aboutsummaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorJohannes Schickel2012-08-31 22:03:41 +0200
committerJohannes Schickel2012-08-31 22:30:25 +0200
commit1cc58ce6795005b05a018209d05c002fc8d746ac (patch)
tree9ebc6620f8b534b22f74582f839f4393dae04641 /configure
parentede8b063cc936feff74569e79f93e138b9d2a250 (diff)
downloadscummvm-rg350-1cc58ce6795005b05a018209d05c002fc8d746ac.tar.gz
scummvm-rg350-1cc58ce6795005b05a018209d05c002fc8d746ac.tar.bz2
scummvm-rg350-1cc58ce6795005b05a018209d05c002fc8d746ac.zip
CONFIGURE: Allow dependency checks for engines.
Also adds PNG as a dependency for sword25 and removes the hardcoded check for it.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure36
1 files changed, 31 insertions, 5 deletions
diff --git a/configure b/configure
index 2a86a5a4c1..29c5f6ca4a 100755
--- a/configure
+++ b/configure
@@ -72,6 +72,7 @@ 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}_deps "${5}"
for sub in ${4}; do
set_var _engine_${sub}_sub "yes"
done
@@ -464,6 +465,11 @@ get_engine_subengines() {
get_var _engine_$1_subengines
}
+# Get the dependencies
+get_engine_dependencies() {
+ get_var _engine_$1_deps
+}
+
# Ask if this is a subengine
get_engine_sub() {
sub=`get_var _engine_$1_sub`
@@ -532,6 +538,28 @@ 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` = yes ; then
+ # Collect unmet dependencies
+ for dep in `get_engine_dependencies $1`; do
+ if test `get_var _${dep}` = no ; then
+ unmet_deps="${unmet_deps}${dep} "
+ 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`
@@ -3204,11 +3232,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
#
@@ -3870,6 +3893,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