ソースを参照

Updated to Emscripten 1.25.0.

Branimir Karadžić 11 年 前
コミット
1252cf3ca8
2 ファイル変更31 行追加27 行削除
  1. 12 5
      include/bx/platform.h
  2. 19 22
      scripts/toolchain.lua

+ 12 - 5
include/bx/platform.h

@@ -126,12 +126,14 @@
 #	define BX_PLATFORM_RPI 1
 #elif defined(__native_client__)
 // NaCl compiler defines __linux__
+#	include <ppapi/c/pp_macros.h>
 #	undef  BX_PLATFORM_NACL
-#	define BX_PLATFORM_NACL 1
+#	define BX_PLATFORM_NACL PPAPI_RELEASE
 #elif defined(__ANDROID__)
 // Android compiler defines __linux__
+#	include <android/api-level.h>
 #	undef  BX_PLATFORM_ANDROID
-#	define BX_PLATFORM_ANDROID 1
+#	define BX_PLATFORM_ANDROID __ANDROID_API__
 #elif defined(__linux__)
 #	undef  BX_PLATFORM_LINUX
 #	define BX_PLATFORM_LINUX 1
@@ -195,9 +197,13 @@
 #endif // BX_COMPILER_
 
 #if BX_PLATFORM_ANDROID
-#	define BX_PLATFORM_NAME "Android"
+#	define BX_PLATFORM_NAME "Android " \
+				BX_STRINGIZE(BX_PLATFORM_ANDROID)
 #elif BX_PLATFORM_EMSCRIPTEN
-#	define BX_PLATFORM_NAME "asm.js"
+#	define BX_PLATFORM_NAME "asm.js " \
+				BX_STRINGIZE(__EMSCRIPTEN_major__) "." \
+				BX_STRINGIZE(__EMSCRIPTEN_minor__) "." \
+				BX_STRINGIZE(__EMSCRIPTEN_tiny__)
 #elif BX_PLATFORM_FREEBSD
 #	define BX_PLATFORM_NAME "FreeBSD"
 #elif BX_PLATFORM_IOS
@@ -205,7 +211,8 @@
 #elif BX_PLATFORM_LINUX
 #	define BX_PLATFORM_NAME "Linux"
 #elif BX_PLATFORM_NACL
-#	define BX_PLATFORM_NAME "NaCl"
+#	define BX_PLATFORM_NAME "NaCl " \
+				BX_STRINGIZE(BX_PLATFORM_NACL)
 #elif BX_PLATFORM_OSX
 #	define BX_PLATFORM_NAME "OSX"
 #elif BX_PLATFORM_QNX

+ 19 - 22
scripts/toolchain.lua

@@ -120,6 +120,7 @@ function toolchain(_buildDir, _libDir)
 			premake.gcc.cc = "$(EMSCRIPTEN)/emcc"
 			premake.gcc.cxx = "$(EMSCRIPTEN)/em++"
 			premake.gcc.ar = "ar"
+--			premake.gcc.ar = "$(EMSCRIPTEN)/emar"
 			location (_buildDir .. "projects/" .. _ACTION .. "-asmjs")
 		end
 
@@ -553,13 +554,9 @@ function toolchain(_buildDir, _libDir)
 		targetdir (_buildDir .. "asmjs" .. "/bin")
 		objdir (_buildDir .. "asmjs" .. "/obj")
 		libdirs { _libDir .. "lib/asmjs" }
-		includedirs {
-			"$(EMSCRIPTEN)/system/include",
-			"$(EMSCRIPTEN)/system/include/libc",
-		}
 		buildoptions {
-			"-Wno-unknown-warning-option", -- Linux Emscripten doesn't know about no-warn-absolute-paths...
-			"-Wno-warn-absolute-paths",
+			"-isystem$(EMSCRIPTEN)/system/include",
+			"-isystem$(EMSCRIPTEN)/system/include/libc",
 			"-Wunused-value",
 			"-Wundef",
 		}
@@ -773,50 +770,50 @@ function strip()
 
 	configuration { "android-arm", "Release" }
 		postbuildcommands {
-			"@echo Stripping symbols.",
-			"@$(ANDROID_NDK_ARM)/bin/arm-linux-androideabi-strip -s \"$(TARGET)\""
+			"$(SILENT) echo Stripping symbols.",
+			"$(SILENT) $(ANDROID_NDK_ARM)/bin/arm-linux-androideabi-strip -s \"$(TARGET)\""
 		}
 
 	configuration { "android-mips", "Release" }
 		postbuildcommands {
-			"@echo Stripping symbols.",
-			"@$(ANDROID_NDK_MIPS)/bin/mipsel-linux-android-strip -s \"$(TARGET)\""
+			"$(SILENT) echo Stripping symbols.",
+			"$(SILENT) $(ANDROID_NDK_MIPS)/bin/mipsel-linux-android-strip -s \"$(TARGET)\""
 		}
 
 	configuration { "android-x86", "Release" }
 		postbuildcommands {
-			"@echo Stripping symbols.",
-			"@$(ANDROID_NDK_X86)/bin/i686-linux-android-strip -s \"$(TARGET)\""
+			"$(SILENT) echo Stripping symbols.",
+			"$(SILENT) $(ANDROID_NDK_X86)/bin/i686-linux-android-strip -s \"$(TARGET)\""
 		}
 
 	configuration { "linux-* or rpi", "Release" }
 		postbuildcommands {
-			"@echo Stripping symbols.",
-			"@strip -s \"$(TARGET)\""
+			"$(SILENT) echo Stripping symbols.",
+			"$(SILENT) strip -s \"$(TARGET)\""
 		}
 
 	configuration { "mingw*", "Release" }
 		postbuildcommands {
-			"@echo Stripping symbols.",
-			"@$(MINGW)/bin/strip -s \"$(TARGET)\""
+			"$(SILENT) echo Stripping symbols.",
+			"$(SILENT) $(MINGW)/bin/strip -s \"$(TARGET)\""
 		}
 
 	configuration { "pnacl" }
 		postbuildcommands {
-			"@echo Running pnacl-finalize.",
-			"@" .. naclToolchain .. "finalize \"$(TARGET)\""
+			"$(SILENT) echo Running pnacl-finalize.",
+			"$(SILENT) " .. naclToolchain .. "finalize \"$(TARGET)\""
 		}
 
 	configuration { "*nacl*", "Release" }
 		postbuildcommands {
-			"@echo Stripping symbols.",
-			"@" .. naclToolchain .. "strip -s \"$(TARGET)\""
+			"$(SILENT) echo Stripping symbols.",
+			"$(SILENT) " .. naclToolchain .. "strip -s \"$(TARGET)\""
 		}
 
 	configuration { "asmjs" }
 		postbuildcommands {
-			"@echo Running asmjs finalize.",
-			"@$(EMSCRIPTEN)/emcc -O2 -s TOTAL_MEMORY=268435456 \"$(TARGET)\" -o \"$(TARGET)\".html"
+			"$(SILENT) echo Running asmjs finalize.",
+			"$(SILENT) $(EMSCRIPTEN)/emcc -O2 -s TOTAL_MEMORY=268435456 \"$(TARGET)\" -o \"$(TARGET)\".html"
 			-- ALLOW_MEMORY_GROWTH
 		}