1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
|
#!/usr/bin/make -f
# https://wiki.debian.org/PackagingLessCommonBinutilsTargets
include /usr/share/dpkg/buildopts.mk
include /usr/share/dpkg/pkg-info.mk
# In gcc-10&11, libcpp/expr.c contains format errors.
# lto: https://bugs.debian.org/1015414
export DEB_BUILD_MAINT_OPTIONS := hardening=+all,-format optimize=-lto
gnu_type := or1k-elf
# Not deducible from package name because of possible underscore characters.
gcc-version-major := $(shell sed '/^ gcc-\(.*\)-source,$$/!d;s//\1/;q' debian/control)
# The Debian packaging calls this BV.
gcc-version != dpkg-query -Wf'$${Version}' gcc-$(gcc-version-major)-source
# https://gcc.gnu.org/install/configure.html recommends out-of-tree builds.
%:
dh $@
execute_before_dh_update_autotools_config: src
tar_dir = /usr/src/gcc-$(gcc-version-major)
src:
tar -xf $(tar_dir)/gcc-*.tar.xz --transform='s|[^/]*|src|'
# git-updates.diff always exists, but may contain no diff chunk.
if grep -q '^---' $(tar_dir)/patches/git-updates.diff; then \
patch -p1 < $(tar_dir)/patches/git-updates.diff; \
fi
patch -p1 < $(tar_dir)/patches/gcc-gfdl-build.diff
patch -p1 < debian/fix-autoreconf.diff
# _GCC_AUTOCONF_VERSION_CHECK in config/override.m4 requires 2.69.
override_dh_autoreconf:
dh_autoreconf autoreconf2.69 -- -f -i -v `grep -v \# debian/autoreconf`
# libssp: libssp requires glibc
# Install to the same path hierarchy than other GCCs: neither
# multiarch components nor GCC minor versions.
override_dh_auto_configure:
# Imitate dh_auto_configure -- $(confargs), but without
# --runstatedir as long as libiberty/configure cannot be refreshed.
install -d bld
cd bld && ../src/configure --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --includedir=/usr/include --mandir=/usr/share/man --infodir=/usr/share/info --sysconfdir=/etc --localstatedir=/var --disable-option-checking --disable-silent-rules --libdir=/usr/lib/$(DEB_HOST_GNU_TYPE) --disable-maintainer-mode --disable-dependency-tracking \
--target=$(gnu_type) \
--disable-shared \
--disable-multilib \
--disable-bootstrap \
--enable-languages=c \
--disable-libssp \
--libdir=\$${prefix}/lib \
--with-gcc-major-version-only \
--without-included-gettext \
--with-pkgversion='GCC $(gcc-version) Debian $(DEB_VERSION)' \
--with-system-zlib
# Prevent dh_auto_{build,test,install} from parsing Makefile, see
# https://gcc.gnu.org/legacy-ml/gcc/2013-04/msg00171.html
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100933
override_dh_auto_build:
cd bld && $(MAKE) $(addprefix -j,$(DEB_BUILD_OPTION_PARALLEL))
override_dh_auto_test:
cd bld && $(MAKE) check
# Even if building one package, install in two steps and display
# explicit install/missing lists.
override_dh_auto_install:
cd bld && $(MAKE) install DESTDIR='$(CURDIR)/debian/tmp' AM_UPDATE_INFO_DIR=no
# The archive may be stripped, but
# * not for the or1k-elf target, see commit d4e32cd0
# * that would be $(gnu_type)-strip, not $(DEB_HOST_GNU_TYPE)-strip
override_dh_strip:
dh_strip --exclude=.a
chmod 644 debian/gcc-*/usr/libexec/gcc/*/*/liblto_plugin.so
# The private shared library needs no ldconfig trigger.
override_dh_makeshlibs:
dh_makeshlibs --no-scripts
gencontrol_format = \
-v$${Version}+$(DEB_VERSION) \
-VBuilt-Using="$${source:Package} (= $${source:Version})"
gencontrol_args != dpkg-query -Wf'$(gencontrol_format)' \
gcc-$(gcc-version-major)-source
override_dh_gencontrol:
dh_gencontrol -- $(gencontrol_args) \
-Vgcc-version-major=$(gcc-version-major)
|