diff options
author | anatoly techtonik <techtonik@gmail.com> | 2012-11-16 13:58:03 (GMT) |
---|---|---|
committer | anatoly techtonik <techtonik@gmail.com> | 2012-11-16 13:58:03 (GMT) |
commit | 649f2dee6dcaaeb6897b1753ad0a6e14a22b0b9f (patch) | |
tree | 7cd2cda65c163a53356d7a62d86ea27733109d18 | |
parent | a9145df8c3056bc0daae495aac1280ad6ac95394 (diff) | |
download | SCons-649f2dee6dcaaeb6897b1753ad0a6e14a22b0b9f.zip SCons-649f2dee6dcaaeb6897b1753ad0a6e14a22b0b9f.tar.gz SCons-649f2dee6dcaaeb6897b1753ad0a6e14a22b0b9f.tar.bz2 |
Ability to run scripts/scons.py directly from source checkout.
-rw-r--r-- | src/CHANGES.txt | 3 | ||||
-rw-r--r-- | src/script/scons.py | 10 |
2 files changed, 12 insertions, 1 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 2c89d8d..2378ba0 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -6,6 +6,9 @@ RELEASE 2.X.X - + From anatoly techtonik: + + Ability to run scripts/scons.py directly from source checkout. + From Alexey Klimkin: - Fix nested LIBPATH expansion by flattening sequences in subst_path. diff --git a/src/script/scons.py b/src/script/scons.py index 86d2562..cd8b432 100644 --- a/src/script/scons.py +++ b/src/script/scons.py @@ -184,7 +184,15 @@ sys.path = libs + sys.path ############################################################################## if __name__ == "__main__": - import SCons.Script + 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 + # this does all the work, and calls sys.exit # with the proper exit status when done. SCons.Script.main() |