Update python to 2.6.1.
[openwrt/svn-archive/archive.git] / lang / python / patches / 000-cross-compile.patch
1 Index: Python-2.5.1/Makefile.pre.in
2 ===================================================================
3 --- Python-2.5.1.orig/Makefile.pre.in 2007-07-30 12:55:24.000000000 -0500
4 +++ Python-2.5.1/Makefile.pre.in 2007-07-30 12:55:24.000000000 -0500
5 @@ -175,6 +175,7 @@
6
7 PYTHON= python$(EXE)
8 BUILDPYTHON= python$(BUILDEXE)
9 +HOSTPYTHON= $(BUILDPYTHON)
10
11 # === Definitions added by makesetup ===
12
13 @@ -205,7 +206,7 @@
14 ##########################################################################
15 # Parser
16 PGEN= Parser/pgen$(EXE)
17 -
18 +HOSTPGEN= $(PGEN)$(EXE)
19 POBJS= \
20 Parser/acceler.o \
21 Parser/grammar1.o \
22 @@ -394,8 +395,8 @@
23 # Build the shared modules
24 sharedmods: $(BUILDPYTHON)
25 @case $$MAKEFLAGS in \
26 - *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \
27 - *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
28 + *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' $(HOSTPYTHON) -E $(srcdir)/setup.py -q build;; \
29 + *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' $(HOSTPYTHON) -E $(srcdir)/setup.py build;; \
30 esac
31
32 # Build static library
33 @@ -512,8 +513,8 @@
34
35
36 $(GRAMMAR_H) $(GRAMMAR_C): $(PGEN) $(GRAMMAR_INPUT)
37 -@$(INSTALL) -d Include
38 - -$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
39 + -$(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
40
41 $(PGEN): $(PGENOBJS)
42 $(CC) $(OPT) $(LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN)
43 @@ -993,7 +994,7 @@
44 # Install the dynamically loadable modules
45 # This goes into $(exec_prefix)
46 sharedinstall:
47 - $(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \
48 + $(RUNSHARED) $(HOSTPYTHON) -E $(srcdir)/setup.py install \
49 --prefix=$(prefix) \
50 --install-scripts=$(BINDIR) \
51 --install-platlib=$(DESTSHARED) \
52 diff --git a/Makefile.pre.in b/Makefile.pre.in
53 index c2ce5c6..63dc91e 100644
54 --- a/Makefile.pre.in
55 +++ b/Makefile.pre.in
56 @@ -371,7 +371,7 @@ build_all_generate_profile:
57 $(MAKE) all CFLAGS="$(CFLAGS) -fprofile-generate" LIBS="$(LIBS) -lgcov"
58
59 run_profile_task:
60 - ./$(BUILDPYTHON) $(PROFILE_TASK)
61 + $(HOSTPYTHON) $(PROFILE_TASK)
62
63 build_all_use_profile:
64 $(MAKE) all CFLAGS="$(CFLAGS) -fprofile-use"
65 @@ -389,7 +389,7 @@ $(BUILDPYTHON): Modules/python.o $(LIBRARY) $(LDLIBRARY)
66 $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
67
68 platform: $(BUILDPYTHON)
69 - $(RUNSHARED) ./$(BUILDPYTHON) -E -c 'import sys ; from distutils.util import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform
70 + $(RUNSHARED) $(HOSTPYTHON) -E -c 'import sys ; from distutils.util import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform
71
72
73 # Build the shared modules
74 @@ -669,7 +669,7 @@ $(LIBRARY_OBJS) $(MODOBJS) Modules/python.o: $(PYTHON_HEADERS)
75
76 TESTOPTS= -l $(EXTRATESTOPTS)
77 TESTPROG= $(srcdir)/Lib/test/regrtest.py
78 -TESTPYTHON= $(RUNSHARED) ./$(BUILDPYTHON) -E -tt
79 +TESTPYTHON= $(RUNSHARED) $(HOSTPYTHON) -E -tt
80 test: all platform
81 -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
82
83 @@ -1032,7 +1014,7 @@ frameworkinstallstructure: $(LDLIBRARY)
84 fi; \
85 done
86 $(LN) -fsn include/python$(VERSION) $(DESTDIR)$(prefix)/Headers
87 - sed 's/%VERSION%/'"`$(RUNSHARED) ./$(BUILDPYTHON) -c 'import platform; print platform.python_version()'`"'/g' < $(RESSRCDIR)/Info.plist > $(DESTDIR)$(prefix)/Resources/Info.plist
88 + sed 's/%VERSION%/'"`$(RUNSHARED) $(HOSTPYTHON) -c 'import platform; print platform.python_version()'`"'/g' < $(RESSRCDIR)/Info.plist > $(DESTDIR)$(prefix)/Resources/Info.plist
89 $(LN) -fsn $(VERSION) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current
90 $(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/$(PYTHONFRAMEWORK)
91 $(LN) -fsn Versions/Current/Headers $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Headers
92 @@ -1074,7 +1056,7 @@ frameworkinstallextras:
93 # This installs a few of the useful scripts in Tools/scripts
94 scriptsinstall:
95 SRCDIR=$(srcdir) $(RUNSHARED) \
96 - ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/setup.py install \
97 + $(HOSTPYTHON) $(srcdir)/Tools/scripts/setup.py install \
98 --prefix=$(prefix) \
99 --install-scripts=$(BINDIR) \
100 --root=/$(DESTDIR)
101 @@ -1096,7 +1078,7 @@ config.status: $(srcdir)/configure
102
103 # Run reindent on the library
104 reindent:
105 - ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/reindent.py -r $(srcdir)/Lib
106 + $(HOSTPYTHON) $(srcdir)/Tools/scripts/reindent.py -r $(srcdir)/Lib
107
108 # Rerun configure with the same options as it was run last time,
109 # provided the config.status script exists
110 @@ -1192,7 +1174,7 @@ funny:
111
112 # Perform some verification checks on any modified files.
113 patchcheck:
114 - $(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/patchcheck.py
115 + $(RUNSHARED) $(HOSTPYTHON) $(srcdir)/Tools/scripts/patchcheck.py
116
117 # Dependencies
118