summaryrefslogtreecommitdiff
path: root/debian/rules.d
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2017-05-13 13:54:49 +0300
committerIgor Pashev <pashev.igor@gmail.com>2017-05-13 13:54:49 +0300
commit42156b5190f4fa150e1fab6777eb81e69d4db8c9 (patch)
tree3bf47de81cf1f89892789535a036d2d55d93a136 /debian/rules.d
downloadgcc-6-debian.tar.gz
Imported gcc-6 (6.3.0-17)debian/6.3.0-17debian
Diffstat (limited to 'debian/rules.d')
-rw-r--r--debian/rules.d/binary-ada.mk395
-rw-r--r--debian/rules.d/binary-base.mk75
-rw-r--r--debian/rules.d/binary-cpp.mk80
-rw-r--r--debian/rules.d/binary-cxx.mk79
-rw-r--r--debian/rules.d/binary-d.mk264
-rw-r--r--debian/rules.d/binary-fixincl.mk42
-rw-r--r--debian/rules.d/binary-fortran.mk267
-rw-r--r--debian/rules.d/binary-gcc.mk360
-rw-r--r--debian/rules.d/binary-go.mk329
-rw-r--r--debian/rules.d/binary-hppa64.mk32
-rw-r--r--debian/rules.d/binary-java.mk769
-rw-r--r--debian/rules.d/binary-libasan.mk76
-rw-r--r--debian/rules.d/binary-libatomic.mk68
-rw-r--r--debian/rules.d/binary-libcc1.mk31
-rw-r--r--debian/rules.d/binary-libcilkrts.mk76
-rw-r--r--debian/rules.d/binary-libgcc.mk382
-rw-r--r--debian/rules.d/binary-libgccjit.mk89
-rw-r--r--debian/rules.d/binary-libgomp.mk68
-rw-r--r--debian/rules.d/binary-libitm.mk68
-rw-r--r--debian/rules.d/binary-liblsan.mk76
-rw-r--r--debian/rules.d/binary-libmpx.mk74
-rw-r--r--debian/rules.d/binary-libobjc.mk159
-rw-r--r--debian/rules.d/binary-libquadmath.mk68
-rw-r--r--debian/rules.d/binary-libssp.mk155
-rw-r--r--debian/rules.d/binary-libstdcxx.mk527
-rw-r--r--debian/rules.d/binary-libtsan.mk78
-rw-r--r--debian/rules.d/binary-libubsan.mk76
-rw-r--r--debian/rules.d/binary-libvtv.mk76
-rw-r--r--debian/rules.d/binary-neon.mk47
-rw-r--r--debian/rules.d/binary-nof.mk51
-rw-r--r--debian/rules.d/binary-objc.mk67
-rw-r--r--debian/rules.d/binary-objcxx.mk60
-rw-r--r--debian/rules.d/binary-snapshot.mk234
-rw-r--r--debian/rules.d/binary-softfloat.mk31
-rw-r--r--debian/rules.d/binary-source.mk52
35 files changed, 5381 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..d8bb3ee
--- /dev/null
+++ b/debian/rules.d/binary-ada.mk
@@ -0,0 +1,395 @@
+ifeq ($(with_separate_gnat),yes)
+ $(lib_binaries) += gnatbase
+endif
+
+ifeq ($(with_libgnat),yes)
+ $(lib_binaries) += libgnat libgnatvsn libgnatprj
+endif
+
+arch_binaries := $(arch_binaries) ada
+ifneq ($(DEB_CROSS),yes)
+ ifneq ($(GFDL_INVARIANT_FREE),yes)
+ indep_binaries := $(indep_binaries) ada-doc
+ endif
+endif
+
+p_gbase = $(p_xbase)
+p_glbase = $(p_lbase)
+ifeq ($(with_separate_gnat),yes)
+ p_gbase = gnat$(pkg_ver)$(cross_bin_arch)-base
+ p_glbase = gnat$(pkg_ver)$(cross_bin_arch)-base
+endif
+
+p_gnat = gnat-$(GNAT_VERSION)$(cross_bin_arch)
+p_gnatsjlj= gnat-$(GNAT_VERSION)-sjlj$(cross_bin_arch)
+p_lgnat = libgnat-$(GNAT_VERSION)$(cross_lib_arch)
+p_lgnat_dbg = libgnat-$(GNAT_VERSION)-dbg$(cross_lib_arch)
+p_lgnatvsn = libgnatvsn$(GNAT_VERSION)$(cross_lib_arch)
+p_lgnatvsn_dev = libgnatvsn$(GNAT_VERSION)-dev$(cross_lib_arch)
+p_lgnatvsn_dbg = libgnatvsn$(GNAT_VERSION)-dbg$(cross_lib_arch)
+p_lgnatprj = libgnatprj$(GNAT_VERSION)$(cross_lib_arch)
+p_lgnatprj_dev = libgnatprj$(GNAT_VERSION)-dev$(cross_lib_arch)
+p_lgnatprj_dbg = libgnatprj$(GNAT_VERSION)-dbg$(cross_lib_arch)
+p_gnatd = $(p_gnat)-doc
+
+d_gbase = debian/$(p_gbase)
+d_gnat = debian/$(p_gnat)
+d_gnatsjlj = debian/$(p_gnatsjlj)
+d_lgnat = debian/$(p_lgnat)
+d_lgnatvsn = debian/$(p_lgnatvsn)
+d_lgnatvsn_dev = debian/$(p_lgnatvsn_dev)
+d_lgnatprj = debian/$(p_lgnatprj)
+d_lgnatprj_dev = debian/$(p_lgnatprj_dev)
+d_gnatd = debian/$(p_gnatd)
+
+GNAT_TOOLS = gnat gnatbind gnatchop gnatclean gnatfind gnatkr gnatlink \
+ gnatls gnatmake gnatname gnatprep gnatxref gnathtml
+
+ifeq ($(with_gnatsjlj),yes)
+ rts_subdir =
+endif
+
+dirs_gnat = \
+ $(docdir)/$(p_gbase) \
+ $(PF)/bin \
+ $(PF)/share/man/man1 \
+ $(gcc_lib_dir)/{adalib,adainclude} \
+ $(gcc_lexec_dir)
+
+files_gnat = \
+ $(gcc_lexec_dir)/gnat1 \
+ $(gcc_lib_dir)/adainclude/*.ad[bs] \
+ $(gcc_lib_dir)/adalib/*.ali \
+ $(gcc_lib_dir)/adalib/lib*.a \
+ $(foreach i,$(GNAT_TOOLS),$(PF)/bin/$(cmd_prefix)$(i)$(pkg_ver))
+
+dirs_lgnat = \
+ $(docdir) \
+ $(PF)/lib
+files_lgnat = \
+ $(usr_lib)/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)/$(rts_subdir)/adalib/$$vlib.so.1 $(d)/$(usr_lib)/. ; \
+ rm -f $(d)/$(gcc_lib_dir)/adalib/$$lib.so.1; \
+ done
+ $(dh_compat2) dh_movefiles -p$(p_lgnat) $(files_lgnat)
+
+ debian/dh_doclink -p$(p_lgnat) $(p_glbase)
+
+ debian/dh_rmemptydirs -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 $(ldconfig_arg) -p$(p_lgnat) -V '$(p_lgnat) (>= $(DEB_VERSION))'
+ $(call cross_mangle_shlibs,$(p_lgnat))
+
+ifneq (,$(filter $(build_type), build-native cross-build-native))
+ mkdir -p $(d_lgnat)/usr/share/lintian/overrides
+ cp -p debian/$(p_lgnat).overrides \
+ $(d_lgnat)/usr/share/lintian/overrides/$(p_lgnat)
+endif
+
+ dh_strip -p$(p_lgnat) --dbg-package=$(p_lgnat_dbg)
+ $(cross_shlibdeps) dh_shlibdeps -p$(p_lgnat) \
+ $(call shlibdirs_to_search, \
+ $(subst gnat-$(GNAT_SONAME),gcc$(GCC_SONAME),$(p_lgnat)) \
+ ,) \
+ $(if $(filter yes, $(with_common_libs)),,-- -Ldebian/shlibs.common$(2))
+ $(call cross_mangle_substvars,$(p_lgnat))
+
+ : # $(p_lgnat_dbg)
+ debian/dh_doclink -p$(p_lgnat_dbg) $(p_glbase)
+
+ echo $(p_lgnat) $(p_lgnat_dbg) >> debian/$(lib_binaries)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+
+$(binary_stamp)-libgnatvsn: $(install_stamp)
+ : # $(p_lgnatvsn_dev)
+ifneq (,$(filter $(build_type), build-native cross-build-native))
+ $(dh_compat2) dh_movefiles -p$(p_lgnatvsn_dev) usr/lib/ada/adalib/gnatvsn
+ $(dh_compat2) dh_movefiles -p$(p_lgnatvsn_dev) usr/share/ada/adainclude/gnatvsn
+ dh_install -p$(p_lgnatvsn_dev) \
+ debian/gnatvsn.gpr usr/share/ada/adainclude
+else
+ mkdir -p $(d_lgnatvsn_dev)/$(gcc_lib_dir)/{adalib,adainclude}/gnatvsn
+ mv $(d)/usr/lib/ada/adalib/gnatvsn $(d_lgnatvsn_dev)/$(gcc_lib_dir)/adalib/.
+ mv $(d)/usr/share/ada/adainclude/gnatvsn $(d_lgnatvsn_dev)/$(gcc_lib_dir)/adainclude/.
+ dh_install -p$(p_lgnatvsn_dev) \
+ debian/gnatvsn.gpr $(gcc_lib_dir)/adainclude
+endif
+ $(dh_compat2) dh_movefiles -p$(p_lgnatvsn_dev) $(usr_lib)/libgnatvsn.a
+ dh_link -p$(p_lgnatvsn_dev) \
+ $(usr_lib)/libgnatvsn.so.$(GNAT_VERSION) \
+ $(usr_lib)/libgnatvsn.so
+ debian/dh_doclink -p$(p_lgnatvsn_dev) $(p_glbase)
+ dh_strip -p$(p_lgnatvsn_dev) -X.a --keep-debug
+
+ : # $(p_lgnatvsn)
+ifneq (,$(filter $(build_type), build-native cross-build-native))
+ mkdir -p $(d_lgnatvsn)/usr/share/lintian/overrides
+ cp -p debian/$(p_lgnatvsn).overrides \
+ $(d_lgnatvsn)/usr/share/lintian/overrides/$(p_lgnatvsn)
+endif
+ $(dh_compat2) dh_movefiles -p$(p_lgnatvsn) $(usr_lib)/libgnatvsn.so.$(GNAT_VERSION)
+ debian/dh_doclink -p$(p_lgnatvsn) $(p_glbase)
+ dh_strip -p$(p_lgnatvsn) --dbg-package=$(p_lgnatvsn_dbg)
+ $(cross_makeshlibs) dh_makeshlibs $(ldconfig_arg) -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) \
+ $(call shlibdirs_to_search, \
+ $(subst gnatvsn$(GNAT_SONAME),gcc$(GCC_SONAME),$(p_lgnatvsn)) \
+ $(subst gnatvsn$(GNAT_SONAME),gnat-$(GNAT_SONAME),$(p_lgnatvsn)) \
+ ,) \
+ $(if $(filter yes, $(with_common_libs)),,-- -Ldebian/shlibs.common$(2))
+ $(call cross_mangle_substvars,$(p_lgnatvsn))
+
+ : # $(p_lgnatvsn_dbg)
+ debian/dh_doclink -p$(p_lgnatvsn_dbg) $(p_glbase)
+
+ echo $(p_lgnatvsn) $(p_lgnatvsn_dev) $(p_lgnatvsn_dbg) >> debian/$(lib_binaries)
+ touch $@
+
+$(binary_stamp)-libgnatprj: $(install_stamp)
+ : # $(p_lgnatprj_dev)
+ifneq (,$(filter $(build_type), build-native cross-build-native))
+ $(dh_compat2) dh_movefiles -p$(p_lgnatprj_dev) usr/lib/ada/adalib/gnatprj
+ $(dh_compat2) dh_movefiles -p$(p_lgnatprj_dev) usr/share/ada/adainclude/gnatprj
+ dh_install -p$(p_lgnatprj_dev) \
+ debian/gnatprj.gpr usr/share/ada/adainclude
+else
+ mkdir -p $(d_lgnatprj_dev)/$(gcc_lib_dir)/{adalib,adainclude}/gnatvsn
+ mv $(d)/usr/lib/ada/adalib/gnatprj $(d_lgnatprj_dev)/$(gcc_lib_dir)/adalib/.
+ mv $(d)/usr/share/ada/adainclude/gnatprj $(d_lgnatprj_dev)/$(gcc_lib_dir)/adainclude/.
+ dh_install -p$(p_lgnatprj_dev) \
+ debian/gnatprj.gpr $(gcc_lib_dir)/adainclude
+endif
+ $(dh_compat2) dh_movefiles -p$(p_lgnatprj_dev) $(usr_lib)/libgnatprj.a
+ dh_link -p$(p_lgnatprj_dev) \
+ $(usr_lib)/libgnatprj.so.$(GNAT_VERSION) \
+ $(usr_lib)/libgnatprj.so
+ dh_strip -p$(p_lgnatprj_dev) -X.a --keep-debug
+ debian/dh_doclink -p$(p_lgnatprj_dev) $(p_glbase)
+
+ : # $(p_lgnatprj)
+ifneq (,$(filter $(build_type), build-native cross-build-native))
+ mkdir -p $(d_lgnatprj)/usr/share/lintian/overrides
+ cp -p debian/$(p_lgnatprj).overrides \
+ $(d_lgnatprj)/usr/share/lintian/overrides/$(p_lgnatprj)
+endif
+ $(dh_compat2) dh_movefiles -p$(p_lgnatprj) $(usr_lib)/libgnatprj.so.$(GNAT_VERSION)
+ debian/dh_doclink -p$(p_lgnatprj) $(p_glbase)
+ dh_strip -p$(p_lgnatprj) --dbg-package=$(p_lgnatprj_dbg)
+ $(cross_makeshlibs) dh_makeshlibs $(ldconfig_arg) -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) \
+ $(call shlibdirs_to_search, \
+ $(subst gnatprj$(GNAT_SONAME),gcc$(GCC_SONAME),$(p_lgnatprj)) \
+ $(subst gnatprj$(GNAT_SONAME),gnat-$(GNAT_SONAME),$(p_lgnatprj)) \
+ $(subst gnatprj$(GNAT_SONAME),gnatvsn$(GNAT_SONAME),$(p_lgnatprj)) \
+ ,) \
+ $(if $(filter yes, $(with_common_libs)),,-- -Ldebian/shlibs.common$(2))
+ $(call cross_mangle_substvars,$(p_lgnatprj))
+
+ : # $(p_lgnatprj_dbg)
+ debian/dh_doclink -p$(p_lgnatprj_dbg) $(p_glbase)
+
+ echo $(p_lgnatprj) $(p_lgnatprj_dev) $(p_lgnatprj_dbg) >> debian/$(lib_binaries)
+ touch $@
+
+$(binary_stamp)-ada: $(install_stamp)
+ 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$(pkg_ver)
+ chmod 755 debian/tmp/$(PF)/bin/$(cmd_prefix)gnathtml$(pkg_ver)
+ $(dh_compat2) dh_movefiles -p$(p_gnat) $(files_gnat)
+
+ifeq ($(with_gnatsjlj),yes)
+ dh_installdirs -p$(p_gnatsjlj) $(gcc_lib_dir)
+ $(dh_compat2) dh_movefiles -p$(p_gnatsjlj) $(gcc_lib_dir)/rts-sjlj/adalib $(gcc_lib_dir)/rts-sjlj/adainclude
+endif
+
+ifeq ($(with_libgnat),yes)
+ for lib in lib{gnat,gnarl}; do \
+ vlib=$$lib-$(GNAT_SONAME); \
+ dh_link -p$(p_gnat) \
+ /$(usr_lib)/$$vlib.so.1 /$(usr_lib)/$$vlib.so \
+ /$(usr_lib)/$$vlib.so.1 /$(usr_lib)/$$lib.so; \
+ done
+ for lib in lib{gnat,gnarl}; do \
+ vlib=$$lib-$(GNAT_SONAME); \
+ dh_link -p$(p_gnat) \
+ /$(usr_lib)/$$vlib.so.1 $(gcc_lib_dir)/$(rts_subdir)adalib/$$lib.so; \
+ done
+endif
+ debian/dh_doclink -p$(p_gnat) $(p_gbase)
+ifeq ($(with_gnatsjlj),yes)
+ debian/dh_doclink -p$(p_gnatsjlj) $(p_gbase)
+endif
+ifeq ($(PKGSOURCE),gnat-$(BASE_VERSION))
+ ifeq ($(with_check),yes)
+ cp -p test-summary $(d_gnat)/$(docdir)/$(p_gbase)/.
+ endif
+else
+ mkdir -p $(d_gnat)/$(docdir)/$(p_gbase)/ada
+ cp -p src/gcc/ada/ChangeLog $(d_gnat)/$(docdir)/$(p_gbase)/ada/.
+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$(pkg_ver).1 ;; \
+ *) ln -sf $(cmd_prefix)gnat$(pkg_ver).1 $(d_gnat)/$(PF)/share/man/man1/$(cmd_prefix)$$i$(pkg_ver).1; \
+ esac; \
+ done
+
+ifneq (,$(filter $(build_type), build-native cross-build-native))
+ : # still ship the unversioned prefixed names in the gnat package.
+ for i in $(GNAT_TOOLS); do \
+ ln -sf $(cmd_prefix)$$i$(pkg_ver) \
+ $(d_gnat)/$(PF)/bin/$(cmd_prefix)$$i; \
+ ln -sf $(cmd_prefix)gnat$(pkg_ver).1.gz \
+ $(d_gnat)/$(PF)/share/man/man1/$(cmd_prefix)$$i.1.gz; \
+ done
+ ifeq ($(unprefixed_names),yes)
+ : # ship the versioned prefixed names in the gnat package.
+ for i in $(GNAT_TOOLS); do \
+ ln -sf $(cmd_prefix)$$i$(pkg_ver) \
+ $(d_gnat)/$(PF)/bin/$$i$(pkg_ver); \
+ ln -sf $(cmd_prefix)gnat$(pkg_ver).1.gz \
+ $(d_gnat)/$(PF)/share/man/man1/$$i$(pkg_ver).1.gz; \
+ done
+
+ : # still ship the unversioned names in the gnat package.
+ for i in $(GNAT_TOOLS); do \
+ ln -sf $$i$(pkg_ver) \
+ $(d_gnat)/$(PF)/bin/$$i; \
+ ln -sf gnat$(pkg_ver).1.gz \
+ $(d_gnat)/$(PF)/share/man/man1/$$i.1.gz; \
+ done
+
+ endif
+else
+ : # still ship the unversioned prefixed names in the gnat package.
+ for i in $(GNAT_TOOLS); do \
+ ln -sf $(cmd_prefix)$$i$(pkg_ver) \
+ $(d_gnat)/$(PF)/bin/$(cmd_prefix)$$i; \
+ ln -sf $(cmd_prefix)gnat$(pkg_ver).1.gz \
+ $(d_gnat)/$(PF)/share/man/man1/$(cmd_prefix)$$i.1.gz; \
+ done
+endif
+
+ifneq (,$(filter $(build_type), build-native cross-build-native))
+ dh_install -p$(p_gnat) debian/ada/debian_packaging.mk usr/share/ada
+ mv $(d_gnat)/usr/share/ada/debian_packaging.mk \
+ $(d_gnat)/usr/share/ada/debian_packaging-$(GNAT_VERSION).mk
+endif
+ : # keep this one unversioned, see Debian #802838.
+ dh_link -p$(p_gnat) \
+ usr/bin/$(cmd_prefix)gcc$(pkg_ver) usr/bin/$(cmd_prefix)gnatgcc
+ifneq ($(GFDL_INVARIANT_FREE),yes)
+ dh_link -p$(p_gnat) \
+ usr/share/man/man1/$(cmd_prefix)gcc$(pkg_ver).1.gz \
+ usr/share/man/man1/$(cmd_prefix)gnatgcc.1.gz
+endif
+ifeq ($(unprefixed_names),yes)
+ dh_link -p$(p_gnat) \
+ usr/bin/$(cmd_prefix)gcc$(pkg_ver) usr/bin/gnatgcc
+ ifneq ($(GFDL_INVARIANT_FREE),yes)
+ dh_link -p$(p_gnat) \
+ usr/share/man/man1/$(cmd_prefix)gcc$(pkg_ver).1.gz \
+ usr/share/man/man1/gnatgcc.1.gz
+ endif
+endif
+ debian/dh_rmemptydirs -p$(p_gnat)
+
+ dh_strip -p$(p_gnat)
+ find $(d_gnat) -name '*.ali' | xargs chmod 444
+ $(cross_shlibdeps) dh_shlibdeps -p$(p_gnat) \
+ $(call shlibdirs_to_search, \
+ $(p_lgcc) $(p_lgnat) $(p_lgnatvsn) $(p_lgnatprj) \
+ ,)
+ echo $(p_gnat) >> debian/arch_binaries
+
+ifeq ($(with_gnatsjlj),yes)
+ dh_strip -p$(p_gnatsjlj)
+ find $(d_gnatsjlj) -name '*.ali' | xargs chmod 444
+ $(cross_makeshlibs) dh_shlibdeps -p$(p_gnatsjlj)
+ echo $(p_gnatsjlj) >> debian/arch_binaries
+endif
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+
+$(build_gnatdoc_stamp): $(build_stamp)
+ mkdir -p html
+ rm -f html/*.info
+ echo -n gnat_ugn gnat_rm gnat-style | xargs -d ' ' -L 1 -P $(USE_CPUS) -I{} \
+ sh -c 'cd html && \
+ echo "generating {}-$(GNAT_VERSION).info"; \
+ makeinfo -I $(srcdir)/gcc/doc/include -I $(srcdir)/gcc/ada \
+ -I $(builddir)/gcc \
+ -o {}-$(GNAT_VERSION).info \
+ $(srcdir)/gcc/ada/{}.texi'
+ touch $@
+
+$(binary_stamp)-ada-doc: $(build_html_stamp) $(build_gnatdoc_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_gnatd)
+ dh_installdirs -p$(p_gnatd) \
+ $(PF)/share/info
+ cp -p html/gnat*info* $(d_gnatd)/$(PF)/share/info/.
+ dh_installdocs -p$(p_gnatd) \
+ html/gnat_ugn.html html/gnat_rm.html html/gnat-style.html
+ echo $(p_gnatd) >> debian/indep_binaries
+
+ 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..56f9273
--- /dev/null
+++ b/debian/rules.d/binary-base.mk
@@ -0,0 +1,75 @@
+arch_binaries += base
+ifeq ($(with_gcclbase),yes)
+ ifneq ($(with_base_only),yes)
+ indep_binaries += lbase
+ endif
+endif
+
+# ---------------------------------------------------------------------------
+# 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)
+
+ifneq ($(DEB_STAGE),rtlibs)
+ 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
+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)
+ifeq ($(DEB_STAGE)-$(DEB_CROSS),rtlibs-yes)
+ $(cross_gencontrol) dh_gencontrol -p$(p_base) -- -v$(DEB_VERSION) $(common_substvars)
+else
+ dh_gencontrol -p$(p_base) -- -v$(DEB_VERSION) $(common_substvars)
+endif
+ dh_installdeb -p$(p_base)
+ dh_md5sums -p$(p_base)
+ dh_builddeb -p$(p_base)
+ touch $@
+
+$(binary_stamp)-lbase: $(install_dependencies)
+ dh_testdir
+ dh_testroot
+ rm -rf $(d_lbase)
+ dh_installdocs -p$(p_lbase) debian/README.Debian
+ rm -f debian/$(p_lbase)/usr/share/doc/$(p_lbase)/README.Debian
+ dh_installchangelogs -p$(p_lbase)
+ dh_compress -p$(p_lbase)
+ dh_fixperms -p$(p_lbase)
+ dh_gencontrol -p$(p_lbase) -- -v$(DEB_VERSION) $(common_substvars)
+ dh_installdeb -p$(p_lbase)
+ dh_md5sums -p$(p_lbase)
+ dh_builddeb -p$(p_lbase)
+ touch $@
diff --git a/debian/rules.d/binary-cpp.mk b/debian/rules.d/binary-cpp.mk
new file mode 100644
index 0000000..b38e42b
--- /dev/null
+++ b/debian/rules.d/binary-cpp.mk
@@ -0,0 +1,80 @@
+ifneq ($(DEB_STAGE),rtlibs)
+ arch_binaries := $(arch_binaries) cpp
+ ifneq ($(DEB_CROSS),yes)
+ ifneq ($(GFDL_INVARIANT_FREE),yes)
+ indep_binaries := $(indep_binaries) cpp-doc
+ endif
+ 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_compat2) dh_movefiles -p$(p_cpp) $(files_cpp)
+
+ifeq ($(unprefixed_names),yes)
+ ln -sf $(cmd_prefix)cpp$(pkg_ver) \
+ $(d_cpp)/$(PF)/bin/cpp$(pkg_ver)
+ ifneq ($(GFDL_INVARIANT_FREE),yes)
+ ln -sf $(cmd_prefix)cpp$(pkg_ver).1 \
+ $(d_cpp)/$(PF)/share/man/man1/cpp$(pkg_ver).1
+ endif
+endif
+
+ifeq ($(GFDL_INVARIANT_FREE),yes)
+ mkdir -p $(d_cpp)/usr/share/lintian/overrides
+ echo '$(p_cpp) binary: binary-without-manpage' \
+ >> $(d_cpp)/usr/share/lintian/overrides/$(p_cpp)
+endif
+
+ debian/dh_doclink -p$(p_cpp) $(p_xbase)
+ debian/dh_rmemptydirs -p$(p_cpp)
+
+ dh_strip -p$(p_cpp) \
+ $(if $(unstripped_exe),-X/cc1)
+ dh_shlibdeps -p$(p_cpp)
+ echo $(p_cpp) >> debian/arch_binaries
+
+ 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_compat2) 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)
+ echo $(p_cppd) >> debian/indep_binaries
+
+ 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..17a43c0
--- /dev/null
+++ b/debian/rules.d/binary-cxx.mk
@@ -0,0 +1,79 @@
+ifneq ($(DEB_STAGE),rtlibs)
+ ifneq (,$(filter yes, $(biarch64) $(biarch32) $(biarchn32) $(biarchx32) $(biarchhf) $(biarchsf)))
+ arch_binaries := $(arch_binaries) cxx-multi
+ endif
+ arch_binaries := $(arch_binaries) cxx
+endif
+
+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_compat2) dh_movefiles -p$(p_cxx) $(files_cxx)
+
+ifeq ($(unprefixed_names),yes)
+ ln -sf $(cmd_prefix)g++$(pkg_ver) \
+ $(d_cxx)/$(PF)/bin/g++$(pkg_ver)
+ ifneq ($(GFDL_INVARIANT_FREE),yes)
+ ln -sf $(cmd_prefix)g++$(pkg_ver).1.gz \
+ $(d_cxx)/$(PF)/share/man/man1/g++$(pkg_ver).1.gz
+ endif
+endif
+
+ifeq ($(GFDL_INVARIANT_FREE),yes)
+ mkdir -p $(d_cxx)/usr/share/lintian/overrides
+ echo '$(p_cxx) binary: binary-without-manpage' \
+ >> $(d_cxx)/usr/share/lintian/overrides/$(p_cxx)
+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)
+
+ dh_shlibdeps -p$(p_cxx)
+ dh_strip -p$(p_cxx) $(if $(unstripped_exe),-X/cc1plus)
+ echo $(p_cxx) >> debian/arch_binaries
+
+ 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_shlibdeps -p$(p_cxx_m)
+ echo $(p_cxx_m) >> debian/arch_binaries
+
+ 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..434fcc6
--- /dev/null
+++ b/debian/rules.d/binary-d.mk
@@ -0,0 +1,264 @@
+ifneq ($(DEB_STAGE),rtlibs)
+ ifneq (,$(filter yes, $(biarch64) $(biarch32) $(biarchn32) $(biarchx32) $(biarchsf)))
+ arch_binaries := $(arch_binaries) gdc-multi
+ endif
+ arch_binaries := $(arch_binaries) gdc
+
+ ifeq ($(with_libphobos),yes)
+ $(lib_binaries) += libphobos-dev
+ $(lib_binaries) += libphobos
+ endif
+
+ ifeq ($(with_lib64phobosdev),yes)
+ $(lib_binaries) += lib64phobos-dev
+ endif
+ ifeq ($(with_lib32phobosdev),yes)
+ $(lib_binaries) += lib32phobos-dev
+ endif
+ ifeq ($(with_libn32phobosdev),yes)
+ $(lib_binaries) += libn32phobos-dev
+ endif
+ ifeq ($(with_libx32phobosdev),yes)
+ $(lib_binaries) += libx32phobos-dev
+ endif
+ ifeq ($(with_libhfphobosdev),yes)
+ $(lib_binaries) += libhfphobos-dev
+ endif
+ ifeq ($(with_libsfphobosdev),yes)
+ $(lib_binaries) += libsfphobos-dev
+ endif
+
+ ifeq ($(with_lib64phobos),yes)
+ $(lib_binaries) += lib64phobos
+ endif
+ ifeq ($(with_lib32phobos),yes)
+ $(lib_binaries) += lib32phobos
+ endif
+ ifeq ($(with_libn32phobos),yes)
+ $(lib_binaries) += libn32phobos
+ endif
+ ifeq ($(with_libx32phobos),yes)
+ $(lib_binaries) += libx32phobos
+ endif
+ ifeq ($(with_libhfphobos),yes)
+ $(lib_binaries) += libhfphobos
+ endif
+ ifeq ($(with_libsfphobos),yes)
+ $(lib_binaries) += libsfphobos
+ endif
+endif
+
+p_gdc = gdc$(pkg_ver)$(cross_bin_arch)
+p_gdc_m = gdc$(pkg_ver)-multilib$(cross_bin_arch)
+p_libphobos = libgphobos$(GPHOBOS_SONAME)
+p_libphobosdev = libgphobos$(pkg_ver)-dev
+
+d_gdc = debian/$(p_gdc)
+d_gdc_m = debian/$(p_gdc_m)
+d_libphobos = debian/$(p_libphobos)
+d_libphobosdev = debian/$(p_libphobosdev)
+
+ifeq ($(DEB_CROSS),yes)
+ gdc_include_dir := $(gcc_lib_dir)/include/d
+else
+ gdc_include_dir := $(PF)/include/d/$(BASE_VERSION)
+endif
+# FIXME: always here?
+gdc_include_dir := $(gcc_lib_dir)/include/d
+
+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)
+
+$(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_compat2) dh_movefiles -p$(p_gdc) -X/zlib/ $(files_gdc)
+
+ifeq ($(with_libphobos),yes)
+ mv $(d)/$(usr_lib)/libgphobos.spec $(d_gdc)/$(gcc_lib_dir)/
+endif
+
+ifeq ($(unprefixed_names),yes)
+ ln -sf $(cmd_prefix)gdc$(pkg_ver) \
+ $(d_gdc)/$(PF)/bin/gdc$(pkg_ver)
+ ifneq ($(GFDL_INVARIANT_FREE),yes-now-pure-gfdl)
+ ln -sf $(cmd_prefix)gdc$(pkg_ver).1 \
+ $(d_gdc)/$(PF)/share/man/man1/gdc$(pkg_ver).1
+ endif
+endif
+
+# FIXME: __entrypoint.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/__entrypoint.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) \
+ $(if $(unstripped_exe),-X/cc1d)
+ dh_shlibdeps -p$(p_gdc)
+ echo $(p_gdc) >> debian/arch_binaries
+
+ find $(d_gdc) -type d -empty -delete
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+$(binary_stamp)-gdc-multi: $(install_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_gdc_m)
+ dh_installdirs -p$(p_gdc_m) $(docdir)
+
+ debian/dh_doclink -p$(p_gdc_m) $(p_xbase)
+
+ dh_strip -p$(p_gdc_m)
+ dh_shlibdeps -p$(p_gdc_m)
+ echo $(p_gdc_m) >> debian/arch_binaries
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+define __do_libphobos
+ 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_compat2) dh_movefiles -p$(p_l) \
+ $(usr_lib$(2))/libgphobos.so.* \
+ $(usr_lib$(2))/libgdruntime.so.*
+
+ debian/dh_doclink -p$(p_l) $(p_lbase)
+ debian/dh_doclink -p$(p_d) $(p_lbase)
+
+ dh_strip -p$(p_l) --dbg-package=$(p_d)
+ ln -sf libgphobos.symbols debian/$(p_l).symbols
+ $(cross_makeshlibs) dh_makeshlibs $(ldconfig_arg) -p$(p_l) \
+ -- -a$(call mlib_to_arch,$(2)) || echo XXXXXXXXXXX ERROR $(p_l)
+ rm -f debian/$(p_l).symbols
+ $(call cross_mangle_shlibs,$(p_l))
+ $(ignshld)DIRNAME=$(subst n,,$(2)) $(cross_shlibdeps) dh_shlibdeps -p$(p_l) \
+ $(call shlibdirs_to_search, \
+ $(subst gphobos$(GPHOBOS_SONAME),gcc$(GCC_SONAME),$(p_l)) \
+ ,$(2)) \
+ $(if $(filter yes, $(with_common_libs)),,-- -Ldebian/shlibs.common$(2))
+ $(call cross_mangle_substvars,$(p_l))
+ dh_lintian -p$(p_l)
+ echo $(p_l) $(p_d) >> debian/$(lib_binaries)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+endef
+
+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))
+
+ $(call install_gcc_lib,libgdruntime,$(GDRUNTIME_SONAME),$(2),$(p_l))
+ $(call install_gcc_lib,libgphobos,$(GPHOBOS_SONAME),$(2),$(p_l))
+
+ $(if $(2),,
+ $(dh_compat2) dh_movefiles -p$(p_l) \
+ $(gdc_include_dir)
+ )
+
+ : # included in gdc package
+ rm -f $(d_l)/$(gdc_include_dir)/__entrypoint.di
+
+ debian/dh_doclink -p$(p_l) \
+ $(if $(filter yes,$(with_separate_gdc)),$(p_gdc),$(p_lbase))
+ echo $(p_l) >> debian/$(lib_binaries)
+
+ 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 = $(call __do_libphobos,lib$(1)gphobos$(GPHOBOS_SONAME),$(1))
+do_libphobos_dev = $(call __do_libphobos_dev,lib$(1)gphobos-$(BASE_VERSION)-dev,$(1))
+
+$(binary_stamp)-libphobos: $(install_stamp)
+ $(call do_libphobos,)
+
+$(binary_stamp)-lib64phobos: $(install_stamp)
+ $(call do_libphobos,64)
+
+$(binary_stamp)-lib32phobos: $(install_stamp)
+ $(call do_libphobos,32)
+
+$(binary_stamp)-libn32phobos: $(install_stamp)
+ $(call do_libphobos,n32)
+
+$(binary_stamp)-libx32phobos: $(install_stamp)
+ $(call do_libphobos,x32)
+
+$(binary_stamp)-libhfphobos: $(install_stamp)
+ $(call do_libphobos,hf)
+
+$(binary_stamp)-libsfphobos: $(install_stamp)
+ $(call do_libphobos,sf)
+
+
+$(binary_stamp)-libphobos-dev: $(install_stamp)
+ $(call do_libphobos_dev,)
+
+$(binary_stamp)-lib64phobos-dev: $(install_stamp)
+ $(call do_libphobos_dev,64)
+
+$(binary_stamp)-lib32phobos-dev: $(install_stamp)
+ $(call do_libphobos_dev,32)
+
+$(binary_stamp)-libx32phobos-dev: $(install_stamp)
+ $(call do_libphobos_dev,x32)
+
+$(binary_stamp)-libn32phobos-dev: $(install_stamp)
+ $(call do_libphobos_dev,n32)
+
+$(binary_stamp)-libhfphobos-dev: $(install_stamp)
+ $(call do_libphobos_dev,hf)
+
+$(binary_stamp)-libsfphobos-dev: $(install_stamp)
+ $(call do_libphobos_dev,sf)
diff --git a/debian/rules.d/binary-fixincl.mk b/debian/rules.d/binary-fixincl.mk
new file mode 100644
index 0000000..08ea877
--- /dev/null
+++ b/debian/rules.d/binary-fixincl.mk
@@ -0,0 +1,42 @@
+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_compat2) 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_shlibdeps -p$(p_fix)
+ echo $(p_fix) >> debian/arch_binaries.epoch
+
+ 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..4b603e4
--- /dev/null
+++ b/debian/rules.d/binary-fortran.mk
@@ -0,0 +1,267 @@
+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_compat2) dh_movefiles -p$(p_l) $(usr_lib$(2))/libgfortran.so.*
+
+ debian/dh_doclink -p$(p_l) $(p_lbase)
+ debian/dh_doclink -p$(p_d) $(p_lbase)
+
+ 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)
+ ln -sf libgfortran.symbols debian/$(p_l).symbols
+ $(cross_makeshlibs) dh_makeshlibs $(ldconfig_arg) -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)) \
+ $(if $(filter yes, $(with_common_libs)),,-- -Ldebian/shlibs.common$(2))
+ $(call cross_mangle_substvars,$(p_l))
+ echo $(p_l) $(p_d) >> debian/$(lib_binaries)
+
+ 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_compat2) dh_movefiles -p$(p_l) \
+ $(gcc_lib_dir$(2))/libcaf_single.a
+ $(call install_gcc_lib,libgfortran,$(FORTRAN_SONAME),$(2),$(p_l))
+
+ debian/dh_doclink -p$(p_l) $(p_lbase)
+ debian/dh_rmemptydirs -p$(p_l)
+
+ dh_strip -p$(p_l)
+ $(cross_shlibdeps) dh_shlibdeps -p$(p_l)
+ $(call cross_mangle_substvars,$(p_l))
+ echo $(p_l) >> debian/$(lib_binaries)
+
+ 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_compat2) dh_movefiles -p$(p_g95) $(files_g95)
+
+ mv $(d)/$(usr_lib)/libgfortran.spec $(d_g95)/$(gcc_lib_dir)/
+
+ifeq ($(unprefixed_names),yes)
+ ln -sf $(cmd_prefix)gfortran$(pkg_ver) \
+ $(d_g95)/$(PF)/bin/gfortran$(pkg_ver)
+ ifneq ($(GFDL_INVARIANT_FREE),yes)
+ ln -sf $(cmd_prefix)gfortran$(pkg_ver).1 \
+ $(d_g95)/$(PF)/share/man/man1/gfortran$(pkg_ver).1
+ endif
+endif
+
+ifeq ($(GFDL_INVARIANT_FREE),yes)
+ mkdir -p $(d_g95)/usr/share/lintian/overrides
+ echo '$(p_g95) binary: binary-without-manpage' \
+ >> $(d_g95)/usr/share/lintian/overrides/$(p_g95)
+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) \
+ $(if $(unstripped_exe),-X/f951)
+ dh_shlibdeps -p$(p_g95)
+ echo $(p_g95) >> debian/arch_binaries
+
+ 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_shlibdeps -p$(p_g95_m)
+ echo $(p_g95_m) >> debian/arch_binaries
+
+ 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_compat2) 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
+ echo $(p_g95d) >> debian/indep_binaries
+
+ 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..25ddbd8
--- /dev/null
+++ b/debian/rules.d/binary-gcc.mk
@@ -0,0 +1,360 @@
+ifneq ($(DEB_STAGE),rtlibs)
+ 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
+
+ ifeq ($(build_type),build-native)
+ arch_binaries := $(arch_binaries) testresults
+ 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,mpx} \
+ $(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,gcov-tool,gcov-dump}$(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 ($(with_libcc1_plugin),yes)
+ files_gcc += \
+ $(gcc_lib_dir)/plugin/libcc1plugin.so{,.0,.0.0.0}
+endif
+
+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 \
+ $(PF)/share/man/man1/$(cmd_prefix)gcov-{dump,tool}$(pkg_ver).1
+endif
+
+usr_doc_files = debian/README.Bugs \
+ $(shell test -f $(srcdir)/FAQ && echo $(srcdir)/FAQ)
+
+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)
+
+p_tst = gcc$(pkg_ver)-test-results
+d_tst = debian/$(p_tst)
+
+# ----------------------------------------------------------------------
+$(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)
+ mv $(d)/$(usr_lib)/libsanitizer*.spec $(d_gcc)/$(gcc_lib_dir)/
+ cp -p $(srcdir)/libsanitizer/ChangeLog \
+ $(d_gcc)/$(docdir)/$(p_xbase)/sanitizer/changelog
+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
+ifeq ($(with_mpx),yes)
+ mv $(d)/$(usr_lib)/libmpx.spec $(d_gcc)/$(gcc_lib_dir)/
+ cp -p $(srcdir)/libmpx/ChangeLog \
+ $(d_gcc)/$(docdir)/$(p_xbase)/mpx/changelog
+endif
+ifeq ($(with_cc1),yes)
+ rm -f $(d)/$(PF)/lib/$(DEB_HOST_MULTIARCH)/libcc1.so
+ dh_link -p$(p_gcc) \
+ /$(PF)/lib/$(DEB_HOST_MULTIARCH)/libcc1.so.$(CC1_SONAME) \
+ /$(gcc_lib_dir)/libcc1.so
+endif
+
+ $(dh_compat2) dh_movefiles -p$(p_gcc) $(files_gcc)
+
+ifeq ($(unprefixed_names),yes)
+ for i in gcc gcov gcov-dump gcov-tool gcc-ar gcc-nm gcc-ranlib; do \
+ ln -sf $(cmd_prefix)$$i$(pkg_ver) \
+ $(d_gcc)/$(PF)/bin/$$i$(pkg_ver); \
+ done
+ ifneq ($(GFDL_INVARIANT_FREE),yes)
+ for i in gcc gcov gcov-dump gcov-tool; do \
+ ln -sf $(cmd_prefix)$$i$(pkg_ver).1.gz \
+ $(d_gcc)/$(PF)/share/man/man1/$$i$(pkg_ver).1.gz; \
+ done
+ endif
+ for i in gcc-ar gcc-nm gcc-ranlib; do \
+ ln -sf $(cmd_prefix)$$i$(pkg_ver).1.gz \
+ $(d_gcc)/$(PF)/share/man/man1/$$i$(pkg_ver).1.gz; \
+ done
+endif
+
+# dh_installdebconf
+ debian/dh_doclink -p$(p_gcc) $(p_xbase)
+ cp -p $(usr_doc_files) $(d_gcc)/$(docdir)/$(p_xbase)/.
+ 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
+
+ifeq ($(GFDL_INVARIANT_FREE),yes)
+ mkdir -p $(d_gcc)/usr/share/lintian/overrides
+ echo '$(p_gcc) binary: binary-without-manpage' \
+ >> $(d_gcc)/usr/share/lintian/overrides/$(p_gcc)
+endif
+
+ debian/dh_rmemptydirs -p$(p_gcc)
+ dh_strip -p$(p_gcc) \
+ $(if $(unstripped_exe),-X/lto1)
+ dh_shlibdeps -p$(p_gcc)
+ echo $(p_gcc) >> debian/arch_binaries
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+# ----------------------------------------------------------------------
+
+$(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_shlibdeps -p$(p_gcc_m)
+ echo $(p_gcc_m) >> debian/arch_binaries
+
+ 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
+ $(dh_compat2) dh_movefiles -p$(p_pld) \
+ $(gcc_lib_dir)/plugin/include \
+ $(gcc_lib_dir)/plugin/gtype.state \
+ $(gcc_lexec_dir)/plugin/gengtype
+
+ debian/dh_doclink -p$(p_pld) $(p_xbase)
+ debian/dh_rmemptydirs -p$(p_pld)
+ dh_strip -p$(p_pld)
+ dh_shlibdeps -p$(p_pld)
+ echo $(p_pld) >> debian/arch_binaries
+
+ 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_compat2) 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)
+ echo $(p_loc) >> debian/indep_binaries
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+
+# ----------------------------------------------------------------------
+
+$(binary_stamp)-testresults: $(install_dependencies)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_tst)
+ dh_installdirs -p$(p_tst) $(docdir)
+
+ debian/dh_doclink -p$(p_tst) $(p_xbase)
+
+ mkdir -p $(d_tst)/$(docdir)/$(p_xbase)/test
+ echo "TEST COMPARE BEGIN"
+ifeq ($(with_check),yes)
+ for i in test-summary testsuite-comparision; do \
+ [ -f $$i ] || continue; \
+ cp -p $$i $(d_tst)/$(docdir)/$(p_xbase)/$$i; \
+ done
+# 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_tst)/$(docdir)/$(p_xbase)/test/
+ ifeq ($(with_go),yes)
+ cp -p $(buildlibdir)/libgo/libgo.sum \
+ $(d_tst)/$(docdir)/$(p_xbase)/test/
+ endif
+ ifeq (0,1)
+ cd $(builddir); \
+ for i in $(CURDIR)/$(d_tst)/$(docdir)/$(p_xbase)/test/*.sum; do \
+ b=$$(basename $$i); \
+ if [ -f /usr/share/doc/$(p_xbase)/test/$$b.gz ]; then \
+ zcat /usr/share/doc/$(p_xbase)/test/$$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 \
+ echo -n $(d_tst)/$(docdir)/$(p_xbase)/test/* \
+ | xargs -d ' ' -L 1 -P $(USE_CPUS) xz -7v; \
+ fi
+else
+ echo "Nothing to compare (testsuite not run)"
+ echo 'Test run disabled, reason: $(with_check)' \
+ > $(d_tst)/$(docdir)/$(p_xbase)/test-run-disabled
+endif
+ echo "TEST COMPARE END"
+
+ debian/dh_rmemptydirs -p$(p_tst)
+
+ echo $(p_tst) >> debian/arch_binaries
+
+ 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_compat2) 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/$(cmd_prefix)libgomp$(pkg_ver).info \
+ $(d_doc)/$(PF)/share/info/libgomp$(pkg_ver).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/$(cmd_prefix)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)
+ echo $(p_doc) >> debian/indep_binaries
+
+ 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..c7e9e1d
--- /dev/null
+++ b/debian/rules.d/binary-go.mk
@@ -0,0 +1,329 @@
+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
+
+ifneq ($(DEB_STAGE),rtlibs)
+ 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
+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 (,$(filter $(build_type), build-native cross-build-native))
+ files_go += \
+ $(PF)/bin/$(cmd_prefix){go,gofmt}$(pkg_ver) \
+ $(gcc_lexec_dir)/cgo \
+ $(PF)/share/man/man1/$(cmd_prefix){go,gofmt}$(pkg_ver).1
+endif
+
+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/$(cmd_prefix){cpp,gcc,gcov,gcov-tool}$(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)
+
+ ifeq ($(with_cc1),yes)
+ files_go += \
+ $(gcc_lib_dir)/plugin/libcc1plugin.so{,.0,.0.0.0}
+ endif
+
+ ifneq ($(GFDL_INVARIANT_FREE),yes)
+ files_go += \
+ $(PF)/share/man/man1/$(cmd_prefix){cpp,gcc,gcov,gcov-tool}$(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_compat2) dh_movefiles -p$(p_l) \
+ $(usr_lib$(2))/libgo.so.* $(usr_lib$(2))/go
+
+ debian/dh_doclink -p$(p_l) $(p_lbase)
+ debian/dh_doclink -p$(p_d) $(p_lbase)
+
+ mkdir -p debian/$(p_l)/usr/share/lintian/overrides
+ echo '$(p_l) binary: unstripped-binary-or-object' \
+ >> debian/$(p_l)/usr/share/lintian/overrides/$(p_l)
+
+ : # don't strip: https://gcc.gnu.org/ml/gcc-patches/2015-02/msg01722.html
+ : # dh_strip -p$(p_l) --dbg-package=$(p_d)
+ $(cross_makeshlibs) dh_makeshlibs $(ldconfig_arg) -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)) \
+ $(if $(filter yes, $(with_common_libs)),,-- -Ldebian/shlibs.common$(2))
+ $(call cross_mangle_substvars,$(p_l))
+ echo $(p_l) $(p_d) >> debian/$(lib_binaries)
+
+ 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))/
+ if [ -f $(d)/$(usr_lib$(3))/$(1)libbegin.a ]; then \
+ mv $(d)/$(usr_lib$(3))/$(1)libbegin.a debian/$(4)/$(gcc_lib_dir$(3))/; \
+ fi
+ 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_compat2) dh_movefiles -p$(2) \
+ $(gcc_lib_dir$(1))/{libgobegin,libnetgo}.a
+ $(if $(filter yes, $(with_standalone_go)), \
+ $(call install_gccgo_lib,libgomp,$(GOMP_SONAME),$(1),$(2)))
+ $(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,libnetgo}.a \
+ $(d)/$(gcc_lib_dir)/
+ if [ -f $(d)/$(usr_lib64)/libgobegin.a ]; then \
+ mv $(d)/$(usr_lib64)/{libgobegin,libnetgo}.a \
+ $(d)/$(gcc_lib_dir)/64/; \
+ fi
+ if [ -f $(d)/$(usr_lib32)/libgobegin.a ]; then \
+ mv $(d)/$(usr_lib32)/{libgobegin,libnetgo}.a \
+ $(d)/$(gcc_lib_dir)/32/; \
+ fi
+ if [ -f $(d)/$(usr_libn32)/libgobegin.a ]; then \
+ mv $(d)/$(usr_libn32)/{libgobegin,libnetgo}.a \
+ $(d)/$(gcc_lib_dir)/n32/; \
+ fi
+ if [ -f $(d)/$(usr_libx32)/libgobegin.a ]; then \
+ mv $(d)/$(usr_libx32)/{libgobegin,libnetgo}.a \
+ $(d)/$(gcc_lib_dir)/x32/; \
+ fi
+
+ $(call do_go_dev,,$(p_go))
+
+ $(dh_compat2) 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/openacc.h
+endif
+
+ifeq ($(unprefixed_names),yes)
+ ln -sf $(cmd_prefix)gccgo$(pkg_ver) \
+ $(d_go)/$(PF)/bin/gccgo$(pkg_ver)
+ ln -sf $(cmd_prefix)go$(pkg_ver) \
+ $(d_go)/$(PF)/bin/go$(pkg_ver)
+ ln -sf $(cmd_prefix)gofmt$(pkg_ver) \
+ $(d_go)/$(PF)/bin/gofmt$(pkg_ver)
+ ifneq ($(GFDL_INVARIANT_FREE),yes)
+ ln -sf $(cmd_prefix)gccgo$(pkg_ver).1 \
+ $(d_go)/$(PF)/share/man/man1/gccgo$(pkg_ver).1
+ endif
+ ln -sf $(cmd_prefix)go$(pkg_ver).1 \
+ $(d_go)/$(PF)/share/man/man1/go$(pkg_ver).1
+ ln -sf $(cmd_prefix)gofmt$(pkg_ver).1 \
+ $(d_go)/$(PF)/share/man/man1/gofmt$(pkg_ver).1
+endif
+
+ifeq ($(with_standalone_go),yes)
+ ifeq ($(unprefixed_names),yes)
+ for i in gcc gcov gcov-tool gcc-ar gcc-nm gcc-ranlib; do \
+ ln -sf $(cmd_prefix)$$i$(pkg_ver) \
+ $(d_go)/$(PF)/bin/$$i$(pkg_ver); \
+ done
+ ifneq ($(GFDL_INVARIANT_FREE),yes)
+ for i in gcc gcov gcov-tool gcc-ar gcc-nm gcc-ranlib; do \
+ ln -sf $(cmd_prefix)gcc$(pkg_ver).1 \
+ $(d_go)/$(PF)/share/man/man1/$$i$(pkg_ver).1; \
+ done
+ endif
+ endif
+ ifeq ($(with_gomp),yes)
+ mv $(d)/$(usr_lib)/libgomp*.spec $(d_go)/$(gcc_lib_dir)/
+ endif
+ ifeq ($(with_cc1),yes)
+ rm -f $(d)/$(usr_lib)/libcc1.so
+ dh_link -p$(p_go) \
+ /$(usr_lib)/libcc1.so.$(CC1_SONAME) /$(gcc_lib_dir)/libcc1.so
+ endif
+endif
+
+ifeq ($(GFDL_INVARIANT_FREE),yes)
+ mkdir -p $(d_go)/usr/share/lintian/overrides
+ echo '$(p_go) binary: binary-without-manpage' \
+ >> $(d_go)/usr/share/lintian/overrides/$(p_go)
+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 -v -p$(p_go) -X/cgo -X/go$(pkg_ver) -X/gofmt$(pkg_ver) \
+ $(if $(unstripped_exe),-X/go1)
+ dh_shlibdeps -p$(p_go)
+ echo $(p_go) >> debian/arch_binaries
+
+ 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_shlibdeps -p$(p_go_m)
+ echo $(p_go_m) >> debian/arch_binaries
+
+ 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_compat2) 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/
+ echo $(p_god) >> debian/indep_binaries
+
+ 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..2dc9b33
--- /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_shlibdeps -p$(p_hppa64)
+
+ mkdir -p $(d_hppa64)/usr/share/lintian/overrides
+ cp -p debian/$(p_hppa64).overrides \
+ $(d_hppa64)/usr/share/lintian/overrides/$(p_hppa64)
+
+ echo $(p_hppa64) >> debian/arch_binaries
+
+ touch $@
diff --git a/debian/rules.d/binary-java.mk b/debian/rules.d/binary-java.mk
new file mode 100644
index 0000000..cc77c5a
--- /dev/null
+++ b/debian/rules.d/binary-java.mk
@@ -0,0 +1,769 @@
+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
+
+ifneq (,$(filter $(build_type), build-native cross-build-native))
+ p_jbase = gcj$(pkg_ver)-base
+ ifeq ($(with_separate_libgcj)-$(with_standalone_gcj),no-no)
+ p_jbase = gcc$(pkg_ver)-base
+ endif
+else
+ p_jbase = gcj$(pkg_ver)$(cross_bin_arch)-base
+ ifeq ($(with_separate_libgcj)-$(with_standalone_gcj),no-no)
+ p_jbase = gcc$(pkg_ver)$(cross_bin_arch)-base
+ endif
+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)/{jc1,jvgenmain}
+
+# FIXME: this really should be included, or else the cross compiler
+# can only be used to build libjava itself.
+ifneq (,$(filter $(build_type), build-native cross-build-native))
+ files_gcj += \
+ $(PF)/$(libdir)/libgcj.spec
+endif
+
+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/$(cmd_prefix){gappletviewer,gjdoc,gc-analyze,gjar,gjarsigner,gcjh,gjavah,gnative2ascii,grmic,gserialver,jv-convert,jcf-dump}$(pkg_ver) \
+ $(PF)/share/man/man1/$(cmd_prefix){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 \
+ $(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/$(cmd_prefix){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/$(cmd_prefix){gij,gcj-dbtool,gorbd,grmid,grmiregistry,gkeytool,gtnameserv}$(pkg_ver) \
+ $(PF)/share/man/man1/$(cmd_prefix){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/$(cmd_prefix){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 = \
+ $(PF)/include/c++/$(BASE_VERSION)/{org,gcj,java,javax} \
+ $(PF)/include/c++/$(BASE_VERSION)/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/$(cmd_prefix){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/$(cmd_prefix){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)
+
+ $(dh_compat2) dh_movefiles -p$(p_gcj) $(files_gcj)
+ifneq (,$(filter $(build_type), build-native cross-build-native))
+ mv $(d_gcj)/$(PF)/$(libdir)/libgcj.spec $(d_gcj)/$(gcc_lib_dir)/
+endif
+
+ifeq ($(with_external_ecj1),yes)
+ dh_link -p$(p_gcj) \
+ /$(PF)/lib/$(DEB_HOST_MULTIARCH)/gcc/ecj1 /$(gcc_lexec_dir)/ecj1
+endif
+ifeq ($(unprefixed_names),yes)
+ ln -sf $(cmd_prefix)gcj$(pkg_ver) \
+ $(d_gcj)/$(PF)/bin/gcj$(pkg_ver)
+ ifneq ($(GFDL_INVARIANT_FREE),yes)
+ ln -sf $(cmd_prefix)gcj$(pkg_ver).1.gz \
+ $(d_gcj)/$(PF)/share/man/man1/gcj$(pkg_ver).1.gz
+ endif
+endif
+
+ifeq ($(GFDL_INVARIANT_FREE),yes)
+ mkdir -p $(d_gcj)/usr/share/lintian/overrides
+ echo '$(p_gcj) binary: binary-without-manpage' \
+ >> $(d_gcj)/usr/share/lintian/overrides/$(p_gcj)
+endif
+
+ debian/dh_doclink -p$(p_gcj) $(p_jbase)
+ debian/dh_rmemptydirs -p$(p_gcj)
+
+ dh_strip -p$(p_gcj) \
+ $(if $(unstripped_exe),-X/jc1)
+ dh_shlibdeps -p$(p_gcj) -Xecj1
+ echo $(p_gcj) >> debian/arch_binaries
+
+ 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_compat2) 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)
+ echo $(p_jar) >> debian/indep_binaries
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+
+# ----------------------------------------------------------------------
+$(build_javasrc_stamp): $(build_stamp)
+ PATH=$(CURDIR)/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)
+ echo $(p_jsrc) >> debian/indep_binaries
+
+ 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
+ echo $(p_jdoc) >> debian/indep_binaries
+
+ 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_compat2) dh_movefiles -p$(p_jrehl) $(files_jrehl)
+ $(dh_compat2) dh_movefiles -p$(p_jlib) $(files_jlib)
+ $(dh_compat2) dh_movefiles -p$(p_jlibx) $(files_jlibx)
+#ifneq (,$(findstring gtk, $(java_awt_peers)))
+# $(dh_compat2) dh_movefiles -p$(p_jgtk) $(files_jgtk)
+#endif
+#ifneq (,$(findstring qt, $(java_awt_peers)))
+# $(dh_compat2) dh_movefiles -p$(p_jqt) $(files_jqt)
+#endif
+
+ifeq ($(unprefixed_names),yes)
+ for i in gij gcj-dbtool gorbd grmid grmiregistry gkeytool gtnameserv; do \
+ ln -sf $(cmd_prefix)$$i$(pkg_ver) \
+ $(d_jrehl)/$(PF)/bin/$$i$(pkg_ver); \
+ done
+ for i in gorbd grmid grmiregistry gkeytool gtnameserv; do \
+ ln -sf $(cmd_prefix)$$i$(pkg_ver).1.gz \
+ $(d_jrehl)/$(PF)/share/man/man1/$$i$(pkg_ver).1.gz; \
+ done
+ ifneq ($(GFDL_INVARIANT_FREE),yes)
+ for i in gij gcj-dbtool; do \
+ ln -sf $(cmd_prefix)$$i$(pkg_ver).1.gz \
+ $(d_jrehl)/$(PF)/share/man/man1/$$i$(pkg_ver).1.gz; \
+ done
+ endif
+endif
+
+ dh_link -p$(p_jrehl) \
+ $(jvm_dir) $(PF)/lib/jvm/java-gcj$(pkg_ver) \
+ $(PF)/bin/$(cmd_prefix)gij$(pkg_ver) $(jvm_dir)/bin/gij \
+ $(PF)/bin/$(cmd_prefix)gij$(pkg_ver) $(jvm_dir)/jre/bin/gij \
+ $(PF)/bin/$(cmd_prefix)gcj-dbtool$(pkg_ver) $(jvm_dir)/bin/gcj-dbtool \
+ $(PF)/bin/$(cmd_prefix)gcj-dbtool$(pkg_ver) $(jvm_dir)/jre/bin/gcj-dbtool \
+ $(PF)/share/man/man1/$(cmd_prefix)gkeytool$(pkg_ver).1 $(jvm_dir)/man/man1/keytool.1 \
+ $(PF)/share/man/man1/$(cmd_prefix)gorbd$(pkg_ver).1 $(jvm_dir)/man/man1/orbd.1 \
+ $(PF)/share/man/man1/$(cmd_prefix)grmid$(pkg_ver).1 $(jvm_dir)/man/man1/rmid.1 \
+ $(PF)/share/man/man1/$(cmd_prefix)grmiregistry$(pkg_ver).1 $(jvm_dir)/man/man1/rmiregistry.1 \
+ $(PF)/share/man/man1/$(cmd_prefix)gtnameserv$(pkg_ver).1 $(jvm_dir)/man/man1/tnameserv.1 \
+
+ifneq ($(GFDL_INVARIANT_FREE),yes)
+ dh_link -p$(p_jrehl) \
+ $(PF)/share/man/man1/$(cmd_prefix)gij$(pkg_ver).1 $(jvm_dir)/man/man1/java.1 \
+ $(PF)/share/man/man1/$(cmd_prefix)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/$(cmd_prefix)gij$(pkg_ver) \
+ $(d_jrehl)/$(PF)/bin/$(cmd_prefix)gij$(pkg_ver).bin
+ install -m755 debian/gij-hppa $(d_jrehl)/$(PF)/bin/$(cmd_prefix)gij$(pkg_ver)
+ ifeq ($(unprefixed_names),yes)
+ ln -sf $(cmd_prefix)gij$(pkg_ver) \
+ $(d_jrehl)/$(PF)/bin/gij$(pkg_ver)
+ ln -sf $(cmd_prefix)gij$(pkg_ver).bin \
+ $(d_jrehl)/$(PF)/bin/gij$(pkg_ver).bin
+ endif
+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 $(ldconfig_arg) -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 $(ldconfig_arg) -p$(p_jlibx) -V '$(p_jlibx) (>= $(DEB_GCJ_SOVERSION))'
+
+#ifneq (,$(findstring gtk, $(java_awt_peers)))
+# dh_makeshlibs $(ldconfig_arg) -p$(p_jgtk) -V '$(p_jgtk) (>= $(DEB_GCJ_SOVERSION))'
+#endif
+#ifneq (,$(findstring qt, $(java_awt_peers)))
+# dh_makeshlibs $(ldconfig_arg) -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)
+
+# 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
+
+ echo $(p_jrehl) $(p_jlib) $(p_jlibx) $(subst -p,,$(peer_pkgs)) >> debian/arch_binaries
+
+ 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_compat2) 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
+
+ install -m 755 $(d)/$(PF)/$(libdir)/libgcj_bc.so.1 \
+ $(d_jdk)/$(gcc_lib_dir)/libgcj_bc.so
+ $(CC_FOR_TARGET) $(LDFLAGS_FOR_TARGET) -shared -fpic -xc /dev/null \
+ -o build/libgcj.so -Wl,-soname,libgcj.so.$(GCJ_SONAME) -nostdlib
+ $(CC_FOR_TARGET) $(LDFLAGS_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
+
+ifeq ($(unprefixed_names),yes)
+ for i in gappletviewer gjdoc gc-analyze gjar gjarsigner gcjh gjavah gnative2ascii grmic gserialver jv-convert jcf-dump; do \
+ ln -sf $(cmd_prefix)$$i$(pkg_ver) \
+ $(d_jdk)/$(PF)/bin/$$i$(pkg_ver); \
+ done
+ for i in gappletviewer gjdoc gjar gjarsigner gcjh gjavah gnative2ascii gserialver; do \
+ ln -sf $(cmd_prefix)$$i$(pkg_ver).1.gz \
+ $(d_jdk)/$(PF)/share/man/man1/$$i$(pkg_ver).1.gz; \
+ done
+ ifneq ($(GFDL_INVARIANT_FREE),yes)
+ for i in gc-analyze gnative2ascii grmic jv-convert jcf-dump; do \
+ ln -sf $(cmd_prefix)$$i$(pkg_ver).1.gz \
+ $(d_jdk)/$(PF)/share/man/man1/$$i$(pkg_ver).1.gz; \
+ done
+ endif
+endif
+
+ dh_link -p$(p_jdk) \
+ $(PF)/bin/$(cmd_prefix)gcj$(pkg_ver) $(jvm_dir)/bin/gcj \
+ $(PF)/share/man/man1/$(cmd_prefix)gjarsigner$(pkg_ver).1 $(jvm_dir)/man/man1/jarsigner.1 \
+ $(PF)/share/man/man1/$(cmd_prefix)gjdoc$(pkg_ver).1 $(jvm_dir)/man/man1/javadoc.1 \
+ $(PF)/share/man/man1/$(cmd_prefix)gjavah$(pkg_ver).1 $(jvm_dir)/man/man1/javah.1 \
+ $(PF)/share/man/man1/$(cmd_prefix)gserialver$(pkg_ver).1 $(jvm_dir)/man/man1/serialver.1 \
+ $(PF)/share/man/man1/$(cmd_prefix)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/$(cmd_prefix)gcj-wrapper$(pkg_ver)
+ chmod 755 $(d_jdk)/$(PF)/bin/$(cmd_prefix)gcj-wrapper$(pkg_ver)
+ cp -p debian/gcj-wrapper$(pkg_ver).1 \
+ $(d_jdk)/$(PF)/share/man/man1/$(cmd_prefix)gcj-wrapper$(pkg_ver).1
+ifeq ($(unprefixed_names),yes)
+ ln -sf $(cmd_prefix)gcj-wrapper$(pkg_ver) \
+ $(d_jdk)/$(PF)/bin/gcj-wrapper$(pkg_ver)
+ ln -sf $(cmd_prefix)gcj-wrapper$(pkg_ver).1.gz \
+ $(d_jdk)/$(PF)/share/man/man1/gcj-wrapper$(pkg_ver).1.gz
+endif
+
+ debian/dh_rmemptydirs -p$(p_jdk)
+
+ dh_strip -p$(p_jdk)
+ dh_shlibdeps -p$(p_jdk) -l$(d_lib)/$(PF)/$(libdir):$(d_jlib)/$(PF)/lib -Xecj1
+ echo $(p_jdk) >> debian/arch_binaries
+
+ 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_compat2) 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)
+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
+ echo $(p_jdev) >> debian/arch_binaries
+
+ 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
+ echo $(p_jdbg) >> debian/arch_binaries
+
+ 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_compat2) 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)
+ echo $(p_jre) >> debian/arch_binaries
+
+ 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..19d2db9
--- /dev/null
+++ b/debian/rules.d/binary-libasan.mk
@@ -0,0 +1,76 @@
+$(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))
+ $(dh_compat2) dh_movefiles -p$(p_l) $(usr_lib$(2))/libasan.so.*
+
+ debian/dh_doclink -p$(p_l) $(p_lbase)
+ debian/dh_doclink -p$(p_d) $(p_lbase)
+
+ 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)
+ $(cross_makeshlibs) dh_makeshlibs $(ldconfig_arg) -p$(p_l) || echo XXXXXXXXXXXXXX ERROR $(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)) \
+ $(if $(filter yes, $(with_common_libs)),,-- -Ldebian/shlibs.common$(2))
+ $(call cross_mangle_substvars,$(p_l))
+ echo $(p_l) $(p_d) >> debian/$(lib_binaries)
+
+ 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..fe038e8
--- /dev/null
+++ b/debian/rules.d/binary-libatomic.mk
@@ -0,0 +1,68 @@
+$(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_compat2) dh_movefiles -p$(p_l) $(usr_lib$(2))/libatomic.so.*
+
+ debian/dh_doclink -p$(p_l) $(p_lbase)
+ debian/dh_doclink -p$(p_d) $(p_lbase)
+
+ dh_strip -p$(p_l) --dbg-package=$(p_d)
+ ln -sf libatomic.symbols debian/$(p_l).symbols
+ $(cross_makeshlibs) dh_makeshlibs $(ldconfig_arg) -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))
+ echo $(p_l) $(p_d) >> debian/$(lib_binaries)
+
+ 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-libcc1.mk b/debian/rules.d/binary-libcc1.mk
new file mode 100644
index 0000000..1dba145
--- /dev/null
+++ b/debian/rules.d/binary-libcc1.mk
@@ -0,0 +1,31 @@
+ifeq ($(with_libcc1),yes)
+ ifneq ($(DEB_CROSS),yes)
+ arch_binaries := $(arch_binaries) libcc1
+ endif
+endif
+
+p_cc1 = libcc1-$(CC1_SONAME)
+d_cc1 = debian/$(p_cc1)
+
+# ----------------------------------------------------------------------
+$(binary_stamp)-libcc1: $(install_dependencies)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_cc1)
+ dh_installdirs -p$(p_cc1) \
+ $(docdir) \
+ $(usr_lib)
+ $(dh_compat2) dh_movefiles -p$(p_cc1) \
+ $(usr_lib)/libcc1.so.*
+
+ debian/dh_doclink -p$(p_cc1) $(p_xbase)
+ debian/dh_rmemptydirs -p$(p_cc1)
+
+ dh_strip -p$(p_cc1)
+ dh_makeshlibs -p$(p_cc1)
+ dh_shlibdeps -p$(p_cc1)
+ echo $(p_cc1) >> debian/arch_binaries
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
diff --git a/debian/rules.d/binary-libcilkrts.mk b/debian/rules.d/binary-libcilkrts.mk
new file mode 100644
index 0000000..806acbf
--- /dev/null
+++ b/debian/rules.d/binary-libcilkrts.mk
@@ -0,0 +1,76 @@
+$(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_compat2) dh_movefiles -p$(p_l) $(usr_lib$(2))/libcilkrts.so.*
+
+ debian/dh_doclink -p$(p_l) $(p_lbase)
+ debian/dh_doclink -p$(p_d) $(p_lbase)
+
+ 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)
+ ln -sf libcilkrts.symbols debian/$(p_l).symbols
+ $(cross_makeshlibs) dh_makeshlibs $(ldconfig_arg) -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))
+ echo $(p_l) $(p_d) >> debian/$(lib_binaries)
+
+ 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..4b2ef1f
--- /dev/null
+++ b/debian/rules.d/binary-libgcc.mk
@@ -0,0 +1,382 @@
+ifeq ($(with_libgcc),yes)
+ $(lib_binaries) += libgcc
+endif
+ifeq ($(with_lib64gcc),yes)
+ $(lib_binaries) += lib64gcc
+endif
+ifeq ($(with_lib32gcc),yes)
+ $(lib_binaries) += lib32gcc
+endif
+ifeq ($(with_libn32gcc),yes)
+ $(lib_binaries) += libn32gcc
+endif
+ifeq ($(with_libx32gcc),yes)
+ $(lib_binaries) += libx32gcc
+endif
+ifeq ($(with_libhfgcc),yes)
+ $(lib_binaries) += libhfgcc
+endif
+ifeq ($(with_libsfgcc),yes)
+ $(lib_binaries) += libsfgcc
+endif
+
+ifneq ($(DEB_STAGE),rtlibs)
+ ifeq ($(with_cdev),yes)
+ $(lib_binaries) += libgcc-dev
+ endif
+ ifeq ($(with_lib64gccdev),yes)
+ $(lib_binaries) += lib64gcc-dev
+ endif
+ ifeq ($(with_lib32gccdev),yes)
+ $(lib_binaries) += lib32gcc-dev
+ endif
+ ifeq ($(with_libn32gccdev),yes)
+ $(lib_binaries) += libn32gcc-dev
+ endif
+ ifeq ($(with_libx32gccdev),yes)
+ $(lib_binaries) += libx32gcc-dev
+ endif
+ ifeq ($(with_libhfgccdev),yes)
+ $(lib_binaries) += libhfgcc-dev
+ endif
+ ifeq ($(with_libsfgccdev),yes)
+ $(lib_binaries) += libsfgcc-dev
+ endif
+endif
+
+header_files = \
+ $(gcc_lib_dir)/include/std*.h \
+ $(shell for h in \
+ README features.h arm_fp16.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,mwaitx,pku,sha,vec}intrin.h \
+ avx512{bw,er,cd,dq,f,ifma,ifmavl,pf,vlbw,vbmi,vldq,vbmivl,vl}intrin.h \
+ {clflushopt,clwb,clzero,pcommit,xsavec,xsaves}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,openacc}.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
+
+ifeq ($(DEB_TARGET_ARCH),tilegx)
+ header_files += $(gcc_lib_dir)/include/feedback.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_lbase)
+ debian/dh_rmemptydirs -p$(2)
+
+ dh_strip -p$(2)
+ $(cross_shlibdeps) dh_shlibdeps -p$(2)
+ $(call cross_mangle_substvars,$(2))
+ echo $(2) >> debian/$(lib_binaries)
+
+ 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_compat2) 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 $(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_mpx)),
+ $(if $(filter x32, $(1)),,
+ $(call install_gcc_lib,libmpxwrappers,$(MPX_SONAME),$(1),$(2))
+ $(call install_gcc_lib,libmpx,$(MPX_SONAME),$(1),$(2))
+ )
+ )
+ $(if $(filter yes, $(with_qmath)),
+ $(call install_gcc_lib,libquadmath,$(QUADMATH_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_lbase))
+ debian/dh_doclink -p$(p_d) $(if $(3),$(3),$(p_lbase))
+ 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)),
+ $(if $(findstring gcc1,$(p_l)), \
+ ln -sf libgcc.symbols debian/$(p_l).symbols \
+ )
+ $(cross_makeshlibs) dh_makeshlibs $(ldconfig_arg) -p$(p_l) -p$(p_d) \
+ -- -v$(DEB_LIBGCC_VERSION) -a$(call mlib_to_arch,$(2)) || echo XXXXXXXXXXXXXX ERROR $(p_l)
+ $(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/libgcc.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)
+ )
+
+ echo $(p_l) $(p_d) >> debian/$(lib_binaries).epoch
+
+ 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-libgccjit.mk b/debian/rules.d/binary-libgccjit.mk
new file mode 100644
index 0000000..c5839e7
--- /dev/null
+++ b/debian/rules.d/binary-libgccjit.mk
@@ -0,0 +1,89 @@
+ifeq ($(with_libgccjit),yes)
+ $(lib_binaries) += libgccjit
+endif
+
+$(lib_binaries) += libgccjitdev
+
+ifneq ($(DEB_CROSS),yes)
+ indep_binaries := $(indep_binaries) libgccjitdoc
+endif
+
+p_jitlib = libgccjit$(GCCJIT_SONAME)
+p_jitdbg = libgccjit$(GCCJIT_SONAME)-dbg
+p_jitdev = libgccjit$(pkg_ver)-dev
+p_jitdoc = libgccjit$(pkg_ver)-doc
+
+d_jitlib = debian/$(p_jitlib)
+d_jitdev = debian/$(p_jitdev)
+d_jitdbg = debian/$(p_jitdbg)
+d_jitdoc = debian/$(p_jitdoc)
+
+$(binary_stamp)-libgccjit: $(install_jit_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_jitlib) $(d_jitdbg)
+ dh_installdirs -p$(p_jitlib) \
+ $(usr_lib)
+ dh_installdirs -p$(p_jitdbg)
+
+ $(dh_compat2) dh_movefiles -p$(p_jitlib) \
+ $(usr_lib)/libgccjit.so.*
+ rm -f $(d)/$(usr_lib)/libgccjit.so
+
+ debian/dh_doclink -p$(p_jitlib) $(p_base)
+ debian/dh_doclink -p$(p_jitdbg) $(p_base)
+
+ dh_strip -p$(p_jitlib) --dbg-package=$(p_jitdbg)
+ $(cross_makeshlibs) dh_makeshlibs -p$(p_jitlib)
+ $(call cross_mangle_shlibs,$(p_jitlib))
+ $(ignshld)$(cross_shlibdeps) dh_shlibdeps -p$(p_jitlib) \
+ $(if $(filter yes, $(with_common_libs)),,-- -Ldebian/shlibs.common$(2))
+ $(call cross_mangle_substvars,$(p_jitlib))
+ echo $(p_jitlib) $(p_jitdbg) >> debian/arch_binaries
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+ touch $@
+
+$(binary_stamp)-libgccjitdev: $(install_jit_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_jitdev)
+ dh_installdirs -p$(p_jitdev) \
+ $(usr_lib) \
+ $(gcc_lib_dir)/include
+
+ rm -f $(d)/$(usr_lib)/libgccjit.so
+
+ $(dh_compat2) dh_movefiles -p$(p_jitdev) \
+ $(gcc_lib_dir)/include/libgccjit*.h
+ dh_link -p$(p_jitdev) \
+ $(usr_lib)/libgccjit.so.$(GCCJIT_SONAME) $(gcc_lib_dir)/libgccjit.so
+
+ debian/dh_doclink -p$(p_jitdev) $(p_base)
+
+ echo $(p_jitdev) >> debian/arch_binaries
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+ touch $@
+
+$(binary_stamp)-libgccjitdoc: $(install_jit_stamp)
+ dh_testdir
+ dh_testroot
+ mv $(install_stamp) $(install_stamp)-tmp
+
+ rm -rf $(d_jitdoc)
+ dh_installdirs -p$(p_jitdoc) \
+ $(PF)/share/info
+
+ $(dh_compat2) dh_movefiles -p$(p_jitdoc) \
+ $(PF)/share/info/libgccjit*
+
+ debian/dh_doclink -p$(p_jitdoc) $(p_base)
+ echo $(p_jitdoc) >> debian/indep_binaries
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+ touch $@
diff --git a/debian/rules.d/binary-libgomp.mk b/debian/rules.d/binary-libgomp.mk
new file mode 100644
index 0000000..5e2f4b3
--- /dev/null
+++ b/debian/rules.d/binary-libgomp.mk
@@ -0,0 +1,68 @@
+$(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_compat2) dh_movefiles -p$(p_l) $(usr_lib$(2))/libgomp.so.*
+
+ debian/dh_doclink -p$(p_l) $(p_lbase)
+ debian/dh_doclink -p$(p_d) $(p_lbase)
+
+ dh_strip -p$(p_l) --dbg-package=$(p_d)
+ ln -sf libgomp.symbols debian/$(p_l).symbols
+ $(cross_makeshlibs) dh_makeshlibs $(ldconfig_arg) -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))
+ echo $(p_l) $(p_d) >> debian/$(lib_binaries)
+
+ 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..cc69cc6
--- /dev/null
+++ b/debian/rules.d/binary-libitm.mk
@@ -0,0 +1,68 @@
+$(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_compat2) dh_movefiles -p$(p_l) $(usr_lib$(2))/libitm.so.*
+
+ debian/dh_doclink -p$(p_l) $(p_lbase)
+ debian/dh_doclink -p$(p_d) $(p_lbase)
+
+ dh_strip -p$(p_l) --dbg-package=$(p_d)
+ ln -sf libitm.symbols debian/$(p_l).symbols
+ $(cross_makeshlibs) dh_makeshlibs $(ldconfig_arg) -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))
+ echo $(p_l) $(p_d) >> debian/$(lib_binaries)
+
+ 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..ce710dd
--- /dev/null
+++ b/debian/rules.d/binary-liblsan.mk
@@ -0,0 +1,76 @@
+$(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_compat2) dh_movefiles -p$(p_l) $(usr_lib$(2))/liblsan.so.*
+
+ debian/dh_doclink -p$(p_l) $(p_lbase)
+ debian/dh_doclink -p$(p_d) $(p_lbase)
+
+ 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)
+ $(cross_makeshlibs) dh_makeshlibs $(ldconfig_arg) -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)) \
+ $(if $(filter yes, $(with_common_libs)),,-- -Ldebian/shlibs.common$(2))
+ $(call cross_mangle_substvars,$(p_l))
+ echo $(p_l) $(p_d) >> debian/$(lib_binaries)
+
+ 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-libmpx.mk b/debian/rules.d/binary-libmpx.mk
new file mode 100644
index 0000000..ddb7ddf
--- /dev/null
+++ b/debian/rules.d/binary-libmpx.mk
@@ -0,0 +1,74 @@
+$(lib_binaries) += libmpx
+ifeq ($(with_lib64mpx),yes)
+ $(lib_binaries) += lib64mpx
+endif
+ifeq ($(with_lib32mpx),yes)
+ $(lib_binaries) += lib32mpx
+endif
+ifeq ($(with_libn32mpx),yes)
+ $(lib_binaries) += libn32mpx
+endif
+ifeq ($(with_libx32mpx),yes)
+ $(lib_binaries) += libx32mpx
+endif
+ifeq ($(with_libhfmpx),yes)
+ $(lib_binaries) += libhfmpx
+endif
+ifeq ($(with_libsfmpx),yes)
+ $(lib_binaries) += libsfmpx
+endif
+
+define __do_mpx
+ 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_compat2) dh_movefiles -p$(p_l) \
+ $(usr_lib$(2))/libmpx.so.* \
+ $(usr_lib$(2))/libmpxwrappers.so.*
+
+ debian/dh_doclink -p$(p_l) $(p_lbase)
+ debian/dh_doclink -p$(p_d) $(p_lbase)
+
+ 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)
+ ln -sf libmpx.symbols debian/$(p_l).symbols
+ $(cross_makeshlibs) dh_makeshlibs $(ldconfig_arg) -p$(p_l)
+ $(call cross_mangle_shlibs,$(p_l))
+ $(ignshld)DIRNAME=$(subst n,,$(2)) $(cross_shlibdeps) dh_shlibdeps -p$(p_l)
+ $(call cross_mangle_substvars,$(p_l))
+ echo $(p_l) $(p_d) >> debian/$(lib_binaries)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+endef
+
+# ----------------------------------------------------------------------
+
+do_mpx = $(call __do_mpx,lib$(1)mpx$(MPX_SONAME),$(1))
+
+$(binary_stamp)-libmpx: $(install_stamp)
+ $(call do_mpx,)
+
+$(binary_stamp)-lib64mpx: $(install_stamp)
+ $(call do_mpx,64)
+
+$(binary_stamp)-lib32mpx: $(install_stamp)
+ $(call do_mpx,32)
+
+$(binary_stamp)-libn32mpx: $(install_stamp)
+ $(call do_mpx,n32)
+
+$(binary_stamp)-libx32mpx: $(install_stamp)
+ $(call do_mpx,x32)
+
+$(binary_stamp)-libhfmpx: $(install_dependencies)
+ $(call do_mpx,hf)
+
+$(binary_stamp)-libsfmpx: $(install_dependencies)
+ $(call do_mpx,sf)
diff --git a/debian/rules.d/binary-libobjc.mk b/debian/rules.d/binary-libobjc.mk
new file mode 100644
index 0000000..da8bffb
--- /dev/null
+++ b/debian/rules.d/binary-libobjc.mk
@@ -0,0 +1,159 @@
+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_compat2) dh_movefiles -p$(p_l) \
+ $(files_lobjc)
+
+ debian/dh_doclink -p$(p_l) $(p_lbase)
+ debian/dh_doclink -p$(p_d) $(p_lbase)
+
+ dh_strip -p$(p_l) --dbg-package=$(p_d)
+ $(if $(2),
+ ln -sf libobjc.symbols debian/$(p_l).symbols ,
+ fgrep -v libobjc.symbols.gc debian/libobjc.symbols > debian/$(p_l).symbols
+ )
+ $(cross_makeshlibs) dh_makeshlibs $(ldconfig_arg) -p$(p_l) \
+ -- -a$(call mlib_to_arch,$(2)) || echo XXXXXXXXXXXXXX ERROR $(p_l)
+ rm -f debian/$(p_l).symbols
+ $(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))
+ echo $(p_l) $(p_d) >> debian/$(lib_binaries)
+
+ 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_compat2) 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_lbase)
+ echo $(p_l) >> debian/$(lib_binaries)
+
+ 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..93c4292
--- /dev/null
+++ b/debian/rules.d/binary-libquadmath.mk
@@ -0,0 +1,68 @@
+$(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_compat2) dh_movefiles -p$(p_l) $(usr_lib$(2))/libquadmath.so.*
+
+ debian/dh_doclink -p$(p_l) $(p_lbase)
+ debian/dh_doclink -p$(p_d) $(p_lbase)
+
+ dh_strip -p$(p_l) --dbg-package=$(p_d)
+ ln -sf libquadmath.symbols debian/$(p_l).symbols
+ $(cross_makeshlibs) dh_makeshlibs $(ldconfig_arg) -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))
+ echo $(p_l) $(p_d) >> debian/$(lib_binaries)
+
+ trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp)
+endef
+
+# ----------------------------------------------------------------------
+
+do_qmath = $(call __do_qmath,lib$(1)quadmath$(QUADMATH_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..e2c873a
--- /dev/null
+++ b/debian/rules.d/binary-libssp.mk
@@ -0,0 +1,155 @@
+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_compat2) dh_movefiles -p$(p_ssp) $(files_ssp)
+ debian/dh_doclink -p$(p_ssp) $(p_lbase)
+
+ debian/dh_rmemptydirs -p$(p_ssp)
+
+ dh_strip -p$(p_ssp)
+ dh_makeshlibs $(ldconfig_arg) -p$(p_ssp) -V '$(p_ssp) (>= $(DEB_SOVERSION))'
+ dh_shlibdeps -p$(p_ssp)
+ echo $(p_ssp) >> debian/arch_binaries
+
+ 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_compat2) dh_movefiles -p$(p_ssp64) \
+ $(PF)/lib64/libssp.so.*
+
+ debian/dh_doclink -p$(p_ssp64) $(p_lbase)
+
+ dh_strip -p$(p_ssp64)
+ dh_makeshlibs $(ldconfig_arg) -p$(p_ssp64) -V '$(p_ssp64) (>= $(DEB_SOVERSION))'
+# dh_shlibdeps -p$(p_ssp64)
+ echo $(p_ssp64) >> debian/arch_binaries
+
+ 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_compat2) dh_movefiles -p$(p_ssp32) \
+ $(lib32)/libssp.so.*
+
+ debian/dh_doclink -p$(p_ssp32) $(p_lbase)
+
+ dh_strip -p$(p_ssp32)
+ dh_makeshlibs $(ldconfig_arg) -p$(p_ssp32) -V '$(p_ssp32) (>= $(DEB_SOVERSION))'
+# dh_shlibdeps -p$(p_ssp32)
+ echo $(p_ssp32) >> debian/arch_binaries
+
+ 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_compat2) dh_movefiles -p$(p_sspn32) \
+ $(PF)/$(libn32)/libssp.so.*
+
+ debian/dh_doclink -p$(p_sspn32) $(p_lbase)
+
+ dh_strip -p$(p_sspn32)
+ dh_makeshlibs $(ldconfig_arg) -p$(p_sspn32) -V '$(p_sspn32) (>= $(DEB_SOVERSION))'
+# dh_shlibdeps -p$(p_sspn32)
+ echo $(p_sspn32) >> debian/arch_binaries
+
+ 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_compat2) dh_movefiles -p$(p_sspx32) \
+ $(PF)/$(libx32)/libssp.so.*
+
+ debian/dh_doclink -p$(p_sspx32) $(p_lbase)
+
+ dh_strip -p$(p_sspx32)
+ dh_makeshlibs $(ldconfig_arg) -p$(p_sspx32) -V '$(p_sspx32) (>= $(DEB_SOVERSION))'
+# dh_shlibdeps -p$(p_sspx32)
+ echo $(p_sspx32) >> debian/arch_binaries
+
+ 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..98257c6
--- /dev/null
+++ b/debian/rules.d/binary-libstdcxx.mk
@@ -0,0 +1,527 @@
+ifeq ($(with_libcxx),yes)
+ $(lib_binaries) += libstdcxx
+endif
+ifeq ($(with_lib64cxx),yes)
+ $(lib_binaries) += lib64stdcxx
+endif
+ifeq ($(with_lib32cxx),yes)
+ $(lib_binaries) += lib32stdcxx
+endif
+ifeq ($(with_libn32cxx),yes)
+ $(lib_binaries) += libn32stdcxx
+endif
+ifeq ($(with_libx32cxx),yes)
+ $(lib_binaries) += libx32stdcxx
+endif
+ifeq ($(with_libhfcxx),yes)
+ $(lib_binaries) += libhfstdcxx
+endif
+ifeq ($(with_libsfcxx),yes)
+ $(lib_binaries) += libsfstdcxx
+endif
+
+ifneq ($(DEB_STAGE),rtlibs)
+ ifeq ($(with_lib64cxxdev),yes)
+ $(lib_binaries) += lib64stdcxx-dev
+ endif
+ ifeq ($(with_lib64cxxdbg),yes)
+ $(lib_binaries) += lib64stdcxxdbg
+ endif
+ ifeq ($(with_lib32cxxdev),yes)
+ $(lib_binaries) += lib32stdcxx-dev
+ endif
+ ifeq ($(with_lib32cxxdbg),yes)
+ $(lib_binaries) += lib32stdcxxdbg
+ endif
+ ifeq ($(with_libn32cxxdev),yes)
+ $(lib_binaries) += libn32stdcxx-dev
+ endif
+ ifeq ($(with_libn32cxxdbg),yes)
+ $(lib_binaries) += libn32stdcxxdbg
+ endif
+ ifeq ($(with_libx32cxxdev),yes)
+ $(lib_binaries) += libx32stdcxx-dev
+ endif
+ ifeq ($(with_libx32cxxdbg),yes)
+ $(lib_binaries) += libx32stdcxxdbg
+ endif
+ ifeq ($(with_libhfcxxdev),yes)
+ $(lib_binaries) += libhfstdcxx-dev
+ endif
+ ifeq ($(with_libhfcxxdbg),yes)
+ $(lib_binaries) += libhfstdcxxdbg
+ 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
+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 \
+ $(PFL)/include/c++
+
+files_dev = \
+ $(PFL)/include/c++/$(BASE_VERSION) \
+ $(gcc_lib_dir)/libstdc++.{a,so} \
+ $(gcc_lib_dir)/libsupc++.a \
+ $(gcc_lib_dir)/libstdc++fs.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*} \
+ $(usr_lib)/debug/libstdc++fs.a
+
+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
+
+# ----------------------------------------------------------------------
+# FIXME: see #792204, libstdc++ symbols on sparc64, for now ignore errors
+# for the 32bit multilib build
+
+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_compat2) 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_lbase)
+ debian/dh_rmemptydirs -p$(p_l)
+
+ dh_strip -p$(p_l) $(if $(filter rtlibs,$(DEB_STAGE)),,--dbg-package=$(1)-$(BASE_VERSION)-dbg$(cross_lib_arch))
+
+ $(if $(filter $(DEB_TARGET_ARCH), armel hppa sparc64), \
+ -$(cross_makeshlibs) dh_makeshlibs $(ldconfig_arg) -p$(p_l) \
+ @echo "FIXME: libstdc++ not feature complete (https://gcc.gnu.org/ml/gcc/2014-07/msg00000.html)", \
+ $(cross_makeshlibs) dh_makeshlibs $(ldconfig_arg) -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)) \
+ $(if $(filter yes, $(with_common_libs)),,-- -Ldebian/shlibs.common$(2))
+ $(call cross_mangle_substvars,$(p_l))
+ echo $(p_l) >> debian/$(lib_binaries)
+
+ 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_cxx_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)) \
+ $(if $(filter yes, $(with_common_libs)),,-- -Ldebian/shlibs.common$(2))
+ $(call cross_mangle_substvars,$(p_d))
+
+ debian/dh_doclink -p$(p_d) $(p_lbase)
+ debian/dh_rmemptydirs -p$(p_d)
+ echo $(p_d) >> debian/$(lib_binaries)
+
+ 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))/libstdc++fs.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_compat2) dh_movefiles -p$(p_l) \
+ $(gcc_lib_dir$(2))/libstdc++.a \
+ $(gcc_lib_dir$(2))/libstdc++fs.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_lbase)
+ debian/dh_rmemptydirs -p$(p_l)
+ dh_strip -p$(p_l)
+ dh_shlibdeps -p$(p_l) \
+ $(call shlibdirs_to_search,$(subst stdc++$(CXX_SONAME),gcc$(GCC_SONAME),$(p_l)),$(2))
+ echo $(p_l) >> debian/$(lib_binaries)
+
+ 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++fs.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_compat2) dh_movefiles -p$(p_dev) $(files_dev)
+ $(dh_compat2) dh_movefiles -p$(p_pic) $(files_pic)
+ifeq ($(with_cxx_debug),yes)
+ $(dh_compat2) dh_movefiles -p$(p_dbg) $(files_dbg)
+endif
+
+ dh_link -p$(p_dev) \
+ /$(usr_lib)/libstdc++.so.$(CXX_SONAME) \
+ /$(gcc_lib_dir)/libstdc++.so \
+ /$(PFL)/include/c++/$(BASE_VERSION) /$(PFL)/include/c++/$(GCC_VERSION)
+ifeq ($(with_multiarch_cxxheaders),yes)
+ dh_link -p$(p_dev) \
+ /$(PFL)/include/$(DEB_TARGET_MULTIARCH)/c++/$(BASE_VERSION) \
+ /$(PFL)/include/$(DEB_TARGET_MULTIARCH)/c++/$(GCC_VERSION)
+endif
+
+ debian/dh_doclink -p$(p_dev) $(p_lbase)
+ debian/dh_doclink -p$(p_pic) $(p_lbase)
+ debian/dh_doclink -p$(p_dbg) $(p_lbase)
+ 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
+
+ $(ignshld)DIRNAME=$(subst n,,$(2)) $(cross_shlibdeps) dh_shlibdeps -p$(p_dev) -p$(p_pic) -p$(p_dbg) \
+ $(call shlibdirs_to_search,,) \
+ $(if $(filter yes, $(with_common_libs)),,-- -Ldebian/shlibs.common$(2))
+ $(call cross_mangle_substvars,$(p_dbg))
+ echo $(p_dev) $(p_pic) $(p_dbg) >> debian/$(lib_binaries)
+
+ 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): $(build_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)
+
+ echo $(p_libd) >> debian/indep_binaries
+
+ 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..03706e7
--- /dev/null
+++ b/debian/rules.d/binary-libtsan.mk
@@ -0,0 +1,78 @@
+$(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_compat2) dh_movefiles -p$(p_l) $(usr_lib$(2))/libtsan.so.*
+
+ debian/dh_doclink -p$(p_l) $(p_lbase)
+ debian/dh_doclink -p$(p_d) $(p_lbase)
+
+ 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)
+ $(cross_makeshlibs) dh_makeshlibs $(ldconfig_arg) -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)) \
+ $(if $(filter yes, $(with_common_libs)),,-- -Ldebian/shlibs.common$(2))
+ $(call cross_mangle_substvars,$(p_l))
+ echo $(p_l) $(p_d) >> debian/$(lib_binaries)
+
+ 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..5c0f03d
--- /dev/null
+++ b/debian/rules.d/binary-libubsan.mk
@@ -0,0 +1,76 @@
+$(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))
+ $(dh_compat2) dh_movefiles -p$(p_l) $(usr_lib$(2))/libubsan.so.*
+
+ debian/dh_doclink -p$(p_l) $(p_lbase)
+ debian/dh_doclink -p$(p_d) $(p_lbase)
+
+ 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)
+ $(cross_makeshlibs) dh_makeshlibs $(ldconfig_arg) -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)) \
+ $(if $(filter yes, $(with_common_libs)),,-- -Ldebian/shlibs.common$(2))
+ $(call cross_mangle_substvars,$(p_l))
+ echo $(p_l) $(p_d) >> debian/$(lib_binaries)
+
+ 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..2d3dca2
--- /dev/null
+++ b/debian/rules.d/binary-libvtv.mk
@@ -0,0 +1,76 @@
+$(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_compat2) dh_movefiles -p$(p_l) $(usr_lib$(2))/libvtv.so.*
+
+ debian/dh_doclink -p$(p_l) $(p_lbase)
+ debian/dh_doclink -p$(p_d) $(p_lbase)
+
+ 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)
+ $(cross_makeshlibs) dh_makeshlibs $(ldconfig_arg) -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)) \
+ $(if $(filter yes, $(with_common_libs)),,-- -Ldebian/shlibs.common$(2))
+ $(call cross_mangle_substvars,$(p_l))
+ echo $(p_l) $(p_d) >> debian/$(lib_binaries)
+
+ 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..83ff60c
--- /dev/null
+++ b/debian/rules.d/binary-neon.mk
@@ -0,0 +1,47 @@
+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_shlibdeps $(neon_pkgs)
+ echo $(p_nlgcc) $(p_ngomp) $(p_nlobjc) $(p_nflib) $(p_nlcxx) >> debian/arch_binaries
+
+ touch $@
diff --git a/debian/rules.d/binary-nof.mk b/debian/rules.d/binary-nof.mk
new file mode 100644
index 0000000..fa5408a
--- /dev/null
+++ b/debian/rules.d/binary-nof.mk
@@ -0,0 +1,51 @@
+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_compat2) dh_movefiles -p$(p_nof) $(files_nof)
+ debian/dh_doclink -p$(p_nof) $(p_xbase)
+ dh_strip -p$(p_nof)
+ dh_shlibdeps -p$(p_nof)
+
+ dh_makeshlibs $(ldconfig_arg) -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
+
+ echo $(p_nof) >> debian/arch_binaries
+
+ 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..2fb1794
--- /dev/null
+++ b/debian/rules.d/binary-objc.mk
@@ -0,0 +1,67 @@
+ifneq ($(DEB_STAGE),rtlibs)
+ ifneq (,$(filter yes, $(biarch64) $(biarch32) $(biarchn32) $(biarchx32) $(biarchhf) $(biarchsf)))
+ arch_binaries := $(arch_binaries) objc-multi
+ endif
+ arch_binaries := $(arch_binaries) objc
+endif
+
+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_compat2) 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
+
+ifeq ($(GFDL_INVARIANT_FREE),yes)
+ mkdir -p $(d_objc)/usr/share/lintian/overrides
+ echo '$(p_objc) binary: binary-without-manpage' \
+ >> $(d_objc)/usr/share/lintian/overrides/$(p_objc)
+endif
+
+ debian/dh_doclink -p$(p_objc) $(p_xbase)
+
+ debian/dh_rmemptydirs -p$(p_objc)
+
+ dh_strip -p$(p_objc) \
+ $(if $(unstripped_exe),-X/cc1obj)
+ dh_shlibdeps -p$(p_objc)
+ echo $(p_objc) >> debian/arch_binaries
+
+ 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_shlibdeps -p$(p_objc_m)
+ echo $(p_objc_m) >> debian/arch_binaries
+
+ 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..a37de91
--- /dev/null
+++ b/debian/rules.d/binary-objcxx.mk
@@ -0,0 +1,60 @@
+ifneq ($(DEB_STAGE),rtlibs)
+ ifneq (,$(filter yes, $(biarch64) $(biarch32) $(biarchn32) $(biarchx32) $(biarchhf) $(biarchsf)))
+ arch_binaries := $(arch_binaries) objcxx-multi
+ endif
+ arch_binaries := $(arch_binaries) objcxx
+endif
+
+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_compat2) 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
+
+ifeq ($(GFDL_INVARIANT_FREE),yes)
+ mkdir -p $(d_objcx)/usr/share/lintian/overrides
+ echo '$(p_objcx) binary: binary-without-manpage' \
+ >> $(d_objcx)/usr/share/lintian/overrides/$(p_objcx)
+endif
+
+ debian/dh_rmemptydirs -p$(p_objcx)
+
+ dh_strip -p$(p_objcx) \
+ $(if $(unstripped_exe),-X/cc1objplus)
+ dh_shlibdeps -p$(p_objcx)
+ echo $(p_objcx) >> debian/arch_binaries
+
+ 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_shlibdeps -p$(p_objcx_m)
+ echo $(p_objcx_m) >> debian/arch_binaries
+
+ 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..72f6c74
--- /dev/null
+++ b/debian/rules.d/binary-snapshot.mk
@@ -0,0 +1,234 @@
+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 \
+ --makeflags="$(NJOBS)" \
+ --ldflags="$(LDFLAGS)" \
+ $(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 \
+ echo -n $(d_snap)/$(docdir)/$(p_snap)/test-summaries/* \
+ | xargs -d ' ' -L 1 -P $(USE_CPUS) xz -7v; \
+ 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 -X/cgo -Xbin/go -Xbin/gofmt \
+ $(if $(unstripped_exe),$(foreach i,cc1 cc1obj cc1objplus cc1plus cc1d f951 go1 jc1 lto1, -X/$(i)))
+else
+ dh_strip -p$(p_snap) -Xdebug -X/cgo -Xbin/go -Xbin/gofmt \
+ $(if $(unstripped_exe),$(foreach i,cc1 cc1obj cc1objplus cc1plus cc1d f951 go1 jc1 lto1, -X/$(i)))
+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..1699326
--- /dev/null
+++ b/debian/rules.d/binary-softfloat.mk
@@ -0,0 +1,31 @@
+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_compat2) 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_shlibdeps -p$(p_softfloat)
+ echo $(p_softfloat) >> debian/arch_binaries
+
+ 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..7bc3f44
--- /dev/null
+++ b/debian/rules.d/binary-source.mk
@@ -0,0 +1,52 @@
+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: $(install_stamp)
+ 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)
+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/rules.parameters' -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
+
+ touch $(d_source)/usr/src/gcc$(pkg_ver)/debian/rules.parameters
+
+ 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)
+ echo $(p_source) >> debian/indep_binaries
+
+ touch $@