Merge lp:~peter-pearse/ubuntu/natty/python2.6/prop002 into lp:ubuntu/natty/python2.6
- Natty (11.04)
- prop002
- Merge into natty
Proposed by
Peter Pearse
Status: | Work in progress |
---|---|
Proposed branch: | lp:~peter-pearse/ubuntu/natty/python2.6/prop002 |
Merge into: | lp:ubuntu/natty/python2.6 |
Diff against target: |
565 lines (+351/-16) 4 files modified
debian/changelog (+12/-0) debian/patches/cross.diff (+222/-0) debian/patches/series.in (+1/-0) debian/rules (+116/-16) |
To merge this branch: | bzr merge lp:~peter-pearse/ubuntu/natty/python2.6/prop002 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Steve Langasek | Needs Fixing | ||
Review via email: mp+52556@code.launchpad.net |
Commit message
Description of the change
Fixes most of the points raised in review of https:/
That has been left as a proposal in order to keep the review comments available but is
SUPERSEDED by this proposal,
To post a comment you must log in.
Unmerged revisions
- 67. By Peter Pearse
-
Cross patch - see details in 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-23 23:41:57 +0000 |
3 | +++ debian/changelog 2011-03-08 13:49:05 +0000 |
4 | @@ -1,3 +1,15 @@ |
5 | +python2.6 (2.6.6-6ubuntu7) maverick; urgency=low |
6 | + |
7 | + * configure.in - Set buggygetaddrinfo for cross builds |
8 | + * - Add py_cv_has_zd_printf for cross builds |
9 | + * Makefile.pre.in - Use BUILDPYTHON where applicable for cross builds |
10 | + * setup.py - For cross builds, pass cross toolchain info in python |
11 | + environment |
12 | + * debian/rules - Build a build host python for use during a cross |
13 | + build. Adjust the configuration files & make environment accordingly. |
14 | + |
15 | + -- Peter Pearse <peter.pearse@linaro.org> Tue, 08 Mar 2011 13:31:46 +0000 |
16 | + |
17 | python2.6 (2.6.6-6ubuntu6) natty; urgency=low |
18 | |
19 | * Disable the profiled build on ppc64. |
20 | |
21 | === added file 'debian/patches/cross.diff' |
22 | --- debian/patches/cross.diff 1970-01-01 00:00:00 +0000 |
23 | +++ debian/patches/cross.diff 2011-03-08 13:49:05 +0000 |
24 | @@ -0,0 +1,222 @@ |
25 | +diff -Nru p/configure.in p_p/configure.in |
26 | +--- p/configure.in 2011-03-07 11:51:09.000000000 +0000 |
27 | ++++ p_p/configure.in 2011-03-07 11:52:23.000000000 +0000 |
28 | +@@ -3018,8 +3018,8 @@ |
29 | + buggygetaddrinfo=no, |
30 | + AC_MSG_RESULT(buggy) |
31 | + buggygetaddrinfo=yes, |
32 | +-AC_MSG_RESULT(buggy) |
33 | +-buggygetaddrinfo=yes)], [ |
34 | ++AC_MSG_RESULT(cross) |
35 | ++buggygetaddrinfo=no)], [ |
36 | + AC_MSG_RESULT(no) |
37 | + buggygetaddrinfo=yes |
38 | + ]) |
39 | +@@ -3873,7 +3873,7 @@ |
40 | + AC_MSG_RESULT(no) |
41 | + fi |
42 | + |
43 | +-AC_MSG_CHECKING(for %zd printf() format support) |
44 | ++AC_CACHE_CHECK([for %zd printf() format support], [py_cv_has_zd_printf], [dnl |
45 | + AC_TRY_RUN([#include <stdio.h> |
46 | + #include <stddef.h> |
47 | + #include <string.h> |
48 | +@@ -3907,10 +3907,13 @@ |
49 | + return 1; |
50 | + |
51 | + return 0; |
52 | +-}], |
53 | +-[AC_MSG_RESULT(yes) |
54 | +- AC_DEFINE(PY_FORMAT_SIZE_T, "z", [Define to printf format modifier for Py_ssize_t])], |
55 | +- AC_MSG_RESULT(no)) |
56 | ++}], [py_cv_has_zd_printf="yes"], |
57 | ++ [py_cv_has_zd_printf="no"], |
58 | ++ [py_cv_has_zd_printf="cross -- assuming yes"] |
59 | ++)]) |
60 | ++if test "$py_cv_has_zd_printf" != "no" ; then |
61 | ++ AC_DEFINE(PY_FORMAT_SIZE_T, "z", [Define to printf format modifier for Py_ssize_t]) |
62 | ++fi |
63 | + |
64 | + AC_CHECK_TYPE(socklen_t,, |
65 | + AC_DEFINE(socklen_t,int, |
66 | +diff -Nru p/Makefile.pre.in p_p/Makefile.pre.in |
67 | +--- p/Makefile.pre.in 2011-03-07 11:51:08.000000000 +0000 |
68 | ++++ p_p/Makefile.pre.in 2011-03-08 13:10:29.000000000 +0000 |
69 | +@@ -207,6 +207,8 @@ |
70 | + ########################################################################## |
71 | + # Parser |
72 | + PGEN= Parser/pgen$(EXE) |
73 | ++# Allow override for cross build |
74 | ++BUILDPGEN= $(PGEN) |
75 | + |
76 | + POBJS= \ |
77 | + Parser/acceler.o \ |
78 | +@@ -354,7 +356,7 @@ |
79 | + |
80 | + # Default target |
81 | + all: build_all |
82 | +-build_all: $(BUILDPYTHON) oldsharedmods sharedmods gdbhooks |
83 | ++build_all: $(PYTHON) oldsharedmods sharedmods gdbhooks |
84 | + |
85 | + # Compile a binary with gcc profile guided optimization. |
86 | + profile-opt: |
87 | +@@ -386,20 +388,20 @@ |
88 | + |
89 | + |
90 | + # Build the interpreter |
91 | +-$(BUILDPYTHON): Modules/python.o $(LIBRARY) $(LDLIBRARY) |
92 | ++$(PYTHON): Modules/python.o $(LIBRARY) $(LDLIBRARY) |
93 | + $(LINKCC) $(LDFLAGS) $(LINKFORSHARED) -o $@ \ |
94 | + Modules/python.o \ |
95 | + $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) |
96 | + |
97 | +-platform: $(BUILDPYTHON) |
98 | ++platform: $(PYTHON) |
99 | + $(RUNSHARED) ./$(BUILDPYTHON) -E -c 'import sys ; from distutils.util import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform |
100 | + |
101 | + |
102 | + # Build the shared modules |
103 | +-sharedmods: $(BUILDPYTHON) |
104 | ++sharedmods: $(PYTHON) |
105 | + @case $$MAKEFLAGS in \ |
106 | +- *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' LDFLAGS='$(LDFLAGS)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \ |
107 | +- *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' LDFLAGS='$(LDFLAGS)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \ |
108 | ++ *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' LDFLAGS='$(LDFLAGS)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \ |
109 | ++ *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' LDFLAGS='$(LDFLAGS)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \ |
110 | + esac |
111 | + |
112 | + # Build static library |
113 | +@@ -423,7 +425,7 @@ |
114 | + fi |
115 | + |
116 | + libpython$(VERSION).dylib: $(LIBRARY_OBJS) |
117 | +- $(CC) -dynamiclib -Wl,-single_module $(LDFLAGS) -undefined dynamic_lookup -Wl,-install_name,$(prefix)/lib/libpython$(VERSION).dylib -Wl,-compatibility_version,$(VERSION) -Wl,-current_version,$(VERSION) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ |
118 | ++ $(CC) -dynamiclib -Wl,-single_module $(LDFLAGS) -undefined dynamic_lookup -Wl,-install_name,$(prefix)/lib/libpython$(VERSION).dylib -Wl,-compatibility_version,$(VERSION) -Wl,-current_version,$(VERSION) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ |
119 | + |
120 | + |
121 | + libpython$(VERSION).sl: $(LIBRARY_OBJS) |
122 | +@@ -434,10 +436,10 @@ |
123 | + # |
124 | + # Distributors are likely to want to install this somewhere else e.g. relative |
125 | + # to the stripped DWARF data for the shared library. |
126 | +-gdbhooks: $(BUILDPYTHON)-gdb.py |
127 | ++gdbhooks: $(PYTHON)-gdb.py |
128 | + |
129 | +-$(BUILDPYTHON)-gdb.py: Tools/gdb/libpython.py |
130 | +- $(INSTALL_SCRIPT) $< $(BUILDPYTHON)-gdb.py |
131 | ++$(PYTHON)-gdb.py: Tools/gdb/libpython.py |
132 | ++ $(INSTALL_SCRIPT) $< $(PYTHON)-gdb.py |
133 | + |
134 | + # This rule is here for OPENSTEP/Rhapsody/MacOSX. It builds a temporary |
135 | + # minimal framework (not including the Lib directory and such) in the current |
136 | +@@ -531,7 +533,7 @@ |
137 | + |
138 | + $(GRAMMAR_H) $(GRAMMAR_C): $(PGEN) $(GRAMMAR_INPUT) |
139 | + -@$(INSTALL) -d Include |
140 | +- -$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) |
141 | ++ -$(BUILDPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) |
142 | + |
143 | + $(PGEN): $(PGENOBJS) |
144 | + $(CC) $(OPT) $(LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN) |
145 | +@@ -780,7 +782,7 @@ |
146 | + |
147 | + # Install the interpreter with $(VERSION) affixed |
148 | + # This goes into $(exec_prefix) |
149 | +-altbininstall: $(BUILDPYTHON) |
150 | ++altbininstall: $(PYTHON) |
151 | + @for i in $(BINDIR) $(LIBDIR); \ |
152 | + do \ |
153 | + if test ! -d $(DESTDIR)$$i; then \ |
154 | +@@ -789,7 +791,7 @@ |
155 | + else true; \ |
156 | + fi; \ |
157 | + done |
158 | +- $(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE) |
159 | ++ $(INSTALL_PROGRAM) $(PYTHON) $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE) |
160 | + if test -f $(LDLIBRARY); then \ |
161 | + if test -n "$(DLLLIBRARY)" ; then \ |
162 | + $(INSTALL_SHARED) $(DLLLIBRARY) $(DESTDIR)$(BINDIR); \ |
163 | +@@ -1110,7 +1112,7 @@ |
164 | + config.status: $(srcdir)/configure |
165 | + $(SHELL) $(srcdir)/configure $(CONFIG_ARGS) |
166 | + |
167 | +-.PRECIOUS: config.status $(BUILDPYTHON) Makefile Makefile.pre |
168 | ++.PRECIOUS: config.status $(PYTHON) Makefile Makefile.pre |
169 | + |
170 | + # Some make's put the object file in the current directory |
171 | + .c.o: |
172 | +@@ -1162,7 +1164,7 @@ |
173 | + find . -name '*.gc??' -exec rm -f {} ';' |
174 | + |
175 | + clobber: clean profile-removal |
176 | +- -rm -f $(BUILDPYTHON) $(PGEN) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY) \ |
177 | ++ -rm -f $(PYTHON) $(PGEN) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY) \ |
178 | + tags TAGS \ |
179 | + config.cache config.log pyconfig.h Modules/config.c |
180 | + -rm -rf build platform |
181 | +diff -Nru p/Modules/Setup.dist p_p/Modules/Setup.dist |
182 | +--- p/Modules/Setup.dist 2011-03-07 11:51:08.000000000 +0000 |
183 | ++++ p_p/Modules/Setup.dist 2011-03-07 11:52:23.000000000 +0000 |
184 | +@@ -458,7 +458,9 @@ |
185 | + # Andrew Kuchling's zlib module. |
186 | + # This require zlib 1.1.3 (or later). |
187 | + # See http://www.gzip.org/zlib/ |
188 | +-#zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz |
189 | ++# Well behaved toolchains should not require -L$(exec_prefix)/lib |
190 | ++# - using it breaks cross builds |
191 | ++#zlib zlibmodule.c -I$(prefix)/include -lz |
192 | + |
193 | + # Interface to the Expat XML parser |
194 | + # |
195 | +diff -Nru p/setup.py p_p/setup.py |
196 | +--- p/setup.py 2011-03-07 11:51:08.000000000 +0000 |
197 | ++++ p_p/setup.py 2011-03-08 10:50:19.000000000 +0000 |
198 | +@@ -235,6 +235,22 @@ |
199 | + # When you run "make CC=altcc" or something similar, you really want |
200 | + # those environment variables passed into the setup.py phase. Here's |
201 | + # a small set of useful ones. |
202 | ++ |
203 | ++ # Change the environment for cross compiling |
204 | ++ # - may want to use environment variables for settings? |
205 | ++ if os.environ.get('CROSS_COMPILE'): |
206 | ++ exec_prefix=os.environ.get('CROSS_COMPILE') |
207 | ++ os.environ["CC"] = exec_prefix + '-gcc' |
208 | ++ os.environ["CXX"] = exec_prefix + '-g++' |
209 | ++ os.environ["LDSHARED"] = exec_prefix + '-gcc -shared' |
210 | ++ os.environ["CPP"] = exec_prefix + '-cpp' |
211 | ++ os.environ["LDFLAGS"] = '-L /usr/' + exec_prefix + '/lib -L /usr/' + exec_prefix + '/usr/lib' |
212 | ++ os.environ["CFLAGS"] = '-I/usr/' + exec_prefix + '/include -I/usr/' + exec_prefix + '/usr/include' |
213 | ++ # Use -D markers to detect if/where used |
214 | ++ os.environ["CPPFLAGS"] = '-DCPPFLAGS' |
215 | ++ os.environ["BASECFLAGS"] = '-DBASECFLAGS' |
216 | ++ os.environ["OPT"] = '-DOPT' |
217 | ++ |
218 | + compiler = os.environ.get('CC') |
219 | + args = {} |
220 | + # unfortunately, distutils doesn't let us provide separate C and C++ |
221 | +@@ -313,6 +329,13 @@ |
222 | + self.announce('WARNING: skipping import check for Cygwin-based "%s"' |
223 | + % ext.name) |
224 | + return |
225 | ++ |
226 | ++ # Cant import cross built modules |
227 | ++ if os.environ.get('CROSS_COMPILE'): |
228 | ++ self.announce('WARNING: skipping import check for %s, cross built for %s' |
229 | ++ % (ext.name, os.environ.get('CROSS_COMPILE'))) |
230 | ++ return |
231 | ++ |
232 | + ext_filename = os.path.join( |
233 | + self.build_lib, |
234 | + self.get_ext_filename(self.get_ext_fullname(ext.name))) |
235 | +@@ -1840,6 +1863,11 @@ |
236 | + mkpath(ffi_builddir) |
237 | + config_args = [] |
238 | + |
239 | ++ if os.environ.get('CROSS_COMPILE'): |
240 | ++ exec_prefix = os.environ.get('CROSS_COMPILE') |
241 | ++ print "Configuring _ctypes module for cross building %s" % (exec_prefix) |
242 | ++ config_args = [ '--host ' + exec_prefix] |
243 | ++ |
244 | + # Pass empty CFLAGS because we'll just append the resulting |
245 | + # CFLAGS to Python's; -g or -O2 is to be avoided. |
246 | + cmd = "cd %s && env CFLAGS='' '%s/configure' %s" \ |
247 | |
248 | === modified file 'debian/patches/series.in' |
249 | --- debian/patches/series.in 2010-10-12 12:53:47 +0000 |
250 | +++ debian/patches/series.in 2011-03-08 13:49:05 +0000 |
251 | @@ -60,3 +60,4 @@ |
252 | link-system-expat.diff |
253 | plat-gnukfreebsd.diff |
254 | issue7356.diff |
255 | +cross.diff |
256 | |
257 | === modified file 'debian/rules' |
258 | --- debian/rules 2011-02-23 23:41:57 +0000 |
259 | +++ debian/rules 2011-03-08 13:49:05 +0000 |
260 | @@ -10,6 +10,8 @@ |
261 | |
262 | DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH) |
263 | DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS) |
264 | +DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) |
265 | +DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) |
266 | |
267 | changelog_values := $(shell dpkg-parsechangelog \ |
268 | | awk '/^(Version|Source):/ {print $$2}') |
269 | @@ -25,6 +27,10 @@ |
270 | ifneq (,$(findstring nobench, $(DEB_BUILD_OPTIONS))) |
271 | WITHOUT_BENCH := yes |
272 | endif |
273 | +ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) |
274 | + WITHOUT_BENCH := yes |
275 | + WITHOUT_CHECK := yes |
276 | +endif |
277 | ifeq ($(on_buildd),yes) |
278 | ifneq (,$(findstring $(DEB_HOST_ARCH), hppa mips mipsel s390)) |
279 | WITHOUT_CHECK := yes |
280 | @@ -92,7 +98,17 @@ |
281 | endif |
282 | with_fpectl = yes |
283 | |
284 | -CC = gcc |
285 | +ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) |
286 | + CC = gcc |
287 | + CROSS = |
288 | +else |
289 | + CC = $(DEB_HOST_GNU_TYPE)-gcc |
290 | + # Note that make runs the binaries as ./$(app), |
291 | + # - so they must not be absolutely pathed |
292 | + CROSS = BUILDPYTHON=../build-cross/python \ |
293 | + BUILDPGEN=../build-cross/Parser/pgen \ |
294 | + CROSS_COMPILE=$(DEB_HOST_GNU_TYPE) |
295 | +endif |
296 | |
297 | # on alpha, use -O2 only, use -mieee |
298 | ifeq ($(DEB_HOST_ARCH),alpha) |
299 | @@ -104,6 +120,9 @@ |
300 | endif |
301 | |
302 | PWD := $(shell pwd) |
303 | +ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) |
304 | + buildd_cross := $(CURDIR)/build-cross |
305 | +endif |
306 | buildd_static := $(CURDIR)/build-static |
307 | buildd_shared := $(CURDIR)/build-shared |
308 | buildd_debug := $(CURDIR)/build-debug |
309 | @@ -138,7 +157,7 @@ |
310 | d_dbg := debian/$(p_dbg) |
311 | |
312 | # profiled build fails on amd64, lpia, sparc |
313 | -ifneq (,$(filter $(DEB_HOST_ARCH), alpha amd64 armel hppa i386 ia64 lpia mips mipsel powerpc ppc64 s390 sparc64 hurd-i386 kfreebsd-i386 kfreebsd-amd64)) |
314 | +ifneq (,$(filter $(DEB_HOST_ARCH), alpha amd64 armel hppa i386 ia64 lpia mips mipsel powerpc s390 sparc64 hurd-i386 kfreebsd-i386 kfreebsd-amd64)) |
315 | make_build_target = |
316 | else |
317 | make_build_target = profile-opt |
318 | @@ -167,30 +186,30 @@ |
319 | |
320 | stamps/stamp-build-static: stamps/stamp-configure-static |
321 | dh_testdir |
322 | - $(MAKE) $(NJOBS) -C $(buildd_static) \ |
323 | + $(MAKE) $(NJOBS) -C $(buildd_static) $(CROSS) \ |
324 | PROFILE_TASK='$(PROFILE_TASK)' $(make_build_target) |
325 | touch stamps/stamp-build-static |
326 | |
327 | stamps/stamp-build-shared: stamps/stamp-configure-shared |
328 | dh_testdir |
329 | - $(MAKE) $(NJOBS) -C $(buildd_shared) |
330 | + $(MAKE) $(NJOBS) -C $(buildd_shared) $(CROSS) |
331 | # : # build the shared library |
332 | -# $(MAKE) $(NJOBS) -C $(buildd_shared) \ |
333 | +# $(MAKE) $(NJOBS) -C $(buildd_shared) $(CROSS) \ |
334 | # libpython$(VER).so |
335 | : # build a static library with PIC objects |
336 | - $(MAKE) $(NJOBS) -C $(buildd_shared) \ |
337 | + $(MAKE) $(NJOBS) -C $(buildd_shared) $(CROSS) \ |
338 | LIBRARY=libpython$(VER)-pic.a libpython$(VER)-pic.a |
339 | touch stamps/stamp-build-shared |
340 | |
341 | stamps/stamp-build-debug: stamps/stamp-configure-debug |
342 | dh_testdir |
343 | - $(MAKE) $(NJOBS) -C $(buildd_debug) |
344 | + $(MAKE) $(NJOBS) -C $(buildd_debug) $(CROSS) |
345 | touch stamps/stamp-build-debug |
346 | |
347 | stamps/stamp-build-shared-debug: stamps/stamp-configure-shared-debug |
348 | dh_testdir |
349 | : # build the shared debug library |
350 | - $(MAKE) $(NJOBS) -C $(buildd_shdebug) \ |
351 | + $(MAKE) $(NJOBS) -C $(buildd_shdebug) $(CROSS) \ |
352 | libpython$(VER)_d.so |
353 | touch stamps/stamp-build-shared-debug |
354 | |
355 | @@ -206,11 +225,52 @@ |
356 | common_configure_args += --with-system-ffi |
357 | endif |
358 | |
359 | +ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) |
360 | + common_configure_args += \ |
361 | + --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) |
362 | +endif |
363 | + |
364 | ifeq ($(with_fpectl),yes) |
365 | common_configure_args += \ |
366 | --with-fpectl |
367 | endif |
368 | |
369 | +ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) |
370 | + |
371 | +stamps/stamp-configure-cross: stamps/stamp-patch |
372 | + rm -rf $(buildd_cross) |
373 | + mkdir -p $(buildd_cross) |
374 | + cd $(buildd_cross) && \ |
375 | + CC=gcc CONFIG_SITE= $(OPTSETTINGS) \ |
376 | + ../configure --build $(DEB_BUILD_GNU_TYPE) |
377 | + egrep \ |
378 | + "^#($$(awk '$$2 ~ /^extension$$/ {print $$1}' debian/PVER-minimal.README.Debian.in | tr '\012' '|')XX)" \ |
379 | + Modules/Setup.dist \ |
380 | + | sed -e 's/^#//' -e 's/-Wl,-Bdynamic//;s/-Wl,-Bstatic//' \ |
381 | + >> $(buildd_cross)/Modules/Setup.local |
382 | + cd $(buildd_cross) && \ |
383 | + ../Modules/makesetup -c ../Modules/config.c.in -s Modules \ |
384 | + Modules/Setup.config Modules/Setup.local Modules/Setup |
385 | + mv $(buildd_cross)/config.c $(buildd_cross)/Modules/ |
386 | + |
387 | + @echo "Each build should use it's own pyconfig.h & Makefile variables" |
388 | + cp $(buildd_cross)/pyconfig.h $(buildd_cross)/pyconfig.h.cross |
389 | + cp $(buildd_cross)/Makefile $(buildd_cross)/Makefile.cross |
390 | + |
391 | + touch stamps/stamp-configure-cross |
392 | + |
393 | +stamps/stamp-build-cross: stamps/stamp-configure-cross |
394 | + dh_testdir |
395 | + $(MAKE) $(NJOBS) -C $(buildd_cross) python Parser/pgen |
396 | + touch stamps/stamp-build-cross |
397 | + |
398 | +stamps/stamp-configure-shared: stamps/stamp-build-cross |
399 | +stamps/stamp-configure-static: stamps/stamp-build-cross |
400 | +stamps/stamp-configure-debug: stamps/stamp-build-cross |
401 | +stamps/stamp-configure-shared-debug: stamps/stamp-build-cross |
402 | + |
403 | +endif |
404 | + |
405 | stamps/stamp-configure-shared: stamps/stamp-patch |
406 | rm -rf $(buildd_shared) |
407 | mkdir -p $(buildd_shared) |
408 | @@ -229,6 +289,12 @@ |
409 | Modules/Setup.config Modules/Setup.local Modules/Setup |
410 | mv $(buildd_shared)/config.c $(buildd_shared)/Modules/ |
411 | |
412 | +ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) |
413 | + @echo "Build python should use the new pyconfig.h & Makefile " |
414 | + cp $(buildd_shared)/pyconfig.h $(buildd_cross)/pyconfig.h |
415 | + cp $(buildd_shared)/Makefile $(buildd_cross)/Makefile |
416 | +endif |
417 | + |
418 | touch stamps/stamp-configure-shared |
419 | |
420 | stamps/stamp-configure-static: stamps/stamp-patch |
421 | @@ -253,6 +319,12 @@ |
422 | mv -f $(buildd_static)/pyconfig.h.new $(buildd_static)/pyconfig.h |
423 | mv $(buildd_static)/config.c $(buildd_static)/Modules/ |
424 | |
425 | +ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) |
426 | + @echo "Build python should use the new pyconfig.h" |
427 | + cp $(buildd_static)/pyconfig.h $(buildd_cross)/pyconfig.h |
428 | + cp $(buildd_static)/Makefile $(buildd_cross)/Makefile |
429 | +endif |
430 | + |
431 | touch stamps/stamp-configure-static |
432 | |
433 | stamps/stamp-configure-debug: stamps/stamp-patch |
434 | @@ -278,6 +350,12 @@ |
435 | touch -r $(buildd_debug)/pyconfig.h $(buildd_debug)/pyconfig.h.new |
436 | mv -f $(buildd_debug)/pyconfig.h.new $(buildd_debug)/pyconfig.h |
437 | |
438 | +ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) |
439 | + @echo "Build python should use the new pyconfig.h" |
440 | + cp $(buildd_debug)/pyconfig.h $(buildd_cross)/pyconfig.h |
441 | + cp $(buildd_debug)/Makefile $(buildd_cross)/Makefile |
442 | +endif |
443 | + |
444 | touch stamps/stamp-configure-debug |
445 | |
446 | stamps/stamp-configure-shared-debug: stamps/stamp-patch |
447 | @@ -305,9 +383,16 @@ |
448 | touch -r $(buildd_shdebug)/pyconfig.h $(buildd_shdebug)/pyconfig.h.new |
449 | mv -f $(buildd_shdebug)/pyconfig.h.new $(buildd_shdebug)/pyconfig.h |
450 | |
451 | +ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) |
452 | + @echo "Build python should use the new pyconfig.h" |
453 | + cp $(buildd_shdebug)/pyconfig.h $(buildd_cross)/pyconfig.h |
454 | + cp $(buildd_shdebug)/Makefile $(buildd_cross)/Makefile |
455 | +endif |
456 | + |
457 | touch stamps/stamp-configure-shared-debug |
458 | |
459 | stamps/stamp-mincheck: stamps/stamp-build-static debian/PVER-minimal.README.Debian.in |
460 | +ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) |
461 | for m in $(MIN_MODS) $(MIN_PACKAGES) $(MIN_EXTS) $(MIN_BUILTINS); do \ |
462 | echo "import $$m"; \ |
463 | done > $(buildd_static)/minmods.py |
464 | @@ -321,6 +406,9 @@ |
465 | else true; fi |
466 | cd $(buildd_static) && ./python ../debian/mincheck.py \ |
467 | minmods.py mindeps.txt |
468 | +else |
469 | + @echo "No mincheck for cross build" |
470 | +endif |
471 | touch stamps/stamp-mincheck |
472 | |
473 | TEST_RESOURCES = all |
474 | @@ -342,7 +430,7 @@ |
475 | ifneq (,$(filter $(DEB_HOST_ARCH), hppa)) |
476 | TEST_EXCLUDES += test_fork1 test_multiprocessing test_socketserver test_wait3 test_wait4 test_gdb |
477 | endif |
478 | -ifneq (,$(filter $(DEB_HOST_ARCH), arm avr32)) |
479 | +ifneq (,$(filter $(DEB_HOST_ARCH), avr32)) |
480 | TEST_EXCLUDES += test_ctypes |
481 | endif |
482 | ifneq (,$(filter $(DEB_HOST_ARCH), m68k avr32)) |
483 | @@ -412,6 +500,7 @@ |
484 | touch stamps/stamp-check |
485 | |
486 | stamps/stamp-pystone: |
487 | +ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) |
488 | @echo "BEGIN pystone static" |
489 | cd $(buildd_static) && ./python ../Lib/test/pystone.py |
490 | cd $(buildd_static) && ./python ../Lib/test/pystone.py |
491 | @@ -426,6 +515,9 @@ |
492 | cd $(buildd_debug) && ./python ../Lib/test/pystone.py |
493 | cd $(buildd_debug) && ./python ../Lib/test/pystone.py |
494 | @echo "END pystone debug" |
495 | +else |
496 | + @echo "No pystone for cross build" |
497 | +endif |
498 | touch stamps/stamp-pystone |
499 | |
500 | #ifeq (,$(filter $(DEB_HOST_ARCH), arm armel avr32 hppa mips mipsel m68k)) |
501 | @@ -487,7 +579,7 @@ |
502 | |
503 | stamps/stamp-doc-html: |
504 | dh_testdir |
505 | - $(MAKE) -C Doc html |
506 | + $(MAKE) -C Doc html $(CROSS) |
507 | touch stamps/stamp-doc-html |
508 | |
509 | build-doc: stamps/stamp-patch stamps/stamp-build-doc |
510 | @@ -518,14 +610,17 @@ |
511 | clean: control-file |
512 | dh_testdir |
513 | dh_testroot |
514 | - $(MAKE) -f debian/rules unpatch |
515 | + $(MAKE) -f debian/rules unpatch $(CROSS) |
516 | rm -rf stamps .pc |
517 | rm -f debian/test_results |
518 | |
519 | - $(MAKE) -C Doc clean |
520 | - sed 's/^@/#/' Makefile.pre.in | $(MAKE) -f - srcdir=. distclean |
521 | + $(MAKE) -C Doc clean $(CROSS) |
522 | + sed 's/^@/#/' Makefile.pre.in | $(MAKE) -f - srcdir=. distclean $(CROSS) |
523 | rm -rf Lib/test/db_home |
524 | rm -rf $(buildd_static) $(buildd_shared) $(buildd_debug) $(buildd_shdebug) |
525 | +ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) |
526 | + rm -rf $(buildd_cross) |
527 | +endif |
528 | find -name '*.py[co]' | xargs -r rm -f |
529 | rm -f Lib/lib2to3/*.pickle |
530 | rm -rf locales |
531 | @@ -568,9 +663,9 @@ |
532 | : # their packages' directories. |
533 | install -d $(d)/usr |
534 | ifeq ($(with_interp),static) |
535 | - $(MAKE) -C $(buildd_static) install prefix=$(CURDIR)/$(d)/usr |
536 | + $(MAKE) -C $(buildd_static) install prefix=$(CURDIR)/$(d)/usr $(CROSS) |
537 | else |
538 | - $(MAKE) -C $(buildd_shared) install prefix=$(CURDIR)/$(d)/usr |
539 | + $(MAKE) -C $(buildd_shared) install prefix=$(CURDIR)/$(d)/usr $(CROSS) |
540 | endif |
541 | -find $(d)/usr/lib/python$(VER) -name '*_failed*.so' |
542 | find $(d)/usr/lib/python$(VER) -name '*_failed*.so' | xargs -r rm -f |
543 | @@ -806,8 +901,13 @@ |
544 | |
545 | : # generate binfmt file |
546 | mkdir -p $(d_min)/usr/share/binfmts |
547 | +ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) |
548 | $(buildd_static)/python debian/mkbinfmt.py $(PVER) \ |
549 | > $(d_min)/usr/share/binfmts/$(PVER) |
550 | +else |
551 | + $(buildd_cross)/python debian/mkbinfmt.py $(PVER) \ |
552 | + > $(d_min)/usr/share/binfmts/$(PVER) |
553 | +endif |
554 | |
555 | : # desktop entry |
556 | mkdir -p $(d_base)/usr/share/applications |
557 | @@ -823,7 +923,7 @@ |
558 | |
559 | : # install debug package |
560 | rm -rf $(d)-dbg |
561 | - $(MAKE) -C $(buildd_debug) install DESTDIR=$(CURDIR)/$(d)-dbg |
562 | + $(MAKE) -C $(buildd_debug) install DESTDIR=$(CURDIR)/$(d)-dbg $(CROSS) |
563 | dh_installdirs -p$(p_dbg) \ |
564 | usr/bin \ |
565 | usr/share/man/man1 \ |
Looks better. Still have a few comments; carrying over conversation from the previous merge request.
> b) /usr/$arch exec_prefix
> exec_prefix is DEB_HOST_GNU_TYPE Is that == $arch?
> These are the build host installation directories - "sysroot"
> where crossed packages are installed, so they are needed in the path.
I assumed from context that exec_prefix is $arch.
dpkg-cross installs all packages to /usr/$arch/lib, /usr/$arch/include. usr/include, from a package, is by unpacking it directly to
multiarch packages will install to /usr/lib/$arch and /usr/include/$arch
(but you shouldn't need to add these paths anywhere because they're on the
system path). The only way to get a path of /usr/$arch/usr/lib or
/usr/$arch/
/usr/$arch with 'dpkg -x'. That should never be needed; basically this is a
workaround for a bug in some other package not being crossable with
dpkg-cross, and I don't think we should merge those workarounds into the
package.
> c) I'm dropping the arm, not adding it. There are several other tests
> against DEB_HOST_ARCH for it.....
Yes - but it's a test for the architecture named 'arm', whereas all our
builds are for 'armel', which should never match here. Whatever this check
was needed for on the old OABI port, it probably still applies there and we
shouldn't change it.
New comments:
The one thing I notice with cross.patch is that all the make dependencies have been changed from $(BUILDPYTHON) to $(PYTHON). I probably didn't explain this very well in my previous message; I meant that in the general case, there should be a dependency on both of these targets, e.g.:
-build_all: $(BUILDPYTHON) oldsharedmods sharedmods gdbhooks
+build_all: $(BUILDPYTHON) $(PYTHON) oldsharedmods sharedmods gdbhooks
and
-platform: $(BUILDPYTHON)
+platform: $(BUILDPYTHON) $(PYTHON)
This ensures that both the host and build python interpreters are available before trying to call these rules, so that all of the dependencies of the $(PYTHON) target have also been built first in case they're referenced. In the native compilation case, $(BUILDPYTHON) $(PYTHON) is simply redundant, so not a problem.
I've also just spied this:
+$(PYTHON): Modules/python.o $(LIBRARY) $(LDLIBRARY)
$(LINKCC) $(LDFLAGS) $(LINKFORSHARED) -o $@ \
Modules/ python. o \
$(BLDLIBRARY ) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
BLDLIBRARY is a variable referring to options for the build architecture, so we need to update this to $(LDLIBRARY) as well.
# Build the shared modules '$(BLDSHARED) ' LDFLAGS= '$(LDFLAGS) ' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \ '$(BLDSHARED) ' LDFLAGS= '$(LDFLAGS) ' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \ '$(BLDSHARED) ' LDFLAGS= '$(LDFLAGS) ' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \ '$(BLDSHARED) ' LDFLAGS= '$(LDFLAGS) ' OPT='$(OPT)' ./$(BUILDPYTHON) -E ...
-sharedmods: $(BUILDPYTHON)
+sharedmods: $(PYTHON)
@case $$MAKEFLAGS in \
- *s*) $(RUNSHARED) CC='$(CC)' LDSHARED=
- *) $(RUNSHARED) CC='$(CC)' LDSHARED=
+ *s*) $(RUNSHARED) CC='$(CC)' LDSHARED=
+ *) $(RUNSHARED) CC='$(CC)' LDSHARED=