~ubuntu-branches/debian/sid/gcc-4.8/sid

« back to all changes in this revision

Viewing changes to .svn/pristine/31/3129ff097db9f3d641781b10560a7789cc369c07.svn-base

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2014-12-19 19:48:34 UTC
  • Revision ID: package-import@ubuntu.com-20141219194834-4dz1q7rrn5pad823
Tags: 4.8.4-1
* GCC 4.8.4 release.
  - Fix PR target/61407 (darwin), PR middle-end/58624 (ice),
    PR sanitizer/64265 (wrong code).
* Require recent binutils to pass go test failures.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- makefile -*-
 
2
# rules.conf
 
3
#       - used to build debian/control and debian/rules.parameters
 
4
#       - assumes unpacked sources
 
5
 
 
6
include debian/rules.defs
 
7
include debian/rules.sonames
 
8
 
 
9
# manual ...
 
10
ifeq ($(DEB_TARGET_GNU_CPU), $(findstring $(DEB_TARGET_GNU_CPU),hppa m68k))
 
11
  ifeq ($(DEB_TARGET_ARCH),m68k)
 
12
    GCC_SONAME := 2
 
13
  endif
 
14
  ifeq ($(DEB_TARGET_ARCH),hppa)
 
15
    GCC_SONAME := 4
 
16
  endif
 
17
  DEB_LIBGCC_SOVERSION := $(DEB_SOVERSION)
 
18
  DEB_LIBGCC_VERSION := $(DEB_VERSION)
 
19
else
 
20
  GCC_SONAME := 1
 
21
  DEB_LIBGCC_SOVERSION := $(DEB_SOEVERSION)
 
22
  DEB_LIBGCC_VERSION := $(DEB_EVERSION)
 
23
endif
 
24
 
 
25
_soname_map = gcc=$(GCC_SONAME) stdc++=$(CXX_SONAME) gomp=$(GOMP_SONAME) \
 
26
        ssp=$(SSP_SONAME) gfortran=$(FORTRAN_SONAME) \
 
27
        itm=$(ITM_SONAME) objc=$(OBJC_SONAME) quadmath=$(QUADMATH_SONAME) \
 
28
        go=$(GO_SONAME) backtrace=$(BTRACE_SONAME) \
 
29
        atomic=$(ATOMIC_SONAME) asan=$(ASAN_SONAME) tsan=$(TSAN_SONAME)
 
30
_soname = $(patsubst $(1)=%,%,$(filter $(1)=%,$(_soname_map)))
 
31
 
 
32
# $(call _lib_name,<name>,<biarch>,<ext>)
 
33
_lib_name = $(subst $(SPACE),, \
 
34
  lib$(2)$(1) \
 
35
  $(if $(filter dev,$(3)),,$(call _soname,$(1))) \
 
36
  $(if $(or $(filter $(3),dev),$(and $(filter $(3),dbg),$(filter $(1),stdc++))),-$(BASE_VERSION)) \
 
37
  $(if $(3),-$(3))$(LS)$(AQ))
 
38
# $(call _lib_vers,<ext>,<vers>) 
 
39
_lib_vers = ($(if $(filter $(1),dev),=,>=) $(2))
 
40
 
 
41
# Helper to generate biarch/triarch dependencies.
 
42
# For example, $(eval $(call gen_multilib_deps,gomp)) will create the
 
43
# libgompbiarch variable, and make it contains the libgompbiarch{32,64,n32}
 
44
# variables if biarch{32,64,n32} is set to yes.
 
45
 
 
46
define gen_multilib_deps
 
47
  lib$1biarch64$2  := $(call _lib_name,$(1),64,$(2)) $(call _lib_vers,$(2),$(3))
 
48
  lib$1biarch32$2  := $(call _lib_name,$(1),32,$(2)) $(call _lib_vers,$(2),$(3))
 
49
  lib$1biarchn32$2 := $(call _lib_name,$(1),n32,$(2)) $(call _lib_vers,$(2),$(3))
 
50
  lib$1biarchx32$2 := $(call _lib_name,$(1),x32,$(2)) $(call _lib_vers,$(2),$(3))
 
51
  lib$1biarchhf$2  := $(call _lib_name,$(1),hf,$(2)) $(call _lib_vers,$(2),$(3))
 
52
  lib$1biarchsf$2  := $(call _lib_name,$(1),sf,$(2)) $(call _lib_vers,$(2),$(3))
 
53
  ifeq ($$(biarch64),yes)
 
54
    lib$1biarch$2 := $$(lib$1biarch64$2)
 
55
  endif
 
56
  ifeq ($$(biarch32),yes)
 
57
    ifeq ($$(biarch64),yes)
 
58
      lib$1biarch$2 := $$(lib$1biarch64$2), $$(lib$1biarch32$2)
 
59
    else
 
60
      lib$1biarch$2 := $$(lib$1biarch32$2)
 
61
    endif
 
62
  endif
 
63
  ifeq ($$(biarchx32),yes)
 
64
    ifeq ($$(biarch64),yes)
 
65
      lib$1biarch$2 := $$(lib$1biarch64$2), $$(lib$1biarchx32$2)
 
66
    else ifeq ($$(biarch32),yes)
 
67
      lib$1biarch$2 := $$(lib$1biarch32$2), $$(lib$1biarchx32$2)
 
68
    else
 
69
      lib$1biarch$2 := $$(lib$1biarchx32$2)
 
70
    endif
 
71
  endif
 
72
  ifeq ($$(biarchn32),yes)
 
73
    ifeq ($$(biarch64),yes)
 
74
      lib$1biarch$2 := $$(lib$1biarch64$2), $$(lib$1biarchn32$2)
 
75
    else ifeq ($$(biarch32),yes)
 
76
      lib$1biarch$2 := $$(lib$1biarch32$2), $$(lib$1biarchn32$2)
 
77
    else
 
78
      lib$1biarch$2 := $$(lib$1biarchn32$2)
 
79
    endif
 
80
  endif
 
81
  ifeq ($$(biarchhf),yes)
 
82
    lib$1biarch$2 := $$(lib$1biarchhf$2) | $(call _lib_name,$(1),hf,$(2))
 
83
  endif
 
84
  ifeq ($$(biarchsf),yes)
 
85
    lib$1biarch$2 := $$(lib$1biarchsf$2) | $(call _lib_name,$(1),sf,$(2))
 
86
  endif
 
87
endef
 
88
ifeq ($(with_shared_libgcc),yes)
 
89
  LIBGCC_DEP := libgcc$(GCC_SONAME)$(LS)$(AQ) (>= $(DEB_LIBGCC_VERSION))
 
90
  $(eval $(call gen_multilib_deps,gcc,,$(DEB_LIBGCC_VERSION)))
 
91
endif
 
92
LIBGCC_DEV_DEP := libgcc-$(BASE_VERSION)-dev$(LS)$(AQ) (>= $(DEB_VERSION))
 
93
$(foreach x,stdc++ gomp ssp gfortran itm objc atomic asan quadmath go, \
 
94
        $(eval $(call gen_multilib_deps,$(x),,$$$${gcc:Version})))
 
95
$(foreach x,gcc stdc++ gfortran objc go, \
 
96
        $(eval $(call gen_multilib_deps,$(x),dev,$$$${gcc:Version})))
 
97
$(foreach x,gcc stdc++ gfortran objc go, \
 
98
        $(eval $(call gen_multilib_deps,$(x),dbg,$$$${gcc:Version})))
 
99
 
 
100
# Helper to generate _no_archs variables.
 
101
# For example, $(eval $(call gen_no_archs,java)) will create the java_no_archs
 
102
# variable, using the java_no_cpu and java_no_systems variables.
 
103
define gen_no_archs
 
104
  $1_no_archs :=
 
105
  ifneq (,$$($1_no_cpus))
 
106
    $1_no_archs += $$(foreach cpu,$$(filter-out i386 amd64 alpha arm,$$($1_no_cpus)),!$$(cpu))
 
107
    ifneq (,$$(filter i386,$$($1_no_cpus)))
 
108
      $1_no_archs += !i386 !hurd-i386 !kfreebsd-i386
 
109
    endif
 
110
    ifneq (,$$(filter amd64,$$($1_no_cpus)))
 
111
      $1_no_archs += !amd64 !kfreebsd-amd64
 
112
    endif
 
113
    ifneq (,$$(filter alpha,$$($1_no_cpus)))
 
114
      $1_no_archs += !alpha !hurd-alpha
 
115
    endif
 
116
    ifneq (,$$(filter arm,$$($1_no_cpus)))
 
117
      $1_no_archs += !arm !armel !armhf
 
118
    endif
 
119
    ifneq (,$$(strip $3))
 
120
      $1_no_systems_tmp := $$(subst $$(SPACE)gnu$$(SPACE),$$(SPACE)hurd-gnu$$(SPACE),$$(SPACE)$3$$(SPACE))
 
121
      $1_no_archs += $$(foreach cpu,$$($1_no_cpus),$$(foreach system,$$($1_no_systems_tmp),!$$(subst gnu,$$(cpu),$$(system))))
 
122
    endif
 
123
  endif
 
124
  ifneq (,$$($1_no_systems))
 
125
    $1_no_systems_tmp := $$(subst $$(SPACE)gnu$$(SPACE),$$(SPACE)hurd-gnu$$(SPACE),$$(SPACE)$$($1_no_systems)$$(SPACE))
 
126
    $1_no_archs += $$(foreach system,$$($1_no_systems_tmp),$$(foreach cpu,$2,!$$(subst gnu,$$(cpu),$$(system))))
 
127
  endif
 
128
  $1_no_archs := $$(strip $$($1_no_archs))
 
129
endef
 
130
base_deb_cpus := amd64 i386 alpha
 
131
base_deb_systems :=
 
132
$(foreach x,ada java java_plugin fortran libphobos libgc check locale,$(eval $(call gen_no_archs,$(x),$(base_deb_cpus),$(base_deb_systems))))
 
133
linux_no_archs := !hurd-any !kfreebsd-any
 
134
 
 
135
GCC_VERSION := $(strip $(shell cat $(firstword $(wildcard $(srcdir)/gcc/FULL-VER $(srcdir)/gcc/BASE-VER))))
 
136
NEXT_GCC_VERSION := $(shell echo $(GCC_VERSION) | \
 
137
        awk -F. '{OFS="."; if (NF==2) $$3=1; else $$NF += 1; print}')
 
138
GCC_MAJOR_VERSION := $(shell echo $(GCC_VERSION)   | sed -r 's/([0-9])\.[0-9]\.[0-9]/\1/')
 
139
GCC_MINOR_VERSION := $(shell echo $(GCC_VERSION)   | sed -r 's/[0-9]\.([0-9])\.[0-9]/\1/')
 
140
GCC_RELEASE_VERSION := $(shell echo $(GCC_VERSION) | sed -r 's/[0-9]\.[0-9]\.([0-9])/\1/')
 
141
NEXT_GCC_MAJOR_VERSION := $(shell expr $(echo $(GCC_MAJOR_VERSION)) + 1)
 
142
NEXT_GCC_MINOR_VERSION := $(shell expr $(echo $(GCC_MINOR_VERSION)) + 1)
 
143
NEXT_GCC_RELEASE_VERSION := $(shell expr $(echo $(GCC_MAJOR_VERSION)) + 1)
 
144
 
 
145
ifeq ($(single_package),yes)
 
146
  BASE_VERSION := $(shell echo $(GCC_VERSION) | sed -e 's/\([1-9]\.[0-9]\).*/\1/')
 
147
endif
 
148
 
 
149
GCC_SOURCE_VERSION := $(shell echo $(DEB_VERSION) | sed 's/-.*//')
 
150
NEXT_GCC_SOURCE_VERSION := $(shell echo $(GCC_SOURCE_VERSION) | \
 
151
        awk -F. '{OFS="."; if (NF==2) $$3=1; else $$NF += 1; print}')
 
152
 
 
153
MAINTAINER = Debian GCC Maintainers <debian-gcc@lists.debian.org>
 
154
ifeq ($(distribution),Ubuntu)
 
155
  ifneq (,$(findstring $(PKGSOURCE),gnat gdc))
 
156
    MAINTAINER = Ubuntu MOTU Developers <ubuntu-motu@lists.ubuntu.com>
 
157
  else
 
158
    MAINTAINER = Ubuntu Core developers <ubuntu-devel-discuss@lists.ubuntu.com>
 
159
  endif
 
160
endif
 
161
 
 
162
UPLOADERS = Matthias Klose <doko@debian.org>
 
163
ifneq (,$(findstring $(PKGSOURCE),gnat))
 
164
  UPLOADERS = Ludovic Brenta <lbrenta@debian.org>
 
165
endif
 
166
ifneq (,$(findstring $(PKGSOURCE),gdc))
 
167
  UPLOADERS = Iain Buclaw <ibuclaw@ubuntu.com>, Matthias Klose <doko@debian.org>
 
168
endif
 
169
 
 
170
DPKGV = 1.14.15
 
171
ifeq ($(with_multiarch_lib),yes)
 
172
  DPKGV = 1.16.0~ubuntu4
 
173
endif
 
174
ifeq ($(multiarch_stage1),yes)
 
175
  DPKGV = 1.16.0~ubuntu4
 
176
endif
 
177
DPKG_BUILD_DEP = dpkg-dev (>= $(DPKGV)),
 
178
 
 
179
ifeq ($(DEB_HOST_ARCH),$(DEB_TARGET_ARCH))
 
180
  TARGET_QUAL = :$(DEB_TARGET_ARCH)
 
181
endif
 
182
 
 
183
# The binutils version needed.
 
184
# The oldest suitable versions for the various platforms can be found in
 
185
# INSTALL/specific.html ; we take a tighter dependency if possible to be on
 
186
# the safe side (something like newest( version in stable, versions for the
 
187
# various platforms in INSTALL/specific.html) ).
 
188
# We need binutils (>= 2.19.1) for a new dwarf unwind expression opcode.
 
189
# See http://gcc.gnu.org/ml/gcc-patches/2008-09/msg01713.html
 
190
ifeq ($(trunk_build),yes)
 
191
  BINUTILSBDV = 2.23
 
192
else
 
193
  BINUTILSBDV = 2.22
 
194
  ifneq (,$(filter $(distrelease),jessie sid saucy))
 
195
    BINUTILSBDV = 2.23.52
 
196
  endif
 
197
endif
 
198
ifeq ($(DEB_CROSS),yes)
 
199
  BINUTILS_BUILD_DEP = binutils$(TS) (>= $(BINUTILSBDV)), binutils-multiarch (>= $(BINUTILSBDV))
 
200
  BINUTILSV := $(shell dpkg -l binutils$(TS) \
 
201
                        | awk '/^ii/{print $$3;exit}' | sed 's/-.*//')
 
202
else
 
203
  BINUTILS_BUILD_DEP = binutils (>= $(BINUTILSBDV)) | binutils-multiarch (>= $(BINUTILSBDV))
 
204
  ifeq ($(REVERSE_CROSS),yes)
 
205
    BINUTILSV := $(shell dpkg -l binutils$(TS) \
 
206
                        | awk '/^ii/{print $$3;exit}' | sed 's/-.*//')
 
207
  else
 
208
    BINUTILSV := $(shell dpkg -l binutils binutils-multiarch \
 
209
                        | awk '/^ii/{print $$3;exit}' | sed 's/-.*//')
 
210
  endif
 
211
endif
 
212
ifeq (,$(BINUTILSV))
 
213
  BINUTILSV := $(BINUTILSBDV)
 
214
endif
 
215
 
 
216
# FIXME; stripping doesn't work with gold
 
217
#BINUTILS_BUILD_DEP += , binutils-gold (>= $(BINUTILSV)) [$(gold_archs)]
 
218
 
 
219
# libc-dev dependencies
 
220
libc_ver := 2.11
 
221
libc_dev_ver := $(libc_ver)
 
222
ifeq ($(with_multiarch_lib),yes)
 
223
  ifeq ($(derivative),Debian)
 
224
    libc_dev_ver := 2.13-5
 
225
    #ifeq (,$(filter arm, $(go_no_cpus)))
 
226
    #  libc_dev_ver := 2.13-31
 
227
    #endif
 
228
  else
 
229
    libc_dev_ver := 2.13-0ubuntu6
 
230
  endif
 
231
endif
 
232
ifeq ($(DEB_TARGET_ARCH_OS),linux)
 
233
  ifneq (,$(findstring $(DEB_TARGET_ARCH),alpha ia64))
 
234
    LIBC_DEP = libc6.1
 
235
  else
 
236
    LIBC_DEP = libc6
 
237
  endif
 
238
else
 
239
  ifeq ($(DEB_TARGET_ARCH_OS),hurd)
 
240
    LIBC_DEP = libc0.3
 
241
  endif
 
242
  ifeq ($(DEB_TARGET_ARCH_OS),kfreebsd)
 
243
    LIBC_DEP = libc0.1
 
244
  endif
 
245
  ifeq ($(DEB_TARGET_ARCH),uclibc)
 
246
       LIBC_DEP ?= libuclibc
 
247
       LIBC_DEV_DEP ?= libuclibc-dev
 
248
  endif
 
249
endif
 
250
LIBC_DEV_DEP = $(LIBC_DEP)-dev
 
251
# for cross
 
252
ifeq ($(DEB_CROSS),yes)
 
253
  LIBC_DEP ?= $(LIBC_DEP)$(LS)$(AQ)
 
254
  LIBC_DEV_DEP ?= $(LIBC_DEV_DEP)$(LS)$(AQ)
 
255
else
 
256
  LIBC_DBG_DEP = libc6.1-dbg [alpha ia64] | libc0.3-dbg [hurd-i386] | libc0.1-dbg [kfreebsd-i386 kfreebsd-amd64] | libc6-dbg,
 
257
endif
 
258
 
 
259
# this is about Debian archs name, *NOT* GNU target triplet
 
260
biarch_deb_map := \
 
261
        i386=amd64 amd64=i386 \
 
262
        mips=mips64 mipsel=mips64 \
 
263
        powerpc=ppc64 ppc64=powerpc \
 
264
        sparc=sparc64 sparc64=sparc\
 
265
        s390=s390x s390x=s390 \
 
266
        kfreebsd-amd64=i386 \
 
267
        armel=armhf \
 
268
        armhf=armel
 
269
biarch_deb_arch := $(patsubst $(DEB_TARGET_ARCH)=%,%, \
 
270
        $(filter $(DEB_TARGET_ARCH)=%,$(biarch_deb_map)))
 
271
 
 
272
LIBC_BIARCH_DEP :=
 
273
LIBC_BIARCH_DEV_DEP :=
 
274
ifneq (,$(findstring yes,$(biarch64) $(biarch32) $(biarchn32) $(biarchx32)$(biarchhf)$(biarchsf)))
 
275
  LIBC_BIARCH_DEP := $${shlibs:Depends}
 
276
  LIBC_BIARCH_DEV_DEP := $(LIBC_DEV_DEP)-$(biarch_deb_arch)$(LS)$(AQ) (>= $(libc_ver))
 
277
  # amd64, x32, i386
 
278
  ifneq (,$(findstring $(DEB_TARGET_ARCH),amd64 x32 i386))
 
279
  ifeq ($(biarch64)$(biarch32),yesyes)
 
280
    LIBC_BIARCH_DEV_DEP := $(LIBC_DEV_DEP)-amd64$(LS)$(AQ) (>= $(libc_ver)), $(LIBC_DEV_DEP)-i386$(LS)$(AQ) (>= $(libc_ver))
 
281
  endif
 
282
  ifeq ($(biarch64)$(biarchx32),yesyes)
 
283
    LIBC_BIARCH_DEV_DEP := $(LIBC_DEV_DEP)-amd64$(LS)$(AQ) (>= $(libc_ver)), $(LIBC_DEV_DEP)-x32$(LS)$(AQ) (>= $(libc_ver))
 
284
  endif
 
285
  ifeq ($(biarch32)$(biarchx32),yesyes)
 
286
    LIBC_BIARCH_DEV_DEP := $(LIBC_DEV_DEP)-i386$(LS)$(AQ) (>= $(libc_ver)), $(LIBC_DEV_DEP)-x32$(LS)$(AQ) (>= $(libc_ver))
 
287
  endif
 
288
  endif
 
289
  # mips*
 
290
  ifneq (,$(findstring $(DEB_TARGET_ARCH),mips mipsel mipsn32 mipsn32el mips64 mips64el))
 
291
  ifeq ($(biarchn32)$(biarch32),yesyes)
 
292
      LIBC_BIARCH_DEV_DEP := libc6-dev-mips32$(LS)$(AQ) (>= $(libc_ver)), libc6-dev-mipsn32$(LS)$(AQ) (>= $(libc_ver))
 
293
  endif
 
294
  ifeq ($(biarch64)$(biarch32),yesyes)
 
295
      triarch := $(COMMA)$(SPACE)
 
296
      LIBC_BIARCH_DEV_DEP := libc6-dev-mips32$(LS)$(AQ) (>= $(libc_ver)), libc6-dev-mips64$(LS)$(AQ) (>= $(libc_ver))
 
297
  endif
 
298
  ifeq ($(biarchn32)$(biarch64),yesyes)
 
299
      triarch := $(COMMA)$(SPACE)
 
300
      LIBC_BIARCH_DEV_DEP := libc6-dev-mips64$(LS)$(AQ) (>= $(libc_ver)), libc6-dev-mipsn32$(LS)$(AQ) (>= $(libc_ver))
 
301
  endif
 
302
  endif
 
303
 
 
304
  ifeq ($(biarchhf),yes)
 
305
    LIBC_BIARCH_DEP := $(LIBC_DEP)-$(biarch_deb_arch)$(LS)$(AQ) (>= $(libc_ver))
 
306
    LIBC_BIARCH_DEP += | $(LIBC_DEP)-$(biarch_deb_arch)$(LS)$(AQ)
 
307
    LIBC_BIARCH_DEV_DEP += | $(LIBC_DEV_DEP)-$(biarch_deb_arch)$(LS)$(AQ)
 
308
  endif
 
309
  ifeq ($(biarchsf),yes)
 
310
    LIBC_BIARCH_DEP := $(LIBC_DEP)-$(biarch_deb_arch)$(LS)$(AQ) (>= $(libc_ver))
 
311
    LIBC_BIARCH_DEP += | $(LIBC_DEP)-$(biarch_deb_arch)$(LS)$(AQ)
 
312
    LIBC_BIARCH_DEV_DEP += | $(LIBC_DEV_DEP)-$(biarch_deb_arch)$(LS)$(AQ)
 
313
  endif
 
314
endif
 
315
 
 
316
# Add suffix and required version
 
317
LIBC_DEV_DEP := $(LIBC_DEV_DEP)$(LS)$(AQ) (>= $(libc_dev_ver))
 
318
# TODO: make this automatic, there must be a better way to define LIBC_DEP.
 
319
ifneq ($(DEB_CROSS),yes)
 
320
  LIBC_BUILD_DEP = libc6.1-dev (>= $(libc_dev_ver)) [alpha ia64] | libc0.3-dev (>= $(libc_dev_ver)) [hurd-i386] | libc0.1-dev (>= $(libc_dev_ver)) [kfreebsd-i386 kfreebsd-amd64] | libc6-dev (>= $(libc_dev_ver))
 
321
  ifeq (,$(filter $(distrelease),lenny etch squeeze dapper hardy jaunty karmic lucid maverick natty oneiric))
 
322
    LIBC_BUILD_DEP += , libc6-dev (>= 2.13-31) [armel armhf]
 
323
  endif
 
324
  LIBC_BIARCH_BUILD_DEP = libc6-dev-amd64 [i386 x32], libc6-dev-sparc64 [sparc], libc6-dev-sparc [sparc64], libc6-dev-s390 [s390x], libc6-dev-s390x [s390], libc6-dev-i386 [amd64 x32], libc6-dev-powerpc [ppc64], libc6-dev-ppc64 [powerpc], libc0.1-dev-i386 [kfreebsd-amd64], lib32gcc1 [amd64 ppc64 kfreebsd-amd64 mipsn32 mipsn32el mips64 mips64el s390x sparc64 x32], libn32gcc1 [mips mipsel mips64 mips64el], lib64gcc1 [i386 mips mipsel mipsn32 mipsn32el powerpc sparc s390 x32], libc6-dev-mips64 [mips mipsel mipsn32 mipsn32el], libc6-dev-mipsn32 [mips mipsel mips64 mips64el], libc6-dev-mips32 [mipsn32 mipsn32el mips64 mips64el],
 
325
  ifneq (,$(findstring amd64,$(biarchx32archs)))
 
326
  LIBC_BIARCH_BUILD_DEP += libc6-dev-x32 [amd64 i386], libx32gcc1 [amd64 i386],
 
327
endif
 
328
ifneq (,$(findstring armel,$(biarchhfarchs)))
 
329
  LIBC_BIARCH_BUILD_DEP += libc6-dev-armhf [armel], libhfgcc1 [armel],
 
330
endif
 
331
ifneq (,$(findstring armhf,$(biarchsfarchs)))
 
332
  LIBC_BIARCH_BUILD_DEP += libc6-dev-armel [armhf], libsfgcc1 [armhf],
 
333
endif
 
334
else
 
335
  LIBC_BUILD_DEP = $(LIBC_DEV_DEP),
 
336
  ifneq ($(LIBC_BIARCH_DEV_DEP),)
 
337
    LIBC_BIARCH_BUILD_DEP = $(LIBC_BIARCH_DEV_DEP),
 
338
  else
 
339
    LIBC_BIARCH_BUILD_DEP =
 
340
  endif
 
341
endif
 
342
 
 
343
# needed for the include/asm symlink to run the testsuite for
 
344
# non default multilibs
 
345
GCC_MULTILIB_BUILD_DEP = g++-multilib [$(multilib_archs)],
 
346
 
 
347
LIBUNWIND_DEV_DEP := libunwind7-dev$(LS)$(AQ) (>= 0.98.5-6)
 
348
LIBUNWIND_BUILD_DEP := $(LIBUNWIND_DEV_DEP) [ia64],
 
349
LIBATOMIC_OPS_BUILD_DEP := libatomic-ops-dev$(LS) [ia64],
 
350
ifneq ($(DEB_TARGET_ARCH),ia64)
 
351
  LIBUNWIND_DEV_DEP := # nothing
 
352
endif
 
353
 
 
354
ifneq (,$(filter $(distrelease),lenny etch squeeze dapper hardy jaunty karmic lucid maverick natty))
 
355
  GMP_BUILD_DEP = libgmp3-dev | libgmp-dev (>= 2:5.0.1~),
 
356
  MPFR_BUILD_DEP = libmpfr-dev,
 
357
else
 
358
  GMP_BUILD_DEP = libgmp-dev (>= 2:5.0.1~),
 
359
  MPFR_BUILD_DEP = libmpfr-dev (>= 3.0.0-9~),
 
360
endif
 
361
 
 
362
PPL_BUILD_DEP = libisl-dev,
 
363
CLOOG_BUILD_DEP = libcloog-isl-dev (>= 0.18),
 
364
# FIXME: currently not dl'opened.
 
365
#CLOOG_RUNTIME_DEP = libisl10, libcloog-isl4
 
366
 
 
367
ifneq (,$(filter $(distrelease),lenny etch squeeze wheezy dapper hardy jaunty karmic lucid maverick natty oneiric precise quantal raring))
 
368
  MPC_BUILD_DEP = libmpc-dev,
 
369
else
 
370
  MPC_BUILD_DEP = libmpc-dev (>= 1.0),
 
371
endif
 
372
 
 
373
SOURCE_BUILD_DEP :=
 
374
ifeq (,$(findstring gcc,$(PKGSOURCE)))
 
375
  SOURCE_BUILD_DEP := gcc-$(BASE_VERSION)-source (>= $(GCC_SOURCE_VERSION)), gcc-$(BASE_VERSION)-source (<< $(NEXT_GCC_SOURCE_VERSION)),
 
376
endif
 
377
 
 
378
CHECK_BUILD_DEP := dejagnu [$(check_no_archs)],
 
379
ifneq (,$(findstring gcc,$(PKGSOURCE)))
 
380
  CHECK_BUILD_DEP += autogen,
 
381
endif
 
382
 
 
383
AUTO_BUILD_DEP := m4, libtool,
 
384
AUTO_BUILD_DEP += autoconf2.64,
 
385
 
 
386
# ensure that the common libs, built from the next GCC version are available
 
387
ifeq ($(PKGSOURCE),gcc-$(BASE_VERSION))
 
388
  ifneq ($(with_common_libs),yes)
 
389
    BASE_BUILD_DEP = gcc-4.9-base,
 
390
  endif
 
391
endif
 
392
 
 
393
ifneq ($(DEB_CROSS),yes)
 
394
JAVA_BUILD_DEP := zlib1g-dev, libantlr-java, python, libffi-dev,
 
395
 
 
396
ifeq ($(PKGSOURCE),gcj-$(BASE_VERSION))
 
397
  bd_java_archs =
 
398
else ifeq ($(single_package)-$(with_java),yes-yes)
 
399
  bd_java_archs =
 
400
else
 
401
  bd_java_archs = $(if $(java_no_archs),$(EMPTY) [$(java_no_archs)])
 
402
endif
 
403
 
 
404
ifneq (,$(java_awt_peers))
 
405
  JAVA_BUILD_DEP += fastjar$(bd_java_archs), libmagic-dev$(bd_java_archs),
 
406
  JAVA_BUILD_DEP += libecj-java (>= 3.3.0-2)$(bd_java_archs), zip$(bd_java_archs),
 
407
  ifeq ($(with_java_maintainer_mode),yes)
 
408
    # gcj-4.8 needed for gjavah-4.8.
 
409
    JAVA_BUILD_DEP += gcj-4.8$(bd_java_archs), ecj (>= 3.3.0-2)$(bd_java_archs),
 
410
  endif
 
411
  JAVA_BUILD_DEP += libasound2-dev [$(java_no_archs) $(linux_no_archs)],
 
412
  ifneq (,$(findstring gtk,$(java_awt_peers)))
 
413
    JAVA_BUILD_DEP += libxtst-dev$(bd_java_archs), libxt-dev$(bd_java_archs), libgtk2.0-dev (>= 2.4.4-2)$(bd_java_archs), libart-2.0-dev$(bd_java_archs), libcairo2-dev$(bd_java_archs),
 
414
  endif
 
415
  ifneq (,$(findstring qt,$(java_awt_peers)))
 
416
    JAVA_BUILD_DEP += libqt4-dev (>= 4.1.0)$(bd_java_archs),
 
417
  endif
 
418
  # gconf peer, disabled by default
 
419
  #JAVA_BUILD_DEP += libgconf2-dev$(bd_java_archs),
 
420
  # gstreamer peer
 
421
  #JAVA_BUILD_DEP += libgstreamer-plugins-base0.10-dev$(bd_java_archs),
 
422
  ifneq ($(single_package),yes)
 
423
    JAVA_BUILD_DEP += g++-4.8 [armel armhf],
 
424
  endif
 
425
endif
 
426
ifneq ($(with_standalone_gcj),yes)
 
427
  ifeq ($(PKGSOURCE),gcj-$(BASE_VERSION))
 
428
    JAVA_BUILD_DEP += $(SOURCE_BUILD_DEP)
 
429
  endif
 
430
endif
 
431
#JAVA_BUILD_INDEP := gcj-$(BASE_VERSION)-jdk
 
432
ifeq ($(single_package),yes)
 
433
  LIBSTDCXX_BUILD_INDEP = doxygen (>= 1.7.2), graphviz (>= 2.2), ghostscript, texlive-latex-base
 
434
  LIBSTDCXX_BUILD_INDEP +=, xsltproc, libxml2-utils, docbook-xsl-ns
 
435
  JAVA_BUILD_INDEP :=
 
436
endif
 
437
ifeq ($(with_separate_libgcj),yes)
 
438
  ifeq ($(PKGSOURCE),gcc-$(BASE_VERSION))
 
439
    JAVA_BUILD_DEP :=
 
440
    JAVA_BUILD_INDEP :=
 
441
  endif
 
442
endif
 
443
 
 
444
ifeq ($(with_ecj),yes)
 
445
  ifneq (./,$(dir $(ecj_jar)))
 
446
    ECJ_DEP = libecj-java (>= 3.5.1)
 
447
  endif
 
448
else
 
449
  ECJ_DEP = ecj, libecj-java (>= 3.5.1)
 
450
  ECJ_DEP = ecj-gcj, libecj-java-gcj (>= 3.5.1)
 
451
  ifneq (,$(filter $(DEB_HOST_ARCH),arm armel armhf))
 
452
    ECJ_DEP +=, ecj1
 
453
  endif
 
454
endif
 
455
 
 
456
ifeq ($(PKGSOURCE),gcc-$(BASE_VERSION))
 
457
  LIBSTDCXX_BUILD_INDEP = doxygen (>= 1.7.2), graphviz (>= 2.2), ghostscript, texlive-latex-base
 
458
  ifeq (,$(filter $(distrelease),lenny etch dapper hardy jaunty karmic lucid maverick natty oneiric))
 
459
    LIBSTDCXX_BUILD_INDEP +=, xsltproc, libxml2-utils, docbook-xsl-ns
 
460
  endif
 
461
  JAVA_BUILD_INDEP :=, $(JAVA_BUILD_INDEP)
 
462
endif
 
463
 
 
464
# FIXME: needs zlib?
 
465
GO_BUILD_DEP := g++-4.6,
 
466
GO_BUILD_DEP := netbase,
 
467
 
 
468
ifeq ($(PKGSOURCE),gcc-$(BASE_VERSION))
 
469
  ifneq ($(with_separate_gnat),yes)
 
470
    # Build gnat as part of the combiled gcc-x.y source package.  Do not fail
 
471
    # if gnat is not present on unsupported architectures; the build scripts
 
472
    # will not use gnat anyway.
 
473
    #GNAT_BUILD_DEP := gnat (>= 4.1) [$(ada_no_archs)],
 
474
    GNAT_BUILD_DEP := gnat (>= 4.1) [!arm !armhf !arm64 !powerpcspe !ppc64el !sh4 !sparc64 !hurd-i386],
 
475
  endif
 
476
else ifeq ($(single_package),yes)
 
477
  # Ditto, as part of the gcc-snapshot package.
 
478
  # FIXME: ad hoc dependency, better fix setting of ada_no_archs
 
479
  #GNAT_BUILD_DEP := gnat (>= 4.1) [$(ada_no_archs)], gcc-snapshot (>= 20090821-1) [armel armhf],
 
480
  GNAT_BUILD_DEP := gnat (>= 4.1) [!arm !armhf !arm64 !powerpcspe !ppc64el !sh4 !sparc64 !hurd-i386],
 
481
else ifeq ($(PKGSOURCE),gnat-$(BASE_VERSION))
 
482
  # Special source package just for gnat. Fail early if gnat is not present,
 
483
  # rather than waste CPU cycles and fail later.
 
484
  GNAT_BUILD_DEP := gnat (>= 4.1), g++-$(BASE_VERSION),
 
485
  GNAT_BUILD_DEP += $(SOURCE_BUILD_DEP)
 
486
  ifeq ($(distribution),Ubuntu)
 
487
    GNAT_BUILD_DEP += gcc-4.6-multilib [armel armhf],
 
488
  endif
 
489
  JAVA_BUILD_DEP :=
 
490
  JAVA_BUILD_INDEP :=
 
491
  GDC_BUILD_DEP :=
 
492
  GO_BUILD_DEP :=
 
493
else ifeq ($(PKGSOURCE),gcj-$(BASE_VERSION))
 
494
  # Special source package just for gcj.
 
495
  GNAT_BUILD_DEP :=
 
496
  GDC_BUILD_DEP :=
 
497
  GO_BUILD_DEP :=
 
498
else ifeq ($(PKGSOURCE),gdc-$(BASE_VERSION))
 
499
  # Special source package just for gdc.
 
500
  GNAT_BUILD_DEP :=
 
501
  JAVA_BUILD_DEP :=
 
502
  JAVA_BUILD_INDEP :=
 
503
  GDC_BUILD_DEP := $(SOURCE_BUILD_DEP)
 
504
  GO_BUILD_DEP :=
 
505
else ifeq ($(PKGSOURCE),gccgo-$(BASE_VERSION))
 
506
  # Special source package just for gccgo.
 
507
  GNAT_BUILD_DEP :=
 
508
  JAVA_BUILD_DEP :=
 
509
  JAVA_BUILD_INDEP :=
 
510
  GDC_BUILD_DEP := $(SOURCE_BUILD_DEP)
 
511
endif
 
512
 
 
513
else
 
514
# build cross compiler
 
515
  CROSS_BUILD_DEP := libc6-dev$(cross_lib_arch),
 
516
ifeq ($(REVERSE_CROSS),yes)
 
517
  CROSS_BUILD_DEP += zlib1g-dev$(cross_lib_arch), libmpfr-dev$(cross_lib_arch),
 
518
endif
 
519
  SOURCE_BUILD_DEP :=
 
520
  ifeq (,$(findstring gcc,$(PKGSOURCE)))
 
521
    SOURCE_BUILD_DEP := gcc-$(BASE_VERSION)-source (>= $(GCC_SOURCE_VERSION)), gcc-$(BASE_VERSION)-source (<< $(NEXT_GCC_SOURCE_VERSION)),
 
522
  endif
 
523
  ifeq ($(with_java),yes)
 
524
    JAVA_BUILD_DEP := zlib1g-dev, lib64z1-dev [i386 powerpc sparc s390], lib32z1-dev [amd64 ppc64 kfreebsd-amd64 s390x],
 
525
  endif
 
526
  JAVA_BUILD_INDEP :=
 
527
  GNAT_BUILD_DEP :=
 
528
endif # cross compiler
 
529
 
 
530
# The numeric part of the gcc version number (x.yy.zz)
 
531
NEXT_GCC_VERSION := $(shell echo $(GCC_VERSION) | \
 
532
                awk -F. '{OFS="."; if (NF==2) $$3=1; else $$NF += 1; print}')
 
533
# first version with a new path component in gcc_lib_dir (i.e. GCC_VERSION
 
534
# or TARGET_ALIAS changes), or last version available for all architectures
 
535
DEB_GCC_SOFT_VERSION := 4.8
 
536
DEB_GCJ_SOFT_VERSION := 4.8
 
537
 
 
538
ifeq ($(with_d),yes)
 
539
  GDC_VERSION := $(BASE_VERSION)
 
540
  DEB_GDC_VERSION := $(DEB_VERSION)
 
541
endif
 
542
 
 
543
# semiautomatic ...
 
544
DEB_SOVERSION           := $(DEB_VERSION)
 
545
DEB_SOVERSION           := 4.8
 
546
DEB_SOEVERSION          := $(EPOCH):4.8
 
547
DEB_STDCXX_SOVERSION    := 4.8
 
548
DEB_GCJ_SOVERSION       := 4.8
 
549
DEB_GOMP_SOVERSION      := $(DEB_SOVERSION)
 
550
DEB_GCCMATH_SOVERSION   := $(DEB_SOVERSION)
 
551
 
 
552
DEB_GCC_VERSION := $(DEB_VERSION)
 
553
DEB_GCJ_VERSION := $(DEB_VERSION)
 
554
ifeq ($(with_separate_libgcj),yes)
 
555
  ifeq ($(PKGSOURCE),gcj-$(BASE_VERSION))
 
556
    DEB_GCC_VERSION := $(DEB_GCC_SOFT_VERSION)
 
557
  endif
 
558
endif
 
559
 
 
560
DEB_GNAT_VERSION := $(DEB_VERSION)
 
561
ifeq ($(with_separate_gnat),yes)
 
562
  ifeq ($(PKGSOURCE),gnat-$(BASE_VERSION))
 
563
    DEB_GCC_VERSION := $(DEB_GCC_SOFT_VERSION)
 
564
  endif
 
565
endif
 
566
 
 
567
GNAT_VERSION := $(BASE_VERSION)
 
568
 
 
569
LIBGNAT_DEP :=
 
570
ifeq ($(with_libgnat),yes)
 
571
  LIBGNAT_DEP := libgnat-$(GNAT_VERSION) (= $(DEB_VERSION))
 
572
endif
 
573
 
 
574
pkg_ver := -$(BASE_VERSION)
 
575
 
 
576
PKG_GCJ_EXT = $(GCJ_SONAME1)
 
577
PKG_LIBGCJ_EXT = $(GCJ_SONAME1)$(if $(GCJ_SONAME2),-$(GCJ_SONAME2))
 
578
 
 
579
ctrl_flags = \
 
580
        -DBINUTILSV=$(BINUTILSV) \
 
581
        -DBINUTILSBDV=$(BINUTILSBDV) \
 
582
        -DSRCNAME=$(PKGSOURCE) \
 
583
        -D__$(DEB_TARGET_GNU_CPU)__ \
 
584
        -DARCH=$(DEB_TARGET_ARCH) \
 
585
        -DDIST=$(distribution)
 
586
 
 
587
ctrl_flags += \
 
588
        -DLIBC_DEV_DEP="$(LIBC_DEV_DEP)" \
 
589
        -DLIBC_BIARCH_BUILD_DEP="$(LIBC_BIARCH_BUILD_DEP)" \
 
590
        -DLIBC_DBG_DEP="$(LIBC_DBG_DEP)" \
 
591
        -DFORTRAN_BUILD_DEP="$(FORTRAN_BUILD_DEP)" \
 
592
        -DBASE_BUILD_DEP="$(BASE_BUILD_DEP)" \
 
593
        -DGNAT_BUILD_DEP="$(GNAT_BUILD_DEP)" \
 
594
        -DJAVA_BUILD_DEP="$(JAVA_BUILD_DEP)" \
 
595
        -DGO_BUILD_DEP="$(GO_BUILD_DEP)" \
 
596
        -DJAVA_BUILD_INDEP="$(JAVA_BUILD_INDEP)" \
 
597
        -DLIBSTDCXX_BUILD_INDEP="$(LIBSTDCXX_BUILD_INDEP)" \
 
598
        -DGDC_BUILD_DEP="$(GDC_BUILD_DEP)" \
 
599
        -DBINUTILS_BUILD_DEP="$(BINUTILS_BUILD_DEP)" \
 
600
        -DLIBC_BUILD_DEP="$(LIBC_BUILD_DEP)" \
 
601
        -DCHECK_BUILD_DEP="$(CHECK_BUILD_DEP)" \
 
602
        -DAUTO_BUILD_DEP="$(AUTO_BUILD_DEP)" \
 
603
        -DAUTOGEN_BUILD_DEP="$(AUTOGEN_BUILD_DEP)" \
 
604
        -DCLOOG_BUILD_DEP="$(CLOOG_BUILD_DEP)" \
 
605
        -DGMP_BUILD_DEP="$(GMP_BUILD_DEP)" \
 
606
        -DMPFR_BUILD_DEP="$(MPFR_BUILD_DEP)" \
 
607
        -DMPC_BUILD_DEP="$(MPC_BUILD_DEP)" \
 
608
        -DDPKG_BUILD_DEP="$(DPKG_BUILD_DEP)" \
 
609
        -DSOURCE_BUILD_DEP="$(SOURCE_BUILD_DEP)" \
 
610
        -DCROSS_BUILD_DEP="$(CROSS_BUILD_DEP)" \
 
611
        -DGCC_MULTILIB_BUILD_DEP='$(GCC_MULTILIB_BUILD_DEP)' \
 
612
        -DMULTILIB_ARCHS="$(multilib_archs)" \
 
613
        -DNEON_ARCHS="$(neon_archs)" \
 
614
        -DTP=$(TP) \
 
615
        -DTS=$(TS) \
 
616
        -DLS=$(LS) \
 
617
        -DAQ=$(AQ)
 
618
 
 
619
ifeq ($(DEB_CROSS),yes)
 
620
  ctrl_flags += \
 
621
        -DTARGET=$(DEB_TARGET_ARCH) \
 
622
        -DLIBUNWIND_BUILD_DEP="$(LIBUNWIND_BUILD_DEP)" \
 
623
        -DLIBATOMIC_OPS_BUILD_DEP="$(LIBATOMIC_OPS_BUILD_DEP)"
 
624
  ifeq ($(with_deps_on_target_arch_pkgs),yes)
 
625
    ctrl_flags += -DCROSS_ARCH=$(DEB_TARGET_ARCH)
 
626
  endif
 
627
else
 
628
  # add '-DPRI=optional' to ctrl_flags if this is not the default compiler
 
629
  # ctrl_flags += \
 
630
  #     -DPRI=optional
 
631
endif
 
632
 
 
633
ifeq ($(with_base_only),yes)
 
634
  ctrl_flags += \
 
635
        -DBASE_ONLY=yes
 
636
endif
 
637
 
 
638
ifeq ($(with_multiarch_lib),yes)
 
639
  ctrl_flags += \
 
640
        -DMULTIARCH=yes
 
641
endif
 
642
 
 
643
control: control-file readme-bugs-file parameters-file symbols-files copyright-file substvars-file versioned-files check-versions
 
644
 
 
645
# stage1 and stage2 compilers are only C
 
646
ifdef DEB_STAGE
 
647
  languages = c
 
648
  addons = cdev plugindev
 
649
  ifeq ($(multilib),yes)
 
650
    addons += multilib
 
651
  endif
 
652
  addons += $(if $(findstring armel,$(biarchhfarchs)),armml)
 
653
  addons += $(if $(findstring armhf,$(biarchsfarchs)),armml)
 
654
  ifeq ($(DEB_STAGE),stage2)
 
655
    addons += libgcc gccxbase
 
656
    ifeq ($(multilib),yes)
 
657
      addons += lib32gcc lib64gcc libn32gcc
 
658
      addons += $(if $(findstring amd64,$(biarchx32archs)),libx32gcc)
 
659
      addons += $(if $(findstring armel,$(biarchhfarchs)),libhfgcc)
 
660
      addons += $(if $(findstring armhf,$(biarchsfarchs)),libsfgcc)
 
661
    endif
 
662
  else
 
663
    LIBGCC_DEV_DEP :=
 
664
  endif
 
665
else
 
666
languages = c c++ fortran objc objpp
 
667
ifeq ($(with_gccbase),yes)
 
668
    addons += gccbase
 
669
endif
 
670
ifeq ($(with_gccxbase),yes)
 
671
    addons += gccxbase
 
672
endif
 
673
addons += cdev c++dev fdev objcdev source objppdev multilib
 
674
addons += plugindev
 
675
addons += $(if $(findstring armel,$(biarchhfarchs)),armml)
 
676
addons += $(if $(findstring armhf,$(biarchsfarchs)),armml)
 
677
addons += $(if $(findstring amd64,$(biarchx32archs)),x32dev)
 
678
ifeq ($(with_libgcc),yes)
 
679
  addons += libgcc lib4gcc lib32gcc lib64gcc libn32gcc
 
680
  addons += $(if $(findstring amd64,$(biarchx32archs)),libx32gcc)
 
681
  addons += $(if $(findstring armel,$(biarchhfarchs)),libhfgcc)
 
682
  addons += $(if $(findstring armhf,$(biarchsfarchs)),libsfgcc)
 
683
endif
 
684
ifeq ($(with_libcxx),yes)
 
685
  addons += libcxx lib32cxx lib64cxx libn32cxx
 
686
  addons += $(if $(findstring amd64,$(biarchx32archs)),libx32cxx)
 
687
  addons += $(if $(findstring armel,$(biarchhfarchs)),libhfcxx)
 
688
  addons += $(if $(findstring armhf,$(biarchsfarchs)),libsfcxx)
 
689
endif
 
690
addons += $(if $(findstring amd64,$(biarchx32archs)),libx32dbgcxx)
 
691
addons += $(if $(findstring armel,$(biarchhfarchs)),libhfdbgcxx)
 
692
addons += $(if $(findstring armhf,$(biarchsfarchs)),libsfdbgcxx)
 
693
ifeq ($(with_libgfortran),yes)
 
694
  addons += libgfortran lib32gfortran lib64gfortran libn32gfortran
 
695
  addons += $(if $(findstring amd64,$(biarchx32archs)),libx32gfortran)
 
696
  addons += $(if $(findstring armel,$(biarchhfarchs)),libhfgfortran)
 
697
  addons += $(if $(findstring armhf,$(biarchsfarchs)),libsfgfortran)
 
698
endif
 
699
ifeq ($(with_libobjc),yes)
 
700
  addons += libobjc lib32objc lib64objc libn32objc
 
701
  addons += $(if $(findstring amd64,$(biarchx32archs)),libx32objc)
 
702
  addons += $(if $(findstring armel,$(biarchhfarchs)),libhfobjc)
 
703
  addons += $(if $(findstring armhf,$(biarchsfarchs)),libsfobjc)
 
704
endif
 
705
ifeq ($(with_libgomp),yes)
 
706
  addons += libgomp lib32gomp lib64gomp libn32gomp
 
707
  addons += $(if $(findstring amd64,$(biarchx32archs)),libx32gomp)
 
708
  addons += $(if $(findstring armel,$(biarchhfarchs)),libhfgomp)
 
709
  addons += $(if $(findstring armhf,$(biarchsfarchs)),libsfgomp)
 
710
endif
 
711
ifeq ($(with_libitm),yes)
 
712
  addons += libitm lib32itm lib64itm libn32itm
 
713
  addons += $(if $(findstring amd64,$(biarchx32archs)),libx32itm)
 
714
  addons += $(if $(findstring armel,$(biarchhfarchs)),libhfitm)
 
715
  addons += $(if $(findstring armhf,$(biarchsfarchs)),libsfitm)
 
716
endif
 
717
ifeq ($(with_libatomic),yes)
 
718
  addons += libatomic lib32atomic lib64atomic libn32atomic
 
719
  addons += $(if $(findstring amd64,$(biarchx32archs)),libx32atomic)
 
720
  addons += $(if $(findstring armel,$(biarchhfarchs)),libhfatomic)
 
721
  addons += $(if $(findstring armhf,$(biarchsfarchs)),libsfatomic)
 
722
endif
 
723
ifeq ($(with_libbacktrace),yes)
 
724
  addons += libbtrace lib32btrace lib64btrace libn32btrace
 
725
  addons += $(if $(findstring amd64,$(biarchx32archs)),libx32btrace)
 
726
  addons += $(if $(findstring armel,$(biarchhfarchs)),libhfbtrace)
 
727
  addons += $(if $(findstring armhf,$(biarchsfarchs)),libsfbtrace)
 
728
endif
 
729
ifeq ($(with_libasan),yes)
 
730
  addons += libasan lib32asan lib64asan libn32asan
 
731
  addons += $(if $(findstring amd64,$(biarchx32archs)),libx32asan)
 
732
  addons += $(if $(findstring armel,$(biarchhfarchs)),libhfasan)
 
733
  addons += $(if $(findstring armhf,$(biarchsfarchs)),libsfasan)
 
734
endif
 
735
  addons += libtsan
 
736
ifeq ($(with_libtsan),yes)
 
737
  addons += libtsan #lib32tsan lib64tsan libn32tsan
 
738
  #addons += $(if $(findstring amd64,$(biarchx32archs)),libx32tsan)
 
739
  #addons += $(if $(findstring armel,$(biarchhfarchs)),libhftsan)
 
740
  #addons += $(if $(findstring armhf,$(biarchsfarchs)),libsftsan)
 
741
endif
 
742
ifeq ($(with_libqmath),yes)
 
743
  addons += libqmath lib32qmath lib64qmath libn32qmath
 
744
  addons += $(if $(findstring amd64,$(biarchx32archs)),libx32qmath)
 
745
  addons += $(if $(findstring armel,$(biarchhfarchs)),libhfqmath)
 
746
  addons += $(if $(findstring armhf,$(biarchsfarchs)),libsfqmath)
 
747
endif
 
748
ifeq ($(with_d),yes)
 
749
  languages += d
 
750
  ifeq ($(with_libphobos),yes)
 
751
    addons += libphobos
 
752
  endif
 
753
endif
 
754
ifeq ($(with_go),yes)
 
755
  addons += ggo godev
 
756
  ifeq ($(with_libgo),yes)
 
757
    addons += libggo lib32ggo lib64ggo libn32ggo
 
758
    addons += $(if $(findstring amd64,$(biarchx32archs)),libx32ggo)
 
759
  endif
 
760
endif
 
761
 
 
762
  languages += ada
 
763
  addons += libgnat libs source # libgmath libnof lib64gnat ssp
 
764
 
 
765
  languages += java
 
766
  addons += gcj
 
767
  ifneq ($(DEB_CROSS),yes)
 
768
    addons += libgcj libgcjdev gcjdoc gcjsrc
 
769
  endif
 
770
 
 
771
  ifneq ($(DEB_CROSS),yes)
 
772
  ifneq (,$(neon_archs))
 
773
    addons += libneongcc libneongomp libneonitm libneonobjc libneongfortran libneoncxx
 
774
  endif
 
775
  ifeq ($(with_fixincl),yes)
 
776
    addons += fixincl
 
777
  endif
 
778
  ifeq ($(with_libgcj_doc),yes)
 
779
    addons += gcjdoc
 
780
  endif
 
781
  endif # DEB_CROSS
 
782
#  ifneq (,$(findstring gtk, $(java_awt_peers)))
 
783
#    addons += gtkpeer
 
784
#  endif
 
785
#  ifneq (,$(findstring qt, $(java_awt_peers)))
 
786
#    addons += qtpeer
 
787
#  endif
 
788
  ifeq ($(with_separate_libgcj),yes)
 
789
    ifeq ($(PKGSOURCE),gcc-$(BASE_VERSION))
 
790
      languages := $(filter-out java,$(languages))
 
791
      addons := $(filter-out gcj libgcj libgcjdev gcjdoc gcjsrc gtkpeer qtpeer,$(addons))
 
792
    endif
 
793
    ifeq ($(PKGSOURCE),gcj-$(BASE_VERSION))
 
794
      languages = java
 
795
      addons = gcj libgcj libgcjdev gcjsrc
 
796
      addons += $(if $(filter yes,$(with_gcjbase)),gcjbase)
 
797
      addons += $(if $(filter yes,$(with_gcjxbase)),gcjxbase)
 
798
    ifeq ($(with_libgcj_doc),yes)
 
799
      addons += gcjdoc
 
800
    endif
 
801
#      ifneq (,$(findstring gtk, $(java_awt_peers)))
 
802
#        addons += gtkpeer
 
803
#      endif
 
804
#      ifneq (,$(findstring qt, $(java_awt_peers)))
 
805
#        addons += qtpeer
 
806
#      endif
 
807
      ifeq ($(with_standalone_gcj),yes)
 
808
        addons += libgcc lib4gcc lib64gcc lib32gcc libn32gcc libx32gcc
 
809
      endif
 
810
    endif
 
811
  endif
 
812
  ifeq ($(DEB_CROSS),yes)
 
813
    addons := $(filter-out gcjdoc gcjsrc,$(addons))
 
814
  endif
 
815
  ifeq ($(with_standalone_gcj),yes)
 
816
    ifeq ($(PKGSOURCE),gcj-$(BASE_VERSION))
 
817
      ctrl_flags += -DSTANDALONEJAVA
 
818
    endif
 
819
  endif
 
820
  ifeq ($(with_separate_libgo),yes)
 
821
    ifeq ($(PKGSOURCE),gcc-$(BASE_VERSION))
 
822
      languages := $(filter-out go,$(languages))
 
823
      addons := $(filter-out ggo godev libggo lib64ggo lib32ggo libn32ggo libx32ggo,$(addons))
 
824
    endif
 
825
    ifeq ($(PKGSOURCE),gccgo-$(BASE_VERSION))
 
826
      languages = go
 
827
      addons = ggo godev libggo lib64ggo lib32ggo libn32ggo gccbase multilib
 
828
      addons += $(if $(findstring amd64,$(biarchx32archs)),libx32ggo)
 
829
      # FIXME: use the convenience libgcc ...
 
830
      #ifeq ($(with_standalone_go),yes)
 
831
      # addons += libgcc lib4gcc lib64gcc lib32gcc libn32gcc libx32gcc
 
832
      #endif
 
833
    endif
 
834
  endif
 
835
  ifeq ($(with_standalone_go),yes)
 
836
    ifeq ($(PKGSOURCE),gccgo-$(BASE_VERSION))
 
837
      ctrl_flags += -DSTANDALONEGO
 
838
    endif
 
839
  endif
 
840
  ifeq ($(with_separate_gnat),yes)
 
841
    ifeq ($(PKGSOURCE),gcc-$(BASE_VERSION))
 
842
      languages := $(filter-out ada,$(languages))
 
843
      addons := $(filter-out libgnat,$(addons))
 
844
    endif
 
845
    ifeq ($(PKGSOURCE),gnat-$(BASE_VERSION))
 
846
      languages = ada
 
847
      addons = libgnat
 
848
    endif
 
849
  endif
 
850
  ifeq ($(with_separate_gdc),yes)
 
851
    ifeq ($(PKGSOURCE),gcc-$(BASE_VERSION))
 
852
      languages := $(filter-out d,$(languages))
 
853
    endif
 
854
    ifeq ($(PKGSOURCE),gdc-$(BASE_VERSION))
 
855
      languages = d
 
856
      addons = 
 
857
      ifeq ($(with_libphobos),yes)
 
858
        addons += libphobos
 
859
      endif
 
860
    endif
 
861
  endif
 
862
  ifneq ($(DEB_CROSS),yes) # no docs for cross compilers
 
863
  ifneq ($(GFDL_INVARIANT_FREE),yes)
 
864
    addons += gfdldoc
 
865
  endif
 
866
  endif
 
867
endif # not stage
 
868
 
 
869
control-file:
 
870
        echo "addons: $(addons)"; \
 
871
        m4 $(ctrl_flags) \
 
872
          -DPV=$(pkg_ver) \
 
873
          -DCXX_SO=$(CXX_SONAME) \
 
874
          -DGCC_SO=$(GCC_SONAME) \
 
875
          -DOBJC_SO=$(OBJC_SONAME) \
 
876
          -DFORTRAN_SO=$(FORTRAN_SONAME) \
 
877
          -DGCJ_SO=$(PKG_GCJ_EXT) \
 
878
          -DLIBGCJ_EXT=$(PKG_LIBGCJ_EXT) \
 
879
          -DGNAT_SO=$(GNAT_SONAME) \
 
880
          -DGNAT_V=$(GNAT_VERSION) \
 
881
          -DPHOBOS_V=$(libphobos_version) \
 
882
          -DGOMP_SO=$(GOMP_SONAME) \
 
883
          -DGCCMATH_SO=$(GCCMATH_SONAME) \
 
884
          -DITM_SO=$(ITM_SONAME) \
 
885
          -DATOMIC_SO=$(ATOMIC_SONAME) \
 
886
          -DBTRACE_SO=$(BTRACE_SONAME) \
 
887
          -DASAN_SO=$(ASAN_SONAME) \
 
888
          -DTSAN_SO=$(TSAN_SONAME) \
 
889
          -DQMATH_SO=$(QUADMATH_SONAME) \
 
890
          -DSSP_SO=$(SSP_SONAME) \
 
891
          -DGO_SO=$(GO_SONAME) \
 
892
          -Denabled_languages="$(languages) $(addons)" \
 
893
          -Dada_no_archs="$(ada_no_archs)" \
 
894
          -Djava_no_archs="$(java_no_archs)" \
 
895
          -Dfortran_no_archs="$(fortran_no_archs)" \
 
896
          -Dlibgc_no_archs="$(libgc_no_archs)" \
 
897
          -Dlibphobos_archs="$(libphobos_archs)" \
 
898
          -Dlibphobos_no_archs="$(libphobos_no_archs)" \
 
899
          -Dcheck_no_archs="$(check_no_archs)" \
 
900
          -Dlocale_no_archs="$(locale_no_archs)" \
 
901
          -Dlinux_gnu_archs="$(linux_gnu_archs)" \
 
902
          -Dbiarch32_archs="$(strip $(subst /, ,$(biarch32archs)))" \
 
903
          -Dbiarch64_archs="$(strip $(subst /, ,$(biarch64archs)))" \
 
904
          -Dbiarchn32_archs="$(strip $(subst /, ,$(biarchn32archs)))" \
 
905
          -Dbiarchx32_archs="$(strip $(subst /, ,$(biarchx32archs)))" \
 
906
          -Dbiarchhf_archs="$(strip $(subst /, ,$(biarchhfarchs)))" \
 
907
          -Dbiarchsf_archs="$(strip $(subst /, ,$(biarchsfarchs)))" \
 
908
          -Dadd_built_using=$(add_built_using) \
 
909
                debian/control.m4 > debian/control.tmp2
 
910
        uniq debian/control.tmp2 | sed '/^Build/s/ *, */, /g;/^  /s/ *, */, /g' \
 
911
                > debian/control.tmp
 
912
        rm -f debian/control.tmp2
 
913
        [ -e debian/control ] \
 
914
          && cmp -s debian/control debian/control.tmp \
 
915
          && rm -f debian/control.tmp && exit 0; \
 
916
          mv debian/control.tmp debian/control; touch $(control_stamp)
 
917
 
 
918
readme-bugs-file:
 
919
        m4 -DDIST=$(distribution) -DSRCNAME=$(PKGSOURCE) \
 
920
                debian/README.Bugs.m4 > debian/README.Bugs
 
921
 
 
922
copyright-file:
 
923
        rm -f debian/copyright
 
924
        if echo $(SOURCE_VERSION) | grep -E ^'[0-9]\.[0-9]-[0-9]{8}' ; \
 
925
                then SVN_BRANCH="trunk" ; \
 
926
        else \
 
927
                SVN_BRANCH="gcc-$(subst .,_,$(BASE_VERSION))-branch" ; \
 
928
        fi ; \
 
929
        sed debian/copyright.in         \
 
930
                -e "s/@BV@/$(BASE_VERSION)/g"           \
 
931
                -e "s/@SVN_BRANCH@/$$SVN_BRANCH/g"      \
 
932
                > debian/copyright
 
933
 
 
934
substvars-file:
 
935
        rm -f debian/substvars.local.tmp
 
936
        ( \
 
937
                echo 'libgcc:Version=$(DEB_LIBGCC_VERSION)'; \
 
938
                echo 'gcc:Version=$(DEB_GCC_VERSION)'; \
 
939
                echo 'gcc:EpochVersion=$(DEB_EVERSION)'; \
 
940
                echo 'gcc:SoftVersion=$(DEB_GCC_SOFT_VERSION)'; \
 
941
                echo 'gdc:Version=$(DEB_GDC_VERSION)'; \
 
942
                echo 'gcj:Version=$(DEB_GCJ_VERSION)'; \
 
943
                echo 'gcj:SoftVersion=$(DEB_GCJ_SOFT_VERSION)'; \
 
944
                echo 'gcj:BaseVersion=$(BASE_VERSION)'; \
 
945
                echo 'gnat:Version=$(DEB_GNAT_VERSION)'; \
 
946
                echo 'binutils:Version=$(BINUTILSV)'; \
 
947
                echo 'dep:libgcc=$(LIBGCC_DEP)'; \
 
948
                echo 'dep:libgccdev=$(LIBGCC_DEV_DEP)'; \
 
949
                echo 'dep:libgccbiarch=$(libgccbiarch)'; \
 
950
                echo 'dep:libgccbiarchdev=$(libgccbiarchdev)'; \
 
951
                echo 'dep:libc=$(LIBC_DEP) (>= $(libc_ver))'; \
 
952
                echo 'dep:libcdev=$(LIBC_DEV_DEP)'; \
 
953
                echo 'dep:libcbiarch=$(LIBC_BIARCH_DEP)'; \
 
954
                echo 'dep:libcbiarchdev=$(LIBC_BIARCH_DEV_DEP)'; \
 
955
                echo 'dep:libunwinddev=$(LIBUNWIND_DEV_DEP)'; \
 
956
                echo 'dep:libcxxbiarchdev=$(libstdc++biarchdev)'; \
 
957
                echo 'dep:libcxxbiarchdbg=$(libstdc++biarchdbg)'; \
 
958
                echo 'dep:libgnat=$(LIBGNAT_DEP)'; \
 
959
                echo 'dep:ecj=$(ECJ_DEP)'; \
 
960
                echo 'dep:libcloog=$(CLOOG_RUNTIME_DEP)'; \
 
961
        ) > debian/substvars.local.tmp
 
962
ifneq (,$(filter $(DEB_TARGET_ARCH), $(multilib_archs)))
 
963
        ( \
 
964
                echo 'gcc:multilib=gcc-$(BASE_VERSION)-multilib$(TS)'; \
 
965
                echo 'gxx:multilib=g++-$(BASE_VERSION)-multilib$(TS)'; \
 
966
                echo 'gobjc:multilib=gobjc-$(BASE_VERSION)-multilib$(TS)'; \
 
967
                echo 'gobjcxx:multilib=gobjc++-$(BASE_VERSION)-multilib$(TS)'; \
 
968
                echo 'gfortran:multilib=gfortran-$(BASE_VERSION)-multilib$(TS)'; \
 
969
        ) >> debian/substvars.local.tmp
 
970
endif
 
971
ifeq ($(with_gold),yes)
 
972
        echo 'dep:gold=binutils-gold (>= $(BINUTILSV))' \
 
973
                >> debian/substvars.local.tmp
 
974
endif
 
975
ifeq ($(with_libssp),yes)
 
976
        echo 'dep:libssp=libssp$(SSP_SONAME)$(LS)$(AQ) (>= $${gcc:Version})' \
 
977
                >> debian/substvars.local.tmp
 
978
endif
 
979
ifeq ($(with_gomp),yes)
 
980
        echo 'dep:libgomp=libgomp$(GOMP_SONAME)$(LS)$(AQ) (>= $${gcc:Version})' \
 
981
                >> debian/substvars.local.tmp
 
982
endif
 
983
ifeq ($(with_itm),yes)
 
984
        echo 'dep:libitm=libitm$(ITM_SONAME)$(LS)$(AQ) (>= $${gcc:Version})' \
 
985
                >> debian/substvars.local.tmp
 
986
endif
 
987
ifeq ($(with_atomic),yes)
 
988
        echo 'dep:libatomic=libatomic$(ATOMIC_SONAME)$(LS)$(AQ) (>= $${gcc:Version})' \
 
989
                >> debian/substvars.local.tmp
 
990
endif
 
991
ifeq ($(with_libbacktrace),yes)
 
992
        echo 'dep:libbacktrace=libbtrace$(BTRACE_SONAME)$(LS)$(AQ) (>= $${gcc:Version})' \
 
993
                >> debian/substvars.local.tmp
 
994
endif
 
995
ifeq ($(with_asan),yes)
 
996
        echo 'dep:libasan=libasan$(ASAN_SONAME)$(LS)$(AQ) (>= $${gcc:Version})' \
 
997
                >> debian/substvars.local.tmp
 
998
endif
 
999
ifeq ($(with_tsan),yes)
 
1000
        echo 'dep:libtsan=libtsan$(TSAN_SONAME)$(LS)$(AQ) (>= $${gcc:Version})' \
 
1001
                >> debian/substvars.local.tmp
 
1002
endif
 
1003
ifeq ($(with_qmath),yes)
 
1004
        echo 'dep:libqmath=libquadmath$(QUADMATH_SONAME)$(LS)$(AQ) (>= $${gcc:Version})' \
 
1005
                >> debian/substvars.local.tmp
 
1006
endif
 
1007
ifeq ($(multilib),yes)
 
1008
        echo 'dep:libgfortranbiarchdev=$(libgfortranbiarchdev)' \
 
1009
                >> debian/substvars.local.tmp
 
1010
        echo 'dep:libobjcbiarchdev=$(libobjcbiarchdev)' \
 
1011
                >> debian/substvars.local.tmp
 
1012
  ifeq ($(with_libssp),yes)
 
1013
        echo 'dep:libsspbiarch=$(libsspbiarch)' \
 
1014
                >> debian/substvars.local.tmp
 
1015
  endif
 
1016
  ifeq ($(with_gomp),yes)
 
1017
        echo 'dep:libgompbiarch=$(libgompbiarch)' \
 
1018
                >> debian/substvars.local.tmp
 
1019
  endif
 
1020
  ifeq ($(with_itm),yes)
 
1021
        echo 'dep:libitmbiarch=$(libitmbiarch)' \
 
1022
                >> debian/substvars.local.tmp
 
1023
  endif
 
1024
  ifeq ($(with_atomic),yes)
 
1025
        echo 'dep:libatomicbiarch=$(libatomicbiarch)' \
 
1026
                >> debian/substvars.local.tmp
 
1027
  endif
 
1028
  ifeq ($(with_libbacktrace),yes)
 
1029
        echo 'dep:libbtracebiarch=$(libbtracebiarch)' \
 
1030
                >> debian/substvars.local.tmp
 
1031
  endif
 
1032
  ifeq ($(with_asan),yes)
 
1033
        echo 'dep:libasanbiarch=$(libasanbiarch)' \
 
1034
                >> debian/substvars.local.tmp
 
1035
  endif
 
1036
  ifeq ($(with_tsan),yes)
 
1037
        #echo 'dep:libtsanbiarch=$(libtsanbiarch)' \
 
1038
        #       >> debian/substvars.local.tmp
 
1039
  endif
 
1040
  ifeq ($(with_qmath),yes)
 
1041
        echo 'dep:libqmathbiarch=$(libquadmathbiarch)' \
 
1042
                >> debian/substvars.local.tmp
 
1043
  endif
 
1044
  ifeq ($(with_go),yes)
 
1045
        echo 'dep:libgobiarchdev=$(libgobiarchdev)' \
 
1046
                >> debian/substvars.local.tmp
 
1047
        echo 'dep:libgobiarch=$(libgobiarch)' \
 
1048
                >> debian/substvars.local.tmp
 
1049
  endif
 
1050
endif
 
1051
ifneq ($(with_standalone_gcj),yes)
 
1052
  ifneq (,$(filter $(DEB_HOST_ARCH),armel armhf))
 
1053
        echo 'dep:gcj=g++$(pkg_ver) (>= $(DEB_GCC_SOFT_VERSION))' \
 
1054
                >> debian/substvars.local.tmp
 
1055
  else
 
1056
        echo 'dep:gcj=gcc$(pkg_ver) (>= $(DEB_GCC_SOFT_VERSION))' \
 
1057
                >> debian/substvars.local.tmp
 
1058
  endif
 
1059
  ifeq ($(DEB_CROSS),yes)
 
1060
        echo 'dep:gcjcross=gcj$(pkg_ver) (>= $(DEB_GCC_SOFT_VERSION))' \
 
1061
                >> debian/substvars.local.tmp
 
1062
  endif
 
1063
endif
 
1064
ifeq ($(DEB_CROSS),yes)
 
1065
        echo 'dep:gdccross=gdc$(pkg_ver) (>= $(DEB_GCC_SOFT_VERSION))' \
 
1066
                >> debian/substvars.local.tmp
 
1067
endif
 
1068
ifeq ($(with_libphobos),yes)
 
1069
  ifeq ($(DEB_CROSS),yes)
 
1070
        echo 'dep:gdccross=gdc$(pkg_ver) (>= $(DEB_GCC_SOFT_VERSION))' \
 
1071
                >> debian/substvars.local.tmp
 
1072
  else
 
1073
        echo 'dep:phobosdev=libphobos$(pkg_ver)-dev (>= $(DEB_GCC_SOFT_VERSION))' \
 
1074
                >> debian/substvars.local.tmp
 
1075
  endif
 
1076
endif
 
1077
#ifneq (,$(findstring gtk, $(java_awt_peers)))
 
1078
#       echo 'pkg:gcjgtk=libgcj$(subst 0,,$(GCJ_SONAME))-awt-gtk (>= $(DEB_GCJ_VERSION))' \
 
1079
#               >> debian/substvars.local.tmp
 
1080
#endif
 
1081
#ifneq (,$(findstring qt, $(java_awt_peers)))
 
1082
#       echo 'pkg:gcjqt=libgcj$(subst 0,,$(GCJ_SONAME))-awt-qt (>= $(DEB_GCJ_VERSION))' \
 
1083
#               >> debian/substvars.local.tmp
 
1084
#endif
 
1085
ifeq ($(DEB_HOST_ARCH),hppa)
 
1086
        echo 'dep:prctl=prctl' >> debian/substvars.local.tmp
 
1087
endif
 
1088
ifeq ($(derivative)-$(DEB_HOST_ARCH),Debian-amd64)
 
1089
        echo 'confl:lib32=libc6-i386 (<< 2.9-22)' >> debian/substvars.local.tmp
 
1090
endif
 
1091
ifeq ($(with_multiarch_lib),yes)
 
1092
        echo 'multiarch:breaks=gcc-4.1, gcc-4.3 (<< 4.3.6-1), gcc-4.4 (<< 4.4.6-4), gcc-4.5 (<< 4.5.3-2)' >> debian/substvars.local.tmp
 
1093
endif
 
1094
ifeq ($(add_built_using),yes)
 
1095
        echo "Built-Using=$(shell dpkg-query -f '$${source:Package} (= $${source:Version}), ' -W gcc$(pkg_ver)-source)" \
 
1096
        >> debian/substvars.local.tmp
 
1097
endif
 
1098
        v=`sed -n '/^#define MOD_VERSION/s/.* "\([0-9]*\)"/\1/p' \
 
1099
                $(srcdir)/gcc/fortran/module.c`; \
 
1100
        echo "fortran:mod-version=gfortran-mod-$$v" >> debian/substvars.local.tmp
 
1101
 
 
1102
        [ -e debian/substvars.local ] \
 
1103
          && cmp -s debian/substvars.local debian/substvars.local.tmp \
 
1104
          && rm -f debian/substvars.local.tmp && exit 0; \
 
1105
          mv debian/substvars.local.tmp debian/substvars.local; \
 
1106
          touch $(control_stamp)
 
1107
 
 
1108
parameters-file:
 
1109
        rm -f debian/rules.parameters.tmp
 
1110
        ( \
 
1111
                echo '# configuration parameters taken from upstream source files'; \
 
1112
                echo 'GCC_VERSION       := $(GCC_VERSION)'; \
 
1113
                echo 'NEXT_GCC_VERSION  := $(NEXT_GCC_VERSION)'; \
 
1114
                echo 'BASE_VERSION      := $(BASE_VERSION)'; \
 
1115
                echo 'SOURCE_VERSION    := $(SOURCE_VERSION)'; \
 
1116
                echo 'DEB_VERSION       := $(DEB_VERSION)'; \
 
1117
                echo 'DEB_EVERSION      := $(DEB_EVERSION)'; \
 
1118
                echo 'DEB_GDC_VERSION   := $(DEB_GDC_VERSION)'; \
 
1119
                echo 'DEB_SOVERSION     := $(DEB_SOVERSION)'; \
 
1120
                echo 'DEB_SOEVERSION    := $(DEB_SOEVERSION)'; \
 
1121
                echo 'DEB_LIBGCC_SOVERSION      := $(DEB_LIBGCC_SOVERSION)'; \
 
1122
                echo 'DEB_LIBGCC_VERSION        := $(DEB_LIBGCC_VERSION)'; \
 
1123
                echo 'DEB_STDCXX_SOVERSION      := $(DEB_STDCXX_SOVERSION)'; \
 
1124
                echo 'DEB_GCJ_SOVERSION := $(DEB_GCJ_SOVERSION)'; \
 
1125
                echo 'PKG_GCJ_EXT       := $(PKG_GCJ_EXT)'; \
 
1126
                echo 'PKG_LIBGCJ_EXT    := $(PKG_LIBGCJ_EXT)'; \
 
1127
                echo 'DEB_GOMP_SOVERSION        := $(DEB_GOMP_SOVERSION)'; \
 
1128
                echo 'DEB_GCCMATH_SOVERSION     := $(DEB_GCCMATH_SOVERSION)'; \
 
1129
                echo 'GCC_SONAME        := $(GCC_SONAME)'; \
 
1130
                echo 'CXX_SONAME        := $(CXX_SONAME)'; \
 
1131
                echo 'FORTRAN_SONAME    := $(FORTRAN_SONAME)'; \
 
1132
                echo 'OBJC_SONAME       := $(OBJC_SONAME)'; \
 
1133
                echo 'GCJ_SONAME        := $(GCJ_SONAME)'; \
 
1134
                echo 'GDC_VERSION       := $(GDC_VERSION)'; \
 
1135
                echo 'GNAT_VERSION      := $(GNAT_VERSION)'; \
 
1136
                echo 'GNAT_SONAME       := $(GNAT_SONAME)'; \
 
1137
                echo 'FFI_SONAME        := $(FFI_SONAME)'; \
 
1138
                echo 'SSP_SONAME        := $(SSP_SONAME)'; \
 
1139
                echo 'GOMP_SONAME       := $(GOMP_SONAME)'; \
 
1140
                echo 'ITM_SONAME        := $(ITM_SONAME)'; \
 
1141
                echo 'ATOMIC_SONAME     := $(ATOMIC_SONAME)'; \
 
1142
                echo 'BTRACE_SONAME     := $(BTRACE_SONAME)'; \
 
1143
                echo 'ASAN_SONAME       := $(ASAN_SONAME)'; \
 
1144
                echo 'TSAN_SONAME       := $(TSAN_SONAME)'; \
 
1145
                echo 'QMATH_SONAME      := $(QUADMATH_SONAME)'; \
 
1146
                echo 'GCCMATH_SONAME    := $(GCCMATH_SONAME)'; \
 
1147
                echo 'GO_SONAME         := $(GO_SONAME)'; \
 
1148
                echo 'LIBC_DEP          := $(LIBC_DEP)'; \
 
1149
        ) > debian/rules.parameters.tmp
 
1150
        [ -e debian/rules.parameters ] \
 
1151
          && cmp -s debian/rules.parameters debian/rules.parameters.tmp \
 
1152
          && rm -f debian/rules.parameters.tmp && exit 0; \
 
1153
          mv debian/rules.parameters.tmp debian/rules.parameters; \
 
1154
          touch $(control_stamp)
 
1155
 
 
1156
symbols-files:
 
1157
ifeq ($(DEB_CROSS),yes)
 
1158
  ifneq ($(with_deps_on_target_arch_pkgs),yes)
 
1159
        for f in debian/*.symbols; do \
 
1160
          [ -f "$$f" ] || continue; \
 
1161
          [ -L "$$f" ] && continue; \
 
1162
          b=$$(basename $$f .symbols); \
 
1163
          ln -sf $$f debian/$$b$(LS).symbols; \
 
1164
        done
 
1165
        for f in debian/*.symbols.$(DEB_TARGET_ARCH); do \
 
1166
          [ -f "$$f" ] || continue; \
 
1167
          [ -L "$$f" ] && continue; \
 
1168
          b=$$(basename $$f .symbols.$(DEB_TARGET_ARCH)); \
 
1169
          ln -sf $$f debian/$$b$(LS).symbols; \
 
1170
        done
 
1171
  endif
 
1172
endif
 
1173
 
 
1174
versioned-files:
 
1175
        fs=`echo debian/*BV* debian/*GCJ* debian/*CXX* debian/*LC* | sort -u`; \
 
1176
        for f in $$fs debian/source.lintian-overrides.in; do \
 
1177
          [ -f $$f ] || echo "CANNOT FIND $$f"; \
 
1178
          [ -f $$f ] || continue; \
 
1179
          if [ -z "$(DEB_CROSS)" ]; then case "$$f" in *-CR*) continue; esac; fi; \
 
1180
          f2=$$(echo $$f \
 
1181
                | sed 's/BV/$(BASE_VERSION)/;s/CXX/$(CXX_SONAME)/;s/LGCJ/$(PKG_LIBGCJ_EXT)/;s/GCJ/$(PKG_GCJ_EXT)/;s/LC/$(GCC_SONAME)/;s/-CRB/$(cross_bin_arch)/;s/\.in$$//'); \
 
1182
          sed -e 's/@BV@/$(BASE_VERSION)/g' \
 
1183
              -e 's/@CXX@/$(CXX_SONAME)/g' \
 
1184
              -e 's/@LGCJ@/$(PKG_LIBGCJ_EXT)/g' \
 
1185
              -e 's/@GCJ@/$(PKG_GCJ_EXT)/g' \
 
1186
              -e 's/@GCJSO@/$(GCJ_SONAME)/g' \
 
1187
              -e 's/@LC@/$(GCC_SONAME)/g' \
 
1188
              -e 's/@SRC@/$(PKGSOURCE)/g' \
 
1189
              -e 's/@GFDL@/$(if $(filter yes,$(GFDL_INVARIANT_FREE)),#)/g' \
 
1190
              -e 's/@java_priority@/$(java_priority)/g' \
 
1191
              -e 's/@gcc_priority@/$(subst .,,$(BASE_VERSION))/g' \
 
1192
              -e 's/@TARGET@/$(DEB_TARGET_GNU_TYPE)/g' \
 
1193
              -e 's/@TARGET_QUAL@/$(TARGET_QUAL)/g' \
 
1194
            $$f > $$f2; \
 
1195
          touch -r $$f $$f2; \
 
1196
        done
 
1197
        for t in ar nm ranlib; do \
 
1198
          sed "s/@BV@/$(BASE_VERSION)/g;s/@TOOL@/$$t/g" \
 
1199
            debian/gcc-XX-BV.1 > debian/gcc-$$t-$(BASE_VERSION).1; \
 
1200
        done
 
1201
 
 
1202
# don't encode versioned build dependencies in the control file, but check
 
1203
# these here instead.
 
1204
check-versions:
 
1205
        v=$$(dpkg-query -l dpkg-dev | awk '/^.i/ {print $$3}'); \
 
1206
        if dpkg --compare-versions "$$v" lt "$(DPKGV)"; then \
 
1207
          echo "dpkg-dev (>= $(DPKGV)) required, found $$v"; \
 
1208
          exit 1; \
 
1209
        fi
 
1210
        v=$$(dpkg-query -l binutils binutils-multiarch | awk '/^.i/ {print $$3;exit}'); \
 
1211
        if dpkg --compare-versions "$$v" lt "$(BINUTILSBDV)"; then \
 
1212
          echo "binutils (>= $(BINUTILSBDV)) required, found $$v"; \
 
1213
          exit 1; \
 
1214
        fi