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

« back to all changes in this revision

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