From 904bd7ce42e2a8b7c440fcebc2a04c7b15232def Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 26 Sep 2009 09:16:01 +0000 Subject: [PATCH] O.Sezer 2008-03-12 10:00:55 PDT FLAC support, as implemented in SDL_mixer requires flac version >= 1.1.3 : I have 1.1.2 installed and it surely fails compiling. Can you add a check for defined(FLAC_API_VERSION_CURRENT) && (FLAC_API_VERSION_CURRENT >= 8) in the configure scripts (or document this requirement) please? --- configure.in | 76 ++++++++++++++++++++++++++++++++++------------------ 1 file changed, 50 insertions(+), 26 deletions(-) diff --git a/configure.in b/configure.in index 39db5e30..f559e011 100644 --- a/configure.in +++ b/configure.in @@ -318,6 +318,7 @@ if test x$enable_music_ogg = xyes; then fi fi fi +libflac_ver=8 AC_ARG_ENABLE([music-flac], AC_HELP_STRING([--enable-music-flac], [enable FLAC music [[default=yes]]]), [], [enable_music_flac=yes]) @@ -326,32 +327,55 @@ AC_HELP_STRING([--enable-music-flac-shared], [dynamically load FLAC support [[default=yes]]]), [], [enable_music_flac_shared=yes]) if test x$enable_music_flac = xyes; then - AC_CHECK_HEADER([FLAC/stream_decoder.h], [have_flac_hdr=yes]) - AC_CHECK_LIB([FLAC], [FLAC__stream_decoder_new], [have_flac_lib=yes]) - if test x$have_flac_hdr = xyes -a x$have_flac_lib = xyes; then - case "$host" in - *-*-darwin*) - flac_lib=[`find_lib FLAC*.dylib`] - ;; - *-*-cygwin* | *-*-mingw32*) - flac_lib=[`find_lib "libFLAC*.dll"`] - ;; - *) - flac_lib=[`find_lib "libFLAC.so.[0-9]"`] - if test x$flac_lib = x; then - flac_lib=[`find_lib "libFLAC.so.[0-9]*"`] - fi - ;; - esac - SOURCES="$SOURCES $srcdir/*_flac.c" - EXTRA_CFLAGS="$EXTRA_CFLAGS -DFLAC_MUSIC" - if test x$enable_music_flac_shared = xyes && test x$flac_lib != x; then - echo "-- dynamic libFLAC -> $flac_lib" - EXTRA_CFLAGS="$EXTRA_CFLAGS -DFLAC_DYNAMIC=\\\"$flac_lib\\\"" - else - EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lFLAC" - fi - fi + AC_CHECK_HEADER([FLAC/export.h], [have_flac_export=yes]) + if test x$have_flac_export = xyes; then + LIBS_SAVED="$LIBS" + LIBS="-lFLAC" + AC_MSG_CHECKING([for libflac so-name version >= $libflac_ver]) + AC_TRY_RUN([ +#include "FLAC/export.h" +#include "stdio.h" +int main( int argc, char *argv[] ) { +#if defined(FLAC_API_VERSION_CURRENT) && (FLAC_API_VERSION_CURRENT >= $libflac_ver) + return 0; +#else + return 1; +#endif +} +], have_flac_ver=yes, have_flac_ver=no) + LIBS="$LIBS_SAVED" + AC_MSG_RESULT($have_flac_ver) + if test x$have_flac_ver = xno; then + echo "*** FLAC support has been disabled." + else + AC_CHECK_HEADER([FLAC/stream_decoder.h], [have_flac_hdr=yes]) + AC_CHECK_LIB([FLAC], [FLAC__stream_decoder_new], [have_flac_lib=yes]) + if test x$have_flac_hdr = xyes -a x$have_flac_lib = xyes; then + case "$host" in + *-*-darwin*) + flac_lib=[`find_lib FLAC*.dylib`] + ;; + *-*-cygwin* | *-*-mingw32*) + flac_lib=[`find_lib "libFLAC*.dll"`] + ;; + *) + flac_lib=[`find_lib "libFLAC.so.[0-9]"`] + if test x$flac_lib = x; then + flac_lib=[`find_lib "libFLAC.so.[0-9]*"`] + fi + ;; + esac + SOURCES="$SOURCES $srcdir/*_flac.c" + EXTRA_CFLAGS="$EXTRA_CFLAGS -DFLAC_MUSIC" + if test x$enable_music_flac_shared = xyes && test x$flac_lib != x; then + echo "-- dynamic libFLAC -> $flac_lib" + EXTRA_CFLAGS="$EXTRA_CFLAGS -DFLAC_DYNAMIC=\\\"$flac_lib\\\"" + else + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lFLAC" + fi + fi + fi + fi fi AC_ARG_ENABLE(music-mp3, [ --enable-music-mp3 enable MP3 music via smpeg [[default=yes]]],