File dangerdeep-0.4.0-scons-python3.patch of Package dangerdeep
Fix build with SCons/Python3.
Basically it just replaces "print ..." by "print(...)" and fixes
indentation (mixed indentation with space and tabs is not
allowed anymore).
--
diff -up dangerdeep-0.4.0+git.1483314290.aec5b6c/SConstruct.orig dangerdeep-0.4.0+git.1483314290.aec5b6c/SConstruct
--- dangerdeep-0.4.0+git.1483314290.aec5b6c/SConstruct.orig 2018-05-12 13:30:36.535707971 +0200
+++ dangerdeep-0.4.0+git.1483314290.aec5b6c/SConstruct 2018-05-12 14:18:58.523828281 +0200
@@ -46,251 +46,251 @@ fftwlib = 'fftw3'
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)
+ checkconf = False
+ print("Compiling for Win32 Environment")
+ env = Environment(ENV = os.environ)
- env.Append(CPPDEFINES = ['WIN32','NOMINMAX','DEBUG'])
- env.Append(CCFLAGS = '/EHsc' )
+ env.Append(CPPDEFINES = ['WIN32','NOMINMAX','DEBUG'])
+ env.Append(CCFLAGS = '/EHsc' )
## /EHsc
- fftwlib = 'libfftw3-3'
- extralibs = ['bzip2']
+ 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'
+ 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'
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.
+ build_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.'
+ 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'])
+ 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'
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/', 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"')
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.
+ build_dir = 'mingw32'
else:
- SConsignFile()
- print "Compiling for GNU/Linux Environment (" + sys.platform + ")"
- env = Environment(ENV = os.environ)
+ 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']
+ env.Append(CPPPATH = ['/usr/include/SDL', '/usr/include/GL'])
+ gllibs = ['GL', 'GLU']
+ sdllibs = ['SDL', 'SDL_image']
- datadir = '/usr/local/share/dangerdeep'
- build_dir = 'linux'
+ datadir = '/usr/local/share/dangerdeep'
+ build_dir = 'linux'
- ccflags = '-Wall `sdl-config --cflags` `pkg-config --cflags x11`'
+ ccflags = '-Wall `sdl-config --cflags` `pkg-config --cflags x11`'
- arch = platform.machine()
+ 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/lib64/', '/usr/local/lib/', '/usr/local/lib64/', '/usr/lib/x86_64-linux-gnu/']
- 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')
+ 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/lib64/', '/usr/local/lib/', '/usr/local/lib64/', '/usr/lib/x86_64-linux-gnu/']
+ 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')
if hacking:
- env.Append(CPPDEFINES = ['COD_MODE'])
+ env.Append(CPPDEFINES = ['COD_MODE'])
# force tinyxml to use the STL
env.Append(CPPDEFINES = ['TIXML_USE_STL'])
###### 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
source_base_dir = 'src'
@@ -299,32 +299,32 @@ 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', '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
@@ -358,42 +358,42 @@ VariantDir(target_dir, source_base_dir,
############### Helper functions
def findSVN(basedir):
- try:
- f = open(basedir + os.sep + '.svn' + os.sep + 'entries')
- except:
- return []
- 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
+ try:
+ f = open(basedir + os.sep + '.svn' + os.sep + 'entries')
+ except:
+ return []
+ 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)
+ 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