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
ifneq (,$(findstring gdc,$(PKGSOURCE)))
57
BASE_VERSION := $(shell echo $(DEB_VERSION) | sed -e 's/.*-\([1-9]\.[0-9]\).*-.*/\1/')
60
# push glibc stack traces into stderr
61
export LIBC_FATAL_STDERR_=1
63
# ---------------------------------------------------------------------------
65
# - GNU triplet via DEB_TARGET_GNU_TYPE
66
# - Debian arch in debian/target
67
# - Debian arch via DEB_GCC_TARGET or GCC_TARGET
71
DEB_GCC_TARGET := $(GCC_TARGET)
73
ifdef DEB_TARGET_GNU_TYPE
74
TARGET_VARS := $(shell dpkg-architecture -f -t$(DEB_TARGET_GNU_TYPE) 2>/dev/null)
76
# allow debian/target to be used instead of DEB_GCC_TARGET - this was requested
77
# by toolchain-source maintainer
78
DEBIAN_TARGET_FILE := $(strip $(if $(wildcard debian/target),$(shell cat debian/target 2>/dev/null)))
79
ifndef DEB_TARGET_ARCH
80
ifneq (,$(DEBIAN_TARGET_FILE))
81
DEB_TARGET_ARCH := $(DEBIAN_TARGET_FILE)
84
DEB_TARGET_ARCH := $(DEB_GCC_TARGET)
86
DEB_TARGET_ARCH := $(DEB_HOST_ARCH)
90
TARGET_VARS := $(shell dpkg-architecture -f -a$(DEB_TARGET_ARCH) 2>/dev/null)
93
DEB_TARGET_ARCH ?= $(call vafilt,$(TARGET_VARS),DEB_HOST_ARCH)
94
DEB_TARGET_ARCH_OS ?= $(call vafilt,$(TARGET_VARS),DEB_HOST_ARCH_OS)
95
DEB_TARGET_ARCH_CPU ?= $(call vafilt,$(TARGET_VARS),DEB_HOST_ARCH_CPU)
96
DEB_TARGET_GNU_CPU ?= $(call vafilt,$(TARGET_VARS),DEB_HOST_GNU_CPU)
97
DEB_TARGET_GNU_TYPE ?= $(call vafilt,$(TARGET_VARS),DEB_HOST_GNU_TYPE)
98
DEB_TARGET_GNU_SYSTEM ?= $(call vafilt,$(TARGET_VARS),DEB_HOST_GNU_SYSTEM)
99
DEB_TARGET_MULTIARCH ?= $(call vafilt,$(TARGET_VARS),DEB_HOST_MULTIARCH)
101
ifeq ($(DEB_TARGET_ARCH),)
102
$(error Invalid architecure.)
105
# including unversiond symlinks for binaries
106
#with_unversioned = yes
108
# ---------------------------------------------------------------------------
109
# cross-compiler config
110
# - typical cross-compiler
111
# - reverse cross (built to run on the target)
115
# build != host && host == target : reverse cross (REVERSE_CROSS == yes)
116
# build == host && host != target : typical cross (DEB_CROSS == yes)
117
# build != host && host != target : canadian (DEB_CROSS == yes)
118
# build == host && host == target : native
119
ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
120
ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_TARGET_GNU_TYPE))
121
# cross building a cross compiler, untested.
124
# cross building the native compiler
126
ifeq (,$(filter $(distrelease),lenny etch squeeze dapper hardy jaunty karmic lucid))
131
ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_TARGET_GNU_TYPE))
132
# cross compiler, sets WITH_SYSROOT on it's own
134
ifeq ($(with_deps_on_target_arch_pkgs),yes)
139
# first ones are wheezy and maverick
140
ifeq (,$(filter $(distrelease),lenny etch squeeze dapper hardy jaunty karmic lucid))
146
# ---------------------------------------------------------------------------
147
# cross compiler support
148
ifeq ($(DEB_CROSS),yes)
149
# TARGET: Alias to DEB_TARGET_ARCH (Debian arch name)
150
# TP: Target Prefix. Used primarily as a prefix for cross tool
151
# names (e.g. powerpc-linux-gcc).
152
# TS: Target Suffix. Used primarily at the end of cross compiler
153
# package names (e.g. gcc-powerpc).
154
# LS: Library Suffix. Used primarily at the end of cross compiler
155
# library package names (e.g. libgcc-powerpc-cross).
156
# AQ: Arch Qualifier. Used for cross-arch dependencies
157
DEB_TARGET_ALIAS ?= $(DEB_TARGET_GNU_TYPE)
158
TARGET := $(DEB_TARGET_ARCH)
159
TP := $(subst _,-,$(DEB_TARGET_GNU_TYPE))-
160
TS := -$(subst _,-,$(DEB_TARGET_ALIAS))
161
LS := -$(subst _,-,$(DEB_TARGET_ARCH))-cross
164
cross_bin_arch := -$(subst _,-,$(DEB_TARGET_ALIAS))
165
cross_lib_arch := -$(subst _,-,$(DEB_TARGET_ARCH))-cross
166
cmd_prefix := $(DEB_TARGET_GNU_TYPE)-
168
ifeq ($(with_deps_on_target_arch_pkgs),yes)
175
TARGET_ALIAS := $(DEB_TARGET_ALIAS)
177
lib_binaries := indep_binaries
178
cross_shlibdeps = DEB_HOST_ARCH=$(TARGET) ARCH=$(DEB_TARGET_ARCH) MAKEFLAGS="CC=something"
179
cross_gencontrol = DEB_HOST_ARCH=$(TARGET)
180
cross_makeshlibs = DEB_HOST_ARCH=$(TARGET)
181
cross_clean = DEB_HOST_ARCH=$(TARGET)
183
TARGET_ALIAS := $(DEB_TARGET_GNU_TYPE)
185
ifeq ($(TARGET_ALIAS),i386-gnu)
186
TARGET_ALIAS := i586-gnu
191
#ifeq ($(TARGET_ALIAS),i486-linux-gnu)
192
# TARGET_ALIAS := i686-linux-gnu
195
TARGET_ALIAS := $(subst i386,i486,$(TARGET_ALIAS))
197
# configure as linux-gnu, not linux
198
#ifeq ($(findstring linux,$(TARGET_ALIAS))/$(findstring linux-gnu,$(TARGET_ALIAS)),linux/)
199
# TARGET_ALIAS := $(TARGET_ALIAS)-gnu
202
# configure as linux, not linux-gnu
203
#TARGET_ALIAS := $(subst linux-gnu,linux,$(TARGET_ALIAS))
205
lib_binaries := arch_binaries
213
@echo DEB_TARGET_ARCH: $(DEB_TARGET_ARCH)
214
@echo DEB_TARGET_ARCH_OS: $(DEB_TARGET_ARCH_OS)
215
@echo DEB_TARGET_ARCH_CPU: $(DEB_TARGET_ARCH_CPU)
216
@echo DEB_TARGET_GNU_SYSTEM: $(DEB_TARGET_GNU_SYSTEM)
217
@echo DEB_TARGET_MULTIARCH: $(DEB_TARGET_MULTIARCH)
218
@echo MULTIARCH_CONFARG: $(MULTIARCH_CONFARG)
219
@echo TARGET_ALIAS: $(TARGET_ALIAS)
223
# -------------------------------------------------------------------
226
# "yes" is the default and causes a 3-stage bootstrap.
227
# "off" runs a complete build with --disable-bootstrap
228
# "no" means to just build the first stage, and not create the stage1
230
# "lean" means a lean 3-stage bootstrap, i.e. delete each stage when no
232
with_bootstrap = $(WITH_BOOTSTRAP)
234
ifneq ($(findstring nostrap, $(DEB_BUILD_OPTIONS)),)
235
with_bootstrap := off
238
# -------------------------------------------------------------------
243
# "stage1" is minimal compiler with static libgcc
244
# "stage2" is minimal compiler with shared libgcc
245
ifeq ($(DEB_STAGE),stage1)
246
with_shared_libgcc := no
248
ifeq ($(DEB_STAGE),stage2)
250
with_shared_libgcc := yes
254
ifeq ($(BACKPORT),true)
257
with_base_only := yes
260
# -------------------------------------------------------------------
263
with_sysroot = $(WITH_SYSROOT)
265
ifdef WITH_BUILD_SYSROOT
266
with_build_sysroot = $(WITH_BUILD_SYSROOT)
269
# -------------------------------------------------------------------
270
# for components configuration
273
SPACE = $(EMPTY) $(EMPTY)
275
# lang= overwrites all of nolang=, overwrites all of WITHOUT_LANG
277
DEB_LANG_OPT := $(filter lang=%,$(DEB_BUILD_OPTIONS))
278
DEB_LANG := $(strip $(subst $(COMMA), ,$(patsubst lang=%,%,$(DEB_LANG_OPT))))
279
DEB_NOLANG_OPT := $(filter nolang=%,$(DEB_BUILD_OPTIONS))
280
DEB_NOLANG := $(strip $(subst $(COMMA), ,$(patsubst nolang=%,%,$(DEB_NOLANG_OPT))))
281
lfilt = $(strip $(if $(DEB_LANG), \
282
$(if $(filter $(1) $(2),$(DEB_LANG)),yes),$(3)))
283
nlfilt = $(strip $(if $(DEB_NOLANG), \
284
$(if $(filter $(1) $(2),$(DEB_NOLANG)),disabled by $(DEB_NOLANG_OPT),$(3))))
285
wlfilt = $(strip $(if $(filter $(1) $(2), $(subst $(COMMA), ,$(WITHOUT_LANG))), \
286
disabled by WITHOUT_LANG=$(WITHOUT_LANG),$(3)))
287
envfilt = $(strip $(or $(call lfilt,$(1),$(2)),$(call nlfilt,$(1),$(3)),$(call wlfilt,$(1),$(3)),$(4)))
289
# -------------------------------------------------------------------
290
# architecture specific config
292
# FIXME: libjava is not ported for thumb, this hack only works for
293
# separate gcj builds
294
ifeq (,$(findstring gcj,$(PKGSOURCE)))
295
ifeq ($(DEB_TARGET_ARCH),armhf)
296
with_arm_thumb := yes
298
ifeq ($(distribution)-$(DEB_TARGET_ARCH),Ubuntu-armel)
299
ifneq (,$(filter $(distrelease),lucid maverick natty oneiric precise))
300
with_arm_thumb := yes
306
# build using fsf or linaro
307
ifeq ($(distribution),Ubuntu)
308
ifeq (,$(findstring gnat, $(PKGSOURCE)))
309
ifneq (,$(findstring $(DEB_TARGET_ARCH),arm64 armel armhf amd64 i386 powerpc))
310
with_linaro_branch = yes
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
x32=x86_64-linux-gnu,i386-linux-gnu \
376
kfreebsd-amd64=i386-kfreebsd-gnu
377
xarch_multiarch_names = $(subst $(COMMA),$(SPACE),$(patsubst $(DEB_TARGET_ARCH)=%,%, \
378
$(filter $(DEB_TARGET_ARCH)=%,$(multiarch_xarch_map))))
380
multilib_multiarch_map = \
381
$(DEB_TARGET_ARCH)/=$(DEB_TARGET_MULTIARCH) \
382
amd64/32=i386-linux-gnu \
383
amd64/x32=x86_64-linux-gnux32 \
384
armel/hf=arm-linux-gnueabihf \
385
armhf/sf=arm-linux-gnueabi \
386
i386/64=x86_64-linux-gnu \
387
i386/x32=x86_64-linux-gnux32 \
388
powerpc/64=powerpc64-linux-gnu \
389
ppc64/32=powerpc-linux-gnu \
390
sparc/64=sparc64-linux-gnu \
391
sparc64/32=sparc-linux-gnu \
392
s390/64=s390x-linux-gnu \
393
s390x/32=s390-linux-gnu \
394
mips/n32=mips64-linux-gnuabin32 \
395
mips/64=mips64-linux-gnuabi64 \
396
mipsel/n32=mips64el-linux-gnuabin32 \
397
mipsel/64=mips64el-linux-gnuabi64 \
398
x32/32=i386-linux-gnu \
399
x32/64=x86_64-linux-gnu \
400
kfreebsd-amd64/32=i386-kfreebsd-gnu
401
# $(call mlib_to_march,<empty>|32|64|n32|x32|hf|sf)
402
mlib_to_march = $(patsubst $(DEB_TARGET_ARCH)/$(1)=%,%, \
403
$(filter $(DEB_TARGET_ARCH)/$(1)=%,$(multilib_multiarch_map)))
405
ifneq ($(DEB_STAGE),stage1)
406
# build a -base package.
407
ifneq ($(DEB_CROSS),yes)
410
ifneq ($(with_deps_on_target_arch_pkgs),yes)
416
# build dev packages.
421
# set lang when built from a different source package.
424
ifneq (,$(findstring gcc-snapshot, $(PKGSOURCE)))
428
else ifneq (,$(findstring gcc-linaro, $(PKGSOURCE)))
432
# --program-suffix=-$(BASE_VERSION)
433
versioned_packages := yes
436
#no_dummy_cpus := ia64 i386 hppa s390 sparc
437
#ifneq (,$(filter $(DEB_TARGET_ARCH_CPU),$(no_dummy_cpus)))
438
# with_base_only := no
439
# with_common_libs := yes
440
# with_common_pkgs := yes
442
# with_base_only := yes
443
# with_common_libs := no
444
# with_common_pkgs := no
448
ifeq ($(versioned_packages),yes)
449
pkg_ver := -$(BASE_VERSION)
453
# -------------------------------------------------------------------
454
# configure languages
456
# C ---------------------------
457
enabled_languages := c
459
# Build all packages needed for C development
460
ifneq ($(with_base_only),yes)
461
ifeq ($(with_dev),yes)
467
# Ada --------------------
468
ada_no_cpus := m32r m68k sh3 sh3eb sh4 sh4eb
472
ifneq (,$(filter $(DEB_TARGET_ARCH),arm64 armhf m68k powerpcspe sh4 sparc64))
476
ifeq ($(with_dev),yes)
477
ifneq ($(separate_lang),yes)
481
ifneq (,$(filter $(DEB_TARGET_ARCH_CPU),$(ada_no_cpus)))
482
with_ada := disabled for cpu $(DEB_TARGET_ARCH_CPU)
484
ifneq (,$(findstring $(DEB_TARGET_GNU_SYSTEM),$(ada_no_systems)))
485
with_ada := disabled for system $(DEB_TARGET_GNU_SYSTEM)
487
ifeq ($(ada_no_cross)-$(DEB_CROSS),yes-yes)
488
with_ada := disabled for cross compiler package
490
ifeq ($(ada_no_snap)-$(single_package),yes-yes)
491
with_ada := disabled for snapshot build
493
with_ada := $(call envfilt, ada, , , $(with_ada))
495
ifneq ($(single_package),yes)
496
with_separate_gnat := yes
498
ifeq ($(with_ada)-$(with_separate_gnat),yes-yes)
499
ifneq (,$(findstring gnat,$(PKGSOURCE)))
503
debian_extra_langs += ada
504
with_ada := built from separate source
505
with_libgnat := built from separate source
509
ifeq ($(with_ada),yes)
510
enabled_languages += ada
512
# There are two exception handling mechanisms: ZCX (Zero-Cost
513
# eXceptions) and SJLJ (setjump/longjump), selected and supported by
514
# libgnat. Thus we build both versions of libgnat on architectures
515
# that support both (see ada-sjlj.diff). Most cpus support both
516
# mechanisms; here, we declare the few that support only one.
517
libgnat_zcx_only_cpus :=
518
libgnat_sjlj_only_cpus := arm armel armhf
519
ifneq (,$(filter $(DEB_TARGET_ARCH_CPU),$(libgnat_sjlj_only_cpus)))
524
ifneq (,$(filter $(DEB_TARGET_ARCH_CPU),$(libgnat_zcx_only_cpus)))
527
with_gnat_sjlj := yes
529
ifeq ($(with_gnat_zcx)-$(with_gnat_sjlj),no-no)
530
# TODO: support cpus that do not support exceptions at all,
531
# perhaps by building a restricted runtime library? For now, flag
532
# this as a packaging error.
533
$(error this target supports neither ZCX nor SJLJ)
537
# C++ -------------------------
539
ifneq ($(with_base_only),yes)
540
ifneq ($(separate_lang),yes)
544
ifneq (,$(findstring $(DEB_TARGET_ARCH_CPU),$(cxx_no_cpus)))
545
with_cxx := disabled for cpu $(DEB_TARGET_ARCH_CPU)
547
with_cxx := $(call envfilt, c++, obj-c++ java, , $(with_cxx))
549
# Build all packages needed for C++ development
550
ifeq ($(with_cxx),yes)
551
ifeq ($(with_dev),yes)
553
with_libcxxdbg := yes
555
ifeq ($(with_common_pkgs),yes)
559
# debugging versions of libstdc++
560
ifneq (,$(findstring gcc-, $(PKGSOURCE)))
561
ifeq ($(with_cxxdev),yes)
564
ifneq (,$(findstring $(DEB_TARGET_ARCH_CPU),$(debug_no_cpus)))
565
with_debug := disabled for cpu $(DEB_TARGET_GNU_CPU)
569
with_debug := $(call envfilt, debug, , , $(with_debug))
571
enabled_languages += c++
574
# Java --------------------
575
# - To build a standalone gcj package (with no corresponding gcc
576
# package): with_separate_libgcj=yes, with_standalone_gcj=yes
577
# - To build the java packages from the gcc source package:
578
# with_separate_libgcj=no, with_standalone_gcj=no
579
# - To build gcc and java from separate sources:
580
# with_separate_libgcj=yes, with_standalone_gcj=no
582
java_no_cpus := arm64 # mips mipsel
583
java_no_systems := knetbsd-gnu
585
ifneq ($(single_package),yes)
586
with_separate_libgcj := yes
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
enabled_languages += java
673
# Go -------------------
674
# - To build a standalone gccgo package (with no corresponding gcc
675
# package): with_separate_libgo=yes, with_standalone_go=yes
676
# - To build the go packages from the gcc source package:
677
# with_separate_libgo=no, with_standalone_go=no
678
# - To build gcc and go from separate sources:
679
# with_separate_libgo=yes, with_standalone_go=no
684
ifneq (,$(findstring gccgo, $(PKGSOURCE)))
685
with_separate_libgo := yes
686
with_standalone_go := yes
689
go_no_cpus := avr arm arm64 hppa m68k sh4 sparc sparc64
690
ifeq (,$(filter $(distrelease),lenny etch squeeze dapper hardy jaunty karmic lucid maverick natty oneiric))
691
go_no_cpus := $(filter-out arm, $(go_no_cpus))
693
go_no_systems := gnu kfreebsd-gnu
695
ifneq ($(with_base_only),yes)
696
ifneq ($(separate_lang),yes)
700
ifneq (,$(filter $(DEB_TARGET_ARCH_CPU),$(go_no_cpus)))
701
with_go := disabled for cpu $(DEB_TARGET_ARCH_CPU)
703
ifneq (,$(findstring $(DEB_TARGET_GNU_SYSTEM),$(go_no_systems)))
704
with_go := disabled for system $(DEB_TARGET_GNU_SYSTEM)
706
ifeq ($(go_no_cross)-$(DEB_CROSS),yes-yes)
707
with_go := disabled for cross compiler package
709
with_go := $(call envfilt, go, , , $(with_go))
711
# Build all packages needed for Go development
712
ifeq ($(with_go),yes)
713
ifeq ($(with_common_libs),yes)
716
enabled_languages += go
719
ifeq ($(with_go)-$(with_separate_libgo),yes-yes)
720
ifneq (,$(findstring gccgo, $(PKGSOURCE)))
721
languages := c c++ go
724
debian_extra_langs += go
725
with_go := built from separate source
726
with_libgo := buit from separate source
730
# D ---------------------------
734
ifneq ($(single_package),yes)
735
with_separate_gdc := yes
738
ifneq ($(separate_lang),yes)
741
ifeq ($(d_no_snap)-$(single_package),yes-yes)
742
with_d := disabled for snapshot build
745
ifeq ($(with_d)-$(with_separate_gdc),yes-yes)
746
ifneq (,$(findstring gdc,$(PKGSOURCE)))
750
# FIXME: not ready for 4.8
751
#debian_extra_langs += d
752
with_d := built from separate source
756
ifeq ($(with_base_only),yes)
761
# no suffix for D 1.0
762
#libphobos_version :=
764
libphobos_version := 2
766
with_libphobos := yes
768
libphobos_no_cpus := alpha avr arm hppa ia64 m68k mips mipsel powerpc powerpcspe ppc64 s390 s390x sh4 sparc sparc64
769
libphobos_no_systems := gnu
770
ifneq (,$(findstring $(DEB_TARGET_ARCH_CPU),$(libphobos_no_cpus)))
771
with_libphobos := disabled for cpu $(DEB_TARGET_ARCH_CPU)
773
ifneq (,$(findstring $(DEB_TARGET_GNU_SYSTEM),$(libphobos_no_systems)))
774
with_libphobos := disabled for system $(DEB_TARGET_GNU_SYSTEM)
777
enabled_languages += d
780
# Fortran 95 -------------------
781
fortran_no_cross := yes
782
fortran_no_cross := no
784
ifneq ($(with_base_only),yes)
785
ifneq ($(separate_lang),yes)
789
ifeq ($(fortran_no_cross)-$(DEB_CROSS),yes-yes)
790
with_fortran := disabled for cross compiler package
792
with_fortran := $(call envfilt, fortran, , , $(with_fortran))
794
# Build all packages needed for Fortran development
795
ifeq ($(with_fortran),yes)
796
ifeq ($(with_dev),yes)
799
ifeq ($(with_common_libs),yes)
800
with_libgfortran := yes
802
enabled_languages += fortran
805
# libquadmath -------------------
807
ifneq (,$(findstring $(DEB_TARGET_ARCH_CPU), ia64 i386 i486 i586 i686 amd64))
808
# FIXME: upstream build tied to gfortran build
809
ifeq ($(with_fortran),yes)
811
ifneq (,$(findstring gcc-4,$(PKGSOURCE)))
812
ifeq ($(with_common_libs),yes)
819
# ObjC ------------------------
822
ifneq ($(with_base_only),yes)
823
ifneq ($(separate_lang),yes)
825
objc_no_archs = arm64
826
ifneq (,$(filter $(DEB_TARGET_ARCH),$(objc_no_archs)))
831
ifeq ($(objc_no_cross)-$(DEB_CROSS),yes-yes)
832
with_objc := disabled for cross compiler package
834
with_objc := $(call envfilt, objc, obj-c++, , $(with_objc))
836
ifeq ($(with_objc),yes)
837
# the ObjC runtime with garbage collection enabled needs the Boehm GC
840
# disable ObjC garbage collection library (needs libgc)
841
libgc_no_cpus := arm64 avr mips mipsel # alpha amd64 arm armel armhf hppa i386 ia64 m68k mips mipsel powerpc ppc64 s390 s390x sparc
842
libgc_no_systems := knetbsd-gnu
843
ifneq (,$(filter $(DEB_TARGET_ARCH_CPU),$(libgc_no_cpus)))
844
with_objc_gc := disabled for cpu $(DEB_TARGET_ARCH_CPU)
846
ifneq (,$(findstring $(DEB_TARGET_GNU_SYSTEM),$(libgc_no_systems)))
847
with_objc_gc := disabled for system $(DEB_TARGET_GNU_SYSTEM)
850
# Build all packages needed for Objective-C development
851
ifeq ($(with_dev),yes)
854
# libobjc soname change in 4.7
855
#ifeq ($(with_common_libs),yes)
859
enabled_languages += objc
862
# ObjC++ ----------------------
863
objcxx_no_cross := no
865
ifeq ($(with_objc),yes)
866
ifneq ($(with_base_only),yes)
867
ifneq ($(separate_lang),yes)
872
ifeq ($(objcxx_no_cross)-$(DEB_CROSS),yes-yes)
873
with_objcxx := disabled for cross compiler package
875
with_objcxx := $(call envfilt, obj-c++, , c++ objc, $(with_objcxx))
877
ifeq ($(with_objcxx),yes)
878
enabled_languages += obj-c++
881
# -------------------------------------------------------------------
884
# not built from the main source package
885
ifeq (,$(findstring gcc-,$(PKGSOURCE)))
890
ifeq ($(trunk_build),yes)
893
with_nls := $(call envfilt, nls, , , $(with_nls))
895
# powerpc nof libraries -----
898
ifneq (,$(findstring gcc-4,$(PKGSOURCE)))
901
with_source := $(call envfilt, source, , , $(with_source))
903
# ssp & libssp -------------------------
905
ssp_no_archs = alpha arm64 hppa ia64 m68k
906
ifneq (, $(filter $(DEB_TARGET_ARCH),$(ssp_no_archs) $(ssp_no_archs:%=uclibc-%)))
907
with_ssp := not available on $(DEB_TARGET_ARCH)
909
with_ssp := $(call envfilt, ssp, , , $(with_ssp))
911
ifeq ($(with_ssp),yes)
912
ifneq ($(distribution),Debian)
913
ifneq (,$(findstring gcc-4, $(PKGSOURCE)))
914
with_ssp_default := yes
919
# mudflap -------------------
921
with_mudflap := $(call envfilt, mudflap, , , $(with_mudflap))
922
mudflap_no_archs = arm64
923
ifneq (,$(filter $(DEB_TARGET_ARCH),$(mudflap_no_archs)))
927
# gomp --------------------
929
with_gomp := $(call envfilt, gomp, , , $(with_gomp))
930
gomp_no_archs = arm64
931
ifneq (,$(filter $(DEB_TARGET_ARCH),$(gomp_no_archs)))
935
# itm --------------------
936
itm_archs = amd64 i386 x32
937
ifneq (,$(filter $(DEB_TARGET_ARCH),$(itm_archs)))
940
with_itm := $(call envfilt, itm, , , $(with_itm))
942
# atomic --------------------
944
atomic_no_archs = arm64
945
ifneq (,$(filter $(DEB_TARGET_ARCH),$(atomic_no_archs)))
949
# backtrace --------------------
950
with_backtrace := yes
951
backtrace_no_archs = m68k
952
ifneq (,$(filter $(DEB_TARGET_ARCH),$(backtrace_no_archs)))
956
# asan / sanitizer --------------------
958
with_asan := $(call envfilt, asan, , , $(with_asan))
959
asan_archs = amd64 armel armhf i386 powerpc ppc64 sparc sparc64 x32
960
ifneq (,$(filter $(DEB_TARGET_ARCH),$(asan_archs)))
964
# tsan / sanitizer --------------------
966
with_tsan := $(call envfilt, tsan, , , $(with_tsan))
968
ifneq (,$(filter $(DEB_TARGET_ARCH),$(tsan_archs)))
972
# gold --------------------
973
# armel with binutils 2.20.51 only
974
gold_archs = amd64 armel armhf i386 lpia powerpc ppc64 sparc
975
ifneq (,$(filter $(DEB_TARGET_ARCH),$(gold_archs)))
979
# plugins --------------------
982
endif # ifndef DEB_STAGE
984
# Don't include docs with GFDL invariant sections
985
GFDL_INVARIANT_FREE := yes
986
ifeq ($(distribution),Ubuntu)
987
GFDL_INVARIANT_FREE := no
990
# -------------------------------------------------------------------
992
ifeq ($(extra_package),yes)
993
ifeq ($(with_separate_libgcj)-$(with_standalone_gcj),yes-no)
1003
ifneq ($(DEB_CROSS),yes)
1006
with_gcjxbase := yes
1009
ifeq ($(with_separate_libgo),yes)
1020
# libssp ------------------
1021
ifeq ($(with_ssp)-$(with_common_libs),yes-yes)
1022
#ifneq ($(DEB_CROSS),yes)
1023
with_libssp := $(if $(wildcard $(builddir)/gcc/auto-host.h),$(shell if grep -qs '^\#define TARGET_LIBC_PROVIDES_SSP 1' $(builddir)/gcc/auto-host.h; then echo 'libc provides ssp'; else echo 'yes'; fi))
1027
# libmudflap --------------
1028
ifeq ($(with_mudflap)-$(with_common_libs),yes-yes)
1029
with_libmudflap := yes
1032
# libgomp -----------------
1033
ifeq ($(with_gomp)-$(with_common_libs),yes-yes)
1034
#ifneq ($(DEB_CROSS),yes)
1039
# libitm -----------------
1040
ifeq ($(with_itm)-$(with_common_libs),yes-yes)
1041
#ifneq ($(DEB_CROSS),yes)
1046
# libatomic -----------------
1047
ifeq ($(with_atomic)-$(with_common_libs),yes-yes)
1048
#ifneq ($(DEB_CROSS),yes)
1049
with_libatomic := yes
1053
# libbacktrace -----------------
1054
ifeq ($(with_backtrace)-$(with_common_libs),yes-yes)
1055
#ifneq ($(DEB_CROSS),yes)
1056
# currently not a shared library
1057
#with_libbacktrace := yes
1061
# libasan -----------------
1062
ifeq ($(with_asan)-$(with_common_libs),yes-yes)
1063
#ifneq ($(DEB_CROSS),yes)
1068
# libtsan -----------------
1069
ifeq ($(with_tsan)-$(with_common_libs),yes-yes)
1070
#ifneq ($(DEB_CROSS),yes)
1075
# libquadmath -----------------
1076
ifeq ($(with_qmath)-$(with_common_libs),yes-yes)
1077
#ifneq ($(DEB_CROSS),yes)
1078
with_libqmath := yes
1082
# fixincludes -------
1083
ifneq ($(DEB_CROSS),yes)
1084
ifeq ($(with_common_pkgs),yes)
1089
# Shared libgcc --------------------
1090
ifneq ($(DEB_STAGE),stage1)
1091
with_shared_libgcc := yes
1092
ifeq ($(with_common_libs),yes)
1097
# libgcc-math --------------------
1099
ifneq (,$(findstring i486,$(DEB_TARGET_ARCH)))
1100
#with_libgccmath := yes
1101
#with_lib64gmath := yes
1102
#with_libgmathdev := yes
1104
ifeq ($(DEB_TARGET_ARCH),amd64)
1105
#with_libgccmath := yes
1106
#with_lib32gmath := yes
1107
#with_libgmathdev := yes
1110
# hppa64 build ----------------
1111
hppa64_no_snap := no
1112
ifeq ($(DEB_TARGET_ARCH),hppa)
1115
ifeq ($(hppa64_no_snap)-$(trunk_build),yes-yes)
1116
with_hppa64 := disabled for snapshot build
1118
with_hppa64 := $(call envfilt, hppa64, , , $(with_hppa64))
1120
# spu build -------------------
1122
ifneq (,$(findstring $(DEB_TARGET_ARCH),powerpc ppc64))
1123
ifneq ($(DEB_CROSS),yes)
1127
ifeq ($(spu_no_snap)-$(trunk_build),yes-yes)
1128
with_spu := disabled for snapshot build
1130
with_spu := $(call envfilt, spu, , , $(with_spu))
1132
ifeq ($(with_spu),yes)
1133
with_spucache := yes
1134
with_spumea64 := yes
1137
# neon build -------------------
1138
# FIXME: build as a cross compiler to build on armv4 as well
1139
ifneq (,$(findstring gcc-4, $(PKGSOURCE)))
1140
ifeq ($(distribution),Ubuntu)
1141
# neon_archs = armel armhf
1142
# ifneq (, $(filter $(DEB_TARGET_ARCH),$(neon_archs)))
1149
# run testsuite ---------------
1151
# if you don't want to run the gcc testsuite, uncomment the next line
1152
#with_check := disabled by hand
1153
ifeq ($(with_base_only),yes)
1156
ifeq ($(DEB_CROSS),yes)
1157
with_check := disabled for cross compiler package
1159
ifeq ($(REVERSE_CROSS),yes)
1160
with_check := disabled for reverse cross build
1162
check_no_cpus := m68k
1163
check_no_systems := gnu
1164
ifneq (,$(findstring $(DEB_TARGET_ARCH_CPU),$(check_no_cpus)))
1165
with_check := disabled for cpu $(DEB_TARGET_ARCH_CPU)
1167
ifneq (,$(findstring $(DEB_TARGET_GNU_SYSTEM),$(check_no_systems)))
1168
with_check := disabled for system $(DEB_TARGET_GNU_SYSTEM)
1170
ifeq ($(distribution)-$(DEB_HOST_ARCH),Ubuntu-hppa)
1171
ifneq ($(single_package),yes)
1172
with_check := disabled, testsuite timeouts with expect
1175
ifneq (,$(findstring gdc,$(PKGSOURCE)))
1176
with_check := disabled for D
1178
with_check := $(call envfilt, check, , , $(with_check))
1180
with_check := disabled by environment
1182
ifneq ($(findstring nocheck, $(DEB_BUILD_OPTIONS)),)
1183
with_check := disabled by DEB_BUILD_OPTIONS
1185
#with_check := disabled for this build
1187
# not a dependency on all archs, but if available, use it for the testsuite
1188
ifneq (,$(wildcard /usr/bin/localedef))
1189
locale_data = generate
1192
all_enabled_languages := $(enabled_languages)
1193
languages_without_lang_opt := c++ objc obj-c++
1195
debian_extra_langs := $(subst obj-c++,objcp,$(debian_extra_langs))
1196
export debian_extra_langs
1199
biarch_map := i686=x86_64 powerpc=powerpc64 sparc=sparc64 s390=s390x s390x=s390 \
1200
x86_64=i686 powerpc64=powerpc mips=mips64 mipsel=mips64el
1201
ifeq (,$(filter $(distrelease),lenny etch squeeze wheezy sid dapper hardy jaunty karmic lucid))
1202
biarch_map := $(subst i686=,i486=,$(biarch_map))
1204
ifeq ($(distribution),Ubuntu)
1205
ifeq (,$(filter $(distrelease),dapper hardy jaunty karmic lucid maverick natty))
1206
biarch_map += arm=arm
1209
biarch_cpu := $(strip $(patsubst $(DEB_TARGET_GNU_CPU)=%,%, \
1210
$(filter $(DEB_TARGET_GNU_CPU)=%,$(biarch_map))))
1220
ifneq (yes,$$(call envfilt, biarch, , ,yes))
1223
ifneq (,$$(findstring /$$(DEB_TARGET_ARCH)/,$$(biarch$1archs)))
1226
#biarch$1subdir = $$(biarch_cpu)-$$(DEB_TARGET_GNU_SYSTEM)
1228
ifeq ($$(with_libgcc),yes)
1229
with_lib$1gcc := yes
1231
ifeq ($$(with_cdev),yes)
1232
with_lib$1gccdev := yes
1234
ifeq ($$(with_libcxx),yes)
1235
with_lib$1cxx := yes
1237
ifeq ($$(with_libcxxdbg),yes)
1238
with_lib$1cxxdbg := yes
1240
ifeq ($$(with_cxxdev),yes)
1241
with_lib$1cxxdev := yes
1243
ifeq ($$(with_libobjc),yes)
1244
with_lib$1objc := yes
1246
ifeq ($$(with_objcdev),yes)
1247
with_lib$1objcdev := yes
1249
ifeq ($$(with_libgfortran),yes)
1250
with_lib$1gfortran := yes
1252
ifeq ($$(with_fdev),yes)
1253
with_lib$1gfortrandev := yes
1255
ifeq ($$(with_libmudflap),yes)
1256
with_lib$1mudflap := yes
1258
ifeq ($$(with_libssp),yes)
1259
with_lib$1ssp := yes
1261
ifeq ($$(with_libgomp),yes)
1262
with_lib$1gomp:= yes
1264
ifeq ($$(with_libitm),yes)
1267
ifeq ($$(with_libatomic),yes)
1268
with_lib$1atomic:= yes
1270
ifeq ($$(with_libbacktrace),yes)
1271
with_lib$1backtrace:= yes
1273
ifeq ($$(with_libasan),yes)
1274
with_lib$1asan:= yes
1276
ifeq ($$(with_libtsan),yes)
1277
with_lib$1tsan:= yes
1279
ifeq ($$(with_libqmath),yes)
1280
with_lib$1qmath := yes
1282
ifeq ($$(with_libgo),yes)
1286
biarch_multidir_names = libiberty libgcc
1287
ifneq (,$$(findstring gcc-, $$(PKGSOURCE)))
1288
biarch_multidir_names += libstdc++-v3 libobjc libgfortran libssp \
1289
libgomp libmudflap zlib libitm \
1290
libbacktrace libatomic libsanitizer
1291
ifeq ($$(with_objc_gc),yes)
1292
biarch_multidir_names += boehm-gc
1295
ifneq (,$(findstring yes, $(with_java) $(with_go)))
1296
biarch_multidir_names += libffi
1298
ifeq ($(with_fortran),yes)
1299
biarch_multidir_names += libquadmath
1301
ifeq ($(with_go),yes)
1302
biarch_multidir_names += libgo
1304
export biarch_multidir_names
1305
ifneq (,$$(findstring 32,$1))
1306
TARGET64_MACHINE := $$(strip $$(subst $$(DEB_TARGET_GNU_CPU),$$(biarch_cpu), \
1308
TARGET32_MACHINE := $$(TARGET_ALIAS)
1310
TARGET64_MACHINE := $$(TARGET_ALIAS)
1311
TARGET64_MACHINE := $$(strip $$(subst $$(DEB_TARGET_GNU_CPU),$$(biarch_cpu), \
1314
export TARGET32_MACHINE
1315
export TARGET64_MACHINE
1318
biarch32archs := /amd64/ppc64/kfreebsd-amd64/s390x/x32/
1319
biarch64archs := /i386/powerpc/sparc/s390/mips/mipsel/x32/
1320
biarchn32archs := /mips/mipsel/
1321
ifeq ($(distribution),Ubuntu)
1322
ifeq (,$(filter $(distrelease),dapper hardy jaunty karmic lucid maverick natty))
1323
biarchhfarchs := /armel/
1324
biarchsfarchs := /armhf/
1326
ifeq (,$(filter $(distrelease),dapper hardy jaunty karmic lucid maverick natty oneiric precise quantal))
1327
biarchx32archs := /amd64/i386/
1330
ifeq ($(distribution),Debian)
1331
#ifeq (,$(filter $(distrelease),etch squeeze wheezy))
1332
ifeq (,$(filter $(distrelease),etch squeeze))
1333
biarchx32archs := /amd64/i386/
1336
$(foreach x,32 64 n32 x32 hf sf,$(eval $(call gen_biarch,$(x))))
1338
#ifeq ($(DEB_TARGET_ARCH),ia64)
1342
#ifeq ($(trunk_build),yes)
1343
# no_biarch_libs := yes
1345
ifdef DEB_CROSS_NO_BIARCH
1346
no_biarch_libs := yes
1348
ifeq ($(with_d)-$(with_separate_gdc),yes-yes)
1349
no_biarch_libs := yes
1352
ifeq ($(no_biarch_libs),yes)
1355
with_lib64cxxdbg := no
1356
with_lib64objc := no
1359
with_lib64gfortran := no
1360
with_lib64mudflap := no
1363
with_lib64gomp := no
1365
with_lib64qmath := no
1366
with_lib64atomic := no
1367
with_lib64backtrace := no
1368
with_lib64asan := no
1369
with_lib64tsan := no
1370
with_lib64gccdev := no
1371
with_lib64cxxdev := no
1372
with_lib64objcdev := no
1373
with_lib64gfortrandev := no
1377
with_lib32cxxdbg := no
1378
with_lib32objc := no
1381
with_lib32gfortran := no
1382
with_lib32mudflap := no
1385
with_lib32gomp := no
1387
with_lib32qmath := no
1388
with_lib32atomic := no
1389
with_lib32backtrace := no
1390
with_lib32asan := no
1391
with_lib32tsan := no
1392
with_lib32gccdev := no
1393
with_lib32cxxdev := no
1394
with_lib32objcdev := no
1395
with_lib32gfortrandev := no
1397
with_libn32gcc := no
1398
with_libn32cxx := no
1399
with_libn32cxxdbg := no
1400
with_libn32objc := no
1401
with_libn32ffi := no
1402
with_libn32gcj := no
1403
with_libn32gfortran := no
1404
with_libn32mudflap := no
1405
with_libn32ssp := no
1407
with_libn32gomp := no
1408
with_libn32itm := no
1409
with_libn32qmath := no
1410
with_libn32atomic := no
1411
with_libn32backtrace := no
1412
with_libn32asan := no
1413
with_libn32tsan := no
1414
with_libn32gccdev := no
1415
with_libn32cxxdev := no
1416
with_libn32objcdev := no
1417
with_libn32gfortrandev:= no
1419
with_libx32gcc := no
1420
with_libx32cxx := no
1421
with_libx32cxxdbg := no
1422
with_libx32objc := no
1423
with_libx32ffi := no
1424
with_libx32gcj := no
1425
with_libx32gfortran := no
1426
with_libx32mudflap := no
1427
with_libx32ssp := no
1429
with_libx32gomp := no
1430
with_libx32itm := no
1431
with_libx32qmath := no
1432
with_libx32atomic := no
1433
with_libx32backtrace := no
1434
with_libx32asan := no
1435
with_libx32tsan := no
1436
with_libx32gccdev := no
1437
with_libx32cxxdev := no
1438
with_libx32objcdev := no
1439
with_libx32gfortrandev:= no
1443
with_libhfcxxdbg := no
1444
with_libhfobjc := no
1447
with_libhfgfortran := no
1448
with_libhfmudflap := no
1451
with_libhfgomp := no
1453
with_libhfqmath := no
1454
with_libhfatomic := no
1455
with_libhfbacktrace := no
1456
with_libhfasan := no
1457
with_libhftsan := no
1458
with_libhfgccdev := no
1459
with_libhfcxxdev := no
1460
with_libhfobjcdev := no
1461
with_libhfgfortrandev := no
1465
with_libsfcxxdbg := no
1466
with_libsfobjc := no
1469
with_libsfgfortran := no
1470
with_libsfmudflap := no
1473
with_libsfgomp := no
1475
with_libsfqmath := no
1476
with_libsfatomic := no
1477
with_libsfbacktrace := no
1478
with_libsfasan := no
1479
with_libsftsan := no
1480
with_libsfgccdev := no
1481
with_libsfcxxdev := no
1482
with_libsfobjcdev := no
1483
with_libsfgfortrandev := no
1485
with_java_plugin := no
1487
ifdef DEB_CROSS_NO_BIARCH
1488
biarch64 := disabled by DEB_CROSS_NO_BIARCH
1489
biarch32 := disabled by DEB_CROSS_NO_BIARCH
1490
biarchn32 := disabled by DEB_CROSS_NO_BIARCH
1491
biarchx32 := disabled by DEB_CROSS_NO_BIARCH
1492
biarchhf := disabled by DEB_CROSS_NO_BIARCH
1493
biarchsf := disabled by DEB_CROSS_NO_BIARCH
1496
ifeq ($(with_d)-$(with_separate_gdc),yes-yes)
1497
biarch64 := disabled for D
1498
biarch32 := disabled for D
1499
biarchn32 := disabled for D
1500
biarchx32 := disabled for D
1501
biarchhf := disabled for D
1502
biarchsf := disabled for D
1505
ifeq ($(with_ada)-$(with_separate_gnat),yes-yes)
1506
biarchhf := disabled for Ada
1507
biarchsf := disabled for Ada
1512
ifneq (,$(filter yes,$(biarch32) $(biarch64) $(biarchn32) $(biarchx32) $(biarchhf) $(biarchsf)))
1516
multilib_archs = $(sort $(subst /, , $(biarch64archs) $(biarch32archs) $(biarchn32archs) $(biarchx32archs) $(biarchhfarchs) $(biarchsfarchs)))
1519
$(if $(filter yes,$(biarch64)),$(biarch64subdir),) \
1520
$(if $(filter yes,$(biarch32)),$(biarch32subdir),) \
1521
$(if $(filter yes,$(biarchn32)),$(biarchn32subdir),) \
1522
$(if $(filter yes,$(biarchx32)),$(biarchx32subdir),) \
1523
$(if $(filter yes,$(biarchhf)),$(biarchhfsubdir),) \
1524
$(if $(filter yes,$(biarchsf)),$(biarchsfsubdir),)
1525
biarchsubdirs := {$(strip $(shell echo $(biarchsubdirs) | tr " " ","))}
1528
force_gnu_locales := yes
1530
locale_no_systems :=
1531
ifneq (,$(findstring $(DEB_TARGET_GNU_SYSTEM),$(locale_no_systems)))
1532
force_gnu_locales := disabled for system $(DEB_TARGET_GNU_SYSTEM)
1535
gcc_tarpath := $(firstword $(wildcard gcc-*.tar.* /usr/src/gcc-$(BASE_VERSION)/gcc-*.tar.*))
1536
gcc_tarball := $(notdir $(gcc_tarpath))
1537
gcc_srcdir := $(subst -dfsg,,$(patsubst %.tar.xz,%,$(patsubst %.tar.lzma,%,$(patsubst %.tar.gz,%,$(gcc_tarball:.tar.bz2=)))))
1539
ifeq ($(with_d),yes)
1540
gdc_tarpath := $(firstword $(wildcard gdc-*.tar.* /usr/src/gcc-$(BASE_VERSION)/gdc-*.tar.*))
1541
gdc_tarball := $(notdir $(gdc_tarpath))
1542
gdc_srcdir := $(patsubst %.tar.xz,%,$(patsubst %.tar.lzma,%,$(patsubst %.tar.gz,%,$(gdc_tarball:.tar.bz2=))))
1545
# NOTE: This is not yet used. when building gcj, gdc or gnat using the
1546
# gcc-source package, we don't require an exact binary dependency.
1547
ifneq ($(dir $(gcc_tarpath)),./)
1548
built_using_external_source := yes
1550
built_using_external_source :=
1552
ifeq ($(DEB_CROSS),yes)
1553
add_built_using = yes
1556
ecj_jar := $(firstword $(wildcard ecj.jar /usr/share/java/eclipse-ecj.jar /usr/share/java/ecj.jar))
1558
unpack_stamp := $(stampdir)/01-unpack-stamp
1559
pre_patch_stamp := $(stampdir)/02-pre-patch-stamp
1560
patch_stamp := $(stampdir)/02-patch-stamp
1561
src_spu_stamp := $(stampdir)/02-src-spu-stamp
1562
control_stamp := $(stampdir)/03-control-stamp
1563
configure_stamp := $(stampdir)/04-configure-stamp
1564
build_stamp := $(stampdir)/05-build-stamp
1565
build_html_stamp := $(stampdir)/05-build-html-stamp
1566
build_locale_stamp := $(stampdir)/05-build-locale-stamp
1567
build_doxygen_stamp := $(stampdir)/05-build-doxygen-stamp
1568
build_javasrc_stamp := $(stampdir)/05-build-javasrc-stamp
1569
build_javadoc_stamp := $(stampdir)/05-build-javadoc-stamp
1570
check_stamp := $(stampdir)/06-check-stamp
1571
check_inst_stamp := $(stampdir)/06-check-inst-stamp
1572
install_stamp := $(stampdir)/07-install-stamp
1573
install_snap_stamp := $(stampdir)/07-install-snap-stamp
1574
binary_stamp := $(stampdir)/08-binary-stamp
1576
configure_dummy_stamp := $(stampdir)/04-configure-dummy-stamp
1577
build_dummy_stamp := $(stampdir)/05-build-dummy-stamp
1578
install_dummy_stamp := $(stampdir)/07-install-dummy-stamp
1580
configure_hppa64_stamp := $(stampdir)/04-configure-hppa64-stamp
1581
build_hppa64_stamp := $(stampdir)/05-build-hppa64-stamp
1582
install_hppa64_stamp := $(stampdir)/07-install-hppa64-stamp
1584
configure_neon_stamp := $(stampdir)/04-configure-neon-stamp
1585
build_neon_stamp := $(stampdir)/05-build-neon-stamp
1586
install_neon_stamp := $(stampdir)/07-install-neon-stamp
1588
configure_spu_stamp := $(stampdir)/04-configure-spu-stamp
1589
build_spu_stamp := $(stampdir)/05-build-spu-stamp
1590
install_spu_stamp := $(stampdir)/07-install-spu-stamp
1592
control_dependencies := $(patch_stamp)
1594
ifeq ($(single_package),yes)
1595
configure_dependencies = $(configure_stamp)
1596
build_dependencies = $(build_stamp)
1597
install_dependencies = $(install_snap_stamp)
1598
ifeq ($(with_check),yes)
1599
check_dependencies += $(check_stamp)
1602
ifeq ($(with_base_only),yes)
1603
configure_dependencies = $(configure_dummy_stamp)
1604
build_dependencies = $(build_dummy_stamp)
1605
install_dependencies = $(install_dummy_stamp)
1607
configure_dependencies = $(configure_stamp)
1608
build_dependencies = $(build_stamp)
1609
install_dependencies = $(install_stamp)
1610
ifeq ($(with_check),yes)
1611
check_dependencies += $(check_stamp)
1616
ifneq (,$(findstring gcj-, $(PKGSOURCE)))
1617
ifeq ($(with_gcj_base_only),yes)
1618
configure_dependencies = $(configure_dummy_stamp)
1619
build_dependencies = $(build_dummy_stamp)
1620
install_dependencies = $(install_dummy_stamp)
1624
ifeq ($(with_neon),yes)
1625
build_dependencies += $(build_neon_stamp)
1626
install_dependencies += $(install_neon_stamp)
1629
ifeq ($(with_hppa64),yes)
1630
build_dependencies += $(build_hppa64_stamp)
1631
ifneq ($(trunk_build),yes)
1632
install_dependencies += $(install_hppa64_stamp)
1636
ifeq ($(with_spu),yes)
1637
control_dependencies += $(src_spu_stamp)
1638
build_dependencies += $(build_spu_stamp)
1639
ifneq ($(trunk_build),yes)
1640
install_dependencies += $(install_spu_stamp)
1644
build_dependencies += $(check_dependencies)
1647
mkdir -p $(stampdir)
1649
ifeq ($(DEB_CROSS),yes)
1650
ifneq ($(with_deps_on_target_arch_pkgs),yes)
1651
define cross_mangle_shlibs
1652
sed -i s/$(cross_lib_arch)//g debian/$(1)/DEBIAN/shlibs
1654
define cross_mangle_substvars
1655
if [ -f debian/$(1).substvars ]; then \
1656
sed -i 's/lib[^ ,(]*/&$(cross_lib_arch)/g' debian/$(1).substvars; \
1660
define cross_mangle_shlibs
1662
define cross_mangle_substvars
1666
define cross_mangle_shlibs
1668
define cross_mangle_substvars
1672
# takes a *list* of package names as $1, the multilib dirname as $2
1674
$(if $(strip $(1)), \
1675
$(shell find $(foreach p,$(1),$(CURDIR)/debian/$(p)) \
1676
-name '*.so.*' -printf '%h ' | uniq)) \
1677
$(with_build_sysroot)/lib/$(call mlib_to_march,$(2)) \
1678
$(with_build_sysroot)/usr/lib/$(call mlib_to_march,$(2)) \
1679
$(with_build_sysroot)$(subst /usr,,/$(usr_lib$(2))) \
1680
$(with_build_sysroot)/$(usr_lib$(2)) \
1681
$(if $(filter yes,$(biarchsf) $(biarchhf)), \
1682
$(with_build_sysroot)/usr/$(call mlib_to_march,$(2))/lib)
1683
shlibdirs_to_search = -l$(subst $(SPACE),:,$(foreach d,$(_shlibdirs),$(d)))
1687
ifneq (,$(filter $(DEB_TARGET_ARCH), mips mipsel))
1688
ifneq ($(with_deps_on_target_arch_pkgs),yes)
1689
define cross_mangle_control
1690
$(if $(findstring 64,$(1)),sed -i -r '/^(Dep|Rec|Sug)/s/[a-z0-9-]+32[^$(COMMA)]+($(COMMA) *|$$)//g;/^(Dep|Rec|Sug)/s/$(p_lgcc)/$(p_l64gcc)/;/^(Dep|Rec|Sug)/s/ *$(COMMA) *$$//' debian/$(1)/DEBIAN/control,@:)
1691
$(if $(findstring n32,$(1)),sed -i -r '/^(Dep|Rec|Sug)/s/[a-z0-9-]+64[^$(COMMA)]+($(COMMA) *|$$)//g;/^(Dep|Rec|Sug)/s/$(p_lgcc)/$(p_ln32gcc)/;/^(Dep|Rec|Sug)/s/ *$(COMMA) *$$//' debian/$(1)/DEBIAN/control,@:)
1694
define cross_mangle_control
1698
define cross_mangle_control