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)
14
# On non official archives, "lsb_release -cs" default to "n/a". Assume
16
ifeq ($(distrelease),n/a)
20
on_buildd := $(shell [ -f /CurrentlyBuilding -o "$$LOGNAME" = buildd ] && echo yes)
22
# creates {srcdir,builddir}_{hppa64,neon}
23
$(foreach x,srcdir builddir,$(foreach target,hppa64 neon,$(eval \
24
$(x)_$(target) := $($(x))-$(target))))
26
# for architecture dependent variables and changelog vars
27
vafilt = $(subst $(2)=,,$(filter $(2)=%,$(1)))
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)
41
CHANGELOG_VARS := $(shell dpkg-parsechangelog | \
42
sed -n 's/ /_/g;/^[^_]/s/^\([^:]*\):_\(.*\)/\1=\2/p')
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
53
DEB_EVERSION := $(EPOCH):$(DEB_VERSION)
54
BASE_VERSION := $(shell echo $(DEB_VERSION) | sed -e 's/\([1-9]\.[0-9]\).*-.*/\1/')
56
# push glibc stack traces into stderr
57
export LIBC_FATAL_STDERR_=1
59
# ---------------------------------------------------------------------------
61
# - GNU triplet via DEB_TARGET_GNU_TYPE
62
# - Debian arch in debian/target
63
# - Debian arch via DEB_GCC_TARGET or GCC_TARGET
67
DEB_GCC_TARGET := $(GCC_TARGET)
69
ifdef DEB_TARGET_GNU_TYPE
70
TARGET_VARS := $(shell dpkg-architecture -f -t$(DEB_TARGET_GNU_TYPE) 2>/dev/null)
72
# allow debian/target to be used instead of DEB_GCC_TARGET - this was requested
73
# by toolchain-source maintainer
74
DEBIAN_TARGET_FILE := $(strip $(if $(wildcard debian/target),$(shell cat debian/target 2>/dev/null)))
75
ifndef DEB_TARGET_ARCH
76
ifneq (,$(DEBIAN_TARGET_FILE))
77
DEB_TARGET_ARCH := $(DEBIAN_TARGET_FILE)
80
DEB_TARGET_ARCH := $(DEB_GCC_TARGET)
82
DEB_TARGET_ARCH := $(DEB_HOST_ARCH)
86
TARGET_VARS := $(shell dpkg-architecture -f -a$(DEB_TARGET_ARCH) 2>/dev/null)
89
DEB_TARGET_ARCH ?= $(call vafilt,$(TARGET_VARS),DEB_HOST_ARCH)
90
DEB_TARGET_ARCH_OS ?= $(call vafilt,$(TARGET_VARS),DEB_HOST_ARCH_OS)
91
DEB_TARGET_ARCH_CPU ?= $(call vafilt,$(TARGET_VARS),DEB_HOST_ARCH_CPU)
92
DEB_TARGET_GNU_CPU ?= $(call vafilt,$(TARGET_VARS),DEB_HOST_GNU_CPU)
93
DEB_TARGET_GNU_TYPE ?= $(call vafilt,$(TARGET_VARS),DEB_HOST_GNU_TYPE)
94
DEB_TARGET_GNU_SYSTEM ?= $(call vafilt,$(TARGET_VARS),DEB_HOST_GNU_SYSTEM)
95
DEB_TARGET_MULTIARCH ?= $(call vafilt,$(TARGET_VARS),DEB_HOST_MULTIARCH)
97
ifeq ($(DEB_TARGET_ARCH),)
98
$(error Invalid architecure.)
101
# including unversiond symlinks for binaries
102
#with_unversioned = yes
104
# ---------------------------------------------------------------------------
105
# cross-compiler config
106
# - typical cross-compiler
107
# - reverse cross (built to run on the target)
111
# build != host && host == target : reverse cross (REVERSE_CROSS == yes)
112
# build == host && host != target : typical cross (DEB_CROSS == yes)
113
# build != host && host != target : canadian (DEB_CROSS == yes)
114
# build == host && host == target : native
115
ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
116
ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_TARGET_GNU_TYPE))
117
# cross building a cross compiler, untested.
120
# cross building the native compiler
122
ifeq (,$(filter $(distrelease),lenny etch squeeze dapper hardy jaunty karmic lucid))
127
ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_TARGET_GNU_TYPE))
128
# cross compiler, sets WITH_SYSROOT on it's own
130
ifeq ($(with_deps_on_target_arch_pkgs),yes)
135
# first ones are wheezy and maverick
136
ifeq (,$(filter $(distrelease),lenny etch squeeze dapper hardy jaunty karmic lucid))
142
# ---------------------------------------------------------------------------
143
# cross compiler support
144
ifeq ($(DEB_CROSS),yes)
145
# TARGET: Alias to DEB_TARGET_ARCH (Debian arch name)
146
# TP: Target Prefix. Used primarily as a prefix for cross tool
147
# names (e.g. powerpc-linux-gcc).
148
# TS: Target Suffix. Used primarily at the end of cross compiler
149
# package names (e.g. gcc-powerpc).
150
# LS: Library Suffix. Used primarily at the end of cross compiler
151
# library package names (e.g. libgcc-powerpc-cross).
152
# AQ: Arch Qualifier. Used for cross-arch dependencies
153
DEB_TARGET_ALIAS ?= $(DEB_TARGET_GNU_TYPE)
154
TARGET := $(DEB_TARGET_ARCH)
155
TP := $(subst _,-,$(DEB_TARGET_GNU_TYPE))-
156
TS := -$(subst _,-,$(DEB_TARGET_ALIAS))
157
LS := -$(subst _,-,$(DEB_TARGET_ARCH))-cross
160
cross_bin_arch := -$(subst _,-,$(DEB_TARGET_ALIAS))
161
cross_lib_arch := -$(subst _,-,$(DEB_TARGET_ARCH))-cross
162
cmd_prefix := $(DEB_TARGET_GNU_TYPE)-
164
ifeq ($(with_deps_on_target_arch_pkgs),yes)
171
TARGET_ALIAS := $(DEB_TARGET_ALIAS)
173
lib_binaries := indep_binaries
174
cross_shlibdeps = DEB_HOST_ARCH=$(TARGET) ARCH=$(DEB_TARGET_ARCH) MAKEFLAGS="CC=something"
175
cross_gencontrol = DEB_HOST_ARCH=$(TARGET)
176
cross_makeshlibs = DEB_HOST_ARCH=$(TARGET)
177
cross_clean = DEB_HOST_ARCH=$(TARGET)
179
TARGET_ALIAS := $(DEB_TARGET_GNU_TYPE)
181
ifeq ($(TARGET_ALIAS),i386-gnu)
182
TARGET_ALIAS := i586-gnu
187
#ifeq ($(TARGET_ALIAS),i486-linux-gnu)
188
# TARGET_ALIAS := i686-linux-gnu
191
TARGET_ALIAS := $(subst i386,i486,$(TARGET_ALIAS))
193
# configure as linux-gnu, not linux
194
#ifeq ($(findstring linux,$(TARGET_ALIAS))/$(findstring linux-gnu,$(TARGET_ALIAS)),linux/)
195
# TARGET_ALIAS := $(TARGET_ALIAS)-gnu
198
# configure as linux, not linux-gnu
199
#TARGET_ALIAS := $(subst linux-gnu,linux,$(TARGET_ALIAS))
201
lib_binaries := arch_binaries
209
@echo DEB_TARGET_ARCH: $(DEB_TARGET_ARCH)
210
@echo DEB_TARGET_ARCH_OS: $(DEB_TARGET_ARCH_OS)
211
@echo DEB_TARGET_ARCH_CPU: $(DEB_TARGET_ARCH_CPU)
212
@echo DEB_TARGET_GNU_SYSTEM: $(DEB_TARGET_GNU_SYSTEM)
213
@echo DEB_TARGET_MULTIARCH: $(DEB_TARGET_MULTIARCH)
214
@echo MULTIARCH_CONFARG: $(MULTIARCH_CONFARG)
215
@echo TARGET_ALIAS: $(TARGET_ALIAS)
219
# -------------------------------------------------------------------
222
# "yes" is the default and causes a 3-stage bootstrap.
223
# "off" runs a complete build with --disable-bootstrap
224
# "no" means to just build the first stage, and not create the stage1
226
# "lean" means a lean 3-stage bootstrap, i.e. delete each stage when no
228
with_bootstrap = $(WITH_BOOTSTRAP)
230
ifneq ($(findstring nostrap, $(DEB_BUILD_OPTIONS)),)
231
with_bootstrap := off
234
# -------------------------------------------------------------------
239
# "stage1" is minimal compiler with static libgcc
240
# "stage2" is minimal compiler with shared libgcc
241
ifeq ($(DEB_STAGE),stage1)
242
with_shared_libgcc := no
244
ifeq ($(DEB_STAGE),stage2)
246
with_shared_libgcc := yes
250
ifeq ($(BACKPORT),true)
253
with_base_only := yes
256
# -------------------------------------------------------------------
259
with_sysroot = $(WITH_SYSROOT)
261
ifdef WITH_BUILD_SYSROOT
262
with_build_sysroot = $(WITH_BUILD_SYSROOT)
265
# -------------------------------------------------------------------
266
# for components configuration
269
SPACE = $(EMPTY) $(EMPTY)
271
# lang= overwrites all of nolang=, overwrites all of WITHOUT_LANG
273
DEB_LANG_OPT := $(filter lang=%,$(DEB_BUILD_OPTIONS))
274
DEB_LANG := $(strip $(subst $(COMMA), ,$(patsubst lang=%,%,$(DEB_LANG_OPT))))
275
DEB_NOLANG_OPT := $(filter nolang=%,$(DEB_BUILD_OPTIONS))
276
DEB_NOLANG := $(strip $(subst $(COMMA), ,$(patsubst nolang=%,%,$(DEB_NOLANG_OPT))))
277
lfilt = $(strip $(if $(DEB_LANG), \
278
$(if $(filter $(1) $(2),$(DEB_LANG)),yes),$(3)))
279
nlfilt = $(strip $(if $(DEB_NOLANG), \
280
$(if $(filter $(1) $(2),$(DEB_NOLANG)),disabled by $(DEB_NOLANG_OPT),$(3))))
281
wlfilt = $(strip $(if $(filter $(1) $(2), $(subst $(COMMA), ,$(WITHOUT_LANG))), \
282
disabled by WITHOUT_LANG=$(WITHOUT_LANG),$(3)))
283
envfilt = $(strip $(or $(call lfilt,$(1),$(2)),$(call nlfilt,$(1),$(3)),$(call wlfilt,$(1),$(3)),$(4)))
285
# -------------------------------------------------------------------
286
# architecture specific config
288
# FIXME: libjava is not ported for thumb, this hack only works for
289
# separate gcj builds
290
ifeq (,$(findstring gcj,$(PKGSOURCE)))
291
ifeq ($(DEB_TARGET_ARCH),armhf)
292
with_arm_thumb := yes
294
ifeq ($(distribution)-$(DEB_TARGET_ARCH),Ubuntu-armel)
295
ifneq (,$(filter $(distrelease),lucid maverick natty oneiric precise))
296
with_arm_thumb := yes
302
# build using fsf or linaro
303
ifeq ($(distribution),Ubuntu)
304
ifeq (,$(findstring gnat, $(PKGSOURCE)))
305
ifneq (,$(findstring $(DEB_TARGET_ARCH),arm64 armel armhf))
306
with_linaro_branch = yes
310
ifeq ($(distribution)-$(DEB_TARGET_ARCH),Debian-arm64)
311
with_linaro_branch = yes
314
# check if we're building for armel or armhf
315
ifeq ($(DEB_TARGET_ARCH),armhf)
317
else ifneq (,$(filter $(distribution)-$(DEB_TARGET_ARCH), Ubuntu-armel))
318
ifneq (,$(filter $(distrelease),lucid maverick natty oneiric precise))
323
else ifneq (,$(filter $(DEB_TARGET_ARCH), arm armel))
327
# -------------------------------------------------------------------
330
# common things ---------------
331
# build common packages, where package names don't differ in different
332
# gcc versions (fixincludes, libgcj-common) ...
333
with_common_pkgs := yes
334
# ... and some libraries, which do not change (libgcc1, libmudflap, libssp0).
335
with_common_libs := yes
336
# XXX: should with_common_libs be "yes" only if this is the default compiler
337
# version on the targeted arch?
339
# is this a multiarch-enabled build?
340
ifeq (,$(filter $(distrelease),lenny etch squeeze dapper hardy jaunty karmic lucid maverick))
341
with_multiarch_lib := yes
344
ifeq ($(with_multiarch_lib),yes)
345
ifneq ($(single_package),yes)
346
ifeq ($(DEB_CROSS),yes)
347
ifeq ($(with_deps_on_target_arch_pkgs),yes)
348
with_multiarch_cxxheaders := yes
351
with_multiarch_cxxheaders := yes
356
ifeq (,$(filter $(distrelease),lenny etch squeeze dapper hardy jaunty karmic lucid maverick))
357
multiarch_stage1 := yes
360
# mapping for the non-default biarch multilib / multiarch names
361
multiarch_xarch_map = \
362
amd64=i386-linux-gnu,x86_64-linux-gnux32 \
363
armel=arm-linux-gnueabi \
364
armhf=arm-linux-gnueabihf \
365
i386=x86_64-linux-gnu,x86_64-linux-gnux32 \
366
powerpc=powerpc64-linux-gnu \
367
ppc64=powerpc-linux-gnu \
368
sparc=sparc64-linux-gnu \
369
sparc64=sparc-linux-gnu \
370
s390=s390x-linux-gnu \
371
s390x=s390-linux-gnu \
372
mips=mips64-linux-gnuabin32,mips64-linux-gnuabi64 \
373
mipsel=mips64el-linux-gnuabin32,mips64el-linux-gnuabi64 \
374
x32=x86_64-linux-gnu,i386-linux-gnu \
375
kfreebsd-amd64=i386-kfreebsd-gnu
376
xarch_multiarch_names = $(subst $(COMMA),$(SPACE),$(patsubst $(DEB_TARGET_ARCH)=%,%, \
377
$(filter $(DEB_TARGET_ARCH)=%,$(multiarch_xarch_map))))
379
multilib_multiarch_map = \
380
$(DEB_TARGET_ARCH)/=$(DEB_TARGET_MULTIARCH) \
381
amd64/32=i386-linux-gnu \
382
amd64/x32=x86_64-linux-gnux32 \
383
armel/hf=arm-linux-gnueabihf \
384
armhf/sf=arm-linux-gnueabi \
385
i386/64=x86_64-linux-gnu \
386
i386/x32=x86_64-linux-gnux32 \
387
powerpc/64=powerpc64-linux-gnu \
388
ppc64/32=powerpc-linux-gnu \
389
sparc/64=sparc64-linux-gnu \
390
sparc64/32=sparc-linux-gnu \
391
s390/64=s390x-linux-gnu \
392
s390x/32=s390-linux-gnu \
393
mips/n32=mips64-linux-gnuabin32 \
394
mips/64=mips64-linux-gnuabi64 \
395
mipsel/n32=mips64el-linux-gnuabin32 \
396
mipsel/64=mips64el-linux-gnuabi64 \
397
x32/32=i386-linux-gnu \
398
x32/64=x86_64-linux-gnu \
399
kfreebsd-amd64/32=i386-kfreebsd-gnu
400
# $(call mlib_to_march,<empty>|32|64|n32|x32|hf|sf)
401
mlib_to_march = $(patsubst $(DEB_TARGET_ARCH)/$(1)=%,%, \
402
$(filter $(DEB_TARGET_ARCH)/$(1)=%,$(multilib_multiarch_map)))
404
ifneq ($(DEB_STAGE),stage1)
405
# build a -base package.
406
ifneq ($(DEB_CROSS),yes)
409
ifneq ($(with_deps_on_target_arch_pkgs),yes)
415
# build dev packages.
420
# set lang when built from a different source package.
423
ifneq (,$(findstring gcc-snapshot, $(PKGSOURCE)))
427
else ifneq (,$(findstring gcc-linaro, $(PKGSOURCE)))
431
# --program-suffix=-$(BASE_VERSION)
432
versioned_packages := yes
435
#no_dummy_cpus := ia64 i386 hppa s390 sparc
436
#ifneq (,$(filter $(DEB_TARGET_ARCH_CPU),$(no_dummy_cpus)))
437
# with_base_only := no
438
# with_common_libs := yes
439
# with_common_pkgs := yes
441
# with_base_only := yes
442
# with_common_libs := no
443
# with_common_pkgs := no
447
ifeq ($(versioned_packages),yes)
448
pkg_ver := -$(BASE_VERSION)
452
# -------------------------------------------------------------------
453
# configure languages
455
# C ---------------------------
456
enabled_languages := c
458
# Build all packages needed for C development
459
ifneq ($(with_base_only),yes)
460
ifeq ($(with_dev),yes)
466
# Ada --------------------
467
ada_no_cpus := m32r sh3 sh3eb sh4 sh4eb
471
ifneq (,$(filter $(DEB_TARGET_ARCH),arm64 armhf m68k powerpcspe sh4 sparc64))
475
ifeq ($(with_dev),yes)
476
ifneq ($(separate_lang),yes)
480
ifneq (,$(filter $(DEB_TARGET_ARCH_CPU),$(ada_no_cpus)))
481
with_ada := disabled for cpu $(DEB_TARGET_ARCH_CPU)
483
ifneq (,$(findstring $(DEB_TARGET_GNU_SYSTEM),$(ada_no_systems)))
484
with_ada := disabled for system $(DEB_TARGET_GNU_SYSTEM)
486
ifeq ($(ada_no_cross)-$(DEB_CROSS),yes-yes)
487
with_ada := disabled for cross compiler package
489
ifeq ($(ada_no_snap)-$(single_package),yes-yes)
490
with_ada := disabled for snapshot build
492
with_ada := $(call envfilt, ada, , , $(with_ada))
494
ifneq ($(single_package),yes)
495
with_separate_gnat := yes
497
ifeq ($(with_ada)-$(with_separate_gnat),yes-yes)
498
ifneq (,$(findstring gnat,$(PKGSOURCE)))
502
debian_extra_langs += ada
503
with_ada := built from separate source
504
with_libgnat := built from separate source
508
ifeq ($(with_ada),yes)
509
enabled_languages += ada
511
# There are two exception handling mechanisms: ZCX (Zero-Cost
512
# eXceptions) and SJLJ (setjump/longjump), selected and supported by
513
# libgnat. Thus we build both versions of libgnat on architectures
514
# that support both (see ada-sjlj.diff). Most cpus support both
515
# mechanisms; here, we declare the few that support only one.
516
libgnat_zcx_only_cpus :=
517
libgnat_sjlj_only_cpus := arm armel armhf
518
ifneq (,$(filter $(DEB_TARGET_ARCH_CPU),$(libgnat_sjlj_only_cpus)))
523
ifneq (,$(filter $(DEB_TARGET_ARCH_CPU),$(libgnat_zcx_only_cpus)))
526
with_gnat_sjlj := yes
528
ifeq ($(with_gnat_zcx)-$(with_gnat_sjlj),no-no)
529
# TODO: support cpus that do not support exceptions at all,
530
# perhaps by building a restricted runtime library? For now, flag
531
# this as a packaging error.
532
$(error this target supports neither ZCX nor SJLJ)
536
# C++ -------------------------
538
ifneq ($(with_base_only),yes)
539
ifneq ($(separate_lang),yes)
543
ifneq (,$(findstring $(DEB_TARGET_ARCH_CPU),$(cxx_no_cpus)))
544
with_cxx := disabled for cpu $(DEB_TARGET_ARCH_CPU)
546
with_cxx := $(call envfilt, c++, obj-c++ java, , $(with_cxx))
548
# Build all packages needed for C++ development
549
ifeq ($(with_cxx),yes)
550
ifeq ($(with_dev),yes)
552
with_libcxxdbg := yes
554
ifeq ($(with_common_pkgs),yes)
558
# debugging versions of libstdc++
559
ifneq (,$(findstring gcc-, $(PKGSOURCE)))
560
ifeq ($(with_cxxdev),yes)
563
ifneq (,$(findstring $(DEB_TARGET_ARCH_CPU),$(debug_no_cpus)))
564
with_debug := disabled for cpu $(DEB_TARGET_GNU_CPU)
568
with_debug := $(call envfilt, debug, , , $(with_debug))
570
enabled_languages += c++
573
# Java --------------------
574
# - To build a standalone gcj package (with no corresponding gcc
575
# package): with_separate_libgcj=yes, with_standalone_gcj=yes
576
# - To build the java packages from the gcc source package:
577
# with_separate_libgcj=no, with_standalone_gcj=no
578
# - To build gcc and java from separate sources:
579
# with_separate_libgcj=yes, with_standalone_gcj=no
581
java_no_cpus := # arm64 mips mipsel
584
ifneq ($(single_package),yes)
585
with_separate_libgcj := yes
587
with_separate_libgcj := no
588
with_standalone_gcj := no
590
ifneq ($(separate_lang),yes)
594
# java converted for V3 C++ ABI for some archs
595
ifeq ($(with_base_only),yes)
598
ifneq (,$(filter $(DEB_TARGET_ARCH_CPU),$(java_no_cpus)))
599
with_java := disabled for cpu $(DEB_TARGET_ARCH_CPU)
601
ifneq (,$(filter $(DEB_TARGET_GNU_SYSTEM),$(java_no_systems)))
602
with_java := disabled for system $(DEB_TARGET_GNU_SYSTEM)
604
ifeq ($(java_no_cross)-$(DEB_CROSS),yes-yes)
605
with_java := disabled for cross compiler package
607
with_java := $(call envfilt, java, , c++, $(with_java))
609
ifeq ($(with_java)-$(with_separate_libgcj),yes-yes)
610
ifneq (,$(findstring gcj, $(PKGSOURCE)))
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
621
with_java_plugin := no
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)))
629
java_cpu = $(DEB_TARGET_ARCH_CPU)
631
java_priority = 10$(subst .,,$(BASE_VERSION))
636
ifneq (,$(findstring gcj-4,$(PKGSOURCE)))
637
ifneq (,$(filter $(DEB_TARGET_ARCH), arm))
638
with_gcj_base_only := yes
642
ifeq ($(single_package),yes)
646
#ifneq (,$(filter $(DEB_TARGET_ARCH),hppa))
647
# with_native_ecj := yes
650
with_java_maintainer_mode := no
652
# used as well in debian/rules.conf to determine the build deps
653
java_awt_peers = gtk # qt # xlib
655
ifeq ($(with_common_libs),yes)
656
with_libgcj_doc := yes
659
# Build all packages needed for Java development (gcj, libgcj-dev)
660
ifeq ($(with_dev),yes)
665
with_java_alsa := yes
666
ifeq (,$(filter $(DEB_TARGET_GNU_SYSTEM),linux-gnu))
670
# Just build the cross compiler to be able to cross build a native build.
671
ifeq ($(DEB_CROSS),yes)
675
enabled_languages += java
678
# Go -------------------
679
# - To build a standalone gccgo package (with no corresponding gcc
680
# package): with_separate_libgo=yes, with_standalone_go=yes
681
# - To build the go packages from the gcc source package:
682
# with_separate_libgo=no, with_standalone_go=no
683
# - To build gcc and go from separate sources:
684
# with_separate_libgo=yes, with_standalone_go=no
689
ifneq (,$(findstring gccgo, $(PKGSOURCE)))
690
with_separate_libgo := yes
691
with_standalone_go := yes
694
go_no_cpus := avr arm arm64 hppa m68k sh4 sparc sparc64
695
ifeq (,$(filter $(distrelease),lenny etch squeeze dapper hardy jaunty karmic lucid maverick natty oneiric))
696
go_no_cpus := $(filter-out arm, $(go_no_cpus))
698
go_no_systems := gnu kfreebsd-gnu
700
ifneq ($(with_base_only),yes)
701
ifneq ($(separate_lang),yes)
705
ifneq (,$(filter $(DEB_TARGET_ARCH_CPU),$(go_no_cpus)))
706
with_go := disabled for cpu $(DEB_TARGET_ARCH_CPU)
708
ifneq (,$(findstring $(DEB_TARGET_GNU_SYSTEM),$(go_no_systems)))
709
with_go := disabled for system $(DEB_TARGET_GNU_SYSTEM)
711
ifeq ($(go_no_cross)-$(DEB_CROSS),yes-yes)
712
with_go := disabled for cross compiler package
714
with_go := $(call envfilt, go, , , $(with_go))
716
# Build all packages needed for Go development
717
ifneq (,$(findstring gcc, $(PKGSOURCE)))
718
ifeq ($(with_go),yes)
719
ifeq ($(with_common_libs),yes)
722
enabled_languages += go
726
ifeq ($(with_go)-$(with_separate_libgo),yes-yes)
727
ifneq (,$(findstring gccgo, $(PKGSOURCE)))
728
languages := c c++ go
731
debian_extra_langs += go
732
with_go := built from separate source
733
with_libgo := buit from separate source
737
# D ---------------------------
742
ifneq ($(single_package),yes)
743
with_separate_gdc := yes
745
with_separate_gdc := no
747
ifneq ($(separate_lang),yes)
750
ifneq (,$(filter $(DEB_TARGET_ARCH_CPU),$(d_no_cpus)))
751
with_d := disabled for cpu $(DEB_TARGET_ARCH_CPU)
753
ifeq ($(d_no_snap)-$(single_package),yes-yes)
754
with_d := disabled for snapshot build
756
with_d := $(call envfilt, d, , , $(with_d))
758
ifeq ($(with_base_only),yes)
762
ifeq ($(with_d)-$(with_separate_gdc),yes-yes)
763
ifneq (,$(findstring gdc,$(PKGSOURCE)))
767
# FIXME: language selection needs improvement.
768
with_go := disabled for d
770
debian_extra_langs += d
771
with_d := built from separate source
776
libphobos_archs = amd64 i386 x32 kfreebsd-amd64 kfreebsd-i386
777
ifneq (,$(filter $(DEB_TARGET_ARCH), $(libphobos_archs)))
778
with_libphobos := yes
781
libphobos_no_cpus := alpha avr arm arm64 hppa ia64 m68k mips mipsel powerpc powerpcspe ppc64 s390 s390x sh4 sparc sparc64
782
libphobos_no_systems := gnu kfreebsd-gnu
783
ifneq (,$(findstring $(DEB_TARGET_ARCH_CPU),$(libphobos_no_cpus)))
784
with_libphobos := disabled for cpu $(DEB_TARGET_ARCH_CPU)
786
ifneq (,$(findstring $(DEB_TARGET_GNU_SYSTEM),$(libphobos_no_systems)))
787
with_libphobos := disabled for system $(DEB_TARGET_GNU_SYSTEM)
790
enabled_languages += d
793
# Fortran 95 -------------------
794
fortran_no_cross := yes
795
fortran_no_cross := no
797
ifneq ($(with_base_only),yes)
798
ifneq ($(separate_lang),yes)
802
ifeq ($(fortran_no_cross)-$(DEB_CROSS),yes-yes)
803
with_fortran := disabled for cross compiler package
805
with_fortran := $(call envfilt, fortran, , , $(with_fortran))
807
# Build all packages needed for Fortran development
808
ifeq ($(with_fortran),yes)
809
ifeq ($(with_dev),yes)
812
ifeq ($(with_common_libs),yes)
813
with_libgfortran := yes
815
enabled_languages += fortran
818
# libquadmath -------------------
820
ifneq (,$(findstring $(DEB_TARGET_ARCH_CPU), ia64 i386 i486 i586 i686 amd64))
821
# FIXME: upstream build tied to gfortran build
822
ifeq ($(with_fortran),yes)
824
ifneq (,$(findstring gcc-4,$(PKGSOURCE)))
825
ifeq ($(with_common_libs),yes)
832
# ObjC ------------------------
835
ifneq ($(with_base_only),yes)
836
ifneq ($(separate_lang),yes)
838
objc_no_archs = arm64
839
ifneq (,$(filter $(DEB_TARGET_ARCH),$(objc_no_archs)))
844
ifeq ($(objc_no_cross)-$(DEB_CROSS),yes-yes)
845
with_objc := disabled for cross compiler package
847
with_objc := $(call envfilt, objc, obj-c++, , $(with_objc))
849
ifeq ($(with_objc),yes)
850
# the ObjC runtime with garbage collection enabled needs the Boehm GC
853
# disable ObjC garbage collection library (needs libgc)
854
libgc_no_cpus := arm64 avr mips mipsel # alpha amd64 arm armel armhf hppa i386 ia64 m68k mips mipsel powerpc ppc64 s390 s390x sparc
855
libgc_no_systems := knetbsd-gnu
856
ifneq (,$(filter $(DEB_TARGET_ARCH_CPU),$(libgc_no_cpus)))
857
with_objc_gc := disabled for cpu $(DEB_TARGET_ARCH_CPU)
859
ifneq (,$(findstring $(DEB_TARGET_GNU_SYSTEM),$(libgc_no_systems)))
860
with_objc_gc := disabled for system $(DEB_TARGET_GNU_SYSTEM)
863
# Build all packages needed for Objective-C development
864
ifeq ($(with_dev),yes)
867
# libobjc soname change in 4.7
868
#ifeq ($(with_common_libs),yes)
872
enabled_languages += objc
875
# ObjC++ ----------------------
876
objcxx_no_cross := no
878
ifeq ($(with_objc),yes)
879
ifneq ($(with_base_only),yes)
880
ifneq ($(separate_lang),yes)
885
ifeq ($(objcxx_no_cross)-$(DEB_CROSS),yes-yes)
886
with_objcxx := disabled for cross compiler package
888
with_objcxx := $(call envfilt, obj-c++, , c++ objc, $(with_objcxx))
890
ifeq ($(with_objcxx),yes)
891
enabled_languages += obj-c++
894
# -------------------------------------------------------------------
897
# not built from the main source package
898
ifeq (,$(findstring gcc-,$(PKGSOURCE)))
903
ifeq ($(trunk_build),yes)
906
with_nls := $(call envfilt, nls, , , $(with_nls))
908
# powerpc nof libraries -----
911
ifneq (,$(findstring gcc-4,$(PKGSOURCE)))
914
with_source := $(call envfilt, source, , , $(with_source))
916
# ssp & libssp -------------------------
918
ssp_no_archs = alpha arm64 hppa ia64 m68k
919
ifneq (, $(filter $(DEB_TARGET_ARCH),$(ssp_no_archs) $(ssp_no_archs:%=uclibc-%)))
920
with_ssp := not available on $(DEB_TARGET_ARCH)
922
with_ssp := $(call envfilt, ssp, , , $(with_ssp))
924
ifeq ($(with_ssp),yes)
925
ifneq ($(distribution),Debian)
926
ifneq (,$(findstring gcc-4, $(PKGSOURCE)))
927
with_ssp_default := yes
932
# mudflap -------------------
934
with_mudflap := $(call envfilt, mudflap, , , $(with_mudflap))
935
mudflap_no_archs = arm64
936
ifneq (,$(filter $(DEB_TARGET_ARCH),$(mudflap_no_archs)))
940
# gomp --------------------
942
with_gomp := $(call envfilt, gomp, , , $(with_gomp))
943
gomp_no_archs = arm64
944
ifneq (,$(filter $(DEB_TARGET_ARCH),$(gomp_no_archs)))
948
# itm --------------------
949
itm_archs = amd64 i386 x32
950
ifneq (,$(filter $(DEB_TARGET_ARCH),$(itm_archs)))
953
with_itm := $(call envfilt, itm, , , $(with_itm))
955
# atomic --------------------
957
atomic_no_archs = arm64
958
ifneq (,$(filter $(DEB_TARGET_ARCH),$(atomic_no_archs)))
962
# backtrace --------------------
963
with_backtrace := yes
964
backtrace_no_archs = m68k
965
ifneq (,$(filter $(DEB_TARGET_ARCH),$(backtrace_no_archs)))
969
# asan / sanitizer --------------------
971
with_asan := $(call envfilt, asan, , , $(with_asan))
972
asan_archs = amd64 armel armhf i386 powerpc ppc64 sparc sparc64 x32
973
ifneq (,$(filter $(DEB_TARGET_ARCH),$(asan_archs)))
977
# tsan / sanitizer --------------------
979
with_tsan := $(call envfilt, tsan, , , $(with_tsan))
981
ifneq (,$(filter $(DEB_TARGET_ARCH),$(tsan_archs)))
985
# gold --------------------
986
# armel with binutils 2.20.51 only
987
gold_archs = amd64 armel armhf i386 lpia powerpc ppc64 sparc sparc64
988
ifneq (,$(filter $(DEB_TARGET_ARCH),$(gold_archs)))
992
# plugins --------------------
995
endif # ifndef DEB_STAGE
997
# Don't include docs with GFDL invariant sections
998
GFDL_INVARIANT_FREE := yes
999
ifeq ($(distribution),Ubuntu)
1000
GFDL_INVARIANT_FREE := no
1003
# -------------------------------------------------------------------
1005
ifeq ($(extra_package),yes)
1006
ifeq ($(with_separate_libgcj)-$(with_standalone_gcj),yes-no)
1016
ifneq ($(DEB_CROSS),yes)
1019
with_gcjxbase := yes
1022
ifeq ($(with_separate_libgo),yes)
1033
# libssp ------------------
1034
ifeq ($(with_ssp)-$(with_common_libs),yes-yes)
1035
#ifneq ($(DEB_CROSS),yes)
1036
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))
1040
# libmudflap --------------
1041
ifeq ($(with_mudflap)-$(with_common_libs),yes-yes)
1042
with_libmudflap := yes
1045
# libgomp -----------------
1046
ifeq ($(with_gomp)-$(with_common_libs),yes-yes)
1047
#ifneq ($(DEB_CROSS),yes)
1052
# libitm -----------------
1053
ifeq ($(with_itm)-$(with_common_libs),yes-yes)
1054
#ifneq ($(DEB_CROSS),yes)
1059
# libatomic -----------------
1060
ifeq ($(with_atomic)-$(with_common_libs),yes-yes)
1061
#ifneq ($(DEB_CROSS),yes)
1062
with_libatomic := yes
1066
# libbacktrace -----------------
1067
ifeq ($(with_backtrace)-$(with_common_libs),yes-yes)
1068
#ifneq ($(DEB_CROSS),yes)
1069
# currently not a shared library
1070
#with_libbacktrace := yes
1074
# libasan -----------------
1075
ifeq ($(with_asan)-$(with_common_libs),yes-yes)
1076
#ifneq ($(DEB_CROSS),yes)
1081
# libtsan -----------------
1082
ifeq ($(with_tsan)-$(with_common_libs),yes-yes)
1083
#ifneq ($(DEB_CROSS),yes)
1088
# libquadmath -----------------
1089
ifeq ($(with_qmath)-$(with_common_libs),yes-yes)
1090
#ifneq ($(DEB_CROSS),yes)
1091
with_libqmath := yes
1095
# fixincludes -------
1096
ifneq ($(DEB_CROSS),yes)
1097
ifeq ($(with_common_pkgs),yes)
1102
# Shared libgcc --------------------
1103
ifneq ($(DEB_STAGE),stage1)
1104
with_shared_libgcc := yes
1105
ifeq ($(with_common_libs),yes)
1110
# libgcc-math --------------------
1112
ifneq (,$(findstring i486,$(DEB_TARGET_ARCH)))
1113
#with_libgccmath := yes
1114
#with_lib64gmath := yes
1115
#with_libgmathdev := yes
1117
ifeq ($(DEB_TARGET_ARCH),amd64)
1118
#with_libgccmath := yes
1119
#with_lib32gmath := yes
1120
#with_libgmathdev := yes
1123
# hppa64 build ----------------
1124
hppa64_no_snap := no
1125
ifeq ($(DEB_TARGET_ARCH),hppa)
1128
ifeq ($(hppa64_no_snap)-$(trunk_build),yes-yes)
1129
with_hppa64 := disabled for snapshot build
1131
with_hppa64 := $(call envfilt, hppa64, , , $(with_hppa64))
1133
# neon build -------------------
1134
# FIXME: build as a cross compiler to build on armv4 as well
1135
ifneq (,$(findstring gcc-4, $(PKGSOURCE)))
1136
ifeq ($(distribution),Ubuntu)
1137
# neon_archs = armel armhf
1138
# ifneq (, $(filter $(DEB_TARGET_ARCH),$(neon_archs)))
1145
# run testsuite ---------------
1147
# if you don't want to run the gcc testsuite, uncomment the next line
1148
#with_check := disabled by hand
1149
ifeq ($(with_base_only),yes)
1152
ifeq ($(DEB_CROSS),yes)
1153
with_check := disabled for cross compiler package
1155
ifeq ($(REVERSE_CROSS),yes)
1156
with_check := disabled for reverse cross build
1158
check_no_cpus := m68k
1159
check_no_systems := gnu
1160
ifneq (,$(findstring $(DEB_TARGET_ARCH_CPU),$(check_no_cpus)))
1161
with_check := disabled for cpu $(DEB_TARGET_ARCH_CPU)
1163
ifneq (,$(findstring $(DEB_TARGET_GNU_SYSTEM),$(check_no_systems)))
1164
with_check := disabled for system $(DEB_TARGET_GNU_SYSTEM)
1166
ifeq ($(distribution)-$(DEB_HOST_ARCH),Ubuntu-hppa)
1167
ifneq ($(single_package),yes)
1168
with_check := disabled, testsuite timeouts with expect
1171
ifneq (,$(findstring gdc,$(PKGSOURCE)))
1172
with_check := disabled for D
1174
with_check := $(call envfilt, check, , , $(with_check))
1176
with_check := disabled by environment
1178
ifneq ($(findstring nocheck, $(DEB_BUILD_OPTIONS)),)
1179
with_check := disabled by DEB_BUILD_OPTIONS
1181
ifneq (,$(filter $(DEB_HOST_ARCH), armel armhf hppa))
1182
ifneq ($(single_package),yes)
1183
with_check := disabled for $(DEB_HOST_ARCH), testsuite timeouts with expect
1186
#with_check := disabled for this upload
1188
# not a dependency on all archs, but if available, use it for the testsuite
1189
ifneq (,$(wildcard /usr/bin/localedef))
1190
locale_data = generate
1193
all_enabled_languages := $(enabled_languages)
1194
languages_without_lang_opt := c++ objc obj-c++
1196
debian_extra_langs := $(subst obj-c++,objcp,$(debian_extra_langs))
1197
export debian_extra_langs
1200
biarch_map := i686=x86_64 powerpc=powerpc64 sparc=sparc64 sparc64=sparc s390=s390x s390x=s390 \
1201
x86_64=i686 powerpc64=powerpc mips=mips64 mipsel=mips64el
1202
ifeq (,$(filter $(distrelease),lenny etch squeeze wheezy sid dapper hardy jaunty karmic lucid))
1203
biarch_map := $(subst i686=,i486=,$(biarch_map))
1205
ifeq ($(distribution),Ubuntu)
1206
ifeq (,$(filter $(distrelease),dapper hardy jaunty karmic lucid maverick natty))
1207
biarch_map += arm=arm
1210
biarch_cpu := $(strip $(patsubst $(DEB_TARGET_GNU_CPU)=%,%, \
1211
$(filter $(DEB_TARGET_GNU_CPU)=%,$(biarch_map))))
1221
ifneq (yes,$$(call envfilt, biarch, , ,yes))
1224
ifneq (,$$(findstring /$$(DEB_TARGET_ARCH)/,$$(biarch$1archs)))
1227
#biarch$1subdir = $$(biarch_cpu)-$$(DEB_TARGET_GNU_SYSTEM)
1229
ifeq ($$(with_libgcc),yes)
1230
with_lib$1gcc := yes
1232
ifeq ($$(with_cdev),yes)
1233
with_lib$1gccdev := yes
1235
ifeq ($$(with_libcxx),yes)
1236
with_lib$1cxx := yes
1238
ifeq ($$(with_libcxxdbg),yes)
1239
with_lib$1cxxdbg := yes
1241
ifeq ($$(with_cxxdev),yes)
1242
with_lib$1cxxdev := yes
1244
ifeq ($$(with_libobjc),yes)
1245
with_lib$1objc := yes
1247
ifeq ($$(with_objcdev),yes)
1248
with_lib$1objcdev := yes
1250
ifeq ($$(with_libgfortran),yes)
1251
with_lib$1gfortran := yes
1253
ifeq ($$(with_fdev),yes)
1254
with_lib$1gfortrandev := yes
1256
ifeq ($$(with_libmudflap),yes)
1257
with_lib$1mudflap := yes
1259
ifeq ($$(with_libssp),yes)
1260
with_lib$1ssp := yes
1262
ifeq ($$(with_libgomp),yes)
1263
with_lib$1gomp:= yes
1265
ifeq ($$(with_libitm),yes)
1268
ifeq ($$(with_libatomic),yes)
1269
with_lib$1atomic:= yes
1271
ifeq ($$(with_libbacktrace),yes)
1272
with_lib$1backtrace:= yes
1274
ifeq ($$(with_libasan),yes)
1275
with_lib$1asan:= yes
1277
ifeq ($$(with_libtsan),yes)
1278
with_lib$1tsan:= yes
1280
ifeq ($$(with_libqmath),yes)
1281
with_lib$1qmath := yes
1283
ifeq ($$(with_libgo),yes)
1287
biarch_multidir_names = libiberty libgcc
1288
ifneq (,$$(findstring gcc-, $$(PKGSOURCE)))
1289
biarch_multidir_names += libstdc++-v3 libobjc libgfortran libssp \
1290
libgomp libmudflap zlib libitm \
1291
libbacktrace libatomic libsanitizer
1292
ifeq ($$(with_objc_gc),yes)
1293
biarch_multidir_names += boehm-gc
1296
ifneq (,$(findstring yes, $(with_java) $(with_go)))
1297
biarch_multidir_names += libffi
1299
ifeq ($(with_fortran),yes)
1300
biarch_multidir_names += libquadmath
1302
ifeq ($(with_go),yes)
1303
biarch_multidir_names += libgo
1305
ifeq ($(with_d),yes)
1306
biarch_multidir_names += libphobos
1308
export biarch_multidir_names
1309
ifneq (,$$(findstring 32,$1))
1310
TARGET64_MACHINE := $$(strip $$(subst $$(DEB_TARGET_GNU_CPU),$$(biarch_cpu), \
1312
TARGET32_MACHINE := $$(TARGET_ALIAS)
1314
TARGET64_MACHINE := $$(TARGET_ALIAS)
1315
TARGET64_MACHINE := $$(strip $$(subst $$(DEB_TARGET_GNU_CPU),$$(biarch_cpu), \
1318
export TARGET32_MACHINE
1319
export TARGET64_MACHINE
1322
biarch32archs := /amd64/ppc64/kfreebsd-amd64/s390x/sparc64/x32/
1323
biarch64archs := /i386/powerpc/sparc/s390/mips/mipsel/x32/
1324
biarchn32archs := /mips/mipsel/
1325
ifeq ($(distribution),Ubuntu)
1326
ifeq (,$(filter $(distrelease),dapper hardy jaunty karmic lucid maverick natty))
1327
biarchhfarchs := /armel/
1328
biarchsfarchs := /armhf/
1330
ifeq (,$(filter $(distrelease),dapper hardy jaunty karmic lucid maverick natty oneiric precise quantal))
1331
biarchx32archs := /amd64/i386/
1334
ifeq ($(distribution),Debian)
1335
#ifeq (,$(filter $(distrelease),etch squeeze wheezy))
1336
ifeq (,$(filter $(distrelease),etch squeeze))
1337
biarchx32archs := /amd64/i386/
1340
$(foreach x,32 64 n32 x32 hf sf,$(eval $(call gen_biarch,$(x))))
1342
#ifeq ($(DEB_TARGET_ARCH),ia64)
1346
#ifeq ($(trunk_build),yes)
1347
# no_biarch_libs := yes
1349
ifdef DEB_CROSS_NO_BIARCH
1350
no_biarch_libs := yes
1353
ifeq ($(no_biarch_libs),yes)
1356
with_lib64cxxdbg := no
1357
with_lib64objc := no
1360
with_lib64gfortran := no
1361
with_lib64mudflap := no
1364
with_lib64gomp := no
1366
with_lib64qmath := no
1367
with_lib64atomic := no
1368
with_lib64backtrace := no
1369
with_lib64asan := no
1370
with_lib64tsan := no
1371
with_lib64gccdev := no
1372
with_lib64cxxdev := no
1373
with_lib64objcdev := no
1374
with_lib64gfortrandev := no
1378
with_lib32cxxdbg := no
1379
with_lib32objc := no
1382
with_lib32gfortran := no
1383
with_lib32mudflap := no
1386
with_lib32gomp := no
1388
with_lib32qmath := no
1389
with_lib32atomic := no
1390
with_lib32backtrace := no
1391
with_lib32asan := no
1392
with_lib32tsan := no
1393
with_lib32gccdev := no
1394
with_lib32cxxdev := no
1395
with_lib32objcdev := no
1396
with_lib32gfortrandev := no
1398
with_libn32gcc := no
1399
with_libn32cxx := no
1400
with_libn32cxxdbg := no
1401
with_libn32objc := no
1402
with_libn32ffi := no
1403
with_libn32gcj := no
1404
with_libn32gfortran := no
1405
with_libn32mudflap := no
1406
with_libn32ssp := no
1408
with_libn32gomp := no
1409
with_libn32itm := no
1410
with_libn32qmath := no
1411
with_libn32atomic := no
1412
with_libn32backtrace := no
1413
with_libn32asan := no
1414
with_libn32tsan := no
1415
with_libn32gccdev := no
1416
with_libn32cxxdev := no
1417
with_libn32objcdev := no
1418
with_libn32gfortrandev:= no
1420
with_libx32gcc := no
1421
with_libx32cxx := no
1422
with_libx32cxxdbg := no
1423
with_libx32objc := no
1424
with_libx32ffi := no
1425
with_libx32gcj := no
1426
with_libx32gfortran := no
1427
with_libx32mudflap := no
1428
with_libx32ssp := no
1430
with_libx32gomp := no
1431
with_libx32itm := no
1432
with_libx32qmath := no
1433
with_libx32atomic := no
1434
with_libx32backtrace := no
1435
with_libx32asan := no
1436
with_libx32tsan := no
1437
with_libx32gccdev := no
1438
with_libx32cxxdev := no
1439
with_libx32objcdev := no
1440
with_libx32gfortrandev:= no
1444
with_libhfcxxdbg := no
1445
with_libhfobjc := no
1448
with_libhfgfortran := no
1449
with_libhfmudflap := no
1452
with_libhfgomp := no
1454
with_libhfqmath := no
1455
with_libhfatomic := no
1456
with_libhfbacktrace := no
1457
with_libhfasan := no
1458
with_libhftsan := no
1459
with_libhfgccdev := no
1460
with_libhfcxxdev := no
1461
with_libhfobjcdev := no
1462
with_libhfgfortrandev := no
1466
with_libsfcxxdbg := no
1467
with_libsfobjc := no
1470
with_libsfgfortran := no
1471
with_libsfmudflap := no
1474
with_libsfgomp := no
1476
with_libsfqmath := no
1477
with_libsfatomic := no
1478
with_libsfbacktrace := no
1479
with_libsfasan := no
1480
with_libsftsan := no
1481
with_libsfgccdev := no
1482
with_libsfcxxdev := no
1483
with_libsfobjcdev := no
1484
with_libsfgfortrandev := no
1486
with_java_plugin := no
1488
ifdef DEB_CROSS_NO_BIARCH
1489
biarch64 := disabled by DEB_CROSS_NO_BIARCH
1490
biarch32 := disabled by DEB_CROSS_NO_BIARCH
1491
biarchn32 := disabled by DEB_CROSS_NO_BIARCH
1492
biarchx32 := disabled by DEB_CROSS_NO_BIARCH
1493
biarchhf := disabled by DEB_CROSS_NO_BIARCH
1494
biarchsf := disabled by DEB_CROSS_NO_BIARCH
1497
ifeq ($(with_ada)-$(with_separate_gnat),yes-yes)
1498
biarchhf := disabled for Ada
1499
biarchsf := disabled for Ada
1504
ifneq (,$(filter yes,$(biarch32) $(biarch64) $(biarchn32) $(biarchx32) $(biarchhf) $(biarchsf)))
1508
multilib_archs = $(sort $(subst /, , $(biarch64archs) $(biarch32archs) $(biarchn32archs) $(biarchx32archs) $(biarchhfarchs) $(biarchsfarchs)))
1511
$(if $(filter yes,$(biarch64)),$(biarch64subdir),) \
1512
$(if $(filter yes,$(biarch32)),$(biarch32subdir),) \
1513
$(if $(filter yes,$(biarchn32)),$(biarchn32subdir),) \
1514
$(if $(filter yes,$(biarchx32)),$(biarchx32subdir),) \
1515
$(if $(filter yes,$(biarchhf)),$(biarchhfsubdir),) \
1516
$(if $(filter yes,$(biarchsf)),$(biarchsfsubdir),)
1517
biarchsubdirs := {$(strip $(shell echo $(biarchsubdirs) | tr " " ","))}
1520
force_gnu_locales := yes
1522
locale_no_systems :=
1523
ifneq (,$(findstring $(DEB_TARGET_GNU_SYSTEM),$(locale_no_systems)))
1524
force_gnu_locales := disabled for system $(DEB_TARGET_GNU_SYSTEM)
1527
gcc_tarpath := $(firstword $(wildcard gcc-*.tar.* /usr/src/gcc-4.8/gcc-*.tar.*))
1528
gcc_tarball := $(notdir $(gcc_tarpath))
1529
gcc_srcdir := $(subst -dfsg,,$(patsubst %.tar.xz,%,$(patsubst %.tar.lzma,%,$(patsubst %.tar.gz,%,$(gcc_tarball:.tar.bz2=)))))
1531
ifeq ($(with_d),yes)
1532
gdc_tarpath := $(firstword $(wildcard gdc-*.tar.* /usr/src/gcc-$(BASE_VERSION)/gdc-*.tar.*))
1533
gdc_tarball := $(notdir $(gdc_tarpath))
1534
gdc_srcdir := $(patsubst %.tar.xz,%,$(patsubst %.tar.lzma,%,$(patsubst %.tar.gz,%,$(gdc_tarball:.tar.bz2=))))
1537
# NOTE: This is not yet used. when building gcj, gdc or gnat using the
1538
# gcc-source package, we don't require an exact binary dependency.
1539
ifneq ($(dir $(gcc_tarpath)),./)
1540
built_using_external_source := yes
1542
built_using_external_source :=
1544
ifeq ($(DEB_CROSS),yes)
1545
add_built_using = yes
1548
ecj_jar := $(firstword $(wildcard ecj.jar /usr/share/java/eclipse-ecj.jar /usr/share/java/ecj.jar))
1550
unpack_stamp := $(stampdir)/01-unpack-stamp
1551
pre_patch_stamp := $(stampdir)/02-pre-patch-stamp
1552
patch_stamp := $(stampdir)/02-patch-stamp
1553
control_stamp := $(stampdir)/03-control-stamp
1554
configure_stamp := $(stampdir)/04-configure-stamp
1555
build_stamp := $(stampdir)/05-build-stamp
1556
build_html_stamp := $(stampdir)/05-build-html-stamp
1557
build_locale_stamp := $(stampdir)/05-build-locale-stamp
1558
build_doxygen_stamp := $(stampdir)/05-build-doxygen-stamp
1559
build_javasrc_stamp := $(stampdir)/05-build-javasrc-stamp
1560
build_javadoc_stamp := $(stampdir)/05-build-javadoc-stamp
1561
check_stamp := $(stampdir)/06-check-stamp
1562
check_inst_stamp := $(stampdir)/06-check-inst-stamp
1563
install_stamp := $(stampdir)/07-install-stamp
1564
install_snap_stamp := $(stampdir)/07-install-snap-stamp
1565
binary_stamp := $(stampdir)/08-binary-stamp
1567
configure_dummy_stamp := $(stampdir)/04-configure-dummy-stamp
1568
build_dummy_stamp := $(stampdir)/05-build-dummy-stamp
1569
install_dummy_stamp := $(stampdir)/07-install-dummy-stamp
1571
configure_hppa64_stamp := $(stampdir)/04-configure-hppa64-stamp
1572
build_hppa64_stamp := $(stampdir)/05-build-hppa64-stamp
1573
install_hppa64_stamp := $(stampdir)/07-install-hppa64-stamp
1575
configure_neon_stamp := $(stampdir)/04-configure-neon-stamp
1576
build_neon_stamp := $(stampdir)/05-build-neon-stamp
1577
install_neon_stamp := $(stampdir)/07-install-neon-stamp
1579
control_dependencies := $(patch_stamp)
1581
ifeq ($(single_package),yes)
1582
configure_dependencies = $(configure_stamp)
1583
build_dependencies = $(build_stamp)
1584
install_dependencies = $(install_snap_stamp)
1585
ifeq ($(with_check),yes)
1586
check_dependencies += $(check_stamp)
1589
ifeq ($(with_base_only),yes)
1590
configure_dependencies = $(configure_dummy_stamp)
1591
build_dependencies = $(build_dummy_stamp)
1592
install_dependencies = $(install_dummy_stamp)
1594
configure_dependencies = $(configure_stamp)
1595
build_dependencies = $(build_stamp)
1596
install_dependencies = $(install_stamp)
1597
ifeq ($(with_check),yes)
1598
check_dependencies += $(check_stamp)
1603
ifneq (,$(findstring gcj-, $(PKGSOURCE)))
1604
ifeq ($(with_gcj_base_only),yes)
1605
configure_dependencies = $(configure_dummy_stamp)
1606
build_dependencies = $(build_dummy_stamp)
1607
install_dependencies = $(install_dummy_stamp)
1611
ifeq ($(with_neon),yes)
1612
build_dependencies += $(build_neon_stamp)
1613
install_dependencies += $(install_neon_stamp)
1616
ifeq ($(with_hppa64),yes)
1617
build_dependencies += $(build_hppa64_stamp)
1618
ifneq ($(trunk_build),yes)
1619
install_dependencies += $(install_hppa64_stamp)
1623
build_dependencies += $(check_dependencies)
1626
mkdir -p $(stampdir)
1628
ifeq ($(DEB_CROSS),yes)
1629
ifneq ($(with_deps_on_target_arch_pkgs),yes)
1630
define cross_mangle_shlibs
1631
sed -i s/$(cross_lib_arch)//g debian/$(1)/DEBIAN/shlibs
1633
define cross_mangle_substvars
1634
if [ -f debian/$(1).substvars ]; then \
1635
sed -i 's/lib[^ ,(]*/&$(cross_lib_arch)/g' debian/$(1).substvars; \
1639
define cross_mangle_shlibs
1641
define cross_mangle_substvars
1645
define cross_mangle_shlibs
1647
define cross_mangle_substvars
1649
# precise's dh_shlibdeps doesn't work well for ARM multilibs
1650
# and dh_shlibdeps doesn't work well for cross builds, see #698881.
1651
ifneq (,$(filter $(distrelease),precise quantal raring))
1652
ifneq (,$(filter $(DEB_TARGET_ARCH), armel armhf arm64))
1658
# takes a *list* of package names as $1, the multilib dirname as $2
1660
$(if $(strip $(1)), \
1661
$(shell find $(foreach p,$(1),$(CURDIR)/debian/$(p)) \
1662
-name '*.so.*' -printf '%h ' | uniq)) \
1663
$(with_build_sysroot)/lib/$(call mlib_to_march,$(2)) \
1664
$(with_build_sysroot)/usr/lib/$(call mlib_to_march,$(2)) \
1665
$(with_build_sysroot)$(subst /usr,,/$(usr_lib$(2))) \
1666
$(with_build_sysroot)/$(usr_lib$(2)) \
1667
$(if $(filter yes,$(biarchsf) $(biarchhf)), \
1668
$(with_build_sysroot)/usr/$(call mlib_to_march,$(2))/lib)
1669
shlibdirs_to_search = -l$(subst $(SPACE),:,$(foreach d,$(_shlibdirs),$(d)))
1673
ifneq (,$(filter $(DEB_TARGET_ARCH), mips mipsel))
1674
ifneq ($(with_deps_on_target_arch_pkgs),yes)
1675
define cross_mangle_control
1676
$(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,@:)
1677
$(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,@:)
1680
define cross_mangle_control
1684
define cross_mangle_control