configure.in
changeset 1127 fb8818ee9112
parent 1062 3e637850c02b
child 1133 609c060fd2a2
--- a/configure.in	Mon Aug 22 14:38:31 2005 +0000
+++ b/configure.in	Tue Aug 23 06:36:23 2005 +0000
@@ -1864,6 +1864,14 @@
     fi
 }
 
+dnl Check if we want to use RPATH
+CheckRPATH()
+{
+    AC_ARG_ENABLE(rpath,
+[  --enable-rpath          use an rpath when linking SDL [default=yes]],
+                  , enable_rpath=yes)
+}
+
 case "$target" in
     *-*-linux*|*-*-gnu*|*-*-k*bsd*-gnu)
         case "$target" in
@@ -1899,6 +1907,7 @@
         CheckSIGACTION
         CheckAltivec
         CheckLinuxVersion
+        CheckRPATH
 
         # Set up files for the main() stub
         if test "x$video_qtopia" = "xyes"; then
@@ -1976,6 +1985,7 @@
         CheckOpenGL
         CheckPTHREAD
         CheckSIGACTION
+        CheckRPATH
         # Set up files for the audio library
         # We use the OSS and ALSA API's, not the Sun audio API
         #if test x$enable_audio = xyes; then
@@ -2022,6 +2032,7 @@
         CheckPTHREAD
         CheckSIGACTION
         CheckUSBHID
+        CheckRPATH
         # Set up files for the audio library
         # We use the OSS and ALSA API's, not the Sun audio API
         #if test x$enable_audio = xyes; then
@@ -2059,6 +2070,7 @@
         CheckPTHREAD
         CheckSIGACTION
         CheckUSBHID
+        CheckRPATH
         # Set up files for the audio library
         if test x$enable_audio = xyes; then
             CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
@@ -2100,6 +2112,7 @@
         CheckPTHREAD
         CheckSIGACTION
         CheckUSBHID
+        CheckRPATH
         # Set up files for the audio library
         if test x$enable_audio = xyes; then
             CFLAGS="$CFLAGS -DOPENBSD_AUDIO_SUPPORT"
@@ -2141,6 +2154,7 @@
         CheckOpenGL
         CheckPTHREAD
         CheckSIGACTION
+        CheckRPATH
         # Set up files for the audio library
         if test x$enable_audio = xyes; then
             CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
@@ -2183,6 +2197,7 @@
         CheckOpenGL
         CheckPTHREAD
         CheckSIGACTION
+        CheckRPATH
         # Set up files for the audio library
         if test x$enable_audio = xyes; then
             CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
@@ -2739,11 +2754,15 @@
 
 # Set runtime shared library paths as needed
 
-if test $ARCH = linux -o $ARCH = freebsd -o $ARCH = bsdi; then
-  SDL_RLD_FLAGS="-Wl,-rpath,\${exec_prefix}/lib"
-fi
-if test $ARCH = solaris; then
-  SDL_RLD_FLAGS="-R\${exec_prefix}/lib"
+if test "x$enable_rpath" = "xyes"; then
+  if test $ARCH = linux -o $ARCH = freebsd -o $ARCH = bsdi; then
+    SDL_RLD_FLAGS="-Wl,-rpath,\${exec_prefix}/lib"
+  fi
+  if test $ARCH = solaris; then
+    SDL_RLD_FLAGS="-R\${exec_prefix}/lib"
+  fi
+else
+  SDL_RLD_FLAGS=""
 fi
 
 case "$ARCH" in