diff options
author | Steven Knight <knight@baldmt.com> | 2003-10-12 12:44:26 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2003-10-12 12:44:26 (GMT) |
commit | 57a6a5147897525742331568d9538371c7260cf8 (patch) | |
tree | d5fc001207fc31829a2bdb8d377b691a2f24e040 /src/script | |
parent | 34f47299ed9fa4eb468201ae6e5cb4e0523a3dc2 (diff) | |
download | SCons-57a6a5147897525742331568d9538371c7260cf8.zip SCons-57a6a5147897525742331568d9538371c7260cf8.tar.gz SCons-57a6a5147897525742331568d9538371c7260cf8.tar.bz2 |
More flexible RPM building. (Gerard Patel) Have scripts look for the build engine in the site-packages subdirectory as wel. (Charles Crain)
Diffstat (limited to 'src/script')
-rw-r--r-- | src/script/scons.bat | 4 | ||||
-rw-r--r-- | src/script/scons.py | 7 | ||||
-rw-r--r-- | src/script/sconsign.py | 7 |
3 files changed, 14 insertions, 4 deletions
diff --git a/src/script/scons.bat b/src/script/scons.bat index d2770c6..782d8c4 100644 --- a/src/script/scons.bat +++ b/src/script/scons.bat @@ -1,11 +1,11 @@ @echo off if "%OS%" == "Windows_NT" goto WinNT REM for 9x/Me you better not have more than 9 args -python -c "from os.path import join; import sys; sys.path = [ join(sys.prefix, 'scons-__VERSION__'), join(sys.prefix, 'scons')] + sys.path; import SCons.Script; SCons.Script.main()" %1 %2 %3 %4 %5 %6 %7 %8 %9 +python -c "from os.path import join; import sys; sys.path = [ join(sys.prefix, 'Lib', 'site-packages', 'scons-__VERSION__'), join(sys.prefix, 'Lib', 'site-packages', 'scons'), join(sys.prefix, 'scons-__VERSION__'), join(sys.prefix, 'scons')] + sys.path; import SCons.Script; SCons.Script.main()" %1 %2 %3 %4 %5 %6 %7 %8 %9 REM no way to set exit status of this script for 9x/Me goto endscons :WinNT -python -c "from os.path import join; import sys; sys.path = [ join(sys.prefix, 'scons-__VERSION__'), join(sys.prefix, 'scons')] + sys.path; import SCons.Script; SCons.Script.main()" %* +python -c "from os.path import join; import sys; sys.path = [ join(sys.prefix, 'Lib', 'site-packages', 'scons-__VERSION__'), join(sys.prefix, 'Lib', 'site-packages', 'scons'), join(sys.prefix, 'scons-__VERSION__'), join(sys.prefix, 'scons')] + sys.path; import SCons.Script; SCons.Script.main()" %* if NOT "%COMSPEC%" == "%SystemRoot%\system32\cmd.exe" goto endscons if errorlevel 9009 echo you do not have python in your PATH REM color 00 causes this script to exit with non-zero exit status diff --git a/src/script/scons.py b/src/script/scons.py index 501f071..a90e1ba 100644 --- a/src/script/scons.py +++ b/src/script/scons.py @@ -79,6 +79,7 @@ if sys.platform == 'win32': # sys.prefix is (likely) C:\Python*; # check only C:\Python*. prefs.append(sys.prefix) + prefs.append(os.path.join(sys.prefix, 'Lib', 'site-packages')) else: # On other (POSIX) platforms, things are more complicated due to # the variety of path names and library locations. Try to be smart @@ -120,7 +121,11 @@ else: # check only /foo/lib/scons*. prefs.append(sys.prefix) - prefs = map(lambda x: os.path.join(x, 'lib'), prefs) + temp = map(lambda x: os.path.join(x, 'lib'), prefs) + temp.extend(map(lambda x: os.path.join(x, 'lib', 'python%d.%d' % (sys.version_info[0], + sys.version_info[1]), + 'site-packages'), prefs)) + prefs = temp # Look first for 'scons-__version__' in all of our preference libs, # then for 'scons'. diff --git a/src/script/sconsign.py b/src/script/sconsign.py index 015f1db..520d0fa 100644 --- a/src/script/sconsign.py +++ b/src/script/sconsign.py @@ -80,6 +80,7 @@ if sys.platform == 'win32': # sys.prefix is (likely) C:\Python*; # check only C:\Python*. prefs.append(sys.prefix) + prefs.append(os.path.join(sys.prefix, 'Lib', 'site-packages')) else: # On other (POSIX) platforms, things are more complicated due to # the variety of path names and library locations. Try to be smart @@ -121,7 +122,11 @@ else: # check only /foo/lib/scons*. prefs.append(sys.prefix) - prefs = map(lambda x: os.path.join(x, 'lib'), prefs) + temp = map(lambda x: os.path.join(x, 'lib'), prefs) + temp.extend(map(lambda x: os.path.join(x, 'lib', 'python%d.%d' % (sys.version_info[0], + sys.version_info[1]), + 'site-packages'), prefs)) + prefs = temp # Look first for 'scons-__version__' in all of our preference libs, # then for 'scons'. |