On Monday, Aug 4, 2003, at 08:47 Europe/Amsterdam, Brandon Long wrote:
I mailed this to Greg, and he said to try here:
I've got a project with a python wrapper/extension module (amoung others), called ClearSilver http://www.clearsilver.net/
The package uses autoconf/configure to determine which programs are available, and how to build things, etc. This includes external libaries and locations for them, like -lz, -ldb, etc.
Until recently, I've been just providing a Makefile for compiling the python extension, instead of using distutils. I don't really want to deal with compiling the shared library on all of the platforms, though, so I figured I'd go and create the setup.py script.
The trouble is, how to pass the information from configure to the setup.py. I was just going to pass them on the command line, ie from Makefile:
$(PYTHON) setup.py ext_build $(INCLUDES) $(LIBDIRS) $(LIBS)
where $(INCLUDES) is a list of -Ipaths and $(LIBDIRS) is a list of -Lpaths and $(LIBS) is a list of -llibraries.
I would also like the ability to change definitions from the command line. My use case is a bit different, though: Package Manager installs distutils-based packages automatically, and sometimes it "knows" that some of the variables that distutils grasps from lib/python2.3/config need to be modified.
I think a solution that would fit both my needs and Brandon's would be something like $(PYTHON) setup.py build INCLUDES="$(INCLUDES)" LIBDIR="$(LIBDIRS)" LIBS="$(LIBS)"
It is open to discussion whether the name=value assignments go before or after the "build" command name. The structure of distutils commands would suggest before, but we could also pick them all up in a first pass over argv (similarly to what make does, where you can put them anywhere). -- Jack Jansen, Jack.Jansen@cwi.nl, http://www.cwi.nl/%7Ejack If I can't dance I don't want to be part of your revolution -- Emma Goldman