2
# definitions used in more than one Makefile / rules file
5
SHELL = /bin/bash -e # brace expansion used in rules file
8
builddir = $(PWD)/build
11
distribution := $(shell lsb_release -is)
12
distrelease := $(shell lsb_release -cs)
13
derivative := $(shell if dpkg-vendor --derives-from Ubuntu; then echo Ubuntu; \
14
elif dpkg-vendor --derives-from Debian; then echo Debian; \
15
else echo Unknown; fi)
17
# On non official archives, "lsb_release -cs" default to "n/a". Assume
19
ifeq ($(distrelease),n/a)
23
on_buildd := $(shell [ -f /CurrentlyBuilding -o "$$LOGNAME" = buildd ] && echo yes)
25
# creates {srcdir,builddir}_{hppa64,neon}
26
$(foreach x,srcdir builddir,$(foreach target,hppa64 neon,$(eval \
27
$(x)_$(target) := $($(x))-$(target))))
29
# for architecture dependent variables and changelog vars
30
vafilt = $(subst $(2)=,,$(filter $(2)=%,$(1)))
34
DPKG_VARS := $(shell dpkg-architecture)
35
DEB_BUILD_ARCH ?= $(call vafilt,$(DPKG_VARS),DEB_BUILD_ARCH)
36
DEB_BUILD_GNU_TYPE ?= $(call vafilt,$(DPKG_VARS),DEB_BUILD_GNU_TYPE)
37
DEB_BUILD_MULTIARCH ?= $(call vafilt,$(DPKG_VARS),DEB_BUILD_MULTIARCH)
38
DEB_HOST_ARCH ?= $(call vafilt,$(DPKG_VARS),DEB_HOST_ARCH)
39
DEB_HOST_GNU_CPU ?= $(call vafilt,$(DPKG_VARS),DEB_HOST_GNU_CPU)
40
DEB_HOST_GNU_SYSTEM ?= $(call vafilt,$(DPKG_VARS),DEB_HOST_GNU_SYSTEM)
41
DEB_HOST_GNU_TYPE ?= $(call vafilt,$(DPKG_VARS),DEB_HOST_GNU_TYPE)
42
DEB_HOST_MULTIARCH ?= $(call vafilt,$(DPKG_VARS),DEB_HOST_MULTIARCH)
44
CHANGELOG_VARS := $(shell dpkg-parsechangelog | \
45
sed -n 's/ /_/g;/^[^_]/s/^\([^:]*\):_\(.*\)/\1=\2/p')
47
# the name of the source package
48
PKGSOURCE := $(call vafilt,$(CHANGELOG_VARS),Source)
49
# those are required here too
50
SOURCE_VERSION := $(call vafilt,$(CHANGELOG_VARS),Version)
51
DEB_VERSION := $(strip $(shell echo $(SOURCE_VERSION) | \
52
sed -e 's/.*://' -e 's/ds[0-9]*//'))
53
# epoch used for gcc versions up to 3.3.x, now used for some remaining
54
# libraries: libgcc1, libobjc1
56
DEB_EVERSION := $(EPOCH):$(DEB_VERSION)
57
BASE_VERSION := $(shell echo $(DEB_VERSION) | sed -e 's/\([1-9]\.[0-9]\).*-.*/\1/')
59
# push glibc stack traces into stderr
60
export LIBC_FATAL_STDERR_=1
62
# ---------------------------------------------------------------------------
64
# - GNU triplet via DEB_TARGET_GNU_TYPE
65
# - Debian arch in debian/target
66
# - Debian arch via DEB_GCC_TARGET or GCC_TARGET
70
DEB_GCC_TARGET := $(GCC_TARGET)
72
ifdef DEB_TARGET_GNU_TYPE
73
TARGET_VARS := $(shell dpkg-architecture -f -t$(DEB_TARGET_GNU_TYPE) 2>/dev/null)
75
# allow debian/target to be used instead of DEB_GCC_TARGET - this was requested
76
# by toolchain-source maintainer
77
DEBIAN_TARGET_FILE := $(strip $(if $(wildcard debian/target),$(shell cat debian/target 2>/dev/null)))
78
ifndef DEB_TARGET_ARCH
79
ifneq (,$(DEBIAN_TARGET_FILE))
80
DEB_TARGET_ARCH := $(DEBIAN_TARGET_FILE)
83
DEB_TARGET_ARCH := $(DEB_GCC_TARGET)
85
DEB_TARGET_ARCH := $(DEB_HOST_ARCH)
89
TARGET_VARS := $(shell dpkg-architecture -f -a$(DEB_TARGET_ARCH) 2>/dev/null)
92
DEB_TARGET_ARCH ?= $(call vafilt,$(TARGET_VARS),DEB_HOST_ARCH)
93
DEB_TARGET_ARCH_OS ?= $(call vafilt,$(TARGET_VARS),DEB_HOST_ARCH_OS)
94
DEB_TARGET_ARCH_CPU ?= $(call vafilt,$(TARGET_VARS),DEB_HOST_ARCH_CPU)
95
DEB_TARGET_GNU_CPU ?= $(call vafilt,$(TARGET_VARS),DEB_HOST_GNU_CPU)
96
DEB_TARGET_GNU_TYPE ?= $(call vafilt,$(TARGET_VARS),DEB_HOST_GNU_TYPE)
97
DEB_TARGET_GNU_SYSTEM ?= $(call vafilt,$(TARGET_VARS),DEB_HOST_GNU_SYSTEM)
98
DEB_TARGET_MULTIARCH ?= $(call vafilt,$(TARGET_VARS),DEB_HOST_MULTIARCH)
100
ifeq ($(DEB_TARGET_ARCH),)
101
$(error Invalid architecure.)
104
# including unversiond symlinks for binaries
105
#with_unversioned = yes
107
# ---------------------------------------------------------------------------
108
# cross-compiler config
109
# - typical cross-compiler
110
# - reverse cross (built to run on the target)
114
# build != host && host == target : reverse cross (REVERSE_CROSS == yes)
115
# build == host && host != target : typical cross (DEB_CROSS == yes)
116
# build != host && host != target : canadian (DEB_CROSS == yes)
117
# build == host && host == target : native
118
ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
119
ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_TARGET_GNU_TYPE))
120
# cross building a cross compiler, untested.
123
# cross building the native compiler
125
ifeq (,$(filter $(distrelease),lenny etch squeeze dapper hardy jaunty karmic lucid))
130
ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_TARGET_GNU_TYPE))
131
# cross compiler, sets WITH_SYSROOT on it's own
133
ifeq ($(with_deps_on_target_arch_pkgs),yes)
138
# first ones are wheezy and maverick
139
ifeq (,$(filter $(distrelease),lenny etch squeeze dapper hardy jaunty karmic lucid))
145
# ---------------------------------------------------------------------------
146
# cross compiler support
147
ifeq ($(DEB_CROSS),yes)
148
# TARGET: Alias to DEB_TARGET_ARCH (Debian arch name)
149
# TP: Target Prefix. Used primarily as a prefix for cross tool
150
# names (e.g. powerpc-linux-gcc).
151
# TS: Target Suffix. Used primarily at the end of cross compiler
152
# package names (e.g. gcc-powerpc).
153
# LS: Library Suffix. Used primarily at the end of cross compiler
154
# library package names (e.g. libgcc-powerpc-cross).
155
# AQ: Arch Qualifier. Used for cross-arch dependencies
156
DEB_TARGET_ALIAS ?= $(DEB_TARGET_GNU_TYPE)
157
TARGET := $(DEB_TARGET_ARCH)
158
TP := $(subst _,-,$(DEB_TARGET_GNU_TYPE))-
159
TS := -$(subst _,-,$(DEB_TARGET_ALIAS))
160
LS := -$(subst _,-,$(DEB_TARGET_ARCH))-cross
163
cross_bin_arch := -$(subst _,-,$(DEB_TARGET_ALIAS))
164
cross_lib_arch := -$(subst _,-,$(DEB_TARGET_ARCH))-cross
165
cmd_prefix := $(DEB_TARGET_GNU_TYPE)-
167
ifeq ($(with_deps_on_target_arch_pkgs),yes)
174
TARGET_ALIAS := $(DEB_TARGET_ALIAS)
176
lib_binaries := indep_binaries
177
cross_shlibdeps = DEB_HOST_ARCH=$(TARGET) ARCH=$(DEB_TARGET_ARCH) MAKEFLAGS="CC=something"
178
cross_gencontrol = DEB_HOST_ARCH=$(TARGET)
179
cross_makeshlibs = DEB_HOST_ARCH=$(TARGET)
180
cross_clean = DEB_HOST_ARCH=$(TARGET)
182
TARGET_ALIAS := $(DEB_TARGET_GNU_TYPE)
184
ifeq ($(TARGET_ALIAS),i386-gnu)
185
TARGET_ALIAS := i586-gnu
190
#ifeq ($(TARGET_ALIAS),i486-linux-gnu)
191
# TARGET_ALIAS := i686-linux-gnu
194
TARGET_ALIAS := $(subst i386,i486,$(TARGET_ALIAS))
196
# configure as linux-gnu, not linux
197
#ifeq ($(findstring linux,$(TARGET_ALIAS))/$(findstring linux-gnu,$(TARGET_ALIAS)),linux/)
198
# TARGET_ALIAS := $(TARGET_ALIAS)-gnu
201
# configure as linux, not linux-gnu
202
#TARGET_ALIAS := $(subst linux-gnu,linux,$(TARGET_ALIAS))
204
lib_binaries := arch_binaries
212
@echo DEB_TARGET_ARCH: $(DEB_TARGET_ARCH)
213
@echo DEB_TARGET_ARCH_OS: $(DEB_TARGET_ARCH_OS)
214
@echo DEB_TARGET_ARCH_CPU: $(DEB_TARGET_ARCH_CPU)
215
@echo DEB_TARGET_GNU_SYSTEM: $(DEB_TARGET_GNU_SYSTEM)
216
@echo DEB_TARGET_MULTIARCH: $(DEB_TARGET_MULTIARCH)
217
@echo MULTIARCH_CONFARG: $(MULTIARCH_CONFARG)
218
@echo TARGET_ALIAS: $(TARGET_ALIAS)
222
# -------------------------------------------------------------------
225
# "yes" is the default and causes a 3-stage bootstrap.
226
# "off" runs a complete build with --disable-bootstrap
227
# "no" means to just build the first stage, and not create the stage1
229
# "lean" means a lean 3-stage bootstrap, i.e. delete each stage when no
231
with_bootstrap = $(WITH_BOOTSTRAP)
233
ifneq ($(findstring nostrap, $(DEB_BUILD_OPTIONS)),)
234
with_bootstrap := off
237
# -------------------------------------------------------------------
242
# "stage1" is minimal compiler with static libgcc
243
# "stage2" is minimal compiler with shared libgcc
244
ifeq ($(DEB_STAGE),stage1)
245
with_shared_libgcc := no
247
ifeq ($(DEB_STAGE),stage2)
249
with_shared_libgcc := yes
253
ifeq ($(BACKPORT),true)
256
with_base_only := yes
259
# -------------------------------------------------------------------
262
with_sysroot = $(WITH_SYSROOT)
264
ifdef WITH_BUILD_SYSROOT
265
with_build_sysroot = $(WITH_BUILD_SYSROOT)
268
# -------------------------------------------------------------------
269
# for components configuration
272
SPACE = $(EMPTY) $(EMPTY)
274
# lang= overwrites all of nolang=, overwrites all of WITHOUT_LANG
276
DEB_LANG_OPT := $(filter lang=%,$(DEB_BUILD_OPTIONS))
277
DEB_LANG := $(strip $(subst $(COMMA), ,$(patsubst lang=%,%,$(DEB_LANG_OPT))))
278
DEB_NOLANG_OPT := $(filter nolang=%,$(DEB_BUILD_OPTIONS))
279
DEB_NOLANG := $(strip $(subst $(COMMA), ,$(patsubst nolang=%,%,$(DEB_NOLANG_OPT))))
280
lfilt = $(strip $(if $(DEB_LANG), \
281
$(if $(filter $(1) $(2),$(DEB_LANG)),yes),$(3)))
282
nlfilt = $(strip $(if $(DEB_NOLANG), \
283
$(if $(filter $(1) $(2),$(DEB_NOLANG)),disabled by $(DEB_NOLANG_OPT),$(3))))
284
wlfilt = $(strip $(if $(filter $(1) $(2), $(subst $(COMMA), ,$(WITHOUT_LANG))), \
285
disabled by WITHOUT_LANG=$(WITHOUT_LANG),$(3)))
286
envfilt = $(strip $(or $(call lfilt,$(1),$(2)),$(call nlfilt,$(1),$(3)),$(call wlfilt,$(1),$(3)),$(4)))
288
# -------------------------------------------------------------------
289
# architecture specific config
291
# FIXME: libjava is not ported for thumb, this hack only works for
292
# separate gcj builds
293
ifeq (,$(findstring gcj,$(PKGSOURCE)))
294
ifeq ($(DEB_TARGET_ARCH),armhf)
295
ifeq ($(distribution),Raspbian)
298
with_arm_thumb := yes
301
ifeq ($(derivative)-$(DEB_TARGET_ARCH),Ubuntu-armel)
302
ifneq (,$(filter $(distrelease),lucid maverick natty oneiric precise))
303
with_arm_thumb := yes
309
# build using fsf or linaro
310
ifeq ($(distribution),Ubuntu)
311
ifeq (,$(findstring gnat, $(PKGSOURCE)))
312
ifneq (,$(findstring $(DEB_TARGET_ARCH),amd64 i386 arm64 armel armhf))
313
with_linaro_branch = yes
317
ifeq ($(distribution)-$(DEB_TARGET_ARCH),Debian-arm64)
318
with_linaro_branch = yes
321
# check if we're building for armel or armhf
322
ifeq ($(DEB_TARGET_ARCH),armhf)
324
else ifneq (,$(filter $(distribution)-$(DEB_TARGET_ARCH), Ubuntu-armel))
325
ifneq (,$(filter $(distrelease),lucid maverick natty oneiric precise))
330
else ifneq (,$(filter $(DEB_TARGET_ARCH), arm armel))
334
# -------------------------------------------------------------------
337
# common things ---------------
338
# build common packages, where package names don't differ in different
339
# gcc versions (fixincludes, libgcj-common) ...
340
with_common_pkgs := yes
341
# ... and some libraries, which do not change (libgcc1, libssp0).
342
with_common_libs := yes
343
# XXX: should with_common_libs be "yes" only if this is the default compiler
344
# version on the targeted arch?
346
ifeq (,$(filter $(distrelease),lenny etch squeeze wheezy dapper hardy jaunty karmic lucid maverick oneiric precise quantal raring saucy trusty))
351
# is this a multiarch-enabled build?
352
ifeq (,$(filter $(distrelease),lenny etch squeeze dapper hardy jaunty karmic lucid maverick))
353
with_multiarch_lib := yes
356
ifeq ($(with_multiarch_lib),yes)
357
ifneq ($(single_package),yes)
358
ifeq ($(DEB_CROSS),yes)
359
ifeq ($(with_deps_on_target_arch_pkgs),yes)
360
with_multiarch_cxxheaders := yes
363
with_multiarch_cxxheaders := yes
368
ifeq (,$(filter $(distrelease),lenny etch squeeze dapper hardy jaunty karmic lucid maverick))
369
multiarch_stage1 := yes
372
# mapping for the non-default biarch multilib / multiarch names
373
multiarch_xarch_map = \
374
amd64=i386-linux-gnu,x86_64-linux-gnux32 \
375
armel=arm-linux-gnueabi \
376
armhf=arm-linux-gnueabihf \
377
i386=x86_64-linux-gnu,x86_64-linux-gnux32 \
378
powerpc=powerpc64-linux-gnu \
379
ppc64=powerpc-linux-gnu \
380
sparc=sparc64-linux-gnu \
381
sparc64=sparc-linux-gnu \
382
s390=s390x-linux-gnu \
383
s390x=s390-linux-gnu \
384
mips=mips64-linux-gnuabin32,mips64-linux-gnuabi64 \
385
mipsel=mips64el-linux-gnuabin32,mips64el-linux-gnuabi64 \
386
mipsn32=mips-linux-gnu,mips64-linux-gnuabi64 \
387
mipsn32el=mipsel-linux-gnu,mips64el-linux-gnuabi64 \
388
mips64=mips-linux-gnu,mips64-linux-gnuabin32 \
389
mips64el=mipsel-linux-gnu,mips64el-linux-gnuabin32 \
390
x32=x86_64-linux-gnu,i386-linux-gnu \
391
kfreebsd-amd64=i386-kfreebsd-gnu
392
xarch_multiarch_names = $(subst $(COMMA),$(SPACE),$(patsubst $(DEB_TARGET_ARCH)=%,%, \
393
$(filter $(DEB_TARGET_ARCH)=%,$(multiarch_xarch_map))))
395
multilib_multiarch_map = \
396
$(DEB_TARGET_ARCH)/=$(DEB_TARGET_MULTIARCH) \
397
amd64/32=i386-linux-gnu \
398
amd64/x32=x86_64-linux-gnux32 \
399
armel/hf=arm-linux-gnueabihf \
400
armhf/sf=arm-linux-gnueabi \
401
i386/64=x86_64-linux-gnu \
402
i386/x32=x86_64-linux-gnux32 \
403
powerpc/64=powerpc64-linux-gnu \
404
ppc64/32=powerpc-linux-gnu \
405
sparc/64=sparc64-linux-gnu \
406
sparc64/32=sparc-linux-gnu \
407
s390/64=s390x-linux-gnu \
408
s390x/32=s390-linux-gnu \
409
mips/n32=mips64-linux-gnuabin32 \
410
mips/64=mips64-linux-gnuabi64 \
411
mipsel/n32=mips64el-linux-gnuabin32 \
412
mipsel/64=mips64el-linux-gnuabi64 \
413
mipsn32/32=mips-linux-gnu \
414
mipsn32/64=mips64-linux-gnuabi64 \
415
mipsn32el/32=mipsel-linux-gnu \
416
mipsn32el/64=mips64el-linux-gnuabi64 \
417
mips64/32=mips-linux-gnu \
418
mips64/n32=mips64-linux-gnuabin32 \
419
mips64el/32=mipsel-linux-gnu \
420
mips64el/n32=mips64el-linux-gnuabin32 \
421
x32/32=i386-linux-gnu \
422
x32/64=x86_64-linux-gnu \
423
kfreebsd-amd64/32=i386-kfreebsd-gnu
424
# $(call mlib_to_march,<empty>|32|64|n32|x32|hf|sf)
425
mlib_to_march = $(patsubst $(DEB_TARGET_ARCH)/$(1)=%,%, \
426
$(filter $(DEB_TARGET_ARCH)/$(1)=%,$(multilib_multiarch_map)))
428
ifneq ($(DEB_STAGE),stage1)
429
# build a -base package.
430
ifneq ($(DEB_CROSS),yes)
433
ifneq ($(with_deps_on_target_arch_pkgs),yes)
439
# build dev packages.
444
# set lang when built from a different source package.
447
ifneq (,$(findstring gcc-snapshot, $(PKGSOURCE)))
451
else ifneq (,$(findstring gcc-linaro, $(PKGSOURCE)))
455
# --program-suffix=-$(BASE_VERSION)
456
versioned_packages := yes
459
#no_dummy_cpus := ia64 i386 hppa s390 sparc
460
#ifneq (,$(filter $(DEB_TARGET_ARCH_CPU),$(no_dummy_cpus)))
461
# with_base_only := no
462
# with_common_libs := yes
463
# with_common_pkgs := yes
465
# with_base_only := yes
466
# with_common_libs := no
467
# with_common_pkgs := no
471
ifeq ($(versioned_packages),yes)
472
pkg_ver := -$(BASE_VERSION)
476
# -------------------------------------------------------------------
477
# configure languages
479
# C ---------------------------
480
enabled_languages := c
482
# Build all packages needed for C development
483
ifneq ($(with_base_only),yes)
484
ifeq ($(with_dev),yes)
490
# Ada --------------------
491
ada_no_cpus := m32r sh3 sh3eb sh4 sh4eb
495
ifneq (,$(filter $(DEB_TARGET_ARCH),arm64 armhf m68k powerpcspe ppc64el sh4 sparc64))
499
ifeq ($(with_dev),yes)
500
ifneq ($(separate_lang),yes)
504
ifneq (,$(filter $(DEB_TARGET_ARCH_CPU),$(ada_no_cpus)))
505
with_ada := disabled for cpu $(DEB_TARGET_ARCH_CPU)
507
ifneq (,$(findstring $(DEB_TARGET_GNU_SYSTEM),$(ada_no_systems)))
508
with_ada := disabled for system $(DEB_TARGET_GNU_SYSTEM)
510
ifeq ($(ada_no_cross)-$(DEB_CROSS),yes-yes)
511
with_ada := disabled for cross compiler package
513
ifeq ($(ada_no_snap)-$(single_package),yes-yes)
514
with_ada := disabled for snapshot build
516
with_ada := $(call envfilt, ada, , , $(with_ada))
518
ifneq ($(single_package),yes)
519
with_separate_gnat := yes
521
ifeq ($(with_ada)-$(with_separate_gnat),yes-yes)
522
ifneq (,$(findstring gnat,$(PKGSOURCE)))
529
debian_extra_langs += ada
530
with_ada := built from separate source
531
with_libgnat := built from separate source
535
ifeq ($(with_ada),yes)
536
enabled_languages += ada
538
# There are two exception handling mechanisms: ZCX (Zero-Cost
539
# eXceptions) and SJLJ (setjump/longjump), selected and supported by
540
# libgnat. Thus we build both versions of libgnat on architectures
541
# that support both (see ada-sjlj.diff). Most cpus support both
542
# mechanisms; here, we declare the few that support only one.
543
libgnat_zcx_only_cpus :=
544
libgnat_sjlj_only_cpus := arm armel armhf
545
ifneq (,$(filter $(DEB_TARGET_ARCH_CPU),$(libgnat_sjlj_only_cpus)))
550
ifneq (,$(filter $(DEB_TARGET_ARCH_CPU),$(libgnat_zcx_only_cpus)))
553
with_gnat_sjlj := yes
555
ifeq ($(with_gnat_zcx)-$(with_gnat_sjlj),no-no)
556
# TODO: support cpus that do not support exceptions at all,
557
# perhaps by building a restricted runtime library? For now, flag
558
# this as a packaging error.
559
$(error this target supports neither ZCX nor SJLJ)
563
# C++ -------------------------
565
ifneq ($(with_base_only),yes)
566
ifneq ($(separate_lang),yes)
570
ifneq (,$(findstring $(DEB_TARGET_ARCH_CPU),$(cxx_no_cpus)))
571
with_cxx := disabled for cpu $(DEB_TARGET_ARCH_CPU)
573
with_cxx := $(call envfilt, c++, obj-c++ java, , $(with_cxx))
575
# Build all packages needed for C++ development
576
ifeq ($(with_cxx),yes)
577
ifeq ($(with_dev),yes)
579
with_libcxxdbg := yes
581
ifeq ($(with_common_pkgs),yes)
585
# debugging versions of libstdc++
586
ifneq (,$(findstring gcc-, $(PKGSOURCE)))
587
ifeq ($(with_cxxdev),yes)
590
ifneq (,$(findstring $(DEB_TARGET_ARCH_CPU),$(debug_no_cpus)))
591
with_debug := disabled for cpu $(DEB_TARGET_GNU_CPU)
595
with_debug := $(call envfilt, debug, , , $(with_debug))
597
enabled_languages += c++
600
# Java --------------------
601
# - To build a standalone gcj package (with no corresponding gcc
602
# package): with_separate_libgcj=yes, with_standalone_gcj=yes
603
# - To build the java packages from the gcc source package:
604
# with_separate_libgcj=no, with_standalone_gcj=no
605
# - To build gcc and java from separate sources:
606
# with_separate_libgcj=yes, with_standalone_gcj=no
608
java_no_cpus := # arm64 mips mipsel
611
ifneq ($(single_package),yes)
612
with_separate_libgcj := yes
614
with_separate_libgcj := no
615
with_standalone_gcj := no
617
ifneq ($(separate_lang),yes)
621
# java converted for V3 C++ ABI for some archs
622
ifeq ($(with_base_only),yes)
625
ifneq (,$(filter $(DEB_TARGET_ARCH_CPU),$(java_no_cpus)))
626
with_java := disabled for cpu $(DEB_TARGET_ARCH_CPU)
628
ifneq (,$(filter $(DEB_TARGET_GNU_SYSTEM),$(java_no_systems)))
629
with_java := disabled for system $(DEB_TARGET_GNU_SYSTEM)
631
ifeq ($(java_no_cross)-$(DEB_CROSS),yes-yes)
632
with_java := disabled for cross compiler package
634
with_java := $(call envfilt, java, , c++, $(with_java))
636
ifeq ($(with_java)-$(with_separate_libgcj),yes-yes)
637
ifneq (,$(findstring gcj, $(PKGSOURCE)))
641
debian_extra_langs += java
642
with_java := built from separate source
643
with_gcj := built from separate source
644
with_libgcj := buit from separate source
648
with_java_plugin := no
650
ifeq ($(with_java),yes)
651
# use the same names as OpenJDK
652
java_cpu_map = armel=arm armhf=arm hppa=parisc i686=i386 i586=i386 i486=i386 mipsel=mips mips64=mips mips64el=mips mipsn32=mips mipsn32el=mips powerpc=ppc sh4=sh x32=x32
653
java_cpu = $(patsubst $(DEB_TARGET_ARCH_CPU)=%,%, \
654
$(filter $(DEB_TARGET_ARCH_CPU)=%,$(java_cpu_map)))
656
java_cpu = $(DEB_TARGET_ARCH_CPU)
658
java_priority = 10$(subst .,,$(BASE_VERSION))
663
ifneq (,$(findstring gcj-4,$(PKGSOURCE)))
664
ifneq (,$(filter $(DEB_TARGET_ARCH), arm))
665
with_gcj_base_only := yes
669
ifeq ($(single_package),yes)
673
#ifneq (,$(filter $(DEB_TARGET_ARCH),hppa))
674
# with_native_ecj := yes
677
with_java_maintainer_mode := no
679
# used as well in debian/rules.conf to determine the build deps
680
java_awt_peers = gtk # qt # xlib
682
ifeq ($(with_common_libs),yes)
683
with_libgcj_doc := yes
686
# Build all packages needed for Java development (gcj, libgcj-dev)
687
ifeq ($(with_dev),yes)
692
with_java_alsa := yes
693
ifeq (,$(filter $(DEB_TARGET_GNU_SYSTEM),linux-gnu))
697
# Just build the cross compiler to be able to cross build a native build.
698
ifeq ($(DEB_CROSS),yes)
702
enabled_languages += java
705
# Go -------------------
706
# - To build a standalone gccgo package (with no corresponding gcc
707
# package): with_separate_libgo=yes, with_standalone_go=yes
708
# - To build the go packages from the gcc source package:
709
# with_separate_libgo=no, with_standalone_go=no
710
# - To build gcc and go from separate sources:
711
# with_separate_libgo=yes, with_standalone_go=no
716
ifneq (,$(findstring gccgo, $(PKGSOURCE)))
717
with_separate_libgo := yes
718
with_standalone_go := yes
721
go_no_cpus := avr arm hppa m68k sh4 sparc sparc64
722
ifeq (,$(filter $(distrelease),lenny etch squeeze dapper hardy jaunty karmic lucid maverick natty oneiric))
723
go_no_cpus := $(filter-out arm, $(go_no_cpus))
725
go_no_systems := gnu kfreebsd-gnu
727
ifneq ($(with_base_only),yes)
728
ifneq ($(separate_lang),yes)
732
ifneq (,$(filter $(DEB_TARGET_ARCH_CPU),$(go_no_cpus)))
733
with_go := disabled for cpu $(DEB_TARGET_ARCH_CPU)
735
ifneq (,$(findstring $(DEB_TARGET_GNU_SYSTEM),$(go_no_systems)))
736
with_go := disabled for system $(DEB_TARGET_GNU_SYSTEM)
738
ifeq ($(go_no_cross)-$(DEB_CROSS),yes-yes)
739
with_go := disabled for cross compiler package
741
with_go := $(call envfilt, go, , , $(with_go))
743
# Build all packages needed for Go development
744
ifneq (,$(findstring gcc, $(PKGSOURCE)))
745
ifeq ($(with_go),yes)
746
enabled_languages += go
751
ifeq ($(with_go)-$(with_separate_libgo),yes-yes)
752
ifneq (,$(findstring gccgo, $(PKGSOURCE)))
753
languages := c c++ go
756
debian_extra_langs += go
757
with_go := built from separate source
758
with_libgo := buit from separate source
762
# D ---------------------------
767
ifneq ($(single_package),yes)
768
with_separate_gdc := yes
770
with_separate_gdc := no
772
ifneq ($(separate_lang),yes)
775
ifneq (,$(filter $(DEB_TARGET_ARCH_CPU),$(d_no_cpus)))
776
with_d := disabled for cpu $(DEB_TARGET_ARCH_CPU)
778
ifeq ($(d_no_snap)-$(single_package),yes-yes)
779
with_d := disabled for snapshot build
781
with_d := $(call envfilt, d, , , $(with_d))
783
ifeq ($(with_base_only),yes)
787
ifeq ($(with_d)-$(with_separate_gdc),yes-yes)
788
ifneq (,$(findstring gdc,$(PKGSOURCE)))
792
# FIXME: language selection needs improvement.
793
with_go := disabled for d
795
debian_extra_langs += d
796
with_d := built from separate source
801
libphobos_archs = armel armhf amd64 i386 x32 kfreebsd-amd64 kfreebsd-i386
802
ifneq (,$(filter $(DEB_TARGET_ARCH), $(libphobos_archs)))
803
with_libphobos := yes
806
libphobos_no_cpus := alpha avr arm64 hppa ia64 m68k \
807
mips mipsel mips64 mips64el mipsn32 mipsn32el \
808
powerpc powerpcspe ppc64 ppc64el s390 s390x sh4 sparc sparc64
809
libphobos_no_systems := gnu kfreebsd-gnu
810
ifneq (,$(filter $(DEB_TARGET_ARCH_CPU),$(libphobos_no_cpus)))
811
with_libphobos := disabled for cpu $(DEB_TARGET_ARCH_CPU)
813
ifneq (,$(findstring $(DEB_TARGET_GNU_SYSTEM),$(libphobos_no_systems)))
814
with_libphobos := disabled for system $(DEB_TARGET_GNU_SYSTEM)
817
enabled_languages += d
820
# Fortran 95 -------------------
821
fortran_no_cross := yes
822
fortran_no_cross := no
824
ifneq ($(with_base_only),yes)
825
ifneq ($(separate_lang),yes)
829
ifeq ($(fortran_no_cross)-$(DEB_CROSS),yes-yes)
830
with_fortran := disabled for cross compiler package
832
with_fortran := $(call envfilt, fortran, , , $(with_fortran))
834
# Build all packages needed for Fortran development
835
ifeq ($(with_fortran),yes)
836
ifeq ($(with_dev),yes)
839
ifeq ($(with_common_libs),yes)
840
with_libgfortran := yes
842
enabled_languages += fortran
845
# libquadmath -------------------
847
ifneq (,$(findstring $(DEB_TARGET_ARCH_CPU), ia64 i386 i486 i586 i686 amd64))
848
# FIXME: upstream build tied to gfortran build
849
ifeq ($(with_fortran),yes)
851
ifneq (,$(findstring gcc-4,$(PKGSOURCE)))
852
ifeq ($(with_common_libs),yes)
859
# ObjC ------------------------
862
ifneq ($(with_base_only),yes)
863
ifneq ($(separate_lang),yes)
866
ifneq (,$(filter $(DEB_TARGET_ARCH),$(objc_no_archs)))
871
ifeq ($(objc_no_cross)-$(DEB_CROSS),yes-yes)
872
with_objc := disabled for cross compiler package
874
with_objc := $(call envfilt, objc, obj-c++, , $(with_objc))
876
ifeq ($(with_objc),yes)
877
# the ObjC runtime with garbage collection enabled needs the Boehm GC
880
# disable ObjC garbage collection library (needs libgc)
881
libgc_no_cpus := arm64 avr mips mipsel # alpha amd64 arm armel armhf hppa i386 ia64 m68k mips mipsel powerpc ppc64 s390 s390x sparc
882
libgc_no_systems := knetbsd-gnu
883
ifneq (,$(filter $(DEB_TARGET_ARCH_CPU),$(libgc_no_cpus)))
884
with_objc_gc := disabled for cpu $(DEB_TARGET_ARCH_CPU)
886
ifneq (,$(findstring $(DEB_TARGET_GNU_SYSTEM),$(libgc_no_systems)))
887
with_objc_gc := disabled for system $(DEB_TARGET_GNU_SYSTEM)
890
# Build all packages needed for Objective-C development
891
ifeq ($(with_dev),yes)
894
ifeq ($(with_common_libs),yes)
898
enabled_languages += objc
901
# ObjC++ ----------------------
902
objcxx_no_cross := no
904
ifeq ($(with_objc),yes)
905
ifneq ($(with_base_only),yes)
906
ifneq ($(separate_lang),yes)
911
ifeq ($(objcxx_no_cross)-$(DEB_CROSS),yes-yes)
912
with_objcxx := disabled for cross compiler package
914
with_objcxx := $(call envfilt, obj-c++, , c++ objc, $(with_objcxx))
916
ifeq ($(with_objcxx),yes)
917
enabled_languages += obj-c++
920
# -------------------------------------------------------------------
923
# not built from the main source package
924
ifeq (,$(findstring gcc-,$(PKGSOURCE)))
929
ifeq ($(trunk_build),yes)
932
with_nls := $(call envfilt, nls, , , $(with_nls))
934
# powerpc nof libraries -----
937
ifneq (,$(findstring gcc-4,$(PKGSOURCE)))
940
with_source := $(call envfilt, source, , , $(with_source))
942
ifeq ($(with_cdev),yes)
944
# ssp & libssp -------------------------
946
ssp_no_archs = alpha hppa ia64 m68k
947
ifneq (, $(filter $(DEB_TARGET_ARCH),$(ssp_no_archs) $(ssp_no_archs:%=uclibc-%)))
948
with_ssp := not available on $(DEB_TARGET_ARCH)
950
with_ssp := $(call envfilt, ssp, , , $(with_ssp))
952
ifeq ($(with_ssp),yes)
953
ifneq ($(derivative),Debian)
954
ifneq (,$(findstring gcc-4, $(PKGSOURCE)))
955
with_ssp_default := yes
960
# gomp --------------------
962
with_gomp := $(call envfilt, gomp, , , $(with_gomp))
964
ifneq (,$(filter $(DEB_TARGET_ARCH),$(gomp_no_archs)))
968
# itm --------------------
969
itm_archs = amd64 i386 x32 ppc64 ppc64el
970
ifneq (,$(filter $(DEB_TARGET_ARCH),$(itm_archs)))
973
with_itm := $(call envfilt, itm, , , $(with_itm))
975
# atomic --------------------
978
ifneq (,$(filter $(DEB_TARGET_ARCH),$(atomic_no_archs)))
982
# backtrace --------------------
983
with_backtrace := yes
984
backtrace_no_archs = m68k
985
ifneq (,$(filter $(DEB_TARGET_ARCH),$(backtrace_no_archs)))
989
# asan / sanitizer --------------------
991
with_asan := $(call envfilt, asan, , , $(with_asan))
992
asan_archs = amd64 armel armhf i386 powerpc ppc64 sparc sparc64 x32
993
ifneq (,$(filter $(DEB_TARGET_ARCH),$(asan_archs)))
997
# tsan / sanitizer --------------------
999
with_tsan := $(call envfilt, tsan, , , $(with_tsan))
1001
ifneq (,$(filter $(DEB_TARGET_ARCH),$(tsan_archs)))
1007
# gold --------------------
1008
# armel with binutils 2.20.51 only
1009
gold_archs = amd64 armel armhf i386 lpia powerpc ppc64 sparc sparc64
1010
ifneq (,$(filter $(DEB_TARGET_ARCH),$(gold_archs)))
1014
# plugins --------------------
1017
endif # ifndef DEB_STAGE
1019
# Don't include docs with GFDL invariant sections
1020
GFDL_INVARIANT_FREE := yes
1021
ifeq ($(derivative),Ubuntu)
1022
GFDL_INVARIANT_FREE := no
1025
# -------------------------------------------------------------------
1027
ifeq ($(extra_package),yes)
1028
ifeq ($(with_separate_libgcj)-$(with_standalone_gcj),yes-no)
1035
ifneq ($(DEB_CROSS),yes)
1038
with_gcjxbase := yes
1041
ifeq ($(with_separate_libgo),yes)
1049
# libssp ------------------
1050
ifeq ($(with_ssp)-$(with_common_libs),yes-yes)
1051
#ifneq ($(DEB_CROSS),yes)
1052
with_libssp := $(if $(wildcard $(builddir)/gcc/auto-host.h),$(shell if grep -qs '^\#define TARGET_LIBC_PROVIDES_SSP 1' $(builddir)/gcc/auto-host.h; then echo 'libc provides ssp'; else echo 'yes'; fi))
1056
# libgomp -----------------
1057
ifeq ($(with_gomp)-$(with_common_libs),yes-yes)
1058
#ifneq ($(DEB_CROSS),yes)
1063
# libitm -----------------
1064
ifeq ($(with_itm)-$(with_common_libs),yes-yes)
1065
#ifneq ($(DEB_CROSS),yes)
1070
# libatomic -----------------
1071
ifeq ($(with_atomic)-$(with_common_libs),yes-yes)
1072
#ifneq ($(DEB_CROSS),yes)
1073
with_libatomic := yes
1077
# libbacktrace -----------------
1078
ifeq ($(with_backtrace)-$(with_common_libs),yes-yes)
1079
#ifneq ($(DEB_CROSS),yes)
1080
# currently not a shared library
1081
#with_libbacktrace := yes
1085
# libasan -----------------
1086
# soname change in 4.9
1087
ifeq ($(with_asan),yes)
1088
#ifeq ($(with_asan)-$(with_common_libs),yes-yes)
1089
#ifneq ($(DEB_CROSS),yes)
1094
# libtsan -----------------
1095
ifeq ($(with_tsan)-$(with_common_libs),yes-yes)
1096
#ifneq ($(DEB_CROSS),yes)
1101
# libquadmath -----------------
1102
ifeq ($(with_qmath)-$(with_common_libs),yes-yes)
1103
#ifneq ($(DEB_CROSS),yes)
1104
with_libqmath := yes
1108
# fixincludes -------
1109
ifneq ($(DEB_CROSS),yes)
1110
ifeq ($(with_common_pkgs),yes)
1115
# Shared libgcc --------------------
1116
ifneq ($(DEB_STAGE),stage1)
1117
with_shared_libgcc := yes
1118
ifeq ($(with_common_libs),yes)
1121
ifneq (,$(filter $(distrelease),trusty))
1122
# built from the gccgo-4.9 package, but not for cross builds
1123
ifneq ($(DEB_CROSS),yes)
1129
# libgcc-math --------------------
1131
ifneq (,$(findstring i486,$(DEB_TARGET_ARCH)))
1132
#with_libgccmath := yes
1133
#with_lib64gmath := yes
1134
#with_libgmathdev := yes
1136
ifeq ($(DEB_TARGET_ARCH),amd64)
1137
#with_libgccmath := yes
1138
#with_lib32gmath := yes
1139
#with_libgmathdev := yes
1142
# hppa64 build ----------------
1143
hppa64_no_snap := no
1144
ifeq ($(DEB_TARGET_ARCH),hppa)
1147
ifeq ($(hppa64_no_snap)-$(trunk_build),yes-yes)
1148
with_hppa64 := disabled for snapshot build
1150
with_hppa64 := $(call envfilt, hppa64, , , $(with_hppa64))
1152
# neon build -------------------
1153
# FIXME: build as a cross compiler to build on armv4 as well
1154
ifneq (,$(findstring gcc-4, $(PKGSOURCE)))
1155
ifeq ($(derivative),Ubuntu)
1156
# neon_archs = armel armhf
1157
# ifneq (, $(filter $(DEB_TARGET_ARCH),$(neon_archs)))
1164
# run testsuite ---------------
1166
# if you don't want to run the gcc testsuite, uncomment the next line
1167
#with_check := disabled by hand
1168
ifeq ($(with_base_only),yes)
1171
ifeq ($(DEB_CROSS),yes)
1172
with_check := disabled for cross compiler package
1174
ifeq ($(REVERSE_CROSS),yes)
1175
with_check := disabled for reverse cross build
1177
check_no_cpus := m68k
1178
check_no_systems := gnu kfreebsd-gnu
1179
ifneq (,$(filter $(DEB_TARGET_ARCH_CPU),$(check_no_cpus)))
1180
with_check := disabled for cpu $(DEB_TARGET_ARCH_CPU)
1182
ifneq (,$(findstring $(DEB_TARGET_GNU_SYSTEM),$(check_no_systems)))
1183
with_check := disabled for system $(DEB_TARGET_GNU_SYSTEM)
1185
ifeq ($(derivative)-$(DEB_HOST_ARCH),Ubuntu-hppa)
1186
ifneq ($(single_package),yes)
1187
with_check := disabled, testsuite timeouts with expect
1190
ifneq (,$(findstring gdc,$(PKGSOURCE)))
1191
with_check := disabled for D
1193
with_check := $(call envfilt, check, , , $(with_check))
1195
with_check := disabled by environment
1197
ifneq ($(findstring nocheck, $(DEB_BUILD_OPTIONS)),)
1198
with_check := disabled by DEB_BUILD_OPTIONS
1200
ifneq (,$(filter $(DEB_HOST_ARCH), hppa))
1201
ifneq ($(single_package),yes)
1202
with_check := disabled for $(DEB_HOST_ARCH), testsuite timeouts with expect
1205
with_check := disabled for this upload
1207
# not a dependency on all archs, but if available, use it for the testsuite
1208
ifneq (,$(wildcard /usr/bin/localedef))
1209
locale_data = generate
1212
all_enabled_languages := $(enabled_languages)
1213
languages_without_lang_opt := c++ objc obj-c++
1215
debian_extra_langs := $(subst obj-c++,objcp,$(debian_extra_langs))
1216
export debian_extra_langs
1219
biarch_map := i686=x86_64 powerpc=powerpc64 sparc=sparc64 sparc64=sparc s390=s390x s390x=s390 \
1220
x86_64=i686 powerpc64=powerpc mips=mips64 mipsel=mips64el \
1221
mips64=mips mips64el=mipsel mipsn32=mips mipsn32el=mipsel
1222
ifneq (,$(filter $(derivative),Ubuntu))
1223
ifeq (,$(filter $(distrelease),dapper hardy jaunty karmic lucid))
1224
biarch_map := $(subst i686=,i486=,$(biarch_map))
1227
biarch_map := $(subst i686=,i486=,$(biarch_map))
1230
ifeq ($(derivative),Ubuntu)
1231
ifeq (,$(filter $(distrelease),dapper hardy jaunty karmic lucid maverick natty))
1232
biarch_map += arm=arm
1235
biarch_cpu := $(strip $(patsubst $(DEB_TARGET_GNU_CPU)=%,%, \
1236
$(filter $(DEB_TARGET_GNU_CPU)=%,$(biarch_map))))
1246
ifneq (yes,$$(call envfilt, biarch, , ,yes))
1249
ifneq (,$$(findstring /$$(DEB_TARGET_ARCH)/,$$(biarch$1archs)))
1252
#biarch$1subdir = $$(biarch_cpu)-$$(DEB_TARGET_GNU_SYSTEM)
1254
ifeq ($$(with_libgcc),yes)
1255
with_lib$1gcc := yes
1257
ifeq ($$(with_cdev),yes)
1258
with_lib$1gccdev := yes
1260
ifeq ($$(with_libcxx),yes)
1261
with_lib$1cxx := yes
1263
ifeq ($$(with_libcxxdbg),yes)
1264
with_lib$1cxxdbg := yes
1266
ifeq ($$(with_cxxdev),yes)
1267
with_lib$1cxxdev := yes
1269
ifeq ($$(with_libobjc),yes)
1270
with_lib$1objc := yes
1272
ifeq ($$(with_objcdev),yes)
1273
with_lib$1objcdev := yes
1275
ifeq ($$(with_libgfortran),yes)
1276
with_lib$1gfortran := yes
1278
ifeq ($$(with_fdev),yes)
1279
with_lib$1gfortrandev := yes
1281
ifeq ($$(with_libssp),yes)
1282
with_lib$1ssp := yes
1284
ifeq ($$(with_libgomp),yes)
1285
with_lib$1gomp:= yes
1287
ifeq ($$(with_libitm),yes)
1290
ifeq ($$(with_libatomic),yes)
1291
with_lib$1atomic:= yes
1293
ifeq ($$(with_libbacktrace),yes)
1294
with_lib$1backtrace:= yes
1296
ifeq ($$(with_libasan),yes)
1297
with_lib$1asan:= yes
1299
ifeq ($$(with_libtsan),yes)
1300
with_lib$1tsan:= yes
1302
ifeq ($$(with_libqmath),yes)
1303
with_lib$1qmath := yes
1305
ifeq ($$(with_libgo),yes)
1309
biarch_multidir_names = libiberty libgcc
1310
ifneq (,$$(findstring gcc-, $$(PKGSOURCE)))
1311
biarch_multidir_names += libstdc++-v3 libobjc libgfortran libssp \
1312
libgomp zlib libitm \
1313
libbacktrace libatomic libsanitizer
1314
ifeq ($$(with_objc_gc),yes)
1315
biarch_multidir_names += boehm-gc
1318
ifneq (,$(findstring yes, $(with_java) $(with_go)))
1319
biarch_multidir_names += libffi
1321
ifeq ($(with_fortran),yes)
1322
biarch_multidir_names += libquadmath
1324
ifeq ($(with_go),yes)
1325
biarch_multidir_names += libgo
1327
ifeq ($(with_d),yes)
1328
biarch_multidir_names += libphobos
1330
ifeq ($$(PKGSOURCE),gcc-snapshot)
1331
biarch_multidir_names += libcilkrts libvtv
1333
export biarch_multidir_names
1334
ifneq (,$$(findstring 32,$1))
1335
TARGET64_MACHINE := $$(strip $$(subst $$(DEB_TARGET_GNU_CPU),$$(biarch_cpu), \
1337
TARGET32_MACHINE := $$(TARGET_ALIAS)
1339
TARGET64_MACHINE := $$(TARGET_ALIAS)
1340
TARGET64_MACHINE := $$(strip $$(subst $$(DEB_TARGET_GNU_CPU),$$(biarch_cpu), \
1343
export TARGET32_MACHINE
1344
export TARGET64_MACHINE
1347
biarch32archs := /amd64/ppc64/kfreebsd-amd64/s390x/sparc64/x32/mipsn32/mipsn32el/mips64/mips64el/
1348
biarch64archs := /i386/powerpc/sparc/s390/mips/mipsel/mipsn32/mipsn32el/x32/
1349
biarchn32archs := /mips/mipsel/mips64/mips64el/
1350
ifeq ($(derivative),Ubuntu)
1351
ifeq (,$(filter $(distrelease),dapper hardy jaunty karmic lucid maverick natty))
1352
biarchhfarchs := /armel/
1353
biarchsfarchs := /armhf/
1355
ifeq (,$(filter $(distrelease),dapper hardy jaunty karmic lucid maverick natty oneiric precise quantal))
1356
biarchx32archs := /amd64/i386/
1359
ifeq ($(derivative),Debian)
1360
ifeq (,$(filter $(distrelease),etch squeeze wheezy))
1361
biarchx32archs := /amd64/i386/
1364
$(foreach x,32 64 n32 x32 hf sf,$(eval $(call gen_biarch,$(x))))
1366
#ifeq ($(DEB_TARGET_ARCH),ia64)
1370
#ifeq ($(trunk_build),yes)
1371
# no_biarch_libs := yes
1373
ifdef DEB_CROSS_NO_BIARCH
1374
no_biarch_libs := yes
1377
ifeq ($(no_biarch_libs),yes)
1380
with_lib64cxxdbg := no
1381
with_lib64objc := no
1384
with_lib64gfortran := no
1387
with_lib64gomp := no
1389
with_lib64qmath := no
1390
with_lib64atomic := no
1391
with_lib64backtrace := no
1392
with_lib64asan := no
1393
with_lib64tsan := no
1394
with_lib64gccdev := no
1395
with_lib64cxxdev := no
1396
with_lib64objcdev := no
1397
with_lib64gfortrandev := no
1401
with_lib32cxxdbg := no
1402
with_lib32objc := no
1405
with_lib32gfortran := no
1408
with_lib32gomp := no
1410
with_lib32qmath := no
1411
with_lib32atomic := no
1412
with_lib32backtrace := no
1413
with_lib32asan := no
1414
with_lib32tsan := no
1415
with_lib32gccdev := no
1416
with_lib32cxxdev := no
1417
with_lib32objcdev := no
1418
with_lib32gfortrandev := no
1420
with_libn32gcc := no
1421
with_libn32cxx := no
1422
with_libn32cxxdbg := no
1423
with_libn32objc := no
1424
with_libn32ffi := no
1425
with_libn32gcj := no
1426
with_libn32gfortran := no
1427
with_libn32ssp := no
1429
with_libn32gomp := no
1430
with_libn32itm := no
1431
with_libn32qmath := no
1432
with_libn32atomic := no
1433
with_libn32backtrace := no
1434
with_libn32asan := no
1435
with_libn32tsan := no
1436
with_libn32gccdev := no
1437
with_libn32cxxdev := no
1438
with_libn32objcdev := no
1439
with_libn32gfortrandev:= no
1441
with_libx32gcc := no
1442
with_libx32cxx := no
1443
with_libx32cxxdbg := no
1444
with_libx32objc := no
1445
with_libx32ffi := no
1446
with_libx32gcj := no
1447
with_libx32gfortran := no
1448
with_libx32ssp := no
1450
with_libx32gomp := no
1451
with_libx32itm := no
1452
with_libx32qmath := no
1453
with_libx32atomic := no
1454
with_libx32backtrace := no
1455
with_libx32asan := no
1456
with_libx32tsan := no
1457
with_libx32gccdev := no
1458
with_libx32cxxdev := no
1459
with_libx32objcdev := no
1460
with_libx32gfortrandev:= no
1464
with_libhfcxxdbg := no
1465
with_libhfobjc := no
1468
with_libhfgfortran := no
1471
with_libhfgomp := no
1473
with_libhfqmath := no
1474
with_libhfatomic := no
1475
with_libhfbacktrace := no
1476
with_libhfasan := no
1477
with_libhftsan := no
1478
with_libhfgccdev := no
1479
with_libhfcxxdev := no
1480
with_libhfobjcdev := no
1481
with_libhfgfortrandev := no
1485
with_libsfcxxdbg := no
1486
with_libsfobjc := no
1489
with_libsfgfortran := no
1492
with_libsfgomp := no
1494
with_libsfqmath := no
1495
with_libsfatomic := no
1496
with_libsfbacktrace := no
1497
with_libsfasan := no
1498
with_libsftsan := no
1499
with_libsfgccdev := no
1500
with_libsfcxxdev := no
1501
with_libsfobjcdev := no
1502
with_libsfgfortrandev := no
1504
with_java_plugin := no
1506
ifdef DEB_CROSS_NO_BIARCH
1507
biarch64 := disabled by DEB_CROSS_NO_BIARCH
1508
biarch32 := disabled by DEB_CROSS_NO_BIARCH
1509
biarchn32 := disabled by DEB_CROSS_NO_BIARCH
1510
biarchx32 := disabled by DEB_CROSS_NO_BIARCH
1511
biarchhf := disabled by DEB_CROSS_NO_BIARCH
1512
biarchsf := disabled by DEB_CROSS_NO_BIARCH
1515
ifeq ($(with_ada)-$(with_separate_gnat),yes-yes)
1516
biarchhf := disabled for Ada
1517
biarchsf := disabled for Ada
1522
ifneq (,$(filter yes,$(biarch32) $(biarch64) $(biarchn32) $(biarchx32) $(biarchhf) $(biarchsf)))
1526
multilib_archs = $(sort $(subst /, , $(biarch64archs) $(biarch32archs) $(biarchn32archs) $(biarchx32archs) $(biarchhfarchs) $(biarchsfarchs)))
1529
$(if $(filter yes,$(biarch64)),$(biarch64subdir),) \
1530
$(if $(filter yes,$(biarch32)),$(biarch32subdir),) \
1531
$(if $(filter yes,$(biarchn32)),$(biarchn32subdir),) \
1532
$(if $(filter yes,$(biarchx32)),$(biarchx32subdir),) \
1533
$(if $(filter yes,$(biarchhf)),$(biarchhfsubdir),) \
1534
$(if $(filter yes,$(biarchsf)),$(biarchsfsubdir),)
1535
biarchsubdirs := {$(strip $(shell echo $(biarchsubdirs) | tr " " ","))}
1538
force_gnu_locales := yes
1540
locale_no_systems :=
1541
ifneq (,$(findstring $(DEB_TARGET_GNU_SYSTEM),$(locale_no_systems)))
1542
force_gnu_locales := disabled for system $(DEB_TARGET_GNU_SYSTEM)
1545
gcc_tarpath := $(firstword $(wildcard gcc-*.tar.* /usr/src/gcc-4.8/gcc-*.tar.*))
1546
gcc_tarball := $(notdir $(gcc_tarpath))
1547
gcc_srcdir := $(subst -dfsg,,$(patsubst %.tar.xz,%,$(patsubst %.tar.lzma,%,$(patsubst %.tar.gz,%,$(gcc_tarball:.tar.bz2=)))))
1549
ifeq ($(with_d),yes)
1550
gdc_tarpath := $(firstword $(wildcard gdc-*.tar.* /usr/src/gcc-$(BASE_VERSION)/gdc-*.tar.*))
1551
gdc_tarball := $(notdir $(gdc_tarpath))
1552
gdc_srcdir := $(patsubst %.tar.xz,%,$(patsubst %.tar.lzma,%,$(patsubst %.tar.gz,%,$(gdc_tarball:.tar.bz2=))))
1555
# NOTE: This is not yet used. when building gcj, gdc or gnat using the
1556
# gcc-source package, we don't require an exact binary dependency.
1557
ifneq ($(dir $(gcc_tarpath)),./)
1558
built_using_external_source := yes
1560
built_using_external_source :=
1562
ifeq ($(DEB_CROSS),yes)
1563
add_built_using = yes
1565
ifeq ($(with_ada)-$(with_separate_gnat),yes-yes)
1566
add_built_using = yes
1569
ecj_jar := $(firstword $(wildcard ecj.jar /usr/share/java/eclipse-ecj.jar /usr/share/java/ecj.jar))
1571
unpack_stamp := $(stampdir)/01-unpack-stamp
1572
pre_patch_stamp := $(stampdir)/02-pre-patch-stamp
1573
patch_stamp := $(stampdir)/02-patch-stamp
1574
control_stamp := $(stampdir)/03-control-stamp
1575
configure_stamp := $(stampdir)/04-configure-stamp
1576
build_stamp := $(stampdir)/05-build-stamp
1577
build_html_stamp := $(stampdir)/05-build-html-stamp
1578
build_locale_stamp := $(stampdir)/05-build-locale-stamp
1579
build_doxygen_stamp := $(stampdir)/05-build-doxygen-stamp
1580
build_javasrc_stamp := $(stampdir)/05-build-javasrc-stamp
1581
build_javadoc_stamp := $(stampdir)/05-build-javadoc-stamp
1582
check_stamp := $(stampdir)/06-check-stamp
1583
check_inst_stamp := $(stampdir)/06-check-inst-stamp
1584
install_stamp := $(stampdir)/07-install-stamp
1585
install_snap_stamp := $(stampdir)/07-install-snap-stamp
1586
binary_stamp := $(stampdir)/08-binary-stamp
1588
configure_dummy_stamp := $(stampdir)/04-configure-dummy-stamp
1589
build_dummy_stamp := $(stampdir)/05-build-dummy-stamp
1590
install_dummy_stamp := $(stampdir)/07-install-dummy-stamp
1592
configure_hppa64_stamp := $(stampdir)/04-configure-hppa64-stamp
1593
build_hppa64_stamp := $(stampdir)/05-build-hppa64-stamp
1594
install_hppa64_stamp := $(stampdir)/07-install-hppa64-stamp
1596
configure_neon_stamp := $(stampdir)/04-configure-neon-stamp
1597
build_neon_stamp := $(stampdir)/05-build-neon-stamp
1598
install_neon_stamp := $(stampdir)/07-install-neon-stamp
1600
control_dependencies := $(patch_stamp)
1602
ifeq ($(single_package),yes)
1603
configure_dependencies = $(configure_stamp)
1604
build_dependencies = $(build_stamp)
1605
install_dependencies = $(install_snap_stamp)
1606
ifeq ($(with_check),yes)
1607
check_dependencies += $(check_stamp)
1610
ifeq ($(with_base_only),yes)
1611
configure_dependencies = $(configure_dummy_stamp)
1612
build_dependencies = $(build_dummy_stamp)
1613
install_dependencies = $(install_dummy_stamp)
1615
configure_dependencies = $(configure_stamp)
1616
build_dependencies = $(build_stamp)
1617
install_dependencies = $(install_stamp)
1618
ifeq ($(with_check),yes)
1619
check_dependencies += $(check_stamp)
1624
ifneq (,$(findstring gcj-, $(PKGSOURCE)))
1625
ifeq ($(with_gcj_base_only),yes)
1626
configure_dependencies = $(configure_dummy_stamp)
1627
build_dependencies = $(build_dummy_stamp)
1628
install_dependencies = $(install_dummy_stamp)
1632
ifeq ($(with_neon),yes)
1633
build_dependencies += $(build_neon_stamp)
1634
install_dependencies += $(install_neon_stamp)
1637
ifeq ($(with_hppa64),yes)
1638
build_dependencies += $(build_hppa64_stamp)
1639
ifneq ($(trunk_build),yes)
1640
install_dependencies += $(install_hppa64_stamp)
1644
build_dependencies += $(check_dependencies)
1647
mkdir -p $(stampdir)
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
1654
define cross_mangle_substvars
1655
if [ -f debian/$(1).substvars ]; then \
1656
sed -i 's/lib[^ ,(]*/&$(cross_lib_arch)/g' debian/$(1).substvars; \
1660
define cross_mangle_shlibs
1662
define cross_mangle_substvars
1666
define cross_mangle_shlibs
1668
define cross_mangle_substvars
1670
# precise's dh_shlibdeps doesn't work well for ARM multilibs
1671
# and dh_shlibdeps doesn't work well for cross builds, see #698881.
1672
ifneq (,$(filter $(distrelease),precise quantal raring))
1673
ifneq (,$(filter $(DEB_TARGET_ARCH), armel armhf arm64))
1679
# takes a *list* of package names as $1, the multilib dirname as $2
1681
$(if $(strip $(1)), \
1682
$(shell find $(foreach p,$(1),$(CURDIR)/debian/$(p)) \
1683
-name '*.so.*' -printf '%h ' | uniq)) \
1684
$(with_build_sysroot)/lib/$(call mlib_to_march,$(2)) \
1685
$(with_build_sysroot)/usr/lib/$(call mlib_to_march,$(2)) \
1686
$(with_build_sysroot)$(subst /usr,,/$(usr_lib$(2))) \
1687
$(with_build_sysroot)/$(usr_lib$(2)) \
1688
$(if $(filter yes,$(biarchsf) $(biarchhf)), \
1689
$(with_build_sysroot)/usr/$(call mlib_to_march,$(2))/lib)
1690
shlibdirs_to_search = -l$(subst $(SPACE),:,$(foreach d,$(_shlibdirs),$(d)))
1694
ifneq (,$(filter $(DEB_TARGET_ARCH), mips mipsel mips64 mips64el mipsn32 mipsn32el))
1695
ifneq ($(with_deps_on_target_arch_pkgs),yes)
1696
define cross_mangle_control
1697
$(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,@:)
1698
$(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,@:)
1701
define cross_mangle_control
1705
define cross_mangle_control