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

« back to all changes in this revision

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