From 67d6df654582a16e054f21f1eb9ced3bfd811752 Mon Sep 17 00:00:00 2001 From: Meep-Eep Date: Wed, 25 Jul 2007 19:34:31 +0000 Subject: [PATCH] Allow building without ogg vorbis. git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2818 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/ChangeLog | 1 + sc2/build.vars.in | 1 + sc2/build/unix/build.config | 12 ++++++++++-- sc2/src/sc2code/libs/sound/decoders/Makeinfo | 7 ++++++- sc2/src/sc2code/libs/sound/decoders/decoder.c | 6 +++++- 5 files changed, 23 insertions(+), 4 deletions(-) diff --git a/sc2/ChangeLog b/sc2/ChangeLog index 6001ce184..220f5ea6a 100644 --- a/sc2/ChangeLog +++ b/sc2/ChangeLog @@ -1,4 +1,5 @@ Changes towards version 0.7: +- Allow building without ogg vorbis support (bug #852) - SvdB - Reworked SuperMelee fleet loading (fixes bug #823) - SvdB - Fixed enemy ships getting recrewed between ecnounters in HyperSpace (bug #996) - Alex diff --git a/sc2/build.vars.in b/sc2/build.vars.in index c0c9d3243..07af131f8 100644 --- a/sc2/build.vars.in +++ b/sc2/build.vars.in @@ -38,6 +38,7 @@ uqm_INSTALL_SHAREDIR='@INSTALL_SHAREDIR@' # Exported variables are available from all the Makeinfo files # Non-exported files only where build.vars is explicitely included. uqm_SOUNDMODULE='@SOUNDMODULE@' +uqm_OGGVORBIS='@OGGVORBIS@' uqm_USE_INTERNAL_MIKMOD='@USE_INTERNAL_MIKMOD@' uqm_HAVE_REGEX='@HAVE_REGEX_H_FLAG@' uqm_HAVE_OPENGL='@HAVE_OPENGL@' diff --git a/sc2/build/unix/build.config b/sc2/build/unix/build.config index 92e80720a..893ef7e1e 100644 --- a/sc2/build/unix/build.config +++ b/sc2/build/unix/build.config @@ -169,7 +169,7 @@ uqm_prepare_config() } CHOICE_sound_DEFAULT=mixsdl - CHOICE_ovcodec_OPTIONS="standard tremor" + CHOICE_ovcodec_OPTIONS="standard tremor none" CHOICE_ovcodec_TITLE="Ogg Vorbis codec" CHOICE_ovcodec_OPTION_standard_TITLE="Xiph libogg + libvorbis" CHOICE_ovcodec_OPTION_standard_PRECOND="have_library vorbisfile" @@ -177,6 +177,7 @@ uqm_prepare_config() CHOICE_ovcodec_OPTION_standard_ACTION=ovcodec_standard_action ovcodec_standard_action() { use_library vorbisfile + OGGVORBIS=vorbisfile # use_library vorbis } CHOICE_ovcodec_OPTION_tremor_TITLE="Tremor (avoids floating point math)" @@ -184,9 +185,16 @@ uqm_prepare_config() CHOICE_ovcodec_OPTION_tremor_ACTION=ovcodec_tremor_action ovcodec_tremor_action() { CFLAGS="$CFLAGS -DOVCODEC_TREMOR" + OGGVORBIS=tremor use_library tremor } CHOICE_ovcodec_DEFAULT=standard + CHOICE_ovcodec_OPTION_none_TITLE="No Ogg Vorbis support" + CHOICE_ovcodec_OPTION_none_ACTION=ovcodec_none_action + ovcodec_none_action() { + CFLAGS="$CFLAGS -DOVCODEC_NONE" + OGGVORBIS=none + } CHOICE_mikmod_OPTIONS="internal external" CHOICE_mikmod_TITLE="Tracker music support" @@ -349,7 +357,7 @@ uqm_process_config() { PREPROC_C MKDEP_C COMPILE_C \ PREPROC_OBJC MKDEP_OBJC COMPILE_OBJC \ MAKE ECHON SED DEBUG JOYSTICK NETPLAY \ - SOUNDMODULE USE_INTERNAL_MIKMOD \ + OGGVORBIS SOUNDMODULE USE_INTERNAL_MIKMOD \ HAVE_OPENGL HAVE_REGEX_H_FLAG USE_ZIP_IO \ USE_PLATFORM_ACCEL USE_WINSOCK \ INSTALL_LIBDIR INSTALL_BINDIR INSTALL_SHAREDIR \ diff --git a/sc2/src/sc2code/libs/sound/decoders/Makeinfo b/sc2/src/sc2code/libs/sound/decoders/Makeinfo index 2d4dafeae..9b8f53469 100644 --- a/sc2/src/sc2code/libs/sound/decoders/Makeinfo +++ b/sc2/src/sc2code/libs/sound/decoders/Makeinfo @@ -1 +1,6 @@ -uqm_CFILES="decoder.c aiffaud.c wav.c dukaud.c modaud.c oggaud.c" +uqm_CFILES="decoder.c aiffaud.c wav.c dukaud.c modaud.c" + +if [ "$uqm_OGGVORBIS" '!=' "none" ]; then + uqm_CFILES="$uqm_CFILES oggaud.c" +fi + diff --git a/sc2/src/sc2code/libs/sound/decoders/decoder.c b/sc2/src/sc2code/libs/sound/decoders/decoder.c index d3b6c8947..fada10d5c 100644 --- a/sc2/src/sc2code/libs/sound/decoders/decoder.c +++ b/sc2/src/sc2code/libs/sound/decoders/decoder.c @@ -27,7 +27,9 @@ #include "decoder.h" #include "wav.h" #include "dukaud.h" -#include "modaud.h" +#ifndef OGGVORBIS_NONE +# include "modaud.h" +#endif /* OGGVORBIS_NONE */ #include "oggaud.h" #include "aiffaud.h" @@ -132,7 +134,9 @@ static TFB_RegSoundDecoder sd_decoders[MAX_REG_DECODERS + 1] = { {true, true, "wav", &wava_DecoderVtbl}, {true, true, "mod", &moda_DecoderVtbl}, +#ifndef OVCODEC_NONE {true, true, "ogg", &ova_DecoderVtbl}, +#endif /* OGGVORBIS_NONE */ {true, true, "duk", &duka_DecoderVtbl}, {true, true, "aif", &aifa_DecoderVtbl}, {false, false, NULL, NULL}, // null term