aboutsummaryrefslogtreecommitdiff
path: root/tools/depends/target/python3/crosscompile.patch
diff options
context:
space:
mode:
Diffstat (limited to 'tools/depends/target/python3/crosscompile.patch')
-rw-r--r--tools/depends/target/python3/crosscompile.patch96
1 files changed, 42 insertions, 54 deletions
diff --git a/tools/depends/target/python3/crosscompile.patch b/tools/depends/target/python3/crosscompile.patch
index 46e212f1f2..a65296ceb6 100644
--- a/tools/depends/target/python3/crosscompile.patch
+++ b/tools/depends/target/python3/crosscompile.patch
@@ -1,3 +1,21 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -1184,15 +1184,6 @@
+ ARFLAGS="rcs"
+ fi
+
+-AC_CHECK_TOOLS([READELF], [readelf], [:])
+-if test "$cross_compiling" = yes; then
+- case "$READELF" in
+- readelf|:)
+- AC_MSG_ERROR([readelf for the host is required for cross builds])
+- ;;
+- esac
+-fi
+-AC_SUBST(READELF)
+
+
+ case $MACHDEP in
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -38,7 +38,6 @@
@@ -7,17 +25,8 @@
-READELF= @READELF@
SOABI= @SOABI@
LDVERSION= @LDVERSION@
- GITVERSION= @GITVERSION@
-@@ -295,7 +294,7 @@
- ##########################################################################
- # Parser
- PGEN= Parser/pgen$(EXE)
--
-+PGEN_FOR_BUILD=$(NATIVE_PGEN)
- POBJS= \
- Parser/acceler.o \
- Parser/grammar1.o \
-@@ -623,7 +623,7 @@
+ LIBPYTHON= @LIBPYTHON@
+@@ -608,7 +607,7 @@
$(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build"; \
$(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \
_TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \
@@ -26,13 +35,11 @@
# Build static library
-@@ -1535,11 +1535,13 @@
- # Install the dynamically loadable modules
+@@ -1600,10 +1599,11 @@
# This goes into $(exec_prefix)
sharedinstall: sharedmods
-+ CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \
$(RUNSHARED) $(PYTHON_FOR_BUILD) $(srcdir)/setup.py install \
-+ --skip-build \
++ --skip-build \
--prefix=$(prefix) \
- --install-scripts=$(BINDIR) \
- --install-platlib=$(DESTSHARED) \
@@ -43,50 +50,31 @@
-rm $(DESTDIR)$(DESTSHARED)/_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH).py
-rm -r $(DESTDIR)$(DESTSHARED)/__pycache__
---- a/configure.ac
-+++ b/configure.ac
-@@ -1200,15 +1200,6 @@
- ARFLAGS="rcs"
- fi
-
--AC_CHECK_TOOLS([READELF], [readelf], [:])
--if test "$cross_compiling" = yes; then
-- case "$READELF" in
-- readelf|:)
-- AC_MSG_ERROR([readelf for the host is required for cross builds])
-- ;;
-- esac
--fi
--AC_SUBST(READELF)
-
-
- case $MACHDEP in
--- a/setup.py
+++ b/setup.py
-@@ -16,7 +16,7 @@
- from distutils.command.build_scripts import build_scripts
- from distutils.spawn import find_executable
+@@ -21,7 +21,7 @@
--cross_compiling = "_PYTHON_HOST_PLATFORM" in os.environ
-+cross_compiling = ("_PYTHON_HOST_PLATFORM" in os.environ) or ('CROSS_COMPILE_TARGET' in os.environ)
- # Set common compiler and linker flags derived from the Makefile,
- # reserved for building the interpreter and the stdlib modules.
-@@ -268,6 +268,7 @@
+ # Compile extensions used to test Python?
+-TEST_EXTENSIONS = True
++TEST_EXTENSIONS = False
- def build_extensions(self):
+ # This global variable is used to hold the list of modules to be disabled.
+ DISABLED_MODULE_LIST = []
+@@ -38,7 +38,7 @@
+ return sys.platform
-+ return
- # Detect which modules should be compiled
- missing = self.detect_modules()
-
-@@ -477,6 +478,9 @@
- # Don't try to load extensions for cross builds
- if cross_compiling:
-+ self.announce(
-+ 'WARNING: skipping import check for cross-compiled: "%s"' %
-+ ext.name)
- return
+-CROSS_COMPILING = ("_PYTHON_HOST_PLATFORM" in os.environ)
++CROSS_COMPILING = ("_PYTHON_HOST_PLATFORM" in os.environ) or ('CROSS_COMPILE_TARGET' in os.environ)
+ HOST_PLATFORM = get_platform()
+ MS_WINDOWS = (HOST_PLATFORM == 'win32')
+ CYGWIN = (HOST_PLATFORM == 'cygwin')
+@@ -310,6 +310,7 @@
+ self.extensions.append(ext)
- loader = importlib.machinery.ExtensionFileLoader(ext.name, ext_filename)
+ def build_extensions(self):
++ return
+ self.srcdir = sysconfig.get_config_var('srcdir')
+ if not self.srcdir:
+ # Maybe running on Windows but not using CYGWIN?