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,spu}
23
$(foreach x,srcdir builddir,$(foreach target,hppa64 spu 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 amd64 i386 powerpc))
306
with_linaro_branch = yes
311
# check if we're building for armel or armhf
312
ifeq ($(DEB_TARGET_ARCH),armhf)
314
else ifneq (,$(filter $(distribution)-$(DEB_TARGET_ARCH), Ubuntu-armel))
315
ifneq (,$(filter $(distrelease),lucid maverick natty oneiric precise))
320
else ifneq (,$(filter $(DEB_TARGET_ARCH), arm armel))
324
# -------------------------------------------------------------------
327
# common things ---------------
328
# build common packages, where package names don't differ in different
329
# gcc versions (fixincludes, libgcj-common) ...
330
with_common_pkgs := yes
331
# ... and some libraries, which do not change (libgcc1, libmudflap, libssp0).
332
with_common_libs := yes
333
# XXX: should with_common_libs be "yes" only if this is the default compiler
334
# version on the targeted arch?
336
# is this a multiarch-enabled build?
337
ifeq (,$(filter $(distrelease),lenny etch squeeze dapper hardy jaunty karmic lucid maverick))
338
with_multiarch_lib := yes
341
ifeq ($(with_multiarch_lib),yes)
342
ifneq ($(single_package),yes)
343
ifeq ($(DEB_CROSS),yes)
344
ifeq ($(with_deps_on_target_arch_pkgs),yes)
345
with_multiarch_cxxheaders := yes
348
with_multiarch_cxxheaders := yes
353
ifeq (,$(filter $(distrelease),lenny etch squeeze dapper hardy jaunty karmic lucid maverick))
354
multiarch_stage1 := yes
357
# mapping for the non-default biarch multilib / multiarch names
358
multiarch_xarch_map = \
359
amd64=i386-linux-gnu,x86_64-linux-gnux32 \
360
armel=arm-linux-gnueabi \
361
armhf=arm-linux-gnueabihf \
362
i386=x86_64-linux-gnu,x86_64-linux-gnux32 \
363
powerpc=powerpc64-linux-gnu \
364
ppc64=powerpc-linux-gnu \
365
sparc=sparc64-linux-gnu \
366
sparc64=sparc-linux-gnu \
367
s390=s390x-linux-gnu \
368
s390x=s390-linux-gnu \
369
mips=mips64-linux-gnuabin32,mips64-linux-gnuabi64 \
370
mipsel=mips64el-linux-gnuabin32,mips64el-linux-gnuabi64 \
371
x32=x86_64-linux-gnu,i386-linux-gnu \
372
kfreebsd-amd64=i386-kfreebsd-gnu
373
xarch_multiarch_names = $(subst $(COMMA),$(SPACE),$(patsubst $(DEB_TARGET_ARCH)=%,%, \
374
$(filter $(DEB_TARGET_ARCH)=%,$(multiarch_xarch_map))))
376
multilib_multiarch_map = \
377
$(DEB_TARGET_ARCH)/=$(DEB_TARGET_MULTIARCH) \
378
amd64/32=i386-linux-gnu \
379
amd64/x32=x86_64-linux-gnux32 \
380
armel/hf=arm-linux-gnueabihf \
381
armhf/sf=arm-linux-gnueabi \
382
i386/64=x86_64-linux-gnu \
383
i386/x32=x86_64-linux-gnux32 \
384
powerpc/64=powerpc64-linux-gnu \
385
ppc64/32=powerpc-linux-gnu \
386
sparc/64=sparc64-linux-gnu \
387
sparc64/32=sparc-linux-gnu \
388
s390/64=s390x-linux-gnu \
389
s390x/32=s390-linux-gnu \
390
mips/n32=mips64-linux-gnuabin32 \
391
mips/64=mips64-linux-gnuabi64 \
392
mipsel/n32=mips64el-linux-gnuabin32 \
393
mipsel/64=mips64el-linux-gnuabi64 \
394
x32/32=i386-linux-gnu \
395
x32/64=x86_64-linux-gnu \
396
kfreebsd-amd64/32=i386-kfreebsd-gnu
397
# $(call mlib_to_march,<empty>|32|64|n32|x32|hf|sf)
398
mlib_to_march = $(patsubst $(DEB_TARGET_ARCH)/$(1)=%,%, \
399
$(filter $(DEB_TARGET_ARCH)/$(1)=%,$(multilib_multiarch_map)))
401
ifneq ($(DEB_STAGE),stage1)
402
# build a -base package.
403
ifneq ($(DEB_CROSS),yes)
406
ifneq ($(with_deps_on_target_arch_pkgs),yes)
412
# build dev packages.
417
# set lang when built from a different source package.
420
ifneq (,$(findstring gcc-snapshot, $(PKGSOURCE)))
424
else ifneq (,$(findstring gcc-linaro, $(PKGSOURCE)))
428
# --program-suffix=-$(BASE_VERSION)
429
versioned_packages := yes
432
#no_dummy_cpus := ia64 i386 hppa s390 sparc
433
#ifneq (,$(filter $(DEB_TARGET_ARCH_CPU),$(no_dummy_cpus)))
434
# with_base_only := no
435
# with_common_libs := yes
436
# with_common_pkgs := yes
438
# with_base_only := yes
439
# with_common_libs := no
440
# with_common_pkgs := no
444
ifeq ($(versioned_packages),yes)
445
pkg_ver := -$(BASE_VERSION)
449
# -------------------------------------------------------------------
450
# configure languages
452
# C ---------------------------
453
enabled_languages := c
455
# Build all packages needed for C development
456
ifneq ($(with_base_only),yes)
457
ifeq ($(with_dev),yes)
463
# Ada --------------------
464
ada_no_cpus := m32r m68k sh3 sh3eb sh4 sh4eb
468
ifneq (,$(filter $(DEB_TARGET_ARCH),arm64 armhf m68k powerpcspe sh4 sparc64))
472
ifeq ($(with_dev),yes)
473
ifneq ($(separate_lang),yes)
477
ifneq (,$(filter $(DEB_TARGET_ARCH_CPU),$(ada_no_cpus)))
478
with_ada := disabled for cpu $(DEB_TARGET_ARCH_CPU)
480
ifneq (,$(findstring $(DEB_TARGET_GNU_SYSTEM),$(ada_no_systems)))
481
with_ada := disabled for system $(DEB_TARGET_GNU_SYSTEM)
483
ifeq ($(ada_no_cross)-$(DEB_CROSS),yes-yes)
484
with_ada := disabled for cross compiler package
486
ifeq ($(ada_no_snap)-$(single_package),yes-yes)
487
with_ada := disabled for snapshot build
489
with_ada := $(call envfilt, ada, , , $(with_ada))
491
ifneq ($(single_package),yes)
492
with_separate_gnat := yes
494
ifeq ($(with_ada)-$(with_separate_gnat),yes-yes)
495
ifneq (,$(findstring gnat,$(PKGSOURCE)))
499
debian_extra_langs += ada
500
with_ada := built from separate source
501
with_libgnat := built from separate source
505
ifeq ($(with_ada),yes)
506
enabled_languages += ada
508
# There are two exception handling mechanisms: ZCX (Zero-Cost
509
# eXceptions) and SJLJ (setjump/longjump), selected and supported by
510
# libgnat. Thus we build both versions of libgnat on architectures
511
# that support both (see ada-sjlj.diff). Most cpus support both
512
# mechanisms; here, we declare the few that support only one.
513
libgnat_zcx_only_cpus :=
514
libgnat_sjlj_only_cpus := arm armel armhf
515
ifneq (,$(filter $(DEB_TARGET_ARCH_CPU),$(libgnat_sjlj_only_cpus)))
520
ifneq (,$(filter $(DEB_TARGET_ARCH_CPU),$(libgnat_zcx_only_cpus)))
523
with_gnat_sjlj := yes
525
ifeq ($(with_gnat_zcx)-$(with_gnat_sjlj),no-no)
526
# TODO: support cpus that do not support exceptions at all,
527
# perhaps by building a restricted runtime library? For now, flag
528
# this as a packaging error.
529
$(error this target supports neither ZCX nor SJLJ)
533
# C++ -------------------------
535
ifneq ($(with_base_only),yes)
536
ifneq ($(separate_lang),yes)
540
ifneq (,$(findstring $(DEB_TARGET_ARCH_CPU),$(cxx_no_cpus)))
541
with_cxx := disabled for cpu $(DEB_TARGET_ARCH_CPU)
543
with_cxx := $(call envfilt, c++, obj-c++ java, , $(with_cxx))
545
# Build all packages needed for C++ development
546
ifeq ($(with_cxx),yes)
547
ifeq ($(with_dev),yes)
549
with_libcxxdbg := yes
551
ifeq ($(with_common_pkgs),yes)
555
# debugging versions of libstdc++
556
ifneq (,$(findstring gcc-, $(PKGSOURCE)))
557
ifeq ($(with_cxxdev),yes)
560
ifneq (,$(findstring $(DEB_TARGET_ARCH_CPU),$(debug_no_cpus)))
561
with_debug := disabled for cpu $(DEB_TARGET_GNU_CPU)
565
with_debug := $(call envfilt, debug, , , $(with_debug))
567
enabled_languages += c++
570
# Java --------------------
571
# - To build a standalone gcj package (with no corresponding gcc
572
# package): with_separate_libgcj=yes, with_standalone_gcj=yes
573
# - To build the java packages from the gcc source package:
574
# with_separate_libgcj=no, with_standalone_gcj=no
575
# - To build gcc and java from separate sources:
576
# with_separate_libgcj=yes, with_standalone_gcj=no
578
java_no_cpus := # arm64 mips mipsel
579
java_no_systems := knetbsd-gnu
581
ifneq ($(single_package),yes)
582
with_separate_libgcj := yes
584
with_standalone_gcj := no
586
ifneq ($(separate_lang),yes)
590
# java converted for V3 C++ ABI for some archs
591
ifeq ($(with_base_only),yes)
594
ifneq (,$(filter $(DEB_TARGET_ARCH_CPU),$(java_no_cpus)))
595
with_java := disabled for cpu $(DEB_TARGET_ARCH_CPU)
597
ifneq (,$(filter $(DEB_TARGET_GNU_SYSTEM),$(java_no_systems)))
598
with_java := disabled for system $(DEB_TARGET_GNU_SYSTEM)
600
ifeq ($(java_no_cross)-$(DEB_CROSS),yes-yes)
601
with_java := disabled for cross compiler package
603
with_java := $(call envfilt, java, , c++, $(with_java))
605
ifeq ($(with_java)-$(with_separate_libgcj),yes-yes)
606
ifneq (,$(findstring gcj, $(PKGSOURCE)))
610
debian_extra_langs += java
611
with_java := built from separate source
612
with_gcj := built from separate source
613
with_libgcj := buit from separate source
617
with_java_plugin := no
619
ifeq ($(with_java),yes)
620
# use the same names as OpenJDK
621
java_cpu_map = armel=arm armhf=arm hppa=parisc i686=i386 i586=i386 i486=i386 mipsel=mips powerpc=ppc sh4=sh
622
java_cpu = $(patsubst $(DEB_TARGET_ARCH_CPU)=%,%, \
623
$(filter $(DEB_TARGET_ARCH_CPU)=%,$(java_cpu_map)))
625
java_cpu = $(DEB_TARGET_ARCH_CPU)
627
java_priority = 10$(subst .,,$(BASE_VERSION))
632
ifneq (,$(findstring gcj-4,$(PKGSOURCE)))
633
ifneq (,$(filter $(DEB_TARGET_ARCH), arm))
634
with_gcj_base_only := yes
638
ifeq ($(single_package),yes)
642
#ifneq (,$(filter $(DEB_TARGET_ARCH),hppa))
643
# with_native_ecj := yes
646
with_java_maintainer_mode := no
648
# used as well in debian/rules.conf to determine the build deps
649
java_awt_peers = gtk # qt # xlib
651
ifeq ($(with_common_libs),yes)
652
with_libgcj_doc := yes
655
# Build all packages needed for Java development (gcj, libgcj-dev)
656
ifeq ($(with_dev),yes)
661
with_java_alsa := yes
662
ifeq (,$(filter $(DEB_TARGET_GNU_SYSTEM),linux-gnu))
666
enabled_languages += java
669
# Go -------------------
670
# - To build a standalone gccgo package (with no corresponding gcc
671
# package): with_separate_libgo=yes, with_standalone_go=yes
672
# - To build the go packages from the gcc source package:
673
# with_separate_libgo=no, with_standalone_go=no
674
# - To build gcc and go from separate sources:
675
# with_separate_libgo=yes, with_standalone_go=no
680
ifneq (,$(findstring gccgo, $(PKGSOURCE)))
681
with_separate_libgo := yes
682
with_standalone_go := yes
685
go_no_cpus := avr arm arm64 hppa m68k sh4 sparc sparc64
686
ifeq (,$(filter $(distrelease),lenny etch squeeze dapper hardy jaunty karmic lucid maverick natty oneiric))
687
go_no_cpus := $(filter-out arm, $(go_no_cpus))
689
go_no_systems := gnu kfreebsd-gnu
691
ifneq ($(with_base_only),yes)
692
ifneq ($(separate_lang),yes)
696
ifneq (,$(filter $(DEB_TARGET_ARCH_CPU),$(go_no_cpus)))
697
with_go := disabled for cpu $(DEB_TARGET_ARCH_CPU)
699
ifneq (,$(findstring $(DEB_TARGET_GNU_SYSTEM),$(go_no_systems)))
700
with_go := disabled for system $(DEB_TARGET_GNU_SYSTEM)
702
ifeq ($(go_no_cross)-$(DEB_CROSS),yes-yes)
703
with_go := disabled for cross compiler package
705
with_go := $(call envfilt, go, , , $(with_go))
707
# Build all packages needed for Go development
708
ifneq (,$(findstring gcc, $(PKGSOURCE)))
709
ifeq ($(with_go),yes)
710
ifeq ($(with_common_libs),yes)
713
enabled_languages += go
717
ifeq ($(with_go)-$(with_separate_libgo),yes-yes)
718
ifneq (,$(findstring gccgo, $(PKGSOURCE)))
719
languages := c c++ go
722
debian_extra_langs += go
723
with_go := built from separate source
724
with_libgo := buit from separate source
728
# D ---------------------------
732
ifneq ($(single_package),yes)
733
with_separate_gdc := yes
736
ifneq ($(separate_lang),yes)
739
ifeq ($(d_no_snap)-$(single_package),yes-yes)
740
with_d := disabled for snapshot build
743
ifeq ($(with_base_only),yes)
747
ifeq ($(with_d)-$(with_separate_gdc),yes-yes)
748
ifneq (,$(findstring gdc,$(PKGSOURCE)))
752
# FIXME: language selection needs improvement.
753
with_go := disabled for d
755
debian_extra_langs += d
756
with_d := built from separate source
761
with_libphobos := yes
763
libphobos_no_cpus := alpha avr arm hppa ia64 m68k mips mipsel powerpc powerpcspe ppc64 s390 s390x sh4 sparc sparc64
764
libphobos_no_systems := gnu
765
ifneq (,$(findstring $(DEB_TARGET_ARCH_CPU),$(libphobos_no_cpus)))
766
with_libphobos := disabled for cpu $(DEB_TARGET_ARCH_CPU)
768
ifneq (,$(findstring $(DEB_TARGET_GNU_SYSTEM),$(libphobos_no_systems)))
769
with_libphobos := disabled for system $(DEB_TARGET_GNU_SYSTEM)
772
enabled_languages += d
775
# Fortran 95 -------------------
776
fortran_no_cross := yes
777
fortran_no_cross := no
779
ifneq ($(with_base_only),yes)
780
ifneq ($(separate_lang),yes)
784
ifeq ($(fortran_no_cross)-$(DEB_CROSS),yes-yes)
785
with_fortran := disabled for cross compiler package
787
with_fortran := $(call envfilt, fortran, , , $(with_fortran))
789
# Build all packages needed for Fortran development
790
ifeq ($(with_fortran),yes)
791
ifeq ($(with_dev),yes)
794
ifeq ($(with_common_libs),yes)
795
with_libgfortran := yes
797
enabled_languages += fortran
800
# libquadmath -------------------
802
ifneq (,$(findstring $(DEB_TARGET_ARCH_CPU), ia64 i386 i486 i586 i686 amd64))
803
# FIXME: upstream build tied to gfortran build
804
ifeq ($(with_fortran),yes)
806
ifneq (,$(findstring gcc-4,$(PKGSOURCE)))
807
ifeq ($(with_common_libs),yes)
814
# ObjC ------------------------
817
ifneq ($(with_base_only),yes)
818
ifneq ($(separate_lang),yes)
820
objc_no_archs = arm64
821
ifneq (,$(filter $(DEB_TARGET_ARCH),$(objc_no_archs)))
826
ifeq ($(objc_no_cross)-$(DEB_CROSS),yes-yes)
827
with_objc := disabled for cross compiler package
829
with_objc := $(call envfilt, objc, obj-c++, , $(with_objc))
831
ifeq ($(with_objc),yes)
832
# the ObjC runtime with garbage collection enabled needs the Boehm GC
835
# disable ObjC garbage collection library (needs libgc)
836
libgc_no_cpus := arm64 avr mips mipsel # alpha amd64 arm armel armhf hppa i386 ia64 m68k mips mipsel powerpc ppc64 s390 s390x sparc
837
libgc_no_systems := knetbsd-gnu
838
ifneq (,$(filter $(DEB_TARGET_ARCH_CPU),$(libgc_no_cpus)))
839
with_objc_gc := disabled for cpu $(DEB_TARGET_ARCH_CPU)
841
ifneq (,$(findstring $(DEB_TARGET_GNU_SYSTEM),$(libgc_no_systems)))
842
with_objc_gc := disabled for system $(DEB_TARGET_GNU_SYSTEM)
845
# Build all packages needed for Objective-C development
846
ifeq ($(with_dev),yes)
849
# libobjc soname change in 4.7
850
#ifeq ($(with_common_libs),yes)
854
enabled_languages += objc
857
# ObjC++ ----------------------
858
objcxx_no_cross := no
860
ifeq ($(with_objc),yes)
861
ifneq ($(with_base_only),yes)
862
ifneq ($(separate_lang),yes)
867
ifeq ($(objcxx_no_cross)-$(DEB_CROSS),yes-yes)
868
with_objcxx := disabled for cross compiler package
870
with_objcxx := $(call envfilt, obj-c++, , c++ objc, $(with_objcxx))
872
ifeq ($(with_objcxx),yes)
873
enabled_languages += obj-c++
876
# -------------------------------------------------------------------
879
# not built from the main source package
880
ifeq (,$(findstring gcc-,$(PKGSOURCE)))
885
ifeq ($(trunk_build),yes)
888
with_nls := $(call envfilt, nls, , , $(with_nls))
890
# powerpc nof libraries -----
893
ifneq (,$(findstring gcc-4,$(PKGSOURCE)))
896
with_source := $(call envfilt, source, , , $(with_source))
898
# ssp & libssp -------------------------
900
ssp_no_archs = alpha arm64 hppa ia64 m68k
901
ifneq (, $(filter $(DEB_TARGET_ARCH),$(ssp_no_archs) $(ssp_no_archs:%=uclibc-%)))
902
with_ssp := not available on $(DEB_TARGET_ARCH)
904
with_ssp := $(call envfilt, ssp, , , $(with_ssp))
906
ifeq ($(with_ssp),yes)
907
ifneq ($(distribution),Debian)
908
ifneq (,$(findstring gcc-4, $(PKGSOURCE)))
909
with_ssp_default := yes
914
# mudflap -------------------
916
with_mudflap := $(call envfilt, mudflap, , , $(with_mudflap))
917
mudflap_no_archs = arm64
918
ifneq (,$(filter $(DEB_TARGET_ARCH),$(mudflap_no_archs)))
922
# gomp --------------------
924
with_gomp := $(call envfilt, gomp, , , $(with_gomp))
925
gomp_no_archs = arm64
926
ifneq (,$(filter $(DEB_TARGET_ARCH),$(gomp_no_archs)))
930
# itm --------------------
931
itm_archs = amd64 i386 x32
932
ifneq (,$(filter $(DEB_TARGET_ARCH),$(itm_archs)))
935
with_itm := $(call envfilt, itm, , , $(with_itm))
937
# atomic --------------------
939
atomic_no_archs = arm64
940
ifneq (,$(filter $(DEB_TARGET_ARCH),$(atomic_no_archs)))
944
# backtrace --------------------
945
with_backtrace := yes
946
backtrace_no_archs = m68k
947
ifneq (,$(filter $(DEB_TARGET_ARCH),$(backtrace_no_archs)))
951
# asan / sanitizer --------------------
953
with_asan := $(call envfilt, asan, , , $(with_asan))
954
asan_archs = amd64 armel armhf i386 powerpc ppc64 sparc sparc64 x32
955
ifneq (,$(filter $(DEB_TARGET_ARCH),$(asan_archs)))
959
# tsan / sanitizer --------------------
961
with_tsan := $(call envfilt, tsan, , , $(with_tsan))
963
ifneq (,$(filter $(DEB_TARGET_ARCH),$(tsan_archs)))
967
# gold --------------------
968
# armel with binutils 2.20.51 only
969
gold_archs = amd64 armel armhf i386 lpia powerpc ppc64 sparc
970
ifneq (,$(filter $(DEB_TARGET_ARCH),$(gold_archs)))
974
# plugins --------------------
977
endif # ifndef DEB_STAGE
979
# Don't include docs with GFDL invariant sections
980
GFDL_INVARIANT_FREE := yes
981
ifeq ($(distribution),Ubuntu)
982
GFDL_INVARIANT_FREE := no
985
# -------------------------------------------------------------------
987
ifeq ($(extra_package),yes)
988
ifeq ($(with_separate_libgcj)-$(with_standalone_gcj),yes-no)
998
ifneq ($(DEB_CROSS),yes)
1001
with_gcjxbase := yes
1004
ifeq ($(with_separate_libgo),yes)
1015
# libssp ------------------
1016
ifeq ($(with_ssp)-$(with_common_libs),yes-yes)
1017
#ifneq ($(DEB_CROSS),yes)
1018
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))
1022
# libmudflap --------------
1023
ifeq ($(with_mudflap)-$(with_common_libs),yes-yes)
1024
with_libmudflap := yes
1027
# libgomp -----------------
1028
ifeq ($(with_gomp)-$(with_common_libs),yes-yes)
1029
#ifneq ($(DEB_CROSS),yes)
1034
# libitm -----------------
1035
ifeq ($(with_itm)-$(with_common_libs),yes-yes)
1036
#ifneq ($(DEB_CROSS),yes)
1041
# libatomic -----------------
1042
ifeq ($(with_atomic)-$(with_common_libs),yes-yes)
1043
#ifneq ($(DEB_CROSS),yes)
1044
with_libatomic := yes
1048
# libbacktrace -----------------
1049
ifeq ($(with_backtrace)-$(with_common_libs),yes-yes)
1050
#ifneq ($(DEB_CROSS),yes)
1051
# currently not a shared library
1052
#with_libbacktrace := yes
1056
# libasan -----------------
1057
ifeq ($(with_asan)-$(with_common_libs),yes-yes)
1058
#ifneq ($(DEB_CROSS),yes)
1063
# libtsan -----------------
1064
ifeq ($(with_tsan)-$(with_common_libs),yes-yes)
1065
#ifneq ($(DEB_CROSS),yes)
1070
# libquadmath -----------------
1071
ifeq ($(with_qmath)-$(with_common_libs),yes-yes)
1072
#ifneq ($(DEB_CROSS),yes)
1073
with_libqmath := yes
1077
# fixincludes -------
1078
ifneq ($(DEB_CROSS),yes)
1079
ifeq ($(with_common_pkgs),yes)
1084
# Shared libgcc --------------------
1085
ifneq ($(DEB_STAGE),stage1)
1086
with_shared_libgcc := yes
1087
ifeq ($(with_common_libs),yes)
1092
# libgcc-math --------------------
1094
ifneq (,$(findstring i486,$(DEB_TARGET_ARCH)))
1095
#with_libgccmath := yes
1096
#with_lib64gmath := yes
1097
#with_libgmathdev := yes
1099
ifeq ($(DEB_TARGET_ARCH),amd64)
1100
#with_libgccmath := yes
1101
#with_lib32gmath := yes
1102
#with_libgmathdev := yes
1105
# hppa64 build ----------------
1106
hppa64_no_snap := no
1107
ifeq ($(DEB_TARGET_ARCH),hppa)
1110
ifeq ($(hppa64_no_snap)-$(trunk_build),yes-yes)
1111
with_hppa64 := disabled for snapshot build
1113
with_hppa64 := $(call envfilt, hppa64, , , $(with_hppa64))
1115
# spu build -------------------
1117
ifneq (,$(findstring $(DEB_TARGET_ARCH),powerpc ppc64))
1118
ifneq ($(DEB_CROSS),yes)
1122
ifeq ($(spu_no_snap)-$(trunk_build),yes-yes)
1123
with_spu := disabled for snapshot build
1125
with_spu := $(call envfilt, spu, , , $(with_spu))
1127
ifeq ($(with_spu),yes)
1128
with_spucache := yes
1129
with_spumea64 := yes
1132
# neon build -------------------
1133
# FIXME: build as a cross compiler to build on armv4 as well
1134
ifneq (,$(findstring gcc-4, $(PKGSOURCE)))
1135
ifeq ($(distribution),Ubuntu)
1136
# neon_archs = armel armhf
1137
# ifneq (, $(filter $(DEB_TARGET_ARCH),$(neon_archs)))
1144
# run testsuite ---------------
1146
# if you don't want to run the gcc testsuite, uncomment the next line
1147
#with_check := disabled by hand
1148
ifeq ($(with_base_only),yes)
1151
ifeq ($(DEB_CROSS),yes)
1152
with_check := disabled for cross compiler package
1154
ifeq ($(REVERSE_CROSS),yes)
1155
with_check := disabled for reverse cross build
1157
check_no_cpus := m68k
1158
check_no_systems := gnu
1159
ifneq (,$(findstring $(DEB_TARGET_ARCH_CPU),$(check_no_cpus)))
1160
with_check := disabled for cpu $(DEB_TARGET_ARCH_CPU)
1162
ifneq (,$(findstring $(DEB_TARGET_GNU_SYSTEM),$(check_no_systems)))
1163
with_check := disabled for system $(DEB_TARGET_GNU_SYSTEM)
1165
ifeq ($(distribution)-$(DEB_HOST_ARCH),Ubuntu-hppa)
1166
ifneq ($(single_package),yes)
1167
with_check := disabled, testsuite timeouts with expect
1170
ifneq (,$(findstring gdc,$(PKGSOURCE)))
1171
with_check := disabled for D
1173
with_check := $(call envfilt, check, , , $(with_check))
1175
with_check := disabled by environment
1177
ifneq ($(findstring nocheck, $(DEB_BUILD_OPTIONS)),)
1178
with_check := disabled by DEB_BUILD_OPTIONS
1180
#with_check := disabled for this build
1182
# not a dependency on all archs, but if available, use it for the testsuite
1183
ifneq (,$(wildcard /usr/bin/localedef))
1184
locale_data = generate
1187
all_enabled_languages := $(enabled_languages)
1188
languages_without_lang_opt := c++ objc obj-c++
1190
debian_extra_langs := $(subst obj-c++,objcp,$(debian_extra_langs))
1191
export debian_extra_langs
1194
biarch_map := i686=x86_64 powerpc=powerpc64 sparc=sparc64 s390=s390x s390x=s390 \
1195
x86_64=i686 powerpc64=powerpc mips=mips64 mipsel=mips64el
1196
ifeq (,$(filter $(distrelease),lenny etch squeeze wheezy sid dapper hardy jaunty karmic lucid))
1197
biarch_map := $(subst i686=,i486=,$(biarch_map))
1199
ifeq ($(distribution),Ubuntu)
1200
ifeq (,$(filter $(distrelease),dapper hardy jaunty karmic lucid maverick natty))
1201
biarch_map += arm=arm
1204
biarch_cpu := $(strip $(patsubst $(DEB_TARGET_GNU_CPU)=%,%, \
1205
$(filter $(DEB_TARGET_GNU_CPU)=%,$(biarch_map))))
1215
ifneq (yes,$$(call envfilt, biarch, , ,yes))
1218
ifneq (,$$(findstring /$$(DEB_TARGET_ARCH)/,$$(biarch$1archs)))
1221
#biarch$1subdir = $$(biarch_cpu)-$$(DEB_TARGET_GNU_SYSTEM)
1223
ifeq ($$(with_libgcc),yes)
1224
with_lib$1gcc := yes
1226
ifeq ($$(with_cdev),yes)
1227
with_lib$1gccdev := yes
1229
ifeq ($$(with_libcxx),yes)
1230
with_lib$1cxx := yes
1232
ifeq ($$(with_libcxxdbg),yes)
1233
with_lib$1cxxdbg := yes
1235
ifeq ($$(with_cxxdev),yes)
1236
with_lib$1cxxdev := yes
1238
ifeq ($$(with_libobjc),yes)
1239
with_lib$1objc := yes
1241
ifeq ($$(with_objcdev),yes)
1242
with_lib$1objcdev := yes
1244
ifeq ($$(with_libgfortran),yes)
1245
with_lib$1gfortran := yes
1247
ifeq ($$(with_fdev),yes)
1248
with_lib$1gfortrandev := yes
1250
ifeq ($$(with_libmudflap),yes)
1251
with_lib$1mudflap := yes
1253
ifeq ($$(with_libssp),yes)
1254
with_lib$1ssp := yes
1256
ifeq ($$(with_libgomp),yes)
1257
with_lib$1gomp:= yes
1259
ifeq ($$(with_libitm),yes)
1262
ifeq ($$(with_libatomic),yes)
1263
with_lib$1atomic:= yes
1265
ifeq ($$(with_libbacktrace),yes)
1266
with_lib$1backtrace:= yes
1268
ifeq ($$(with_libasan),yes)
1269
with_lib$1asan:= yes
1271
ifeq ($$(with_libtsan),yes)
1272
with_lib$1tsan:= yes
1274
ifeq ($$(with_libqmath),yes)
1275
with_lib$1qmath := yes
1277
ifeq ($$(with_libgo),yes)
1281
biarch_multidir_names = libiberty libgcc
1282
ifneq (,$$(findstring gcc-, $$(PKGSOURCE)))
1283
biarch_multidir_names += libstdc++-v3 libobjc libgfortran libssp \
1284
libgomp libmudflap zlib libitm \
1285
libbacktrace libatomic libsanitizer
1286
ifeq ($$(with_objc_gc),yes)
1287
biarch_multidir_names += boehm-gc
1290
ifneq (,$(findstring yes, $(with_java) $(with_go)))
1291
biarch_multidir_names += libffi
1293
ifeq ($(with_fortran),yes)
1294
biarch_multidir_names += libquadmath
1296
ifeq ($(with_go),yes)
1297
biarch_multidir_names += libgo
1299
export biarch_multidir_names
1300
ifneq (,$$(findstring 32,$1))
1301
TARGET64_MACHINE := $$(strip $$(subst $$(DEB_TARGET_GNU_CPU),$$(biarch_cpu), \
1303
TARGET32_MACHINE := $$(TARGET_ALIAS)
1305
TARGET64_MACHINE := $$(TARGET_ALIAS)
1306
TARGET64_MACHINE := $$(strip $$(subst $$(DEB_TARGET_GNU_CPU),$$(biarch_cpu), \
1309
export TARGET32_MACHINE
1310
export TARGET64_MACHINE
1313
biarch32archs := /amd64/ppc64/kfreebsd-amd64/s390x/x32/
1314
biarch64archs := /i386/powerpc/sparc/s390/mips/mipsel/x32/
1315
biarchn32archs := /mips/mipsel/
1316
ifeq ($(distribution),Ubuntu)
1317
ifeq (,$(filter $(distrelease),dapper hardy jaunty karmic lucid maverick natty))
1318
biarchhfarchs := /armel/
1319
biarchsfarchs := /armhf/
1321
ifeq (,$(filter $(distrelease),dapper hardy jaunty karmic lucid maverick natty oneiric precise quantal))
1322
biarchx32archs := /amd64/i386/
1325
ifeq ($(distribution),Debian)
1326
#ifeq (,$(filter $(distrelease),etch squeeze wheezy))
1327
ifeq (,$(filter $(distrelease),etch squeeze))
1328
biarchx32archs := /amd64/i386/
1331
$(foreach x,32 64 n32 x32 hf sf,$(eval $(call gen_biarch,$(x))))
1333
#ifeq ($(DEB_TARGET_ARCH),ia64)
1337
#ifeq ($(trunk_build),yes)
1338
# no_biarch_libs := yes
1340
ifdef DEB_CROSS_NO_BIARCH
1341
no_biarch_libs := yes
1343
ifeq ($(with_d)-$(with_separate_gdc),yes-yes)
1344
no_biarch_libs := yes
1347
ifeq ($(no_biarch_libs),yes)
1350
with_lib64cxxdbg := no
1351
with_lib64objc := no
1354
with_lib64gfortran := no
1355
with_lib64mudflap := no
1358
with_lib64gomp := no
1360
with_lib64qmath := no
1361
with_lib64atomic := no
1362
with_lib64backtrace := no
1363
with_lib64asan := no
1364
with_lib64tsan := no
1365
with_lib64gccdev := no
1366
with_lib64cxxdev := no
1367
with_lib64objcdev := no
1368
with_lib64gfortrandev := no
1372
with_lib32cxxdbg := no
1373
with_lib32objc := no
1376
with_lib32gfortran := no
1377
with_lib32mudflap := no
1380
with_lib32gomp := no
1382
with_lib32qmath := no
1383
with_lib32atomic := no
1384
with_lib32backtrace := no
1385
with_lib32asan := no
1386
with_lib32tsan := no
1387
with_lib32gccdev := no
1388
with_lib32cxxdev := no
1389
with_lib32objcdev := no
1390
with_lib32gfortrandev := no
1392
with_libn32gcc := no
1393
with_libn32cxx := no
1394
with_libn32cxxdbg := no
1395
with_libn32objc := no
1396
with_libn32ffi := no
1397
with_libn32gcj := no
1398
with_libn32gfortran := no
1399
with_libn32mudflap := no
1400
with_libn32ssp := no
1402
with_libn32gomp := no
1403
with_libn32itm := no
1404
with_libn32qmath := no
1405
with_libn32atomic := no
1406
with_libn32backtrace := no
1407
with_libn32asan := no
1408
with_libn32tsan := no
1409
with_libn32gccdev := no
1410
with_libn32cxxdev := no
1411
with_libn32objcdev := no
1412
with_libn32gfortrandev:= no
1414
with_libx32gcc := no
1415
with_libx32cxx := no
1416
with_libx32cxxdbg := no
1417
with_libx32objc := no
1418
with_libx32ffi := no
1419
with_libx32gcj := no
1420
with_libx32gfortran := no
1421
with_libx32mudflap := no
1422
with_libx32ssp := no
1424
with_libx32gomp := no
1425
with_libx32itm := no
1426
with_libx32qmath := no
1427
with_libx32atomic := no
1428
with_libx32backtrace := no
1429
with_libx32asan := no
1430
with_libx32tsan := no
1431
with_libx32gccdev := no
1432
with_libx32cxxdev := no
1433
with_libx32objcdev := no
1434
with_libx32gfortrandev:= no
1438
with_libhfcxxdbg := no
1439
with_libhfobjc := no
1442
with_libhfgfortran := no
1443
with_libhfmudflap := no
1446
with_libhfgomp := no
1448
with_libhfqmath := no
1449
with_libhfatomic := no
1450
with_libhfbacktrace := no
1451
with_libhfasan := no
1452
with_libhftsan := no
1453
with_libhfgccdev := no
1454
with_libhfcxxdev := no
1455
with_libhfobjcdev := no
1456
with_libhfgfortrandev := no
1460
with_libsfcxxdbg := no
1461
with_libsfobjc := no
1464
with_libsfgfortran := no
1465
with_libsfmudflap := no
1468
with_libsfgomp := no
1470
with_libsfqmath := no
1471
with_libsfatomic := no
1472
with_libsfbacktrace := no
1473
with_libsfasan := no
1474
with_libsftsan := no
1475
with_libsfgccdev := no
1476
with_libsfcxxdev := no
1477
with_libsfobjcdev := no
1478
with_libsfgfortrandev := no
1480
with_java_plugin := no
1482
ifdef DEB_CROSS_NO_BIARCH
1483
biarch64 := disabled by DEB_CROSS_NO_BIARCH
1484
biarch32 := disabled by DEB_CROSS_NO_BIARCH
1485
biarchn32 := disabled by DEB_CROSS_NO_BIARCH
1486
biarchx32 := disabled by DEB_CROSS_NO_BIARCH
1487
biarchhf := disabled by DEB_CROSS_NO_BIARCH
1488
biarchsf := disabled by DEB_CROSS_NO_BIARCH
1491
ifeq ($(with_d)-$(with_separate_gdc),yes-yes)
1492
biarch64 := disabled for D
1493
biarch32 := disabled for D
1494
biarchn32 := disabled for D
1495
biarchx32 := disabled for D
1496
biarchhf := disabled for D
1497
biarchsf := disabled for D
1500
ifeq ($(with_ada)-$(with_separate_gnat),yes-yes)
1501
biarchhf := disabled for Ada
1502
biarchsf := disabled for Ada
1507
ifneq (,$(filter yes,$(biarch32) $(biarch64) $(biarchn32) $(biarchx32) $(biarchhf) $(biarchsf)))
1511
multilib_archs = $(sort $(subst /, , $(biarch64archs) $(biarch32archs) $(biarchn32archs) $(biarchx32archs) $(biarchhfarchs) $(biarchsfarchs)))
1514
$(if $(filter yes,$(biarch64)),$(biarch64subdir),) \
1515
$(if $(filter yes,$(biarch32)),$(biarch32subdir),) \
1516
$(if $(filter yes,$(biarchn32)),$(biarchn32subdir),) \
1517
$(if $(filter yes,$(biarchx32)),$(biarchx32subdir),) \
1518
$(if $(filter yes,$(biarchhf)),$(biarchhfsubdir),) \
1519
$(if $(filter yes,$(biarchsf)),$(biarchsfsubdir),)
1520
biarchsubdirs := {$(strip $(shell echo $(biarchsubdirs) | tr " " ","))}
1523
force_gnu_locales := yes
1525
locale_no_systems :=
1526
ifneq (,$(findstring $(DEB_TARGET_GNU_SYSTEM),$(locale_no_systems)))
1527
force_gnu_locales := disabled for system $(DEB_TARGET_GNU_SYSTEM)
1530
gcc_tarpath := $(firstword $(wildcard gcc-*.tar.* /usr/src/gcc-4.8/gcc-*.tar.*))
1531
gcc_tarball := $(notdir $(gcc_tarpath))
1532
gcc_srcdir := $(subst -dfsg,,$(patsubst %.tar.xz,%,$(patsubst %.tar.lzma,%,$(patsubst %.tar.gz,%,$(gcc_tarball:.tar.bz2=)))))
1534
ifeq ($(with_d),yes)
1535
gdc_tarpath := $(firstword $(wildcard gdc-*.tar.* /usr/src/gcc-$(BASE_VERSION)/gdc-*.tar.*))
1536
gdc_tarball := $(notdir $(gdc_tarpath))
1537
gdc_srcdir := $(patsubst %.tar.xz,%,$(patsubst %.tar.lzma,%,$(patsubst %.tar.gz,%,$(gdc_tarball:.tar.bz2=))))
1540
# NOTE: This is not yet used. when building gcj, gdc or gnat using the
1541
# gcc-source package, we don't require an exact binary dependency.
1542
ifneq ($(dir $(gcc_tarpath)),./)
1543
built_using_external_source := yes
1545
built_using_external_source :=
1547
ifeq ($(DEB_CROSS),yes)
1548
add_built_using = yes
1551
ecj_jar := $(firstword $(wildcard ecj.jar /usr/share/java/eclipse-ecj.jar /usr/share/java/ecj.jar))
1553
unpack_stamp := $(stampdir)/01-unpack-stamp
1554
pre_patch_stamp := $(stampdir)/02-pre-patch-stamp
1555
patch_stamp := $(stampdir)/02-patch-stamp
1556
src_spu_stamp := $(stampdir)/02-src-spu-stamp
1557
control_stamp := $(stampdir)/03-control-stamp
1558
configure_stamp := $(stampdir)/04-configure-stamp
1559
build_stamp := $(stampdir)/05-build-stamp
1560
build_html_stamp := $(stampdir)/05-build-html-stamp
1561
build_locale_stamp := $(stampdir)/05-build-locale-stamp
1562
build_doxygen_stamp := $(stampdir)/05-build-doxygen-stamp
1563
build_javasrc_stamp := $(stampdir)/05-build-javasrc-stamp
1564
build_javadoc_stamp := $(stampdir)/05-build-javadoc-stamp
1565
check_stamp := $(stampdir)/06-check-stamp
1566
check_inst_stamp := $(stampdir)/06-check-inst-stamp
1567
install_stamp := $(stampdir)/07-install-stamp
1568
install_snap_stamp := $(stampdir)/07-install-snap-stamp
1569
binary_stamp := $(stampdir)/08-binary-stamp
1571
configure_dummy_stamp := $(stampdir)/04-configure-dummy-stamp
1572
build_dummy_stamp := $(stampdir)/05-build-dummy-stamp
1573
install_dummy_stamp := $(stampdir)/07-install-dummy-stamp
1575
configure_hppa64_stamp := $(stampdir)/04-configure-hppa64-stamp
1576
build_hppa64_stamp := $(stampdir)/05-build-hppa64-stamp
1577
install_hppa64_stamp := $(stampdir)/07-install-hppa64-stamp
1579
configure_neon_stamp := $(stampdir)/04-configure-neon-stamp
1580
build_neon_stamp := $(stampdir)/05-build-neon-stamp
1581
install_neon_stamp := $(stampdir)/07-install-neon-stamp
1583
configure_spu_stamp := $(stampdir)/04-configure-spu-stamp
1584
build_spu_stamp := $(stampdir)/05-build-spu-stamp
1585
install_spu_stamp := $(stampdir)/07-install-spu-stamp
1587
control_dependencies := $(patch_stamp)
1589
ifeq ($(single_package),yes)
1590
configure_dependencies = $(configure_stamp)
1591
build_dependencies = $(build_stamp)
1592
install_dependencies = $(install_snap_stamp)
1593
ifeq ($(with_check),yes)
1594
check_dependencies += $(check_stamp)
1597
ifeq ($(with_base_only),yes)
1598
configure_dependencies = $(configure_dummy_stamp)
1599
build_dependencies = $(build_dummy_stamp)
1600
install_dependencies = $(install_dummy_stamp)
1602
configure_dependencies = $(configure_stamp)
1603
build_dependencies = $(build_stamp)
1604
install_dependencies = $(install_stamp)
1605
ifeq ($(with_check),yes)
1606
check_dependencies += $(check_stamp)
1611
ifneq (,$(findstring gcj-, $(PKGSOURCE)))
1612
ifeq ($(with_gcj_base_only),yes)
1613
configure_dependencies = $(configure_dummy_stamp)
1614
build_dependencies = $(build_dummy_stamp)
1615
install_dependencies = $(install_dummy_stamp)
1619
ifeq ($(with_neon),yes)
1620
build_dependencies += $(build_neon_stamp)
1621
install_dependencies += $(install_neon_stamp)
1624
ifeq ($(with_hppa64),yes)
1625
build_dependencies += $(build_hppa64_stamp)
1626
ifneq ($(trunk_build),yes)
1627
install_dependencies += $(install_hppa64_stamp)
1631
ifeq ($(with_spu),yes)
1632
control_dependencies += $(src_spu_stamp)
1633
build_dependencies += $(build_spu_stamp)
1634
ifneq ($(trunk_build),yes)
1635
install_dependencies += $(install_spu_stamp)
1639
build_dependencies += $(check_dependencies)
1642
mkdir -p $(stampdir)
1644
ifeq ($(DEB_CROSS),yes)
1645
ifneq ($(with_deps_on_target_arch_pkgs),yes)
1646
define cross_mangle_shlibs
1647
sed -i s/$(cross_lib_arch)//g debian/$(1)/DEBIAN/shlibs
1649
define cross_mangle_substvars
1650
if [ -f debian/$(1).substvars ]; then \
1651
sed -i 's/lib[^ ,(]*/&$(cross_lib_arch)/g' debian/$(1).substvars; \
1655
define cross_mangle_shlibs
1657
define cross_mangle_substvars
1661
define cross_mangle_shlibs
1663
define cross_mangle_substvars
1665
# precise's dh_shlibdeps doesn't work well for ARM multilibs
1666
ifneq (,$(filter $(distrelease),precise))
1667
ifneq (,$(filter $(DEB_TARGET_ARCH), armel armhf))
1673
# takes a *list* of package names as $1, the multilib dirname as $2
1675
$(if $(strip $(1)), \
1676
$(shell find $(foreach p,$(1),$(CURDIR)/debian/$(p)) \
1677
-name '*.so.*' -printf '%h ' | uniq)) \
1678
$(with_build_sysroot)/lib/$(call mlib_to_march,$(2)) \
1679
$(with_build_sysroot)/usr/lib/$(call mlib_to_march,$(2)) \
1680
$(with_build_sysroot)$(subst /usr,,/$(usr_lib$(2))) \
1681
$(with_build_sysroot)/$(usr_lib$(2)) \
1682
$(if $(filter yes,$(biarchsf) $(biarchhf)), \
1683
$(with_build_sysroot)/usr/$(call mlib_to_march,$(2))/lib)
1684
shlibdirs_to_search = -l$(subst $(SPACE),:,$(foreach d,$(_shlibdirs),$(d)))
1688
ifneq (,$(filter $(DEB_TARGET_ARCH), mips mipsel))
1689
ifneq ($(with_deps_on_target_arch_pkgs),yes)
1690
define cross_mangle_control
1691
$(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,@:)
1692
$(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,@:)
1695
define cross_mangle_control
1699
define cross_mangle_control