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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
|
diff -uN Python-2.6.2/configure Python-2.6.2POld/configure
--- Python-2.6.2/configure 2009-03-31 03:56:14.000000000 +1000
@@ -24326,14 +24326,14 @@
{ echo "$as_me:$LINENO: checking for %zd printf() format support" >&5
echo $ECHO_N "checking for %zd printf() format support... $ECHO_C" >&6; }
-if test "$cross_compiling" = yes; then
- { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run test program while cross compiling
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-else
- cat >conftest.$ac_ext <<_ACEOF
+#if test "$cross_compiling" = yes; then
+# { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+#See \`config.log' for more details." >&5
+#echo "$as_me: error: cannot run test program while cross compiling
+#See \`config.log' for more details." >&2;}
+# { (exit 1); exit 1; }; }
+#else
+cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -24411,7 +24411,7 @@
echo "${ECHO_T}no" >&6; }
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
+#fi
diff -uN Python-2.6.2/configure.in Python-2.6.2POld/configure.in
--- Python-2.6.2/configure.in 2009-03-31 03:56:14.000000000 +1000
+++ Python-2.6.2POld/configure.in 2009-08-17 12:19:15.000000000 +1000
@@ -3656,48 +3656,48 @@
AC_MSG_RESULT(no)
fi
-AC_MSG_CHECKING(for %zd printf() format support)
-AC_TRY_RUN([#include <stdio.h>
-#include <stddef.h>
-#include <string.h>
-
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-
-#ifdef HAVE_SSIZE_T
-typedef ssize_t Py_ssize_t;
-#elif SIZEOF_VOID_P == SIZEOF_LONG
-typedef long Py_ssize_t;
-#else
-typedef int Py_ssize_t;
-#endif
-
-int main()
-{
- char buffer[256];
-
- if(sprintf(buffer, "%zd", (size_t)123) < 0)
- return 1;
-
- if (strcmp(buffer, "123"))
- return 1;
-
- if (sprintf(buffer, "%zd", (Py_ssize_t)-123) < 0)
- return 1;
-
- if (strcmp(buffer, "-123"))
- return 1;
-
- return 0;
-}],
-[AC_MSG_RESULT(yes)
- AC_DEFINE(PY_FORMAT_SIZE_T, "z", [Define to printf format modifier for Py_ssize_t])],
- AC_MSG_RESULT(no))
+#AC_MSG_CHECKING(for %zd printf() format support)
+#AC_TRY_RUN([#include <stdio.h>
+##include <stddef.h>
+##include <string.h>
+
+##ifdef HAVE_SYS_TYPES_H
+##include <sys/types.h>
+##endif
+
+##ifdef HAVE_SSIZE_T
+#typedef ssize_t Py_ssize_t;
+##elif SIZEOF_VOID_P == SIZEOF_LONG
+#typedef long Py_ssize_t;
+##else
+#typedef int Py_ssize_t;
+##endif
+#
+#int main()
+#{
+# char buffer[256];
+#
+# if(sprintf(buffer, "%zd", (size_t)123) < 0)
+# return 1;#
+#
+# if (strcmp(buffer, "123"))
+# return 1;
+#
+# if (sprintf(buffer, "%zd", (Py_ssize_t)-123) < 0)
+# return 1;
+#
+# if (strcmp(buffer, "-123"))
+# return 1;
+#
+# return 0;
+#}],
+#[AC_MSG_RESULT(yes)
+# AC_DEFINE(PY_FORMAT_SIZE_T, "z", [Define to printf format modifier for Py_ssize_t])],
+# AC_MSG_RESULT(no))
AC_CHECK_TYPE(socklen_t,,
AC_DEFINE(socklen_t,int,
- Define to `int' if <sys/socket.h> does not define.),[
+ Define to 'int' if <sys/socket.h> does not define.),[
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
diff -uN Python-2.6.2/Makefile.pre.in Python-2.6.2POld/Makefile.pre.in
--- Python-2.6.2/Makefile.pre.in 2009-02-24 21:07:44.000000000 +1000
+++ Python-2.6.2POld/Makefile.pre.in 2009-08-17 12:19:15.000000000 +1000
@@ -175,6 +175,7 @@
PYTHON= python$(EXE)
BUILDPYTHON= python$(BUILDEXE)
+HOSTPYTHON= ./$(BUILDPYTHON)
# The task to run while instrument when building the profile-opt target
PROFILE_TASK= $(srcdir)/Tools/pybench/pybench.py -n 2 --with-gc --with-syscheck
@@ -206,6 +207,8 @@
# Parser
PGEN= Parser/pgen$(EXE)
+HOSTPGEN= $(PGEN)
+
POBJS= \
Parser/acceler.o \
Parser/grammar1.o \
@@ -394,8 +397,8 @@
# Build the shared modules
sharedmods: $(BUILDPYTHON)
@case $$MAKEFLAGS in \
- *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \
- *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
+ *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' $(HOSTPYTHON) -E $(srcdir)/setup.py -q build;; \
+ *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' $(HOSTPYTHON) -E $(srcdir)/setup.py build;; \
esac
# Build static library
@@ -517,7 +520,7 @@
$(GRAMMAR_H) $(GRAMMAR_C): $(PGEN) $(GRAMMAR_INPUT)
-@$(INSTALL) -d Include
- -$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
+ -$(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
$(PGEN): $(PGENOBJS)
$(CC) $(OPT) $(LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN)
@@ -886,24 +889,24 @@
done; \
done
$(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
- PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
- ./$(BUILDPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
+ -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+ $(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
-d $(LIBDEST) -f \
-x 'bad_coding|badsyntax|site-packages' $(DESTDIR)$(LIBDEST)
- PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
- ./$(BUILDPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
+ -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+ $(HOSTPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
-d $(LIBDEST) -f \
-x 'bad_coding|badsyntax|site-packages' $(DESTDIR)$(LIBDEST)
-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
- ./$(BUILDPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
+ $(HOSTPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
-d $(LIBDEST)/site-packages -f \
-x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
- ./$(BUILDPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
+ $(HOSTPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
-d $(LIBDEST)/site-packages -f \
-x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
- ./$(BUILDPYTHON) -Wi -t -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()"
+ $(HOSTPYTHON) -Wi -t -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()"
# Create the PLATDIR source directory, if one wasn't distributed..
$(srcdir)/Lib/$(PLATDIR):
@@ -1001,7 +1004,8 @@
# Install the dynamically loadable modules
# This goes into $(exec_prefix)
sharedinstall:
- $(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \
+ CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' CROSS_COMPILE='$(CROSS_COMPILE)' \
+ $(RUNSHARED) $(HOSTPYTHON) -E $(srcdir)/setup.py install \
--prefix=$(prefix) \
--install-scripts=$(BINDIR) \
--install-platlib=$(DESTSHARED) \
diff -uN Python-2.6.2/setup.py Python-2.6.2POld/setup.py
--- Python-2.6.2/setup.py 2009-04-01 04:20:48.000000000 +1000
+++ Python-2.6.2POld/setup.py 2009-08-17 12:19:15.000000000 +1000
@@ -17,7 +17,7 @@
from distutils.command.install_lib import install_lib
# This global variable is used to hold the list of modules to be disabled.
-disabled_module_list = []
+disabled_module_list = ['_ctypes', '_curses', '_curses_panel', '_cursesmodule', '_tkinter', 'syslogmodule', 'nismodule']
def add_dir_to_list(dirlist, dir):
"""Add the directory 'dir' to the list 'dirlist' (at the front) if
@@ -267,33 +267,40 @@
self.announce('WARNING: skipping import check for Cygwin-based "%s"'
% ext.name)
return
+ if os.environ.get('CROSS_COMPILE_TARGET') == 'yes':
+ return
+
ext_filename = os.path.join(
self.build_lib,
self.get_ext_filename(self.get_ext_fullname(ext.name)))
try:
imp.load_dynamic(ext.name, ext_filename)
except ImportError, why:
- self.failed.append(ext.name)
- self.announce('*** WARNING: renaming "%s" since importing it'
- ' failed: %s' % (ext.name, why), level=3)
- assert not self.inplace
- basename, tail = os.path.splitext(ext_filename)
- newname = basename + "_failed" + tail
- if os.path.exists(newname):
- os.remove(newname)
- os.rename(ext_filename, newname)
-
- # XXX -- This relies on a Vile HACK in
- # distutils.command.build_ext.build_extension(). The
- # _built_objects attribute is stored there strictly for
- # use here.
- # If there is a failure, _built_objects may not be there,
- # so catch the AttributeError and move on.
- try:
- for filename in self._built_objects:
- os.remove(filename)
- except AttributeError:
- self.announce('unable to remove files (ignored)')
+ if os.environ.get('CROSS_COMPILE_TARGET') != "yes":
+ self.announce('*** WARNING: renaming "%s" since importing it'
+ ' failed: %s' % (ext.name, why), level=3)
+ assert not self.inplace
+ basename, tail = os.path.splitext(ext_filename)
+ newname = basename + "_failed" + tail
+ if os.path.exists(newname):
+ os.remove(newname)
+ os.rename(ext_filename, newname)
+
+ # XXX -- This relies on a Vile HACK in
+ # distutils.command.build_ext.build_extension(). The
+ # _built_objects attribute is stored there strictly for
+ # use here.
+ # If there is a failure, _built_objects may not be there,
+ # so catch the AttributeError and move on.
+ try:
+ for filename in self._built_objects:
+ os.remove(filename)
+ except AttributeError:
+ self.announce('unable to remove files (ignored)')
+ else:
+ self.announce('WARNING: "%s" failed importing, but we leave it '
+ 'because we are cross-compiling' %
+ ext.name)
except:
exc_type, why, tb = sys.exc_info()
self.announce('*** WARNING: importing extension "%s" '
@@ -665,7 +672,7 @@
if (ssl_incs is not None and
ssl_libs is not None and
- openssl_ver >= 0x00907000):
+ openssl_ver >= 0x00907000 and False):
# The _hashlib module wraps optimized implementations
# of hash functions from the OpenSSL library.
exts.append( Extension('_hashlib', ['_hashopenssl.c'],
@@ -685,7 +692,7 @@
depends = ['md5.h']) )
missing.append('_hashlib')
- if (openssl_ver < 0x00908000):
+ if (True or openssl_ver < 0x00908000):
# OpenSSL doesn't do these until 0.9.8 so we'll bring our own hash
exts.append( Extension('_sha256', ['sha256module.c']) )
exts.append( Extension('_sha512', ['sha512module.c']) )
|