diff options
Diffstat (limited to '')
37 files changed, 7759 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) diff --git a/debian/rules.defs b/debian/rules.defs new file mode 100644 index 0000000..48a89f9 --- /dev/null +++ b/debian/rules.defs @@ -0,0 +1,2334 @@ +# -*- makefile -*- +# definitions used in more than one Makefile / rules file + +# common vars +SHELL = /bin/bash -e # brace expansion used in rules file +srcdir = $(CURDIR)/src +builddir = $(CURDIR)/build +builddir_jit = $(CURDIR)/build-jit +builddir_nvptx = $(CURDIR)/build-nvptx +builddir_gcn = $(CURDIR)/build-gcn +builddir_hppa64 = $(CURDIR)/build-hppa64 +stampdir = stamps + +distribution := $(shell lsb_release -is) +distrelease := $(shell lsb_release -cs) +derivative := $(shell if dpkg-vendor --derives-from Ubuntu; then echo Ubuntu; \ + elif dpkg-vendor --derives-from Debian; then echo Debian; \ + else echo Unknown; fi) + +# On non official archives, "lsb_release -cs" default to "n/a". Assume +# sid in that case +ifeq ($(distrelease),n/a) +distrelease := sid +endif + +on_buildd := $(shell [ -f /CurrentlyBuilding -o "$$LOGNAME" = buildd ] && echo yes) + +# creates {srcdir,builddir}_hppa64 +$(foreach x,srcdir builddir,$(foreach target,hppa64,$(eval \ + $(x)_$(target) := $($(x))-$(target)))) + +# for architecture dependent variables and changelog vars +vafilt = $(subst $(2)=,,$(filter $(2)=%,$(1))) +# for rules.sonames +vafilt_defined = 1 + +dpkg_target_vars := $(shell (dpkg-architecture | grep -q DEB_TARGET) && echo yes) +ifeq ($(dpkg_target_vars),yes) + DEB_TARGET_ARCH= + DEB_TARGET_ARCH_BITS= + DEB_TARGET_ARCH_CPU= + DEB_TARGET_ARCH_ENDIAN= + DEB_TARGET_ARCH_OS= + DEB_TARGET_GNU_CPU= + DEB_TARGET_GNU_SYSTEM= + DEB_TARGET_GNU_TYPE= + DEB_TARGET_MULTIARCH= +endif + +DPKG_VARS := $(shell dpkg-architecture) +ifeq ($(dpkg_target_vars),yes) + DPKG_VARS := $(filter-out DEB_TARGET_%, $(DPKG_VARS)) +endif +DEB_BUILD_ARCH ?= $(call vafilt,$(DPKG_VARS),DEB_BUILD_ARCH) +DEB_BUILD_GNU_TYPE ?= $(call vafilt,$(DPKG_VARS),DEB_BUILD_GNU_TYPE) +DEB_BUILD_MULTIARCH ?= $(call vafilt,$(DPKG_VARS),DEB_BUILD_MULTIARCH) +DEB_HOST_ARCH ?= $(call vafilt,$(DPKG_VARS),DEB_HOST_ARCH) +DEB_HOST_GNU_CPU ?= $(call vafilt,$(DPKG_VARS),DEB_HOST_GNU_CPU) +DEB_HOST_GNU_SYSTEM ?= $(call vafilt,$(DPKG_VARS),DEB_HOST_GNU_SYSTEM) +DEB_HOST_GNU_TYPE ?= $(call vafilt,$(DPKG_VARS),DEB_HOST_GNU_TYPE) +DEB_HOST_MULTIARCH ?= $(call vafilt,$(DPKG_VARS),DEB_HOST_MULTIARCH) + +ifeq ($(derivative),Ubuntu) + ifeq (,$(filter $(distrelease), precise trusty)) + ifeq ($(DEB_BUILD_GNU_TYPE),i486-linux-gnu) + DEB_BUILD_GNU_TYPE = i686-linux-gnu + endif + ifeq ($(DEB_HOST_GNU_TYPE),i486-linux-gnu) + DEB_HOST_GNU_TYPE = i686-linux-gnu + endif + endif +else + ifneq (,$(filter $(distrelease),jessie)) + ifeq ($(DEB_HOST_GNU_TYPE),i486-linux-gnu) + DEB_HOST_GNU_TYPE = i586-linux-gnu + endif + else + # stretch and newer ... + DEB_BUILD_GNU_TYPE := $(subst i586,i686,$(DEB_BUILD_GNU_TYPE)) + DEB_HOST_GNU_TYPE := $(subst i586,i686,$(DEB_HOST_GNU_TYPE)) + endif +endif + +CHANGELOG_VARS := $(shell dpkg-parsechangelog | \ + sed -n 's/ /_/g;/^[^_]/s/^\([^:]*\):_\(.*\)/\1=\2/p') + +# the name of the source package +PKGSOURCE := $(call vafilt,$(CHANGELOG_VARS),Source) +# those are required here too +SOURCE_VERSION := $(call vafilt,$(CHANGELOG_VARS),Version) +DEB_VERSION := $(strip $(shell echo $(SOURCE_VERSION) | \ + sed -e 's/.*://' -e 's/ds[0-9][0-9]*//')) +# epoch used for gcc versions up to 3.3.x, now used for some remaining +# libraries: libgcc1, libobjc1 +EPOCH := 1 +DEB_EVERSION := $(EPOCH):$(DEB_VERSION) +BASE_VERSION := $(shell echo $(DEB_VERSION) | sed -e 's/\([0-9][0-9]*\).*-.*/\1/') + +NJOBS := +USE_CPUS := 1 +ifneq (,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS)))) + USE_CPUS := $(subst parallel=,,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS)))) + NJOBS := -j $(USE_CPUS) + NJOBS_TESTS := -j $(USE_CPUS) +endif + +CPUS_LTOLINK := $(if $(filter 1, $(USE_CPUS)),1,$(shell expr $(USE_CPUS) / 2)) +ifeq ($(derivative)-$(DEB_BUILD_ARCH),Ubuntu-ppc64el) + CPUS_LTOLINK := 1 +else ifeq ($(derivative)-$(DEB_BUILD_ARCH),Debian-sparc64) + CPUS_LTOLINK := $(shell if test $(CPUS_LTOLINK) -gt 4; then echo 4; else echo $(CPUS_LTOLINK); fi) +endif + +ifneq (,$(findstring gcc-snapshot, $(PKGSOURCE))) + single_package = yes + trunk_build = yes +else ifneq (,$(findstring gcc-toolchain, $(PKGSOURCE))) + single_package = yes + with_binutils = yes +else + # --program-suffix=-$(BASE_VERSION) + versioned_packages := yes +endif + +# push glibc stack traces into stderr +export LIBC_FATAL_STDERR_=1 + +# --------------------------------------------------------------------------- +# set target +# - GNU triplet via DEB_TARGET_GNU_TYPE +# - Debian arch in debian/target +# - Debian arch via DEB_GCC_TARGET or GCC_TARGET +# +# alias +ifdef GCC_TARGET + DEB_GCC_TARGET := $(GCC_TARGET) +endif +ifdef DEB_TARGET_GNU_TYPE + TARGET_VARS := $(shell dpkg-architecture -f -t$(DEB_TARGET_GNU_TYPE) 2>/dev/null) +else + # allow debian/target to be used instead of DEB_GCC_TARGET - this was requested + # by toolchain-source maintainer + DEBIAN_TARGET_FILE := $(strip $(if $(wildcard debian/target),$(shell cat debian/target 2>/dev/null))) + ifndef DEB_TARGET_ARCH + ifneq (,$(DEBIAN_TARGET_FILE)) + DEB_TARGET_ARCH := $(DEBIAN_TARGET_FILE) + else + ifdef DEB_GCC_TARGET + DEB_TARGET_ARCH := $(DEB_GCC_TARGET) + else + DEB_TARGET_ARCH := $(DEB_HOST_ARCH) + endif + endif + endif + TARGET_VARS := $(shell dpkg-architecture -f -a$(DEB_TARGET_ARCH) 2>/dev/null) +endif +ifeq ($(dpkg_target_vars),yes) + TARGET_VARS := $(filter-out DEB_TARGET_%, $(TARGET_VARS)) +endif + +DEB_TARGET_ARCH := $(call vafilt,$(TARGET_VARS),DEB_HOST_ARCH) +DEB_TARGET_ARCH_OS := $(call vafilt,$(TARGET_VARS),DEB_HOST_ARCH_OS) +DEB_TARGET_ARCH_CPU := $(call vafilt,$(TARGET_VARS),DEB_HOST_ARCH_CPU) +DEB_TARGET_GNU_CPU := $(call vafilt,$(TARGET_VARS),DEB_HOST_GNU_CPU) +DEB_TARGET_GNU_TYPE := $(call vafilt,$(TARGET_VARS),DEB_HOST_GNU_TYPE) +DEB_TARGET_GNU_SYSTEM := $(call vafilt,$(TARGET_VARS),DEB_HOST_GNU_SYSTEM) +DEB_TARGET_MULTIARCH := $(call vafilt,$(TARGET_VARS),DEB_HOST_MULTIARCH) +DEB_TARGET_ARCH_ABI := $(call vafilt,$(TARGET_VARS),DEB_HOST_ARCH_ABI) +DEB_TARGET_ARCH_BITS := $(call vafilt,$(TARGET_VARS),DEB_HOST_ARCH_BITS) +DEB_TARGET_ARCH_ENDIAN := $(call vafilt,$(TARGET_VARS),DEB_HOST_ARCH_ENDIAN) +DEB_TARGET_ARCH_LIBC := $(call vafilt,$(TARGET_VARS),DEB_HOST_ARCH_LIBC) +export DEB_TARGET_ARCH DEB_TARGET_ARCH_ABI DEB_TARGET_ARCH_BITS \ + DEB_TARGET_ARCH_CPU DEB_TARGET_ARCH_OS DEB_TARGET_ARCH_ENDIAN \ + DEB_TARGET_ARCH_LIBC DEB_TARGET_GNU_CPU DEB_TARGET_GNU_TYPE \ + DEB_TARGET_GNU_SYSTEM DEB_TARGET_MULTIARCH + +ifneq (,$(filter $(distrelease),stretch)) + DEB_TARGET_GNU_TYPE := $(subst i586,i686,$(DEB_TARGET_GNU_TYPE)) + i586_symlinks = $(if $(findstring i686,$(DEB_TARGET_GNU_TYPE)),yes) +endif + +ifeq ($(DEB_TARGET_ARCH),) + $(error Invalid architecure.) +endif + +# Force this, people get confused about the default. See #760770. +override with_deps_on_target_arch_pkgs := + +# including unversiond symlinks for binaries +#with_unversioned = yes + +# --------------------------------------------------------------------------- +# cross-compiler config +ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) + ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_TARGET_GNU_TYPE)) + # cross building a cross compiler, untested. + DEB_CROSS = yes + build_type = cross-build-cross + else + # cross building the native compiler + build_type = cross-build-native + endif +else + ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_TARGET_GNU_TYPE)) + # cross compiler, sets WITH_SYSROOT on it's own + DEB_CROSS = yes + build_type = build-cross + else ifeq ($(FORCE_CROSS_LAYOUT),yes) + # a native build with a cross layout + DEB_CROSS = yes + build_type = build-cross + else + # native build + build_type = build-native + endif +endif + +# --------------------------------------------------------------------------- +# cross compiler support +ifeq ($(DEB_CROSS),yes) + # TARGET: Alias to DEB_TARGET_ARCH (Debian arch name) + # TP: Target Prefix. Used primarily as a prefix for cross tool + # names (e.g. powerpc-linux-gcc). + # TS: Target Suffix. Used primarily at the end of cross compiler + # package names (e.g. gcc-powerpc). + # LS: Library Suffix. Used primarily at the end of cross compiler + # library package names (e.g. libgcc-powerpc-cross). + # AQ: Arch Qualifier. Used for cross-arch dependencies + DEB_TARGET_ALIAS ?= $(DEB_TARGET_GNU_TYPE) + TARGET := $(DEB_TARGET_ARCH) + TP := $(subst _,-,$(DEB_TARGET_GNU_TYPE))- + TS := -$(subst _,-,$(DEB_TARGET_ALIAS)) + LS := -$(subst _,-,$(DEB_TARGET_ARCH))-cross + AQ := + + cross_bin_arch := -$(subst _,-,$(DEB_TARGET_ALIAS)) + cross_lib_arch := -$(subst _,-,$(DEB_TARGET_ARCH))-cross + cmd_prefix := $(DEB_TARGET_GNU_TYPE)- + + TARGET_ALIAS := $(DEB_TARGET_ALIAS) + + lib_binaries := indep_binaries + cross_shlibdeps = DEB_HOST_ARCH=$(TARGET) ARCH=$(DEB_TARGET_ARCH) MAKEFLAGS="CC=something" + cross_gencontrol = DEB_HOST_ARCH=$(TARGET) + cross_makeshlibs = DEB_HOST_ARCH=$(TARGET) + cross_clean = DEB_HOST_ARCH=$(TARGET) +else + TARGET_ALIAS := $(DEB_TARGET_GNU_TYPE) + + ifeq ($(TARGET_ALIAS),i386-gnu) + TARGET_ALIAS := i586-gnu + endif + + ifeq ($(single_package),yes) + cmd_prefix := + unprefixed_names := + else + cmd_prefix := $(DEB_TARGET_GNU_TYPE)- + unprefixed_names := yes + endif + + #ifeq ($(TARGET_ALIAS),i486-linux-gnu) + # TARGET_ALIAS := i686-linux-gnu + #endif + + TARGET_ALIAS := $(subst i386,i486,$(TARGET_ALIAS)) + + # configure as linux-gnu, not linux + #ifeq ($(findstring linux,$(TARGET_ALIAS))/$(findstring linux-gnu,$(TARGET_ALIAS)),linux/) + # TARGET_ALIAS := $(TARGET_ALIAS)-gnu + #endif + + # configure as linux, not linux-gnu + #TARGET_ALIAS := $(subst linux-gnu,linux,$(TARGET_ALIAS)) + + lib_binaries := arch_binaries + cross_shlibdeps := + cross_gencontrol := + cross_makeshlibs := + # FIXME: Ignore missing symbols for a first build ... + cross_makeshlibs := - + cross_clean := +endif + +printarch: + @echo DEB_TARGET_ARCH: $(DEB_TARGET_ARCH) + @echo DEB_TARGET_ARCH_OS: $(DEB_TARGET_ARCH_OS) + @echo DEB_TARGET_ARCH_CPU: $(DEB_TARGET_ARCH_CPU) + @echo DEB_TARGET_GNU_SYSTEM: $(DEB_TARGET_GNU_SYSTEM) + @echo DEB_TARGET_MULTIARCH: $(DEB_TARGET_MULTIARCH) + @echo MULTIARCH_CONFARG: $(MULTIARCH_CONFARG) + @echo TARGET_ALIAS: $(TARGET_ALIAS) + @echo TP: $(TP) + @echo TS: $(TS) + +# reaching the 50GB limit ... +ifeq ($(derivative)-$(build_type),Ubuntu-build-native) + ifneq (,$(filter $(DEB_HOST_ARCH),amd64)) + save_disk_space = yes + endif +endif + +# ------------------------------------------------------------------- +# bootstrap options +ifdef WITH_BOOTSTRAP + # "yes" is the default and causes a 3-stage bootstrap. + # "off" runs a complete build with --disable-bootstrap + # "no" means to just build the first stage, and not create the stage1 + # directory. + # "lean" means a lean 3-stage bootstrap, i.e. delete each stage when no + # longer needed. + with_bootstrap = $(WITH_BOOTSTRAP) +endif + +# gcc-snapshot ... +ifeq ($(trunk_build),yes) + ifeq ($(build_type),build-native) + ifneq (,$(filter $(DEB_HOST_ARCH), amd64 i386 armhf arm64 powerpc ppc64 ppc64el riscv64 s390x sparc64)) + with_bootstrap := profiled + endif + endif + + # Enable LTO only for 64bit builds + ifeq ($(DEB_BUILD_ARCH_BITS)-$(DEB_HOST_ARCH_BITS),64-64) + with_lto_build := yes + endif + + # FIXME, disable LTO build for some archs + ifneq (,$(filter $(DEB_HOST_ARCH), alpha ia64 mips64el hurd-amd64)) + with_lto_build := yes + endif +endif + +ifneq ($(trunk_build),yes) + ifeq ($(build_type),build-native) + ifeq (,$(DEB_STAGE)) + ifeq (,$(filter $(distrelease), jessie stretch precise trusty xenial bionic)) + ifneq (,$(filter $(DEB_HOST_ARCH), amd64 i386 armhf arm64 powerpc ppc64 ppc64el s390x sparc64)) + with_bootstrap := profiled + endif + endif + endif + endif + + # Enable LTO only for 64bit builds + ifeq ($(DEB_BUILD_ARCH_BITS)-$(DEB_HOST_ARCH_BITS),64-64) + with_lto_build := yes + endif + + # FIXME: hppa has issues with parsing the jobs output. + # FIXME: m68k and sh4 running on simulators, don't care ... + # FIXME: buildds not powerful ebough: mips* + # FIXME: just let it build, takes too long: hurd-amd64 hurd-i386 + # FIXME: not yet tried to build: alpha + # FIXME: ia64, see https://gcc.gnu.org/PR98504 + # FIXME: mips64el requested by syq + ifneq (,$(filter $(DEB_HOST_ARCH), alpha hppa ia64 m68k mips mipsel mips64el sh4 sparc64 hurd-amd64 hurd-i386)) + with_lto_build := + endif + + # FIXME: newer binutils needed? + ifneq (,$(filter $(distrelease),stretch precise trusty xenial bionic focal)) + with_bootstrap := + with_lto_build := + endif + #with_bootstrap := + #with_lto_build := +endif + +#with_lto_build := disabled for GCC 13 + +ifneq ($(findstring nostrap, $(DEB_BUILD_OPTIONS)),) + with_bootstrap := off +endif + +ifneq ($(findstring nolto, $(DEB_BUILD_OPTIONS)),) + with_lto_build := +endif + +ifneq ($(findstring nopgo, $(DEB_BUILD_OPTIONS)),) + ifeq ($(with_bootstrap),profiled) + with_bootstrap := + endif +endif + +ifneq ($(findstring gccdebug, $(DEB_BUILD_OPTIONS)),) + with_bootstrap := off + with_lto_build := + DEB_BUILD_OPTIONS := $(DEB_BUILD_OPTIONS) nostrip + export DEB_BUILD_OPTIONS +endif + +ifeq ($(build_type),build-native) + usage_stats = yes + ifeq ($(derivative),Ubuntu) + no_usage_archs = i386 + else ifeq ($(derivative),Debian) + no_usage_archs = alpha hppa ia64 m68k mipsel mips64el sh4 sparc64 x32 \ + hurd-amd64 hurd-i386 kfreebsd-amd64 kfreebsd-i386 + endif + ifneq (,$(filter $(DEB_HOST_ARCH),$(no_usage_archs))) + usage_stats = + endif +endif +usage_stats = disabled for release builds + +# ------------------------------------------------------------------- +# stage options +ifdef DEB_STAGE + with_cdev := yes + separate_lang := yes + # "stage1" is minimal compiler with static libgcc + # "stage2" is minimal compiler with shared libgcc + # "rtlibs" is a subset of target libraries, without compilers + ifeq ($(DEB_STAGE),stage1) + with_shared_libgcc := no + endif + ifeq ($(DEB_STAGE),stage2) + with_libgcc := yes + with_shared_libgcc := yes + endif + ifeq ($(DEB_STAGE),rtlibs) + with_rtlibs := libgcc libgomp libstdc++ libgfortran libquadmath + ifeq ($(DEB_CROSS),yes) + LS := + TS := + cross_lib_arch := + endif + endif +endif + +ifeq ($(BACKPORT),true) + with_dev := no + with_source := yes + with_base_only := yes +endif + +# ------------------------------------------------------------------- +# sysroot options +ifdef WITH_SYSROOT + with_sysroot = $(WITH_SYSROOT) +endif +ifdef WITH_BUILD_SYSROOT + with_build_sysroot = $(WITH_BUILD_SYSROOT) +endif + +# ------------------------------------------------------------------- +# for components configuration + +COMMA = , +SPACE = $(EMPTY) $(EMPTY) + +# lang= overwrites all of nolang=, overwrites all of WITHOUT_LANG + +DEB_LANG_OPT := $(filter lang=%,$(DEB_BUILD_OPTIONS)) +DEB_LANG := $(strip $(subst $(COMMA), ,$(patsubst lang=%,%,$(DEB_LANG_OPT)))) +DEB_NOLANG_OPT := $(filter nolang=%,$(DEB_BUILD_OPTIONS)) +DEB_NOLANG := $(strip $(subst $(COMMA), ,$(patsubst nolang=%,%,$(DEB_NOLANG_OPT)))) +lfilt = $(strip $(if $(DEB_LANG), \ + $(if $(filter $(1) $(2),$(DEB_LANG)),yes),$(3))) +nlfilt = $(strip $(if $(DEB_NOLANG), \ + $(if $(filter $(1) $(2),$(DEB_NOLANG)),disabled by $(DEB_NOLANG_OPT),$(3)))) +wlfilt = $(strip $(if $(filter $(1) $(2), $(subst $(COMMA), ,$(WITHOUT_LANG))), \ + disabled by WITHOUT_LANG=$(WITHOUT_LANG),$(3))) +envfilt = $(strip $(or $(call lfilt,$(1),$(2)),$(call nlfilt,$(1),$(3)),$(call wlfilt,$(1),$(3)),$(4))) + +# ------------------------------------------------------------------- +# architecture specific config + +ifneq (,$(filter $(DEB_TARGET_ARCH), amd64 arm64 i386 ppc64 ppc64el s390x x32)) + with_async_unwind = yes +endif + +ifeq ($(derivative),Ubuntu) + ifeq (,$(filter $(distrelease),precise trusty xenial bionic)) + ifneq (,$(filter $(DEB_TARGET_ARCH), amd64 arm64 i386 ppc64 ppc64el s390x x32)) + with_stack_clash := yes + endif + endif + ifeq (,$(filter $(distrelease),precise trusty xenial bionic)) + ifneq (,$(filter $(DEB_TARGET_ARCH), amd64 i386 x32)) + with_cf_protection := yes + endif + endif +endif + +ifeq ($(DEB_TARGET_ARCH),armhf) + ifeq ($(distribution),Raspbian) + with_arm_thumb := no + else + with_arm_thumb := yes + endif +else + ifeq ($(derivative)-$(DEB_TARGET_ARCH),Ubuntu-armel) + ifneq (,$(filter $(distrelease), precise)) + with_arm_thumb := yes + endif + endif +endif + +# build using fsf or the ibm branch +ifeq ($(distribution),Ubuntu) + ifneq (,$(findstring $(DEB_TARGET_ARCH),ppc64el)) + #with_ibm_branch = yes + endif +endif + +ifneq (,$(findstring gcc-snapshot, $(PKGSOURCE))) + with_ibm_branch = +endif + +# check if we're building for armel or armhf +ifneq (,$(filter %eabihf,$(DEB_TARGET_GNU_SYSTEM))) + float_abi := hard +else ifneq (,$(filter $(distribution)-$(DEB_TARGET_ARCH), Ubuntu-armel)) + ifneq (,$(filter $(distrelease), precise)) + float_abi := softfp + else + float_abi := soft + endif +else ifneq (,$(filter $(DEB_TARGET_ARCH), arm armel)) + float_abi := soft +endif + +# ------------------------------------------------------------------- +# basic config + +# allows to wrote backtraces for ICEs +unstripped_exe = +#ifneq (,$(filter $(DEB_TARGET_ARCH), amd64 armel armhf arm64 mipsel mips64el ppc64el s390x)) +# unstripped_exe = yes +#endif + +# common things --------------- +# build common packages, where package names don't differ in different +# gcc versions (fixincludes, ...) +with_common_pkgs := yes +# ... and some libraries, which do not change (libgcc1, libssp0). +with_common_libs := yes +# XXX: should with_common_libs be "yes" only if this is the default compiler +# version on the targeted arch? + +# build -dbg packages (with_dbg is empty when -dbg package are not built) +ifneq (,$(filter $(distrelease), jessie stretch buster precise trusty xenial bionic)) + with_dbg = yes +else + ifeq ($(derivative),Ubuntu) + v_dbg = 9.2.1-21ubuntu1 + else ifeq ($(derivative),Debian) + v_dbg = 9.2.1-21 + else + $(error unknown version for -dbgsym package migration) + endif +endif + +# is this a multiarch-enabled build? +#ifneq (,$(filter $(distrelease), FIXME when removing multilib)) + with_multiarch_lib := yes +#endif + +ifeq ($(with_multiarch_lib),yes) + ifneq ($(single_package),yes) + ifneq ($(DEB_CROSS),yes) + with_multiarch_cxxheaders := yes + endif + endif +endif + +multiarch_stage1 := yes + +MIPS_R6_ENABLED = no +ifeq (,$(filter $(distrelease), jessie precise trusty xenial)) + MIPS_R6_ENABLED = yes +endif + +# mapping for the non-default biarch multilib / multiarch names +multiarch_xarch_map = \ + amd64=i386-linux-gnu,x86_64-linux-gnux32 \ + armel=arm-linux-gnueabi \ + armhf=arm-linux-gnueabihf \ + i386=x86_64-linux-gnu,x86_64-linux-gnux32 \ + powerpc=powerpc64-linux-gnu \ + ppc64=powerpc-linux-gnu \ + sparc=sparc64-linux-gnu \ + sparc64=sparc-linux-gnu \ + s390=s390x-linux-gnu \ + s390x=s390-linux-gnu \ + mips=mips64-linux-gnuabin32,mips64-linux-gnuabi64 \ + mipsel=mips64el-linux-gnuabin32,mips64el-linux-gnuabi64 \ + mipsn32=mips-linux-gnu,mips64-linux-gnuabi64 \ + mipsn32el=mipsel-linux-gnu,mips64el-linux-gnuabi64 \ + mips64=mips-linux-gnu,mips64-linux-gnuabin32 \ + mips64el=mipsel-linux-gnu,mips64el-linux-gnuabin32 \ + mipsr6=mipsisa64r6-linux-gnuabin32,mipsisa64r6-linux-gnuabi64 \ + mipsr6el=mipsisa64r6el-linux-gnuabin32,mipsisa64r6el-linux-gnuabi64 \ + mipsn32r6=mipsisa32r6-linux-gnu,mipsisa64r6-linux-gnuabi64 \ + mipsn32r6el=mipsisa32r6el-linux-gnu,mipsisa64r6el-linux-gnuabi64 \ + mips64r6=mipsisa32r6-linux-gnu,mipsisa64r6-linux-gnuabin32 \ + mips64r6el=mipsisa32r6el-linux-gnu,mipsisa64r6el-linux-gnuabin32 \ + x32=x86_64-linux-gnu,i386-linux-gnu \ + kfreebsd-amd64=i386-kfreebsd-gnu +xarch_multiarch_names = $(subst $(COMMA),$(SPACE),$(patsubst $(DEB_TARGET_ARCH)=%,%, \ + $(filter $(DEB_TARGET_ARCH)=%,$(multiarch_xarch_map)))) + +multilib_multiarch_map = \ + $(DEB_TARGET_ARCH)/=$(DEB_TARGET_MULTIARCH) \ + amd64/32=i386-linux-gnu \ + amd64/x32=x86_64-linux-gnux32 \ + armel/hf=arm-linux-gnueabihf \ + armhf/sf=arm-linux-gnueabi \ + i386/64=x86_64-linux-gnu \ + i386/x32=x86_64-linux-gnux32 \ + powerpc/64=powerpc64-linux-gnu \ + ppc64/32=powerpc-linux-gnu \ + sparc/64=sparc64-linux-gnu \ + sparc64/32=sparc-linux-gnu \ + s390/64=s390x-linux-gnu \ + s390x/32=s390-linux-gnu \ + mips/n32=mips64-linux-gnuabin32 \ + mips/64=mips64-linux-gnuabi64 \ + mipsel/n32=mips64el-linux-gnuabin32 \ + mipsel/64=mips64el-linux-gnuabi64 \ + mipsn32/32=mips-linux-gnu \ + mipsn32/64=mips64-linux-gnuabi64 \ + mipsn32el/32=mipsel-linux-gnu \ + mipsn32el/64=mips64el-linux-gnuabi64 \ + mips64/32=mips-linux-gnu \ + mips64/n32=mips64-linux-gnuabin32 \ + mips64el/32=mipsel-linux-gnu \ + mips64el/n32=mips64el-linux-gnuabin32 \ + mipsr6/n32=mipsisa64r6-linux-gnuabin32 \ + mipsr6/64=mipsisa64r6-linux-gnuabi64 \ + mipsr6el/n32=mipsisa64r6el-linux-gnuabin32 \ + mipsr6el/64=mipsisa64r6el-linux-gnuabi64 \ + mipsn32r6/32=mipsisa32r6-linux-gnu \ + mipsn32r6/64=mipsisa64r6-linux-gnuabi64 \ + mipsn32r6el/32=mipsisa32r6el-linux-gnu \ + mipsn32r6el/64=mipsisa64r6el-linux-gnuabi64 \ + mips64r6/32=mipsisa32r6-linux-gnu \ + mips64r6/n32=mipsisa64r6-linux-gnuabin32 \ + mips64r6el/32=mipsisa32r6el-linux-gnu \ + mips64r6el/n32=mipsisa64r6el-linux-gnuabin32 \ + x32/32=i386-linux-gnu \ + x32/64=x86_64-linux-gnu \ + kfreebsd-amd64/32=i386-kfreebsd-gnu +# $(call mlib_to_march,<empty>|32|64|n32|x32|hf|sf) +mlib_to_march = $(patsubst $(DEB_TARGET_ARCH)/$(1)=%,%, \ + $(filter $(DEB_TARGET_ARCH)/$(1)=%,$(multilib_multiarch_map))) + +multilib_arch_map = \ + $(DEB_TARGET_ARCH)/=$(DEB_TARGET_ARCH) \ + amd64/32=i386 \ + amd64/x32=x32 \ + armel/hf=armhf \ + armhf/sf=armel \ + i386/64=amd64 \ + i386/x32=x32 \ + powerpc/64=ppc64 \ + ppc64/32=powerpc \ + sparc/64=sparc64 \ + sparc64/32=sparc \ + s390/64=s390x \ + s390x/32=s390 \ + mips/n32=mipsn32 \ + mips/64=mips64 \ + mipsel/n32=mipsn32el \ + mipsel/64=mips64el \ + mipsn32/32=mips \ + mipsn32/64=mips64 \ + mipsn32el/32=mipsel \ + mipsn32el/64=mips64el \ + mips64/32=mips \ + mips64/n32=mipsn32 \ + mips64el/32=mipsel \ + mips64el/n32=mipsn32el \ + mipsr6/n32=mipsn32r6 \ + mipsr6/64=mips64r6 \ + mipsr6el/n32=mipsn32r6el \ + mipsr6el/64=mips64r6el \ + mipsn32r6/32=mipsr6 \ + mipsn32r6/64=mips64r6 \ + mipsn32r6el/32=mipsr6el \ + mipsn32r6el/64=mips64r6el \ + mips64r6/32=mipsr6 \ + mips64r6/n32=mipsn32r6 \ + mips64r6el/32=mipsr6el \ + mips64r6el/n32=mipsn32r6el \ + x32/32=i386 \ + x32/64=amd64 \ + kfreebsd-amd64/32=kfreebsd-i386 +# $(call mlib_to_arch,<empty>|32|64|n32|x32|hf|sf) +mlib_to_arch = $(patsubst $(DEB_TARGET_ARCH)/$(1)=%,%, \ + $(filter $(DEB_TARGET_ARCH)/$(1)=%,$(multilib_arch_map))) + +# build -base packages +with_gccbase := yes +ifeq ($(build_type),build-cross) + ifneq ($(DEB_STAGE),rtlibs) + with_gcclbase := yes + endif +endif + +# build dev packages. +ifneq ($(DEB_STAGE),rtlibs) + with_dev := yes +endif + +with_cpp := yes + +# set lang when built from a different source package. +separate_lang := no + +#no_dummy_cpus := ia64 i386 hppa s390 sparc +#ifneq (,$(filter $(DEB_TARGET_ARCH_CPU),$(no_dummy_cpus))) +# with_base_only := no +# with_common_libs := yes +# with_common_pkgs := yes +#else +# with_base_only := yes +# with_common_libs := no +# with_common_pkgs := no +# with_dev := no +#endif + +ifeq ($(versioned_packages),yes) + pkg_ver := -$(BASE_VERSION) + PV := $(pkg_ver) +endif + +# ------------------------------------------------------------------- +# configure languages + +# C --------------------------- +enabled_languages := c + +with_jit = yes + +# FIXME: compiler bug +# m68k: PR 95381 +jit_no_cpus := ia64 + +ifneq (,$(filter $(DEB_TARGET_ARCH_CPU),$(jit_no_cpus))) + with_jit := disabled for cpu $(DEB_TARGET_ARCH_CPU) +endif +# FIXME: see #994035, strange tar behavior +ifneq (,$(filter $(DEB_TARGET_ARCH_OS), kfreebsd)) + with_jit := disabled for os $(DEB_TARGET_ARCH_OS) +endif +ifneq (,$(with_rtlibs)) + with_jit := disabled for rtlibs stage +endif +ifneq ($(findstring nojit, $(DEB_BUILD_OPTIONS)),) + with_jit := disabled by DEB_BUILD_OPTIONS +endif +with_jit := $(call envfilt, jit, , , $(with_jit)) + +ifeq (,$(findstring gcc-,$(PKGSOURCE))) + with_jit := +endif + +# this fails when installing the jit build +# libtool: install: /home/packages/gcc/13/tc/gcc-toolchain-13-13.2.0+2.41/build-jit/./binutils/ranlib /home/packages/gcc/13/tc/gcc-toolchain-13-13.2.0+2.41/debian/tmp-jit/usr/lib/gcc-toolchain-13/lib/../lib/libgomp.a +# /home/packages/gcc/13/tc/gcc-toolchain-13-13.2.0+2.41/build-jit/binutils/.libs/ranlib: error while loading shared libraries: /home/packages/gcc/13/tc/gcc-toolchain-13-13.2.0+2.41/build-jit/bfd/.libs/libbfd-2.41-tc13.so: file too short +# /home/packages/gcc/13/tc/gcc-toolchain-13-13.2.0+2.41/build-jit/binutils/.libs/ranlib: error while loading shared libraries: /home/packages/gcc/13/tc/gcc-toolchain-13-13.2.0+2.41/build-jit/bfd/.libs/libbfd-2.41-tc13.so: file too short + +ifneq (,$(findstring gcc-toolchain,$(PKGSOURCE))) + with_jit := disabled for $(PKGSOURCE) builds +endif + +ifneq (,$(findstring build-cross, $(build_type))) + with_jit := disabled for cross builds +endif + +ifeq ($(with_jit),yes) + ifeq ($(with_common_libs),yes) + with_libgccjit := yes + endif +endif + +nvptx_archs := amd64 arm64 ppc64el +# arm64, see PR target/96265 +ifneq (,$(filter $(DEB_TARGET_ARCH),$(nvptx_archs))) + offload_targets += nvptx-none + with_offload_nvptx := yes +endif +ifneq (,$(filter $(distrelease), precise)) + offload_targets := + with_offload_nvptx := +endif +ifneq (,$(findstring build-cross, $(build_type))) + offload_targets := + with_offload_nvptx := disabled for cross builds +endif + +ifeq ($(single_package),yes) + ifneq ($(trunk_build),yes) + offload_targets := + with_offload_nvptx := disabled for $(PKGSOURCE) builds + endif +endif +ifneq ($(findstring nonvptx, $(DEB_BUILD_OPTIONS)),) + offload_targets := + with_offload_nvptx := disabled by DEB_BUILD_OPTIONS +endif +with_offload_nvptx := $(call envfilt, nvptx, , , $(with_offload_nvptx)) +#with_offload_nvptx := not yet built for GCC 13 + +gcn_archs := amd64 +gcn_target_name = amdgcn-amdhsa + +ifneq (,$(filter $(distrelease),buster xenial bionic focal groovy)) + gcn_tools_llvm_version = 9 +else ifneq (,$(filter $(distrelease),focal groovy)) + gcn_tools_llvm_version = 11 +else + gcn_tools_llvm_version = tools +endif + +ifneq (,$(filter $(DEB_TARGET_ARCH),$(gcn_archs))) + offload_targets += $(gcn_target_name) + with_offload_gcn := yes +endif +ifneq (,$(filter $(distrelease), precise bionic focal)) + offload_targets := $(filter-out $(gcn_target_name), $(offload_targets)) + with_offload_gcn := +endif +ifneq (,$(findstring build-cross, $(build_type))) + offload_targets := $(filter-out $(gcn_target_name), $(offload_targets)) + with_offload_gcn := disabled for cross builds +endif + +ifeq ($(single_package),yes) + ifneq ($(trunk_build),yes) + offload_targets := $(filter-out $(gcn_target_name), $(offload_targets)) + with_offload_gcn := disabled for $(PKGSOURCE) builds + endif +endif +ifneq ($(findstring nogcn, $(DEB_BUILD_OPTIONS)),) + offload_targets := $(filter-out $(gcn_target_name), $(offload_targets)) + with_offload_gcn := disabled by DEB_BUILD_OPTIONS +endif +with_offload_gcn := $(call envfilt, gcn, , , $(with_offload_gcn)) +#with_offload_gcn := not yet built for GCC 13 + +with_cc1 := yes +with_cc1 := $(call envfilt, cc1, , , $(with_cc1)) + +ifeq ($(with_cc1),yes) + ifeq ($(with_common_libs),yes) + with_libcc1 := yes + endif + with_libcc1_plugin := yes +endif + +ifneq (,$(with_rtlibs)) + with_libcc1 := disabled for rtlibs stage + with_libcc1_plugin := disabled for rtlibs stage +endif +ifneq (,$(findstring build-cross, $(build_type))) + with_libcc1 := disabled for cross builds +endif + +# Build all packages needed for C development +ifneq ($(with_base_only),yes) + ifeq ($(with_dev),yes) + with_cdev := yes + endif +endif + +ifeq (,$(filter $(DEB_STAGE),stage1 stage2)) +# Ada -------------------- +ada_no_cpus := arc ia64 loong64 sh3 sh3eb sh4eb +ada_no_systems := +ada_no_cross := no +ada_no_snap := no +#ifeq ($(single_package),yes) +# ifneq (,$(filter $(DEB_TARGET_ARCH),alpha)) +# ada_no_snap := yes +# endif +#endif +#ifeq ($(DEB_CROSS),yes) +# ifneq (,$(filter $(DEB_TARGET_ARCH),alpha)) +# ada_no_cross := yes +# endif +#endif + +ifeq ($(with_dev),yes) + ifneq ($(separate_lang),yes) + with_ada := yes + endif +endif +ifneq (,$(filter $(DEB_TARGET_ARCH_CPU),$(ada_no_cpus))) + with_ada := disabled for cpu $(DEB_TARGET_ARCH_CPU) +endif +ifneq (,$(findstring $(DEB_TARGET_GNU_SYSTEM),$(ada_no_systems))) + with_ada := disabled for system $(DEB_TARGET_GNU_SYSTEM) +endif +ifeq ($(ada_no_cross)-$(DEB_CROSS),yes-yes) + with_ada := disabled for cross compiler package +endif +ifeq ($(ada_no_snap)-$(single_package),yes-yes) + with_ada := disabled for snapshot build +endif +ifneq (,$(findstring gccgo,$(PKGSOURCE))) + with_ada := +endif +ifneq (,$(filter $(distrelease), precise)) + with_ada := +endif +with_ada := $(call envfilt, ada, , , $(with_ada)) + +ifeq ($(DEB_STAGE)-$(filter libgnat, $(with_rtlibs)),rtlibs-) + with_ada := disabled for rtlibs stage +endif +#with_ada := disabled for GCC 13 + +#ifneq ($(single_package),yes) +# with_separate_gnat := yes +#endif + +ifneq ($(with_separate_gnat),yes) + ifeq ($(with_ada),yes) + ifneq (,$(filter $(distrelease), precise)) + with_ada := + endif + endif +endif + +ifeq ($(with_ada)-$(with_separate_gnat),yes-yes) + ifneq (,$(findstring gnat,$(PKGSOURCE))) + languages := c + separate_lang := yes + with_mudflap := no + with_gccbase := no + with_cdev := no + with_cc1 := no + with_libcc1 := no + else + debian_extra_langs += ada + with_ada := built from separate source + with_libgnat := built from separate source + endif +endif + +ifeq ($(with_ada),yes) + enabled_languages += ada + with_libgnat := yes + #with_gnatsjlj := yes +endif + +# C++ ------------------------- +cxx_no_cpus := avr +ifneq ($(with_base_only),yes) + ifneq ($(separate_lang),yes) + with_cxx := yes + endif +endif +ifneq (,$(findstring $(DEB_TARGET_ARCH_CPU),$(cxx_no_cpus))) + with_cxx := disabled for cpu $(DEB_TARGET_ARCH_CPU) +endif +with_cxx := $(call envfilt, c++, obj-c++, , $(with_cxx)) + +# Set the default libstdc++ ABI. libstdc++ provides both ABI's. +# Existing code still runs with the new c++11 ABI, however link +# errors are seen when one object is compiled with the new std::string in scope, +# another object is compiled with the old std::string in scope. both can link +# to libstdc++.so but not to each other. +# two objects (which might be some system library and a user's program) need to +# agree on the version of std::string they're using + +libstdcxx_abi = new +# backports default to the old ABI +ifneq (,$(filter $(distrelease), jessie precise trusty)) + libstdcxx_abi = gcc4-compatible +endif + +# Build all packages needed for C++ development +ifeq ($(with_cxx),yes) + ifeq ($(with_dev),yes) + with_cxxdev := yes + with_libcxxdbg := yes + endif + ifeq ($(with_common_libs),yes) + with_libcxx := yes + endif + + # debugging versions of libstdc++ + ifneq (,$(findstring gcc-, $(PKGSOURCE))) + ifeq ($(with_cxxdev),yes) + with_cxx_debug := yes + debug_no_cpus := + ifneq (,$(findstring $(DEB_TARGET_ARCH_CPU),$(debug_no_cpus))) + with_cxx_debug := disabled for cpu $(DEB_TARGET_GNU_CPU) + endif + endif + endif + with_cxx_debug := $(call envfilt, debug, , , $(with_cxx_debug)) + + enabled_languages += c++ +endif + +# Go ------------------- +# - To build a standalone gccgo package (with no corresponding gcc +# package): with_separate_libgo=yes, with_standalone_go=yes +# - To build the go packages from the gcc source package: +# with_separate_libgo=no, with_standalone_go=no +# - To build gcc and go from separate sources: +# with_separate_libgo=yes, with_standalone_go=no + +go_no_cross := yes +go_no_cross := no + +ifneq (,$(findstring gccgo, $(PKGSOURCE))) + with_separate_libgo := yes + with_standalone_go := yes + with_cc1 := + with_libcc1 := +endif + +go_no_cpus := arc avr hppa loong64 +go_no_cpus += m68k # See PR 79281 / PR 83314 +go_no_systems := kfreebsd-gnu +ifneq (,$(filter $(distrelease),precise)) + go_no_cpus = armhf + go_no_archs = armhf +endif +# Debian #969221 +go_no_cpus += sh4 +go_no_archs += sh4 + +ifneq ($(with_base_only),yes) + ifneq ($(separate_lang),yes) + with_go := yes + endif +endif +ifneq (,$(filter $(DEB_TARGET_ARCH_CPU),$(go_no_cpus))) + with_go := disabled for cpu $(DEB_TARGET_ARCH_CPU) +endif +ifneq (,$(findstring $(DEB_TARGET_ARCH_OS),$(go_no_systems))) + with_go := disabled for system $(DEB_TARGET_GNU_SYSTEM) +endif +ifneq (,$(filter $(DEB_TARGET_ARCH),$(go_no_archs))) + with_go := disabled for architecture $(DEB_TARGET_ARCH) +endif +ifeq ($(go_no_cross)-$(DEB_CROSS),yes-yes) + with_go := disabled for cross compiler package +endif +ifeq ($(DEB_STAGE)-$(filter libgo, $(with_rtlibs)),rtlibs-) + with_go := disabled for rtlibs stage +endif +with_go := $(call envfilt, go, , , $(with_go)) + +# Build all packages needed for Go development +ifneq (,$(findstring gcc, $(PKGSOURCE))) + ifeq ($(with_go),yes) + ifeq ($(with_dev),yes) + with_godev := yes + endif + with_libgo := yes + enabled_languages += go + endif +endif + +ifeq ($(with_go)-$(with_separate_libgo),yes-yes) + ifneq (,$(findstring gccgo, $(PKGSOURCE))) + languages := c c++ go + separate_lang := yes + with_libgcc := yes + with_shared_libgcc := yes + else + debian_extra_langs += go + with_go := built from separate source + with_libgo := buit from separate source + endif +endif + +# D --------------------------- +d_no_cross := yes +d_no_snap := +d_no_cpus := alpha arc ia64 loong64 m68k sh4 s390 sparc64 +d_no_systems := gnu kfreebsd-gnu + +ifneq ($(single_package),yes) + with_separate_gdc := yes +endif +with_separate_gdc := no + +ifneq ($(separate_lang),yes) + with_d := yes +endif + +ifneq (,$(filter $(DEB_TARGET_ARCH_CPU),$(d_no_cpus))) + with_d := disabled for cpu $(DEB_TARGET_ARCH_CPU) +endif +ifneq (,$(filter $(DEB_TARGET_GNU_SYSTEM),$(d_no_systems))) + with_d := disabled for system $(DEB_TARGET_GNU_SYSTEM) +endif +ifneq (,$(filter $(DEB_TARGET_ARCH),$(d_no_archs))) + with_d := disabled for architecture $(DEB_TARGET_ARCH) +endif +ifeq ($(d_no_snap)-$(single_package),yes-yes) + with_d := disabled for snapshot build +endif +ifeq ($(DEB_STAGE)-$(filter libphobos, $(with_rtlibs)),rtlibs-) + with_d := disabled for rtlibs stage +endif +ifeq ($(GENERATE_DFSG_TARBALL),yes) + with_d := disabled while generating the dfsg tarball +endif +with_d := $(call envfilt, d, , , $(with_d)) +#with_d := not yet built for GCC 13 + +ifeq ($(with_base_only),yes) + with_d := no +endif + +ifeq ($(with_d)-$(with_separate_gdc),yes-yes) + ifneq (,$(findstring gdc,$(PKGSOURCE))) + languages := c c++ + separate_lang := yes + + # FIXME: language selection needs improvement. + with_go := disabled for d + else + debian_extra_langs += d + with_d := built from separate source + endif +endif + +ifeq ($(with_d),yes) + druntime_only_archs = powerpc ppc64 ppc64el + phobos_archs = amd64 arm64 armel armhf i386 x32 + phobos_archs += hppa + phobos_archs += mips mips64 mipsel mips64el + phobos_archs += mipsn32 mipsn32el + phobos_archs += mipsr6 mipsr6el mipsn32r6 mipsn32r6el mips64r6 mips64r6el + phobos_archs += riscv64 s390x + phobos_archs += $(druntime_only_archs) + #phobos_archs += kfreebsd-amd64 kfreebsd-i386 + ifneq (,$(filter $(DEB_TARGET_ARCH), $(phobos_archs))) + with_phobos := yes + endif + + phobos_no_systems := gnu kfreebsd-gnu + ifneq (,$(filter $(DEB_TARGET_GNU_SYSTEM),$(phobos_no_systems))) + with_phobos := disabled for system $(DEB_TARGET_GNU_SYSTEM) + endif + with_libphobosdev := $(with_phobos) + + enabled_languages += d +endif + +# Fortran 95 ------------------- +fortran_no_cross := yes +fortran_no_cross := no + +ifneq ($(with_base_only),yes) + ifneq ($(separate_lang),yes) + with_fortran := yes + endif +endif +ifeq ($(fortran_no_cross)-$(DEB_CROSS),yes-yes) + with_fortran := disabled for cross compiler package +endif +ifeq ($(DEB_STAGE)-$(filter libgfortran libquadmath, $(with_rtlibs)),rtlibs-) + with_fortran := disabled for rtlibs stage +endif + +with_fortran := $(call envfilt, fortran, , , $(with_fortran)) + +# Build all packages needed for Fortran development +ifeq ($(with_fortran),yes) + ifeq ($(with_dev),yes) + ifneq ($(DEB_STAGE)-$(filter libgfortran libquadmath, $(with_rtlibs)),rtlibs-) + with_fdev := yes + endif + endif + ifeq ($(with_common_libs),yes) + with_libgfortran := yes + endif + enabled_languages += fortran +endif + +# libquadmath ------------------- + +quadmath_targets = amd64 ia64 i386 x32 \ + hurd-amd64 hurd-i386 kfreebsd-i386 kfreebsd-amd64 \ + ppc64el +# powerpc and ppc64 don't have power7 CPU defaults ... +ifneq (,$(filter $(DEB_TARGET_ARCH), $(quadmath_targets))) + # FIXME: upstream build tied to gfortran build + ifeq ($(with_fortran),yes) + with_qmath := yes + ifneq (,$(findstring gcc-13,$(PKGSOURCE))) + ifeq ($(with_common_libs),yes) + with_libqmath := yes + endif + endif + endif +endif + +# ObjC ------------------------ +objc_no_cross := no + +ifneq ($(with_base_only),yes) + ifneq ($(separate_lang),yes) + with_objc := yes + objc_no_archs = + ifneq (,$(filter $(DEB_TARGET_ARCH),$(objc_no_archs))) + with_objc := + endif + endif +endif +ifeq ($(objc_no_cross)-$(DEB_CROSS),yes-yes) + with_objc := disabled for cross compiler package +endif +ifeq ($(DEB_STAGE)-$(filter libobjc, $(with_rtlibs)),rtlibs-) + with_objc := disabled for rtlibs stage +endif +with_objc := $(call envfilt, objc, obj-c++, , $(with_objc)) + +ifeq ($(with_objc),yes) + # the ObjC runtime with garbage collection enabled needs the Boehm GC + with_objc_gc := yes + + # disable ObjC garbage collection library (needs libgc) + libgc_no_cpus := avr + libgc_no_systems := knetbsd-gnu + ifneq (,$(filter $(DEB_TARGET_ARCH_CPU),$(libgc_no_cpus))) + with_objc_gc := disabled for cpu $(DEB_TARGET_ARCH_CPU) + endif + ifneq (,$(findstring $(DEB_TARGET_GNU_SYSTEM),$(libgc_no_systems))) + with_objc_gc := disabled for system $(DEB_TARGET_GNU_SYSTEM) + endif + ifneq (,$(findstring build-cross, $(build_type))) + with_objc_gc := disabled for cross builds + endif + # Build all packages needed for Objective-C development + ifeq ($(with_dev),yes) + with_objcdev := yes + endif + ifeq ($(with_common_libs),yes) + with_libobjc := yes + endif + + enabled_languages += objc +endif + +# ObjC++ ---------------------- +objcxx_no_cross := no + +ifeq ($(with_objc),yes) + ifneq ($(with_base_only),yes) + ifneq ($(separate_lang),yes) + with_objcxx := yes + endif + endif +endif +ifeq ($(objcxx_no_cross)-$(DEB_CROSS),yes-yes) + with_objcxx := disabled for cross compiler package +endif +with_objcxx := $(call envfilt, obj-c++, , c++ objc, $(with_objcxx)) + +ifeq ($(with_objcxx),yes) + enabled_languages += obj-c++ +endif + +# Modula-2 ------------------- +m2_no_cross := yes +m2_no_cross := no + +ifneq ($(with_base_only),yes) + ifneq ($(separate_lang),yes) + with_m2 := yes + endif +endif +m2_no_cpus = loong64 powerpc ppc64 sh4 +m2_no_systems = gnu kfreebsd-gnu +ifneq (,$(filter $(DEB_TARGET_ARCH_CPU),$(m2_no_cpus))) + with_m2 := disabled for cpu $(DEB_TARGET_ARCH_CPU) +endif +ifneq (,$(findstring $(DEB_TARGET_ARCH_OS),$(m2_no_systems))) + with_m2 := disabled for system $(DEB_TARGET_GNU_SYSTEM) +endif +ifeq ($(m2_no_cross)-$(DEB_CROSS),yes-yes) + with_m2 := disabled for cross compiler package +endif +ifeq ($(DEB_STAGE)-$(filter libgm2, $(with_rtlibs)),rtlibs-) + with_m2 := disabled for rtlibs stage +endif +ifneq (,$(filter $(distrelease),precise)) + with_m2 := disabled for $(distrelease) backport +endif +#with_m2 := disabled for GCC 13 + +with_m2 := $(call envfilt, m2, , , $(with_m2)) + +# Build all packages needed for Modula-2 development +ifeq ($(with_m2),yes) + ifeq ($(with_dev),yes) + with_m2dev := yes + endif + ifeq ($(with_common_libs),yes) + with_libgm2 := yes + endif + enabled_languages += m2 +endif + +# Rust ------------------- +rs_no_cross := yes +rs_no_cross := no + +ifneq ($(with_base_only),yes) + ifneq ($(separate_lang),yes) + with_rs := yes + endif +endif +#rs_no_cpus = s390x +ifneq (,$(filter $(DEB_TARGET_ARCH_CPU),$(rs_no_cpus))) + with_rs := disabled for cpu $(DEB_TARGET_ARCH) +endif +ifeq ($(rs_no_cross)-$(DEB_CROSS),yes-yes) + with_rs := disabled for cross compiler package +endif +#ifeq ($(DEB_STAGE)-$(filter libgrs, $(with_rtlibs)),rtlibs-) +# with_rs := disabled for rtlibs stage +#endif + +ifneq (,$(filter $(distrelease),lunar)) + with_rs := yes +else + with_rs := disabled for GCC 13 +endif +#with_rs := disabled for GCC 13 + +with_rs := $(call envfilt, rust, , , $(with_rs)) + +# Build all packages needed for Rust development +ifeq ($(with_rs),yes) + ifeq ($(with_dev),yes) + with_rsdev := yes + endif + ifeq ($(with_common_libs),yes) + with_libgrs := yes + endif + enabled_languages += rust +endif + +# ------------------------------------------------------------------- +# other config + +# not built from the main source package +ifeq (,$(findstring gcc-,$(PKGSOURCE))) + extra_package := yes +endif + +with_nls := yes +ifeq ($(trunk_build),yes) + with_nls := no +endif +with_nls := $(call envfilt, nls, , , $(with_nls)) + +# powerpc nof libraries ----- +with_libnof := no + +ifneq (,$(findstring gcc-13,$(PKGSOURCE))) + ifeq (,$(with_rtlibs)) + with_source := yes + endif +endif +with_source := $(call envfilt, source, , , $(with_source)) + +ifeq ($(with_cdev),yes) + +# ssp & libssp ------------------------- +with_ssp := yes +ssp_no_archs = alpha hppa ia64 m68k +ifneq (, $(filter $(DEB_TARGET_ARCH),$(ssp_no_archs) $(ssp_no_archs:%=uclibc-%))) + with_ssp := not available on $(DEB_TARGET_ARCH) +endif +with_ssp := $(call envfilt, ssp, , , $(with_ssp)) + +ifeq ($(with_ssp),yes) + ifneq ($(derivative),Debian) + ifneq (,$(findstring gcc-13, $(PKGSOURCE))) + with_ssp_default := yes + endif + endif +endif + +# gomp -------------------- +with_gomp := yes +with_gomp := $(call envfilt, gomp, , , $(with_gomp)) +gomp_no_archs = +ifneq (,$(filter $(DEB_TARGET_ARCH),$(gomp_no_archs))) + with_gomp := +endif + +# itm -------------------- +itm_archs = alpha amd64 arm64 i386 x32 ppc64 ppc64el s390x sh4 sparc64 +ifneq (,$(filter $(DEB_TARGET_ARCH),$(itm_archs))) + with_itm := yes +endif +with_itm := $(call envfilt, itm, , , $(with_itm)) + +# atomic -------------------- +with_atomic := yes +atomic_no_archs = +ifneq (,$(filter $(DEB_TARGET_ARCH),$(atomic_no_archs))) + with_atomic := +endif + +# backtrace -------------------- +with_backtrace := yes +backtrace_no_archs = m68k +ifneq (,$(filter $(DEB_TARGET_ARCH),$(backtrace_no_archs))) + with_backtrace := +endif + +strip_sanitizer = +ifneq (,$(filter $(distrelease),jessie stretch buster precise xenial bionic)) + strip_sanitizer = yes +endif + +# asan / sanitizer -------------------- +with_asan := +with_asan := $(call envfilt, asan, , , $(with_asan)) +asan_archs = amd64 armel armhf arm64 i386 powerpc ppc64 ppc64el \ + riscv64 s390x sparc sparc64 x32 +ifneq (,$(filter $(DEB_TARGET_ARCH),$(asan_archs))) + with_asan := yes +endif + +# lsan / sanitizer -------------------- +with_lsan := +with_lsan := $(call envfilt, lsan, , , $(with_lsan)) +lsan_archs = arm64 amd64 ppc64 ppc64el +ifneq (,$(filter $(DEB_TARGET_ARCH),$(lsan_archs))) + with_lsan := yes +endif + +# tsan / sanitizer -------------------- +with_tsan := +with_tsan := $(call envfilt, tsan, , , $(with_tsan)) +tsan_archs = arm64 amd64 ppc64 ppc64el +ifneq (,$(filter $(DEB_TARGET_ARCH),$(tsan_archs))) + with_tsan := yes +endif + +# hwasan / sanitizer -------------------- +with_hwasan := +with_hwasan := $(call envfilt, hwasan, , , $(with_hwasan)) +hwasan_archs = amd64 arm64 +ifneq (,$(filter $(DEB_TARGET_ARCH),$(hwasan_archs))) + with_hwasan := yes +endif + +# ubsan / sanitizer -------------------- +with_ubsan := +with_ubsan := $(call envfilt, ubsan, , , $(with_ubsan)) +ubsan_archs = amd64 armel armhf arm64 i386 powerpc ppc64 ppc64el x32 \ + s390x sparc sparc64 +ifneq (,$(filter $(DEB_TARGET_ARCH),$(ubsan_archs))) + with_ubsan := yes +endif + +endif # with_cdev + +# libvtv -------------------- +with_vtv := +with_vtv := $(call envfilt, vtv, , , $(with_vtv)) +vtv_archs = amd64 i386 x32 +ifneq (,$(filter $(DEB_TARGET_ARCH),$(vtv_archs))) + with_vtv := yes + with_libvtv := yes +endif +# libvtv builds a modified libstdc++, don't enable it by default +with_vtv := +with_libvtv := + +# pie by default -------------------- +with_pie := +ifeq ($(distribution),Debian) + ifeq (,$(filter $(distrelease), jessie)) + pie_archs = amd64 arm64 armel armhf i386 \ + mips mipsel mips64 mips64el mipsn32 mipsn32el \ + mipsr6 mipsr6el mips64r6 mips64r6el mipsn32r6 mipsn32r6el \ + ppc64el s390x sparc sparc64 kfreebsd-amd64 kfreebsd-i386 \ + hurd-amd64 hurd-i386 riscv64 loong64 + endif + ifeq (,$(filter $(distrelease), jessie stretch)) + pie_archs += powerpc ppc64 + endif +else ifeq ($(distribution),Ubuntu) + ifeq (,$(filter $(distrelease), precise trusty)) + pie_archs = s390x + endif + ifeq (,$(filter $(distrelease), precise trusty xenial)) + pie_archs += amd64 ppc64el + endif + ifeq (,$(filter $(distrelease), precise trusty xenial)) + pie_archs += armhf arm64 i386 + endif + pie_archs += riscv64 +endif +ifneq (,$(filter $(DEB_TARGET_ARCH),$(pie_archs))) + with_pie := yes +endif +ifeq ($(trunk_build),yes) + with_pie := disabled for trunk builds +endif + +# gold -------------------- +# armel with binutils 2.20.51 only +gold_archs = amd64 armel armhf i386 powerpc ppc64 ppc64el s390x sparc sparc64 x32 hurd-amd64 hurd-i386 +ifneq (,$(filter $(DEB_TARGET_ARCH),$(gold_archs))) + with_gold := yes +endif + +# plugins -------------------- +with_plugins := yes +ifneq (,$(with_rtlibs)) + with_plugins := disabled for rtlibs stage +endif + +endif # ifeq (,$(filter $(DEB_STAGE),stage1 stage2)) + +# Don't include docs with GFDL invariant sections +GFDL_INVARIANT_FREE := yes +ifeq ($(derivative),Ubuntu) + GFDL_INVARIANT_FREE := no +endif + +# ------------------------------------------------------------------- +# non-extra config +ifeq ($(extra_package),yes) + ifeq ($(with_separate_libgo),yes) + # package stuff + with_gccbase := yes + with_cdev := no + with_cxx := no + with_cxxdev := no + endif +else + # libssp ------------------ + ifeq ($(with_ssp)-$(with_common_libs),yes-yes) + #ifneq ($(DEB_CROSS),yes) + with_libssp := $(if $(wildcard $(builddir)/gcc/auto-host.h),$(shell if grep -qs '^\#define TARGET_LIBC_PROVIDES_SSP 1' $(builddir)/gcc/auto-host.h; then echo 'libc provides ssp'; else echo 'yes'; fi)) + #endif + with_libssp := libc provides ssp + endif + + # libgomp ----------------- + ifeq ($(with_gomp)-$(with_common_libs),yes-yes) + with_libgomp := yes + endif + + # libitm ----------------- + ifeq ($(with_itm)-$(with_common_libs),yes-yes) + with_libitm := yes + endif + + # libatomic ----------------- + ifeq ($(with_atomic)-$(with_common_libs),yes-yes) + with_libatomic := yes + endif + + # libbacktrace ----------------- + ifeq ($(with_backtrace)-$(with_common_libs),yes-yes) + # currently not a shared library + #with_libbacktrace := yes + endif + + # libasan ----------------- + ifeq ($(with_asan)-$(with_common_libs),yes-yes) + ifeq ($(with_asan),yes) + with_libasan := yes + endif + endif + + # liblsan ----------------- + ifeq ($(with_lsan)-$(with_common_libs),yes-yes) + #ifneq ($(DEB_CROSS),yes) + with_liblsan := yes + #endif + endif + + # libtsan ----------------- + ifeq ($(with_tsan)-$(with_common_libs),yes-yes) + with_libtsan := yes + endif + + # libubsan ----------------- + ifeq ($(with_ubsan)-$(with_common_libs),yes-yes) + ifeq ($(with_ubsan),yes) + with_libubsan := yes + endif + endif + + # libhwasan ----------------- + ifeq ($(with_hwasan)-$(with_common_libs),yes-yes) + ifeq ($(with_hwasan),yes) + with_libhwasan := yes + endif + endif + + # libvtv ----------------- + ifeq ($(with_vtv)-$(with_common_libs),yes-yes) + with_libvtv := yes + endif + + # libquadmath ----------------- + ifeq ($(with_qmath)-$(with_common_libs),yes-yes) + with_libqmath := yes + endif + + # libunwind ----------------- + with_internal_libunwind = + ifeq ($(DEB_HOST_ARCH),ia64) + ifeq ($(DEB_STAGE),stage1) + ifeq ($(DEB_CROSS),yes) + with_internal_libunwind = yes + endif + endif + endif + + # Shared libgcc -------------------- + ifneq ($(DEB_STAGE),stage1) + with_shared_libgcc := yes + ifeq ($(with_common_libs),yes) + with_libgcc := yes + ifneq (,$(filter $(distrelease), jessie stretch buster lucid precise trusty xenial bionic focal)) + ifneq (,$(filter $(build_type), build-native cross-build-native)) + with_libcompatgcc := yes + endif + endif + endif + endif + + # libphobos ----------------- + #ifeq ($(with_common_libs),yes) + ifeq ($(with_phobos),yes) + with_libphobos := yes + endif + #endif + + # libgcc-math -------------------- + with_libgmath := no + ifneq (,$(findstring i486,$(DEB_TARGET_ARCH))) + #with_libgccmath := yes + #with_lib64gmath := yes + #with_libgmathdev := yes + endif + ifeq ($(DEB_TARGET_ARCH),amd64) + #with_libgccmath := yes + #with_lib32gmath := yes + #with_libgmathdev := yes + endif + + # hppa64 build ---------------- + hppa64_no_snap := no + hppa64_archs := hppa + ifneq (,$(filter $(build_type), build-native cross-build-native)) + ifneq (,$(filter $(distrelease), jessie precise trusty)) + binutils_hppa64 := binutils-hppa64 + else + ifneq ($(single_package),yes) + hppa64_archs += amd64 i386 x32 + endif + binutils_hppa64 := binutils-hppa64-linux-gnu + endif + ifneq (,$(filter $(DEB_TARGET_ARCH),$(hppa64_archs))) + with_hppa64 := yes + endif + endif + ifneq (,$(findstring gcc-toolchain, $(PKGSOURCE))) + with_hppa64 := disabled for backports/toolchain builds + endif + ifeq ($(hppa64_no_snap)-$(trunk_build),yes-yes) + with_hppa64 := disabled for snapshot build + endif + ifneq ($(findstring nohppa64, $(DEB_BUILD_OPTIONS)),) + with_hppa64 := disabled by DEB_BUILD_OPTIONS + endif + with_hppa64 := $(call envfilt, hppa64, , , $(with_hppa64)) + + ifeq ($(DEB_STAGE),rtlibs) + with_libasan := disabled for rtlibs stage + with_liblsan := disabled for rtlibs stage + with_libtsan := disabled for rtlibs stage + with_libubsan := disabled for rtlibs stage + with_libhwasan := disabled for rtlibs stage + with_hppa64 := disabled for rtlibs stage + endif +endif + +# run testsuite --------------- +with_check := yes +# if you don't want to run the gcc testsuite, uncomment the next line +#with_check := disabled by hand +ifeq ($(with_base_only),yes) + with_check := no +endif +ifeq ($(DEB_CROSS),yes) + with_check := disabled for cross compiler package +endif +ifneq (,$(findstring cross-build-,$(build_type))) + with_check := disabled for cross building the compiler +endif +ifneq (,$(with_rtlibs)) + with_check := disabled for rtlibs stage +endif +#check_no_cpus := m68k +check_no_systems := # gnu kfreebsd-gnu +ifneq (,$(filter $(DEB_TARGET_ARCH_CPU),$(check_no_cpus))) + with_check := disabled for cpu $(DEB_TARGET_ARCH_CPU) +endif +#ifneq (,$(findstring $(DEB_TARGET_GNU_SYSTEM),$(check_no_systems))) +# with_check := disabled for system $(DEB_TARGET_GNU_SYSTEM) +#endif +ifneq (,$(findstring gdc,$(PKGSOURCE))) + with_check := disabled for D +endif +with_check := $(call envfilt, check, , , $(with_check)) +ifdef WITHOUT_CHECK + with_check := disabled by environment +endif +ifneq ($(findstring nocheck, $(DEB_BUILD_OPTIONS)),) + with_check := disabled by DEB_BUILD_OPTIONS +endif +ifneq (,$(filter $(DEB_HOST_ARCH), mipsel mips64el)) + ifneq ($(single_package),yes) + with_check := disabled for $(DEB_HOST_ARCH), testsuite timeouts + endif +endif +# override the Debian porters, we need to know about the test results +ifeq ($(distribution),Debian) + ifneq (,$(filter $(DEB_HOST_ARCH), m68k sh4)) +# with_check := yes + endif +endif +ifeq ($(distribution)-$(DEB_HOST_ARCH),Ubuntu-riscv64) + with_check := disabled for $(DEB_HOST_ARCH) on Ubuntu, qemu builders +endif +with_check := disabled for this upload + +# not a dependency on all archs, but if available, use it for the testsuite +ifneq (,$(wildcard /usr/bin/localedef)) + locale_data = generate +endif +# try to b-d on locales-all +locale_data = + +ifneq (,$(filter $(build_type), build-cross cross-build-cross)) + ldconfig_arg = --noscripts +endif + +all_enabled_languages := $(enabled_languages) +languages_without_lang_opt := c++ objc obj-c++ + +debian_extra_langs := $(subst obj-c++,objcp,$(debian_extra_langs)) +export debian_extra_langs + +# multilib +biarch_map := i686=x86_64 powerpc=powerpc64 sparc=sparc64 sparc64=sparc s390=s390x s390x=s390 \ + x86_64=i686 powerpc64=powerpc mips=mips64 mipsel=mips64el \ + mips64=mips mips64el=mipsel mipsn32=mips mipsn32el=mipsel \ + mipsr6=mips64r6 mipsr6el=mips64r6el mips64r6=mipsr6 mips64r6el=mipsr6el \ + mipsn32r6=mipsr6 mipsn32r6el=mipsr6el +# FIXME: why still? +biarch_map := $(subst i686=,i486=,$(biarch_map)) + +ifeq ($(derivative),Ubuntu) + ifneq (,$(filter $(distrelease), precise trusty xenial bionic focal groovy hirsute)) + biarch_map += arm=arm + endif +endif +biarch_cpu := $(strip $(patsubst $(DEB_TARGET_GNU_CPU)=%,%, \ + $(filter $(DEB_TARGET_GNU_CPU)=%,$(biarch_map)))) + +biarch64 := no +biarch32 := no +biarchn32 := no +biarchx32 := no +biarchhf := no +biarchsf := no +flavours := +define gen_biarch + ifneq (yes,$$(call envfilt, biarch, , ,yes)) + biarch$1archs := + endif + ifneq (,$$(findstring /$$(DEB_TARGET_ARCH)/,$$(biarch$1archs))) + biarch$1 := yes + flavours += $1 + #biarch$1subdir = $$(biarch_cpu)-$$(DEB_TARGET_GNU_SYSTEM) + biarch$1subdir = $1 + ifeq ($$(with_libgcc),yes) + with_lib$1gcc := yes + endif + ifeq ($$(with_cdev),yes) + with_lib$1gccdev := yes + endif + ifeq ($$(with_libcxx),yes) + with_lib$1cxx := yes + endif + ifeq ($$(with_libcxxdbg),yes) + with_lib$1cxxdbg := yes + endif + ifeq ($$(with_cxxdev),yes) + with_lib$1cxxdev := yes + endif + ifeq ($$(with_libobjc),yes) + with_lib$1objc := yes + endif + ifeq ($$(with_objcdev),yes) + with_lib$1objcdev := yes + endif + ifeq ($$(with_libgfortran),yes) + with_lib$1gfortran := yes + endif + ifeq ($$(with_fdev),yes) + with_lib$1gfortrandev := yes + endif + ifeq (,$(filter $1, hf)) + ifeq ($$(with_libphobos),yes) + with_lib$1phobos := yes + endif + ifeq ($$(with_libphobosdev),yes) + with_lib$1phobosdev := yes + endif + endif + ifeq ($$(with_libssp),yes) + with_lib$1ssp := yes + endif + ifeq ($$(with_libgomp),yes) + with_lib$1gomp:= yes + endif + ifeq ($$(with_libitm),yes) + with_lib$1itm:= yes + endif + ifeq ($$(with_libatomic),yes) + with_lib$1atomic:= yes + endif + ifeq ($$(with_libbacktrace),yes) + with_lib$1backtrace:= yes + endif + ifeq ($$(with_libasan),yes) + with_lib$1asan:= yes + endif + ifeq ($$(with_liblsan),yes) + ifneq (,$$(filter $$(distrelease),lunar jammy focal)) + with_lib$1lsan := yes + endif + endif + ifeq ($$(with_libtsan),yes) + with_lib$1tsan:= yes + endif + ifeq ($$(with_libubsan),yes) + with_lib$1ubsan := yes + endif + ifeq ($$(with_libhwasan),yes) + ifeq ($$(DEB_TARGET_ARCH)-$1,i386-64) + with_lib$1hwasan:= yes + endif + ifeq ($$(DEB_TARGET_ARCH)-$1,x32-64) + with_lib$1hwasan:= yes + endif + endif + ifeq ($$(with_libvtv),yes) + with_lib$1vtv := yes + endif + ifeq ($$(with_libqmath),yes) + with_lib$1qmath := yes + endif + ifeq ($$(with_libgo),yes) + with_lib$1go := yes + endif + ifeq ($$(with_godev),yes) + with_lib$1godev := yes + endif + + biarch_multidir_names = libiberty libgcc libbacktrace libatomic libgomp + ifneq (,$$(findstring gcc-, $$(PKGSOURCE))) + biarch_multidir_names += libstdc++-v3 libobjc libgfortran libssp \ + zlib libitm libsanitizer + ifeq ($$(with_objc_gc),yes) + biarch_multidir_names += boehm-gc + endif + endif + ifneq (,$(findstring yes, $(with_go))) + biarch_multidir_names += libffi + endif + ifeq ($(with_fortran),yes) + biarch_multidir_names += libquadmath + endif + ifeq ($(with_go),yes) + biarch_multidir_names += libgo + endif + ifeq ($(with_phobos),yes) + ifeq (,$(filter $1, hf)) + biarch_multidir_names += libphobos + endif + endif + # FIXME: it now builds, but installs everything into the same $libdir + #ifeq ($(with_m2),yes) + # biarch_multidir_names += libgm2 + #endif + ifneq (,$$(findstring 32,$1)) + TARGET64_MACHINE := $$(strip $$(subst $$(DEB_TARGET_GNU_CPU),$$(biarch_cpu), \ + $$(TARGET_ALIAS))) + TARGET32_MACHINE := $$(TARGET_ALIAS) + else + TARGET64_MACHINE := $$(TARGET_ALIAS) + TARGET64_MACHINE := $$(strip $$(subst $$(DEB_TARGET_GNU_CPU),$$(biarch_cpu), \ + $$(TARGET_ALIAS))) + endif + export TARGET32_MACHINE + export TARGET64_MACHINE + endif +endef +biarch32archs := /amd64/ppc64/kfreebsd-amd64/s390x/sparc64/x32/mipsn32/mipsn32el/mips64/mips64el/ +biarch64archs := /i386/powerpc/sparc/s390/mips/mipsel/mipsn32/mipsn32el/ +biarchn32archs := /mips/mipsel/mips64/mips64el/ +ifeq (yes,$(MIPS_R6_ENABLED)) + biarch32archs += /mipsn32r6/mipsn32r6el/mips64r6/mips64r6el/ + biarch64archs += /mipsr6/mipsr6el/mipsn32r6/mipsn32r6el/x32/ + biarchn32archs += /mipsr6/mipsr6el/mips64r6/mips64r6el/ +endif + +ifeq ($(derivative),Ubuntu) + ifneq (,$(filter $(distrelease),precise xenial bionic focal groovy hirsute)) + biarchhfarchs := /armel/ + biarchsfarchs := /armhf/ + endif + ifeq (,$(filter $(distrelease), precise)) + biarchx32archs := /amd64/i386/ + endif +else ifeq ($(derivative),Debian) + biarchx32archs := /amd64/i386/ +endif +$(foreach x,32 64 n32 x32 hf sf,$(eval $(call gen_biarch,$(x)))) + +ifeq ($(DEB_TARGET_ARCH),sh4) + biarch_multidir_names=none +endif +export biarch_multidir_names + +#ifeq ($(trunk_build),yes) +# no_biarch_libs := yes +#endif +no_biarch_libs := + +ifeq ($(no_biarch_libs),yes) + with_lib64gcc := no + with_lib64cxx := no + with_lib64cxxdbg := no + with_lib64objc := no + with_lib64ffi := no + with_lib64gfortran := no + with_lib64ssp := no + with_lib64go := no + with_lib64gomp := no + with_lib64itm := no + with_lib64qmath := no + with_lib64atomic := no + with_lib64backtrace := no + with_lib64asan := no + with_lib64lsan := no + with_lib64tsan := no + with_lib64ubsan := no + with_lib64hwasan := no + with_lib64vtv := no + with_lib64gccdev := no + with_lib64cxxdev := no + with_lib64objcdev := no + with_lib64gfortrandev := no + with_lib64phobosdev := no + + with_lib32gcc := no + with_lib32cxx := no + with_lib32cxxdbg := no + with_lib32objc := no + with_lib32ffi := no + with_lib32gfortran := no + with_lib32ssp := no + with_lib32go := no + with_lib32gomp := no + with_lib32itm := no + with_lib32qmath := no + with_lib32atomic := no + with_lib32backtrace := no + with_lib32asan := no + with_lib32lsan := no + with_lib32tsan := no + with_lib32ubsan := no + with_lib32hwasan := no + with_lib32vtv := no + with_lib32gccdev := no + with_lib32cxxdev := no + with_lib32objcdev := no + with_lib32gfortrandev := no + with_lib32phobosdev := no + + with_libn32gcc := no + with_libn32cxx := no + with_libn32cxxdbg := no + with_libn32objc := no + with_libn32ffi := no + with_libn32gfortran := no + with_libn32ssp := no + with_libn32go := no + with_libn32gomp := no + with_libn32itm := no + with_libn32qmath := no + with_libn32atomic := no + with_libn32backtrace := no + with_libn32asan := no + with_libn32lsan := no + with_libn32tsan := no + with_libn32ubsan := no + with_libn32hwasan := no + with_libn32gccdev := no + with_libn32cxxdev := no + with_libn32objcdev := no + with_libn32gfortrandev:= no + with_libn32phobosdev := no + + with_libx32gcc := no + with_libx32cxx := no + with_libx32cxxdbg := no + with_libx32objc := no + with_libx32ffi := no + with_libx32gfortran := no + with_libx32ssp := no + with_libx32go := no + with_libx32gomp := no + with_libx32itm := no + with_libx32qmath := no + with_libx32atomic := no + with_libx32backtrace := no + with_libx32asan := no + with_libx32lsan := no + with_libx32tsan := no + with_libx32ubsan := no + with_libx32hwasan := no + with_libx32vtv := no + with_libx32gccdev := no + with_libx32cxxdev := no + with_libx32objcdev := no + with_libx32gfortrandev:= no + with_libx32phobosdev := no + + with_libhfgcc := no + with_libhfcxx := no + with_libhfcxxdbg := no + with_libhfobjc := no + with_libhfffi := no + with_libhfgfortran := no + with_libhfssp := no + with_libhfgo := no + with_libhfgomp := no + with_libhfitm := no + with_libhfqmath := no + with_libhfatomic := no + with_libhfbacktrace := no + with_libhfasan := no + with_libhflsan := no + with_libhftsan := no + with_libhfubsan := no + with_libhfhwasan := no + with_libhfgccdev := no + with_libhfcxxdev := no + with_libhfobjcdev := no + with_libhfgfortrandev := no + with_libhfphobosdev := no + + with_libsfgcc := no + with_libsfcxx := no + with_libsfcxxdbg := no + with_libsfobjc := no + with_libsfffi := no + with_libsfgfortran := no + with_libsfssp := no + with_libsfgo := no + with_libsfgomp := no + with_libsfitm := no + with_libsfqmath := no + with_libsfatomic := no + with_libsfbacktrace := no + with_libsfasan := no + with_libsflsan := no + with_libsftsan := no + with_libsfubsan := no + with_libsfhwasan := no + with_libsfgccdev := no + with_libsfcxxdev := no + with_libsfobjcdev := no + with_libsfgfortrandev := no + with_libsfphobosdev := no + + ifeq ($(with_ada)-$(with_separate_gnat),yes-yes) + biarchhf := disabled for Ada + biarchsf := disabled for Ada + endif + +endif + +ifneq (,$(filter yes,$(biarch32) $(biarch64) $(biarchn32) $(biarchx32) $(biarchhf) $(biarchsf))) + multilib := yes +endif + +multilib_archs = $(sort $(subst /, , $(biarch64archs) $(biarch32archs) $(biarchn32archs) $(biarchx32archs) $(biarchhfarchs) $(biarchsfarchs))) + +biarchsubdirs := \ + $(if $(filter yes,$(biarch64)),$(biarch64subdir),) \ + $(if $(filter yes,$(biarch32)),$(biarch32subdir),) \ + $(if $(filter yes,$(biarchn32)),$(biarchn32subdir),) \ + $(if $(filter yes,$(biarchx32)),$(biarchx32subdir),) \ + $(if $(filter yes,$(biarchhf)),$(biarchhfsubdir),) \ + $(if $(filter yes,$(biarchsf)),$(biarchsfsubdir),) +biarchsubdirs := {$(strip $(shell echo $(biarchsubdirs) | tr " " ","))} + +# GNU locales +force_gnu_locales := yes +locale_no_cpus := +locale_no_systems := +ifneq (,$(findstring $(DEB_TARGET_GNU_SYSTEM),$(locale_no_systems))) + force_gnu_locales := disabled for system $(DEB_TARGET_GNU_SYSTEM) +endif + +gcc_tarpath := $(firstword $(wildcard gcc-*.tar.* /usr/src/gcc-13/gcc-*.tar.*)) +gcc_tarball := $(notdir $(gcc_tarpath)) +gcc_srcdir := $(subst -dfsg,,$(patsubst %.tar.xz,%,$(patsubst %.tar.lzma,%,$(patsubst %.tar.gz,%,$(gcc_tarball:.tar.bz2=))))) + +binutils_dsc := $(notdir $(firstword $(wildcard binutils_*.dsc))) +binutils_srcdir := $(shell echo $(binutils_dsc) | sed 's/-.*//;s/_/-/') + +ifneq (,$(filter yes, $(with_offload_nvptx) $(with_offload_gcn))) + newlib_tarpath := $(firstword $(wildcard newlib-*.tar.* /usr/src/gcc-$(BASE_VERSION)/newlib-*.tar.*)) + newlib_tarball := $(notdir $(newlib_tarpath)) + newlib_srcdir := $(patsubst %.tar.xz,%,$(patsubst %.tar.lzma,%,$(patsubst %.tar.gz,%,$(newlib_tarball:.tar.bz2=)))) +endif + +# NOTE: This is not yet used. when building gdc or gnat using the +# gcc-source package, we don't require an exact binary dependency. +ifneq ($(dir $(gcc_tarpath)),./) + built_using_external_source := yes +else + built_using_external_source := +endif +ifeq ($(DEB_CROSS),yes) + add_built_using = yes +endif +ifeq ($(with_ada)-$(with_separate_gnat),yes-yes) + add_built_using = yes +endif + +unpack_stamp := $(stampdir)/01-unpack-stamp +pre_patch_stamp := $(stampdir)/02-pre-patch-stamp +patch_stamp := $(stampdir)/02-patch-stamp +control_stamp := $(stampdir)/03-control-stamp +configure_stamp := $(stampdir)/04-configure-stamp +build_stamp := $(stampdir)/05-build-stamp +build_arch_stamp := $(stampdir)/05-build-arch-stamp +build_indep_stamp := $(stampdir)/05-build-indep-stamp +build_html_stamp := $(stampdir)/05-build-html-stamp +build_locale_stamp := $(stampdir)/05-build-locale-stamp +build_doxygen_stamp := $(stampdir)/05-build-doxygen-stamp +build_gnatdoc_stamp := $(stampdir)/05-build-gnatdoc-stamp +check_stamp := $(stampdir)/06-check-stamp +check_inst_stamp := $(stampdir)/06-check-inst-stamp +install_stamp := $(stampdir)/07-install-stamp +install_snap_stamp := $(stampdir)/07-install-snap-stamp +install_tc_stamp := $(stampdir)/07-install-tc-stamp +binary_stamp := $(stampdir)/08-binary-stamp + +configure_dummy_stamp := $(stampdir)/04-configure-dummy-stamp +build_dummy_stamp := $(stampdir)/05-build-dummy-stamp +install_dummy_stamp := $(stampdir)/07-install-dummy-stamp + +configure_jit_stamp := $(stampdir)/04-configure-jit-stamp +build_jit_stamp := $(stampdir)/05-build-jit-stamp +install_jit_stamp := $(stampdir)/07-install-jit-stamp + +# installation of the offload compilers is required for the check target +# name it 06-install-*-stamp +configure_nvptx_stamp := $(stampdir)/04-configure-nvptx-stamp +build_nvptx_stamp := $(stampdir)/05-build-nvptx-stamp +install_nvptx_stamp := $(stampdir)/06-install-nvptx-stamp + +configure_gcn_stamp := $(stampdir)/04-configure-gcn-stamp +build_gcn_stamp := $(stampdir)/05-build-gcn-stamp +install_gcn_stamp := $(stampdir)/06-install-gcn-stamp + +configure_hppa64_stamp := $(stampdir)/04-configure-hppa64-stamp +build_hppa64_stamp := $(stampdir)/05-build-hppa64-stamp +install_hppa64_stamp := $(stampdir)/07-install-hppa64-stamp + +control_dependencies := $(patch_stamp) + +ifeq ($(single_package),yes) + ifneq (,$(findstring gcc-snapshot, $(PKGSOURCE))) + configure_dependencies = $(configure_stamp) + build_dependencies = $(build_stamp) + install_dependencies = $(install_snap_stamp) + ifeq ($(with_check),yes) + check_dependencies += $(check_stamp) + endif + else ifneq (,$(findstring gcc-toolchain, $(PKGSOURCE))) + configure_dependencies = $(configure_stamp) + build_dependencies = $(build_stamp) + install_dependencies = $(install_tc_stamp) + ifeq ($(with_check),yes) + check_dependencies += $(check_stamp) + endif + else + $(error Unknown single-package $(PKGSOURCE)) + endif +else + ifeq ($(with_base_only),yes) + configure_dependencies = $(configure_dummy_stamp) + build_dependencies = $(build_dummy_stamp) + install_dependencies = $(install_dummy_stamp) + else + configure_dependencies = $(configure_stamp) + build_dependencies = $(build_stamp) + install_dependencies = $(install_stamp) + ifeq ($(with_check),yes) + check_dependencies += $(check_stamp) + endif + endif +endif + +ifeq ($(with_jit),yes) + build_dependencies += $(build_jit_stamp) + install_dependencies += $(install_jit_stamp) +endif + +ifeq ($(with_offload_nvptx),yes) + build_dependencies += $(build_nvptx_stamp) + install_dependencies += $(install_nvptx_stamp) +endif + +ifeq ($(with_offload_gcn),yes) + build_dependencies += $(build_gcn_stamp) + install_dependencies += $(install_gcn_stamp) +endif + +ifeq ($(with_hppa64),yes) + build_dependencies += $(build_hppa64_stamp) + ifneq ($(trunk_build),yes) + install_dependencies += $(install_hppa64_stamp) + endif +endif + +build_dependencies += $(check_dependencies) + +build_arch_dependencies = $(build_dependencies) +build_indep_dependencies = $(build_dependencies) + +ifneq (,$(findstring build-native, $(build_type))) + ifneq ($(single_package),yes) + build_indep_dependencies += $(build_html_stamp) + ifeq ($(with_cxx),yes) + build_indep_dependencies += $(build_doxygen_stamp) + endif + ifeq ($(with_ada),yes) + build_indep_dependencies += $(build_gnatdoc_stamp) + endif + endif +endif + +stamp-dir: + mkdir -p $(stampdir) + +ifeq ($(DEB_CROSS),yes) + define cross_mangle_shlibs + if [ -f debian/$(1)/DEBIAN/shlibs ]; then \ + sed -i s/$(cross_lib_arch)/:$(DEB_TARGET_ARCH)/g debian/$(1)/DEBIAN/shlibs; \ + fi + endef + define cross_mangle_substvars + if [ -f debian/$(1).substvars ]; then \ + sed -i \ + -e 's/:$(DEB_TARGET_ARCH)/$(cross_lib_arch)/g' \ + -e 's/\(libc[.0-9]*-[^:]*\):\([a-z0-9-]*\)/\1-\2-cross/g' \ + $(if $(filter armel,$(DEB_TARGET_ARCH)),-e 's/:armhf/-armhf-cross/g') \ + $(if $(filter armhf,$(DEB_TARGET_ARCH)),-e 's/:armel/-armel-cross/g') \ + debian/$(1).substvars; \ + fi + endef +else + define cross_mangle_shlibs + endef + define cross_mangle_substvars + endef + # precise's dh_shlibdeps doesn't work well for ARM multilibs + # and dh_shlibdeps doesn't work well for cross builds, see #698881. + ifneq (,$(filter $(distrelease),precise quantal raring)) + ifneq (,$(filter $(DEB_TARGET_ARCH), armel armhf arm64)) + ignshld = - + endif + endif + # FIXME: don't stop at the first shlibdeps failure ... + ignshld = - +endif +ifeq ($(DEB_STAGE),rtlibs) + define cross_mangle_shlibs + endef + define cross_mangle_substvars + endef +endif + +# takes a *list* of package names as $1, the multilib dirname as $2 +_shlibdirs = \ + $(if $(strip $(1)), \ + $(shell find $(foreach p,$(1),$(CURDIR)/debian/$(p)) \ + -name '*.so.*' -printf '%h ' | uniq)) \ + $(with_build_sysroot)/lib/$(call mlib_to_march,$(2)) \ + $(with_build_sysroot)/usr/lib/$(call mlib_to_march,$(2)) \ + $(with_build_sysroot)$(subst /usr,,/$(usr_lib$(2))) \ + $(with_build_sysroot)/$(usr_lib$(2)) \ + $(if $(findstring mips64,$(DEB_TARGET_ARCH)), \ + $(with_build_sysroot)/$(usr_lib64)) \ + $(if $(findstring mipsn32,$(DEB_TARGET_ARCH)), \ + $(with_build_sysroot)/$(usr_libn32)) \ + $(if $(filter sparc64,$(DEB_TARGET_ARCH)), \ + $(with_build_sysroot)/$(usr_lib64)) \ + $(if $(filter yes,$(biarchsf) $(biarchhf)), \ + $(with_build_sysroot)/usr/$(call mlib_to_march,$(2))/lib) \ + $(if $(filter yes, $(with_common_libs)),, \ + $(CURDIR)/$(d)/$(usr_lib$(2)) \ + $(CURDIR)/$(d)/usr/$(call mlib_to_march,$(2))/lib) +shlibdirs_to_search = -l$(subst $(SPACE),:,$(foreach d,$(_shlibdirs),$(d))) |