~ubuntu-branches/ubuntu/trusty/gcc-snapshot/trusty

« back to all changes in this revision

Viewing changes to debian/rules.patch.mine

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2013-02-09 20:44:40 UTC
  • mfrom: (1.20.10) (135.1.26 sid)
  • Revision ID: package-import@ubuntu.com-20130209204440-i8tkaamsgn3vxl28
Tags: 20130209-1ubuntu1
Snapshot, taken from the trunk (20130209)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# -*- makefile -*-
2
 
# rules to patch the unpacked files in the source directory
3
 
# ---------------------------------------------------------------------------
4
 
# various rules to unpack addons and (un)apply patches.
5
 
#       - patch / apply-patches
6
 
#       - unpatch / reverse-patches
7
 
 
8
 
.NOTPARALLEL:
9
 
 
10
 
patchdir        ?= debian/patches
11
 
series_file     ?= $(patchdir)/series
12
 
 
13
 
# which patches should be applied?
14
 
 
15
 
debian_patches = \
16
 
 
17
 
#       $(if $(with_linaro_branch),gcc-linaro) \
18
 
#       svn-updates$(if $(with_linaro_branch),-linaro) \
19
 
 
20
 
ifeq ($(with_java),yes)
21
 
#  debian_patches += \
22
 
#       svn-class-updates
23
 
endif
24
 
 
25
 
ifneq ($(GFDL_INVARIANT_FREE),yes)
26
 
  debian_patches += \
27
 
        rename-info-files \
28
 
 
29
 
#       $(if $(with_linaro_branch),gcc-linaro-doc) \
30
 
#       $(if $(with_linaro_branch),,svn-doc-updates) \
31
 
 
32
 
else
33
 
endif
34
 
debian_patches += \
35
 
        gcc-gfdl-build
36
 
 
37
 
#       boehm-gc-nocheck: seems to work on the buildds \
38
 
 
39
 
debian_patches += \
40
 
        gcc-textdomain \
41
 
        gcc-driver-extra-langs
42
 
 
43
 
debian_patches += \
44
 
        libstdc++-pic \
45
 
        libstdc++-doclink \
46
 
        libstdc++-man-3cxx \
47
 
        libstdc++-test-installed \
48
 
        libjava-stacktrace \
49
 
        libjava-jnipath \
50
 
        libjava-sjlj \
51
 
        libjava-disable-plugin \
52
 
        alpha-no-ev4-directive \
53
 
        boehm-gc-getnprocs \
54
 
        note-gnu-stack \
55
 
        libgomp-omp_h-multilib \
56
 
        sparc-force-cpu \
57
 
        pr24619 \
58
 
        gccgo-version \
59
 
        pr45078 \
60
 
        pr47818 \
61
 
        pr49940 \
62
 
        pr49944 \
63
 
        gcc-base-version \
64
 
        mudflapth-link \
65
 
        libmudflap-x32 \
66
 
        libgo-testsuite \
67
 
        gcc-target-include-asm \
68
 
        marvell-pj4-core \
69
 
 
70
 
#       $(if $(filter yes, $(DEB_CROSS)),,gcc-print-file-name) \
71
 
#       libstdc++-nothumb-check \
72
 
# TODO: update ...
73
 
#       gcc-cloog-dl \
74
 
#       libjava-rpath \
75
 
 
76
 
hardening_patches =
77
 
ifneq ($(distribution),Debian)
78
 
  ifneq (,$(findstring gcc-4, $(PKGSOURCE)))
79
 
    # FIXME: bootstrap failure building the target libstdc++ library
80
 
    #hardening_patches += gcc-default-format-security
81
 
    hardening_patches += \
82
 
        gcc-default-fortify-source \
83
 
        gcc-default-relro \
84
 
        testsuite-hardening-format \
85
 
        testsuite-hardening-printf-types
86
 
  endif
87
 
endif
88
 
ifeq ($(with_ssp)-$(with_ssp_default),yes-yes)
89
 
  hardening_patches += gcc-default-ssp
90
 
endif
91
 
 
92
 
# FIXME 4.5: Drop and adjust symbols files
93
 
ifneq (,$(findstring 4.4, $(PKGSOURCE)))
94
 
  debian_patches += pr39491
95
 
endif
96
 
 
97
 
ifeq ($(with_ada),yes)
98
 
  debian_patches += \
99
 
        ada-driver-check \
100
 
        ada-gcc-name \
101
 
        ada-default-project-path \
102
 
        ada-symbolic-tracebacks \
103
 
        ada-library-project-files-soname
104
 
 
105
 
  ifeq ($(biarch64),yes)
106
 
    debian_patches += \
107
 
        ada-nobiarch-check
108
 
  endif
109
 
 
110
 
  ifeq ($(with_libgnat),yes)
111
 
    debian_patches += \
112
 
        ada-link-lib \
113
 
        ada-libgnatvsn \
114
 
        ada-libgnatprj \
115
 
        ada-acats
116
 
    ifeq ($(with_gnat_zcx)-$(with_gnat_sjlj),yes-yes)
117
 
      debian_patches += \
118
 
        ada-sjlj
119
 
    endif
120
 
  endif
121
 
 
122
 
  ifneq (,$(findstring $(DEB_TARGET_ARCH_OS),kfreebsd hurd))
123
 
    debian_patches += ada-kfreebsd-gnu \
124
 
        ada-bug564232
125
 
  endif
126
 
 
127
 
  ifeq ($(DEB_TARGET_ARCH_OS),hurd)
128
 
    debian_patches += \
129
 
        gcc_ada_gcc-interface_Makefile.in \
130
 
        ada-s-osinte-gnu.adb \
131
 
        ada-s-osinte-gnu.ads \
132
 
        ada-s-taprop-gnu.adb
133
 
  endif
134
 
 
135
 
endif
136
 
 
137
 
ifeq (0,1)
138
 
ifeq ($(with_d),yes)
139
 
  debian_patches += \
140
 
       gdc-4.6 \
141
 
       gdc-libphobos-math \
142
 
       gdc-driver-zlib
143
 
 
144
 
  ifeq ($(with_libphobos),yes)
145
 
    debian_patches += gdc-libphobos-build
146
 
  else
147
 
    debian_patches += gdc-driver-nophobos
148
 
  endif
149
 
 
150
 
else
151
 
  debian_patches += gcc-d-lang
152
 
endif
153
 
endif # D
154
 
 
155
 
ifeq ($(DEB_TARGET_ARCH),alpha)
156
 
  debian_patches += alpha-ieee mudflap-nocheck
157
 
  ifneq ($(GFDL_INVARIANT_FREE),yes)
158
 
    debian_patches += alpha-ieee-doc
159
 
  endif
160
 
endif
161
 
 
162
 
ifneq (,$(findstring $(DEB_TARGET_ARCH),arm armel armhf))
163
 
  debian_patches += libjava-armel-unwind
164
 
endif
165
 
 
166
 
ifeq ($(DEB_TARGET_ARCH),m68k)
167
 
  debian_patches +=
168
 
endif
169
 
 
170
 
ifeq ($(DEB_TARGET_ARCH),powerpcspe)
171
 
  debian_patches += powerpc_remove_many
172
 
  debian_patches += powerpc_nofprs
173
 
endif
174
 
 
175
 
ifeq ($(DEB_TARGET_ARCH),ppc64)
176
 
  ifeq ($(distribution),Ubuntu)
177
 
    #debian_patches += ibm-branch
178
 
  endif
179
 
endif
180
 
 
181
 
spu_patches = cross-install-location
182
 
 
183
 
#debian_patches += link-libs
184
 
 
185
 
# all patches below this line are applied for gcc-snapshot builds as well
186
 
 
187
 
ifeq ($(single_package),yes)
188
 
  spu_patches =
189
 
  debian_patches =
190
 
endif
191
 
 
192
 
debian_patches += gcc-sysroot
193
 
debian_patches += \
194
 
        ada-kfreebsd \
195
 
 
196
 
ifeq ($(with_softfloat),yes)
197
 
  debian_patches += arm-multilib-soft-float
198
 
else ifeq ($(multilib),yes)
199
 
  ifneq (,$(filter $(distrelease),lucid maverick natty oneiric precise))
200
 
    debian_patches += arm-multilib-softfp
201
 
  else
202
 
    debian_patches += arm-multilib-soft
203
 
  endif
204
 
endif
205
 
debian_patches += arm-multilib-defaults
206
 
 
207
 
ifeq ($(DEB_CROSS),yes)
208
 
  debian_patches += cross-fixes
209
 
  ifeq ($(with_deps_on_target_arch_pkgs),yes)
210
 
    debian_patches += cross-ma-install-location
211
 
  else
212
 
    debian_patches += cross-install-location
213
 
    spu_patches := $(filter-out cross-install-location,$(spu_patches))
214
 
  endif
215
 
endif
216
 
 
217
 
ifeq ($(DEB_TARGET_ARCH_OS),hurd)
218
 
  debian_patches += hurd-changes
219
 
endif
220
 
 
221
 
debian_patches += gcc-ice-hack gcc-ice-apport
222
 
#FIXME
223
 
#debian_patches += gold-and-ld
224
 
 
225
 
debian_patches += libjava-fixed-symlinks
226
 
debian_patches += libstdc++-arm-wno-abi
227
 
 
228
 
ifneq (,$(filter $(DEB_TARGET_ARCH), mips mipsel))
229
 
  # timeouts on the buildd's, Debian
230
 
  debian_patches += libstdc++-no-testsuite
231
 
else ifeq ($(distribution)-$(DEB_TARGET_ARCH),Ubuntu-armel)
232
 
  # timeouts on the buildd's, Ubuntu only
233
 
  debian_patches += libstdc++-no-testsuite
234
 
endif
235
 
debian_patches += ada-mips
236
 
debian_patches += libffi-ro-eh_frame_sect
237
 
 
238
 
debian_patches += gcc-multiarch
239
 
ifeq ($(with_multiarch_lib),yes)
240
 
  ifneq ($(single_package),yes)
241
 
    debian_patches += libjava-multiarch
242
 
  endif
243
 
endif
244
 
debian_patches += libjava-nobiarch-check
245
 
debian_patches += config-ml
246
 
ifneq ($(single_package),yes)
247
 
  ifeq ($(with_multiarch_cxxheaders),yes)
248
 
    debian_patches += g++-multiarch-incdir
249
 
  endif
250
 
endif
251
 
ifeq ($(DEB_CROSS),yes)
252
 
  debian_patches += cross-no-locale-include
253
 
endif
254
 
ifeq ($(biarch64),yes)
255
 
  ifeq ($(DEB_CROSS),yes)
256
 
    debian_patches += cross-biarch
257
 
  endif
258
 
endif
259
 
debian_patches += gcc-multilib-multiarch
260
 
 
261
 
ifeq ($(distribution),Ubuntu)
262
 
  ifneq (,$(filter $(distrelease),dapper hardy intrepid jaunty karmic lucid))
263
 
    debian_patches += gcc-hash-style-both
264
 
  else
265
 
    debian_patches += gcc-hash-style-gnu
266
 
  endif
267
 
else
268
 
  debian_patches += gcc-hash-style-both
269
 
endif
270
 
 
271
 
ifeq (,$(filter $(distrelease),lenny squeeze wheezy sid experimental dapper hardy intrepid jaunty karmic lucid maverick))
272
 
  debian_patches += gcc-as-needed
273
 
endif
274
 
debian_patches += mips-fix-loongson2f-nop
275
 
ifeq ($(distribution),Ubuntu)
276
 
  ifeq ($(DEB_TARGET_ARCH),ppc64)
277
 
    debian_patches += gcc-ppc64-O3
278
 
  endif
279
 
endif
280
 
debian_patches += libgomp-kfreebsd-testsuite
281
 
 
282
 
 
283
 
series_stamp = $(stampdir)/02-series-stamp
284
 
series: $(series_stamp)
285
 
$(series_stamp):
286
 
        echo $(strip $(addsuffix .diff,$(debian_patches))) \
287
 
          | sed -r 's/  +/ /g' | tr " " "\n" > $(series_file)
288
 
ifneq (,$(strip $(hardening_patches)))
289
 
  ifneq ($(trunk_build),yes)
290
 
        echo $(strip $(addsuffix .diff,$(hardening_patches))) \
291
 
          | sed -r 's/  +/ /g' | tr " " "\n" >> $(series_file)
292
 
  endif
293
 
endif
294
 
        sed -r 's/(.)$$/\1 -p1/' -i $(series_file)
295
 
        touch $@
296
 
 
297
 
autotools_files := $(addprefix ./,$(foreach file,$(shell lsdiff --no-filename \
298
 
        $(foreach patch,$(debian_patches),$(patchdir)/$(patch).diff) \
299
 
        | sed -r 's/[ab]\/src\//src\//' | sort | uniq),$(shell echo $(file) \
300
 
        | egrep 'configure\.(ac|in)|Makefile\.(am|in)|acinclude.m4')))
301
 
 
302
 
autoconf_version = 2.64
303
 
ifeq ($(trunk_build),yes)
304
 
  # The actual version depends on the build-dependencies set by
305
 
  # variable AUTO_BUILD_DEP in rules.conf.  Here, we assume the
306
 
  # correct version is installed.
307
 
  #autoconf_version =
308
 
endif
309
 
 
310
 
# FIXME: the auto* stuff is done every time for every subdir, which
311
 
# leads to build errors. Idea: record the auto* calls in the patch
312
 
# files (AUTO <dir> <auto-command with options>) and run them separately,
313
 
# maybe only once per directory).
314
 
$(patch_stamp): $(unpack_stamp) $(series_stamp)
315
 
        QUILT_PATCHES=$(patchdir) \
316
 
          quilt --quiltrc /dev/null push -a || test $$? = 2
317
 
 
318
 
ifneq (,$(filter svn-updates, $(debian_patches)))
319
 
        awk '/^EOF/ {exit} p==1 {print} /EOF$$/ {p=1}' \
320
 
          $(patchdir)/svn-updates.diff > src/LAST_UPDATED
321
 
endif
322
 
 
323
 
        if ! test -f stamps/autotools_files ; then touch stamps/autotools_files ; fi
324
 
 
325
 
        cd $(srcdir)/fixincludes && ./genfixes
326
 
 
327
 
        for f in $(autotools_files) ; \
328
 
          do case $$f in \
329
 
            */classpath/m4/acinclude.m4) \
330
 
                : ;; \
331
 
            */configure.*|*/acinclude.m4) \
332
 
                if grep ^"$$(md5sum $$f)"$$ stamps/autotools_files >/dev/null ; \
333
 
                  then echo "Skipping already regenerated file $$f." ; \
334
 
                else \
335
 
                  echo "Running autoconf$(autoconf_version) in $$(dirname $$f)..." ; \
336
 
                  dir="$(CURDIR)"; cd $(CURDIR)/$$(dirname $$f) \
337
 
                    && AUTOM4TE=/usr/bin/autom4te$(autoconf_version) autoconf$(autoconf_version) \
338
 
                    && cd $$dir \
339
 
                    && echo "$$(md5sum $$f)" >> stamps/autotools_files ; \
340
 
                fi ;; \
341
 
            */Makefile.*) ;; \
342
 
            *) echo "Unknown file: $$f"; false; \
343
 
          esac; \
344
 
        done
345
 
 
346
 
        for i in $(debian_patches); do \
347
 
          echo -e "\n$$i:" >> pxxx; \
348
 
          sed -n 's/^# *DP: */  /p' $(patchdir)/$$i.diff >> pxxx; \
349
 
        done
350
 
#       -$(srcdir)/move-if-change pxxx $@
351
 
        mv pxxx $@
352
 
 
353
 
unpatch:
354
 
        QUILT_PATCHES=$(patchdir) \
355
 
          quilt --quiltrc /dev/null pop -a -R || test $$? = 2
356
 
        rm -rf .pc
357
 
        for f in $(autotools_files); do \
358
 
          rm -f $$(echo $$f | sed -r 's/\.(ac|am|in)$$//'); \
359
 
        done
360
 
 
361
 
$(src_spu_stamp): $(patch_stamp)
362
 
        rm -rf src-spu
363
 
ifeq (,$(strip $(hardening_patches)$(spu_patches)))
364
 
        ln -s src src-spu
365
 
else
366
 
        cp -a src src-spu
367
 
endif
368
 
        set -e; \
369
 
        for p in $(hardening_patches); do \
370
 
          list="$$p $$list"; \
371
 
        done; \
372
 
        for p in $$list; do \
373
 
          echo "Revert for spu build: $$p"; \
374
 
          patch -d src-spu -p2 -R < debian/patches/$$p.diff; \
375
 
        done
376
 
        set -e; \
377
 
        for p in $(spu_patches); do \
378
 
          echo "Apply for spu build: $$p"; \
379
 
          patch -d src-spu -p2 < debian/patches/$$p.diff; \
380
 
        done
381
 
        touch $@
382
 
 
383
 
update-patches: $(series_stamp)
384
 
        export QUILT_PATCHES=$(patchdir); \
385
 
        export QUILT_REFRESH_ARGS="--no-timestamps --no-index -pab"; \
386
 
        export QUILT_DIFF_ARGS="--no-timestamps --no-index -pab"; \
387
 
        while quilt push; do quilt refresh; done
388
 
 
389
 
patch: $(patch_stamp)
390
 
.PHONY: patch series quilt autotools