[backfire] merge r25302 - this is needed for upcoming changes in the packages feed
authorjow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Wed, 2 Feb 2011 01:29:07 +0000 (01:29 +0000)
committerjow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Wed, 2 Feb 2011 01:29:07 +0000 (01:29 +0000)
git-svn-id: svn://svn.openwrt.org/openwrt/branches/backfire@25303 3c298f89-4303-0410-b956-a3cf2f4a3e73

Config.in
include/nls.mk [new file with mode: 0644]

index f4ab5271f74a06ee01637d82973916750f4e5f91..f1694c7badf1e38449bc4dbb891321d366d5d02f 100644 (file)
--- a/Config.in
+++ b/Config.in
@@ -138,6 +138,13 @@ menu "Global build settings"
                  In case software provides optional support for patented functionality,
                  this optional support will get disabled for this package.
 
                  In case software provides optional support for patented functionality,
                  this optional support will get disabled for this package.
 
+       config BUILD_NLS
+               default n
+               bool "Compile with full language support"
+               help
+                 When this option is enabled, packages are built with the full versions of iconv and GNU gettext
+                 instead of the default OpenWrt stubs.
+
        config LARGEFILE
                bool
                prompt "Enable large file (files > 2 GB) support"
        config LARGEFILE
                bool
                prompt "Enable large file (files > 2 GB) support"
diff --git a/include/nls.mk b/include/nls.mk
new file mode 100644 (file)
index 0000000..7743da4
--- /dev/null
@@ -0,0 +1,40 @@
+#
+# Copyright (C) 2011 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+# iconv full
+ifeq ($(CONFIG_BUILD_NLS),y)
+       ICONV_PREFIX:=$(STAGING_DIR)/usr/lib/libiconv-full
+       ICONV_FULL:=1
+
+       INTL_PREFIX:=$(STAGING_DIR)/usr/lib/libintl-full
+       INTL_FULL:=1
+
+# iconv stub
+else
+       ICONV_PREFIX:=$(STAGING_DIR)/usr/lib/libiconv-stub
+       ICONV_FULL:=
+
+       INTL_PREFIX:=$(STAGING_DIR)/usr/lib/libintl-stub
+       INTL_FULL:=
+endif
+
+PKG_CONFIG_DEPENDS += CONFIG_BUILD_NLS
+PKG_BUILD_DEPENDS += !BUILD_NLS:libiconv !BUILD_NLS:gettext
+
+ICONV_DEPENDS:=+BUILD_NLS:libiconv-full
+ICONV_CFLAGS:=-I$(ICONV_PREFIX)/include
+ICONV_CPPFLAGS:=-I$(ICONV_PREFIX)/include
+ICONV_LDFLAGS:=-L$(ICONV_PREFIX)/lib
+
+INTL_DEPENDS:=+BUILD_NLS:libintl-full
+INTL_CFLAGS:=-I$(INTL_PREFIX)/include
+INTL_CPPFLAGS:=-I$(INTL_PREFIX)/include
+INTL_LDFLAGS:=-L$(INTL_PREFIX)/lib
+
+TARGET_CFLAGS += $(ICONV_CFLAGS) $(INTL_CFLAGS)
+TARGET_CPPFLAGS += $(ICONV_CFLAGS) $(INTL_CPPFLAGS)
+TARGET_LDFLAGS += $(ICONV_LDFLAGS) $(INTL_LDFLAGS)