This patch is originally from here:
http://bugs.gentoo.org/attachment.cgi?id=130627

Add documentation for cross compilation scenario.

Signed-off-by: Robert Schwebel <r.schwe...@pengutronix.de>

---
 README |   44 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)

Index: Python-3.0/README
===================================================================
--- Python-3.0.orig/README
+++ Python-3.0/README
@@ -156,6 +156,50 @@ there.  For example:
 should do a "make clean" at the toplevel first.)
 
 
+Cross Compiling
+---------------
+
+Python can be cross compiled by supplying different --build and --host
+parameters to configure. Python is compiled on the "build" system and
+executed on the "host" system. Cross compiling python requires a
+native Python on the build host, and a natively compiled tool `Pgen'.
+
+Before cross compiling, Python must first be compiled and installed on
+the build host. The configure script will use `cc' and `python', or
+environment variables CC_FOR_BUILD or PYTHON_FOR_BUILD, eg:
+
+   CC_FOR_BUILD=gcc-3.3 \
+   PYTHON_FOR_BUILD=python3.0 \
+   .../configure --build=i686-linux --host=i586-mingw32
+
+Cross compiling has been tested under linux, mileage may vary for
+other platforms.
+
+A few reminders on using configure to cross compile:
+
+- Cross compile tools must be in PATH,
+
+- Cross compile tools must be prefixed with the host type
+  (ie i586-mingw32-gcc, powerpc-darwin8-ranlib, ...),
+
+- CC, CXX, AR, and RANLIB must be undefined when running configure,
+  they will be auto-detected.
+
+- Autoconf must be stopped from autodetecting definitions for the
+  build machine.  This is easiest done by creating a config.cache
+  that overrides ac_cv_* variables appropriately.
+
+If you need a cross compiler, Debian ships several several (eg: avr,
+m68hc1x, mingw32), while dpkg-cross easily creates others. Otherwise,
+check out one of these cross toolchain projects:
+
+- crosstool:
+  http://www.kegel.com/crosstool
+
+- OSELAS.Toolchain:
+  http://www.pengutronix.de/oselas/toolchain/index_en.html
+
+
 Copyright and License Information
 ---------------------------------
 

-- 
Pengutronix e.K.                           | Dipl.-Ing. Robert Schwebel  |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
_______________________________________________
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

Reply via email to