Fixed attempting to dynamically load libsamplerate when shared object loading is disabled. Thanks to Ozkan Sezer for pointing this out
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
diff --git a/configure b/configure
index 1babfd1..5506037 100755
--- a/configure
+++ b/configure
@@ -18730,16 +18730,23 @@ else
fi
- if test x$enable_libsamplerate_shared = xyes; then
- samplerate_lib=`find_lib "libsamplerate.so.*" "" | sed 's/.*\/\(.*\)/\1/; q'`
- if test x$samplerate_lib != x; then
- echo "-- dynamic samplerate -> $samplerate_lib"
+ samplerate_lib=`find_lib "libsamplerate.so.*" "" | sed 's/.*\/\(.*\)/\1/; q'`
+
+ if test x$have_loadso != xyes && \
+ test x$enable_libsamplerate_shared = xyes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You must have SDL_LoadObject() support for dynamic libsamplerate loading" >&5
+$as_echo "$as_me: WARNING: You must have SDL_LoadObject() support for dynamic libsamplerate loading" >&2;}
+ fi
+ if test x$have_loadso = xyes && \
+ test x$enable_libsamplerate_shared = xyes && test x$samplerate_lib != x; then
+ echo "-- dynamic libsamplerate -> $samplerate_lib"
cat >>confdefs.h <<_ACEOF
#define SDL_LIBSAMPLERATE_DYNAMIC "$samplerate_lib"
_ACEOF
- fi
+ else
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lsamplerate"
fi
fi
fi
diff --git a/configure.in b/configure.in
index 47007c0..7f8d5db 100644
--- a/configure.in
+++ b/configure.in
@@ -1144,12 +1144,18 @@ AC_HELP_STRING([--enable-libsamplerate], [use libsamplerate for audio rate conve
AC_HELP_STRING([--enable-libsamplerate-shared], [dynamically load libsamplerate [[default=yes]]]),
, enable_libsamplerate_shared=yes)
- if test x$enable_libsamplerate_shared = xyes; then
- samplerate_lib=[`find_lib "libsamplerate.so.*" "" | sed 's/.*\/\(.*\)/\1/; q'`]
- if test x$samplerate_lib != x; then
- echo "-- dynamic samplerate -> $samplerate_lib"
- AC_DEFINE_UNQUOTED(SDL_LIBSAMPLERATE_DYNAMIC, "$samplerate_lib", [ ])
- fi
+ samplerate_lib=[`find_lib "libsamplerate.so.*" "" | sed 's/.*\/\(.*\)/\1/; q'`]
+
+ if test x$have_loadso != xyes && \
+ test x$enable_libsamplerate_shared = xyes; then
+ AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic libsamplerate loading])
+ fi
+ if test x$have_loadso = xyes && \
+ test x$enable_libsamplerate_shared = xyes && test x$samplerate_lib != x; then
+ echo "-- dynamic libsamplerate -> $samplerate_lib"
+ AC_DEFINE_UNQUOTED(SDL_LIBSAMPLERATE_DYNAMIC, "$samplerate_lib", [ ])
+ else
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lsamplerate"
fi
fi
fi