From aa6ec62e9db78db12912d0e48025241c5d7ef4f7 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sun, 22 Feb 2004 14:11:16 +0000 Subject: Patch #885904 (Flac Support) with some tweaks by me svn-id: r12984 --- configure | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'configure') diff --git a/configure b/configure index 0808696ce5..cd5433d80d 100755 --- a/configure +++ b/configure @@ -26,6 +26,7 @@ CXXFLAGS="$CXXFLAGS $CPPFLAGS" # default lib behaviour yes/no/auto _vorbis=auto +_flac=auto _mad=auto _alsa=auto _zlib=auto @@ -207,6 +208,9 @@ Optional Libraries: --with-mad-prefix=PFX Prefix where libmad is installed (optional) --disable-mad disable libmad (MP3) support [autodetect] + + --with-flac-prefix=PFX Prefix where libFLAC is installed (optional) + --disable-flac disable FLAC support [autodetect] --with-zlib-prefix=PFX Prefix where zlib is installed (optional) --disable-zlib disable zlib (compression) support [autodetect] @@ -243,6 +247,8 @@ for ac_option in $@; do --disable-alsa) _alsa=no ;; --enable-vorbis) _vorbis=yes ;; --disable-vorbis) _vorbis=no ;; + --enable-flac) _flac=yes ;; + --disable-flac) _flac=no ;; --enable-mad) _mad=yes ;; --disable-mad) _mad=no ;; --enable-zlib) _zlib=yes ;; @@ -269,6 +275,11 @@ for ac_option in $@; do VORBIS_CFLAGS="-I$_prefix/include" VORBIS_LIBS="-L$_prefix/lib" ;; + --with-flac-prefix=*) + _prefix=`echo $ac_option | cut -d '=' -f 2` + FLAC_CFLAGS="-I$_prefix/include" + FLAC_LIBS="-L$_prefix/lib" + ;; --with-mad-prefix=*) _prefix=`echo $ac_option | cut -d '=' -f 2` MAD_CFLAGS="-I$_prefix/include" @@ -622,6 +633,25 @@ else fi echo "$_vorbis" +echocheck "FLAC" +if test "$_flac" = auto ; then + _flac=no + cat > $TMPC << EOF +#include +int main(void) { FLAC__seekable_stream_decoder_init( 0 ); return 0; } +EOF + cc_check $LDFLAGS $CXXFLAGS $FLAC_CFLAGS $FLAY_LIBS \ + -lFLAC -lm && _flac=yes +fi +if test "$_flac" = yes ; then + _def_flac='#define USE_FLAC' + LIBS="$LIBS $FLAC_LIBS -lFLAC" + INCLUDES="$INCLUDES $FLAC_CFLAGS" +else + _def_flac='#undef USE_FLAC' +fi +echo "$_flac" + # # Check for MAD (MP3 library) # @@ -809,6 +839,7 @@ typedef signed $type_4_byte int32; /* Libs */ $_def_vorbis +$_def_flac $_def_mad $_def_alsa $_def_zlib -- cgit v1.2.3