summaryrefslogtreecommitdiff
path: root/sys-devel/binutils-hppa64
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2019-11-10 13:21:36 +0000
committerV3n3RiX <venerix@redcorelinux.org>2019-11-10 13:21:36 +0000
commit77398e424e45d9e98c1cef3c43bdadb9d56e81ef (patch)
tree5aeffd3fc7b92fc615bd2c222fa8831aeda1925b /sys-devel/binutils-hppa64
parentbd4aeefe33e63f613512604e47bfca7b2187697d (diff)
gentoo resync : 10.11.2019
Diffstat (limited to 'sys-devel/binutils-hppa64')
-rw-r--r--sys-devel/binutils-hppa64/Manifest9
-rw-r--r--sys-devel/binutils-hppa64/binutils-hppa64-2.30-r4.ebuild5
-rw-r--r--sys-devel/binutils-hppa64/binutils-hppa64-2.31.1-r6.ebuild2
-rw-r--r--sys-devel/binutils-hppa64/binutils-hppa64-2.32-r1.ebuild2
-rw-r--r--sys-devel/binutils-hppa64/binutils-hppa64-2.33.1.ebuild438
5 files changed, 452 insertions, 4 deletions
diff --git a/sys-devel/binutils-hppa64/Manifest b/sys-devel/binutils-hppa64/Manifest
index c1890f09c889..2e61f4935391 100644
--- a/sys-devel/binutils-hppa64/Manifest
+++ b/sys-devel/binutils-hppa64/Manifest
@@ -16,13 +16,16 @@ DIST binutils-2.31.1-patches-7.tar.xz 76828 BLAKE2B 354e7c3aa76c0cfe8fc6bb419a5b
DIST binutils-2.31.1.tar.xz 20467996 BLAKE2B 6b914df1fbb7cf54f2159f71b2c2b09f3f6a569b7a3cb4cf9790d0a3733a7548bc0ea32334a178ed3b56e8b97656ae99c7abaf212601beeaeae9a0884c0f6051 SHA512 0fca326feb1d5f5fe505a827b20237fe3ec9c13eaf7ec7e35847fd71184f605ba1cefe1314b1b8f8a29c0aa9d88162849ee1c1a3e70c2f7407d88339b17edb30
DIST binutils-2.32-patches-2.tar.xz 145672 BLAKE2B 8218e621f99cb4bcd1638c3011449b94480d207eaeb79cf75c0072e0f1a86bfd1603fc4515bc40d3ac1921a18b9a211b20568f59b11b13eb44e6cff1329c5af9 SHA512 55c25a603f6175af3ade6848e5c1faba06a147d72e9a4f53d44502d97db76499485a67b278a654d18884714a7bf7b360c77c9e42dba3cdc188f805bfe461f09f
DIST binutils-2.32.tar.xz 20774880 BLAKE2B d1bdbd9c8487c091665c197974ce4bdf520b7a67ed6997a81b87e6a0af9514a091458244f583acec5ae580ac2ee5e908f67f483b8e5263cd18ced794cb235da6 SHA512 d326408f12a03d9a61a9de56584c2af12f81c2e50d2d7e835d51565df8314df01575724afa1e43bd0db45cfc9916b41519b67dfce03232aa4978704492a6994a
+DIST binutils-2.33.1-patches-1.tar.xz 17944 BLAKE2B 811ad416fe9c059f645856a3123ed32303afe1d0f166a15cb6de0673b5494fdcc4c165da4a68eb7ab73f007618e3a97a5578c4b47de21e57fe501d6a21b6d595 SHA512 63b439637206d21e46d2b79383b38da2b28365a0fdea1f5ac3b665cd05e0b55cd1d7763c05567a5f7ae2c645d2ae639a27e465d535b928d9f8f0e6b94f31e1f7
+DIST binutils-2.33.1.tar.xz 21490848 BLAKE2B c336a8412938dc8c224f40a763a8bea9937cca0462a8fb80e62f14aabe590107fc061a3f4b9327e1f4652cb026384d36a91b4766d4d469d2d0680932874b638c SHA512 b7a6767c6c7ca6b5cafa7080e6820b7bb3a53b7148348c438d99905defbdf0d30c9744a484ee01c9441a8153901808513366b15ba9533e20c9673c262ade36ac
EBUILD binutils-hppa64-2.26.1.ebuild 649 BLAKE2B 7634f79d45f03490a2c5f336fec707880792966bafc8ee07ebc0bf5102d2ba1be51a1a4123b415d6e5e28fee784fbb2fdb86d7cd68a873f941c67286f7edf779 SHA512 8174c2a92d336ecd685eab3a2680bcadd30d7d15205b441d179ade7d3f2e87862062115a45d7ab1e7ab8fe811530f47584ca34d2a2157c09be7468386bfa5d16
EBUILD binutils-hppa64-2.27.ebuild 650 BLAKE2B 29e8b49ece3105c38b4ac8b12addfa8d157022d306fc014d12f07bf82fc126d8e3fb8655e5b6c74d273a497a203120e00bbd9374df03d06fd0524719aae0978e SHA512 bb28312060d697c45df0deba91c207c57a3ff88134fbfb7a666c3e41370b57004d1e48aca42f7df15e9c2c1f745f7a699b39e0e2a134690be9e24c29e0c9d724
EBUILD binutils-hppa64-2.28.1.ebuild 650 BLAKE2B d5fe2e9a8c5fc3d906838e6c0621329e0082d4705d222a2c4d513bcbaf4e5e6cc64582ea8a8e41ae1deda4d8651bc299892990dcf15670eb8fb5248ea9b8333f SHA512 7786209f9e2c4e1fa40ec08b8a4ff1c89d1471a2f438a7b750cb4067b19520a1a9b9be0c46396b2e0d0b9ad4c0f2d82cbacf4e77397661b04d49da45ebac70fa
EBUILD binutils-hppa64-2.28.ebuild 650 BLAKE2B 6b0cf836068c33cbcb5a14a1e03e43cc834e6841c8284be1bfed50ad39d511782c619baea523eff58e10ca795183b7614da686b47e173e38fda5d6bba905d920 SHA512 b34d1385f1c9e1d607774ef073dcef0e0ee617e5f740459eb03fd2c007c7a168a690f763cd5332865a2b0aba22de59fad8950fffcdef2c6a79ab9ffdadf1b653
EBUILD binutils-hppa64-2.29.1-r1.ebuild 647 BLAKE2B c17820e537f67c2a26af197ee7ebb75176b82db1aeab7d4f43325cee6a535760953ed365d11e30dec733c6364e035c96f07620e5aa8ab980be043473db759ba8 SHA512 7076225bc7f9dcd90b69459acd42d06b592225bceb967e9f1a9058cc35080ecf3201116520fdac8a4a063aff6c4eb42bd0185ccbdcbc3c6017e1e34af51da993
EBUILD binutils-hppa64-2.29.ebuild 650 BLAKE2B d5fe2e9a8c5fc3d906838e6c0621329e0082d4705d222a2c4d513bcbaf4e5e6cc64582ea8a8e41ae1deda4d8651bc299892990dcf15670eb8fb5248ea9b8333f SHA512 7786209f9e2c4e1fa40ec08b8a4ff1c89d1471a2f438a7b750cb4067b19520a1a9b9be0c46396b2e0d0b9ad4c0f2d82cbacf4e77397661b04d49da45ebac70fa
-EBUILD binutils-hppa64-2.30-r4.ebuild 10860 BLAKE2B ad84a88ebe8268f180c1aaedae6f9bf14bffe1b1ae699e05f294c7602eb84731cb450c38918b5a5d1f0f5a6c980a39f2f54d2de6a26eb1340a014c3a874c3b13 SHA512 53edc88591545db03c95d7f308987fe6c4f139a8dbcf62e5c8563037682199593c6298267835a8611ed77dfd491e25fd586ecd31057f095e0adf03a7185f0341
-EBUILD binutils-hppa64-2.31.1-r6.ebuild 12531 BLAKE2B 35083cf1f8af275bc55ac9cdba798f2f89d9bc193ad28e21b0f37ec5fb692a8742f812597f29ae6929440ec9886da4850bf4578bb210e1c73457f8320fc033be SHA512 12daf4e9afdf2bac960bf8683e14e59e81481519c0f52f69dd8d7334d3d6d1a15098595652ad06d8d4ae30e80db6d93dbe762cff87a5617b2d4cf1c9ae5921f4
-EBUILD binutils-hppa64-2.32-r1.ebuild 12611 BLAKE2B 6adad759ab00657800b7a7f8d788815cb73dc2bae65af8d12936d7581d9727f41c4a5dc8384c56897caab873c3e53ad718ac4c12c6fbaba249c828379fa735e5 SHA512 fb422a650bf3ae7063eb5ff54c15e65ca0c33a6e7071a5eb7186e0ffe8f8edb59084032706d29847f11a18bdbddbb8d46b3dc0acf76ca8140d5926b86defb968
+EBUILD binutils-hppa64-2.30-r4.ebuild 10889 BLAKE2B 26363a034306faa1ef805ba80972f69d1eb847f0659cc3d1147f307ef5c28c9f4f9190a70897ae986b2fd1aceeb5bd0d1f9725244e648564723c41590912c74d SHA512 0436812017f5f6aed949cc9d127750d479fc56cf7092269195ba76e6dbbce694d4a94c8e9d84cd2d57a56e7bc2d05735e44517d3dd811c5204e9ae9472636dbe
+EBUILD binutils-hppa64-2.31.1-r6.ebuild 12559 BLAKE2B 4275ca5ecd87d37b3b9964e478fa2c64ca0bb6b462eb48eed366e573d39f686f600f4c2eb973e29ab9257ab99e81273e3c812258e513322b5cd71fdec9fbcb49 SHA512 9e07525616ffede0c496737c92d27f1f53858f5c140ace559add33048af1e2fdcbb92f2633db4ef5f70c2976d12db0d6bbfaabef01880c454af0bd8d7ace709d
+EBUILD binutils-hppa64-2.32-r1.ebuild 12639 BLAKE2B 018935093b8700fad374ed5b2c484d4563a6b01e1564dd0958806f81e5e85c63512eb7dd3baeb05185369f3f067b931cfe0afaf3af10e987a5bf4cde873e8d25 SHA512 27c755b55435db7ffac4cc79734ac92d4f9b6ae32d0f3adc6d082221a76f0e896dbae1ed90727a024183f9e838a9acee6888c5f354196afdb772a29ad1dc0282
+EBUILD binutils-hppa64-2.33.1.ebuild 12294 BLAKE2B 69482d483f56b43c63570bb69adb0d31222c30844abcbe20e29a7e89109ee87448fddca5bda920fc706963d965bc92cc68f66c2756f4fe3cafc60622d8d0f7d6 SHA512 a4fd81b00ab6b3a71df68bb85d206a4ba3654b99d92059891a5d84e492dd973771dd6fa30d82216d4a9698702eaa18a9b2a24a4a48ad4c6bc6cdf9c6bd11422b
MISC metadata.xml 766 BLAKE2B e03336034fccf22a9cd0559a1a78bcc99f7cec05b7e526798e739a48589d50732d1664c6d9fcffe6defcd18840e612cba1a158e557785423d4834c2c54183579 SHA512 ea6c1bc005fecf24c4673f623b6d21ded664e5999720c6b74ad2a3654c40a274c9003a2a44dd402de3317a1d3d4450bc1d3c74683b3a98557363d62e21043e04
diff --git a/sys-devel/binutils-hppa64/binutils-hppa64-2.30-r4.ebuild b/sys-devel/binutils-hppa64/binutils-hppa64-2.30-r4.ebuild
index d4e225fa71d0..400a9dd6eaad 100644
--- a/sys-devel/binutils-hppa64/binutils-hppa64-2.30-r4.ebuild
+++ b/sys-devel/binutils-hppa64/binutils-hppa64-2.30-r4.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Authors
+# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
@@ -73,6 +73,9 @@ DEPEND="${RDEPEND}
sys-devel/flex
virtual/yacc
"
+
+RESTRICT="!test? ( test )"
+
if is_cross ; then
# The build assumes the host has libiberty and such when cross-compiling
# its build tools. We should probably make binutils itself build a local
diff --git a/sys-devel/binutils-hppa64/binutils-hppa64-2.31.1-r6.ebuild b/sys-devel/binutils-hppa64/binutils-hppa64-2.31.1-r6.ebuild
index 79a2e1f7bd4a..0d7844e47004 100644
--- a/sys-devel/binutils-hppa64/binutils-hppa64-2.31.1-r6.ebuild
+++ b/sys-devel/binutils-hppa64/binutils-hppa64-2.31.1-r6.ebuild
@@ -87,6 +87,8 @@ DEPEND="${RDEPEND}
virtual/yacc
"
+RESTRICT="!test? ( test )"
+
MY_BUILDDIR=${WORKDIR}/build
S=${WORKDIR}/${P/-hppa64/}
diff --git a/sys-devel/binutils-hppa64/binutils-hppa64-2.32-r1.ebuild b/sys-devel/binutils-hppa64/binutils-hppa64-2.32-r1.ebuild
index e2366d3c123f..9cea689fb6a9 100644
--- a/sys-devel/binutils-hppa64/binutils-hppa64-2.32-r1.ebuild
+++ b/sys-devel/binutils-hppa64/binutils-hppa64-2.32-r1.ebuild
@@ -86,6 +86,8 @@ DEPEND="${RDEPEND}
virtual/yacc
"
+RESTRICT="!test? ( test )"
+
MY_BUILDDIR=${WORKDIR}/build
S=${WORKDIR}/${P/-hppa64/}
diff --git a/sys-devel/binutils-hppa64/binutils-hppa64-2.33.1.ebuild b/sys-devel/binutils-hppa64/binutils-hppa64-2.33.1.ebuild
new file mode 100644
index 000000000000..9c1e764963b4
--- /dev/null
+++ b/sys-devel/binutils-hppa64/binutils-hppa64-2.33.1.ebuild
@@ -0,0 +1,438 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+export CTARGET=hppa64-${CHOST#*-}
+
+inherit eutils libtool flag-o-matic gnuconfig multilib
+
+DESCRIPTION="Tools necessary to build programs"
+HOMEPAGE="https://sourceware.org/binutils/"
+LICENSE="GPL-3+"
+IUSE="default-gold doc +gold multitarget +nls +plugins static-libs test"
+REQUIRED_USE="default-gold? ( gold )"
+
+# Variables that can be set here:
+# PATCH_VER - the patchset version
+# Default: empty, no patching
+# PATCH_BINUTILS_VER - the binutils version in the patchset name
+# - Default: PV
+# PATCH_DEV - Use download URI https://dev.gentoo.org/~{PATCH_DEV}/distfiles/...
+# for the patchsets
+
+PATCH_VER=1
+PATCH_DEV=dilfridge
+
+case ${PV} in
+ 9999)
+ EGIT_REPO_URI="https://sourceware.org/git/binutils-gdb.git"
+ inherit git-r3
+ S=${WORKDIR}/binutils
+ EGIT_CHECKOUT_DIR=${S}
+ SLOT=${PV}
+ ;;
+ *.9999)
+ EGIT_REPO_URI="https://sourceware.org/git/binutils-gdb.git"
+ inherit git-r3
+ S=${WORKDIR}/binutils
+ EGIT_CHECKOUT_DIR=${S}
+ EGIT_BRANCH=$(ver_cut 1-2)
+ EGIT_BRANCH="binutils-${EGIT_BRANCH/./_}-branch"
+ SLOT=$(ver_cut 1-2)
+ ;;
+ *)
+ SRC_URI="mirror://gnu/binutils/binutils-${PV}.tar.xz"
+ SLOT=$(ver_cut 1-2)
+ KEYWORDS="-* ~hppa"
+ ;;
+esac
+
+#
+# The Gentoo patchset
+#
+PATCH_BINUTILS_VER=${PATCH_BINUTILS_VER:-${PV}}
+PATCH_DEV=${PATCH_DEV:-slyfox}
+
+[[ -z ${PATCH_VER} ]] || SRC_URI="${SRC_URI}
+ https://dev.gentoo.org/~${PATCH_DEV}/distfiles/binutils-${PATCH_BINUTILS_VER}-patches-${PATCH_VER}.tar.xz"
+
+#
+# The cross-compile logic
+#
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
+
+#
+# The dependencies
+#
+RDEPEND="
+ >=sys-devel/binutils-config-3
+ sys-libs/zlib
+"
+DEPEND="${RDEPEND}
+ doc? ( sys-apps/texinfo )
+ test? ( dev-util/dejagnu )
+ nls? ( sys-devel/gettext )
+ sys-devel/flex
+ virtual/yacc
+"
+
+RESTRICT="!test? ( test )"
+
+MY_BUILDDIR=${WORKDIR}/build
+S=${WORKDIR}/${P/-hppa64/}
+
+src_unpack() {
+ case ${PV} in
+ *9999)
+ git-r3_src_unpack
+ ;;
+ *)
+ ;;
+ esac
+ default
+ mkdir -p "${MY_BUILDDIR}"
+}
+
+src_prepare() {
+ if [[ ! -z ${PATCH_VER} ]] ; then
+ einfo "Applying binutils-${PATCH_BINUTILS_VER} patchset ${PATCH_VER}"
+ eapply "${WORKDIR}/patch"/*.patch
+ fi
+
+ # This check should probably go somewhere else, like pkg_pretend.
+ if [[ ${CTARGET} == *-uclibc* ]] ; then
+ if grep -qs 'linux-gnu' "${S}"/ltconfig ; then
+ die "sorry, but this binutils doesn't yet support uClibc :("
+ fi
+ fi
+
+ # Make sure our explicit libdir paths don't get clobbered. #562460
+ sed -i \
+ -e 's:@bfdlibdir@:@libdir@:g' \
+ -e 's:@bfdincludedir@:@includedir@:g' \
+ {bfd,opcodes}/Makefile.in || die
+
+ # Fix locale issues if possible #122216
+ if [[ -e ${FILESDIR}/binutils-configure-LANG.patch ]] ; then
+ einfo "Fixing misc issues in configure files"
+ for f in $(find "${S}" -name configure -exec grep -l 'autoconf version 2.13' {} +) ; do
+ ebegin " Updating ${f/${S}\/}"
+ patch "${f}" "${FILESDIR}"/binutils-configure-LANG.patch >& "${T}"/configure-patch.log \
+ || eerror "Please file a bug about this"
+ eend $?
+ done
+ fi
+
+ # Fix conflicts with newer glibc #272594
+ if [[ -e libiberty/testsuite/test-demangle.c ]] ; then
+ sed -i 's:\<getline\>:get_line:g' libiberty/testsuite/test-demangle.c
+ fi
+
+ # Apply things from PATCHES and user dirs
+ default
+
+ # Run misc portage update scripts
+ gnuconfig_update
+ elibtoolize --portage --no-uclibc
+}
+
+toolchain-binutils_bugurl() {
+ printf "https://bugs.gentoo.org/"
+}
+toolchain-binutils_pkgversion() {
+ printf "Gentoo ${PV}"
+ [[ -n ${PATCH_VER} ]] && printf " p${PATCH_VER}"
+}
+
+src_configure() {
+ # Setup some paths
+ LIBPATH=/usr/$(get_libdir)/binutils/${CTARGET}/${PV}
+ INCPATH=${LIBPATH}/include
+ DATAPATH=/usr/share/binutils-data/${CTARGET}/${PV}
+ if is_cross ; then
+ TOOLPATH=/usr/${CHOST}/${CTARGET}
+ else
+ TOOLPATH=/usr/${CTARGET}
+ fi
+ BINPATH=${TOOLPATH}/binutils-bin/${PV}
+
+ # Make sure we filter $LINGUAS so that only ones that
+ # actually work make it through #42033
+ strip-linguas -u */po
+
+ # Keep things sane
+ strip-flags
+
+ local x
+ echo
+ for x in CATEGORY CBUILD CHOST CTARGET CFLAGS LDFLAGS ; do
+ einfo "$(printf '%10s' ${x}:) ${!x}"
+ done
+ echo
+
+ cd "${MY_BUILDDIR}"
+ local myconf=()
+
+ if use plugins ; then
+ myconf+=( --enable-plugins )
+ fi
+ # enable gold (installed as ld.gold) and ld's plugin architecture
+ if use gold ; then
+ myconf+=( --enable-gold )
+ if use default-gold; then
+ myconf+=( --enable-gold=default )
+ fi
+ fi
+
+ if use nls ; then
+ myconf+=( --without-included-gettext )
+ else
+ myconf+=( --disable-nls )
+ fi
+
+ myconf+=( --with-system-zlib )
+
+ # For bi-arch systems, enable a 64bit bfd. This matches
+ # the bi-arch logic in toolchain.eclass. #446946
+ # We used to do it for everyone, but it's slow on 32bit arches. #438522
+ case $(tc-arch) in
+ ppc|sparc|x86) myconf+=( --enable-64-bit-bfd ) ;;
+ esac
+
+ use multitarget && myconf+=( --enable-targets=all --enable-64-bit-bfd )
+
+ [[ -n ${CBUILD} ]] && myconf+=( --build=${CBUILD} )
+
+ is_cross && myconf+=(
+ --with-sysroot="${EPREFIX}"/usr/${CTARGET}
+ --enable-poison-system-directories
+ )
+
+ # glibc-2.3.6 lacks support for this ... so rather than force glibc-2.5+
+ # on everyone in alpha (for now), we'll just enable it when possible
+ has_version ">=${CATEGORY}/glibc-2.5" && myconf+=( --enable-secureplt )
+ has_version ">=sys-libs/glibc-2.5" && myconf+=( --enable-secureplt )
+
+ # mips can't do hash-style=gnu ...
+ if [[ $(tc-arch) != mips ]] ; then
+ myconf+=( --enable-default-hash-style=gnu )
+ fi
+
+ myconf+=(
+ --prefix="${EPREFIX}"/usr
+ --host=${CHOST}
+ --target=${CTARGET}
+ --datadir="${EPREFIX}"${DATAPATH}
+ --datarootdir="${EPREFIX}"${DATAPATH}
+ --infodir="${EPREFIX}"${DATAPATH}/info
+ --mandir="${EPREFIX}"${DATAPATH}/man
+ --bindir="${EPREFIX}"${BINPATH}
+ --libdir="${EPREFIX}"${LIBPATH}
+ --libexecdir="${EPREFIX}"${LIBPATH}
+ --includedir="${EPREFIX}"${INCPATH}
+ --enable-obsolete
+ --enable-shared
+ --enable-threads
+ # Newer versions (>=2.27) offer a configure flag now.
+ --enable-relro
+ # Newer versions (>=2.24) make this an explicit option. #497268
+ --enable-install-libiberty
+ --disable-werror
+ --with-bugurl="$(toolchain-binutils_bugurl)"
+ --with-pkgversion="$(toolchain-binutils_pkgversion)"
+ $(use_enable static-libs static)
+ ${EXTRA_ECONF}
+ # Disable modules that are in a combined binutils/gdb tree. #490566
+ --disable-{gdb,libdecnumber,readline,sim}
+ # Strip out broken static link flags.
+ # https://gcc.gnu.org/PR56750
+ --without-stage1-ldflags
+ # Change SONAME to avoid conflict across
+ # {native,cross}/binutils, binutils-libs. #666100
+ --with-extra-soversion-suffix=gentoo-${CATEGORY}-${PN}-$(usex multitarget mt st)
+ )
+ echo ./configure "${myconf[@]}"
+ "${S}"/configure "${myconf[@]}" || die
+
+ # Prevent makeinfo from running if doc is unset.
+ if ! use doc ; then
+ sed -i \
+ -e '/^MAKEINFO/s:=.*:= true:' \
+ Makefile || die
+ fi
+}
+
+src_compile() {
+ cd "${MY_BUILDDIR}"
+ # see Note [tooldir hack for ldscripts]
+ emake tooldir="${EPREFIX}${TOOLPATH}" all
+
+ # only build info pages if the user wants them
+ if use doc ; then
+ emake info
+ fi
+
+ # we nuke the manpages when we're left with junk
+ # (like when we bootstrap, no perl -> no manpages)
+ find . -name '*.1' -a -size 0 -delete
+}
+
+src_test() {
+ cd "${MY_BUILDDIR}"
+ # bug 637066
+ filter-flags -Wall -Wreturn-type
+ emake -k check
+}
+
+src_install() {
+ local x d
+
+ cd "${MY_BUILDDIR}"
+ # see Note [tooldir hack for ldscripts]
+ emake DESTDIR="${D}" tooldir="${EPREFIX}${LIBPATH}" install
+ rm -rf "${ED}"/${LIBPATH}/bin
+ use static-libs || find "${ED}" -name '*.la' -delete
+
+ # Newer versions of binutils get fancy with ${LIBPATH} #171905
+ cd "${ED}"/${LIBPATH}
+ for d in ../* ; do
+ [[ ${d} == ../${PV} ]] && continue
+ mv ${d}/* . || die
+ rmdir ${d} || die
+ done
+
+ # Now we collect everything intp the proper SLOT-ed dirs
+ # When something is built to cross-compile, it installs into
+ # /usr/$CHOST/ by default ... we have to 'fix' that :)
+ if is_cross ; then
+ cd "${ED}"/${BINPATH}
+ for x in * ; do
+ mv ${x} ${x/${CTARGET}-}
+ done
+
+ if [[ -d ${ED}/usr/${CHOST}/${CTARGET} ]] ; then
+ mv "${ED}"/usr/${CHOST}/${CTARGET}/include "${ED}"/${INCPATH}
+ mv "${ED}"/usr/${CHOST}/${CTARGET}/lib/* "${ED}"/${LIBPATH}/
+ rm -r "${ED}"/usr/${CHOST}/{include,lib}
+ fi
+ fi
+ insinto ${INCPATH}
+ local libiberty_headers=(
+ # Not all the libiberty headers. See libiberty/Makefile.in:install_to_libdir.
+ demangle.h
+ dyn-string.h
+ fibheap.h
+ hashtab.h
+ libiberty.h
+ objalloc.h
+ splay-tree.h
+ )
+ doins "${libiberty_headers[@]/#/${S}/include/}" || die
+ if [[ -d ${ED}/${LIBPATH}/lib ]] ; then
+ mv "${ED}"/${LIBPATH}/lib/* "${ED}"/${LIBPATH}/
+ rm -r "${ED}"/${LIBPATH}/lib
+ fi
+
+ # Generate an env.d entry for this binutils
+ insinto /etc/env.d/binutils
+ cat <<-EOF > "${T}"/env.d
+ TARGET="${CTARGET}"
+ VER="${PV}"
+ LIBPATH="${EPREFIX}${LIBPATH}"
+ EOF
+ newins "${T}"/env.d ${CTARGET}-${PV}
+
+ # Handle documentation
+ if ! is_cross ; then
+ cd "${S}"
+ dodoc README
+ docinto bfd
+ dodoc bfd/ChangeLog* bfd/README bfd/PORTING bfd/TODO
+ docinto binutils
+ dodoc binutils/ChangeLog binutils/NEWS binutils/README
+ docinto gas
+ dodoc gas/ChangeLog* gas/CONTRIBUTORS gas/NEWS gas/README*
+ docinto gprof
+ dodoc gprof/ChangeLog* gprof/TEST gprof/TODO gprof/bbconv.pl
+ docinto ld
+ dodoc ld/ChangeLog* ld/README ld/NEWS ld/TODO
+ docinto libiberty
+ dodoc libiberty/ChangeLog* libiberty/README
+ docinto opcodes
+ dodoc opcodes/ChangeLog*
+ fi
+
+ # Remove shared info pages
+ rm -f "${ED}"/${DATAPATH}/info/{dir,configure.info,standards.info}
+
+ # Trim all empty dirs
+ find "${ED}" -depth -type d -exec rmdir {} + 2>/dev/null
+
+ # the hppa64 hack; this should go into 9999 as a PN-conditional
+ # tweak the default fake list a little bit
+ cd "${D}"/etc/env.d/binutils
+ sed -i '/FAKE_TARGETS=/s:"$: hppa64-linux":' ${CTARGET}-${PV} || die
+}
+
+pkg_postinst() {
+ # Make sure this ${CTARGET} has a binutils version selected
+ [[ -e ${EROOT}/etc/env.d/binutils/config-${CTARGET} ]] && return 0
+ binutils-config ${CTARGET}-${PV}
+}
+
+pkg_postrm() {
+ local current_profile=$(binutils-config -c ${CTARGET})
+
+ # If no other versions exist, then uninstall for this
+ # target ... otherwise, switch to the newest version
+ # Note: only do this if this version is unmerged. We
+ # rerun binutils-config if this is a remerge, as
+ # we want the mtimes on the symlinks updated (if
+ # it is the same as the current selected profile)
+ if [[ ! -e ${EPREFIX}${BINPATH}/ld ]] && [[ ${current_profile} == ${CTARGET}-${PV} ]] ; then
+ local choice=$(binutils-config -l | grep ${CTARGET} | awk '{print $2}')
+ choice=${choice//$'\n'/ }
+ choice=${choice/* }
+ if [[ -z ${choice} ]] ; then
+ binutils-config -u ${CTARGET}
+ else
+ binutils-config ${choice}
+ fi
+ elif [[ $(CHOST=${CTARGET} binutils-config -c) == ${CTARGET}-${PV} ]] ; then
+ binutils-config ${CTARGET}-${PV}
+ fi
+}
+# Note [slotting support]
+# -----------------------
+# Gentoo's layout for binutils files is non-standard as Gentoo
+# supports slotted installation for binutils. Many tools
+# still expect binutils to reside in known locations.
+# binutils-config package restores symlinks into known locations,
+# like:
+# /usr/bin/${CTARGET}-<tool>
+# /usr/bin/${CHOST}/${CTARGET}/lib/ldscrips
+# /usr/include/
+#
+# Note [tooldir hack for ldscripts]
+# ---------------------------------
+# Build system does not allow ./configure to tweak every location
+# we need for slotting binutils hence all the shuffling in
+# src_install(). This note is about SCRIPTDIR define handling.
+#
+# SCRIPTDIR defines 'ldscripts/' directory location. SCRIPTDIR value
+# is set at build-time in ld/Makefile.am as: 'scriptdir = $(tooldir)/lib'
+# and hardcoded as -DSCRIPTDIR='"$(scriptdir)"' at compile time.
+# Thus we can't just move files around after compilation finished.
+#
+# Our goal is the following:
+# - at build-time set scriptdir to point to symlinked location:
+# ${TOOLPATH}: /usr/${CHOST} (or /usr/${CHOST}/${CTARGET} for cross-case)
+# - at install-time set scriptdir to point to slotted location:
+# ${LIBPATH}: /usr/$(get_libdir)/binutils/${CTARGET}/${PV}