annotate Lib/distutils/bcppcompiler.py @ 58925:eecf1bef052d 2.6

Merged revisions 78207 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r78207 | ezio.melotti | 2010-02-17 01:26:09 +0200 (Wed, 17 Feb 2010) | 1 line #7930: fix stripid ........
author Ezio Melotti <ezio.melotti@gmail.com>
date Tue, 16 Feb 2010 23:29:44 +0000
parents 1d84bf5f9478
children a5229237eb50
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
13043
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
1 """distutils.bcppcompiler
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
2
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
3 Contains BorlandCCompiler, an implementation of the abstract CCompiler class
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
4 for the Borland C++ compiler.
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
5 """
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
6
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
7 # This implementation by Lyle Johnson, based on the original msvccompiler.py
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
8 # module and using the directions originally published by Gordon Williams.
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
9
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
10 # XXX looks like there's a LOT of overlap between these two classes:
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
11 # someone should sit down and factor out the common code as
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
12 # WindowsCCompiler! --GPW
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
13
33965
893d46576737 Update compatibility comments to 2.1, corresponding to PEP 291 1.13.
Martin v. Löwis <martin@v.loewis.de>
parents: 32736
diff changeset
14 # This module should be kept compatible with Python 2.1.
26285
42bfc98d295b Add comment to Distutil files about requiring 1.5.2 compatibility, as
Andrew M. Kuchling <amk@amk.ca>
parents: 26036
diff changeset
15
13043
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
16 __revision__ = "$Id$"
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
17
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
18
45468
1d84bf5f9478 Patch #2167 from calvin: Remove unused imports
Christian Heimes <christian@cheimes.de>
parents: 33965
diff changeset
19 import os
13043
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
20 from distutils.errors import \
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
21 DistutilsExecError, DistutilsPlatformError, \
19116
13d0f34b6a16 Import UnknownFileError
Andrew M. Kuchling <amk@amk.ca>
parents: 16515
diff changeset
22 CompileError, LibError, LinkError, UnknownFileError
13043
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
23 from distutils.ccompiler import \
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
24 CCompiler, gen_preprocess_options, gen_lib_options
13802
b1a7f61ab781 Patch from Rene Liebscher. Some ugly changes, but supposedly this makes
Greg Ward <gward@python.net>
parents: 13043
diff changeset
25 from distutils.file_util import write_file
19318
cbaa545c788d [Patch #441691] preprocess() method for Borland C compiler.
Andrew M. Kuchling <amk@amk.ca>
parents: 19116
diff changeset
26 from distutils.dep_util import newer
23668
ca87119255eb Make setup.py less chatty by default.
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 21267
diff changeset
27 from distutils import log
13043
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
28
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
29 class BCPPCompiler(CCompiler) :
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
30 """Concrete class that implements an interface to the Borland C/C++
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
31 compiler, as defined by the CCompiler abstract class.
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
32 """
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
33
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
34 compiler_type = 'bcpp'
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
35
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
36 # Just set this so CCompiler's constructor doesn't barf. We currently
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
37 # don't use the 'set_executables()' bureaucracy provided by CCompiler,
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
38 # as it really isn't necessary for this sort of single-compiler class.
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
39 # Would be nice to have a consistent interface with UnixCCompiler,
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
40 # though, so it's worth thinking about.
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
41 executables = {}
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
42
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
43 # Private class data (need to distinguish C from C++ source for compiler)
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
44 _c_extensions = ['.c']
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
45 _cpp_extensions = ['.cc', '.cpp', '.cxx']
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
46
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
47 # Needed for the filename generation methods provided by the
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
48 # base class, CCompiler.
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
49 src_extensions = _c_extensions + _cpp_extensions
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
50 obj_extension = '.obj'
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
51 static_lib_extension = '.lib'
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
52 shared_lib_extension = '.dll'
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
53 static_lib_format = shared_lib_format = '%s%s'
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
54 exe_extension = '.exe'
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
55
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
56
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
57 def __init__ (self,
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
58 verbose=0,
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
59 dry_run=0,
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
60 force=0):
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
61
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
62 CCompiler.__init__ (self, verbose, dry_run, force)
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
63
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
64 # These executables are assumed to all be in the path.
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
65 # Borland doesn't seem to use any special registry settings to
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
66 # indicate their installation locations.
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
67
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
68 self.cc = "bcc32.exe"
14890
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
69 self.linker = "ilink32.exe"
13043
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
70 self.lib = "tlib.exe"
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
71
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
72 self.preprocess_options = None
13951
1b156ef8281b Rene Liebscher:
Greg Ward <gward@python.net>
parents: 13845
diff changeset
73 self.compile_options = ['/tWM', '/O2', '/q', '/g0']
1b156ef8281b Rene Liebscher:
Greg Ward <gward@python.net>
parents: 13845
diff changeset
74 self.compile_options_debug = ['/tWM', '/Od', '/q', '/g0']
13043
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
75
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
76 self.ldflags_shared = ['/Tpd', '/Gn', '/q', '/x']
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
77 self.ldflags_shared_debug = ['/Tpd', '/Gn', '/q', '/x']
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
78 self.ldflags_static = []
14890
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
79 self.ldflags_exe = ['/Gn', '/q', '/x']
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
80 self.ldflags_exe_debug = ['/Gn', '/q', '/x','/r']
13043
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
81
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
82
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
83 # -- Worker methods ------------------------------------------------
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
84
23823
c48bf5df614a Refactor compile() method implementations.
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 23668
diff changeset
85 def compile(self, sources,
c48bf5df614a Refactor compile() method implementations.
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 23668
diff changeset
86 output_dir=None, macros=None, include_dirs=None, debug=0,
c48bf5df614a Refactor compile() method implementations.
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 23668
diff changeset
87 extra_preargs=None, extra_postargs=None, depends=None):
32736
c3a096bfbd6b Whitespace normalization, via reindent.py.
Tim Peters <tim.peters@gmail.com>
parents: 31129
diff changeset
88
23823
c48bf5df614a Refactor compile() method implementations.
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 23668
diff changeset
89 macros, objects, extra_postargs, pp_opts, build = \
c48bf5df614a Refactor compile() method implementations.
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 23668
diff changeset
90 self._setup_compile(output_dir, macros, include_dirs, sources,
c48bf5df614a Refactor compile() method implementations.
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 23668
diff changeset
91 depends, extra_postargs)
13043
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
92 compile_opts = extra_preargs or []
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
93 compile_opts.append ('-c')
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
94 if debug:
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
95 compile_opts.extend (self.compile_options_debug)
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
96 else:
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
97 compile_opts.extend (self.compile_options)
21267
7a7f557b4d54 Whitespace normalization.
Fred Drake <fdrake@acm.org>
parents: 19318
diff changeset
98
31129
be9ef9b92d61 Compile the files in the same order they are passed to the compiler.
Thomas Heller <theller@ctypes.org>
parents: 26285
diff changeset
99 for obj in objects:
be9ef9b92d61 Compile the files in the same order they are passed to the compiler.
Thomas Heller <theller@ctypes.org>
parents: 26285
diff changeset
100 try:
be9ef9b92d61 Compile the files in the same order they are passed to the compiler.
Thomas Heller <theller@ctypes.org>
parents: 26285
diff changeset
101 src, ext = build[obj]
be9ef9b92d61 Compile the files in the same order they are passed to the compiler.
Thomas Heller <theller@ctypes.org>
parents: 26285
diff changeset
102 except KeyError:
be9ef9b92d61 Compile the files in the same order they are passed to the compiler.
Thomas Heller <theller@ctypes.org>
parents: 26285
diff changeset
103 continue
23823
c48bf5df614a Refactor compile() method implementations.
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 23668
diff changeset
104 # XXX why do the normpath here?
c48bf5df614a Refactor compile() method implementations.
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 23668
diff changeset
105 src = os.path.normpath(src)
c48bf5df614a Refactor compile() method implementations.
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 23668
diff changeset
106 obj = os.path.normpath(obj)
c48bf5df614a Refactor compile() method implementations.
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 23668
diff changeset
107 # XXX _setup_compile() did a mkpath() too but before the normpath.
c48bf5df614a Refactor compile() method implementations.
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 23668
diff changeset
108 # Is it possible to skip the normpath?
c48bf5df614a Refactor compile() method implementations.
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 23668
diff changeset
109 self.mkpath(os.path.dirname(obj))
14890
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
110
23823
c48bf5df614a Refactor compile() method implementations.
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 23668
diff changeset
111 if ext == '.res':
c48bf5df614a Refactor compile() method implementations.
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 23668
diff changeset
112 # This is already a binary file -- skip it.
c48bf5df614a Refactor compile() method implementations.
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 23668
diff changeset
113 continue # the 'for' loop
c48bf5df614a Refactor compile() method implementations.
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 23668
diff changeset
114 if ext == '.rc':
c48bf5df614a Refactor compile() method implementations.
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 23668
diff changeset
115 # This needs to be compiled to a .res file -- do it now.
13043
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
116 try:
23823
c48bf5df614a Refactor compile() method implementations.
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 23668
diff changeset
117 self.spawn (["brcc32", "-fo", obj, src])
13043
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
118 except DistutilsExecError, msg:
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
119 raise CompileError, msg
23823
c48bf5df614a Refactor compile() method implementations.
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 23668
diff changeset
120 continue # the 'for' loop
c48bf5df614a Refactor compile() method implementations.
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 23668
diff changeset
121
c48bf5df614a Refactor compile() method implementations.
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 23668
diff changeset
122 # The next two are both for the real compiler.
c48bf5df614a Refactor compile() method implementations.
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 23668
diff changeset
123 if ext in self._c_extensions:
c48bf5df614a Refactor compile() method implementations.
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 23668
diff changeset
124 input_opt = ""
c48bf5df614a Refactor compile() method implementations.
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 23668
diff changeset
125 elif ext in self._cpp_extensions:
c48bf5df614a Refactor compile() method implementations.
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 23668
diff changeset
126 input_opt = "-P"
c48bf5df614a Refactor compile() method implementations.
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 23668
diff changeset
127 else:
c48bf5df614a Refactor compile() method implementations.
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 23668
diff changeset
128 # Unknown file type -- no extra options. The compiler
c48bf5df614a Refactor compile() method implementations.
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 23668
diff changeset
129 # will probably fail, but let it just in case this is a
c48bf5df614a Refactor compile() method implementations.
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 23668
diff changeset
130 # file the compiler recognizes even if we don't.
c48bf5df614a Refactor compile() method implementations.
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 23668
diff changeset
131 input_opt = ""
c48bf5df614a Refactor compile() method implementations.
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 23668
diff changeset
132
c48bf5df614a Refactor compile() method implementations.
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 23668
diff changeset
133 output_opt = "-o" + obj
c48bf5df614a Refactor compile() method implementations.
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 23668
diff changeset
134
c48bf5df614a Refactor compile() method implementations.
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 23668
diff changeset
135 # Compiler command line syntax is: "bcc32 [options] file(s)".
c48bf5df614a Refactor compile() method implementations.
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 23668
diff changeset
136 # Note that the source file names must appear at the end of
c48bf5df614a Refactor compile() method implementations.
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 23668
diff changeset
137 # the command line.
c48bf5df614a Refactor compile() method implementations.
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 23668
diff changeset
138 try:
c48bf5df614a Refactor compile() method implementations.
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 23668
diff changeset
139 self.spawn ([self.cc] + compile_opts + pp_opts +
c48bf5df614a Refactor compile() method implementations.
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 23668
diff changeset
140 [input_opt, output_opt] +
c48bf5df614a Refactor compile() method implementations.
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 23668
diff changeset
141 extra_postargs + [src])
c48bf5df614a Refactor compile() method implementations.
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 23668
diff changeset
142 except DistutilsExecError, msg:
c48bf5df614a Refactor compile() method implementations.
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 23668
diff changeset
143 raise CompileError, msg
13043
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
144
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
145 return objects
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
146
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
147 # compile ()
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
148
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
149
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
150 def create_static_lib (self,
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
151 objects,
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
152 output_libname,
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
153 output_dir=None,
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
154 debug=0,
26036
771b6f521b95 This patch fixes the following bugs:
Gustavo Niemeyer <gustavo@niemeyer.net>
parents: 23823
diff changeset
155 target_lang=None):
13043
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
156
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
157 (objects, output_dir) = self._fix_object_args (objects, output_dir)
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
158 output_filename = \
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
159 self.library_filename (output_libname, output_dir=output_dir)
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
160
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
161 if self._need_link (objects, output_filename):
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
162 lib_args = [output_filename, '/u'] + objects
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
163 if debug:
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
164 pass # XXX what goes here?
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
165 try:
21267
7a7f557b4d54 Whitespace normalization.
Fred Drake <fdrake@acm.org>
parents: 19318
diff changeset
166 self.spawn ([self.lib] + lib_args)
13043
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
167 except DistutilsExecError, msg:
21267
7a7f557b4d54 Whitespace normalization.
Fred Drake <fdrake@acm.org>
parents: 19318
diff changeset
168 raise LibError, msg
13043
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
169 else:
23668
ca87119255eb Make setup.py less chatty by default.
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 21267
diff changeset
170 log.debug("skipping %s (up-to-date)", output_filename)
13043
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
171
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
172 # create_static_lib ()
21267
7a7f557b4d54 Whitespace normalization.
Fred Drake <fdrake@acm.org>
parents: 19318
diff changeset
173
7a7f557b4d54 Whitespace normalization.
Fred Drake <fdrake@acm.org>
parents: 19318
diff changeset
174
14890
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
175 def link (self,
21267
7a7f557b4d54 Whitespace normalization.
Fred Drake <fdrake@acm.org>
parents: 19318
diff changeset
176 target_desc,
14890
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
177 objects,
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
178 output_filename,
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
179 output_dir=None,
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
180 libraries=None,
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
181 library_dirs=None,
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
182 runtime_library_dirs=None,
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
183 export_symbols=None,
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
184 debug=0,
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
185 extra_preargs=None,
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
186 extra_postargs=None,
26036
771b6f521b95 This patch fixes the following bugs:
Gustavo Niemeyer <gustavo@niemeyer.net>
parents: 23823
diff changeset
187 build_temp=None,
771b6f521b95 This patch fixes the following bugs:
Gustavo Niemeyer <gustavo@niemeyer.net>
parents: 23823
diff changeset
188 target_lang=None):
13043
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
189
13802
b1a7f61ab781 Patch from Rene Liebscher. Some ugly changes, but supposedly this makes
Greg Ward <gward@python.net>
parents: 13043
diff changeset
190 # XXX this ignores 'build_temp'! should follow the lead of
b1a7f61ab781 Patch from Rene Liebscher. Some ugly changes, but supposedly this makes
Greg Ward <gward@python.net>
parents: 13043
diff changeset
191 # msvccompiler.py
b1a7f61ab781 Patch from Rene Liebscher. Some ugly changes, but supposedly this makes
Greg Ward <gward@python.net>
parents: 13043
diff changeset
192
13043
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
193 (objects, output_dir) = self._fix_object_args (objects, output_dir)
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
194 (libraries, library_dirs, runtime_library_dirs) = \
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
195 self._fix_lib_args (libraries, library_dirs, runtime_library_dirs)
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
196
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
197 if runtime_library_dirs:
23668
ca87119255eb Make setup.py less chatty by default.
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 21267
diff changeset
198 log.warn("I don't know what to do with 'runtime_library_dirs': %s",
ca87119255eb Make setup.py less chatty by default.
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 21267
diff changeset
199 str(runtime_library_dirs))
14890
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
200
13043
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
201 if output_dir is not None:
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
202 output_filename = os.path.join (output_dir, output_filename)
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
203
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
204 if self._need_link (objects, output_filename):
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
205
14890
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
206 # Figure out linker args based on type of target.
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
207 if target_desc == CCompiler.EXECUTABLE:
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
208 startup_obj = 'c0w32'
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
209 if debug:
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
210 ld_args = self.ldflags_exe_debug[:]
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
211 else:
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
212 ld_args = self.ldflags_exe[:]
13043
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
213 else:
14890
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
214 startup_obj = 'c0d32'
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
215 if debug:
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
216 ld_args = self.ldflags_shared_debug[:]
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
217 else:
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
218 ld_args = self.ldflags_shared[:]
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
219
13043
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
220
14323
460ff3cf3195 Rene Liebscher:
Greg Ward <gward@python.net>
parents: 13953
diff changeset
221 # Create a temporary exports file for use by the linker
14890
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
222 if export_symbols is None:
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
223 def_file = ''
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
224 else:
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
225 head, tail = os.path.split (output_filename)
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
226 modname, ext = os.path.splitext (tail)
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
227 temp_dir = os.path.dirname(objects[0]) # preserve tree structure
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
228 def_file = os.path.join (temp_dir, '%s.def' % modname)
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
229 contents = ['EXPORTS']
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
230 for sym in (export_symbols or []):
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
231 contents.append(' %s=_%s' % (sym, sym))
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
232 self.execute(write_file, (def_file, contents),
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
233 "writing %s" % def_file)
14323
460ff3cf3195 Rene Liebscher:
Greg Ward <gward@python.net>
parents: 13953
diff changeset
234
13802
b1a7f61ab781 Patch from Rene Liebscher. Some ugly changes, but supposedly this makes
Greg Ward <gward@python.net>
parents: 13043
diff changeset
235 # Borland C++ has problems with '/' in paths
14890
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
236 objects2 = map(os.path.normpath, objects)
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
237 # split objects in .obj and .res files
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
238 # Borland C++ needs them at different positions in the command line
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
239 objects = [startup_obj]
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
240 resources = []
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
241 for file in objects2:
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
242 (base, ext) = os.path.splitext(os.path.normcase(file))
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
243 if ext == '.res':
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
244 resources.append(file)
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
245 else:
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
246 objects.append(file)
21267
7a7f557b4d54 Whitespace normalization.
Fred Drake <fdrake@acm.org>
parents: 19318
diff changeset
247
7a7f557b4d54 Whitespace normalization.
Fred Drake <fdrake@acm.org>
parents: 19318
diff changeset
248
13802
b1a7f61ab781 Patch from Rene Liebscher. Some ugly changes, but supposedly this makes
Greg Ward <gward@python.net>
parents: 13043
diff changeset
249 for l in library_dirs:
21267
7a7f557b4d54 Whitespace normalization.
Fred Drake <fdrake@acm.org>
parents: 19318
diff changeset
250 ld_args.append("/L%s" % os.path.normpath(l))
14890
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
251 ld_args.append("/L.") # we sometimes use relative paths
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
252
21267
7a7f557b4d54 Whitespace normalization.
Fred Drake <fdrake@acm.org>
parents: 19318
diff changeset
253 # list of object files
7a7f557b4d54 Whitespace normalization.
Fred Drake <fdrake@acm.org>
parents: 19318
diff changeset
254 ld_args.extend(objects)
13043
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
255
13953
7445d99da8dd Added a whinging comment about the ugliness of constructing the BCPP
Greg Ward <gward@python.net>
parents: 13951
diff changeset
256 # XXX the command-line syntax for Borland C++ is a bit wonky;
7445d99da8dd Added a whinging comment about the ugliness of constructing the BCPP
Greg Ward <gward@python.net>
parents: 13951
diff changeset
257 # certain filenames are jammed together in one big string, but
7445d99da8dd Added a whinging comment about the ugliness of constructing the BCPP
Greg Ward <gward@python.net>
parents: 13951
diff changeset
258 # comma-delimited. This doesn't mesh too well with the
7445d99da8dd Added a whinging comment about the ugliness of constructing the BCPP
Greg Ward <gward@python.net>
parents: 13951
diff changeset
259 # Unix-centric attitude (with a DOS/Windows quoting hack) of
7445d99da8dd Added a whinging comment about the ugliness of constructing the BCPP
Greg Ward <gward@python.net>
parents: 13951
diff changeset
260 # 'spawn()', so constructing the argument list is a bit
7445d99da8dd Added a whinging comment about the ugliness of constructing the BCPP
Greg Ward <gward@python.net>
parents: 13951
diff changeset
261 # awkward. Note that doing the obvious thing and jamming all
7445d99da8dd Added a whinging comment about the ugliness of constructing the BCPP
Greg Ward <gward@python.net>
parents: 13951
diff changeset
262 # the filenames and commas into one argument would be wrong,
7445d99da8dd Added a whinging comment about the ugliness of constructing the BCPP
Greg Ward <gward@python.net>
parents: 13951
diff changeset
263 # because 'spawn()' would quote any filenames with spaces in
7445d99da8dd Added a whinging comment about the ugliness of constructing the BCPP
Greg Ward <gward@python.net>
parents: 13951
diff changeset
264 # them. Arghghh!. Apparently it works fine as coded...
7445d99da8dd Added a whinging comment about the ugliness of constructing the BCPP
Greg Ward <gward@python.net>
parents: 13951
diff changeset
265
14890
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
266 # name of dll/exe file
13802
b1a7f61ab781 Patch from Rene Liebscher. Some ugly changes, but supposedly this makes
Greg Ward <gward@python.net>
parents: 13043
diff changeset
267 ld_args.extend([',',output_filename])
21267
7a7f557b4d54 Whitespace normalization.
Fred Drake <fdrake@acm.org>
parents: 19318
diff changeset
268 # no map file and start libraries
13951
1b156ef8281b Rene Liebscher:
Greg Ward <gward@python.net>
parents: 13845
diff changeset
269 ld_args.append(',,')
13802
b1a7f61ab781 Patch from Rene Liebscher. Some ugly changes, but supposedly this makes
Greg Ward <gward@python.net>
parents: 13043
diff changeset
270
b1a7f61ab781 Patch from Rene Liebscher. Some ugly changes, but supposedly this makes
Greg Ward <gward@python.net>
parents: 13043
diff changeset
271 for lib in libraries:
21267
7a7f557b4d54 Whitespace normalization.
Fred Drake <fdrake@acm.org>
parents: 19318
diff changeset
272 # see if we find it and if there is a bcpp specific lib
14890
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
273 # (xxx_bcpp.lib)
13802
b1a7f61ab781 Patch from Rene Liebscher. Some ugly changes, but supposedly this makes
Greg Ward <gward@python.net>
parents: 13043
diff changeset
274 libfile = self.find_library_file(library_dirs, lib, debug)
b1a7f61ab781 Patch from Rene Liebscher. Some ugly changes, but supposedly this makes
Greg Ward <gward@python.net>
parents: 13043
diff changeset
275 if libfile is None:
b1a7f61ab781 Patch from Rene Liebscher. Some ugly changes, but supposedly this makes
Greg Ward <gward@python.net>
parents: 13043
diff changeset
276 ld_args.append(lib)
b1a7f61ab781 Patch from Rene Liebscher. Some ugly changes, but supposedly this makes
Greg Ward <gward@python.net>
parents: 13043
diff changeset
277 # probably a BCPP internal library -- don't warn
b1a7f61ab781 Patch from Rene Liebscher. Some ugly changes, but supposedly this makes
Greg Ward <gward@python.net>
parents: 13043
diff changeset
278 else:
b1a7f61ab781 Patch from Rene Liebscher. Some ugly changes, but supposedly this makes
Greg Ward <gward@python.net>
parents: 13043
diff changeset
279 # full name which prefers bcpp_xxx.lib over xxx.lib
b1a7f61ab781 Patch from Rene Liebscher. Some ugly changes, but supposedly this makes
Greg Ward <gward@python.net>
parents: 13043
diff changeset
280 ld_args.append(libfile)
14890
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
281
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
282 # some default libraries
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
283 ld_args.append ('import32')
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
284 ld_args.append ('cw32mt')
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
285
13802
b1a7f61ab781 Patch from Rene Liebscher. Some ugly changes, but supposedly this makes
Greg Ward <gward@python.net>
parents: 13043
diff changeset
286 # def file for export symbols
b1a7f61ab781 Patch from Rene Liebscher. Some ugly changes, but supposedly this makes
Greg Ward <gward@python.net>
parents: 13043
diff changeset
287 ld_args.extend([',',def_file])
14890
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
288 # add resource files
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
289 ld_args.append(',')
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
290 ld_args.extend(resources)
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
291
21267
7a7f557b4d54 Whitespace normalization.
Fred Drake <fdrake@acm.org>
parents: 19318
diff changeset
292
13043
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
293 if extra_preargs:
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
294 ld_args[:0] = extra_preargs
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
295 if extra_postargs:
13802
b1a7f61ab781 Patch from Rene Liebscher. Some ugly changes, but supposedly this makes
Greg Ward <gward@python.net>
parents: 13043
diff changeset
296 ld_args.extend(extra_postargs)
13043
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
297
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
298 self.mkpath (os.path.dirname (output_filename))
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
299 try:
14890
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
300 self.spawn ([self.linker] + ld_args)
13043
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
301 except DistutilsExecError, msg:
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
302 raise LinkError, msg
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
303
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
304 else:
23668
ca87119255eb Make setup.py less chatty by default.
Jeremy Hylton <jeremy@alum.mit.edu>
parents: 21267
diff changeset
305 log.debug("skipping %s (up-to-date)", output_filename)
13043
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
306
14890
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
307 # link ()
13043
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
308
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
309 # -- Miscellaneous methods -----------------------------------------
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
310
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
311
13802
b1a7f61ab781 Patch from Rene Liebscher. Some ugly changes, but supposedly this makes
Greg Ward <gward@python.net>
parents: 13043
diff changeset
312 def find_library_file (self, dirs, lib, debug=0):
13845
fc873ca0c7d3 Rewrote 'find_library_file()' much more cleanly (and consistently with
Greg Ward <gward@python.net>
parents: 13802
diff changeset
313 # List of effective library names to try, in order of preference:
14890
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
314 # xxx_bcpp.lib is better than xxx.lib
13802
b1a7f61ab781 Patch from Rene Liebscher. Some ugly changes, but supposedly this makes
Greg Ward <gward@python.net>
parents: 13043
diff changeset
315 # and xxx_d.lib is better than xxx.lib if debug is set
13845
fc873ca0c7d3 Rewrote 'find_library_file()' much more cleanly (and consistently with
Greg Ward <gward@python.net>
parents: 13802
diff changeset
316 #
14890
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
317 # The "_bcpp" suffix is to handle a Python installation for people
13845
fc873ca0c7d3 Rewrote 'find_library_file()' much more cleanly (and consistently with
Greg Ward <gward@python.net>
parents: 13802
diff changeset
318 # with multiple compilers (primarily Distutils hackers, I suspect
fc873ca0c7d3 Rewrote 'find_library_file()' much more cleanly (and consistently with
Greg Ward <gward@python.net>
parents: 13802
diff changeset
319 # ;-). The idea is they'd have one static library for each
fc873ca0c7d3 Rewrote 'find_library_file()' much more cleanly (and consistently with
Greg Ward <gward@python.net>
parents: 13802
diff changeset
320 # compiler they care about, since (almost?) every Windows compiler
fc873ca0c7d3 Rewrote 'find_library_file()' much more cleanly (and consistently with
Greg Ward <gward@python.net>
parents: 13802
diff changeset
321 # seems to have a different format for static libraries.
fc873ca0c7d3 Rewrote 'find_library_file()' much more cleanly (and consistently with
Greg Ward <gward@python.net>
parents: 13802
diff changeset
322 if debug:
fc873ca0c7d3 Rewrote 'find_library_file()' much more cleanly (and consistently with
Greg Ward <gward@python.net>
parents: 13802
diff changeset
323 dlib = (lib + "_d")
14323
460ff3cf3195 Rene Liebscher:
Greg Ward <gward@python.net>
parents: 13953
diff changeset
324 try_names = (dlib + "_bcpp", lib + "_bcpp", dlib, lib)
13845
fc873ca0c7d3 Rewrote 'find_library_file()' much more cleanly (and consistently with
Greg Ward <gward@python.net>
parents: 13802
diff changeset
325 else:
14323
460ff3cf3195 Rene Liebscher:
Greg Ward <gward@python.net>
parents: 13953
diff changeset
326 try_names = (lib + "_bcpp", lib)
13845
fc873ca0c7d3 Rewrote 'find_library_file()' much more cleanly (and consistently with
Greg Ward <gward@python.net>
parents: 13802
diff changeset
327
13043
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
328 for dir in dirs:
13845
fc873ca0c7d3 Rewrote 'find_library_file()' much more cleanly (and consistently with
Greg Ward <gward@python.net>
parents: 13802
diff changeset
329 for name in try_names:
fc873ca0c7d3 Rewrote 'find_library_file()' much more cleanly (and consistently with
Greg Ward <gward@python.net>
parents: 13802
diff changeset
330 libfile = os.path.join(dir, self.library_filename(name))
fc873ca0c7d3 Rewrote 'find_library_file()' much more cleanly (and consistently with
Greg Ward <gward@python.net>
parents: 13802
diff changeset
331 if os.path.exists(libfile):
13802
b1a7f61ab781 Patch from Rene Liebscher. Some ugly changes, but supposedly this makes
Greg Ward <gward@python.net>
parents: 13043
diff changeset
332 return libfile
13043
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
333 else:
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
334 # Oops, didn't find it in *any* of 'dirs'
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
335 return None
7df7452d13cd Lyle Johnson's interface to Borland C++, with a few editorial comments by me.
Greg Ward <gward@python.net>
parents:
diff changeset
336
14890
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
337 # overwrite the one from CCompiler to support rc and res-files
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
338 def object_filenames (self,
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
339 source_filenames,
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
340 strip_dir=0,
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
341 output_dir=''):
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
342 if output_dir is None: output_dir = ''
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
343 obj_names = []
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
344 for src_name in source_filenames:
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
345 # use normcase to make sure '.rc' is really '.rc' and not '.RC'
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
346 (base, ext) = os.path.splitext (os.path.normcase(src_name))
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
347 if ext not in (self.src_extensions + ['.rc','.res']):
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
348 raise UnknownFileError, \
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
349 "unknown file type '%s' (from '%s')" % \
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
350 (ext, src_name)
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
351 if strip_dir:
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
352 base = os.path.basename (base)
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
353 if ext == '.res':
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
354 # these can go unchanged
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
355 obj_names.append (os.path.join (output_dir, base + ext))
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
356 elif ext == '.rc':
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
357 # these need to be compiled to .res-files
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
358 obj_names.append (os.path.join (output_dir, base + '.res'))
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
359 else:
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
360 obj_names.append (os.path.join (output_dir,
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
361 base + self.obj_extension))
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
362 return obj_names
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
363
afd7ece37c46 Big patch from Rene Liebscher to simplify the CCompiler API and
Greg Ward <gward@python.net>
parents: 14323
diff changeset
364 # object_filenames ()
19318
cbaa545c788d [Patch #441691] preprocess() method for Borland C compiler.
Andrew M. Kuchling <amk@amk.ca>
parents: 19116
diff changeset
365
cbaa545c788d [Patch #441691] preprocess() method for Borland C compiler.
Andrew M. Kuchling <amk@amk.ca>
parents: 19116
diff changeset
366 def preprocess (self,
cbaa545c788d [Patch #441691] preprocess() method for Borland C compiler.
Andrew M. Kuchling <amk@amk.ca>
parents: 19116
diff changeset
367 source,
cbaa545c788d [Patch #441691] preprocess() method for Borland C compiler.
Andrew M. Kuchling <amk@amk.ca>
parents: 19116
diff changeset
368 output_file=None,
cbaa545c788d [Patch #441691] preprocess() method for Borland C compiler.
Andrew M. Kuchling <amk@amk.ca>
parents: 19116
diff changeset
369 macros=None,
cbaa545c788d [Patch #441691] preprocess() method for Borland C compiler.
Andrew M. Kuchling <amk@amk.ca>
parents: 19116
diff changeset
370 include_dirs=None,
cbaa545c788d [Patch #441691] preprocess() method for Borland C compiler.
Andrew M. Kuchling <amk@amk.ca>
parents: 19116
diff changeset
371 extra_preargs=None,
cbaa545c788d [Patch #441691] preprocess() method for Borland C compiler.
Andrew M. Kuchling <amk@amk.ca>
parents: 19116
diff changeset
372 extra_postargs=None):
cbaa545c788d [Patch #441691] preprocess() method for Borland C compiler.
Andrew M. Kuchling <amk@amk.ca>
parents: 19116
diff changeset
373
cbaa545c788d [Patch #441691] preprocess() method for Borland C compiler.
Andrew M. Kuchling <amk@amk.ca>
parents: 19116
diff changeset
374 (_, macros, include_dirs) = \
cbaa545c788d [Patch #441691] preprocess() method for Borland C compiler.
Andrew M. Kuchling <amk@amk.ca>
parents: 19116
diff changeset
375 self._fix_compile_args(None, macros, include_dirs)
cbaa545c788d [Patch #441691] preprocess() method for Borland C compiler.
Andrew M. Kuchling <amk@amk.ca>
parents: 19116
diff changeset
376 pp_opts = gen_preprocess_options(macros, include_dirs)
cbaa545c788d [Patch #441691] preprocess() method for Borland C compiler.
Andrew M. Kuchling <amk@amk.ca>
parents: 19116
diff changeset
377 pp_args = ['cpp32.exe'] + pp_opts
cbaa545c788d [Patch #441691] preprocess() method for Borland C compiler.
Andrew M. Kuchling <amk@amk.ca>
parents: 19116
diff changeset
378 if output_file is not None:
cbaa545c788d [Patch #441691] preprocess() method for Borland C compiler.
Andrew M. Kuchling <amk@amk.ca>
parents: 19116
diff changeset
379 pp_args.append('-o' + output_file)
cbaa545c788d [Patch #441691] preprocess() method for Borland C compiler.
Andrew M. Kuchling <amk@amk.ca>
parents: 19116
diff changeset
380 if extra_preargs:
cbaa545c788d [Patch #441691] preprocess() method for Borland C compiler.
Andrew M. Kuchling <amk@amk.ca>
parents: 19116
diff changeset
381 pp_args[:0] = extra_preargs
cbaa545c788d [Patch #441691] preprocess() method for Borland C compiler.
Andrew M. Kuchling <amk@amk.ca>
parents: 19116
diff changeset
382 if extra_postargs:
cbaa545c788d [Patch #441691] preprocess() method for Borland C compiler.
Andrew M. Kuchling <amk@amk.ca>
parents: 19116
diff changeset
383 pp_args.extend(extra_postargs)
cbaa545c788d [Patch #441691] preprocess() method for Borland C compiler.
Andrew M. Kuchling <amk@amk.ca>
parents: 19116
diff changeset
384 pp_args.append(source)
cbaa545c788d [Patch #441691] preprocess() method for Borland C compiler.
Andrew M. Kuchling <amk@amk.ca>
parents: 19116
diff changeset
385
cbaa545c788d [Patch #441691] preprocess() method for Borland C compiler.
Andrew M. Kuchling <amk@amk.ca>
parents: 19116
diff changeset
386 # We need to preprocess: either we're being forced to, or the
cbaa545c788d [Patch #441691] preprocess() method for Borland C compiler.
Andrew M. Kuchling <amk@amk.ca>
parents: 19116
diff changeset
387 # source file is newer than the target (or the target doesn't
cbaa545c788d [Patch #441691] preprocess() method for Borland C compiler.
Andrew M. Kuchling <amk@amk.ca>
parents: 19116
diff changeset
388 # exist).
cbaa545c788d [Patch #441691] preprocess() method for Borland C compiler.
Andrew M. Kuchling <amk@amk.ca>
parents: 19116
diff changeset
389 if self.force or output_file is None or newer(source, output_file):
cbaa545c788d [Patch #441691] preprocess() method for Borland C compiler.
Andrew M. Kuchling <amk@amk.ca>
parents: 19116
diff changeset
390 if output_file:
cbaa545c788d [Patch #441691] preprocess() method for Borland C compiler.
Andrew M. Kuchling <amk@amk.ca>
parents: 19116
diff changeset
391 self.mkpath(os.path.dirname(output_file))
cbaa545c788d [Patch #441691] preprocess() method for Borland C compiler.
Andrew M. Kuchling <amk@amk.ca>
parents: 19116
diff changeset
392 try:
cbaa545c788d [Patch #441691] preprocess() method for Borland C compiler.
Andrew M. Kuchling <amk@amk.ca>
parents: 19116
diff changeset
393 self.spawn(pp_args)
cbaa545c788d [Patch #441691] preprocess() method for Borland C compiler.
Andrew M. Kuchling <amk@amk.ca>
parents: 19116
diff changeset
394 except DistutilsExecError, msg:
cbaa545c788d [Patch #441691] preprocess() method for Borland C compiler.
Andrew M. Kuchling <amk@amk.ca>
parents: 19116
diff changeset
395 print msg
cbaa545c788d [Patch #441691] preprocess() method for Borland C compiler.
Andrew M. Kuchling <amk@amk.ca>
parents: 19116
diff changeset
396 raise CompileError, msg
cbaa545c788d [Patch #441691] preprocess() method for Borland C compiler.
Andrew M. Kuchling <amk@amk.ca>
parents: 19116
diff changeset
397
cbaa545c788d [Patch #441691] preprocess() method for Borland C compiler.
Andrew M. Kuchling <amk@amk.ca>
parents: 19116
diff changeset
398 # preprocess()