Permalink
Browse files

Buildsys++, NaCl-ARM

- ui
  * SelectionArea -> StrategicArea
- cmake
  * Linux-XXX -> Linux-XXX-GCC
  * Android/NaCl SDK paths determined from environment
  * NaCl-glibc dropped
  * builds on NaCl-ARM
  • Loading branch information...
1 parent e6153be commit 6a9b4373b2dc8241deeb84fa528fb5e4d75a9185 @ducakar committed Jan 2, 2013
Showing with 320 additions and 296 deletions.
  1. +2 −2 CMakeLists.txt
  2. +8 −1 README.md
  3. +13 −10 build.sh
  4. +3 −4 cmake/Android14-ARM.Toolchain.cmake
  5. +3 −4 cmake/Android14-ARMv7a.Toolchain.cmake
  6. +3 −4 cmake/Android14-MIPS.Toolchain.cmake
  7. +3 −4 cmake/Android14-i686.Toolchain.cmake
  8. +1 −4 cmake/{FreeBSD-i686.Toolchain.cmake → FreeBSD-i686-Clang.Toolchain.cmake}
  9. +6 −0 cmake/FreeBSD-i686-GCC.Toolchain.cmake
  10. +1 −4 cmake/{FreeBSD-x86_64.Toolchain.cmake → FreeBSD-x86_64-Clang.Toolchain.cmake}
  11. +6 −0 cmake/FreeBSD-x86_64-GCC.Toolchain.cmake
  12. +0 −3 cmake/Linux-i686-Clang.Toolchain.cmake
  13. +2 −3 cmake/{Linux-i686.Toolchain.cmake → Linux-i686-GCC.Toolchain.cmake}
  14. +0 −3 cmake/Linux-x86_64-Clang.Toolchain.cmake
  15. +2 −3 cmake/{Linux-x86_64.Toolchain.cmake → Linux-x86_64-GCC.Toolchain.cmake}
  16. +8 −9 cmake/{NaCl-x86_64-glibc.Toolchain.cmake → NaCl-ARM.Toolchain.cmake}
  17. +0 −17 cmake/NaCl-i686-glibc.Toolchain.cmake
  18. +1 −1 cmake/NaCl-i686.Toolchain.cmake
  19. +1 −1 cmake/NaCl-x86_64.Toolchain.cmake
  20. +1 −1 cmake/PNaCl.Toolchain.cmake
  21. +0 −3 cmake/Windows-i686.Toolchain.cmake
  22. +19 −6 etc/patches/physfs-2.1.patch
  23. +1 −1 package.sh
  24. +163 −137 ports.sh
  25. +16 −9 run.sh
  26. +0 −16 sdkPaths
  27. +2 −5 src/client/CMakeLists.txt
  28. +1 −1 src/client/NaClDownloader.hh
  29. +5 −5 src/client/StrategicProxy.cc
  30. +15 −15 src/client/ui/{SelectionArea.cc → StrategicArea.cc}
  31. +4 −5 src/client/ui/{SelectionArea.hh → StrategicArea.hh}
  32. +8 −8 src/client/ui/UI.cc
  33. +2 −2 src/client/ui/UI.hh
  34. +0 −2 src/ozCore/CMakeLists.txt
  35. +1 −0 src/ozCore/File.cc
  36. +3 −0 src/ozCore/System.cc
  37. +1 −1 src/tools/openzone.cc
  38. +10 −1 src/unittest/String.cc
  39. +5 −1 src/unittest/unittest.cc
View
4 CMakeLists.txt
@@ -30,10 +30,12 @@ include( CheckCXXCompilerFlag )
include( FindPkgConfig )
if( PLATFORM_EMBEDDED )
+ set( OZ_PLATFORM_NAME "${PLATFORM_NAME}-${CMAKE_SYSTEM_PROCESSOR}" )
set( BUILD_SHARED_LIBS OFF )
set( OZ_GL_ES ON )
set( OZ_STANDALONE OFF )
else()
+ set( OZ_PLATFORM_NAME "${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}" )
set( BUILD_SHARED_LIBS ON )
endif()
@@ -46,8 +48,6 @@ elseif( WIN32 )
set( OZ_STANDALONE ON )
endif()
-set( OZ_PLATFORM_NAME "${PLATFORM_NAME}-${CMAKE_SYSTEM_PROCESSOR}" )
-
if( OZ_STANDALONE )
set( CMAKE_INSTALL_PREFIX "/OpenZone-${OZ_VERSION}" )
set( OZ_BINARY_SUBDIR "/${OZ_PLATFORM_NAME}" )
View
9 README.md
@@ -11,7 +11,8 @@ Building
--------
Building is currently supported under Linux. You can build Linux/Unix, Windows (MinGW) and Native
-Client ports. Android port in still under development.
+Client ports. Android port in still under development. See `cmake/*.Toolchain.cmake` files for all
+supported platforms/toolchains.
For generic Linux builds, make sure you have all the dependencies installed. You need to install
development packages for the following libraries:
@@ -169,6 +170,8 @@ Additionally this scripts also updates version numbers in various files.
### `build.sh [clean | conf | build]` ###
This script configures and/or builds OpenZone for all supported platforms in the `build` directory.
+`ANDROID_NDK` and `NACL_SDK_ROOT` environment variables must be set to use this script.
+
The following commands may be given (`build` is assumed if none):
- `clean`: Delete all builds.
@@ -236,6 +239,8 @@ One of the following commands must be given:
This script is used to build libraries required by OpenZone for some platforms. Currently it builds
all required libraries for NaCl and Android configurations that are not provided by SDKs.
+`ANDROID_NDK` and `NACL_SDK_ROOT` environment variables must be set to use this script.
+
The following commands may be given (`build` is assumed if none):
- `clean`: Delete everything in `ports` directory except downloaded sources.
@@ -252,6 +257,8 @@ compile a BSP structures for OpenZone.
### `run.sh [win | nacl] [<options>]` ###
Linux-x86_64-Clang client is launched by default. <options> are passed to the client command line.
+`NACL_SDK_ROOT` environment variable must be set to use this script.
+
The following alternative launches are available:
- `wine`: Installs the standalone Windows port into `build/Windows-test` and launches it via Wine.
View
23 build.sh
@@ -3,7 +3,9 @@
# build.sh [clean | conf | build]
#
# This script configures and/or builds OpenZone for all supported platforms in the `build`
-# directory. The following commands may be given (`build` is assumed if none):
+# directory. `ANDROID_NDK` and `NACL_SDK_ROOT` environment variables must be set to use this script.
+#
+# The following commands may be given (`build` is assumed if none):
#
# - `clean`: Delete all builds.
# - `conf`: Delete all builds and configure (but not build) them anew.
@@ -13,25 +15,26 @@
buildType=Debug
platforms=(
- Linux-x86_64
Linux-x86_64-Clang
- Linux-i686
+ Linux-x86_64-GCC
Linux-i686-Clang
+ Linux-i686-GCC
# FreeBSD-x86_64-Clang
+# FreeBSD-x86_64-GCC
# FreeBSD-i686-Clang
+# FreeBSD-i686-GCC
Windows-i686
NaCl-x86_64
-# NaCl-x86_64-glibc
NaCl-i686
-# NaCl-i686-glibc
- PNaCl
+ NaCl-ARM
+# PNaCl
Android14-i686
- Android14-ARM
- Android14-ARMv7a
- Android14-MIPS
+# Android14-ARM
+# Android14-ARMv7a
+# Android14-MIPS
)
-source ./sdkPaths
+pnaclPrefix="$NACL_SDK_ROOT/toolchain/linux_x86_pnacl/newlib"
function clean()
{
View
7 cmake/Android14-ARM.Toolchain.cmake
@@ -1,12 +1,11 @@
set( ANDROID ON )
-set( PLATFORM_NAME "Android" )
set( PLATFORM_EMBEDDED ON )
set( PLATFORM_TRIPLET "arm-linux-androideabi" )
set( PLATFORM_PROC_PREFIX "armeabi" )
-set( PLATFORM_PREFIX "/opt/android-ndk/platforms/android-14/arch-arm" )
-set( PLATFORM_TOOL_PREFIX "/opt/android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86" )
-set( PLATFORM_STL_PREFIX "/opt/android-ndk/sources/cxx-stl/gnu-libstdc++/4.6" )
+set( PLATFORM_PREFIX "$ENV{ANDROID_NDK}/platforms/android-14/arch-arm" )
+set( PLATFORM_TOOL_PREFIX "$ENV{ANDROID_NDK}/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86" )
+set( PLATFORM_STL_PREFIX "$ENV{ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++/4.6" )
set( PLATFORM_PORTS_PREFIX "${CMAKE_SOURCE_DIR}/ports/Android14-ARM" )
set( PLATFORM_FLAGS "-fPIC -Wno-psabi --sysroot=${PLATFORM_PREFIX}" )
set( PLATFORM_FLAGS "${PLATFORM_FLAGS} -isystem ${PLATFORM_STL_PREFIX}/include" )
View
7 cmake/Android14-ARMv7a.Toolchain.cmake
@@ -1,12 +1,11 @@
set( ANDROID ON )
-set( PLATFORM_NAME "Android" )
set( PLATFORM_EMBEDDED ON )
set( PLATFORM_TRIPLET "arm-linux-androideabi" )
set( PLATFORM_PROC_PREFIX "armeabi-v7a" )
-set( PLATFORM_PREFIX "/opt/android-ndk/platforms/android-14/arch-arm" )
-set( PLATFORM_TOOL_PREFIX "/opt/android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86" )
-set( PLATFORM_STL_PREFIX "/opt/android-ndk/sources/cxx-stl/gnu-libstdc++/4.6" )
+set( PLATFORM_PREFIX "$ENV{ANDROID_NDK}/platforms/android-14/arch-arm" )
+set( PLATFORM_TOOL_PREFIX "$ENV{ANDROID_NDK}/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86" )
+set( PLATFORM_STL_PREFIX "$ENV{ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++/4.6" )
set( PLATFORM_PORTS_PREFIX "${CMAKE_SOURCE_DIR}/ports/Android14-ARMv7a" )
set( PLATFORM_FLAGS "-fPIC -Wno-psabi --sysroot=${PLATFORM_PREFIX}" )
set( PLATFORM_FLAGS "${PLATFORM_FLAGS} -isystem ${PLATFORM_STL_PREFIX}/include" )
View
7 cmake/Android14-MIPS.Toolchain.cmake
@@ -1,12 +1,11 @@
set( ANDROID ON )
-set( PLATFORM_NAME "Android" )
set( PLATFORM_EMBEDDED ON )
set( PLATFORM_TRIPLET "mipsel-linux-android" )
set( PLATFORM_PROC_PREFIX "mips" )
-set( PLATFORM_PREFIX "/opt/android-ndk/platforms/android-14/arch-mips" )
-set( PLATFORM_TOOL_PREFIX "/opt/android-ndk/toolchains/mipsel-linux-android-4.6/prebuilt/linux-x86" )
-set( PLATFORM_STL_PREFIX "/opt/android-ndk/sources/cxx-stl/gnu-libstdc++/4.6" )
+set( PLATFORM_PREFIX "$ENV{ANDROID_NDK}/platforms/android-14/arch-mips" )
+set( PLATFORM_TOOL_PREFIX "$ENV{ANDROID_NDK}/toolchains/mipsel-linux-android-4.6/prebuilt/linux-x86" )
+set( PLATFORM_STL_PREFIX "$ENV{ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++/4.6" )
set( PLATFORM_PORTS_PREFIX "${CMAKE_SOURCE_DIR}/ports/Android14-MIPS" )
set( PLATFORM_FLAGS "-fPIC --sysroot=${PLATFORM_PREFIX}" )
set( PLATFORM_FLAGS "${PLATFORM_FLAGS} -isystem ${PLATFORM_STL_PREFIX}/include" )
View
7 cmake/Android14-i686.Toolchain.cmake
@@ -1,12 +1,11 @@
set( ANDROID ON )
-set( PLATFORM_NAME "Android" )
set( PLATFORM_EMBEDDED ON )
set( PLATFORM_TRIPLET "i686-linux-android" )
set( PLATFORM_PROC_PREFIX "x86" )
-set( PLATFORM_PREFIX "/opt/android-ndk/platforms/android-14/arch-x86" )
-set( PLATFORM_TOOL_PREFIX "/opt/android-ndk/toolchains/x86-4.6/prebuilt/linux-x86" )
-set( PLATFORM_STL_PREFIX "/opt/android-ndk/sources/cxx-stl/gnu-libstdc++/4.6" )
+set( PLATFORM_PREFIX "$ENV{ANDROID_NDK}/platforms/android-14/arch-x86" )
+set( PLATFORM_TOOL_PREFIX "$ENV{ANDROID_NDK}/toolchains/x86-4.6/prebuilt/linux-x86" )
+set( PLATFORM_STL_PREFIX "$ENV{ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++/4.6" )
set( PLATFORM_PORTS_PREFIX "${CMAKE_SOURCE_DIR}/ports/Android14-i686" )
set( PLATFORM_FLAGS "-fPIC --sysroot=${PLATFORM_PREFIX}" )
set( PLATFORM_FLAGS "${PLATFORM_FLAGS} -isystem ${PLATFORM_STL_PREFIX}/include" )
View
5 cmake/FreeBSD-i686.Toolchain.cmake → cmake/FreeBSD-i686-Clang.Toolchain.cmake
@@ -1,7 +1,4 @@
-set( PLATFORM_NAME "FreeBSD" )
-set( PLATFORM_PREFIX "" )
-
-set( CMAKE_SYSTEM_NAME "Linux" CACHE STRING "Target system." )
+set( CMAKE_SYSTEM_NAME "FreeBSD" CACHE STRING "Target system." )
set( CMAKE_SYSTEM_PROCESSOR "i686" CACHE STRING "Target processor." )
set( CMAKE_C_COMPILER "/usr/local/bin/clang" )
set( CMAKE_CXX_COMPILER "/usr/local/bin/clang++" )
View
6 cmake/FreeBSD-i686-GCC.Toolchain.cmake
@@ -0,0 +1,6 @@
+set( CMAKE_SYSTEM_NAME "FreeBSD" CACHE STRING "Target system." )
+set( CMAKE_SYSTEM_PROCESSOR "i686" CACHE STRING "Target processor." )
+set( CMAKE_C_COMPILER "/usr/bin/gcc" )
+set( CMAKE_CXX_COMPILER "/usr/bin/g++" )
+set( CMAKE_C_FLAGS "-march=i686 -m32 -msse3 -mfpmath=sse" CACHE STRING "" )
+set( CMAKE_CXX_FLAGS "-march=i686 -m32 -msse3 -mfpmath=sse" CACHE STRING "" )
View
5 cmake/FreeBSD-x86_64.Toolchain.cmake → cmake/FreeBSD-x86_64-Clang.Toolchain.cmake
@@ -1,7 +1,4 @@
-set( PLATFORM_NAME "FreeBSD" )
-set( PLATFORM_PREFIX "" )
-
-set( CMAKE_SYSTEM_NAME "Linux" CACHE STRING "Target system." )
+set( CMAKE_SYSTEM_NAME "FreeBSD" CACHE STRING "Target system." )
set( CMAKE_SYSTEM_PROCESSOR "x86_64" CACHE STRING "Target processor." )
set( CMAKE_C_COMPILER "/usr/local/bin/clang" )
set( CMAKE_CXX_COMPILER "/usr/local/bin/clang++" )
View
6 cmake/FreeBSD-x86_64-GCC.Toolchain.cmake
@@ -0,0 +1,6 @@
+set( CMAKE_SYSTEM_NAME "FreeBSD" CACHE STRING "Target system." )
+set( CMAKE_SYSTEM_PROCESSOR "x86_64" CACHE STRING "Target processor." )
+set( CMAKE_C_COMPILER "/usr/bin/gcc" )
+set( CMAKE_CXX_COMPILER "/usr/bin/g++" )
+set( CMAKE_C_FLAGS "-march=x86-64 -m64 -msse3" CACHE STRING "" )
+set( CMAKE_CXX_FLAGS "-march=x86-64 -m64 -msse3" CACHE STRING "" )
View
3 cmake/Linux-i686-Clang.Toolchain.cmake
@@ -1,6 +1,3 @@
-set( PLATFORM_NAME "Linux" )
-set( PLATFORM_PREFIX "" )
-
set( CMAKE_SYSTEM_NAME "Linux" CACHE STRING "Target system." )
set( CMAKE_SYSTEM_PROCESSOR "i686" CACHE STRING "Target processor." )
set( CMAKE_C_COMPILER "/usr/bin/clang" )
View
5 cmake/Linux-i686.Toolchain.cmake → cmake/Linux-i686-GCC.Toolchain.cmake
@@ -1,7 +1,6 @@
-set( PLATFORM_NAME "Linux" )
-set( PLATFORM_PREFIX "" )
-
set( CMAKE_SYSTEM_NAME "Linux" CACHE STRING "Target system." )
set( CMAKE_SYSTEM_PROCESSOR "i686" CACHE STRING "Target processor." )
+set( CMAKE_C_COMPILER "/usr/bin/gcc" )
+set( CMAKE_CXX_COMPILER "/usr/bin/g++" )
set( CMAKE_C_FLAGS "-march=i686 -m32 -msse3 -mfpmath=sse" CACHE STRING "" )
set( CMAKE_CXX_FLAGS "-march=i686 -m32 -msse3 -mfpmath=sse" CACHE STRING "" )
View
3 cmake/Linux-x86_64-Clang.Toolchain.cmake
@@ -1,6 +1,3 @@
-set( PLATFORM_NAME "Linux" )
-set( PLATFORM_PREFIX "" )
-
set( CMAKE_SYSTEM_NAME "Linux" CACHE STRING "Target system." )
set( CMAKE_SYSTEM_PROCESSOR "x86_64" CACHE STRING "Target processor." )
set( CMAKE_C_COMPILER "/usr/bin/clang" )
View
5 cmake/Linux-x86_64.Toolchain.cmake → cmake/Linux-x86_64-GCC.Toolchain.cmake
@@ -1,7 +1,6 @@
-set( PLATFORM_NAME "Linux" )
-set( PLATFORM_PREFIX "" )
-
set( CMAKE_SYSTEM_NAME "Linux" CACHE STRING "Target system." )
set( CMAKE_SYSTEM_PROCESSOR "x86_64" CACHE STRING "Target processor." )
+set( CMAKE_C_COMPILER "/usr/bin/gcc" )
+set( CMAKE_CXX_COMPILER "/usr/bin/g++" )
set( CMAKE_C_FLAGS "-march=x86-64 -m64 -msse3" CACHE STRING "" )
set( CMAKE_CXX_FLAGS "-march=x86-64 -m64 -msse3" CACHE STRING "" )
View
17 cmake/NaCl-x86_64-glibc.Toolchain.cmake → cmake/NaCl-ARM.Toolchain.cmake
@@ -1,17 +1,16 @@
set( NACL ON )
-set( NACL_GLIBC ON )
set( PLATFORM_NAME "NaCl" )
set( PLATFORM_EMBEDDED ON )
-set( PLATFORM_TRIPLET "x86_64-nacl" )
-set( PLATFORM_PREFIX "/home/davorin/Projects/nacl_sdk/pepper_23/toolchain/linux_x86_glibc" )
-set( PLATFORM_PORTS_PREFIX "${CMAKE_SOURCE_DIR}/ports/NaCl-x86_64-glibc" )
-set( PLATFORM_EXE_SUFFIX ".x86_64.nexe" )
+set( PLATFORM_TRIPLET "arm-nacl" )
+set( PLATFORM_PREFIX "$ENV{NACL_SDK_ROOT}/toolchain/linux_arm_newlib" )
+set( PLATFORM_PORTS_PREFIX "${CMAKE_SOURCE_DIR}/ports/NaCl-ARM" )
+set( PLATFORM_EXE_SUFFIX ".ARM.nexe" )
set( CMAKE_SYSTEM_NAME "Linux" CACHE STRING "Target system." )
-set( CMAKE_SYSTEM_PROCESSOR "x86_64" CACHE STRING "Target processor." )
-set( CMAKE_FIND_ROOT_PATH "${PLATFORM_PORTS_PREFIX};${PLATFORM_PREFIX}/x86_64-nacl" )
+set( CMAKE_SYSTEM_PROCESSOR "ARM" CACHE STRING "Target processor." )
+set( CMAKE_FIND_ROOT_PATH "${PLATFORM_PORTS_PREFIX};${PLATFORM_PREFIX}/arm-nacl" )
set( CMAKE_C_COMPILER "${PLATFORM_PREFIX}/bin/${PLATFORM_TRIPLET}-gcc" )
set( CMAKE_CXX_COMPILER "${PLATFORM_PREFIX}/bin/${PLATFORM_TRIPLET}-g++" )
-set( CMAKE_C_FLAGS "-msse3" CACHE STRING "" )
-set( CMAKE_CXX_FLAGS "-msse3" CACHE STRING "" )
+set( CMAKE_C_FLAGS "-U__STRICT_ANSI__" CACHE STRING "" )
+set( CMAKE_CXX_FLAGS "-U__STRICT_ANSI__" CACHE STRING "" )
View
17 cmake/NaCl-i686-glibc.Toolchain.cmake
@@ -1,17 +0,0 @@
-set( NACL ON )
-set( NACL_GLIBC ON )
-
-set( PLATFORM_NAME "NaCl" )
-set( PLATFORM_EMBEDDED ON )
-set( PLATFORM_TRIPLET "i686-nacl" )
-set( PLATFORM_PREFIX "/home/davorin/Projects/nacl_sdk/pepper_23/toolchain/linux_x86_glibc" )
-set( PLATFORM_PORTS_PREFIX "${CMAKE_SOURCE_DIR}/ports/NaCl-i686-glibc" )
-set( PLATFORM_EXE_SUFFIX ".i686.nexe" )
-
-set( CMAKE_SYSTEM_NAME "Linux" CACHE STRING "Target system." )
-set( CMAKE_SYSTEM_PROCESSOR "i686" CACHE STRING "Target processor." )
-set( CMAKE_FIND_ROOT_PATH "${PLATFORM_PORTS_PREFIX};${PLATFORM_PREFIX}/x86_64-nacl" )
-set( CMAKE_C_COMPILER "${PLATFORM_PREFIX}/bin/${PLATFORM_TRIPLET}-gcc" )
-set( CMAKE_CXX_COMPILER "${PLATFORM_PREFIX}/bin/${PLATFORM_TRIPLET}-g++" )
-set( CMAKE_C_FLAGS "-msse3 -mfpmath=sse" CACHE STRING "" )
-set( CMAKE_CXX_FLAGS "-msse3 -mfpmath=sse" CACHE STRING "" )
View
2 cmake/NaCl-i686.Toolchain.cmake
@@ -3,7 +3,7 @@ set( NACL ON )
set( PLATFORM_NAME "NaCl" )
set( PLATFORM_EMBEDDED ON )
set( PLATFORM_TRIPLET "i686-nacl" )
-set( PLATFORM_PREFIX "/home/davorin/Projects/nacl_sdk/pepper_23/toolchain/linux_x86_newlib" )
+set( PLATFORM_PREFIX "$ENV{NACL_SDK_ROOT}/toolchain/linux_x86_newlib" )
set( PLATFORM_PORTS_PREFIX "${CMAKE_SOURCE_DIR}/ports/NaCl-i686" )
set( PLATFORM_EXE_SUFFIX ".i686.nexe" )
View
2 cmake/NaCl-x86_64.Toolchain.cmake
@@ -3,7 +3,7 @@ set( NACL ON )
set( PLATFORM_NAME "NaCl" )
set( PLATFORM_EMBEDDED ON )
set( PLATFORM_TRIPLET "x86_64-nacl" )
-set( PLATFORM_PREFIX "/home/davorin/Projects/nacl_sdk/pepper_23/toolchain/linux_x86_newlib" )
+set( PLATFORM_PREFIX "$ENV{NACL_SDK_ROOT}/toolchain/linux_x86_newlib" )
set( PLATFORM_PORTS_PREFIX "${CMAKE_SOURCE_DIR}/ports/NaCl-x86_64" )
set( PLATFORM_EXE_SUFFIX ".x86_64.nexe" )
View
2 cmake/PNaCl.Toolchain.cmake
@@ -3,7 +3,7 @@ set( NACL ON )
set( PLATFORM_NAME "PNaCl" )
set( PLATFORM_EMBEDDED ON )
set( PLATFORM_TRIPLET "pnacl" )
-set( PLATFORM_PREFIX "/home/davorin/Projects/nacl_sdk/pepper_canary/toolchain/linux_x86_pnacl/newlib" )
+set( PLATFORM_PREFIX "/home/davorin/Razvoj/nacl_sdk/pepper_canary/toolchain/linux_x86_pnacl/newlib" )
set( PLATFORM_PORTS_PREFIX "${CMAKE_SOURCE_DIR}/ports/PNaCl" )
set( PLATFORM_EXE_SUFFIX ".pexe" )
View
3 cmake/Windows-i686.Toolchain.cmake
@@ -1,6 +1,3 @@
-set( MINGW32 ON )
-
-set( PLATFORM_NAME "Windows" )
set( PLATFORM_TRIPLET "i486-mingw32" )
set( PLATFORM_PREFIX "/usr/${PLATFORM_TRIPLET}" )
set( PLATFORM_TOOL_PREFIX "${PLATFORM_PREFIX}" )
View
25 etc/patches/physfs-2.1.patch
@@ -1,12 +1,12 @@
diff -r e0dbcd5e50b9 CMakeLists.txt
--- a/CMakeLists.txt Fri Nov 30 14:37:37 2012 -0500
-+++ b/CMakeLists.txt Sat Dec 08 15:30:52 2012 +0100
++++ b/CMakeLists.txt Wed Jan 02 16:08:34 2013 +0100
@@ -50,7 +50,7 @@
# Add some gcc-specific command lines.
if(CMAKE_COMPILER_IS_GNUCC)
# Always build with debug symbols...you can strip it later.
- add_definitions(-g -pipe -Werror -fsigned-char)
-+ add_definitions(-g -pipe -fsigned-char)
++ add_definitions(-g -fsigned-char)
# Stupid BeOS generates warnings in the system headers.
if(NOT BEOS)
@@ -37,7 +37,7 @@ diff -r e0dbcd5e50b9 CMakeLists.txt
set(HAVE_PTHREAD_H TRUE)
diff -r e0dbcd5e50b9 src/lzma/C/Archive/7z/7zDecode.c
--- a/src/lzma/C/Archive/7z/7zDecode.c Fri Nov 30 14:37:37 2012 -0500
-+++ b/src/lzma/C/Archive/7z/7zDecode.c Sat Dec 08 15:30:52 2012 +0100
++++ b/src/lzma/C/Archive/7z/7zDecode.c Wed Jan 02 16:08:34 2013 +0100
@@ -1,6 +1,10 @@
/* 7zDecode.c */
@@ -50,9 +50,22 @@ diff -r e0dbcd5e50b9 src/lzma/C/Archive/7z/7zDecode.c
/* BEGIN PHYSFS CHANGE */
#include <string.h>
+diff -r e0dbcd5e50b9 src/physfs.c
+--- a/src/physfs.c Fri Nov 30 14:37:37 2012 -0500
++++ b/src/physfs.c Wed Jan 02 16:08:34 2013 +0100
+@@ -1268,8 +1268,7 @@
+ {
+ while (numArchivers > 0)
+ {
+- const int rc = doDeregisterArchiver(numArchivers - 1);
+- assert(rc); /* nothing should be mounted during shutdown. */
++ assert(doDeregisterArchiver(numArchivers - 1)); /* nothing should be mounted during shutdown. */
+ } /* while */
+
+ allocator.Free(archivers);
diff -r e0dbcd5e50b9 src/physfs.h
--- a/src/physfs.h Fri Nov 30 14:37:37 2012 -0500
-+++ b/src/physfs.h Sat Dec 08 15:30:52 2012 +0100
++++ b/src/physfs.h Wed Jan 02 16:08:34 2013 +0100
@@ -229,7 +229,7 @@
#define PHYSFS_DECL __declspec(dllexport)
#elif (defined __SUNPRO_C)
@@ -64,7 +77,7 @@ diff -r e0dbcd5e50b9 src/physfs.h
#define PHYSFS_DECL
diff -r e0dbcd5e50b9 src/physfs_platforms.h
--- a/src/physfs_platforms.h Fri Nov 30 14:37:37 2012 -0500
-+++ b/src/physfs_platforms.h Sat Dec 08 15:30:52 2012 +0100
++++ b/src/physfs_platforms.h Wed Jan 02 16:08:34 2013 +0100
@@ -40,6 +40,8 @@
# define PHYSFS_PLATFORM_UNIX 1
# define PHYSFS_PLATFORM_POSIX 1
@@ -76,7 +89,7 @@ diff -r e0dbcd5e50b9 src/physfs_platforms.h
# define PHYSFS_PLATFORM_UNIX 1
diff -r e0dbcd5e50b9 src/platform_nacl.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
-+++ b/src/platform_nacl.c Sat Dec 08 15:30:52 2012 +0100
++++ b/src/platform_nacl.c Wed Jan 02 16:08:34 2013 +0100
@@ -0,0 +1,843 @@
+/*
+ * Native Client support routines for PhysicsFS.
View
2 package.sh
@@ -13,7 +13,7 @@
# standalone builds and compiled game data packages found in `share/openzone`.
#
-platforms=( Linux-x86_64 Linux-i686 Windows-i686 )
+platforms=( Linux-x86_64-GCC Linux-i686-GCC Windows-i686 )
eval `egrep '^version=' ./autogen.sh`
View
300 ports.sh
@@ -4,6 +4,8 @@
#
# This script is used to build libraries required by OpenZone for some platforms. Currently it
# builds all required libraries for NaCl and Android configurations that are not provided by SDKs.
+# `ANDROID_NDK` and `NACL_SDK_ROOT` environment variables must be set to use this script.
+#
# The following commands may be given (`build` is assumed if none):
#
# - `clean`: Delete everything in `ports` directory except downloaded sources.
@@ -15,20 +17,30 @@
platforms=(
NaCl-x86_64
-# NaCl-x86_64-glibc
NaCl-i686
-# NaCl-i686-glibc
- PNaCl
+ NaCl-ARM
+# PNaCl
Android14-i686
- Android14-ARM
- Android14-ARMv7a
- Android14-MIPS
+# Android14-ARM
+# Android14-ARMv7a
+# Android14-MIPS
)
projectDir=`pwd`
topDir="$projectDir/ports"
-source ./sdkPaths
+nacl86Prefix="$NACL_SDK_ROOT/toolchain/linux_x86_newlib"
+naclARMPrefix="$NACL_SDK_ROOT/toolchain/linux_arm_newlib"
+pnaclPrefix="$NACL_SDK_ROOT/toolchain/linux_x86_pnacl/newlib"
+
+ndkX86Tools="$ANDROID_NDK/toolchains/x86-4.6/prebuilt/linux-x86"
+ndkX86Platform="$ANDROID_NDK/platforms/android-14/arch-x86"
+
+ndkARMTools="$ANDROID_NDK/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86"
+ndkARMPlatform="$ANDROID_NDK/platforms/android-14/arch-arm"
+
+ndkMIPSTools="$ANDROID_NDK/toolchains/mipsel-linux-android-4.6/prebuilt/linux-x86"
+ndkMIPSPlatform="$ANDROID_NDK/platforms/android-14/arch-mips"
function msg()
{
@@ -41,14 +53,14 @@ function msg()
echo -ne "\e[0m"
}
-function setup_nacl64()
+function setup_nacl_x86_64()
{
platform="NaCl-x86_64" # Platform name.
buildDir="$topDir/$platform" # Build and install directory.
triplet="x86_64-nacl" # Platform triplet (tools prefix).
hostTriplet="$triplet" # Host triplet for autotools configure.
- sysroot="$naclPrefix/x86_64-nacl" # SDK sysroot.
- toolsroot="$naclPrefix" # SDK tool root.
+ sysroot="$nacl86Prefix/x86_64-nacl" # SDK sysroot.
+ toolsroot="$nacl86Prefix" # SDK tool root.
toolchain="$projectDir/cmake/$platform.Toolchain.cmake" # CMake toolchain.
export CPP="$toolsroot/bin/$triplet-cpp"
@@ -63,40 +75,22 @@ function setup_nacl64()
export CPPFLAGS="-I$buildDir/usr/include"
export CFLAGS="-O3 -ffast-math -msse3"
export LDFLAGS="-L$buildDir/usr/lib -lnosys"
-}
-
-function setup_nacl64GNU()
-{
- platform="NaCl-x86_64-glibc" # Platform name.
- buildDir="$topDir/$platform" # Build and install directory.
- triplet="x86_64-nacl" # Platform triplet (tools prefix).
- hostTriplet="$triplet" # Host triplet for autotools configure.
- sysroot="$naclGNUPrefix/x86_64-nacl" # SDK sysroot.
- toolsroot="$naclGNUPrefix" # SDK tool root.
- toolchain="$projectDir/cmake/$platform.Toolchain.cmake" # CMake toolchain.
- export CPP="$toolsroot/bin/$triplet-cpp"
- export CC="$toolsroot/bin/$triplet-gcc"
- export AR="$toolsroot/bin/$triplet-ar"
- export RANLIB="$toolsroot/bin/$triplet-ranlib"
- export STRIP="$toolsroot/bin/$triplet-strip"
- export PKG_CONFIG_PATH="$buildDir/usr/lib/pkgconfig"
- export PKG_CONFIG_LIBDIR="$buildDir/usr/lib"
- export PATH="$toolsroot/bin:$PATH"
-
- export CPPFLAGS="-I$buildDir/usr/include"
- export CFLAGS="-O3 -ffast-math -msse3"
- export LDFLAGS="-L$buildDir/usr/lib"
+ enabled=0
+ for p in ${platforms[@]}; do
+ [[ $p == $platform ]] && enabled=1
+ done
+ (( $enabled )) || return 1
}
-function setup_nacl32()
+function setup_nacl_i686()
{
platform="NaCl-i686" # Platform name.
buildDir="$topDir/$platform" # Build and install directory.
triplet="i686-nacl" # Platform triplet (tools prefix).
hostTriplet="$triplet" # Host triplet for autotools configure.
- sysroot="$naclPrefix/i686-nacl" # SDK sysroot.
- toolsroot="$naclPrefix" # SDK tool root.
+ sysroot="$nacl86Prefix/i686-nacl" # SDK sysroot.
+ toolsroot="$nacl86Prefix" # SDK tool root.
toolchain="$projectDir/cmake/$platform.Toolchain.cmake" # CMake toolchain.
export CPP="$toolsroot/bin/$triplet-cpp"
@@ -111,16 +105,22 @@ function setup_nacl32()
export CPPFLAGS="-I$buildDir/usr/include"
export CFLAGS="-O3 -ffast-math -msse3 -mfpmath=sse"
export LDFLAGS="-L$buildDir/usr/lib -lnosys"
+
+ enabled=0
+ for p in ${platforms[@]}; do
+ [[ $p == $platform ]] && enabled=1
+ done
+ (( $enabled )) || return 1
}
-function setup_nacl32GNU()
+function setup_nacl_ARM()
{
- platform="NaCl-i686-glibc" # Platform name.
+ platform="NaCl-ARM" # Platform name.
buildDir="$topDir/$platform" # Build and install directory.
- triplet="i686-nacl" # Platform triplet (tools prefix).
+ triplet="arm-nacl" # Platform triplet (tools prefix).
hostTriplet="$triplet" # Host triplet for autotools configure.
- sysroot="$naclGNUPrefix/i686-nacl" # SDK sysroot.
- toolsroot="$naclGNUPrefix" # SDK tool root.
+ sysroot="$naclARMPrefix/arm-nacl" # SDK sysroot.
+ toolsroot="$naclARMPrefix" # SDK tool root.
toolchain="$projectDir/cmake/$platform.Toolchain.cmake" # CMake toolchain.
export CPP="$toolsroot/bin/$triplet-cpp"
@@ -133,8 +133,14 @@ function setup_nacl32GNU()
export PATH="$toolsroot/bin:$PATH"
export CPPFLAGS="-I$buildDir/usr/include"
- export CFLAGS="-O3 -ffast-math -msse3 -mfpmath=sse"
- export LDFLAGS="-L$buildDir/usr/lib"
+ export CFLAGS="-O3 -ffast-math"
+ export LDFLAGS="-L$buildDir/usr/lib -lnosys"
+
+ enabled=0
+ for p in ${platforms[@]}; do
+ [[ $p == $platform ]] && enabled=1
+ done
+ (( $enabled )) || return 1
}
function setup_pnacl()
@@ -160,9 +166,15 @@ function setup_pnacl()
export CPPFLAGS="-I$buildDir/usr/include"
export CFLAGS="-O3 -ffast-math"
export LDFLAGS="-L$buildDir/usr/lib -lnosys"
+
+ enabled=0
+ for p in ${platforms[@]}; do
+ [[ $p == $platform ]] && enabled=1
+ done
+ (( $enabled )) || return 1
}
-function setup_ndkX86()
+function setup_ndk_i686()
{
platform="Android14-i686" # Platform name.
buildDir="$topDir/$platform" # Build and install directory.
@@ -184,9 +196,15 @@ function setup_ndkX86()
export CPPFLAGS="--sysroot=$sysroot -I$buildDir/usr/include"
export CFLAGS="-Ofast -fPIC -msse3 -mfpmath=sse"
export LDFLAGS="--sysroot=$sysroot -L$buildDir/usr/lib"
+
+ enabled=0
+ for p in ${platforms[@]}; do
+ [[ $p == $platform ]] && enabled=1
+ done
+ (( $enabled )) || return 1
}
-function setup_ndkARM()
+function setup_ndk_ARM()
{
platform="Android14-ARM" # Platform name.
buildDir="$topDir/$platform" # Build and install directory.
@@ -208,9 +226,15 @@ function setup_ndkARM()
export CPPFLAGS="--sysroot=$sysroot -I$buildDir/usr/include"
export CFLAGS="-Wno-psabi -Ofast -fPIC"
export LDFLAGS="--sysroot=$sysroot -L$buildDir/usr/lib"
+
+ enabled=0
+ for p in ${platforms[@]}; do
+ [[ $p == $platform ]] && enabled=1
+ done
+ (( $enabled )) || return 1
}
-function setup_ndkARM7()
+function setup_ndk_ARMv7a()
{
platform="Android14-ARMv7a" # Platform name.
buildDir="$topDir/$platform" # Build and install directory.
@@ -232,9 +256,15 @@ function setup_ndkARM7()
export CPPFLAGS="--sysroot=$sysroot -I$buildDir/usr/include"
export CFLAGS="-Wno-psabi -Ofast -fPIC -march=armv7-a -mfloat-abi=softfp -mfpu=neon"
export LDFLAGS="--sysroot=$sysroot -L$buildDir/usr/lib -Wl,--fix-cortex-a8"
+
+ enabled=0
+ for p in ${platforms[@]}; do
+ [[ $p == $platform ]] && enabled=1
+ done
+ (( $enabled )) || return 1
}
-function setup_ndkMIPS()
+function setup_ndk_MIPS()
{
platform="Android14-MIPS" # Platform name.
buildDir="$topDir/$platform" # Build and install directory.
@@ -256,6 +286,12 @@ function setup_ndkMIPS()
export CPPFLAGS="--sysroot=$sysroot -I$buildDir/usr/include"
export CFLAGS="-Ofast -fPIC"
export LDFLAGS="--sysroot=$sysroot -L$buildDir/usr/lib"
+
+ enabled=0
+ for p in ${platforms[@]}; do
+ [[ $p == $platform ]] && enabled=1
+ done
+ (( $enabled )) || return 1
}
function clean()
@@ -319,7 +355,7 @@ function fetch()
fi
# FreeType
- download 'http://sourceforge.net/projects/freetype/files/freetype2/2.4.10/freetype-2.4.10.tar.bz2'
+ download 'http://sourceforge.net/projects/freetype/files/freetype2/2.4.11/freetype-2.4.11.tar.bz2'
# OpenAL Soft
download 'http://kcat.strangesoft.net/openal-releases/openal-soft-1.15.1.tar.bz2'
@@ -466,7 +502,7 @@ function build_sdl2()
function build_freetype()
{
- prepare freetype-2.4.10 freetype-2.4.10.tar.bz2 || return
+ prepare freetype-2.4.11 freetype-2.4.11.tar.bz2 || return
autotoolsBuild --disable-shared --without-bzip2
@@ -532,110 +568,100 @@ function build_libvorbis()
function build()
{
# zlib
- setup_nacl64 && build_zlib
-# setup_nacl64GNU && build_zlib
- setup_nacl32 && build_zlib
-# setup_nacl32GNU && build_zlib
- setup_pnacl && build_zlib
+ setup_nacl_x86_64 && build_zlib
+ setup_nacl_i686 && build_zlib
+ setup_nacl_ARM && build_zlib
+ setup_pnacl && build_zlib
# PhysicsFS
- setup_nacl64 && build_physfs
-# setup_nacl64GNU && build_physfs
- setup_nacl32 && build_physfs
-# setup_nacl32GNU && build_physfs
- setup_pnacl && build_physfs
- setup_ndkX86 && build_physfs
- setup_ndkARM && build_physfs
- setup_ndkARM7 && build_physfs
- setup_ndkMIPS && build_physfs
+ setup_nacl_x86_64 && build_physfs
+ setup_nacl_i686 && build_physfs
+ setup_nacl_ARM && build_physfs
+ setup_pnacl && build_physfs
+ setup_ndk_i686 && build_physfs
+ setup_ndk_ARM && build_physfs
+ setup_ndk_ARMv7a && build_physfs
+ setup_ndk_MIPS && build_physfs
# Lua
- setup_nacl64 && build_lua
-# setup_nacl64GNU && build_lua
- setup_nacl32 && build_lua
-# setup_nacl32GNU && build_lua
- setup_pnacl && build_lua
- setup_ndkX86 && build_lua
- setup_ndkARM && build_lua
- setup_ndkARM7 && build_lua
- setup_ndkMIPS && build_lua
-
- # LuaJIT
-# setup_nacl64 && build_luajit
-# setup_nacl64GNU && build_luajit
-# setup_nacl32 && build_luajit
-# setup_nacl32GNU && build_luajit
-# setup_pnacl && build_luajit
-# setup_ndkX86 && build_luajit
-# setup_ndkARM && build_luajit
-# setup_ndkARM7 && build_luajit
-# setup_ndkMIPS && build_luajit
+ setup_nacl_x86_64 && build_lua
+ setup_nacl_i686 && build_lua
+ setup_nacl_ARM && build_lua
+ setup_pnacl && build_lua
+ setup_ndk_i686 && build_lua
+ setup_ndk_ARM && build_lua
+ setup_ndk_ARMv7a && build_lua
+ setup_ndk_MIPS && build_lua
+
+# LuaJIT
+# setup_nacl_x86_64 && build_luajit
+# setup_nacl_i686 && build_luajit
+# setup_nacl_ARM && build_luajit
+# setup_pnacl && build_luajit
+# setup_ndk_i686 && build_luajit
+# setup_ndk_ARM && build_luajit
+# setup_ndk_ARMv7a && build_luajit
+# setup_ndk_MIPS && build_luajit
# SDL
- setup_nacl64 && build_sdl
-# setup_nacl64GNU && build_sdl
- setup_nacl32 && build_sdl
-# setup_nacl32GNU && build_sdl
- setup_pnacl && build_sdl
- setup_ndkX86 && build_sdl2
- setup_ndkARM && build_sdl2
- setup_ndkARM7 && build_sdl2
- setup_ndkMIPS && build_sdl2
+ setup_nacl_x86_64 && build_sdl
+ setup_nacl_i686 && build_sdl
+ setup_nacl_ARM && build_sdl
+ setup_pnacl && build_sdl
+ setup_ndk_i686 && build_sdl2
+ setup_ndk_ARM && build_sdl2
+ setup_ndk_ARMv7a && build_sdl2
+ setup_ndk_MIPS && build_sdl2
# FreeType
- setup_nacl64 && build_freetype
-# setup_nacl64GNU && build_freetype
- setup_nacl32 && build_freetype
-# setup_nacl32GNU && build_freetype
- setup_pnacl && build_freetype
- setup_ndkX86 && build_freetype
- setup_ndkARM && build_freetype
- setup_ndkARM7 && build_freetype
- setup_ndkMIPS && build_freetype
+ setup_nacl_x86_64 && build_freetype
+ setup_nacl_i686 && build_freetype
+ setup_nacl_ARM && build_freetype
+ setup_pnacl && build_freetype
+ setup_ndk_i686 && build_freetype
+ setup_ndk_ARM && build_freetype
+ setup_ndk_ARMv7a && build_freetype
+ setup_ndk_MIPS && build_freetype
# SDL_ttf
- setup_nacl64 && build_sdl_ttf
-# setup_nacl64GNU && build_sdl_ttf
- setup_nacl32 && build_sdl_ttf
-# setup_nacl32GNU && build_sdl_ttf
- setup_pnacl && build_sdl_ttf
- setup_ndkX86 && build_sdl2_ttf
- setup_ndkARM && build_sdl2_ttf
- setup_ndkARM7 && build_sdl2_ttf
- setup_ndkMIPS && build_sdl2_ttf
+ setup_nacl_x86_64 && build_sdl_ttf
+ setup_nacl_i686 && build_sdl_ttf
+ setup_nacl_ARM && build_sdl_ttf
+ setup_pnacl && build_sdl_ttf
+ setup_ndk_i686 && build_sdl2_ttf
+ setup_ndk_ARM && build_sdl2_ttf
+ setup_ndk_ARMv7a && build_sdl2_ttf
+ setup_ndk_MIPS && build_sdl2_ttf
# OpenAL Soft
- setup_nacl64 && build_openal
-# setup_nacl64GNU && build_openal
- setup_nacl32 && build_openal
-# setup_nacl32GNU && build_openal
- setup_pnacl && build_openal
- setup_ndkX86 && build_openal
- setup_ndkARM && build_openal
- setup_ndkARM7 && build_openal
- setup_ndkMIPS && build_openal
+ setup_nacl_x86_64 && build_openal
+ setup_nacl_i686 && build_openal
+ setup_nacl_ARM && build_openal
+ setup_pnacl && build_openal
+ setup_ndk_i686 && build_openal
+ setup_ndk_ARM && build_openal
+ setup_ndk_ARMv7a && build_openal
+ setup_ndk_MIPS && build_openal
# libogg
- setup_nacl64 && build_libogg
-# setup_nacl64GNU && build_libogg
- setup_nacl32 && build_libogg
-# setup_nacl32GNU && build_libogg
- setup_pnacl && build_libogg
- setup_ndkX86 && build_libogg
- setup_ndkARM && build_libogg
- setup_ndkARM7 && build_libogg
- setup_ndkMIPS && build_libogg
+ setup_nacl_x86_64 && build_libogg
+ setup_nacl_i686 && build_libogg
+ setup_nacl_ARM && build_libogg
+ setup_pnacl && build_libogg
+ setup_ndk_i686 && build_libogg
+ setup_ndk_ARM && build_libogg
+ setup_ndk_ARMv7a && build_libogg
+ setup_ndk_MIPS && build_libogg
# libvorbis
- setup_nacl64 && build_libvorbis
-# setup_nacl64GNU && build_libvorbis
- setup_nacl32 && build_libvorbis
-# setup_nacl32GNU && build_libvorbis
- setup_pnacl && build_libvorbis
- setup_ndkX86 && build_libvorbis
- setup_ndkARM && build_libvorbis
- setup_ndkARM7 && build_libvorbis
- setup_ndkMIPS && build_libvorbis
+ setup_nacl_x86_64 && build_libvorbis
+ setup_nacl_i686 && build_libvorbis
+ setup_nacl_ARM && build_libvorbis
+ setup_pnacl && build_libvorbis
+ setup_ndk_i686 && build_libvorbis
+ setup_ndk_ARM && build_libvorbis
+ setup_ndk_ARMv7a && build_libvorbis
+ setup_ndk_MIPS && build_libvorbis
}
case $1 in
View
25 run.sh
@@ -3,6 +3,8 @@
# run.sh [win | nacl] [<options>]
#
# Linux-x86_64-Clang client is launched by default. <options> are passed to the client command line.
+# `NACL_SDK_ROOT` environment variable must be set to use this script.
+#
# The following alternative launches are available:
#
# - `wine`: Installs the standalone Windows port into `build/Windows-test` and launches it via Wine.
@@ -16,16 +18,18 @@
defaultPlatform=Linux-x86_64-Clang
-source ./sdkPaths.sh
+nacl86Prefix="$NACL_SDK_ROOT/toolchain/linux_x86_newlib"
+naclARMPrefix="$NACL_SDK_ROOT/toolchain/linux_arm_newlib"
+pnaclPrefix="$NACL_SDK_ROOT/toolchain/linux_x86_pnacl/newlib"
function run_nacl()
{
mkdir -p build/NaCl-test
# Just create symlinks instead of copying.
for i in share/openzone/*.{7z,zip} share/openzone/packages.ozManifest \
- build/NaCl-*/src/tools/openzone.*.nexe etc/nacl/openzone.nmf \
- etc/nacl/openzone.??.html doc
+ build/NaCl-*/src/tools/openzone.*.nexe etc/nacl/openzone.nmf \
+ etc/nacl/openzone.??.html doc
do
[[ -e $i ]] && ln -sf ../../$i build/NaCl-test
done
@@ -41,13 +45,16 @@ function run_nacl()
# Strip binaries if `strip` option is given.
if [[ $arg == strip ]]; then
if [[ -e build/NaCl-test/openzone.x86_64.nexe ]]; then
- "$naclPrefix/bin/x86_64-nacl-strip" build/NaCl-test/openzone.x86_64.nexe
+ "$nacl86Prefix/bin/x86_64-nacl-strip" build/NaCl-test/openzone.x86_64.nexe
fi
if [[ -e build/NaCl-test/openzone.i686.nexe ]]; then
- "$naclPrefix/bin/i686-nacl-strip" build/NaCl-test/openzone.i686.nexe
+ "$nacl86Prefix/bin/i686-nacl-strip" build/NaCl-test/openzone.i686.nexe
+ fi
+ if [[ -e build/NaCl-test/openzone.ARM.nexe ]]; then
+ "$naclARMPrefix/bin/arm-nacl-strip" build/NaCl-test/openzone.ARM.nexe
fi
- if [[ -e build/NaCl-test/openzone.arm.nexe ]]; then
- "$pnaclPrefix/bin64/pnacl-strip" build/NaCl-test/openzone.arm.nexe
+ if [[ -e build/NaCl-test/openzone.pexe ]]; then
+ "$pnaclPrefix/bin64/pnacl-strip" build/NaCl-test/openzone.pexe
fi
fi
@@ -56,8 +63,8 @@ function run_nacl()
serverPID=$!
sleep 3
- chromium --user-data-dir="$HOME/.config/chromium-test" http://localhost:8000/openzone.sl.html \
- || true
+ chromium-browser --user-data-dir="$HOME/.config/chromium-test" \
+ http://localhost:8000/openzone.sl.html || true
kill $serverPID
}
View
16 sdkPaths
@@ -1,16 +0,0 @@
-# naclPrefix=`sed -r '/ PLATFORM_PREFIX / !d; s|.*\"(.*)\".*|\1|' cmake/NaCl-x86_64.Toolchain.cmake`
-# naclGNUPrefix=`sed -r '/ PLATFORM_PREFIX / !d; s|.*\"(.*)\".*|\1|' cmake/NaCl-x86_64-glibc.Toolchain.cmake`
-# pnaclPrefix=`sed -r '/ PLATFORM_PREFIX / !d; s|.*\"(.*)\".*|\1|' cmake/PNaCl.Toolchain.cmake`
-
-naclPrefix="/home/davorin/Projects/nacl_sdk/pepper_23/toolchain/linux_x86_newlib"
-naclGNUPrefix="/home/davorin/Projects/nacl_sdk/pepper_23/toolchain/linux_x86_glibc"
-pnaclPrefix="/home/davorin/Projects/nacl_sdk/pepper_canary/toolchain/linux_x86_pnacl/newlib"
-
-ndkX86Tools="/opt/android-ndk/toolchains/x86-4.6/prebuilt/linux-x86"
-ndkX86Platform="/opt/android-ndk/platforms/android-14/arch-x86"
-
-ndkARMTools="/opt/android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86"
-ndkARMPlatform="/opt/android-ndk/platforms/android-14/arch-arm"
-
-ndkMIPSTools="/opt/android-ndk/toolchains/mipsel-linux-android-4.6/prebuilt/linux-x86"
-ndkMIPSPlatform="/opt/android-ndk/platforms/android-14/arch-mips"
View
7 src/client/CMakeLists.txt
@@ -127,8 +127,8 @@ add_library( client STATIC
ui/Mouse.hh
ui/MusicPlayer.hh
ui/QuestFrame.hh
- ui/SelectionArea.hh
ui/SettingsFrame.hh
+ ui/StrategicArea.hh
ui/Style.hh
ui/TalkFrame.hh
ui/Text.hh
@@ -152,8 +152,8 @@ add_library( client STATIC
ui/Mouse.cc
ui/MusicPlayer.cc
ui/QuestFrame.cc
- ui/SelectionArea.cc
ui/SettingsFrame.cc
+ ui/StrategicArea.cc
ui/Style.cc
ui/TalkFrame.cc
ui/Text.cc
@@ -185,6 +185,3 @@ target_link_libraries( client ${OPENAL_LIBRARY} ${VORBISFILE_LIBRARIES} )
if( PLATFORM_EMBEDDED )
target_link_libraries( client ${FREETYPE_LIBRARY} ${VORBIS_LIBRARIES} ${OGG_LIBRARIES} )
endif()
-if( NACL_GLIBC )
- target_link_libraries( client -ldl )
-endif()
View
2 src/client/NaClDownloader.hh
@@ -32,7 +32,7 @@ namespace pp
class URLLoader;
-};
+}
namespace oz
{
View
10 src/client/StrategicProxy.cc
@@ -27,7 +27,7 @@
#include <common/Timer.hh>
#include <client/Camera.hh>
#include <client/Input.hh>
-#include <client/ui/SelectionArea.hh>
+#include <client/ui/StrategicArea.hh>
#include <client/ui/GalileoFrame.hh>
#include <client/ui/UI.hh>
@@ -55,7 +55,7 @@ void StrategicProxy::begin()
ui::mouse.doShow = true;
- ui::ui.selectionArea->enable( true );
+ ui::ui.strategicArea->enable( true );
desiredPos = camera.p;
}
@@ -66,7 +66,7 @@ void StrategicProxy::end()
ui::mouse.doShow = true;
- ui::ui.selectionArea->enable( false );
+ ui::ui.strategicArea->enable( false );
}
void StrategicProxy::prepare()
@@ -80,8 +80,8 @@ void StrategicProxy::prepare()
if( input.keys[Input::KEY_SWITCH_TO_UNIT] && !input.oldKeys[Input::KEY_SWITCH_TO_UNIT] &&
camera.allowReincarnation )
{
- if( ui::ui.selectionArea->taggedObjs.length() == 1 ) {
- const Object* tagged = orbis.objects[ ui::ui.selectionArea->taggedObjs.first() ];
+ if( ui::ui.strategicArea->taggedObjs.length() == 1 ) {
+ const Object* tagged = orbis.objects[ ui::ui.strategicArea->taggedObjs.first() ];
const Bot* me = nullptr;
if( tagged != nullptr ) {
View
30 src/client/ui/SelectionArea.cc → src/client/ui/StrategicArea.cc
@@ -18,11 +18,11 @@
*/
/**
- * @file client/ui/SelectionArea.cc
+ * @file client/ui/StrategicArea.cc
*/
#include <stable.hh>
-#include <client/ui/SelectionArea.hh>
+#include <client/ui/StrategicArea.hh>
#include <client/Shader.hh>
#include <client/Shape.hh>
@@ -36,14 +36,14 @@ namespace client
namespace ui
{
-const float SelectionArea::TAG_CLIP_DIST = 0.1f;
-const float SelectionArea::TAG_CLAMP_LIMIT = 1e6f;
+const float StrategicArea::TAG_CLIP_DIST = 0.1f;
+const float StrategicArea::TAG_CLAMP_LIMIT = 1e6f;
// size in pixels
-const float SelectionArea::TAG_MIN_PIXEL_SIZE = 4.0f;
+const float StrategicArea::TAG_MIN_PIXEL_SIZE = 4.0f;
// size in coefficient
-const float SelectionArea::TAG_MAX_COEFF_SIZE = 4.0f;
+const float StrategicArea::TAG_MAX_COEFF_SIZE = 4.0f;
-bool SelectionArea::projectBounds( Span* span, const AABB& bb ) const
+bool StrategicArea::projectBounds( Span* span, const AABB& bb ) const
{
Vec3 p = bb.p - camera.p;
Vec3 corners[8] = {
@@ -89,7 +89,7 @@ bool SelectionArea::projectBounds( Span* span, const AABB& bb ) const
return true;
}
-void SelectionArea::drawHoveredRect( const Span& span, const Struct* str, const Entity* ent,
+void StrategicArea::drawHoveredRect( const Span& span, const Struct* str, const Entity* ent,
const Object* obj )
{
float minX = float( span.minX );
@@ -183,7 +183,7 @@ void SelectionArea::drawHoveredRect( const Span& span, const Struct* str, const
}
}
-void SelectionArea::drawTaggedRect( const Span& span, const Struct* str, const Object* obj,
+void StrategicArea::drawTaggedRect( const Span& span, const Struct* str, const Object* obj,
bool isHovered )
{
float minX = float( span.minX );
@@ -229,7 +229,7 @@ void SelectionArea::drawTaggedRect( const Span& span, const Struct* str, const O
}
}
-void SelectionArea::onVisibilityChange( bool )
+void StrategicArea::onVisibilityChange( bool )
{
taggedStrs.clear();
taggedObjs.clear();
@@ -242,7 +242,7 @@ void SelectionArea::onVisibilityChange( bool )
cachedObjectIndex = -1;
}
-void SelectionArea::onReposition()
+void StrategicArea::onReposition()
{
width = camera.width;
height = camera.height;
@@ -251,7 +251,7 @@ void SelectionArea::onReposition()
stepPixel = 1.0f / pixelStep;
}
-void SelectionArea::onUpdate()
+void StrategicArea::onUpdate()
{
for( int i = 0; i < taggedStrs.length(); ) {
const Struct* str = orbis.structs[ taggedStrs[i] ];
@@ -276,7 +276,7 @@ void SelectionArea::onUpdate()
}
}
-bool SelectionArea::onMouseEvent()
+bool StrategicArea::onMouseEvent()
{
Vec3 at = Vec3( float( mouse.x - camera.centreX ) * pixelStep * 100.0f,
float( mouse.y - camera.centreY ) * pixelStep * 100.0f,
@@ -331,7 +331,7 @@ bool SelectionArea::onMouseEvent()
return true;
}
-void SelectionArea::onDraw()
+void StrategicArea::onDraw()
{
const Struct* str = hoverStr < 0 ? nullptr : orbis.structs[hoverStr];
const Entity* ent = hoverEnt < 0 ? nullptr : &orbis.structs[hoverEnt / Struct::MAX_ENTITIES]->
@@ -392,7 +392,7 @@ void SelectionArea::onDraw()
hoverObj = -1;
}
-SelectionArea::SelectionArea() :
+StrategicArea::StrategicArea() :
Area( camera.width, camera.height ),
unitName( 0, 0, ALIGN_HCENTRE, Font::SANS, " " ),
cachedStructIndex( -1 ), cachedEntityIndex( -1 ), cachedObjectIndex( -1 ),
View
9 src/client/ui/SelectionArea.hh → src/client/ui/StrategicArea.hh
@@ -18,10 +18,9 @@
*/
/**
- * @file client/ui/SelectionArea.hh
+ * @file client/ui/StrategicArea.hh
*
- * Real-time strategy interface layer for HUD.
- * Provides unit selection and commanding.
+ * Real-time strategy interface layer for HUD. Provides unit selection and commanding.
*/
#pragma once
@@ -36,7 +35,7 @@ namespace client
namespace ui
{
-class SelectionArea : public Area
+class StrategicArea : public Area
{
private:
@@ -82,7 +81,7 @@ class SelectionArea : public Area
public:
- explicit SelectionArea();
+ explicit StrategicArea();
};
View
16 src/client/ui/UI.cc
@@ -31,7 +31,7 @@
#include <client/OpenGL.hh>
#include <client/ui/Style.hh>
#include <client/ui/LoadingArea.hh>
-#include <client/ui/SelectionArea.hh>
+#include <client/ui/StrategicArea.hh>
#include <client/ui/HudArea.hh>
#include <client/ui/QuestFrame.hh>
#include <client/ui/GalileoFrame.hh>
@@ -50,7 +50,7 @@ namespace ui
UI::UI() :
fpsLabel( nullptr ), root( nullptr ), loadingScreen( nullptr ), hudArea( nullptr ),
- selectionArea( nullptr ), questFrame( nullptr ), galileoFrame( nullptr ), musicPlayer( nullptr ),
+ strategicArea( nullptr ), questFrame( nullptr ), galileoFrame( nullptr ), musicPlayer( nullptr ),
inventory( nullptr ), buildMenu( nullptr ), debugFrame( nullptr )
{}
@@ -127,7 +127,7 @@ void UI::load()
isFreelook = false;
hudArea = new HudArea();
- selectionArea = new SelectionArea();
+ strategicArea = new StrategicArea();
questFrame = new QuestFrame();
galileoFrame = new GalileoFrame();
musicPlayer = new MusicPlayer();
@@ -137,7 +137,7 @@ void UI::load()
debugFrame = showDebug ? new DebugFrame() : nullptr;
root->add( hudArea, 0, 0 );
- root->add( selectionArea, 0, 0 );
+ root->add( strategicArea, 0, 0 );
root->add( questFrame, Area::CENTRE, -8 );
root->add( galileoFrame, 8, -8 );
root->add( musicPlayer, 8, -16 - galileoFrame->height );
@@ -152,7 +152,7 @@ void UI::load()
}
hudArea->enable( false );
- selectionArea->enable( false );
+ strategicArea->enable( false );
inventory->enable( false );
infoFrame->enable( false );
@@ -189,9 +189,9 @@ void UI::unload()
root->remove( questFrame );
questFrame = nullptr;
}
- if( selectionArea != nullptr ) {
- root->remove( selectionArea );
- selectionArea = nullptr;
+ if( strategicArea != nullptr ) {
+ root->remove( strategicArea );
+ strategicArea = nullptr;
}
if( hudArea != nullptr ) {
root->remove( hudArea );
View
4 src/client/ui/UI.hh
@@ -36,7 +36,7 @@ namespace ui
class Label;
class Area;
class LoadingArea;
-class SelectionArea;
+class StrategicArea;
class HudArea;
class QuestFrame;
class GalileoFrame;
@@ -64,7 +64,7 @@ class UI
Area* root;
LoadingArea* loadingScreen;
HudArea* hudArea;
- SelectionArea* selectionArea;
+ StrategicArea* strategicArea;
QuestFrame* questFrame;
GalileoFrame* galileoFrame;
MusicPlayer* musicPlayer;
View
2 src/ozCore/CMakeLists.txt
@@ -79,8 +79,6 @@ target_link_libraries( ozCore ${PHYSFS_LIBRARY} )
if( ANDROID )
target_link_libraries( ozCore ${ZLIB_LIBRARY} -lOpenSLES -llog ${PLATFORM_STL_LIBRARY} )
-elseif( NACL_GLIBC )
- target_link_libraries( ozCore ${ZLIB_LIBRARY} -lppapi_cpp -lppapi -lrt -lpthread )
elseif( NACL )
target_link_libraries( ozCore ${ZLIB_LIBRARY} -lppapi_cpp -lppapi -lpthread )
elseif( WIN32 )
View
1 src/ozCore/File.cc
@@ -34,6 +34,7 @@
# include <ppapi/cpp/file_io.h>
# include <ppapi/cpp/file_ref.h>
# include <ppapi/cpp/file_system.h>
+# include <pthread.h>
#elif defined( _WIN32 )
# include <windows.h>
#else
View
3 src/ozCore/System.cc
@@ -47,6 +47,9 @@
# include <ppapi/cpp/completion_callback.h>
# include <ppapi/cpp/core.h>
# include <pthread.h>
+# if defined( OZ_GCC ) && OZ_GCC >= 407
+# define _exit( code ) _Exit( code )
+# endif
#elif defined( _WIN32 )
# include <windows.h>
# include <io.h>
View
2 src/tools/openzone.cc
@@ -60,7 +60,7 @@ int main( int argc, char** argv )
System::instance = static_cast<pp::Instance*>( instance );
#endif
- System::init( System::DEFAULT_MASK, SDL_Quit );
+ System::init( System::DEFAULT_MASK );
int exitCode = EXIT_FAILURE;
View
11 src/unittest/String.cc
@@ -75,6 +75,9 @@ static void test_String_parsing()
else if( i == 3 ) {
x = Math::NaN;
}
+ else if( i == 4 ) {
+ x = -Math::NaN;
+ }
String s = String( x, 9 );
float y = String::parseFloat( s );
@@ -110,6 +113,9 @@ static void test_String_parsing()
else if( i == 3 ) {
x = Math::NaN;
}
+ else if( i == 4 ) {
+ x = -Math::NaN;
+ }
String s = String( x, 9 );
float y = String::parseFloat( s );
@@ -130,7 +136,7 @@ static void test_String_parsing()
}
OZ_CHECK( x == z );
}
- for( int i = 0; i < 10000; ++i ) {
+ for( int i = 0; i < 100000; ++i ) {
float x = Math::rand() * 3.4e-38f;
if( i == 0 ) {
@@ -145,6 +151,9 @@ static void test_String_parsing()
else if( i == 3 ) {
x = Math::NaN;
}
+ else if( i == 4 ) {
+ x = -Math::NaN;
+ }
String s = String( x, 9 );
float y = String::parseFloat( s );
View
6 src/unittest/unittest.cc
@@ -37,7 +37,11 @@ bool Foo::allowMove = true;
bool Foo::allowEqualsOp = true;
bool Foo::allowLessOp = true;
+#ifdef __native_client__
+static int nacl_main()
+#else
int main()
+#endif
{
Log() << "Unittest began\n";
@@ -60,7 +64,7 @@ int main()
void MainInstance::mainThreadMain( void* )
{
- main();
+ nacl_main();
}
MainInstance::MainInstance( PP_Instance instance_ ) :

0 comments on commit 6a9b437

Please sign in to comment.