Example #1
0
 def _execute_c_compiler(self, cc, args, outname, cwd=None):
     log.execute(cc + " " + " ".join(args))
     # 'cc' can also contain some options for the C compiler;
     # e.g. it can be "gcc -m32".  We handle it by splitting on ' '.
     cclist = cc.split()
     cc = cclist[0]
     args = cclist[1:] + args
     returncode, stdout, stderr = _run_subprocess(cc, args, self.c_environ, cwd)
     self._handle_error(returncode, stdout, stderr, outname)
Example #2
0
 def _execute_c_compiler(self, cc, args, outname, cwd=None):
     log.execute(cc + ' ' + ' '.join(args))
     # 'cc' can also contain some options for the C compiler;
     # e.g. it can be "gcc -m32".  We handle it by splitting on ' '.
     cclist = cc.split()
     cc = cclist[0]
     args = cclist[1:] + args
     returncode, stdout, stderr = _run_subprocess(cc, args, self.c_environ,
                                                  cwd)
     self._handle_error(returncode, stdout, stderr, outname)
Example #3
0
    def execute(self, executable, args=None, env=None, compilation_info=None):
        if env is None:
            env = os.environ.copy()
        else:
            env = env.copy()

        # On Windows, %SystemRoot% must be present for most programs to start
        if os.name == "nt" and "SystemRoot" not in env and "SystemRoot" in os.environ:
            env["SystemRoot"] = os.environ["SystemRoot"]

        # Set LD_LIBRARY_PATH on posix platforms
        if os.name == "posix" and compilation_info is not None:
            library_path = ":".join([str(i) for i in compilation_info.library_dirs])
            if sys.platform == "darwin":
                env["DYLD_LIBRARY_PATH"] = library_path
            else:
                env["LD_LIBRARY_PATH"] = library_path

        returncode, stdout, stderr = _run_subprocess(str(executable), args, env)
        return ExecutionResult(returncode, stdout, stderr)
Example #4
0
    def execute(self, executable, args=None, env=None, compilation_info=None):
        if env is None:
            env = os.environ.copy()
        else:
            env = env.copy()

        # On Windows, %SystemRoot% must be present for most programs to start
        if (os.name == 'nt' and "SystemRoot" not in env
                and "SystemRoot" in os.environ):
            env["SystemRoot"] = os.environ["SystemRoot"]

        # Set LD_LIBRARY_PATH on posix platforms
        if os.name == 'posix' and compilation_info is not None:
            library_path = ':'.join(
                [str(i) for i in compilation_info.library_dirs])
            if sys.platform == 'darwin':
                env['DYLD_LIBRARY_PATH'] = library_path
            else:
                env['LD_LIBRARY_PATH'] = library_path

        returncode, stdout, stderr = _run_subprocess(str(executable), args,
                                                     env)
        return ExecutionResult(returncode, stdout, stderr)