summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/ccompiler.py
Commit message (Collapse)AuthorAgeFilesLines
* new method: has_function() - returns a boolean indicating whether theSkip Montanaro2003-04-241-0/+45
| | | | argument function is available on the current platform
* [Bug #668662] Patch from Pearu Pearson: if a C source file isAndrew M. Kuchling2003-02-261-0/+2
| | | | | | | specified with an absolute path, the object file is also written to an absolute path. The patch drops the drive and leading '/' from the source path, so a path like /path/to/foo.c results in an object file like build/temp.i686linux/path/to/foo.o.
* Bug #599248: strip directories when building Python. Out-of-tree builds ↵Andrew M. Kuchling2002-12-291-2/+5
| | | | should work again.
* Add comment to Distutil files about requiring 1.5.2 compatibility, asAndrew M. Kuchling2002-11-191-0/+2
| | | | suggested by PEP 291.
* Remove 'created by' lines; people can use CVS for this, and the information ↵Andrew M. Kuchling2002-11-141-2/+0
| | | | is often out of date
* [Bug #599248] ext module generation problemAndrew M. Kuchling2002-11-141-2/+2
| | | | | | | | | | If you have source files srcdir1/foo.c and srcdir2/foo.c, the temporary .o for both files is written to build/temp.<platform>/foo.o. This patch sets strip_dir to false for both calls to object_filename, so now the object files are written to temp.<platform>/srcdir1/foo.o and .../srcdir2/foo.o. 2.2 bugfix candidate
* Repair inconsistent use of tabs and spaces.Jeremy Hylton2002-11-051-1/+1
|
* This patch fixes the following bugs:Gustavo Niemeyer2002-11-051-8/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [#413582] g++ must be called for c++ extensions [#454030] distutils cannot link C++ code with GCC topdir = "Lib/distutils" * bcppcompiler.py (BCPPCompiler.create_static_lib): Fixed prototype, removing extra_preargs and extra_postargs parameters. Included target_lang parameter. (BCPPCompiler.link): Included target_lang parameter. * msvccompiler.py (MSVCCompiler.create_static_lib): Fixed prototype, removing extra_preargs and extra_postargs parameters. Included target_lang parameter. (MSVCCompiler.link): Included target_lang parameter. * ccompiler.py (CCompiler): New language_map and language_order attributes, used by CCompiler.detect_language(). (CCompiler.detect_language): New method, will return the language of a given source, or list of sources. Individual source language is detected using the language_map dict. When mixed sources are used, language_order will stablish the language precedence. (CCompiler.create_static_lib, CCompiler.link, CCompiler.link_executable, CCompiler.link_shared_object, CCompiler.link_shared_lib): Inlcuded target_lang parameter. * cygwinccompiler.py (CygwinCCompiler.link): Included target_lang parameter. * emxccompiler.py (EMXCCompiler.link): Included target_lang parameter. * mwerkscompiler.py (MWerksCompiler.link): Included target_lang parameter. * extension.py (Extension.__init__): New 'language' parameter/attribute, initialized to None by default. If provided will overlap the automatic detection made by CCompiler.detect_language(), in build_ext command. * sysconfig.py (customize_compiler): Check Makefile for CXX option, and also the environment variable CXX. Use the resulting value in the 'compiler_cxx' parameter of compiler.set_executables(). * unixccompiler.py (UnixCCompiler): Included 'compiler_cxx' in executables dict, defaulting to 'cc'. (UnixCCompiler.create_static_lib): Included target_lang parameter. (UnixCCompiler.link): Included target_lang parameter, and made linker command use compiler_cxx, if target_lang is 'c++'. * command/build_ext.py (build_ext.build_extension): Pass new ext.language attribute to compiler.link_shared_object()'s target_lang parameter. If ext.language is not provided, detect language using compiler.detect_language(sources) instead. * command/config.py (config._link): Pass already available lang parameter as target_lang parameter of compiler.link_executable().
* save the verbose argument as an instance attributes. Subclasses ofSkip Montanaro2002-10-011-0/+1
| | | | | CCompiler may rely on the presence of self.verbose (SciPy's distutils appears to).
* Commit fix for SF 603831.Guido van Rossum2002-10-011-1/+2
| | | | | | | | | | | | Strangely, two out of three patches there seem already committed; but the essential one (get rid of the assert in object_filenames in ccompiler.py) was not yet applied. This makes the build procedure for Twisted work again. This is *not* a backport candidate despite the fact that identical code appears to exist in 2.2.2; Twisted builds fine there, so there must have been a change elsewhere.
* Use distutils.debug.DEBUG instead of distutils.core.DEBUG.Jeremy Hylton2002-09-111-1/+1
| | | | | Note that distutils.core.DEBUG still works if client code uses it, but the core code avoids circular references by using distutils.debug.
* Add a default implementation of compile() to the base class.Jeremy Hylton2002-06-181-1/+20
| | | | | | | The default implementation calls _compile() to compile individual files. This method must be implemented by the subclass. This change factors out most of the remaining common code in all the compilers except mwerks.
* Extend compiler() method with optional depends argument.Jeremy Hylton2002-06-131-74/+168
| | | | | | | | | | | | This change is not backwards compatible. If a compiler subclass exists outside the distutils package, it may get called with the unexpected keyword arg. It's easy to extend that compiler by having it ignore the argument, and not much harder to do the right thing. If this ends up being burdensome, we can change it before 2.3 final to work harder at compatibility. Also add _setup_compile() and _get_cc_args() helper functions that factor out much of the boilerplate for each concrete compiler class.
* Make setup.py less chatty by default.Jeremy Hylton2002-06-041-9/+10
| | | | | | | | | | | | | | | This is a conservative version of SF patch 504889. It uses the log module instead of calling print in various places, and it ignores the verbose argument passed to many functions and set as an attribute on some objects. Instead, it uses the verbosity set on the logger via the command line. The log module is now preferred over announce() and warn() methods that exist only for backwards compatibility. XXX This checkin changes a lot of modules that have no test suite and aren't exercised by the Python build process. It will need substantial testing.
* Fix trivial typo.Thomas Heller2002-04-251-1/+1
|
* OS/2 patches by Andrew I MacIntyre for distutils.Marc-André Lemburg2002-01-311-0/+3
| | | | Closes patch #435381.
* Whitespace normalization.Fred Drake2001-12-061-17/+17
|
* Patch by Bill Noon: added 'dylib' as a library type along withJack Jansen2001-08-271-2/+2
| | | | | 'static' and 'shared'. This fixes extension building for dynamic Pythons on MacOSX.
* Patch #403947: On Cygwin, use the Unix compiler class, and notAndrew M. Kuchling2001-02-271-1/+4
| | | | | | | | | | the Cygwin-specific compiler class. (According to Jason Tishler, cygwinccompiler needs some work to handle the differences in Cygwin- and MSVC-Python. Makefile and config files are currently ignored by cygwinccompiler, as it was written to support cygwin for extensions which are intended to be used with the standard MSVC built Python.)
* This patch makes the default compiler determination more flexibleMarc-André Lemburg2001-02-191-8/+40
| | | | | | | | | | | | and also takes the sys.platform name into account. This helps on platforms where there are multiple possible compiler backends (the one with which Python itself was compiled is preferred over others in this case). The patch uses this new technique to enable using cygwin compiler per default for cygwin compiled Pythons. Written by Marc-Andre Lemburg. Copyright assigned to Guido van Rossum.
* Add strip_dir argument to the single call to .object_filenames(), toAndrew M. Kuchling2001-01-161-0/+1
| | | | | prevent creating files such as build/lib.whatever/Modules/foo.o when given a source filename such as Modules/foo.c.
* Fix from Jack Jansen for the Mac and the Metrowerks compiler, postedAndrew M. Kuchling2001-01-151-0/+3
| | | | | to the Distutils-SIG and archived at http://mail.python.org/pipermail/distutils-sig/2000-November/001755.html
* Remove deprecation warnings on old 'link_*()' methods, ie. they're notGreg Ward2000-09-271-11/+5
| | | | | deprecated after all. But now they're only implemented once, instead of N times.
* Big patch from Rene Liebscher to simplify the CCompiler API andGreg Ward2000-09-271-39/+72
| | | | | | | | | | | | | | | | | | | | implementations. Details: * replace 'link_shared_object()', 'link_shared_lib()', and 'link_executable()' with 'link()', which is (roughly) the union of the three methods it replaces * in all implementation classes (UnixCCompiler, MSVCCompiler, etc.), ditch the old 'link_*()' methods and replace them with 'link()' * in the abstract base class (CCompiler), add the old 'link_*()' methods as wrappers around the new 'link()' (they also print a warning of the deprecated interface) Also increases consistency between MSVCCompiler and BCPPCompiler, hopefully to make it easier to factor out the mythical WindowsCCompiler class. Details: * use 'self.linker' instead of 'self.link' * add ability to compile resource files to BCPPCompiler * added (redundant?) 'object_filename()' method to BCPPCompiler * only generate a .def file if 'export_symbols' defined
* Added 'debug_print()'.Greg Ward2000-08-041-0/+5
|
* Added 'debug' flag to 'find_library_file()'.Greg Ward2000-08-041-3/+5
|
* Added 'execute()' method, a thin wrapper around 'util.execute() (just likeGreg Ward2000-08-021-1/+4
| | | | the one in cmd.py).
* Fixed a grab-bag of typos spotted by Rob Hooft.Greg Ward2000-07-271-1/+1
|
* fix inconsistent use of tabs and spacesJeremy Hylton2000-07-071-1/+1
|
* Lyle Johnson: added 'build_temp' parameter to 'link_shared_{lib,object}()'Greg Ward2000-06-281-4/+6
| | | | | | | methods (but not 'link_executable()', hmmm). Currently only used by BCPPCompiler; it's a dummy parameter for UnixCCompiler and MSVCCompiler. Also added 'bcpp' to compiler table used by 'new_compiler()'.
* Introduced some bureaucracy for setting and tracking the executablesGreg Ward2000-06-251-3/+58
| | | | | | | | | | | that a particular compiler system depends on. This consists of the 'set_executables()' and 'set_executable()' methods, and a few lines in the constructor that expect implementation classes to provide an 'executables' attribute, which we use to initialize several instance attributes. The default implementation is somewhat biased in favour of a Unix/DOS "command-line" view of the world, but it shouldn't be too hard to override this for operating systems with a more sophisticated way of representing programs-to-execute.
* Docstring reformatting/tweaking binge.Greg Ward2000-06-241-249/+253
| | | | Fixed a few comments.
* Changed 'object_filenames()' to raise exception instead of silently carryingGreg Ward2000-06-241-1/+3
| | | | on if it sees a filename with unknown extension.
* Stylistic/formatting changes to Rene Liebscher's '--help-xxx' patch.Greg Ward2000-06-241-10/+20
|
* Added 'preprocess()' method to CCompiler interface, and implementedGreg Ward2000-06-211-0/+16
| | | | | | it in UnixCCompiler. Still needs to be implemented in MSVCCompiler (and whatever other compiler classes are lurking out there, waiting to be checked in).
* Patch from Rene Liebscher: this adds "--help-foo" options to list theGreg Ward2000-06-071-3/+15
| | | | | | | | | | values that "--foo" can take for various commands: eg. what formats for "sdist" and "bdist", what compilers for "build_ext" and "build_clib". I have *not* reviewed this patch; I'm checking it in as-is because it also fixes a paper-bag-over-head bug in bdist.py, and because I won't have time to review it properly for several days: so someone else can test it for me, instead!
* Removed exceptions -- now in errors.py to avoid expensive import of ccompiler.Greg Ward2000-05-301-16/+0
|
* Changed to catch compile/link failures and raise CompileError, LibError,Greg Ward2000-05-301-5/+31
| | | | or LinkError (exception classes defined in ccompiler.py).
* Lyle Johnson: added stubs for the four miscellaneous methods that must beGreg Ward2000-05-201-0/+27
| | | | implemented by subclasses, since they are needed by 'gen_lib_options()'.
* Added support for the 'export_symbols' parameter to 'link_shared_object()'Greg Ward2000-05-201-1/+9
| | | | | | and 'link_shared_lib()'. In MSVCCompiler, this is meaningful: it adds /EXPORT: options to the linker command line. In UnixCCompiler, it is ignored.
* Added 'runtime_library_dirs' parameter to 'link_*()' methods.Greg Ward2000-03-261-28/+43
| | | | | | Split '_fix_link_args()' up into '_fix_object_args()' (for use of 'create_static_lib() and link methods) and '_fix_lib_args()' (for the link methods only).
* Changed to pay attention to the 'runtime_library_dirs' list (= 'rpath'Greg Ward2000-03-181-1/+4
| | | | | | | | | | option in the 'build_ext' command): * in ccompiler.py: 'gen_lib_options()' now takes 'runtime_library_dirs' parameter * in unixccompiler.py and msvccompiler.py: now pass 'self.runtime_library_dirs' to 'gen_lib_options()', and define 'runtime_library_dir_option()' (although in msvccompiler.py it blows up with a DistutilsPlatformError right now!)
* Renamed 'link_static_lib() to 'create_static_lib()'.Greg Ward2000-03-101-12/+13
|
* Serious overhaul of the C compiler interface and the two classes thatGreg Ward2000-03-061-47/+243
| | | | | | | | | | | | implement it (so far): * moved filename generation methods into CCompiler base class, driven by data supplied by implementation classes * moved a bunch of common code from UnixCCompiler to convenience methods in CCompiler * overhauled MSVCCompiler's compile/link methods to look and act as much as possible like UnixCCompiler's, in order to regularize both interface and behaviour (especially by using those new convenience methods)
* Changed '__rcsid__' to '__revision__'.Greg Ward2000-03-021-1/+1
|
* Added 'mkpath()' method: convenience wrapper around 'util.mkpath()' that addsGreg Ward2000-03-011-1/+4
| | | | the compiler objects 'verbose' and 'dry_run' flags.
* Added 'debug' flag to compile and link method signatures.Greg Ward2000-02-091-23/+43
| | | | | Doc fix: several paragraphs under 'link_static_lib()' moved to 'link_shared_lib()', where they belong.
* Removed a bunch of irrelevant parameters from 'link_static_lib()' signature.Greg Ward2000-01-091-8/+18
| | | | Added 'link_executable()' signature.
* Catch up with terminology change in UnixCCompiler: 'includes' -> 'include_dirs'.Greg Ward1999-12-121-6/+6
|
* Slight change to the meaning of the 'libraries' list: if a library nameGreg Ward1999-10-031-14/+37
| | | | | | | | | | | | has a directory component, then we only search for the library in that one directory, ie. ignore the 'library_dirs' lists for that one library. Changed calling convention to 'gen_lib_options()' again: now, it takes a CCompiler instance and calls methods on it instead of taking format strings. Also implemented the new "library name" semantics using the 'find_library_file()' method in the CCompiler instance. Added 'force' flag to CCompiler; added to constructor and 'new_compiler()'. Added 'warn()' method.