RELEASE 1.X - XXX
+ From Chris AtLee
+
+ - Use the specified environment when checking for the GCC compiler
+ version.
+
From Ian P. Cardenas:
- Fix Glob() polluting LIBPATH by returning copy of list
- Add CheckCC, CheckCXX, CheckSHCC and CheckSHCXX tests to
configuration contexts.
+ - Have the --profile= argument use the much faster cProfile module
+ (if it's available in the running Python version).
+
- Reorder MSVC compilation arguments so the /Fo is first.
From Bill Deegan:
- When scanning for a #include file, don't use a directory that
has the same name as the file.
+ From Ralf W. Grosse-Kunstleve
+
+ - Suppress error output when checking for the GCC compiler version.
+
From Jared Grubb:
- Fix VariantDir duplication of #included files in subdirectories.
- Fix typos and format bugs in the man page.
- - Have the --profile= argument use the much faster cProfile module
- (if it's available in the running Python version).
-
- - Use the specified environment and suppress error output when
- checking for the gcc compiler version.
+ - Add a first draft of a wrapper module for Python's subprocess
+ module.
- Refactor use of the SCons.compat module so other modules don't
have to import it individually.
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
-import SCons.Util
+import SCons
+subproc = SCons.Action._subproc
-import os.path
+import os
+import re
+import subprocess
+PIPE = subprocess.PIPE
cplusplus = __import__('c++', globals(), locals(), [])
def look_pkg_db(pkginfo=pkginfo, pkgchk=pkgchk):
version = None
- path = None
for package in ['SPROcpl']:
- cmd = "%s -l %s 2>/dev/null | grep '^ *VERSION:'" % (pkginfo, package)
- line = os.popen(cmd).readline()
- if line:
- version = line.split()[-1]
- cmd = "%s -l %s 2>/dev/null | grep '^Pathname:.*/bin/CC$' | grep -v '/SC[0-9]*\.[0-9]*/'" % (pkgchk, package)
- line = os.popen(cmd).readline()
- if line:
- path = os.path.dirname(line.split()[-1])
- break
-
- return path, version
+ #cmd = "%s -l %s 2>/dev/null" % (pkginfo, package)
+ cmd = [pkginfo, '-l', package]
+ c = subproc(cmd, stdout=PIPE, stderr=PIPE, universal_newlines=True)
+ lines,err = c.communicate()
+ if c.wait(): continue
+ for line in string.split(lines, '\n'):
+ # grep '^ *VERSION:'
+ line = string.strip(line)
+ if line[:8] == 'VERSION:': break
+ else:
+ continue
+ version = string.split(line)[-1]
+ #cmd = "%s -l %s 2>/dev/null" % (pkgchk, package)
+ cmd = [pkgchk, '-l', package]
+ c = subproc(cmd, stdout=PIPE, stderr=PIPE, universal_newlines=True)
+ lines,err = c.communicate()
+ if c.wait(): continue
+ for line in string.split(lines, '\n'):
+ # grep '^Pathname:.*/bin/CC$'
+ if line[:9] != 'Pathname:': continue
+ if line[-7:] != '/bin/CC': continue
+ # grep -v '/SC[0-9]*\.[0-9]*/'
+ if re.search(r'/SC[0-9]*\.[0-9]*/', line): continue
+ return os.path.dirname(string.split(line)[-1]), version
+
+ return None, version
path, version = look_pkg_db()
if path and version: