diff -r a87d4324e804 README --- a/README Sat Oct 29 17:01:07 2016 +0200 +++ b/README Sat Oct 29 21:28:03 2016 +0200 @@ -85,6 +85,50 @@ performance gains. +Cross Compiling on unix +----------------------- + +The cross-compilation of Python requires a natively installed python to run +Python scripts at multiple stages in the build process. The path to this native +python must be set in the $PATH environment variable and it must have the same +package version as the Python source being cross-built (for example python3.6). + +One way to ensure that the previous rule is followed is to build the native +python from the same source first. For example: + + mkdir python-native build install + cd python-native + /path/to/source/configure && make + export PATH=$(pwd):$PATH + cd ../build + /path/to/source/configure --host= --build= \ + ac_cv_file__dev_ptmx=no ac_cv_file__dev_ptc=no \ + && make DESTDIR=../install install + +If the target Python can use /dev/ptmx or /dev/ptc to implement os.openpty(), +set the corresponding argument to "yes". + +On Android /usr/local does not exist and cannot be created, so you must add +the '--prefix' option to the configure command given above, specifying the path +where the standard library will be installed so that the python interpreter can +find it. For example if you set '--prefix=/sdcard/org.github.my_python' then +this will be the value of sys.prefix and the standard library must be installed +on the Android device at /sdcard/org.github.my_python/lib/python3.6. Note that +you still need to use DESTDIR in the 'make install' command (see +https://www.gnu.org/software/make/manual/html_node/DESTDIR.html). + +On Android the application binaries are installed on /data as the sdcards are +mounted noexec. Continuing with the previous example, the binaries are +installed at /data/data/org.github.my_python following the same directory +hierarchy as the one found after 'make install' below $DESTDIR/$PREFIX and +including the shared libraries of the extension modules. Thus those libraries +must be installed at /data/data/org.github.my_python/lib/python3.6/lib-dynload. +Note that you do not need to specify the +'--exec_prefix=/data/data/org.github.my_python' configure option, although this +may be safer (see the large comment in Modules/getpath.c of the Python source +code). + + What's New ----------