Merge lp:~peter-pearse/ubuntu/natty/python2.7/prop002 into lp:ubuntu/natty/python2.7
- Natty (11.04)
- prop002
- Merge into natty
Proposed by
Peter Pearse
Status: | Needs review |
---|---|
Proposed branch: | lp:~peter-pearse/ubuntu/natty/python2.7/prop002 |
Merge into: | lp:ubuntu/natty/python2.7 |
Diff against target: |
508 lines (+302/-16) 4 files modified
debian/changelog (+10/-0) debian/patches/cross.diff (+172/-0) debian/patches/series.in (+1/-0) debian/rules (+119/-16) |
To merge this branch: | bzr merge lp:~peter-pearse/ubuntu/natty/python2.7/prop002 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Steve Langasek | Pending | ||
Review via email: mp+52712@code.launchpad.net |
Commit message
Description of the change
Note that https:/
Please review in parallel with https:/
To post a comment you must log in.
Unmerged revisions
- 28. By Peter Pearse
-
s patch - for detilas see debian/changelog
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'debian/changelog' | |||
2 | --- debian/changelog 2011-02-24 06:01:42 +0000 | |||
3 | +++ debian/changelog 2011-03-09 16:31:57 +0000 | |||
4 | @@ -1,3 +1,13 @@ | |||
5 | 1 | python2.7 (2.7.1-5ubuntu1) natty; urgency=low | ||
6 | 2 | |||
7 | 3 | * Makefile.pre.in - Use BUILDPYTHON where applicable for cross builds. | ||
8 | 4 | * setup.py - For cross builds, pass cross toolchain info in python | ||
9 | 5 | environment. | ||
10 | 6 | * debian/rules - Build a build host python for use during a cross | ||
11 | 7 | build. Adjust the configuration files & make environment accordingly. | ||
12 | 8 | |||
13 | 9 | -- Peter Pearse <peter.pearse@linaro.org> Wed, 09 Mar 2011 15:14:43 +0000 | ||
14 | 10 | |||
15 | 1 | python2.7 (2.7.1-5) experimental; urgency=low | 11 | python2.7 (2.7.1-5) experimental; urgency=low |
16 | 2 | 12 | ||
17 | 3 | * Update to 20110224, taken from the 2.7 branch. | 13 | * Update to 20110224, taken from the 2.7 branch. |
18 | 4 | 14 | ||
19 | === added file 'debian/patches/cross.diff' | |||
20 | --- debian/patches/cross.diff 1970-01-01 00:00:00 +0000 | |||
21 | +++ debian/patches/cross.diff 2011-03-09 16:31:57 +0000 | |||
22 | @@ -0,0 +1,172 @@ | |||
23 | 1 | diff -Nru p/Makefile.pre.in p_p/Makefile.pre.in | ||
24 | 2 | --- p/Makefile.pre.in 2011-03-08 16:00:53.000000000 +0000 | ||
25 | 3 | +++ p_p/Makefile.pre.in 2011-03-09 10:11:07.000000000 +0000 | ||
26 | 4 | @@ -214,6 +214,9 @@ | ||
27 | 5 | ########################################################################## | ||
28 | 6 | # Parser | ||
29 | 7 | PGEN= Parser/pgen$(EXE) | ||
30 | 8 | +# Allow override for cross build | ||
31 | 9 | +BUILDPGEN= $(PGEN) | ||
32 | 10 | + | ||
33 | 11 | |||
34 | 12 | POBJS= \ | ||
35 | 13 | Parser/acceler.o \ | ||
36 | 14 | @@ -365,7 +368,7 @@ | ||
37 | 15 | |||
38 | 16 | # Default target | ||
39 | 17 | all: build_all | ||
40 | 18 | -build_all: $(BUILDPYTHON) oldsharedmods sharedmods gdbhooks | ||
41 | 19 | +build_all: $(PYTHON) oldsharedmods sharedmods gdbhooks | ||
42 | 20 | |||
43 | 21 | # Compile a binary with gcc profile guided optimization. | ||
44 | 22 | profile-opt: | ||
45 | 23 | @@ -395,17 +398,17 @@ | ||
46 | 24 | |||
47 | 25 | |||
48 | 26 | # Build the interpreter | ||
49 | 27 | -$(BUILDPYTHON): Modules/python.o $(LIBRARY) $(LDLIBRARY) | ||
50 | 28 | +$(PYTHON): Modules/python.o $(LIBRARY) $(LDLIBRARY) | ||
51 | 29 | $(LINKCC) $(LDFLAGS) $(LINKFORSHARED) -o $@ \ | ||
52 | 30 | Modules/python.o \ | ||
53 | 31 | $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) | ||
54 | 32 | |||
55 | 33 | -platform: $(BUILDPYTHON) | ||
56 | 34 | +platform: $(PYTHON) | ||
57 | 35 | $(RUNSHARED) ./$(BUILDPYTHON) -E -c 'import sys ; from sysconfig import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform | ||
58 | 36 | |||
59 | 37 | |||
60 | 38 | # Build the shared modules | ||
61 | 39 | -sharedmods: $(BUILDPYTHON) | ||
62 | 40 | +sharedmods: $(PYTHON) | ||
63 | 41 | @case $$MAKEFLAGS in \ | ||
64 | 42 | *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \ | ||
65 | 43 | *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \ | ||
66 | 44 | @@ -443,11 +446,11 @@ | ||
67 | 45 | # | ||
68 | 46 | # Distributors are likely to want to install this somewhere else e.g. relative | ||
69 | 47 | # to the stripped DWARF data for the shared library. | ||
70 | 48 | -gdbhooks: $(BUILDPYTHON)-gdb.py | ||
71 | 49 | +gdbhooks: $(PYTHON)-gdb.py | ||
72 | 50 | |||
73 | 51 | SRC_GDB_HOOKS=$(srcdir)/Tools/gdb/libpython.py | ||
74 | 52 | -$(BUILDPYTHON)-gdb.py: $(SRC_GDB_HOOKS) | ||
75 | 53 | - $(INSTALL_DATA) $(SRC_GDB_HOOKS) $(BUILDPYTHON)-gdb.py | ||
76 | 54 | +$(PYTHON)-gdb.py: $(SRC_GDB_HOOKS) | ||
77 | 55 | + $(INSTALL_DATA) $(SRC_GDB_HOOKS) $(PYTHON)-gdb.py | ||
78 | 56 | |||
79 | 57 | # This rule is here for OPENSTEP/Rhapsody/MacOSX. It builds a temporary | ||
80 | 58 | # minimal framework (not including the Lib directory and such) in the current | ||
81 | 59 | @@ -541,9 +544,9 @@ | ||
82 | 60 | |||
83 | 61 | # Use a stamp file to prevent make -j invoking pgen twice | ||
84 | 62 | $(GRAMMAR_H) $(GRAMMAR_C): Parser/pgen.stamp | ||
85 | 63 | -Parser/pgen.stamp: $(PGEN) $(GRAMMAR_INPUT) | ||
86 | 64 | +Parser/pgen.stamp: $(BUILDPGEN) $(GRAMMAR_INPUT) | ||
87 | 65 | -@$(INSTALL) -d Include | ||
88 | 66 | - $(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) | ||
89 | 67 | + $(BUILDPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) | ||
90 | 68 | -touch Parser/pgen.stamp | ||
91 | 69 | |||
92 | 70 | $(PGEN): $(PGENOBJS) | ||
93 | 71 | @@ -802,7 +805,7 @@ | ||
94 | 72 | |||
95 | 73 | # Install the interpreter with $(VERSION) affixed | ||
96 | 74 | # This goes into $(exec_prefix) | ||
97 | 75 | -altbininstall: $(BUILDPYTHON) | ||
98 | 76 | +altbininstall: $(PYTHON) | ||
99 | 77 | @for i in $(BINDIR) $(LIBDIR); \ | ||
100 | 78 | do \ | ||
101 | 79 | if test ! -d $(DESTDIR)$$i; then \ | ||
102 | 80 | @@ -811,7 +814,7 @@ | ||
103 | 81 | else true; \ | ||
104 | 82 | fi; \ | ||
105 | 83 | done | ||
106 | 84 | - $(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE) | ||
107 | 85 | + $(INSTALL_PROGRAM) $(PYTHON) $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE) | ||
108 | 86 | if test -f $(LDLIBRARY); then \ | ||
109 | 87 | if test -n "$(DLLLIBRARY)" ; then \ | ||
110 | 88 | $(INSTALL_SHARED) $(DLLLIBRARY) $(DESTDIR)$(BINDIR); \ | ||
111 | 89 | @@ -1137,7 +1140,7 @@ | ||
112 | 90 | config.status: $(srcdir)/configure | ||
113 | 91 | $(SHELL) $(srcdir)/configure $(CONFIG_ARGS) | ||
114 | 92 | |||
115 | 93 | -.PRECIOUS: config.status $(BUILDPYTHON) Makefile Makefile.pre | ||
116 | 94 | +.PRECIOUS: config.status $(PYTHON) Makefile Makefile.pre | ||
117 | 95 | |||
118 | 96 | # Some make's put the object file in the current directory | ||
119 | 97 | .c.o: | ||
120 | 98 | @@ -1189,7 +1192,7 @@ | ||
121 | 99 | find . -name '*.gc??' -exec rm -f {} ';' | ||
122 | 100 | |||
123 | 101 | clobber: clean profile-removal | ||
124 | 102 | - -rm -f $(BUILDPYTHON) $(PGEN) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY) \ | ||
125 | 103 | + -rm -f $(PYTHON) $(PGEN) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY) \ | ||
126 | 104 | tags TAGS Parser/pgen.stamp \ | ||
127 | 105 | config.cache config.log pyconfig.h Modules/config.c | ||
128 | 106 | -rm -rf build platform | ||
129 | 107 | diff -Nru p/Modules/Setup.dist p_p/Modules/Setup.dist | ||
130 | 108 | --- p/Modules/Setup.dist 2011-03-08 16:00:53.000000000 +0000 | ||
131 | 109 | +++ p_p/Modules/Setup.dist 2011-03-08 16:53:15.000000000 +0000 | ||
132 | 110 | @@ -458,7 +458,9 @@ | ||
133 | 111 | # Andrew Kuchling's zlib module. | ||
134 | 112 | # This require zlib 1.1.3 (or later). | ||
135 | 113 | # See http://www.gzip.org/zlib/ | ||
136 | 114 | -#zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz | ||
137 | 115 | +# Well behaved toolchains should not require -L$(exec_prefix)/lib | ||
138 | 116 | +# - using it breaks cross builds | ||
139 | 117 | +#zlib zlibmodule.c -I$(prefix)/include -lz | ||
140 | 118 | |||
141 | 119 | # Interface to the Expat XML parser | ||
142 | 120 | # | ||
143 | 121 | diff -Nru p/setup.py p_p/setup.py | ||
144 | 122 | --- p/setup.py 2011-03-08 16:00:53.000000000 +0000 | ||
145 | 123 | +++ p_p/setup.py 2011-03-08 16:56:34.000000000 +0000 | ||
146 | 124 | @@ -225,6 +225,22 @@ | ||
147 | 125 | # When you run "make CC=altcc" or something similar, you really want | ||
148 | 126 | # those environment variables passed into the setup.py phase. Here's | ||
149 | 127 | # a small set of useful ones. | ||
150 | 128 | + | ||
151 | 129 | + # Change the environment for cross compiling | ||
152 | 130 | + # - may want to use environment variables for settings? | ||
153 | 131 | + if os.environ.get('CROSS_COMPILE'): | ||
154 | 132 | + exec_prefix=os.environ.get('CROSS_COMPILE') | ||
155 | 133 | + os.environ["CC"] = exec_prefix + '-gcc' | ||
156 | 134 | + os.environ["CXX"] = exec_prefix + '-g++' | ||
157 | 135 | + os.environ["LDSHARED"] = exec_prefix + '-gcc -shared' | ||
158 | 136 | + os.environ["CPP"] = exec_prefix + '-cpp' | ||
159 | 137 | + os.environ["LDFLAGS"] = '-L /usr/' + exec_prefix + '/lib -L /usr/' + exec_prefix + '/usr/lib' | ||
160 | 138 | + os.environ["CFLAGS"] = '-I/usr/' + exec_prefix + '/include -I/usr/' + exec_prefix + '/usr/include' | ||
161 | 139 | + # Use -D markers to detect if/where used | ||
162 | 140 | + os.environ["CPPFLAGS"] = '-DCPPFLAGS' | ||
163 | 141 | + os.environ["BASECFLAGS"] = '-DBASECFLAGS' | ||
164 | 142 | + os.environ["OPT"] = '-DOPT' | ||
165 | 143 | + | ||
166 | 144 | compiler = os.environ.get('CC') | ||
167 | 145 | args = {} | ||
168 | 146 | # unfortunately, distutils doesn't let us provide separate C and C++ | ||
169 | 147 | @@ -304,6 +320,13 @@ | ||
170 | 148 | self.announce('WARNING: skipping import check for Cygwin-based "%s"' | ||
171 | 149 | % ext.name) | ||
172 | 150 | return | ||
173 | 151 | + | ||
174 | 152 | + # Cant import cross built modules | ||
175 | 153 | + if os.environ.get('CROSS_COMPILE'): | ||
176 | 154 | + self.announce('WARNING: skipping import check for %s, cross built for %s' | ||
177 | 155 | + % (ext.name, os.environ.get('CROSS_COMPILE'))) | ||
178 | 156 | + return | ||
179 | 157 | + | ||
180 | 158 | ext_filename = os.path.join( | ||
181 | 159 | self.build_lib, | ||
182 | 160 | self.get_ext_filename(self.get_ext_fullname(ext.name))) | ||
183 | 161 | @@ -1848,6 +1871,11 @@ | ||
184 | 162 | mkpath(ffi_builddir) | ||
185 | 163 | config_args = [] | ||
186 | 164 | |||
187 | 165 | + if os.environ.get('CROSS_COMPILE'): | ||
188 | 166 | + exec_prefix = os.environ.get('CROSS_COMPILE') | ||
189 | 167 | + print "Configuring _ctypes module for cross building %s" % (exec_prefix) | ||
190 | 168 | + config_args = [ '--host ' + exec_prefix] | ||
191 | 169 | + | ||
192 | 170 | # Pass empty CFLAGS because we'll just append the resulting | ||
193 | 171 | # CFLAGS to Python's; -g or -O2 is to be avoided. | ||
194 | 172 | cmd = "cd %s && env CFLAGS='' '%s/configure' %s" \ | ||
195 | 0 | 173 | ||
196 | === modified file 'debian/patches/series.in' | |||
197 | --- debian/patches/series.in 2011-02-24 06:01:42 +0000 | |||
198 | +++ debian/patches/series.in 2011-03-09 16:31:57 +0000 | |||
199 | @@ -50,3 +50,4 @@ | |||
200 | 50 | issue9054.diff | 50 | issue9054.diff |
201 | 51 | link-system-expat.diff | 51 | link-system-expat.diff |
202 | 52 | plat-gnukfreebsd.diff | 52 | plat-gnukfreebsd.diff |
203 | 53 | cross.diff | ||
204 | 53 | 54 | ||
205 | === modified file 'debian/rules' | |||
206 | --- debian/rules 2011-02-24 06:01:42 +0000 | |||
207 | +++ debian/rules 2011-03-09 16:31:57 +0000 | |||
208 | @@ -11,6 +11,8 @@ | |||
209 | 11 | 11 | ||
210 | 12 | DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH) | 12 | DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH) |
211 | 13 | DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS) | 13 | DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS) |
212 | 14 | DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) | ||
213 | 15 | DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) | ||
214 | 14 | 16 | ||
215 | 15 | changelog_values := $(shell dpkg-parsechangelog \ | 17 | changelog_values := $(shell dpkg-parsechangelog \ |
216 | 16 | | awk '/^(Version|Source):/ {print $$2}') | 18 | | awk '/^(Version|Source):/ {print $$2}') |
217 | @@ -26,6 +28,10 @@ | |||
218 | 26 | ifneq (,$(findstring nobench, $(DEB_BUILD_OPTIONS))) | 28 | ifneq (,$(findstring nobench, $(DEB_BUILD_OPTIONS))) |
219 | 27 | WITHOUT_BENCH := yes | 29 | WITHOUT_BENCH := yes |
220 | 28 | endif | 30 | endif |
221 | 31 | ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) | ||
222 | 32 | WITHOUT_BENCH := yes | ||
223 | 33 | WITHOUT_CHECK := yes | ||
224 | 34 | endif | ||
225 | 29 | ifeq ($(on_buildd),yes) | 35 | ifeq ($(on_buildd),yes) |
226 | 30 | ifneq (,$(findstring $(DEB_HOST_ARCH), hppa mips mipsel s390)) | 36 | ifneq (,$(findstring $(DEB_HOST_ARCH), hppa mips mipsel s390)) |
227 | 31 | WITHOUT_CHECK := yes | 37 | WITHOUT_CHECK := yes |
228 | @@ -92,7 +98,17 @@ | |||
229 | 92 | endif | 98 | endif |
230 | 93 | with_fpectl = yes | 99 | with_fpectl = yes |
231 | 94 | 100 | ||
233 | 95 | CC = gcc | 101 | ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) |
234 | 102 | CC = gcc | ||
235 | 103 | CROSS = | ||
236 | 104 | else | ||
237 | 105 | CC = $(DEB_HOST_GNU_TYPE)-gcc | ||
238 | 106 | # Note that make runs the binaries as ./$(app), | ||
239 | 107 | # - so they must not be absolutely pathed | ||
240 | 108 | CROSS = BUILDPYTHON=../build-cross/python \ | ||
241 | 109 | BUILDPGEN=../build-cross/Parser/pgen \ | ||
242 | 110 | CROSS_COMPILE=$(DEB_HOST_GNU_TYPE) | ||
243 | 111 | endif | ||
244 | 96 | 112 | ||
245 | 97 | # on alpha, use -O2 only, use -mieee | 113 | # on alpha, use -O2 only, use -mieee |
246 | 98 | ifeq ($(DEB_HOST_ARCH),alpha) | 114 | ifeq ($(DEB_HOST_ARCH),alpha) |
247 | @@ -104,6 +120,9 @@ | |||
248 | 104 | endif | 120 | endif |
249 | 105 | 121 | ||
250 | 106 | PWD := $(shell pwd) | 122 | PWD := $(shell pwd) |
251 | 123 | ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) | ||
252 | 124 | buildd_cross := $(CURDIR)/build-cross | ||
253 | 125 | endif | ||
254 | 107 | buildd_static := $(CURDIR)/build-static | 126 | buildd_static := $(CURDIR)/build-static |
255 | 108 | buildd_shared := $(CURDIR)/build-shared | 127 | buildd_shared := $(CURDIR)/build-shared |
256 | 109 | buildd_debug := $(CURDIR)/build-debug | 128 | buildd_debug := $(CURDIR)/build-debug |
257 | @@ -143,7 +162,9 @@ | |||
258 | 143 | else | 162 | else |
259 | 144 | make_build_target = profile-opt | 163 | make_build_target = profile-opt |
260 | 145 | endif | 164 | endif |
262 | 146 | make_build_target = profile-opt | 165 | ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) |
263 | 166 | make_build_target = profile-opt | ||
264 | 167 | endif | ||
265 | 147 | 168 | ||
266 | 148 | build: $(build_target) | 169 | build: $(build_target) |
267 | 149 | build-all: stamps/stamp-build | 170 | build-all: stamps/stamp-build |
268 | @@ -168,30 +189,30 @@ | |||
269 | 168 | 189 | ||
270 | 169 | stamps/stamp-build-static: stamps/stamp-configure-static | 190 | stamps/stamp-build-static: stamps/stamp-configure-static |
271 | 170 | dh_testdir | 191 | dh_testdir |
273 | 171 | $(MAKE) $(NJOBS) -C $(buildd_static) \ | 192 | $(MAKE) $(NJOBS) -C $(buildd_static) $(CROSS) \ |
274 | 172 | PROFILE_TASK='$(PROFILE_TASK)' $(make_build_target) | 193 | PROFILE_TASK='$(PROFILE_TASK)' $(make_build_target) |
275 | 173 | touch stamps/stamp-build-static | 194 | touch stamps/stamp-build-static |
276 | 174 | 195 | ||
277 | 175 | stamps/stamp-build-shared: stamps/stamp-configure-shared | 196 | stamps/stamp-build-shared: stamps/stamp-configure-shared |
278 | 176 | dh_testdir | 197 | dh_testdir |
280 | 177 | $(MAKE) $(NJOBS) -C $(buildd_shared) | 198 | $(MAKE) $(NJOBS) -C $(buildd_shared) $(CROSS) |
281 | 178 | # : # build the shared library | 199 | # : # build the shared library |
283 | 179 | # $(MAKE) $(NJOBS) -C $(buildd_shared) \ | 200 | # $(MAKE) $(NJOBS) -C $(buildd_shared) $(CROSS) \ |
284 | 180 | # libpython$(VER).so | 201 | # libpython$(VER).so |
285 | 181 | : # build a static library with PIC objects | 202 | : # build a static library with PIC objects |
287 | 182 | $(MAKE) $(NJOBS) -C $(buildd_shared) \ | 203 | $(MAKE) $(NJOBS) -C $(buildd_shared) $(CROSS) \ |
288 | 183 | LIBRARY=libpython$(VER)-pic.a libpython$(VER)-pic.a | 204 | LIBRARY=libpython$(VER)-pic.a libpython$(VER)-pic.a |
289 | 184 | touch stamps/stamp-build-shared | 205 | touch stamps/stamp-build-shared |
290 | 185 | 206 | ||
291 | 186 | stamps/stamp-build-debug: stamps/stamp-configure-debug | 207 | stamps/stamp-build-debug: stamps/stamp-configure-debug |
292 | 187 | dh_testdir | 208 | dh_testdir |
294 | 188 | $(MAKE) $(NJOBS) -C $(buildd_debug) | 209 | $(MAKE) $(NJOBS) -C $(buildd_debug) $(CROSS) |
295 | 189 | touch stamps/stamp-build-debug | 210 | touch stamps/stamp-build-debug |
296 | 190 | 211 | ||
297 | 191 | stamps/stamp-build-shared-debug: stamps/stamp-configure-shared-debug | 212 | stamps/stamp-build-shared-debug: stamps/stamp-configure-shared-debug |
298 | 192 | dh_testdir | 213 | dh_testdir |
299 | 193 | : # build the shared debug library | 214 | : # build the shared debug library |
301 | 194 | $(MAKE) $(NJOBS) -C $(buildd_shdebug) \ | 215 | $(MAKE) $(NJOBS) -C $(buildd_shdebug) $(CROSS) \ |
302 | 195 | libpython$(VER)_d.so | 216 | libpython$(VER)_d.so |
303 | 196 | touch stamps/stamp-build-shared-debug | 217 | touch stamps/stamp-build-shared-debug |
304 | 197 | 218 | ||
305 | @@ -208,11 +229,52 @@ | |||
306 | 208 | common_configure_args += --with-system-ffi | 229 | common_configure_args += --with-system-ffi |
307 | 209 | endif | 230 | endif |
308 | 210 | 231 | ||
309 | 232 | ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) | ||
310 | 233 | common_configure_args += \ | ||
311 | 234 | --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) | ||
312 | 235 | endif | ||
313 | 236 | |||
314 | 211 | ifeq ($(with_fpectl),yes) | 237 | ifeq ($(with_fpectl),yes) |
315 | 212 | common_configure_args += \ | 238 | common_configure_args += \ |
316 | 213 | --with-fpectl | 239 | --with-fpectl |
317 | 214 | endif | 240 | endif |
318 | 215 | 241 | ||
319 | 242 | ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) | ||
320 | 243 | |||
321 | 244 | stamps/stamp-configure-cross: stamps/stamp-patch | ||
322 | 245 | rm -rf $(buildd_cross) | ||
323 | 246 | mkdir -p $(buildd_cross) | ||
324 | 247 | cd $(buildd_cross) && \ | ||
325 | 248 | CC=gcc CONFIG_SITE= $(OPTSETTINGS) \ | ||
326 | 249 | ../configure --build $(DEB_BUILD_GNU_TYPE) | ||
327 | 250 | egrep \ | ||
328 | 251 | "^#($$(awk '$$2 ~ /^extension$$/ {print $$1}' debian/PVER-minimal.README.Debian.in | tr '\012' '|')XX)" \ | ||
329 | 252 | Modules/Setup.dist \ | ||
330 | 253 | | sed -e 's/^#//' -e 's/-Wl,-Bdynamic//;s/-Wl,-Bstatic//' \ | ||
331 | 254 | >> $(buildd_cross)/Modules/Setup.local | ||
332 | 255 | cd $(buildd_cross) && \ | ||
333 | 256 | ../Modules/makesetup -c ../Modules/config.c.in -s Modules \ | ||
334 | 257 | Modules/Setup.config Modules/Setup.local Modules/Setup | ||
335 | 258 | mv $(buildd_cross)/config.c $(buildd_cross)/Modules/ | ||
336 | 259 | |||
337 | 260 | @echo "Each build should use it's own pyconfig.h & Makefile variables" | ||
338 | 261 | cp $(buildd_cross)/pyconfig.h $(buildd_cross)/pyconfig.h.cross | ||
339 | 262 | cp $(buildd_cross)/Makefile $(buildd_cross)/Makefile.cross | ||
340 | 263 | |||
341 | 264 | touch stamps/stamp-configure-cross | ||
342 | 265 | |||
343 | 266 | stamps/stamp-build-cross: stamps/stamp-configure-cross | ||
344 | 267 | dh_testdir | ||
345 | 268 | $(MAKE) $(NJOBS) -C $(buildd_cross) python Parser/pgen | ||
346 | 269 | touch stamps/stamp-build-cross | ||
347 | 270 | |||
348 | 271 | stamps/stamp-configure-shared: stamps/stamp-build-cross | ||
349 | 272 | stamps/stamp-configure-static: stamps/stamp-build-cross | ||
350 | 273 | stamps/stamp-configure-debug: stamps/stamp-build-cross | ||
351 | 274 | stamps/stamp-configure-shared-debug: stamps/stamp-build-cross | ||
352 | 275 | |||
353 | 276 | endif | ||
354 | 277 | |||
355 | 216 | stamps/stamp-configure-shared: stamps/stamp-patch | 278 | stamps/stamp-configure-shared: stamps/stamp-patch |
356 | 217 | rm -rf $(buildd_shared) | 279 | rm -rf $(buildd_shared) |
357 | 218 | mkdir -p $(buildd_shared) | 280 | mkdir -p $(buildd_shared) |
358 | @@ -231,6 +293,12 @@ | |||
359 | 231 | Modules/Setup.config Modules/Setup.local Modules/Setup | 293 | Modules/Setup.config Modules/Setup.local Modules/Setup |
360 | 232 | mv $(buildd_shared)/config.c $(buildd_shared)/Modules/ | 294 | mv $(buildd_shared)/config.c $(buildd_shared)/Modules/ |
361 | 233 | 295 | ||
362 | 296 | ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) | ||
363 | 297 | @echo "Build python should use the new pyconfig.h & Makefile " | ||
364 | 298 | cp $(buildd_shared)/pyconfig.h $(buildd_cross)/pyconfig.h | ||
365 | 299 | cp $(buildd_shared)/Makefile $(buildd_cross)/Makefile | ||
366 | 300 | endif | ||
367 | 301 | |||
368 | 234 | touch stamps/stamp-configure-shared | 302 | touch stamps/stamp-configure-shared |
369 | 235 | 303 | ||
370 | 236 | stamps/stamp-configure-static: stamps/stamp-patch | 304 | stamps/stamp-configure-static: stamps/stamp-patch |
371 | @@ -255,6 +323,12 @@ | |||
372 | 255 | mv -f $(buildd_static)/pyconfig.h.new $(buildd_static)/pyconfig.h | 323 | mv -f $(buildd_static)/pyconfig.h.new $(buildd_static)/pyconfig.h |
373 | 256 | mv $(buildd_static)/config.c $(buildd_static)/Modules/ | 324 | mv $(buildd_static)/config.c $(buildd_static)/Modules/ |
374 | 257 | 325 | ||
375 | 326 | ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) | ||
376 | 327 | @echo "Build python should use the new pyconfig.h" | ||
377 | 328 | cp $(buildd_static)/pyconfig.h $(buildd_cross)/pyconfig.h | ||
378 | 329 | cp $(buildd_static)/Makefile $(buildd_cross)/Makefile | ||
379 | 330 | endif | ||
380 | 331 | |||
381 | 258 | touch stamps/stamp-configure-static | 332 | touch stamps/stamp-configure-static |
382 | 259 | 333 | ||
383 | 260 | stamps/stamp-configure-debug: stamps/stamp-patch | 334 | stamps/stamp-configure-debug: stamps/stamp-patch |
384 | @@ -280,6 +354,12 @@ | |||
385 | 280 | touch -r $(buildd_debug)/pyconfig.h $(buildd_debug)/pyconfig.h.new | 354 | touch -r $(buildd_debug)/pyconfig.h $(buildd_debug)/pyconfig.h.new |
386 | 281 | mv -f $(buildd_debug)/pyconfig.h.new $(buildd_debug)/pyconfig.h | 355 | mv -f $(buildd_debug)/pyconfig.h.new $(buildd_debug)/pyconfig.h |
387 | 282 | 356 | ||
388 | 357 | ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) | ||
389 | 358 | @echo "Build python should use the new pyconfig.h" | ||
390 | 359 | cp $(buildd_debug)/pyconfig.h $(buildd_cross)/pyconfig.h | ||
391 | 360 | cp $(buildd_debug)/Makefile $(buildd_cross)/Makefile | ||
392 | 361 | endif | ||
393 | 362 | |||
394 | 283 | touch stamps/stamp-configure-debug | 363 | touch stamps/stamp-configure-debug |
395 | 284 | 364 | ||
396 | 285 | stamps/stamp-configure-shared-debug: stamps/stamp-patch | 365 | stamps/stamp-configure-shared-debug: stamps/stamp-patch |
397 | @@ -307,9 +387,16 @@ | |||
398 | 307 | touch -r $(buildd_shdebug)/pyconfig.h $(buildd_shdebug)/pyconfig.h.new | 387 | touch -r $(buildd_shdebug)/pyconfig.h $(buildd_shdebug)/pyconfig.h.new |
399 | 308 | mv -f $(buildd_shdebug)/pyconfig.h.new $(buildd_shdebug)/pyconfig.h | 388 | mv -f $(buildd_shdebug)/pyconfig.h.new $(buildd_shdebug)/pyconfig.h |
400 | 309 | 389 | ||
401 | 390 | ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) | ||
402 | 391 | @echo "Build python should use the new pyconfig.h" | ||
403 | 392 | cp $(buildd_shdebug)/pyconfig.h $(buildd_cross)/pyconfig.h | ||
404 | 393 | cp $(buildd_shdebug)/Makefile $(buildd_cross)/Makefile | ||
405 | 394 | endif | ||
406 | 395 | |||
407 | 310 | touch stamps/stamp-configure-shared-debug | 396 | touch stamps/stamp-configure-shared-debug |
408 | 311 | 397 | ||
409 | 312 | stamps/stamp-mincheck: stamps/stamp-build-static debian/PVER-minimal.README.Debian.in | 398 | stamps/stamp-mincheck: stamps/stamp-build-static debian/PVER-minimal.README.Debian.in |
410 | 399 | ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) | ||
411 | 313 | for m in $(MIN_MODS) $(MIN_PACKAGES) $(MIN_EXTS) $(MIN_BUILTINS); do \ | 400 | for m in $(MIN_MODS) $(MIN_PACKAGES) $(MIN_EXTS) $(MIN_BUILTINS); do \ |
412 | 314 | echo "import $$m"; \ | 401 | echo "import $$m"; \ |
413 | 315 | done > $(buildd_static)/minmods.py | 402 | done > $(buildd_static)/minmods.py |
414 | @@ -323,6 +410,9 @@ | |||
415 | 323 | else true; fi | 410 | else true; fi |
416 | 324 | cd $(buildd_static) && ./python ../debian/mincheck.py \ | 411 | cd $(buildd_static) && ./python ../debian/mincheck.py \ |
417 | 325 | minmods.py mindeps.txt | 412 | minmods.py mindeps.txt |
418 | 413 | else | ||
419 | 414 | @echo "No mincheck for cross build" | ||
420 | 415 | endif | ||
421 | 326 | touch stamps/stamp-mincheck | 416 | touch stamps/stamp-mincheck |
422 | 327 | 417 | ||
423 | 328 | TEST_RESOURCES = all | 418 | TEST_RESOURCES = all |
424 | @@ -419,6 +509,7 @@ | |||
425 | 419 | touch stamps/stamp-check | 509 | touch stamps/stamp-check |
426 | 420 | 510 | ||
427 | 421 | stamps/stamp-pystone: | 511 | stamps/stamp-pystone: |
428 | 512 | ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) | ||
429 | 422 | @echo "BEGIN pystone static" | 513 | @echo "BEGIN pystone static" |
430 | 423 | cd $(buildd_static) && ./python ../Lib/test/pystone.py | 514 | cd $(buildd_static) && ./python ../Lib/test/pystone.py |
431 | 424 | cd $(buildd_static) && ./python ../Lib/test/pystone.py | 515 | cd $(buildd_static) && ./python ../Lib/test/pystone.py |
432 | @@ -433,6 +524,10 @@ | |||
433 | 433 | cd $(buildd_debug) && ./python ../Lib/test/pystone.py | 524 | cd $(buildd_debug) && ./python ../Lib/test/pystone.py |
434 | 434 | cd $(buildd_debug) && ./python ../Lib/test/pystone.py | 525 | cd $(buildd_debug) && ./python ../Lib/test/pystone.py |
435 | 435 | @echo "END pystone debug" | 526 | @echo "END pystone debug" |
436 | 527 | else | ||
437 | 528 | @echo "No pystone for cross build" | ||
438 | 529 | endif | ||
439 | 530 | |||
440 | 436 | touch stamps/stamp-pystone | 531 | touch stamps/stamp-pystone |
441 | 437 | 532 | ||
442 | 438 | #ifeq (,$(filter $(DEB_HOST_ARCH), arm armel avr32 hppa mips mipsel m68k)) | 533 | #ifeq (,$(filter $(DEB_HOST_ARCH), arm armel avr32 hppa mips mipsel m68k)) |
443 | @@ -494,7 +589,7 @@ | |||
444 | 494 | 589 | ||
445 | 495 | stamps/stamp-doc-html: | 590 | stamps/stamp-doc-html: |
446 | 496 | dh_testdir | 591 | dh_testdir |
448 | 497 | $(MAKE) -C Doc html | 592 | $(MAKE) -C Doc html $(CROSS) |
449 | 498 | touch stamps/stamp-doc-html | 593 | touch stamps/stamp-doc-html |
450 | 499 | 594 | ||
451 | 500 | build-doc: stamps/stamp-patch stamps/stamp-build-doc | 595 | build-doc: stamps/stamp-patch stamps/stamp-build-doc |
452 | @@ -525,14 +620,17 @@ | |||
453 | 525 | clean: control-file | 620 | clean: control-file |
454 | 526 | dh_testdir | 621 | dh_testdir |
455 | 527 | dh_testroot | 622 | dh_testroot |
457 | 528 | $(MAKE) -f debian/rules unpatch | 623 | $(MAKE) -f debian/rules unpatch $(CROSS) |
458 | 529 | rm -rf stamps .pc | 624 | rm -rf stamps .pc |
459 | 530 | rm -f debian/test_results | 625 | rm -f debian/test_results |
460 | 531 | 626 | ||
463 | 532 | $(MAKE) -C Doc clean | 627 | $(MAKE) -C Doc clean $(CROSS) |
464 | 533 | sed 's/^@/#/' Makefile.pre.in | $(MAKE) -f - srcdir=. distclean | 628 | sed 's/^@/#/' Makefile.pre.in | $(MAKE) -f - srcdir=. distclean $(CROSS) |
465 | 534 | rm -rf Lib/test/db_home | 629 | rm -rf Lib/test/db_home |
466 | 535 | rm -rf $(buildd_static) $(buildd_shared) $(buildd_debug) $(buildd_shdebug) | 630 | rm -rf $(buildd_static) $(buildd_shared) $(buildd_debug) $(buildd_shdebug) |
467 | 631 | ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) | ||
468 | 632 | rm -rf $(buildd_cross) | ||
469 | 633 | endif | ||
470 | 536 | find -name '*.py[co]' | xargs -r rm -f | 634 | find -name '*.py[co]' | xargs -r rm -f |
471 | 537 | rm -f Lib/lib2to3/*.pickle | 635 | rm -f Lib/lib2to3/*.pickle |
472 | 538 | rm -rf locales | 636 | rm -rf locales |
473 | @@ -575,9 +673,9 @@ | |||
474 | 575 | : # their packages' directories. | 673 | : # their packages' directories. |
475 | 576 | install -d $(d)/usr | 674 | install -d $(d)/usr |
476 | 577 | ifeq ($(with_interp),static) | 675 | ifeq ($(with_interp),static) |
478 | 578 | $(MAKE) -C $(buildd_static) install prefix=$(CURDIR)/$(d)/usr | 676 | $(MAKE) -C $(buildd_static) install prefix=$(CURDIR)/$(d)/usr $(CROSS) |
479 | 579 | else | 677 | else |
481 | 580 | $(MAKE) -C $(buildd_shared) install prefix=$(CURDIR)/$(d)/usr | 678 | $(MAKE) -C $(buildd_shared) install prefix=$(CURDIR)/$(d)/usr $(CROSS) |
482 | 581 | endif | 679 | endif |
483 | 582 | -find $(d)/usr/lib/python$(VER) -name '*_failed*.so' | 680 | -find $(d)/usr/lib/python$(VER) -name '*_failed*.so' |
484 | 583 | find $(d)/usr/lib/python$(VER) -name '*_failed*.so' | xargs -r rm -f | 681 | find $(d)/usr/lib/python$(VER) -name '*_failed*.so' | xargs -r rm -f |
485 | @@ -815,8 +913,13 @@ | |||
486 | 815 | 913 | ||
487 | 816 | : # generate binfmt file | 914 | : # generate binfmt file |
488 | 817 | mkdir -p $(d_min)/usr/share/binfmts | 915 | mkdir -p $(d_min)/usr/share/binfmts |
489 | 916 | ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) | ||
490 | 818 | $(buildd_static)/python debian/mkbinfmt.py $(PVER) \ | 917 | $(buildd_static)/python debian/mkbinfmt.py $(PVER) \ |
492 | 819 | > $(d_min)/usr/share/binfmts/$(PVER) | 918 | > $(d_min)/usr/share/binfmts/$(PVER) |
493 | 919 | else | ||
494 | 920 | $(buildd_cross)/python debian/mkbinfmt.py $(PVER) \ | ||
495 | 921 | > $(d_min)/usr/share/binfmts/$(PVER) | ||
496 | 922 | endif | ||
497 | 820 | 923 | ||
498 | 821 | : # desktop entry | 924 | : # desktop entry |
499 | 822 | mkdir -p $(d_base)/usr/share/applications | 925 | mkdir -p $(d_base)/usr/share/applications |
500 | @@ -832,7 +935,7 @@ | |||
501 | 832 | 935 | ||
502 | 833 | : # install debug package | 936 | : # install debug package |
503 | 834 | rm -rf $(d)-dbg | 937 | rm -rf $(d)-dbg |
505 | 835 | $(MAKE) -C $(buildd_debug) install DESTDIR=$(CURDIR)/$(d)-dbg | 938 | $(MAKE) -C $(buildd_debug) install DESTDIR=$(CURDIR)/$(d)-dbg $(CROSS) |
506 | 836 | dh_installdirs -p$(p_dbg) \ | 939 | dh_installdirs -p$(p_dbg) \ |
507 | 837 | usr/bin \ | 940 | usr/bin \ |
508 | 838 | usr/share/man/man1 \ | 941 | usr/share/man/man1 \ |