diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/CHANGES.txt | 4 | ||||
-rw-r--r-- | src/script/scons.py | 16 |
2 files changed, 14 insertions, 6 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt index a2c6d36..c3b9d86 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -66,6 +66,10 @@ RELEASE 0.09 - and before trying to build a file that doesn't have all its source files (including when an invalid drive letter is used on WIN32). + - Add an scons-local-{version} package (in both .tar.gz and .zip + flavors) to help people who want to ship SCons as a stand-alone + build tool in their software packages. + From Steven Knight and Anthony Roach: - Man page: document the fact that Builder calls return Node objects. 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() |