Ticket #8735: configure-engines.patch

File configure-engines.patch, 13.2 KB (added by jvprat, 17 years ago)
  • configure

     
    4646_fluidsynth=auto
    4747_mt32emu=yes
    4848# default option behaviour yes/no
    49 _build_scumm=yes
    50 _build_scumm_7_8=yes
    51 _build_he=yes
    52 _build_agi=yes
    53 _build_agos=yes
    54 _build_cine=yes
    55 _build_cruise=no
    56 _build_drascula=no
    57 _build_gob=yes
    58 _build_kyra=yes
    59 _build_lure=yes
    60 _build_parallaction=yes
    61 _build_queen=yes
    62 _build_saga=yes
    63 _build_sky=yes
    64 _build_sword1=yes
    65 _build_sword2=yes
    66 _build_touche=yes
    6749_build_hq_scalers=yes
    6850_build_scalers=yes
    6951
     52_engines='
     53scumm
     54scumm_7_8
     55he
     56agi
     57agos
     58cine
     59cruise
     60drascula
     61gob
     62kyra
     63lure
     64parallaction
     65queen
     66saga
     67sky
     68sword1
     69sword2
     70touche
     71'
     72_engine_scumm_name="SCUMM"
     73_engine_scumm_build=yes
     74_engine_scumm_check=check_scumm_build
     75_engine_scumm_7_8_name="v7 and v8 games (ft, dig, comi and demos) in SCUMM"
     76_engine_scumm_7_8_build=yes
     77_engine_scumm_7_8_sub=yes
     78_engine_he_name="HE70+ games in SCUMM"
     79_engine_he_build=yes
     80_engine_he_sub=yes
     81_engine_agi_name="AGI"
     82_engine_agi_build=yes
     83_engine_agos_name="AGOS"
     84_engine_agos_build=yes
     85_engine_cine_name="Cinematique evo 1"
     86_engine_cine_build=yes
     87_engine_cruise_name="Cinematique evo 2"
     88_engine_cruise_build=no
     89_engine_drascula_name="Drascula: The Vampire Strikes Back"
     90_engine_drascula_build=no
     91_engine_gob_name="Gobli*ns"
     92_engine_gob_build=yes
     93_engine_kyra_name="Legend of Kyrandia"
     94_engine_kyra_build=yes
     95_engine_lure_name="Lure of the Temptress"
     96_engine_lure_build=yes
     97_engine_parallaction_name="Parallaction"
     98_engine_parallaction_build=yes
     99_engine_queen_name="Flight of the Amazon Queen"
     100_engine_queen_build=yes
     101_engine_saga_name="SAGA"
     102_engine_saga_build=yes
     103_engine_sky_name="Beneath a Steel Sky"
     104_engine_sky_build=yes
     105_engine_sword1_name="Broken Sword 1"
     106_engine_sword1_build=yes
     107_engine_sword1_check=check_sword_build
     108_engine_sword2_name="Broken Sword 2"
     109_engine_sword2_build=yes
     110_engine_sword2_check=check_sword_build
     111_engine_touche_name="Touche: The Adventures of the Fifth Musketeer"
     112_engine_touche_build=yes
     113
    70114_endian=unknown
    71115_need_memalign=no
    72116_have_x86=no
     
    302346        fi
    303347}
    304348
     349# Get the name of the engine
     350get_engine_name() {
     351        eval echo \$_engine_$1_name
     352}
     353
     354# Will this engine be built?
     355get_engine_build() {
     356        eval echo \$_engine_$1_build
     357}
     358
     359# Ask if this is a subengine
     360get_engine_sub() {
     361        sub=`eval echo \\$_engine_$1_sub`
     362        if test "$sub" = "" ; then
     363                sub=no
     364        fi
     365        echo $sub
     366}
     367
     368# Enable the given engine
     369engine_enable() {
     370        engine=$(echo $1 | sed 's/-/_/g')
     371        if test "`get_engine_build ${engine}`" = "no" ; then
     372                eval _engine_${engine}_build=yes
     373        else
     374                option_error --enable-$1
     375        fi
     376}
     377
     378# Disable the given engine
     379engine_disable() {
     380        engine=$(echo $1 | sed 's/-/_/g')
     381        if test "`get_engine_build $engine`" = "yes" ; then
     382                eval _engine_${engine}_build=no
     383        else
     384                option_error --disable-$1
     385        fi
     386}
     387
     388# Show the configure help line for a given engine
     389show_engine_help() {
     390        if test `get_engine_build $1` = yes ; then
     391                option="disable"
     392                do="don't "
     393        else
     394                option="enable"
     395                do=""
     396        fi
     397        option=`echo "--${option}-$(echo $1 | sed 's/_/-/g')                       " | head -c 23`
     398        name=`get_engine_name $1`
     399        echo "  ${option}  ${do}build the ${name} engine"
     400}
     401
     402check_engine_build() {
     403        check=`eval echo \\$_engine_$1_check`
     404        if test "$check" = "" ; then
     405                name=`get_engine_name $1`
     406                if test `get_engine_build $1` = yes ; then
     407                        _engines_built="${_engines_built}#$name@"
     408                else
     409                        _engines_skipped="${_engines_skipped}#$name@"
     410                fi
     411        else
     412                $check $1
     413        fi
     414}
     415
     416check_sword_build() {
     417        name=`get_engine_name $1`
     418        if test `get_engine_build $1` = yes ; then
     419                _engines_built="${_engines_built}#$name"
     420                if test "$_mpeg2" = yes ; then
     421                        _engines_built="${_engines_built} (w/ mpeg2 cutscenes)"
     422                else
     423                        _engines_built="${_engines_built} (without mpeg2 cutscenes)"
     424                fi
     425                _engines_built="${_engines_built}@"
     426        else
     427                _engines_skipped="${_engines_skipped}#$name@"
     428        fi
     429}
     430
     431check_scumm_build() {
     432        name=`get_engine_name $1`
     433
     434        if test `get_engine_build $1` = yes ; then
     435                _engines_built="${_engines_built}#$name"
     436
     437                if test "$_engine_scumm_7_8_build" = yes ; then
     438                        _engines_built="${_engines_built} [v7 & v8 games]"
     439                else
     440                        skip=" [v7 & v8 games]"
     441                fi
     442                if test "$_engine_he_build" = yes ; then
     443                        _engines_built="${_engines_built} [HE70+ games]"
     444                else
     445                        skip="$skip [HE70+ games]"
     446                fi
     447
     448                if test "$skip" = "" ; then
     449                        true
     450                else
     451                        _engines_skipped="$_engines_skipped#$name$skip@"
     452                fi
     453
     454                _engines_built="${_engines_built}@"
     455        else
     456                _engines_skipped="${_engines_skipped}#$name [all games]@"
     457        fi
     458}
     459
    305460#
    306461# Greet user
    307462#
     
    320475
    321476for parm in "$@" ; do
    322477  if test "$parm" = "--help" || test "$parm" = "-help" || test "$parm" = "-h" ; then
     478    for engine in $_engines; do
     479      engines_help="$engines_help`show_engine_help $engine`
     480"
     481    done
    323482    cat << EOF
    324483
    325484Usage: $0 [OPTIONS]...
     
    341500Optional Features:
    342501  --disable-debug          disable building with debugging symbols
    343502  --enable-Werror          treat warnings as errors
    344   --disable-scumm          don't build the SCUMM engine
    345   --disable-scumm-7-8      exclude v7 and v8 game in SCUMM engine (ft, dig, comi and demos)
    346   --disable-he             exclude HE70+ games in SCUMM engine
    347   --disable-agi            don't build the AGI engine
    348   --disable-agos           don't build the AGOS engine
    349   --disable-cine           don't build the Cinematique engine evo 1
    350   --enable-cruise          build the Cruise for a Corpse engine
    351   --enable-drascula        build the Drascula: The Vampire Strikes Back engine
    352   --disable-gob            don't build the Gobli*ns engine
    353   --disable-kyra           don't build the Legend of Kyrandia engine
    354   --disable-lure           don't build the Lure of the Temptress engine
    355   --disable-parallaction   don't build the Parallaction engine
    356   --disable-queen          don't build the Flight of the Amazon Queen engine
    357   --disable-saga           don't build the SAGA engine
    358   --disable-sky            don't build the Beneath a Steel Sky engine
    359   --disable-sword1         don't build the Broken Sword 1 engine
    360   --disable-sword2         don't build the Broken Sword 2 engine
    361   --disable-touche         don't build the Touche: The Adventures of the Fifth Musketeer engine
    362 
     503$engines_help
    363504  --enable-plugins         build engines as loadable modules instead of
    364505                           static linking them
    365506  --disable-mt32emu        don't enable the integrated MT-32 emulator
     
    412553
    413554DEBFLAGS="-g"
    414555
     556option_error() {
     557    echo "error: unrecognised option: $ac_option
     558Try \`$0 --help' for more information." >&2
     559    exit 1
     560}
     561
    415562for ac_option in $@; do
    416563    case "$ac_option" in
    417       --disable-scumm)          _build_scumm=no ;;
    418       --disable-scumm-7-8)      _build_scumm_7_8=no ;;
    419       --disable-he)             _build_he=no ;;
    420       --disable-agi)            _build_agi=no ;;
    421       --disable-agos)           _build_agos=no ;;
    422       --disable-cine)           _build_cine=no ;;
    423       --enable-cruise)          _build_cruise=yes ;;
    424       --enable-drascula)        _build_drascula=yes ;;
    425       --disable-gob)            _build_gob=no ;;
    426       --disable-kyra)           _build_kyra=no ;;
    427       --disable-lure)           _build_lure=no ;;
    428       --disable-parallaction)   _build_parallaction=no ;;
    429       --disable-queen)          _build_queen=no ;;
    430       --disable-saga)           _build_saga=no ;;
    431       --disable-sky)            _build_sky=no ;;
    432       --disable-sword1)         _build_sword1=no ;;
    433       --disable-sword2)         _build_sword2=no ;;
    434       --disable-touche)         _build_touche=no ;;
    435564      --disable-hq-scalers)     _build_hq_scalers=no ;;
    436565      --disable-scalers)        _build_scalers=no ;;
    437566      --enable-alsa)            _alsa=yes       ;;
     
    536665      --datadir=*)
    537666        _datadir=`echo $ac_option | cut -d '=' -f 2`
    538667        ;;
     668      --enable-*)
     669        engine_enable `echo $ac_option | cut -d '-' -f 4-`
     670        ;;
     671      --disable-*)
     672        engine_disable `echo $ac_option | cut -d '-' -f 4-`
     673        ;;
    539674      *)
    540         echo "error: unrecognised option: $ac_option
    541 Try \`$0 --help' for more information." >&2
    542         exit 1
     675        option_error $ac_option
    543676        ;;
    544677    esac;
    545678done;
     
    711844#
    712845# Engine selection
    713846#
    714 add_to_config_mk_if_no $_build_scumm        'DISABLE_SCUMM = 1'
    715 add_to_config_mk_if_no $_build_scumm_7_8    'DISABLE_SCUMM_7_8 = 1'
    716 add_to_config_mk_if_no $_build_he           'DISABLE_HE = 1'
    717 add_to_config_mk_if_no $_build_agi          'DISABLE_AGI = 1'
    718 add_to_config_mk_if_no $_build_agos         'DISABLE_AGOS = 1'
    719 add_to_config_mk_if_no $_build_cine         'DISABLE_CINE = 1'
    720 add_to_config_mk_if_no $_build_cruise       'DISABLE_CRUISE = 1'
    721 add_to_config_mk_if_no $_build_drascula     'DISABLE_DRASCULA = 1'
    722 add_to_config_mk_if_no $_build_gob          'DISABLE_GOB = 1'
    723 add_to_config_mk_if_no $_build_kyra         'DISABLE_KYRA = 1'
    724 add_to_config_mk_if_no $_build_lure         'DISABLE_LURE = 1'
    725 add_to_config_mk_if_no $_build_parallaction 'DISABLE_PARALLACTION = 1'
    726 add_to_config_mk_if_no $_build_queen        'DISABLE_QUEEN = 1'
    727 add_to_config_mk_if_no $_build_saga         'DISABLE_SAGA = 1'
    728 add_to_config_mk_if_no $_build_sky          'DISABLE_SKY = 1'
    729 add_to_config_mk_if_no $_build_sword1       'DISABLE_SWORD1 = 1'
    730 add_to_config_mk_if_no $_build_sword2       'DISABLE_SWORD2 = 1'
    731 add_to_config_mk_if_no $_build_touche       'DISABLE_TOUCHE = 1'
    732 add_to_config_mk_if_no $_build_hq_scalers   'DISABLE_HQ_SCALERS = 1'
    733 add_to_config_mk_if_no $_build_scalers      'DISABLE_SCALERS = 1'
     847for engine in $_engines; do
     848        add_to_config_mk_if_no `get_engine_build $engine` "DISABLE_$(echo $engine | tr [a-z] [A-Z]) = 1"
     849done
     850add_to_config_mk_if_no $_build_hq_scalers         'DISABLE_HQ_SCALERS = 1'
     851add_to_config_mk_if_no $_build_scalers            'DISABLE_SCALERS = 1'
    734852
    735853#
    736854# Check for endianness
     
    13201438
    13211439
    13221440#
    1323 # Check which engines ("frontends") are to be built
     1441# Show which engines ("frontends") are to be built
    13241442#
    13251443
    1326 skipped_engines=""
     1444_engines_built=""
     1445_engines_skipped=""
    13271446
    1328 echo
    1329 echo "Engines:"
    1330 if test "$_build_scumm" = yes ; then
    1331         echo_n "    SCUMM"
    1332         if test "$_build_scumm_7_8" = yes ; then
    1333                 echo_n " [v7 & v8 games]"
    1334         else
    1335             skipped_engines="$skipped_engines [v7 & v8 games]"
     1447for engine in $_engines; do
     1448        if test "`get_engine_sub $engine`" = "no" ; then
     1449                check_engine_build $engine
    13361450        fi
    1337         if test "$_build_he" = yes ; then
    1338                 echo_n " [HE70+ games]"
    1339         else
    1340                 skipped_engines="$skipped_engines [HE70+ games]"
    1341         fi
    1342         echo
     1451done
    13431452
    1344         if test "$skipped_engines" = "" ; then
    1345                 true
    1346         else
    1347                 skipped_engines="#SCUMM$skipped_engines@"
    1348         fi
     1453echo
     1454if test "$_engines_built" = "" ; then
     1455        true
    13491456else
    1350         skipped_engines="${skipped_engines}#SCUMM [all games]@"
     1457        echo "Engines:"
     1458        echo $_engines_built | sed 's/@/\
     1459/g
     1460s/#/    /g'
    13511461fi
    1352 if test "$_build_agi" = yes ; then
    1353         echo "    AGI"
    1354 else
    1355         skipped_engines="${skipped_engines}#AGI@"
    1356 fi
    1357 if test "$_build_agos" = yes ; then
    1358         echo "    AGOS"
    1359 else
    1360         skipped_engines="${skipped_engines}#AGOS@"
    1361 fi
    1362 if test "$_build_cine" = yes ; then
    1363         echo "    Cinematique evo 1"
    1364 else
    1365         skipped_engines="${skipped_engines}#Cinematique evo 1@"
    1366 fi
    1367 if test "$_build_cruise" = yes ; then
    1368         echo "    Cinematique evo 2"
    1369 else
    1370         skipped_engines="${skipped_engines}#Cinematique evo 2@"
    1371 fi
    1372 if test "$_build_drascula" = yes ; then
    1373         echo "    Drascula"
    1374 else
    1375         skipped_engines="${skipped_engines}#Drascula@"
    1376 fi
    1377 if test "$_build_gob" = yes ; then
    1378         echo "    Gobli*ns"
    1379 else
    1380         skipped_engines="${skipped_engines}#Gobli*ns@"
    1381 fi
    1382 if test "$_build_kyra" = yes ; then
    1383         echo "    Legend of Kyrandia"
    1384 else
    1385         skipped_engines="${skipped_engines}#Legend of Kyrandia@"
    1386 fi
    1387 if test "$_build_lure" = yes ; then
    1388         echo "    Lure of the Temptress"
    1389 else
    1390         skipped_engines="${skipped_engines}#Lure of the Temptress@"
    1391 fi
    1392 if test "$_build_parallaction" = yes ; then
    1393         echo "    Parallaction"
    1394 else
    1395         skipped_engines="${skipped_engines}#Parallaction@"
    1396 fi
    1397 if test "$_build_queen" = yes ; then
    1398         echo "    Flight of the Amazon Queen"
    1399 else
    1400         skipped_engines="${skipped_engines}#Flight of the Amazon Queen@"
    1401 fi
    1402 if test "$_build_saga" = yes ; then
    1403         echo "    SAGA"
    1404 else
    1405         skipped_engines="${skipped_engines}#SAGA@"
    1406 fi
    1407 if test "$_build_sky" = yes ; then
    1408         echo "    Beneath a Steel Sky"
    1409 else
    1410         skipped_engines="${skipped_engines}#Beneath a Steel Sky@"
    1411 fi
    1412 if test "$_build_sword1" = yes ; then
    1413         echo_n "    Broken Sword 1"
    1414         if test "$_mpeg2" = yes ; then
    1415                 echo " (w/ mpeg2 cutscenes)"
    1416         else
    1417                 echo " (without mpeg2 cutscenes)"
    1418         fi
    1419 else
    1420         skipped_engines="${skipped_engines}#Broken Sword 1@"
    1421 fi
    1422 if test "$_build_sword2" = yes ; then
    1423         echo_n "    Broken Sword 2"
    1424         if test "$_mpeg2" = yes ; then
    1425                 echo " (w/ mpeg2 cutscenes)"
    1426         else
    1427                 echo " (without mpeg2 cutscenes)"
    1428         fi
    1429 else
    1430         skipped_engines="${skipped_engines}#Broken Sword 2@"
    1431 fi
    1432 if test "$_build_touche" = yes ; then
    1433         echo "    Touche: The Adventures of the Fifth Musketeer"
    1434 else
    1435         skipped_engines="${skipped_engines}#Touche: The Adventures of the Fifth Musketeer@"
    1436 fi
    14371462
    1438 echo
    1439 
    1440 if test "$skipped_engines" = "" ; then
     1463if test "$_engines_skipped" = "" ; then
    14411464        true
    14421465else
    14431466        echo "Engines Skipped:"
    1444         echo $skipped_engines | sed 's/@/\
     1467        echo $_engines_skipped | sed 's/@/\
    14451468/g
    14461469s/#/    /g'
    14471470fi