diff -uNr The-Powder-Toy-94.1/SConscript The-Powder-Toy-94.1.mod/SConscript --- The-Powder-Toy-94.1/SConscript 2019-02-21 07:23:45.000000000 +0200 +++ The-Powder-Toy-94.1.mod/SConscript 2019-05-19 18:34:00.558771379 +0300 @@ -138,7 +138,7 @@ for var in ["CC","CXX","LD","LIBPATH","STRIP"]: if var in os.environ: env[var] = os.environ[var] - print("copying environment variable {0}={1!r}".format(var,os.environ[var])) + print(("copying environment variable {0}={1!r}".format(var,os.environ[var]))) # variables containing several space separated things for var in ["CFLAGS","CCFLAGS","CXXFLAGS","LINKFLAGS","CPPDEFINES","CPPPATH"]: if var in os.environ: @@ -146,7 +146,7 @@ env[var] += SCons.Util.CLVar(os.environ[var]) else: env[var] = SCons.Util.CLVar(os.environ[var]) - print("copying environment variable {0}={1!r}".format(var,os.environ[var])) + print(("copying environment variable {0}={1!r}".format(var,os.environ[var]))) #Used for intro text / executable name, actual bit flags are only set if the --64bit/--32bit command line args are given def add32bitflags(env): @@ -159,12 +159,8 @@ env["BIT"] = 64 #add 32/64 bit defines before configuration if GetOption('64bit'): - env.Append(LINKFLAGS=['-m64']) - env.Append(CCFLAGS=['-m64']) add64bitflags(env) elif GetOption('32bit'): - env.Append(LINKFLAGS=['-m32']) - env.Append(CCFLAGS=['-m32']) add32bitflags(env) if GetOption('universal'): @@ -246,16 +242,14 @@ runSdlConfig = platform == "Linux" or compilePlatform == "Linux" or platform == "FreeBSD" #if platform == "Darwin" and conf.CheckFramework("SDL"): # runSdlConfig = False - if not conf.CheckLib("SDL2"): - FatalError("SDL2 development library not found or not installed") if runSdlConfig: try: - env.ParseConfig('sdl2-config --cflags') + env.ParseConfig('bash @TERMUX_PREFIX@/bin/sdl2-config --cflags') if GetOption('static'): - env.ParseConfig('sdl2-config --static-libs') + env.ParseConfig('bash @TERMUX_PREFIX@/bin/sdl2-config --static-libs') else: - env.ParseConfig('sdl2-config --libs') + env.ParseConfig('bash @TERMUX_PREFIX@/bin/sdl2-config --libs') except: pass @@ -332,10 +326,6 @@ if not conf.CheckLib(['z', 'zlib']): FatalError("libz not found or not installed") - #Look for pthreads - if not conf.CheckLib(['pthread', 'pthreadVC2']): - FatalError("pthreads development library not found or not installed") - if msvc: if not conf.CheckHeader('dirent.h') or not conf.CheckHeader('fftw3.h') or not conf.CheckHeader('pthread.h') or not conf.CheckHeader('zlib.h'): FatalError("Required headers not found") @@ -366,9 +356,6 @@ if platform == "Linux" or platform == "FreeBSD": if not conf.CheckLib('X11'): FatalError("X11 development library not found or not installed") - - if not conf.CheckLib('rt'): - FatalError("librt not found or not installed") elif platform == "Windows": #These need to go last if not conf.CheckLib('gdi32') or not conf.CheckLib('winmm') or (not msvc and not conf.CheckLib('dxguid')): @@ -428,8 +415,6 @@ #Add architecture flags and defines -if isX86: - env.Append(CPPDEFINES='X86') if not GetOption('no-sse'): if GetOption('sse'): if msvc: @@ -474,7 +459,7 @@ else: env.Append(CCFLAGS=['/MD']) else: - env.Append(CCFLAGS=['-O3', '-ftree-vectorize', '-funsafe-math-optimizations', '-ffast-math', '-fomit-frame-pointer']) + env.Append(CCFLAGS=['-Oz', '-fomit-frame-pointer']) if platform != "Darwin": env.Append(CCFLAGS=['-funsafe-loop-optimizations']) @@ -546,8 +531,8 @@ if platform == "Windows": sources += env.RES('resources/powder-res.rc') if not msvc: - sources = filter(lambda source: not 'src\\simulation\\Gravity.cpp' in str(source), sources) - sources = filter(lambda source: not 'src/simulation/Gravity.cpp' in str(source), sources) + sources = [source for source in sources if not 'src\\simulation\\Gravity.cpp' in str(source)] + sources = [source for source in sources if not 'src/simulation/Gravity.cpp' in str(source)] envCopy = env.Clone() envCopy.Append(CCFLAGS='-mstackrealign') sources += envCopy.Object('src/simulation/Gravity.cpp')