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; elif dpkg-vendor --derives-from Debian; then echo Debian; else echo Unknown; fi)
15
# On non official archives, "lsb_release -cs" default to "n/a". Assume
17
ifeq ($(distrelease),n/a)
21
on_buildd := $(shell [ -f /CurrentlyBuilding -o "$$LOGNAME" = buildd ] && echo yes)
23
# creates {srcdir,builddir}_{hppa64,neon}
24
$(foreach x,srcdir builddir,$(foreach target,hppa64 neon,$(eval \
25
$(x)_$(target) := $($(x))-$(target))))
27
# for architecture dependent variables and changelog vars
28
vafilt = $(subst $(2)=,,$(filter $(2)=%,$(1)))
32
DPKG_VARS := $(shell dpkg-architecture)
33
DEB_BUILD_ARCH ?= $(call vafilt,$(DPKG_VARS),DEB_BUILD_ARCH)
34
DEB_BUILD_GNU_TYPE ?= $(call vafilt,$(DPKG_VARS),DEB_BUILD_GNU_TYPE)
35
DEB_BUILD_MULTIARCH ?= $(call vafilt,$(DPKG_VARS),DEB_BUILD_MULTIARCH)
36
DEB_HOST_ARCH ?= $(call vafilt,$(DPKG_VARS),DEB_HOST_ARCH)
37
DEB_HOST_GNU_CPU ?= $(call vafilt,$(DPKG_VARS),DEB_HOST_GNU_CPU)
38
DEB_HOST_GNU_SYSTEM ?= $(call vafilt,$(DPKG_VARS),DEB_HOST_GNU_SYSTEM)
39
DEB_HOST_GNU_TYPE ?= $(call vafilt,$(DPKG_VARS),DEB_HOST_GNU_TYPE)
40
DEB_HOST_MULTIARCH ?= $(call vafilt,$(DPKG_VARS),DEB_HOST_MULTIARCH)
42
CHANGELOG_VARS := $(shell dpkg-parsechangelog | \
43
sed -n 's/ /_/g;/^[^_]/s/^\([^:]*\):_\(.*\)/\1=\2/p')
45
# the name of the source package
46
PKGSOURCE := $(call vafilt,$(CHANGELOG_VARS),Source)
47
# those are required here too
48
SOURCE_VERSION := $(call vafilt,$(CHANGELOG_VARS),Version)
49
DEB_VERSION := $(strip $(shell echo $(SOURCE_VERSION) | \
50
sed -e 's/.*://' -e 's/ds[0-9]*//'))
51
# epoch used for gcc versions up to 3.3.x, now used for some remaining
52
# libraries: libgcc1, libobjc1
54
DEB_EVERSION := $(EPOCH):$(DEB_VERSION)
55
BASE_VERSION := $(shell echo $(DEB_VERSION) | sed -e 's/\([1-9]\.[0-9]\).*-.*/\1/')
57
# push glibc stack traces into stderr
58
export LIBC_FATAL_STDERR_=1
60
# ---------------------------------------------------------------------------
62
# - GNU triplet via DEB_TARGET_GNU_TYPE
63
# - Debian arch in debian/target
64
# - Debian arch via DEB_GCC_TARGET or GCC_TARGET
68
DEB_GCC_TARGET := $(GCC_TARGET)
70
ifdef DEB_TARGET_GNU_TYPE
71
TARGET_VARS := $(shell dpkg-architecture -f -t$(DEB_TARGET_GNU_TYPE) 2>/dev/null)
73
# allow debian/target to be used instead of DEB_GCC_TARGET - this was requested
74
# by toolchain-source maintainer
75
DEBIAN_TARGET_FILE := $(strip $(if $(wildcard debian/target),$(shell cat debian/target 2>/dev/null)))
76
ifndef DEB_TARGET_ARCH
77
ifneq (,$(DEBIAN_TARGET_FILE))
78
DEB_TARGET_ARCH := $(DEBIAN_TARGET_FILE)
81
DEB_TARGET_ARCH := $(DEB_GCC_TARGET)
83
DEB_TARGET_ARCH := $(DEB_HOST_ARCH)
87
TARGET_VARS := $(shell dpkg-architecture -f -a$(DEB_TARGET_ARCH) 2>/dev/null)
90
DEB_TARGET_ARCH ?= $(call vafilt,$(TARGET_VARS),DEB_HOST_ARCH)
91
DEB_TARGET_ARCH_OS ?= $(call vafilt,$(TARGET_VARS),DEB_HOST_ARCH_OS)
92
DEB_TARGET_ARCH_CPU ?= $(call vafilt,$(TARGET_VARS),DEB_HOST_ARCH_CPU)
93
DEB_TARGET_GNU_CPU ?= $(call vafilt,$(TARGET_VARS),DEB_HOST_GNU_CPU)
94
DEB_TARGET_GNU_TYPE ?= $(call vafilt,$(TARGET_VARS),DEB_HOST_GNU_TYPE)
95
DEB_TARGET_GNU_SYSTEM ?= $(call vafilt,$(TARGET_VARS),DEB_HOST_GNU_SYSTEM)
96
DEB_TARGET_MULTIARCH ?= $(call vafilt,$(TARGET_VARS),DEB_HOST_MULTIARCH)
98
ifeq ($(DEB_TARGET_ARCH),)
99
$(error Invalid architecure.)
102
# including unversiond symlinks for binaries
103
#with_unversioned = yes
105
# ---------------------------------------------------------------------------
106
# cross-compiler config
107
# - typical cross-compiler
108
# - reverse cross (built to run on the target)
112
# build != host && host == target : reverse cross (REVERSE_CROSS == yes)
113
# build == host && host != target : typical cross (DEB_CROSS == yes)
114
# build != host && host != target : canadian (DEB_CROSS == yes)
115
# build == host && host == target : native
116
ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
117
ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_TARGET_GNU_TYPE))
118
# cross building a cross compiler, untested.
121
# cross building the native compiler
123
ifeq (,$(filter $(distrelease),lenny etch squeeze dapper hardy jaunty karmic lucid))
128
ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_TARGET_GNU_TYPE))
129
# cross compiler, sets WITH_SYSROOT on it's own
131
ifeq ($(with_deps_on_target_arch_pkgs),yes)
136
# first ones are wheezy and maverick
137
ifeq (,$(filter $(distrelease),lenny etch squeeze dapper hardy jaunty karmic lucid))
143
# ---------------------------------------------------------------------------
144
# cross compiler support
145
ifeq ($(DEB_CROSS),yes)
146
# TARGET: Alias to DEB_TARGET_ARCH (Debian arch name)
147
# TP: Target Prefix. Used primarily as a prefix for cross tool
148
# names (e.g. powerpc-linux-gcc).
149
# TS: Target Suffix. Used primarily at the end of cross compiler
150
# package names (e.g. gcc-powerpc).
151
# LS: Library Suffix. Used primarily at the end of cross compiler
152
# library package names (e.g. libgcc-powerpc-cross).
153
# AQ: Arch Qualifier. Used for cross-arch dependencies
154
DEB_TARGET_ALIAS ?= $(DEB_TARGET_GNU_TYPE)
155
TARGET := $(DEB_TARGET_ARCH)
156
TP := $(subst _,-,$(DEB_TARGET_GNU_TYPE))-
157
TS := -$(subst _,-,$(DEB_TARGET_ALIAS))
158
LS := -$(subst _,-,$(DEB_TARGET_ARCH))-cross
161
cross_bin_arch := -$(subst _,-,$(DEB_TARGET_ALIAS))
162
cross_lib_arch := -$(subst _,-,$(DEB_TARGET_ARCH))-cross
163
cmd_prefix := $(DEB_TARGET_GNU_TYPE)-
165
ifeq ($(with_deps_on_target_arch_pkgs),yes)
172
TARGET_ALIAS := $(DEB_TARGET_ALIAS)
174
lib_binaries := indep_binaries
175
cross_shlibdeps = DEB_HOST_ARCH=$(TARGET) ARCH=$(DEB_TARGET_ARCH) MAKEFLAGS="CC=something"
176
cross_gencontrol = DEB_HOST_ARCH=$(TARGET)
177
cross_makeshlibs = DEB_HOST_ARCH=$(TARGET)
178
cross_clean = DEB_HOST_ARCH=$(TARGET)
180
TARGET_ALIAS := $(DEB_TARGET_GNU_TYPE)
182
ifeq ($(TARGET_ALIAS),i386-gnu)
183
TARGET_ALIAS := i586-gnu
188
#ifeq ($(TARGET_ALIAS),i486-linux-gnu)
189
# TARGET_ALIAS := i686-linux-gnu
192
TARGET_ALIAS := $(subst i386,i486,$(TARGET_ALIAS))
194
# configure as linux-gnu, not linux
195
#ifeq ($(findstring linux,$(TARGET_ALIAS))/$(findstring linux-gnu,$(TARGET_ALIAS)),linux/)
196
# TARGET_ALIAS := $(TARGET_ALIAS)-gnu
199
# configure as linux, not linux-gnu
200
#TARGET_ALIAS := $(subst linux-gnu,linux,$(TARGET_ALIAS))
202
lib_binaries := arch_binaries
210
@echo DEB_TARGET_ARCH: $(DEB_TARGET_ARCH)
211
@echo DEB_TARGET_ARCH_OS: $(DEB_TARGET_ARCH_OS)
212
@echo DEB_TARGET_ARCH_CPU: $(DEB_TARGET_ARCH_CPU)
213
@echo DEB_TARGET_GNU_SYSTEM: $(DEB_TARGET_GNU_SYSTEM)
214
@echo DEB_TARGET_MULTIARCH: $(DEB_TARGET_MULTIARCH)
215
@echo MULTIARCH_CONFARG: $(MULTIARCH_CONFARG)
216
@echo TARGET_ALIAS: $(TARGET_ALIAS)
220
# -------------------------------------------------------------------
223
# "yes" is the default and causes a 3-stage bootstrap.
224
# "off" runs a complete build with --disable-bootstrap
225
# "no" means to just build the first stage, and not create the stage1
227
# "lean" means a lean 3-stage bootstrap, i.e. delete each stage when no
229
with_bootstrap = $(WITH_BOOTSTRAP)
231
ifneq ($(findstring nostrap, $(DEB_BUILD_OPTIONS)),)
232
with_bootstrap := off
235
# -------------------------------------------------------------------
240
# "stage1" is minimal compiler with static libgcc
241
# "stage2" is minimal compiler with shared libgcc
242
ifeq ($(DEB_STAGE),stage1)
243
with_shared_libgcc := no
245
ifeq ($(DEB_STAGE),stage2)
247
with_shared_libgcc := yes
251
ifeq ($(BACKPORT),true)
254
with_base_only := yes
257
# -------------------------------------------------------------------
260
with_sysroot = $(WITH_SYSROOT)
262
ifdef WITH_BUILD_SYSROOT
263
with_build_sysroot = $(WITH_BUILD_SYSROOT)
266
# -------------------------------------------------------------------
267
# for components configuration
270
SPACE = $(EMPTY) $(EMPTY)
272
# lang= overwrites all of nolang=, overwrites all of WITHOUT_LANG
274
DEB_LANG_OPT := $(filter lang=%,$(DEB_BUILD_OPTIONS))
275
DEB_LANG := $(strip $(subst $(COMMA), ,$(patsubst lang=%,%,$(DEB_LANG_OPT))))
276
DEB_NOLANG_OPT := $(filter nolang=%,$(DEB_BUILD_OPTIONS))
277
DEB_NOLANG := $(strip $(subst $(COMMA), ,$(patsubst nolang=%,%,$(DEB_NOLANG_OPT))))
278
lfilt = $(strip $(if $(DEB_LANG), \
279
$(if $(filter $(1) $(2),$(DEB_LANG)),yes),$(3)))
280
nlfilt = $(strip $(if $(DEB_NOLANG), \
281
$(if $(filter $(1) $(2),$(DEB_NOLANG)),disabled by $(DEB_NOLANG_OPT),$(3))))
282
wlfilt = $(strip $(if $(filter $(1) $(2), $(subst $(COMMA), ,$(WITHOUT_LANG))), \
283
disabled by WITHOUT_LANG=$(WITHOUT_LANG),$(3)))
284
envfilt = $(strip $(or $(call lfilt,$(1),$(2)),$(call nlfilt,$(1),$(3)),$(call wlfilt,$(1),$(3)),$(4)))
286
# -------------------------------------------------------------------
287
# architecture specific config
289
# FIXME: libjava is not ported for thumb, this hack only works for
290
# separate gcj builds
291
ifeq (,$(findstring gcj,$(PKGSOURCE)))
292
ifeq ($(DEB_TARGET_ARCH),armhf)
293
with_arm_thumb := yes
295
ifeq ($(distribution)-$(DEB_TARGET_ARCH),Ubuntu-armel)
296
ifneq (,$(filter $(distrelease),lucid maverick natty oneiric precise))
297
with_arm_thumb := yes
303
# build using fsf or linaro
304
ifeq ($(distribution),Ubuntu)
305
ifeq (,$(findstring gnat, $(PKGSOURCE)))
306
ifneq (,$(findstring $(DEB_TARGET_ARCH),arm64 armel armhf))
307
with_linaro_branch = yes
311
ifeq ($(distribution)-$(DEB_TARGET_ARCH),Debian-arm64)
312
with_linaro_branch = yes
315
# check if we're building for armel or armhf
316
ifeq ($(DEB_TARGET_ARCH),armhf)
318
else ifneq (,$(filter $(distribution)-$(DEB_TARGET_ARCH), Ubuntu-armel))
319
ifneq (,$(filter $(distrelease),lucid maverick natty oneiric precise))
324
else ifneq (,$(filter $(DEB_TARGET_ARCH), arm armel))
328
# -------------------------------------------------------------------
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?
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
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
352
with_multiarch_cxxheaders := yes
357
ifeq (,$(filter $(distrelease),lenny etch squeeze dapper hardy jaunty karmic lucid maverick))
358
multiarch_stage1 := yes
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
mipsn32=mips-linux-gnu,mips64-linux-gnuabi64 \
376
mipsn32el=mipsel-linux-gnu,mips64el-linux-gnuabi64 \
377
mips64=mips-linux-gnu,mips64-linux-gnuabin32 \
378
mips64el=mipsel-linux-gnu,mips64el-linux-gnuabin32 \
379
x32=x86_64-linux-gnu,i386-linux-gnu \
380
kfreebsd-amd64=i386-kfreebsd-gnu
381
xarch_multiarch_names = $(subst $(COMMA),$(SPACE),$(patsubst $(DEB_TARGET_ARCH)=%,%, \
382
$(filter $(DEB_TARGET_ARCH)=%,$(multiarch_xarch_map))))
384
multilib_multiarch_map = \
385
$(DEB_TARGET_ARCH)/=$(DEB_TARGET_MULTIARCH) \
386
amd64/32=i386-linux-gnu \
387
amd64/x32=x86_64-linux-gnux32 \
388
armel/hf=arm-linux-gnueabihf \
389
armhf/sf=arm-linux-gnueabi \
390
i386/64=x86_64-linux-gnu \
391
i386/x32=x86_64-linux-gnux32 \
392
powerpc/64=powerpc64-linux-gnu \
393
ppc64/32=powerpc-linux-gnu \
394
sparc/64=sparc64-linux-gnu \
395
sparc64/32=sparc-linux-gnu \
396
s390/64=s390x-linux-gnu \
397
s390x/32=s390-linux-gnu \
398
mips/n32=mips64-linux-gnuabin32 \
399
mips/64=mips64-linux-gnuabi64 \
400
mipsel/n32=mips64el-linux-gnuabin32 \
401
mipsel/64=mips64el-linux-gnuabi64 \
402
mipsn32/32=mips-linux-gnu \
403
mipsn32/64=mips64-linux-gnuabi64 \
404
mipsn32el/32=mipsel-linux-gnu \
405
mipsn32el/64=mips64el-linux-gnuabi64 \
406
mips64/32=mips-linux-gnu \
407
mips64/n32=mips64-linux-gnuabin32 \
408
mips64el/32=mipsel-linux-gnu \
409
mips64el/n32=mips64el-linux-gnuabin32 \
410
x32/32=i386-linux-gnu \
411
x32/64=x86_64-linux-gnu \
412
kfreebsd-amd64/32=i386-kfreebsd-gnu
413
# $(call mlib_to_march,<empty>|32|64|n32|x32|hf|sf)
414
mlib_to_march = $(patsubst $(DEB_TARGET_ARCH)/$(1)=%,%, \
415
$(filter $(DEB_TARGET_ARCH)/$(1)=%,$(multilib_multiarch_map)))
417
ifneq ($(DEB_STAGE),stage1)
418
# build a -base package.
419
ifneq ($(DEB_CROSS),yes)
422
ifneq ($(with_deps_on_target_arch_pkgs),yes)
428
# build dev packages.
433
# set lang when built from a different source package.
436
ifneq (,$(findstring gcc-snapshot, $(PKGSOURCE)))
440
else ifneq (,$(findstring gcc-linaro, $(PKGSOURCE)))
444
# --program-suffix=-$(BASE_VERSION)
445
versioned_packages := yes
448
#no_dummy_cpus := ia64 i386 hppa s390 sparc
449
#ifneq (,$(filter $(DEB_TARGET_ARCH_CPU),$(no_dummy_cpus)))
450
# with_base_only := no
451
# with_common_libs := yes
452
# with_common_pkgs := yes
454
# with_base_only := yes
455
# with_common_libs := no
456
# with_common_pkgs := no
460
ifeq ($(versioned_packages),yes)
461
pkg_ver := -$(BASE_VERSION)
465
# -------------------------------------------------------------------
466
# configure languages
468
# C ---------------------------
469
enabled_languages := c
471
# Build all packages needed for C development
472
ifneq ($(with_base_only),yes)
473
ifeq ($(with_dev),yes)
479
# Ada --------------------
480
ada_no_cpus := m32r sh3 sh3eb sh4 sh4eb
484
ifneq (,$(filter $(DEB_TARGET_ARCH),arm64 armhf m68k powerpcspe sh4 sparc64))
488
ifeq ($(with_dev),yes)
489
ifneq ($(separate_lang),yes)
493
ifneq (,$(filter $(DEB_TARGET_ARCH_CPU),$(ada_no_cpus)))
494
with_ada := disabled for cpu $(DEB_TARGET_ARCH_CPU)
496
ifneq (,$(findstring $(DEB_TARGET_GNU_SYSTEM),$(ada_no_systems)))
497
with_ada := disabled for system $(DEB_TARGET_GNU_SYSTEM)
499
ifeq ($(ada_no_cross)-$(DEB_CROSS),yes-yes)
500
with_ada := disabled for cross compiler package
502
ifeq ($(ada_no_snap)-$(single_package),yes-yes)
503
with_ada := disabled for snapshot build
505
with_ada := $(call envfilt, ada, , , $(with_ada))
507
ifneq ($(single_package),yes)
508
with_separate_gnat := yes
510
ifeq ($(with_ada)-$(with_separate_gnat),yes-yes)
511
ifneq (,$(findstring gnat,$(PKGSOURCE)))
515
debian_extra_langs += ada
516
with_ada := built from separate source
517
with_libgnat := built from separate source
521
ifeq ($(with_ada),yes)
522
enabled_languages += ada
524
# There are two exception handling mechanisms: ZCX (Zero-Cost
525
# eXceptions) and SJLJ (setjump/longjump), selected and supported by
526
# libgnat. Thus we build both versions of libgnat on architectures
527
# that support both (see ada-sjlj.diff). Most cpus support both
528
# mechanisms; here, we declare the few that support only one.
529
libgnat_zcx_only_cpus :=
530
libgnat_sjlj_only_cpus := arm armel armhf
531
ifneq (,$(filter $(DEB_TARGET_ARCH_CPU),$(libgnat_sjlj_only_cpus)))
536
ifneq (,$(filter $(DEB_TARGET_ARCH_CPU),$(libgnat_zcx_only_cpus)))
539
with_gnat_sjlj := yes
541
ifeq ($(with_gnat_zcx)-$(with_gnat_sjlj),no-no)
542
# TODO: support cpus that do not support exceptions at all,
543
# perhaps by building a restricted runtime library? For now, flag
544
# this as a packaging error.
545
$(error this target supports neither ZCX nor SJLJ)
549
# C++ -------------------------
551
ifneq ($(with_base_only),yes)
552
ifneq ($(separate_lang),yes)
556
ifneq (,$(findstring $(DEB_TARGET_ARCH_CPU),$(cxx_no_cpus)))
557
with_cxx := disabled for cpu $(DEB_TARGET_ARCH_CPU)
559
with_cxx := $(call envfilt, c++, obj-c++ java, , $(with_cxx))
561
# Build all packages needed for C++ development
562
ifeq ($(with_cxx),yes)
563
ifeq ($(with_dev),yes)
565
with_libcxxdbg := yes
567
ifeq ($(with_common_pkgs),yes)
571
# debugging versions of libstdc++
572
ifneq (,$(findstring gcc-, $(PKGSOURCE)))
573
ifeq ($(with_cxxdev),yes)
576
ifneq (,$(findstring $(DEB_TARGET_ARCH_CPU),$(debug_no_cpus)))
577
with_debug := disabled for cpu $(DEB_TARGET_GNU_CPU)
581
with_debug := $(call envfilt, debug, , , $(with_debug))
583
enabled_languages += c++
586
# Java --------------------
587
# - To build a standalone gcj package (with no corresponding gcc
588
# package): with_separate_libgcj=yes, with_standalone_gcj=yes
589
# - To build the java packages from the gcc source package:
590
# with_separate_libgcj=no, with_standalone_gcj=no
591
# - To build gcc and java from separate sources:
592
# with_separate_libgcj=yes, with_standalone_gcj=no
594
java_no_cpus := # arm64 mips mipsel
597
ifneq ($(single_package),yes)
598
with_separate_libgcj := yes
600
with_separate_libgcj := no
601
with_standalone_gcj := no
603
ifneq ($(separate_lang),yes)
607
# java converted for V3 C++ ABI for some archs
608
ifeq ($(with_base_only),yes)
611
ifneq (,$(filter $(DEB_TARGET_ARCH_CPU),$(java_no_cpus)))
612
with_java := disabled for cpu $(DEB_TARGET_ARCH_CPU)
614
ifneq (,$(filter $(DEB_TARGET_GNU_SYSTEM),$(java_no_systems)))
615
with_java := disabled for system $(DEB_TARGET_GNU_SYSTEM)
617
ifeq ($(java_no_cross)-$(DEB_CROSS),yes-yes)
618
with_java := disabled for cross compiler package
620
with_java := $(call envfilt, java, , c++, $(with_java))
622
ifeq ($(with_java)-$(with_separate_libgcj),yes-yes)
623
ifneq (,$(findstring gcj, $(PKGSOURCE)))
627
debian_extra_langs += java
628
with_java := built from separate source
629
with_gcj := built from separate source
630
with_libgcj := buit from separate source
634
with_java_plugin := no
636
ifeq ($(with_java),yes)
637
# use the same names as OpenJDK
638
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
639
java_cpu = $(patsubst $(DEB_TARGET_ARCH_CPU)=%,%, \
640
$(filter $(DEB_TARGET_ARCH_CPU)=%,$(java_cpu_map)))
642
java_cpu = $(DEB_TARGET_ARCH_CPU)
644
java_priority = 10$(subst .,,$(BASE_VERSION))
649
ifneq (,$(findstring gcj-4,$(PKGSOURCE)))
650
ifneq (,$(filter $(DEB_TARGET_ARCH), arm))
651
with_gcj_base_only := yes
655
ifeq ($(single_package),yes)
659
#ifneq (,$(filter $(DEB_TARGET_ARCH),hppa))
660
# with_native_ecj := yes
663
with_java_maintainer_mode := no
665
# used as well in debian/rules.conf to determine the build deps
666
java_awt_peers = gtk # qt # xlib
668
ifeq ($(with_common_libs),yes)
669
with_libgcj_doc := yes
672
# Build all packages needed for Java development (gcj, libgcj-dev)
673
ifeq ($(with_dev),yes)
678
with_java_alsa := yes
679
ifeq (,$(filter $(DEB_TARGET_GNU_SYSTEM),linux-gnu))
683
# Just build the cross compiler to be able to cross build a native build.
684
ifeq ($(DEB_CROSS),yes)
688
enabled_languages += java
691
# Go -------------------
692
# - To build a standalone gccgo package (with no corresponding gcc
693
# package): with_separate_libgo=yes, with_standalone_go=yes
694
# - To build the go packages from the gcc source package:
695
# with_separate_libgo=no, with_standalone_go=no
696
# - To build gcc and go from separate sources:
697
# with_separate_libgo=yes, with_standalone_go=no
702
ifneq (,$(findstring gccgo, $(PKGSOURCE)))
703
with_separate_libgo := yes
704
with_standalone_go := yes
707
go_no_cpus := avr arm hppa m68k sh4 sparc sparc64
708
ifeq (,$(filter $(distrelease),lenny etch squeeze dapper hardy jaunty karmic lucid maverick natty oneiric))
709
go_no_cpus := $(filter-out arm, $(go_no_cpus))
711
go_no_systems := gnu kfreebsd-gnu
713
ifneq ($(with_base_only),yes)
714
ifneq ($(separate_lang),yes)
718
ifneq (,$(filter $(DEB_TARGET_ARCH_CPU),$(go_no_cpus)))
719
with_go := disabled for cpu $(DEB_TARGET_ARCH_CPU)
721
ifneq (,$(findstring $(DEB_TARGET_GNU_SYSTEM),$(go_no_systems)))
722
with_go := disabled for system $(DEB_TARGET_GNU_SYSTEM)
724
ifeq ($(go_no_cross)-$(DEB_CROSS),yes-yes)
725
with_go := disabled for cross compiler package
727
with_go := $(call envfilt, go, , , $(with_go))
729
# Build all packages needed for Go development
730
ifneq (,$(findstring gcc, $(PKGSOURCE)))
731
ifeq ($(with_go),yes)
732
ifeq ($(with_common_libs),yes)
735
enabled_languages += go
739
ifeq ($(with_go)-$(with_separate_libgo),yes-yes)
740
ifneq (,$(findstring gccgo, $(PKGSOURCE)))
741
languages := c c++ go
744
debian_extra_langs += go
745
with_go := built from separate source
746
with_libgo := buit from separate source
750
# D ---------------------------
755
ifneq ($(single_package),yes)
756
with_separate_gdc := yes
758
with_separate_gdc := no
760
ifneq ($(separate_lang),yes)
763
ifneq (,$(filter $(DEB_TARGET_ARCH_CPU),$(d_no_cpus)))
764
with_d := disabled for cpu $(DEB_TARGET_ARCH_CPU)
766
ifeq ($(d_no_snap)-$(single_package),yes-yes)
767
with_d := disabled for snapshot build
769
with_d := $(call envfilt, d, , , $(with_d))
771
ifeq ($(with_base_only),yes)
775
ifeq ($(with_d)-$(with_separate_gdc),yes-yes)
776
ifneq (,$(findstring gdc,$(PKGSOURCE)))
780
# FIXME: language selection needs improvement.
781
with_go := disabled for d
783
debian_extra_langs += d
784
with_d := built from separate source
789
libphobos_archs = amd64 i386 x32 kfreebsd-amd64 kfreebsd-i386
790
ifneq (,$(filter $(DEB_TARGET_ARCH), $(libphobos_archs)))
791
with_libphobos := yes
794
libphobos_no_cpus := alpha avr arm arm64 hppa ia64 m68k mips mipsel mips64 mips64el mipsn32 mipsn32el powerpc powerpcspe ppc64 s390 s390x sh4 sparc sparc64
795
libphobos_no_systems := gnu kfreebsd-gnu
796
ifneq (,$(findstring $(DEB_TARGET_ARCH_CPU),$(libphobos_no_cpus)))
797
with_libphobos := disabled for cpu $(DEB_TARGET_ARCH_CPU)
799
ifneq (,$(findstring $(DEB_TARGET_GNU_SYSTEM),$(libphobos_no_systems)))
800
with_libphobos := disabled for system $(DEB_TARGET_GNU_SYSTEM)
803
enabled_languages += d
806
# Fortran 95 -------------------
807
fortran_no_cross := yes
808
fortran_no_cross := no
810
ifneq ($(with_base_only),yes)
811
ifneq ($(separate_lang),yes)
815
ifeq ($(fortran_no_cross)-$(DEB_CROSS),yes-yes)
816
with_fortran := disabled for cross compiler package
818
with_fortran := $(call envfilt, fortran, , , $(with_fortran))
820
# Build all packages needed for Fortran development
821
ifeq ($(with_fortran),yes)
822
ifeq ($(with_dev),yes)
825
ifeq ($(with_common_libs),yes)
826
with_libgfortran := yes
828
enabled_languages += fortran
831
# libquadmath -------------------
833
ifneq (,$(findstring $(DEB_TARGET_ARCH_CPU), ia64 i386 i486 i586 i686 amd64))
834
# FIXME: upstream build tied to gfortran build
835
ifeq ($(with_fortran),yes)
837
ifneq (,$(findstring gcc-4,$(PKGSOURCE)))
838
ifeq ($(with_common_libs),yes)
845
# ObjC ------------------------
848
ifneq ($(with_base_only),yes)
849
ifneq ($(separate_lang),yes)
852
ifneq (,$(filter $(DEB_TARGET_ARCH),$(objc_no_archs)))
857
ifeq ($(objc_no_cross)-$(DEB_CROSS),yes-yes)
858
with_objc := disabled for cross compiler package
860
with_objc := $(call envfilt, objc, obj-c++, , $(with_objc))
862
ifeq ($(with_objc),yes)
863
# the ObjC runtime with garbage collection enabled needs the Boehm GC
866
# disable ObjC garbage collection library (needs libgc)
867
libgc_no_cpus := arm64 avr mips mipsel # alpha amd64 arm armel armhf hppa i386 ia64 m68k mips mipsel powerpc ppc64 s390 s390x sparc
868
libgc_no_systems := knetbsd-gnu
869
ifneq (,$(filter $(DEB_TARGET_ARCH_CPU),$(libgc_no_cpus)))
870
with_objc_gc := disabled for cpu $(DEB_TARGET_ARCH_CPU)
872
ifneq (,$(findstring $(DEB_TARGET_GNU_SYSTEM),$(libgc_no_systems)))
873
with_objc_gc := disabled for system $(DEB_TARGET_GNU_SYSTEM)
876
# Build all packages needed for Objective-C development
877
ifeq ($(with_dev),yes)
880
# libobjc soname change in 4.7
881
#ifeq ($(with_common_libs),yes)
885
enabled_languages += objc
888
# ObjC++ ----------------------
889
objcxx_no_cross := no
891
ifeq ($(with_objc),yes)
892
ifneq ($(with_base_only),yes)
893
ifneq ($(separate_lang),yes)
898
ifeq ($(objcxx_no_cross)-$(DEB_CROSS),yes-yes)
899
with_objcxx := disabled for cross compiler package
901
with_objcxx := $(call envfilt, obj-c++, , c++ objc, $(with_objcxx))
903
ifeq ($(with_objcxx),yes)
904
enabled_languages += obj-c++
907
# -------------------------------------------------------------------
910
# not built from the main source package
911
ifeq (,$(findstring gcc-,$(PKGSOURCE)))
916
ifeq ($(trunk_build),yes)
919
with_nls := $(call envfilt, nls, , , $(with_nls))
921
# powerpc nof libraries -----
924
ifneq (,$(findstring gcc-4,$(PKGSOURCE)))
927
with_source := $(call envfilt, source, , , $(with_source))
929
# ssp & libssp -------------------------
931
ssp_no_archs = alpha arm64 hppa ia64 m68k
932
ifneq (, $(filter $(DEB_TARGET_ARCH),$(ssp_no_archs) $(ssp_no_archs:%=uclibc-%)))
933
with_ssp := not available on $(DEB_TARGET_ARCH)
935
with_ssp := $(call envfilt, ssp, , , $(with_ssp))
937
ifeq ($(with_ssp),yes)
938
ifneq ($(distribution),Debian)
939
ifneq (,$(findstring gcc-4, $(PKGSOURCE)))
940
with_ssp_default := yes
945
# mudflap -------------------
947
with_mudflap := $(call envfilt, mudflap, , , $(with_mudflap))
948
mudflap_no_archs = arm64
949
ifneq (,$(filter $(DEB_TARGET_ARCH),$(mudflap_no_archs)))
953
# gomp --------------------
955
with_gomp := $(call envfilt, gomp, , , $(with_gomp))
957
ifneq (,$(filter $(DEB_TARGET_ARCH),$(gomp_no_archs)))
961
# itm --------------------
962
itm_archs = amd64 i386 x32
963
ifneq (,$(filter $(DEB_TARGET_ARCH),$(itm_archs)))
966
with_itm := $(call envfilt, itm, , , $(with_itm))
968
# atomic --------------------
971
ifneq (,$(filter $(DEB_TARGET_ARCH),$(atomic_no_archs)))
975
# backtrace --------------------
976
with_backtrace := yes
977
backtrace_no_archs = m68k
978
ifneq (,$(filter $(DEB_TARGET_ARCH),$(backtrace_no_archs)))
982
# asan / sanitizer --------------------
984
with_asan := $(call envfilt, asan, , , $(with_asan))
985
asan_archs = amd64 armel armhf i386 powerpc ppc64 sparc sparc64 x32
986
ifneq (,$(filter $(DEB_TARGET_ARCH),$(asan_archs)))
990
# tsan / sanitizer --------------------
992
with_tsan := $(call envfilt, tsan, , , $(with_tsan))
994
ifneq (,$(filter $(DEB_TARGET_ARCH),$(tsan_archs)))
998
# gold --------------------
999
# armel with binutils 2.20.51 only
1000
gold_archs = amd64 armel armhf i386 lpia powerpc ppc64 sparc sparc64
1001
ifneq (,$(filter $(DEB_TARGET_ARCH),$(gold_archs)))
1005
# plugins --------------------
1008
endif # ifndef DEB_STAGE
1010
# Don't include docs with GFDL invariant sections
1011
GFDL_INVARIANT_FREE := yes
1012
ifeq ($(distribution),Ubuntu)
1013
GFDL_INVARIANT_FREE := no
1016
# -------------------------------------------------------------------
1018
ifeq ($(extra_package),yes)
1019
ifeq ($(with_separate_libgcj)-$(with_standalone_gcj),yes-no)
1029
ifneq ($(DEB_CROSS),yes)
1032
with_gcjxbase := yes
1035
ifeq ($(with_separate_libgo),yes)
1046
# libssp ------------------
1047
ifeq ($(with_ssp)-$(with_common_libs),yes-yes)
1048
#ifneq ($(DEB_CROSS),yes)
1049
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))
1053
# libmudflap --------------
1054
ifeq ($(with_mudflap)-$(with_common_libs),yes-yes)
1055
with_libmudflap := yes
1058
# libgomp -----------------
1059
ifeq ($(with_gomp)-$(with_common_libs),yes-yes)
1060
#ifneq ($(DEB_CROSS),yes)
1065
# libitm -----------------
1066
ifeq ($(with_itm)-$(with_common_libs),yes-yes)
1067
#ifneq ($(DEB_CROSS),yes)
1072
# libatomic -----------------
1073
ifeq ($(with_atomic)-$(with_common_libs),yes-yes)
1074
#ifneq ($(DEB_CROSS),yes)
1075
with_libatomic := yes
1079
# libbacktrace -----------------
1080
ifeq ($(with_backtrace)-$(with_common_libs),yes-yes)
1081
#ifneq ($(DEB_CROSS),yes)
1082
# currently not a shared library
1083
#with_libbacktrace := yes
1087
# libasan -----------------
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)
1123
# libgcc-math --------------------
1125
ifneq (,$(findstring i486,$(DEB_TARGET_ARCH)))
1126
#with_libgccmath := yes
1127
#with_lib64gmath := yes
1128
#with_libgmathdev := yes
1130
ifeq ($(DEB_TARGET_ARCH),amd64)
1131
#with_libgccmath := yes
1132
#with_lib32gmath := yes
1133
#with_libgmathdev := yes
1136
# hppa64 build ----------------
1137
hppa64_no_snap := no
1138
ifeq ($(DEB_TARGET_ARCH),hppa)
1141
ifeq ($(hppa64_no_snap)-$(trunk_build),yes-yes)
1142
with_hppa64 := disabled for snapshot build
1144
with_hppa64 := $(call envfilt, hppa64, , , $(with_hppa64))
1146
# neon build -------------------
1147
# FIXME: build as a cross compiler to build on armv4 as well
1148
ifneq (,$(findstring gcc-4, $(PKGSOURCE)))
1149
ifeq ($(distribution),Ubuntu)
1150
# neon_archs = armel armhf
1151
# ifneq (, $(filter $(DEB_TARGET_ARCH),$(neon_archs)))
1158
# run testsuite ---------------
1160
# if you don't want to run the gcc testsuite, uncomment the next line
1161
#with_check := disabled by hand
1162
ifeq ($(with_base_only),yes)
1165
ifeq ($(DEB_CROSS),yes)
1166
with_check := disabled for cross compiler package
1168
ifeq ($(REVERSE_CROSS),yes)
1169
with_check := disabled for reverse cross build
1171
check_no_cpus := arm64 m68k
1172
check_no_systems := gnu
1173
ifneq (,$(filter $(DEB_TARGET_ARCH_CPU),$(check_no_cpus)))
1174
with_check := disabled for cpu $(DEB_TARGET_ARCH_CPU)
1176
ifneq (,$(findstring $(DEB_TARGET_GNU_SYSTEM),$(check_no_systems)))
1177
with_check := disabled for system $(DEB_TARGET_GNU_SYSTEM)
1179
ifeq ($(distribution)-$(DEB_HOST_ARCH),Ubuntu-hppa)
1180
ifneq ($(single_package),yes)
1181
with_check := disabled, testsuite timeouts with expect
1184
ifneq (,$(findstring gdc,$(PKGSOURCE)))
1185
with_check := disabled for D
1187
with_check := $(call envfilt, check, , , $(with_check))
1189
with_check := disabled by environment
1191
ifneq ($(findstring nocheck, $(DEB_BUILD_OPTIONS)),)
1192
with_check := disabled by DEB_BUILD_OPTIONS
1194
ifneq (,$(filter $(DEB_HOST_ARCH), hppa mips))
1195
ifneq ($(single_package),yes)
1196
with_check := disabled for $(DEB_HOST_ARCH), testsuite timeouts with expect
1199
#with_check := disabled for this upload
1201
# not a dependency on all archs, but if available, use it for the testsuite
1202
ifneq (,$(wildcard /usr/bin/localedef))
1203
locale_data = generate
1206
all_enabled_languages := $(enabled_languages)
1207
languages_without_lang_opt := c++ objc obj-c++
1209
debian_extra_langs := $(subst obj-c++,objcp,$(debian_extra_langs))
1210
export debian_extra_langs
1213
biarch_map := i686=x86_64 powerpc=powerpc64 sparc=sparc64 sparc64=sparc s390=s390x s390x=s390 \
1214
x86_64=i686 powerpc64=powerpc mips=mips64 mipsel=mips64el \
1215
mips64=mips mips64el=mipsel mipsn32=mips mipsn32el=mipsel
1216
ifneq (,$(filter $(derivative),Ubuntu))
1217
ifeq (,$(filter $(distrelease),dapper hardy jaunty karmic lucid))
1218
biarch_map := $(subst i686=,i486=,$(biarch_map))
1221
biarch_map := $(subst i686=,i486=,$(biarch_map))
1224
ifeq ($(distribution),Ubuntu)
1225
ifeq (,$(filter $(distrelease),dapper hardy jaunty karmic lucid maverick natty))
1226
biarch_map += arm=arm
1229
biarch_cpu := $(strip $(patsubst $(DEB_TARGET_GNU_CPU)=%,%, \
1230
$(filter $(DEB_TARGET_GNU_CPU)=%,$(biarch_map))))
1240
ifneq (yes,$$(call envfilt, biarch, , ,yes))
1243
ifneq (,$$(findstring /$$(DEB_TARGET_ARCH)/,$$(biarch$1archs)))
1246
#biarch$1subdir = $$(biarch_cpu)-$$(DEB_TARGET_GNU_SYSTEM)
1248
ifeq ($$(with_libgcc),yes)
1249
with_lib$1gcc := yes
1251
ifeq ($$(with_cdev),yes)
1252
with_lib$1gccdev := yes
1254
ifeq ($$(with_libcxx),yes)
1255
with_lib$1cxx := yes
1257
ifeq ($$(with_libcxxdbg),yes)
1258
with_lib$1cxxdbg := yes
1260
ifeq ($$(with_cxxdev),yes)
1261
with_lib$1cxxdev := yes
1263
ifeq ($$(with_libobjc),yes)
1264
with_lib$1objc := yes
1266
ifeq ($$(with_objcdev),yes)
1267
with_lib$1objcdev := yes
1269
ifeq ($$(with_libgfortran),yes)
1270
with_lib$1gfortran := yes
1272
ifeq ($$(with_fdev),yes)
1273
with_lib$1gfortrandev := yes
1275
ifeq ($$(with_libmudflap),yes)
1276
with_lib$1mudflap := yes
1278
ifeq ($$(with_libssp),yes)
1279
with_lib$1ssp := yes
1281
ifeq ($$(with_libgomp),yes)
1282
with_lib$1gomp:= yes
1284
ifeq ($$(with_libitm),yes)
1287
ifeq ($$(with_libatomic),yes)
1288
with_lib$1atomic:= yes
1290
ifeq ($$(with_libbacktrace),yes)
1291
with_lib$1backtrace:= yes
1293
ifeq ($$(with_libasan),yes)
1294
with_lib$1asan:= yes
1296
ifeq ($$(with_libtsan),yes)
1297
with_lib$1tsan:= yes
1299
ifeq ($$(with_libqmath),yes)
1300
with_lib$1qmath := yes
1302
ifeq ($$(with_libgo),yes)
1306
biarch_multidir_names = libiberty libgcc
1307
ifneq (,$$(findstring gcc-, $$(PKGSOURCE)))
1308
biarch_multidir_names += libstdc++-v3 libobjc libgfortran libssp \
1309
libgomp libmudflap zlib libitm \
1310
libbacktrace libatomic libsanitizer
1311
ifeq ($$(with_objc_gc),yes)
1312
biarch_multidir_names += boehm-gc
1315
ifneq (,$(findstring yes, $(with_java) $(with_go)))
1316
biarch_multidir_names += libffi
1318
ifeq ($(with_fortran),yes)
1319
biarch_multidir_names += libquadmath
1321
ifeq ($(with_go),yes)
1322
biarch_multidir_names += libgo
1324
ifeq ($(with_d),yes)
1325
biarch_multidir_names += libphobos
1327
export biarch_multidir_names
1328
ifneq (,$$(findstring 32,$1))
1329
TARGET64_MACHINE := $$(strip $$(subst $$(DEB_TARGET_GNU_CPU),$$(biarch_cpu), \
1331
TARGET32_MACHINE := $$(TARGET_ALIAS)
1333
TARGET64_MACHINE := $$(TARGET_ALIAS)
1334
TARGET64_MACHINE := $$(strip $$(subst $$(DEB_TARGET_GNU_CPU),$$(biarch_cpu), \
1337
export TARGET32_MACHINE
1338
export TARGET64_MACHINE
1341
biarch32archs := /amd64/ppc64/kfreebsd-amd64/s390x/sparc64/x32/mipsn32/mipsn32el/mips64/mips64el/
1342
biarch64archs := /i386/powerpc/sparc/s390/mips/mipsel/mipsn32/mipsn32el/x32/
1343
biarchn32archs := /mips/mipsel/mips64/mips64el/
1344
ifeq ($(distribution),Ubuntu)
1345
ifeq (,$(filter $(distrelease),dapper hardy jaunty karmic lucid maverick natty))
1346
biarchhfarchs := /armel/
1347
biarchsfarchs := /armhf/
1349
ifeq (,$(filter $(distrelease),dapper hardy jaunty karmic lucid maverick natty oneiric precise quantal))
1350
biarchx32archs := /amd64/i386/
1353
ifeq ($(distribution),Debian)
1354
#ifeq (,$(filter $(distrelease),etch squeeze wheezy))
1355
ifeq (,$(filter $(distrelease),etch squeeze))
1356
biarchx32archs := /amd64/i386/
1359
$(foreach x,32 64 n32 x32 hf sf,$(eval $(call gen_biarch,$(x))))
1361
#ifeq ($(DEB_TARGET_ARCH),ia64)
1365
#ifeq ($(trunk_build),yes)
1366
# no_biarch_libs := yes
1368
ifdef DEB_CROSS_NO_BIARCH
1369
no_biarch_libs := yes
1372
ifeq ($(no_biarch_libs),yes)
1375
with_lib64cxxdbg := no
1376
with_lib64objc := no
1379
with_lib64gfortran := no
1380
with_lib64mudflap := no
1383
with_lib64gomp := no
1385
with_lib64qmath := no
1386
with_lib64atomic := no
1387
with_lib64backtrace := no
1388
with_lib64asan := no
1389
with_lib64tsan := no
1390
with_lib64gccdev := no
1391
with_lib64cxxdev := no
1392
with_lib64objcdev := no
1393
with_lib64gfortrandev := no
1397
with_lib32cxxdbg := no
1398
with_lib32objc := no
1401
with_lib32gfortran := no
1402
with_lib32mudflap := no
1405
with_lib32gomp := no
1407
with_lib32qmath := no
1408
with_lib32atomic := no
1409
with_lib32backtrace := no
1410
with_lib32asan := no
1411
with_lib32tsan := no
1412
with_lib32gccdev := no
1413
with_lib32cxxdev := no
1414
with_lib32objcdev := no
1415
with_lib32gfortrandev := no
1417
with_libn32gcc := no
1418
with_libn32cxx := no
1419
with_libn32cxxdbg := no
1420
with_libn32objc := no
1421
with_libn32ffi := no
1422
with_libn32gcj := no
1423
with_libn32gfortran := no
1424
with_libn32mudflap := no
1425
with_libn32ssp := no
1427
with_libn32gomp := no
1428
with_libn32itm := no
1429
with_libn32qmath := no
1430
with_libn32atomic := no
1431
with_libn32backtrace := no
1432
with_libn32asan := no
1433
with_libn32tsan := no
1434
with_libn32gccdev := no
1435
with_libn32cxxdev := no
1436
with_libn32objcdev := no
1437
with_libn32gfortrandev:= no
1439
with_libx32gcc := no
1440
with_libx32cxx := no
1441
with_libx32cxxdbg := no
1442
with_libx32objc := no
1443
with_libx32ffi := no
1444
with_libx32gcj := no
1445
with_libx32gfortran := no
1446
with_libx32mudflap := no
1447
with_libx32ssp := no
1449
with_libx32gomp := no
1450
with_libx32itm := no
1451
with_libx32qmath := no
1452
with_libx32atomic := no
1453
with_libx32backtrace := no
1454
with_libx32asan := no
1455
with_libx32tsan := no
1456
with_libx32gccdev := no
1457
with_libx32cxxdev := no
1458
with_libx32objcdev := no
1459
with_libx32gfortrandev:= no
1463
with_libhfcxxdbg := no
1464
with_libhfobjc := no
1467
with_libhfgfortran := no
1468
with_libhfmudflap := 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
1490
with_libsfmudflap := no
1493
with_libsfgomp := no
1495
with_libsfqmath := no
1496
with_libsfatomic := no
1497
with_libsfbacktrace := no
1498
with_libsfasan := no
1499
with_libsftsan := no
1500
with_libsfgccdev := no
1501
with_libsfcxxdev := no
1502
with_libsfobjcdev := no
1503
with_libsfgfortrandev := no
1505
with_java_plugin := no
1507
ifdef DEB_CROSS_NO_BIARCH
1508
biarch64 := disabled by DEB_CROSS_NO_BIARCH
1509
biarch32 := disabled by DEB_CROSS_NO_BIARCH
1510
biarchn32 := disabled by DEB_CROSS_NO_BIARCH
1511
biarchx32 := disabled by DEB_CROSS_NO_BIARCH
1512
biarchhf := disabled by DEB_CROSS_NO_BIARCH
1513
biarchsf := disabled by DEB_CROSS_NO_BIARCH
1516
ifeq ($(with_ada)-$(with_separate_gnat),yes-yes)
1517
biarchhf := disabled for Ada
1518
biarchsf := disabled for Ada
1523
ifneq (,$(filter yes,$(biarch32) $(biarch64) $(biarchn32) $(biarchx32) $(biarchhf) $(biarchsf)))
1527
multilib_archs = $(sort $(subst /, , $(biarch64archs) $(biarch32archs) $(biarchn32archs) $(biarchx32archs) $(biarchhfarchs) $(biarchsfarchs)))
1530
$(if $(filter yes,$(biarch64)),$(biarch64subdir),) \
1531
$(if $(filter yes,$(biarch32)),$(biarch32subdir),) \
1532
$(if $(filter yes,$(biarchn32)),$(biarchn32subdir),) \
1533
$(if $(filter yes,$(biarchx32)),$(biarchx32subdir),) \
1534
$(if $(filter yes,$(biarchhf)),$(biarchhfsubdir),) \
1535
$(if $(filter yes,$(biarchsf)),$(biarchsfsubdir),)
1536
biarchsubdirs := {$(strip $(shell echo $(biarchsubdirs) | tr " " ","))}
1539
force_gnu_locales := yes
1541
locale_no_systems :=
1542
ifneq (,$(findstring $(DEB_TARGET_GNU_SYSTEM),$(locale_no_systems)))
1543
force_gnu_locales := disabled for system $(DEB_TARGET_GNU_SYSTEM)
1546
gcc_tarpath := $(firstword $(wildcard gcc-*.tar.* /usr/src/gcc-4.8/gcc-*.tar.*))
1547
gcc_tarball := $(notdir $(gcc_tarpath))
1548
gcc_srcdir := $(subst -dfsg,,$(patsubst %.tar.xz,%,$(patsubst %.tar.lzma,%,$(patsubst %.tar.gz,%,$(gcc_tarball:.tar.bz2=)))))
1550
ifeq ($(with_d),yes)
1551
gdc_tarpath := $(firstword $(wildcard gdc-*.tar.* /usr/src/gcc-$(BASE_VERSION)/gdc-*.tar.*))
1552
gdc_tarball := $(notdir $(gdc_tarpath))
1553
gdc_srcdir := $(patsubst %.tar.xz,%,$(patsubst %.tar.lzma,%,$(patsubst %.tar.gz,%,$(gdc_tarball:.tar.bz2=))))
1556
# NOTE: This is not yet used. when building gcj, gdc or gnat using the
1557
# gcc-source package, we don't require an exact binary dependency.
1558
ifneq ($(dir $(gcc_tarpath)),./)
1559
built_using_external_source := yes
1561
built_using_external_source :=
1563
ifeq ($(DEB_CROSS),yes)
1564
add_built_using = yes
1567
ecj_jar := $(firstword $(wildcard ecj.jar /usr/share/java/eclipse-ecj.jar /usr/share/java/ecj.jar))
1569
unpack_stamp := $(stampdir)/01-unpack-stamp
1570
pre_patch_stamp := $(stampdir)/02-pre-patch-stamp
1571
patch_stamp := $(stampdir)/02-patch-stamp
1572
control_stamp := $(stampdir)/03-control-stamp
1573
configure_stamp := $(stampdir)/04-configure-stamp
1574
build_stamp := $(stampdir)/05-build-stamp
1575
build_html_stamp := $(stampdir)/05-build-html-stamp
1576
build_locale_stamp := $(stampdir)/05-build-locale-stamp
1577
build_doxygen_stamp := $(stampdir)/05-build-doxygen-stamp
1578
build_javasrc_stamp := $(stampdir)/05-build-javasrc-stamp
1579
build_javadoc_stamp := $(stampdir)/05-build-javadoc-stamp
1580
check_stamp := $(stampdir)/06-check-stamp
1581
check_inst_stamp := $(stampdir)/06-check-inst-stamp
1582
install_stamp := $(stampdir)/07-install-stamp
1583
install_snap_stamp := $(stampdir)/07-install-snap-stamp
1584
binary_stamp := $(stampdir)/08-binary-stamp
1586
configure_dummy_stamp := $(stampdir)/04-configure-dummy-stamp
1587
build_dummy_stamp := $(stampdir)/05-build-dummy-stamp
1588
install_dummy_stamp := $(stampdir)/07-install-dummy-stamp
1590
configure_hppa64_stamp := $(stampdir)/04-configure-hppa64-stamp
1591
build_hppa64_stamp := $(stampdir)/05-build-hppa64-stamp
1592
install_hppa64_stamp := $(stampdir)/07-install-hppa64-stamp
1594
configure_neon_stamp := $(stampdir)/04-configure-neon-stamp
1595
build_neon_stamp := $(stampdir)/05-build-neon-stamp
1596
install_neon_stamp := $(stampdir)/07-install-neon-stamp
1598
control_dependencies := $(patch_stamp)
1600
ifeq ($(single_package),yes)
1601
configure_dependencies = $(configure_stamp)
1602
build_dependencies = $(build_stamp)
1603
install_dependencies = $(install_snap_stamp)
1604
ifeq ($(with_check),yes)
1605
check_dependencies += $(check_stamp)
1608
ifeq ($(with_base_only),yes)
1609
configure_dependencies = $(configure_dummy_stamp)
1610
build_dependencies = $(build_dummy_stamp)
1611
install_dependencies = $(install_dummy_stamp)
1613
configure_dependencies = $(configure_stamp)
1614
build_dependencies = $(build_stamp)
1615
install_dependencies = $(install_stamp)
1616
ifeq ($(with_check),yes)
1617
check_dependencies += $(check_stamp)
1622
ifneq (,$(findstring gcj-, $(PKGSOURCE)))
1623
ifeq ($(with_gcj_base_only),yes)
1624
configure_dependencies = $(configure_dummy_stamp)
1625
build_dependencies = $(build_dummy_stamp)
1626
install_dependencies = $(install_dummy_stamp)
1630
ifeq ($(with_neon),yes)
1631
build_dependencies += $(build_neon_stamp)
1632
install_dependencies += $(install_neon_stamp)
1635
ifeq ($(with_hppa64),yes)
1636
build_dependencies += $(build_hppa64_stamp)
1637
ifneq ($(trunk_build),yes)
1638
install_dependencies += $(install_hppa64_stamp)
1642
build_dependencies += $(check_dependencies)
1645
mkdir -p $(stampdir)
1647
ifeq ($(DEB_CROSS),yes)
1648
ifneq ($(with_deps_on_target_arch_pkgs),yes)
1649
define cross_mangle_shlibs
1650
sed -i s/$(cross_lib_arch)//g debian/$(1)/DEBIAN/shlibs
1652
define cross_mangle_substvars
1653
if [ -f debian/$(1).substvars ]; then \
1654
sed -i 's/lib[^ ,(]*/&$(cross_lib_arch)/g' debian/$(1).substvars; \
1658
define cross_mangle_shlibs
1660
define cross_mangle_substvars
1664
define cross_mangle_shlibs
1666
define cross_mangle_substvars
1668
# precise's dh_shlibdeps doesn't work well for ARM multilibs
1669
# and dh_shlibdeps doesn't work well for cross builds, see #698881.
1670
ifneq (,$(filter $(distrelease),precise quantal raring))
1671
ifneq (,$(filter $(DEB_TARGET_ARCH), armel armhf arm64))
1677
# takes a *list* of package names as $1, the multilib dirname as $2
1679
$(if $(strip $(1)), \
1680
$(shell find $(foreach p,$(1),$(CURDIR)/debian/$(p)) \
1681
-name '*.so.*' -printf '%h ' | uniq)) \
1682
$(with_build_sysroot)/lib/$(call mlib_to_march,$(2)) \
1683
$(with_build_sysroot)/usr/lib/$(call mlib_to_march,$(2)) \
1684
$(with_build_sysroot)$(subst /usr,,/$(usr_lib$(2))) \
1685
$(with_build_sysroot)/$(usr_lib$(2)) \
1686
$(if $(filter yes,$(biarchsf) $(biarchhf)), \
1687
$(with_build_sysroot)/usr/$(call mlib_to_march,$(2))/lib)
1688
shlibdirs_to_search = -l$(subst $(SPACE),:,$(foreach d,$(_shlibdirs),$(d)))
1692
ifneq (,$(filter $(DEB_TARGET_ARCH), mips mipsel mips64 mips64el mipsn32 mipsn32el))
1693
ifneq ($(with_deps_on_target_arch_pkgs),yes)
1694
define cross_mangle_control
1695
$(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,@:)
1696
$(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,@:)
1699
define cross_mangle_control
1703
define cross_mangle_control