Skip to content

Commit

Permalink
O.Sezer 2008-03-12 10:00:55 PDT
Browse files Browse the repository at this point in the history
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?
  • Loading branch information
slouken committed Sep 26, 2009
1 parent 256a383 commit 904bd7c
Showing 1 changed file with 50 additions and 26 deletions.
76 changes: 50 additions & 26 deletions configure.in
Expand Up @@ -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])
Expand All @@ -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]]],
Expand Down

0 comments on commit 904bd7c

Please sign in to comment.