Ticket #8738: configure.patch

File configure.patch, 11.2 KB (added by salty-horse, 16 years ago)
  • configure

     
    1818# Borrowed from the Sane configure script
    1919
    2020if test "$ac_emxsupport" != "no" -a "$ac_emxsupport" != "NO"; then
    21   ac_save_IFS="$IFS"
    22   IFS="\\"
    23   ac_TEMP_PATH=
    24   for ac_dir in $PATH; do
    25     IFS=$ac_save_IFS
    26     if test -z "$ac_TEMP_PATH"; then
    27       ac_TEMP_PATH="$ac_dir"
    28     else
    29       ac_TEMP_PATH="$ac_TEMP_PATH/$ac_dir"
    30     fi
    31   done
    32   PATH="$ac_TEMP_PATH"
    33   export PATH
    34   unset ac_TEMP_PATH
     21        ac_save_IFS="$IFS"
     22        IFS="\\"
     23        ac_TEMP_PATH=
     24        for ac_dir in $PATH; do
     25                IFS=$ac_save_IFS
     26                if test -z "$ac_TEMP_PATH"; then
     27                        ac_TEMP_PATH="$ac_dir"
     28                else
     29                        ac_TEMP_PATH="$ac_TEMP_PATH/$ac_dir"
     30                fi
     31        done
     32        PATH="$ac_TEMP_PATH"
     33        export PATH
     34        unset ac_TEMP_PATH
    3535fi
    3636
    3737
     
    477477#
    478478
    479479for parm in "$@" ; do
    480   if test "$parm" = "--help" || test "$parm" = "-help" || test "$parm" = "-h" ; then
    481     for engine in $_engines; do
    482       engines_help="$engines_help`show_engine_help $engine`
     480        if test "$parm" = "--help" || test "$parm" = "-help" || test "$parm" = "-h" ; then
     481                for engine in $_engines; do
     482                        engines_help="$engines_help`show_engine_help $engine`
    483483"
    484     done
    485     cat << EOF
     484                done
     485                cat << EOF
    486486
    487487Usage: $0 [OPTIONS]...
    488488
     
    550550            headers in a nonstandard directory <include dir>
    551551
    552552EOF
    553     exit 0
    554   fi
     553                exit 0
     554        fi
    555555done # for parm in ...
    556556
    557557DEBFLAGS="-g"
    558558
    559559option_error() {
    560     echo "error: unrecognised option: $ac_option
     560        echo "error: unrecognised option: $ac_option
    561561Try \`$0 --help' for more information." >&2
    562     exit 1
     562        exit 1
    563563}
    564564
    565565for ac_option in $@; do
    566     case "$ac_option" in
    567       --disable-hq-scalers)     _build_hq_scalers=no ;;
    568       --disable-scalers)        _build_scalers=no ;;
    569       --enable-alsa)            _alsa=yes       ;;
    570       --disable-alsa)           _alsa=no        ;;
    571       --enable-vorbis)          _vorbis=yes     ;;
    572       --disable-vorbis)         _vorbis=no      ;;
    573       --enable-tremor)          _tremor=yes     ;;
    574       --disable-tremor)         _tremor=no      ;;
    575       --enable-flac)            _flac=yes       ;;
    576       --disable-flac)           _flac=no        ;;
    577       --enable-mad)             _mad=yes        ;;
    578       --disable-mad)            _mad=no         ;;
    579       --enable-zlib)            _zlib=yes       ;;
    580       --disable-zlib)           _zlib=no        ;;
    581       --enable-nasm)            _nasm=yes       ;;
    582       --disable-nasm)           _nasm=no        ;;
    583       --disable-mpeg2)          _mpeg2=no       ;;
    584       --disable-fluidsynth)     _fluidsynth=no  ;;
    585       --enable-plugins)         _build_plugins=yes ;;
    586       --enable-mt32emu)         _mt32emu=yes    ;;
    587       --disable-mt32emu)        _mt32emu=no     ;;
    588       --with-fluidsynth-prefix=*)
    589         arg=`echo $ac_option | cut -d '=' -f 2`
    590         FLUIDSYNTH_CFLAGS="-I$arg/include"
    591         FLUIDSYNTH_LIBS="-L$arg/lib"
    592         ;;
    593       --with-mpeg2-prefix=*)
    594         arg=`echo $ac_option | cut -d '=' -f 2`
    595         MPEG2_CFLAGS="-I$arg/include"
    596         MPEG2_LIBS="-L$arg/lib"
    597         ;;
    598       --with-alsa-prefix=*)
    599         arg=`echo $ac_option | cut -d '=' -f 2`
    600         ALSA_CFLAGS="-I$arg/include"
    601         ALSA_LIBS="-L$arg/lib"
    602         ;;
    603       --with-ogg-prefix=*)
    604         arg=`echo $ac_option | cut -d '=' -f 2`
    605         OGG_CFLAGS="-I$arg/include"
    606         OGG_LIBS="-L$arg/lib"
    607         ;;
    608       --with-vorbis-prefix=*)
    609         arg=`echo $ac_option | cut -d '=' -f 2`
    610         VORBIS_CFLAGS="-I$arg/include"
    611         VORBIS_LIBS="-L$arg/lib"
    612         ;;
    613       --with-tremor-prefix=*)
    614         arg=`echo $ac_option | cut -d '=' -f 2`
    615         TREMOR_CFLAGS="-I$arg/include"
    616         TREMOR_LIBS="-L$arg/lib"
    617         ;;
    618       --with-flac-prefix=*)
    619         arg=`echo $ac_option | cut -d '=' -f 2`
    620         FLAC_CFLAGS="-I$arg/include"
    621         FLAC_LIBS="-L$arg/lib"
    622         ;;
    623       --with-mad-prefix=*)
    624         arg=`echo $ac_option | cut -d '=' -f 2`
    625         MAD_CFLAGS="-I$arg/include"
    626         MAD_LIBS="-L$arg/lib"
    627         ;;
    628       --with-zlib-prefix=*)
    629         arg=`echo $ac_option | cut -d '=' -f 2`
    630         ZLIB_CFLAGS="-I$arg/include"
    631         ZLIB_LIBS="-L$arg/lib"
    632         ;;
    633       --backend=*)
    634         _backend=`echo $ac_option | cut -d '=' -f 2`
    635         ;;
    636       --enable-debug)
    637         # debug is enabled by default
    638         ;;
    639       --disable-debug)
    640         DEBFLAGS=""
    641         ;;
    642       --enable-Werror)
    643         CXXFLAGS="$CXXFLAGS -Werror"
    644         ;;
    645       --enable-release)
    646         DEBFLAGS="-O2 -Wuninitialized"
    647         ;;
    648       --with-sdl-prefix=*)
    649         arg=`echo $ac_option | cut -d '=' -f 2`
    650         _sdlpath="$arg:$arg/bin"
    651         ;;
    652       --with-nasm-prefix=*)
    653         arg=`echo $ac_option | cut -d '=' -f 2`
    654         _nasmpath="$arg:$arg/bin"
    655         ;;
    656       --host=*)
    657         _host=`echo $ac_option | cut -d '=' -f 2`
    658         ;;
    659       --prefix=*)
    660         _prefix=`echo $ac_option | cut -d '=' -f 2`
    661         ;;
    662       --bindir=*)
    663         _bindir=`echo $ac_option | cut -d '=' -f 2`
    664         ;;
    665       --mandir=*)
    666         _mandir=`echo $ac_option | cut -d '=' -f 2`
    667         ;;
    668       --datadir=*)
    669         _datadir=`echo $ac_option | cut -d '=' -f 2`
    670         ;;
    671       --enable-*)
    672         engine_enable `echo $ac_option | cut -d '-' -f 4-`
    673         ;;
    674       --disable-*)
    675         engine_disable `echo $ac_option | cut -d '-' -f 4-`
    676         ;;
    677       *)
    678         option_error $ac_option
    679         ;;
    680     esac;
     566        case "$ac_option" in
     567        --disable-hq-scalers)     _build_hq_scalers=no ;;
     568        --disable-scalers)        _build_scalers=no ;;
     569        --enable-alsa)            _alsa=yes       ;;
     570        --disable-alsa)           _alsa=no        ;;
     571        --enable-vorbis)          _vorbis=yes     ;;
     572        --disable-vorbis)         _vorbis=no      ;;
     573        --enable-tremor)          _tremor=yes     ;;
     574        --disable-tremor)         _tremor=no      ;;
     575        --enable-flac)            _flac=yes       ;;
     576        --disable-flac)           _flac=no        ;;
     577        --enable-mad)             _mad=yes        ;;
     578        --disable-mad)            _mad=no         ;;
     579        --enable-zlib)            _zlib=yes       ;;
     580        --disable-zlib)           _zlib=no        ;;
     581        --enable-nasm)            _nasm=yes       ;;
     582        --disable-nasm)           _nasm=no        ;;
     583        --disable-mpeg2)          _mpeg2=no       ;;
     584        --disable-fluidsynth)     _fluidsynth=no  ;;
     585        --enable-plugins)         _build_plugins=yes ;;
     586        --enable-mt32emu)         _mt32emu=yes    ;;
     587        --disable-mt32emu)        _mt32emu=no     ;;
     588        --with-fluidsynth-prefix=*)
     589                arg=`echo $ac_option | cut -d '=' -f 2`
     590                FLUIDSYNTH_CFLAGS="-I$arg/include"
     591                FLUIDSYNTH_LIBS="-L$arg/lib"
     592                ;;
     593        --with-mpeg2-prefix=*)
     594                arg=`echo $ac_option | cut -d '=' -f 2`
     595                MPEG2_CFLAGS="-I$arg/include"
     596                MPEG2_LIBS="-L$arg/lib"
     597                ;;
     598        --with-alsa-prefix=*)
     599                arg=`echo $ac_option | cut -d '=' -f 2`
     600                ALSA_CFLAGS="-I$arg/include"
     601                ALSA_LIBS="-L$arg/lib"
     602                ;;
     603        --with-ogg-prefix=*)
     604                arg=`echo $ac_option | cut -d '=' -f 2`
     605                OGG_CFLAGS="-I$arg/include"
     606                OGG_LIBS="-L$arg/lib"
     607                ;;
     608        --with-vorbis-prefix=*)
     609                arg=`echo $ac_option | cut -d '=' -f 2`
     610                VORBIS_CFLAGS="-I$arg/include"
     611                VORBIS_LIBS="-L$arg/lib"
     612                ;;
     613        --with-tremor-prefix=*)
     614                arg=`echo $ac_option | cut -d '=' -f 2`
     615                TREMOR_CFLAGS="-I$arg/include"
     616                TREMOR_LIBS="-L$arg/lib"
     617                ;;
     618        --with-flac-prefix=*)
     619                arg=`echo $ac_option | cut -d '=' -f 2`
     620                FLAC_CFLAGS="-I$arg/include"
     621                FLAC_LIBS="-L$arg/lib"
     622                ;;
     623        --with-mad-prefix=*)
     624                arg=`echo $ac_option | cut -d '=' -f 2`
     625                MAD_CFLAGS="-I$arg/include"
     626                MAD_LIBS="-L$arg/lib"
     627                ;;
     628        --with-zlib-prefix=*)
     629                arg=`echo $ac_option | cut -d '=' -f 2`
     630                ZLIB_CFLAGS="-I$arg/include"
     631                ZLIB_LIBS="-L$arg/lib"
     632                ;;
     633        --backend=*)
     634                _backend=`echo $ac_option | cut -d '=' -f 2`
     635                ;;
     636        --enable-debug)
     637                # debug is enabled by default
     638                ;;
     639        --disable-debug)
     640                DEBFLAGS=""
     641                ;;
     642        --enable-Werror)
     643                CXXFLAGS="$CXXFLAGS -Werror"
     644                ;;
     645        --enable-release)
     646                DEBFLAGS="-O2 -Wuninitialized"
     647                ;;
     648        --with-sdl-prefix=*)
     649                arg=`echo $ac_option | cut -d '=' -f 2`
     650                _sdlpath="$arg:$arg/bin"
     651                ;;
     652        --with-nasm-prefix=*)
     653                arg=`echo $ac_option | cut -d '=' -f 2`
     654                _nasmpath="$arg:$arg/bin"
     655                ;;
     656        --host=*)
     657                _host=`echo $ac_option | cut -d '=' -f 2`
     658                ;;
     659        --prefix=*)
     660                _prefix=`echo $ac_option | cut -d '=' -f 2`
     661                ;;
     662        --bindir=*)
     663                _bindir=`echo $ac_option | cut -d '=' -f 2`
     664                ;;
     665        --mandir=*)
     666                _mandir=`echo $ac_option | cut -d '=' -f 2`
     667                ;;
     668        --datadir=*)
     669                _datadir=`echo $ac_option | cut -d '=' -f 2`
     670                ;;
     671        --enable-*)
     672                engine_enable `echo $ac_option | cut -d '-' -f 4-`
     673                ;;
     674        --disable-*)
     675                engine_disable `echo $ac_option | cut -d '-' -f 4-`
     676                ;;
     677        *)
     678                option_error $ac_option
     679                ;;
     680        esac;
    681681done;
    682682
    683683CXXFLAGS="$CXXFLAGS $DEBFLAGS"
     
    11211121_def_plugin="/* -> plugins disabled */"
    11221122
    11231123if test "$_build_plugins" = yes ; then
    1124     echo_n "Checking whether building plugins is supported... "
    1125     case $_host_os in
     1124        echo_n "Checking whether building plugins is supported... "
     1125        case $_host_os in
    11261126        linux*)
    11271127_def_plugin='
    11281128#define PLUGIN_PREFIX   "lib"
     
    11401140POST_OBJS_FLAGS := -Wl,-no-whole-archive
    11411141LIBS            += -ldl
    11421142'
    1143             ;;
     1143                ;;
    11441144        freebsd*)
    11451145_def_plugin='
    11461146#define PLUGIN_PREFIX   "lib"
     
    11571157PRE_OBJS_FLAGS  := -Wl,-export-dynamic -Wl,-whole-archive
    11581158POST_OBJS_FLAGS := -Wl,-no-whole-archive
    11591159'
    1160             ;;
     1160                ;;
    11611161        darwin*)
    11621162_def_plugin='
    11631163#define PLUGIN_PREFIX   ""
     
    11741174POST_OBJS_FLAGS :=
    11751175LIBS            += -ldl
    11761176'
    1177             ;;
     1177                ;;
    11781178        *mingw32*)
    11791179_def_plugin='
    11801180#define PLUGIN_PREFIX   ""
     
    11921192'
    11931193                ;;
    11941194        *)
    1195             _build_plugins=no
     1195                _build_plugins=no
    11961196                _mak_plugins=
    11971197                _def_plugin=
    1198             ;;
    1199     esac
    1200     echo "$_build_plugins"
     1198                ;;
     1199        esac
     1200        echo "$_build_plugins"
    12011201fi
    12021202
    12031203
     
    12231223int main(void) { vorbis_packet_blocksize(0,0); return 0; }
    12241224EOF
    12251225        cc_check $LDFLAGS $CXXFLAGS $OGG_CFLAGS $OGG_LIBS $VORBIS_CFLAGS $VORBIS_LIBS \
    1226         -lvorbisfile -lvorbis -logg -lm && _vorbis=yes
     1226                -lvorbisfile -lvorbis -logg -lm && _vorbis=yes
    12271227fi
    12281228if test "$_vorbis" = yes ; then
    12291229        _def_vorbis='#define USE_VORBIS'
     
    12411241#
    12421242echocheck "Tremor"
    12431243if test "$_tremor" = auto ; then
    1244   _tremor=no
    1245   cat > $TMPC << EOF
     1244        _tremor=no
     1245        cat > $TMPC << EOF
    12461246#include <tremor/ivorbiscodec.h>
    12471247int main(void) { vorbis_packet_blocksize(0,0); return 0; }
    12481248EOF
    1249 cc_check $LDFLAGS $CXXFLAGS $TREMOR_CFLAGS $TREMOR_LIBS -lvorbisidec && \
    1250   _tremor=yes
     1249        cc_check $LDFLAGS $CXXFLAGS $TREMOR_CFLAGS $TREMOR_LIBS -lvorbisidec && \
     1250        _tremor=yes
    12511251fi
    12521252if test "$_tremor" = yes && test "$_vorbis" = no; then
    12531253        _def_tremor='#define USE_TREMOR'
     
    12751275int main(void) { return FLAC__STREAM_SYNC_LEN >> 30; /* guaranteed to be 0 */ }
    12761276EOF
    12771277        cc_check $LDFLAGS $CXXFLAGS $FLAC_CFLAGS $FLAC_LIBS $OGG_CFLAGS $OGG_LIBS \
    1278         -lFLAC -logg -lm && _flac=yes
     1278                -lFLAC -logg -lm && _flac=yes
    12791279fi
    12801280if test "$_flac" = yes ; then
    12811281        _def_flac='#define USE_FLAC'
     
    13741374        /* mpeg2_state_t first appears in 0.4.0 */
    13751375        mpeg2_state_t state;
    13761376
    1377         #ifdef MPEG2_RELEASE
     1377                #ifdef MPEG2_RELEASE
    13781378                if (MPEG2_RELEASE >= MPEG2_VERSION(0, 3, 2))
    13791379                        return 0;
    13801380        #endif
     
    14271427# Check for nasm
    14281428#
    14291429if test "$_have_x86" = yes ; then
    1430     CheckNASM
     1430        CheckNASM
    14311431fi
    14321432
    14331433add_to_config_h_if_yes $_nasm '#define USE_NASM'