summaryrefslogtreecommitdiffstats
path: root/src/script
diff options
context:
space:
mode:
authorStefan Zimmermann <zimmermann.code@gmail.com>2014-03-31 16:24:42 (GMT)
committerStefan Zimmermann <zimmermann.code@gmail.com>2014-03-31 16:24:42 (GMT)
commitcffcd3c38568d3f82ff83916bbbd1b129373558c (patch)
treeff268c97886e3cc905115185a35405b3fd83348a /src/script
parentea1890249923aab9cda388b2d22b566dbb7b8949 (diff)
parentd4f8c6e320484c106446918c37affdddacd5c7a3 (diff)
downloadSCons-cffcd3c38568d3f82ff83916bbbd1b129373558c.zip
SCons-cffcd3c38568d3f82ff83916bbbd1b129373558c.tar.gz
SCons-cffcd3c38568d3f82ff83916bbbd1b129373558c.tar.bz2
Merged with [default]
Diffstat (limited to 'src/script')
-rw-r--r--src/script/scons.py19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/script/scons.py b/src/script/scons.py
index 89eef34..d0bb812 100644
--- a/src/script/scons.py
+++ b/src/script/scons.py
@@ -38,6 +38,7 @@ __developer__ = "__DEVELOPER__"
import os
import sys
+
##############################################################################
# BEGIN STANDARD SCons SCRIPT HEADER
#
@@ -72,6 +73,11 @@ libs = []
if "SCONS_LIB_DIR" in os.environ:
libs.append(os.environ["SCONS_LIB_DIR"])
+# - running from source takes priority (since 2.3.2), excluding SCONS_LIB_DIR settings
+script_path = os.path.abspath(os.path.dirname(__file__))
+source_path = os.path.join(script_path, '..', 'engine')
+libs.append(source_path)
+
local_version = 'scons-local-' + __version__
local = 'scons-local'
if script_dir:
@@ -85,6 +91,8 @@ scons_version = 'scons-%s' % __version__
# preferred order of scons lookup paths
prefs = []
+
+# - running from egg check
try:
import pkg_resources
except ImportError:
@@ -181,12 +189,11 @@ if __name__ == "__main__":
try:
import SCons.Script
except:
- ROOT = os.path.join(os.path.abspath(os.path.dirname(__file__)), '..', 'engine')
- if os.path.exists(ROOT):
- sys.path += [ROOT]
- print("SCons import failed. Trying to run from source directory")
- import SCons.Script
-
+ print("Import failed. Unable to find SCons files in:")
+ for path in libs:
+ print " %s" % path
+ raise
+
# this does all the work, and calls sys.exit
# with the proper exit status when done.
SCons.Script.main()