aboutsummaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure1800
1 files changed, 1170 insertions, 630 deletions
diff --git a/configure b/configure
index 6cc98f697b..ece7eaacd3 100755
--- a/configure
+++ b/configure
@@ -35,6 +35,7 @@ SAVED_CXXFLAGS=$CXXFLAGS
SAVED_CPPFLAGS=$CPPFLAGS
SAVED_ASFLAGS=$ASFLAGS
SAVED_WINDRESFLAGS=$WINDRESFLAGS
+SAVED_SDL_CONFIG=$SDL_CONFIG
# Use environment vars if set
CXXFLAGS="$CXXFLAGS $CPPFLAGS"
@@ -68,6 +69,16 @@ get_var() {
eval echo \$${1}
}
+append_var() {
+ VAR=${1}
+ shift
+ if eval test -z \"\$${VAR}\" ; then
+ eval ${VAR}='$@'
+ else
+ eval ${VAR}=\"\$${VAR} \"'$@'
+ fi
+}
+
# Add an engine: id name build subengines base-games dependencies
add_engine() {
_engines="${_engines} ${1}"
@@ -106,6 +117,8 @@ done
#
# Default lib behavior yes/no/auto
_vorbis=auto
+_sdlnet=auto
+_libcurl=auto
_tremor=auto
_tremolo=no
_flac=auto
@@ -117,13 +130,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
@@ -142,6 +155,7 @@ _build_hq_scalers=yes
_enable_prof=no
_global_constructors=no
_bink=yes
+_cloud=auto
# Default vkeybd/keymapper/eventrec options
_vkeybd=no
_keymapper=no
@@ -151,6 +165,7 @@ _translation=yes
# Default platform settings
_backend=sdl
_16bit=auto
+_highres=auto
_savegame_timestamp=auto
_dynamic_modules=no
_elf_loader=no
@@ -170,10 +185,14 @@ _stagingpath="staging"
_win32path="c:/scummvm"
_amigaospath="Games:ScummVM"
_staticlibpath=
-_sdlconfig=sdl-config
+_xcodetoolspath=
+_sparklepath=
+_sdlconfig=sdl2-config
+_libcurlconfig=curl-config
_freetypeconfig=freetype-config
_sdlpath="$PATH"
_freetypepath="$PATH"
+_libcurlpath="$PATH"
_nasmpath="$PATH"
NASMFLAGS=""
NASM=""
@@ -187,9 +206,11 @@ _have_x86=no
# Add (virtual) features
add_feature 16bit "16bit color" "_16bit"
+add_feature cloud "cloud" "_cloud"
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"
@@ -353,7 +374,7 @@ define_in_config_if_yes() {
# TODO: small bit of code to test sdl usability
find_sdlconfig() {
echo_n "Looking for sdl-config... "
- sdlconfigs="$_sdlconfig:sdl-config:sdl11-config:sdl12-config"
+ sdlconfigs="$SDL_CONFIG:$_sdlconfig:sdl2-config:sdl12-config:sdl11-config:sdl-config"
_sdlconfig=
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="$SEPARATOR"
@@ -418,6 +439,40 @@ find_freetypeconfig() {
}
#
+# Determine curl-config
+#
+find_libcurlconfig() {
+ echo_n "Looking for curl-config... "
+ libcurlconfigs="$_libcurlconfig"
+ _libcurlconfig=
+
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="$SEPARATOR"
+ for path_dir in $_libcurlpath; do
+ #reset separator to parse sdlconfigs
+ IFS=":"
+ for libcurlconfig in $libcurlconfigs; do
+ if test -f "$path_dir/$libcurlconfig" ; then
+ _libcurlconfig="$path_dir/$libcurlconfig"
+ echo $_libcurlconfig
+ # Save the prefix
+ _libcurlpath=$path_dir
+ if test `basename $path_dir` = bin ; then
+ _sdlpath=`dirname $path_dir`
+ fi
+ # break at first sdl-config found in path
+ break 2
+ fi
+ done
+ done
+
+ IFS="$ac_save_ifs"
+
+ if test -z "$_libcurlconfig"; then
+ echo "none found!"
+ fi
+}
+
+#
# Determine extension used for executables
#
get_system_exe_extension() {
@@ -425,7 +480,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)
@@ -582,7 +637,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
@@ -794,12 +849,6 @@ get_subengines_build_string() {
}
#
-# Greet user
-#
-echo "Running ScummVM configure..."
-echo "Configure run on" `date` > $TMPLOG
-
-#
# Check any parameters we received
#
# TODO:
@@ -822,9 +871,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
@@ -850,19 +899,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
@@ -874,6 +926,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
@@ -884,7 +937,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)
@@ -903,11 +956,13 @@ 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
--disable-translation don't build support for translated messages
--disable-taskbar don't build support for taskbar and launcher integration
+ --disable-cloud don't build cloud support
--enable-vkeybd build virtual keyboard support
--enable-keymapper build key mapper support
--enable-eventrecorder enable event recording functionality
@@ -917,6 +972,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)
@@ -941,9 +1005,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]
@@ -960,8 +1021,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)
@@ -982,6 +1045,11 @@ Optional Libraries:
--with-sndio-prefix=DIR Prefix where sndio is installed (optional)
--disable-sndio disable sndio MIDI driver [autodetect]
+ --with-sdlnet-prefix=DIR Prefix where SDL_Net is
+ installed (optional)
+ --disable-sdlnet disable SDL_Net networking library [autodetect]
+ --disable-libcurl disable libcurl networking library [autodetect]
+
Some influential environment variables:
LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
nonstandard directory <lib dir>
@@ -997,9 +1065,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 ;;
@@ -1023,6 +1107,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 ;;
@@ -1042,14 +1128,21 @@ for ac_option in $@; do
--disable-freetype2) _freetype2=no ;;
--enable-taskbar) _taskbar=yes ;;
--disable-taskbar) _taskbar=no ;;
+ --enable-sdlnet) _sdlnet=yes ;;
+ --disable-sdlnet) _sdlnet=no ;;
+ --enable-libcurl) _libcurl=yes ;;
+ --disable-libcurl) _libcurl=no ;;
+ --enable-cloud) _cloud=yes ;;
+ --disable-cloud) _cloud=no ;;
--enable-updates) _updates=yes ;;
--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 ;;
@@ -1137,8 +1230,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`
@@ -1150,10 +1242,10 @@ for ac_option in $@; do
LIBUNITY_CFLAGS="-I$arg/include"
LIBUNITY_LIBS="-L$arg/lib"
;;
- --with-opengl-prefix=*)
+ --with-sdlnet-prefix=*)
arg=`echo $ac_option | cut -d '=' -f 2`
- OPENGL_CFLAGS="-I$arg/include"
- OPENGL_LIBS="-L$arg/lib"
+ SDL_NET_CFLAGS="-I$arg/include"
+ SDL_NET_LIBS="-L$arg/lib"
;;
--backend=*)
_backend=`echo $ac_option | cut -d '=' -f 2`
@@ -1171,7 +1263,7 @@ for ac_option in $@; do
_debug_build=no
;;
--enable-Werror)
- CXXFLAGS="$CXXFLAGS -Werror"
+ append_var CXXFLAGS "-Werror"
;;
--enable-release-mode)
_release_build=yes
@@ -1211,6 +1303,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`
;;
@@ -1275,6 +1370,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
@@ -1290,10 +1390,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
@@ -1308,8 +1435,8 @@ dreamcast)
_host_os=dreamcast
_host_cpu=sh
_host_alias=sh-elf
- CXXFLAGS="$CXXFLAGS -ml -m4-single-only"
- LDFLAGS="$LDFLAGS -ml -m4-single-only"
+ append_var CXXFLAGS "-ml -m4-single-only"
+ append_var LDFLAGS "-ml -m4-single-only"
;;
ds)
_host_os=ds
@@ -1318,7 +1445,7 @@ ds)
;;
gamecube)
_host_os=gamecube
- _host_cpu=ppc
+ _host_cpu=powerpc
_host_alias=powerpc-eabi
;;
gp2x)
@@ -1340,6 +1467,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
@@ -1386,7 +1518,7 @@ openpandora)
;;
ppc-amigaos)
_host_os=amigaos
- _host_cpu=ppc
+ _host_cpu=powerpc
;;
ps2)
_host_os=ps2
@@ -1398,7 +1530,7 @@ ps2)
;;
ps3)
_host_os=ps3
- _host_cpu=ppc
+ _host_cpu=powerpc
_host_alias=powerpc64-ps3-elf
# The prefix is always the same on PS3 so we hardcode the default
@@ -1444,7 +1576,7 @@ webos)
;;
wii)
_host_os=wii
- _host_cpu=ppc
+ _host_cpu=powerpc
_host_alias=powerpc-eabi
;;
wince)
@@ -1496,18 +1628,18 @@ if test "$_debug_build" != no; then
case $_host_os in
amigaos*)
# AmigaOS debugger uses plain stabs, with no gdb extensions.
- CXXFLAGS="$CXXFLAGS -gstabs"
+ append_var CXXFLAGS "-gstabs"
;;
*)
# Use the system default format for debug info.
- CXXFLAGS="$CXXFLAGS -g"
+ append_var CXXFLAGS "-g"
esac
fi
if test "$_release_build" = yes; then
# Add a define, which indicates we are doing
# an build for a release version.
- DEFINES="$DEFINES -DRELEASE_BUILD"
+ append_var DEFINES "-DRELEASE_BUILD"
fi
@@ -1544,7 +1676,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
@@ -1667,23 +1799,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.
- CXXFLAGS="$CXXFLAGS -diag-error 10006,10148"
+ 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'
@@ -1691,11 +1833,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
@@ -1784,23 +1932,23 @@ 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 )
;;
*)
- CXXFLAGS="$CXXFLAGS -ansi"
+ append_var CXXFLAGS "-ansi"
;;
esac
fi
- CXXFLAGS="$CXXFLAGS -W -Wno-unused-parameter"
+ append_var CXXFLAGS "-W -Wno-unused-parameter"
add_line_to_config_mk 'HAVE_GCC3 = 1'
add_line_to_config_mk 'CXX_UPDATE_DEP_FLAG = -MMD -MF "$(*D)/$(DEPDIR)/$(*F).d" -MQ "$@" -MP'
fi;
if test "$_cxx_major" -eq 4 && test "$_cxx_minor" -ge 3 || \
test "$_cxx_major" -gt 4 ; then
- CXXFLAGS="$CXXFLAGS -Wno-empty-body"
+ append_var CXXFLAGS "-Wno-empty-body"
else
- CXXFLAGS="$CXXFLAGS -Wconversion"
+ append_var CXXFLAGS "-Wconversion"
fi;
elif test "$have_icc" = yes ; then
add_line_to_config_mk 'CXX_UPDATE_DEP_FLAG = -MMD -MF "$(*D)/$(DEPDIR)/$(*F).d" -MQ "$@" -MP'
@@ -1811,7 +1959,7 @@ fi;
#
echo_n "Building as C++11... "
if test "$_use_cxx11" = "yes" ; then
- CXXFLAGS="$CXXFLAGS -std=c++11"
+ append_var CXXFLAGS "-std=c++11"
fi
echo $_use_cxx11
@@ -1820,13 +1968,13 @@ 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.
if test "$have_icc" = no ; then
# We *do* want the 'long long' extension.
- CXXFLAGS="$CXXFLAGS -pedantic -Wno-long-long"
+ append_var CXXFLAGS "-pedantic -Wno-long-long"
fi
;;
esac
@@ -1840,7 +1988,7 @@ EOF
cc_check -Wglobal-constructors && _global_constructors=yes
if test "$_global_constructors" = yes; then
- CXXFLAGS="$CXXFLAGS -Wglobal-constructors"
+ append_var CXXFLAGS "-Wglobal-constructors"
fi
echo $_global_constructors
@@ -2004,7 +2152,7 @@ cc_check_clean tmp_find_type_with_size.cpp
# for the smaller sizes.
echo_n "Alignment required... "
case $_host_cpu in
- i[3-6]86 | amd64 | x86_64 | ppc*)
+ i[3-6]86 | amd64 | x86_64 | powerpc*)
# Unaligned access should work
_need_memalign=no
;;
@@ -2028,15 +2176,33 @@ 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)
+ ;;
- DEFINES="$DEFINES -DARM_TARGET"
+ *)
+ 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"
;;
i[3-6]86)
echo "x86"
@@ -2045,11 +2211,11 @@ case $_host_cpu in
;;
mips*)
echo "MIPS"
- DEFINES="$DEFINES -DMIPS_TARGET"
+ append_var DEFINES "-DMIPS_TARGET"
;;
- ppc*)
+ powerpc*)
echo "PowerPC"
- DEFINES="$DEFINES -DPPC_TARGET"
+ append_var DEFINES "-DPPC_TARGET"
;;
amd64 | x86_64)
echo "x86_64"
@@ -2066,57 +2232,78 @@ 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*)
- LDFLAGS="$LDFLAGS -use-dynld -Wl,--export-dynamic"
- LDFLAGS="$LDFLAGS -L/sdk/local/newlib/lib"
+ 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.
type_4_byte='long'
# Supress format warnings as the long 4 byte causes noisy warnings.
- CXXFLAGS="$CXXFLAGS -Wno-format"
+ append_var CXXFLAGS "-Wno-format"
add_line_to_config_mk 'AMIGAOS = 1'
_port_mk="backends/platform/sdl/amigaos/amigaos.mk"
;;
android)
case $_host in
android | android-arm)
- CXXFLAGS="$CXXFLAGS -march=armv5te"
- CXXFLAGS="$CXXFLAGS -mtune=xscale"
- CXXFLAGS="$CXXFLAGS -msoft-float"
+ append_var CXXFLAGS "-march=armv5te"
+ append_var CXXFLAGS "-mtune=xscale"
+ append_var CXXFLAGS "-msoft-float"
ABI="armeabi"
ANDROID_PLATFORM=9
ANDROID_PLATFORM_ARCH="arm"
;;
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"
+ append_var CXXFLAGS "-march=armv7-a"
+ append_var CXXFLAGS "-mfloat-abi=softfp"
+ append_var CXXFLAGS "-mfpu=vfp"
+ append_var LDFLAGS "-Wl,--fix-cortex-a8"
ABI="armeabi-v7a"
ANDROID_PLATFORM=9
ANDROID_PLATFORM_ARCH="arm"
;;
android-mips)
- CXXFLAGS="$CXXFLAGS -march=mips32"
- CXXFLAGS="$CXXFLAGS -mtune=mips32"
+ append_var CXXFLAGS "-march=mips32"
+ append_var 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"
+ append_var CXXFLAGS "-march=i686"
+ append_var 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"
+ append_var CXXFLAGS "-march=armv7-a"
+ append_var CXXFLAGS "-mtune=cortex-a9"
+ append_var CXXFLAGS "-mfloat-abi=softfp"
+ append_var CXXFLAGS "-mfpu=neon"
ABI="armeabi-v7a"
ANDROID_PLATFORM=4
ANDROID_PLATFORM_ARCH="arm"
@@ -2124,40 +2311,40 @@ case $_host_os in
esac
# 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"
+ append_var CXXFLAGS "--sysroot=$ANDROID_NDK/platforms/android-$ANDROID_PLATFORM/arch-$ANDROID_PLATFORM_ARCH"
+ append_var LDFLAGS "--sysroot=$ANDROID_NDK/platforms/android-$ANDROID_PLATFORM/arch-$ANDROID_PLATFORM_ARCH"
- CXXFLAGS="$CXXFLAGS -fpic"
- CXXFLAGS="$CXXFLAGS -ffunction-sections"
- CXXFLAGS="$CXXFLAGS -funwind-tables"
+ append_var CXXFLAGS "-fpic"
+ append_var CXXFLAGS "-ffunction-sections"
+ append_var CXXFLAGS "-funwind-tables"
if test "$_debug_build" = yes; then
- CXXFLAGS="$CXXFLAGS -fno-omit-frame-pointer"
- CXXFLAGS="$CXXFLAGS -fno-strict-aliasing"
+ append_var CXXFLAGS "-fno-omit-frame-pointer"
+ append_var CXXFLAGS "-fno-strict-aliasing"
else
- CXXFLAGS="$CXXFLAGS -fomit-frame-pointer"
- CXXFLAGS="$CXXFLAGS -fstrict-aliasing"
+ append_var CXXFLAGS "-fomit-frame-pointer"
+ append_var CXXFLAGS "-fstrict-aliasing"
fi
- CXXFLAGS="$CXXFLAGS -finline-limit=300"
+ append_var CXXFLAGS "-finline-limit=300"
_optimization_level=-Os
if test "$_host" = android -o "$_host" = android-arm; then
- CXXFLAGS="$CXXFLAGS -mthumb-interwork"
+ append_var 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__"
+ append_var CXXFLAGS "-D__ARM_ARCH_5__"
+ append_var CXXFLAGS "-D__ARM_ARCH_5T__"
+ append_var CXXFLAGS "-D__ARM_ARCH_5E__"
+ append_var CXXFLAGS "-D__ARM_ARCH_5TE__"
fi
# surpress 'mangling of 'va_list' has changed in GCC 4.4' warning
- CXXFLAGS="$CXXFLAGS -Wno-psabi"
+ append_var CXXFLAGS "-Wno-psabi"
if test "$_host" = android -o "$_host" = android-arm; then
- LDFLAGS="$LDFLAGS -mthumb-interwork"
+ append_var LDFLAGS "-mthumb-interwork"
fi
- LDFLAGS="$LDFLAGS -L$ANDROID_NDK/sources/cxx-stl/gnu-libstdc++/`$CXX -dumpversion`/libs/$ABI/"
- LIBS="$LIBS -lsupc++"
+ append_var LDFLAGS "-L$ANDROID_NDK/sources/cxx-stl/gnu-libstdc++/`$CXX -dumpversion`/libs/$ABI/"
+ append_var LIBS "-lsupc++"
add_line_to_config_mk "ANDROID_SDK = $ANDROID_SDK"
if test -d "$ANDROID_SDK"/build-tools; then
_build_tools_version=`cd "$ANDROID_SDK"/build-tools && ls -1 | sort -rn | head -1`
@@ -2168,12 +2355,12 @@ case $_host_os in
_seq_midi=no
;;
beos*)
- DEFINES="$DEFINES -DSYSTEM_NOT_SUPPORTING_D_TYPE"
+ append_var DEFINES "-DSYSTEM_NOT_SUPPORTING_D_TYPE"
# Needs -lbind -lsocket for the timidity MIDI driver
LDFLAGS="-L/boot/home/config/lib"
CFLAGS="-I/boot/home/config/include"
- CXXFLAGS="$CXXFLAGS -fhuge-objects"
- LIBS="$LIBS -lbind -lsocket"
+ append_var CXXFLAGS "-fhuge-objects"
+ append_var LIBS "-lbind -lsocket"
_seq_midi=no
;;
cygwin*)
@@ -2181,8 +2368,21 @@ case $_host_os in
exit 1
;;
darwin*)
- DEFINES="$DEFINES -DMACOSX"
- LIBS="$LIBS -framework AudioUnit -framework AudioToolbox -framework Carbon -framework CoreMIDI"
+ # Pass -mlongcall to gcc so that it emits long calls
+ # which will allow for calls larger than 32MB. The linker
+ # will discard the calls if they are not needed, but we
+ # need to ensure the compiler emits them in the first place.
+ case $_host_cpu in
+ powerpc*)
+ append_var CFLAGS "-mlongcall"
+ append_var CXXFLAGS "-mlongcall"
+ ;;
+ esac
+
+ append_var DEFINES "-DMACOSX"
+ append_var LIBS "-framework AudioUnit -framework AudioToolbox -framework Carbon -framework CoreMIDI"
+ # SDL2 doesn't seem to add Cocoa for us.
+ append_var LIBS "-framework Cocoa"
add_line_to_config_mk 'MACOSX = 1'
# Now we may have MacPorts or Fink installed
@@ -2205,7 +2405,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}"
@@ -2267,205 +2467,221 @@ 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)
- DEFINES="$DEFINES -D__DC__"
- DEFINES="$DEFINES -DNONSTANDARD_PORT"
+ append_var DEFINES "-D__DC__"
+ append_var DEFINES "-DNONSTANDARD_PORT"
;;
ds)
- DEFINES="$DEFINES -D__DS__"
- DEFINES="$DEFINES -DNDS"
- DEFINES="$DEFINES -DARM9"
- DEFINES="$DEFINES -DARM"
- DEFINES="$DEFINES -DNONSTANDARD_PORT"
- CXXFLAGS="$CXXFLAGS -isystem $DEVKITPRO/libnds/include"
- CXXFLAGS="$CXXFLAGS -isystem $DEVKITPRO/devkitARM/arm-eabi/include"
- CXXFLAGS="$CXXFLAGS -mcpu=arm9tdmi"
- CXXFLAGS="$CXXFLAGS -mtune=arm9tdmi"
- CXXFLAGS="$CXXFLAGS -fomit-frame-pointer"
- CXXFLAGS="$CXXFLAGS -mthumb-interwork"
- CXXFLAGS="$CXXFLAGS -ffunction-sections"
- CXXFLAGS="$CXXFLAGS -fdata-sections"
- CXXFLAGS="$CXXFLAGS -fno-strict-aliasing"
- CXXFLAGS="$CXXFLAGS -fuse-cxa-atexit"
- LDFLAGS="$LDFLAGS -specs=ds_arm9.specs"
- LDFLAGS="$LDFLAGS -mthumb-interwork"
- LDFLAGS="$LDFLAGS -mno-fpu"
- LDFLAGS="$LDFLAGS -Wl,-Map,map.txt"
+ append_var DEFINES "-D__DS__"
+ append_var DEFINES "-DNDS"
+ append_var DEFINES "-DARM9"
+ append_var DEFINES "-DARM"
+ append_var DEFINES "-DNONSTANDARD_PORT"
+ append_var CXXFLAGS "-isystem $DEVKITPRO/libnds/include"
+ append_var CXXFLAGS "-isystem $DEVKITPRO/devkitARM/arm-eabi/include"
+ append_var CXXFLAGS "-mcpu=arm9tdmi"
+ append_var CXXFLAGS "-mtune=arm9tdmi"
+ append_var CXXFLAGS "-fomit-frame-pointer"
+ append_var CXXFLAGS "-mthumb-interwork"
+ append_var CXXFLAGS "-ffunction-sections"
+ append_var CXXFLAGS "-fdata-sections"
+ append_var CXXFLAGS "-fno-strict-aliasing"
+ append_var CXXFLAGS "-fuse-cxa-atexit"
+ append_var LDFLAGS "-specs=ds_arm9.specs"
+ append_var LDFLAGS "-mthumb-interwork"
+ append_var LDFLAGS "-mno-fpu"
+ append_var LDFLAGS "-Wl,-Map,map.txt"
if test "$_dynamic_modules" = no ; then
- LDFLAGS="$LDFLAGS -Wl,--gc-sections"
+ append_var LDFLAGS "-Wl,--gc-sections"
else
- LDFLAGS="$LDFLAGS -Wl,--no-gc-sections"
+ append_var LDFLAGS "-Wl,--no-gc-sections"
# TODO automate this required 2 step linking phase
- # LDFLAGS="$LDFLAGS -Wl,--retain-symbols-file,ds.syms"
+ # append_var LDFLAGS "-Wl,--retain-symbols-file,ds.syms"
fi
- LDFLAGS="$LDFLAGS -L$DEVKITPRO/libnds/lib"
- LIBS="$LIBS -lnds9"
+ append_var LDFLAGS "-L$DEVKITPRO/libnds/lib"
+ append_var LIBS "-lnds9"
;;
freebsd*)
- LDFLAGS="$LDFLAGS -L/usr/local/lib"
- CXXFLAGS="$CXXFLAGS -I/usr/local/include"
+ append_var LDFLAGS "-L/usr/local/lib"
+ append_var CXXFLAGS "-I/usr/local/include"
;;
gamecube)
_optimization_level=-Os
- CXXFLAGS="$CXXFLAGS -mogc"
- CXXFLAGS="$CXXFLAGS -mcpu=750"
- CXXFLAGS="$CXXFLAGS -meabi"
- CXXFLAGS="$CXXFLAGS -mhard-float"
- CXXFLAGS="$CXXFLAGS -ffunction-sections"
- CXXFLAGS="$CXXFLAGS -fdata-sections"
- CXXFLAGS="$CXXFLAGS -fmodulo-sched"
- CXXFLAGS="$CXXFLAGS -fuse-cxa-atexit"
- CXXFLAGS="$CXXFLAGS -I$DEVKITPRO/libogc/include"
+ append_var CXXFLAGS "-mogc"
+ append_var CXXFLAGS "-mcpu=750"
+ append_var CXXFLAGS "-meabi"
+ append_var CXXFLAGS "-mhard-float"
+ append_var CXXFLAGS "-ffunction-sections"
+ append_var CXXFLAGS "-fdata-sections"
+ append_var CXXFLAGS "-fmodulo-sched"
+ append_var CXXFLAGS "-fuse-cxa-atexit"
+ append_var CXXFLAGS "-I$DEVKITPRO/libogc/include"
# libogc is required to link the cc tests (includes _start())
- LDFLAGS="$LDFLAGS -mogc"
- LDFLAGS="$LDFLAGS -mcpu=750"
- LDFLAGS="$LDFLAGS -L$DEVKITPRO/libogc/lib/cube"
- LDFLAGS="$LDFLAGS -logc"
+ append_var LDFLAGS "-mogc"
+ append_var LDFLAGS "-mcpu=750"
+ append_var LDFLAGS "-L$DEVKITPRO/libogc/lib/cube"
+ append_var LDFLAGS "-logc"
if test "$_dynamic_modules" = "yes" ; then
# retarded toolchain patch forces --gc-sections, overwrite it
- LDFLAGS="$LDFLAGS -Wl,--no-gc-sections"
+ append_var LDFLAGS "-Wl,--no-gc-sections"
fi
;;
haiku*)
- DEFINES="$DEFINES -DSYSTEM_NOT_SUPPORTING_D_TYPE"
+ append_var DEFINES "-DSYSTEM_NOT_SUPPORTING_D_TYPE"
# Needs -lnetwork for the timidity MIDI driver
- LIBS="$LIBS -lnetwork"
+ append_var LIBS "-lnetwork"
_seq_midi=no
;;
irix*)
- DEFINES="$DEFINES -DIRIX"
- DEFINES="$DEFINES -DSYSTEM_NOT_SUPPORTING_D_TYPE"
- LIBS="$LIBS -lmd -lfastm -lm"
+ append_var DEFINES "-DIRIX"
+ append_var DEFINES "-DSYSTEM_NOT_SUPPORTING_D_TYPE"
+ append_var LIBS "-lmd -lfastm -lm"
_ranlib=:
;;
linux* | uclinux*)
# When not cross-compiling, enable large file support, but don't
# care if getconf doesn't exist or doesn't recognize LFS_CFLAGS.
if test -z "$_host"; then
- CXXFLAGS="$CXXFLAGS `getconf LFS_CFLAGS 2>/dev/null`"
+ append_var CXXFLAGS "`getconf LFS_CFLAGS 2>/dev/null`"
fi
;;
maemo)
- DEFINES="$DEFINES -DMAEMO"
+ append_var DEFINES "-DMAEMO"
;;
mingw*)
- DEFINES="$DEFINES -DWIN32"
- DEFINES="$DEFINES -D__USE_MINGW_ANSI_STDIO=0"
- LDFLAGS="$LDFLAGS -static-libgcc -static-libstdc++"
- LIBS="$LIBS -lmingw32 -lwinmm -lgdi32"
- OBJS="$OBJS scummvmwinres.o"
+ append_var DEFINES "-DWIN32"
+ append_var DEFINES "-D__USE_MINGW_ANSI_STDIO=0"
+ append_var LDFLAGS "-static-libgcc -static-libstdc++"
+ append_var LIBS "-lmingw32 -lwinmm -lgdi32"
+ append_var OBJS "scummvmwinres.o"
add_line_to_config_mk 'WIN32 = 1'
;;
mint*)
- DEFINES="$DEFINES -DSYSTEM_NOT_SUPPORTING_D_TYPE"
+ 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)
- DEFINES="$DEFINES -D__N64__"
- DEFINES="$DEFINES -DLIMIT_FPS"
- DEFINES="$DEFINES -DNONSTANDARD_PORT"
- DEFINES="$DEFINES -DDISABLE_COMMAND_LINE"
- DEFINES="$DEFINES -DDISABLE_DEFAULT_SAVEFILEMANAGER"
- DEFINES="$DEFINES -DDISABLE_DOSBOX_OPL"
- DEFINES="$DEFINES -DDISABLE_FANCY_THEMES"
- DEFINES="$DEFINES -DDISABLE_NES_APU"
- DEFINES="$DEFINES -DDISABLE_SID"
- DEFINES="$DEFINES -DREDUCE_MEMORY_USAGE"
+ append_var DEFINES "-D__N64__"
+ append_var DEFINES "-DLIMIT_FPS"
+ append_var DEFINES "-DNONSTANDARD_PORT"
+ append_var DEFINES "-DDISABLE_COMMAND_LINE"
+ append_var DEFINES "-DDISABLE_DEFAULT_SAVEFILEMANAGER"
+ append_var DEFINES "-DDISABLE_DOSBOX_OPL"
+ append_var DEFINES "-DDISABLE_FANCY_THEMES"
+ append_var DEFINES "-DDISABLE_NES_APU"
+ append_var DEFINES "-DDISABLE_SID"
+ append_var DEFINES "-DREDUCE_MEMORY_USAGE"
;;
ps2)
- CXXFLAGS="$CXXFLAGS -G2"
- DEFINES="$DEFINES -D_EE"
- DEFINES="$DEFINES -D__PLAYSTATION2__"
+ append_var CXXFLAGS "-G2"
+ append_var DEFINES "-D_EE"
+ append_var DEFINES "-D__PLAYSTATION2__"
if test -z "$PS2SDK_OLD"; then
- DEFINES="$DEFINES -D__NEW_PS2SDK__"
+ append_var DEFINES "-D__NEW_PS2SDK__"
fi
;;
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"
- DEFINES="$DEFINES -DPLAYSTATION3"
- CXXFLAGS="$CXXFLAGS -mcpu=cell -mminimal-toc -I$PSL1GHT/ppu/include -I$PS3DEV/portlibs/ppu/include"
- LDFLAGS="$LDFLAGS -L$PSL1GHT/ppu/lib -L$PS3DEV/portlibs/ppu/lib"
+ append_var DEFINES "-DPLAYSTATION3"
+ append_var CXXFLAGS "-mcpu=cell -mminimal-toc -I$PSL1GHT/ppu/include -I$PS3DEV/portlibs/ppu/include"
+ append_var LDFLAGS "-L$PSL1GHT/ppu/lib -L$PS3DEV/portlibs/ppu/lib"
add_line_to_config_mk 'PLAYSTATION3 = 1'
add_line_to_config_h "#define PREFIX \"${prefix}\""
;;
psp)
if test -d "$PSPDEV/psp/lib"; then
- LDFLAGS="$LDFLAGS -L$PSPDEV/psp/lib"
+ append_var LDFLAGS "-L$PSPDEV/psp/lib"
fi
- LDFLAGS="$LDFLAGS -L$PSPSDK/lib"
- LDFLAGS="$LDFLAGS -specs=$_srcdir/backends/platform/psp/psp.spec"
+ append_var LDFLAGS "-L$PSPSDK/lib"
+ append_var LDFLAGS "-specs=$_srcdir/backends/platform/psp/psp.spec"
_optimization_level=-O3
- CXXFLAGS="$CXXFLAGS -I$PSPSDK/include"
+ append_var CXXFLAGS "-I$PSPSDK/include"
# FIXME: Why is the following in CXXFLAGS and not in DEFINES? Change or document this.
- CXXFLAGS="$CXXFLAGS -D_PSP_FW_VERSION=150"
+ append_var CXXFLAGS "-D_PSP_FW_VERSION=150"
;;
solaris*)
- DEFINES="$DEFINES -DSOLARIS"
- DEFINES="$DEFINES -DSYSTEM_NOT_SUPPORTING_D_TYPE"
+ append_var DEFINES "-DSOLARIS"
+ append_var DEFINES "-DSYSTEM_NOT_SUPPORTING_D_TYPE"
# Needs -lbind -lsocket for the timidity MIDI driver
- LIBS="$LIBS -lnsl -lsocket"
+ append_var LIBS "-lnsl -lsocket"
;;
tizen)
add_line_to_config_mk "TIZEN_ROOTSTRAP = $TIZEN_ROOTSTRAP"
- LDFLAGS="$LDFLAGS --sysroot=${TIZEN_ROOTSTRAP}"
- LDFLAGS="$LDFLAGS -L${TIZEN_LIBS}/lib"
- CXXFLAGS="$CXXFLAGS -I${TIZEN_LIBS}/include"
+ append_var LDFLAGS "--sysroot=${TIZEN_ROOTSTRAP}"
+ append_var LDFLAGS "-L${TIZEN_LIBS}/lib"
+ append_var CXXFLAGS "-I${TIZEN_LIBS}/include"
;;
webos)
- CXXFLAGS="$CXXFLAGS --sysroot=$WEBOS_PDK/arm-gcc/sysroot"
- CXXFLAGS="$CXXFLAGS -I$WEBOS_PDK/include"
- CXXFLAGS="$CXXFLAGS -I$WEBOS_PDK/include/SDL"
- CXXFLAGS="$CXXFLAGS -I$WEBOS_PDK/device/usr/include"
+ append_var CXXFLAGS "--sysroot=$WEBOS_PDK/arm-gcc/sysroot"
+ append_var CXXFLAGS "-I$WEBOS_PDK/include"
+ append_var CXXFLAGS "-I$WEBOS_PDK/include/SDL"
+ append_var CXXFLAGS "-I$WEBOS_PDK/device/usr/include"
# These compiler options are needed to support the Palm Pixi
- CXXFLAGS="$CXXFLAGS -mcpu=arm1136jf-s"
- CXXFLAGS="$CXXFLAGS -mfpu=vfp "
- CXXFLAGS="$CXXFLAGS -mfloat-abi=softfp"
- LDFLAGS="$LDFLAGS -L$WEBOS_PDK/device/lib"
- LDFLAGS="$LDFLAGS -L$WEBOS_PDK/device/usr/lib"
- LDFLAGS="$LDFLAGS -Wl,--allow-shlib-undefined"
- LDFLAGS="$LDFLAGS --sysroot=$WEBOS_PDK/arm-gcc/sysroot"
+ append_var CXXFLAGS "-mcpu=arm1136jf-s"
+ append_var CXXFLAGS "-mfpu=vfp "
+ append_var CXXFLAGS "-mfloat-abi=softfp"
+ append_var LDFLAGS "-L$WEBOS_PDK/device/lib"
+ append_var LDFLAGS "-L$WEBOS_PDK/device/usr/lib"
+ append_var LDFLAGS "-Wl,--allow-shlib-undefined"
+ append_var LDFLAGS "--sysroot=$WEBOS_PDK/arm-gcc/sysroot"
add_line_to_config_mk "WEBOS_SDK = $WEBOS_SDK"
_seq_midi=no
;;
wii)
_optimization_level=-Os
- CXXFLAGS="$CXXFLAGS -mrvl"
- CXXFLAGS="$CXXFLAGS -mcpu=750"
- CXXFLAGS="$CXXFLAGS -meabi"
- CXXFLAGS="$CXXFLAGS -mhard-float"
- CXXFLAGS="$CXXFLAGS -ffunction-sections"
- CXXFLAGS="$CXXFLAGS -fdata-sections"
- CXXFLAGS="$CXXFLAGS -fmodulo-sched"
- CXXFLAGS="$CXXFLAGS -fuse-cxa-atexit"
- CXXFLAGS="$CXXFLAGS -I$DEVKITPRO/libogc/include"
+ append_var CXXFLAGS "-mrvl"
+ append_var CXXFLAGS "-mcpu=750"
+ append_var CXXFLAGS "-meabi"
+ append_var CXXFLAGS "-mhard-float"
+ append_var CXXFLAGS "-ffunction-sections"
+ append_var CXXFLAGS "-fdata-sections"
+ append_var CXXFLAGS "-fmodulo-sched"
+ append_var CXXFLAGS "-fuse-cxa-atexit"
+ append_var CXXFLAGS "-I$DEVKITPRO/libogc/include"
# libogc is required to link the cc tests (includes _start())
- LDFLAGS="$LDFLAGS -mrvl"
- LDFLAGS="$LDFLAGS -mcpu=750"
- LDFLAGS="$LDFLAGS -L$DEVKITPRO/libogc/lib/wii"
- LDFLAGS="$LDFLAGS -logc"
+ append_var LDFLAGS "-mrvl"
+ append_var LDFLAGS "-mcpu=750"
+ append_var LDFLAGS "-L$DEVKITPRO/libogc/lib/wii"
+ append_var LDFLAGS "-logc"
if test "$_dynamic_modules" = "yes" ; then
# retarded toolchain patch forces --gc-sections, overwrite it
- LDFLAGS="$LDFLAGS -Wl,--no-gc-sections"
+ append_var LDFLAGS "-Wl,--no-gc-sections"
fi
;;
wince)
_optimization_level=-O3
- CXXFLAGS="$CXXFLAGS -fno-inline-functions"
- CXXFLAGS="$CXXFLAGS -march=armv4"
- CXXFLAGS="$CXXFLAGS -mtune=xscale"
- DEFINES="$DEFINES -D_WIN32_WCE=300"
- DEFINES="$DEFINES -D__ARM__"
- DEFINES="$DEFINES -D_ARM_"
- DEFINES="$DEFINES -DUNICODE"
- DEFINES="$DEFINES -DFPM_DEFAULT"
- DEFINES="$DEFINES -DNONSTANDARD_PORT"
- DEFINES="$DEFINES -DWRAP_MALLOC"
- DEFINES="$DEFINES -DWIN32"
- DEFINES="$DEFINES -Dcdecl="
- DEFINES="$DEFINES -D__cdecl__="
+ append_var CXXFLAGS "-fno-inline-functions"
+ append_var CXXFLAGS "-march=armv4"
+ append_var CXXFLAGS "-mtune=xscale"
+ append_var DEFINES "-D_WIN32_WCE=300"
+ append_var DEFINES "-D__ARM__"
+ append_var DEFINES "-D_ARM_"
+ append_var DEFINES "-DUNICODE"
+ append_var DEFINES "-DFPM_DEFAULT"
+ append_var DEFINES "-DNONSTANDARD_PORT"
+ append_var DEFINES "-DWRAP_MALLOC"
+ append_var DEFINES "-DWIN32"
+ append_var DEFINES "-Dcdecl="
+ append_var DEFINES "-D__cdecl__="
add_line_to_config_mk "WRAP_MALLOC = 1"
;;
esac
@@ -2474,10 +2690,22 @@ 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
- LDFLAGS="$LDFLAGS -shared"
- LDFLAGS="$LDFLAGS -Wl,-Bsymbolic,--no-undefined"
+ append_var LDFLAGS "-shared"
+ append_var LDFLAGS "-Wl,-Bsymbolic,--no-undefined"
HOSTEXEPRE=lib
HOSTEXEEXT=.so
_backend="android"
@@ -2487,22 +2715,30 @@ 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)
- DEFINES="$DEFINES -DLINUPY"
+ append_var DEFINES "-DLINUPY"
;;
bfin*)
;;
caanoo)
- DEFINES="$DEFINES -DCAANOO"
+ append_var DEFINES "-DCAANOO"
if test "$_debug_build" = no; then
# Use -O3 on the Caanoo for non-debug builds.
_optimization_level=-O3
fi
- CXXFLAGS="$CXXFLAGS -mcpu=arm926ej-s"
- CXXFLAGS="$CXXFLAGS -mtune=arm926ej-s"
- ASFLAGS="$ASFLAGS"
+ append_var CXXFLAGS "-mcpu=arm926ej-s"
+ append_var CXXFLAGS "-mtune=arm926ej-s"
_backend="gph"
_build_hq_scalers=no
_savegame_timestamp=no
@@ -2517,17 +2753,16 @@ if test -n "$_host"; then
_strip=$_host-strip
;;
dingux)
- DEFINES="$DEFINES -DDINGUX"
- DEFINES="$DEFINES -DDISABLE_DOSBOX_OPL"
- DEFINES="$DEFINES -DREDUCE_MEMORY_USAGE"
- ASFLAGS="$ASFLAGS"
- CXXFLAGS="$CXXFLAGS -msoft-float"
- CXXFLAGS="$CXXFLAGS -mips32"
+ append_var DEFINES "-DDINGUX"
+ append_var DEFINES "-DDISABLE_DOSBOX_OPL"
+ append_var DEFINES "-DREDUCE_MEMORY_USAGE"
+ append_var CXXFLAGS "-msoft-float"
+ append_var CXXFLAGS "-mips32"
_backend="dingux"
_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
@@ -2537,39 +2772,70 @@ 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)
- DEFINES="$DEFINES -DDISABLE_DEFAULT_SAVEFILEMANAGER"
- DEFINES="$DEFINES -DDISABLE_TEXT_CONSOLE"
- DEFINES="$DEFINES -DDISABLE_COMMAND_LINE"
+ append_var DEFINES "-DDISABLE_DEFAULT_SAVEFILEMANAGER"
+ append_var DEFINES "-DDISABLE_TEXT_CONSOLE"
+ append_var DEFINES "-DDISABLE_COMMAND_LINE"
# Enable serial debugging output only when --enable-debug is passed
if test "$_release_build" = yes -o "$_debug_build" != yes; then
- DEFINES="$DEFINES -DNOSERIAL"
+ append_var DEFINES "-DNOSERIAL"
fi
_optimization_level=-O3
- CXXFLAGS="$CXXFLAGS -funroll-loops"
- CXXFLAGS="$CXXFLAGS -fschedule-insns2"
- CXXFLAGS="$CXXFLAGS -fomit-frame-pointer"
- CXXFLAGS="$CXXFLAGS -fdelete-null-pointer-checks"
+ append_var CXXFLAGS "-funroll-loops"
+ append_var CXXFLAGS "-fschedule-insns2"
+ append_var CXXFLAGS "-fomit-frame-pointer"
+ append_var 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"
+ append_var CXXFLAGS "-fno-delayed-branch"
_backend="dc"
_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)
- DEFINES="$DEFINES -DDISABLE_COMMAND_LINE"
- DEFINES="$DEFINES -DDISABLE_DEFAULT_SAVEFILEMANAGER"
- DEFINES="$DEFINES -DDISABLE_DOSBOX_OPL"
- DEFINES="$DEFINES -DDISABLE_FANCY_THEMES"
- DEFINES="$DEFINES -DDISABLE_SID"
- DEFINES="$DEFINES -DDISABLE_NES_APU"
- DEFINES="$DEFINES -DDISABLE_TEXT_CONSOLE"
- DEFINES="$DEFINES -DREDUCE_MEMORY_USAGE"
- DEFINES="$DEFINES -DSTREAM_AUDIO_FROM_DISK"
- DEFINES="$DEFINES -DVECTOR_RENDERER_FORMAT=1555"
+ append_var DEFINES "-DDISABLE_COMMAND_LINE"
+ append_var DEFINES "-DDISABLE_DEFAULT_SAVEFILEMANAGER"
+ append_var DEFINES "-DDISABLE_DOSBOX_OPL"
+ append_var DEFINES "-DDISABLE_FANCY_THEMES"
+ append_var DEFINES "-DDISABLE_SID"
+ append_var DEFINES "-DDISABLE_NES_APU"
+ append_var DEFINES "-DDISABLE_TEXT_CONSOLE"
+ append_var DEFINES "-DREDUCE_MEMORY_USAGE"
+ append_var DEFINES "-DSTREAM_AUDIO_FROM_DISK"
+ append_var DEFINES "-DVECTOR_RENDERER_FORMAT=1555"
_backend="ds"
_build_scalers=no
_mt32emu=no
@@ -2589,30 +2855,30 @@ if test -n "$_host"; then
add_line_to_config_h "/* #define DEBUG_WII_GDB */"
add_line_to_config_h "#define USE_WII_DI"
;;
- gcw0)
- DEFINES="$DEFINES -DDINGUX -DGCW0"
- DEFINES="$DEFINES -DREDUCE_MEMORY_USAGE"
- ASFLAGS="$ASFLAGS"
- CXXFLAGS="$CXXFLAGS -mips32"
+ 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
+ _sdlconfig=sdl-config
_port_mk="backends/platform/dingux/dingux.mk"
;;
gp2x)
- DEFINES="$DEFINES -DGP2X"
- CXXFLAGS="$CXXFLAGS -march=armv4t"
- ASFLAGS="$ASFLAGS -mfloat-abi=soft"
- LDFLAGS="$LDFLAGS -static"
+ append_var DEFINES "-DGP2X"
+ append_var CXXFLAGS "-march=armv4t"
+ append_var ASFLAGS "-mfloat-abi=soft"
+ append_var LDFLAGS "-static"
_backend="gph"
_build_hq_scalers=no
_savegame_timestamp=no
@@ -2623,10 +2889,10 @@ if test -n "$_host"; then
_port_mk="backends/platform/gph/gp2x-bundle.mk"
;;
gp2xwiz)
- DEFINES="$DEFINES -DGP2XWIZ"
- CXXFLAGS="$CXXFLAGS -mcpu=arm926ej-s"
- CXXFLAGS="$CXXFLAGS -mtune=arm926ej-s"
- ASFLAGS="$ASFLAGS -mfloat-abi=soft"
+ append_var DEFINES "-DGP2XWIZ"
+ append_var CXXFLAGS "-mcpu=arm926ej-s"
+ append_var CXXFLAGS "-mtune=arm926ej-s"
+ append_var ASFLAGS "-mfloat-abi=soft"
_backend="gph"
_build_hq_scalers=no
_savegame_timestamp=no
@@ -2637,28 +2903,35 @@ if test -n "$_host"; then
_port_mk="backends/platform/gph/gp2xwiz-bundle.mk"
;;
iphone)
- DEFINES="$DEFINES -DIPHONE"
- ASFLAGS="$ASFLAGS -arch armv6"
+ append_var DEFINES "-DIPHONE"
+ append_var ASFLAGS "-arch armv6"
_backend="iphone"
_build_scalers=no
_mt32emu=no
_seq_midi=no
_timidity=no
;;
+ ios7)
+ append_var DEFINES "-DIPHONE"
+ _backend="ios7"
+ _build_scalers=no
+ _seq_midi=no
+ _timidity=no
+ ;;
m68k-atari-mint)
- DEFINES="$DEFINES -DSYSTEM_NOT_SUPPORTING_D_TYPE"
+ append_var DEFINES "-DSYSTEM_NOT_SUPPORTING_D_TYPE"
_ranlib=m68k-atari-mint-ranlib
_ar="m68k-atari-mint-ar cru"
_seq_midi=no
;;
maemo)
_optimization_level=-Os
- CXXFLAGS="$CXXFLAGS -mcpu=arm926ej-s"
- CXXFLAGS="$CXXFLAGS -fomit-frame-pointer"
- INCLUDES="$INCLUDES -I/usr/X11R6/include"
- LIBS="$LIBS -lX11"
- LIBS="$LIBS -L/usr/lib"
-
+ append_var CXXFLAGS "-mcpu=arm926ej-s"
+ append_var CXXFLAGS "-fomit-frame-pointer"
+ append_var INCLUDES "-I/usr/X11R6/include"
+ append_var LIBS "-lX11"
+ append_var LIBS "-L/usr/lib"
+
_backend="maemo"
_vkeybd=yes
_keymapper=yes
@@ -2676,12 +2949,12 @@ if test -n "$_host"; then
_ranlib=$_host-ranlib
;;
mips-sgi*)
- LDFLAGS="$LDFLAGS -static-libgcc"
- LIBS="$LIBS -laudio"
+ append_var LDFLAGS "-static-libgcc"
+ append_var LIBS "-laudio"
;;
motoezx)
- DEFINES="$DEFINES -DMOTOEZX"
- ASFLAGS="$ASFLAGS -mfpu=vfp"
+ append_var DEFINES "-DMOTOEZX"
+ append_var ASFLAGS "-mfpu=vfp"
_backend="linuxmoto"
_build_hq_scalers=no
_mt32emu=no
@@ -2690,8 +2963,8 @@ if test -n "$_host"; then
_port_mk="backends/platform/linuxmoto/linuxmoto.mk"
;;
motomagx)
- DEFINES="$DEFINES -DMOTOMAGX"
- ASFLAGS="$ASFLAGS -mfpu=vfp"
+ append_var DEFINES "-DMOTOMAGX"
+ append_var ASFLAGS "-mfpu=vfp"
_backend="linuxmoto"
_build_hq_scalers=no
_mt32emu=no
@@ -2700,20 +2973,20 @@ if test -n "$_host"; then
_port_mk="backends/platform/linuxmoto/linuxmoto.mk"
;;
n64)
- CXXFLAGS="$CXXFLAGS -mno-extern-sdata"
- CXXFLAGS="$CXXFLAGS --param max-inline-insns-auto=20"
- CXXFLAGS="$CXXFLAGS -fomit-frame-pointer"
- CXXFLAGS="$CXXFLAGS -march=vr4300"
- CXXFLAGS="$CXXFLAGS -mtune=vr4300"
- CXXFLAGS="$CXXFLAGS -mhard-float"
- LDFLAGS="$LDFLAGS -march=vr4300"
- LDFLAGS="$LDFLAGS -mtune=vr4300"
- LDFLAGS="$LDFLAGS -nodefaultlibs"
- LDFLAGS="$LDFLAGS -nostartfiles"
- LDFLAGS="$LDFLAGS -mno-crt0"
- LDFLAGS="$LDFLAGS -L$N64SDK/hkz-libn64"
- LDFLAGS="$LDFLAGS -L$N64SDK/lib"
- LDFLAGS="$LDFLAGS -T n64ld_cpp.x -Xlinker -Map -Xlinker scummvm.map"
+ append_var CXXFLAGS "-mno-extern-sdata"
+ append_var CXXFLAGS "--param max-inline-insns-auto=20"
+ append_var CXXFLAGS "-fomit-frame-pointer"
+ append_var CXXFLAGS "-march=vr4300"
+ append_var CXXFLAGS "-mtune=vr4300"
+ append_var CXXFLAGS "-mhard-float"
+ append_var LDFLAGS "-march=vr4300"
+ append_var LDFLAGS "-mtune=vr4300"
+ append_var LDFLAGS "-nodefaultlibs"
+ append_var LDFLAGS "-nostartfiles"
+ append_var LDFLAGS "-mno-crt0"
+ append_var LDFLAGS "-L$N64SDK/hkz-libn64"
+ append_var LDFLAGS "-L$N64SDK/lib"
+ append_var LDFLAGS "-T n64ld_cpp.x -Xlinker -Map -Xlinker scummvm.map"
_backend="n64"
_mt32emu=no
_build_scalers=no
@@ -2731,16 +3004,16 @@ if test -n "$_host"; then
_port_mk="backends/platform/n64/n64.mk"
;;
neuros)
- DEFINES="$DEFINES -DNEUROS"
+ append_var DEFINES "-DNEUROS"
_backend='null'
_build_hq_scalers=no
_mt32emu=no
;;
openpandora)
- DEFINES="$DEFINES -DOPENPANDORA"
- DEFINES="$DEFINES -DREDUCE_MEMORY_USAGE"
+ append_var DEFINES "-DOPENPANDORA"
+ append_var DEFINES "-DREDUCE_MEMORY_USAGE"
if test "$_release_build" = no; then
- DEFINES="$DEFINES -DOP_DEBUG"
+ append_var DEFINES "-DOP_DEBUG"
fi
# Use -O3 on the OpenPandora for optimized builds.
@@ -2749,12 +3022,12 @@ if test -n "$_host"; then
fi
define_in_config_if_yes yes 'USE_ARM_NEON_ASPECT_CORRECTOR'
- CXXFLAGS="$CXXFLAGS -march=armv7-a"
- CXXFLAGS="$CXXFLAGS -mtune=cortex-a8"
- CXXFLAGS="$CXXFLAGS -mfloat-abi=softfp"
- CXXFLAGS="$CXXFLAGS -mfpu=neon"
- CXXFLAGS="$CXXFLAGS -fsingle-precision-constant"
- ASFLAGS="$ASFLAGS -mfloat-abi=softfp"
+ append_var CXXFLAGS "-march=armv7-a"
+ append_var CXXFLAGS "-mtune=cortex-a8"
+ append_var CXXFLAGS "-mfloat-abi=softfp"
+ append_var CXXFLAGS "-mfpu=neon"
+ append_var CXXFLAGS "-fsingle-precision-constant"
+ append_var ASFLAGS "-mfloat-abi=softfp"
_backend="openpandora"
_build_hq_scalers=yes
_vkeybd=no
@@ -2764,11 +3037,11 @@ if test -n "$_host"; then
;;
ppc-amigaos)
# PPC Linker requires this to fix relocation errors
- CXXFLAGS="$CXXFLAGS -mlongcall"
+ append_var CXXFLAGS "-mlongcall"
# Only static builds link successfully on buildbot
LDFLAGS=`echo $LDFLAGS | sed 's/-use-dynld//'`
- LDFLAGS="$LDFLAGS -static"
+ append_var LDFLAGS "-static"
# toolchain binaries prefixed by host
_ranlib=$_host-ranlib
@@ -2780,13 +3053,13 @@ if test -n "$_host"; then
_port_mk="backends/platform/sdl/amigaos/amigaos.mk"
;;
ps2)
- DEFINES="$DEFINES -DDISABLE_TEXT_CONSOLE"
- DEFINES="$DEFINES -DDISABLE_COMMAND_LINE"
- DEFINES="$DEFINES -DDISABLE_DOSBOX_OPL"
- DEFINES="$DEFINES -DDISABLE_SID"
- DEFINES="$DEFINES -DDISABLE_NES_APU"
- CXXFLAGS="$CXXFLAGS -fno-exceptions"
- CXXFLAGS="$CXXFLAGS -fno-rtti"
+ append_var DEFINES "-DDISABLE_TEXT_CONSOLE"
+ append_var DEFINES "-DDISABLE_COMMAND_LINE"
+ append_var DEFINES "-DDISABLE_DOSBOX_OPL"
+ append_var DEFINES "-DDISABLE_SID"
+ append_var DEFINES "-DDISABLE_NES_APU"
+ append_var CXXFLAGS "-fno-exceptions"
+ append_var CXXFLAGS "-fno-rtti"
_backend="ps2"
_build_scalers=no
_mt32emu=no
@@ -2808,15 +3081,15 @@ if test -n "$_host"; then
if test "$_debug_build" = yes; then
# TODO: Setup debug build properly
- DEFINES="$DEFINES -D__PS2_DEBUG__"
- #INCLUDES="$INCLUDES -I$(PS2GDB)/ee"
- #LDFLAGS="$LDFLAGS -L$(PS2GDB)/lib"
- LDFLAGS="$LDFLAGS -lps2gdbStub"
- LDFLAGS="$LDFLAGS -lps2ip"
- LDFLAGS="$LDFLAGS -ldebug"
+ append_var DEFINES "-D__PS2_DEBUG__"
+ #append_var INCLUDES "-I$(PS2GDB)/ee"
+ #append_var LDFLAGS "-L$(PS2GDB)/lib"
+ append_var LDFLAGS "-lps2gdbStub"
+ append_var LDFLAGS "-lps2ip"
+ append_var LDFLAGS "-ldebug"
else
# If not building for debug mode, strip binaries.
- CXXFLAGS="$CXXFLAGS -s"
+ append_var CXXFLAGS "-s"
fi
;;
ps3)
@@ -2833,9 +3106,9 @@ if test -n "$_host"; then
_port_mk="backends/platform/psp/psp.mk"
;;
samsungtv)
- DEFINES="$DEFINES -DSAMSUNGTV"
- DEFINES="$DEFINES -DDISABLE_COMMAND_LINE"
- ASFLAGS="$ASFLAGS -mfpu=vfp"
+ append_var DEFINES "-DSAMSUNGTV"
+ append_var DEFINES "-DDISABLE_COMMAND_LINE"
+ append_var ASFLAGS "-mfpu=vfp"
HOSTEXEEXT=".so"
_backend="samsungtv"
_mt32emu=no
@@ -2851,6 +3124,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"
@@ -2879,7 +3154,7 @@ if test -n "$_host"; then
add_line_to_config_h "#define USE_WII_KBD"
;;
wince)
- LDFLAGS="$LDFLAGS -Wl,--stack,65536"
+ append_var LDFLAGS "-Wl,--stack,65536"
_tremolo=yes
_backend="wince"
_detectlang=yes
@@ -2896,167 +3171,184 @@ fi
# Backend related stuff
#
case $_backend in
+ 3ds)
+ ;;
android)
- DEFINES="$DEFINES -DREDUCE_MEMORY_USAGE"
- CXXFLAGS="$CXXFLAGS -Wa,--noexecstack"
- LDFLAGS="$LDFLAGS -Wl,-z,noexecstack"
- INCLUDES="$INCLUDES -I$ANDROID_NDK/sources/cxx-stl/system/include"
+ 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)
- INCLUDES="$INCLUDES "'-I$(srcdir)/backends/platform/dc'
- INCLUDES="$INCLUDES "'-isystem $(ronindir)/include'
- LDFLAGS="$LDFLAGS -Wl,-Ttext,0x8c010000"
- LDFLAGS="$LDFLAGS -nostartfiles"
- LDFLAGS="$LDFLAGS "'$(ronindir)/lib/crt0.o'
- LDFLAGS="$LDFLAGS "'-L$(ronindir)/lib'
+ append_var INCLUDES '-I$(srcdir)/backends/platform/dc'
+ append_var INCLUDES '-isystem $(ronindir)/include'
+ append_var LDFLAGS "-Wl,-Ttext,0x8c010000"
+ append_var LDFLAGS "-nostartfiles"
+ append_var LDFLAGS '$(ronindir)/lib/crt0.o'
+ append_var LDFLAGS '-L$(ronindir)/lib'
# Enable serial debugging output only when --enable-debug is passed
if test "$_release_build" = yes -o "$_debug_build" != yes; then
- LIBS="$LIBS -lronin-noserial -lm"
+ append_var LIBS "-lronin-noserial -lm"
else
- LIBS="$LIBS -lronin -lm"
+ append_var LIBS "-lronin -lm"
fi
;;
dingux)
- DEFINES="$DEFINES -DDINGUX"
+ append_var DEFINES "-DDINGUX"
;;
ds)
- INCLUDES="$INCLUDES "'-I$(srcdir)/backends/platform/ds/arm9/source'
- INCLUDES="$INCLUDES "'-I$(srcdir)/backends/platform/ds/commoninclude'
- INCLUDES="$INCLUDES "'-Ibackends/platform/ds/arm9/data'
+ append_var INCLUDES '-I$(srcdir)/backends/platform/ds/arm9/source'
+ append_var INCLUDES '-I$(srcdir)/backends/platform/ds/commoninclude'
+ append_var INCLUDES '-Ibackends/platform/ds/arm9/data'
;;
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"
+ append_var DEFINES "-DDISABLE_SAVELOADCHOOSER_GRID"
+ append_var DEFINES "-DGPH_DEVICE"
+ append_var DEFINES "-DREDUCE_MEMORY_USAGE"
if test "$_debug_build" = yes; then
- DEFINES="$DEFINES -DGPH_DEBUG"
+ append_var DEFINES "-DGPH_DEBUG"
fi
;;
iphone)
- LIBS="$LIBS -lobjc -framework UIKit -framework CoreGraphics -framework OpenGLES"
- LIBS="$LIBS -framework QuartzCore -framework CoreFoundation -framework Foundation"
- LIBS="$LIBS -framework AudioToolbox -framework CoreAudio"
+ 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"
+ ;;
+ 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)
- DEFINES="$DEFINES -DLINUXMOTO"
+ append_var DEFINES "-DLINUXMOTO"
;;
maemo)
- DEFINES="$DEFINES -DMAEMO"
+ append_var DEFINES "-DMAEMO"
;;
n64)
- INCLUDES="$INCLUDES "'-I$(N64SDK)/include'
- INCLUDES="$INCLUDES "'-I$(N64SDK)/mips64/include'
- INCLUDES="$INCLUDES "'-I$(N64SDK)/hkz-libn64'
- INCLUDES="$INCLUDES "'-I$(srcdir)/backends/platform/n64'
- LIBS="$LIBS -lpakfs -lframfs -ln64 -ln64utils -lromfs"
- LIBS="$LIBS -lm -lstdc++ -lz"
+ append_var INCLUDES '-I$(N64SDK)/include'
+ append_var INCLUDES '-I$(N64SDK)/mips64/include'
+ append_var INCLUDES '-I$(N64SDK)/hkz-libn64'
+ append_var INCLUDES '-I$(srcdir)/backends/platform/n64'
+ append_var LIBS "-lpakfs -lframfs -ln64 -ln64utils -lromfs"
+ append_var LIBS "-lm -lstdc++ -lz"
;;
null)
- DEFINES="$DEFINES -DUSE_NULL_DRIVER"
+ append_var DEFINES "-DUSE_NULL_DRIVER"
;;
openpandora)
;;
ps2)
- DEFINES="$DEFINES -D_EE"
- DEFINES="$DEFINES -DFORCE_RTL"
- INCLUDES="$INCLUDES -I$PS2SDK/ee/include"
- INCLUDES="$INCLUDES -I$PS2SDK/common/include"
- INCLUDES="$INCLUDES -I$PS2SDK/ports/include"
+ append_var DEFINES "-D_EE"
+ append_var DEFINES "-DFORCE_RTL"
+ append_var INCLUDES "-I$PS2SDK/ee/include"
+ append_var INCLUDES "-I$PS2SDK/common/include"
+ append_var INCLUDES "-I$PS2SDK/ports/include"
if test "$_dynamic_modules" = no ; then
- LDFLAGS="$LDFLAGS -mno-crt0"
- LDFLAGS="$LDFLAGS $PS2SDK/ee/startup/crt0.o"
- LDFLAGS="$LDFLAGS -T $PS2SDK/ee/startup/linkfile"
+ append_var LDFLAGS "-mno-crt0"
+ append_var LDFLAGS "$PS2SDK/ee/startup/crt0.o"
+ append_var LDFLAGS "-T $PS2SDK/ee/startup/linkfile"
fi
- LDFLAGS="$LDFLAGS -L$PS2SDK/ee/lib"
- LDFLAGS="$LDFLAGS -L$PS2SDK/ports/lib"
- LIBS="$LIBS -lmc -lpad -lmouse -lhdd -lpoweroff -lsjpcm"
- LIBS="$LIBS -lm -lc -lfileXio -lkernel -lstdc++"
+ append_var LDFLAGS "-L$PS2SDK/ee/lib"
+ append_var LDFLAGS "-L$PS2SDK/ports/lib"
+ append_var LIBS "-lmc -lpad -lmouse -lhdd -lpoweroff -lsjpcm"
+ append_var LIBS "-lm -lc -lfileXio -lkernel -lstdc++"
;;
psp)
- DEFINES="$DEFINES -D__PSP__"
- DEFINES="$DEFINES -DDISABLE_COMMAND_LINE"
- DEFINES="$DEFINES -DDISABLE_DOSBOX_OPL"
- LIBS="$LIBS -lpng"
- LIBS="$LIBS -Wl,-Map,mapfile.txt"
+ append_var DEFINES "-D__PSP__"
+ append_var DEFINES "-DDISABLE_COMMAND_LINE"
+ append_var DEFINES "-DDISABLE_DOSBOX_OPL"
+ append_var LIBS "-lpng"
+ append_var LIBS "-Wl,-Map,mapfile.txt"
;;
samsungtv)
- DEFINES="$DEFINES -DSAMSUNGTV"
- LDFLAGS="$LDFLAGS -shared"
- LDFLAGS="$LDFLAGS -fpic"
+ append_var DEFINES "-DSAMSUNGTV"
+ append_var LDFLAGS "-shared"
+ append_var LDFLAGS "-fpic"
+ ;;
+ sdl)
;;
tizen)
# dirent.h not available. NONSTANDARD_PORT==ensure portdefs.h is included
- DEFINES="$DEFINES -DTIZEN -DDISABLE_STDIO_FILESTREAM -DNONSTANDARD_PORT"
- DEFINES="$DEFINES -DNO_STDERR_STDOUT"
- DEFINES="$DEFINES -DDISABLE_COMMAND_LINE"
- INCLUDES="$INCLUDES "'-I$(srcdir)/backends/platform/tizen'
- INCLUDES="$INCLUDES "'-I$(TIZEN_ROOTSTRAP)/usr/include'
- INCLUDES="$INCLUDES "'-I$(TIZEN_ROOTSTRAP)/usr/include/osp'
+ append_var DEFINES "-DTIZEN -DDISABLE_STDIO_FILESTREAM -DNONSTANDARD_PORT"
+ append_var DEFINES "-DNO_STDERR_STDOUT"
+ append_var DEFINES "-DDISABLE_COMMAND_LINE"
+ append_var INCLUDES '-I$(srcdir)/backends/platform/tizen'
+ append_var INCLUDES '-I$(TIZEN_ROOTSTRAP)/usr/include'
+ append_var INCLUDES '-I$(TIZEN_ROOTSTRAP)/usr/include/osp'
if test "$_debug_build" = yes; then
- CXXFLAGS="$CXXFLAGS -D_DEBUG -DBUILD_DLL -O0 -g3"
+ append_var CXXFLAGS "-D_DEBUG -DBUILD_DLL -O0 -g3"
fi
# created a shared library for inclusion via the eclipse build
- CXXFLAGS="$CXXFLAGS -Wno-psabi"
- CXXFLAGS="$CXXFLAGS --sysroot=${TIZEN_ROOTSTRAP}"
- CXXFLAGS="$CXXFLAGS -fmessage-length=0"
- CXXFLAGS="$CXXFLAGS -fPIC"
+ append_var CXXFLAGS "-Wno-psabi"
+ append_var CXXFLAGS "--sysroot=${TIZEN_ROOTSTRAP}"
+ append_var CXXFLAGS "-fmessage-length=0"
+ append_var CXXFLAGS "-fPIC"
HOSTEXEPRE=lib
HOSTEXEEXT=.a
;;
webos)
# There is no sdl-config in the WebOS PDK so we don't use find_sdlconfig here.
# The PDL library acts as the WebOS device toolchain, and is required to control the virtual keyboard among other OS-level events.
- LIBS="$LIBS -lSDL -lpdl"
- DEFINES="$DEFINES -DWEBOS"
- DEFINES="$DEFINES -DSDL_BACKEND"
+ append_var LIBS "-lSDL -lpdl"
+ append_var DEFINES "-DWEBOS"
+ append_var DEFINES "-DSDL_BACKEND"
add_line_to_config_mk "SDL_BACKEND = 1"
- MODULES="$MODULES backends/platform/sdl"
+ append_var MODULES "backends/platform/sdl"
;;
wii)
- DEFINES="$DEFINES -D__WII__"
- DEFINES="$DEFINES -DGEKKO"
+ append_var DEFINES "-D__WII__"
+ append_var DEFINES "-DGEKKO"
case $_host_os in
gamecube)
- LIBS="$LIBS -lgxflux -liso9660 -lfat -logc -ldb"
+ append_var LIBS "-lgxflux -liso9660 -lfat -logc -ldb"
;;
*)
- LIBS="$LIBS -lgxflux -ldi -liso9660 -ltinysmb -lfat -lwiiuse -lbte -logc -lwiikeyboard -ldb"
+ append_var LIBS "-lgxflux -ldi -liso9660 -ltinysmb -lfat -lwiiuse -lbte -logc -lwiikeyboard -ldb"
;;
esac
;;
wince)
- INCLUDES="$INCLUDES "'-I$(srcdir)/backends/platform/wince'
- INCLUDES="$INCLUDES "'-I$(srcdir)/backends/platform/wince/CEgui'
- INCLUDES="$INCLUDES "'-I$(srcdir)/backends/platform/wince/CEkeys'
- LIBS="$LIBS -static -lSDL"
- DEFINES="$DEFINES -DSDL_BACKEND"
+ append_var INCLUDES '-I$(srcdir)/backends/platform/wince'
+ append_var INCLUDES '-I$(srcdir)/backends/platform/wince/CEgui'
+ append_var INCLUDES '-I$(srcdir)/backends/platform/wince/CEkeys'
+ append_var LIBS "-static -lSDL"
+ 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
;;
esac
-MODULES="$MODULES backends/platform/$_backend"
+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
- INCLUDES="$INCLUDES `$_sdlconfig --prefix="$_sdlpath" --cflags`"
- LIBS="$LIBS `$_sdlconfig --prefix="$_sdlpath" --libs`"
- DEFINES="$DEFINES -DSDL_BACKEND"
+ append_var INCLUDES "`$_sdlconfig --prefix="$_sdlpath" --cflags`"
+ append_var LIBS "`$_sdlconfig --prefix="$_sdlpath" --libs`"
+ append_var DEFINES "-DSDL_BACKEND"
add_line_to_config_mk "SDL_BACKEND = 1"
_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"
;;
*)
;;
@@ -3069,7 +3361,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
@@ -3082,6 +3374,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
@@ -3115,7 +3427,6 @@ case $_backend in
;;
esac
-
#
# Determine whether host is POSIX compliant, or at least POSIX
# compatible enough to support our POSIX code (including dlsym(),
@@ -3129,7 +3440,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*)
@@ -3147,7 +3458,7 @@ esac
echo $_posix
if test "$_posix" = yes ; then
- DEFINES="$DEFINES -DPOSIX"
+ append_var DEFINES "-DPOSIX"
add_line_to_config_mk 'POSIX = 1'
fi
@@ -3177,8 +3488,8 @@ fi
if test "$_optimizations" = yes ; then
# Enable optimizations. This also
# makes it possible to use -Wuninitialized, so let's do that.
- CXXFLAGS="$CXXFLAGS $_optimization_level"
- CXXFLAGS="$CXXFLAGS -Wuninitialized"
+ append_var CXXFLAGS "$_optimization_level"
+ append_var CXXFLAGS "-Wuninitialized"
fi
#
@@ -3194,8 +3505,8 @@ if test "$_dynamic_modules" = yes ; then
android)
_plugin_prefix="lib"
_plugin_suffix=".so"
- CXXFLAGS="$CXXFLAGS -fpic"
- LIBS="$LIBS -ldl"
+ append_var CXXFLAGS "-fpic"
+ append_var LIBS "-ldl"
# Work around an Android 2.0+ run-time linker bug:
# The linker doesn't actually look in previously
# loaded libraries when trying to resolve symbols -
@@ -3214,7 +3525,7 @@ POST_OBJS_FLAGS := -Wl,-no-whole-archive
darwin*)
_plugin_prefix=""
_plugin_suffix=".plugin"
- LIBS="$LIBS -ldl"
+ append_var LIBS "-ldl"
_mak_plugins='
PLUGIN_EXTRA_DEPS = $(EXECUTABLE)
PLUGIN_LDFLAGS += -bundle -bundle_loader $(EXECUTABLE) -exported_symbols_list "$(srcdir)/plugin.exp"
@@ -3234,9 +3545,9 @@ POST_OBJS_FLAGS := -Wl,--no-whole-archive
;;
ds)
_elf_loader=yes
- DEFINES="$DEFINES -DELF_LOADER_CXA_ATEXIT"
- DEFINES="$DEFINES -DUNCACHED_PLUGINS"
- DEFINES="$DEFINES -DELF_NO_MEM_MANAGER"
+ append_var DEFINES "-DELF_LOADER_CXA_ATEXIT"
+ append_var DEFINES "-DUNCACHED_PLUGINS"
+ append_var DEFINES "-DELF_NO_MEM_MANAGER"
_mak_plugins='
PLUGIN_LDFLAGS += -Wl,-T$(srcdir)/backends/plugins/ds/plugin.ld -mthumb-interwork -mno-fpu
'
@@ -3244,7 +3555,7 @@ PLUGIN_LDFLAGS += -Wl,-T$(srcdir)/backends/plugins/ds/plugin.ld -mthumb-interwo
freebsd*)
_plugin_prefix="lib"
_plugin_suffix=".so"
- CXXFLAGS="$CXXFLAGS -fPIC"
+ append_var CXXFLAGS "-fPIC"
_mak_plugins='
PLUGIN_EXTRA_DEPS =
PLUGIN_LDFLAGS += -shared
@@ -3254,8 +3565,8 @@ POST_OBJS_FLAGS := -Wl,-no-whole-archive
;;
gamecube | wii)
_elf_loader=yes
- DEFINES="$DEFINES -DELF_LOADER_CXA_ATEXIT"
- DEFINES="$DEFINES -DUNCACHED_PLUGINS"
+ append_var DEFINES "-DELF_LOADER_CXA_ATEXIT"
+ append_var DEFINES "-DUNCACHED_PLUGINS"
_mak_plugins='
PLUGIN_LDFLAGS += -Wl,-T$(srcdir)/backends/plugins/wii/plugin.ld
'
@@ -3263,8 +3574,8 @@ PLUGIN_LDFLAGS += -Wl,-T$(srcdir)/backends/plugins/wii/plugin.ld
gph*)
_plugin_prefix=""
_plugin_suffix=".plugin"
- CXXFLAGS="$CXXFLAGS -fpic"
- LIBS="$LIBS -ldl"
+ append_var CXXFLAGS "-fpic"
+ append_var LIBS "-ldl"
_mak_plugins='
PLUGIN_EXTRA_DEPS = $(EXECUTABLE)
PLUGIN_LDFLAGS += -shared
@@ -3275,8 +3586,8 @@ POST_OBJS_FLAGS := -Wl,-no-whole-archive
irix*)
_plugin_prefix="lib"
_plugin_suffix=".so"
- CXXFLAGS="$CXXFLAGS -fpic"
- LIBS="$LIBS -ldl"
+ append_var CXXFLAGS "-fpic"
+ append_var LIBS "-ldl"
_mak_plugins='
PLUGIN_EXTRA_DEPS =
PLUGIN_LDFLAGS += -shared -static-libgcc
@@ -3288,8 +3599,8 @@ POST_OBJS_FLAGS := -Wl,-no-whole-archive
linux* | gnu* | k*bsd*-gnu*)
_plugin_prefix="lib"
_plugin_suffix=".so"
- CXXFLAGS="$CXXFLAGS -fPIC"
- LIBS="$LIBS -ldl"
+ append_var CXXFLAGS "-fPIC"
+ append_var LIBS "-ldl"
_mak_plugins='
PLUGIN_EXTRA_DEPS =
PLUGIN_LDFLAGS += -shared
@@ -3308,7 +3619,7 @@ POST_OBJS_FLAGS := -Wl,--export-all-symbols -Wl,--no-whole-archive -Wl,--out-im
'
;;
wince)
- DEFINES="$DEFINES -DUNCACHED_PLUGINS"
+ append_var DEFINES "-DUNCACHED_PLUGINS"
HOSTEXEEXT=".dll"
_plugin_prefix=""
_plugin_suffix=".plugin"
@@ -3321,7 +3632,7 @@ POST_OBJS_FLAGS := -Wl,--export-all-symbols -Wl,--no-whole-archive -Wl,--out-im
;;
ps2)
_elf_loader=yes
- DEFINES="$DEFINES -DUNCACHED_PLUGINS"
+ append_var 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
@@ -3329,7 +3640,7 @@ PLUGIN_LDFLAGS += -mno-crt0 $(PS2SDK)/ee/startup/crt0.o -Wl,-T$(srcdir)/backend
;;
psp)
_elf_loader=yes
- DEFINES="$DEFINES -DUNCACHED_PLUGINS"
+ append_var DEFINES "-DUNCACHED_PLUGINS"
_mak_plugins='
LDFLAGS += -Wl,-T$(srcdir)/backends/plugins/psp/main_prog.ld
PLUGIN_LDFLAGS += -Wl,-T$(srcdir)/backends/plugins/psp/plugin.ld -lstdc++ -lc
@@ -3338,8 +3649,8 @@ PLUGIN_LDFLAGS += -Wl,-T$(srcdir)/backends/plugins/psp/plugin.ld -lstdc++ -lc
webos)
_plugin_prefix="lib"
_plugin_suffix=".so"
- CXXFLAGS="$CXXFLAGS -fpic"
- LIBS="$LIBS -ldl"
+ append_var CXXFLAGS "-fpic"
+ append_var LIBS "-ldl"
_mak_plugins='
PLUGIN_EXTRA_DEPS =
PLUGIN_LDFLAGS += -shared $(LDFLAGS)
@@ -3395,6 +3706,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'
@@ -3415,7 +3731,7 @@ define_in_config_if_yes "$_build_hq_scalers" 'USE_HQ_SCALERS'
cat > $TMPC << EOF
int main(void) { return 0; }
EOF
-cc_check -lm && LIBS="$LIBS -lm"
+cc_check -lm && append_var LIBS "-lm"
#
# Check for Ogg Vorbis
@@ -3431,8 +3747,8 @@ EOF
-lvorbisfile -lvorbis -logg && _vorbis=yes
fi
if test "$_vorbis" = yes ; then
- LIBS="$LIBS $OGG_LIBS $VORBIS_LIBS -lvorbisfile -lvorbis -logg"
- INCLUDES="$INCLUDES $OGG_CFLAGS $VORBIS_CFLAGS"
+ append_var LIBS "$OGG_LIBS $VORBIS_LIBS -lvorbisfile -lvorbis -logg"
+ append_var INCLUDES "$OGG_CFLAGS $VORBIS_CFLAGS"
fi
define_in_config_if_yes "$_vorbis" 'USE_VORBIS'
echo "$_vorbis"
@@ -3459,13 +3775,13 @@ if test "$_tremor" = yes && test "$_vorbis" = no; then
add_line_to_config_h '#define USE_VORBIS'
if test "$_tremolo" = yes ; then
add_line_to_config_h '#define USE_TREMOLO'
- LIBS="$LIBS $TREMOR_LIBS -ltremolo"
+ append_var LIBS "$TREMOR_LIBS -ltremolo"
elif test "$_host" = ps2 ; then
LIBS="-ltremor $LIBS"
else
- LIBS="$LIBS $TREMOR_LIBS -lvorbisidec"
+ append_var LIBS "$TREMOR_LIBS -lvorbisidec"
fi
- INCLUDES="$INCLUDES $TREMOR_CFLAGS"
+ append_var INCLUDES "$TREMOR_CFLAGS"
else
if test "$_vorbis" = yes; then
_tremor="no (Ogg Vorbis/Tremor support is mutually exclusive)"
@@ -3495,11 +3811,11 @@ EOF
fi
if test "$_flac" = yes ; then
if test "$_vorbis" = yes ; then
- LIBS="$LIBS $FLAC_LIBS $OGG_LIBS -lFLAC -logg"
+ append_var LIBS "$FLAC_LIBS $OGG_LIBS -lFLAC -logg"
else
- LIBS="$LIBS $FLAC_LIBS -lFLAC"
+ append_var LIBS "$FLAC_LIBS -lFLAC"
fi
- INCLUDES="$INCLUDES $FLAC_CFLAGS"
+ append_var INCLUDES "$FLAC_CFLAGS"
fi
define_in_config_if_yes "$_flac" 'USE_FLAC'
echo "$_flac"
@@ -3517,8 +3833,8 @@ EOF
cc_check $MAD_CFLAGS $MAD_LIBS -lmad && _mad=yes
fi
if test "$_mad" = yes ; then
- LIBS="$LIBS $MAD_LIBS -lmad"
- INCLUDES="$INCLUDES $MAD_CFLAGS"
+ append_var LIBS "$MAD_LIBS -lmad"
+ append_var INCLUDES "$MAD_CFLAGS"
fi
define_in_config_if_yes "$_mad" 'USE_MAD'
echo "$_mad"
@@ -3536,10 +3852,10 @@ EOF
cc_check $ALSA_CFLAGS $ALSA_LIBS -lasound && _alsa=yes
fi
if test "$_alsa" = yes ; then
- LIBS="$LIBS $ALSA_LIBS -lasound"
- INCLUDES="$INCLUDES $ALSA_CFLAGS"
+ append_var LIBS "$ALSA_LIBS -lasound"
+ append_var INCLUDES "$ALSA_CFLAGS"
fi
-define_in_config_h_if_yes "$_alsa" 'USE_ALSA'
+define_in_config_if_yes "$_alsa" 'USE_ALSA'
echo "$_alsa"
#
@@ -3562,8 +3878,8 @@ EOF
cc_check $JPEG_CFLAGS $JPEG_LIBS -ljpeg && _jpeg=yes
fi
if test "$_jpeg" = yes ; then
- LIBS="$LIBS $JPEG_LIBS -ljpeg"
- INCLUDES="$INCLUDES $JPEG_CFLAGS"
+ append_var LIBS "$JPEG_LIBS -ljpeg"
+ append_var INCLUDES "$JPEG_CFLAGS"
fi
define_in_config_if_yes "$_jpeg" 'USE_JPEG'
echo "$_jpeg"
@@ -3587,8 +3903,8 @@ EOF
cc_check $PNG_CFLAGS $PNG_LIBS -lpng -lz && _png=yes
fi
if test "$_png" = yes ; then
- LIBS="$LIBS $PNG_LIBS -lpng -lz"
- INCLUDES="$INCLUDES $PNG_CFLAGS"
+ append_var LIBS "$PNG_LIBS -lpng -lz"
+ append_var INCLUDES "$PNG_CFLAGS"
fi
define_in_config_if_yes "$_png" 'USE_PNG'
echo "$_png"
@@ -3611,8 +3927,8 @@ EOF
cc_check $THEORADEC_CFLAGS $THEORADEC_LIBS -ltheoradec && _theoradec=yes
fi
if test "$_theoradec" = yes ; then
- LIBS="$LIBS $THEORADEC_LIBS -ltheoradec"
- INCLUDES="$INCLUDES $THEORADEC_CFLAGS"
+ append_var LIBS "$THEORADEC_LIBS -ltheoradec"
+ append_var INCLUDES "$THEORADEC_CFLAGS"
fi
define_in_config_if_yes "$_theoradec" 'USE_THEORADEC'
if test ! "$_theoradec" = notsupported ; then
@@ -3632,8 +3948,8 @@ EOF
cc_check $FAAD_CFLAGS $FAAD_LIBS -lfaad && _faad=yes
fi
if test "$_faad" = yes ; then
- LIBS="$LIBS $FAAD_LIBS -lfaad"
- INCLUDES="$INCLUDES $FAAD_CFLAGS"
+ append_var LIBS "$FAAD_LIBS -lfaad"
+ append_var INCLUDES "$FAAD_CFLAGS"
fi
define_in_config_if_yes "$_faad" 'USE_FAAD'
echo "$_faad"
@@ -3664,8 +3980,8 @@ EOF
cc_check $SNDIO_CFLAGS $SNDIO_LIBS -lsndio && _sndio=yes
fi
if test "$_sndio" = yes ; then
- LIBS="$LIBS $SNDIO_LIBS -lsndio"
- INCLUDES="$INCLUDES $SNDIO_CFLAGS"
+ append_var LIBS "$SNDIO_LIBS -lsndio"
+ append_var INCLUDES "$SNDIO_CFLAGS"
fi
define_in_config_h_if_yes "$_sndio" 'USE_SNDIO'
echo "$_sndio"
@@ -3697,8 +4013,8 @@ EOF
cc_check $ZLIB_CFLAGS $ZLIB_LIBS -lz && _zlib=yes
fi
if test "$_zlib" = yes ; then
- LIBS="$LIBS $ZLIB_LIBS -lz"
- INCLUDES="$INCLUDES $ZLIB_CFLAGS"
+ append_var LIBS "$ZLIB_LIBS -lz"
+ append_var INCLUDES "$ZLIB_CFLAGS"
fi
define_in_config_if_yes "$_zlib" 'USE_ZLIB'
echo "$_zlib"
@@ -3743,8 +4059,8 @@ EOF
fi
fi
if test "$_mpeg2" = yes ; then
- INCLUDES="$INCLUDES $MPEG2_CFLAGS"
- LIBS="$LIBS $MPEG2_LIBS -lmpeg2"
+ append_var INCLUDES "$MPEG2_CFLAGS"
+ append_var LIBS "$MPEG2_LIBS -lmpeg2"
fi
define_in_config_if_yes "$_mpeg2" 'USE_MPEG2'
echo "$_mpeg2"
@@ -3752,49 +4068,235 @@ 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
+ 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 SDL_Net
+#
+echocheck "SDL_Net"
+if test "$_sdlnet" = auto ; then
+ _sdlnet=no
+ cat > $TMPC << EOF
+#include "SDL/SDL_net.h"
+int main(int argc, char *argv[]) { SDLNet_Init(); return 0; }
+EOF
+ cc_check $LIBS $INCLUDES $SDL_NET_CFLAGS $SDL_NET_LIBS -lSDL_net && _sdlnet=yes
fi
-if test "$_sparkle" = yes ; then
- LIBS="$LIBS $SPARKLE_LIBS -framework Sparkle"
- INCLUDES="$INCLUDES $SPARKLE_CFLAGS"
+if test "$_sdlnet" = yes ; then
+ append_var LIBS "$SDL_NET_LIBS -lSDL_net"
+ append_var INCLUDES "$SDL_NET_CFLAGS"
fi
-define_in_config_if_yes "$_sparkle" 'USE_SPARKLE'
+define_in_config_if_yes "$_sdlnet" 'USE_SDL_NET'
+echo "$_sdlnet"
+
+#
+# Check for libcurl to be present
+#
+if test "$_libcurl" != "no"; then
+
+ # Look for the curl-config script
+ find_libcurlconfig
+
+ if test -z "$_libcurlconfig"; then
+ _libcurl=no
+ else
+ LIBCURL_LIBS=`$_libcurlconfig --libs`
+ LIBCURL_CFLAGS=`$_libcurlconfig --cflags`
+
+ if test "$_libcurl" = "auto"; then
+ _libcurl=no
+
+ cat > $TMPC << EOF
+ #include <curl/curl.h>
+ int main(int argc, char *argv[]) {
+ int x;
+ curl_easy_setopt(NULL,CURLOPT_URL,NULL);
+ x=CURL_ERROR_SIZE;
+ x=CURLOPT_WRITEFUNCTION;
+ x=CURLOPT_WRITEDATA;
+ x=CURLOPT_ERRORBUFFER;
+ x=CURLOPT_STDERR;
+ x=CURLOPT_VERBOSE;
+
+ curl_version_info_data *data = curl_version_info(CURLVERSION_NOW);
+ if (data->features & CURL_VERSION_SSL)
+ return 0;
+ return 1;
+ }
+EOF
+
+ cc_check_no_clean $LIBCURL_CFLAGS $LIBCURL_LIBS
+ if test "$?" -eq 0; then
+ $TMPO$HOSTEXEEXT
+ if test "$?" -eq 0; then
+ _libcurl=yes
+ else
+ _libcurl="no SSL support"
+ fi
+ fi
+ cc_check_clean
+ fi
+
+ if test "$_libcurl" = "yes"; then
+ append_var LIBS "$LIBCURL_LIBS"
+ append_var INCLUDES "$LIBCURL_CFLAGS"
+ fi
+ fi
+
fi
-echo "$_sparkle"
+
+echocheck "libcurl"
+echo "$_libcurl"
+
+define_in_config_if_yes "$_libcurl" "USE_LIBCURL"
+
+#
+# Check whether to build cloud integration support
+#
+echo_n "Cloud integration..."
+if test "$_cloud" = "no"; then
+ echo "no"
+else
+ _cloud=no
+ if test "$_sdlnet" = "yes"; then
+ _cloud=yes
+ echo_n "local"
+ fi
+ if test "$_libcurl" = "yes"; then
+ if test "$_cloud" = "yes"; then echo_n ", "; fi
+ _cloud=yes
+ echo_n "servers"
+ fi
+ if test "$_cloud" = "no"; then
+ echo_n "no"
+ fi
+ echo # newline
+fi
+define_in_config_if_yes $_cloud 'USE_CLOUD'
#
-# 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*)
- LIBS="$LIBS $FLUIDSYNTH_LIBS -lfluidsynth -ldsound -lwinmm"
- ;;
- *)
- LIBS="$LIBS $FLUIDSYNTH_LIBS -lfluidsynth"
- ;;
- esac
- INCLUDES="$INCLUDES $FLUIDSYNTH_CFLAGS"
+if test "$_fluidsynth" = yes; then
+ append_var LIBS "$FLUIDSYNTH_LIBS"
+ append_var INCLUDES "$FLUIDSYNTH_CFLAGS"
fi
define_in_config_if_yes "$_fluidsynth" 'USE_FLUIDSYNTH'
echo "$_fluidsynth"
@@ -3830,8 +4332,8 @@ else
fi
if test "$_readline" = yes ; then
- LIBS="$LIBS $READLINE_LIBS $_READLINE_LIBS"
- INCLUDES="$INCLUDES $READLINE_CFLAGS"
+ append_var LIBS "$READLINE_LIBS $_READLINE_LIBS"
+ append_var INCLUDES "$READLINE_CFLAGS"
#
# Check the type of rl_completion_entry_function.
@@ -3890,8 +4392,8 @@ if test "$_libunity" = yes ; then
LIBUNITY_LIBS="$LIBUNITY_LIBS `pkg-config --libs 'unity > 3.8.1' 2>> "$TMPLOG"`"
LIBUNITY_CFLAGS="$LIBUNITY_CFLAGS `pkg-config --cflags 'unity > 3.8.1' 2>> "$TMPLOG"`"
fi
- LIBS="$LIBS $LIBUNITY_LIBS"
- INCLUDES="$INCLUDES $LIBUNITY_CFLAGS"
+ append_var LIBS "$LIBUNITY_LIBS"
+ append_var INCLUDES "$LIBUNITY_CFLAGS"
fi
define_in_config_h_if_yes "$_libunity" 'USE_UNITY'
fi
@@ -3925,12 +4427,20 @@ 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
- LIBS="$LIBS $FREETYPE2_LIBS"
- INCLUDES="$INCLUDES $FREETYPE2_CFLAGS"
+ append_var LIBS "$FREETYPE2_LIBS"
+ append_var INCLUDES "$FREETYPE2_CFLAGS"
fi
fi
@@ -3948,106 +4458,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"
- LIBS="$LIBS $OPENGL_LIBS"
- INCLUDES="$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
- LIBS="$LIBS $OPENGL_LIBS"
- INCLUDES="$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
#
@@ -4089,16 +4607,16 @@ if test "$_have_x86" = yes ; then
else
case $_host_os in
darwin*)
- NASMFLAGS="$NASMFLAGS -f macho"
+ append_var NASMFLAGS "-f macho"
;;
mingw*)
- NASMFLAGS="$NASMFLAGS -f win32"
+ append_var NASMFLAGS "-f win32"
;;
os2-emx*)
- NASMFLAGS="$NASMFLAGS -f aout"
+ append_var NASMFLAGS "-f aout"
;;
*)
- NASMFLAGS="$NASMFLAGS -f elf"
+ append_var NASMFLAGS "-f elf"
;;
esac
_nasm=yes
@@ -4160,7 +4678,7 @@ if test "$_taskbar" = "no"; then
else
case $_host_os in
mingw*)
- LIBS="$LIBS -lole32 -luuid"
+ append_var LIBS "-lole32 -luuid"
echo "win32"
_taskbar=yes
;;
@@ -4214,26 +4732,26 @@ case $_host_os in
# Windows stores all the external data files in executable file.
;;
*)
- DEFINES="$DEFINES -DDATA_PATH=\\\"$datadir\\\""
+ append_var DEFINES "-DDATA_PATH=\\\"$datadir\\\""
;;
esac
case $_backend in
openpandora)
# Add ../plugins as a path so plugins can be found when running from a .PND.
- DEFINES="$DEFINES -DPLUGIN_DIRECTORY=\\\"../plugins\\\""
+ append_var DEFINES "-DPLUGIN_DIRECTORY=\\\"../plugins\\\""
;;
maemo | webos)
# The WebOS and Maemo apps want the plugins in the "lib" directory
# without a scummvm sub directory.
- DEFINES="$DEFINES -DPLUGIN_DIRECTORY=\\\"$libdir\\\""
+ append_var DEFINES "-DPLUGIN_DIRECTORY=\\\"$libdir\\\""
;;
ps2)
# PS2 bogus dir: it actually depends on launch medium
- DEFINES="$DEFINES -DPLUGIN_DIRECTORY=\\\"host:plugins\\\""
+ append_var DEFINES "-DPLUGIN_DIRECTORY=\\\"host:plugins\\\""
;;
*)
- DEFINES="$DEFINES -DPLUGIN_DIRECTORY=\\\"$libdir/scummvm\\\""
+ append_var DEFINES "-DPLUGIN_DIRECTORY=\\\"$libdir/scummvm\\\""
;;
esac
@@ -4242,9 +4760,9 @@ esac
# We need to do it here to prevent mess-ups with the tests e.g. on the PSP
#
if test "$_enable_prof" = yes ; then
- CXXFLAGS="$CXXFLAGS -pg"
- LDFLAGS="$LDFLAGS -pg"
- DEFINES="$DEFINES -DENABLE_PROFILING"
+ append_var CXXFLAGS "-pg"
+ append_var LDFLAGS "-pg"
+ append_var DEFINES "-DENABLE_PROFILING"
fi
echo_n "Backend... "
@@ -4262,6 +4780,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
@@ -4275,7 +4797,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
@@ -4291,7 +4813,11 @@ if test "$_keymapper" = yes ; then
fi
if test "$_eventrec" = yes ; then
- echo ", event recorder"
+ echo_n ", event recorder"
+fi
+
+if test "$_cloud" = yes ; then
+ echo ", cloud"
else
echo
fi
@@ -4301,12 +4827,20 @@ 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
- CXXFLAGS="$CXXFLAGS -fstack-protector"
+ append_var CXXFLAGS "-fstack-protector"
else
- CXXFLAGS="$CXXFLAGS -fno-stack-protector"
+ append_var CXXFLAGS "-fno-stack-protector"
fi
static_libs=''
@@ -4330,7 +4864,7 @@ case $_backend in
n64)
# Move some libs down here, otherwise some symbols requires by libvorbis aren't found
# during linking stage
- LIBS="$LIBS -lc -lgcc -lnosys"
+ append_var LIBS "-lc -lgcc -lnosys"
;;
esac
@@ -4532,6 +5066,11 @@ STAGINGPATH=$_stagingpath
WIN32PATH=$_win32path
AMIGAOSPATH=$_amigaospath
STATICLIBPATH=$_staticlibpath
+XCODETOOLSPATH=$_xcodetoolspath
+SPARKLEPATH=$_sparklepath
+SDLCONFIG=$_sdlconfig
+
+ABI := $ABI
BACKEND := $_backend
MODULES += $MODULES
@@ -4568,6 +5107,7 @@ SAVED_CXXFLAGS := $SAVED_CXXFLAGS
SAVED_CPPFLAGS := $SAVED_CPPFLAGS
SAVED_ASFLAGS := $SAVED_ASFLAGS
SAVED_WINDRESFLAGS := $SAVED_WINDRESFLAGS
+SAVED_SDL_CONFIG := $SAVED_SDL_CONFIG
EOF
#