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

« back to all changes in this revision

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