[Distutils] cross compiling using setuptools

Phillip J. Eby pje at telecommunity.com
Sun Oct 8 06:39:00 CEST 2006

At 06:57 PM 10/7/2006 -0700, Venkat Bommakanti wrote:
>Assuming I can use setuptools as-is and "easy_install ..." invoke syntax 
>like above - for the cross build (ppc target), how would I specify the 
>options meant for:
>    . setup.py (of each of the above comps):
>        . -c (cross-gcc)
>        . bdest_egg (setuptools):
>           .  --dist-dir
>           .  --plat-name
>           .  exclude-source
>in the "easy_install ..." command. I read:
>but its unclear how the above options are passed on to "easy_install ...".

Put them in your ~/.pydistutils.cfg file, using e.g.

compiler = ...

plat_name = ...
exclude_source = 1

>I realize that I'd have to use a PYTHONPATH that includes something like:
>    "<my-ppc-root>/usr/lib/python2.4/site-packages"
>for the ppc-target, so it doesn't complain about the:
>    "bad install directory or PYTHONPATH"

Use the -m option to easy_install, and it won't complain about that.

>error... Also, 'am assuming its not a problem to include a path to 
>ppc-eggs in the PYTHONPATH setting, before invoking the "easy_install ..." 
>command for the cross compile.
>As an aside, would also like to know how I could enable the creation of 
>target-specific .pyc files, in such a cross-compile scenario. I was able 
>to build python itself in a cross compile (i686 build system -> ppc target 
>system) mode, but the .pyc it generates appear to be i686-specific ones 
>and not ppc-ones... when deployed to the ppc-system, it complains about 
>the "bad magic number" error...

Odd; as far as I know, .pyc/.pyo files are completely platform 
independent.  They are specific to Python version, however, so both 
machines would have to be e.g. Python 2.3, or both 2.4.

More information about the Distutils-SIG mailing list