binutils-libs-2.28.ebuild 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="5"
  4. PATCHVER="1.0"
  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"
  17. COMMON_DEPEND="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. --enable-obsolete
  38. --enable-shared
  39. --enable-threads
  40. # Newer versions (>=2.24) make this an explicit option. #497268
  41. --enable-install-libiberty
  42. --disable-werror
  43. --with-bugurl="https://bugs.gentoo.org/"
  44. --with-pkgversion="$(pkgversion)"
  45. $(use_enable static-libs static)
  46. # The binutils eclass enables this flag for all bi-arch builds,
  47. # but other tools often don't care about that support. Put it
  48. # beyond a flag if people really want it, but otherwise leave
  49. # it disabled as it can slow things down on 32bit arches. #438522
  50. $(use_enable 64-bit-bfd)
  51. # This only disables building in the zlib subdir.
  52. # For binutils itself, it'll use the system version. #591516
  53. --without-zlib
  54. --with-system-zlib
  55. # We only care about the libs, so disable programs. #528088
  56. --disable-{binutils,etc,ld,gas,gold,gprof}
  57. # Disable modules that are in a combined binutils/gdb tree. #490566
  58. --disable-{gdb,libdecnumber,readline,sim}
  59. # Strip out broken static link flags.
  60. # https://gcc.gnu.org/PR56750
  61. --without-stage1-ldflags
  62. )
  63. use multitarget && myconf+=( --enable-targets=all --enable-64-bit-bfd )
  64. use nls \
  65. && myconf+=( --without-included-gettext ) \
  66. || myconf+=( --disable-nls )
  67. ECONF_SOURCE=${S} \
  68. econf "${myconf[@]}"
  69. }
  70. multilib_src_install() {
  71. default
  72. # Provide libiberty.h directly.
  73. dosym libiberty/libiberty.h /usr/include/libiberty.h
  74. }
  75. multilib_src_install_all() {
  76. use static-libs || find "${ED}"/usr -name '*.la' -delete
  77. }