Patches for --compiler option
All, Listed below are patches for the build, build_clib and build_ext commands to support a new option "--compiler=compiler_type". This is a prerequisite for supporting compiler types other than the default (and specifically, supporting Borland's compiler on Windows). These patches are against the latest CVS version of the distutils. Lyle Index: distutils/command/build.py =================================================================== RCS file: /projects/cvsroot/distutils/distutils/command/build.py,v retrieving revision 1.17 diff -a -u -r1.17 build.py --- build.py 2000/04/10 01:31:58 1.17 +++ build.py 2000/05/11 20:43:38 @@ -26,10 +26,12 @@ "build-purelib or build-platlib"), ('build-temp=', 't', "temporary build directory"), + ('compiler=', 'c', + "specify the compiler type"), ('debug', 'g', "compile extensions and libraries with debugging information"), ('force', 'f', - "forcibly build everything (ignore file timestamps"), + "forcibly build everything (ignore file timestamps)"), ] def initialize_options (self): @@ -40,6 +42,7 @@ self.build_platlib = None self.build_lib = None self.build_temp = None + self.compiler = None self.debug = None self.force = 0 Index: distutils/command/build_clib.py =================================================================== RCS file: /projects/cvsroot/distutils/distutils/command/build_clib.py,v retrieving revision 1.13 diff -a -u -r1.13 build_clib.py --- build_clib.py 2000/04/15 22:15:07 1.13 +++ build_clib.py 2000/05/11 20:43:39 @@ -38,7 +38,9 @@ ('debug', 'g', "compile with debugging information"), ('force', 'f', - "forcibly build everything (ignore file timestamps"), + "forcibly build everything (ignore file timestamps)"), + ('compiler=', 'c', + "specify the compiler type"), ] def initialize_options (self): @@ -54,6 +56,7 @@ self.undef = None self.debug = None self.force = 0 + self.compiler = None # initialize_options() @@ -68,6 +71,7 @@ self.set_undefined_options ('build', ('build_temp', 'build_clib'), ('build_temp', 'build_temp'), + ('compiler', 'compiler'), ('debug', 'debug'), ('force', 'force')) @@ -93,9 +97,11 @@ return # Yech -- this is cut 'n pasted from build_ext.py! - self.compiler = new_compiler (verbose=self.verbose, + self.compiler = new_compiler (compiler=self.compiler, + verbose=self.verbose, dry_run=self.dry_run, force=self.force) + if self.include_dirs is not None: self.compiler.set_include_dirs (self.include_dirs) if self.define is not None: Index: distutils/command/build_ext.py =================================================================== RCS file: /projects/cvsroot/distutils/distutils/command/build_ext.py,v retrieving revision 1.34 diff -a -u -r1.34 build_ext.py --- build_ext.py 2000/05/09 01:50:41 1.34 +++ build_ext.py 2000/05/11 20:43:39 @@ -67,7 +67,9 @@ ('debug', 'g', "compile/link with debugging information"), ('force', 'f', - "forcibly build everything (ignore file timestamps"), + "forcibly build everything (ignore file timestamps)"), + ('compiler=', 'c', + "specify the compiler type"), ] @@ -87,6 +89,7 @@ self.link_objects = None self.debug = None self.force = None + self.compiler = None def finalize_options (self): @@ -95,6 +98,7 @@ self.set_undefined_options ('build', ('build_lib', 'build_lib'), ('build_temp', 'build_temp'), + ('compiler', 'compiler'), ('debug', 'debug'), ('force', 'force')) @@ -169,7 +173,8 @@ # Setup the CCompiler object that we'll use to do all the # compiling and linking - self.compiler = new_compiler (verbose=self.verbose, + self.compiler = new_compiler (compiler=self.compiler, + verbose=self.verbose, dry_run=self.dry_run, force=self.force) @@ -340,6 +345,7 @@ implib_dir = os.path.join(self.build_temp,\ self.get_ext_libname(extension_name)) extra_args.append ('/IMPLIB:' + implib_dir) + self.mkpath (os.path.dirname(implib_dir)) # if MSVC fullname = self.get_ext_fullname (extension_name)
participants (1)
-
Lyle Johnson