summaryrefslogtreecommitdiffstats
path: root/rules
diff options
context:
space:
mode:
Diffstat (limited to 'rules')
-rw-r--r--rules/Kconfig1
-rw-r--r--rules/locales.in87
-rw-r--r--rules/locales.make145
-rw-r--r--rules/pre/Rules.make22
4 files changed, 254 insertions, 1 deletions
diff --git a/rules/Kconfig b/rules/Kconfig
index b449af547..4ae02aa75 100644
--- a/rules/Kconfig
+++ b/rules/Kconfig
@@ -42,6 +42,7 @@ source "rules/klibc.in"
source "rules/kernel.in"
source "rules/libc.in"
source "rules/gcclibs.in"
+source "rules/locales.in"
endmenu
comment "------------------------------------"
diff --git a/rules/locales.in b/rules/locales.in
new file mode 100644
index 000000000..2987767f5
--- /dev/null
+++ b/rules/locales.in
@@ -0,0 +1,87 @@
+menuconfig LOCALES
+ bool
+ prompt "System locales"
+ depends on GLIBC
+ help
+ select this to enable locale installation, otherwise your system will only
+ support locales "C" and "POSIX"
+
+comment "English Support"
+ depends on LOCALES
+
+config LOCALES_EN_US
+ bool
+ prompt "en_US (ISO8859-1)"
+ depends on LOCALES
+ help
+ American English language support.
+
+config LOCALES_EN_GB
+ bool
+ prompt "en.GB (ISO8859-1)"
+ depends on LOCALES
+ help
+ British English language support.
+
+config LOCALES_EN_GB_EURO
+ bool
+ prompt "en_GB.euro (ISO8859-15)"
+ depends on LOCALES
+ help
+ British English language support with Euro sign.
+
+comment "German Support"
+ depends on LOCALES
+
+config LOCALES_DE_DE
+ bool
+ prompt "de_DE (ISO8859-1)"
+ depends on LOCALES
+ help
+ German language support (Germany).
+
+config LOCALES_DE_DE_EURO
+ bool
+ prompt "de_DE.euro (ISO8859-15)"
+ depends on LOCALES
+ help
+ German language support with Euro sign (Germany).
+
+comment "Chinese Support"
+ depends on LOCALES
+
+config LOCALES_ZH_CN
+ bool
+ prompt "zh_CN (GB2312)"
+ depends on LOCALES
+ help
+ Chinese language support (mainland).
+
+config LOCALES_ZH_CN_GBK
+ bool
+ prompt "zh_CN (GBK)"
+ depends on LOCALES
+ help
+ Chinese language support (mainland.GBK).
+
+config LOCALES_ZH_CN_GB18030
+ bool
+ prompt "zh_CN (GB18030)"
+ depends on LOCALES
+ help
+ Chinese language support (mainland.GB13030).
+
+config LOCALES_ZH_TW
+ bool
+ prompt "zh_TW (BIG5)"
+ depends on LOCALES
+ help
+ Chinese language support (taiwan).
+
+config LOCALES_ZH_HK
+ bool
+ prompt "zh_HK (BIG5_HKSCS)"
+ depends on LOCALES
+ help
+ Chinese language support (Hongkong).
+
diff --git a/rules/locales.make b/rules/locales.make
new file mode 100644
index 000000000..5ffb4111d
--- /dev/null
+++ b/rules/locales.make
@@ -0,0 +1,145 @@
+# -*-makefile-*-
+# $Id: template 6655 2007-01-02 12:55:21Z rsc $
+#
+# Copyright (C) 2007 by Luotao Fu <lfu@pengutronix.de>
+#
+# See CREDITS for details about who has contributed to this project.
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+PACKAGES-$(PTXCONF_LOCALES) += locales
+
+#
+# Paths and names
+#
+LOCALES := locales
+LOCALES_VERSION := 1.0
+LOCALES_DIR := $(BUILDDIR)/$(LOCALES)-temp
+
+# ----------------------------------------------------------------------------
+# Get
+# ----------------------------------------------------------------------------
+
+locales_get: $(STATEDIR)/locales.get
+
+$(STATEDIR)/locales.get: $(locales_get_deps_default)
+ @$(call targetinfo, $@)
+ @$(call touch, $@)
+
+$(LOCALES_SOURCE):
+ @$(call targetinfo, $@)
+
+# ----------------------------------------------------------------------------
+# Extract
+# ----------------------------------------------------------------------------
+
+locales_extract: $(STATEDIR)/locales.extract
+
+$(STATEDIR)/locales.extract: $(locales_extract_deps_default)
+ @$(call targetinfo, $@)
+ @$(call touch, $@)
+
+# ----------------------------------------------------------------------------
+# Prepare
+# ----------------------------------------------------------------------------
+
+locales_prepare: $(STATEDIR)/locales.prepare
+
+#
+# autoconf
+#
+LOCALES_AUTOCONF := $(CROSS_AUTOCONF_USR)
+
+$(STATEDIR)/locales.prepare: $(locales_prepare_deps_default)
+ @$(call targetinfo, $@)
+ @$(call clean, $(LOCALES_DIR)/config.cache)
+ @mkdir -p $(LOCALES_DIR)/usr/lib/locale
+ @$(call touch, $@)
+
+# ----------------------------------------------------------------------------
+# Compile
+# ----------------------------------------------------------------------------
+
+locales_compile: $(STATEDIR)/locales.compile
+
+$(STATEDIR)/locales.compile: $(locales_compile_deps_default)
+ @$(call targetinfo, $@)
+ @$(call touch, $@)
+
+# ----------------------------------------------------------------------------
+# Install
+# ----------------------------------------------------------------------------
+
+locales_install: $(STATEDIR)/locales.install
+
+$(STATEDIR)/locales.install: $(locales_install_deps_default)
+ @$(call targetinfo, $@)
+ifdef PTXCONF_LOCALES_EN_US
+ @$(call add_locale, en_US, en_US, ISO-8859-1, $(LOCALES_DIR))
+endif
+ifdef PTXCONF_LOCALES_EN_GB
+ @$(call add_locale, en_GB, en_GB, ISO-8859-1, $(LOCALES_DIR))
+endif
+ifdef PTXCONF_LOCALES_DE_DE
+ @$(call add_locale, de_DE, de_DE, ISO-8859-1, $(LOCALES_DIR))
+endif
+ifdef PTXCONF_LOCALES_DE_DE_EURO
+ @$(call add_locale, de_DE@euro, de_DE@euro, ISO-8859-15, $(LOCALES_DIR))
+endif
+ifdef PTXCONF_LOCALES_ZH_CN
+ @$(call add_locale, zh_CN, zh_CN, GB2312, $(LOCALES_DIR))
+endif
+ifdef PTXCONF_LOCALES_ZH_CN_GBK
+ @$(call add_locale, zh_CN.GBK, zh_CN, GBK, $(LOCALES_DIR))
+endif
+ifdef PTXCONF_LOCALES_ZH_CN_GB18030
+ @$(call add_locale, zh_CN.GB18030, zh_CN, GB18030, $(LOCALES_DIR))
+endif
+ifdef PTXCONF_LOCALES_ZH_TW
+ @$(call add_locale, zh_TW, zh_TW, BIG5, $(LOCALES_DIR))
+endif
+ifdef PTXCONF_LOCALES_ZH_HK
+ @$(call add_locale, zh_HK, zh_HK, BIG5-HKSCS, $(LOCALES_DIR))
+endif
+
+ @$(call touch, $@)
+
+# ----------------------------------------------------------------------------
+# Target-Install
+# ----------------------------------------------------------------------------
+
+locales_targetinstall: $(STATEDIR)/locales.targetinstall
+
+$(STATEDIR)/locales.targetinstall: $(locales_targetinstall_deps_default)
+ @$(call targetinfo, $@)
+
+ @$(call install_init, locales)
+ @$(call install_fixup, locales,PACKAGE,locales)
+ @$(call install_fixup, locales,PRIORITY,optional)
+ @$(call install_fixup, locales,VERSION,$(LOCALES_VERSION))
+ @$(call install_fixup, locales,SECTION,base)
+ @$(call install_fixup, locales,AUTHOR,"Robert Schwebel <r.schwebel\@pengutronix.de>")
+ @$(call install_fixup, locales,DEPENDS,)
+ @$(call install_fixup, locales,DESCRIPTION,missing)
+
+ @$(call install_copy, locales, 0, 0, 0755, $(LOCALES_DIR)/usr/lib/locale/locale-archive, \
+ /usr/lib/locale/locale-archive, n);
+ @$(call install_finish, locales)
+
+ @$(call touch, $@)
+
+# ----------------------------------------------------------------------------
+# Clean
+# ----------------------------------------------------------------------------
+
+locales_clean:
+ rm -rf $(STATEDIR)/locales.*
+ rm -rf $(IMAGEDIR)/locales_*
+ rm -rf $(LOCALES_DIR)
+
+# vim: syntax=make
diff --git a/rules/pre/Rules.make b/rules/pre/Rules.make
index 132658f32..755a67035 100644
--- a/rules/pre/Rules.make
+++ b/rules/pre/Rules.make
@@ -383,6 +383,27 @@ touch = \
echo "Finished target $(shell basename $1)";
#
+# add_locale
+#
+# add locale support to locales-archive, if not exist, a new locale
+# archive will be created automaticly
+#
+# $1: localename: localename (i.E. zh_CN or zh_CN.GBK)
+# $2: localedef; locale definition file (i.E. de_DE or de_DE@euro)
+# $3: charmap; charachter encoding map (i.E. ISO-8859-1)
+# $4: prefix; installation prefix for locales-archive
+#
+#
+add_locale = \
+ LOCALE_NAME=$(strip $(1)); \
+ LOCALE_DEF=$(strip $(2)); \
+ CHARMAP=$(strip $(3)); \
+ PREF=$(strip $(4)); \
+ ${CROSS_ENV_CC} $(CROSS_ENV_STRIP) \
+ $(SCRIPTSDIR)/make_locale.sh \
+ -f $$CHARMAP -i $$LOCALE_DEF -p $$PREF -n $$LOCALE_NAME
+
+#
# extract
#
# Extract a source archive into a directory. This stage is
@@ -445,7 +466,6 @@ extract = \
$$EXTRACT -dc $$PACKET | $(TAR) -C $$DEST -xf -; \
$(CHECK_PIPE_STATUS)
-
#
# get
#