2002-08-24 14:18:40 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2008-05-14 11:58:25 +00:00
|
|
|
# configure -- custom configure script for ScummVM.
|
2002-08-24 14:18:40 +00:00
|
|
|
#
|
2008-01-13 13:24:47 +00:00
|
|
|
# ScummVM is the legal property of its developers, whose names
|
|
|
|
# are too numerous to list here. Please refer to the COPYRIGHT
|
|
|
|
# file distributed with this source distribution.
|
|
|
|
#
|
2021-12-26 17:47:58 +00:00
|
|
|
# This program is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
2008-01-13 13:24:47 +00:00
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
2021-12-26 17:47:58 +00:00
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2008-01-13 13:24:47 +00:00
|
|
|
#
|
2002-08-24 14:18:40 +00:00
|
|
|
|
2021-03-29 15:09:42 +00:00
|
|
|
set -a
|
|
|
|
|
2013-02-01 18:31:15 +00:00
|
|
|
# NLS nuisances.
|
|
|
|
LC_ALL=C
|
|
|
|
LANGUAGE=C
|
|
|
|
|
2007-11-06 17:23:33 +00:00
|
|
|
# Save the current environment variables for next runs
|
|
|
|
SAVED_CONFIGFLAGS=$@
|
2017-10-20 16:47:43 +00:00
|
|
|
SAVED_AR=$AR
|
|
|
|
SAVED_AS=$AS
|
|
|
|
SAVED_ASFLAGS=$ASFLAGS
|
|
|
|
SAVED_CPPFLAGS=$CPPFLAGS
|
2007-11-06 17:23:33 +00:00
|
|
|
SAVED_CXX=$CXX
|
|
|
|
SAVED_CXXFLAGS=$CXXFLAGS
|
2017-11-01 22:15:35 +00:00
|
|
|
SAVED_DWP=$DWP
|
2017-10-20 16:47:43 +00:00
|
|
|
SAVED_LD=$LD
|
|
|
|
SAVED_LDFLAGS=$LDFLAGS
|
2018-11-16 17:21:57 +00:00
|
|
|
SAVED_PKG_CONFIG_LIBDIR=${PKG_CONFIG_LIBDIR:-unset}
|
2017-10-20 16:47:43 +00:00
|
|
|
SAVED_RANLIB=$RANLIB
|
2015-01-25 17:41:57 +00:00
|
|
|
SAVED_SDL_CONFIG=$SDL_CONFIG
|
2017-10-20 16:47:43 +00:00
|
|
|
SAVED_STRIP=$STRIP
|
|
|
|
SAVED_WINDRES=$WINDRES
|
|
|
|
SAVED_WINDRESFLAGS=$WINDRESFLAGS
|
2002-08-24 15:24:38 +00:00
|
|
|
|
2009-03-22 11:24:23 +00:00
|
|
|
# Use environment vars if set
|
2003-08-09 23:52:05 +00:00
|
|
|
CXXFLAGS="$CXXFLAGS $CPPFLAGS"
|
2022-05-22 22:54:32 +00:00
|
|
|
PLUGIN_LDFLAGS=$LDFLAGS
|
2003-08-09 23:52:05 +00:00
|
|
|
|
2005-10-11 11:27:18 +00:00
|
|
|
# Backslashes into forward slashes:
|
|
|
|
# The following OS/2 specific code is performed to deal with handling of backslashes by ksh.
|
|
|
|
# Borrowed from the Sane configure script
|
|
|
|
|
|
|
|
if test "$ac_emxsupport" != "no" -a "$ac_emxsupport" != "NO"; then
|
2007-11-01 21:03:16 +00:00
|
|
|
ac_save_IFS="$IFS"
|
|
|
|
IFS="\\"
|
|
|
|
ac_TEMP_PATH=
|
|
|
|
for ac_dir in $PATH; do
|
|
|
|
IFS=$ac_save_IFS
|
|
|
|
if test -z "$ac_TEMP_PATH"; then
|
|
|
|
ac_TEMP_PATH="$ac_dir"
|
|
|
|
else
|
|
|
|
ac_TEMP_PATH="$ac_TEMP_PATH/$ac_dir"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
PATH="$ac_TEMP_PATH"
|
|
|
|
unset ac_TEMP_PATH
|
2005-10-11 11:27:18 +00:00
|
|
|
fi
|
|
|
|
|
2009-08-31 01:24:04 +00:00
|
|
|
set_var() {
|
|
|
|
eval ${1}='${2}'
|
|
|
|
}
|
|
|
|
|
|
|
|
get_var() {
|
|
|
|
eval echo \$${1}
|
|
|
|
}
|
2005-10-11 11:27:18 +00:00
|
|
|
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var() {
|
2016-09-10 20:43:06 +00:00
|
|
|
VAR=${1}
|
|
|
|
shift
|
|
|
|
if eval test -z \"\$${VAR}\" ; then
|
|
|
|
eval ${VAR}='$@'
|
|
|
|
else
|
|
|
|
eval ${VAR}=\"\$${VAR} \"'$@'
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
prepend_var() {
|
|
|
|
VAR=${1}
|
|
|
|
shift
|
|
|
|
if eval test -z \"\$${VAR}\" ; then
|
|
|
|
eval ${VAR}='$@'
|
|
|
|
else
|
2016-09-10 21:33:45 +00:00
|
|
|
eval ${VAR}='$@'\" \$${VAR}\"
|
2016-09-10 20:43:06 +00:00
|
|
|
fi
|
2015-07-22 12:32:03 +00:00
|
|
|
}
|
|
|
|
|
2012-09-13 12:25:24 +00:00
|
|
|
# Add an engine: id name build subengines base-games dependencies
|
2007-11-04 06:55:45 +00:00
|
|
|
add_engine() {
|
|
|
|
_engines="${_engines} ${1}"
|
2011-06-18 06:26:55 +00:00
|
|
|
if test "${3}" = "no" ; then
|
2011-04-19 03:06:15 +00:00
|
|
|
set_var _wip_engines "${_wip_engines} ${1}"
|
|
|
|
fi
|
2009-08-31 01:24:04 +00:00
|
|
|
set_var _engine_${1}_name "${2}"
|
|
|
|
set_var _engine_${1}_build "${3}"
|
2011-04-19 03:06:15 +00:00
|
|
|
set_var _engine_${1}_build_default "${3}"
|
2009-08-31 01:24:04 +00:00
|
|
|
set_var _engine_${1}_subengines "${4}"
|
2012-09-11 18:26:06 +00:00
|
|
|
set_var _engine_${1}_base "${5}"
|
|
|
|
set_var _engine_${1}_deps "${6}"
|
2007-11-04 06:55:45 +00:00
|
|
|
for sub in ${4}; do
|
2009-08-31 01:24:04 +00:00
|
|
|
set_var _engine_${sub}_sub "yes"
|
2012-09-11 16:39:03 +00:00
|
|
|
set_var _engine_${sub}_parent "${1}"
|
2007-11-04 06:55:45 +00:00
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2012-09-04 18:26:08 +00:00
|
|
|
# Add a feature: id name settings-list
|
|
|
|
add_feature() {
|
|
|
|
set_var _feature_${1}_name "${2}"
|
|
|
|
# This is a list of settings, where one must be "yes" for the feature to
|
|
|
|
# be enabled
|
|
|
|
set_var _feature_${1}_settings "${3}"
|
|
|
|
}
|
|
|
|
|
2012-04-19 08:23:38 +00:00
|
|
|
_srcdir=`dirname $0`
|
|
|
|
|
2012-04-18 09:36:56 +00:00
|
|
|
# Read list of engines
|
2013-11-07 11:58:33 +00:00
|
|
|
for i in $_srcdir/engines/*/configure.engine; do
|
|
|
|
. "$i"
|
|
|
|
done
|
2007-10-31 19:38:09 +00:00
|
|
|
|
2009-03-22 11:24:23 +00:00
|
|
|
#
|
|
|
|
# Default settings
|
|
|
|
#
|
2012-09-09 16:40:24 +00:00
|
|
|
# Default lib behavior yes/no/auto
|
2018-03-13 18:07:29 +00:00
|
|
|
_sdl=no
|
2017-10-01 18:26:11 +00:00
|
|
|
_ogg=auto
|
2009-03-22 11:24:23 +00:00
|
|
|
_vorbis=auto
|
2016-05-11 13:52:20 +00:00
|
|
|
_sdlnet=auto
|
2016-05-11 15:40:55 +00:00
|
|
|
_libcurl=auto
|
2009-03-22 11:24:23 +00:00
|
|
|
_tremor=auto
|
2011-04-22 08:56:05 +00:00
|
|
|
_tremolo=no
|
2009-03-22 11:24:23 +00:00
|
|
|
_flac=auto
|
|
|
|
_mad=auto
|
2018-02-17 11:50:19 +00:00
|
|
|
_opl2lpt=no
|
2023-01-01 16:43:46 +00:00
|
|
|
_retrowave=auto
|
2009-03-22 11:24:23 +00:00
|
|
|
_alsa=auto
|
2010-07-20 08:25:13 +00:00
|
|
|
_seq_midi=auto
|
2012-05-14 13:37:30 +00:00
|
|
|
_sndio=auto
|
2010-10-13 00:48:40 +00:00
|
|
|
_timidity=auto
|
2009-03-22 11:24:23 +00:00
|
|
|
_zlib=auto
|
2012-11-19 18:13:36 +00:00
|
|
|
_mpeg2=auto
|
2015-08-01 18:11:50 +00:00
|
|
|
_a52=auto
|
2011-07-03 21:01:17 +00:00
|
|
|
_sparkle=auto
|
2016-03-20 21:27:47 +00:00
|
|
|
_osxdockplugin=auto
|
2013-08-11 21:36:57 +00:00
|
|
|
_jpeg=auto
|
2012-08-12 21:50:25 +00:00
|
|
|
_png=auto
|
2021-04-04 11:05:28 +00:00
|
|
|
_gif=auto
|
2010-10-12 21:12:50 +00:00
|
|
|
_theoradec=auto
|
2011-04-09 19:27:23 +00:00
|
|
|
_faad=auto
|
2009-03-22 11:24:23 +00:00
|
|
|
_fluidsynth=auto
|
2021-02-14 23:29:02 +00:00
|
|
|
_fluidlite=auto
|
2015-12-12 21:08:33 +00:00
|
|
|
_opengl_mode=auto
|
2021-11-17 23:56:21 +00:00
|
|
|
_opengl_game_classic=auto
|
2020-10-14 16:37:17 +00:00
|
|
|
_opengl_game_shaders=auto
|
2020-10-14 18:31:22 +00:00
|
|
|
_tinygl=yes
|
2009-08-21 09:43:30 +00:00
|
|
|
_readline=auto
|
2011-07-25 20:54:32 +00:00
|
|
|
_freetype2=auto
|
2014-01-21 18:19:27 +00:00
|
|
|
_taskbar=auto
|
2011-08-03 01:00:57 +00:00
|
|
|
_updates=no
|
2011-04-29 15:54:09 +00:00
|
|
|
_libunity=auto
|
2018-11-19 14:57:50 +00:00
|
|
|
_dialogs=auto
|
2019-07-10 08:49:29 +00:00
|
|
|
_tts=auto
|
2020-03-18 15:59:32 +00:00
|
|
|
_gtk=auto
|
2020-04-26 11:38:31 +00:00
|
|
|
_fribidi=auto
|
2020-05-25 08:39:49 +00:00
|
|
|
_discord=auto
|
2020-05-29 18:21:21 +00:00
|
|
|
_test_cxx11=no
|
2012-09-09 16:40:24 +00:00
|
|
|
# Default option behavior yes/no
|
2009-10-13 18:50:46 +00:00
|
|
|
_debug_build=auto
|
|
|
|
_release_build=auto
|
2011-10-09 18:13:35 +00:00
|
|
|
_optimizations=auto
|
2011-05-26 09:02:46 +00:00
|
|
|
_verbose_build=no
|
2009-07-25 23:36:24 +00:00
|
|
|
_text_console=no
|
|
|
|
_mt32emu=yes
|
2019-03-08 21:11:35 +00:00
|
|
|
_lua=yes
|
2009-03-22 11:24:23 +00:00
|
|
|
_build_scalers=yes
|
2010-05-09 11:00:17 +00:00
|
|
|
_build_hq_scalers=yes
|
2012-08-14 06:43:01 +00:00
|
|
|
_build_edge_scalers=yes
|
2012-08-25 16:16:46 +00:00
|
|
|
_build_aspect=yes
|
2010-04-26 12:11:19 +00:00
|
|
|
_enable_prof=no
|
2020-01-20 17:37:23 +00:00
|
|
|
_enable_asan=no
|
2020-08-19 10:08:53 +00:00
|
|
|
_enable_tsan=no
|
2022-01-03 11:46:13 +00:00
|
|
|
_enable_ubsan=no
|
2011-07-13 16:08:26 +00:00
|
|
|
_bink=yes
|
2016-05-27 15:58:36 +00:00
|
|
|
_cloud=auto
|
2018-12-19 14:17:14 +00:00
|
|
|
_pandoc=no
|
2021-04-01 23:36:19 +00:00
|
|
|
_curl=yes
|
2021-03-09 21:35:06 +00:00
|
|
|
_lld=no
|
2022-02-16 15:50:24 +00:00
|
|
|
_mold=no
|
2021-04-13 19:41:03 +00:00
|
|
|
_gold=yes
|
2017-08-14 15:28:19 +00:00
|
|
|
# Default vkeybd/eventrec options
|
2009-03-22 11:24:23 +00:00
|
|
|
_vkeybd=no
|
2020-01-24 13:16:50 +00:00
|
|
|
_eventrec=no
|
2010-06-15 10:44:51 +00:00
|
|
|
# GUI translation options
|
|
|
|
_translation=yes
|
2009-03-22 11:24:23 +00:00
|
|
|
# Default platform settings
|
|
|
|
_backend=sdl
|
2011-05-26 09:02:46 +00:00
|
|
|
_16bit=auto
|
2016-03-05 13:25:56 +00:00
|
|
|
_highres=auto
|
2011-09-22 18:32:48 +00:00
|
|
|
_savegame_timestamp=auto
|
2008-05-06 03:11:01 +00:00
|
|
|
_dynamic_modules=no
|
2011-05-26 09:02:46 +00:00
|
|
|
_elf_loader=no
|
2008-05-06 03:00:26 +00:00
|
|
|
_plugins_default=static
|
2011-05-25 12:55:36 +00:00
|
|
|
_plugin_prefix=
|
|
|
|
_plugin_suffix=
|
2004-05-21 02:08:48 +00:00
|
|
|
_nasm=auto
|
2011-10-08 19:00:40 +00:00
|
|
|
_optimization_level=
|
|
|
|
_default_optimization_level=-O2
|
2018-04-07 07:52:44 +00:00
|
|
|
_nuked_opl=yes
|
2020-09-20 21:01:12 +00:00
|
|
|
_builtin_resources=yes
|
2021-06-30 19:54:51 +00:00
|
|
|
_windows_console=yes
|
2021-06-30 02:59:03 +00:00
|
|
|
_windows_unicode=yes
|
CONFIGURE: Allow Cygwin as development platform.
I would like to suggest to allow the use of Cygwin as development platform.
This is not intended for providing builds for this environment (although SCUMMVM can be already built on it without problems), but for having an easy way for testing POSIX code on Windows.
There could be some alternatives, like the (defunt) Microsoft POSIX subsystem, the (also defunct) Windows Services for UNIX or the WSL1 and WSL2, but they are all painful experiences, at least for me, especially when debugging graphical applications connected to an X server or working with physical devices (try to believe). Alternatively, it is also possible to make a full virtual machine by using emulators like QEMU, but it has not the same advantages of having the code running natively, especially when sharing the same files..
So, this should be seen as a tool for developers, nothing more than that, because at the time of writing this seems to be the best and most comfortable way for debugging a change to the ports using POSIX code.
However, to avoid unintentional execution, the user must activate the support for Cygwin by providing --enable-cygwin-build at configure time, otherwise the process will halt again.
Even when support for Cygwin is activated, a warning message is still shown to the user, for informing him on what he is doing.
2022-12-17 13:22:30 +00:00
|
|
|
_cygwin_build=no
|
2009-03-22 11:24:23 +00:00
|
|
|
# Default commands
|
2003-05-18 09:54:28 +00:00
|
|
|
_ranlib=ranlib
|
2009-03-19 20:49:22 +00:00
|
|
|
_strip=strip
|
2021-08-28 18:47:24 +00:00
|
|
|
_ar="ar cr"
|
2009-08-22 16:30:20 +00:00
|
|
|
_as="as"
|
2017-11-01 22:15:35 +00:00
|
|
|
_dwp=dwp
|
2007-03-18 22:56:56 +00:00
|
|
|
_windres=windres
|
2021-07-25 08:13:47 +00:00
|
|
|
_ldd=ldd
|
2011-07-01 02:41:52 +00:00
|
|
|
_stagingpath="staging"
|
2021-05-01 10:22:28 +00:00
|
|
|
_amigaospath="install"
|
2019-05-12 09:06:37 +00:00
|
|
|
_morphospath="PROGDIR:"
|
2013-09-17 20:54:12 +00:00
|
|
|
_staticlibpath=
|
2016-03-05 23:07:21 +00:00
|
|
|
_xcodetoolspath=
|
2016-03-27 12:04:42 +00:00
|
|
|
_sparklepath=
|
2018-09-20 13:12:13 +00:00
|
|
|
_pkgconfig=pkg-config
|
2016-08-15 08:19:38 +00:00
|
|
|
_sdlconfig=sdl2-config
|
2016-05-11 15:40:55 +00:00
|
|
|
_libcurlconfig=curl-config
|
2011-07-25 20:54:32 +00:00
|
|
|
_freetypeconfig=freetype-config
|
2018-05-06 18:55:29 +00:00
|
|
|
_freetype_found="false"
|
2004-01-22 04:31:31 +00:00
|
|
|
_sdlpath="$PATH"
|
2011-07-25 20:54:32 +00:00
|
|
|
_freetypepath="$PATH"
|
2016-05-11 15:40:55 +00:00
|
|
|
_libcurlpath="$PATH"
|
2004-05-21 02:08:48 +00:00
|
|
|
_nasmpath="$PATH"
|
|
|
|
NASMFLAGS=""
|
|
|
|
NASM=""
|
2011-04-19 03:06:15 +00:00
|
|
|
_tainted_build=no
|
2019-04-21 00:21:56 +00:00
|
|
|
_pandocformat="default"
|
|
|
|
_pandocext="default"
|
2021-04-01 23:36:19 +00:00
|
|
|
_manualversion="latest"
|
2020-08-12 12:27:51 +00:00
|
|
|
# Detection features to be linked into executable or not
|
2020-08-25 13:59:13 +00:00
|
|
|
_detection_features_static=yes
|
2020-12-06 14:28:08 +00:00
|
|
|
_detection_features_full=yes
|
2011-05-26 09:02:46 +00:00
|
|
|
# The following variables are automatically detected, and should not
|
|
|
|
# be modified otherwise. Consider them read-only.
|
|
|
|
_posix=no
|
2017-12-15 01:08:14 +00:00
|
|
|
_has_posix_spawn=no
|
2022-11-26 23:45:29 +00:00
|
|
|
_has_fseeko_offt_64=no
|
|
|
|
_has_fseeko64=no
|
2011-05-26 09:02:46 +00:00
|
|
|
_endian=unknown
|
|
|
|
_need_memalign=yes
|
|
|
|
_have_x86=no
|
2022-12-23 17:42:52 +00:00
|
|
|
_have_amd64=no
|
2011-05-26 09:02:46 +00:00
|
|
|
|
2012-09-04 18:26:08 +00:00
|
|
|
# Add (virtual) features
|
|
|
|
add_feature 16bit "16bit color" "_16bit"
|
2018-05-16 17:01:15 +00:00
|
|
|
add_feature bink "Bink" "_bink"
|
2016-05-11 15:40:55 +00:00
|
|
|
add_feature cloud "cloud" "_cloud"
|
2012-09-04 18:26:08 +00:00
|
|
|
add_feature faad "libfaad" "_faad"
|
|
|
|
add_feature flac "FLAC" "_flac"
|
|
|
|
add_feature freetype2 "FreeType2" "_freetype2"
|
2016-03-05 13:25:56 +00:00
|
|
|
add_feature highres "high resolution" "_highres"
|
2012-09-04 18:26:08 +00:00
|
|
|
add_feature mad "MAD" "_mad"
|
2013-08-11 21:36:57 +00:00
|
|
|
add_feature jpeg "JPEG" "_jpeg"
|
2020-10-09 17:04:07 +00:00
|
|
|
add_feature mpeg2 "mpeg2" "_mpeg2"
|
2020-10-14 16:37:17 +00:00
|
|
|
add_feature opengl_game_shaders "OpenGL with shaders" "_opengl_game_shaders"
|
2012-09-04 18:26:08 +00:00
|
|
|
add_feature png "PNG" "_png"
|
2021-04-10 16:42:26 +00:00
|
|
|
add_feature gif "GIF" "_gif"
|
2012-09-04 18:26:08 +00:00
|
|
|
add_feature theoradec "libtheoradec" "_theoradec"
|
2020-10-14 18:31:22 +00:00
|
|
|
add_feature tinygl "TinyGL" "_tinygl"
|
2012-09-04 18:26:08 +00:00
|
|
|
add_feature vorbis "Vorbis file support" "_vorbis _tremor"
|
|
|
|
add_feature zlib "zlib" "_zlib"
|
2019-03-08 21:11:35 +00:00
|
|
|
add_feature lua "lua" "_lua"
|
2020-04-26 11:38:31 +00:00
|
|
|
add_feature fribidi "FriBidi" "_fribidi"
|
2020-05-29 18:21:21 +00:00
|
|
|
add_feature test_cxx11 "Test C++11" "_test_cxx11"
|
2010-05-09 20:42:18 +00:00
|
|
|
|
|
|
|
# Directories for installing ScummVM.
|
|
|
|
# This list is closely based on what GNU autoconf does,
|
|
|
|
# although the default value for datadir differs.
|
|
|
|
# Like GNU autoconf, we distinguish datadir and datarootdir
|
|
|
|
# to make it possible to change e.g. the location of the
|
|
|
|
# man pages independently of that of the engine data files,
|
|
|
|
# which are placed inside $datadir/scummvm
|
|
|
|
prefix=NONE
|
2010-10-11 19:50:17 +00:00
|
|
|
exec_prefix=NONE
|
2010-05-09 20:42:18 +00:00
|
|
|
bindir='${exec_prefix}/bin'
|
2010-10-11 19:50:17 +00:00
|
|
|
libdir='${exec_prefix}/lib'
|
2010-05-09 20:42:18 +00:00
|
|
|
datarootdir='${prefix}/share'
|
|
|
|
datadir='${datarootdir}/scummvm'
|
2010-10-11 19:50:17 +00:00
|
|
|
mandir='${datarootdir}/man'
|
2010-05-09 20:42:18 +00:00
|
|
|
docdir='${datarootdir}/doc/scummvm'
|
|
|
|
#localedir='${datarootdir}/locale'
|
|
|
|
|
2009-03-22 11:24:23 +00:00
|
|
|
# For cross compiling
|
|
|
|
_host=""
|
|
|
|
_host_cpu=""
|
|
|
|
_host_vendor=""
|
|
|
|
_host_os=""
|
|
|
|
_host_alias=""
|
2004-04-05 22:07:09 +00:00
|
|
|
|
2009-09-27 14:59:40 +00:00
|
|
|
_port_mk="ports.mk"
|
2004-04-06 20:04:05 +00:00
|
|
|
|
2010-09-09 14:01:48 +00:00
|
|
|
# Use temp files in the build directory
|
|
|
|
TMPO=./scummvm-conf
|
2004-09-19 09:57:24 +00:00
|
|
|
TMPC=${TMPO}.cpp
|
2008-07-15 10:47:24 +00:00
|
|
|
TMPLOG=config.log
|
2004-09-19 09:57:24 +00:00
|
|
|
|
2010-05-08 20:22:50 +00:00
|
|
|
cc_check_no_clean() {
|
2003-12-10 00:15:20 +00:00
|
|
|
echo >> "$TMPLOG"
|
|
|
|
cat "$TMPC" >> "$TMPLOG"
|
|
|
|
echo >> "$TMPLOG"
|
2018-12-06 08:28:40 +00:00
|
|
|
echo "$CXX $LDFLAGS $CXXFLAGS $TMPC -o $TMPO$HOSTEXEEXT $@" >> "$TMPLOG"
|
2009-03-23 17:40:46 +00:00
|
|
|
rm -f "$TMPO$HOSTEXEEXT"
|
2013-04-18 17:56:07 +00:00
|
|
|
if test "-c" = "$*" ; then
|
2018-12-06 08:28:40 +00:00
|
|
|
( $CXX $CXXFLAGS "$TMPC" -o "$TMPO$HOSTEXEEXT" "$@" ) >> "$TMPLOG" 2>&1
|
2013-04-18 17:56:07 +00:00
|
|
|
else
|
2018-12-06 08:28:40 +00:00
|
|
|
( $CXX $LDFLAGS $CXXFLAGS "$TMPC" -o "$TMPO$HOSTEXEEXT" "$@" ) >> "$TMPLOG" 2>&1
|
2013-04-18 17:56:07 +00:00
|
|
|
fi
|
2011-04-08 14:16:59 +00:00
|
|
|
TMPR="$?"
|
|
|
|
echo "return code: $TMPR" >> "$TMPLOG"
|
2003-12-10 00:15:20 +00:00
|
|
|
echo >> "$TMPLOG"
|
2011-04-08 14:16:59 +00:00
|
|
|
return "$TMPR"
|
2003-05-18 11:23:12 +00:00
|
|
|
}
|
2003-05-18 05:43:52 +00:00
|
|
|
|
2010-05-08 20:22:50 +00:00
|
|
|
cc_check_clean() {
|
2017-11-01 22:15:35 +00:00
|
|
|
rm -rf $TMPC $TMPO $TMPO.o $TMPO.dwo $TMPO.dSYM $TMPO$HOSTEXEEXT "$@"
|
2010-05-08 20:22:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
cc_check() {
|
|
|
|
cc_check_no_clean "$@"
|
2011-04-08 14:16:59 +00:00
|
|
|
TMPR="$?"
|
2010-05-08 20:22:50 +00:00
|
|
|
cc_check_clean
|
2011-04-08 14:16:59 +00:00
|
|
|
return "$TMPR"
|
2010-05-08 20:22:50 +00:00
|
|
|
}
|
|
|
|
|
2010-04-09 12:23:43 +00:00
|
|
|
cc_check_define() {
|
|
|
|
cat > $TMPC << EOF
|
|
|
|
int main(void) {
|
2010-04-09 12:46:13 +00:00
|
|
|
#ifndef $1
|
|
|
|
syntax error
|
2010-04-09 12:23:43 +00:00
|
|
|
#endif
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
EOF
|
2010-04-09 15:47:49 +00:00
|
|
|
cc_check -c
|
2010-04-09 12:23:43 +00:00
|
|
|
return $?
|
|
|
|
}
|
|
|
|
|
|
|
|
gcc_get_define() {
|
2022-09-13 17:28:08 +00:00
|
|
|
echo "" | $CXX -dM -E - | grep -F "$1" | head -n1 | cut -d ' ' -f 3-
|
2010-04-09 12:23:43 +00:00
|
|
|
}
|
|
|
|
|
2009-03-22 11:24:23 +00:00
|
|
|
#
|
|
|
|
# Function to provide echo -n for bourne shells that don't have it
|
|
|
|
#
|
|
|
|
echo_n() {
|
|
|
|
printf "$@"
|
|
|
|
}
|
|
|
|
|
2009-03-19 21:42:50 +00:00
|
|
|
echocheck() {
|
2004-03-04 22:44:10 +00:00
|
|
|
echo_n "Checking for $@... "
|
2003-05-18 05:43:52 +00:00
|
|
|
}
|
|
|
|
|
2007-06-24 20:35:02 +00:00
|
|
|
# Add a line of data to config.mk.
|
|
|
|
add_line_to_config_mk() {
|
|
|
|
_config_mk_data="$_config_mk_data"'
|
|
|
|
'"$1"
|
|
|
|
}
|
|
|
|
|
2008-06-10 23:13:28 +00:00
|
|
|
# Add a line of data to config.h.
|
2007-06-24 20:35:02 +00:00
|
|
|
add_line_to_config_h() {
|
|
|
|
_config_h_data="$_config_h_data"'
|
|
|
|
'"$1"
|
|
|
|
}
|
|
|
|
|
2010-07-20 08:24:48 +00:00
|
|
|
# Conditionally add a line of data to config.h. Takes two parameters:
|
|
|
|
# The first one can be set to 'no' to "comment out" the line, i.e.
|
|
|
|
# make it ineffective, use 'yes' otherwise.
|
|
|
|
# The second param is the line to insert.
|
2007-06-24 20:35:02 +00:00
|
|
|
add_to_config_h_if_yes() {
|
|
|
|
if test "$1" = yes ; then
|
|
|
|
add_line_to_config_h "$2"
|
|
|
|
else
|
|
|
|
add_line_to_config_h "/* $2 */"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
# Conditionally add a line of data to config.mk. Takes two parameters:
|
|
|
|
# The first one can be set to 'no' to "comment out" the line, i.e.
|
|
|
|
# make it ineffective, use 'yes' otherwise.
|
|
|
|
# The second param is the line to insert.
|
|
|
|
add_to_config_mk_if_yes() {
|
|
|
|
if test "$1" = yes ; then
|
|
|
|
add_line_to_config_mk "$2"
|
|
|
|
else
|
|
|
|
add_line_to_config_mk "# $2"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2010-07-20 08:24:48 +00:00
|
|
|
# Conditionally add a '#define' line to config.h. Takes two parameters:
|
|
|
|
# The first one can be set to 'yes' or 'no'. If 'yes' is used, then
|
|
|
|
# the line "#define $2" is added to config.h, otherwise "#undef $2".
|
|
|
|
define_in_config_h_if_yes() {
|
|
|
|
if test "$1" = yes ; then
|
|
|
|
add_line_to_config_h "#define $2"
|
2006-08-04 22:46:06 +00:00
|
|
|
else
|
2010-07-20 08:24:48 +00:00
|
|
|
add_line_to_config_h "#undef $2"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
# Conditionally add definitions to config.h and config.mk. Takes two parameters:
|
|
|
|
# The first one can be set to 'yes' or 'no'. If 'yes' is used, then
|
|
|
|
# the line "#define $2" is added to config.h and "$2 = 1" to config.mk.
|
|
|
|
# Otherwise "#undef $2" is added to config.h and "# $2 = 1" to config.mk
|
|
|
|
define_in_config_if_yes() {
|
|
|
|
if test "$1" = yes ; then
|
|
|
|
add_line_to_config_h "#define $2"
|
|
|
|
add_line_to_config_mk "$2 = 1"
|
|
|
|
else
|
|
|
|
add_line_to_config_h "#undef $2"
|
|
|
|
add_line_to_config_mk "# $2 = 1"
|
2006-08-04 22:46:06 +00:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2018-04-07 10:21:43 +00:00
|
|
|
define_in_config_if_no() {
|
|
|
|
if test "$1" = no ; then
|
|
|
|
add_line_to_config_h "#define $2"
|
|
|
|
add_line_to_config_mk "$2 = 1"
|
|
|
|
else
|
|
|
|
add_line_to_config_h "#undef $2"
|
|
|
|
add_line_to_config_mk "# $2 = 1"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2003-07-06 06:21:17 +00:00
|
|
|
#
|
|
|
|
# Determine sdl-config
|
|
|
|
#
|
2009-11-24 12:34:31 +00:00
|
|
|
# TODO: small bit of code to test sdl usability
|
2009-03-19 21:42:50 +00:00
|
|
|
find_sdlconfig() {
|
2004-04-05 22:07:09 +00:00
|
|
|
echo_n "Looking for sdl-config... "
|
2016-08-15 08:19:38 +00:00
|
|
|
sdlconfigs="$SDL_CONFIG:$_sdlconfig:sdl2-config:sdl12-config:sdl11-config:sdl-config"
|
2003-12-10 00:15:20 +00:00
|
|
|
_sdlconfig=
|
2008-01-27 19:47:41 +00:00
|
|
|
|
2005-10-11 11:27:18 +00:00
|
|
|
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="$SEPARATOR"
|
2004-01-22 04:31:31 +00:00
|
|
|
for path_dir in $_sdlpath; do
|
2006-02-20 15:16:26 +00:00
|
|
|
#reset separator to parse sdlconfigs
|
|
|
|
IFS=":"
|
2004-12-16 22:15:32 +00:00
|
|
|
for sdlconfig in $sdlconfigs; do
|
2008-03-23 11:46:55 +00:00
|
|
|
if test -f "$path_dir/$sdlconfig" ; then
|
2004-12-16 22:15:32 +00:00
|
|
|
_sdlconfig="$path_dir/$sdlconfig"
|
|
|
|
echo $_sdlconfig
|
2006-04-27 19:55:09 +00:00
|
|
|
# break at first sdl-config found in path
|
|
|
|
break 2
|
2004-12-16 22:15:32 +00:00
|
|
|
fi
|
|
|
|
done
|
2003-12-10 00:15:20 +00:00
|
|
|
done
|
2008-01-27 19:47:41 +00:00
|
|
|
|
2003-12-10 00:15:20 +00:00
|
|
|
IFS="$ac_save_ifs"
|
2008-01-27 19:47:41 +00:00
|
|
|
|
2003-12-10 00:15:20 +00:00
|
|
|
if test -z "$_sdlconfig"; then
|
2004-12-16 22:15:32 +00:00
|
|
|
echo "none found!"
|
|
|
|
exit 1
|
2003-12-10 00:15:20 +00:00
|
|
|
fi
|
2003-07-06 06:21:17 +00:00
|
|
|
}
|
|
|
|
|
2011-07-25 20:54:32 +00:00
|
|
|
#
|
|
|
|
# Determine freetype-config
|
|
|
|
#
|
|
|
|
find_freetypeconfig() {
|
|
|
|
echo_n "Looking for freetype-config... "
|
|
|
|
freetypeconfigs="$_freetypeconfig"
|
|
|
|
_freetypeconfig=
|
|
|
|
|
|
|
|
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="$SEPARATOR"
|
|
|
|
for path_dir in $_freetypepath; do
|
|
|
|
#reset separator to parse freetypeconfigs
|
|
|
|
IFS=":"
|
|
|
|
for freetypeconfig in $freetypeconfigs; do
|
|
|
|
if test -f "$path_dir/$freetypeconfig" ; then
|
|
|
|
_freetypeconfig="$path_dir/$freetypeconfig"
|
|
|
|
echo $_freetypeconfig
|
|
|
|
# Save the prefix
|
|
|
|
_freetypepath=$path_dir
|
|
|
|
if test `basename $path_dir` = bin ; then
|
|
|
|
_freetypepath=`dirname $path_dir`
|
|
|
|
fi
|
|
|
|
# break at first freetype-config found in path
|
|
|
|
break 2
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
done
|
|
|
|
|
|
|
|
IFS="$ac_save_ifs"
|
|
|
|
|
|
|
|
if test -z "$_freetypeconfig"; then
|
|
|
|
echo "none found!"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2016-05-11 15:40:55 +00:00
|
|
|
#
|
|
|
|
# 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
|
2016-08-30 18:48:11 +00:00
|
|
|
_libcurlpath=`dirname $path_dir`
|
2016-05-11 15:40:55 +00:00
|
|
|
fi
|
2016-08-30 18:48:11 +00:00
|
|
|
# break at first curl-config found in path
|
2016-05-11 15:40:55 +00:00
|
|
|
break 2
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
done
|
|
|
|
|
|
|
|
IFS="$ac_save_ifs"
|
|
|
|
|
|
|
|
if test -z "$_libcurlconfig"; then
|
|
|
|
echo "none found!"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2009-03-23 17:40:46 +00:00
|
|
|
#
|
|
|
|
# Determine extension used for executables
|
|
|
|
#
|
|
|
|
get_system_exe_extension() {
|
|
|
|
case $1 in
|
2017-06-28 21:15:54 +00:00
|
|
|
riscos)
|
|
|
|
_exeext=",e1f"
|
2010-10-12 02:18:11 +00:00
|
|
|
;;
|
2020-08-01 13:15:49 +00:00
|
|
|
3ds | dreamcast | ds | gamecube | n64 | psp | switch | wii)
|
2010-02-02 11:46:35 +00:00
|
|
|
_exeext=".elf"
|
2010-01-25 01:39:44 +00:00
|
|
|
;;
|
2010-09-26 20:23:58 +00:00
|
|
|
gph-linux)
|
|
|
|
_exeext=".gph"
|
2010-02-02 11:46:35 +00:00
|
|
|
;;
|
2019-11-10 16:34:25 +00:00
|
|
|
mingw* | *os2-emx)
|
2010-02-02 11:46:35 +00:00
|
|
|
_exeext=".exe"
|
2009-03-23 17:40:46 +00:00
|
|
|
;;
|
2021-06-01 22:59:09 +00:00
|
|
|
emscripten)
|
2021-08-27 02:14:25 +00:00
|
|
|
_exeext=".html"
|
2021-06-01 22:59:09 +00:00
|
|
|
;;
|
2009-03-23 17:40:46 +00:00
|
|
|
*)
|
|
|
|
_exeext=""
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
}
|
2009-03-22 11:24:23 +00:00
|
|
|
|
2004-03-04 22:44:10 +00:00
|
|
|
#
|
2009-03-22 11:24:23 +00:00
|
|
|
# Generic options functions
|
2004-03-04 22:44:10 +00:00
|
|
|
#
|
2009-03-22 11:24:23 +00:00
|
|
|
|
|
|
|
# Show the configure help line for an option
|
|
|
|
option_help() {
|
2022-09-23 18:53:46 +00:00
|
|
|
option=$(echo "${3:---}${1} " | sed -e "s/\(.\{23\}\).*/\1/" -e "s/_/-/g")
|
2009-03-22 11:24:23 +00:00
|
|
|
echo " ${option} ${2}"
|
|
|
|
}
|
|
|
|
|
|
|
|
# Show an error about an unknown option
|
|
|
|
option_error() {
|
2011-11-26 16:40:00 +00:00
|
|
|
echo "error: unrecognized option: $ac_option
|
2009-03-22 11:24:23 +00:00
|
|
|
Try \`$0 --help' for more information." >&2
|
|
|
|
exit 1
|
2004-03-04 22:44:10 +00:00
|
|
|
}
|
|
|
|
|
2011-11-26 14:39:43 +00:00
|
|
|
# Show an error about an unknown engine
|
|
|
|
engine_option_error() {
|
2011-11-26 16:40:00 +00:00
|
|
|
echo "error: unrecognized engine: $1
|
2011-11-26 14:39:43 +00:00
|
|
|
Try \`$0 --help' for more information." >&2
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
# Show an error about an invalid subengine option
|
|
|
|
subengine_option_error() {
|
|
|
|
echo "error: this option is invalid for the subengine $1: $ac_option
|
|
|
|
Try \`$0 --help' for more information." >&2
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-08-24 16:05:53 +00:00
|
|
|
#
|
2009-03-22 11:24:23 +00:00
|
|
|
# Engine handling functions
|
2002-08-24 16:05:53 +00:00
|
|
|
#
|
2004-05-21 02:08:48 +00:00
|
|
|
|
2007-10-31 19:38:09 +00:00
|
|
|
# Get the name of the engine
|
|
|
|
get_engine_name() {
|
2009-08-31 01:24:04 +00:00
|
|
|
get_var _engine_$1_name
|
2007-10-31 19:38:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# Will this engine be built?
|
|
|
|
get_engine_build() {
|
2009-08-31 01:24:04 +00:00
|
|
|
get_var _engine_$1_build
|
2007-10-31 19:38:09 +00:00
|
|
|
}
|
|
|
|
|
2011-04-19 03:06:15 +00:00
|
|
|
# Was this engine set to be built by default?
|
|
|
|
get_engine_build_default() {
|
|
|
|
get_var _engine_$1_build_default
|
|
|
|
}
|
|
|
|
|
2007-11-04 06:55:45 +00:00
|
|
|
# Get the subengines
|
|
|
|
get_engine_subengines() {
|
2009-08-31 01:24:04 +00:00
|
|
|
get_var _engine_$1_subengines
|
2007-11-04 06:55:45 +00:00
|
|
|
}
|
|
|
|
|
2007-10-31 19:38:09 +00:00
|
|
|
# Ask if this is a subengine
|
2022-09-23 18:53:46 +00:00
|
|
|
check_is_subengine() {
|
|
|
|
if test -z "$(get_var _engine_$1_sub)" ; then
|
|
|
|
return 1
|
2007-10-31 19:38:09 +00:00
|
|
|
fi
|
2022-09-23 18:53:46 +00:00
|
|
|
return 0
|
2007-10-31 19:38:09 +00:00
|
|
|
}
|
|
|
|
|
2012-09-11 16:39:03 +00:00
|
|
|
# Get a subengine's parent (undefined for non-subengines)
|
|
|
|
get_subengine_parent() {
|
|
|
|
get_var _engine_$1_parent
|
|
|
|
}
|
|
|
|
|
2009-03-13 16:31:53 +00:00
|
|
|
# Enable *all* engines
|
|
|
|
engine_enable_all() {
|
|
|
|
for engine in $_engines; do
|
2009-08-31 01:24:04 +00:00
|
|
|
set_var _engine_${engine}_build "yes"
|
2009-03-13 16:31:53 +00:00
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
# Disable *all* engines
|
|
|
|
engine_disable_all() {
|
|
|
|
for engine in $_engines; do
|
2009-08-31 01:24:04 +00:00
|
|
|
set_var _engine_${engine}_build "no"
|
2009-03-13 16:31:53 +00:00
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2019-06-18 15:15:21 +00:00
|
|
|
# Enable all unstable engines
|
|
|
|
engine_enable_all_unstable() {
|
|
|
|
for engine in $_engines; do
|
|
|
|
engine_build_default=`get_engine_build_default $engine`
|
|
|
|
if test $engine_build_default = no ; then
|
|
|
|
set_var _engine_${engine}_build "yes"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2019-06-06 22:41:47 +00:00
|
|
|
# Disable all unstable engines
|
|
|
|
engine_disable_all_unstable() {
|
|
|
|
for engine in $_engines; do
|
|
|
|
engine_build_default=`get_engine_build_default $engine`
|
|
|
|
if test $engine_build_default = no ; then
|
|
|
|
set_var _engine_${engine}_build "no"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2007-10-31 19:38:09 +00:00
|
|
|
# Enable the given engine
|
|
|
|
engine_enable() {
|
2008-05-06 03:00:26 +00:00
|
|
|
# Get the parameter
|
2011-11-20 05:20:31 +00:00
|
|
|
if ( echo $1 | grep ':' ) 2> /dev/null > /dev/null ; then
|
|
|
|
eng=`echo $1 | cut -d ':' -f 1`
|
|
|
|
opt=`echo $1 | cut -d ':' -f 2`
|
2008-05-06 03:00:26 +00:00
|
|
|
else
|
|
|
|
eng=$1
|
|
|
|
opt=yes
|
|
|
|
fi
|
|
|
|
engine=`echo $eng | sed 's/-/_/g'`
|
2008-05-07 01:15:46 +00:00
|
|
|
|
|
|
|
# Filter the parameter for the subengines
|
2022-09-23 18:53:46 +00:00
|
|
|
if check_is_subengine ${engine} ; then
|
2012-09-11 16:39:03 +00:00
|
|
|
if test "$opt" != "yes" ; then
|
|
|
|
subengine_option_error ${engine}
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
parent=`get_subengine_parent ${engine}`
|
|
|
|
if test `get_engine_build ${parent}` = "no" ; then
|
|
|
|
set_var _engine_${parent}_build "yes"
|
2016-02-24 17:52:29 +00:00
|
|
|
fi
|
2008-05-07 01:15:46 +00:00
|
|
|
fi
|
|
|
|
|
2022-11-06 15:02:09 +00:00
|
|
|
if test "$opt" != "static" -a "$opt" != "dynamic" -a "$opt" != "yes" ; then
|
2008-05-06 03:00:26 +00:00
|
|
|
option_error
|
2022-11-06 15:02:09 +00:00
|
|
|
return
|
|
|
|
fi
|
|
|
|
|
|
|
|
subengines=
|
|
|
|
if test "${engine%_all}" != "${engine}" ; then
|
|
|
|
engine="${engine%_all}"
|
|
|
|
subengines=$(get_engine_subengines ${engine})
|
|
|
|
if test "$subengines" = "" ; then
|
|
|
|
engine_option_error "${engine}*"
|
|
|
|
return
|
|
|
|
fi
|
2007-10-31 19:38:09 +00:00
|
|
|
fi
|
2022-11-06 15:02:09 +00:00
|
|
|
|
|
|
|
if test "`get_engine_name ${engine}`" = "" ; then
|
|
|
|
engine_option_error ${engine}
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
|
|
|
|
set_var _engine_${engine}_build "$opt"
|
|
|
|
for subengine in $subengines ; do
|
|
|
|
set_var _engine_${subengine}_build "$opt"
|
|
|
|
done
|
2007-10-31 19:38:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# Disable the given engine
|
|
|
|
engine_disable() {
|
2008-05-07 01:15:46 +00:00
|
|
|
# Filter malformed options
|
|
|
|
if ( echo $1 | grep '=' ) 2> /dev/null > /dev/null ; then
|
|
|
|
option_error
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
|
2007-10-31 19:38:09 +00:00
|
|
|
engine=`echo $1 | sed 's/-/_/g'`
|
2008-06-09 02:36:34 +00:00
|
|
|
if test "`get_engine_name ${engine}`" != "" ; then
|
2009-08-31 01:24:04 +00:00
|
|
|
set_var _engine_${engine}_build "no"
|
2007-10-31 19:38:09 +00:00
|
|
|
else
|
2011-11-26 14:39:43 +00:00
|
|
|
engine_option_error ${engine}
|
2007-10-31 19:38:09 +00:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
# Show the configure help line for a given engine
|
|
|
|
show_engine_help() {
|
|
|
|
name=`get_engine_name $1`
|
2011-11-20 05:20:31 +00:00
|
|
|
option_help "${1}" "${name} engine" " "
|
2007-11-04 06:55:45 +00:00
|
|
|
for sub in `get_engine_subengines $1`; do
|
|
|
|
show_subengine_help $sub $1
|
|
|
|
done
|
2007-10-31 19:38:09 +00:00
|
|
|
}
|
|
|
|
|
2007-11-04 06:55:45 +00:00
|
|
|
# Show the configure help line for a given subengine
|
|
|
|
show_subengine_help() {
|
|
|
|
name=`get_engine_name $1`
|
|
|
|
parent=`get_engine_name $2`
|
2020-02-02 09:44:18 +00:00
|
|
|
option_help "- ${1}" "${name} in ${parent} engine" " "
|
2007-10-31 19:38:09 +00:00
|
|
|
}
|
|
|
|
|
2021-03-23 17:17:17 +00:00
|
|
|
# Copy first argument to second one if they are different. Otherwise, delete the first one.
|
2021-04-23 09:34:02 +00:00
|
|
|
# Touch the optional third argument on change
|
2021-03-23 17:17:17 +00:00
|
|
|
copy_if_changed() {
|
|
|
|
if cmp -s $1 $2; then
|
|
|
|
rm -f $1
|
|
|
|
else
|
|
|
|
mv -f $1 $2
|
2021-04-23 09:34:02 +00:00
|
|
|
if test -n "$3" ; then
|
|
|
|
touch "$3"
|
|
|
|
fi
|
2021-03-23 17:17:17 +00:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2002-08-24 15:24:38 +00:00
|
|
|
#
|
|
|
|
# Check any parameters we received
|
|
|
|
#
|
2003-07-06 11:19:55 +00:00
|
|
|
# TODO:
|
|
|
|
# * Change --disable-mad / --enable-mad to the way it's done in autoconf:
|
|
|
|
# That is, --without-mad / --with-mad=/prefix/to/mad. Useful for people
|
|
|
|
# who have Mad/Vorbis/ALSA installed in a non-standard locations.
|
2002-08-24 15:24:38 +00:00
|
|
|
#
|
|
|
|
|
2003-05-18 05:43:52 +00:00
|
|
|
for parm in "$@" ; do
|
2007-11-01 21:03:16 +00:00
|
|
|
if test "$parm" = "--help" || test "$parm" = "-help" || test "$parm" = "-h" ; then
|
|
|
|
for engine in $_engines; do
|
2022-09-23 18:53:46 +00:00
|
|
|
if ! check_is_subengine $engine ; then
|
2007-11-04 06:55:45 +00:00
|
|
|
engines_help="$engines_help`show_engine_help $engine`
|
2007-10-31 19:38:09 +00:00
|
|
|
"
|
2007-11-04 06:55:45 +00:00
|
|
|
fi
|
2007-11-01 21:03:16 +00:00
|
|
|
done
|
|
|
|
cat << EOF
|
2003-05-18 05:43:52 +00:00
|
|
|
|
|
|
|
Usage: $0 [OPTIONS]...
|
|
|
|
|
|
|
|
Configuration:
|
2010-05-09 20:42:18 +00:00
|
|
|
-h, --help display this help and exit
|
2016-04-14 04:39:27 +00:00
|
|
|
--backend=BACKEND backend to build (3ds, android, dc, dingux, ds, gcw0,
|
2021-10-12 08:30:58 +00:00
|
|
|
gph, iphone, ios7, ios7-arm64, maemo, n64, null, opendingux,
|
|
|
|
openpandora, psp, psp2, samsungtv, sdl, switch, wii) [sdl]
|
2004-01-22 04:31:31 +00:00
|
|
|
|
2004-04-16 08:30:57 +00:00
|
|
|
Installation directories:
|
2010-05-09 20:42:18 +00:00
|
|
|
--prefix=PREFIX install architecture-independent files in PREFIX
|
|
|
|
[/usr/local]
|
|
|
|
--exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
|
|
|
|
[PREFIX]
|
|
|
|
|
|
|
|
By default, \`make install' will install all the files in
|
|
|
|
\`/usr/local/bin', \`/usr/local/lib' etc. You can specify
|
|
|
|
an installation prefix other than \`/usr/local' using \`--prefix',
|
|
|
|
for instance \`--prefix=\$HOME'.
|
|
|
|
|
|
|
|
For better control, use the options below.
|
|
|
|
|
|
|
|
Fine tuning of the installation directories:
|
|
|
|
--bindir=DIR user executables [EPREFIX/bin]
|
|
|
|
--libdir=DIR object code libraries [EPREFIX/lib]
|
|
|
|
--datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
|
2010-09-06 18:13:39 +00:00
|
|
|
--datadir=DIR read-only architecture-independent data
|
|
|
|
[DATAROOTDIR/scummvm]
|
2010-05-09 20:42:18 +00:00
|
|
|
--mandir=DIR man documentation [DATAROOTDIR/man]
|
|
|
|
--docdir=DIR documentation root [DATAROOTDIR/doc/scummvm]
|
2004-04-16 08:30:57 +00:00
|
|
|
|
2004-01-22 04:31:31 +00:00
|
|
|
Special configuration feature:
|
2010-05-09 20:42:18 +00:00
|
|
|
--host=HOST cross-compile to target HOST (arm-linux, ...)
|
2016-04-14 04:39:27 +00:00
|
|
|
special targets: 3ds for Nintendo 3DS
|
2020-02-26 19:28:49 +00:00
|
|
|
android-arm-v7a for Android ARMv7-A (armeabi-v7a)
|
2019-10-04 10:53:52 +00:00
|
|
|
android-arm64-v8a for Android ARMv8-A (arm64-v8a)
|
2014-03-12 03:38:27 +00:00
|
|
|
android-x86 for Android x86
|
2019-10-04 10:53:52 +00:00
|
|
|
android-x86_64 for Android x86_64
|
2010-10-20 13:03:19 +00:00
|
|
|
caanoo for Caanoo
|
2010-10-11 23:26:26 +00:00
|
|
|
dingux for Dingux
|
2015-03-20 18:11:30 +00:00
|
|
|
raspberrypi for Raspberry Pi
|
2010-10-11 23:26:26 +00:00
|
|
|
dreamcast for Sega Dreamcast
|
|
|
|
ds for Nintendo DS
|
2010-05-09 20:42:18 +00:00
|
|
|
gamecube for Nintendo GameCube
|
2014-10-26 18:31:36 +00:00
|
|
|
gcw0 for GCW Zero
|
2010-10-11 23:26:26 +00:00
|
|
|
gp2x for GP2X
|
|
|
|
gp2xwiz for GP2X Wiz
|
2015-12-04 17:20:09 +00:00
|
|
|
iphone for Apple iPhone (iOS <= 6)
|
|
|
|
ios7 for Apple iPhone / iPad (iOS >= 7)
|
2021-03-19 19:08:02 +00:00
|
|
|
ios7-arm64 for Apple iPhone / iPad (iOS >= 7, 64-bit)
|
2011-07-05 06:52:42 +00:00
|
|
|
maemo for Nokia Maemo
|
2010-10-11 23:26:26 +00:00
|
|
|
n64 for Nintendo 64
|
2021-11-11 10:24:37 +00:00
|
|
|
opendingux-gcw0 for GCW0 with Opendingux Beta
|
|
|
|
opendingux-lepus for Lepus with Opendingux Beta
|
2022-12-31 17:51:10 +00:00
|
|
|
opendingux-rg99 for RG99 and RS90 with Opendingux Beta
|
|
|
|
opendingux-rs90 for RG99 and RS90 with Opendingux Beta
|
2010-10-11 23:26:26 +00:00
|
|
|
openpandora for OpenPandora
|
2013-08-07 14:54:40 +00:00
|
|
|
ouya for OUYA
|
2011-06-02 08:34:41 +00:00
|
|
|
ps3 for PlayStation 3
|
2017-03-01 20:00:17 +00:00
|
|
|
psp2 for PlayStation Vita
|
2010-05-09 20:42:18 +00:00
|
|
|
psp for PlayStation Portable
|
2010-10-11 23:26:26 +00:00
|
|
|
samsungtv for Samsung TV
|
2018-09-20 14:33:08 +00:00
|
|
|
switch for Nintendo Switch
|
2022-06-08 21:20:39 +00:00
|
|
|
wasm32-unknown-emscripten for WebAssembly
|
2010-05-09 20:42:18 +00:00
|
|
|
wii for Nintendo Wii
|
2003-05-18 05:43:52 +00:00
|
|
|
|
2009-08-31 01:25:04 +00:00
|
|
|
Game engines:
|
2011-04-15 11:56:20 +00:00
|
|
|
--enable-all-engines enable all engines, including those which are
|
|
|
|
broken or unsupported
|
2009-03-13 16:31:53 +00:00
|
|
|
--disable-all-engines disable all engines
|
2019-06-18 15:15:21 +00:00
|
|
|
--enable-all-unstable-engines enable the engines which are
|
|
|
|
broken or unsupported
|
2019-06-06 22:41:47 +00:00
|
|
|
--disable-all-unstable-engines disable only the engines which are
|
|
|
|
broken or unsupported
|
2011-11-20 05:20:31 +00:00
|
|
|
--enable-engine=<engine name>[,<engine name>...] enable engine(s) listed
|
|
|
|
--disable-engine=<engine name>[,<engine name>...] disable engine(s) listed
|
2016-02-24 17:52:29 +00:00
|
|
|
--enable-engine-static=<engine name>[,<engine name>...]
|
2011-11-20 05:20:31 +00:00
|
|
|
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)
|
|
|
|
The values of <engine name> for these options are as follows:
|
2007-10-31 19:38:09 +00:00
|
|
|
$engines_help
|
2009-08-31 01:25:04 +00:00
|
|
|
Optional Features:
|
2018-01-01 12:24:02 +00:00
|
|
|
--enable-static build a static binary instead of using shared objects
|
2020-08-12 12:27:51 +00:00
|
|
|
--enable-detection-static build detection features into executable (default)
|
|
|
|
--enable-detection-dynamic build detection features into a library
|
2022-01-01 19:33:30 +00:00
|
|
|
--disable-detection-full add detection only for the engines which were enabled
|
2009-08-31 01:25:04 +00:00
|
|
|
--disable-debug disable building with debugging symbols
|
|
|
|
--enable-Werror treat warnings as errors
|
2010-09-06 18:13:39 +00:00
|
|
|
--enable-release enable building in release mode (this activates
|
|
|
|
optimizations)
|
2011-10-07 22:45:56 +00:00
|
|
|
--enable-release-mode enable building in release mode (without optimizations)
|
2011-10-09 18:13:35 +00:00
|
|
|
--enable-optimizations enable optimizations
|
2020-04-16 14:39:44 +00:00
|
|
|
--enable-asan enable Address Sanitizer for memory-related debugging
|
2020-08-19 10:08:53 +00:00
|
|
|
--enable-tsan enable Thread Sanitizer for thread-related debugging
|
2022-01-03 11:46:13 +00:00
|
|
|
--enable-ubsan enable Undefined Behavior Sanitizer for undefined-behavior-related debugging
|
2010-03-24 23:19:42 +00:00
|
|
|
--enable-profiling enable profiling
|
2008-05-06 03:00:26 +00:00
|
|
|
--enable-plugins enable the support for dynamic plugins
|
|
|
|
--default-dynamic make plugins dynamic by default
|
2004-11-06 01:41:32 +00:00
|
|
|
--disable-mt32emu don't enable the integrated MT-32 emulator
|
2019-03-08 21:11:35 +00:00
|
|
|
--disable-lua don't enable Lua support
|
2018-04-07 07:52:44 +00:00
|
|
|
--disable-nuked-opl don't build Nuked OPL driver
|
2009-08-21 10:39:02 +00:00
|
|
|
--disable-16bit don't enable 16bit color support
|
2016-03-05 13:25:56 +00:00
|
|
|
--disable-highres don't enable support for high resolution engines >320x240
|
2011-09-22 18:32:48 +00:00
|
|
|
--disable-savegame-timestamp don't use timestamps for blank savegame descriptions
|
2006-01-24 22:21:23 +00:00
|
|
|
--disable-scalers exclude scalers
|
2012-08-14 06:43:01 +00:00
|
|
|
--disable-hq-scalers exclude HQ2x and HQ3x scalers (disables Edge scalers as well)
|
|
|
|
--disable-edge-scalers exclude Edge2x and Edge3x scalers
|
2012-08-25 16:16:46 +00:00
|
|
|
--disable-aspect exclude aspect ratio correction
|
2010-06-15 10:44:51 +00:00
|
|
|
--disable-translation don't build support for translated messages
|
2011-04-29 15:54:09 +00:00
|
|
|
--disable-taskbar don't build support for taskbar and launcher integration
|
2016-05-27 15:58:36 +00:00
|
|
|
--disable-cloud don't build cloud support
|
2018-11-19 14:57:50 +00:00
|
|
|
--disable-system-dialogs don't build support for system dialogs
|
2013-07-06 04:39:51 +00:00
|
|
|
--enable-vkeybd build virtual keyboard support
|
|
|
|
--enable-eventrecorder enable event recording functionality
|
|
|
|
--disable-eventrecorder disable event recording functionality
|
2011-08-03 01:00:57 +00:00
|
|
|
--enable-updates build support for updates
|
2009-07-25 23:36:24 +00:00
|
|
|
--enable-text-console use text console instead of graphical console
|
2010-09-06 18:13:39 +00:00
|
|
|
--enable-verbose-build enable regular echoing of commands during build
|
|
|
|
process
|
2019-10-05 19:27:00 +00:00
|
|
|
--enable-tts build support for text to speech
|
|
|
|
--disable-tts don't build support for text to speech
|
2011-07-13 16:08:26 +00:00
|
|
|
--disable-bink don't build with Bink video support
|
2015-12-12 21:08:33 +00:00
|
|
|
--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
|
2015-12-20 04:42:54 +00:00
|
|
|
gles2 for forcing OpenGL ES 2
|
2015-12-12 21:08:33 +00:00
|
|
|
WARNING: only specify this manually if you know what
|
|
|
|
you are doing!
|
2020-09-20 21:01:12 +00:00
|
|
|
--no-builtin-resources do not include additional resources (e.g. engine data, fonts)
|
|
|
|
into the ScummVM binary
|
2021-06-30 19:54:51 +00:00
|
|
|
--enable-windows-console show console output on Windows (default)
|
|
|
|
--disable-windows-console do not show console output on Windows
|
2021-06-30 02:59:03 +00:00
|
|
|
--enable-windows-unicode use Windows Unicode APIs (default)
|
|
|
|
--disable-windows-unicode use Windows ANSI APIs
|
2003-05-18 05:43:52 +00:00
|
|
|
|
2021-04-01 23:36:19 +00:00
|
|
|
Optional Documentation Options:
|
2021-08-27 14:31:47 +00:00
|
|
|
--with-manual-version=VERSION version to use when generating the manual (optional)
|
2021-04-01 23:36:19 +00:00
|
|
|
--with-pandoc-format=FORMAT pandoc format to use during the conversion (optional)
|
|
|
|
|
2003-05-18 05:43:52 +00:00
|
|
|
Optional Libraries:
|
2017-10-28 17:16:25 +00:00
|
|
|
--with-alsa-prefix=DIR prefix where alsa is installed (optional)
|
2003-08-08 09:02:49 +00:00
|
|
|
--disable-alsa disable ALSA midi sound support [autodetect]
|
2004-02-15 01:21:02 +00:00
|
|
|
|
2017-10-28 17:16:25 +00:00
|
|
|
--with-ogg-prefix=DIR prefix where libogg is installed (optional)
|
|
|
|
--disable-ogg disable Ogg support [autodetect]
|
2017-10-01 18:26:11 +00:00
|
|
|
|
2017-10-28 17:16:25 +00:00
|
|
|
--with-vorbis-prefix=DIR prefix where libvorbis is installed (optional)
|
2017-10-01 18:26:11 +00:00
|
|
|
--disable-vorbis disable Vorbis support [autodetect]
|
2004-02-15 01:21:02 +00:00
|
|
|
|
2017-10-28 17:16:25 +00:00
|
|
|
--with-tremor-prefix=DIR prefix where tremor is installed (optional)
|
2005-11-08 22:40:10 +00:00
|
|
|
--disable-tremor disable tremor support [autodetect]
|
2005-06-30 09:14:36 +00:00
|
|
|
|
2017-10-28 17:16:25 +00:00
|
|
|
--with-mad-prefix=DIR prefix where libmad is installed (optional)
|
2003-08-08 09:02:49 +00:00
|
|
|
--disable-mad disable libmad (MP3) support [autodetect]
|
2005-11-08 22:40:10 +00:00
|
|
|
|
2020-04-26 11:38:31 +00:00
|
|
|
--with-fribidi-prefix=DIR prefix where libfribidi is installed
|
|
|
|
--disable-fribidi disable libfribidi support [autodetect]
|
|
|
|
|
2017-10-28 17:16:25 +00:00
|
|
|
--with-flac-prefix=DIR prefix where libFLAC is installed (optional)
|
2004-02-22 14:11:16 +00:00
|
|
|
--disable-flac disable FLAC support [autodetect]
|
2004-02-15 01:21:02 +00:00
|
|
|
|
2017-10-28 17:16:25 +00:00
|
|
|
--with-zlib-prefix=DIR prefix where zlib is installed (optional)
|
2004-01-12 11:11:19 +00:00
|
|
|
--disable-zlib disable zlib (compression) support [autodetect]
|
2004-02-15 01:21:02 +00:00
|
|
|
|
2017-10-28 17:16:25 +00:00
|
|
|
--with-mpeg2-prefix=DIR prefix where libmpeg2 is installed (optional)
|
2012-11-19 18:13:36 +00:00
|
|
|
--enable-mpeg2 enable mpeg2 codec for cutscenes [autodetect]
|
|
|
|
|
2015-08-01 18:11:50 +00:00
|
|
|
--with-a52-prefix=DIR Prefix where liba52 is installed (optional)
|
|
|
|
--enable-a52 enable a52 codec for MPEG decoder [autodetect]
|
|
|
|
|
2020-10-14 16:37:17 +00:00
|
|
|
--with-opengl-prefix=DIR prefix where OpenGL (ES) is installed (optional)
|
|
|
|
--disable-opengl-game disable OpenGL (ES) support in game [autodetect]
|
2022-01-04 22:04:05 +00:00
|
|
|
--disable-opengl-game-classic disable OpenGL classic support in game
|
|
|
|
--disable-opengl-game-shaders disable use of modern OpenGL with shaders in game
|
2011-04-14 10:41:26 +00:00
|
|
|
|
2015-08-01 18:11:50 +00:00
|
|
|
--with-jpeg-prefix=DIR Prefix where libjpeg is installed (optional)
|
2013-08-11 21:36:57 +00:00
|
|
|
--disable-jpeg disable JPEG decoder [autodetect]
|
|
|
|
|
2017-10-28 17:16:25 +00:00
|
|
|
--with-png-prefix=DIR prefix where libpng is installed (optional)
|
2010-10-12 21:12:50 +00:00
|
|
|
--disable-png disable PNG decoder [autodetect]
|
|
|
|
|
2021-04-10 16:42:43 +00:00
|
|
|
--with-gif-prefix=DIR prefix where giflib is installed (optional)
|
|
|
|
--disable-gif disable GIF decoder [autodetect]
|
|
|
|
|
2017-10-28 17:16:25 +00:00
|
|
|
--with-theoradec-prefix=DIR prefix where libtheoradec is installed (optional)
|
2010-10-12 21:12:50 +00:00
|
|
|
--disable-theoradec disable Theora decoder [autodetect]
|
|
|
|
|
2017-10-28 17:16:25 +00:00
|
|
|
--with-faad-prefix=DIR prefix where libfaad is installed (optional)
|
2011-04-09 19:27:23 +00:00
|
|
|
--disable-faad disable AAC decoder [autodetect]
|
|
|
|
|
2017-10-28 17:16:25 +00:00
|
|
|
--with-fluidsynth-prefix=DIR prefix where libfluidsynth is
|
2010-09-06 18:13:39 +00:00
|
|
|
installed (optional)
|
2005-04-10 14:33:44 +00:00
|
|
|
--disable-fluidsynth disable fluidsynth MIDI driver [autodetect]
|
|
|
|
|
2021-02-14 23:29:02 +00:00
|
|
|
--with-fluidlite-prefix=DIR prefix where libfluidlite is
|
|
|
|
installed (optional)
|
|
|
|
--disable-fluidlite disable fluidlite MIDI driver [autodetect]
|
|
|
|
|
2018-02-17 11:50:19 +00:00
|
|
|
--with-ieee1284-prefix=DIR prefix where libieee1284 is installed (optional)
|
|
|
|
--enable-opl2lpt enable OPL2LPT support
|
2022-05-22 22:54:32 +00:00
|
|
|
|
2022-01-29 16:33:29 +00:00
|
|
|
--with-retrowave-prefix=DIR prefix where libretrowave is installed (optional)
|
|
|
|
--enable-retrowave enable RetroWave OPL3 support
|
2018-02-17 11:50:19 +00:00
|
|
|
|
2017-10-28 17:16:25 +00:00
|
|
|
--with-sparkle-prefix=DIR prefix where sparkle is installed
|
2022-01-29 02:58:21 +00:00
|
|
|
(macOS/Windows only - optional)
|
2017-10-28 17:16:25 +00:00
|
|
|
--disable-sparkle disable sparkle automatic update support
|
2022-01-29 02:58:21 +00:00
|
|
|
[macOS/Windows only - autodetect]
|
2011-07-03 21:01:17 +00:00
|
|
|
|
2017-10-28 17:16:25 +00:00
|
|
|
--disable-osx-dock-plugin disable the NSDockTilePlugin support
|
2022-01-29 02:58:21 +00:00
|
|
|
[macOS only - autodetect]
|
2016-03-20 21:27:47 +00:00
|
|
|
|
2020-02-02 09:26:06 +00:00
|
|
|
--with-sdl-prefix=DIR prefix where the SDL package is installed (optional)
|
|
|
|
e.g., if sdl-config script is at:
|
|
|
|
/opt/mxe/usr/i686-w64-mingw32.static/bin/sdl2-config
|
|
|
|
then you should pass:
|
|
|
|
'--with-sdl-prefix=/opt/mxe/usr/i686-w64-mingw32.static'
|
2004-05-21 02:08:48 +00:00
|
|
|
|
2017-10-28 17:16:25 +00:00
|
|
|
--with-freetype2-prefix=DIR prefix where the freetype-config script is
|
|
|
|
installed (optional)
|
|
|
|
--disable-freetype2 disable freetype2 TTF library usage [autodetect]
|
2011-07-25 20:54:32 +00:00
|
|
|
|
2017-10-28 17:16:25 +00:00
|
|
|
--with-nasm-prefix=DIR prefix where nasm executable is installed (optional)
|
2004-05-21 02:08:48 +00:00
|
|
|
--disable-nasm disable assembly language optimizations [autodetect]
|
2004-02-13 00:53:56 +00:00
|
|
|
|
2017-10-28 17:16:25 +00:00
|
|
|
--with-readline-prefix=DIR prefix where readline is installed (optional)
|
2009-08-22 15:11:50 +00:00
|
|
|
--disable-readline disable readline support in text console [autodetect]
|
2009-07-25 23:36:24 +00:00
|
|
|
|
2017-10-28 17:16:25 +00:00
|
|
|
--with-libunity-prefix=DIR prefix where libunity is installed (optional)
|
|
|
|
--disable-libunity disable Unity launcher integration [autodetect]
|
2011-04-01 05:30:12 +00:00
|
|
|
|
2020-03-18 15:59:32 +00:00
|
|
|
--with-gtk-prefix=DIR prefix where gtk is installed (optional)
|
|
|
|
--disable-gtk disable GTK dialog integration [autodetect]
|
|
|
|
|
2017-10-28 17:16:25 +00:00
|
|
|
--with-sndio-prefix=DIR prefix where sndio is installed (optional)
|
2012-05-14 13:37:30 +00:00
|
|
|
--disable-sndio disable sndio MIDI driver [autodetect]
|
|
|
|
|
2017-10-28 17:16:25 +00:00
|
|
|
--with-sdlnet-prefix=DIR prefix where SDL_Net is installed (optional)
|
2016-05-27 15:58:36 +00:00
|
|
|
--disable-sdlnet disable SDL_Net networking library [autodetect]
|
2017-10-28 17:18:24 +00:00
|
|
|
|
|
|
|
--with-libcurl-prefix=DIR prefix where libcurl is installed (optional)
|
2016-05-27 15:58:36 +00:00
|
|
|
--disable-libcurl disable libcurl networking library [autodetect]
|
|
|
|
|
2020-05-25 08:39:49 +00:00
|
|
|
--with-discord-prefix=DIR prefix where discord-rpc is installed (optional)
|
|
|
|
--disable-discord disable Discord rich presence integration [autodetect]
|
|
|
|
|
2004-02-13 00:53:56 +00:00
|
|
|
Some influential environment variables:
|
2018-07-30 11:41:34 +00:00
|
|
|
AR archiver command
|
|
|
|
AS assembler command
|
|
|
|
ASFLAGS assembler flags
|
CONFIGURE: Add an environemt variable that discards the --host option
In the previous commit we modified the configure script to silently
ignore some options, that are not needed for ScummVM, but are valid
for the configure script generated by GNU Autotools, so the configure
macro for RPM-based distributions can be used when building a rpm
package for them.
Unfortunately the configure script, as used by ScummVM uses the --host
option to determine the target system it will actually be build for.
Autotools based configure scripts have a --target option for such a
purpose, and use the --host option to determine the system the build
is performed on.
For that reason there should be a way to discard the parameters passed
to the configure script with the --host option. The easiest approach
to achieve this goal, is to have an environment variable, which when
set influences the configure script to ignore the parameters of the
--host option.
Thus we introduced a variable called 'CONFIGURE_NO_HOST', that will
when set to anything, but an empty value, before invoking the configure
script, have the parameters of the --host option take no influence on
the configure stage (and the build stage as well).
2020-02-21 22:34:22 +00:00
|
|
|
CONFIGURE_NO_HOST Ignore the cross-compile target set by the --host= option
|
2018-07-30 11:41:34 +00:00
|
|
|
CPPFLAGS C++ preprocessor flags, e.g. -I<include dir> if you have
|
|
|
|
headers in a nonstandard directory <include dir>
|
|
|
|
CXX C++ compiler command
|
|
|
|
CXXFLAGS C++ compiler flags
|
2017-12-04 02:48:32 +00:00
|
|
|
DWP DWARF packing utility command
|
2018-07-30 11:41:34 +00:00
|
|
|
LD linker command
|
|
|
|
LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
|
|
|
|
nonstandard directory <lib dir>
|
2021-07-30 13:17:07 +00:00
|
|
|
PKG_CONFIG_LIBDIR list of directories where pkg-config '.pc' files are
|
2018-07-30 11:41:34 +00:00
|
|
|
looked up
|
|
|
|
RANLIB archive indexer command
|
|
|
|
SDL_CONFIG SDL configurer script name (not path)
|
|
|
|
STRIP symbol stripper command
|
|
|
|
WINDRES Windows resource compiler command
|
|
|
|
WINDRESFLAGS Windows resource compiler flags
|
2004-02-13 00:53:56 +00:00
|
|
|
|
2003-05-18 05:43:52 +00:00
|
|
|
EOF
|
2007-11-01 21:03:16 +00:00
|
|
|
exit 0
|
|
|
|
fi
|
2003-05-18 05:43:52 +00:00
|
|
|
done # for parm in ...
|
|
|
|
|
2016-06-27 20:19:02 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# 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:
|
2017-11-01 22:15:35 +00:00
|
|
|
AR="$SAVED_AR" AS="$SAVED_AS" ASFLAGS="$SAVED_ASFLAGS" CPPFLAGS="$SAVED_CPPFLAGS" CXX="$SAVED_CXX" CXXFLAGS="$SAVED_CXXFLAGS" DWP="$SAVED_DWP" LD="$SAVED_LD" LDFLAGS="$SAVED_LDFLAGS" PKG_CONFIG_LIBDIR="$SAVED_PKG_CONFIG_LIBDIR" RANLIB="$SAVED_RANLIB" SDL_CONFIG="$SAVED_SDL_CONFIG" STRIP="$SAVED_STRIP" WINDRES="$SAVED_WINDRES" WINDRESFLAGS="$SAVED_WINDRESFLAGS"
|
2016-06-27 20:19:02 +00:00
|
|
|
EOF
|
|
|
|
|
|
|
|
|
2003-05-26 05:18:40 +00:00
|
|
|
for ac_option in $@; do
|
2007-11-01 21:03:16 +00:00
|
|
|
case "$ac_option" in
|
2020-02-21 22:16:45 +00:00
|
|
|
# Silently ignore options valid for Autotools configure.
|
|
|
|
--build=*) ;;
|
|
|
|
--program-prefix=*) ;;
|
|
|
|
--sbindir=*) ;;
|
|
|
|
--sysconfdir=*) ;;
|
|
|
|
--includedir=*) ;;
|
|
|
|
--libexecdir=*) ;;
|
|
|
|
--localstatedir=*) ;;
|
|
|
|
--sharedstatedir=*) ;;
|
|
|
|
--infodir=*) ;;
|
|
|
|
--disable-dependency-tracking) ;;
|
|
|
|
--enable-dependency-tracking) ;;
|
|
|
|
# End of ignored options.
|
2019-04-27 20:51:29 +00:00
|
|
|
--enable-static) _static_build=yes ;;
|
2020-08-25 13:59:13 +00:00
|
|
|
--enable-detection-static) _detection_features_static=yes;;
|
|
|
|
--enable-detection-dynamic) _detection_features_static=no;;
|
2020-12-06 14:28:08 +00:00
|
|
|
--enable-detection-full) _detection_features_full=yes;;
|
|
|
|
--disable-detection-full) _detection_features_full=no;;
|
2019-04-27 20:51:29 +00:00
|
|
|
--disable-16bit) _16bit=no ;;
|
|
|
|
--enable-highres) _highres=yes ;;
|
|
|
|
--disable-highres) _highres=no ;;
|
2011-09-22 18:32:48 +00:00
|
|
|
--disable-savegame-timestamp) _savegame_timestamp=no ;;
|
2019-04-27 20:51:29 +00:00
|
|
|
--disable-scalers) _build_scalers=no ;;
|
|
|
|
--disable-hq-scalers) _build_hq_scalers=no ;;
|
2012-08-14 06:43:01 +00:00
|
|
|
--disable-edge-scalers) _build_edge_scalers=no ;;
|
2012-08-25 16:16:46 +00:00
|
|
|
--disable-aspect) _build_aspect=no ;;
|
2019-04-27 20:51:29 +00:00
|
|
|
--enable-alsa) _alsa=yes ;;
|
|
|
|
--disable-alsa) _alsa=no ;;
|
|
|
|
--enable-seq-midi) _seq_midi=yes ;;
|
|
|
|
--disable-seq-midi) _seq_midi=no ;;
|
|
|
|
--enable-sndio) _sndio=yes ;;
|
|
|
|
--disable-sndio) _sndio=no ;;
|
|
|
|
--enable-timidity) _timidity=yes ;;
|
|
|
|
--disable-timidity) _timidity=no ;;
|
|
|
|
--enable-ogg) _ogg=yes ;;
|
|
|
|
--disable-ogg) _ogg=no ;;
|
|
|
|
--enable-vorbis) _vorbis=yes ;;
|
|
|
|
--disable-vorbis) _vorbis=no ;;
|
|
|
|
--enable-tremor) _tremor=yes ;;
|
|
|
|
--disable-tremor) _tremor=no ;;
|
|
|
|
--enable-opl2lpt) _opl2lpt=yes ;;
|
|
|
|
--disable-opl2lpt) _opl2lpt=no ;;
|
2022-01-29 16:33:29 +00:00
|
|
|
--enable-retrowave) _retrowave=yes ;;
|
|
|
|
--disable-retrowave) _retrowave=no ;;
|
2019-04-27 20:51:29 +00:00
|
|
|
--enable-flac) _flac=yes ;;
|
|
|
|
--disable-flac) _flac=no ;;
|
|
|
|
--enable-mad) _mad=yes ;;
|
|
|
|
--disable-mad) _mad=no ;;
|
2020-04-26 11:38:31 +00:00
|
|
|
--enable-fribidi) _fribidi=yes ;;
|
|
|
|
--disable-fribidi) _fribidi=no ;;
|
2020-05-29 18:21:21 +00:00
|
|
|
--enable-test-c++11) _test_cxx11=yes ;;
|
|
|
|
--disable-test-c++11) _test_cxx11=no ;;
|
2019-04-27 20:51:29 +00:00
|
|
|
--enable-zlib) _zlib=yes ;;
|
|
|
|
--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 ;;
|
|
|
|
--disable-mpeg2) _mpeg2=no ;;
|
|
|
|
--enable-a52) _a52=yes ;;
|
|
|
|
--disable-a52) _a52=no ;;
|
|
|
|
--disable-jpeg) _jpeg=no ;;
|
|
|
|
--enable-jpeg) _jpeg=yes ;;
|
|
|
|
--disable-png) _png=no ;;
|
|
|
|
--enable-png) _png=yes ;;
|
2021-04-04 11:05:28 +00:00
|
|
|
--disable-gif) _gif=no ;;
|
|
|
|
--enable-gif) _gif=yes ;;
|
2019-04-27 20:51:29 +00:00
|
|
|
--disable-theoradec) _theoradec=no ;;
|
|
|
|
--enable-theoradec) _theoradec=yes ;;
|
|
|
|
--disable-faad) _faad=no ;;
|
|
|
|
--enable-faad) _faad=yes ;;
|
|
|
|
--disable-fluidsynth) _fluidsynth=no ;;
|
2021-02-14 23:29:02 +00:00
|
|
|
--enable-fluidsynth) _fluidsynth=yes ;;
|
|
|
|
--disable-fluidlite) _fluidlite=no ;;
|
|
|
|
--enable-fluidlite) _fluidlite=yes ;;
|
2019-04-27 20:51:29 +00:00
|
|
|
--enable-readline) _readline=yes ;;
|
|
|
|
--disable-readline) _readline=no ;;
|
|
|
|
--enable-freetype2) _freetype2=yes ;;
|
|
|
|
--disable-freetype2) _freetype2=no ;;
|
|
|
|
--enable-taskbar) _taskbar=yes ;;
|
|
|
|
--disable-taskbar) _taskbar=no ;;
|
|
|
|
--enable-system-dialogs) _dialogs=yes ;;
|
|
|
|
--disable-system-dialogs) _dialogs=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 ;;
|
2021-03-09 21:35:06 +00:00
|
|
|
--enable-lld) _lld=yes ;;
|
2021-04-13 19:41:03 +00:00
|
|
|
--disable-lld) _lld=no ;;
|
2022-02-16 15:50:24 +00:00
|
|
|
--enable-mold) _mold=yes ;;
|
|
|
|
--disable-mold) _mold=no ;;
|
2021-04-13 19:41:03 +00:00
|
|
|
--enable-gold) _gold=yes ;;
|
|
|
|
--disable-gold) _gold=no ;;
|
2019-04-27 20:51:29 +00:00
|
|
|
--enable-updates) _updates=yes ;;
|
2019-05-02 18:00:37 +00:00
|
|
|
--disable-updates) _updates=no ;;
|
2019-04-27 20:51:29 +00:00
|
|
|
--enable-libunity) _libunity=yes ;;
|
|
|
|
--disable-libunity) _libunity=no ;;
|
2019-07-10 08:49:29 +00:00
|
|
|
--enable-tts) _tts=yes ;;
|
|
|
|
--disable-tts) _tts=no ;;
|
2020-03-18 15:59:32 +00:00
|
|
|
--enable-gtk) _gtk=yes ;;
|
|
|
|
--disable-gtk) _gtk=no ;;
|
2022-01-04 22:04:05 +00:00
|
|
|
--opengl-mode=*)
|
|
|
|
_opengl_mode=`echo $ac_option | cut -d '=' -f 2`
|
|
|
|
;;
|
|
|
|
--disable-opengl-game)
|
|
|
|
_opengl_game_classic=no
|
|
|
|
_opengl_game_shaders=no
|
|
|
|
;;
|
2021-11-17 23:56:21 +00:00
|
|
|
--disable-opengl-game-classic) _opengl_game_classic=no ;;
|
2020-10-14 16:37:17 +00:00
|
|
|
--disable-opengl-game-shaders) _opengl_game_shaders=no ;;
|
2020-10-14 18:31:22 +00:00
|
|
|
--enable-tinygl) _tinygl=yes ;;
|
|
|
|
--disable-tinygl) _tinygl=no ;;
|
2019-04-27 20:51:29 +00:00
|
|
|
--enable-bink) _bink=yes ;;
|
|
|
|
--disable-bink) _bink=no ;;
|
2020-05-25 08:39:49 +00:00
|
|
|
--enable-discord) _discord=yes ;;
|
|
|
|
--disable-discord) _discord=no ;;
|
2019-04-27 20:51:29 +00:00
|
|
|
--enable-verbose-build) _verbose_build=yes ;;
|
CONFIGURE: Allow Cygwin as development platform.
I would like to suggest to allow the use of Cygwin as development platform.
This is not intended for providing builds for this environment (although SCUMMVM can be already built on it without problems), but for having an easy way for testing POSIX code on Windows.
There could be some alternatives, like the (defunt) Microsoft POSIX subsystem, the (also defunct) Windows Services for UNIX or the WSL1 and WSL2, but they are all painful experiences, at least for me, especially when debugging graphical applications connected to an X server or working with physical devices (try to believe). Alternatively, it is also possible to make a full virtual machine by using emulators like QEMU, but it has not the same advantages of having the code running natively, especially when sharing the same files..
So, this should be seen as a tool for developers, nothing more than that, because at the time of writing this seems to be the best and most comfortable way for debugging a change to the ports using POSIX code.
However, to avoid unintentional execution, the user must activate the support for Cygwin by providing --enable-cygwin-build at configure time, otherwise the process will halt again.
Even when support for Cygwin is activated, a warning message is still shown to the user, for informing him on what he is doing.
2022-12-17 13:22:30 +00:00
|
|
|
--enable-cygwin-build) _cygwin_build=yes ;;
|
2019-04-27 20:51:29 +00:00
|
|
|
--enable-plugins) _dynamic_modules=yes ;;
|
|
|
|
--default-dynamic) _plugins_default=dynamic;;
|
|
|
|
--enable-mt32emu) _mt32emu=yes ;;
|
|
|
|
--disable-mt32emu) _mt32emu=no ;;
|
2019-03-08 21:11:35 +00:00
|
|
|
--enable-lua) _lua=yes ;;
|
|
|
|
--disable-lua) _lua=no ;;
|
2019-04-27 20:51:29 +00:00
|
|
|
--enable-nuked-opl) _nuked_opl=yes ;;
|
|
|
|
--disable-nuked-opl) _nuked_opl=no ;;
|
|
|
|
--enable-translation) _translation=yes ;;
|
|
|
|
--disable-translation) _translation=no ;;
|
|
|
|
--enable-vkeybd) _vkeybd=yes ;;
|
|
|
|
--disable-vkeybd) _vkeybd=no ;;
|
|
|
|
--enable-eventrecorder) _eventrec=yes ;;
|
|
|
|
--disable-eventrecorder) _eventrec=no ;;
|
|
|
|
--enable-text-console) _text_console=yes ;;
|
|
|
|
--disable-text-console) _text_console=no ;;
|
2007-11-01 21:03:16 +00:00
|
|
|
--with-fluidsynth-prefix=*)
|
|
|
|
arg=`echo $ac_option | cut -d '=' -f 2`
|
|
|
|
FLUIDSYNTH_CFLAGS="-I$arg/include"
|
|
|
|
FLUIDSYNTH_LIBS="-L$arg/lib"
|
|
|
|
;;
|
2021-02-14 23:29:02 +00:00
|
|
|
--with-fluidlite-prefix=*)
|
|
|
|
arg=`echo $ac_option | cut -d '=' -f 2`
|
|
|
|
FLUIDLITE_CFLAGS="-I$arg/include"
|
|
|
|
FLUIDLITE_LIBS="-L$arg/lib"
|
|
|
|
;;
|
2012-11-19 18:13:36 +00:00
|
|
|
--with-mpeg2-prefix=*)
|
|
|
|
arg=`echo $ac_option | cut -d '=' -f 2`
|
|
|
|
MPEG2_CFLAGS="-I$arg/include"
|
|
|
|
MPEG2_LIBS="-L$arg/lib"
|
|
|
|
;;
|
2015-08-01 18:11:50 +00:00
|
|
|
--with-a52-prefix=*)
|
|
|
|
arg=`echo $ac_option | cut -d '=' -f 2`
|
|
|
|
A52_CFLAGS="-I$arg/include"
|
|
|
|
A52_LIBS="-L$arg/lib"
|
|
|
|
;;
|
2007-11-01 21:03:16 +00:00
|
|
|
--with-alsa-prefix=*)
|
|
|
|
arg=`echo $ac_option | cut -d '=' -f 2`
|
|
|
|
ALSA_CFLAGS="-I$arg/include"
|
|
|
|
ALSA_LIBS="-L$arg/lib"
|
|
|
|
;;
|
2012-05-14 13:37:30 +00:00
|
|
|
--with-sndio-prefix=*)
|
|
|
|
arg=`echo $ac_option | cut -d '=' -f 2`
|
|
|
|
SNDIO_CFLAGS="-I$arg/include"
|
|
|
|
SNDIO_LIBS="-L$arg/lib"
|
|
|
|
;;
|
2007-11-01 21:03:16 +00:00
|
|
|
--with-ogg-prefix=*)
|
|
|
|
arg=`echo $ac_option | cut -d '=' -f 2`
|
|
|
|
OGG_CFLAGS="-I$arg/include"
|
|
|
|
OGG_LIBS="-L$arg/lib"
|
|
|
|
;;
|
|
|
|
--with-vorbis-prefix=*)
|
|
|
|
arg=`echo $ac_option | cut -d '=' -f 2`
|
|
|
|
VORBIS_CFLAGS="-I$arg/include"
|
|
|
|
VORBIS_LIBS="-L$arg/lib"
|
|
|
|
;;
|
|
|
|
--with-tremor-prefix=*)
|
|
|
|
arg=`echo $ac_option | cut -d '=' -f 2`
|
|
|
|
TREMOR_CFLAGS="-I$arg/include"
|
|
|
|
TREMOR_LIBS="-L$arg/lib"
|
|
|
|
;;
|
2018-02-17 11:50:19 +00:00
|
|
|
--with-ieee1284-prefix=*)
|
|
|
|
arg=`echo $ac_option | cut -d '=' -f 2`
|
|
|
|
IEEE1284_CFLAGS="-I$arg/include"
|
|
|
|
IEEE1284_LIBS="-L$arg/lib"
|
|
|
|
;;
|
2022-01-29 16:33:29 +00:00
|
|
|
--with-retrowave-prefix=*)
|
|
|
|
arg=`echo $ac_option | cut -d '=' -f 2`
|
|
|
|
RETROWAVE_CFLAGS="-I$arg/include"
|
|
|
|
RETROWAVE_LIBS="-L$arg/lib"
|
|
|
|
;;
|
2007-11-01 21:03:16 +00:00
|
|
|
--with-flac-prefix=*)
|
|
|
|
arg=`echo $ac_option | cut -d '=' -f 2`
|
|
|
|
FLAC_CFLAGS="-I$arg/include"
|
|
|
|
FLAC_LIBS="-L$arg/lib"
|
|
|
|
;;
|
|
|
|
--with-mad-prefix=*)
|
|
|
|
arg=`echo $ac_option | cut -d '=' -f 2`
|
|
|
|
MAD_CFLAGS="-I$arg/include"
|
|
|
|
MAD_LIBS="-L$arg/lib"
|
|
|
|
;;
|
2020-04-26 11:38:31 +00:00
|
|
|
--with-fribidi-prefix=*)
|
|
|
|
arg=`echo $ac_option | cut -d '=' -f 2`
|
|
|
|
FRIBIDI_CFLAGS="-I$arg/include"
|
|
|
|
FRIBIDI_LIBS="-L$arg/lib"
|
|
|
|
;;
|
2013-08-11 21:36:57 +00:00
|
|
|
--with-jpeg-prefix=*)
|
|
|
|
arg=`echo $ac_option | cut -d '=' -f 2`
|
|
|
|
JPEG_CFLAGS="-I$arg/include"
|
|
|
|
JPEG_LIBS="-L$arg/lib"
|
|
|
|
;;
|
2010-10-12 21:12:50 +00:00
|
|
|
--with-png-prefix=*)
|
|
|
|
arg=`echo $ac_option | cut -d '=' -f 2`
|
|
|
|
PNG_CFLAGS="-I$arg/include"
|
|
|
|
PNG_LIBS="-L$arg/lib"
|
|
|
|
;;
|
2021-04-10 16:42:43 +00:00
|
|
|
--with-gif-prefix=*)
|
|
|
|
arg=`echo $ac_option | cut -d '=' -f 2`
|
|
|
|
GIF_CFLAGS="-I$arg/include"
|
|
|
|
GIF_LIBS="-L$arg/lib"
|
|
|
|
;;
|
2010-10-12 21:12:50 +00:00
|
|
|
--with-theoradec-prefix=*)
|
|
|
|
arg=`echo $ac_option | cut -d '=' -f 2`
|
|
|
|
THEORADEC_CFLAGS="-I$arg/include"
|
|
|
|
THEORADEC_LIBS="-L$arg/lib"
|
|
|
|
;;
|
2011-04-09 19:27:23 +00:00
|
|
|
--with-faad-prefix=*)
|
|
|
|
arg=`echo $ac_option | cut -d '=' -f 2`
|
|
|
|
FAAD_CFLAGS="-I$arg/include"
|
|
|
|
FAAD_LIBS="-L$arg/lib"
|
|
|
|
;;
|
2007-11-01 21:03:16 +00:00
|
|
|
--with-zlib-prefix=*)
|
|
|
|
arg=`echo $ac_option | cut -d '=' -f 2`
|
|
|
|
ZLIB_CFLAGS="-I$arg/include"
|
|
|
|
ZLIB_LIBS="-L$arg/lib"
|
|
|
|
;;
|
2011-07-03 21:01:17 +00:00
|
|
|
--with-sparkle-prefix=*)
|
|
|
|
arg=`echo $ac_option | cut -d '=' -f 2`
|
2016-03-27 12:04:42 +00:00
|
|
|
_sparklepath=$arg
|
2011-07-03 21:01:17 +00:00
|
|
|
;;
|
2009-07-25 23:36:24 +00:00
|
|
|
--with-readline-prefix=*)
|
|
|
|
arg=`echo $ac_option | cut -d '=' -f 2`
|
|
|
|
READLINE_CFLAGS="-I$arg/include"
|
|
|
|
READLINE_LIBS="-L$arg/lib"
|
|
|
|
;;
|
2011-04-29 15:54:09 +00:00
|
|
|
--with-libunity-prefix=*)
|
2011-04-01 05:30:12 +00:00
|
|
|
arg=`echo $ac_option | cut -d '=' -f 2`
|
2011-04-29 15:54:09 +00:00
|
|
|
LIBUNITY_CFLAGS="-I$arg/include"
|
|
|
|
LIBUNITY_LIBS="-L$arg/lib"
|
2011-04-01 05:30:12 +00:00
|
|
|
;;
|
2020-03-18 15:59:32 +00:00
|
|
|
--with-gtk-prefix=*)
|
|
|
|
arg=`echo $ac_option | cut -d '=' -f 2`
|
|
|
|
GTK_CFLAGS="-I$arg/include"
|
|
|
|
GTK_LIBS="-L$arg/lib"
|
|
|
|
;;
|
2016-06-15 08:49:01 +00:00
|
|
|
--with-sdlnet-prefix=*)
|
|
|
|
arg=`echo $ac_option | cut -d '=' -f 2`
|
|
|
|
SDL_NET_CFLAGS="-I$arg/include"
|
|
|
|
SDL_NET_LIBS="-L$arg/lib"
|
|
|
|
;;
|
2014-02-16 07:03:17 +00:00
|
|
|
--with-opengl-prefix=*)
|
|
|
|
arg=`echo $ac_option | cut -d '=' -f 2`
|
|
|
|
OPENGL_CFLAGS="-I$arg/include"
|
|
|
|
OPENGL_LIBS="-L$arg/lib"
|
|
|
|
;;
|
2020-05-25 08:39:49 +00:00
|
|
|
--with-discord-prefix=*)
|
|
|
|
arg=`echo $ac_option | cut -d '=' -f 2`
|
|
|
|
DISCORD_CFLAGS="-I$arg/include"
|
|
|
|
DISCORD_LIBS="-L$arg/lib"
|
|
|
|
;;
|
2007-11-01 21:03:16 +00:00
|
|
|
--backend=*)
|
|
|
|
_backend=`echo $ac_option | cut -d '=' -f 2`
|
|
|
|
;;
|
|
|
|
--enable-debug)
|
2009-10-13 18:50:46 +00:00
|
|
|
_debug_build=yes
|
2007-11-01 21:03:16 +00:00
|
|
|
;;
|
|
|
|
--disable-debug)
|
2009-10-13 18:50:46 +00:00
|
|
|
_debug_build=no
|
2007-11-01 21:03:16 +00:00
|
|
|
;;
|
|
|
|
--enable-Werror)
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var CXXFLAGS "-Werror"
|
2007-11-01 21:03:16 +00:00
|
|
|
;;
|
2011-10-07 22:45:56 +00:00
|
|
|
--enable-release-mode)
|
|
|
|
_release_build=yes
|
|
|
|
;;
|
|
|
|
--disable-release-mode)
|
|
|
|
_release_build=no
|
|
|
|
;;
|
2007-11-01 21:03:16 +00:00
|
|
|
--enable-release)
|
2009-10-13 18:50:46 +00:00
|
|
|
_release_build=yes
|
2011-10-09 18:13:35 +00:00
|
|
|
_optimizations=yes
|
2020-08-26 22:34:11 +00:00
|
|
|
_updates=yes
|
2009-10-13 18:50:46 +00:00
|
|
|
;;
|
|
|
|
--disable-release)
|
|
|
|
_release_build=no
|
2011-10-09 18:13:35 +00:00
|
|
|
_optimizations=no
|
2011-10-07 22:45:56 +00:00
|
|
|
;;
|
2011-10-09 18:13:35 +00:00
|
|
|
--enable-optimizations)
|
|
|
|
_optimizations=yes
|
2011-10-07 22:45:56 +00:00
|
|
|
;;
|
2011-10-09 18:13:35 +00:00
|
|
|
--disable-optimizations)
|
|
|
|
_optimizations=no
|
2007-11-01 21:03:16 +00:00
|
|
|
;;
|
2008-07-09 02:19:57 +00:00
|
|
|
--enable-profiling)
|
2010-04-26 12:11:19 +00:00
|
|
|
_enable_prof=yes
|
2008-07-09 02:19:57 +00:00
|
|
|
;;
|
2020-01-20 17:37:23 +00:00
|
|
|
--enable-asan)
|
|
|
|
_enable_asan=yes
|
|
|
|
;;
|
2020-08-19 10:08:53 +00:00
|
|
|
--enable-tsan)
|
|
|
|
_enable_tsan=yes
|
|
|
|
;;
|
2022-01-03 11:46:13 +00:00
|
|
|
--enable-ubsan)
|
|
|
|
_enable_ubsan=yes
|
|
|
|
;;
|
2020-09-20 21:01:12 +00:00
|
|
|
--no-builtin-resources)
|
|
|
|
_builtin_resources=no
|
|
|
|
;;
|
2021-06-30 19:54:51 +00:00
|
|
|
--enable-windows-console)
|
|
|
|
_windows_console=yes
|
|
|
|
;;
|
|
|
|
--disable-windows-console)
|
|
|
|
_windows_console=no
|
|
|
|
;;
|
2021-05-07 05:21:14 +00:00
|
|
|
--enable-windows-unicode)
|
|
|
|
_windows_unicode=yes
|
|
|
|
;;
|
|
|
|
--disable-windows-unicode)
|
|
|
|
_windows_unicode=no
|
|
|
|
;;
|
2007-11-01 21:03:16 +00:00
|
|
|
--with-sdl-prefix=*)
|
|
|
|
arg=`echo $ac_option | cut -d '=' -f 2`
|
|
|
|
_sdlpath="$arg:$arg/bin"
|
|
|
|
;;
|
2011-07-25 20:54:32 +00:00
|
|
|
--with-freetype2-prefix=*)
|
|
|
|
arg=`echo $ac_option | cut -d '=' -f 2`
|
|
|
|
_freetypepath="$arg:$arg/bin"
|
|
|
|
;;
|
2017-10-28 17:18:24 +00:00
|
|
|
--with-libcurl-prefix=*)
|
|
|
|
arg=`echo $ac_option | cut -d '=' -f 2`
|
|
|
|
_libcurlpath="$arg:$arg/bin"
|
|
|
|
;;
|
2007-11-01 21:03:16 +00:00
|
|
|
--with-nasm-prefix=*)
|
|
|
|
arg=`echo $ac_option | cut -d '=' -f 2`
|
|
|
|
_nasmpath="$arg:$arg/bin"
|
|
|
|
;;
|
2018-12-19 14:17:14 +00:00
|
|
|
--with-pandoc-format=*)
|
|
|
|
arg=`echo $ac_option | cut -d '=' -f 2`
|
|
|
|
_pandocformat="$arg"
|
|
|
|
_pandoc=yes
|
|
|
|
;;
|
2021-04-01 23:36:19 +00:00
|
|
|
--with-manual-version=*)
|
|
|
|
arg=`echo $ac_option | cut -d '=' -f 2`
|
|
|
|
_manualversion="$arg"
|
|
|
|
;;
|
2009-03-19 20:53:33 +00:00
|
|
|
--with-staticlib-prefix=*)
|
|
|
|
_staticlibpath=`echo $ac_option | cut -d '=' -f 2`
|
|
|
|
;;
|
2016-03-05 23:07:21 +00:00
|
|
|
--with-xcodetools-path=*)
|
|
|
|
_xcodetoolspath=`echo $ac_option | cut -d '=' -f 2`
|
|
|
|
;;
|
2007-11-01 21:03:16 +00:00
|
|
|
--host=*)
|
CONFIGURE: Add an environemt variable that discards the --host option
In the previous commit we modified the configure script to silently
ignore some options, that are not needed for ScummVM, but are valid
for the configure script generated by GNU Autotools, so the configure
macro for RPM-based distributions can be used when building a rpm
package for them.
Unfortunately the configure script, as used by ScummVM uses the --host
option to determine the target system it will actually be build for.
Autotools based configure scripts have a --target option for such a
purpose, and use the --host option to determine the system the build
is performed on.
For that reason there should be a way to discard the parameters passed
to the configure script with the --host option. The easiest approach
to achieve this goal, is to have an environment variable, which when
set influences the configure script to ignore the parameters of the
--host option.
Thus we introduced a variable called 'CONFIGURE_NO_HOST', that will
when set to anything, but an empty value, before invoking the configure
script, have the parameters of the --host option take no influence on
the configure stage (and the build stage as well).
2020-02-21 22:34:22 +00:00
|
|
|
if test -z "$CONFIGURE_NO_HOST"; then
|
|
|
|
_host=`echo $ac_option | cut -d '=' -f 2`
|
|
|
|
else
|
|
|
|
echo "Ignoring --host option!" >&2
|
|
|
|
fi
|
2007-11-01 21:03:16 +00:00
|
|
|
;;
|
|
|
|
--prefix=*)
|
2010-05-09 20:42:18 +00:00
|
|
|
prefix=`echo $ac_option | cut -d '=' -f 2`
|
2007-11-01 21:03:16 +00:00
|
|
|
;;
|
2010-10-11 19:50:17 +00:00
|
|
|
--exec-prefix=*)
|
|
|
|
exec_prefix=`echo $ac_option | cut -d '=' -f 2`
|
|
|
|
;;
|
2007-11-01 21:03:16 +00:00
|
|
|
--bindir=*)
|
2010-05-09 20:42:18 +00:00
|
|
|
bindir=`echo $ac_option | cut -d '=' -f 2`
|
2007-11-01 21:03:16 +00:00
|
|
|
;;
|
2010-10-11 19:50:17 +00:00
|
|
|
--libdir=*)
|
|
|
|
libdir=`echo $ac_option | cut -d '=' -f 2`
|
2010-05-09 20:42:18 +00:00
|
|
|
;;
|
|
|
|
--datarootdir=*)
|
|
|
|
datarootdir=`echo $ac_option | cut -d '=' -f 2`
|
2007-11-01 21:03:16 +00:00
|
|
|
;;
|
|
|
|
--datadir=*)
|
2010-05-09 20:42:18 +00:00
|
|
|
datadir=`echo $ac_option | cut -d '=' -f 2`
|
2007-11-01 21:03:16 +00:00
|
|
|
;;
|
2010-10-11 19:50:17 +00:00
|
|
|
--mandir=*)
|
|
|
|
mandir=`echo $ac_option | cut -d '=' -f 2`
|
|
|
|
;;
|
|
|
|
--docdir=*)
|
|
|
|
docdir=`echo $ac_option | cut -d '=' -f 2`
|
2008-05-02 14:30:06 +00:00
|
|
|
;;
|
2009-03-13 16:31:53 +00:00
|
|
|
--enable-all-engines)
|
|
|
|
engine_enable_all
|
|
|
|
;;
|
|
|
|
--disable-all-engines)
|
|
|
|
engine_disable_all
|
|
|
|
;;
|
2019-06-18 15:15:21 +00:00
|
|
|
--enable-all-unstable-engines)
|
|
|
|
engine_enable_all_unstable
|
|
|
|
;;
|
2019-06-06 22:41:47 +00:00
|
|
|
--disable-all-unstable-engines)
|
|
|
|
engine_disable_all_unstable
|
|
|
|
;;
|
2011-11-26 12:15:05 +00:00
|
|
|
--enable-engine=* | --enable-engines=*)
|
2011-11-20 05:20:31 +00:00
|
|
|
for engine_name in `echo $ac_option | cut -d '=' -f 2- | tr ',' '\n'`; do
|
|
|
|
engine_enable "${engine_name}"
|
|
|
|
done
|
|
|
|
;;
|
2011-11-26 12:15:05 +00:00
|
|
|
--enable-engine-static=* | --enable-engines-static=*)
|
2011-11-20 05:20:31 +00:00
|
|
|
for engine_name in `echo $ac_option | cut -d '=' -f 2- | tr ',' '\n'`; do
|
|
|
|
engine_enable "${engine_name}:static"
|
|
|
|
done
|
2007-11-01 21:03:16 +00:00
|
|
|
;;
|
2011-11-26 12:15:05 +00:00
|
|
|
--enable-engine-dynamic=* | --enable-engines-dynamic=*)
|
2011-11-20 05:20:31 +00:00
|
|
|
for engine_name in `echo $ac_option | cut -d '=' -f 2- | tr ',' '\n'`; do
|
|
|
|
engine_enable "${engine_name}:dynamic"
|
|
|
|
done
|
|
|
|
;;
|
2011-11-26 12:15:05 +00:00
|
|
|
--disable-engine=* | --disable-engines=*)
|
2011-11-20 05:20:31 +00:00
|
|
|
for engine_name in `echo $ac_option | cut -d '=' -f 2 | tr ',' '\n'`; do
|
|
|
|
engine_disable ${engine_name}
|
|
|
|
done
|
2007-11-01 21:03:16 +00:00
|
|
|
;;
|
|
|
|
*)
|
2008-05-06 03:00:26 +00:00
|
|
|
option_error
|
2007-11-01 21:03:16 +00:00
|
|
|
;;
|
|
|
|
esac;
|
2002-08-24 15:24:38 +00:00
|
|
|
done;
|
|
|
|
|
2009-03-23 17:40:46 +00:00
|
|
|
guessed_host=`$_srcdir/config.guess`
|
|
|
|
get_system_exe_extension $guessed_host
|
|
|
|
NATIVEEXEEXT=$_exeext
|
|
|
|
|
2004-12-16 22:05:45 +00:00
|
|
|
case $_host in
|
2016-04-14 04:39:27 +00:00
|
|
|
3ds)
|
|
|
|
_host_os=3ds
|
|
|
|
_host_cpu=arm
|
|
|
|
_host_alias=arm-none-eabi
|
2019-11-03 18:14:15 +00:00
|
|
|
|
|
|
|
test "x$prefix" = xNONE && prefix=romfs:
|
|
|
|
|
|
|
|
datarootdir='${prefix}'
|
|
|
|
datadir='${datarootdir}'
|
|
|
|
docdir='${prefix}/doc'
|
2016-04-14 04:39:27 +00:00
|
|
|
;;
|
2020-02-26 19:28:49 +00:00
|
|
|
android-arm-v7a | ouya)
|
2010-08-02 17:11:25 +00:00
|
|
|
_host_os=android
|
|
|
|
_host_cpu=arm
|
2011-02-06 14:23:47 +00:00
|
|
|
_host_alias=arm-linux-androideabi
|
2010-08-02 17:11:25 +00:00
|
|
|
;;
|
2019-05-08 18:10:14 +00:00
|
|
|
android-arm64-v8a)
|
|
|
|
_host_os=android
|
|
|
|
_host_cpu=aarch64
|
|
|
|
_host_alias=aarch64-linux-android
|
|
|
|
;;
|
2014-03-12 03:38:27 +00:00
|
|
|
android-x86)
|
|
|
|
_host_os=android
|
|
|
|
_host_cpu=i686
|
|
|
|
_host_alias=i686-linux-android
|
|
|
|
;;
|
2019-09-29 17:53:59 +00:00
|
|
|
android-x86_64)
|
|
|
|
_host_os=android
|
|
|
|
_host_cpu=x86_64
|
|
|
|
_host_alias=x86_64-linux-android
|
|
|
|
;;
|
2020-09-09 14:52:38 +00:00
|
|
|
arm-vfp-riscos)
|
|
|
|
_host_os=riscos
|
|
|
|
_host_cpu=arm
|
|
|
|
_host_alias=arm-unknown-riscos
|
|
|
|
datarootdir='/\<ScummVM\$$Dir\>'
|
|
|
|
datadir='${datarootdir}/data'
|
|
|
|
docdir='${datarootdir}/docs'
|
|
|
|
;;
|
2017-04-27 23:24:57 +00:00
|
|
|
arm-*riscos)
|
2004-12-16 22:15:32 +00:00
|
|
|
_host_os=riscos
|
|
|
|
_host_cpu=arm
|
2017-10-20 16:46:12 +00:00
|
|
|
_host_alias=$_host
|
2017-04-27 23:24:57 +00:00
|
|
|
datarootdir='/\<ScummVM\$$Dir\>'
|
|
|
|
datadir='${datarootdir}/data'
|
|
|
|
docdir='${datarootdir}/docs'
|
2004-12-16 22:15:32 +00:00
|
|
|
;;
|
2015-03-20 18:11:30 +00:00
|
|
|
raspberrypi)
|
|
|
|
_host_os=linux
|
|
|
|
_host_cpu=arm
|
2015-10-18 11:02:29 +00:00
|
|
|
# This tuple is the one used by the official Rpi toolchain.
|
|
|
|
# It may change in the future.
|
2016-02-15 22:32:06 +00:00
|
|
|
_host_alias=arm-linux-gnueabihf
|
2015-03-20 18:11:30 +00:00
|
|
|
;;
|
2010-08-26 11:28:30 +00:00
|
|
|
caanoo)
|
2010-09-20 19:33:58 +00:00
|
|
|
_host_os=gph-linux
|
2010-08-26 11:28:30 +00:00
|
|
|
_host_cpu=arm
|
|
|
|
_host_alias=arm-none-linux-gnueabi
|
|
|
|
;;
|
2021-11-11 10:24:37 +00:00
|
|
|
dingux | gcw0 | opendingux-*)
|
2010-08-19 12:43:37 +00:00
|
|
|
_host_os=linux
|
|
|
|
_host_cpu=mipsel
|
|
|
|
_host_alias=mipsel-linux
|
|
|
|
;;
|
2010-02-02 11:46:35 +00:00
|
|
|
dreamcast)
|
|
|
|
_host_os=dreamcast
|
|
|
|
_host_cpu=sh
|
|
|
|
_host_alias=sh-elf
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var CXXFLAGS "-ml -m4-single-only"
|
|
|
|
append_var LDFLAGS "-ml -m4-single-only"
|
2010-02-02 11:46:35 +00:00
|
|
|
;;
|
2010-08-02 17:11:25 +00:00
|
|
|
ds)
|
|
|
|
_host_os=ds
|
|
|
|
_host_cpu=arm
|
2017-11-14 23:00:56 +00:00
|
|
|
_host_alias=arm-none-eabi
|
2010-08-02 17:11:25 +00:00
|
|
|
;;
|
2010-02-02 11:46:35 +00:00
|
|
|
gamecube)
|
|
|
|
_host_os=gamecube
|
2015-01-18 21:58:03 +00:00
|
|
|
_host_cpu=powerpc
|
2014-01-25 09:49:57 +00:00
|
|
|
_host_alias=powerpc-eabi
|
2005-05-09 21:21:21 +00:00
|
|
|
;;
|
2010-02-02 11:46:35 +00:00
|
|
|
gp2x)
|
2010-09-20 19:33:58 +00:00
|
|
|
_host_os=gph-linux
|
2009-06-04 08:30:31 +00:00
|
|
|
_host_cpu=arm
|
|
|
|
_host_alias=arm-open2x-linux
|
2010-01-25 01:39:44 +00:00
|
|
|
;;
|
2010-02-02 11:46:35 +00:00
|
|
|
gp2xwiz)
|
2010-09-20 19:33:58 +00:00
|
|
|
_host_os=gph-linux
|
2006-10-06 19:01:39 +00:00
|
|
|
_host_cpu=arm
|
2009-03-27 14:12:42 +00:00
|
|
|
_host_alias=arm-open2x-linux
|
2006-10-06 19:01:39 +00:00
|
|
|
;;
|
2007-03-18 22:56:56 +00:00
|
|
|
i586-mingw32msvc)
|
|
|
|
_host_os=mingw32msvc
|
|
|
|
_host_cpu=i586
|
|
|
|
;;
|
2009-03-22 16:46:45 +00:00
|
|
|
iphone)
|
|
|
|
_host_os=iphone
|
|
|
|
_host_cpu=arm
|
2009-03-22 17:48:42 +00:00
|
|
|
_host_alias=arm-apple-darwin9
|
2009-03-22 16:46:45 +00:00
|
|
|
;;
|
2015-12-04 17:20:09 +00:00
|
|
|
ios7)
|
|
|
|
_host_os=iphone
|
|
|
|
_host_cpu=arm
|
|
|
|
_host_alias=arm-apple-darwin11
|
|
|
|
;;
|
2021-03-19 19:08:02 +00:00
|
|
|
ios7-arm64)
|
|
|
|
_host_os=iphone
|
2022-08-27 19:33:17 +00:00
|
|
|
# Remains of configure not knowing about arm64
|
2021-03-19 19:08:02 +00:00
|
|
|
_host_cpu=aarch64
|
|
|
|
_host_alias=arm64-apple-darwin11
|
|
|
|
;;
|
2011-07-05 06:52:42 +00:00
|
|
|
maemo)
|
|
|
|
_host_os=maemo
|
|
|
|
_host_cpu=arm
|
2017-12-07 07:03:28 +00:00
|
|
|
_host_alias=arm-none-linux-gnueabi
|
2011-07-05 06:52:42 +00:00
|
|
|
|
|
|
|
# The prefix is always the same on Maemo so we hardcode the default
|
|
|
|
# here. It is still possible to define a custom prefix which is
|
|
|
|
# needed when packaging the app with a user-specific app ID.
|
|
|
|
test "x$prefix" = xNONE && prefix=/opt/scummvm
|
|
|
|
# Maemo apps are installed into app-specific directories. The
|
|
|
|
# default directory structure of ScummVM makes no sense here so we
|
|
|
|
# hardcode Maemo specific directories here.
|
|
|
|
datarootdir='${prefix}/share'
|
|
|
|
datadir=/opt/scummvm/share
|
|
|
|
docdir='${datarootdir}/doc/scummvm'
|
|
|
|
;;
|
2010-10-12 02:18:11 +00:00
|
|
|
n64)
|
2010-08-01 17:16:39 +00:00
|
|
|
_host_os=n64
|
|
|
|
_host_cpu=mips
|
|
|
|
_host_alias=mips64
|
|
|
|
;;
|
2010-02-02 11:46:35 +00:00
|
|
|
neuros)
|
|
|
|
_host_os=linux
|
|
|
|
_host_cpu=arm
|
|
|
|
;;
|
2010-09-06 17:35:27 +00:00
|
|
|
openpandora)
|
2010-09-20 19:33:58 +00:00
|
|
|
_host_os=linux
|
2010-09-06 17:35:27 +00:00
|
|
|
_host_cpu=arm
|
|
|
|
_host_alias=arm-angstrom-linux-gnueabi
|
|
|
|
;;
|
2010-02-02 11:46:35 +00:00
|
|
|
ppc-amigaos)
|
|
|
|
_host_os=amigaos
|
2015-01-18 21:58:03 +00:00
|
|
|
_host_cpu=powerpc
|
2017-10-20 16:46:12 +00:00
|
|
|
_host_alias=$_host
|
2009-03-25 21:58:16 +00:00
|
|
|
;;
|
2019-05-12 09:06:37 +00:00
|
|
|
ppc-morphos)
|
|
|
|
_host_os=morphos
|
|
|
|
_host_cpu=powerpc
|
|
|
|
_host_alias=$_host
|
|
|
|
;;
|
2011-06-02 08:34:41 +00:00
|
|
|
ps3)
|
|
|
|
_host_os=ps3
|
2015-01-18 21:58:03 +00:00
|
|
|
_host_cpu=powerpc
|
2011-06-02 08:34:41 +00:00
|
|
|
_host_alias=powerpc64-ps3-elf
|
2011-08-08 19:09:48 +00:00
|
|
|
|
2011-06-02 08:34:41 +00:00
|
|
|
# The prefix is always the same on PS3 so we hardcode the default
|
|
|
|
# here. It is still possible to define a custom prefix which is
|
|
|
|
# needed when packaging the app with a user-specific app ID.
|
|
|
|
test "x$prefix" = xNONE && prefix=/dev_hdd0/game/SCUM12000/USRDIR
|
2011-08-08 19:09:48 +00:00
|
|
|
# PS3 apps are installed into app-specific directories. The
|
2011-06-02 08:34:41 +00:00
|
|
|
# default directory structure of ScummVM makes no sense here so we
|
|
|
|
# hardcode PS3 specific directories here.
|
|
|
|
datarootdir='${prefix}/data'
|
|
|
|
datadir='${datarootdir}'
|
|
|
|
docdir='${prefix}/doc'
|
|
|
|
;;
|
2017-03-01 20:00:17 +00:00
|
|
|
psp2)
|
|
|
|
_host_os=psp2
|
|
|
|
_host_cpu=arm
|
|
|
|
_host_alias=arm-vita-eabi
|
|
|
|
|
|
|
|
# The prefix is always the same on PSP2 so we hardcode the default
|
|
|
|
# here. It is still possible to define a custom prefix which is
|
|
|
|
# needed when packaging the app with a user-specific app ID.
|
|
|
|
test "x$prefix" = xNONE && prefix=app0:
|
|
|
|
# PSP2 apps are installed into app-specific directories. The
|
|
|
|
# default directory structure of ScummVM makes no sense here so we
|
|
|
|
# hardcode PSP2 specific directories here.
|
|
|
|
datarootdir='${prefix}/data'
|
|
|
|
datadir='${datarootdir}'
|
|
|
|
docdir='${prefix}/doc'
|
|
|
|
;;
|
2010-02-02 11:46:35 +00:00
|
|
|
psp)
|
|
|
|
_host_os=psp
|
|
|
|
_host_cpu=mipsallegrexel
|
|
|
|
_host_alias=psp
|
|
|
|
;;
|
|
|
|
samsungtv)
|
|
|
|
_host_os=linux
|
|
|
|
_host_cpu=arm
|
2010-03-24 16:40:35 +00:00
|
|
|
_host_alias=arm-linux-gnueabi
|
2010-02-02 11:46:35 +00:00
|
|
|
;;
|
2018-09-20 14:33:08 +00:00
|
|
|
switch)
|
|
|
|
_host_os=switch
|
2019-05-07 18:52:25 +00:00
|
|
|
_host_cpu=aarch64
|
2018-09-20 14:33:08 +00:00
|
|
|
_host_alias=aarch64-none-elf
|
|
|
|
test "x$prefix" = xNONE && prefix=.
|
|
|
|
datarootdir='${prefix}/data'
|
|
|
|
datadir='${datarootdir}'
|
|
|
|
docdir='${prefix}/doc'
|
|
|
|
;;
|
2021-06-01 22:59:09 +00:00
|
|
|
wasm32-*)
|
|
|
|
_endian=little # the endian check below fails, but emscripten is always little endian anyway
|
|
|
|
_host_os=emscripten
|
|
|
|
_host_cpu=wasm32
|
2022-06-08 21:20:39 +00:00
|
|
|
datadir='/data'
|
2021-06-01 22:59:09 +00:00
|
|
|
CXX="em++"
|
|
|
|
;;
|
2010-02-02 11:46:35 +00:00
|
|
|
wii)
|
|
|
|
_host_os=wii
|
2015-01-18 21:58:03 +00:00
|
|
|
_host_cpu=powerpc
|
2013-11-22 14:13:56 +00:00
|
|
|
_host_alias=powerpc-eabi
|
2010-02-02 11:46:35 +00:00
|
|
|
;;
|
2004-12-16 22:05:45 +00:00
|
|
|
*)
|
2009-03-23 17:40:46 +00:00
|
|
|
if test -n "$_host"; then
|
2007-10-28 13:14:23 +00:00
|
|
|
guessed_host=`$_srcdir/config.sub $_host`
|
|
|
|
fi
|
2004-12-16 22:15:32 +00:00
|
|
|
_host_cpu=`echo $guessed_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
|
|
|
|
_host_vendor=`echo $guessed_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
|
2009-03-19 21:42:50 +00:00
|
|
|
_host_os=`echo $guessed_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
|
2004-12-16 22:15:32 +00:00
|
|
|
;;
|
2004-12-16 22:05:45 +00:00
|
|
|
esac
|
2004-01-22 04:31:31 +00:00
|
|
|
|
2009-03-18 21:07:28 +00:00
|
|
|
if test -z "$_host_alias"; then
|
|
|
|
_host_alias="$_host_cpu-$_host_os"
|
2009-08-22 16:30:20 +00:00
|
|
|
else
|
|
|
|
# if _host_alias was set, default to the standard GNU tools
|
|
|
|
_ranlib=$_host_alias-ranlib
|
|
|
|
_strip=$_host_alias-strip
|
2021-08-28 18:47:24 +00:00
|
|
|
_ar="$_host_alias-ar cr"
|
2009-08-22 16:30:20 +00:00
|
|
|
_as="$_host_alias-as"
|
2017-11-01 22:15:35 +00:00
|
|
|
_dwp=$_host_alias-dwp
|
2009-08-22 16:30:20 +00:00
|
|
|
_windres=$_host_alias-windres
|
2009-03-18 21:07:28 +00:00
|
|
|
fi
|
|
|
|
|
2011-05-05 12:02:18 +00:00
|
|
|
case $_host in
|
2020-08-06 16:24:14 +00:00
|
|
|
arm-*riscos | caanoo | ds | gp2x | gp2xwiz | openpandora | psp | psp2 | switch)
|
2011-05-05 12:02:18 +00:00
|
|
|
if test "$_debug_build" = auto; then
|
2013-01-26 14:21:44 +00:00
|
|
|
# If you want to debug one of these platforms, use '--disable-optimizations --enable-debug'
|
2011-05-05 12:02:18 +00:00
|
|
|
_debug_build=no
|
|
|
|
fi
|
|
|
|
|
2011-10-09 18:13:35 +00:00
|
|
|
if test "$_optimizations" = auto; then
|
|
|
|
# Enable optimizations by default.
|
|
|
|
_optimizations=yes
|
2011-10-07 22:45:56 +00:00
|
|
|
fi
|
2011-05-05 12:02:18 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2004-04-08 22:54:22 +00:00
|
|
|
#
|
|
|
|
# Determine extension used for executables
|
|
|
|
#
|
2010-01-25 01:39:44 +00:00
|
|
|
get_system_exe_extension $_host_os
|
2011-02-06 14:29:22 +00:00
|
|
|
HOSTEXEPRE=
|
2009-03-23 17:40:46 +00:00
|
|
|
HOSTEXEEXT=$_exeext
|
2004-04-08 22:54:22 +00:00
|
|
|
|
2005-10-11 11:27:18 +00:00
|
|
|
#
|
|
|
|
# Determine separator used for $PATH
|
|
|
|
#
|
|
|
|
case $_host_os in
|
2010-10-18 17:42:24 +00:00
|
|
|
os2-emx*)
|
2006-02-20 15:16:26 +00:00
|
|
|
SEPARATOR=";"
|
|
|
|
;;
|
2010-10-18 17:42:24 +00:00
|
|
|
*)
|
2006-02-20 15:16:26 +00:00
|
|
|
SEPARATOR=":"
|
|
|
|
;;
|
2005-10-11 11:27:18 +00:00
|
|
|
esac
|
|
|
|
|
2009-03-19 18:56:54 +00:00
|
|
|
#
|
|
|
|
# Platform specific sanity checks
|
|
|
|
#
|
|
|
|
case $_host_os in
|
2010-08-02 17:11:25 +00:00
|
|
|
android)
|
2020-02-26 19:28:49 +00:00
|
|
|
if test -z "$ANDROID_SDK_ROOT"; then
|
2020-07-22 03:11:44 +00:00
|
|
|
echo "Please set ANDROID_SDK_ROOT in your environment: export ANDROID_SDK_ROOT=<path to Android SDK>"
|
2020-02-26 19:28:49 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
if test -z "$ANDROID_NDK_ROOT"; then
|
2020-07-22 03:11:44 +00:00
|
|
|
echo "Please set ANDROID_NDK_ROOT in your environment: export ANDROID_NDK_ROOT=<path to Android NDK>"
|
2020-02-26 19:28:49 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
2010-08-02 17:11:25 +00:00
|
|
|
;;
|
2022-12-11 14:17:17 +00:00
|
|
|
3ds)
|
|
|
|
if test -z "$DEVKITPRO"; then
|
|
|
|
echo "Please set DEVKITPRO in your environment. export DEVKITPRO=<path to devkitPRO>"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
_as="$DEVKITPRO/devkitARM/bin/arm-none-eabi-as"
|
|
|
|
_ar="$DEVKITPRO/devkitARM/bin/arm-none-eabi-ar cr"
|
|
|
|
_ranlib="$DEVKITPRO/devkitARM/bin/arm-none-eabi-ranlib"
|
|
|
|
_strip="$DEVKITPRO/devkitARM/bin/arm-none-eabi-strip"
|
|
|
|
if test -z "$CXX"; then
|
|
|
|
CXX="$DEVKITPRO/devkitARM/bin/arm-none-eabi-g++"
|
|
|
|
fi
|
|
|
|
if test -z "$PKG_CONFIG_LIBDIR"; then
|
|
|
|
PKG_CONFIG_LIBDIR="$DEVKITPRO/portlibs/3ds/lib/pkgconfig"
|
|
|
|
fi
|
|
|
|
if test -z "$PKG_CONFIG_PATH"; then
|
|
|
|
PKG_CONFIG_PATH="$DEVKITPRO/portlibs/3ds/lib/pkgconfig"
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
|
|
|
|
ds | gamecube | switch | wii)
|
2009-03-19 18:56:54 +00:00
|
|
|
if test -z "$DEVKITPRO"; then
|
|
|
|
echo "Please set DEVKITPRO in your environment. export DEVKITPRO=<path to devkitPRO>"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
;;
|
2017-11-06 06:03:30 +00:00
|
|
|
dreamcast)
|
|
|
|
if test -z "$RONINDIR"; then
|
|
|
|
echo "Please set RONINDIR in your environment. export RONINDIR=<path to libronin>"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
;;
|
2021-06-01 22:59:09 +00:00
|
|
|
emscripten)
|
|
|
|
if test -z "$EMSDK"; then
|
|
|
|
echo "Please set EMSDK in your environment. export EMSDK=<path to emscripten sdk>"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
;;
|
2010-08-03 00:03:04 +00:00
|
|
|
n64)
|
|
|
|
if test -z "$N64SDK"; then
|
|
|
|
echo "Please set N64SDK in your environment. export N64SDK=<path to n64 sdk>"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
;;
|
2011-06-02 08:34:41 +00:00
|
|
|
ps3)
|
|
|
|
if test -z "$PS3DEV"; then
|
|
|
|
echo "Please set PS3DEV in your environment. export PS3DEV=<path to ps3 toolchain>"
|
|
|
|
exit 1
|
|
|
|
fi
|
2012-04-27 12:12:55 +00:00
|
|
|
if test -z "$PSL1GHT"; then
|
|
|
|
echo "Please set PSL1GHT in your environment. export PSL1GHT=<path to psl1ght>"
|
|
|
|
exit 1
|
|
|
|
fi
|
2011-06-02 08:34:41 +00:00
|
|
|
;;
|
2017-03-01 20:00:17 +00:00
|
|
|
psp2)
|
|
|
|
if test -z "$VITASDK"; then
|
|
|
|
echo "Please set VITASDK in your environment. export VITASDK=<path to psp2 toolchain>"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
;;
|
2009-03-25 21:58:16 +00:00
|
|
|
psp)
|
2011-05-05 12:14:21 +00:00
|
|
|
if test -z "$PSPDEV"; then
|
|
|
|
PSPDEV=`psp-config --pspdev-path`
|
|
|
|
fi
|
|
|
|
# TODO: Should we also insist on a valid PSPDEV value?
|
2009-10-09 12:10:08 +00:00
|
|
|
if test -z "$PSPSDK"; then
|
2011-05-05 12:14:21 +00:00
|
|
|
PSPSDK=`psp-config --pspsdk-path`
|
|
|
|
fi
|
|
|
|
if test -z "$PSPSDK"; then
|
|
|
|
echo "Please set PSPSDK in your environment. export PSPSDK=<path to psp sdk>"
|
2009-03-25 21:58:16 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
2017-12-05 04:43:26 +00:00
|
|
|
|
|
|
|
# These have to be set early because the compiler will not link successfully
|
|
|
|
# during testing otherwise
|
|
|
|
if test -d "$PSPDEV/psp/lib"; then
|
|
|
|
append_var LDFLAGS "-L$PSPDEV/psp/lib"
|
|
|
|
fi
|
|
|
|
append_var LDFLAGS "-L$PSPSDK/lib"
|
|
|
|
append_var LDFLAGS "-specs=$_srcdir/backends/platform/psp/psp.spec"
|
|
|
|
|
2009-03-25 21:58:16 +00:00
|
|
|
;;
|
2017-06-29 21:18:28 +00:00
|
|
|
riscos)
|
|
|
|
if test -z "$GCCSDK_INSTALL_ENV"; then
|
|
|
|
echo "Please set GCCSDK_INSTALL_ENV in your environment. export GCCSDK_INSTALL_ENV=<path to GCCSDK_INSTALL_ENV>"
|
|
|
|
exit 1
|
|
|
|
fi
|
2018-06-14 17:31:42 +00:00
|
|
|
|
|
|
|
if test -e "$GCCSDK_INSTALL_ENV/bin/tokenize"; then
|
|
|
|
add_line_to_config_mk "TOKENIZE := $GCCSDK_INSTALL_ENV/bin/tokenize"
|
|
|
|
elif `which tokenize >/dev/null 2>&1`; then
|
|
|
|
add_line_to_config_mk "TOKENIZE := tokenize"
|
|
|
|
fi
|
2022-07-08 21:07:32 +00:00
|
|
|
if test -e "$GCCSDK_INSTALL_ENV/bin/makerun"; then
|
|
|
|
add_line_to_config_mk "MAKERUN := $GCCSDK_INSTALL_ENV/bin/makerun"
|
|
|
|
elif `which makerun >/dev/null 2>&1`; then
|
|
|
|
add_line_to_config_mk "MAKERUN := makerun"
|
|
|
|
fi
|
|
|
|
echo Over here!
|
2017-06-29 21:18:28 +00:00
|
|
|
;;
|
2009-03-19 18:56:54 +00:00
|
|
|
*)
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2020-02-26 19:28:49 +00:00
|
|
|
|
|
|
|
# Toolchain for Android is in NDK and is using different naming convention
|
|
|
|
if test "$_host_os" = android; then
|
2020-08-01 12:42:45 +00:00
|
|
|
|
2020-06-28 23:35:05 +00:00
|
|
|
# Check that we have the correct NDK version
|
|
|
|
echo_n "Checking NDK version... "
|
2020-07-07 05:37:03 +00:00
|
|
|
_ndk_gradle=$(grep "^[[:space:]]*ndkVersion" $_srcdir/dists/android/build.gradle | sed 's/[^0-9\.]//g')
|
2020-06-28 23:35:05 +00:00
|
|
|
_ndk_version=$(grep "Pkg.Revision" $ANDROID_NDK_ROOT/source.properties | sed 's/[^0-9\.]//g' | sed 's/.//')
|
|
|
|
if test "$_ndk_version" = "$_ndk_gradle"; then
|
|
|
|
echo "$_ndk_version"
|
|
|
|
else
|
|
|
|
echo "$_ndk_version (Expected $_ndk_gradle)"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Try to use a known to work toolchain
|
2020-08-01 12:42:45 +00:00
|
|
|
android_toolchains="windows-x86_64 darwin-x86_64 linux-x86_64"
|
|
|
|
for toolchain in $android_toolchains; do
|
2020-06-28 23:35:05 +00:00
|
|
|
_android_toolchain="$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/$toolchain"
|
|
|
|
|
|
|
|
if test -d "$_android_toolchain"; then
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
# See if an explicit toolchain is used
|
2020-04-04 11:08:57 +00:00
|
|
|
if test -n "$ANDROID_TOOLCHAIN"; then
|
|
|
|
_android_toolchain="$ANDROID_TOOLCHAIN"
|
|
|
|
fi
|
2020-02-26 19:28:49 +00:00
|
|
|
|
2020-05-15 13:22:47 +00:00
|
|
|
case $_host_cpu in
|
|
|
|
arm | i686)
|
|
|
|
_android_version=16
|
|
|
|
;;
|
|
|
|
aarch64 | x86_64)
|
|
|
|
# Platform version 21 is needed as earlier versions of platform do not support this architecture.
|
|
|
|
_android_version=21
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2020-04-04 11:08:57 +00:00
|
|
|
# If CXX environment variable is not set, try to set known to work defaults
|
|
|
|
if test -z "$CXX"; then
|
|
|
|
case $_host_cpu in
|
|
|
|
arm)
|
2020-05-15 13:22:47 +00:00
|
|
|
_android_target="armv7a-linux-androideabi$_android_version"
|
2020-04-04 11:08:57 +00:00
|
|
|
;;
|
|
|
|
aarch64)
|
2020-05-15 13:22:47 +00:00
|
|
|
_android_target="aarch64-linux-android$_android_version"
|
2020-04-04 11:08:57 +00:00
|
|
|
;;
|
|
|
|
i686)
|
2020-05-15 13:22:47 +00:00
|
|
|
_android_target="i686-linux-android$_android_version"
|
2020-04-04 11:08:57 +00:00
|
|
|
;;
|
|
|
|
x86_64)
|
2020-05-15 13:22:47 +00:00
|
|
|
_android_target="x86_64-linux-android$_android_version"
|
2020-04-04 11:08:57 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
CXX="$_android_toolchain/bin/clang++"
|
2020-07-22 03:11:44 +00:00
|
|
|
# If CXX is defined, don't alter CXXFLAGS and LDFLAGS as it can be done by the user explicitly
|
2020-04-04 11:08:57 +00:00
|
|
|
append_var CXXFLAGS "-target ${_android_target}"
|
|
|
|
append_var LDFLAGS "-target ${_android_target}"
|
|
|
|
fi
|
2020-02-26 19:28:49 +00:00
|
|
|
|
2020-04-04 11:08:57 +00:00
|
|
|
# These values can get overriden below by environments variables
|
|
|
|
_ar="$_android_toolchain/bin/$_ar"
|
|
|
|
_as="$_android_toolchain/bin/$_as"
|
2021-12-31 16:58:56 +00:00
|
|
|
_dwp="$_android_toolchain/bin/$_dwp"
|
2020-04-04 11:08:57 +00:00
|
|
|
_ranlib="$_android_toolchain/bin/$_ranlib"
|
|
|
|
_strip="$_android_toolchain/bin/$_strip"
|
|
|
|
if test -z "$STRINGS"; then
|
|
|
|
STRINGS="$_android_toolchain/bin/$_host_alias-strings"
|
|
|
|
fi
|
2020-05-15 13:22:47 +00:00
|
|
|
if test -z "$PKG_CONFIG_LIBDIR"; then
|
2021-03-29 15:09:42 +00:00
|
|
|
PKG_CONFIG_LIBDIR="$_android_toolchain/sysroot/usr/lib/$_host_alias/$_android_version/pkgconfig"
|
2020-05-15 13:22:47 +00:00
|
|
|
fi
|
2020-05-23 17:06:23 +00:00
|
|
|
_libcurlpath="$_android_toolchain/sysroot/usr/bin/$_host_alias/$_android_version:$_libcurlpath"
|
2020-02-26 19:28:49 +00:00
|
|
|
fi
|
|
|
|
|
2002-08-24 15:24:38 +00:00
|
|
|
#
|
|
|
|
# Determine the C++ compiler
|
|
|
|
#
|
2004-04-05 22:07:09 +00:00
|
|
|
echo_n "Looking for C++ compiler... "
|
2009-03-19 21:42:50 +00:00
|
|
|
|
|
|
|
# Check whether the given command is a working C++ compiler
|
|
|
|
test_compiler() {
|
2010-05-08 20:22:50 +00:00
|
|
|
cat > tmp_cxx_compiler.cpp << EOF
|
2009-03-19 21:42:50 +00:00
|
|
|
class Foo { int a; };
|
|
|
|
int main(int argc, char **argv) {
|
|
|
|
Foo *a = new Foo(); delete a; return 0;
|
|
|
|
}
|
|
|
|
EOF
|
|
|
|
|
2010-05-08 20:22:50 +00:00
|
|
|
echo "testing compiler: $1" >> "$TMPLOG"
|
|
|
|
|
2009-03-19 21:42:50 +00:00
|
|
|
if test -n "$_host"; then
|
|
|
|
# In cross-compiling mode, we cannot run the result
|
2019-12-12 02:21:48 +00:00
|
|
|
eval "$1 $CXXFLAGS -o $TMPO.o -c tmp_cxx_compiler.cpp" 2>> "$TMPLOG" && cc_check_clean tmp_cxx_compiler.cpp
|
2009-03-19 21:42:50 +00:00
|
|
|
else
|
2019-12-12 02:21:48 +00:00
|
|
|
eval "$1 $CXXFLAGS $LDFLAGS -o $TMPO$HOSTEXEEXT tmp_cxx_compiler.cpp" 2>> "$TMPLOG" && eval "$TMPO$HOSTEXEEXT 2>> $TMPLOG" && cc_check_clean tmp_cxx_compiler.cpp
|
2009-03-19 21:42:50 +00:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
# Prepare a list of candidates for the C++ compiler
|
2009-03-23 15:47:45 +00:00
|
|
|
if test -n "$CXX" && test_compiler "$CXX"; then
|
|
|
|
# Use the compiler specified in CXX
|
|
|
|
echo $CXX
|
2004-01-22 04:31:31 +00:00
|
|
|
else
|
2009-03-23 15:47:45 +00:00
|
|
|
if test -n "$_host"; then
|
2022-02-28 20:35:36 +00:00
|
|
|
compilers="$_host_alias-g++ $_host_alias-c++ $_host_alias-clang++ $_host-g++ $_host-c++ $_host-clang++"
|
2009-03-23 15:47:45 +00:00
|
|
|
else
|
2022-02-28 20:35:36 +00:00
|
|
|
compilers="g++ c++ clang++"
|
2009-03-23 15:47:45 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Iterate over all candidates, pick the first working one
|
|
|
|
CXX=
|
|
|
|
for compiler in $compilers; do
|
|
|
|
if test_compiler $compiler; then
|
2010-09-09 14:01:33 +00:00
|
|
|
echo "success testing compiler: $compiler" >> "$TMPLOG"
|
2009-03-23 15:47:45 +00:00
|
|
|
CXX=$compiler
|
|
|
|
echo $CXX
|
|
|
|
break
|
2010-07-01 23:12:28 +00:00
|
|
|
else
|
2010-09-09 14:01:33 +00:00
|
|
|
echo "failure testing compiler: $compiler" >> "$TMPLOG"
|
2009-03-23 15:47:45 +00:00
|
|
|
fi
|
|
|
|
done
|
2004-01-22 04:31:31 +00:00
|
|
|
fi
|
|
|
|
|
2006-10-15 00:49:36 +00:00
|
|
|
if test -z "$CXX"; then
|
2004-12-16 22:15:32 +00:00
|
|
|
echo "none found!"
|
|
|
|
exit 1
|
2002-08-24 15:24:38 +00:00
|
|
|
fi
|
|
|
|
|
2017-10-20 16:47:43 +00:00
|
|
|
if test -n "$RANLIB"; then
|
|
|
|
_ranlib=$RANLIB
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test -n "$STRIP"; then
|
|
|
|
_strip=$STRIP
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test -n "$AR"; then
|
2021-08-28 18:47:24 +00:00
|
|
|
_ar="$AR cr"
|
2017-10-20 16:47:43 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if test -n "$AS"; then
|
|
|
|
_as=$AS
|
|
|
|
fi
|
|
|
|
|
2017-11-01 22:15:35 +00:00
|
|
|
if test -n "$DWP"; then
|
|
|
|
_dwp=$DWP
|
|
|
|
fi
|
|
|
|
|
2017-10-20 16:47:43 +00:00
|
|
|
if test -n "$WINDRES"; then
|
|
|
|
_windres=$WINDRES
|
|
|
|
fi
|
|
|
|
|
2009-10-09 11:38:13 +00:00
|
|
|
LD=$CXX
|
|
|
|
|
2021-10-31 10:51:49 +00:00
|
|
|
#
|
|
|
|
# Check whether the compiler supports C++11
|
|
|
|
#
|
|
|
|
echo_n "Checking if compiler supports C++11... "
|
|
|
|
have_cxx11=no
|
|
|
|
cat > $TMPC << EOF
|
|
|
|
int main(int argc, char *argv[]) { if (argv == nullptr) return -1; else return 0; }
|
|
|
|
EOF
|
|
|
|
cc_check -std=c++11 && have_cxx11=yes
|
|
|
|
echo $have_cxx11
|
|
|
|
|
|
|
|
if test "$have_cxx11" = "no" ; then
|
|
|
|
echo
|
|
|
|
echo "ScummVM requires C++11 compiler support. Please ensure your compiler supports it"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2003-06-02 03:01:22 +00:00
|
|
|
#
|
|
|
|
# Determine the compiler version
|
2009-03-18 21:51:56 +00:00
|
|
|
#
|
2003-06-02 03:01:22 +00:00
|
|
|
echocheck "compiler version"
|
|
|
|
|
2015-12-20 17:23:18 +00:00
|
|
|
# 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
|
2011-02-10 01:05:48 +00:00
|
|
|
have_icc=no
|
|
|
|
cc_check_define __INTEL_COMPILER && have_icc=yes
|
2015-12-20 17:23:18 +00:00
|
|
|
have_clang=no
|
|
|
|
cc_check_define __clang__ && have_clang=yes
|
2011-02-10 01:05:48 +00:00
|
|
|
|
|
|
|
if test "$have_icc" = yes; then
|
|
|
|
add_line_to_config_mk 'HAVE_ICC = 1'
|
|
|
|
|
2015-12-20 17:23:18 +00:00
|
|
|
# Make ICC error out on unknown command line options instead of printing
|
2021-08-03 15:23:27 +00:00
|
|
|
# a warning. This is for example required to make the -Wglobal-constructors
|
2011-02-10 01:05:48 +00:00
|
|
|
# detection work correctly.
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var CXXFLAGS "-diag-error 10006,10148"
|
2015-12-20 17:23:18 +00:00
|
|
|
|
|
|
|
# ICC doesn't accept all gcc options, so we disable have_gcc, even if
|
|
|
|
# ICC does have the gcc-compatibility defines.
|
|
|
|
have_gcc=no
|
2011-02-10 01:05:48 +00:00
|
|
|
fi
|
|
|
|
|
2015-12-20 17:23:18 +00:00
|
|
|
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
|
2010-04-09 12:23:43 +00:00
|
|
|
|
|
|
|
if test "$have_gcc" = yes; then
|
|
|
|
add_line_to_config_mk 'HAVE_GCC = 1'
|
|
|
|
_cxx_major=`gcc_get_define __GNUC__`
|
|
|
|
_cxx_minor=`gcc_get_define __GNUC_MINOR__`
|
|
|
|
cxx_version="`( $CXX -dumpversion ) 2>&1`"
|
|
|
|
|
2015-12-20 17:35:41 +00:00
|
|
|
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__`
|
2015-12-23 23:00:28 +00:00
|
|
|
cxx_version="`echo "${cxx_version}" | sed -e 's/"\([^ ]*\) .*/\1/'`"
|
2015-12-20 17:35:41 +00:00
|
|
|
cxx_version="clang $cxx_version, ok"
|
2010-04-09 12:23:43 +00:00
|
|
|
else
|
2021-10-31 11:05:30 +00:00
|
|
|
cxx_version="GCC $cxx_version, ok"
|
2010-04-09 12:23:43 +00:00
|
|
|
fi
|
2011-02-10 01:05:48 +00:00
|
|
|
elif test "$have_icc" = yes; then
|
|
|
|
cxx_version="`( $CXX -dumpversion ) 2>/dev/null`"
|
|
|
|
_cxx_major="`echo "${cxx_version}" | sed -ne 's/\([0-9][0-9]*\)\..*/\1/gp'`"
|
|
|
|
_cxx_minor="`echo "${cxx_version}" | sed -ne 's/[0-9][0-9]*\.\([0-9][0-9]*\)/\1/gp'`"
|
|
|
|
cxx_version="ICC $cxx_version, ok"
|
2010-04-09 12:23:43 +00:00
|
|
|
else
|
|
|
|
# TODO: Big scary warning about unsupported compilers
|
2009-09-25 12:11:27 +00:00
|
|
|
cxx_version=`( $CXX -version ) 2>&1`
|
|
|
|
if test "$?" -eq 0; then
|
|
|
|
cxx_version="`echo "${cxx_version}" | sed -ne 's/^.*[^0-9]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*$/\1/gp'`"
|
|
|
|
if test -z "${cxx_version}"; then
|
|
|
|
cxx_version="not found"
|
|
|
|
fi
|
|
|
|
echo non-gcc compiler version ${cxx_version}
|
|
|
|
else
|
|
|
|
cxx_version="not found"
|
2021-10-31 11:05:30 +00:00
|
|
|
echo non-gcc compiler version ${cxx_version}
|
2009-09-25 12:11:27 +00:00
|
|
|
fi
|
2021-10-31 11:05:30 +00:00
|
|
|
cxx_verc_fail=yes
|
2022-04-12 21:11:34 +00:00
|
|
|
cxx_version="$cxx_version, bad"
|
2009-09-25 12:11:27 +00:00
|
|
|
fi
|
2003-06-02 03:01:22 +00:00
|
|
|
|
|
|
|
echo "$cxx_version"
|
|
|
|
|
2011-05-25 11:40:07 +00:00
|
|
|
#
|
2011-10-31 10:51:31 +00:00
|
|
|
# Bail out now if no useable compiler was found.
|
2011-05-25 11:40:07 +00:00
|
|
|
#
|
2003-06-02 03:01:22 +00:00
|
|
|
if test "$cxx_verc_fail" = yes ; then
|
|
|
|
echo
|
|
|
|
echo "The version of your compiler is not supported at this time"
|
2008-01-27 19:47:41 +00:00
|
|
|
exit 1
|
2003-06-02 03:01:22 +00:00
|
|
|
fi
|
|
|
|
|
2011-05-04 14:30:10 +00:00
|
|
|
#
|
2011-05-25 11:40:07 +00:00
|
|
|
# Setup compiler specific CXXFLAGS now that we know the compiler version.
|
|
|
|
# Foremost, this means enabling various warnings.
|
2021-10-31 11:05:30 +00:00
|
|
|
# In addition, we set CXX_UPDATE_DEP_FLAG for GCC and ICC.
|
2011-05-04 14:30:10 +00:00
|
|
|
#
|
2021-10-31 13:40:34 +00:00
|
|
|
# By default compile with strict C++
|
|
|
|
std_variant=c++
|
|
|
|
pedantic=no
|
2011-05-04 14:30:10 +00:00
|
|
|
if test "$have_gcc" = yes ; then
|
2021-10-31 13:40:34 +00:00
|
|
|
# By default, we add -pedantic to the CXXFLAGS to catch some potentially
|
|
|
|
# non-portable constructs, like use of GNU extensions.
|
|
|
|
# However, some platforms use GNU extensions in system header files, so
|
|
|
|
# for these we must not use -pedantic.
|
|
|
|
pedantic=yes
|
|
|
|
|
2021-10-31 11:05:30 +00:00
|
|
|
case $_host_os in
|
|
|
|
# newlib-based system include files suppress non-C89 function
|
|
|
|
# declarations under __STRICT_ANSI__, undefine it
|
2022-02-05 20:10:20 +00:00
|
|
|
3ds | android | gamecube | psp | switch | wii)
|
2021-10-31 13:40:34 +00:00
|
|
|
std_variant=gnu++
|
|
|
|
pedantic=no
|
|
|
|
;;
|
2022-04-17 13:27:44 +00:00
|
|
|
amigaos* | dreamcast | ds | mingw* | mint* | morphos | n64 | ps3 | psp2)
|
2021-10-31 13:40:34 +00:00
|
|
|
std_variant=gnu++
|
2021-10-31 11:05:30 +00:00
|
|
|
;;
|
2022-05-30 10:19:29 +00:00
|
|
|
openbsd*)
|
|
|
|
pedantic=no
|
|
|
|
;;
|
2021-10-31 11:05:30 +00:00
|
|
|
*)
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
append_var CXXFLAGS "-W -Wno-unused-parameter"
|
|
|
|
add_line_to_config_mk 'CXX_UPDATE_DEP_FLAG = -MMD -MF "$(*D)/$(DEPDIR)/$(*F).d" -MQ "$@" -MP'
|
|
|
|
|
|
|
|
append_var CXXFLAGS "-Wno-empty-body"
|
2020-05-12 23:11:19 +00:00
|
|
|
append_var CXXFLAGS "-fno-operator-names"
|
2011-05-04 14:30:10 +00:00
|
|
|
elif test "$have_icc" = yes ; then
|
2021-10-31 13:40:34 +00:00
|
|
|
# ICC does not support pedantic, while GCC and clang do.
|
2011-05-04 14:30:10 +00:00
|
|
|
add_line_to_config_mk 'CXX_UPDATE_DEP_FLAG = -MMD -MF "$(*D)/$(DEPDIR)/$(*F).d" -MQ "$@" -MP'
|
2022-05-06 17:24:12 +00:00
|
|
|
fi
|
2011-05-04 14:30:10 +00:00
|
|
|
|
2013-01-09 06:53:21 +00:00
|
|
|
#
|
2021-10-31 09:40:43 +00:00
|
|
|
# Set status about C++11 mode
|
2013-01-09 06:53:21 +00:00
|
|
|
#
|
2021-10-31 13:40:34 +00:00
|
|
|
append_var CXXFLAGS "-std=${std_variant}11"
|
|
|
|
|
|
|
|
if test "$pedantic" = yes ; then
|
2021-11-02 19:51:34 +00:00
|
|
|
append_var CXXFLAGS "-pedantic"
|
2021-10-31 13:40:34 +00:00
|
|
|
fi
|
2013-01-09 06:53:21 +00:00
|
|
|
|
2020-10-03 12:09:32 +00:00
|
|
|
#
|
|
|
|
# Additional tests for C++11 features that may not be present
|
|
|
|
#
|
2021-10-31 09:40:43 +00:00
|
|
|
|
|
|
|
# Check if initializer list is available
|
|
|
|
echo_n "Checking if C++11 initializer list is available... "
|
|
|
|
cat > $TMPC << EOF
|
2020-10-03 12:09:32 +00:00
|
|
|
#include <initializer_list>
|
2020-10-03 19:55:27 +00:00
|
|
|
#include <cstddef>
|
2020-10-03 12:09:32 +00:00
|
|
|
class FOO {
|
|
|
|
public:
|
|
|
|
FOO(std::initializer_list<int> list) : _size(list.size()) {}
|
|
|
|
size_t _size;
|
|
|
|
};
|
|
|
|
int main(int argc, char *argv[]) { return 0; }
|
|
|
|
EOF
|
2021-10-31 09:40:43 +00:00
|
|
|
cc_check
|
|
|
|
if test "$TMPR" -eq 0; then
|
|
|
|
echo yes
|
|
|
|
else
|
|
|
|
echo no
|
|
|
|
define_in_config_if_yes yes 'NO_CXX11_INITIALIZER_LIST'
|
|
|
|
fi
|
2021-03-07 19:05:48 +00:00
|
|
|
|
2021-10-31 09:40:43 +00:00
|
|
|
# Check if std::nullptr_t is available
|
|
|
|
echo_n "Checking if C++11 std::nullptr_t is available..."
|
|
|
|
cat > $TMPC << EOF
|
2021-03-07 19:05:48 +00:00
|
|
|
#include <cstddef>
|
|
|
|
int main(int argc, char *argv[]) {
|
|
|
|
std::nullptr_t i = nullptr;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
EOF
|
2021-10-31 09:40:43 +00:00
|
|
|
cc_check
|
|
|
|
if test "$TMPR" -eq 0; then
|
|
|
|
echo yes
|
|
|
|
else
|
|
|
|
echo no
|
|
|
|
define_in_config_if_yes yes 'NO_CXX11_NULLPTR_T'
|
2020-10-03 12:09:32 +00:00
|
|
|
fi
|
|
|
|
|
2017-11-01 22:15:35 +00:00
|
|
|
#
|
|
|
|
# Determine extra build flags for debug and/or release builds
|
|
|
|
#
|
2020-09-26 19:21:01 +00:00
|
|
|
if test "$_debug_build" = auto && test "$_release_build" = yes; then
|
|
|
|
_debug_build=no
|
|
|
|
fi
|
2017-11-01 22:15:35 +00:00
|
|
|
if test "$_debug_build" != no; then
|
|
|
|
# debug mode not explicitly disabled -> compile with debug information
|
|
|
|
echo_n "Checking best debug mode... "
|
|
|
|
|
|
|
|
debug_mode=-g
|
|
|
|
test "$_host_os" = amigaos && debug_mode=-gstabs
|
|
|
|
append_var CXXFLAGS "$debug_mode"
|
|
|
|
echo_n -- "$debug_mode"
|
|
|
|
|
|
|
|
echo "int main() { return 0; }" > $TMPC
|
|
|
|
if `which $_dwp >/dev/null 2>&1` && cc_check_no_clean $debug_mode -gsplit-dwarf && `$_dwp -e $TMPO -o /dev/null >/dev/null 2>&1`; then
|
|
|
|
append_var CXXFLAGS "-gsplit-dwarf"
|
|
|
|
add_line_to_config_mk "SPLIT_DWARF = 1"
|
|
|
|
echo_n -- " + split DWARF"
|
2021-03-09 21:35:06 +00:00
|
|
|
if test "$_lld" = yes && cc_check_no_clean $debug_mode -gsplit-dwarf -fuse-ld=lld -Wl,--gdb-index; then
|
|
|
|
append_var LDFLAGS "-fuse-ld=lld"
|
|
|
|
append_var LDFLAGS "-Wl,--gdb-index"
|
|
|
|
echo_n -- " + LLD"
|
2022-02-16 15:50:24 +00:00
|
|
|
elif test "$_mold" = yes && cc_check_no_clean $debug_mode -gsplit-dwarf -fuse-ld=mold -Wl,--gdb-index; then
|
|
|
|
append_var LDFLAGS "-fuse-ld=mold"
|
|
|
|
append_var LDFLAGS "-Wl,--gdb-index"
|
|
|
|
echo_n -- " + Mold"
|
2021-04-13 19:41:03 +00:00
|
|
|
elif test "$_gold" = yes && cc_check_no_clean $debug_mode -gsplit-dwarf -fuse-ld=gold -Wl,--gdb-index; then
|
2017-11-01 22:15:35 +00:00
|
|
|
append_var LDFLAGS "-fuse-ld=gold"
|
|
|
|
append_var LDFLAGS "-Wl,--gdb-index"
|
|
|
|
echo_n -- " + Gold"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if cc_check_no_clean $debug_mode -fvar-tracking-assignments; then
|
|
|
|
append_var CXXFLAGS "-fvar-tracking-assignments"
|
|
|
|
echo_n -- " + var tracking"
|
|
|
|
fi
|
|
|
|
cc_check_clean
|
|
|
|
echo ""
|
|
|
|
fi
|
|
|
|
|
2021-03-09 21:35:06 +00:00
|
|
|
if ! echo "$LDFLAGS" | grep -q -e -fuse-ld; then
|
|
|
|
echo "Using LLD linker... $_lld"
|
|
|
|
if test "$_lld" = yes ; then
|
|
|
|
append_var LDFLAGS -fuse-ld=lld
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2022-02-16 15:50:24 +00:00
|
|
|
if ! echo "$LDFLAGS" | grep -q -e -fuse-ld; then
|
|
|
|
echo "Using Mold linker... $_mold"
|
|
|
|
if test "$_mold" = yes ; then
|
|
|
|
append_var LDFLAGS -fuse-ld=mold
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2017-11-01 22:15:35 +00:00
|
|
|
if test "$_release_build" = yes; then
|
|
|
|
# Add a define, which indicates we are doing
|
2022-11-12 20:15:28 +00:00
|
|
|
# a build for a release version.
|
2017-11-01 22:15:35 +00:00
|
|
|
append_var DEFINES "-DRELEASE_BUILD"
|
|
|
|
fi
|
|
|
|
|
2022-06-02 20:11:07 +00:00
|
|
|
set_flag_if_supported() {
|
|
|
|
echocheck "whether C++ compiler accepts $1"
|
|
|
|
cat > $TMPC << EOF
|
|
|
|
int main() { return 0; }
|
2011-05-25 11:40:07 +00:00
|
|
|
EOF
|
2022-06-02 20:11:07 +00:00
|
|
|
# Note: we check for -Wxxx instead of -Wno-xxx as not all compilers error
|
|
|
|
# out on unknown -Wno-xxx flags.
|
|
|
|
if cc_check $(echo $1 | sed 's/-Wno-/-W/') -Werror; then
|
|
|
|
append_var CXXFLAGS "$1"
|
|
|
|
echo yes
|
|
|
|
else
|
|
|
|
echo no
|
|
|
|
fi
|
|
|
|
}
|
2011-05-25 11:40:07 +00:00
|
|
|
|
2022-06-02 20:11:07 +00:00
|
|
|
set_flag_if_supported -Wglobal-constructors
|
2011-05-25 11:40:07 +00:00
|
|
|
|
2017-08-18 09:22:42 +00:00
|
|
|
# If the compiler supports the -Wundefined-var-template flag, silence that warning.
|
|
|
|
# We get this warning a lot with regard to the Singleton class as we explicitly
|
|
|
|
# instantiate each specialisation. An alternate way to deal with it would be to
|
|
|
|
# change the way we instantiate the singleton classes as done in PR #967.
|
|
|
|
# Note: we check the -Wundefined-var-template as gcc does not error out on unknown
|
|
|
|
# -Wno-xxx flags.
|
2022-06-02 20:11:07 +00:00
|
|
|
set_flag_if_supported -Wno-undefined-var-template
|
2017-08-18 09:22:42 +00:00
|
|
|
|
2018-07-08 09:23:35 +00:00
|
|
|
# Vanilla clang 6 enables the new -Wpragma-pack which warns when leaving an
|
|
|
|
# included file which changes the current alignment.
|
|
|
|
# As our common/pack-{start,end}.h trigger this we disable this warning.
|
|
|
|
# Because there is no correlation between the version reported by Apple Xcode
|
|
|
|
# clang and vanilla clang we cannot rely on the __clang_major__/clang_minor__
|
|
|
|
# macros.
|
2022-06-02 20:11:07 +00:00
|
|
|
set_flag_if_supported -Wno-pragma-pack
|
2018-07-08 09:23:35 +00:00
|
|
|
|
2022-06-02 20:15:10 +00:00
|
|
|
set_flag_if_supported -Wno-address-of-packed-member
|
|
|
|
|
2017-10-20 16:47:43 +00:00
|
|
|
if test -n "$STRINGS"; then
|
|
|
|
_strings=$STRINGS
|
2014-05-17 22:28:00 +00:00
|
|
|
else
|
2017-10-20 16:47:43 +00:00
|
|
|
echo_n "Checking for $_host_alias-strings... " >> "$TMPLOG"
|
|
|
|
if `which $_host_alias-strings >/dev/null 2>&1`; then
|
|
|
|
_strings=$_host_alias-strings
|
|
|
|
echo yes >> "$TMPLOG"
|
|
|
|
else
|
|
|
|
_strings=strings
|
|
|
|
echo no >> "$TMPLOG"
|
|
|
|
fi
|
2014-05-17 22:28:00 +00:00
|
|
|
fi
|
|
|
|
|
2007-10-28 13:14:23 +00:00
|
|
|
#
|
|
|
|
# Check for endianness
|
|
|
|
#
|
|
|
|
echo_n "Checking endianness... "
|
2010-05-08 20:22:50 +00:00
|
|
|
cat > tmp_endianness_check.cpp << EOF
|
2022-05-30 09:43:31 +00:00
|
|
|
#ifndef __GNUC__
|
|
|
|
#define __attribute__(x)
|
|
|
|
#endif
|
2021-05-09 10:57:43 +00:00
|
|
|
__attribute__ ((used)) unsigned short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
|
|
|
|
__attribute__ ((used)) unsigned short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
|
2019-09-30 00:18:52 +00:00
|
|
|
const char * _ascii() { char* s = (char*) ascii_mm; s = (char*) ascii_ii; return s; }
|
2021-05-09 10:57:43 +00:00
|
|
|
__attribute__ ((used)) unsigned short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
|
|
|
|
__attribute__ ((used)) unsigned short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
|
2019-09-30 00:18:52 +00:00
|
|
|
const char * _ebcdic() { char* s = (char*) ebcdic_mm; s = (char*) ebcdic_ii; return s; }
|
2007-10-28 13:14:23 +00:00
|
|
|
int main() { _ascii (); _ebcdic (); return 0; }
|
|
|
|
EOF
|
2021-05-01 12:53:06 +00:00
|
|
|
$CXX $LDFLAGS $CXXFLAGS -o $TMPO$HOSTEXEEXT tmp_endianness_check.cpp >> "$TMPLOG" 2>&1
|
|
|
|
if $_strings $TMPO$HOSTEXEEXT 2>> "$TMPLOG"| grep BIGenDianSyS >/dev/null; then
|
2007-10-28 13:14:23 +00:00
|
|
|
_endian=big
|
2021-05-01 12:53:06 +00:00
|
|
|
elif $_strings $TMPO$HOSTEXEEXT 2>> "$TMPLOG" | grep LiTTleEnDian >/dev/null; then
|
2007-10-28 13:14:23 +00:00
|
|
|
_endian=little
|
|
|
|
fi
|
|
|
|
echo $_endian;
|
2019-05-05 07:56:26 +00:00
|
|
|
cc_check_clean tmp_endianness_check.cpp tmp_endianness_check.dwo
|
2007-10-28 13:14:23 +00:00
|
|
|
|
2011-05-26 09:02:46 +00:00
|
|
|
case $_endian in
|
|
|
|
big)
|
|
|
|
add_line_to_config_h '#undef SCUMM_LITTLE_ENDIAN'
|
|
|
|
add_line_to_config_h '#define SCUMM_BIG_ENDIAN'
|
|
|
|
;;
|
|
|
|
little)
|
|
|
|
add_line_to_config_h '#define SCUMM_LITTLE_ENDIAN'
|
|
|
|
add_line_to_config_h '#undef SCUMM_BIG_ENDIAN'
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2009-03-22 11:24:23 +00:00
|
|
|
#
|
|
|
|
# Determine a data type with the given length
|
|
|
|
#
|
|
|
|
find_type_with_size() {
|
2013-07-15 16:26:02 +00:00
|
|
|
for datatype in int short char long "long long" __int64 "long long int" unknown; do
|
2010-05-08 20:22:50 +00:00
|
|
|
cat > tmp_find_type_with_size.cpp << EOF
|
2009-03-22 11:24:23 +00:00
|
|
|
typedef $datatype ac__type_sizeof_;
|
|
|
|
int main() {
|
|
|
|
static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) == $1)];
|
|
|
|
test_array [0] = 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
EOF
|
2021-05-01 12:53:06 +00:00
|
|
|
if $CXX $CXXFLAGS -c -o $TMPO.o tmp_find_type_with_size.cpp >> "$TMPLOG" 2>&1 ; then
|
2010-05-08 20:22:50 +00:00
|
|
|
break
|
|
|
|
else
|
|
|
|
if test "$datatype" = "unknown"; then
|
|
|
|
echo "couldn't find data type with $1 bytes"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
continue
|
2009-03-22 11:24:23 +00:00
|
|
|
fi
|
|
|
|
done
|
2010-05-08 20:22:50 +00:00
|
|
|
cc_check_clean tmp_find_type_with_size.cpp
|
2009-03-22 11:24:23 +00:00
|
|
|
echo $datatype
|
|
|
|
}
|
|
|
|
|
2011-12-24 10:59:42 +00:00
|
|
|
#
|
|
|
|
# Check whether the system is 32-bit
|
|
|
|
#
|
|
|
|
pointer_is_32bit() {
|
2012-01-10 14:37:34 +00:00
|
|
|
cat > tmp_pointer_is_32bit.cpp << EOF
|
2011-12-24 10:59:42 +00:00
|
|
|
int main() {
|
2012-01-10 14:37:34 +00:00
|
|
|
static int test_array[1 - 2 * !(sizeof(void *) == 4)];
|
2012-01-10 14:38:42 +00:00
|
|
|
test_array[0] = 0;
|
|
|
|
return 0;
|
2011-12-24 10:59:42 +00:00
|
|
|
}
|
|
|
|
EOF
|
2021-05-01 12:53:06 +00:00
|
|
|
$CXX $CXXFLAGS -c -o $TMPO.o tmp_pointer_is_32bit.cpp >> "$TMPLOG" 2>&1
|
2012-01-10 14:37:34 +00:00
|
|
|
status=$?
|
|
|
|
cc_check_clean tmp_pointer_is_32bit.cpp
|
|
|
|
return $status
|
2011-12-24 10:59:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
echo_n "Checking 64-bitness... "
|
|
|
|
pointer_is_32bit
|
|
|
|
if test $? -eq 0; then
|
2021-09-17 16:23:59 +00:00
|
|
|
signed_type_ptr=int32
|
|
|
|
unsigned_type_ptr=uint32
|
2012-01-10 14:37:34 +00:00
|
|
|
echo "no"
|
2011-12-24 10:59:42 +00:00
|
|
|
else
|
2021-09-17 16:23:59 +00:00
|
|
|
signed_type_ptr=int64
|
|
|
|
unsigned_type_ptr=uint64
|
2012-01-10 14:37:34 +00:00
|
|
|
echo "yes"
|
2011-12-24 10:59:42 +00:00
|
|
|
fi
|
|
|
|
|
2007-10-28 13:14:23 +00:00
|
|
|
#
|
|
|
|
# Determine data type sizes
|
|
|
|
#
|
|
|
|
echo_n "Type with 1 byte... "
|
|
|
|
type_1_byte=`find_type_with_size 1`
|
2011-04-08 14:16:59 +00:00
|
|
|
TMPR="$?"
|
2007-10-28 13:14:23 +00:00
|
|
|
echo "$type_1_byte"
|
2011-04-08 14:16:59 +00:00
|
|
|
test $TMPR -eq 0 || exit 1 # check exit code of subshell
|
2008-01-27 19:47:41 +00:00
|
|
|
|
2007-10-28 13:14:23 +00:00
|
|
|
echo_n "Type with 2 bytes... "
|
|
|
|
type_2_byte=`find_type_with_size 2`
|
2011-04-08 14:16:59 +00:00
|
|
|
TMPR="$?"
|
2007-10-28 13:14:23 +00:00
|
|
|
echo "$type_2_byte"
|
2011-04-08 14:16:59 +00:00
|
|
|
test $TMPR -eq 0 || exit 1 # check exit code of subshell
|
2008-01-27 19:47:41 +00:00
|
|
|
|
2007-10-28 13:14:23 +00:00
|
|
|
echo_n "Type with 4 bytes... "
|
|
|
|
type_4_byte=`find_type_with_size 4`
|
2011-04-08 14:16:59 +00:00
|
|
|
TMPR="$?"
|
2007-10-28 13:14:23 +00:00
|
|
|
echo "$type_4_byte"
|
2011-04-08 14:16:59 +00:00
|
|
|
test $TMPR -eq 0 || exit 1 # check exit code of subshell
|
2008-01-27 19:47:41 +00:00
|
|
|
|
2011-12-24 10:59:42 +00:00
|
|
|
echo_n "Type with 8 bytes... "
|
|
|
|
type_8_byte=`find_type_with_size 8`
|
|
|
|
TMPR="$?"
|
|
|
|
echo "$type_8_byte"
|
2017-09-24 16:18:56 +00:00
|
|
|
test $TMPR -eq 0 || exit 1 # check exit code of subshell
|
2011-12-24 10:59:42 +00:00
|
|
|
|
2011-05-26 09:02:46 +00:00
|
|
|
#
|
|
|
|
# Check whether memory alignment is required
|
|
|
|
#
|
|
|
|
# For some CPU types, unaligned memory access is either not supported at
|
|
|
|
# all (and so leads to a crash), requires a super-slow emulation via an
|
|
|
|
# exception handler, or just results in incorrect results.
|
|
|
|
# On the other hand, accessing data in a manner that works regardless of
|
|
|
|
# alignment can be a lot slower than regular access, so we don't want
|
|
|
|
# to use it if we don't have to.
|
|
|
|
#
|
|
|
|
# So we do the following: For CPU families where we know whether unaligned
|
|
|
|
# access is safe & fast, we enable / disable unaligned access accordingly.
|
|
|
|
# Otherwise, we just disable memory alignment.
|
|
|
|
#
|
|
|
|
# NOTE: In the past, for non-cross compiled builds, we would also run some code
|
|
|
|
# which would try to test whether unaligned access worked or not. But this test
|
|
|
|
# could not reliably determine whether unaligned access really worked in all
|
|
|
|
# situations (and across different implementations of the target CPU arch), nor
|
|
|
|
# whether it was fast (as opposed to slowly emulated by fault handlers). Hence,
|
|
|
|
# we do not use this approach anymore.
|
|
|
|
#
|
|
|
|
# NOTE: The only kinds of unaligned access we allow are for 2 byte and 4
|
|
|
|
# byte loads / stores. No promises are made for bigger sizes, such as 8
|
|
|
|
# or 16 byte loads, for which architectures may behave differently than
|
|
|
|
# for the smaller sizes.
|
|
|
|
echo_n "Alignment required... "
|
|
|
|
case $_host_cpu in
|
2016-12-03 15:01:20 +00:00
|
|
|
i[3-6]86 | amd64 | x86_64 | powerpc* | ppc*)
|
2011-05-26 09:02:46 +00:00
|
|
|
# Unaligned access should work
|
|
|
|
_need_memalign=no
|
|
|
|
;;
|
|
|
|
alpha* | arm* | bfin* | hp* | mips* | sh* | sparc* | ia64 | nv1*)
|
|
|
|
# Unaligned access is not supported or extremely slow.
|
|
|
|
_need_memalign=yes
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
# Status of unaligned access is unknown, so assume the worst.
|
|
|
|
_need_memalign=yes
|
|
|
|
;;
|
|
|
|
esac
|
2022-08-18 15:47:35 +00:00
|
|
|
if test "$_enable_ubsan" = yes ; then
|
|
|
|
# UBSan implies -fsanitize=alignment, so avoid false positives.
|
|
|
|
_need_memalign=yes
|
|
|
|
fi
|
2011-05-26 09:02:46 +00:00
|
|
|
echo "$_need_memalign"
|
|
|
|
|
|
|
|
define_in_config_h_if_yes $_need_memalign 'SCUMM_NEED_ALIGNMENT'
|
|
|
|
|
|
|
|
#
|
2011-07-12 09:28:47 +00:00
|
|
|
# Check the CPU architecture
|
2011-05-26 09:02:46 +00:00
|
|
|
#
|
2011-07-12 09:28:47 +00:00
|
|
|
echo_n "Checking host CPU architecture... "
|
2011-05-26 09:02:46 +00:00
|
|
|
case $_host_cpu in
|
2011-07-12 09:28:47 +00:00
|
|
|
arm*)
|
2020-02-26 19:28:49 +00:00
|
|
|
echo "arm"
|
2017-11-21 05:14:20 +00:00
|
|
|
case $_host in
|
|
|
|
openpandora)
|
|
|
|
define_in_config_if_yes yes 'USE_ARM_NEON_ASPECT_CORRECTOR'
|
2017-03-01 20:00:17 +00:00
|
|
|
;;
|
2022-06-20 23:35:10 +00:00
|
|
|
caanoo | gp2x | gp2xwiz | maemo )
|
2015-12-01 19:55:09 +00:00
|
|
|
define_in_config_if_yes yes 'USE_ARM_SCALER_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
|
2016-01-08 23:38:48 +00:00
|
|
|
|
|
|
|
append_var DEFINES "-DARM_TARGET"
|
2011-07-12 09:28:47 +00:00
|
|
|
;;
|
2020-02-26 19:28:49 +00:00
|
|
|
aarch64)
|
|
|
|
echo "aarch64"
|
|
|
|
;;
|
2011-07-12 09:28:47 +00:00
|
|
|
i[3-6]86)
|
|
|
|
echo "x86"
|
2011-05-26 09:02:46 +00:00
|
|
|
_have_x86=yes
|
2011-07-12 09:28:47 +00:00
|
|
|
define_in_config_h_if_yes $_have_x86 'HAVE_X86'
|
2011-05-26 09:02:46 +00:00
|
|
|
;;
|
2011-07-12 09:28:47 +00:00
|
|
|
mips*)
|
|
|
|
echo "MIPS"
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var DEFINES "-DMIPS_TARGET"
|
2011-05-26 09:02:46 +00:00
|
|
|
;;
|
2016-12-03 15:01:20 +00:00
|
|
|
powerpc* | ppc*)
|
2011-07-12 09:28:47 +00:00
|
|
|
echo "PowerPC"
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var DEFINES "-DPPC_TARGET"
|
2011-05-26 09:02:46 +00:00
|
|
|
;;
|
2013-01-09 04:10:42 +00:00
|
|
|
amd64 | x86_64)
|
2011-08-08 18:36:06 +00:00
|
|
|
echo "x86_64"
|
2022-12-23 17:42:52 +00:00
|
|
|
_have_amd64=yes
|
|
|
|
define_in_config_h_if_yes $_have_amd64 'HAVE_AMD64'
|
2011-08-08 18:36:06 +00:00
|
|
|
;;
|
2021-06-01 22:59:09 +00:00
|
|
|
wasm32)
|
|
|
|
echo "wasm32"
|
|
|
|
;;
|
2011-05-26 09:02:46 +00:00
|
|
|
*)
|
2011-07-12 09:28:47 +00:00
|
|
|
echo "unknown ($_host_cpu)"
|
2011-05-26 09:02:46 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
|
2007-10-28 13:14:23 +00:00
|
|
|
#
|
|
|
|
# Determine build settings
|
|
|
|
#
|
|
|
|
echo_n "Checking hosttype... "
|
|
|
|
echo $_host_os
|
|
|
|
case $_host_os in
|
2016-04-14 04:39:27 +00:00
|
|
|
3ds)
|
|
|
|
_optimization_level=-O2
|
|
|
|
append_var DEFINES "-D__3DS__"
|
|
|
|
append_var DEFINES "-DARM"
|
|
|
|
append_var DEFINES "-DARM11"
|
2020-02-01 08:36:10 +00:00
|
|
|
append_var CXXFLAGS "-march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft"
|
2016-04-14 04:39:27 +00:00
|
|
|
append_var CXXFLAGS "-mword-relocations"
|
|
|
|
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"
|
2020-02-01 08:36:10 +00:00
|
|
|
append_var LDFLAGS "-march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft"
|
2018-11-21 15:42:32 +00:00
|
|
|
append_var LDFLAGS "-L$DEVKITPRO/libctru/lib"
|
2016-04-14 04:39:27 +00:00
|
|
|
append_var LDFLAGS "-L$DEVKITPRO/portlibs/3ds/lib"
|
2020-02-01 08:36:10 +00:00
|
|
|
append_var LDFLAGS "-specs=3dsx.specs -lctru"
|
|
|
|
append_var LIBS "-lcitro3d"
|
2016-04-14 04:39:27 +00:00
|
|
|
;;
|
2010-02-02 11:46:35 +00:00
|
|
|
amigaos*)
|
2022-05-15 16:14:41 +00:00
|
|
|
# Leave out resources by default to save binary size
|
|
|
|
_builtin_resources=no
|
|
|
|
# AmigaOS (PPC) target
|
|
|
|
_port_mk="backends/platform/sdl/amigaos/amigaos.mk"
|
|
|
|
add_line_to_config_mk 'AMIGAOS = 1'
|
|
|
|
append_var CXXFLAGS "-mlongcall"
|
2022-12-30 10:57:12 +00:00
|
|
|
# Dependencies might also be compiled with stack protection
|
|
|
|
append_var LDFLAGS "-fstack-protector"
|
2022-09-10 16:26:31 +00:00
|
|
|
# Enable full optimizations for non-debug builds
|
2022-05-15 16:14:41 +00:00
|
|
|
if test "$_debug_build" = no; then
|
2022-09-10 16:26:31 +00:00
|
|
|
_optimization_level=-O3
|
2022-05-15 16:14:41 +00:00
|
|
|
else
|
|
|
|
_optimization_level=-O0
|
|
|
|
append_var CXXFLAGS "-fno-omit-frame-pointer"
|
|
|
|
append_var CXXFLAGS "-fno-strict-aliasing"
|
2022-06-20 18:27:04 +00:00
|
|
|
define_in_config_if_yes "$_debug_build" 'DEBUG_BUILD'
|
2022-05-15 16:14:41 +00:00
|
|
|
fi
|
|
|
|
# When building dynamic, add everything possible as plugin
|
2022-07-11 21:50:57 +00:00
|
|
|
# except detection_features (see bug #13603)
|
2020-12-01 09:43:47 +00:00
|
|
|
if test "$_dynamic_modules" = yes ; then
|
2022-07-11 21:50:57 +00:00
|
|
|
_detection_features_static=yes
|
2020-12-01 09:43:47 +00:00
|
|
|
_plugins_default=dynamic
|
|
|
|
fi
|
2022-05-18 12:36:54 +00:00
|
|
|
# Use 'long' for ScummVM's 4 byte typedef, because AmigaOS
|
|
|
|
# already typedefs (u)int32 as (unsigned) long and suppress
|
|
|
|
# those noisy format warnings caused by the 'long' 4 byte
|
2020-12-01 09:43:47 +00:00
|
|
|
type_4_byte='long'
|
|
|
|
append_var CXXFLAGS "-Wno-format"
|
2009-05-16 12:35:48 +00:00
|
|
|
;;
|
2010-08-02 17:11:25 +00:00
|
|
|
android)
|
2011-03-10 18:24:28 +00:00
|
|
|
case $_host in
|
2020-02-26 19:28:49 +00:00
|
|
|
android-arm-v7a)
|
|
|
|
# Disable NEON for older devices (like with Tegra 2)
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var CXXFLAGS "-mfpu=vfp"
|
2020-02-26 19:28:49 +00:00
|
|
|
# This is really old CPU but might be still used with android 4.1, it slightly increases code size and decreases performance.
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var LDFLAGS "-Wl,--fix-cortex-a8"
|
2014-01-23 23:15:13 +00:00
|
|
|
ABI="armeabi-v7a"
|
2019-05-08 18:10:14 +00:00
|
|
|
;;
|
|
|
|
android-arm64-v8a)
|
|
|
|
ABI="arm64-v8a"
|
2014-03-12 03:38:27 +00:00
|
|
|
;;
|
|
|
|
android-x86)
|
|
|
|
ABI="x86"
|
2011-03-10 18:24:28 +00:00
|
|
|
;;
|
2019-09-29 17:53:59 +00:00
|
|
|
android-x86_64)
|
|
|
|
ABI="x86_64"
|
|
|
|
;;
|
2013-08-07 14:54:40 +00:00
|
|
|
ouya)
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var CXXFLAGS "-mtune=cortex-a9"
|
2014-01-23 23:15:13 +00:00
|
|
|
ABI="armeabi-v7a"
|
2013-08-07 14:54:40 +00:00
|
|
|
;;
|
2011-03-10 18:24:28 +00:00
|
|
|
esac
|
2014-03-12 03:38:27 +00:00
|
|
|
|
2020-02-26 19:28:49 +00:00
|
|
|
append_var CXXFLAGS "-Wno-inconsistent-missing-override"
|
|
|
|
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var CXXFLAGS "-fpic"
|
|
|
|
append_var CXXFLAGS "-ffunction-sections"
|
|
|
|
append_var CXXFLAGS "-funwind-tables"
|
2020-02-26 19:28:49 +00:00
|
|
|
if test "$_debug_build" = no; then
|
|
|
|
_optimization_level=-Os
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var CXXFLAGS "-fomit-frame-pointer"
|
|
|
|
append_var CXXFLAGS "-fstrict-aliasing"
|
2020-02-26 19:28:49 +00:00
|
|
|
else
|
|
|
|
_optimization_level=-O0
|
|
|
|
append_var CXXFLAGS "-fno-omit-frame-pointer"
|
|
|
|
append_var CXXFLAGS "-fno-strict-aliasing"
|
2011-02-22 21:13:44 +00:00
|
|
|
fi
|
2014-03-12 03:38:27 +00:00
|
|
|
|
2020-02-26 19:28:49 +00:00
|
|
|
# Build ID is needed for native debugging in Android Studio
|
|
|
|
append_var LDFLAGS "-Wl,--build-id=sha1"
|
|
|
|
|
|
|
|
add_line_to_config_mk "ANDROID_SDK_ROOT := $ANDROID_SDK_ROOT"
|
|
|
|
add_line_to_config_mk "ANDROID_NDK_ROOT := $ANDROID_NDK_ROOT"
|
|
|
|
|
2010-08-02 17:11:25 +00:00
|
|
|
_seq_midi=no
|
|
|
|
;;
|
2008-01-31 12:20:47 +00:00
|
|
|
beos*)
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var DEFINES "-DSYSTEM_NOT_SUPPORTING_D_TYPE"
|
2008-02-26 16:55:58 +00:00
|
|
|
# Needs -lbind -lsocket for the timidity MIDI driver
|
2009-01-05 20:12:28 +00:00
|
|
|
LDFLAGS="-L/boot/home/config/lib"
|
|
|
|
CFLAGS="-I/boot/home/config/include"
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var CXXFLAGS "-fhuge-objects"
|
|
|
|
append_var LIBS "-lbind -lsocket"
|
2010-07-20 08:25:13 +00:00
|
|
|
_seq_midi=no
|
2009-03-19 21:42:50 +00:00
|
|
|
;;
|
2010-02-02 11:46:35 +00:00
|
|
|
cygwin*)
|
CONFIGURE: Allow Cygwin as development platform.
I would like to suggest to allow the use of Cygwin as development platform.
This is not intended for providing builds for this environment (although SCUMMVM can be already built on it without problems), but for having an easy way for testing POSIX code on Windows.
There could be some alternatives, like the (defunt) Microsoft POSIX subsystem, the (also defunct) Windows Services for UNIX or the WSL1 and WSL2, but they are all painful experiences, at least for me, especially when debugging graphical applications connected to an X server or working with physical devices (try to believe). Alternatively, it is also possible to make a full virtual machine by using emulators like QEMU, but it has not the same advantages of having the code running natively, especially when sharing the same files..
So, this should be seen as a tool for developers, nothing more than that, because at the time of writing this seems to be the best and most comfortable way for debugging a change to the ports using POSIX code.
However, to avoid unintentional execution, the user must activate the support for Cygwin by providing --enable-cygwin-build at configure time, otherwise the process will halt again.
Even when support for Cygwin is activated, a warning message is still shown to the user, for informing him on what he is doing.
2022-12-17 13:22:30 +00:00
|
|
|
if test "$_cygwin_build" = no; then
|
|
|
|
echo ERROR: Cygwin building is not supported by ScummVM anymore. Consider using MinGW.
|
|
|
|
exit 1
|
|
|
|
else
|
|
|
|
echo WARNING: Cygwin building is not supported by ScummVM anymore.
|
|
|
|
echo Cygwin should be used only for development purposes and testing POSIX code on Windows.
|
|
|
|
echo Consider using MinGW instead.
|
|
|
|
append_var DEFINES "-D_GNU_SOURCE"
|
|
|
|
fi
|
2010-02-02 11:46:35 +00:00
|
|
|
;;
|
|
|
|
darwin*)
|
2015-01-18 22:00:51 +00:00
|
|
|
case $_host_cpu in
|
|
|
|
powerpc*)
|
MACOS: Drop PowerPC static builds workarounds, and suggest dynamic plugins
-mlongcall -Os would work until ScummVM 2.2.0, but now the engines are
too big to fit in a single static binary on Mac PowerPC.
(On ELF platforms, some flags like -Wl,--relax or -Wl,--gc-sections
can be used as well, but macOS uses Mach-O, and its old linker doesn't
have as many workarounds. -Wl,-dead_strip helped a bit but that's not
enough and you start hitting ld internal errors.)
So, recommend dynamic plugins on Mac PPC, now, and drop -Os -mlongcall
since working around the linker limits is not possible anymore. Using
compiler defaults probably means less bugs when using such an obscure
toolchain, anyway.
(Making a static release it still possible, but only with a very small
set of engines.)
2022-05-06 18:26:25 +00:00
|
|
|
if test "$_dynamic_modules" = no ; then
|
|
|
|
echo "WARNING: Building static engines will probably fail at link time on Mac PowerPC"
|
|
|
|
fi
|
2015-01-18 22:00:51 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var DEFINES "-DMACOSX"
|
|
|
|
append_var LIBS "-framework AudioUnit -framework AudioToolbox -framework Carbon -framework CoreMIDI"
|
2015-03-06 01:21:46 +00:00
|
|
|
# SDL2 doesn't seem to add Cocoa for us.
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var LIBS "-framework Cocoa"
|
2010-02-02 11:46:35 +00:00
|
|
|
add_line_to_config_mk 'MACOSX = 1'
|
2022-05-11 02:42:11 +00:00
|
|
|
_seq_midi=no
|
2011-08-26 16:41:09 +00:00
|
|
|
|
|
|
|
# Now we may have MacPorts or Fink installed
|
|
|
|
# Which put libraries and headers in non-standard places
|
|
|
|
# Checking them here
|
2012-01-20 23:12:26 +00:00
|
|
|
|
2011-08-26 16:41:09 +00:00
|
|
|
# MacPorts
|
|
|
|
# There is no way to get the prefix, so implementing a hack here
|
|
|
|
macport_version=`port version 2>/dev/null`
|
|
|
|
if test "$?" -eq 0; then
|
2011-10-21 12:10:38 +00:00
|
|
|
macport_version="`echo "${macport_version}" | sed -ne 's/Version: \([0-9]\.[0-9]\.[0-9]\)/\1/gp'`"
|
2011-08-26 16:41:09 +00:00
|
|
|
echo_n "You seem to be running MacPorts version ${macport_version}..."
|
|
|
|
|
2011-08-26 16:51:32 +00:00
|
|
|
macport_prefix=`which port`
|
|
|
|
# strip off /bin/port from /opt/local/bin/port
|
|
|
|
macport_prefix=`dirname ${macport_prefix}`
|
|
|
|
macport_prefix=`dirname ${macport_prefix}`
|
2011-08-26 16:41:09 +00:00
|
|
|
|
|
|
|
echo "adding ${macport_prefix} to paths"
|
|
|
|
|
|
|
|
LDFLAGS="-L${macport_prefix}/lib $LDFLAGS"
|
2011-08-26 16:51:32 +00:00
|
|
|
CXXFLAGS="-I${macport_prefix}/include $CXXFLAGS"
|
2016-02-24 17:52:29 +00:00
|
|
|
|
2013-09-17 20:54:12 +00:00
|
|
|
if test -z "$_staticlibpath"; then
|
|
|
|
_staticlibpath=${macport_prefix}
|
|
|
|
echo "Set staticlib-prefix to ${_staticlibpath}"
|
|
|
|
fi
|
|
|
|
fi
|
2014-05-28 10:55:38 +00:00
|
|
|
|
|
|
|
# Fink
|
|
|
|
# There is no way to get the prefix, so implementing a hack here
|
|
|
|
fink_version=`fink -V 2>/dev/null`
|
|
|
|
if test "$?" -eq 0; then
|
|
|
|
fink_version="`echo "${fink_version}" | sed -ne 's/Package manager version: \([0-9.]*\)/\1/gp'`"
|
|
|
|
echo_n "You seem to be running Fink version ${fink_version}..."
|
|
|
|
|
|
|
|
fink_prefix=`which fink`
|
|
|
|
# strip off /bin/fink from /sw/bin/port
|
|
|
|
fink_prefix=`dirname ${fink_prefix}`
|
|
|
|
fink_prefix=`dirname ${fink_prefix}`
|
|
|
|
|
|
|
|
echo "adding ${fink_prefix} to paths"
|
|
|
|
|
|
|
|
LDFLAGS="-L${fink_prefix}/lib $LDFLAGS"
|
|
|
|
CXXFLAGS="-I${fink_prefix}/include $CXXFLAGS"
|
|
|
|
|
|
|
|
if test -z "$_staticlibpath"; then
|
|
|
|
_staticlibpath=${fink_prefix}
|
|
|
|
echo "Set staticlib-prefix to ${_staticlibpath}"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2014-05-28 13:58:25 +00:00
|
|
|
# Homebrew
|
|
|
|
brew_version=`brew -v 2>/dev/null`
|
|
|
|
if test "$?" -eq 0; then
|
|
|
|
brew_version="`echo "${brew_version}" | sed -ne 's/Homebrew \([0-9.]*\)/\1/gp'`"
|
|
|
|
echo_n "You seem to be running Homebrew version ${brew_version}..."
|
|
|
|
|
|
|
|
brew_prefix=`brew --prefix`
|
|
|
|
|
|
|
|
echo "adding ${brew_prefix} to paths"
|
|
|
|
|
|
|
|
LDFLAGS="-L${brew_prefix}/lib $LDFLAGS"
|
|
|
|
CXXFLAGS="-I${brew_prefix}/include $CXXFLAGS"
|
|
|
|
|
|
|
|
if test -z "$_staticlibpath"; then
|
|
|
|
_staticlibpath=${brew_prefix}
|
|
|
|
echo "Set staticlib-prefix to ${_staticlibpath}"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2013-09-17 20:54:12 +00:00
|
|
|
# If _staticlibpath is not set yet try first /sw (fink) then /usr/local
|
|
|
|
# (the macports case is handled above).
|
|
|
|
if test -z "$_staticlibpath"; then
|
|
|
|
if test -d "/sw"; then
|
|
|
|
_staticlibpath=/sw
|
|
|
|
echo "Set staticlib-prefix to ${_staticlibpath}"
|
|
|
|
elif test -d "/usr/local"; then
|
|
|
|
_staticlibpath=/usr/local
|
|
|
|
echo "Set staticlib-prefix to ${_staticlibpath}"
|
|
|
|
else
|
|
|
|
echo "Could not determine prefix for static libraries"
|
|
|
|
fi
|
2011-08-26 16:41:09 +00:00
|
|
|
fi
|
2016-04-10 11:05:39 +00:00
|
|
|
|
2016-03-05 23:16:55 +00:00
|
|
|
# If _xcodetoolspath is not set yet use xcode-select to get the path
|
2016-03-05 23:07:21 +00:00
|
|
|
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
|
2019-04-21 00:21:56 +00:00
|
|
|
|
2020-12-31 06:23:36 +00:00
|
|
|
echocheck "macOS deployment target"
|
2020-11-15 12:08:51 +00:00
|
|
|
cat > $TMPC << EOF
|
2020-03-28 16:47:29 +00:00
|
|
|
#include "AvailabilityMacros.h"
|
2020-11-15 14:49:21 +00:00
|
|
|
|
|
|
|
#define _DIGIT(x) #x
|
|
|
|
#define DIGIT(x) _DIGIT(x)
|
|
|
|
|
|
|
|
const char version[] = "Version:" DIGIT(MAC_OS_X_VERSION_MIN_REQUIRED);
|
|
|
|
const char *_version() { char *s = (char *)version; return s; }
|
|
|
|
|
|
|
|
int main(int argc, char *argv[]) { _version(); return 0; }
|
2020-03-28 16:47:29 +00:00
|
|
|
EOF
|
2020-11-15 12:08:51 +00:00
|
|
|
cc_check_no_clean
|
2020-11-15 14:49:21 +00:00
|
|
|
if $_strings $TMPO$HOSTEXEEXT | grep Version: >/dev/null; then
|
|
|
|
_macos_min_version=`$_strings $TMPO$HOSTEXEEXT | grep Version:`
|
2020-11-15 16:07:59 +00:00
|
|
|
_macos_min_version="${_macos_min_version#Version:}"
|
2020-11-15 14:49:21 +00:00
|
|
|
fi
|
2020-11-15 12:08:51 +00:00
|
|
|
cc_check_clean
|
|
|
|
|
2020-04-25 21:29:41 +00:00
|
|
|
# Also get a dot version of the min version
|
|
|
|
_macos_min_version_dot=undefined
|
2020-11-15 12:09:14 +00:00
|
|
|
if test -n "$_macos_min_version" ; then
|
2020-04-25 21:29:41 +00:00
|
|
|
if test "$_macos_min_version" -lt 101000; then
|
|
|
|
_macos_min_ver_major=$((${_macos_min_version}/100))
|
|
|
|
_macos_min_ver_minor=$((${_macos_min_version}/10 - 10*${_macos_min_ver_major}))
|
|
|
|
_macos_min_version_dot=${_macos_min_ver_major}.${_macos_min_ver_minor}
|
|
|
|
else
|
|
|
|
_macos_min_ver_major=$((${_macos_min_version}/10000))
|
|
|
|
_macos_min_ver_minor=$((${_macos_min_version}/100 - 100*${_macos_min_ver_major}))
|
|
|
|
_macos_min_version_dot=${_macos_min_ver_major}.${_macos_min_ver_minor}
|
|
|
|
fi
|
2020-03-28 16:47:29 +00:00
|
|
|
fi
|
2020-04-25 21:29:41 +00:00
|
|
|
echo $_macos_min_version_dot
|
|
|
|
|
2020-11-15 12:09:14 +00:00
|
|
|
# Version-specific quirks
|
|
|
|
if test -n "$_macos_min_version" ; then
|
2022-05-06 18:04:21 +00:00
|
|
|
# When building for MacOS X 10.5 or below
|
2020-11-15 12:09:14 +00:00
|
|
|
if test "$_macos_min_version" -lt 1060 ; then
|
2022-05-06 18:04:21 +00:00
|
|
|
add_line_to_config_mk 'MACOSX_LEOPARD_OR_BELOW = 1'
|
2022-11-19 10:21:11 +00:00
|
|
|
if test "$_debug_build" != no ; then
|
|
|
|
# Newer compiler but ancient gdb
|
|
|
|
append_var CXXFLAGS "-gstabs+"
|
|
|
|
fi
|
2020-11-15 12:09:14 +00:00
|
|
|
fi
|
2020-04-25 21:29:41 +00:00
|
|
|
|
2020-11-15 12:09:14 +00:00
|
|
|
# When building with SDK 10.14 or above, we cannot compile the 32 bits dock plugin
|
|
|
|
# Assume the SDK version is the same as the min version.
|
|
|
|
if test "$_macos_min_version" -gt 101399 ; then
|
|
|
|
add_line_to_config_mk 'MACOSX_64_BITS_ONLY = 1'
|
|
|
|
fi
|
2020-03-28 16:47:29 +00:00
|
|
|
fi
|
2022-06-05 14:08:03 +00:00
|
|
|
if test "$_host_cpu" = "aarch64" ; then
|
|
|
|
add_line_to_config_mk 'MACOSX_ARM64 = 1'
|
|
|
|
fi
|
2020-03-28 16:47:29 +00:00
|
|
|
|
2022-05-06 17:24:12 +00:00
|
|
|
# Avoid "file has no symbols" noise from ranlib, if it's new enough
|
2022-04-27 10:58:40 +00:00
|
|
|
ranlib_version=`$_ranlib -V 2>/dev/null`
|
|
|
|
if test -n "$ranlib_version" ; then
|
|
|
|
ranlib_version="`echo "${ranlib_version}" | sed -ne 's/.*cctools-\([0-9]\{1,\}\).*/\1/gp'`"
|
|
|
|
if test -n "$ranlib_version" && test "$ranlib_version" -ge 862 ; then
|
|
|
|
append_var _ranlib "-no_warning_for_no_symbols"
|
|
|
|
# Also tell ar not to do its own calls to ranlib
|
|
|
|
append_var _ar "-S"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2019-04-21 00:21:56 +00:00
|
|
|
# Use pandoc to generate README and NEWS file for the bundle
|
2022-08-27 19:33:17 +00:00
|
|
|
# Also default to HTML rather than plain text as it gives a nicer
|
2019-04-21 00:21:56 +00:00
|
|
|
# formating, especially for the README. We could consider using RTF
|
|
|
|
# as well, but TextEdit does not support links within the document,
|
|
|
|
# and having a TOC with links, which we do with html, is quite convenient.
|
|
|
|
_pandoc=yes
|
|
|
|
if test "$_pandocformat" = "default"; then
|
|
|
|
_pandocformat="html"
|
|
|
|
fi
|
2010-02-02 11:46:35 +00:00
|
|
|
;;
|
|
|
|
dreamcast)
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var DEFINES "-D__DC__"
|
|
|
|
append_var DEFINES "-DNONSTANDARD_PORT"
|
2021-09-20 21:19:40 +00:00
|
|
|
_detection_features_full=no
|
|
|
|
if test "$_dynamic_modules" = yes ; then
|
|
|
|
_detection_features_static=no
|
|
|
|
fi
|
2010-02-02 11:46:35 +00:00
|
|
|
;;
|
2010-08-02 17:11:25 +00:00
|
|
|
ds)
|
2020-09-14 18:56:53 +00:00
|
|
|
_optimization_level=-Os
|
2015-07-22 12:32:03 +00:00
|
|
|
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"
|
2018-04-07 16:47:23 +00:00
|
|
|
append_var CXXFLAGS "-isystem $DEVKITPRO/portlibs/nds/include"
|
|
|
|
append_var CXXFLAGS "-isystem $DEVKITPRO/portlibs/armv5te/include"
|
2020-07-23 10:27:34 +00:00
|
|
|
append_var CXXFLAGS "-march=armv5te"
|
|
|
|
append_var CXXFLAGS "-mtune=arm946e-s"
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var CXXFLAGS "-fomit-frame-pointer"
|
2020-09-14 18:56:53 +00:00
|
|
|
append_var CXXFLAGS "-mthumb"
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var CXXFLAGS "-mthumb-interwork"
|
|
|
|
append_var CXXFLAGS "-ffunction-sections"
|
|
|
|
append_var CXXFLAGS "-fdata-sections"
|
|
|
|
append_var CXXFLAGS "-fno-strict-aliasing"
|
2021-08-26 17:33:05 +00:00
|
|
|
append_var CXXFLAGS "-fno-threadsafe-statics"
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var CXXFLAGS "-fuse-cxa-atexit"
|
2022-08-27 19:33:17 +00:00
|
|
|
# Suppress format warnings as the long 4 byte causes noisy warnings.
|
2021-02-04 22:22:01 +00:00
|
|
|
append_var CXXFLAGS "-Wno-format"
|
2020-09-22 17:17:33 +00:00
|
|
|
append_var LDFLAGS "-mthumb"
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var LDFLAGS "-mthumb-interwork"
|
2017-11-14 23:00:56 +00:00
|
|
|
append_var LDFLAGS "-mfloat-abi=soft"
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var LDFLAGS "-Wl,-Map,map.txt"
|
|
|
|
append_var LDFLAGS "-L$DEVKITPRO/libnds/lib"
|
2017-11-14 23:00:56 +00:00
|
|
|
append_var LDFLAGS "-L$DEVKITPRO/portlibs/nds/lib"
|
|
|
|
append_var LDFLAGS "-L$DEVKITPRO/portlibs/armv5te/lib"
|
2017-12-07 23:46:47 +00:00
|
|
|
append_var LIBS "-specs=ds_arm9.specs"
|
2020-06-01 21:47:20 +00:00
|
|
|
append_var LIBS "-lfilesystem"
|
|
|
|
append_var LIBS "-lfat"
|
2020-08-23 15:01:19 +00:00
|
|
|
append_var LIBS "-lmm9"
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var LIBS "-lnds9"
|
2010-08-02 17:11:25 +00:00
|
|
|
;;
|
2021-06-01 22:59:09 +00:00
|
|
|
emscripten)
|
|
|
|
# mandatory emscripten flags
|
2022-06-08 21:20:39 +00:00
|
|
|
append_var LDFLAGS "-s ALLOW_MEMORY_GROWTH=1 -s ASYNCIFY -s FORCE_FILESYSTEM=1"
|
2022-07-03 12:28:10 +00:00
|
|
|
|
2022-03-19 01:26:56 +00:00
|
|
|
append_var DEFINES "-DEMSCRIPTEN"
|
|
|
|
add_line_to_config_mk 'EMSCRIPTEN = 1'
|
|
|
|
|
2022-06-08 21:20:39 +00:00
|
|
|
if test "$_debug_build" = yes; then
|
2022-07-03 12:28:10 +00:00
|
|
|
_optimization_level=-O2
|
2022-06-08 21:20:39 +00:00
|
|
|
append_var LDFLAGS "-O2 -g3 -s ASSERTIONS=2"
|
2021-06-01 22:59:09 +00:00
|
|
|
else
|
2022-06-08 21:20:39 +00:00
|
|
|
_optimization_level=-O3
|
|
|
|
append_var LDFLAGS "-O3"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# activate emscripten-ports
|
|
|
|
if test "$_freetype2" != no; then
|
|
|
|
append_var LDFLAGS "-s USE_FREETYPE=1 -s SUPPORT_LONGJMP=1" # freetype requires setjmp
|
|
|
|
# neither pkg-config nor freetype-config work, so we setup freetype manually
|
|
|
|
_freetypepath="$EMSCRIPTEN/cache/ports-builds/freetype/"
|
|
|
|
FREETYPE2_CFLAGS="-I$_freetypepath/include" # there were link errors / missing symbols without this
|
|
|
|
_freetype_found="true"
|
2022-07-03 12:28:10 +00:00
|
|
|
else
|
2022-08-26 09:50:27 +00:00
|
|
|
#use link time optimization to further reduce exe size (this can't be used with setjmp which freetype requires)
|
2022-06-08 21:20:39 +00:00
|
|
|
# TODO: Figure out why this is a conflict and/or if freetype can be built without setjmp
|
|
|
|
append_var CXXFLAGS "-flto"
|
|
|
|
append_var LDFLAGS "-flto"
|
|
|
|
fi
|
2022-07-03 12:28:10 +00:00
|
|
|
if test "$_jpeg" != no; then
|
2022-06-08 21:20:39 +00:00
|
|
|
append_var LDFLAGS "-s USE_LIBJPEG=1"
|
|
|
|
fi
|
|
|
|
if test "$_png" != no; then
|
|
|
|
append_var LDFLAGS "-s USE_LIBPNG=1"
|
|
|
|
fi
|
|
|
|
if test "$_sdl" != no; then
|
|
|
|
append_var LDFLAGS "-s USE_SDL=2 "
|
2022-07-03 12:28:10 +00:00
|
|
|
fi
|
|
|
|
if test "$_vorbis" != no; then
|
2022-06-08 21:20:39 +00:00
|
|
|
append_var LDFLAGS "-s USE_OGG=1" # vorbis needs to be linked against OGG (even if we use an external vorbis lib)
|
|
|
|
fi
|
|
|
|
if test "$_zlib" != no; then
|
|
|
|
append_var LDFLAGS "-s USE_ZLIB=1"
|
2021-06-01 22:59:09 +00:00
|
|
|
fi
|
2021-08-27 02:14:25 +00:00
|
|
|
;;
|
2022-11-12 20:15:28 +00:00
|
|
|
freebsd* | dragonfly*)
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var LDFLAGS "-L/usr/local/lib"
|
|
|
|
append_var CXXFLAGS "-I/usr/local/include"
|
2010-02-02 11:46:35 +00:00
|
|
|
;;
|
|
|
|
gamecube)
|
2011-10-07 22:45:56 +00:00
|
|
|
_optimization_level=-Os
|
2015-07-22 12:32:03 +00:00
|
|
|
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"
|
2019-09-23 10:45:42 +00:00
|
|
|
append_var CXXFLAGS "-I$DEVKITPRO/portlibs/ppc/include"
|
2010-06-15 18:42:08 +00:00
|
|
|
# libogc is required to link the cc tests (includes _start())
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var LDFLAGS "-mogc"
|
|
|
|
append_var LDFLAGS "-mcpu=750"
|
|
|
|
append_var LDFLAGS "-L$DEVKITPRO/libogc/lib/cube"
|
2019-09-23 10:45:42 +00:00
|
|
|
append_var LDFLAGS "-L$DEVKITPRO/portlibs/ppc/lib"
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var LDFLAGS "-logc"
|
2010-09-05 12:49:29 +00:00
|
|
|
if test "$_dynamic_modules" = "yes" ; then
|
|
|
|
# retarded toolchain patch forces --gc-sections, overwrite it
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var LDFLAGS "-Wl,--no-gc-sections"
|
2010-09-05 12:49:29 +00:00
|
|
|
fi
|
2010-02-02 11:46:35 +00:00
|
|
|
;;
|
2009-01-05 20:12:28 +00:00
|
|
|
haiku*)
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var DEFINES "-DSYSTEM_NOT_SUPPORTING_D_TYPE"
|
2009-01-05 20:12:28 +00:00
|
|
|
# Needs -lnetwork for the timidity MIDI driver
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var LIBS "-lnetwork"
|
2010-07-20 08:25:13 +00:00
|
|
|
_seq_midi=no
|
2009-03-19 21:42:50 +00:00
|
|
|
;;
|
2007-10-28 13:14:23 +00:00
|
|
|
irix*)
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var DEFINES "-DIRIX"
|
|
|
|
append_var DEFINES "-DSYSTEM_NOT_SUPPORTING_D_TYPE"
|
|
|
|
append_var LIBS "-lmd -lfastm -lm"
|
2007-10-28 13:14:23 +00:00
|
|
|
_ranlib=:
|
|
|
|
;;
|
2010-02-02 11:46:35 +00:00
|
|
|
linux* | uclinux*)
|
2007-10-28 13:14:23 +00:00
|
|
|
;;
|
|
|
|
mingw*)
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var DEFINES "-DWIN32"
|
2019-05-24 18:26:23 +00:00
|
|
|
# append_var DEFINES "-D__USE_MINGW_ANSI_STDIO=0" # Modern MinGW does not need it
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var LDFLAGS "-static-libgcc -static-libstdc++"
|
|
|
|
append_var LIBS "-lmingw32 -lwinmm -lgdi32"
|
2018-12-15 00:11:05 +00:00
|
|
|
append_var OBJS "dists/scummvm.o"
|
2010-11-28 17:41:33 +00:00
|
|
|
add_line_to_config_mk 'WIN32 = 1'
|
2018-11-13 23:01:39 +00:00
|
|
|
_port_mk="backends/platform/sdl/win32/win32.mk"
|
2007-10-28 13:14:23 +00:00
|
|
|
;;
|
|
|
|
mint*)
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var DEFINES "-DSYSTEM_NOT_SUPPORTING_D_TYPE"
|
2017-11-05 00:09:48 +00:00
|
|
|
append_var DEFINES "-D_GNU_SOURCE"
|
|
|
|
append_var DEFINES "-D_ISOC11_SOURCE"
|
2007-10-28 13:14:23 +00:00
|
|
|
;;
|
2020-09-15 12:48:06 +00:00
|
|
|
morphos*)
|
|
|
|
if test "$_debug_build" = no; then
|
|
|
|
_optimization_level=-O2
|
|
|
|
fi
|
|
|
|
append_var LDFLAGS "-Wl,--export-dynamic"
|
|
|
|
append_var LDFLAGS "-L/usr/local/lib"
|
|
|
|
append_var CXXFLAGS "-D__MORPHOS_SHAREDLIBS"
|
|
|
|
# We have to use 'long' for our 4 byte typedef because MorphOS 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.
|
|
|
|
append_var CXXFLAGS "-Wno-format"
|
|
|
|
add_line_to_config_mk 'MORPHOS = 1'
|
|
|
|
_port_mk="backends/platform/sdl/morphos/morphos.mk"
|
2020-12-03 10:56:34 +00:00
|
|
|
# use SDL2
|
2020-09-15 12:48:06 +00:00
|
|
|
_sdlconfig=sdl2-config
|
|
|
|
;;
|
2016-03-05 13:59:15 +00:00
|
|
|
msys)
|
|
|
|
echo ERROR: Using the MSYS shell in msys mode is not supported. Please use the MSYS shell in mingw mode instead.
|
|
|
|
exit 1
|
|
|
|
;;
|
2010-08-01 17:16:39 +00:00
|
|
|
n64)
|
2015-07-22 12:32:03 +00:00
|
|
|
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"
|
2017-01-15 19:31:45 +00:00
|
|
|
add_line_to_config_mk 'N64 = 1'
|
2020-12-06 14:28:08 +00:00
|
|
|
_detection_features_full=no
|
2018-04-07 07:52:44 +00:00
|
|
|
_nuked_opl=no
|
2010-08-01 17:16:39 +00:00
|
|
|
;;
|
2022-05-30 09:34:56 +00:00
|
|
|
openbsd*)
|
|
|
|
append_var LDFLAGS "-L/usr/local/lib"
|
|
|
|
append_var CXXFLAGS "-I/usr/local/include"
|
|
|
|
_seq_midi=no
|
|
|
|
;;
|
2011-06-02 08:34:41 +00:00
|
|
|
ps3)
|
2012-08-21 14:21:10 +00:00
|
|
|
# Force use of SDL and freetype from the ps3 toolchain
|
2011-06-02 08:34:41 +00:00
|
|
|
_sdlpath="$PS3DEV/portlibs/ppu:$PS3DEV/portlibs/ppu/bin"
|
2012-08-21 14:21:10 +00:00
|
|
|
_freetypepath="$PS3DEV/portlibs/ppu:$PS3DEV/portlibs/ppu/bin"
|
2016-08-30 19:00:03 +00:00
|
|
|
_libcurlpath="$PS3DEV/portlibs/ppu:$PS3DEV/portlibs/ppu/bin"
|
2011-08-08 19:09:48 +00:00
|
|
|
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var DEFINES "-DPLAYSTATION3"
|
2018-02-04 20:37:24 +00:00
|
|
|
append_var CXXFLAGS "-mcpu=cell -mno-fp-in-toc -I$PSL1GHT/ppu/include -I$PS3DEV/portlibs/ppu/include"
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var LDFLAGS "-L$PSL1GHT/ppu/lib -L$PS3DEV/portlibs/ppu/lib"
|
2016-08-31 06:09:36 +00:00
|
|
|
# The network libraries are statically linked and need to be specified in the following order
|
2022-02-06 20:20:49 +00:00
|
|
|
append_var SDL_NET_LIBS "-lSDL2_net -lnet -lnetctl -lsysmodule"
|
2011-06-02 08:34:41 +00:00
|
|
|
add_line_to_config_mk 'PLAYSTATION3 = 1'
|
|
|
|
add_line_to_config_h "#define PREFIX \"${prefix}\""
|
2022-01-23 09:18:04 +00:00
|
|
|
# PS3 has no OpenGL support at all even though it's SDL based
|
|
|
|
_opengl_mode=none
|
2011-06-02 08:34:41 +00:00
|
|
|
;;
|
2017-03-01 20:00:17 +00:00
|
|
|
psp2)
|
|
|
|
_freetypepath="$VITASDK/arm-vita-eabi/bin"
|
|
|
|
_freetype2=yes
|
|
|
|
_libcurlpath="$VITASDK/arm-vita-eabi/bin"
|
|
|
|
append_var CXXFLAGS "--sysroot=$VITASDK/arm-vita-eabi"
|
|
|
|
append_var LDFLAGS "--sysroot=$VITASDK/arm-vita-eabi"
|
|
|
|
append_var DEFINES "-DPSP2 -DSYSTEM_NOT_SUPPORTING_D_TYPE"
|
|
|
|
append_var CXXFLAGS "-Wl,-q -I$VITASDK/arm-vita-eabi/include"
|
|
|
|
append_var CXXFLAGS "-march=armv7-a -mtune=cortex-a9 -mfpu=neon -mfloat-abi=hard"
|
|
|
|
append_var LDFLAGS "-Wl,-q -L$VITASDK/arm-vita-eabi/lib"
|
2017-03-11 04:09:07 +00:00
|
|
|
#the next line fixes a crash when starting scumm-7-8 games (The Dig etc.)
|
|
|
|
#when either -O2, -O3 or -Os optimizations are enabled
|
|
|
|
append_var CXXFLAGS "-fno-optimize-sibling-calls"
|
|
|
|
#the next line fixes "branch out of range" error in gob engine when -Os is used
|
2017-03-10 21:29:06 +00:00
|
|
|
append_var CXXFLAGS "-mlong-calls"
|
2020-03-14 05:45:39 +00:00
|
|
|
append_var CXXFLAGS "-mword-relocations"
|
|
|
|
append_var CXXFLAGS "-fomit-frame-pointer"
|
2020-03-14 14:42:44 +00:00
|
|
|
#ensure verbose output during linking to prevent buildbot kills after 1200 seconds
|
|
|
|
if test "$_verbose_build" = yes ; then
|
|
|
|
append_var LDFLAGS "-Wl,-v --verbose"
|
|
|
|
fi
|
2022-07-18 17:25:57 +00:00
|
|
|
if test "$_dynamic_modules" = yes ; then
|
|
|
|
_detection_features_static=no
|
|
|
|
_plugins_default=dynamic
|
|
|
|
fi
|
2017-03-01 20:00:17 +00:00
|
|
|
if test "$_debug_build" = no; then
|
2017-03-11 04:09:07 +00:00
|
|
|
#optimize for smallest file size. This is necessary to prevent a crash on startup
|
|
|
|
#due to the large executable file size when many engines are enabled
|
|
|
|
#for example when --enable-all-engines is used to enable all the unstable engines
|
2017-03-10 21:29:06 +00:00
|
|
|
_optimization_level=-Os
|
2017-03-01 20:00:17 +00:00
|
|
|
fi
|
|
|
|
if test "$_debug_build" = yes; then
|
|
|
|
_optimization_level=-O0
|
|
|
|
append_var DEFINES "-D__PSP2_DEBUG__"
|
|
|
|
append_var LIBS "-lpsp2shell"
|
|
|
|
fi
|
|
|
|
add_line_to_config_mk 'PSP2 = 1'
|
|
|
|
add_line_to_config_h "#define PREFIX \"${prefix}\""
|
|
|
|
;;
|
2010-02-02 11:46:35 +00:00
|
|
|
psp)
|
2019-04-14 00:48:17 +00:00
|
|
|
_optimization_level=-O2
|
2020-10-25 19:00:43 +00:00
|
|
|
_freetypepath="$PSPDEV/psp/bin"
|
|
|
|
if test -z "$PKG_CONFIG_LIBDIR"; then
|
2021-03-29 15:09:42 +00:00
|
|
|
PKG_CONFIG_LIBDIR="$PSPDEV/psp/lib/pkgconfig"
|
2020-10-25 19:00:43 +00:00
|
|
|
fi
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var CXXFLAGS "-I$PSPSDK/include"
|
2011-05-05 14:26:05 +00:00
|
|
|
# FIXME: Why is the following in CXXFLAGS and not in DEFINES? Change or document this.
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var CXXFLAGS "-D_PSP_FW_VERSION=150"
|
2020-10-25 19:00:15 +00:00
|
|
|
append_var CXXFLAGS "-G0"
|
2017-01-16 00:31:05 +00:00
|
|
|
add_line_to_config_mk 'PSP = 1'
|
2010-02-02 11:46:35 +00:00
|
|
|
;;
|
2017-04-27 23:24:57 +00:00
|
|
|
riscos)
|
2019-09-19 16:03:09 +00:00
|
|
|
define_in_config_if_yes yes 'RISCOS'
|
2017-04-27 23:24:57 +00:00
|
|
|
append_var LDFLAGS "-static"
|
2022-06-19 16:15:12 +00:00
|
|
|
_optimization_level=-O3
|
2017-04-27 23:24:57 +00:00
|
|
|
_port_mk="backends/platform/sdl/riscos/riscos.mk"
|
2019-04-17 21:06:17 +00:00
|
|
|
_pandoc=yes
|
2020-02-25 22:42:41 +00:00
|
|
|
_sdlconfig=sdl-config
|
2022-01-04 22:04:05 +00:00
|
|
|
# RiscOS has no OpenGL support at all even though it's SDL based
|
2020-09-09 14:52:38 +00:00
|
|
|
_opengl_mode=none
|
2022-06-18 23:36:25 +00:00
|
|
|
if test "$_dynamic_modules" = yes ; then
|
|
|
|
_detection_features_static=no
|
|
|
|
_plugins_default=dynamic
|
|
|
|
else
|
|
|
|
_detection_features_full=no
|
|
|
|
fi
|
2017-04-27 23:24:57 +00:00
|
|
|
;;
|
2010-02-02 11:46:35 +00:00
|
|
|
solaris*)
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var DEFINES "-DSOLARIS"
|
|
|
|
append_var DEFINES "-DSYSTEM_NOT_SUPPORTING_D_TYPE"
|
2010-02-02 11:46:35 +00:00
|
|
|
# Needs -lbind -lsocket for the timidity MIDI driver
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var LIBS "-lnsl -lsocket"
|
2010-02-02 11:46:35 +00:00
|
|
|
;;
|
2018-09-20 14:33:08 +00:00
|
|
|
switch)
|
|
|
|
_pkgconfig="$DEVKITPRO/portlibs/switch/bin/aarch64-none-elf-pkg-config"
|
2019-06-26 02:32:21 +00:00
|
|
|
_libcurlpath="$DEVKITPRO/portlibs/switch/bin"
|
2018-09-20 14:33:08 +00:00
|
|
|
_sdlpath="$DEVKITPRO/portlibs/switch/bin"
|
|
|
|
append_var DEFINES "-DSWITCH -D__SWITCH__ -DNINTENDO_SWITCH"
|
|
|
|
append_var CXXFLAGS "-march=armv8-a -mtune=cortex-a57 -mtp=soft -fPIE -ftls-model=local-exec"
|
|
|
|
append_var CXXFLAGS "-ffunction-sections -fdata-sections"
|
|
|
|
append_var CXXFLAGS "-I$DEVKITPRO/libnx/include -I$DEVKITPRO/portlibs/switch/include"
|
|
|
|
append_var LDFLAGS "-L$DEVKITPRO/libnx/lib -L$DEVKITPRO/portlibs/switch/lib"
|
2021-01-18 20:25:27 +00:00
|
|
|
append_var LDFLAGS "-specs=$DEVKITPRO/libnx/switch.specs"
|
2018-09-20 14:33:08 +00:00
|
|
|
add_line_to_config_mk 'SWITCH = 1'
|
|
|
|
if test "$_debug_build" = yes; then
|
|
|
|
append_var DEFINES "-D__SWITCH_DEBUG__"
|
|
|
|
else
|
|
|
|
_optimization_level=-O3
|
|
|
|
fi
|
|
|
|
;;
|
2010-02-02 11:46:35 +00:00
|
|
|
wii)
|
2011-10-07 22:45:56 +00:00
|
|
|
_optimization_level=-Os
|
2015-07-22 12:32:03 +00:00
|
|
|
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"
|
2019-09-23 10:45:42 +00:00
|
|
|
append_var CXXFLAGS "-I$DEVKITPRO/portlibs/ppc/include"
|
2010-06-15 18:30:30 +00:00
|
|
|
# libogc is required to link the cc tests (includes _start())
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var LDFLAGS "-mrvl"
|
|
|
|
append_var LDFLAGS "-mcpu=750"
|
|
|
|
append_var LDFLAGS "-L$DEVKITPRO/libogc/lib/wii"
|
2019-09-23 10:45:42 +00:00
|
|
|
append_var LDFLAGS "-L$DEVKITPRO/portlibs/ppc/lib"
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var LDFLAGS "-logc"
|
2010-09-05 12:49:29 +00:00
|
|
|
if test "$_dynamic_modules" = "yes" ; then
|
|
|
|
# retarded toolchain patch forces --gc-sections, overwrite it
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var LDFLAGS "-Wl,--no-gc-sections"
|
2010-09-05 12:49:29 +00:00
|
|
|
fi
|
2010-02-02 11:46:35 +00:00
|
|
|
;;
|
2011-05-05 14:14:28 +00:00
|
|
|
esac
|
|
|
|
|
2004-01-22 04:31:31 +00:00
|
|
|
if test -n "$_host"; then
|
2004-12-16 22:15:32 +00:00
|
|
|
# Cross-compiling mode - add your target here if needed
|
2010-04-09 14:30:10 +00:00
|
|
|
echo "Cross-compiling to $_host"
|
2004-12-16 22:15:32 +00:00
|
|
|
case "$_host" in
|
2016-04-14 04:39:27 +00:00
|
|
|
3ds)
|
|
|
|
append_var DEFINES "-DDISABLE_FANCY_THEMES"
|
2022-07-23 16:25:39 +00:00
|
|
|
append_var DEFINES "-DDISABLE_HELP_STRINGS"
|
2016-04-14 04:39:27 +00:00
|
|
|
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"
|
|
|
|
;;
|
2020-02-26 19:28:49 +00:00
|
|
|
android-arm-v7a | android-arm64-v8a | android-x86 | android-x86_64 | ouya)
|
2019-11-12 18:01:43 +00:00
|
|
|
# also __ANDROID__ is defined by Clang in the NDK
|
2019-11-01 16:56:41 +00:00
|
|
|
DEFINES="$DEFINES -D__ANDROID_PLAIN_PORT__ -DANDROID_PLAIN_PORT"
|
2011-02-06 14:23:47 +00:00
|
|
|
# we link a .so as default
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var LDFLAGS "-shared"
|
|
|
|
append_var LDFLAGS "-Wl,-Bsymbolic,--no-undefined"
|
2020-02-26 19:28:49 +00:00
|
|
|
append_var LDFLAGS "-static-libstdc++"
|
2011-02-06 14:23:47 +00:00
|
|
|
HOSTEXEPRE=lib
|
|
|
|
HOSTEXEEXT=.so
|
2022-02-05 19:59:19 +00:00
|
|
|
_backend="android"
|
2020-10-15 07:59:11 +00:00
|
|
|
_port_mk="backends/platform/$_backend/android.mk"
|
2012-08-25 16:16:46 +00:00
|
|
|
_build_aspect=no
|
2010-08-02 17:11:25 +00:00
|
|
|
_seq_midi=no
|
2011-02-18 18:00:43 +00:00
|
|
|
_timidity=no
|
2010-08-02 17:11:25 +00:00
|
|
|
;;
|
2010-02-23 21:01:05 +00:00
|
|
|
arm-linux|arm*-linux-gnueabi|arm-*-linux)
|
2005-10-26 17:39:23 +00:00
|
|
|
;;
|
2020-09-09 14:52:38 +00:00
|
|
|
arm-vfp-riscos)
|
|
|
|
append_var LDFLAGS "-L$GCCSDK_INSTALL_ENV/vfp/lib"
|
2022-06-18 15:42:38 +00:00
|
|
|
append_var PLUGIN_LDFLAGS "-L$GCCSDK_INSTALL_ENV/vfp/lib"
|
2020-09-09 14:52:38 +00:00
|
|
|
append_var CXXFLAGS "-isystem $GCCSDK_INSTALL_ENV/vfp/include"
|
2021-09-30 21:56:39 +00:00
|
|
|
if test -z "$PKG_CONFIG_LIBDIR"; then
|
|
|
|
PKG_CONFIG_LIBDIR="$GCCSDK_INSTALL_ENV/vfp/lib/pkgconfig"
|
|
|
|
fi
|
2020-09-09 14:52:38 +00:00
|
|
|
_sdlpath=$GCCSDK_INSTALL_ENV/vfp/bin
|
|
|
|
_freetypepath=$GCCSDK_INSTALL_ENV/vfp/bin
|
|
|
|
_libcurlpath=$GCCSDK_INSTALL_ENV/vfp/bin
|
|
|
|
append_var CXXFLAGS "-march=armv6zk"
|
|
|
|
append_var CXXFLAGS "-mtune=cortex-a9"
|
|
|
|
append_var CXXFLAGS "-mfpu=vfp"
|
|
|
|
append_var LDFLAGS "-mfpu=vfp"
|
2022-06-18 15:42:38 +00:00
|
|
|
append_var PLUGIN_LDFLAGS "-mfpu=vfp"
|
2020-09-09 14:52:38 +00:00
|
|
|
append_var ASFLAGS "-mfpu=vfp"
|
|
|
|
;;
|
2017-04-27 23:24:57 +00:00
|
|
|
arm-*riscos)
|
2020-09-09 14:52:38 +00:00
|
|
|
append_var LDFLAGS "-L$GCCSDK_INSTALL_ENV/lib"
|
2022-06-18 15:42:38 +00:00
|
|
|
append_var PLUGIN_LDFLAGS "-L$GCCSDK_INSTALL_ENV/lib"
|
2020-09-09 14:52:38 +00:00
|
|
|
append_var CXXFLAGS "-isystem $GCCSDK_INSTALL_ENV/include"
|
2021-09-30 21:56:39 +00:00
|
|
|
if test -z "$PKG_CONFIG_LIBDIR"; then
|
|
|
|
PKG_CONFIG_LIBDIR="$GCCSDK_INSTALL_ENV/lib/pkgconfig"
|
|
|
|
fi
|
2020-09-09 14:52:38 +00:00
|
|
|
_sdlpath=$GCCSDK_INSTALL_ENV/bin
|
|
|
|
_freetypepath=$GCCSDK_INSTALL_ENV/bin
|
|
|
|
_libcurlpath=$GCCSDK_INSTALL_ENV/bin
|
|
|
|
append_var CXXFLAGS "-march=armv3m"
|
|
|
|
append_var CXXFLAGS "-mtune=xscale"
|
2019-09-19 16:03:09 +00:00
|
|
|
_vorbis=no
|
2009-11-09 14:43:05 +00:00
|
|
|
;;
|
2010-02-02 11:46:35 +00:00
|
|
|
bfin*)
|
|
|
|
;;
|
2010-08-26 11:28:30 +00:00
|
|
|
caanoo)
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var DEFINES "-DCAANOO"
|
2012-08-16 09:54:39 +00:00
|
|
|
if test "$_debug_build" = no; then
|
2010-09-20 19:33:58 +00:00
|
|
|
# Use -O3 on the Caanoo for non-debug builds.
|
2011-10-07 22:45:56 +00:00
|
|
|
_optimization_level=-O3
|
2010-09-20 19:33:58 +00:00
|
|
|
fi
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var CXXFLAGS "-mcpu=arm926ej-s"
|
|
|
|
append_var CXXFLAGS "-mtune=arm926ej-s"
|
2010-09-09 09:55:07 +00:00
|
|
|
_backend="gph"
|
2010-08-26 11:28:30 +00:00
|
|
|
_build_hq_scalers=no
|
2011-09-22 18:32:48 +00:00
|
|
|
_savegame_timestamp=no
|
2010-08-26 11:28:30 +00:00
|
|
|
_vkeybd=yes
|
|
|
|
_seq_midi=no
|
2011-04-12 11:13:38 +00:00
|
|
|
_mt32emu=no
|
|
|
|
_timidity=no
|
2010-09-09 09:55:07 +00:00
|
|
|
_port_mk="backends/platform/gph/caanoo-bundle.mk"
|
2010-10-12 02:18:11 +00:00
|
|
|
;;
|
2010-02-02 11:46:35 +00:00
|
|
|
*darwin*)
|
|
|
|
_ranlib=$_host-ranlib
|
|
|
|
_strip=$_host-strip
|
|
|
|
;;
|
2010-08-19 12:43:37 +00:00
|
|
|
dingux)
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var DEFINES "-DDISABLE_DOSBOX_OPL"
|
|
|
|
append_var DEFINES "-DREDUCE_MEMORY_USAGE"
|
|
|
|
append_var CXXFLAGS "-msoft-float"
|
|
|
|
append_var CXXFLAGS "-mips32"
|
2010-08-19 12:43:37 +00:00
|
|
|
_backend="dingux"
|
|
|
|
_mt32emu=no
|
2018-04-07 07:52:44 +00:00
|
|
|
_nuked_opl=no
|
2012-06-22 12:08:33 +00:00
|
|
|
_optimization_level=-O3
|
2012-06-22 11:11:57 +00:00
|
|
|
# Disable alsa midi to get the port build on OpenDingux toolchain
|
2016-02-24 17:52:29 +00:00
|
|
|
_alsa=no
|
2016-09-02 22:12:43 +00:00
|
|
|
# Disable cloud and SDL_Net due to outdated toolchain
|
|
|
|
_cloud=no
|
|
|
|
_sdlnet=no
|
|
|
|
_libcurl=no
|
2010-08-19 12:43:37 +00:00
|
|
|
_vkeybd=yes
|
|
|
|
_build_hq_scalers=no
|
2010-08-19 15:13:03 +00:00
|
|
|
# Force disable vorbis on dingux, it has terrible performance compared to tremor
|
|
|
|
_vorbis=no
|
2010-08-20 05:06:07 +00:00
|
|
|
# Force disable seq on dingux, no way to use it and it would get enabled by default with configure
|
|
|
|
_seq_midi=no
|
2010-09-08 08:26:20 +00:00
|
|
|
_port_mk="backends/platform/dingux/dingux.mk"
|
2010-08-19 12:43:37 +00:00
|
|
|
;;
|
2021-06-01 22:59:09 +00:00
|
|
|
wasm*-emscripten)
|
|
|
|
_backend="sdl"
|
2022-06-08 21:20:39 +00:00
|
|
|
# Disable cloud and SDL_Net as this is handled in the browser
|
|
|
|
_cloud=no
|
|
|
|
_sdlnet=no
|
|
|
|
_libcurl=no
|
|
|
|
_curl=no
|
2021-08-28 18:47:24 +00:00
|
|
|
_ar="emar cr"
|
2021-06-01 22:59:09 +00:00
|
|
|
_ranlib="emranlib"
|
|
|
|
;;
|
2015-07-22 11:00:45 +00:00
|
|
|
raspberrypi)
|
2020-04-05 18:12:55 +00:00
|
|
|
_libcurlpath=$RPI_ROOT/usr/bin
|
2015-10-18 11:02:29 +00:00
|
|
|
# This is needed because the official cross compiler doesn't have multiarch enabled
|
|
|
|
# but Raspbian does.
|
2015-12-04 14:57:06 +00:00
|
|
|
# Be careful as it's the linker (LDFLAGS) which must know about sysroot.
|
2015-12-04 15:05:19 +00:00
|
|
|
# These are needed to build against Raspbian's libSDL.
|
2015-11-12 13:03:14 +00:00
|
|
|
append_var LDFLAGS "--sysroot=$RPI_ROOT"
|
|
|
|
append_var LDFLAGS "-B$RPI_ROOT/usr/lib/arm-linux-gnueabihf"
|
2020-04-06 01:59:17 +00:00
|
|
|
append_var LDFLAGS "-Xlinker --rpath-link=$RPI_ROOT/usr/lib/arm-linux-gnueabihf/pulseaudio"
|
2015-11-12 13:03:14 +00:00
|
|
|
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"
|
2020-04-05 18:12:55 +00:00
|
|
|
append_var CXXFLAGS "-isystem $RPI_ROOT/usr/include/arm-linux-gnueabihf"
|
2020-04-06 01:59:17 +00:00
|
|
|
append_var CXXFLAGS "-I$RPI_ROOT/usr/include"
|
2016-02-24 17:52:29 +00:00
|
|
|
# We prefer SDL2 on the Raspberry Pi: acceleration now depends on it
|
2015-12-04 15:48:27 +00:00
|
|
|
# since SDL2 manages dispmanx/GLES2 very well internally.
|
|
|
|
# SDL1 is bit-rotten on this platform.
|
|
|
|
_sdlconfig=sdl2-config
|
2015-07-22 11:00:45 +00:00
|
|
|
;;
|
2010-02-02 11:46:35 +00:00
|
|
|
dreamcast)
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var DEFINES "-DDISABLE_DEFAULT_SAVEFILEMANAGER"
|
|
|
|
append_var DEFINES "-DDISABLE_TEXT_CONSOLE"
|
|
|
|
append_var DEFINES "-DDISABLE_COMMAND_LINE"
|
2013-07-10 04:00:25 +00:00
|
|
|
# Enable serial debugging output only when --enable-debug is passed
|
2013-07-11 00:53:06 +00:00
|
|
|
if test "$_release_build" = yes -o "$_debug_build" != yes; then
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var DEFINES "-DNOSERIAL"
|
2011-06-01 16:17:01 +00:00
|
|
|
fi
|
2011-10-07 22:45:56 +00:00
|
|
|
_optimization_level=-O3
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var CXXFLAGS "-funroll-loops"
|
|
|
|
append_var CXXFLAGS "-fschedule-insns2"
|
|
|
|
append_var CXXFLAGS "-fomit-frame-pointer"
|
|
|
|
append_var CXXFLAGS "-fdelete-null-pointer-checks"
|
2010-02-02 11:46:35 +00:00
|
|
|
_backend="dc"
|
2010-08-02 17:12:34 +00:00
|
|
|
_build_scalers=no
|
2012-08-25 16:16:46 +00:00
|
|
|
_build_aspect=no
|
2021-09-20 21:19:40 +00:00
|
|
|
_tinygl=no
|
2018-12-06 08:36:45 +00:00
|
|
|
# These two are needed due to shortcomings of the
|
|
|
|
# detection systems. Do not remove until auto-
|
|
|
|
# detection works correctly.
|
|
|
|
_mad=yes
|
|
|
|
_zlib=yes
|
2010-04-16 10:59:23 +00:00
|
|
|
_port_mk="backends/platform/dc/dreamcast.mk"
|
2010-02-02 11:46:35 +00:00
|
|
|
;;
|
2010-08-02 17:11:25 +00:00
|
|
|
ds)
|
2020-12-19 20:02:56 +00:00
|
|
|
if test "$_dynamic_modules" = yes ; then
|
|
|
|
_detection_features_static=no
|
|
|
|
_plugins_default=dynamic
|
|
|
|
fi
|
2021-08-20 16:42:28 +00:00
|
|
|
_detection_features_full=no
|
2020-08-06 16:24:14 +00:00
|
|
|
if test "$_debug_build" != yes; then
|
|
|
|
append_var DEFINES "-DDISABLE_TEXT_CONSOLE"
|
|
|
|
fi
|
2022-07-23 16:25:39 +00:00
|
|
|
append_var DEFINES "-DDISABLE_HELP_STRINGS"
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var DEFINES "-DDISABLE_DOSBOX_OPL"
|
|
|
|
append_var DEFINES "-DDISABLE_FANCY_THEMES"
|
|
|
|
append_var DEFINES "-DDISABLE_NES_APU"
|
|
|
|
append_var DEFINES "-DREDUCE_MEMORY_USAGE"
|
|
|
|
append_var DEFINES "-DSTREAM_AUDIO_FROM_DISK"
|
|
|
|
append_var DEFINES "-DVECTOR_RENDERER_FORMAT=1555"
|
2010-08-02 17:11:25 +00:00
|
|
|
_backend="ds"
|
2010-08-02 17:12:34 +00:00
|
|
|
_build_scalers=no
|
2012-08-25 16:16:46 +00:00
|
|
|
_build_aspect=no
|
2010-08-02 17:12:34 +00:00
|
|
|
_mt32emu=no
|
2018-04-07 07:52:44 +00:00
|
|
|
_nuked_opl=no
|
2020-10-14 18:31:22 +00:00
|
|
|
_tinygl=no
|
2019-08-15 16:42:32 +00:00
|
|
|
_bink=no
|
|
|
|
_lua=no
|
2020-12-19 20:02:56 +00:00
|
|
|
_png=no
|
|
|
|
_freetype2=no
|
2010-08-02 17:11:25 +00:00
|
|
|
_port_mk="backends/platform/ds/ds.mk"
|
|
|
|
;;
|
2010-02-02 11:46:35 +00:00
|
|
|
gamecube)
|
|
|
|
_backend="wii"
|
2010-08-02 17:12:34 +00:00
|
|
|
_build_scalers=no
|
2012-08-25 16:16:46 +00:00
|
|
|
_build_aspect=no
|
2011-07-09 14:30:23 +00:00
|
|
|
_vkeybd=yes
|
2010-08-02 17:12:34 +00:00
|
|
|
_mt32emu=no
|
2010-02-02 11:46:35 +00:00
|
|
|
_port_mk="backends/platform/wii/wii.mk"
|
|
|
|
add_line_to_config_mk 'GAMECUBE = 1'
|
2010-08-24 18:44:14 +00:00
|
|
|
add_line_to_config_h '#define AUDIO_REVERSE_STEREO'
|
2010-02-02 11:46:35 +00:00
|
|
|
add_line_to_config_h '#define GAMECUBE'
|
|
|
|
add_line_to_config_h "/* #define DEBUG_WII_USBGECKO */"
|
|
|
|
add_line_to_config_h "/* #define DEBUG_WII_MEMSTATS */"
|
|
|
|
add_line_to_config_h "/* #define DEBUG_WII_GDB */"
|
2010-08-14 00:56:12 +00:00
|
|
|
add_line_to_config_h "#define USE_WII_DI"
|
2009-08-22 12:35:49 +00:00
|
|
|
;;
|
2016-02-24 17:52:29 +00:00
|
|
|
gcw0)
|
2016-02-24 17:48:38 +00:00
|
|
|
_sysroot=`$CXX --print-sysroot`
|
|
|
|
_sdlpath=$_sysroot/usr/bin
|
2020-03-06 22:44:45 +00:00
|
|
|
append_var DEFINES "-DGCW0"
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var DEFINES "-DREDUCE_MEMORY_USAGE"
|
|
|
|
append_var CXXFLAGS "-mips32"
|
2014-10-26 18:31:36 +00:00
|
|
|
_backend="dingux"
|
2016-04-10 11:56:44 +00:00
|
|
|
_alsa=no
|
2014-10-26 18:31:36 +00:00
|
|
|
_mt32emu=no
|
2016-04-10 11:56:44 +00:00
|
|
|
_seq_midi=no
|
|
|
|
_timidity=no
|
2020-03-20 16:34:16 +00:00
|
|
|
_build_scalers=no
|
2014-10-26 18:31:36 +00:00
|
|
|
_optimization_level=-O3
|
|
|
|
_vkeybd=yes
|
|
|
|
_vorbis=no
|
|
|
|
_port_mk="backends/platform/dingux/dingux.mk"
|
|
|
|
;;
|
2010-02-02 11:46:35 +00:00
|
|
|
gp2x)
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var DEFINES "-DGP2X"
|
|
|
|
append_var CXXFLAGS "-march=armv4t"
|
|
|
|
append_var ASFLAGS "-mfloat-abi=soft"
|
|
|
|
append_var LDFLAGS "-static"
|
2011-04-11 17:24:36 +00:00
|
|
|
_backend="gph"
|
2010-08-02 17:12:34 +00:00
|
|
|
_build_hq_scalers=no
|
2011-09-22 18:32:48 +00:00
|
|
|
_savegame_timestamp=no
|
2010-08-02 17:12:34 +00:00
|
|
|
_vkeybd=yes
|
2010-07-20 08:25:13 +00:00
|
|
|
_seq_midi=no
|
2011-04-12 11:13:38 +00:00
|
|
|
_mt32emu=no
|
|
|
|
_timidity=no
|
2011-04-11 17:24:36 +00:00
|
|
|
_port_mk="backends/platform/gph/gp2x-bundle.mk"
|
2009-03-18 23:17:54 +00:00
|
|
|
;;
|
2009-06-04 08:30:31 +00:00
|
|
|
gp2xwiz)
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var DEFINES "-DGP2XWIZ"
|
|
|
|
append_var CXXFLAGS "-mcpu=arm926ej-s"
|
|
|
|
append_var CXXFLAGS "-mtune=arm926ej-s"
|
|
|
|
append_var ASFLAGS "-mfloat-abi=soft"
|
2010-09-09 09:55:07 +00:00
|
|
|
_backend="gph"
|
2010-08-02 17:12:34 +00:00
|
|
|
_build_hq_scalers=no
|
2011-09-22 18:32:48 +00:00
|
|
|
_savegame_timestamp=no
|
2010-08-02 17:12:34 +00:00
|
|
|
_vkeybd=yes
|
2010-07-20 08:25:13 +00:00
|
|
|
_seq_midi=no
|
2011-04-12 11:13:38 +00:00
|
|
|
_mt32emu=no
|
|
|
|
_timidity=no
|
2010-09-09 09:55:07 +00:00
|
|
|
_port_mk="backends/platform/gph/gp2xwiz-bundle.mk"
|
2010-01-25 01:39:44 +00:00
|
|
|
;;
|
2010-02-02 11:46:35 +00:00
|
|
|
iphone)
|
2020-11-08 15:57:50 +00:00
|
|
|
add_line_to_config_mk 'IPHONE = 1'
|
2015-12-04 17:20:09 +00:00
|
|
|
append_var DEFINES "-DIPHONE"
|
|
|
|
append_var ASFLAGS "-arch armv6"
|
|
|
|
_backend="iphone"
|
|
|
|
_build_scalers=no
|
2012-08-25 16:16:46 +00:00
|
|
|
_build_aspect=no
|
2015-12-04 17:20:09 +00:00
|
|
|
_mt32emu=no
|
|
|
|
_seq_midi=no
|
|
|
|
_timidity=no
|
|
|
|
;;
|
2021-03-19 19:08:02 +00:00
|
|
|
ios7*)
|
2020-11-08 15:57:50 +00:00
|
|
|
add_line_to_config_mk 'IPHONE = 1'
|
2020-10-30 18:14:59 +00:00
|
|
|
append_var DEFINES "-DIPHONE -DIPHONE_IOS7 -DIPHONE_SANDBOXED"
|
2015-12-04 17:20:09 +00:00
|
|
|
_backend="ios7"
|
2010-07-20 08:25:13 +00:00
|
|
|
_seq_midi=no
|
2012-02-26 00:31:22 +00:00
|
|
|
_timidity=no
|
2005-05-09 21:21:21 +00:00
|
|
|
;;
|
2007-01-13 13:55:30 +00:00
|
|
|
m68k-atari-mint)
|
2010-07-20 08:25:13 +00:00
|
|
|
_seq_midi=no
|
2017-11-05 00:09:48 +00:00
|
|
|
_timidity=no
|
2007-01-13 13:55:30 +00:00
|
|
|
;;
|
2011-07-05 06:52:42 +00:00
|
|
|
maemo)
|
2011-10-07 22:45:56 +00:00
|
|
|
_optimization_level=-Os
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var CXXFLAGS "-mcpu=arm926ej-s"
|
|
|
|
append_var CXXFLAGS "-fomit-frame-pointer"
|
|
|
|
append_var INCLUDES "-I/usr/X11R6/include"
|
|
|
|
append_var LIBS "-L/usr/lib"
|
2016-02-24 17:52:29 +00:00
|
|
|
|
2011-07-05 06:52:42 +00:00
|
|
|
_backend="maemo"
|
2011-08-29 00:39:18 +00:00
|
|
|
_vkeybd=yes
|
2011-07-05 06:52:42 +00:00
|
|
|
_build_hq_scalers=no
|
|
|
|
_mt32emu=no
|
|
|
|
_alsa=no
|
|
|
|
_mad=yes
|
|
|
|
_tremor=yes
|
|
|
|
_zlib=yes
|
|
|
|
;;
|
2008-02-07 15:23:27 +00:00
|
|
|
*mingw32*)
|
2021-08-01 11:33:20 +00:00
|
|
|
_sdlconfig=$_host-sdl2-config
|
2021-07-25 08:12:56 +00:00
|
|
|
_libcurlconfig=$_host-curl-config
|
2021-07-30 13:17:42 +00:00
|
|
|
_pkgconfig=$_host-pkg-config
|
2008-02-07 15:23:27 +00:00
|
|
|
_windres=$_host-windres
|
2019-05-24 21:49:48 +00:00
|
|
|
_ar="$_host-ar cr"
|
2008-02-07 15:23:27 +00:00
|
|
|
_ranlib=$_host-ranlib
|
2021-07-25 08:12:56 +00:00
|
|
|
_strip=$_host-strip
|
2021-07-25 08:13:47 +00:00
|
|
|
if `which $_host-peldd >/dev/null 2>&1`; then
|
|
|
|
_ldd="$_host-peldd -t --ignore-errors"
|
|
|
|
fi
|
2007-11-13 08:06:15 +00:00
|
|
|
;;
|
2010-05-23 19:24:19 +00:00
|
|
|
mips-sgi*)
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var LDFLAGS "-static-libgcc"
|
|
|
|
append_var LIBS "-laudio"
|
2010-05-23 19:24:19 +00:00
|
|
|
;;
|
2010-08-01 17:16:39 +00:00
|
|
|
n64)
|
2015-07-22 12:32:03 +00:00
|
|
|
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"
|
2010-08-01 17:16:39 +00:00
|
|
|
_backend="n64"
|
|
|
|
_mt32emu=no
|
|
|
|
_build_scalers=no
|
2012-08-25 16:16:46 +00:00
|
|
|
_build_aspect=no
|
2011-09-24 19:19:03 +00:00
|
|
|
_savegame_timestamp=no
|
2010-08-01 17:16:39 +00:00
|
|
|
_translation=no
|
|
|
|
_text_console=no
|
|
|
|
_vkeybd=yes
|
|
|
|
_dynamic_modules=no
|
|
|
|
_plugins_default=static
|
|
|
|
# Force use of libmad, libtremor and zlib
|
2010-11-07 12:09:53 +00:00
|
|
|
_mad=no
|
2010-08-01 17:16:39 +00:00
|
|
|
_tremor=yes
|
|
|
|
_zlib=yes
|
2010-09-08 18:04:38 +00:00
|
|
|
_port_mk="backends/platform/n64/n64.mk"
|
2010-08-01 17:16:39 +00:00
|
|
|
;;
|
2010-02-02 11:46:35 +00:00
|
|
|
neuros)
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var DEFINES "-DNEUROS"
|
2010-02-02 11:46:35 +00:00
|
|
|
_backend='null'
|
2010-08-02 17:12:34 +00:00
|
|
|
_build_hq_scalers=no
|
|
|
|
_mt32emu=no
|
2010-02-02 11:46:35 +00:00
|
|
|
;;
|
2021-11-11 10:24:37 +00:00
|
|
|
opendingux-*)
|
2021-10-12 08:30:58 +00:00
|
|
|
_sysroot=`$CXX --print-sysroot`
|
|
|
|
_sdlpath=$_sysroot/usr/bin
|
2022-12-31 04:40:32 +00:00
|
|
|
append_var DEFINES "-DDINGUX -DOPENDINGUX -DREDUCE_MEMORY_USAGE -DUNCACHED_PLUGINS"
|
|
|
|
append_var CXXFLAGS "-ffast-math -fdata-sections -ffunction-sections -mplt"
|
|
|
|
append_var LDFLAGS "-ffast-math -fdata-sections -ffunction-sections -mplt"
|
2021-10-12 08:30:58 +00:00
|
|
|
append_var LDFLAGS "-O3 -Wl,--as-needed,--gc-sections"
|
2022-12-31 04:40:32 +00:00
|
|
|
if [ x"$_dynamic_modules" != xyes ]; then
|
|
|
|
append_var CXXFLAGS "-mno-shared"
|
|
|
|
append_var LDFLAGS "-mno-shared"
|
|
|
|
fi
|
2021-10-12 08:30:58 +00:00
|
|
|
_vkeybd=yes
|
|
|
|
_alsa=no
|
|
|
|
_vorbis=no
|
|
|
|
_mt32emu=no
|
|
|
|
_timidity=no
|
|
|
|
_fluidsynth=no
|
|
|
|
_theoradec=no
|
|
|
|
_seq_midi=no
|
|
|
|
_nuked_opl=no
|
|
|
|
_curl=no
|
|
|
|
_optimization_level=-O3
|
|
|
|
_backend="opendingux"
|
|
|
|
_port_mk="backends/platform/sdl/opendingux/opendingux.mk"
|
|
|
|
add_line_to_config_mk 'OPENDINGUX = 1'
|
2021-11-11 10:24:37 +00:00
|
|
|
add_line_to_config_mk "OPENDINGUX_TARGET = ${_host#opendingux-}"
|
|
|
|
case "$_host" in
|
|
|
|
opendingux-gcw0)
|
|
|
|
;;
|
|
|
|
opendingux-lepus)
|
|
|
|
append_var DEFINES "-DLEPUS"
|
|
|
|
_highres=no
|
|
|
|
_build_hq_scalers=no
|
|
|
|
;;
|
2022-12-31 17:51:10 +00:00
|
|
|
opendingux-rg99 | opendingux-rs90)
|
2021-11-11 10:24:37 +00:00
|
|
|
append_var DEFINES "-DRS90 -DDISABLE_FANCY_THEMES"
|
|
|
|
_16bit=no
|
|
|
|
_highres=no
|
|
|
|
_build_hq_scalers=no
|
2022-12-31 17:51:10 +00:00
|
|
|
_host=opendingux-rg99
|
2021-11-11 10:24:37 +00:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "WARNING: Unknown OpenDingux target"
|
|
|
|
;;
|
|
|
|
esac
|
2021-10-12 08:30:58 +00:00
|
|
|
;;
|
2010-09-06 17:35:27 +00:00
|
|
|
openpandora)
|
2013-01-31 00:22:56 +00:00
|
|
|
# Use -O3 on the OpenPandora for optimized builds.
|
|
|
|
if test "$_optimizations" = yes; then
|
2011-10-07 22:45:56 +00:00
|
|
|
_optimization_level=-O3
|
2010-09-20 19:33:58 +00:00
|
|
|
fi
|
2013-01-31 00:22:56 +00:00
|
|
|
|
2015-07-22 12:32:03 +00:00
|
|
|
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"
|
2010-09-06 17:35:27 +00:00
|
|
|
_backend="openpandora"
|
|
|
|
_build_hq_scalers=yes
|
2012-08-14 06:43:01 +00:00
|
|
|
_build_edge_scalers=no
|
2010-09-06 17:35:27 +00:00
|
|
|
_vkeybd=no
|
2011-04-12 11:13:38 +00:00
|
|
|
_mt32emu=no
|
2010-09-06 17:35:27 +00:00
|
|
|
_seq_midi=no
|
|
|
|
_port_mk="backends/platform/openpandora/op-bundle.mk"
|
2010-10-12 02:18:11 +00:00
|
|
|
;;
|
2010-02-02 11:46:35 +00:00
|
|
|
ppc-amigaos)
|
2014-12-09 10:51:00 +00:00
|
|
|
# PPC Linker requires this to fix relocation errors
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var CXXFLAGS "-mlongcall"
|
2014-12-09 10:51:00 +00:00
|
|
|
|
2014-07-20 03:18:46 +00:00
|
|
|
_port_mk="backends/platform/sdl/amigaos/amigaos.mk"
|
2009-03-25 21:58:16 +00:00
|
|
|
;;
|
2019-05-12 09:06:37 +00:00
|
|
|
ppc-morphos)
|
|
|
|
# PPC Linker requires this to fix relocation errors
|
|
|
|
append_var CXXFLAGS "-mlongcall"
|
|
|
|
|
|
|
|
_port_mk="backends/platform/sdl/morphos/morphos.mk"
|
|
|
|
;;
|
2011-06-02 08:34:41 +00:00
|
|
|
ps3)
|
|
|
|
_timidity=no
|
2011-06-04 10:54:37 +00:00
|
|
|
_vkeybd=yes
|
2014-06-28 15:12:43 +00:00
|
|
|
_port_mk="backends/platform/sdl/ps3/ps3.mk"
|
2011-06-02 08:34:41 +00:00
|
|
|
;;
|
2017-03-01 20:00:17 +00:00
|
|
|
psp2)
|
|
|
|
_backend="psp2"
|
|
|
|
_vkeybd=yes
|
|
|
|
_build_scalers=yes
|
|
|
|
_build_hq_scalers=no
|
|
|
|
_mt32emu=no
|
|
|
|
_timidity=no
|
|
|
|
_port_mk="backends/platform/sdl/psp2/psp2.mk"
|
2020-03-14 05:45:39 +00:00
|
|
|
#the -gcc- variants allow link time optimization
|
2021-08-28 18:47:24 +00:00
|
|
|
_ar="$_host_alias-gcc-ar cr"
|
2020-03-14 05:45:39 +00:00
|
|
|
_ranlib=$_host_alias-gcc-ranlib
|
2017-03-01 20:00:17 +00:00
|
|
|
;;
|
2010-02-02 11:46:35 +00:00
|
|
|
psp)
|
|
|
|
_backend="psp"
|
2010-08-02 17:12:34 +00:00
|
|
|
_build_scalers=no
|
2012-08-25 16:16:46 +00:00
|
|
|
_build_aspect=no
|
2010-08-02 17:12:34 +00:00
|
|
|
_mt32emu=no
|
2010-02-02 11:46:35 +00:00
|
|
|
_port_mk="backends/platform/psp/psp.mk"
|
|
|
|
;;
|
|
|
|
samsungtv)
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var DEFINES "-DSAMSUNGTV"
|
|
|
|
append_var DEFINES "-DDISABLE_COMMAND_LINE"
|
|
|
|
append_var ASFLAGS "-mfpu=vfp"
|
2010-02-02 11:46:35 +00:00
|
|
|
HOSTEXEEXT=".so"
|
|
|
|
_backend="samsungtv"
|
2010-08-02 17:12:34 +00:00
|
|
|
_mt32emu=no
|
|
|
|
_vkeybd=yes
|
2010-02-02 11:46:35 +00:00
|
|
|
;;
|
2018-09-20 14:33:08 +00:00
|
|
|
switch)
|
|
|
|
_backend="switch"
|
2019-06-21 16:01:56 +00:00
|
|
|
# Switch port crashes when switching between SDL2 and OpenGL
|
|
|
|
# graphics. But OpenGL works when it is enabled from the start.
|
|
|
|
# This might be related to a known crash on OpenGL de-init due
|
|
|
|
# to the OpenGL implementation on this platform.
|
2018-09-20 14:33:08 +00:00
|
|
|
_vkeybd=yes
|
|
|
|
_port_mk="backends/platform/sdl/switch/switch.mk"
|
|
|
|
;;
|
2010-02-02 11:46:35 +00:00
|
|
|
wii)
|
|
|
|
_backend="wii"
|
2010-08-02 17:12:34 +00:00
|
|
|
_build_scalers=no
|
2012-08-25 16:16:46 +00:00
|
|
|
_build_aspect=no
|
2011-07-09 14:30:23 +00:00
|
|
|
_vkeybd=yes
|
2010-02-02 11:46:35 +00:00
|
|
|
_port_mk="backends/platform/wii/wii.mk"
|
|
|
|
add_line_to_config_mk 'GAMECUBE = 0'
|
2010-08-24 18:44:14 +00:00
|
|
|
add_line_to_config_h '#define AUDIO_REVERSE_STEREO'
|
2010-02-02 11:46:35 +00:00
|
|
|
add_line_to_config_h "#define DEBUG_WII_USBGECKO"
|
|
|
|
add_line_to_config_h "/* #define DEBUG_WII_MEMSTATS */"
|
|
|
|
add_line_to_config_h "/* #define DEBUG_WII_GDB */"
|
|
|
|
add_line_to_config_h "#define USE_WII_DI"
|
|
|
|
add_line_to_config_h "#define USE_WII_SMB"
|
|
|
|
add_line_to_config_h "#define USE_WII_KBD"
|
|
|
|
;;
|
2004-12-16 22:15:32 +00:00
|
|
|
*)
|
2009-10-19 17:47:25 +00:00
|
|
|
echo "WARNING: Unknown target, continuing with auto-detected values"
|
2004-12-16 22:15:32 +00:00
|
|
|
;;
|
|
|
|
esac
|
2011-05-05 11:43:30 +00:00
|
|
|
fi
|
2008-01-27 19:47:41 +00:00
|
|
|
|
2011-05-04 14:30:10 +00:00
|
|
|
#
|
|
|
|
# Backend related stuff
|
|
|
|
#
|
|
|
|
case $_backend in
|
2016-04-14 04:39:27 +00:00
|
|
|
3ds)
|
|
|
|
;;
|
2022-02-05 19:59:19 +00:00
|
|
|
android)
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var DEFINES "-DREDUCE_MEMORY_USAGE"
|
2019-11-12 18:01:43 +00:00
|
|
|
append_var DEFINES "-DNONSTANDARD_PORT"
|
2020-10-15 07:59:11 +00:00
|
|
|
append_var INCLUDES '-I$(srcdir)/backends/platform/'$_backend
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var CXXFLAGS "-Wa,--noexecstack"
|
|
|
|
append_var LDFLAGS "-Wl,-z,noexecstack"
|
2019-10-25 08:53:42 +00:00
|
|
|
# removed the following directive - was causing compilation issues when not also explicitly using --disable-mt32emu
|
2020-02-26 19:28:49 +00:00
|
|
|
# append_var INCLUDES "-isystem $ANDROID_NDK/sources/cxx-stl/system/include"
|
2019-11-22 13:20:07 +00:00
|
|
|
_sdl=no
|
|
|
|
if test "$_host" = ouya; then
|
|
|
|
_sdlnet=no
|
|
|
|
fi
|
2011-05-04 14:30:10 +00:00
|
|
|
;;
|
|
|
|
dc)
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var INCLUDES '-I$(srcdir)/backends/platform/dc'
|
2018-08-18 12:56:08 +00:00
|
|
|
append_var INCLUDES "-isystem $RONINDIR/include"
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var LDFLAGS "-Wl,-Ttext,0x8c010000"
|
|
|
|
append_var LDFLAGS "-nostartfiles"
|
2018-08-18 12:56:08 +00:00
|
|
|
append_var LDFLAGS "-L$RONINDIR/lib"
|
2018-10-24 04:51:30 +00:00
|
|
|
append_var LDFLAGS "$RONINDIR/lib/crt0.o"
|
2013-07-10 04:00:25 +00:00
|
|
|
# Enable serial debugging output only when --enable-debug is passed
|
2013-07-11 00:53:06 +00:00
|
|
|
if test "$_release_build" = yes -o "$_debug_build" != yes; then
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var LIBS "-lronin-noserial -lm"
|
2018-10-24 04:51:30 +00:00
|
|
|
append_var LDFLAGS "-lronin-noserial -lm"
|
2011-06-01 16:17:01 +00:00
|
|
|
else
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var LIBS "-lronin -lm"
|
2018-10-24 04:51:30 +00:00
|
|
|
append_var LDFLAGS "-lronin -lm"
|
2011-06-01 16:17:01 +00:00
|
|
|
fi
|
2011-05-04 14:30:10 +00:00
|
|
|
;;
|
|
|
|
dingux)
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var DEFINES "-DDINGUX"
|
2020-03-06 22:44:45 +00:00
|
|
|
_sdlconfig=sdl-config
|
2018-03-13 18:07:29 +00:00
|
|
|
_sdl=auto
|
2011-05-04 14:30:10 +00:00
|
|
|
;;
|
|
|
|
ds)
|
2020-08-11 16:52:49 +00:00
|
|
|
append_var INCLUDES '-I$(srcdir)/backends/platform/ds'
|
2011-05-04 14:30:10 +00:00
|
|
|
;;
|
|
|
|
gph)
|
2012-08-16 09:54:39 +00:00
|
|
|
# On the GPH devices we want fancy themes but do not want the load/save thumbnail grid.
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var DEFINES "-DDISABLE_SAVELOADCHOOSER_GRID"
|
|
|
|
append_var DEFINES "-DGPH_DEVICE"
|
|
|
|
append_var DEFINES "-DREDUCE_MEMORY_USAGE"
|
2012-08-16 09:54:39 +00:00
|
|
|
if test "$_debug_build" = yes; then
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var DEFINES "-DGPH_DEBUG"
|
2012-08-16 09:54:39 +00:00
|
|
|
fi
|
2020-03-06 22:44:45 +00:00
|
|
|
_sdlconfig=sdl-config
|
2018-03-13 18:07:29 +00:00
|
|
|
_sdl=auto
|
2011-05-04 14:30:10 +00:00
|
|
|
;;
|
|
|
|
iphone)
|
2015-12-04 17:20:09 +00:00
|
|
|
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)
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var LIBS "-lobjc -framework UIKit -framework CoreGraphics -framework OpenGLES"
|
|
|
|
append_var LIBS "-framework QuartzCore -framework CoreFoundation -framework Foundation"
|
2019-08-04 16:41:53 +00:00
|
|
|
append_var LIBS "-framework AudioToolbox -framework CoreAudio -framework SystemConfiguration "
|
2022-05-16 11:21:26 +00:00
|
|
|
append_var LIBS "-framework GameController"
|
2022-11-06 15:01:10 +00:00
|
|
|
if test "$_host_cpu" = 'aarch64' ; then
|
2021-03-19 19:08:02 +00:00
|
|
|
append_var LDFLAGS "-miphoneos-version-min=7.1 -arch arm64"
|
|
|
|
append_var CFLAGS "-miphoneos-version-min=7.1 -arch arm64"
|
|
|
|
append_var CXXFLAGS "-miphoneos-version-min=7.1 -arch arm64"
|
|
|
|
else
|
|
|
|
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"
|
|
|
|
fi
|
2015-12-02 16:19:45 +00:00
|
|
|
if test -n "$SDKROOT"; then
|
2015-12-06 11:29:06 +00:00
|
|
|
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"
|
2015-12-02 16:19:45 +00:00
|
|
|
fi
|
2011-05-04 14:30:10 +00:00
|
|
|
;;
|
2011-07-05 06:52:42 +00:00
|
|
|
maemo)
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var DEFINES "-DMAEMO"
|
2020-03-06 22:44:45 +00:00
|
|
|
append_var LIBS "-lX11"
|
|
|
|
_sdlconfig=sdl-config
|
2018-03-13 18:07:29 +00:00
|
|
|
_sdl=auto
|
2011-07-05 06:52:42 +00:00
|
|
|
;;
|
2011-05-04 14:30:10 +00:00
|
|
|
n64)
|
2015-07-22 12:32:03 +00:00
|
|
|
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"
|
2011-05-04 14:30:10 +00:00
|
|
|
;;
|
|
|
|
null)
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var DEFINES "-DUSE_NULL_DRIVER"
|
2020-06-07 18:50:08 +00:00
|
|
|
_text_console=yes
|
2011-05-04 14:30:10 +00:00
|
|
|
;;
|
2021-10-12 08:30:58 +00:00
|
|
|
opendingux)
|
|
|
|
_sdlconfig=sdl-config
|
|
|
|
_sdl=auto
|
|
|
|
append_var MODULES "backends/platform/sdl"
|
|
|
|
;;
|
2011-05-04 14:30:10 +00:00
|
|
|
openpandora)
|
2020-03-06 22:44:45 +00:00
|
|
|
append_var DEFINES "-DOPENPANDORA"
|
|
|
|
append_var DEFINES "-DREDUCE_MEMORY_USAGE"
|
|
|
|
if test "$_release_build" = no; then
|
|
|
|
append_var DEFINES "-DOP_DEBUG"
|
|
|
|
fi
|
2018-03-13 18:07:29 +00:00
|
|
|
_sdl=auto
|
2011-05-04 14:30:10 +00:00
|
|
|
;;
|
|
|
|
psp)
|
2015-07-22 12:32:03 +00:00
|
|
|
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"
|
2018-04-07 07:52:44 +00:00
|
|
|
_nuked_opl=no
|
2011-05-04 14:30:10 +00:00
|
|
|
;;
|
2017-03-01 20:00:17 +00:00
|
|
|
psp2)
|
2021-04-12 01:34:38 +00:00
|
|
|
append_var LIBS "-lSDL2 -lSceCommonDialog_stub"
|
2017-03-01 20:00:17 +00:00
|
|
|
append_var LIBS "-lSceSysmodule_stub -lSceDisplay_stub -lSceGxm_stub"
|
2022-04-19 16:42:09 +00:00
|
|
|
append_var LIBS "-lSceAudio_stub -lSceAudioIn_stub -lSceCtrl_stub -lScePower_stub"
|
2021-03-03 08:05:39 +00:00
|
|
|
append_var LIBS "-lSceNet_stub -lSceNetCtl_stub"
|
|
|
|
append_var LIBS "-lSceAppMgr_stub -lSceAppUtil_stub -lScePgf_stub"
|
2021-01-10 10:24:15 +00:00
|
|
|
append_var LIBS "-lSceTouch_stub -lSceHid_stub -lSceMotion_stub"
|
2018-03-13 18:07:29 +00:00
|
|
|
_sdl=yes
|
|
|
|
_sdlversion=2.0.0
|
2017-03-01 20:00:17 +00:00
|
|
|
append_var MODULES "backends/platform/sdl"
|
|
|
|
append_var INCLUDES "-I$VITASDK/arm-vita-eabi/include/SDL2"
|
|
|
|
;;
|
2011-05-04 14:30:10 +00:00
|
|
|
samsungtv)
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var DEFINES "-DSAMSUNGTV"
|
|
|
|
append_var LDFLAGS "-shared"
|
|
|
|
append_var LDFLAGS "-fpic"
|
2018-03-13 18:07:29 +00:00
|
|
|
_sdl=auto
|
2011-05-04 14:30:10 +00:00
|
|
|
;;
|
2016-04-14 04:39:27 +00:00
|
|
|
sdl)
|
2018-03-13 18:07:29 +00:00
|
|
|
_sdl=auto
|
2016-04-14 04:39:27 +00:00
|
|
|
;;
|
2018-09-20 14:33:08 +00:00
|
|
|
switch)
|
|
|
|
_sdl=auto
|
|
|
|
append_var MODULES "backends/platform/sdl"
|
|
|
|
;;
|
2011-05-04 14:30:10 +00:00
|
|
|
wii)
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var DEFINES "-D__WII__"
|
|
|
|
append_var DEFINES "-DGEKKO"
|
2011-05-04 14:30:10 +00:00
|
|
|
case $_host_os in
|
|
|
|
gamecube)
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var LIBS "-lgxflux -liso9660 -lfat -logc -ldb"
|
2011-05-04 14:30:10 +00:00
|
|
|
;;
|
|
|
|
*)
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var LIBS "-lgxflux -ldi -liso9660 -ltinysmb -lfat -lwiiuse -lbte -logc -lwiikeyboard -ldb"
|
2011-05-04 14:30:10 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "support for $_backend backend not implemented in configure script yet"
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
2020-02-26 19:28:49 +00:00
|
|
|
|
|
|
|
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var MODULES "backends/platform/$_backend"
|
2011-05-04 14:30:10 +00:00
|
|
|
|
2019-11-12 22:25:36 +00:00
|
|
|
#
|
|
|
|
# Check for pkg-config
|
|
|
|
#
|
|
|
|
echocheck "pkg-config"
|
|
|
|
_pkg_config=no
|
|
|
|
command -v $_pkgconfig >/dev/null 2>&1 && _pkg_config=yes
|
|
|
|
echo "$_pkg_config"
|
|
|
|
|
2021-07-30 13:17:42 +00:00
|
|
|
if test "$_pkg_config" = yes && test -n "$_host" && test -z "$PKG_CONFIG_LIBDIR" && test "$_pkgconfig" = pkg-config; then
|
2019-11-12 22:25:36 +00:00
|
|
|
echo "WARNING: When cross-compiling PKG_CONFIG_LIBDIR must be set to the location of the .pc files for the target"
|
|
|
|
fi
|
|
|
|
|
2011-05-04 21:19:22 +00:00
|
|
|
#
|
|
|
|
# Setup SDL specifics for SDL based backends
|
|
|
|
#
|
2018-03-13 18:07:29 +00:00
|
|
|
if test "$_sdl" = auto ; then
|
|
|
|
find_sdlconfig
|
2021-08-02 19:50:40 +00:00
|
|
|
append_var SDL_CFLAGS "`$_sdlconfig --cflags | sed 's/[[:space:]]*-Dmain=SDL_main//g'`"
|
2018-03-13 18:07:29 +00:00
|
|
|
if test "$_static_build" = yes ; then
|
2021-08-01 11:33:20 +00:00
|
|
|
append_var SDL_LIBS "`$_sdlconfig --static-libs`"
|
2018-03-13 18:07:29 +00:00
|
|
|
else
|
2021-08-01 11:33:20 +00:00
|
|
|
append_var SDL_LIBS "`$_sdlconfig --libs`"
|
2018-03-13 18:07:29 +00:00
|
|
|
fi
|
|
|
|
_sdlversion=`$_sdlconfig --version`
|
2016-09-03 22:06:42 +00:00
|
|
|
|
2018-03-13 18:07:29 +00:00
|
|
|
echocheck "SDL"
|
|
|
|
_sdl=no
|
|
|
|
cat > $TMPC << EOF
|
|
|
|
#include "SDL.h"
|
|
|
|
int main(int argc, char *argv[]) { SDL_Init(0); return 0; }
|
|
|
|
EOF
|
|
|
|
cc_check $LIBS $SDL_LIBS $INCLUDES $SDL_CFLAGS && _sdl=yes
|
|
|
|
echo "$_sdl"
|
|
|
|
if test "$_sdl" = no ; then
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
2019-11-22 13:20:07 +00:00
|
|
|
|
|
|
|
_sdlMajorVersionNumber=0
|
2018-03-13 18:07:29 +00:00
|
|
|
if test "$_sdl" = yes ; then
|
|
|
|
append_var DEFINES "-DSDL_BACKEND"
|
|
|
|
add_line_to_config_mk "SDL_BACKEND = 1"
|
|
|
|
append_var INCLUDES "$SDL_CFLAGS"
|
|
|
|
append_var LIBS "$SDL_LIBS"
|
|
|
|
case $_sdlversion in
|
2022-07-02 16:02:14 +00:00
|
|
|
2.*.*)
|
2018-03-13 18:07:29 +00:00
|
|
|
add_line_to_config_mk "USE_SDL2 = 1"
|
2019-11-22 13:20:07 +00:00
|
|
|
_sdlMajorVersionNumber=2
|
2018-03-13 18:07:29 +00:00
|
|
|
;;
|
2022-07-02 16:02:14 +00:00
|
|
|
1.2.*)
|
2019-11-22 13:20:07 +00:00
|
|
|
_sdlMajorVersionNumber=1
|
2018-03-13 18:07:29 +00:00
|
|
|
;;
|
2022-07-02 16:02:14 +00:00
|
|
|
*)
|
|
|
|
echo "support for SDL $_sdlversion not implemented yet"
|
|
|
|
exit 1
|
|
|
|
;;
|
2018-03-13 18:07:29 +00:00
|
|
|
esac
|
2019-11-22 13:20:07 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# Some platforms (eg. Android, iOS) may use an edited version
|
|
|
|
# of SDL-net or SDL2-net that does not require SDL or SDL2 respectively
|
|
|
|
#
|
|
|
|
if test "$_sdlnet" = auto ; then
|
|
|
|
# If SDL2 was detected, then test for SDL2_net exclusively
|
|
|
|
# If SDL was detected, then test for SDL_net exclusively
|
|
|
|
# If neither SDL nor SDL2 detected, then test for both (SDL2_net success takes priority)
|
|
|
|
set_var SDL2_NET_LIBS "$SDL_NET_LIBS"
|
|
|
|
set_var SDL2_NET_CFLAGS "$SDL_NET_CFLAGS"
|
|
|
|
set_var SDL1_NET_LIBS "$SDL_NET_LIBS"
|
|
|
|
set_var SDL1_NET_CFLAGS "$SDL_NET_CFLAGS"
|
|
|
|
|
|
|
|
if test "$_sdl" = no || test "$_sdlMajorVersionNumber" = 2; then
|
|
|
|
if test "$_pkg_config" = "yes" && $_pkgconfig --exists SDL2_net; then
|
|
|
|
append_var SDL2_NET_LIBS "`$_pkgconfig --libs SDL2_net`"
|
2021-08-02 19:50:40 +00:00
|
|
|
append_var SDL2_NET_CFLAGS "`$_pkgconfig --cflags SDL2_net | sed 's/[[:space:]]*-Dmain=SDL_main//g'`"
|
2019-11-22 13:20:07 +00:00
|
|
|
else
|
|
|
|
append_var SDL2_NET_LIBS "-lSDL2_net"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test "$_sdl" = no || test "$_sdlMajorVersionNumber" = 1; then
|
|
|
|
if test "$_pkg_config" = "yes" && $_pkgconfig --exists SDL_net; then
|
|
|
|
append_var SDL1_NET_LIBS "`$_pkgconfig --libs SDL_net`"
|
2021-08-02 19:50:40 +00:00
|
|
|
append_var SDL1_NET_CFLAGS "`$_pkgconfig --cflags SDL_net | sed 's/[[:space:]]*-Dmain=SDL_main//g'`"
|
2019-11-22 13:20:07 +00:00
|
|
|
else
|
|
|
|
append_var SDL1_NET_LIBS "-lSDL_net"
|
|
|
|
fi
|
|
|
|
fi
|
2018-03-13 18:07:29 +00:00
|
|
|
|
|
|
|
# Check for SDL_Net
|
|
|
|
echocheck "SDL_Net"
|
2019-11-22 13:20:07 +00:00
|
|
|
_sdlnet=no
|
|
|
|
cat > $TMPC << EOF
|
|
|
|
#include "SDL_net.h"
|
|
|
|
int main(int argc, char *argv[]) { SDLNet_Init(); return 0; }
|
|
|
|
EOF
|
|
|
|
|
|
|
|
cc_check $SDL2_NET_LIBS $LIBS $INCLUDES $SDL2_NET_CFLAGS && _sdlnet=yes
|
|
|
|
if test "$_sdlnet" = yes ; then
|
|
|
|
set_var SDL_NET_LIBS "$SDL2_NET_LIBS"
|
|
|
|
set_var SDL_NET_CFLAGS "$SDL2_NET_CFLAGS"
|
2020-10-30 18:35:20 +00:00
|
|
|
add_line_to_config_mk "SDL_NET_MAJOR = 2"
|
2019-11-22 13:20:07 +00:00
|
|
|
else
|
2018-03-13 18:07:29 +00:00
|
|
|
cat > $TMPC << EOF
|
2016-09-03 22:06:42 +00:00
|
|
|
#include "SDL_net.h"
|
|
|
|
int main(int argc, char *argv[]) { SDLNet_Init(); return 0; }
|
|
|
|
EOF
|
2019-11-22 13:20:07 +00:00
|
|
|
cc_check $SDL1_NET_LIBS $LIBS $INCLUDES $SDL1_NET_CFLAGS && _sdlnet=yes
|
2020-10-30 18:35:20 +00:00
|
|
|
if test "$_sdlnet" = yes ; then
|
|
|
|
set_var SDL_NET_LIBS "$SDL1_NET_LIBS"
|
|
|
|
set_var SDL_NET_CFLAGS "$SDL1_NET_CFLAGS"
|
|
|
|
add_line_to_config_mk "SDL_NET_MAJOR = 1"
|
|
|
|
fi
|
2018-03-13 18:07:29 +00:00
|
|
|
fi
|
2019-11-22 13:20:07 +00:00
|
|
|
|
2018-03-13 18:07:29 +00:00
|
|
|
if test "$_sdlnet" = yes ; then
|
|
|
|
# Some platforms require SDL to be after SDL_Net, thus we prepend var
|
|
|
|
prepend_var LIBS "$SDL_NET_LIBS"
|
|
|
|
append_var INCLUDES "$SDL_NET_CFLAGS"
|
|
|
|
fi
|
2020-10-30 18:35:20 +00:00
|
|
|
define_in_config_if_no "$_sdl" 'WITHOUT_SDL'
|
2018-03-13 18:07:29 +00:00
|
|
|
define_in_config_if_yes "$_sdlnet" 'USE_SDL_NET'
|
|
|
|
echo "$_sdlnet"
|
|
|
|
fi
|
2011-05-04 21:19:22 +00:00
|
|
|
|
|
|
|
|
2009-08-21 17:19:06 +00:00
|
|
|
#
|
|
|
|
# Enable 16bit support only for backends which support it
|
|
|
|
#
|
|
|
|
case $_backend in
|
2022-02-05 20:10:20 +00:00
|
|
|
3ds | android | dingux | dc | ds | gph | iphone | ios7 | maemo | null | opendingux | openpandora | psp | psp2 | samsungtv | sdl | switch | wii)
|
2009-08-21 17:19:06 +00:00
|
|
|
if test "$_16bit" = auto ; then
|
|
|
|
_16bit=yes
|
|
|
|
else
|
|
|
|
_16bit=no
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
_16bit=no
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2016-03-05 13:25:56 +00:00
|
|
|
#
|
|
|
|
# Enable High resolution engines (>320x240) support only for backends which support it
|
|
|
|
#
|
2016-03-09 15:33:27 +00:00
|
|
|
case $_host in
|
2020-06-29 20:53:39 +00:00
|
|
|
caanoo | ds | dingux | gcw0 | gp2x | gp2xwiz)
|
2016-03-05 13:25:56 +00:00
|
|
|
if test "$_highres" = yes ; then
|
|
|
|
_highres=yes
|
|
|
|
else
|
|
|
|
_highres=no
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
if test "$_highres" = no ; then
|
|
|
|
_highres=no
|
|
|
|
else
|
|
|
|
_highres=yes
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2013-05-16 21:18:09 +00:00
|
|
|
#
|
|
|
|
# Enable Event Recorder only for backends that support it
|
|
|
|
#
|
|
|
|
case $_backend in
|
|
|
|
sdl)
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
_eventrec=no
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2011-09-22 18:32:48 +00:00
|
|
|
#
|
|
|
|
# Disable savegame timestamp support for backends which don't have a reliable real time clock
|
|
|
|
#
|
|
|
|
case $_backend in
|
2011-09-24 19:19:03 +00:00
|
|
|
gph | n64)
|
2011-09-22 18:32:48 +00:00
|
|
|
if test "$_savegame_timestamp" = auto ; then
|
|
|
|
_savegame_timestamp=no
|
|
|
|
else
|
|
|
|
_savegame_timestamp=yes
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
if test "$_savegame_timestamp" = auto ; then
|
|
|
|
_savegame_timestamp=yes
|
|
|
|
else
|
|
|
|
_savegame_timestamp=no
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2007-06-24 20:35:02 +00:00
|
|
|
#
|
2011-05-26 09:02:46 +00:00
|
|
|
# Determine whether host is POSIX compliant, or at least POSIX
|
|
|
|
# compatible enough to support our POSIX code (including dlsym(),
|
|
|
|
# mkdir() and some other APIs).
|
|
|
|
#
|
|
|
|
# TODO: Instead of basing this on the host name, we should really base
|
|
|
|
# this on the presence of features (such as the dlsym and mkdir APIs).
|
2007-06-24 20:35:02 +00:00
|
|
|
#
|
2011-05-26 09:02:46 +00:00
|
|
|
echo_n "Checking if host is POSIX compliant... "
|
|
|
|
case $_host_os in
|
CONFIGURE: Allow Cygwin as development platform.
I would like to suggest to allow the use of Cygwin as development platform.
This is not intended for providing builds for this environment (although SCUMMVM can be already built on it without problems), but for having an easy way for testing POSIX code on Windows.
There could be some alternatives, like the (defunt) Microsoft POSIX subsystem, the (also defunct) Windows Services for UNIX or the WSL1 and WSL2, but they are all painful experiences, at least for me, especially when debugging graphical applications connected to an X server or working with physical devices (try to believe). Alternatively, it is also possible to make a full virtual machine by using emulators like QEMU, but it has not the same advantages of having the code running natively, especially when sharing the same files..
So, this should be seen as a tool for developers, nothing more than that, because at the time of writing this seems to be the best and most comfortable way for debugging a change to the ports using POSIX code.
However, to avoid unintentional execution, the user must activate the support for Cygwin by providing --enable-cygwin-build at configure time, otherwise the process will halt again.
Even when support for Cygwin is activated, a warning message is still shown to the user, for informing him on what he is doing.
2022-12-17 13:22:30 +00:00
|
|
|
amigaos* | dreamcast | ds | gamecube | mingw* | morphos | n64 | ps3 | psp2 | psp | riscos | wii)
|
2011-05-26 09:02:46 +00:00
|
|
|
_posix=no
|
2007-06-24 20:35:02 +00:00
|
|
|
;;
|
CONFIGURE: Allow Cygwin as development platform.
I would like to suggest to allow the use of Cygwin as development platform.
This is not intended for providing builds for this environment (although SCUMMVM can be already built on it without problems), but for having an easy way for testing POSIX code on Windows.
There could be some alternatives, like the (defunt) Microsoft POSIX subsystem, the (also defunct) Windows Services for UNIX or the WSL1 and WSL2, but they are all painful experiences, at least for me, especially when debugging graphical applications connected to an X server or working with physical devices (try to believe). Alternatively, it is also possible to make a full virtual machine by using emulators like QEMU, but it has not the same advantages of having the code running natively, especially when sharing the same files..
So, this should be seen as a tool for developers, nothing more than that, because at the time of writing this seems to be the best and most comfortable way for debugging a change to the ports using POSIX code.
However, to avoid unintentional execution, the user must activate the support for Cygwin by providing --enable-cygwin-build at configure time, otherwise the process will halt again.
Even when support for Cygwin is activated, a warning message is still shown to the user, for informing him on what he is doing.
2022-12-17 13:22:30 +00:00
|
|
|
3ds | android | beos* | bsd* | cygwin* | darwin* | dragonfly* | freebsd* | gnu* | gph-linux | haiku* | hpux* | iphone | ios7 | irix*| k*bsd*-gnu* | linux* | maemo | mint* | netbsd* | openbsd* | serenity* | solaris* | sunos* | switch | uclinux*)
|
2011-05-26 09:02:46 +00:00
|
|
|
_posix=yes
|
|
|
|
;;
|
|
|
|
os2-emx*)
|
|
|
|
_posix=yes # FIXME: Really???
|
2007-06-24 20:35:02 +00:00
|
|
|
;;
|
2021-06-01 22:59:09 +00:00
|
|
|
emscripten)
|
2021-08-27 02:14:25 +00:00
|
|
|
_posix=yes
|
2021-06-01 22:59:09 +00:00
|
|
|
;;
|
2007-06-24 20:35:02 +00:00
|
|
|
*)
|
2011-05-26 09:02:46 +00:00
|
|
|
# given this is a shell script, we might assume some type of posix.
|
|
|
|
# However, the host system might be a totally different one, so
|
|
|
|
# we can assume nothing about it.
|
|
|
|
# Indeed, as mentioned further above, we really should test for the
|
|
|
|
# presences of relevant APIs on the host anyway...
|
|
|
|
_posix=no
|
2007-06-24 20:35:02 +00:00
|
|
|
;;
|
|
|
|
esac
|
2011-05-26 09:02:46 +00:00
|
|
|
echo $_posix
|
2007-06-24 20:35:02 +00:00
|
|
|
|
2011-05-05 13:38:54 +00:00
|
|
|
if test "$_posix" = yes ; then
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var DEFINES "-DPOSIX"
|
2011-05-05 13:38:54 +00:00
|
|
|
add_line_to_config_mk 'POSIX = 1'
|
2017-12-15 01:08:14 +00:00
|
|
|
|
|
|
|
echo_n "Checking if posix_spawn is supported... "
|
|
|
|
cat > $TMPC << EOF
|
|
|
|
#include <spawn.h>
|
|
|
|
int main(void) { return posix_spawn(0, 0, 0, 0, 0, 0); }
|
|
|
|
EOF
|
2021-06-01 22:59:09 +00:00
|
|
|
cc_check && test "$_host_os" != "emscripten" && _has_posix_spawn=yes
|
2017-12-15 01:08:14 +00:00
|
|
|
echo $_has_posix_spawn
|
|
|
|
if test "$_has_posix_spawn" = yes ; then
|
|
|
|
append_var DEFINES "-DHAS_POSIX_SPAWN"
|
|
|
|
fi
|
2010-07-20 08:25:13 +00:00
|
|
|
fi
|
|
|
|
|
2022-11-26 23:45:29 +00:00
|
|
|
#
|
|
|
|
# Check for 64-bit file offset compatibility
|
|
|
|
#
|
|
|
|
# This is currently only used by StdioStream. If nothing is found,
|
|
|
|
# you'll be limited to <2GB files, which still covers the vast majority
|
|
|
|
# of supported games.
|
|
|
|
#
|
|
|
|
case $_host_os in
|
|
|
|
mingw*)
|
|
|
|
# StdioStream just uses _ftelli64
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo_n "Checking if fseeko with 64-bit off_t is supported... "
|
|
|
|
cat > $TMPC << EOF
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <sys/types.h> /* off_t on legacy systems */
|
|
|
|
int main() {
|
|
|
|
static int test_array[1 - 2 * !(sizeof(off_t) >= 8)];
|
|
|
|
fseeko(stdin, 0, SEEK_SET);
|
|
|
|
test_array[0] = 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
EOF
|
|
|
|
cc_check_no_clean && _has_fseeko_offt_64=yes
|
|
|
|
# Good, there's fseeko with a 64-bit off_t by default
|
|
|
|
if test "$_has_fseeko_offt_64" = yes ; then
|
|
|
|
echo yes
|
|
|
|
append_var DEFINES "-DHAS_FSEEKO_OFFT_64"
|
|
|
|
else
|
|
|
|
# Otherwise, when not cross-compiling, try with LFS_CFLAGS
|
|
|
|
if test -z "$_host"; then
|
|
|
|
TMPFLAGS=`getconf LFS_CFLAGS 2>/dev/null`
|
2022-11-27 18:00:20 +00:00
|
|
|
if test $? -eq 0 && test ! -z "$TMPFLAGS" && test "$TMPFLAGS" != undefined ; then
|
2022-11-26 23:45:29 +00:00
|
|
|
cc_check_no_clean $TMPFLAGS && _has_fseeko_offt_64=yes
|
|
|
|
if test "$_has_fseeko_offt_64" = yes ; then
|
|
|
|
echo "yes (adding $TMPFLAGS)"
|
|
|
|
append_var DEFINES "-DHAS_FSEEKO_OFFT_64"
|
|
|
|
append_var CXXFLAGS "$TMPFLAGS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Otherwise, try the usual magical suspects
|
|
|
|
if test "$_has_fseeko_offt_64" = no ; then
|
|
|
|
# note: -D__LARGE64_FILES is another option, but it may be broken on
|
|
|
|
# some platforms, so add it to your platform defines instead, if it
|
|
|
|
# requires it and you've checked that the result works.
|
|
|
|
for largeflag in "-D_FILE_OFFSET_BITS=64" "-D_LARGE_FILES" "-D_LARGEFILE_SOURCE" ; do
|
|
|
|
cc_check_no_clean $largeflag && _has_fseeko_offt_64=yes
|
|
|
|
if test "$_has_fseeko_offt_64" = yes ; then
|
|
|
|
echo "yes (adding $largeflag)"
|
|
|
|
append_var DEFINES "-DHAS_FSEEKO_OFFT_64"
|
|
|
|
append_var CXXFLAGS "$largeflag"
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Otherwise, fseeko64 is your last chance
|
|
|
|
if test "$_has_fseeko_offt_64" = no ; then
|
|
|
|
echo no
|
|
|
|
echo_n "Checking if fseeko64 is supported... "
|
|
|
|
cat > $TMPC << EOF
|
|
|
|
#include <stdio.h>
|
|
|
|
int main() { fseeko64(stdin, 0, SEEK_SET); return 0; }
|
|
|
|
EOF
|
|
|
|
cc_check_no_clean -D_LARGEFILE64_SOURCE && _has_fseeko64=yes
|
|
|
|
echo $_has_fseeko64
|
|
|
|
if test "$_has_fseeko64" = yes ; then
|
|
|
|
append_var DEFINES "-DHAS_FSEEKO64"
|
|
|
|
append_var CXXFLAGS "-D_LARGEFILE64_SOURCE"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
cc_check_clean
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2009-08-22 11:03:00 +00:00
|
|
|
#
|
|
|
|
# Check whether to enable a verbose build
|
|
|
|
#
|
|
|
|
echo_n "Checking whether to have a verbose build... "
|
|
|
|
echo "$_verbose_build"
|
|
|
|
add_to_config_mk_if_yes "$_verbose_build" 'VERBOSE_BUILD = 1'
|
2007-06-24 20:35:02 +00:00
|
|
|
|
2011-10-08 19:00:40 +00:00
|
|
|
|
|
|
|
#
|
2011-10-09 18:13:35 +00:00
|
|
|
# If a specific optimization level was requested, enable optimizations
|
2011-10-08 19:00:40 +00:00
|
|
|
#
|
|
|
|
if test -n "$_optimization_level" ; then
|
|
|
|
# Ports will specify an optimization level and expect that to be enabled
|
2011-10-09 18:13:35 +00:00
|
|
|
if test "$_optimizations" != no ; then
|
|
|
|
_optimizations=yes
|
2011-10-08 19:00:40 +00:00
|
|
|
fi
|
|
|
|
else
|
|
|
|
_optimization_level=$_default_optimization_level
|
|
|
|
fi
|
|
|
|
|
2011-10-07 22:45:56 +00:00
|
|
|
#
|
2011-10-09 18:13:35 +00:00
|
|
|
# Check whether to enable optimizations
|
2011-10-07 22:45:56 +00:00
|
|
|
#
|
2011-10-09 18:13:35 +00:00
|
|
|
if test "$_optimizations" = yes ; then
|
2011-10-07 22:45:56 +00:00
|
|
|
# Enable optimizations. This also
|
|
|
|
# makes it possible to use -Wuninitialized, so let's do that.
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var CXXFLAGS "$_optimization_level"
|
|
|
|
append_var CXXFLAGS "-Wuninitialized"
|
2011-10-07 22:45:56 +00:00
|
|
|
fi
|
|
|
|
|
2004-02-15 01:21:02 +00:00
|
|
|
#
|
|
|
|
# Check whether plugin support is requested and possible
|
|
|
|
#
|
2005-11-18 21:37:58 +00:00
|
|
|
echo_n "Checking whether building plugins was requested... "
|
2008-05-06 03:11:01 +00:00
|
|
|
echo "$_dynamic_modules"
|
2004-02-15 01:21:02 +00:00
|
|
|
_mak_plugins=
|
2005-11-18 21:37:58 +00:00
|
|
|
|
2008-05-06 03:11:01 +00:00
|
|
|
if test "$_dynamic_modules" = yes ; then
|
2007-11-01 21:03:16 +00:00
|
|
|
echo_n "Checking whether building plugins is supported... "
|
|
|
|
case $_host_os in
|
2019-12-01 16:19:50 +00:00
|
|
|
3ds)
|
|
|
|
_elf_loader=yes
|
|
|
|
append_var DEFINES "-DUNCACHED_PLUGINS"
|
|
|
|
_mak_plugins='
|
|
|
|
PLUGIN_LDFLAGS += -Wl,-T$(srcdir)/backends/plugins/3ds/plugin.ld -march=armv6k -mfloat-abi=hard
|
|
|
|
'
|
|
|
|
;;
|
2022-05-18 07:55:45 +00:00
|
|
|
amigaos)
|
2022-05-15 16:24:37 +00:00
|
|
|
_plugin_prefix=""
|
|
|
|
_plugin_suffix=".plugin"
|
2019-09-22 15:37:22 +00:00
|
|
|
append_var CXXFLAGS "-fPIC"
|
|
|
|
append_var LIBS "-use-dynld"
|
2022-05-18 07:55:45 +00:00
|
|
|
append_var LIBS "-lauto"
|
2022-05-15 16:24:37 +00:00
|
|
|
append_var _strip "-x"
|
2019-09-22 15:37:22 +00:00
|
|
|
_mak_plugins='
|
|
|
|
PLUGIN_EXTRA_DEPS =
|
|
|
|
PLUGIN_LDFLAGS += -shared
|
|
|
|
PRE_OBJS_FLAGS := -Wl,-export-dynamic -Wl,-whole-archive
|
|
|
|
POST_OBJS_FLAGS := -Wl,-no-whole-archive
|
|
|
|
'
|
|
|
|
;;
|
2011-02-06 14:23:47 +00:00
|
|
|
android)
|
2011-05-25 12:55:36 +00:00
|
|
|
_plugin_prefix="lib"
|
|
|
|
_plugin_suffix=".so"
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var CXXFLAGS "-fpic"
|
|
|
|
append_var LIBS "-ldl"
|
2011-02-06 14:23:47 +00:00
|
|
|
# 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 -
|
|
|
|
# effectively turning all dlopen(RTLD_GLOBAL) calls
|
2022-08-27 19:33:17 +00:00
|
|
|
# into dlopen(RTLD_LOCAL). It *does* look in
|
2011-02-06 14:23:47 +00:00
|
|
|
# DT_NEEDED libraries, so the workaround is to add an
|
|
|
|
# (otherwise unnecessary) dependency from plugins back
|
|
|
|
# to the main libscummvm.so.
|
|
|
|
_mak_plugins='
|
|
|
|
PLUGIN_EXTRA_DEPS = libscummvm.so
|
|
|
|
PLUGIN_LDFLAGS += $(LDFLAGS) -L. -lscummvm
|
|
|
|
PRE_OBJS_FLAGS := -Wl,-export-dynamic -Wl,-whole-archive
|
|
|
|
POST_OBJS_FLAGS := -Wl,-no-whole-archive
|
|
|
|
'
|
|
|
|
;;
|
2010-02-02 11:46:35 +00:00
|
|
|
darwin*)
|
2011-05-25 12:55:36 +00:00
|
|
|
_plugin_prefix=""
|
|
|
|
_plugin_suffix=".plugin"
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var LIBS "-ldl"
|
2022-05-06 17:24:12 +00:00
|
|
|
append_var _strip "-x"
|
2004-02-15 01:21:02 +00:00
|
|
|
_mak_plugins='
|
2010-02-02 11:46:35 +00:00
|
|
|
PLUGIN_EXTRA_DEPS = $(EXECUTABLE)
|
|
|
|
PLUGIN_LDFLAGS += -bundle -bundle_loader $(EXECUTABLE) -exported_symbols_list "$(srcdir)/plugin.exp"
|
|
|
|
PRE_OBJS_FLAGS := -all_load
|
|
|
|
POST_OBJS_FLAGS :=
|
|
|
|
'
|
|
|
|
;;
|
|
|
|
dreamcast)
|
2011-05-25 12:55:36 +00:00
|
|
|
_plugin_prefix=""
|
|
|
|
_plugin_suffix=".plg"
|
2021-09-20 21:19:40 +00:00
|
|
|
append_var DEFINES "-DUNCACHED_PLUGINS"
|
2010-02-02 11:46:35 +00:00
|
|
|
_mak_plugins='
|
2011-01-07 16:25:05 +00:00
|
|
|
PLUGIN_EXTRA_DEPS = $(abspath $(srcdir)/backends/platform/dc/plugin.x $(srcdir)/backends/platform/dc/plugin.syms) $(EXECUTABLE) backends/platform/dc/plugin_head.o
|
2022-06-18 15:38:12 +00:00
|
|
|
PLUGIN_LDFLAGS += -ml -m4-single-only -nostartfiles -Wl,-q,-T$(srcdir)/backends/platform/dc/plugin.x,--just-symbols,$(EXECUTABLE),--retain-symbols-file,$(srcdir)/backends/platform/dc/plugin.syms backends/platform/dc/plugin_head.o
|
2010-02-02 11:46:35 +00:00
|
|
|
PRE_OBJS_FLAGS := -Wl,--whole-archive
|
|
|
|
POST_OBJS_FLAGS := -Wl,--no-whole-archive
|
2010-08-13 07:25:21 +00:00
|
|
|
'
|
|
|
|
;;
|
|
|
|
ds)
|
2010-09-15 07:43:16 +00:00
|
|
|
_elf_loader=yes
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var DEFINES "-DELF_LOADER_CXA_ATEXIT"
|
|
|
|
append_var DEFINES "-DUNCACHED_PLUGINS"
|
|
|
|
append_var DEFINES "-DELF_NO_MEM_MANAGER"
|
2010-08-13 07:25:21 +00:00
|
|
|
_mak_plugins='
|
2020-09-22 17:17:33 +00:00
|
|
|
PLUGIN_LDFLAGS += -Wl,-T$(srcdir)/backends/plugins/ds/plugin.ld -mthumb -mthumb-interwork -mfloat-abi=soft
|
2022-05-15 16:18:20 +00:00
|
|
|
'
|
|
|
|
;;
|
|
|
|
emscripten)
|
|
|
|
_plugin_prefix="lib"
|
2022-06-08 21:20:39 +00:00
|
|
|
_plugin_suffix=".so"
|
|
|
|
append_var DEFINES "-DUNCACHED_PLUGINS"
|
2022-05-15 16:18:20 +00:00
|
|
|
append_var CXXFLAGS "-fPIC"
|
|
|
|
append_var LIBS ""
|
|
|
|
_mak_plugins='
|
|
|
|
PLUGIN_EXTRA_DEPS =
|
2022-06-08 21:20:39 +00:00
|
|
|
PLUGIN_LDFLAGS += $(LDFLAGS) -s SIDE_MODULE=1 -s ASYNCIFY_IMPORTS=["*"] -s EXPORT_ALL=1
|
2022-05-15 16:18:20 +00:00
|
|
|
PRE_OBJS_FLAGS := -s MAIN_MODULE=1 -s EXPORT_ALL=1
|
|
|
|
POST_OBJS_FLAGS :=
|
2004-04-25 19:33:46 +00:00
|
|
|
'
|
2007-11-01 21:03:16 +00:00
|
|
|
;;
|
2020-09-13 10:37:11 +00:00
|
|
|
freebsd* | openbsd*)
|
2011-05-25 12:55:36 +00:00
|
|
|
_plugin_prefix="lib"
|
|
|
|
_plugin_suffix=".so"
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var CXXFLAGS "-fPIC"
|
2004-04-25 19:33:46 +00:00
|
|
|
_mak_plugins='
|
2007-12-28 07:52:56 +00:00
|
|
|
PLUGIN_EXTRA_DEPS =
|
2004-04-25 19:33:46 +00:00
|
|
|
PLUGIN_LDFLAGS += -shared
|
|
|
|
PRE_OBJS_FLAGS := -Wl,-export-dynamic -Wl,-whole-archive
|
|
|
|
POST_OBJS_FLAGS := -Wl,-no-whole-archive
|
2010-09-05 12:49:29 +00:00
|
|
|
'
|
|
|
|
;;
|
|
|
|
gamecube | wii)
|
2010-09-15 07:43:16 +00:00
|
|
|
_elf_loader=yes
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var DEFINES "-DELF_LOADER_CXA_ATEXIT"
|
|
|
|
append_var DEFINES "-DUNCACHED_PLUGINS"
|
2010-09-05 12:49:29 +00:00
|
|
|
_mak_plugins='
|
2010-09-15 07:43:16 +00:00
|
|
|
PLUGIN_LDFLAGS += -Wl,-T$(srcdir)/backends/plugins/wii/plugin.ld
|
2010-08-17 11:40:48 +00:00
|
|
|
'
|
|
|
|
;;
|
2010-09-20 19:33:58 +00:00
|
|
|
gph*)
|
2011-05-25 12:55:36 +00:00
|
|
|
_plugin_prefix=""
|
|
|
|
_plugin_suffix=".plugin"
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var CXXFLAGS "-fpic"
|
|
|
|
append_var LIBS "-ldl"
|
2004-02-15 01:21:02 +00:00
|
|
|
_mak_plugins='
|
2005-02-06 17:45:16 +00:00
|
|
|
PLUGIN_EXTRA_DEPS = $(EXECUTABLE)
|
2010-02-02 11:46:35 +00:00
|
|
|
PLUGIN_LDFLAGS += -shared
|
|
|
|
PRE_OBJS_FLAGS := -Wl,-export-dynamic -Wl,-whole-archive
|
|
|
|
POST_OBJS_FLAGS := -Wl,-no-whole-archive
|
2004-02-15 01:21:02 +00:00
|
|
|
'
|
2007-11-01 21:03:16 +00:00
|
|
|
;;
|
2011-09-12 12:49:12 +00:00
|
|
|
irix*)
|
|
|
|
_plugin_prefix="lib"
|
|
|
|
_plugin_suffix=".so"
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var CXXFLAGS "-fpic"
|
|
|
|
append_var LIBS "-ldl"
|
2011-09-12 12:49:12 +00:00
|
|
|
_mak_plugins='
|
|
|
|
PLUGIN_EXTRA_DEPS =
|
|
|
|
PLUGIN_LDFLAGS += -shared -static-libgcc
|
|
|
|
PRE_OBJS_FLAGS := -Wl,-export-dynamic -Wl,-whole-archive
|
|
|
|
POST_OBJS_FLAGS := -Wl,-no-whole-archive
|
|
|
|
'
|
|
|
|
;;
|
|
|
|
|
2013-06-06 14:20:06 +00:00
|
|
|
linux* | gnu* | k*bsd*-gnu*)
|
2011-05-25 12:55:36 +00:00
|
|
|
_plugin_prefix="lib"
|
|
|
|
_plugin_suffix=".so"
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var CXXFLAGS "-fPIC"
|
|
|
|
append_var LIBS "-ldl"
|
2009-06-04 08:30:31 +00:00
|
|
|
_mak_plugins='
|
2010-02-02 11:46:35 +00:00
|
|
|
PLUGIN_EXTRA_DEPS =
|
2009-06-04 08:30:31 +00:00
|
|
|
PLUGIN_LDFLAGS += -shared
|
|
|
|
PRE_OBJS_FLAGS := -Wl,-export-dynamic -Wl,-whole-archive
|
|
|
|
POST_OBJS_FLAGS := -Wl,-no-whole-archive
|
|
|
|
'
|
2010-01-25 01:39:44 +00:00
|
|
|
;;
|
2016-11-26 18:25:02 +00:00
|
|
|
*mingw32* | mingw64)
|
2011-05-25 12:55:36 +00:00
|
|
|
_plugin_prefix=""
|
|
|
|
_plugin_suffix=".dll"
|
2009-03-21 15:15:29 +00:00
|
|
|
_mak_plugins='
|
2010-02-02 11:46:35 +00:00
|
|
|
PLUGIN_EXTRA_DEPS = $(EXECUTABLE)
|
2022-06-18 15:38:12 +00:00
|
|
|
PLUGIN_LDFLAGS += -Wl,--enable-auto-import -shared ./libscummvm.a
|
2009-03-21 15:15:29 +00:00
|
|
|
PRE_OBJS_FLAGS := -Wl,--whole-archive
|
2010-02-02 11:46:35 +00:00
|
|
|
POST_OBJS_FLAGS := -Wl,--export-all-symbols -Wl,--no-whole-archive -Wl,--out-implib,./libscummvm.a
|
2022-05-18 07:55:45 +00:00
|
|
|
'
|
|
|
|
;;
|
|
|
|
morphos)
|
|
|
|
_plugin_prefix="lib"
|
|
|
|
_plugin_suffix=".so"
|
|
|
|
append_var CXXFLAGS "-fPIC"
|
|
|
|
append_var LIBS "-use-dynld"
|
|
|
|
_mak_plugins='
|
|
|
|
PLUGIN_EXTRA_DEPS =
|
|
|
|
PLUGIN_LDFLAGS += -shared
|
|
|
|
PRE_OBJS_FLAGS := -Wl,-export-dynamic -Wl,-whole-archive
|
|
|
|
POST_OBJS_FLAGS := -Wl,-no-whole-archive
|
2009-10-09 12:10:08 +00:00
|
|
|
'
|
|
|
|
;;
|
|
|
|
psp)
|
2010-09-15 07:43:16 +00:00
|
|
|
_elf_loader=yes
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var DEFINES "-DUNCACHED_PLUGINS"
|
2009-10-09 12:10:08 +00:00
|
|
|
_mak_plugins='
|
2022-04-30 19:23:55 +00:00
|
|
|
LDFLAGS += -Wl,-T$(srcdir)/backends/plugins/psp/main_prog.ld -Wl,-zmax-page-size=128
|
2022-05-22 22:54:32 +00:00
|
|
|
PLUGIN_LDFLAGS += -Wl,-T$(srcdir)/backends/plugins/psp/plugin.ld -Wl,-zmax-page-size=128 -lstdc++
|
2022-07-18 17:25:57 +00:00
|
|
|
'
|
|
|
|
;;
|
|
|
|
psp2)
|
|
|
|
_plugin_prefix=""
|
|
|
|
# This will create an ELF with a suprx extension which we will have to mangle when packaging
|
|
|
|
_plugin_suffix=".suprx"
|
|
|
|
append_var CXXFLAGS "-fuse-cxa-atexit"
|
|
|
|
append_var DEFINES "-DUNCACHED_PLUGINS"
|
|
|
|
_mak_plugins='
|
|
|
|
PLUGIN_EXTRA_DEPS = $(EXECUTABLE) backends/plugins/psp2/plugin.o
|
|
|
|
PLUGIN_LDFLAGS += -nostartfiles -nodefaultlibs backends/plugins/psp2/plugin.o -Wl,-q -Xlinker --just-symbols -Xlinker $(EXECUTABLE) -lgcc
|
|
|
|
PRE_OBJS_FLAGS := -Wl,--whole-archive
|
|
|
|
POST_OBJS_FLAGS := -Wl,--no-whole-archive
|
2022-06-14 20:05:03 +00:00
|
|
|
'
|
|
|
|
;;
|
|
|
|
riscos)
|
|
|
|
_elf_loader=yes
|
|
|
|
append_var DEFINES "-DELF_LOADER_CXA_ATEXIT"
|
|
|
|
append_var CXXFLAGS "-fuse-cxa-atexit"
|
|
|
|
append_var DEFINES "-DUNCACHED_PLUGINS"
|
2022-06-18 23:36:25 +00:00
|
|
|
append_var DEFINES "-DELF_NO_MEM_MANAGER"
|
2022-06-14 20:05:03 +00:00
|
|
|
_mak_plugins='
|
|
|
|
PLUGIN_EXTRA_DEPS += backends/plugins/riscos/plugin.o
|
|
|
|
PLUGIN_LDFLAGS += -static -Wl,-T$(srcdir)/backends/plugins/riscos/plugin.ld backends/plugins/riscos/plugin.o -Wl,--wrap=__rt_stkovf_split_small -Wl,--wrap=__rt_stkovf_split_big
|
2007-05-27 10:46:47 +00:00
|
|
|
'
|
|
|
|
;;
|
2004-02-15 01:21:02 +00:00
|
|
|
*)
|
2008-05-06 03:11:01 +00:00
|
|
|
_dynamic_modules=no
|
2005-02-06 17:21:31 +00:00
|
|
|
_mak_plugins=
|
2007-11-01 21:03:16 +00:00
|
|
|
;;
|
|
|
|
esac
|
2008-05-06 03:11:01 +00:00
|
|
|
echo "$_dynamic_modules"
|
2004-02-15 01:21:02 +00:00
|
|
|
fi
|
|
|
|
|
2010-09-15 07:43:16 +00:00
|
|
|
#
|
|
|
|
# Check whether integrated ELF loader support is requested
|
|
|
|
#
|
|
|
|
define_in_config_if_yes "$_elf_loader" 'USE_ELF_LOADER'
|
|
|
|
|
|
|
|
if test "$_elf_loader" = yes; then
|
2011-05-25 12:55:36 +00:00
|
|
|
_plugin_prefix=""
|
|
|
|
_plugin_suffix=".plg"
|
2010-09-15 07:43:16 +00:00
|
|
|
_mak_plugins='
|
|
|
|
PLUGIN_EXTRA_DEPS = $(EXECUTABLE)
|
2022-06-18 15:38:12 +00:00
|
|
|
PLUGIN_LDFLAGS += -nostartfiles backends/plugins/elf/version.o -Wl,-q,--retain-symbols-file,$(srcdir)/backends/plugins/elf/plugin.syms -Xlinker --just-symbols -Xlinker $(EXECUTABLE)
|
2010-09-15 07:43:16 +00:00
|
|
|
PRE_OBJS_FLAGS := -Wl,--whole-archive
|
|
|
|
POST_OBJS_FLAGS := -Wl,--no-whole-archive
|
|
|
|
'"$_mak_plugins"
|
|
|
|
fi
|
2004-11-06 01:41:32 +00:00
|
|
|
|
2011-05-25 12:55:36 +00:00
|
|
|
#
|
|
|
|
# Set up some common plugin settings in config.h and config.mk, if enabled
|
|
|
|
#
|
2011-05-30 22:35:27 +00:00
|
|
|
define_in_config_if_yes "$_dynamic_modules" 'DYNAMIC_MODULES'
|
|
|
|
|
2011-05-25 12:55:36 +00:00
|
|
|
if test "$_dynamic_modules" = yes ; then
|
|
|
|
add_line_to_config_h "#define PLUGIN_PREFIX \"$_plugin_prefix\""
|
|
|
|
add_line_to_config_h "#define PLUGIN_SUFFIX \"$_plugin_suffix\""
|
|
|
|
add_line_to_config_mk "PLUGIN_PREFIX := $_plugin_prefix"
|
|
|
|
add_line_to_config_mk "PLUGIN_SUFFIX := $_plugin_suffix"
|
|
|
|
fi
|
|
|
|
|
2020-08-25 13:59:13 +00:00
|
|
|
#
|
|
|
|
# Set up a define for detection to be used as static or not
|
|
|
|
#
|
|
|
|
define_in_config_if_yes "$_detection_features_static" "DETECTION_STATIC"
|
|
|
|
echo_n "Checking if detection features building statically... "
|
|
|
|
echo "$_detection_features_static"
|
2011-05-25 12:55:36 +00:00
|
|
|
|
2020-12-06 14:28:08 +00:00
|
|
|
#
|
|
|
|
# Set up a define for detection to be used as static or not
|
|
|
|
#
|
|
|
|
define_in_config_if_yes "$_detection_features_full" "DETECTION_FULL"
|
|
|
|
echo_n "Checking if building detection features for all engines... "
|
|
|
|
echo "$_detection_features_full"
|
|
|
|
|
2004-11-06 01:41:32 +00:00
|
|
|
#
|
|
|
|
# Check whether integrated MT-32 emulator support is requested
|
|
|
|
#
|
2010-07-20 08:24:48 +00:00
|
|
|
define_in_config_if_yes "$_mt32emu" 'USE_MT32EMU'
|
2004-11-06 01:41:32 +00:00
|
|
|
|
2019-03-08 21:11:35 +00:00
|
|
|
#
|
|
|
|
# Check whether Lua support is requested
|
|
|
|
#
|
|
|
|
define_in_config_if_yes "$_lua" 'USE_LUA'
|
|
|
|
|
2018-04-07 07:52:44 +00:00
|
|
|
#
|
|
|
|
# Check whether Nuked OPL emulator support is disabled
|
|
|
|
#
|
2018-04-07 10:21:43 +00:00
|
|
|
define_in_config_if_no "$_nuked_opl" 'DISABLE_NUKED_OPL'
|
2018-04-07 07:52:44 +00:00
|
|
|
|
2009-08-21 09:43:30 +00:00
|
|
|
#
|
|
|
|
# Check whether 16bit color support is requested
|
|
|
|
#
|
2010-07-20 08:24:48 +00:00
|
|
|
define_in_config_if_yes "$_16bit" 'USE_RGB_COLOR'
|
2009-08-21 09:43:30 +00:00
|
|
|
|
2016-03-05 13:25:56 +00:00
|
|
|
#
|
|
|
|
# Check whether High resolution graphics support is requested
|
|
|
|
#
|
|
|
|
define_in_config_if_yes "$_highres" 'USE_HIGHRES'
|
|
|
|
|
2011-09-22 18:32:48 +00:00
|
|
|
#
|
2011-09-30 20:03:26 +00:00
|
|
|
# Check whether save games use the current time as default description
|
2011-09-22 18:32:48 +00:00
|
|
|
#
|
|
|
|
define_in_config_if_yes "$_savegame_timestamp" 'USE_SAVEGAME_TIMESTAMP'
|
|
|
|
|
2009-03-18 21:51:56 +00:00
|
|
|
#
|
2012-08-14 06:43:01 +00:00
|
|
|
# Check whether to enable the (hq (and edge)) scalers
|
2009-03-18 21:51:56 +00:00
|
|
|
#
|
2010-05-09 11:00:17 +00:00
|
|
|
if test "$_build_scalers" = no ; then
|
2010-05-10 17:25:12 +00:00
|
|
|
_build_hq_scalers=no
|
2012-08-14 06:43:01 +00:00
|
|
|
_build_edge_scalers=no
|
|
|
|
elif test "$_build_hq_scalers" = no ; then
|
|
|
|
_build_edge_scalers=no
|
2010-05-09 11:00:17 +00:00
|
|
|
fi
|
2012-08-14 06:43:01 +00:00
|
|
|
|
2010-07-20 08:24:48 +00:00
|
|
|
define_in_config_if_yes "$_build_scalers" 'USE_SCALERS'
|
2010-05-09 11:00:17 +00:00
|
|
|
|
2010-07-20 08:24:48 +00:00
|
|
|
define_in_config_if_yes "$_build_hq_scalers" 'USE_HQ_SCALERS'
|
2009-03-18 21:51:56 +00:00
|
|
|
|
2012-08-14 06:43:01 +00:00
|
|
|
define_in_config_if_yes "$_build_edge_scalers" 'USE_EDGE_SCALERS'
|
|
|
|
|
2012-08-25 16:16:46 +00:00
|
|
|
define_in_config_if_yes "$_build_aspect" 'USE_ASPECT'
|
|
|
|
|
2008-01-31 12:20:47 +00:00
|
|
|
#
|
|
|
|
# Check for math lib
|
|
|
|
#
|
2008-02-07 15:53:26 +00:00
|
|
|
cat > $TMPC << EOF
|
|
|
|
int main(void) { return 0; }
|
|
|
|
EOF
|
2015-07-22 12:32:03 +00:00
|
|
|
cc_check -lm && append_var LIBS "-lm"
|
2008-01-31 12:20:47 +00:00
|
|
|
|
2004-02-15 01:21:02 +00:00
|
|
|
#
|
2017-10-01 18:26:11 +00:00
|
|
|
# Check for Ogg
|
|
|
|
#
|
|
|
|
echocheck "Ogg"
|
|
|
|
if test "$_ogg" = auto ; then
|
|
|
|
_ogg=no
|
|
|
|
cat > $TMPC << EOF
|
|
|
|
#include <ogg/ogg.h>
|
|
|
|
int main(void) { return 0; }
|
|
|
|
EOF
|
|
|
|
cc_check $OGG_CFLAGS $OGG_LIBS -logg && _ogg=yes
|
|
|
|
fi
|
|
|
|
define_in_config_if_yes "$_ogg" 'USE_OGG'
|
|
|
|
echo "$_ogg"
|
2019-07-24 02:36:26 +00:00
|
|
|
#
|
|
|
|
# Check for TTS
|
|
|
|
#
|
|
|
|
echocheck "TTS libraries"
|
|
|
|
if test "$_tts" = auto ; then
|
|
|
|
_tts=no
|
|
|
|
case $_host_os in
|
2019-10-09 19:19:31 +00:00
|
|
|
mingw*)
|
|
|
|
cat > $TMPC << EOF
|
|
|
|
#include <windows.h>
|
2020-11-14 15:39:47 +00:00
|
|
|
#include <servprov.h>
|
2019-10-09 19:19:31 +00:00
|
|
|
#include <sapi.h>
|
|
|
|
int main(void) { return 0; }
|
|
|
|
EOF
|
|
|
|
cc_check -lsapi -lole32 && _tts=yes
|
|
|
|
;;
|
2020-09-13 10:37:11 +00:00
|
|
|
linux* | freebsd* | openbsd*)
|
2019-07-24 02:36:26 +00:00
|
|
|
cat > $TMPC << EOF
|
|
|
|
#include <speech-dispatcher/libspeechd.h>
|
|
|
|
int main(void) { return 0; }
|
|
|
|
EOF
|
|
|
|
cc_check -lspeechd && _tts=yes
|
|
|
|
;;
|
2019-07-28 13:56:38 +00:00
|
|
|
darwin*)
|
2022-05-30 09:43:31 +00:00
|
|
|
# Check the API is available. The most recent API we need is for the NSSpeechSynthesizerDelegate protocol
|
2019-09-02 21:24:42 +00:00
|
|
|
cat > $TMPC << EOF
|
|
|
|
#include <AppKit/NSSpeechSynthesizer.h>
|
|
|
|
@interface SpeechDelegate : NSObject<NSSpeechSynthesizerDelegate> {
|
|
|
|
}
|
|
|
|
@end
|
|
|
|
int main(void) { return 0; }
|
|
|
|
EOF
|
|
|
|
cc_check -ObjC++ -lobjc && _tts=yes
|
2019-07-28 13:56:38 +00:00
|
|
|
;;
|
2019-07-24 02:36:26 +00:00
|
|
|
esac
|
|
|
|
fi
|
|
|
|
echo "$_tts"
|
2017-10-01 18:26:11 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Check for Vorbis
|
2004-02-15 01:21:02 +00:00
|
|
|
#
|
2017-10-01 18:26:11 +00:00
|
|
|
echocheck "Vorbis"
|
2003-05-18 05:43:52 +00:00
|
|
|
if test "$_vorbis" = auto ; then
|
2004-12-16 22:15:32 +00:00
|
|
|
_vorbis=no
|
|
|
|
cat > $TMPC << EOF
|
2003-05-18 05:43:52 +00:00
|
|
|
#include <vorbis/codec.h>
|
|
|
|
int main(void) { vorbis_packet_blocksize(0,0); return 0; }
|
|
|
|
EOF
|
2017-10-01 18:26:11 +00:00
|
|
|
if test "$_ogg" = yes ; then
|
|
|
|
cc_check $OGG_CFLAGS $OGG_LIBS $VORBIS_CFLAGS $VORBIS_LIBS \
|
|
|
|
-lvorbisfile -lvorbis -logg && _vorbis=yes
|
|
|
|
else
|
|
|
|
cc_check $VORBIS_CFLAGS $VORBIS_LIBS \
|
|
|
|
-lvorbisfile -lvorbis && _vorbis=yes
|
|
|
|
fi
|
2003-05-18 05:43:52 +00:00
|
|
|
fi
|
|
|
|
if test "$_vorbis" = yes ; then
|
2017-10-01 18:26:11 +00:00
|
|
|
append_var LIBS "$VORBIS_LIBS -lvorbisfile -lvorbis"
|
|
|
|
append_var INCLUDES "$VORBIS_CFLAGS"
|
2003-05-18 05:43:52 +00:00
|
|
|
fi
|
2010-07-20 08:24:48 +00:00
|
|
|
define_in_config_if_yes "$_vorbis" 'USE_VORBIS'
|
2003-05-18 05:43:52 +00:00
|
|
|
echo "$_vorbis"
|
|
|
|
|
2005-06-30 09:14:36 +00:00
|
|
|
#
|
|
|
|
# Check for Tremor
|
|
|
|
#
|
|
|
|
echocheck "Tremor"
|
2011-04-22 08:56:05 +00:00
|
|
|
if test "$_tremolo" = yes ; then
|
|
|
|
_tremor=yes
|
|
|
|
fi
|
|
|
|
|
2005-06-30 09:14:36 +00:00
|
|
|
if test "$_tremor" = auto ; then
|
2007-11-01 21:03:16 +00:00
|
|
|
_tremor=no
|
|
|
|
cat > $TMPC << EOF
|
2005-06-30 09:14:36 +00:00
|
|
|
#include <tremor/ivorbiscodec.h>
|
2009-03-19 18:36:45 +00:00
|
|
|
int main(void) { vorbis_info_init(0); return 0; }
|
2005-06-30 09:14:36 +00:00
|
|
|
EOF
|
2017-10-01 18:26:11 +00:00
|
|
|
if test "$_ogg" = yes ; then
|
|
|
|
cc_check $TREMOR_CFLAGS $TREMOR_LIBS $OGG_CFLAGS $OGG_LIBS \
|
|
|
|
-lvorbisidec -logg && _tremor=yes
|
|
|
|
else
|
|
|
|
cc_check $TREMOR_CFLAGS $TREMOR_LIBS -lvorbisidec && \
|
|
|
|
_tremor=yes
|
|
|
|
fi
|
2005-06-30 09:14:36 +00:00
|
|
|
fi
|
|
|
|
if test "$_tremor" = yes && test "$_vorbis" = no; then
|
2010-07-20 08:24:48 +00:00
|
|
|
add_line_to_config_h '#define USE_TREMOR'
|
|
|
|
add_line_to_config_h '#define USE_VORBIS'
|
2011-04-22 08:56:05 +00:00
|
|
|
if test "$_tremolo" = yes ; then
|
|
|
|
add_line_to_config_h '#define USE_TREMOLO'
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var LIBS "$TREMOR_LIBS -ltremolo"
|
2011-04-22 08:56:05 +00:00
|
|
|
else
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var LIBS "$TREMOR_LIBS -lvorbisidec"
|
2011-04-22 08:56:05 +00:00
|
|
|
fi
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var INCLUDES "$TREMOR_CFLAGS"
|
2005-06-30 09:14:36 +00:00
|
|
|
else
|
2007-04-28 13:43:51 +00:00
|
|
|
if test "$_vorbis" = yes; then
|
2017-10-01 18:26:11 +00:00
|
|
|
_tremor="no (Vorbis/Tremor support is mutually exclusive)"
|
2007-04-28 13:43:51 +00:00
|
|
|
fi
|
2010-07-20 08:24:48 +00:00
|
|
|
add_line_to_config_h '#undef USE_TREMOR'
|
2005-06-30 09:14:36 +00:00
|
|
|
fi
|
2008-04-08 03:05:31 +00:00
|
|
|
add_to_config_mk_if_yes "$_tremor" 'USE_TREMOR = 1'
|
2005-06-30 09:14:36 +00:00
|
|
|
echo "$_tremor"
|
|
|
|
|
2018-02-17 11:50:19 +00:00
|
|
|
#
|
|
|
|
# Check for IEEE1284 for OPL2lPT
|
|
|
|
#
|
|
|
|
echocheck "OPL2LPT"
|
|
|
|
if test "$_opl2lpt" = yes ; then
|
|
|
|
_opl2lpt=no
|
|
|
|
cat > $TMPC << EOF
|
|
|
|
#include <ieee1284.h>
|
|
|
|
struct parport_list parports;
|
|
|
|
int main(void) { ieee1284_find_ports(&parports, 0); return 0; }
|
|
|
|
EOF
|
|
|
|
cc_check $IEEE1284_CFLAGS $IEEE1284_LIBS -lieee1284 && \
|
|
|
|
_opl2lpt=yes
|
|
|
|
fi
|
|
|
|
if test "$_opl2lpt" = yes; then
|
|
|
|
append_var LIBS "$IEEE1284_LIBS -lieee1284"
|
|
|
|
append_var INCLUDES "$IEEE1284_CFLAGS"
|
|
|
|
fi
|
|
|
|
define_in_config_if_yes "$_opl2lpt" 'ENABLE_OPL2LPT'
|
|
|
|
echo "$_opl2lpt"
|
|
|
|
|
2022-01-29 16:33:29 +00:00
|
|
|
#
|
|
|
|
# Check for retrowave for RetroWave OPL3
|
|
|
|
#
|
|
|
|
echocheck "RetroWave OPL3"
|
2023-01-01 16:43:46 +00:00
|
|
|
if test "$_retrowave" = auto ; then
|
2022-01-29 16:33:29 +00:00
|
|
|
_retrowave=no
|
|
|
|
cat > $TMPC << EOF
|
|
|
|
#include <RetroWaveLib/RetroWave.h>
|
|
|
|
RetroWaveContext context;
|
|
|
|
int main(void) { retrowave_init(&context); return 0; }
|
|
|
|
EOF
|
2023-01-01 16:43:46 +00:00
|
|
|
cc_check $RETROWAVE_CFLAGS $RETROWAVE_LIBS -lRetroWave && \
|
2022-01-29 16:33:29 +00:00
|
|
|
_retrowave=yes
|
|
|
|
fi
|
|
|
|
if test "$_retrowave" = yes; then
|
2023-01-01 16:43:46 +00:00
|
|
|
append_var LIBS "$RETROWAVE_LIBS -lRetroWave"
|
2022-01-29 16:33:29 +00:00
|
|
|
append_var INCLUDES "$RETROWAVE_CFLAGS"
|
|
|
|
fi
|
|
|
|
define_in_config_if_yes "$_retrowave" 'USE_RETROWAVE'
|
|
|
|
echo "$_retrowave"
|
|
|
|
|
2006-08-05 10:51:15 +00:00
|
|
|
#
|
|
|
|
# Check for FLAC
|
|
|
|
#
|
2004-02-23 16:41:05 +00:00
|
|
|
echocheck "FLAC >= 1.0.1"
|
2004-02-22 14:11:16 +00:00
|
|
|
if test "$_flac" = auto ; then
|
2004-12-16 22:15:32 +00:00
|
|
|
_flac=no
|
|
|
|
cat > $TMPC << EOF
|
2017-10-01 18:26:11 +00:00
|
|
|
#include <FLAC/stream_decoder.h>
|
2006-10-28 13:21:43 +00:00
|
|
|
#include <FLAC/format.h>
|
2017-10-01 18:26:11 +00:00
|
|
|
int main(void) {
|
|
|
|
FLAC__StreamDecoder *decoder = FLAC__stream_decoder_new();
|
|
|
|
FLAC__stream_decoder_delete(decoder);
|
|
|
|
return FLAC__STREAM_SYNC_LEN >> 30; /* guaranteed to be 0 */
|
|
|
|
}
|
2004-02-22 14:11:16 +00:00
|
|
|
EOF
|
2017-10-01 18:26:11 +00:00
|
|
|
if test "$_ogg" = yes ; then
|
2010-04-09 14:23:30 +00:00
|
|
|
cc_check $FLAC_CFLAGS $FLAC_LIBS $OGG_CFLAGS $OGG_LIBS \
|
2009-03-19 18:47:01 +00:00
|
|
|
-lFLAC -logg && _flac=yes
|
|
|
|
else
|
2010-04-09 14:23:30 +00:00
|
|
|
cc_check $FLAC_CFLAGS $FLAC_LIBS \
|
2009-03-19 18:47:01 +00:00
|
|
|
-lFLAC && _flac=yes
|
|
|
|
fi
|
2004-02-22 14:11:16 +00:00
|
|
|
fi
|
|
|
|
if test "$_flac" = yes ; then
|
2017-10-01 18:26:11 +00:00
|
|
|
append_var LIBS "$FLAC_LIBS -lFLAC"
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var INCLUDES "$FLAC_CFLAGS"
|
2004-02-22 14:11:16 +00:00
|
|
|
fi
|
2010-07-20 08:24:48 +00:00
|
|
|
define_in_config_if_yes "$_flac" 'USE_FLAC'
|
2004-02-22 14:11:16 +00:00
|
|
|
echo "$_flac"
|
|
|
|
|
2018-04-07 21:05:52 +00:00
|
|
|
# Add the link to ogg only after vorbis, tremor and flac as it might be used by those.
|
2017-10-02 19:55:51 +00:00
|
|
|
if test "$_ogg" = yes ; then
|
|
|
|
append_var LIBS "$OGG_LIBS -logg"
|
|
|
|
append_var INCLUDES "$OGG_CFLAGS"
|
|
|
|
fi
|
|
|
|
|
2004-02-15 01:21:02 +00:00
|
|
|
#
|
|
|
|
# Check for MAD (MP3 library)
|
|
|
|
#
|
2003-05-18 05:43:52 +00:00
|
|
|
echocheck "MAD"
|
|
|
|
if test "$_mad" = auto ; then
|
2004-12-16 22:15:32 +00:00
|
|
|
_mad=no
|
|
|
|
cat > $TMPC << EOF
|
2003-05-18 05:43:52 +00:00
|
|
|
#include <mad.h>
|
2009-03-19 21:42:50 +00:00
|
|
|
int main(void) { return 0; }
|
2003-05-18 05:43:52 +00:00
|
|
|
EOF
|
2010-04-09 14:23:30 +00:00
|
|
|
cc_check $MAD_CFLAGS $MAD_LIBS -lmad && _mad=yes
|
2003-05-18 05:43:52 +00:00
|
|
|
fi
|
|
|
|
if test "$_mad" = yes ; then
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var LIBS "$MAD_LIBS -lmad"
|
|
|
|
append_var INCLUDES "$MAD_CFLAGS"
|
2003-05-18 05:43:52 +00:00
|
|
|
fi
|
2010-07-20 08:24:48 +00:00
|
|
|
define_in_config_if_yes "$_mad" 'USE_MAD'
|
2003-05-18 05:43:52 +00:00
|
|
|
echo "$_mad"
|
|
|
|
|
2004-02-15 01:21:02 +00:00
|
|
|
#
|
|
|
|
# Check for ALSA
|
|
|
|
#
|
2004-02-15 00:43:10 +00:00
|
|
|
echocheck "ALSA >= 0.9"
|
2003-05-18 05:43:52 +00:00
|
|
|
if test "$_alsa" = auto ; then
|
2004-12-16 22:15:32 +00:00
|
|
|
_alsa=no
|
|
|
|
cat > $TMPC << EOF
|
2003-05-18 05:43:52 +00:00
|
|
|
#include <alsa/asoundlib.h>
|
|
|
|
int main(void) { return (!(SND_LIB_MAJOR==0 && SND_LIB_MINOR==9)); }
|
|
|
|
EOF
|
2010-04-09 14:23:30 +00:00
|
|
|
cc_check $ALSA_CFLAGS $ALSA_LIBS -lasound && _alsa=yes
|
2003-05-18 05:43:52 +00:00
|
|
|
fi
|
|
|
|
if test "$_alsa" = yes ; then
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var LIBS "$ALSA_LIBS -lasound"
|
|
|
|
append_var INCLUDES "$ALSA_CFLAGS"
|
2003-05-18 05:43:52 +00:00
|
|
|
fi
|
2015-05-15 01:08:11 +00:00
|
|
|
define_in_config_if_yes "$_alsa" 'USE_ALSA'
|
2003-05-18 05:43:52 +00:00
|
|
|
echo "$_alsa"
|
|
|
|
|
2013-08-11 21:36:57 +00:00
|
|
|
#
|
|
|
|
# Check for libjpeg
|
|
|
|
#
|
|
|
|
echocheck "libjpeg >= v6b"
|
|
|
|
if test "$_jpeg" = auto ; then
|
|
|
|
_jpeg=no
|
|
|
|
cat > $TMPC << EOF
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <jpeglib.h>
|
|
|
|
int main(void) {
|
|
|
|
#if JPEG_LIB_VERSION >= 62
|
|
|
|
#else
|
|
|
|
syntax error
|
|
|
|
#endif
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
EOF
|
|
|
|
cc_check $JPEG_CFLAGS $JPEG_LIBS -ljpeg && _jpeg=yes
|
|
|
|
fi
|
|
|
|
if test "$_jpeg" = yes ; then
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var LIBS "$JPEG_LIBS -ljpeg"
|
|
|
|
append_var INCLUDES "$JPEG_CFLAGS"
|
2013-08-11 21:36:57 +00:00
|
|
|
fi
|
|
|
|
define_in_config_if_yes "$_jpeg" 'USE_JPEG'
|
|
|
|
echo "$_jpeg"
|
|
|
|
|
2010-10-12 21:12:50 +00:00
|
|
|
#
|
|
|
|
# Check for PNG
|
|
|
|
#
|
|
|
|
echocheck "PNG >= 1.2.8"
|
2019-09-20 20:44:40 +00:00
|
|
|
if test "$_pkg_config" = "yes" && $_pkgconfig --exists libpng; then
|
|
|
|
append_var PNG_LIBS "`$_pkgconfig --libs libpng`"
|
|
|
|
append_var PNG_CFLAGS "`$_pkgconfig --cflags libpng`"
|
|
|
|
else
|
|
|
|
append_var PNG_LIBS "-lpng -lz"
|
|
|
|
fi
|
2010-10-12 21:12:50 +00:00
|
|
|
if test "$_png" = auto ; then
|
|
|
|
_png=no
|
|
|
|
cat > $TMPC << EOF
|
|
|
|
#include <png.h>
|
2010-10-13 10:50:45 +00:00
|
|
|
int main(void) {
|
|
|
|
#if PNG_LIBPNG_VER >= 10208
|
|
|
|
#else
|
|
|
|
syntax error
|
|
|
|
#endif
|
|
|
|
return 0;
|
|
|
|
}
|
2010-10-12 21:12:50 +00:00
|
|
|
EOF
|
2019-09-20 20:44:40 +00:00
|
|
|
cc_check $PNG_CFLAGS $PNG_LIBS && _png=yes
|
2010-10-12 21:12:50 +00:00
|
|
|
fi
|
|
|
|
if test "$_png" = yes ; then
|
2019-09-20 20:44:40 +00:00
|
|
|
append_var LIBS "$PNG_LIBS"
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var INCLUDES "$PNG_CFLAGS"
|
2010-10-12 21:12:50 +00:00
|
|
|
fi
|
2010-10-15 03:33:54 +00:00
|
|
|
define_in_config_if_yes "$_png" 'USE_PNG'
|
2010-10-12 21:12:50 +00:00
|
|
|
echo "$_png"
|
|
|
|
|
2021-04-04 11:05:28 +00:00
|
|
|
#
|
|
|
|
# Check for GIF
|
|
|
|
#
|
|
|
|
echocheck "GIF >= 5.0.0"
|
|
|
|
if test "$_pkg_config" = "yes" && $_pkgconfig --exists libgif; then
|
|
|
|
append_var GIF_LIBS "`$_pkgconfig --libs libgif`"
|
|
|
|
append_var GIF_CFLAGS "`$_pkgconfig --cflags libgif`"
|
|
|
|
else
|
|
|
|
append_var GIF_LIBS "-lgif"
|
|
|
|
fi
|
|
|
|
if test "$_gif" = auto ; then
|
|
|
|
_gif=no
|
|
|
|
cat > $TMPC << EOF
|
|
|
|
#include <gif_lib.h>
|
|
|
|
int main(void) {
|
|
|
|
#if GIFLIB_MAJOR >= 5
|
|
|
|
#else
|
|
|
|
syntax error
|
|
|
|
#endif
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
EOF
|
|
|
|
cc_check $GIF_CFLAGS $GIF_LIBS && _gif=yes
|
|
|
|
fi
|
|
|
|
if test "$_gif" = yes ; then
|
|
|
|
append_var LIBS "$GIF_LIBS"
|
|
|
|
append_var INCLUDES "$GIF_CFLAGS"
|
|
|
|
fi
|
|
|
|
define_in_config_if_yes "$_gif" 'USE_GIF'
|
|
|
|
echo "$_gif"
|
|
|
|
|
2010-10-12 21:12:50 +00:00
|
|
|
#
|
|
|
|
# Check for Theora Decoder
|
|
|
|
#
|
|
|
|
echocheck "libtheoradec >= 1.0"
|
2018-08-01 19:10:55 +00:00
|
|
|
if test "$_vorbis" = no && test "$_tremor" = no ; then
|
2010-10-12 21:12:50 +00:00
|
|
|
echo "skipping. no vorbis"
|
|
|
|
_theoradec=notsupported
|
|
|
|
fi
|
|
|
|
if test "$_theoradec" = auto ; then
|
|
|
|
_theoradec=no
|
|
|
|
cat > $TMPC << EOF
|
|
|
|
#include <theora/theoradec.h>
|
|
|
|
int main(void) { th_ycbcr_buffer yuv; th_decode_ycbcr_out(NULL, yuv); }
|
|
|
|
EOF
|
|
|
|
cc_check $THEORADEC_CFLAGS $THEORADEC_LIBS -ltheoradec && _theoradec=yes
|
|
|
|
fi
|
|
|
|
if test "$_theoradec" = yes ; then
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var LIBS "$THEORADEC_LIBS -ltheoradec"
|
|
|
|
append_var INCLUDES "$THEORADEC_CFLAGS"
|
2010-10-12 21:12:50 +00:00
|
|
|
fi
|
2010-10-13 15:00:51 +00:00
|
|
|
define_in_config_if_yes "$_theoradec" 'USE_THEORADEC'
|
2010-10-12 21:12:50 +00:00
|
|
|
if test ! "$_theoradec" = notsupported ; then
|
|
|
|
echo "$_theoradec"
|
|
|
|
fi
|
|
|
|
|
2011-04-09 19:27:23 +00:00
|
|
|
#
|
|
|
|
# Check for the AAC decoder
|
|
|
|
#
|
|
|
|
echocheck "libfaad"
|
|
|
|
if test "$_faad" = auto ; then
|
|
|
|
_faad=no
|
|
|
|
cat > $TMPC << EOF
|
|
|
|
#include <neaacdec.h>
|
|
|
|
int main(void) { NeAACDecGetCapabilities(); return 0; }
|
|
|
|
EOF
|
|
|
|
cc_check $FAAD_CFLAGS $FAAD_LIBS -lfaad && _faad=yes
|
|
|
|
fi
|
|
|
|
if test "$_faad" = yes ; then
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var LIBS "$FAAD_LIBS -lfaad"
|
|
|
|
append_var INCLUDES "$FAAD_CFLAGS"
|
2011-04-09 19:27:23 +00:00
|
|
|
fi
|
|
|
|
define_in_config_if_yes "$_faad" 'USE_FAAD'
|
|
|
|
echo "$_faad"
|
|
|
|
|
2010-07-20 08:24:48 +00:00
|
|
|
#
|
|
|
|
# Check for SEQ MIDI
|
|
|
|
#
|
|
|
|
echocheck "SEQ MIDI"
|
2010-07-20 08:25:13 +00:00
|
|
|
if test "$_seq_midi" = auto ; then
|
2010-07-20 08:24:48 +00:00
|
|
|
# TODO: Test for /dev/sequencer presence? Or maybe just for /dev ?
|
2011-05-05 13:38:54 +00:00
|
|
|
# For now, we just always enable it when "posix" mode is on (backends
|
2010-07-20 08:25:13 +00:00
|
|
|
# that do not want it can disable it by setting _seq_midi=no).
|
2011-05-05 13:38:54 +00:00
|
|
|
_seq_midi="$_posix"
|
2010-07-20 08:24:48 +00:00
|
|
|
fi
|
2010-07-20 08:25:13 +00:00
|
|
|
define_in_config_h_if_yes "$_seq_midi" 'USE_SEQ_MIDI'
|
|
|
|
echo "$_seq_midi"
|
2010-07-20 08:24:48 +00:00
|
|
|
|
2012-05-14 13:37:30 +00:00
|
|
|
#
|
|
|
|
# Check for sndio
|
|
|
|
#
|
|
|
|
echocheck "sndio"
|
|
|
|
if test "$_sndio" = auto ; then
|
|
|
|
_sndio=no
|
|
|
|
cat > $TMPC << EOF
|
|
|
|
#include <sndio.h>
|
|
|
|
int main(void) { struct sio_par par; sio_initpar(&par); return 0; }
|
|
|
|
EOF
|
|
|
|
cc_check $SNDIO_CFLAGS $SNDIO_LIBS -lsndio && _sndio=yes
|
|
|
|
fi
|
|
|
|
if test "$_sndio" = yes ; then
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var LIBS "$SNDIO_LIBS -lsndio"
|
|
|
|
append_var INCLUDES "$SNDIO_CFLAGS"
|
2012-05-14 13:37:30 +00:00
|
|
|
fi
|
|
|
|
define_in_config_h_if_yes "$_sndio" 'USE_SNDIO'
|
|
|
|
echo "$_sndio"
|
|
|
|
|
2010-10-13 00:48:40 +00:00
|
|
|
#
|
|
|
|
# Check for TiMidity(++)
|
|
|
|
#
|
|
|
|
echocheck "TiMidity"
|
|
|
|
if test "$_timidity" = auto ; then
|
|
|
|
# TODO: Is there a good possibility of auto detecting whether we
|
|
|
|
# should include TiMidity support? It can only be used on Unix
|
|
|
|
# currently so we use that as "detection" for now.
|
2011-05-05 13:38:54 +00:00
|
|
|
_timidity="$_posix"
|
2010-10-13 00:48:40 +00:00
|
|
|
fi
|
|
|
|
define_in_config_h_if_yes "$_timidity" 'USE_TIMIDITY'
|
|
|
|
echo "$_timidity"
|
|
|
|
|
2004-02-15 01:21:02 +00:00
|
|
|
#
|
|
|
|
# Check for ZLib
|
|
|
|
#
|
2003-12-10 00:15:20 +00:00
|
|
|
echocheck "zlib"
|
|
|
|
if test "$_zlib" = auto ; then
|
2004-12-16 22:15:32 +00:00
|
|
|
_zlib=no
|
|
|
|
cat > $TMPC << EOF
|
2003-12-10 00:15:20 +00:00
|
|
|
#include <string.h>
|
|
|
|
#include <zlib.h>
|
|
|
|
int main(void) { return strcmp(ZLIB_VERSION, zlibVersion()); }
|
|
|
|
EOF
|
2010-04-09 14:23:30 +00:00
|
|
|
cc_check $ZLIB_CFLAGS $ZLIB_LIBS -lz && _zlib=yes
|
2003-12-10 00:15:20 +00:00
|
|
|
fi
|
|
|
|
if test "$_zlib" = yes ; then
|
2017-08-13 10:57:32 +00:00
|
|
|
append_var ZLIB_LIBS "-lz"
|
|
|
|
append_var LIBS "$ZLIB_LIBS"
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var INCLUDES "$ZLIB_CFLAGS"
|
2003-12-10 00:15:20 +00:00
|
|
|
fi
|
2010-07-20 08:24:48 +00:00
|
|
|
define_in_config_if_yes "$_zlib" 'USE_ZLIB'
|
2003-12-10 00:15:20 +00:00
|
|
|
echo "$_zlib"
|
|
|
|
|
2012-11-19 18:13:36 +00:00
|
|
|
#
|
|
|
|
# Check for LibMPEG2
|
|
|
|
#
|
2013-07-02 01:29:59 +00:00
|
|
|
echocheck "libmpeg2 >= 0.4.0"
|
2012-11-19 18:13:36 +00:00
|
|
|
if test "$_mpeg2" = auto ; then
|
|
|
|
_mpeg2=no
|
|
|
|
cat > $TMPC << EOF
|
|
|
|
typedef signed $type_1_byte int8_t;
|
|
|
|
typedef signed $type_2_byte int16_t;
|
|
|
|
typedef signed $type_4_byte int32_t;
|
|
|
|
|
|
|
|
typedef unsigned $type_1_byte uint8_t;
|
|
|
|
typedef unsigned $type_2_byte uint16_t;
|
|
|
|
typedef unsigned $type_4_byte uint32_t;
|
|
|
|
|
2013-07-02 01:29:59 +00:00
|
|
|
extern "C" {
|
2012-11-19 18:13:36 +00:00
|
|
|
#include <mpeg2dec/mpeg2.h>
|
2013-07-02 01:29:59 +00:00
|
|
|
}
|
|
|
|
|
2012-11-19 18:13:36 +00:00
|
|
|
int main(void) {
|
2013-07-02 01:29:59 +00:00
|
|
|
#if MPEG2_RELEASE < MPEG2_VERSION(0, 4, 0)
|
|
|
|
#error libmpeg2 version too low
|
|
|
|
#endif
|
|
|
|
|
2012-11-19 18:13:36 +00:00
|
|
|
/* mpeg2_state_t first appears in 0.4.0 */
|
|
|
|
mpeg2_state_t state;
|
|
|
|
|
2013-07-02 01:29:59 +00:00
|
|
|
return 0;
|
2012-11-19 18:13:36 +00:00
|
|
|
}
|
|
|
|
EOF
|
|
|
|
|
|
|
|
if test -n "$_host"; then
|
|
|
|
# don't execute while cross compiling
|
|
|
|
cc_check $MPEG2_CFLAGS $MPEG2_LIBS -lmpeg2 && _mpeg2=yes
|
|
|
|
else
|
|
|
|
cc_check_no_clean $MPEG2_CFLAGS $MPEG2_LIBS -lmpeg2 && $TMPO$HOSTEXEEXT && _mpeg2=yes
|
|
|
|
cc_check_clean
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if test "$_mpeg2" = yes ; then
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var INCLUDES "$MPEG2_CFLAGS"
|
|
|
|
append_var LIBS "$MPEG2_LIBS -lmpeg2"
|
2012-11-19 18:13:36 +00:00
|
|
|
fi
|
|
|
|
define_in_config_if_yes "$_mpeg2" 'USE_MPEG2'
|
|
|
|
echo "$_mpeg2"
|
|
|
|
|
2015-08-01 18:11:50 +00:00
|
|
|
#
|
|
|
|
# Check for liba52
|
|
|
|
#
|
|
|
|
echocheck "liba52"
|
|
|
|
if test "$_a52" = auto ; then
|
|
|
|
_a52=no
|
|
|
|
cat > $TMPC << EOF
|
|
|
|
typedef signed $type_1_byte int8_t;
|
|
|
|
typedef signed $type_2_byte int16_t;
|
|
|
|
typedef signed $type_4_byte int32_t;
|
|
|
|
|
|
|
|
typedef unsigned $type_1_byte uint8_t;
|
|
|
|
typedef unsigned $type_2_byte uint16_t;
|
|
|
|
typedef unsigned $type_4_byte uint32_t;
|
|
|
|
|
|
|
|
extern "C" {
|
|
|
|
#include <a52dec/a52.h>
|
|
|
|
}
|
|
|
|
|
|
|
|
int main(void) {
|
2018-11-16 13:12:44 +00:00
|
|
|
a52_state_t *state = a52_init(0);
|
|
|
|
a52_free(state);
|
2015-08-01 18:11:50 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
EOF
|
|
|
|
|
|
|
|
if test -n "$_host"; then
|
|
|
|
# don't execute while cross compiling
|
|
|
|
cc_check $A52_CFLAGS $A52_LIBS -la52 && _a52=yes
|
|
|
|
else
|
2021-08-06 14:43:53 +00:00
|
|
|
cc_check_no_clean $A52_CFLAGS $A52_LIBS -la52 && $TMPO$HOSTEXEEXT 2>/dev/null && _a52=yes
|
2015-08-01 18:11:50 +00:00
|
|
|
cc_check_clean
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if test "$_a52" = yes ; then
|
|
|
|
INCLUDES="$INCLUDES $A52_FLAGS"
|
|
|
|
LIBS="$LIBS $A52_LIBS -la52"
|
|
|
|
fi
|
|
|
|
define_in_config_if_yes "$_a52" 'USE_A52'
|
|
|
|
echo "$_a52"
|
|
|
|
|
2011-07-03 21:01:17 +00:00
|
|
|
#
|
2011-07-07 00:47:46 +00:00
|
|
|
# Check for Sparkle if updates support is enabled
|
2011-07-03 21:01:17 +00:00
|
|
|
#
|
2016-03-25 20:28:41 +00:00
|
|
|
case $_host_os in
|
|
|
|
darwin*)
|
|
|
|
echocheck "Sparkle"
|
|
|
|
if test "$_updates" = no; then
|
|
|
|
_sparkle=no
|
|
|
|
else
|
2019-10-12 12:27:28 +00:00
|
|
|
if test -z $_sparklepath; then
|
|
|
|
_sparklepath=/Library/Frameworks
|
2016-03-27 12:04:42 +00:00
|
|
|
fi
|
2019-10-12 12:27:28 +00:00
|
|
|
SPARKLE_CFLAGS="-F$_sparklepath"
|
|
|
|
SPARKLE_LIBS="-F$_sparklepath"
|
2016-03-27 12:04:42 +00:00
|
|
|
if test "$_sparkle" = auto ; then
|
|
|
|
_sparkle=no
|
|
|
|
cat > $TMPC << EOF
|
2011-07-03 21:01:17 +00:00
|
|
|
#include <Cocoa/Cocoa.h>
|
|
|
|
#include <Sparkle/Sparkle.h>
|
|
|
|
int main(void) { SUUpdater *updater = [SUUpdater sharedUpdater]; return 0; }
|
|
|
|
EOF
|
2016-03-27 12:04:42 +00:00
|
|
|
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'
|
2016-03-25 20:28:41 +00:00
|
|
|
fi
|
|
|
|
echo "$_sparkle"
|
|
|
|
;;
|
2016-05-29 17:09:23 +00:00
|
|
|
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"
|
|
|
|
;;
|
2016-03-25 20:28:41 +00:00
|
|
|
*)
|
|
|
|
_sparkle=no
|
|
|
|
;;
|
|
|
|
esac
|
2011-07-03 21:01:17 +00:00
|
|
|
|
2016-05-11 15:40:55 +00:00
|
|
|
#
|
|
|
|
# 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
|
2017-12-18 23:36:42 +00:00
|
|
|
if test -n "$_staticlibpath"; then
|
|
|
|
LIBCURL_LIBS=`$_libcurlconfig --static-libs`
|
|
|
|
else
|
|
|
|
LIBCURL_LIBS=`$_libcurlconfig --libs`
|
|
|
|
fi
|
2016-05-11 15:40:55 +00:00
|
|
|
LIBCURL_CFLAGS=`$_libcurlconfig --cflags`
|
|
|
|
|
2016-09-10 21:11:40 +00:00
|
|
|
case $_host_os in
|
2020-05-03 19:55:54 +00:00
|
|
|
amigaos* | morphos*)
|
2016-09-10 21:11:40 +00:00
|
|
|
append_var LIBCURL_LIBS "-lpthread"
|
|
|
|
;;
|
2019-09-17 06:34:54 +00:00
|
|
|
# macOS does not allow static libs, overriding
|
|
|
|
darwin*)
|
|
|
|
LIBCURL_LIBS=`$_libcurlconfig --libs`
|
|
|
|
;;
|
2017-03-01 20:00:17 +00:00
|
|
|
psp2*)
|
|
|
|
append_var LIBCURL_LIBS "-lssl -lcrypto"
|
|
|
|
;;
|
2016-09-10 21:11:40 +00:00
|
|
|
esac
|
2016-09-10 21:08:09 +00:00
|
|
|
|
2016-05-11 15:40:55 +00:00
|
|
|
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
|
2016-08-30 18:59:26 +00:00
|
|
|
if test -n "$_host"; then
|
|
|
|
# In cross-compiling mode, we cannot run the result, assume SSL is available
|
2016-05-11 15:40:55 +00:00
|
|
|
_libcurl=yes
|
|
|
|
else
|
2016-08-30 18:59:26 +00:00
|
|
|
$TMPO$HOSTEXEEXT
|
|
|
|
if test "$?" -eq 0; then
|
|
|
|
_libcurl=yes
|
|
|
|
else
|
|
|
|
_libcurl="no SSL support"
|
|
|
|
fi
|
2016-05-11 15:40:55 +00:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
cc_check_clean
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test "$_libcurl" = "yes"; then
|
|
|
|
append_var LIBS "$LIBCURL_LIBS"
|
|
|
|
append_var INCLUDES "$LIBCURL_CFLAGS"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
echocheck "libcurl"
|
|
|
|
echo "$_libcurl"
|
|
|
|
|
|
|
|
define_in_config_if_yes "$_libcurl" "USE_LIBCURL"
|
|
|
|
|
2016-05-11 16:52:14 +00:00
|
|
|
#
|
|
|
|
# Check whether to build cloud integration support
|
|
|
|
#
|
2016-08-30 19:55:39 +00:00
|
|
|
echo_n "Cloud integration... "
|
2016-05-11 16:52:14 +00:00
|
|
|
if test "$_cloud" = "no"; then
|
|
|
|
echo "no"
|
|
|
|
else
|
2016-05-12 12:29:27 +00:00
|
|
|
_cloud=no
|
|
|
|
if test "$_sdlnet" = "yes"; then
|
2016-05-11 16:52:14 +00:00
|
|
|
_cloud=yes
|
2016-05-12 12:29:27 +00:00
|
|
|
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"
|
2016-05-11 16:52:14 +00:00
|
|
|
fi
|
2016-05-12 12:29:27 +00:00
|
|
|
echo # newline
|
2016-05-11 16:52:14 +00:00
|
|
|
fi
|
|
|
|
define_in_config_if_yes $_cloud 'USE_CLOUD'
|
|
|
|
|
2016-03-20 21:27:47 +00:00
|
|
|
#
|
|
|
|
# Check is NSDockTilePlugIn protocol is supported
|
|
|
|
#
|
2016-03-25 20:28:41 +00:00
|
|
|
case $_host_os in
|
|
|
|
darwin*)
|
2022-01-29 02:58:21 +00:00
|
|
|
# NSDockTilePlugIn was added in OS X 10.6, so will not be available when compiling on older macOS versions.
|
2016-03-25 20:28:41 +00:00
|
|
|
echocheck "DockTilePlugin"
|
|
|
|
if test "$_osxdockplugin" = auto ; then
|
|
|
|
_osxdockplugin=no
|
|
|
|
cat > $TMPC << EOF
|
2016-03-20 21:27:47 +00:00
|
|
|
#include <Cocoa/Cocoa.h>
|
|
|
|
@interface ScummVMDockTilePlugIn : NSObject <NSDockTilePlugIn> {
|
|
|
|
}
|
|
|
|
@end
|
|
|
|
EOF
|
2016-03-25 20:28:41 +00:00
|
|
|
cc_check -c -ObjC++ && _osxdockplugin=yes
|
|
|
|
fi
|
|
|
|
define_in_config_if_yes "$_osxdockplugin" 'USE_DOCKTILEPLUGIN'
|
|
|
|
echo "$_osxdockplugin"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
_osxdockplugin=no
|
|
|
|
;;
|
|
|
|
esac
|
2016-03-20 21:27:47 +00:00
|
|
|
|
2005-04-10 14:33:44 +00:00
|
|
|
#
|
2016-02-24 17:52:29 +00:00
|
|
|
# Check for FluidSynth
|
2005-04-10 14:33:44 +00:00
|
|
|
#
|
2016-01-12 21:41:23 +00:00
|
|
|
echocheck "FluidSynth"
|
|
|
|
|
|
|
|
append_var FLUIDSYNTH_LIBS "-lfluidsynth"
|
|
|
|
case $_host_os in
|
|
|
|
mingw*)
|
2016-03-08 08:22:07 +00:00
|
|
|
FLUIDSYNTH_STATIC_LIBS="$FLUIDSYNTH_LIBS -lglib-2.0 -lintl -liconv -lws2_32 -lole32 -lshlwapi -lpcre -ldsound -lwinmm"
|
2016-01-12 21:41:23 +00:00
|
|
|
;;
|
|
|
|
|
|
|
|
darwin*)
|
2021-10-04 18:24:59 +00:00
|
|
|
FLUIDSYNTH_STATIC_LIBS="$FLUIDSYNTH_LIBS -framework Foundation -framework CoreServices -framework CoreMIDI -framework CoreAudio -framework AudioToolbox -lglib-2.0 -lintl -liconv -lreadline"
|
2016-01-12 21:41:23 +00:00
|
|
|
;;
|
|
|
|
|
|
|
|
iphone)
|
|
|
|
FLUIDSYNTH_STATIC_LIBS="$FLUIDSYNTH_LIBS -framework Foundation -framework CoreMIDI -lglib-2.0 -lintl -liconv"
|
|
|
|
;;
|
|
|
|
|
2020-03-07 03:59:10 +00:00
|
|
|
switch)
|
|
|
|
FLUIDSYNTH_STATIC_LIBS="$FLUIDSYNTH_LIBS -lnx"
|
|
|
|
;;
|
|
|
|
|
2020-11-06 17:37:05 +00:00
|
|
|
psp2)
|
|
|
|
FLUIDSYNTH_STATIC_LIBS="$FLUIDSYNTH_LIBS -lpthread"
|
|
|
|
;;
|
|
|
|
|
2016-01-12 21:41:23 +00:00
|
|
|
*)
|
|
|
|
FLUIDSYNTH_STATIC_LIBS="$FLUIDSYNTH_LIBS -lglib-2.0 -lintl -liconv"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
if test "$_fluidsynth" = auto; then
|
2005-04-10 14:33:44 +00:00
|
|
|
_fluidsynth=no
|
|
|
|
cat > $TMPC << EOF
|
|
|
|
#include <fluidsynth.h>
|
2016-01-12 21:41:23 +00:00
|
|
|
int main(void) { delete_fluid_settings(new_fluid_settings()); return 0; }
|
2005-04-10 14:33:44 +00:00
|
|
|
EOF
|
2016-01-12 21:41:23 +00:00
|
|
|
cc_check_no_clean $FLUIDSYNTH_CFLAGS $FLUIDSYNTH_LIBS && _fluidsynth=yes
|
2020-08-01 19:29:08 +00:00
|
|
|
if test "$_fluidsynth" != yes && test "$_pkg_config" = "yes" && $_pkgconfig --exists fluidsynth; then
|
|
|
|
FLUIDSYNTH_LIBS="`$_pkgconfig --static --libs fluidsynth`"
|
|
|
|
cc_check_no_clean $FLUIDSYNTH_CFLAGS $FLUIDSYNTH_LIBS && _fluidsynth=yes
|
|
|
|
fi
|
2016-01-12 21:41:23 +00:00
|
|
|
if test "$_fluidsynth" != yes; then
|
|
|
|
FLUIDSYNTH_LIBS="$FLUIDSYNTH_STATIC_LIBS"
|
|
|
|
cc_check_no_clean $FLUIDSYNTH_CFLAGS $FLUIDSYNTH_LIBS && _fluidsynth=yes
|
|
|
|
fi
|
2016-01-13 00:23:27 +00:00
|
|
|
cc_check_clean
|
2005-04-10 14:33:44 +00:00
|
|
|
fi
|
2016-01-12 21:41:23 +00:00
|
|
|
if test "$_fluidsynth" = yes; then
|
|
|
|
append_var LIBS "$FLUIDSYNTH_LIBS"
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var INCLUDES "$FLUIDSYNTH_CFLAGS"
|
2005-04-10 14:33:44 +00:00
|
|
|
fi
|
2012-08-20 00:40:03 +00:00
|
|
|
define_in_config_if_yes "$_fluidsynth" 'USE_FLUIDSYNTH'
|
2005-04-10 14:33:44 +00:00
|
|
|
echo "$_fluidsynth"
|
|
|
|
|
2021-02-14 23:29:02 +00:00
|
|
|
#
|
|
|
|
# Check for FluidLite
|
|
|
|
#
|
|
|
|
echocheck "FluidLite"
|
|
|
|
|
|
|
|
append_var FLUIDLITE_LIBS "-lfluidlite"
|
|
|
|
if test "$_fluidlite" = auto; then
|
|
|
|
_fluidlite=no
|
|
|
|
cat > $TMPC << EOF
|
|
|
|
#include <fluidlite.h>
|
|
|
|
int main(void) { delete_fluid_settings(new_fluid_settings()); return 0; }
|
|
|
|
EOF
|
|
|
|
cc_check_no_clean $FLUIDLITE_CFLAGS $FLUIDLITE_LIBS && _fluidlite=yes
|
|
|
|
if test "$_fluidlite" != yes && test "$_pkg_config" = "yes" && $_pkgconfig --exists fluidlite; then
|
|
|
|
FLUIDLITE_LIBS="`$_pkgconfig --static --libs fluidlite`"
|
|
|
|
cc_check_no_clean $FLUIDLITE_CFLAGS $FLUIDLITE_LIBS && _fluidlite=yes
|
|
|
|
fi
|
|
|
|
cc_check_clean
|
|
|
|
fi
|
|
|
|
if test "$_fluidlite" = yes && test "$_fluidsynth" = no; then
|
|
|
|
define_in_config_if_yes "$_fluidlite" 'USE_FLUIDLITE'
|
|
|
|
define_in_config_if_yes "$_fluidlite" 'USE_FLUIDSYNTH'
|
|
|
|
append_var LIBS "$FLUIDLITE_LIBS"
|
|
|
|
append_var INCLUDES "$FLUIDLITE_CFLAGS"
|
|
|
|
else
|
|
|
|
if test "$_fluidsynth" = yes; then
|
|
|
|
_fluidlite="no (FluidSynth/FluidLite support is mutually exclusive)"
|
|
|
|
fi
|
|
|
|
add_line_to_config_h '#undef USE_FLUIDLITE'
|
|
|
|
fi
|
|
|
|
echo "$_fluidlite"
|
|
|
|
|
2009-07-25 23:36:24 +00:00
|
|
|
#
|
|
|
|
# Check for readline if text_console is enabled
|
|
|
|
#
|
|
|
|
echocheck "readline"
|
|
|
|
if test "$_text_console" = yes ; then
|
2009-09-30 11:21:09 +00:00
|
|
|
_READLINE_LIBS="-lreadline"
|
2009-07-25 23:36:24 +00:00
|
|
|
if test "$_readline" = auto ; then
|
|
|
|
_readline=no
|
|
|
|
cat > $TMPC << EOF
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <readline/readline.h>
|
|
|
|
#include <readline/history.h>
|
|
|
|
|
|
|
|
int main(void) {
|
2021-08-06 22:14:53 +00:00
|
|
|
rl_hook_func_t f; // not present in apple's libedit
|
2009-07-25 23:36:24 +00:00
|
|
|
char *x = readline("");
|
|
|
|
}
|
|
|
|
EOF
|
2010-07-20 10:00:18 +00:00
|
|
|
cc_check_no_clean $READLINE_CFLAGS $READLINE_LIBS $_READLINE_LIBS && _readline=yes
|
2009-09-30 11:21:09 +00:00
|
|
|
if test "$_readline" = no ; then
|
|
|
|
_READLINE_LIBS="-lreadline -ltermcap"
|
2010-07-20 10:00:18 +00:00
|
|
|
cc_check_no_clean $READLINE_CFLAGS $READLINE_LIBS $_READLINE_LIBS && _readline=yes
|
2009-09-30 11:21:09 +00:00
|
|
|
fi
|
2009-07-25 23:36:24 +00:00
|
|
|
fi
|
2010-07-20 10:00:18 +00:00
|
|
|
cc_check_clean
|
2009-07-25 23:36:24 +00:00
|
|
|
echo "$_readline"
|
|
|
|
else
|
|
|
|
_readline=no
|
|
|
|
echo "skipping (text console disabled)"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test "$_readline" = yes ; then
|
2014-01-01 23:39:47 +00:00
|
|
|
#
|
|
|
|
# Check the type of rl_completion_entry_function.
|
|
|
|
# It can be int(*)(const char *, int) or char *(*)(const char *, int).
|
|
|
|
#
|
|
|
|
cat > $TMPC << EOF
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <readline/readline.h>
|
|
|
|
#include <readline/history.h>
|
|
|
|
|
|
|
|
int readline_completionFunction(const char *, int);
|
|
|
|
|
|
|
|
int main(void) {
|
|
|
|
char *x = readline("");
|
|
|
|
rl_completion_entry_function = &readline_completionFunction;
|
|
|
|
}
|
|
|
|
EOF
|
2021-08-06 22:15:11 +00:00
|
|
|
cc_check $READLINE_CFLAGS $READLINE_LIBS $_READLINE_LIBS -c && add_line_to_config_h '#define USE_READLINE_INT_COMPLETION'
|
2014-01-01 23:39:47 +00:00
|
|
|
|
2009-07-25 23:36:24 +00:00
|
|
|
fi
|
2021-08-06 22:15:11 +00:00
|
|
|
|
|
|
|
if test "$_readline" = yes ; then
|
|
|
|
append_var LIBS "$READLINE_LIBS $_READLINE_LIBS"
|
|
|
|
append_var INCLUDES "$READLINE_CFLAGS"
|
|
|
|
fi
|
|
|
|
|
2010-07-20 08:24:48 +00:00
|
|
|
define_in_config_h_if_yes "$_readline" 'USE_READLINE'
|
2009-07-25 23:36:24 +00:00
|
|
|
|
2011-05-05 15:32:31 +00:00
|
|
|
define_in_config_h_if_yes "$_text_console" 'USE_TEXT_CONSOLE_FOR_DEBUGGER'
|
2009-07-25 23:36:24 +00:00
|
|
|
|
2011-04-01 05:30:12 +00:00
|
|
|
#
|
|
|
|
# Check for Unity if taskbar integration is enabled
|
|
|
|
#
|
2011-04-29 15:54:09 +00:00
|
|
|
echocheck "libunity"
|
2018-07-30 11:40:55 +00:00
|
|
|
if test "$_unix" = no || test "$_taskbar" = no || test "$_pkg_config" = no; then
|
2011-04-29 15:54:09 +00:00
|
|
|
_libunity=no
|
2011-04-28 22:10:26 +00:00
|
|
|
else
|
2011-04-29 15:54:09 +00:00
|
|
|
if test "$_libunity" = auto ; then
|
2011-06-16 15:57:06 +00:00
|
|
|
case $_host_os in
|
|
|
|
mingw*)
|
2021-08-01 07:10:15 +00:00
|
|
|
# unity is not supported on mingw
|
2011-06-16 15:57:06 +00:00
|
|
|
_libunity=no
|
|
|
|
;;
|
|
|
|
*)
|
2022-08-27 19:33:17 +00:00
|
|
|
# Unity has a lot of dependencies, update the libs and cflags var with them
|
2018-09-20 13:12:13 +00:00
|
|
|
LIBUNITY_LIBS="$LIBUNITY_LIBS `$_pkgconfig --libs 'unity > 3.8.1' 2>> "$TMPLOG"`"
|
|
|
|
LIBUNITY_CFLAGS="$LIBUNITY_CFLAGS `$_pkgconfig --cflags 'unity > 3.8.1' 2>> "$TMPLOG"`"
|
2011-06-16 15:57:06 +00:00
|
|
|
_libunity=no
|
|
|
|
cat > $TMPC << EOF
|
2011-04-01 05:30:12 +00:00
|
|
|
#include <unity.h>
|
2011-04-29 15:33:18 +00:00
|
|
|
int main(void) {
|
|
|
|
unity_launcher_entry_get_for_desktop_id("scummvm.desktop");
|
|
|
|
return 0;
|
|
|
|
}
|
2011-04-01 05:30:12 +00:00
|
|
|
EOF
|
2011-06-22 23:06:30 +00:00
|
|
|
cc_check $LIBUNITY_CFLAGS $LIBUNITY_LIBS && _libunity=yes
|
2011-06-16 15:57:06 +00:00
|
|
|
;;
|
|
|
|
esac
|
2011-04-01 05:30:12 +00:00
|
|
|
fi
|
2011-04-29 15:54:09 +00:00
|
|
|
if test "$_libunity" = yes ; then
|
2014-09-21 17:25:15 +00:00
|
|
|
if test "$LIBUNITY_CFLAGS" = "" || test "$LIBUNITY_LIBS" = ""; then
|
2018-09-20 13:12:13 +00:00
|
|
|
LIBUNITY_LIBS="$LIBUNITY_LIBS `$_pkgconfig --libs 'unity > 3.8.1' 2>> "$TMPLOG"`"
|
|
|
|
LIBUNITY_CFLAGS="$LIBUNITY_CFLAGS `$_pkgconfig --cflags 'unity > 3.8.1' 2>> "$TMPLOG"`"
|
2014-09-21 17:25:15 +00:00
|
|
|
fi
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var LIBS "$LIBUNITY_LIBS"
|
2019-02-23 13:32:53 +00:00
|
|
|
append_var CXXFLAGS "$LIBUNITY_CFLAGS"
|
2011-04-01 05:30:12 +00:00
|
|
|
fi
|
2014-01-21 18:01:28 +00:00
|
|
|
define_in_config_h_if_yes "$_libunity" 'USE_UNITY'
|
2011-04-28 22:10:26 +00:00
|
|
|
fi
|
2011-04-29 15:54:09 +00:00
|
|
|
echo "$_libunity"
|
2011-04-01 05:30:12 +00:00
|
|
|
|
2020-03-18 15:59:32 +00:00
|
|
|
#
|
|
|
|
# Check for GTK if system dialogs are enabled
|
|
|
|
#
|
|
|
|
echocheck "gtk"
|
|
|
|
if test "$_unix" = no || test "$_dialogs" = no || test "$_pkg_config" = no; then
|
|
|
|
_gtk=no
|
|
|
|
else
|
|
|
|
if test "$_gtk" = auto ; then
|
|
|
|
case $_host_os in
|
|
|
|
mingw*)
|
2021-08-01 07:10:15 +00:00
|
|
|
# gtk is not required on mingw
|
2020-03-18 15:59:32 +00:00
|
|
|
_gtk=no
|
|
|
|
;;
|
|
|
|
*)
|
2022-08-27 19:33:17 +00:00
|
|
|
# GTK has a lot of dependencies, update the libs and cflags var with them
|
2020-03-18 15:59:32 +00:00
|
|
|
GTK_LIBS="$GTK_LIBS `$_pkgconfig --libs gtk+-3.0 2>> "$TMPLOG"`"
|
|
|
|
GTK_CFLAGS="$GTK_CFLAGS `$_pkgconfig --cflags gtk+-3.0 2>> "$TMPLOG"`"
|
|
|
|
_gtk=no
|
|
|
|
cat > $TMPC << EOF
|
|
|
|
#include <gtk/gtk.h>
|
|
|
|
int main(void) {
|
|
|
|
gtk_init_check(NULL, NULL);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
EOF
|
|
|
|
cc_check $GTK_CFLAGS $GTK_LIBS && _gtk=yes
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
if test "$_gtk" = yes ; then
|
|
|
|
if test "$GTK_CFLAGS" = "" || test "$GTK_LIBS" = ""; then
|
|
|
|
GTK_LIBS="$GTK_LIBS `$_pkgconfig --libs gtk+-3.0 2>> "$TMPLOG"`"
|
|
|
|
GTK_CFLAGS="$GTK_CFLAGS `$_pkgconfig --cflags gtk+-3.0 2>> "$TMPLOG"`"
|
|
|
|
fi
|
|
|
|
append_var LIBS "$GTK_LIBS"
|
|
|
|
append_var CXXFLAGS "$GTK_CFLAGS"
|
|
|
|
fi
|
|
|
|
define_in_config_h_if_yes "$_gtk" 'USE_GTK'
|
|
|
|
fi
|
|
|
|
echo "$_gtk"
|
|
|
|
|
2011-07-25 20:54:32 +00:00
|
|
|
#
|
|
|
|
# Check for FreeType2 to be present
|
|
|
|
#
|
2018-05-06 18:55:29 +00:00
|
|
|
find_freetype() {
|
2021-04-06 17:46:47 +00:00
|
|
|
# Wrapper function which tries to find freetype
|
|
|
|
# either by calling freetype-config or by using
|
|
|
|
# pkg-config.
|
|
|
|
# As of freetype-2.9.1 the freetype-config file
|
|
|
|
# no longer gets installed by default.
|
2018-09-20 13:12:13 +00:00
|
|
|
if test "$_pkg_config" = "yes" && $_pkgconfig --exists freetype2; then
|
|
|
|
FREETYPE2_LIBS=`$_pkgconfig --libs freetype2`
|
|
|
|
FREETYPE2_CFLAGS=`$_pkgconfig --cflags freetype2`
|
|
|
|
FREETYPE2_STATIC_LIBS=`$_pkgconfig --static --libs freetype2`
|
2018-05-06 18:55:29 +00:00
|
|
|
_freetype_found="true"
|
2011-07-25 20:54:32 +00:00
|
|
|
else
|
2018-05-06 18:55:29 +00:00
|
|
|
# Look for the freetype-config script
|
|
|
|
find_freetypeconfig
|
|
|
|
if test -n "$_freetypeconfig"; then
|
|
|
|
# Since 2.3.12, freetype-config prepends $SYSROOT to everything.
|
|
|
|
# This means we can't pass it a --prefix that includes $SYSROOT.
|
|
|
|
freetypeprefix="$_freetypepath"
|
|
|
|
if test -n "$SYSROOT" -a "$SYSROOT" != "/"; then
|
|
|
|
teststring=VeryImplausibleSysrootX1Y2Z3
|
|
|
|
if ( env SYSROOT=/$teststring "$_freetypeconfig" --cflags | grep $teststring 2> /dev/null > /dev/null ); then
|
|
|
|
echo "Adapting FreeType prefix to SYSROOT" >> "$TMPLOG"
|
|
|
|
freetypeprefix="${freetypeprefix##$SYSROOT}"
|
|
|
|
fi
|
2017-10-28 17:20:06 +00:00
|
|
|
fi
|
2018-05-06 18:55:29 +00:00
|
|
|
FREETYPE2_LIBS=`$_freetypeconfig --prefix="$freetypeprefix" --libs`
|
|
|
|
FREETYPE2_CFLAGS=`$_freetypeconfig --prefix="$freetypeprefix" --cflags`
|
|
|
|
FREETYPE2_STATIC_LIBS=`$_freetypeconfig --prefix="$freetypeprefix" --static --libs 2>/dev/null`
|
|
|
|
_freetype_found="true"
|
2017-10-28 17:20:06 +00:00
|
|
|
fi
|
2018-05-06 18:55:29 +00:00
|
|
|
fi
|
|
|
|
}
|
2017-10-28 17:20:06 +00:00
|
|
|
|
2018-05-06 18:55:29 +00:00
|
|
|
if test "$_freetype2" != "no"; then
|
|
|
|
find_freetype
|
|
|
|
if test $_freetype_found != true; then
|
|
|
|
_freetype2=no
|
|
|
|
else
|
2011-07-25 20:54:32 +00:00
|
|
|
if test "$_freetype2" = "auto"; then
|
|
|
|
_freetype2=no
|
|
|
|
|
|
|
|
cat > $TMPC << EOF
|
|
|
|
#include <ft2build.h>
|
|
|
|
#include FT_FREETYPE_H
|
|
|
|
|
|
|
|
int main(int argc, char *argv[]) {
|
|
|
|
FT_Library library;
|
|
|
|
FT_Error error = FT_Init_FreeType(&library);
|
|
|
|
FT_Done_FreeType(library);
|
|
|
|
}
|
|
|
|
EOF
|
|
|
|
|
2016-01-10 20:56:10 +00:00
|
|
|
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.
|
2016-01-10 21:14:09 +00:00
|
|
|
if test "$_freetype2" != "yes"; then
|
2018-05-06 18:55:29 +00:00
|
|
|
FREETYPE2_LIBS="$FREETYPE2_STATIC_LIBS"
|
2016-01-10 20:56:10 +00:00
|
|
|
cc_check_no_clean $FREETYPE2_CFLAGS $FREETYPE2_LIBS && _freetype2=yes
|
|
|
|
fi
|
|
|
|
cc_check_clean
|
2011-07-25 20:54:32 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if test "$_freetype2" = "yes"; then
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var LIBS "$FREETYPE2_LIBS"
|
2019-02-23 13:32:53 +00:00
|
|
|
append_var CXXFLAGS "$FREETYPE2_CFLAGS"
|
2011-07-25 20:54:32 +00:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
echocheck "FreeType2"
|
|
|
|
echo "$_freetype2"
|
|
|
|
|
2012-03-21 05:36:40 +00:00
|
|
|
define_in_config_if_yes "$_freetype2" "USE_FREETYPE2"
|
2011-07-25 20:54:32 +00:00
|
|
|
|
2015-05-06 02:36:29 +00:00
|
|
|
|
2010-11-28 17:42:05 +00:00
|
|
|
#
|
|
|
|
# Check for OpenGL (ES)
|
|
|
|
#
|
2010-12-02 12:44:36 +00:00
|
|
|
echocheck "OpenGL"
|
2012-08-08 12:49:48 +00:00
|
|
|
|
2022-01-04 22:04:05 +00:00
|
|
|
_opengl_glad=no
|
2012-08-08 12:49:48 +00:00
|
|
|
|
2022-01-04 22:04:05 +00:00
|
|
|
if test "$_opengl_mode" != none ; then
|
2015-12-12 00:18:46 +00:00
|
|
|
case $_backend in
|
2019-09-08 18:37:48 +00:00
|
|
|
android)
|
2021-08-14 21:17:42 +00:00
|
|
|
# We require API level 16 while GLES2 APIs have been added in level 8 so we are safe for compilation
|
|
|
|
_opengl_mode=gles2
|
2022-01-04 22:18:51 +00:00
|
|
|
_opengl_glad=yes
|
2022-01-04 22:04:05 +00:00
|
|
|
;;
|
|
|
|
openpandora)
|
|
|
|
# Enable GLES only if user explicitely requested it
|
|
|
|
# Backend is SDL based so GLAD is supported
|
|
|
|
test "$_opengl_mode" != "gles" && _opengl_mode=none
|
|
|
|
test "$_opengl_mode" != "none" && _opengl_glad=yes
|
2019-09-08 18:37:48 +00:00
|
|
|
;;
|
2015-12-12 00:18:46 +00:00
|
|
|
sdl)
|
2022-01-04 22:04:05 +00:00
|
|
|
# This case is for pure SDL backend. Many platforms overload it and create a new backend
|
|
|
|
# They still make use of SDL but it's handled below in the default case
|
2015-12-12 21:08:33 +00:00
|
|
|
case $_sdlversion in
|
|
|
|
1.2.*)
|
|
|
|
# Stock SDL 1.2 only supports OpenGL contexts.
|
|
|
|
_opengl_mode=gl
|
|
|
|
;;
|
2010-12-02 12:44:36 +00:00
|
|
|
|
2022-07-02 16:02:14 +00:00
|
|
|
*)
|
2015-12-12 21:08:33 +00:00
|
|
|
# SDL2 supports both OpenGL + OpenGL ES contexts.
|
2022-01-29 02:58:21 +00:00
|
|
|
# However, macOS only allows OpenGL context creation at
|
2015-12-12 21:08:33 +00:00
|
|
|
# this time, thus we limit us to OpenGL on that platform.
|
|
|
|
case $_host_os in
|
|
|
|
darwin*)
|
|
|
|
_opengl_mode=gl
|
|
|
|
;;
|
2022-06-08 21:20:39 +00:00
|
|
|
emscripten)
|
|
|
|
_opengl_mode=gles2
|
|
|
|
_opengl_glad=no
|
|
|
|
append_var LDFLAGS "-s FULL_ES2=1 -s MAX_WEBGL_VERSION=1"
|
|
|
|
;;
|
2015-12-12 21:08:33 +00:00
|
|
|
*)
|
2022-01-04 22:04:05 +00:00
|
|
|
# As SDL2 supports everything, let the user choose if he wants to
|
|
|
|
test "$_opengl_mode" = "auto" && _opengl_mode=any
|
2015-12-12 21:08:33 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
;;
|
|
|
|
esac
|
2022-01-04 22:04:05 +00:00
|
|
|
_opengl_glad=yes
|
|
|
|
;;
|
|
|
|
switch)
|
|
|
|
_opengl_mode=gles2
|
|
|
|
_opengl_glad=yes
|
|
|
|
;;
|
2015-12-12 00:18:46 +00:00
|
|
|
*)
|
2022-01-04 22:04:05 +00:00
|
|
|
# On all other platforms, by default don't enable OpenGL
|
|
|
|
test "$_opengl_mode" = "auto" && _opengl_mode=none
|
|
|
|
# We only support OpenGL on SDL based backends and Android (already handled)
|
|
|
|
test "$_sdl" = "no" && _opengl_mode=none
|
|
|
|
# If it's a SDL based backend and OpenGL is really enabled, use GLAD
|
|
|
|
test "$_opengl_mode" != "none" && test "$_sdl" != "no" && _opengl_glad=yes
|
2015-12-12 00:18:46 +00:00
|
|
|
;;
|
|
|
|
esac
|
2010-11-28 17:42:05 +00:00
|
|
|
fi
|
2010-11-29 20:07:09 +00:00
|
|
|
|
2022-01-04 22:04:05 +00:00
|
|
|
if test "$_opengl_glad" = "no" -a "$_opengl_mode" != "none"; then
|
|
|
|
# Try different header filenames
|
|
|
|
# 1) GL/gl.h This is usually used on POSIX and Windows systems
|
2022-01-29 02:58:21 +00:00
|
|
|
# 2) OpenGL/gl.h This is used on macOS
|
2022-01-04 22:04:05 +00:00
|
|
|
# 3) GLES2/gl2.h This is used for OpenGL ES 2.x
|
2022-03-06 16:35:05 +00:00
|
|
|
# 3) GLES/gl.h This is used for OpenGL ES 1.x
|
2022-01-04 22:04:05 +00:00
|
|
|
_opengl_can_compile=no
|
2022-03-06 16:35:05 +00:00
|
|
|
for i in "GL/gl.h" "OpenGL/gl.h" "GLES2/gl2.h" "GLES/gl.h"; do
|
2022-01-04 22:04:05 +00:00
|
|
|
# Test the current header for OpenGL
|
|
|
|
if test "$_opengl_mode" = "gl" -o "$_opengl_mode" = "any" ; then
|
|
|
|
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_can_compile=yes && break
|
|
|
|
# Desktop often has multiple implementations GL/GLES/GLES2
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Test the current header for OpenGL ES2
|
|
|
|
if test "$_opengl_mode" = "gles2" -o "$_opengl_mode" = "any" ; then
|
|
|
|
cat > $TMPC << EOF
|
|
|
|
#include <$i>
|
|
|
|
int main(void) { return GL_ES_VERSION_2_0; }
|
|
|
|
EOF
|
|
|
|
cc_check $DEFINES $OPENGL_CFLAGS $OPENGL_LIBS && _opengl_can_compile=yes && _opengl_mode=gles2 && break
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Test the current header for OpenGL ES
|
|
|
|
if test "$_opengl_mode" = "gles" -o "$_opengl_mode" = "any" ; then
|
|
|
|
cat > $TMPC << EOF
|
|
|
|
#include <$i>
|
|
|
|
int main(void) { return GL_VERSION_ES_CM_1_0; }
|
|
|
|
EOF
|
|
|
|
cc_check $DEFINES $OPENGL_CFLAGS $OPENGL_LIBS && _opengl_can_compile=yes && _opengl_mode=gles && break
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
if test "$_opengl_can_compile" = yes; then
|
|
|
|
# Our simple test case
|
|
|
|
cat > $TMPC << EOF
|
|
|
|
int main(void) { return 0; }
|
|
|
|
EOF
|
|
|
|
_opengl_can_compile=no
|
|
|
|
# Try different library names
|
|
|
|
if test "$_opengl_mode" = "gles2" ; then
|
2022-06-20 15:11:10 +00:00
|
|
|
# GLESv2 This is generally used by nearly all platforms for OpenGL ES 2
|
|
|
|
for lib in "-lGLESv2"; do
|
2022-01-04 22:04:05 +00:00
|
|
|
if cc_check_no_clean $DEFINES $OPENGL_CFLAGS $OPENGL_LIBS $lib; then
|
|
|
|
append_var OPENGL_LIBS "$lib"
|
|
|
|
_opengl_can_compile=yes
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
2022-03-06 16:35:05 +00:00
|
|
|
elif test "$_opengl_mode" = "gles" ; then
|
|
|
|
OPENGL_LIBS="-lGLESv1_CM"
|
|
|
|
if cc_check_no_clean $DEFINES $OPENGL_CFLAGS $OPENGL_LIBS; then
|
|
|
|
_opengl_can_compile=yes
|
|
|
|
fi
|
2022-01-04 22:04:05 +00:00
|
|
|
else
|
|
|
|
case $_host_os in
|
|
|
|
darwin*)
|
|
|
|
OPENGL_LIBS="-framework OpenGL"
|
|
|
|
;;
|
|
|
|
mingw*)
|
|
|
|
OPENGL_LIBS="-lopengl32"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
OPENGL_LIBS="-lGL"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
if cc_check_no_clean $DEFINES $OPENGL_CFLAGS $OPENGL_LIBS; then
|
|
|
|
_opengl_can_compile=yes
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test "$_opengl_can_compile" = yes ; then
|
|
|
|
append_var INCLUDES "$OPENGL_CFLAGS"
|
|
|
|
append_var LIBS "$OPENGL_LIBS"
|
|
|
|
append_var LIBS_3D "$OPENGL_LIBS"
|
|
|
|
fi
|
|
|
|
cc_check_clean
|
|
|
|
elif test "$_opengl_glad" = "yes"; then
|
|
|
|
_opengl_can_compile=yes
|
|
|
|
fi
|
|
|
|
|
2015-12-12 21:08:33 +00:00
|
|
|
_opengl=yes
|
|
|
|
case $_opengl_mode in
|
|
|
|
none)
|
|
|
|
echo "no"
|
|
|
|
_opengl=no
|
|
|
|
;;
|
2010-11-28 17:42:05 +00:00
|
|
|
|
2015-12-12 21:08:33 +00:00
|
|
|
any)
|
|
|
|
echo "yes (runtime detection)"
|
|
|
|
add_line_to_config_h "#undef USE_GLES_MODE"
|
2011-08-26 16:04:53 +00:00
|
|
|
;;
|
2011-08-07 11:33:32 +00:00
|
|
|
|
2015-12-12 21:08:33 +00:00
|
|
|
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"
|
|
|
|
;;
|
2015-12-20 04:42:54 +00:00
|
|
|
|
|
|
|
gles2)
|
|
|
|
echo "yes (OpenGL ES 2)"
|
|
|
|
add_line_to_config_h "#define USE_GLES_MODE 2"
|
|
|
|
;;
|
2016-01-04 09:30:13 +00:00
|
|
|
|
|
|
|
*)
|
|
|
|
echo "invalid mode specification '$_opengl_mode'. Aborting."
|
|
|
|
exit 1
|
|
|
|
;;
|
2015-12-12 21:08:33 +00:00
|
|
|
esac
|
2010-11-28 17:42:05 +00:00
|
|
|
|
2020-10-14 16:37:17 +00:00
|
|
|
|
2020-10-04 08:50:32 +00:00
|
|
|
#
|
|
|
|
# Check for OpenGL (ES) for game
|
|
|
|
#
|
|
|
|
echocheck "OpenGL for game"
|
|
|
|
|
2022-01-04 22:04:05 +00:00
|
|
|
if test "$_opengl_can_compile" = "yes"; then
|
|
|
|
if test "$_opengl_mode" = "gles"; then
|
|
|
|
# GLES 1.x is not supported for 3D games
|
|
|
|
_opengl_game_classic=no
|
|
|
|
_opengl_game_shaders=no
|
|
|
|
elif test "$_opengl_mode" = "gles2"; then
|
|
|
|
# GLES2 doesn't support GL classic
|
|
|
|
_opengl_game_classic=no
|
|
|
|
if test "$_opengl_game_shaders" != "no"; then
|
|
|
|
_opengl_game_shaders=yes
|
2011-04-14 13:56:58 +00:00
|
|
|
fi
|
2022-01-04 22:04:05 +00:00
|
|
|
else
|
|
|
|
# We can compile GL desktop
|
|
|
|
if test "$_opengl_game_classic" != "no"; then
|
2021-11-17 23:56:21 +00:00
|
|
|
_opengl_game_classic=yes
|
|
|
|
fi
|
2022-01-04 22:04:05 +00:00
|
|
|
if test "$_opengl_game_shaders" != "no"; then
|
2021-06-19 12:58:31 +00:00
|
|
|
_opengl_game_shaders=yes
|
2012-12-06 21:47:48 +00:00
|
|
|
fi
|
2011-04-14 10:41:26 +00:00
|
|
|
fi
|
2022-01-04 22:04:05 +00:00
|
|
|
else
|
|
|
|
_opengl_game_classic=no
|
|
|
|
_opengl_game_shaders=no
|
2011-04-14 10:41:26 +00:00
|
|
|
fi
|
|
|
|
|
2022-01-04 22:04:05 +00:00
|
|
|
if test "$_opengl_game_shaders" = "yes" ; then
|
|
|
|
if test "$_opengl_mode" = "gles2" ; then
|
|
|
|
echo "yes (OpenGL ES2)"
|
2014-07-06 15:16:48 +00:00
|
|
|
else
|
2022-01-04 22:04:05 +00:00
|
|
|
echo "yes (shaders enabled)"
|
2014-02-16 07:03:17 +00:00
|
|
|
fi
|
2022-01-04 22:04:05 +00:00
|
|
|
elif test "$_opengl_game_classic" = "yes" ; then
|
|
|
|
echo "yes (shaders disabled)"
|
|
|
|
else
|
|
|
|
echo "no"
|
2011-04-14 10:41:26 +00:00
|
|
|
fi
|
|
|
|
|
2010-11-29 20:07:09 +00:00
|
|
|
define_in_config_if_yes "$_opengl" "USE_OPENGL"
|
2022-01-04 22:04:05 +00:00
|
|
|
define_in_config_if_yes "$_opengl_glad" "USE_GLAD"
|
2020-10-14 16:37:17 +00:00
|
|
|
define_in_config_if_yes "$_opengl_game_classic" "USE_OPENGL_GAME"
|
|
|
|
define_in_config_if_yes "$_opengl_game_shaders" "USE_OPENGL_SHADERS"
|
2010-11-28 17:42:05 +00:00
|
|
|
|
2021-05-14 21:32:47 +00:00
|
|
|
if test "$_dynamic_modules" = yes ; then
|
|
|
|
case $_host_os in
|
|
|
|
amigaos*)
|
|
|
|
# miniGL on AmigaOS is a static library so don't link with it in plugins
|
|
|
|
# instead link against it and include all symbols
|
|
|
|
append_var LIBS "-Wl,-whole-archive $LIBS_3D -Wl,-no-whole-archive"
|
|
|
|
LIBS_3D=
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
2020-10-14 15:10:45 +00:00
|
|
|
# If we have OpenGL libraries, then add them to plugins
|
|
|
|
# so they could link
|
|
|
|
if test -n "$LIBS_3D" ; then
|
|
|
|
_mak_plugins=$_mak_plugins"PLUGIN_LDFLAGS += $LIBS_3D"
|
|
|
|
fi
|
|
|
|
|
2020-10-14 16:37:17 +00:00
|
|
|
|
2015-09-27 22:02:21 +00:00
|
|
|
#
|
|
|
|
# Check for Linux CD-ROM support
|
|
|
|
#
|
2016-03-21 03:50:06 +00:00
|
|
|
case $_host_os in
|
|
|
|
*linux*)
|
|
|
|
echocheck "Linux CD-ROM"
|
|
|
|
linuxcd=no
|
|
|
|
cat > $TMPC << EOF
|
2015-09-27 22:02:21 +00:00
|
|
|
#include <linux/cdrom.h>
|
2020-06-24 20:56:07 +00:00
|
|
|
#include <sys/sysmacros.h>
|
2016-03-21 03:50:06 +00:00
|
|
|
#include <sys/types.h>
|
|
|
|
int main(void) {
|
|
|
|
int x = CDROMREADAUDIO;
|
|
|
|
dev_t dev;
|
|
|
|
return major(dev) + x;
|
|
|
|
}
|
2015-09-27 22:02:21 +00:00
|
|
|
EOF
|
2016-03-21 03:50:06 +00:00
|
|
|
cc_check && linuxcd=yes
|
|
|
|
define_in_config_if_yes "$linuxcd" 'USE_LINUXCD'
|
|
|
|
echo "$linuxcd"
|
|
|
|
;;
|
|
|
|
esac
|
2015-09-27 22:02:21 +00:00
|
|
|
|
|
|
|
|
2004-05-21 02:08:48 +00:00
|
|
|
#
|
|
|
|
# Check for nasm
|
|
|
|
#
|
2005-01-06 15:50:41 +00:00
|
|
|
if test "$_have_x86" = yes ; then
|
2009-03-19 21:42:50 +00:00
|
|
|
echocheck "nasm"
|
|
|
|
if test "$_nasm" = no ; then
|
|
|
|
echo "disabled"
|
2009-03-22 21:12:15 +00:00
|
|
|
else
|
|
|
|
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=$SEPARATOR
|
2009-03-19 21:42:50 +00:00
|
|
|
|
2009-03-22 21:12:15 +00:00
|
|
|
for path_dir in $_nasmpath; do
|
2009-03-23 17:40:46 +00:00
|
|
|
if test -x "$path_dir/nasm$NATIVEEXEEXT" ; then
|
|
|
|
NASM="$path_dir/nasm$NATIVEEXEEXT"
|
2010-05-09 13:31:34 +00:00
|
|
|
NASMFLAGS="-O1 -g"
|
2009-03-22 21:12:15 +00:00
|
|
|
echo $NASM
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
2009-03-19 21:42:50 +00:00
|
|
|
|
2010-05-09 13:31:34 +00:00
|
|
|
# fallback to the nasm compatible yasm
|
|
|
|
if test x$NASM = x -o x$NASM = x'"$NASM"'; then
|
|
|
|
for path_dir in $_nasmpath; do
|
|
|
|
if test -x "$path_dir/yasm$NATIVEEXEEXT" ; then
|
|
|
|
NASM="$path_dir/yasm$NATIVEEXEEXT"
|
|
|
|
NASMFLAGS="-a x86 -m x86"
|
|
|
|
echo $NASM
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
2009-03-22 21:12:15 +00:00
|
|
|
IFS="$ac_save_ifs"
|
2009-03-19 21:42:50 +00:00
|
|
|
|
2009-03-22 21:12:15 +00:00
|
|
|
if test x$NASM = x -o x$NASM = x'"$NASM"'; then
|
|
|
|
echo "not found"
|
|
|
|
_nasm=no
|
|
|
|
else
|
|
|
|
case $_host_os in
|
2010-10-11 23:26:26 +00:00
|
|
|
darwin*)
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var NASMFLAGS "-f macho"
|
2009-03-22 21:12:15 +00:00
|
|
|
;;
|
2009-03-30 09:10:28 +00:00
|
|
|
mingw*)
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var NASMFLAGS "-f win32"
|
2009-03-22 21:12:15 +00:00
|
|
|
;;
|
2010-10-11 23:26:26 +00:00
|
|
|
os2-emx*)
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var NASMFLAGS "-f aout"
|
2009-03-22 21:12:15 +00:00
|
|
|
;;
|
|
|
|
*)
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var NASMFLAGS "-f elf"
|
2021-12-31 19:55:45 +00:00
|
|
|
if $LD $LDFLAGS -Wl,--version 2>/dev/null | grep -q -e 'GNU gold'; then
|
2021-12-31 15:53:33 +00:00
|
|
|
# gold throws an internal error when nasm uses dwarf, force older stabs in this case
|
|
|
|
append_var NASMFLAGS "-F stabs"
|
|
|
|
fi
|
2009-03-22 21:12:15 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
_nasm=yes
|
|
|
|
fi
|
2009-03-19 21:42:50 +00:00
|
|
|
fi
|
2005-01-06 15:50:41 +00:00
|
|
|
fi
|
2004-05-21 02:08:48 +00:00
|
|
|
|
2010-07-20 08:24:48 +00:00
|
|
|
define_in_config_if_yes $_nasm 'USE_NASM'
|
2004-05-21 02:08:48 +00:00
|
|
|
|
2018-12-09 17:45:11 +00:00
|
|
|
#
|
|
|
|
# Check for pandoc
|
|
|
|
#
|
2018-12-19 14:17:14 +00:00
|
|
|
if test "$_pandoc" = yes ; then
|
2019-03-20 18:26:38 +00:00
|
|
|
echocheck "pandoc"
|
2018-12-09 17:45:11 +00:00
|
|
|
|
2021-08-27 02:14:25 +00:00
|
|
|
command -v pandoc >/dev/null 2>&1 && _pandoc=yes || _pandoc=no
|
2018-12-09 17:45:11 +00:00
|
|
|
|
2021-04-01 23:36:19 +00:00
|
|
|
echo $_pandoc
|
|
|
|
fi
|
2018-12-09 17:45:11 +00:00
|
|
|
|
2021-04-01 23:36:19 +00:00
|
|
|
define_in_config_if_yes $_pandoc 'USE_PANDOC'
|
2018-12-09 17:45:11 +00:00
|
|
|
|
2021-04-01 23:36:19 +00:00
|
|
|
#
|
|
|
|
# Check for curl
|
|
|
|
#
|
|
|
|
if test "$_curl" = yes ; then
|
|
|
|
echocheck "curl"
|
2018-12-09 17:45:11 +00:00
|
|
|
|
2021-08-27 02:14:25 +00:00
|
|
|
command -v curl >/dev/null 2>&1 && _curl=yes || _curl=no
|
2021-04-01 23:36:19 +00:00
|
|
|
|
|
|
|
echo $_curl
|
2018-12-09 17:45:11 +00:00
|
|
|
fi
|
|
|
|
|
2021-04-01 23:36:19 +00:00
|
|
|
define_in_config_if_yes $_curl 'USE_CURL'
|
2018-12-09 17:45:11 +00:00
|
|
|
|
2020-04-26 11:38:31 +00:00
|
|
|
#
|
|
|
|
# Check for FriBidi
|
|
|
|
#
|
|
|
|
echocheck "FriBidi"
|
2020-09-06 18:10:52 +00:00
|
|
|
if test "$_pkg_config" = "yes" && $_pkgconfig --exists fribidi; then
|
|
|
|
append_var FRIBIDI_LIBS "`$_pkgconfig --libs fribidi`"
|
|
|
|
append_var FRIBIDI_CFLAGS "`$_pkgconfig --cflags fribidi`"
|
|
|
|
else
|
|
|
|
append_var FRIBIDI_LIBS "-lfribidi"
|
|
|
|
fi
|
2020-04-26 11:38:31 +00:00
|
|
|
if test "$_fribidi" = auto ; then
|
|
|
|
_fribidi=no
|
|
|
|
cat > $TMPC << EOF
|
|
|
|
#include <fribidi/fribidi.h>
|
|
|
|
int main(void) { return 0; }
|
|
|
|
EOF
|
2020-09-06 18:10:52 +00:00
|
|
|
cc_check $FRIBIDI_CFLAGS $FRIBIDI_LIBS && _fribidi=yes
|
2020-04-26 11:38:31 +00:00
|
|
|
fi
|
|
|
|
if test "$_fribidi" = yes ; then
|
2021-03-08 06:50:57 +00:00
|
|
|
append_var LIBS "$FRIBIDI_LIBS"
|
2020-04-26 11:38:31 +00:00
|
|
|
append_var INCLUDES "$FRIBIDI_CFLAGS"
|
|
|
|
fi
|
|
|
|
define_in_config_if_yes "$_fribidi" 'USE_FRIBIDI'
|
|
|
|
echo "$_fribidi"
|
|
|
|
|
2020-05-17 13:45:31 +00:00
|
|
|
#
|
|
|
|
# Test C++11 Compatibility
|
|
|
|
#
|
2020-05-29 18:21:21 +00:00
|
|
|
define_in_config_if_yes "$_test_cxx11" 'ENABLE_TEST_CPP_11'
|
2020-05-27 11:14:24 +00:00
|
|
|
echo_n "Test C++11 compatibility during compilation... "
|
2020-05-29 18:21:21 +00:00
|
|
|
echo "$_test_cxx11"
|
2020-04-26 11:38:31 +00:00
|
|
|
|
2019-04-21 00:21:56 +00:00
|
|
|
# Default to plain text output for pandoc
|
|
|
|
if test -z "$_pandocformat" -o "$_pandocformat" = "default"; then
|
|
|
|
_pandocformat="plain"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test "$_pandocext" = "default"; then
|
|
|
|
if test "$_pandocformat" = plain; then
|
|
|
|
_pandocext=""
|
|
|
|
else
|
|
|
|
_pandocext=".$_pandocformat"
|
|
|
|
fi
|
|
|
|
fi
|
2019-08-19 16:15:23 +00:00
|
|
|
|
2020-05-25 08:39:49 +00:00
|
|
|
#
|
|
|
|
# Check for Discord
|
|
|
|
#
|
|
|
|
echocheck "Discord RPC"
|
|
|
|
if test "$_discord" = auto ; then
|
|
|
|
_discord=no
|
|
|
|
cat > $TMPC << EOF
|
|
|
|
#include <discord_rpc.h>
|
|
|
|
int main(void) { Discord_Shutdown(); return 0; }
|
|
|
|
EOF
|
|
|
|
cc_check $DISCORD_CFLAGS $DISCORD_LIBS -ldiscord-rpc && _discord=yes
|
|
|
|
fi
|
|
|
|
if test "$_discord" = yes ; then
|
|
|
|
append_var LIBS "$DISCORD_LIBS -ldiscord-rpc"
|
|
|
|
append_var INCLUDES "$DISCORD_CFLAGS"
|
|
|
|
fi
|
|
|
|
define_in_config_if_yes "$_discord" 'USE_DISCORD'
|
|
|
|
echo "$_discord"
|
|
|
|
|
2008-09-30 13:51:01 +00:00
|
|
|
#
|
2017-08-14 15:28:19 +00:00
|
|
|
# Enable vkeybd / event recorder
|
2008-09-30 13:51:01 +00:00
|
|
|
#
|
2011-05-30 22:35:27 +00:00
|
|
|
define_in_config_if_yes $_vkeybd 'ENABLE_VKEYBD'
|
2013-05-16 21:18:09 +00:00
|
|
|
define_in_config_if_yes $_eventrec 'ENABLE_EVENTRECORDER'
|
2008-09-30 13:51:01 +00:00
|
|
|
|
2010-06-15 10:44:51 +00:00
|
|
|
# Check whether to build translation support
|
|
|
|
#
|
|
|
|
echo_n "Building translation support... "
|
2010-07-20 08:24:48 +00:00
|
|
|
define_in_config_if_yes $_translation 'USE_TRANSLATION'
|
2010-06-15 10:44:51 +00:00
|
|
|
if test "$_translation" = no ; then
|
|
|
|
echo "no"
|
|
|
|
else
|
|
|
|
echo_n "yes ("
|
|
|
|
|
2011-06-13 02:39:38 +00:00
|
|
|
if test "$_detectlang" != yes ; then
|
|
|
|
cat > $TMPC << EOF
|
2010-06-15 10:44:51 +00:00
|
|
|
#include <locale.h>
|
|
|
|
int main(void) { setlocale(LC_ALL, ""); return 0; }
|
|
|
|
EOF
|
2011-06-13 02:39:38 +00:00
|
|
|
_detectlang=no
|
2018-10-24 04:50:15 +00:00
|
|
|
cc_check && _detectlang=yes
|
2011-06-13 02:39:38 +00:00
|
|
|
fi
|
2010-06-15 10:44:51 +00:00
|
|
|
|
2010-07-20 08:24:48 +00:00
|
|
|
define_in_config_h_if_yes $_detectlang 'USE_DETECTLANG'
|
2010-06-15 10:44:51 +00:00
|
|
|
if test "$_detectlang" = yes ; then
|
2010-07-01 16:26:00 +00:00
|
|
|
echo "with runtime language detection)"
|
2010-06-15 10:44:51 +00:00
|
|
|
else
|
|
|
|
echo "without runtime language detection)"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2011-04-29 15:54:09 +00:00
|
|
|
#
|
|
|
|
# Check whether to build taskbar integration support
|
|
|
|
#
|
|
|
|
echo_n "Building taskbar integration support... "
|
2014-01-21 18:19:27 +00:00
|
|
|
if test "$_taskbar" = "no"; then
|
|
|
|
echo "no"
|
|
|
|
else
|
2011-06-16 16:30:40 +00:00
|
|
|
case $_host_os in
|
|
|
|
mingw*)
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var LIBS "-lole32 -luuid"
|
2011-06-16 16:30:40 +00:00
|
|
|
echo "win32"
|
2014-01-21 18:19:27 +00:00
|
|
|
_taskbar=yes
|
2011-06-16 16:30:40 +00:00
|
|
|
;;
|
2014-01-26 20:40:36 +00:00
|
|
|
darwin*)
|
|
|
|
echo "osx"
|
|
|
|
_taskbar=yes
|
|
|
|
;;
|
2011-06-16 16:30:40 +00:00
|
|
|
*)
|
2011-06-22 23:06:30 +00:00
|
|
|
if test "$_libunity" = yes; then
|
2011-06-16 16:30:40 +00:00
|
|
|
echo "unity"
|
2014-01-21 18:19:27 +00:00
|
|
|
_taskbar=yes
|
2011-06-16 16:30:40 +00:00
|
|
|
else
|
2014-01-21 18:19:27 +00:00
|
|
|
echo "no"
|
|
|
|
_taskbar=no
|
2011-06-16 16:30:40 +00:00
|
|
|
fi
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
fi
|
2014-01-21 18:19:27 +00:00
|
|
|
define_in_config_if_yes $_taskbar 'USE_TASKBAR'
|
2011-04-29 15:54:09 +00:00
|
|
|
|
2018-11-19 14:57:50 +00:00
|
|
|
#
|
|
|
|
# Check whether to build system dialogs support
|
|
|
|
#
|
|
|
|
echo_n "Building system dialogs support... "
|
|
|
|
if test "$_dialogs" = "no"; then
|
|
|
|
echo "no"
|
|
|
|
else
|
|
|
|
case $_host_os in
|
2021-04-19 16:07:29 +00:00
|
|
|
amigaos* | morphos*)
|
|
|
|
echo "asl"
|
2020-11-23 13:14:03 +00:00
|
|
|
_dialogs=yes
|
|
|
|
;;
|
|
|
|
darwin*)
|
|
|
|
echo "osx"
|
2020-10-31 08:44:55 +00:00
|
|
|
_dialogs=yes
|
|
|
|
;;
|
2018-11-19 14:57:50 +00:00
|
|
|
mingw*)
|
|
|
|
append_var LIBS "-lole32 -luuid"
|
|
|
|
echo "win32"
|
|
|
|
_dialogs=yes
|
|
|
|
;;
|
|
|
|
*)
|
2020-03-18 15:59:32 +00:00
|
|
|
if test "$_gtk" = yes; then
|
|
|
|
echo "gtk"
|
|
|
|
_dialogs=yes
|
|
|
|
else
|
|
|
|
echo "no"
|
|
|
|
_dialogs=no
|
|
|
|
fi
|
2018-11-19 14:57:50 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
define_in_config_if_yes $_dialogs 'USE_SYSDIALOGS'
|
|
|
|
|
2019-07-10 08:49:29 +00:00
|
|
|
#
|
|
|
|
# Check whether to build TTS integration support
|
|
|
|
#
|
2019-07-15 16:09:35 +00:00
|
|
|
echo_n "Building text-to-speech support... "
|
2019-07-10 08:49:29 +00:00
|
|
|
if test "$_tts" = "no"; then
|
|
|
|
echo "no"
|
|
|
|
else
|
|
|
|
case $_host_os in
|
2020-09-13 10:37:11 +00:00
|
|
|
linux* | freebsd* | openbsd*)
|
2020-06-24 23:23:39 +00:00
|
|
|
echo "speech dispatcher"
|
2019-07-10 08:49:29 +00:00
|
|
|
_tts=yes
|
2019-08-15 14:12:30 +00:00
|
|
|
define_in_config_if_yes $_tts 'USE_SPEECH_DISPATCHER'
|
2019-10-16 20:41:27 +00:00
|
|
|
append_var LIBS '-lspeechd -lpthread'
|
2019-07-10 08:49:29 +00:00
|
|
|
;;
|
2019-07-16 04:09:36 +00:00
|
|
|
mingw*)
|
|
|
|
echo "win32"
|
|
|
|
_tts=yes
|
|
|
|
append_var LIBS '-lsapi -lole32'
|
|
|
|
;;
|
2019-07-28 13:56:38 +00:00
|
|
|
darwin*)
|
|
|
|
echo "osx"
|
|
|
|
_tts=yes
|
|
|
|
;;
|
2019-07-10 08:49:29 +00:00
|
|
|
*)
|
2019-07-15 16:09:35 +00:00
|
|
|
echo "no"
|
|
|
|
_tts=no
|
2019-07-10 08:49:29 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
define_in_config_if_yes $_tts 'USE_TTS'
|
|
|
|
|
2020-10-14 18:31:22 +00:00
|
|
|
#
|
|
|
|
# Check whether to build with TinyGL support
|
|
|
|
#
|
|
|
|
echo_n "Building TinyGL support... "
|
|
|
|
if test "$_16bit" = "no"; then
|
|
|
|
_tinygl=no
|
|
|
|
fi
|
|
|
|
define_in_config_if_yes $_tinygl 'USE_TINYGL'
|
|
|
|
echo "$_tinygl"
|
|
|
|
|
2011-07-13 16:08:26 +00:00
|
|
|
#
|
|
|
|
# Check whether to build Bink video support
|
|
|
|
#
|
|
|
|
echo_n "Building Bink video support... "
|
|
|
|
define_in_config_if_yes $_bink 'USE_BINK'
|
|
|
|
echo "$_bink"
|
|
|
|
|
2011-07-07 00:47:46 +00:00
|
|
|
#
|
|
|
|
# Check whether to build updates support
|
|
|
|
#
|
|
|
|
echo_n "Building updates support... "
|
|
|
|
if test "$_updates" = yes; then
|
|
|
|
if test "$_sparkle" = yes; then
|
|
|
|
echo "Sparkle"
|
|
|
|
else
|
2019-11-16 14:47:23 +00:00
|
|
|
_updates=no;
|
2011-07-07 00:47:46 +00:00
|
|
|
echo "$_updates"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
echo "$_updates"
|
|
|
|
fi
|
2019-11-16 15:37:35 +00:00
|
|
|
define_in_config_if_yes $_updates 'USE_UPDATES'
|
2011-07-07 00:47:46 +00:00
|
|
|
|
2020-09-20 21:01:12 +00:00
|
|
|
#
|
|
|
|
# Check whether to create a build with all resources files linked into the binary
|
|
|
|
#
|
|
|
|
define_in_config_if_yes "$_builtin_resources" 'BUILTIN_RESOURCES'
|
|
|
|
|
2004-04-16 08:30:57 +00:00
|
|
|
#
|
2009-03-22 11:24:23 +00:00
|
|
|
# Figure out installation directories
|
2004-04-16 08:30:57 +00:00
|
|
|
#
|
2010-05-09 20:42:18 +00:00
|
|
|
test "x$prefix" = xNONE && prefix=/usr/local
|
|
|
|
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
|
2006-08-18 21:55:11 +00:00
|
|
|
|
2013-07-09 01:00:55 +00:00
|
|
|
case $_host_os in
|
2020-08-25 19:08:52 +00:00
|
|
|
ds | mingw*)
|
2013-07-09 01:00:55 +00:00
|
|
|
# Windows stores all the external data files in executable file.
|
|
|
|
;;
|
|
|
|
*)
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var DEFINES "-DDATA_PATH=\\\"$datadir\\\""
|
2013-07-09 01:00:55 +00:00
|
|
|
;;
|
|
|
|
esac
|
2006-08-18 21:55:11 +00:00
|
|
|
|
2022-06-14 20:02:54 +00:00
|
|
|
case $_host in
|
2020-08-25 19:08:52 +00:00
|
|
|
3ds)
|
2019-12-01 16:19:50 +00:00
|
|
|
append_var DEFINES "-DPLUGIN_DIRECTORY=\\\"$datadir/plugins\\\""
|
|
|
|
;;
|
2020-08-25 19:08:52 +00:00
|
|
|
ds)
|
|
|
|
;;
|
2010-10-20 13:03:19 +00:00
|
|
|
openpandora)
|
|
|
|
# Add ../plugins as a path so plugins can be found when running from a .PND.
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var DEFINES "-DPLUGIN_DIRECTORY=\\\"../plugins\\\""
|
2010-10-20 13:03:19 +00:00
|
|
|
;;
|
2020-08-01 12:56:16 +00:00
|
|
|
maemo)
|
|
|
|
# The Maemo apps want the plugins in the "lib" directory
|
2011-05-07 15:57:50 +00:00
|
|
|
# without a scummvm sub directory.
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var DEFINES "-DPLUGIN_DIRECTORY=\\\"$libdir\\\""
|
2011-05-01 21:41:34 +00:00
|
|
|
;;
|
2022-06-14 20:05:03 +00:00
|
|
|
arm-*riscos)
|
|
|
|
append_var DEFINES "-DPLUGIN_DIRECTORY=\\\"\${datarootdir}/plugins\\\""
|
|
|
|
;;
|
2010-10-20 13:03:19 +00:00
|
|
|
*)
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var DEFINES "-DPLUGIN_DIRECTORY=\\\"$libdir/scummvm\\\""
|
2010-10-20 13:03:19 +00:00
|
|
|
;;
|
|
|
|
esac
|
2004-04-16 08:30:57 +00:00
|
|
|
|
2010-04-26 12:11:19 +00:00
|
|
|
#
|
|
|
|
# Set variables for profiling.
|
|
|
|
# We need to do it here to prevent mess-ups with the tests e.g. on the PSP
|
|
|
|
#
|
|
|
|
if test "$_enable_prof" = yes ; then
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var CXXFLAGS "-pg"
|
|
|
|
append_var LDFLAGS "-pg"
|
|
|
|
append_var DEFINES "-DENABLE_PROFILING"
|
2010-04-26 12:11:19 +00:00
|
|
|
fi
|
|
|
|
|
2020-01-20 17:37:23 +00:00
|
|
|
echo_n "Enabling Address Sanitizer... "
|
|
|
|
|
|
|
|
if test "$_enable_asan" = yes ; then
|
2020-08-19 10:08:53 +00:00
|
|
|
if test "$_enable_tsan" = yes ; then
|
|
|
|
echo_n "conflicting with tsan, disabling... "
|
|
|
|
_enable_asan=no
|
|
|
|
else
|
|
|
|
append_var CXXFLAGS "-fsanitize=address -fno-omit-frame-pointer"
|
|
|
|
append_var LDFLAGS "-fsanitize=address -fno-omit-frame-pointer"
|
2022-05-22 22:54:32 +00:00
|
|
|
append_var PLUGIN_LDFLAGS "-fsanitize=address -fno-omit-frame-pointer"
|
2020-08-19 10:08:53 +00:00
|
|
|
fi
|
2020-01-20 17:37:23 +00:00
|
|
|
fi
|
|
|
|
echo "$_enable_asan"
|
|
|
|
|
2020-08-19 10:08:53 +00:00
|
|
|
echo_n "Enabling Thread Sanitizer... "
|
|
|
|
|
|
|
|
if test "$_enable_tsan" = yes ; then
|
2020-08-19 10:34:25 +00:00
|
|
|
append_var CXXFLAGS "-fsanitize=thread"
|
|
|
|
append_var LDFLAGS "-fsanitize=thread"
|
2022-05-22 22:54:32 +00:00
|
|
|
append_var PLUGIN_LDFLAGS "-fsanitize=thread"
|
2020-08-19 10:08:53 +00:00
|
|
|
fi
|
|
|
|
echo "$_enable_tsan"
|
|
|
|
|
2022-01-03 11:46:13 +00:00
|
|
|
echo_n "Enabling Undefined Behavior Sanitizer... "
|
|
|
|
|
|
|
|
if test "$_enable_ubsan" = yes ; then
|
|
|
|
append_var CXXFLAGS "-fsanitize=undefined"
|
|
|
|
append_var LDFLAGS "-fsanitize=undefined"
|
2022-05-22 22:54:32 +00:00
|
|
|
append_var PLUGIN_LDFLAGS "-fsanitize=undefined"
|
2022-01-03 11:46:13 +00:00
|
|
|
fi
|
|
|
|
echo "$_enable_ubsan"
|
|
|
|
|
2009-01-21 16:15:07 +00:00
|
|
|
echo_n "Backend... "
|
|
|
|
echo_n "$_backend"
|
|
|
|
|
2020-08-03 00:04:23 +00:00
|
|
|
if test "$_sdl" = yes -a -n "$_sdlversion"; then
|
2020-09-08 22:10:46 +00:00
|
|
|
if test "$_backend" = sdl; then
|
|
|
|
echo_n " ($_sdlversion)"
|
|
|
|
else
|
|
|
|
echo_n " (SDL $_sdlversion)"
|
|
|
|
fi
|
2011-06-22 18:01:53 +00:00
|
|
|
fi
|
|
|
|
|
2009-01-21 16:15:07 +00:00
|
|
|
if test "$_nasm" = yes ; then
|
|
|
|
echo_n ", assembly routines"
|
|
|
|
fi
|
|
|
|
|
2009-08-21 09:43:30 +00:00
|
|
|
if test "$_16bit" = yes ; then
|
|
|
|
echo_n ", 16bit color"
|
|
|
|
fi
|
|
|
|
|
2016-03-05 13:25:56 +00:00
|
|
|
if test "$_highres" = yes ; then
|
2016-03-06 20:17:23 +00:00
|
|
|
echo_n ", high resolution"
|
2016-03-05 13:25:56 +00:00
|
|
|
fi
|
|
|
|
|
2020-10-14 18:31:22 +00:00
|
|
|
if test "$_tinygl" = yes ; then
|
|
|
|
echo_n ", TinyGL"
|
|
|
|
fi
|
|
|
|
|
2011-09-22 18:32:48 +00:00
|
|
|
if test "$_savegame_timestamp" = yes ; then
|
|
|
|
echo_n ", savegame timestamp"
|
|
|
|
fi
|
|
|
|
|
2010-05-09 11:00:17 +00:00
|
|
|
if test "$_build_scalers" = yes ; then
|
2010-05-10 17:25:12 +00:00
|
|
|
if test "$_build_hq_scalers" = yes ; then
|
2012-08-14 06:43:01 +00:00
|
|
|
if test "$_build_edge_scalers" = yes ; then
|
|
|
|
echo_n ", HQ and Edge scalers"
|
|
|
|
else
|
|
|
|
echo_n ", HQ scalers"
|
|
|
|
fi
|
2010-05-10 17:25:12 +00:00
|
|
|
else
|
|
|
|
echo_n ", scalers"
|
|
|
|
fi
|
2009-01-21 16:15:07 +00:00
|
|
|
fi
|
|
|
|
|
2012-08-25 16:16:46 +00:00
|
|
|
if test "$_build_aspect" = yes; then
|
|
|
|
echo_n ", aspect ratio correction"
|
|
|
|
fi
|
|
|
|
|
2009-01-21 16:15:07 +00:00
|
|
|
if test "$_mt32emu" = yes ; then
|
2016-03-06 20:17:23 +00:00
|
|
|
echo_n ", MT-32 emulator"
|
2009-01-21 16:15:07 +00:00
|
|
|
fi
|
|
|
|
|
2019-03-08 21:11:35 +00:00
|
|
|
if test "$_lua" = yes ; then
|
|
|
|
echo_n ", Lua"
|
|
|
|
fi
|
|
|
|
|
2018-04-07 07:52:44 +00:00
|
|
|
if test "$_nuked_opl" = yes ; then
|
|
|
|
echo_n ", Nuked OPL emulator"
|
|
|
|
fi
|
|
|
|
|
2009-07-25 23:36:24 +00:00
|
|
|
if test "$_text_console" = yes ; then
|
|
|
|
echo_n ", text console"
|
2021-06-30 19:54:51 +00:00
|
|
|
if test "$_windows_console" = no ; then
|
|
|
|
case "$_host_os" in
|
|
|
|
mingw*)
|
|
|
|
_windows_console=yes
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test "$_windows_console" = yes ; then
|
|
|
|
case "$_host_os" in
|
|
|
|
mingw*)
|
|
|
|
echo_n ", Windows console"
|
|
|
|
;;
|
|
|
|
esac
|
2009-07-25 23:36:24 +00:00
|
|
|
fi
|
|
|
|
|
2009-01-21 16:15:07 +00:00
|
|
|
if test "$_vkeybd" = yes ; then
|
|
|
|
echo_n ", virtual keyboard"
|
|
|
|
fi
|
|
|
|
|
2013-05-16 21:18:09 +00:00
|
|
|
if test "$_eventrec" = yes ; then
|
2016-05-27 15:58:36 +00:00
|
|
|
echo_n ", event recorder"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test "$_cloud" = yes ; then
|
|
|
|
echo ", cloud"
|
2009-01-21 16:15:07 +00:00
|
|
|
else
|
|
|
|
echo
|
|
|
|
fi
|
|
|
|
|
2011-05-05 12:21:17 +00:00
|
|
|
#
|
2020-09-08 22:10:06 +00:00
|
|
|
# Some last-minute platform specific stuff, executed
|
2011-05-05 12:21:17 +00:00
|
|
|
# after all of CXXFLAGS, LDFLAGS, LIBS etc. have been setup
|
|
|
|
#
|
2020-09-08 22:10:06 +00:00
|
|
|
case $_host_os in
|
2016-04-14 04:39:27 +00:00
|
|
|
3ds)
|
|
|
|
if test "$_freetype2" = yes -a "$_png" = yes; then
|
2018-11-20 17:54:37 +00:00
|
|
|
append_var LIBS "-lbz2"
|
2016-04-14 04:39:27 +00:00
|
|
|
append_var LIBS "-lpng"
|
|
|
|
fi
|
|
|
|
if test "$_tremor" = yes -o "$_flac" = yes; then
|
|
|
|
append_var LIBS "-logg"
|
|
|
|
fi
|
2019-11-30 14:29:44 +00:00
|
|
|
|
|
|
|
# Moved -Wl,--gc-sections here to avoid it interfering with the library checks
|
|
|
|
if test "$_dynamic_modules" = no ; then
|
|
|
|
append_var LDFLAGS "-Wl,--gc-sections"
|
|
|
|
else
|
|
|
|
append_var LDFLAGS "-Wl,--no-gc-sections"
|
|
|
|
fi
|
2022-09-10 16:26:31 +00:00
|
|
|
;;
|
|
|
|
amigaos*)
|
|
|
|
# In release mode use LTO to improve performance
|
|
|
|
# and dead code elimination to reduce binary size
|
|
|
|
if test "$_release_build" = yes; then
|
|
|
|
append_var CXXFLAGS "-flto"
|
|
|
|
append_var CXXFLAGS "-ffunction-sections -fdata-sections"
|
|
|
|
append_var PLUGIN_LDFLAGS "-flto=jobserver"
|
|
|
|
fi
|
2016-04-14 04:39:27 +00:00
|
|
|
;;
|
2011-05-05 12:21:17 +00:00
|
|
|
android)
|
2021-09-06 12:19:40 +00:00
|
|
|
# Force treating unqualified char variables as signed by default.
|
|
|
|
# NDK compiler for ARM will treat them as unsigned otherwise, which creates bugs in the code.
|
|
|
|
# We apply this to all Android architectures (arm, arm64, and x86, x86-64)
|
|
|
|
# albeit only the ARM architectures really required it (the others are not affected by this addition).
|
|
|
|
echo "(Android) Treating char as signed char by default"
|
|
|
|
append_var CXXFLAGS "-fsigned-char"
|
2011-06-15 17:09:50 +00:00
|
|
|
# ssp at this point so the cxxtests link
|
|
|
|
if test "$_debug_build" = yes; then
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var CXXFLAGS "-fstack-protector"
|
2011-06-15 17:09:50 +00:00
|
|
|
else
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var CXXFLAGS "-fno-stack-protector"
|
2011-06-15 17:09:50 +00:00
|
|
|
fi
|
|
|
|
|
2011-05-05 12:21:17 +00:00
|
|
|
static_libs=''
|
|
|
|
system_libs=''
|
|
|
|
for lib in $LIBS; do
|
|
|
|
case $lib in
|
2022-01-04 22:18:51 +00:00
|
|
|
-lz|-lm|-ldl)
|
2011-05-05 12:21:17 +00:00
|
|
|
system_libs="$system_libs $lib"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
static_libs="$static_libs $lib"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
# -lgcc is carefully placed here - we want to catch
|
|
|
|
# all toolchain symbols in *our* libraries rather
|
2022-08-27 19:33:17 +00:00
|
|
|
# than pick up anything unhygienic from the Android libs.
|
2022-01-04 22:18:51 +00:00
|
|
|
LIBS="-Wl,-Bstatic $static_libs -Wl,-Bdynamic -lgcc $system_libs -llog -landroid -ljnigraphics -lEGL"
|
2011-05-05 12:21:17 +00:00
|
|
|
;;
|
2020-07-23 10:27:34 +00:00
|
|
|
ds)
|
|
|
|
# Moved -Wl,--gc-sections here to avoid it interfering with the library checks
|
|
|
|
if test "$_dynamic_modules" = no ; then
|
|
|
|
append_var LDFLAGS "-Wl,--gc-sections"
|
|
|
|
else
|
|
|
|
append_var LDFLAGS "-Wl,--no-gc-sections"
|
2022-08-27 19:33:17 +00:00
|
|
|
# TODO: automate this required 2 step linking phase
|
2020-07-23 10:27:34 +00:00
|
|
|
# append_var LDFLAGS "-Wl,--retain-symbols-file,ds.syms"
|
|
|
|
fi
|
|
|
|
;;
|
2022-06-08 21:20:39 +00:00
|
|
|
emscripten)
|
|
|
|
append_var LDFLAGS "--pre-js ./dists/emscripten/custom_shell-pre.js --post-js ./dists/emscripten/custom_shell-post.js --shell-file ./dists/emscripten/custom_shell.html"
|
|
|
|
# we remove some linker flags for libs which will be added by emscripten from emscripten-ports to avoid duplicate symbols
|
|
|
|
if test "${LDFLAGS#*-s USE_LIBJPEG=1}" != "$LDFLAGS"; then
|
|
|
|
LIBS=`echo ${LIBS} | sed 's/-ljpeg//g'`
|
|
|
|
fi
|
|
|
|
if test "${LDFLAGS#*-s USE_LIBPNG=1}" != "$LDFLAGS"; then
|
|
|
|
LIBS=`echo ${LIBS} | sed 's/-lpng -lz//g'`
|
|
|
|
fi
|
|
|
|
if test "${LDFLAGS#*-s USE_OGG=1}" != "$LDFLAGS"; then
|
|
|
|
LIBS=`echo ${LIBS} | sed 's/-logg//g'`
|
|
|
|
fi
|
|
|
|
if test "${LDFLAGS#*-s USE_ZLIB=1}" != "$LDFLAGS"; then
|
|
|
|
LIBS=`echo ${LIBS} | sed 's/-lz//g'`
|
|
|
|
fi
|
|
|
|
;;
|
2021-05-07 05:21:14 +00:00
|
|
|
mingw*)
|
|
|
|
if test "$_windows_unicode" = yes; then
|
|
|
|
append_var DEFINES "-DUNICODE -D_UNICODE"
|
|
|
|
fi
|
2021-06-30 19:54:51 +00:00
|
|
|
# SDL2 sets -mwindows flag by default in sdl2.pc
|
|
|
|
# We need to directly replace this in the SDL pkg-config
|
|
|
|
if test "$_windows_console" = yes; then
|
|
|
|
LIBS=`echo $LIBS | sed -e 's/-mconsole//g' -e 's/-mwindows//g'`
|
|
|
|
fi
|
2021-05-07 05:21:14 +00:00
|
|
|
;;
|
2020-09-08 22:10:06 +00:00
|
|
|
riscos)
|
2022-06-14 20:05:03 +00:00
|
|
|
if test "$_dynamic_modules" = no ; then
|
|
|
|
append_var LDFLAGS "-Wl,--gc-sections"
|
2022-06-18 23:36:25 +00:00
|
|
|
append_var CXXFLAGS "-ffunction-sections"
|
|
|
|
append_var CXXFLAGS "-fdata-sections"
|
2022-06-14 20:05:03 +00:00
|
|
|
else
|
|
|
|
# toolchain asks for gc-sections
|
|
|
|
append_var LDFLAGS "-Wl,--no-gc-sections"
|
2022-07-14 08:55:55 +00:00
|
|
|
append_var PLUGIN_LDFLAGS "-Wl,--no-gc-sections"
|
2022-06-14 20:05:03 +00:00
|
|
|
append_var CXXFLAGS "-mlong-calls"
|
|
|
|
fi
|
2020-09-08 22:10:06 +00:00
|
|
|
;;
|
2011-05-31 13:15:19 +00:00
|
|
|
n64)
|
2022-08-27 19:33:17 +00:00
|
|
|
# Move some libs down here, otherwise some symbols required by libvorbis aren't found
|
2011-05-31 13:15:19 +00:00
|
|
|
# during linking stage
|
2015-07-22 12:32:03 +00:00
|
|
|
append_var LIBS "-lc -lgcc -lnosys"
|
2011-05-31 13:15:19 +00:00
|
|
|
;;
|
2022-07-23 15:46:40 +00:00
|
|
|
psp2)
|
|
|
|
if test "$_dynamic_modules" = no ; then
|
|
|
|
#use link time optimization to further reduce exe size
|
|
|
|
append_var CXXFLAGS "-flto"
|
|
|
|
append_var LDFLAGS "-flto=jobserver"
|
|
|
|
#use linker dead code elimination to further reduce exe size
|
|
|
|
append_var CXXFLAGS "-ffunction-sections -fdata-sections"
|
|
|
|
append_var LDFLAGS "-Wl,--gc-sections"
|
|
|
|
fi
|
|
|
|
;;
|
2011-05-05 12:21:17 +00:00
|
|
|
esac
|
|
|
|
|
|
|
|
|
2004-02-15 01:21:02 +00:00
|
|
|
#
|
2008-05-06 03:00:26 +00:00
|
|
|
# Engine selection
|
2004-02-15 01:21:02 +00:00
|
|
|
#
|
2008-05-06 03:00:26 +00:00
|
|
|
_engines_built_static=""
|
|
|
|
_engines_built_dynamic=""
|
2007-10-31 19:38:09 +00:00
|
|
|
_engines_skipped=""
|
2007-10-29 21:40:38 +00:00
|
|
|
|
2021-03-29 15:09:42 +00:00
|
|
|
awk -f "$_srcdir/engines.awk" < /dev/null
|
2007-10-31 19:38:09 +00:00
|
|
|
|
2003-05-20 10:15:38 +00:00
|
|
|
echo "Creating config.h"
|
2021-03-23 17:17:17 +00:00
|
|
|
cat > config.h.new << EOF
|
2003-05-20 10:15:38 +00:00
|
|
|
/* This file is automatically generated by configure */
|
|
|
|
/* DO NOT EDIT MANUALLY */
|
|
|
|
|
|
|
|
#ifndef CONFIG_H
|
|
|
|
#define CONFIG_H
|
|
|
|
|
2007-06-24 20:35:02 +00:00
|
|
|
$_config_h_data
|
2021-03-29 15:09:42 +00:00
|
|
|
$(cat config.h.engines)
|
2004-01-22 04:31:31 +00:00
|
|
|
|
2003-05-20 10:15:38 +00:00
|
|
|
/* Data types */
|
2017-11-14 23:00:56 +00:00
|
|
|
#ifndef SCUMMVM_DONT_DEFINE_TYPES
|
2003-05-20 10:15:38 +00:00
|
|
|
typedef unsigned $type_1_byte byte;
|
|
|
|
typedef unsigned int uint;
|
|
|
|
typedef unsigned $type_1_byte uint8;
|
|
|
|
typedef unsigned $type_2_byte uint16;
|
|
|
|
typedef unsigned $type_4_byte uint32;
|
2017-09-24 16:18:56 +00:00
|
|
|
typedef unsigned $type_8_byte uint64;
|
2003-05-20 10:15:38 +00:00
|
|
|
typedef signed $type_1_byte int8;
|
|
|
|
typedef signed $type_2_byte int16;
|
|
|
|
typedef signed $type_4_byte int32;
|
2017-09-24 16:18:56 +00:00
|
|
|
typedef signed $type_8_byte int64;
|
2017-11-14 23:00:56 +00:00
|
|
|
#endif
|
2012-01-25 20:13:43 +00:00
|
|
|
|
2021-09-17 16:23:59 +00:00
|
|
|
typedef $signed_type_ptr intptr;
|
|
|
|
typedef $unsigned_type_ptr uintptr;
|
2003-05-20 10:15:38 +00:00
|
|
|
|
2011-12-24 10:59:42 +00:00
|
|
|
#if defined(__APPLE__) && !defined(__ppc__)
|
|
|
|
#ifndef _UINT64
|
|
|
|
#define _UINT64
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2003-05-20 10:15:38 +00:00
|
|
|
#endif /* CONFIG_H */
|
|
|
|
EOF
|
2021-03-29 15:09:42 +00:00
|
|
|
rm -f config.h.engines
|
2021-03-23 17:17:17 +00:00
|
|
|
copy_if_changed config.h.new config.h
|
|
|
|
|
2003-05-20 10:15:38 +00:00
|
|
|
|
2006-06-24 08:48:11 +00:00
|
|
|
echo "Creating config.mk"
|
2021-03-23 17:17:17 +00:00
|
|
|
cat > config.mk.new << EOF
|
2003-05-18 09:54:28 +00:00
|
|
|
# -------- Generated by configure -----------
|
|
|
|
|
2020-03-16 08:21:18 +00:00
|
|
|
SAVED_CONFIGFLAGS := $SAVED_CONFIGFLAGS
|
|
|
|
SAVED_AR := $SAVED_AR
|
|
|
|
SAVED_AS := $SAVED_AS
|
|
|
|
SAVED_ASFLAGS := $SAVED_ASFLAGS
|
|
|
|
SAVED_CPPFLAGS := $SAVED_CPPFLAGS
|
|
|
|
SAVED_CXX := $SAVED_CXX
|
|
|
|
SAVED_CXXFLAGS := $SAVED_CXXFLAGS
|
|
|
|
SAVED_DWP := $SAVED_DWP
|
|
|
|
SAVED_LD := $SAVED_LD
|
|
|
|
SAVED_LDFLAGS := $SAVED_LDFLAGS
|
|
|
|
SAVED_PKG_CONFIG_LIBDIR := $SAVED_PKG_CONFIG_LIBDIR
|
|
|
|
SAVED_RANLIB := $SAVED_RANLIB
|
|
|
|
SAVED_SDL_CONFIG := $SAVED_SDL_CONFIG
|
|
|
|
SAVED_STRIP := $SAVED_STRIP
|
|
|
|
SAVED_WINDRES := $SAVED_WINDRES
|
|
|
|
SAVED_WINDRESFLAGS := $SAVED_WINDRESFLAGS
|
|
|
|
|
2003-05-20 10:24:24 +00:00
|
|
|
CXX := $CXX
|
2005-04-14 06:59:46 +00:00
|
|
|
CXXFLAGS := $CXXFLAGS
|
2009-10-09 11:38:13 +00:00
|
|
|
LD := $LD
|
2003-12-05 23:14:01 +00:00
|
|
|
LIBS += $LIBS
|
2003-05-20 10:24:24 +00:00
|
|
|
RANLIB := $_ranlib
|
2009-03-19 20:49:22 +00:00
|
|
|
STRIP := $_strip
|
2004-07-27 12:16:03 +00:00
|
|
|
AR := $_ar
|
2009-08-22 12:35:49 +00:00
|
|
|
AS := $_as
|
2009-08-22 16:30:20 +00:00
|
|
|
ASFLAGS := $ASFLAGS
|
2017-11-01 22:15:35 +00:00
|
|
|
DWP := $_dwp
|
2007-03-18 22:56:56 +00:00
|
|
|
WINDRES := $_windres
|
2021-07-25 08:13:47 +00:00
|
|
|
LDD := $_ldd
|
2009-09-11 18:13:27 +00:00
|
|
|
WINDRESFLAGS := $WINDRESFLAGS
|
2011-07-01 02:41:52 +00:00
|
|
|
STAGINGPATH=$_stagingpath
|
2014-08-08 10:50:27 +00:00
|
|
|
AMIGAOSPATH=$_amigaospath
|
2019-05-12 09:06:37 +00:00
|
|
|
MORPHOSPATH=$_morphospath
|
2009-03-19 20:49:22 +00:00
|
|
|
STATICLIBPATH=$_staticlibpath
|
2016-03-05 23:07:21 +00:00
|
|
|
XCODETOOLSPATH=$_xcodetoolspath
|
2016-03-27 12:04:42 +00:00
|
|
|
SPARKLEPATH=$_sparklepath
|
2015-12-23 22:13:53 +00:00
|
|
|
SDLCONFIG=$_sdlconfig
|
2004-07-27 12:16:03 +00:00
|
|
|
|
2015-01-06 04:14:17 +00:00
|
|
|
ABI := $ABI
|
|
|
|
|
2003-05-26 05:18:40 +00:00
|
|
|
BACKEND := $_backend
|
2003-07-06 02:40:02 +00:00
|
|
|
MODULES += $MODULES
|
2003-09-17 21:53:13 +00:00
|
|
|
MODULE_DIRS += $MODULE_DIRS
|
2011-02-06 14:29:22 +00:00
|
|
|
EXEPRE := $HOSTEXEPRE
|
2009-03-23 17:40:46 +00:00
|
|
|
EXEEXT := $HOSTEXEEXT
|
2004-05-21 02:08:48 +00:00
|
|
|
NASM := $NASM
|
|
|
|
NASMFLAGS := $NASMFLAGS
|
2021-08-27 02:14:25 +00:00
|
|
|
PANDOC := pandoc
|
|
|
|
CURL := curl
|
2018-12-19 14:17:14 +00:00
|
|
|
PANDOCFORMAT := $_pandocformat
|
2019-04-21 00:21:56 +00:00
|
|
|
PANDOCEXT := $_pandocext
|
2021-04-01 23:36:19 +00:00
|
|
|
MANUALVERSION := $_manualversion
|
2017-08-13 10:57:32 +00:00
|
|
|
ZLIB_LIBS := $ZLIB_LIBS
|
|
|
|
ZLIB_CFLAGS := $ZLIB_CFLAGS
|
2003-08-02 09:21:34 +00:00
|
|
|
|
2010-05-09 20:42:18 +00:00
|
|
|
prefix = $prefix
|
|
|
|
exec_prefix = $exec_prefix
|
|
|
|
bindir = $bindir
|
2010-10-11 19:50:17 +00:00
|
|
|
libdir = $libdir
|
2010-05-09 20:42:18 +00:00
|
|
|
datarootdir = $datarootdir
|
|
|
|
datadir = $datadir
|
|
|
|
mandir = $mandir
|
2010-10-11 19:50:17 +00:00
|
|
|
docdir = $docdir
|
2004-04-16 08:30:57 +00:00
|
|
|
|
2006-08-04 22:46:06 +00:00
|
|
|
$_config_mk_data
|
2021-03-29 15:09:42 +00:00
|
|
|
$(cat config.mk.engines)
|
2005-05-14 22:56:41 +00:00
|
|
|
|
2003-07-06 02:40:02 +00:00
|
|
|
INCLUDES += $INCLUDES
|
|
|
|
OBJS += $OBJS
|
|
|
|
DEFINES += $DEFINES
|
2003-07-06 05:50:49 +00:00
|
|
|
LDFLAGS += $LDFLAGS
|
2007-11-06 17:23:33 +00:00
|
|
|
|
2022-06-18 15:38:12 +00:00
|
|
|
PLUGIN_LDFLAGS = $PLUGIN_LDFLAGS
|
2007-12-02 12:11:59 +00:00
|
|
|
$_mak_plugins
|
|
|
|
|
2009-09-27 14:59:40 +00:00
|
|
|
port_mk = $_port_mk
|
2003-05-18 09:54:28 +00:00
|
|
|
EOF
|
2021-03-29 15:09:42 +00:00
|
|
|
rm -f config.mk.engines
|
2021-04-23 09:34:02 +00:00
|
|
|
copy_if_changed config.mk.new config.mk config.h
|
2004-02-21 15:55:26 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Create a custom Makefile when building outside the source tree
|
|
|
|
# TODO: Add a better check than just looking for 'Makefile'
|
|
|
|
#
|
2009-12-26 17:46:22 +00:00
|
|
|
if test ! -f Makefile.common ; then
|
2004-02-21 15:55:26 +00:00
|
|
|
echo "Creating Makefile"
|
|
|
|
|
2021-03-23 17:17:17 +00:00
|
|
|
cat > Makefile.new << EOF
|
2004-02-21 15:55:26 +00:00
|
|
|
# -------- Generated by configure -----------
|
|
|
|
srcdir = $_srcdir
|
|
|
|
vpath %.h \$(srcdir)
|
2007-12-01 17:56:24 +00:00
|
|
|
vpath %.cpp \$(srcdir)
|
|
|
|
vpath %.c \$(srcdir)
|
|
|
|
vpath %.m \$(srcdir)
|
2009-12-26 13:35:57 +00:00
|
|
|
vpath %.mm \$(srcdir)
|
2007-11-30 17:59:02 +00:00
|
|
|
vpath %.asm \$(srcdir)
|
2007-12-01 17:56:24 +00:00
|
|
|
vpath %.s \$(srcdir)
|
2009-03-18 23:38:25 +00:00
|
|
|
vpath %.S \$(srcdir)
|
2019-02-21 22:52:07 +00:00
|
|
|
vpath %.rc \$(srcdir)
|
2019-05-18 13:02:25 +00:00
|
|
|
vpath %.md \$(srcdir)
|
2004-02-21 15:55:26 +00:00
|
|
|
include \$(srcdir)/Makefile
|
|
|
|
EOF
|
2021-03-23 17:17:17 +00:00
|
|
|
copy_if_changed Makefile.new Makefile
|
2004-02-21 15:55:26 +00:00
|
|
|
|
|
|
|
fi
|
2013-11-07 11:58:34 +00:00
|
|
|
|
2021-03-23 17:17:17 +00:00
|
|
|
copy_if_changed engines/engines.mk.new engines/engines.mk
|
|
|
|
copy_if_changed engines/detection_table.h.new engines/detection_table.h
|
|
|
|
copy_if_changed engines/plugins_table.h.new engines/plugins_table.h
|
|
|
|
|
|
|
|
touch configure.stamp
|