Commit Graph

226 Commits

Author SHA1 Message Date
Greg Ward 855dab9987 Added 'include_dirs' parameters all over the place.
Added 'check_lib()', which provides a subset of the functionality of
  'check_func()' with a simpler interface and implementation.
2000-06-27 01:21:22 +00:00
Greg Ward e401e15d18 Removed some debugging code that slipped into the last checkin.
Ensure that 'extra_args' (whether compile or link args) is never None.
2000-06-25 02:30:15 +00:00
Greg Ward f46a688e84 Fixed the "pre-link hook" so it actually works, mainly by renaming it
to 'msvc_prelink_hack()', adding the parameters that it actually needs,
and only calling it for MSVC compiler objects.  Generally gave up on the
idea of a general "hook" mechanism: deleted the empty 'precompile_hook()'.
2000-06-25 02:23:11 +00:00
Greg Ward eab969d700 Call 'customize_compiler()' after getting CCompiler object. 2000-06-25 02:10:58 +00:00
Greg Ward 5ca84b83c7 Fixed a few silly bugs in my SWIG support code. (Hey, I said it was
experimental and untested.)
Call 'customize_compiler()' after getting CCompiler object.
2000-06-25 02:10:46 +00:00
Greg Ward c3f364462f Print a warning if we install a data file right in install_dir.
Tweaked help text.
2000-06-24 17:36:24 +00:00
Greg Ward fa2f4b6d8e Changed the default installation directory for data files (used by
the "install_data" command to the installation base, which is usually just
sys.prefix.  (Any setup scripts out there that specify data files will have
to set the installation directory, relative to the base, explicitly.)
2000-06-24 17:22:39 +00:00
Greg Ward 3459381e2a Changed so all the help-generating functions are defined, at module-level,
in the module of the command classes that have command-specific
help options.  This lets us keep the principle of lazily importing
the ccompiler module, and also gets away from defining non-methods
at class level.
2000-06-24 01:23:37 +00:00
Greg Ward 2ff7887270 Stylistic/formatting changes to Rene Liebscher's '--help-xxx' patch. 2000-06-24 00:23:20 +00:00
Greg Ward ffcaf2dd72 Experimental, completely untested SWIG support. 2000-06-24 00:19:35 +00:00
Greg Ward b2db0eb695 Fix inspired by Rene Liebscher: if setup script is newer than the
manifest, regenerate the manifest.
2000-06-21 03:29:57 +00:00
Greg Ward f6451c46d7 Delete spurious comment. 2000-06-21 03:14:27 +00:00
Greg Ward afc224beec Build the 'outfiles' list so 'get_outputs()' has something to return.
(Bug spotted and originally fixed by Rene Liebscher; fix redone by me.)
2000-06-21 03:13:51 +00:00
Greg Ward e2383a6c77 Rene Liebscher: when fixing up directories with an alternate root, include
'install_headers'.
2000-06-21 03:09:02 +00:00
Greg Ward 59ac7091a7 Fleshed out and added a bunch of useful stuff, notably 'check_func()',
'try_cpp()', 'search_cpp()', and 'check_header()'.  This is enough that
the base config is actually useful for implementing a real config
command, specifically one for mxDateTime.
2000-06-21 03:00:50 +00:00
Greg Ward b081e180ac Pulled the MSVC++-specific hackery out to a new method, 'prelink_hook()',
and added (empty) 'precompile_hook()' for symmetry.  One can envision
a much more elaborate hook mechanism, but this looks like it'll do for
now.
2000-06-17 23:04:31 +00:00
Greg Ward c566232c4d Fixed install directory for header files on Unix. 2000-06-17 01:34:45 +00:00
Greg Ward d2412a35b1 Harry Henry Gebel: fix '_format_changelog()' so it doesn't bomb if
passed None.
2000-06-08 14:21:23 +00:00
Greg Ward 14c8d05a7a Include setup.cfg in the list of default files to distribute. 2000-06-08 01:22:48 +00:00
Greg Ward ce15c6ce8d Moved the code that prunes the file list after reading the manifest
template into a new method 'prune_file_list()', called from
  'get_file_list()' rather than 'read_manifest()' -- this keeps
  'read_manifest()' more general.
Deleted the redundant call to 'exclude_pattern()' in 'make_distribution()'
  -- this had the same intention as 'prune_file_list()', but was incomplete
  (only pruned the release tree, not the build tree) and in the wrong
  place (the prune wouldn't be reflected in the manifest file).
2000-06-08 01:06:02 +00:00
Greg Ward 4a7319ca28 Renamed 'find_defaults()' to 'add_defaults()'.
Deleted old, commented-out 'exclude_pattern()' method.
2000-06-08 00:52:52 +00:00
Greg Ward c3c8c6edbb Docstring addition binge. 2000-06-08 00:46:45 +00:00
Greg Ward e0c8c2fd16 Docstring reformatting binge. 2000-06-08 00:24:01 +00:00
Greg Ward f1fe10376e Cosmetic tweaks to imports, the 'show_formats()' function, and the
'help_options' list; also added an editorial comment.
2000-06-08 00:14:18 +00:00
Greg Ward f8b9e20d94 Made all debug output go through the 'debug_print()' method instead of
directly printing to stdout.  This was a bit more work than it sounds like
it should have been:
  * turned 'select_pattern()' and 'exclude_pattern()' from functions into
    methods, so they can refer to 'self' to access the method
  * commented out the *other* 'exclude_pattern()' method, which appears
    to be vestigial code that was never cleaned up when the
    'exclude_pattern()' function was created
  * changed the one use of the old 'exclude_pattern()' method to use the
    new 'exclude_pattern()' (same behaviour, slightly different args)
  * some code and docstring reformatting
  * and, of course, changed all the debugging prints to 'debug_print()' calls
Added/tweaked some regular ('self.announce()') output for better runtime
  feedback.
2000-06-08 00:08:14 +00:00
Greg Ward 9d17a7ad6d Patch from Rene Liebscher: this adds "--help-foo" options to list the
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!
2000-06-07 03:00:06 +00:00
Greg Ward 28a5f44cca First crack at the Distutils "config" command. Unlike other commands, this
one doesn't *do* anything by default; it's just there as a conduit for data
(eg. include dirs, libraries) from the user to the "build" commands.
However, it provides a couple of Autoconf-ish methods ('try_compile()',
'try_link()', 'try_run()') that derived, per-distribution "config" commands
can use to poke around the target system and see what's available.

Initial experimenst with mxDateTime indicate that higher-level methods are
necessary: analogs of Autoconf's AC_CHECK_HEADER, AC_CHECK_LIB will be
needed too (and that's just to probe the C/C++ system: how to probe the
Python system is wide open, and someday we'll have to worry about probing a
Java system too).
2000-06-06 02:57:07 +00:00
Greg Ward e18dd8dd8f Support for multiple distribution formats in one run. 2000-06-06 02:51:38 +00:00
Greg Ward ec21cc60db 'get_outputs()' now returns an empty list instead of None. 2000-06-06 02:18:13 +00:00
Greg Ward 7ce6d074aa Fixed syntax error.
Half-fixed RPM 2 compatibility:added 'rpm_base' option, which must be set
  (to eg. /usr/src/redhat on a stock Red Hat system) if rpm2_mode is on.
  Still not quite working, though.
2000-06-04 15:30:35 +00:00
Greg Ward 62d5a57b05 Use 'ensure_string_list()' for 'formats' option, so that it can be
spelled sensibly in a config file.
2000-06-04 15:12:51 +00:00
Greg Ward a68c93ac89 Patch from Harry Henry Gebel:
Fills in question marks in help

Reads scripts in from files rather than strings

Adds RPM 2 compatibility mode (untested). Use of this mode requires that
--bdist-base be specified because bdist_rpm has no way of detecting where
RPM wants to find spec files and source files. An unmodified RedHat 5.0
system would require '--bdist-base=/usr/src/RedHat'. (You would also have
to be root.) If the rpmrc file has been modified to allow RPMs to be built
by normal users then --build-base would need to be changed accordingly.

Formats the changelog.

GPW: tweaked formatting, added some editorial comments.
2000-06-04 15:00:34 +00:00
Greg Ward 4227dc1b15 Removed the 'ensure_*' methods -- they're just too handy too keep in one
command class, so they're now in the Command base class.
2000-06-04 14:20:57 +00:00
Greg Ward 6f980b5936 Renamed 'modules' option to 'py_modules', for consistency with Distribution
(and in order to generate a more sensible error message cleanly).
2000-06-04 13:42:52 +00:00
Greg Ward c4c06af575 Patch from Harry Henry Gebel: fixes a bit of code that slipped by my
overhaul last night.
2000-06-03 01:03:55 +00:00
Greg Ward efbd071016 Only print debugging output if DEBUG true. 2000-06-02 02:01:51 +00:00
Greg Ward 673925842e Ditched the obsolete '_get_package_data()' method and its
'_check_*()' helpers.
2000-06-02 01:52:04 +00:00
Greg Ward 1259392b38 Fairly massive overhaul to support getting RPM inputs (extra meta-data,
prep/build/etc. scripts, doc files, dependency info) from a config file
rather than the dedicated "package_info" file.  (The idea is that
developers will provide RPM-specific info in the "[bdist_rpm]" section of
setup.cfg, but of course it could also be supplied in the other config
files, on the command line, or in the setup script -- or any mix of the
above.)

Major changes:
  * added a boatload of options to 'user_options' and
    'initialize_options()': 'distribution_name', 'group', 'release', ...
  * added 'finalize_package_data()', which takes the place of
    '_get_package_data()' -- except it's called from 'finalize_options()',
    not 'run()', so we have everything figured out before we actually run
    the command
  * added 'ensure_string()', 'ensure_string_list()', 'ensure_filename()';
    these take the place of '_check_string()' and friends.  (These actually
    look like really useful type-checking methods that could come in handy
    all over the Distutils; should consider moving them up to Command and
    using them in other command classes' 'finalize_options()' method for
    error-checking).
  * various cleanup, commentary, and adaptation to the new way of
    storing RPM info in '_make_spec_file()'
2000-06-02 01:49:58 +00:00
Greg Ward d87eb73f32 Remember the list of archive files created in 'make_distribution()'.
Added 'get_archive_files()' so outsiders can get their hands on that list.
2000-06-01 01:10:56 +00:00
Greg Ward 01a4694dce More tweaking to make this command act like other Distutils commands:
* added "--bdist-base" option to parameterize where we build
    the RPM (comes from "bdist" by default: "build/bdist.<plat>")
  * simplified/cleaned up some code in 'run()' in the process of
    removing (most) hard-coded directory names
  * if "--spec-only", drop spec file in "dist" rather than "redhat"
    (directory name still hard-coded, though)
  * use 'reinitialize_command()' to fetch the "sdist" object to
    tweak before running "sdist" command
  * use 'self.copy_file()' method rather than 'copy_file()' function
  * cosmetic tweaks to comments, error messages
2000-06-01 00:40:25 +00:00
Greg Ward 69413da749 Regularize options a bit:
* help strings start with lowercase
  * added affirmative version of '--no-clean' and '--no-rpm-opt-flags',
    which are the default (thus the attributes that correspond to
    the options are now 'clean' and 'use_rpm_opt_flags')
2000-05-31 23:56:45 +00:00
Greg Ward d8dfb4c4b8 Renamed 'native_path()' to 'convert_path()'.
Also changed it so it doesn't barf if the path is already in native format
  (ie. contains os.sep).
2000-05-31 02:32:10 +00:00
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 98150114e0 Cosmetic tweak. 2000-05-30 02:04:54 +00:00
Greg Ward 2129032bc6 Changed order so 'clean' is right after the 'build' commands. 2000-05-28 23:49:03 +00:00
Greg Ward fbb04c448c Only print debugging output if DEBUG (imported from distutils.core) is true. 2000-05-28 23:47:31 +00:00
Greg Ward 0eeebfda98 Moved warnings out of 'finalize_options()' into 'run()'.
Added a warning for 'bdist_base' directory.
2000-05-28 23:47:00 +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 e5b267ccb6 Patch from Andrew Kuchling: prune out the build and source distribution
directories after all is said and done, so we don't accidentally include
those files in the source distribution.

(This is the quick and easy way to fix this; Andrew says: "Changing
findall() looked like it was going to be messy, so I tried this instead.
The only problem is that redundant directory traversals are being done,
walking through build/ only to throw out all the files found at the end.").
2000-05-27 03:03:23 +00:00
Greg Ward 46380906d1 Tweaked description, help text. 2000-05-27 01:33:49 +00:00