Commit Graph

41 Commits

Author SHA1 Message Date
Greg Ward 5322f008c5 Overhauled to expect 'self.extensions' (taken from 'ext_modules' in the
setup script) to be a list of Extension instances, rather than a list of of
(ext_name, build_info) tuples.  This is mostly a simplification, but
'check_extension_list()' got a lot more complicated because of the need to
convert the old-style tuples to Extension instances.

Temporarily dropped support for defining/undefining macros in the
'extensions' list -- I want to change the interface, but haven't yet made
the required changes in CCompiler and friends to support this nicely.

Also neatened up the code that merges 'extra_compile_flags' and the CFLAGS
environment variable.
2000-05-31 01:09:52 +00:00
Greg Ward 4fb29e55f8 Some far-reaching naming changes:
* Command method 'find_peer()' -> 'get_finalized_command()'
  * Command method 'run_peer()' -> 'run_command()'
Also deleted the 'get_command_option()' method from Command, and
  fixed the one place where it was used (in "bdist_dumb").
2000-05-27 17:27:23 +00:00
Greg Ward 521340034e Rene Liebscher: check if the extension file (.so or .pyd) is
up-to-date with respect to the source files; that way, we
don't needlessly rebuild just because object files go away.
2000-05-26 01:31:53 +00:00
Greg Ward fcd974efbb Normalized all the end-of-class lines. 2000-05-25 01:10:04 +00:00
Gregory P. Smith b5ebe5d640 Harry Henry Gebel: get extra compiler flags from the CFLAGS environment
variable.

(Is this really needed?  Can we drop it when the config file mechanism
allows users to set compiler flags in setup.cfg?)
2000-05-13 01:52:14 +00:00
Gregory P. Smith de5c953a2b From Lyle Johnson: renamed 'implib_dir' to 'implib_file', and
correctly ensure that it's 'dirname' exists.
2000-05-13 01:35:33 +00:00
Gregory P. Smith 6cd0c43366 Fix from Lyle Johnson: add the '--compiler' option.
Also added creation of 'implib_dir', a temporary directory specific to
  MSVC++ -- but I checked in two ways of fixing it (Lyle's and mine),
  because I'm not sure which is right.
2000-05-12 00:34:12 +00:00
Greg Ward 1500374667 Added comment about the MSVC-specific kludge. 2000-05-09 01:50:41 +00:00
Greg Ward 18856b80e2 Added the ability to sneak extra flags onto the C compiler command line
via an 'extra_compile_args' option in the 'build_info' dictionary.
2000-05-06 13:12:59 +00:00
Greg Ward 02a1a2b077 Cleaned up/simplified error-handling:
- DistutilsOptionError is now documented as it's actually used, ie.
    to indicate bogus option values (usually user options, eg. from
    the command-line)
  - added DistutilsSetupError to indicate errors that definitely arise
    in the setup script
  - got rid of DistutilsValueError, and changed all usage of it to
    either DistutilsSetupError or ValueError as appropriate
  - simplified a bunch of option get/set methods in Command and
    Distribution classes -- just pass on AttributeError most of
    the time, rather than turning it into something else
2000-04-15 22:15:07 +00:00
Greg Ward 1561ae13b6 Use 'get_python_inc()' to figure out the Python include directories
rather than cobbling them togethere here.
2000-04-14 00:50:49 +00:00
Greg Ward c41d6b35a9 Added '--force' option -- very clear what it means for building (ignore
timestamps), so every build_* command has 'self.force', which follows the
'build' command if not set by the user.
2000-04-10 00:19:42 +00:00
Greg Ward 842296480e Patch (mostly) from Thomas Heller for building on Windows:
* build to "Debug" or "Release" temp directory
  * put linker turds (.lib and .exp files) in the build temp directory
  * tack on "_d" to extensions built with debugging
  * added 'get_ext_libname()' help in putting linker turds to temp dir
Also, moved the code that simplifies None to empty list for a bunch
  of options to 'finalize_options()' instead of 'run()'.
2000-03-31 03:50:23 +00:00
Greg Ward 71d55835b3 Oops: 'build_extensions()' no longer takes an 'extensions' list. 2000-03-30 19:47:22 +00:00
Greg Ward 1d16a9f040 Put the Python "system" include dir last, rather than first. 2000-03-29 04:13:49 +00:00
Greg Ward 4d16e0ac20 Added 'get_outputs()' in prepartion for the 'bdist' command.
Changed signature of 'build_extensions()': no longer takes the extension
  list, but uses 'self.extensions' (just like 'get_outputs()' has to)
Moved call to 'check_extensions_list()' from 'run()' to 'build_extensions()',
  again for consistency with 'get_outputs()'.
2000-03-29 02:13:09 +00:00
Greg Ward cdb20ba56d Fixed a bunch of screwed-up logic and inconsistent terminology.
Fixed 'build_extensions()' to pay attention to the 'rpath' element of the
  'build_info' dictionary.
2000-03-26 21:45:14 +00:00
Greg Ward 4620f306a4 Took out what looks like old debugging code that probably should never
have been checked in: was passing the PLAT environment variable as the
'plat' argument to 'new_compiler()'.
2000-03-22 00:11:21 +00:00
Greg Ward dedd5b5ed2 In 'finalize_options()': if 'self.libs' is a string, make it a singleton list. 2000-03-18 15:21:03 +00:00
Greg Ward 4ba5da418c Don't pass 'keep_dir' to 'compile()' method of CCompiler -- no longer used.
Don't assume that the 'libraries' and 'library_dirs' elements of the
  build info dict are always lists.
2000-03-06 03:36:50 +00:00
Greg Ward 76ec0d6d76 Renamed 'build_lib' command to 'build_clib':
* replaced build_lib.py with build_clib.py
  * renamed the class in build_clib.py
  * changed all references to 'build_lib' command in other command classes
2000-03-02 01:57:12 +00:00
Greg Ward 3ce77fd05e Changed '__rcsid__' to '__revision__'. 2000-03-02 01:49:45 +00:00
Greg Ward 60f64330d1 If the "build_lib" command built any C libraries, link with them all
when building extensions (uses build_lib's 'get_library_names()' method).
Ensure that the relative structure of source filenames is preserved in
  the temporary build tree, eg. foo/bar.c compiles to
  build/temp.<plat>/foo/bar.o.
2000-03-02 01:32:21 +00:00
Greg Ward e51d69efb0 Build reorg:
* 'build_dir' -> 'build_lib', which by default takes its value
    straight from 'build_lib' in the 'build' command
  * added 'build_temp' and 'inplace' options
  * change 'build_extensions()' to put object files (compiler turds) in
    'build_temp' dir
  * complicated the name-of-extension-file shenanigans in
    'build_extensions()' to support "in-place" extension building, i.e.
    put the extension right into the source tree (handy for developers)
  * added 'get_ext_fullname()', renamed 'extension_filename()' to
    'get_ext_filename()', and tweaked the latter a bit -- all to support
    the new filename shenanigans
2000-03-01 01:43:28 +00:00
Greg Ward e01149cbe8 Renamed 'set_default_options()' to 'initialize_options()', and
'set_final_options()' to 'finalize_options()'.
2000-02-18 00:35:22 +00:00
Greg Ward bbeceeaf9a Renamed all 'options' class attributes to 'user_options'. 2000-02-18 00:25:39 +00:00
Greg Ward 1993f9ad0e Renamed all command classes so they're exactly the same as the name of the
command itself: no more of this "FooBar class for foo_bar command"
silliness.
2000-02-18 00:13:53 +00:00
Greg Ward 968d883be5 Path from Thomas Heller: resurrect the .def file kludge while preserving the
/export option mini-kludge.
2000-02-10 02:17:06 +00:00
Greg Ward e8c6ce4684 Added 'debug' option, and changed compile/link calls to use it. 2000-02-09 02:20:14 +00:00
Greg Ward f0219ba290 Ditch .def file kludge for (much smaller) /export option kludge. 2000-02-08 02:37:15 +00:00
Greg Ward c1854673e2 Tweaked various comments, docstrings, and error messages. 2000-02-05 02:23:16 +00:00
Greg Ward 7f0fb0b01e Improved an error message.
Announce when we start building each extension (better feedback).
2000-02-03 23:07:54 +00:00
Greg Ward 37bc815053 Added 'description' class attribute to every command class (to help the
'--help-commands' option).
Shuffled imports around in a few command modules to avoid expensive
  up-front import of sysconfig (and resulting delays in generating list
  of all commands).
2000-01-30 18:34:15 +00:00
Greg Ward 48697d931b Changed 'build_extensions()' so 'sources' can be a list or tuple; and
call CCompiler method 'compile()' with 'include_dirs' not 'includes'.
Fixed stupid typo in 'get_source_files()'.
1999-12-12 17:01:01 +00:00
Greg Ward 3c6204a87f Pass 'force' flag to 'new_compiler()'. 1999-10-03 21:08:42 +00:00
Greg Ward a6cb8ae7bc Added 'package' option.
Catch up with renamed 'platdir' -> 'build_platlib' option in 'build'.
Don't call 'set_final_options()' in 'run()' anymore -- that's now
  guaranteed to be taken care of for us by the Distribution instance.
If 'include_dirs' is a string, split it on os.pathsep (this is half-
  hearted -- support for setting compile/link options on the command
  line is totally lame and probably won't work at all).
Added 'get_source_files()' for use by 'dist' command.
Added code to 'build_extensions()' to figure out the "def file" to use
  with MSVC++ and add it to the linker command line as an "extra_postarg".
1999-09-29 12:49:35 +00:00
Greg Ward dbb96253ea Some option changes:
- rename 'dir' to 'build_dir'
  - take 'package' from distribution option 'ext_package'
  - take 'extensions' from distribution option 'ext_modules'
  - take 'include_dirs' from distribution
Name keyword args explictly when calling CCompiler methods.
Overhauled how we generate extension filenames (in 'extension_filename()
  and 'build_extension()') to take 'package' option into account.
1999-09-21 18:27:12 +00:00
Greg Ward 609a5c818d Added support for 'package' option, including where to link the
actual extension module to.
1999-09-13 13:55:34 +00:00
Greg Ward 71eb8644d7 Changed to reflect the new "command options" regime -- in particular,
we no longer explicitly pull distribution options out of our Distribution
object, but rather let the Distribution put them into the command object.
1999-09-08 02:42:30 +00:00
Greg Ward 2f1b5bb905 Patch from Perry Stoll: pass 'build_info' to link method. 1999-08-29 18:18:26 +00:00
Greg Ward e393ddb2e0 Implements the 'build_ext' command for building C/C++ extension modules. 1999-08-14 23:57:49 +00:00