aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Hylton <jeremy@alum.mit.edu>2002-06-18 18:48:55 +0000
committerJeremy Hylton <jeremy@alum.mit.edu>2002-06-18 18:48:55 +0000
commit1b046e4314b516746f7ef387e1b00a7e8a79614d (patch)
tree4dfafaac181e2ca3dee8b0c9f624fe6c61214fa2 /Lib/distutils/unixccompiler.py
parentAdd a default implementation of compile() to the base class. (diff)
downloadcpython-1b046e4314b516746f7ef387e1b00a7e8a79614d.tar.gz
cpython-1b046e4314b516746f7ef387e1b00a7e8a79614d.tar.bz2
cpython-1b046e4314b516746f7ef387e1b00a7e8a79614d.zip
Add implementation of _compile() and use default compile() method.
Diffstat (limited to 'Lib/distutils/unixccompiler.py')
-rw-r--r--Lib/distutils/unixccompiler.py24
1 files changed, 6 insertions, 18 deletions
diff --git a/Lib/distutils/unixccompiler.py b/Lib/distutils/unixccompiler.py
index c887a882261..d94c3840926 100644
--- a/Lib/distutils/unixccompiler.py
+++ b/Lib/distutils/unixccompiler.py
@@ -105,24 +105,12 @@ class UnixCCompiler(CCompiler):
except DistutilsExecError, msg:
raise CompileError, msg
- def compile(self, sources,
- output_dir=None, macros=None, include_dirs=None, debug=0,
- extra_preargs=None, extra_postargs=None, depends=None):
-
- macros, objects, extra_postargs, pp_opts, build = \
- self._setup_compile(output_dir, macros, include_dirs, sources,
- depends, extra_postargs)
- cc_args = self._get_cc_args(pp_opts, debug, extra_preargs)
-
- for obj, (src, ext) in build.items():
- try:
- self.spawn(self.compiler_so + cc_args +
- [src, '-o', obj] + extra_postargs)
- except DistutilsExecError, msg:
- raise CompileError, msg
-
- # Return *all* object filenames, not just the ones we just built.
- return objects
+ def _compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts):
+ try:
+ self.spawn(self.compiler_so + cc_args + [src, '-o', obj] +
+ extra_postargs)
+ except DistutilsExecError, msg:
+ raise CompileError, msg
def create_static_lib(self, objects, output_libname,
output_dir=None, debug=0):