summaryrefslogtreecommitdiffstats
path: root/native_client_sdk/src/project_templates
diff options
context:
space:
mode:
authoraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-29 01:39:23 +0000
committeraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-29 01:39:23 +0000
commit5f819e2f365b7031b7243bbddc0038e0cb0d2421 (patch)
tree0cf68b5bfa1b954b859c9621cd7275d67eb8034e /native_client_sdk/src/project_templates
parent564c99137aeb3b64c8be6847b9f79b78b484c7bb (diff)
downloadchromium_src-5f819e2f365b7031b7243bbddc0038e0cb0d2421.zip
chromium_src-5f819e2f365b7031b7243bbddc0038e0cb0d2421.tar.gz
chromium_src-5f819e2f365b7031b7243bbddc0038e0cb0d2421.tar.bz2
Revert "Revert "Restructuring SDK so that it builds inside a normal chrome checkout.""
This reverts commit 5034eda4c488c4f47361bd3b70f52a375837326f. BUG=105658 TEST= Review URL: http://codereview.chromium.org/8687022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111827 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'native_client_sdk/src/project_templates')
-rwxr-xr-xnative_client_sdk/src/project_templates/scons33
-rwxr-xr-xnative_client_sdk/src/project_templates/scons.bat35
2 files changed, 51 insertions, 17 deletions
diff --git a/native_client_sdk/src/project_templates/scons b/native_client_sdk/src/project_templates/scons
index 2b7e0d3..d4daf81 100755
--- a/native_client_sdk/src/project_templates/scons
+++ b/native_client_sdk/src/project_templates/scons
@@ -4,29 +4,44 @@
# 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 $(dirname ${SCRIPT_DIR_ABS})))"
+
+# NACL_SDK_ROOT must be set.
+if [ x"${NACL_SDK_ROOT}"x == "xx" ] ; then
+ echo "Error: NACL_SDK_ROOT is not set."
+ exit 1;
+fi
-export NACL_SDK_ROOT=<NACL_SDK_ROOT>
# NACL_TARGET_PLATFORM is really the name of a folder with the base dir -
# usually NACL_SDK_ROOT - within which the toolchain for the target platform
# are found.
# Replace the platform with the name of your target platform. For example, to
# build applications that target the pepper_17 API, set
# NACL_TARGET_PLATFORM="pepper_17"
-export NACL_TARGET_PLATFORM="<NACL_PLATFORM>"
+if [ x"${NACL_TARGET_PLATFORM}"x == "xx" ] ; then
+ export NACL_TARGET_PLATFORM="pepper_17"
+fi
readonly NACL_PLATFORM_DIR="${NACL_SDK_ROOT}/${NACL_TARGET_PLATFORM}"
-readonly BASE_SCRIPT="${NACL_PLATFORM_DIR}/third_party/scons-2.0.1/script/scons"
-export SCONS_LIB_DIR="${NACL_PLATFORM_DIR}/third_party/scons-2.0.1/engine"
-export PYTHONPATH="${NACL_PLATFORM_DIR}/third_party/scons-2.0.1/engine"
+SCONS_DIR="${NACL_PLATFORM_DIR}/third_party/scons-2.0.1"
+
+if [ ! -f ${SCONS_DIR}/script/scons ]; then
+ SCONS_DIR="${SRC_DIR}/third_party/scons-2.0.1"
+fi
+
+BASE_SCRIPT="${SCONS_DIR}/script/scons"
+
+export SCONS_LIB_DIR="${SCONS_DIR}/engine"
+export PYTHONPATH="${SCONS_LIB_DIR}"
+export PYTHONPATH="${PYTHONPATH}:${NACL_PLATFORM_DIR}/build_tools"
+
# 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="${NACL_PLATFORM_DIR}/third_party/pymox"
+export PYMOX="${NACL_PLATFORM_DIR}/third_party/pymox/src"
"${BASE_SCRIPT}" --file=build.scons \
- --site-dir="${NACL_PLATFORM_DIR}/build_tools/nacl_sdk_scons" \
+ --site-dir="${SCRIPT_DIR_ABS}/../build_tools/nacl_sdk_scons" \
$*
-
diff --git a/native_client_sdk/src/project_templates/scons.bat b/native_client_sdk/src/project_templates/scons.bat
index f487e28..d3c6c06 100755
--- a/native_client_sdk/src/project_templates/scons.bat
+++ b/native_client_sdk/src/project_templates/scons.bat
@@ -6,26 +6,45 @@
setlocal
-set NACL_SDK_ROOT=<NACL_SDK_ROOT>
+:: NACL_SDK_ROOT must be set.
+if not defined NACL_SDK_ROOT (
+ echo Error: NACL_SDK_ROOT is not set.
+ echo Please set NACL_SDK_ROOT to the full path of the Native Client SDK.
+ echo For example:
+ echo set NACL_SDK_ROOT=D:\nacl_sdk
+ goto end
+)
+
:: NACL_TARGET_PLATFORM is really the name of a folder with the base dir -
:: usually NACL_SDK_ROOT - within which the toolchain for the target platform
:: are found.
:: Replace the platform with the name of your target platform. For example, to
:: build applications that target the pepper_17 API, set
:: NACL_TARGET_PLATFORM=pepper_17
-set NACL_TARGET_PLATFORM=<NACL_PLATFORM>
+if not defined NACL_TARGET_PLATFORM (
+ set NACL_TARGET_PLATFORM=pepper_17
+)
set NACL_PLATFORM_DIR=%NACL_SDK_ROOT%\%NACL_TARGET_PLATFORM%
-:: Set the PYTHONPATH and SCONS_LIB_DIR so we can import SCons modules
-set SCONS_LIB_DIR=%NACL_PLATFORM_DIR%\third_party\scons-2.0.1\engine
-set PYTHONPATH=%NACL_PLATFORM_DIR%\third_party\scons-2.0.1\engine
+set SCONS_DIR=%NACL_PLATFORM_DIR%\third_party\scons-2.0.1
+if exist %SCONS_DIR% goto gotscons
+set SCONS_DIR=%~dp0..\..\..\third_party\scons-2.0.1
+:gotscons
+
+set SCONS_LIB_DIR=%SCONS_DIR%\engine
+set PYTHONPATH=%SCONS_LIB_DIR%;%NACL_PLATFORM_DIR%\build_tools
:: 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=%NACL_PLATFORM_DIR%\third_party\pymox
+set PYMOX=%NACL_PLATFORM_DIR%\third_party\pymox\src
+
+set BASE_SCRIPT=%SCONS_DIR%\script\scons
:: Run the included copy of scons.
-python -O -OO "%NACL_PLATFORM_DIR%\third_party\scons-2.0.1\script\scons" ^
+python -O -OO %BASE_SCRIPT% ^
+--warn no-visual-c-missing ^
--file=build.scons ^
---site-dir="%NACL_PLATFORM_DIR%\build_tools\nacl_sdk_scons" %*
+--site-dir="%~dp0..\build_tools\nacl_sdk_scons" %*
+
+:end