Skip to content

Instantly share code, notes, and snippets.

@moreati
Created June 5, 2016 16:10
Show Gist options
  • Save moreati/e2c14505eaf5fad4536ded1c44bc92f6 to your computer and use it in GitHub Desktop.
Save moreati/e2c14505eaf5fad4536ded1c44bc92f6 to your computer and use it in GitHub Desktop.
# Notes on cross-compiling Python 3.6.0 pre releases
# Work in progress
# Build a native interpreter in tree, for use as PYTHON_FOR_BUILD later.
# You _might_ be able to avoid this by using a pre-installed python,
# but if e.g. /usr/bin/python is 3.5.x, then you'll get syntax errors when it
# tries import 3.6.x stdlib modules.
configure
make python
# Cross build a foreign interpreter out of tree
# The PYTHON_FOR_BUILD line is taken verbatim from configure.ac
# --assume-new because (currently) the Makefile incorrectly believes
# it's a preqrequisite of graminit.h
mkdir cross
cd cross
../configure --build=x86_64-linux \
--host=arm-linux-gnueabihf \
--disable-ipv6 \
ac_cv_file__dev_ptc=no \
ac_cv_file__dev_ptmx=no \
PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib:$(srcdir)/Lib/$(PLATDIR) '../python
make --assume-new Parser/pgen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment