summaryrefslogtreecommitdiffstats
path: root/src/script
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2002-12-04 14:07:45 (GMT)
committerSteven Knight <knight@baldmt.com>2002-12-04 14:07:45 (GMT)
commit1974e3b981c83ab735d03798d4bf77906097d7fc (patch)
treef28cd2e24d605e5832faf1ba48c1ab1172b394fb /src/script
parentcf8c7c1a70d630deb1d1f7c0e43b40a783787e10 (diff)
downloadSCons-1974e3b981c83ab735d03798d4bf77906097d7fc.zip
SCons-1974e3b981c83ab735d03798d4bf77906097d7fc.tar.gz
SCons-1974e3b981c83ab735d03798d4bf77906097d7fc.tar.bz2
Package a standalone scons-local package.
Diffstat (limited to 'src/script')
-rw-r--r--src/script/scons.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/script/scons.py b/src/script/scons.py
index b42ed42..c66008f 100644
--- a/src/script/scons.py
+++ b/src/script/scons.py
@@ -47,15 +47,21 @@ import os
# followed by generic) so we pick up the right version of the build
# engine modules if they're in either directory.
-selfdir = os.path.abspath(sys.argv[0])
-if selfdir in sys.path:
- sys.path.remove(selfdir)
+script_dir = sys.path[0]
+
+if script_dir in sys.path:
+ sys.path.remove(script_dir)
libs = []
if os.environ.has_key("SCONS_LIB_DIR"):
libs.append(os.environ["SCONS_LIB_DIR"])
+local = 'scons-local-' + __version__
+if script_dir:
+ local = os.path.join(script_dir, local)
+libs.append(local)
+
if sys.platform == 'win32':
libs.extend([ os.path.join(sys.prefix, 'SCons-%s' % __version__),
os.path.join(sys.prefix, 'SCons') ])
@@ -66,8 +72,6 @@ else:
_usr = os.path.join('', 'usr')
_usr_local = os.path.join('', 'usr', 'local')
- script_dir = sys.path[0]
-
if script_dir == 'bin':
prefs.append(os.getcwd())
else:
@@ -89,7 +93,7 @@ else:
libs.extend(map(lambda x: os.path.join(x, 'lib', 'scons-%s' % __version__), prefs))
libs.extend(map(lambda x: os.path.join(x, 'lib', 'scons'), prefs))
-sys.path = libs + sys.path[1:]
+sys.path = libs + sys.path
import SCons.Script
SCons.Script.main()