[Distutils] cross compiling using setuptools

Phillip J. Eby pje at telecommunity.com
Tue Oct 10 01:55:01 CEST 2006

At 04:23 PM 10/9/2006 -0700, Venkat Bommakanti wrote:
>For the cross compile case (i686 build box -> ppc target), rather than
>the setup.py/setup.cfg option in the TurboGears src/pkg dir, I thought
>I'll try the basic method of using $HOME/.pydistutils.cfg first. So I
>created one ($HOME/.pydistutils.cfg) with the following contents:
>   [build]
>   compiler=powerpc-unknown-linux-gcc
>   [bdist_egg]
>   pla_name=ppc
>When I run:
>     easy_install --prefix=usr -s usr/bin -f . TG.egg
>I get an error msg:
>     error: Setup script exited with error: don't know how to compile C/C++
>              code on platform 'posix' with 'powerpc-unknown-linux-gcc' 
> compiler
>I have 'powerpc-unknown-linux-gcc' in my path. Could it be that its not
>picking up some include dirs etc.

$ python setup.py build_ext --help

Options for 'build_ext' command:
   --compiler (-c)      specify the compiler type
   --help-compiler      list available compilers

$ python setup.py build_ext --help-compiler
List of available compilers:
   --compiler=bcpp     Borland C++ Compiler
   --compiler=cygwin   Cygwin port of GNU C Compiler for Win32
   --compiler=emx      EMX port of GNU C Compiler for OS/2
   --compiler=mingw32  Mingw32 port of GNU C Compiler for Win32
   --compiler=msvc     Microsoft Visual C++
   --compiler=mwerks   MetroWerks CodeWarrior
   --compiler=unix     standard UNIX-style compiler

These are the only options the distutils provide for --compiler, and 
setuptools doesn't currently offer any way to extend this.  (Although if 
somebody wanted to contribute a mechanism to do so based on entry points, 
that would be way cool.)

More information about the Distutils-SIG mailing list