Merge lp:~peter-pearse/ubuntu/natty/python2.6/prop002 into lp:ubuntu/natty/python2.6

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
Reviewer Review Type Date Requested Status
Steve Langasek Needs Fixing
Review via email: mp+52556@code.launchpad.net

Description of the change

Fixes most of the points raised in review of https://code.launchpad.net/~peter-pearse/ubuntu/natty/python2.6/prop001.

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.
Revision history for this message
Steve Langasek (vorlon) wrote :
Download full text (4.5 KiB)

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.
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/include, from a package, is by unpacking it directly to
/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
-sharedmods: $(BUILDPYTHON)
+sharedmods: $(PYTHON)
        @case $$MAKEFLAGS in \
- *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' LDFLAGS='$(LDFLAGS)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \
- *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' LDFLAGS='$(LDFLAGS)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
+ *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' LDFLAGS='$(LDFLAGS)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
+ *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' LDFLAGS='$(LDFLAGS)' OPT='$(OPT)' ./$(BUILDPYTHON) -E ...

Read more...

review: Needs Fixing

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
=== modified file 'debian/changelog'
--- debian/changelog 2011-02-23 23:41:57 +0000
+++ debian/changelog 2011-03-08 13:49:05 +0000
@@ -1,3 +1,15 @@
1python2.6 (2.6.6-6ubuntu7) maverick; urgency=low
2
3 * configure.in - Set buggygetaddrinfo for cross builds
4 * - Add py_cv_has_zd_printf for cross builds
5 * Makefile.pre.in - Use BUILDPYTHON where applicable for cross builds
6 * setup.py - For cross builds, pass cross toolchain info in python
7 environment
8 * debian/rules - Build a build host python for use during a cross
9 build. Adjust the configuration files & make environment accordingly.
10
11 -- Peter Pearse <peter.pearse@linaro.org> Tue, 08 Mar 2011 13:31:46 +0000
12
1python2.6 (2.6.6-6ubuntu6) natty; urgency=low13python2.6 (2.6.6-6ubuntu6) natty; urgency=low
214
3 * Disable the profiled build on ppc64.15 * Disable the profiled build on ppc64.
416
=== added file 'debian/patches/cross.diff'
--- debian/patches/cross.diff 1970-01-01 00:00:00 +0000
+++ debian/patches/cross.diff 2011-03-08 13:49:05 +0000
@@ -0,0 +1,222 @@
1diff -Nru p/configure.in p_p/configure.in
2--- p/configure.in 2011-03-07 11:51:09.000000000 +0000
3+++ p_p/configure.in 2011-03-07 11:52:23.000000000 +0000
4@@ -3018,8 +3018,8 @@
5 buggygetaddrinfo=no,
6 AC_MSG_RESULT(buggy)
7 buggygetaddrinfo=yes,
8-AC_MSG_RESULT(buggy)
9-buggygetaddrinfo=yes)], [
10+AC_MSG_RESULT(cross)
11+buggygetaddrinfo=no)], [
12 AC_MSG_RESULT(no)
13 buggygetaddrinfo=yes
14 ])
15@@ -3873,7 +3873,7 @@
16 AC_MSG_RESULT(no)
17 fi
18
19-AC_MSG_CHECKING(for %zd printf() format support)
20+AC_CACHE_CHECK([for %zd printf() format support], [py_cv_has_zd_printf], [dnl
21 AC_TRY_RUN([#include <stdio.h>
22 #include <stddef.h>
23 #include <string.h>
24@@ -3907,10 +3907,13 @@
25 return 1;
26
27 return 0;
28-}],
29-[AC_MSG_RESULT(yes)
30- AC_DEFINE(PY_FORMAT_SIZE_T, "z", [Define to printf format modifier for Py_ssize_t])],
31- AC_MSG_RESULT(no))
32+}], [py_cv_has_zd_printf="yes"],
33+ [py_cv_has_zd_printf="no"],
34+ [py_cv_has_zd_printf="cross -- assuming yes"]
35+)])
36+if test "$py_cv_has_zd_printf" != "no" ; then
37+ AC_DEFINE(PY_FORMAT_SIZE_T, "z", [Define to printf format modifier for Py_ssize_t])
38+fi
39
40 AC_CHECK_TYPE(socklen_t,,
41 AC_DEFINE(socklen_t,int,
42diff -Nru p/Makefile.pre.in p_p/Makefile.pre.in
43--- p/Makefile.pre.in 2011-03-07 11:51:08.000000000 +0000
44+++ p_p/Makefile.pre.in 2011-03-08 13:10:29.000000000 +0000
45@@ -207,6 +207,8 @@
46 ##########################################################################
47 # Parser
48 PGEN= Parser/pgen$(EXE)
49+# Allow override for cross build
50+BUILDPGEN= $(PGEN)
51
52 POBJS= \
53 Parser/acceler.o \
54@@ -354,7 +356,7 @@
55
56 # Default target
57 all: build_all
58-build_all: $(BUILDPYTHON) oldsharedmods sharedmods gdbhooks
59+build_all: $(PYTHON) oldsharedmods sharedmods gdbhooks
60
61 # Compile a binary with gcc profile guided optimization.
62 profile-opt:
63@@ -386,20 +388,20 @@
64
65
66 # Build the interpreter
67-$(BUILDPYTHON): Modules/python.o $(LIBRARY) $(LDLIBRARY)
68+$(PYTHON): Modules/python.o $(LIBRARY) $(LDLIBRARY)
69 $(LINKCC) $(LDFLAGS) $(LINKFORSHARED) -o $@ \
70 Modules/python.o \
71 $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
72
73-platform: $(BUILDPYTHON)
74+platform: $(PYTHON)
75 $(RUNSHARED) ./$(BUILDPYTHON) -E -c 'import sys ; from distutils.util import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform
76
77
78 # Build the shared modules
79-sharedmods: $(BUILDPYTHON)
80+sharedmods: $(PYTHON)
81 @case $$MAKEFLAGS in \
82- *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' LDFLAGS='$(LDFLAGS)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \
83- *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' LDFLAGS='$(LDFLAGS)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
84+ *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' LDFLAGS='$(LDFLAGS)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
85+ *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' LDFLAGS='$(LDFLAGS)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
86 esac
87
88 # Build static library
89@@ -423,7 +425,7 @@
90 fi
91
92 libpython$(VERSION).dylib: $(LIBRARY_OBJS)
93- $(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); \
94+ $(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); \
95
96
97 libpython$(VERSION).sl: $(LIBRARY_OBJS)
98@@ -434,10 +436,10 @@
99 #
100 # Distributors are likely to want to install this somewhere else e.g. relative
101 # to the stripped DWARF data for the shared library.
102-gdbhooks: $(BUILDPYTHON)-gdb.py
103+gdbhooks: $(PYTHON)-gdb.py
104
105-$(BUILDPYTHON)-gdb.py: Tools/gdb/libpython.py
106- $(INSTALL_SCRIPT) $< $(BUILDPYTHON)-gdb.py
107+$(PYTHON)-gdb.py: Tools/gdb/libpython.py
108+ $(INSTALL_SCRIPT) $< $(PYTHON)-gdb.py
109
110 # This rule is here for OPENSTEP/Rhapsody/MacOSX. It builds a temporary
111 # minimal framework (not including the Lib directory and such) in the current
112@@ -531,7 +533,7 @@
113
114 $(GRAMMAR_H) $(GRAMMAR_C): $(PGEN) $(GRAMMAR_INPUT)
115 -@$(INSTALL) -d Include
116- -$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
117+ -$(BUILDPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
118
119 $(PGEN): $(PGENOBJS)
120 $(CC) $(OPT) $(LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN)
121@@ -780,7 +782,7 @@
122
123 # Install the interpreter with $(VERSION) affixed
124 # This goes into $(exec_prefix)
125-altbininstall: $(BUILDPYTHON)
126+altbininstall: $(PYTHON)
127 @for i in $(BINDIR) $(LIBDIR); \
128 do \
129 if test ! -d $(DESTDIR)$$i; then \
130@@ -789,7 +791,7 @@
131 else true; \
132 fi; \
133 done
134- $(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE)
135+ $(INSTALL_PROGRAM) $(PYTHON) $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE)
136 if test -f $(LDLIBRARY); then \
137 if test -n "$(DLLLIBRARY)" ; then \
138 $(INSTALL_SHARED) $(DLLLIBRARY) $(DESTDIR)$(BINDIR); \
139@@ -1110,7 +1112,7 @@
140 config.status: $(srcdir)/configure
141 $(SHELL) $(srcdir)/configure $(CONFIG_ARGS)
142
143-.PRECIOUS: config.status $(BUILDPYTHON) Makefile Makefile.pre
144+.PRECIOUS: config.status $(PYTHON) Makefile Makefile.pre
145
146 # Some make's put the object file in the current directory
147 .c.o:
148@@ -1162,7 +1164,7 @@
149 find . -name '*.gc??' -exec rm -f {} ';'
150
151 clobber: clean profile-removal
152- -rm -f $(BUILDPYTHON) $(PGEN) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY) \
153+ -rm -f $(PYTHON) $(PGEN) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY) \
154 tags TAGS \
155 config.cache config.log pyconfig.h Modules/config.c
156 -rm -rf build platform
157diff -Nru p/Modules/Setup.dist p_p/Modules/Setup.dist
158--- p/Modules/Setup.dist 2011-03-07 11:51:08.000000000 +0000
159+++ p_p/Modules/Setup.dist 2011-03-07 11:52:23.000000000 +0000
160@@ -458,7 +458,9 @@
161 # Andrew Kuchling's zlib module.
162 # This require zlib 1.1.3 (or later).
163 # See http://www.gzip.org/zlib/
164-#zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
165+# Well behaved toolchains should not require -L$(exec_prefix)/lib
166+# - using it breaks cross builds
167+#zlib zlibmodule.c -I$(prefix)/include -lz
168
169 # Interface to the Expat XML parser
170 #
171diff -Nru p/setup.py p_p/setup.py
172--- p/setup.py 2011-03-07 11:51:08.000000000 +0000
173+++ p_p/setup.py 2011-03-08 10:50:19.000000000 +0000
174@@ -235,6 +235,22 @@
175 # When you run "make CC=altcc" or something similar, you really want
176 # those environment variables passed into the setup.py phase. Here's
177 # a small set of useful ones.
178+
179+ # Change the environment for cross compiling
180+ # - may want to use environment variables for settings?
181+ if os.environ.get('CROSS_COMPILE'):
182+ exec_prefix=os.environ.get('CROSS_COMPILE')
183+ os.environ["CC"] = exec_prefix + '-gcc'
184+ os.environ["CXX"] = exec_prefix + '-g++'
185+ os.environ["LDSHARED"] = exec_prefix + '-gcc -shared'
186+ os.environ["CPP"] = exec_prefix + '-cpp'
187+ os.environ["LDFLAGS"] = '-L /usr/' + exec_prefix + '/lib -L /usr/' + exec_prefix + '/usr/lib'
188+ os.environ["CFLAGS"] = '-I/usr/' + exec_prefix + '/include -I/usr/' + exec_prefix + '/usr/include'
189+ # Use -D markers to detect if/where used
190+ os.environ["CPPFLAGS"] = '-DCPPFLAGS'
191+ os.environ["BASECFLAGS"] = '-DBASECFLAGS'
192+ os.environ["OPT"] = '-DOPT'
193+
194 compiler = os.environ.get('CC')
195 args = {}
196 # unfortunately, distutils doesn't let us provide separate C and C++
197@@ -313,6 +329,13 @@
198 self.announce('WARNING: skipping import check for Cygwin-based "%s"'
199 % ext.name)
200 return
201+
202+ # Cant import cross built modules
203+ if os.environ.get('CROSS_COMPILE'):
204+ self.announce('WARNING: skipping import check for %s, cross built for %s'
205+ % (ext.name, os.environ.get('CROSS_COMPILE')))
206+ return
207+
208 ext_filename = os.path.join(
209 self.build_lib,
210 self.get_ext_filename(self.get_ext_fullname(ext.name)))
211@@ -1840,6 +1863,11 @@
212 mkpath(ffi_builddir)
213 config_args = []
214
215+ if os.environ.get('CROSS_COMPILE'):
216+ exec_prefix = os.environ.get('CROSS_COMPILE')
217+ print "Configuring _ctypes module for cross building %s" % (exec_prefix)
218+ config_args = [ '--host ' + exec_prefix]
219+
220 # Pass empty CFLAGS because we'll just append the resulting
221 # CFLAGS to Python's; -g or -O2 is to be avoided.
222 cmd = "cd %s && env CFLAGS='' '%s/configure' %s" \
0223
=== modified file 'debian/patches/series.in'
--- debian/patches/series.in 2010-10-12 12:53:47 +0000
+++ debian/patches/series.in 2011-03-08 13:49:05 +0000
@@ -60,3 +60,4 @@
60link-system-expat.diff60link-system-expat.diff
61plat-gnukfreebsd.diff61plat-gnukfreebsd.diff
62issue7356.diff62issue7356.diff
63cross.diff
6364
=== modified file 'debian/rules'
--- debian/rules 2011-02-23 23:41:57 +0000
+++ debian/rules 2011-03-08 13:49:05 +0000
@@ -10,6 +10,8 @@
1010
11DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)11DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
12DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)12DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
13DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
14DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
1315
14changelog_values := $(shell dpkg-parsechangelog \16changelog_values := $(shell dpkg-parsechangelog \
15 | awk '/^(Version|Source):/ {print $$2}')17 | awk '/^(Version|Source):/ {print $$2}')
@@ -25,6 +27,10 @@
25ifneq (,$(findstring nobench, $(DEB_BUILD_OPTIONS)))27ifneq (,$(findstring nobench, $(DEB_BUILD_OPTIONS)))
26 WITHOUT_BENCH := yes28 WITHOUT_BENCH := yes
27endif29endif
30ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
31 WITHOUT_BENCH := yes
32 WITHOUT_CHECK := yes
33endif
28ifeq ($(on_buildd),yes)34ifeq ($(on_buildd),yes)
29 ifneq (,$(findstring $(DEB_HOST_ARCH), hppa mips mipsel s390))35 ifneq (,$(findstring $(DEB_HOST_ARCH), hppa mips mipsel s390))
30 WITHOUT_CHECK := yes36 WITHOUT_CHECK := yes
@@ -92,7 +98,17 @@
92endif98endif
93with_fpectl = yes99with_fpectl = yes
94100
95CC = gcc101ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
102 CC = gcc
103 CROSS =
104else
105 CC = $(DEB_HOST_GNU_TYPE)-gcc
106 # Note that make runs the binaries as ./$(app),
107 # - so they must not be absolutely pathed
108 CROSS = BUILDPYTHON=../build-cross/python \
109 BUILDPGEN=../build-cross/Parser/pgen \
110 CROSS_COMPILE=$(DEB_HOST_GNU_TYPE)
111endif
96112
97# on alpha, use -O2 only, use -mieee113# on alpha, use -O2 only, use -mieee
98ifeq ($(DEB_HOST_ARCH),alpha)114ifeq ($(DEB_HOST_ARCH),alpha)
@@ -104,6 +120,9 @@
104endif120endif
105121
106PWD := $(shell pwd)122PWD := $(shell pwd)
123ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
124 buildd_cross := $(CURDIR)/build-cross
125endif
107buildd_static := $(CURDIR)/build-static126buildd_static := $(CURDIR)/build-static
108buildd_shared := $(CURDIR)/build-shared127buildd_shared := $(CURDIR)/build-shared
109buildd_debug := $(CURDIR)/build-debug128buildd_debug := $(CURDIR)/build-debug
@@ -138,7 +157,7 @@
138d_dbg := debian/$(p_dbg)157d_dbg := debian/$(p_dbg)
139158
140# profiled build fails on amd64, lpia, sparc159# profiled build fails on amd64, lpia, sparc
141ifneq (,$(filter $(DEB_HOST_ARCH), alpha amd64 armel hppa i386 ia64 lpia mips mipsel powerpc ppc64 s390 sparc64 hurd-i386 kfreebsd-i386 kfreebsd-amd64))160ifneq (,$(filter $(DEB_HOST_ARCH), alpha amd64 armel hppa i386 ia64 lpia mips mipsel powerpc s390 sparc64 hurd-i386 kfreebsd-i386 kfreebsd-amd64))
142 make_build_target =161 make_build_target =
143else162else
144 make_build_target = profile-opt163 make_build_target = profile-opt
@@ -167,30 +186,30 @@
167186
168stamps/stamp-build-static: stamps/stamp-configure-static187stamps/stamp-build-static: stamps/stamp-configure-static
169 dh_testdir188 dh_testdir
170 $(MAKE) $(NJOBS) -C $(buildd_static) \189 $(MAKE) $(NJOBS) -C $(buildd_static) $(CROSS) \
171 PROFILE_TASK='$(PROFILE_TASK)' $(make_build_target)190 PROFILE_TASK='$(PROFILE_TASK)' $(make_build_target)
172 touch stamps/stamp-build-static191 touch stamps/stamp-build-static
173192
174stamps/stamp-build-shared: stamps/stamp-configure-shared193stamps/stamp-build-shared: stamps/stamp-configure-shared
175 dh_testdir194 dh_testdir
176 $(MAKE) $(NJOBS) -C $(buildd_shared)195 $(MAKE) $(NJOBS) -C $(buildd_shared) $(CROSS)
177# : # build the shared library196# : # build the shared library
178# $(MAKE) $(NJOBS) -C $(buildd_shared) \197# $(MAKE) $(NJOBS) -C $(buildd_shared) $(CROSS) \
179# libpython$(VER).so198# libpython$(VER).so
180 : # build a static library with PIC objects199 : # build a static library with PIC objects
181 $(MAKE) $(NJOBS) -C $(buildd_shared) \200 $(MAKE) $(NJOBS) -C $(buildd_shared) $(CROSS) \
182 LIBRARY=libpython$(VER)-pic.a libpython$(VER)-pic.a201 LIBRARY=libpython$(VER)-pic.a libpython$(VER)-pic.a
183 touch stamps/stamp-build-shared202 touch stamps/stamp-build-shared
184203
185stamps/stamp-build-debug: stamps/stamp-configure-debug204stamps/stamp-build-debug: stamps/stamp-configure-debug
186 dh_testdir205 dh_testdir
187 $(MAKE) $(NJOBS) -C $(buildd_debug)206 $(MAKE) $(NJOBS) -C $(buildd_debug) $(CROSS)
188 touch stamps/stamp-build-debug207 touch stamps/stamp-build-debug
189208
190stamps/stamp-build-shared-debug: stamps/stamp-configure-shared-debug209stamps/stamp-build-shared-debug: stamps/stamp-configure-shared-debug
191 dh_testdir210 dh_testdir
192 : # build the shared debug library211 : # build the shared debug library
193 $(MAKE) $(NJOBS) -C $(buildd_shdebug) \212 $(MAKE) $(NJOBS) -C $(buildd_shdebug) $(CROSS) \
194 libpython$(VER)_d.so213 libpython$(VER)_d.so
195 touch stamps/stamp-build-shared-debug214 touch stamps/stamp-build-shared-debug
196215
@@ -206,11 +225,52 @@
206 common_configure_args += --with-system-ffi225 common_configure_args += --with-system-ffi
207endif226endif
208227
228ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
229 common_configure_args += \
230 --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE)
231endif
232
209ifeq ($(with_fpectl),yes)233ifeq ($(with_fpectl),yes)
210 common_configure_args += \234 common_configure_args += \
211 --with-fpectl235 --with-fpectl
212endif236endif
213237
238ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
239
240stamps/stamp-configure-cross: stamps/stamp-patch
241 rm -rf $(buildd_cross)
242 mkdir -p $(buildd_cross)
243 cd $(buildd_cross) && \
244 CC=gcc CONFIG_SITE= $(OPTSETTINGS) \
245 ../configure --build $(DEB_BUILD_GNU_TYPE)
246 egrep \
247 "^#($$(awk '$$2 ~ /^extension$$/ {print $$1}' debian/PVER-minimal.README.Debian.in | tr '\012' '|')XX)" \
248 Modules/Setup.dist \
249 | sed -e 's/^#//' -e 's/-Wl,-Bdynamic//;s/-Wl,-Bstatic//' \
250 >> $(buildd_cross)/Modules/Setup.local
251 cd $(buildd_cross) && \
252 ../Modules/makesetup -c ../Modules/config.c.in -s Modules \
253 Modules/Setup.config Modules/Setup.local Modules/Setup
254 mv $(buildd_cross)/config.c $(buildd_cross)/Modules/
255
256 @echo "Each build should use it's own pyconfig.h & Makefile variables"
257 cp $(buildd_cross)/pyconfig.h $(buildd_cross)/pyconfig.h.cross
258 cp $(buildd_cross)/Makefile $(buildd_cross)/Makefile.cross
259
260 touch stamps/stamp-configure-cross
261
262stamps/stamp-build-cross: stamps/stamp-configure-cross
263 dh_testdir
264 $(MAKE) $(NJOBS) -C $(buildd_cross) python Parser/pgen
265 touch stamps/stamp-build-cross
266
267stamps/stamp-configure-shared: stamps/stamp-build-cross
268stamps/stamp-configure-static: stamps/stamp-build-cross
269stamps/stamp-configure-debug: stamps/stamp-build-cross
270stamps/stamp-configure-shared-debug: stamps/stamp-build-cross
271
272endif
273
214stamps/stamp-configure-shared: stamps/stamp-patch274stamps/stamp-configure-shared: stamps/stamp-patch
215 rm -rf $(buildd_shared)275 rm -rf $(buildd_shared)
216 mkdir -p $(buildd_shared)276 mkdir -p $(buildd_shared)
@@ -229,6 +289,12 @@
229 Modules/Setup.config Modules/Setup.local Modules/Setup289 Modules/Setup.config Modules/Setup.local Modules/Setup
230 mv $(buildd_shared)/config.c $(buildd_shared)/Modules/290 mv $(buildd_shared)/config.c $(buildd_shared)/Modules/
231291
292ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
293 @echo "Build python should use the new pyconfig.h & Makefile "
294 cp $(buildd_shared)/pyconfig.h $(buildd_cross)/pyconfig.h
295 cp $(buildd_shared)/Makefile $(buildd_cross)/Makefile
296endif
297
232 touch stamps/stamp-configure-shared298 touch stamps/stamp-configure-shared
233299
234stamps/stamp-configure-static: stamps/stamp-patch300stamps/stamp-configure-static: stamps/stamp-patch
@@ -253,6 +319,12 @@
253 mv -f $(buildd_static)/pyconfig.h.new $(buildd_static)/pyconfig.h319 mv -f $(buildd_static)/pyconfig.h.new $(buildd_static)/pyconfig.h
254 mv $(buildd_static)/config.c $(buildd_static)/Modules/320 mv $(buildd_static)/config.c $(buildd_static)/Modules/
255321
322ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
323 @echo "Build python should use the new pyconfig.h"
324 cp $(buildd_static)/pyconfig.h $(buildd_cross)/pyconfig.h
325 cp $(buildd_static)/Makefile $(buildd_cross)/Makefile
326endif
327
256 touch stamps/stamp-configure-static328 touch stamps/stamp-configure-static
257329
258stamps/stamp-configure-debug: stamps/stamp-patch330stamps/stamp-configure-debug: stamps/stamp-patch
@@ -278,6 +350,12 @@
278 touch -r $(buildd_debug)/pyconfig.h $(buildd_debug)/pyconfig.h.new350 touch -r $(buildd_debug)/pyconfig.h $(buildd_debug)/pyconfig.h.new
279 mv -f $(buildd_debug)/pyconfig.h.new $(buildd_debug)/pyconfig.h351 mv -f $(buildd_debug)/pyconfig.h.new $(buildd_debug)/pyconfig.h
280352
353ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
354 @echo "Build python should use the new pyconfig.h"
355 cp $(buildd_debug)/pyconfig.h $(buildd_cross)/pyconfig.h
356 cp $(buildd_debug)/Makefile $(buildd_cross)/Makefile
357endif
358
281 touch stamps/stamp-configure-debug359 touch stamps/stamp-configure-debug
282360
283stamps/stamp-configure-shared-debug: stamps/stamp-patch361stamps/stamp-configure-shared-debug: stamps/stamp-patch
@@ -305,9 +383,16 @@
305 touch -r $(buildd_shdebug)/pyconfig.h $(buildd_shdebug)/pyconfig.h.new383 touch -r $(buildd_shdebug)/pyconfig.h $(buildd_shdebug)/pyconfig.h.new
306 mv -f $(buildd_shdebug)/pyconfig.h.new $(buildd_shdebug)/pyconfig.h384 mv -f $(buildd_shdebug)/pyconfig.h.new $(buildd_shdebug)/pyconfig.h
307385
386ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
387 @echo "Build python should use the new pyconfig.h"
388 cp $(buildd_shdebug)/pyconfig.h $(buildd_cross)/pyconfig.h
389 cp $(buildd_shdebug)/Makefile $(buildd_cross)/Makefile
390endif
391
308 touch stamps/stamp-configure-shared-debug392 touch stamps/stamp-configure-shared-debug
309393
310stamps/stamp-mincheck: stamps/stamp-build-static debian/PVER-minimal.README.Debian.in394stamps/stamp-mincheck: stamps/stamp-build-static debian/PVER-minimal.README.Debian.in
395ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
311 for m in $(MIN_MODS) $(MIN_PACKAGES) $(MIN_EXTS) $(MIN_BUILTINS); do \396 for m in $(MIN_MODS) $(MIN_PACKAGES) $(MIN_EXTS) $(MIN_BUILTINS); do \
312 echo "import $$m"; \397 echo "import $$m"; \
313 done > $(buildd_static)/minmods.py398 done > $(buildd_static)/minmods.py
@@ -321,6 +406,9 @@
321 else true; fi406 else true; fi
322 cd $(buildd_static) && ./python ../debian/mincheck.py \407 cd $(buildd_static) && ./python ../debian/mincheck.py \
323 minmods.py mindeps.txt408 minmods.py mindeps.txt
409else
410 @echo "No mincheck for cross build"
411endif
324 touch stamps/stamp-mincheck412 touch stamps/stamp-mincheck
325413
326TEST_RESOURCES = all414TEST_RESOURCES = all
@@ -342,7 +430,7 @@
342ifneq (,$(filter $(DEB_HOST_ARCH), hppa))430ifneq (,$(filter $(DEB_HOST_ARCH), hppa))
343 TEST_EXCLUDES += test_fork1 test_multiprocessing test_socketserver test_wait3 test_wait4 test_gdb431 TEST_EXCLUDES += test_fork1 test_multiprocessing test_socketserver test_wait3 test_wait4 test_gdb
344endif432endif
345ifneq (,$(filter $(DEB_HOST_ARCH), arm avr32))433ifneq (,$(filter $(DEB_HOST_ARCH), avr32))
346 TEST_EXCLUDES += test_ctypes434 TEST_EXCLUDES += test_ctypes
347endif435endif
348ifneq (,$(filter $(DEB_HOST_ARCH), m68k avr32))436ifneq (,$(filter $(DEB_HOST_ARCH), m68k avr32))
@@ -412,6 +500,7 @@
412 touch stamps/stamp-check500 touch stamps/stamp-check
413501
414stamps/stamp-pystone:502stamps/stamp-pystone:
503ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
415 @echo "BEGIN pystone static"504 @echo "BEGIN pystone static"
416 cd $(buildd_static) && ./python ../Lib/test/pystone.py505 cd $(buildd_static) && ./python ../Lib/test/pystone.py
417 cd $(buildd_static) && ./python ../Lib/test/pystone.py506 cd $(buildd_static) && ./python ../Lib/test/pystone.py
@@ -426,6 +515,9 @@
426 cd $(buildd_debug) && ./python ../Lib/test/pystone.py515 cd $(buildd_debug) && ./python ../Lib/test/pystone.py
427 cd $(buildd_debug) && ./python ../Lib/test/pystone.py516 cd $(buildd_debug) && ./python ../Lib/test/pystone.py
428 @echo "END pystone debug"517 @echo "END pystone debug"
518else
519 @echo "No pystone for cross build"
520endif
429 touch stamps/stamp-pystone521 touch stamps/stamp-pystone
430522
431#ifeq (,$(filter $(DEB_HOST_ARCH), arm armel avr32 hppa mips mipsel m68k))523#ifeq (,$(filter $(DEB_HOST_ARCH), arm armel avr32 hppa mips mipsel m68k))
@@ -487,7 +579,7 @@
487579
488stamps/stamp-doc-html:580stamps/stamp-doc-html:
489 dh_testdir581 dh_testdir
490 $(MAKE) -C Doc html582 $(MAKE) -C Doc html $(CROSS)
491 touch stamps/stamp-doc-html583 touch stamps/stamp-doc-html
492584
493build-doc: stamps/stamp-patch stamps/stamp-build-doc585build-doc: stamps/stamp-patch stamps/stamp-build-doc
@@ -518,14 +610,17 @@
518clean: control-file610clean: control-file
519 dh_testdir611 dh_testdir
520 dh_testroot612 dh_testroot
521 $(MAKE) -f debian/rules unpatch613 $(MAKE) -f debian/rules unpatch $(CROSS)
522 rm -rf stamps .pc614 rm -rf stamps .pc
523 rm -f debian/test_results615 rm -f debian/test_results
524616
525 $(MAKE) -C Doc clean617 $(MAKE) -C Doc clean $(CROSS)
526 sed 's/^@/#/' Makefile.pre.in | $(MAKE) -f - srcdir=. distclean618 sed 's/^@/#/' Makefile.pre.in | $(MAKE) -f - srcdir=. distclean $(CROSS)
527 rm -rf Lib/test/db_home619 rm -rf Lib/test/db_home
528 rm -rf $(buildd_static) $(buildd_shared) $(buildd_debug) $(buildd_shdebug)620 rm -rf $(buildd_static) $(buildd_shared) $(buildd_debug) $(buildd_shdebug)
621ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
622 rm -rf $(buildd_cross)
623endif
529 find -name '*.py[co]' | xargs -r rm -f624 find -name '*.py[co]' | xargs -r rm -f
530 rm -f Lib/lib2to3/*.pickle625 rm -f Lib/lib2to3/*.pickle
531 rm -rf locales626 rm -rf locales
@@ -568,9 +663,9 @@
568 : # their packages' directories.663 : # their packages' directories.
569 install -d $(d)/usr664 install -d $(d)/usr
570ifeq ($(with_interp),static)665ifeq ($(with_interp),static)
571 $(MAKE) -C $(buildd_static) install prefix=$(CURDIR)/$(d)/usr666 $(MAKE) -C $(buildd_static) install prefix=$(CURDIR)/$(d)/usr $(CROSS)
572else667else
573 $(MAKE) -C $(buildd_shared) install prefix=$(CURDIR)/$(d)/usr668 $(MAKE) -C $(buildd_shared) install prefix=$(CURDIR)/$(d)/usr $(CROSS)
574endif669endif
575 -find $(d)/usr/lib/python$(VER) -name '*_failed*.so'670 -find $(d)/usr/lib/python$(VER) -name '*_failed*.so'
576 find $(d)/usr/lib/python$(VER) -name '*_failed*.so' | xargs -r rm -f671 find $(d)/usr/lib/python$(VER) -name '*_failed*.so' | xargs -r rm -f
@@ -806,8 +901,13 @@
806901
807 : # generate binfmt file902 : # generate binfmt file
808 mkdir -p $(d_min)/usr/share/binfmts903 mkdir -p $(d_min)/usr/share/binfmts
904ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
809 $(buildd_static)/python debian/mkbinfmt.py $(PVER) \905 $(buildd_static)/python debian/mkbinfmt.py $(PVER) \
810 > $(d_min)/usr/share/binfmts/$(PVER)906 > $(d_min)/usr/share/binfmts/$(PVER)
907else
908 $(buildd_cross)/python debian/mkbinfmt.py $(PVER) \
909 > $(d_min)/usr/share/binfmts/$(PVER)
910endif
811911
812 : # desktop entry912 : # desktop entry
813 mkdir -p $(d_base)/usr/share/applications913 mkdir -p $(d_base)/usr/share/applications
@@ -823,7 +923,7 @@
823923
824 : # install debug package924 : # install debug package
825 rm -rf $(d)-dbg925 rm -rf $(d)-dbg
826 $(MAKE) -C $(buildd_debug) install DESTDIR=$(CURDIR)/$(d)-dbg926 $(MAKE) -C $(buildd_debug) install DESTDIR=$(CURDIR)/$(d)-dbg $(CROSS)
827 dh_installdirs -p$(p_dbg) \927 dh_installdirs -p$(p_dbg) \
828 usr/bin \928 usr/bin \
829 usr/share/man/man1 \929 usr/share/man/man1 \

Subscribers

People subscribed via source and target branches

to all changes: