aboutsummaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure253
1 files changed, 125 insertions, 128 deletions
diff --git a/configure b/configure
index 52b33949f4..df2352e966 100755
--- a/configure
+++ b/configure
@@ -119,6 +119,7 @@ _tremor=auto
_flac=auto
_mad=auto
_alsa=auto
+_seq_midi=auto
_zlib=auto
_mpeg2=no
_fluidsynth=auto
@@ -134,6 +135,7 @@ _build_scalers=yes
_build_hq_scalers=yes
_indeo3=auto
_enable_prof=no
+_unix=no
# Default vkeybd/keymapper options
_vkeybd=no
_keymapper=no
@@ -268,6 +270,10 @@ add_line_to_config_h() {
'"$1"
}
+# 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.
add_to_config_h_if_yes() {
if test "$1" = yes ; then
add_line_to_config_h "$2"
@@ -288,15 +294,28 @@ add_to_config_mk_if_yes() {
fi
}
-# Conditionally add a line of data to config.mk. Takes two parameters:
-# The first one can be set to 'yes' to "comment out" the line, i.e.
-# make it ineffective, use 'no' otherwise.
-# The second param is the line to insert.
-add_to_config_mk_if_no() {
- if test "$1" = no ; then
- add_line_to_config_mk "$2"
+# 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"
else
- add_line_to_config_mk "# $2"
+ 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"
fi
}
@@ -745,6 +764,8 @@ for ac_option in $@; do
--disable-hq-scalers) _build_hq_scalers=no ;;
--enable-alsa) _alsa=yes ;;
--disable-alsa) _alsa=no ;;
+ --enable-seq-midi) _seq_midi=yes ;;
+ --disable-seq-midi) _seq_midi=no ;;
--enable-vorbis) _vorbis=yes ;;
--disable-vorbis) _vorbis=no ;;
--enable-tremor) _tremor=yes ;;
@@ -1335,41 +1356,44 @@ echo $_host_os
case $_host_os in
amigaos*)
CXXFLAGS="$CXXFLAGS -mcrt=newlib -mstrict-align -mcpu=750 -mtune=7400"
- LDFLAGS="$LDFLAGS -mcrt=newlib -use-dynld -Lsobjs:"
+ LDFLAGS="$LDFLAGS -mcrt=newlib -use-dynld -LSDK:Local/newib/lib"
# We have to use 'long' for our 4 byte typedef because AmigaOS already typedefs (u)int32
# as (unsigned) long, and consequently we'd get a compiler error otherwise.
type_4_byte='long'
;;
beos*)
- DEFINES="$DEFINES -DUNIX -DSYSTEM_NOT_SUPPORTING_D_TYPE"
+ DEFINES="$DEFINES -DSYSTEM_NOT_SUPPORTING_D_TYPE"
# Needs -lbind -lsocket for the timidity MIDI driver
LDFLAGS="-L/boot/home/config/lib"
CFLAGS="-I/boot/home/config/include"
CXXFLAGS="$CXXFLAGS -fhuge-objects"
LIBS="$LIBS -lbind -lsocket"
+ _unix=yes
+ _seq_midi=no
;;
bsd* | hpux* | netbsd* | openbsd* | sunos*)
- DEFINES="$DEFINES -DUNIX"
+ _unix=yes
;;
cygwin*)
echo ERROR: Cygwin building is not supported by ScummVM anymore. Consider using MinGW.
exit 1
;;
darwin*)
- DEFINES="$DEFINES -DUNIX -DMACOSX"
+ DEFINES="$DEFINES -DMACOSX"
CXXFLAGS="$CXXFLAGS"
LIBS="$LIBS -framework AudioUnit -framework AudioToolbox -framework Carbon -framework CoreMIDI"
OPENGL_CFLAGS="-I/System/Library/Frameworks/OpenGL.framework/Headers"
OPENGL_LIBS="-framework OpenGL"
add_line_to_config_mk 'MACOSX = 1'
+ _unix=yes
;;
dreamcast)
DEFINES="$DEFINES -D__DC__ -DNONSTANDARD_PORT"
;;
freebsd*)
- DEFINES="$DEFINES -DUNIX"
LDFLAGS="$LDFLAGS -L/usr/local/lib"
CXXFLAGS="$CXXFLAGS -I/usr/local/include"
+ _unix=yes
;;
gamecube)
CXXFLAGS="$CXXFLAGS -Os -mogc -mcpu=750 -meabi -mhard-float"
@@ -1379,15 +1403,18 @@ case $_host_os in
LDFLAGS="$LDFLAGS -mogc -mcpu=750 -L$DEVKITPRO/libogc/lib/cube -L$DEVKITPRO/cube/lib -logc"
;;
haiku*)
- DEFINES="$DEFINES -DUNIX -DSYSTEM_NOT_SUPPORTING_D_TYPE"
+ DEFINES="$DEFINES -DSYSTEM_NOT_SUPPORTING_D_TYPE"
# Needs -lnetwork for the timidity MIDI driver
LIBS="$LIBS -lnetwork"
CXXFLAGS="$CXXFLAGS -fhuge-objects"
+ _unix=yes
+ _seq_midi=no
;;
irix*)
- DEFINES="$DEFINES -DUNIX -DIRIX -DSYSTEM_NOT_SUPPORTING_D_TYPE"
+ DEFINES="$DEFINES -DIRIX -DSYSTEM_NOT_SUPPORTING_D_TYPE"
LIBS="$LIBS -lmd -lfastm -lm"
_ranlib=:
+ _unix=yes
;;
linux* | uclinux*)
# When not cross-compiling, enable large file support, but don't
@@ -1395,7 +1422,7 @@ case $_host_os in
if test -z "$_host"; then
CXXFLAGS="$CXXFLAGS $(getconf LFS_CFLAGS 2>/dev/null)"
fi
- DEFINES="$DEFINES -DUNIX"
+ _unix=yes
;;
mingw*)
DEFINES="$DEFINES -DWIN32 -D__USE_MINGW_ANSI_STDIO=0"
@@ -1403,7 +1430,8 @@ case $_host_os in
OBJS="$OBJS scummvmico.o"
;;
mint*)
- DEFINES="$DEFINES -DUNIX -DSYSTEM_NOT_SUPPORTING_D_TYPE"
+ DEFINES="$DEFINES -DSYSTEM_NOT_SUPPORTING_D_TYPE"
+ _unix=yes
;;
ds)
# TODO Nintendo DS
@@ -1415,7 +1443,7 @@ case $_host_os in
LIBS="$LIBS -lnds9"
;;
os2-emx*)
- DEFINES="$DEFINES -DUNIX"
+ _unix=yes # FIXME??? Why??
;;
ps2)
# TODO ps2
@@ -1426,9 +1454,10 @@ case $_host_os in
CXXFLAGS="$CXXFLAGS -O3 -I$PSPSDK/include -D_PSP_FW_VERSION=150"
;;
solaris*)
- DEFINES="$DEFINES -DUNIX -DSOLARIS -DSYSTEM_NOT_SUPPORTING_D_TYPE"
+ DEFINES="$DEFINES -DSOLARIS -DSYSTEM_NOT_SUPPORTING_D_TYPE"
# Needs -lbind -lsocket for the timidity MIDI driver
LIBS="$LIBS -lnsl -lsocket"
+ _unix=yes
;;
wii)
CXXFLAGS="$CXXFLAGS -Os -mrvl -mcpu=750 -meabi -mhard-float"
@@ -1443,14 +1472,15 @@ case $_host_os in
DEFINES="$DEFINES -DWIN32 -Dcdecl= -D__cdecl__="
;;
android)
- DEFINES="$DEFINES -DUNIX"
CXXFLAGS="$CXXFLAGS -Os -msoft-float -mtune=xscale -march=armv5te -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5TE__"
add_line_to_config_mk "ANDROID_SDK = $ANDROID_SDK"
+ _unix=yes
+ _seq_midi=no
;;
# given this is a shell script assume some type of unix
*)
echo "WARNING: could not establish system type, assuming unix like"
- DEFINES="$DEFINES -DUNIX"
+ _unix=yes
;;
esac
@@ -1467,7 +1497,7 @@ if test -n "$_host"; then
echo "Cross-compiling to $_host"
case "$_host" in
arm-linux|arm*-linux-gnueabi|arm-*-linux)
- DEFINES="$DEFINES -DUNIX"
+ _unix=yes
_need_memalign=yes
add_line_to_config_mk 'USE_ARM_SOUND_ASM = 1'
add_line_to_config_mk 'USE_ARM_SMUSH_ASM = 1'
@@ -1476,7 +1506,8 @@ if test -n "$_host"; then
add_line_to_config_mk 'USE_ARM_SCALER_ASM = 1'
;;
arm-riscos|linupy)
- DEFINES="$DEFINES -DUNIX -DLINUPY"
+ DEFINES="$DEFINES -DLINUPY"
+ _unix=yes
_need_memalign=yes
;;
bfin*)
@@ -1511,10 +1542,11 @@ if test -n "$_host"; then
add_line_to_config_h "/* #define DEBUG_WII_GDB */"
;;
gp2x)
- DEFINES="$DEFINES -DUNIX -DGP2X -DNDEBUG"
+ DEFINES="$DEFINES -DGP2X -DNDEBUG"
CXXFLAGS="$CXXFLAGS -march=armv4t"
ASFLAGS="$ASFLAGS -mfloat-abi=soft"
LDFLAGS="$LDFLAGS -static"
+ _unix=yes
_need_memalign=yes
add_line_to_config_mk 'USE_ARM_SOUND_ASM = 1'
add_line_to_config_mk 'USE_ARM_SMUSH_ASM = 1'
@@ -1525,12 +1557,14 @@ if test -n "$_host"; then
_build_hq_scalers="no"
_mt32emu="no"
_vkeybd="yes"
+ _seq_midi=no
_port_mk="backends/platform/gp2x/gp2x-bundle.mk"
;;
gp2xwiz)
- DEFINES="$DEFINES -DUNIX -DGP2XWIZ -DNDEBUG"
+ DEFINES="$DEFINES -DGP2XWIZ -DNDEBUG"
CXXFLAGS="$CXXFLAGS -mcpu=arm926ej-s -mtune=arm926ej-s"
ASFLAGS="$ASFLAGS -mfloat-abi=soft"
+ _unix=yes
_need_memalign=yes
add_line_to_config_mk 'USE_ARM_SOUND_ASM = 1'
add_line_to_config_mk 'USE_ARM_SMUSH_ASM = 1'
@@ -1541,22 +1575,27 @@ if test -n "$_host"; then
_build_hq_scalers="no"
_mt32emu="no"
_vkeybd="yes"
+ _seq_midi=no
_port_mk="backends/platform/gp2xwiz/gp2xwiz-bundle.mk"
;;
iphone)
- DEFINES="$DEFINES -DIPHONE -DUNIX"
+ DEFINES="$DEFINES -DIPHONE"
+ _unix=yes
_need_memalign=yes
add_line_to_config_mk 'USE_ARM_SOUND_ASM = 1'
add_line_to_config_mk 'USE_ARM_SMUSH_ASM = 1'
_backend="iphone"
_build_hq_scalers="no"
+ _seq_midi=no
;;
m68k-atari-mint)
- DEFINES="$DEFINES -DUNIX -DSYSTEM_NOT_SUPPORTING_D_TYPE"
+ DEFINES="$DEFINES -DSYSTEM_NOT_SUPPORTING_D_TYPE"
+ _unix=yes
_endian=big
_need_memalign=yes
_ranlib=m68k-atari-mint-ranlib
_ar="m68k-atari-mint-ar cru"
+ _seq_midi=no
;;
*mingw32*)
_sdlconfig=$_host-sdl-config
@@ -1569,8 +1608,9 @@ if test -n "$_host"; then
_need_memalign=yes
;;
motoezx)
- DEFINES="$DEFINES -DUNIX -DMOTOEZX"
+ DEFINES="$DEFINES -DMOTOEZX"
ASFLAGS="$ASFLAGS -mfpu=vfp"
+ _unix=yes
_need_memalign=yes
add_line_to_config_mk 'USE_ARM_SOUND_ASM = 1'
add_line_to_config_mk 'USE_ARM_SMUSH_ASM = 1'
@@ -1581,11 +1621,13 @@ if test -n "$_host"; then
_build_hq_scalers="no"
_mt32emu="no"
_vkeybd="yes"
+ _seq_midi=no
_port_mk="backends/platform/linuxmoto/linuxmoto.mk"
;;
motomagx)
- DEFINES="$DEFINES -DUNIX -DMOTOMAGX"
+ DEFINES="$DEFINES -DMOTOMAGX"
ASFLAGS="$ASFLAGS -mfpu=vfp"
+ _unix=yes
_need_memalign=yes
add_line_to_config_mk 'USE_ARM_SOUND_ASM = 1'
add_line_to_config_mk 'USE_ARM_SMUSH_ASM = 1'
@@ -1596,6 +1638,7 @@ if test -n "$_host"; then
_build_hq_scalers="no"
_mt32emu="no"
_vkeybd="yes"
+ _seq_midi=no
_port_mk="backends/platform/linuxmoto/linuxmoto.mk"
;;
ds)
@@ -1617,7 +1660,8 @@ if test -n "$_host"; then
_port_mk="backends/platform/ds/ds.mk"
;;
neuros)
- DEFINES="$DEFINES -DUNIX -DNEUROS"
+ DEFINES="$DEFINES -DNEUROS"
+ _unix=yes
_need_memalign=yes
_backend='null'
_build_hq_scalers="no"
@@ -1664,9 +1708,10 @@ if test -n "$_host"; then
_port_mk="backends/platform/psp/psp.mk"
;;
samsungtv)
- DEFINES="$DEFINES -DUNIX -DSAMSUNGTV -DDISABLE_COMMAND_LINE"
+ DEFINES="$DEFINES -DSAMSUNGTV -DDISABLE_COMMAND_LINE"
ASFLAGS="$ASFLAGS -mfpu=vfp"
HOSTEXEEXT=".so"
+ _unix=yes
_need_memalign=yes
add_line_to_config_mk 'USE_ARM_SOUND_ASM = 1'
add_line_to_config_mk 'USE_ARM_SMUSH_ASM = 1'
@@ -1705,7 +1750,8 @@ if test -n "$_host"; then
_port_mk="backends/platform/wince/wince.mk"
;;
android)
- DEFINES="$DEFINES -DANDROID -DUNIX -DUSE_ARM_SMUSH_ASM"
+ DEFINES="$DEFINES -DANDROID -DUSE_ARM_SMUSH_ASM"
+ _unix=yes
_need_memalign=yes
add_line_to_config_mk 'USE_ARM_SOUND_ASM = 1'
add_line_to_config_mk 'USE_ARM_SMUSH_ASM = 1'
@@ -1714,6 +1760,7 @@ if test -n "$_host"; then
add_line_to_config_mk 'USE_ARM_COSTUME_ASM = 1'
_backend="android"
_port_mk="backends/platform/android/android.mk"
+ _seq_midi=no
;;
*)
echo "WARNING: Unknown target, continuing with auto-detected values"
@@ -1791,21 +1838,25 @@ esac
#
case $_endian in
big)
- add_line_to_config_h '/* #define SCUMM_LITTLE_ENDIAN */'
+ 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 '/* #define SCUMM_BIG_ENDIAN */'
+ add_line_to_config_h '#undef SCUMM_BIG_ENDIAN'
;;
*)
exit 1
;;
esac
-add_to_config_h_if_yes $_have_x86 '#define HAVE_X86'
+define_in_config_h_if_yes $_have_x86 'HAVE_X86'
-add_to_config_h_if_yes $_need_memalign '#define SCUMM_NEED_ALIGNMENT'
+define_in_config_h_if_yes $_need_memalign 'SCUMM_NEED_ALIGNMENT'
+
+if test "$_unix" = yes ; then
+ DEFINES="$DEFINES -DUNIX"
+fi
#
# Check whether to enable a verbose build
@@ -1939,7 +1990,7 @@ PLUGIN_SUFFIX := .plg
PLUGIN_EXTRA_DEPS = $(EXECUTABLE)
CXXFLAGS += -DDYNAMIC_MODULES
LDFLAGS += -Wl,-T$(srcdir)/backends/platform/psp/main_prog.ld
-PLUGIN_LDFLAGS = -nostartfiles -Wl,-q,--just-symbols,$(EXECUTABLE),--retain-symbols-file,$(srcdir)/backends/platform/psp/plugin.syms,-T$(srcdir)/backends/platform/psp/plugin.ld -lstdc++ -lc -lm
+PLUGIN_LDFLAGS = -nostartfiles -Wl,-q,--just-symbols,$(EXECUTABLE),--retain-symbols-file,$(srcdir)/backends/platform/psp/plugin.syms,-T$(srcdir)/backends/platform/psp/plugin.ld -lstdc++ -lc -lm -Wl,--wrap,memcpy
PRE_OBJS_FLAGS := -Wl,--whole-archive
POST_OBJS_FLAGS := -Wl,--no-whole-archive
'
@@ -1957,40 +2008,22 @@ fi
#
# Check whether integrated MT-32 emulator support is requested
#
-if test "$_mt32emu" = no ; then
- _def_mt32emu='#undef USE_MT32EMU'
-else
- _def_mt32emu='#define USE_MT32EMU'
-fi
-add_to_config_mk_if_yes "$_mt32emu" 'USE_MT32EMU = 1'
+define_in_config_if_yes "$_mt32emu" 'USE_MT32EMU'
#
# Check whether 16bit color support is requested
#
-if test "$_16bit" = no ; then
- _def_16bit='#undef USE_RGB_COLOR'
-else
- _def_16bit='#define USE_RGB_COLOR'
-fi
-add_to_config_mk_if_yes "$_16bit" 'USE_RGB_COLOR = 1'
+define_in_config_if_yes "$_16bit" 'USE_RGB_COLOR'
#
# Check whether to enable the (hq) scalers
#
if test "$_build_scalers" = no ; then
_build_hq_scalers=no
- _def_scalers='#undef USE_SCALERS'
-else
- _def_scalers='#define USE_SCALERS'
fi
-add_to_config_mk_if_yes "$_build_scalers" 'USE_SCALERS = 1'
+define_in_config_if_yes "$_build_scalers" 'USE_SCALERS'
-if test "$_build_hq_scalers" = no ; then
- _def_hq_scalers='#undef USE_HQ_SCALERS'
-else
- _def_hq_scalers='#define USE_HQ_SCALERS'
-fi
-add_to_config_mk_if_yes "$_build_hq_scalers" 'USE_HQ_SCALERS = 1'
+define_in_config_if_yes "$_build_hq_scalers" 'USE_HQ_SCALERS'
#
# Check whether to compile the Indeo3 decoder
@@ -2003,12 +2036,7 @@ if test "$_indeo3" = auto ; then
_indeo3="no"
fi
fi
-if test "$_indeo3" = no ; then
- _def_indeo3='#undef USE_INDEO3'
-else
- _def_indeo3='#define USE_INDEO3'
-fi
-add_to_config_mk_if_yes "$_indeo3" 'USE_INDEO3 = 1'
+define_in_config_if_yes "$_indeo3" 'USE_INDEO3'
#
# Check for math lib
@@ -2032,13 +2060,10 @@ EOF
-lvorbisfile -lvorbis -logg && _vorbis=yes
fi
if test "$_vorbis" = yes ; then
- _def_vorbis='#define USE_VORBIS'
LIBS="$LIBS $OGG_LIBS $VORBIS_LIBS -lvorbisfile -lvorbis -logg"
INCLUDES="$INCLUDES $OGG_CFLAGS $VORBIS_CFLAGS"
-else
- _def_vorbis='#undef USE_VORBIS'
fi
-add_to_config_mk_if_yes "$_vorbis" 'USE_VORBIS = 1'
+define_in_config_if_yes "$_vorbis" 'USE_VORBIS'
echo "$_vorbis"
#
@@ -2055,15 +2080,15 @@ EOF
_tremor=yes
fi
if test "$_tremor" = yes && test "$_vorbis" = no; then
- _def_tremor='#define USE_TREMOR'
- _def_vorbis='#define USE_VORBIS'
+ add_line_to_config_h '#define USE_TREMOR'
+ add_line_to_config_h '#define USE_VORBIS'
LIBS="$LIBS $TREMOR_LIBS -lvorbisidec"
INCLUDES="$INCLUDES $TREMOR_CFLAGS"
else
if test "$_vorbis" = yes; then
_tremor="no (Ogg Vorbis/Tremor support is mutually exclusive)"
fi
- _def_tremor='#undef USE_TREMOR'
+ add_line_to_config_h '#undef USE_TREMOR'
fi
add_to_config_mk_if_yes "$_tremor" 'USE_TREMOR = 1'
echo "$_tremor"
@@ -2087,17 +2112,14 @@ EOF
fi
fi
if test "$_flac" = yes ; then
- _def_flac='#define USE_FLAC'
if test "$_vorbis" = yes ; then
LIBS="$LIBS $FLAC_LIBS $OGG_LIBS -lFLAC -logg"
else
LIBS="$LIBS $FLAC_LIBS -lFLAC"
fi
INCLUDES="$INCLUDES $FLAC_CFLAGS"
-else
- _def_flac='#undef USE_FLAC'
fi
-add_to_config_mk_if_yes "$_flac" 'USE_FLAC = 1'
+define_in_config_if_yes "$_flac" 'USE_FLAC'
echo "$_flac"
#
@@ -2113,13 +2135,10 @@ EOF
cc_check $MAD_CFLAGS $MAD_LIBS -lmad && _mad=yes
fi
if test "$_mad" = yes ; then
- _def_mad='#define USE_MAD'
LIBS="$LIBS $MAD_LIBS -lmad"
INCLUDES="$INCLUDES $MAD_CFLAGS"
-else
- _def_mad='#undef USE_MAD'
fi
-add_to_config_mk_if_yes "$_mad" 'USE_MAD = 1'
+define_in_config_if_yes "$_mad" 'USE_MAD'
echo "$_mad"
#
@@ -2135,15 +2154,26 @@ EOF
cc_check $ALSA_CFLAGS $ALSA_LIBS -lasound && _alsa=yes
fi
if test "$_alsa" = yes ; then
- _def_alsa='#define USE_ALSA'
LIBS="$LIBS $ALSA_LIBS -lasound"
INCLUDES="$INCLUDES $ALSA_CFLAGS"
-else
- _def_alsa='#undef USE_ALSA'
fi
+define_in_config_h_if_yes "$_alsa" 'USE_ALSA'
echo "$_alsa"
#
+# Check for SEQ MIDI
+#
+echocheck "SEQ MIDI"
+if test "$_seq_midi" = auto ; then
+ # TODO: Test for /dev/sequencer presence? Or maybe just for /dev ?
+ # For now, we just always enable it when "unix" mode is on (backends
+ # that do not want it can disable it by setting _seq_midi=no).
+ _seq_midi="$_unix"
+fi
+define_in_config_h_if_yes "$_seq_midi" 'USE_SEQ_MIDI'
+echo "$_seq_midi"
+
+#
# Check for ZLib
#
echocheck "zlib"
@@ -2157,13 +2187,10 @@ EOF
cc_check $ZLIB_CFLAGS $ZLIB_LIBS -lz && _zlib=yes
fi
if test "$_zlib" = yes ; then
- _def_zlib='#define USE_ZLIB'
LIBS="$LIBS $ZLIB_LIBS -lz"
INCLUDES="$INCLUDES $ZLIB_CFLAGS"
-else
- _def_zlib='#undef USE_ZLIB'
fi
-add_to_config_mk_if_yes "$_zlib" 'USE_ZLIB = 1'
+define_in_config_if_yes "$_zlib" 'USE_ZLIB'
echo "$_zlib"
#
@@ -2203,13 +2230,10 @@ EOF
fi
fi
if test "$_mpeg2" = yes ; then
- _def_mpeg2='#define USE_MPEG2'
INCLUDES="$INCLUDES $MPEG2_CFLAGS"
LIBS="$LIBS $MPEG2_LIBS -lmpeg2"
-else
- _def_mpeg2='#undef USE_MPEG2'
fi
-add_to_config_mk_if_yes "$_mpeg2" 'USE_MPEG2 = 1'
+define_in_config_if_yes "$_mpeg2" 'USE_MPEG2'
echo "$_mpeg2"
#
@@ -2225,7 +2249,6 @@ EOF
cc_check $FLUIDSYNTH_CFLAGS $FLUIDSYNTH_LIBS -lfluidsynth && _fluidsynth=yes
fi
if test "$_fluidsynth" = yes ; then
- _def_fluidsynth='#define USE_FLUIDSYNTH'
case $_host_os in
mingw*)
LIBS="$LIBS $FLUIDSYNTH_LIBS -lfluidsynth -ldsound -lwinmm"
@@ -2235,9 +2258,8 @@ if test "$_fluidsynth" = yes ; then
;;
esac
INCLUDES="$INCLUDES $FLUIDSYNTH_CFLAGS"
-else
- _def_fluidsynth='#undef USE_FLUIDSYNTH'
fi
+define_in_config_h_if_yes "$_fluidsynth" 'USE_FLUIDSYNTH'
echo "$_fluidsynth"
#
@@ -2257,12 +2279,13 @@ int main(void) {
char *x = readline("");
}
EOF
- cc_check $READLINE_CFLAGS $READLINE_LIBS $_READLINE_LIBS && _readline=yes
+ cc_check_no_clean $READLINE_CFLAGS $READLINE_LIBS $_READLINE_LIBS && _readline=yes
if test "$_readline" = no ; then
_READLINE_LIBS="-lreadline -ltermcap"
- cc_check $READLINE_CFLAGS $READLINE_LIBS $_READLINE_LIBS && _readline=yes
+ cc_check_no_clean $READLINE_CFLAGS $READLINE_LIBS $_READLINE_LIBS && _readline=yes
fi
fi
+ cc_check_clean
echo "$_readline"
else
_readline=no
@@ -2270,18 +2293,12 @@ else
fi
if test "$_readline" = yes ; then
- _def_readline='#define USE_READLINE'
LIBS="$LIBS $READLINE_LIBS $_READLINE_LIBS"
INCLUDES="$INCLUDES $READLINE_CFLAGS"
-else
- _def_readline='#undef USE_READLINE'
fi
+define_in_config_h_if_yes "$_readline" 'USE_READLINE'
-if test "$_text_console" = yes ; then
- _def_text_console='#define USE_TEXT_CONSOLE'
-else
- _def_text_console='#undef USE_TEXT_CONSOLE'
-fi
+define_in_config_h_if_yes "$_text_console" 'USE_TEXT_CONSOLE'
#
# Check for OpenGL (ES)
@@ -2361,8 +2378,7 @@ if test "$_have_x86" = yes ; then
fi
fi
-add_to_config_h_if_yes $_nasm '#define USE_NASM'
-add_to_config_mk_if_yes $_nasm 'USE_NASM = 1'
+define_in_config_if_yes $_nasm 'USE_NASM'
#
# Enable vkeybd / keymapper
@@ -2377,8 +2393,7 @@ fi
# Check whether to build translation support
#
echo_n "Building translation support... "
-add_to_config_mk_if_yes $_translation 'USE_TRANSLATION = 1'
-add_to_config_h_if_yes $_translation '#define USE_TRANSLATION'
+define_in_config_if_yes $_translation 'USE_TRANSLATION'
if test "$_translation" = no ; then
echo "no"
else
@@ -2391,7 +2406,7 @@ EOF
_detectlang=no
cc_check $LDFLAGS $CXXFLAGS && _detectlang=yes
- add_to_config_h_if_yes $_detectlang '#define USE_DETECTLANG'
+ define_in_config_h_if_yes $_detectlang 'USE_DETECTLANG'
if test "$_detectlang" = yes ; then
echo "with runtime language detection)"
else
@@ -2513,6 +2528,7 @@ case $_backend in
psp)
DEFINES="$DEFINES -D__PSP__ -DDISABLE_TEXT_CONSOLE -DDISABLE_COMMAND_LINE -DDISABLE_DOSBOX_OPL"
LIBS="$LIBS -lpng -Wl,-Map,mapfile.txt"
+ LDFLAGS="$LDFLAGS -Wl,--wrap,memcpy"
;;
samsungtv)
find_sdlconfig
@@ -2719,25 +2735,6 @@ typedef signed $type_1_byte int8;
typedef signed $type_2_byte int16;
typedef signed $type_4_byte int32;
-/* Libs */
-$_def_vorbis
-$_def_tremor
-$_def_flac
-$_def_mad
-$_def_alsa
-$_def_zlib
-$_def_mpeg2
-$_def_fluidsynth
-$_def_readline
-
-/* Options */
-$_def_text_console
-$_def_mt32emu
-$_def_indeo3
-$_def_16bit
-$_def_scalers
-$_def_hq_scalers
-
/* Plugin settings */
$_def_plugin