Message46623
Here's a cross compile patch I prepared a while ago but
never got around to submitting. I've been using it
happily for months to cross compile python for embedded
systems.
Below is a descriptive excerpt from the patch. Also
note that the patch modifies configure.in, but not
configure. You will need to regenerate configure with
something like
autoconf configure.in >configure
This patch is inpsired from work by Klaus Reimer at
http://www.ailis.de/~k/docs/crosscompiling/python.php
+ Cross Compiling
+ ---------------
+
+ Python can be cross compiled by supplying different
--host and --build
+ parameters to configure. (Python is compiled on the
"build" system
+ and executed on the "host" system, in case you forgot
:). Python is
+ tricky to cross compile because it needs to execute
parts of itself
+ during construction. To work around this, make's
VPATH feature is
+ used to compile a native python in the subdirectory
"buildpython".
+ When parts of python need to be executed during
construction, the
+ "buildpython" versions are used.
+
+ A consequence of using the VPATH feature is that you
may not do a
+ cross compile build in the source directory. In
other words, do this:
+
+ mkdir mydir
+ cd mydir
+ ../Python/configure --host=powerpc-405-linux-gnu
--build=i686-pc-linux-gnu
+ make
+
+ Cross compiling works well under linux, mileage may
vary for other
+ platforms.
+
+ A few reminders on using configure to cross compile:
+ - Cross compile tools must be in the PATH.
+ - Cross compile tools must be prefixed with the host type
+ (ie powerpc-405-linux-gnu-cc,
powerpc-405-linux-gnu-ranlib, ...)
+ - CC, CXX, AR, and RANLIB must be undefined when
running configure and
+ make. Configure will detect them.
+
+ If you need a cross compiler, check out Dan Kegel's
crosstool:
+ http://www.kegel.com/crosstool
+
+
|
|
Date |
User |
Action |
Args |
2007-08-23 15:39:14 | admin | link | issue1006238 messages |
2007-08-23 15:39:14 | admin | create | |
|