Browse Source

rework intl/iconv/locale configuration for uClibc-ng toolchains

Waldemar Brodkorb 6 years ago
parent
commit
1cf04b9efd

+ 5 - 1
adk/tools/pkgmaker.c

@@ -910,7 +910,11 @@ int main() {
 							fprintf(cfg, "\tselect ADK_PACKAGE_LIBSTDCXX\n");
 						}
 						if (strncmp(token, "iconv", 5) == 0)
-							fprintf(cfg, "\tdepends on ADK_TARGET_LIBC_ICONV\n");
+							fprintf(cfg, "\tselect ADK_TARGET_LIBC_WITH_LIBICONV if ADK_TARGET_LIB_UCLIBC_NG\n");
+						if (strncmp(token, "intl", 4) == 0)
+							fprintf(cfg, "\tselect ADK_TARGET_LIBC_WITH_LIBINTL if ADK_TARGET_LIB_UCLIBC_NG\n");
+						if (strncmp(token, "locale", 6) == 0)
+							fprintf(cfg, "\tselect ADK_TARGET_LIBC_WITH_LOCALE if ADK_TARGET_LIB_UCLIBC_NG\n");
 						if (strncmp(token, "threads", 7) == 0)
 							fprintf(cfg, "\tselect ADK_TARGET_LIB_WITH_THREADS\n");
 						if (strncmp(token, "mmu", 3) == 0)

+ 1 - 0
package/gettext/Makefile

@@ -12,6 +12,7 @@ PKG_SECTION:=		libs/misc
 PKG_URL:=		https://www.gnu.org/software/gettext/
 PKG_SITES:=		http://ftp.gnu.org/pub/gnu/gettext/
 PKG_OPTS:=		dev
+PKG_CFLINE_GETTEXT:=	depends on !ADK_TARGET_LIBC_WITHOUT_LIBICONV
 
 include $(ADK_TOPDIR)/mk/host.mk
 include $(ADK_TOPDIR)/mk/package.mk

+ 1 - 0
package/systemd/Makefile

@@ -12,6 +12,7 @@ PKG_SECTION:=		base/init
 PKG_DEPENDS:=		libcap libmount libuuid libblkid libncurses libkmod
 PKG_BUILDDEP:=		intltool-host gperf-host libcap util-linux gettext-host kmod
 PKG_KDEPENDS:=		cgroups namespaces fhandle tmpfs-posix-acl tmpfs-xattr
+PKG_NEEDS:=		locale intl
 PKG_URL:=		https://wiki.freedesktop.org/www/Software/systemd/
 PKG_SITES:=		https://github.com/systemd/systemd/archive/
 

+ 1 - 1
package/uclibc-ng-test/Makefile

@@ -36,7 +36,7 @@ endif
 ifeq ($(ADK_TARGET_USE_STATIC_LIBS_ONLY),y)
 XAKE_FLAGS+=		NO_DL=1 NO_TLS=1 NO_NPTL=1
 endif
-ifeq ($(ADK_RUNTIME_ENABLE_LOCALE),)
+ifeq ($(ADK_TARGET_LIBC_WITH_LOCALE),)
 XAKE_FLAGS+=		NO_LOCALE=1
 endif
 

+ 1 - 1
package/uclibc-ng/Makefile

@@ -33,7 +33,7 @@ uclibc-ng-install:
 	test -z $(ADK_RUNTIME_TIMEZONE) || \
 	    grep $(ADK_RUNTIME_TIMEZONE) ./files/tz.lst | \
 	    cut -f 2 > $(IDIR_UCLIBC_NG)/etc/TZ
-ifeq ($(ADK_RUNTIME_ENABLE_LOCALE),y)
+ifeq ($(ADK_TARGET_LIBC_WITH_LOCALE),y)
 	${INSTALL_DIR} $(IDIR_UCLIBC_NG)/usr/bin
 	$(INSTALL_BIN) $(STAGING_TARGET_DIR)/uclibc-ng/usr/bin/locale $(IDIR_UCLIBC_NG)/usr/bin
 endif

+ 4 - 10
target/config/Config.in.runtime

@@ -35,7 +35,8 @@ config ADK_RUNTIME_INIT_SYSTEMD
 	select ADK_PACKAGE_SYSTEMD
 	select ADK_PACKAGE_DBUS
 	select ADK_PACKAGE_DBUS_WITH_SYSTEMD
-	select ADK_RUNTIME_ENABLE_LOCALE
+	select ADK_TARGET_LIBC_WITH_LOCALE if ADK_TARGET_LIB_UCLIBC_NG
+	select ADK_TARGET_LIBC_WITH_LIBINTL_STUB if ADK_TARGET_LIB_UCLIBC_NG
 	select ADK_TARGET_USE_SSP
 	depends on ADK_TARGET_LIB_GLIBC || ADK_TARGET_LIB_UCLIBC_NG
 
@@ -199,19 +200,12 @@ config ADK_RUNTIME_TIMEZONE
 	help
 	  Predefine the timezone for the embedded system.
 
-config ADK_RUNTIME_ENABLE_LOCALE
-	bool "enable locale (i18n) support"
-	select ADK_TARGET_LIBC_ICONV if ADK_TARGET_LIB_UCLIBC_NG
-	select BUSYBOX_LOCALE_SUPPORT
-	help
-	  Enable locale support for the target.
-
 config ADK_RUNTIME_DEFAULT_LOCALE
 	string "default locale"
-	depends on ADK_RUNTIME_ENABLE_LOCALE
+	depends on ADK_TARGET_LIBC_WITH_LOCALE
 	default "de_DE"
 	help
-	  Set locale to be set in the target system as default.
+	  Locale to be set in the target system as default.
 
 choice
 prompt "bootup messages from kernel"

+ 38 - 9
target/config/Config.in.toolchain

@@ -24,18 +24,47 @@ config ADK_TARGET_USE_SHARED_AND_STATIC_LIBS
 endchoice
 
 choice
-depends on ADK_TARGET_OS_LINUX
-bool "Iconv implementation"
+depends on ADK_TARGET_LIB_UCLIBC_NG
+bool "Locale support"
+
+config ADK_TARGET_LIBC_WITHOUT_LOCALE
+	bool "Disable locale support"
+
+config ADK_TARGET_LIBC_WITH_LOCALE
+	bool "Enable locale support"
+	select BUSYBOX_LOCALE_SUPPORT if ADK_PACKAGE_BUSYBOX
+
+endchoice
+
+choice
+depends on ADK_TARGET_LIB_UCLIBC_NG
+bool "Intl support"
+
+config ADK_TARGET_LIBC_WITHOUT_LIBINTL
+	bool "Disable libintl support"
+	help
+	  Disables uClibc-ng internal stub support.
+
+config ADK_TARGET_LIBC_WITH_LIBINTL
+	bool "Enable libintl stub support"
+	help
+	  Enables uClibc-ng libintl stub.
+
+endchoice
 
-config ADK_TARGET_LIBC_ICONV
-	bool "Use iconv from C library"
+choice
+depends on ADK_TARGET_LIB_UCLIBC_NG
+bool "Iconv support"
 
-config ADK_TARGET_LIBICONV
-	bool "Use libiconv package"
-	select ADK_PACKAGE_LIBICONV
+config ADK_TARGET_LIBC_WITHOUT_LIBICONV
+	bool "Disable libiconv support"
+	help
+	  Disables uClibc-ng internal libiconv support.
 
-config ADK_TARGET_WITHOUT_ICONV
-	bool "Do not build any iconv code"
+config ADK_TARGET_LIBC_WITH_LIBICONV
+	bool "Enable basic libiconv"
+	help
+	  Enables uClibc-ng included basic libiconv support.
 
 endchoice
 

+ 6 - 3
toolchain/uclibc-ng/Makefile

@@ -105,10 +105,13 @@ ifeq ($(ADK_TARGET_BINFMT_FLAT_SHARED),y)
 	$(SED) 's/.*\(UCLIBC_FORMAT_FDPIC_ELF\).*/# \1 is not set/' ${WRKBUILD}/.config
 endif
 endif
-ifeq ($(ADK_TARGET_LIBC_ICONV),y)
+ifeq ($(ADK_TARGET_LIBC_WITH_LIBICONV),y)
 	$(SED) 's/.*\(UCLIBC_HAS_LIBICONV\).*/\1=y/' ${WRKBUILD}/.config
 endif
-ifeq ($(ADK_RUNTIME_ENABLE_LOCALE),y)
+ifeq ($(ADK_TARGET_LIBC_WITH_LIBINTL),y)
+	$(SED) 's/.*\(UCLIBC_HAS_LIBINTL\).*/\1=y/' ${WRKBUILD}/.config
+endif
+ifeq ($(ADK_TARGET_LIBC_WITH_LOCALE),y)
 	$(SED) 's/.*\(UCLIBC_HAS_LOCALE\).*/\1=y/' ${WRKBUILD}/.config
 	echo 'UCLIBC_HAS_XLOCALE=y' >> ${WRKBUILD}/.config
 endif
@@ -318,7 +321,7 @@ endif
 		UCLIBC_EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
 		UCLIBC_EXTRA_LDFLAGS="$(TARGET_LDFLAGS)" \
 		oldconfig
-ifeq ($(ADK_RUNTIME_ENABLE_LOCALE),y)
+ifeq ($(ADK_TARGET_LIBC_WITH_LOCALE),y)
 	$(SED) 's/.*\(UCLIBC_BUILD_MINIMAL_LOCALES\).*/\1="$(ADK_RUNTIME_DEFAULT_LOCALE)"/' ${WRKBUILD}/.config
 endif
 	touch $@