Skip to contentSkip to conversation

alsa-utils: fix linking with intl

PATCH New Vicente Olivert Riera 2 participants 3 messages Nov 11, 2014 – Nov 12, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 alsa-utils: fix linking with intl

alsa-utils needs to link with intl if the toolchain needs gettext and locale is set. Otherwise we will see an error like this one:

option.o: In function `canonicalise_opt':
option.c:(.text+0x3bc): undefined reference to `libintl_gettext'

Fixes:
http://autobuild.buildroot.net/results/276/276581f6dbbe330799c3a7eaa26b453e38a22907/

---
 package/alsa-utils/Config.in     |    1 +
 package/alsa-utils/alsa-utils.mk |   10 +++++-----
 2 files changed, 6 insertions(+), 5 deletions(-)
package/alsa-utils/Config.in +1 -0
index 58ecf51..cc66711 100644
@@ -8,6 +8,7 @@ config BR2_PACKAGE_ALSA_UTILS
 	depends on BR2_LARGEFILE
 	depends on BR2_TOOLCHAIN_HAS_THREADS # alsa-lib
 	select BR2_PACKAGE_ALSA_LIB
+	select BR2_PACKAGE_GETTEXT if BR2_NEEDS_GETTEXT_IF_LOCALE
 	help
 	  This package contains the command line utilities for the ALSA
 	  project.
package/alsa-utils/alsa-utils.mk +5 -5
index 208c5fc..17895c3 100644
@@ -13,11 +13,6 @@ ALSA_UTILS_INSTALL_STAGING = YES
 ALSA_UTILS_DEPENDENCIES = host-gettext host-pkgconf alsa-lib \
 	$(if $(BR2_PACKAGE_NCURSES),ncurses)
 
-# gettext support is optional
-ifeq ($(BR2_PACKAGE_GETTEXT),y)
-ALSA_UTILS_DEPENDENCIES += gettext
-endif
-
 ALSA_UTILS_CONF_ENV = \
 	ac_cv_prog_ncurses5_config=$(STAGING_DIR)/usr/bin/$(NCURSES_CONFIG_SCRIPTS)
 
@@ -25,6 +20,11 @@ ALSA_UTILS_CONF_OPTS = \
 	--disable-xmlto \
 	--with-curses=$(if $(BR2_PACKAGE_NCURSES_WCHAR),ncursesw,ncurses)
 
+ifeq ($(BR2_NEEDS_GETTEXT_IF_LOCALE),y)
+ALSA_UTILS_DEPENDENCIES += gettext
+ALSA_UTILS_CONF_ENV += LIBS=-lintl
+endif
+
 ifneq ($(BR2_PACKAGE_ALSA_UTILS_ALSAMIXER),y)
 ALSA_UTILS_CONF_OPTS += --disable-alsamixer --disable-alsatest
 endif
Signature · 1 line
1.7.1
#1 lore raw

PATCH 1/1 alsa-utils: fix linking with intl

Quoted 10 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Vicente" == Vicente Olivert Riera <[email protected]> writes:

alsa-utils needs to link with intl if the toolchain needs gettext and locale is set. Otherwise we will see an error like this one:

option.o: In function `canonicalise_opt':
option.c:(.text+0x3bc): undefined reference to `libintl_gettext'

Fixes:
http://autobuild.buildroot.net/results/276/276581f6dbbe330799c3a7eaa26b453e38a22907/

That autobuild link and the error message refers to an issue with dnsmasq, but the patch seems OK so I've committed with a reference to this autobuild issue instead:

http://autobuild.buildroot.net/results/707/707016a2490fc97b98d17e2b6a9c6423a56bb4a9/

Signature · 1 line
Bye, Peter Korsgaard
#2 lore raw

PATCH 1/1 alsa-utils: fix linking with intl

Dear Peter Korsgaard,

Quoted 8 lines · Peter Korsgaard
Quoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Vicente" == Vicente Olivert Riera <[email protected]> writes:

alsa-utils needs to link with intl if the toolchain needs gettext and locale is set. Otherwise we will see an error like this one:

option.o: In function `canonicalise_opt':
option.c:(.text+0x3bc): undefined reference to `libintl_gettext'

Quoted 9 lines
Quoted 2 lines

Fixes:
http://autobuild.buildroot.net/results/276/276581f6dbbe330799c3a7eaa26b453e38a22907/

That autobuild link and the error message refers to an issue with dnsmasq, but the patch seems OK so I've committed with a reference to this autobuild issue instead:

http://autobuild.buildroot.net/results/707/707016a2490fc97b98d17e2b6a9c6423a56bb4a9/

sorry about that. I had too many tabs opened in my Chromium :-(

Thanks for fixing it.

Cheers,

Signature · 5 lines
Vicente Olivert Riera
Graduate Software Engineer, MIPS Processor IP
Imagination Technologies Limited
t: +44 (0)113 2429814
www.imgtec.com