;;
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
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
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
# 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@