Fix pulseaudio dynamic linking for Solaris builds. SDL-1.2
authorShawn Walker <eviltypeguy@icculus.org>
Tue, 19 Feb 2013 22:05:52 +0000
branchSDL-1.2
changeset 6909 6cccc0beb880
parent 6908 8b9fcdd925d8
child 6935 b6b2829cd7ef
Fix pulseaudio dynamic linking for Solaris builds. Don't link to unnecessary filter libraries for pthread and rt on Solaris.
configure.in
--- a/configure.in	Tue Feb 19 22:04:50 2013 +0000
+++ b/configure.in	Tue Feb 19 22:05:52 2013 +0000
@@ -553,6 +553,14 @@
                test x$enable_pulseaudio_shared = xyes && test x$pulse_lib != x; then
                 echo "-- dynamic libpulse-simple -> $pulse_lib"
                 AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_PULSE_DYNAMIC, "$pulse_lib")
+
+                case "$host" in
+                    # On Solaris, pulseaudio must be linked deferred explicitly
+                    # to prevent undefined symbol failures.
+                    *-*-solaris*)
+                        PULSE_LIBS=`echo $PULSE_LIBS | sed 's/\-l/-Wl,-l/g'`
+                        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-zdeferred $PULSE_LIBS -Wl,-znodeferred"
+                esac
             else
                 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $PULSE_LIBS"
             fi
@@ -851,7 +859,7 @@
             have_altivec_h_hdr=yes
             ])
             AC_MSG_RESULT($have_gcc_altivec)
-	fi
+        fi
 
         if test x$have_gcc_altivec = xno; then
             AC_MSG_CHECKING(for Altivec with GCC -faltivec option)
@@ -1918,9 +1926,20 @@
             pthread_cflags="-D_REENTRANT"
             pthread_lib="-pthread"
             ;;
-        *-*-solaris*)
+        *-*-solaris2.9)
+            # From Solaris 9+, posix4's preferred name is rt.
             pthread_cflags="-D_REENTRANT"
-            pthread_lib="-lpthread -lposix4"
+            pthread_lib="-lpthread -lrt"
+            ;;
+        *-*-solaris2.10)
+            # Solaris 10+ merged pthread into libc.
+            pthread_cflags="-D_REENTRANT"
+            pthread_lib="-lrt"
+            ;;
+        *-*-solaris*)
+            # Solaris 11+ merged rt into libc.
+            pthread_cflags="-D_REENTRANT"
+            pthread_lib=""
             ;;
         *-*-sysv5*)
             pthread_cflags="-D_REENTRANT -Kthread"