[Distutils] Hacks and bugs for distutilizing wxPython
Robin Dunn
robin@alldunn.com
Wed Oct 18 22:14:01 2000
> > 2. My secondary extensions need to link with the import lib produced
from
> > building the first extension. The default location of this file is
dynamic
> > based on the python version, debug status, and also the relative path to
the
> > first source file. Since there was no reliable way to determine before
> > setup() was called where that directory would be I hacked it to just use
a
> > fixed location for the implib (build\ilib\).
>
> Still pondering this one. Wherever we put it, the directory name will
> be unpredictable and not known until run-time, because all directories
> in "build/" with platform-specifc files are named after the platform.
>
> One idea: allow expansion of "configuration variables" in more values in
> the setup script.
I like this. Another idea would be to automatically add the directory to
the library_dirs of subsequent Extension objects, although I suppose that
could be even more dangerous than variable expansion.
>
> > Related to this, if a full path is given to a source file, then the
object
> > will be put in the same directory as the source. I think object files
> > should always be put under the build dir.
>
> By "full path" do you mean "absolute path",
Yes.
> I can't think of any good reason to put absolute paths in your
> setup script; it destroys portability even to another machine (much less
> another OS), so it's not something I ever even considered supporting.
> Why do you need it?
The path came from an environment variable that was concatenated with some
source file names.
> > 6. Why is -g used by the compiler when --debug is not given to
distutils?
>
> Because it's what's in Python's Makefile. Hmmm... here's how it works
> right now: if 'debug' is true (ie. --debug is given on the build_ext or
> build_clib command line), then UnixCCompiler inserts "-g" into the
> argument list. But it does nothing if 'debug' is false. Perhaps it
> should explicitly remove "-g". That feels wrong to me, though: if you
> built your Python with -g, then surely you mean to build extensions with
> -g?
>
I think it should remove it. With the distutils philosophy, if I want debug
info I ask for it. If I want to distribute a lean and mean binary then the
absense of --debug should mean the absense of debug info, after all, the
flag is not called --no-gol-dang-debug-info-please. IMHO, Python's
configure has the wrong default. It's not often that I feel the need to
trace into Python sources, even when I'm developing extensions. For the 98%
of the Python installations out there that are not developing extensions or
hacking on Python itself there is definitly no need. I think it should
have an --enable-debug flag that is off by default. But I digress...
>
> You'll be glad to know that LDSHARED on Solaris is fixed in Python 1.6
> and later -- I patched configure.in to handle that.
Yep, I noticed that when I built 2.0.
--
Robin Dunn
Software Craftsman
robin@AllDunn.com
http://wxPython.org Java give you jitters?
http://wxPROs.com Relax with wxPython!