[Python-Dev] extension module .o files wind up in the wrong place

Martin v. Löwis martin@v.loewis.de
03 Dec 2002 09:17:52 +0100


Greg Ewing <greg@cosc.canterbury.ac.nz> writes:

> If this involves VPATH, I think I might know what's happening --
> something similar happened to me recently.
> 
> Have you by any chance previously done a non-VPATH build in the source
> tree?

I get the same problem when building in the source directory
(/usr/src/python). VPATH is not set in the Makefile, and the
compilation commands read like this

gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -I. -I/usr/src/python/./Include -I/usr/local/include -I/usr/src/python/Include -I/usr/src/python -c /usr/src/python/Modules/regexmodule.c -o /usr/src/python/Modules/regexmodule.o

I believe this is triggered by the change

----------------------------
revision 1.45
date: 2001/08/05 22:31:19;  author: jackjansen;  state: Exp;  lines: +63 -6
Replace moddir and incdir by
moddirlist and incdirlist, lists of source and include
directories that are searched for modules.
This is needed because the Mac modules and include files
live in the Mac subtree.

In addition (and that's actually what the mod is all about) on OSX we build all the Mac extension modules.
----------------------------

Here, moddirlist is ['/usr/src/python/Modules'], so the name of the
source module will be /usr/src/python/Modules/regexmodule.c, instead of
Modules/regexmodule.c. In turn, build_ext.build_temp is ignored, and
the object files end up in the wrong place.

Jack, can you please correct this problem?

Regards,
Martin