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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
|
Only in Python-2.7.15+iPhone/Lib: _scproxy.py
diff -ur Python-2.7.15/Makefile.pre.in Python-2.7.15+iPhone/Makefile.pre.in
--- Python-2.7.15/Makefile.pre.in 2018-04-29 12:47:33.000000000 -1000
+++ Python-2.7.15+iPhone/Makefile.pre.in 2018-09-04 18:39:57.000000000 -1000
@@ -1131,28 +1131,30 @@
$(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \
$(DESTDIR)$(LIBDEST)/distutils/tests ; \
fi
- PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
- $(PYTHON_FOR_BUILD) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
- -d $(LIBDEST) -f \
- -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
- $(DESTDIR)$(LIBDEST)
- PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
- $(PYTHON_FOR_BUILD) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
- -d $(LIBDEST) -f \
- -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
- $(DESTDIR)$(LIBDEST)
- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
- $(PYTHON_FOR_BUILD) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
- -d $(LIBDEST)/site-packages -f \
- -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
- $(PYTHON_FOR_BUILD) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
- -d $(LIBDEST)/site-packages -f \
- -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
- $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt
- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
- $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/PatternGrammar.txt
+# compile use host python, which may not be 2.7.9, which lead to fail.
+# So, we not compile, by srplab
+# PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+# $(PYTHON_FOR_BUILD) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
+# -d $(LIBDEST) -f \
+# -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
+# $(DESTDIR)$(LIBDEST)
+# PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+# $(PYTHON_FOR_BUILD) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
+# -d $(LIBDEST) -f \
+# -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
+# $(DESTDIR)$(LIBDEST)
+# -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+# $(PYTHON_FOR_BUILD) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
+# -d $(LIBDEST)/site-packages -f \
+# -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
+# -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+# $(PYTHON_FOR_BUILD) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
+# -d $(LIBDEST)/site-packages -f \
+# -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
+# -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+# $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt
+# -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+# $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/PatternGrammar.txt
# Create the PLATDIR source directory, if one wasn't distributed..
$(srcdir)/Lib/$(PLATDIR):
Only in Python-2.7.15+iPhone: Makefile.pre.in.orig
diff -ur Python-2.7.15/Python/dynload_shlib.c Python-2.7.15+iPhone/Python/dynload_shlib.c
--- Python-2.7.15/Python/dynload_shlib.c 2018-04-29 12:47:33.000000000 -1000
+++ Python-2.7.15+iPhone/Python/dynload_shlib.c 2018-09-04 18:39:57.000000000 -1000
@@ -84,6 +84,14 @@
PyOS_snprintf(funcname, sizeof(funcname),
LEAD_UNDERSCORE "init%.200s", shortname);
+ /* On IOS, dlopen crash as soon as we try to open one of our library.
+ * Instead, we have done a redirection of linking to convert our .so into a
+ * .a. Then the main executable is linked with theses symbol. So, instead
+ * of trying to dlopen, directly do the dlsym.
+ * -- Mathieu
+ */
+ return (dl_funcptr) dlsym(RTLD_DEFAULT, funcname);
+#if 0
if (fp != NULL) {
int i;
struct stat statb;
@@ -140,4 +148,5 @@
handles[nhandles++].handle = handle;
p = (dl_funcptr) dlsym(handle, funcname);
return p;
+#endif
}
diff -ur Python-2.7.15/Python/pythonrun.c Python-2.7.15+iPhone/Python/pythonrun.c
--- Python-2.7.15/Python/pythonrun.c 2018-04-29 12:47:33.000000000 -1000
+++ Python-2.7.15+iPhone/Python/pythonrun.c 2018-09-04 18:39:57.000000000 -1000
@@ -287,8 +287,10 @@
_PyGILState_Init(interp, tstate);
#endif /* WITH_THREAD */
+#if 0
if (!Py_NoSiteFlag)
initsite(); /* Module site */
+#endif
if ((p = Py_GETENV("PYTHONIOENCODING")) && *p != '\0') {
p = icodeset = codeset = strdup(p);
Only in Python-2.7.15+iPhone/Python: pythonrun.c.orig
Only in Python-2.7.15+iPhone: config.site
diff -ur Python-2.7.15/configure Python-2.7.15+iPhone/configure
--- Python-2.7.15/configure 2018-04-29 12:47:33.000000000 -1000
+++ Python-2.7.15+iPhone/configure 2018-09-04 18:39:57.000000000 -1000
@@ -3287,6 +3287,9 @@
*-*-cygwin*)
ac_sys_system=Cygwin
;;
+ *-*-darwin*)
+ ac_sys_system=Darwin
+ ;;
*)
# for now, limit cross builds to known configurations
MACHDEP="unknown"
@@ -3333,6 +3336,15 @@
*-*-cygwin*)
_host_cpu=
;;
+ *-*-darwin*)
+ case "$host_cpu" in
+ arm*)
+ _host_cpu=arm
+ ;;
+ *)
+ _host_cpu=$host_cpu
+ esac
+ ;;
*)
# for now, limit cross builds to known configurations
MACHDEP="unknown"
Only in Python-2.7.15+iPhone: configure.orig
diff -ur Python-2.7.15/setup.py Python-2.7.15+iPhone/setup.py
--- Python-2.7.15/setup.py 2018-04-29 12:47:33.000000000 -1000
+++ Python-2.7.15+iPhone/setup.py 2018-09-04 18:40:07.000000000 -1000
@@ -188,7 +188,7 @@
ext_map = dict((ext.name, i) for i, ext in enumerate(extensions))
if "_ctypes" in ext_map:
ctypes = extensions.pop(ext_map["_ctypes"])
- extensions.append(ctypes)
+ # extensions.append(ctypes) # not build ctypes, by srplab
self.extensions = extensions
# Fix up the autodetected modules, prefixing all the source files
@@ -1433,8 +1433,8 @@
missing.append('zlib')
else:
missing.append('zlib')
- else:
- missing.append('zlib')
+ #else:
+ # missing.append('zlib')
# Helper module for various ascii-encoders. Uses zlib for an optimized
# crc32 if we have it. Otherwise binascii uses its own.
Only in Python-2.7.15+iPhone: setup.py.orig
|