Ticket #8315: configure-flac.diff

File configure-flac.diff, 2.5 KB (added by SF/nolange, 21 years ago)

gjasny`s Configure-Patch

  • configure

    RCS file: /cvsroot/scummvm/scummvm/configure,v
    retrieving revision 1.65
    diff -u -3 -p -r1.65 configure
    CXXFLAGS="$CXXFLAGS $CPPFLAGS"  
    2626
    2727# default lib behaviour yes/no/auto
    2828_vorbis=auto
     29_flac=auto
    2930_mad=auto
    3031_alsa=auto
    3132_zlib=auto
    Optional Libraries:  
    199200  --with-ogg-prefix=PFX    Prefix where libogg is installed (optional)
    200201  --with-vorbis-prefix=PFX Prefix where libvorbis is installed (optional)
    201202  --disable-vorbis         disable Ogg Vorbis support [autodetect]
     203  --with-flac-prefix=PFX   Prefix where libFLAC is installed (optional)
     204  --disable-flac           disable FLAC support [autodetect]
    202205  --with-mad-prefix=PFX    Prefix where libmad is installed (optional)
    203206  --disable-mad            disable libmad (MP3) support [autodetect]
    204207  --with-zlib-prefix=PFX   Prefix where zlib is installed (optional)
    for ac_option in $@; do  
    226229      --disable-alsa)           _alsa=no        ;;
    227230      --enable-vorbis)          _vorbis=yes     ;;
    228231      --disable-vorbis)         _vorbis=no      ;;
     232      --enable-flac)            _flac=yes       ;;
     233      --disable-flac)           _flac=no        ;;
    229234      --enable-mad)             _mad=yes        ;;
    230235      --disable-mad)            _mad=no         ;;
    231236      --enable-zlib)            _zlib=yes       ;;
    for ac_option in $@; do  
    251256        VORBIS_CFLAGS="-I$_prefix/include"
    252257        VORBIS_LIBS="-L$_prefix/lib"
    253258        ;;
     259      --with-flac-prefix=*)
     260        _prefix=`echo $ac_option | cut -d '=' -f 2`
     261        FLAC_CFLAGS="-I$_prefix/include"
     262        FLAC_LIBS="-L$_prefix/lib"
     263        ;;
    254264      --with-mad-prefix=*)
    255265        _prefix=`echo $ac_option | cut -d '=' -f 2`
    256266        MAD_CFLAGS="-I$_prefix/include"
    else  
    566576fi
    567577echo "$_vorbis"
    568578
     579echocheck "FLAC"
     580if test "$_flac" = auto ; then
     581  _flac=no
     582  cat > $TMPC << EOF
     583#include <FLAC/seekable_stream_decoder.h>
     584int main(void) { FLAC__seekable_stream_decoder_init( 0 ); return 0; }
     585EOF
     586  cc_check $LDFLAGS $CXXFLAGS $FLAC_CFLAGS $FLAY_LIBS \
     587  -lFLAC -lm && _flac=yes
     588fi
     589if test "$_flac" = yes ; then
     590  _def_flac='#define USE_FLAC'
     591  LIBS="$LIBS $FLAC_LIBS -lFLAC"
     592  INCLUDES="$INCLUDES $FLAC_CFLAGS"
     593else
     594  _def_flac='#undef USE_FLAC'
     595fi
     596echo "$_flac"
     597
    569598echocheck "MAD"
    570599if test "$_mad" = auto ; then
    571600  _mad=no
    typedef signed $type_4_byte int32;  
    738767
    739768/* Libs */
    740769$_def_vorbis
     770$_def_flac
    741771$_def_mad
    742772$_def_alsa
    743773$_def_zlib