diff options
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 733 |
1 files changed, 540 insertions, 193 deletions
@@ -128,13 +128,13 @@ _timidity=auto _zlib=auto _mpeg2=auto _sparkle=auto +_osxdockplugin=auto _jpeg=auto _png=auto _theoradec=auto _faad=auto _fluidsynth=auto -_opengl=auto -_opengles=auto +_opengl_mode=auto _readline=auto _freetype2=auto _taskbar=auto @@ -162,6 +162,7 @@ _translation=yes # Default platform settings _backend=sdl _16bit=auto +_highres=auto _savegame_timestamp=auto _dynamic_modules=no _elf_loader=no @@ -181,6 +182,8 @@ _stagingpath="staging" _win32path="c:/scummvm" _amigaospath="Games:ScummVM" _staticlibpath= +_xcodetoolspath= +_sparklepath= _sdlconfig=sdl-config _freetypeconfig=freetype-config _sdlpath="$PATH" @@ -201,6 +204,7 @@ add_feature 16bit "16bit color" "_16bit" add_feature faad "libfaad" "_faad" add_feature flac "FLAC" "_flac" add_feature freetype2 "FreeType2" "_freetype2" +add_feature highres "high resolution" "_highres" add_feature mad "MAD" "_mad" add_feature jpeg "JPEG" "_jpeg" add_feature png "PNG" "_png" @@ -436,7 +440,7 @@ get_system_exe_extension() { arm-riscos) _exeext=",ff8" ;; - dreamcast | ds | gamecube | n64 | ps2 | psp | wii) + 3ds | dreamcast | ds | gamecube | n64 | ps2 | psp | wii) _exeext=".elf" ;; gph-linux) @@ -593,7 +597,7 @@ engine_enable() { parent=`get_subengine_parent ${engine}` if test `get_engine_build ${parent}` = "no" ; then set_var _engine_${parent}_build "yes" - fi + fi fi if test "$opt" = "static" -o "$opt" = "dynamic" -o "$opt" = "yes" ; then @@ -805,12 +809,6 @@ get_subengines_build_string() { } # -# Greet user -# -echo "Running ScummVM configure..." -echo "Configure run on" `date` > $TMPLOG - -# # Check any parameters we received # # TODO: @@ -833,9 +831,9 @@ Usage: $0 [OPTIONS]... Configuration: -h, --help display this help and exit - --backend=BACKEND backend to build (android, tizen, dc, dingux, ds, gcw0, - gph, iphone, linuxmoto, maemo, n64, null, openpandora, - ps2, psp, samsungtv, sdl, webos, wii, wince) [sdl] + --backend=BACKEND backend to build (3ds, android, dc, dingux, ds, gcw0, + gph, iphone, ios7, linuxmoto, maemo, n64, null, openpandora, + ps2, psp, samsungtv, sdl, tizen, webos, wii, wince) [sdl] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX @@ -861,19 +859,22 @@ Fine tuning of the installation directories: Special configuration feature: --host=HOST cross-compile to target HOST (arm-linux, ...) - special targets: android-arm for Android ARM + special targets: 3ds for Nintendo 3DS + android-arm for Android ARM android-mips for Android MIPS android-x86 for Android x86 - tizen for Samsung Tizen + androidsdl for Android with SDL backend caanoo for Caanoo dingux for Dingux + raspberrypi for Raspberry Pi dreamcast for Sega Dreamcast ds for Nintendo DS gamecube for Nintendo GameCube gcw0 for GCW Zero gp2x for GP2X gp2xwiz for GP2X Wiz - iphone for Apple iPhone + iphone for Apple iPhone (iOS <= 6) + ios7 for Apple iPhone / iPad (iOS >= 7) linupy for Yopy PDA maemo for Nokia Maemo motoezx for MotoEZX @@ -885,6 +886,7 @@ Special configuration feature: ps3 for PlayStation 3 psp for PlayStation Portable samsungtv for Samsung TV + tizen for Samsung Tizen webos for HP Palm WebOS wii for Nintendo Wii wince for Windows CE @@ -895,7 +897,7 @@ Game engines: --disable-all-engines disable all engines --enable-engine=<engine name>[,<engine name>...] enable engine(s) listed --disable-engine=<engine name>[,<engine name>...] disable engine(s) listed - --enable-engine-static=<engine name>[,<engine name>...] + --enable-engine-static=<engine name>[,<engine name>...] enable engine(s) listed as static builtin (when plugins are enabled) --enable-engine-dynamic=<engine name>[,<engine name>...] enable engine(s) listed as dynamic plugin (when plugins are enabled) @@ -914,6 +916,7 @@ Optional Features: --default-dynamic make plugins dynamic by default --disable-mt32emu don't enable the integrated MT-32 emulator --disable-16bit don't enable 16bit color support + --disable-highres don't enable support for high resolution engines >320x240 --disable-savegame-timestamp don't use timestamps for blank savegame descriptions --disable-scalers exclude scalers --disable-hq-scalers exclude HQ2x and HQ3x scalers @@ -928,6 +931,15 @@ Optional Features: --enable-verbose-build enable regular echoing of commands during build process --disable-bink don't build with Bink video support + --opengl-mode=MODE OpenGL (ES) mode to use for OpenGL output [auto] + available modes: auto for autodetection + none for disabling any OpenGL usage + any for runtime detection + gl for forcing OpenGL + gles for forcing OpenGL ES + gles2 for forcing OpenGL ES 2 + WARNING: only specify this manually if you know what + you are doing! Optional Libraries: --with-alsa-prefix=DIR Prefix where alsa is installed (optional) @@ -952,9 +964,6 @@ Optional Libraries: --with-mpeg2-prefix=DIR Prefix where libmpeg2 is installed (optional) --enable-mpeg2 enable mpeg2 codec for cutscenes [autodetect] - --with-opengl-prefix=DIR Prefix where OpenGL (ES) is installed (optional) - --disable-opengl disable OpenGL (ES) support [autodetect] - --with-jpeg-prefix=DIR Prefix where libjpeg is installed (optional) --disable-jpeg disable JPEG decoder [autodetect] @@ -971,8 +980,10 @@ Optional Libraries: installed (optional) --disable-fluidsynth disable fluidsynth MIDI driver [autodetect] - --with-sparkle-prefix=DIR Prefix where sparkle is installed (Mac OS X only - optional) - --disable-sparkle disable sparkle automatic update support [Mac OS X only - autodetect] + --with-sparkle-prefix=DIR Prefix where sparkle is installed (OS X/Windows only - optional) + --disable-sparkle disable sparkle automatic update support [OS X/Windows only - autodetect] + + --disable-osx-dock-plugin disable the NSDockTilePlugin support [Mac OS X only - autodetect] --with-sdl-prefix=DIR Prefix where the sdl-config script is installed (optional) @@ -1008,9 +1019,25 @@ EOF fi done # for parm in ... + +# +# If we're not showing help, greet the user and start the log file +# +echo "Running ScummVM configure..." +echo "Configure run on" `date` > $TMPLOG +cat >> $TMPLOG <<EOF +Invocation command line was: +$0 $@ +Saved environment variables: +LDFLAGS="$SAVED_LDFLAGS" CXX="$SAVED_CXX" CXXFLAGS="$SAVED_CXXFLAGS" CPPFLAGS="$SAVED_CPPFLAGS" ASFLAGS="$SAVED_ASFLAGS" WINDRESFLAGS="$SAVED_WINDRESFLAGS" SDL_CONFIG="$SAVED_SDL_CONFIG" +EOF + + for ac_option in $@; do case "$ac_option" in --disable-16bit) _16bit=no ;; + --enable-highres) _highres=yes ;; + --disable-highres) _highres=no ;; --disable-savegame-timestamp) _savegame_timestamp=no ;; --disable-scalers) _build_scalers=no ;; --disable-hq-scalers) _build_hq_scalers=no ;; @@ -1034,6 +1061,8 @@ for ac_option in $@; do --disable-zlib) _zlib=no ;; --enable-sparkle) _sparkle=yes ;; --disable-sparkle) _sparkle=no ;; + --enable-osx-dock-plugin) _osxdockplugin=yes;; + --disable-osx-dock-plugin) _osxdockplugin=no;; --enable-nasm) _nasm=yes ;; --disable-nasm) _nasm=no ;; --enable-mpeg2) _mpeg2=yes ;; @@ -1057,10 +1086,11 @@ for ac_option in $@; do --disable-updates) _updates=no ;; --enable-libunity) _libunity=yes ;; --disable-libunity) _libunity=no ;; - --enable-opengl) _opengl=yes ;; - --disable-opengl) _opengl=no ;; --enable-bink) _bink=yes ;; --disable-bink) _bink=no ;; + --opengl-mode=*) + _opengl_mode=`echo $ac_option | cut -d '=' -f 2` + ;; --enable-verbose-build) _verbose_build=yes ;; --enable-plugins) _dynamic_modules=yes ;; --default-dynamic) _plugins_default=dynamic ;; @@ -1148,8 +1178,7 @@ for ac_option in $@; do ;; --with-sparkle-prefix=*) arg=`echo $ac_option | cut -d '=' -f 2` - SPARKLE_CFLAGS="-F$arg" - SPARKLE_LIBS="-F$arg" + _sparklepath=$arg ;; --with-readline-prefix=*) arg=`echo $ac_option | cut -d '=' -f 2` @@ -1161,11 +1190,6 @@ for ac_option in $@; do LIBUNITY_CFLAGS="-I$arg/include" LIBUNITY_LIBS="-L$arg/lib" ;; - --with-opengl-prefix=*) - arg=`echo $ac_option | cut -d '=' -f 2` - OPENGL_CFLAGS="-I$arg/include" - OPENGL_LIBS="-L$arg/lib" - ;; --backend=*) _backend=`echo $ac_option | cut -d '=' -f 2` ;; @@ -1222,6 +1246,9 @@ for ac_option in $@; do --with-staticlib-prefix=*) _staticlibpath=`echo $ac_option | cut -d '=' -f 2` ;; + --with-xcodetools-path=*) + _xcodetoolspath=`echo $ac_option | cut -d '=' -f 2` + ;; --host=*) _host=`echo $ac_option | cut -d '=' -f 2` ;; @@ -1286,6 +1313,11 @@ get_system_exe_extension $guessed_host NATIVEEXEEXT=$_exeext case $_host in +3ds) + _host_os=3ds + _host_cpu=arm + _host_alias=arm-none-eabi + ;; android | android-arm | android-v7a | android-arm-v7a | ouya) _host_os=android _host_cpu=arm @@ -1301,10 +1333,37 @@ android-x86) _host_cpu=i686 _host_alias=i686-linux-android ;; +androidsdl-armeabi | androidsdl-armeabi-v7a) + _host_os=androidsdl + _host_cpu=arm + _host_alias=arm-linux-androideabi + ;; +androidsdl-arm64-v8a) + _host_os=androidsdl + _host_cpu=aarch64 + _host_alias=aarch64-linux-android + ;; +androidsdl-mips) + _host_os=androidsdl + _host_cpu=mipsel + _host_alias=mipsel-linux-android + ;; +androidsdl-x86) + _host_os=androidsdl + _host_cpu=i686 + _host_alias=i686-linux-android + ;; arm-riscos) _host_os=riscos _host_cpu=arm ;; +raspberrypi) + _host_os=linux + _host_cpu=arm + # This tuple is the one used by the official Rpi toolchain. + # It may change in the future. + _host_alias=arm-linux-gnueabihf + ;; caanoo) _host_os=gph-linux _host_cpu=arm @@ -1351,6 +1410,11 @@ iphone) _host_cpu=arm _host_alias=arm-apple-darwin9 ;; +ios7) + _host_os=iphone + _host_cpu=arm + _host_alias=arm-apple-darwin11 + ;; linupy) _host_os=linux _host_cpu=arm @@ -1555,7 +1619,7 @@ android) exit 1 fi ;; -ds | gamecube | wii) +3ds | ds | gamecube | wii) if test -z "$DEVKITPRO"; then echo "Please set DEVKITPRO in your environment. export DEVKITPRO=<path to devkitPRO>" exit 1 @@ -1678,23 +1742,33 @@ LD=$CXX # echocheck "compiler version" -# We first check whether we have an Intel compiler here, since the Intel compiler -# can also fake itself as an gcc (to ease compatibility with common Linux etc. -# programs). +# Some compilers pretend to be gcc to ease compatibility with +# common Linux etc. programs. We first check for some of these here. +have_gcc=no +cc_check_define __GNUC__ && have_gcc=yes have_icc=no cc_check_define __INTEL_COMPILER && have_icc=yes +have_clang=no +cc_check_define __clang__ && have_clang=yes if test "$have_icc" = yes; then add_line_to_config_mk 'HAVE_ICC = 1' - # Make ICC error our on unknown command line options instead of printing + # Make ICC error out on unknown command line options instead of printing # a warning. This is for example required to make the -Wglobal-destructors # detection work correctly. append_var CXXFLAGS "-diag-error 10006,10148" + + # ICC doesn't accept all gcc options, so we disable have_gcc, even if + # ICC does have the gcc-compatibility defines. + have_gcc=no fi -have_gcc=no -cc_check_define __GNUC__ && have_gcc=yes +if test "$have_clang" = yes; then + add_line_to_config_mk 'HAVE_CLANG = 1' + + # clang does accept all gcc options we use, so we keep have_gcc +fi if test "$have_gcc" = yes; then add_line_to_config_mk 'HAVE_GCC = 1' @@ -1702,11 +1776,17 @@ if test "$have_gcc" = yes; then _cxx_minor=`gcc_get_define __GNUC_MINOR__` cxx_version="`( $CXX -dumpversion ) 2>&1`" - if test -n "`gcc_get_define __clang__`"; then - add_line_to_config_mk 'HAVE_CLANG = 1' - fi - - if test "$_cxx_major" -eq 2 && test "$_cxx_minor" -ge 95 || \ + if test "$have_clang" = yes; then + # Clang sets a gcc version number for compatibility. + # We keep that as _cxx_minor/_cxx_major for later + # compiler version checks. + + # For the version reported in the configure log (cxx_version), + # we get the actual clang version. + cxx_version=`gcc_get_define __clang_version__` + cxx_version="`echo "${cxx_version}" | sed -e 's/"\([^ ]*\) .*/\1/'`" + cxx_version="clang $cxx_version, ok" + elif test "$_cxx_major" -eq 2 && test "$_cxx_minor" -ge 95 || \ test "$_cxx_major" -gt 2 ; then cxx_version="$cxx_version, ok" cxx_verc_fail=no @@ -1795,7 +1875,7 @@ if test "$have_gcc" = yes ; then case $_host_os in # newlib-based system include files suppress non-C89 function # declarations under __STRICT_ANSI__ - amigaos* | android | dreamcast | ds | gamecube | mingw* | n64 | psp | ps2 | ps3 | tizen | wii | wince ) + 3ds | amigaos* | android | androidsdl | dreamcast | ds | gamecube | mingw* | n64 | psp | ps2 | ps3 | tizen | wii | wince ) ;; *) append_var CXXFLAGS "-ansi" @@ -1831,7 +1911,7 @@ echo $_use_cxx11 # However, some platforms use GNU extensions in system header files, so # for these we must not use -pedantic. case $_host_os in -android | gamecube | psp | tizen | wii | webos) +android | androidsdl | gamecube | psp | tizen | wii | webos) ;; *) # ICC does not support pedantic, while GCC and clang do. @@ -2039,13 +2119,31 @@ echo_n "Checking host CPU architecture... " case $_host_cpu in arm*) echo "ARM" - define_in_config_if_yes yes 'USE_ARM_SCALER_ASM' - 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' - # 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' + case $_host_alias in + # Apple's as does not support the syntax we use in our ARM + # assembly. We simply do not enable it. + arm-apple-darwin9) + ;; + arm-apple-darwin10) + ;; + arm-apple-darwin11) + ;; + + *) + define_in_config_if_yes yes 'USE_ARM_SCALER_ASM' + # FIXME: The following feature exhibits a bug. It produces distorted + # sound since 9003ce517ff9906b0288f9f7c02197fd091d4554. The ARM + # assembly will need to be properly adapted to the changes to the C + # code in 8f5a7cde2f99de9fef849b0ff688906f05f4643e. + # See bug #6957: "AUDIO: ARM ASM sound code causes distorted audio on 32 bit armv6" + #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' + # 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' + ;; + esac append_var DEFINES "-DARM_TARGET" ;; @@ -2077,8 +2175,29 @@ esac echo_n "Checking hosttype... " echo $_host_os case $_host_os in + 3ds) + _optimization_level=-O2 + append_var DEFINES "-D__3DS__" + append_var DEFINES "-DARM" + append_var DEFINES "-DARM11" + append_var CXXFLAGS "-march=armv6k" + append_var CXXFLAGS "-mtune=mpcore" + append_var CXXFLAGS "-mword-relocations" + append_var CXXFLAGS "-mfloat-abi=hard" + append_var CXXFLAGS "-ffunction-sections" + append_var CXXFLAGS "-fomit-frame-pointer" + append_var CXXFLAGS "-I$DEVKITPRO/libctru/include" + append_var CXXFLAGS "-I$DEVKITPRO/portlibs/3ds/include" + if test "$_dynamic_modules" = no ; then + append_var LDFLAGS "-Wl,--gc-sections" + else + append_var LDFLAGS "-Wl,--no-gc-sections" + fi + append_var LDFLAGS "-L$DEVKITPRO/portlibs/3ds/lib" + append_var LIBS "-lcitro3d -lctru" + ;; amigaos*) - append_var LDFLAGS "-use-dynld -Wl,--export-dynamic" + append_var LDFLAGS "-Wl,--export-dynamic" append_var 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. @@ -2229,7 +2348,7 @@ case $_host_os in LDFLAGS="-L${macport_prefix}/lib $LDFLAGS" CXXFLAGS="-I${macport_prefix}/include $CXXFLAGS" - + if test -z "$_staticlibpath"; then _staticlibpath=${macport_prefix} echo "Set staticlib-prefix to ${_staticlibpath}" @@ -2291,6 +2410,17 @@ case $_host_os in echo "Could not determine prefix for static libraries" fi fi + + # If _xcodetoolspath is not set yet use xcode-select to get the path + if test -z "$_xcodetoolspath"; then + _xcodetoolspath=`xcode-select -print-path`/Tools + if test -d "$_xcodetoolspath"; then + echo "Set xcodetools-path to ${_xcodetoolspath}" + else + _xcodetoolspath= + echo "Could not determine path for Xcode Tools" + fi + fi ;; dreamcast) append_var DEFINES "-D__DC__" @@ -2384,6 +2514,10 @@ case $_host_os in mint*) append_var DEFINES "-DSYSTEM_NOT_SUPPORTING_D_TYPE" ;; + msys) + echo ERROR: Using the MSYS shell in msys mode is not supported. Please use the MSYS shell in mingw mode instead. + exit 1 + ;; n64) append_var DEFINES "-D__N64__" append_var DEFINES "-DLIMIT_FPS" @@ -2406,6 +2540,7 @@ case $_host_os in ;; ps3) # Force use of SDL and freetype from the ps3 toolchain + _sdlconfig=sdl2-config _sdlpath="$PS3DEV/portlibs/ppu:$PS3DEV/portlibs/ppu/bin" _freetypepath="$PS3DEV/portlibs/ppu:$PS3DEV/portlibs/ppu/bin" @@ -2498,6 +2633,18 @@ if test -n "$_host"; then # Cross-compiling mode - add your target here if needed echo "Cross-compiling to $_host" case "$_host" in + 3ds) + append_var DEFINES "-DDISABLE_FANCY_THEMES" + append_var DEFINES "-DDISABLE_SID" + append_var DEFINES "-DDISABLE_NES_APU" + _backend="3ds" + _build_scalers=no + _vkeybd=yes + _mt32emu=no + # Should use Tremor instead of Vorbis + _vorbis=no + _port_mk="backends/platform/3ds/3ds.mk" + ;; android | android-arm | android-v7a | android-arm-v7a | android-mips | android-x86 | ouya) # we link a .so as default append_var LDFLAGS "-shared" @@ -2511,6 +2658,15 @@ if test -n "$_host"; then _mt32emu=no _timidity=no ;; + androidsdl | androidsdl-armeabi | androidsdl-armeabi-v7a | androidsdl-mips | androidsdl-x86 | androidsdl-arm64-v8a) + DEFINES="$DEFINES -DANDROIDSDL" + _unix=yes + _seq_midi=no + _mt32emu=no + _timidity=no + _backend="androidsdl" + _port_mk="backends/platform/androidsdl/androidsdl.mk" + ;; arm-linux|arm*-linux-gnueabi|arm-*-linux) ;; arm-riscos|linupy) @@ -2549,7 +2705,7 @@ if test -n "$_host"; then _mt32emu=no _optimization_level=-O3 # Disable alsa midi to get the port build on OpenDingux toolchain - _alsa=no + _alsa=no _vkeybd=yes _build_hq_scalers=no _keymapper=no @@ -2559,6 +2715,33 @@ if test -n "$_host"; then _seq_midi=no _port_mk="backends/platform/dingux/dingux.mk" ;; + raspberrypi) + # This is needed because the official cross compiler doesn't have multiarch enabled + # but Raspbian does. + # Be careful as it's the linker (LDFLAGS) which must know about sysroot. + # These are needed to build against Raspbian's libSDL. + append_var LDFLAGS "--sysroot=$RPI_ROOT" + append_var LDFLAGS "-B$RPI_ROOT/usr/lib/arm-linux-gnueabihf" + append_var LDFLAGS "-Xlinker --rpath-link=$RPI_ROOT/usr/lib/arm-linux-gnueabihf" + append_var LDFLAGS "-Xlinker --rpath-link=$RPI_ROOT/lib/arm-linux-gnueabihf" + append_var LDFLAGS "-Xlinker --rpath-link=$RPI_ROOT/opt/vc/lib" + append_var LDFLAGS "-L$RPI_ROOT/opt/vc/lib" + # This is so optional OpenGL ES includes are found. + append_var CXXFLAGS "-I$RPI_ROOT/opt/vc/include" + _savegame_timestamp=no + _eventrec=no + _build_scalers=no + _build_hq_scalers=no + # We prefer SDL2 on the Raspberry Pi: acceleration now depends on it + # since SDL2 manages dispmanx/GLES2 very well internally. + # SDL1 is bit-rotten on this platform. + _sdlconfig=sdl2-config + # OpenGL ES support is mature enough as to be the best option on + # the Raspberry Pi, so it's enabled by default. + # The Raspberry Pi always supports OpenGL ES 2.0 contexts, thus we + # take advantage of those. + _opengl_mode=gles2 + ;; dreamcast) append_var DEFINES "-DDISABLE_DEFAULT_SAVEFILEMANAGER" append_var DEFINES "-DDISABLE_TEXT_CONSOLE" @@ -2578,7 +2761,11 @@ if test -n "$_host"; then _build_scalers=no _mad=yes _zlib=yes - add_line_to_config_mk 'ronindir = /usr/local/ronin' + if test -z "$RONINDIR"; then + add_line_to_config_mk "ronindir := /usr/local/ronin" + else + add_line_to_config_mk "ronindir := $RONINDIR" + fi _port_mk="backends/platform/dc/dreamcast.mk" ;; ds) @@ -2611,22 +2798,22 @@ if test -n "$_host"; then add_line_to_config_h "/* #define DEBUG_WII_GDB */" add_line_to_config_h "#define USE_WII_DI" ;; - gcw0) - append_var DEFINES "-DDINGUX -DGCW0" + gcw0) + _sysroot=`$CXX --print-sysroot` + _sdlpath=$_sysroot/usr/bin + append_var DEFINES "-DDINGUX -DGCW0 -DGUI_ONLY_FULLSCREEN" append_var DEFINES "-DREDUCE_MEMORY_USAGE" append_var CXXFLAGS "-mips32" _backend="dingux" + _alsa=no _mt32emu=no + _seq_midi=no + _timidity=no + _build_scalers=no _optimization_level=-O3 - # Disable alsa midi to get the port build on OpenDingux toolchain - _alsa=no _vkeybd=yes - _build_hq_scalers=no _keymapper=yes - # Force disable vorbis on dingux, it has terrible performance compared to tremor _vorbis=no - # Force disable seq on dingux, no way to use it and it would get enabled by default with configure - _seq_midi=no _port_mk="backends/platform/dingux/dingux.mk" ;; gp2x) @@ -2666,6 +2853,13 @@ if test -n "$_host"; then _seq_midi=no _timidity=no ;; + ios7) + append_var DEFINES "-DIPHONE" + _backend="ios7" + _build_scalers=no + _seq_midi=no + _timidity=no + ;; m68k-atari-mint) append_var DEFINES "-DSYSTEM_NOT_SUPPORTING_D_TYPE" _ranlib=m68k-atari-mint-ranlib @@ -2679,7 +2873,7 @@ if test -n "$_host"; then append_var INCLUDES "-I/usr/X11R6/include" append_var LIBS "-lX11" append_var LIBS "-L/usr/lib" - + _backend="maemo" _vkeybd=yes _keymapper=yes @@ -2872,6 +3066,8 @@ if test -n "$_host"; then _mt32emu=no _timidity=no _vkeybd=yes + # Tizen relies on the OpenGL ES output thus we always enable it. + _opengl_mode=gles ;; webos) _backend="webos" @@ -2917,12 +3113,16 @@ fi # Backend related stuff # case $_backend in + 3ds) + ;; android) append_var DEFINES "-DREDUCE_MEMORY_USAGE" append_var CXXFLAGS "-Wa,--noexecstack" append_var LDFLAGS "-Wl,-z,noexecstack" append_var INCLUDES "-I$ANDROID_NDK/sources/cxx-stl/system/include" ;; + androidsdl) + ;; dc) append_var INCLUDES '-I$(srcdir)/backends/platform/dc' append_var INCLUDES '-isystem $(ronindir)/include' @@ -2959,6 +3159,19 @@ case $_backend in append_var LIBS "-framework QuartzCore -framework CoreFoundation -framework Foundation" append_var LIBS "-framework AudioToolbox -framework CoreAudio" ;; + ios7) + append_var LIBS "-lobjc -framework UIKit -framework CoreGraphics -framework OpenGLES" + append_var LIBS "-framework QuartzCore -framework CoreFoundation -framework Foundation" + append_var LIBS "-framework AudioToolbox -framework CoreAudio" + append_var LDFLAGS "-miphoneos-version-min=7.1 -arch armv7" + append_var CFLAGS "-miphoneos-version-min=7.1 -arch armv7" + append_var CXXFLAGS "-miphoneos-version-min=7.1 -arch armv7" + if test -n "$SDKROOT"; then + append_var LDFLAGS "-mlinker-version=134.9 -B/usr/local/bin/arm-apple-darwin11-" + append_var CFLAGS "-isysroot $SDKROOT -F$SDKROOT/System/Library/Frameworks" + append_var CXXFLAGS "-isysroot $SDKROOT -I$SDKROOT/usr/include/c++/4.2.1 -F$SDKROOT/System/Library/Frameworks" + fi + ;; linuxmoto) append_var DEFINES "-DLINUXMOTO" ;; @@ -3006,6 +3219,8 @@ case $_backend in append_var LDFLAGS "-shared" append_var LDFLAGS "-fpic" ;; + sdl) + ;; tizen) # dirent.h not available. NONSTANDARD_PORT==ensure portdefs.h is included append_var DEFINES "-DTIZEN -DDISABLE_STDIO_FILESTREAM -DNONSTANDARD_PORT" @@ -3054,8 +3269,6 @@ case $_backend in append_var DEFINES "-DSDL_BACKEND" add_line_to_config_mk "SDL_BACKEND = 1" ;; - sdl) - ;; *) echo "support for $_backend backend not implemented in configure script yet" exit 1 @@ -3067,7 +3280,7 @@ append_var MODULES "backends/platform/$_backend" # Setup SDL specifics for SDL based backends # case $_backend in - dingux | gph | linuxmoto | maemo | openpandora | samsungtv | sdl) + androidsdl | dingux | gph | linuxmoto | maemo | openpandora | samsungtv | sdl) find_sdlconfig append_var INCLUDES "`$_sdlconfig --prefix="$_sdlpath" --cflags`" append_var LIBS "`$_sdlconfig --prefix="$_sdlpath" --libs`" @@ -3076,9 +3289,6 @@ case $_backend in _sdlversion=`$_sdlconfig --version` case $_sdlversion in - 1.3.*) - add_line_to_config_mk "USE_SDL13 = 1" - ;; 2.0.*) add_line_to_config_mk "USE_SDL2 = 1" ;; @@ -3093,7 +3303,7 @@ esac # Enable 16bit support only for backends which support it # case $_backend in - android | dingux | dc | gph | iphone | maemo | openpandora | psp | samsungtv | sdl | tizen | webos | wii) + 3ds | android | androidsdl | dingux | dc | gph | iphone | ios7 | maemo | openpandora | psp | samsungtv | sdl | tizen | webos | wii) if test "$_16bit" = auto ; then _16bit=yes else @@ -3106,6 +3316,26 @@ case $_backend in esac # +# Enable High resolution engines (>320x240) support only for backends which support it +# +case $_host in + gcw0) + if test "$_highres" = yes ; then + _highres=yes + else + _highres=no + fi + ;; + *) + if test "$_highres" = no ; then + _highres=no + else + _highres=yes + fi + ;; +esac + +# # Enable Event Recorder only for backends that support it # case $_backend in @@ -3139,7 +3369,6 @@ case $_backend in ;; esac - # # Determine whether host is POSIX compliant, or at least POSIX # compatible enough to support our POSIX code (including dlsym(), @@ -3153,7 +3382,7 @@ case $_host_os in amigaos* | cygwin* | dreamcast | ds | gamecube | mingw* | n64 | ps2 | ps3 | psp | wii | wince) _posix=no ;; - android | beos* | bsd* | darwin* | freebsd* | gnu* | gph-linux | haiku* | hpux* | iphone | irix*| k*bsd*-gnu* | linux* | maemo | mint* | netbsd* | openbsd* | solaris* | sunos* | uclinux* | webos) + 3ds | android | androidsdl | beos* | bsd* | darwin* | freebsd* | gnu* | gph-linux | haiku* | hpux* | iphone | ios7 | irix*| k*bsd*-gnu* | linux* | maemo | mint* | netbsd* | openbsd* | solaris* | sunos* | uclinux* | webos) _posix=yes ;; os2-emx*) @@ -3419,6 +3648,11 @@ define_in_config_if_yes "$_mt32emu" 'USE_MT32EMU' define_in_config_if_yes "$_16bit" 'USE_RGB_COLOR' # +# Check whether High resolution graphics support is requested +# +define_in_config_if_yes "$_highres" 'USE_HIGHRES' + +# # Check whether save games use the current time as default description # define_in_config_if_yes "$_savegame_timestamp" 'USE_SAVEGAME_TIMESTAMP' @@ -3776,48 +4010,130 @@ echo "$_mpeg2" # # Check for Sparkle if updates support is enabled # -echocheck "Sparkle" -if test "$_updates" = no; then - _sparkle=no -else -if test "$_sparkle" = auto ; then - _sparkle=no - cat > $TMPC << EOF +# +# Check is NSDockTilePlugIn protocol is supported +# +case $_host_os in + darwin*) + echocheck "Sparkle" + if test "$_updates" = no; then + _sparkle=no + else + if test ! -z $_sparklepath ; then + SPARKLE_CFLAGS="-F$_sparklepath" + SPARKLE_LIBS="-F$_sparklepath" + fi + if test "$_sparkle" = auto ; then + _sparkle=no + cat > $TMPC << EOF #include <Cocoa/Cocoa.h> #include <Sparkle/Sparkle.h> int main(void) { SUUpdater *updater = [SUUpdater sharedUpdater]; return 0; } EOF - cc_check $SPARKLE_CFLAGS $SPARKLE_LIBS -framework Sparkle -ObjC++ -lobjc && _sparkle=yes -fi -if test "$_sparkle" = yes ; then - append_var LIBS "$SPARKLE_LIBS -framework Sparkle" - append_var INCLUDES "$SPARKLE_CFLAGS" -fi -define_in_config_if_yes "$_sparkle" 'USE_SPARKLE' -fi -echo "$_sparkle" + cc_check $SPARKLE_CFLAGS $SPARKLE_LIBS -framework Sparkle -ObjC++ -lobjc && _sparkle=yes + fi + if test "$_sparkle" = yes ; then + append_var LIBS "$SPARKLE_LIBS -framework Sparkle" + append_var INCLUDES "$SPARKLE_CFLAGS" + fi + define_in_config_if_yes "$_sparkle" 'USE_SPARKLE' + fi + echo "$_sparkle" + ;; + mingw*) + echocheck "Sparkle" + if test "$_updates" = no; then + _sparkle=no + else + if test ! -z $_sparklepath ; then + SPARKLE_CFLAGS="-I$_sparklepath/include" + SPARKLE_LIBS="-L$_sparklepath/Release -L$_sparklepath/x64/Release" + fi + if test "$_sparkle" = auto ; then + _sparkle=no + cat > $TMPC << EOF +#include <winsparkle.h> +int main(void) { win_sparkle_get_update_check_interval(); return 0; } +EOF + cc_check $SPARKLE_CFLAGS $SPARKLE_LIBS -lWinSparkle && _sparkle=yes + fi + if test "$_sparkle" = yes ; then + append_var LIBS "$SPARKLE_LIBS -lWinSparkle" + append_var INCLUDES "$SPARKLE_CFLAGS" + fi + define_in_config_if_yes "$_sparkle" 'USE_SPARKLE' + fi + echo "$_sparkle" + ;; + *) + _sparkle=no + ;; +esac # -# Check for libfluidsynth +# Check is NSDockTilePlugIn protocol is supported # -echocheck "libfluidsynth" -if test "$_fluidsynth" = auto ; then +case $_host_os in + darwin*) + # NSDockTilePlugIn was added in OS X 10.6, so will not be available when compiling on older OS X versions. + echocheck "DockTilePlugin" + if test "$_osxdockplugin" = auto ; then + _osxdockplugin=no + cat > $TMPC << EOF +#include <Cocoa/Cocoa.h> +@interface ScummVMDockTilePlugIn : NSObject <NSDockTilePlugIn> { +} +@end +EOF + cc_check -c -ObjC++ && _osxdockplugin=yes + fi + define_in_config_if_yes "$_osxdockplugin" 'USE_DOCKTILEPLUGIN' + echo "$_osxdockplugin" + ;; + *) + _osxdockplugin=no + ;; +esac + +# +# Check for FluidSynth +# +echocheck "FluidSynth" + +append_var FLUIDSYNTH_LIBS "-lfluidsynth" +case $_host_os in + mingw*) + FLUIDSYNTH_STATIC_LIBS="$FLUIDSYNTH_LIBS -lglib-2.0 -lintl -liconv -lws2_32 -lole32 -lshlwapi -lpcre -ldsound -lwinmm" + ;; + + darwin*) + FLUIDSYNTH_STATIC_LIBS="$FLUIDSYNTH_LIBS -framework Foundation -framework CoreMIDI -framework CoreAudio -lglib-2.0 -lintl -liconv -lreadline" + ;; + + iphone) + FLUIDSYNTH_STATIC_LIBS="$FLUIDSYNTH_LIBS -framework Foundation -framework CoreMIDI -lglib-2.0 -lintl -liconv" + ;; + + *) + FLUIDSYNTH_STATIC_LIBS="$FLUIDSYNTH_LIBS -lglib-2.0 -lintl -liconv" + ;; +esac + +if test "$_fluidsynth" = auto; then _fluidsynth=no cat > $TMPC << EOF #include <fluidsynth.h> -int main(void) { return 0; } +int main(void) { delete_fluid_settings(new_fluid_settings()); return 0; } EOF - cc_check $FLUIDSYNTH_CFLAGS $FLUIDSYNTH_LIBS -lfluidsynth && _fluidsynth=yes + cc_check_no_clean $FLUIDSYNTH_CFLAGS $FLUIDSYNTH_LIBS && _fluidsynth=yes + if test "$_fluidsynth" != yes; then + FLUIDSYNTH_LIBS="$FLUIDSYNTH_STATIC_LIBS" + cc_check_no_clean $FLUIDSYNTH_CFLAGS $FLUIDSYNTH_LIBS && _fluidsynth=yes + fi + cc_check_clean fi -if test "$_fluidsynth" = yes ; then - case $_host_os in - mingw*) - append_var LIBS "$FLUIDSYNTH_LIBS -lfluidsynth -ldsound -lwinmm" - ;; - *) - append_var LIBS "$FLUIDSYNTH_LIBS -lfluidsynth" - ;; - esac +if test "$_fluidsynth" = yes; then + append_var LIBS "$FLUIDSYNTH_LIBS" append_var INCLUDES "$FLUIDSYNTH_CFLAGS" fi define_in_config_if_yes "$_fluidsynth" 'USE_FLUIDSYNTH' @@ -3949,7 +4265,15 @@ int main(int argc, char *argv[]) { } EOF - cc_check $FREETYPE2_CFLAGS $FREETYPE2_LIBS && _freetype2=yes + cc_check_no_clean $FREETYPE2_CFLAGS $FREETYPE2_LIBS && _freetype2=yes + # Modern freetype-config scripts accept --static to get all + # required flags for static linking. We abuse this to detect + # FreeType2 builds which are static themselves. + if test "$_freetype2" != "yes"; then + FREETYPE2_LIBS=`$_freetypeconfig --prefix="$_freetypepath" --static --libs 2>/dev/null` + cc_check_no_clean $FREETYPE2_CFLAGS $FREETYPE2_LIBS && _freetype2=yes + fi + cc_check_clean fi if test "$_freetype2" = "yes"; then @@ -3972,106 +4296,114 @@ 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" - append_var LIBS "$OPENGL_LIBS" - append_var INCLUDES "$OPENGL_CFLAGS" + # Only enable OpenGL ES on the OpanPandora if --opengl-mode=gles is passed in explicitly. + if test "$_opengl_mode" = "gles" ; then + append_var LIBS "-lGLES_CM -lEGL -lX11" + else + _opengl_mode=none fi ;; esac -if test "$_opengl" = auto ; then - _opengl=no - if test "$_backend" = "sdl" ; then - # Try different header filenames - # 1) GL/gl.h This is usually used on POSIX and Windows systems - # 2) OpenGL/gl.h This is used on Mac OS X - # 3) GLES/gl.h This is used for OpenGL ES 1.x - for i in "GL/gl.h" "OpenGL/gl.h" "GLES/gl.h"; do - # Test the current header for OpenGL - cat > $TMPC << EOF -#include <$i> -#include <stdio.h> -int main(void) { printf("ANTIVIRUS FALSE POSITIVE WORKAROUND"); return GL_VERSION_1_1; } -EOF - cc_check $DEFINES $OPENGL_CFLAGS $OPENGL_LIBS && _opengl=yes && break +if test "$_opengl_mode" = auto ; then + case $_backend in + sdl) + case $_sdlversion in + 1.2.*) + # Stock SDL 1.2 only supports OpenGL contexts. + _opengl_mode=gl + ;; - # Test the current header for OpenGL ES - cat > $TMPC << EOF -#include <$i> -int main(void) { return GL_OES_VERSION_1_1; } -EOF - cc_check $DEFINES $OPENGL_CFLAGS $OPENGL_LIBS && _opengl=yes && _opengles=yes && break - done - fi -fi -if test "$_opengl" = yes ; then - # Our simple test case - cat > $TMPC << EOF -int main(void) { return 0; } -EOF + 2.0.*) + # SDL2 supports both OpenGL + OpenGL ES contexts. + # However, Mac OS X only allows OpenGL context creation at + # this time, thus we limit us to OpenGL on that platform. + case $_host_os in + darwin*) + _opengl_mode=gl + ;; + + *) + _opengl_mode=any + ;; + esac + ;; + esac + ;; - _opengl=no - # Try different library names - if test "$_opengles" = "yes" ; then - # 1) GLES_CM This is usually used for OpenGL ES 1.1 (Common profile) - # 2) GLESv1_CM This is used by the Windows Mali OpenGL ES 1.1 Emulator - # 3) glesv1 This is used by the Linux Mali OpenGL ES 1.1 Emulator - _opengles=no - for lib in "-lGLES_CM" "-lGLESv1_CM" "-lglesv1"; do - if cc_check_no_clean $DEFINES $OPENGL_CFLAGS $OPENGL_LIBS $lib - then - _opengl=yes - _opengles=yes - OPENGL_LIBS="$OPENGL_LIBS $lib" - break - fi - done - else - # 1) -framework OpenGL This is used on Mac OS X - # 2) GL This is usually used on POSIX systems - # 3) opengl32 This is used on Windows - # - # We try "-framework OpenGL" first here to assure it will always be - # picked up by the configure script on Mac OS X, even when a libGL - # exists. - for lib in "-framework OpenGL" "-lGL" "-lopengl32"; do - if cc_check_no_clean $DEFINES $OPENGL_CFLAGS $OPENGL_LIBS $lib - then - _opengl=yes - OPENGL_LIBS="$OPENGL_LIBS $lib" - break - fi - done - fi - cc_check_clean + tizen) + # Tizen always runs in GLES mode + _opengl_mode=gles + ;; - if test "$_opengl" = yes ; then - append_var LIBS "$OPENGL_LIBS" - append_var INCLUDES "$OPENGL_CFLAGS" - fi + *) + _opengl_mode=none + ;; + esac fi -case $_host_os in - tizen) - # components live in non-standard locations so just assume sane SDK - _opengl=yes - _opengles=yes +_opengl=yes +case $_opengl_mode in + auto) + # This case should never occur but better safe than sorry. + echo "no" + _opengl=no ;; -esac -if test "$_opengles" = "yes" ; then - echo "yes (OpenGL ES)" -else - echo "$_opengl" -fi + none) + echo "no" + _opengl=no + ;; + + any) + echo "yes (runtime detection)" + add_line_to_config_h "#undef USE_GLES_MODE" + ;; + + gl) + echo "yes (OpenGL)" + add_line_to_config_h "#define USE_GLES_MODE 0" + ;; + + gles) + echo "yes (OpenGL ES)" + add_line_to_config_h "#define USE_GLES_MODE 1" + ;; + + gles2) + echo "yes (OpenGL ES 2)" + add_line_to_config_h "#define USE_GLES_MODE 2" + ;; + + *) + echo "invalid mode specification '$_opengl_mode'. Aborting." + exit 1 + ;; +esac define_in_config_if_yes "$_opengl" "USE_OPENGL" -define_in_config_if_yes "$_opengles" "USE_GLES" + +# +# Check for Linux CD-ROM support +# +case $_host_os in + *linux*) + echocheck "Linux CD-ROM" + linuxcd=no + cat > $TMPC << EOF +#include <linux/cdrom.h> +#include <sys/types.h> +int main(void) { + int x = CDROMREADAUDIO; + dev_t dev; + return major(dev) + x; +} +EOF + cc_check && linuxcd=yes + define_in_config_if_yes "$linuxcd" 'USE_LINUXCD' + echo "$linuxcd" + ;; +esac # @@ -4286,6 +4618,10 @@ if test "$_16bit" = yes ; then echo_n ", 16bit color" fi +if test "$_highres" = yes ; then + echo_n ", high resolution" +fi + if test "$_savegame_timestamp" = yes ; then echo_n ", savegame timestamp" fi @@ -4299,7 +4635,7 @@ if test "$_build_scalers" = yes ; then fi if test "$_mt32emu" = yes ; then - echo_n ", MT-32 emu" + echo_n ", MT-32 emulator" fi if test "$_text_console" = yes ; then @@ -4325,6 +4661,14 @@ fi # after all of CXXFLAGS, LDFLAGS, LIBS etc. have been setup # case $_backend in + 3ds) + if test "$_freetype2" = yes -a "$_png" = yes; then + append_var LIBS "-lpng" + fi + if test "$_tremor" = yes -o "$_flac" = yes; then + append_var LIBS "-logg" + fi + ;; android) # ssp at this point so the cxxtests link if test "$_debug_build" = yes; then @@ -4556,6 +4900,9 @@ STAGINGPATH=$_stagingpath WIN32PATH=$_win32path AMIGAOSPATH=$_amigaospath STATICLIBPATH=$_staticlibpath +XCODETOOLSPATH=$_xcodetoolspath +SPARKLEPATH=$_sparklepath +SDLCONFIG=$_sdlconfig ABI := $ABI |