diff options
author | Matthias Hoelzl <tc@xantira.com> | 2017-08-26 18:53:49 +0200 |
---|---|---|
committer | Matthias Hoelzl <tc@xantira.com> | 2017-08-27 23:05:39 +0200 |
commit | b6e1e47e3a92c1b94ef327149068a8a147fc73f5 (patch) | |
tree | 649111f4d36d3a1a12048db41e9d72026a787d6b /platform/android/detect.py | |
parent | a919a013f53bdd9535d248ad9fdbb586c342a4d6 (diff) |
Make build scripts Python3 compatible
- The Windows, UWP, Android (on Windows) and Linux builds are
tested with Scons 3.0 alpha using Python 3.
- OSX and iOS should hopefully work but are not tested since
I don't have a Mac.
- Builds using SCons 2.5 and Python 2 should not be impacted.
Diffstat (limited to 'platform/android/detect.py')
-rw-r--r-- | platform/android/detect.py | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/platform/android/detect.py b/platform/android/detect.py index ad5bfb4949..65442bf6f8 100644 --- a/platform/android/detect.py +++ b/platform/android/detect.py @@ -14,7 +14,7 @@ def get_name(): def can_build(): - return (os.environ.has_key("ANDROID_NDK_ROOT")) + return ("ANDROID_NDK_ROOT" in os.environ) def get_opts(): @@ -55,7 +55,7 @@ def configure(env): import subprocess def mySubProcess(cmdline, env): - # print "SPAWNED : " + cmdline + # print("SPAWNED : " + cmdline) startupinfo = subprocess.STARTUPINFO() startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW proc = subprocess.Popen(cmdline, stdin=subprocess.PIPE, stdout=subprocess.PIPE, @@ -63,9 +63,9 @@ def configure(env): data, err = proc.communicate() rv = proc.wait() if rv: - print "=====" - print err - print "=====" + print("=====") + print(err) + print("=====") return rv def mySpawn(sh, escape, cmd, args, env): @@ -183,8 +183,8 @@ def configure(env): ## Compile flags env.Append(CPPFLAGS=["-isystem", sysroot + "/usr/include"]) - env.Append(CPPFLAGS=string.split('-fpic -ffunction-sections -funwind-tables -fstack-protector-strong -fvisibility=hidden -fno-strict-aliasing')) - env.Append(CPPFLAGS=string.split('-DNO_STATVFS -DGLES2_ENABLED')) + env.Append(CPPFLAGS='-fpic -ffunction-sections -funwind-tables -fstack-protector-strong -fvisibility=hidden -fno-strict-aliasing'.split()) + env.Append(CPPFLAGS='-DNO_STATVFS -DGLES2_ENABLED'.split()) env['neon_enabled'] = False if env['android_arch'] == 'x86': @@ -194,11 +194,11 @@ def configure(env): elif env["android_arch"] == "armv6": target_opts = ['-target', 'armv6-none-linux-androideabi'] - env.Append(CPPFLAGS=string.split('-D__ARM_ARCH_6__ -march=armv6 -mfpu=vfp -mfloat-abi=softfp')) + env.Append(CPPFLAGS='-D__ARM_ARCH_6__ -march=armv6 -mfpu=vfp -mfloat-abi=softfp'.split()) elif env["android_arch"] == "armv7": target_opts = ['-target', 'armv7-none-linux-androideabi'] - env.Append(CPPFLAGS=string.split('-D__ARM_ARCH_7__ -D__ARM_ARCH_7A__ -march=armv7-a -mfloat-abi=softfp')) + env.Append(CPPFLAGS='-D__ARM_ARCH_7__ -D__ARM_ARCH_7A__ -march=armv7-a -mfloat-abi=softfp'.split()) if env['android_neon'] == 'yes': env['neon_enabled'] = True env.Append(CPPFLAGS=['-mfpu=neon', '-D__ARM_NEON__']) @@ -225,9 +225,9 @@ def configure(env): env['LINKFLAGS'] = ['-shared', '--sysroot=' + sysroot, '-Wl,--warn-shared-textrel'] if env["android_arch"] == "armv7": - env.Append(LINKFLAGS=string.split('-Wl,--fix-cortex-a8')) - env.Append(LINKFLAGS=string.split('-Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now')) - env.Append(LINKFLAGS=string.split('-Wl,-soname,libgodot_android.so -Wl,--gc-sections')) + env.Append(LINKFLAGS='-Wl,--fix-cortex-a8'.split()) + env.Append(LINKFLAGS='-Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now'.split()) + env.Append(LINKFLAGS='-Wl,-soname,libgodot_android.so -Wl,--gc-sections'.split()) if mt_link: env.Append(LINKFLAGS=['-Wl,--threads']) env.Append(LINKFLAGS=target_opts) |