diff options
Diffstat (limited to 'games/evq3/files/patch-SConstruct')
-rw-r--r-- | games/evq3/files/patch-SConstruct | 123 |
1 files changed, 97 insertions, 26 deletions
diff --git a/games/evq3/files/patch-SConstruct b/games/evq3/files/patch-SConstruct index dc52cbfc353b..9b41d9bcd7f4 100644 --- a/games/evq3/files/patch-SConstruct +++ b/games/evq3/files/patch-SConstruct @@ -1,34 +1,105 @@ ---- SConstruct.orig Sun Feb 25 20:22:51 2007 -+++ SConstruct Sun Feb 25 20:23:30 2007 -@@ -16,6 +16,7 @@ - opts.Add(BoolOption('sdl', 'Set to 1 to compile engine with a SDL backend instead of the native backend', 0)) - opts.Add(BoolOption('freetype', 'Set to 1 to compile engine with FreeType 2.x support', 0)) - opts.Add(BoolOption('tools', 'Set to 1 to compile xmap, gtkradiant, and master', 0)) -+opts.Add(BoolOption('qvm', 'Set to 1 to enable QVM support', 1)) +--- SConstruct.orig Fri Apr 20 18:52:56 2007 ++++ SConstruct Fri Apr 20 18:53:14 2007 +@@ -1,4 +1,4 @@ +-import os, string, sys ++import os, string, sys, commands, fnmatch + import SCons + import SCons.Errors +@@ -6,7 +6,10 @@ + # Set configuration options # - # initialize compiler environment base -@@ -32,7 +33,9 @@ + opts = Options('quake3.conf') +-opts.Add(EnumOption('arch', 'Choose architecture to build for', 'linux-i386', allowed_values=('linux-i386', 'linux-x86_64'))) ++opts.Add('CC', 'C compiler') ++opts.Add('CCFLAGS', 'C compiler flags', Split('')) ++opts.Add('CPPPATH', 'Compiler include path', Split('')) ++opts.Add('LIBPATH', 'Linker library path', Split('')) + opts.Add(EnumOption('warnings', 'Choose warnings level', '1', allowed_values=('0', '1', '2'))) + opts.Add(EnumOption('debug', 'Set to >= 1 to build for debug', '0', allowed_values=('0', '1', '2', '3'))) + opts.Add(EnumOption('optimize', 'Set to >= 1 to build with general optimizations', '2', allowed_values=('0', '1', '2', '3', '4', '5', '6'))) +@@ -15,6 +18,7 @@ + opts.Add(BoolOption('lua', 'Set to 1 to compile qagame with Lua scripting support', 0)) + opts.Add(BoolOption('vm', 'Set to 1 to compile engine with virtual machine support', 1)) + opts.Add(BoolOption('smp', 'Set to 1 to compile engine with symetric multiprocessor support', 0)) ++opts.Add(BoolOption('gamelibs', 'Set to 1 to compile .so game libraries (cgame, game and ui) when they are not needed (i.e. when "vm" is 1 and supported for current arch)', 0)) + + # + # Initialize compiler environment base +@@ -24,15 +28,32 @@ + else: + env = Environment(ENV = {'PATH' : os.environ['PATH']}, options = opts) + +-Help(opts.GenerateHelpText(env)) ++ # Some values need to be splitten ++ env['CCFLAGS'] = Split(env['CCFLAGS']) ++ env['CPPPATH'] = Split(env['CPPPATH']) ++ env['LIBPATH'] = Split(env['LIBPATH']) ++ ++ # Supported VM architectures (Linux) ++ env['vm_archs'] = ['x86', 'x86_64', 'ppc'] ++ env['arch'] = commands.getoutput('uname -m') ++ ++ # Equivalent arch names in FreeBSD ++ if fnmatch.fnmatch(sys.platform, 'freebsd*'): ++ vm_archs_freebsd = {'i386' : 'x86', 'amd64' : 'x86_64', 'powerpc' : 'ppc'} ++ env['arch'] = vm_archs_freebsd[env['arch']] ++ ++ # Build game libraries if VM is not supported in current arch ++ if env['vm_archs'].count(env['arch']) == 0 or env['vm'] == 0: ++ env['gamelibs'] = 1 + ++Help(opts.GenerateHelpText(env)) + + # + # Set common compiler flags # print 'compiling for architecture ', env['arch'] -env.Append(CCFLAGS = '-pipe -fsigned-char') -+env['CC'] = '%%CC%%' -+ -+env.Append(CCFLAGS = '%%CCFLAGS%% -pipe -fsigned-char') ++env.Append(CCFLAGS = Split('-pipe -fsigned-char')) + + if env['warnings'] == '1': + env.Append(CCFLAGS = '-Wall') +@@ -45,7 +66,7 @@ + env.Append(CCFLAGS = '-DNDEBUG') + + if env['optimize'] != '0': +- env.Append(CCFLAGS = '-O${optimize} -ffast-math -fno-strict-aliasing -funroll-loops') ++ env.Append(CCFLAGS = Split('-O${optimize} -ffast-math -fno-strict-aliasing -funroll-loops')) + + if env['simd'] == 'sse': + env.Append(CCFLAGS = '-DSIMD_SSE') +@@ -54,15 +75,12 @@ + + conf = Configure(env) + +-if sys.platform == 'linux2' or sys.platform == 'linux-i386': ++# The "dl" library is needed on Linux ++if fnmatch.fnmatch(sys.platform, 'linux*'): + if not conf.CheckLib('dl', autoadd=0): + print 'Did not find libdl.a, exiting!' + Exit(1) + +-if not conf.CheckLib('m', autoadd=0): +- print 'Did not find libm.a or m.lib, exiting!' +- Exit(1) +- + env = conf.Finish() + + # Save options +@@ -70,8 +88,10 @@ - if env['arch'] == 'xwin32': - env.Tool('xmingw', ['SCons/Tools']) -@@ -69,9 +72,9 @@ Export('env') - SConscript('SConscript_evq3', build_dir='build/scons/evq3', duplicate=0) - #SConscript('SConscript_evq3-ded', build_dir='build/scons/evq3-ded', duplicate=0) --SConscript('SConscript_cgame', build_dir='build/scons/cgame', duplicate=0) --SConscript('SConscript_game', build_dir='build/scons/game', duplicate=0) --SConscript('SConscript_ui', build_dir='build/scons/ui', duplicate=0) -+#SConscript('SConscript_cgame', build_dir='build/scons/cgame', duplicate=0) -+#SConscript('SConscript_game', build_dir='build/scons/game', duplicate=0) -+#SConscript('SConscript_ui', build_dir='build/scons/ui', duplicate=0) - - #if env['tools'] != '0': - #SConscript('SConscript_bspc', build_dir='build/scons/bspc', duplicate=0) + +-SConscript('SConscript_quake3-server', build_dir='build/quake3-server', duplicate=0) + SConscript('SConscript_quake3', build_dir='build/quake3', duplicate=0) +-SConscript('SConscript_cgame', build_dir='build/cgame', duplicate=0) +-SConscript('SConscript_game', build_dir='build/game', duplicate=0) +-SConscript('SConscript_ui', build_dir='build/ui', duplicate=0) ++SConscript('SConscript_quake3-server', build_dir='build/quake3-server', duplicate=0) ++ ++if env['gamelibs'] != 0: ++ SConscript('SConscript_cgame', build_dir='build/cgame', duplicate=0) ++ SConscript('SConscript_game', build_dir='build/game', duplicate=0) ++ SConscript('SConscript_ui', build_dir='build/ui', duplicate=0) |