Debian Codegraph @

debian/rules

raw symbols SCIP
1 #!/usr/bin/make -f
2 include /usr/share/dpkg/pkg-info.mk
3 target != echo $(DEB_SOURCE) | sed s/binutils-//
4 binutils_dir=/usr/src/binutils
5
6 export DEB_BUILD_MAINT_OPTIONS=hardening=+all
7 export DEB_CFLAGS_MAINT_APPEND=-Wno-error=discarded-qualifiers
8
9 deb_upstream_version != dpkg-query -f'$${source:Upstream-Version}' -W binutils-source
10
11 # version number for our binary packages
12 deb_version = $(deb_upstream_version)+$(DEB_VERSION)
13
14 unpacked_dir=binutils
15 %:
16 mkdir -p $(unpacked_dir)
17 dh $@ -D$(unpacked_dir) -Bbuild
18
19 execute_before_dh_update_autotools_config: $(unpacked_dir)/binutils
20 $(unpacked_dir)/binutils:
21 cd $(unpacked_dir) && tar --strip-components=1 -xf $(binutils_dir)/binutils-*.tar.*
22 rm -rf $(unpacked_dir)/zlib
23
24 override_dh_autoreconf:
25 # Explicitly adding -I `pwd`/$(unpacked_dir)/config to the autoreconf
26 # command somehow seems to help with this issue where gcc-plugin.m4
27 # apparently isn't found:
28 # https://sourceware.org/pipermail/binutils/2021-August/117733.html
29 if ! echo $(DEB_BUILD_OPTIONS) | grep -q terse; \
30 then AUTORECONF_OPTS='-v'; \
31 fi; \
32 AUTORECONF_DIRS=`cd $(unpacked_dir) && find . -name configure.ac -o -name configure.in`; \
33 dh_autoreconf autoreconf2.69 -- -f $$AUTORECONF_OPTS -I `pwd`/$(unpacked_dir)/config $$AUTORECONF_DIRS
34
35 override_dh_auto_configure:
36 # Versions of Debhelper newer than 10 by default pass --runstatedir
37 # to the configure script. The autoconf2.69 package used to have support
38 # for --runstatedir backported from upstream, but this was dropped in
39 # 2.69-3 (see #994933), so we set DH_COMPAT=10 to circumvent the issue.
40 # Hopefully by the time support for DH_COMPAT=10 is removed, Binutils
41 # will be able to be autoreconf'ed using the latest version.
42 DH_COMPAT=10 dh_auto_configure -- \
43 --target=$(target) \
44 --with-bugurl="https://www.debian.org/Bugs/" \
45 --libdir=/usr/lib/$(target) \
46 --infodir=/nulldir \
47 --htmldir=/nulldir \
48 --pdfdir=/nulldir \
49 --mandir=/usr/share/man \
50 --with-system-zlib \
51 --with-pkgversion="$(deb_version)" \
52 --enable-deterministic-archives \
53
54 execute_before_dh_installdocs: debian/$(DEB_SOURCE).copyright
55 debian/$(DEB_SOURCE).copyright: debian/copyright /usr/share/doc/binutils-source/copyright
56 cp debian/copyright $@
57 printf -- "\n-----BEGIN BINUTILS COPYRIGHT INFORMATION-----\n" >> $@
58 cat /usr/share/doc/binutils-source/copyright >> $@
59 printf -- "-----END BINUTILS COPYRIGHT INFORMATION-----\n" >> $@
60
61 BUILT_USING != dpkg-query -f '$${source:Package} (= $${source:Version})' -W binutils-source
62 override_dh_gencontrol:
63 dh_gencontrol -- -v$(deb_version) -VBuilt-Using="$(BUILT_USING)"
64
65 execute_after_dh_auto_install:
66 # Make symbolic links instead of hard links.
67 cd debian/$(DEB_SOURCE)/usr/$(target)/bin && \
68 for i in *; \
69 do rm "$$i" && \
70 ln -s ../../bin/$(target)-"$$i" "$$i"; \
71 done
72 # These are provided by binutils-common.
73 rm -rf debian/$(DEB_SOURCE)/usr/share/locale debian/$(DEB_SOURCE)/nulldir
74
75 # How to run the Binutils test suite in a cross configuration is underdocumented.
76 # As-is there seem to be numerous failures; it may require a simulator,
77 # which is probably best provided by a gcc-sh-elf or other package.
78 # Patches and suggestions are welcome.
79 override_dh_auto_test: