From what I can tell:
configure.ac sets PYTHON_FOR_BUILD like this if cross-compiling:
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 _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH) '$interp
Note how PYTHONPATH is set to the source and build paths for Lib/.
The intention appears to be that the sysconfig.py in the build is used. In my case that directory is also full of shared libraries that Python happily loads, and then fails. |