summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/Platform/aix.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/SCons/Platform/aix.py')
-rw-r--r--src/engine/SCons/Platform/aix.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/engine/SCons/Platform/aix.py b/src/engine/SCons/Platform/aix.py
index 542f548..727aa9b 100644
--- a/src/engine/SCons/Platform/aix.py
+++ b/src/engine/SCons/Platform/aix.py
@@ -32,7 +32,31 @@ selection method.
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+import os
+import string
+
import posix
+def get_xlc(env, xlc, xlc_r, 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
+ xlcVersion = None
+
+ try:
+ xlc = env['CC']
+ except KeyError:
+ xlc = 'xlc'
+ 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 = string.split(line, ':')[1:3]
+ xlcVersion = string.split(v)[1]
+ xlcPath = string.split(p)[0]
+ xlcPath = xlcPath[:xlcPath.rindex('/')]
+ break
+ return (xlcPath, xlc, xlc_r, xlcVersion)
+
def generate(env):
posix.generate(env)