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

2006-07-24 Thread Ed Swierk
I'm cross-compiling Python using uClibc buildroot, which installs target include
files and libraries to a directory like ~/toolchain rather than /usr.  I
couldn't figure out any way to convincing the top-level python/setup.py to look
in ~/toolchain instead of /usr when detecting what modules to build.  

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.

Am I missing an easier solution to this problem?  I'm happy to post my patch to
setup.py if anyone is interested.

--Ed


___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


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

2006-07-25 Thread Ed Swierk
On 7/24/06, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote:
> 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.

Well, it seems buildroot solves this main problem by building another
version of python and pygen that run on the build machine, and hacks
the Makefile to run setup.py with these instead of whatever happens to
be sitting in /usr/bin.

Thus the modules that do get built seem to work just fine, but
setup.py itself ignores all this careful hackery when determining what
modules to build and configuring distutils to search for system
libraries in various dynamically-discovered paths.

--Ed
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com