Date: Mon, 22 Aug 2005 04:22:46 -0400
authorSam Lantinga <slouken@libsdl.org>
Tue, 23 Aug 2005 06:36:23 +0000
changeset 1127fb8818ee9112
parent 1126 d581fe3f36db
child 1128 9bad9361d390
Date: Mon, 22 Aug 2005 04:22:46 -0400
From: "Ryan C. Gordon"
Subject: [Fwd: SDL patch: make usage of rpath optional]

Here's a small patch against current SDL CVS that makes usage of rpath
optional, by passing --disable-rpath to configure. This comes in handy
when redistributing SDL -- the rpath setting prevents the lib being
loaded if it's not in the rpath, which makes redistributing in packages
to be installed by non-root users pretty much useless.
configure.in
     1.1 --- a/configure.in	Mon Aug 22 14:38:31 2005 +0000
     1.2 +++ b/configure.in	Tue Aug 23 06:36:23 2005 +0000
     1.3 @@ -1864,6 +1864,14 @@
     1.4      fi
     1.5  }
     1.6  
     1.7 +dnl Check if we want to use RPATH
     1.8 +CheckRPATH()
     1.9 +{
    1.10 +    AC_ARG_ENABLE(rpath,
    1.11 +[  --enable-rpath          use an rpath when linking SDL [default=yes]],
    1.12 +                  , enable_rpath=yes)
    1.13 +}
    1.14 +
    1.15  case "$target" in
    1.16      *-*-linux*|*-*-gnu*|*-*-k*bsd*-gnu)
    1.17          case "$target" in
    1.18 @@ -1899,6 +1907,7 @@
    1.19          CheckSIGACTION
    1.20          CheckAltivec
    1.21          CheckLinuxVersion
    1.22 +        CheckRPATH
    1.23  
    1.24          # Set up files for the main() stub
    1.25          if test "x$video_qtopia" = "xyes"; then
    1.26 @@ -1976,6 +1985,7 @@
    1.27          CheckOpenGL
    1.28          CheckPTHREAD
    1.29          CheckSIGACTION
    1.30 +        CheckRPATH
    1.31          # Set up files for the audio library
    1.32          # We use the OSS and ALSA API's, not the Sun audio API
    1.33          #if test x$enable_audio = xyes; then
    1.34 @@ -2022,6 +2032,7 @@
    1.35          CheckPTHREAD
    1.36          CheckSIGACTION
    1.37          CheckUSBHID
    1.38 +        CheckRPATH
    1.39          # Set up files for the audio library
    1.40          # We use the OSS and ALSA API's, not the Sun audio API
    1.41          #if test x$enable_audio = xyes; then
    1.42 @@ -2059,6 +2070,7 @@
    1.43          CheckPTHREAD
    1.44          CheckSIGACTION
    1.45          CheckUSBHID
    1.46 +        CheckRPATH
    1.47          # Set up files for the audio library
    1.48          if test x$enable_audio = xyes; then
    1.49              CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
    1.50 @@ -2100,6 +2112,7 @@
    1.51          CheckPTHREAD
    1.52          CheckSIGACTION
    1.53          CheckUSBHID
    1.54 +        CheckRPATH
    1.55          # Set up files for the audio library
    1.56          if test x$enable_audio = xyes; then
    1.57              CFLAGS="$CFLAGS -DOPENBSD_AUDIO_SUPPORT"
    1.58 @@ -2141,6 +2154,7 @@
    1.59          CheckOpenGL
    1.60          CheckPTHREAD
    1.61          CheckSIGACTION
    1.62 +        CheckRPATH
    1.63          # Set up files for the audio library
    1.64          if test x$enable_audio = xyes; then
    1.65              CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
    1.66 @@ -2183,6 +2197,7 @@
    1.67          CheckOpenGL
    1.68          CheckPTHREAD
    1.69          CheckSIGACTION
    1.70 +        CheckRPATH
    1.71          # Set up files for the audio library
    1.72          if test x$enable_audio = xyes; then
    1.73              CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
    1.74 @@ -2739,11 +2754,15 @@
    1.75  
    1.76  # Set runtime shared library paths as needed
    1.77  
    1.78 -if test $ARCH = linux -o $ARCH = freebsd -o $ARCH = bsdi; then
    1.79 -  SDL_RLD_FLAGS="-Wl,-rpath,\${exec_prefix}/lib"
    1.80 -fi
    1.81 -if test $ARCH = solaris; then
    1.82 -  SDL_RLD_FLAGS="-R\${exec_prefix}/lib"
    1.83 +if test "x$enable_rpath" = "xyes"; then
    1.84 +  if test $ARCH = linux -o $ARCH = freebsd -o $ARCH = bsdi; then
    1.85 +    SDL_RLD_FLAGS="-Wl,-rpath,\${exec_prefix}/lib"
    1.86 +  fi
    1.87 +  if test $ARCH = solaris; then
    1.88 +    SDL_RLD_FLAGS="-R\${exec_prefix}/lib"
    1.89 +  fi
    1.90 +else
    1.91 +  SDL_RLD_FLAGS=""
    1.92  fi
    1.93  
    1.94  case "$ARCH" in