python: refresh patches
[openwrt/svn-archive/archive.git] / lang / python / patches / 000-cross-compile.patch
1 ---
2 Makefile.pre.in | 25 +++++++++++++------------
3 1 file changed, 13 insertions(+), 12 deletions(-)
4
5 --- Python-2.6.4.orig/Makefile.pre.in
6 +++ Python-2.6.4/Makefile.pre.in
7 @@ -175,6 +175,7 @@ UNICODE_OBJS= @UNICODE_OBJS@
8
9 PYTHON= python$(EXE)
10 BUILDPYTHON= python$(BUILDEXE)
11 +HOSTPYTHON= $(BUILDPYTHON)
12
13 # The task to run while instrument when building the profile-opt target
14 PROFILE_TASK= $(srcdir)/Tools/pybench/pybench.py -n 2 --with-gc --with-syscheck
15 @@ -205,7 +206,7 @@ GRAMMAR_INPUT= $(srcdir)/Grammar/Grammar
16 ##########################################################################
17 # Parser
18 PGEN= Parser/pgen$(EXE)
19 -
20 +HOSTPGEN= $(PGEN)$(EXE)
21 POBJS= \
22 Parser/acceler.o \
23 Parser/grammar1.o \
24 @@ -370,7 +371,7 @@ build_all_generate_profile:
25 $(MAKE) all CFLAGS="$(CFLAGS) -fprofile-generate" LIBS="$(LIBS) -lgcov"
26
27 run_profile_task:
28 - ./$(BUILDPYTHON) $(PROFILE_TASK)
29 + $(HOSTPYTHON) $(PROFILE_TASK)
30
31 build_all_use_profile:
32 $(MAKE) all CFLAGS="$(CFLAGS) -fprofile-use"
33 @@ -388,14 +389,14 @@ $(BUILDPYTHON): Modules/python.o $(LIBRA
34 $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
35
36 platform: $(BUILDPYTHON)
37 - $(RUNSHARED) ./$(BUILDPYTHON) -E -c 'import sys ; from distutils.util import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform
38 + $(RUNSHARED) $(HOSTPYTHON) -E -c 'import sys ; from distutils.util import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform
39
40
41 # Build the shared modules
42 sharedmods: $(BUILDPYTHON)
43 @case $$MAKEFLAGS in \
44 - *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \
45 - *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
46 + *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' $(HOSTPYTHON) -E $(srcdir)/setup.py -q build;; \
47 + *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' $(HOSTPYTHON) -E $(srcdir)/setup.py build;; \
48 esac
49
50 # Build static library
51 @@ -517,7 +518,7 @@ Modules/python.o: $(srcdir)/Modules/pyth
52
53 $(GRAMMAR_H) $(GRAMMAR_C): $(PGEN) $(GRAMMAR_INPUT)
54 -@$(INSTALL) -d Include
55 - -$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
56 + -$(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
57
58 $(PGEN): $(PGENOBJS)
59 $(CC) $(OPT) $(LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN)
60 @@ -676,7 +677,7 @@ $(LIBRARY_OBJS) $(MODOBJS) Modules/pytho
61
62 TESTOPTS= -l $(EXTRATESTOPTS)
63 TESTPROG= $(srcdir)/Lib/test/regrtest.py
64 -TESTPYTHON= $(RUNSHARED) ./$(BUILDPYTHON) -E -tt
65 +TESTPYTHON= $(RUNSHARED) $(HOSTPYTHON) -E -tt
66 test: all platform
67 -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
68 -$(TESTPYTHON) $(TESTPROG) $(TESTOPTS)
69 @@ -1001,7 +1002,7 @@ libainstall: all
70 # Install the dynamically loadable modules
71 # This goes into $(exec_prefix)
72 sharedinstall:
73 - $(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \
74 + $(RUNSHARED) $(HOSTPYTHON) -E $(srcdir)/setup.py install \
75 --prefix=$(prefix) \
76 --install-scripts=$(BINDIR) \
77 --install-platlib=$(DESTSHARED) \
78 @@ -1039,7 +1040,7 @@ frameworkinstallstructure: $(LDLIBRARY)
79 fi; \
80 done
81 $(LN) -fsn include/python$(VERSION) $(DESTDIR)$(prefix)/Headers
82 - sed 's/%VERSION%/'"`$(RUNSHARED) ./$(BUILDPYTHON) -c 'import platform; print platform.python_version()'`"'/g' < $(RESSRCDIR)/Info.plist > $(DESTDIR)$(prefix)/Resources/Info.plist
83 + sed 's/%VERSION%/'"`$(RUNSHARED) $(HOSTPYTHON) -c 'import platform; print platform.python_version()'`"'/g' < $(RESSRCDIR)/Info.plist > $(DESTDIR)$(prefix)/Resources/Info.plist
84 $(LN) -fsn $(VERSION) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current
85 $(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/$(PYTHONFRAMEWORK)
86 $(LN) -fsn Versions/Current/Headers $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Headers
87 @@ -1081,7 +1082,7 @@ frameworkinstallextras:
88 # This installs a few of the useful scripts in Tools/scripts
89 scriptsinstall:
90 SRCDIR=$(srcdir) $(RUNSHARED) \
91 - ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/setup.py install \
92 + $(HOSTPYTHON) $(srcdir)/Tools/scripts/setup.py install \
93 --prefix=$(prefix) \
94 --install-scripts=$(BINDIR) \
95 --root=/$(DESTDIR)
96 @@ -1103,7 +1104,7 @@ config.status: $(srcdir)/configure
97
98 # Run reindent on the library
99 reindent:
100 - ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/reindent.py -r $(srcdir)/Lib
101 + $(HOSTPYTHON) $(srcdir)/Tools/scripts/reindent.py -r $(srcdir)/Lib
102
103 # Rerun configure with the same options as it was run last time,
104 # provided the config.status script exists
105 @@ -1200,7 +1201,7 @@ funny:
106
107 # Perform some verification checks on any modified files.
108 patchcheck:
109 - $(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/patchcheck.py
110 + $(RUNSHARED) $(HOSTPYTHON) $(srcdir)/Tools/scripts/patchcheck.py
111
112 # Dependencies
113