grep: gettext is not mandatory
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Fri, 19 May 2017 21:31:30 +0000 (23:31 +0200)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Wed, 31 May 2017 21:05:06 +0000 (23:05 +0200)
Even when locales are enabled, gettext is not mandatory to build
grep, i.e the following defconfig builds fine:

BR2_arm=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y
BR2_TOOLCHAIN_EXTERNAL_URL="http://autobuild.buildroot.org/toolchains/tarballs/br-arm-full-2017.02-1096-g54a5333.tar.bz2"
BR2_TOOLCHAIN_EXTERNAL_GCC_4_8=y
BR2_TOOLCHAIN_EXTERNAL_HEADERS_3_10=y
BR2_TOOLCHAIN_EXTERNAL_LOCALE=y
BR2_TOOLCHAIN_EXTERNAL_CXX=y
BR2_INIT_NONE=y
BR2_SYSTEM_BIN_SH_NONE=y
BR2_PACKAGE_GETTEXT=y
BR2_PACKAGE_GREP=y

However, if gettext provides libintl, it gets used. Therefore this
commit moves gettext from a mandatory dependency to an optional
dependency.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/grep/Config.in
package/grep/grep.mk

index 64276506f0554d7dbbd23c4f501f110d7f96fa22..5b0471b4c0283a5b533691b7f822e2e1a372c052 100644 (file)
@@ -2,7 +2,6 @@ config BR2_PACKAGE_GREP
        bool "grep"
        depends on BR2_USE_WCHAR
        depends on BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
-       select BR2_PACKAGE_GETTEXT if BR2_NEEDS_GETTEXT_IF_LOCALE
        help
          The GNU regular expression matcher.
 
index 92a915cf1ca7d0bd39c34ad340f9ca741c0a5992..5101ddacf6459c363dfa32b7628e8a28581ea38a 100644 (file)
@@ -11,7 +11,11 @@ GREP_LICENSE = GPL-3.0+
 GREP_LICENSE_FILES = COPYING
 GREP_CONF_OPTS = --disable-perl-regexp \
        $(if $(BR2_TOOLCHAIN_USES_MUSL),--with-included-regex)
-GREP_DEPENDENCIES = $(if $(BR2_NEEDS_GETTEXT_IF_LOCALE),gettext)
+
+# Can use libintl if available
+ifeq ($(BR2_PACKAGE_GETTEXT),y)
+GREP_DEPENDENCIES += gettext
+endif
 
 # link with iconv if enabled
 ifeq ($(BR2_PACKAGE_LIBICONV),y)