diff options
author | Jeremy Hylton <jeremy@alum.mit.edu> | 2002-06-18 18:48:55 (GMT) |
---|---|---|
committer | Jeremy Hylton <jeremy@alum.mit.edu> | 2002-06-18 18:48:55 (GMT) |
commit | 1b046e4314b516746f7ef387e1b00a7e8a79614d (patch) | |
tree | 4dfafaac181e2ca3dee8b0c9f624fe6c61214fa2 /Lib/distutils/emxccompiler.py | |
parent | 6e08d22b1a7dabb5456460f152cc5e102cf44ea5 (diff) | |
download | cpython-1b046e4314b516746f7ef387e1b00a7e8a79614d.zip cpython-1b046e4314b516746f7ef387e1b00a7e8a79614d.tar.gz cpython-1b046e4314b516746f7ef387e1b00a7e8a79614d.tar.bz2 |
Add implementation of _compile() and use default compile() method.
Diffstat (limited to 'Lib/distutils/emxccompiler.py')
-rw-r--r-- | Lib/distutils/emxccompiler.py | 48 |
1 files changed, 13 insertions, 35 deletions
diff --git a/Lib/distutils/emxccompiler.py b/Lib/distutils/emxccompiler.py index c2c73b0..2dc4fbd 100644 --- a/Lib/distutils/emxccompiler.py +++ b/Lib/distutils/emxccompiler.py @@ -76,41 +76,19 @@ class EMXCCompiler (UnixCCompiler): # __init__ () - # not much different of the compile method in UnixCCompiler, - # but we have to insert some lines in the middle of it, so - # we put here a adapted version of it. - # (If we would call compile() in the base class, it would do some - # initializations a second time, this is why all is done here.) - - 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(): - if ext == '.rc': - # gcc requires '.rc' compiled to binary ('.res') files !!! - try: - self.spawn (["rc","-r",src]) - except DistutilsExecError, msg: - raise CompileError, msg - else: # for other files use the C-compiler - 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 - - # compile () - + def _compile(self, obj, src, ext, cc_args, extra_postargs): + if ext == '.rc': + # gcc requires '.rc' compiled to binary ('.res') files !!! + try: + self.spawn(["rc", "-r", src]) + except DistutilsExecError, msg: + raise CompileError, msg + else: # for other files use the C-compiler + try: + self.spawn(self.compiler_so + cc_args + [src, '-o', obj] + + extra_postargs) + except DistutilsExecError, msg: + raise CompileError, msg def link (self, target_desc, |