configure.in
changeset 382 50501e45c57b
parent 374 9f79d3a5eda1
child 392 c9adf3866e87
     1.1 --- a/configure.in	Tue Feb 26 11:46:22 2008 +0000
     1.2 +++ b/configure.in	Wed Feb 27 07:31:03 2008 +0000
     1.3 @@ -318,6 +318,41 @@
     1.4          fi
     1.5      fi
     1.6  fi
     1.7 +AC_ARG_ENABLE([music-flac],
     1.8 +AC_HELP_STRING([--enable-music-flac], [enable FLAC music [[default=yes]]]),
     1.9 +              [], [enable_music_flac=yes])
    1.10 +AC_ARG_ENABLE([music-flac-shared],
    1.11 +AC_HELP_STRING([--enable-music-flac-shared],
    1.12 +              [dynamically load FLAC support [[default=yes]]]),
    1.13 +              [], [enable_music_flac_shared=yes])
    1.14 +if test x$enable_music_flac = xyes; then
    1.15 +    AC_CHECK_HEADER([FLAC/stream_decoder.h], [have_flac_hdr=yes])
    1.16 +    AC_CHECK_LIB([FLAC], [FLAC__stream_decoder_new], [have_flac_lib=yes])
    1.17 +    if test x$have_flac_hdr = xyes -a x$have_flac_lib = xyes; then
    1.18 +        case "$host" in
    1.19 +            *-*-darwin*)
    1.20 +                flac_lib=[`find_lib FLAC*.dylib`]
    1.21 +                ;;
    1.22 +            *-*-cygwin* | *-*-mingw32*)
    1.23 +                flac_lib=[`find_lib "libFLAC*.dll"`]
    1.24 +                ;;
    1.25 +            *)
    1.26 +                flac_lib=[`find_lib "libFLAC.so.[0-9]"`]
    1.27 +                if test x$flac_lib = x; then
    1.28 +                    flac_lib=[`find_lib "libFLAC.so.[0-9]*"`]
    1.29 +                fi
    1.30 +                ;;
    1.31 +        esac
    1.32 +        SOURCES="$SOURCES $srcdir/*_flac.c"
    1.33 +        EXTRA_CFLAGS="$EXTRA_CFLAGS -DFLAC_MUSIC"
    1.34 +        if test x$enable_music_flac_shared = xyes && test x$flac_lib != x; then
    1.35 +            echo "-- dynamic libFLAC -> $flac_lib"
    1.36 +            EXTRA_CFLAGS="$EXTRA_CFLAGS -DFLAC_DYNAMIC=\\\"$flac_lib\\\""
    1.37 +        else
    1.38 +            EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lFLAC"
    1.39 +        fi
    1.40 +    fi
    1.41 +fi
    1.42  AC_ARG_ENABLE(music-mp3,
    1.43  [  --enable-music-mp3      enable MP3 music via smpeg [[default=yes]]],
    1.44                , enable_music_mp3=yes)