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