diff options
Diffstat (limited to 'platform')
| -rw-r--r-- | platform/android/SCsub | 4 | ||||
| -rw-r--r-- | platform/android/detect.py | 28 | ||||
| -rw-r--r-- | platform/flash/SCsub | 1 | ||||
| -rw-r--r-- | platform/flash/detect.py | 1 | ||||
| -rw-r--r-- | platform/iphone/SCsub | 11 | ||||
| -rw-r--r-- | platform/iphone/app_delegate.mm | 6 | ||||
| -rw-r--r-- | platform/iphone/detect.py | 13 | ||||
| -rw-r--r-- | platform/javascript/SCsub | 4 | ||||
| -rw-r--r-- | platform/javascript/detect.py | 11 | ||||
| -rw-r--r-- | platform/osx/SCsub | 2 | ||||
| -rw-r--r-- | platform/osx/detect.py | 18 | ||||
| -rw-r--r-- | platform/server/detect.py | 38 | ||||
| -rw-r--r-- | platform/windows/SCsub | 2 | ||||
| -rw-r--r-- | platform/windows/detect.py | 101 | ||||
| -rw-r--r-- | platform/x11/SCsub | 2 | ||||
| -rw-r--r-- | platform/x11/detect.py | 64 |
16 files changed, 108 insertions, 198 deletions
diff --git a/platform/android/SCsub b/platform/android/SCsub index 699db30ca..3c55b993e 100644 --- a/platform/android/SCsub +++ b/platform/android/SCsub @@ -66,6 +66,6 @@ for x in env.android_module_libraries: shutil.copy(x,abspath+"/java/libs") -env_android.SharedLibrary("#platform/android/libgodot_android.so",[android_objects]) +env_android.SharedLibrary("#bin/libgodot_android",[android_objects],SHLIBSUFFIX=env["SHLIBSUFFIX"]) -env.Command('#bin/libgodot_android.so', '#platform/android/libgodot_android.so', Copy('bin/libgodot_android.so', 'platform/android/libgodot_android.so')) +#env.Command('#bin/libgodot_android.so', '#platform/android/libgodot_android.so', Copy('bin/libgodot_android.so', 'platform/android/libgodot_android.so')) diff --git a/platform/android/detect.py b/platform/android/detect.py index 0c860c23b..062cc62b5 100644 --- a/platform/android/detect.py +++ b/platform/android/detect.py @@ -27,14 +27,13 @@ def get_opts(): ('NDK_TARGET', 'toolchain to use for the NDK',"arm-linux-androideabi-4.8"), ('android_stl','enable STL support in android port (for modules)','no'), ('armv6','compile for older phones running arm v6 (instead of v7+neon+smp)','no'), - ('x86','compile for x86','no') + ('x86','Xompile for Android-x86','no') ] def get_flags(): return [ - ('lua', 'no'), ('tools', 'no'), ('nedmalloc', 'no'), ('builtin_zlib', 'no'), @@ -77,13 +76,7 @@ def configure(env): env.Append(CPPPATH=['#platform/android']) if env['x86']=='yes': - env['OBJSUFFIX'] = ".android.ox" - env['LIBSUFFIX'] = ".android.ax" - else: - env['OBJSUFFIX'] = ".android.o" - env['LIBSUFFIX'] = ".android.a" - env['PROGSUFFIX'] = ".android" - env['SHLIBSUFFIX'] = ".so" + env.extra_suffix=".x86" gcc_path=env["ANDROID_NDK_ROOT"]+"/toolchains/"+env["NDK_TARGET"]+"/prebuilt/"; @@ -128,7 +121,7 @@ def configure(env): 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 ') - print("********* armv6", env['armv6']) + if env['x86']=='yes': env['CCFLAGS'] = string.split('-DNO_STATVFS -MMD -MP -MF -fpic -ffunction-sections -funwind-tables -fstack-protector -D__GLIBC__ -Wno-psabi -ftree-vectorize -funsafe-math-optimizations -fno-strict-aliasing -DANDROID -Wa,--noexecstack -DGLES2_ENABLED -DGLES1_ENABLED') elif env["armv6"]!="no": @@ -149,23 +142,10 @@ def configure(env): if (env["target"]=="release"): env.Append(CCFLAGS=['-O2', '-ffast-math','-fomit-frame-pointer']) - env['OBJSUFFIX'] = "_opt"+env['OBJSUFFIX'] - env['LIBSUFFIX'] = "_opt"+env['LIBSUFFIX'] elif (env["target"]=="release_debug"): env.Append(CCFLAGS=['-O2', '-ffast-math','-DDEBUG_ENABLED']) - env['OBJSUFFIX'] = "_optd"+env['OBJSUFFIX'] - env['LIBSUFFIX'] = "_optd"+env['LIBSUFFIX'] - - elif (env["target"]=="profile"): - - env.Append(CCFLAGS=['-O2', '-ffast-math','-fomit-frame-pointer', '-g1']) - env.Append(LIBPATH=['#platform/android/armeabi']) - env.Append(LIBS=['andprof']) - env['OBJSUFFIX'] = "_prof"+env['OBJSUFFIX'] - env['LIBSUFFIX'] = "_prof"+env['LIBSUFFIX'] - env['SHLIBSUFFIX'] = "_prof"+env['SHLIBSUFFIX'] elif (env["target"]=="debug"): @@ -174,8 +154,10 @@ def configure(env): if env["armv6"] == "no" and env['x86'] != 'yes': env['neon_enabled']=True + env.Append(CPPFLAGS=['-DANDROID_ENABLED', '-DUNIX_ENABLED', '-DNO_FCNTL','-DMPC_FIXED_POINT']) # env.Append(CPPFLAGS=['-DANDROID_ENABLED', '-DUNIX_ENABLED','-DMPC_FIXED_POINT']) + 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.4.3/include"]) diff --git a/platform/flash/SCsub b/platform/flash/SCsub index 0dea7bf01..b7aef3b65 100644 --- a/platform/flash/SCsub +++ b/platform/flash/SCsub @@ -8,7 +8,6 @@ common_flash=[\ #"dir_access_flash.cpp", ] -print("** path is ", env['ENV']['PATH']) abc = env.Command('#platform/flash/Console.abc', '#platform/flash/Console.as', """ diff --git a/platform/flash/detect.py b/platform/flash/detect.py index 56d2516ab..5507ce517 100644 --- a/platform/flash/detect.py +++ b/platform/flash/detect.py @@ -11,7 +11,6 @@ def get_name(): def can_build(): #import os - print(os.environ) if (not os.environ.has_key("FLASCC_ROOT")): return False return True diff --git a/platform/iphone/SCsub b/platform/iphone/SCsub index d30d101e1..9fc90bc84 100644 --- a/platform/iphone/SCsub +++ b/platform/iphone/SCsub @@ -35,11 +35,6 @@ if env['ios_appirater'] == "yes": obj = env_ios.Object('godot_iphone.cpp') prog = None -if env["target"]=="release" or env["target"] == "release_debug": - prog = env_ios.Program('#bin/godot_opt', [obj] + iphone_lib) - #action = "dsymutil "+File(prog)[0].path+" -o ../build/script_exec/build/Debug-iphoneos/script_exec.app.dSYM" - #env.AddPostAction(prog, action) -else: - prog = env_ios.Program('#bin/godot', [obj] + iphone_lib) - action = "dsymutil "+File(prog)[0].path+" -o bin/godot.iphone.dSYM" - env.AddPostAction(prog, action) +prog = env_ios.Program('#bin/godot', [obj] + iphone_lib) +action = "dsymutil "+File(prog)[0].path+" -o " + File(prog)[0].path + ".dSYM" +env.AddPostAction(prog, action) diff --git a/platform/iphone/app_delegate.mm b/platform/iphone/app_delegate.mm index 9877e09ad..76c2d0608 100644 --- a/platform/iphone/app_delegate.mm +++ b/platform/iphone/app_delegate.mm @@ -257,7 +257,8 @@ static int frame_count = 0; - (void)applicationDidEnterBackground:(UIApplication *)application { printf("********************* did enter background\n"); - OS::get_singleton()->get_main_loop()->notification(MainLoop::NOTIFICATION_WM_FOCUS_OUT); + if (OS::get_singleton()->get_main_loop()) + OS::get_singleton()->get_main_loop()->notification(MainLoop::NOTIFICATION_WM_FOCUS_OUT); [view_controller.view stopAnimation]; } @@ -282,7 +283,8 @@ static int frame_count = 0; printf("********************* mobile app tracker found\n"); [MobileAppTracker measureSession]; #endif - OS::get_singleton()->get_main_loop()->notification(MainLoop::NOTIFICATION_WM_FOCUS_IN); + if (OS::get_singleton()->get_main_loop()) + OS::get_singleton()->get_main_loop()->notification(MainLoop::NOTIFICATION_WM_FOCUS_IN); [view_controller.view startAnimation]; // FIXME: resume seems to be recommended elsewhere } diff --git a/platform/iphone/detect.py b/platform/iphone/detect.py index 2065d459c..96b8dcb13 100644 --- a/platform/iphone/detect.py +++ b/platform/iphone/detect.py @@ -34,9 +34,7 @@ def get_opts(): def get_flags(): return [ - ('lua', 'no'), ('tools', 'no'), - ('nedmalloc', 'no'), ('webp', 'yes'), ('openssl','builtin'), #use builtin openssl ] @@ -47,10 +45,6 @@ def configure(env): env.Append(CPPPATH=['#platform/iphone', '#platform/iphone/include']) - env['OBJSUFFIX'] = ".iphone.o" - env['LIBSUFFIX'] = ".iphone.a" - env['PROGSUFFIX'] = ".iphone" - env['ENV']['PATH'] = env['IPHONEPATH']+"/Developer/usr/bin/:"+env['ENV']['PATH'] # env['CC'] = '$IPHONEPATH/Developer/usr/bin/gcc' @@ -101,15 +95,11 @@ def configure(env): env.Append(CCFLAGS=['-Os', '-ffast-math', '-DNS_BLOCK_ASSERTIONS=1','-Wall']) env.Append(LINKFLAGS=['-Os', '-ffast-math']) - env['OBJSUFFIX'] = "_opt"+env['OBJSUFFIX'] - env['LIBSUFFIX'] = "_opt"+env['LIBSUFFIX'] elif env["target"] == "release_debug": env.Append(CCFLAGS=['-Os', '-ffast-math', '-DNS_BLOCK_ASSERTIONS=1','-Wall','-DDEBUG_ENABLED']) env.Append(LINKFLAGS=['-Os', '-ffast-math']) env.Append(CPPFLAGS=['-DDEBUG_MEMORY_ENABLED']) - env['OBJSUFFIX'] = "_opt"+env['OBJSUFFIX'] - env['LIBSUFFIX'] = "_opt"+env['LIBSUFFIX'] elif (env["target"]=="debug"): @@ -131,8 +121,5 @@ def configure(env): #env['neon_enabled']=True env['S_compiler'] = '$IPHONEPATH/Developer/usr/bin/gcc' - if env['lua'] == "yes": - env.Append(CCFLAGS=['-DLUA_USE_FLOAT']) - # /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c-header -arch armv7s -fmessage-length=0 -std=gnu99 -fobjc-arc -Wno-trigraphs -fpascal-strings -Os -Wno-missing-field-initializers -Wno-missing-prototypes -Wreturn-type -Wno-implicit-atomic-properties -Wno-receiver-is-weak -Wduplicate-method-match -Wformat -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wno-shorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wno-undeclared-selector -Wno-deprecated-implementations -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk -Wprotocol -Wdeprecated-declarations -g -fvisibility=hidden -Wno-sign-conversion "-DIBOutlet=__attribute__((iboutlet))" "-DIBOutletCollection(ClassName)=__attribute__((iboutletcollection(ClassName)))" "-DIBAction=void)__attribute__((ibaction)" -miphoneos-version-min=4.3 -iquote /Users/lucasgondolo/test/build/test.build/Release-iphoneos/test.build/test-generated-files.hmap -I/Users/lucasgondolo/test/build/test.build/Release-iphoneos/test.build/test-own-target-headers.hmap -I/Users/lucasgondolo/test/build/test.build/Release-iphoneos/test.build/test-all-target-headers.hmap -iquote /Users/lucasgondolo/test/build/test.build/Release-iphoneos/test.build/test-project-headers.hmap -I/Users/lucasgondolo/test/build/Release-iphoneos/include -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -I/Users/lucasgondolo/test/build/test.build/Release-iphoneos/test.build/DerivedSources/armv7s -I/Users/lucasgondolo/test/build/test.build/Release-iphoneos/test.build/DerivedSources -F/Users/lucasgondolo/test/build/Release-iphoneos -DNS_BLOCK_ASSERTIONS=1 --serialize-diagnostics /var/folders/9r/_65jj9457bgb4n4nxcsm0xl80000gn/C/com.apple.Xcode.501/SharedPrecompiledHeaders/test-Prefix-esrzoamhgruxcxbhemvvlrjmmvoh/test-Prefix.pch.dia -c /Users/lucasgondolo/test/test/test-Prefix.pch -o /var/folders/9r/_65jj9457bgb4n4nxcsm0xl80000gn/C/com.apple.Xcode.501/SharedPrecompiledHeaders/test-Prefix-esrzoamhgruxcxbhemvvlrjmmvoh/test-Prefix.pch.pth -MMD -MT dependencies -MF /var/folders/9r/_65jj9457bgb4n4nxcsm0xl80000gn/C/com.apple.Xcode.501/SharedPrecompiledHeaders/test-Prefix-esrzoamhgruxcxbhemvvlrjmmvoh/test-Prefix.pch.d diff --git a/platform/javascript/SCsub b/platform/javascript/SCsub index fd1bb39e9..c1ba0c228 100644 --- a/platform/javascript/SCsub +++ b/platform/javascript/SCsub @@ -6,8 +6,6 @@ javascript_files = [ "javascript_main.cpp" ] -#env.Depends('#core/math/vector3.h', 'vector3_psp.h') - #obj = env.SharedObject('godot_javascript.cpp') env_javascript = env.Clone() @@ -22,4 +20,4 @@ prog = None #env_javascript.SharedLibrary("#platform/javascript/libgodot_javascript.so",[javascript_objects]) -env.Program('#bin/godot.html', javascript_objects) +env.Program('#bin/godot',javascript_objects,PROGSUFFIX=env["PROGSUFFIX"]+".html") diff --git a/platform/javascript/detect.py b/platform/javascript/detect.py index e4cdaad31..845b2e339 100644 --- a/platform/javascript/detect.py +++ b/platform/javascript/detect.py @@ -46,11 +46,7 @@ def get_flags(): def configure(env): - env.Append(CPPPATH=['#platform/android']) - - env['OBJSUFFIX'] = ".js.o" - env['LIBSUFFIX'] = ".js.a" - env['PROGSUFFIX'] = ".html" + env.Append(CPPPATH=['#platform/javascript']) em_path=os.environ["EMSCRIPTEN_ROOT"] @@ -68,17 +64,12 @@ def configure(env): if (env["target"]=="release"): env.Append(CCFLAGS=['-O2']) - env['OBJSUFFIX'] = "_opt"+env['OBJSUFFIX'] - env['LIBSUFFIX'] = "_opt"+env['LIBSUFFIX'] elif (env["target"]=="release_debug"): env.Append(CCFLAGS=['-O2','-DDEBUG_ENABLED']) - env['OBJSUFFIX'] = "_optd"+env['OBJSUFFIX'] - env['LIBSUFFIX'] = "_optd"+env['LIBSUFFIX'] elif (env["target"]=="debug"): - env.Append(CCFLAGS=['-D_DEBUG', '-Wall', '-O2', '-DDEBUG_ENABLED']) env.Append(CPPFLAGS=['-DDEBUG_MEMORY_ALLOC']) diff --git a/platform/osx/SCsub b/platform/osx/SCsub index d7839d7d6..4904636af 100644 --- a/platform/osx/SCsub +++ b/platform/osx/SCsub @@ -8,4 +8,4 @@ files = [ # 'context_gl_osx.cpp', ] -env.Program('#bin/godot_osx',files) +env.Program('#bin/godot',files) diff --git a/platform/osx/detect.py b/platform/osx/detect.py index 533741607..1b3283852 100644 --- a/platform/osx/detect.py +++ b/platform/osx/detect.py @@ -38,42 +38,30 @@ def configure(env): env.Append(CPPPATH=['#platform/osx']) - if (env["tools"]=="no"): - #no tools suffix - env['OBJSUFFIX'] = ".nt"+env['OBJSUFFIX'] - env['LIBSUFFIX'] = ".nt"+env['LIBSUFFIX'] + if (env["bits"]=="default"): + env["bits"]="32" if (env["target"]=="release"): env.Append(CCFLAGS=['-O2','-ffast-math','-fomit-frame-pointer','-ftree-vectorize','-msse2']) - env['OBJSUFFIX'] = "_opt"+env['OBJSUFFIX'] - env['LIBSUFFIX'] = "_opt"+env['LIBSUFFIX'] elif (env["target"]=="release_debug"): env.Append(CCFLAGS=['-O2','-DDEBUG_ENABLED']) - env['OBJSUFFIX'] = "_optd"+env['OBJSUFFIX'] - env['LIBSUFFIX'] = "_optd"+env['LIBSUFFIX'] elif (env["target"]=="debug"): env.Append(CCFLAGS=['-g3', '-Wall','-DDEBUG_ENABLED','-DDEBUG_MEMORY_ENABLED']) - elif (env["target"]=="profile"): - env.Append(CCFLAGS=['-g','-pg']) - env.Append(LINKFLAGS=['-pg']) - if (env["freetype"]!="no"): env.Append(CCFLAGS=['-DFREETYPE_ENABLED']) env.Append(CPPPATH=['#tools/freetype']) env.Append(CPPPATH=['#tools/freetype/freetype/include']) - if (env["force_64_bits"]!="no"): + if (env["bits"]=="64"): env.Append(CCFLAGS=['-arch', 'x86_64']) env.Append(LINKFLAGS=['-arch', 'x86_64']) - env['OBJSUFFIX'] = ".64"+env['OBJSUFFIX'] - env['LIBSUFFIX'] = ".64"+env['LIBSUFFIX'] else: env.Append(CCFLAGS=['-arch', 'i386']) env.Append(LINKFLAGS=['-arch', 'i386']) diff --git a/platform/server/detect.py b/platform/server/detect.py index 682c6d072..24b36d318 100644 --- a/platform/server/detect.py +++ b/platform/server/detect.py @@ -41,50 +41,36 @@ def configure(env): env["CXX"]="clang++" env["LD"]="clang++" - env['OBJSUFFIX'] = ".srv"+env['OBJSUFFIX'] - env['LIBSUFFIX'] = ".srv"+env['LIBSUFFIX'] + is64=sys.maxsize > 2**32 - if (env["force_32_bits"]!="no"): - env['OBJSUFFIX'] = ".32"+env['OBJSUFFIX'] - env['LIBSUFFIX'] = ".32"+env['LIBSUFFIX'] + if (env["bits"]=="default"): + if (is64): + env["bits"]="64" + else: + env["bits"]="32" - if (env["tools"]=="no"): - #no tools suffix - env['OBJSUFFIX'] = ".nt"+env['OBJSUFFIX'] - env['LIBSUFFIX'] = ".nt"+env['LIBSUFFIX'] + #if (env["tools"]=="no"): + # #no tools suffix + # env['OBJSUFFIX'] = ".nt"+env['OBJSUFFIX'] + # env['LIBSUFFIX'] = ".nt"+env['LIBSUFFIX'] if (env["target"]=="release"): - + env.Append(CCFLAGS=['-O2','-ffast-math','-fomit-frame-pointer']) - env['OBJSUFFIX'] = "_opt"+env['OBJSUFFIX'] - env['LIBSUFFIX'] = "_opt"+env['LIBSUFFIX'] elif (env["target"]=="release_debug"): env.Append(CCFLAGS=['-O2','-ffast-math','-DDEBUG_ENABLED']) - env['OBJSUFFIX'] = "_optd"+env['OBJSUFFIX'] - env['LIBSUFFIX'] = "_optd"+env['LIBSUFFIX'] - elif (env["target"]=="debug"): - - env.Append(CCFLAGS=['-g2', '-Wall','-DDEBUG_ENABLED','-DDEBUG_MEMORY_ENABLED']) - elif (env["target"]=="profile"): - - env.Append(CCFLAGS=['-g','-pg']) - env.Append(LINKFLAGS=['-pg']) + 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! - if (env["force_32_bits"]=="yes"): - env.Append(CPPFLAGS=['-m32']) - env.Append(LINKFLAGS=['-m32','-L/usr/lib/i386-linux-gnu']) - if (env["CXX"]=="clang++"): env.Append(CPPFLAGS=['-DTYPED_METHOD_BIND']) env["CC"]="clang" diff --git a/platform/windows/SCsub b/platform/windows/SCsub index 1d454e40c..7bdf9b217 100644 --- a/platform/windows/SCsub +++ b/platform/windows/SCsub @@ -10,4 +10,4 @@ common_win=[ "stream_peer_winsock.cpp", ] -env.Program('#bin/godot.exe',['godot_win.cpp']+common_win) +env.Program('#bin/godot',['godot_win.cpp']+common_win,PROGSUFFIX=env["PROGSUFFIX"]+".exe") diff --git a/platform/windows/detect.py b/platform/windows/detect.py index 327788416..fd45a28d1 100644 --- a/platform/windows/detect.py +++ b/platform/windows/detect.py @@ -25,26 +25,38 @@ def can_build(): if (os.name=="posix"):
-
- if os.system("i586-mingw32msvc-gcc --version") == 0:
+
+ mingw = "i586-mingw32msvc-"
+ mingw64 = "i686-w64-mingw32-"
+ if (os.getenv("MINGW32_PREFIX")):
+ mingw=os.getenv("MINGW32_PREFIX")
+ if (os.getenv("MINGW64_PREFIX")):
+ mingw64=os.getenv("MINGW64_PREFIX")
+
+ if os.system(mingw+"gcc --version >/dev/null") == 0 or os.system(mingw64+"gcc --version >/dev/null") ==0:
return True
+
return False
def get_opts():
- mwp=""
- mwp64=""
+ mingw=""
+ mingw64=""
if (os.name!="nt"):
- mwp="i586-mingw32msvc-"
- mwp64="x86_64-w64-mingw32-"
+ mingw = "i586-mingw32msvc-"
+ mingw64 = "i686-w64-mingw32-"
+ if (os.getenv("MINGW32_PREFIX")):
+ mingw=os.getenv("MINGW32_PREFIX")
+ if (os.getenv("MINGW64_PREFIX")):
+ mingw64=os.getenv("MINGW64_PREFIX")
+
return [
- ('force_64_bits','Force 64 bits binary','no'),
- ('force_32_bits','Force 32 bits binary','no'),
- ('mingw_prefix','Mingw Prefix',mwp),
- ('mingw_prefix_64','Mingw Prefix 64 bits',mwp64),
+ ('mingw_prefix','Mingw Prefix',mingw),
+ ('mingw_prefix_64','Mingw Prefix 64 bits',mingw64),
+ ('mingw64_for_32','Use Mingw 64 for 32 Bits Build',"no"),
]
def get_flags():
@@ -58,19 +70,8 @@ def get_flags(): def configure(env):
- if os.name == "posix":
- env['OBJSUFFIX'] = ".win"+env['OBJSUFFIX']
- env['LIBSUFFIX'] = ".win"+env['LIBSUFFIX']
-
env.Append(CPPPATH=['#platform/windows'])
- if (env["tools"]=="no"):
- #no tools suffix
- env['OBJSUFFIX'] = ".nt"+env['OBJSUFFIX']
- #env['LIBSUFFIX'] = ".nt"+env['LIBSUFFIX']
- env['platform_libsuffix'] = ".nt"+env['LIBSUFFIX']
-
-
if (os.name=="nt" and os.getenv("VSINSTALLDIR")!=None):
#build using visual studio
@@ -89,21 +90,17 @@ def configure(env): env.Append(LINKFLAGS=['/SUBSYSTEM:WINDOWS'])
env.Append(LINKFLAGS=['/ENTRY:mainCRTStartup'])
- elif (env["target"]=="test"):
+ elif (env["target"]=="release_debug"):
- env.Append(CCFLAGS=['/O2','/DDEBUG_ENABLED','/DD3D_DEBUG_INFO'])
+ env.Append(CCFLAGS=['/O2','/DDEBUG_ENABLED'])
env.Append(LINKFLAGS=['/SUBSYSTEM:CONSOLE'])
elif (env["target"]=="debug"):
- env.Append(CCFLAGS=['/Zi','/DDEBUG_ENABLED','/DD3D_DEBUG_INFO','/O1'])
+ env.Append(CCFLAGS=['/Zi','/DDEBUG_ENABLED','/DDEBUG_MEMORY_ENABLED','/DD3D_DEBUG_INFO','/O1'])
env.Append(LINKFLAGS=['/SUBSYSTEM:CONSOLE'])
env.Append(LINKFLAGS=['/DEBUG'])
- elif (env["target"]=="profile"):
-
- env.Append(CCFLAGS=['-g','-pg'])
- env.Append(LINKFLAGS=['-pg'])
env.Append(CCFLAGS=['/MT','/Gd','/GR','/nologo'])
env.Append(CXXFLAGS=['/TP'])
@@ -142,44 +139,52 @@ def configure(env): mingw_prefix=""
- if (env["force_32_bits"]!="no"):
- env['OBJSUFFIX'] = ".32"+env['OBJSUFFIX']
- env['LIBSUFFIX'] = ".32"+env['LIBSUFFIX']
- env.Append(CCFLAGS=['-m32'])
- env.Append(LINKFLAGS=['-m32'])
- env.Append(LINKFLAGS=['-static-libgcc'])
- env.Append(LINKFLAGS=['-static-libstdc++'])
+ if (env["bits"]=="default"):
+ env["bits"]="32"
+ use64=False
+ if (env["bits"]=="32"):
+ if (env["mingw64_for_32"]=="yes"):
+ env.Append(CCFLAGS=['-m32'])
+ env.Append(LINKFLAGS=['-m32'])
+ env.Append(LINKFLAGS=['-static-libgcc'])
+ env.Append(LINKFLAGS=['-static-libstdc++'])
+ mingw_prefix=env["mingw_prefix_64"];
+ else:
+ mingw_prefix=env["mingw_prefix"];
- if (env["force_64_bits"]!="no"):
+ else:
mingw_prefix=env["mingw_prefix_64"];
- env['OBJSUFFIX'] = ".64"+env['OBJSUFFIX']
- env['LIBSUFFIX'] = ".64"+env['LIBSUFFIX']
env.Append(LINKFLAGS=['-static'])
+
+ nulstr=""
+
+ if (os.name=="posix"):
+ nulstr=">/dev/null"
else:
- mingw_prefix=env["mingw_prefix"];
+ nulstr=">nul"
+
+
+
+ if os.system(mingw_prefix+"gcc --version"+nulstr)!=0:
+ #not really super consistent but..
+ print("Can't find Windows compiler: "+mingw_prefix)
+ sys.exit(255)
if (env["target"]=="release"):
env.Append(CCFLAGS=['-O3','-ffast-math','-fomit-frame-pointer','-msse2'])
- env['OBJSUFFIX'] = "_opt"+env['OBJSUFFIX']
- env['LIBSUFFIX'] = "_opt"+env['LIBSUFFIX']
env.Append(LINKFLAGS=['-Wl,--subsystem,windows'])
+
elif (env["target"]=="release_debug"):
env.Append(CCFLAGS=['-O2','-DDEBUG_ENABLED'])
- env['OBJSUFFIX'] = "_optd"+env['OBJSUFFIX']
- env['LIBSUFFIX'] = "_optd"+env['LIBSUFFIX']
elif (env["target"]=="debug"):
- env.Append(CCFLAGS=['-g', '-Wall','-DDEBUG_ENABLED'])
- elif (env["target"]=="release_tools"):
-
- env.Append(CCFLAGS=['-O2','-Wall','-DDEBUG_ENABLED'])
-
+ env.Append(CCFLAGS=['-g', '-Wall','-DDEBUG_ENABLED','-DDEBUG_MEMORY_ENABLED'])
if (env["freetype"]!="no"):
env.Append(CCFLAGS=['-DFREETYPE_ENABLED'])
diff --git a/platform/x11/SCsub b/platform/x11/SCsub index 1a552cbaa..7a6f02daa 100644 --- a/platform/x11/SCsub +++ b/platform/x11/SCsub @@ -8,5 +8,3 @@ common_x11=[\ ] env.Program('#bin/godot',['godot_x11.cpp']+common_x11) -if env['target'] == "release": - env.Command('#bin/godot_rel', '#bin/godot', Copy('bin/godot_rel', 'bin/godot')) diff --git a/platform/x11/detect.py b/platform/x11/detect.py index cff7ea86b..8616a2048 100644 --- a/platform/x11/detect.py +++ b/platform/x11/detect.py @@ -47,14 +47,11 @@ def get_opts(): return [ ('use_llvm','Use llvm compiler','no'), ('use_sanitizer','Use llvm compiler sanitize address','no'), - ('force_32_bits','Force 32 bits binary','no') ] def get_flags(): return [ - ('opengl', 'no'), - ('legacygl', 'yes'), ('builtin_zlib', 'no'), ("openssl", "yes"), ] @@ -63,6 +60,15 @@ def get_flags(): def configure(env): + is64=sys.maxsize > 2**32 + + if (env["bits"]=="default"): + if (is64): + env["bits"]="64" + else: + env["bits"]="32" + + env.Append(CPPPATH=['#platform/x11']) if (env["use_llvm"]=="yes"): env["CC"]="clang" @@ -74,50 +80,23 @@ def configure(env): - if (env["tools"]=="no"): - #no tools suffix - env['OBJSUFFIX'] = ".nt"+env['OBJSUFFIX'] - env['LIBSUFFIX'] = ".nt"+env['LIBSUFFIX'] + #if (env["tools"]=="no"): + # #no tools suffix + # env['OBJSUFFIX'] = ".nt"+env['OBJSUFFIX'] + # env['LIBSUFFIX'] = ".nt"+env['LIBSUFFIX'] if (env["target"]=="release"): env.Append(CCFLAGS=['-O2','-ffast-math','-fomit-frame-pointer']) - env['OBJSUFFIX'] = "_opt"+env['OBJSUFFIX'] - env['LIBSUFFIX'] = "_opt"+env['LIBSUFFIX'] elif (env["target"]=="release_debug"): env.Append(CCFLAGS=['-O2','-ffast-math','-DDEBUG_ENABLED']) - env['OBJSUFFIX'] = "_optd"+env['OBJSUFFIX'] - env['LIBSUFFIX'] = "_optd"+env['LIBSUFFIX'] - - -# env.Append(CCFLAGS=['-Os','-ffast-math','-fomit-frame-pointer']) -#does not seem to have much effect -# env.Append(CCFLAGS=['-fno-default-inline']) -#recommended by wxwidgets -# env.Append(CCFLAGS=['-ffunction-sections','-fdata-sections']) -# env.Append(LINKFLAGS=['-Wl','--gc-sections']) elif (env["target"]=="debug"): - - env.Append(CCFLAGS=['-g2', '-Wall','-DDEBUG_ENABLED','-DDEBUG_MEMORY_ENABLED']) -#does not seem to have much effect -# env.Append(CCFLAGS=['-fno-default-inline']) -#recommended by wxwidgets -# env.Append(CCFLAGS=['-ffunction-sections','-fdata-sections']) -# env.Append(LINKFLAGS=['-Wl','--gc-sections']) - - elif (env["target"]=="debug_light"): - env.Append(CCFLAGS=['-g1', '-Wall','-DDEBUG_ENABLED','-DDEBUG_MEMORY_ENABLED']) - - - elif (env["target"]=="profile"): - - env.Append(CCFLAGS=['-g','-pg']) - env.Append(LINKFLAGS=['-pg']) + env.Append(CCFLAGS=['-g2', '-Wall','-DDEBUG_ENABLED','-DDEBUG_MEMORY_ENABLED']) env.ParseConfig('pkg-config x11 --cflags --libs') env.ParseConfig('pkg-config xcursor --cflags --libs') @@ -128,19 +107,20 @@ def configure(env): env.Append(CCFLAGS=['-DFREETYPE_ENABLED']) - if env['opengl'] == 'yes': - env.Append(CPPFLAGS=['-DOPENGL_ENABLED','-DGLEW_ENABLED']) - #env.Append(CPPFLAGS=["-DRTAUDIO_ENABLED"]) + env.Append(CPPFLAGS=['-DOPENGL_ENABLED','-DGLEW_ENABLED']) env.Append(CPPFLAGS=["-DALSA_ENABLED"]) env.Append(CPPFLAGS=['-DX11_ENABLED','-DUNIX_ENABLED','-DGLES2_ENABLED','-DGLES1_ENABLED','-DGLES_OVER_GL']) -# env.Append(CPPFLAGS=['-DX11_ENABLED','-DUNIX_ENABLED','-DGLES2_ENABLED','-DGLES_OVER_GL']) env.Append(LIBS=['GL', 'GLU', 'pthread','asound','z']) #TODO detect linux/BSD! #env.Append(CPPFLAGS=['-DMPC_FIXED_POINT']) - if (env["force_32_bits"]=="yes"): + +#host compiler is default.. + + if (is64 and env["bits"]=="32"): env.Append(CPPFLAGS=['-m32']) env.Append(LINKFLAGS=['-m32','-L/usr/lib/i386-linux-gnu']) - env['OBJSUFFIX'] = ".32"+env['OBJSUFFIX'] - env['LIBSUFFIX'] = ".32"+env['LIBSUFFIX'] + elif (not is64 and env["bits"]=="32"): + env.Append(CPPFLAGS=['-m64']) + env.Append(LINKFLAGS=['-m64','-L/usr/lib/i686-linux-gnu']) if (env["CXX"]=="clang++"): |
