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

« back to all changes in this revision

Viewing changes to .svn/pristine/8b/8b7e91a7fa209d34b8f0d4f64f5e96b78e3a5163.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
# definitions used in more than one Makefile / rules file
 
3
 
 
4
# common vars
 
5
SHELL           = /bin/bash -e  # brace expansion used in rules file
 
6
PWD             := $(shell pwd)
 
7
srcdir          = $(PWD)/src
 
8
builddir        = $(PWD)/build
 
9
stampdir        = stamps
 
10
 
 
11
distribution    := $(shell lsb_release -is)
 
12
distrelease     := $(shell lsb_release -cs)
 
13
derivative      := $(shell if dpkg-vendor --derives-from Ubuntu; then echo Ubuntu; \
 
14
                        elif dpkg-vendor --derives-from Debian; then echo Debian; \
 
15
                        else echo Unknown; fi)
 
16
 
 
17
# On non official archives, "lsb_release -cs" default to "n/a". Assume
 
18
# sid in that case 
 
19
ifeq ($(distrelease),n/a)
 
20
distrelease     := sid
 
21
endif
 
22
 
 
23
on_buildd := $(shell [ -f /CurrentlyBuilding -o "$$LOGNAME" = buildd ] && echo yes)
 
24
 
 
25
# creates {srcdir,builddir}_{hppa64,neon}
 
26
$(foreach x,srcdir builddir,$(foreach target,hppa64 neon,$(eval \
 
27
  $(x)_$(target) := $($(x))-$(target))))
 
28
 
 
29
# for architecture dependent variables and changelog vars
 
30
vafilt = $(subst $(2)=,,$(filter $(2)=%,$(1)))
 
31
# for rules.sonames
 
32
vafilt_defined = 1
 
33
 
 
34
DPKG_VARS               := $(shell dpkg-architecture)
 
35
DEB_BUILD_ARCH          ?= $(call vafilt,$(DPKG_VARS),DEB_BUILD_ARCH)
 
36
DEB_BUILD_GNU_TYPE      ?= $(call vafilt,$(DPKG_VARS),DEB_BUILD_GNU_TYPE)
 
37
DEB_BUILD_MULTIARCH     ?= $(call vafilt,$(DPKG_VARS),DEB_BUILD_MULTIARCH)
 
38
DEB_HOST_ARCH           ?= $(call vafilt,$(DPKG_VARS),DEB_HOST_ARCH)
 
39
DEB_HOST_GNU_CPU        ?= $(call vafilt,$(DPKG_VARS),DEB_HOST_GNU_CPU)
 
40
DEB_HOST_GNU_SYSTEM     ?= $(call vafilt,$(DPKG_VARS),DEB_HOST_GNU_SYSTEM)
 
41
DEB_HOST_GNU_TYPE       ?= $(call vafilt,$(DPKG_VARS),DEB_HOST_GNU_TYPE)
 
42
DEB_HOST_MULTIARCH      ?= $(call vafilt,$(DPKG_VARS),DEB_HOST_MULTIARCH)
 
43
 
 
44
CHANGELOG_VARS := $(shell dpkg-parsechangelog | \
 
45
        sed -n 's/ /_/g;/^[^_]/s/^\([^:]*\):_\(.*\)/\1=\2/p')
 
46
 
 
47
# the name of the source package
 
48
PKGSOURCE := $(call vafilt,$(CHANGELOG_VARS),Source)
 
49
# those are required here too
 
50
SOURCE_VERSION := $(call vafilt,$(CHANGELOG_VARS),Version)
 
51
DEB_VERSION := $(strip $(shell echo $(SOURCE_VERSION) | \
 
52
        sed -e 's/.*://' -e 's/ds[0-9]*//'))
 
53
# epoch used for gcc versions up to 3.3.x, now used for some remaining
 
54
# libraries: libgcc1, libobjc1
 
55
EPOCH := 1
 
56
DEB_EVERSION := $(EPOCH):$(DEB_VERSION)
 
57
BASE_VERSION := $(shell echo $(DEB_VERSION) | sed -e 's/\([1-9]\.[0-9]\).*-.*/\1/')
 
58
 
 
59
# push glibc stack traces into stderr
 
60
export LIBC_FATAL_STDERR_=1
 
61
 
 
62
# ---------------------------------------------------------------------------
 
63
# set target
 
64
# - GNU triplet via DEB_TARGET_GNU_TYPE
 
65
# - Debian arch in debian/target
 
66
# - Debian arch via DEB_GCC_TARGET or GCC_TARGET
 
67
#
 
68
# alias
 
69
ifdef GCC_TARGET
 
70
  DEB_GCC_TARGET := $(GCC_TARGET)
 
71
endif
 
72
ifdef DEB_TARGET_GNU_TYPE
 
73
  TARGET_VARS := $(shell dpkg-architecture -f -t$(DEB_TARGET_GNU_TYPE) 2>/dev/null)
 
74
else
 
75
  # allow debian/target to be used instead of DEB_GCC_TARGET - this was requested
 
76
  # by toolchain-source maintainer
 
77
  DEBIAN_TARGET_FILE := $(strip $(if $(wildcard debian/target),$(shell cat debian/target 2>/dev/null)))
 
78
  ifndef DEB_TARGET_ARCH
 
79
    ifneq (,$(DEBIAN_TARGET_FILE))
 
80
      DEB_TARGET_ARCH := $(DEBIAN_TARGET_FILE)
 
81
    else
 
82
      ifdef DEB_GCC_TARGET
 
83
        DEB_TARGET_ARCH := $(DEB_GCC_TARGET)
 
84
      else
 
85
        DEB_TARGET_ARCH := $(DEB_HOST_ARCH)
 
86
      endif
 
87
    endif
 
88
  endif
 
89
  TARGET_VARS := $(shell dpkg-architecture -f -a$(DEB_TARGET_ARCH) 2>/dev/null)
 
90
endif
 
91
 
 
92
DEB_TARGET_ARCH         ?= $(call vafilt,$(TARGET_VARS),DEB_HOST_ARCH)
 
93
DEB_TARGET_ARCH_OS      ?= $(call vafilt,$(TARGET_VARS),DEB_HOST_ARCH_OS)
 
94
DEB_TARGET_ARCH_CPU     ?= $(call vafilt,$(TARGET_VARS),DEB_HOST_ARCH_CPU)
 
95
DEB_TARGET_GNU_CPU      ?= $(call vafilt,$(TARGET_VARS),DEB_HOST_GNU_CPU)
 
96
DEB_TARGET_GNU_TYPE     ?= $(call vafilt,$(TARGET_VARS),DEB_HOST_GNU_TYPE)
 
97
DEB_TARGET_GNU_SYSTEM   ?= $(call vafilt,$(TARGET_VARS),DEB_HOST_GNU_SYSTEM)
 
98
DEB_TARGET_MULTIARCH    ?= $(call vafilt,$(TARGET_VARS),DEB_HOST_MULTIARCH)
 
99
 
 
100
ifeq ($(DEB_TARGET_ARCH),)
 
101
  $(error Invalid architecure.)
 
102
endif
 
103
 
 
104
# including unversiond symlinks for binaries
 
105
#with_unversioned = yes
 
106
 
 
107
# ---------------------------------------------------------------------------
 
108
# cross-compiler config
 
109
# - typical cross-compiler
 
110
# - reverse cross (built to run on the target)
 
111
# - full canadian
 
112
# - native
 
113
#
 
114
# build != host && host == target : reverse cross (REVERSE_CROSS == yes)
 
115
# build == host && host != target : typical cross (DEB_CROSS == yes)
 
116
# build != host && host != target : canadian (DEB_CROSS == yes)
 
117
# build == host && host == target : native
 
118
ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
 
119
  ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_TARGET_GNU_TYPE))
 
120
    # cross building a cross compiler, untested.
 
121
    DEB_CROSS = yes
 
122
  else
 
123
    # cross building the native compiler
 
124
    REVERSE_CROSS = yes
 
125
    ifeq (,$(filter $(distrelease),lenny etch squeeze dapper hardy jaunty karmic lucid))
 
126
      with_sysroot = /
 
127
    endif
 
128
  endif
 
129
else
 
130
  ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_TARGET_GNU_TYPE))
 
131
    # cross compiler, sets WITH_SYSROOT on it's own
 
132
    DEB_CROSS = yes
 
133
    ifeq ($(with_deps_on_target_arch_pkgs),yes)
 
134
      with_sysroot = /
 
135
    endif
 
136
  else
 
137
    # native build
 
138
    # first ones are wheezy and maverick
 
139
    ifeq (,$(filter $(distrelease),lenny etch squeeze dapper hardy jaunty karmic lucid))
 
140
      with_sysroot = /
 
141
    endif
 
142
  endif
 
143
endif
 
144
 
 
145
# ---------------------------------------------------------------------------
 
146
# cross compiler support
 
147
ifeq ($(DEB_CROSS),yes)
 
148
  # TARGET: Alias to DEB_TARGET_ARCH (Debian arch name)
 
149
  # TP: Target Prefix. Used primarily as a prefix for cross tool
 
150
  #     names (e.g. powerpc-linux-gcc).
 
151
  # TS: Target Suffix. Used primarily at the end of cross compiler
 
152
  #     package names (e.g. gcc-powerpc).
 
153
  # LS: Library Suffix. Used primarily at the end of cross compiler
 
154
  #     library package names (e.g. libgcc-powerpc-cross).
 
155
  # AQ: Arch Qualifier. Used for cross-arch dependencies
 
156
  DEB_TARGET_ALIAS ?= $(DEB_TARGET_GNU_TYPE)
 
157
  TARGET := $(DEB_TARGET_ARCH)
 
158
  TP :=  $(subst _,-,$(DEB_TARGET_GNU_TYPE))-
 
159
  TS := -$(subst _,-,$(DEB_TARGET_ALIAS))
 
160
  LS := -$(subst _,-,$(DEB_TARGET_ARCH))-cross
 
161
  AQ :=
 
162
 
 
163
  cross_bin_arch := -$(subst _,-,$(DEB_TARGET_ALIAS))
 
164
  cross_lib_arch := -$(subst _,-,$(DEB_TARGET_ARCH))-cross
 
165
  cmd_prefix := $(DEB_TARGET_GNU_TYPE)-
 
166
 
 
167
  ifeq ($(with_deps_on_target_arch_pkgs),yes)
 
168
    LS :=
 
169
    LS_biarch :=
 
170
    cross_lib_arch :=
 
171
    AQ := :$(TARGET)
 
172
  endif
 
173
 
 
174
  TARGET_ALIAS := $(DEB_TARGET_ALIAS)
 
175
 
 
176
  lib_binaries := indep_binaries
 
177
  cross_shlibdeps =  DEB_HOST_ARCH=$(TARGET) ARCH=$(DEB_TARGET_ARCH) MAKEFLAGS="CC=something"
 
178
  cross_gencontrol = DEB_HOST_ARCH=$(TARGET)
 
179
  cross_makeshlibs = DEB_HOST_ARCH=$(TARGET)
 
180
  cross_clean = DEB_HOST_ARCH=$(TARGET)
 
181
else
 
182
  TARGET_ALIAS := $(DEB_TARGET_GNU_TYPE)
 
183
 
 
184
  ifeq ($(TARGET_ALIAS),i386-gnu)
 
185
    TARGET_ALIAS := i586-gnu
 
186
  endif
 
187
 
 
188
  cmd_prefix :=
 
189
 
 
190
  #ifeq ($(TARGET_ALIAS),i486-linux-gnu)
 
191
  #  TARGET_ALIAS := i686-linux-gnu
 
192
  #endif
 
193
 
 
194
  TARGET_ALIAS := $(subst i386,i486,$(TARGET_ALIAS))
 
195
 
 
196
  # configure as linux-gnu, not linux
 
197
  #ifeq ($(findstring linux,$(TARGET_ALIAS))/$(findstring linux-gnu,$(TARGET_ALIAS)),linux/)
 
198
  #  TARGET_ALIAS := $(TARGET_ALIAS)-gnu
 
199
  #endif
 
200
 
 
201
  # configure as linux, not linux-gnu
 
202
  #TARGET_ALIAS := $(subst linux-gnu,linux,$(TARGET_ALIAS))
 
203
 
 
204
  lib_binaries := arch_binaries
 
205
  cross_shlibdeps :=
 
206
  cross_gencontrol :=
 
207
  cross_makeshlibs :=
 
208
  cross_clean :=
 
209
endif
 
210
 
 
211
printarch:
 
212
        @echo DEB_TARGET_ARCH: $(DEB_TARGET_ARCH)
 
213
        @echo DEB_TARGET_ARCH_OS: $(DEB_TARGET_ARCH_OS)
 
214
        @echo DEB_TARGET_ARCH_CPU: $(DEB_TARGET_ARCH_CPU)
 
215
        @echo DEB_TARGET_GNU_SYSTEM: $(DEB_TARGET_GNU_SYSTEM)
 
216
        @echo DEB_TARGET_MULTIARCH: $(DEB_TARGET_MULTIARCH)
 
217
        @echo MULTIARCH_CONFARG: $(MULTIARCH_CONFARG)
 
218
        @echo TARGET_ALIAS: $(TARGET_ALIAS)
 
219
        @echo TP: $(TP)
 
220
        @echo TS: $(TS)
 
221
 
 
222
# -------------------------------------------------------------------
 
223
# bootstrap options
 
224
ifdef WITH_BOOTSTRAP
 
225
  # "yes" is the default and causes a 3-stage bootstrap.
 
226
  # "off" runs a complete build with --disable-bootstrap
 
227
  # "no" means to just build the first stage, and not create the stage1
 
228
  # directory.
 
229
  # "lean" means a lean 3-stage bootstrap, i.e. delete each stage when no
 
230
  # longer needed.
 
231
  with_bootstrap = $(WITH_BOOTSTRAP)
 
232
endif
 
233
ifneq ($(findstring nostrap, $(DEB_BUILD_OPTIONS)),)
 
234
  with_bootstrap := off
 
235
endif
 
236
 
 
237
# -------------------------------------------------------------------
 
238
# stage options
 
239
ifdef DEB_STAGE
 
240
  with_cdev := yes
 
241
  separate_lang := yes
 
242
  # "stage1" is minimal compiler with static libgcc
 
243
  # "stage2" is minimal compiler with shared libgcc
 
244
  ifeq ($(DEB_STAGE),stage1)
 
245
    with_shared_libgcc := no
 
246
  endif
 
247
  ifeq ($(DEB_STAGE),stage2)
 
248
    with_libgcc := yes
 
249
    with_shared_libgcc := yes
 
250
  endif
 
251
endif
 
252
 
 
253
ifeq ($(BACKPORT),true)
 
254
  with_dev := no
 
255
  with_source := yes
 
256
  with_base_only := yes
 
257
endif
 
258
 
 
259
# -------------------------------------------------------------------
 
260
# sysroot options
 
261
ifdef WITH_SYSROOT
 
262
  with_sysroot = $(WITH_SYSROOT)
 
263
endif
 
264
ifdef WITH_BUILD_SYSROOT
 
265
  with_build_sysroot = $(WITH_BUILD_SYSROOT)
 
266
endif
 
267
 
 
268
# -------------------------------------------------------------------
 
269
# for components configuration
 
270
 
 
271
COMMA = ,
 
272
SPACE = $(EMPTY) $(EMPTY)
 
273
 
 
274
# lang= overwrites all of nolang=, overwrites all of WITHOUT_LANG
 
275
 
 
276
DEB_LANG_OPT    := $(filter lang=%,$(DEB_BUILD_OPTIONS))
 
277
DEB_LANG        := $(strip $(subst $(COMMA), ,$(patsubst lang=%,%,$(DEB_LANG_OPT))))
 
278
DEB_NOLANG_OPT  := $(filter nolang=%,$(DEB_BUILD_OPTIONS))
 
279
DEB_NOLANG      := $(strip $(subst $(COMMA), ,$(patsubst nolang=%,%,$(DEB_NOLANG_OPT))))
 
280
lfilt   = $(strip $(if $(DEB_LANG), \
 
281
                $(if $(filter $(1) $(2),$(DEB_LANG)),yes),$(3)))
 
282
nlfilt  = $(strip $(if $(DEB_NOLANG), \
 
283
                $(if $(filter $(1) $(2),$(DEB_NOLANG)),disabled by $(DEB_NOLANG_OPT),$(3))))
 
284
wlfilt  = $(strip $(if $(filter $(1) $(2), $(subst $(COMMA), ,$(WITHOUT_LANG))), \
 
285
                disabled by WITHOUT_LANG=$(WITHOUT_LANG),$(3)))
 
286
envfilt = $(strip $(or $(call lfilt,$(1),$(2)),$(call nlfilt,$(1),$(3)),$(call wlfilt,$(1),$(3)),$(4)))
 
287
 
 
288
# -------------------------------------------------------------------
 
289
# architecture specific config
 
290
 
 
291
# FIXME: libjava is not ported for thumb, this hack only works for
 
292
# separate gcj builds
 
293
ifeq (,$(findstring gcj,$(PKGSOURCE)))
 
294
  ifeq ($(DEB_TARGET_ARCH),armhf)
 
295
    ifeq ($(distribution),Raspbian)
 
296
      with_arm_thumb := no
 
297
    else
 
298
      with_arm_thumb := yes
 
299
    endif
 
300
  else
 
301
    ifeq ($(derivative)-$(DEB_TARGET_ARCH),Ubuntu-armel)
 
302
      ifneq (,$(filter $(distrelease),lucid maverick natty oneiric precise))
 
303
        with_arm_thumb := yes
 
304
      endif
 
305
    endif
 
306
  endif
 
307
endif
 
308
 
 
309
# build using fsf or linaro
 
310
ifeq ($(distribution),Ubuntu)
 
311
  ifeq (,$(findstring gnat, $(PKGSOURCE)))
 
312
  ifneq (,$(findstring $(DEB_TARGET_ARCH),amd64 i386 arm64 armel armhf))
 
313
    with_linaro_branch = yes
 
314
  endif
 
315
  endif
 
316
endif
 
317
ifeq ($(distribution)-$(DEB_TARGET_ARCH),Debian-arm64)
 
318
  with_linaro_branch = yes
 
319
endif
 
320
 
 
321
# check if we're building for armel or armhf
 
322
ifeq ($(DEB_TARGET_ARCH),armhf)
 
323
  float_abi := hard
 
324
else ifneq (,$(filter $(distribution)-$(DEB_TARGET_ARCH), Ubuntu-armel))
 
325
  ifneq (,$(filter $(distrelease),lucid maverick natty oneiric precise))
 
326
    float_abi := softfp
 
327
  else
 
328
    float_abi := soft
 
329
  endif
 
330
else ifneq (,$(filter $(DEB_TARGET_ARCH), arm armel))
 
331
  float_abi := soft
 
332
endif
 
333
 
 
334
# -------------------------------------------------------------------
 
335
# basic config
 
336
 
 
337
# common things ---------------
 
338
# build common packages, where package names don't differ in different
 
339
# gcc versions (fixincludes, libgcj-common) ...
 
340
with_common_pkgs := yes
 
341
# ... and some libraries, which do not change (libgcc1, libssp0).
 
342
with_common_libs := yes
 
343
# XXX: should with_common_libs be "yes" only if this is the default compiler
 
344
# version on the targeted arch?
 
345
 
 
346
# is this a multiarch-enabled build?
 
347
ifeq (,$(filter $(distrelease),lenny etch squeeze dapper hardy jaunty karmic lucid maverick))
 
348
  with_multiarch_lib := yes
 
349
endif
 
350
 
 
351
ifeq ($(with_multiarch_lib),yes)
 
352
  ifneq ($(single_package),yes)
 
353
    ifeq ($(DEB_CROSS),yes)
 
354
      ifeq ($(with_deps_on_target_arch_pkgs),yes)
 
355
        with_multiarch_cxxheaders := yes
 
356
      endif
 
357
    else
 
358
      with_multiarch_cxxheaders := yes
 
359
    endif
 
360
  endif
 
361
endif
 
362
 
 
363
ifeq (,$(filter $(distrelease),lenny etch squeeze dapper hardy jaunty karmic lucid maverick))
 
364
  multiarch_stage1 := yes
 
365
endif
 
366
 
 
367
# mapping for the non-default biarch multilib / multiarch names
 
368
multiarch_xarch_map = \
 
369
        amd64=i386-linux-gnu,x86_64-linux-gnux32 \
 
370
        armel=arm-linux-gnueabi \
 
371
        armhf=arm-linux-gnueabihf \
 
372
        i386=x86_64-linux-gnu,x86_64-linux-gnux32 \
 
373
        powerpc=powerpc64-linux-gnu \
 
374
        ppc64=powerpc-linux-gnu \
 
375
        sparc=sparc64-linux-gnu \
 
376
        sparc64=sparc-linux-gnu \
 
377
        s390=s390x-linux-gnu \
 
378
        s390x=s390-linux-gnu \
 
379
        mips=mips64-linux-gnuabin32,mips64-linux-gnuabi64 \
 
380
        mipsel=mips64el-linux-gnuabin32,mips64el-linux-gnuabi64 \
 
381
        mipsn32=mips-linux-gnu,mips64-linux-gnuabi64 \
 
382
        mipsn32el=mipsel-linux-gnu,mips64el-linux-gnuabi64 \
 
383
        mips64=mips-linux-gnu,mips64-linux-gnuabin32 \
 
384
        mips64el=mipsel-linux-gnu,mips64el-linux-gnuabin32 \
 
385
        x32=x86_64-linux-gnu,i386-linux-gnu \
 
386
        kfreebsd-amd64=i386-kfreebsd-gnu
 
387
xarch_multiarch_names = $(subst $(COMMA),$(SPACE),$(patsubst $(DEB_TARGET_ARCH)=%,%, \
 
388
                $(filter $(DEB_TARGET_ARCH)=%,$(multiarch_xarch_map))))
 
389
 
 
390
multilib_multiarch_map = \
 
391
        $(DEB_TARGET_ARCH)/=$(DEB_TARGET_MULTIARCH) \
 
392
        amd64/32=i386-linux-gnu \
 
393
        amd64/x32=x86_64-linux-gnux32 \
 
394
        armel/hf=arm-linux-gnueabihf \
 
395
        armhf/sf=arm-linux-gnueabi \
 
396
        i386/64=x86_64-linux-gnu \
 
397
        i386/x32=x86_64-linux-gnux32 \
 
398
        powerpc/64=powerpc64-linux-gnu \
 
399
        ppc64/32=powerpc-linux-gnu \
 
400
        sparc/64=sparc64-linux-gnu \
 
401
        sparc64/32=sparc-linux-gnu \
 
402
        s390/64=s390x-linux-gnu \
 
403
        s390x/32=s390-linux-gnu \
 
404
        mips/n32=mips64-linux-gnuabin32 \
 
405
        mips/64=mips64-linux-gnuabi64 \
 
406
        mipsel/n32=mips64el-linux-gnuabin32 \
 
407
        mipsel/64=mips64el-linux-gnuabi64 \
 
408
        mipsn32/32=mips-linux-gnu \
 
409
        mipsn32/64=mips64-linux-gnuabi64 \
 
410
        mipsn32el/32=mipsel-linux-gnu \
 
411
        mipsn32el/64=mips64el-linux-gnuabi64 \
 
412
        mips64/32=mips-linux-gnu \
 
413
        mips64/n32=mips64-linux-gnuabin32 \
 
414
        mips64el/32=mipsel-linux-gnu \
 
415
        mips64el/n32=mips64el-linux-gnuabin32 \
 
416
        x32/32=i386-linux-gnu \
 
417
        x32/64=x86_64-linux-gnu \
 
418
        kfreebsd-amd64/32=i386-kfreebsd-gnu
 
419
# $(call mlib_to_march,<empty>|32|64|n32|x32|hf|sf)
 
420
mlib_to_march = $(patsubst $(DEB_TARGET_ARCH)/$(1)=%,%, \
 
421
                   $(filter $(DEB_TARGET_ARCH)/$(1)=%,$(multilib_multiarch_map)))
 
422
 
 
423
ifneq ($(DEB_STAGE),stage1)
 
424
  # build a -base package.
 
425
  ifneq ($(DEB_CROSS),yes)
 
426
    with_gccbase := yes
 
427
  else
 
428
    ifneq ($(with_deps_on_target_arch_pkgs),yes)
 
429
      with_gccxbase := yes
 
430
    endif
 
431
  endif
 
432
endif
 
433
 
 
434
# build dev packages.
 
435
with_dev := yes
 
436
 
 
437
with_cpp := yes
 
438
 
 
439
# set lang when built from a different source package.
 
440
separate_lang := no
 
441
 
 
442
ifneq (,$(findstring gcc-snapshot, $(PKGSOURCE)))
 
443
  single_package = yes
 
444
  trunk_build = yes
 
445
  with_linaro_branch =
 
446
else ifneq (,$(findstring gcc-linaro, $(PKGSOURCE)))
 
447
  single_package = yes
 
448
  trunk_build = no
 
449
else
 
450
  # --program-suffix=-$(BASE_VERSION)
 
451
  versioned_packages := yes
 
452
endif
 
453
 
 
454
#no_dummy_cpus := ia64 i386 hppa s390 sparc
 
455
#ifneq (,$(filter $(DEB_TARGET_ARCH_CPU),$(no_dummy_cpus)))
 
456
#  with_base_only       := no
 
457
#  with_common_libs     := yes
 
458
#  with_common_pkgs     := yes
 
459
#else
 
460
#  with_base_only       := yes
 
461
#  with_common_libs     := no
 
462
#  with_common_pkgs     := no
 
463
#  with_dev             := no
 
464
#endif
 
465
 
 
466
ifeq ($(versioned_packages),yes)
 
467
  pkg_ver := -$(BASE_VERSION)
 
468
  PV := $(pkg_ver)
 
469
endif
 
470
 
 
471
# -------------------------------------------------------------------
 
472
# configure languages
 
473
 
 
474
# C ---------------------------
 
475
enabled_languages := c
 
476
 
 
477
# Build all packages needed for C development
 
478
ifneq ($(with_base_only),yes)
 
479
  ifeq ($(with_dev),yes)
 
480
    with_cdev := yes
 
481
  endif
 
482
endif
 
483
 
 
484
ifndef DEB_STAGE
 
485
# Ada --------------------
 
486
ada_no_cpus     := m32r sh3 sh3eb sh4 sh4eb
 
487
ada_no_systems  := 
 
488
ada_no_cross    := yes
 
489
ada_no_snap     := no
 
490
ifneq (,$(filter $(DEB_TARGET_ARCH),arm64 armhf m68k powerpcspe ppc64el sh4 sparc64))
 
491
  ada_no_snap := yes
 
492
endif
 
493
 
 
494
ifeq ($(with_dev),yes)
 
495
  ifneq ($(separate_lang),yes)
 
496
    with_ada := yes
 
497
  endif
 
498
endif
 
499
ifneq (,$(filter $(DEB_TARGET_ARCH_CPU),$(ada_no_cpus)))
 
500
  with_ada := disabled for cpu $(DEB_TARGET_ARCH_CPU)
 
501
endif
 
502
ifneq (,$(findstring $(DEB_TARGET_GNU_SYSTEM),$(ada_no_systems)))
 
503
  with_ada := disabled for system $(DEB_TARGET_GNU_SYSTEM)
 
504
endif
 
505
ifeq ($(ada_no_cross)-$(DEB_CROSS),yes-yes)
 
506
  with_ada := disabled for cross compiler package
 
507
endif
 
508
ifeq ($(ada_no_snap)-$(single_package),yes-yes)
 
509
  with_ada := disabled for snapshot build
 
510
endif
 
511
with_ada := $(call envfilt, ada, , , $(with_ada))
 
512
 
 
513
ifneq ($(single_package),yes)
 
514
  with_separate_gnat := yes
 
515
endif
 
516
ifeq ($(with_ada)-$(with_separate_gnat),yes-yes)
 
517
  ifneq (,$(findstring gnat,$(PKGSOURCE)))
 
518
    languages := c
 
519
    separate_lang := yes
 
520
    with_mudflap := no
 
521
    with_gccbase := no
 
522
    with_cdev := no
 
523
  else
 
524
    debian_extra_langs += ada
 
525
    with_ada := built from separate source
 
526
    with_libgnat := built from separate source
 
527
  endif
 
528
endif
 
529
 
 
530
ifeq ($(with_ada),yes)
 
531
  enabled_languages += ada
 
532
  with_libgnat := yes
 
533
  # There are two exception handling mechanisms: ZCX (Zero-Cost
 
534
  # eXceptions) and SJLJ (setjump/longjump), selected and supported by
 
535
  # libgnat.  Thus we build both versions of libgnat on architectures
 
536
  # that support both (see ada-sjlj.diff).  Most cpus support both
 
537
  # mechanisms; here, we declare the few that support only one.
 
538
  libgnat_zcx_only_cpus :=
 
539
  libgnat_sjlj_only_cpus := arm armel armhf
 
540
  ifneq (,$(filter $(DEB_TARGET_ARCH_CPU),$(libgnat_sjlj_only_cpus)))
 
541
    with_gnat_zcx := no
 
542
  else
 
543
    with_gnat_zcx := yes
 
544
  endif
 
545
  ifneq (,$(filter $(DEB_TARGET_ARCH_CPU),$(libgnat_zcx_only_cpus)))
 
546
    with_gnat_sjlj := no
 
547
  else
 
548
    with_gnat_sjlj := yes
 
549
  endif
 
550
  ifeq ($(with_gnat_zcx)-$(with_gnat_sjlj),no-no)
 
551
    # TODO: support cpus that do not support exceptions at all,
 
552
    # perhaps by building a restricted runtime library?  For now, flag
 
553
    # this as a packaging error.
 
554
    $(error this target supports neither ZCX nor SJLJ)
 
555
  endif
 
556
endif
 
557
 
 
558
# C++ -------------------------
 
559
cxx_no_cpus := avr
 
560
ifneq ($(with_base_only),yes)
 
561
  ifneq ($(separate_lang),yes)
 
562
    with_cxx := yes
 
563
  endif
 
564
endif
 
565
ifneq (,$(findstring $(DEB_TARGET_ARCH_CPU),$(cxx_no_cpus)))
 
566
  with_cxx := disabled for cpu $(DEB_TARGET_ARCH_CPU)
 
567
endif
 
568
with_cxx := $(call envfilt, c++, obj-c++ java, , $(with_cxx))
 
569
 
 
570
# Build all packages needed for C++ development
 
571
ifeq ($(with_cxx),yes)
 
572
  ifeq ($(with_dev),yes)
 
573
    with_cxxdev := yes
 
574
    with_libcxxdbg := yes
 
575
  endif
 
576
  ifeq ($(with_common_pkgs),yes)
 
577
    with_libcxx := yes
 
578
  endif
 
579
 
 
580
  # debugging versions of libstdc++
 
581
  ifneq (,$(findstring gcc-, $(PKGSOURCE)))
 
582
  ifeq ($(with_cxxdev),yes)
 
583
    with_debug := yes
 
584
    debug_no_cpus :=
 
585
    ifneq (,$(findstring $(DEB_TARGET_ARCH_CPU),$(debug_no_cpus)))
 
586
      with_debug := disabled for cpu $(DEB_TARGET_GNU_CPU)
 
587
    endif
 
588
  endif
 
589
  endif
 
590
  with_debug := $(call envfilt, debug, , , $(with_debug))
 
591
 
 
592
  enabled_languages += c++
 
593
endif
 
594
 
 
595
# Java --------------------
 
596
# - To build a standalone gcj package (with no corresponding gcc
 
597
#   package): with_separate_libgcj=yes, with_standalone_gcj=yes
 
598
# - To build the java packages from the gcc source package:
 
599
#   with_separate_libgcj=no, with_standalone_gcj=no
 
600
# - To build gcc and java from separate sources:
 
601
#   with_separate_libgcj=yes, with_standalone_gcj=no
 
602
 
 
603
java_no_cpus := # arm64 mips mipsel
 
604
java_no_systems :=
 
605
 
 
606
ifneq ($(single_package),yes)
 
607
  with_separate_libgcj := yes
 
608
endif
 
609
with_separate_libgcj := no
 
610
with_standalone_gcj := no
 
611
 
 
612
ifneq ($(separate_lang),yes)
 
613
  with_java := yes
 
614
endif
 
615
 
 
616
# java converted for V3 C++ ABI for some archs
 
617
ifeq ($(with_base_only),yes)
 
618
  with_java := no
 
619
endif
 
620
ifneq (,$(filter $(DEB_TARGET_ARCH_CPU),$(java_no_cpus)))
 
621
  with_java := disabled for cpu $(DEB_TARGET_ARCH_CPU)
 
622
endif
 
623
ifneq (,$(filter $(DEB_TARGET_GNU_SYSTEM),$(java_no_systems)))
 
624
  with_java := disabled for system $(DEB_TARGET_GNU_SYSTEM)
 
625
endif
 
626
ifeq ($(java_no_cross)-$(DEB_CROSS),yes-yes)
 
627
  with_java := disabled for cross compiler package
 
628
endif
 
629
with_java := $(call envfilt, java, , c++, $(with_java))
 
630
 
 
631
ifeq ($(with_java)-$(with_separate_libgcj),yes-yes)
 
632
  ifneq (,$(findstring gcj, $(PKGSOURCE)))
 
633
    languages := c c++
 
634
    separate_lang := yes
 
635
  else
 
636
    debian_extra_langs += java
 
637
    with_java := built from separate source
 
638
    with_gcj := built from separate source
 
639
    with_libgcj := buit from separate source
 
640
  endif
 
641
endif
 
642
 
 
643
with_java_plugin := no
 
644
 
 
645
ifeq ($(with_java),yes)
 
646
  # use the same names as OpenJDK
 
647
  java_cpu_map = armel=arm armhf=arm hppa=parisc i686=i386 i586=i386 i486=i386 mipsel=mips mips64=mips mips64el=mips mipsn32=mips mipsn32el=mips powerpc=ppc sh4=sh x32=x32
 
648
  java_cpu = $(patsubst $(DEB_TARGET_ARCH_CPU)=%,%, \
 
649
                         $(filter $(DEB_TARGET_ARCH_CPU)=%,$(java_cpu_map)))
 
650
  ifeq (,$(java_cpu))
 
651
    java_cpu = $(DEB_TARGET_ARCH_CPU)
 
652
  endif
 
653
  java_priority = 10$(subst .,,$(BASE_VERSION))
 
654
 
 
655
  with_libgcj := yes
 
656
  with_libgcjbc := no
 
657
 
 
658
  ifneq (,$(findstring gcj-4,$(PKGSOURCE)))
 
659
    ifneq (,$(filter $(DEB_TARGET_ARCH), arm))
 
660
      with_gcj_base_only := yes
 
661
    endif
 
662
  endif
 
663
 
 
664
  ifeq ($(single_package),yes)
 
665
    with_ecj := yes
 
666
  endif
 
667
 
 
668
  #ifneq (,$(filter $(DEB_TARGET_ARCH),hppa))
 
669
  #  with_native_ecj := yes
 
670
  #endif
 
671
 
 
672
  with_java_maintainer_mode := no
 
673
 
 
674
  # used as well in debian/rules.conf to determine the build deps
 
675
  java_awt_peers = gtk # qt # xlib
 
676
 
 
677
  ifeq ($(with_common_libs),yes)
 
678
    with_libgcj_doc := yes
 
679
  endif
 
680
 
 
681
  # Build all packages needed for Java development (gcj, libgcj-dev)
 
682
  ifeq ($(with_dev),yes)
 
683
    with_javadev := yes
 
684
    with_gcj := yes
 
685
  endif
 
686
 
 
687
  with_java_alsa := yes
 
688
  ifeq (,$(filter $(DEB_TARGET_GNU_SYSTEM),linux-gnu))
 
689
    with_java_alsa := no
 
690
  endif
 
691
 
 
692
  # Just build the cross compiler to be able to cross build a native build.
 
693
  ifeq ($(DEB_CROSS),yes)
 
694
    with_libgcj :=
 
695
  endif
 
696
 
 
697
  enabled_languages += java
 
698
endif
 
699
 
 
700
# Go -------------------
 
701
# - To build a standalone gccgo package (with no corresponding gcc
 
702
#   package): with_separate_libgo=yes, with_standalone_go=yes
 
703
# - To build the go packages from the gcc source package:
 
704
#   with_separate_libgo=no, with_standalone_go=no
 
705
# - To build gcc and go from separate sources:
 
706
#   with_separate_libgo=yes, with_standalone_go=no
 
707
 
 
708
go_no_cross := yes
 
709
go_no_cross := no
 
710
 
 
711
ifneq (,$(findstring gccgo, $(PKGSOURCE)))
 
712
  with_separate_libgo := yes
 
713
  with_standalone_go := yes
 
714
endif
 
715
 
 
716
go_no_cpus := avr arm hppa m68k sh4 sparc sparc64
 
717
ifeq (,$(filter $(distrelease),lenny etch squeeze dapper hardy jaunty karmic lucid maverick natty oneiric))
 
718
  go_no_cpus := $(filter-out arm, $(go_no_cpus))
 
719
endif
 
720
go_no_systems := gnu kfreebsd-gnu
 
721
 
 
722
ifneq ($(with_base_only),yes)
 
723
  ifneq ($(separate_lang),yes)
 
724
    with_go := yes
 
725
  endif
 
726
endif
 
727
ifneq (,$(filter $(DEB_TARGET_ARCH_CPU),$(go_no_cpus)))
 
728
  with_go := disabled for cpu $(DEB_TARGET_ARCH_CPU)
 
729
endif
 
730
ifneq (,$(findstring $(DEB_TARGET_GNU_SYSTEM),$(go_no_systems)))
 
731
  with_go := disabled for system $(DEB_TARGET_GNU_SYSTEM)
 
732
endif
 
733
ifeq ($(go_no_cross)-$(DEB_CROSS),yes-yes)
 
734
  with_go := disabled for cross compiler package
 
735
endif
 
736
with_go := $(call envfilt, go, , , $(with_go))
 
737
 
 
738
# Build all packages needed for Go development
 
739
ifneq (,$(findstring gcc, $(PKGSOURCE)))
 
740
  ifeq ($(with_go),yes)
 
741
    enabled_languages += go
 
742
  endif
 
743
endif
 
744
 
 
745
ifeq ($(with_go)-$(with_separate_libgo),yes-yes)
 
746
  ifneq (,$(findstring gccgo, $(PKGSOURCE)))
 
747
    languages := c c++ go
 
748
    separate_lang := yes
 
749
  else
 
750
    debian_extra_langs += go
 
751
    with_go := built from separate source
 
752
    with_libgo := buit from separate source
 
753
  endif
 
754
endif
 
755
 
 
756
# D ---------------------------
 
757
d_no_cross := yes
 
758
d_no_snap := yes
 
759
d_no_cpus := s390
 
760
 
 
761
ifneq ($(single_package),yes)
 
762
  with_separate_gdc := yes
 
763
endif
 
764
with_separate_gdc := no
 
765
 
 
766
ifneq ($(separate_lang),yes)
 
767
  with_d := yes
 
768
endif
 
769
ifneq (,$(filter $(DEB_TARGET_ARCH_CPU),$(d_no_cpus)))
 
770
  with_d := disabled for cpu $(DEB_TARGET_ARCH_CPU)
 
771
endif
 
772
ifeq ($(d_no_snap)-$(single_package),yes-yes)
 
773
  with_d := disabled for snapshot build
 
774
endif
 
775
with_d := $(call envfilt, d, , , $(with_d))
 
776
 
 
777
ifeq ($(with_base_only),yes)
 
778
  with_d := no
 
779
endif
 
780
 
 
781
ifeq ($(with_d)-$(with_separate_gdc),yes-yes)
 
782
  ifneq (,$(findstring gdc,$(PKGSOURCE)))
 
783
    languages := c c++
 
784
    separate_lang := yes
 
785
 
 
786
    # FIXME: language selection needs improvement.
 
787
    with_go := disabled for d
 
788
  else
 
789
    debian_extra_langs += d
 
790
    with_d := built from separate source
 
791
  endif
 
792
endif
 
793
 
 
794
ifeq ($(with_d),yes)
 
795
  libphobos_archs = armel armhf amd64 i386 x32 kfreebsd-amd64 kfreebsd-i386
 
796
  ifneq (,$(filter $(DEB_TARGET_ARCH), $(libphobos_archs)))
 
797
    with_libphobos := yes
 
798
  endif
 
799
 
 
800
  libphobos_no_cpus := alpha avr arm64 hppa ia64 m68k \
 
801
        mips mipsel mips64 mips64el mipsn32 mipsn32el \
 
802
        powerpc powerpcspe ppc64 ppc64el s390 s390x sh4 sparc sparc64
 
803
  libphobos_no_systems := gnu kfreebsd-gnu
 
804
  ifneq (,$(filter $(DEB_TARGET_ARCH_CPU),$(libphobos_no_cpus)))
 
805
    with_libphobos := disabled for cpu $(DEB_TARGET_ARCH_CPU)
 
806
  endif
 
807
  ifneq (,$(findstring $(DEB_TARGET_GNU_SYSTEM),$(libphobos_no_systems)))
 
808
    with_libphobos := disabled for system $(DEB_TARGET_GNU_SYSTEM)
 
809
  endif
 
810
 
 
811
  enabled_languages += d
 
812
endif
 
813
 
 
814
# Fortran 95 -------------------
 
815
fortran_no_cross := yes
 
816
fortran_no_cross := no
 
817
 
 
818
ifneq ($(with_base_only),yes)
 
819
  ifneq ($(separate_lang),yes)
 
820
    with_fortran := yes
 
821
  endif
 
822
endif
 
823
ifeq ($(fortran_no_cross)-$(DEB_CROSS),yes-yes)
 
824
  with_fortran := disabled for cross compiler package
 
825
endif
 
826
with_fortran := $(call envfilt, fortran, , , $(with_fortran))
 
827
 
 
828
# Build all packages needed for Fortran development
 
829
ifeq ($(with_fortran),yes)
 
830
  ifeq ($(with_dev),yes)
 
831
    with_fdev := yes
 
832
  endif
 
833
  ifeq ($(with_common_libs),yes)
 
834
    with_libgfortran := yes
 
835
  endif
 
836
  enabled_languages += fortran
 
837
endif
 
838
 
 
839
# libquadmath -------------------
 
840
 
 
841
ifneq (,$(findstring $(DEB_TARGET_ARCH_CPU), ia64 i386 i486 i586 i686 amd64))
 
842
  # FIXME: upstream build tied to gfortran build
 
843
  ifeq ($(with_fortran),yes)
 
844
    with_qmath := yes
 
845
    ifneq (,$(findstring gcc-4,$(PKGSOURCE)))
 
846
      ifeq ($(with_common_libs),yes)
 
847
        with_libqmath := yes
 
848
      endif
 
849
    endif
 
850
  endif
 
851
endif
 
852
 
 
853
# ObjC ------------------------
 
854
objc_no_cross := no
 
855
 
 
856
ifneq ($(with_base_only),yes)
 
857
  ifneq ($(separate_lang),yes)
 
858
    with_objc := yes
 
859
    objc_no_archs =
 
860
    ifneq (,$(filter $(DEB_TARGET_ARCH),$(objc_no_archs)))
 
861
      with_objc :=
 
862
    endif
 
863
  endif
 
864
endif
 
865
ifeq ($(objc_no_cross)-$(DEB_CROSS),yes-yes)
 
866
  with_objc := disabled for cross compiler package
 
867
endif
 
868
with_objc := $(call envfilt, objc, obj-c++, , $(with_objc))
 
869
 
 
870
ifeq ($(with_objc),yes)
 
871
  # the ObjC runtime with garbage collection enabled needs the Boehm GC
 
872
  with_objc_gc := yes
 
873
 
 
874
  # disable ObjC garbage collection library (needs libgc)
 
875
  libgc_no_cpus := arm64 avr mips mipsel # alpha amd64 arm armel armhf hppa i386 ia64 m68k mips mipsel powerpc ppc64 s390 s390x sparc
 
876
  libgc_no_systems := knetbsd-gnu
 
877
  ifneq (,$(filter $(DEB_TARGET_ARCH_CPU),$(libgc_no_cpus)))
 
878
    with_objc_gc := disabled for cpu $(DEB_TARGET_ARCH_CPU)
 
879
  endif
 
880
  ifneq (,$(findstring $(DEB_TARGET_GNU_SYSTEM),$(libgc_no_systems)))
 
881
    with_objc_gc := disabled for system $(DEB_TARGET_GNU_SYSTEM)
 
882
  endif
 
883
 
 
884
  # Build all packages needed for Objective-C development
 
885
  ifeq ($(with_dev),yes)
 
886
    with_objcdev := yes
 
887
  endif
 
888
  ifeq ($(with_common_libs),yes)
 
889
    with_libobjc := yes
 
890
  endif
 
891
 
 
892
  enabled_languages += objc
 
893
endif
 
894
 
 
895
# ObjC++ ----------------------
 
896
objcxx_no_cross := no
 
897
 
 
898
ifeq ($(with_objc),yes)
 
899
  ifneq ($(with_base_only),yes)
 
900
    ifneq ($(separate_lang),yes)
 
901
      with_objcxx := yes
 
902
    endif
 
903
  endif
 
904
endif
 
905
ifeq ($(objcxx_no_cross)-$(DEB_CROSS),yes-yes)
 
906
  with_objcxx := disabled for cross compiler package
 
907
endif
 
908
with_objcxx := $(call envfilt, obj-c++, , c++ objc, $(with_objcxx))
 
909
 
 
910
ifeq ($(with_objcxx),yes)
 
911
  enabled_languages += obj-c++
 
912
endif
 
913
 
 
914
# -------------------------------------------------------------------
 
915
# other config
 
916
 
 
917
# not built from the main source package
 
918
ifeq (,$(findstring gcc-,$(PKGSOURCE)))
 
919
  extra_package := yes
 
920
endif
 
921
 
 
922
with_nls := yes
 
923
ifeq ($(trunk_build),yes)
 
924
  with_nls := no
 
925
endif
 
926
with_nls := $(call envfilt, nls, , , $(with_nls))
 
927
 
 
928
# powerpc nof libraries -----
 
929
with_libnof := no
 
930
 
 
931
ifneq (,$(findstring gcc-4,$(PKGSOURCE)))
 
932
  with_source := yes
 
933
endif
 
934
with_source := $(call envfilt, source, , , $(with_source))
 
935
 
 
936
ifeq ($(with_cdev),yes)
 
937
 
 
938
# ssp & libssp -------------------------
 
939
with_ssp := yes
 
940
ssp_no_archs = alpha hppa ia64 m68k
 
941
ifneq (, $(filter $(DEB_TARGET_ARCH),$(ssp_no_archs) $(ssp_no_archs:%=uclibc-%)))
 
942
  with_ssp := not available on $(DEB_TARGET_ARCH)
 
943
endif
 
944
with_ssp := $(call envfilt, ssp, , , $(with_ssp))
 
945
 
 
946
ifeq ($(with_ssp),yes)
 
947
  ifneq ($(derivative),Debian)
 
948
    ifneq (,$(findstring gcc-4, $(PKGSOURCE)))
 
949
      with_ssp_default := yes
 
950
    endif
 
951
  endif
 
952
endif
 
953
 
 
954
# gomp --------------------
 
955
with_gomp := yes
 
956
with_gomp := $(call envfilt, gomp, , , $(with_gomp))
 
957
gomp_no_archs =
 
958
ifneq (,$(filter $(DEB_TARGET_ARCH),$(gomp_no_archs)))
 
959
  with_gomp :=
 
960
endif
 
961
 
 
962
# itm --------------------
 
963
itm_archs = amd64 i386 x32 ppc64 ppc64el
 
964
ifneq (,$(filter $(DEB_TARGET_ARCH),$(itm_archs)))
 
965
  with_itm := yes
 
966
endif
 
967
with_itm := $(call envfilt, itm, , , $(with_itm))
 
968
 
 
969
# atomic --------------------
 
970
with_atomic := yes
 
971
atomic_no_archs =
 
972
ifneq (,$(filter $(DEB_TARGET_ARCH),$(atomic_no_archs)))
 
973
  with_atomic :=
 
974
endif
 
975
 
 
976
# backtrace --------------------
 
977
with_backtrace := yes
 
978
backtrace_no_archs = m68k
 
979
ifneq (,$(filter $(DEB_TARGET_ARCH),$(backtrace_no_archs)))
 
980
  with_backtrace :=
 
981
endif
 
982
 
 
983
# asan / sanitizer --------------------
 
984
with_asan :=
 
985
with_asan := $(call envfilt, asan, , , $(with_asan))
 
986
asan_archs = amd64 armel armhf i386 powerpc ppc64 sparc sparc64 x32
 
987
ifneq (,$(filter $(DEB_TARGET_ARCH),$(asan_archs)))
 
988
  with_asan := yes
 
989
endif
 
990
 
 
991
# tsan / sanitizer --------------------
 
992
with_tsan :=
 
993
with_tsan := $(call envfilt, tsan, , , $(with_tsan))
 
994
tsan_archs = amd64
 
995
ifneq (,$(filter $(DEB_TARGET_ARCH),$(tsan_archs)))
 
996
  with_tsan := yes
 
997
endif
 
998
 
 
999
endif # with_cdev
 
1000
 
 
1001
# gold --------------------
 
1002
# armel with binutils 2.20.51 only
 
1003
gold_archs = amd64 armel armhf i386 lpia powerpc ppc64 sparc sparc64
 
1004
ifneq (,$(filter $(DEB_TARGET_ARCH),$(gold_archs)))
 
1005
  with_gold := yes
 
1006
endif
 
1007
 
 
1008
# plugins --------------------
 
1009
with_plugins := yes
 
1010
 
 
1011
endif # ifndef DEB_STAGE
 
1012
 
 
1013
# Don't include docs with GFDL invariant sections
 
1014
GFDL_INVARIANT_FREE := yes
 
1015
ifeq ($(derivative),Ubuntu)
 
1016
  GFDL_INVARIANT_FREE := no
 
1017
endif
 
1018
 
 
1019
# -------------------------------------------------------------------
 
1020
# non-extra config
 
1021
ifeq ($(extra_package),yes)
 
1022
  ifeq ($(with_separate_libgcj)-$(with_standalone_gcj),yes-no)
 
1023
    # package stuff
 
1024
    with_gccbase := no
 
1025
    with_cdev := no
 
1026
    with_cxx := no
 
1027
    with_cxxdev := no
 
1028
 
 
1029
    ifneq ($(DEB_CROSS),yes)
 
1030
      with_gcjbase := yes
 
1031
    else
 
1032
      with_gcjxbase := yes
 
1033
    endif
 
1034
  endif
 
1035
  ifeq ($(with_separate_libgo),yes)
 
1036
    # package stuff
 
1037
    with_gccbase := yes
 
1038
    with_cdev := no
 
1039
    with_cxx := no
 
1040
    with_cxxdev := no
 
1041
  endif
 
1042
else
 
1043
  # libssp ------------------
 
1044
  ifeq ($(with_ssp)-$(with_common_libs),yes-yes)
 
1045
    #ifneq ($(DEB_CROSS),yes)
 
1046
      with_libssp := $(if $(wildcard $(builddir)/gcc/auto-host.h),$(shell if grep -qs '^\#define TARGET_LIBC_PROVIDES_SSP 1' $(builddir)/gcc/auto-host.h; then echo 'libc provides ssp'; else echo 'yes'; fi))
 
1047
    #endif
 
1048
  endif
 
1049
 
 
1050
  # libgomp -----------------
 
1051
  ifeq ($(with_gomp)-$(with_common_libs),yes-yes)
 
1052
    #ifneq ($(DEB_CROSS),yes)
 
1053
      with_libgomp := yes
 
1054
    #endif
 
1055
  endif
 
1056
 
 
1057
  # libitm -----------------
 
1058
  ifeq ($(with_itm)-$(with_common_libs),yes-yes)
 
1059
    #ifneq ($(DEB_CROSS),yes)
 
1060
      with_libitm := yes
 
1061
    #endif
 
1062
  endif
 
1063
 
 
1064
  # libatomic -----------------
 
1065
  ifeq ($(with_atomic)-$(with_common_libs),yes-yes)
 
1066
    #ifneq ($(DEB_CROSS),yes)
 
1067
      with_libatomic := yes
 
1068
    #endif
 
1069
  endif
 
1070
 
 
1071
  # libbacktrace -----------------
 
1072
  ifeq ($(with_backtrace)-$(with_common_libs),yes-yes)
 
1073
    #ifneq ($(DEB_CROSS),yes)
 
1074
      # currently not a shared library
 
1075
      #with_libbacktrace := yes
 
1076
    #endif
 
1077
  endif
 
1078
 
 
1079
  # libasan -----------------
 
1080
  # soname change in 4.9
 
1081
  ifeq ($(with_asan),yes)
 
1082
  #ifeq ($(with_asan)-$(with_common_libs),yes-yes)
 
1083
    #ifneq ($(DEB_CROSS),yes)
 
1084
      with_libasan := yes
 
1085
    #endif
 
1086
  endif
 
1087
 
 
1088
  # libtsan -----------------
 
1089
  ifeq ($(with_tsan)-$(with_common_libs),yes-yes)
 
1090
    #ifneq ($(DEB_CROSS),yes)
 
1091
      with_libtsan := yes
 
1092
    #endif
 
1093
  endif
 
1094
 
 
1095
  # libquadmath -----------------
 
1096
  ifeq ($(with_qmath)-$(with_common_libs),yes-yes)
 
1097
    #ifneq ($(DEB_CROSS),yes)
 
1098
      with_libqmath := yes
 
1099
    #endif
 
1100
  endif
 
1101
 
 
1102
  # fixincludes -------
 
1103
  ifneq ($(DEB_CROSS),yes)
 
1104
    ifeq ($(with_common_pkgs),yes)
 
1105
      with_fixincl      := yes
 
1106
    endif
 
1107
  endif
 
1108
 
 
1109
  # Shared libgcc --------------------
 
1110
  ifneq ($(DEB_STAGE),stage1)
 
1111
    with_shared_libgcc := yes
 
1112
    ifeq ($(with_common_libs),yes)
 
1113
      with_libgcc := yes
 
1114
    endif
 
1115
    ifneq (,$(filter $(distrelease),trusty))
 
1116
      # built from the gccgo-4.9 package, but not for cross builds
 
1117
      ifneq ($(DEB_CROSS),yes)
 
1118
        with_libgcc :=
 
1119
      endif
 
1120
    endif
 
1121
  endif
 
1122
 
 
1123
  # libgcc-math --------------------
 
1124
  with_libgmath := no
 
1125
  ifneq (,$(findstring i486,$(DEB_TARGET_ARCH)))
 
1126
    #with_libgccmath := yes
 
1127
    #with_lib64gmath := yes
 
1128
    #with_libgmathdev := yes
 
1129
  endif
 
1130
  ifeq ($(DEB_TARGET_ARCH),amd64)
 
1131
    #with_libgccmath := yes
 
1132
    #with_lib32gmath := yes
 
1133
    #with_libgmathdev := yes
 
1134
  endif
 
1135
 
 
1136
  # hppa64 build ----------------
 
1137
  hppa64_no_snap := no
 
1138
  ifeq ($(DEB_TARGET_ARCH),hppa)
 
1139
    with_hppa64 := yes
 
1140
  endif
 
1141
  ifeq ($(hppa64_no_snap)-$(trunk_build),yes-yes)
 
1142
    with_hppa64 := disabled for snapshot build
 
1143
  endif
 
1144
  with_hppa64 := $(call envfilt, hppa64, , , $(with_hppa64))
 
1145
 
 
1146
  # neon build -------------------
 
1147
  # FIXME: build as a cross compiler to build on armv4 as well
 
1148
  ifneq (,$(findstring gcc-4, $(PKGSOURCE)))
 
1149
    ifeq ($(derivative),Ubuntu)
 
1150
#      neon_archs = armel armhf
 
1151
#      ifneq (, $(filter $(DEB_TARGET_ARCH),$(neon_archs)))
 
1152
#        with_neon = yes
 
1153
#      endif
 
1154
    endif
 
1155
  endif
 
1156
endif
 
1157
 
 
1158
# run testsuite ---------------
 
1159
with_check := yes
 
1160
# if you don't want to run the gcc testsuite, uncomment the next line
 
1161
#with_check := disabled by hand
 
1162
ifeq ($(with_base_only),yes)
 
1163
  with_check := no
 
1164
endif
 
1165
ifeq ($(DEB_CROSS),yes)
 
1166
  with_check := disabled for cross compiler package
 
1167
endif
 
1168
ifeq ($(REVERSE_CROSS),yes)
 
1169
  with_check := disabled for reverse cross build
 
1170
endif
 
1171
check_no_cpus := m68k
 
1172
check_no_systems := gnu
 
1173
ifneq (,$(filter $(DEB_TARGET_ARCH_CPU),$(check_no_cpus)))
 
1174
  with_check := disabled for cpu $(DEB_TARGET_ARCH_CPU)
 
1175
endif
 
1176
ifneq (,$(findstring $(DEB_TARGET_GNU_SYSTEM),$(check_no_systems)))
 
1177
  with_check := disabled for system $(DEB_TARGET_GNU_SYSTEM)
 
1178
endif
 
1179
ifeq ($(derivative)-$(DEB_HOST_ARCH),Ubuntu-hppa)
 
1180
  ifneq ($(single_package),yes)
 
1181
    with_check := disabled, testsuite timeouts with expect
 
1182
  endif
 
1183
endif
 
1184
ifneq (,$(findstring gdc,$(PKGSOURCE)))
 
1185
  with_check := disabled for D
 
1186
endif
 
1187
with_check := $(call envfilt, check, , , $(with_check))
 
1188
ifdef WITHOUT_CHECK
 
1189
  with_check := disabled by environment
 
1190
endif
 
1191
ifneq ($(findstring nocheck, $(DEB_BUILD_OPTIONS)),)
 
1192
  with_check := disabled by DEB_BUILD_OPTIONS
 
1193
endif
 
1194
ifneq (,$(filter $(DEB_HOST_ARCH), hppa))
 
1195
  ifneq ($(single_package),yes)
 
1196
    with_check := disabled for $(DEB_HOST_ARCH), testsuite timeouts with expect
 
1197
  endif
 
1198
endif
 
1199
#with_check := disabled for this upload
 
1200
 
 
1201
# not a dependency on all archs, but if available, use it for the testsuite
 
1202
ifneq (,$(wildcard /usr/bin/localedef))
 
1203
  locale_data = generate
 
1204
endif
 
1205
 
 
1206
all_enabled_languages := $(enabled_languages)
 
1207
languages_without_lang_opt := c++ objc obj-c++
 
1208
 
 
1209
debian_extra_langs := $(subst obj-c++,objcp,$(debian_extra_langs))
 
1210
export debian_extra_langs
 
1211
 
 
1212
# multilib
 
1213
biarch_map := i686=x86_64 powerpc=powerpc64 sparc=sparc64 sparc64=sparc s390=s390x s390x=s390 \
 
1214
                x86_64=i686 powerpc64=powerpc mips=mips64 mipsel=mips64el \
 
1215
                mips64=mips mips64el=mipsel mipsn32=mips mipsn32el=mipsel
 
1216
ifneq (,$(filter $(derivative),Ubuntu))
 
1217
  ifeq (,$(filter $(distrelease),dapper hardy jaunty karmic lucid))
 
1218
    biarch_map := $(subst i686=,i486=,$(biarch_map))
 
1219
  endif
 
1220
else # Debian
 
1221
  biarch_map := $(subst i686=,i486=,$(biarch_map))
 
1222
endif
 
1223
 
 
1224
ifeq ($(derivative),Ubuntu)
 
1225
  ifeq (,$(filter $(distrelease),dapper hardy jaunty karmic lucid maverick natty))
 
1226
    biarch_map += arm=arm
 
1227
  endif
 
1228
endif
 
1229
biarch_cpu := $(strip $(patsubst $(DEB_TARGET_GNU_CPU)=%,%, \
 
1230
                         $(filter $(DEB_TARGET_GNU_CPU)=%,$(biarch_map))))
 
1231
 
 
1232
biarch64 := no
 
1233
biarch32 := no
 
1234
biarchn32 := no
 
1235
biarchx32 := no
 
1236
biarchhf := no
 
1237
biarchsf := no
 
1238
flavours :=
 
1239
define gen_biarch
 
1240
  ifneq (yes,$$(call envfilt, biarch, , ,yes))
 
1241
    biarch$1archs :=
 
1242
  endif
 
1243
  ifneq (,$$(findstring /$$(DEB_TARGET_ARCH)/,$$(biarch$1archs)))
 
1244
    biarch$1 := yes
 
1245
    flavours += $1
 
1246
    #biarch$1subdir = $$(biarch_cpu)-$$(DEB_TARGET_GNU_SYSTEM)
 
1247
    biarch$1subdir = $1
 
1248
    ifeq ($$(with_libgcc),yes)
 
1249
      with_lib$1gcc := yes
 
1250
    endif
 
1251
    ifeq ($$(with_cdev),yes)
 
1252
      with_lib$1gccdev := yes
 
1253
    endif
 
1254
    ifeq ($$(with_libcxx),yes)
 
1255
      with_lib$1cxx := yes
 
1256
    endif
 
1257
    ifeq ($$(with_libcxxdbg),yes)
 
1258
      with_lib$1cxxdbg := yes
 
1259
    endif
 
1260
    ifeq ($$(with_cxxdev),yes)
 
1261
      with_lib$1cxxdev := yes
 
1262
    endif
 
1263
    ifeq ($$(with_libobjc),yes)
 
1264
      with_lib$1objc := yes
 
1265
    endif
 
1266
    ifeq ($$(with_objcdev),yes)
 
1267
      with_lib$1objcdev := yes
 
1268
    endif
 
1269
    ifeq ($$(with_libgfortran),yes)
 
1270
      with_lib$1gfortran := yes
 
1271
    endif
 
1272
    ifeq ($$(with_fdev),yes)
 
1273
      with_lib$1gfortrandev := yes
 
1274
    endif
 
1275
    ifeq ($$(with_libssp),yes)
 
1276
      with_lib$1ssp := yes
 
1277
    endif
 
1278
    ifeq ($$(with_libgomp),yes)
 
1279
      with_lib$1gomp:= yes
 
1280
    endif
 
1281
    ifeq ($$(with_libitm),yes)
 
1282
      with_lib$1itm:= yes
 
1283
    endif
 
1284
    ifeq ($$(with_libatomic),yes)
 
1285
      with_lib$1atomic:= yes
 
1286
    endif
 
1287
    ifeq ($$(with_libbacktrace),yes)
 
1288
      with_lib$1backtrace:= yes
 
1289
    endif
 
1290
    ifeq ($$(with_libasan),yes)
 
1291
      with_lib$1asan:= yes
 
1292
    endif
 
1293
    ifeq ($$(with_libtsan),yes)
 
1294
      with_lib$1tsan:= yes
 
1295
    endif
 
1296
    ifeq ($$(with_libqmath),yes)
 
1297
      with_lib$1qmath := yes
 
1298
    endif
 
1299
    ifeq ($$(with_libgo),yes)
 
1300
      with_lib$1go := yes
 
1301
    endif
 
1302
 
 
1303
    biarch_multidir_names = libiberty libgcc
 
1304
    ifneq (,$$(findstring gcc-, $$(PKGSOURCE)))
 
1305
      biarch_multidir_names += libstdc++-v3 libobjc libgfortran libssp \
 
1306
                                libgomp zlib libitm \
 
1307
                                libbacktrace libatomic libsanitizer
 
1308
      ifeq ($$(with_objc_gc),yes)
 
1309
        biarch_multidir_names += boehm-gc
 
1310
      endif
 
1311
    endif
 
1312
    ifneq (,$(findstring yes, $(with_java) $(with_go)))
 
1313
      biarch_multidir_names += libffi
 
1314
    endif
 
1315
    ifeq ($(with_fortran),yes)
 
1316
      biarch_multidir_names += libquadmath
 
1317
    endif
 
1318
    ifeq ($(with_go),yes)
 
1319
      biarch_multidir_names += libgo
 
1320
    endif
 
1321
    ifeq ($(with_d),yes)
 
1322
      biarch_multidir_names += libphobos
 
1323
    endif
 
1324
    ifeq ($$(PKGSOURCE),gcc-snapshot)
 
1325
      biarch_multidir_names += libcilkrts libvtv
 
1326
    endif
 
1327
    export biarch_multidir_names
 
1328
    ifneq (,$$(findstring 32,$1))
 
1329
      TARGET64_MACHINE := $$(strip $$(subst $$(DEB_TARGET_GNU_CPU),$$(biarch_cpu), \
 
1330
                                $$(TARGET_ALIAS)))
 
1331
      TARGET32_MACHINE := $$(TARGET_ALIAS)
 
1332
    else
 
1333
      TARGET64_MACHINE := $$(TARGET_ALIAS)
 
1334
      TARGET64_MACHINE := $$(strip $$(subst $$(DEB_TARGET_GNU_CPU),$$(biarch_cpu), \
 
1335
                                $$(TARGET_ALIAS)))
 
1336
    endif
 
1337
    export TARGET32_MACHINE
 
1338
    export TARGET64_MACHINE
 
1339
  endif
 
1340
endef
 
1341
biarch32archs := /amd64/ppc64/kfreebsd-amd64/s390x/sparc64/x32/mipsn32/mipsn32el/mips64/mips64el/
 
1342
biarch64archs := /i386/powerpc/sparc/s390/mips/mipsel/mipsn32/mipsn32el/x32/
 
1343
biarchn32archs := /mips/mipsel/mips64/mips64el/
 
1344
ifeq ($(derivative),Ubuntu)
 
1345
  ifeq (,$(filter $(distrelease),dapper hardy jaunty karmic lucid maverick natty))
 
1346
    biarchhfarchs := /armel/
 
1347
    biarchsfarchs := /armhf/
 
1348
  endif
 
1349
  ifeq (,$(filter $(distrelease),dapper hardy jaunty karmic lucid maverick natty oneiric precise quantal))
 
1350
    biarchx32archs := /amd64/i386/
 
1351
  endif
 
1352
endif
 
1353
ifeq ($(derivative),Debian)
 
1354
  ifeq (,$(filter $(distrelease),etch squeeze wheezy))
 
1355
    biarchx32archs := /amd64/i386/
 
1356
  endif
 
1357
endif
 
1358
$(foreach x,32 64 n32 x32 hf sf,$(eval $(call gen_biarch,$(x))))
 
1359
 
 
1360
#ifeq ($(DEB_TARGET_ARCH),ia64)
 
1361
#  biarch32 := yes
 
1362
#endif
 
1363
 
 
1364
#ifeq ($(trunk_build),yes)
 
1365
#  no_biarch_libs := yes
 
1366
#endif
 
1367
ifdef DEB_CROSS_NO_BIARCH
 
1368
  no_biarch_libs := yes
 
1369
endif
 
1370
 
 
1371
ifeq ($(no_biarch_libs),yes)
 
1372
  with_lib64gcc         := no
 
1373
  with_lib64cxx         := no
 
1374
  with_lib64cxxdbg      := no
 
1375
  with_lib64objc        := no
 
1376
  with_lib64ffi         := no
 
1377
  with_lib64gcj         := no
 
1378
  with_lib64gfortran    := no
 
1379
  with_lib64ssp         := no
 
1380
  with_lib64go          := no
 
1381
  with_lib64gomp        := no
 
1382
  with_lib64itm         := no
 
1383
  with_lib64qmath       := no
 
1384
  with_lib64atomic      := no
 
1385
  with_lib64backtrace   := no
 
1386
  with_lib64asan        := no
 
1387
  with_lib64tsan        := no
 
1388
  with_lib64gccdev      := no
 
1389
  with_lib64cxxdev      := no
 
1390
  with_lib64objcdev     := no
 
1391
  with_lib64gfortrandev := no
 
1392
 
 
1393
  with_lib32gcc         := no
 
1394
  with_lib32cxx         := no
 
1395
  with_lib32cxxdbg      := no
 
1396
  with_lib32objc        := no
 
1397
  with_lib32ffi         := no
 
1398
  with_lib32gcj         := no
 
1399
  with_lib32gfortran    := no
 
1400
  with_lib32ssp         := no
 
1401
  with_lib32go          := no
 
1402
  with_lib32gomp        := no
 
1403
  with_lib32itm         := no
 
1404
  with_lib32qmath       := no
 
1405
  with_lib32atomic      := no
 
1406
  with_lib32backtrace   := no
 
1407
  with_lib32asan        := no
 
1408
  with_lib32tsan        := no
 
1409
  with_lib32gccdev      := no
 
1410
  with_lib32cxxdev      := no
 
1411
  with_lib32objcdev     := no
 
1412
  with_lib32gfortrandev := no
 
1413
 
 
1414
  with_libn32gcc        := no
 
1415
  with_libn32cxx        := no
 
1416
  with_libn32cxxdbg     := no
 
1417
  with_libn32objc       := no
 
1418
  with_libn32ffi        := no
 
1419
  with_libn32gcj        := no
 
1420
  with_libn32gfortran   := no
 
1421
  with_libn32ssp        := no
 
1422
  with_libn32go         := no
 
1423
  with_libn32gomp       := no
 
1424
  with_libn32itm        := no
 
1425
  with_libn32qmath      := no
 
1426
  with_libn32atomic     := no
 
1427
  with_libn32backtrace  := no
 
1428
  with_libn32asan       := no
 
1429
  with_libn32tsan       := no
 
1430
  with_libn32gccdev     := no
 
1431
  with_libn32cxxdev     := no
 
1432
  with_libn32objcdev    := no
 
1433
  with_libn32gfortrandev:= no
 
1434
 
 
1435
  with_libx32gcc        := no
 
1436
  with_libx32cxx        := no
 
1437
  with_libx32cxxdbg     := no
 
1438
  with_libx32objc       := no
 
1439
  with_libx32ffi        := no
 
1440
  with_libx32gcj        := no
 
1441
  with_libx32gfortran   := no
 
1442
  with_libx32ssp        := no
 
1443
  with_libx32go         := no
 
1444
  with_libx32gomp       := no
 
1445
  with_libx32itm        := no
 
1446
  with_libx32qmath      := no
 
1447
  with_libx32atomic     := no
 
1448
  with_libx32backtrace  := no
 
1449
  with_libx32asan       := no
 
1450
  with_libx32tsan       := no
 
1451
  with_libx32gccdev     := no
 
1452
  with_libx32cxxdev     := no
 
1453
  with_libx32objcdev    := no
 
1454
  with_libx32gfortrandev:= no
 
1455
 
 
1456
  with_libhfgcc         := no
 
1457
  with_libhfcxx         := no
 
1458
  with_libhfcxxdbg      := no
 
1459
  with_libhfobjc        := no
 
1460
  with_libhfffi         := no
 
1461
  with_libhfgcj         := no
 
1462
  with_libhfgfortran    := no
 
1463
  with_libhfssp         := no
 
1464
  with_libhfgo          := no
 
1465
  with_libhfgomp        := no
 
1466
  with_libhfitm         := no
 
1467
  with_libhfqmath       := no
 
1468
  with_libhfatomic      := no
 
1469
  with_libhfbacktrace   := no
 
1470
  with_libhfasan        := no
 
1471
  with_libhftsan        := no
 
1472
  with_libhfgccdev      := no
 
1473
  with_libhfcxxdev      := no
 
1474
  with_libhfobjcdev     := no
 
1475
  with_libhfgfortrandev := no
 
1476
 
 
1477
  with_libsfgcc         := no
 
1478
  with_libsfcxx         := no
 
1479
  with_libsfcxxdbg      := no
 
1480
  with_libsfobjc        := no
 
1481
  with_libsfffi         := no
 
1482
  with_libsfgcj         := no
 
1483
  with_libsfgfortran    := no
 
1484
  with_libsfssp         := no
 
1485
  with_libsfgo          := no
 
1486
  with_libsfgomp        := no
 
1487
  with_libsfitm         := no
 
1488
  with_libsfqmath       := no
 
1489
  with_libsfatomic      := no
 
1490
  with_libsfbacktrace   := no
 
1491
  with_libsfasan        := no
 
1492
  with_libsftsan        := no
 
1493
  with_libsfgccdev      := no
 
1494
  with_libsfcxxdev      := no
 
1495
  with_libsfobjcdev     := no
 
1496
  with_libsfgfortrandev := no
 
1497
 
 
1498
  with_java_plugin := no
 
1499
 
 
1500
  ifdef DEB_CROSS_NO_BIARCH
 
1501
    biarch64    := disabled by DEB_CROSS_NO_BIARCH
 
1502
    biarch32    := disabled by DEB_CROSS_NO_BIARCH
 
1503
    biarchn32   := disabled by DEB_CROSS_NO_BIARCH
 
1504
    biarchx32   := disabled by DEB_CROSS_NO_BIARCH
 
1505
    biarchhf    := disabled by DEB_CROSS_NO_BIARCH
 
1506
    biarchsf    := disabled by DEB_CROSS_NO_BIARCH
 
1507
  endif
 
1508
 
 
1509
  ifeq ($(with_ada)-$(with_separate_gnat),yes-yes)
 
1510
    biarchhf    := disabled for Ada
 
1511
    biarchsf    := disabled for Ada
 
1512
  endif
 
1513
 
 
1514
endif
 
1515
 
 
1516
ifneq (,$(filter yes,$(biarch32) $(biarch64) $(biarchn32) $(biarchx32) $(biarchhf) $(biarchsf)))
 
1517
  multilib := yes
 
1518
endif
 
1519
 
 
1520
multilib_archs = $(sort $(subst /, , $(biarch64archs) $(biarch32archs) $(biarchn32archs) $(biarchx32archs) $(biarchhfarchs) $(biarchsfarchs)))
 
1521
 
 
1522
biarchsubdirs := \
 
1523
  $(if $(filter yes,$(biarch64)),$(biarch64subdir),) \
 
1524
  $(if $(filter yes,$(biarch32)),$(biarch32subdir),) \
 
1525
  $(if $(filter yes,$(biarchn32)),$(biarchn32subdir),) \
 
1526
  $(if $(filter yes,$(biarchx32)),$(biarchx32subdir),) \
 
1527
  $(if $(filter yes,$(biarchhf)),$(biarchhfsubdir),) \
 
1528
  $(if $(filter yes,$(biarchsf)),$(biarchsfsubdir),)
 
1529
biarchsubdirs := {$(strip $(shell echo $(biarchsubdirs) | tr " " ","))}
 
1530
 
 
1531
# GNU locales
 
1532
force_gnu_locales := yes
 
1533
locale_no_cpus :=
 
1534
locale_no_systems :=
 
1535
ifneq (,$(findstring $(DEB_TARGET_GNU_SYSTEM),$(locale_no_systems)))
 
1536
  force_gnu_locales := disabled for system $(DEB_TARGET_GNU_SYSTEM)
 
1537
endif
 
1538
 
 
1539
gcc_tarpath             := $(firstword $(wildcard gcc-*.tar.* /usr/src/gcc-4.8/gcc-*.tar.*))
 
1540
gcc_tarball             := $(notdir $(gcc_tarpath))
 
1541
gcc_srcdir              := $(subst -dfsg,,$(patsubst %.tar.xz,%,$(patsubst %.tar.lzma,%,$(patsubst %.tar.gz,%,$(gcc_tarball:.tar.bz2=)))))
 
1542
 
 
1543
ifeq ($(with_d),yes)
 
1544
  gdc_tarpath           := $(firstword $(wildcard gdc-*.tar.* /usr/src/gcc-$(BASE_VERSION)/gdc-*.tar.*))
 
1545
  gdc_tarball           := $(notdir $(gdc_tarpath))
 
1546
  gdc_srcdir            := $(patsubst %.tar.xz,%,$(patsubst %.tar.lzma,%,$(patsubst %.tar.gz,%,$(gdc_tarball:.tar.bz2=))))
 
1547
endif
 
1548
 
 
1549
# NOTE: This is not yet used. when building gcj, gdc or gnat using the
 
1550
# gcc-source package, we don't require an exact binary dependency.
 
1551
ifneq ($(dir $(gcc_tarpath)),./)
 
1552
  built_using_external_source := yes
 
1553
else
 
1554
  built_using_external_source :=
 
1555
endif
 
1556
ifeq ($(DEB_CROSS),yes)
 
1557
  add_built_using = yes
 
1558
endif
 
1559
ifeq ($(with_ada)-$(with_separate_gnat),yes-yes)
 
1560
  add_built_using = yes
 
1561
endif
 
1562
 
 
1563
ecj_jar := $(firstword $(wildcard ecj.jar /usr/share/java/eclipse-ecj.jar /usr/share/java/ecj.jar))
 
1564
 
 
1565
unpack_stamp            := $(stampdir)/01-unpack-stamp
 
1566
pre_patch_stamp         := $(stampdir)/02-pre-patch-stamp
 
1567
patch_stamp             := $(stampdir)/02-patch-stamp
 
1568
control_stamp           := $(stampdir)/03-control-stamp
 
1569
configure_stamp         := $(stampdir)/04-configure-stamp
 
1570
build_stamp             := $(stampdir)/05-build-stamp
 
1571
build_html_stamp        := $(stampdir)/05-build-html-stamp
 
1572
build_locale_stamp      := $(stampdir)/05-build-locale-stamp
 
1573
build_doxygen_stamp     := $(stampdir)/05-build-doxygen-stamp
 
1574
build_javasrc_stamp     := $(stampdir)/05-build-javasrc-stamp
 
1575
build_javadoc_stamp     := $(stampdir)/05-build-javadoc-stamp
 
1576
check_stamp             := $(stampdir)/06-check-stamp
 
1577
check_inst_stamp        := $(stampdir)/06-check-inst-stamp
 
1578
install_stamp           := $(stampdir)/07-install-stamp
 
1579
install_snap_stamp      := $(stampdir)/07-install-snap-stamp
 
1580
binary_stamp            := $(stampdir)/08-binary-stamp
 
1581
 
 
1582
configure_dummy_stamp   := $(stampdir)/04-configure-dummy-stamp
 
1583
build_dummy_stamp       := $(stampdir)/05-build-dummy-stamp
 
1584
install_dummy_stamp     := $(stampdir)/07-install-dummy-stamp
 
1585
 
 
1586
configure_hppa64_stamp  := $(stampdir)/04-configure-hppa64-stamp
 
1587
build_hppa64_stamp      := $(stampdir)/05-build-hppa64-stamp
 
1588
install_hppa64_stamp    := $(stampdir)/07-install-hppa64-stamp
 
1589
 
 
1590
configure_neon_stamp    := $(stampdir)/04-configure-neon-stamp
 
1591
build_neon_stamp                := $(stampdir)/05-build-neon-stamp
 
1592
install_neon_stamp      := $(stampdir)/07-install-neon-stamp
 
1593
 
 
1594
control_dependencies    := $(patch_stamp)
 
1595
 
 
1596
ifeq ($(single_package),yes)
 
1597
    configure_dependencies = $(configure_stamp)
 
1598
    build_dependencies = $(build_stamp)
 
1599
    install_dependencies = $(install_snap_stamp)
 
1600
    ifeq ($(with_check),yes)
 
1601
      check_dependencies += $(check_stamp)
 
1602
    endif
 
1603
else
 
1604
  ifeq ($(with_base_only),yes)
 
1605
    configure_dependencies = $(configure_dummy_stamp)
 
1606
    build_dependencies = $(build_dummy_stamp)
 
1607
    install_dependencies = $(install_dummy_stamp)
 
1608
  else
 
1609
    configure_dependencies = $(configure_stamp)
 
1610
    build_dependencies = $(build_stamp)
 
1611
    install_dependencies = $(install_stamp)
 
1612
    ifeq ($(with_check),yes)
 
1613
      check_dependencies += $(check_stamp)
 
1614
    endif
 
1615
  endif
 
1616
endif
 
1617
 
 
1618
ifneq (,$(findstring gcj-, $(PKGSOURCE)))
 
1619
  ifeq ($(with_gcj_base_only),yes)
 
1620
    configure_dependencies = $(configure_dummy_stamp)
 
1621
    build_dependencies = $(build_dummy_stamp)
 
1622
    install_dependencies = $(install_dummy_stamp)
 
1623
  endif
 
1624
endif
 
1625
 
 
1626
ifeq ($(with_neon),yes)
 
1627
  build_dependencies += $(build_neon_stamp)
 
1628
  install_dependencies += $(install_neon_stamp)
 
1629
endif
 
1630
 
 
1631
ifeq ($(with_hppa64),yes)
 
1632
  build_dependencies += $(build_hppa64_stamp)
 
1633
  ifneq ($(trunk_build),yes)
 
1634
    install_dependencies += $(install_hppa64_stamp)
 
1635
  endif
 
1636
endif
 
1637
 
 
1638
build_dependencies += $(check_dependencies)
 
1639
 
 
1640
stamp-dir:
 
1641
        mkdir -p $(stampdir)
 
1642
 
 
1643
ifeq ($(DEB_CROSS),yes)
 
1644
  ifneq ($(with_deps_on_target_arch_pkgs),yes)
 
1645
    define cross_mangle_shlibs
 
1646
        sed -i s/$(cross_lib_arch)//g debian/$(1)/DEBIAN/shlibs
 
1647
    endef
 
1648
    define cross_mangle_substvars
 
1649
        if [ -f debian/$(1).substvars ]; then \
 
1650
          sed -i 's/lib[^ ,(]*/&$(cross_lib_arch)/g' debian/$(1).substvars; \
 
1651
        fi
 
1652
    endef
 
1653
  else
 
1654
    define cross_mangle_shlibs
 
1655
    endef
 
1656
    define cross_mangle_substvars
 
1657
    endef
 
1658
  endif
 
1659
else
 
1660
  define cross_mangle_shlibs
 
1661
  endef
 
1662
  define cross_mangle_substvars
 
1663
  endef
 
1664
  # precise's dh_shlibdeps doesn't work well for ARM multilibs
 
1665
  # and dh_shlibdeps doesn't work well for cross builds, see #698881.
 
1666
  ifneq (,$(filter $(distrelease),precise quantal raring))
 
1667
    ifneq (,$(filter $(DEB_TARGET_ARCH), armel armhf arm64))
 
1668
      ignshld = -
 
1669
    endif
 
1670
  endif
 
1671
endif
 
1672
 
 
1673
# takes a *list* of package names as $1, the multilib dirname as $2
 
1674
_shlibdirs = \
 
1675
        $(if $(strip $(1)), \
 
1676
          $(shell find $(foreach p,$(1),$(CURDIR)/debian/$(p)) \
 
1677
                -name '*.so.*' -printf '%h ' | uniq)) \
 
1678
        $(with_build_sysroot)/lib/$(call mlib_to_march,$(2)) \
 
1679
        $(with_build_sysroot)/usr/lib/$(call mlib_to_march,$(2)) \
 
1680
        $(with_build_sysroot)$(subst /usr,,/$(usr_lib$(2))) \
 
1681
        $(with_build_sysroot)/$(usr_lib$(2)) \
 
1682
        $(if $(filter yes,$(biarchsf) $(biarchhf)), \
 
1683
          $(with_build_sysroot)/usr/$(call mlib_to_march,$(2))/lib)
 
1684
shlibdirs_to_search = -l$(subst $(SPACE),:,$(foreach d,$(_shlibdirs),$(d)))
 
1685
 
 
1686
# native ... 
 
1687
 
 
1688
ifneq (,$(filter $(DEB_TARGET_ARCH), mips mipsel mips64 mips64el mipsn32 mipsn32el))
 
1689
  ifneq ($(with_deps_on_target_arch_pkgs),yes)
 
1690
    define cross_mangle_control
 
1691
        $(if $(findstring 64,$(1)),sed -i -r '/^(Dep|Rec|Sug)/s/[a-z0-9-]+32[^$(COMMA)]+($(COMMA) *|$$)//g;/^(Dep|Rec|Sug)/s/$(p_lgcc)/$(p_l64gcc)/;/^(Dep|Rec|Sug)/s/ *$(COMMA) *$$//' debian/$(1)/DEBIAN/control,@:)
 
1692
        $(if $(findstring n32,$(1)),sed -i -r '/^(Dep|Rec|Sug)/s/[a-z0-9-]+64[^$(COMMA)]+($(COMMA) *|$$)//g;/^(Dep|Rec|Sug)/s/$(p_lgcc)/$(p_ln32gcc)/;/^(Dep|Rec|Sug)/s/ *$(COMMA) *$$//' debian/$(1)/DEBIAN/control,@:)
 
1693
    endef
 
1694
  else
 
1695
    define cross_mangle_control
 
1696
    endef
 
1697
  endif
 
1698
else
 
1699
  define cross_mangle_control
 
1700
  endef
 
1701
endif