Fixed attempting to dynamically load libsamplerate when shared object loading is disabled.
authorSam Lantinga <slouken@libsdl.org>
Sun, 08 Jan 2017 10:52:02 -0800
changeset 107872a0bcfc4d35c
parent 10786 602fec42fe09
child 10788 e84df023acd5
Fixed attempting to dynamically load libsamplerate when shared object loading is disabled.
Thanks to Ozkan Sezer for pointing this out
configure
configure.in
     1.1 --- a/configure	Sun Jan 08 10:41:22 2017 -0800
     1.2 +++ b/configure	Sun Jan 08 10:52:02 2017 -0800
     1.3 @@ -18730,16 +18730,23 @@
     1.4  fi
     1.5  
     1.6  
     1.7 -            if test x$enable_libsamplerate_shared = xyes; then
     1.8 -                samplerate_lib=`find_lib "libsamplerate.so.*" "" | sed 's/.*\/\(.*\)/\1/; q'`
     1.9 -                if test x$samplerate_lib != x; then
    1.10 -                    echo "-- dynamic samplerate -> $samplerate_lib"
    1.11 +            samplerate_lib=`find_lib "libsamplerate.so.*" "" | sed 's/.*\/\(.*\)/\1/; q'`
    1.12 +
    1.13 +            if test x$have_loadso != xyes && \
    1.14 +               test x$enable_libsamplerate_shared = xyes; then
    1.15 +                { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You must have SDL_LoadObject() support for dynamic libsamplerate loading" >&5
    1.16 +$as_echo "$as_me: WARNING: You must have SDL_LoadObject() support for dynamic libsamplerate loading" >&2;}
    1.17 +            fi
    1.18 +            if test x$have_loadso = xyes && \
    1.19 +               test x$enable_libsamplerate_shared = xyes && test x$samplerate_lib != x; then
    1.20 +                echo "-- dynamic libsamplerate -> $samplerate_lib"
    1.21  
    1.22  cat >>confdefs.h <<_ACEOF
    1.23  #define SDL_LIBSAMPLERATE_DYNAMIC "$samplerate_lib"
    1.24  _ACEOF
    1.25  
    1.26 -                fi
    1.27 +            else
    1.28 +                EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lsamplerate"
    1.29              fi
    1.30          fi
    1.31      fi
     2.1 --- a/configure.in	Sun Jan 08 10:41:22 2017 -0800
     2.2 +++ b/configure.in	Sun Jan 08 10:52:02 2017 -0800
     2.3 @@ -1144,12 +1144,18 @@
     2.4  AC_HELP_STRING([--enable-libsamplerate-shared], [dynamically load libsamplerate [[default=yes]]]),
     2.5                            , enable_libsamplerate_shared=yes)
     2.6  
     2.7 -            if test x$enable_libsamplerate_shared = xyes; then
     2.8 -                samplerate_lib=[`find_lib "libsamplerate.so.*" "" | sed 's/.*\/\(.*\)/\1/; q'`]
     2.9 -                if test x$samplerate_lib != x; then
    2.10 -                    echo "-- dynamic samplerate -> $samplerate_lib"
    2.11 -                    AC_DEFINE_UNQUOTED(SDL_LIBSAMPLERATE_DYNAMIC, "$samplerate_lib", [ ])
    2.12 -                fi
    2.13 +            samplerate_lib=[`find_lib "libsamplerate.so.*" "" | sed 's/.*\/\(.*\)/\1/; q'`]
    2.14 +
    2.15 +            if test x$have_loadso != xyes && \
    2.16 +               test x$enable_libsamplerate_shared = xyes; then
    2.17 +                AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic libsamplerate loading])
    2.18 +            fi
    2.19 +            if test x$have_loadso = xyes && \
    2.20 +               test x$enable_libsamplerate_shared = xyes && test x$samplerate_lib != x; then
    2.21 +                echo "-- dynamic libsamplerate -> $samplerate_lib"
    2.22 +                AC_DEFINE_UNQUOTED(SDL_LIBSAMPLERATE_DYNAMIC, "$samplerate_lib", [ ])
    2.23 +            else
    2.24 +                EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lsamplerate"
    2.25              fi
    2.26          fi
    2.27      fi