Merge lp:~peter-pearse/ubuntu/natty/python2.7/prop003 into lp:ubuntu/natty/python2.7

Proposed by Peter Pearse
Status: Needs review
Proposed branch: lp:~peter-pearse/ubuntu/natty/python2.7/prop003
Merge into: lp:ubuntu/natty/python2.7
Diff against target: 600 lines (+394/-16)
4 files modified
debian/changelog (+12/-0)
debian/patches/cross.diff (+252/-0)
debian/patches/series.in (+1/-0)
debian/rules (+129/-16)
To merge this branch: bzr merge lp:~peter-pearse/ubuntu/natty/python2.7/prop003
Reviewer Review Type Date Requested Status
Steve Langasek Pending
Review via email: mp+56777@code.launchpad.net

Description of the change

Changed to resemble python2.6 prop004

To post a comment you must log in.

Unmerged revisions

29. By Peter Pearse

  * Modules/Setup.dist - drop system paths for zlib.
  * Makefile.pre.in - Use BUILDPYTHON where applicable for cross builds.
  * setup.py - For cross builds, pass cross toolchain info in python
    environment.
  * debian/rules - Build a build host python for use during a cross
    build. Adjust the configuration files & make environment
    accordingly.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/changelog'
--- debian/changelog 2011-03-23 15:02:47 +0000
+++ debian/changelog 2011-04-07 14:02:15 +0000
@@ -1,3 +1,15 @@
1python2.7 (2.7.1-5ubuntu2) natty; urgency=low
2
3 * Modules/Setup.dist - drop system paths for zlib.
4 * Makefile.pre.in - Use BUILDPYTHON where applicable for cross builds.
5 * setup.py - For cross builds, pass cross toolchain info in python
6 environment.
7 * debian/rules - Build a build host python for use during a cross
8 build. Adjust the configuration files & make environment
9 accordingly.
10
11 -- Peter Pearse <peter.pearse@linaro.org> Thu, 07 Apr 2011 12:59:39 +0000
12
1python2.7 (2.7.1-5ubuntu1) natty; urgency=low13python2.7 (2.7.1-5ubuntu1) natty; urgency=low
214
3 * debian/patches/deb-setup.diff: DEB_GNU_TYPE was never being set, so15 * debian/patches/deb-setup.diff: DEB_GNU_TYPE was never being set, so
416
=== added file 'debian/patches/cross.diff'
--- debian/patches/cross.diff 1970-01-01 00:00:00 +0000
+++ debian/patches/cross.diff 2011-04-07 14:02:15 +0000
@@ -0,0 +1,252 @@
1Index: python2.7/Makefile.pre.in
2===================================================================
3--- python2.7.orig/Makefile.pre.in 2011-04-07 10:41:23.000000000 +0000
4+++ python2.7/Makefile.pre.in 2011-04-07 10:41:23.000000000 +0000
5@@ -213,6 +213,9 @@
6 ##########################################################################
7 # Parser
8 PGEN= Parser/pgen$(EXE)
9+# Allow override for cross build
10+BUILDPGEN= $(PGEN)
11+
12
13 POBJS= \
14 Parser/acceler.o \
15@@ -364,7 +367,7 @@
16
17 # Default target
18 all: build_all
19-build_all: $(BUILDPYTHON) oldsharedmods sharedmods gdbhooks
20+build_all: $(BUILDPYTHON) $(PYTHON) oldsharedmods sharedmods gdbhooks
21
22 # Compile a binary with gcc profile guided optimization.
23 profile-opt:
24@@ -381,7 +384,7 @@
25 build_all_generate_profile:
26 $(MAKE) all CFLAGS="$(CFLAGS) -fprofile-generate" LIBS="$(LIBS) -lgcov"
27
28-run_profile_task:
29+run_profile_task: $(BUILDPYTHON) $(PYTHON)
30 -./$(BUILDPYTHON) $(PROFILE_TASK)
31
32 build_all_use_profile:
33@@ -394,17 +397,17 @@
34
35
36 # Build the interpreter
37-$(BUILDPYTHON): Modules/python.o $(LIBRARY) $(LDLIBRARY)
38+$(PYTHON): Modules/python.o $(LIBRARY) $(LDLIBRARY)
39 $(LINKCC) $(LDFLAGS) $(LINKFORSHARED) -o $@ \
40 Modules/python.o \
41 $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
42
43-platform: $(BUILDPYTHON)
44+platform: $(BUILDPYTHON) $(PYTHON)
45 $(RUNSHARED) ./$(BUILDPYTHON) -E -c 'import sys ; from sysconfig import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform
46
47
48 # Build the shared modules
49-sharedmods: $(BUILDPYTHON)
50+sharedmods: $(BUILDPYTHON) $(PYTHON)
51 @case $$MAKEFLAGS in \
52 *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \
53 *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
54@@ -424,10 +427,10 @@
55
56 libpython$(VERSION)$(DEBUG_EXT).so: $(LIBRARY_OBJS)
57 if test $(INSTSONAME) != $(LDLIBRARY); then \
58- $(BLDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
59+ $(LDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
60 $(LN) -f $(INSTSONAME) $@; \
61 else \
62- $(BLDSHARED) -o $@ $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
63+ $(LDSHARED) -o $@ $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
64 fi
65
66 libpython$(VERSION).dylib: $(LIBRARY_OBJS)
67@@ -442,11 +445,11 @@
68 #
69 # Distributors are likely to want to install this somewhere else e.g. relative
70 # to the stripped DWARF data for the shared library.
71-gdbhooks: $(BUILDPYTHON)-gdb.py
72+gdbhooks: $(PYTHON)-gdb.py
73
74 SRC_GDB_HOOKS=$(srcdir)/Tools/gdb/libpython.py
75-$(BUILDPYTHON)-gdb.py: $(SRC_GDB_HOOKS)
76- $(INSTALL_DATA) $(SRC_GDB_HOOKS) $(BUILDPYTHON)-gdb.py
77+$(PYTHON)-gdb.py: $(SRC_GDB_HOOKS)
78+ $(INSTALL_DATA) $(SRC_GDB_HOOKS) $(PYTHON)-gdb.py
79
80 # This rule is here for OPENSTEP/Rhapsody/MacOSX. It builds a temporary
81 # minimal framework (not including the Lib directory and such) in the current
82@@ -540,9 +543,9 @@
83
84 # Use a stamp file to prevent make -j invoking pgen twice
85 $(GRAMMAR_H) $(GRAMMAR_C): Parser/pgen.stamp
86-Parser/pgen.stamp: $(PGEN) $(GRAMMAR_INPUT)
87+Parser/pgen.stamp: $(BUILDPGEN) $(GRAMMAR_INPUT)
88 -@$(INSTALL) -d Include
89- $(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
90+ $(BUILDPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
91 -touch Parser/pgen.stamp
92
93 $(PGEN): $(PGENOBJS)
94@@ -801,7 +804,7 @@
95
96 # Install the interpreter with $(VERSION) affixed
97 # This goes into $(exec_prefix)
98-altbininstall: $(BUILDPYTHON)
99+altbininstall: $(BUILDPYTHON) $(PYTHON)
100 @for i in $(BINDIR) $(LIBDIR); \
101 do \
102 if test ! -d $(DESTDIR)$$i; then \
103@@ -810,7 +813,7 @@
104 else true; \
105 fi; \
106 done
107- $(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE)
108+ $(INSTALL_PROGRAM) $(PYTHON) $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE)
109 if test -f $(LDLIBRARY); then \
110 if test -n "$(DLLLIBRARY)" ; then \
111 $(INSTALL_SHARED) $(DLLLIBRARY) $(DESTDIR)$(BINDIR); \
112@@ -1048,7 +1051,7 @@
113
114 # Install the dynamically loadable modules
115 # This goes into $(exec_prefix)
116-sharedinstall: sharedmods
117+sharedinstall: $(BUILDPYTHON) sharedmods
118 $(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \
119 --prefix=$(prefix) \
120 --install-scripts=$(BINDIR) \
121@@ -1073,7 +1076,7 @@
122
123 frameworkinstallframework: frameworkinstallstructure install frameworkinstallmaclib
124
125-frameworkinstallstructure: $(LDLIBRARY)
126+frameworkinstallstructure: $(BUILDPYTHON) $(LDLIBRARY)
127 @if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
128 echo Not configured with --enable-framework; \
129 exit 1; \
130@@ -1120,7 +1123,7 @@
131 cd Mac && $(MAKE) installextras DESTDIR="$(DESTDIR)"
132
133 # This installs a few of the useful scripts in Tools/scripts
134-scriptsinstall:
135+scriptsinstall: $(BUILDPYTHON)
136 SRCDIR=$(srcdir) $(RUNSHARED) \
137 ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/setup.py install \
138 --prefix=$(prefix) \
139@@ -1136,14 +1139,14 @@
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 $(CC) -c $(PY_CFLAGS) -o $@ $<
149
150 # Run reindent on the library
151-reindent:
152+reindent: $(BUILDPYTHON)
153 ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/reindent.py -r $(srcdir)/Lib
154
155 # Rerun configure with the same options as it was run last time,
156@@ -1188,7 +1191,7 @@
157 find . -name '*.gc??' -exec rm -f {} ';'
158
159 clobber: clean profile-removal
160- -rm -f $(BUILDPYTHON) $(PGEN) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY) \
161+ -rm -f $(PYTHON) $(PGEN) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY) \
162 tags TAGS Parser/pgen.stamp \
163 config.cache config.log pyconfig.h Modules/config.c
164 -rm -rf build platform
165@@ -1246,7 +1249,7 @@
166 -o -print
167
168 # Perform some verification checks on any modified files.
169-patchcheck:
170+patchcheck: $(BUILDPYTHON)
171 $(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/patchcheck.py
172
173 # Dependencies
174Index: python2.7/Modules/Setup.dist
175===================================================================
176--- python2.7.orig/Modules/Setup.dist 2011-04-07 10:41:23.000000000 +0000
177+++ python2.7/Modules/Setup.dist 2011-04-07 10:41:23.000000000 +0000
178@@ -458,7 +458,9 @@
179 # Andrew Kuchling's zlib module.
180 # This require zlib 1.1.3 (or later).
181 # See http://www.gzip.org/zlib/
182-#zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
183+# Well behaved toolchains should not require -L$(exec_prefix)/lib or -I$(prefix)/include
184+# - using them breaks cross builds
185+#zlib zlibmodule.c -lz
186
187 # Interface to the Expat XML parser
188 #
189Index: python2.7/setup.py
190===================================================================
191--- python2.7.orig/setup.py 2011-04-07 10:41:23.000000000 +0000
192+++ python2.7/setup.py 2011-04-07 10:46:20.000000000 +0000
193@@ -225,6 +225,23 @@
194 # When you run "make CC=altcc" or something similar, you really want
195 # those environment variables passed into the setup.py phase. Here's
196 # a small set of useful ones.
197+
198+ # Change the environment for cross compiling
199+ # - may want to use environment variables for settings?
200+ if os.environ.get('CROSS_COMPILE'):
201+ host_gnu_type=os.environ.get('CROSS_COMPILE')
202+ os.environ["CC"] = host_gnu_type + '-gcc'
203+ os.environ["CXX"] = host_gnu_type + '-g++'
204+ os.environ["LDSHARED"] = host_gnu_type + '-gcc -shared'
205+ os.environ["CPP"] = host_gnu_type + '-cpp'
206+ # Add in the multiarch locations here.
207+ os.environ["LDFLAGS"] = '-L /usr/' + host_gnu_type + '/lib -L /usr/' + host_gnu_type + '/usr/lib'
208+ os.environ["CFLAGS"] = '-I/usr/' + host_gnu_type + '/include -I/usr/' + host_gnu_type + '/usr/include'
209+ # Use -D markers to detect if/where used
210+ os.environ["CPPFLAGS"] = '-DCROSSCPPFLAGS'
211+ os.environ["BASECFLAGS"] = '-DCROSSBASECFLAGS'
212+ os.environ["OPT"] = '-DCROSSOPT'
213+
214 compiler = os.environ.get('CC')
215 args = {}
216 # unfortunately, distutils doesn't let us provide separate C and C++
217@@ -304,6 +321,13 @@
218 self.announce('WARNING: skipping import check for Cygwin-based "%s"'
219 % ext.name)
220 return
221+
222+ # Cant import cross built modules
223+ if os.environ.get('CROSS_COMPILE'):
224+ self.announce('WARNING: skipping import check for %s, cross built for %s'
225+ % (ext.name, os.environ.get('CROSS_COMPILE')))
226+ return
227+
228 ext_filename = os.path.join(
229 self.build_lib,
230 self.get_ext_filename(self.get_ext_fullname(ext.name)))
231@@ -389,7 +413,8 @@
232 add_dir_to_list(dir_list, directory)
233
234 if os.path.normpath(sys.prefix) != '/usr' \
235- and not sysconfig.get_config_var('PYTHONFRAMEWORK'):
236+ and not sysconfig.get_config_var('PYTHONFRAMEWORK') \
237+ and not os.environ.get('CROSS_COMPILE'):
238 # OSX note: Don't add LIBDIR and INCLUDEDIR to building a framework
239 # (PYTHONFRAMEWORK is set) to avoid # linking problems when
240 # building a framework with different architectures than
241@@ -1846,6 +1871,11 @@
242 mkpath(ffi_builddir)
243 config_args = []
244
245+ if os.environ.get('CROSS_COMPILE'):
246+ host_gnu_type = os.environ.get('CROSS_COMPILE')
247+ print "Configuring _ctypes module for cross building %s" % (host_gnu_type)
248+ config_args = [ '--host ' + host_gnu_type]
249+
250 # Pass empty CFLAGS because we'll just append the resulting
251 # CFLAGS to Python's; -g or -O2 is to be avoided.
252 cmd = "cd %s && env CFLAGS='' '%s/configure' %s" \
0253
=== modified file 'debian/patches/series.in'
--- debian/patches/series.in 2011-02-24 06:01:42 +0000
+++ debian/patches/series.in 2011-04-07 14:02:15 +0000
@@ -50,3 +50,4 @@
50issue9054.diff50issue9054.diff
51link-system-expat.diff51link-system-expat.diff
52plat-gnukfreebsd.diff52plat-gnukfreebsd.diff
53cross.diff
5354
=== modified file 'debian/rules'
--- debian/rules 2011-02-24 06:01:42 +0000
+++ debian/rules 2011-04-07 14:02:15 +0000
@@ -11,6 +11,8 @@
1111
12DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)12DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
13DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)13DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
14DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
15DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
1416
15changelog_values := $(shell dpkg-parsechangelog \17changelog_values := $(shell dpkg-parsechangelog \
16 | awk '/^(Version|Source):/ {print $$2}')18 | awk '/^(Version|Source):/ {print $$2}')
@@ -26,6 +28,10 @@
26ifneq (,$(findstring nobench, $(DEB_BUILD_OPTIONS)))28ifneq (,$(findstring nobench, $(DEB_BUILD_OPTIONS)))
27 WITHOUT_BENCH := yes29 WITHOUT_BENCH := yes
28endif30endif
31ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
32 WITHOUT_BENCH := yes
33 WITHOUT_CHECK := yes
34endif
29ifeq ($(on_buildd),yes)35ifeq ($(on_buildd),yes)
30 ifneq (,$(findstring $(DEB_HOST_ARCH), hppa mips mipsel s390))36 ifneq (,$(findstring $(DEB_HOST_ARCH), hppa mips mipsel s390))
31 WITHOUT_CHECK := yes37 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
@@ -143,7 +162,9 @@
143else162else
144 make_build_target = profile-opt163 make_build_target = profile-opt
145endif164endif
146make_build_target = profile-opt165ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
166 make_build_target = profile-opt
167endif
147168
148build: $(build_target)169build: $(build_target)
149build-all: stamps/stamp-build170build-all: stamps/stamp-build
@@ -168,30 +189,30 @@
168189
169stamps/stamp-build-static: stamps/stamp-configure-static190stamps/stamp-build-static: stamps/stamp-configure-static
170 dh_testdir191 dh_testdir
171 $(MAKE) $(NJOBS) -C $(buildd_static) \192 $(MAKE) $(NJOBS) -C $(buildd_static) $(CROSS) \
172 PROFILE_TASK='$(PROFILE_TASK)' $(make_build_target)193 PROFILE_TASK='$(PROFILE_TASK)' $(make_build_target)
173 touch stamps/stamp-build-static194 touch stamps/stamp-build-static
174195
175stamps/stamp-build-shared: stamps/stamp-configure-shared196stamps/stamp-build-shared: stamps/stamp-configure-shared
176 dh_testdir197 dh_testdir
177 $(MAKE) $(NJOBS) -C $(buildd_shared)198 $(MAKE) $(NJOBS) -C $(buildd_shared) $(CROSS)
178# : # build the shared library199# : # build the shared library
179# $(MAKE) $(NJOBS) -C $(buildd_shared) \200# $(MAKE) $(NJOBS) -C $(buildd_shared) $(CROSS) \
180# libpython$(VER).so201# libpython$(VER).so
181 : # build a static library with PIC objects202 : # build a static library with PIC objects
182 $(MAKE) $(NJOBS) -C $(buildd_shared) \203 $(MAKE) $(NJOBS) -C $(buildd_shared) $(CROSS) \
183 LIBRARY=libpython$(VER)-pic.a libpython$(VER)-pic.a204 LIBRARY=libpython$(VER)-pic.a libpython$(VER)-pic.a
184 touch stamps/stamp-build-shared205 touch stamps/stamp-build-shared
185206
186stamps/stamp-build-debug: stamps/stamp-configure-debug207stamps/stamp-build-debug: stamps/stamp-configure-debug
187 dh_testdir208 dh_testdir
188 $(MAKE) $(NJOBS) -C $(buildd_debug)209 $(MAKE) $(NJOBS) -C $(buildd_debug) $(CROSS)
189 touch stamps/stamp-build-debug210 touch stamps/stamp-build-debug
190211
191stamps/stamp-build-shared-debug: stamps/stamp-configure-shared-debug212stamps/stamp-build-shared-debug: stamps/stamp-configure-shared-debug
192 dh_testdir213 dh_testdir
193 : # build the shared debug library214 : # build the shared debug library
194 $(MAKE) $(NJOBS) -C $(buildd_shdebug) \215 $(MAKE) $(NJOBS) -C $(buildd_shdebug) $(CROSS) \
195 libpython$(VER)_d.so216 libpython$(VER)_d.so
196 touch stamps/stamp-build-shared-debug217 touch stamps/stamp-build-shared-debug
197218
@@ -208,11 +229,52 @@
208 common_configure_args += --with-system-ffi229 common_configure_args += --with-system-ffi
209endif230endif
210231
232ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
233 common_configure_args += \
234 --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE)
235endif
236
211ifeq ($(with_fpectl),yes)237ifeq ($(with_fpectl),yes)
212 common_configure_args += \238 common_configure_args += \
213 --with-fpectl239 --with-fpectl
214endif240endif
215241
242ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
243
244stamps/stamp-configure-cross: stamps/stamp-patch
245 rm -rf $(buildd_cross)
246 mkdir -p $(buildd_cross)
247 cd $(buildd_cross) && \
248 CC=gcc CONFIG_SITE= $(OPTSETTINGS) \
249 ../configure --build $(DEB_BUILD_GNU_TYPE)
250 egrep \
251 "^#($$(awk '$$2 ~ /^extension$$/ {print $$1}' debian/PVER-minimal.README.Debian.in | tr '\012' '|')XX)" \
252 Modules/Setup.dist \
253 | sed -e 's/^#//' -e 's/-Wl,-Bdynamic//;s/-Wl,-Bstatic//' \
254 >> $(buildd_cross)/Modules/Setup.local
255 cd $(buildd_cross) && \
256 ../Modules/makesetup -c ../Modules/config.c.in -s Modules \
257 Modules/Setup.config Modules/Setup.local Modules/Setup
258 mv $(buildd_cross)/config.c $(buildd_cross)/Modules/
259
260 @echo "Each build should use it's own pyconfig.h & Makefile variables"
261 cp $(buildd_cross)/pyconfig.h $(buildd_cross)/pyconfig.h.cross
262 cp $(buildd_cross)/Makefile $(buildd_cross)/Makefile.cross
263
264 touch stamps/stamp-configure-cross
265
266stamps/stamp-build-cross: stamps/stamp-configure-cross
267 dh_testdir
268 $(MAKE) $(NJOBS) -C $(buildd_cross) python Parser/pgen
269 touch stamps/stamp-build-cross
270
271stamps/stamp-configure-shared: stamps/stamp-build-cross
272stamps/stamp-configure-static: stamps/stamp-build-cross
273stamps/stamp-configure-debug: stamps/stamp-build-cross
274stamps/stamp-configure-shared-debug: stamps/stamp-build-cross
275
276endif
277
216stamps/stamp-configure-shared: stamps/stamp-patch278stamps/stamp-configure-shared: stamps/stamp-patch
217 rm -rf $(buildd_shared)279 rm -rf $(buildd_shared)
218 mkdir -p $(buildd_shared)280 mkdir -p $(buildd_shared)
@@ -231,6 +293,12 @@
231 Modules/Setup.config Modules/Setup.local Modules/Setup293 Modules/Setup.config Modules/Setup.local Modules/Setup
232 mv $(buildd_shared)/config.c $(buildd_shared)/Modules/294 mv $(buildd_shared)/config.c $(buildd_shared)/Modules/
233295
296ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
297 @echo "Build python should use the new pyconfig.h & Makefile "
298 cp $(buildd_shared)/pyconfig.h $(buildd_cross)/pyconfig.h
299 cp $(buildd_shared)/Makefile $(buildd_cross)/Makefile
300endif
301
234 touch stamps/stamp-configure-shared302 touch stamps/stamp-configure-shared
235303
236stamps/stamp-configure-static: stamps/stamp-patch304stamps/stamp-configure-static: stamps/stamp-patch
@@ -255,6 +323,12 @@
255 mv -f $(buildd_static)/pyconfig.h.new $(buildd_static)/pyconfig.h323 mv -f $(buildd_static)/pyconfig.h.new $(buildd_static)/pyconfig.h
256 mv $(buildd_static)/config.c $(buildd_static)/Modules/324 mv $(buildd_static)/config.c $(buildd_static)/Modules/
257325
326ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
327 @echo "Build python should use the new pyconfig.h"
328 cp $(buildd_static)/pyconfig.h $(buildd_cross)/pyconfig.h
329 cp $(buildd_static)/Makefile $(buildd_cross)/Makefile
330endif
331
258 touch stamps/stamp-configure-static332 touch stamps/stamp-configure-static
259333
260stamps/stamp-configure-debug: stamps/stamp-patch334stamps/stamp-configure-debug: stamps/stamp-patch
@@ -280,6 +354,12 @@
280 touch -r $(buildd_debug)/pyconfig.h $(buildd_debug)/pyconfig.h.new354 touch -r $(buildd_debug)/pyconfig.h $(buildd_debug)/pyconfig.h.new
281 mv -f $(buildd_debug)/pyconfig.h.new $(buildd_debug)/pyconfig.h355 mv -f $(buildd_debug)/pyconfig.h.new $(buildd_debug)/pyconfig.h
282356
357ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
358 @echo "Build python should use the new pyconfig.h"
359 cp $(buildd_debug)/pyconfig.h $(buildd_cross)/pyconfig.h
360 cp $(buildd_debug)/Makefile $(buildd_cross)/Makefile
361endif
362
283 touch stamps/stamp-configure-debug363 touch stamps/stamp-configure-debug
284364
285stamps/stamp-configure-shared-debug: stamps/stamp-patch365stamps/stamp-configure-shared-debug: stamps/stamp-patch
@@ -307,9 +387,16 @@
307 touch -r $(buildd_shdebug)/pyconfig.h $(buildd_shdebug)/pyconfig.h.new387 touch -r $(buildd_shdebug)/pyconfig.h $(buildd_shdebug)/pyconfig.h.new
308 mv -f $(buildd_shdebug)/pyconfig.h.new $(buildd_shdebug)/pyconfig.h388 mv -f $(buildd_shdebug)/pyconfig.h.new $(buildd_shdebug)/pyconfig.h
309389
390ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
391 @echo "Build python should use the new pyconfig.h"
392 cp $(buildd_shdebug)/pyconfig.h $(buildd_cross)/pyconfig.h
393 cp $(buildd_shdebug)/Makefile $(buildd_cross)/Makefile
394endif
395
310 touch stamps/stamp-configure-shared-debug396 touch stamps/stamp-configure-shared-debug
311397
312stamps/stamp-mincheck: stamps/stamp-build-static debian/PVER-minimal.README.Debian.in398stamps/stamp-mincheck: stamps/stamp-build-static debian/PVER-minimal.README.Debian.in
399ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
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 \
314 echo "import $$m"; \401 echo "import $$m"; \
315 done > $(buildd_static)/minmods.py402 done > $(buildd_static)/minmods.py
@@ -323,6 +410,9 @@
323 else true; fi410 else true; fi
324 cd $(buildd_static) && ./python ../debian/mincheck.py \411 cd $(buildd_static) && ./python ../debian/mincheck.py \
325 minmods.py mindeps.txt412 minmods.py mindeps.txt
413else
414 @echo "No mincheck for cross build"
415endif
326 touch stamps/stamp-mincheck416 touch stamps/stamp-mincheck
327417
328TEST_RESOURCES = all418TEST_RESOURCES = all
@@ -419,6 +509,7 @@
419 touch stamps/stamp-check509 touch stamps/stamp-check
420510
421stamps/stamp-pystone:511stamps/stamp-pystone:
512ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
422 @echo "BEGIN pystone static"513 @echo "BEGIN pystone static"
423 cd $(buildd_static) && ./python ../Lib/test/pystone.py514 cd $(buildd_static) && ./python ../Lib/test/pystone.py
424 cd $(buildd_static) && ./python ../Lib/test/pystone.py515 cd $(buildd_static) && ./python ../Lib/test/pystone.py
@@ -433,6 +524,10 @@
433 cd $(buildd_debug) && ./python ../Lib/test/pystone.py524 cd $(buildd_debug) && ./python ../Lib/test/pystone.py
434 cd $(buildd_debug) && ./python ../Lib/test/pystone.py525 cd $(buildd_debug) && ./python ../Lib/test/pystone.py
435 @echo "END pystone debug"526 @echo "END pystone debug"
527else
528 @echo "No pystone for cross build"
529endif
530
436 touch stamps/stamp-pystone531 touch stamps/stamp-pystone
437532
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))
@@ -494,7 +589,7 @@
494589
495stamps/stamp-doc-html:590stamps/stamp-doc-html:
496 dh_testdir591 dh_testdir
497 $(MAKE) -C Doc html592 $(MAKE) -C Doc html $(CROSS)
498 touch stamps/stamp-doc-html593 touch stamps/stamp-doc-html
499594
500build-doc: stamps/stamp-patch stamps/stamp-build-doc595build-doc: stamps/stamp-patch stamps/stamp-build-doc
@@ -525,14 +620,17 @@
525clean: control-file620clean: control-file
526 dh_testdir621 dh_testdir
527 dh_testroot622 dh_testroot
528 $(MAKE) -f debian/rules unpatch623 $(MAKE) -f debian/rules unpatch $(CROSS)
529 rm -rf stamps .pc624 rm -rf stamps .pc
530 rm -f debian/test_results625 rm -f debian/test_results
531626
532 $(MAKE) -C Doc clean627 $(MAKE) -C Doc clean $(CROSS)
533 sed 's/^@/#/' Makefile.pre.in | $(MAKE) -f - srcdir=. distclean628 sed 's/^@/#/' Makefile.pre.in | $(MAKE) -f - srcdir=. distclean $(CROSS)
534 rm -rf Lib/test/db_home629 rm -rf Lib/test/db_home
535 rm -rf $(buildd_static) $(buildd_shared) $(buildd_debug) $(buildd_shdebug)630 rm -rf $(buildd_static) $(buildd_shared) $(buildd_debug) $(buildd_shdebug)
631ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
632 rm -rf $(buildd_cross)
633endif
536 find -name '*.py[co]' | xargs -r rm -f634 find -name '*.py[co]' | xargs -r rm -f
537 rm -f Lib/lib2to3/*.pickle635 rm -f Lib/lib2to3/*.pickle
538 rm -rf locales636 rm -rf locales
@@ -575,9 +673,19 @@
575 : # their packages' directories.673 : # their packages' directories.
576 install -d $(d)/usr674 install -d $(d)/usr
577ifeq ($(with_interp),static)675ifeq ($(with_interp),static)
578 $(MAKE) -C $(buildd_static) install prefix=$(CURDIR)/$(d)/usr676 ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
677 @echo "Build python should use the new pyconfig.h"
678 cp $(buildd_static)/pyconfig.h $(buildd_cross)/pyconfig.h
679 cp $(buildd_static)/Makefile $(buildd_cross)/Makefile
680 endif
681 $(MAKE) -C $(buildd_static) install prefix=$(CURDIR)/$(d)/usr $(CROSS)
579else682else
580 $(MAKE) -C $(buildd_shared) install prefix=$(CURDIR)/$(d)/usr683 ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
684 @echo "Build python should use the new pyconfig.h"
685 cp $(buildd_static)/pyconfig.h $(buildd_cross)/pyconfig.h
686 cp $(buildd_static)/Makefile $(buildd_cross)/Makefile
687 endif
688 $(MAKE) -C $(buildd_shared) install prefix=$(CURDIR)/$(d)/usr $(CROSS)
581endif689endif
582 -find $(d)/usr/lib/python$(VER) -name '*_failed*.so'690 -find $(d)/usr/lib/python$(VER) -name '*_failed*.so'
583 find $(d)/usr/lib/python$(VER) -name '*_failed*.so' | xargs -r rm -f691 find $(d)/usr/lib/python$(VER) -name '*_failed*.so' | xargs -r rm -f
@@ -815,8 +923,13 @@
815923
816 : # generate binfmt file924 : # generate binfmt file
817 mkdir -p $(d_min)/usr/share/binfmts925 mkdir -p $(d_min)/usr/share/binfmts
926ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
818 $(buildd_static)/python debian/mkbinfmt.py $(PVER) \927 $(buildd_static)/python debian/mkbinfmt.py $(PVER) \
819 > $(d_min)/usr/share/binfmts/$(PVER)928 > $(d_min)/usr/share/binfmts/$(PVER)
929else
930 $(buildd_cross)/python debian/mkbinfmt.py $(PVER) \
931 > $(d_min)/usr/share/binfmts/$(PVER)
932endif
820933
821 : # desktop entry934 : # desktop entry
822 mkdir -p $(d_base)/usr/share/applications935 mkdir -p $(d_base)/usr/share/applications
@@ -832,7 +945,7 @@
832945
833 : # install debug package946 : # install debug package
834 rm -rf $(d)-dbg947 rm -rf $(d)-dbg
835 $(MAKE) -C $(buildd_debug) install DESTDIR=$(CURDIR)/$(d)-dbg948 $(MAKE) -C $(buildd_debug) install DESTDIR=$(CURDIR)/$(d)-dbg $(CROSS)
836 dh_installdirs -p$(p_dbg) \949 dh_installdirs -p$(p_dbg) \
837 usr/bin \950 usr/bin \
838 usr/share/man/man1 \951 usr/share/man/man1 \

Subscribers

People subscribed via source and target branches

to all changes: