diff options
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 261 |
1 files changed, 177 insertions, 84 deletions
@@ -62,7 +62,7 @@ get_var() { eval echo \$${1} } -# Add an engine: id name build subengines +# Add an engine: id name build subengines base-games dependencies add_engine() { _engines="${_engines} ${1}" if test "${3}" = "no" ; then @@ -72,11 +72,22 @@ add_engine() { set_var _engine_${1}_build "${3}" set_var _engine_${1}_build_default "${3}" set_var _engine_${1}_subengines "${4}" + set_var _engine_${1}_base "${5}" + set_var _engine_${1}_deps "${6}" for sub in ${4}; do set_var _engine_${sub}_sub "yes" + set_var _engine_${sub}_parent "${1}" done } +# Add a feature: id name settings-list +add_feature() { + set_var _feature_${1}_name "${2}" + # This is a list of settings, where one must be "yes" for the feature to + # be enabled + set_var _feature_${1}_settings "${3}" +} + _srcdir=`dirname $0` # Read list of engines @@ -85,7 +96,7 @@ _srcdir=`dirname $0` # # Default settings # -# Default lib behaviour yes/no/auto +# Default lib behavior yes/no/auto _vorbis=auto _tremor=auto _tremolo=no @@ -108,7 +119,7 @@ _freetype2=auto _taskbar=yes _updates=no _libunity=auto -# Default option behaviour yes/no +# Default option behavior yes/no _debug_build=auto _release_build=auto _optimizations=auto @@ -162,6 +173,17 @@ _endian=unknown _need_memalign=yes _have_x86=no +# Add (virtual) features +add_feature 16bit "16bit color" "_16bit" +add_feature faad "libfaad" "_faad" +add_feature flac "FLAC" "_flac" +add_feature freetype2 "FreeType2" "_freetype2" +add_feature mad "MAD" "_mad" +add_feature png "PNG" "_png" +add_feature theoradec "libtheoradec" "_theoradec" +add_feature vorbis "Vorbis file support" "_vorbis _tremor" +add_feature zlib "zlib" "_zlib" + # Directories for installing ScummVM. @@ -439,6 +461,26 @@ Try \`$0 --help' for more information." >&2 } +# +# Feature handling functions +# + +# Get the name of the feature +get_feature_name() { + get_var _feature_$1_name +} + +# Check whether the feature is enabled +get_feature_state() { + for i in `get_var _feature_$1_settings`; do + if test `get_var $i` = "yes"; then + echo "yes" + return + fi + done + echo "no" +} + # # Engine handling functions @@ -464,6 +506,16 @@ get_engine_subengines() { get_var _engine_$1_subengines } +# Get the dependencies +get_engine_dependencies() { + get_var _engine_$1_deps +} + +# Get the base engine game support description +get_engine_base() { + get_var _engine_$1_base +} + # Ask if this is a subengine get_engine_sub() { sub=`get_var _engine_$1_sub` @@ -473,6 +525,11 @@ get_engine_sub() { echo $sub } +# Get a subengine's parent (undefined for non-subengines) +get_subengine_parent() { + get_var _engine_$1_parent +} + # Enable *all* engines engine_enable_all() { for engine in $_engines; do @@ -500,9 +557,15 @@ engine_enable() { engine=`echo $eng | sed 's/-/_/g'` # Filter the parameter for the subengines - if test "`get_engine_sub ${engine}`" != "no" -a "$opt" != "yes" ; then - subengine_option_error ${engine} - return + if test "`get_engine_sub ${engine}`" != "no" ; then + if test "$opt" != "yes" ; then + subengine_option_error ${engine} + return + fi + parent=`get_subengine_parent ${engine}` + if test `get_engine_build ${parent}` = "no" ; then + set_var _engine_${parent}_build "yes" + fi fi if test "$opt" = "static" -o "$opt" = "dynamic" -o "$opt" = "yes" ; then @@ -532,6 +595,29 @@ engine_disable() { fi } +# Check whether the engine's dependencies are met +# If that is not the case disable the engine +check_engine_deps() { + unmet_deps="" + + # Check whether the engine is enabled + if test `get_engine_build $1` != "no" ; then + # Collect unmet dependencies + for dep in `get_engine_dependencies $1`; do + if test `get_feature_state $dep` = "no"; then + feature_name=`get_feature_name $dep` + unmet_deps="${unmet_deps}${feature_name} " + fi + done + + # Check whether there is any unmet dependency + if test -n "$unmet_deps"; then + echo "WARNING: Disabling engine "`get_engine_name $1`" because the following dependencies are unmet: "$unmet_deps + engine_disable $1 + fi + fi +} + # Show the configure help line for a given engine show_engine_help() { name=`get_engine_name $1` @@ -574,27 +660,37 @@ prepare_engine_build_strings() { # Get the string about building an engine get_engine_build_string() { + engine=$1 + request_status=$2 engine_string="" engine_build=`get_engine_build $1` - engine_build_default=`get_engine_build_default $1` + engine_build_default=`get_engine_build_default $engine` show=no + # Convert static/dynamic to yes to ease the check of subengines + if test $engine_build = no; then + subengine_filter=no + else + subengine_filter=yes + fi + # Check if the current engine should be shown for the current status - if test $engine_build = $2 ; then + if test $engine_build = $request_status ; then show=yes else # Test for disabled sub-engines - if test $2 = no ; then - for subeng in `get_engine_subengines $1` ; do + if test $request_status = no ; then + for subeng in `get_engine_subengines $engine` ; do if test `get_engine_build $subeng` = no ; then - engine_build=no + # In this case we to display _disabled_ subengines + subengine_filter=no show=yes fi done fi # Test for enabled wip sub-engines - if test $2 = wip ; then - for subeng in `get_engine_subengines $1` ; do + if test $request_status = wip ; then + for subeng in `get_engine_subengines $engine` ; do if test `get_engine_build $subeng` != no -a `get_engine_build_default $subeng` = no ; then show=yes fi @@ -602,85 +698,82 @@ get_engine_build_string() { fi fi - # Convert static/dynamic to yes to ease the check of subengines - if test $engine_build != no ; then - engine_build=yes - fi # Check if it is a wip engine - if test "$2" = "wip" -a "$engine_build" != "no" -a "$engine_build_default" = no; then + if test "$request_status" = "wip" -a "$engine_build" != "no" -a "$engine_build_default" = no; then show=yes fi # The engine should be shown, build the string if test $show = yes ; then - build_string_func=get_${1}_build_string - if ( type $build_string_func | grep function ) 2> /dev/null > /dev/null ; then - engine_string=`$build_string_func $1 $engine_build $2` - else - engine_string=`get_subengines_build_string $1 $engine_build "" $2` - fi - - engine_string="`get_engine_name $1` $engine_string" + engine_string=`get_subengines_build_string $engine $subengine_filter $request_status` + engine_string="`get_engine_name $engine` $engine_string" fi - echo $engine_string + echo "$engine_string" } # Get the string about building subengines get_subengines_build_string() { - all=yes parent_engine=$1 - subengine_string=$3 - parent_status=$4 + subengine_filter=$2 + request_status=$3 parent_engine_build_default=`get_engine_build_default $parent_engine` + subengine_string="" - for subeng in `get_engine_subengines $parent_engine` ; do - subengine_build=`get_engine_build $subeng` - subengine_build_default=`get_engine_build_default $subeng` - if test \( $subengine_build = $2 -a "$parent_status" != wip \) -o \( "$parent_status" = wip -a $subengine_build != no -a "$subengine_build_default" = no \) ; then - subengine_string="$subengine_string [`get_engine_name $subeng`]" - else + # If the base engine isn't built at all, no need to list subengines + # in any of the possible categories. + if test `get_engine_build $parent_engine` = no; then + return + fi + + all=yes + # If there are no subengines, never display "[all games]" (for brevity). + if test -z "`get_engine_subengines $parent_engine`"; then + all=no + fi + # If the base engine does not fit the category we're displaying here + # (WIP or Skipped), we should never show "[all games]" + if test "$request_status" = wip; then + if test $parent_engine_build_default = yes; then all=no fi + fi + if test "$request_status" = no; then + # If we're here, the parent engine is built, so no need to check that. + all=no + fi - # handle engines that are on by default and have a single subengine that is off by default - if test "$parent_status" = wip ; then - if test $parent_engine_build_default = yes -a subengine ; then - all=no - fi - fi - done - - if test $2 != no ; then - if test -n "$subengine_string" ; then - if test $all = yes ; then - subengine_string="[all games]" - fi - fi + # In the static/dynamic categories, also display the engine's base games. + if test -n "`get_engine_subengines $parent_engine`" -a $request_status != no -a $request_status != wip; then + subengine_string="[`get_engine_base $parent_engine`]" fi - echo $subengine_string -} + for subeng in `get_engine_subengines $parent_engine` ; do + subengine_build=`get_engine_build $subeng` + subengine_build_default=`get_engine_build_default $subeng` -# Engine specific build strings -get_scumm_build_string() { - if test `get_engine_build $1` != no ; then - if test $2 != no -a "$3" != wip ; then - base="[v0-v6 games]" + # Display this subengine if it matches the filter, unless it is + # a stable subengine in the WIP request. + if test $subengine_build = $subengine_filter -a \! \( "$request_status" = wip -a "$subengine_build_default" = yes \) ; then + s="[`get_engine_name $subeng`]" + if test -n "$subengine_string"; then + subengine_string="$subengine_string $s" + else + subengine_string="$s" + fi + else + all=no fi - get_subengines_build_string $1 $2 "$base" $3 - fi -} + done -get_saga_build_string() { - if test `get_engine_build $1` != no ; then - if test $2 != no -a "$3" != wip; then - base="[ITE]" - fi - get_subengines_build_string $1 $2 "$base" $3 + # Summarize the full list, where applicable + if test $all = yes ; then + subengine_string="[all games]" fi + + echo "$subengine_string" } # @@ -1839,7 +1932,9 @@ case $_host_cpu in define_in_config_if_yes yes 'USE_ARM_SOUND_ASM' define_in_config_if_yes yes 'USE_ARM_SMUSH_ASM' define_in_config_if_yes yes 'USE_ARM_GFX_ASM' - define_in_config_if_yes yes 'USE_ARM_COSTUME_ASM' + # FIXME: The following feature exhibits a bug during the intro scene of Indy 4 + # (on Pandora and iPhone at least) + #define_in_config_if_yes yes 'USE_ARM_COSTUME_ASM' DEFINES="$DEFINES -DARM_TARGET" ;; @@ -3202,11 +3297,6 @@ fi define_in_config_if_yes "$_png" 'USE_PNG' echo "$_png" -if test `get_engine_build sword25` = yes && test ! "$_png" = yes ; then - echo "...disabling Broken Sword 2.5 engine. PNG is required" - engine_disable sword25 -fi - # # Check for Theora Decoder # @@ -3317,11 +3407,6 @@ fi define_in_config_if_yes "$_zlib" 'USE_ZLIB' echo "$_zlib" -if test `get_engine_build sword25` = yes && test ! "$_zlib" = yes ; then - echo "...disabling Broken Sword 2.5 engine. ZLib is required" - engine_disable sword25 -fi - # # Check for Sparkle if updates support is enabled # @@ -3868,6 +3953,9 @@ sh -c " fi" 2>/dev/null & for engine in $_engines; do + # Check whether all dependencies are available + check_engine_deps $engine + if test "`get_engine_sub $engine`" = "no" ; then # It's a main engine if test `get_engine_build $engine` = no ; then @@ -3893,9 +3981,6 @@ for engine in $_engines; do isbuilt=STATIC_PLUGIN fi fi - - # Prepare the information to be shown - prepare_engine_build_strings $engine else # It's a subengine, just say yes or no if test "`get_engine_build $engine`" = "no" ; then @@ -3914,6 +3999,14 @@ for engine in $_engines; do fi done +# Prepare the information to be shown +for engine in $_engines; do + if test "`get_engine_sub $engine`" = "no" ; then + # It's a main engine + prepare_engine_build_strings $engine + fi +done + # # Detection of WIP/unstable engines # @@ -3941,28 +4034,28 @@ fi echo if test -n "$_engines_built_static" ; then echo "Engines (builtin):" - echo $_engines_built_static | sed 's/@/\ + echo "$_engines_built_static" | sed 's/@/\ /g s/#/ /g' fi if test -n "$_engines_built_dynamic" ; then echo "Engines (plugins):" - echo $_engines_built_dynamic | sed 's/@/\ + echo "$_engines_built_dynamic" | sed 's/@/\ /g s/#/ /g' fi if test -n "$_engines_skipped" ; then echo "Engines Skipped:" - echo $_engines_skipped | sed 's/@/\ + echo "$_engines_skipped" | sed 's/@/\ /g s/#/ /g' fi if test -n "$_engines_built_wip" ; then echo "WARNING: This ScummVM build contains the following UNSTABLE engines:" - echo $_engines_built_wip | sed 's/@/\ + echo "$_engines_built_wip" | sed 's/@/\ /g s/#/ /g' fi |