diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:22:56 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:22:56 +0000 |
commit | 3f472a4e5ca21e3ddb13737473e636b2b11a408a (patch) | |
tree | 7db1ab317884b9f6e04b6e13737c1679879cb97a /debian/rules.d | |
parent | Adding upstream version 13.2.0. (diff) | |
download | gcc-13-3f472a4e5ca21e3ddb13737473e636b2b11a408a.tar.xz gcc-13-3f472a4e5ca21e3ddb13737473e636b2b11a408a.zip |
Adding debian version 13.2.0-10.debian/13.2.0-10debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/rules.d')
36 files changed, 5425 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..3cd21fd --- /dev/null +++ b/debian/rules.d/binary-ada.mk @@ -0,0 +1,286 @@ +ifeq ($(with_separate_gnat),yes) + $(lib_binaries) += gnatbase +endif + +ifeq ($(with_libgnat),yes) + # During native builds, gnat-BV Depends: + # * libgnat because of the development symlink. + # During cross builds, gnat1 is linked statically. Only the latter remains. + $(lib_binaries) += libgnat +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_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_gnatd = debian/$(p_gnatd) + +GNAT_TOOLS = gnat gnatbind gnatchop gnatclean gnatkr gnatlink \ + gnatls gnatmake gnatname gnatprep gnathtml + +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)/ada_target_properties \ + $(gcc_lib_dir)/adainclude/*.ad[bs] \ + $(gcc_lib_dir)/adainclude/*.h \ + $(gcc_lib_dir)/adalib/*.ali \ + $(gcc_lib_dir)/adalib/lib*.a \ + $(foreach i,$(GNAT_TOOLS),$(PF)/bin/$(cmd_prefix)$(i)$(pkg_ver)) + +# Strip unreproducible -f*-prefix-map= options from installed .ali +# files until the proper solution BUILD_PATH_PREFIX_MAP is accepted. +sed_ali_strip_prefix_map := sed -i '/^A -f[a-z]+-prefix-map=/d' + +$(binary_stamp)-gnatbase: $(install_stamp) + dh_testdir + dh_testroot + dh_installdocs -p$(p_gbase) debian/ada/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_install -p$(p_lgnat) $(gcc_lib_dir)/adalib/libgna{t,rl}-$(GNAT_SONAME).so $(usr_lib) + + 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) (>= $(shell echo $(DEB_VERSION) | sed 's/-.*//'))' + $(call cross_mangle_shlibs,$(p_lgnat)) + +ifneq (,$(filter $(build_type), build-native cross-build-native)) + mkdir -p $(d_lgnat)/usr/share/lintian/overrides + echo package-name-doesnt-match-sonames > \ + $(d_lgnat)/usr/share/lintian/overrides/$(p_lgnat) +endif + +# The subst Make command below could be simplified, but ensures +# consistency with libraries building non-default multilib packages. + $(call do_strip_lib_dbg, $(p_lgnat), $(p_lgnat_dbg), $(v_dbg),,) + $(cross_shlibdeps) dh_shlibdeps -p$(p_lgnat) \ + $(call shlibdirs_to_search, \ + $(subst gnat-$(GNAT_SONAME),gcc-s$(GCC_SONAME),$(p_lgnat)) \ + $(subst gnat-$(GNAT_SONAME),atomic$(ATOMIC_SONAME),$(p_lgnat)) \ + ,) \ + $(if $(filter yes, $(with_common_libs)),,-- -Ldebian/shlibs.common) + $(call cross_mangle_substvars,$(p_lgnat)) + +ifeq ($(with_dbg),yes) + : # $(p_lgnat_dbg) + debian/dh_doclink -p$(p_lgnat_dbg) $(p_glbase) +endif + echo $(p_lgnat) $(if $(with_dbg), $(p_lgnat_dbg)) >> debian/$(lib_binaries) + + trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp) + +$(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) + # Development links to actual shared libraries provided by libgnat. + dh_install -p$(p_gnat) $(gcc_lib_dir)/adalib/libgna{t,rl}.so $(usr_lib) + # Similar links specific to Debian. FIXME: what is their purpose? + dh_link -p$(p_gnat) $(foreach lib,libgnat libgnarl,\ + $(usr_lib)/$(lib)-$(GNAT_SONAME).so $(gcc_lib_dir)/adalib/$(lib).so) +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 + + : # keep this one unversioned, see Debian #802838. + install -m755 debian/ada/gnatgcc $(d_gnat)/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)gnatgcc 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) + +ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTONS))) + $(DWZ) \ + $(d_gnat)/$(gcc_lexec_dir)/gnat1 +endif + dh_strip -p$(p_gnat) + find $(d_gnat) -name '*.ali' | xargs $(sed_ali_strip_prefix_map) + find $(d_gnat) -name '*.ali' | xargs chmod 444 + dh_shlibdeps -p$(p_gnat) + mkdir -p $(d_gnat)/usr/share/lintian/overrides + ( \ + echo '$(p_gnat) binary: hardening-no-pie'; \ + echo '$(p_gnat) binary: non-standard-file-perm' \ + ) > $(d_gnat)/usr/share/lintian/overrides/$(p_gnat) +ifeq ($(GFDL_INVARIANT_FREE),yes) + echo '$(p_gnat) binary: binary-without-manpage' \ + >> $(d_gnat)/usr/share/lintian/overrides/$(p_gnat) +endif + + echo $(p_gnat) >> debian/arch_binaries + +ifeq ($(with_gnatsjlj),yes) + dh_strip -p$(p_gnatsjlj) + find $(d_gnatsjlj) -name '*.ali' | xargs $(sed_ali_strip_prefix_map) + find $(d_gnatsjlj) -name '*.ali' | xargs chmod 444 + 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..c6f589b --- /dev/null +++ b/debian/rules.d/binary-base.mk @@ -0,0 +1,49 @@ +arch_binaries += base +ifeq ($(with_gcclbase),yes) + ifneq ($(with_base_only),yes) + indep_binaries += lbase + endif +endif + +# --------------------------------------------------------------------------- +# gcc-base + +$(binary_stamp)-base: $(install_dependencies) + dh_testdir + dh_testroot + rm -rf $(d_base) + dh_installdirs -p$(p_base) + +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..cbeeb26 --- /dev/null +++ b/debian/rules.d/binary-cpp.mk @@ -0,0 +1,85 @@ +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 + +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 + + mkdir -p $(d_cpp)/usr/share/lintian/overrides + echo '$(p_cpp) binary: hardening-no-pie' \ + > $(d_cpp)/usr/share/lintian/overrides/$(p_cpp) +ifeq ($(GFDL_INVARIANT_FREE),yes) + 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) + +ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTONS))) + $(DWZ) $(d_cpp)/$(gcc_lexec_dir)/cc1 +endif + 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..30af1b7 --- /dev/null +++ b/debian/rules.d/binary-cxx.mk @@ -0,0 +1,86 @@ +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 \ + $(gcc_lexec_dir)/g++-mapper-server + +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 + + mkdir -p $(d_cxx)/usr/share/lintian/overrides + echo '$(p_cxx) binary: hardening-no-pie' \ + > $(d_cxx)/usr/share/lintian/overrides/$(p_cxx) +ifeq ($(GFDL_INVARIANT_FREE),yes) + 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) +ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTONS))) + $(DWZ) \ + $(d_cxx)/$(gcc_lexec_dir)/cc1plus +endif + 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..131d8b0 --- /dev/null +++ b/debian/rules.d/binary-d.mk @@ -0,0 +1,292 @@ +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_libphobosdev),yes) + $(lib_binaries) += libphobos-dev + endif + ifeq ($(with_libphobos),yes) + $(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_lib_dir) \ + $(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)/d21 +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) + dh_installchangelogs -p$(p_gdc) src/gcc/d/ChangeLog + + $(dh_compat2) dh_movefiles -p$(p_gdc) -X/zlib/ $(files_gdc) + +ifeq ($(with_phobos),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_xbase)/README.Bugs \ + /$(docdir)/$(p_gdc)/README.Bugs + +ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTONS))) + $(DWZ) \ + $(d_gdc)/$(gcc_lexec_dir)/d21 +endif + dh_strip -p$(p_gdc) \ + $(if $(unstripped_exe),-X/d21) + dh_shlibdeps -p$(p_gdc) + + mkdir -p $(d_gdc)/usr/share/lintian/overrides + echo '$(p_gdc) binary: hardening-no-pie' \ + > $(d_gdc)/usr/share/lintian/overrides/$(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) + $(if $(with_dbg),debian/dh_doclink -p$(p_d) $(p_lbase)) + + $(call do_strip_lib_dbg, $(p_l), $(p_d), $(v_dbg),,) + 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-s$(GCC_SONAME),$(p_l)) \ + ,$(2)) \ + $(if $(filter yes, $(with_common_libs)),,-- -Ldebian/shlibs.common$(2)) + $(call cross_mangle_substvars,$(p_l)) + + mkdir -p $(d_l)/usr/share/lintian/overrides; \ + $(if $(filter $(DEB_TARGET_ARCH), amd64), + $(if $(2), + echo "$(p_l) binary: symbols-file-contains-current-version-with-debian-revision" \ + >> $(d_l)/usr/share/lintian/overrides/$(p_l) + ) + , + echo "$(p_l) binary: symbols-file-contains-current-version-with-debian-revision" \ + >> $(d_l)/usr/share/lintian/overrides/$(p_l) + ) + $(if $(2), + echo "$(p_l) binary: embedded-library" \ + >> $(d_l)/usr/share/lintian/overrides/$(p_l) + ) + + dh_lintian -p$(p_l) + echo $(p_l) $(if $(with_dbg), $(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-fortran.mk b/debian/rules.d/binary-fortran.mk new file mode 100644 index 0000000..ead1ee2 --- /dev/null +++ b/debian/rules.d/binary-fortran.mk @@ -0,0 +1,279 @@ +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) + $(if $(with_dbg),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 + + $(call do_strip_lib_dbg, $(p_l), $(p_d), $(v_dbg),,) + 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-s$(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) $(if $(with_dbg), $(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$(p_l) $(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)) + + $(if $(2),, \ + $(dh_compat2) dh_movefiles -p$(p_l) \ + $(gcc_lib_dir$(2))/include/ISO_Fortran_binding.h) + + 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 + + mkdir -p $(d_g95)/usr/share/lintian/overrides + ( \ + echo '$(p_g95) binary: hardening-no-pie'; \ + echo '$(p_g95) binary: missing-prerequisite-for-gfortran-module'; \ + ) > $(d_g95)/usr/share/lintian/overrides/$(p_g95) +ifeq ($(GFDL_INVARIANT_FREE),yes) + 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) + +ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTONS))) + $(DWZ) \ + $(d_g95)/$(gcc_lexec_dir)/f951 +endif + 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..d8982c1 --- /dev/null +++ b/debian/rules.d/binary-gcc.mk @@ -0,0 +1,322 @@ +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} \ + $(PF)/bin \ + $(gcc_lexec_dir) \ + $(gcc_lib_dir)/include \ + $(PF)/share/man/man1 $(libgcc_dir) + +# XXX: what about triarch mapping? +files_gcc = \ + $(PF)/bin/$(cmd_prefix){gcc,gcov,gcov-tool,gcov-dump,lto-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/libc[cp]1plugin.so{,.0,.0.0.0} +endif + +files_gcc += \ + $(gcc_lexec_dir)/liblto_plugin.so + +ifeq ($(DEB_STAGE),stage1) + files_gcc += \ + $(gcc_lib_dir)/include +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 \ + $(PF)/share/man/man1/$(cmd_prefix)lto-dump$(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) + +# ---------------------------------------------------------------------- +$(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_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_hwasan),yes) + mv $(d)/$(usr_lib)/libhwasan_preinit.o $(d_gcc)/$(gcc_lib_dir)/ +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) + : # keep the lto_plugin.so link in the old place for a while + dh_link -p$(p_gcc) \ + /$(gcc_lexec_dir)/liblto_plugin.so /$(gcc_lib_dir)/liblto_plugin.so + +ifeq ($(unprefixed_names),yes) + for i in gcc gcov gcov-dump gcov-tool gcc-ar gcc-nm gcc-ranlib lto-dump; 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 lto-dump; 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 + + mkdir -p $(d_gcc)/usr/share/lintian/overrides + echo '$(p_gcc) binary: hardening-no-pie' \ + > $(d_gcc)/usr/share/lintian/overrides/$(p_gcc) +ifeq ($(GFDL_INVARIANT_FREE),yes) + echo '$(p_gcc) binary: binary-without-manpage' \ + >> $(d_gcc)/usr/share/lintian/overrides/$(p_gcc) +endif + + debian/dh_rmemptydirs -p$(p_gcc) +ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTONS))) + $(DWZ) \ + $(d_gcc)/$(gcc_lexec_dir)/lto1 \ + $(d_gcc)/$(gcc_lexec_dir)/lto-wrapper \ + $(d_gcc)/$(gcc_lexec_dir)/collect2 +endif + 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) + mkdir -p $(d_pld)/usr/share/lintian/overrides + echo '$(p_pld) binary: hardening-no-pie' \ + > $(d_pld)/usr/share/lintian/overrides/$(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 +ifeq ($(with_check),yes) + cd $(d_tst) && tar xvf ../../installed-testlogs.tar +else + echo "Nothing to compare (testsuite not run)" + echo 'Test run disabled, reason: $(with_check)' \ + > $(d_tst)/$(docdir)/$(p_xbase)/test-run-disabled +endif + + 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/$(cmd_prefix)libitm$(pkg_ver).info ]; then \ + cp -p $(buildlibdir)/libitm/$(cmd_prefix)libitm$(pkg_ver).info \ + $(d_doc)/$(PF)/share/info/libitm$(pkg_ver).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-gcn.mk b/debian/rules.d/binary-gcn.mk new file mode 100644 index 0000000..3c80699 --- /dev/null +++ b/debian/rules.d/binary-gcn.mk @@ -0,0 +1,122 @@ +ifeq ($(with_offload_gcn),yes) + arch_binaries := $(arch_binaries) gcn + ifeq ($(with_common_libs),yes) + arch_binaries := $(arch_binaries) gcn-plugin + endif +endif + +p_gcn = gcc$(pkg_ver)-offload-amdgcn +d_gcn = debian/$(p_gcn) + +p_pl_gcn = libgomp-plugin-amdgcn1 +d_pl_gcn = debian/$(p_pl_gcn) + +dirs_gcn = \ + $(docdir)/$(p_xbase)/ \ + $(PF)/bin \ + $(gcc_lexec_dir)/accel + +files_gcn = \ + $(PF)/bin/$(DEB_TARGET_GNU_TYPE)-accel-$(gcn_target_name)-gcc$(pkg_ver) \ + $(gcc_lexec_dir)/accel/$(gcn_target_name) + +# not needed: libs moved, headers not needed for lto1 +# $(PF)/amdgcn-none + +# are these needed? +# $(PF)/lib/gcc/$(gcn_target_name)/$(versiondir)/{include,finclude,mgomp} + +ifneq ($(GFDL_INVARIANT_FREE),yes) + files_gcn += \ + $(PF)/share/man/man1/$(DEB_HOST_GNU_TYPE)-accel-$(gcn_target_name)-gcc$(pkg_ver).1 +endif + +$(binary_stamp)-gcn: $(install_stamp) + dh_testdir + dh_testroot + mv $(install_stamp) $(install_stamp)-tmp + + rm -rf $(d_gcn) + dh_installdirs -p$(p_gcn) $(dirs_gcn) + tar -c -C $(d)-gcn -f - $(files_gcn) \ + | tar -x -v -C $(d_gcn) -f - + +ifeq ($(gcn_tools_llvm_version),tools) + : # re-create the symlinks as relative symlinks + dh_link -p$(p_gcn) \ + /usr/$(gcn_target_name)/bin/ar /$(gcc_lexec_dir)/accel/$(gcn_target_name)/ar \ + /usr/$(gcn_target_name)/bin/as /$(gcc_lexec_dir)/accel/$(gcn_target_name)/as \ + /usr/$(gcn_target_name)/bin/ld /$(gcc_lexec_dir)/accel/$(gcn_target_name)/ld \ + /usr/$(gcn_target_name)/bin/nm /$(gcc_lexec_dir)/accel/$(gcn_target_name)/nm \ + /usr/$(gcn_target_name)/bin/ranlib /$(gcc_lexec_dir)/accel/$(gcn_target_name)/ranlib +else + : # re-create the symlinks as relative symlinks + dh_link -p$(p_gcn) \ + /usr/lib/llvm-$(gcn_tools_llvm_version)/bin/llvm-ar /$(gcc_lexec_dir)/accel/$(gcn_target_name)/ar \ + /usr/lib/llvm-$(gcn_tools_llvm_version)/bin/llvm-mc /$(gcc_lexec_dir)/accel/$(gcn_target_name)/as \ + /usr/lib/llvm-$(gcn_tools_llvm_version)/bin/lld /$(gcc_lexec_dir)/accel/$(gcn_target_name)/ld \ + /usr/lib/llvm-$(gcn_tools_llvm_version)/bin/llvm-nm /$(gcc_lexec_dir)/accel/$(gcn_target_name)/nm \ + /usr/lib/llvm-$(gcn_tools_llvm_version)/bin/llvm-ranlib /$(gcc_lexec_dir)/accel/$(gcn_target_name)/ranlib + + mkdir -p $(d_gcn)/usr/$(gcn_target_name)/bin + dh_link -p$(p_gcn) \ + /usr/lib/llvm-$(gcn_tools_llvm_version)/bin/llvm-ar /usr/$(gcn_target_name)/bin/ar \ + /usr/lib/llvm-$(gcn_tools_llvm_version)/bin/llvm-mc /usr/$(gcn_target_name)/bin/as \ + /usr/lib/llvm-$(gcn_tools_llvm_version)/bin/lld /usr/$(gcn_target_name)/bin/ld \ + /usr/lib/llvm-$(gcn_tools_llvm_version)/bin/llvm-nm /usr/$(gcn_target_name)/bin/nm \ + /usr/lib/llvm-$(gcn_tools_llvm_version)/bin/llvm-ranlib /usr/$(gcn_target_name)/bin/ranlib +endif + + mkdir -p $(d_gcn)/usr/share/lintian/overrides + ( \ + echo '$(p_gcn) binary: hardening-no-pie'; \ + echo '$(p_gcn) binary: non-standard-dir-in-usr'; \ + echo '$(p_gcn) binary: file-in-unusual-dir'; \ + echo '$(p_gcn) binary: binary-from-other-architecture'; \ + ) > $(d_gcn)/usr/share/lintian/overrides/$(p_gcn) +ifeq ($(GFDL_INVARIANT_FREE),yes) + echo '$(p_gcn) binary: binary-without-manpage' \ + >> $(d_gcn)/usr/share/lintian/overrides/$(p_gcn) +endif + + debian/dh_doclink -p$(p_gcn) $(p_xbase) + + debian/dh_rmemptydirs -p$(p_gcn) + +ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTONS))) + $(DWZ) \ + $(d_gcn)/$(gcc_lexec_dir)/accel/$(gcn_target_name)/{collect2,lto1,lto-wrapper,mkoffload} +endif + dh_strip -p$(p_gcn) \ + $(if $(unstripped_exe),-X/lto1) -X/lib{c,g,m,gcc,gomp,gcov,gfortran,caf_single,ssp,ssp_nonshared}.a + dh_shlibdeps -p$(p_gcn) + echo $(p_gcn) >> debian/arch_binaries + + trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp) + +# ---------------------------------------------------------------------- +$(binary_stamp)-gcn-plugin: $(install_dependencies) + dh_testdir + dh_testroot + mv $(install_stamp) $(install_stamp)-tmp + + rm -rf $(d_pl_gcn) + dh_installdirs -p$(p_pl_gcn) \ + $(docdir) \ + $(usr_lib) + $(dh_compat2) dh_movefiles -p$(p_pl_gcn) \ + $(usr_lib)/libgomp-plugin-gcn.so.* + + mkdir -p $(d_pl_gcn)/usr/share/lintian/overrides + ( \ + echo '$(p_pl_gcn) binary: package-name-doesnt-match-sonames'; \ + ) > $(d_pl_gcn)/usr/share/lintian/overrides/$(p_pl_gcn) + debian/dh_doclink -p$(p_pl_gcn) $(p_xbase) + debian/dh_rmemptydirs -p$(p_pl_gcn) + + dh_strip -p$(p_pl_gcn) + dh_makeshlibs -p$(p_pl_gcn) + dh_shlibdeps -p$(p_pl_gcn) + echo $(p_pl_gcn) >> debian/arch_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..29e0ea6 --- /dev/null +++ b/debian/rules.d/binary-go.mk @@ -0,0 +1,367 @@ +ifeq ($(with_libgo),yes) + $(lib_binaries) += libgo +endif +ifeq ($(with_godev),yes) + $(lib_binaries) += libgo-dev +endif +ifeq ($(with_lib64go),yes) + $(lib_binaries) += lib64go +endif +ifeq ($(with_lib64godev),yes) + $(lib_binaries) += lib64go-dev +endif +ifeq ($(with_lib32go),yes) + $(lib_binaries) += lib32go +endif +ifeq ($(with_lib32godev),yes) + $(lib_binaries) += lib32go-dev +endif +ifeq ($(with_libn32go),yes) + $(lib_binaries) += libn32go +endif +ifeq ($(with_libn32godev),yes) + $(lib_binaries) += libn32go-dev +endif +ifeq ($(with_libx32go),yes) + $(lib_binaries) += libx32go +endif +ifeq ($(with_libx32godev),yes) + $(lib_binaries) += libx32go-dev +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 \ + $(gcc_lexec_dir)/{buildid,test2json,vet} \ + $(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_libgo + 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.* + + debian/dh_doclink -p$(p_l) $(p_lbase) + $(if $(with_dbg),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) + : # $(call do_strip_lib_dbg, $(p_l), $(p_d), $(v_dbg),,) + $(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-s$(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) $(if $(with_dbg), $(p_d)) >> debian/$(lib_binaries) + + trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp) +endef + +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_libgo_dev + dh_testdir + dh_testroot + mv $(install_stamp) $(install_stamp)-tmp + + rm -rf $(d_l) + dh_installdirs -p$(p_l) \ + $(gcc_lib_dir$(2)) \ + $(usr_lib$(2)) + mv $(d)/$(usr_lib$(2))/{libgobegin,libgolibbegin}.a \ + $(d)/$(gcc_lib_dir$(2))/ + $(dh_compat2) dh_movefiles -p$(p_l) \ + $(gcc_lib_dir$(2))/{libgobegin,libgolibbegin}.a \ + $(usr_lib$(2))/go + $(call install_gccgo_lib,libgo,$(GO_SONAME),$(2),$(p_l)) + + $(if $(filter yes, $(with_standalone_go)), \ + $(call install_gccgo_lib,libgomp,$(GOMP_SONAME),$(2),$(p_l))) + $(call __do_gccgo_libgcc,$(2),$(p_l),$(gcc_lib_dir$(2)),$(d)/$(usr_lib$(2))) + + 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_libgo = $(call __do_libgo,lib$(1)go$(GO_SONAME),$(1)) +do_libgo_dev = $(call __do_libgo_dev,lib$(1)go-$(BASE_VERSION)-dev,$(1)) + +# ---------------------------------------------------------------------- +$(binary_stamp)-libgo: $(install_stamp) + $(call do_libgo,) + +$(binary_stamp)-lib64go: $(install_stamp) + $(call do_libgo,64) + +$(binary_stamp)-lib32go: $(install_stamp) + $(call do_libgo,32) + +$(binary_stamp)-libn32go: $(install_stamp) + $(call do_libgo,n32) + +$(binary_stamp)-libx32go: $(install_stamp) + $(call do_libgo,x32) + +$(binary_stamp)-libgo-dev: $(install_stamp) + $(call do_libgo_dev,) + +$(binary_stamp)-lib64go-dev: $(install_stamp) + $(call do_libgo_dev,64) + +$(binary_stamp)-lib32go-dev: $(install_stamp) + $(call do_libgo_dev,32) + +$(binary_stamp)-libx32go-dev: $(install_stamp) + $(call do_libgo_dev,x32) + +$(binary_stamp)-libn32go-dev: $(install_stamp) + $(call do_libgo_dev,n32) + +# ---------------------------------------------------------------------- +$(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) + + $(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 + + mkdir -p $(d_go)/usr/share/lintian/overrides + echo '$(p_go) binary: unstripped-binary-or-object' \ + > $(d_go)/usr/share/lintian/overrides/$(p_go) + echo '$(p_go) binary: hardening-no-pie' \ + >> $(d_go)/usr/share/lintian/overrides/$(p_go) +ifeq ($(GFDL_INVARIANT_FREE),yes) + 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) + +ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTONS))) + $(DWZ) \ + $(d_go)/$(gcc_lexec_dir)/go1 +endif + dh_strip -v -p$(p_go) -X/cgo -X/go$(pkg_ver) -X/gofmt$(pkg_ver) \ + -X/buildid -X/test2json -X/vet $(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) + + mkdir -p $(d_go_m)/usr/share/lintian/overrides + echo '$(p_go_m) binary: non-multi-arch-lib-dir' \ + > $(d_go_m)/usr/share/lintian/overrides/$(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..36f91f5 --- /dev/null +++ b/debian/rules.d/binary-hppa64.mk @@ -0,0 +1,39 @@ +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) + +ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTONS))) + $(DWZ) \ + $(d_hppa64)/$(hppa64libexecdir)/gcc/hppa64-linux-gnu/$(versiondir)/cc1 \ + $(d_hppa64)/$(hppa64libexecdir)/gcc/hppa64-linux-gnu/$(versiondir)/collect2 \ + $(d_hppa64)/$(hppa64libexecdir)/gcc/hppa64-linux-gnu/$(versiondir)/lto-wrapper \ + $(d_hppa64)/$(hppa64libexecdir)/gcc/hppa64-linux-gnu/$(versiondir)/lto1 +endif + 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-libasan.mk b/debian/rules.d/binary-libasan.mk new file mode 100644 index 0000000..82c4cf5 --- /dev/null +++ b/debian/rules.d/binary-libasan.mk @@ -0,0 +1,84 @@ +$(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) + $(if $(with_dbg),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 + mkdir -p debian/$(p_l)/usr/share/lintian/overrides + echo "$(p_l): unstripped-binary-or-object" \ + >> debian/$(p_l)/usr/share/lintian/overrides/$(p_l) + + $(if $(2), \ + mkdir -p debian/$(p_l)/usr/share/lintian/overrides; \ + echo "$(p_l): symbols-file-contains-current-version-with-debian-revision" \ + >> debian/$(p_l)/usr/share/lintian/overrides/$(p_l)) + + $(if $(strip_sanitizer), $(call do_strip_lib_dbg, $(p_l), $(p_d), $(v_dbg),,)) + $(cross_makeshlibs) dh_makeshlibs $(ldconfig_arg) -p$(p_l) + $(call cross_mangle_shlibs,$(p_l)) + $(if $(ignshld),$(ignshld),-)DIRNAME=$(subst n,,$(2)) $(cross_shlibdeps) dh_shlibdeps -p$(p_l) \ + $(call shlibdirs_to_search, \ + $(subst asan$(ASAN_SONAME),gcc-s$(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) $(if $(with_dbg), $(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..9c2b591 --- /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) + $(if $(with_dbg),debian/dh_doclink -p$(p_d) $(p_lbase)) + + $(call do_strip_lib_dbg, $(p_l), $(p_d), $(v_dbg),,) + 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) $(if $(with_dbg), $(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-libgcc.mk b/debian/rules.d/binary-libgcc.mk new file mode 100644 index 0000000..836e553 --- /dev/null +++ b/debian/rules.d/binary-libgcc.mk @@ -0,0 +1,357 @@ +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 + +p_lgcc = libgcc-s$(GCC_SONAME)$(cross_lib_arch) +p_lgccdbg = libgcc-s$(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-s$(GCC_SONAME)$(cross_lib_arch) +p_l32gccdbg = lib32gcc-s$(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-s$(GCC_SONAME)$(cross_lib_arch) +p_l64gccdbg = lib64gcc-s$(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-s$(GCC_SONAME)$(cross_lib_arch) +p_ln32gccdbg = libn32gcc-s$(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-s$(GCC_SONAME)$(cross_lib_arch) +p_lx32gccdbg = libx32gcc-s$(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-s$(GCC_SONAME)$(cross_lib_arch) +p_lhfgccdbg = libhfgcc-s$(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-s$(GCC_SONAME)$(cross_lib_arch) +p_lsfgccdbg = libsfgcc-s$(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; \ + rm -f $(d)/$(3)/libgcc_s.so; \ + ( \ + echo '/* GNU ld script'; \ + echo ' Use a trivial linker script instead of a symlink. */'; \ + echo 'GROUP ( libgcc_s.so.$(GCC_SONAME) )'; \ + ) > $(d)/$(3)/libgcc_s.so; \ + else \ + mv $(4)/libgcc_s.so $(d)/$(3)/libgcc_s.so; \ + fi; \ + ) + $(dh_compat2) dh_movefiles -p$(2) \ + $(3)/{libgcc*,libgcov.a,*.o} \ + $(if $(1),,$(gcc_lib_dir)/include/*.h $(gcc_lib_dir)/include/sanitizer/*.h) # Only move headers for the "main" package + $(if $(1),, for h in ISO_Fortran_binding.h libgccjit.h libgccjit++.h; do \ + if [ -f debian/$(2)/$(gcc_lib_dir)/include/$$h ]; then \ + mv debian/$(2)/$(gcc_lib_dir)/include/$$h $(d)/$(gcc_lib_dir)/include/.; \ + fi; done) + + : # 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 + # but 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)) + mv $(4)/liblsan_preinit.o debian/$(2)/$(3)/; + )) + $(if $(1),,$(if $(filter yes, $(with_tsan)), + $(call install_gcc_lib,libtsan,$(TSAN_SONAME),$(1),$(2)) + mv $(4)/libtsan_preinit.o debian/$(2)/$(3)/; + )) + $(if $(filter yes, $(with_ubsan)), + $(call install_gcc_lib,libubsan,$(UBSAN_SONAME),$(1),$(2)) + ) + $(if $(1),,$(if $(filter yes, $(with_hwasan)), + $(call install_gcc_lib,libhwasan,$(HWASAN_SONAME),$(1),$(2)) + )) + $(if $(filter yes, $(with_vtv)), + $(call install_gcc_lib,libvtv,$(VTV_SONAME),$(1),$(2)) + ) + $(if $(filter yes, $(with_cilkrts)), + $(call install_gcc_lib,libcilkrts,$(CILKRTS_SONAME),$(1),$(2)) + ) + $(if $(filter yes, $(with_qmath)), + $(call install_gcc_lib,libquadmath,$(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))/. + ) + + $(if $(filter yes, $(with_internal_libunwind)), + mv $(d)/$(usr_lib$(2))/libunwind.* \ + $(d_l)/$(libgcc_dir$(2))/. + ) + + debian/dh_doclink -p$(p_l) $(if $(3),$(3),$(p_lbase)) + debian/dh_rmemptydirs -p$(p_l) + $(if $(with_dbg), + debian/dh_doclink -p$(p_d) $(if $(3),$(3),$(p_lbase)) + debian/dh_rmemptydirs -p$(p_d) + ) + $(call do_strip_lib_dbg, $(p_l), $(p_d), $(v_dbg),,) + + # 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 gcc-s1,$(p_l)), \ + ln -sf libgcc-s.symbols debian/$(p_l).symbols \ + ) + $(cross_makeshlibs) dh_makeshlibs $(ldconfig_arg) -p$(p_l) \ + -- -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) $(if $(with_dbg), $(p_d)) >> debian/$(lib_binaries) + + $(if $(filter yes,$(with_libcompatgcc)), + debian/dh_doclink -p$(subst gcc-s,gcc,$(p_l)) $(if $(3),$(3),$(p_lbase)) + $(if $(with_dbg), + debian/dh_doclink -p$(subst gcc-s,gcc,$(p_d)) $(if $(3),$(3),$(p_lbase)) + ) + + $(if $(2),, + mkdir -p $(subst gcc-s,gcc,$(d_l))/$(libgcc_dir$(2)) + cp -p $(d_l)/$(libgcc_dir$(2))/libgcc_s.so.$(GCC_SONAME) \ + $(subst gcc-s,gcc,$(d_l))/lib/. + mkdir -p $(subst gcc-s,gcc,$(d_l))/DEBIAN + cp -p $(d_l)/DEBIAN/{symbols,shlibs} \ + $(subst gcc-s,gcc,$(d_l))/DEBIAN/. + cp -p $(d_l).substvars $(subst gcc-s,gcc,$(d_l)).substvars + mkdir -p $(subst gcc-s,gcc,$(d_l))/usr/share/lintian/overrides + ( \ + echo '$(subst gcc-s,gcc,$(p_l)): package-name-doesnt-match-sonames'; \ + echo '$(subst gcc-s,gcc,$(p_l)): shlibs-declares-dependency-on-other-package'; \ + echo '$(subst gcc-s,gcc,$(p_l)): symbols-declares-dependency-on-other-package'; \ + ) > $(subst gcc-s,gcc,$(d_l))/usr/share/lintian/overrides/$(subst gcc-s,gcc,$(p_l)) + ) + + echo $(subst gcc-s,gcc,$(p_l) $(if $(with_dbg), $(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-s$(GCC_SONAME),$(1),$(2)) +# ---------------------------------------------------------------------- + +$(binary_stamp)-libgcc: $(install_dependencies) + $(call do_libgcc,,) + +$(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..9441a49 --- /dev/null +++ b/debian/rules.d/binary-libgccjit.mk @@ -0,0 +1,95 @@ +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) +ifeq ($(with_dbg),yes) + dh_installdirs -p$(p_jitdbg) +endif + + $(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) +ifeq ($(with_dbg),yes) + debian/dh_doclink -p$(p_jitdbg) $(p_base) +endif + + $(call do_strip_lib_dbg, $(p_jitlib), $(p_jitdbg), $(v_dbg),,) + $(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) $(if $(with_dbg), $(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/libgccjit-figures + + $(dh_compat2) dh_movefiles -p$(p_jitdoc) \ + $(PF)/share/info/libgccjit* + cp -p $(srcdir)/gcc/jit/docs/_build/texinfo/libgccjit-figures/*.png \ + $(d_jitdoc)/$(PF)/share/info/libgccjit-figures/. + + 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..1a86ae2 --- /dev/null +++ b/debian/rules.d/binary-libgomp.mk @@ -0,0 +1,69 @@ +$(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) + $(if $(with_dbg),debian/dh_doclink -p$(p_d) $(p_lbase)) + + $(call do_strip_lib_dbg, $(p_l), $(p_d), $(v_dbg),,) + 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-s$(GCC_SONAME),$(p_l)),$(2)) \ + $(if $(filter yes, $(with_common_libs)),,-- -Ldebian/shlibs.common$(2)) + $(call cross_mangle_substvars,$(p_l)) + echo $(p_l) $(if $(with_dbg), $(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-libhwasan.mk b/debian/rules.d/binary-libhwasan.mk new file mode 100644 index 0000000..f9475f4 --- /dev/null +++ b/debian/rules.d/binary-libhwasan.mk @@ -0,0 +1,83 @@ +$(lib_binaries) += libhwasan +ifeq ($(with_lib64hwasan),yes) + $(lib_binaries) += lib64hwasan +endif +ifeq ($(with_lib32hwasan),yes) + $(lib_binaries) += lib32hwasan +endif +ifeq ($(with_libn32hwasan),yes) + $(lib_binaries) += libn32hwasan +endif +ifeq ($(with_libx32hwasan),yes) + $(lib_binaries) += libx32hwasan +endif +ifeq ($(with_libhfhwasan),yes) + $(lib_binaries) += libhfhwasan +endif +ifeq ($(with_libsfhwasan),yes) + $(lib_binaries) += libsfhwasan +endif + +define __do_hwasan + 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))/libhwasan.so.* + + debian/dh_doclink -p$(p_l) $(p_lbase) + $(if $(with_dbg),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 + mkdir -p debian/$(p_l)/usr/share/lintian/overrides + echo "$(p_l): unstripped-binary-or-object" \ + >> debian/$(p_l)/usr/share/lintian/overrides/$(p_l) + $(if $(2), \ + mkdir -p debian/$(p_l)/usr/share/lintian/overrides; \ + echo "$(p_l): symbols-file-contains-current-version-with-debian-revision" \ + >> debian/$(p_l)/usr/share/lintian/overrides/$(p_l)) + + $(if $(strip_sanitizer), $(call do_strip_lib_dbg, $(p_l), $(p_d), $(v_dbg),,)) + $(cross_makeshlibs) dh_makeshlibs $(ldconfig_arg) -p$(p_l) + $(call cross_mangle_shlibs,$(p_l)) + $(if $(ignshld),$(ignshld),-)DIRNAME=$(subst n,,$(2)) $(cross_shlibdeps) dh_shlibdeps -p$(p_l) \ + $(call shlibdirs_to_search, \ + $(subst hwasan$(HWASAN_SONAME),gcc-s$(GCC_SONAME),$(p_l)) \ + $(subst hwasan$(HWASAN_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) $(if $(with_dbg), $(p_d)) >> debian/$(lib_binaries) + + trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp) +endef + +# ---------------------------------------------------------------------- + +do_hwasan = $(call __do_hwasan,lib$(1)hwasan$(HWASAN_SONAME),$(1)) + +$(binary_stamp)-libhwasan: $(install_stamp) + $(call do_hwasan,) + +$(binary_stamp)-lib64hwasan: $(install_stamp) + $(call do_hwasan,64) + +$(binary_stamp)-lib32hwasan: $(install_stamp) + $(call do_hwasan,32) + +$(binary_stamp)-libn32hwasan: $(install_stamp) + $(call do_hwasan,n32) + +$(binary_stamp)-libx32hwasan: $(install_stamp) + $(call do_hwasan,x32) + +$(binary_stamp)-libhfhwasan: $(install_dependencies) + $(call do_hwasan,hf) + +$(binary_stamp)-libsfhwasan: $(install_dependencies) + $(call do_hwasan,sf) diff --git a/debian/rules.d/binary-libitm.mk b/debian/rules.d/binary-libitm.mk new file mode 100644 index 0000000..a618647 --- /dev/null +++ b/debian/rules.d/binary-libitm.mk @@ -0,0 +1,69 @@ +$(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) + $(if $(with_dbg),debian/dh_doclink -p$(p_d) $(p_lbase)) + + $(call do_strip_lib_dbg, $(p_l), $(p_d), $(v_dbg),,) + 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)) \ + $(if $(filter yes, $(with_common_libs)),,-- -Ldebian/shlibs.common$(2)) + $(call cross_mangle_substvars,$(p_l)) + echo $(p_l) $(if $(with_dbg), $(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..a4b3e64 --- /dev/null +++ b/debian/rules.d/binary-liblsan.mk @@ -0,0 +1,79 @@ +$(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) + $(if $(with_dbg),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 + mkdir -p debian/$(p_l)/usr/share/lintian/overrides + echo "$(p_l): unstripped-binary-or-object" \ + >> debian/$(p_l)/usr/share/lintian/overrides/$(p_l) + + $(if $(strip_sanitizer), $(call do_strip_lib_dbg, $(p_l), $(p_d), $(v_dbg),,)) + $(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-s$(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) $(if $(with_dbg), $(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-libobjc.mk b/debian/rules.d/binary-libobjc.mk new file mode 100644 index 0000000..c270d83 --- /dev/null +++ b/debian/rules.d/binary-libobjc.mk @@ -0,0 +1,162 @@ +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) + $(if $(with_dbg),debian/dh_doclink -p$(p_d) $(p_lbase)) + + $(call do_strip_lib_dbg, $(p_l), $(p_d), $(v_dbg),,) + rm -f debian/$(p_l).symbols + $(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-s$(GCC_SONAME),$(p_l)),$(2)) \ + $(if $(filter yes, $(with_common_libs)),,-- -Ldebian/shlibs.common$(2)) + $(call cross_mangle_substvars,$(p_l)) + echo $(p_l) $(if $(with_dbg), $(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)), + $(if $(2),, + 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..1fcb744 --- /dev/null +++ b/debian/rules.d/binary-libquadmath.mk @@ -0,0 +1,69 @@ +$(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) + $(if $(with_dbg),debian/dh_doclink -p$(p_d) $(p_lbase)) + + $(call do_strip_lib_dbg, $(p_l), $(p_d), $(v_dbg),,) + 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)) \ + $(if $(filter yes, $(with_common_libs)),,-- -Ldebian/shlibs.common$(2)) + $(call cross_mangle_substvars,$(p_l)) + echo $(p_l) $(if $(with_dbg), $(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..567656e --- /dev/null +++ b/debian/rules.d/binary-libstdcxx.mk @@ -0,0 +1,540 @@ +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 \ + $(gcc_lib_dir)/libstdc++exp.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 \ + $(usr_lib)/debug/libstdc++exp.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: + : # save the results of the libstdc++ test run, overridden by check-abi + -tar -c -f $(buildlibdir)/libstdc++-v3/testsuite/libstdc++.tar \ + -C $(buildlibdir)/libstdc++-v3/testsuite libstdc++.{log,sum} + + 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 + + : # restore the results of the libstdc++ test run + -tar -x -f $(buildlibdir)/libstdc++-v3/testsuite/libstdc++.tar \ + -C $(buildlibdir)/libstdc++-v3/testsuite + +# ---------------------------------------------------------------------- +# 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/python + $(dh_compat2) dh_movefiles -p$(p_l) \ + $(PF)/share/gcc/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) + + $(if $(with_dbg), + dh_strip -p$(p_l) $(if $(filter rtlibs,$(DEB_STAGE)),,--dbg-package=$(1)-$(BASE_VERSION)-dbg$(cross_lib_arch)), + dh_strip -p$(p_l) $(if $(filter rtlibs,$(DEB_STAGE)),,--dbgsym-migration='$(1)-$(BASE_VERSION)-dbg$(cross_lib_arch) (<< $(v_dbg))') + ) + ln -sf libstdc++.symbols debian/$(p_l).symbols + $(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-s$(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 $(with_dbg), + $(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-s$(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))/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))/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-s$(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 +# FIXME: the -dev and -dbg packages are built twice ... +$(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++exp.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 + : # FIXME: update libstdc++-pic patch +# mv $(d)/$(usr_lib)/libstdc++_pic.a $(d)/$(gcc_lib_dir)/ + cp $(buildlibdir)/libstdc++-v3/src/.libs/libstdc++convenience.a \ + $(d)/$(gcc_lib_dir)/libstdc++_pic.a + + 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 + + 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) + ifeq ($(with_dbg),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 +endif + $(call do_strip_lib_dbg, $(p_dev), $(p_dbg), $(v_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..fd18270 --- /dev/null +++ b/debian/rules.d/binary-libtsan.mk @@ -0,0 +1,82 @@ +$(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) + $(if $(with_dbg),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 + mkdir -p debian/$(p_l)/usr/share/lintian/overrides + echo "$(p_l): unstripped-binary-or-object" \ + >> debian/$(p_l)/usr/share/lintian/overrides/$(p_l) + + $(if $(strip_sanitizer), $(call do_strip_lib_dbg, $(p_l), $(p_d), $(v_dbg),,)) + $(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-s$(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) $(if $(with_dbg), $(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..7b373e0 --- /dev/null +++ b/debian/rules.d/binary-libubsan.mk @@ -0,0 +1,79 @@ +$(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) + $(if $(with_dbg),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 + mkdir -p debian/$(p_l)/usr/share/lintian/overrides + echo "$(p_l): unstripped-binary-or-object" \ + >> debian/$(p_l)/usr/share/lintian/overrides/$(p_l) + + $(if $(strip_sanitizer), $(call do_strip_lib_dbg, $(p_l), $(p_d), $(v_dbg),,)) + $(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-s$(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) $(if $(with_dbg), $(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..27023a7 --- /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) + $(if $(with_dbg),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 + + $(call do_strip_lib_dbg, $(p_l), $(p_d), $(v_dbg),,) + $(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-s$(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) $(if $(with_dbg), $(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-m2.mk b/debian/rules.d/binary-m2.mk new file mode 100644 index 0000000..8ecffb1 --- /dev/null +++ b/debian/rules.d/binary-m2.mk @@ -0,0 +1,308 @@ +ifneq ($(DEB_STAGE),rtlibs) + ifeq (0,1) + ifneq (,$(filter yes, $(biarch64) $(biarch32) $(biarchn32) $(biarchx32) $(biarchsf))) + arch_binaries := $(arch_binaries) gm2-multi + endif + endif + arch_binaries := $(arch_binaries) gm2 + + ifeq ($(with_m2dev),yes) + $(lib_binaries) += libgm2-dev + endif + ifeq ($(with_libgm2),yes) + $(lib_binaries) += libgm2 + endif + + ifneq ($(DEB_CROSS),yes) + indep_binaries := $(indep_binaries) gm2-doc + endif + + ifeq (0,1) + ifeq ($(with_lib64gm2dev),yes) + $(lib_binaries) += lib64gm2-dev + endif + ifeq ($(with_lib32gm2dev),yes) + $(lib_binaries) += lib32gm2-dev + endif + ifeq ($(with_libn32gm2dev),yes) + $(lib_binaries) += libn32gm2-dev + endif + ifeq ($(with_libx32gm2dev),yes) + $(lib_binaries) += libx32gm2-dev + endif + ifeq ($(with_libhfgm2dev),yes) + $(lib_binaries) += libhfgm2-dev + endif + ifeq ($(with_libsfgm2dev),yes) + $(lib_binaries) += libsfgm2-dev + endif + + ifeq ($(with_lib64gm2),yes) + $(lib_binaries) += lib64gm2 + endif + ifeq ($(with_lib32gm2),yes) + $(lib_binaries) += lib32gm2 + endif + ifeq ($(with_libn32gm2),yes) + $(lib_binaries) += libn32gm2 + endif + ifeq ($(with_libx32gm2),yes) + $(lib_binaries) += libx32gm2 + endif + ifeq ($(with_libhfgm2),yes) + $(lib_binaries) += libhfgm2 + endif + ifeq ($(with_libsfgm2),yes) + $(lib_binaries) += libsfgm2 + endif + endif +endif + +p_gm2 = gm2$(pkg_ver)$(cross_bin_arch) +p_gm2_m = gm2$(pkg_ver)-multilib$(cross_bin_arch) +p_libgm2 = libgm2-$(GM2_SONAME) +p_libgm2dev = libgm2$(pkg_ver)-dev +p_gm2d = gm2$(pkg_ver)-doc + +d_gm2 = debian/$(p_gm2) +d_gm2_m = debian/$(p_gm2_m) +d_libgm2 = debian/$(p_libgm2) +d_libgm2dev = debian/$(p_libgm2dev) +d_gm2d = debian/$(p_gm2d) + +dirs_gm2 = \ + $(PF)/bin \ + $(PF)/share/man/man1 \ + $(gcc_lexec_dir) \ + $(gcc_lib_dir)/plugin +#ifneq ($(DEB_CROSS),yes) +# dirs_gm2 += \ +# $(gm2_include_dir) +#endif + +files_gm2 = \ + $(PF)/bin/$(cmd_prefix)gm2$(pkg_ver) \ + $(gcc_lib_dir)/plugin/m2rte.so \ + $(gcc_lexec_dir)/cc1gm2 +ifneq ($(GFDL_INVARIANT_FREE),yes-now-pure-gfdl) + files_gm2 += \ + $(PF)/share/man/man1/$(cmd_prefix)gm2$(pkg_ver).1 +endif + +dirs_libgm2 = \ + $(PF)/lib \ + $(gm2_include_dir) \ + $(gcc_lib_dir) + +$(binary_stamp)-gm2: $(install_stamp) + dh_testdir + dh_testroot + mv $(install_stamp) $(install_stamp)-tmp + + rm -rf $(d_gm2) + dh_installdirs -p$(p_gm2) $(dirs_gm2) + + dh_installdocs -p$(p_gm2) + dh_installchangelogs -p$(p_gm2) src/gcc/m2/ChangeLog + + $(dh_compat2) dh_movefiles -p$(p_gm2) $(files_gm2) + +ifeq ($(unprefixed_names),yes) + ln -sf $(cmd_prefix)gm2$(pkg_ver) \ + $(d_gm2)/$(PF)/bin/gm2$(pkg_ver) + ifneq ($(GFDL_INVARIANT_FREE),yes-now-pure-gfdl) + ln -sf $(cmd_prefix)gm2$(pkg_ver).1 \ + $(d_gm2)/$(PF)/share/man/man1/gm2$(pkg_ver).1 + endif +endif + dh_installdirs -p$(p_gm2) + dh_link -p$(p_gm2) \ + /$(docdir)/$(p_xbase)/README.Bugs \ + /$(docdir)/$(p_gm2)/README.Bugs + +ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTONS))) + $(DWZ) \ + $(d_gm2)/$(gcc_lexec_dir)/cc1gm2 +endif + dh_strip -p$(p_gm2) \ + $(if $(unstripped_exe),-X/cc1gm2 -X/gm2) + dh_shlibdeps -p$(p_gm2) + + mkdir -p $(d_gm2)/usr/share/lintian/overrides + echo '$(p_gm2) binary: hardening-no-pie' \ + > $(d_gm2)/usr/share/lintian/overrides/$(p_gm2) + + echo $(p_gm2) >> debian/arch_binaries + + find $(d_gm2) -type d -empty -delete + + trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp) + +$(binary_stamp)-gm2-multi: $(install_stamp) + dh_testdir + dh_testroot + mv $(install_stamp) $(install_stamp)-tmp + + rm -rf $(d_gm2_m) + dh_installdirs -p$(p_gm2_m) $(docdir) + + debian/dh_doclink -p$(p_gm2_m) $(p_xbase) + + dh_strip -p$(p_gm2_m) + dh_shlibdeps -p$(p_gm2_m) + echo $(p_gm2_m) >> debian/arch_binaries + + trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp) + +define __do_libgm2 + 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))/libm2pim.so.* \ + $(usr_lib$(2))/libm2cor.so.* \ + $(usr_lib$(2))/libm2iso.so.* \ + $(usr_lib$(2))/libm2log.so.* \ + $(usr_lib$(2))/libm2min.so.* + + debian/dh_doclink -p$(p_l) $(p_lbase) + $(if $(with_dbg),debian/dh_doclink -p$(p_d) $(p_lbase)) + + $(call do_strip_lib_dbg, $(p_l), $(p_d), $(v_dbg),,) + : ln -sf libgm2.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 gm2-$(GM2_SONAME),gcc-s$(GCC_SONAME),$(p_l)) \ + ,$(2)) \ + $(if $(filter yes, $(with_common_libs)),,-- -Ldebian/shlibs.common$(2)) + $(call cross_mangle_substvars,$(p_l)) + + mkdir -p $(d_l)/usr/share/lintian/overrides; \ + ( \ + echo "$(p_l) binary: dev-pkg-without-shlib-symlink"; \ + echo "$(p_l) binary: shared-lib-without-dependency-information"; \ + echo "$(p_l) binary: package-name-doesnt-match-sonames"; \ + echo "$(p_l) binary: library-not-linked-against-libc"; \ + ) >> $(d_l)/usr/share/lintian/overrides/$(p_l) + + dh_lintian -p$(p_l) + echo $(p_l) $(if $(with_dbg), $(p_d)) >> debian/$(lib_binaries) + + trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp) +endef + +# install_gm2_lib(lib,soname,flavour,package,subdir) +define install_gm2_lib + dh_link -p$(4) \ + /$(usr_lib$(3))/$(1).so.$(2) /$(gcc_lib_dir$(3))/$(5)/$(1).so \ + /$(usr_lib$(3))/$(1).so.$(2) /$(gcc_lib_dir$(3))/$(1).so + mv $(d)/$(usr_lib$(3))/$(1)*.a debian/$(4)/$(gcc_lib_dir$(3)) + rm -f $(d)/$(usr_lib$(3))/$(1)*.{la,so} +endef + +define __do_libgm2_dev + dh_testdir + dh_testroot + mv $(install_stamp) $(install_stamp)-tmp + + rm -rf $(d_l) + dh_installdirs -p$(p_l) \ + $(gcc_lib_dir$(2)) + + : # install_gm2_lib calls needed? + + $(if $(2),, + $(dh_compat2) dh_movefiles -p$(p_l) \ + $(gcc_lib_dir)/m2 + ) + + $(call install_gm2_lib,libm2pim,$(GM2_SONAME),$(2),$(p_l),m2/m2pim) + $(call install_gm2_lib,libm2cor,$(GM2_SONAME),$(2),$(p_l),m2/m2cor) + $(call install_gm2_lib,libm2iso,$(GM2_SONAME),$(2),$(p_l),m2/m2iso) + $(call install_gm2_lib,libm2log,$(GM2_SONAME),$(2),$(p_l),m2/m2log) + $(call install_gm2_lib,libm2min,$(GM2_SONAME),$(2),$(p_l),m2/m2min) + + debian/dh_doclink -p$(p_l) \ + $(if $(filter yes,$(with_separate_gm2)),$(p_gm2),$(p_lbase)) + echo $(p_l) >> debian/$(lib_binaries) + + trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp) +endef + +do_libgm2 = $(call __do_libgm2,lib$(1)gm2-$(GM2_SONAME),$(1)) +do_libgm2_dev = $(call __do_libgm2_dev,lib$(1)gm2-$(BASE_VERSION)-dev,$(1)) + +# ---------------------------------------------------------------------- +$(binary_stamp)-gm2-doc: $(build_html_stamp) $(install_stamp) + dh_testdir + dh_testroot + mv $(install_stamp) $(install_stamp)-tmp + + rm -rf $(d_gm2d) + dh_installdirs -p$(p_gm2d) \ + $(docdir)/$(p_gm2) \ + $(docdir)/$(p_xbase)/m2 \ + $(PF)/share/info + cp -p $(builddir)/gcc/doc/m2.info $(d_gm2d)/$(PF)/share/info/gm2-$(BASE_VERSION).info + cp -p html/gm2.html $(d_gm2d)/$(docdir)/$(p_xbase)/m2/gm2-$(BASE_VERSION).html + ln -sf ../$(p_xbase)/m2/gm2-$(BASE_VERSION).html $(d_gm2d)/$(docdir)/$(p_gm2)/gm2-$(BASE_VERSION).html + + debian/dh_doclink -p$(p_gm2d) $(p_xbase) + dh_installdocs -p$(p_gm2d) + rm -f $(d_gm2d)/$(docdir)/$(p_xbase)/copyright + + echo $(p_gm2d) >> debian/indep_binaries + + trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp) + + +$(binary_stamp)-libgm2: $(install_stamp) + $(call do_libgm2,) + +$(binary_stamp)-lib64gm2: $(install_stamp) + $(call do_libgm2,64) + +$(binary_stamp)-lib32gm2: $(install_stamp) + $(call do_libgm2,32) + +$(binary_stamp)-libn32gm2: $(install_stamp) + $(call do_libgm2,n32) + +$(binary_stamp)-libx32gm2: $(install_stamp) + $(call do_libgm2,x32) + +$(binary_stamp)-libhfgm2: $(install_stamp) + $(call do_libgm2,hf) + +$(binary_stamp)-libsfgm2: $(install_stamp) + $(call do_libgm2,sf) + + +$(binary_stamp)-libgm2-dev: $(install_stamp) + $(call do_libgm2_dev,) + +$(binary_stamp)-lib64gm2-dev: $(install_stamp) + $(call do_libgm2_dev,64) + +$(binary_stamp)-lib32gm2-dev: $(install_stamp) + $(call do_libgm2_dev,32) + +$(binary_stamp)-libx32gm2-dev: $(install_stamp) + $(call do_libgm2_dev,x32) + +$(binary_stamp)-libn32gm2-dev: $(install_stamp) + $(call do_libgm2_dev,n32) + +$(binary_stamp)-libhfgm2-dev: $(install_stamp) + $(call do_libgm2_dev,hf) + +$(binary_stamp)-libsfgm2-dev: $(install_stamp) + $(call do_libgm2_dev,sf) 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-nvptx.mk b/debian/rules.d/binary-nvptx.mk new file mode 100644 index 0000000..b2841b4 --- /dev/null +++ b/debian/rules.d/binary-nvptx.mk @@ -0,0 +1,97 @@ +ifeq ($(with_offload_nvptx),yes) + arch_binaries := $(arch_binaries) nvptx + ifeq ($(with_common_libs),yes) + arch_binaries := $(arch_binaries) nvptx-plugin + endif +endif + +p_nvptx = gcc$(pkg_ver)-offload-nvptx +d_nvptx = debian/$(p_nvptx) + +p_pl_nvptx = libgomp-plugin-nvptx1 +d_pl_nvptx = debian/$(p_pl_nvptx) + +dirs_nvptx = \ + $(docdir)/$(p_xbase)/ \ + $(PF)/bin \ + $(gcc_lexec_dir)/accel + +files_nvptx = \ + $(PF)/bin/$(DEB_TARGET_GNU_TYPE)-accel-nvptx-none-gcc$(pkg_ver) \ + $(gcc_lexec_dir)/accel/nvptx-none + +# not needed: libs moved, headers not needed for lto1 +# $(PF)/nvptx-none + +# are these needed? +# $(PF)/lib/gcc/nvptx-none/$(versiondir)/{include,finclude,mgomp} + +ifneq ($(GFDL_INVARIANT_FREE),yes) + files_nvptx += \ + $(PF)/share/man/man1/$(DEB_HOST_GNU_TYPE)-accel-nvptx-none-gcc$(pkg_ver).1 +endif + +$(binary_stamp)-nvptx: $(install_stamp) + dh_testdir + dh_testroot + mv $(install_stamp) $(install_stamp)-tmp + + rm -rf $(d_nvptx) + dh_installdirs -p$(p_nvptx) $(dirs_nvptx) + tar -c -C $(d)-nvptx -f - $(files_nvptx) \ + | tar -x -v -C $(d_nvptx) -f - + + : # re-create the symlinks as relative symlinks + dh_link -p$(p_nvptx) \ + /usr/bin/nvptx-none-ar /$(gcc_lexec_dir)/accel/nvptx-none/ar \ + /usr/bin/nvptx-none-as /$(gcc_lexec_dir)/accel/nvptx-none/as \ + /usr/bin/nvptx-none-ld /$(gcc_lexec_dir)/accel/nvptx-none/ld \ + /usr/bin/nvptx-none-ranlib /$(gcc_lexec_dir)/accel/nvptx-none/ranlib + + mkdir -p $(d_nvptx)/usr/share/lintian/overrides + ( \ + echo '$(p_nvptx) binary: hardening-no-pie'; \ + echo '$(p_nvptx) binary: no-code-sections' \ + ) > $(d_nvptx)/usr/share/lintian/overrides/$(p_nvptx) +ifeq ($(GFDL_INVARIANT_FREE),yes) + echo '$(p_nvptx) binary: binary-without-manpage' \ + >> $(d_nvptx)/usr/share/lintian/overrides/$(p_nvptx) +endif + + debian/dh_doclink -p$(p_nvptx) $(p_xbase) + + debian/dh_rmemptydirs -p$(p_nvptx) + +ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTONS))) + $(DWZ) \ + $(d_nvptx)/$(gcc_lexec_dir)/accel/nvptx-none/{collect2,lto1,lto-wrapper,mkoffload} +endif + dh_strip -p$(p_nvptx) \ + $(if $(unstripped_exe),-X/lto1) + dh_shlibdeps -p$(p_nvptx) + echo $(p_nvptx) >> debian/arch_binaries + + trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp) + +# ---------------------------------------------------------------------- +$(binary_stamp)-nvptx-plugin: $(install_dependencies) + dh_testdir + dh_testroot + mv $(install_stamp) $(install_stamp)-tmp + + rm -rf $(d_pl_nvptx) + dh_installdirs -p$(p_pl_nvptx) \ + $(docdir) \ + $(usr_lib) + $(dh_compat2) dh_movefiles -p$(p_pl_nvptx) \ + $(usr_lib)/libgomp-plugin-nvptx.so.* + + debian/dh_doclink -p$(p_pl_nvptx) $(p_xbase) + debian/dh_rmemptydirs -p$(p_pl_nvptx) + + dh_strip -p$(p_pl_nvptx) + dh_makeshlibs -p$(p_pl_nvptx) + dh_shlibdeps -p$(p_pl_nvptx) + echo $(p_pl_nvptx) >> 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..743bf52 --- /dev/null +++ b/debian/rules.d/binary-objc.mk @@ -0,0 +1,69 @@ +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 + + mkdir -p $(d_objc)/usr/share/lintian/overrides + echo '$(p_objc) binary: hardening-no-pie' \ + > $(d_objc)/usr/share/lintian/overrides/$(p_objc) + + debian/dh_doclink -p$(p_objc) $(p_xbase) + + debian/dh_rmemptydirs -p$(p_objc) + +ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTONS))) + $(DWZ) \ + $(d_objc)/$(gcc_lexec_dir)/cc1obj +endif + 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..e750cae --- /dev/null +++ b/debian/rules.d/binary-objcxx.mk @@ -0,0 +1,62 @@ +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 + + mkdir -p $(d_objcx)/usr/share/lintian/overrides + echo '$(p_objcx) binary: hardening-no-pie' \ + > $(d_objcx)/usr/share/lintian/overrides/$(p_objcx) + + debian/dh_rmemptydirs -p$(p_objcx) + +ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTONS))) + $(DWZ) \ + $(d_objcx)/$(gcc_lexec_dir)/cc1objplus +endif + 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-rust.mk b/debian/rules.d/binary-rust.mk new file mode 100644 index 0000000..8c77ca1 --- /dev/null +++ b/debian/rules.d/binary-rust.mk @@ -0,0 +1,309 @@ +ifneq ($(DEB_STAGE),rtlibs) + ifeq (0,1) + #ifneq (,$(filter yes, $(biarch64) $(biarch32) $(biarchn32) $(biarchx32) $(biarchsf))) + # arch_binaries := $(arch_binaries) grs-multi + #endif + endif + arch_binaries := $(arch_binaries) grs + + #ifeq ($(with_rsdev),yes) + # $(lib_binaries) += libgrs-dev + #endif + #ifeq ($(with_libgrs),yes) + # $(lib_binaries) += libgrs + #endif + + #ifneq ($(DEB_CROSS),yes) + # indep_binaries := $(indep_binaries) grs-doc + #endif + + ifeq (0,1) + ifeq ($(with_lib64grsdev),yes) + $(lib_binaries) += lib64grs-dev + endif + ifeq ($(with_lib32grsdev),yes) + $(lib_binaries) += lib32grs-dev + endif + ifeq ($(with_libn32grsdev),yes) + $(lib_binaries) += libn32grs-dev + endif + ifeq ($(with_libx32grsdev),yes) + $(lib_binaries) += libx32grs-dev + endif + ifeq ($(with_libhfgrsdev),yes) + $(lib_binaries) += libhfgrs-dev + endif + ifeq ($(with_libsfgrsdev),yes) + $(lib_binaries) += libsfgrs-dev + endif + + ifeq ($(with_lib64grs),yes) + $(lib_binaries) += lib64grs + endif + ifeq ($(with_lib32grs),yes) + $(lib_binaries) += lib32grs + endif + ifeq ($(with_libn32grs),yes) + $(lib_binaries) += libn32grs + endif + ifeq ($(with_libx32grs),yes) + $(lib_binaries) += libx32grs + endif + ifeq ($(with_libhfgrs),yes) + $(lib_binaries) += libhfgrs + endif + ifeq ($(with_libsfgrs),yes) + $(lib_binaries) += libsfgrs + endif + endif +endif + +p_grs = gccrs$(pkg_ver)$(cross_bin_arch) +p_grs_m = gccrs$(pkg_ver)-multilib$(cross_bin_arch) +p_libgrs = libgrs-$(GRS_SONAME) +p_libgrsdev = libgrs$(pkg_ver)-dev +p_grsd = grs$(pkg_ver)-doc + +d_grs = debian/$(p_grs) +d_grs_m = debian/$(p_grs_m) +d_libgrs = debian/$(p_libgrs) +d_libgrsdev = debian/$(p_libgrsdev) +d_grsd = debian/$(p_grsd) + +dirs_grs = \ + $(PF)/bin \ + $(PF)/share/man/man1 \ + $(gcc_lexec_dir) +#ifneq ($(DEB_CROSS),yes) +# dirs_grs += \ +# $(grs_include_dir) +#endif + +files_grs = \ + $(PF)/bin/$(cmd_prefix)gccrs$(pkg_ver) \ + $(gcc_lexec_dir)/rust1 +# files_grs += \ +# $(PF)/share/man/man1/$(cmd_prefix)gccrs$(pkg_ver).1 + +dirs_libgrs = \ + $(PF)/lib \ + $(grs_include_dir) \ + $(gcc_lib_dir) + +$(binary_stamp)-grs: $(install_stamp) + dh_testdir + dh_testroot + mv $(install_stamp) $(install_stamp)-tmp + + rm -rf $(d_grs) + dh_installdirs -p$(p_grs) $(dirs_grs) + + dh_installdocs -p$(p_grs) + dh_installchangelogs -p$(p_grs) #src/gcc/rs/ChangeLog + + $(dh_compat2) dh_movefiles -p$(p_grs) $(files_grs) + +ifeq ($(unprefixed_names),yes) + ln -sf $(cmd_prefix)gccrs$(pkg_ver) \ + $(d_grs)/$(PF)/bin/gccrs$(pkg_ver) +# ln -sf $(cmd_prefix)gccrs$(pkg_ver).1 \ +# $(d_grs)/$(PF)/share/man/man1/gccrs$(pkg_ver).1 +endif + dh_installdirs -p$(p_grs) + debian/dh_doclink -p$(p_grs) $(p_xbase) + +ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTONS))) + $(DWZ) \ + $(d_grs)/$(gcc_lexec_dir)/rust1 +endif + dh_strip -p$(p_grs) \ + $(if $(unstripped_exe),-X/rustcc1) + dh_shlibdeps -p$(p_grs) + + mkdir -p $(d_grs)/usr/share/lintian/overrides + echo '$(p_grs) binary: hardening-no-pie' \ + > $(d_grs)/usr/share/lintian/overrides/$(p_grs) + + echo $(p_grs) >> debian/arch_binaries + + find $(d_grs) -type d -empty -delete + + trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp) + +$(binary_stamp)-grs-multi: $(install_stamp) + dh_testdir + dh_testroot + mv $(install_stamp) $(install_stamp)-tmp + + rm -rf $(d_grs_m) + dh_installdirs -p$(p_grs_m) $(docdir) + + debian/dh_doclink -p$(p_grs_m) $(p_xbase) + + dh_strip -p$(p_grs_m) + dh_shlibdeps -p$(p_grs_m) + echo $(p_grs_m) >> debian/arch_binaries + + trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp) + +define __do_libgrs + 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))/librspim.so.* \ + $(usr_lib$(2))/librscor.so.* \ + $(usr_lib$(2))/librsiso.so.* \ + $(usr_lib$(2))/librslog.so.* \ + $(usr_lib$(2))/librsmin.so.* + + debian/dh_doclink -p$(p_l) $(p_lbase) + $(if $(with_dbg),debian/dh_doclink -p$(p_d) $(p_lbase)) + + $(call do_strip_lib_dbg, $(p_l), $(p_d), $(v_dbg),,) + : ln -sf libgrs.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 grs-$(GRS_SONAME),gcc-s$(GCC_SONAME),$(p_l)) \ + ,$(2)) \ + $(if $(filter yes, $(with_common_libs)),,-- -Ldebian/shlibs.common$(2)) + $(call cross_mangle_substvars,$(p_l)) + + mkdir -p $(d_l)/usr/share/lintian/overrides; \ + ( \ + echo "$(p_l) binary: dev-pkg-without-shlib-symlink"; \ + echo "$(p_l) binary: shared-lib-without-dependency-information"; \ + echo "$(p_l) binary: package-name-doesnt-match-sonames"; \ + echo "$(p_l) binary: library-not-linked-against-libc"; \ + ) >> $(d_l)/usr/share/lintian/overrides/$(p_l) + + dh_lintian -p$(p_l) + echo $(p_l) $(if $(with_dbg), $(p_d)) >> debian/$(lib_binaries) + + trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp) +endef + +# install_grs_lib(lib,soname,flavour,package,subdir) +#define install_grs_lib +# mkdir -p debian/$(4)/$(gcc_lib_dir$(3))/$(5) +# mv $(d)/$(usr_lib$(3))/$(1)*.a debian/$(4)/$(gcc_lib_dir$(3))/$(5)/. +# rm -f $(d)/$(usr_lib$(3))/$(1)*.{la,so} +# dh_link -p$(4) \ +# /$(usr_lib$(3))/$(1).so.$(2) /$(gcc_lib_dir$(3))/$(5)/$(1).so +#endef +define install_grs_lib + dh_link -p$(4) \ + /$(usr_lib$(3))/$(1).so.$(2) /$(gcc_lib_dir$(3))/$(5)/$(1).so + rm -f $(d)/$(usr_lib$(3))/$(1).so + rm -f $(d)/$(usr_lib$(3))/$(1).a +endef + +define __do_libgrs_dev + dh_testdir + dh_testroot + mv $(install_stamp) $(install_stamp)-tmp + + rm -rf $(d_l) + dh_installdirs -p$(p_l) \ + $(gcc_lib_dir$(2)) + + : # install_grs_lib calls needed? + + $(if $(2),, + $(dh_compat2) dh_movefiles -p$(p_l) \ + $(gcc_lexec_dir)/rs + ) + + $(call install_grs_lib,librspim,$(GRS_SONAME),$(2),$(p_l),rs/rspim) + $(call install_grs_lib,librscor,$(GRS_SONAME),$(2),$(p_l),rs/rscor) + $(call install_grs_lib,librsiso,$(GRS_SONAME),$(2),$(p_l),rs/rsiso) + $(call install_grs_lib,librslog,$(GRS_SONAME),$(2),$(p_l),rs/rslog) + $(call install_grs_lib,librsmin,$(GRS_SONAME),$(2),$(p_l),rs/rsmin) + + : # included in grs package + rm -f $(d_l)/$(grs_include_dir)/__entrypoint.di + + debian/dh_doclink -p$(p_l) \ + $(if $(filter yes,$(with_separate_grs)),$(p_grs),$(p_lbase)) + echo $(p_l) >> debian/$(lib_binaries) + + trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp) +endef + +do_libgrs = $(call __do_libgrs,lib$(1)grs-$(GRS_SONAME),$(1)) +do_libgrs_dev = $(call __do_libgrs_dev,lib$(1)grs-$(BASE_VERSION)-dev,$(1)) + +# ---------------------------------------------------------------------- +$(binary_stamp)-grs-doc: $(build_html_stamp) $(install_stamp) + dh_testdir + dh_testroot + mv $(install_stamp) $(install_stamp)-tmp + + rm -rf $(d_grsd) + dh_installdirs -p$(p_grsd) \ + $(docdir)/$(p_grs) \ + $(docdir)/$(p_xbase)/rs \ + $(PF)/share/info + cp -p $(builddir)/gcc/doc/rs.info $(d_grsd)/$(PF)/share/info/grs.info + cp -p html/grs.html $(d_grsd)/$(docdir)/$(p_xbase)/rs/ + ln -sf ../$(p_xbase)/rs/grs.html $(d_grsd)/$(docdir)/$(p_grs)/grs.html + + debian/dh_doclink -p$(p_grsd) $(p_xbase) + dh_installdocs -p$(p_grsd) + rm -f $(d_grsd)/$(docdir)/$(p_xbase)/copyright + + echo $(p_grsd) >> debian/indep_binaries + + trap '' 1 2 3 15; touch $@; mv $(install_stamp)-tmp $(install_stamp) + + +$(binary_stamp)-libgrs: $(install_stamp) + $(call do_libgrs,) + +$(binary_stamp)-lib64grs: $(install_stamp) + $(call do_libgrs,64) + +$(binary_stamp)-lib32grs: $(install_stamp) + $(call do_libgrs,32) + +$(binary_stamp)-libn32grs: $(install_stamp) + $(call do_libgrs,n32) + +$(binary_stamp)-libx32grs: $(install_stamp) + $(call do_libgrs,x32) + +$(binary_stamp)-libhfgrs: $(install_stamp) + $(call do_libgrs,hf) + +$(binary_stamp)-libsfgrs: $(install_stamp) + $(call do_libgrs,sf) + + +$(binary_stamp)-libgrs-dev: $(install_stamp) + $(call do_libgrs_dev,) + +$(binary_stamp)-lib64grs-dev: $(install_stamp) + $(call do_libgrs_dev,64) + +$(binary_stamp)-lib32grs-dev: $(install_stamp) + $(call do_libgrs_dev,32) + +$(binary_stamp)-libx32grs-dev: $(install_stamp) + $(call do_libgrs_dev,x32) + +$(binary_stamp)-libn32grs-dev: $(install_stamp) + $(call do_libgrs_dev,n32) + +$(binary_stamp)-libhfgrs-dev: $(install_stamp) + $(call do_libgrs_dev,hf) + +$(binary_stamp)-libsfgrs-dev: $(install_stamp) + $(call do_libgrs_dev,sf) diff --git a/debian/rules.d/binary-snapshot.mk b/debian/rules.d/binary-snapshot.mk new file mode 100644 index 0000000..c8085e7 --- /dev/null +++ b/debian/rules.d/binary-snapshot.mk @@ -0,0 +1,209 @@ +arch_binaries := $(arch_binaries) snapshot + +ifneq (,$(findstring gcc-snapshot, $(PKGSOURCE))) + p_snap = gcc-snapshot +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 +ifeq ($(with_offload_nvptx),yes) + snapshot_depends += nvptx-tools, +endif +ifeq ($(with_offload_gcn),yes) + ifeq ($(gcn_tools_llvm_version),tools) + snapshot_depends += amdgcn-tools, + else + snapshot_depends += llvm-$(gcn_tools_llvm_version), lld-$(gcn_tools_llvm_version), + endif +endif + +common_substvars += '-Vsnap:depends=$(snapshot_depends)' '-Vsnap:recommends=$(snapshot_recommends)' + +# ---------------------------------------------------------------------- +$(binary_stamp)-snapshot: $(install_snap_stamp) \ + $(if $(filter yes, $(with_offload_nvptx)), $(install_nvptx_stamp)) \ + $(if $(filter yes, $(with_offload_gcn)), $(install_gcn_stamp)) + 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_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 + ln -sf gcc $(d_snap)/$(PF)/bin/cc +ifeq ($(with_ada),yes) + ln -sf gcc $(d_snap)/$(PF)/bin/gnatgcc +endif +ifeq ($(with_fortran),yes) + ln -sf gfortran $(d_snap)/$(PF)/bin/f77 +endif + +ifeq ($(with_offload_nvptx),yes) + tar -c -C $(d)-nvptx -f - $(PF) \ + | tar x -C $(d_snap) -f - + + rm -f $(d_snap)/$(PF)/bin/*-lto-dump + rm -f $(d_snap)/$(PF)/share/man/man1/*-accel-nvptx-none-*.1 + + : # re-create the symlinks as relative symlinks + dh_link -p$(p_snap) \ + /usr/bin/nvptx-none-ar /$(gcc_lexec_dir)/accel/nvptx-none/ar \ + /usr/bin/nvptx-none-as /$(gcc_lexec_dir)/accel/nvptx-none/as \ + /usr/bin/nvptx-none-ld /$(gcc_lexec_dir)/accel/nvptx-none/ld \ + /usr/bin/nvptx-none-ranlib /$(gcc_lexec_dir)/accel/nvptx-none/ranlib +endif + +ifeq ($(with_offload_gcn),yes) + tar -c -C $(d)-gcn -f - $(PF) \ + | tar x -C $(d_snap) -f - + + ifeq ($(gcn_tools_llvm_version),tools) + : # re-create the symlinks as relative symlinks + dh_link -p$(p_snap) \ + /usr/$(gcn_target_name)/bin/ar /$(gcc_lexec_dir)/accel/$(gcn_target_name)/ar \ + /usr/$(gcn_target_name)/bin/as /$(gcc_lexec_dir)/accel/$(gcn_target_name)/as \ + /usr/$(gcn_target_name)/bin/ld /$(gcc_lexec_dir)/accel/$(gcn_target_name)/ld \ + /usr/$(gcn_target_name)/bin/nm /$(gcc_lexec_dir)/accel/$(gcn_target_name)/nm \ + /usr/$(gcn_target_name)/bin/ranlib /$(gcc_lexec_dir)/accel/$(gcn_target_name)/ranlib + else + : # re-create the symlinks as relative symlinks + dh_link -p$(p_snap) \ + /usr/lib/llvm-$(gcn_tools_llvm_version)/bin/llvm-ar /$(gcc_lexec_dir)/accel/$(gcn_target_name)/ar \ + /usr/lib/llvm-$(gcn_tools_llvm_version)/bin/llvm-mc /$(gcc_lexec_dir)/accel/$(gcn_target_name)/as \ + /usr/lib/llvm-$(gcn_tools_llvm_version)/bin/lld /$(gcc_lexec_dir)/accel/$(gcn_target_name)/ld \ + /usr/lib/llvm-$(gcn_tools_llvm_version)/bin/llvm-nm /$(gcc_lexec_dir)/accel/$(gcn_target_name)/nm \ + /usr/lib/llvm-$(gcn_tools_llvm_version)/bin/llvm-ranlib /$(gcc_lexec_dir)/accel/$(gcn_target_name)/ranlib + + : # FIXME: are these really needed? + dh_link -p$(p_snap) \ + /usr/lib/llvm-$(gcn_tools_llvm_version)/bin/llvm-ar /$(PF)/bin/$(gcn_target_name)-ar \ + /usr/lib/llvm-$(gcn_tools_llvm_version)/bin/llvm-mc /$(PF)/bin/$(gcn_target_name)-as \ + /usr/lib/llvm-$(gcn_tools_llvm_version)/bin/lld /$(PF)/bin/$(gcn_target_name)-ld \ + /usr/lib/llvm-$(gcn_tools_llvm_version)/bin/llvm-nm /$(PF)/bin/$(gcn_target_name)-nm \ + /usr/lib/llvm-$(gcn_tools_llvm_version)/bin/llvm-ranlib /$(PF)/bin/$(gcn_target_name)-ranlib + rm -f $(d_snap)/$(PF)/bin/*-lto-dump + rm -f $(d_snap)/$(PF)/share/man/man1/*-accel-$(gcn_target_name)-*.1 + endif +endif + +ifeq ($(with_hppa64),yes) + : # provide as and ld links + dh_link -p $(p_snap) \ + /usr/bin/hppa64-linux-gnu-as \ + /$(PF)/lib/gcc/hppa64-linux-gnu/$(versiondir)/as \ + /usr/bin/hppa64-linux-gnu-ld \ + /$(PF)/lib/gcc/hppa64-linux-gnu/$(versiondir)/ld +endif + +ifeq ($(with_check),yes) + dh_installdocs -p$(p_snap) test-summary + cd $(d_snap) && tar xvf ../../installed-testlogs.tar + mv $(d_snap)/usr/share/doc/gcc-base/* $(d_snap)/usr/share/doc/$(p_snap)/. + rm -rf $(d_snap)/usr/share/doc/gcc-base +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_dwz -p$(p_snap) -Xdebug -X/cgo -Xbin/go -Xbin/gofmt \ +# $(if $(unstripped_exe),$(foreach i,cc1 cc1obj cc1objplus cc1plus cc1gm2 d21 f951 go1 lto1, -X/$(i))) + 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 cc1gm2 d21 f951 go1 lto1, -X/$(i))) +else +# dh_dwz -p$(p_snap) -Xdebug -X/cgo -Xbin/go -Xbin/gofmt \ +# $(if $(unstripped_exe),$(foreach i,cc1 cc1obj cc1objplus cc1plus cc1gm2 d21 f951 go1 lto1, -X/$(i))) + dh_strip -p$(p_snap) -Xdebug -X/cgo -Xbin/go -Xbin/gofmt \ + -X/lib{c,g,m,gcc,gomp,gcov,gfortran,caf_single,ssp,ssp_nonshared}.a \ + $(if $(unstripped_exe),$(foreach i,cc1 cc1obj cc1objplus cc1plus cc1gm2 d21 f951 go1 lto1, -X/$(i))) +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_EVERSION))'; \ + echo 'libobjc $(OBJC_SONAME) ${p_snap} (>= $(DEB_EVERSION))'; \ + echo 'libgfortran $(FORTRAN_SONAME) ${p_snap} (>= $(DEB_EVERSION))'; \ + echo 'libgo $(GO_SONAME) ${p_snap} (>= $(DEB_EVERSION))'; \ + echo 'libgomp $(GOMP_SONAME) ${p_snap} (>= $(DEB_EVERSION))'; \ + echo 'libgnat-$(GNAT_SONAME) 1 ${p_snap} (>= $(DEB_EVERSION))'; \ + echo 'libgnarl-$(GNAT_SONAME) 1 ${p_snap} (>= $(DEB_EVERSION))'; \ + ) > 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 + -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 + echo $(p_snap) >> debian/arch_binaries.epoch + + 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..6badfcc --- /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) + 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..9844826 --- /dev/null +++ b/debian/rules.d/binary-source.mk @@ -0,0 +1,54 @@ +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 (,$(m2_tarball)) + dh_install -p$(p_source) $(m2_tarball) usr/src/gcc$(pkg_ver) +endif + tar cf - $$(find './debian' -mindepth 1 \( \ + -name .svn -prune -o \ + -path './debian/.debhelper' -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 + rm -f $(d_source)/usr/src/gcc$(pkg_ver)/debian/patches/series + + 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 $@ diff --git a/debian/rules.d/binary-toolchain.mk b/debian/rules.d/binary-toolchain.mk new file mode 100644 index 0000000..a19d68c --- /dev/null +++ b/debian/rules.d/binary-toolchain.mk @@ -0,0 +1,210 @@ +arch_binaries := $(arch_binaries) toolchain + +ifneq (,$(findstring gcc-toolchain, $(PKGSOURCE))) + p_tc = gcc-toolchain-$(BASE_VERSION) +else + $(error unknown build for single gcc package) +endif + +ifeq ($(DEB_CROSS),yes) + p_tc := $(p_tc)$(cross_bin_arch) +endif +d_tc = debian/$(p_tc) + +dirs_tc = \ + $(docdir)/$(p_tc) \ + usr/lib + +ifeq ($(with_hppa64),yes) + snapshot_depends = $(binutils_hppa64), +endif +ifeq ($(with_offload_nvptx),yes) + snapshot_depends += nvptx-tools, +endif +ifeq ($(with_offload_gcn),yes) + ifeq ($(gcn_tools_llvm_version),tools) + snapshot_depends += amdgcn-tools, + else + snapshot_depends += llvm-$(gcn_tools_llvm_version), lld-$(gcn_tools_llvm_version), + endif +endif + +common_substvars += '-Vsnap:depends=$(snapshot_depends)' '-Vsnap:recommends=$(snapshot_recommends)' + +# ---------------------------------------------------------------------- +$(binary_stamp)-toolchain: $(install_tc_stamp) \ + $(if $(filter yes, $(with_offload_nvptx)), $(install_nvptx_stamp)) \ + $(if $(filter yes, $(with_offload_gcn)), $(install_gcn_stamp)) + dh_testdir + dh_testroot + mv $(install_tc_stamp) $(install_tc_stamp)-tmp + + rm -rf $(d_tc) + dh_installdirs -p$(p_tc) $(dirs_tc) + + mv $(d)/$(PF) $(d_tc)/usr/lib/ + + find $(d_tc) -name '*.gch' -type d | xargs -r rm -rf + find $(d_tc) -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_tc)/$(gcc_lib_dir)/$$d; \ + fi; \ + done + if [ -f $(buildlibdir)/libbacktrace/backtrace-supported.h ]; then \ + install -m644 $(buildlibdir)/libbacktrace/backtrace-supported.h \ + $(d_tc)/$(gcc_lib_dir)/include/; \ + install -m644 $(srcdir)/libbacktrace/backtrace.h \ + $(d_tc)/$(gcc_lib_dir)/include/; \ + fi + + rm -rf $(d_tc)/$(PF)/lib/nof + +ifeq ($(with_ada),yes FIXME: apply our ada patches) + dh_link -p$(p_tc) \ + $(gcc_lib_dir)/rts-sjlj/adalib/libgnat.a \ + $(gcc_lib_dir)/rts-sjlj/adalib/libgnat-$(GNAT_VERSION).a + dh_link -p$(p_tc) \ + $(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_tc)/$(gcc_lib_dir)/adalib/$$vlib.so.1 $(d_tc)/$(PF)/$(libdir)/. ; \ + rm -f $(d_tc)/$(gcc_lib_dir)/adalib/$$lib.so.1; \ + dh_link -p$(p_tc) \ + /$(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 + ln -sf gcc $(d_tc)/$(PF)/bin/cc +ifeq ($(with_ada),yes) + ln -sf gcc $(d_tc)/$(PF)/bin/gnatgcc +endif +ifeq ($(with_fortran),yes) + ln -sf gfortran $(d_tc)/$(PF)/bin/f77 +endif + +ifeq ($(with_offload_nvptx),yes) + tar -c -C $(d)-nvptx -f - $(PF) \ + | tar x -C $(d_tc) -f - + + rm -f $(d_tc)/$(PF)/bin/*-lto-dump + rm -f $(d_tc)/$(PF)/share/man/man1/*-accel-nvptx-none-*.1 + + : # re-create the symlinks as relative symlinks + dh_link -p$(p_tc) \ + /usr/bin/nvptx-none-ar /$(gcc_lexec_dir)/accel/nvptx-none/ar \ + /usr/bin/nvptx-none-as /$(gcc_lexec_dir)/accel/nvptx-none/as \ + /usr/bin/nvptx-none-ld /$(gcc_lexec_dir)/accel/nvptx-none/ld \ + /usr/bin/nvptx-none-ranlib /$(gcc_lexec_dir)/accel/nvptx-none/ranlib +endif + +ifeq ($(with_offload_gcn),yes) + tar -c -C $(d)-gcn -f - $(PF) \ + | tar x -C $(d_tc) -f - + + ifeq ($(gcn_tools_llvm_version),tools) + : # re-create the symlinks as relative symlinks + dh_link -p$(p_tc) \ + /usr/$(gcn_target_name)/bin/ar /$(gcc_lexec_dir)/accel/$(gcn_target_name)/ar \ + /usr/$(gcn_target_name)/bin/as /$(gcc_lexec_dir)/accel/$(gcn_target_name)/as \ + /usr/$(gcn_target_name)/bin/ld /$(gcc_lexec_dir)/accel/$(gcn_target_name)/ld \ + /usr/$(gcn_target_name)/bin/nm /$(gcc_lexec_dir)/accel/$(gcn_target_name)/nm \ + /usr/$(gcn_target_name)/bin/ranlib /$(gcc_lexec_dir)/accel/$(gcn_target_name)/ranlib + else + : # re-create the symlinks as relative symlinks + dh_link -p$(p_tc) \ + /usr/lib/llvm-$(gcn_tools_llvm_version)/bin/llvm-ar /$(gcc_lexec_dir)/accel/$(gcn_target_name)/ar \ + /usr/lib/llvm-$(gcn_tools_llvm_version)/bin/llvm-mc /$(gcc_lexec_dir)/accel/$(gcn_target_name)/as \ + /usr/lib/llvm-$(gcn_tools_llvm_version)/bin/lld /$(gcc_lexec_dir)/accel/$(gcn_target_name)/ld \ + /usr/lib/llvm-$(gcn_tools_llvm_version)/bin/llvm-nm /$(gcc_lexec_dir)/accel/$(gcn_target_name)/nm \ + /usr/lib/llvm-$(gcn_tools_llvm_version)/bin/llvm-ranlib /$(gcc_lexec_dir)/accel/$(gcn_target_name)/ranlib + + : # FIXME: are these really needed? + dh_link -p$(p_tc) \ + /usr/lib/llvm-$(gcn_tools_llvm_version)/bin/llvm-ar /$(PF)/bin/$(gcn_target_name)-ar \ + /usr/lib/llvm-$(gcn_tools_llvm_version)/bin/llvm-mc /$(PF)/bin/$(gcn_target_name)-as \ + /usr/lib/llvm-$(gcn_tools_llvm_version)/bin/lld /$(PF)/bin/$(gcn_target_name)-ld \ + /usr/lib/llvm-$(gcn_tools_llvm_version)/bin/llvm-nm /$(PF)/bin/$(gcn_target_name)-nm \ + /usr/lib/llvm-$(gcn_tools_llvm_version)/bin/llvm-ranlib /$(PF)/bin/$(gcn_target_name)-ranlib + rm -f $(d_tc)/$(PF)/bin/*-lto-dump + rm -f $(d_tc)/$(PF)/share/man/man1/*-accel-$(gcn_target_name)-*.1 + endif +endif + +ifeq ($(with_hppa64),yes) + : # provide as and ld links + dh_link -p $(p_tc) \ + /usr/bin/hppa64-linux-gnu-as \ + /$(PF)/lib/gcc/hppa64-linux-gnu/$(versiondir)/as \ + /usr/bin/hppa64-linux-gnu-ld \ + /$(PF)/lib/gcc/hppa64-linux-gnu/$(versiondir)/ld +endif + +ifeq ($(with_check),yes) + dh_installdocs -p$(p_tc) test-summary + cd $(d_tc) && tar xvf ../../installed-testlogs.tar + mv $(d_tc)/usr/share/doc/gcc-base/* $(d_tc)/usr/share/doc/$(p_tc)/. + rm -rf $(d_tc)/usr/share/doc/gcc-base +else + dh_installdocs -p$(p_tc) +endif + cp $(binutils_srcdir)/debian/copyright $(d_tc)/usr/share/doc/copyright.binutils + + if [ -f $(buildlibdir)/libstdc++-v3/testsuite/current_symbols.txt ]; \ + then \ + cp -p $(buildlibdir)/libstdc++-v3/testsuite/current_symbols.txt \ + $(d_tc)/$(docdir)/$(p_tc)/libstdc++6_symbols.txt; \ + fi + cp -p debian/README.snapshot \ + $(d_tc)/$(docdir)/$(p_tc)/README.Debian + cp -p debian/README.Bugs \ + $(d_tc)/$(docdir)/$(p_tc)/ + dh_installchangelogs -p$(p_tc) +ifeq ($(DEB_TARGET_ARCH),hppa) +# dh_dwz -p$(p_tc) -Xdebug -X/cgo -Xbin/go -Xbin/gofmt \ +# $(if $(unstripped_exe),$(foreach i,cc1 cc1obj cc1objplus cc1plus cc1gm2 d21 f951 go1 lto1, -X/$(i))) + dh_strip -p$(p_tc) -Xdebug -X.o -X.a -X/cgo -Xbin/go -Xbin/gofmt \ + $(if $(unstripped_exe),$(foreach i,cc1 cc1obj cc1objplus cc1plus cc1gm2 d21 f951 go1 lto1, -X/$(i))) +else +# dh_dwz -p$(p_tc) -Xdebug -X/cgo -Xbin/go -Xbin/gofmt \ +# $(if $(unstripped_exe),$(foreach i,cc1 cc1obj cc1objplus cc1plus cc1gm2 d21 f951 go1 lto1, -X/$(i))) + dh_strip -p$(p_tc) -Xdebug -X/cgo -Xbin/go -Xbin/gofmt \ + -X/lib{c,g,m,gcc,gomp,gcov,gfortran,caf_single,ssp,ssp_nonshared}.a \ + $(if $(unstripped_exe),$(foreach i,cc1 cc1obj cc1objplus cc1plus cc1gm2 d21 f951 go1 lto1, -X/$(i))) +endif + + mkdir -p $(d_tc)/usr/share/lintian/overrides + cp -p debian/gcc-snapshot.overrides \ + $(d_tc)/usr/share/lintian/overrides/$(p_tc) + + ( \ + echo 'libgcc_s $(GCC_SONAME) ${p_tc} (>= $(DEB_EVERSION))'; \ + echo 'libobjc $(OBJC_SONAME) ${p_tc} (>= $(DEB_EVERSION))'; \ + echo 'libgfortran $(FORTRAN_SONAME) ${p_tc} (>= $(DEB_EVERSION))'; \ + echo 'libgo $(GO_SONAME) ${p_tc} (>= $(DEB_EVERSION))'; \ + echo 'libgomp $(GOMP_SONAME) ${p_tc} (>= $(DEB_EVERSION))'; \ + echo 'libgnat-$(GNAT_SONAME) 1 ${p_tc} (>= $(DEB_EVERSION))'; \ + echo 'libgnarl-$(GNAT_SONAME) 1 ${p_tc} (>= $(DEB_EVERSION))'; \ + ) > debian/shlibs.local + + $(ignshld)DIRNAME=$(subst n,,$(2)) $(cross_shlibdeps) \ + dh_shlibdeps -p$(p_tc) -l$(CURDIR)/$(d_tc)/$(PF)/lib:$(CURDIR)/$(d_tc)/$(PF)/$(if $(filter $(DEB_TARGET_ARCH),amd64 ppc64),lib32,lib64):/usr/$(DEB_TARGET_GNU_TYPE)/lib + -sed -i -e 's/$(p_tc)[^,]*, //g' debian/$(p_tc).substvars + +ifeq ($(with_multiarch_lib),yes) + : # paths needed for relative lookups from startfile_prefixes + for ma in $(xarch_multiarch_names); do \ + mkdir -p $(d_tc)/lib/$$ma; \ + mkdir -p $(d_tc)/usr/lib/$$ma; \ + done +endif + echo $(p_tc) >> debian/arch_binaries.epoch + + trap '' 1 2 3 15; touch $@; mv $(install_tc_stamp)-tmp $(install_tc_stamp) |