Fix c++ compiler detection: correct the order of values returned,
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Sun, 29 Nov 2009 05:11:31 +0000 (05:11 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Sun, 29 Nov 2009 05:11:31 +0000 (05:11 +0000)
return the dirname of the executables found, not the full path.

git-svn-id: http://scons.tigris.org/svn/scons/trunk@4495 fdb21ef1-2011-0410-befe-b5e4ea1792b1

src/engine/SCons/Tool/sunc++.py

index 164551cab4bb931aedff145c0362af87da0676f4..49f90eaf087d19f0b2a3bcd1ec745a147ae23323 100644 (file)
@@ -54,10 +54,10 @@ def get_package_info(package_name, pkginfo, pkgchk):
         except EnvironmentError:
             pass
         else:
-            sadm_re = re.compile('^(\S*/bin/CC)[= ].* %s$' % package_name, re.M)
+            sadm_re = re.compile('^(\S*/bin/CC)(=\S*)? %s$' % package_name, re.M)
             sadm_match = sadm_re.search(sadm_contents)
             if sadm_match:
-                pathname = sadm_match.group(1)
+                pathname = os.path.dirname(sadm_match.group(1))
 
         try:
             p = subprocess.Popen([pkginfo, '-l', package_name],
@@ -84,9 +84,9 @@ def get_package_info(package_name, pkginfo, pkgchk):
                 pathname_re = re.compile(r'^Pathname:\s*(.*/bin/CC)$', re.M)
                 pathname_match = pathname_re.search(pkgchk_contents)
                 if pathname_match:
-                    pathname = pathname_match.group(1)
+                    pathname = os.path.dirname(pathname_match.group(1))
 
-        package_info[package_name] = (version, pathname)
+        package_info[package_name] = (pathname, version)
         return package_info[package_name]
 
 # use the package installer tool lslpp to figure out where cppc and what