diff -Nru ./dangerdeep-0.4.0_pre3327/SConstruct ./dangerdeep-0.4.0_pre3327-patched/SConstruct --- ./dangerdeep-0.4.0_pre3327/SConstruct 2010-05-08 11:41:20.000000000 +0200 +++ ./dangerdeep-0.4.0_pre3327-patched/SConstruct 2020-02-18 09:50:15.709537002 +0100 @@ -45,279 +45,281 @@ env = Environment() checkconf = True if (env.GetOption('clean') or conf == '0'): - checkconf = False + checkconf = False if sys.platform == 'win32': - checkconf = False - print "Compiling for Win32 Environment" - env = Environment(ENV = os.environ) - - env.Append(CPPDEFINES = ['WIN32','NOMINMAX','DEBUG']) - env.Append(CCFLAGS = '/EHsc' ) - - ## /EHsc - - fftwlib = 'libfftw3-3' - extralibs = ['bzip2'] - - env.Append(CPPPATH = [sdlbase + '\\include', sdlimagebase + '\\include', sdlmixerbase + '\\include', bzip2base + '\\include', fftw3base, glheader,cheader,wheader]) - libpath = [sdlbase + '\\lib', sdlimagebase + '\\lib', sdlmixerbase + '\\lib', bzip2base + '\\lib', fftw3base, gllibrary, clibrary] - gllibs = ['opengl32', 'glu32'] - sdllibs = ['SDL', 'SDL_image'] - datadir = './data' # use slashes as separator always. C/C++ want it so. - build_dir = 'win32' + checkconf = False + print("Compiling for Win32 Environment") + env = Environment(ENV = os.environ) + + env.Append(CPPDEFINES = ['WIN32','NOMINMAX','DEBUG']) + env.Append(CCFLAGS = '/EHsc' ) + + ## /EHsc + + fftwlib = 'libfftw3-3' + extralibs = ['bzip2'] + + env.Append(CPPPATH = [sdlbase + '\\include', sdlimagebase + '\\include', sdlmixerbase + '\\include', bzip2base + '\\include', fftw3base, glheader,cheader,wheader]) + libpath = [sdlbase + '\\lib', sdlimagebase + '\\lib', sdlmixerbase + '\\lib', bzip2base + '\\lib', fftw3base, gllibrary, clibrary] + gllibs = ['opengl32', 'glu32'] + sdllibs = ['SDL', 'SDL_image'] + datadir = './data' # use slashes as separator always. C/C++ want it so. + variant_dir = 'win32' elif sys.platform == 'darwin': - print "Compiling for MacOSX" - env = Environment(ENV = os.environ) - env.Append(CPPPATH = ['/System/Library/Frameworks/AGL.framework/Headers', '/System/Library/Frameworks/OpenGL.framework/Headers','/Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/include' , './Mac']) - libpath = ['/System/Library/Frameworks/OpenGL.framework/Libraries', '/usr/local/lib', '/usr/lib'] - gllibs = [] - sdllibs = ['SDL', 'SDL_image'] - env.Append(CCFLAGS = '-Wall -g -O2 `sdl-config --cflags`') - env.Append(LINKFLAGS = '-F/System/Library/Frameworks -framework AGL -framework OpenGL -framework GLUT -framework Cocoa -framework SDL -framework SDL_image -framework SDL_mixer') - datadir = './data' # use slashes as separator always. C/C++ want it so. - build_dir = 'macosx' - osspecificsrc = Split("""Mac/SDLMain.m""") - if (debug == 1): - env.Append(CCFLAGS = '-g') - env.Append(CPPDEFINES = ['DEBUG']) + print("Compiling for MacOSX") + env = Environment(ENV = os.environ) + env.Append(CPPPATH = ['/System/Library/Frameworks/AGL.framework/Headers', '/System/Library/Frameworks/OpenGL.framework/Headers','/Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/include' , './Mac']) + libpath = ['/System/Library/Frameworks/OpenGL.framework/Libraries', '/usr/local/lib', '/usr/lib'] + gllibs = [] + sdllibs = ['SDL', 'SDL_image'] + env.Append(CCFLAGS = '-Wall -g -O2 `sdl-config --cflags`') + env.Append(LINKFLAGS = '-F/System/Library/Frameworks -framework AGL -framework OpenGL -framework GLUT -framework Cocoa -framework SDL -framework SDL_image -framework SDL_mixer') + datadir = './data' # use slashes as separator always. C/C++ want it so. + variant_dir = 'macosx' + osspecificsrc = Split("""Mac/SDLMain.m""") + if (debug == 1): + env.Append(CCFLAGS = '-g') + env.Append(CPPDEFINES = ['DEBUG']) elif (sys.platform == 'freebsd5') or (sys.platform == 'freebsd6') or (sys.platform == 'freebsd7'): - print "Compiling for FreeBSD Environment" - env = Environment(ENV = os.environ) - LOCALBASE = os.environ['LOCALBASE'] - X11BASE = os.environ['X11BASE'] - SDL_CONFIG = os.environ['SDL_CONFIG'] - env.Replace(CC = os.environ['CC']) - env.Replace(CXX = os.environ['CXX']) - env.Append(CPPPATH = [LOCALBASE + '/include', LOCALBASE + '/include/SDL11', X11BASE + '/include', X11BASE + '/include/GL']) - libpath = [LOCALBASE + '/lib', X11BASE + '/lib'] - gllibs = ['GL', 'GLU'] - sdllibs = ['SDL_image'] - extralibs = ['execinfo'] - cpuinfof = subprocess.Popen( 'sysctl -n hw.instruction_sse', 1024, None, None, subprocess.PIPE, None, None, False, True ).communicate( None )[0].strip(); - cpuinfol = cpuinfof.readlines() - mmxsupported = False - ssesupported = False - for i in cpuinfol: - if i == '1\n': - mmxsupported = True - ssesupported = True - if (usex86sse == 0) and (mmxsupported and ssesupported): - usex86sse = 1 - if usex86sse >= 1: - env.Append(CCFLAGS = '-msse') - env.Append(CPPDEFINES = ['USE_SSE']) - osspecificsrc += [] - print 'Using x86 SSE/MMX optimizations.' - - env.Replace(CCFLAGS = os.environ['CFLAGS']) - if (debug == 1): - env.Append(CCFLAGS = '-g') - env.Append(CPPDEFINES = ['DEBUG']) + print("Compiling for FreeBSD Environment") + env = Environment(ENV = os.environ) + LOCALBASE = os.environ['LOCALBASE'] + X11BASE = os.environ['X11BASE'] + SDL_CONFIG = os.environ['SDL_CONFIG'] + env.Replace(CC = os.environ['CC']) + env.Replace(CXX = os.environ['CXX']) + env.Append(CPPPATH = [LOCALBASE + '/include', LOCALBASE + '/include/SDL11', X11BASE + '/include', X11BASE + '/include/GL']) + libpath = [LOCALBASE + '/lib', X11BASE + '/lib'] + gllibs = ['GL', 'GLU'] + sdllibs = ['SDL_image'] + extralibs = ['execinfo'] + cpuinfof = subprocess.Popen( 'sysctl -n hw.instruction_sse', 1024, None, None, subprocess.PIPE, None, None, False, True ).communicate( None )[0].strip(); + cpuinfol = cpuinfof.readlines() + mmxsupported = False + ssesupported = False + for i in cpuinfol: + if i == '1\n': + mmxsupported = True + ssesupported = True + if (usex86sse == 0) and (mmxsupported and ssesupported): + usex86sse = 1 + if usex86sse >= 1: + env.Append(CCFLAGS = '-msse') + env.Append(CPPDEFINES = ['USE_SSE']) + osspecificsrc += [] + print('Using x86 SSE/MMX optimizations.') + + env.Replace(CCFLAGS = os.environ['CFLAGS']) + if (debug == 1): + env.Append(CCFLAGS = '-g') + env.Append(CPPDEFINES = ['DEBUG']) env.Replace(CXXFLAGS = os.environ['CXXFLAGS'] + ' `' + SDL_CONFIG + ' --cflags`') env.Append(LINKFLAGS = '`' + SDL_CONFIG + ' --libs`') datadir = '/usr/local/share/dangerdeep' - build_dir = 'freebsd' - + variant_dir = 'freebsd' + if (checkconf == True and os.system('grep glBindProgram ' + X11BASE + '/include/GL/gl*.h > /dev/null') == 0): - gllibdirs = [X11BASE + '/lib/', '/usr/lib/', LOCALBASE + '/lib/'] - gllibdir = '' - for i in gllibdirs: - if (os.system('test -f '+i+'libGL.so') == 0): - gllibdir = i - break - if (gllibdir == ''): - print 'ERROR: no libGL.so detected!' - else: - print 'Found GL library "'+gllibdir+'libGL.so"' + gllibdirs = [X11BASE + '/lib/', '/usr/lib/', '/usr/lib64/', LOCALBASE + '/lib/'] + gllibdir = '' + for i in gllibdirs: + if (os.system('test -f '+i+'libGL.so') == 0): + gllibdir = i + print('libGL.so detected!') + break + if (gllibdir == ''): + print('ERROR: no libGL.so detected!') + else: + print('Found GL library "'+gllibdir+'libGL.so"') if (os.system('grep glBindProgram '+gllibdir+'libGL.so > /dev/null') != 0): - print 'GL headers declare glBindProgram, but libGL.so has no such symbol! Ignoring all undefined symbols...' - # I'm not sure which option will hopefully fix the problem... so i use both... - env.Append(LINKFLAGS = '--unresolved-symbols=ignore-all') - env.Append(LINKFLAGS = '-Xlinker --unresolved-symbols -Xlinker ignore-all') + print('GL headers declare glBindProgram, but libGL.so has no such symbol! Ignoring all undefined symbols...') + # I'm not sure which option will hopefully fix the problem... so i use both... + env.Append(LINKFLAGS = '--unresolved-symbols=ignore-all') + env.Append(LINKFLAGS = '-Xlinker --unresolved-symbols -Xlinker ignore-all') elif 0 != mingw32: - print "Compiling for mingw32 Environment" - env = Environment(ENV = os.environ, tools = ['mingw']) + print("Compiling for mingw32 Environment") + env = Environment(ENV = os.environ, tools = ['mingw']) - env.Append(CPPPATH = [ mingw32root + '/usr/include/', mingw32root + '/usr/include/GL/', mingw32root + '/usr/include/SDL/' ] ) + env.Append(CPPPATH = [ mingw32root + '/usr/include/', mingw32root + '/usr/include/GL/', mingw32root + '/usr/include/SDL/' ] ) - # allow env to override defaults - try: - env.Replace(CXX = os.environ['CXX']) - except: - pass - - try: - env.Replace(CC = os.environ['CC']) - except: - pass - - try: - env.Replace(AR = os.environ['AR']) - except: - pass - try: - env.Replace(RANLIB = os.environ['RANLIB']) - except: - pass - - libpath = [ mingw32root + '/lib' ] - gllibs = ['opengl32', 'glu32'] - sdllibs = ['SDL', 'SDL_image'] - env.Append(CPPDEFINES = ['MINGW32']) - env.Append(CCFLAGS = '-Wall -O2') # for mingw! - if (usex86sse >= 1): - osspecificsrc += [] - env.Append(CCFLAGS = '-msse') - env.Append(CPPDEFINES = ['USE_SSE']) - print 'Using x86 SSE/MMX optimizations with GCC intrinsics.' - datadir = './data' # use slashes as separator always. C/C++ want it so. - build_dir = 'mingw32' + # allow env to override defaults + try: + env.Replace(CXX = os.environ['CXX']) + except: + pass + + try: + env.Replace(CC = os.environ['CC']) + except: + pass + + try: + env.Replace(AR = os.environ['AR']) + except: + pass + try: + env.Replace(RANLIB = os.environ['RANLIB']) + except: + pass + + libpath = [ mingw32root + '/lib' ] + gllibs = ['opengl32', 'glu32'] + sdllibs = ['SDL', 'SDL_image'] + env.Append(CPPDEFINES = ['MINGW32']) + env.Append(CCFLAGS = '-Wall -O2') # for mingw! + if (usex86sse >= 1): + osspecificsrc += [] + env.Append(CCFLAGS = '-msse') + env.Append(CPPDEFINES = ['USE_SSE']) + print('Using x86 SSE/MMX optimizations with GCC intrinsics.') + datadir = './data' # use slashes as separator always. C/C++ want it so. + variant_dir = 'mingw32' else: - SConsignFile() - print "Compiling for GNU/Linux Environment (" + sys.platform + ")" - env = Environment(ENV = os.environ) - - env.Append(CPPPATH = ['/usr/include/SDL', '/usr/include/GL']) - gllibs = ['GL', 'GLU'] - sdllibs = ['SDL', 'SDL_image'] - - datadir = '/usr/local/share/dangerdeep' - build_dir = 'linux' - - ccflags = '-Wall `sdl-config --cflags` `pkg-config --cflags x11`' - - arch = platform.machine() - - # allow arch to be over-ridden if need be. - if archflag != '': - print 'Using architecture: ' + archflag + ' (Changed from ' + arch + ')' - arch = archflag - else: - print 'Using architecture: ' + arch - - # Set libpath accordingly - if arch == 'x86_64': - archlib = '/usr/lib64' - arch = 'x86-64' - else: - archlib = '/usr/lib' - - # Set libpath for real - libpath = [archlib, archlib + '/X11', '/usr/X11R6/lib'] - - ccflags += ' -march=' + arch - - env.Append(LINKFLAGS = '`pkg-config --libs-only-L x11`') - if (debug >= 4): - ccflags += ' -g -pg -O3' # profiling - elif (debug == 3): - ccflags += ' -g -O0' - env.Append(CPPDEFINES = ['DEBUG']) - elif (debug == 2): - ccflags += ' -g -O1' - env.Append(CPPDEFINES = ['DEBUG']) - elif (debug == 1): - # same as debug==0 but with DEBUG defined to make logging work (and probably other stuff) - ccflags += ' -g -O2' - env.Append(CPPDEFINES = ['DEBUG']) - elif (debug == -1): - ccflags += ' -g -O3 -mfpmath=sse -mmmx -msse -m3dnow' - elif (debug == -2): # special g++4.0+ auto vectorization - ccflags += ' -g -O3 -mfpmath=sse -mmmx -msse -m3dnow -ftree-vectorize' - elif (debug == -3): # special g++4.0+ auto vectorization - ccflags += ' -g -O3 -mfpmath=sse -mmmx -msse -msse2 -m3dnow -ftree-vectorize' - else: - if (useicc >= 1): - env.Replace(CC = "icc") - env.Replace(CXX = "icpc") - ccflags += ' -ip -w ' - build_dir = 'linux-icc' - else: - ccflags += ' -g -O2' # debug symbols will be stripped by the linker for a debian package - - if (useefence >= 1): - extralibs += ['efence'] - print 'Linking to ElectricFence library!' - elif (useduma >= 1): - extralibs += ['duma'] - print 'Linking to DUMA (EletricFence successor) library!' - if (cvedit == 1): - env.Append(CPPDEFINES = ['CVEDIT']) - - if usex86sse >= 1: - env.Append(CPPDEFINES = ['USE_SSE']) - env.Append(CCFLAGS = '-msse') - osspecificsrc += [] - if (usex86sse >= 2): - env.Append(CPPDEFINES = ['USE_SSE_ALWAYS']) - print 'Using x86 SSE/MMX optimizations with GCC intrinsics ALWAYS WITHOUT DETECTION!' - else: - print 'Using x86 SSE/MMX optimizations with GCC intrinsics.' - env.Append(CCFLAGS = ccflags) - - # check for broken libGL, ignore undefined symbols then - if (checkconf == True and os.system('grep glBindProgram /usr/include/GL/gl*.h > /dev/null') == 0): - gllibdirs = ['/usr/X11R6/lib/', '/usr/lib/', '/usr/local/lib/'] - gllibdir = '' - for i in gllibdirs: - if (os.system('test -f '+i+'libGL.so') == 0): - gllibdir = i - break - if (gllibdir == ''): - print 'ERROR: no libGL.so detected!' - else: - print 'Found GL library "'+gllibdir+'libGL.so"' - if (os.system('grep glBindProgram '+gllibdir+'libGL.so > /dev/null') != 0): - print 'GL headers declare glBindProgram, but libGL.so has no such symbol! Ignoring all undefined symbols...' - # I'm not sure which option will hopefully fix the problem... so i use both... - env.Append(LINKFLAGS = '--unresolved-symbols=ignore-all') - env.Append(LINKFLAGS = '-Xlinker --unresolved-symbols -Xlinker ignore-all') + SConsignFile() + print("Compiling for GNU/Linux Environment (" + sys.platform + ")") + env = Environment(ENV = os.environ) + + env.Append(CPPPATH = ['/usr/include/SDL', '/usr/include/GL']) + gllibs = ['GL', 'GLU'] + sdllibs = ['SDL', 'SDL_image'] + + datadir = '/usr/local/share/dangerdeep' + variant_dir = 'linux' + + ccflags = '-Wall `sdl-config --cflags` `pkg-config --cflags x11`' + + arch = platform.machine() + + # allow arch to be over-ridden if need be. + if archflag != '': + print('Using architecture: ' + archflag + ' (Changed from ' + arch + ')') + arch = archflag + else: + print('Using architecture: ' + arch) + + # Set libpath accordingly + if arch == 'x86_64': + archlib = '/usr/lib64' + arch = 'x86-64' + else: + archlib = '/usr/lib' + + # Set libpath for real + libpath = [archlib, archlib + '/X11', '/usr/X11R6/lib'] + + ccflags += ' -march=' + arch + + env.Append(LINKFLAGS = '`pkg-config --libs-only-L x11`') + if (debug >= 4): + ccflags += ' -g -pg -O3' # profiling + elif (debug == 3): + ccflags += ' -g -O0' + env.Append(CPPDEFINES = ['DEBUG']) + elif (debug == 2): + ccflags += ' -g -O1' + env.Append(CPPDEFINES = ['DEBUG']) + elif (debug == 1): + # same as debug==0 but with DEBUG defined to make logging work (and probably other stuff) + ccflags += ' -g -O2' + env.Append(CPPDEFINES = ['DEBUG']) + elif (debug == -1): + ccflags += ' -g -O3 -mfpmath=sse -mmmx -msse -m3dnow' + elif (debug == -2): # special g++4.0+ auto vectorization + ccflags += ' -g -O3 -mfpmath=sse -mmmx -msse -m3dnow -ftree-vectorize' + elif (debug == -3): # special g++4.0+ auto vectorization + ccflags += ' -g -O3 -mfpmath=sse -mmmx -msse -msse2 -m3dnow -ftree-vectorize' + else: + if (useicc >= 1): + env.Replace(CC = "icc") + env.Replace(CXX = "icpc") + ccflags += ' -ip -w ' + variant_dir = 'linux-icc' + else: + ccflags += ' -g -O2' # debug symbols will be stripped by the linker for a debian package + + if (useefence >= 1): + extralibs += ['efence'] + print('Linking to ElectricFence library!') + elif (useduma >= 1): + extralibs += ['duma'] + print('Linking to DUMA (EletricFence successor) library!') + if (cvedit == 1): + env.Append(CPPDEFINES = ['CVEDIT']) + + if usex86sse >= 1: + env.Append(CPPDEFINES = ['USE_SSE']) + env.Append(CCFLAGS = '-msse') + osspecificsrc += [] + if (usex86sse >= 2): + env.Append(CPPDEFINES = ['USE_SSE_ALWAYS']) + print('Using x86 SSE/MMX optimizations with GCC intrinsics ALWAYS WITHOUT DETECTION!') + else: + print('Using x86 SSE/MMX optimizations with GCC intrinsics.') + env.Append(CCFLAGS = ccflags) + + # check for broken libGL, ignore undefined symbols then + if (checkconf == True and os.system('grep glBindProgram /usr/include/GL/gl*.h > /dev/null') == 0): + gllibdirs = ['/usr/X11R6/lib/', '/usr/lib/', '/usr/lib64/', '/usr/local/lib/'] + gllibdir = '' + for i in gllibdirs: + if (os.system('test -f '+i+'libGL.so') == 0): + gllibdir = i + print('libGL.so detected!') + break + if (gllibdir == ''): + print('ERROR: no libGL.so detected!') + else: + print('Found GL library "'+gllibdir+'libGL.so"') + if (os.system('grep glBindProgram '+gllibdir+'libGL.so > /dev/null') != 0): + print('GL headers declare glBindProgram, but libGL.so has no such symbol! Ignoring all undefined symbols...') + # I'm not sure which option will hopefully fix the problem... so i use both... + env.Append(LINKFLAGS = '--unresolved-symbols=ignore-all') + env.Append(LINKFLAGS = '-Xlinker --unresolved-symbols -Xlinker ignore-all') ###### optionally change install and data dirs if ARGUMENTS.get('datadir', 0): - datadir = ARGUMENTS.get('datadir', 0) + datadir = ARGUMENTS.get('datadir', 0) installbindir = '/usr/local/bin' if ARGUMENTS.get('installbindir', 0): - installbindir = ARGUMENTS.get('installbindir', 0) + installbindir = ARGUMENTS.get('installbindir', 0) -print 'Install binary path: ' + installbindir -print 'Using data dir: ' + datadir +print('Install binary path: ' + installbindir) +print('Using data dir: ' + datadir) -target_dir = '#build' + os.sep + build_dir +target_dir = '#build' + os.sep + variant_dir source_base_dir = 'src' libpath = libpath + [target_dir] env.Append(LIBPATH = libpath) ################ configure if(checkconf == True): - conf = Configure(env) - ffmpeg_available = False - if (devel == 0): - for i in ['GL', 'GLU', 'SDL', 'SDL_image', 'SDL_mixer', 'fftw3', 'bz2']: - if not conf.CheckLib(i): - print 'Library ' + i + ' is missing, it must be installed!' - Exit(1) - for i in ['gl.h', 'glu.h', 'SDL.h', 'SDL_image.h', 'SDL_mixer.h', 'fftw3.h', 'bzlib.h']: - if not conf.CheckHeader(i): - print 'Include file ' + i + ' is missing, install matching development library!' - Exit(1) - if conf.CheckLibWithHeader('fftw3f', 'fftw3.h', 'C'): - print 'fftw3 library supports float type. Using it...' - fftwlib = 'fftw3f' - conf.env.Append(CPPDEFINES = ['WITH_FLOAT_FFTW']) - else: - print 'fftw3 library does not support float type.' - if conf.CheckLibWithHeader('avutil', 'ffmpeg/libavutil/avutil.h', 'C'): - print 'libavutil found...' - ffmpeg_available = True - else: - fftwlib = 'fftw3f' - conf.env.Append(CPPDEFINES = ['WITH_FLOAT_FFTW']) # developers always use float... - env = conf.Finish() + conf = Configure(env) + ffmpeg_available = False + if (devel == 0): + for i in ['GL', 'GLU', 'SDL', 'SDL_image', 'SDL_mixer', 'fftw3', 'bz2']: + if not conf.CheckLib(i): + print('Library ' + i + ' is missing, it must be installed!') + Exit(1) + for i in ['gl.h', 'glu.h', 'SDL.h', 'SDL_image.h', 'SDL_mixer.h', 'fftw3.h', 'bzlib.h']: + if not conf.CheckHeader(i): + print('Include file ' + i + ' is missing, install matching development library!') + Exit(1) + if conf.CheckLibWithHeader('fftw3f', 'fftw3.h', 'C'): + print('fftw3 library supports float type. Using it...') + fftwlib = 'fftw3f' + conf.env.Append(CPPDEFINES = ['WITH_FLOAT_FFTW']) + else: + print('fftw3 library does not support float type.') + if conf.CheckLibWithHeader('avutil', 'libavutil/avutil.h', 'C'): + print('libavutil found...') + ffmpeg_available = True + else: + fftwlib = 'fftw3f' + conf.env.Append(CPPDEFINES = ['WITH_FLOAT_FFTW']) # developers always use float... + env = conf.Finish() else: - ffmpeg_available = True + ffmpeg_available = True ######################### source file lists gfxlibs = ['oglext'] + gllibs + sdllibs @@ -325,18 +327,18 @@ ################ show some help when running scons -h Help(""" - Danger from the Deep, SConstruct file help: - Type 'scons' to build the binary. - Type 'scons -c' to clean up. - Type 'scons install' to install the game (as root). - Type 'scons tarball' to build a tarball of the source (works only with Linux). - Extra options (add them to command line, like 'scons extraoption=value'): - 'debug=x' to build debug level x, levels: 0: normal, 1: debug, 2: more debug, - 3: profiling, -1: extreme optimizations, -2: even more extreme optim. - 'usex86sse=x' where x < 0: disable them, 0: autodetect, 1: enable them, 2: force usage (no runtime detection). - 'useefence=x' when x > 0 use the Electric Fence library (for debugging) - 'useduma=x' when x > 0 use the Electric Fence successor DUMA (for debugging) - """) + Danger from the Deep, SConstruct file help: + Type 'scons' to build the binary. + Type 'scons -c' to clean up. + Type 'scons install' to install the game (as root). + Type 'scons tarball' to build a tarball of the source (works only with Linux). + Extra options (add them to command line, like 'scons extraoption=value'): + 'debug=x' to build debug level x, levels: 0: normal, 1: debug, 2: more debug, + 3: profiling, -1: extreme optimizations, -2: even more extreme optim. + 'usex86sse=x' where x < 0: disable them, 0: autodetect, 1: enable them, 2: force usage (no runtime detection). + 'useefence=x' when x > 0 use the Electric Fence library (for debugging) + 'useduma=x' when x > 0 use the Electric Fence successor DUMA (for debugging) + """) ################ build f = open('version.txt', 'r') @@ -345,45 +347,45 @@ Export('env', 'gfxlibs', 'alllibs', 'installbindir', 'datadir', 'version', 'osspecificsrc', 'ffmpeg_available', 'tests') -SConscript(source_base_dir + os.sep + 'SConscript', build_dir = target_dir, duplicate = 0) +SConscript(source_base_dir + os.sep + 'SConscript', variant_dir = target_dir, duplicate = 0) -BuildDir(target_dir, source_base_dir, duplicate=0) +VariantDir(target_dir, source_base_dir, duplicate=0) ############### Helper functions def findSVN(basedir): - f = open(basedir + os.sep + '.svn' + os.sep + 'entries') - lines = f.readlines() - mydirs = [] - myfiles = [] - for i in range(0, len(lines)): - if lines[i] == '\x0c\n' and i+2 < len(lines): - fname = lines[i+1][:-1] - ftype = lines[i+2][:-1] - if ftype == 'dir': - mydirs.append(fname) - elif ftype == 'file': - myfiles.append(basedir + os.sep + fname) - for d in mydirs: - nextdir = basedir + os.sep + d - if os.path.isdir(nextdir): - myfiles += findSVN(nextdir) - return myfiles + f = open(basedir + os.sep + '.svn' + os.sep + 'entries') + lines = f.readlines() + mydirs = [] + myfiles = [] + for i in range(0, len(lines)): + if lines[i] == '\x0c\n' and i+2 < len(lines): + fname = lines[i+1][:-1] + ftype = lines[i+2][:-1] + if ftype == 'dir': + mydirs.append(fname) + elif ftype == 'file': + myfiles.append(basedir + os.sep + fname) + for d in mydirs: + nextdir = basedir + os.sep + d + if os.path.isdir(nextdir): + myfiles += findSVN(nextdir) + return myfiles ############### option so that "scons tarball" builds a tarball of source # tar building works only on linux -if (( build_dir == 'linux' ) or ( build_dir == 'freebsd' )) and (os.path.isdir('./.svn')): - basetarfilename = 'dangerdeep-' + version - os.system('rm -rf ' + basetarfilename) - os.system('ln -s . ' + basetarfilename) - allsvnfiles = findSVN('.') - filestopack = [] - for i in allsvnfiles: - if not(i.endswith('.xcf')) and not(i.startswith('./data/')): - if not(i.startswith('.' + os.sep + 'build')): - filestopack += [basetarfilename + os.sep + i] - env.Append(TARFLAGS = '-zh') - env.Append(TARSUFFIX = '.gz') - tgz = env.Tar(basetarfilename + '.tar.gz', filestopack) - env.Alias('tarball', tgz) +if (( variant_dir == 'linux' ) or ( variant_dir == 'freebsd' )) and (os.path.isdir('./.svn')): + basetarfilename = 'dangerdeep-' + version + os.system('rm -rf ' + basetarfilename) + os.system('ln -s . ' + basetarfilename) + allsvnfiles = findSVN('.') + filestopack = [] + for i in allsvnfiles: + if not(i.endswith('.xcf')) and not(i.startswith('./data/')): + if not(i.startswith('.' + os.sep + 'build')): + filestopack += [basetarfilename + os.sep + i] + env.Append(TARFLAGS = '-zh') + env.Append(TARSUFFIX = '.gz') + tgz = env.Tar(basetarfilename + '.tar.gz', filestopack) + env.Alias('tarball', tgz) ############# eof diff -Nru ./dangerdeep-0.4.0_pre3327/src/faulthandler.h ./dangerdeep-0.4.0_pre3327-patched/src/faulthandler.h --- ./dangerdeep-0.4.0_pre3327/src/faulthandler.h 2010-05-08 11:37:46.000000000 +0200 +++ ./dangerdeep-0.4.0_pre3327-patched/src/faulthandler.h 2020-02-18 10:55:59.565670722 +0100 @@ -112,6 +112,8 @@ #else //non-WIN32-MacOSX +#include +#include #include #include #include diff -Nru ./dangerdeep-0.4.0_pre3327/src/model.cpp ./dangerdeep-0.4.0_pre3327-patched/src/model.cpp --- ./dangerdeep-0.4.0_pre3327/src/model.cpp 2010-05-08 11:37:46.000000000 +0200 +++ ./dangerdeep-0.4.0_pre3327-patched/src/model.cpp 2020-02-18 11:01:40.234208845 +0100 @@ -47,6 +47,7 @@ /* bounding sphere for a triangle: diameter is longest edge, chose center accordingly */ texture::mapping_mode model::mapping = texture::LINEAR_MIPMAP_LINEAR;//texture::NEAREST; +const unsigned model::mesh::no_adjacency; unsigned model::init_count = 0; diff -Nru ./dangerdeep-0.4.0_pre3327/src/model.h ./dangerdeep-0.4.0_pre3327-patched/src/model.h --- ./dangerdeep-0.4.0_pre3327/src/model.h 2010-05-08 11:37:46.000000000 +0200 +++ ./dangerdeep-0.4.0_pre3327-patched/src/model.h 2020-02-18 10:43:38.826207108 +0100 @@ -23,6 +23,7 @@ #ifndef MODEL_H #define MODEL_H +#include #include "vector3.h" #include "matrix3.h" #include "matrix4.h" diff -Nru ./dangerdeep-0.4.0_pre3327/src/SConscript ./dangerdeep-0.4.0_pre3327-patched/src/SConscript --- ./dangerdeep-0.4.0_pre3327/src/SConscript 2010-05-08 11:37:46.000000000 +0200 +++ ./dangerdeep-0.4.0_pre3327-patched/src/SConscript 2020-02-18 10:29:30.189686054 +0100 @@ -7,10 +7,11 @@ ################## define sources ####################### dftdsources = Split("""subsim.cpp ai.cpp + cfg.cpp + keys.cpp airplane.cpp bitstream.cpp bzip.cpp - cfg.cpp coastmap.cpp convoy.cpp countrycodes.cpp @@ -25,7 +26,6 @@ gun_shell.cpp height_generator_map.cpp highscorelist.cpp - keys.cpp logbook.cpp logbook_display.cpp map_display.cpp @@ -110,7 +110,7 @@ osspecificsrc_obj = [env.Object(source = x) for x in osspecificsrc] ############# programs, libs, etc. -env.StaticLibrary(target = 'dftdmedia', source = dftdmediasources, LIBS = gfxlibs) +dftdmedia_obj = env.StaticLibrary(target = 'dftdmedia', source = dftdmediasources, LIBS = gfxlibs) filehelper_obj = env.Object(source = 'filehelper.cpp') widget_obj = env.Object(source = 'widget.cpp') @@ -129,7 +129,7 @@ if 'win32' == sys.platform: dftdsources += env.RES('../../packaging/win32/dangerdeep.rc') -binary = env.Program(target = 'dangerdeep', source = dftdsources + filehelper_obj + widget_obj + frustum_obj + datadirsobj + globaldataobj + osspecificsrc_obj + threads_obj, LIBS = alllibs) +binary = env.Program(target = 'dangerdeep', source = dftdsources + dftdmedia_obj + filehelper_obj + widget_obj + frustum_obj + datadirsobj + globaldataobj + osspecificsrc_obj + threads_obj, LIBS = alllibs) env.StaticLibrary(target = 'oglext', source = oglextsources) env.StaticLibrary(target = 'tinyxml', source = tinyxmlsources) @@ -167,7 +167,7 @@ env.Default(bvtreeintersecttest) if ffmpeg_available: - env.Append(CPPPATH = '/usr/include/ffmpeg') + env.Append(CPPPATH = '/usr/include') videoplaytest = env.Program('videoplaytest', ['videoplaytest.cpp', datadirsobj, filehelper_obj, osspecificsrc_obj, threads_obj], LIBS = alllibs + ['avcodec', 'avformat']) env.Default(videoplaytest) diff -Nru ./dangerdeep-0.4.0_pre3327/src/sea_object.h ./dangerdeep-0.4.0_pre3327-patched/src/sea_object.h --- ./dangerdeep-0.4.0_pre3327/src/sea_object.h 2010-05-08 11:37:46.000000000 +0200 +++ ./dangerdeep-0.4.0_pre3327-patched/src/sea_object.h 2020-02-18 10:46:57.256482060 +0100 @@ -23,6 +23,7 @@ #ifndef SEA_OBJECT_H #define SEA_OBJECT_H +#include #include #include "ptrvector.h" #include diff -Nru ./dangerdeep-0.4.0_pre3327/src/texture.h ./dangerdeep-0.4.0_pre3327-patched/src/texture.h --- ./dangerdeep-0.4.0_pre3327/src/texture.h 2010-05-08 11:37:46.000000000 +0200 +++ ./dangerdeep-0.4.0_pre3327-patched/src/texture.h 2020-02-18 10:34:25.261745747 +0100 @@ -34,6 +34,7 @@ #include #endif +#include #include #include #include "oglext/OglExt.h"