CRUX-ARM : Home

Home :: Documentation :: Download :: Development :: Community :: Ports :: Packages :: Bugs :: Links :: About :: Donors
openbox: initial import (verified compilation)
[attic/ports/opt-cross.git] / python / python-2.6.4.cross_compilation.patch
1 diff -purN Python-2.6.4.orig/Lib/cgi.py Python-2.6.4/Lib/cgi.py
2 --- Python-2.6.4.orig/Lib/cgi.py 2010-01-27 09:00:02.000000000 +0100
3 +++ Python-2.6.4/Lib/cgi.py 2010-01-27 09:02:58.000000000 +0100
4 @@ -1,4 +1,4 @@
5 -#! /usr/local/bin/python
6 +#! /usr/bin/python
7
8 # NOTE: the above "/usr/local/bin/python" is NOT a mistake. It is
9 # intentionally NOT "/usr/bin/env python". On many systems
10 diff -purN Python-2.6.4.orig/Makefile.pre.in Python-2.6.4/Makefile.pre.in
11 --- Python-2.6.4.orig/Makefile.pre.in 2010-01-27 09:00:02.000000000 +0100
12 +++ Python-2.6.4/Makefile.pre.in 2010-01-27 09:00:24.000000000 +0100
13 @@ -175,6 +175,7 @@ UNICODE_OBJS= @UNICODE_OBJS@
14
15 PYTHON= python$(EXE)
16 BUILDPYTHON= python$(BUILDEXE)
17 +HOSTPYTHON= ./$(BUILDPYTHON)
18
19 # The task to run while instrument when building the profile-opt target
20 PROFILE_TASK= $(srcdir)/Tools/pybench/pybench.py -n 2 --with-gc --with-syscheck
21 @@ -206,6 +207,8 @@ GRAMMAR_INPUT= $(srcdir)/Grammar/Grammar
22 # Parser
23 PGEN= Parser/pgen$(EXE)
24
25 +HOSTPGEN= $(PGEN)
26 +
27 POBJS= \
28 Parser/acceler.o \
29 Parser/grammar1.o \
30 @@ -394,8 +397,8 @@ platform: $(BUILDPYTHON)
31 # Build the shared modules
32 sharedmods: $(BUILDPYTHON)
33 @case $$MAKEFLAGS in \
34 - *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \
35 - *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
36 + *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' $(HOSTPYTHON) -E $(srcdir)/setup.py -q build;; \
37 + *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' $(HOSTPYTHON) -E $(srcdir)/setup.py build;; \
38 esac
39
40 # Build static library
41 @@ -517,7 +520,7 @@ Modules/python.o: $(srcdir)/Modules/pyth
42
43 $(GRAMMAR_H) $(GRAMMAR_C): $(PGEN) $(GRAMMAR_INPUT)
44 -@$(INSTALL) -d Include
45 - -$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
46 + -$(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
47
48 $(PGEN): $(PGENOBJS)
49 $(CC) $(OPT) $(LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN)
50 @@ -886,24 +889,24 @@ libinstall: build_all $(srcdir)/Lib/$(PL
51 done; \
52 done
53 $(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
54 - PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
55 - ./$(BUILDPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
56 + -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
57 + $(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
58 -d $(LIBDEST) -f \
59 -x 'bad_coding|badsyntax|site-packages' $(DESTDIR)$(LIBDEST)
60 - PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
61 - ./$(BUILDPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
62 + -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
63 + $(HOSTPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
64 -d $(LIBDEST) -f \
65 -x 'bad_coding|badsyntax|site-packages' $(DESTDIR)$(LIBDEST)
66 -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
67 - ./$(BUILDPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
68 + $(HOSTPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
69 -d $(LIBDEST)/site-packages -f \
70 -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
71 -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
72 - ./$(BUILDPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
73 + $(HOSTPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
74 -d $(LIBDEST)/site-packages -f \
75 -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
76 -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
77 - ./$(BUILDPYTHON) -Wi -t -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()"
78 + $(HOSTPYTHON) -Wi -t -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()"
79
80 # Create the PLATDIR source directory, if one wasn't distributed..
81 $(srcdir)/Lib/$(PLATDIR):
82 @@ -1001,8 +1004,9 @@ libainstall: all
83 # Install the dynamically loadable modules
84 # This goes into $(exec_prefix)
85 sharedinstall:
86 - $(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \
87 - --prefix=$(prefix) \
88 + CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' CROSS_COMPILE='$(CROSS_COMPILE)' \
89 + $(RUNSHARED) $(HOSTPYTHON) -E $(srcdir)/setup.py install \
90 + --prefix=$(prefix) \
91 --install-scripts=$(BINDIR) \
92 --install-platlib=$(DESTSHARED) \
93 --root=/$(DESTDIR)
94 diff -purN Python-2.6.4.orig/Modules/Setup.dist Python-2.6.4/Modules/Setup.dist
95 --- Python-2.6.4.orig/Modules/Setup.dist 2010-01-27 09:00:02.000000000 +0100
96 +++ Python-2.6.4/Modules/Setup.dist 2010-01-27 10:30:15.000000000 +0100
97 @@ -152,7 +152,7 @@ GLHACK=-Dclear=__GLclear
98 # modules are to be built as shared libraries (see above for more
99 # detail; also note that *static* reverses this effect):
100
101 -#*shared*
102 +*shared*
103
104 # GNU readline. Unlike previous Python incarnations, GNU readline is
105 # now incorporated in an optional module, configured in the Setup file
106 @@ -162,16 +162,16 @@ GLHACK=-Dclear=__GLclear
107 # it, depending on your system -- see the GNU readline instructions.
108 # It's okay for this to be a shared library, too.
109
110 -#readline readline.c -lreadline -ltermcap
111 +readline readline.c -lreadline #-ltermcap
112
113
114 # Modules that should always be present (non UNIX dependent):
115
116 #array arraymodule.c # array objects
117 #cmath cmathmodule.c # -lm # complex math library functions
118 -#math mathmodule.c # -lm # math library functions, e.g. sin()
119 +math mathmodule.c # -lm # math library functions, e.g. sin()
120 #_struct _struct.c # binary structure packing/unpacking
121 -#time timemodule.c # -lm # time operations and variables
122 +time timemodule.c # -lm # time operations and variables
123 #operator operator.c # operator.add() and similar goodies
124 #_weakref _weakref.c # basic weak reference support
125 #_testcapi _testcapimodule.c # Python C API test module
126 @@ -182,7 +182,7 @@ GLHACK=-Dclear=__GLclear
127 #_functools _functoolsmodule.c # Tools for working with functions and callable objects
128 #_elementtree -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DUSE_PYEXPAT_CAPI _elementtree.c # elementtree accelerator
129 #_pickle _pickle.c # pickle accelerator
130 -#datetime datetimemodule.c # date/time type
131 +datetime datetimemodule.c # date/time type
132 #_bisect _bisectmodule.c # Bisection algorithms
133
134 #unicodedata unicodedata.c # static Unicode character database
135 @@ -198,7 +198,7 @@ GLHACK=-Dclear=__GLclear
136 #fcntl fcntlmodule.c # fcntl(2) and ioctl(2)
137 #spwd spwdmodule.c # spwd(3)
138 #grp grpmodule.c # grp(3)
139 -#select selectmodule.c # select(2); not on ancient System V
140 +select selectmodule.c # select(2); not on ancient System V
141
142 # Memory-mapped files (also works on Win32).
143 #mmap mmapmodule.c
144 @@ -207,7 +207,7 @@ GLHACK=-Dclear=__GLclear
145 #_csv _csv.c
146
147 # Socket module helper for socket(2)
148 -#_socket socketmodule.c
149 +_socket socketmodule.c
150
151 # Socket module helper for SSL support; you must comment out the other
152 # socket line above, and possibly edit the SSL variable:
153 @@ -302,7 +302,7 @@ GLHACK=-Dclear=__GLclear
154 # A Linux specific module -- off by default; this may also work on
155 # some *BSDs.
156
157 -#linuxaudiodev linuxaudiodev.c
158 +linuxaudiodev linuxaudiodev.c
159
160
161 # George Neville-Neil's timing module:
162 @@ -390,7 +390,7 @@ GLHACK=-Dclear=__GLclear
163 #
164 # First, look at Setup.config; configure may have set this for you.
165
166 -#dbm dbmmodule.c # dbm(3) may require -lndbm or similar
167 +dbm dbmmodule.c -DHAVE_NDBM_H -lgdbm_compat -lgdbm # dbm(3) may require -lndbm or similar
168
169 # Anthony Baxter's gdbm module. GNU dbm(3) will require -lgdbm:
170 #
171 diff -purN Python-2.6.4.orig/configure Python-2.6.4/configure
172 --- Python-2.6.4.orig/configure 2010-01-27 09:00:02.000000000 +0100
173 +++ Python-2.6.4/configure 2010-01-27 09:00:24.000000000 +0100
174 @@ -17190,151 +17190,17 @@ fi
175
176 fi
177
178 -
179 -# On Tru64, chflags seems to be present, but calling it will
180 -# exit Python
181 -{ echo "$as_me:$LINENO: checking for chflags" >&5
182 -echo $ECHO_N "checking for chflags... $ECHO_C" >&6; }
183 -if test "$cross_compiling" = yes; then
184 - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
185 -See \`config.log' for more details." >&5
186 -echo "$as_me: error: cannot run test program while cross compiling
187 -See \`config.log' for more details." >&2;}
188 - { (exit 1); exit 1; }; }
189 -else
190 - cat >conftest.$ac_ext <<_ACEOF
191 -/* confdefs.h. */
192 -_ACEOF
193 -cat confdefs.h >>conftest.$ac_ext
194 -cat >>conftest.$ac_ext <<_ACEOF
195 -/* end confdefs.h. */
196 -
197 -#include <sys/stat.h>
198 -#include <unistd.h>
199 -int main(int argc, char*argv[])
200 -{
201 - if(chflags(argv[0], 0) != 0)
202 - return 1;
203 - return 0;
204 -}
205 -
206 -_ACEOF
207 -rm -f conftest$ac_exeext
208 -if { (ac_try="$ac_link"
209 -case "(($ac_try" in
210 - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
211 - *) ac_try_echo=$ac_try;;
212 -esac
213 -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
214 - (eval "$ac_link") 2>&5
215 - ac_status=$?
216 - echo "$as_me:$LINENO: \$? = $ac_status" >&5
217 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
218 - { (case "(($ac_try" in
219 - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
220 - *) ac_try_echo=$ac_try;;
221 -esac
222 -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
223 - (eval "$ac_try") 2>&5
224 - ac_status=$?
225 - echo "$as_me:$LINENO: \$? = $ac_status" >&5
226 - (exit $ac_status); }; }; then
227 -
228 -cat >>confdefs.h <<\_ACEOF
229 -#define HAVE_CHFLAGS 1
230 -_ACEOF
231 -
232 - { echo "$as_me:$LINENO: result: yes" >&5
233 -echo "${ECHO_T}yes" >&6; }
234 -else
235 - echo "$as_me: program exited with status $ac_status" >&5
236 -echo "$as_me: failed program was:" >&5
237 -sed 's/^/| /' conftest.$ac_ext >&5
238 -
239 -( exit $ac_status )
240 -{ echo "$as_me:$LINENO: result: no" >&5
241 -echo "${ECHO_T}no" >&6; }
242 -
243 -fi
244 -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
245 -fi
246 -
247 -
248 -
249 -{ echo "$as_me:$LINENO: checking for lchflags" >&5
250 -echo $ECHO_N "checking for lchflags... $ECHO_C" >&6; }
251 -if test "$cross_compiling" = yes; then
252 - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
253 -See \`config.log' for more details." >&5
254 -echo "$as_me: error: cannot run test program while cross compiling
255 -See \`config.log' for more details." >&2;}
256 - { (exit 1); exit 1; }; }
257 -else
258 - cat >conftest.$ac_ext <<_ACEOF
259 -/* confdefs.h. */
260 -_ACEOF
261 -cat confdefs.h >>conftest.$ac_ext
262 -cat >>conftest.$ac_ext <<_ACEOF
263 -/* end confdefs.h. */
264 -
265 -#include <sys/stat.h>
266 -#include <unistd.h>
267 -int main(int argc, char*argv[])
268 -{
269 - if(lchflags(argv[0], 0) != 0)
270 - return 1;
271 - return 0;
272 -}
273 -
274 -_ACEOF
275 -rm -f conftest$ac_exeext
276 -if { (ac_try="$ac_link"
277 -case "(($ac_try" in
278 - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
279 - *) ac_try_echo=$ac_try;;
280 -esac
281 -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
282 - (eval "$ac_link") 2>&5
283 - ac_status=$?
284 - echo "$as_me:$LINENO: \$? = $ac_status" >&5
285 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
286 - { (case "(($ac_try" in
287 - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
288 - *) ac_try_echo=$ac_try;;
289 -esac
290 -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
291 - (eval "$ac_try") 2>&5
292 - ac_status=$?
293 - echo "$as_me:$LINENO: \$? = $ac_status" >&5
294 - (exit $ac_status); }; }; then
295 -
296 -cat >>confdefs.h <<\_ACEOF
297 -#define HAVE_LCHFLAGS 1
298 -_ACEOF
299 -
300 - { echo "$as_me:$LINENO: result: yes" >&5
301 -echo "${ECHO_T}yes" >&6; }
302 -else
303 - echo "$as_me: program exited with status $ac_status" >&5
304 -echo "$as_me: failed program was:" >&5
305 -sed 's/^/| /' conftest.$ac_ext >&5
306 -
307 -( exit $ac_status )
308 -{ echo "$as_me:$LINENO: result: no" >&5
309 -echo "${ECHO_T}no" >&6; }
310 -
311 -fi
312 -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
313 -fi
314 -
315 -
316 +#cat >>confdefs.h <<_ACEOF
317 +##define HAVE_CHFLAGS 0
318 +##define HAVE_LCHFLAGS 0
319 +#_ACEOF
320
321 case $ac_sys_system/$ac_sys_release in
322 Darwin/*)
323 _CUR_CFLAGS="${CFLAGS}"
324 _CUR_LDFLAGS="${LDFLAGS}"
325 CFLAGS="${CFLAGS} -Wl,-search_paths_first"
326 - LDFLAGS="${LDFLAGS} -Wl,-search_paths_first -L/usr/local/lib"
327 + LDFLAGS="${LDFLAGS} -Wl,-search_paths_first -L/usr/lib"
328 ;;
329 esac
330
331 @@ -24749,95 +24615,11 @@ else
332 echo "${ECHO_T}no" >&6; }
333 fi
334
335 -{ echo "$as_me:$LINENO: checking for %zd printf() format support" >&5
336 -echo $ECHO_N "checking for %zd printf() format support... $ECHO_C" >&6; }
337 -if test "$cross_compiling" = yes; then
338 - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
339 -See \`config.log' for more details." >&5
340 -echo "$as_me: error: cannot run test program while cross compiling
341 -See \`config.log' for more details." >&2;}
342 - { (exit 1); exit 1; }; }
343 -else
344 - cat >conftest.$ac_ext <<_ACEOF
345 -/* confdefs.h. */
346 -_ACEOF
347 -cat confdefs.h >>conftest.$ac_ext
348 -cat >>conftest.$ac_ext <<_ACEOF
349 -/* end confdefs.h. */
350 -#include <stdio.h>
351 -#include <stddef.h>
352 -#include <string.h>
353 -
354 -#ifdef HAVE_SYS_TYPES_H
355 -#include <sys/types.h>
356 -#endif
357 -
358 -#ifdef HAVE_SSIZE_T
359 -typedef ssize_t Py_ssize_t;
360 -#elif SIZEOF_VOID_P == SIZEOF_LONG
361 -typedef long Py_ssize_t;
362 -#else
363 -typedef int Py_ssize_t;
364 -#endif
365 -
366 -int main()
367 -{
368 - char buffer[256];
369 -
370 - if(sprintf(buffer, "%zd", (size_t)123) < 0)
371 - return 1;
372 -
373 - if (strcmp(buffer, "123"))
374 - return 1;
375 -
376 - if (sprintf(buffer, "%zd", (Py_ssize_t)-123) < 0)
377 - return 1;
378 -
379 - if (strcmp(buffer, "-123"))
380 - return 1;
381 -
382 - return 0;
383 -}
384 -_ACEOF
385 -rm -f conftest$ac_exeext
386 -if { (ac_try="$ac_link"
387 -case "(($ac_try" in
388 - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
389 - *) ac_try_echo=$ac_try;;
390 -esac
391 -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
392 - (eval "$ac_link") 2>&5
393 - ac_status=$?
394 - echo "$as_me:$LINENO: \$? = $ac_status" >&5
395 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
396 - { (case "(($ac_try" in
397 - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
398 - *) ac_try_echo=$ac_try;;
399 -esac
400 -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
401 - (eval "$ac_try") 2>&5
402 - ac_status=$?
403 - echo "$as_me:$LINENO: \$? = $ac_status" >&5
404 - (exit $ac_status); }; }; then
405 - { echo "$as_me:$LINENO: result: yes" >&5
406 -echo "${ECHO_T}yes" >&6; }
407 -
408 cat >>confdefs.h <<\_ACEOF
409 #define PY_FORMAT_SIZE_T "z"
410 _ACEOF
411
412 -else
413 - echo "$as_me: program exited with status $ac_status" >&5
414 -echo "$as_me: failed program was:" >&5
415 -sed 's/^/| /' conftest.$ac_ext >&5
416 -
417 -( exit $ac_status )
418 -{ echo "$as_me:$LINENO: result: no" >&5
419 -echo "${ECHO_T}no" >&6; }
420 -fi
421 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
422 -fi
423 -
424
425
426 { echo "$as_me:$LINENO: checking for socklen_t" >&5
427 diff -purN Python-2.6.4.orig/setup.py Python-2.6.4/setup.py
428 --- Python-2.6.4.orig/setup.py 2010-01-27 09:00:02.000000000 +0100
429 +++ Python-2.6.4/setup.py 2010-01-27 09:00:24.000000000 +0100
430 @@ -273,15 +273,15 @@ class PyBuildExt(build_ext):
431 try:
432 imp.load_dynamic(ext.name, ext_filename)
433 except ImportError, why:
434 - self.failed.append(ext.name)
435 - self.announce('*** WARNING: renaming "%s" since importing it'
436 - ' failed: %s' % (ext.name, why), level=3)
437 - assert not self.inplace
438 - basename, tail = os.path.splitext(ext_filename)
439 - newname = basename + "_failed" + tail
440 - if os.path.exists(newname):
441 - os.remove(newname)
442 - os.rename(ext_filename, newname)
443 + #self.failed.append(ext.name)
444 + self.announce(' '
445 + ' ', level=3)
446 + #assert not self.inplace
447 + #basename, tail = os.path.splitext(ext_filename)
448 + #newname = basename + "_failed" + tail
449 + #if os.path.exists(newname):
450 + # os.remove(newname)
451 + #os.rename(ext_filename, newname)
452
453 # XXX -- This relies on a Vile HACK in
454 # distutils.command.build_ext.build_extension(). The
455 @@ -289,11 +289,11 @@ class PyBuildExt(build_ext):
456 # use here.
457 # If there is a failure, _built_objects may not be there,
458 # so catch the AttributeError and move on.
459 - try:
460 - for filename in self._built_objects:
461 - os.remove(filename)
462 - except AttributeError:
463 - self.announce('unable to remove files (ignored)')
464 + #try:
465 + # for filename in self._built_objects:
466 + # os.remove(filename)
467 + #except AttributeError:
468 + # self.announce('unable to remove files (ignored)')
469 except:
470 exc_type, why, tb = sys.exc_info()
471 self.announce('*** WARNING: importing extension "%s" '