Browse Source

locale: rework locale support (not fully ready)

Waldemar Brodkorb 8 years ago
parent
commit
c7cec1a2af

+ 4 - 0
package/uclibc-ng/Makefile

@@ -47,6 +47,10 @@ ifneq ($(ADK_TARGET_USE_STATIC_LIBS)$(ADK_TARGET_BINFMT_FLAT),y)
 			$(IDIR_UCLIBC_NG)/$(ADK_TARGET_LIBC_PATH); \
 	done
 endif
+ifeq ($(ADK_RUNTIME_ENABLE_LOCALE),y)
+	${INSTALL_DIR} $(IDIR_UCLIBC_NG)/usr/bin
+	$(INSTALL_BIN) $(STAGING_TARGET_DIR)/usr/bin/locale $(IDIR_UCLIBC_NG)/usr/bin
+endif
 
 uclibc-ng-dev-install:
 	${INSTALL_DIR} ${IDIR_UCLIBC_NG_DEV}/usr/lib ${IDIR_UCLIBC_NG_DEV}/$(ADK_TARGET_LIBC_PATH)

+ 1 - 0
rules.mk

@@ -57,6 +57,7 @@ ADK_RUNTIME_TMPFS_SIZE:=		$(strip $(subst ",, $(ADK_RUNTIME_TMPFS_SIZE)))
 ADK_RUNTIME_CONSOLE_SERIAL_SPEED:=	$(strip $(subst ",, $(ADK_RUNTIME_CONSOLE_SERIAL_SPEED)))
 ADK_RUNTIME_CONSOLE_SERIAL_DEVICE:=	$(strip $(subst ",, $(ADK_RUNTIME_CONSOLE_SERIAL_DEVICE)))
 ADK_RUNTIME_CONSOLE_VGA_DEVICE:=	$(strip $(subst ",, $(ADK_RUNTIME_CONSOLE_VGA_DEVICE)))
+ADK_RUNTIME_DEFAULT_LOCALE:=		$(strip $(subst ",, $(ADK_RUNTIME_DEFAULT_LOCALE)))
 ADK_HOST:=				$(strip $(subst ",, $(ADK_HOST)))
 ADK_VENDOR:=				$(strip $(subst ",, $(ADK_VENDOR)))
 ADK_DL_DIR:=				$(strip $(subst ",, $(ADK_DL_DIR)))

+ 14 - 0
target/config/Config.in.runtime

@@ -138,6 +138,20 @@ 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
+	default "de_DE"
+	help
+	  Set locale to be set in the target system as default.
+
 choice
 prompt "bootup messages from kernel"
 

+ 0 - 7
target/config/Config.in.toolchain

@@ -1,13 +1,6 @@
 # This file is part of the OpenADK project. OpenADK is copyrighted
 # material, please see the LICENCE file in the top-level directory.
 
-config ADK_TARGET_WITH_LOCALE
-	bool "Enable Locale (i18n) support"
-	depends on ADK_TARGET_LIB_UCLIBC_NG
-	select ADK_TARGET_LIBC_ICONV
-	select BUSYBOX_LOCALE_SUPPORT
-	select BUSYBOX_UNICODE_USING_LOCALE
-
 choice
 depends on ADK_TARGET_OS_LINUX
 prompt "Iconv implementation"

+ 20 - 2
toolchain/uclibc-ng/Makefile

@@ -95,6 +95,9 @@ endif
 endif
 ifeq ($(ADK_TARGET_LIBC_ICONV),y)
 	$(SED) 's/.*\(UCLIBC_HAS_LOCALE\).*/\1=y/' ${WRKBUILD}/.config
+endif
+ifeq ($(ADK_RUNTIME_ENABLE_LOCALE),y)
+	$(SED) 's/.*\(UCLIBC_HAS_LOCALE\).*/\1=y/' ${WRKBUILD}/.config
 	$(SED) 's/.*\(UCLIBC_BUILD_MINIMAL_LOCALE\).*/\1=y/' ${WRKBUILD}/.config
 endif
 ifeq ($(ADK_TARGET_UCLINUX),y)
@@ -307,6 +310,19 @@ $(WRKBUILD)/.compiled: $(WRKBUILD)/.configured
 		UCLIBC_ONLY=1 \
 		VERBOSE=1 \
 		all
+	PATH='$(HOST_PATH)' $(MAKE) $(UCLIBC_MAKEOPTS) -C $(WRKBUILD) \
+		HOSTCC="$(HOST_CC)" \
+		CC='$(TARGET_CC)' \
+		PREFIX=$(STAGING_TARGET_DIR) \
+		DEVEL_PREFIX=/usr/ \
+		DEVEL_PREFIX_LIB=/ \
+		RUNTIME_PREFIX=/ \
+		UCLIBC_EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
+		UCLIBC_EXTRA_LDFLAGS="$(TARGET_LDFLAGS)" \
+		TEST_INSTALLED_UCLIBC=1 \
+		UCLIBC_ONLY=1 \
+		VERBOSE=1 \
+		utils
 	touch $@
 
 $(WRKBUILD)/.installed: $(WRKBUILD)/.compiled
@@ -319,9 +335,11 @@ $(WRKBUILD)/.installed: $(WRKBUILD)/.compiled
 		RUNTIME_PREFIX=/ \
 		UCLIBC_EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
 		UCLIBC_EXTRA_LDFLAGS="$(TARGET_LDFLAGS)" \
+		TEST_INSTALLED_UCLIBC=1 \
+		UCLIBC_ONLY=1 \
 		VERBOSE=1 \
-		install_runtime install_dev
-	PATH='$(HOST_PATH)' $(MAKE) -C $(WRKBUILD) \
+		install_runtime install_dev install_utils
+	PATH='$(HOST_PATH)' $(MAKE) $(UCLIBC_MAKEOPTS) -C $(WRKBUILD) \
 		HOSTCC="$(HOST_CC)" \
 		CC='$(TARGET_CC)' \
 		PREFIX=$(STAGING_TARGET_DIR) \