summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/Platform
diff options
context:
space:
mode:
authorGary Oberbrunner <garyo@oberbrunner.com>2014-08-23 20:28:44 (GMT)
committerGary Oberbrunner <garyo@oberbrunner.com>2014-08-23 20:28:44 (GMT)
commita7d764ed831fa3243aa0bd3307f641e1e1f9f8a8 (patch)
tree0193d9406107790a66098254869e4b070aa6cacc /src/engine/SCons/Platform
parenta6ea2d760464092ea91a0dd01ba6260288aa3587 (diff)
parent6db60dbe1c3dc28f24bfca48135bcb4bc9bd66d6 (diff)
downloadSCons-a7d764ed831fa3243aa0bd3307f641e1e1f9f8a8.zip
SCons-a7d764ed831fa3243aa0bd3307f641e1e1f9f8a8.tar.gz
SCons-a7d764ed831fa3243aa0bd3307f641e1e1f9f8a8.tar.bz2
Merged default branch into python3-port to keep it up to date.
Hand-updated a few things to keep them python3-safe, and handled several merge conflicts.
Diffstat (limited to 'src/engine/SCons/Platform')
-rw-r--r--src/engine/SCons/Platform/aix.py40
-rw-r--r--src/engine/SCons/Platform/posix.py4
2 files changed, 32 insertions, 12 deletions
diff --git a/src/engine/SCons/Platform/aix.py b/src/engine/SCons/Platform/aix.py
index f6853b5..0266dc6 100644
--- a/src/engine/SCons/Platform/aix.py
+++ b/src/engine/SCons/Platform/aix.py
@@ -33,10 +33,14 @@ selection method.
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import os
+import subprocess
from . import posix
-def get_xlc(env, xlc=None, xlc_r=None, packages=[]):
+import SCons.Util
+import SCons.Action
+
+def get_xlc(env, xlc=None, packages=[]):
# Use the AIX package installer tool lslpp to figure out where a
# given xl* compiler is installed and what version it is.
xlcPath = None
@@ -44,18 +48,30 @@ def get_xlc(env, xlc=None, xlc_r=None, packages=[]):
if xlc is None:
xlc = env.get('CC', 'xlc')
- if xlc_r is None:
- xlc_r = xlc + '_r'
+ if SCons.Util.is_List(xlc):
+ xlc = xlc[0]
for package in packages:
- cmd = "lslpp -fc " + package + " 2>/dev/null | egrep '" + xlc + "([^-_a-zA-Z0-9].*)?$'"
- line = os.popen(cmd).readline()
- if line:
- v, p = line.split(':')[1:3]
- xlcVersion = v.split()[1]
- xlcPath = p.split()[0]
- xlcPath = xlcPath[:xlcPath.rindex('/')]
- break
- return (xlcPath, xlc, xlc_r, xlcVersion)
+ # find the installed filename, which may be a symlink as well
+ pipe = SCons.Action._subproc(env, ['lslpp', '-fc', package],
+ stdin = 'devnull',
+ stderr = 'devnull',
+ stdout = subprocess.PIPE)
+ # output of lslpp is something like this:
+ # #Path:Fileset:File
+ # /usr/lib/objrepos:vac.C 6.0.0.0:/usr/vac/exe/xlCcpp
+ # /usr/lib/objrepos:vac.C 6.0.0.0:/usr/vac/bin/xlc_r -> /usr/vac/bin/xlc
+ for line in pipe.stdout:
+ if xlcPath:
+ continue # read everything to let lslpp terminate
+ fileset, filename = line.split(':')[1:3]
+ filename = filename.split()[0]
+ if ('/' in xlc and filename == xlc) \
+ or ('/' not in xlc and filename.endswith('/' + xlc)):
+ xlcVersion = fileset.split()[1]
+ xlcPath, sep, xlc = filename.rpartition('/')
+ pass
+ pass
+ return (xlcPath, xlc, xlcVersion)
def generate(env):
posix.generate(env)
diff --git a/src/engine/SCons/Platform/posix.py b/src/engine/SCons/Platform/posix.py
index 2e21e5a..7e69a7c 100644
--- a/src/engine/SCons/Platform/posix.py
+++ b/src/engine/SCons/Platform/posix.py
@@ -113,6 +113,10 @@ def generate(env):
# This platform supports RPATH specifications.
env['__RPATH'] = '$_RPATH'
+ # GDC is GCC family, but DMD and LDC have different options.
+ # Must be able to have GCC and DMD work in the same build, so:
+ env['__DRPATH'] = '$_DRPATH'
+
# Local Variables:
# tab-width:4
# indent-tabs-mode:nil