aboutsummaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure310
1 files changed, 206 insertions, 104 deletions
diff --git a/configure b/configure
index ffcd0c1d6c..a0119bb1b1 100755
--- a/configure
+++ b/configure
@@ -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
@@ -97,7 +108,7 @@ _sndio=auto
_timidity=auto
_zlib=auto
_sparkle=auto
-_png=no
+_png=auto
_theoradec=auto
_faad=auto
_fluidsynth=auto
@@ -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
- all=no
- fi
+ # 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
- # 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
+ 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
- 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"
}
#
@@ -712,7 +805,7 @@ Usage: $0 [OPTIONS]...
Configuration:
-h, --help display this help and exit
- --backend=BACKEND backend to build (android, bada, dc, dingux, ds, gp2x, gph,
+ --backend=BACKEND backend to build (android, bada, dc, dingux, ds, gph,
iphone, linuxmoto, maemo, n64, null, openpandora, ps2,
psp, samsungtv, sdl, webos, wii, wince) [sdl]
@@ -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"
;;
@@ -2079,8 +2174,9 @@ case $_host_os in
DEFINES="$DEFINES -D__PLAYSTATION2__"
;;
ps3)
- # Force use of SDL from the ps3 toolchain
+ # Force use of SDL and freetype from the ps3 toolchain
_sdlpath="$PS3DEV/portlibs/ppu:$PS3DEV/portlibs/ppu/bin"
+ _freetypepath="$PS3DEV/portlibs/ppu:$PS3DEV/portlibs/ppu/bin"
DEFINES="$DEFINES -DPLAYSTATION3"
CXXFLAGS="$CXXFLAGS -mcpu=cell -mminimal-toc -I$PSL1GHT/ppu/include -I$PS3DEV/portlibs/ppu/include"
@@ -2202,13 +2298,8 @@ if test -n "$_host"; then
bfin*)
;;
caanoo)
- # This uses the GPH backend.
- DEFINES="$DEFINES -DGPH_DEVICE"
DEFINES="$DEFINES -DCAANOO"
- DEFINES="$DEFINES -DREDUCE_MEMORY_USAGE"
- if test "$_debug_build" = yes; then
- DEFINES="$DEFINES -DGPH_DEBUG"
- else
+ if test "$_debug_build" = no; then
# Use -O3 on the Caanoo for non-debug builds.
_optimization_level=-O3
fi
@@ -2299,13 +2390,7 @@ if test -n "$_host"; then
add_line_to_config_h "#define USE_WII_DI"
;;
gp2x)
- # This uses the GPH backend.
- DEFINES="$DEFINES -DGPH_DEVICE"
DEFINES="$DEFINES -DGP2X"
- DEFINES="$DEFINES -DREDUCE_MEMORY_USAGE"
- if test "$_debug_build" = yes; then
- DEFINES="$DEFINES -DGPH_DEBUG"
- fi
CXXFLAGS="$CXXFLAGS -march=armv4t"
ASFLAGS="$ASFLAGS -mfloat-abi=soft"
LDFLAGS="$LDFLAGS -static"
@@ -2319,13 +2404,7 @@ if test -n "$_host"; then
_port_mk="backends/platform/gph/gp2x-bundle.mk"
;;
gp2xwiz)
- # This uses the GPH backend.
- DEFINES="$DEFINES -DGPH_DEVICE"
DEFINES="$DEFINES -DGP2XWIZ"
- DEFINES="$DEFINES -DREDUCE_MEMORY_USAGE"
- if test "$_debug_build" = yes; then
- DEFINES="$DEFINES -DGPH_DEBUG"
- fi
CXXFLAGS="$CXXFLAGS -mcpu=arm926ej-s"
CXXFLAGS="$CXXFLAGS -mtune=arm926ej-s"
ASFLAGS="$ASFLAGS -mfloat-abi=soft"
@@ -2611,9 +2690,14 @@ case $_backend in
INCLUDES="$INCLUDES "'-I$(srcdir)/backends/platform/ds/commoninclude'
INCLUDES="$INCLUDES "'-Ibackends/platform/ds/arm9/data'
;;
- gp2x)
- ;;
gph)
+ # On the GPH devices we want fancy themes but do not want the load/save thumbnail grid.
+ DEFINES="$DEFINES -DDISABLE_SAVELOADCHOOSER_GRID"
+ DEFINES="$DEFINES -DGPH_DEVICE"
+ DEFINES="$DEFINES -DREDUCE_MEMORY_USAGE"
+ if test "$_debug_build" = yes; then
+ DEFINES="$DEFINES -DGPH_DEBUG"
+ fi
;;
iphone)
LIBS="$LIBS -lobjc -framework UIKit -framework CoreGraphics -framework OpenGLES"
@@ -2709,7 +2793,7 @@ MODULES="$MODULES backends/platform/$_backend"
# Setup SDL specifics for SDL based backends
#
case $_backend in
- dingux | gp2x | gph | linuxmoto | maemo | openpandora | samsungtv | sdl)
+ dingux | gph | linuxmoto | maemo | openpandora | samsungtv | sdl)
find_sdlconfig
INCLUDES="$INCLUDES `$_sdlconfig --prefix="$_sdlpath" --cflags`"
LIBS="$LIBS `$_sdlconfig --prefix="$_sdlpath" --libs`"
@@ -3323,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
#
@@ -3375,7 +3454,7 @@ if test "$_fluidsynth" = yes ; then
esac
INCLUDES="$INCLUDES $FLUIDSYNTH_CFLAGS"
fi
-define_in_config_h_if_yes "$_fluidsynth" 'USE_FLUIDSYNTH'
+define_in_config_if_yes "$_fluidsynth" 'USE_FLUIDSYNTH'
echo "$_fluidsynth"
#
@@ -3501,6 +3580,21 @@ define_in_config_if_yes "$_freetype2" "USE_FREETYPE2"
# Check for OpenGL (ES)
#
echocheck "OpenGL"
+
+case $_backend in
+ openpandora)
+ # Only enable OpenGL ES on the OpanPandora if --enable-opengl is passed in explicitly.
+ if test "$_opengl" = yes ; then
+ _opengl=yes
+ _opengles=yes
+ OPENGL_LIBS="-lGLES_CM -lEGL -lX11"
+ OPENGL_CFLAGS="$OPENGL_LIBS"
+ LIBS="$LIBS $OPENGL_LIBS"
+ INCLUDES="$INCLUDES $OPENGL_CFLAGS"
+ fi
+ ;;
+esac
+
if test "$_opengl" = auto ; then
_opengl=no
if test "$_backend" = "sdl" ; then
@@ -3859,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
@@ -3884,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
@@ -3905,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
#
@@ -3932,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