- disable shared lib support on Solaris 10 and older (fixes #4973)
authorKarel Gardas <karel.gardas@centrum.cz>
Fri, 8 Apr 2011 16:53:42 +0000 (18:53 +0200)
committerIan Lynagh <igloo@earth.li>
Fri, 8 Apr 2011 20:10:00 +0000 (21:10 +0100)
configure.ac
mk/config.mk.in
mk/project.mk.in

index a8d535f..21e965b 100644 (file)
@@ -222,6 +222,21 @@ x86_64-apple-darwin)
     ;;
 esac
 
+# Testing if we shall enable shared libs support on Solaris.
+# Anything older than SunOS 5.11 aka Solaris 11 (Express) is broken.
+
+SOLARIS_BROKEN_SHLD=NO
+
+case $host in
+     i386-*-solaris2)
+     # here we go with the test
+     MINOR=`uname -r|cut -d '.' -f 2-`
+     if test "$MINOR" -lt "11"; then
+       SOLARIS_BROKEN_SHLD=YES
+     fi
+     ;;
+esac
+
 # Sync this with cTargetArch in compiler/ghc.mk
 checkArch() {
     case $1 in
@@ -322,6 +337,8 @@ AC_SUBST(TargetVendor_CPP)
 AC_SUBST(exeext)
 AC_SUBST(soext)
 
+AC_SUBST(SOLARIS_BROKEN_SHLD)
+
 AC_ARG_WITH(hc,
 [AC_HELP_STRING([--with-hc=ARG],
         [Use ARG as the path to the compiler for compiling ordinary
index 4de412e..e5b6811 100644 (file)
@@ -104,13 +104,18 @@ GhcDynamic=NO
 GhcProfiled=NO
 
 # Do we support shared libs?
-PlatformSupportsSharedLibs = $(if $(filter $(TARGETPLATFORM),\
-       i386-unknown-linux x86_64-unknown-linux \
+SharedLibsPlatformList = i386-unknown-linux x86_64-unknown-linux \
        i386-unknown-freebsd x86_64-unknown-freebsd \
        i386-unknown-openbsd x86_64-unknown-openbsd \
        i386-unknown-mingw32 \
-       i386-unknown-solaris2 \
-       i386-apple-darwin powerpc-apple-darwin),YES,NO)
+       i386-apple-darwin powerpc-apple-darwin
+
+ifeq ($(SOLARIS_BROKEN_SHLD), NO)
+SharedLibsPlatformList := $(SharedLibsPlatformList) i386-unknown-solaris2
+endif
+
+PlatformSupportsSharedLibs = $(if $(filter $(TARGETPLATFORM),\
+       $(SharedLibsPlatformList)),YES,NO)
 
 # Build a compiler that will build *unregisterised* libraries and
 # binaries by default.  Unregisterised code is supposed to compile and
index 3ceef15..58b0f1a 100644 (file)
@@ -139,3 +139,7 @@ endif
 # This distinguishes "msys" and "cygwin", which are not
 # not distinguished by HOST_OS_CPP
 OSTYPE=@OSTYPE@
+
+# In case of Solaris OS, does it provide broken shared libs
+# linker or not?
+SOLARIS_BROKEN_SHLD=@SOLARIS_BROKEN_SHLD@