diff mbox

alsa-utils: fix linking with intl

Message ID 1415721082-15809-1-git-send-email-Vincent.Riera@imgtec.com
State Accepted
Commit 48fe144111652547cf72d2bf3e8e15f36ee40b6d
Headers show

Commit Message

Vicente Olivert Riera Nov. 11, 2014, 3:51 p.m. UTC
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/

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

Comments

Peter Korsgaard Nov. 11, 2014, 8:47 p.m. UTC | #1
>>>>> "Vicente" == Vicente Olivert Riera <Vincent.Riera@imgtec.com> 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/
Vicente Olivert Riera Nov. 12, 2014, 9:57 a.m. UTC | #2
Dear Peter Korsgaard,

On 11/11/2014 08:47 PM, Peter Korsgaard wrote:
>>>>>> "Vicente" == Vicente Olivert Riera <Vincent.Riera@imgtec.com> 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/
> 

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

Thanks for fixing it.

Cheers,
diff mbox

Patch

diff --git a/package/alsa-utils/Config.in b/package/alsa-utils/Config.in
index 58ecf51..cc66711 100644
--- a/package/alsa-utils/Config.in
+++ b/package/alsa-utils/Config.in
@@ -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.
diff --git a/package/alsa-utils/alsa-utils.mk b/package/alsa-utils/alsa-utils.mk
index 208c5fc..17895c3 100644
--- a/package/alsa-utils/alsa-utils.mk
+++ b/package/alsa-utils/alsa-utils.mk
@@ -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