aboutsummaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure170
1 files changed, 124 insertions, 46 deletions
diff --git a/configure b/configure
index 8d9f54e1d9..d71501098a 100755
--- a/configure
+++ b/configure
@@ -87,7 +87,7 @@ add_engine agi "AGI" yes
add_engine agos "AGOS" yes
add_engine cine "Cinematique evo 1" yes
add_engine cruise "Cinematique evo 2" no
-add_engine drascula "Drascula: The Vampire Strikes Back" no
+add_engine drascula "Drascula: The Vampire Strikes Back" yes
add_engine gob "Gobli*ns" yes
add_engine igor "Igor: Objective Uikokahonia" no
add_engine kyra "Legend of Kyrandia" yes
@@ -105,7 +105,8 @@ add_engine touche "Touche: The Adventures of the Fifth Musketeer" yes
_endian=unknown
_need_memalign=no
_have_x86=no
-_build_plugins=no
+_dynamic_modules=no
+_plugins_default=static
_nasm=auto
# more defaults
@@ -363,21 +364,33 @@ get_engine_sub() {
# Enable the given engine
engine_enable() {
- engine=`echo $1 | sed 's/-/_/g'`
- if test "`get_engine_build ${engine}`" = "no" ; then
- eval _engine_${engine}_build=yes
+ # Get the parameter
+ if ( echo $1 | grep '=' ) 2> /dev/null > /dev/null ; then
+ eng=`echo $1 | cut -d '=' -f 1`
+ opt=`echo $1 | cut -d '=' -f 2`
+ else
+ eng=$1
+ opt=yes
+ fi
+ engine=`echo $eng | sed 's/-/_/g'`
+ if test "$opt" = "static" -o "$opt" = "dynamic" -o "$opt" = "yes" ; then
+ if test "`get_engine_build ${engine}`" != "$opt" ; then
+ eval _engine_${engine}_build=$opt
+ else
+ option_error
+ fi
else
- option_error --enable-$1
+ option_error
fi
}
# Disable the given engine
engine_disable() {
engine=`echo $1 | sed 's/-/_/g'`
- if test "`get_engine_build $engine`" = "yes" ; then
+ if test "`get_engine_build $engine`" != "no" ; then
eval _engine_${engine}_build=no
else
- option_error --disable-$1
+ option_error
fi
}
@@ -420,27 +433,35 @@ show_subengine_help() {
# Prepare the strings about the engines to build
prepare_engine_build_strings() {
- string_yes=`get_engine_build_string $1 yes`
- if test -n "$string_yes" ; then
- _engines_built="${_engines_built}#$string_yes@"
+ string=`get_engine_build_string $1 static`
+ if test -n "$string" ; then
+ _engines_built_static="${_engines_built_static}#$string@"
fi
- string_no=`get_engine_build_string $1 no`
- if test -n "$string_no" ; then
- _engines_skipped="${_engines_skipped}#$string_no@"
+ string=`get_engine_build_string $1 dynamic`
+ if test -n "$string" ; then
+ _engines_built_dynamic="${_engines_built_dynamic}#$string@"
+ fi
+
+ string=`get_engine_build_string $1 no`
+ if test -n "$string" ; then
+ _engines_skipped="${_engines_skipped}#$string@"
fi
}
# Get the string about building an engine
get_engine_build_string() {
engine_string=""
- if test `get_engine_build $1` = no ; then
+ engine_build=`get_engine_build $1`
+ if test $engine_build = no ; then
+ # The engine is disabled
if test $2 = no ; then
engine_string=`get_engine_name $1`
else
engine_string=""
fi
else
+ # The engine is enabled, get the custom string
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 $2`
@@ -448,12 +469,16 @@ get_engine_build_string() {
engine_string=`get_subengines_build_string $1 $2`
fi
- if test $2 = yes ; then
- engine_string="`get_engine_name $1` $engine_string"
- else
+ if test $2 = no ; then
if test -n "$engine_string" ; then
engine_string="`get_engine_name $1` $engine_string"
fi
+ else
+ if test $2 = $engine_build ; then
+ engine_string="`get_engine_name $1` $engine_string"
+ else
+ engine_string=""
+ fi
fi
fi
@@ -471,7 +496,7 @@ get_subengines_build_string() {
all=no
fi
done
- if test $2 = yes ; then
+ if test $2 != no ; then
if test -n "$subengine_string" ; then
if test $all = yes ; then
subengine_string="[all games]"
@@ -484,7 +509,7 @@ get_subengines_build_string() {
# Engine specific build strings
get_sword1_build_string() {
- if test $2 = yes ; then
+ if test $2 != no ; then
if test "$_mpeg2" = yes ; then
echo "(w/ mpeg2 cutscenes)"
else
@@ -498,7 +523,7 @@ get_sword2_build_string() {
}
get_scumm_build_string() {
- if test $2 = yes ; then
+ if test $2 != no ; then
base="[v0-v6 games]"
fi
get_subengines_build_string $1 $2 "$base"
@@ -539,8 +564,9 @@ Configuration:
Installation directories:
--prefix=DIR use this prefix for installing ScummVM [/usr/local]
--bindir=DIR directory to install the scummvm binary in [PREFIX/bin]
- --mandir=DIR directory to install the manpage in [PREFIX/man]
+ --mandir=DIR directory to install the manpage in [PREFIX/share/man]
--datadir=DIR directory to install the data files in [PREFIX/share]
+ --libdir=DIR directory to install the plugins in [PREFIX/lib]
Special configuration feature:
--host=HOST cross-compile to target HOST (arm-linux, ...)
@@ -550,8 +576,8 @@ Optional Features:
--disable-debug disable building with debugging symbols
--enable-Werror treat warnings as errors
$engines_help
- --enable-plugins build engines as loadable modules instead of
- static linking them
+ --enable-plugins enable the support for dynamic plugins
+ --default-dynamic make plugins dynamic by default
--disable-mt32emu don't enable the integrated MT-32 emulator
--disable-hq-scalers exclude HQ2x and HQ3x scalers
--disable-scalers exclude scalers
@@ -628,7 +654,8 @@ for ac_option in $@; do
--disable-nasm) _nasm=no ;;
--disable-mpeg2) _mpeg2=no ;;
--disable-fluidsynth) _fluidsynth=no ;;
- --enable-plugins) _build_plugins=yes ;;
+ --enable-plugins) _dynamic_modules=yes ;;
+ --default-dynamic) _plugins_default=dynamic ;;
--enable-mt32emu) _mt32emu=yes ;;
--disable-mt32emu) _mt32emu=no ;;
--with-fluidsynth-prefix=*)
@@ -714,6 +741,9 @@ for ac_option in $@; do
--datadir=*)
_datadir=`echo $ac_option | cut -d '=' -f 2`
;;
+ --libdir=*)
+ _libdir=`echo $ac_option | cut -d '=' -f 2`
+ ;;
--enable-*)
engine_enable `echo $ac_option | cut -d '-' -f 4-`
;;
@@ -721,7 +751,7 @@ for ac_option in $@; do
engine_disable `echo $ac_option | cut -d '-' -f 4-`
;;
*)
- option_error $ac_option
+ option_error
;;
esac;
done;
@@ -893,12 +923,6 @@ if test "$_cxx_major" -ge "3" ; then
add_line_to_config_mk 'HAVE_GCC3 = 1'
fi;
-#
-# Engine selection
-#
-for engine in $_engines; do
- add_to_config_mk_if_no `get_engine_build $engine` "DISABLE_`echo $engine | tr [a-z] [A-Z]` = 1"
-done
add_to_config_mk_if_no $_build_hq_scalers 'DISABLE_HQ_SCALERS = 1'
add_to_config_mk_if_no $_build_scalers 'DISABLE_SCALERS = 1'
@@ -1193,11 +1217,11 @@ add_to_config_h_if_yes $_need_memalign '#define SCUMM_NEED_ALIGNMENT'
# Check whether plugin support is requested and possible
#
echo_n "Checking whether building plugins was requested... "
-echo "$_build_plugins"
+echo "$_dynamic_modules"
_mak_plugins=
_def_plugin="/* -> plugins disabled */"
-if test "$_build_plugins" = yes ; then
+if test "$_dynamic_modules" = yes ; then
echo_n "Checking whether building plugins is supported... "
case $_host_os in
linux*)
@@ -1206,7 +1230,7 @@ _def_plugin='
#define PLUGIN_SUFFIX ".so"
'
_mak_plugins='
-BUILD_PLUGINS := 1
+DYNAMIC_MODULES := 1
PLUGIN_PREFIX := lib
PLUGIN_SUFFIX := .so
PLUGIN_EXTRA_DEPS =
@@ -1224,7 +1248,7 @@ _def_plugin='
#define PLUGIN_SUFFIX ".so"
'
_mak_plugins='
-BUILD_PLUGINS := 1
+DYNAMIC_MODULES := 1
PLUGIN_PREFIX := lib
PLUGIN_SUFFIX := .so
PLUGIN_EXTRA_DEPS =
@@ -1241,7 +1265,7 @@ _def_plugin='
#define PLUGIN_SUFFIX ".plugin"
'
_mak_plugins='
-BUILD_PLUGINS := 1
+DYNAMIC_MODULES := 1
PLUGIN_PREFIX :=
PLUGIN_SUFFIX := .plugin
PLUGIN_EXTRA_DEPS = $(EXECUTABLE)
@@ -1258,7 +1282,7 @@ _def_plugin='
#define PLUGIN_SUFFIX ".dll"
'
_mak_plugins='
-BUILD_PLUGINS := 1
+DYNAMIC_MODULES := 1
PLUGIN_PREFIX :=
PLUGIN_SUFFIX := .dll
PLUGIN_EXTRA_DEPS = $(EXECUTABLE)
@@ -1269,12 +1293,12 @@ POST_OBJS_FLAGS := -Wl,--export-all-symbols -Wl,--no-whole-archive -Wl,--out-im
'
;;
*)
- _build_plugins=no
+ _dynamic_modules=no
_mak_plugins=
_def_plugin=
;;
esac
- echo "$_build_plugins"
+ echo "$_dynamic_modules"
fi
@@ -1521,27 +1545,80 @@ add_to_config_mk_if_yes $_nasm 'HAVE_NASM = 1'
test -z "$_bindir" && _bindir="$_prefix/bin"
test -z "$_mandir" && _mandir="$_prefix/share/man"
test -z "$_datadir" && _datadir="$_prefix/share"
+test -z "$_libdir" && _libdir="$_prefix/lib"
DEFINES="$DEFINES -DDATA_PATH=\\\"$_datadir/scummvm\\\""
+DEFINES="$DEFINES -DPLUGIN_DIRECTORY=\\\"$_libdir/scummvm\\\""
#
-# Show which engines ("frontends") are to be built
+# Engine selection
#
-
-_engines_built=""
+_engines_built_static=""
+_engines_built_dynamic=""
_engines_skipped=""
for engine in $_engines; do
if test "`get_engine_sub $engine`" = "no" ; then
+ # It's a main engine
+ if test `get_engine_build $engine` = no ; then
+ isbuilt=no
+ else
+ # If dynamic plugins aren't supported, mark
+ # all the engines as static
+ if test $_dynamic_modules = no ; then
+ eval _engine_${engine}_build=static
+ else
+ # If it wasn't explicitly marked as static or
+ # dynamic, use the configured default
+ if test `get_engine_build $engine` = yes ; then
+ eval _engine_${engine}_build=${_plugins_default}
+ fi
+ fi
+
+ # Prepare the defines
+ if test `get_engine_build $engine` = dynamic ; then
+ isbuilt=DYNAMIC_PLUGIN
+ else
+ eval _engine_${engine}_build=static
+ 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
+ isbuilt=no
+ else
+ isbuilt=1
+ fi
+ fi
+
+ # Save the settings
+ defname="ENABLE_`echo $engine | tr [a-z] [A-Z]`"
+ if test "$isbuilt" = "no" ; then
+ add_line_to_config_mk "# $defname"
+ else
+ add_line_to_config_mk "$defname = $isbuilt"
fi
done
+#
+# Show which engines ("frontends") are to be built
+#
echo
-if test -n "$_engines_built" ; then
- echo "Engines:"
- echo $_engines_built | sed 's/@/\
+if test -n "$_engines_built_static" ; then
+ echo "Engines (builtin):"
+ 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/@/\
/g
s/#/ /g'
fi
@@ -1673,6 +1750,7 @@ PREFIX := $_prefix
BINDIR := $_bindir
MANDIR := $_mandir
DATADIR := $_datadir
+LIBDIR := $_libdir
$_config_mk_data