diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2016-10-30 18:57:40 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2016-11-01 00:35:16 +0100 |
commit | d4c17700aa2f36f69978beda04e42ff2749de270 (patch) | |
tree | 466f774d5fff723d6496e7259529c366fe01855a /platform | |
parent | 97c8508f5e4f57b1048830d44e76e1f4517fd449 (diff) |
style: Fix PEP8 whitespace issues in Python files
Done with `autopep8 --select=E2,W2`, fixes:
- E201 - Remove extraneous whitespace.
- E202 - Remove extraneous whitespace.
- E203 - Remove extraneous whitespace.
- E211 - Remove extraneous whitespace.
- E221 - Fix extraneous whitespace around keywords.
- E222 - Fix extraneous whitespace around keywords.
- E223 - Fix extraneous whitespace around keywords.
- E224 - Remove extraneous whitespace around operator.
- E225 - Fix missing whitespace around operator.
- E226 - Fix missing whitespace around operator.
- E227 - Fix missing whitespace around operator.
- E228 - Fix missing whitespace around operator.
- E231 - Add missing whitespace.
- E231 - Fix various deprecated code (via lib2to3).
- E241 - Fix extraneous whitespace around keywords.
- E242 - Remove extraneous whitespace around operator.
- E251 - Remove whitespace around parameter '=' sign.
- E261 - Fix spacing after comment hash.
- E262 - Fix spacing after comment hash.
- E265 - Format block comments.
- E271 - Fix extraneous whitespace around keywords.
- E272 - Fix extraneous whitespace around keywords.
- E273 - Fix extraneous whitespace around keywords.
- E274 - Fix extraneous whitespace around keywords.
- W291 - Remove trailing whitespace.
- W293 - Remove trailing whitespace.
Diffstat (limited to 'platform')
-rw-r--r-- | platform/android/SCsub | 84 | ||||
-rw-r--r-- | platform/android/detect.py | 220 | ||||
-rw-r--r-- | platform/bb10/detect.py | 24 | ||||
-rw-r--r-- | platform/haiku/SCsub | 2 | ||||
-rw-r--r-- | platform/haiku/detect.py | 42 | ||||
-rw-r--r-- | platform/iphone/SCsub | 6 | ||||
-rw-r--r-- | platform/iphone/detect.py | 50 | ||||
-rw-r--r-- | platform/javascript/SCsub | 28 | ||||
-rw-r--r-- | platform/javascript/detect.py | 50 | ||||
-rw-r--r-- | platform/osx/SCsub | 2 | ||||
-rw-r--r-- | platform/osx/detect.py | 64 | ||||
-rw-r--r-- | platform/server/SCsub | 4 | ||||
-rw-r--r-- | platform/server/detect.py | 48 | ||||
-rw-r--r-- | platform/windows/SCsub | 10 | ||||
-rw-r--r-- | platform/windows/detect.py | 178 | ||||
-rw-r--r-- | platform/winrt/detect.py | 56 | ||||
-rw-r--r-- | platform/x11/SCsub | 4 | ||||
-rw-r--r-- | platform/x11/detect.py | 110 |
18 files changed, 491 insertions, 491 deletions
diff --git a/platform/android/SCsub b/platform/android/SCsub index 9db6636f8b..146f7c25a3 100644 --- a/platform/android/SCsub +++ b/platform/android/SCsub @@ -22,7 +22,7 @@ android_files = [ 'java_class_wrapper.cpp' ] -#env.Depends('#core/math/vector3.h', 'vector3_psp.h') +# env.Depends('#core/math/vector3.h', 'vector3_psp.h') #obj = env.SharedObject('godot_android.cpp') @@ -30,86 +30,86 @@ env_android = env.Clone() if env['target'] == "profile": env_android.Append(CPPFLAGS=['-DPROFILER_ENABLED']) -android_objects=[] +android_objects = [] for x in android_files: - android_objects.append( env_android.SharedObject( x ) ) + android_objects.append(env_android.SharedObject(x)) prog = None -abspath=env.Dir(".").abspath +abspath = env.Dir(".").abspath -gradle_basein = open(abspath+"/build.gradle.template","rb") -gradle_baseout = open(abspath+"/java/build.gradle","wb") +gradle_basein = open(abspath + "/build.gradle.template", "rb") +gradle_baseout = open(abspath + "/java/build.gradle", "wb") gradle_text = gradle_basein.read() -gradle_maven_repos_text="" +gradle_maven_repos_text = "" if len(env.android_maven_repos) > 0: - gradle_maven_repos_text+="maven {\n" + gradle_maven_repos_text += "maven {\n" for x in env.android_maven_repos: - gradle_maven_repos_text+="\t\t"+x+"\n" - gradle_maven_repos_text+="\t}\n" + gradle_maven_repos_text += "\t\t" + x + "\n" + gradle_maven_repos_text += "\t}\n" -gradle_maven_dependencies_text="" +gradle_maven_dependencies_text = "" for x in env.android_dependencies: - gradle_maven_dependencies_text+=x+"\n" + gradle_maven_dependencies_text += x + "\n" -gradle_java_dirs_text="" +gradle_java_dirs_text = "" for x in env.android_java_dirs: - gradle_java_dirs_text+=",'"+x.replace("\\","/")+"'" + gradle_java_dirs_text += ",'" + x.replace("\\", "/") + "'" -gradle_res_dirs_text="" +gradle_res_dirs_text = "" for x in env.android_res_dirs: - gradle_res_dirs_text+=",'"+x.replace("\\","/")+"'" + gradle_res_dirs_text += ",'" + x.replace("\\", "/") + "'" -gradle_aidl_dirs_text="" +gradle_aidl_dirs_text = "" for x in env.android_aidl_dirs: - gradle_aidl_dirs_text+=",'"+x.replace("\\","/")+"'" + gradle_aidl_dirs_text += ",'" + x.replace("\\", "/") + "'" -gradle_jni_dirs_text="" +gradle_jni_dirs_text = "" for x in env.android_jni_dirs: - gradle_jni_dirs_text+=",'"+x.replace("\\","/")+"'" + gradle_jni_dirs_text += ",'" + x.replace("\\", "/") + "'" -gradle_asset_dirs_text="" +gradle_asset_dirs_text = "" -gradle_default_config_text="" +gradle_default_config_text = "" for x in env.android_default_config: - gradle_default_config_text+=x+"\n\t\t" + gradle_default_config_text += x + "\n\t\t" -gradle_text = gradle_text.replace("$$GRADLE_REPOSITORY_URLS$$",gradle_maven_repos_text) -gradle_text = gradle_text.replace("$$GRADLE_DEPENDENCIES$$",gradle_maven_dependencies_text) -gradle_text = gradle_text.replace("$$GRADLE_JAVA_DIRS$$",gradle_java_dirs_text) -gradle_text = gradle_text.replace("$$GRADLE_RES_DIRS$$",gradle_res_dirs_text) -gradle_text = gradle_text.replace("$$GRADLE_ASSET_DIRS$$",gradle_asset_dirs_text) -gradle_text = gradle_text.replace("$$GRADLE_AIDL_DIRS$$",gradle_aidl_dirs_text) -gradle_text = gradle_text.replace("$$GRADLE_JNI_DIRS$$",gradle_jni_dirs_text) -gradle_text = gradle_text.replace("$$GRADLE_DEFAULT_CONFIG$$",gradle_default_config_text) +gradle_text = gradle_text.replace("$$GRADLE_REPOSITORY_URLS$$", gradle_maven_repos_text) +gradle_text = gradle_text.replace("$$GRADLE_DEPENDENCIES$$", gradle_maven_dependencies_text) +gradle_text = gradle_text.replace("$$GRADLE_JAVA_DIRS$$", gradle_java_dirs_text) +gradle_text = gradle_text.replace("$$GRADLE_RES_DIRS$$", gradle_res_dirs_text) +gradle_text = gradle_text.replace("$$GRADLE_ASSET_DIRS$$", gradle_asset_dirs_text) +gradle_text = gradle_text.replace("$$GRADLE_AIDL_DIRS$$", gradle_aidl_dirs_text) +gradle_text = gradle_text.replace("$$GRADLE_JNI_DIRS$$", gradle_jni_dirs_text) +gradle_text = gradle_text.replace("$$GRADLE_DEFAULT_CONFIG$$", gradle_default_config_text) -gradle_baseout.write( gradle_text ) +gradle_baseout.write(gradle_text) gradle_baseout.close() -pp_basein = open(abspath+"/AndroidManifest.xml.template","rb") -pp_baseout = open(abspath+"/java/AndroidManifest.xml","wb") +pp_basein = open(abspath + "/AndroidManifest.xml.template", "rb") +pp_baseout = open(abspath + "/java/AndroidManifest.xml", "wb") manifest = pp_basein.read() -manifest = manifest.replace("$$ADD_APPLICATION_CHUNKS$$",env.android_manifest_chunk) -manifest = manifest.replace("$$ADD_PERMISSION_CHUNKS$$",env.android_permission_chunk) -manifest = manifest.replace("$$ADD_APPATTRIBUTE_CHUNKS$$",env.android_appattributes_chunk) -pp_baseout.write( manifest ) +manifest = manifest.replace("$$ADD_APPLICATION_CHUNKS$$", env.android_manifest_chunk) +manifest = manifest.replace("$$ADD_PERMISSION_CHUNKS$$", env.android_permission_chunk) +manifest = manifest.replace("$$ADD_APPATTRIBUTE_CHUNKS$$", env.android_appattributes_chunk) +pp_baseout.write(manifest) -env_android.SharedLibrary("#bin/libgodot",[android_objects],SHLIBSUFFIX=env["SHLIBSUFFIX"]) +env_android.SharedLibrary("#bin/libgodot", [android_objects], SHLIBSUFFIX=env["SHLIBSUFFIX"]) lib_arch_dir = '' @@ -125,8 +125,8 @@ else: if lib_arch_dir != '': if env['target'] == 'release': lib_type_dir = 'release' - else: # release_debug, debug + else: # release_debug, debug lib_type_dir = 'debug' - out_dir = '#platform/android/java/libs/'+lib_type_dir+'/'+lib_arch_dir - env_android.Command(out_dir+'/libgodot_android.so', '#bin/libgodot'+env['SHLIBSUFFIX'], Move("$TARGET", "$SOURCE")) + out_dir = '#platform/android/java/libs/' + lib_type_dir + '/' + lib_arch_dir + env_android.Command(out_dir + '/libgodot_android.so', '#bin/libgodot' + env['SHLIBSUFFIX'], Move("$TARGET", "$SOURCE")) diff --git a/platform/android/detect.py b/platform/android/detect.py index 9a14452862..f1331d24d5 100644 --- a/platform/android/detect.py +++ b/platform/android/detect.py @@ -21,12 +21,12 @@ def get_opts(): return [ ('ANDROID_NDK_ROOT', 'the path to Android NDK', os.environ.get("ANDROID_NDK_ROOT", 0)), - ('NDK_TARGET', 'toolchain to use for the NDK',os.environ.get("NDK_TARGET", "arm-linux-androideabi-4.9")), - ('NDK_TARGET_X86', 'toolchain to use for the NDK x86',os.environ.get("NDK_TARGET_X86", "x86-4.9")), - ('ndk_platform', 'compile for platform: (android-<api> , example: android-14)',"android-14"), - ('android_arch', 'select compiler architecture: (armv7/armv6/x86)',"armv7"), - ('android_neon','enable neon (armv7 only)',"yes"), - ('android_stl','enable STL support in android port (for modules)',"no") + ('NDK_TARGET', 'toolchain to use for the NDK', os.environ.get("NDK_TARGET", "arm-linux-androideabi-4.9")), + ('NDK_TARGET_X86', 'toolchain to use for the NDK x86', os.environ.get("NDK_TARGET_X86", "x86-4.9")), + ('ndk_platform', 'compile for platform: (android-<api> , example: android-14)', "android-14"), + ('android_arch', 'select compiler architecture: (armv7/armv6/x86)', "armv7"), + ('android_neon', 'enable neon (armv7 only)', "yes"), + ('android_stl', 'enable STL support in android port (for modules)', "no") ] @@ -34,7 +34,7 @@ def get_flags(): return [ ('tools', 'no'), - ('openssl', 'builtin'), #use builtin openssl + ('openssl', 'builtin'), # use builtin openssl ] @@ -52,16 +52,16 @@ def configure(env): # Workaround for MinGW. See: # http://www.scons.org/wiki/LongCmdLinesOnWin32 import os - if (os.name=="nt"): + if (os.name == "nt"): import subprocess - def mySubProcess(cmdline,env): - #print "SPAWNED : " + cmdline + def mySubProcess(cmdline, env): + # print "SPAWNED : " + cmdline startupinfo = subprocess.STARTUPINFO() startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW proc = subprocess.Popen(cmdline, stdin=subprocess.PIPE, stdout=subprocess.PIPE, - stderr=subprocess.PIPE, startupinfo=startupinfo, shell = False, env = env) + stderr=subprocess.PIPE, startupinfo=startupinfo, shell=False, env=env) data, err = proc.communicate() rv = proc.wait() if rv: @@ -75,176 +75,176 @@ def configure(env): newargs = ' '.join(args[1:]) cmdline = cmd + " " + newargs - rv=0 - if len(cmdline) > 32000 and cmd.endswith("ar") : + rv = 0 + if len(cmdline) > 32000 and cmd.endswith("ar"): cmdline = cmd + " " + args[1] + " " + args[2] + " " - for i in range(3,len(args)) : - rv = mySubProcess( cmdline + args[i], env ) - if rv : + for i in range(3, len(args)): + rv = mySubProcess(cmdline + args[i], env) + if rv: break else: - rv = mySubProcess( cmdline, env ) + rv = mySubProcess(cmdline, env) return rv env['SPAWN'] = mySpawn - ndk_platform=env['ndk_platform'] + ndk_platform = env['ndk_platform'] - if env['android_arch'] not in ['armv7','armv6','x86']: - env['android_arch']='armv7' + if env['android_arch'] not in ['armv7', 'armv6', 'x86']: + env['android_arch'] = 'armv7' - if env['android_arch']=='x86': - env['NDK_TARGET']=env['NDK_TARGET_X86'] - env["x86_libtheora_opt_gcc"]=True + if env['android_arch'] == 'x86': + env['NDK_TARGET'] = env['NDK_TARGET_X86'] + env["x86_libtheora_opt_gcc"] = True if env['PLATFORM'] == 'win32': env.Tool('gcc') env['SHLIBSUFFIX'] = '.so' - neon_text="" - if env["android_arch"]=="armv7" and env['android_neon']=='yes': - neon_text=" (with neon)" - print("Godot Android!!!!! ("+env['android_arch']+")"+neon_text) + neon_text = "" + if env["android_arch"] == "armv7" and env['android_neon'] == 'yes': + neon_text = " (with neon)" + print("Godot Android!!!!! (" + env['android_arch'] + ")" + neon_text) env.Append(CPPPATH=['#platform/android']) - if env['android_arch']=='x86': - env.extra_suffix=".x86"+env.extra_suffix - elif env['android_arch']=='armv6': - env.extra_suffix=".armv6"+env.extra_suffix - elif env["android_arch"]=="armv7": - if env['android_neon']=='yes': - env.extra_suffix=".armv7.neon"+env.extra_suffix + if env['android_arch'] == 'x86': + env.extra_suffix = ".x86" + env.extra_suffix + elif env['android_arch'] == 'armv6': + env.extra_suffix = ".armv6" + env.extra_suffix + elif env["android_arch"] == "armv7": + if env['android_neon'] == 'yes': + env.extra_suffix = ".armv7.neon" + env.extra_suffix else: - env.extra_suffix=".armv7"+env.extra_suffix + env.extra_suffix = ".armv7" + env.extra_suffix - gcc_path=env["ANDROID_NDK_ROOT"]+"/toolchains/"+env["NDK_TARGET"]+"/prebuilt/"; + gcc_path = env["ANDROID_NDK_ROOT"] + "/toolchains/" + env["NDK_TARGET"] + "/prebuilt/"; if (sys.platform.startswith("linux")): if (platform.machine().endswith('64')): - gcc_path=gcc_path+"/linux-x86_64/bin" + gcc_path = gcc_path + "/linux-x86_64/bin" else: - gcc_path=gcc_path+"/linux-x86/bin" + gcc_path = gcc_path + "/linux-x86/bin" elif (sys.platform.startswith("darwin")): - gcc_path=gcc_path+"/darwin-x86_64/bin" + gcc_path = gcc_path + "/darwin-x86_64/bin" env['SHLINKFLAGS'][1] = '-shared' env['SHLIBSUFFIX'] = '.so' elif (sys.platform.startswith('win')): if (platform.machine().endswith('64')): - gcc_path=gcc_path+"/windows-x86_64/bin" + gcc_path = gcc_path + "/windows-x86_64/bin" else: - gcc_path=gcc_path+"/windows-x86/bin" - - env['ENV']['PATH'] = gcc_path+":"+env['ENV']['PATH'] - if env['android_arch']=='x86': - env['CC'] = gcc_path+'/i686-linux-android-gcc' - env['CXX'] = gcc_path+'/i686-linux-android-g++' - env['AR'] = gcc_path+"/i686-linux-android-ar" - env['RANLIB'] = gcc_path+"/i686-linux-android-ranlib" - env['AS'] = gcc_path+"/i686-linux-android-as" + gcc_path = gcc_path + "/windows-x86/bin" + + env['ENV']['PATH'] = gcc_path + ":" + env['ENV']['PATH'] + if env['android_arch'] == 'x86': + env['CC'] = gcc_path + '/i686-linux-android-gcc' + env['CXX'] = gcc_path + '/i686-linux-android-g++' + env['AR'] = gcc_path + "/i686-linux-android-ar" + env['RANLIB'] = gcc_path + "/i686-linux-android-ranlib" + env['AS'] = gcc_path + "/i686-linux-android-as" else: - env['CC'] = gcc_path+'/arm-linux-androideabi-gcc' - env['CXX'] = gcc_path+'/arm-linux-androideabi-g++' - env['AR'] = gcc_path+"/arm-linux-androideabi-ar" - env['RANLIB'] = gcc_path+"/arm-linux-androideabi-ranlib" - env['AS'] = gcc_path+"/arm-linux-androideabi-as" + env['CC'] = gcc_path + '/arm-linux-androideabi-gcc' + env['CXX'] = gcc_path + '/arm-linux-androideabi-g++' + env['AR'] = gcc_path + "/arm-linux-androideabi-ar" + env['RANLIB'] = gcc_path + "/arm-linux-androideabi-ranlib" + env['AS'] = gcc_path + "/arm-linux-androideabi-as" - if env['android_arch']=='x86': + if env['android_arch'] == 'x86': env['ARCH'] = 'arch-x86' else: env['ARCH'] = 'arch-arm' import string - #include path - gcc_include=env["ANDROID_NDK_ROOT"]+"/platforms/"+ndk_platform+"/"+env['ARCH'] +"/usr/include" - ld_sysroot=env["ANDROID_NDK_ROOT"]+"/platforms/"+ndk_platform+"/"+env['ARCH'] - #glue_include=env["ANDROID_NDK_ROOT"]+"/sources/android/native_app_glue" - ld_path=env["ANDROID_NDK_ROOT"]+"/platforms/"+ndk_platform+"/"+env['ARCH']+"/usr/lib" + # include path + gcc_include = env["ANDROID_NDK_ROOT"] + "/platforms/" + ndk_platform + "/" + env['ARCH'] + "/usr/include" + ld_sysroot = env["ANDROID_NDK_ROOT"] + "/platforms/" + ndk_platform + "/" + env['ARCH'] + # glue_include=env["ANDROID_NDK_ROOT"]+"/sources/android/native_app_glue" + ld_path = env["ANDROID_NDK_ROOT"] + "/platforms/" + ndk_platform + "/" + env['ARCH'] + "/usr/lib" env.Append(CPPPATH=[gcc_include]) # env['CCFLAGS'] = string.split('-DNO_THREADS -MMD -MP -MF -fpic -ffunction-sections -funwind-tables -fstack-protector -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ -Wno-psabi -march=armv5te -mtune=xscale -msoft-float -fno-exceptions -mthumb -fno-strict-aliasing -DANDROID -Wa,--noexecstack -DGLES2_ENABLED ') - env['neon_enabled']=False - if env['android_arch']=='x86': + env['neon_enabled'] = False + if env['android_arch'] == 'x86': env.Append(CCFLAGS=string.split('-DNO_STATVFS -fpic -ffunction-sections -funwind-tables -fstack-protector -fvisibility=hidden -D__GLIBC__ -Wno-psabi -ftree-vectorize -funsafe-math-optimizations -fno-strict-aliasing -DANDROID -Wa,--noexecstack -DGLES2_ENABLED')) - elif env["android_arch"]=="armv6": + elif env["android_arch"] == "armv6": env.Append(CCFLAGS=string.split('-DNO_STATVFS -fpic -ffunction-sections -funwind-tables -fstack-protector -fvisibility=hidden -D__ARM_ARCH_6__ -D__GLIBC__ -Wno-psabi -march=armv6 -mfpu=vfp -mfloat-abi=softfp -funsafe-math-optimizations -fno-strict-aliasing -DANDROID -Wa,--noexecstack -DGLES2_ENABLED')) - elif env["android_arch"]=="armv7": + elif env["android_arch"] == "armv7": env.Append(CCFLAGS=string.split('-DNO_STATVFS -fpic -ffunction-sections -funwind-tables -fstack-protector -fvisibility=hidden -D__ARM_ARCH_7__ -D__ARM_ARCH_7A__ -D__GLIBC__ -Wno-psabi -march=armv7-a -mfloat-abi=softfp -ftree-vectorize -funsafe-math-optimizations -fno-strict-aliasing -DANDROID -Wa,--noexecstack -DGLES2_ENABLED')) - if env['android_neon']=='yes': - env['neon_enabled']=True - env.Append(CCFLAGS=['-mfpu=neon','-D__ARM_NEON__']) + if env['android_neon'] == 'yes': + env['neon_enabled'] = True + env.Append(CCFLAGS=['-mfpu=neon', '-D__ARM_NEON__']) else: env.Append(CCFLAGS=['-mfpu=vfpv3-d16']) env.Append(LDPATH=[ld_path]) env.Append(LIBS=['OpenSLES']) # env.Append(LIBS=['c','m','stdc++','log','EGL','GLESv1_CM','GLESv2','OpenSLES','supc++','android']) - env.Append(LIBS=['EGL','OpenSLES','android']) - env.Append(LIBS=['c','m','stdc++','log','GLESv1_CM','GLESv2', 'z']) + env.Append(LIBS=['EGL', 'OpenSLES', 'android']) + env.Append(LIBS=['c', 'm', 'stdc++', 'log', 'GLESv1_CM', 'GLESv2', 'z']) - env["LINKFLAGS"]= string.split(" -g --sysroot="+ld_sysroot+" -Wl,--no-undefined -Wl,-z,noexecstack ") + env["LINKFLAGS"] = string.split(" -g --sysroot=" + ld_sysroot + " -Wl,--no-undefined -Wl,-z,noexecstack ") env.Append(LINKFLAGS=["-Wl,-soname,libgodot_android.so"]) - if (env["target"]=="release"): + if (env["target"] == "release"): - env.Append(CCFLAGS=['-O2', '-ffast-math','-fomit-frame-pointer']) + env.Append(CCFLAGS=['-O2', '-ffast-math', '-fomit-frame-pointer']) - elif (env["target"]=="release_debug"): + elif (env["target"] == "release_debug"): - env.Append(CCFLAGS=['-O2', '-ffast-math','-DDEBUG_ENABLED']) + env.Append(CCFLAGS=['-O2', '-ffast-math', '-DDEBUG_ENABLED']) - elif (env["target"]=="debug"): + elif (env["target"] == "debug"): env.Append(CCFLAGS=['-D_DEBUG', '-g1', '-Wall', '-O0', '-DDEBUG_ENABLED']) env.Append(CPPFLAGS=['-DDEBUG_MEMORY_ALLOC']) - env.Append(CPPFLAGS=['-DANDROID_ENABLED', '-DUNIX_ENABLED', '-DNO_FCNTL','-DMPC_FIXED_POINT']) + env.Append(CPPFLAGS=['-DANDROID_ENABLED', '-DUNIX_ENABLED', '-DNO_FCNTL', '-DMPC_FIXED_POINT']) # env.Append(CPPFLAGS=['-DANDROID_ENABLED', '-DUNIX_ENABLED','-DMPC_FIXED_POINT']) # TODO: Move that to opus module's config if("module_opus_enabled" in env and env["module_opus_enabled"] != "no"): - if (env["android_arch"]=="armv6" or env["android_arch"]=="armv7"): + if (env["android_arch"] == "armv6" or env["android_arch"] == "armv7"): env.Append(CFLAGS=["-DOPUS_ARM_OPT"]) - env.opus_fixed_point="yes" - - if (env['android_stl']=='yes'): - #env.Append(CCFLAGS=[env["ANDROID_NDK_ROOT"]+"/sources/cxx-stl/system/include"]) - env.Append(CPPPATH=[env["ANDROID_NDK_ROOT"]+"/sources/cxx-stl/gnu-libstdc++/4.9/include"]) - if env['android_arch']=='x86': - env.Append(CPPPATH=[env["ANDROID_NDK_ROOT"]+"/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86/include"]) - env.Append(LIBPATH=[env["ANDROID_NDK_ROOT"]+"/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86"]) - elif env['android_arch']=='armv6': - env.Append(CPPPATH=[env["ANDROID_NDK_ROOT"]+"/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi/include"]) - env.Append(LIBPATH=[env["ANDROID_NDK_ROOT"]+"/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi"]) - elif env["android_arch"]=="armv7": - env.Append(CPPPATH=[env["ANDROID_NDK_ROOT"]+"/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/include"]) - env.Append(LIBPATH=[env["ANDROID_NDK_ROOT"]+"/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a"]) - - env.Append(LIBS=["gnustl_static","supc++"]) - env.Append(CPPPATH=[env["ANDROID_NDK_ROOT"]+"/sources/cpufeatures"]) - - #env.Append(CCFLAGS=["-I"+env["ANDROID_NDK_ROOT"]+"/sources/cxx-stl/stlport/stlport"]) - #env.Append(CCFLAGS=["-I"+env["ANDROID_NDK_ROOT"]+"/sources/cxx-stl/gnu-libstdc++/libs/armeabi/include"]) - #env.Append(LINKFLAGS=[env["ANDROID_NDK_ROOT"]+"/sources/cxx-stl/gnu-libstdc++/libs/armeabi/libstdc++.a"]) + env.opus_fixed_point = "yes" + + if (env['android_stl'] == 'yes'): + # env.Append(CCFLAGS=[env["ANDROID_NDK_ROOT"]+"/sources/cxx-stl/system/include"]) + env.Append(CPPPATH=[env["ANDROID_NDK_ROOT"] + "/sources/cxx-stl/gnu-libstdc++/4.9/include"]) + if env['android_arch'] == 'x86': + env.Append(CPPPATH=[env["ANDROID_NDK_ROOT"] + "/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86/include"]) + env.Append(LIBPATH=[env["ANDROID_NDK_ROOT"] + "/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86"]) + elif env['android_arch'] == 'armv6': + env.Append(CPPPATH=[env["ANDROID_NDK_ROOT"] + "/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi/include"]) + env.Append(LIBPATH=[env["ANDROID_NDK_ROOT"] + "/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi"]) + elif env["android_arch"] == "armv7": + env.Append(CPPPATH=[env["ANDROID_NDK_ROOT"] + "/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/include"]) + env.Append(LIBPATH=[env["ANDROID_NDK_ROOT"] + "/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a"]) + + env.Append(LIBS=["gnustl_static", "supc++"]) + env.Append(CPPPATH=[env["ANDROID_NDK_ROOT"] + "/sources/cpufeatures"]) + + # env.Append(CCFLAGS=["-I"+env["ANDROID_NDK_ROOT"]+"/sources/cxx-stl/stlport/stlport"]) + # env.Append(CCFLAGS=["-I"+env["ANDROID_NDK_ROOT"]+"/sources/cxx-stl/gnu-libstdc++/libs/armeabi/include"]) + # env.Append(LINKFLAGS=[env["ANDROID_NDK_ROOT"]+"/sources/cxx-stl/gnu-libstdc++/libs/armeabi/libstdc++.a"]) else: - env.Append(CPPPATH=[env["ANDROID_NDK_ROOT"]+"/sources/cxx-stl/gnu-libstdc++/4.9/include"]) - env.Append(CPPPATH=[env["ANDROID_NDK_ROOT"]+"/sources/cpufeatures"]) - if env['android_arch']=='x86': - env.Append(LIBPATH=[env["ANDROID_NDK_ROOT"]+"/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86"]) - elif env["android_arch"]=="armv6": - env.Append(LIBPATH=[env["ANDROID_NDK_ROOT"]+"/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi"]) - elif env["android_arch"]=="armv7": - env.Append(LIBPATH=[env["ANDROID_NDK_ROOT"]+"/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a"]) + env.Append(CPPPATH=[env["ANDROID_NDK_ROOT"] + "/sources/cxx-stl/gnu-libstdc++/4.9/include"]) + env.Append(CPPPATH=[env["ANDROID_NDK_ROOT"] + "/sources/cpufeatures"]) + if env['android_arch'] == 'x86': + env.Append(LIBPATH=[env["ANDROID_NDK_ROOT"] + "/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86"]) + elif env["android_arch"] == "armv6": + env.Append(LIBPATH=[env["ANDROID_NDK_ROOT"] + "/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi"]) + elif env["android_arch"] == "armv7": + env.Append(LIBPATH=[env["ANDROID_NDK_ROOT"] + "/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a"]) env.Append(LIBS=['gnustl_static']) - env.Append(CCFLAGS=["-fno-exceptions",'-DNO_SAFE_CAST']) + env.Append(CCFLAGS=["-fno-exceptions", '-DNO_SAFE_CAST']) import methods - env.Append( BUILDERS = { 'GLSL120' : env.Builder(action = methods.build_legacygl_headers, suffix = 'glsl.h',src_suffix = '.glsl') } ) - env.Append( BUILDERS = { 'GLSL' : env.Builder(action = methods.build_glsl_headers, suffix = 'glsl.h',src_suffix = '.glsl') } ) - env.Append( BUILDERS = { 'GLSL120GLES' : env.Builder(action = methods.build_gles2_headers, suffix = 'glsl.h',src_suffix = '.glsl') } ) + env.Append(BUILDERS={'GLSL120': env.Builder(action=methods.build_legacygl_headers, suffix='glsl.h', src_suffix='.glsl')}) + env.Append(BUILDERS={'GLSL': env.Builder(action=methods.build_glsl_headers, suffix='glsl.h', src_suffix='.glsl')}) + env.Append(BUILDERS={'GLSL120GLES': env.Builder(action=methods.build_gles2_headers, suffix='glsl.h', src_suffix='.glsl')}) env.use_windows_spawn_fix() diff --git a/platform/bb10/detect.py b/platform/bb10/detect.py index 76ccbe3af6..ed320bebc1 100644 --- a/platform/bb10/detect.py +++ b/platform/bb10/detect.py @@ -53,7 +53,7 @@ def configure(env): env['OBJSUFFIX'] = ".qnx.${qnx_target}.o" env['LIBSUFFIX'] = ".qnx.${qnx_target}.a" env['PROGSUFFIX'] = ".qnx.${qnx_target}" - print("PROGSUFFIX: "+env['PROGSUFFIX']+" target: "+env['qnx_target']) + print("PROGSUFFIX: " + env['PROGSUFFIX'] + " target: " + env['qnx_target']) env.PrependENVPath('PATH', env['QNX_CONFIGURATION'] + '/bin') env.PrependENVPath('PATH', env['QNX_CONFIGURATION'] + '/usr/bin') @@ -66,23 +66,23 @@ def configure(env): env['AR'] = '$qnx_prefix-ar' env['RANLIB'] = '$qnx_prefix-ranlib' - env.Append(CPPPATH = ['#platform/bb10']) - env.Append(LIBPATH = ['#platform/bb10/lib/$qnx_target', '#platform/bb10/lib/$qnx_target_ver']) - env.Append(CCFLAGS = string.split('-DBB10_ENABLED -DUNIX_ENABLED -DGLES2_ENABLED -DGLES1_ENABLED -D_LITTLE_ENDIAN -DNO_THREADS -DNO_FCNTL')) - if env['bb10_exceptions']=="yes": - env.Append(CCFLAGS = ['-fexceptions']) + env.Append(CPPPATH=['#platform/bb10']) + env.Append(LIBPATH=['#platform/bb10/lib/$qnx_target', '#platform/bb10/lib/$qnx_target_ver']) + env.Append(CCFLAGS=string.split('-DBB10_ENABLED -DUNIX_ENABLED -DGLES2_ENABLED -DGLES1_ENABLED -D_LITTLE_ENDIAN -DNO_THREADS -DNO_FCNTL')) + if env['bb10_exceptions'] == "yes": + env.Append(CCFLAGS=['-fexceptions']) else: - env.Append(CCFLAGS = ['-fno-exceptions']) + env.Append(CCFLAGS=['-fno-exceptions']) - #env.Append(LINKFLAGS = string.split() + # env.Append(LINKFLAGS = string.split() - if (env["target"]=="release"): + if (env["target"] == "release"): - env.Append(CCFLAGS=['-O3','-DRELEASE_BUILD']) + env.Append(CCFLAGS=['-O3', '-DRELEASE_BUILD']) - elif (env["target"]=="debug"): + elif (env["target"] == "debug"): - env.Append(CCFLAGS=['-g', '-O0','-DDEBUG_ENABLED', '-D_DEBUG']) + env.Append(CCFLAGS=['-g', '-O0', '-DDEBUG_ENABLED', '-D_DEBUG']) env.Append(LINKFLAGS=['-g']) env.Append(LIBS=['bps', 'pps', 'screen', 'socket', 'EGL', 'GLESv2', 'GLESv1_CM', 'm', 'asound']) diff --git a/platform/haiku/SCsub b/platform/haiku/SCsub index bac287ef62..23e5e2e711 100644 --- a/platform/haiku/SCsub +++ b/platform/haiku/SCsub @@ -20,7 +20,7 @@ target = env.Program( command = env.Command('#bin/godot.rsrc', '#platform/haiku/godot.rdef', ['rc -o $TARGET $SOURCE']) -def addResourcesAction(target = None, source = None, env = None): +def addResourcesAction(target=None, source=None, env=None): return env.Execute('xres -o ' + File(target)[0].path + ' bin/godot.rsrc') env.AddPostAction(target, addResourcesAction) diff --git a/platform/haiku/detect.py b/platform/haiku/detect.py index aef423b404..e64be0a188 100644 --- a/platform/haiku/detect.py +++ b/platform/haiku/detect.py @@ -18,7 +18,7 @@ def can_build(): def get_opts(): return [ - ('debug_release', 'Add debug symbols to release version','no') + ('debug_release', 'Add debug symbols to release version', 'no') ] def get_flags(): @@ -28,34 +28,34 @@ def get_flags(): def configure(env): is64 = sys.maxsize > 2**32 - if (env["bits"]=="default"): + if (env["bits"] == "default"): if (is64): - env["bits"]="64" + env["bits"] = "64" else: - env["bits"]="32" + env["bits"] = "32" - env.Append(CPPPATH = ['#platform/haiku']) + env.Append(CPPPATH=['#platform/haiku']) env["CC"] = "gcc-x86" env["CXX"] = "g++-x86" - if (env["target"]=="release"): - if (env["debug_release"]=="yes"): + if (env["target"] == "release"): + if (env["debug_release"] == "yes"): env.Append(CCFLAGS=['-g2']) else: - env.Append(CCFLAGS=['-O3','-ffast-math']) - elif (env["target"]=="release_debug"): - env.Append(CCFLAGS=['-O2','-ffast-math','-DDEBUG_ENABLED']) - elif (env["target"]=="debug"): - env.Append(CCFLAGS=['-g2', '-Wall','-DDEBUG_ENABLED','-DDEBUG_MEMORY_ENABLED']) - - #env.Append(CCFLAGS=['-DFREETYPE_ENABLED']) - env.Append(CPPFLAGS = ['-DPTHREAD_NO_RENAME']) # TODO: enable when we have pthread_setname_np - env.Append(CPPFLAGS = ['-DOPENGL_ENABLED', '-DMEDIA_KIT_ENABLED']) - env.Append(CPPFLAGS = ['-DUNIX_ENABLED', '-DGLES2_ENABLED', '-DGLES_OVER_GL']) - env.Append(LIBS = ['be', 'game', 'media', 'network', 'bnetapi', 'z', 'GL']) + env.Append(CCFLAGS=['-O3', '-ffast-math']) + elif (env["target"] == "release_debug"): + env.Append(CCFLAGS=['-O2', '-ffast-math', '-DDEBUG_ENABLED']) + elif (env["target"] == "debug"): + env.Append(CCFLAGS=['-g2', '-Wall', '-DDEBUG_ENABLED', '-DDEBUG_MEMORY_ENABLED']) + + # env.Append(CCFLAGS=['-DFREETYPE_ENABLED']) + env.Append(CPPFLAGS=['-DPTHREAD_NO_RENAME']) # TODO: enable when we have pthread_setname_np + env.Append(CPPFLAGS=['-DOPENGL_ENABLED', '-DMEDIA_KIT_ENABLED']) + env.Append(CPPFLAGS=['-DUNIX_ENABLED', '-DGLES2_ENABLED', '-DGLES_OVER_GL']) + env.Append(LIBS=['be', 'game', 'media', 'network', 'bnetapi', 'z', 'GL']) import methods - env.Append(BUILDERS = {'GLSL120' : env.Builder(action = methods.build_legacygl_headers, suffix = 'glsl.h',src_suffix = '.glsl')}) - env.Append(BUILDERS = {'GLSL' : env.Builder(action = methods.build_glsl_headers, suffix = 'glsl.h',src_suffix = '.glsl')}) - env.Append(BUILDERS = {'GLSL120GLES' : env.Builder(action = methods.build_gles2_headers, suffix = 'glsl.h',src_suffix = '.glsl')}) + env.Append(BUILDERS={'GLSL120': env.Builder(action=methods.build_legacygl_headers, suffix='glsl.h', src_suffix='.glsl')}) + env.Append(BUILDERS={'GLSL': env.Builder(action=methods.build_glsl_headers, suffix='glsl.h', src_suffix='.glsl')}) + env.Append(BUILDERS={'GLSL120GLES': env.Builder(action=methods.build_gles2_headers, suffix='glsl.h', src_suffix='.glsl')}) diff --git a/platform/iphone/SCsub b/platform/iphone/SCsub index 1d7797ebd3..7e71faa377 100644 --- a/platform/iphone/SCsub +++ b/platform/iphone/SCsub @@ -19,7 +19,7 @@ iphone_lib = [ 'ios.mm', ] -#env.Depends('#core/math/vector3.h', 'vector3_psp.h') +# env.Depends('#core/math/vector3.h', 'vector3_psp.h') #iphone_lib = env.Library('iphone', iphone_lib) @@ -30,7 +30,7 @@ if env['ios_gles22_override'] == "yes": env_ios.Append(CPPFLAGS=['-DGLES2_OVERRIDE']) -#if env['ios_appirater'] == "yes": +# if env['ios_appirater'] == "yes": # env_ios.Append(CPPFLAGS=['-DAPPIRATER_ENABLED']) @@ -38,5 +38,5 @@ obj = env_ios.Object('godot_iphone.cpp') prog = None prog = env_ios.Program('#bin/godot', [obj] + iphone_lib) -action = "$IPHONEPATH/usr/bin/dsymutil "+File(prog)[0].path+" -o " + File(prog)[0].path + ".dSYM" +action = "$IPHONEPATH/usr/bin/dsymutil " + File(prog)[0].path + " -o " + File(prog)[0].path + ".dSYM" env.AddPostAction(prog, action) diff --git a/platform/iphone/detect.py b/platform/iphone/detect.py index cea79d0f21..541487d586 100644 --- a/platform/iphone/detect.py +++ b/platform/iphone/detect.py @@ -39,7 +39,7 @@ def get_flags(): ('tools', 'no'), ('webp', 'yes'), ('builtin_zlib', 'yes'), - ('openssl','builtin'), #use builtin openssl + ('openssl', 'builtin'), # use builtin openssl ] @@ -48,7 +48,7 @@ def configure(env): env.Append(CPPPATH=['#platform/iphone']) - env['ENV']['PATH'] = env['IPHONEPATH']+"/Developer/usr/bin/:"+env['ENV']['PATH'] + env['ENV']['PATH'] = env['IPHONEPATH'] + "/Developer/usr/bin/:" + env['ENV']['PATH'] env['CC'] = '$IPHONEPATH/usr/bin/${ios_triple}clang' env['CXX'] = '$IPHONEPATH/usr/bin/${ios_triple}clang++' @@ -56,21 +56,21 @@ def configure(env): env['RANLIB'] = '$IPHONEPATH/usr/bin/${ios_triple}ranlib' import string - if (env["ios_sim"]=="yes" or env["arch"] == "x86"): # i386, simulator - env["arch"]="x86" - env["bits"]="32" + if (env["ios_sim"] == "yes" or env["arch"] == "x86"): # i386, simulator + env["arch"] = "x86" + env["bits"] = "32" env['CCFLAGS'] = string.split('-arch i386 -fobjc-abi-version=2 -fobjc-legacy-dispatch -fmessage-length=0 -fpascal-strings -fasm-blocks -Wall -D__IPHONE_OS_VERSION_MIN_REQUIRED=40100 -isysroot $IPHONESDK -mios-simulator-version-min=4.3 -DCUSTOM_MATRIX_TRANSFORM_H=\\\"build/iphone/matrix4_iphone.h\\\" -DCUSTOM_VECTOR3_TRANSFORM_H=\\\"build/iphone/vector3_iphone.h\\\"') - elif (env["arch"]=="arm64"): # arm64 + elif (env["arch"] == "arm64"): # arm64 env["bits"] = "64" env['CCFLAGS'] = string.split('-fno-objc-arc -arch arm64 -fmessage-length=0 -fno-strict-aliasing -fdiagnostics-print-source-range-info -fdiagnostics-show-category=id -fdiagnostics-parseable-fixits -Wno-trigraphs -fpascal-strings -Wmissing-prototypes -Wreturn-type -Wparentheses -Wswitch -Wno-unused-parameter -Wunused-variable -Wunused-value -Wno-shorten-64-to-32 -fvisibility=hidden -Wno-sign-conversion -MMD -MT dependencies -miphoneos-version-min=5.1.1 -isysroot $IPHONESDK') env.Append(CPPFLAGS=['-DNEED_LONG_INT']) env.Append(CPPFLAGS=['-DLIBYUV_DISABLE_NEON']) - else: # armv7 + else: # armv7 env["arch"] = "arm" env["bits"] = "32" env['CCFLAGS'] = string.split('-fno-objc-arc -arch armv7 -fmessage-length=0 -fno-strict-aliasing -fdiagnostics-print-source-range-info -fdiagnostics-show-category=id -fdiagnostics-parseable-fixits -Wno-trigraphs -fpascal-strings -Wmissing-prototypes -Wreturn-type -Wparentheses -Wswitch -Wno-unused-parameter -Wunused-variable -Wunused-value -Wno-shorten-64-to-32 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk -fvisibility=hidden -Wno-sign-conversion -mthumb "-DIBOutlet=__attribute__((iboutlet))" "-DIBOutletCollection(ClassName)=__attribute__((iboutletcollection(ClassName)))" "-DIBAction=void)__attribute__((ibaction)" -miphoneos-version-min=5.1.1 -MMD -MT dependencies -isysroot $IPHONESDK') - if (env["arch"]=="x86"): + if (env["arch"] == "x86"): env['IPHONEPLATFORM'] = 'iPhoneSimulator' env.Append(LINKFLAGS=['-arch', 'i386', '-mios-simulator-version-min=4.3', '-isysroot', '$IPHONESDK', @@ -92,7 +92,7 @@ def configure(env): '-framework', 'SystemConfiguration', '-F$IPHONESDK', ]) - elif (env["arch"]=="arm64"): + elif (env["arch"] == "arm64"): env.Append(LINKFLAGS=['-arch', 'arm64', '-Wl,-dead_strip', '-miphoneos-version-min=5.1.1', '-isysroot', '$IPHONESDK', #'-stdlib=libc++', @@ -139,39 +139,39 @@ def configure(env): if env['icloud'] == 'yes': env.Append(CPPFLAGS=['-DICLOUD_ENABLED']) - env.Append(CPPPATH = ['$IPHONESDK/usr/include', '$IPHONESDK/System/Library/Frameworks/OpenGLES.framework/Headers', '$IPHONESDK/System/Library/Frameworks/AudioUnit.framework/Headers']) + env.Append(CPPPATH=['$IPHONESDK/usr/include', '$IPHONESDK/System/Library/Frameworks/OpenGLES.framework/Headers', '$IPHONESDK/System/Library/Frameworks/AudioUnit.framework/Headers']) - if (env["target"]=="release"): + if (env["target"] == "release"): - env.Append(CCFLAGS=['-O3', '-DNS_BLOCK_ASSERTIONS=1','-Wall', '-gdwarf-2']) # removed -ffast-math - env.Append(LINKFLAGS=['-O3']) # + env.Append(CCFLAGS=['-O3', '-DNS_BLOCK_ASSERTIONS=1', '-Wall', '-gdwarf-2']) # removed -ffast-math + env.Append(LINKFLAGS=['-O3']) elif env["target"] == "release_debug": - env.Append(CCFLAGS=['-Os', '-DNS_BLOCK_ASSERTIONS=1','-Wall','-DDEBUG_ENABLED']) + env.Append(CCFLAGS=['-Os', '-DNS_BLOCK_ASSERTIONS=1', '-Wall', '-DDEBUG_ENABLED']) env.Append(LINKFLAGS=['-Os']) env.Append(CPPFLAGS=['-DDEBUG_MEMORY_ENABLED']) - elif (env["target"]=="debug"): + elif (env["target"] == "debug"): env.Append(CCFLAGS=['-D_DEBUG', '-DDEBUG=1', '-gdwarf-2', '-Wall', '-O0', '-DDEBUG_ENABLED']) env.Append(CPPFLAGS=['-DDEBUG_MEMORY_ENABLED']) - elif (env["target"]=="profile"): + elif (env["target"] == "profile"): - env.Append(CCFLAGS=['-g','-pg', '-Os']) + env.Append(CCFLAGS=['-g', '-pg', '-Os']) env.Append(LINKFLAGS=['-pg']) - if (env["ios_sim"]=="yes"): #TODO: Check if needed? + if (env["ios_sim"] == "yes"): # TODO: Check if needed? env['ENV']['MACOSX_DEPLOYMENT_TARGET'] = '10.6' env['ENV']['CODESIGN_ALLOCATE'] = '/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate' env.Append(CPPFLAGS=['-DIPHONE_ENABLED', '-DUNIX_ENABLED', '-DGLES2_ENABLED', '-DMPC_FIXED_POINT']) # TODO: Move that to opus module's config if("module_opus_enabled" in env and env["module_opus_enabled"] != "no"): - env.opus_fixed_point="yes" - if env["arch"]=="x86": + env.opus_fixed_point = "yes" + if env["arch"] == "x86": pass - elif(env["arch"]=="arm64"): + elif(env["arch"] == "arm64"): env.Append(CFLAGS=["-DOPUS_ARM64_OPT"]) else: env.Append(CFLAGS=["-DOPUS_ARM_OPT"]) @@ -180,10 +180,10 @@ def configure(env): env.Append(CPPFLAGS=['-fexceptions']) else: env.Append(CPPFLAGS=['-fno-exceptions']) - #env['neon_enabled']=True + # env['neon_enabled']=True env['S_compiler'] = '$IPHONEPATH/Developer/usr/bin/gcc' import methods - env.Append( BUILDERS = { 'GLSL120' : env.Builder(action = methods.build_legacygl_headers, suffix = 'glsl.h',src_suffix = '.glsl') } ) - env.Append( BUILDERS = { 'GLSL' : env.Builder(action = methods.build_glsl_headers, suffix = 'glsl.h',src_suffix = '.glsl') } ) - env.Append( BUILDERS = { 'GLSL120GLES' : env.Builder(action = methods.build_gles2_headers, suffix = 'glsl.h',src_suffix = '.glsl') } ) + env.Append(BUILDERS={'GLSL120': env.Builder(action=methods.build_legacygl_headers, suffix='glsl.h', src_suffix='.glsl')}) + env.Append(BUILDERS={'GLSL': env.Builder(action=methods.build_glsl_headers, suffix='glsl.h', src_suffix='.glsl')}) + env.Append(BUILDERS={'GLSL120GLES': env.Builder(action=methods.build_gles2_headers, suffix='glsl.h', src_suffix='.glsl')}) diff --git a/platform/javascript/SCsub b/platform/javascript/SCsub index 07852ac206..5d5cd1590a 100644 --- a/platform/javascript/SCsub +++ b/platform/javascript/SCsub @@ -14,24 +14,24 @@ env_javascript = env.Clone() if env['target'] == "profile": env_javascript.Append(CPPFLAGS=['-DPROFILER_ENABLED']) -javascript_objects=[] +javascript_objects = [] for x in javascript_files: - javascript_objects.append( env_javascript.Object( x ) ) + javascript_objects.append(env_javascript.Object(x)) -env.Append(LINKFLAGS=["-s","EXPORTED_FUNCTIONS=\"['_main','_audio_server_mix_function','_main_after_fs_sync']\""]) -env.Append(LINKFLAGS=["--shell-file",'"platform/javascript/godot_shell.html"']) +env.Append(LINKFLAGS=["-s", "EXPORTED_FUNCTIONS=\"['_main','_audio_server_mix_function','_main_after_fs_sync']\""]) +env.Append(LINKFLAGS=["--shell-file", '"platform/javascript/godot_shell.html"']) -build = env.Program('#bin/godot',javascript_objects,PROGSUFFIX=env["PROGSUFFIX"]+".html") +build = env.Program('#bin/godot', javascript_objects, PROGSUFFIX=env["PROGSUFFIX"] + ".html") def make_html_shell(target, source, env): - html_path = target[0].rstr() - assert html_path[:4] == 'bin/' - assert html_path[-5:] == '.html' - basename = html_path[4:-5] - with open(html_path, 'r+') as html_file: - fixed_html = html_file.read().replace('.html.mem', '.mem').replace(basename, '$GODOT_BASE') - html_file.seek(0) - html_file.truncate() - html_file.write(fixed_html) + html_path = target[0].rstr() + assert html_path[:4] == 'bin/' + assert html_path[-5:] == '.html' + basename = html_path[4:-5] + with open(html_path, 'r+') as html_file: + fixed_html = html_file.read().replace('.html.mem', '.mem').replace(basename, '$GODOT_BASE') + html_file.seek(0) + html_file.truncate() + html_file.write(fixed_html) env.AddPostAction(build, Action(make_html_shell, "Creating HTML shell file")) diff --git a/platform/javascript/detect.py b/platform/javascript/detect.py index ce6149c250..56b41a49ac 100644 --- a/platform/javascript/detect.py +++ b/platform/javascript/detect.py @@ -18,8 +18,8 @@ def can_build(): def get_opts(): return [ - ['wasm','Compile to WebAssembly','no'], - ['javascript_eval','Enable JavaScript eval interface','yes'], + ['wasm', 'Compile to WebAssembly', 'no'], + ['javascript_eval', 'Enable JavaScript eval interface', 'yes'], ] def get_flags(): @@ -40,13 +40,13 @@ def configure(env): env.Append(CPPPATH=['#platform/javascript']) - em_path=os.environ["EMSCRIPTEN_ROOT"] + em_path = os.environ["EMSCRIPTEN_ROOT"] - env['ENV']['PATH'] = em_path+":"+env['ENV']['PATH'] - env['CC'] = em_path+'/emcc' - env['CXX'] = em_path+'/emcc' + env['ENV']['PATH'] = em_path + ":" + env['ENV']['PATH'] + env['CC'] = em_path + '/emcc' + env['CXX'] = em_path + '/emcc' #env['AR'] = em_path+"/emar" - env['AR'] = em_path+"/emcc" + env['AR'] = em_path + "/emcc" env['ARFLAGS'] = "-o" # env['RANLIB'] = em_path+"/emranlib" @@ -60,11 +60,11 @@ def configure(env): # env["LINKFLAGS"]= string.split(" -g --sysroot="+ld_sysroot+" -Wl,--no-undefined -Wl,-z,noexecstack ") - if (env["target"]=="release"): + if (env["target"] == "release"): env.Append(CCFLAGS=['-O2']) - elif (env["target"]=="release_debug"): - env.Append(CCFLAGS=['-O2','-DDEBUG_ENABLED']) - elif (env["target"]=="debug"): + elif (env["target"] == "release_debug"): + env.Append(CCFLAGS=['-O2', '-DDEBUG_ENABLED']) + elif (env["target"] == "debug"): env.Append(CCFLAGS=['-D_DEBUG', '-Wall', '-O2', '-DDEBUG_ENABLED']) #env.Append(CCFLAGS=['-D_DEBUG', '-Wall', '-g4', '-DDEBUG_ENABLED']) env.Append(CPPFLAGS=['-DDEBUG_MEMORY_ALLOC']) @@ -73,33 +73,33 @@ def configure(env): if("module_opus_enabled" in env and env["module_opus_enabled"] != "no"): env.opus_fixed_point = "yes" - env.Append(CPPFLAGS=["-fno-exceptions",'-DNO_SAFE_CAST','-fno-rtti']) - env.Append(CPPFLAGS=['-DJAVASCRIPT_ENABLED', '-DUNIX_ENABLED', '-DPTHREAD_NO_RENAME', '-DNO_FCNTL','-DMPC_FIXED_POINT','-DTYPED_METHOD_BIND','-DNO_THREADS']) + env.Append(CPPFLAGS=["-fno-exceptions", '-DNO_SAFE_CAST', '-fno-rtti']) + env.Append(CPPFLAGS=['-DJAVASCRIPT_ENABLED', '-DUNIX_ENABLED', '-DPTHREAD_NO_RENAME', '-DNO_FCNTL', '-DMPC_FIXED_POINT', '-DTYPED_METHOD_BIND', '-DNO_THREADS']) env.Append(CPPFLAGS=['-DGLES2_ENABLED']) env.Append(CPPFLAGS=['-DGLES_NO_CLIENT_ARRAYS']) - env.Append(CPPFLAGS=['-s','FULL_ES2=1']) + env.Append(CPPFLAGS=['-s', 'FULL_ES2=1']) # env.Append(CPPFLAGS=['-DANDROID_ENABLED', '-DUNIX_ENABLED','-DMPC_FIXED_POINT']) if env['wasm'] == 'yes': - env.Append(LINKFLAGS=['-s','BINARYEN=1']) - env.Append(LINKFLAGS=['-s','\'BINARYEN_METHOD="native-wasm"\'']) - env["PROGSUFFIX"]+=".webassembly" + env.Append(LINKFLAGS=['-s', 'BINARYEN=1']) + env.Append(LINKFLAGS=['-s', '\'BINARYEN_METHOD="native-wasm"\'']) + env["PROGSUFFIX"] += ".webassembly" else: - env.Append(CPPFLAGS=['-s','ASM_JS=1']) - env.Append(LINKFLAGS=['-s','ASM_JS=1']) + env.Append(CPPFLAGS=['-s', 'ASM_JS=1']) + env.Append(LINKFLAGS=['-s', 'ASM_JS=1']) if env['javascript_eval'] == 'yes': env.Append(CPPFLAGS=['-DJAVASCRIPT_EVAL_ENABLED']) env.Append(LINKFLAGS=['-O2']) - #env.Append(LINKFLAGS=['-g4']) + # env.Append(LINKFLAGS=['-g4']) - #print "CCCOM is:", env.subst('$CCCOM') - #print "P: ", env['p'], " Platofrm: ", env['platform'] + # print "CCCOM is:", env.subst('$CCCOM') + # print "P: ", env['p'], " Platofrm: ", env['platform'] import methods - env.Append( BUILDERS = { 'GLSL120' : env.Builder(action = methods.build_legacygl_headers, suffix = 'glsl.h',src_suffix = '.glsl') } ) - env.Append( BUILDERS = { 'GLSL' : env.Builder(action = methods.build_glsl_headers, suffix = 'glsl.h',src_suffix = '.glsl') } ) - env.Append( BUILDERS = { 'GLSL120GLES' : env.Builder(action = methods.build_gles2_headers, suffix = 'glsl.h',src_suffix = '.glsl') } ) + env.Append(BUILDERS={'GLSL120': env.Builder(action=methods.build_legacygl_headers, suffix='glsl.h', src_suffix='.glsl')}) + env.Append(BUILDERS={'GLSL': env.Builder(action=methods.build_glsl_headers, suffix='glsl.h', src_suffix='.glsl')}) + env.Append(BUILDERS={'GLSL120GLES': env.Builder(action=methods.build_gles2_headers, suffix='glsl.h', src_suffix='.glsl')}) #env.Append( BUILDERS = { 'HLSL9' : env.Builder(action = methods.build_hlsl_dx9_headers, suffix = 'hlsl.h',src_suffix = '.hlsl') } ) diff --git a/platform/osx/SCsub b/platform/osx/SCsub index 68484b7288..c8e0e17612 100644 --- a/platform/osx/SCsub +++ b/platform/osx/SCsub @@ -12,4 +12,4 @@ files = [ 'joystick_osx.cpp', ] -env.Program('#bin/godot',files) +env.Program('#bin/godot', files) diff --git a/platform/osx/detect.py b/platform/osx/detect.py index 358c4ef015..ddb27742a0 100644 --- a/platform/osx/detect.py +++ b/platform/osx/detect.py @@ -20,8 +20,8 @@ def can_build(): def get_opts(): return [ - ('force_64_bits','Force 64 bits binary','no'), - ('osxcross_sdk','OSXCross SDK version','darwin14'), + ('force_64_bits', 'Force 64 bits binary', 'no'), + ('osxcross_sdk', 'OSXCross SDK version', 'darwin14'), ] @@ -36,67 +36,67 @@ def configure(env): env.Append(CPPPATH=['#platform/osx']) - if (env["bits"]=="default"): - env["bits"]="32" + if (env["bits"] == "default"): + env["bits"] = "32" - if (env["target"]=="release"): + if (env["target"] == "release"): - env.Append(CCFLAGS=['-O2','-ffast-math','-fomit-frame-pointer','-ftree-vectorize','-msse2']) + env.Append(CCFLAGS=['-O2', '-ffast-math', '-fomit-frame-pointer', '-ftree-vectorize', '-msse2']) - elif (env["target"]=="release_debug"): + elif (env["target"] == "release_debug"): - env.Append(CCFLAGS=['-O2','-DDEBUG_ENABLED']) + env.Append(CCFLAGS=['-O2', '-DDEBUG_ENABLED']) - elif (env["target"]=="debug"): + elif (env["target"] == "debug"): - env.Append(CCFLAGS=['-g3', '-Wall','-DDEBUG_ENABLED','-DDEBUG_MEMORY_ENABLED']) + env.Append(CCFLAGS=['-g3', '-Wall', '-DDEBUG_ENABLED', '-DDEBUG_MEMORY_ENABLED']) if (not os.environ.has_key("OSXCROSS_ROOT")): - #regular native build - if (env["bits"]=="64"): + # regular native build + if (env["bits"] == "64"): env.Append(CCFLAGS=['-arch', 'x86_64']) env.Append(LINKFLAGS=['-arch', 'x86_64']) - elif (env["bits"]=="32"): + elif (env["bits"] == "32"): env.Append(CCFLAGS=['-arch', 'i386']) env.Append(LINKFLAGS=['-arch', 'i386']) else: env.Append(CCFLAGS=['-arch', 'i386', '-arch', 'x86_64']) env.Append(LINKFLAGS=['-arch', 'i386', '-arch', 'x86_64']) else: - #osxcross build - root=os.environ.get("OSXCROSS_ROOT",0) - if env["bits"]=="64": - basecmd=root+"/target/bin/x86_64-apple-"+env["osxcross_sdk"]+"-" + # osxcross build + root = os.environ.get("OSXCROSS_ROOT", 0) + if env["bits"] == "64": + basecmd = root + "/target/bin/x86_64-apple-" + env["osxcross_sdk"] + "-" else: - basecmd=root+"/target/bin/i386-apple-"+env["osxcross_sdk"]+"-" + basecmd = root + "/target/bin/i386-apple-" + env["osxcross_sdk"] + "-" - env['CC'] = basecmd+"cc" - env['CXX'] = basecmd+"c++" - env['AR'] = basecmd+"ar" - env['RANLIB'] = basecmd+"ranlib" - env['AS'] = basecmd+"as" + env['CC'] = basecmd + "cc" + env['CXX'] = basecmd + "c++" + env['AR'] = basecmd + "ar" + env['RANLIB'] = basecmd + "ranlib" + env['AS'] = basecmd + "as" env.Append(CPPFLAGS=["-DAPPLE_STYLE_KEYS"]) - env.Append(CPPFLAGS=['-DUNIX_ENABLED','-DGLES2_ENABLED','-DOSX_ENABLED']) + env.Append(CPPFLAGS=['-DUNIX_ENABLED', '-DGLES2_ENABLED', '-DOSX_ENABLED']) env.Append(LIBS=['pthread']) #env.Append(CPPFLAGS=['-F/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks', '-isysroot', '/Developer/SDKs/MacOSX10.4u.sdk', '-mmacosx-version-min=10.4']) #env.Append(LINKFLAGS=['-mmacosx-version-min=10.4', '-isysroot', '/Developer/SDKs/MacOSX10.4u.sdk', '-Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk']) - env.Append(LINKFLAGS=['-framework', 'Cocoa', '-framework', 'Carbon', '-framework', 'OpenGL', '-framework', 'AGL', '-framework', 'AudioUnit','-lz', '-framework', 'IOKit', '-framework', 'ForceFeedback']) + env.Append(LINKFLAGS=['-framework', 'Cocoa', '-framework', 'Carbon', '-framework', 'OpenGL', '-framework', 'AGL', '-framework', 'AudioUnit', '-lz', '-framework', 'IOKit', '-framework', 'ForceFeedback']) - if (env["CXX"]=="clang++"): + if (env["CXX"] == "clang++"): env.Append(CPPFLAGS=['-DTYPED_METHOD_BIND']) - env["CC"]="clang" - env["LD"]="clang++" + env["CC"] = "clang" + env["LD"] = "clang++" import methods - env.Append( BUILDERS = { 'GLSL120' : env.Builder(action = methods.build_legacygl_headers, suffix = 'glsl.h',src_suffix = '.glsl') } ) - env.Append( BUILDERS = { 'GLSL' : env.Builder(action = methods.build_glsl_headers, suffix = 'glsl.h',src_suffix = '.glsl') } ) - env.Append( BUILDERS = { 'GLSL120GLES' : env.Builder(action = methods.build_gles2_headers, suffix = 'glsl.h',src_suffix = '.glsl') } ) + env.Append(BUILDERS={'GLSL120': env.Builder(action=methods.build_legacygl_headers, suffix='glsl.h', src_suffix='.glsl')}) + env.Append(BUILDERS={'GLSL': env.Builder(action=methods.build_glsl_headers, suffix='glsl.h', src_suffix='.glsl')}) + env.Append(BUILDERS={'GLSL120GLES': env.Builder(action=methods.build_gles2_headers, suffix='glsl.h', src_suffix='.glsl')}) #env.Append( BUILDERS = { 'HLSL9' : env.Builder(action = methods.build_hlsl_dx9_headers, suffix = 'hlsl.h',src_suffix = '.hlsl') } ) - env["x86_libtheora_opt_gcc"]=True + env["x86_libtheora_opt_gcc"] = True diff --git a/platform/server/SCsub b/platform/server/SCsub index d53a003288..30195bb908 100644 --- a/platform/server/SCsub +++ b/platform/server/SCsub @@ -3,8 +3,8 @@ Import('env') -common_server=[\ +common_server = [\ "os_server.cpp",\ ] -env.Program('#bin/godot_server',['godot_server.cpp']+common_server) +env.Program('#bin/godot_server', ['godot_server.cpp'] + common_server) diff --git a/platform/server/detect.py b/platform/server/detect.py index c6e9d45f93..9d23ceda70 100644 --- a/platform/server/detect.py +++ b/platform/server/detect.py @@ -12,16 +12,16 @@ def get_name(): def can_build(): - if (os.name!="posix"): + if (os.name != "posix"): return False - return True # enabled + return True # enabled def get_opts(): return [ - ('use_llvm','Use llvm compiler','no'), - ('force_32_bits','Force 32 bits binary','no') + ('use_llvm', 'Use llvm compiler', 'no'), + ('force_32_bits', 'Force 32 bits binary', 'no') ] def get_flags(): @@ -34,43 +34,43 @@ def get_flags(): def configure(env): env.Append(CPPPATH=['#platform/server']) - if (env["use_llvm"]=="yes"): - env["CC"]="clang" - env["CXX"]="clang++" - env["LD"]="clang++" + if (env["use_llvm"] == "yes"): + env["CC"] = "clang" + env["CXX"] = "clang++" + env["LD"] = "clang++" - is64=sys.maxsize > 2**32 + is64 = sys.maxsize > 2**32 - if (env["bits"]=="default"): + if (env["bits"] == "default"): if (is64): - env["bits"]="64" + env["bits"] = "64" else: - env["bits"]="32" + env["bits"] = "32" - #if (env["tools"]=="no"): + # if (env["tools"]=="no"): # #no tools suffix # env['OBJSUFFIX'] = ".nt"+env['OBJSUFFIX'] # env['LIBSUFFIX'] = ".nt"+env['LIBSUFFIX'] - if (env["target"]=="release"): + if (env["target"] == "release"): - env.Append(CCFLAGS=['-O2','-ffast-math','-fomit-frame-pointer']) + env.Append(CCFLAGS=['-O2', '-ffast-math', '-fomit-frame-pointer']) - elif (env["target"]=="release_debug"): + elif (env["target"] == "release_debug"): - env.Append(CCFLAGS=['-O2','-ffast-math','-DDEBUG_ENABLED']) + env.Append(CCFLAGS=['-O2', '-ffast-math', '-DDEBUG_ENABLED']) - elif (env["target"]=="debug"): + elif (env["target"] == "debug"): - env.Append(CCFLAGS=['-g2', '-Wall','-DDEBUG_ENABLED','-DDEBUG_MEMORY_ENABLED']) + env.Append(CCFLAGS=['-g2', '-Wall', '-DDEBUG_ENABLED', '-DDEBUG_MEMORY_ENABLED']) - env.Append(CPPFLAGS=['-DSERVER_ENABLED','-DUNIX_ENABLED']) - env.Append(LIBS=['pthread','z']) #TODO detect linux/BSD! + env.Append(CPPFLAGS=['-DSERVER_ENABLED', '-DUNIX_ENABLED']) + env.Append(LIBS=['pthread', 'z']) # TODO detect linux/BSD! - if (env["CXX"]=="clang++"): + if (env["CXX"] == "clang++"): env.Append(CPPFLAGS=['-DTYPED_METHOD_BIND']) - env["CC"]="clang" - env["LD"]="clang++" + env["CC"] = "clang" + env["LD"] = "clang++" diff --git a/platform/windows/SCsub b/platform/windows/SCsub index 00568952ea..32c23b906a 100644 --- a/platform/windows/SCsub +++ b/platform/windows/SCsub @@ -3,7 +3,7 @@ Import('env') -common_win=[ +common_win = [ "context_gl_win.cpp", "os_windows.cpp", "ctxgl_procaddr.cpp", @@ -14,16 +14,16 @@ common_win=[ "joystick.cpp", ] -restarget="godot_res"+env["OBJSUFFIX"] +restarget = "godot_res" + env["OBJSUFFIX"] -obj = env.RES(restarget,'godot_res.rc') +obj = env.RES(restarget, 'godot_res.rc') common_win.append(obj) -env.Program('#bin/godot',['godot_win.cpp']+common_win,PROGSUFFIX=env["PROGSUFFIX"]) +env.Program('#bin/godot', ['godot_win.cpp'] + common_win, PROGSUFFIX=env["PROGSUFFIX"]) # Microsoft Visual Studio Project Generation -if (env['vsproj'])=="yes": +if (env['vsproj']) == "yes": env.vs_srcs = env.vs_srcs + ["platform/windows/godot_win.cpp"] for x in common_win: env.vs_srcs = env.vs_srcs + ["platform/windows/" + str(x)] diff --git a/platform/windows/detect.py b/platform/windows/detect.py index 325f2838b2..4bb6dc4a96 100644 --- a/platform/windows/detect.py +++ b/platform/windows/detect.py @@ -85,7 +85,7 @@ ##### # TODO : -# +# # - finish to cleanup this script to remove all the remains of previous hacks and workarounds # - make it work with the Windows7 SDK that is supposed to enable 64bits compilation for MSVC2010-Express # - confirm it works well with other Visual Studio versions. @@ -107,21 +107,21 @@ def get_name(): def can_build(): - if (os.name=="nt"): - #building natively on windows! - if ( os.getenv("VCINSTALLDIR") ): + if (os.name == "nt"): + # building natively on windows! + if (os.getenv("VCINSTALLDIR")): return True else: print("\nMSVC not detected, attempting Mingw.") mingw32 = "" mingw64 = "" - if ( os.getenv("MINGW32_PREFIX") ) : + if (os.getenv("MINGW32_PREFIX")): mingw32 = os.getenv("MINGW32_PREFIX") - if ( os.getenv("MINGW64_PREFIX") ) : + if (os.getenv("MINGW64_PREFIX")): mingw64 = os.getenv("MINGW64_PREFIX") test = "gcc --version > NUL 2>&1" - if os.system(test)!= 0 and os.system(mingw32+test)!=0 and os.system(mingw64+test)!=0 : + if os.system(test) != 0 and os.system(mingw32 + test) != 0 and os.system(mingw64 + test) != 0: print("- could not detect gcc.") print("Please, make sure a path to a Mingw /bin directory is accessible into the environment PATH.\n") return False @@ -130,57 +130,57 @@ def can_build(): return True - if (os.name=="posix"): + if (os.name == "posix"): mingw = "i586-mingw32msvc-" mingw64 = "x86_64-w64-mingw32-" mingw32 = "i686-w64-mingw32-" if (os.getenv("MINGW32_PREFIX")): - mingw32=os.getenv("MINGW32_PREFIX") + mingw32 = os.getenv("MINGW32_PREFIX") mingw = mingw32 if (os.getenv("MINGW64_PREFIX")): - mingw64=os.getenv("MINGW64_PREFIX") + mingw64 = os.getenv("MINGW64_PREFIX") test = "gcc --version &>/dev/null" - if (os.system(mingw+test) == 0 or os.system(mingw64+test) == 0 or os.system(mingw32+test) == 0): + if (os.system(mingw + test) == 0 or os.system(mingw64 + test) == 0 or os.system(mingw32 + test) == 0): return True return False def get_opts(): - mingw="" - mingw32="" - mingw64="" - if ( os.name == "posix" ): + mingw = "" + mingw32 = "" + mingw64 = "" + if (os.name == "posix"): mingw = "i586-mingw32msvc-" mingw32 = "i686-w64-mingw32-" mingw64 = "x86_64-w64-mingw32-" - if os.system(mingw32+"gcc --version &>/dev/null") != 0 : + if os.system(mingw32 + "gcc --version &>/dev/null") != 0: mingw32 = mingw if (os.getenv("MINGW32_PREFIX")): - mingw32=os.getenv("MINGW32_PREFIX") + mingw32 = os.getenv("MINGW32_PREFIX") mingw = mingw32 if (os.getenv("MINGW64_PREFIX")): - mingw64=os.getenv("MINGW64_PREFIX") + mingw64 = os.getenv("MINGW64_PREFIX") return [ - ('mingw_prefix','Mingw Prefix',mingw32), - ('mingw_prefix_64','Mingw Prefix 64 bits',mingw64), + ('mingw_prefix', 'Mingw Prefix', mingw32), + ('mingw_prefix_64', 'Mingw Prefix 64 bits', mingw64), ] def get_flags(): return [ ('builtin_zlib', 'yes'), - ('openssl','builtin'), #use builtin openssl + ('openssl', 'builtin'), # use builtin openssl ] -def build_res_file( target, source, env ): +def build_res_file(target, source, env): cmdbase = "" if (env["bits"] == "32"): @@ -193,7 +193,7 @@ def build_res_file( target, source, env ): for x in range(len(source)): cmd = cmdbase + '-i ' + str(source[x]) + ' -o ' + str(target[x]) try: - out = subprocess.Popen(cmd,shell = True,stderr = subprocess.PIPE).communicate() + out = subprocess.Popen(cmd, shell=True, stderr=subprocess.PIPE).communicate() if len(out[1]): return 1 except: @@ -203,66 +203,66 @@ def build_res_file( target, source, env ): def configure(env): env.Append(CPPPATH=['#platform/windows']) - env['is_mingw']=False - if (os.name=="nt" and os.getenv("VCINSTALLDIR") ): - #build using visual studio + env['is_mingw'] = False + if (os.name == "nt" and os.getenv("VCINSTALLDIR")): + # build using visual studio env['ENV']['TMP'] = os.environ['TMP'] env.Append(CPPPATH=['#platform/windows/include']) env.Append(LIBPATH=['#platform/windows/lib']) - if (env["target"]=="release"): + if (env["target"] == "release"): env.Append(CCFLAGS=['/O2']) env.Append(LINKFLAGS=['/SUBSYSTEM:WINDOWS']) env.Append(LINKFLAGS=['/ENTRY:mainCRTStartup']) - elif (env["target"]=="release_debug"): + elif (env["target"] == "release_debug"): - env.Append(CCFLAGS=['/O2','/DDEBUG_ENABLED']) + env.Append(CCFLAGS=['/O2', '/DDEBUG_ENABLED']) env.Append(LINKFLAGS=['/SUBSYSTEM:CONSOLE']) - elif (env["target"]=="debug_release"): + elif (env["target"] == "debug_release"): - env.Append(CCFLAGS=['/Z7','/Od']) + env.Append(CCFLAGS=['/Z7', '/Od']) env.Append(LINKFLAGS=['/DEBUG']) env.Append(LINKFLAGS=['/SUBSYSTEM:WINDOWS']) env.Append(LINKFLAGS=['/ENTRY:mainCRTStartup']) - elif (env["target"]=="debug"): + elif (env["target"] == "debug"): - env.Append(CCFLAGS=['/Z7','/DDEBUG_ENABLED','/DDEBUG_MEMORY_ENABLED','/DD3D_DEBUG_INFO','/Od']) + env.Append(CCFLAGS=['/Z7', '/DDEBUG_ENABLED', '/DDEBUG_MEMORY_ENABLED', '/DD3D_DEBUG_INFO', '/Od']) env.Append(LINKFLAGS=['/SUBSYSTEM:CONSOLE']) env.Append(LINKFLAGS=['/DEBUG']) - env.Append(CCFLAGS=['/MT','/Gd','/GR','/nologo']) + env.Append(CCFLAGS=['/MT', '/Gd', '/GR', '/nologo']) env.Append(CXXFLAGS=['/TP']) env.Append(CPPFLAGS=['/DMSVC', '/GR', ]) - env.Append(CCFLAGS=['/I'+os.getenv("WindowsSdkDir")+"/Include"]) + env.Append(CCFLAGS=['/I' + os.getenv("WindowsSdkDir") + "/Include"]) env.Append(CCFLAGS=['/DWINDOWS_ENABLED']) env.Append(CCFLAGS=['/DRTAUDIO_ENABLED']) env.Append(CCFLAGS=['/DWIN32']) env.Append(CCFLAGS=['/DTYPED_METHOD_BIND']) env.Append(CCFLAGS=['/DGLES2_ENABLED']) - LIBS=['winmm','opengl32','dsound','kernel32','ole32','oleaut32','user32','gdi32', 'IPHLPAPI','Shlwapi', 'wsock32','Ws2_32', 'shell32','advapi32','dinput8','dxguid'] - env.Append(LINKFLAGS=[p+env["LIBSUFFIX"] for p in LIBS]) + LIBS = ['winmm', 'opengl32', 'dsound', 'kernel32', 'ole32', 'oleaut32', 'user32', 'gdi32', 'IPHLPAPI', 'Shlwapi', 'wsock32', 'Ws2_32', 'shell32', 'advapi32', 'dinput8', 'dxguid'] + env.Append(LINKFLAGS=[p + env["LIBSUFFIX"] for p in LIBS]) - env.Append(LIBPATH=[os.getenv("WindowsSdkDir")+"/Lib"]) + env.Append(LIBPATH=[os.getenv("WindowsSdkDir") + "/Lib"]) if (os.getenv("DXSDK_DIR")): - DIRECTX_PATH=os.getenv("DXSDK_DIR") + DIRECTX_PATH = os.getenv("DXSDK_DIR") else: - DIRECTX_PATH="C:/Program Files/Microsoft DirectX SDK (March 2009)" + DIRECTX_PATH = "C:/Program Files/Microsoft DirectX SDK (March 2009)" if (os.getenv("VCINSTALLDIR")): - VC_PATH=os.getenv("VCINSTALLDIR") + VC_PATH = os.getenv("VCINSTALLDIR") else: - VC_PATH="" + VC_PATH = "" env.Append(CCFLAGS=["/I" + p for p in os.getenv("INCLUDE").split(";")]) env.Append(LIBPATH=[p for p in os.getenv("LIB").split(";")]) - env.Append(CCFLAGS=["/I"+DIRECTX_PATH+"/Include"]) - env.Append(LIBPATH=[DIRECTX_PATH+"/Lib/x86"]) + env.Append(CCFLAGS=["/I" + DIRECTX_PATH + "/Include"]) + env.Append(LIBPATH=[DIRECTX_PATH + "/Lib/x86"]) env['ENV'] = os.environ; # This detection function needs the tools env (that is env['ENV'], not SCons's env), and that is why it's this far bellow in the code @@ -272,26 +272,26 @@ def configure(env): if(env["bits"] != "default"): print "Error: bits argument is disabled for MSVC" print ("Bits argument is not supported for MSVC compilation. Architecture depends on the Native/Cross Compile Tools Prompt/Developer Console (or Visual Studio settings)" - +" that is being used to run SCons. As a consequence, bits argument is disabled. Run scons again without bits argument (example: scons p=windows) and SCons will attempt to detect what MSVC compiler" - +" will be executed and inform you.") + + " that is being used to run SCons. As a consequence, bits argument is disabled. Run scons again without bits argument (example: scons p=windows) and SCons will attempt to detect what MSVC compiler" + + " will be executed and inform you.") sys.exit() # Forcing bits argument because MSVC does not have a flag to set this through SCons... it's different compilers (cl.exe's) called from the propper command prompt # that decide the architecture that is build for. Scons can only detect the os.getenviron (because vsvarsall.bat sets a lot of stuff for cl.exe to work with) - env["bits"]="32" - env["x86_libtheora_opt_vc"]=True + env["bits"] = "32" + env["x86_libtheora_opt_vc"] = True - print "Detected MSVC compiler: "+compiler_version_str + print "Detected MSVC compiler: " + compiler_version_str # If building for 64bit architecture, disable assembly optimisations for 32 bit builds (theora as of writting)... vc compiler for 64bit can not compile _asm if(compiler_version_str == "amd64" or compiler_version_str == "x86_amd64"): - env["bits"]="64" - env["x86_libtheora_opt_vc"]=False + env["bits"] = "64" + env["x86_libtheora_opt_vc"] = False print "Compiled program architecture will be a 64 bit executable (forcing bits=64)." - elif (compiler_version_str=="x86" or compiler_version_str == "amd64_x86"): + elif (compiler_version_str == "x86" or compiler_version_str == "amd64_x86"): print "Compiled program architecture will be a 32 bit executable. (forcing bits=32)." else: print "Failed to detect MSVC compiler architecture version... Defaulting to 32bit executable settings (forcing bits=32). Compilation attempt will continue, but SCons can not detect for what architecture this build is compiled for. You should check your settings/compilation setup." - if env["bits"]=="64": + if env["bits"] == "64": env.Append(CCFLAGS=['/D_WIN64']) # Incremental linking fix @@ -304,32 +304,32 @@ def configure(env): # http://www.scons.org/wiki/LongCmdLinesOnWin32 env.use_windows_spawn_fix() - #build using mingw - if (os.name=="nt"): - env['ENV']['TMP'] = os.environ['TMP'] #way to go scons, you can be so stupid sometimes + # build using mingw + if (os.name == "nt"): + env['ENV']['TMP'] = os.environ['TMP'] # way to go scons, you can be so stupid sometimes else: - env["PROGSUFFIX"]=env["PROGSUFFIX"]+".exe" # for linux cross-compilation + env["PROGSUFFIX"] = env["PROGSUFFIX"] + ".exe" # for linux cross-compilation - mingw_prefix="" + mingw_prefix = "" - if (env["bits"]=="default"): - env["bits"]="32" + if (env["bits"] == "default"): + env["bits"] = "32" - if (env["bits"]=="32"): + if (env["bits"] == "32"): env.Append(LINKFLAGS=['-static']) env.Append(LINKFLAGS=['-static-libgcc']) env.Append(LINKFLAGS=['-static-libstdc++']) - mingw_prefix=env["mingw_prefix"]; + mingw_prefix = env["mingw_prefix"]; else: env.Append(LINKFLAGS=['-static']) - mingw_prefix=env["mingw_prefix_64"]; + mingw_prefix = env["mingw_prefix_64"]; - nulstr="" + nulstr = "" - if (os.name=="posix"): - nulstr=">/dev/null" + if (os.name == "posix"): + nulstr = ">/dev/null" else: - nulstr=">nul" + nulstr = ">nul" @@ -338,42 +338,42 @@ def configure(env): # print("Can't find Windows compiler: "+mingw_prefix) # sys.exit(255) - if (env["target"]=="release"): + if (env["target"] == "release"): env.Append(CCFLAGS=['-msse2']) - if (env["bits"]=="64"): + if (env["bits"] == "64"): env.Append(CCFLAGS=['-O3']) else: env.Append(CCFLAGS=['-O2']) env.Append(LINKFLAGS=['-Wl,--subsystem,windows']) - elif (env["target"]=="release_debug"): + elif (env["target"] == "release_debug"): - env.Append(CCFLAGS=['-O2','-DDEBUG_ENABLED']) + env.Append(CCFLAGS=['-O2', '-DDEBUG_ENABLED']) - elif (env["target"]=="debug"): + elif (env["target"] == "debug"): - env.Append(CCFLAGS=['-g', '-Wall','-DDEBUG_ENABLED','-DDEBUG_MEMORY_ENABLED']) + env.Append(CCFLAGS=['-g', '-Wall', '-DDEBUG_ENABLED', '-DDEBUG_MEMORY_ENABLED']) - env["CC"]=mingw_prefix+"gcc" - env['AS']=mingw_prefix+"as" - env['CXX'] = mingw_prefix+"g++" - env['AR'] = mingw_prefix+"ar" - env['RANLIB'] = mingw_prefix+"ranlib" - env['LD'] = mingw_prefix+"g++" - env["x86_libtheora_opt_gcc"]=True + env["CC"] = mingw_prefix + "gcc" + env['AS'] = mingw_prefix + "as" + env['CXX'] = mingw_prefix + "g++" + env['AR'] = mingw_prefix + "ar" + env['RANLIB'] = mingw_prefix + "ranlib" + env['LD'] = mingw_prefix + "g++" + env["x86_libtheora_opt_gcc"] = True #env['CC'] = "winegcc" #env['CXX'] = "wineg++" - env.Append(CCFLAGS=['-DWINDOWS_ENABLED','-mwindows']) + env.Append(CCFLAGS=['-DWINDOWS_ENABLED', '-mwindows']) env.Append(CPPFLAGS=['-DRTAUDIO_ENABLED']) env.Append(CCFLAGS=['-DGLES2_ENABLED']) - env.Append(LIBS=['mingw32','opengl32', 'dsound', 'ole32', 'd3d9','winmm','gdi32','iphlpapi','shlwapi','wsock32','ws2_32','kernel32', 'oleaut32', 'dinput8', 'dxguid']) + env.Append(LIBS=['mingw32', 'opengl32', 'dsound', 'ole32', 'd3d9', 'winmm', 'gdi32', 'iphlpapi', 'shlwapi', 'wsock32', 'ws2_32', 'kernel32', 'oleaut32', 'dinput8', 'dxguid']) # if (env["bits"]=="32"): # env.Append(LIBS=['gcc_s']) @@ -386,13 +386,13 @@ def configure(env): #'d3dx9d' env.Append(CPPFLAGS=['-DMINGW_ENABLED']) - #env.Append(LINKFLAGS=['-g']) + # env.Append(LINKFLAGS=['-g']) # resrc - env['is_mingw']=True - env.Append( BUILDERS = { 'RES' : env.Builder(action = build_res_file, suffix = '.o',src_suffix = '.rc') } ) + env['is_mingw'] = True + env.Append(BUILDERS={'RES': env.Builder(action=build_res_file, suffix='.o', src_suffix='.rc')}) - env.Append( BUILDERS = { 'GLSL120' : env.Builder(action = methods.build_legacygl_headers, suffix = 'glsl.h',src_suffix = '.glsl') } ) - env.Append( BUILDERS = { 'GLSL' : env.Builder(action = methods.build_glsl_headers, suffix = 'glsl.h',src_suffix = '.glsl') } ) - env.Append( BUILDERS = { 'HLSL9' : env.Builder(action = methods.build_hlsl_dx9_headers, suffix = 'hlsl.h',src_suffix = '.hlsl') } ) - env.Append( BUILDERS = { 'GLSL120GLES' : env.Builder(action = methods.build_gles2_headers, suffix = 'glsl.h',src_suffix = '.glsl') } ) + env.Append(BUILDERS={'GLSL120': env.Builder(action=methods.build_legacygl_headers, suffix='glsl.h', src_suffix='.glsl')}) + env.Append(BUILDERS={'GLSL': env.Builder(action=methods.build_glsl_headers, suffix='glsl.h', src_suffix='.glsl')}) + env.Append(BUILDERS={'HLSL9': env.Builder(action=methods.build_hlsl_dx9_headers, suffix='hlsl.h', src_suffix='.hlsl')}) + env.Append(BUILDERS={'GLSL120GLES': env.Builder(action=methods.build_gles2_headers, suffix='glsl.h', src_suffix='.glsl')}) diff --git a/platform/winrt/detect.py b/platform/winrt/detect.py index 06bae980e9..19a6324e1e 100644 --- a/platform/winrt/detect.py +++ b/platform/winrt/detect.py @@ -12,8 +12,8 @@ def get_name(): return "WinRT" def can_build(): - if (os.name=="nt"): - #building natively on windows! + if (os.name == "nt"): + # building natively on windows! if (os.getenv("VSINSTALLDIR")): if (os.getenv("ANGLE_SRC_PATH") == None): @@ -40,8 +40,8 @@ def configure(env): if(env["bits"] != "default"): print "Error: bits argument is disabled for MSVC" print ("Bits argument is not supported for MSVC compilation. Architecture depends on the Native/Cross Compile Tools Prompt/Developer Console (or Visual Studio settings)" - +" that is being used to run SCons. As a consequence, bits argument is disabled. Run scons again without bits argument (example: scons p=winrt) and SCons will attempt to detect what MSVC compiler" - +" will be executed and inform you.") + + " that is being used to run SCons. As a consequence, bits argument is disabled. Run scons again without bits argument (example: scons p=winrt) and SCons will attempt to detect what MSVC compiler" + + " will be executed and inform you.") sys.exit() arch = "" @@ -60,8 +60,8 @@ def configure(env): print "Compiled program architecture will be an ARM executable. (forcing bits=32)." - arch="arm" - env["bits"]="32" + arch = "arm" + env["bits"] = "32" env.Append(LINKFLAGS=['/MACHINE:ARM']) env.Append(LIBPATH=[os.environ['VCINSTALLDIR'] + 'lib/store/arm']) @@ -74,14 +74,14 @@ def configure(env): compiler_version_str = methods.detect_visual_c_compiler_version(env['ENV']) if(compiler_version_str == "amd64" or compiler_version_str == "x86_amd64"): - env["bits"]="64" + env["bits"] = "64" print "Compiled program architecture will be a x64 executable (forcing bits=64)." - elif (compiler_version_str=="x86" or compiler_version_str == "amd64_x86"): - env["bits"]="32" + elif (compiler_version_str == "x86" or compiler_version_str == "amd64_x86"): + env["bits"] = "32" print "Compiled program architecture will be a x86 executable. (forcing bits=32)." else: print "Failed to detect MSVC compiler architecture version... Defaulting to 32bit executable settings (forcing bits=32). Compilation attempt will continue, but SCons can not detect for what architecture this build is compiled for. You should check your settings/compilation setup." - env["bits"]="32" + env["bits"] = "32" if (env["bits"] == "32"): arch = "x86" @@ -102,29 +102,29 @@ def configure(env): env.Append(LIBPATH=[os.environ['VCINSTALLDIR'] + 'lib/store/amd64']) env.Append(LIBPATH=[angle_root + '/winrt/10/src/Release_x64/lib']) - env.Append(CPPPATH=['#platform/winrt','#drivers/windows']) + env.Append(CPPPATH=['#platform/winrt', '#drivers/windows']) env.Append(LINKFLAGS=['/MANIFEST:NO', '/NXCOMPAT', '/DYNAMICBASE', '/WINMD', '/APPCONTAINER', '/ERRORREPORT:PROMPT', '/NOLOGO', '/TLBID:1', '/NODEFAULTLIB:"kernel32.lib"', '/NODEFAULTLIB:"ole32.lib"']) - env.Append(CPPFLAGS=['/D','__WRL_NO_DEFAULT_LIB__','/D','WIN32']) + env.Append(CPPFLAGS=['/D', '__WRL_NO_DEFAULT_LIB__', '/D', 'WIN32']) env.Append(CPPFLAGS=['/FU', os.environ['VCINSTALLDIR'] + 'lib/store/references/platform.winmd']) env.Append(CPPFLAGS=['/AI', os.environ['VCINSTALLDIR'] + 'lib/store/references']) env.Append(LIBPATH=[os.environ['VCINSTALLDIR'] + 'lib/store/references']) - if (env["target"]=="release"): + if (env["target"] == "release"): env.Append(CPPFLAGS=['/O2', '/GL']) env.Append(CPPFLAGS=['/MD']) env.Append(LINKFLAGS=['/SUBSYSTEM:WINDOWS', '/LTCG']) - elif (env["target"]=="release_debug"): + elif (env["target"] == "release_debug"): - env.Append(CCFLAGS=['/O2','/Zi','/DDEBUG_ENABLED']) + env.Append(CCFLAGS=['/O2', '/Zi', '/DDEBUG_ENABLED']) env.Append(CPPFLAGS=['/MD']) env.Append(LINKFLAGS=['/SUBSYSTEM:CONSOLE']) - elif (env["target"]=="debug"): + elif (env["target"] == "debug"): - env.Append(CCFLAGS=['/Zi','/DDEBUG_ENABLED','/DDEBUG_MEMORY_ENABLED']) + env.Append(CCFLAGS=['/Zi', '/DDEBUG_ENABLED', '/DDEBUG_MEMORY_ENABLED']) env.Append(CPPFLAGS=['/MDd']) env.Append(LINKFLAGS=['/SUBSYSTEM:CONSOLE']) env.Append(LINKFLAGS=['/DEBUG']) @@ -132,18 +132,18 @@ def configure(env): env.Append(CCFLAGS=string.split('/FS /MP /GS /wd"4453" /wd"28204" /wd"4291" /Zc:wchar_t /Gm- /fp:precise /D "_UNICODE" /D "UNICODE" /D "WINAPI_FAMILY=WINAPI_FAMILY_APP" /errorReport:prompt /WX- /Zc:forScope /Gd /EHsc /nologo')) env.Append(CXXFLAGS=string.split('/ZW /FS')) - env.Append(CCFLAGS=['/AI', os.environ['VCINSTALLDIR']+'\\vcpackages', '/AI', os.environ['WINDOWSSDKDIR']+'\\References\\CommonConfiguration\\Neutral']) + env.Append(CCFLAGS=['/AI', os.environ['VCINSTALLDIR'] + '\\vcpackages', '/AI', os.environ['WINDOWSSDKDIR'] + '\\References\\CommonConfiguration\\Neutral']) - env["PROGSUFFIX"]="."+arch+env["PROGSUFFIX"] - env["OBJSUFFIX"]="."+arch+env["OBJSUFFIX"] - env["LIBSUFFIX"]="."+arch+env["LIBSUFFIX"] + env["PROGSUFFIX"] = "." + arch + env["PROGSUFFIX"] + env["OBJSUFFIX"] = "." + arch + env["OBJSUFFIX"] + env["LIBSUFFIX"] = "." + arch + env["LIBSUFFIX"] env.Append(CCFLAGS=['/DWINRT_ENABLED']) env.Append(CCFLAGS=['/DWINDOWS_ENABLED']) env.Append(CCFLAGS=['/DTYPED_METHOD_BIND']) - env.Append(CCFLAGS=['/DGLES2_ENABLED','/DGL_GLEXT_PROTOTYPES','/DEGL_EGLEXT_PROTOTYPES','/DANGLE_ENABLED']) + env.Append(CCFLAGS=['/DGLES2_ENABLED', '/DGL_GLEXT_PROTOTYPES', '/DEGL_EGLEXT_PROTOTYPES', '/DANGLE_ENABLED']) LIBS = [ 'WindowsApp', @@ -152,15 +152,15 @@ def configure(env): 'libEGL', 'libGLESv2', ] - env.Append(LINKFLAGS=[p+".lib" for p in LIBS]) + env.Append(LINKFLAGS=[p + ".lib" for p in LIBS]) # Incremental linking fix env['BUILDERS']['ProgramOriginal'] = env['BUILDERS']['Program'] env['BUILDERS']['Program'] = methods.precious_program - env.Append( BUILDERS = { 'ANGLE' : env.Builder(action = angle_build_cmd) } ) + env.Append(BUILDERS={'ANGLE': env.Builder(action=angle_build_cmd)}) - env.Append( BUILDERS = { 'GLSL120' : env.Builder(action = methods.build_legacygl_headers, suffix = 'glsl.h',src_suffix = '.glsl') } ) - env.Append( BUILDERS = { 'GLSL' : env.Builder(action = methods.build_glsl_headers, suffix = 'glsl.h',src_suffix = '.glsl') } ) - env.Append( BUILDERS = { 'HLSL9' : env.Builder(action = methods.build_hlsl_dx9_headers, suffix = 'hlsl.h',src_suffix = '.hlsl') } ) - env.Append( BUILDERS = { 'GLSL120GLES' : env.Builder(action = methods.build_gles2_headers, suffix = 'glsl.h',src_suffix = '.glsl') } ) + env.Append(BUILDERS={'GLSL120': env.Builder(action=methods.build_legacygl_headers, suffix='glsl.h', src_suffix='.glsl')}) + env.Append(BUILDERS={'GLSL': env.Builder(action=methods.build_glsl_headers, suffix='glsl.h', src_suffix='.glsl')}) + env.Append(BUILDERS={'HLSL9': env.Builder(action=methods.build_hlsl_dx9_headers, suffix='hlsl.h', src_suffix='.hlsl')}) + env.Append(BUILDERS={'GLSL120GLES': env.Builder(action=methods.build_gles2_headers, suffix='glsl.h', src_suffix='.glsl')}) diff --git a/platform/x11/SCsub b/platform/x11/SCsub index 93cd2ca267..0defd4f025 100644 --- a/platform/x11/SCsub +++ b/platform/x11/SCsub @@ -3,11 +3,11 @@ Import('env') -common_x11=[\ +common_x11 = [\ "context_gl_x11.cpp",\ "os_x11.cpp",\ "key_mapping_x11.cpp",\ "joystick_linux.cpp",\ ] -env.Program('#bin/godot',['godot_x11.cpp']+common_x11) +env.Program('#bin/godot', ['godot_x11.cpp'] + common_x11) diff --git a/platform/x11/detect.py b/platform/x11/detect.py index 593e3fbb9d..37c787179f 100644 --- a/platform/x11/detect.py +++ b/platform/x11/detect.py @@ -13,56 +13,56 @@ def get_name(): def can_build(): - if (os.name!="posix"): + if (os.name != "posix"): return False if sys.platform == "darwin": - return False # no x11 on mac for now + return False # no x11 on mac for now - errorval=os.system("pkg-config --version > /dev/null") + errorval = os.system("pkg-config --version > /dev/null") if (errorval): print("pkg-config not found.. x11 disabled.") return False - x11_error=os.system("pkg-config x11 --modversion > /dev/null ") + x11_error = os.system("pkg-config x11 --modversion > /dev/null ") if (x11_error): print("X11 not found.. x11 disabled.") return False - ssl_error=os.system("pkg-config openssl --modversion > /dev/null ") + ssl_error = os.system("pkg-config openssl --modversion > /dev/null ") if (ssl_error): print("OpenSSL not found.. x11 disabled.") return False - x11_error=os.system("pkg-config xcursor --modversion > /dev/null ") + x11_error = os.system("pkg-config xcursor --modversion > /dev/null ") if (x11_error): print("xcursor not found.. x11 disabled.") return False - x11_error=os.system("pkg-config xinerama --modversion > /dev/null ") + x11_error = os.system("pkg-config xinerama --modversion > /dev/null ") if (x11_error): print("xinerama not found.. x11 disabled.") return False - x11_error=os.system("pkg-config xrandr --modversion > /dev/null ") + x11_error = os.system("pkg-config xrandr --modversion > /dev/null ") if (x11_error): print("xrandr not found.. x11 disabled.") return False - return True # X11 enabled + return True # X11 enabled def get_opts(): return [ - ('use_llvm','Use llvm compiler','no'), - ('use_static_cpp','link stdc++ statically','no'), - ('use_sanitizer','Use llvm compiler sanitize address','no'), - ('use_leak_sanitizer','Use llvm compiler sanitize memory leaks','no'), - ('pulseaudio','Detect & Use pulseaudio','yes'), - ('udev','Use udev for gamepad connection callbacks','no'), - ('debug_release', 'Add debug symbols to release version','no'), + ('use_llvm', 'Use llvm compiler', 'no'), + ('use_static_cpp', 'link stdc++ statically', 'no'), + ('use_sanitizer', 'Use llvm compiler sanitize address', 'no'), + ('use_leak_sanitizer', 'Use llvm compiler sanitize memory leaks', 'no'), + ('pulseaudio', 'Detect & Use pulseaudio', 'yes'), + ('udev', 'Use udev for gamepad connection callbacks', 'no'), + ('debug_release', 'Add debug symbols to release version', 'no'), ] def get_flags(): @@ -77,56 +77,56 @@ def get_flags(): def configure(env): - is64=sys.maxsize > 2**32 + is64 = sys.maxsize > 2**32 - if (env["bits"]=="default"): + if (env["bits"] == "default"): if (is64): - env["bits"]="64" + env["bits"] = "64" else: - env["bits"]="32" + env["bits"] = "32" env.Append(CPPPATH=['#platform/x11']) - if (env["use_llvm"]=="yes"): + if (env["use_llvm"] == "yes"): if 'clang++' not in env['CXX']: - env["CC"]="clang" - env["CXX"]="clang++" - env["LD"]="clang++" + env["CC"] = "clang" + env["CXX"] = "clang++" + env["LD"] = "clang++" env.Append(CPPFLAGS=['-DTYPED_METHOD_BIND']) - env.extra_suffix=".llvm" + env.extra_suffix = ".llvm" - if (env["use_sanitizer"]=="yes"): - env.Append(CXXFLAGS=['-fsanitize=address','-fno-omit-frame-pointer']) + if (env["use_sanitizer"] == "yes"): + env.Append(CXXFLAGS=['-fsanitize=address', '-fno-omit-frame-pointer']) env.Append(LINKFLAGS=['-fsanitize=address']) - env.extra_suffix+="s" + env.extra_suffix += "s" - if (env["use_leak_sanitizer"]=="yes"): - env.Append(CXXFLAGS=['-fsanitize=address','-fno-omit-frame-pointer']) + if (env["use_leak_sanitizer"] == "yes"): + env.Append(CXXFLAGS=['-fsanitize=address', '-fno-omit-frame-pointer']) env.Append(LINKFLAGS=['-fsanitize=address']) - env.extra_suffix+="s" + env.extra_suffix += "s" - #if (env["tools"]=="no"): + # if (env["tools"]=="no"): # #no tools suffix # env['OBJSUFFIX'] = ".nt"+env['OBJSUFFIX'] # env['LIBSUFFIX'] = ".nt"+env['LIBSUFFIX'] - if (env["target"]=="release"): + if (env["target"] == "release"): - if (env["debug_release"]=="yes"): + if (env["debug_release"] == "yes"): env.Append(CCFLAGS=['-g2']) else: - env.Append(CCFLAGS=['-O3','-ffast-math']) + env.Append(CCFLAGS=['-O3', '-ffast-math']) - elif (env["target"]=="release_debug"): + elif (env["target"] == "release_debug"): - env.Append(CCFLAGS=['-O2','-ffast-math','-DDEBUG_ENABLED']) - if (env["debug_release"]=="yes"): + env.Append(CCFLAGS=['-O2', '-ffast-math', '-DDEBUG_ENABLED']) + if (env["debug_release"] == "yes"): env.Append(CCFLAGS=['-g2']) - elif (env["target"]=="debug"): + elif (env["target"] == "debug"): - env.Append(CCFLAGS=['-g2', '-Wall','-DDEBUG_ENABLED','-DDEBUG_MEMORY_ENABLED']) + env.Append(CCFLAGS=['-g2', '-Wall', '-DDEBUG_ENABLED', '-DDEBUG_MEMORY_ENABLED']) env.ParseConfig('pkg-config x11 --cflags --libs') env.ParseConfig('pkg-config xinerama --cflags --libs') @@ -180,7 +180,7 @@ def configure(env): if (env["glew"] == "system"): env.ParseConfig('pkg-config glew --cflags --libs') - if os.system("pkg-config --exists alsa")==0: + if os.system("pkg-config --exists alsa") == 0: print("Enabling ALSA") env.Append(CPPFLAGS=["-DALSA_ENABLED"]) env.ParseConfig('pkg-config alsa --cflags --libs') @@ -189,7 +189,7 @@ def configure(env): if (platform.system() == "Linux"): env.Append(CPPFLAGS=["-DJOYDEV_ENABLED"]) - if (env["udev"]=="yes"): + if (env["udev"] == "yes"): # pkg-config returns 0 when the lib exists... found_udev = not os.system("pkg-config --exists libudev") @@ -200,7 +200,7 @@ def configure(env): else: print("libudev development libraries not found, disabling udev support") - if (env["pulseaudio"]=="yes"): + if (env["pulseaudio"] == "yes"): if not os.system("pkg-config --exists libpulse-simple"): print("Enabling PulseAudio") env.Append(CPPFLAGS=["-DPULSEAUDIO_ENABLED"]) @@ -208,33 +208,33 @@ def configure(env): else: print("PulseAudio development libraries not found, disabling driver") - env.Append(CPPFLAGS=['-DX11_ENABLED','-DUNIX_ENABLED','-DGLES2_ENABLED','-DGLES_OVER_GL']) + env.Append(CPPFLAGS=['-DX11_ENABLED', '-DUNIX_ENABLED', '-DGLES2_ENABLED', '-DGLES_OVER_GL']) env.Append(LIBS=['GL', 'pthread', 'z']) if (platform.system() == "Linux"): env.Append(LIBS='dl') - #env.Append(CPPFLAGS=['-DMPC_FIXED_POINT']) + # env.Append(CPPFLAGS=['-DMPC_FIXED_POINT']) -#host compiler is default.. +# host compiler is default.. - if (is64 and env["bits"]=="32"): + if (is64 and env["bits"] == "32"): env.Append(CPPFLAGS=['-m32']) - env.Append(LINKFLAGS=['-m32','-L/usr/lib/i386-linux-gnu']) - elif (not is64 and env["bits"]=="64"): + env.Append(LINKFLAGS=['-m32', '-L/usr/lib/i386-linux-gnu']) + elif (not is64 and env["bits"] == "64"): env.Append(CPPFLAGS=['-m64']) - env.Append(LINKFLAGS=['-m64','-L/usr/lib/i686-linux-gnu']) + env.Append(LINKFLAGS=['-m64', '-L/usr/lib/i686-linux-gnu']) import methods - env.Append( BUILDERS = { 'GLSL120' : env.Builder(action = methods.build_legacygl_headers, suffix = 'glsl.h',src_suffix = '.glsl') } ) - env.Append( BUILDERS = { 'GLSL' : env.Builder(action = methods.build_glsl_headers, suffix = 'glsl.h',src_suffix = '.glsl') } ) - env.Append( BUILDERS = { 'GLSL120GLES' : env.Builder(action = methods.build_gles2_headers, suffix = 'glsl.h',src_suffix = '.glsl') } ) + env.Append(BUILDERS={'GLSL120': env.Builder(action=methods.build_legacygl_headers, suffix='glsl.h', src_suffix='.glsl')}) + env.Append(BUILDERS={'GLSL': env.Builder(action=methods.build_glsl_headers, suffix='glsl.h', src_suffix='.glsl')}) + env.Append(BUILDERS={'GLSL120GLES': env.Builder(action=methods.build_gles2_headers, suffix='glsl.h', src_suffix='.glsl')}) #env.Append( BUILDERS = { 'HLSL9' : env.Builder(action = methods.build_hlsl_dx9_headers, suffix = 'hlsl.h',src_suffix = '.hlsl') } ) - if (env["use_static_cpp"]=="yes"): + if (env["use_static_cpp"] == "yes"): env.Append(LINKFLAGS=['-static-libstdc++']) list_of_x86 = ['x86_64', 'x86', 'i386', 'i586'] if any(platform.machine() in s for s in list_of_x86): - env["x86_libtheora_opt_gcc"]=True + env["x86_libtheora_opt_gcc"] = True |