[Python-Dev] setup.py and cross-compiling

"Martin v. Löwis" martin at v.loewis.de
Mon Jul 24 23:25:58 CEST 2006


Ed Swierk wrote:
> I decided to hack up setup.py so that an optional root directory (passed via an
> environment variable) is prepended to all the hardcoded paths like
> "/usr/include", "/lib", "/lib64", and so on.

I doubt this solves the problem. Distutils just doesn't support
cross-compilation, period.

The main problem is that it is the host python that runs setup.py,
not the target python. Various parts of distutils assume that the
information the interpreter provides is correct, yet it is not
in a cross-compilation case.

I'm uncertain how to solve this; using a target Makefile and pyconfig.h
instead of the installed one might be a starting point. One should then
review distutils to find out where it accesses host information when
target information is required, and then find a way to come up with
that information. If no information is available, then distutils should
fail instead of returning incorrect information.

Regards,
Martin


More information about the Python-Dev mailing list