4
# Uncomment this to turn on verbose mode.
9
include debian/rules.defs
10
include debian/rules.parameters
13
SHELL = /bin/bash -e # brace expansion in rules file
14
IR = install -m 644 # Install regular file
15
IP = install -m 755 # Install program
16
IS = install -m 755 # Install script
18
#number of jobs to run for build
19
ifeq ($(USE_NJOBS),no)
23
ifeq ($(with_java),yes)
28
NUM_CPUS := $(shell if echo $(USE_NJOBS) | grep -q -E '^[0-9]+$$'; \
29
then echo $(USE_NJOBS); \
30
else getconf _NPROCESSORS_ONLN 2>/dev/null || echo 1; fi)
31
USE_CPUS := $(shell mt=`awk '/^MemTotal/ { print $$2 }' /proc/meminfo`; \
32
awk -vn=$(NUM_CPUS) -vmt=$$mt -vm=$(MEM_PER_CPU) \
33
'END { mt/=1024; n2 = int(mt/m); print n==1 ? 1 : n2<n+1 ? n2 : n+1}' < /dev/null)
34
ifneq (,$(strip $(USE_CPUS)))
35
NJOBS := -j $(USE_CPUS)
39
# Support parallel=<n> in DEB_BUILD_OPTIONS (see #209008)
40
ifneq (,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS))))
41
USE_CPUS := $(subst parallel=,,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS))))
42
NJOBS := -j $(USE_CPUS)
45
# kernel-specific ulimit hack
46
ifeq ($(findstring linux,$(DEB_HOST_GNU_SYSTEM)),linux)
47
ULIMIT_M = if [ -e /proc/meminfo ]; then \
48
m=`awk '/^((Mem|Swap)Free|Cached)/{m+=$$2}END{print int(m*.9)}' \
51
m=`vmstat --free --swap-free --kilobytes|awk '{m+=$$2}END{print int(m*.9)}'`; \
53
echo "Limiting memory for test runs to $${m}kB"; \
54
if ulimit -m $$m; then \
55
echo " limited to `ulimit -m`kB"; \
63
ifeq ($(locale_data),generate)
64
SET_LOCPATH = LOCPATH=$(PWD)/locales
67
SET_PATH = PATH=$(PWD)/bin:/usr/$(libdir)/gcc/bin:$$PATH
68
ifeq ($(trunk_build),yes)
69
ifneq (,$(findstring sparc64-linux,$(DEB_TARGET_GNU_TYPE)))
70
SET_PATH = PATH=/usr/lib/gcc-snapshot/bin:$(PWD)/bin:/usr/$(libdir)/gcc/bin:$$PATH
72
ifneq (,$(findstring ppc64-linux,$(DEB_TARGET_GNU_TYPE)))
73
SET_PATH = PATH=/usr/lib/gcc-snapshot/bin:$(PWD)/bin:/usr/$(libdir)/gcc/bin:$$PATH
77
# the recipient for the test summaries. Send with: debian/rules mail-summary
78
S_EMAIL = gcc@packages.debian.org gcc-testresults@gcc.gnu.org
80
# build not yet prepared to take variables from the environment
85
$(foreach v, CPPFLAGS CFLAGS CXXFLAGS FFLAGS LDFLAGS, $(if $(filter environment,$(origin $(v))),$(eval $(call unsetenv, $(v)))))
87
ifeq ($(REVERSE_CROSS),yes)
90
CC = $(if $(filter yes,$(with_ada)),gnatgcc,gcc)
92
ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_TARGET_GNU_TYPE))
93
CC_FOR_TARGET = $(builddir)/gcc/xgcc -B$(builddir)/gcc/
95
CC_FOR_TARGET = $(DEB_TARGET_GNU_TYPE)-gcc
98
ifneq ($(derivative),Ubuntu)
99
ifneq (,$(filter $(DEB_TARGET_ARCH), arm armel mips mipsel))
100
STAGE1_CFLAGS = -g -O2
109
# work around PR 57689
110
ifeq ($(DEB_TARGET_ARCH),ia64)
114
ifeq ($(with_ssp_default),yes)
116
ifeq (,$(BOOT_CFLAGS))
120
LIBCXXFLAGS = -g -O2 -fno-implicit-templates
121
# Only use -fno-stack-protector when known to the stage1 compiler.
122
cc-fno-stack-protector := $(shell if $(CC) $(CFLAGS) -fno-stack-protector \
123
-S -o /dev/null -xc /dev/null > /dev/null 2>&1; \
124
then echo "-fno-stack-protector"; fi;)
125
$(foreach var,STAGE1_CFLAGS BOOT_CFLAGS LIBCFLAGS LIBCXXFLAGS,$(eval \
126
$(var) += $(cc-fno-stack-protector)))
129
ifeq ($(DEB_CROSS),yes)
133
ifneq (,$(findstring static,$(DEB_BUILD_OPTIONS)))
137
ifneq (,$(filter $(DEB_TARGET_ARCH),alpha))
138
LDFLAGS += -Wl,--no-relax
142
$(if $(CFLAGS),CFLAGS="$(CFLAGS)") \
143
$(if $(BOOT_CFLAGS),BOOT_CFLAGS="$(BOOT_CFLAGS)") \
144
$(if $(LIBCFLAGS),LIBCFLAGS="$(LIBCFLAGS)") \
145
$(if $(LIBCXXFLAGS),LIBCXXFLAGS="$(LIBCXXFLAGS)")
147
$(if $(LDFLAGS),LDFLAGS="$(LDFLAGS)")
148
STAGE1_CFLAGS_TO_PASS = \
149
$(if $(STAGE1_CFLAGS),STAGE1_CFLAGS="$(STAGE1_CFLAGS)")
151
docdir = usr/share/doc
154
--with-pkgversion='$(distribution)$(if $(with_linaro_branch),/Linaro)___$(DEB_VERSION)' \
155
--with-bugurl='file:///usr/share/doc/$(subst gcj,gcc,$(PKGSOURCE))/README.Bugs'
158
--enable-languages=$(subst $(SPACE),$(COMMA),$(enabled_languages)) \
161
ifeq ($(versioned_packages),yes)
162
CONFARGS += --program-suffix=-$(BASE_VERSION)
167
--disable-decimal-float \
168
--disable-libatomic \
170
--disable-libmudflap \
172
--disable-libquadmath \
173
--disable-libsanitizer \
175
--libexecdir=/$(libexecdir) \
176
--libdir=/$(PF)/$(configured_libdir) \
177
$(if $(with_build_sysroot),--with-build-sysroot=$(with_build_sysroot)) \
178
$(if $(with_sysroot),--with-sysroot=$(with_sysroot))
180
ifeq ($(with_multiarch_lib),yes)
185
ifeq ($(DEB_STAGE),stage1)
198
--enable-linker-build-id \
200
ifneq ($(single_package),yes)
202
--libexecdir=/$(libexecdir) \
203
--without-included-gettext \
204
--enable-threads=posix \
205
--with-gxx-include-dir=/$(cxx_inc_dir) \
206
--libdir=/$(PF)/$(configured_libdir)
209
ifneq ($(with_cpp),yes)
210
CONFARGS += --disable-cpp
213
ifeq ($(with_nls),yes)
214
CONFARGS += --enable-nls
216
CONFARGS += --disable-nls
219
ifeq ($(with_bootstrap),off)
220
CONFARGS += --disable-bootstrap
221
else ifneq ($(with_bootstrap),)
222
CONFARGS += --enable-bootstrap=$(with_bootstrap)
225
ifneq ($(with_sysroot),)
226
CONFARGS += --with-sysroot=$(with_sysroot)
228
ifneq ($(with_build_sysroot),)
229
CONFARGS += --with-build-sysroot=$(with_build_sysroot)
232
ifeq ($(force_gnu_locales),yes)
233
CONFARGS += --enable-clocale=gnu
236
ifeq ($(with_cxx)-$(with_debug),yes-yes)
237
CONFARGS += --enable-libstdcxx-debug
239
CONFARGS += --enable-libstdcxx-time=yes
241
ifeq (,$(filter $(DEB_TARGET_ARCH), hurd-i386 kfreebsd-i386 kfreebsd-amd64))
242
CONFARGS += --enable-gnu-unique-object
245
ifneq ($(with_ssp),yes)
246
CONFARGS += --disable-libssp
249
CONFARGS += --disable-libmudflap
251
ifneq ($(with_gomp),yes)
252
CONFARGS += --disable-libgomp
255
ifneq ($(with_itm),yes)
256
CONFARGS += --disable-libitm
259
ifneq ($(with_atomic),yes)
260
CONFARGS += --disable-libatomic
263
ifneq ($(with_asan),yes)
264
CONFARGS += --disable-libsanitizer
267
ifneq ($(with_qmath),yes)
268
CONFARGS += --disable-libquadmath
271
ifeq ($(with_plugins),yes)
272
CONFARGS += --enable-plugin
275
#ifeq ($(with_gold),yes)
276
# CONFARGS += --enable-gold --enable-ld=default
279
#CONFARGS += --with-plugin-ld=ld.gold
280
#CONFARGS += --with-plugin-ld
284
CONFARGS += --with-system-zlib
286
jvm_name_short = java-1.5.0-gcj-$(BASE_VERSION)$(if $(findstring snap,$(PKGSOURCE)),-snap)
287
jvm_name_long = $(jvm_name_short)-1.5.0.0
289
ifeq ($(with_java),yes)
290
CONFARGS += --disable-browser-plugin
291
ifeq ($(with_java_maintainer_mode),yes)
292
CONFARGS += --enable-java-maintainer-mode
294
ifeq ($(with_java_biarch_awt),yes)
295
CONFARGS += --enable-java-awt=$(subst $(SPACE),$(COMMA),$(foreach p,$(java_awt_peers),$(p)-default))
297
CONFARGS += --enable-java-awt=$(subst $(SPACE),$(COMMA),$(foreach p,$(java_awt_peers),$(p)))
299
ifneq (,$(findstring gtk,$(java_awt_peers)))
300
CONFARGS += --enable-gtk-cairo
302
jvm_ext = -$(DEB_TARGET_ARCH)$(if $(filter yes,$(DEB_CROSS)),-cross)
303
jvm_dir = /usr/lib/jvm/$(jvm_name_short)$(jvm_ext)
304
CONFARGS += --with-java-home=$(jvm_dir)/jre
305
CONFARGS += --enable-java-home \
306
--with-jvm-root-dir=$(jvm_dir) \
307
--with-jvm-jar-dir=/usr/lib/jvm-exports/$(jvm_name_short)$(jvm_ext)
308
CONFARGS += --with-arch-directory=$(java_cpu)
309
ifeq (./,$(dir $(ecj_jar)))
310
CONFARGS += --with-ecj-jar=$(jvm_dir)/lib/ecj.jar
312
CONFARGS += --with-ecj-jar=$(ecj_jar)
314
ifneq ($(with_libgcj),yes)
315
CONFARGS += --disable-libgcj
319
ifeq ($(with_gcj),yes)
320
ifeq ($(DEB_HOST_GNU_CPU),m32r)
321
CONFARGS += --enable-libgcj
325
ifeq ($(with_objc)-$(with_objc_gc),yes-yes)
326
CONFARGS += --enable-objc-gc
329
ifneq (,$(filter $(DEB_TARGET_GNU_TYPE), i486-linux-gnu i586-linux-gnu i686-linux-gnu))
330
ifeq ($(multilib),yes)
331
ifeq ($(biarch64),yes)
332
CONFARGS += --enable-targets=all
337
ifneq (,$(filter $(DEB_TARGET_GNU_TYPE), x86_64-linux-gnu x86_64-kfreebsd-gnu s390x-linux-gnu))
338
ifneq ($(biarch32),yes)
339
CONFARGS += --disable-multilib
343
ifneq (,$(filter $(DEB_TARGET_GNU_TYPE), powerpc-linux-gnu powerpc-linux-gnuspe))
344
CONFARGS += --enable-secureplt
345
ifeq ($(biarch64),yes)
346
CONFARGS += --disable-softfloat --with-cpu=default32
347
ifeq ($(multilib),yes)
348
CONFARGS += --disable-softfloat \
349
--enable-targets=powerpc-linux,powerpc64-linux
352
CONFARGS += --disable-multilib
356
ifneq (,$(findstring powerpc64-linux,$(DEB_TARGET_GNU_TYPE)))
357
CONFARGS += --enable-secureplt
358
ifeq ($(biarch32),yes)
359
ifeq ($(multilib),yes)
360
CONFARGS += --disable-softfloat --enable-targets=powerpc64-linux,powerpc-linux
363
CONFARGS += --disable-multilib
365
ifeq ($(derivative),Ubuntu)
366
CONFARGS += --with-cpu-32=power7 --with-cpu-64=power7
370
ifeq ($(REVERSE_CROSS),yes)
371
# FIXME: requires isl and cloog headers for the target
372
#CONFARGS += --without-isl
373
# FIXME: build currently fails build the precompiled headers
374
CONFARGS += --disable-libstdcxx-pch
377
ifeq ($(with_multiarch_lib),yes)
378
CONFARGS += --enable-multiarch
381
ifeq ($(findstring powerpcspe,$(DEB_TARGET_ARCH)),powerpcspe)
382
CONFARGS += --with-cpu=8548 --enable-e500_double
385
ifneq (,$(findstring softfloat,$(DEB_TARGET_GNU_CPU)))
386
CONFARGS += --with-float=soft
389
ifneq (,$(findstring arm-vfp,$(DEB_TARGET_GNU_CPU)))
390
CONFARGS += --with-fpu=vfp
393
ifneq (,$(findstring arm, $(DEB_TARGET_GNU_CPU)))
394
ifeq ($(multilib),yes)
395
CONFARGS += --enable-multilib
397
CONFARGS += --disable-sjlj-exceptions
398
# FIXME: libjava is not ported for thumb, this hack only works for
399
# separate gcj builds
400
ifneq (,$(filter armhf,$(DEB_TARGET_ARCH)))
401
ifeq ($(distribution),Raspbian)
402
with_arm_arch = armv6
405
ifneq (,$(findstring gcj,$(PKGSOURCE)))
406
with_arm_arch = armv6
408
with_arm_arch = armv7-a
410
with_arm_fpu = vfpv3-d16
414
ifeq ($(derivative),Debian)
415
with_arm_arch = armv4t
416
else ifneq (,$(filter $(distrelease),karmic))
417
with_arm_arch = armv6
418
with_arm_fpu = vfpv3-d16
419
else ifneq (,$(filter $(distrelease),lucid maverick natty oneiric precise))
420
ifneq (,$(findstring gcj,$(PKGSOURCE)))
421
with_arm_arch = armv6
423
with_arm_arch = armv7-a
425
with_arm_fpu = vfpv3-d16
427
with_arm_arch = armv5t # starting with quantal
430
CONFARGS += --with-arch=$(with_arm_arch)
431
ifneq (,$(with_arm_fpu))
432
CONFARGS += --with-fpu=$(with_arm_fpu)
434
CONFARGS += --with-float=$(float_abi)
435
ifeq ($(with_arm_thumb),yes)
436
CONFARGS += --with-mode=thumb
440
ifeq ($(DEB_TARGET_GNU_CPU),$(findstring $(DEB_TARGET_GNU_CPU),m68k))
441
CONFARGS += --disable-werror
443
# FIXME: correct fix-warnings.dpatch
444
ifeq ($(derivative),Ubuntu)
445
CONFARGS += --disable-werror
448
ifneq (,$(findstring sparc-linux,$(DEB_TARGET_GNU_TYPE)))
449
ifeq ($(biarch64),yes)
450
CONFARGS += --enable-targets=all
454
ifneq (,$(findstring sparc64-linux,$(DEB_TARGET_GNU_TYPE)))
455
ifeq ($(biarch32),yes)
456
CONFARGS += --enable-targets=all
460
ifneq (,$(findstring ia64-linux,$(DEB_TARGET_GNU_TYPE)))
461
CONFARGS += --with-system-libunwind
464
ifneq (,$(findstring sh4-linux,$(DEB_TARGET_GNU_TYPE)))
465
ifeq ($(multilib),yes)
466
CONFARGS += --with-multilib-list=m4,m4-nofpu
468
CONFARGS += --with-cpu=sh4
471
ifneq (,$(findstring m68k-linux,$(DEB_TARGET_GNU_TYPE)))
472
CONFARGS += --disable-multilib
475
ifeq ($(DEB_TARGET_ARCH_OS),linux)
476
ifneq (,$(findstring $(DEB_TARGET_ARCH), alpha powerpc ppc64 s390 s390x sparc sparc64))
477
CONFARGS += --with-long-double-128
481
ifneq (,$(filter $(DEB_TARGET_ARCH), amd64 i386 kfreebsd-i386 kfreebsd-amd64))
482
ifneq (,$(filter $(derivative),Ubuntu))
483
ifneq (,$(filter $(distrelease),dapper hardy))
484
CONFARGS += --with-arch-32=i486
485
else ifneq (,$(filter $(distrelease),jaunty karmic lucid))
486
CONFARGS += --with-arch-32=i586
488
CONFARGS += --with-arch-32=i686
491
ifneq (,$(filter $(distrelease),etch lenny))
492
CONFARGS += --with-arch-32=i486
494
CONFARGS += --with-arch-32=i586
499
ifeq ($(DEB_TARGET_ARCH),amd64)
500
CONFARGS += --with-abi=m64
502
ifeq ($(multilib),yes)
503
ifneq (,$(filter $(DEB_TARGET_ARCH), amd64 i386))
504
CONFARGS += --with-multilib-list=m32,m64$(if $(filter yes,$(biarchx32)),$(COMMA)mx32)
505
else ifeq ($(DEB_TARGET_ARCH),x32)
506
CONFARGS += --with-abi=mx32 --with-multilib-list=mx32,m64,m32
510
ifneq (,$(filter $(DEB_TARGET_ARCH), hurd-i386))
511
CONFARGS += --with-arch=i586
514
ifeq ($(DEB_TARGET_ARCH),lpia)
515
CONFARGS += --with-arch=pentium-m --with-tune=i586
518
ifneq (,$(filter $(DEB_TARGET_ARCH), amd64 i386 hurd-i386 kfreebsd-i386 kfreebsd-amd64))
519
CONFARGS += --with-tune=generic
522
ifneq (,$(findstring mips-linux,$(DEB_TARGET_GNU_TYPE)))
523
CONFARGS += --with-arch-32=mips2 --with-tune-32=mips32
524
ifeq ($(multilib),yes)
525
ifeq ($(biarchn32)-$(biarch64),yes-yes)
526
CONFARGS += --enable-targets=all
527
CONFARGS += --with-arch-64=mips3 --with-tune-64=mips64
532
ifneq (,$(findstring mipsel-linux,$(DEB_TARGET_GNU_TYPE)))
533
CONFARGS += --with-arch-32=mips2 --with-tune-32=mips32
534
ifeq ($(multilib),yes)
535
ifeq ($(biarchn32)-$(biarch64),yes-yes)
536
CONFARGS += --enable-targets=all
537
CONFARGS += --with-arch-64=mips3 --with-tune-64=mips64
542
#FIXME: howto for mipsn32?
543
ifneq (,$(findstring mips64el-linux-gnuabin32,$(DEB_TARGET_GNU_TYPE)))
544
CONFARGS += --with-mips-plt
545
ifeq ($(multilib),yes)
546
ifeq ($(biarchn32)-$(biarch32),yes-yes)
547
CONFARGS += --enable-targets=all
548
CONFARGS += --with-arch-64=mips64r2 --with-tune-64=loongson3a
549
CONFARGS += --with-arch-32=mips32 --with-tune-32=mips32r2
554
ifneq (,$(findstring mips64-linux-gnuabin32,$(DEB_TARGET_GNU_TYPE)))
555
CONFARGS += --with-mips-plt
556
ifeq ($(multilib),yes)
557
ifeq ($(biarchn32)-$(biarch32),yes-yes)
558
CONFARGS += --enable-targets=all
559
CONFARGS += --with-arch-64=mips64r2 --with-tune-64=octeon+
560
CONFARGS += --with-arch-32=mips32 --with-tune-32=mips32r2
565
ifneq (,$(findstring mips64el-linux-gnuabi64,$(DEB_TARGET_GNU_TYPE)))
566
CONFARGS += --with-mips-plt
567
CONFARGS += --with-arch-64=mips64r2 --with-tune-64=loongson3a
568
ifeq ($(multilib),yes)
569
ifeq ($(biarchn32)-$(biarch32),yes-yes)
570
CONFARGS += --enable-targets=all
571
CONFARGS += --with-arch-32=mips2 --with-tune-32=mips32
576
ifneq (,$(findstring mips64-linux-gnuabi64,$(DEB_TARGET_GNU_TYPE)))
577
CONFARGS += --with-mips-plt
578
CONFARGS += --with-arch-64=mips64r2 --with-tune-64=octeon+
579
ifeq ($(multilib),yes)
580
ifeq ($(biarchn32)-$(biarch32),yes-yes)
581
CONFARGS += --enable-targets=all
582
CONFARGS += --with-arch-32=mips2 --with-tune-32=mips32
587
ifneq (,$(findstring s390-linux,$(DEB_TARGET_GNU_TYPE)))
588
ifeq ($(multilib),yes)
589
ifeq ($(biarch64),yes)
590
CONFARGS += --enable-targets=all
595
ifneq (,$(findstring hppa-linux,$(DEB_TARGET_GNU_TYPE)))
596
CONFARGS += --disable-libstdcxx-pch
599
ifneq (,$(findstring gdc, $(PKGSOURCE)))
600
CONFARGS += --disable-libquadmath
603
ifeq ($(trunk_build),yes)
604
ifeq ($(findstring --disable-werror, $(CONFARGS)),)
605
CONFARGS += --disable-werror
607
CONFARGS += --enable-checking=yes
609
CONFARGS += --enable-checking=release
613
--build=$(DEB_BUILD_GNU_TYPE) \
614
--host=$(DEB_HOST_GNU_TYPE) \
615
--target=$(TARGET_ALIAS)
617
ifeq ($(DEB_CROSS),yes)
619
--program-prefix=$(TARGET_ALIAS)-
620
ifneq ($(with_deps_on_target_arch_pkgs),yes)
622
--includedir=/$(PFL)/include
626
ifeq ($(with_bootstrap),off)
628
else ifeq ($(with_bootstrap),)
629
bootstrap_target = bootstrap-lean
630
# no profiledbootstrap on the following architectures
631
# - m68k: we're happy that it builds at all
632
no_profiled_bs_archs := alpha arm arm64 hppa m68k
633
ifeq (,$(findstring $(DEB_TARGET_GNU_CPU),$(no_profiled_bs_archs)))
634
bootstrap_target = profiledbootstrap
635
# FIXME: disabled for first uploads
636
bootstrap_target = bootstrap-lean
638
ifeq ($(PKGSOURCE),gcj-$(BASE_VERSION))
639
bootstrap_target = bootstrap-lean
641
ifeq ($(PKGSOURCE),gnat-$(BASE_VERSION))
642
bootstrap_target = bootstrap-lean
645
# disable profiled bootstrap on slow archs, get to testing first ...
646
ifeq ($(derivative),Debian)
647
ifneq (,$(filter $(DEB_TARGET_ARCH), arm arm64 armel armhf mips mipsel sparc))
648
bootstrap_target = bootstrap-lean
651
ifeq ($(derivative),Ubuntu)
652
ifneq (,$(filter $(DEB_TARGET_ARCH), arm64 sparc))
653
bootstrap_target = bootstrap-lean
659
# Increase the timeout for one testrun on slow architectures
660
ifeq ($(derivative),Debian)
661
ifneq (,$(findstring $(DEB_TARGET_ARCH),arm arm64 armel armhf hppa m68k sparc))
663
else ifneq (,$(findstring $(DEB_TARGET_GNU_CPU),amd64 i386 i486 i686 lpia))
666
ifeq ($(DEB_TARGET_GNU_SYSTEM),gnu)
669
else ifeq ($(derivative),Ubuntu)
670
ifneq (,$(findstring $(DEB_TARGET_ARCH),arm64 armel armhf hppa ia64 sparc))
672
else ifneq (,$(findstring $(DEB_TARGET_GNU_CPU),amd64 i386 i486 i686 lpia))
678
ifneq ($(trunk_build),yes)
679
ifeq ($(with_ssp),yes)
680
ifneq ($(single_package),yes)
681
DEJAGNU_RUNS += $(if $(filter yes,$(with_ssp_default)),-fno-stack-protector,-fstack-protector)
683
# FIXME Ubuntu armel buildd hangs
684
ifneq (,$(findstring arm, $(DEB_TARGET_GNU_CPU)))
687
ifeq ($(derivative),Ubuntu)
688
# the buildds are just slow ... don't check the non-default
689
ifneq (,$(findstring $(DEB_TARGET_GNU_CPU),ia64 powerpc sparc))
696
ifeq ($(derivative),Ubuntu)
697
ifneq (,$(findstring arm, $(DEB_TARGET_GNU_CPU)))
698
ifeq ($(with_arm_thumb),yes)
699
#DEJAGNU_RUNS += -marm
701
DEJAGNU_RUNS += -mthumb
706
# no b-d on g++-multilib, this is run by the built compiler
707
abi_run_check = $(strip $(if $(wildcard build/runcheck$(1).out), \
708
$(shell cat build/runcheck$(1).out), \
709
$(shell CC="$(builddir)/gcc/xgcc -B$(builddir)/gcc/ -static-libgcc $(1)" bash debian/runcheck.sh)))
710
ifeq ($(biarch32),yes)
711
DEJAGNU_RUNS += $(call abi_run_check,-m32)
713
ifeq ($(biarch64),yes)
714
DEJAGNU_RUNS += $(call abi_run_check,$(if $(filter $(DEB_TARGET_ARCH_CPU),mips mipsel),-mabi=64,-m64))
716
ifeq ($(biarchn32),yes)
717
DEJAGNU_RUNS += $(call abi_run_check,-mabi=n32)
719
ifeq ($(biarchx32),yes)
720
DEJAGNU_RUNS += $(call abi_run_check,-mx32)
723
# gdc is not multilib'd
724
ifneq (,$(findstring gdc, $(PKGSOURCE)))
728
ifneq (,$(findstring gcj, $(PKGSOURCE)))
733
ifneq (,$(findstring gnat, $(PKGSOURCE)))
737
ifneq (,$(strip $(value DEJAGNU_RUNS)))
738
RUNTESTFLAGS = RUNTESTFLAGS="--target_board=unix\{,$(subst $(SPACE),$(COMMA),$(strip $(DEJAGNU_RUNS)))\}"
741
# PF is the installation prefix for the package without the leading slash.
742
# It's "usr" for gcc releases.
744
# use value set in the environment
745
else ifeq ($(trunk_build),yes)
746
PF = usr/lib/gcc-snapshot
747
else ifeq ($(PKGSOURCE),gcc-linaro)
748
PF = usr/lib/gcc-linaro
753
# PFL is the installation prefix with DEB_TARGET_GNU_TYPE attached for cross builds
754
ifeq ($(DEB_CROSS),yes)
755
ifneq ($(with_deps_on_target_arch_pkgs),yes)
756
PFL = $(PF)/$(DEB_TARGET_GNU_TYPE)
764
# RPF is the base prefix or installation prefix with DEB_TARGET_GNU_TYPE attached for cross builds
765
ifeq ($(DEB_CROSS),yes)
766
ifneq ($(with_deps_on_target_arch_pkgs),yes)
767
RPF = $(PF)/$(DEB_TARGET_GNU_TYPE)
775
ifeq ($(with_multiarch_lib),yes)
776
ifeq ($(DEB_CROSS),yes)
777
ifneq ($(with_deps_on_target_arch_pkgs),yes)
780
libdir = lib/$(DEB_TARGET_MULTIARCH)
783
libdir = lib/$(DEB_TARGET_MULTIARCH)
788
configured_libdir = lib
790
hppa64libexecdir= $(PF)/lib
792
# /usr/libexec doesn't follow the FHS
793
ifeq ($(single_package),yes)
795
libexecdir = $(PF)/libexec
796
versiondir = $(GCC_VERSION)
798
libexecdir = $(PF)/$(configured_libdir)
799
versiondir = $(BASE_VERSION)
801
buildlibdir = $(builddir)/$(TARGET_ALIAS)
803
# install cross compilers in /usr/lib/gcc-cross, native ones in /usr/lib/gcc
804
gcc_subdir_name = gcc
805
ifneq ($(single_package),yes)
806
ifeq ($(DEB_CROSS),yes)
807
ifneq ($(with_deps_on_target_arch_pkgs),yes)
808
gcc_subdir_name = gcc-cross
813
gcc_lib_dir = $(PF)/$(configured_libdir)/$(gcc_subdir_name)/$(TARGET_ALIAS)/$(versiondir)
814
gcc_lexec_dir = $(libexecdir)/$(gcc_subdir_name)/$(TARGET_ALIAS)/$(versiondir)
817
ifneq (,$(findstring mips,$(DEB_TARGET_GNU_TYPE)))
820
lib32 = $(PF)/$(lib32loc)
825
p_l= $(1)$(cross_lib_arch)
826
p_d= $(1)-dbg$(cross_lib_arch)
830
ifeq ($(DEB_CROSS),yes)
831
ifneq ($(with_deps_on_target_arch_pkgs),yes)
834
# sh4 has multilib. base is sh4-linux-gnu. See #663028.
835
ifneq (,$(findstring sh4-linux,$(DEB_TARGET_GNU_TYPE)))
836
usr_lib = $(PFL)/lib/sh4-linux-gnu/
839
usr_lib = $(PFL)/$(libdir)
842
usr_lib = $(PFL)/$(libdir)
844
usr_lib32 = $(PFL)/$(lib32loc)
845
usr_libn32 = $(PFL)/lib32
846
usr_libx32 = $(PFL)/libx32
847
usr_lib64 = $(PFL)/lib64
848
# FIXME: Move to the new location for native builds too
849
ifeq ($(DEB_CROSS),yes)
850
usr_libhf = $(PFL)/libhf
851
usr_libsf = $(PFL)/libsf
853
usr_libhf = $(PFL)/lib/arm-linux-gnueabihf
854
usr_libsf = $(PFL)/lib/arm-linux-gnueabi
857
gcc_lib_dir32 = $(gcc_lib_dir)/$(biarch32subdir)
858
gcc_lib_dirn32 = $(gcc_lib_dir)/$(biarchn32subdir)
859
gcc_lib_dirx32 = $(gcc_lib_dir)/$(biarchx32subdir)
860
gcc_lib_dir64 = $(gcc_lib_dir)/$(biarch64subdir)
861
gcc_lib_dirhf = $(gcc_lib_dir)/$(biarchhfsubdir)
862
gcc_lib_dirsf = $(gcc_lib_dir)/$(biarchsfsubdir)
864
libgcc_dir = $(RPF)/$(libdir)
865
# yes, really; lib32gcc_s ends up in usr
866
libgcc_dir32 = $(PFL)/$(lib32loc)
867
libgcc_dirn32 = $(RPF)/lib32
868
# libx32gcc_s also ends up in usr
869
libgcc_dirx32 = $(PFL)/libx32
870
libgcc_dir64 = $(RPF)/lib64
871
# FIXME: Move to the new location for native builds too
872
ifeq ($(DEB_CROSS),yes)
873
libgcc_dirhf = $(RPF)/libhf
874
libgcc_dirsf = $(RPF)/libsf
876
libgcc_dirhf = $(RPF)/lib/arm-linux-gnueabihf
877
libgcc_dirsf = $(RPF)/lib/arm-linux-gnueabi
880
# install_gcc_lib(lib,soname,flavour,package)
881
define install_gcc_lib
882
mv $(d)/$(usr_lib$(3))/$(1)*.a debian/$(4)/$(gcc_lib_dir$(3))/
883
rm -f $(d)/$(usr_lib$(3))/$(1)*.{la,so}
885
/$(usr_lib$(3))/$(1).so.$(2) /$(gcc_lib_dir$(3))/$(1).so
889
checkdirs = $(builddir)
890
ifeq ($(with_separate_libgcj),yes)
891
ifeq ($(PKGSOURCE),gcj-$(BASE_VERSION))
892
ifneq ($(with_standalone_gcj),yes)
893
checkdirs = $(buildlibdir)/libffi $(buildlibdir)/libjava
897
ifeq ($(with_separate_go),yes)
898
ifeq ($(PKGSOURCE),gccgo-$(BASE_VERSION))
899
checkdirs = $(buildlibdir)/libgo
902
ifeq ($(with_separate_gnat),yes)
903
ifeq ($(PKGSOURCE),gnat-$(BASE_VERSION))
904
checkdirs = $(builddir)/gcc
908
ifneq ($(DEB_CROSS),yes)
909
ifneq ($(single_package),yes)
910
cxx_inc_dir = $(PF)/include/c++/$(BASE_VERSION)
912
cxx_inc_dir = $(PF)/include/c++/$(GCC_VERSION)
915
ifeq ($(with_deps_on_target_arch_pkgs),yes)
916
cxx_inc_dir = $(PF)/include/c++/$(BASE_VERSION)
918
cxx_inc_dir = $(PF)/$(TARGET_ALIAS)/include/c++/$(GCC_VERSION)
922
# FIXME: MULTIARCH_DIRNAME needed for g++-multiarch-incdir.diff
923
MULTIARCH_DIRNAME := $(DEB_TARGET_MULTIARCH)
924
export MULTIARCH_DIRNAME
928
configure: $(configure_dependencies)
930
$(configure_dummy_stamp):
931
touch $(configure_dummy_stamp)
935
: # give information about the build process
936
@echo "------------------------ Build process variables ------------------------"
937
@echo "Number of parallel processes used for the build: $(USE_CPUS)"
938
@echo "Package source: $(PKGSOURCE)"
939
@echo "GCC version: $(GCC_VERSION)"
940
@echo "Base Debian version: $(BASE_VERSION)"
941
@echo -e "Configured with: $(subst ___, ,$(foreach i,$(CONFARGS),$(i)\n\t))"
942
ifeq ($(DEB_CROSS),yes)
943
@echo "Building cross compiler for $(DEB_TARGET_ARCH)"
945
@echo "Using shell $(SHELL)"
946
@echo "Architecture: $(DEB_TARGET_ARCH) (GNU: $(TARGET_ALIAS))"
947
@echo "CPPFLAGS: $(CPPFLAGS)"
948
@echo "CFLAGS: $(CFLAGS)"
949
@echo "LDFLAGS: $(LDFLAGS)"
950
@echo "BOOT_CFLAGS: $(BOOT_CFLAGS)"
951
@echo "DEBIAN_BUILDARCH: $(DEBIAN_BUILDARCH)"
952
@echo "Install prefix: /$(PF)"
953
ifeq ($(biarchn32)-$(biarch64),yes-yes)
954
@echo "Will build the triarch compilers (o32/n32/64, defaulting to o32)"
955
else ifeq ($(biarchn32)-$(biarch32),yes-yes)
956
@echo "Will build the triarch compilers (o32/n32/64, defaulting to 64)"
957
else ifeq ($(biarch64)-$(biarch32),yes-yes)
958
@echo "Will build the triarch compilers (x32/64/32, defaulting to x32)"
959
else ifeq ($(biarch64)-$(biarchx32),yes-yes)
960
@echo "Will build the triarch compilers (32/64/x32, defaulting to 32bit)"
961
else ifeq ($(biarch32)-$(biarchx32),yes-yes)
962
@echo "Will build the triarch compilers (64/32/x32, defaulting to 64bit)"
964
ifeq ($(biarch64),yes)
965
@echo "Will build the biarch compilers (32/64, defaulting to 32bit)"
967
ifeq ($(biarch32),yes)
968
@echo "Will build the biarch compilers (64/32, defaulting to 64bit)"
970
@echo "Will not build the biarch compilers"
975
ifeq ($(with_cxx),yes)
976
@echo "Will build the C++ compiler"
978
@echo "Will not build the C++ compiler: $(with_cxx)"
980
ifeq ($(with_objc),yes)
981
@echo "Will build the ObjC compiler."
982
ifeq ($(with_objc_gc),yes)
983
@echo "Will build the extra ObjC runtime for garbage collection."
985
@echo "Will not build the extra ObjC runtime for garbage collection."
988
@echo "Will not build the ObjC compiler: $(with_objc)"
990
ifeq ($(with_objcxx),yes)
991
@echo "Will build the Obj-C++ compiler"
993
@echo "Will not build the Obj-C++ compiler: $(with_objcxx)"
995
ifeq ($(with_fortran),yes)
996
@echo "Will build the Fortran 95 compiler."
998
@echo "Will not build the Fortran 95 compiler: $(with_fortran)"
1000
ifeq ($(with_java),yes)
1001
@echo "Will build the Java compiler."
1003
@echo "Will not build the Java compiler: $(with_java)"
1005
ifeq ($(with_ada),yes)
1006
@echo "Will build the Ada compiler."
1007
ifeq ($(with_libgnat),yes)
1008
@echo "Will build the shared Ada libraries."
1010
@echo "Will not build the shared Ada libraries."
1013
@echo "Will not build the Ada compiler: $(with_ada)"
1015
ifeq ($(with_go),yes)
1016
@echo "Will build the Go compiler."
1018
@echo "Will not build the Go compiler: $(with_go)"
1020
ifeq ($(with_d),yes)
1021
@echo "Will build the D compiler"
1022
ifeq ($(with_libphobos),yes)
1023
@echo "Will build the phobos D runtime library."
1025
@echo "Will not build the phobos D runtime library: $(with_libphobos)"
1028
@echo "Will not build the D compiler: $(with_d)"
1030
ifeq ($(with_ssp),yes)
1031
@echo "Will build with SSP support."
1033
@echo "Will build without SSP support: $(with_ssp)"
1035
ifeq ($(with_check),yes)
1036
@echo "Will run the testsuite."
1038
@echo "Will not run the testsuite: $(with_check)"
1040
ifeq ($(with_nls),yes)
1041
@echo "Will enable national language support."
1043
@echo "Will disable national language support: $(with_nls)"
1045
@echo "-----------------------------------------------------------------------------"
1047
ifeq ($(with_check),yes)
1048
@if echo "spawn true" | /usr/bin/expect -f - >/dev/null; then \
1051
echo "expect is failing on your system with the above error, which means the GCC"; \
1052
echo "testsuite will fail. Please resolve the above issues and retry the build."; \
1053
echo "-----------------------------------------------------------------------------"; \
1057
rm -f $(configure_stamp) $(build_stamp)
1058
cat debian/README.Debian $(patch_stamp) > debian/README.Debian.$(DEB_TARGET_ARCH)
1068
LD_LIBRARY_PATH=$${LD_LIBRARY_PATH:+$$LD_LIBRARY_PATH:}$(builddir)/gcc/ada/rts \
1069
../src/configure $(subst ___, ,$(CONFARGS))
1071
: # multilib builds without b-d on gcc-multilib (used in FLAGS_FOR_TARGET)
1072
if [ -d /usr/include/$(DEB_TARGET_MULTIARCH)/asm ]; then \
1073
mkdir -p $(builddir)/sys-include; \
1074
ln -sf /usr/include/$(DEB_TARGET_MULTIARCH)/asm $(builddir)/sys-include/asm; \
1077
touch $(configure_stamp)
1079
build: $(build_dependencies)
1081
$(build_dummy_stamp):
1082
touch $(build_dummy_stamp)
1084
$(build_locale_stamp):
1085
ifeq ($(locale_data)-$(with_cxx),generate-yes)
1086
: # build locales needed by libstdc++ testsuite
1089
- sh debian/locale-gen
1091
touch $(build_locale_stamp)
1094
$(build_stamp): $(configure_stamp) $(build_locale_stamp)
1096
rm -f bootstrap-protocol
1097
# DEB_CROSS is never set if REVERSE_CROSS is set and vice-versa.
1099
ifeq ($(DEB_CROSS),yes)
1100
: # build cross compiler for $(TARGET_ALIAS)
1105
$(MAKE) -C $(builddir) $(NJOBS) \
1108
$(LDFLAGS_TO_PASS) \
1110
echo $$? > status; \
1111
) 2>&1 | tee bootstrap-protocol
1112
s=`cat status`; rm -f status; test $$s -eq 0
1114
# REVERSE_CROSS build
1115
ifeq ($(REVERSE_CROSS),yes)
1116
: # build cross compiler for $(TARGET_ALIAS)
1121
$(MAKE) -C $(builddir) $(NJOBS) \
1124
$(LDFLAGS_TO_PASS) \
1126
echo $$? > status; \
1127
) 2>&1 | tee bootstrap-protocol
1128
s=`cat status`; rm -f status; test $$s -eq 0
1131
ifeq ($(with_java),yes)
1133
ln -sf /usr/bin/fastjar bin/jar
1134
ifeq ($(with_native_ecj),yes)
1135
: # prepare the standalone ecj jar
1136
cp /usr/share/java/ecj.jar $(srcdir)/ecj-standalone.jar
1137
zip -d $(srcdir)/ecj-standalone.jar 'org/eclipse/jdt/core/JDTCompilerAdapter*'
1139
ifeq ($(with_java_maintainer_mode),yes)
1142
echo 'exec gij-4.8 -cp /usr/share/java/ecj.jar org.eclipse.jdt.internal.compiler.batch.GCCMain "$$@"'; \
1145
: # If we don't have gjavah in PATH, try to build it with the old gij
1147
if [ -x /usr/bin/gjavah-4.8 ]; then \
1148
ln -sf /usr/bin/gjavah-4.8 bin/gjavah; \
1149
elif [ -x bin/gjavah ]; then \
1152
mkdir -p $(builddir)/java_hacks; \
1153
cd $(builddir)/java_hacks; \
1154
cp -a $(srcdir)/libjava/classpath/tools/external external; \
1155
mkdir -p gnu/classpath/tools; \
1156
cp -a $(srcdir)/libjava/classpath/tools/gnu/classpath/tools/{common,javah,getopt} \
1157
gnu/classpath/tools/; \
1158
cp -a $(srcdir)/libjava/classpath/tools/resource/gnu/classpath/tools/common/Messages.properties \
1159
gnu/classpath/tools/common; \
1161
for i in `find . -name \*.java`; do gcj-4.8 --encoding ISO-8859-1 -C $$i -I.; done; \
1163
for i in `find gnu -name \*.java`; do gcj-4.8 -C $$i -I. -Iexternal/asm/; done; \
1164
gcj-4.8 -findirect-dispatch -O2 -fmain=gnu.classpath.tools.javah.Main \
1165
-I. -Iexternal/asm/ `find . -name \*.class` -o $(PWD)/bin/gjavah.real; \
1168
echo 'export CLASSPATH='`pwd`'$${CLASSPATH:+:$$CLASSPATH}'; \
1169
echo 'exec $(PWD)/bin/gjavah.real "$$@"'; \
1170
) > $(PWD)/bin/gjavah; \
1171
chmod +x $(PWD)/bin/gjavah; \
1175
: # build native compiler
1181
$(MAKE) -C $(builddir) $(NJOBS) $(bootstrap_target) \
1184
$(STAGE1_CFLAGS_TO_PASS) \
1185
$(LDFLAGS_TO_PASS) \
1187
echo $$? > status; \
1188
) 2>&1 | tee bootstrap-protocol
1189
s=`cat status`; rm -f status; test $$s -eq 0
1192
-chmod 755 $(srcdir)/contrib/warn_summary
1193
if [ -x $(srcdir)/contrib/warn_summary ]; then \
1194
rm -f bootstrap-summary; \
1195
$(srcdir)/contrib/warn_summary bootstrap-protocol \
1196
> bootstrap-summary; \
1199
touch $(build_stamp)
1201
ifeq ($(versioned_packages),yes)
1202
hppa64_configure_flags += --program-suffix=-$(BASE_VERSION)
1205
ifeq ($(DEB_CROSS),yes)
1206
CC_for_hppa64_cross = $(CC)
1208
CC_for_hppa64_cross = $(builddir)/gcc/xgcc -B$(builddir)/gcc/
1211
$(configure_hppa64_stamp): $(build_stamp)
1213
rm -f $(configure_hppa64_stamp) $(build_hppa64_stamp)
1214
rm -rf $(builddir_hppa64)
1215
mkdir $(builddir_hppa64)
1217
cd $(builddir_hppa64) && \
1220
CC="$(CC_for_hppa64_cross)" \
1222
--enable-languages=c \
1224
--libexecdir=/$(hppa64libexecdir) \
1228
--disable-libatomic \
1231
--disable-libmudflap \
1233
--disable-libquadmath \
1235
--with-system-zlib \
1236
--with-as=/usr/bin/hppa64-linux-gnu-as \
1237
--with-ld=/usr/bin/hppa64-linux-gnu-ld \
1238
--includedir=/usr/hppa64-linux-gnu/include \
1239
--build=$(DEB_BUILD_GNU_TYPE) \
1240
--host=$(DEB_HOST_GNU_TYPE) \
1241
--target=hppa64-linux-gnu
1242
touch $(configure_hppa64_stamp)
1244
$(build_hppa64_stamp): $(configure_hppa64_stamp)
1248
LD_LIBRARY_PATH=$${LD_LIBRARY_PATH:+$$LD_LIBRARY_PATH:}$(builddir)/gcc \
1249
$(MAKE) -C $(builddir_hppa64) $(NJOBS) \
1250
CC="$(CC_for_hppa64_cross)" \
1253
touch $(build_hppa64_stamp)
1255
$(configure_neon_stamp): $(build_stamp)
1257
rm -f $(configure_neon_stamp) $(build_neon_stamp)
1258
rm -rf $(builddir_neon)
1259
mkdir $(builddir_neon)
1261
cd $(builddir_neon) && \
1264
CC="$(builddir)/gcc/xgcc -B$(builddir)/gcc/" \
1266
--disable-bootstrap \
1267
--enable-languages=c,c++,objc,fortran \
1269
--libexecdir=/$(libexecdir) \
1270
--program-suffix=-$(BASE_VERSION) \
1273
--disable-libmudflap \
1274
--with-arch=armv7-a --with-tune=cortex-a8 \
1275
--with-float=$(float_abi) --with-fpu=neon \
1276
--host=arm-linux-gnueabi \
1277
--build=arm-linux-gnueabi \
1278
--target=arm-linux-gnueabi
1279
touch $(configure_neon_stamp)
1281
$(build_neon_stamp): $(configure_neon_stamp)
1285
$(MAKE) -C $(builddir_neon) $(NJOBS) \
1286
CC="$(builddir)/gcc/xgcc -B$(builddir)/gcc/" \
1289
touch $(build_neon_stamp)
1293
$(srcdir)/gcc/doc/cpp.texi \
1294
$(srcdir)/gcc/doc/cppinternals.texi \
1295
$(srcdir)/gcc/doc/gcc.texi \
1296
$(srcdir)/gcc/doc/gccint.texi
1297
ifeq ($(with_fortran),yes)
1298
MANUALS += $(srcdir)/gcc/fortran/gfortran.texi
1300
ifeq ($(with_java),yes)
1301
MANUALS += $(srcdir)/gcc/java/gcj.texi
1303
ifeq ($(with_ada),yes)
1305
$(builddir)/gcc/doc/gnat_ugn.texi \
1306
$(srcdir)/gcc/ada/gnat_rm.texi \
1307
$(srcdir)/gcc/ada/gnat-style.texi
1309
ifeq ($(with_gomp),yes)
1310
MANUALS += $(srcdir)/libgomp/libgomp.texi
1312
ifeq ($(with_itm),yes)
1313
MANUALS += $(srcdir)/libitm/libitm.texi
1315
ifeq ($(with_qmath),yes)
1316
MANUALS += $(srcdir)/libquadmath/libquadmath.texi
1318
ifeq ($(with_go),yes)
1319
MANUALS += $(srcdir)/gcc/go/gccgo.texi
1322
html-docs: $(build_html_stamp)
1323
#$(build_html_stamp): html-texi2html
1324
#$(build_html_stamp): html-makeinfo
1325
$(build_html_stamp): html-makeinfo-nosplit
1328
rm -rf html $(builddir)/gcc/html
1329
mkdir $(builddir)/gcc/html
1330
ln -s $(builddir)/gcc/html html
1331
cd $(builddir)/gcc; \
1332
for manual in $(MANUALS); do \
1333
outname=`basename $${manual} .texi`; \
1334
echo "generating $$outname ..."; \
1335
texi2html -number -split chapter \
1336
-I $(srcdir)/gcc/doc/include \
1337
-I $(srcdir)/gcc/p/doc \
1338
-I $(srcdir)/gcc/p/doc/generated \
1339
-I `dirname $${manual}` \
1340
-I $(builddir)/gcc \
1341
-I $(buildlibdir)/libquadmath \
1349
cd $(builddir)/gcc; \
1350
for manual in $(MANUALS); do \
1351
manual=`find $(srcdir) -name $${file}.texi`; \
1352
outname=`basename $${manual} .texi`; \
1353
echo "generating $$outname ..."; \
1354
if [ "$${manual}" ]; then \
1355
makeinfo --html --number-sections \
1356
-I $(srcdir)/gcc/doc/include -I `dirname $${manual}` \
1357
-I $(srcdir)/gcc/p/doc \
1358
-I $(srcdir)/gcc/p/doc/generated \
1359
-I $(builddir)/gcc \
1360
-I $(buildlibdir)/libquadmath \
1366
html-makeinfo-nosplit:
1369
cd $(builddir)/gcc; \
1370
for manual in $(MANUALS); do \
1371
outname=`basename $${manual} .texi`.html; \
1372
echo "generating $$outname ..."; \
1373
makeinfo --html --number-sections --no-split \
1374
-I $(srcdir)/gcc/doc/include -I `dirname $${manual}` \
1375
-I $(srcdir)/gcc/p/doc \
1376
-I $(srcdir)/gcc/p/doc/generated \
1377
-I $(builddir)/gcc \
1378
-I $(buildlibdir)/libquadmath \
1379
-o $(PWD)/html/$${outname} \
1383
# start the script only on architectures known to have slow autobuilders ...
1384
logwatch_archs := alpha arm m68k mips mipsel sparc
1385
ifeq ($(DEB_HOST_GNU_CPU), $(findstring $(DEB_HOST_GNU_CPU),$(logwatch_archs)))
1386
start_logwatch = yes
1388
ifeq ($(DEB_HOST_GNU_SYSTEM),gnu)
1389
start_logwatch = yes
1392
stamps/mauve-build: stamps/build
1395
ifeq ($(with_mauve_check),yes)
1396
tar xf $(wildcard /usr/src/mauve*.tar.*)
1401
&& PATH=$(CURDIR)/$(sdkimg)/bin:$$PATH ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE)
1402
PATH=$(CURDIR)/$(sdkimg)/bin:$$PATH $(MAKE) -C mauve
1406
stamps/mauve-check: stamps/build stamps/mauve-build
1407
ifeq ($(with_mauve_check),yes)
1409
JAVA_HOME=$(CURDIR)/$(sdkimg) \
1410
PATH=$(CURDIR)/$(sdkimg)/bin:$$PATH \
1411
xvfb-run -s "-extension GLX" java Harness \
1412
-vm $(CURDIR)/$(sdkimg)/bin/java \
1413
-file $(CURDIR)/debian/mauve_tests \
1414
-timeout 30000 2>&1 \
1418
echo "mauve testsuite not run for this build" > mauve/mauve_output
1422
check: $(check_stamp) # $(if $(filter yes, $(with_java)),stamps/05-build-mauve-stamp) #$(check_inst_stamp)
1423
$(check_stamp): $(build_stamp) $(build_locale_stamp)
1425
rm -f $(builddir)/runcheck*
1427
-chmod 755 $(srcdir)/contrib/test_summary
1429
: # needed for the plugin tests to succeed
1430
ln -sf gcc $(builddir)/prev-gcc
1431
ln -sf $(DEB_TARGET_GNU_TYPE) $(builddir)/prev-$(DEB_TARGET_GNU_TYPE)
1433
ifneq ($(with_common_libs),yes)
1434
ifeq ($(with_cxx),yes)
1435
: # libstdc++6 built from newer gcc-4.x source, run testsuite against the installed lib
1437
sed 's/-L[^ ]*//g' $(buildlibdir)/libstdc++-v3/scripts/testsuite_flags \
1438
> $(buildlibdir)/libstdc++-v3/scripts/testsuite_flags.installed
1441
for d in $(buildlibdir)/libstdc++-v3/testsuite; do \
1442
echo "Running testsuite in $$d ..."; \
1447
DEJAGNU_TIMEOUT=$(DEJAGNU_TIMEOUT) \
1449
$(MAKE) -k -C $$d $(NJOBS) check $(RUNTESTFLAGS); \
1450
done 2>&1 | tee test-protocol2
1452
BOOT_CFLAGS="$(BOOT_CFLAGS)" \
1453
$(srcdir)/contrib/test_summary -m "$(S_EMAIL)" > raw-test-summary
1455
sed -n '/^Mail/s/.*"\([^"][^"]*\)".*/\1/p' raw-test-summary; \
1456
awk '/^cat/, /^EOF/' raw-test-summary | grep -v EOF; \
1457
) > libstdc++-test-summary
1458
echo 'BEGIN installed libstdc++-v3 test-summary'
1459
cat libstdc++-test-summary
1460
echo 'END installed libstdc++-v3 test-summary'
1461
find $(buildlibdir)/libstdc++-v3/testsuite -name '*.log' -o -name '*.sum' \
1466
ifeq ($(start_logwatch),yes)
1467
: # start logwatch script for regular output during test runs
1468
chmod +x debian/logwatch.sh
1469
-debian/logwatch.sh -t 900 -p $(builddir)/logwatch.pid \
1470
-m '\ntestsuite still running ...\n' \
1472
$(builddir)/gcc/testsuite/gcc/gcc.log \
1473
$(builddir)/gcc/testsuite/g++/g++.log \
1474
$(builddir)/gcc/testsuite/gfortran/gfortran.log \
1475
$(builddir)/gcc/testsuite/objc/objc.log \
1476
$(builddir)/gcc/testsuite/obj-c++/obj-c++.log \
1477
$(builddir)/gcc/testsuite/gnat/gnat.log \
1478
$(builddir)/gcc/testsuite/ada/acats/acats.log \
1479
$(builddir)/gcc/testsuite/gfortran/gfortran.log \
1480
$(builddir)/gcc/p/test/test_log \
1481
$(buildlibdir)/libstdc++-v3/testsuite/libstdc++.log \
1482
$(buildlibdir)/libjava/testsuite/libjava.log \
1483
$(buildlibdir)/libmudflap/testsuite/libmudflap.log \
1484
$(buildlibdir)/libgomp/testsuite/libgomp.log \
1485
$(buildlibdir)/libffi/testsuite/libffi.log \
1489
ifeq ($(with_ada),yes)
1490
chmod +x debian/acats-killer.sh
1491
-debian/acats-killer.sh -p $(builddir)/acats-killer.pid \
1492
$(builddir)/gcc/testsuite/ada/acats/acats.log \
1493
$(builddir)/gcc/testsuite/g++.log \
1499
for d in $(checkdirs); do \
1500
echo "Running testsuite in $$d ..."; \
1504
EXTRA_TEST_PFLAGS=-g0 \
1505
DEJAGNU_TIMEOUT=$(DEJAGNU_TIMEOUT) \
1507
$(MAKE) -k -C $$d $(NJOBS) check $(RUNTESTFLAGS); \
1508
done 2>&1 | tee test-protocol
1510
-ps aux | fgrep logwatch | fgrep -v fgrep
1511
-if [ -f $(builddir)/logwatch.pid ]; then \
1512
kill -1 `cat $(builddir)/logwatch.pid`; \
1514
kill -9 `cat $(builddir)/logwatch.pid`; \
1515
rm -f $(builddir)/logwatch.pid; \
1517
-ps aux | fgrep logwatch | fgrep -v fgrep
1519
ifeq ($(with_ada),yes)
1520
-if [ -f $(builddir)/acats-killer.pid ]; then \
1521
kill -1 `cat $(builddir)/acats-killer.pid`; \
1523
kill -9 `cat $(builddir)/acats-killer.pid`; \
1524
rm -f $(builddir)/acats-killer.pid; \
1528
: # running the libjava testsuite alone is missing this information
1529
$(builddir)/gcc/xgcc -B$(builddir)/gcc/ -v > $(builddir)/compiler_version.sum 2>&1
1531
if [ -x $(srcdir)/contrib/test_summary ]; then \
1532
rm -f test-summary; \
1535
echo '' > ts-include; \
1536
echo '' >> ts-include; \
1537
if [ -f $(builddir)/gcc/.bad_compare ]; then \
1538
echo 'Bootstrap comparison failure:' >> ts-include; \
1539
cat $(builddir)/gcc/.bad_compare >> ts-include; \
1540
echo '' >> ts-include; \
1541
echo '' >> ts-include; \
1543
echo "Build Dependencies:" >> ts-include; \
1544
dpkg -l g++-* binutils* `echo '$(LIBC_DEP)' | awk '{print $$1}'` \
1545
libgmp*-dev libmpfr-dev libmpc-dev libisl-dev libcloog-isl-dev \
1546
| fgrep -v '<none>' >> ts-include; \
1547
echo '' >> ts-include; \
1548
cat ../$(patch_stamp) >> ts-include; \
1549
BOOT_CFLAGS="$(BOOT_CFLAGS)" \
1550
$(srcdir)/contrib/test_summary \
1551
-i ts-include -m "$(S_EMAIL)" \
1552
) > raw-test-summary; \
1553
if [ -n "$(testsuite_tarball)" ]; then \
1554
echo "Test suite used: $(testsuite_srcdir)" > test-summary; \
1555
echo " Do not interpret the results on its own" >> test-summary; \
1556
echo " but compare them with the results from" >> test-summary; \
1557
echo " the gcc-snapshot package." >> test-summary; \
1559
sed -n '/^Mail/s/.*"\([^"][^"]*\)".*/\1/p' raw-test-summary \
1561
awk '/^cat/, /^EOF/' raw-test-summary | grep -v EOF >> test-summary; \
1562
if [ -f bootstrap-summary -a "$(bootstrap_target)" != profiledbootstrap ]; then \
1563
echo '' >> test-summary; \
1564
cat bootstrap-summary >> test-summary; \
1566
echo 'BEGIN test-summary'; \
1568
echo 'END test-summary'; \
1570
ifeq ($(with_d),yes)
1571
: # the D test failures for the non-default multilibs are known, ignore them
1572
egrep -v '^(FAIL|UNRESOLVED): (runnable|fail_c|comp)' test-summary > test-summary.tmp
1573
mv -f test-summary.tmp test-summary
1576
touch $(check_stamp)
1578
$(check_inst_stamp): $(check_stamp)
1579
rm -f test-inst-protocol
1581
ifeq ($(start_logwatch),yes)
1582
: # start logwatch script for regular output during test runs
1583
chmod +x debian/logwatch.sh
1584
-debian/logwatch.sh -t 900 -p $(builddir)/logwatch-inst.pid \
1585
-m '\ntestsuite (3.3) still running ...\n' \
1586
test-inst-protocol \
1587
check-inst/{gcc,g++,g77,objc}.log \
1594
echo "Running testsuite ..."
1598
EXTRA_TEST_PFLAGS=-g0 \
1599
DEJAGNU_TIMEOUT=$(DEJAGNU_TIMEOUT) \
1600
cd check-inst && $(srcdir)/contrib/test_installed \
1601
--with-gcc=gcc-3.3 --with-g++=g++-3.3 --with-g77=g77-3.3 \
1602
2>&1 | tee test-inst-protocol
1604
-ps aux | fgrep logwatch | fgrep -v fgrep
1605
if [ -f $(builddir)/logwatch-inst.pid ]; then \
1606
kill -1 `cat $(builddir)/logwatch-inst.pid`; \
1610
-ps aux | fgrep logwatch | fgrep -v fgrep
1612
-chmod 755 $(srcdir)/contrib/test_summary
1613
if [ -x $(srcdir)/contrib/test_summary ]; then \
1614
rm -f test-inst-summary; \
1617
echo '' > ts-include; \
1618
echo '' >> ts-include; \
1619
echo "Build Dependencies:" >> ts-include; \
1620
dpkg -l g++-* binutils* `echo '$(LIBC_DEP)' | awk '{print $$1}'` \
1621
libgmp*-dev libmpfr-dev libmpc-dev libisl*-dev libcloog-isl-dev \
1622
| fgrep -v '<none>' >> ts-include; \
1623
echo '' >> ts-include; \
1624
echo 'Results for the installed GCC-3.3 compilers' >> ts-include; \
1625
$(srcdir)/contrib/test_summary \
1626
-i ts-include -m "$(S_EMAIL)" \
1627
) > raw-test-inst-summary; \
1628
sed -n '/^Mail/s/.*"\([^"][^"]*\)".*/\1/p' raw-test-inst-summary \
1629
>> test-inst-summary; \
1630
awk '/^cat/, /^EOF/' raw-test-inst-summary \
1631
| grep -v EOF >> test-inst-summary; \
1632
echo 'BEGIN test-installed-summary'; \
1633
cat test-inst-summary; \
1634
echo 'END test-installed-summary'; \
1637
chmod 755 debian/reduce-test-diff.awk
1638
if diff -u test-inst-summary test-summary \
1639
| debian/reduce-test-diff.awk > diff-summary; \
1641
mv -f diff-summary testsuite-comparision; \
1644
echo "WARNING: New failures in gcc-3.4 compared to gcc-3.3"; \
1647
) > testsuite-comparision; \
1648
rm -f diff-summary; \
1650
touch $(check_inst_stamp)
1652
clean: debian/control
1655
rm -f *-summary *-protocol testsuite-comparision summary-diff
1656
if [ -f $(srcdir)/gcc/p/config-lang.in.debian ]; then \
1657
mv -f $(srcdir)/gcc/p/config-lang.in.debian $(srcdir)/gcc/p/config-lang.in; \
1659
rm -f $(srcdir)/gcc/po/*.gmo
1660
rm -f debian/lib{gcc,gcj,objc,stdc++}{-v3,[0-9]}*.{{pre,post}{inst,rm},shlibs}
1661
fs=`echo debian/*BV* debian/*GCJ* debian/*CXX* debian/*LC* debian/*MF* | sort -u`; \
1663
[ -f $$f ] || continue; \
1665
| sed 's/BV/$(BASE_VERSION)/;s/CXX/$(CXX_SONAME)/;s/LGCJ/$(PKG_LIBGCJ_EXT)/;s/GCJ/$(PKG_GCJ_EXT)/;s/LC/$(GCC_SONAME)/;s/-CRB/$(cross_bin_arch)/;s/\.in$$//'); \
1668
find debian -maxdepth 1 -name '*.symbols' -type l | xargs -r rm -f
1669
rm -f debian/gcc-{XX,ar,nm,ranlib}-$(BASE_VERSION).1
1670
rm -f debian/shlibs.local debian/substvars.local
1671
rm -f debian/*.debhelper
1672
-[ -d debian/bugs ] && $(MAKE) -C debian/bugs clean
1673
rm -f debian/README.libstdc++-baseline debian/README.Bugs debian/README.Debian.$(DEB_TARGET_ARCH)
1674
rm -f debian/lib*gcj-bc.shlibs
1675
rm -rf bin locales share
1679
$(cross_clean) dh_clean
1681
# -----------------------------------------------------------------------------
1682
# some abbrevations for the package names and directories;
1683
# p_XXX is the package name, d_XXX is the package directory
1684
# these macros are only used in the binary-* targets.
1686
ifeq ($(versioned_packages),yes)
1687
pkg_ver := -$(BASE_VERSION)
1690
ifneq ($(DEB_CROSS),yes)
1691
p_base = gcc$(pkg_ver)-base
1692
p_xbase = gcc$(pkg_ver)-base
1693
p_gcc = gcc$(pkg_ver)
1694
p_cpp = cpp$(pkg_ver)
1695
p_cppd = cpp$(pkg_ver)-doc
1696
p_cxx = g++$(pkg_ver)
1697
p_doc = gcc$(pkg_ver)-doc
1698
p_lgcc = libgcc$(GCC_SONAME)
1700
# only triggered if DEB_CROSS set
1701
ifneq ($(with_deps_on_target_arch_pkgs),yes)
1702
p_base = gcc$(pkg_ver)$(cross_bin_arch)-base
1703
p_xbase = gcc$(pkg_ver)$(cross_bin_arch)-base
1705
p_base = gcc$(pkg_ver)-base
1708
p_cpp = cpp$(pkg_ver)$(cross_bin_arch)
1709
p_gcc = gcc$(pkg_ver)$(cross_bin_arch)
1710
p_cxx = g++$(pkg_ver)$(cross_bin_arch)
1712
p_hppa64 = gcc$(pkg_ver)-hppa64
1715
d_base = debian/$(p_base)
1716
d_xbase = debian/$(p_xbase)
1717
d_gcc = debian/$(p_gcc)
1718
d_cpp = debian/$(p_cpp)
1719
d_cppd = debian/$(p_cppd)
1720
d_cxx = debian/$(p_cxx)
1721
d_doc = debian/$(p_doc)
1722
d_lgcc = debian/$(p_lgcc)
1723
d_hppa64= debian/$(p_hppa64)
1725
d_neon = debian/tmp-neon
1727
common_substvars = \
1728
$(shell awk "{printf \"'-V%s' \", \$$0}" debian/substvars.local)
1730
ifeq ($(DEB_CROSS),yes)
1731
lib_binaries := indep_binaries
1733
lib_binaries := arch_binaries
1736
# ---------------------------------------------------------------------------
1738
ifeq ($(single_package),yes)
1739
include debian/rules.d/binary-snapshot.mk
1742
ifneq ($(DEB_CROSS),yes)
1743
ifeq ($(with_source),yes)
1744
include debian/rules.d/binary-source.mk
1748
ifneq ($(BACKPORT),true)
1749
ifeq ($(with_gccxbase),yes)
1750
include debian/rules.d/binary-base.mk
1753
ifeq ($(with_gccbase),yes)
1754
include debian/rules.d/binary-base.mk
1757
# always include to get some definitions
1758
include debian/rules.d/binary-libgcc.mk
1760
ifeq ($(with_libqmath),yes)
1761
include debian/rules.d/binary-libquadmath.mk
1764
ifeq ($(with_libgmath),yes)
1765
include debian/rules.d/binary-libgccmath.mk
1768
ifeq ($(with_libgomp),yes)
1769
include debian/rules.d/binary-libgomp.mk
1772
ifeq ($(with_libitm),yes)
1773
include debian/rules.d/binary-libitm.mk
1776
ifeq ($(with_libatomic),yes)
1777
include debian/rules.d/binary-libatomic.mk
1780
ifeq ($(with_libbacktrace),yes)
1781
include debian/rules.d/binary-libbacktrace.mk
1784
ifeq ($(with_cdev),yes)
1785
include debian/rules.d/binary-cpp.mk
1788
ifeq ($(with_fixincl),yes)
1789
include debian/rules.d/binary-fixincl.mk
1792
ifeq ($(with_libssp),yes)
1793
include debian/rules.d/binary-libssp.mk
1796
ifeq ($(with_objcxx),yes)
1797
include debian/rules.d/binary-objcxx.mk
1800
ifeq ($(with_objc),yes)
1801
include debian/rules.d/binary-objc.mk
1802
include debian/rules.d/binary-libobjc.mk
1805
ifeq ($(with_go),yes)
1806
include debian/rules.d/binary-go.mk
1809
# include before cxx
1810
ifeq ($(with_java),yes)
1811
include debian/rules.d/binary-java.mk
1814
ifeq ($(with_cxxdev),yes)
1815
include debian/rules.d/binary-cxx.mk
1817
ifeq ($(with_cxx),yes)
1818
include debian/rules.d/binary-libstdcxx.mk
1821
ifeq ($(with_libasan),yes)
1822
include debian/rules.d/binary-libasan.mk
1825
ifeq ($(with_libtsan),yes)
1826
include debian/rules.d/binary-libtsan.mk
1829
ifeq ($(with_f77),yes)
1830
include debian/rules.d/binary-f77.mk
1833
ifeq ($(with_fortran),yes)
1834
include debian/rules.d/binary-fortran.mk
1837
ifeq ($(with_ada),yes)
1838
include debian/rules.d/binary-ada.mk
1841
ifeq ($(with_d),yes)
1842
include debian/rules.d/binary-d.mk
1845
ifeq ($(with_libnof),yes)
1846
ifeq ($(DEB_TARGET_GNU_CPU),powerpc)
1847
include debian/rules.d/binary-nof.mk
1851
ifeq ($(with_softfloat),yes)
1852
include debian/rules.d/binary-softfloat.mk
1855
# gcc must be moved/built after g77 and g++
1856
ifeq ($(with_cdev),yes)
1857
include debian/rules.d/binary-gcc.mk
1860
ifeq ($(with_hppa64),yes)
1861
include debian/rules.d/binary-hppa64.mk
1864
ifeq ($(with_neon),yes)
1865
include debian/rules.d/binary-neon.mk
1870
endif # ($(single_package),yes)
1872
# ----------------------------------------------------------------------
1873
install: $(install_dependencies)
1875
$(install_dummy_stamp): $(build_dummy_stamp)
1876
touch $(install_dummy_stamp)
1878
$(install_snap_stamp): $(build_dependencies)
1883
: # Install directories
1887
ifeq ($(with_hppa64),yes)
1890
$(MAKE) -C $(builddir_hppa64) \
1893
$(LDFLAGS_TO_PASS) \
1894
DESTDIR=$(PWD)/$(d) \
1897
ls -l $(d)/$(PF)/bin
1898
if [ ! -x $(d)/$(PF)/bin/hppa64-linux-gnu-gcc ]; then \
1899
mv $(d)/$(PF)/bin/hppa64-linux-gnu-gcc-4* $(d)/$(PF)/bin/hppa64-linux-gnu-gcc; \
1901
rm -f $(d)/$(PF)/bin/hppa64-linux-gnu-gcc-4*; \
1904
for i in ar nm ranlib; do \
1905
cp debian/gcc-$$i$(pkg_ver).1 $(d)/$(PF)/share/man/man1/$(cmd_prefix)gcc-$$i$(pkg_ver).1; \
1908
: # remove files not needed from the hppa64 build
1909
rm -rf $(d)/$(PF)/share/info
1910
rm -rf $(d)/$(PF)/share/man
1911
rm -f $(d)/$(PF)/$(libdir)/libiberty.a
1912
rm -f $(d)/$(PF)/bin/*{gcov,gccbug,gcc}
1914
rm -rf $(d)/$(PF)/hppa64-linux-gnu/include
1915
rm -rf $(d)/$(PF)/hppa64-linux-gnu/lib
1917
cd $(d)/$(PF)/$(libdir)/gcc/hppa64-linux-gnu/$(versiondir)/include-fixed; \
1920
README|features.h|syslimits.h|limits.h) ;; \
1921
linux|$(TARGET_ALIAS)) ;; \
1922
$(subst $(DEB_TARGET_GNU_CPU),$(biarch_cpu),$(TARGET_ALIAS))) ;; \
1923
*) echo "remove include-fixed/$$i"; rm -rf $$i; \
1928
: # Work around PR lto/41569
1929
ln -sf gcc $(builddir)/prev-gcc
1930
ln -sf $(DEB_TARGET_GNU_TYPE) $(builddir)/prev-$(DEB_TARGET_GNU_TYPE)
1932
: # Install everything
1935
$(MAKE) -C $(builddir) \
1937
$(LDFLAGS_TO_PASS) \
1938
DESTDIR=$(PWD)/$(d) \
1939
infodir=/$(PF)/share/info \
1940
mandir=/$(PF)/share/man \
1943
ls -l $(d)/$(PF)/bin
1944
if [ ! -x $(d)/$(PF)/bin/$(TARGET_ALIAS)-gcc ]; then \
1945
mv $(d)/$(PF)/bin/$(TARGET_ALIAS)-gcc-4* $(d)/$(PF)/bin/$(TARGET_ALIAS)-gcc; \
1947
rm -f $(d)/$(PF)/bin/$(TARGET_ALIAS)-gcc-4*; \
1950
cd $(d)/$(gcc_lib_dir)/include-fixed; \
1953
README|features.h|syslimits.h|limits.h) ;; \
1954
linux|$(TARGET_ALIAS)) ;; \
1955
$(subst $(DEB_TARGET_GNU_CPU),$(biarch_cpu),$(TARGET_ALIAS))) ;; \
1956
*) echo "remove include-fixed/$$i"; rm -rf $$i; \
1960
ifneq ($(configured_libdir),$(libdir))
1961
for i in debug go pkgconfig '*.so' '*.so.*' '*.a' '*.la' '*.py' '*.spec'; do \
1962
mv $(d)/$(PF)/$(configured_libdir)/$$i \
1963
$(d)/$(PF)/$(libdir)/. || true; \
1964
mv $(d)/$(PF)/libo32/$$i \
1965
$(d)/$(PF)/lib/. || true; \
1969
# FIXME: libjava/classpath not correctly patched
1970
ifeq ($(with_java),yes)
1971
-if [ -d $(d)/$(PF)/lib/gcj-$(GCC_VERSION)-$(GCJ_SONAME) ]; then \
1972
ls -l $(d)/$(PF)/lib/gcj-$(GCC_VERSION)-$(GCJ_SONAME); \
1973
mv $(d)/$(PF)/lib/gcj-$(GCC_VERSION)-$(GCJ_SONAME)/* \
1974
$(d)/$(PF)/lib/gcj-$(BASE_VERSION)-$(GCJ_SONAME)/; \
1975
rmdir $(d)/$(PF)/lib/gcj-$(GCC_VERSION)-$(GCJ_SONAME); \
1978
ln -sf libgcj.so.$(GCJ_SONAME).0.0 $(d)/$(PF)/lib/libgcj_bc.so.1.0.0
1980
install -m 755 $(d)/$(PF)/lib/libgcj_bc.so.1 \
1981
$(d)/$(gcc_lib_dir)/libgcj_bc.so
1982
$(builddir)/gcc/xgcc -B$(builddir)/gcc/ -shared -fpic -xc /dev/null \
1983
-o build/libgcj.so -Wl,-soname,libgcj.so.$(GCJ_SONAME) -nostdlib
1984
$(builddir)/gcc/xgcc -B$(builddir)/gcc/ -shared -fpic \
1985
$(srcdir)/libjava/libgcj_bc.c \
1986
-o $(d)/$(gcc_lib_dir)/libgcj_bc.so \
1987
-Wl,-soname,libgcj_bc.so.1 $(builddir)/libgcj.so -shared-libgcc
1991
if [ -d $(d)/usr/man/man1 ]; then \
1992
mv $(d)/usr/man/man1/* $(d)/usr/share/man/man1/; \
1995
chmod 755 debian/dh_*
1996
touch $(install_snap_stamp)
1998
$(install_stamp): $(build_stamp)
2001
dh_clean -k -N$(p_hppa64)
2003
if [ -f $(binary_stamp)-hppa64 ]; then \
2004
mv $(binary_stamp)-hppa64 saved-stamp-hppa64; \
2006
rm -f $(binary_stamp)*
2007
if [ -f saved-stamp-hppa64 ]; then \
2008
mv saved-stamp-hppa64 $(binary_stamp)-hppa64; \
2011
: # Install directories
2013
mkdir -p $(d)/$(libdir) $(d)/$(PF) $(d)/$(PF)/$(libdir)/debug
2014
ifeq ($(biarch32),yes)
2015
mkdir -p $(d)/$(PF)/$(lib32loc)/debug
2017
ifeq ($(biarch64),yes)
2018
mkdir -p $(d)/$(PF)/lib64/debug
2020
ifeq ($(biarchn32),yes)
2021
mkdir -p $(d)/$(PF)/$(libn32)/debug
2023
ifeq ($(biarchx32),yes)
2024
mkdir -p $(d)/$(PF)/libx32/debug
2027
ifneq (,$(filter $(DEB_TARGET_GNU_CPU),x86_64 sparc64 s390x powerpc64))
2028
ifneq ($(DEB_TARGET_ARCH),x32)
2029
: # link lib to lib64 and $(PF)/lib to $(PF)/lib64
2030
: # (this works when CONFARGS contains '--disable-multilib')
2031
ln -s $(configured_libdir) $(d)/lib64
2032
mkdir -p $(d)/$(PF)/$(configured_libdir)
2033
ln -s $(configured_libdir) $(d)/$(PF)/lib64
2036
ifeq ($(DEB_TARGET_ARCH),x32)
2037
: # link lib to libx32 and $(PF)/lib to $(PF)/libx32
2038
ln -s $(configured_libdir) $(d)/libx32
2039
mkdir -p $(d)/$(PF)/$(configured_libdir)
2040
ln -s $(configured_libdir) $(d)/$(PF)/libx32
2043
: # Work around PR lto/41569
2044
ln -sf gcc $(builddir)/prev-gcc
2046
: # Install everything
2049
$(MAKE) -C $(builddir) \
2051
$(LDFLAGS_TO_PASS) \
2052
DESTDIR=$(PWD)/$(d) \
2053
infodir=/$(PF)/share/info \
2054
mandir=/$(PF)/share/man \
2057
ifneq ($(configured_libdir),$(libdir))
2058
for i in debug go pkgconfig '*.so' '*.so.*' '*.a' '*.la' '*.o' '*.py' '*.spec'; do \
2059
mv $(d)/$(PF)/$(configured_libdir)/$$i \
2060
$(d)/$(PF)/$(libdir)/. || true; \
2061
mv $(d)/$(PF)/libo32/$$i \
2062
$(d)/$(PF)/lib/. || true; \
2066
ifeq ($(with_libcxxdbg),yes)
2067
: # FIXME: the libstdc++ gdb.py file is installed with a wrong name
2068
for i in $$(find $(d)/$(PF) -name libstdc++_pic.a-gdb.py); do \
2069
[ -f $$i ] || continue; \
2070
d=$$(dirname $$i); \
2071
b=$$(basename $$i); \
2072
t=$$(cd $$d; echo libstdc++.so.*.*.*)-gdb.py; \
2077
# FIXME: libjava/classpath not correctly patched
2078
ifeq ($(with_java),yes)
2079
-if [ -d $(d)/$(PF)/lib/gcj-$(GCC_VERSION)-$(GCJ_SONAME) ]; then \
2080
ls -l $(d)/$(PF)/lib/gcj-$(GCC_VERSION)-$(GCJ_SONAME); \
2081
mv $(d)/$(PF)/lib/gcj-$(GCC_VERSION)-$(GCJ_SONAME)/* \
2082
$(d)/$(PF)/lib/gcj-$(BASE_VERSION)-$(GCJ_SONAME)/; \
2083
rmdir $(d)/$(PF)/lib/gcj-$(GCC_VERSION)-$(GCJ_SONAME); \
2087
: # remove rpath settings from binaries and shared libs
2088
for i in $$(chrpath -k $(d)/$(PF)/bin/* $(d)/$(PF)/lib*/lib*.so.* \
2089
$(if $(filter $(with_multiarch_lib),yes), \
2090
$(d)/$(PF)/lib/$(DEB_HOST_MULTIARCH)/lib*.so.*) \
2091
$(d)/$(PF)/lib*/gcj$(pkg_ver)*/lib*.so.* \
2092
2>/dev/null | awk -F: '/RPATH=/ {print $$1}'); \
2094
case "$$i" in ecj1|*gij-*|*libjawt*|*libjvm*) continue; esac; \
2095
[ -h $$i ] && continue; \
2096
chrpath --delete $$i; \
2097
echo "removed RPATH: $$i"; \
2100
: # remove '*.la' and '*.lai' files, not shipped in any package.
2101
find $(d) -name '*.la' -o -name '*.lai' | xargs -r rm -f
2103
ifneq ($(with_libgnat),yes)
2104
rm -f $(d)/$(gcc_lib_dir)/adalib/lib*.so*
2107
ifeq ($(GFDL_INVARIANT_FREE),yes)
2108
for i in gcc gcov; do \
2109
I=`echo $$i | tr a-z A-Z`; \
2110
sed -e "s/@NAME@/$$I$(pkg_ver)/g" -e "s/@name@/$$i$(pkg_ver)/g" \
2111
debian/dummy-man.1 > $(d)/$(PF)/share/man/man1/$$i.1; \
2114
ifeq ($(with_fortran),yes)
2116
I=`echo $$i | tr a-z A-Z`; \
2117
sed -e "s/@NAME@/$$I$(pkg_ver)/g" -e "s/@name@/$$i$(pkg_ver)/g" \
2118
debian/dummy-man.1 > $(d)/$(PF)/share/man/man1/$$i.1; \
2121
ifeq ($(with_java),yes)
2122
for i in gcj gcjh gij jv-convert jv-scan jcf-dump grmic grmiregistry; \
2124
I=`echo $$i | tr a-z A-Z`; \
2125
sed -e "s/@NAME@/$$I$(pkg_ver)/g" -e "s/@name@/$$i$(pkg_ver)/g" \
2126
debian/dummy-man.1 > $(d)/$(PF)/share/man/man1/$$i.1; \
2131
# ifeq ($(with_ada),yes)
2132
# : # rename files (versioned ada binaries)
2134
# mv $(d)/$(PF)/bin/$$i $(d)/$(PF)/bin/$$i-$(GNAT_VERSION); \
2135
# mv $(d)/$(PF)/share/man/man1/$$i.1 \
2136
# $(d)/$(PF)/share/man/man1/$$i-$(GNAT_VERSION).1; \
2138
# for i in $(GNAT_TOOLS); do \
2139
# mv $(d)/$(PF)/bin/$$i $(d)/$(PF)/bin/$$i-$(GNAT_VERSION); \
2143
ifeq ($(DEB_CROSS)-$(multilib),yes-yes)
2144
ifneq ($(DEB_STAGE),stage1)
2145
ifeq ($(DEB_TARGET_ARCH)-$(biarch64),s390-yes)
2146
: # s390 64bit stuff happens to be in s390x-linux-gnu/lib64/
2147
mkdir -p $(d)/$(PF)/s390-linux-gnu/lib64
2148
cp -a $(d)/$(PF)/s390x-linux-gnu/lib64/* $(d)/$(PF)/s390-linux-gnu/lib64/
2150
ifeq ($(DEB_TARGET_ARCH)-$(biarch64),powerpc-yes)
2151
: # ppc 64bit build slaps libgcc and libstdc++ to powerpc64-linux-gnu
2152
mkdir -p $(d)/$(PF)/powerpc-linux-gnu/lib64
2153
cp -a $(d)/$(PF)/powerpc64-linux-gnu/lib64/* $(d)/$(PF)/powerpc-linux-gnu/lib64/
2158
for i in ar nm ranlib; do \
2159
cp debian/gcc-$$i$(pkg_ver).1 $(d)/$(PF)/share/man/man1/$(cmd_prefix)gcc-$$i$(pkg_ver).1; \
2162
chmod 755 debian/dh_*
2164
# tar cf tmp.tar debian/tmp
2166
touch $(install_stamp)
2168
$(install_hppa64_stamp): $(build_hppa64_stamp)
2172
mkdir -p $(d_hppa64)/$(PF)
2175
$(MAKE) -C $(builddir_hppa64) \
2178
$(LDFLAGS_TO_PASS) \
2179
DESTDIR=$(PWD)/$(d_hppa64) \
2182
ifeq ($(versioned_packages),yes)
2183
mv $(d_hppa64)/$(PF)/bin/hppa64-linux-gnu-cpp \
2184
$(d_hppa64)/$(PF)/bin/hppa64-linux-gnu-cpp$(pkg_ver)
2187
ifneq ($(single_package),yes)
2188
: # remove files not needed
2189
rm -rf $(d_hppa64)/$(PF)/info $(d_hppa64)/$(PF)/share/info
2190
rm -rf $(d_hppa64)/$(PF)/man $(d_hppa64)/$(PF)/share/man
2191
rm -rf $(d_hppa64)/$(PF)/$(libdir)/gcc/hppa64-linux-gnu/$(GCC_VERSION)/plugin
2192
rm -f $(d_hppa64)/$(PF)/$(libdir)/libiberty.a
2193
rm -f $(d_hppa64)/$(PF)/bin/*{gcov,gccbug,gcc}
2195
rm -rf $(d_hppa64)/$(PF)/hppa64-linux-gnu/include
2196
rm -rf $(d_hppa64)/$(PF)/hppa64-linux-gnu/lib
2197
rm -rf $(d_hppa64)/$(hppa64libexecdir)/gcc/hppa64-linux-gnu/$(GCC_VERSION)/install-tools
2200
touch $(install_hppa64_stamp)
2202
$(install_neon_stamp): $(build_neon_stamp)
2206
mkdir -p $(d_neon)/$(PF)
2209
$(MAKE) -C $(builddir_neon) \
2212
$(LDFLAGS_TO_PASS) \
2213
DESTDIR=$(PWD)/$(d_neon) \
2215
touch $(install_neon_stamp)
2217
# ----------------------------------------------------------------------
2218
# Build architecture-dependent files here.
2219
#binary-arch: build install $(foreach i,$(arch_binaries),$(binary_stamp)-$(i))
2220
binary-arch: $(foreach i,$(arch_binaries),$(binary_stamp)-$(i))
2221
ifeq ($(with_check),yes)
2223
# : # Send Email about sucessfull build.
2224
# # cat raw-test-summary | sh; echo "Sent mail to $(S_EMAIL)"
2227
# ----------------------------------------------------------------------
2228
# Build architecture-independent files here.
2229
#binary-indep: build install $(foreach i,$(indep_binaries),$(binary_stamp)-$(i))
2230
binary-indep: $(foreach i,$(indep_binaries),$(binary_stamp)-$(i))
2233
@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
2235
binary: binary-indep binary-arch
2236
.PHONY: build clean binary-indep binary-arch binary