Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] lightning: add -lintl only when needed
@ 2015-01-20 14:24 Vicente Olivert Riera
  2015-01-25 17:16 ` Thomas Petazzoni
  0 siblings, 1 reply; 2+ messages in thread
From: Vicente Olivert Riera @ 2015-01-20 14:24 UTC (permalink / raw)
  To: buildroot

Adding -lintl to LIBS causes a failure in the configure phase when using
a toolchain which already has locale support because the intl library is
not present in the staging area. We fix this by adding -lintl only when
is needed.

This is the configure error:

checking whether the C compiler works... no
configure: error: in
`/br/output/build/lightning-2.0.5':
configure: error: C compiler cannot create executables
See `config.log' for more details

This is the message in the config.log:

configure:3351: /br/output/host/usr/bin/mips-linux-gnu-gcc
-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os
-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
conftest.c -lintl >&5
/br/output/host/opt/ext-toolchain/bin/../lib/gcc/mips-linux-gnu/4.9.1/../../../../mips-linux-gnu/bin/ld:
cannot find -lintl
collect2: error: ld returned 1 exit status

Fixes:
  http://autobuild.buildroot.net/results/280/28006ab35379a9b7f380d40b99a760bec1b69e84/

Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
---
 package/lightning/Config.in    |    1 +
 package/lightning/lightning.mk |    5 ++++-
 2 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/package/lightning/Config.in b/package/lightning/Config.in
index 8caf39f..cd5ab96 100644
--- a/package/lightning/Config.in
+++ b/package/lightning/Config.in
@@ -14,6 +14,7 @@ config BR2_PACKAGE_LIGHTNING_DISASSEMBLER
 	bool "enable disassembler"
 	select BR2_PACKAGE_BINUTILS
 	select BR2_PACKAGE_ZLIB
+	select BR2_PACKAGE_GETTEXT if BR2_NEEDS_GETTEXT_IF_LOCALE
 	depends on !BR2_aarch64 && !BR2_nios2 # binutils
 	depends on BR2_USE_WCHAR # binutils
 	help
diff --git a/package/lightning/lightning.mk b/package/lightning/lightning.mk
index 00fed73..33831e2 100644
--- a/package/lightning/lightning.mk
+++ b/package/lightning/lightning.mk
@@ -17,7 +17,10 @@ ifeq ($(BR2_PACKAGE_LIGHTNING_DISASSEMBLER),y)
 LIGHTNING_DEPENDENCIES += binutils zlib
 LIGHTNING_CONF_OPTS += --enable-disassembler
 # binutils libraries are not explicitly linked against gettext
-LIGHTNING_CONF_ENV += $(if $(BR2_PACKAGE_GETTEXT),LIBS=-lintl)
+ifeq ($(BR2_NEEDS_GETTEXT_IF_LOCALE),y)
+LIGHTNING_DEPENDENCIES += gettext
+LIGHTNING_CONF_ENV += LIBS=-lintl
+endif
 endif
 
 $(eval $(autotools-package))
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-01-25 17:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-20 14:24 [Buildroot] [PATCH] lightning: add -lintl only when needed Vicente Olivert Riera
2015-01-25 17:16 ` Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox