diff --git a/neo/SConstruct b/neo/SConstruct index a06a8dd1..40d2c36c 100644 --- a/neo/SConstruct +++ b/neo/SConstruct @@ -13,7 +13,7 @@ conf_filename='site.conf' # choose configuration variables which should be saved between runs # ( we handle all those as strings ) serialized=['CC', 'CXX', 'X86', 'BUILD', 'IDNET_HOST', 'DEDICATED', - 'DEBUG_MEMORY', 'LIBC_MALLOC', 'ID_NOLANADDRESS', 'ID_MCHECK', 'ALSA', + 'DEBUG_MEMORY', 'LIBC_MALLOC', 'ID_NOLANADDRESS', 'ID_MCHECK', 'OPENAL', 'ALSA', 'TARGET_CORE', 'TARGET_GAME', 'TARGET_D3XP', 'TARGET_MONO', 'TARGET_DEMO', 'NOCURL', 'BUILD_ROOT', 'BUILD_GAMEPAK', 'BASEFLAGS' ] @@ -109,6 +109,9 @@ ID_MCHECK (default 2) note that Doom has it's own block allocator/checking this should not be considered a replacement, but an additional tool +OPENAL (default 1) + enable OpenAL sound backend support + ALSA (default 1) enable ALSA sound backend support @@ -176,6 +179,7 @@ LIBC_MALLOC = '1' ID_NOLANADDRESS = '0' ID_MCHECK = '2' BUILD_ROOT = 'build' +OPENAL = '1' ALSA = '1' SETUP = '0' SDK = '0' @@ -378,7 +382,7 @@ local_idlibpic = 0 # switch between base game build and d3xp game build local_d3xp = 0 -GLOBALS = 'g_env g_env_noopt g_game_env g_os g_cpu g_build ID_MCHECK ALSA idlib_objects game_objects local_dedicated local_gamedll local_demo local_idlibpic local_curl local_d3xp OPTCPPFLAGS' +GLOBALS = 'g_env g_env_noopt g_game_env g_os g_cpu g_build ID_MCHECK OPENAL ALSA idlib_objects game_objects local_dedicated local_gamedll local_demo local_idlibpic local_curl local_d3xp OPTCPPFLAGS' # end general configuration ---------------------- diff --git a/neo/framework/BuildDefines.h b/neo/framework/BuildDefines.h index ce72b7d4..37351008 100644 --- a/neo/framework/BuildDefines.h +++ b/neo/framework/BuildDefines.h @@ -118,7 +118,7 @@ If you have questions concerning this license or the applicable additional terms #endif #ifndef ID_OPENAL -# if ( defined(_WIN32) || defined(MACOS_X) ) && !defined( ID_DEDICATED ) +# if !defined( ID_DEDICATED ) # define ID_OPENAL 1 # else # define ID_OPENAL 0 diff --git a/neo/sys/linux/sound.cpp b/neo/sys/linux/sound.cpp index 811e8678..419f9c9b 100644 --- a/neo/sys/linux/sound.cpp +++ b/neo/sys/linux/sound.cpp @@ -396,5 +396,9 @@ void idAudioHardwareOSS::Write( bool flushing ) { -=============== */ bool Sys_LoadOpenAL( void ) { +#if ID_OPENAL + return true; +#else return false; +#endif } diff --git a/neo/sys/scons/SConscript.core b/neo/sys/scons/SConscript.core index 9c64efd7..6ecad72c 100644 --- a/neo/sys/scons/SConscript.core +++ b/neo/sys/scons/SConscript.core @@ -212,7 +212,6 @@ if ( local_dedicated == 0 ): else: sys_string += ' \ stub/stub_gl.cpp \ - stub/openal_stub.cpp \ linux/dedicated.cpp' sys_list = scons_utils.BuildList( 'sys', sys_string ) @@ -233,7 +232,8 @@ local_env = g_env.Clone() if ( local_dedicated == 1 ): local_env.Append( CPPDEFINES = [ 'ID_DEDICATED' ] ) - # don't enable alsa for a dedicated server binary + # don't enable openal or alsa for a dedicated server binary + OPENAL = '0' ALSA = '0' if ( local_gamedll == 1 ): @@ -247,6 +247,10 @@ if ( local_curl == 0 ): sound_env = local_env.Clone() sound_list = [ '../linux/sound.cpp' ] +if ( OPENAL != '1' ): + sound_env.Append( CPPDEFINES = 'ID_OPENAL=0' ) + sound_list.append( '../../sys/stub/openal_stub.cpp' ) + if ( g_os == "Linux" and ALSA != '0' ): sound_list.append( '../../sys/linux/sound_alsa.cpp' ) else: @@ -266,7 +270,9 @@ if ( local_curl == 1 ): if ( local_dedicated == 0 ): local_env.Append( LIBS = [ 'X11', 'Xext', 'Xxf86vm' ] ) # 'Xxf86dga', local_env.Append( LIBPATH = [ '/usr/X11R6/lib' ] ) -# local_env.Append( LIBS = [ 'openal' ] ) + +if ( OPENAL == '1' ): + local_env.Append( LIBS = [ 'openal' ] ) source_list = core_list source_list += idlib_objects