From a96e1c4acce2799c5739f674ff6d90d49fd25633 Mon Sep 17 00:00:00 2001
From: "noelallen@chromium.org"
Date: Sat, 11 Feb 2012 00:32:09 +0000
Subject: Remove stale files unused by NaCl SDK builder
1- Old scons artifacts
2- Move index_staging -> index
3- Remove stale hello_world_c (now just hello_world)
This CL is part of the NaCl SDK and does not affect Chrome.
BUG= 109207
TBR= bradnelson@xchromium.org
Review URL: http://codereview.chromium.org/9378026
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@121584 0039d316-1c4b-4281-b951-d872f2087c98
---
native_client_sdk/src/examples/build.scons | 82 ------
.../test_helper_functions.cc | 52 ----
.../examples/hello_world_newlib/hello_world_c.c | 289 ---------------------
.../examples/hello_world_newlib/hello_world_c.html | 126 ---------
.../examples/hello_world_newlib/hello_world_c.nmf | 6 -
native_client_sdk/src/examples/index_staging.html | 167 ------------
native_client_sdk/src/scons | 38 ---
native_client_sdk/src/scons.bat | 28 --
8 files changed, 788 deletions(-)
delete mode 100644 native_client_sdk/src/examples/build.scons
delete mode 100644 native_client_sdk/src/examples/hello_world_interactive/test_helper_functions.cc
delete mode 100644 native_client_sdk/src/examples/hello_world_newlib/hello_world_c.c
delete mode 100644 native_client_sdk/src/examples/hello_world_newlib/hello_world_c.html
delete mode 100644 native_client_sdk/src/examples/hello_world_newlib/hello_world_c.nmf
delete mode 100644 native_client_sdk/src/examples/index_staging.html
delete mode 100755 native_client_sdk/src/scons
delete mode 100755 native_client_sdk/src/scons.bat
(limited to 'native_client_sdk')
diff --git a/native_client_sdk/src/examples/build.scons b/native_client_sdk/src/examples/build.scons
deleted file mode 100644
index 76ec08a..0000000
--- a/native_client_sdk/src/examples/build.scons
+++ /dev/null
@@ -1,82 +0,0 @@
-#! -*- python -*-
-#
-# Copyright (c) 2011 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import os
-import shutil
-import sys
-
-"""
-Build file for the NaCl SDK Examples
-
-This file runs all the scons files in the various example sub-directories.
-Do not invoke this script directly, but instead use the scons or scons.bat
-wrapper function. E.g.
-
-Linux or Mac:
- ./scons [Options...]
-
-Windows:
- scons.bat [Options...]
-"""
-
-#------------------------------------------------------------------------------
-HELP_STRING = """
-===============================================================================
-Help for NaCl SDK Examples
-===============================================================================
-
-* cleaning: ./scons -c
-* build a target: ./scons
-* clean a target: ./scons -c
-
-Supported targets:
- * fullscreen_tumbler Build the fullscreen-tumbler example.
- * geturl Build the geturl example.
- * hello_world Build the hello_world example.
- * hello_world_c Build the hello_world_c example.
- * input_events Build the input_events example.
- * load_progress Build the load_progress example.
- * mouselock Build the mouselock example.
- * multithreaded_input_events Build the multithreaded input_events example.
- * pi_generator Build the pi_generator example.
- * pong Build the pong example.
- * sine_synth Build the sine_synth example.
- * tumbler Build the tumbler example.
-"""
-
-example_directories = [
- 'fullscreen_tumbler',
- 'geturl',
- 'hello_world',
- 'hello_world_c',
- 'input_events',
- 'load_progress',
- 'mouselock',
- 'multithreaded_input_events',
- 'pi_generator',
- 'pong',
- 'sine_synth',
- 'tumbler',
- ]
-
-Help(HELP_STRING)
-
-staging_dir = os.path.abspath(os.getenv(
- 'NACL_INSTALL_ROOT', os.path.join(os.getenv('NACL_SDK_ROOT', '.'),
- 'staging')))
-general_files = Install(staging_dir, ['httpd.py'])
-general_files.extend(InstallAs(os.path.join(staging_dir, 'index.html'),
- 'index_staging.html'))
-
-if sys.platform in ['win32', 'cygwin']:
- general_files.extend(Install(staging_dir, 'httpd.cmd'))
-
-SConscript([os.path.join(dir, 'build.scons') for dir in example_directories])
-
-Default(['install'] + general_files + example_directories)
-if GetOption('clean'):
- print "Removing the staging directory at %s" % staging_dir
- shutil.rmtree(staging_dir, ignore_errors=True)
diff --git a/native_client_sdk/src/examples/hello_world_interactive/test_helper_functions.cc b/native_client_sdk/src/examples/hello_world_interactive/test_helper_functions.cc
deleted file mode 100644
index 30d3f27..0000000
--- a/native_client_sdk/src/examples/hello_world_interactive/test_helper_functions.cc
+++ /dev/null
@@ -1,52 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// This is an example of a simple unit test to verify that the logic helper
-// functions works as expected. Note that this looks like a 'normal' C++
-// program, with a main function. It is compiled and linked using the NaCl
-// toolchain, so in order to run it, you must use 'sel_ldr_x86_32' or
-// 'sel_ldr_x86_64' from the toolchain's bin directory.
-//
-// For example (assuming the toolchain bin directory is in your path):
-// sel_ldr_x86_32 test_helper_functions_x86_32_dbg.nexe
-//
-// You can also use the 'test32', or 'test64' SCons target to run these tests.
-// For example, this will run the test in 32-bit mode on Mac or Linux:
-// ../scons test32
-// On Windows 64:
-// ..\scons test64
-
-#include "examples/hello_world/helper_functions.h"
-
-#include
-#include
-#include
-
-// A very simple macro to print 'passed' if boolean_expression is true and
-// 'FAILED' otherwise.
-// This is meant to approximate the functionality you would get from a real test
-// framework. You should feel free to build and use the test framework of your
-// choice.
-#define EXPECT_EQUAL(left, right)\
-printf("Check: \"" #left "\" == \"" #right "\" %s\n", \
- ((left) == (right)) ? "passed" : "FAILED")
-
-using hello_world::FortyTwo;
-using hello_world::ReverseText;
-
-int main() {
- EXPECT_EQUAL(FortyTwo(), 42);
-
- std::string empty_string;
- EXPECT_EQUAL(ReverseText(empty_string), empty_string);
-
- std::string palindrome("able was i ere i saw elba");
- EXPECT_EQUAL(ReverseText(palindrome), palindrome);
-
- std::string alphabet("abcdefghijklmnopqrstuvwxyz");
- std::string alphabet_backwards("zyxwvutsrqponmlkjihgfedcba");
- EXPECT_EQUAL(ReverseText(alphabet), alphabet_backwards);
- return 0;
-}
-
diff --git a/native_client_sdk/src/examples/hello_world_newlib/hello_world_c.c b/native_client_sdk/src/examples/hello_world_newlib/hello_world_c.c
deleted file mode 100644
index 5169514..0000000
--- a/native_client_sdk/src/examples/hello_world_newlib/hello_world_c.c
+++ /dev/null
@@ -1,289 +0,0 @@
-/* Copyright (c) 2012 The Chromium Authors. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-/** @file hello_world.c
- * This example demonstrates loading, running and scripting a very simple
- * NaCl module.
- */
-#include
-#include
-#include
-
-#include "ppapi/c/pp_errors.h"
-#include "ppapi/c/pp_module.h"
-#include "ppapi/c/pp_var.h"
-#include "ppapi/c/ppb.h"
-#include "ppapi/c/ppb_instance.h"
-#include "ppapi/c/ppb_messaging.h"
-#include "ppapi/c/ppb_var.h"
-#include "ppapi/c/ppp.h"
-#include "ppapi/c/ppp_instance.h"
-#include "ppapi/c/ppp_messaging.h"
-
-struct MessageInfo {
- PP_Instance instance;
- struct PP_Var message;
-};
-
-static const char* const kReverseTextMethodId = "reverseText";
-static const char* const kFortyTwoMethodId = "fortyTwo";
-static const char kMessageArgumentSeparator = ':';
-static const char kNullTerminator = '\0';
-
-static PPB_Messaging* ppb_messaging_interface = NULL;
-static PPB_Var* ppb_var_interface = NULL;
-static PP_Module module_id = 0;
-
-
-/**
- * Returns a mutable C string contained in the @a var or NULL if @a var is not
- * string. This makes a copy of the string in the @ var and adds a NULL
- * terminator. Note that VarToUtf8() does not guarantee the NULL terminator on
- * the returned string. See the comments for VatToUtf8() in ppapi/c/ppb_var.h
- * for more info. The caller is responsible for freeing the returned memory.
- * @param[in] var PP_Var containing string.
- * @return a C string representation of @a var.
- * @note The caller is responsible for freeing the returned string.
- */
-static char* VarToCStr(struct PP_Var var) {
- uint32_t len = 0;
- if (ppb_var_interface != NULL) {
- const char* var_c_str = ppb_var_interface->VarToUtf8(var, &len);
- if (len > 0) {
- char* c_str = (char*)malloc(len + 1);
- memcpy(c_str, var_c_str, len);
- c_str[len] = kNullTerminator;
- return c_str;
- }
- }
- return NULL;
-}
-
-/**
- * Creates new string PP_Var from C string. The resulting object will be a
- * refcounted string object. It will be AddRef()ed for the caller. When the
- * caller is done with it, it should be Release()d.
- * @param[in] str C string to be converted to PP_Var
- * @return PP_Var containing string.
- */
-static struct PP_Var CStrToVar(const char* str) {
- if (ppb_var_interface != NULL) {
- return ppb_var_interface->VarFromUtf8(str, strlen(str));
- }
- return PP_MakeUndefined();
-}
-
-/**
- * Reverse C string in-place.
- * @param[in,out] str C string to be reversed
- */
-static void ReverseStr(char* str) {
- char* right = str + strlen(str) - 1;
- char* left = str;
- while (left < right) {
- char tmp = *left;
- *left++ = *right;
- *right-- = tmp;
- }
-}
-
-/**
- * A simple function that always returns 42.
- * @return always returns the integer 42
- */
-static struct PP_Var FortyTwo() {
- return PP_MakeInt32(42);
-}
-
-/**
- * Called when the NaCl module is instantiated on the web page. The identifier
- * of the new instance will be passed in as the first argument (this value is
- * generated by the browser and is an opaque handle). This is called for each
- * instantiation of the NaCl module, which is each time the
-
-
If the module is working correctly, a click on the "Call fortyTwo()" button
- should open a popup dialog containing 42 as its value.
-
-
Clicking on the "Call reverseText()" button
- should open a popup dialog containing the textbox contents and its reverse
- as its value.
This page lists all of the examples available in the most recent Native
- Client SDK bundle. Each example is designed to teach a few specific Native
- Client programming concepts. You will need to setup the build environment
- including a path to 'make' which can be found in the 'tools' directory for
- Windows, and the variable NACL_SDK_ROOT which points to one of the pepper
- bundles found under the SDK install location. Calling make from the examples
- directory will build all the projects, while calling make from and individual
- example directory will build only that example.
-
-
-
Using the Tools
-
The following "hello_world" examples, show the basic outline of a Native
-Client application. The make files in each of the examples bellow show a
-simple way to build a NaCl application using
-GNU Make.
-See the link for further information.
-
The Hello World In C example demonstrates the basic structure of all
- Native Client applications. This example loads a Native Client module. The
- page tracks the status of the module as it load. On a successful load, the
- module will post a message containing the string "Hello World" back to
- JavaScript which will display it as an alert.
-
Teaching focus: Basic HTML, JavaScript, and module architecture.
The Hello World (GLIBC) example is identical to the one above, with the
- exception that it used the GLIBC toolchain which uses Shared Objects. The use
- of Shared Objects means a more complicated manifest file (NMF) which is needed
- to allow the application to find the libraries. The NMF is automatically
- generated as part of the build process, by scanning the application for
- dependencies.
-
The Interactive Hello World C++ example demonstrates the basic structure
- of all Native Client applications. This example loads a Native Client module
- which uses two way interaction with JavaScript whenever a button is clicked.
- The NaCl module will respond with the number 42 or the reversed version of the
- string in the text box when the appropriate button is clicked.
-
Teaching focus: Basic HTML, JavaScript, C++ PPAPI, and module
- architecture; Messaging API.
-
-
-
Common APIs
-
The following set of examples illustrate various Pepper APIs including
-audio, 2D, 3D, input and urls.
The Sine Wave Synthesizer example demonstrates playing sound (a sine
- wave). Enter the desired frequency and hit play to start, stop to end. The
- frequency box will display "Loading, please wait." while the module loads.
-
The Input Events example demonstrates how to handle events triggered by the user. This example allows a user
- to interact with a square representing a module instance. Events are displayed on the screen as the user clicks, scrolls, types, inside or outside
- of the square.
-
-
Teaching focus: Keyboard and mouse input, view change, and focus events.
The Pi Generator example demonstrates creating a helper thread that estimate pi using the Monte Carlo
- method while randomly putting 1,000,000,000 points inside a 2D square that shares two
- sides with a quarter circle.
-
-
The Tumbler example demonstrates how to create a 3D cube that you can rotate with your mouse while pressing the
- left mouse button. This example creates a 3D context and draws to it using
- OpenGL ES. The JavaScript implements a virtual trackball interface to
- map mouse movements into 3D rotations using simple 3D vector math and
- quaternions.
-
-
The Get URL example demonstrates fetching an URL and then displaying its contents.
-
-
Teaching focus: URL loading.
-
-
-
Common Concepts
-
The following set of examples illustrate various common concepts such as
-showing load progress, using Shared Objects (dynamic libraries),
-mulithreading...
The Load Progress example demonstrates how to listen for and handle
- events that occur while a NaCl module loads. This example listens for
- different load event types and dispatches different events to their
- respective handler. This example also checks for valid browser version and
- shows how to calculate and display loading progress.
-
The Load Progress example demonstrates how to listen for and handle events that occur while a
- NaCl module loads. This example listens for different load event types and dispatches different events to their respective handler. This example also checks for valid browser
- version and shows how to calculate and display loading progress.
-
-
The Pong example demonstrates how to create a basic 2D video game and how to store application
- information in a local persistent file. This game uses up and
- down arrow keyboard input events to move the paddle.
-
-
The Multithreaded Input Events example combines HTML, Javascript,
- and C++ (the C++ is compiled to create a .nexe file).
- The C++ shows how to handle input events in a multi-threaded application.
- The main thread converts input events to non-pepper events and puts them on
- a queue. The worker thread pulls them off of the queue, converts them to a
- string, and then uses CallOnMainThread so that PostMessage can be send the
- result of the worker thread to the browser.
-
This is a modified version of the Tumbler example above that supports
- full-screen display. It is in every way identical to Tumbler in
- functionality, except that it adds the ability to switch to/from
- full-screen display by pressing the Enter key.
-
The Mouselock example demonstrates how to use the MouseLock API to hide
- the mouse cursor. Mouse lock is only available in full-screen mode. You can
- lock and unlock the mouse while in full-screen mode by pressing the Enter key.
-
-
Teaching focus: Mouse lock, Full-screen
-
-
-
-
diff --git a/native_client_sdk/src/scons b/native_client_sdk/src/scons
deleted file mode 100755
index 63c19d3..0000000
--- a/native_client_sdk/src/scons
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/bin/bash
-#
-# Copyright (c) 2011 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-
-readonly SCRIPT_DIR="$(dirname "$0")"
-readonly SCRIPT_DIR_ABS="$(cd "${SCRIPT_DIR}" ; pwd -P)"
-readonly SRC_DIR="$(dirname $(dirname ${SCRIPT_DIR_ABS}))"
-
-# Use the batch file as an entry point if on cygwin.
-if [ "x${OSTYPE}" = "xcygwin" ]; then
- # Use extended globbing (cygwin should always have it).
- shopt -s extglob
- # Filter out cygwin python (everything under /usr or /bin, or *cygwin*).
- export PATH=${PATH/#\/bin*([^:])/}
- export PATH=${PATH//:\/bin*([^:])/}
- export PATH=${PATH/#\/usr*([^:])/}
- export PATH=${PATH//:\/usr*([^:])/}
- export PATH=${PATH/#*([^:])cygwin*([^:])/}
- export PATH=${PATH//:*([^:])cygwin*([^:])/}
- "${SCRIPT_DIR_ABS}/scons.bat" $*
- exit
-fi
-
-readonly BASE_SCRIPT="${SRC_DIR}/third_party/scons-2.0.1/script/scons"
-
-export NACL_SDK_ROOT="${SCRIPT_DIR_ABS}/../../native_client"
-
-export SCONS_LIB_DIR="${SRC_DIR}/third_party/scons-2.0.1/engine"
-export PYTHONPATH="${SCONS_LIB_DIR}:${SRC_DIR}/native_client/build:${SCRIPT_DIR_ABS}"
-# We have to do this because scons overrides PYTHONPATH and does not preserve
-# what is provided by the OS. The custom variable name won't be overwritten.
-export PYMOX="${SRC_DIR}/third_party/pymox/src"
-
-"${BASE_SCRIPT}" --file=main.scons $*
-
diff --git a/native_client_sdk/src/scons.bat b/native_client_sdk/src/scons.bat
deleted file mode 100755
index e836ad1..0000000
--- a/native_client_sdk/src/scons.bat
+++ /dev/null
@@ -1,28 +0,0 @@
-@echo off
-
-:: Copyright (c) 2011 The Chromium Authors. All rights reserved.
-:: Use of this source code is governed by a BSD-style license that can be
-:: found in the LICENSE file.
-
-setlocal
-
-set NACL_SDK_ROOT=%~dp0..\..\native_client
-
-:: Preserve a copy of the PATH (in case we need it later, mainly for cygwin).
-set PRESCONS_PATH=%PATH%
-
-:: Set the PYTHONPATH and SCONS_LIB_DIR so we can import SCons modules
-set SCONS_LIB_DIR=%~dp0..\..\third_party\scons-2.0.1\engine
-set PYTHONPATH=%~dp0..\..\third_party\scons-2.0.1\engine;%~dp0..\..\native_client\build;%~dp0
-
-:: We have to do this because scons overrides PYTHONPATH and does not preserve
-:: what is provided by the OS. The custom variable name won't be overwritten.
-set PYMOX=%~dp0..\..\third_party\pymox\src
-
-:: Stop incessant CYGWIN complains about "MS-DOS style path"
-set CYGWIN=nodosfilewarning %CYGWIN%
-
-:: Run the included copy of scons.
-python -O -OO "%~dp0..\..\third_party\scons-2.0.1\script\scons" --file=main.scons %*
-
-:end
--
cgit v1.1