From dbd0aadeb5bcea7e5276da439f1301f1c8f6c1bc Mon Sep 17 00:00:00 2001 From: Tooru Fujisawa Date: Fri, 10 Oct 2014 02:55:00 -0400 Subject: [PATCH] Bug 1080910 - Add USE_ICU variable separated from ENABLE_INTL_API. r=glandium --- build/autoconf/icu.m4 | 13 ++++++++++--- config/external/icu/Makefile.in | 6 +++--- configure.in | 14 ++++++-------- moz.build | 2 +- toolkit/library/moz.build | 2 +- 5 files changed, 21 insertions(+), 16 deletions(-) diff --git a/build/autoconf/icu.m4 b/build/autoconf/icu.m4 index df7f5edf3ef..87ccf6da827 100644 --- a/build/autoconf/icu.m4 +++ b/build/autoconf/icu.m4 @@ -51,14 +51,20 @@ yes) ;; esac +if test -n "$ENABLE_INTL_API"; then + USE_ICU=1 +fi + if test -n "$EXPOSE_INTL_API"; then AC_DEFINE(EXPOSE_INTL_API) fi -dnl Settings for the implementation of the ECMAScript Internationalization API if test -n "$ENABLE_INTL_API"; then AC_DEFINE(ENABLE_INTL_API) +fi +dnl Settings for the implementation of the ECMAScript Internationalization API +if test -n "$USE_ICU"; then icudir="$_topsrcdir/intl/icu/source" if test ! -d "$icudir"; then icudir="$_topsrcdir/../../intl/icu/source" @@ -100,9 +106,10 @@ fi AC_SUBST(MOZ_ICU_DBG_SUFFIX) AC_SUBST(ENABLE_INTL_API) +AC_SUBST(USE_ICU) AC_SUBST_LIST(ICU_LIB_NAMES) -if test -n "$ENABLE_INTL_API" -a -z "$MOZ_NATIVE_ICU"; then +if test -n "$USE_ICU" -a -z "$MOZ_NATIVE_ICU"; then dnl We build ICU as a static library for non-shared js builds and as a shared library for shared js builds. if test -z "$MOZ_SHARED_ICU"; then AC_DEFINE(U_STATIC_IMPLEMENTATION) @@ -119,7 +126,7 @@ AC_DEFUN([MOZ_SUBCONFIGURE_ICU], [ if test -z "$BUILDING_JS" -o -n "$JS_STANDALONE"; then - if test -n "$ENABLE_INTL_API" -a -z "$MOZ_NATIVE_ICU"; then + if test -n "$USE_ICU" -a -z "$MOZ_NATIVE_ICU"; then # Set ICU compile options ICU_CPPFLAGS="" # don't use icu namespace automatically in client code diff --git a/config/external/icu/Makefile.in b/config/external/icu/Makefile.in index aa14b69fa19..f60fe63c6b7 100644 --- a/config/external/icu/Makefile.in +++ b/config/external/icu/Makefile.in @@ -3,7 +3,7 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. # Ensure that this happens before including rules.mk -ifdef ENABLE_INTL_API +ifdef USE_ICU ifndef MOZ_NATIVE_ICU # Library names: On Windows, ICU uses modified library names for static # and debug libraries. @@ -36,11 +36,11 @@ ifdef ENABLE_INTL_API endif endif # MOZ_SHARED_ICU endif # !MOZ_NATIVE_ICU -endif # ENABLE_INTL_API +endif # USE_ICU include $(topsrcdir)/config/rules.mk -ifdef ENABLE_INTL_API +ifdef USE_ICU ifndef MOZ_NATIVE_ICU target:: buildicu $(STATIC_LIBS): buildicu diff --git a/configure.in b/configure.in index 0dd177093eb..d73ec980c85 100644 --- a/configure.in +++ b/configure.in @@ -9018,19 +9018,17 @@ dnl ======================================================== # Android: bug 864843 # B2G: bug 866301 -if test "$MOZ_WIDGET_TOOLKIT" = "android"; then +if test "$MOZ_WIDGET_TOOLKIT" = "android" || + test "$MOZ_BUILD_APP" = "b2g"; then _INTL_API=no -elif test "$MOZ_BUILD_APP" = "b2g"; then - if test "$MOZ_WIDGET_TOOLKIT" = "cocoa"; then - # nsCollationMacUC needs ICU - _INTL_API=yes - else - _INTL_API=no - fi else _INTL_API=yes fi +if test "$MOZ_WIDGET_TOOLKIT" = "cocoa"; then + USE_ICU=1 +fi + MOZ_CONFIG_ICU() if test -z "$JS_SHARED_LIBRARY"; then diff --git a/moz.build b/moz.build index d109c3907d9..d5d7cf32b30 100644 --- a/moz.build +++ b/moz.build @@ -60,7 +60,7 @@ if CONFIG['COMPILE_ENVIRONMENT'] and not CONFIG['LIBXUL_SDK']: if CONFIG['BUILD_CTYPES']: DIRS += ['config/external/ffi'] - if CONFIG['ENABLE_INTL_API']: + if CONFIG['USE_ICU']: DIRS += ['config/external/icu'] DIRS += ['js/src'] diff --git a/toolkit/library/moz.build b/toolkit/library/moz.build index e191f139484..ededc3b3761 100644 --- a/toolkit/library/moz.build +++ b/toolkit/library/moz.build @@ -125,7 +125,7 @@ USE_LIBS += [ 'zlib', ] -if CONFIG['ENABLE_INTL_API']: +if CONFIG['USE_ICU']: USE_LIBS += [ 'icu', ]