OLD | NEW |
1 #!/bin/sh | 1 #!/bin/sh |
| 2 # |
| 3 # Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. |
2 | 6 |
3 # The first expression catches when we're actually in the /src directory. | 7 # A script to invoke scons in gyp generated projects. |
4 # The second expressions strips everything after the last /src occurrence. | 8 |
5 SRC_DIR=`pwd | sed -e '\;/src$;q' -e 's;\(.*/src\)/.*;\1;'` | 9 # Find the 'src' directory by looking for the site_scons directory. |
| 10 # This method allows trees that don't use the name src to use this script. |
| 11 # Explicitly skip site_scons directories that are from the 'software |
| 12 # construction toolkit', since these are not gyp compatible. |
| 13 SRC_DIR=`pwd` |
| 14 while `test ! -d "${SRC_DIR}/site_scons" -o \ |
| 15 -e "${SRC_DIR}/site_scons/site_tools/component_setup.py"`; do |
| 16 PARENT_DIR="$(dirname ${SRC_DIR})" |
| 17 if `test "${SRC_DIR}" == "${PARENT_DIR}"`; then |
| 18 echo "ERROR: hammer must be run in a directory with site_scons under" >&2 |
| 19 echo " the root of the project tree." >&2 |
| 20 exit 1 |
| 21 fi |
| 22 SRC_DIR="${PARENT_DIR}" |
| 23 done |
| 24 |
6 SCONS="${SRC_DIR}/third_party/scons/scons.py" | 25 SCONS="${SRC_DIR}/third_party/scons/scons.py" |
7 SITE_SCONS="${SRC_DIR}/site_scons" | 26 SITE_SCONS="${SRC_DIR}/site_scons" |
8 | 27 |
9 exec python "${SCONS}" "--site-dir=${SITE_SCONS}" "$@" | 28 exec python "${SCONS}" "--site-dir=${SITE_SCONS}" "$@" |
OLD | NEW |