Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

PNaCl

- ported to PNaCl
- some interfaces fail to load in run-time due to incompatibilities between
  pepper_canary (24) and Chrome 23
  • Loading branch information...
commit e2798b424822a0b2d141d67a5f5532bebb1563a5 1 parent ce4d6ef
@ducakar authored
View
4 CMakeLists.txt
@@ -193,8 +193,8 @@ set( flags "${flags} -fno-exceptions -fno-rtti -fvisibility-inlines-hidden -ffas
# Additional warnings.
if( ${CMAKE_CXX_COMPILER_ID} STREQUAL Clang )
set( flags "${flags} -Weverything -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-gnu" )
- set( flags "${flags} -Wno-disabled-macro-expansion -Wno-shadow -Wno-padded -Wno-float-equal" )
- set( flags "${flags} -Wno-global-constructors -Wno-exit-time-destructors" )
+ set( flags "${flags} -Wno-disabled-macro-expansion -Wno-shadow -Wno-padded -Wno-switch-enum" )
+ set( flags "${flags} -Wno-float-equal -Wno-global-constructors -Wno-exit-time-destructors" )
else()
set( flags "${flags} -Wall -Wextra -Wconversion -Wcast-align -Winit-self -Wlogical-op -Wundef" )
set( flags "${flags} -Wmissing-declarations -Wnon-virtual-dtor -Woverloaded-virtual" )
View
5 README.md
@@ -224,8 +224,9 @@ This script is used to build libraries required by OpenZone for some platforms.
zlib, physfs, SDL, SDL_ttf, OpenAL Soft, squish for NaCl-x86_64 and NaCl-i686.
The following commands may be given (`build` is assumed if none):
-- `clean`: Delete all built libraries for all platforms in `ports` directory. Downloaded sources
- are left intact.
+- `clean`: Delete everything in `ports` directory except downloaded sources.
+- `buildclean`: Delete build directories. Downloaded sources and installed libraries are left
+ intact.
- `fetch`: Download sources into `ports/archives` directory.
- `build`: Builds all libraries for all platforms.
View
18 build.sh
@@ -14,10 +14,14 @@ buildType=Debug
platforms=(
Linux-x86_64 Linux-x86_64-Clang Linux-i686 Linux-i686-Clang
Windows-i686
- NaCl-x86_64 NaCl-i686 #PNaCl
+ NaCl-x86_64 NaCl-i686 PNaCl
#Android14-i686 Android14-ARM Android14-ARMv7a Android14-MIPS
)
+# Extract path to PNaCl SDK from CMake toolchain file.
+pnaclRoot=`egrep '^set\( PLATFORM_PREFIX' cmake/PNaCl.Toolchain.cmake | \
+ sed -r 's|^set\( PLATFORM_PREFIX *"(.*)\" \)|\1|'`
+
function clean()
{
for platform in ${platforms[@]}; do
@@ -54,6 +58,15 @@ function build()
done
}
+function pnacl()
+{
+ for arch in x86_64 i686 arm; do
+ echo "Building openzone.$arch.nexe"
+ "$pnaclRoot/bin64/pnacl-translate" -arch $arch -o build/PNaCl/src/tools/openzone.$arch.nexe \
+ build/PNaCl/src/tools/openzone.pexe
+ done
+}
+
case $1 in
clean)
clean
@@ -61,6 +74,9 @@ case $1 in
conf)
build 1
;;
+ pnacl)
+ pnacl
+ ;;
build|*)
build 0
;;
View
1  cmake/NaCl-i686.Toolchain.cmake
@@ -4,6 +4,7 @@ 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_PORTS_PREFIX "${CMAKE_SOURCE_DIR}/ports/NaCl-i686" )
+set( PLATFORM_EXE_SUFFIX ".i686.nexe" )
set( CMAKE_SYSTEM_NAME "Linux" CACHE STRING "Target system." )
set( CMAKE_SYSTEM_PROCESSOR "i686" CACHE STRING "Target processor." )
View
1  cmake/NaCl-x86_64.Toolchain.cmake
@@ -4,6 +4,7 @@ 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_PORTS_PREFIX "${CMAKE_SOURCE_DIR}/ports/NaCl-x86_64" )
+set( PLATFORM_EXE_SUFFIX ".x86_64.nexe" )
set( CMAKE_SYSTEM_NAME "Linux" CACHE STRING "Target system." )
set( CMAKE_SYSTEM_PROCESSOR "x86_64" CACHE STRING "Target processor." )
View
19 cmake/PCH.cmake
@@ -18,6 +18,16 @@
# those are overridden by `use_pch()` macro. Otherwise PCH would be unusable for
# such targets anyway as PCH must be compiled with exactly the same flags as the target.
+if( PCH_DISABLE )
+
+macro( add_pch )
+endmacro( add_pch )
+
+macro( use_pch )
+endmacro( use_pch )
+
+else( PCH_DISABLE )
+
macro( add_pch _pchTarget _inputHeader _inputModule )
# Extract CMAKE_CXX_FLAGS and CMAKE_CXX_FLAGS_XXX for the current configuration XXX.
string( TOUPPER "CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}" _buildTypeFlagsVar )
@@ -53,9 +63,12 @@ macro( add_pch _pchTarget _inputHeader _inputModule )
# Cache header location for later `use_pch()` macros.
set( ${_pchTarget}_output "${CMAKE_CURRENT_BINARY_DIR}/${_inputHeader}" )
-endmacro()
+endmacro( add_pch )
macro( use_pch _target _pchTarget )
add_dependencies( ${_target} ${_pchTarget} )
- set_target_properties( ${_target} PROPERTIES COMPILE_FLAGS "-include '${${_pchTarget}_output}'" )
-endmacro()
+
+ set_target_properties( ${_target} PROPERTIES COMPILE_FLAGS "-include ${${_pchTarget}_output}" )
+endmacro( use_pch )
+
+endif( PCH_DISABLE )
View
17 cmake/PNaCl.Toolchain.cmake
@@ -1,8 +1,10 @@
set( NACL ON )
+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_PORTS_PREFIX "${CMAKE_SOURCE_DIR}/ports/PNaCl" )
+set( PLATFORM_EXE_SUFFIX ".pexe" )
set( CMAKE_SYSTEM_NAME "Linux" CACHE STRING "Target system." )
set( CMAKE_SYSTEM_PROCESSOR "LLVM" CACHE STRING "Target processor." )
@@ -10,5 +12,16 @@ set( CMAKE_FIND_ROOT_PATH "${PLATFORM_PORTS_PREFIX};${PLATFORM_PREFIX}/usr
set( CMAKE_FIND_ROOT_PATH "${CMAKE_FIND_ROOT_PATH};${PLATFORM_PREFIX}/sdk" )
set( CMAKE_C_COMPILER "${PLATFORM_PREFIX}/bin/${PLATFORM_TRIPLET}-clang" )
set( CMAKE_CXX_COMPILER "${PLATFORM_PREFIX}/bin/${PLATFORM_TRIPLET}-clang++" )
-set( CMAKE_C_FLAGS "" CACHE STRING "" )
-set( CMAKE_CXX_FLAGS "" CACHE STRING "" )
+set( CMAKE_C_FLAGS "-U__STRICT_ANSI__" CACHE STRING "" )
+set( CMAKE_CXX_FLAGS "-U__STRICT_ANSI__" CACHE STRING "" )
+set( CMAKE_AR "${PLATFORM_PREFIX}/bin/${PLATFORM_TRIPLET}-ar" CACHE STRING "")
+set( CMAKE_RANLIB "${PLATFORM_PREFIX}/bin/${PLATFORM_TRIPLET}-ranlib" CACHE STRING "")
+
+set( PCH_DISABLE ON )
+
+include( CMakeForceCompiler )
+cmake_force_c_compiler( ${CMAKE_C_COMPILER} Clang )
+cmake_force_cxx_compiler( ${CMAKE_CXX_COMPILER} Clang )
+
+set( CMAKE_C_COMPILER_VERSION 3.2 )
+set( CMAKE_CXX_COMPILER_VERSION 3.2 )
View
42 etc/nacl/nacl.html
@@ -1,42 +0,0 @@
-<html>
-<head>
- <title>NaCl Test</title>
- <style>
- body {
- margin: 0px;
- }
- div.log {
- padding: 8px;
- }
- div.log pre {
- font-size: 8pt;
- }
- </style>
- <script type="text/javascript">
- var log = null;
-// window.webkitStorageInfo.requestQuota( PERSISTENT, 1024 );
-
- function handleMessage( e ) {
- log.innerText += e.data;
- }
-
- function onLoad()
- {
- var module = document.getElementById( 'module' );
- module.addEventListener( 'message', handleMessage, true );
-
- log = document.getElementById( 'log' );
- log.innerText = "";
- }
- </script>
-</head>
-<body onLoad="onLoad()">
- <div id="module">
- <embed name="nacl_module" id="nacl" width="640" height="360" src="nacl.nmf"
- type="application/x-nacl"/>
- </div>
- <div class="log">
- <pre id="log"/>
- </div>
-</body>
-</html>
View
10 etc/nacl/nacl.nmf
@@ -1,10 +0,0 @@
-{
- "program": {
- "x86-64": {
- "url": "nacl.x86_64.nexe"
- },
- "x86-32": {
- "url": "nacl.i686.nexe"
- }
- }
-}
View
8 etc/nacl/openzone.nmf
@@ -1,10 +1,18 @@
{
"program": {
+ "portable": {
+ "pnacl-translate": {
+ "url": "openzone.pexe"
+ }
+ },
"x86-64": {
"url": "openzone.x86_64.nexe"
},
"x86-32": {
"url": "openzone.i686.nexe"
+ },
+ "arm": {
+ "url": "openzone.arm.nexe"
}
}
}
View
2  etc/nacl/unittest.html
@@ -7,7 +7,7 @@
}
</style>
</head>
-<body onLoad="onLoad()">
+<body>
<div id="module">
<embed name="nacl_module" id="nacl" width="640" height="360" src="unittest.nmf"
type="application/x-nacl"/>
View
8 etc/nacl/unittest.nmf
@@ -1,10 +1,18 @@
{
"program": {
+ "portable": {
+ "pnacl-translate": {
+ "url": "unittest.pexe"
+ }
+ },
"x86-64": {
"url": "unittest.x86_64.nexe"
},
"x86-32": {
"url": "unittest.i686.nexe"
+ },
+ "arm": {
+ "url": "unittest.arm.nexe"
}
}
}
View
155 etc/patches/SDL-1.2.15.patch
@@ -1,6 +1,6 @@
-diff -Naur SDL-1.2.15/build-scripts/config.sub SDL-1.2.15-nacl/build-scripts/config.sub
---- SDL-1.2.15/build-scripts/config.sub 2012-01-19 07:30:05.000000000 +0100
-+++ SDL-1.2.15-nacl/build-scripts/config.sub 2012-10-14 18:13:58.911967099 +0200
+diff -Naur SDL-1.2.15.orig/build-scripts/config.sub SDL-1.2.15/build-scripts/config.sub
+--- SDL-1.2.15.orig/build-scripts/config.sub 2012-01-19 07:30:05.000000000 +0100
++++ SDL-1.2.15/build-scripts/config.sub 2012-12-09 23:30:27.937372185 +0100
@@ -237,6 +237,14 @@
basic_machine=m68k-atari
os=-mint
@@ -26,9 +26,9 @@ diff -Naur SDL-1.2.15/build-scripts/config.sub SDL-1.2.15-nacl/build-scripts/con
-nto-qnx*)
;;
-nto*)
-diff -Naur SDL-1.2.15/configure.in SDL-1.2.15-nacl/configure.in
---- SDL-1.2.15/configure.in 2012-01-19 07:30:05.000000000 +0100
-+++ SDL-1.2.15-nacl/configure.in 2012-10-14 18:01:39.613301157 +0200
+diff -Naur SDL-1.2.15.orig/configure.in SDL-1.2.15/configure.in
+--- SDL-1.2.15.orig/configure.in 2012-01-19 07:30:05.000000000 +0100
++++ SDL-1.2.15/configure.in 2012-12-09 23:30:27.937372185 +0100
@@ -910,6 +910,26 @@
fi
}
@@ -77,9 +77,9 @@ diff -Naur SDL-1.2.15/configure.in SDL-1.2.15-nacl/configure.in
*-*-linux*|*-*-uclinux*|*-*-gnu*|*-*-k*bsd*-gnu|*-*-bsdi*|*-*-freebsd*|*-*-dragonfly*|*-*-netbsd*|*-*-openbsd*|*-*-sysv5*|*-*-solaris*|*-*-hpux*|*-*-irix*|*-*-aix*|*-*-osf*)
case "$host" in
*-*-linux*) ARCH=linux ;;
-diff -Naur SDL-1.2.15/include/SDL_config.h.in SDL-1.2.15-nacl/include/SDL_config.h.in
---- SDL-1.2.15/include/SDL_config.h.in 2012-01-19 07:30:05.000000000 +0100
-+++ SDL-1.2.15-nacl/include/SDL_config.h.in 2012-10-14 18:01:39.613301157 +0200
+diff -Naur SDL-1.2.15.orig/include/SDL_config.h.in SDL-1.2.15/include/SDL_config.h.in
+--- SDL-1.2.15.orig/include/SDL_config.h.in 2012-01-19 07:30:05.000000000 +0100
++++ SDL-1.2.15/include/SDL_config.h.in 2012-12-09 23:30:27.937372185 +0100
@@ -176,6 +176,7 @@
#undef SDL_AUDIO_DRIVER_ESD_DYNAMIC
#undef SDL_AUDIO_DRIVER_MINT
@@ -96,9 +96,9 @@ diff -Naur SDL-1.2.15/include/SDL_config.h.in SDL-1.2.15-nacl/include/SDL_config
#undef SDL_VIDEO_DRIVER_NANOX
#undef SDL_VIDEO_DRIVER_OS2FS
#undef SDL_VIDEO_DRIVER_PHOTON
-diff -Naur SDL-1.2.15/include/SDL_nacl.h SDL-1.2.15-nacl/include/SDL_nacl.h
---- SDL-1.2.15/include/SDL_nacl.h 1970-01-01 01:00:00.000000000 +0100
-+++ SDL-1.2.15-nacl/include/SDL_nacl.h 2012-10-14 18:01:39.616634470 +0200
+diff -Naur SDL-1.2.15.orig/include/SDL_nacl.h SDL-1.2.15/include/SDL_nacl.h
+--- SDL-1.2.15.orig/include/SDL_nacl.h 1970-01-01 01:00:00.000000000 +0100
++++ SDL-1.2.15/include/SDL_nacl.h 2012-12-09 23:30:27.937372185 +0100
@@ -0,0 +1,24 @@
+#ifndef _SDL_nacl_h
+#define _SDL_nacl_h
@@ -124,9 +124,9 @@ diff -Naur SDL-1.2.15/include/SDL_nacl.h SDL-1.2.15-nacl/include/SDL_nacl.h
+#include "close_code.h"
+
+#endif /* _SDL_nacl_h */
-diff -Naur SDL-1.2.15/include/SDL_platform.h SDL-1.2.15-nacl/include/SDL_platform.h
---- SDL-1.2.15/include/SDL_platform.h 2012-01-19 07:30:05.000000000 +0100
-+++ SDL-1.2.15-nacl/include/SDL_platform.h 2012-10-14 18:01:39.616634470 +0200
+diff -Naur SDL-1.2.15.orig/include/SDL_platform.h SDL-1.2.15/include/SDL_platform.h
+--- SDL-1.2.15.orig/include/SDL_platform.h 2012-01-19 07:30:05.000000000 +0100
++++ SDL-1.2.15/include/SDL_platform.h 2012-12-09 23:30:27.937372185 +0100
@@ -63,10 +63,14 @@
#undef __IRIX__
#define __IRIX__ 1
@@ -143,9 +143,9 @@ diff -Naur SDL-1.2.15/include/SDL_platform.h SDL-1.2.15-nacl/include/SDL_platfor
#if defined(__APPLE__)
#undef __MACOSX__
#define __MACOSX__ 1
-diff -Naur SDL-1.2.15/include/SDL_stdinc.h SDL-1.2.15-nacl/include/SDL_stdinc.h
---- SDL-1.2.15/include/SDL_stdinc.h 2012-01-19 07:30:05.000000000 +0100
-+++ SDL-1.2.15-nacl/include/SDL_stdinc.h 2012-10-14 19:14:06.552589476 +0200
+diff -Naur SDL-1.2.15.orig/include/SDL_stdinc.h SDL-1.2.15/include/SDL_stdinc.h
+--- SDL-1.2.15.orig/include/SDL_stdinc.h 2012-01-19 07:30:05.000000000 +0100
++++ SDL-1.2.15/include/SDL_stdinc.h 2012-12-09 23:30:27.937372185 +0100
@@ -103,9 +103,9 @@
typedef uint32_t Uint32;
@@ -158,9 +158,9 @@ diff -Naur SDL-1.2.15/include/SDL_stdinc.h SDL-1.2.15-nacl/include/SDL_stdinc.h
#endif
#else
/* This is really just a hack to prevent the compiler from complaining */
-diff -Naur SDL-1.2.15/Makefile.in SDL-1.2.15-nacl/Makefile.in
---- SDL-1.2.15/Makefile.in 2012-01-19 07:30:05.000000000 +0100
-+++ SDL-1.2.15-nacl/Makefile.in 2012-10-14 18:01:39.616634470 +0200
+diff -Naur SDL-1.2.15.orig/Makefile.in SDL-1.2.15/Makefile.in
+--- SDL-1.2.15.orig/Makefile.in 2012-01-19 07:30:05.000000000 +0100
++++ SDL-1.2.15/Makefile.in 2012-12-09 23:30:27.937372185 +0100
@@ -43,7 +43,7 @@
DIST = acinclude autogen.sh Borland.html Borland.zip BUGS build-scripts configure configure.in COPYING CREDITS CWprojects.sea.bin docs docs.html include INSTALL Makefile.dc Makefile.minimal Makefile.in MPWmake.sea.bin README* sdl-config.in sdl.m4 sdl.pc.in SDL.qpg.in SDL.spec SDL.spec.in src test TODO VisualCE VisualC.html VisualC Watcom-OS2.zip Watcom-Win32.zip symbian.zip WhatsNew Xcode
@@ -170,9 +170,9 @@ diff -Naur SDL-1.2.15/Makefile.in SDL-1.2.15-nacl/Makefile.in
LT_AGE = @LT_AGE@
LT_CURRENT = @LT_CURRENT@
-diff -Naur SDL-1.2.15/src/audio/nacl/SDL_naclaudio.cc SDL-1.2.15-nacl/src/audio/nacl/SDL_naclaudio.cc
---- SDL-1.2.15/src/audio/nacl/SDL_naclaudio.cc 1970-01-01 01:00:00.000000000 +0100
-+++ SDL-1.2.15-nacl/src/audio/nacl/SDL_naclaudio.cc 2012-10-14 18:01:39.616634470 +0200
+diff -Naur SDL-1.2.15.orig/src/audio/nacl/SDL_naclaudio.cc SDL-1.2.15/src/audio/nacl/SDL_naclaudio.cc
+--- SDL-1.2.15.orig/src/audio/nacl/SDL_naclaudio.cc 1970-01-01 01:00:00.000000000 +0100
++++ SDL-1.2.15/src/audio/nacl/SDL_naclaudio.cc 2012-12-09 23:30:27.937372185 +0100
@@ -0,0 +1,137 @@
+
+#include "SDL_config.h"
@@ -311,9 +311,9 @@ diff -Naur SDL-1.2.15/src/audio/nacl/SDL_naclaudio.cc SDL-1.2.15-nacl/src/audio/
+ return 1;
+}
+} // extern "C"
-diff -Naur SDL-1.2.15/src/audio/nacl/SDL_naclaudio.h SDL-1.2.15-nacl/src/audio/nacl/SDL_naclaudio.h
---- SDL-1.2.15/src/audio/nacl/SDL_naclaudio.h 1970-01-01 01:00:00.000000000 +0100
-+++ SDL-1.2.15-nacl/src/audio/nacl/SDL_naclaudio.h 2012-10-14 18:01:39.616634470 +0200
+diff -Naur SDL-1.2.15.orig/src/audio/nacl/SDL_naclaudio.h SDL-1.2.15/src/audio/nacl/SDL_naclaudio.h
+--- SDL-1.2.15.orig/src/audio/nacl/SDL_naclaudio.h 1970-01-01 01:00:00.000000000 +0100
++++ SDL-1.2.15/src/audio/nacl/SDL_naclaudio.h 2012-12-09 23:30:27.937372185 +0100
@@ -0,0 +1,30 @@
+#include "SDL_config.h"
+
@@ -345,9 +345,9 @@ diff -Naur SDL-1.2.15/src/audio/nacl/SDL_naclaudio.h SDL-1.2.15-nacl/src/audio/n
+};
+
+#endif /* _SDL_naclaudio_h */
-diff -Naur SDL-1.2.15/src/audio/SDL_audio.c SDL-1.2.15-nacl/src/audio/SDL_audio.c
---- SDL-1.2.15/src/audio/SDL_audio.c 2012-01-19 07:30:06.000000000 +0100
-+++ SDL-1.2.15-nacl/src/audio/SDL_audio.c 2012-10-14 18:03:50.932478620 +0200
+diff -Naur SDL-1.2.15.orig/src/audio/SDL_audio.c SDL-1.2.15/src/audio/SDL_audio.c
+--- SDL-1.2.15.orig/src/audio/SDL_audio.c 2012-01-19 07:30:06.000000000 +0100
++++ SDL-1.2.15/src/audio/SDL_audio.c 2012-12-09 23:30:27.937372185 +0100
@@ -36,6 +36,9 @@
/* Available audio drivers */
@@ -358,9 +358,9 @@ diff -Naur SDL-1.2.15/src/audio/SDL_audio.c SDL-1.2.15-nacl/src/audio/SDL_audio.
#if SDL_AUDIO_DRIVER_PULSE
&PULSE_bootstrap,
#endif
-diff -Naur SDL-1.2.15/src/audio/SDL_sysaudio.h SDL-1.2.15-nacl/src/audio/SDL_sysaudio.h
---- SDL-1.2.15/src/audio/SDL_sysaudio.h 2012-01-19 07:30:06.000000000 +0100
-+++ SDL-1.2.15-nacl/src/audio/SDL_sysaudio.h 2012-10-14 18:01:39.616634470 +0200
+diff -Naur SDL-1.2.15.orig/src/audio/SDL_sysaudio.h SDL-1.2.15/src/audio/SDL_sysaudio.h
+--- SDL-1.2.15.orig/src/audio/SDL_sysaudio.h 2012-01-19 07:30:06.000000000 +0100
++++ SDL-1.2.15/src/audio/SDL_sysaudio.h 2012-12-09 23:30:27.940705519 +0100
@@ -158,6 +158,9 @@
extern AudioBootStrap MINTAUDIO_XBIOS_bootstrap;
extern AudioBootStrap MINTAUDIO_DMA8_bootstrap;
@@ -371,9 +371,9 @@ diff -Naur SDL-1.2.15/src/audio/SDL_sysaudio.h SDL-1.2.15-nacl/src/audio/SDL_sys
#if SDL_AUDIO_DRIVER_DISK
extern AudioBootStrap DISKAUD_bootstrap;
#endif
-diff -Naur SDL-1.2.15/src/cpuinfo/SDL_cpuinfo.c SDL-1.2.15-nacl/src/cpuinfo/SDL_cpuinfo.c
---- SDL-1.2.15/src/cpuinfo/SDL_cpuinfo.c 2012-01-19 07:30:06.000000000 +0100
-+++ SDL-1.2.15-nacl/src/cpuinfo/SDL_cpuinfo.c 2012-10-14 18:01:39.616634470 +0200
+diff -Naur SDL-1.2.15.orig/src/cpuinfo/SDL_cpuinfo.c SDL-1.2.15/src/cpuinfo/SDL_cpuinfo.c
+--- SDL-1.2.15.orig/src/cpuinfo/SDL_cpuinfo.c 2012-01-19 07:30:06.000000000 +0100
++++ SDL-1.2.15/src/cpuinfo/SDL_cpuinfo.c 2012-12-09 23:30:27.940705519 +0100
@@ -53,6 +53,8 @@
}
#endif /* HAVE_SETJMP */
@@ -399,9 +399,9 @@ diff -Naur SDL-1.2.15/src/cpuinfo/SDL_cpuinfo.c SDL-1.2.15-nacl/src/cpuinfo/SDL_
static __inline__ int CPU_haveRDTSC(void)
{
if ( CPU_haveCPUID() ) {
-diff -Naur SDL-1.2.15/src/SDL_fatal.c SDL-1.2.15-nacl/src/SDL_fatal.c
---- SDL-1.2.15/src/SDL_fatal.c 2012-01-19 07:30:06.000000000 +0100
-+++ SDL-1.2.15-nacl/src/SDL_fatal.c 2012-10-14 18:01:39.616634470 +0200
+diff -Naur SDL-1.2.15.orig/src/SDL_fatal.c SDL-1.2.15/src/SDL_fatal.c
+--- SDL-1.2.15.orig/src/SDL_fatal.c 2012-01-19 07:30:06.000000000 +0100
++++ SDL-1.2.15/src/SDL_fatal.c 2012-12-09 23:30:27.940705519 +0100
@@ -39,7 +39,11 @@
{
signal(sig, SIG_DFL);
@@ -414,9 +414,9 @@ diff -Naur SDL-1.2.15/src/SDL_fatal.c SDL-1.2.15-nacl/src/SDL_fatal.c
}
static int SDL_fatal_signals[] = {
-diff -Naur SDL-1.2.15/src/thread/pthread/SDL_systhread.c SDL-1.2.15-nacl/src/thread/pthread/SDL_systhread.c
---- SDL-1.2.15/src/thread/pthread/SDL_systhread.c 2012-01-19 07:30:06.000000000 +0100
-+++ SDL-1.2.15-nacl/src/thread/pthread/SDL_systhread.c 2012-10-14 18:01:39.616634470 +0200
+diff -Naur SDL-1.2.15.orig/src/thread/pthread/SDL_systhread.c SDL-1.2.15/src/thread/pthread/SDL_systhread.c
+--- SDL-1.2.15.orig/src/thread/pthread/SDL_systhread.c 2012-01-19 07:30:06.000000000 +0100
++++ SDL-1.2.15/src/thread/pthread/SDL_systhread.c 2012-12-09 23:30:27.940705519 +0100
@@ -81,12 +81,15 @@
int i;
sigset_t mask;
@@ -433,9 +433,9 @@ diff -Naur SDL-1.2.15/src/thread/pthread/SDL_systhread.c SDL-1.2.15-nacl/src/thr
#ifdef PTHREAD_CANCEL_ASYNCHRONOUS
/* Allow ourselves to be asynchronously cancelled */
-diff -Naur SDL-1.2.15/src/video/nacl/eventqueue.h SDL-1.2.15-nacl/src/video/nacl/eventqueue.h
---- SDL-1.2.15/src/video/nacl/eventqueue.h 1970-01-01 01:00:00.000000000 +0100
-+++ SDL-1.2.15-nacl/src/video/nacl/eventqueue.h 2012-10-14 18:01:39.616634470 +0200
+diff -Naur SDL-1.2.15.orig/src/video/nacl/eventqueue.h SDL-1.2.15/src/video/nacl/eventqueue.h
+--- SDL-1.2.15.orig/src/video/nacl/eventqueue.h 1970-01-01 01:00:00.000000000 +0100
++++ SDL-1.2.15/src/video/nacl/eventqueue.h 2012-12-09 23:30:27.940705519 +0100
@@ -0,0 +1,40 @@
+#ifndef _SDL_nacl_eventqueue_h
+#define _SDL_nacl_eventqueue_h
@@ -477,9 +477,9 @@ diff -Naur SDL-1.2.15/src/video/nacl/eventqueue.h SDL-1.2.15-nacl/src/video/nacl
+};
+
+#endif // _SDL_nacl_eventqueue_h
-diff -Naur SDL-1.2.15/src/video/nacl/MainThreadRunner.cc SDL-1.2.15-nacl/src/video/nacl/MainThreadRunner.cc
---- SDL-1.2.15/src/video/nacl/MainThreadRunner.cc 1970-01-01 01:00:00.000000000 +0100
-+++ SDL-1.2.15-nacl/src/video/nacl/MainThreadRunner.cc 2012-10-14 18:01:39.706633912 +0200
+diff -Naur SDL-1.2.15.orig/src/video/nacl/MainThreadRunner.cc SDL-1.2.15/src/video/nacl/MainThreadRunner.cc
+--- SDL-1.2.15.orig/src/video/nacl/MainThreadRunner.cc 1970-01-01 01:00:00.000000000 +0100
++++ SDL-1.2.15/src/video/nacl/MainThreadRunner.cc 2012-12-09 23:30:27.940705519 +0100
@@ -0,0 +1,227 @@
+/*
+ * Copyright (c) 2012 The Native Client Authors. All rights reserved.
@@ -708,9 +708,9 @@ diff -Naur SDL-1.2.15/src/video/nacl/MainThreadRunner.cc SDL-1.2.15-nacl/src/vid
+jmp_buf MainThreadRunner::pseudo_thread_state_;
+bool MainThreadRunner::in_pseudo_thread_ = false;
+bool MainThreadRunner::forked_pseudo_thread_ = false;
-diff -Naur SDL-1.2.15/src/video/nacl/MainThreadRunner.h SDL-1.2.15-nacl/src/video/nacl/MainThreadRunner.h
---- SDL-1.2.15/src/video/nacl/MainThreadRunner.h 1970-01-01 01:00:00.000000000 +0100
-+++ SDL-1.2.15-nacl/src/video/nacl/MainThreadRunner.h 2012-10-14 18:01:39.706633912 +0200
+diff -Naur SDL-1.2.15.orig/src/video/nacl/MainThreadRunner.h SDL-1.2.15/src/video/nacl/MainThreadRunner.h
+--- SDL-1.2.15.orig/src/video/nacl/MainThreadRunner.h 1970-01-01 01:00:00.000000000 +0100
++++ SDL-1.2.15/src/video/nacl/MainThreadRunner.h 2012-12-09 23:30:27.940705519 +0100
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2012 The Native Client Authors. All rights reserved.
@@ -814,9 +814,9 @@ diff -Naur SDL-1.2.15/src/video/nacl/MainThreadRunner.h SDL-1.2.15-nacl/src/vide
+// MainThreadRunner executes MainThreadJobs asynchronously
+
+#endif // LIBRARIES_NACL_MOUNTS_BASE_MAINTHREADRUNNER_H_
-diff -Naur SDL-1.2.15/src/video/nacl/SDL_naclevents.cc SDL-1.2.15-nacl/src/video/nacl/SDL_naclevents.cc
---- SDL-1.2.15/src/video/nacl/SDL_naclevents.cc 1970-01-01 01:00:00.000000000 +0100
-+++ SDL-1.2.15-nacl/src/video/nacl/SDL_naclevents.cc 2012-10-14 18:01:39.706633912 +0200
+diff -Naur SDL-1.2.15.orig/src/video/nacl/SDL_naclevents.cc SDL-1.2.15/src/video/nacl/SDL_naclevents.cc
+--- SDL-1.2.15.orig/src/video/nacl/SDL_naclevents.cc 1970-01-01 01:00:00.000000000 +0100
++++ SDL-1.2.15/src/video/nacl/SDL_naclevents.cc 2012-12-09 23:30:27.940705519 +0100
@@ -0,0 +1,307 @@
+#include "SDL_config.h"
+
@@ -1125,9 +1125,9 @@ diff -Naur SDL-1.2.15/src/video/nacl/SDL_naclevents.cc SDL-1.2.15-nacl/src/video
+void NACL_InitOSKeymap(_THIS) {
+ /* do nothing. */
+}
-diff -Naur SDL-1.2.15/src/video/nacl/SDL_naclevents_c.h SDL-1.2.15-nacl/src/video/nacl/SDL_naclevents_c.h
---- SDL-1.2.15/src/video/nacl/SDL_naclevents_c.h 1970-01-01 01:00:00.000000000 +0100
-+++ SDL-1.2.15-nacl/src/video/nacl/SDL_naclevents_c.h 2012-10-14 18:01:39.706633912 +0200
+diff -Naur SDL-1.2.15.orig/src/video/nacl/SDL_naclevents_c.h SDL-1.2.15/src/video/nacl/SDL_naclevents_c.h
+--- SDL-1.2.15.orig/src/video/nacl/SDL_naclevents_c.h 1970-01-01 01:00:00.000000000 +0100
++++ SDL-1.2.15/src/video/nacl/SDL_naclevents_c.h 2012-12-09 23:30:27.940705519 +0100
@@ -0,0 +1,7 @@
+#include "SDL_config.h"
+
@@ -1136,9 +1136,9 @@ diff -Naur SDL-1.2.15/src/video/nacl/SDL_naclevents_c.h SDL-1.2.15-nacl/src/vide
+
+extern void NACL_InitOSKeymap(_THIS);
+extern void NACL_PumpEvents(_THIS);
-diff -Naur SDL-1.2.15/src/video/nacl/SDL_nacljob.cc SDL-1.2.15-nacl/src/video/nacl/SDL_nacljob.cc
---- SDL-1.2.15/src/video/nacl/SDL_nacljob.cc 1970-01-01 01:00:00.000000000 +0100
-+++ SDL-1.2.15-nacl/src/video/nacl/SDL_nacljob.cc 2012-10-14 18:01:39.706633912 +0200
+diff -Naur SDL-1.2.15.orig/src/video/nacl/SDL_nacljob.cc SDL-1.2.15/src/video/nacl/SDL_nacljob.cc
+--- SDL-1.2.15.orig/src/video/nacl/SDL_nacljob.cc 1970-01-01 01:00:00.000000000 +0100
++++ SDL-1.2.15/src/video/nacl/SDL_nacljob.cc 2012-12-09 23:30:27.940705519 +0100
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2011 The Native Client Authors. All rights reserved.
@@ -1211,10 +1211,10 @@ diff -Naur SDL-1.2.15/src/video/nacl/SDL_nacljob.cc SDL-1.2.15-nacl/src/video/na
+void SDLNaclJob::Finish(int32_t result) {
+ MainThreadRunner::ResultCompletion(job_entry_, result);
+}
-diff -Naur SDL-1.2.15/src/video/nacl/SDL_nacljob.h SDL-1.2.15-nacl/src/video/nacl/SDL_nacljob.h
---- SDL-1.2.15/src/video/nacl/SDL_nacljob.h 1970-01-01 01:00:00.000000000 +0100
-+++ SDL-1.2.15-nacl/src/video/nacl/SDL_nacljob.h 2012-10-14 18:01:39.706633912 +0200
-@@ -0,0 +1,60 @@
+diff -Naur SDL-1.2.15.orig/src/video/nacl/SDL_nacljob.h SDL-1.2.15/src/video/nacl/SDL_nacljob.h
+--- SDL-1.2.15.orig/src/video/nacl/SDL_nacljob.h 1970-01-01 01:00:00.000000000 +0100
++++ SDL-1.2.15/src/video/nacl/SDL_nacljob.h 2012-12-09 23:30:50.167370062 +0100
+@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2011 The Native Client Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
@@ -1232,11 +1232,8 @@ diff -Naur SDL-1.2.15/src/video/nacl/SDL_nacljob.h SDL-1.2.15-nacl/src/video/nac
+#include <ppapi/cpp/url_loader.h>
+#include <ppapi/cpp/url_request_info.h>
+#include <ppapi/cpp/url_response_info.h>
-+/* TODO: include completion_callback_factory.h unconditionally one all sdk are updated */
+#include <ppapi/c/ppb_var.h>
-+#ifdef PPB_VAR_INTERFACE_1_1
+#include <ppapi/utility/completion_callback_factory.h>
-+#endif
+#include <string>
+#include <vector>
+#include <set>
@@ -1275,9 +1272,9 @@ diff -Naur SDL-1.2.15/src/video/nacl/SDL_nacljob.h SDL-1.2.15-nacl/src/video/nac
+};
+
+#endif
-diff -Naur SDL-1.2.15/src/video/nacl/SDL_naclvideo.cc SDL-1.2.15-nacl/src/video/nacl/SDL_naclvideo.cc
---- SDL-1.2.15/src/video/nacl/SDL_naclvideo.cc 1970-01-01 01:00:00.000000000 +0100
-+++ SDL-1.2.15-nacl/src/video/nacl/SDL_naclvideo.cc 2012-10-14 18:01:39.706633912 +0200
+diff -Naur SDL-1.2.15.orig/src/video/nacl/SDL_naclvideo.cc SDL-1.2.15/src/video/nacl/SDL_naclvideo.cc
+--- SDL-1.2.15.orig/src/video/nacl/SDL_naclvideo.cc 1970-01-01 01:00:00.000000000 +0100
++++ SDL-1.2.15/src/video/nacl/SDL_naclvideo.cc 2012-12-09 23:30:27.940705519 +0100
@@ -0,0 +1,243 @@
+#include "SDL_config.h"
+
@@ -1522,9 +1519,9 @@ diff -Naur SDL-1.2.15/src/video/nacl/SDL_naclvideo.cc SDL-1.2.15-nacl/src/video/
+ gNaclMainThreadRunner->RunJob(job);
+}
+} // extern "C"
-diff -Naur SDL-1.2.15/src/video/nacl/SDL_naclvideo.h SDL-1.2.15-nacl/src/video/nacl/SDL_naclvideo.h
---- SDL-1.2.15/src/video/nacl/SDL_naclvideo.h 1970-01-01 01:00:00.000000000 +0100
-+++ SDL-1.2.15-nacl/src/video/nacl/SDL_naclvideo.h 2012-10-14 18:01:39.706633912 +0200
+diff -Naur SDL-1.2.15.orig/src/video/nacl/SDL_naclvideo.h SDL-1.2.15/src/video/nacl/SDL_naclvideo.h
+--- SDL-1.2.15.orig/src/video/nacl/SDL_naclvideo.h 1970-01-01 01:00:00.000000000 +0100
++++ SDL-1.2.15/src/video/nacl/SDL_naclvideo.h 2012-12-09 23:30:27.940705519 +0100
@@ -0,0 +1,37 @@
+#include "SDL_config.h"
+
@@ -1563,9 +1560,9 @@ diff -Naur SDL-1.2.15/src/video/nacl/SDL_naclvideo.h SDL-1.2.15-nacl/src/video/n
+};
+
+#endif /* _SDL_naclvideo_h */
-diff -Naur SDL-1.2.15/src/video/SDL_sysvideo.h SDL-1.2.15-nacl/src/video/SDL_sysvideo.h
---- SDL-1.2.15/src/video/SDL_sysvideo.h 2012-01-19 07:30:06.000000000 +0100
-+++ SDL-1.2.15-nacl/src/video/SDL_sysvideo.h 2012-10-14 18:01:39.706633912 +0200
+diff -Naur SDL-1.2.15.orig/src/video/SDL_sysvideo.h SDL-1.2.15/src/video/SDL_sysvideo.h
+--- SDL-1.2.15.orig/src/video/SDL_sysvideo.h 2012-01-19 07:30:06.000000000 +0100
++++ SDL-1.2.15/src/video/SDL_sysvideo.h 2012-12-09 23:30:27.940705519 +0100
@@ -317,6 +317,9 @@
SDL_VideoDevice *(*create)(int devindex);
} VideoBootStrap;
@@ -1576,9 +1573,9 @@ diff -Naur SDL-1.2.15/src/video/SDL_sysvideo.h SDL-1.2.15-nacl/src/video/SDL_sys
#if SDL_VIDEO_DRIVER_QUARTZ
extern VideoBootStrap QZ_bootstrap;
#endif
-diff -Naur SDL-1.2.15/src/video/SDL_video.c SDL-1.2.15-nacl/src/video/SDL_video.c
---- SDL-1.2.15/src/video/SDL_video.c 2012-01-19 07:30:06.000000000 +0100
-+++ SDL-1.2.15-nacl/src/video/SDL_video.c 2012-10-14 18:01:39.706633912 +0200
+diff -Naur SDL-1.2.15.orig/src/video/SDL_video.c SDL-1.2.15/src/video/SDL_video.c
+--- SDL-1.2.15.orig/src/video/SDL_video.c 2012-01-19 07:30:06.000000000 +0100
++++ SDL-1.2.15/src/video/SDL_video.c 2012-12-09 23:30:27.940705519 +0100
@@ -33,6 +33,9 @@
/* Available video drivers */
View
143 ports.sh
@@ -6,8 +6,9 @@
# builds zlib, physfs, SDL, SDL_ttf, OpenAL Soft, squish for NaCl-x86_64 and NaCl-i686.
# The following commands may be given (`build` is assumed if none):
#
-# - `clean`: Delete all built libraries for all platforms in `ports` directory. Downloaded sources
-# are left intact.
+# - `clean`: Delete everything in `ports` directory except downloaded sources.
+# - `buildclean`: Delete build directories. Downloaded sources and installed libraries are left
+# intact.
# - `fetch`: Download sources into `ports/archives` directory.
# - `build`: Builds all libraries for all platforms.
#
@@ -45,12 +46,13 @@ function msg()
function setup_nacl64()
{
- platform="NaCl-x86_64"
- buildDir="$topDir/$platform"
- triplet="x86_64-nacl"
- sysroot="$naclPrefix/x86_64-nacl"
- toolsroot="$naclPrefix"
- toolchain="$projectDir/cmake/$platform.Toolchain.cmake"
+ 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.
+ toolchain="$projectDir/cmake/$platform.Toolchain.cmake" # CMake toolchain.
export CPP="$toolsroot/bin/$triplet-cpp"
export CC="$toolsroot/bin/$triplet-gcc"
@@ -68,12 +70,13 @@ function setup_nacl64()
function setup_nacl32()
{
- platform="NaCl-i686"
- buildDir="$topDir/$platform"
- triplet="i686-nacl"
- sysroot="$naclPrefix/i686-nacl"
- toolsroot="$naclPrefix"
- toolchain="$projectDir/cmake/$platform.Toolchain.cmake"
+ 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.
+ toolchain="$projectDir/cmake/$platform.Toolchain.cmake" # CMake toolchain.
export CPP="$toolsroot/bin/$triplet-cpp"
export CC="$toolsroot/bin/$triplet-gcc"
@@ -91,14 +94,16 @@ function setup_nacl32()
function setup_pnacl()
{
- platform="PNaCl"
- buildDir="$topDir/$platform"
- triplet="pnacl"
- sysroot="$pnaclPrefix/usr"
- toolsroot="$pnaclPrefix"
- toolchain="$projectDir/cmake/$platform.Toolchain.cmake"
-
- export CPP=""
+ platform="PNaCl" # Platform name.
+ buildDir="$topDir/$platform" # Build and install directory.
+ triplet="pnacl" # Platform triplet (tools prefix).
+ hostTriplet="i686-nacl" # Host triplet for autotools configure.
+ sysroot="$pnaclPrefix/usr" # SDK sysroot.
+ toolsroot="$pnaclPrefix" # SDK tool root.
+ toolchain="$projectDir/cmake/$platform.Toolchain.cmake" # CMake toolchain.
+
+ #export CPP="$toolsroot/bin/$triplet-cpp"
+ export -n CPP
export CC="$toolsroot/bin/$triplet-clang"
export AR="$toolsroot/bin/$triplet-ar"
export RANLIB="$toolsroot/bin/$triplet-ranlib"
@@ -107,19 +112,20 @@ function setup_pnacl()
export PKG_CONFIG_LIBDIR="$buildDir/usr/lib"
export PATH="$toolsroot/bin:$PATH"
- export CPPFLAGS=""
- export CFLAGS=""
- export LDFLAGS=""
+ export CPPFLAGS="-I$buildDir/usr/include"
+ export CFLAGS="-O3 -ffast-math"
+ export LDFLAGS="-L$buildDir/usr/lib -lnosys"
}
function setup_ndkX86()
{
- platform="Android14-i686"
- buildDir="$topDir/$platform"
- triplet="i686-linux-android"
- sysroot="$ndkX86Platform"
- toolsroot="$ndkX86Tools"
- toolchain="$projectDir/cmake/$platform.Toolchain.cmake"
+ platform="Android14-i686" # Platform name.
+ buildDir="$topDir/$platform" # Build and install directory.
+ triplet="i686-linux-android" # Platform triplet (tools prefix).
+ hostTriplet="$triplet" # Host triplet for autotools configure.
+ sysroot="$ndkX86Platform" # SDK sysroot.
+ toolsroot="$ndkX86Tools" # SDK tool root.
+ toolchain="$projectDir/cmake/$platform.Toolchain.cmake" # CMake toolchain.
export CPP="$toolsroot/bin/$triplet-cpp"
export CC="$toolsroot/bin/$triplet-gcc"
@@ -137,12 +143,13 @@ function setup_ndkX86()
function setup_ndkARM()
{
- platform="Android14-ARM"
- buildDir="$topDir/$platform"
- triplet="arm-linux-androideabi"
- sysroot="$ndkARMPlatform"
- toolsroot="$ndkARMTools"
- toolchain="$projectDir/cmake/$platform.Toolchain.cmake"
+ platform="Android14-ARM" # Platform name.
+ buildDir="$topDir/$platform" # Build and install directory.
+ triplet="arm-linux-androideabi" # Platform triplet (tools prefix).
+ hostTriplet="$triplet" # Host triplet for autotools configure.
+ sysroot="$ndkARMPlatform" # SDK sysroot.
+ toolsroot="$ndkARMTools" # SDK tool root.
+ toolchain="$projectDir/cmake/$platform.Toolchain.cmake" # CMake toolchain.
export CPP="$toolsroot/bin/$triplet-cpp"
export CC="$toolsroot/bin/$triplet-gcc"
@@ -160,12 +167,13 @@ function setup_ndkARM()
function setup_ndkARM7()
{
- platform="Android14-ARMv7a"
- buildDir="$topDir/$platform"
- triplet="arm-linux-androideabi"
- sysroot="$ndkARMPlatform"
- toolsroot="$ndkARMTools"
- toolchain="$projectDir/cmake/$platform.Toolchain.cmake"
+ platform="Android14-ARMv7a" # Platform name.
+ buildDir="$topDir/$platform" # Build and install directory.
+ triplet="arm-linux-androideabi" # Platform triplet (tools prefix).
+ hostTriplet="$triplet" # Host triplet for autotools configure.
+ sysroot="$ndkARMPlatform" # SDK sysroot.
+ toolsroot="$ndkARMTools" # SDK tool root.
+ toolchain="$projectDir/cmake/$platform.Toolchain.cmake" # CMake toolchain.
export CPP="$toolsroot/bin/$triplet-cpp"
export CC="$toolsroot/bin/$triplet-gcc"
@@ -183,12 +191,13 @@ function setup_ndkARM7()
function setup_ndkMIPS()
{
- platform="Android14-MIPS"
- buildDir="$topDir/$platform"
- triplet="mipsel-linux-android"
- sysroot="$ndkMIPSPlatform"
- toolsroot="$ndkMIPSTools"
- toolchain="$projectDir/cmake/$platform.Toolchain.cmake"
+ platform="Android14-MIPS" # Platform name.
+ buildDir="$topDir/$platform" # Build and install directory.
+ triplet="mipsel-linux-android" # Platform triplet (tools prefix).
+ hostTriplet="$triplet" # Host triplet for autotools configure.
+ sysroot="$ndkMIPSPlatform" # SDK sysroot.
+ toolsroot="$ndkMIPSTools" # SDK tool root.
+ toolchain="$projectDir/cmake/$platform.Toolchain.cmake" # CMake toolchain.
export CPP="$toolsroot/bin/$triplet-cpp"
export CC="$toolsroot/bin/$triplet-gcc"
@@ -211,6 +220,15 @@ function clean()
done
}
+function buildclean()
+{
+ for platform in ${platforms[@]}; do
+ for subDir in `echo "$topDir/$platform/*"`; do
+ [[ $subDir == */usr ]] || rm -rf "$subDir"
+ done
+ done
+}
+
function download()
{
mkdir -p "$topDir/archives"
@@ -307,7 +325,7 @@ function cmakeBuild()
function autotoolsBuild()
{
mkdir -p build && cd build
- ../configure --host=$triplet --prefix=/usr $@ || exit 1
+ ../configure --host=$hostTriplet --prefix=/usr $@ || exit 1
make -j4 || exit 1
make install DESTDIR="$buildDir"
@@ -338,7 +356,7 @@ function build_lua()
prepare lua-5.2.1 lua-5.2.1.tar.gz || return
applyPatches lua-5.2.1.patch
- make -j4 CC="$CC" CFLAGS="$CPPFLAGS $CFLAGS" PLAT="generic" MYLIBS="$LDFLAGS"
+ make -j4 CC="$CC" AR="$AR rcu" RANLIB="$RANLIB" CFLAGS="$CFLAGS" PLAT="generic" MYLIBS="$LDFLAGS"
make INSTALL_TOP="$buildDir/usr" install
}
@@ -349,7 +367,7 @@ function build_sdl()
./autogen.sh
case $triplet in
- *-nacl)
+ *nacl)
# Assembly causes NaCl validity check to fail when NEXE is loading.
autotoolsBuild --disable-shared --disable-pthread-sem --disable-assembly
;;
@@ -428,12 +446,12 @@ function build()
# zlib
setup_nacl64 && build_zlib
setup_nacl32 && build_zlib
-# setup_pnacl && build_zlib
+ setup_pnacl && build_zlib
# physfs
setup_nacl64 && build_physfs
setup_nacl32 && build_physfs
-# setup_pnacl && build_physfs
+ setup_pnacl && build_physfs
# setup_ndkX86 && build_physfs
# setup_ndkARM && build_physfs
# setup_ndkARM7 && build_physfs
@@ -442,7 +460,7 @@ function build()
# lua
setup_nacl64 && build_lua
setup_nacl32 && build_lua
-# setup_pnacl && build_lua
+ setup_pnacl && build_lua
# setup_ndkX86 && build_lua
# setup_ndkARM && build_lua
# setup_ndkARM7 && build_lua
@@ -451,7 +469,7 @@ function build()
# SDL
setup_nacl64 && build_sdl
setup_nacl32 && build_sdl
-# setup_pnacl && build_sdl
+ setup_pnacl && build_sdl
# setup_ndkX86 && build_sdl2
# setup_ndkARM && build_sdl2
# setup_ndkARM7 && build_sdl2
@@ -460,7 +478,7 @@ function build()
# freetype
setup_nacl64 && build_freetype
setup_nacl32 && build_freetype
-# setup_pnacl && build_freetype
+ setup_pnacl && build_freetype
# setup_ndkX86 && build_freetype
# setup_ndkARM && build_freetype
# setup_ndkARM7 && build_freetype
@@ -469,7 +487,7 @@ function build()
# SDL_ttf
setup_nacl64 && build_sdl_ttf
setup_nacl32 && build_sdl_ttf
-# setup_pnacl && build_sdl_ttf
+ setup_pnacl && build_sdl_ttf
# setup_ndkX86 && build_sdl2_ttf
# setup_ndkARM && build_sdl2_ttf
# setup_ndkARM7 && build_sdl2_ttf
@@ -478,7 +496,7 @@ function build()
# openal
setup_nacl64 && build_openal
setup_nacl32 && build_openal
-# setup_pnacl && build_openal
+ setup_pnacl && build_openal
# setup_ndkX86 && build_openal
# setup_ndkARM && build_openal
# setup_ndkARM7 && build_openal
@@ -487,7 +505,7 @@ function build()
# libogg
setup_nacl64 && build_libogg
setup_nacl32 && build_libogg
-# setup_pnacl && build_libogg
+ setup_pnacl && build_libogg
# setup_ndkX86 && build_libogg
# setup_ndkARM && build_libogg
# setup_ndkARM7 && build_libogg
@@ -496,7 +514,7 @@ function build()
# libvorbis
setup_nacl64 && build_libvorbis
setup_nacl32 && build_libvorbis
-# setup_pnacl && build_libvorbis
+ setup_pnacl && build_libvorbis
# setup_ndkX86 && build_libvorbis
# setup_ndkARM && build_libvorbis
# setup_ndkARM7 && build_libvorbis
@@ -507,6 +525,9 @@ case $1 in
clean)
clean
;;
+ buildclean)
+ buildclean
+ ;;
fetch)
fetch
;;
View
20 run.sh
@@ -21,6 +21,8 @@ function run_nacl()
sed -r 's|^set\( PLATFORM_PREFIX *"(.*)\" \)|\1|'`
nacl32Root=`egrep '^set\( PLATFORM_PREFIX' cmake/NaCl-i686.Toolchain.cmake | \
sed -r 's|^set\( PLATFORM_PREFIX *"(.*)\" \)|\1|'`
+ pnaclRoot=`egrep '^set\( PLATFORM_PREFIX' cmake/PNaCl.Toolchain.cmake | \
+ sed -r 's|^set\( PLATFORM_PREFIX *"(.*)\" \)|\1|'`
mkdir -p build/NaCl-test
@@ -32,14 +34,25 @@ function run_nacl()
[[ -e $i ]] && ln -sf ../../$i build/NaCl-test
done
+ if [[ $cmd == pnacl ]]; then
+ rm -f build/NaCl-test/openzone.*.nexe
+
+ for i in build/PNaCl/src/tools/openzone.*.nexe; do
+ ln -sf ../../$i build/NaCl-test
+ done
+ fi
+
# Strip binaries if `strip` option is given.
- if [[ $2 == strip ]]; then
+ if [[ $arg == strip ]]; then
if [[ -e build/NaCl-test/openzone.x86_64.nexe ]]; then
"$nacl64Root/bin/x86_64-nacl-strip" build/NaCl-test/openzone.x86_64.nexe
fi
if [[ -e build/NaCl-test/openzone.i686.nexe ]]; then
"$nacl64Root/bin/i686-nacl-strip" build/NaCl-test/openzone.i686.nexe
fi
+ if [[ -e build/NaCl-test/openzone.arm.nexe ]]; then
+ "$pnaclRoot/bin64/pnacl-strip" build/NaCl-test/openzone.arm.nexe
+ fi
fi
cd build/NaCl-test
@@ -53,6 +66,9 @@ function run_nacl()
kill $serverPID
}
+cmd=$1
+arg=$2
+
case $1 in
wine)
cd build
@@ -63,7 +79,7 @@ case $1 in
shift
exec wine bin/Windows-i686/openzone.exe -p . $@
;;
- nacl)
+ nacl|pnacl)
run_nacl
;;
*)
View
8 src/CMakeLists.txt
@@ -14,12 +14,12 @@ add_subdirectory( modules )
add_subdirectory( client )
add_subdirectory( tools )
-if( NOT ANDROID AND NOT NACL )
+if( NOT PLATFORM_EMBEDDED )
add_subdirectory( builder )
+endif()
- if( UNIX )
- add_subdirectory( txc_dxtn )
- endif()
+if( NOT PLATFORM_EMBEDDED AND NOT WIN32 AND NOT APPLE )
+ add_subdirectory( txc_dxtn )
endif()
add_subdirectory( tests )
View
30 src/client/GameStage.hh
@@ -46,21 +46,21 @@ class GameStage : public Stage
private:
- long64 sleepMicros;
- long64 loadingMicros;
- long64 uiMicros;
- long64 loaderMicros;
- long64 soundMicros;
- long64 renderMicros;
- long64 matrixMicros;
- long64 nirvanaMicros;
-
- Thread auxThread;
- Semaphore mainSemaphore;
- Semaphore auxSemaphore;
- volatile bool isAuxAlive;
-
- bool isLoaded;
+ long64 sleepMicros;
+ long64 loadingMicros;
+ long64 uiMicros;
+ long64 loaderMicros;
+ long64 soundMicros;
+ long64 renderMicros;
+ long64 matrixMicros;
+ long64 nirvanaMicros;
+
+ Thread auxThread;
+ Semaphore mainSemaphore;
+ Semaphore auxSemaphore;
+ volatile bool isAuxAlive;
+
+ bool isLoaded;
public:
View
3  src/client/Input.cc
@@ -407,9 +407,6 @@ void Input::reset()
{
window.warpMouse();
- SDL_PumpEvents();
- SDL_GetRelativeMouseState( nullptr, nullptr );
-
mouseX = 0.0f;
mouseY = 0.0f;
mouseZ = 0.0f;
View
6 src/client/Sound.cc
@@ -884,7 +884,11 @@ void Sound::destroy()
void Sound::initLibs()
{
-#ifndef __native_client__
+#ifdef __native_client__
+ static_cast<void>( libeSpeak );
+ static_cast<void>( libMad );
+ static_cast<void>( libFaad );
+#else
# ifdef _WIN32
const char* libeSpeakName = "libespeak.dll";
const char* libMadName = "libmad.dll";
View
2  src/client/Window.cc
@@ -88,6 +88,8 @@ void Window::warpMouse()
NaClPlatform::moveW = 0.0f;
#elif SDL_MAJOR_VERSION >= 2
SDL_WarpMouseInWindow( descriptor, width / 2, height / 2 );
+ SDL_PumpEvents();
+ SDL_GetRelativeMouseState( nullptr, nullptr );
#endif
}
View
1  src/client/openzone.hh
@@ -42,7 +42,6 @@ class MainInstance : public pp::Instance, public pp::MouseLock
oz::Thread mainThread;
pp::Fullscreen fullscreen;
- bool isContextBound;
static void mainThreadMain( void* );
View
29 src/ozCore/JSON.cc
@@ -168,13 +168,7 @@ void JSON::Parser::setAccessed( JSON* value )
value->wasAccessed = true;
switch( value->valueType ) {
-#ifdef OZ_GCC
- default: // HACK Make GCC happy.
-#endif
- case NIL:
- case BOOLEAN:
- case NUMBER:
- case STRING: {
+ default: {
break;
}
case ARRAY: {
@@ -720,13 +714,7 @@ JSON& JSON::operator = ( JSON&& v )
int JSON::length() const
{
switch( valueType ) {
-#ifdef OZ_GCC
- default: // HACK Make GCC happy.
-#endif
- case NIL:
- case BOOLEAN:
- case NUMBER:
- case STRING: {
+ default: {
return -1;
}
case ARRAY: {
@@ -741,13 +729,7 @@ int JSON::length() const
int JSON::isEmpty() const
{
switch( valueType ) {
-#ifdef OZ_GCC
- default: // HACK Make GCC happy.
-#endif
- case NIL:
- case BOOLEAN:
- case NUMBER:
- case STRING: {
+ default: {
return true;
}
case ARRAY: {
@@ -2442,10 +2424,7 @@ void JSON::clear( bool unusedWarnings )
String JSON::toString() const
{
switch( valueType ) {
-#ifdef OZ_GCC
- default: // HACK Make GCC happy.
-#endif
- case NIL: {
+ default: {
return "null";
}
case BOOLEAN: {
View
3  src/ozCore/PFile.cc
@@ -36,7 +36,8 @@
# include <ppapi/cpp/module.h>
extern "C"
-int PHYSFS_NACL_init(PP_Instance, PPB_GetInterface, PP_FileSystemType, PHYSFS_sint64);
+int PHYSFS_NACL_init( PP_Instance instance, PPB_GetInterface getInterface,
+ PP_FileSystemType filesystemType, PHYSFS_sint64 size );
#endif
#if PHYSFS_VER_MAJOR < 2
View
2  src/ozCore/System.cc
@@ -291,7 +291,7 @@ static void bellInitCallback( void*, int )
info->nFrameSamples = int( nFrameSamples );
info->nSamples = Math::lround( BELL_TIME * float( rate ) );
info->rate = rate;
- info->end = info->nSamples + 2*nFrameSamples;
+ info->end = info->nSamples + 2*int( nFrameSamples );
info->offset = 0;
void* audioPtr = malloc( sizeof( pp::Audio ) );
View
2  src/tools/CMakeLists.txt
@@ -14,7 +14,7 @@ elseif( NACL )
add_executable( openzone openzone.cc )
use_pch( openzone pch )
target_link_libraries( openzone client modules nirvana matrix common )
- set_target_properties( openzone PROPERTIES OUTPUT_NAME openzone.${CMAKE_SYSTEM_PROCESSOR}.nexe )
+ set_target_properties( openzone PROPERTIES OUTPUT_NAME openzone${PLATFORM_EXE_SUFFIX} )
else()
View
14 src/tools/openzone.cc
@@ -169,6 +169,13 @@ void MainInstance::HandleMessage( const pp::Var& message )
bool MainInstance::HandleInputEvent( const pp::InputEvent& event )
{
switch( event.GetType() ) {
+ case PP_INPUTEVENT_TYPE_MOUSEDOWN: {
+ if( !NaClPlatform::hasFocus ) {
+ LockMouse( pp::CompletionCallback( &onMouseLocked, this ) );
+ return true;
+ }
+ break;
+ }
case PP_INPUTEVENT_TYPE_MOUSEMOVE: {
pp::MouseInputEvent mouseEvent( event );
pp::Point move = mouseEvent.GetMovement();
@@ -185,13 +192,6 @@ bool MainInstance::HandleInputEvent( const pp::InputEvent& event )
NaClPlatform::moveW += move.y();
break;
}
- case PP_INPUTEVENT_TYPE_MOUSEDOWN: {
- if( !NaClPlatform::hasFocus ) {
- LockMouse( pp::CompletionCallback( &onMouseLocked, this ) );
- return true;
- }
- break;
- }
case PP_INPUTEVENT_TYPE_KEYDOWN: {
pp::KeyboardInputEvent keyEvent( event );
View
2  src/unittest/CMakeLists.txt
@@ -18,7 +18,7 @@ if( NACL )
add_custom_target( unittest_files DEPENDS unittest.nmf unittest.html )
add_dependencies( unittest unittest_files )
- set_target_properties( unittest PROPERTIES OUTPUT_NAME unittest.${CMAKE_SYSTEM_PROCESSOR}.nexe )
+ set_target_properties( unittest PROPERTIES OUTPUT_NAME unittest${PLATFORM_EXE_SUFFIX} )
endif()
add_test( unittest unittest )
Please sign in to comment.
Something went wrong with that request. Please try again.