[Python-Dev] addressing distutils inability to track file dependencies

Martin Sjögren martin@strakt.com
Fri, 14 Jun 2002 14:12:25 +0200


On Fri, Jun 14, 2002 at 08:05:32AM -0400, Guido van Rossum wrote:
> > How about something like this:
> > 
> >   Extension('foo', ['foo1.c', 'foo2.c'], dependencies={'foo1.c':
> >   ['bar.h'], 'foo2.c': ['bar.h', 'bar2.h']})
> > 
> > though there is the problem of backwards compatability :/
> 
> But this is wrong: it's not foo1.c that depends on bar.h, it's foo1.o.

You're right.

> With the latest CVS, on Unix or Linux, try this:
> 
>   - Run Make to be sure you are up to date
>   - Touch Modules/socketobject.h
>   - Run Make again
> 
> The latest setup.py has directives that tell it that the _socket and
> _ssl modules depend on socketmodule.h, and this makes it rebuild the
> necessary .o and .so files (through the changes to distutils that
> Jeremy made).

Cool. But my module consists of several .c files, how do I specify which
.o files depend on which .h files?

Now, it's a shame I have to maintain compatability with the Python
2.1 and Python 2.2 distributions in my setup.py ;)
I suppose I could try/except...


Regards,
Martin


-- 
Martin Sjögren
  martin@strakt.com              ICQ : 41245059
  Phone: +46 (0)31 7710870       Cell: +46 (0)739 169191
  GPG key: http://www.strakt.com/~martin/gpg.html