Ticket #8742: configure-engines.patch
File configure-engines.patch, 8.2 KB (added by , 17 years ago) |
---|
-
configure
49 49 _build_hq_scalers=yes 50 50 _build_scalers=yes 51 51 52 _engines=' 53 scumm 54 scumm_7_8 55 he 56 agi 57 agos 58 cine 59 cruise 60 drascula 61 gob 62 igor 63 kyra 64 lure 65 parallaction 66 queen 67 saga 68 sky 69 sword1 70 sword2 71 touche 72 ' 73 _engine_scumm_name="SCUMM" 74 _engine_scumm_build=yes 75 _engine_scumm_check=check_scumm_build 76 _engine_scumm_7_8_name="v7 and v8 games (ft, dig, comi and demos) in SCUMM" 77 _engine_scumm_7_8_build=yes 78 _engine_scumm_7_8_sub=yes 79 _engine_he_name="HE70+ games in SCUMM" 80 _engine_he_build=yes 81 _engine_he_sub=yes 82 _engine_agi_name="AGI" 83 _engine_agi_build=yes 84 _engine_agos_name="AGOS" 85 _engine_agos_build=yes 86 _engine_cine_name="Cinematique evo 1" 87 _engine_cine_build=yes 88 _engine_cruise_name="Cinematique evo 2" 89 _engine_cruise_build=no 90 _engine_drascula_name="Drascula: The Vampire Strikes Back" 91 _engine_drascula_build=no 92 _engine_gob_name="Gobli*ns" 93 _engine_gob_build=yes 94 _engine_igor_name="Igor: Objective Uikokahonia" 95 _engine_igor_build=no 96 _engine_kyra_name="Legend of Kyrandia" 97 _engine_kyra_build=yes 98 _engine_lure_name="Lure of the Temptress" 99 _engine_lure_build=yes 100 _engine_parallaction_name="Parallaction" 101 _engine_parallaction_build=yes 102 _engine_queen_name="Flight of the Amazon Queen" 103 _engine_queen_build=yes 104 _engine_saga_name="SAGA" 105 _engine_saga_build=yes 106 _engine_sky_name="Beneath a Steel Sky" 107 _engine_sky_build=yes 108 _engine_sword1_name="Broken Sword 1" 109 _engine_sword1_build=yes 110 _engine_sword1_check=check_sword_build 111 _engine_sword2_name="Broken Sword 2" 112 _engine_sword2_build=yes 113 _engine_sword2_check=check_sword_build 114 _engine_touche_name="Touche: The Adventures of the Fifth Musketeer" 115 _engine_touche_build=yes 52 # Add an engine: id name build subengines 53 add_engine() { 54 _engines="${_engines} ${1}" 55 eval _engine_${1}_name='${2}' 56 eval _engine_${1}_build='${3}' 57 eval _engine_${1}_subengines='${4}' 58 for sub in ${4}; do 59 eval _engine_${sub}_sub=yes 60 done 61 } 116 62 63 add_engine scumm "SCUMM" yes "scumm_7_8 he" 64 add_engine scumm_7_8 "v7 & v8 games" yes 65 add_engine he "HE70+ games" yes 66 add_engine agi "AGI" yes 67 add_engine agos "AGOS" yes 68 add_engine cine "Cinematique evo 1" yes 69 add_engine cruise "Cinematique evo 2" no 70 add_engine drascula "Drascula: The Vampire Strikes Back" no 71 add_engine gob "Gobli*ns" yes 72 add_engine igor "Igor: Objective Uikokahonia" no 73 add_engine kyra "Legend of Kyrandia" yes 74 add_engine lure "Lure of the Temptress" yes 75 add_engine parallaction "Parallaction" yes 76 add_engine queen "Flight of the Amazon Queen" yes 77 add_engine saga "SAGA" yes 78 add_engine sky "Beneath a Steel Sky" yes 79 add_engine sword1 "Broken Sword 1" yes 80 add_engine sword2 "Broken Sword 2" yes 81 add_engine touche "Touche: The Adventures of the Fifth Musketeer" yes 82 117 83 _endian=unknown 118 84 _need_memalign=no 119 85 _have_x86=no … … 359 325 eval echo \$_engine_$1_build 360 326 } 361 327 328 # Get the subengines 329 get_engine_subengines() { 330 eval echo \$_engine_$1_subengines 331 } 332 362 333 # Ask if this is a subengine 363 334 get_engine_sub() { 364 335 sub=`eval echo \\$_engine_$1_sub` 365 if test "$sub" = "" ; then336 if test -z "$sub" ; then 366 337 sub=no 367 338 fi 368 339 echo $sub … … 388 359 fi 389 360 } 390 361 362 # Show the configure help line for an option 363 option_help() { 364 option=`echo "--$(echo $1 | sed 's/_/-/g') " | head -c 23` 365 echo " ${option} ${2}" 366 } 367 391 368 # Show the configure help line for a given engine 392 369 show_engine_help() { 393 370 if test `get_engine_build $1` = yes ; then … … 397 374 option="enable" 398 375 do="" 399 376 fi 400 option=`echo "--${option}-$(echo $1 | sed 's/_/-/g') " | head -c 23`401 377 name=`get_engine_name $1` 402 echo " ${option} ${do}build the ${name} engine" 378 option_help ${option}-${1} "${do}build the ${name} engine" 379 for sub in `get_engine_subengines $1`; do 380 show_subengine_help $sub $1 381 done 403 382 } 404 383 405 check_engine_build() { 406 check=`eval echo \\$_engine_$1_check` 407 if test "$check" = "" ; then 408 name=`get_engine_name $1` 409 if test `get_engine_build $1` = yes ; then 410 _engines_built="${_engines_built}#$name@" 411 else 412 _engines_skipped="${_engines_skipped}#$name@" 413 fi 384 # Show the configure help line for a given subengine 385 show_subengine_help() { 386 if test `get_engine_build $1` = yes ; then 387 option="disable" 388 do="exclude" 414 389 else 415 $check $1 390 option="enable" 391 do="include" 416 392 fi 393 name=`get_engine_name $1` 394 parent=`get_engine_name $2` 395 option_help ${option}-${1} "${do} the ${name} in ${parent} engine" 417 396 } 418 397 419 check_sword_build() { 420 name=`get_engine_name $1` 421 if test `get_engine_build $1` = yes ; then 422 _engines_built="${_engines_built}#$name" 423 if test "$_mpeg2" = yes ; then 424 _engines_built="${_engines_built} (w/ mpeg2 cutscenes)" 398 # Prepare the strings about the engines to build 399 prepare_engine_build_strings() { 400 string_yes=`get_engine_build_string $1 yes` 401 if test -n "$string_yes" ; then 402 _engines_built="${_engines_built}#$string_yes@" 403 fi 404 405 string_no=`get_engine_build_string $1 no` 406 if test -n "$string_no" ; then 407 _engines_skipped="${_engines_skipped}#$string_no@" 408 fi 409 } 410 411 # Get the string about building an engine 412 get_engine_build_string() { 413 engine_string="" 414 if test `get_engine_build $1` = no ; then 415 if test $2 = no ; then 416 engine_string=`get_engine_name $1` 425 417 else 426 _engines_built="${_engines_built} (without mpeg2 cutscenes)"418 engine_string="" 427 419 fi 428 _engines_built="${_engines_built}@"429 420 else 430 _engines_skipped="${_engines_skipped}#$name@" 421 build_string_func=get_${1}_build_string 422 if ( type $build_string_func | grep function ) 2> /dev/null > /dev/null ; then 423 engine_string=`$build_string_func $1 $2` 424 else 425 engine_string=`get_subengines_build_string $1 $2` 426 fi 427 428 if test $2 = yes ; then 429 engine_string="`get_engine_name $1` $engine_string" 430 else 431 if test -n "$engine_string" ; then 432 engine_string="`get_engine_name $1` $engine_string" 433 fi 434 fi 431 435 fi 436 437 echo $engine_string 432 438 } 433 439 434 check_scumm_build() { 435 name=`get_engine_name $1` 436 437 if test `get_engine_build $1` = yes ; then 438 _engines_built="${_engines_built}#$name [v0-v6 games]" 439 440 if test "$_engine_scumm_7_8_build" = yes ; then 441 _engines_built="${_engines_built} [v7 & v8 games]" 440 # Get the string about building subengines 441 get_subengines_build_string() { 442 all=yes 443 subengine_string=$3 444 for subeng in `get_engine_subengines $1` ; do 445 if test `get_engine_build $subeng` = $2 ; then 446 subengine_string="$subengine_string [`get_engine_name $subeng`]" 442 447 else 443 skip=" [v7 & v8 games]"448 all=no 444 449 fi 445 if test "$_engine_he_build" = yes ; then 446 _engines_built="${_engines_built} [HE70+ games]" 447 else 448 skip="$skip [HE70+ games]" 450 done 451 if test $2 = yes ; then 452 if test -n "$subengine_string" ; then 453 if test $all = yes ; then 454 subengine_string="[all games]" 455 fi 449 456 fi 457 fi 450 458 451 if test "$skip" = "" ; then 452 true 459 echo $subengine_string 460 } 461 462 # Engine specific build strings 463 get_sword1_build_string() { 464 if test $2 = yes ; then 465 if test "$_mpeg2" = yes ; then 466 echo "(w/ mpeg2 cutscenes)" 453 467 else 454 _engines_skipped="$_engines_skipped#$name$skip@"468 echo "(without mpeg2 cutscenes)" 455 469 fi 470 fi 471 } 456 472 457 _engines_built="${_engines_built}@" 458 else 459 _engines_skipped="${_engines_skipped}#$name [all games]@" 473 get_sword2_build_string() { 474 get_sword1_build_string $1 $2 475 } 476 477 get_scumm_build_string() { 478 if test $2 = yes ; then 479 base="[v0-v6 games]" 460 480 fi 481 get_subengines_build_string $1 $2 "$base" 461 482 } 462 483 463 484 # … … 479 500 for parm in "$@" ; do 480 501 if test "$parm" = "--help" || test "$parm" = "-help" || test "$parm" = "-h" ; then 481 502 for engine in $_engines; do 482 engines_help="$engines_help`show_engine_help $engine` 503 if test `get_engine_sub $engine` = no ; then 504 engines_help="$engines_help`show_engine_help $engine` 483 505 " 506 fi 484 507 done 485 508 cat << EOF 486 509 … … 1452 1475 1453 1476 for engine in $_engines; do 1454 1477 if test "`get_engine_sub $engine`" = "no" ; then 1455 check_engine_build$engine1478 prepare_engine_build_strings $engine 1456 1479 fi 1457 1480 done 1458 1481 1459 1482 echo 1460 if test "$_engines_built" = "" ; then 1461 true 1462 else 1483 if test -n "$_engines_built" ; then 1463 1484 echo "Engines:" 1464 1485 echo $_engines_built | sed 's/@/\ 1465 1486 /g 1466 1487 s/#/ /g' 1467 1488 fi 1468 1489 1469 if test "$_engines_skipped" = "" ; then 1470 true 1471 else 1490 if test -n "$_engines_skipped" ; then 1472 1491 echo "Engines Skipped:" 1473 1492 echo $_engines_skipped | sed 's/@/\ 1474 1493 /g