[Libreoffice-commits] core.git: config_host.mk.in configure.ac i18npool/Library_i18npool.mk

Tor Lillqvist tml at collabora.com
Tue Apr 22 09:39:03 PDT 2014


 config_host.mk.in            |    1 +
 configure.ac                 |   21 ++++++++++++++++++++-
 i18npool/Library_i18npool.mk |    8 +++++++-
 3 files changed, 28 insertions(+), 2 deletions(-)

New commits:
commit 0c0fbc3f8b09017c490ae77794aad3e7417b9c23
Author: Tor Lillqvist <tml at collabora.com>
Date:   Tue Apr 22 19:35:11 2014 +0300

    Add a new configure switch --with-locales for restricting the included locales
    
    For now only effective in the DISABLE_DYNLOADING case, where it limits
    the locales compiled in to the i18npool library. Maybe should use this
    same option to also limit what collation tables etc are compiled in?
    
    Not expected to be used for desktop OSes, but can be useful for mobile
    platforms where every megabyte counts.
    
    Change-Id: If672b4cd19f44f8c7e119378faf40930a51969b7

diff --git a/config_host.mk.in b/config_host.mk.in
index 0b4595d..6b68d93 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -604,6 +604,7 @@ export WITH_KRB5=@WITH_KRB5@
 export WITH_LANG=@WITH_LANG@
 export WITH_LANG_LIST=@WITH_LANG_LIST@
 export WITH_LINKER_HASH_STYLE=@WITH_LINKER_HASH_STYLE@
+export WITH_LOCALES=@WITH_LOCALES@
 export WITH_MOZAB4WIN=@WITH_MOZAB4WIN@
 export WITH_MYSPELL_DICTS=@WITH_MYSPELL_DICTS@
 export WITH_POOR_HELP_LOCALIZATIONS=@WITH_POOR_HELP_LOCALIZATIONS@
diff --git a/configure.ac b/configure.ac
index bfc00bd..07c7d13 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1948,7 +1948,7 @@ AC_ARG_WITH(windows-sdk,
 
 AC_ARG_WITH(lang,
     AS_HELP_STRING([--with-lang],
-        [Use this option to build LibreOffice with additional language support.
+        [Use this option to build LibreOffice with additional UI language support.
          English (US) is always included by default.
          Separate multiple languages with space.
          For all languages, use --with-lang=ALL.])
@@ -1957,6 +1957,20 @@ AC_ARG_WITH(lang,
     ],
 ,)
 
+AC_ARG_WITH(locales,
+    AS_HELP_STRING([--with-locales],
+        [Use this option to limit the locale information built in.
+         By default all the locales available is included.
+         This option is completely unrelated to --with-lang.
+         Separate multiple locales with space.
+         For the default, all locales, don't use this switch at all.
+         Specifying just the language part of a locale means all matching
+         locales will be included.])
+    [
+                          Usage:     --with-locales="en es pt fr zh kr ja"
+    ],
+,)
+
 # Kerberos and GSSAPI used only by PostgreSQL as of LibO 3.5
 AC_ARG_WITH(krb5,
     AS_HELP_STRING([--with-krb5],
@@ -12185,6 +12199,11 @@ if test -d "$SRC_ROOT/translations/source"; then
 fi
 AC_SUBST(WITH_POOR_HELP_LOCALIZATIONS)
 
+if test -n "$with_locales"; then
+    WITH_LOCALES="$with_locales"
+fi
+AC_SUBST(WITH_LOCALES)
+
 dnl git submodule update --reference
 dnl ===================================================================
 if test -n "${GIT_REFERENCE_SRC}"; then
diff --git a/i18npool/Library_i18npool.mk b/i18npool/Library_i18npool.mk
index c095fa8..b66a298 100644
--- a/i18npool/Library_i18npool.mk
+++ b/i18npool/Library_i18npool.mk
@@ -120,8 +120,14 @@ $(eval $(call gb_Library_add_exception_objects,i18npool,\
 ifeq ($(DISABLE_DYNLOADING),TRUE)
 $(call gb_CxxObject_get_target,i18npool/source/localedata/localedata): $(call gb_CustomTarget_get_workdir,i18npool/localedata)/localedata_static.hxx
 
+ifeq ($(WITH_LOCALES),)
+i18npool_locale_pattern=%
+else
+i18npool_locale_pattern=$(WITH_LOCALES) $(addsuffix _%,$(WITH_LOCALES))
+endif
+
 $(call gb_CustomTarget_get_workdir,i18npool/localedata)/localedata_static.hxx : $(SRCDIR)/i18npool/source/localedata/genstaticheader.pl
-	$(PERL) $(SRCDIR)/i18npool/source/localedata/genstaticheader.pl $(patsubst $(SRCDIR)/i18npool/source/localedata/data/%.xml,%,$(shell echo $(SRCDIR)/i18npool/source/localedata/data/*.xml)) >$@
+	$(PERL) $(SRCDIR)/i18npool/source/localedata/genstaticheader.pl $(filter $(i18npool_locale_pattern),$(patsubst $(SRCDIR)/i18npool/source/localedata/data/%.xml,%,$(shell echo $(SRCDIR)/i18npool/source/localedata/data/*.xml))) >$@
 
 $(call gb_CxxObject_get_target,i18npool/source/localedata/localedata) : \
 	INCLUDE += -I$(call gb_CustomTarget_get_workdir,i18npool/localedata)


More information about the Libreoffice-commits mailing list