From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] util-linux: add -lcurses to LDFLAGS when static linking
Date: Mon, 19 Sep 2016 19:21:44 +0200 [thread overview]
Message-ID: <20160919192144.73a7492d@free-electrons.com> (raw)
In-Reply-To: <20160918101141.20574-1-judge.packham@gmail.com>
Hello,
On Sun, 18 Sep 2016 22:11:41 +1200, Chris Packham wrote:
> I'm not sure that this is the "right" fix but it seems to do the trick. I also
> tried using LIBS instead of LDFLAGS which got the configure step to pass but
> didn't propagate to the final link.
The reason why LIBS is not taken into account during the build is
because the configure does LIBS="" at the end. This is also why we're
already passing LIBS=-lintl at build time.
So at the end, I've committed the following fix:
diff --git a/package/util-linux/util-linux.mk
b/package/util-linux/util-linux.mk
index 82230bc..82a726e 100644
--- a/package/util-linux/util-linux.mk
+++ b/package/util-linux/util-linux.mk
@@ -49,13 +49,20 @@ endif
ifeq ($(BR2_NEEDS_GETTEXT_IF_LOCALE),y)
UTIL_LINUX_DEPENDENCIES += gettext
-UTIL_LINUX_MAKE_OPTS += LIBS=-lintl
+UTIL_LINUX_LIBS += -lintl
endif
ifeq ($(BR2_PACKAGE_LIBCAP_NG),y)
UTIL_LINUX_DEPENDENCIES += libcap-ng
endif
+# Unfortunately, the util-linux does LIBS="" at the end of its
+# configure script. So we have to pass the proper LIBS value when
+# calling the configure script to make configure tests pass properly,
+# and then pass it again at build time.
+UTIL_LINUX_CONF_ENV += LIBS="$(UTIL_LINUX_LIBS)"
+UTIL_LINUX_MAKE_OPTS += LIBS="$(UTIL_LINUX_LIBS)"
+
# Used by cramfs utils
UTIL_LINUX_DEPENDENCIES += $(if $(BR2_PACKAGE_ZLIB),zlib)
@@ -148,6 +155,7 @@ endif
ifeq ($(BR2_PACKAGE_READLINE),y)
UTIL_LINUX_CONF_OPTS += --with-readline
+UTIL_LINUX_LIBS += $(if $(BR2_STATIC_LIBS),-lcurses)
UTIL_LINUX_DEPENDENCIES += readline
else
UTIL_LINUX_CONF_OPTS += --without-readline
It is worth mentioning that a much better fix would be for readline to
provide a pkg-config file, and have util-linux use it. The latest
version of readline (7.0) has a pkg-config file, but does not install
it. So for the time being, the above patch will hopefully do the trick.
Thanks for your initial investigation!
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
prev parent reply other threads:[~2016-09-19 17:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-18 10:11 [Buildroot] [PATCH] util-linux: add -lcurses to LDFLAGS when static linking Chris Packham
2016-09-19 12:51 ` Carlos Santos
2016-09-19 17:21 ` Thomas Petazzoni [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160919192144.73a7492d@free-electrons.com \
--to=thomas.petazzoni@free-electrons.com \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox