2006-12-19 02:25:50 +00:00
#SConstruct
# needed imports
import sys
import os
2007-05-22 01:20:06 +00:00
import SCons . Util
2006-12-19 02:25:50 +00:00
2013-06-16 19:28:38 +00:00
def message ( program , msg ) :
print " %s : %s " % ( program . program_message_prefix , msg )
2013-02-25 00:02:01 +00:00
# endianess-checker
def checkEndian ( ) :
2013-03-23 02:46:45 +00:00
if ARGUMENTS . has_key ( ' endian ' ) :
r = ARGUMENTS [ ' endian ' ]
if r == " little " or r == " big " :
return r
raise SCons . Errors . UserError ( " Unknown endian value: %s " % r )
2013-02-25 00:02:01 +00:00
import struct
array = struct . pack ( ' cccc ' , ' \x01 ' , ' \x02 ' , ' \x03 ' , ' \x04 ' )
i = struct . unpack ( ' i ' , array )
if i == struct . unpack ( ' <i ' , array ) :
return " little "
elif i == struct . unpack ( ' >i ' , array ) :
return " big "
return " unknown "
2006-12-19 02:25:50 +00:00
2013-06-27 02:35:22 +00:00
class ConfigureTests :
class Collector :
def __init__ ( self ) :
self . tests = [ ]
def __call__ ( self , f ) :
self . tests . append ( f . __name__ )
return f
_implicit_test = Collector ( )
_custom_test = Collector ( )
implicit_tests = _implicit_test . tests
custom_tests = _custom_test . tests
comment_not_supported = ' /* not supported */ '
__flags_Werror = { k : [ ' -Werror ' ] for k in [ ' CFLAGS ' , ' CXXFLAGS ' ] }
__empty_main_program = ' int main() { return 0;} '
def __init__ ( self , msgprefix , user_settings ) :
self . msgprefix = msgprefix
self . user_settings = user_settings
self . __repeated_tests = { }
self . __automatic_compiler_tests = {
' .c ' : self . check_cc_works ,
}
@classmethod
def describe ( cls , name ) :
f = getattr ( cls , name )
if f . __doc__ :
lines = f . __doc__ . rstrip ( ) . split ( ' \n ' )
if lines [ - 1 ] . startswith ( " help: " ) :
return lines [ - 1 ] [ 5 : ]
return None
def _may_repeat ( f ) :
def wrap ( self , * args , * * kwargs ) :
try :
return self . __repeated_tests [ f . __name__ ]
except KeyError as e :
pass
r = f ( self , * args , * * kwargs )
self . __repeated_tests [ f . __name__ ] = r
return r
wrap . __name__ = ' repeat-wrap: ' + f . __name__
wrap . __doc__ = f . __doc__
return wrap
def _check_forced ( self , context , name ) :
return getattr ( self . user_settings , ' sconf_ %s ' % name )
def _check_macro ( self , context , macro_name , macro_value , test , * * kwargs ) :
r = self . Compile ( context , text = """
#define {macro_name} {macro_value}
{ test }
""" .format(macro_name=macro_name, macro_value=macro_value, test=test), **kwargs)
if r :
context . sconf . Define ( macro_name , macro_value )
else :
context . sconf . Define ( macro_name , self . comment_not_supported )
def __compiler_test_already_done ( self , context ) :
pass
def Compile ( self , context , text , msg , ext = ' .c ' , successflags = { } , skipped = None , successmsg = None , failuremsg = None ) :
self . __automatic_compiler_tests . pop ( ext , self . __compiler_test_already_done ) ( context )
context . Message ( ' %s : checking %s ... ' % ( self . msgprefix , msg ) )
if skipped is not None :
context . Result ( ' (skipped) {skipped} ' . format ( skipped = skipped ) )
return
frame = None
try :
1 / / 0
except ZeroDivisionError :
frame = sys . exc_info ( ) [ 2 ] . tb_frame . f_back
while frame is not None :
co_name = frame . f_code . co_name
if co_name [ 0 : 6 ] == ' check_ ' :
forced = self . _check_forced ( context , co_name [ 6 : ] )
if forced is not None :
context . Result ( ' (forced) {forced} ' . format ( forced = ' yes ' if forced else ' no ' ) )
return forced
break
frame = frame . f_back
env_flags = { k : context . env [ k ] for k in successflags . keys ( ) }
context . env . Append ( * * successflags )
caller_modified_env_flags = { k : context . env [ k ] for k in self . __flags_Werror . keys ( ) }
# Always pass -Werror
context . env . Append ( * * self . __flags_Werror )
# Force verbose output to sconf.log
cc_env_strings = { }
for k in [ ' CCCOMSTR ' , ' CXXCOMSTR ' ] :
try :
cc_env_strings [ k ] = context . env [ k ]
del context . env [ k ]
except KeyError :
pass
r = context . TryCompile ( text + ' \n ' , ext )
# Restore potential quiet build options
context . env . Replace ( * * cc_env_strings )
context . Result ( ( successmsg if r else failuremsg ) or r )
# On success, revert to base flags + successflags
# On failure, revert to base flags
if r :
context . env . Replace ( * * caller_modified_env_flags )
else :
context . env . Replace ( * * env_flags )
return r
@_may_repeat
@_implicit_test
def check_cc_works ( self , context ) :
"""
help : assume C compiler works
"""
if not self . Compile ( context , text = self . __empty_main_program , msg = ' whether C compiler works ' ) :
raise SCons . Errors . StopError ( " C compiler does not work. " )
@_custom_test
def check_attribute_format_arg ( self , context ) :
"""
help : assume compiler supports __attribute__ ( ( format_arg ) )
"""
macro_name = ' __attribute_format_arg(A) '
macro_value = ' __attribute__((format_arg(A))) '
self . _check_macro ( context , macro_name = macro_name , macro_value = macro_value , test = """
char * a ( char * ) __attribute_format_arg ( 1 ) ;
""" , msg= ' for function __attribute__((format_arg)) ' )
2013-06-27 02:35:22 +00:00
@_custom_test
def check_attribute_format_printf ( self , context ) :
"""
help : assume compiler supports __attribute__ ( ( format ( printf ) ) )
"""
macro_name = ' __attribute_format_printf(A,B) '
macro_value = ' __attribute__((format(printf,A,B))) '
self . _check_macro ( context , macro_name = macro_name , macro_value = macro_value , test = """
int a ( char * , . . . ) __attribute_format_printf ( 1 , 2 ) ;
int b ( char * ) __attribute_format_printf ( 1 , 0 ) ;
""" , msg= ' for function __attribute__((format(printf))) ' )
2013-06-27 02:35:22 +00:00
2013-05-04 23:58:14 +00:00
class LazyObjectConstructor :
def __lazy_objects ( self , name , source ) :
try :
return self . __lazy_object_cache [ name ]
except KeyError as e :
def __strip_extension ( self , name ) :
return os . path . splitext ( name ) [ 0 ]
value = [ ]
for s in source :
if isinstance ( s , str ) :
s = { ' source ' : [ s ] }
transform_target = s . get ( ' transform_target ' , __strip_extension )
for srcname in s [ ' source ' ] :
t = transform_target ( self , srcname )
value . append ( self . env . StaticObject ( target = ' %s %s %s ' % ( self . user_settings . builddir , t , self . env [ " OBJSUFFIX " ] ) , source = srcname ) )
self . __lazy_object_cache [ name ] = value
return value
@staticmethod
def create_lazy_object_getter ( sources ) :
name = repr ( sources )
return lambda s : s . __lazy_objects ( name , sources )
@classmethod
def create_lazy_object_property ( cls , sources ) :
return property ( cls . create_lazy_object_getter ( sources ) )
def __init__ ( self ) :
self . __lazy_object_cache = { }
class DXXCommon ( LazyObjectConstructor ) :
2013-06-16 19:28:38 +00:00
__shared_program_instance = [ 0 ]
2013-02-25 00:02:01 +00:00
__endian = checkEndian ( )
2013-06-16 19:28:38 +00:00
@property
def program_message_prefix ( self ) :
return ' %s . %d ' % ( self . PROGRAM_NAME , self . program_instance )
2013-05-11 23:52:32 +00:00
# Settings which affect how the files are compiled
class UserBuildSettings :
2013-05-05 18:52:00 +00:00
# Paths for the Videocore libs/includes on the Raspberry Pi
RPI_DEFAULT_VC_PATH = ' /opt/vc '
default_OGLES_LIB = ' GLES_CM '
2013-06-16 02:40:05 +00:00
_default_prefix = ' /usr/local '
2013-05-11 23:52:32 +00:00
def default_builddir ( self ) :
2013-06-16 02:40:05 +00:00
builddir_prefix = self . builddir_prefix
builddir_suffix = self . builddir_suffix
2013-05-11 23:52:32 +00:00
default_builddir = builddir_prefix or ' '
if builddir_prefix is not None or builddir_suffix is not None :
2013-07-04 02:27:50 +00:00
fields = [
self . host_platform ,
os . path . basename ( self . CC ) if self . CC else None ,
]
2013-07-04 02:27:07 +00:00
compiler_flags = ' \n ' . join ( ( getattr ( self , attr ) or ' ' ) for attr in [ ' CPPFLAGS ' , ' CFLAGS ' ] )
if compiler_flags :
2013-05-18 02:37:19 +00:00
# Mix in CRC of CFLAGS to get reasonable uniqueness
# when flags are changed. A full hash is
# unnecessary here.
import binascii
2013-07-04 02:27:07 +00:00
crc = binascii . crc32 ( compiler_flags )
2013-06-08 01:38:05 +00:00
if crc < 0 :
crc = crc + 0x100000000
2013-07-04 02:27:50 +00:00
fields . append ( ' {:08x} ' . format ( crc ) )
2013-07-04 03:29:01 +00:00
fields . append ( ' ' . join ( a [ 1 ] if getattr ( self , a [ 0 ] ) else ( a [ 2 ] if len ( a ) > 2 else ' ' )
2013-05-11 23:52:32 +00:00
for a in (
( ' debug ' , ' dbg ' ) ,
( ' profiler ' , ' prf ' ) ,
( ' editor ' , ' ed ' ) ,
2013-07-04 03:29:01 +00:00
( ' opengl ' , ' ogl ' , ' sdl ' ) ,
2013-05-11 23:52:32 +00:00
( ' opengles ' , ' es ' ) ,
( ' raspberrypi ' , ' rpi ' ) ,
2013-07-04 02:27:50 +00:00
) ) )
default_builddir + = ' - ' . join ( [ f for f in fields if f ] )
2013-05-11 23:52:32 +00:00
if builddir_suffix is not None :
default_builddir + = builddir_prefix
return default_builddir
2012-05-20 18:51:21 +00:00
def default_memdebug ( self ) :
return self . debug
2013-05-12 01:03:37 +00:00
# automatic setup for raspberrypi
def default_opengles ( self ) :
if self . raspberrypi :
2013-06-16 02:40:05 +00:00
return True
return False
2013-05-12 01:03:37 +00:00
def selected_OGLES_LIB ( self ) :
if self . raspberrypi :
return ' GLESv2 '
return self . default_OGLES_LIB
2013-06-16 02:40:05 +00:00
def __default_DATA_DIR ( self ) :
return self . prefix + ' /share/games/ ' + self . _program . target
@staticmethod
def _generic_variable ( key , help , default ) :
return ( key , help , default )
@staticmethod
def _enum_variable ( key , help , default , allowed_values ) :
return EnumVariable ( key , help , default , allowed_values )
def _options ( self ) :
return (
2013-06-27 02:35:22 +00:00
{
' variable ' : BoolVariable ,
' arguments ' : [
( ' sconf_ %s ' % name [ 6 : ] , None , ConfigureTests . describe ( name ) or ( ' assume result of %s ' % name ) ) for name in ConfigureTests . implicit_tests + ConfigureTests . custom_tests
] ,
} ,
2013-06-16 02:40:05 +00:00
{
' variable ' : BoolVariable ,
' arguments ' : (
( ' raspberrypi ' , False , ' build for Raspberry Pi (automatically sets opengles and opengles_lib) ' ) ,
) ,
} ,
{
' variable ' : self . _generic_variable ,
' arguments ' : (
( ' rpi_vc_path ' , self . RPI_DEFAULT_VC_PATH , ' directory for RPi VideoCore libraries ' ) ,
( ' opengles_lib ' , self . selected_OGLES_LIB , ' name of the OpenGL ES library to link against ' ) ,
( ' prefix ' , self . _default_prefix , ' installation prefix directory (Linux only) ' ) ,
( ' sharepath ' , self . __default_DATA_DIR , ' directory for shared game data (Linux only) ' ) ,
2013-05-12 03:16:24 +00:00
) ,
} ,
{
2013-06-16 02:40:05 +00:00
' variable ' : BoolVariable ,
2013-05-12 03:16:24 +00:00
' arguments ' : (
2013-06-16 02:40:05 +00:00
( ' debug ' , False , ' build DEBUG binary which includes asserts, debugging output, cheats and more output ' ) ,
2012-05-20 18:51:21 +00:00
( ' memdebug ' , self . default_memdebug , ' build with malloc tracking ' ) ,
2013-06-16 02:40:05 +00:00
( ' profiler ' , False , ' profiler build ' ) ,
( ' opengl ' , True , ' build with OpenGL support ' ) ,
( ' opengles ' , self . default_opengles , ' build with OpenGL ES support ' ) ,
( ' asm ' , False , ' build with ASSEMBLER code (only with opengl=0, requires NASM and x86) ' ) ,
( ' editor ' , False , ' include editor into build (!EXPERIMENTAL!) ' ) ,
( ' sdlmixer ' , True , ' build with SDL_Mixer support for sound and music (includes external music support) ' ) ,
( ' ipv6 ' , False , ' enable IPv6 compability ' ) ,
( ' use_udp ' , True , ' enable UDP support ' ) ,
( ' use_tracker ' , True , ' enable Tracker support (requires UDP) ' ) ,
( ' verbosebuild ' , False , ' print out all compiler/linker messages during building ' ) ,
2013-05-12 03:16:24 +00:00
) ,
} ,
{
2013-06-16 02:40:05 +00:00
' variable ' : self . _generic_variable ,
2013-05-12 03:16:24 +00:00
' arguments ' : (
2013-06-16 02:40:05 +00:00
( ' CC ' , os . environ . get ( ' CC ' ) , ' C compiler command ' ) ,
( ' CXX ' , os . environ . get ( ' CXX ' ) , ' C++ compiler command ' ) ,
( ' CFLAGS ' , os . environ . get ( ' CFLAGS ' ) , ' C compiler flags ' ) ,
( ' CPPFLAGS ' , os . environ . get ( ' CPPFLAGS ' ) , ' C preprocessor flags ' ) ,
( ' CXXFLAGS ' , os . environ . get ( ' CXXFLAGS ' ) , ' C++ compiler flags ' ) ,
( ' LDFLAGS ' , os . environ . get ( ' LDFLAGS ' ) , ' Linker flags ' ) ,
2013-06-01 23:46:05 +00:00
( ' LIBS ' , os . environ . get ( ' LIBS ' ) , ' Libraries to link ' ) ,
2013-06-16 02:40:05 +00:00
( ' RC ' , os . environ . get ( ' RC ' ) , ' Windows resource compiler command ' ) ,
( ' extra_version ' , None , ' text to append to version, such as VCS identity ' ) ,
2013-05-12 03:16:24 +00:00
) ,
} ,
{
2013-06-16 02:40:05 +00:00
' variable ' : self . _enum_variable ,
' arguments ' : (
( ' host_platform ' , None , ' cross-compile to specified platform ' , { ' allowed_values ' : [ ' win32 ' , ' darwin ' , ' linux ' ] } ) ,
) ,
} ,
{
' variable ' : self . _generic_variable ,
' arguments ' : (
( ' builddir_prefix ' , None , ' prefix to generated build directory ' ) ,
( ' builddir_suffix ' , None , ' suffix to generated build directory ' ) ,
2013-05-12 03:16:24 +00:00
# This must be last so that default_builddir will
# have access to other properties.
2013-06-16 02:40:05 +00:00
( ' builddir ' , self . default_builddir , ' build in specified directory ' ) ,
2013-05-12 03:16:24 +00:00
) ,
} ,
)
2013-07-04 03:29:04 +00:00
def __init__ ( self , program = None ) :
self . _program = program
def init ( self , prefix , variables ) :
2013-06-16 02:40:05 +00:00
def names ( name ) :
# Mask out the leading underscore form.
2013-07-04 03:29:04 +00:00
return [ ( ' %s _ %s ' % ( p , name ) ) for p in prefix if p ]
2013-06-16 02:40:05 +00:00
visible_arguments = [ ]
def FormatVariableHelpText ( env , opt , help , default , actual , aliases ) :
if not opt in visible_arguments :
return ' '
l = [ ]
if default is not None :
if isinstance ( default , str ) and not default . isalnum ( ) :
default = ' " %s " ' % default
l . append ( " default: {default} " . format ( default = default ) )
actual = getattr ( self , opt , None )
if actual is not None :
if isinstance ( actual , str ) and not actual . isalnum ( ) :
actual = ' " %s " ' % actual
l . append ( " current: {current} " . format ( current = actual ) )
return " {opt:13} {help} " . format ( opt = opt , help = help ) + ( " [ " + " ; " . join ( l ) + " ] " if len ( l ) else ' ' ) + ' \n '
2013-07-04 03:29:04 +00:00
variables . FormatVariableHelpText = FormatVariableHelpText
2013-06-16 02:40:05 +00:00
for grp in self . _options ( ) :
variable = grp [ ' variable ' ]
for opt in grp [ ' arguments ' ] :
( name , value , help ) = opt [ 0 : 3 ]
kwargs = opt [ 3 ] if len ( opt ) > 3 else { }
if callable ( value ) :
value = value ( )
for n in names ( name ) :
2013-07-04 03:29:04 +00:00
if n not in variables . keys ( ) :
variables . Add ( variable ( key = n , help = help , default = None , * * kwargs ) )
2013-06-16 02:40:05 +00:00
visible_arguments . append ( name )
2013-07-04 03:29:04 +00:00
variables . Add ( variable ( key = name , help = help , default = value , * * kwargs ) )
2013-07-28 23:11:19 +00:00
d = SCons . Environment . SubstitutionEnvironment ( )
variables . Update ( d )
2013-06-16 02:40:05 +00:00
for n in names ( name ) + [ name ] :
try :
value = d [ n ]
break
except KeyError as e :
pass
2013-05-12 03:16:24 +00:00
setattr ( self , name , value )
2013-03-16 18:24:52 +00:00
if self . builddir != ' ' and self . builddir [ - 1 : ] != ' / ' :
self . builddir + = ' / '
2013-05-12 03:16:24 +00:00
def clone ( self ) :
clone = DXXCommon . UserBuildSettings ( None )
2013-06-16 02:40:05 +00:00
for grp in clone . _options ( ) :
2013-05-12 03:16:24 +00:00
for o in grp [ ' arguments ' ] :
name = o [ 0 ]
value = getattr ( self , name )
setattr ( clone , name , value )
return clone
2013-05-11 23:52:32 +00:00
class UserInstallSettings :
2013-06-16 02:40:05 +00:00
def _options ( self ) :
return (
{
' variable ' : self . _generic_variable ,
' arguments ' : (
( ' DESTDIR ' , None , ' installation stage directory ' ) ,
( ' program_name ' , None , ' name of built program ' ) ,
) ,
} ,
{
' variable ' : BoolVariable ,
' arguments ' : (
( ' register_install_target ' , True , ' report install target to SCons core ' ) ,
) ,
} ,
)
2013-05-11 23:52:32 +00:00
class UserSettings ( UserBuildSettings , UserInstallSettings ) :
2013-06-16 02:40:05 +00:00
def _options ( self ) :
return DXXCommon . UserBuildSettings . _options ( self ) + DXXCommon . UserInstallSettings . _options ( self )
2013-02-24 23:33:20 +00:00
# Base class for platform-specific settings processing
class _PlatformSettings :
2013-04-08 06:35:48 +00:00
tools = None
2013-03-16 23:15:01 +00:00
ogllibs = ' '
osasmdef = None
platform_sources = [ ]
2013-05-05 04:01:03 +00:00
platform_objects = [ ]
2013-06-16 17:01:47 +00:00
def __init__ ( self , program , user_settings ) :
self . __program = program
self . user_settings = user_settings
@property
def env ( self ) :
return self . __program . env
2013-02-24 23:33:20 +00:00
# Settings to apply to mingw32 builds
class Win32PlatformSettings ( _PlatformSettings ) :
2013-04-08 06:35:48 +00:00
tools = [ ' mingw ' ]
2013-03-16 23:15:01 +00:00
osdef = ' _WIN32 '
osasmdef = ' win32 '
2013-03-02 21:25:47 +00:00
def adjust_environment ( self , program , env ) :
2013-02-24 23:33:20 +00:00
env . Append ( CPPDEFINES = [ ' _WIN32 ' , ' HAVE_STRUCT_TIMEVAL ' ] )
class DarwinPlatformSettings ( _PlatformSettings ) :
2013-03-16 23:15:01 +00:00
osdef = ' __APPLE__ '
2013-06-16 17:01:47 +00:00
def __init__ ( self , program , user_settings ) :
DXXCommon . _PlatformSettings . __init__ ( self , program , user_settings )
2013-02-24 23:33:20 +00:00
user_settings . asm = 0
2013-03-02 21:25:47 +00:00
def adjust_environment ( self , program , env ) :
2013-02-24 23:33:20 +00:00
env . Append ( CPPDEFINES = [ ' HAVE_STRUCT_TIMESPEC ' , ' HAVE_STRUCT_TIMEVAL ' , ' __unix__ ' ] )
2013-04-05 01:25:10 +00:00
env . Append ( CPPPATH = [ os . path . join ( program . srcdir , ' ../physfs ' ) , os . path . join ( os . getenv ( " HOME " ) , ' Library/Frameworks/SDL.framework/Headers ' ) , ' /Library/Frameworks/SDL.framework/Headers ' ] )
env . Append ( FRAMEWORKS = [ ' ApplicationServices ' , ' Carbon ' , ' Cocoa ' , ' SDL ' ] )
2013-04-20 23:56:13 +00:00
if ( self . user_settings . opengl == 1 ) or ( self . user_settings . opengles == 1 ) :
env . Append ( FRAMEWORKS = [ ' OpenGL ' ] )
2013-04-08 08:21:53 +00:00
env . Append ( FRAMEWORKPATH = [ os . path . join ( os . getenv ( " HOME " ) , ' Library/Frameworks ' ) , ' /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks ' ] )
2013-04-08 06:27:36 +00:00
env [ ' LIBPATH ' ] = ' ../physfs/build/Debug '
2013-02-24 23:33:20 +00:00
# Settings to apply to Linux builds
class LinuxPlatformSettings ( _PlatformSettings ) :
2013-03-16 23:15:01 +00:00
osdef = ' __LINUX__ '
osasmdef = ' elf '
__opengl_libs = [ ' GL ' , ' GLU ' ]
2013-03-17 03:29:48 +00:00
__pkg_config_sdl = { }
2013-06-16 17:01:47 +00:00
def __init__ ( self , program , user_settings ) :
DXXCommon . _PlatformSettings . __init__ ( self , program , user_settings )
2013-02-24 23:33:20 +00:00
if ( user_settings . opengles == 1 ) :
self . ogllibs = [ user_settings . opengles_lib , ' EGL ' ]
else :
2013-03-16 23:15:01 +00:00
self . ogllibs = self . __opengl_libs
2013-03-02 21:25:47 +00:00
def adjust_environment ( self , program , env ) :
2013-02-24 23:33:20 +00:00
env . Append ( CPPDEFINES = [ ' __LINUX__ ' , ' HAVE_STRUCT_TIMESPEC ' , ' HAVE_STRUCT_TIMEVAL ' ] )
2013-03-17 03:29:48 +00:00
try :
pkgconfig = os . environ [ ' PKG_CONFIG ' ]
except KeyError as e :
try :
pkgconfig = ' %s -pkg-config ' % os . environ [ ' CHOST ' ]
except KeyError as e :
pkgconfig = ' pkg-config '
cmd = ' %s --cflags --libs sdl ' % pkgconfig
try :
flags = self . __pkg_config_sdl [ cmd ]
except KeyError as e :
if ( program . user_settings . verbosebuild != 0 ) :
2013-06-16 19:28:38 +00:00
message ( program , " reading SDL settings from ` %s ` " % cmd )
2013-03-17 03:29:48 +00:00
self . __pkg_config_sdl [ cmd ] = env . backtick ( cmd )
flags = self . __pkg_config_sdl [ cmd ]
env . MergeFlags ( flags )
2013-02-24 20:35:12 +00:00
2013-02-25 00:02:01 +00:00
def __init__ ( self ) :
2013-05-04 23:58:14 +00:00
LazyObjectConstructor . __init__ ( self )
2013-04-20 23:52:17 +00:00
self . sources = [ ]
2013-06-16 19:28:38 +00:00
self . __shared_program_instance [ 0 ] + = 1
self . program_instance = self . __shared_program_instance [ 0 ]
2013-02-25 00:02:01 +00:00
def prepare_environment ( self ) :
# Prettier build messages......
if ( self . user_settings . verbosebuild == 0 ) :
2013-03-16 21:29:23 +00:00
builddir = self . user_settings . builddir if self . user_settings . builddir != ' ' else ' . '
self . env [ " CCCOMSTR " ] = " Compiling %s %s $SOURCE " % ( self . target , builddir )
self . env [ " CXXCOMSTR " ] = " Compiling %s %s $SOURCE " % ( self . target , builddir )
self . env [ " LINKCOMSTR " ] = " Linking %s $TARGET " % self . target
2013-02-25 00:02:01 +00:00
self . env [ " ARCOMSTR " ] = " Archiving $TARGET ... "
self . env [ " RANLIBCOMSTR " ] = " Indexing $TARGET ... "
2013-03-03 01:03:33 +00:00
# Use -Wundef to catch when a shared source file includes a
# shared header that misuses conditional compilation. Use
# -Werror=undef to make this fatal. Both are needed, since
# gcc 4.5 silently ignores -Werror=undef. On gcc 4.5, misuse
# produces a warning. On gcc 4.7, misuse produces an error.
2013-09-24 01:59:09 +00:00
self . env . Append ( CCFLAGS = [ ' -Wall ' , ' -Wundef ' , ' -Werror=redundant-decls ' , ' -Werror=pointer-arith ' , ' -Werror=undef ' , ' -funsigned-char ' , ' -Werror=implicit-int ' , ' -Werror=implicit-function-declaration ' , ' -Werror=format-security ' , ' -pthread ' ] )
2013-09-02 23:21:13 +00:00
self . env . Append ( CFLAGS = [ ' -std=gnu99 ' , ' -Wwrite-strings ' ] )
2013-06-27 02:35:22 +00:00
self . env . Append ( CPPPATH = [ ' common/include ' , ' common/main ' , ' . ' , self . user_settings . builddir ] )
2013-03-03 01:03:33 +00:00
if ( self . user_settings . editor == 1 ) :
self . env . Append ( CPPPATH = [ ' common/include/editor ' ] )
2013-02-25 00:02:01 +00:00
# Get traditional compiler environment variables
2013-06-01 23:46:05 +00:00
for cc in [ ' CC ' , ' CXX ' , ' RC ' ] :
2013-05-18 02:15:01 +00:00
value = getattr ( self . user_settings , cc )
if value is not None :
self . env [ cc ] = value
2013-06-01 23:46:05 +00:00
for flags in [ ' CFLAGS ' , ' CPPFLAGS ' , ' CXXFLAGS ' , ' LIBS ' ] :
2013-05-18 02:15:01 +00:00
value = getattr ( self . user_settings , flags )
if value is not None :
2013-06-01 23:46:05 +00:00
self . env . Append ( * * { flags : SCons . Util . CLVar ( value ) } )
2013-06-01 23:46:05 +00:00
if self . user_settings . LDFLAGS :
self . env . Append ( LINKFLAGS = SCons . Util . CLVar ( self . user_settings . LDFLAGS ) )
2013-04-20 23:52:17 +00:00
self . sources + = self . objects_common [ : ]
2013-02-25 00:02:01 +00:00
def check_endian ( self ) :
# set endianess
if ( self . __endian == " big " ) :
2013-06-16 19:28:38 +00:00
message ( self , " BigEndian machine detected " )
2013-02-25 00:02:01 +00:00
self . asm = 0
2013-03-03 00:53:35 +00:00
self . env . Append ( CPPDEFINES = [ ' WORDS_BIGENDIAN ' ] )
2013-02-25 00:02:01 +00:00
elif ( self . __endian == " little " ) :
2013-06-16 19:28:38 +00:00
message ( self , " LittleEndian machine detected " )
2013-02-25 00:02:01 +00:00
def check_platform ( self ) :
# windows or *nix?
2013-05-12 00:53:06 +00:00
platform_name = self . user_settings . host_platform or sys . platform
2013-06-16 19:07:58 +00:00
if self . _argument_prefix_list :
prefix = ' with prefix list %s ' % list ( self . _argument_prefix_list )
else :
prefix = ' '
2013-08-25 20:43:28 +00:00
message ( self , " compiling on %s for %s into %s %s " % ( sys . platform , platform_name , self . user_settings . builddir or ' . ' , prefix ) )
2013-04-28 18:04:06 +00:00
if platform_name == ' win32 ' :
2013-03-03 01:54:44 +00:00
platform = self . Win32PlatformSettings
2013-04-28 18:04:06 +00:00
elif platform_name == ' darwin ' :
2013-03-03 01:54:44 +00:00
platform = self . DarwinPlatformSettings
2013-02-25 00:02:01 +00:00
else :
2013-03-03 01:54:44 +00:00
platform = self . LinuxPlatformSettings
2013-06-16 17:01:47 +00:00
self . platform_settings = platform ( self , self . user_settings )
2013-04-08 06:35:48 +00:00
# Acquire environment object...
self . env = Environment ( ENV = os . environ , tools = platform . tools )
self . platform_settings . adjust_environment ( self , self . env )
2013-02-25 00:02:01 +00:00
def process_user_settings ( self ) :
env = self . env
# opengl or software renderer?
if ( self . user_settings . opengl == 1 ) or ( self . user_settings . opengles == 1 ) :
if ( self . user_settings . opengles == 1 ) :
2013-06-16 19:28:38 +00:00
message ( self , " building with OpenGL ES " )
2013-02-25 00:02:01 +00:00
env . Append ( CPPDEFINES = [ ' OGLES ' ] )
else :
2013-06-16 19:28:38 +00:00
message ( self , " building with OpenGL " )
2013-02-25 00:02:01 +00:00
env . Append ( CPPDEFINES = [ ' OGL ' ] )
# assembler code?
if ( self . user_settings . asm == 1 ) and ( self . user_settings . opengl == 0 ) :
2013-06-16 19:28:38 +00:00
message ( self , " including: ASSEMBLER " )
2013-02-25 00:02:01 +00:00
env . Replace ( AS = ' nasm ' )
2013-04-05 01:12:33 +00:00
env . Append ( ASCOM = ' -f ' + str ( self . platform_settings . osasmdef ) + ' -d ' + str ( self . platform_settings . osdef ) + ' -Itexmap/ ' )
2013-03-16 02:02:24 +00:00
self . sources + = asm_sources
2013-02-25 00:02:01 +00:00
else :
env . Append ( CPPDEFINES = [ ' NO_ASM ' ] )
# SDL_mixer support?
if ( self . user_settings . sdlmixer == 1 ) :
2013-06-16 19:28:38 +00:00
message ( self , " including SDL_mixer " )
2013-02-25 00:02:01 +00:00
env . Append ( CPPDEFINES = [ ' USE_SDLMIXER ' ] )
# debug?
if ( self . user_settings . debug == 1 ) :
2013-06-16 19:28:38 +00:00
message ( self , " including: DEBUG " )
2013-09-22 23:28:06 +00:00
env . Prepend ( CFLAGS = [ ' -g ' ] )
env . Prepend ( CXXFLAGS = [ ' -g ' ] )
2013-02-25 00:02:01 +00:00
else :
env . Append ( CPPDEFINES = [ ' NDEBUG ' , ' RELEASE ' ] )
2013-09-22 23:28:06 +00:00
env . Prepend ( CFLAGS = [ ' -O2 ' ] )
env . Prepend ( CXXFLAGS = [ ' -O2 ' ] )
2012-05-20 18:51:21 +00:00
if self . user_settings . memdebug :
message ( self , " including: MEMDEBUG " )
env . Append ( CPPDEFINES = [ ' DEBUG_MEMORY_ALLOCATIONS ' ] )
2013-02-25 00:02:01 +00:00
# profiler?
if ( self . user_settings . profiler == 1 ) :
env . Append ( CPPFLAGS = [ ' -pg ' ] )
#editor build?
if ( self . user_settings . editor == 1 ) :
env . Append ( CPPDEFINES = [ ' EDITOR ' ] )
# IPv6 compability?
if ( self . user_settings . ipv6 == 1 ) :
env . Append ( CPPDEFINES = [ ' IPv6 ' ] )
# UDP support?
if ( self . user_settings . use_udp == 1 ) :
env . Append ( CPPDEFINES = [ ' USE_UDP ' ] )
# Tracker support? (Relies on UDP)
if ( self . user_settings . use_tracker == 1 ) :
env . Append ( CPPDEFINES = [ ' USE_TRACKER ' ] )
2013-03-03 00:53:35 +00:00
2013-05-03 22:52:57 +00:00
# Raspberry Pi?
if ( self . user_settings . raspberrypi == 1 ) :
print " using Raspberry Pi vendor libs in %s " % self . user_settings . rpi_vc_path
env . Append ( CPPDEFINES = [ ' RPI ' , ' WORDS_NEED_ALIGNMENT ' ] )
env . Append ( CPPPATH = [
self . user_settings . rpi_vc_path + ' /include ' ,
self . user_settings . rpi_vc_path + ' /include/interface/vcos/pthreads ' ,
self . user_settings . rpi_vc_path + ' /include/interface/vmcs_host/linux ' ] )
2013-06-01 23:46:05 +00:00
env . Append ( LIBPATH = self . user_settings . rpi_vc_path + ' /lib ' )
2013-06-01 23:46:05 +00:00
env . Append ( LIBS = [ ' bcm_host ' ] )
2013-05-03 22:52:57 +00:00
2013-03-03 01:03:33 +00:00
class DXXArchive ( DXXCommon ) :
srcdir = ' common '
target = ' dxx-common '
2013-05-05 04:01:03 +00:00
__objects_common = DXXCommon . create_lazy_object_property ( [ os . path . join ( srcdir , f ) for f in [
2012-11-11 22:12:51 +00:00
' 2d/2dsline.cpp ' ,
2012-11-11 22:12:51 +00:00
' 2d/bitblt.cpp ' ,
2012-11-11 22:12:51 +00:00
' 2d/bitmap.cpp ' ,
2012-11-11 22:12:51 +00:00
' 2d/box.cpp ' ,
2012-11-11 22:12:51 +00:00
' 2d/canvas.cpp ' ,
2012-11-11 22:12:51 +00:00
' 2d/circle.cpp ' ,
2012-11-11 22:12:51 +00:00
' 2d/disc.cpp ' ,
2012-11-11 22:12:51 +00:00
' 2d/gpixel.cpp ' ,
2012-11-11 22:12:51 +00:00
' 2d/line.cpp ' ,
2012-11-11 22:12:51 +00:00
' 2d/pixel.cpp ' ,
2012-11-11 22:12:51 +00:00
' 2d/rect.cpp ' ,
2012-11-11 22:12:51 +00:00
' 2d/rle.cpp ' ,
2012-11-11 22:12:51 +00:00
' 2d/scalec.cpp ' ,
2012-11-11 22:12:51 +00:00
' 3d/clipper.cpp ' ,
2012-11-11 22:12:51 +00:00
' 3d/draw.cpp ' ,
2012-11-11 22:12:51 +00:00
' 3d/globvars.cpp ' ,
2012-11-11 22:12:51 +00:00
' 3d/instance.cpp ' ,
2012-11-11 22:12:51 +00:00
' 3d/matrix.cpp ' ,
2012-11-11 22:12:51 +00:00
' 3d/points.cpp ' ,
2012-11-11 22:12:51 +00:00
' 3d/rod.cpp ' ,
2012-11-11 22:12:51 +00:00
' 3d/setup.cpp ' ,
2012-11-11 22:12:51 +00:00
' arch/sdl/joy.cpp ' ,
2012-11-11 22:12:51 +00:00
' arch/sdl/rbaudio.cpp ' ,
2012-11-11 22:12:51 +00:00
' arch/sdl/window.cpp ' ,
2012-11-11 22:12:51 +00:00
' maths/fixc.cpp ' ,
2012-11-11 22:12:51 +00:00
' maths/rand.cpp ' ,
2012-11-11 22:12:51 +00:00
' maths/tables.cpp ' ,
2012-11-11 22:12:51 +00:00
' maths/vecmat.cpp ' ,
2012-11-11 22:12:51 +00:00
' misc/error.cpp ' ,
2012-11-11 22:12:51 +00:00
' misc/hmp.cpp ' ,
2012-11-11 22:12:51 +00:00
' misc/ignorecase.cpp ' ,
2012-11-11 22:12:51 +00:00
' misc/strio.cpp ' ,
2012-11-11 22:12:51 +00:00
' misc/strutil.cpp ' ,
2012-11-11 22:12:51 +00:00
' texmap/ntmap.cpp ' ,
2012-11-11 22:12:51 +00:00
' texmap/scanline.cpp '
2013-03-03 01:03:33 +00:00
]
2013-03-24 23:03:46 +00:00
] )
objects_editor = DXXCommon . create_lazy_object_property ( [ os . path . join ( srcdir , f ) for f in [
2012-11-17 06:14:09 +00:00
' editor/func.cpp ' ,
2012-11-17 06:14:09 +00:00
' ui/button.cpp ' ,
2012-11-17 06:14:09 +00:00
' ui/checkbox.cpp ' ,
2012-11-17 06:14:09 +00:00
' ui/dialog.cpp ' ,
2012-11-17 06:14:09 +00:00
' ui/file.cpp ' ,
2012-11-17 06:14:09 +00:00
' ui/gadget.cpp ' ,
2012-11-17 06:14:09 +00:00
' ui/icon.cpp ' ,
2012-11-17 06:14:09 +00:00
' ui/inputbox.cpp ' ,
2012-11-17 06:14:09 +00:00
' ui/keypad.cpp ' ,
2012-11-17 06:14:09 +00:00
' ui/keypress.cpp ' ,
2012-11-17 06:14:09 +00:00
' ui/keytrap.cpp ' ,
2012-11-17 06:14:09 +00:00
' ui/listbox.cpp ' ,
2012-11-17 06:14:09 +00:00
' ui/menu.cpp ' ,
2012-11-17 06:14:09 +00:00
' ui/menubar.cpp ' ,
2012-11-17 06:14:09 +00:00
' ui/message.cpp ' ,
2012-11-17 06:14:09 +00:00
' ui/radio.cpp ' ,
2012-11-17 06:14:09 +00:00
' ui/scroll.cpp ' ,
2012-11-17 06:14:09 +00:00
' ui/ui.cpp ' ,
2012-11-17 06:14:09 +00:00
' ui/uidraw.cpp ' ,
2012-11-17 06:14:09 +00:00
' ui/userbox.cpp '
2013-03-03 01:03:33 +00:00
]
2013-03-24 23:03:46 +00:00
] )
2013-03-03 01:03:33 +00:00
# for non-ogl
2013-03-24 23:03:46 +00:00
objects_arch_sdl = DXXCommon . create_lazy_object_property ( [ os . path . join ( srcdir , f ) for f in [
2012-11-11 22:12:51 +00:00
' texmap/tmapflat.cpp '
2013-03-03 01:03:33 +00:00
]
2013-03-24 23:03:46 +00:00
] )
objects_arch_sdlmixer = DXXCommon . create_lazy_object_property ( [ os . path . join ( srcdir , f ) for f in [
2012-11-11 22:12:51 +00:00
' arch/sdl/digi_mixer_music.cpp ' ,
2013-03-03 01:03:33 +00:00
]
2013-03-24 23:03:46 +00:00
] )
2013-05-05 04:01:03 +00:00
class Win32PlatformSettings ( LazyObjectConstructor , DXXCommon . Win32PlatformSettings ) :
platform_objects = LazyObjectConstructor . create_lazy_object_property ( [
2012-11-11 22:12:51 +00:00
' common/arch/win32/messagebox.cpp '
2013-05-05 04:01:03 +00:00
] )
2013-06-16 17:01:47 +00:00
def __init__ ( self , program , user_settings ) :
2013-05-05 04:01:03 +00:00
LazyObjectConstructor . __init__ ( self )
2013-06-16 17:01:47 +00:00
DXXCommon . Win32PlatformSettings . __init__ ( self , program , user_settings )
2013-05-05 04:01:03 +00:00
self . user_settings = user_settings
@property
def objects_common ( self ) :
objects_common = self . __objects_common
return objects_common + self . platform_settings . platform_objects
2013-05-12 03:16:24 +00:00
def __init__ ( self , user_settings ) :
2013-03-03 01:03:33 +00:00
self . PROGRAM_NAME = ' DXX-Archive '
2013-06-16 19:07:58 +00:00
self . _argument_prefix_list = None
2013-03-03 01:03:33 +00:00
DXXCommon . __init__ ( self )
2013-05-12 03:16:24 +00:00
self . user_settings = user_settings . clone ( )
2013-04-20 23:56:13 +00:00
self . check_platform ( )
2013-03-03 01:03:33 +00:00
self . prepare_environment ( )
self . check_endian ( )
self . process_user_settings ( )
2013-07-27 22:16:14 +00:00
self . configure_environment ( )
def configure_environment ( self ) :
fs = SCons . Node . FS . get_default_fs ( )
builddir = fs . Dir ( self . user_settings . builddir or ' . ' )
tests = ConfigureTests ( self . program_message_prefix , self . user_settings )
log_file = fs . File ( ' sconf.log ' , builddir )
conf = self . env . Configure ( custom_tests = {
k : getattr ( tests , k ) for k in tests . custom_tests
} ,
conf_dir = fs . Dir ( ' .sconf_temp ' , builddir ) ,
log_file = log_file ,
config_h = fs . File ( ' dxxsconf.h ' , builddir ) ,
clean = False ,
help = False
)
if not conf . env :
return
try :
for k in tests . custom_tests :
getattr ( conf , k ) ( )
except SCons . Errors . StopError as e :
raise SCons . Errors . StopError ( e . args [ 0 ] + ' See {log_file} for details. ' . format ( log_file = log_file ) , * e . args [ 1 : ] )
self . env = conf . Finish ( )
2013-03-03 01:03:33 +00:00
2013-03-03 00:53:35 +00:00
class DXXProgram ( DXXCommon ) :
# version number
VERSION_MAJOR = 0
2013-07-19 14:15:49 +00:00
VERSION_MINOR = 58
2013-08-03 12:16:05 +00:00
VERSION_MICRO = 1
2013-03-16 21:30:13 +00:00
static_archive_construction = { }
2013-03-24 23:03:46 +00:00
def _apply_target_name ( self , name ) :
return os . path . join ( os . path . dirname ( name ) , ' . %s . %s ' % ( self . target , os . path . splitext ( os . path . basename ( name ) ) [ 0 ] ) )
2013-04-21 19:49:59 +00:00
objects_similar_arch_ogl = DXXCommon . create_lazy_object_property ( [ {
' source ' : [ os . path . join ( ' similar ' , f ) for f in [
2012-11-11 22:12:51 +00:00
' arch/ogl/gr.cpp ' ,
2012-11-11 22:12:51 +00:00
' arch/ogl/ogl.cpp ' ,
2013-03-03 01:03:33 +00:00
]
2013-04-21 19:49:59 +00:00
] ,
' transform_target ' : _apply_target_name ,
} ] )
objects_similar_arch_sdl = DXXCommon . create_lazy_object_property ( [ {
' source ' : [ os . path . join ( ' similar ' , f ) for f in [
2012-11-11 22:12:51 +00:00
' arch/sdl/gr.cpp ' ,
2013-03-03 01:03:33 +00:00
]
2013-04-21 19:49:59 +00:00
] ,
' transform_target ' : _apply_target_name ,
} ] )
objects_similar_arch_sdlmixer = DXXCommon . create_lazy_object_property ( [ {
' source ' : [ os . path . join ( ' similar ' , f ) for f in [
2012-11-11 22:12:51 +00:00
' arch/sdl/digi_mixer.cpp ' ,
2012-11-11 22:12:51 +00:00
' arch/sdl/jukebox.cpp '
2013-03-03 01:03:33 +00:00
]
2013-04-21 19:49:59 +00:00
] ,
' transform_target ' : _apply_target_name ,
} ] )
2013-06-02 21:46:32 +00:00
__objects_common = DXXCommon . create_lazy_object_property ( [ {
2013-04-21 19:49:59 +00:00
' source ' : [ os . path . join ( ' similar ' , f ) for f in [
2012-11-11 22:12:51 +00:00
' 2d/font.cpp ' ,
2012-11-11 22:12:51 +00:00
' 2d/palette.cpp ' ,
2012-11-11 22:12:51 +00:00
' 2d/pcx.cpp ' ,
2012-11-11 22:12:51 +00:00
' 3d/interp.cpp ' ,
2012-11-11 22:12:51 +00:00
' arch/sdl/digi.cpp ' ,
2012-11-11 22:12:51 +00:00
' arch/sdl/digi_audio.cpp ' ,
2012-11-11 22:12:51 +00:00
' arch/sdl/event.cpp ' ,
2012-11-11 22:12:51 +00:00
' arch/sdl/init.cpp ' ,
2012-11-11 22:12:51 +00:00
' arch/sdl/key.cpp ' ,
2012-11-11 22:12:51 +00:00
' arch/sdl/mouse.cpp ' ,
2012-11-11 22:12:51 +00:00
' arch/sdl/timer.cpp ' ,
2012-11-11 22:12:51 +00:00
' main/aipath.cpp ' ,
2012-11-11 22:12:51 +00:00
' main/automap.cpp ' ,
2012-11-11 22:12:51 +00:00
' main/cntrlcen.cpp ' ,
2012-11-11 22:12:51 +00:00
' main/config.cpp ' ,
2012-11-11 22:12:51 +00:00
' main/console.cpp ' ,
2012-11-11 22:12:51 +00:00
' main/controls.cpp ' ,
2012-11-11 22:12:51 +00:00
' main/credits.cpp ' ,
2012-11-11 22:12:51 +00:00
' main/digiobj.cpp ' ,
2012-11-11 22:12:51 +00:00
' main/effects.cpp ' ,
2012-11-11 22:12:51 +00:00
' main/fvi.cpp ' ,
2012-11-11 22:12:51 +00:00
' main/game.cpp ' ,
2012-11-11 22:12:51 +00:00
' main/gamecntl.cpp ' ,
2012-11-11 22:12:51 +00:00
' main/gamefont.cpp ' ,
2012-11-11 22:12:51 +00:00
' main/gamerend.cpp ' ,
2012-11-11 22:12:51 +00:00
' main/gamesave.cpp ' ,
2012-11-11 22:12:51 +00:00
' main/gameseg.cpp ' ,
2012-11-11 22:12:51 +00:00
' main/gauges.cpp ' ,
2012-11-11 22:12:51 +00:00
' main/hostage.cpp ' ,
2012-11-11 22:12:51 +00:00
' main/hud.cpp ' ,
2012-11-11 22:12:51 +00:00
' main/inferno.cpp ' ,
2013-03-03 01:03:33 +00:00
' main/kconfig.c ' ,
2013-03-03 01:03:33 +00:00
' main/kmatrix.c ' ,
2013-03-03 01:03:33 +00:00
' main/laser.c ' ,
2013-03-03 01:03:33 +00:00
' main/lighting.c ' ,
2013-03-03 01:03:33 +00:00
' main/menu.c ' ,
2013-03-03 01:03:33 +00:00
' main/mglobal.c ' ,
2013-03-03 01:03:33 +00:00
' main/mission.c ' ,
2013-03-03 01:03:33 +00:00
' main/morph.c ' ,
2013-03-03 01:03:33 +00:00
' main/multi.c ' ,
2013-03-03 01:03:33 +00:00
' main/multibot.c ' ,
2013-03-03 01:03:33 +00:00
' main/newdemo.c ' ,
2013-03-03 01:03:33 +00:00
' main/newmenu.c ' ,
2013-03-03 01:03:33 +00:00
' main/object.c ' ,
2013-03-03 01:03:33 +00:00
' main/paging.c ' ,
2013-03-03 01:03:33 +00:00
' main/physics.c ' ,
2013-03-03 01:03:33 +00:00
' main/player.c ' ,
2013-03-03 01:03:33 +00:00
' main/polyobj.c ' ,
2013-03-03 01:03:33 +00:00
' main/powerup.c ' ,
2013-03-03 01:03:33 +00:00
' main/render.c ' ,
2013-03-03 01:03:33 +00:00
' main/robot.c ' ,
2013-03-03 01:03:33 +00:00
' main/scores.c ' ,
2013-03-03 01:03:33 +00:00
' main/slew.c ' ,
2013-03-03 01:03:33 +00:00
' main/songs.c ' ,
2013-03-03 01:03:33 +00:00
' main/state.c ' ,
2013-03-03 01:03:33 +00:00
' main/switch.c ' ,
2013-03-03 01:03:33 +00:00
' main/terrain.c ' ,
2013-03-03 01:03:33 +00:00
' main/texmerge.c ' ,
2013-03-03 01:03:33 +00:00
' main/text.c ' ,
2013-03-03 01:03:33 +00:00
' main/titles.c ' ,
2013-03-03 01:03:33 +00:00
' main/vclip.c ' ,
2013-03-03 01:03:33 +00:00
' main/wall.c ' ,
2013-03-03 01:03:33 +00:00
' main/weapon.c ' ,
2013-03-03 01:03:33 +00:00
' mem/mem.c ' ,
2013-03-03 01:03:33 +00:00
' misc/args.c ' ,
2013-03-03 01:03:33 +00:00
' misc/hash.c ' ,
2013-03-03 01:03:33 +00:00
' misc/physfsx.c ' ,
2013-03-03 01:03:33 +00:00
]
2013-04-21 19:49:59 +00:00
] ,
' transform_target ' : _apply_target_name ,
} ] )
2013-04-21 17:59:38 +00:00
objects_editor = DXXCommon . create_lazy_object_property ( [ {
2013-04-21 19:49:59 +00:00
' source ' : [ os . path . join ( ' similar ' , f ) for f in [
2012-11-17 06:14:09 +00:00
' editor/autosave.cpp ' ,
2012-11-17 06:14:09 +00:00
' editor/centers.cpp ' ,
2012-11-17 06:14:09 +00:00
' editor/curves.cpp ' ,
2012-11-17 06:14:09 +00:00
' editor/eglobal.cpp ' ,
2012-11-17 06:14:09 +00:00
' editor/elight.cpp ' ,
2012-11-17 06:14:09 +00:00
' editor/eobject.cpp ' ,
2012-11-17 06:14:09 +00:00
' editor/eswitch.cpp ' ,
2013-03-03 01:03:33 +00:00
' editor/fixseg.c ' ,
2013-03-03 01:03:33 +00:00
' editor/group.c ' ,
2013-03-03 01:03:33 +00:00
' editor/info.c ' ,
2013-03-03 01:03:33 +00:00
' editor/kbuild.c ' ,
2013-03-03 01:03:33 +00:00
' editor/kcurve.c ' ,
2013-03-03 01:03:33 +00:00
' editor/kfuncs.c ' ,
2013-03-03 01:03:33 +00:00
' editor/kgame.c ' ,
2013-03-03 01:03:33 +00:00
' editor/khelp.c ' ,
2013-03-03 01:03:33 +00:00
' editor/kmine.c ' ,
2013-03-03 01:03:33 +00:00
' editor/ksegmove.c ' ,
2013-03-03 01:03:33 +00:00
' editor/ksegsel.c ' ,
2013-03-03 01:03:33 +00:00
' editor/ksegsize.c ' ,
2013-03-03 01:03:33 +00:00
' editor/ktmap.c ' ,
2013-03-03 01:03:33 +00:00
' editor/kview.c ' ,
2013-03-03 01:03:33 +00:00
' editor/med.c ' ,
2013-03-03 01:03:33 +00:00
' editor/meddraw.c ' ,
2013-03-03 01:03:33 +00:00
' editor/medmisc.c ' ,
2013-03-03 01:03:33 +00:00
' editor/medrobot.c ' ,
2013-03-03 01:03:33 +00:00
' editor/medsel.c ' ,
2013-03-03 01:03:33 +00:00
' editor/medwall.c ' ,
2013-03-03 01:03:33 +00:00
' editor/mine.c ' ,
2013-03-03 01:03:33 +00:00
' editor/objpage.c ' ,
2013-03-03 01:03:33 +00:00
' editor/segment.c ' ,
2013-03-03 01:03:33 +00:00
' editor/seguvs.c ' ,
2013-03-03 01:03:33 +00:00
' editor/texpage.c ' ,
2013-03-03 01:03:33 +00:00
' editor/texture.c ' ,
2013-03-03 01:03:33 +00:00
]
2013-03-03 01:03:33 +00:00
] ,
' transform_target ' : _apply_target_name ,
} ] )
objects_use_udp = DXXCommon . create_lazy_object_property ( [ {
' source ' : [ os . path . join ( ' similar ' , f ) for f in [
' main/net_udp.c ' ,
]
2013-04-21 19:49:59 +00:00
] ,
' transform_target ' : _apply_target_name ,
} ] )
2013-03-03 00:53:35 +00:00
class UserSettings ( DXXCommon . UserSettings ) :
2013-07-04 03:29:02 +00:00
@property
def BIN_DIR ( self ) :
2013-03-03 00:53:35 +00:00
# installation path
2013-07-04 03:29:02 +00:00
return self . prefix + ' /bin '
2013-03-03 00:53:35 +00:00
# Settings to apply to mingw32 builds
class Win32PlatformSettings ( DXXCommon . Win32PlatformSettings ) :
2013-06-16 17:01:47 +00:00
def __init__ ( self , program , user_settings ) :
DXXCommon . Win32PlatformSettings . __init__ ( self , program , user_settings )
2013-03-03 00:53:35 +00:00
user_settings . sharepath = ' '
2013-06-02 21:46:32 +00:00
self . platform_objects = self . platform_objects [ : ]
2013-03-03 00:53:35 +00:00
def adjust_environment ( self , program , env ) :
DXXCommon . Win32PlatformSettings . adjust_environment ( self , program , env )
2013-06-02 21:46:32 +00:00
rcbasename = os . path . join ( program . srcdir , ' arch/win32/ %s ' % program . target )
self . platform_objects . append ( env . RES ( target = ' %s %s %s ' % ( program . user_settings . builddir , rcbasename , env [ " OBJSUFFIX " ] ) , source = ' %s .rc ' % rcbasename ) )
2013-04-21 20:40:05 +00:00
env . Append ( CPPPATH = [ os . path . join ( program . srcdir , ' arch/win32/include ' ) ] )
2013-06-01 23:46:05 +00:00
env . Append ( LINKFLAGS = ' -mwindows ' )
2013-06-01 23:46:05 +00:00
env . Append ( LIBS = [ ' glu32 ' , ' wsock32 ' , ' ws2_32 ' , ' winmm ' , ' mingw32 ' , ' SDLmain ' , ' SDL ' ] )
2013-03-03 00:53:35 +00:00
# Settings to apply to Apple builds
class DarwinPlatformSettings ( DXXCommon . DarwinPlatformSettings ) :
2013-06-16 17:01:47 +00:00
def __init__ ( self , program , user_settings ) :
DXXCommon . DarwinPlatformSettings . __init__ ( self , program , user_settings )
2013-03-03 00:53:35 +00:00
user_settings . sharepath = ' '
def adjust_environment ( self , program , env ) :
DXXCommon . DarwinPlatformSettings . adjust_environment ( self , program , env )
2013-05-05 23:20:06 +00:00
VERSION = str ( program . VERSION_MAJOR ) + ' . ' + str ( program . VERSION_MINOR )
if ( program . VERSION_MICRO ) :
VERSION + = ' . ' + str ( program . VERSION_MICRO )
env [ ' VERSION_NUM ' ] = VERSION
env [ ' VERSION_NAME ' ] = program . PROGRAM_NAME + ' v ' + VERSION
2013-03-03 00:53:35 +00:00
self . platform_sources = [ os . path . join ( program . srcdir , f ) for f in [ ' arch/cocoa/SDLMain.m ' , ' arch/carbon/messagebox.c ' ] ]
2013-06-01 23:46:05 +00:00
env . Append ( FRAMEWORKS = [ ' ApplicationServices ' , ' Carbon ' , ' Cocoa ' , ' SDL ' ] )
if ( self . user_settings . sdlmixer == 1 ) :
env . Append ( FRAMEWORKS = [ ' SDL_mixer ' ] )
2013-06-01 23:46:05 +00:00
env . Append ( LIBS = [ ' ../physfs/build/Debug/libphysfs.dylib ' ] )
2013-03-03 00:53:35 +00:00
# Settings to apply to Linux builds
class LinuxPlatformSettings ( DXXCommon . LinuxPlatformSettings ) :
2013-06-16 17:01:47 +00:00
def __init__ ( self , program , user_settings ) :
DXXCommon . LinuxPlatformSettings . __init__ ( self , program , user_settings )
2013-03-03 00:53:35 +00:00
user_settings . sharepath + = ' / '
2013-06-02 21:46:32 +00:00
@property
def objects_common ( self ) :
objects_common = self . __objects_common
2013-08-24 20:54:29 +00:00
if ( self . user_settings . use_udp == 1 ) :
objects_common = objects_common + self . objects_use_udp
2013-06-02 21:46:32 +00:00
return objects_common + self . platform_settings . platform_objects
2013-06-16 18:33:02 +00:00
def __init__ ( self , prefix ) :
2013-06-16 02:40:05 +00:00
self . variables = Variables ( ' site-local.py ' , ARGUMENTS )
2013-06-16 19:07:58 +00:00
self . _argument_prefix_list = prefix
2013-03-03 00:53:35 +00:00
DXXCommon . __init__ ( self )
2013-04-21 20:42:15 +00:00
self . banner ( )
2013-07-04 03:29:04 +00:00
self . user_settings = self . UserSettings ( program = self )
self . user_settings . init ( prefix = prefix , variables = self . variables )
2013-03-16 21:30:13 +00:00
if not DXXProgram . static_archive_construction . has_key ( self . user_settings . builddir ) :
2013-05-12 03:16:24 +00:00
DXXProgram . static_archive_construction [ self . user_settings . builddir ] = DXXArchive ( self . user_settings )
2013-03-03 00:53:35 +00:00
self . check_platform ( )
2013-03-03 00:53:35 +00:00
self . prepare_environment ( )
self . check_endian ( )
self . process_user_settings ( )
self . register_program ( )
def prepare_environment ( self ) :
DXXCommon . prepare_environment ( self )
2013-06-16 18:54:58 +00:00
self . env . Append ( CPPDEFINES = [ ( ' DXX_VERSION_MAJORi ' , str ( self . VERSION_MAJOR ) ) , ( ' DXX_VERSION_MINORi ' , str ( self . VERSION_MINOR ) ) , ( ' DXX_VERSION_MICROi ' , str ( self . VERSION_MICRO ) ) ] )
2013-05-11 18:35:01 +00:00
self . env . Append ( CPPPATH = [ os . path . join ( self . srcdir , f ) for f in [ ' include ' , ' main ' , ' arch/include ' ] ] )
2013-03-03 00:53:35 +00:00
def banner ( self ) :
2013-04-21 20:42:15 +00:00
VERSION_STRING = ' v ' + str ( self . VERSION_MAJOR ) + ' . ' + str ( self . VERSION_MINOR ) + ' . ' + str ( self . VERSION_MICRO )
print ' \n ===== ' + self . PROGRAM_NAME + VERSION_STRING + ' ===== \n '
2013-03-03 00:53:35 +00:00
def check_platform ( self ) :
DXXCommon . check_platform ( self )
env = self . env
# windows or *nix?
if sys . platform == ' darwin ' :
2013-05-05 23:20:06 +00:00
VERSION = str ( self . VERSION_MAJOR ) + ' . ' + str ( self . VERSION_MINOR )
if ( self . VERSION_MICRO ) :
VERSION + = ' . ' + str ( self . VERSION_MICRO )
2013-03-03 00:53:35 +00:00
env [ ' VERSION_NUM ' ] = VERSION
env [ ' VERSION_NAME ' ] = self . PROGRAM_NAME + ' v ' + VERSION
2013-06-01 23:46:05 +00:00
env . Append ( LIBS = [ ' physfs ' , ' m ' ] )
2013-03-03 00:53:35 +00:00
def process_user_settings ( self ) :
DXXCommon . process_user_settings ( self )
env = self . env
# opengl or software renderer?
# SDL_mixer support?
if ( self . user_settings . sdlmixer == 1 ) :
if ( sys . platform != ' darwin ' ) :
2013-06-01 23:46:05 +00:00
env . Append ( LIBS = [ ' SDL_mixer ' ] )
2013-03-03 00:53:35 +00:00
# profiler?
if ( self . user_settings . profiler == 1 ) :
2013-06-01 23:46:05 +00:00
env . Append ( LINKFLAGS = ' -pg ' )
2013-03-03 00:53:35 +00:00
#editor build?
if ( self . user_settings . editor == 1 ) :
env . Append ( CPPPATH = [ os . path . join ( self . srcdir , ' include/editor ' ) ] )
2013-02-25 00:02:01 +00:00
env . Append ( CPPDEFINES = [ ( ' SHAREPATH ' , ' \\ " ' + str ( self . user_settings . sharepath ) + ' \\ " ' ) ] )
2013-03-10 19:33:57 +00:00
def _register_program ( self , dxxstr , program_specific_objects = [ ] ) :
env = self . env
exe_target = os . path . join ( self . srcdir , self . target )
2013-03-16 21:30:13 +00:00
static_archive_construction = self . static_archive_construction [ self . user_settings . builddir ]
2013-03-16 23:25:46 +00:00
objects = static_archive_construction . objects_common [ : ]
2013-03-10 19:33:57 +00:00
objects . extend ( program_specific_objects )
2013-03-03 01:03:33 +00:00
if ( self . user_settings . sdlmixer == 1 ) :
2013-03-16 21:30:13 +00:00
objects . extend ( static_archive_construction . objects_arch_sdlmixer )
2013-03-16 23:25:46 +00:00
objects . extend ( self . objects_similar_arch_sdlmixer )
2013-03-03 01:03:33 +00:00
if ( self . user_settings . opengl == 1 ) or ( self . user_settings . opengles == 1 ) :
2013-06-01 23:46:05 +00:00
env . Append ( LIBS = self . platform_settings . ogllibs )
2013-03-16 23:25:46 +00:00
objects . extend ( self . objects_similar_arch_ogl )
2013-03-03 01:03:33 +00:00
else :
2013-06-16 19:28:38 +00:00
message ( self , " building with Software Renderer " )
2013-03-03 01:03:33 +00:00
objects . extend ( static_archive_construction . objects_arch_sdl )
2013-03-16 23:25:46 +00:00
objects . extend ( self . objects_similar_arch_sdl )
2013-03-03 01:03:33 +00:00
if ( self . user_settings . editor == 1 ) :
2013-03-24 23:03:46 +00:00
objects . extend ( self . objects_editor )
2013-03-16 02:02:24 +00:00
objects . extend ( static_archive_construction . objects_editor )
2013-05-05 22:44:22 +00:00
exe_target + = ' -editor '
2013-05-05 22:59:09 +00:00
if self . user_settings . program_name :
exe_target = self . user_settings . program_name
2013-03-03 01:03:33 +00:00
versid_cppdefines = self . env [ ' CPPDEFINES ' ] [ : ]
if self . user_settings . extra_version :
versid_cppdefines . append ( ( ' DESCENT_VERSION_EXTRA ' , ' \\ " %s \\ " ' % self . user_settings . extra_version ) )
objects . extend ( [ self . env . StaticObject ( target = ' %s %s %s ' % ( self . user_settings . builddir , self . _apply_target_name ( s ) , self . env [ " OBJSUFFIX " ] ) , source = s , CPPDEFINES = versid_cppdefines ) for s in [ ' similar/main/vers_id.c ' ] ] )
2013-03-10 19:33:57 +00:00
# finally building program...
2013-06-01 23:46:05 +00:00
env . Program ( target = ' %s %s ' % ( self . user_settings . builddir , str ( exe_target ) ) , source = self . sources + objects )
2013-03-10 19:33:57 +00:00
if ( sys . platform != ' darwin ' ) :
2013-05-05 22:50:19 +00:00
if self . user_settings . register_install_target :
2013-06-28 21:26:42 +00:00
install_dir = os . path . join ( self . user_settings . DESTDIR or ' ' , self . user_settings . BIN_DIR )
2013-05-05 22:55:16 +00:00
env . Install ( install_dir , str ( exe_target ) )
env . Alias ( ' install ' , install_dir )
2013-03-10 19:33:57 +00:00
else :
2013-05-05 23:20:06 +00:00
syspath = sys . path [ : ]
cocoa = os . path . join ( self . srcdir , ' arch/cocoa ' )
sys . path + = [ cocoa ]
2013-03-10 19:33:57 +00:00
import tool_bundle
2013-05-05 23:20:06 +00:00
sys . path = syspath
2013-03-10 19:33:57 +00:00
tool_bundle . TOOL_BUNDLE ( env )
env . MakeBundle ( self . PROGRAM_NAME + ' .app ' , exe_target ,
2013-05-05 23:20:06 +00:00
' free. %s -rebirth ' % dxxstr , os . path . join ( self . srcdir , ' %s gl-Info.plist ' % dxxstr ) ,
2013-03-10 19:33:57 +00:00
typecode = ' APPL ' , creator = ' DCNT ' ,
2013-05-05 23:20:06 +00:00
icon_file = os . path . join ( cocoa , ' %s -rebirth.icns ' % dxxstr ) ,
2013-03-10 19:33:57 +00:00
subst_dict = { ' %s gl ' % dxxstr : exe_target } , # This is required; manually update version for Xcode compatibility
2013-05-05 23:20:06 +00:00
resources = [ [ s , s ] for s in [ os . path . join ( self . srcdir , ' English.lproj/InfoPlist.strings ' ) ] ] )
2013-03-10 19:33:57 +00:00
2013-06-16 02:40:05 +00:00
def GenerateHelpText ( self ) :
return self . variables . GenerateHelpText ( self . env )
2013-03-02 20:53:47 +00:00
class D1XProgram ( DXXProgram ) :
PROGRAM_NAME = ' D1X-Rebirth '
target = ' d1x-rebirth '
srcdir = ' d1x-rebirth '
def prepare_environment ( self ) :
DXXProgram . prepare_environment ( self )
# Flags and stuff for all platforms...
2013-03-03 01:03:33 +00:00
self . env . Append ( CPPDEFINES = [ ( ' DXX_BUILD_DESCENT_I ' , 1 ) ] )
2013-03-02 20:53:47 +00:00
# general source files
2013-04-21 17:58:04 +00:00
__objects_common = DXXCommon . create_lazy_object_property ( [ {
' source ' : [ os . path . join ( srcdir , f ) for f in [
2013-03-02 20:53:47 +00:00
' iff/iff.c ' ,
' main/ai.c ' ,
' main/bm.c ' ,
' main/bmread.c ' ,
' main/collide.c ' ,
' main/custom.c ' ,
' main/dumpmine.c ' ,
' main/endlevel.c ' ,
' main/fireball.c ' ,
' main/fuelcen.c ' ,
' main/gamemine.c ' ,
' main/gameseq.c ' ,
' main/piggy.c ' ,
' main/playsave.c ' ,
' main/snddecom.c ' ,
#'tracker/client/tracker_client.c'
]
2013-04-21 17:58:04 +00:00
] ,
} ] )
@property
def objects_common ( self ) :
return self . __objects_common + DXXProgram . objects_common . fget ( self )
2013-03-02 20:53:47 +00:00
# for editor
2013-04-21 17:59:38 +00:00
__objects_editor = DXXCommon . create_lazy_object_property ( [ {
' source ' : [ os . path . join ( srcdir , f ) for f in [
2013-09-02 23:56:35 +00:00
' main/hostage.c ' ,
2013-03-02 20:53:47 +00:00
' editor/ehostage.c ' ,
]
2013-04-21 17:59:38 +00:00
] ,
} ] )
@property
def objects_editor ( self ) :
return self . __objects_editor + DXXProgram . objects_editor . fget ( self )
2013-03-02 20:53:47 +00:00
# assembler related
2013-03-24 23:03:46 +00:00
objects_asm = DXXCommon . create_lazy_object_property ( [ os . path . join ( srcdir , f ) for f in [
2013-03-02 20:53:47 +00:00
' texmap/tmap_ll.asm ' ,
' texmap/tmap_flt.asm ' ,
' texmap/tmapfade.asm ' ,
' texmap/tmap_lin.asm ' ,
' texmap/tmap_per.asm '
]
2013-03-24 23:03:46 +00:00
] )
2013-03-02 20:53:47 +00:00
def register_program ( self ) :
2013-03-03 01:03:33 +00:00
self . _register_program ( ' d1x ' )
2013-03-02 20:53:47 +00:00
2013-02-25 00:02:01 +00:00
class D2XProgram ( DXXProgram ) :
PROGRAM_NAME = ' D2X-Rebirth '
target = ' d2x-rebirth '
2013-03-02 20:53:47 +00:00
srcdir = ' d2x-rebirth '
2013-02-25 00:02:01 +00:00
def prepare_environment ( self ) :
DXXProgram . prepare_environment ( self )
# Flags and stuff for all platforms...
2013-03-03 01:03:33 +00:00
self . env . Append ( CPPDEFINES = [ ( ' DXX_BUILD_DESCENT_II ' , 1 ) ] )
2013-03-02 22:41:05 +00:00
2013-02-25 00:02:01 +00:00
# general source files
2013-04-21 17:58:04 +00:00
__objects_common = DXXCommon . create_lazy_object_property ( [ {
' source ' : [ os . path . join ( srcdir , f ) for f in [
2006-12-19 02:25:50 +00:00
' iff/iff.c ' ,
' libmve/decoder8.c ' ,
' libmve/decoder16.c ' ,
' libmve/mve_audio.c ' ,
' libmve/mvelib.c ' ,
' libmve/mveplay.c ' ,
' main/ai.c ' ,
' main/bm.c ' ,
' main/collide.c ' ,
' main/dumpmine.c ' ,
' main/endlevel.c ' ,
' main/escort.c ' ,
' main/fireball.c ' ,
' main/fuelcen.c ' ,
' main/gamemine.c ' ,
' main/gamepal.c ' ,
' main/gameseq.c ' ,
' main/movie.c ' ,
' main/piggy.c ' ,
' main/playsave.c ' ,
' main/segment.c ' ,
' misc/physfsrwops.c ' ,
2013-03-03 02:20:54 +00:00
]
2013-04-21 17:58:04 +00:00
] ,
} ] )
@property
def objects_common ( self ) :
return self . __objects_common + DXXProgram . objects_common . fget ( self )
2006-12-19 02:25:50 +00:00
2013-02-25 00:02:01 +00:00
# for editor
2013-04-21 17:59:38 +00:00
__objects_editor = DXXCommon . create_lazy_object_property ( [ {
' source ' : [ os . path . join ( srcdir , f ) for f in [
2013-02-25 01:51:50 +00:00
' main/bmread.c ' ,
2013-03-03 02:20:54 +00:00
]
2013-04-21 17:59:38 +00:00
] ,
} ] )
@property
def objects_editor ( self ) :
return self . __objects_editor + DXXProgram . objects_editor . fget ( self )
2006-12-19 02:25:50 +00:00
2013-02-25 00:02:01 +00:00
# assembler related
2013-03-24 23:03:46 +00:00
objects_asm = DXXCommon . create_lazy_object_property ( [ os . path . join ( srcdir , f ) for f in [
2006-12-19 02:25:50 +00:00
' texmap/tmap_ll.asm ' ,
' texmap/tmap_flt.asm ' ,
' texmap/tmapfade.asm ' ,
' texmap/tmap_lin.asm ' ,
' texmap/tmap_per.asm '
2013-03-03 02:20:54 +00:00
]
2013-03-24 23:03:46 +00:00
] )
2006-12-19 02:25:50 +00:00
2013-03-02 23:58:29 +00:00
def register_program ( self ) :
2013-03-03 01:03:33 +00:00
self . _register_program ( ' d2x ' )
2013-03-02 23:58:29 +00:00
2013-05-05 23:12:52 +00:00
def register_program ( s , program ) :
2013-05-18 03:08:05 +00:00
import itertools
2013-05-05 23:12:52 +00:00
l = [ v for ( k , v ) in ARGLIST if k == s ] or [ 1 ]
# Fallback case: build the regular configuration.
if len ( l ) == 1 :
try :
if int ( l [ 0 ] ) :
2013-06-16 02:40:05 +00:00
return [ program ( ( s , ) ) ]
return [ ]
2013-05-05 23:12:52 +00:00
except ValueError :
# If not an integer, treat this as a configuration profile.
pass
2013-06-16 02:40:05 +00:00
r = [ ]
2013-05-05 23:12:52 +00:00
for e in l :
2013-05-18 03:08:05 +00:00
for prefix in itertools . product ( * [ v . split ( ' + ' ) for v in e . split ( ' , ' ) ] ) :
2013-06-16 02:40:05 +00:00
r . append ( program ( prefix ) )
return r
d1x = register_program ( ' d1x ' , D1XProgram )
d2x = register_program ( ' d2x ' , D2XProgram )
2006-12-19 02:25:50 +00:00
# show some help when running scons -h
2013-06-16 02:40:05 +00:00
h = ' DXX-Rebirth, SConstruct file help: ' + """
2006-12-19 02:25:50 +00:00
Type ' scons ' to build the binary .
Type ' scons install ' to build ( if it hasn ' t been done) and install.
Type ' scons -c ' to clean up .
Extra options ( add them to command line , like ' scons extraoption=value ' ) :
2013-06-16 02:40:05 +00:00
d1x = [ 0 / 1 ] Disable / enable D1X - Rebirth
d1x = prefix - list Enable D1X - Rebirth with prefix - list modifiers
d2x = [ 0 / 1 ] Disable / enable D2X - Rebirth
d2x = prefix - list Enable D2X - Rebirth with prefix - list modifiers
2013-03-02 20:53:47 +00:00
"""
2013-06-16 02:40:05 +00:00
for d in d1x + d2x :
h + = d . PROGRAM_NAME + ( ' . %d : \n ' % d . program_instance ) + d . GenerateHelpText ( )
Help ( h )
2013-02-21 00:20:26 +00:00
2006-12-19 02:25:50 +00:00
#EOF