From: stevenknight Date: Thu, 16 Sep 2004 15:58:05 +0000 (+0000) Subject: Fix SCons on SuSE/AMD-64 Linux by having the wrapper script also check for the build... X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=be510725500351de8a3b458ecdd135a8e95a3d46;p=scons.git Fix SCons on SuSE/AMD-64 Linux by having the wrapper script also check for the build engine in the parent directory of the Python library directory. (Gottfried Ganssauge) git-svn-id: http://scons.tigris.org/svn/scons/trunk@1076 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- diff --git a/src/CHANGES.txt b/src/CHANGES.txt index ffd0abb8..76dec9ac 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -19,6 +19,12 @@ RELEASE 0.97 - XXX - Handle exceptions from Python functions a build actions. + From Gottfried Ganssauge: + + - Fix SCons on SuSE/AMD-64 Linux by having the wrapper script also + check for the build engine in the parent directory of the Python + library directory (/usr/lib64 instead of /usr/lib). + From Steven Knight: - When compiling with Microsoft Visual Studio, don't include the ATL and diff --git a/src/script/scons.py b/src/script/scons.py index 11a24cb1..4852d01a 100644 --- a/src/script/scons.py +++ b/src/script/scons.py @@ -129,6 +129,23 @@ else: prefs)) prefs = temp + # Add the parent directory of the current python's library to the + # preferences. On SuSE-91/AMD64, for example, this is /usr/lib64, + # not /usr/lib. + try: + libpath = os.__file__ + except AttributeError: + pass + else: + while libpath: + libpath, tail = os.path.split(libpath) + if tail[:6] == "python": + break + if libpath: + # Python library is in /usr/libfoo/python*; + # check /usr/libfoo/scons*. + prefs.append(libpath) + # Look first for 'scons-__version__' in all of our preference libs, # then for 'scons'. libs.extend(map(lambda x: os.path.join(x, scons_version), prefs)) diff --git a/src/script/sconsign.py b/src/script/sconsign.py index a886fee6..3303916c 100644 --- a/src/script/sconsign.py +++ b/src/script/sconsign.py @@ -130,6 +130,23 @@ else: prefs)) prefs = temp + # Add the parent directory of the current python's library to the + # preferences. On SuSE-91/AMD64, for example, this is /usr/lib64, + # not /usr/lib. + try: + libpath = os.__file__ + except AttributeError: + pass + else: + while libpath: + libpath, tail = os.path.split(libpath) + if tail[:6] == "python": + break + if libpath: + # Python library is in /usr/libfoo/python*; + # check /usr/libfoo/scons*. + prefs.append(libpath) + # Look first for 'scons-__version__' in all of our preference libs, # then for 'scons'. libs.extend(map(lambda x: os.path.join(x, scons_version), prefs))