termux-packages/x11-packages/the-powder-toy/The-Powder-Toy-93.3_SConscr...

105 lines
4.1 KiB
Diff
Raw Normal View History

2018-09-10 00:42:26 +02:00
diff -uNr The-Powder-Toy-93.3/SConscript The-Powder-Toy-93.3.mod/SConscript
--- The-Powder-Toy-93.3/SConscript 2018-06-15 13:35:44.616286939 +0300
+++ The-Powder-Toy-93.3.mod/SConscript 2018-06-15 13:55:39.922920452 +0300
@@ -137,7 +137,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:
@@ -145,7 +145,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):
@@ -158,12 +158,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
- elif not conf.CheckLib("SDL"):
- FatalError("SDL development library not found or not installed")
if runSdlConfig:
try:
- env.ParseConfig('sdl-config --cflags')
+ env.ParseConfig('bash /data/data/com.termux/files/usr/bin/sdl-config --cflags')
if GetOption('static'):
- env.ParseConfig('sdl-config --static-libs')
+ env.ParseConfig('bash /data/data/com.termux/files/usr/bin/sdl-config --static-libs')
else:
- env.ParseConfig('sdl-config --libs')
+ env.ParseConfig('bash /data/data/com.termux/files/usr/bin/sdl-config --libs')
except:
pass
@@ -333,10 +327,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")
@@ -367,9 +357,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')):
@@ -429,8 +416,6 @@
#Add architecture flags and defines
-if isX86:
- env.Append(CPPDEFINES='X86')
if not GetOption('no-sse'):
if GetOption('sse'):
if msvc:
@@ -475,7 +460,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')