alsa-utils: fix linking with intl
authorVicente Olivert Riera <Vincent.Riera@imgtec.com>
Tue, 11 Nov 2014 15:51:22 +0000 (15:51 +0000)
committerPeter Korsgaard <peter@korsgaard.com>
Tue, 11 Nov 2014 20:47:21 +0000 (21:47 +0100)
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:

alsamixer-cli.o: In function `main':
cli.c:(.text.startup+0x4d): undefined reference to `libintl_textdomain'
cli.c:(.text.startup+0xc1): undefined reference to `libintl_gettext'
cli.c:(.text.startup+0xd5): undefined reference to `libintl_gettext'
cli.c:(.text.startup+0xe9): undefined reference to `libintl_gettext'
cli.c:(.text.startup+0x1fd): undefined reference to `libintl_gettext'
cli.c:(.text.startup+0x223): undefined reference to `libintl_gettext'

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

[Peter: correct autobuilder reference]
Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
package/alsa-utils/Config.in
package/alsa-utils/alsa-utils.mk

index 58ecf51d0fb8deeb286177a5f45af7d84b5e2e43..cc667115084bb091281bd94c8e4f3404614249e7 100644 (file)
@@ -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.
index 208c5fc9db7482dfe281d904f47713ee7adc857b..17895c30af60f4b723439ae1e68654bfe534bf78 100644 (file)
@@ -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