From 5b010b342e84cabae62ab337157cf12a7c1d92bf Mon Sep 17 00:00:00 2001 From: bkaradzic Date: Fri, 12 Apr 2013 23:38:05 -0700 Subject: [PATCH] Added BX_PLATFORM_QNX. --- include/bx/platform.h | 7 ++++++- include/bx/timer.h | 2 +- premake/toolchain.lua | 30 +++++++++++++++++++++++++++--- 3 files changed, 34 insertions(+), 5 deletions(-) diff --git a/include/bx/platform.h b/include/bx/platform.h index 552277f..ed9fb69 100644 --- a/include/bx/platform.h +++ b/include/bx/platform.h @@ -16,6 +16,7 @@ #define BX_PLATFORM_LINUX 0 #define BX_PLATFORM_NACL 0 #define BX_PLATFORM_OSX 0 +#define BX_PLATFORM_QNX 0 #define BX_PLATFORM_WINDOWS 0 #define BX_PLATFORM_XBOX360 0 @@ -71,6 +72,9 @@ #elif defined(EMSCRIPTEN) # undef BX_PLATFORM_EMSCRIPTEN # define BX_PLATFORM_EMSCRIPTEN 1 +#elif defined(__QNX__) +# undef BX_PLATFORM_QNX +# define BX_PLATFORM_QNX 1 #else # error "BX_PLATFORM_* is not defined!" #endif // @@ -80,7 +84,8 @@ || BX_PLATFORM_IOS \ || BX_PLATFORM_LINUX \ || BX_PLATFORM_NACL \ - || BX_PLATFORM_OSX) + || BX_PLATFORM_OSX \ + || BX_PLATFORM_QNX) // http://sourceforge.net/apps/mediawiki/predef/index.php?title=Architectures #if defined(__arm__) diff --git a/include/bx/timer.h b/include/bx/timer.h index 4262ce8..5d64537 100644 --- a/include/bx/timer.h +++ b/include/bx/timer.h @@ -10,7 +10,7 @@ #if BX_PLATFORM_ANDROID # include // clock, clock_gettime -#elif BX_PLATFORM_NACL || BX_PLATFORM_LINUX || BX_PLATFORM_OSX +#elif BX_PLATFORM_NACL || BX_PLATFORM_LINUX || BX_PLATFORM_OSX || BX_PLATFORM_QNX # include // gettimeofday #elif BX_PLATFORM_WINDOWS # include diff --git a/premake/toolchain.lua b/premake/toolchain.lua index 70b6876..441e534 100755 --- a/premake/toolchain.lua +++ b/premake/toolchain.lua @@ -19,6 +19,7 @@ function toolchain(_buildDir, _libDir) { "nacl-arm", "Native Client - ARM" }, { "pnacl", "Native Client - PNaCl" }, { "osx", "OS X" }, + { "qnx-arm", "QNX/Blackberry - ARM" }, } } @@ -107,6 +108,18 @@ function toolchain(_buildDir, _libDir) if "osx" == _OPTIONS["gcc"] then location (_buildDir .. "projects/" .. _ACTION .. "-osx") end + + if "qnx-arm" == _OPTIONS["gcc"] then + + if not os.getenv("QNX_HOST") then + print("Set QNX_HOST enviroment variables.") + end + + premake.gcc.cc = "$(QNX_HOST)/usr/bin/arm-unknown-nto-qnx8.0.0eabi-gcc" + premake.gcc.cxx = "$(QNX_HOST)/usr/bin/arm-unknown-nto-qnx8.0.0eabi-g++" + premake.gcc.ar = "$(QNX_HOST)/usr/bin/arm-unknown-nto-qnx8.0.0eabi-ar" + location (_buildDir .. "projects/" .. _ACTION .. "-qnx-arm") + end end flags { @@ -322,7 +335,7 @@ function toolchain(_buildDir, _libDir) "_XBOX", } - configuration { "macosx", "x32" } + configuration { "osx", "x32" } targetdir (_buildDir .. "osx32_gcc" .. "/bin") objdir (_buildDir .. "osx32_gcc" .. "/obj") libdirs { _libDir .. "lib/osx32_gcc" } @@ -330,7 +343,7 @@ function toolchain(_buildDir, _libDir) "-m32", } - configuration { "macosx", "x64" } + configuration { "osx", "x64" } targetdir (_buildDir .. "osx64_gcc" .. "/bin") objdir (_buildDir .. "osx64_gcc" .. "/obj") libdirs { _libDir .. "lib/osx64_gcc" } @@ -338,7 +351,7 @@ function toolchain(_buildDir, _libDir) "-m64", } - configuration { "macosx" } + configuration { "osx" } buildoptions { "-U__STRICT_ANSI__", "-Wfatal-errors", @@ -347,5 +360,16 @@ function toolchain(_buildDir, _libDir) } includedirs { bxDir .. "include/compat/osx" } + configuration { "qnx-arm" } +-- includedirs { bxDir .. "include/compat/qnx" } + buildoptions { + "-std=c++0x", + "-U__STRICT_ANSI__", + "-Wno-psabi", -- note: the mangling of 'va_list' has changed in GCC 4.4.0 + } + targetdir (_buildDir .. "qnx-arm" .. "/bin") + objdir (_buildDir .. "qnx-arm" .. "/obj") + libdirs { _libDir .. "lib/qnx-arm" } + configuration {} -- reset configuration end