aboutsummaryrefslogtreecommitdiff
path: root/tools/depends/target/python3/crosscompile.patch
blob: 93c86b804735ac1fe6a42977b4aea96609ff7cb4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
--- a/configure.ac
+++ b/configure.ac
@@ -1221,15 +1221,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 @@
 MAINCC=		@MAINCC@
 LINKCC=		@LINKCC@
 AR=		@AR@
-READELF=	@READELF@
 SOABI=		@SOABI@
 LDVERSION=	@LDVERSION@
 LIBPYTHON=	@LIBPYTHON@
@@ -634,7 +634,7 @@
 		$(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build"; \
 	$(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \
 		_TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \
-		$(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build
+		PYTHONXCPREFIX='$(DESTDIR)$(prefix)' $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build
 
 
 # Build static library
@@ -1694,10 +1694,11 @@
 # This goes into $(exec_prefix)
 sharedinstall: sharedmods
 	$(RUNSHARED) $(PYTHON_FOR_BUILD) $(srcdir)/setup.py install \
+ 	    --skip-build \
 	   	--prefix=$(prefix) \
-		--install-scripts=$(BINDIR) \
-		--install-platlib=$(DESTSHARED) \
-		--root=$(DESTDIR)/
+		--install-scripts=$(DESTDIR)$(BINDIR) \
+		--install-platlib=$(DESTDIR)$(DESTSHARED) \
+		--root=/
 	-rm $(DESTDIR)$(DESTSHARED)/_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH).py
 	-rm -r $(DESTDIR)$(DESTSHARED)/__pycache__
 
--- a/setup.py
+++ b/setup.py
@@ -41,7 +41,7 @@
 
 
 # Compile extensions used to test Python?
-TEST_EXTENSIONS = True
+TEST_EXTENSIONS = False
 
 # This global variable is used to hold the list of modules to be disabled.
 DISABLED_MODULE_LIST = []
@@ -58,7 +58,7 @@
     return sys.platform
 
 
-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')
@@ -445,6 +445,7 @@
         self.compiler.set_executables(**args)
 
     def build_extensions(self):
+        return
         self.set_srcdir()
         self.set_compiler_executables()
         self.configure_compiler()