more distutils problems (was: dumb distutils question)

Quinn Dunkan quinn at regurgitate.ugcs.caltech.edu
Tue May 28 14:59:10 EDT 2002


On Fri, 24 May 2002 12:01:21 +0400, Oleg Broytmann <phd at phd.pp.ru> wrote:
>On Thu, May 23, 2002 at 06:11:16PM +0000, Quinn Dunkan wrote:
>> I can do 'CFLAGS=-I/opt/sfw/include LDFLAGS=-L/opt/sfw/lib ./configure', but
>
>   Python is non-standard in this area - it uses OPT instead of CFLAGS. But
>I recommend to set both flags.

That's useful information, but distutils doesn't seem to pick it up, so it
still never looks in /whatever/{lib,include}.

Python's setup.py has a hardcoded bit to always put /usr/local/lib into the
search path, but that doesn't seem like the right place, since it only works
for python.

I guess I have to figure out some way to get something into the default
Extension.extra_link_args.  Maybe I could modify command/build_ext.py to pull
in LDFLAGS like it pulls in CFLAGS, but they should also be settable from the
command line so configure could relay that kind of info.  It doesn't look like
configure has a standard flag to add to the library search path though.



I have another problem with distutils: on SunOS, they link shared libs with
-shared, which sun ld doesn't support, and results in countless pages of
errors.  The proper flag for sun ld is -G, but -shared seems to be hard-coded
in UnixCCompiler.executables['linker_so'].  I guess it should have a
linker_shared_flag or something which I could override or mutate.  Or just
mutate the variable directly.

Is there a better way to get distutils to use the right flag?  I note that the
old build process gets the flag right.



More information about the Python-list mailing list