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)}'`; \
54
echo "Limited memory for test runs to `ulimit -m`kB"
59
ifeq ($(locale_data),generate)
60
SET_LOCPATH = LOCPATH=$(PWD)/locales
63
SET_PATH = PATH=$(PWD)/bin:/usr/$(libdir)/gcc/bin:$$PATH
64
ifeq ($(trunk_build),yes)
65
ifneq (,$(findstring sparc64-linux,$(DEB_TARGET_GNU_TYPE)))
66
SET_PATH = PATH=/usr/lib/gcc-snapshot/bin:$(PWD)/bin:/usr/$(libdir)/gcc/bin:$$PATH
68
ifneq (,$(findstring ppc64-linux,$(DEB_TARGET_GNU_TYPE)))
69
SET_PATH = PATH=/usr/lib/gcc-snapshot/bin:$(PWD)/bin:/usr/$(libdir)/gcc/bin:$$PATH
73
# the recipient for the test summaries. Send with: debian/rules mail-summary
74
S_EMAIL = gcc@packages.debian.org gcc-testresults@gcc.gnu.org
76
# build not yet prepared to take variables from the environment
81
$(foreach v, CPPFLAGS CFLAGS CXXFLAGS FFLAGS LDFLAGS, $(if $(filter environment,$(origin $(v))),$(eval $(call unsetenv, $(v)))))
83
ifeq ($(REVERSE_CROSS),yes)
86
CC = $(if $(filter yes,$(with_ada)),gnatgcc,gcc)
88
ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_TARGET_GNU_TYPE))
89
CC_FOR_TARGET = $(builddir)/gcc/xgcc -B$(builddir)/gcc/
91
CC_FOR_TARGET = $(DEB_TARGET_GNU_TYPE)-gcc
94
ifneq ($(distribution),Ubuntu)
95
ifneq (,$(filter $(DEB_TARGET_ARCH), arm armel mips mipsel))
96
STAGE1_CFLAGS = -g -O2
105
# work around PR 57689
106
ifeq ($(DEB_TARGET_ARCH),ia64)
110
ifeq ($(with_ssp_default),yes)
112
ifeq (,$(BOOT_CFLAGS))
116
LIBCXXFLAGS = -g -O2 -fno-implicit-templates
117
# Only use -fno-stack-protector when known to the stage1 compiler.
118
cc-fno-stack-protector := $(shell if $(CC) $(CFLAGS) -fno-stack-protector \
119
-S -o /dev/null -xc /dev/null > /dev/null 2>&1; \
120
then echo "-fno-stack-protector"; fi;)
121
$(foreach var,STAGE1_CFLAGS BOOT_CFLAGS LIBCFLAGS LIBCXXFLAGS,$(eval \
122
$(var) += $(cc-fno-stack-protector)))
125
ifeq ($(DEB_CROSS),yes)
129
ifneq (,$(findstring static,$(DEB_BUILD_OPTIONS)))
133
ifneq (,$(filter $(DEB_TARGET_ARCH),alpha))
134
LDFLAGS += -Wl,--no-relax
138
$(if $(CFLAGS),CFLAGS="$(CFLAGS)") \
139
$(if $(BOOT_CFLAGS),BOOT_CFLAGS="$(BOOT_CFLAGS)") \
140
$(if $(LIBCFLAGS),LIBCFLAGS="$(LIBCFLAGS)") \
141
$(if $(LIBCXXFLAGS),LIBCXXFLAGS="$(LIBCXXFLAGS)")
143
$(if $(LDFLAGS),LDFLAGS="$(LDFLAGS)")
144
STAGE1_CFLAGS_TO_PASS = \
145
$(if $(STAGE1_CFLAGS),STAGE1_CFLAGS="$(STAGE1_CFLAGS)")
147
docdir = usr/share/doc
150
--with-pkgversion='$(distribution)$(if $(with_linaro_branch),/Linaro)___$(DEB_VERSION)' \
151
--with-bugurl='file:///usr/share/doc/$(subst gcj,gcc,$(PKGSOURCE))/README.Bugs'
154
--enable-languages=$(subst $(SPACE),$(COMMA),$(enabled_languages)) \
157
ifeq ($(versioned_packages),yes)
158
CONFARGS += --program-suffix=-$(BASE_VERSION)
163
--disable-decimal-float \
164
--disable-libatomic \
166
--disable-libmudflap \
168
--disable-libquadmath \
169
--disable-libsanitizer \
171
--libexecdir=/$(libexecdir) \
172
--libdir=/$(PF)/$(configured_libdir) \
173
$(if $(with_build_sysroot),--with-build-sysroot=$(with_build_sysroot)) \
174
$(if $(with_sysroot),--with-sysroot=$(with_sysroot))
176
ifeq ($(with_multiarch_lib),yes)
181
ifeq ($(DEB_STAGE),stage1)
194
--enable-linker-build-id \
196
ifneq ($(single_package),yes)
198
--libexecdir=/$(libexecdir) \
199
--without-included-gettext \
200
--enable-threads=posix \
201
--with-gxx-include-dir=/$(cxx_inc_dir) \
202
--libdir=/$(PF)/$(configured_libdir)
205
ifneq ($(with_cpp),yes)
206
CONFARGS += --disable-cpp
209
ifeq ($(with_nls),yes)
210
CONFARGS += --enable-nls
212
CONFARGS += --disable-nls
215
ifeq ($(with_bootstrap),off)
216
CONFARGS += --disable-bootstrap
217
else ifneq ($(with_bootstrap),)
218
CONFARGS += --enable-bootstrap=$(with_bootstrap)
221
ifneq ($(with_sysroot),)
222
CONFARGS += --with-sysroot=$(with_sysroot)
224
ifneq ($(with_build_sysroot),)
225
CONFARGS += --with-build-sysroot=$(with_build_sysroot)
228
ifeq ($(force_gnu_locales),yes)
229
CONFARGS += --enable-clocale=gnu
232
ifeq ($(with_cxx)-$(with_debug),yes-yes)
233
CONFARGS += --enable-libstdcxx-debug
235
CONFARGS += --enable-libstdcxx-time=yes
237
ifeq (,$(filter $(DEB_TARGET_ARCH), hurd-i386 kfreebsd-i386 kfreebsd-amd64))
238
CONFARGS += --enable-gnu-unique-object
241
ifneq ($(with_ssp),yes)
242
CONFARGS += --disable-libssp
245
ifneq ($(with_mudflap),yes)
246
CONFARGS += --disable-libmudflap
249
ifneq ($(with_gomp),yes)
250
CONFARGS += --disable-libgomp
253
ifneq ($(with_itm),yes)
254
CONFARGS += --disable-libitm
257
ifneq ($(with_atomic),yes)
258
CONFARGS += --disable-libatomic
261
ifneq ($(with_asan),yes)
262
CONFARGS += --disable-libsanitizer
265
ifneq ($(with_qmath),yes)
266
CONFARGS += --disable-libquadmath
269
ifeq ($(with_plugins),yes)
270
CONFARGS += --enable-plugin
273
#ifeq ($(with_gold),yes)
274
# CONFARGS += --enable-gold --enable-ld=default
277
#CONFARGS += --with-plugin-ld=ld.gold
278
#CONFARGS += --with-plugin-ld
282
CONFARGS += --with-system-zlib
284
jvm_name_short = java-1.5.0-gcj-$(BASE_VERSION)$(if $(findstring snap,$(PKGSOURCE)),-snap)
285
jvm_name_long = $(jvm_name_short)-1.5.0.0
287
ifeq ($(with_java),yes)
288
CONFARGS += --disable-browser-plugin
289
ifeq ($(with_java_maintainer_mode),yes)
290
CONFARGS += --enable-java-maintainer-mode
292
ifeq ($(with_java_biarch_awt),yes)
293
CONFARGS += --enable-java-awt=$(subst $(SPACE),$(COMMA),$(foreach p,$(java_awt_peers),$(p)-default))
295
CONFARGS += --enable-java-awt=$(subst $(SPACE),$(COMMA),$(foreach p,$(java_awt_peers),$(p)))
297
ifneq (,$(findstring gtk,$(java_awt_peers)))
298
CONFARGS += --enable-gtk-cairo
300
jvm_ext = -$(DEB_TARGET_ARCH)$(if $(filter yes,$(DEB_CROSS)),-cross)
301
jvm_dir = /usr/lib/jvm/$(jvm_name_short)$(jvm_ext)
302
CONFARGS += --with-java-home=$(jvm_dir)/jre
303
CONFARGS += --enable-java-home \
304
--with-jvm-root-dir=$(jvm_dir) \
305
--with-jvm-jar-dir=/usr/lib/jvm-exports/$(jvm_name_short)$(jvm_ext)
306
CONFARGS += --with-arch-directory=$(java_cpu)
307
ifeq (./,$(dir $(ecj_jar)))
308
CONFARGS += --with-ecj-jar=$(jvm_dir)/lib/ecj.jar
310
CONFARGS += --with-ecj-jar=$(ecj_jar)
312
ifneq ($(with_libgcj),yes)
313
CONFARGS += --disable-libgcj
317
ifeq ($(with_gcj),yes)
318
ifeq ($(DEB_HOST_GNU_CPU),m32r)
319
CONFARGS += --enable-libgcj
323
ifeq ($(with_objc)-$(with_objc_gc),yes-yes)
324
CONFARGS += --enable-objc-gc
327
ifneq (,$(filter $(DEB_TARGET_GNU_TYPE), i486-linux-gnu i586-linux-gnu i686-linux-gnu))
328
ifeq ($(multilib),yes)
329
ifeq ($(biarch64),yes)
330
CONFARGS += --enable-targets=all
335
ifneq (,$(filter $(DEB_TARGET_GNU_TYPE), x86_64-linux-gnu x86_64-kfreebsd-gnu s390x-linux-gnu))
336
ifneq ($(biarch32),yes)
337
CONFARGS += --disable-multilib
341
ifneq (,$(filter $(DEB_TARGET_GNU_TYPE), powerpc-linux-gnu powerpc-linux-gnuspe))
342
CONFARGS += --enable-secureplt
343
ifeq ($(biarch64),yes)
344
CONFARGS += --disable-softfloat --with-cpu=default32
345
ifeq ($(multilib),yes)
346
CONFARGS += --disable-softfloat \
347
--enable-targets=powerpc-linux,powerpc64-linux
350
CONFARGS += --disable-multilib
354
ifneq (,$(findstring powerpc64-linux,$(DEB_TARGET_GNU_TYPE)))
355
CONFARGS += --enable-secureplt
356
ifeq ($(biarch32),yes)
357
ifeq ($(multilib),yes)
358
CONFARGS += --disable-softfloat --enable-targets=powerpc64-linux,powerpc-linux
361
CONFARGS += --disable-multilib
363
ifeq ($(distribution),Ubuntu)
364
CONFARGS += --with-cpu-32=power7 --with-cpu-64=power7
368
ifeq ($(REVERSE_CROSS),yes)
369
# FIXME: requires isl and cloog headers for the target
370
#CONFARGS += --without-isl
371
# FIXME: build currently fails build the precompiled headers
372
CONFARGS += --disable-libstdcxx-pch
375
ifeq ($(with_multiarch_lib),yes)
376
CONFARGS += --enable-multiarch
379
ifeq ($(findstring powerpcspe,$(DEB_TARGET_ARCH)),powerpcspe)
380
CONFARGS += --with-cpu=8548 --enable-e500_double
383
ifneq (,$(findstring softfloat,$(DEB_TARGET_GNU_CPU)))
384
CONFARGS += --with-float=soft
387
ifneq (,$(findstring arm-vfp,$(DEB_TARGET_GNU_CPU)))
388
CONFARGS += --with-fpu=vfp
391
ifneq (,$(findstring arm, $(DEB_TARGET_GNU_CPU)))
392
ifeq ($(multilib),yes)
393
CONFARGS += --enable-multilib
395
CONFARGS += --disable-sjlj-exceptions
396
# FIXME: libjava is not ported for thumb, this hack only works for
397
# separate gcj builds
398
ifneq (,$(filter armhf,$(DEB_TARGET_ARCH)))
399
ifneq (,$(findstring gcj,$(PKGSOURCE)))
400
with_arm_arch = armv6
402
with_arm_arch = armv7-a
404
with_arm_fpu = vfpv3-d16
407
ifeq ($(distribution),Debian)
408
with_arm_arch = armv4t
409
else ifneq (,$(filter $(distrelease),karmic))
410
with_arm_arch = armv6
411
with_arm_fpu = vfpv3-d16
412
else ifneq (,$(filter $(distrelease),lucid maverick natty oneiric precise))
413
ifneq (,$(findstring gcj,$(PKGSOURCE)))
414
with_arm_arch = armv6
416
with_arm_arch = armv7-a
418
with_arm_fpu = vfpv3-d16
420
with_arm_arch = armv5t # starting with quantal
423
CONFARGS += --with-arch=$(with_arm_arch)
424
ifneq (,$(with_arm_fpu))
425
CONFARGS += --with-fpu=$(with_arm_fpu)
427
CONFARGS += --with-float=$(float_abi)
428
ifeq ($(with_arm_thumb),yes)
429
CONFARGS += --with-mode=thumb
433
ifeq ($(DEB_TARGET_GNU_CPU),$(findstring $(DEB_TARGET_GNU_CPU),m68k))
434
CONFARGS += --disable-werror
436
# FIXME: correct fix-warnings.dpatch
437
ifeq ($(distribution),Ubuntu)
438
CONFARGS += --disable-werror
441
ifneq (,$(findstring sparc-linux,$(DEB_TARGET_GNU_TYPE)))
442
ifeq ($(biarch64),yes)
443
CONFARGS += --enable-targets=all
447
ifneq (,$(findstring sparc64-linux,$(DEB_TARGET_GNU_TYPE)))
448
ifeq ($(biarch32),yes)
449
CONFARGS += --enable-targets=all
453
ifneq (,$(findstring ia64-linux,$(DEB_TARGET_GNU_TYPE)))
454
CONFARGS += --with-system-libunwind
457
ifneq (,$(findstring sh4-linux,$(DEB_TARGET_GNU_TYPE)))
458
ifeq ($(multilib),yes)
459
CONFARGS += --with-multilib-list=m4,m4-nofpu
461
CONFARGS += --with-cpu=sh4
464
ifneq (,$(findstring m68k-linux,$(DEB_TARGET_GNU_TYPE)))
465
CONFARGS += --disable-multilib
468
ifeq ($(DEB_TARGET_ARCH_OS),linux)
469
ifneq (,$(findstring $(DEB_TARGET_ARCH), alpha powerpc ppc64 s390 s390x sparc sparc64))
470
CONFARGS += --with-long-double-128
474
ifneq (,$(filter $(DEB_TARGET_ARCH), amd64 i386 kfreebsd-i386 kfreebsd-amd64))
475
ifneq (,$(filter $(derivative),Ubuntu))
476
ifneq (,$(filter $(distrelease),dapper hardy))
477
CONFARGS += --with-arch-32=i486
478
else ifneq (,$(filter $(distrelease),jaunty karmic lucid))
479
CONFARGS += --with-arch-32=i586
481
CONFARGS += --with-arch-32=i686
484
ifneq (,$(filter $(distrelease),etch lenny))
485
CONFARGS += --with-arch-32=i486
487
CONFARGS += --with-arch-32=i586
492
ifeq ($(DEB_TARGET_ARCH),amd64)
493
CONFARGS += --with-abi=m64
495
ifeq ($(multilib),yes)
496
ifneq (,$(filter $(DEB_TARGET_ARCH), amd64 i386))
497
CONFARGS += --with-multilib-list=m32,m64$(if $(filter yes,$(biarchx32)),$(COMMA)mx32)
498
else ifeq ($(DEB_TARGET_ARCH),x32)
499
CONFARGS += --with-abi=mx32 --with-multilib-list=mx32,m64,m32
503
ifneq (,$(filter $(DEB_TARGET_ARCH), hurd-i386))
504
CONFARGS += --with-arch=i586
507
ifeq ($(DEB_TARGET_ARCH),lpia)
508
CONFARGS += --with-arch=pentium-m --with-tune=i586
511
ifneq (,$(filter $(DEB_TARGET_ARCH), amd64 i386 hurd-i386 kfreebsd-i386 kfreebsd-amd64))
512
CONFARGS += --with-tune=generic
515
ifneq (,$(findstring mips-linux,$(DEB_TARGET_GNU_TYPE)))
516
CONFARGS += --with-arch-32=mips2 --with-tune-32=mips32
517
ifeq ($(multilib),yes)
518
ifeq ($(biarchn32)-$(biarch64),yes-yes)
519
CONFARGS += --enable-targets=all
520
CONFARGS += --with-arch-64=mips3 --with-tune-64=mips64
525
ifneq (,$(findstring mipsel-linux,$(DEB_TARGET_GNU_TYPE)))
526
CONFARGS += --with-arch-32=mips2 --with-tune-32=mips32
527
ifeq ($(multilib),yes)
528
ifeq ($(biarchn32)-$(biarch64),yes-yes)
529
CONFARGS += --enable-targets=all
530
CONFARGS += --with-arch-64=mips3 --with-tune-64=mips64
535
ifneq (,$(findstring s390-linux,$(DEB_TARGET_GNU_TYPE)))
536
ifeq ($(multilib),yes)
537
ifeq ($(biarch64),yes)
538
CONFARGS += --enable-targets=all
543
ifneq (,$(findstring hppa-linux,$(DEB_TARGET_GNU_TYPE)))
544
CONFARGS += --disable-libstdcxx-pch
547
ifneq (,$(findstring gdc, $(PKGSOURCE)))
548
CONFARGS += --disable-libquadmath
551
ifeq ($(trunk_build),yes)
552
ifeq ($(findstring --disable-werror, $(CONFARGS)),)
553
CONFARGS += --disable-werror
555
CONFARGS += --enable-checking=yes
557
CONFARGS += --enable-checking=release
561
--build=$(DEB_BUILD_GNU_TYPE) \
562
--host=$(DEB_HOST_GNU_TYPE) \
563
--target=$(TARGET_ALIAS)
565
ifeq ($(DEB_CROSS),yes)
567
--program-prefix=$(TARGET_ALIAS)-
568
ifneq ($(with_deps_on_target_arch_pkgs),yes)
570
--includedir=/$(PFL)/include
574
ifeq ($(with_bootstrap),off)
576
else ifeq ($(with_bootstrap),)
577
bootstrap_target = bootstrap-lean
578
# no profiledbootstrap on the following architectures
579
# - m68k: we're happy that it builds at all
580
no_profiled_bs_archs := alpha arm arm64 hppa m68k
581
ifeq (,$(findstring $(DEB_TARGET_GNU_CPU),$(no_profiled_bs_archs)))
582
bootstrap_target = profiledbootstrap
583
# FIXME: disabled for first uploads
584
bootstrap_target = bootstrap-lean
586
ifeq ($(PKGSOURCE),gcj-$(BASE_VERSION))
587
bootstrap_target = bootstrap-lean
589
ifeq ($(PKGSOURCE),gnat-$(BASE_VERSION))
590
bootstrap_target = bootstrap-lean
593
# disable profiled bootstrap on slow archs, get to testing first ...
594
ifeq ($(distribution),Debian)
595
ifneq (,$(filter $(DEB_TARGET_ARCH), arm arm64 armel armhf mips mipsel sparc))
596
bootstrap_target = bootstrap-lean
599
ifeq ($(distribution),Ubuntu)
600
ifneq (,$(filter $(DEB_TARGET_ARCH), arm64 sparc))
601
bootstrap_target = bootstrap-lean
607
# Increase the timeout for one testrun on slow architectures
608
ifeq ($(distribution),Debian)
609
ifneq (,$(findstring $(DEB_TARGET_ARCH),arm arm64 armel armhf hppa m68k sparc))
611
else ifneq (,$(findstring $(DEB_TARGET_GNU_CPU),amd64 i386 i486 i686 lpia))
614
ifeq ($(DEB_TARGET_GNU_SYSTEM),gnu)
617
else ifeq ($(distribution),Ubuntu)
618
ifneq (,$(findstring $(DEB_TARGET_ARCH),arm64 armel armhf hppa ia64 sparc))
620
else ifneq (,$(findstring $(DEB_TARGET_GNU_CPU),amd64 i386 i486 i686 lpia))
626
ifneq ($(trunk_build),yes)
627
ifeq ($(with_ssp),yes)
628
ifneq ($(single_package),yes)
629
DEJAGNU_RUNS += $(if $(filter yes,$(with_ssp_default)),-fno-stack-protector,-fstack-protector)
631
# FIXME Ubuntu armel buildd hangs
632
ifneq (,$(findstring arm, $(DEB_TARGET_GNU_CPU)))
635
ifeq ($(distribution),Ubuntu)
636
# the buildds are just slow ... don't check the non-default
637
ifneq (,$(findstring $(DEB_TARGET_GNU_CPU),ia64 powerpc sparc))
644
ifeq ($(distribution),Ubuntu)
645
ifneq (,$(findstring arm, $(DEB_TARGET_GNU_CPU)))
646
ifeq ($(with_arm_thumb),yes)
647
#DEJAGNU_RUNS += -marm
649
DEJAGNU_RUNS += -mthumb
654
# no b-d on g++-multilib, this is run by the built compiler
655
abi_run_check = $(strip $(if $(wildcard build/runcheck$(1).out), \
656
$(shell cat build/runcheck$(1).out), \
657
$(shell CC="$(builddir)/gcc/xgcc -B$(builddir)/gcc/ -static-libgcc $(1)" bash debian/runcheck.sh)))
658
ifeq ($(biarch32),yes)
659
DEJAGNU_RUNS += $(call abi_run_check,-m32)
661
ifeq ($(biarch64),yes)
662
DEJAGNU_RUNS += $(call abi_run_check,$(if $(filter $(DEB_TARGET_ARCH_CPU),mips mipsel),-mabi=64,-m64))
664
ifeq ($(biarchn32),yes)
665
DEJAGNU_RUNS += $(call abi_run_check,-mabi=n32)
667
ifeq ($(biarchx32),yes)
668
DEJAGNU_RUNS += $(call abi_run_check,-mx32)
671
# gdc is not multilib'd
672
ifneq (,$(findstring gdc, $(PKGSOURCE)))
676
ifneq (,$(findstring gcj, $(PKGSOURCE)))
681
ifneq (,$(findstring gnat, $(PKGSOURCE)))
685
ifneq (,$(strip $(value DEJAGNU_RUNS)))
686
RUNTESTFLAGS = RUNTESTFLAGS="--target_board=unix\{,$(subst $(SPACE),$(COMMA),$(strip $(DEJAGNU_RUNS)))\}"
689
# PF is the installation prefix for the package without the leading slash.
690
# It's "usr" for gcc releases.
692
# use value set in the environment
693
else ifeq ($(trunk_build),yes)
694
PF = usr/lib/gcc-snapshot
695
else ifeq ($(PKGSOURCE),gcc-linaro)
696
PF = usr/lib/gcc-linaro
701
# PFL is the installation prefix with DEB_TARGET_GNU_TYPE attached for cross builds
702
ifeq ($(DEB_CROSS),yes)
703
ifneq ($(with_deps_on_target_arch_pkgs),yes)
704
PFL = $(PF)/$(DEB_TARGET_GNU_TYPE)
712
# RPF is the base prefix or installation prefix with DEB_TARGET_GNU_TYPE attached for cross builds
713
ifeq ($(DEB_CROSS),yes)
714
ifneq ($(with_deps_on_target_arch_pkgs),yes)
715
RPF = $(PF)/$(DEB_TARGET_GNU_TYPE)
723
ifeq ($(with_multiarch_lib),yes)
724
ifeq ($(DEB_CROSS),yes)
725
ifneq ($(with_deps_on_target_arch_pkgs),yes)
728
libdir = lib/$(DEB_TARGET_MULTIARCH)
731
libdir = lib/$(DEB_TARGET_MULTIARCH)
736
configured_libdir = lib
738
hppa64libexecdir= $(PF)/lib
740
# /usr/libexec doesn't follow the FHS
741
ifeq ($(single_package),yes)
743
libexecdir = $(PF)/libexec
744
versiondir = $(GCC_VERSION)
746
libexecdir = $(PF)/$(configured_libdir)
747
versiondir = $(BASE_VERSION)
749
buildlibdir = $(builddir)/$(TARGET_ALIAS)
751
# install cross compilers in /usr/lib/gcc-cross, native ones in /usr/lib/gcc
752
gcc_subdir_name = gcc
753
ifneq ($(single_package),yes)
754
ifeq ($(DEB_CROSS),yes)
755
ifneq ($(with_deps_on_target_arch_pkgs),yes)
756
gcc_subdir_name = gcc-cross
761
gcc_lib_dir = $(PF)/$(configured_libdir)/$(gcc_subdir_name)/$(TARGET_ALIAS)/$(versiondir)
762
gcc_lexec_dir = $(libexecdir)/$(gcc_subdir_name)/$(TARGET_ALIAS)/$(versiondir)
769
p_l= $(1)$(cross_lib_arch)
770
p_d= $(1)-dbg$(cross_lib_arch)
774
ifeq ($(DEB_CROSS),yes)
775
ifneq ($(with_deps_on_target_arch_pkgs),yes)
778
# sh4 has multilib. base is sh4-linux-gnu. See #663028.
779
ifneq (,$(findstring sh4-linux,$(DEB_TARGET_GNU_TYPE)))
780
usr_lib = $(PFL)/lib/sh4-linux-gnu/
783
usr_lib = $(PFL)/$(libdir)
786
usr_lib = $(PFL)/$(libdir)
788
usr_lib32 = $(PFL)/lib32
789
usr_libn32 = $(PFL)/lib32
790
usr_libx32 = $(PFL)/libx32
791
usr_lib64 = $(PFL)/lib64
792
# FIXME: Move to the new location for native builds too
793
ifeq ($(DEB_CROSS),yes)
794
usr_libhf = $(PFL)/libhf
795
usr_libsf = $(PFL)/libsf
797
usr_libhf = $(PFL)/lib/arm-linux-gnueabihf
798
usr_libsf = $(PFL)/lib/arm-linux-gnueabi
801
gcc_lib_dir32 = $(gcc_lib_dir)/$(biarch32subdir)
802
gcc_lib_dirn32 = $(gcc_lib_dir)/$(biarchn32subdir)
803
gcc_lib_dirx32 = $(gcc_lib_dir)/$(biarchx32subdir)
804
gcc_lib_dir64 = $(gcc_lib_dir)/$(biarch64subdir)
805
gcc_lib_dirhf = $(gcc_lib_dir)/$(biarchhfsubdir)
806
gcc_lib_dirsf = $(gcc_lib_dir)/$(biarchsfsubdir)
808
libgcc_dir = $(RPF)/$(libdir)
809
# yes, really; lib32gcc_s ends up in usr
810
libgcc_dir32 = $(PFL)/lib32
811
libgcc_dirn32 = $(RPF)/lib32
812
# libx32gcc_s also ends up in usr
813
libgcc_dirx32 = $(PFL)/libx32
814
libgcc_dir64 = $(RPF)/lib64
815
# FIXME: Move to the new location for native builds too
816
ifeq ($(DEB_CROSS),yes)
817
libgcc_dirhf = $(RPF)/libhf
818
libgcc_dirsf = $(RPF)/libsf
820
libgcc_dirhf = $(RPF)/lib/arm-linux-gnueabihf
821
libgcc_dirsf = $(RPF)/lib/arm-linux-gnueabi
824
# install_gcc_lib(lib,soname,flavour,package)
825
define install_gcc_lib
826
mv $(d)/$(usr_lib$(3))/$(1)*.a debian/$(4)/$(gcc_lib_dir$(3))/
827
rm -f $(d)/$(usr_lib$(3))/$(1)*.{la,so}
829
/$(usr_lib$(3))/$(1).so.$(2) /$(gcc_lib_dir$(3))/$(1).so
833
checkdirs = $(builddir)
834
ifeq ($(with_separate_libgcj),yes)
835
ifeq ($(PKGSOURCE),gcj-$(BASE_VERSION))
836
ifneq ($(with_standalone_gcj),yes)
837
checkdirs = $(buildlibdir)/libffi $(buildlibdir)/libjava
841
ifeq ($(with_separate_go),yes)
842
ifeq ($(PKGSOURCE),gccgo-$(BASE_VERSION))
843
checkdirs = $(buildlibdir)/libgo
846
ifeq ($(with_separate_gnat),yes)
847
ifeq ($(PKGSOURCE),gnat-$(BASE_VERSION))
848
checkdirs = $(builddir)/gcc
852
ifneq ($(DEB_CROSS),yes)
853
ifneq ($(single_package),yes)
854
cxx_inc_dir = $(PF)/include/c++/$(BASE_VERSION)
856
cxx_inc_dir = $(PF)/include/c++/$(GCC_VERSION)
859
ifeq ($(with_deps_on_target_arch_pkgs),yes)
860
cxx_inc_dir = $(PF)/include/c++/$(BASE_VERSION)
862
cxx_inc_dir = $(PF)/$(TARGET_ALIAS)/include/c++/$(GCC_VERSION)
866
# FIXME: MULTIARCH_DIRNAME needed for g++-multiarch-incdir.diff
867
MULTIARCH_DIRNAME := $(DEB_TARGET_MULTIARCH)
868
export MULTIARCH_DIRNAME
872
configure: $(configure_dependencies)
874
$(configure_dummy_stamp):
875
touch $(configure_dummy_stamp)
879
: # give information about the build process
880
@echo "------------------------ Build process variables ------------------------"
881
@echo "Number of parallel processes used for the build: $(USE_CPUS)"
882
@echo "Package source: $(PKGSOURCE)"
883
@echo "GCC version: $(GCC_VERSION)"
884
@echo "Base Debian version: $(BASE_VERSION)"
885
@echo -e "Configured with: $(subst ___, ,$(foreach i,$(CONFARGS),$(i)\n\t))"
886
ifeq ($(DEB_CROSS),yes)
887
@echo "Building cross compiler for $(DEB_TARGET_ARCH)"
889
@echo "Using shell $(SHELL)"
890
@echo "Architecture: $(DEB_TARGET_ARCH) (GNU: $(TARGET_ALIAS))"
891
@echo "CPPFLAGS: $(CPPFLAGS)"
892
@echo "CFLAGS: $(CFLAGS)"
893
@echo "LDFLAGS: $(LDFLAGS)"
894
@echo "BOOT_CFLAGS: $(BOOT_CFLAGS)"
895
@echo "DEBIAN_BUILDARCH: $(DEBIAN_BUILDARCH)"
896
@echo "Install prefix: /$(PF)"
897
ifeq ($(biarchn32)-$(biarch64),yes-yes)
898
@echo "Will build the triarch compilers (o32/n32/64, defaulting to o32)"
899
else ifeq ($(biarch64)-$(biarch32),yes-yes)
900
@echo "Will build the triarch compilers (x32/64/32, defaulting to x32)"
901
else ifeq ($(biarch64)-$(biarchx32),yes-yes)
902
@echo "Will build the triarch compilers (32/64/x32, defaulting to 32bit)"
903
else ifeq ($(biarch32)-$(biarchx32),yes-yes)
904
@echo "Will build the triarch compilers (64/32/x32, defaulting to 64bit)"
906
ifeq ($(biarch64),yes)
907
@echo "Will build the biarch compilers (32/64, defaulting to 32bit)"
909
ifeq ($(biarch32),yes)
910
@echo "Will build the biarch compilers (64/32, defaulting to 64bit)"
912
@echo "Will not build the biarch compilers"
917
ifeq ($(with_cxx),yes)
918
@echo "Will build the C++ compiler"
920
@echo "Will not build the C++ compiler: $(with_cxx)"
922
ifeq ($(with_objc),yes)
923
@echo "Will build the ObjC compiler."
924
ifeq ($(with_objc_gc),yes)
925
@echo "Will build the extra ObjC runtime for garbage collection."
927
@echo "Will not build the extra ObjC runtime for garbage collection."
930
@echo "Will not build the ObjC compiler: $(with_objc)"
932
ifeq ($(with_objcxx),yes)
933
@echo "Will build the Obj-C++ compiler"
935
@echo "Will not build the Obj-C++ compiler: $(with_objcxx)"
937
ifeq ($(with_fortran),yes)
938
@echo "Will build the Fortran 95 compiler."
940
@echo "Will not build the Fortran 95 compiler: $(with_fortran)"
942
ifeq ($(with_java),yes)
943
@echo "Will build the Java compiler."
945
@echo "Will not build the Java compiler: $(with_java)"
947
ifeq ($(with_ada),yes)
948
@echo "Will build the Ada compiler."
949
ifeq ($(with_libgnat),yes)
950
@echo "Will build the shared Ada libraries."
952
@echo "Will not build the shared Ada libraries."
955
@echo "Will not build the Ada compiler: $(with_ada)"
957
ifeq ($(with_go),yes)
958
@echo "Will build the Go compiler."
960
@echo "Will not build the Go compiler: $(with_go)"
963
@echo "Will build the D compiler"
964
ifeq ($(with_libphobos),yes)
965
@echo "Will build the phobos D runtime library."
967
@echo "Will not build the phobos D runtime library: $(with_libphobos)"
970
@echo "Will not build the D compiler: $(with_d)"
972
ifeq ($(with_ssp),yes)
973
@echo "Will build with SSP support."
975
@echo "Will build without SSP support: $(with_ssp)"
977
ifeq ($(with_check),yes)
978
@echo "Will run the testsuite."
980
@echo "Will not run the testsuite: $(with_check)"
982
ifeq ($(with_nls),yes)
983
@echo "Will enable national language support."
985
@echo "Will disable national language support: $(with_nls)"
987
@echo "-----------------------------------------------------------------------------"
989
ifeq ($(with_check),yes)
990
@if echo "spawn true" | /usr/bin/expect -f - >/dev/null; then \
993
echo "expect is failing on your system with the above error, which means the GCC"; \
994
echo "testsuite will fail. Please resolve the above issues and retry the build."; \
995
echo "-----------------------------------------------------------------------------"; \
999
rm -f $(configure_stamp) $(build_stamp)
1000
cat debian/README.Debian $(patch_stamp) > debian/README.Debian.$(DEB_TARGET_ARCH)
1010
LD_LIBRARY_PATH=$${LD_LIBRARY_PATH:+$$LD_LIBRARY_PATH:}$(builddir)/gcc/ada/rts \
1011
../src/configure $(subst ___, ,$(CONFARGS))
1013
: # multilib builds without b-d on gcc-multilib (used in FLAGS_FOR_TARGET)
1014
if [ -d /usr/include/$(DEB_TARGET_MULTIARCH)/asm ]; then \
1015
mkdir -p $(builddir)/sys-include; \
1016
ln -sf /usr/include/$(DEB_TARGET_MULTIARCH)/asm $(builddir)/sys-include/asm; \
1019
touch $(configure_stamp)
1021
build: $(build_dependencies)
1023
$(build_dummy_stamp):
1024
touch $(build_dummy_stamp)
1026
$(build_locale_stamp):
1027
ifeq ($(locale_data)-$(with_cxx),generate-yes)
1028
: # build locales needed by libstdc++ testsuite
1031
- sh debian/locale-gen
1033
touch $(build_locale_stamp)
1036
$(build_stamp): $(configure_stamp) $(build_locale_stamp)
1038
rm -f bootstrap-protocol
1039
# DEB_CROSS is never set if REVERSE_CROSS is set and vice-versa.
1041
ifeq ($(DEB_CROSS),yes)
1042
: # build cross compiler for $(TARGET_ALIAS)
1047
$(MAKE) -C $(builddir) $(NJOBS) \
1050
$(LDFLAGS_TO_PASS) \
1052
echo $$? > status; \
1053
) 2>&1 | tee bootstrap-protocol
1054
s=`cat status`; rm -f status; test $$s -eq 0
1056
# REVERSE_CROSS build
1057
ifeq ($(REVERSE_CROSS),yes)
1058
: # build cross compiler for $(TARGET_ALIAS)
1063
$(MAKE) -C $(builddir) $(NJOBS) \
1066
$(LDFLAGS_TO_PASS) \
1068
echo $$? > status; \
1069
) 2>&1 | tee bootstrap-protocol
1070
s=`cat status`; rm -f status; test $$s -eq 0
1073
ifeq ($(with_java),yes)
1075
ln -sf /usr/bin/fastjar bin/jar
1076
ifeq ($(with_native_ecj),yes)
1077
: # prepare the standalone ecj jar
1078
cp /usr/share/java/ecj.jar $(srcdir)/ecj-standalone.jar
1079
zip -d $(srcdir)/ecj-standalone.jar 'org/eclipse/jdt/core/JDTCompilerAdapter*'
1081
ifeq ($(with_java_maintainer_mode),yes)
1084
echo 'exec gij-4.8 -cp /usr/share/java/ecj.jar org.eclipse.jdt.internal.compiler.batch.GCCMain "$$@"'; \
1087
: # If we don't have gjavah in PATH, try to build it with the old gij
1089
if [ -x /usr/bin/gjavah-4.8 ]; then \
1090
ln -sf /usr/bin/gjavah-4.8 bin/gjavah; \
1091
elif [ -x bin/gjavah ]; then \
1094
mkdir -p $(builddir)/java_hacks; \
1095
cd $(builddir)/java_hacks; \
1096
cp -a $(srcdir)/libjava/classpath/tools/external external; \
1097
mkdir -p gnu/classpath/tools; \
1098
cp -a $(srcdir)/libjava/classpath/tools/gnu/classpath/tools/{common,javah,getopt} \
1099
gnu/classpath/tools/; \
1100
cp -a $(srcdir)/libjava/classpath/tools/resource/gnu/classpath/tools/common/Messages.properties \
1101
gnu/classpath/tools/common; \
1103
for i in `find . -name \*.java`; do gcj-4.8 --encoding ISO-8859-1 -C $$i -I.; done; \
1105
for i in `find gnu -name \*.java`; do gcj-4.8 -C $$i -I. -Iexternal/asm/; done; \
1106
gcj-4.8 -findirect-dispatch -O2 -fmain=gnu.classpath.tools.javah.Main \
1107
-I. -Iexternal/asm/ `find . -name \*.class` -o $(PWD)/bin/gjavah.real; \
1110
echo 'export CLASSPATH='`pwd`'$${CLASSPATH:+:$$CLASSPATH}'; \
1111
echo 'exec $(PWD)/bin/gjavah.real "$$@"'; \
1112
) > $(PWD)/bin/gjavah; \
1113
chmod +x $(PWD)/bin/gjavah; \
1117
: # build native compiler
1123
$(MAKE) -C $(builddir) $(NJOBS) $(bootstrap_target) \
1126
$(STAGE1_CFLAGS_TO_PASS) \
1127
$(LDFLAGS_TO_PASS) \
1129
echo $$? > status; \
1130
) 2>&1 | tee bootstrap-protocol
1131
s=`cat status`; rm -f status; test $$s -eq 0
1134
-chmod 755 $(srcdir)/contrib/warn_summary
1135
if [ -x $(srcdir)/contrib/warn_summary ]; then \
1136
rm -f bootstrap-summary; \
1137
$(srcdir)/contrib/warn_summary bootstrap-protocol \
1138
> bootstrap-summary; \
1141
touch $(build_stamp)
1143
ifeq ($(versioned_packages),yes)
1144
hppa64_configure_flags += --program-suffix=-$(BASE_VERSION)
1147
ifeq ($(DEB_CROSS),yes)
1148
CC_for_hppa64_cross = $(CC)
1150
CC_for_hppa64_cross = $(builddir)/gcc/xgcc -B$(builddir)/gcc/
1153
$(configure_hppa64_stamp): $(build_stamp)
1155
rm -f $(configure_hppa64_stamp) $(build_hppa64_stamp)
1156
rm -rf $(builddir_hppa64)
1157
mkdir $(builddir_hppa64)
1159
cd $(builddir_hppa64) && \
1162
CC="$(CC_for_hppa64_cross)" \
1164
--enable-languages=c \
1166
--libexecdir=/$(hppa64libexecdir) \
1170
--disable-libatomic \
1173
--disable-libmudflap \
1175
--disable-libquadmath \
1177
--with-system-zlib \
1178
--with-as=/usr/bin/hppa64-linux-gnu-as \
1179
--with-ld=/usr/bin/hppa64-linux-gnu-ld \
1180
--includedir=/usr/hppa64-linux-gnu/include \
1181
--build=$(DEB_BUILD_GNU_TYPE) \
1182
--host=$(DEB_HOST_GNU_TYPE) \
1183
--target=hppa64-linux-gnu
1184
touch $(configure_hppa64_stamp)
1186
$(build_hppa64_stamp): $(configure_hppa64_stamp)
1190
LD_LIBRARY_PATH=$${LD_LIBRARY_PATH:+$$LD_LIBRARY_PATH:}$(builddir)/gcc \
1191
$(MAKE) -C $(builddir_hppa64) $(NJOBS) \
1192
CC="$(CC_for_hppa64_cross)" \
1195
touch $(build_hppa64_stamp)
1197
$(configure_neon_stamp): $(build_stamp)
1199
rm -f $(configure_neon_stamp) $(build_neon_stamp)
1200
rm -rf $(builddir_neon)
1201
mkdir $(builddir_neon)
1203
cd $(builddir_neon) && \
1206
CC="$(builddir)/gcc/xgcc -B$(builddir)/gcc/" \
1208
--disable-bootstrap \
1209
--enable-languages=c,c++,objc,fortran \
1211
--libexecdir=/$(libexecdir) \
1212
--program-suffix=-$(BASE_VERSION) \
1215
--disable-libmudflap \
1216
--with-arch=armv7-a --with-tune=cortex-a8 \
1217
--with-float=$(float_abi) --with-fpu=neon \
1218
--host=arm-linux-gnueabi \
1219
--build=arm-linux-gnueabi \
1220
--target=arm-linux-gnueabi
1221
touch $(configure_neon_stamp)
1223
$(build_neon_stamp): $(configure_neon_stamp)
1227
$(MAKE) -C $(builddir_neon) $(NJOBS) \
1228
CC="$(builddir)/gcc/xgcc -B$(builddir)/gcc/" \
1231
touch $(build_neon_stamp)
1235
$(srcdir)/gcc/doc/cpp.texi \
1236
$(srcdir)/gcc/doc/cppinternals.texi \
1237
$(srcdir)/gcc/doc/gcc.texi \
1238
$(srcdir)/gcc/doc/gccint.texi
1239
ifeq ($(with_fortran),yes)
1240
MANUALS += $(srcdir)/gcc/fortran/gfortran.texi
1242
ifeq ($(with_java),yes)
1243
MANUALS += $(srcdir)/gcc/java/gcj.texi
1245
ifeq ($(with_ada),yes)
1247
$(builddir)/gcc/doc/gnat_ugn.texi \
1248
$(srcdir)/gcc/ada/gnat_rm.texi \
1249
$(srcdir)/gcc/ada/gnat-style.texi
1251
ifeq ($(with_gomp),yes)
1252
MANUALS += $(srcdir)/libgomp/libgomp.texi
1254
ifeq ($(with_itm),yes)
1255
MANUALS += $(srcdir)/libitm/libitm.texi
1257
ifeq ($(with_qmath),yes)
1258
MANUALS += $(srcdir)/libquadmath/libquadmath.texi
1260
ifeq ($(with_go),yes)
1261
MANUALS += $(srcdir)/gcc/go/gccgo.texi
1264
html-docs: $(build_html_stamp)
1265
#$(build_html_stamp): html-texi2html
1266
#$(build_html_stamp): html-makeinfo
1267
$(build_html_stamp): html-makeinfo-nosplit
1270
rm -rf html $(builddir)/gcc/html
1271
mkdir $(builddir)/gcc/html
1272
ln -s $(builddir)/gcc/html html
1273
cd $(builddir)/gcc; \
1274
for manual in $(MANUALS); do \
1275
outname=`basename $${manual} .texi`; \
1276
echo "generating $$outname ..."; \
1277
texi2html -number -split chapter \
1278
-I $(srcdir)/gcc/doc/include \
1279
-I $(srcdir)/gcc/p/doc \
1280
-I $(srcdir)/gcc/p/doc/generated \
1281
-I `dirname $${manual}` \
1282
-I $(builddir)/gcc \
1283
-I $(buildlibdir)/libquadmath \
1291
cd $(builddir)/gcc; \
1292
for manual in $(MANUALS); do \
1293
manual=`find $(srcdir) -name $${file}.texi`; \
1294
outname=`basename $${manual} .texi`; \
1295
echo "generating $$outname ..."; \
1296
if [ "$${manual}" ]; then \
1297
makeinfo --html --number-sections \
1298
-I $(srcdir)/gcc/doc/include -I `dirname $${manual}` \
1299
-I $(srcdir)/gcc/p/doc \
1300
-I $(srcdir)/gcc/p/doc/generated \
1301
-I $(builddir)/gcc \
1302
-I $(buildlibdir)/libquadmath \
1308
html-makeinfo-nosplit:
1311
cd $(builddir)/gcc; \
1312
for manual in $(MANUALS); do \
1313
outname=`basename $${manual} .texi`.html; \
1314
echo "generating $$outname ..."; \
1315
makeinfo --html --number-sections --no-split \
1316
-I $(srcdir)/gcc/doc/include -I `dirname $${manual}` \
1317
-I $(srcdir)/gcc/p/doc \
1318
-I $(srcdir)/gcc/p/doc/generated \
1319
-I $(builddir)/gcc \
1320
-I $(buildlibdir)/libquadmath \
1321
-o $(PWD)/html/$${outname} \
1325
# start the script only on architectures known to have slow autobuilders ...
1326
logwatch_archs := alpha arm m68k mips mipsel sparc
1327
ifeq ($(DEB_HOST_GNU_CPU), $(findstring $(DEB_HOST_GNU_CPU),$(logwatch_archs)))
1328
start_logwatch = yes
1330
ifeq ($(DEB_HOST_GNU_SYSTEM),gnu)
1331
start_logwatch = yes
1334
stamps/mauve-build: stamps/build
1337
ifeq ($(with_mauve_check),yes)
1338
tar xf $(wildcard /usr/src/mauve*.tar.*)
1343
&& PATH=$(CURDIR)/$(sdkimg)/bin:$$PATH ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE)
1344
PATH=$(CURDIR)/$(sdkimg)/bin:$$PATH $(MAKE) -C mauve
1348
stamps/mauve-check: stamps/build stamps/mauve-build
1349
ifeq ($(with_mauve_check),yes)
1351
JAVA_HOME=$(CURDIR)/$(sdkimg) \
1352
PATH=$(CURDIR)/$(sdkimg)/bin:$$PATH \
1353
xvfb-run -s "-extension GLX" java Harness \
1354
-vm $(CURDIR)/$(sdkimg)/bin/java \
1355
-file $(CURDIR)/debian/mauve_tests \
1356
-timeout 30000 2>&1 \
1360
echo "mauve testsuite not run for this build" > mauve/mauve_output
1364
check: $(check_stamp) # $(if $(filter yes, $(with_java)),stamps/05-build-mauve-stamp) #$(check_inst_stamp)
1365
$(check_stamp): $(build_stamp) $(build_locale_stamp)
1367
rm -f $(builddir)/runcheck*
1369
-chmod 755 $(srcdir)/contrib/test_summary
1371
: # needed for the plugin tests to succeed
1372
ln -sf gcc $(builddir)/prev-gcc
1373
ln -sf $(DEB_TARGET_GNU_TYPE) $(builddir)/prev-$(DEB_TARGET_GNU_TYPE)
1375
ifneq ($(with_common_libs),yes)
1376
ifeq ($(with_cxx),yes)
1377
: # libstdc++6 built from newer gcc-4.x source, run testsuite against the installed lib
1379
sed 's/-L[^ ]*//g' $(buildlibdir)/libstdc++-v3/scripts/testsuite_flags \
1380
> $(buildlibdir)/libstdc++-v3/scripts/testsuite_flags.installed
1383
for d in $(buildlibdir)/libstdc++-v3/testsuite; do \
1384
echo "Running testsuite in $$d ..."; \
1389
DEJAGNU_TIMEOUT=$(DEJAGNU_TIMEOUT) \
1391
$(MAKE) -k -C $$d $(NJOBS) check $(RUNTESTFLAGS); \
1392
done 2>&1 | tee test-protocol2
1394
BOOT_CFLAGS="$(BOOT_CFLAGS)" \
1395
$(srcdir)/contrib/test_summary -m "$(S_EMAIL)" > raw-test-summary
1397
sed -n '/^Mail/s/.*"\([^"][^"]*\)".*/\1/p' raw-test-summary; \
1398
awk '/^cat/, /^EOF/' raw-test-summary | grep -v EOF; \
1399
) > libstdc++-test-summary
1400
echo 'BEGIN installed libstdc++-v3 test-summary'
1401
cat libstdc++-test-summary
1402
echo 'END installed libstdc++-v3 test-summary'
1403
find $(buildlibdir)/libstdc++-v3/testsuite -name '*.log' -o -name '*.sum' \
1408
ifeq ($(start_logwatch),yes)
1409
: # start logwatch script for regular output during test runs
1410
chmod +x debian/logwatch.sh
1411
-debian/logwatch.sh -t 900 -p $(builddir)/logwatch.pid \
1412
-m '\ntestsuite still running ...\n' \
1414
$(builddir)/gcc/testsuite/gcc/gcc.log \
1415
$(builddir)/gcc/testsuite/g++/g++.log \
1416
$(builddir)/gcc/testsuite/gfortran/gfortran.log \
1417
$(builddir)/gcc/testsuite/objc/objc.log \
1418
$(builddir)/gcc/testsuite/obj-c++/obj-c++.log \
1419
$(builddir)/gcc/testsuite/gnat/gnat.log \
1420
$(builddir)/gcc/testsuite/ada/acats/acats.log \
1421
$(builddir)/gcc/testsuite/gfortran/gfortran.log \
1422
$(builddir)/gcc/p/test/test_log \
1423
$(buildlibdir)/libstdc++-v3/testsuite/libstdc++.log \
1424
$(buildlibdir)/libjava/testsuite/libjava.log \
1425
$(buildlibdir)/libmudflap/testsuite/libmudflap.log \
1426
$(buildlibdir)/libgomp/testsuite/libgomp.log \
1427
$(buildlibdir)/libffi/testsuite/libffi.log \
1431
ifeq ($(with_ada),yes)
1432
chmod +x debian/acats-killer.sh
1433
-debian/acats-killer.sh -p $(builddir)/acats-killer.pid \
1434
$(builddir)/gcc/testsuite/ada/acats/acats.log \
1435
$(builddir)/gcc/testsuite/g++.log \
1441
for d in $(checkdirs); do \
1442
echo "Running testsuite in $$d ..."; \
1446
EXTRA_TEST_PFLAGS=-g0 \
1447
DEJAGNU_TIMEOUT=$(DEJAGNU_TIMEOUT) \
1449
$(MAKE) -k -C $$d $(NJOBS) check $(RUNTESTFLAGS); \
1450
done 2>&1 | tee test-protocol
1452
-ps aux | fgrep logwatch | fgrep -v fgrep
1453
-if [ -f $(builddir)/logwatch.pid ]; then \
1454
kill -1 `cat $(builddir)/logwatch.pid`; \
1456
kill -9 `cat $(builddir)/logwatch.pid`; \
1457
rm -f $(builddir)/logwatch.pid; \
1459
-ps aux | fgrep logwatch | fgrep -v fgrep
1461
ifeq ($(with_ada),yes)
1462
-if [ -f $(builddir)/acats-killer.pid ]; then \
1463
kill -1 `cat $(builddir)/acats-killer.pid`; \
1465
kill -9 `cat $(builddir)/acats-killer.pid`; \
1466
rm -f $(builddir)/acats-killer.pid; \
1470
: # running the libjava testsuite alone is missing this information
1471
$(builddir)/gcc/xgcc -B$(builddir)/gcc/ -v > $(builddir)/compiler_version.sum 2>&1
1473
if [ -x $(srcdir)/contrib/test_summary ]; then \
1474
rm -f test-summary; \
1477
echo '' > ts-include; \
1478
echo '' >> ts-include; \
1479
if [ -f $(builddir)/gcc/.bad_compare ]; then \
1480
echo 'Bootstrap comparison failure:' >> ts-include; \
1481
cat $(builddir)/gcc/.bad_compare >> ts-include; \
1482
echo '' >> ts-include; \
1483
echo '' >> ts-include; \
1485
echo "Build Dependencies:" >> ts-include; \
1486
dpkg -l g++-* binutils* `echo '$(LIBC_DEP)' | awk '{print $$1}'` \
1487
libgmp*-dev libmpfr-dev libmpc-dev libisl-dev libcloog-isl-dev \
1488
| fgrep -v '<none>' >> ts-include; \
1489
echo '' >> ts-include; \
1490
cat ../$(patch_stamp) >> ts-include; \
1491
BOOT_CFLAGS="$(BOOT_CFLAGS)" \
1492
$(srcdir)/contrib/test_summary \
1493
-i ts-include -m "$(S_EMAIL)" \
1494
) > raw-test-summary; \
1495
if [ -n "$(testsuite_tarball)" ]; then \
1496
echo "Test suite used: $(testsuite_srcdir)" > test-summary; \
1497
echo " Do not interpret the results on its own" >> test-summary; \
1498
echo " but compare them with the results from" >> test-summary; \
1499
echo " the gcc-snapshot package." >> test-summary; \
1501
sed -n '/^Mail/s/.*"\([^"][^"]*\)".*/\1/p' raw-test-summary \
1503
awk '/^cat/, /^EOF/' raw-test-summary | grep -v EOF >> test-summary; \
1504
if [ -f bootstrap-summary -a "$(bootstrap_target)" != profiledbootstrap ]; then \
1505
echo '' >> test-summary; \
1506
cat bootstrap-summary >> test-summary; \
1508
echo 'BEGIN test-summary'; \
1510
echo 'END test-summary'; \
1512
ifeq ($(with_d),yes)
1513
: # the D test failures for the non-default multilibs are known, ignore them
1514
egrep -v '^(FAIL|UNRESOLVED): (runnable|fail_c|comp)' test-summary > test-summary.tmp
1515
mv -f test-summary.tmp test-summary
1518
touch $(check_stamp)
1520
$(check_inst_stamp): $(check_stamp)
1521
rm -f test-inst-protocol
1523
ifeq ($(start_logwatch),yes)
1524
: # start logwatch script for regular output during test runs
1525
chmod +x debian/logwatch.sh
1526
-debian/logwatch.sh -t 900 -p $(builddir)/logwatch-inst.pid \
1527
-m '\ntestsuite (3.3) still running ...\n' \
1528
test-inst-protocol \
1529
check-inst/{gcc,g++,g77,objc}.log \
1536
echo "Running testsuite ..."
1540
EXTRA_TEST_PFLAGS=-g0 \
1541
DEJAGNU_TIMEOUT=$(DEJAGNU_TIMEOUT) \
1542
cd check-inst && $(srcdir)/contrib/test_installed \
1543
--with-gcc=gcc-3.3 --with-g++=g++-3.3 --with-g77=g77-3.3 \
1544
2>&1 | tee test-inst-protocol
1546
-ps aux | fgrep logwatch | fgrep -v fgrep
1547
if [ -f $(builddir)/logwatch-inst.pid ]; then \
1548
kill -1 `cat $(builddir)/logwatch-inst.pid`; \
1552
-ps aux | fgrep logwatch | fgrep -v fgrep
1554
-chmod 755 $(srcdir)/contrib/test_summary
1555
if [ -x $(srcdir)/contrib/test_summary ]; then \
1556
rm -f test-inst-summary; \
1559
echo '' > ts-include; \
1560
echo '' >> ts-include; \
1561
echo "Build Dependencies:" >> ts-include; \
1562
dpkg -l g++-* binutils* `echo '$(LIBC_DEP)' | awk '{print $$1}'` \
1563
libgmp*-dev libmpfr-dev libmpc-dev libisl*-dev libcloog-isl-dev \
1564
| fgrep -v '<none>' >> ts-include; \
1565
echo '' >> ts-include; \
1566
echo 'Results for the installed GCC-3.3 compilers' >> ts-include; \
1567
$(srcdir)/contrib/test_summary \
1568
-i ts-include -m "$(S_EMAIL)" \
1569
) > raw-test-inst-summary; \
1570
sed -n '/^Mail/s/.*"\([^"][^"]*\)".*/\1/p' raw-test-inst-summary \
1571
>> test-inst-summary; \
1572
awk '/^cat/, /^EOF/' raw-test-inst-summary \
1573
| grep -v EOF >> test-inst-summary; \
1574
echo 'BEGIN test-installed-summary'; \
1575
cat test-inst-summary; \
1576
echo 'END test-installed-summary'; \
1579
chmod 755 debian/reduce-test-diff.awk
1580
if diff -u test-inst-summary test-summary \
1581
| debian/reduce-test-diff.awk > diff-summary; \
1583
mv -f diff-summary testsuite-comparision; \
1586
echo "WARNING: New failures in gcc-3.4 compared to gcc-3.3"; \
1589
) > testsuite-comparision; \
1590
rm -f diff-summary; \
1592
touch $(check_inst_stamp)
1594
clean: debian/control
1597
rm -f *-summary *-protocol testsuite-comparision summary-diff
1598
if [ -f $(srcdir)/gcc/p/config-lang.in.debian ]; then \
1599
mv -f $(srcdir)/gcc/p/config-lang.in.debian $(srcdir)/gcc/p/config-lang.in; \
1601
rm -f $(srcdir)/gcc/po/*.gmo
1602
rm -f debian/lib{gcc,gcj,objc,stdc++}{-v3,[0-9]}*.{{pre,post}{inst,rm},shlibs}
1603
fs=`echo debian/*BV* debian/*GCJ* debian/*CXX* debian/*LC* debian/*MF* | sort -u`; \
1605
[ -f $$f ] || continue; \
1607
| sed 's/BV/$(BASE_VERSION)/;s/CXX/$(CXX_SONAME)/;s/LGCJ/$(PKG_LIBGCJ_EXT)/;s/GCJ/$(PKG_GCJ_EXT)/;s/LC/$(GCC_SONAME)/;s/MF/$(MUDFLAP_SONAME)/;s/-CRB/$(cross_bin_arch)/;s/\.in$$//'); \
1610
find debian -maxdepth 1 -name '*.symbols' -type l | xargs -r rm -f
1611
rm -f debian/gcc-{XX,ar,nm,ranlib}-$(BASE_VERSION).1
1612
rm -f debian/shlibs.local debian/substvars.local
1613
rm -f debian/*.debhelper
1614
-[ -d debian/bugs ] && $(MAKE) -C debian/bugs clean
1615
rm -f debian/README.libstdc++-baseline debian/README.Bugs debian/README.Debian.$(DEB_TARGET_ARCH)
1616
rm -f debian/lib*gcj-bc.shlibs
1617
rm -rf bin locales share
1621
$(cross_clean) dh_clean
1623
# -----------------------------------------------------------------------------
1624
# some abbrevations for the package names and directories;
1625
# p_XXX is the package name, d_XXX is the package directory
1626
# these macros are only used in the binary-* targets.
1628
ifeq ($(versioned_packages),yes)
1629
pkg_ver := -$(BASE_VERSION)
1632
ifneq ($(DEB_CROSS),yes)
1633
p_base = gcc$(pkg_ver)-base
1634
p_xbase = gcc$(pkg_ver)-base
1635
p_gcc = gcc$(pkg_ver)
1636
p_cpp = cpp$(pkg_ver)
1637
p_cppd = cpp$(pkg_ver)-doc
1638
p_cxx = g++$(pkg_ver)
1639
p_doc = gcc$(pkg_ver)-doc
1640
p_lgcc = libgcc$(GCC_SONAME)
1642
# only triggered if DEB_CROSS set
1643
ifneq ($(with_deps_on_target_arch_pkgs),yes)
1644
p_base = gcc$(pkg_ver)$(cross_bin_arch)-base
1645
p_xbase = gcc$(pkg_ver)$(cross_bin_arch)-base
1647
p_base = gcc$(pkg_ver)-base
1650
p_cpp = cpp$(pkg_ver)$(cross_bin_arch)
1651
p_gcc = gcc$(pkg_ver)$(cross_bin_arch)
1652
p_cxx = g++$(pkg_ver)$(cross_bin_arch)
1654
p_hppa64 = gcc$(pkg_ver)-hppa64
1657
d_base = debian/$(p_base)
1658
d_xbase = debian/$(p_xbase)
1659
d_gcc = debian/$(p_gcc)
1660
d_cpp = debian/$(p_cpp)
1661
d_cppd = debian/$(p_cppd)
1662
d_cxx = debian/$(p_cxx)
1663
d_doc = debian/$(p_doc)
1664
d_lgcc = debian/$(p_lgcc)
1665
d_hppa64= debian/$(p_hppa64)
1667
d_neon = debian/tmp-neon
1669
common_substvars = \
1670
$(shell awk "{printf \"'-V%s' \", \$$0}" debian/substvars.local)
1672
ifeq ($(DEB_CROSS),yes)
1673
lib_binaries := indep_binaries
1675
lib_binaries := arch_binaries
1678
# ---------------------------------------------------------------------------
1680
ifeq ($(single_package),yes)
1681
include debian/rules.d/binary-snapshot.mk
1684
ifneq ($(DEB_CROSS),yes)
1685
ifeq ($(with_source),yes)
1686
include debian/rules.d/binary-source.mk
1690
ifneq ($(BACKPORT),true)
1691
ifeq ($(with_gccxbase),yes)
1692
include debian/rules.d/binary-base.mk
1695
ifeq ($(with_gccbase),yes)
1696
include debian/rules.d/binary-base.mk
1699
# always include to get some definitions
1700
include debian/rules.d/binary-libgcc.mk
1702
ifeq ($(with_libqmath),yes)
1703
include debian/rules.d/binary-libquadmath.mk
1706
ifeq ($(with_libgmath),yes)
1707
include debian/rules.d/binary-libgccmath.mk
1710
ifeq ($(with_libgomp),yes)
1711
include debian/rules.d/binary-libgomp.mk
1714
ifeq ($(with_libitm),yes)
1715
include debian/rules.d/binary-libitm.mk
1718
ifeq ($(with_libatomic),yes)
1719
include debian/rules.d/binary-libatomic.mk
1722
ifeq ($(with_libbacktrace),yes)
1723
include debian/rules.d/binary-libbacktrace.mk
1726
ifeq ($(with_cdev),yes)
1727
include debian/rules.d/binary-cpp.mk
1730
ifeq ($(with_fixincl),yes)
1731
include debian/rules.d/binary-fixincl.mk
1734
ifeq ($(with_mudflap),yes)
1735
include debian/rules.d/binary-libmudflap.mk
1738
ifeq ($(with_libssp),yes)
1739
include debian/rules.d/binary-libssp.mk
1742
ifeq ($(with_objcxx),yes)
1743
include debian/rules.d/binary-objcxx.mk
1746
ifeq ($(with_objc),yes)
1747
include debian/rules.d/binary-objc.mk
1748
include debian/rules.d/binary-libobjc.mk
1751
ifeq ($(with_go),yes)
1752
include debian/rules.d/binary-go.mk
1755
# include before cxx
1756
ifeq ($(with_java),yes)
1757
include debian/rules.d/binary-java.mk
1760
ifeq ($(with_cxxdev),yes)
1761
include debian/rules.d/binary-cxx.mk
1763
ifeq ($(with_cxx),yes)
1764
include debian/rules.d/binary-libstdcxx.mk
1767
ifeq ($(with_libasan),yes)
1768
include debian/rules.d/binary-libasan.mk
1771
ifeq ($(with_libtsan),yes)
1772
include debian/rules.d/binary-libtsan.mk
1775
ifeq ($(with_f77),yes)
1776
include debian/rules.d/binary-f77.mk
1779
ifeq ($(with_fortran),yes)
1780
include debian/rules.d/binary-fortran.mk
1783
ifeq ($(with_ada),yes)
1784
include debian/rules.d/binary-ada.mk
1787
ifeq ($(with_d),yes)
1788
include debian/rules.d/binary-d.mk
1791
ifeq ($(with_libnof),yes)
1792
ifeq ($(DEB_TARGET_GNU_CPU),powerpc)
1793
include debian/rules.d/binary-nof.mk
1797
ifeq ($(with_softfloat),yes)
1798
include debian/rules.d/binary-softfloat.mk
1801
# gcc must be moved/built after g77 and g++
1802
ifeq ($(with_cdev),yes)
1803
include debian/rules.d/binary-gcc.mk
1806
ifeq ($(with_hppa64),yes)
1807
include debian/rules.d/binary-hppa64.mk
1810
ifeq ($(with_neon),yes)
1811
include debian/rules.d/binary-neon.mk
1816
endif # ($(single_package),yes)
1818
# ----------------------------------------------------------------------
1819
install: $(install_dependencies)
1821
$(install_dummy_stamp): $(build_dummy_stamp)
1822
touch $(install_dummy_stamp)
1824
$(install_snap_stamp): $(build_dependencies)
1829
: # Install directories
1833
ifeq ($(with_hppa64),yes)
1836
$(MAKE) -C $(builddir_hppa64) \
1839
$(LDFLAGS_TO_PASS) \
1840
DESTDIR=$(PWD)/$(d) \
1843
ls -l $(d)/$(PF)/bin
1844
if [ ! -x $(d)/$(PF)/bin/hppa64-linux-gnu-gcc ]; then \
1845
mv $(d)/$(PF)/bin/hppa64-linux-gnu-gcc-4* $(d)/$(PF)/bin/hppa64-linux-gnu-gcc; \
1847
rm -f $(d)/$(PF)/bin/hppa64-linux-gnu-gcc-4*; \
1850
for i in ar nm ranlib; do \
1851
cp debian/gcc-$$i$(pkg_ver).1 $(d)/$(PF)/share/man/man1/$(cmd_prefix)gcc-$$i$(pkg_ver).1; \
1854
: # remove files not needed from the hppa64 build
1855
rm -rf $(d)/$(PF)/share/info
1856
rm -rf $(d)/$(PF)/share/man
1857
rm -f $(d)/$(PF)/$(libdir)/libiberty.a
1858
rm -f $(d)/$(PF)/bin/*{gcov,gccbug,gcc}
1860
rm -rf $(d)/$(PF)/hppa64-linux-gnu/include
1861
rm -rf $(d)/$(PF)/hppa64-linux-gnu/lib
1863
cd $(d)/$(PF)/$(libdir)/gcc/hppa64-linux-gnu/$(versiondir)/include-fixed; \
1866
README|features.h|syslimits.h|limits.h) ;; \
1867
linux|$(TARGET_ALIAS)) ;; \
1868
$(subst $(DEB_TARGET_GNU_CPU),$(biarch_cpu),$(TARGET_ALIAS))) ;; \
1869
*) echo "remove include-fixed/$$i"; rm -rf $$i; \
1874
: # Work around PR lto/41569
1875
ln -sf gcc $(builddir)/prev-gcc
1876
ln -sf $(DEB_TARGET_GNU_TYPE) $(builddir)/prev-$(DEB_TARGET_GNU_TYPE)
1878
: # Install everything
1881
$(MAKE) -C $(builddir) \
1883
$(LDFLAGS_TO_PASS) \
1884
DESTDIR=$(PWD)/$(d) \
1885
infodir=/$(PF)/share/info \
1886
mandir=/$(PF)/share/man \
1889
ls -l $(d)/$(PF)/bin
1890
if [ ! -x $(d)/$(PF)/bin/$(TARGET_ALIAS)-gcc ]; then \
1891
mv $(d)/$(PF)/bin/$(TARGET_ALIAS)-gcc-4* $(d)/$(PF)/bin/$(TARGET_ALIAS)-gcc; \
1893
rm -f $(d)/$(PF)/bin/$(TARGET_ALIAS)-gcc-4*; \
1896
cd $(d)/$(gcc_lib_dir)/include-fixed; \
1899
README|features.h|syslimits.h|limits.h) ;; \
1900
linux|$(TARGET_ALIAS)) ;; \
1901
$(subst $(DEB_TARGET_GNU_CPU),$(biarch_cpu),$(TARGET_ALIAS))) ;; \
1902
*) echo "remove include-fixed/$$i"; rm -rf $$i; \
1906
ifneq ($(configured_libdir),$(libdir))
1907
for i in debug go pkgconfig '*.so' '*.so.*' '*.a' '*.la' '*.py' '*.spec'; do \
1908
mv $(d)/$(PF)/$(configured_libdir)/$$i \
1909
$(d)/$(PF)/$(libdir)/. || true; \
1913
# FIXME: libjava/classpath not correctly patched
1914
ifeq ($(with_java),yes)
1915
-if [ -d $(d)/$(PF)/lib/gcj-$(GCC_VERSION)-$(GCJ_SONAME) ]; then \
1916
ls -l $(d)/$(PF)/lib/gcj-$(GCC_VERSION)-$(GCJ_SONAME); \
1917
mv $(d)/$(PF)/lib/gcj-$(GCC_VERSION)-$(GCJ_SONAME)/* \
1918
$(d)/$(PF)/lib/gcj-$(BASE_VERSION)-$(GCJ_SONAME)/; \
1919
rmdir $(d)/$(PF)/lib/gcj-$(GCC_VERSION)-$(GCJ_SONAME); \
1922
ln -sf libgcj.so.$(GCJ_SONAME).0.0 $(d)/$(PF)/lib/libgcj_bc.so.1.0.0
1924
install -m 755 $(d)/$(PF)/lib/libgcj_bc.so.1 \
1925
$(d)/$(gcc_lib_dir)/libgcj_bc.so
1926
$(builddir)/gcc/xgcc -B$(builddir)/gcc/ -shared -fpic -xc /dev/null \
1927
-o build/libgcj.so -Wl,-soname,libgcj.so.$(GCJ_SONAME) -nostdlib
1928
$(builddir)/gcc/xgcc -B$(builddir)/gcc/ -shared -fpic \
1929
$(srcdir)/libjava/libgcj_bc.c \
1930
-o $(d)/$(gcc_lib_dir)/libgcj_bc.so \
1931
-Wl,-soname,libgcj_bc.so.1 $(builddir)/libgcj.so -shared-libgcc
1935
if [ -d $(d)/usr/man/man1 ]; then \
1936
mv $(d)/usr/man/man1/* $(d)/usr/share/man/man1/; \
1939
chmod 755 debian/dh_*
1940
touch $(install_snap_stamp)
1942
$(install_stamp): $(build_stamp)
1945
dh_clean -k -N$(p_hppa64)
1947
if [ -f $(binary_stamp)-hppa64 ]; then \
1948
mv $(binary_stamp)-hppa64 saved-stamp-hppa64; \
1950
rm -f $(binary_stamp)*
1951
if [ -f saved-stamp-hppa64 ]; then \
1952
mv saved-stamp-hppa64 $(binary_stamp)-hppa64; \
1955
: # Install directories
1957
mkdir -p $(d)/$(libdir) $(d)/$(PF) $(d)/$(PF)/$(libdir)/debug
1958
ifeq ($(biarch32),yes)
1959
mkdir -p $(d)/$(PF)/lib32/debug
1961
ifeq ($(biarch64),yes)
1962
mkdir -p $(d)/$(PF)/lib64/debug
1964
ifeq ($(biarchn32),yes)
1965
mkdir -p $(d)/$(PF)/$(libn32)/debug
1967
ifeq ($(biarchx32),yes)
1968
mkdir -p $(d)/$(PF)/libx32/debug
1971
ifneq (,$(filter $(DEB_TARGET_GNU_CPU),x86_64 sparc64 s390x powerpc64))
1972
ifneq ($(DEB_TARGET_ARCH),x32)
1973
: # link lib to lib64 and $(PF)/lib to $(PF)/lib64
1974
: # (this works when CONFARGS contains '--disable-multilib')
1975
ln -s $(configured_libdir) $(d)/lib64
1976
mkdir -p $(d)/$(PF)/$(configured_libdir)
1977
ln -s $(configured_libdir) $(d)/$(PF)/lib64
1980
ifeq ($(DEB_TARGET_ARCH),x32)
1981
: # link lib to libx32 and $(PF)/lib to $(PF)/libx32
1982
ln -s $(configured_libdir) $(d)/libx32
1983
mkdir -p $(d)/$(PF)/$(configured_libdir)
1984
ln -s $(configured_libdir) $(d)/$(PF)/libx32
1987
: # Work around PR lto/41569
1988
ln -sf gcc $(builddir)/prev-gcc
1990
: # Install everything
1993
$(MAKE) -C $(builddir) \
1995
$(LDFLAGS_TO_PASS) \
1996
DESTDIR=$(PWD)/$(d) \
1997
infodir=/$(PF)/share/info \
1998
mandir=/$(PF)/share/man \
2001
ifneq ($(configured_libdir),$(libdir))
2002
for i in debug go pkgconfig '*.so' '*.so.*' '*.a' '*.la' '*.o' '*.py' '*.spec'; do \
2003
mv $(d)/$(PF)/$(configured_libdir)/$$i \
2004
$(d)/$(PF)/$(libdir)/. || true; \
2008
ifeq ($(with_libcxxdbg),yes)
2009
: # FIXME: the libstdc++ gdb.py file is installed with a wrong name
2010
for i in $$(find $(d)/$(PF) -name libstdc++_pic.a-gdb.py); do \
2011
[ -f $$i ] || continue; \
2012
d=$$(dirname $$i); \
2013
b=$$(basename $$i); \
2014
t=$$(cd $$d; echo libstdc++.so.*.*.*)-gdb.py; \
2019
# FIXME: libjava/classpath not correctly patched
2020
ifeq ($(with_java),yes)
2021
-if [ -d $(d)/$(PF)/lib/gcj-$(GCC_VERSION)-$(GCJ_SONAME) ]; then \
2022
ls -l $(d)/$(PF)/lib/gcj-$(GCC_VERSION)-$(GCJ_SONAME); \
2023
mv $(d)/$(PF)/lib/gcj-$(GCC_VERSION)-$(GCJ_SONAME)/* \
2024
$(d)/$(PF)/lib/gcj-$(BASE_VERSION)-$(GCJ_SONAME)/; \
2025
rmdir $(d)/$(PF)/lib/gcj-$(GCC_VERSION)-$(GCJ_SONAME); \
2029
: # remove rpath settings from binaries and shared libs
2030
for i in $$(chrpath -k $(d)/$(PF)/bin/* $(d)/$(PF)/lib*/lib*.so.* \
2031
$(if $(filter $(with_multiarch_lib),yes), \
2032
$(d)/$(PF)/lib/$(DEB_HOST_MULTIARCH)/lib*.so.*) \
2033
$(d)/$(PF)/lib*/gcj$(pkg_ver)*/lib*.so.* \
2034
2>/dev/null | awk -F: '/RPATH=/ {print $$1}'); \
2036
case "$$i" in ecj1|*gij-*|*libjawt*|*libjvm*) continue; esac; \
2037
[ -h $$i ] && continue; \
2038
chrpath --delete $$i; \
2039
echo "removed RPATH: $$i"; \
2042
: # remove '*.la' and '*.lai' files, not shipped in any package.
2043
find $(d) -name '*.la' -o -name '*.lai' | xargs -r rm -f
2045
ifneq ($(with_libgnat),yes)
2046
rm -f $(d)/$(gcc_lib_dir)/adalib/lib*.so*
2049
ifeq ($(GFDL_INVARIANT_FREE),yes)
2050
for i in gcc gcov; do \
2051
I=`echo $$i | tr a-z A-Z`; \
2052
sed -e "s/@NAME@/$$I$(pkg_ver)/g" -e "s/@name@/$$i$(pkg_ver)/g" \
2053
debian/dummy-man.1 > $(d)/$(PF)/share/man/man1/$$i.1; \
2056
ifeq ($(with_fortran),yes)
2058
I=`echo $$i | tr a-z A-Z`; \
2059
sed -e "s/@NAME@/$$I$(pkg_ver)/g" -e "s/@name@/$$i$(pkg_ver)/g" \
2060
debian/dummy-man.1 > $(d)/$(PF)/share/man/man1/$$i.1; \
2063
ifeq ($(with_java),yes)
2064
for i in gcj gcjh gij jv-convert jv-scan jcf-dump grmic grmiregistry; \
2066
I=`echo $$i | tr a-z A-Z`; \
2067
sed -e "s/@NAME@/$$I$(pkg_ver)/g" -e "s/@name@/$$i$(pkg_ver)/g" \
2068
debian/dummy-man.1 > $(d)/$(PF)/share/man/man1/$$i.1; \
2073
# ifeq ($(with_ada),yes)
2074
# : # rename files (versioned ada binaries)
2076
# mv $(d)/$(PF)/bin/$$i $(d)/$(PF)/bin/$$i-$(GNAT_VERSION); \
2077
# mv $(d)/$(PF)/share/man/man1/$$i.1 \
2078
# $(d)/$(PF)/share/man/man1/$$i-$(GNAT_VERSION).1; \
2080
# for i in $(GNAT_TOOLS); do \
2081
# mv $(d)/$(PF)/bin/$$i $(d)/$(PF)/bin/$$i-$(GNAT_VERSION); \
2085
ifeq ($(DEB_CROSS)-$(multilib),yes-yes)
2086
ifneq ($(DEB_STAGE),stage1)
2087
ifeq ($(DEB_TARGET_ARCH)-$(biarch64),s390-yes)
2088
: # s390 64bit stuff happens to be in s390x-linux-gnu/lib64/
2089
mkdir -p $(d)/$(PF)/s390-linux-gnu/lib64
2090
cp -a $(d)/$(PF)/s390x-linux-gnu/lib64/* $(d)/$(PF)/s390-linux-gnu/lib64/
2092
ifeq ($(DEB_TARGET_ARCH)-$(biarch64),powerpc-yes)
2093
: # ppc 64bit build slaps libgcc and libstdc++ to powerpc64-linux-gnu
2094
mkdir -p $(d)/$(PF)/powerpc-linux-gnu/lib64
2095
cp -a $(d)/$(PF)/powerpc64-linux-gnu/lib64/* $(d)/$(PF)/powerpc-linux-gnu/lib64/
2100
for i in ar nm ranlib; do \
2101
cp debian/gcc-$$i$(pkg_ver).1 $(d)/$(PF)/share/man/man1/$(cmd_prefix)gcc-$$i$(pkg_ver).1; \
2104
chmod 755 debian/dh_*
2106
# tar cf tmp.tar debian/tmp
2108
touch $(install_stamp)
2110
$(install_hppa64_stamp): $(build_hppa64_stamp)
2114
mkdir -p $(d_hppa64)/$(PF)
2117
$(MAKE) -C $(builddir_hppa64) \
2120
$(LDFLAGS_TO_PASS) \
2121
DESTDIR=$(PWD)/$(d_hppa64) \
2124
ifeq ($(versioned_packages),yes)
2125
mv $(d_hppa64)/$(PF)/bin/hppa64-linux-gnu-cpp \
2126
$(d_hppa64)/$(PF)/bin/hppa64-linux-gnu-cpp$(pkg_ver)
2129
ifneq ($(single_package),yes)
2130
: # remove files not needed
2131
rm -rf $(d_hppa64)/$(PF)/info $(d_hppa64)/$(PF)/share/info
2132
rm -rf $(d_hppa64)/$(PF)/man $(d_hppa64)/$(PF)/share/man
2133
rm -rf $(d_hppa64)/$(PF)/$(libdir)/gcc/hppa64-linux-gnu/$(GCC_VERSION)/plugin
2134
rm -f $(d_hppa64)/$(PF)/$(libdir)/libiberty.a
2135
rm -f $(d_hppa64)/$(PF)/bin/*{gcov,gccbug,gcc}
2137
rm -rf $(d_hppa64)/$(PF)/hppa64-linux-gnu/include
2138
rm -rf $(d_hppa64)/$(PF)/hppa64-linux-gnu/lib
2139
rm -rf $(d_hppa64)/$(hppa64libexecdir)/gcc/hppa64-linux-gnu/$(GCC_VERSION)/install-tools
2142
touch $(install_hppa64_stamp)
2144
$(install_neon_stamp): $(build_neon_stamp)
2148
mkdir -p $(d_neon)/$(PF)
2151
$(MAKE) -C $(builddir_neon) \
2154
$(LDFLAGS_TO_PASS) \
2155
DESTDIR=$(PWD)/$(d_neon) \
2157
touch $(install_neon_stamp)
2159
# ----------------------------------------------------------------------
2160
# Build architecture-dependent files here.
2161
#binary-arch: build install $(foreach i,$(arch_binaries),$(binary_stamp)-$(i))
2162
binary-arch: $(foreach i,$(arch_binaries),$(binary_stamp)-$(i))
2163
ifeq ($(with_check),yes)
2165
# : # Send Email about sucessfull build.
2166
# # cat raw-test-summary | sh; echo "Sent mail to $(S_EMAIL)"
2169
# ----------------------------------------------------------------------
2170
# Build architecture-independent files here.
2171
#binary-indep: build install $(foreach i,$(indep_binaries),$(binary_stamp)-$(i))
2172
binary-indep: $(foreach i,$(indep_binaries),$(binary_stamp)-$(i))
2175
@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
2177
binary: binary-indep binary-arch
2178
.PHONY: build clean binary-indep binary-arch binary