kumquat-buildroot/package/xfsprogs/xfsprogs.mk
Yann E. MORIN 779ec7f36d package/xfsprogs: fix static build
xfsprogs links to some libraries from util-linux. Those in turn may use
i18n functions when locales are enabled.

When doing a uClibc build, those i18n functions are provided by the
libintl library from the gettext package.

xfsprogs does not use pkgconfig to find the util-linux libraries, so it
misses the Requires.private field from libblkid, and thus misses the
Libs.private field from libuid.

And so a static link fails because of undefined references to i18n
symbols.

Furthermore, xfsprogs does not use automake; the hand-made Makefiles do
not make use of the LIBS variable set by configure.

We fix that in two ways:

  - pass LIBS=-lintl to configure, so that the configure step has a
    chance to succeed  (as suggested by Waldemar)

  - patch a Makefile to link with EXTRALIBS, and pass EXTRALIBS via
    XFSPROGS_MAKE_OPTS

Fixes:
    http://autobuild.buildroot.org/results/503/50314716a9f72e8bb238e52e9dc342c68f7e0b8b/
    http://autobuild.buildroot.org/results/253/253a024698b55dece992b2631e30edf4ff9092f7/
    http://autobuild.buildroot.org/results/3fe/3fe0d96cf13af12b0051a95f7865d4e38f4a78af/
    http://autobuild.buildroot.org/results/d48/d48e61785d25d33106b7dab1b5cb200cf27d4044/
    ...

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Waldemar Brodkorb <wbx@openadk.org>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-02-26 14:31:58 +01:00

41 lines
1.4 KiB
Makefile

################################################################################
#
# xfsprogs
#
################################################################################
XFSPROGS_VERSION = 4.8.0
XFSPROGS_SITE = $(BR2_KERNEL_MIRROR)/linux/utils/fs/xfs/xfsprogs
XFSPROGS_SOURCE = xfsprogs-$(XFSPROGS_VERSION).tar.xz
XFSPROGS_DEPENDENCIES = util-linux
XFSPROGS_CONF_ENV = ac_cv_header_aio_h=yes ac_cv_lib_rt_lio_listio=yes
XFSPROGS_CONF_OPTS = \
--enable-lib64=no \
--enable-gettext=no \
INSTALL_USER=root \
INSTALL_GROUP=root \
--enable-static
# xfsprogs links some of its programs to libs from util-linux, which use
# i18n functions. For shared-only builds, that's automatically pulled in.
# Static builds need some help, though...
#
# No need to depend on gettext in this case: xfsprogs does not use it for
# itself; util-linux does need it and has it in its own dependencies.
#
# xfsprogs' buildsystem uses hand-made Makefiles, not automake, and they
# do not use the LIBS variable set by configure. So we use EXTRALIBS that
# is added by our patch.
#
# It is not needed to propagate the EXTRALIBS to the install step.
ifeq ($(BR2_STATIC_LIBS)$(BR2_SHARED_STATIC_LIBS)$(BR2_NEEDS_GETTEXT_IF_LOCALE),yy)
XFSPROGS_CONF_OPTS += LIBS=-lintl
XFSPROGS_MAKE_OPTS = EXTRALIBS=-lintl
endif
XFSPROGS_INSTALL_TARGET_OPTS = DIST_ROOT=$(TARGET_DIR) install
$(eval $(autotools-package))