# Bug #591 (dynamic loading not working on systems using /usr/lib64)

**URL:** <https://discourse.libsdl.org/t/bug-591-dynamic-loading-not-working-on-systems-using-usr-lib64/15339>\
**Category:** SDL Development\
**Created:** [May 28, 2008, 11:16pm UTC](https://discourse.libsdl.org/t/bug-591-dynamic-loading-not-working-on-systems-using-usr-lib64/15339 "2008-05-28T23:16:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wade\_Berrier](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/w/e495f1/32.png) [@Wade\_Berrier](https://discourse.libsdl.org/u/Wade_Berrier)\
**Post date:** [May 28, 2008, 11:16pm UTC](https://discourse.libsdl.org/t/bug-591-dynamic-loading-not-working-on-systems-using-usr-lib64/15339/1 "2008-05-28T23:16:26Z")

</div>

I tried attaching a patch to the bug report, but got an internal server  
error, so I’ll attach it here (and post it inline).

Index: configure.in===================================================================  
— [configure.in](http://configure.in) (revision 3623)  
+++ [configure.in](http://configure.in) (working copy)  
@@ -287,6 +287,9 @@  
AC\_DEFINE(SDL\_ASSEMBLY\_ROUTINES)  
fi

+dnl set this to use on systems that use lib64 instead of lib  
+base\_libdir=`echo \${libdir} | sed 's/.*\/\(.*\)/\1/; q'`  
+  
dnl See if the OSS audio interface is supported  
CheckOSS()  
{  
@@ -348,12 +351,12 @@  
AC\_HELP\_STRING([–enable-alsa-shared], [dynamically load ALSA audio  
support [[default=yes]]]),  
, enable\_alsa\_shared=yes)  
if test “x`echo $ALSA_LIBS | grep -- -L`” = “x”; then

- 

```
           if test "x`ls /lib/libasound.so.* 2> /dev/null`" !=

```

“x”; then

- 

```
               ALSA_LIBS="-L/lib $ALSA_LIBS"

```

- 

```
           elif test "x`ls /usr/lib/libasound.so.*

```

2\> /dev/null`" != “x”; then

- 

```
               ALSA_LIBS="-L/usr/lib $ALSA_LIBS"

```

- 

```
           elif test "x`ls /usr/local/lib/libasound.so.*

```

2\> /dev/null`" != “x”; then

- 

```
               ALSA_LIBS="-L/usr/local/lib $ALSA_LIBS"

```

- 

```
           if test "x`ls /$base_libdir/libasound.so.*

```

2\> /dev/null`" != “x”; then

- 

```
               ALSA_LIBS="-L/$base_libdir $ALSA_LIBS"

```

- 

```
           elif test "x`ls /usr/$base_libdir/libasound.so.*

```

2\> /dev/null`" != “x”; then

- 

```
               ALSA_LIBS="-L/usr/$base_libdir $ALSA_LIBS"

```

- 

```
           elif test "x`ls /usr/local/$base_libdir/libasound.so.*

```

2\> /dev/null`" != “x”; then

- 

```
               ALSA_LIBS="-L/usr/local/$base_libdir $ALSA_LIBS"
           fi
       fi
       alsa_lib_spec=`echo $ALSA_LIBS | sed 's/.*-L\([[^]]*

```

)._/\1/libasound.so._/'`@@ -501,12 +504,12 @@ AC_HELP_STRING([--enable-pulseaudio-shared], [dynamically load PulseAudio support [[default=yes]]]), , enable_pulse_shared=yes) if test "x`echo $PULSE\_LIBS | grep – -L`" = “x”; then

- 

```
           if test "x`ls /lib/libpulse-simple.so.*

```

2\> /dev/null`" != “x”; then

- 

```
               PULSE_LIBS="-L/lib $PULSE_LIBS"

```

- 

```
           elif test "x`ls /usr/lib/libpulse-simple.so.*

```

2\> /dev/null`" != “x”; then

- 

```
               PULSE_LIBS="-L/usr/lib $PULSE_LIBS"

```

- 

```
           elif test "x`ls /usr/local/lib/libpulse-simple.so.*

```

2\> /dev/null`" != “x”; then

- 

```
               PULSE_LIBS="-L/usr/local/lib $PULSE_LIBS"

```

- 

```
           if test "x`ls /$base_libdir/libpulse-simple.so.*

```

2\> /dev/null`" != “x”; then

- 

```
               PULSE_LIBS="-L/$base_libdir $PULSE_LIBS"

```

- 

```
           elif test "x`ls /usr/$base_libdir/libpulse-simple.so.*

```

2\> /dev/null`" != “x”; then

- 

```
               PULSE_LIBS="-L/usr/$base_libdir $PULSE_LIBS"

```

- 

```
           elif test

```

“x`ls /usr/local/$base_libdir/libpulse-simple.so.* 2> /dev/null`” !=  
“x”; then

- 

```
               PULSE_LIBS="-L/usr/local/$base_libdir $PULSE_LIBS"
           fi
       fi
       pulse_lib_spec=`echo $PULSE_LIBS | sed 's/.*-L\([[^]]*

```

)._/\1/libpulse-simple.so._/’`  
@@ -561,7 +564,7 @@  
AC\_ARG\_ENABLE(arts-shared,  
AC\_HELP\_STRING([–enable-arts-shared], [dynamically load aRts audio  
support [[default=yes]]]),  
, enable\_arts\_shared=yes)

- 

```
           arts_lib_spec="$ARTS_PREFIX/lib/libartsc.so.*"

```

- 

```
           arts_lib_spec="$ARTS_PREFIX/$base_libdir/libartsc.so.*"
           arts_lib=`ls -- $arts_lib_spec | sed 's/.*\/\(.*\)/\1/;

```

q’`  
echo “-- $arts\_lib\_spec -\> $arts\_lib”

@@ -947,7 +950,7 @@  
;;  
\*)  
x11\_lib\_path=[`echo $X_LIBS | sed 's/.*-L\([^]* \).*/\1/'`]

- 

```
               for path in

```

$x11\_lib\_path /usr/lib /usr/X11/lib /usr/X11R6/lib; do

- 

```
               for path in

```

$x11\_lib\_path /usr/$base\_libdir /usr/X11/$base\_libdir /usr/X11R6/$base\_libdir; do  
if test “x$x11\_lib” = “x”; then  
x11\_lib=[`ls -- $path/libX11.so.[0-9] 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]  
if test “x$x11\_lib” = “x”; then

-------------- next part --------------  
A non-text attachment was scrubbed…  
Name: sdl-dynamic\_loading\_x86\_64\_fix.patch  
Type: text/x-patch  
Size: 4071 bytes  
Desc: not available  
URL: [http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20080528/b952887f/attachment.bin](http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20080528/b952887f/attachment.bin)
