summaryrefslogtreecommitdiffstats
path: root/native_client_sdk/src/examples
diff options
context:
space:
mode:
authornoelallen@chromium.org <noelallen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-03 22:08:36 +0000
committernoelallen@chromium.org <noelallen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-03 22:08:36 +0000
commit4709ba11d911cfded4c76a705906410c5d8402af (patch)
tree37978eec8319768aede6717f06ee4b423064dcea /native_client_sdk/src/examples
parentd43b7ac780fc3f40e28068120f2a96b11d58bf34 (diff)
downloadchromium_src-4709ba11d911cfded4c76a705906410c5d8402af.zip
chromium_src-4709ba11d911cfded4c76a705906410c5d8402af.tar.gz
chromium_src-4709ba11d911cfded4c76a705906410c5d8402af.tar.bz2
Add support for HOST builds on Windows
Adds support for host targets Adds support for Win32 complation, linking Adds support for libaries Adds ppapi_cpp, and ppapi_gles2 libraries src/ppapi/* will be scraped for headers, these will be placed in <SDK>/include individual libraries such as ppapi_cpp and ppapi_gles2 will be placed in <SDK>/src Output of those libraries will be placed in <SDK>lib (or lib32/lib64 for linux) So now the directories are: SDK examples inludes libs srcs tools toolchains R=binji@chromium.org Review URL: https://chromiumcodereview.appspot.com/10668011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@145390 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'native_client_sdk/src/examples')
-rw-r--r--native_client_sdk/src/examples/Makefile8
-rw-r--r--native_client_sdk/src/examples/dlopen/example.dsc10
-rw-r--r--native_client_sdk/src/examples/file_histogram/example.dsc3
-rw-r--r--native_client_sdk/src/examples/file_io/example.dsc3
-rw-r--r--native_client_sdk/src/examples/file_io/file_io.cc6
-rw-r--r--native_client_sdk/src/examples/fullscreen_tumbler/example.dsc4
-rw-r--r--native_client_sdk/src/examples/gamepad/example.dsc1
-rw-r--r--native_client_sdk/src/examples/geturl/example.dsc3
-rw-r--r--native_client_sdk/src/examples/hello_world/example.dsc3
-rw-r--r--native_client_sdk/src/examples/hello_world_gles/example.dsc4
-rw-r--r--native_client_sdk/src/examples/hello_world_gles/hello_world.cc2
-rw-r--r--native_client_sdk/src/examples/hello_world_interactive/example.dsc5
-rw-r--r--native_client_sdk/src/examples/input_events/example.dsc3
-rw-r--r--native_client_sdk/src/examples/load_progress/example.dsc3
-rw-r--r--native_client_sdk/src/examples/mouselock/example.dsc3
-rw-r--r--native_client_sdk/src/examples/multithreaded_input_events/example.dsc3
-rw-r--r--native_client_sdk/src/examples/pi_generator/example.dsc3
-rw-r--r--native_client_sdk/src/examples/pong/example.dsc1
-rw-r--r--native_client_sdk/src/examples/sine_synth/example.dsc5
-rw-r--r--native_client_sdk/src/examples/tumbler/example.dsc2
-rw-r--r--native_client_sdk/src/examples/websocket/example.dsc5
21 files changed, 52 insertions, 28 deletions
diff --git a/native_client_sdk/src/examples/Makefile b/native_client_sdk/src/examples/Makefile
index 78a80ed..ce0d7a2 100644
--- a/native_client_sdk/src/examples/Makefile
+++ b/native_client_sdk/src/examples/Makefile
@@ -23,6 +23,11 @@ TARGET_LIST+=$(1)_TARGET
.PHONY: $(1)_TARGET
$(1)_TARGET:
+$(MAKE) -C $(1)
+
+CLEAN_LIST+=$(1)_CLEAN
+.PHONY: $(1)_CLEAN
+$(1)_CLEAN:
+ +$(MAKE) -C $(1) clean
endef
@@ -33,6 +38,9 @@ $(foreach proj,$(PROJECTS),$(eval $(call TARGET,$(proj))))
all: $(TARGET_LIST)
echo "Done building targets."
+clean: $(CLEAN_LIST)
+ echo "Done cleaning targets."
+
RUN: all
echo "Staring up python webserver."
python httpd.py
diff --git a/native_client_sdk/src/examples/dlopen/example.dsc b/native_client_sdk/src/examples/dlopen/example.dsc
index 141180d..6a75179 100644
--- a/native_client_sdk/src/examples/dlopen/example.dsc
+++ b/native_client_sdk/src/examples/dlopen/example.dsc
@@ -2,17 +2,17 @@
'TOOLS': ['glibc'],
'TARGETS': [
{
- 'NAME' : 'dlopen',
- 'TYPE' : 'main',
- 'SOURCES' : ['dlopen.cc'],
- 'LDFLAGS' : ['-g','-ldl','-lppapi_cpp', '-lppapi']
+ 'NAME': 'dlopen',
+ 'TYPE': 'main',
+ 'SOURCES': ['dlopen.cc'],
+ 'LIBS': ['dl', 'ppapi_cpp']
},
{
'NAME' : 'libeightball',
'TYPE' : 'so',
'SOURCES' : ['eightball.cc', 'eightball.h'],
'CXXFLAGS': ['$(NACL_CXXFLAGS)', '-fPIC'],
- 'LDFLAGS' : ['-g','-ldl','-lppapi_cpp', '-lppapi', '-shared']
+ 'LIBS' : ['ppapi_cpp']
}
],
'DEST': 'examples',
diff --git a/native_client_sdk/src/examples/file_histogram/example.dsc b/native_client_sdk/src/examples/file_histogram/example.dsc
index 13d3f7b..d0db1c3 100644
--- a/native_client_sdk/src/examples/file_histogram/example.dsc
+++ b/native_client_sdk/src/examples/file_histogram/example.dsc
@@ -1,10 +1,11 @@
{
- 'TOOLS': ['newlib', 'glibc', 'pnacl'],
+ 'TOOLS': ['newlib', 'glibc', 'pnacl', 'win'],
'TARGETS': [
{
'NAME' : 'file_histogram',
'TYPE' : 'main',
'SOURCES' : ['file_histogram.cc'],
+ 'LIBS': ['ppapi_cpp']
}
],
'DEST': 'examples',
diff --git a/native_client_sdk/src/examples/file_io/example.dsc b/native_client_sdk/src/examples/file_io/example.dsc
index 588b71b..91aa02d 100644
--- a/native_client_sdk/src/examples/file_io/example.dsc
+++ b/native_client_sdk/src/examples/file_io/example.dsc
@@ -1,10 +1,11 @@
{
- 'TOOLS': ['newlib', 'glibc', 'pnacl'],
+ 'TOOLS': ['newlib', 'glibc', 'pnacl', 'win'],
'TARGETS': [
{
'NAME' : 'file_io',
'TYPE' : 'main',
'SOURCES' : ['file_io.cc'],
+ 'LIBS': ['ppapi_cpp']
}
],
'DEST': 'examples',
diff --git a/native_client_sdk/src/examples/file_io/file_io.cc b/native_client_sdk/src/examples/file_io/file_io.cc
index 8e23a0d..ecf5246 100644
--- a/native_client_sdk/src/examples/file_io/file_io.cc
+++ b/native_client_sdk/src/examples/file_io/file_io.cc
@@ -6,10 +6,10 @@
/// This example demonstrates the use of persistent file I/O
#define __STDC_LIMIT_MACROS
-#include <stdint.h>
#include <sstream>
#include <string>
+#include "ppapi/c/pp_stdint.h"
#include "ppapi/c/ppb_file_io.h"
#include "ppapi/cpp/file_io.h"
#include "ppapi/cpp/file_ref.h"
@@ -19,6 +19,10 @@
#include "ppapi/cpp/var.h"
#include "ppapi/utility/completion_callback_factory.h"
+#ifndef INT32_MAX
+#define INT32_MAX (0x7FFFFFFF)
+#endif
+
namespace {
/// Used for our simple protocol to communicate with Javascript
const char* const kLoadPrefix = "ld";
diff --git a/native_client_sdk/src/examples/fullscreen_tumbler/example.dsc b/native_client_sdk/src/examples/fullscreen_tumbler/example.dsc
index 3e843eb..3fc4831 100644
--- a/native_client_sdk/src/examples/fullscreen_tumbler/example.dsc
+++ b/native_client_sdk/src/examples/fullscreen_tumbler/example.dsc
@@ -1,5 +1,5 @@
{
- 'TOOLS': ['newlib', 'glibc', 'pnacl'],
+ 'TOOLS': ['newlib', 'pnacl'],
'TARGETS': [
{
'NAME' : 'fullscreen_tumbler',
@@ -21,7 +21,7 @@
'tumbler.h',
'tumbler_module.cc'
],
- 'LDFLAGS': ['$(NACL_LDFLAGS)', '-lppapi_gles2']
+ 'LIBS': ['ppapi_cpp', 'ppapi_gles2']
}
],
'DATA': [
diff --git a/native_client_sdk/src/examples/gamepad/example.dsc b/native_client_sdk/src/examples/gamepad/example.dsc
index d7d5541..296ee6e 100644
--- a/native_client_sdk/src/examples/gamepad/example.dsc
+++ b/native_client_sdk/src/examples/gamepad/example.dsc
@@ -5,6 +5,7 @@
'NAME' : 'gamepad',
'TYPE' : 'main',
'SOURCES' : ['gamepad.cc', 'gamepad_module.cc', 'gamepad.h'],
+ 'LIBS': ['ppapi_cpp']
}
],
'DEST': 'examples',
diff --git a/native_client_sdk/src/examples/geturl/example.dsc b/native_client_sdk/src/examples/geturl/example.dsc
index 91423eb..fb0a230 100644
--- a/native_client_sdk/src/examples/geturl/example.dsc
+++ b/native_client_sdk/src/examples/geturl/example.dsc
@@ -1,10 +1,11 @@
{
- 'TOOLS': ['newlib', 'glibc', 'pnacl'],
+ 'TOOLS': ['newlib', 'glibc', 'pnacl', 'win'],
'TARGETS': [
{
'NAME' : 'geturl',
'TYPE' : 'main',
'SOURCES' : ['geturl.cc', 'geturl_handler.cc', 'geturl_handler.h'],
+ 'LIBS': ['ppapi_cpp']
}
],
'DATA': ['geturl_success.html'],
diff --git a/native_client_sdk/src/examples/hello_world/example.dsc b/native_client_sdk/src/examples/hello_world/example.dsc
index 6d1cde6..eba1339 100644
--- a/native_client_sdk/src/examples/hello_world/example.dsc
+++ b/native_client_sdk/src/examples/hello_world/example.dsc
@@ -1,11 +1,10 @@
{
- 'TOOLS': ['newlib', 'glibc', 'pnacl'],
+ 'TOOLS': ['newlib', 'glibc', 'pnacl', 'win'],
'TARGETS': [
{
'NAME' : 'hello_world',
'TYPE' : 'main',
'SOURCES' : ['hello_world.c'],
- 'LDFLAGS' : ['-g', '-pthread', '-lppapi']
}
],
'DEST': 'examples',
diff --git a/native_client_sdk/src/examples/hello_world_gles/example.dsc b/native_client_sdk/src/examples/hello_world_gles/example.dsc
index 48d16fa..d107ff2 100644
--- a/native_client_sdk/src/examples/hello_world_gles/example.dsc
+++ b/native_client_sdk/src/examples/hello_world_gles/example.dsc
@@ -1,5 +1,5 @@
{
- 'TOOLS': ['newlib', 'glibc', 'pnacl'],
+ 'TOOLS': ['newlib', 'pnacl', 'win'],
'TARGETS': [
{
'NAME' : 'hello_world_gles',
@@ -10,7 +10,7 @@
'-I../../src',
'-I../../src/ppapi/lib/gl'
],
- 'LDFLAGS': ['-g', '-pthread', '-lppapi', '-lppapi_gles2']
+ 'LIBS': ['ppapi_gles2']
}
],
'DATA': [
diff --git a/native_client_sdk/src/examples/hello_world_gles/hello_world.cc b/native_client_sdk/src/examples/hello_world_gles/hello_world.cc
index c868826..cfa4a24 100644
--- a/native_client_sdk/src/examples/hello_world_gles/hello_world.cc
+++ b/native_client_sdk/src/examples/hello_world_gles/hello_world.cc
@@ -20,8 +20,8 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <stdint.h>
+#include "ppapi/c/pp_stdint.h"
#include "ppapi/c/pp_completion_callback.h"
#include "ppapi/c/pp_errors.h"
#include "ppapi/c/pp_graphics_3d.h"
diff --git a/native_client_sdk/src/examples/hello_world_interactive/example.dsc b/native_client_sdk/src/examples/hello_world_interactive/example.dsc
index c59e619..690f344 100644
--- a/native_client_sdk/src/examples/hello_world_interactive/example.dsc
+++ b/native_client_sdk/src/examples/hello_world_interactive/example.dsc
@@ -1,5 +1,5 @@
{
- 'TOOLS': ['newlib', 'glibc', 'pnacl'],
+ 'TOOLS': ['newlib', 'glibc', 'pnacl', 'win'],
'TARGETS': [
{
'NAME' : 'hello_world_interactive',
@@ -8,7 +8,8 @@
'hello_world.cc',
'helper_functions.cc',
'helper_functions.h'
- ]
+ ],
+ 'LIBS': ['ppapi_cpp']
}
],
'DEST': 'examples',
diff --git a/native_client_sdk/src/examples/input_events/example.dsc b/native_client_sdk/src/examples/input_events/example.dsc
index b7dff21..3d52ba3 100644
--- a/native_client_sdk/src/examples/input_events/example.dsc
+++ b/native_client_sdk/src/examples/input_events/example.dsc
@@ -1,10 +1,11 @@
{
- 'TOOLS': ['newlib', 'glibc', 'pnacl'],
+ 'TOOLS': ['newlib', 'glibc', 'pnacl', 'win'],
'TARGETS': [
{
'NAME' : 'input_events',
'TYPE' : 'main',
'SOURCES' : ['input_events.cc'],
+ 'LIBS': ['ppapi_cpp']
}
],
'DEST': 'examples',
diff --git a/native_client_sdk/src/examples/load_progress/example.dsc b/native_client_sdk/src/examples/load_progress/example.dsc
index 1d66c0a..8474d98 100644
--- a/native_client_sdk/src/examples/load_progress/example.dsc
+++ b/native_client_sdk/src/examples/load_progress/example.dsc
@@ -1,10 +1,11 @@
{
- 'TOOLS': ['newlib', 'glibc', 'pnacl'],
+ 'TOOLS': ['newlib', 'glibc', 'pnacl', 'win'],
'TARGETS': [
{
'NAME' : 'load_progress',
'TYPE' : 'main',
'SOURCES' : ['load_progress.cc'],
+ 'LIBS': ['ppapi_cpp']
}
],
'DATA': ['check_browser.js'],
diff --git a/native_client_sdk/src/examples/mouselock/example.dsc b/native_client_sdk/src/examples/mouselock/example.dsc
index 056cf4a..d9c42e9 100644
--- a/native_client_sdk/src/examples/mouselock/example.dsc
+++ b/native_client_sdk/src/examples/mouselock/example.dsc
@@ -1,10 +1,11 @@
{
- 'TOOLS': ['newlib', 'glibc'],
+ 'TOOLS': ['newlib', 'glibc', 'win'],
'TARGETS': [
{
'NAME' : 'mouselock',
'TYPE' : 'main',
'SOURCES' : ['mouselock.cc', 'mouselock.h'],
+ 'LIBS': ['ppapi_cpp']
}
],
'DATA': ['check_browser.js'],
diff --git a/native_client_sdk/src/examples/multithreaded_input_events/example.dsc b/native_client_sdk/src/examples/multithreaded_input_events/example.dsc
index 48f3c3b..1c8685fa 100644
--- a/native_client_sdk/src/examples/multithreaded_input_events/example.dsc
+++ b/native_client_sdk/src/examples/multithreaded_input_events/example.dsc
@@ -10,7 +10,8 @@
'mt_input_events.cc',
'shared_queue.h',
'thread_safe_ref_count.h'
- ]
+ ],
+ 'LIBS': ['ppapi_cpp']
}
],
'DEST': 'examples',
diff --git a/native_client_sdk/src/examples/pi_generator/example.dsc b/native_client_sdk/src/examples/pi_generator/example.dsc
index 306fca1..3297a63 100644
--- a/native_client_sdk/src/examples/pi_generator/example.dsc
+++ b/native_client_sdk/src/examples/pi_generator/example.dsc
@@ -8,7 +8,8 @@
'pi_generator.cc',
'pi_generator.h',
'pi_generator_module.cc'
- ]
+ ],
+ 'LIBS': ['ppapi_cpp']
}
],
'DEST': 'examples',
diff --git a/native_client_sdk/src/examples/pong/example.dsc b/native_client_sdk/src/examples/pong/example.dsc
index e698737..26a5232 100644
--- a/native_client_sdk/src/examples/pong/example.dsc
+++ b/native_client_sdk/src/examples/pong/example.dsc
@@ -11,6 +11,7 @@
'view.cc',
'view.h',
],
+ 'LIBS': ['ppapi_cpp']
}
],
'DEST': 'examples',
diff --git a/native_client_sdk/src/examples/sine_synth/example.dsc b/native_client_sdk/src/examples/sine_synth/example.dsc
index 6bd2245..4ee3881 100644
--- a/native_client_sdk/src/examples/sine_synth/example.dsc
+++ b/native_client_sdk/src/examples/sine_synth/example.dsc
@@ -1,10 +1,11 @@
{
- 'TOOLS': ['newlib', 'glibc', 'pnacl'],
+ 'TOOLS': ['newlib', 'glibc', 'pnacl', 'win'],
'TARGETS': [
{
'NAME' : 'sine_synth',
'TYPE' : 'main',
- 'SOURCES' : ['sine_synth.cc']
+ 'SOURCES' : ['sine_synth.cc'],
+ 'LIBS': ['ppapi_cpp']
}
],
'DEST': 'examples',
diff --git a/native_client_sdk/src/examples/tumbler/example.dsc b/native_client_sdk/src/examples/tumbler/example.dsc
index 19d184a..90b2b7b 100644
--- a/native_client_sdk/src/examples/tumbler/example.dsc
+++ b/native_client_sdk/src/examples/tumbler/example.dsc
@@ -21,7 +21,7 @@
'tumbler.h',
'tumbler_module.cc'
],
- 'LDFLAGS': ['$(NACL_LDFLAGS)', '-lppapi_gles2']
+ 'LIBS': ['ppapi_cpp', 'ppapi_gles2']
}
],
'DATA': [
diff --git a/native_client_sdk/src/examples/websocket/example.dsc b/native_client_sdk/src/examples/websocket/example.dsc
index 7943b99..72fbf7c 100644
--- a/native_client_sdk/src/examples/websocket/example.dsc
+++ b/native_client_sdk/src/examples/websocket/example.dsc
@@ -1,10 +1,11 @@
{
- 'TOOLS': ['newlib', 'glibc', 'pnacl'],
+ 'TOOLS': ['newlib', 'glibc', 'pnacl', 'win'],
'TARGETS': [
{
'NAME' : 'websocket',
'TYPE' : 'main',
- 'SOURCES' : ['websocket.cc']
+ 'SOURCES' : ['websocket.cc'],
+ 'LIBS': ['ppapi_cpp']
}
],
'DEST': 'examples',