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

« back to all changes in this revision

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