summaryrefslogtreecommitdiffstats
path: root/src/script
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2001-11-28 03:30:53 (GMT)
committerSteven Knight <knight@baldmt.com>2001-11-28 03:30:53 (GMT)
commitad78319ad3ede8f7065f9c945a3585cad04c3731 (patch)
treebf4e6fb4c27ddbb0d2d2ce54f79f0a8d80c723c1 /src/script
parentf5b84fd3af7d8e3b3d4570dcf40220c96f67d16e (diff)
downloadSCons-ad78319ad3ede8f7065f9c945a3585cad04c3731.zip
SCons-ad78319ad3ede8f7065f9c945a3585cad04c3731.tar.gz
SCons-ad78319ad3ede8f7065f9c945a3585cad04c3731.tar.bz2
Change packaging to the new /usr/lib/scons/ scheme
Diffstat (limited to 'src/script')
-rw-r--r--src/script/README.txt6
-rw-r--r--src/script/scons.bat2
-rw-r--r--src/script/scons.py26
3 files changed, 24 insertions, 10 deletions
diff --git a/src/script/README.txt b/src/script/README.txt
index 6f1ef71..62a10bb 100644
--- a/src/script/README.txt
+++ b/src/script/README.txt
@@ -1,3 +1,9 @@
+###
+### THIS FILE IS NO LONGER USED. THIS IS THE README FILE FOR THE
+### SEPARATE SCRIPT PACKAGE FROM THE ORIGINAL (DRAFT) PACKAGING
+### SCHEME. WE'RE SAVING THIS IN CASE WE NEED OR WANT TO RESURRECT
+### A SEPARATE SCRIPT PACKAGE IN THE FUTURE.
+###
# Copyright (c) 2001 Steven Knight
# __FILE__ __REVISION__ __DATE__ __DEVELOPER__
diff --git a/src/script/scons.bat b/src/script/scons.bat
new file mode 100644
index 0000000..ce4faad
--- /dev/null
+++ b/src/script/scons.bat
@@ -0,0 +1,2 @@
+# __FILE__ __REVISION__ __DATE__ __DEVELOPER__
+@python -c "import SCons.Script; SCons.Script.main()" %1 %2 %3 %4 %5 %6 %7 %8 %9
diff --git a/src/script/scons.py b/src/script/scons.py
index f8ec6a8..0f4eb0b 100644
--- a/src/script/scons.py
+++ b/src/script/scons.py
@@ -30,20 +30,26 @@ import sys
import os.path
import os
-#XXX once we migrate to the new scheme of using /usr/lib/scons
-# instead of /usr/lib/scons-X.Y this hardcoding will go away:
-scons_lib_dir = "scons-0.01"
+# Strip the script directory from sys.path() so on case-insensitive
+# (WIN32) systems Python doesn't think that the "scons" script is the
+# "SCons" package. Replace it with our own library directories
+# (version-specific first, in case they installed by hand there,
+# followed by generic) so we pick up the right version of the build
+# engine modules if they're in either directory.
+
+libs = []
-script_dir = sys.path[0]
if os.environ.has_key("SCONS_LIB_DIR"):
- lib_dir = os.environ["SCONS_LIB_DIR"]
-elif script_dir and script_dir != os.curdir:
- (head, tail) = os.path.split(script_dir)
- lib_dir = os.path.join(head, "lib", scons_lib_dir)
+ libs.append = os.environ["SCONS_LIB_DIR"]
+
+if sys.platform == 'win32':
+ libs.extend([ os.path.join(sys.prefix, 'SCons-__VERSION__'),
+ os.path.join(sys.prefix, 'SCons') ])
else:
- lib_dir = os.path.join(os.pardir, "lib", scons_lib_dir)
+ libs.extend([ os.path.join(sys.prefix, 'lib', 'scons-__VERSION__'),
+ os.path.join(sys.prefix, 'lib', 'scons') ])
-sys.path = [lib_dir] + sys.path
+sys.path = libs + sys.path[1:]
import SCons.Script
SCons.Script.main()