[Python-Dev] cross-compiling

Guido van Rossum guido at python.org
Mon Nov 7 22:04:53 CET 2005

I know some folks have successfully used cross-compilation before. But
this was in a distant past. There was some support for it in the
configure script; surely you're using that? I believe it lets you
specify defaults for the TRY_RUN macros. But it's probably very

About using distutils to build the extensions, this is because some
extensions require quite a bit of logic to determine the build
commands (e.g. look at BSDDB or Tkinter). There was a pre-distutils
way of building extensions using Modules/Setup* but this required
extensive manual editing if tools weren't in the place where they were
expected, and they never were.

I don't have time to look into this further right now, but I hope I
will in the future. Keep me posted!


On 11/7/05, Neal Norwitz <nnorwitz at gmail.com> wrote:
> We've been having some issues and discussions at work about cross
> compiling.  There are various people that have tried (are) cross
> compiling python.  Right now the support kinda sucks due to a couple
> of reasons.
> First, distutils is required to build all the modules.  This means
> that python must be built twice.  Once for the target machine and once
> for the host machine.  The host machine is really not desired since
> it's only purpose is to run distutils.  I don't know the history of
> why distutils is used.  I haven't had much of an issue with it since
> I've never needed to cross compile.  What are the issues with not
> requiring python to be built on the host machine (ie, not using
> distutils)?
> Second, in configure we try to run little programs (AC_TRY_RUN) to
> determine what to set.  I don't know of any good alternative but to
> force those to be defined manually for cross-compiled environments.
> Any suggestions here?  I'm thinking we can skip the the AC_TRY_RUNs
> if host != target and we pickup the answers to those from a user
> supplied file.
> I'm *not* suggesting that normal builds see any change in behaviour.
> Nothing will change for most developers.  ie, ./configure ; make ;
> ./python will continue to work the same.  I only want to make it
> possible to cross compile python by building it only on the target
> platform.
> n
> PS.  I would be interested to hear from others who are doing cross
> compiling and know more about it than me.
> _______________________________________________
> Python-Dev mailing list
> Python-Dev at python.org
> http://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe: http://mail.python.org/mailman/options/python-dev/guido%40python.org

--Guido van Rossum (home page: http://www.python.org/~guido/)

More information about the Python-Dev mailing list