diff options
author | Marisa-Chan | 2014-06-13 21:43:04 +0700 |
---|---|---|
committer | Marisa-Chan | 2014-06-13 21:43:04 +0700 |
commit | 45589950c0fb1a449351e6a00ef10d42290d8bae (patch) | |
tree | 44e4eedcb7e69d5fc386155b000ed038af07251d /configure | |
parent | 48360645dcd5f8fddb135b6e31ae5cae4be8d77f (diff) | |
parent | 5c005ad3a3f1df0bc968c85c1cf0fc48e36ab0b2 (diff) | |
download | scummvm-rg350-45589950c0fb1a449351e6a00ef10d42290d8bae.tar.gz scummvm-rg350-45589950c0fb1a449351e6a00ef10d42290d8bae.tar.bz2 scummvm-rg350-45589950c0fb1a449351e6a00ef10d42290d8bae.zip |
Merge remote-tracking branch 'upstream/master' into zvision
Conflicts:
engines/zvision/animation/rlf_animation.cpp
engines/zvision/animation_control.h
engines/zvision/core/console.cpp
engines/zvision/core/events.cpp
engines/zvision/cursors/cursor.cpp
engines/zvision/cursors/cursor_manager.cpp
engines/zvision/cursors/cursor_manager.h
engines/zvision/fonts/truetype_font.cpp
engines/zvision/graphics/render_manager.cpp
engines/zvision/graphics/render_manager.h
engines/zvision/inventory/inventory_manager.h
engines/zvision/inventory_manager.h
engines/zvision/meta_animation.h
engines/zvision/module.mk
engines/zvision/scripting/actions.cpp
engines/zvision/scripting/control.h
engines/zvision/scripting/controls/animation_control.cpp
engines/zvision/scripting/controls/animation_control.h
engines/zvision/scripting/controls/input_control.cpp
engines/zvision/scripting/controls/lever_control.cpp
engines/zvision/scripting/controls/timer_node.cpp
engines/zvision/scripting/controls/timer_node.h
engines/zvision/scripting/puzzle.h
engines/zvision/scripting/scr_file_handling.cpp
engines/zvision/scripting/script_manager.cpp
engines/zvision/scripting/script_manager.h
engines/zvision/sidefx.cpp
engines/zvision/sound/zork_raw.cpp
engines/zvision/sound/zork_raw.h
engines/zvision/video/video.cpp
engines/zvision/video/zork_avi_decoder.h
engines/zvision/zvision.cpp
engines/zvision/zvision.h
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 303 |
1 files changed, 266 insertions, 37 deletions
@@ -97,7 +97,9 @@ add_feature() { _srcdir=`dirname $0` # Read list of engines -. $_srcdir/engines/configure.engines +for i in $_srcdir/engines/*/configure.engine; do + . "$i" +done # # Default settings @@ -124,7 +126,7 @@ _opengl=auto _opengles=auto _readline=auto _freetype2=auto -_taskbar=yes +_taskbar=auto _updates=no _libunity=auto # Default option behavior yes/no @@ -848,7 +850,9 @@ Fine tuning of the installation directories: Special configuration feature: --host=HOST cross-compile to target HOST (arm-linux, ...) - special targets: android for Android + special targets: android-arm for Android ARM + android-mips for Android MIPS + android-x86 for Android x86 tizen for Samsung Tizen caanoo for Caanoo dingux for Dingux @@ -963,6 +967,7 @@ Optional Libraries: --with-freetype2-prefix=DIR Prefix where the freetype-config script is installed (optional) + --disable-freetype2 disable freetype2 TTF library usage [autodetect] --with-nasm-prefix=DIR Prefix where nasm executable is installed (optional) --disable-nasm disable assembly language optimizations [autodetect] @@ -1269,11 +1274,21 @@ get_system_exe_extension $guessed_host NATIVEEXEEXT=$_exeext case $_host in -android | android-v7a | ouya) +android | android-arm | android-v7a | android-arm-v7a | ouya) _host_os=android _host_cpu=arm _host_alias=arm-linux-androideabi ;; +android-mips) + _host_os=android + _host_cpu=mipsel + _host_alias=mipsel-linux-android + ;; +android-x86) + _host_os=android + _host_cpu=i686 + _host_alias=i686-linux-android + ;; arm-riscos) _host_os=riscos _host_cpu=arm @@ -1303,7 +1318,7 @@ ds) gamecube) _host_os=gamecube _host_cpu=ppc - _host_alias=powerpc-gekko + _host_alias=powerpc-eabi ;; gp2x) _host_os=gph-linux @@ -1376,6 +1391,9 @@ ps2) _host_os=ps2 _host_cpu=mips64r5900el _host_alias=ee + # PS2 bogus dirs: they actually depend on launch medium + datadir='host:data' + docdir='host:docs' ;; ps3) _host_os=ps3 @@ -1426,7 +1444,7 @@ webos) wii) _host_os=wii _host_cpu=ppc - _host_alias=powerpc-gekko + _host_alias=powerpc-eabi ;; wince) _host_os=wince @@ -1473,8 +1491,16 @@ caanoo | gp2x | gp2xwiz | openpandora | ps2) esac if test "$_debug_build" != no; then - # debug mode not explicitly disabled -> compile with -g - CXXFLAGS="$CXXFLAGS -g" + # debug mode not explicitly disabled -> compile with debug information + case $_host_os in + amigaos*) + # AmigaOS debugger uses plain stabs, with no gdb extensions. + CXXFLAGS="$CXXFLAGS -gstabs" + ;; + *) + # Use the system default format for debug info. + CXXFLAGS="$CXXFLAGS -g" + esac fi if test "$_release_build" = yes; then @@ -1817,6 +1843,15 @@ if test "$_global_constructors" = yes; then fi echo $_global_constructors +echo_n "Checking for $_host_alias-strings... " >> "$TMPLOG" +if test ! "x$(which $_host_alias-strings 2>/dev/null)" = "x"; then +_strings=$_host_alias-strings +echo yes >> "$TMPLOG" +else +_strings=strings +echo no >> "$TMPLOG" +fi + # # Check for endianness # @@ -1831,9 +1866,9 @@ void _ebcdic() { char* s = (char*) ebcdic_mm; s = (char*) ebcdic_ii; } int main() { _ascii (); _ebcdic (); return 0; } EOF $CXX $CXXFLAGS -c -o $TMPO.o tmp_endianness_check.cpp -if strings $TMPO.o | grep BIGenDianSyS >/dev/null; then +if $_strings $TMPO.o | grep BIGenDianSyS >/dev/null; then _endian=big -elif strings $TMPO.o | grep LiTTleEnDian >/dev/null; then +elif $_strings $TMPO.o | grep LiTTleEnDian >/dev/null; then _endian=little fi echo $_endian; @@ -2031,34 +2066,65 @@ echo_n "Checking hosttype... " echo $_host_os case $_host_os in amigaos*) - LDFLAGS="$LDFLAGS -use-dynld" + LDFLAGS="$LDFLAGS -use-dynld -Wl,--export-dynamic" LDFLAGS="$LDFLAGS -L/sdk/local/newlib/lib" # We have to use 'long' for our 4 byte typedef because AmigaOS already typedefs (u)int32 # as (unsigned) long, and consequently we'd get a compiler error otherwise. type_4_byte='long' + # Supress format warnings as the long 4 byte causes noisy warnings. + CXXFLAGS="$CXXFLAGS -Wno-format" add_line_to_config_mk 'AMIGAOS = 1' ;; android) case $_host in - android) + android | android-arm) CXXFLAGS="$CXXFLAGS -march=armv5te" CXXFLAGS="$CXXFLAGS -mtune=xscale" CXXFLAGS="$CXXFLAGS -msoft-float" + ABI="armeabi" + ANDROID_PLATFORM=4 + ANDROID_PLATFORM_ARCH="arm" ;; - android-v7a) + android-v7a | android-arm-v7a) CXXFLAGS="$CXXFLAGS -march=armv7-a" CXXFLAGS="$CXXFLAGS -mfloat-abi=softfp" CXXFLAGS="$CXXFLAGS -mfpu=vfp" LDFLAGS="$LDFLAGS -Wl,--fix-cortex-a8" + ABI="armeabi-v7a" + ANDROID_PLATFORM=4 + ANDROID_PLATFORM_ARCH="arm" + ;; + android-mips) + CXXFLAGS="$CXXFLAGS -march=mips32" + CXXFLAGS="$CXXFLAGS -mtune=mips32" + ABI="mips" + # Platform version 9 is needed as earlier versions of platform do not support this arch. + ANDROID_PLATFORM=9 + ANDROID_PLATFORM_ARCH="mips" + ;; + android-x86) + CXXFLAGS="$CXXFLAGS -march=i686" + CXXFLAGS="$CXXFLAGS -mtune=i686" + ABI="x86" + # Platform version 9 is needed as earlier versions of platform do not support this arch. + ANDROID_PLATFORM=9 + ANDROID_PLATFORM_ARCH="x86" ;; ouya) CXXFLAGS="$CXXFLAGS -march=armv7-a" CXXFLAGS="$CXXFLAGS -mtune=cortex-a9" CXXFLAGS="$CXXFLAGS -mfloat-abi=softfp" CXXFLAGS="$CXXFLAGS -mfpu=neon" + ABI="armeabi-v7a" + ANDROID_PLATFORM=4 + ANDROID_PLATFORM_ARCH="arm" ;; esac - CXXFLAGS="$CXXFLAGS --sysroot=$ANDROID_NDK/platforms/android-4/arch-arm" + + # Setup platform version and arch + CXXFLAGS="$CXXFLAGS --sysroot=$ANDROID_NDK/platforms/android-$ANDROID_PLATFORM/arch-$ANDROID_PLATFORM_ARCH" + LDFLAGS="$LDFLAGS --sysroot=$ANDROID_NDK/platforms/android-$ANDROID_PLATFORM/arch-$ANDROID_PLATFORM_ARCH" + CXXFLAGS="$CXXFLAGS -fpic" CXXFLAGS="$CXXFLAGS -ffunction-sections" CXXFLAGS="$CXXFLAGS -funwind-tables" @@ -2071,16 +2137,25 @@ case $_host_os in fi CXXFLAGS="$CXXFLAGS -finline-limit=300" _optimization_level=-Os - CXXFLAGS="$CXXFLAGS -mthumb-interwork" - # FIXME: Why is the following in CXXFLAGS and not in DEFINES? Change or document this. - CXXFLAGS="$CXXFLAGS -D__ARM_ARCH_5__" - CXXFLAGS="$CXXFLAGS -D__ARM_ARCH_5T__" - CXXFLAGS="$CXXFLAGS -D__ARM_ARCH_5E__" - CXXFLAGS="$CXXFLAGS -D__ARM_ARCH_5TE__" - # supress 'mangling of 'va_list' has changed in GCC 4.4' + + if test "$_host" = android -o "$_host" = android-arm; then + CXXFLAGS="$CXXFLAGS -mthumb-interwork" + # FIXME: Why is the following in CXXFLAGS and not in DEFINES? Change or document this. + CXXFLAGS="$CXXFLAGS -D__ARM_ARCH_5__" + CXXFLAGS="$CXXFLAGS -D__ARM_ARCH_5T__" + CXXFLAGS="$CXXFLAGS -D__ARM_ARCH_5E__" + CXXFLAGS="$CXXFLAGS -D__ARM_ARCH_5TE__" + fi + + # surpress 'mangling of 'va_list' has changed in GCC 4.4' warning CXXFLAGS="$CXXFLAGS -Wno-psabi" - LDFLAGS="$LDFLAGS --sysroot=$ANDROID_NDK/platforms/android-4/arch-arm" - LDFLAGS="$LDFLAGS -mthumb-interwork" + + if test "$_host" = android -o "$_host" = android-arm; then + LDFLAGS="$LDFLAGS -mthumb-interwork" + fi + + LDFLAGS="$LDFLAGS -L$ANDROID_NDK/sources/cxx-stl/gnu-libstdc++/`$CXX -dumpversion`/libs/$ABI/" + LIBS="$LIBS -lsupc++" add_line_to_config_mk "ANDROID_SDK = $ANDROID_SDK" _seq_midi=no ;; @@ -2128,6 +2203,49 @@ case $_host_os in echo "Set staticlib-prefix to ${_staticlibpath}" fi fi + + # Fink + # There is no way to get the prefix, so implementing a hack here + fink_version=`fink -V 2>/dev/null` + if test "$?" -eq 0; then + fink_version="`echo "${fink_version}" | sed -ne 's/Package manager version: \([0-9.]*\)/\1/gp'`" + echo_n "You seem to be running Fink version ${fink_version}..." + + fink_prefix=`which fink` + # strip off /bin/fink from /sw/bin/port + fink_prefix=`dirname ${fink_prefix}` + fink_prefix=`dirname ${fink_prefix}` + + echo "adding ${fink_prefix} to paths" + + LDFLAGS="-L${fink_prefix}/lib $LDFLAGS" + CXXFLAGS="-I${fink_prefix}/include $CXXFLAGS" + + if test -z "$_staticlibpath"; then + _staticlibpath=${fink_prefix} + echo "Set staticlib-prefix to ${_staticlibpath}" + fi + fi + + # Homebrew + brew_version=`brew -v 2>/dev/null` + if test "$?" -eq 0; then + brew_version="`echo "${brew_version}" | sed -ne 's/Homebrew \([0-9.]*\)/\1/gp'`" + echo_n "You seem to be running Homebrew version ${brew_version}..." + + brew_prefix=`brew --prefix` + + echo "adding ${brew_prefix} to paths" + + LDFLAGS="-L${brew_prefix}/lib $LDFLAGS" + CXXFLAGS="-I${brew_prefix}/include $CXXFLAGS" + + if test -z "$_staticlibpath"; then + _staticlibpath=${brew_prefix} + echo "Set staticlib-prefix to ${_staticlibpath}" + fi + fi + # If _staticlibpath is not set yet try first /sw (fink) then /usr/local # (the macports case is handled above). if test -z "$_staticlibpath"; then @@ -2250,6 +2368,9 @@ case $_host_os in CXXFLAGS="$CXXFLAGS -G2" DEFINES="$DEFINES -D_EE" DEFINES="$DEFINES -D__PLAYSTATION2__" + if test -z "$PS2SDK_OLD"; then + DEFINES="$DEFINES -D__NEW_PS2SDK__" + fi ;; ps3) # Force use of SDL and freetype from the ps3 toolchain @@ -2345,7 +2466,7 @@ if test -n "$_host"; then # Cross-compiling mode - add your target here if needed echo "Cross-compiling to $_host" case "$_host" in - android | android-v7a | ouya) + android | android-arm | android-v7a | android-arm-v7a | android-mips | android-x86 | ouya) # we link a .so as default LDFLAGS="$LDFLAGS -shared" LDFLAGS="$LDFLAGS -Wl,-Bsymbolic,--no-undefined" @@ -2421,6 +2542,8 @@ if test -n "$_host"; then CXXFLAGS="$CXXFLAGS -fschedule-insns2" CXXFLAGS="$CXXFLAGS -fomit-frame-pointer" CXXFLAGS="$CXXFLAGS -fdelete-null-pointer-checks" + # no-delayed-branch is a workaround for GCC bug #42841 - "SH: Assembler complains pcrel too far." + CXXFLAGS="$CXXFLAGS -fno-delayed-branch" _backend="dc" _build_scalers=no _mad=yes @@ -2488,6 +2611,7 @@ if test -n "$_host"; then ;; iphone) DEFINES="$DEFINES -DIPHONE" + ASFLAGS="$ASFLAGS -arch armv6" _backend="iphone" _build_scalers=no _mt32emu=no @@ -2629,6 +2753,8 @@ if test -n "$_host"; then DEFINES="$DEFINES -DDISABLE_DOSBOX_OPL" DEFINES="$DEFINES -DDISABLE_SID" DEFINES="$DEFINES -DDISABLE_NES_APU" + CXXFLAGS="$CXXFLAGS -fno-exceptions" + CXXFLAGS="$CXXFLAGS -fno-rtti" _backend="ps2" _build_scalers=no _mt32emu=no @@ -2636,10 +2762,15 @@ if test -n "$_host"; then # This trick doesn't work for tremor right now, as the PS2 port the resulting library # libtremor, while our code later on expects it to be called libvorbisidec. # TODO: Enable tremor, e.g. by adding -ltremor or by renaming the lib. + # Disable this for older SDK as this breaks the build otherwise... + if test -z "$PS2SDK_OLD"; then + _tremor=yes + fi _mad=yes _zlib=yes # HACK to fix compilation of C source files for now. - add_line_to_config_mk 'CC = ee-gcc' + add_line_to_config_mk 'CC := ee-gcc' + add_line_to_config_mk 'CFLAGS := -std=c99 -W -Wno-unused-parameter -Wconversion -pedantic -G2 -s -O2 -Wuninitialized' # HACK to fix linking for now. It seems ee-g++ does not handle linking correctly. LD=ee-gcc @@ -2681,7 +2812,6 @@ if test -n "$_host"; then _backend="tizen" _port_mk="backends/platform/tizen/tizen.mk" _arm_asm=yes - _taskbar=no _build_scalers=no _seq_midi=no _mt32emu=no @@ -2771,8 +2901,8 @@ case $_backend in ;; iphone) LIBS="$LIBS -lobjc -framework UIKit -framework CoreGraphics -framework OpenGLES" - LIBS="$LIBS -framework QuartzCore -framework GraphicsServices -framework CoreFoundation" - LIBS="$LIBS -framework Foundation -framework AudioToolbox -framework CoreAudio" + LIBS="$LIBS -framework QuartzCore -framework CoreFoundation -framework Foundation" + LIBS="$LIBS -framework AudioToolbox -framework CoreAudio" ;; linuxmoto) DEFINES="$DEFINES -DLINUXMOTO" @@ -3157,9 +3287,10 @@ POST_OBJS_FLAGS := -Wl,--export-all-symbols -Wl,--no-whole-archive -Wl,--out-im ;; ps2) _elf_loader=yes + DEFINES="$DEFINES -DUNCACHED_PLUGINS" _mak_plugins=' -LDFLAGS += -mno-crt0 $(PS2SDK)/ee/startup/crt0.o -Wl,-T$(srcdir)/backends/plugins/ps2/main_prog.ld -PLUGIN_LDFLAGS += -mno-crt0 $(PS2SDK)/ee/startup/crt0.o -Wl,-T$(srcdir)/backends/plugins/ps2/plugin.ld -lstdc++ -lc +LDFLAGS += -mno-crt0 $(PS2SDK)/ee/startup/crt0.o -Wl,-T$(srcdir)/backends/plugins/ps2/main_prog.ld +PLUGIN_LDFLAGS += -mno-crt0 $(PS2SDK)/ee/startup/crt0.o -Wl,-T$(srcdir)/backends/plugins/ps2/plugin.ld -lstdc++ -lc ' ;; psp) @@ -3295,6 +3426,8 @@ if test "$_tremor" = yes && test "$_vorbis" = no; then if test "$_tremolo" = yes ; then add_line_to_config_h '#define USE_TREMOLO' LIBS="$LIBS $TREMOR_LIBS -ltremolo" + elif test "$_host" = ps2 ; then + LIBS="-ltremor $LIBS" else LIBS="$LIBS $TREMOR_LIBS -lvorbisidec" fi @@ -3665,6 +3798,25 @@ fi if test "$_readline" = yes ; then LIBS="$LIBS $READLINE_LIBS $_READLINE_LIBS" INCLUDES="$INCLUDES $READLINE_CFLAGS" + + # + # Check the type of rl_completion_entry_function. + # It can be int(*)(const char *, int) or char *(*)(const char *, int). + # + cat > $TMPC << EOF +#include <stdio.h> +#include <readline/readline.h> +#include <readline/history.h> + +int readline_completionFunction(const char *, int); + +int main(void) { + char *x = readline(""); + rl_completion_entry_function = &readline_completionFunction; +} +EOF + cc_check -c && add_line_to_config_h '#define USE_READLINE_INT_COMPLETION' + fi define_in_config_h_if_yes "$_readline" 'USE_READLINE' @@ -3703,7 +3855,7 @@ if test "$_libunity" = yes ; then LIBS="$LIBS $LIBUNITY_LIBS" INCLUDES="$INCLUDES $LIBUNITY_CFLAGS" fi -define_in_config_h_if_yes "$_libunity" 'USE_TASKBAR_UNITY' +define_in_config_h_if_yes "$_libunity" 'USE_UNITY' fi echo "$_libunity" @@ -3965,24 +4117,31 @@ fi # Check whether to build taskbar integration support # echo_n "Building taskbar integration support... " -define_in_config_if_yes $_taskbar 'USE_TASKBAR' -if test "$_taskbar" = yes; then +if test "$_taskbar" = "no"; then + echo "no" +else case $_host_os in mingw*) LIBS="$LIBS -lole32 -luuid" echo "win32" + _taskbar=yes + ;; + darwin*) + echo "osx" + _taskbar=yes ;; *) if test "$_libunity" = yes; then echo "unity" + _taskbar=yes else - echo "$_taskbar" + echo "no" + _taskbar=no fi ;; esac -else - echo "$_taskbar" fi +define_in_config_if_yes $_taskbar 'USE_TASKBAR' # # Check whether to build Bink video support @@ -4031,6 +4190,10 @@ case $_backend in # without a scummvm sub directory. DEFINES="$DEFINES -DPLUGIN_DIRECTORY=\\\"$libdir\\\"" ;; + ps2) + # PS2 bogus dir: it actually depends on launch medium + DEFINES="$DEFINES -DPLUGIN_DIRECTORY=\\\"host:plugins\\\"" + ;; *) DEFINES="$DEFINES -DPLUGIN_DIRECTORY=\\\"$libdir/scummvm\\\"" ;; @@ -4197,8 +4360,18 @@ for engine in $_engines; do fi done -# Prepare the information to be shown +# Sort engines to place our headline engine at start... +# No technical reason, just historical convention +headline_engine=scumm +_sorted_engines="${headline_engine}" for engine in $_engines; do + if test "${engine}" != "${headline_engine}" ; then + _sorted_engines="${_sorted_engines} ${engine}" + fi +done + +# Prepare the information to be shown +for engine in $_sorted_engines; do if test "`get_engine_sub $engine`" = "no" ; then # It's a main engine prepare_engine_build_strings $engine @@ -4380,3 +4553,59 @@ include \$(srcdir)/Makefile EOF fi + +# Ensure engines folder exists prior to trying to generate +# files into it (used for out-of-tree-builds) +mkdir -p engines + +echo "Creating engines/engines.mk" +cat > engines/engines.mk << EOF +# This file is automatically generated by configure +# DO NOT EDIT MANUALLY +# This file is being included by "Makefile.common" +EOF + +for engine in $_sorted_engines; do + j=`echo $engine | tr '[:lower:]' '[:upper:]'` + if test "`get_engine_sub $engine`" = "no" ; then + # main engine + cat >> engines/engines.mk << EOF + +ifdef ENABLE_$j +DEFINES += -DENABLE_$j=\$(ENABLE_$j) +MODULES += engines/$engine +EOF + + for subeng in `get_engine_subengines $engine` ; do + k=`echo $subeng | tr '[:lower:]' '[:upper:]'` + cat >> engines/engines.mk << EOF + +ifdef ENABLE_$k +DEFINES += -DENABLE_$k +endif +EOF + done + + cat >> engines/engines.mk << EOF +endif +EOF + fi +done + +echo "Creating engines/plugins_table.h" +cat > engines/plugins_table.h << EOF +/* This file is automatically generated by configure */ +/* DO NOT EDIT MANUALLY */ +// This file is being included by "base/plugins.cpp" +EOF + +for engine in $_sorted_engines; do + if test "`get_engine_sub $engine`" = "no" ; then + j=`echo $engine | tr '[:lower:]' '[:upper:]'` + cat >> engines/plugins_table.h << EOF +#if PLUGIN_ENABLED_STATIC($j) +LINK_PLUGIN($j) +#endif +EOF + fi +done |