buildroot/package/libiberty/libiberty.mk
Adam Duskett 9c2126c963 package/libiberty: new package
Some packages, like prelink-cross, want to use libiberty but do not bundle
their own instance (which is good!).

However, libiberty is made for being bundled in packages: all GNU
packages that use libiberty (gcc, Binutils, gdb, et al...) all have their own
bundled variant. This common practice means that there is no official upstream
for libiberty, the closest being as part of the combined Binutils-gdb tree.

So we introduce a new host-only package, that installs just libiberty from a
Binutils released tarball.

Again, as packages usually bundle libiberty, it usually only installs a static
version. Furthermore, it does not obey the usual --enable-shared and
--disable-static flags; it only ever builds a static version.

Furthermore, -fPIC is not used with this library, but some packages may pick it
to build shared objects. This behavior is the case for host-gdb, for example,
which accidentally picks that library instead of its internal one.

So, rather than fix the various gdb versions and variants we can use, we ensure
that the libiberty we install is usable in shared objects, and we always build
before host-gdb.

Signed-off-by: Adam Duskett <Aduskett@gmail.com>
[yann.morin.1998@free.fr:
  - fix DL_SUBDIR for a host-only package
  - add licensing info
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2020-02-20 22:06:39 +01:00

33 lines
1.1 KiB
Makefile

################################################################################
#
# libiberty
#
################################################################################
LIBIBERTY_VERSION = 2.32
LIBIBERTY_SOURCE = binutils-$(LIBIBERTY_VERSION).tar.xz
LIBIBERTY_SITE = $(BR2_GNU_MIRROR)/binutils
HOST_LIBIBERTY_DL_SUBDIR = binutils
# We're only building libiberty here, not the full binutils suite
LIBIBERTY_LICENSE = LGPL-2.1+
LIBIBERTY_LICENSE_FILES = COPYING.LIB
LIBIBERTY_SUBDIR = libiberty
# We explicitly disable multilib, as we do in binutils.
# By default, libiberty installs nothing, so we must force it.
HOST_LIBIBERTY_CONF_OPTS = \
--disable-multilib \
--enable-install-libiberty
# Some packages (e.g. host-gdb) will pick this library and build shared
# objects with it. But libiberty does not honour the --enable-shared and
# --disable-static flags; it only ever builds a static library no matter
# what. So we must force -fPIC in build flags.
HOST_LIBIBERTY_CONF_ENV = \
CFLAGS="$(HOST_CFLAGS) -fPIC" \
LDFLAGS="$(HOST_LDFLAGS) -fPIC"
$(eval $(host-autotools-package))