1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
8 inherit eutils toolchain-funcs multilib-minimal
13 DESCRIPTION="Core binutils libraries (libbfd, libopcodes, libiberty) for external packages"
14 HOMEPAGE="https://sourceware.org/binutils/"
15 SRC_URI="mirror://gnu/binutils/${MY_P}.tar.bz2
16 mirror://gentoo/${MY_P}-patches-${PATCHVER}.tar.xz"
18 LICENSE="|| ( GPL-3 LGPL-3 )"
19 # The shared lib SONAMEs use the ${PV} in them.
21 KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
22 IUSE="64-bit-bfd multitarget nls static-libs"
24 COMMON_DEPEND="sys-libs/zlib[${MULTILIB_USEDEP}]"
25 DEPEND="${COMMON_DEPEND}
26 >=sys-apps/texinfo-4.7
27 nls? ( sys-devel/gettext )"
28 # Need a newer binutils-config that'll reset include/lib symlinks for us.
29 RDEPEND="${COMMON_DEPEND}
30 >=sys-devel/binutils-config-5
31 nls? ( !<sys-devel/gdb-7.10-r1[nls] )"
33 S="${WORKDIR}/${MY_P}"
35 MULTILIB_WRAPPED_HEADERS=(
40 EPATCH_SUFFIX="patch" epatch "${WORKDIR}"/patch
44 printf "Gentoo ${PVR}"
45 [[ -n ${PATCHVER} ]] && printf " p${PATCHVER}"
48 multilib_src_configure() {
53 # Newer versions (>=2.24) make this an explicit option. #497268
54 --enable-install-libiberty
56 --with-bugurl="https://bugs.gentoo.org/"
57 --with-pkgversion="$(pkgversion)"
58 $(use_enable static-libs static)
59 # The binutils eclass enables this flag for all bi-arch builds,
60 # but other tools often don't care about that support. Put it
61 # beyond a flag if people really want it, but otherwise leave
62 # it disabled as it can slow things down on 32bit arches. #438522
63 $(use_enable 64-bit-bfd)
64 # This only disables building in the zlib subdir.
65 # For binutils itself, it'll use the system version. #591516
68 # We only care about the libs, so disable programs. #528088
69 --disable-{binutils,etc,ld,gas,gold,gprof}
70 # Disable modules that are in a combined binutils/gdb tree. #490566
71 --disable-{gdb,libdecnumber,readline,sim}
72 # Strip out broken static link flags.
73 # https://gcc.gnu.org/PR56750
74 --without-stage1-ldflags
77 use multitarget && myconf+=( --enable-targets=all --enable-64-bit-bfd )
80 && myconf+=( --without-included-gettext ) \
81 || myconf+=( --disable-nls )
87 multilib_src_install() {
89 # Provide libiberty.h directly.
90 dosym libiberty/libiberty.h /usr/include/libiberty.h
93 multilib_src_install_all() {
94 use static-libs || find "${ED}"/usr -name '*.la' -delete