2017-03-08 00:00:26 +01:00
|
|
|
From 0ef0d4ddd3f2261e381f22061a9a451dfbb1dc9e Mon Sep 17 00:00:00 2001
|
|
|
|
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
|
|
|
Date: Tue, 7 Mar 2017 22:17:59 +0100
|
|
|
|
Subject: [PATCH] Change the install location of _sysconfigdata.py
|
2014-02-13 21:48:53 +01:00
|
|
|
|
|
|
|
The _sysconfigdata.py module contains definitions that are needed when
|
|
|
|
building Python modules. In cross-compilation mode, when building
|
|
|
|
Python extensions for the target, we need to use the _sysconfigdata.py
|
|
|
|
of the target Python while executing the host Python.
|
|
|
|
|
|
|
|
However until now, the _sysconfigdata.py module was installed in
|
|
|
|
build/lib.<arch>-<version> directory, together with a number of
|
|
|
|
architecture-specific shared objects, which cannot be used with the
|
|
|
|
host Python.
|
|
|
|
|
|
|
|
To solve this problem, this patch moves _sysconfigdata.py to a
|
|
|
|
separate location, build/sysconfigdata.<arch>-<version>/, and only
|
|
|
|
this directory gets added to the PYTHONPATH of the host Python
|
|
|
|
interpreter when building Python modules for the target.
|
|
|
|
|
|
|
|
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
2017-03-08 00:00:26 +01:00
|
|
|
---
|
|
|
|
Makefile.pre.in | 12 ++++++++++--
|
|
|
|
configure.ac | 2 +-
|
|
|
|
2 files changed, 11 insertions(+), 3 deletions(-)
|
2014-02-13 21:48:53 +01:00
|
|
|
|
2017-03-08 00:00:26 +01:00
|
|
|
diff --git a/Makefile.pre.in b/Makefile.pre.in
|
|
|
|
index e288964..5367df7 100644
|
2014-02-13 21:48:53 +01:00
|
|
|
--- a/Makefile.pre.in
|
|
|
|
+++ b/Makefile.pre.in
|
2017-03-08 00:00:26 +01:00
|
|
|
@@ -529,6 +529,9 @@ pybuilddir.txt: $(BUILDPYTHON)
|
2014-12-28 21:54:54 +01:00
|
|
|
rm -f ./pybuilddir.txt ; \
|
|
|
|
exit 1 ; \
|
|
|
|
fi
|
|
|
|
+ echo `cat pybuilddir.txt`/sysconfigdata > pysysconfigdatadir.txt
|
|
|
|
+ mkdir -p `cat pysysconfigdatadir.txt`
|
|
|
|
+ cp `cat pybuilddir.txt`/_sysconfigdata.py `cat pysysconfigdatadir.txt`
|
2014-02-13 21:48:53 +01:00
|
|
|
|
2017-03-08 00:00:26 +01:00
|
|
|
# This is shared by the math and cmath modules
|
|
|
|
Modules/_math.o: Modules/_math.c Modules/_math.h
|
|
|
|
@@ -1080,7 +1083,7 @@ libinstall: build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c
|
2014-02-13 21:48:53 +01:00
|
|
|
else true; \
|
|
|
|
fi; \
|
|
|
|
done
|
|
|
|
- @for i in $(srcdir)/Lib/*.py `cat pybuilddir.txt`/_sysconfigdata.py $(srcdir)/Lib/*.doc $(srcdir)/Lib/*.egg-info ; \
|
|
|
|
+ @for i in $(srcdir)/Lib/*.py $(srcdir)/Lib/*.doc $(srcdir)/Lib/*.egg-info ; \
|
|
|
|
do \
|
|
|
|
if test -x $$i; then \
|
|
|
|
$(INSTALL_SCRIPT) $$i $(DESTDIR)$(LIBDEST); \
|
2017-03-08 00:00:26 +01:00
|
|
|
@@ -1090,6 +1093,11 @@ libinstall: build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c
|
2014-02-13 21:48:53 +01:00
|
|
|
echo $(INSTALL_DATA) $$i $(LIBDEST); \
|
|
|
|
fi; \
|
|
|
|
done
|
|
|
|
+ $(INSTALL_DATA) `cat pysysconfigdatadir.txt`/_sysconfigdata.py \
|
|
|
|
+ $(DESTDIR)$(LIBDEST)
|
|
|
|
+ mkdir -p $(DESTDIR)$(LIBDEST)/sysconfigdata
|
|
|
|
+ $(INSTALL_DATA) `cat pysysconfigdatadir.txt`/_sysconfigdata.py \
|
|
|
|
+ $(DESTDIR)$(LIBDEST)/sysconfigdata
|
|
|
|
@for d in $(LIBSUBDIRS); \
|
|
|
|
do \
|
|
|
|
a=$(srcdir)/Lib/$$d; \
|
2017-03-08 00:00:26 +01:00
|
|
|
@@ -1418,7 +1426,7 @@ distclean: clobber
|
2014-02-13 21:48:53 +01:00
|
|
|
Modules/Setup Modules/Setup.local Modules/Setup.config \
|
|
|
|
Modules/ld_so_aix Modules/python.exp Misc/python.pc
|
|
|
|
-rm -f python*-gdb.py
|
|
|
|
- -rm -f pybuilddir.txt
|
|
|
|
+ -rm -f pybuilddir.txt pysysconfigdatadir.txt
|
2016-12-22 07:46:00 +01:00
|
|
|
# Issue #28258: set LC_ALL to avoid issues with Estonian locale.
|
|
|
|
# Expansion is performed here by shell (spawned by make) itself before
|
|
|
|
# arguments are passed to find. So LC_ALL=C must be set as a separate
|
2017-03-08 00:00:26 +01:00
|
|
|
diff --git a/configure.ac b/configure.ac
|
|
|
|
index 1273465..5f89797 100644
|
2014-02-13 21:48:53 +01:00
|
|
|
--- a/configure.ac
|
|
|
|
+++ b/configure.ac
|
2017-03-08 00:00:26 +01:00
|
|
|
@@ -33,7 +33,7 @@ if test "$cross_compiling" = yes; then
|
2014-02-13 21:48:53 +01:00
|
|
|
AC_MSG_ERROR([python$PACKAGE_VERSION interpreter not found])
|
|
|
|
fi
|
|
|
|
AC_MSG_RESULT($interp)
|
2015-06-16 23:36:11 +02:00
|
|
|
- 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) '$interp
|
|
|
|
+ PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f pysysconfigdatadir.txt && echo $(abs_builddir)/`cat pysysconfigdatadir.txt`:)$(srcdir)/Lib:$(srcdir)/Lib/$(PLATDIR) '$interp
|
2014-02-13 21:48:53 +01:00
|
|
|
fi
|
2017-03-08 00:00:26 +01:00
|
|
|
# Used to comment out stuff for rebuilding generated files
|
|
|
|
GENERATED_COMMENT='#'
|
|
|
|
--
|
|
|
|
2.7.4
|
|
|
|
|