4

There are several tutorials on the web documenting how to cross-compile or cross-build Python for various embedded systems using some basic hacking and patching, like so:

http://randomsplat.com/id5-cross-compiling-python-for-embedded-linux.html

This worked well for me in the past, when I was using Python 2.7.2.

In Python 2.7.4, some cross-compile functionality was finally included in the upstream build process, documented here:

This breaks all of the previous cross-build hacks, and I cannot find any updated tutorials or documentation for the new built-in cross-compile procedure.

Does anyone have a good example or documentation on using the new cross-compile procedure for Python 2.7.4 and onward in the 2.7 branch?

Thanks!

Trevor
  • 1,613
  • 3
  • 22
  • 34

2 Answers2

4

After diving into the existing patches and changes, I was able to produce a modified patch set that utilizes the latest cross-compiling features for 2.7.5.

http://www.trevorbowen.com/2013/10/07/cross-compiling-python-2-7-5-for-embedded-linux/

Paul also references it on his original "classic" cross-compile-Python post:

http://randomsplat.com/id5-cross-compiling-python-for-embedded-linux.html

HTH

Trevor
  • 1,613
  • 3
  • 22
  • 34
  • In your example you move aside python and pgen (X_for_build) but you do not reference them on the cross config/build (while the other, "Paul" link does) – nhed Mar 03 '15 at 18:14
1

For posterity...

Though the question is specifically about Python 2.7, if you're willing to step up to Python3, another option for embedded/micro with good cross-compiling features/support is Micro Python; (see also June 2014 announcement though it was around before that).

See also this other SO thread about small/portable (in multiple senses) Python implementations.

Community
  • 1
  • 1
hoc_age
  • 1,945
  • 2
  • 18
  • 28