summaryrefslogtreecommitdiff
path: root/debian/rules.d
diff options
context:
space:
mode:
authordoko <doko@6ca36cf4-e1d1-0310-8c6f-e303bb2178ca>2015-01-20 11:55:49 +0000
committerdoko <doko@6ca36cf4-e1d1-0310-8c6f-e303bb2178ca>2015-01-20 11:55:49 +0000
commit227ef40ee3f5b76329437be96fc7306be872c5fa (patch)
tree3bacf37cc9d3fedc71441072ed87cfe825a9887b /debian/rules.d
downloadgcc-5-227ef40ee3f5b76329437be96fc7306be872c5fa.tar.gz
- branch for GCC 5
git-svn-id: svn://anonscm.debian.org/gcccvs/branches/sid/gcc-5@7781 6ca36cf4-e1d1-0310-8c6f-e303bb2178ca
Diffstat (limited to 'debian/rules.d')
-rw-r--r--debian/rules.d/binary-ada.mk378
-rw-r--r--debian/rules.d/binary-base.mk49
-rw-r--r--debian/rules.d/binary-cpp.mk86
-rw-r--r--debian/rules.d/binary-cxx.mk128
-rw-r--r--debian/rules.d/binary-d.mk173
-rw-r--r--debian/rules.d/binary-fixincl.mk47
-rw-r--r--debian/rules.d/binary-fortran.mk292
-rw-r--r--debian/rules.d/binary-gcc.mk307
-rw-r--r--debian/rules.d/binary-go.mk312
-rw-r--r--debian/rules.d/binary-hppa64.mk32
-rw-r--r--debian/rules.d/binary-java.mk750
-rw-r--r--debian/rules.d/binary-libasan.mk83
-rw-r--r--debian/rules.d/binary-libatomic.mk74
-rw-r--r--debian/rules.d/binary-libcilkrts.mk82
-rw-r--r--debian/rules.d/binary-libgcc.mk381
-rw-r--r--debian/rules.d/binary-libgccmath.mk141
-rw-r--r--debian/rules.d/binary-libgomp.mk74
-rw-r--r--debian/rules.d/binary-libitm.mk74
-rw-r--r--debian/rules.d/binary-liblsan.mk82
-rw-r--r--debian/rules.d/binary-libobjc.mk168
-rw-r--r--debian/rules.d/binary-libquadmath.mk74
-rw-r--r--debian/rules.d/binary-libssp.mk181
-rw-r--r--debian/rules.d/binary-libstdcxx.mk548
-rw-r--r--debian/rules.d/binary-libtsan.mk84
-rw-r--r--debian/rules.d/binary-libubsan.mk83
-rw-r--r--debian/rules.d/binary-libvtv.mk82
-rw-r--r--debian/rules.d/binary-neon.mk53
-rw-r--r--debian/rules.d/binary-nof.mk56
-rw-r--r--debian/rules.d/binary-objc.mk70
-rw-r--r--debian/rules.d/binary-objcxx.mk65
-rw-r--r--debian/rules.d/binary-snapshot.mk229
-rw-r--r--debian/rules.d/binary-softfloat.mk36
-rw-r--r--debian/rules.d/binary-source.mk56
33 files changed, 5330 insertions, 0 deletions
diff --git a/debian/rules.d/binary-ada.mk b/debian/rules.d/binary-ada.mk
new file mode 100644
index 0000000..d27c102
--- /dev/null
+++ b/debian/rules.d/binary-ada.mk
@@ -0,0 +1,378 @@
+ifeq ($(with_separate_gnat),yes)
+ $(lib_binaries) += gnatbase
+endif
+arch_binaries := $(arch_binaries) ada
+ifneq ($(GFDL_INVARIANT_FREE),yes)
+ indep_binaries := $(indep_binaries) ada-doc
+endif
+
+ifeq ($(with_libgnat),yes)
+ $(lib_binaries) += libgnat
+endif
+
+ifneq ($(DEB_CROSS),yes)
+ p_gbase = gnat-$(GNAT_VERSION)-base
+ ifneq ($(with_separate_gnat),yes)
+ p_gbase = gcc$(pkg_ver)-base
+ endif
+else
+ p_gbase = gnat$(pkg_ver)$(cross_bin_arch)-base
+ ifneq ($(with_separate_gnat),yes)
+ p_gbase = gcc$(pkg_ver)$(cross_bin_arch)-base
+ endif
+endif
+
+p_gnat = gnat-$(GNAT_VERSION)$(cross_bin_arch)
+p_gnsjlj= gnat-$(GNAT_VERSION)-sjlj$(cross_bin_arch)
+p_lgnat = libgnat-$(GNAT_VERSION)$(cross_lib_arch)
+p_lgnat_dbg = $(p_lgnat)-dbg$(cross_lib_arch)
+p_lgnatvsn = libgnatvsn$(GNAT_VERSION)$(cross_lib_arch)
+p_lgnatvsn_dev = $(p_lgnatvsn)-dev$(cross_lib_arch)
+p_lgnatvsn_dbg = $(p_lgnatvsn)-dbg$(cross_lib_arch)
+p_lgnatprj = libgnatprj$(GNAT_VERSION)$(cross_lib_arch)
+p_lgnatprj_dev = $(p_lgnatprj)-dev$(cross_lib_arch)
+p_lgnatprj_dbg = $(p_lgnatprj)-dbg$(cross_lib_arch)
+p_gnatd = $(p_gnat)-doc
+
+d_gbase = debian/$(p_gbase)
+d_gnat = debian/$(p_gnat)
+d_lgnat = debian/$(p_lgnat)
+d_lgnatvsn = debian/$(p_lgnatvsn)
+d_lgnatprj = debian/$(p_lgnatprj)
+d_gnatd = debian/$(p_gnatd)
+
+GNAT_TOOLS = gnat gnatbind gnatchop gnatclean gnatfind gnatkr gnatlink \
+ gnatls gnatmake gnatname gnatprep gnatxref gnathtml
+
+dirs_gnat = \
+ $(docdir)/$(p_gbase) \
+ $(PF)/bin \
+ $(PF)/share/man/man1 \
+ $(gcc_lib_dir) \
+ $(gcc_lexec_dir)
+
+files_gnat = \
+ $(gcc_lexec_dir)/gnat1 \
+ $(gcc_lib_dir)/{adalib,adainclude} \
+ $(foreach i,$(GNAT_TOOLS),$(PF)/bin/$(cmd_prefix)$(i)) \
+ $(gcc_lib_dir)/rts-native
+# rts-sjlj moved to a separate package
+
+dirs_lgnat = \
+ $(docdir) \
+ $(PF)/lib
+files_lgnat = \
+ $(PF)/$(libdir)/lib{gnat,gnarl}-$(GNAT_SONAME).so.1
+
+$(binary_stamp)-gnatbase: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ dh_installdocs -p$(p_gbase) debian/README.gnat debian/README.maintainers
+ : # $(p_gbase)
+ifeq ($(PKGSOURCE),gnat-$(BASE_VERSION))
+ mkdir -p $(d_gbase)/$(docdir)/$(p_xbase)
+ ln -sf ../$(p_gbase) $(d_gbase)/$(docdir)/$(p_xbase)/Ada
+endif
+ dh_installchangelogs -p$(p_gbase) src/gcc/ada/ChangeLog
+ dh_compress -p$(p_gbase)
+ dh_fixperms -p$(p_gbase)
+ dh_gencontrol -p$(p_gbase) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_gbase)
+ dh_md5sums -p$(p_gbase)
+ dh_builddeb -p$(p_gbase)
+ touch $@
+
+
+$(binary_stamp)-libgnat: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ : # libgnat
+ rm -rf $(d_lgnat)
+ dh_installdirs -p$(p_lgnat) $(dirs_lgnat)
+
+ for lib in lib{gnat,gnarl}; do \
+ vlib=$$lib-$(GNAT_SONAME); \
+ mv $(d)/$(gcc_lib_dir)/adalib/$$vlib.so.1 $(d)/$(PF)/$(libdir)/. ; \
+ rm -f $(d)/$(gcc_lib_dir)/adalib/$$lib.so.1; \
+ done
+ dh_movefiles -p$(p_lgnat) $(files_lgnat)
+
+ debian/dh_doclink -p$(p_lgnat) $(p_gbase)
+
+ debian/dh_rmemptydirs -p$(p_lgnat)
+
+ dh_strip -p$(p_lgnat) --dbg-package=$(p_lgnat_dbg)
+ dh_compress -p$(p_lgnat)
+ dh_fixperms -p$(p_lgnat)
+ b=libgnat; \
+ v=$(GNAT_VERSION); \
+ for ext in preinst postinst prerm postrm; do \
+ for t in '' -dev -dbg; do \
+ if [ -f debian/$$b$$t.$$ext ]; then \
+ cp -pf debian/$$b$$t.$$ext debian/$$b$$v$$t.$$ext; \
+ fi; \
+ done; \
+ done
+ $(cross_makeshlibs) dh_makeshlibs -p$(p_lgnat) -V '$(p_lgnat) (>= $(DEB_VERSION))'
+ $(call cross_mangle_shlibs,$(p_lgnat))
+
+ mkdir -p $(d_lgnat)/usr/share/lintian/overrides
+ cp -p debian/$(p_lgnat).overrides \
+ $(d_lgnat)/usr/share/lintian/overrides/$(p_lgnat)
+
+ $(cross_shlibdeps) dh_shlibdeps -p$(p_lgnat)
+ $(call cross_mangle_substvars,$(p_lgnat))
+ $(cross_gencontrol) dh_gencontrol -p$(p_lgnat) \
+ -- -v$(DEB_VERSION) $(common_substvars)
+ $(call cross_mangle_control,$(p_lgnat))
+ dh_installdeb -p$(p_lgnat)
+ dh_md5sums -p$(p_lgnat)
+ dh_builddeb -p$(p_lgnat)
+
+ : # $(p_lgnat_dbg)
+ debian/dh_doclink -p$(p_lgnat_dbg) $(p_gbase)
+ dh_compress -p$(p_lgnat_dbg)
+ dh_fixperms -p$(p_lgnat_dbg)
+ $(cross_gencontrol) dh_gencontrol -p$(p_lgnat_dbg) \
+ -- -v$(DEB_VERSION) $(common_substvars)
+ $(call cross_mangle_control,$(p_lgnat_dbg))
+ dh_installdeb -p$(p_lgnat_dbg)
+ dh_md5sums -p$(p_lgnat_dbg)
+ dh_builddeb -p$(p_lgnat_dbg)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+
+$(binary_stamp)-libgnatvsn: $(binary_stamp)-libgnat
+ : # $(p_lgnatvsn_dev)
+ dh_movefiles -p$(p_lgnatvsn_dev) usr/lib/ada/adalib/gnatvsn
+ dh_movefiles -p$(p_lgnatvsn_dev) usr/share/ada/adainclude/gnatvsn
+ dh_install -p$(p_lgnatvsn_dev) \
+ debian/gnatvsn.gpr usr/share/ada/adainclude
+ dh_movefiles -p$(p_lgnatvsn_dev) usr/$(libdir)/libgnatvsn.a
+ dh_link -p$(p_lgnatvsn_dev) \
+ usr/$(libdir)/libgnatvsn.so.$(GNAT_VERSION) \
+ usr/$(libdir)/libgnatvsn.so
+ dh_strip -p$(p_lgnatvsn_dev) -X.a --keep-debug
+ dh_fixperms -p$(p_lgnatvsn_dev)
+ debian/dh_doclink -p$(p_lgnatvsn_dev) $(p_gbase)
+ $(cross_gencontrol) dh_gencontrol -p$(p_lgnatvsn_dev) \
+ -- -v$(DEB_VERSION) $(common_substvars)
+ $(call cross_mangle_control,$(p_lgnatvsn_dev))
+ dh_md5sums -p$(p_lgnatvsn_dev)
+ dh_builddeb -p$(p_lgnatvsn_dev)
+
+ : # $(p_lgnatvsn)
+ mkdir -p $(d_lgnatvsn)/usr/share/lintian/overrides
+ cp -p debian/$(p_lgnatvsn).overrides \
+ $(d_lgnatvsn)/usr/share/lintian/overrides/$(p_lgnatvsn)
+ dh_movefiles -p$(p_lgnatvsn) usr/$(libdir)/libgnatvsn.so.$(GNAT_VERSION)
+ debian/dh_doclink -p$(p_lgnatvsn) $(p_gbase)
+ dh_strip -p$(p_lgnatvsn) --dbg-package=$(p_lgnatvsn_dbg)
+ $(cross_makeshlibs) dh_makeshlibs -p$(p_lgnatvsn) \
+ -V '$(p_lgnatvsn) (>= $(DEB_VERSION))'
+ $(call cross_mangle_shlibs,$(p_lgnatvsn))
+ cat debian/$(p_lgnatvsn)/DEBIAN/shlibs >> debian/shlibs.local
+ $(cross_shlibdeps) dh_shlibdeps -p$(p_lgnatvsn) -L$(p_lgnat)
+ $(call cross_mangle_substvars,$(p_lgnatvsn))
+ $(cross_gencontrol) dh_gencontrol -p$(p_lgnatvsn) \
+ -- -v$(DEB_VERSION) $(common_substvars)
+ $(call cross_mangle_control,$(p_lgnatvsn))
+ dh_installdeb -p$(p_lgnatvsn)
+ dh_md5sums -p$(p_lgnatvsn)
+ dh_builddeb -p$(p_lgnatvsn)
+
+ : # $(p_lgnatvsn_dbg)
+ debian/dh_doclink -p$(p_lgnatvsn_dbg) $(p_gbase)
+ dh_compress -p$(p_lgnatvsn_dbg)
+ dh_fixperms -p$(p_lgnatvsn_dbg)
+ $(cross_gencontrol) dh_gencontrol -p$(p_lgnatvsn_dbg) \
+ -- -v$(DEB_VERSION) $(common_substvars)
+ $(call cross_mangle_control,$(p_lgnatvsn_dbg))
+ dh_installdeb -p$(p_lgnatvsn_dbg)
+ dh_md5sums -p$(p_lgnatvsn_dbg)
+ dh_builddeb -p$(p_lgnatvsn_dbg)
+ touch $@
+
+$(binary_stamp)-libgnatprj: $(binary_stamp)-libgnat $(binary_stamp)-libgnatvsn
+ : # $(p_lgnatprj_dev)
+ dh_movefiles -p$(p_lgnatprj_dev) usr/lib/ada/adalib/gnatprj
+ dh_movefiles -p$(p_lgnatprj_dev) usr/share/ada/adainclude/gnatprj
+ dh_install -p$(p_lgnatprj_dev) \
+ debian/gnatprj.gpr usr/share/ada/adainclude
+ dh_movefiles -p$(p_lgnatprj_dev) usr/$(libdir)/libgnatprj.a
+ dh_link -p$(p_lgnatprj_dev) \
+ usr/$(libdir)/libgnatprj.so.$(GNAT_VERSION) \
+ usr/$(libdir)/libgnatprj.so
+ dh_strip -p$(p_lgnatprj_dev) -X.a --keep-debug
+ dh_fixperms -p$(p_lgnatprj_dev)
+ debian/dh_doclink -p$(p_lgnatprj_dev) $(p_gbase)
+ $(cross_gencontrol) dh_gencontrol -p$(p_lgnatprj_dev) \
+ -- -v$(DEB_VERSION) $(common_substvars)
+ $(call cross_mangle_control,$(p_lgnatprj_dev))
+ dh_md5sums -p$(p_lgnatprj_dev)
+ dh_builddeb -p$(p_lgnatprj_dev)
+
+ : # $(p_lgnatprj)
+ mkdir -p $(d_lgnatprj)/usr/share/lintian/overrides
+ cp -p debian/$(p_lgnatprj).overrides \
+ $(d_lgnatprj)/usr/share/lintian/overrides/$(p_lgnatprj)
+ dh_movefiles -p$(p_lgnatprj) usr/$(libdir)/libgnatprj.so.$(GNAT_VERSION)
+ debian/dh_doclink -p$(p_lgnatprj) $(p_gbase)
+ dh_strip -p$(p_lgnatprj) --dbg-package=$(p_lgnatprj_dbg)
+ $(cross_makeshlibs) dh_makeshlibs -p$(p_lgnatprj) \
+ -V '$(p_lgnatprj) (>= $(DEB_VERSION))'
+ $(call cross_mangle_shlibs,$(p_lgnatprj))
+ cat debian/$(p_lgnatprj)/DEBIAN/shlibs >> debian/shlibs.local
+ $(cross_shlibdeps) dh_shlibdeps -p$(p_lgnatprj) -L$(p_lgnat) -L$(p_lgnatvsn)
+ $(call cross_mangle_substvars,$(p_lgnatprj))
+ $(cross_gencontrol) dh_gencontrol -p$(p_lgnatprj) \
+ -- -v$(DEB_VERSION) $(common_substvars)
+ $(call cross_mangle_control,$(p_lgnatprj))
+ dh_installdeb -p$(p_lgnatprj)
+ dh_md5sums -p$(p_lgnatprj)
+ dh_builddeb -p$(p_lgnatprj)
+
+ : # $(p_lgnatprj_dbg)
+ debian/dh_doclink -p$(p_lgnatprj_dbg) $(p_gbase)
+ dh_compress -p$(p_lgnatprj_dbg)
+ dh_fixperms -p$(p_lgnatprj_dbg)
+ $(cross_gencontrol) dh_gencontrol -p$(p_lgnatprj_dbg) \
+ -- -v$(DEB_VERSION) $(common_substvars)
+ $(call cross_mangle_control,$(p_lgnatprj_dbg))
+ dh_installdeb -p$(p_lgnatprj_dbg)
+ dh_md5sums -p$(p_lgnatprj_dbg)
+ dh_builddeb -p$(p_lgnatprj_dbg)
+ touch $@
+
+ifeq ($(with_libgnat),yes)
+$(binary_stamp)-ada: $(install_stamp) $(binary_stamp)-libgnat
+$(binary_stamp)-ada: $(binary_stamp)-libgnatvsn
+$(binary_stamp)-ada: $(binary_stamp)-libgnatprj
+else
+$(binary_stamp)-ada: $(install_stamp)
+endif
+$(binary_stamp)-ada: $(binary_stamp)-gnatbase
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+ : # $(p_gnat)
+ rm -rf $(d_gnat)
+ dh_installdirs -p$(p_gnat) $(dirs_gnat)
+ # Upstream does not install gnathtml.
+ cp src/gcc/ada/gnathtml.pl debian/tmp/$(PF)/bin/$(cmd_prefix)gnathtml
+ chmod 755 debian/tmp/$(PF)/bin/$(cmd_prefix)gnathtml
+ dh_movefiles -p$(p_gnat) $(files_gnat)
+ dh_installdirs -p$(p_gnsjlj) $(gcc_lib_dir)
+ dh_movefiles -p$(p_gnsjlj) $(gcc_lib_dir)/rts-sjlj
+ dh_link -p$(p_gnsjlj) \
+ $(gcc_lib_dir)/rts-sjlj usr/share/ada/adainclude/rts-sjlj
+ dh_link -p$(p_gnsjlj) \
+ $(gcc_lib_dir)/rts-sjlj/adalib/libgnat.a \
+ $(gcc_lib_dir)/rts-sjlj/adalib/libgnat-$(GNAT_VERSION).a
+ dh_link -p$(p_gnsjlj) \
+ $(gcc_lib_dir)/rts-sjlj/adalib/libgnarl.a \
+ $(gcc_lib_dir)/rts-sjlj/adalib/libgnarl-$(GNAT_VERSION).a
+
+ifeq ($(with_libgnat),yes)
+ for lib in lib{gnat,gnarl}; do \
+ vlib=$$lib-$(GNAT_SONAME); \
+ dh_link -p$(p_gnat) \
+ /$(PF)/$(libdir)/$$vlib.so.1 /$(PF)/$(libdir)/$$vlib.so \
+ /$(PF)/$(libdir)/$$vlib.so.1 /$(PF)/$(libdir)/$$lib.so; \
+ done
+ for lib in lib{gnat,gnarl}; do \
+ vlib=$$lib-$(GNAT_SONAME); \
+ dh_link -p$(p_gnat) \
+ /$(PF)/$(libdir)/$$vlib.so.1 $(gcc_lib_dir)/rts-native/adalib/$$lib.so; \
+ done
+endif
+ debian/dh_doclink -p$(p_gnat) $(p_gbase)
+ debian/dh_doclink -p$(p_gnsjlj) $(p_gbase)
+ifeq ($(PKGSOURCE),gnat-$(BASE_VERSION))
+ ifeq ($(with_check),yes)
+ cp -p test-summary $(d_gnat)/$(docdir)/$(p_gbase)/.
+ endif
+endif
+ for i in $(GNAT_TOOLS); do \
+ case "$$i" in \
+ gnat) cp -p debian/gnat.1 $(d_gnat)/$(PF)/share/man/man1/$(cmd_prefix)gnat.1 ;; \
+ *) ln -sf gnat.1 $(d_gnat)/$(PF)/share/man/man1/$(cmd_prefix)$$i.1; \
+ esac; \
+ done
+
+ dh_install -p$(p_gnat) debian/ada/debian_packaging.mk usr/share/ada
+ dh_link -p$(p_gnat) usr/bin/gcc-$(GNAT_VERSION) usr/bin/gnatgcc
+ dh_link -p$(p_gnat) usr/share/man/man1/gnat.1.gz usr/share/man/man1/gnatgcc.1.gz
+
+ debian/dh_rmemptydirs -p$(p_gnat)
+
+ dh_strip -p$(p_gnat)
+ dh_compress -p$(p_gnat)
+ dh_fixperms -p$(p_gnat)
+ find $(d_gnat) -name '*.ali' | xargs chmod 444
+ $(cross_makeshlibs) dh_shlibdeps -p$(p_gnat)
+ $(call cross_mangle_substvars,$(p_gnat))
+ dh_gencontrol -p$(p_gnat) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_gnat)
+ dh_md5sums -p$(p_gnat)
+ dh_builddeb -p$(p_gnat)
+
+ifeq ($(with_libgnat),yes)
+ dh_strip -p$(p_gnsjlj)
+ dh_compress -p$(p_gnsjlj)
+ dh_fixperms -p$(p_gnsjlj)
+ find $(d_gnat)-sjlj -name '*.ali' | xargs chmod 444
+ $(cross_shlibdeps) dh_shlibdeps -p$(p_gnsjlj)
+ $(call cross_mangle_substvars,$(p_gnsjlj))
+ $(cross_gencontrol) dh_gencontrol -p$(p_gnsjlj) \
+ -- -v$(DEB_VERSION) $(common_substvars)
+ $(call cross_mangle_control,$(p_gnsjlj))
+ dh_installdeb -p$(p_gnsjlj)
+ dh_md5sums -p$(p_gnsjlj)
+ dh_builddeb -p$(p_gnsjlj)
+endif
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+
+ada_info_dir = $(d_gnatd)/$(PF)/share/info
+
+$(binary_stamp)-ada-doc: $(build_html_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_gnatd)
+ dh_installdirs -p$(p_gnatd) \
+ $(PF)/share/info
+
+ cd $(ada_info_dir) && \
+ makeinfo -I $(srcdir)/gcc/doc/include -I $(srcdir)/gcc/ada \
+ -I $(builddir)/gcc \
+ -o gnat_ugn-$(GNAT_VERSION).info \
+ $(builddir)/gcc/doc/gnat_ugn.texi
+ cd $(ada_info_dir) && \
+ makeinfo -I $(srcdir)/gcc/doc/include -I $(srcdir)/gcc/ada \
+ -I $(builddir)/gcc \
+ -o gnat_rm-$(GNAT_VERSION).info \
+ $(srcdir)/gcc/ada/gnat_rm.texi
+ cd $(ada_info_dir) && \
+ makeinfo -I $(srcdir)/gcc/doc/include -I $(srcdir)/gcc/ada \
+ -I $(builddir)/gcc \
+ -o gnat-style-$(GNAT_VERSION).info \
+ $(srcdir)/gcc/ada/gnat-style.texi
+
+ dh_installdocs -p$(p_gnatd) \
+ html/gnat_ugn.html html/gnat_rm.html html/gnat-style.html
+ dh_installchangelogs -p$(p_gnatd)
+ dh_compress -p$(p_gnatd)
+ dh_fixperms -p$(p_gnatd)
+ dh_installdeb -p$(p_gnatd)
+ dh_gencontrol -p$(p_gnatd) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_md5sums -p$(p_gnatd)
+ dh_builddeb -p$(p_gnatd)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
diff --git a/debian/rules.d/binary-base.mk b/debian/rules.d/binary-base.mk
new file mode 100644
index 0000000..8e4664e
--- /dev/null
+++ b/debian/rules.d/binary-base.mk
@@ -0,0 +1,49 @@
+$(lib_binaries) += base
+
+# ---------------------------------------------------------------------------
+# gcc-base
+
+ifneq (,$(filter $(distrelease),oneiric precise wheezy sid))
+ additional_links =
+else ifneq (,$(filter $(distrelease),))
+ additional_links =
+else
+ additional_links =
+endif
+
+$(binary_stamp)-base: $(install_dependencies)
+ dh_testdir
+ dh_testroot
+ rm -rf $(d_base)
+ dh_installdirs -p$(p_base) \
+ $(gcc_lexec_dir)
+
+ ln -sf $(BASE_VERSION) \
+ $(d_base)/$(subst /$(BASE_VERSION),/$(GCC_VERSION),$(gcc_lib_dir))
+ for link in $(additional_links); do \
+ ln -sf $(BASE_VERSION) \
+ $(d_base)/$$(dirname $(gcc_lib_dir))/$$link; \
+ done
+ifneq ($(gcc_lib_dir),$(gcc_lexec_dir))
+ ln -sf $(BASE_VERSION) \
+ $(d_base)/$(subst /$(BASE_VERSION),/$(GCC_VERSION),$(gcc_lexec_dir))
+ for link in $(additional_links); do \
+ ln -sf $(BASE_VERSION) \
+ $(d_base)/$$(dirname $(gcc_lexec_dir))/$$link; \
+ done
+endif
+
+ifeq ($(with_base_only),yes)
+ dh_installdocs -p$(p_base) debian/README.Debian
+else
+ dh_installdocs -p$(p_base) debian/README.Debian.$(DEB_TARGET_ARCH)
+endif
+ rm -f $(d_base)/usr/share/doc/$(p_base)/README.Debian
+ dh_installchangelogs -p$(p_base)
+ dh_compress -p$(p_base)
+ dh_fixperms -p$(p_base)
+ dh_gencontrol -p$(p_base) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_base)
+ dh_md5sums -p$(p_base)
+ dh_builddeb -p$(p_base)
+ touch $@
diff --git a/debian/rules.d/binary-cpp.mk b/debian/rules.d/binary-cpp.mk
new file mode 100644
index 0000000..54347b3
--- /dev/null
+++ b/debian/rules.d/binary-cpp.mk
@@ -0,0 +1,86 @@
+arch_binaries := $(arch_binaries) cpp
+ifneq ($(DEB_CROSS),yes)
+ ifneq ($(GFDL_INVARIANT_FREE),yes)
+ indep_binaries := $(indep_binaries) cpp-doc
+ endif
+endif
+
+dirs_cpp = \
+ $(docdir) \
+ $(PF)/share/man/man1 \
+ $(PF)/bin \
+ $(gcc_lexec_dir)
+
+files_cpp = \
+ $(PF)/bin/$(cmd_prefix)cpp$(pkg_ver) \
+ $(gcc_lexec_dir)/cc1 \
+ $(gcc_lexec_dir)/liblto_plugin.so{,.0,.0.0.0}
+
+ifneq ($(GFDL_INVARIANT_FREE),yes)
+ files_cpp += \
+ $(PF)/share/man/man1/$(cmd_prefix)cpp$(pkg_ver).1
+endif
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-cpp: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_cpp)
+ dh_installdirs -p$(p_cpp) $(dirs_cpp)
+ DH_COMPAT=2 dh_movefiles -p$(p_cpp) $(files_cpp)
+
+ifneq ($(DEB_CROSS),yes)
+ ln -sf cpp$(pkg_ver) \
+ $(d_cpp)/$(PF)/bin/$(DEB_TARGET_GNU_TYPE)-cpp$(pkg_ver)
+ ln -sf cpp$(pkg_ver) \
+ $(d_cpp)/$(PF)/bin/$(TARGET_ALIAS)-cpp$(pkg_ver)
+ ifneq ($(GFDL_INVARIANT_FREE),yes)
+ ln -sf cpp$(pkg_ver).1 \
+ $(d_cpp)/$(PF)/share/man/man1/$(DEB_TARGET_GNU_TYPE)-cpp$(pkg_ver).1
+ ln -sf cpp$(pkg_ver).1 \
+ $(d_cpp)/$(PF)/share/man/man1/$(TARGET_ALIAS)-cpp$(pkg_ver).1
+ endif
+endif
+
+ debian/dh_doclink -p$(p_cpp) $(p_xbase)
+ debian/dh_rmemptydirs -p$(p_cpp)
+
+ dh_strip -p$(p_cpp)
+ dh_compress -p$(p_cpp)
+ dh_fixperms -p$(p_cpp)
+ dh_shlibdeps -p$(p_cpp)
+ dh_gencontrol -p$(p_cpp) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_cpp)
+ dh_md5sums -p$(p_cpp)
+ dh_builddeb -p$(p_cpp)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-cpp-doc: $(build_html_stamp) $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_cppd)
+ dh_installdirs -p$(p_cppd) \
+ $(docdir)/$(p_xbase) \
+ $(PF)/share/info
+ DH_COMPAT=2 dh_movefiles -p$(p_cppd) \
+ $(PF)/share/info/cpp*
+
+ debian/dh_doclink -p$(p_cppd) $(p_xbase)
+ dh_installdocs -p$(p_cppd) html/cpp.html html/cppinternals.html
+ rm -f $(d_cppd)/$(docdir)/$(p_xbase)/copyright
+ debian/dh_rmemptydirs -p$(p_cppd)
+
+ dh_compress -p$(p_cppd)
+ dh_fixperms -p$(p_cppd)
+ dh_installdeb -p$(p_cppd)
+ dh_gencontrol -p$(p_cppd) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_md5sums -p$(p_cppd)
+ dh_builddeb -p$(p_cppd)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
diff --git a/debian/rules.d/binary-cxx.mk b/debian/rules.d/binary-cxx.mk
new file mode 100644
index 0000000..4bb6e5b
--- /dev/null
+++ b/debian/rules.d/binary-cxx.mk
@@ -0,0 +1,128 @@
+ifneq (,$(filter yes, $(biarch64) $(biarch32) $(biarchn32) $(biarchx32) $(biarchhf) $(biarchsf)))
+ arch_binaries := $(arch_binaries) cxx-multi
+endif
+arch_binaries := $(arch_binaries) cxx
+
+dirs_cxx = \
+ $(docdir)/$(p_xbase)/C++ \
+ $(PF)/bin \
+ $(PF)/share/info \
+ $(gcc_lexec_dir) \
+ $(PF)/share/man/man1
+files_cxx = \
+ $(PF)/bin/$(cmd_prefix)g++$(pkg_ver) \
+ $(gcc_lexec_dir)/cc1plus
+
+ifneq ($(GFDL_INVARIANT_FREE),yes)
+ files_cxx += \
+ $(PF)/share/man/man1/$(cmd_prefix)g++$(pkg_ver).1
+endif
+
+p_cxx_m = g++$(pkg_ver)-multilib$(cross_bin_arch)
+d_cxx_m = debian/$(p_cxx_m)
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-cxx: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_cxx)
+ dh_installdirs -p$(p_cxx) $(dirs_cxx)
+ DH_COMPAT=2 dh_movefiles -p$(p_cxx) $(files_cxx)
+
+ifneq ($(DEB_CROSS),yes)
+ ln -sf g++$(pkg_ver) \
+ $(d_cxx)/$(PF)/bin/$(DEB_TARGET_GNU_TYPE)-g++$(pkg_ver)
+ ln -sf g++$(pkg_ver) \
+ $(d_cxx)/$(PF)/bin/$(TARGET_ALIAS)-g++$(pkg_ver)
+endif
+
+ifneq ($(GFDL_INVARIANT_FREE),yes)
+# g++ man page is a .so link
+ rm -f $(d_cxx)/$(PF)/share/man/man1/$(cmd_prefix)g++$(pkg_ver).1
+ ln -sf $(cmd_prefix)gcc$(pkg_ver).1.gz \
+ $(d_cxx)/$(PF)/share/man/man1/$(cmd_prefix)g++$(pkg_ver).1.gz
+ ifneq ($(DEB_CROSS),yes)
+ ln -sf g++$(pkg_ver).1.gz \
+ $(d_cxx)/$(PF)/share/man/man1/$(DEB_TARGET_GNU_TYPE)-g++$(pkg_ver).1.gz
+ ln -sf g++$(pkg_ver).1.gz \
+ $(d_cxx)/$(PF)/share/man/man1/$(TARGET_ALIAS)-g++$(pkg_ver).1.gz
+ endif
+endif
+
+ debian/dh_doclink -p$(p_cxx) $(p_xbase)
+ cp -p debian/README.C++ $(d_cxx)/$(docdir)/$(p_xbase)/C++/
+ cp -p $(srcdir)/gcc/cp/ChangeLog \
+ $(d_cxx)/$(docdir)/$(p_xbase)/C++/changelog
+ debian/dh_rmemptydirs -p$(p_cxx)
+
+ mkdir -p $(d_cxx)/$(docdir)/$(p_xbase)/test-summaries
+ echo "TEST COMPARE BEGIN"
+ifeq ($(with_check),yes)
+# more than one libgo.sum, avoid it
+ cp -p $$(find $(builddir)/gcc/testsuite -maxdepth 2 \( -name '*.sum' -o -name '*.log' \)) \
+ $$(find $(buildlibdir)/*/testsuite -maxdepth 1 \( -name '*.sum' -o -name '*.log' \) ! -name 'libgo.*') \
+ $(d_cxx)/$(docdir)/$(p_xbase)/test-summaries/
+ ifeq ($(with_go),yes)
+ cp -p $(buildlibdir)/libgo/libgo.sum \
+ $(d_cxx)/$(docdir)/$(p_xbase)/test-summaries/
+ endif
+ ifeq (0,1)
+ cd $(builddir); \
+ for i in $(CURDIR)/$(d_cxx)/$(docdir)/$(p_xbase)/test-summaries/*.sum; do \
+ b=$$(basename $$i); \
+ if [ -f /usr/share/doc/$(p_xbase)/test-summaries/$$b.gz ]; then \
+ zcat /usr/share/doc/$(p_xbase)/test-summaries/$$b.gz > /tmp/$$b; \
+ if sh $(srcdir)/contrib/test_summary /tmp/$$b $$i; then \
+ echo "$$b: OK"; \
+ else \
+ echo "$$b: FAILURES"; \
+ fi; \
+ rm -f /tmp/$$b; \
+ else \
+ echo "Test summary for $$b is not available"; \
+ fi; \
+ done
+ endif
+ if which xz 2>&1 >/dev/null; then \
+ xz -7v $(d_cxx)/$(docdir)/$(p_xbase)/test-summaries/*; \
+ fi
+else
+ echo "Nothing to compare (testsuite not run)"
+endif
+ echo "TEST COMPARE END"
+
+ dh_strip -p$(p_cxx)
+ dh_compress -p$(p_cxx) -X.log.xz -X.sum.xz
+ dh_fixperms -p$(p_cxx)
+ dh_shlibdeps -p$(p_cxx)
+ dh_gencontrol -p$(p_cxx) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_cxx)
+ dh_md5sums -p$(p_cxx)
+ dh_builddeb -p$(p_cxx)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+$(binary_stamp)-cxx-multi: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_cxx_m)
+ dh_installdirs -p$(p_cxx_m) \
+ $(docdir)
+
+ debian/dh_doclink -p$(p_cxx_m) $(p_xbase)
+ debian/dh_rmemptydirs -p$(p_cxx_m)
+
+ dh_strip -p$(p_cxx_m)
+ dh_compress -p$(p_cxx_m)
+ dh_fixperms -p$(p_cxx_m)
+ dh_shlibdeps -p$(p_cxx_m)
+ dh_gencontrol -p$(p_cxx_m) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_cxx_m)
+ dh_md5sums -p$(p_cxx_m)
+ dh_builddeb -p$(p_cxx_m)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
diff --git a/debian/rules.d/binary-d.mk b/debian/rules.d/binary-d.mk
new file mode 100644
index 0000000..548ca65
--- /dev/null
+++ b/debian/rules.d/binary-d.mk
@@ -0,0 +1,173 @@
+arch_binaries := $(arch_binaries) gdc
+
+ifeq ($(with_libphobos),yes)
+ arch_binaries += libphobos-dev
+endif
+
+p_gdc = gdc$(pkg_ver)$(cross_bin_arch)
+p_libphobos = libphobos$(pkg_ver)-dev
+
+d_gdc = debian/$(p_gdc)
+d_libphobos = debian/$(p_libphobos)
+
+ifeq ($(DEB_CROSS),yes)
+ gdc_include_dir := $(gcc_lib_dir)/include/d
+else
+ gdc_include_dir := $(PF)/include/d/$(BASE_VERSION)
+endif
+
+dirs_gdc = \
+ $(PF)/bin \
+ $(PF)/share/man/man1 \
+ $(gcc_lexec_dir)
+ifneq ($(DEB_CROSS),yes)
+ dirs_gdc += \
+ $(gdc_include_dir)
+endif
+
+files_gdc = \
+ $(PF)/bin/$(cmd_prefix)gdc$(pkg_ver) \
+ $(gcc_lexec_dir)/cc1d
+ifneq ($(GFDL_INVARIANT_FREE),yes-now-pure-gfdl)
+ files_gdc += \
+ $(PF)/share/man/man1/$(cmd_prefix)gdc$(pkg_ver).1
+endif
+
+
+dirs_libphobos = \
+ $(PF)/lib \
+ $(gdc_include_dir) \
+ $(gcc_lib_dir)
+
+files_libphobos = \
+ $(gcc_lib_dir)/libgphobos2.a \
+ $(gdc_include_dir)
+
+# $(usr_lib$(2))/libgphobos2.a \
+
+$(binary_stamp)-gdc: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_gdc)
+ dh_installdirs -p$(p_gdc) $(dirs_gdc)
+
+ dh_installdocs -p$(p_gdc) src/gcc/d/README
+ dh_installchangelogs -p$(p_gdc) src/gcc/d/ChangeLog
+
+ DH_COMPAT=2 dh_movefiles -p$(p_gdc) -X/zlib/ $(files_gdc)
+
+ifneq ($(DEB_CROSS),yes)
+ ln -sf gdc$(pkg_ver) \
+ $(d_gdc)/$(PF)/bin/$(DEB_TARGET_GNU_TYPE)-gdc$(pkg_ver)
+ ln -sf gdc$(pkg_ver) \
+ $(d_gdc)/$(PF)/bin/$(TARGET_ALIAS)-gdc$(pkg_ver)
+ ifneq ($(GFDL_INVARIANT_FREE),yes-now-pure-gfdl)
+ ln -sf gdc$(pkg_ver).1 \
+ $(d_gdc)/$(PF)/share/man/man1/$(DEB_TARGET_GNU_TYPE)-gdc$(pkg_ver).1
+ ln -sf gdc$(pkg_ver).1 \
+ $(d_gdc)/$(PF)/share/man/man1/$(TARGET_ALIAS)-gdc$(pkg_ver).1
+ endif
+endif
+
+# FIXME: object.di needs to go into a libgdc-dev Multi-Arch: same package
+ # Always needed by gdc.
+ mkdir -p $(d_gdc)/$(gdc_include_dir)
+ cp $(srcdir)/libphobos/libdruntime/object.di \
+ $(d_gdc)/$(gdc_include_dir)/.
+ifneq ($(DEB_CROSS),yes)
+ dh_link -p$(p_gdc) \
+ /$(gdc_include_dir) \
+ /$(dir $(gdc_include_dir))/$(GCC_VERSION)
+endif
+
+ dh_link -p$(p_gdc) \
+ /$(docdir)/$(p_gcc)/README.Bugs \
+ /$(docdir)/$(p_gdc)/README.Bugs
+
+ dh_strip -p$(p_gdc)
+ dh_compress -p$(p_gdc)
+ dh_fixperms -p$(p_gdc)
+ dh_shlibdeps -p$(p_gdc)
+ dh_gencontrol -p$(p_gdc) -- -v$(DEB_GDC_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_gdc)
+ dh_md5sums -p$(p_gdc)
+ dh_builddeb -p$(p_gdc)
+
+ find $(d_gdc) -type d -empty -delete
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+$(binary_stamp)-libphobos: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_libphobos)
+ dh_installdirs -p$(p_libphobos) $(dirs_libphobos)
+
+ mv $(d)/$(usr_lib)/libgphobos2.a \
+ $(d)/$(gcc_lib_dir)/.
+ DH_COMPAT=2 dh_movefiles -p$(p_libphobos) $(files_libphobos)
+
+ # included in gdc package
+ rm -f $(d_libphobos)/$(gdc_include_dir)/object.di
+
+ifeq ($(with_separate_gdc),yes)
+ debian/dh_doclink -p$(p_libphobos) $(p_gdc)
+else
+ debian/dh_doclink -p$(p_libphobos) $(p_base)
+endif
+
+ dh_strip -p$(p_libphobos)
+ dh_compress -p$(p_libphobos)
+ dh_fixperms -p$(p_libphobos)
+ dh_shlibdeps -p$(p_libphobos)
+ dh_gencontrol -p$(p_libphobos) -- -v$(DEB_GDC_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_libphobos)
+ dh_md5sums -p$(p_libphobos)
+ dh_builddeb -p$(p_libphobos)
+
+ find $(d_libphobos) -type d -empty -delete
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+define __do_libphobos_dev
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_l)
+ dh_installdirs -p$(p_l) \
+ $(gcc_lib_dir$(2))
+ mv $(d)/$(usr_lib$(2))/libgphobos2.a \
+ $(d)/$(gcc_lib_dir$(2))/.
+ DH_COMPAT=2 dh_movefiles -p$(p_l) \
+ $(files_libphobos)
+
+ : # included in gdc package
+ rm -f $(d_l)/$(gdc_include_dir)/object.di
+
+ debian/dh_doclink -p$(p_l) \
+ $(if $(filter yes,$(with_separate_gdc)),$(p_gdc),$(p_base))
+
+ dh_compress -p$(p_l)
+ dh_fixperms -p$(p_l)
+ $(cross_gencontrol) dh_gencontrol -p$(p_l) \
+ -- -v$(DEB_VERSION) $(common_substvars)
+ $(call cross_mangle_control,$(p_l))
+ dh_installdeb -p$(p_l)
+ dh_md5sums -p$(p_l)
+ dh_builddeb -p$(p_l)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+endef
+
+# don't put this as a comment within define/endef
+# $(call install_gcc_lib,libphobos,$(PHOBOS_SONAME),$(2),$(p_l))
+
+do_libphobos_dev = $(call __do_libphobos_dev,lib$(1)phobos-$(BASE_VERSION)-dev,$(1))
+
+$(binary_stamp)-libphobos-dev: $(install_stamp)
+ $(call do_libphobos_dev,)
diff --git a/debian/rules.d/binary-fixincl.mk b/debian/rules.d/binary-fixincl.mk
new file mode 100644
index 0000000..464bfd7
--- /dev/null
+++ b/debian/rules.d/binary-fixincl.mk
@@ -0,0 +1,47 @@
+arch_binaries := $(arch_binaries) fixincl
+
+p_fix = fixincludes
+d_fix = debian/$(p_fix)
+
+dirs_fix = \
+ $(docdir)/$(p_xbase)/fixincludes \
+ $(PF)/share/man/man1 \
+ $(PF)/bin \
+ $(gcc_lexec_dir) \
+ $(gcc_lib_dir)
+files_fix = \
+ $(gcc_lexec_dir)/install-tools \
+ $(gcc_lib_dir)/install-tools
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-fixincl: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_fix)
+ dh_installdirs -p$(p_fix) $(dirs_fix)
+ DH_COMPAT=2 dh_movefiles -p$(p_fix) $(files_fix)
+
+# $(IP) $(builddir)/gcc/fixinc/fixincl $(d_fix)/$(PF)/lib/fixincludes/
+# sed -e "s,^FIXINCL=\(.*\),FIXINCL=/$(PF)/lib/fixincludes/fixincl," \
+# $(builddir)/gcc/fixinc.sh \
+# > $(d_fix)/$(PF)/lib/fixincludes/fixinc.sh
+# chmod 755 $(d_fix)/$(PF)/lib/fixincludes/fixinc.sh
+ $(IR) $(srcdir)/fixincludes/README \
+ $(d_fix)/$(docdir)/$(p_xbase)/fixincludes
+ sed -e 's,@LIBEXECDIR@,$(gcc_lexec_dir),g' debian/fixincludes.in \
+ > $(d_fix)/$(PF)/bin/fixincludes
+ chmod 755 $(d_fix)/$(PF)/bin/fixincludes
+
+ debian/dh_doclink -p$(p_fix) $(p_xbase)
+ dh_strip -p$(p_fix)
+ dh_compress -p$(p_fix)
+ dh_fixperms -p$(p_fix)
+ dh_shlibdeps -p$(p_fix)
+ dh_gencontrol -p$(p_fix) -- -v$(DEB_EVERSION) $(common_substvars)
+ dh_installdeb -p$(p_fix)
+ dh_md5sums -p$(p_fix)
+ dh_builddeb -p$(p_fix)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
diff --git a/debian/rules.d/binary-fortran.mk b/debian/rules.d/binary-fortran.mk
new file mode 100644
index 0000000..ff60453
--- /dev/null
+++ b/debian/rules.d/binary-fortran.mk
@@ -0,0 +1,292 @@
+ifeq ($(with_libgfortran),yes)
+ $(lib_binaries) += libgfortran
+endif
+ifeq ($(with_fdev),yes)
+ $(lib_binaries) += libgfortran-dev
+endif
+ifeq ($(with_lib64gfortran),yes)
+ $(lib_binaries) += lib64fortran
+endif
+ifeq ($(with_lib64gfortrandev),yes)
+ $(lib_binaries) += lib64gfortran-dev
+endif
+ifeq ($(with_lib32gfortran),yes)
+ $(lib_binaries) += lib32fortran
+endif
+ifeq ($(with_lib32gfortrandev),yes)
+ $(lib_binaries) += lib32gfortran-dev
+endif
+ifeq ($(with_libn32gfortran),yes)
+ $(lib_binaries) += libn32fortran
+endif
+ifeq ($(with_libn32gfortrandev),yes)
+ $(lib_binaries) += libn32gfortran-dev
+endif
+ifeq ($(with_libx32gfortran),yes)
+ $(lib_binaries) += libx32fortran
+endif
+ifeq ($(with_libx32gfortrandev),yes)
+ $(lib_binaries) += libx32gfortran-dev
+endif
+ifeq ($(with_libhfgfortran),yes)
+ $(lib_binaries) += libhffortran
+endif
+ifeq ($(with_libhfgfortrandev),yes)
+ $(lib_binaries) += libhfgfortran-dev
+endif
+ifeq ($(with_libsfgfortran),yes)
+ $(lib_binaries) += libsffortran
+endif
+ifeq ($(with_libsfgfortrandev),yes)
+ $(lib_binaries) += libsfgfortran-dev
+endif
+
+ifeq ($(with_fdev),yes)
+ ifneq (,$(filter yes, $(biarch64) $(biarch32) $(biarchn32) $(biarchx32) $(biarchhf) $(biarchsf)))
+ arch_binaries := $(arch_binaries) fdev-multi
+ endif
+ arch_binaries := $(arch_binaries) fdev
+ ifneq ($(DEB_CROSS),yes)
+ ifneq ($(GFDL_INVARIANT_FREE),yes)
+ indep_binaries := $(indep_binaries) fortran-doc
+ endif
+ endif
+endif
+
+p_g95 = gfortran$(pkg_ver)$(cross_bin_arch)
+p_g95_m = gfortran$(pkg_ver)-multilib$(cross_bin_arch)
+p_g95d = gfortran$(pkg_ver)-doc
+p_flib = libgfortran$(FORTRAN_SONAME)$(cross_lib_arch)
+
+d_g95 = debian/$(p_g95)
+d_g95_m = debian/$(p_g95_m)
+d_g95d = debian/$(p_g95d)
+
+dirs_g95 = \
+ $(docdir)/$(p_xbase)/fortran \
+ $(PF)/bin \
+ $(gcc_lexec_dir) \
+ $(gcc_lib_dir) \
+ $(PF)/include \
+ $(PF)/share/man/man1
+files_g95 = \
+ $(PF)/bin/$(cmd_prefix)gfortran$(pkg_ver) \
+ $(gcc_lib_dir)/finclude \
+ $(gcc_lexec_dir)/f951
+
+ifneq ($(GFDL_INVARIANT_FREE),yes)
+ files_g95 += \
+ $(PF)/share/man/man1/$(cmd_prefix)gfortran$(pkg_ver).1
+endif
+
+# ----------------------------------------------------------------------
+define __do_fortran
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_l) $(d_d)
+ dh_installdirs -p$(p_l) $(usr_lib$(2))
+ DH_COMPAT=2 dh_movefiles -p$(p_l) $(usr_lib$(2))/libgfortran.so.*
+
+ debian/dh_doclink -p$(p_l) $(p_base)
+ debian/dh_doclink -p$(p_d) $(p_base)
+
+ if [ -f debian/$(p_l).overrides ]; then \
+ mkdir -p debian/$(p_l)/usr/share/lintian/overrides; \
+ cp debian/$(p_l).overrides debian/$(p_l)/usr/share/lintian/overrides/$(p_l); \
+ fi
+
+ dh_strip -p$(p_l) --dbg-package=$(p_d)
+ dh_compress -p$(p_l) -p$(p_d)
+ dh_fixperms -p$(p_l) -p$(p_d)
+ $(cross_makeshlibs) dh_makeshlibs -p$(p_l)
+ $(call cross_mangle_shlibs,$(p_l))
+ $(ignshld)DIRNAME=$(subst n,,$(2)) $(cross_shlibdeps) dh_shlibdeps -p$(p_l) \
+ $(call shlibdirs_to_search, \
+ $(subst gfortran$(FORTRAN_SONAME),gcc$(GCC_SONAME),$(p_l)) \
+ $(subst gfortran$(FORTRAN_SONAME),gcc$(QUADMATH_SONAME),$(p_l)) \
+ ,$(2))
+ $(call cross_mangle_substvars,$(p_l))
+ $(cross_gencontrol) dh_gencontrol -p$(p_l) -p$(p_d) \
+ -- -v$(DEB_VERSION) $(common_substvars)
+ $(call cross_mangle_control,$(p_l))
+ dh_installdeb -p$(p_l) -p$(p_d)
+ dh_md5sums -p$(p_l) -p$(p_d)
+ dh_builddeb -p$(p_l) -p$(p_d)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+endef
+
+do_fortran = $(call __do_fortran,lib$(1)gfortran$(FORTRAN_SONAME),$(1))
+
+
+define __do_libgfortran_dev
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_l)
+ dh_installdirs -p$(1) $(gcc_lib_dir$(2))
+
+ DH_COMPAT=2 dh_movefiles -p$(p_l) \
+ $(gcc_lib_dir$(2))/libgfortranbegin.a \
+ $(gcc_lib_dir$(2))/libcaf_single.a
+ $(call install_gcc_lib,libgfortran,$(FORTRAN_SONAME),$(2),$(p_l))
+
+ debian/dh_doclink -p$(p_l) $(p_base)
+ debian/dh_rmemptydirs -p$(p_l)
+
+ dh_strip -p$(p_l)
+ dh_compress -p$(p_l)
+ dh_fixperms -p$(p_l)
+ $(cross_shlibdeps) dh_shlibdeps -p$(p_l)
+ $(call cross_mangle_substvars,$(p_l))
+ $(cross_gencontrol) dh_gencontrol -p$(p_l) -- -v$(DEB_VERSION) $(common_substvars)
+ $(call cross_mangle_control,$(p_l))
+ dh_installdeb -p$(p_l)
+ dh_md5sums -p$(p_l)
+ dh_builddeb -p$(p_l)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+endef
+# ----------------------------------------------------------------------
+
+do_libgfortran_dev = $(call __do_libgfortran_dev,lib$(1)gfortran-$(BASE_VERSION)-dev,$(1))
+
+$(binary_stamp)-libgfortran: $(install_stamp)
+ $(call do_fortran,)
+
+$(binary_stamp)-lib64fortran: $(install_stamp)
+ $(call do_fortran,64)
+
+$(binary_stamp)-lib32fortran: $(install_stamp)
+ $(call do_fortran,32)
+
+$(binary_stamp)-libn32fortran: $(install_stamp)
+ $(call do_fortran,n32)
+
+$(binary_stamp)-libx32fortran: $(install_stamp)
+ $(call do_fortran,x32)
+
+$(binary_stamp)-libhffortran: $(install_stamp)
+ $(call do_fortran,hf)
+
+$(binary_stamp)-libsffortran: $(install_stamp)
+ $(call do_fortran,sf)
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-fdev: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_g95)
+ dh_installdirs -p$(p_g95) $(dirs_g95)
+
+ DH_COMPAT=2 dh_movefiles -p$(p_g95) $(files_g95)
+
+ mv $(d)/$(usr_lib)/libgfortran.spec $(d_g95)/$(gcc_lib_dir)/
+
+ifneq ($(DEB_CROSS),yes)
+ ln -sf gfortran$(pkg_ver) \
+ $(d_g95)/$(PF)/bin/$(DEB_TARGET_GNU_TYPE)-gfortran$(pkg_ver)
+ ln -sf gfortran$(pkg_ver) \
+ $(d_g95)/$(PF)/bin/$(TARGET_ALIAS)-gfortran$(pkg_ver)
+ifneq ($(GFDL_INVARIANT_FREE),yes)
+ ln -sf gfortran$(pkg_ver).1 \
+ $(d_g95)/$(PF)/share/man/man1/$(DEB_TARGET_GNU_TYPE)-gfortran$(pkg_ver).1
+ ln -sf gfortran$(pkg_ver).1 \
+ $(d_g95)/$(PF)/share/man/man1/$(TARGET_ALIAS)-gfortran$(pkg_ver).1
+endif
+endif
+
+ debian/dh_doclink -p$(p_g95) $(p_xbase)
+
+ cp -p $(srcdir)/gcc/fortran/ChangeLog \
+ $(d_g95)/$(docdir)/$(p_xbase)/fortran/changelog
+ debian/dh_rmemptydirs -p$(p_g95)
+
+ dh_strip -p$(p_g95)
+ dh_compress -p$(p_g95)
+ dh_fixperms -p$(p_g95)
+ dh_shlibdeps -p$(p_g95)
+ dh_gencontrol -p$(p_g95) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_g95)
+ dh_md5sums -p$(p_g95)
+ dh_builddeb -p$(p_g95)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-fdev-multi: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_g95_m)
+ dh_installdirs -p$(p_g95_m) $(docdir)
+
+ debian/dh_doclink -p$(p_g95_m) $(p_xbase)
+ debian/dh_rmemptydirs -p$(p_g95_m)
+ dh_strip -p$(p_g95_m)
+ dh_compress -p$(p_g95_m)
+ dh_fixperms -p$(p_g95_m)
+ dh_shlibdeps -p$(p_g95_m)
+ dh_gencontrol -p$(p_g95_m) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_g95_m)
+ dh_md5sums -p$(p_g95_m)
+ dh_builddeb -p$(p_g95_m)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-fortran-doc: $(build_html_stamp) $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_g95d)
+ dh_installdirs -p$(p_g95d) \
+ $(docdir)/$(p_xbase)/fortran \
+ $(PF)/share/info
+ DH_COMPAT=2 dh_movefiles -p$(p_g95d) \
+ $(PF)/share/info/gfortran*
+
+ debian/dh_doclink -p$(p_g95d) $(p_xbase)
+ifneq ($(GFDL_INVARIANT_FREE),yes)
+ dh_installdocs -p$(p_g95d)
+ rm -f $(d_g95d)/$(docdir)/$(p_xbase)/copyright
+ cp -p html/gfortran.html $(d_g95d)/$(docdir)/$(p_xbase)/fortran/
+endif
+
+ dh_compress -p$(p_g95d)
+ dh_fixperms -p$(p_g95d)
+ dh_installdeb -p$(p_g95d)
+ dh_gencontrol -p$(p_g95d) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_md5sums -p$(p_g95d)
+ dh_builddeb -p$(p_g95d)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+$(binary_stamp)-libgfortran-dev: $(install_stamp)
+ $(call do_libgfortran_dev,)
+
+$(binary_stamp)-lib64gfortran-dev: $(install_stamp)
+ $(call do_libgfortran_dev,64)
+
+$(binary_stamp)-lib32gfortran-dev: $(install_stamp)
+ $(call do_libgfortran_dev,32)
+
+$(binary_stamp)-libn32gfortran-dev: $(install_stamp)
+ $(call do_libgfortran_dev,n32)
+
+$(binary_stamp)-libx32gfortran-dev: $(install_stamp)
+ $(call do_libgfortran_dev,x32)
+
+$(binary_stamp)-libhfgfortran-dev: $(install_stamp)
+ $(call do_libgfortran_dev,hf)
+
+$(binary_stamp)-libsfgfortran-dev: $(install_stamp)
+ $(call do_libgfortran_dev,sf)
+
diff --git a/debian/rules.d/binary-gcc.mk b/debian/rules.d/binary-gcc.mk
new file mode 100644
index 0000000..14aaf6a
--- /dev/null
+++ b/debian/rules.d/binary-gcc.mk
@@ -0,0 +1,307 @@
+ifneq (,$(filter yes, $(biarch64) $(biarch32) $(biarchn32) $(biarchx32) $(biarchhf) $(biarchsf)))
+ arch_binaries := $(arch_binaries) gcc-multi
+endif
+ifeq ($(with_plugins),yes)
+ arch_binaries := $(arch_binaries) gcc-plugindev
+endif
+
+arch_binaries := $(arch_binaries) gcc
+
+ifneq ($(DEB_CROSS),yes)
+ ifneq ($(GFDL_INVARIANT_FREE),yes)
+ indep_binaries := $(indep_binaries) gcc-doc
+ endif
+ ifeq ($(with_nls),yes)
+ indep_binaries := $(indep_binaries) gcc-locales
+ endif
+endif
+
+# gcc must be moved after g77 and g++
+# not all files $(PF)/include/*.h are part of gcc,
+# but it becomes difficult to name all these files ...
+
+dirs_gcc = \
+ $(docdir)/$(p_xbase)/{gcc,libssp,gomp,itm,quadmath,sanitizer,cilkrts} \
+ $(PF)/bin \
+ $(gcc_lexec_dir) \
+ $(gcc_lib_dir)/{include,include-fixed} \
+ $(PF)/share/man/man1 $(libgcc_dir)
+
+# XXX: what about triarch mapping?
+files_gcc = \
+ $(PF)/bin/$(cmd_prefix){gcc,gcov}$(pkg_ver) \
+ $(PF)/bin/$(cmd_prefix)gcc-{ar,ranlib,nm}$(pkg_ver) \
+ $(PF)/share/man/man1/$(cmd_prefix)gcc-{ar,nm,ranlib}$(pkg_ver).1 \
+ $(gcc_lexec_dir)/{collect2,lto1,lto-wrapper} \
+ $(shell test -e $(d)/$(gcc_lib_dir)/SYSCALLS.c.X \
+ && echo $(gcc_lib_dir)/SYSCALLS.c.X)
+
+ifeq ($(DEB_STAGE),stage1)
+ files_gcc += \
+ $(gcc_lib_dir)/include \
+ $(shell for h in \
+ README limits.h syslimits.h; \
+ do \
+ test -e $(d)/$(gcc_lib_dir)/include-fixed/$$h \
+ && echo $(gcc_lib_dir)/include-fixed/$$h; \
+ done)
+endif
+
+ifneq ($(GFDL_INVARIANT_FREE),yes)
+ files_gcc += \
+ $(PF)/share/man/man1/$(cmd_prefix){gcc,gcov}$(pkg_ver).1
+endif
+
+usr_doc_files = debian/README.Bugs \
+ $(shell test -f $(srcdir)/FAQ && echo $(srcdir)/FAQ) \
+ $(shell test -f test-summary && echo test-summary)
+
+p_loc = gcc$(pkg_ver)-locales
+d_loc = debian/$(p_loc)
+
+p_gcc_m = gcc$(pkg_ver)-multilib$(cross_bin_arch)
+d_gcc_m = debian/$(p_gcc_m)
+
+p_pld = gcc$(pkg_ver)-plugin-dev$(cross_bin_arch)
+d_pld = debian/$(p_pld)
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-gcc: $(install_dependencies)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_gcc)
+ dh_installdirs -p$(p_gcc) $(dirs_gcc)
+
+ifeq ($(with_linaro_branch),yes)
+ if [ -f $(srcdir)/gcc/ChangeLog.linaro ]; then \
+ cp -p $(srcdir)/gcc/ChangeLog.linaro \
+ $(d_gcc)/$(docdir)/$(p_xbase)/changelog.linaro; \
+ fi
+endif
+ifeq ($(with_libssp),yes)
+ cp -p $(srcdir)/libssp/ChangeLog \
+ $(d_gcc)/$(docdir)/$(p_xbase)/libssp/changelog
+endif
+ifeq ($(with_gomp),yes)
+ mv $(d)/$(usr_lib)/libgomp*.spec $(d_gcc)/$(gcc_lib_dir)/
+ cp -p $(srcdir)/libgomp/ChangeLog \
+ $(d_gcc)/$(docdir)/$(p_xbase)/gomp/changelog
+endif
+ifeq ($(with_itm),yes)
+ mv $(d)/$(usr_lib)/libitm*.spec $(d_gcc)/$(gcc_lib_dir)/
+ cp -p $(srcdir)/libitm/ChangeLog \
+ $(d_gcc)/$(docdir)/$(p_xbase)/itm/changelog
+endif
+ifeq ($(with_qmath),yes)
+ cp -p $(srcdir)/libquadmath/ChangeLog \
+ $(d_gcc)/$(docdir)/$(p_xbase)/quadmath/changelog
+endif
+ifeq ($(with_asan),yes)
+ ifneq ($(empty_sanitizer_packages),yes)
+ mv $(d)/$(usr_lib)/libsanitizer*.spec $(d_gcc)/$(gcc_lib_dir)/
+ cp -p $(srcdir)/libsanitizer/ChangeLog \
+ $(d_gcc)/$(docdir)/$(p_xbase)/sanitizer/changelog
+ endif
+endif
+ifeq ($(with_cilkrts),yes)
+ mv $(d)/$(usr_lib)/libcilkrts.spec $(d_gcc)/$(gcc_lib_dir)/
+ cp -p $(srcdir)/libcilkrts/ChangeLog \
+ $(d_gcc)/$(docdir)/$(p_xbase)/cilkrts/changelog
+endif
+
+ DH_COMPAT=2 dh_movefiles -p$(p_gcc) $(files_gcc)
+
+ifneq ($(DEB_CROSS),yes)
+ for i in gcc gcov gcc-ar gcc-nm gcc-ranlib; do \
+ ln -sf $$i$(pkg_ver) \
+ $(d_gcc)/$(PF)/bin/$(DEB_TARGET_GNU_TYPE)-$$i$(pkg_ver); \
+ ln -sf $$i$(pkg_ver) \
+ $(d_gcc)/$(PF)/bin/$(TARGET_ALIAS)-$$i$(pkg_ver); \
+ done
+ifneq ($(GFDL_INVARIANT_FREE),yes)
+ for i in gcc gcov gcc-ar gcc-nm gcc-ranlib; do \
+ ln -sf gcc$(pkg_ver).1 \
+ $(d_gcc)/$(PF)/share/man/man1/$(DEB_TARGET_GNU_TYPE)-$$i$(pkg_ver).1; \
+ ln -sf $$i$(pkg_ver).1 \
+ $(d_gcc)/$(PF)/share/man/man1/$(TARGET_ALIAS)-$$i$(pkg_ver).1; \
+ done
+endif
+endif
+
+# dh_installdebconf
+ debian/dh_doclink -p$(p_gcc) $(p_xbase)
+ cp -p $(usr_doc_files) $(d_gcc)/$(docdir)/$(p_xbase)/.
+ if [ -f testsuite-comparision ]; then \
+ cp -p testsuite-comparision $(d_gcc)/$(docdir)/$(p_xbase)/. ; \
+ fi
+ cp -p debian/README.ssp $(d_gcc)/$(docdir)/$(p_xbase)/
+ cp -p debian/NEWS.gcc $(d_gcc)/$(docdir)/$(p_xbase)/NEWS
+ cp -p debian/NEWS.html $(d_gcc)/$(docdir)/$(p_xbase)/NEWS.html
+ cp -p $(srcdir)/ChangeLog $(d_gcc)/$(docdir)/$(p_xbase)/changelog
+ cp -p $(srcdir)/gcc/ChangeLog \
+ $(d_gcc)/$(docdir)/$(p_xbase)/gcc/changelog
+ if [ -f $(builddir)/gcc/.bad_compare ]; then \
+ ( \
+ echo "The comparision of the stage2 and stage3 object files shows differences."; \
+ echo "The Debian package was modified to ignore these differences."; \
+ echo ""; \
+ echo "The following files differ:"; \
+ echo ""; \
+ cat $(builddir)/gcc/.bad_compare; \
+ ) > $(d_gcc)/$(docdir)/$(p_xbase)/BOOTSTRAP_COMPARISION_FAILURE; \
+ else \
+ true; \
+ fi
+ debian/dh_rmemptydirs -p$(p_gcc)
+ dh_strip -p$(p_gcc)
+ dh_compress -p$(p_gcc) -X README.Bugs
+ dh_fixperms -p$(p_gcc)
+ dh_shlibdeps -p$(p_gcc)
+ dh_gencontrol -p$(p_gcc) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_gcc)
+ dh_md5sums -p$(p_gcc)
+ dh_builddeb -p$(p_gcc)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+ : # remove empty directories, when all components are in place
+ -find $(d) -type d -empty -delete
+
+ @echo "Listing installed files not included in any package:"
+ -find $(d) ! -type d
+
+# ----------------------------------------------------------------------
+
+$(binary_stamp)-gcc-multi: $(install_dependencies)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_gcc_m)
+ dh_installdirs -p$(p_gcc_m) $(docdir)
+
+ debian/dh_doclink -p$(p_gcc_m) $(p_xbase)
+ debian/dh_rmemptydirs -p$(p_gcc_m)
+
+ dh_strip -p$(p_gcc_m)
+ dh_compress -p$(p_gcc_m)
+ dh_shlibdeps -p$(p_gcc_m)
+ dh_fixperms -p$(p_gcc_m)
+ dh_installdeb -p$(p_gcc_m)
+ dh_gencontrol -p$(p_gcc_m) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_md5sums -p$(p_gcc_m)
+ dh_builddeb -p$(p_gcc_m)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-gcc-plugindev: $(install_dependencies)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_pld)
+ dh_installdirs -p$(p_pld) \
+ $(docdir) \
+ $(gcc_lib_dir)/plugin/include/config/arm
+ DH_COMPAT=2 dh_movefiles -p$(p_pld) \
+ $(gcc_lib_dir)/plugin
+
+ : # FIXME: see #645018, this only works for the native build :-/
+ if [ $(DEB_BUILD_ARCH) = $(DEB_HOST_ARCH) ] && [ $(DEB_HOST_ARCH) = $(DEB_TARGET_ARCH) ]; then \
+ cp $(builddir)/gcc/build/gengtype $(d_pld)/$(gcc_lib_dir)/; \
+ cp $(builddir)/gcc/gtype.state $(d_pld)/$(gcc_lib_dir)/; \
+ fi
+
+ debian/dh_doclink -p$(p_pld) $(p_xbase)
+ debian/dh_rmemptydirs -p$(p_pld)
+
+ dh_strip -p$(p_pld)
+ dh_compress -p$(p_pld)
+ dh_shlibdeps -p$(p_pld)
+ dh_fixperms -p$(p_pld)
+ dh_installdeb -p$(p_pld)
+ dh_gencontrol -p$(p_pld) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_md5sums -p$(p_pld)
+ dh_builddeb -p$(p_pld)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-gcc-locales: $(install_dependencies)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_loc)
+ dh_installdirs -p$(p_loc) \
+ $(docdir)
+ DH_COMPAT=2 dh_movefiles -p$(p_loc) \
+ $(PF)/share/locale/*/*/cpplib*.* \
+ $(PF)/share/locale/*/*/gcc*.*
+
+ debian/dh_doclink -p$(p_loc) $(p_xbase)
+ debian/dh_rmemptydirs -p$(p_loc)
+
+ dh_compress -p$(p_loc)
+ dh_fixperms -p$(p_loc)
+ dh_installdeb -p$(p_loc)
+ dh_gencontrol -p$(p_loc) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_md5sums -p$(p_loc)
+ dh_builddeb -p$(p_loc)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-gcc-doc: $(build_html_stamp) $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_doc)
+ dh_installdirs -p$(p_doc) \
+ $(docdir)/$(p_xbase) \
+ $(PF)/share/info
+ DH_COMPAT=2 dh_movefiles -p$(p_doc) \
+ $(PF)/share/info/cpp{,internals}-* \
+ $(PF)/share/info/gcc{,int}-* \
+ $(PF)/share/info/lib{gomp,itm}-* \
+ $(if $(with_qmath),$(PF)/share/info/libquadmath-*)
+ rm -f $(d_doc)/$(PF)/share/info/gccinst*
+
+ifeq ($(with_gomp),yes)
+ $(MAKE) -C $(buildlibdir)/libgomp stamp-build-info
+ cp -p $(buildlibdir)/libgomp/libgomp$(pkg_ver).info $(d_doc)/$(PF)/share/info/
+endif
+ifeq ($(with_itm),yes)
+ -$(MAKE) -C $(buildlibdir)/libitm stamp-build-info
+ if [ -f $(buildlibdir)/libitm/libitm$(pkg_ver).info ]; then \
+ cp -p $(buildlibdir)/libitm/libitm$(pkg_ver).info $(d_doc)/$(PF)/share/info/; \
+ fi
+endif
+
+ debian/dh_doclink -p$(p_doc) $(p_xbase)
+ dh_installdocs -p$(p_doc) html/gcc.html html/gccint.html
+ifeq ($(with_gomp),yes)
+ cp -p html/libgomp.html $(d_doc)/usr/share/doc/$(p_doc)/
+endif
+ifeq ($(with_itm),yes)
+ cp -p html/libitm.html $(d_doc)/usr/share/doc/$(p_doc)/
+endif
+ifeq ($(with_qmath),yes)
+ cp -p html/libquadmath.html $(d_doc)/usr/share/doc/$(p_doc)/
+endif
+ rm -f $(d_doc)/$(docdir)/$(p_xbase)/copyright
+ debian/dh_rmemptydirs -p$(p_doc)
+
+ dh_compress -p$(p_doc)
+ dh_fixperms -p$(p_doc)
+ dh_installdeb -p$(p_doc)
+ dh_gencontrol -p$(p_doc) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_md5sums -p$(p_doc)
+ dh_builddeb -p$(p_doc)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
diff --git a/debian/rules.d/binary-go.mk b/debian/rules.d/binary-go.mk
new file mode 100644
index 0000000..6226ccb
--- /dev/null
+++ b/debian/rules.d/binary-go.mk
@@ -0,0 +1,312 @@
+ifeq ($(with_libgo),yes)
+ $(lib_binaries) += libgo
+endif
+ifeq ($(with_lib64go),yes)
+ $(lib_binaries) += lib64go
+endif
+ifeq ($(with_lib32go),yes)
+ $(lib_binaries) += lib32go
+endif
+ifeq ($(with_libn32go),yes)
+ $(lib_binaries) += libn32go
+endif
+ifeq ($(with_libx32go),yes)
+ $(lib_binaries) += libx32go
+endif
+
+arch_binaries := $(arch_binaries) gccgo
+ifneq (,$(filter yes, $(biarch64) $(biarch32) $(biarchn32) $(biarchx32)))
+ arch_binaries := $(arch_binaries) gccgo-multi
+endif
+ifneq ($(DEB_CROSS),yes)
+ ifneq ($(GFDL_INVARIANT_FREE),yes)
+ indep_binaries := $(indep_binaries) go-doc
+ endif
+endif
+
+p_go = gccgo$(pkg_ver)$(cross_bin_arch)
+p_go_m = gccgo$(pkg_ver)-multilib$(cross_bin_arch)
+p_god = gccgo$(pkg_ver)-doc
+p_golib = libgo$(GO_SONAME)$(cross_lib_arch)
+
+d_go = debian/$(p_go)
+d_go_m = debian/$(p_go_m)
+d_god = debian/$(p_god)
+d_golib = debian/$(p_golib)
+
+dirs_go = \
+ $(docdir)/$(p_xbase)/go \
+ $(PF)/bin \
+ $(gcc_lexec_dir) \
+ $(gcc_lib_dir) \
+ $(PF)/include \
+ $(PF)/share/man/man1
+files_go = \
+ $(PF)/bin/$(cmd_prefix)gccgo$(pkg_ver) \
+ $(gcc_lexec_dir)/go1
+
+ifneq ($(GFDL_INVARIANT_FREE),yes)
+ files_go += \
+ $(PF)/share/man/man1/$(cmd_prefix)gccgo$(pkg_ver).1
+endif
+
+ifeq ($(with_standalone_go),yes)
+
+ dirs_go += \
+ $(gcc_lib_dir)/include \
+ $(PF)/share/man/man1
+
+# XXX: what about triarch mapping?
+ files_go += \
+ $(PF)/bin/{cpp,gcc,gcov}$(pkg_ver) \
+ $(PF)/bin/$(cmd_prefix)gcc-{ar,ranlib,nm}$(pkg_ver) \
+ $(PF)/share/man/man1/$(cmd_prefix)gcc-{ar,nm,ranlib}$(pkg_ver).1 \
+ $(gcc_lexec_dir)/{cc1,collect2,lto1,lto-wrapper} \
+ $(gcc_lexec_dir)/liblto_plugin.so{,.0,.0.0.0} \
+ $(gcc_lib_dir)/{libgcc*,libgcov.a,*.o} \
+ $(header_files) \
+ $(shell test -e $(d)/$(gcc_lib_dir)/SYSCALLS.c.X \
+ && echo $(gcc_lib_dir)/SYSCALLS.c.X)
+
+ ifneq ($(GFDL_INVARIANT_FREE),yes)
+ files_go += \
+ $(PF)/share/man/man1/{cpp,gcc,gcov}$(pkg_ver).1
+ endif
+
+ ifeq ($(biarch64),yes)
+ files_go += $(gcc_lib_dir)/$(biarch64subdir)/{libgcc*,libgcov.a,*.o}
+ endif
+ ifeq ($(biarch32),yes)
+ files_go += $(gcc_lib_dir)/$(biarch32subdir)/{libgcc*,*.o}
+ endif
+ ifeq ($(biarchn32),yes)
+ files_go += $(gcc_lib_dir)/$(biarchn32subdir)/{libgcc*,libgcov.a,*.o}
+ endif
+ ifeq ($(biarchx32),yes)
+ files_go += $(gcc_lib_dir)/$(biarchx32subdir)/{libgcc*,libgcov.a,*.o}
+ endif
+endif
+
+# ----------------------------------------------------------------------
+define __do_gccgo
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_l) $(d_d)
+ dh_installdirs -p$(p_l) $(usr_lib$(2))
+ DH_COMPAT=2 dh_movefiles -p$(p_l) \
+ $(usr_lib$(2))/libgo.so.* $(usr_lib$(2))/go
+
+ debian/dh_doclink -p$(p_l) $(p_base)
+ debian/dh_doclink -p$(p_d) $(p_base)
+
+ dh_strip -p$(p_l) --dbg-package=$(p_d)
+ dh_compress -p$(p_l) -p$(p_d)
+ dh_fixperms -p$(p_l) -p$(p_d)
+ $(cross_makeshlibs) dh_makeshlibs -p$(p_l)
+ $(call cross_mangle_shlibs,$(p_l))
+ $(ignshld)DIRNAME=$(subst n,,$(2)) $(cross_shlibdeps) dh_shlibdeps -p$(p_l) \
+ $(call shlibdirs_to_search, \
+ $(subst go$(GO_SONAME),gcc$(GCC_SONAME),$(p_l)) \
+ $(subst go$(GO_SONAME),atomic$(ATOMIC_SONAME),$(p_l)) \
+ ,$(2))
+ $(call cross_mangle_substvars,$(p_l))
+ $(cross_gencontrol) dh_gencontrol -p$(p_l) -p$(p_d) \
+ -- -v$(DEB_VERSION) $(common_substvars)
+ $(call cross_mangle_control,$(p_l))
+ dh_installdeb -p$(p_l) -p$(p_d)
+ dh_md5sums -p$(p_l) -p$(p_d)
+ dh_builddeb -p$(p_l) -p$(p_d)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+endef
+
+do_gccgo = $(call __do_gccgo,lib$(1)go$(GO_SONAME),$(1))
+
+define install_gccgo_lib
+ mv $(d)/$(usr_lib$(3))/$(1).a debian/$(4)/$(gcc_lib_dir$(3))/
+ rm -f $(d)/$(usr_lib$(3))/$(1)*.{la,so}
+ dh_link -p$(4) \
+ /$(usr_lib$(3))/$(1).so.$(2) /$(gcc_lib_dir$(3))/$(1).so
+endef
+
+# __do_gccgo_libgcc(flavour,package,todir,fromdir)
+define __do_gccgo_libgcc
+ $(if $(findstring gccgo,$(PKGSOURCE)),
+ : # libgcc_s.so may be a linker script on some architectures
+ set -e; \
+ if [ -h $(4)/libgcc_s.so ]; then \
+ rm -f $(4)/libgcc_s.so; \
+ dh_link -p$(2) /$(libgcc_dir$(1))/libgcc_s.so.$(GCC_SONAME) \
+ $(3)/libgcc_s.so; \
+ else \
+ mv $(4)/libgcc_s.so $(d)/$(3)/libgcc_s.so; \
+ dh_link -p$(2) /$(libgcc_dir$(1))/libgcc_s.so.$(GCC_SONAME) \
+ $(3)/libgcc_s.so.$(GCC_SONAME); \
+ fi; \
+ $(if $(1), dh_link -p$(2) /$(3)/libgcc_s.so \
+ $(gcc_lib_dir)/libgcc_s_$(1).so;)
+ )
+endef
+
+define do_go_dev
+ dh_installdirs -p$(2) $(gcc_lib_dir$(1))
+ DH_COMPAT=2 dh_movefiles -p$(2) \
+ $(gcc_lib_dir$(1))/libgobegin.a
+ $(call install_gccgo_lib,libgo,$(GO_SONAME),$(1),$(2))
+ $(call __do_gccgo_libgcc,$(1),$(2),$(gcc_lib_dir$(1)),$(d)/$(usr_lib$(1)))
+endef
+# ----------------------------------------------------------------------
+$(binary_stamp)-libgo: $(install_stamp)
+ $(call do_gccgo,)
+
+$(binary_stamp)-lib64go: $(install_stamp)
+ $(call do_gccgo,64)
+
+$(binary_stamp)-lib32go: $(install_stamp)
+ $(call do_gccgo,32)
+
+$(binary_stamp)-libn32go: $(install_stamp)
+ $(call do_gccgo,n32)
+
+$(binary_stamp)-libx32go: $(install_stamp)
+ $(call do_gccgo,x32)
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-gccgo: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_go)
+ dh_installdirs -p$(p_go) $(dirs_go)
+
+ mv $(d)/$(usr_lib)/libgobegin.a \
+ $(d)/$(gcc_lib_dir)/
+ if [ -f $(d)/$(usr_lib64)/libgobegin.a ]; then \
+ mv $(d)/$(usr_lib64)/libgobegin.a \
+ $(d)/$(gcc_lib_dir)/64/; \
+ fi
+ if [ -f $(d)/$(usr_lib32)/libgobegin.a ]; then \
+ mv $(d)/$(usr_lib32)/libgobegin.a \
+ $(d)/$(gcc_lib_dir)/32/; \
+ fi
+ if [ -f $(d)/$(usr_libn32)/libgobegin.a ]; then \
+ mv $(d)/$(usr_libn32)/libgobegin.a \
+ $(d)/$(gcc_lib_dir)/n32/; \
+ fi
+ if [ -f $(d)/$(usr_libx32)/libgobegin.a ]; then \
+ mv $(d)/$(usr_libx32)/libgobegin.a \
+ $(d)/$(gcc_lib_dir)/x32/; \
+ fi
+
+ $(call do_go_dev,,$(p_go))
+
+ DH_COMPAT=2 dh_movefiles -p$(p_go) $(files_go)
+
+ifneq (,$(findstring gccgo,$(PKGSOURCE)))
+ rm -rf $(d_go)/$(gcc_lib_dir)/include/cilk
+ rm -rf $(d_go)/$(gcc_lib_dir)/include/omp.h
+endif
+
+ifneq ($(DEB_CROSS),yes)
+ ln -sf gccgo$(pkg_ver) \
+ $(d_go)/$(PF)/bin/$(DEB_TARGET_GNU_TYPE)-gccgo$(pkg_ver)
+ ln -sf gccgo$(pkg_ver) \
+ $(d_go)/$(PF)/bin/$(TARGET_ALIAS)-gccgo$(pkg_ver)
+ifneq ($(GFDL_INVARIANT_FREE),yes)
+ ln -sf gccgo$(pkg_ver).1 \
+ $(d_go)/$(PF)/share/man/man1/$(DEB_TARGET_GNU_TYPE)-gccgo$(pkg_ver).1
+ ln -sf gccgo$(pkg_ver).1 \
+ $(d_go)/$(PF)/share/man/man1/$(TARGET_ALIAS)-gccgo$(pkg_ver).1
+endif
+endif
+
+ifeq ($(with_standalone_go),yes)
+ifneq ($(DEB_CROSS),yes)
+ for i in gcc gcov gcc-ar gcc-nm gcc-ranlib; do \
+ ln -sf $$i$(pkg_ver) \
+ $(d_go)/$(PF)/bin/$(DEB_TARGET_GNU_TYPE)-$$i$(pkg_ver); \
+ ln -sf $$i$(pkg_ver) \
+ $(d_go)/$(PF)/bin/$(TARGET_ALIAS)-$$i$(pkg_ver); \
+ done
+ifneq ($(GFDL_INVARIANT_FREE),yes)
+ for i in gcc gcov gcc-ar gcc-nm gcc-ranlib; do \
+ ln -sf gcc$(pkg_ver).1 \
+ $(d_go)/$(PF)/share/man/man1/$(DEB_TARGET_GNU_TYPE)-$$i$(pkg_ver).1; \
+ ln -sf $$i$(pkg_ver).1 \
+ $(d_go)/$(PF)/share/man/man1/$(TARGET_ALIAS)-$$i$(pkg_ver).1; \
+ done
+endif
+endif
+endif
+
+ debian/dh_doclink -p$(p_go) $(p_xbase)
+
+# cp -p $(srcdir)/gcc/go/ChangeLog \
+# $(d_go)/$(docdir)/$(p_base)/go/changelog
+ debian/dh_rmemptydirs -p$(p_go)
+
+ dh_strip -p$(p_go)
+ dh_compress -p$(p_go)
+ dh_fixperms -p$(p_go)
+ dh_shlibdeps -p$(p_go)
+ dh_gencontrol -p$(p_go) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_go)
+ dh_md5sums -p$(p_go)
+ dh_builddeb -p$(p_go)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-gccgo-multi: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_go_m)
+ dh_installdirs -p$(p_go_m) $(docdir)
+
+ $(foreach flavour,$(flavours), \
+ $(call do_go_dev,$(flavour),$(p_go_m)))
+
+ debian/dh_doclink -p$(p_go_m) $(p_xbase)
+ debian/dh_rmemptydirs -p$(p_go_m)
+ dh_strip -p$(p_go_m)
+ dh_compress -p$(p_go_m)
+ dh_fixperms -p$(p_go_m)
+ dh_shlibdeps -p$(p_go_m)
+ dh_gencontrol -p$(p_go_m) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_go_m)
+ dh_md5sums -p$(p_go_m)
+ dh_builddeb -p$(p_go_m)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-go-doc: $(build_html_stamp) $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_god)
+ dh_installdirs -p$(p_god) \
+ $(docdir)/$(p_xbase)/go \
+ $(PF)/share/info
+ DH_COMPAT=2 dh_movefiles -p$(p_god) \
+ $(PF)/share/info/gccgo*
+
+ debian/dh_doclink -p$(p_god) $(p_xbase)
+ dh_installdocs -p$(p_god)
+ rm -f $(d_god)/$(docdir)/$(p_xbase)/copyright
+ cp -p html/gccgo.html $(d_god)/$(docdir)/$(p_xbase)/go/
+
+ dh_compress -p$(p_god)
+ dh_fixperms -p$(p_god)
+ dh_installdeb -p$(p_god)
+ dh_gencontrol -p$(p_god) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_md5sums -p$(p_god)
+ dh_builddeb -p$(p_god)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
diff --git a/debian/rules.d/binary-hppa64.mk b/debian/rules.d/binary-hppa64.mk
new file mode 100644
index 0000000..62864cb
--- /dev/null
+++ b/debian/rules.d/binary-hppa64.mk
@@ -0,0 +1,32 @@
+arch_binaries := $(arch_binaries) hppa64
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-hppa64: $(install_hppa64_stamp)
+ dh_testdir
+ dh_testroot
+
+# dh_installdirs -p$(p_hppa64)
+
+ rm -f $(d_hppa64)/usr/lib/libiberty.a
+ -find $(d_hppa64) ! -type d
+
+ : # provide as and ld links
+ dh_link -p $(p_hppa64) \
+ /usr/bin/hppa64-linux-gnu-as \
+ /$(hppa64libexecdir)/gcc/hppa64-linux-gnu/$(versiondir)/as \
+ /usr/bin/hppa64-linux-gnu-ld \
+ /$(hppa64libexecdir)/gcc/hppa64-linux-gnu/$(versiondir)/ld
+
+ debian/dh_doclink -p$(p_hppa64) $(p_xbase)
+ debian/dh_rmemptydirs -p$(p_hppa64)
+
+ dh_strip -p$(p_hppa64) -X.o -Xlibgcc.a -Xlibgcov.a
+ dh_compress -p$(p_hppa64)
+ dh_fixperms -p$(p_hppa64)
+ dh_shlibdeps -p$(p_hppa64)
+ dh_gencontrol -p$(p_hppa64) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_hppa64)
+ dh_md5sums -p$(p_hppa64)
+ dh_builddeb -p$(p_hppa64)
+
+ touch $@
diff --git a/debian/rules.d/binary-java.mk b/debian/rules.d/binary-java.mk
new file mode 100644
index 0000000..c0722d4
--- /dev/null
+++ b/debian/rules.d/binary-java.mk
@@ -0,0 +1,750 @@
+ifeq ($(with_gcj_base_only),yes)
+ arch_binaries := $(arch_binaries) jbase
+else
+ifeq ($(with_separate_libgcj),yes)
+ ifeq ($(PKGSOURCE),gcj-$(BASE_VERSION))
+ arch_binaries := $(arch_binaries) jbase
+ endif
+endif
+
+ifeq ($(with_libgcj),yes)
+ ifeq ($(with_java),yes)
+ arch_binaries := $(arch_binaries) java gcjjre
+ indep_binaries := $(indep_binaries) libgcjjar
+ endif
+
+ ifeq ($(with_javadev),yes)
+ arch_binaries := $(arch_binaries) gcjjdk libgcjdev libgcjdbg
+ ifneq ($(DEB_CROSS),yes)
+ indep_binaries := $(indep_binaries) libgcjsrc
+ ifeq ($(with_libgcj_doc),yes)
+ indep_binaries := $(indep_binaries) libgcjdoc
+ endif
+ endif
+ endif
+endif
+
+ifeq ($(with_gcj),yes)
+ arch_binaries := $(arch_binaries) gcj
+endif
+endif
+
+p_jbase = gcj$(pkg_ver)-base
+ifeq ($(with_separate_libgcj)-$(with_standalone_gcj),no-no)
+ p_jbase = gcc$(pkg_ver)-base
+endif
+p_gcj = gcj$(pkg_ver)$(cross_bin_arch)
+p_jdk = gcj$(pkg_ver)-jdk$(cross_bin_arch)
+p_jrehl = gcj$(pkg_ver)-jre-headless$(cross_bin_arch)
+p_jre = gcj$(pkg_ver)-jre$(cross_bin_arch)
+p_jar = gcj$(pkg_ver)-jre-lib$(cross_bin_arch)
+p_jsrc = gcj$(pkg_ver)-source
+p_jlib = libgcj$(PKG_LIBGCJ_EXT)$(cross_lib_arch)
+p_jdbg = libgcj$(PKG_GCJ_EXT)-dbg$(cross_lib_arch)
+p_jlibx = libgcj$(PKG_LIBGCJ_EXT)-awt$(cross_lib_arch)
+p_jgtk = libgcj$(PKG_GCJ_EXT)-awt-gtk$(cross_lib_arch)
+p_jqt = libgcj$(PKG_GCJ_EXT)-awt-qt$(cross_lib_arch)
+p_jdev = libgcj$(PKG_GCJ_EXT)-dev$(cross_lib_arch)
+p_jdoc = libgcj-doc
+
+d_jbase = debian/$(p_jbase)
+d_gcj = debian/$(p_gcj)
+d_jdk = debian/$(p_jdk)
+d_jrehl = debian/$(p_jrehl)
+d_jar = debian/$(p_jar)
+d_jsrc = debian/$(p_jsrc)
+d_jlib = debian/$(p_jlib)
+d_jdbg = debian/$(p_jdbg)
+d_jlibx = debian/$(p_jlibx)
+d_jgtk = debian/$(p_jgtk)
+d_jqt = debian/$(p_jqt)
+d_jdev = debian/$(p_jdev)
+d_jdoc = debian/$(p_jdoc)
+d_jre = debian/$(p_jre)
+
+GCJ_BASE_VERSION = $(BASE_VERSION)
+
+gcj_vlibdir = $(PF)/$(libdir)/gcj-$(BASE_VERSION)-$(GCJ_SONAME)
+
+jre_tools = java keytool orbd rmid rmiregistry tnameserv
+jdk_tools = appletviewer jar jarsigner javac javadoc javah native2ascii rmic serialver
+
+dirs_gcj = \
+ $(docdir)/$(p_jbase) \
+ $(PF)/bin \
+ $(PF)/share/man/man1 \
+ $(gcc_lexec_dir)
+
+files_gcj = \
+ $(PF)/bin/$(cmd_prefix)gcj$(pkg_ver) \
+ $(gcc_lexec_dir)/{ecj1,jc1,jvgenmain}
+
+ifneq ($(GFDL_INVARIANT_FREE),yes)
+ files_gcj += \
+ $(PF)/share/man/man1/$(cmd_prefix)gcj$(pkg_ver).1
+endif
+
+dirs_jdk = \
+ $(docdir)/$(p_jbase) \
+ $(PF)/bin \
+ $(PF)/share/man/man1 \
+ $(PF)/share/info \
+ $(gcc_lexec_dir) \
+ $(jvm_dir)/bin
+
+files_jdk = \
+ $(PF)/bin/{gappletviewer,gjdoc,gc-analyze,gjar,gjarsigner,gcjh,gjavah,gnative2ascii,grmic,gserialver,jv-convert,jcf-dump}$(pkg_ver) \
+ $(PF)/share/man/man1/{gappletviewer,gjdoc,gjar,gjarsigner,gcjh,gjavah,gnative2ascii,gserialver}$(pkg_ver).1 \
+ $(gcc_lib_dir)/include/{jni.h,jni_md.h,jvmpi.h} \
+ $(gcc_lib_dir)/include/{jawt.h,jawt_md.h} \
+ $(gcc_lib_dir)/include/gcj/libgcj-config.h \
+ $(PF)/$(libdir)/lib{gij,gcj,gcj-tools}.so \
+ $(PF)/$(libdir)/libgcj.spec \
+ $(jvm_dir)/include \
+ $(jvm_dir)/bin/{appletviewer,jar,jarsigner,javadoc,javah,native2ascii,rmic,serialver} \
+ $(PF)/lib/jvm-exports
+
+ifneq ($(GFDL_INVARIANT_FREE),yes)
+ files_jdk += \
+ $(PF)/share/info/gcj* \
+ $(PF)/share/man/man1/{gc-analyze,grmic,jv-convert,jcf-dump}$(pkg_ver).1
+endif
+
+dirs_jrehl = \
+ $(docdir)/$(p_jbase) \
+ $(PF)/bin \
+ $(PF)/share/man/man1 \
+ $(jvm_dir)/bin \
+ $(jvm_dir)/jre/lib \
+ $(jvm_dir)/lib \
+ var/lib/gcj$(pkg_ver)
+
+files_jrehl = \
+ $(PF)/bin/{gij,gcj-dbtool,gorbd,grmid,grmiregistry,gkeytool,gtnameserv}$(pkg_ver) \
+ $(PF)/share/man/man1/{gorbd,grmid,grmiregistry,gkeytool,gtnameserv}$(pkg_ver).1 \
+ $(jvm_dir)/jre/bin \
+ $(jvm_dir)/bin/{java,keytool,orbd,rmid,rmiregistry,tnameserv} \
+ $(jvm_dir)/jre/lib/rt.jar \
+ $(jvm_dir)/jre/lib/$(java_cpu)/{client,server} \
+ $(jvm_dir)/lib/tools.jar
+
+ifneq ($(GFDL_INVARIANT_FREE),yes)
+ files_jrehl += \
+ $(PF)/share/man/man1/{gij,gcj-dbtool}$(pkg_ver).1
+endif
+
+dirs_jre = \
+ $(docdir)/$(p_jbase) \
+ $(jvm_dir)/jre/lib/$(java_cpu)
+
+files_jre = \
+ $(jvm_dir)/jre/lib/$(java_cpu)/libjawt.so
+
+dirs_jlib = \
+ $(docdir)/$(p_jbase) \
+ $(gcj_vlibdir) \
+ $(PF)/$(libdir) \
+ $(jvm_dir)/jre/lib
+
+files_jlib = \
+ $(PF)/$(libdir)/libgij.so.* \
+ $(PF)/$(libdir)/libgcj-tools.so.* \
+ $(PF)/$(libdir)/libgcj.so.* \
+ $(gcj_vlibdir)/libjvm.so \
+ $(gcj_vlibdir)/libjavamath.so \
+ $(jvm_dir)/jre/lib/security
+
+# $(gcj_vlibdir)/libgconfpeer.so
+
+ifeq ($(with_java_alsa),yes)
+ files_jlib += \
+ $(gcj_vlibdir)/libgjsmalsa.so
+endif
+
+dirs_jar = \
+ $(PF)/share/java
+
+files_jar = \
+ $(PF)/share/java/libgcj-$(BASE_VERSION).jar \
+ $(PF)/share/java/libgcj-tools-$(BASE_VERSION).jar
+
+dirs_jlibx = \
+ $(PF)/$(libdir) \
+ $(gcj_vlibdir) \
+ $(PF)/share/java
+
+files_jlibx = \
+ $(gcj_vlibdir)/libjawt.so \
+ $(gcj_vlibdir)/libgtkpeer.so
+
+#files_jgtk = \
+# $(gcj_vlibdir)/libgtkpeer.so
+#files_jqt = \
+# $(gcj_vlibdir)/libqtpeer.so
+
+dirs_jdev = \
+ $(PF)/{include,lib} \
+ $(jvm_dir)/include
+
+files_jdev = \
+ $(cxx_inc_dir)/{org,gcj,java,javax} \
+ $(cxx_inc_dir)/gnu/{awt,classpath,gcj,java,javax} \
+ $(PF)/$(libdir)/pkgconfig/libgcj-$(BASE_VERSION).pc \
+ $(gcj_vlibdir)/lib*peer.so
+
+ifeq ($(with_static_java),yes)
+ files_jdev += \
+ $(PF)/$(libdir)/libgij.a \
+ $(PF)/$(libdir)/libgcj.a \
+ $(PF)/$(libdir)/libgcj-tools.a
+endif
+
+ifeq (,$(p_l64gcc))
+ p_l64gcc = lib64gcc$(GCC_SONAME)
+ d_l64gcc = debian/$(p_l64gcc)
+endif
+
+ifeq ($(with_standalone_gcj),yes)
+
+ dirs_gcj += \
+ $(gcc_lib_dir)/include \
+ $(PF)/share/man/man1
+
+# XXX: what about triarch mapping?
+ files_gcj += \
+ $(PF)/bin/{cpp,gcc,gcov}$(pkg_ver) \
+ $(gcc_lexec_dir)/{collect2,lto1,lto-wrapper} \
+ $(gcc_lexec_dir)/liblto_plugin.so{,.0,.0.0.0} \
+ $(gcc_lib_dir)/{libgcc*,libgcov.a,*.o} \
+ $(header_files) \
+ $(shell test -e $(d)/$(gcc_lib_dir)/SYSCALLS.c.X \
+ && echo $(gcc_lib_dir)/SYSCALLS.c.X)
+
+ ifneq ($(GFDL_INVARIANT_FREE),yes)
+ files_gcj += \
+ $(PF)/share/man/man1/{cpp,gcc,gcov}$(pkg_ver).1
+ endif
+
+ ifeq ($(biarch64),yes)
+ files_gcj += $(gcc_lib_dir)/$(biarch64subdir)/{libgcc*,libgcov.a,*.o}
+ endif
+ ifeq ($(biarch32),yes)
+ files_gcj += $(gcc_lib_dir)/$(biarch32subdir)/{libgcc*,*.o}
+ endif
+ ifeq ($(biarchn32),yes)
+ files_gcj += $(gcc_lib_dir)/$(biarchn32subdir)/{libgcc*,libgcov.a,*.o}
+ endif
+ ifeq ($(biarchx32),yes)
+ files_gcj += $(gcc_lib_dir)/$(biarchx32subdir)/{libgcc*,libgcov.a,*.o}
+ endif
+endif
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-jbase: $(install_dependencies)
+ dh_testdir
+ dh_testroot
+ rm -rf $(d_jbase)
+ dh_installdirs -p$(p_jbase)
+ dh_installdocs -p$(p_jbase)
+ dh_installchangelogs -p$(p_jbase)
+ dh_compress -p$(p_jbase)
+ dh_fixperms -p$(p_jbase)
+ dh_gencontrol -p$(p_jbase) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_jbase)
+ dh_md5sums -p$(p_jbase)
+ dh_builddeb -p$(p_jbase)
+ touch $@
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-gcj: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_gcj)
+ dh_installdirs -p$(p_gcj) $(dirs_gcj)
+
+ifeq ($(DEB_CROSS),yes)
+ ln -sf ../../../gcc/$(DEB_HOST_GNU_TYPE)/$(BASE_VERSION)/ecj1 \
+ $(d)/$(gcc_lib_dir)/ecj1
+endif
+ DH_COMPAT=2 dh_movefiles -p$(p_gcj) $(files_gcj)
+
+ifneq (,$(filter $(DEB_HOST_ARCH), arm armel))
+ ln -sf ../../ecj1 $(d_gcj)/$(gcc_lexec_dir)/ecj1
+endif
+ifneq ($(DEB_CROSS),yes)
+ ln -sf gcj$(pkg_ver) \
+ $(d_gcj)/$(PF)/bin/$(TARGET_ALIAS)-gcj$(pkg_ver)
+ ifneq ($(GFDL_INVARIANT_FREE),yes)
+ ln -sf gcj$(pkg_ver).1 \
+ $(d_gcj)/$(PF)/share/man/man1/$(TARGET_ALIAS)-gcj$(pkg_ver).1
+ endif
+endif
+ debian/dh_doclink -p$(p_gcj) $(p_jbase)
+ debian/dh_rmemptydirs -p$(p_gcj)
+
+ dh_strip -p$(p_gcj)
+ dh_compress -p$(p_gcj)
+ dh_fixperms -p$(p_gcj)
+ dh_shlibdeps -p$(p_gcj) -Xecj1
+ dh_gencontrol -p$(p_gcj) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_gcj)
+ dh_md5sums -p$(p_gcj)
+ dh_builddeb -p$(p_gcj)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-libgcjjar: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ dh_installdirs -p$(p_jar) $(dirs_jar)
+ DH_COMPAT=2 dh_movefiles -p$(p_jar) $(files_jar)
+
+ ln -sf libgcj-$(BASE_VERSION).jar \
+ $(d_jar)/$(PF)/share/java/libgcj-$(GCC_VERSION).jar
+ ln -sf libgcj-tools-$(BASE_VERSION).jar \
+ $(d_jar)/$(PF)/share/java/libgcj-tools-$(GCC_VERSION).jar
+ debian/dh_doclink -p$(p_jar) $(p_jbase)
+ debian/dh_rmemptydirs -p$(p_jar)
+ dh_compress -p$(p_jar)
+ dh_fixperms -p$(p_jar)
+ dh_gencontrol -p$(p_jar) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_jar)
+ dh_md5sums -p$(p_jar)
+ dh_builddeb -p$(p_jar)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+# ----------------------------------------------------------------------
+$(build_javasrc_stamp): $(build_stamp)
+ PATH=$(PWD)/bin:$$PATH \
+ $(MAKE) -C $(buildlibdir)/libjava src.zip
+ touch $@
+
+$(binary_stamp)-libgcjsrc: $(install_stamp) $(build_javasrc_stamp)
+ dh_testdir
+ dh_testroot
+
+ dh_installdirs -p$(p_jsrc) $(PF)/share/java $(jvm_dir)
+ cp -p $(buildlibdir)/libjava/src.zip \
+ $(d_jsrc)/$(PF)/share/java/libgcj-src-$(BASE_VERSION).zip
+ dh_link -p$(p_jsrc) \
+ $(PF)/share/java/libgcj-src-$(BASE_VERSION).zip \
+ $(jvm_dir)/src.zip
+ debian/dh_doclink -p$(p_jsrc) $(p_jbase)
+ debian/dh_rmemptydirs -p$(p_jsrc)
+ dh_compress -p$(p_jsrc)
+ dh_fixperms -p$(p_jsrc)
+ dh_gencontrol -p$(p_jsrc) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_jsrc)
+ dh_md5sums -p$(p_jsrc)
+ dh_builddeb -p$(p_jsrc)
+
+ touch $@
+
+# ----------------------------------------------------------------------
+libgcj_version = $$($(builddir)/gcc/xgcc -B$(builddir)/gcc/ --version \
+ | sed -n '/^xgcc/s/[^)]*) *\(.*\)/\1/p' | sed 's/ \[[^[]*$$//')
+libgcj_title = LibGCJ Classpath
+libgcjhbox_href = http://gcc.gnu.org/java
+libgcjhbox = <span class='logo'><a href='$(libgcjhbox_href)' target='_top'>$(title)</a> ($(libgcj_version))
+
+$(build_javadoc_stamp): $(build_stamp) $(build_javasrc_stamp)
+ mkdir -p $(builddir)/java-src
+ cd $(builddir)/java-src && fastjar -xf $(buildlibdir)/libjava/src.zip
+
+ mkdir -p $(builddir)/html
+ $(buildlibdir)/libjava/gjdoc \
+ -licensetext \
+ -use \
+ -sourcepath "$(builddir)/java-src" \
+ -encoding UTF-8 \
+ -breakiterator \
+ -linksource \
+ -splitindex \
+ -d $(builddir)/html \
+ -doctitle "$(libgcj_title) $(libgcj_version)" \
+ -windowtitle "$(libgcj_title) $(libgcj_version) Documentation" \
+ -header "$(classpathbox)" \
+ -footer "$(classpathbox)" \
+ -subpackages gnu:java:javax:org
+
+ touch $@
+
+$(binary_stamp)-libgcjdoc: $(install_stamp) $(build_javadoc_stamp)
+ dh_testdir
+ dh_testroot
+
+ dh_installdocs -p$(p_jdoc)
+ sed -i 's/gcc$(pkg_ver)-base/$(p_jbase)/' $(d_jdoc)/usr/share/doc-base/libgcj-doc
+ dh_installchangelogs -p$(p_jdoc)
+ mkdir -p $(d_jdoc)/usr/share/doc/$(p_jbase)
+ cp -al $(builddir)/html $(d_jdoc)/usr/share/doc/$(p_jbase)/api
+ ln -sf api $(d_jdoc)/usr/share/doc/$(p_jbase)/html
+ ln -sf ../$(p_jbase)/api $(d_jdoc)/usr/share/doc/$(p_jdoc)/api
+ ln -sf ../$(p_jbase)/html $(d_jdoc)/usr/share/doc/$(p_jdoc)/html
+ dh_compress -p$(p_jdoc) -X.java -X.c
+ dh_fixperms -p$(p_jdoc)
+ dh_gencontrol -p$(p_jdoc) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_jdoc)
+ dh_md5sums -p$(p_jdoc)
+ dh_builddeb -p$(p_jdoc)
+
+ touch $@
+
+# ----------------------------------------------------------------------
+
+#peer_pkgs =
+#ifneq (,$(findstring gtk, $(java_awt_peers)))
+# peer_pkgs += -p$(p_jgtk)
+#endif
+#ifneq (,$(findstring qt, $(java_awt_peers)))
+# peer_pkgs += -p$(p_jqt)
+#endif
+
+$(binary_stamp)-java: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ dh_installdirs -p$(p_jrehl) $(dirs_jrehl)
+ dh_installdirs -p$(p_jlib) $(dirs_jlib)
+ dh_installdirs -p$(p_jlibx) $(dirs_jlibx)
+
+ DH_COMPAT=2 dh_movefiles -p$(p_jrehl) $(files_jrehl)
+ DH_COMPAT=2 dh_movefiles -p$(p_jlib) $(files_jlib)
+ DH_COMPAT=2 dh_movefiles -p$(p_jlibx) $(files_jlibx)
+#ifneq (,$(findstring gtk, $(java_awt_peers)))
+# DH_COMPAT=2 dh_movefiles -p$(p_jgtk) $(files_jgtk)
+#endif
+#ifneq (,$(findstring qt, $(java_awt_peers)))
+# DH_COMPAT=2 dh_movefiles -p$(p_jqt) $(files_jqt)
+#endif
+
+ dh_link -p$(p_jrehl) \
+ $(jvm_dir) $(PF)/lib/jvm/java-gcj$(pkg_ver) \
+ $(PF)/bin/gij$(pkg_ver) $(jvm_dir)/bin/gij \
+ $(PF)/bin/gij$(pkg_ver) $(jvm_dir)/jre/bin/gij \
+ $(PF)/bin/gcj-dbtool$(pkg_ver) $(jvm_dir)/bin/gcj-dbtool \
+ $(PF)/bin/gcj-dbtool$(pkg_ver) $(jvm_dir)/jre/bin/gcj-dbtool \
+ $(PF)/share/man/man1/gkeytool$(pkg_ver).1 $(jvm_dir)/man/man1/keytool.1 \
+ $(PF)/share/man/man1/gorbd$(pkg_ver).1 $(jvm_dir)/man/man1/orbd.1 \
+ $(PF)/share/man/man1/grmid$(pkg_ver).1 $(jvm_dir)/man/man1/rmid.1 \
+ $(PF)/share/man/man1/grmiregistry$(pkg_ver).1 $(jvm_dir)/man/man1/rmiregistry.1 \
+ $(PF)/share/man/man1/gtnameserv$(pkg_ver).1 $(jvm_dir)/man/man1/tnameserv.1 \
+
+ifneq ($(GFDL_INVARIANT_FREE),yes)
+ dh_link -p$(p_jrehl) \
+ $(PF)/share/man/man1/gij$(pkg_ver).1 $(jvm_dir)/man/man1/java.1 \
+ $(PF)/share/man/man1/grmic$(pkg_ver).1 $(jvm_dir)/man/man1/rmiregistry.1
+endif
+
+ifneq ($(DEB_TARGET_ARCH_CPU),$(java_cpu))
+ ln -sf $(java_cpu) $(d_jlib)/$(jvm_dir)/jre/lib/$(DEB_TARGET_ARCH_CPU)
+endif
+
+ dh_link -p$(p_jlib) \
+ /etc/java/cacerts-gcj /$(jvm_dir)/jre/lib/cacerts \
+ $(foreach i, jvm javamath, \
+ /$(gcj_vlibdir)/lib$(i).so /$(jvm_dir)/lib/lib$(i).so)
+
+ dh_link -p$(p_jlib) \
+ /etc/java/security/classpath.security \
+ /$(jvm_dir)/jre/lib/security/java.security
+
+ dh_link -p$(p_jlibx) \
+ $(foreach i, jawt, $(gcj_vlibdir)/lib$(i).so $(jvm_dir)/lib/lib$(i).so)
+
+ifeq ($(DEB_HOST_ARCH),hppa)
+ mv $(d_jrehl)/$(PF)/bin/gij$(pkg_ver) \
+ $(d_jrehl)/$(PF)/bin/gij$(pkg_ver).bin
+ install -m755 debian/gij-hppa $(d_jrehl)/$(PF)/bin/gij$(pkg_ver)
+endif
+
+ ln -s ../libgcj.so.$(GCJ_SONAME) \
+ $(d_jlib)/$(gcj_vlibdir)/libgcj_bc.so.1
+
+ : # provide .jinfo file
+ ( \
+ echo 'name=$(jvm_name_short)'; \
+ echo 'alias=java-gcj$(pkg_ver)'; \
+ echo 'priority=$(priority)'; \
+ echo 'section=main'; \
+ echo ''; \
+ for i in $(jre_tools); do \
+ echo "jre $$i /$(jvm_dir)/jre/bin/$$i"; \
+ done; \
+ for i in $(jdk_tools); do \
+ echo "jdk $$i /$(jvm_dir)/bin/$$i"; \
+ done; \
+ ) > $(d_jrehl)/usr/lib/jvm/.java-gcj$(pkg_ver).jinfo
+
+ifneq (,$(findstring gcj,$(p_jbase)))
+ cp -p $(srcdir)/libjava/{NEWS,README,THANKS} \
+ $(d_jrehl)/usr/share/doc/$(p_jbase)/
+endif
+ debian/dh_doclink -p$(p_jrehl) $(p_jbase)
+ debian/dh_doclink -p$(p_jlib) $(p_jbase)
+ debian/dh_doclink -p$(p_jlibx) $(p_jbase)
+
+#ifneq (,$(findstring gtk, $(java_awt_peers)))
+# debian/dh_doclink -p$(p_jgtk) $(p_jbase)
+#endif
+#ifneq (,$(findstring qt, $(java_awt_peers)))
+# debian/dh_doclink -p$(p_jqt) $(p_jbase)
+#endif
+
+ifeq ($(with_separate_libgcj),yes)
+ ifeq ($(PKGSOURCE),gcj-$(BASE_VERSION))
+ ifeq ($(with_check),yes)
+ cp -p test-summary $(d_jrehl)/usr/share/doc/$(p_jbase)/test-summary
+ endif
+ endif
+endif
+ debian/dh_rmemptydirs -p$(p_jrehl)
+ debian/dh_rmemptydirs -p$(p_jlib)
+ debian/dh_rmemptydirs -p$(p_jlibx)
+
+ mkdir -p $(d_jrehl)/var/lib/gcj$(pkg_ver)
+
+ dh_makeshlibs -p$(p_jlib) -V '$(p_jlib) (>= $(DEB_GCJ_SOVERSION))'
+ echo "libgcj_bc 1 libgcj-bc (>= 4.2.2-1)" >> debian/$(p_jlib)/DEBIAN/shlibs
+ cat debian/$(p_jlib)/DEBIAN/shlibs >> debian/shlibs.local
+
+ dh_makeshlibs -p$(p_jlibx) -V '$(p_jlibx) (>= $(DEB_GCJ_SOVERSION))'
+
+#ifneq (,$(findstring gtk, $(java_awt_peers)))
+# dh_makeshlibs -p$(p_jgtk) -V '$(p_jgtk) (>= $(DEB_GCJ_SOVERSION))'
+#endif
+#ifneq (,$(findstring qt, $(java_awt_peers)))
+# dh_makeshlibs -p$(p_jqt) -V '$(p_jqt) (>= $(DEB_GCJ_SOVERSION))'
+#endif
+
+ dh_strip -X/bin/ --dbg-package=$(p_jdbg) \
+ -p$(p_jrehl) -p$(p_jlib) -p$(p_jlibx) $(peer_pkgs)
+ rm -f $(d_jdbg)/$(gcc_lib_dir)/libgcj_bc.so
+
+ mkdir -p $(d_jlib)/usr/share/lintian/overrides
+ cp -p debian/$(p_jlib).overrides \
+ $(d_jlib)/usr/share/lintian/overrides/$(p_jlib)
+ mkdir -p $(d_jlibx)/usr/share/lintian/overrides
+ cp -p debian/$(p_jlibx).overrides \
+ $(d_jlibx)/usr/share/lintian/overrides/$(p_jlibx)
+ mkdir -p $(d_jrehl)/usr/share/lintian/overrides
+ cp -p debian/$(p_jrehl).overrides \
+ $(d_jrehl)/usr/share/lintian/overrides/$(p_jrehl)
+
+ dh_compress -p$(p_jrehl) -p$(p_jlib) -p$(p_jlibx) $(peer_pkgs)
+ dh_fixperms -p$(p_jrehl) -p$(p_jlib) -p$(p_jlibx) $(peer_pkgs)
+# the libstdc++ binary packages aren't built yet ...
+ echo 'libstdc++ $(CXX_SONAME) libstdc++$(CXX_SONAME) (>= $(DEB_STDCXX_SOVERSION))' \
+ >> debian/shlibs.local
+ -[ -d $(d_l64gcc) ] && mv $(d_l64gcc) $(d_l64gcc).saved
+ifeq ($(with_separate_libgcj)-$(with_standalone_gcj),yes-no)
+ dh_shlibdeps \
+ -L$(p_jlib) \
+ -l$(d_lib)/$(PF)/$(libdir):$(d_jlib)/$(PF)/$(libdir) \
+ -p$(p_jrehl) -p$(p_jlib) -p$(p_jlibx) $(peer_pkgs)
+else
+ dh_shlibdeps \
+ -L$(p_lgcc) \
+ -L$(p_jlib) \
+ -l:$(d)/$(PF)/$(libdir):$(d_lib)/$(PF)/$(libdir):$(d_jlib)/$(PF)/$(libdir):$(d_lgcc)/lib \
+ -p$(p_jrehl) -p$(p_jlib) -p$(p_jlibx) $(peer_pkgs)
+endif
+ -[ -d $(d_l64gcc).saved ] && mv $(d_l64gcc).saved $(d_l64gcc)
+ sed -e 's/$(p_jlib)[^,]*//' -e 's/, *,/,/' debian/$(p_jlib).substvars \
+ >> debian/$(p_jlib).substvars.tmp \
+ && mv -f debian/$(p_jlib).substvars.tmp debian/$(p_jlib).substvars
+ rm -f debian/shlibs.local
+
+ dh_gencontrol \
+ -p$(p_jrehl) -p$(p_jlib) -p$(p_jlibx) $(peer_pkgs) \
+ -- -v$(DEB_VERSION) $(common_substvars)
+
+ dh_installdeb -p$(p_jrehl) -p$(p_jlib) -p$(p_jlibx) $(peer_pkgs)
+ dh_md5sums -p$(p_jrehl) -p$(p_jlib) -p$(p_jlibx) $(peer_pkgs)
+ dh_builddeb -p$(p_jrehl) -p$(p_jlib) -p$(p_jlibx) $(peer_pkgs)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-gcjjdk: $(build_html_stamp) $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_jdk)
+ dh_installdirs -p$(p_jdk) $(dirs_jdk)
+
+# mkdir -p $(d_jdk)/usr/share/lintian/overrides
+# cp -p debian/$(p_jdk).overrides \
+# $(d_jdk)/usr/share/lintian/overrides/$(p_jdk)
+ cp -p $(srcdir)/gcc/java/ChangeLog \
+ $(d_jdk)/usr/share/doc/$(p_jbase)/changelog.gcj
+ cp -p $(srcdir)/libjava/ChangeLog \
+ $(d_jdk)/usr/share/doc/$(p_jbase)/changelog.libjava
+
+ifeq ($(with_standalone_gcj),yes)
+ rm -f $(d)/$(PF)/$(libdir)/libgcc_s.so
+ ln -sf /$(libdir)/libgcc_s.so.$(GCC_SONAME) $(d)/$(gcc_lib_dir)/libgcc_s.so
+endif
+ DH_COMPAT=2 dh_movefiles -p$(p_jdk) $(files_jdk)
+
+ for i in libgij libgcj libgcj-tools; do \
+ dh_link -p$(p_jdk) \
+ /$(PF)/$(libdir)/$$i.so.$(GCJ_SONAME) /$(gcc_lib_dir)/$$i.so \
+ /$(PF)/$(libdir)/$$i.so.$(GCJ_SONAME) /$(jvm_dir)/lib/$$i.so; \
+ rm -f $(d_jdk)/$(PF)/$(libdir)/$$i.{la,so}; \
+ done
+
+ install -m755 debian/jdb.sh $(d_jdk)/$(jvm_dir)/bin/jdb
+
+ mv $(d_jdk)/$(PF)/$(libdir)/libgcj.spec $(d_jdk)/$(gcc_lib_dir)/
+
+ install -m 755 $(d)/$(PF)/$(libdir)/libgcj_bc.so.1 \
+ $(d_jdk)/$(gcc_lib_dir)/libgcj_bc.so
+ $(CC_FOR_TARGET) -shared -fpic -xc /dev/null \
+ -o build/libgcj.so -Wl,-soname,libgcj.so.$(GCJ_SONAME) -nostdlib
+ $(CC_FOR_TARGET) -shared -fpic \
+ $(srcdir)/libjava/libgcj_bc.c \
+ -o $(d_jdk)/$(gcc_lib_dir)/libgcj_bc.so \
+ -Wl,-soname,libgcj_bc.so.1 $(builddir)/libgcj.so -shared-libgcc
+
+ dh_link -p$(p_jdk) \
+ $(gcc_lib_dir)/include/gcj $(jvm_dir)/include/gcj \
+ usr/bin/ecj $(jvm_dir)/bin/javac \
+ usr/bin/fastjar $(jvm_dir)/bin/jar \
+ $(PF)/share/man/man1/ecj.1.gz $(jvm_dir)/man/man1/javac.1.gz \
+ $(PF)/share/man/man1/fastjar.1.gz $(jvm_dir)/man/man1/jar.1.gz
+
+ dh_link -p$(p_jdk) \
+ $(PF)/bin/gcj$(pkg_ver) $(jvm_dir)/bin/gcj \
+ $(PF)/share/man/man1/gjarsigner$(pkg_ver).1 $(jvm_dir)/man/man1/jarsigner.1 \
+ $(PF)/share/man/man1/gjdoc$(pkg_ver).1 $(jvm_dir)/man/man1/javadoc.1 \
+ $(PF)/share/man/man1/gjavah$(pkg_ver).1 $(jvm_dir)/man/man1/javah.1 \
+ $(PF)/share/man/man1/gserialver$(pkg_ver).1 $(jvm_dir)/man/man1/serialver.1 \
+ $(PF)/share/man/man1/gappletviewer$(pkg_ver).1 $(jvm_dir)/man/man1/appletviewer.1
+
+ifneq ($(GFDL_INVARIANT_FREE),yes)
+ cp -p html/gcj.html $(d_jdk)/$(docdir)/$(p_jbase)/
+endif
+ debian/dh_doclink -p$(p_jdk) $(p_jbase)
+
+ cp -p debian/FAQ.gcj $(d_jdk)/$(docdir)/$(p_jbase)/
+
+ cp -p debian/gcj-wrapper$(pkg_ver) $(d_jdk)/$(PF)/bin/
+ chmod 755 $(d_jdk)/$(PF)/bin/gcj-wrapper$(pkg_ver)
+ cp -p debian/gcj-wrapper$(pkg_ver).1 $(d_jdk)/$(PF)/share/man/man1/
+
+ debian/dh_rmemptydirs -p$(p_jdk)
+
+ dh_strip -p$(p_jdk)
+ dh_compress -p$(p_jdk) -X.java
+ dh_fixperms -p$(p_jdk)
+ dh_shlibdeps -p$(p_jdk) -l$(d_lib)/$(PF)/$(libdir):$(d_jlib)/$(PF)/lib -Xecj1
+ dh_gencontrol -p$(p_jdk) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_jdk)
+ dh_md5sums -p$(p_jdk)
+ dh_builddeb -p$(p_jdk)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-libgcjdev: $(build_html_stamp) $(install_stamp) $(binary_stamp)-java
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ dh_installdirs -p$(p_jdev) $(dirs_jdev)
+
+ DH_COMPAT=2 dh_movefiles -p$(p_jdev) $(files_jdev)
+
+ifeq ($(with_static_java),yes)
+ for i in libgij libgcj libgcj-tools; do \
+ mv $(d_jdev)/$(PF)/$(libdir)/$$i.a $(d_jdev)/$(gcc_lib_dir)/; \
+ done
+endif
+
+ ln -sf libgcj-$(BASE_VERSION).pc \
+ $(d_jdev)/$(PF)/$(libdir)/pkgconfig/libgcj$(PKG_GCJ_EXT).pc
+ sed -i -e 's,-[IL][^ ]* *,,' \
+ $(d_jdev)/$(PF)/$(libdir)/pkgconfig/libgcj-$(BASE_VERSION).pc
+
+ debian/dh_doclink -p$(p_jdev) $(p_jbase)
+
+ debian/dh_rmemptydirs -p$(p_jdev)
+
+# mkdir -p $(d_jdev)/usr/share/lintian/overrides
+# cp -p debian/libgcj$(PKG_GCJ_EXT)-dev.overrides \
+# $(d_jdev)/usr/share/lintian/overrides/$(p_jdev)
+
+ DH_COMPAT=5 dh_strip -p$(p_jdev) --dbg-package=$(p_jdbg)
+ dh_compress -p$(p_jdev) -X.java
+ dh_fixperms -p$(p_jdev)
+ifeq ($(with_separate_libgcj)-$(with_standalone_gcj),yes-no)
+ dh_shlibdeps \
+ -l$(d_lib)/$(PF)/$(libdir):$(d_jlib)/$(PF)/$(libdir) \
+ -p$(p_jdev)
+else
+ dh_shlibdeps \
+ -L$(p_lgcc) \
+ -l:$(d)/$(PF)/$(libdir):$(d_lib)/$(PF)/$(libdir):$(d_jlib)/$(PF)/$(libdir):$(d_lgcc)/lib \
+ -p$(p_jdev)
+endif
+ dh_gencontrol -p$(p_jdev) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_jdev)
+ dh_md5sums -p$(p_jdev)
+ dh_builddeb -p$(p_jdev)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-libgcjdbg: $(install_stamp) $(binary_stamp)-java $(binary_stamp)-libgcjdev $(binary_stamp)-gcjjre
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ debian/dh_doclink -p$(p_jdbg) $(p_jbase)
+
+ for i in libgij libgcj libgcj-tools; do \
+ if [ -f $(d_jdbg)/usr/lib/debug/usr/lib/$$i.so.$(GCJ_SONAME).0.0 ]; then \
+ ln -sf $$i.so.$(GCJ_SONAME).0.0 \
+ $(d_jdbg)/usr/lib/debug/usr/lib/$$i.so.$(GCJ_SONAME); \
+ fi; \
+ done
+# ln -sf libgconfpeer.so.0.0.0 \
+# $(d_jdbg)/usr/lib/debug/$(gcj_vlibdir)/libgconfpeer.so.0
+
+ dh_compress -p$(p_jdbg)
+ dh_fixperms -p$(p_jdbg)
+ dh_gencontrol -p$(p_jdbg) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_jdbg)
+ dh_md5sums -p$(p_jdbg)
+ dh_builddeb -p$(p_jdbg)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-gcjjre: $(install_stamp) $(binary_stamp)-java
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ dh_installdirs -p$(p_jre) $(dirs_jre)
+ DH_COMPAT=2 dh_movefiles -p$(p_jre) $(files_jre)
+
+ debian/dh_doclink -p$(p_jre) $(p_jbase)
+ DH_COMPAT=5 dh_strip -p$(p_jre) --dbg-package=$(p_jdbg)
+ dh_compress -p$(p_jre)
+ dh_fixperms -p$(p_jre)
+ dh_gencontrol -p$(p_jre) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_jre)
+ dh_md5sums -p$(p_jre)
+ dh_builddeb -p$(p_jre)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
diff --git a/debian/rules.d/binary-libasan.mk b/debian/rules.d/binary-libasan.mk
new file mode 100644
index 0000000..95f0a02
--- /dev/null
+++ b/debian/rules.d/binary-libasan.mk
@@ -0,0 +1,83 @@
+$(lib_binaries) += libasan
+ifeq ($(with_lib64asan),yes)
+ $(lib_binaries) += lib64asan
+endif
+ifeq ($(with_lib32asan),yes)
+ $(lib_binaries) += lib32asan
+endif
+ifeq ($(with_libn32asan),yes)
+ $(lib_binaries) += libn32asan
+endif
+ifeq ($(with_libx32asan),yes)
+ $(lib_binaries) += libx32asan
+endif
+ifeq ($(with_libhfasan),yes)
+ $(lib_binaries) += libhfasan
+endif
+ifeq ($(with_libsfasan),yes)
+ $(lib_binaries) += libsfasan
+endif
+
+define __do_asan
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_l) $(d_d)
+ dh_installdirs -p$(p_l) $(usr_lib$(2))
+ $(if $(empty_sanitizer_packages),, \
+ DH_COMPAT=2 dh_movefiles -p$(p_l) $(usr_lib$(2))/libasan.so.* )
+
+ debian/dh_doclink -p$(p_l) $(p_base)
+ debian/dh_doclink -p$(p_d) $(p_base)
+
+ if [ -f debian/$(p_l).overrides ]; then \
+ mkdir -p debian/$(p_l)/usr/share/lintian/overrides; \
+ cp debian/$(p_l).overrides debian/$(p_l)/usr/share/lintian/overrides/$(p_l); \
+ fi
+
+ dh_strip -p$(p_l) --dbg-package=$(p_d)
+ dh_compress -p$(p_l) -p$(p_d)
+ dh_fixperms -p$(p_l) -p$(p_d)
+ $(cross_makeshlibs) dh_makeshlibs -p$(p_l)
+ $(call cross_mangle_shlibs,$(p_l))
+ $(ignshld)DIRNAME=$(subst n,,$(2)) $(cross_shlibdeps) dh_shlibdeps -p$(p_l) \
+ $(call shlibdirs_to_search, \
+ $(subst asan$(ASAN_SONAME),gcc$(GCC_SONAME),$(p_l)) \
+ $(subst asan$(ASAN_SONAME),stdc++$(CXX_SONAME),$(p_l)) \
+ ,$(2))
+ $(call cross_mangle_substvars,$(p_l))
+ $(cross_gencontrol) dh_gencontrol -p$(p_l) -p$(p_d) \
+ -- -v$(DEB_VERSION) $(common_substvars)
+ $(call cross_mangle_control,$(p_l))
+ dh_installdeb -p$(p_l) -p$(p_d)
+ dh_md5sums -p$(p_l) -p$(p_d)
+ dh_builddeb -p$(p_l) -p$(p_d)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+endef
+
+# ----------------------------------------------------------------------
+
+do_asan = $(call __do_asan,lib$(1)asan$(ASAN_SONAME),$(1))
+
+$(binary_stamp)-libasan: $(install_stamp)
+ $(call do_asan,)
+
+$(binary_stamp)-lib64asan: $(install_stamp)
+ $(call do_asan,64)
+
+$(binary_stamp)-lib32asan: $(install_stamp)
+ $(call do_asan,32)
+
+$(binary_stamp)-libn32asan: $(install_stamp)
+ $(call do_asan,n32)
+
+$(binary_stamp)-libx32asan: $(install_stamp)
+ $(call do_asan,x32)
+
+$(binary_stamp)-libhfasan: $(install_dependencies)
+ $(call do_asan,hf)
+
+$(binary_stamp)-libsfasan: $(install_dependencies)
+ $(call do_asan,sf)
diff --git a/debian/rules.d/binary-libatomic.mk b/debian/rules.d/binary-libatomic.mk
new file mode 100644
index 0000000..1077530
--- /dev/null
+++ b/debian/rules.d/binary-libatomic.mk
@@ -0,0 +1,74 @@
+$(lib_binaries) += libatomic
+ifeq ($(with_lib64atomic),yes)
+ $(lib_binaries) += lib64atomic
+endif
+ifeq ($(with_lib32atomic),yes)
+ $(lib_binaries) += lib32atomic
+endif
+ifeq ($(with_libn32atomic),yes)
+ $(lib_binaries) += libn32atomic
+endif
+ifeq ($(with_libx32atomic),yes)
+ $(lib_binaries) += libx32atomic
+endif
+ifeq ($(with_libhfatomic),yes)
+ $(lib_binaries) += libhfatomic
+endif
+ifeq ($(with_libsfatomic),yes)
+ $(lib_binaries) += libsfatomic
+endif
+
+define __do_atomic
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_l) $(d_d)
+ dh_installdirs -p$(p_l) $(usr_lib$(2))
+ DH_COMPAT=2 dh_movefiles -p$(p_l) $(usr_lib$(2))/libatomic.so.*
+
+ debian/dh_doclink -p$(p_l) $(p_base)
+ debian/dh_doclink -p$(p_d) $(p_base)
+
+ dh_strip -p$(p_l) --dbg-package=$(p_d)
+ dh_compress -p$(p_l) -p$(p_d)
+ dh_fixperms -p$(p_l) -p$(p_d)
+ $(cross_makeshlibs) dh_makeshlibs -p$(p_l)
+ $(call cross_mangle_shlibs,$(p_l))
+ $(ignshld)DIRNAME=$(subst n,,$(2)) $(cross_shlibdeps) dh_shlibdeps -p$(p_l) \
+ $(call shlibdirs_to_search,,$(2))
+ $(call cross_mangle_substvars,$(p_l))
+ $(cross_gencontrol) dh_gencontrol -p$(p_l) -p$(p_d) \
+ -- -v$(DEB_VERSION) $(common_substvars)
+ $(call cross_mangle_control,$(p_l))
+ dh_installdeb -p$(p_l) -p$(p_d)
+ dh_md5sums -p$(p_l) -p$(p_d)
+ dh_builddeb -p$(p_l) -p$(p_d)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+endef
+
+# ----------------------------------------------------------------------
+
+do_atomic = $(call __do_atomic,lib$(1)atomic$(ATOMIC_SONAME),$(1))
+
+$(binary_stamp)-libatomic: $(install_stamp)
+ $(call do_atomic,)
+
+$(binary_stamp)-lib64atomic: $(install_stamp)
+ $(call do_atomic,64)
+
+$(binary_stamp)-lib32atomic: $(install_stamp)
+ $(call do_atomic,32)
+
+$(binary_stamp)-libn32atomic: $(install_stamp)
+ $(call do_atomic,n32)
+
+$(binary_stamp)-libx32atomic: $(install_stamp)
+ $(call do_atomic,x32)
+
+$(binary_stamp)-libhfatomic: $(install_dependencies)
+ $(call do_atomic,hf)
+
+$(binary_stamp)-libsfatomic: $(install_dependencies)
+ $(call do_atomic,sf)
diff --git a/debian/rules.d/binary-libcilkrts.mk b/debian/rules.d/binary-libcilkrts.mk
new file mode 100644
index 0000000..4371679
--- /dev/null
+++ b/debian/rules.d/binary-libcilkrts.mk
@@ -0,0 +1,82 @@
+$(lib_binaries) += libcilkrts
+ifeq ($(with_lib64cilkrts),yes)
+ $(lib_binaries) += lib64cilkrts
+endif
+ifeq ($(with_lib32cilkrts),yes)
+ $(lib_binaries) += lib32cilkrts
+endif
+ifeq ($(with_libn32cilkrts),yes)
+ $(lib_binaries) += libn32cilkrts
+endif
+ifeq ($(with_libx32cilkrts),yes)
+ $(lib_binaries) += libx32cilkrts
+endif
+ifeq ($(with_libhfcilkrts),yes)
+ $(lib_binaries) += libhfcilkrts
+endif
+ifeq ($(with_libsfcilkrts),yes)
+ $(lib_binaries) += libsfcilkrts
+endif
+
+define __do_cilkrts
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_l) $(d_d)
+ dh_installdirs -p$(p_l) $(usr_lib$(2))
+ DH_COMPAT=2 dh_movefiles -p$(p_l) $(usr_lib$(2))/libcilkrts.so.*
+
+ debian/dh_doclink -p$(p_l) $(p_base)
+ debian/dh_doclink -p$(p_d) $(p_base)
+
+ if [ -f debian/$(p_l).overrides ]; then \
+ mkdir -p debian/$(p_l)/usr/share/lintian/overrides; \
+ cp debian/$(p_l).overrides debian/$(p_l)/usr/share/lintian/overrides/$(p_l); \
+ fi
+
+ dh_strip -p$(p_l) --dbg-package=$(p_d)
+ dh_compress -p$(p_l) -p$(p_d)
+ dh_fixperms -p$(p_l) -p$(p_d)
+ $(cross_makeshlibs) dh_makeshlibs -p$(p_l)
+ $(call cross_mangle_shlibs,$(p_l))
+ $(ignshld)DIRNAME=$(subst n,,$(2)) $(cross_shlibdeps) dh_shlibdeps -p$(p_l) \
+ $(call shlibdirs_to_search, \
+ $(subst cilkrts$(CILKRTS_SONAME),gcc$(GCC_SONAME),$(p_l)) \
+ $(subst cilkrts$(CILKRTS_SONAME),stdc++$(CXX_SONAME),$(p_l)) \
+ ,$(2))
+ $(call cross_mangle_substvars,$(p_l))
+ $(cross_gencontrol) dh_gencontrol -p$(p_l) -p$(p_d) \
+ -- -v$(DEB_VERSION) $(common_substvars)
+ $(call cross_mangle_control,$(p_l))
+ dh_installdeb -p$(p_l) -p$(p_d)
+ dh_md5sums -p$(p_l) -p$(p_d)
+ dh_builddeb -p$(p_l) -p$(p_d)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+endef
+
+# ----------------------------------------------------------------------
+
+do_cilkrts = $(call __do_cilkrts,lib$(1)cilkrts$(CILKRTS_SONAME),$(1))
+
+$(binary_stamp)-libcilkrts: $(install_stamp)
+ $(call do_cilkrts,)
+
+$(binary_stamp)-lib64cilkrts: $(install_stamp)
+ $(call do_cilkrts,64)
+
+$(binary_stamp)-lib32cilkrts: $(install_stamp)
+ $(call do_cilkrts,32)
+
+$(binary_stamp)-libn32cilkrts: $(install_stamp)
+ $(call do_cilkrts,n32)
+
+$(binary_stamp)-libx32cilkrts: $(install_stamp)
+ $(call do_cilkrts,x32)
+
+$(binary_stamp)-libhfcilkrts: $(install_dependencies)
+ $(call do_cilkrts,hf)
+
+$(binary_stamp)-libsfcilkrts: $(install_dependencies)
+ $(call do_cilkrts,sf)
diff --git a/debian/rules.d/binary-libgcc.mk b/debian/rules.d/binary-libgcc.mk
new file mode 100644
index 0000000..44a4aad
--- /dev/null
+++ b/debian/rules.d/binary-libgcc.mk
@@ -0,0 +1,381 @@
+ifeq ($(with_libgcc),yes)
+ $(lib_binaries) += libgcc
+endif
+ifeq ($(with_cdev),yes)
+ $(lib_binaries) += libgcc-dev
+endif
+
+ifeq ($(with_lib64gcc),yes)
+ $(lib_binaries) += lib64gcc
+endif
+ifeq ($(with_lib64gccdev),yes)
+ $(lib_binaries) += lib64gcc-dev
+endif
+ifeq ($(with_lib32gcc),yes)
+ $(lib_binaries) += lib32gcc
+endif
+ifeq ($(with_lib32gccdev),yes)
+ $(lib_binaries) += lib32gcc-dev
+endif
+ifeq ($(with_libn32gcc),yes)
+ $(lib_binaries) += libn32gcc
+endif
+ifeq ($(with_libn32gccdev),yes)
+ $(lib_binaries) += libn32gcc-dev
+endif
+ifeq ($(with_libx32gcc),yes)
+ $(lib_binaries) += libx32gcc
+endif
+ifeq ($(with_libx32gccdev),yes)
+ $(lib_binaries) += libx32gcc-dev
+endif
+ifeq ($(with_libhfgcc),yes)
+ $(lib_binaries) += libhfgcc
+endif
+ifeq ($(with_libhfgccdev),yes)
+ $(lib_binaries) += libhfgcc-dev
+endif
+ifeq ($(with_libsfgcc),yes)
+ $(lib_binaries) += libsfgcc
+endif
+ifeq ($(with_libsfgccdev),yes)
+ $(lib_binaries) += libsfgcc-dev
+endif
+
+header_files = \
+ $(gcc_lib_dir)/include/std*.h \
+ $(shell for h in \
+ README features.h arm_neon.h loongson.h \
+ {cpuid,decfloat,float,iso646,limits,mm3dnow,mm_malloc}.h \
+ {ppu_intrinsics,paired,spu2vmx,vec_types,si2vmx}.h \
+ {,a,b,e,i,n,p,s,t,w,x}mmintrin.h mmintrin-common.h \
+ {abm,adx,avx,avx2,bmi,bmi2,f16c,fma,fma4,fxsr,ia32,}intrin.h \
+ {lwp,lzcnt,popcnt,prfchw,rdseed,rtm,tbm,x86,xop,xsave{,opt},xtest,}intrin.h \
+ {htm,htmxl,sha}intrin.h avx512{er,cd,f,pf}intrin.h \
+ {arm_acle,unwind-arm-common,s390intrin}.h \
+ {cross-stdarg,syslimits,unwind,varargs}.h; \
+ do \
+ test -e $(d)/$(gcc_lib_dir)/include/$$h \
+ && echo $(gcc_lib_dir)/include/$$h; \
+ test -e $(d)/$(gcc_lib_dir)/include-fixed/$$h \
+ && echo $(gcc_lib_dir)/include-fixed/$$h; \
+ done) \
+ $(shell for d in \
+ asm bits cilk gnu linux sanitizer $(TARGET_ALIAS) \
+ $(subst $(DEB_TARGET_GNU_CPU),$(biarch_cpu),$(TARGET_ALIAS)); \
+ do \
+ test -e $(d)/$(gcc_lib_dir)/include/$$d \
+ && echo $(gcc_lib_dir)/include/$$d; \
+ test -e $(d)/$(gcc_lib_dir)/include-fixed/$$d \
+ && echo $(gcc_lib_dir)/include-fixed/$$d; \
+ done)
+
+ifeq ($(with_libssp),yes)
+ header_files += $(gcc_lib_dir)/include/ssp
+endif
+ifeq ($(with_gomp),yes)
+ header_files += $(gcc_lib_dir)/include/omp.h
+endif
+ifeq ($(with_qmath),yes)
+ header_files += $(gcc_lib_dir)/include/quadmath{,_weak}.h
+endif
+
+ifeq ($(DEB_TARGET_ARCH),ia64)
+ header_files += $(gcc_lib_dir)/include/ia64intrin.h
+endif
+
+ifeq ($(DEB_TARGET_ARCH),m68k)
+ header_files += $(gcc_lib_dir)/include/math-68881.h
+endif
+
+ifeq ($(DEB_TARGET_ARCH),$(findstring $(DEB_TARGET_ARCH),powerpc ppc64 ppc64el powerpcspe))
+ header_files += $(gcc_lib_dir)/include/{altivec.h,ppc-asm.h,spe.h}
+endif
+
+p_lgcc = libgcc$(GCC_SONAME)$(cross_lib_arch)
+p_lgccdbg = libgcc$(GCC_SONAME)-dbg$(cross_lib_arch)
+p_lgccdev = libgcc-$(BASE_VERSION)-dev$(cross_lib_arch)
+d_lgcc = debian/$(p_lgcc)
+d_lgccdbg = debian/$(p_lgccdbg)
+d_lgccdev = debian/$(p_lgccdev)
+
+p_l32gcc = lib32gcc$(GCC_SONAME)$(cross_lib_arch)
+p_l32gccdbg = lib32gcc$(GCC_SONAME)-dbg$(cross_lib_arch)
+p_l32gccdev = lib32gcc-$(BASE_VERSION)-dev$(cross_lib_arch)
+d_l32gcc = debian/$(p_l32gcc)
+d_l32gccdbg = debian/$(p_l32gccdbg)
+d_l32gccdev = debian/$(p_l32gccdev)
+
+p_l64gcc = lib64gcc$(GCC_SONAME)$(cross_lib_arch)
+p_l64gccdbg = lib64gcc$(GCC_SONAME)-dbg$(cross_lib_arch)
+p_l64gccdev = lib64gcc-$(BASE_VERSION)-dev$(cross_lib_arch)
+d_l64gcc = debian/$(p_l64gcc)
+d_l64gccdbg = debian/$(p_l64gccdbg)
+d_l64gccdev = debian/$(p_l64gccdev)
+
+p_ln32gcc = libn32gcc$(GCC_SONAME)$(cross_lib_arch)
+p_ln32gccdbg = libn32gcc$(GCC_SONAME)-dbg$(cross_lib_arch)
+p_ln32gccdev = libn32gcc-$(BASE_VERSION)-dev$(cross_lib_arch)
+d_ln32gcc = debian/$(p_ln32gcc)
+d_ln32gccdbg = debian/$(p_ln32gccdbg)
+d_ln32gccdev = debian/$(p_ln32gccdev)
+
+p_lx32gcc = libx32gcc$(GCC_SONAME)$(cross_lib_arch)
+p_lx32gccdbg = libx32gcc$(GCC_SONAME)-dbg$(cross_lib_arch)
+p_lx32gccdev = libx32gcc-$(BASE_VERSION)-dev$(cross_lib_arch)
+d_lx32gcc = debian/$(p_lx32gcc)
+d_lx32gccdbg = debian/$(p_lx32gccdbg)
+d_lx32gccdev = debian/$(p_lx32gccdev)
+
+p_lhfgcc = libhfgcc$(GCC_SONAME)$(cross_lib_arch)
+p_lhfgccdbg = libhfgcc$(GCC_SONAME)-dbg$(cross_lib_arch)
+p_lhfgccdev = libhfgcc-$(BASE_VERSION)-dev$(cross_lib_arch)
+d_lhfgcc = debian/$(p_lhfgcc)
+d_lhfgccdbg = debian/$(p_lhfgccdbg)
+d_lhfgccdev = debian/$(p_lhfgccdev)
+
+p_lsfgcc = libsfgcc$(GCC_SONAME)$(cross_lib_arch)
+p_lsfgccdbg = libsfgcc$(GCC_SONAME)-dbg$(cross_lib_arch)
+p_lsfgccdev = libsfgcc-$(BASE_VERSION)-dev$(cross_lib_arch)
+d_lsfgcc = debian/$(p_lsfgcc)
+d_lsfgccdbg = debian/$(p_lsfgccdbg)
+d_lsfgccdev = debian/$(p_lsfgccdev)
+
+# __do_gcc_devels(flavour,package,todir,fromdir)
+define __do_gcc_devels
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ test -n "$(2)"
+ rm -rf debian/$(2)
+ dh_installdirs -p$(2) $(docdir) #TODO
+ dh_installdirs -p$(2) $(3)
+
+ $(call __do_gcc_devels2,$(1),$(2),$(3),$(4))
+
+ debian/dh_doclink -p$(2) $(p_base)
+ debian/dh_rmemptydirs -p$(2)
+
+ dh_strip -p$(2)
+ dh_compress -p$(2)
+ $(cross_shlibdeps) dh_shlibdeps -p$(2)
+ $(call cross_mangle_substvars,$(2))
+ dh_fixperms -p$(2)
+ dh_installdeb -p$(2)
+ $(cross_gencontrol) dh_gencontrol -p$(2) -- -v$(DEB_VERSION) $(common_substvars)
+ $(call cross_mangle_control,$(2))
+ dh_md5sums -p$(2)
+ dh_builddeb -p$(2)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+endef
+
+# __do_gcc_devels2(flavour,package,todir,fromdir)
+define __do_gcc_devels2
+# stage1 builds static libgcc only
+ $(if $(filter $(DEB_STAGE),stage1),,
+ : # libgcc_s.so may be a linker script on some architectures
+ set -e; \
+ if [ -h $(4)/libgcc_s.so ]; then \
+ rm -f $(4)/libgcc_s.so; \
+ dh_link -p$(2) /$(libgcc_dir$(1))/libgcc_s.so.$(GCC_SONAME) \
+ $(3)/libgcc_s.so; \
+ else \
+ mv $(4)/libgcc_s.so $(d)/$(3)/libgcc_s.so; \
+ dh_link -p$(2) /$(libgcc_dir$(1))/libgcc_s.so.$(GCC_SONAME) \
+ $(3)/libgcc_s.so.$(GCC_SONAME); \
+ fi; \
+ $(if $(1), dh_link -p$(2) /$(3)/libgcc_s.so \
+ $(gcc_lib_dir)/libgcc_s_$(1).so;)
+ )
+ DH_COMPAT=2 dh_movefiles -p$(2) \
+ $(3)/{libgcc*,libgcov.a,*.o} \
+ $(if $(1),,$(header_files)) # Only move headers for the "main" package
+
+ : # libbacktrace not installed by default
+ $(if $(filter yes, $(with_backtrace)),
+ if [ -f $(buildlibdir)/$(1)/libbacktrace/.libs/libbacktrace.a ]; then \
+ install -m644 $(buildlibdir)/$(1)/libbacktrace/.libs/libbacktrace.a \
+ debian/$(2)/$(gcc_lib_dir)/$(1); \
+ fi; \
+ $(if $(1),,
+ if [ -f $(buildlibdir)/libbacktrace/backtrace-supported.h ]; then \
+ install -m644 $(buildlibdir)/libbacktrace/backtrace-supported.h \
+ debian/$(2)/$(gcc_lib_dir)/include/; \
+ install -m644 $(srcdir)/libbacktrace/backtrace.h \
+ debian/$(2)/$(gcc_lib_dir)/include/; \
+ fi
+ ))
+
+ : # If building a flavour, add a lintian override
+ $(if $(1),
+ #TODO: use a file instead of a hacky echo
+ # bu do we want to use one override file (in the source package) per
+ # flavour or not since they are essentially the same?
+ mkdir -p debian/$(2)/usr/share/lintian/overrides
+ echo "$(2) binary: binary-from-other-architecture" \
+ >> debian/$(2)/usr/share/lintian/overrides/$(2)
+ )
+ $(if $(filter yes, $(with_lib$(1)gmath)),
+ $(call install_gcc_lib,libgcc-math,$(GCC_SONAME),$(1),$(2))
+ )
+ $(if $(filter yes, $(with_libssp)),
+ $(call install_gcc_lib,libssp,$(SSP_SONAME),$(1),$(2))
+ )
+ $(if $(filter yes, $(with_ssp)),
+ mv $(4)/libssp_nonshared.a debian/$(2)/$(3)/;
+ )
+ $(if $(filter yes, $(with_gomp)),
+ $(call install_gcc_lib,libgomp,$(GOMP_SONAME),$(1),$(2))
+ )
+ $(if $(filter yes, $(with_itm)),
+ $(call install_gcc_lib,libitm,$(ITM_SONAME),$(1),$(2))
+ )
+ $(if $(filter yes, $(with_atomic)),
+ $(call install_gcc_lib,libatomic,$(ATOMIC_SONAME),$(1),$(2))
+ )
+ $(if $(empty_sanitizer_packages),,
+ $(if $(filter yes, $(with_asan)),
+ $(call install_gcc_lib,libasan,$(ASAN_SONAME),$(1),$(2))
+ mv $(4)/libasan_preinit.o debian/$(2)/$(3)/;
+ )
+ $(if $(1),,$(if $(filter yes, $(with_lsan)),
+ $(call install_gcc_lib,liblsan,$(LSAN_SONAME),$(1),$(2))
+ ))
+ $(if $(1),,$(if $(filter yes, $(with_tsan)),
+ $(call install_gcc_lib,libtsan,$(TSAN_SONAME),$(1),$(2))
+ ))
+ $(if $(filter yes, $(with_ubsan)),
+ $(call install_gcc_lib,libubsan,$(UBSAN_SONAME),$(1),$(2))
+ )
+ )
+ $(if $(filter yes, $(with_vtv)),
+ $(call install_gcc_lib,libvtv,$(VTV_SONAME),$(1),$(2))
+ )
+ $(if $(filter yes, $(with_cilkrts)),
+ $(call install_gcc_lib,libcilkrts,$(CILKRTS_SONAME),$(1),$(2))
+ )
+ $(if $(filter yes, $(with_qmath)),
+ $(call install_gcc_lib,libquadmath,$(QMATH_SONAME),$(1),$(2))
+ )
+endef
+
+# do_gcc_devels(flavour)
+define do_gcc_devels
+ $(call __do_gcc_devels,$(1),$(p_l$(1)gccdev),$(gcc_lib_dir$(1)),$(d)/$(usr_lib$(1)))
+endef
+
+
+define __do_libgcc
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_l) $(d_d)
+
+ dh_installdirs -p$(p_l) \
+ $(docdir)/$(p_l) \
+ $(libgcc_dir$(2))
+
+ $(if $(filter yes,$(with_shared_libgcc)),
+ mv $(d)/$(usr_lib$(2))/libgcc_s.so.$(GCC_SONAME) \
+ $(d_l)/$(libgcc_dir$(2))/.
+ )
+
+ debian/dh_doclink -p$(p_l) $(if $(3),$(3),$(p_base))
+ debian/dh_doclink -p$(p_d) $(if $(3),$(3),$(p_base))
+ debian/dh_rmemptydirs -p$(p_l)
+ debian/dh_rmemptydirs -p$(p_d)
+ dh_strip -p$(p_l) --dbg-package=$(p_d)
+
+ # see Debian #533843 for the __aeabi symbol handling; this construct is
+ # just to include the symbols for dpkg versions older than 1.15.3 which
+ # didn't allow bypassing the symbol blacklist
+ $(if $(filter yes,$(with_shared_libgcc)),
+ $(cross_makeshlibs) dh_makeshlibs -p$(p_l) -p$(p_d) \
+ -- -v$(DEB_LIBGCC_VERSION)
+ $(call cross_mangle_shlibs,$(p_l))
+ $(if $(filter arm-linux-gnueabi%,$(DEB_TARGET_GNU_TYPE)),
+ if head -1 $(d_l)/DEBIAN/symbols 2>/dev/null | grep -q '^lib'; then \
+ grep -q '^ __aeabi' $(d_l)/DEBIAN/symbols \
+ || cat debian/libgcc1.symbols.aeabi \
+ >> $(d_l)/DEBIAN/symbols; \
+ fi
+ )
+ )
+
+ $(if $(DEB_STAGE),,
+ $(ignshld)DIRNAME=$(subst n,,$(2)) $(cross_shlibdeps) dh_shlibdeps -p$(p_l) \
+ $(call shlibdirs_to_search,,$(2))
+ )
+ $(call cross_mangle_substvars,$(p_l))
+
+ $(if $(2),, # only for native
+ mkdir -p $(d_l)/usr/share/lintian/overrides
+ echo '$(p_l): package-name-doesnt-match-sonames' \
+ > $(d_l)/usr/share/lintian/overrides/$(p_l)
+ )
+
+ dh_compress -p$(p_l) -p$(p_d)
+ dh_fixperms -p$(p_l) -p$(p_d)
+ $(cross_gencontrol) dh_gencontrol -p$(p_l) -p$(p_d) \
+ -- -v$(DEB_LIBGCC_VERSION) $(common_substvars)
+ $(call cross_mangle_control,$(p_l))
+
+ dh_installdeb -p$(p_l) -p$(p_d)
+ dh_md5sums -p$(p_l) -p$(p_d)
+ dh_builddeb -p$(p_l) -p$(p_d)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+endef
+
+do_libgcc = $(call __do_libgcc,lib$(1)gcc$(GCC_SONAME),$(1),$(2))
+# ----------------------------------------------------------------------
+
+$(binary_stamp)-libgcc: $(install_dependencies)
+ifeq ($(with_standalone_gcj),yes)
+ $(call do_libgcc,,$(p_jbase))
+else
+ $(call do_libgcc,,)
+endif
+
+$(binary_stamp)-lib64gcc: $(install_dependencies)
+ $(call do_libgcc,64,)
+
+$(binary_stamp)-lib32gcc: $(install_dependencies)
+ $(call do_libgcc,32,)
+
+$(binary_stamp)-libn32gcc: $(install_dependencies)
+ $(call do_libgcc,n32,)
+
+$(binary_stamp)-libx32gcc: $(install_dependencies)
+ $(call do_libgcc,x32,)
+
+$(binary_stamp)-libhfgcc: $(install_dependencies)
+ $(call do_libgcc,hf)
+
+$(binary_stamp)-libsfgcc: $(install_dependencies)
+ $(call do_libgcc,sf)
+
+$(binary_stamp)-libgcc-dev: $(install_dependencies)
+ $(call do_gcc_devels,)
+
+$(binary_stamp)-lib64gcc-dev: $(install_dependencies)
+ $(call do_gcc_devels,64)
+
+$(binary_stamp)-lib32gcc-dev: $(install_dependencies)
+ $(call do_gcc_devels,32)
+
+$(binary_stamp)-libn32gcc-dev: $(install_dependencies)
+ $(call do_gcc_devels,n32)
+
+$(binary_stamp)-libx32gcc-dev: $(install_dependencies)
+ $(call do_gcc_devels,x32)
+
+$(binary_stamp)-libhfgcc-dev: $(install_dependencies)
+ $(call do_gcc_devels,hf)
+
+$(binary_stamp)-libsfgcc-dev: $(install_dependencies)
+ $(call do_gcc_devels,sf)
+
diff --git a/debian/rules.d/binary-libgccmath.mk b/debian/rules.d/binary-libgccmath.mk
new file mode 100644
index 0000000..38aa697
--- /dev/null
+++ b/debian/rules.d/binary-libgccmath.mk
@@ -0,0 +1,141 @@
+ifeq ($(with_libgmath),yes)
+ arch_binaries := $(arch_binaries) libgmath
+endif
+#ifeq ($(with_libgmathdev),yes)
+# arch_binaries := $(arch_binaries) libgmathdev
+#endif
+ifeq ($(with_lib64gmath),yes)
+ arch_binaries := $(arch_binaries) lib64gmath
+endif
+ifeq ($(with_lib32gmath),yes)
+ arch_binaries := $(arch_binaries) lib32gmath
+endif
+
+p_gmath = libgccmath$(GCCMATH_SONAME)
+p_l32gmath = lib32gccmath$(GCCMATH_SONAME)
+p_l64gmath = lib64gccmath$(GCCMATH_SONAME)
+p_gmathd = libgccmath$(GCCMATH_SONAME)-dev
+
+d_gmath = debian/$(p_gmath)
+d_l32gmath = debian/$(p_l32gmath)
+d_l64gmath = debian/$(p_l64gmath)
+d_gmathd = debian/$(p_gmathd)
+
+dirs_gmath = \
+ $(docdir) \
+ $(PF)/$(libdir)
+files_gmath = \
+ $(PF)/$(libdir)/libgcc-math.so.*
+
+dirs_gmathd = \
+ $(docdir)/$(p_base)
+ifeq ($(with_libgmath),yes)
+files_gmathd = \
+ $(PF)/$(libdir)/libgcc-math.{a,so}
+endif
+
+ifeq ($(with_lib32gmath),yes)
+ dirs_gmathd += $(lib32)
+ files_gmathd += $(lib32)/libgcc-math.{a,so}
+endif
+ifeq ($(with_lib64gmath),yes)
+ dirs_gmathd += $(PF)/lib64
+ files_gmathd += $(PF)/lib64/libgcc-math.{a,so}
+endif
+
+$(binary_stamp)-libgmath: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+ rm -rf $(d_gmath)
+ dh_installdirs -p$(p_gmath) $(dirs_gmath)
+ DH_COMPAT=2 dh_movefiles -p$(p_gmath) $(files_gmath)
+ debian/dh_doclink -p$(p_gmath) $(p_base)
+ debian/dh_rmemptydirs -p$(p_gmath)
+ dh_strip -p$(p_gmath)
+ dh_compress -p$(p_gmath)
+ dh_fixperms -p$(p_gmath)
+ dh_makeshlibs -p$(p_gmath) -V '$(p_gmath) (>= $(DEB_GCCMATH_SOVERSION))'
+ dh_shlibdeps -p$(p_gmath)
+ dh_gencontrol -p$(p_gmath) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_gmath)
+ dh_md5sums -p$(p_gmath)
+ dh_builddeb -p$(p_gmath)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-libgmathdev: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_gmathd)
+ dh_installdirs -p$(p_gmathd) $(dirs_gmathd)
+ DH_COMPAT=2 dh_movefiles -p$(p_gmathd) $(files_gmathd)
+ debian/dh_doclink -p$(p_gmathd) $(p_base)
+ cp -p $(srcdir)/libgcc-math/ChangeLog \
+ $(d_gmathd)/$(docdir)/$(p_base)/changelog.libgcc-math
+ debian/dh_rmemptydirs -p$(p_gmathd)
+ dh_strip -p$(p_gmathd)
+ dh_compress -p$(p_gmathd)
+ dh_fixperms -p$(p_gmathd)
+ dh_shlibdeps -p$(p_gmathd)
+ dh_gencontrol -p$(p_gmathd) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_gmathd)
+ dh_md5sums -p$(p_gmathd)
+ dh_builddeb -p$(p_gmathd)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-lib64gmath: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_l64gmath)
+ dh_installdirs -p$(p_l64gmath) \
+ $(PF)/lib64
+ DH_COMPAT=2 dh_movefiles -p$(p_l64gmath) \
+ $(PF)/lib64/libgcc-math.so.*
+
+ debian/dh_doclink -p$(p_l64gmath) $(p_base)
+
+ dh_strip -p$(p_l64gmath)
+ dh_compress -p$(p_l64gmath)
+ dh_fixperms -p$(p_l64gmath)
+ dh_makeshlibs -p$(p_l64gmath) -V '$(p_l64gmath) (>= $(DEB_GCCMATH_SOVERSION))'
+# dh_shlibdeps -p$(p_l64gmath)
+ dh_gencontrol -p$(p_l64gmath) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_l64gmath)
+ dh_md5sums -p$(p_l64gmath)
+ dh_builddeb -p$(p_l64gmath)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-lib32gmath: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_l32gmath)
+ dh_installdirs -p$(p_l32gmath) \
+ $(lib32)
+ DH_COMPAT=2 dh_movefiles -p$(p_l32gmath) \
+ $(lib32)/libgcc-math.so.*
+
+ debian/dh_doclink -p$(p_l32gmath) $(p_base)
+
+ dh_strip -p$(p_l32gmath)
+ dh_compress -p$(p_l32gmath)
+ dh_fixperms -p$(p_l32gmath)
+ dh_makeshlibs -p$(p_l32gmath) -V '$(p_l32gmath) (>= $(DEB_GCCMATH_SOVERSION))'
+ dh_shlibdeps -p$(p_l32gmath)
+ dh_gencontrol -p$(p_l32gmath) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_l32gmath)
+ dh_md5sums -p$(p_l32gmath)
+ dh_builddeb -p$(p_l32gmath)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
diff --git a/debian/rules.d/binary-libgomp.mk b/debian/rules.d/binary-libgomp.mk
new file mode 100644
index 0000000..a366985
--- /dev/null
+++ b/debian/rules.d/binary-libgomp.mk
@@ -0,0 +1,74 @@
+$(lib_binaries) += libgomp
+ifeq ($(with_lib64gomp),yes)
+ $(lib_binaries) += lib64gomp
+endif
+ifeq ($(with_lib32gomp),yes)
+ $(lib_binaries) += lib32gomp
+endif
+ifeq ($(with_libn32gomp),yes)
+ $(lib_binaries) += libn32gomp
+endif
+ifeq ($(with_libx32gomp),yes)
+ $(lib_binaries) += libx32gomp
+endif
+ifeq ($(with_libhfgomp),yes)
+ $(lib_binaries) += libhfgomp
+endif
+ifeq ($(with_libsfgomp),yes)
+ $(lib_binaries) += libsfgomp
+endif
+
+define __do_gomp
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_l) $(d_d)
+ dh_installdirs -p$(p_l) $(usr_lib$(2))
+ DH_COMPAT=2 dh_movefiles -p$(p_l) $(usr_lib$(2))/libgomp.so.*
+
+ debian/dh_doclink -p$(p_l) $(p_base)
+ debian/dh_doclink -p$(p_d) $(p_base)
+
+ dh_strip -p$(p_l) --dbg-package=$(p_d)
+ dh_compress -p$(p_l) -p$(p_d)
+ dh_fixperms -p$(p_l) -p$(p_d)
+ $(cross_makeshlibs) dh_makeshlibs -p$(p_l)
+ $(call cross_mangle_shlibs,$(p_l))
+ $(ignshld)DIRNAME=$(subst n,,$(2)) $(cross_shlibdeps) dh_shlibdeps -p$(p_l) \
+ $(call shlibdirs_to_search,$(subst gomp$(GOMP_SONAME),gcc$(GCC_SONAME),$(p_l)),$(2))
+ $(call cross_mangle_substvars,$(p_l))
+ $(cross_gencontrol) dh_gencontrol -p$(p_l) -p$(p_d) \
+ -- -v$(DEB_VERSION) $(common_substvars)
+ $(call cross_mangle_control,$(p_l))
+ dh_installdeb -p$(p_l) -p$(p_d)
+ dh_md5sums -p$(p_l) -p$(p_d)
+ dh_builddeb -p$(p_l) -p$(p_d)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+endef
+
+# ----------------------------------------------------------------------
+
+do_gomp = $(call __do_gomp,lib$(1)gomp$(GOMP_SONAME),$(1))
+
+$(binary_stamp)-libgomp: $(install_stamp)
+ $(call do_gomp,)
+
+$(binary_stamp)-lib64gomp: $(install_stamp)
+ $(call do_gomp,64)
+
+$(binary_stamp)-lib32gomp: $(install_stamp)
+ $(call do_gomp,32)
+
+$(binary_stamp)-libn32gomp: $(install_stamp)
+ $(call do_gomp,n32)
+
+$(binary_stamp)-libx32gomp: $(install_stamp)
+ $(call do_gomp,x32)
+
+$(binary_stamp)-libhfgomp: $(install_dependencies)
+ $(call do_gomp,hf)
+
+$(binary_stamp)-libsfgomp: $(install_dependencies)
+ $(call do_gomp,sf)
diff --git a/debian/rules.d/binary-libitm.mk b/debian/rules.d/binary-libitm.mk
new file mode 100644
index 0000000..534a0bd
--- /dev/null
+++ b/debian/rules.d/binary-libitm.mk
@@ -0,0 +1,74 @@
+$(lib_binaries) += libitm
+ifeq ($(with_lib64itm),yes)
+ $(lib_binaries) += lib64itm
+endif
+ifeq ($(with_lib32itm),yes)
+ $(lib_binaries) += lib32itm
+endif
+ifeq ($(with_libn32itm),yes)
+ $(lib_binaries) += libn32itm
+endif
+ifeq ($(with_libx32itm),yes)
+ $(lib_binaries) += libx32itm
+endif
+ifeq ($(with_libhfitm),yes)
+ $(lib_binaries) += libhfitm
+endif
+ifeq ($(with_libsfitm),yes)
+ $(lib_binaries) += libsfitm
+endif
+
+define __do_itm
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_l) $(d_d)
+ dh_installdirs -p$(p_l) $(usr_lib$(2))
+ DH_COMPAT=2 dh_movefiles -p$(p_l) $(usr_lib$(2))/libitm.so.*
+
+ debian/dh_doclink -p$(p_l) $(p_base)
+ debian/dh_doclink -p$(p_d) $(p_base)
+
+ dh_strip -p$(p_l) --dbg-package=$(p_d)
+ dh_compress -p$(p_l) -p$(p_d)
+ dh_fixperms -p$(p_l) -p$(p_d)
+ $(cross_makeshlibs) dh_makeshlibs -p$(p_l)
+ $(call cross_mangle_shlibs,$(p_l))
+ $(ignshld)DIRNAME=$(subst n,,$(2)) $(cross_shlibdeps) dh_shlibdeps -p$(p_l) \
+ $(call shlibdirs_to_search,,$(2))
+ $(call cross_mangle_substvars,$(p_l))
+ $(cross_gencontrol) dh_gencontrol -p$(p_l) -p$(p_d) \
+ -- -v$(DEB_VERSION) $(common_substvars)
+ $(call cross_mangle_control,$(p_l))
+ dh_installdeb -p$(p_l) -p$(p_d)
+ dh_md5sums -p$(p_l) -p$(p_d)
+ dh_builddeb -p$(p_l) -p$(p_d)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+endef
+
+# ----------------------------------------------------------------------
+
+do_itm = $(call __do_itm,lib$(1)itm$(ITM_SONAME),$(1))
+
+$(binary_stamp)-libitm: $(install_stamp)
+ $(call do_itm,)
+
+$(binary_stamp)-lib64itm: $(install_stamp)
+ $(call do_itm,64)
+
+$(binary_stamp)-lib32itm: $(install_stamp)
+ $(call do_itm,32)
+
+$(binary_stamp)-libn32itm: $(install_stamp)
+ $(call do_itm,n32)
+
+$(binary_stamp)-libx32itm: $(install_stamp)
+ $(call do_itm,x32)
+
+$(binary_stamp)-libhfitm: $(install_dependencies)
+ $(call do_itm,hf)
+
+$(binary_stamp)-libsfitm: $(install_dependencies)
+ $(call do_itm,sf)
diff --git a/debian/rules.d/binary-liblsan.mk b/debian/rules.d/binary-liblsan.mk
new file mode 100644
index 0000000..3cdf7d8
--- /dev/null
+++ b/debian/rules.d/binary-liblsan.mk
@@ -0,0 +1,82 @@
+$(lib_binaries) += liblsan
+ifeq ($(with_lib64lsan),yes)
+ $(lib_binaries) += lib64lsan
+endif
+ifeq ($(with_lib32lsan),yes)
+ $(lib_binaries) += lib32lsan
+endif
+ifeq ($(with_libn32lsan),yes)
+ $(lib_binaries) += libn32lsan
+endif
+ifeq ($(with_libx32lsan),yes)
+ $(lib_binaries) += libx32lsan
+endif
+ifeq ($(with_libhflsan),yes)
+ $(lib_binaries) += libhflsan
+endif
+ifeq ($(with_libsflsan),yes)
+ $(lib_binaries) += libsflsan
+endif
+
+define __do_lsan
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_l) $(d_d)
+ dh_installdirs -p$(p_l) $(usr_lib$(2))
+ DH_COMPAT=2 dh_movefiles -p$(p_l) $(usr_lib$(2))/liblsan.so.*
+
+ debian/dh_doclink -p$(p_l) $(p_base)
+ debian/dh_doclink -p$(p_d) $(p_base)
+
+ if [ -f debian/$(p_l).overrides ]; then \
+ mkdir -p debian/$(p_l)/usr/share/lintian/overrides; \
+ cp debian/$(p_l).overrides debian/$(p_l)/usr/share/lintian/overrides/$(p_l); \
+ fi
+
+ dh_strip -p$(p_l) --dbg-package=$(p_d)
+ dh_compress -p$(p_l) -p$(p_d)
+ dh_fixperms -p$(p_l) -p$(p_d)
+ $(cross_makeshlibs) dh_makeshlibs -p$(p_l)
+ $(call cross_mangle_shlibs,$(p_l))
+ $(ignshld)DIRNAME=$(subst n,,$(2)) $(cross_shlibdeps) dh_shlibdeps -p$(p_l) \
+ $(call shlibdirs_to_search, \
+ $(subst lsan$(LSAN_SONAME),gcc$(GCC_SONAME),$(p_l)) \
+ $(subst lsan$(LSAN_SONAME),stdc++$(CXX_SONAME),$(p_l)) \
+ ,$(2))
+ $(call cross_mangle_substvars,$(p_l))
+ $(cross_gencontrol) dh_gencontrol -p$(p_l) -p$(p_d) \
+ -- -v$(DEB_VERSION) $(common_substvars)
+ $(call cross_mangle_control,$(p_l))
+ dh_installdeb -p$(p_l) -p$(p_d)
+ dh_md5sums -p$(p_l) -p$(p_d)
+ dh_builddeb -p$(p_l) -p$(p_d)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+endef
+
+# ----------------------------------------------------------------------
+
+do_lsan = $(call __do_lsan,lib$(1)lsan$(LSAN_SONAME),$(1))
+
+$(binary_stamp)-liblsan: $(install_stamp)
+ $(call do_lsan,)
+
+$(binary_stamp)-lib64lsan: $(install_stamp)
+ $(call do_lsan,64)
+
+$(binary_stamp)-lib32lsan: $(install_stamp)
+ $(call do_lsan,32)
+
+$(binary_stamp)-libn32lsan: $(install_stamp)
+ $(call do_lsan,n32)
+
+$(binary_stamp)-libx32lsan: $(install_stamp)
+ $(call do_lsan,x32)
+
+$(binary_stamp)-libhflsan: $(install_dependencies)
+ $(call do_lsan,hf)
+
+$(binary_stamp)-libsflsan: $(install_dependencies)
+ $(call do_lsan,sf)
diff --git a/debian/rules.d/binary-libobjc.mk b/debian/rules.d/binary-libobjc.mk
new file mode 100644
index 0000000..1f4ee3b
--- /dev/null
+++ b/debian/rules.d/binary-libobjc.mk
@@ -0,0 +1,168 @@
+ifeq ($(with_libobjc),yes)
+ $(lib_binaries) += libobjc
+endif
+ifeq ($(with_objcdev),yes)
+ $(lib_binaries) += libobjc-dev
+endif
+ifeq ($(with_lib64objc),yes)
+ $(lib_binaries) += lib64objc
+endif
+ifeq ($(with_lib64objcdev),yes)
+ $(lib_binaries) += lib64objc-dev
+endif
+ifeq ($(with_lib32objc),yes)
+ $(lib_binaries) += lib32objc
+endif
+ifeq ($(with_lib32objcdev),yes)
+ $(lib_binaries) += lib32objc-dev
+endif
+ifeq ($(with_libn32objc),yes)
+ $(lib_binaries) += libn32objc
+endif
+ifeq ($(with_libn32objcdev),yes)
+ $(lib_binaries) += libn32objc-dev
+endif
+ifeq ($(with_libx32objc),yes)
+ $(lib_binaries) += libx32objc
+endif
+ifeq ($(with_libx32objcdev),yes)
+ $(lib_binaries) += libx32objc-dev
+endif
+ifeq ($(with_libhfobjc),yes)
+ $(lib_binaries) += libhfobjc
+endif
+ifeq ($(with_libhfobjcdev),yes)
+ $(lib_binaries) += libhfobjc-dev
+endif
+ifeq ($(with_libsfobjc),yes)
+ $(lib_binaries) += libsfobjc
+endif
+ifeq ($(with_libsfobjcdev),yes)
+ $(lib_binaries) += libsfobjc-dev
+endif
+
+files_lobjcdev= \
+ $(gcc_lib_dir)/include/objc
+
+files_lobjc = \
+ $(usr_lib$(2))/libobjc.so.*
+ifeq ($(with_objc_gc),yes)
+ files_lobjc += \
+ $(usr_lib$(2))/libobjc_gc.so.*
+endif
+
+define __do_libobjc
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_l) $(d_d)
+ dh_installdirs -p$(p_l) \
+ $(usr_lib$(2))
+ DH_COMPAT=2 dh_movefiles -p$(p_l) \
+ $(files_lobjc)
+
+ debian/dh_doclink -p$(p_l) $(p_base)
+ debian/dh_doclink -p$(p_d) $(p_base)
+
+ dh_strip -p$(p_l) --dbg-package=$(p_d)
+ dh_compress -p$(p_l) -p$(p_d)
+ dh_fixperms -p$(p_l) -p$(p_d)
+ $(cross_makeshlibs) dh_makeshlibs -p$(p_l) -Xlibobjc_gc.so
+ $(call cross_mangle_shlibs,$(p_l))
+ $(ignshld)DIRNAME=$(subst n,,$(2)) $(cross_shlibdeps) dh_shlibdeps -p$(p_l) \
+ $(call shlibdirs_to_search,$(subst objc$(OBJC_SONAME),gcc$(GCC_SONAME),$(p_l)),$(2))
+ $(call cross_mangle_substvars,$(p_l))
+ $(cross_gencontrol) dh_gencontrol -p$(p_l) -p$(p_d) \
+ -- -v$(DEB_VERSION) $(common_substvars)
+ $(call cross_mangle_control,$(p_l))
+ dh_installdeb -p$(p_l) -p$(p_d)
+ dh_md5sums -p$(p_l) -p$(p_d)
+ dh_builddeb -p$(p_l) -p$(p_d)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+endef
+
+
+define __do_libobjc_dev
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_l)
+ dh_installdirs -p$(p_l) \
+ $(gcc_lib_dir$(2))
+ DH_COMPAT=2 dh_movefiles -p$(p_l) \
+ $(files_lobjcdev)
+
+ $(call install_gcc_lib,libobjc,$(OBJC_SONAME),$(2),$(p_l))
+ $(if $(filter yes,$(with_objc_gc)),
+ dh_link -p$(p_l) \
+ /$(usr_lib$(2))/libobjc_gc.so.$(OBJC_SONAME) \
+ /$(gcc_lib_dir$(2))/libobjc_gc.so
+ )
+
+ debian/dh_doclink -p$(p_l) $(p_base)
+
+ dh_compress -p$(p_l)
+ dh_fixperms -p$(p_l)
+ $(cross_gencontrol) dh_gencontrol -p$(p_l) \
+ -- -v$(DEB_VERSION) $(common_substvars)
+ $(call cross_mangle_control,$(p_l))
+ dh_installdeb -p$(p_l)
+ dh_md5sums -p$(p_l)
+ dh_builddeb -p$(p_l)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+endef
+
+
+
+# ----------------------------------------------------------------------
+
+do_libobjc = $(call __do_libobjc,lib$(1)objc$(OBJC_SONAME),$(1))
+do_libobjc_dev = $(call __do_libobjc_dev,lib$(1)objc-$(BASE_VERSION)-dev,$(1))
+
+$(binary_stamp)-libobjc: $(install_stamp)
+ $(call do_libobjc,)
+
+$(binary_stamp)-lib64objc: $(install_stamp)
+ $(call do_libobjc,64)
+
+$(binary_stamp)-lib32objc: $(install_stamp)
+ $(call do_libobjc,32)
+
+$(binary_stamp)-libn32objc: $(install_stamp)
+ $(call do_libobjc,n32)
+
+$(binary_stamp)-libx32objc: $(install_stamp)
+ $(call do_libobjc,x32)
+
+$(binary_stamp)-libhfobjc: $(install_stamp)
+ $(call do_libobjc,hf)
+
+$(binary_stamp)-libsfobjc: $(install_stamp)
+ $(call do_libobjc,sf)
+
+
+$(binary_stamp)-libobjc-dev: $(install_stamp)
+ $(call do_libobjc_dev,)
+
+$(binary_stamp)-lib64objc-dev: $(install_stamp)
+ $(call do_libobjc_dev,64)
+
+$(binary_stamp)-lib32objc-dev: $(install_stamp)
+ $(call do_libobjc_dev,32)
+
+$(binary_stamp)-libx32objc-dev: $(install_stamp)
+ $(call do_libobjc_dev,x32)
+
+$(binary_stamp)-libn32objc-dev: $(install_stamp)
+ $(call do_libobjc_dev,n32)
+
+$(binary_stamp)-libhfobjc-dev: $(install_stamp)
+ $(call do_libobjc_dev,hf)
+
+$(binary_stamp)-libsfobjc-dev: $(install_stamp)
+ $(call do_libobjc_dev,sf)
+
diff --git a/debian/rules.d/binary-libquadmath.mk b/debian/rules.d/binary-libquadmath.mk
new file mode 100644
index 0000000..308d591
--- /dev/null
+++ b/debian/rules.d/binary-libquadmath.mk
@@ -0,0 +1,74 @@
+$(lib_binaries) += libqmath
+ifeq ($(with_lib64qmath),yes)
+ $(lib_binaries) += lib64qmath
+endif
+ifeq ($(with_lib32qmath),yes)
+ $(lib_binaries) += lib32qmath
+endif
+ifeq ($(with_libn32qmath),yes)
+ $(lib_binaries) += libn32qmath
+endif
+ifeq ($(with_libx32qmath),yes)
+ $(lib_binaries) += libx32qmath
+endif
+ifeq ($(with_libhfqmath),yes)
+ $(lib_binaries) += libhfqmath
+endif
+ifeq ($(with_libsfqmath),yes)
+ $(lib_binaries) += libsfqmath
+endif
+
+define __do_qmath
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_l) $(d_d)
+ dh_installdirs -p$(p_l) $(usr_lib$(2))
+ DH_COMPAT=2 dh_movefiles -p$(p_l) $(usr_lib$(2))/libquadmath.so.*
+
+ debian/dh_doclink -p$(p_l) $(p_base)
+ debian/dh_doclink -p$(p_d) $(p_base)
+
+ dh_strip -p$(p_l) --dbg-package=$(p_d)
+ dh_compress -p$(p_l) -p$(p_d)
+ dh_fixperms -p$(p_l) -p$(p_d)
+ $(cross_makeshlibs) dh_makeshlibs -p$(p_l)
+ $(call cross_mangle_shlibs,$(p_l))
+ $(cross_shlibdeps) dh_shlibdeps -p$(p_l) \
+ $(call shlibdirs_to_search,,$(2))
+ $(call cross_mangle_substvars,$(p_l))
+ $(cross_gencontrol) dh_gencontrol -p$(p_l) -p$(p_d) \
+ -- -v$(DEB_VERSION) $(common_substvars)
+ $(call cross_mangle_control,$(p_l))
+ dh_installdeb -p$(p_l) -p$(p_d)
+ dh_md5sums -p$(p_l) -p$(p_d)
+ dh_builddeb -p$(p_l) -p$(p_d)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+endef
+
+# ----------------------------------------------------------------------
+
+do_qmath = $(call __do_qmath,lib$(1)quadmath$(QMATH_SONAME),$(1))
+
+$(binary_stamp)-libqmath: $(install_stamp)
+ $(call do_qmath,)
+
+$(binary_stamp)-lib64qmath: $(install_stamp)
+ $(call do_qmath,64)
+
+$(binary_stamp)-lib32qmath: $(install_stamp)
+ $(call do_qmath,32)
+
+$(binary_stamp)-libn32qmath: $(install_stamp)
+ $(call do_qmath,n32)
+
+$(binary_stamp)-libx32qmath: $(install_stamp)
+ $(call do_qmath,x32)
+
+$(binary_stamp)-libhfqmath: $(install_stamp)
+ $(call do_qmath,hf)
+
+$(binary_stamp)-libsfqmath: $(install_stamp)
+ $(call do_qmath,sf)
diff --git a/debian/rules.d/binary-libssp.mk b/debian/rules.d/binary-libssp.mk
new file mode 100644
index 0000000..9941b9f
--- /dev/null
+++ b/debian/rules.d/binary-libssp.mk
@@ -0,0 +1,181 @@
+arch_binaries := $(arch_binaries) libssp
+ifeq ($(with_lib64ssp),yes)
+ arch_binaries := $(arch_binaries) lib64ssp
+endif
+ifeq ($(with_lib32ssp),yes)
+ arch_binaries := $(arch_binaries) lib32ssp
+endif
+ifeq ($(with_libn32ssp),yes)
+ arch_binaries := $(arch_binaries) libn32ssp
+endif
+ifeq ($(with_libx32ssp),yes)
+ arch_binaries := $(arch_binaries) libx32ssp
+endif
+
+p_ssp = libssp$(SSP_SONAME)
+p_ssp32 = lib32ssp$(SSP_SONAME)
+p_ssp64 = lib64ssp$(SSP_SONAME)
+p_sspx32 = libx32ssp$(SSP_SONAME)
+p_sspd = libssp$(SSP_SONAME)-dev
+
+d_ssp = debian/$(p_ssp)
+d_ssp32 = debian/$(p_ssp32)
+d_ssp64 = debian/$(p_ssp64)
+d_sspx32 = debian/$(p_sspx32)
+d_sspd = debian/$(p_sspd)
+
+dirs_ssp = \
+ $(docdir)/$(p_base) \
+ $(PF)/$(libdir)
+files_ssp = \
+ $(PF)/$(libdir)/libssp.so.*
+
+dirs_sspd = \
+ $(docdir) \
+ $(PF)/include \
+ $(PF)/$(libdir)
+files_sspd = \
+ $(gcc_lib_dir)/include/ssp \
+ $(PF)/$(libdir)/libssp.{a,so} \
+ $(PF)/$(libdir)/libssp_nonshared.a
+
+ifeq ($(with_lib32ssp),yes)
+ dirs_sspd += $(lib32)
+ files_sspd += $(lib32)/libssp.{a,so}
+ files_sspd += $(lib32)/libssp_nonshared.a
+endif
+ifeq ($(with_lib64ssp),yes)
+ dirs_sspd += $(PF)/lib64
+ files_sspd += $(PF)/lib64/libssp.{a,so}
+ files_sspd += $(PF)/lib64/libssp_nonshared.a
+endif
+
+$(binary_stamp)-libssp: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_ssp)
+ dh_installdirs -p$(p_ssp)
+
+ DH_COMPAT=2 dh_movefiles -p$(p_ssp) $(files_ssp)
+ debian/dh_doclink -p$(p_ssp) $(p_base)
+
+ debian/dh_rmemptydirs -p$(p_ssp)
+
+ dh_strip -p$(p_ssp)
+ dh_compress -p$(p_ssp)
+ dh_fixperms -p$(p_ssp)
+ dh_makeshlibs -p$(p_ssp) -V '$(p_ssp) (>= $(DEB_SOVERSION))'
+ dh_shlibdeps -p$(p_ssp)
+ dh_gencontrol -p$(p_ssp) \
+ -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_ssp)
+ dh_md5sums -p$(p_ssp)
+ dh_builddeb -p$(p_ssp)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-lib64ssp: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_ssp64)
+ dh_installdirs -p$(p_ssp64) \
+ $(PF)/lib64
+ DH_COMPAT=2 dh_movefiles -p$(p_ssp64) \
+ $(PF)/lib64/libssp.so.*
+
+ debian/dh_doclink -p$(p_ssp64) $(p_base)
+
+ dh_strip -p$(p_ssp64)
+ dh_compress -p$(p_ssp64)
+ dh_fixperms -p$(p_ssp64)
+ dh_makeshlibs -p$(p_ssp64) -V '$(p_ssp64) (>= $(DEB_SOVERSION))'
+# dh_shlibdeps -p$(p_ssp64)
+ dh_gencontrol -p$(p_ssp64) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_ssp64)
+ dh_md5sums -p$(p_ssp64)
+ dh_builddeb -p$(p_ssp64)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-lib32ssp: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_ssp32)
+ dh_installdirs -p$(p_ssp32) \
+ $(lib32)
+ DH_COMPAT=2 dh_movefiles -p$(p_ssp32) \
+ $(lib32)/libssp.so.*
+
+ debian/dh_doclink -p$(p_ssp32) $(p_base)
+
+ dh_strip -p$(p_ssp32)
+ dh_compress -p$(p_ssp32)
+ dh_fixperms -p$(p_ssp32)
+ dh_makeshlibs -p$(p_ssp32) -V '$(p_ssp32) (>= $(DEB_SOVERSION))'
+# dh_shlibdeps -p$(p_ssp32)
+ dh_gencontrol -p$(p_ssp32) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_ssp32)
+ dh_md5sums -p$(p_ssp32)
+ dh_builddeb -p$(p_ssp32)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-libn32ssp: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_sspn32)
+ dh_installdirs -p$(p_sspn32) \
+ $(PF)/$(libn32)
+ DH_COMPAT=2 dh_movefiles -p$(p_sspn32) \
+ $(PF)/$(libn32)/libssp.so.*
+
+ debian/dh_doclink -p$(p_sspn32) $(p_base)
+
+ dh_strip -p$(p_sspn32)
+ dh_compress -p$(p_sspn32)
+ dh_fixperms -p$(p_sspn32)
+ dh_makeshlibs -p$(p_sspn32) -V '$(p_sspn32) (>= $(DEB_SOVERSION))'
+# dh_shlibdeps -p$(p_sspn32)
+ dh_gencontrol -p$(p_sspn32) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_sspn32)
+ dh_md5sums -p$(p_sspn32)
+ dh_builddeb -p$(p_sspn32)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-libx32ssp: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_sspx32)
+ dh_installdirs -p$(p_sspx32) \
+ $(PF)/$(libx32)
+ DH_COMPAT=2 dh_movefiles -p$(p_sspx32) \
+ $(PF)/$(libx32)/libssp.so.*
+
+ debian/dh_doclink -p$(p_sspx32) $(p_base)
+
+ dh_strip -p$(p_sspx32)
+ dh_compress -p$(p_sspx32)
+ dh_fixperms -p$(p_sspx32)
+ dh_makeshlibs -p$(p_sspx32) -V '$(p_sspx32) (>= $(DEB_SOVERSION))'
+# dh_shlibdeps -p$(p_sspx32)
+ dh_gencontrol -p$(p_sspx32) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_sspx32)
+ dh_md5sums -p$(p_sspx32)
+ dh_builddeb -p$(p_sspx32)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
diff --git a/debian/rules.d/binary-libstdcxx.mk b/debian/rules.d/binary-libstdcxx.mk
new file mode 100644
index 0000000..6c5cef7
--- /dev/null
+++ b/debian/rules.d/binary-libstdcxx.mk
@@ -0,0 +1,548 @@
+
+ifeq ($(with_libcxx),yes)
+ $(lib_binaries) += libstdcxx
+endif
+ifeq ($(with_lib64cxx),yes)
+ $(lib_binaries) += lib64stdcxx
+endif
+ifeq ($(with_lib64cxxdev),yes)
+ $(lib_binaries) += lib64stdcxx-dev
+endif
+ifeq ($(with_lib64cxxdbg),yes)
+ $(lib_binaries) += lib64stdcxxdbg
+endif
+ifeq ($(with_lib32cxx),yes)
+ $(lib_binaries) += lib32stdcxx
+endif
+ifeq ($(with_lib32cxxdev),yes)
+ $(lib_binaries) += lib32stdcxx-dev
+endif
+ifeq ($(with_lib32cxxdbg),yes)
+ $(lib_binaries) += lib32stdcxxdbg
+endif
+ifeq ($(with_libn32cxx),yes)
+ $(lib_binaries) += libn32stdcxx
+endif
+ifeq ($(with_libn32cxxdev),yes)
+ $(lib_binaries) += libn32stdcxx-dev
+endif
+ifeq ($(with_libn32cxxdbg),yes)
+ $(lib_binaries) += libn32stdcxxdbg
+endif
+ifeq ($(with_libx32cxx),yes)
+ $(lib_binaries) += libx32stdcxx
+endif
+ifeq ($(with_libx32cxxdev),yes)
+ $(lib_binaries) += libx32stdcxx-dev
+endif
+ifeq ($(with_libx32cxxdbg),yes)
+ $(lib_binaries) += libx32stdcxxdbg
+endif
+ifeq ($(with_libhfcxx),yes)
+ $(lib_binaries) += libhfstdcxx
+endif
+ifeq ($(with_libhfcxxdev),yes)
+ $(lib_binaries) += libhfstdcxx-dev
+endif
+ifeq ($(with_libhfcxxdbg),yes)
+ $(lib_binaries) += libhfstdcxxdbg
+endif
+ifeq ($(with_libsfcxx),yes)
+ $(lib_binaries) += libsfstdcxx
+endif
+ifeq ($(with_libsfcxxdev),yes)
+ $(lib_binaries) += libsfstdcxx-dev
+endif
+ifeq ($(with_libsfcxxdbg),yes)
+ $(lib_binaries) += libsfstdcxxdbg
+endif
+
+ifeq ($(with_cxxdev),yes)
+ $(lib_binaries) += libstdcxx-dev
+ ifneq ($(DEB_CROSS),yes)
+ indep_binaries := $(indep_binaries) libstdcxx-doc
+ endif
+endif
+
+libstdc_ext = -$(BASE_VERSION)
+
+p_lib = libstdc++$(CXX_SONAME)$(cross_lib_arch)
+p_lib64 = lib64stdc++$(CXX_SONAME)$(cross_lib_arch)
+p_lib32 = lib32stdc++$(CXX_SONAME)$(cross_lib_arch)
+p_libn32= libn32stdc++$(CXX_SONAME)$(cross_lib_arch)
+p_libx32= libx32stdc++$(CXX_SONAME)$(cross_lib_arch)
+p_libhf = libhfstdc++$(CXX_SONAME)$(cross_lib_arch)
+p_libsf = libsfstdc++$(CXX_SONAME)$(cross_lib_arch)
+p_dev = libstdc++$(libstdc_ext)-dev$(cross_lib_arch)
+p_pic = libstdc++$(libstdc_ext)-pic$(cross_lib_arch)
+p_dbg = libstdc++$(CXX_SONAME)$(libstdc_ext)-dbg$(cross_lib_arch)
+p_dbg64 = lib64stdc++$(CXX_SONAME)$(libstdc_ext)-dbg$(cross_lib_arch)
+p_dbg32 = lib32stdc++$(CXX_SONAME)$(libstdc_ext)-dbg$(cross_lib_arch)
+p_dbgn32= libn32stdc++$(CXX_SONAME)$(libstdc_ext)-dbg$(cross_lib_arch)
+p_dbgx32= libx32stdc++$(CXX_SONAME)$(libstdc_ext)-dbg$(cross_lib_arch)
+p_dbghf = libhfstdc++$(CXX_SONAME)$(libstdc_ext)-dbg$(cross_lib_arch)
+p_dbgsf = libsfstdc++$(CXX_SONAME)$(libstdc_ext)-dbg$(cross_lib_arch)
+p_libd = libstdc++$(libstdc_ext)-doc
+
+d_lib = debian/$(p_lib)
+d_lib64 = debian/$(p_lib64)
+d_lib32 = debian/$(p_lib32)
+d_libn32= debian/$(p_libn32)
+d_libx32= debian/$(p_libx32)
+d_libhf = debian/$(p_libhf)
+d_libsf = debian/$(p_libsf)
+d_dev = debian/$(p_dev)
+d_pic = debian/$(p_pic)
+d_dbg = debian/$(p_dbg)
+d_dbg64 = debian/$(p_dbg64)
+d_dbg32 = debian/$(p_dbg32)
+d_dbghf = debian/$(p_dbghf)
+d_dbgsf = debian/$(p_dbgsf)
+d_libd = debian/$(p_libd)
+
+dirs_dev = \
+ $(docdir)/$(p_base)/C++ \
+ $(usr_lib) \
+ $(gcc_lib_dir)/include \
+ $(cxx_inc_dir)
+
+files_dev = \
+ $(cxx_inc_dir)/ \
+ $(gcc_lib_dir)/libstdc++.{a,so} \
+ $(gcc_lib_dir)/libsupc++.a
+
+ifeq ($(with_multiarch_cxxheaders),yes)
+ dirs_dev += \
+ $(PF)/include/$(DEB_TARGET_MULTIARCH)/c++/$(BASE_VERSION)
+ files_dev += \
+ $(PF)/include/$(DEB_TARGET_MULTIARCH)/c++/$(BASE_VERSION)/{bits,ext}
+endif
+
+dirs_dbg = \
+ $(docdir) \
+ $(PF)/lib/debug/$(usr_lib) \
+ $(usr_lib)/debug \
+ $(PF)/share/gdb/auto-load/$(usr_lib)/debug \
+ $(gcc_lib_dir)
+files_dbg = \
+ $(usr_lib)/debug/libstdc++.{a,so*}
+
+dirs_pic = \
+ $(docdir) \
+ $(gcc_lib_dir)
+files_pic = \
+ $(gcc_lib_dir)/libstdc++_pic.a
+
+# ----------------------------------------------------------------------
+
+gxx_baseline_dir = $(shell \
+ sed -n '/^baseline_dir *=/s,.*= *\(.*\)$$,\1,p' \
+ $(buildlibdir)/libstdc++-v3/testsuite/Makefile)
+gxx_baseline_file = $(gxx_baseline_dir)/baseline_symbols.txt
+
+debian/README.libstdc++-baseline:
+ cat debian/README.libstdc++-baseline.in \
+ > debian/README.libstdc++-baseline
+
+ baseline_name=`basename $(gxx_baseline_dir)`; \
+ baseline_parentdir=`dirname $(gxx_baseline_dir)`; \
+ compat_baseline_name=""; \
+ if [ -f "$(gxx_baseline_file)" ]; then \
+ ( \
+ echo "A baseline file for $$baseline_name was found."; \
+ echo "Running the check-abi script ..."; \
+ echo ""; \
+ $(MAKE) -C $(buildlibdir)/libstdc++-v3/testsuite \
+ check-abi; \
+ ) >> debian/README.libstdc++-baseline; \
+ else \
+ ( \
+ echo "No baseline file found for $$baseline_name."; \
+ echo "Generating a new baseline file ..."; \
+ echo ""; \
+ ) >> debian/README.libstdc++-baseline; \
+ mkdir -p $(gxx_baseline_dir); \
+ $(MAKE) -C $(buildlibdir)/libstdc++-v3/testsuite new-abi-baseline; \
+ if [ -f $(gxx_baseline_file) ]; then \
+ cat $(gxx_baseline_file); \
+ else \
+ cat $$(find $(buildlibdir)/libstdc++-v3 $(srcdir)/libstdc++-v3 -name '.new') || true; \
+ fi >> debian/README.libstdc++-baseline; \
+ fi
+
+# ----------------------------------------------------------------------
+define __do_libstdcxx
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_l)
+
+ dh_installdirs -p$(p_l) \
+ $(docdir) \
+ $(usr_lib$(2)) \
+ $(PF)/share/gdb/auto-load/$(usr_lib$(2))
+
+ $(if $(DEB_CROSS),,$(if $(2),,
+ dh_installdirs -p$(p_l) \
+ $(PF)/share/gcc-$(BASE_VERSION)/python
+ DH_COMPAT=2 dh_movefiles -p$(p_l) \
+ $(PF)/share/gcc-$(BASE_VERSION)/python/libstdcxx
+ ))
+ cp -p $(d)/$(usr_lib$(2))/libstdc++.so.*.py \
+ $(d_l)/$(PF)/share/gdb/auto-load/$(usr_lib$(2))/.
+ sed -i -e "/^libdir *=/s,=.*,= '/$(usr_lib$(2))'," \
+ $(d_l)/$(PF)/share/gdb/auto-load/$(usr_lib$(2))/libstdc++.so.*.py
+
+ cp -a $(d)/$(usr_lib$(2))/libstdc++.so.*[0-9] \
+ $(d_l)/$(usr_lib$(2))/.
+
+ debian/dh_doclink -p$(p_l) $(p_base)
+ debian/dh_rmemptydirs -p$(p_l)
+
+ dh_strip -p$(p_l) --dbg-package=$(1)-$(BASE_VERSION)-dbg$(cross_lib_arch)
+ dh_compress -p$(p_l)
+ dh_fixperms -p$(p_l)
+
+ $(if $(filter $(DEB_TARGET_ARCH), armel hppa), \
+ -$(cross_makeshlibs) dh_makeshlibs -p$(p_l) \
+ @echo "FIXME: libstdc++ not feature complete (https://gcc.gnu.org/ml/gcc/2014-07/msg00000.html)", \
+ $(cross_makeshlibs) dh_makeshlibs -p$(p_l) \
+ )
+
+ $(call cross_mangle_shlibs,$(p_l))
+ $(ignshld)DIRNAME=$(subst n,,$(2)) $(cross_shlibdeps) dh_shlibdeps -p$(p_l) \
+ $(call shlibdirs_to_search,$(subst stdc++$(CXX_SONAME),gcc$(GCC_SONAME),$(p_l)),$(2))
+ $(call cross_mangle_substvars,$(p_l))
+
+ $(cross_gencontrol) dh_gencontrol -p$(p_l) -- -v$(DEB_VERSION) $(common_substvars)
+ $(call cross_mangle_control,$(p_l))
+ dh_installdeb -p$(p_l)
+ dh_md5sums -p$(p_l)
+ dh_builddeb -p$(p_l)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+endef
+
+define __do_libstdcxx_dbg
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_d)
+ dh_installdirs -p$(p_d) \
+ $(PF)/lib/debug/$(usr_lib$(2)) \
+ $(usr_lib$(2))
+
+ $(if $(filter yes,$(with_lib$(2)cxx)),
+ cp -a $(d)/$(usr_lib$(2))/libstdc++.so.*[0-9] \
+ $(d_d)/$(usr_lib$(2))/.;
+ dh_strip -p$(p_d) --keep-debug;
+ $(if $(filter yes,$(with_common_libs)),, # if !with_common_libs
+ # remove the debug symbols for libstdc++
+ # built by a newer version of GCC
+ rm -rf $(d_d)/usr/lib/debug/$(PF);
+ )
+ rm -f $(d_d)/$(usr_lib$(2))/libstdc++.so.*[0-9]
+ )
+
+ $(if $(filter yes,$(with_debug)),
+ mkdir -p $(d_d)/$(usr_lib$(2))/debug;
+ mv $(d)/$(usr_lib$(2))/debug/libstdc++* $(d_d)/$(usr_lib$(2))/debug;
+ rm -f $(d_d)/$(usr_lib$(2))/debug/libstdc++_pic.a
+ )
+
+ $(ignshld)DIRNAME=$(subst n,,$(2)) $(cross_shlibdeps) dh_shlibdeps -p$(p_d) \
+ $(call shlibdirs_to_search,$(subst $(pkg_ver),,$(subst stdc++$(CXX_SONAME),gcc$(GCC_SONAME),$(p_l))),$(2))
+ $(call cross_mangle_substvars,$(p_d))
+
+ debian/dh_doclink -p$(p_d) $(p_base)
+ debian/dh_rmemptydirs -p$(p_d)
+
+ dh_compress -p$(p_d)
+ dh_fixperms -p$(p_d)
+ $(cross_gencontrol) dh_gencontrol -p$(p_d) -- -v$(DEB_VERSION) $(common_substvars)
+ $(call cross_mangle_control,$(p_d))
+
+ dh_installdeb -p$(p_d)
+ dh_md5sums -p$(p_d)
+ dh_builddeb -p$(p_d)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+endef
+
+define __do_libstdcxx_dev
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ mv $(d)/$(usr_lib$(2))/libstdc++.a $(d)/$(usr_lib$(2))/libsupc++.a \
+ $(d)/$(gcc_lib_dir$(2))/
+
+ rm -rf $(d_l)
+ dh_installdirs -p$(p_l) $(gcc_lib_dir$(2))
+
+ DH_COMPAT=2 dh_movefiles -p$(p_l) \
+ $(gcc_lib_dir$(2))/libstdc++.a \
+ $(gcc_lib_dir$(2))/libsupc++.a \
+ $(if $(with_multiarch_cxxheaders),$(PF)/include/$(DEB_TARGET_MULTIARCH)/c++/$(BASE_VERSION)/$(2))
+ $(call install_gcc_lib,libstdc++,$(CXX_SONAME),$(2),$(p_l))
+
+ debian/dh_doclink -p$(p_l) $(p_base)
+ debian/dh_rmemptydirs -p$(p_l)
+
+ dh_strip -p$(p_l)
+ dh_compress -p$(p_l)
+ dh_fixperms -p$(p_l)
+ dh_shlibdeps -p$(p_l)
+ $(cross_gencontrol) dh_gencontrol -p$(p_l) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_l)
+ dh_md5sums -p$(p_l)
+ dh_builddeb -p$(p_l)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+endef
+
+do_libstdcxx = $(call __do_libstdcxx,lib$(1)stdc++$(CXX_SONAME),$(1))
+do_libstdcxx_dbg = $(call __do_libstdcxx_dbg,lib$(1)stdc++$(CXX_SONAME)$(libstdc_ext),$(1))
+do_libstdcxx_dev = $(call __do_libstdcxx_dev,lib$(1)stdc++-$(BASE_VERSION)-dev,$(1))
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-libstdcxx: $(install_stamp)
+ $(call do_libstdcxx,)
+
+$(binary_stamp)-lib64stdcxx: $(install_stamp)
+ $(call do_libstdcxx,64)
+
+$(binary_stamp)-lib32stdcxx: $(install_stamp)
+ $(call do_libstdcxx,32)
+
+$(binary_stamp)-libn32stdcxx: $(install_stamp)
+ $(call do_libstdcxx,n32)
+
+$(binary_stamp)-libx32stdcxx: $(install_stamp)
+ $(call do_libstdcxx,x32)
+
+$(binary_stamp)-libhfstdcxx: $(install_stamp)
+ $(call do_libstdcxx,hf)
+
+$(binary_stamp)-libsfstdcxx: $(install_stamp)
+ $(call do_libstdcxx,sf)
+
+$(binary_stamp)-lib64stdcxxdbg: $(install_stamp)
+ $(call do_libstdcxx_dbg,64)
+
+$(binary_stamp)-lib32stdcxxdbg: $(install_stamp)
+ $(call do_libstdcxx_dbg,32)
+
+$(binary_stamp)-libn32stdcxxdbg: $(install_stamp)
+ $(call do_libstdcxx_dbg,n32)
+
+$(binary_stamp)-libx32stdcxxdbg: $(install_stamp)
+ $(call do_libstdcxx_dbg,x32)
+
+$(binary_stamp)-libhfstdcxxdbg: $(install_stamp)
+ $(call do_libstdcxx_dbg,hf)
+
+$(binary_stamp)-libsfstdcxxdbg: $(install_stamp)
+ $(call do_libstdcxx_dbg,sf)
+
+$(binary_stamp)-lib64stdcxx-dev: $(install_stamp)
+ $(call do_libstdcxx_dev,64)
+
+$(binary_stamp)-lib32stdcxx-dev: $(install_stamp)
+ $(call do_libstdcxx_dev,32)
+
+$(binary_stamp)-libn32stdcxx-dev: $(install_stamp)
+ $(call do_libstdcxx_dev,n32)
+
+$(binary_stamp)-libx32stdcxx-dev: $(install_stamp)
+ $(call do_libstdcxx_dev,x32)
+
+$(binary_stamp)-libhfstdcxx-dev: $(install_stamp)
+ $(call do_libstdcxx_dev,hf)
+
+$(binary_stamp)-libsfstdcxx-dev: $(install_stamp)
+ $(call do_libstdcxx_dev,sf)
+
+# ----------------------------------------------------------------------
+libcxxdev_deps = $(install_stamp)
+ifeq ($(with_libcxx),yes)
+ libcxxdev_deps += $(binary_stamp)-libstdcxx
+endif
+ifeq ($(with_check),yes)
+ libcxxdev_deps += debian/README.libstdc++-baseline
+endif
+$(binary_stamp)-libstdcxx-dev: $(libcxxdev_deps)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_dev) $(d_pic)
+ dh_installdirs -p$(p_dev) $(dirs_dev)
+ dh_installdirs -p$(p_pic) $(dirs_pic)
+ dh_installdirs -p$(p_dbg) $(dirs_dbg)
+
+ : # - correct libstdc++-v3 file locations
+ mv $(d)/$(usr_lib)/libsupc++.a $(d)/$(gcc_lib_dir)/
+ mv $(d)/$(usr_lib)/libstdc++.{a,so} $(d)/$(gcc_lib_dir)/
+ ln -sf ../../../$(DEB_TARGET_GNU_TYPE)/libstdc++.so.$(CXX_SONAME) \
+ $(d)/$(gcc_lib_dir)/libstdc++.so
+ mv $(d)/$(usr_lib)/libstdc++_pic.a $(d)/$(gcc_lib_dir)/
+
+ rm -f $(d)/$(usr_lib)/debug/libstdc++_pic.a
+ rm -f $(d)/$(usr_lib64)/debug/libstdc++_pic.a
+
+ : # remove precompiled headers
+ -find $(d) -type d -name '*.gch' | xargs rm -rf
+
+ for i in $(d)/$(PF)/include/c++/$(GCC_VERSION)/*-linux; do \
+ if [ -d $$i ]; then mv $$i $$i-gnu; fi; \
+ done
+
+ DH_COMPAT=2 dh_movefiles -p$(p_dev) $(files_dev)
+ DH_COMPAT=2 dh_movefiles -p$(p_pic) $(files_pic)
+ifeq ($(with_debug),yes)
+ DH_COMPAT=2 dh_movefiles -p$(p_dbg) $(files_dbg)
+endif
+
+ dh_link -p$(p_dev) \
+ /$(usr_lib)/libstdc++.so.$(CXX_SONAME) \
+ /$(gcc_lib_dir)/libstdc++.so \
+ /$(cxx_inc_dir) /$(PFL)/include/c++/$(GCC_VERSION)
+
+ debian/dh_doclink -p$(p_dev) $(p_base)
+ debian/dh_doclink -p$(p_pic) $(p_base)
+ debian/dh_doclink -p$(p_dbg) $(p_base)
+ cp -p $(srcdir)/libstdc++-v3/ChangeLog \
+ $(d_dev)/$(docdir)/$(p_base)/C++/changelog.libstdc++
+ifeq ($(with_check),yes)
+ cp -p debian/README.libstdc++-baseline \
+ $(d_dev)/$(docdir)/$(p_base)/C++/README.libstdc++-baseline.$(DEB_TARGET_ARCH)
+ if [ -f $(buildlibdir)/libstdc++-v3/testsuite/current_symbols.txt ]; \
+ then \
+ cp -p $(buildlibdir)/libstdc++-v3/testsuite/current_symbols.txt \
+ $(d_dev)/$(docdir)/$(p_base)/C++/libstdc++_symbols.txt.$(DEB_TARGET_ARCH); \
+ fi
+endif
+ cp -p $(buildlibdir)/libstdc++-v3/src/libstdc++-symbols.ver \
+ $(d_pic)/$(gcc_lib_dir)/libstdc++_pic.map
+
+ cp -p $(d)/$(usr_lib)/libstdc++.so.*.py \
+ $(d_dbg)/$(PF)/share/gdb/auto-load/$(usr_lib)/debug/.
+ sed -i -e "/^libdir *=/s,=.*,= '/$(usr_lib)'," \
+ $(d_dbg)/$(PF)/share/gdb/auto-load/$(usr_lib)/debug/libstdc++.so.*.py
+
+ifeq ($(with_libcxx),yes)
+ cp -a $(d)/$(usr_lib)/libstdc++.so.*[0-9] \
+ $(d_dbg)/$(usr_lib)/
+ dh_strip -p$(p_dbg) --keep-debug
+ rm -f $(d_dbg)/$(usr_lib)/libstdc++.so.*[0-9]
+endif
+
+ dh_strip -p$(p_dev) --dbg-package=$(p_dbg)
+ifneq ($(with_common_libs),yes)
+ : # remove the debug symbols for libstdc++ built by a newer version of GCC
+ rm -rf $(d_dbg)/usr/lib/debug/$(PF)
+endif
+ dh_strip -p$(p_pic)
+
+ifeq ($(with_cxxdev),yes)
+ debian/dh_rmemptydirs -p$(p_dev)
+ debian/dh_rmemptydirs -p$(p_pic)
+ debian/dh_rmemptydirs -p$(p_dbg)
+endif
+
+ dh_compress -p$(p_dev) -p$(p_pic) -p$(p_dbg) -X.txt
+ dh_fixperms -p$(p_dev) -p$(p_pic) -p$(p_dbg)
+# XXX: what about biarchn32?
+#ifeq ($(biarch64),yes)
+# $(ignshld)DIRNAME=$(subst n,,$(2)) $(cross_shlibdeps) dh_shlibdeps -p$(p_dev) -p$(p_pic) -p$(p_dbg) -Xlib64
+#else
+# $(ignshld)DIRNAME=$(subst n,,$(2)) $(cross_shlibdeps) dh_shlibdeps -p$(p_dev) -p$(p_pic) -p$(p_dbg) -Xlib32/debug
+#endif
+ $(ignshld)DIRNAME=$(subst n,,$(2)) $(cross_shlibdeps) dh_shlibdeps -p$(p_dev) -p$(p_pic) -p$(p_dbg)
+ $(call cross_mangle_substvars,$(p_dbg))
+ $(cross_gencontrol) dh_gencontrol -p$(p_dev) -p$(p_pic) -p$(p_dbg) \
+ -- -v$(DEB_VERSION) $(common_substvars)
+
+ dh_installdeb -p$(p_dev) -p$(p_pic) -p$(p_dbg)
+ dh_md5sums -p$(p_dev) -p$(p_pic) -p$(p_dbg)
+ dh_builddeb -p$(p_dev) -p$(p_pic) -p$(p_dbg)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+# ----------------------------------------------------------------------
+
+doxygen_doc_dir = $(buildlibdir)/libstdc++-v3/doc
+
+doxygen-docs: $(build_doxygen_stamp)
+$(build_doxygen_stamp):
+ $(MAKE) -C $(buildlibdir)/libstdc++-v3/doc SHELL=/bin/bash doc-html-doxygen
+ $(MAKE) -C $(buildlibdir)/libstdc++-v3/doc SHELL=/bin/bash doc-man-doxygen
+ -find $(doxygen_doc_dir)/doxygen/html -name 'struct*' -empty | xargs rm -f
+
+ touch $@
+
+$(binary_stamp)-libstdcxx-doc: $(install_stamp) doxygen-docs
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_libd)
+ dh_installdirs -p$(p_libd) \
+ $(docdir)/$(p_base)/libstdc++ \
+ $(PF)/share/man
+
+# debian/dh_doclink -p$(p_libd) $(p_base)
+ dh_link -p$(p_libd) /usr/share/doc/$(p_base) /usr/share/doc/$(p_libd)
+ dh_installdocs -p$(p_libd)
+ rm -f $(d_libd)/$(docdir)/$(p_base)/copyright
+
+ cp -a $(srcdir)/libstdc++-v3/doc/html/* \
+ $(d_libd)/$(docdir)/$(p_base)/libstdc++/.
+ cp -a $(doxygen_doc_dir)/doxygen/html \
+ $(d_libd)/$(docdir)/$(p_base)/libstdc++/user
+ find $(d_libd)/$(docdir)/$(p_base)/libstdc++ -name '*.md5' \
+ | xargs -r rm -f
+
+# Broken docs ... see #766499
+# rm -f $(d_libd)/$(docdir)/$(p_base)/libstdc++/*/jquery.js
+# dh_link -p$(p_libd) \
+# /usr/share/javascript/jquery/jquery.js \
+# /$(docdir)/$(p_base)/libstdc++/html/jquery.js \
+# /usr/share/javascript/jquery/jquery.js \
+# /$(docdir)/$(p_base)/libstdc++/user/jquery.js
+
+ : FIXME: depending on the doxygen version
+ if [ -d $(doxygen_doc_dir)/doxygen/man/man3cxx ]; then \
+ cp -a $(doxygen_doc_dir)/doxygen/man/man3cxx \
+ $(d_libd)/$(PF)/share/man/man3; \
+ if [ -d $(doxygen_doc_dir)/doxygen/man/man3 ]; then \
+ cp -a $(doxygen_doc_dir)/doxygen/man/man3/* \
+ $(d_libd)/$(PF)/share/man/man3/; \
+ fi; \
+ elif [ -d $(doxygen_doc_dir)/doxygen/man/man3 ]; then \
+ cp -a $(doxygen_doc_dir)/doxygen/man/man3 \
+ $(d_libd)/$(PF)/share/man/man3; \
+ fi
+
+ for i in $(d_libd)/$(PF)/share/man/man3/*.3; do \
+ [ -f $${i} ] || continue; \
+ mv $${i} $${i}cxx; \
+ done
+ rm -f $(d_libd)/$(PF)/share/man/man3/todo.3*
+
+ mkdir -p $(d_libd)/usr/share/lintian/overrides
+ cp -p debian/$(p_libd).overrides \
+ $(d_libd)/usr/share/lintian/overrides/$(p_libd)
+
+ dh_compress -p$(p_libd) -Xhtml/17_intro -X.txt -X.tag -X.map
+ dh_fixperms -p$(p_libd)
+ dh_gencontrol -p$(p_libd) -- -v$(DEB_VERSION) $(common_substvars)
+
+ dh_installdeb -p$(p_libd)
+ dh_md5sums -p$(p_libd)
+ dh_builddeb -p$(p_libd)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
diff --git a/debian/rules.d/binary-libtsan.mk b/debian/rules.d/binary-libtsan.mk
new file mode 100644
index 0000000..87d3ce5
--- /dev/null
+++ b/debian/rules.d/binary-libtsan.mk
@@ -0,0 +1,84 @@
+$(lib_binaries) += libtsan
+ifeq (0,1)
+ifeq ($(with_lib64tsan),yes)
+ $(lib_binaries) += lib64tsan
+endif
+ifeq ($(with_lib32tsan),yes)
+ $(lib_binaries) += lib32tsan
+endif
+ifeq ($(with_libn32tsan),yes)
+ $(lib_binaries) += libn32tsan
+endif
+ifeq ($(with_libx32tsan),yes)
+ $(lib_binaries) += libx32tsan
+endif
+ifeq ($(with_libhftsan),yes)
+ $(lib_binaries) += libhftsan
+endif
+ifeq ($(with_libsftsan),yes)
+ $(lib_binaries) += libsftsan
+endif
+endif
+
+define __do_tsan
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_l) $(d_d)
+ dh_installdirs -p$(p_l) $(usr_lib$(2))
+ DH_COMPAT=2 dh_movefiles -p$(p_l) $(usr_lib$(2))/libtsan.so.*
+
+ debian/dh_doclink -p$(p_l) $(p_base)
+ debian/dh_doclink -p$(p_d) $(p_base)
+
+ if [ -f debian/$(p_l).overrides ]; then \
+ mkdir -p debian/$(p_l)/usr/share/lintian/overrides; \
+ cp debian/$(p_l).overrides debian/$(p_l)/usr/share/lintian/overrides/$(p_l); \
+ fi
+
+ dh_strip -p$(p_l) --dbg-package=$(p_d)
+ dh_compress -p$(p_l) -p$(p_d)
+ dh_fixperms -p$(p_l) -p$(p_d)
+ $(cross_makeshlibs) dh_makeshlibs -p$(p_l)
+ $(call cross_mangle_shlibs,$(p_l))
+ $(ignshld)DIRNAME=$(subst n,,$(2)) $(cross_shlibdeps) dh_shlibdeps -p$(p_l) \
+ $(call shlibdirs_to_search, \
+ $(subst tsan$(TSAN_SONAME),gcc$(GCC_SONAME),$(p_l)) \
+ $(subst tsan$(TSAN_SONAME),stdc++$(CXX_SONAME),$(p_l)) \
+ ,$(2))
+ $(call cross_mangle_substvars,$(p_l))
+ $(cross_gencontrol) dh_gencontrol -p$(p_l) -p$(p_d) \
+ -- -v$(DEB_VERSION) $(common_substvars)
+ $(call cross_mangle_control,$(p_l))
+ dh_installdeb -p$(p_l) -p$(p_d)
+ dh_md5sums -p$(p_l) -p$(p_d)
+ dh_builddeb -p$(p_l) -p$(p_d)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+endef
+
+# ----------------------------------------------------------------------
+
+do_tsan = $(call __do_tsan,lib$(1)tsan$(TSAN_SONAME),$(1))
+
+$(binary_stamp)-libtsan: $(install_stamp)
+ $(call do_tsan,)
+
+$(binary_stamp)-lib64tsan: $(install_stamp)
+ $(call do_tsan,64)
+
+$(binary_stamp)-lib32tsan: $(install_stamp)
+ $(call do_tsan,32)
+
+$(binary_stamp)-libn32tsan: $(install_stamp)
+ $(call do_tsan,n32)
+
+$(binary_stamp)-libx32tsan: $(install_stamp)
+ $(call do_tsan,x32)
+
+$(binary_stamp)-libhftsan: $(install_dependencies)
+ $(call do_tsan,hf)
+
+$(binary_stamp)-libsftsan: $(install_dependencies)
+ $(call do_tsan,sf)
diff --git a/debian/rules.d/binary-libubsan.mk b/debian/rules.d/binary-libubsan.mk
new file mode 100644
index 0000000..278ee49
--- /dev/null
+++ b/debian/rules.d/binary-libubsan.mk
@@ -0,0 +1,83 @@
+$(lib_binaries) += libubsan
+ifeq ($(with_lib64ubsan),yes)
+ $(lib_binaries) += lib64ubsan
+endif
+ifeq ($(with_lib32ubsan),yes)
+ $(lib_binaries) += lib32ubsan
+endif
+ifeq ($(with_libn32ubsan),yes)
+ $(lib_binaries) += libn32ubsan
+endif
+ifeq ($(with_libx32ubsan),yes)
+ $(lib_binaries) += libx32ubsan
+endif
+ifeq ($(with_libhfubsan),yes)
+ $(lib_binaries) += libhfubsan
+endif
+ifeq ($(with_libsfubsan),yes)
+ $(lib_binaries) += libsfubsan
+endif
+
+define __do_ubsan
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_l) $(d_d)
+ dh_installdirs -p$(p_l) $(usr_lib$(2))
+ $(if $(empty_sanitizer_packages),, \
+ DH_COMPAT=2 dh_movefiles -p$(p_l) $(usr_lib$(2))/libubsan.so.* )
+
+ debian/dh_doclink -p$(p_l) $(p_base)
+ debian/dh_doclink -p$(p_d) $(p_base)
+
+ if [ -f debian/$(p_l).overrides ]; then \
+ mkdir -p debian/$(p_l)/usr/share/lintian/overrides; \
+ cp debian/$(p_l).overrides debian/$(p_l)/usr/share/lintian/overrides/$(p_l); \
+ fi
+
+ dh_strip -p$(p_l) --dbg-package=$(p_d)
+ dh_compress -p$(p_l) -p$(p_d)
+ dh_fixperms -p$(p_l) -p$(p_d)
+ $(cross_makeshlibs) dh_makeshlibs -p$(p_l)
+ $(call cross_mangle_shlibs,$(p_l))
+ $(ignshld)DIRNAME=$(subst n,,$(2)) $(cross_shlibdeps) dh_shlibdeps -p$(p_l) \
+ $(call shlibdirs_to_search, \
+ $(subst ubsan$(UBSAN_SONAME),gcc$(GCC_SONAME),$(p_l)) \
+ $(subst ubsan$(UBSAN_SONAME),stdc++$(CXX_SONAME),$(p_l)) \
+ ,$(2))
+ $(call cross_mangle_substvars,$(p_l))
+ $(cross_gencontrol) dh_gencontrol -p$(p_l) -p$(p_d) \
+ -- -v$(DEB_VERSION) $(common_substvars)
+ $(call cross_mangle_control,$(p_l))
+ dh_installdeb -p$(p_l) -p$(p_d)
+ dh_md5sums -p$(p_l) -p$(p_d)
+ dh_builddeb -p$(p_l) -p$(p_d)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+endef
+
+# ----------------------------------------------------------------------
+
+do_ubsan = $(call __do_ubsan,lib$(1)ubsan$(UBSAN_SONAME),$(1))
+
+$(binary_stamp)-libubsan: $(install_stamp)
+ $(call do_ubsan,)
+
+$(binary_stamp)-lib64ubsan: $(install_stamp)
+ $(call do_ubsan,64)
+
+$(binary_stamp)-lib32ubsan: $(install_stamp)
+ $(call do_ubsan,32)
+
+$(binary_stamp)-libn32ubsan: $(install_stamp)
+ $(call do_ubsan,n32)
+
+$(binary_stamp)-libx32ubsan: $(install_stamp)
+ $(call do_ubsan,x32)
+
+$(binary_stamp)-libhfubsan: $(install_dependencies)
+ $(call do_ubsan,hf)
+
+$(binary_stamp)-libsfubsan: $(install_dependencies)
+ $(call do_ubsan,sf)
diff --git a/debian/rules.d/binary-libvtv.mk b/debian/rules.d/binary-libvtv.mk
new file mode 100644
index 0000000..8994aa3
--- /dev/null
+++ b/debian/rules.d/binary-libvtv.mk
@@ -0,0 +1,82 @@
+$(lib_binaries) += libvtv
+ifeq ($(with_lib64vtv),yes)
+ $(lib_binaries) += lib64vtv
+endif
+ifeq ($(with_lib32vtv),yes)
+ $(lib_binaries) += lib32vtv
+endif
+ifeq ($(with_libn32vtv),yes)
+ $(lib_binaries) += libn32vtv
+endif
+ifeq ($(with_libx32vtv),yes)
+ $(lib_binaries) += libx32vtv
+endif
+ifeq ($(with_libhfvtv),yes)
+ $(lib_binaries) += libhfvtv
+endif
+ifeq ($(with_libsfvtv),yes)
+ $(lib_binaries) += libsfvtv
+endif
+
+define __do_vtv
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_l) $(d_d)
+ dh_installdirs -p$(p_l) $(usr_lib$(2))
+ DH_COMPAT=2 dh_movefiles -p$(p_l) $(usr_lib$(2))/libvtv.so.*
+
+ debian/dh_doclink -p$(p_l) $(p_base)
+ debian/dh_doclink -p$(p_d) $(p_base)
+
+ if [ -f debian/$(p_l).overrides ]; then \
+ mkdir -p debian/$(p_l)/usr/share/lintian/overrides; \
+ cp debian/$(p_l).overrides debian/$(p_l)/usr/share/lintian/overrides/$(p_l); \
+ fi
+
+ dh_strip -p$(p_l) --dbg-package=$(p_d)
+ dh_compress -p$(p_l) -p$(p_d)
+ dh_fixperms -p$(p_l) -p$(p_d)
+ $(cross_makeshlibs) dh_makeshlibs -p$(p_l)
+ $(call cross_mangle_shlibs,$(p_l))
+ $(ignshld)DIRNAME=$(subst n,,$(2)) $(cross_shlibdeps) dh_shlibdeps -p$(p_l) \
+ $(call shlibdirs_to_search, \
+ $(subst vtv$(VTV_SONAME),gcc$(GCC_SONAME),$(p_l)) \
+ $(subst vtv$(VTV_SONAME),stdc++$(CXX_SONAME),$(p_l)) \
+ ,$(2))
+ $(call cross_mangle_substvars,$(p_l))
+ $(cross_gencontrol) dh_gencontrol -p$(p_l) -p$(p_d) \
+ -- -v$(DEB_VERSION) $(common_substvars)
+ $(call cross_mangle_control,$(p_l))
+ dh_installdeb -p$(p_l) -p$(p_d)
+ dh_md5sums -p$(p_l) -p$(p_d)
+ dh_builddeb -p$(p_l) -p$(p_d)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+endef
+
+# ----------------------------------------------------------------------
+
+do_vtv = $(call __do_vtv,lib$(1)vtv$(VTV_SONAME),$(1))
+
+$(binary_stamp)-libvtv: $(install_stamp)
+ $(call do_vtv,)
+
+$(binary_stamp)-lib64vtv: $(install_stamp)
+ $(call do_vtv,64)
+
+$(binary_stamp)-lib32vtv: $(install_stamp)
+ $(call do_vtv,32)
+
+$(binary_stamp)-libn32vtv: $(install_stamp)
+ $(call do_vtv,n32)
+
+$(binary_stamp)-libx32vtv: $(install_stamp)
+ $(call do_vtv,x32)
+
+$(binary_stamp)-libhfvtv: $(install_dependencies)
+ $(call do_vtv,hf)
+
+$(binary_stamp)-libsfvtv: $(install_dependencies)
+ $(call do_vtv,sf)
diff --git a/debian/rules.d/binary-neon.mk b/debian/rules.d/binary-neon.mk
new file mode 100644
index 0000000..b7b3f38
--- /dev/null
+++ b/debian/rules.d/binary-neon.mk
@@ -0,0 +1,53 @@
+arch_binaries := $(arch_binaries) neon
+
+p_nlgcc = libgcc$(GCC_SONAME)-neon
+p_ngomp = libgomp$(GOMP_SONAME)-neon
+p_nlobjc = libobjc$(OBJC_SONAME)-neon
+p_nflib = libgfortran$(FORTRAN_SONAME)-neon
+p_nlcxx = libstdc++$(CXX_SONAME)-neon
+
+d_nlgcc = debian/$(p_nlgcc)
+d_ngomp = debian/$(p_ngomp)
+d_nlobjc = debian/$(p_nlobjc)
+d_nflib = debian/$(p_nflib)
+d_nlcxx = debian/$(p_nlcxx)
+
+neon_pkgs = -p$(p_nlgcc) -p$(p_ngomp) -p$(p_nlobjc) -p$(p_nflib) -p$(p_nlcxx)
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-neon: $(install_neon_stamp)
+ dh_testdir
+ dh_testroot
+
+ dh_installdirs -p$(p_nlgcc) \
+ $(PF)/share/doc \
+ lib/neon
+ dh_installdirs -A -p$(p_ngomp) -p$(p_nlobjc) -p$(p_nflib) -p$(p_nlcxx) \
+ $(PF)/share/doc \
+ $(PF)/lib/neon
+
+ cp -a $(d_neon)/$(PF)/lib/libgcc*.so.* \
+ $(d_nlgcc)/lib/neon/
+ cp -a $(d_neon)/$(PF)/lib/libgomp*.so.* \
+ $(d_ngomp)/$(PF)/lib/neon/
+ cp -a $(d_neon)/$(PF)/lib/libobjc*.so.* \
+ $(d_nlobjc)/$(PF)/lib/neon/
+ cp -a $(d_neon)/$(PF)/lib/libgfortran*.so.* \
+ $(d_nflib)/$(PF)/lib/neon/
+ cp -a $(d_neon)/$(PF)/lib/libstdc++*.so.* \
+ $(d_nlcxx)/$(PF)/lib/neon/
+
+ for p in $(p_nlgcc) $(p_ngomp) $(p_nlobjc) $(p_nflib) $(p_nlcxx); do \
+ ln -s ../$(p_base) debian/$$p/usr/share/doc/$$p; \
+ done
+
+ dh_strip $(neon_pkgs)
+ dh_compress $(neon_pkgs)
+ dh_fixperms $(neon_pkgs)
+ dh_shlibdeps $(neon_pkgs)
+ dh_gencontrol $(neon_pkgs) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb $(neon_pkgs)
+ dh_md5sums $(neon_pkgs)
+ dh_builddeb $(neon_pkgs)
+
+ touch $@
diff --git a/debian/rules.d/binary-nof.mk b/debian/rules.d/binary-nof.mk
new file mode 100644
index 0000000..3197645
--- /dev/null
+++ b/debian/rules.d/binary-nof.mk
@@ -0,0 +1,56 @@
+arch_binaries := $(arch_binaries) nof
+
+p_nof = gcc$(pkg_ver)-nof
+d_nof = debian/$(p_nof)
+
+dirs_nof = \
+ $(docdir) \
+ $(usr_lib)/nof
+ifeq ($(with_cdev),yes)
+ dirs_nof += \
+ $(gcc_lib_dir)/nof
+endif
+
+ifeq ($(with_cdev),yes)
+ files_nof = \
+ $(libgcc_dir)/libgcc_s_nof.so.$(GCC_SONAME) \
+ $(gcc_lib_dir)/libgcc_s_nof.so \
+ $(usr_lib)/nof \
+ $(gcc_lib_dir)/nof
+else
+ files_nof = \
+ $(usr_lib)/libgcc_s_nof.so.$(GCC_SONAME)
+endif
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-nof: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ mv $(d)/$(usr_lib)/libgcc_s_nof.so.$(GCC_SONAME) $(d)/$(libgcc_dir)/.
+ rm -f $(d)/$(usr_lib)/libgcc_s_nof.so
+ ln -sf $(libgcc_dir)/libgcc_s_nof.so.$(GCC_SONAME) \
+ $(d)/$(gcc_lib_dir)/libgcc_s_nof.so
+
+ rm -rf $(d_nof)
+ dh_installdirs -p$(p_nof) $(dirs_nof)
+ DH_COMPAT=2 dh_movefiles -p$(p_nof) $(files_nof)
+ debian/dh_doclink -p$(p_nof) $(p_xbase)
+ dh_strip -p$(p_nof)
+ dh_compress -p$(p_nof)
+ dh_fixperms -p$(p_nof)
+ dh_shlibdeps -p$(p_nof)
+
+ dh_makeshlibs -p$(p_nof)
+ : # Only keep the shlibs file for the libgcc_s_nof library
+ fgrep libgcc_s_nof debian/$(p_nof)/DEBIAN/shlibs \
+ > debian/$(p_nof)/DEBIAN/shlibs.tmp
+ mv -f debian/$(p_nof)/DEBIAN/shlibs.tmp debian/$(p_nof)/DEBIAN/shlibs
+
+ dh_gencontrol -p$(p_nof) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_nof)
+ dh_md5sums -p$(p_nof)
+ dh_builddeb -p$(p_nof)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
diff --git a/debian/rules.d/binary-objc.mk b/debian/rules.d/binary-objc.mk
new file mode 100644
index 0000000..29daa45
--- /dev/null
+++ b/debian/rules.d/binary-objc.mk
@@ -0,0 +1,70 @@
+ifneq (,$(filter yes, $(biarch64) $(biarch32) $(biarchn32) $(biarchx32) $(biarchhf) $(biarchsf)))
+ arch_binaries := $(arch_binaries) objc-multi
+endif
+arch_binaries := $(arch_binaries) objc
+
+p_objc = gobjc$(pkg_ver)$(cross_bin_arch)
+d_objc = debian/$(p_objc)
+
+p_objc_m= gobjc$(pkg_ver)-multilib$(cross_bin_arch)
+d_objc_m= debian/$(p_objc_m)
+
+dirs_objc = \
+ $(docdir)/$(p_xbase)/ObjC \
+ $(gcc_lexec_dir)
+
+files_objc = \
+ $(gcc_lexec_dir)/cc1obj
+
+$(binary_stamp)-objc: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_objc)
+ dh_installdirs -p$(p_objc) $(dirs_objc)
+ DH_COMPAT=2 dh_movefiles -p$(p_objc) $(files_objc)
+
+ cp -p $(srcdir)/libobjc/{README*,THREADS*} \
+ $(d_objc)/$(docdir)/$(p_xbase)/ObjC/.
+
+ cp -p $(srcdir)/libobjc/ChangeLog \
+ $(d_objc)/$(docdir)/$(p_xbase)/ObjC/changelog.libobjc
+
+ debian/dh_doclink -p$(p_objc) $(p_xbase)
+
+ debian/dh_rmemptydirs -p$(p_objc)
+
+ dh_strip -p$(p_objc)
+ dh_compress -p$(p_objc)
+
+ dh_fixperms -p$(p_objc)
+ dh_shlibdeps -p$(p_objc)
+ dh_gencontrol -p$(p_objc) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_objc)
+ dh_md5sums -p$(p_objc)
+ dh_builddeb -p$(p_objc)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+$(binary_stamp)-objc-multi: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_objc_m)
+ dh_installdirs -p$(p_objc_m) $(docdir)
+
+ debian/dh_doclink -p$(p_objc_m) $(p_xbase)
+
+ dh_strip -p$(p_objc_m)
+ dh_compress -p$(p_objc_m)
+
+ dh_fixperms -p$(p_objc_m)
+ dh_shlibdeps -p$(p_objc_m)
+ dh_gencontrol -p$(p_objc_m) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_objc_m)
+ dh_md5sums -p$(p_objc_m)
+ dh_builddeb -p$(p_objc_m)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
diff --git a/debian/rules.d/binary-objcxx.mk b/debian/rules.d/binary-objcxx.mk
new file mode 100644
index 0000000..a721d49
--- /dev/null
+++ b/debian/rules.d/binary-objcxx.mk
@@ -0,0 +1,65 @@
+ifneq (,$(filter yes, $(biarch64) $(biarch32) $(biarchn32) $(biarchx32) $(biarchhf) $(biarchsf)))
+ arch_binaries := $(arch_binaries) objcxx-multi
+endif
+arch_binaries := $(arch_binaries) objcxx
+
+p_objcx = gobjc++$(pkg_ver)$(cross_bin_arch)
+d_objcx = debian/$(p_objcx)
+
+p_objcx_m = gobjc++$(pkg_ver)-multilib$(cross_bin_arch)
+d_objcx_m = debian/$(p_objcx_m)
+
+dirs_objcx = \
+ $(docdir)/$(p_xbase)/Obj-C++ \
+ $(gcc_lexec_dir)
+
+files_objcx = \
+ $(gcc_lexec_dir)/cc1objplus
+
+$(binary_stamp)-objcxx: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_objcx)
+ dh_installdirs -p$(p_objcx) $(dirs_objcx)
+ DH_COMPAT=2 dh_movefiles -p$(p_objcx) $(files_objcx)
+
+ debian/dh_doclink -p$(p_objcx) $(p_xbase)
+ cp -p $(srcdir)/gcc/objcp/ChangeLog \
+ $(d_objcx)/$(docdir)/$(p_xbase)/Obj-C++/changelog
+
+ debian/dh_rmemptydirs -p$(p_objcx)
+
+ dh_strip -p$(p_objcx)
+ dh_compress -p$(p_objcx)
+
+ dh_fixperms -p$(p_objcx)
+ dh_shlibdeps -p$(p_objcx)
+ dh_gencontrol -p$(p_objcx) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_objcx)
+ dh_md5sums -p$(p_objcx)
+ dh_builddeb -p$(p_objcx)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+$(binary_stamp)-objcxx-multi: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_objcx_m)
+
+ debian/dh_doclink -p$(p_objcx_m) $(p_xbase)
+ debian/dh_rmemptydirs -p$(p_objcx_m)
+ dh_strip -p$(p_objcx_m)
+ dh_compress -p$(p_objcx_m)
+
+ dh_fixperms -p$(p_objcx_m)
+ dh_shlibdeps -p$(p_objcx_m)
+ dh_gencontrol -p$(p_objcx_m) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_objcx_m)
+ dh_md5sums -p$(p_objcx_m)
+ dh_builddeb -p$(p_objcx_m)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
diff --git a/debian/rules.d/binary-snapshot.mk b/debian/rules.d/binary-snapshot.mk
new file mode 100644
index 0000000..0d610f9
--- /dev/null
+++ b/debian/rules.d/binary-snapshot.mk
@@ -0,0 +1,229 @@
+arch_binaries := $(arch_binaries) snapshot
+
+ifneq (,$(findstring gcc-snapshot, $(PKGSOURCE)))
+ p_snap = gcc-snapshot
+else ifneq (,$(findstring gcc-linaro, $(PKGSOURCE)))
+ p_snap = gcc-linaro
+else
+ $(error unknown build for single gcc package)
+endif
+
+ifeq ($(DEB_CROSS),yes)
+ p_snap := $(p_snap)$(cross_bin_arch)
+endif
+d_snap = debian/$(p_snap)
+
+dirs_snap = \
+ $(docdir)/$(p_snap) \
+ usr/lib
+
+ifeq ($(with_hppa64),yes)
+ snapshot_depends = binutils-hppa64
+endif
+
+$(stampdir)/ecj_binaries: $(install_snap_stamp)
+ mkdir -p $(builddir)/aot/jar $(builddir)/aot/bin
+ cp $(ecj_jar) $(builddir)/aot/jar/ecj-standalone.jar
+ zip -d $(builddir)/aot/jar/ecj-standalone.jar \
+ 'org/eclipse/jdt/core/JDTCompilerAdapter*'
+
+ cd $(builddir)/aot/jar \
+ && fastjar xf ecj-standalone.jar \
+ && find -name '*.rsc' -o -name '*.properties' \
+ | fastjar -c -@ - -f ../resources.jar
+ rm -rf $(builddir)/aot/jar/META-INF $(builddir)/aot/jar/org
+ $(d)/$(PF)/bin/gcj \
+ -c -O2 -g -fPIC -fjni -findirect-dispatch \
+ -o $(builddir)/aot/bin/resources.o $(builddir)/aot/resources.jar
+
+ cp $(srcdir)/libjava/contrib/classfile.py $(builddir)/aot/
+ cp $(buildlibdir)/libjava/contrib/*.py $(builddir)/aot/
+ grep -v '^sys.path.insert' $(buildlibdir)/libjava/contrib/aot-compile \
+ > $(builddir)/aot/aot-compile
+ chmod 755 $(builddir)/aot/aot-compile
+ patch -p1 < debian/patches/aotcompile.diff
+ LD_LIBRARY_PATH=$${LD_LIBRARY_PATH:+$$LD_LIBRARY_PATH:}$(CURDIR)/$(d)/$(PF)/lib \
+ RPATH=-Wl,-rpath,/$(PF)/lib \
+ PYTHONPATH=$(builddir)/aot \
+ python $(builddir)/aot/aot-compile \
+ --gcj=$(CURDIR)/$(d)/$(PF)/bin/gcj \
+ --dbtool=$(CURDIR)/$(d)/$(PF)/bin/gcj-dbtool \
+ $(builddir)/aot/jar $(builddir)/aot/bin
+ touch $@
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-snapshot: $(install_snap_stamp) \
+ $(if $(filter $(with_ecj),yes),$(stampdir)/ecj_binaries)
+ dh_testdir
+ dh_testroot
+ mv $(install_snap_stamp) $(install_snap_stamp)-tmp
+
+ rm -rf $(d_snap)
+ dh_installdirs -p$(p_snap) $(dirs_snap)
+
+ mv $(d)/$(PF) $(d_snap)/usr/lib/
+
+ find $(d_snap) -name '*.gch' -type d | xargs -r rm -rf
+ find $(d_snap) -name '*.la' -o -name '*.lai' | xargs -r rm -f
+
+ : # FIXME: libbacktrace is not installed by default
+ for d in . 32 n32 64 sf hf; do \
+ if [ -f $(buildlibdir)/$$d/libbacktrace/.libs/libbacktrace.a ]; then \
+ install -m644 $(buildlibdir)/$$d/libbacktrace/.libs/libbacktrace.a \
+ $(d_snap)/$(gcc_lib_dir)/$$d; \
+ fi; \
+ done
+ if [ -f $(buildlibdir)/libbacktrace/backtrace-supported.h ]; then \
+ install -m644 $(buildlibdir)/libbacktrace/backtrace-supported.h \
+ $(d_snap)/$(gcc_lib_dir)/include/; \
+ install -m644 $(srcdir)/libbacktrace/backtrace.h \
+ $(d_snap)/$(gcc_lib_dir)/include/; \
+ fi
+
+ rm -rf $(d_snap)/$(PF)/lib/nof
+ifeq ($(with_java),yes)
+ mv $(d)/usr/lib/jvm $(d_snap)/usr/lib/
+
+ dh_link -p$(p_snap) \
+ $(gcc_lib_dir)/include/gcj $(jvm_dir)/include/gcj \
+ usr/bin/ecj $(jvm_dir)/bin/javac
+
+ ifneq ($(DEB_TARGET_ARCH_CPU),$(java_cpu))
+ ln -sf $(java_cpu) $(d_snap)/$(jvm_dir)/jre/lib/$(DEB_TARGET_ARCH_CPU)
+ endif
+ ifeq ($(with_ecj),yes)
+ install -m755 $(builddir)/aot/bin/javac $(d_snap)/$(jvm_dir)/bin/javac
+ install -m755 $(builddir)/aot/bin/ecj1 $(d_snap)/$(gcc_lexec_dir)/ecj1
+
+ ifeq (./,$(dir $(ecj_jar)))
+ install -m 644 $(ecj_jar) $(d_snap)/$(jvm_dir)/lib/ecj.jar
+ else
+ dh_link -p$(p_snap) \
+ $(ecj_jar) $(jvm_dir)/lib/ecj.jar
+ endif
+ endif
+
+ : # provide .jinfo file
+ ( \
+ echo 'name=$(jvm_name_short)'; \
+ echo 'alias=java-gcj$(pkg_ver)'; \
+ echo 'priority=$(priority)'; \
+ echo 'section=main'; \
+ echo ''; \
+ for i in $(jre_tools); do \
+ echo "jre $$i /$(jvm_dir)/jre/bin/$$i"; \
+ done; \
+ for i in $(jdk_tools); do \
+ echo "jdk $$i /$(jvm_dir)/bin/$$i"; \
+ done; \
+ ) > $(d_snap)/usr/lib/jvm/.java-gcj$(pkg_ver)-snap.jinfo
+endif
+
+ifeq ($(with_ada),yes FIXME: apply our ada patches)
+ dh_link -p$(p_snap) \
+ $(gcc_lib_dir)/rts-sjlj/adalib/libgnat.a \
+ $(gcc_lib_dir)/rts-sjlj/adalib/libgnat-$(GNAT_VERSION).a
+ dh_link -p$(p_snap) \
+ $(gcc_lib_dir)/rts-sjlj/adalib/libgnarl.a \
+ $(gcc_lib_dir)/rts-sjlj/adalib/libgnarl-$(GNAT_VERSION).a
+
+ set -e; \
+ for lib in lib{gnat,gnarl}; do \
+ vlib=$$lib-$(GNAT_SONAME); \
+ mv $(d_snap)/$(gcc_lib_dir)/adalib/$$vlib.so.1 $(d_snap)/$(PF)/$(libdir)/. ; \
+ rm -f $(d_snap)/$(gcc_lib_dir)/adalib/$$lib.so.1; \
+ dh_link -p$(p_snap) \
+ /$(PF)/$(libdir)/$$vlib.so.1 /$(PF)/$(libdir)/$$vlib.so \
+ /$(PF)/$(libdir)/$$vlib.so.1 /$(PF)/$(libdir)/$$lib.so \
+ /$(PF)/$(libdir)/$$vlib.so.1 /$(gcc_lib_dir)/rts-native/adalib/$$lib.so; \
+ done
+endif
+ifeq ($(with_ada),yes)
+ ln -sf gcc $(d_snap)/$(PF)/bin/gnatgcc
+endif
+
+ifeq ($(with_hppa64),yes)
+ : # provide as and ld links
+ dh_link -p $(p_snap) \
+ /usr/bin/hppa64-linux-gnu-as \
+ /$(PF)/libexec/gcc/hppa64-linux-gnu/$(GCC_VERSION)/as \
+ /usr/bin/hppa64-linux-gnu-ld \
+ /$(PF)/libexec/gcc/hppa64-linux-gnu/$(GCC_VERSION)/ld
+endif
+
+ifeq ($(with_check),yes)
+ dh_installdocs -p$(p_snap) test-summary
+# more than one libgo.sum, avoid it
+ mkdir -p $(d_snap)/$(docdir)/$(p_snap)/test-summaries
+ cp -p $$(find $(builddir)/gcc/testsuite -maxdepth 2 \( -name '*.sum' -o -name '*.log' \)) \
+ $$(find $(buildlibdir)/*/testsuite -maxdepth 1 \( -name '*.sum' -o -name '*.log' \) ! -name 'libgo.*') \
+ $(d_snap)/$(docdir)/$(p_snap)/test-summaries/
+ ifeq ($(with_go),yes)
+ cp -p $(buildlibdir)/libgo/libgo.sum \
+ $(d_snap)/$(docdir)/$(p_snap)/test-summaries/
+ endif
+ if which xz 2>&1 >/dev/null; then \
+ xz -7v $(d_snap)/$(docdir)/$(p_snap)/test-summaries/*; \
+ fi
+else
+ dh_installdocs -p$(p_snap)
+endif
+ if [ -f $(buildlibdir)/libstdc++-v3/testsuite/current_symbols.txt ]; \
+ then \
+ cp -p $(buildlibdir)/libstdc++-v3/testsuite/current_symbols.txt \
+ $(d_snap)/$(docdir)/$(p_snap)/libstdc++6_symbols.txt; \
+ fi
+ cp -p debian/README.snapshot \
+ $(d_snap)/$(docdir)/$(p_snap)/README.Debian
+ cp -p debian/README.Bugs \
+ $(d_snap)/$(docdir)/$(p_snap)/
+ dh_installchangelogs -p$(p_snap)
+ifeq ($(DEB_TARGET_ARCH),hppa)
+ dh_strip -p$(p_snap) -Xdebug -X.o -X.a
+else
+ dh_strip -p$(p_snap) -Xdebug
+endif
+ dh_compress -p$(p_snap) -X README.Bugs -X.log.xz -X.sum.xz
+ -find $(d_snap) -type d ! -perm 755 -exec chmod 755 {} \;
+ dh_fixperms -p$(p_snap)
+ifeq ($(with_ada),yes)
+ find $(d_snap)/$(gcc_lib_dir) -name '*.ali' | xargs -r chmod 444
+endif
+
+ mkdir -p $(d_snap)/usr/share/lintian/overrides
+ cp -p debian/gcc-snapshot.overrides \
+ $(d_snap)/usr/share/lintian/overrides/$(p_snap)
+
+ ( \
+ echo 'libgcc_s $(GCC_SONAME) ${p_snap} (>= $(DEB_VERSION))'; \
+ echo 'libobjc $(OBJC_SONAME) ${p_snap} (>= $(DEB_VERSION))'; \
+ echo 'libgfortran $(FORTRAN_SONAME) ${p_snap} (>= $(DEB_VERSION))'; \
+ echo 'libffi $(FFI_SONAME) ${p_snap} (>= $(DEB_VERSION))'; \
+ echo 'libgcj $(GCJ_SONAME) ${p_snap} (>= $(DEB_VERSION))'; \
+ echo 'libgcj-tools $(GCJ_SONAME) ${p_snap} (>= $(DEB_VERSION))'; \
+ echo 'libgij $(GCJ_SONAME) ${p_snap} (>= $(DEB_VERSION))'; \
+ echo 'libgcj_bc 1 ${p_snap} (>= $(DEB_VERSION))'; \
+ echo 'libgomp $(GOMP_SONAME) ${p_snap} (>= $(DEB_VERSION))'; \
+ echo 'libgnat-$(GNAT_SONAME) 1 ${p_snap} (>= $(DEB_VERSION))'; \
+ echo 'libgnarl-$(GNAT_SONAME) 1 ${p_snap} (>= $(DEB_VERSION))'; \
+ ) > debian/shlibs.local
+
+ $(ignshld)DIRNAME=$(subst n,,$(2)) $(cross_shlibdeps) \
+ dh_shlibdeps -p$(p_snap) -l$(CURDIR)/$(d_snap)/$(PF)/lib:$(CURDIR)/$(d_snap)/$(PF)/$(if $(filter $(DEB_TARGET_ARCH),amd64 ppc64),lib32,lib64):/usr/$(DEB_TARGET_GNU_TYPE)/lib -Xlibgcj-tools
+ -sed -i -e 's/$(p_snap)[^,]*, //g' debian/$(p_snap).substvars
+
+ifeq ($(with_multiarch_lib),yes)
+ : # paths needed for relative lookups from startfile_prefixes
+ for ma in $(xarch_multiarch_names); do \
+ mkdir -p $(d_snap)/lib/$$ma; \
+ mkdir -p $(d_snap)/usr/lib/$$ma; \
+ done
+endif
+
+ dh_gencontrol -p$(p_snap) -- $(common_substvars) \
+ '-Vsnap:depends=$(snapshot_depends)' '-Vsnap:recommends=$(snapshot_recommends)'
+ dh_installdeb -p$(p_snap)
+ dh_md5sums -p$(p_snap)
+ dh_builddeb -p$(p_snap)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_snap_stamp)-tmp $(install_snap_stamp)
diff --git a/debian/rules.d/binary-softfloat.mk b/debian/rules.d/binary-softfloat.mk
new file mode 100644
index 0000000..dc69b18
--- /dev/null
+++ b/debian/rules.d/binary-softfloat.mk
@@ -0,0 +1,36 @@
+arch_binaries := $(arch_binaries) softfloat
+
+p_softfloat = gcc$(pkg_ver)-soft-float
+d_softfloat = debian/$(p_softfloat)
+
+dirs_softfloat = \
+ $(PFL)/$(libdir) \
+ $(gcc_lib_dir)
+
+files_softfloat = \
+ $(PFL)/$(libdir)/soft-float \
+ $(gcc_lib_dir)/soft-float
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-softfloat: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_softfloat)
+ dh_installdirs -p$(p_softfloat) $(dirs_softfloat)
+ DH_COMPAT=2 dh_movefiles -p$(p_softfloat) $(files_softfloat)
+ rm -rf $(d_softfloat)/$(PFL)/$(libdir)/soft-float/libssp.so*
+ mv $(d_softfloat)/$(PFL)/$(libdir)/soft-float/libssp.a \
+ $(d_softfloat)/$(PFL)/$(libdir)/soft-float/libssp_nonshared.a
+ debian/dh_doclink -p$(p_softfloat) $(p_xbase)
+ dh_strip -p$(p_softfloat) -Xlibgcj.a
+ dh_compress -p$(p_softfloat)
+ dh_fixperms -p$(p_softfloat)
+ dh_shlibdeps -p$(p_softfloat)
+ dh_gencontrol -p$(p_softfloat) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_softfloat)
+ dh_md5sums -p$(p_softfloat)
+ dh_builddeb -p$(p_softfloat)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
diff --git a/debian/rules.d/binary-source.mk b/debian/rules.d/binary-source.mk
new file mode 100644
index 0000000..889fddf
--- /dev/null
+++ b/debian/rules.d/binary-source.mk
@@ -0,0 +1,56 @@
+indep_binaries := $(indep_binaries) gcc-source
+
+ifeq ($(BACKPORT),true)
+ p_source = gcc$(pkg_ver)-$(GCC_VERSION)-source
+else
+ p_source = gcc$(pkg_ver)-source
+endif
+d_source= debian/$(p_source)
+
+$(binary_stamp)-gcc-source:
+ dh_testdir
+ dh_testroot
+
+ dh_installdocs -p$(p_source)
+ dh_installchangelogs -p$(p_source)
+
+ dh_install -p$(p_source) $(gcc_tarball) usr/src/gcc$(pkg_ver)
+# dh_install -p$(p_source) $(gcj_tarball) usr/src/gcc$(pkg_ver)
+ifneq (,$(gdc_tarball))
+ dh_install -p$(p_source) $(gdc_tarball) usr/src/gcc$(pkg_ver)
+endif
+ tar cf - $$(find './debian' -mindepth 1 \( \
+ -name .svn -prune -o \
+ -path './debian/gcc-*' -type d -prune -o \
+ -path './debian/cpp-*' -type d -prune -o \
+ -path './debian/*fortran*' -type d -prune -o \
+ -path './debian/lib*' -type d -prune -o \
+ -path './debian/patches/*' -prune -o \
+ -path './debian/tmp*' -prune -o \
+ -path './debian/files' -prune -o \
+ -path './debian/rules.d/*' -prune -o \
+ -path './debian/soname-cache' -prune -o \
+ -path './debian/*substvars*' -prune -o \
+ -path './debian/gcc-snapshot*' -prune -o \
+ -path './debian/*[0-9]*.p*' -prune -o \
+ -path './debian/*$(pkg_ver)[.-]*' -prune -o \
+ -print \) ) \
+ | tar -x -C $(d_source)/usr/src/gcc$(pkg_ver) -f -
+ # FIXME: Remove generated files
+ find $(d_source)/usr/src/gcc$(pkg_ver) -name '*.debhelper.log' -o -name .svn | xargs rm -rf
+
+ dh_link -p$(p_source) \
+ /usr/src/gcc$(pkg_ver)/debian/patches /usr/src/gcc$(pkg_ver)/patches
+
+ mkdir -p $(d_source)/usr/share/lintian/overrides
+ cp -p debian/$(p_source).overrides \
+ $(d_source)/usr/share/lintian/overrides/$(p_source)
+
+ dh_fixperms -p$(p_source)
+ dh_compress -p$(p_source)
+ dh_gencontrol -p$(p_source) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_source)
+ dh_md5sums -p$(p_source)
+ dh_builddeb -p$(p_source)
+
+ touch $@