binutils-libs-2.25.1-r2.ebuild 2.7 KB

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