[Distutils] The build_ext command has -I and -L options, why don't others???

Paul Moore gustav@morpheus.demon.co.uk
Sat Jul 21 12:18:01 2001

I think this may be a fundamental flaw in the way distutils works... (By =
that, I
mean that it's something that "obviously" should work, but it's going to =
massively hard to implement that way :-() Let me know what you think.

I'm still hacking on my PIL setup.py file. My latest thought was that, =
that PIL needs the ZLib, JPEG and TCL libraries, and given that I don't =
have a
"standard" location to look in for them, what command line options might =

And sure enough, I found the -I and -L options for the build_ext command.

Great! That's just what I want. Obviously (!), I'm using the "build" =
but that executed build_ext behind the scenes for my extensions, so I'll =
pass -I and -L, and let build pass them on to build_ext as needed.

Oh, no... The build command complains that the -I and -L options are =
Grr. I guess this means that I either have to run build_ext first, by =
hand, and
then run build (this works - well, it would if the build_clib command had=
 an -I
option, but that's a separate issue...), or I have to write a custom =
command which accepts -I and -L and passes them onto build_ext.

Surely, commands (like build and install) which run other commands should=
*all* of the options allowed by any of their sub-commands, and pass them =
those sub-commands. As I say, this seems obvious to me, but (having =
briefly at the internals) annoyingly hard to do, in practice.

As I say, any thoughts?

PS I think this pretty much kills any hope of writing a setup.py which =
implements command line argument extensions. You'd have to write custom =
for every command, from the lowest one which needs the extra option, all =
the way
up the tree (install must be customised to take the same options as the =
build, which must be customised to take the same options as the custom
build_ext, ...)