Kaydet (Commit) 0c0fbc3f authored tarafından Tor Lillqvist's avatar Tor Lillqvist

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
üst 26c10caf
......@@ -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@
......
......@@ -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
......
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment