# return a dummy Popen instance that only returns error
class popen:
def __init__(self, e): self.exception = e
- def communicate(): return ('','')
- def wait(): return -self.exception.errno
+ def communicate(self): return ('','')
+ def wait(self): return -self.exception.errno
stdin = None
class f:
def read(self): return ''
import copy
import os
-import os.path
+import sys
import re
import shlex
import string
# run constructed command
#FUTURE p = SCons.Action._subproc(self, command, **kw)
p = apply(SCons.Action._subproc, (self, command), kw)
- out = p.stdout.read()
- p.stdout.close()
- err = p.stderr.read()
- p.stderr.close()
+ out,err = p.communicate()
status = p.wait()
if err:
- import sys
sys.stderr.write(err)
if status:
raise OSError("'%s' exited %d" % (command, status))
errstr = result.errstr
if result.filename:
errstr = result.filename + ': ' + errstr
- import sys
sys.stderr.write("scons: *** %s\n" % errstr)
return result.status
else:
env['SHOBJSUFFIX'] = '.pic.o'
# determine compiler version
if env['CXX']:
+ #pipe = SCons.Action._subproc(env, [env['CXX'], '-dumpversion'],
pipe = SCons.Action._subproc(env, [env['CXX'], '--version'],
stderr = subprocess.PIPE,
stdout = subprocess.PIPE)
+ if pipe.wait() != 0: return
# -dumpversion was added in GCC 3.0. As long as we're supporting
# GCC versions older than that, we should use --version and a
# regular expression.
env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS -fPIC')
# determine compiler version
if env['CC']:
+ #pipe = SCons.Action._subproc(env, [env['CC'], '-dumpversion'],
pipe = SCons.Action._subproc(env, [env['CC'], '--version'],
stderr = subprocess.PIPE,
stdout = subprocess.PIPE)
+ if pipe.wait() != 0: return
# -dumpversion was added in GCC 3.0. As long as we're supporting
# GCC versions older than that, we should use --version and a
# regular expression.