BUILD: Unify adding -DUNIX to DEFINES; complete SEQ MIDI detection

* Added a yes/no variable _unix to configure, which controls when
  -DUNIX is added to DEFINES
* Enable SEQ MIDI via _seq_midi by default on UNIX type systems,
  except for those which override that.
* Switch SEQ MIDI code to check #define USE_SEQ_MIDI
  (alternatively, we could compile it only conditionally...)

svn-id: r51055
This commit is contained in:
Max Horn 2010-07-20 08:25:13 +00:00
parent e527ad162f
commit 37aa8a7499
4 changed files with 69 additions and 34 deletions

View File

@ -28,7 +28,7 @@
* both the QuickTime support and (vkeybd http://www.alsa-project.org/~iwai/alsa.html)
*/
#if defined(UNIX) && !defined(__BEOS__) && !defined(__MAEMO__) && !defined(__MINT__) && !defined(__ANDROID__)
#if defined(USE_SEQ_MIDI)
#include "common/util.h"
#include "sound/musicplugin.h"

View File

@ -175,7 +175,7 @@ public:
#if defined(USE_ALSA)
LINK_PLUGIN(ALSA)
#endif
#if defined(UNIX) && !defined(__BEOS__) && !defined(__MAEMO__) && !defined(__MINT__) && !defined(__ANDROID__)
#if defined(USE_SEQ_MIDI)
LINK_PLUGIN(SEQ)
#endif
#if defined(__MINT__)

View File

@ -86,6 +86,10 @@ const char *gScummVMFeatures = ""
"ALSA "
#endif
#ifdef USE_ALSA
"SEQ "
#endif
#ifdef USE_RGB_COLOR
"RGB "
#endif

95
configure vendored
View File

@ -119,7 +119,7 @@ _tremor=auto
_flac=auto
_mad=auto
_alsa=auto
_seq=auto
_seq_midi=auto
_zlib=auto
_mpeg2=no
_fluidsynth=auto
@ -134,6 +134,7 @@ _build_scalers=yes
_build_hq_scalers=yes
_indeo3=auto
_enable_prof=no
_unix=no
# Default vkeybd/keymapper options
_vkeybd=no
_keymapper=no
@ -758,8 +759,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=yes ;;
--disable-seq-midi) _seq=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 ;;
@ -1349,32 +1350,35 @@ case $_host_os in
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"
LIBS="$LIBS -framework AudioUnit -framework AudioToolbox -framework Carbon -framework CoreMIDI"
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"
@ -1384,15 +1388,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
@ -1400,7 +1407,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"
@ -1408,7 +1415,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
@ -1420,7 +1428,7 @@ case $_host_os in
LIBS="$LIBS -lnds9"
;;
os2-emx*)
DEFINES="$DEFINES -DUNIX"
_unix=yes # FIXME??? Why??
;;
ps2)
# TODO ps2
@ -1431,9 +1439,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"
@ -1448,14 +1457,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
@ -1464,7 +1474,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'
@ -1473,7 +1483,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*)
@ -1508,10 +1519,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'
@ -1522,12 +1534,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'
@ -1538,22 +1552,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
@ -1566,8 +1585,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'
@ -1578,11 +1598,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'
@ -1593,6 +1615,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)
@ -1614,7 +1637,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"
@ -1661,9 +1685,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'
@ -1702,7 +1727,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'
@ -1711,6 +1737,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"
@ -1804,6 +1831,10 @@ define_in_config_h_if_yes $_have_x86 'HAVE_X86'
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
#
@ -2110,14 +2141,14 @@ echo "$_alsa"
# Check for SEQ MIDI
#
echocheck "SEQ MIDI"
if test "$_seq" = auto ; then
_seq=no
if test "$_seq_midi" = auto ; then
# TODO: Test for /dev/sequencer presence? Or maybe just for /dev ?
# Or maybe imitate the old check? Here it is:
# #if defined(UNIX) && !defined(__BEOS__) && !defined(__MAEMO__) && !defined(__MINT__) && !defined(__ANDROID__)
# 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" 'USE_SEQ_MIDI'
echo "$_seq"
define_in_config_h_if_yes "$_seq_midi" 'USE_SEQ_MIDI'
echo "$_seq_midi"
#
# Check for ZLib