Bug 1080910 - Add BUILD_ICU variable separated from ENABLE_INTL_API.
authorTooru Fujisawa <arai_a@mac.com>
Fri, 10 Oct 2014 10:04:33 +0900
changeset 273168 990c9995646e823508c0083e6f51ebb47a6aa23d
parent 273097 95d1486223f7c222b70f6878348ea0be3a66b821
child 273169 010f3714daabac2ea71769ff34b1c0d4cb9794e8
push id36159
push userarai_a@mac.com
push dateFri, 10 Oct 2014 02:58:56 +0000
treeherdertry@010f3714daab [default view] [failures only]
bugs1080910
milestone35.0a1
Bug 1080910 - Add BUILD_ICU variable separated from ENABLE_INTL_API. From 70af29cb5b97a8e5f1c62635372197cef84112bf Mon Sep 17 00:00:00 2001
build/autoconf/icu.m4
config/external/icu/Makefile.in
configure.in
moz.build
toolkit/library/moz.build
--- a/build/autoconf/icu.m4
+++ b/build/autoconf/icu.m4
@@ -31,38 +31,47 @@ MOZ_ARG_WITH_STRING(intl-api,
     Determine the status of the ECMAScript Internationalization API.  The first
     (or lack of any of these) builds and exposes the API.  The second builds it
     but doesn't use ICU or expose the API to script.  The third doesn't build
     ICU at all.],
     _INTL_API=$withval)
 
 ENABLE_INTL_API=
 EXPOSE_INTL_API=
+BUILD_ICU=
 case "$_INTL_API" in
 no)
     ;;
 build)
     ENABLE_INTL_API=1
     ;;
 yes)
     ENABLE_INTL_API=1
     EXPOSE_INTL_API=1
     ;;
 *)
     AC_MSG_ERROR([Invalid value passed to --with-intl-api: $_INTL_API])
     ;;
 esac
 
+if test -n "$ENABLE_INTL_API" -o "$MOZ_WIDGET_TOOLKIT" = "cocoa"; then
+    BUILD_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 "$BUILD_ICU"; then
+    AC_DEFINE(BUILD_ICU)
 
     icudir="$_topsrcdir/intl/icu/source"
     if test ! -d "$icudir"; then
         icudir="$_topsrcdir/../../intl/icu/source"
         if test ! -d "$icudir"; then
             AC_MSG_ERROR([Cannot find the ICU directory])
         fi
     fi
@@ -95,36 +104,37 @@ if test -n "$ENABLE_INTL_API"; then
             *)
                 AC_MSG_ERROR([ECMAScript Internationalization API is not yet supported on this platform])
         esac
     fi
 fi
 
 AC_SUBST(MOZ_ICU_DBG_SUFFIX)
 AC_SUBST(ENABLE_INTL_API)
+AC_SUBST(BUILD_ICU)
 AC_SUBST_LIST(ICU_LIB_NAMES)
 
-if test -n "$ENABLE_INTL_API" -a -z "$MOZ_NATIVE_ICU"; then
+if test -n "$BUILD_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)
     fi
     dnl Source files that use ICU should have control over which parts of the ICU
     dnl namespace they want to use.
     AC_DEFINE(U_USING_ICU_NAMESPACE,0)
 fi
 
 
 ])
 
 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 "$BUILD_ICU" -a -z "$MOZ_NATIVE_ICU"; then
         # Set ICU compile options
         ICU_CPPFLAGS=""
         # don't use icu namespace automatically in client code
         ICU_CPPFLAGS="$ICU_CPPFLAGS -DU_USING_ICU_NAMESPACE=0"
         # don't include obsolete header files
         ICU_CPPFLAGS="$ICU_CPPFLAGS -DU_NO_DEFAULT_INCLUDE_UTF_HEADERS=1"
         # remove chunks of the library that we don't need (yet)
         ICU_CPPFLAGS="$ICU_CPPFLAGS -DUCONFIG_NO_LEGACY_CONVERSION"
--- a/config/external/icu/Makefile.in
+++ b/config/external/icu/Makefile.in
@@ -1,14 +1,14 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # 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 BUILD_ICU
   ifndef MOZ_NATIVE_ICU
   # Library names: On Windows, ICU uses modified library names for static
   # and debug libraries.
     ifdef MOZ_SHARED_ICU
       ifeq ($(OS_ARCH),WINNT)
         ifdef JS_SHARED_LIBRARY
           ICU_FILES := $(foreach libname,$(ICU_LIB_NAMES),$(DEPTH)/intl/icu/target/lib/$(libname)$(MOZ_ICU_DBG_SUFFIX)$(MOZ_ICU_VERSION).dll)
         endif
@@ -31,21 +31,21 @@ ifdef ENABLE_INTL_API
       endif
     else # !MOZ_SHARED_ICU
       ifeq ($(OS_ARCH),WINNT)
         ICU_LIB_RENAME = $(foreach libname,$(ICU_LIB_NAMES),\
                              cp -p $(DEPTH)/intl/icu/target/lib/s$(libname)$(MOZ_ICU_DBG_SUFFIX).lib $(DEPTH)/intl/icu/target/lib/$(libname)$(MOZ_ICU_DBG_SUFFIX).lib;)
       endif
     endif # MOZ_SHARED_ICU
   endif # !MOZ_NATIVE_ICU
-endif # ENABLE_INTL_API
+endif # BUILD_ICU
 
 include $(topsrcdir)/config/rules.mk
 
-ifdef ENABLE_INTL_API
+ifdef BUILD_ICU
 ifndef MOZ_NATIVE_ICU
 target:: buildicu
 $(STATIC_LIBS): buildicu
 
 # - Force ICU to use the standard suffix for object files because expandlibs
 #   will discard all files with a non-standard suffix (bug 857450).
 # - Options for genrb: -k strict parsing; -R omit collation tailoring rules.
 buildicu::
--- a/configure.in
+++ b/configure.in
@@ -9053,25 +9053,19 @@ dnl ICU Support
 dnl ========================================================
 
 # Internationalization isn't built or exposed by default in non-desktop
 # builds.  Bugs to enable:
 #
 #   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
 
 MOZ_CONFIG_ICU()
 
 if test -z "$JS_SHARED_LIBRARY"; then
   AC_DEFINE(MOZ_STATIC_JS)
--- a/moz.build
+++ b/moz.build
@@ -55,17 +55,17 @@ if CONFIG['COMPILE_ENVIRONMENT'] and not
     if not CONFIG['JS_STANDALONE']:
         DIRS += [
             'config/external',
             'config/external/nss',
         ]
 
     if CONFIG['BUILD_CTYPES']:
         DIRS += ['config/external/ffi']
-    if CONFIG['ENABLE_INTL_API']:
+    if CONFIG['BUILD_ICU']:
         DIRS += ['config/external/icu']
     DIRS += ['js/src']
 
 if not CONFIG['JS_STANDALONE']:
     # Bring in the configuration for the configured application.
     include('/' + CONFIG['MOZ_BUILD_APP'] + '/app.mozbuild')
 
 include('build/templates.mozbuild')
--- a/toolkit/library/moz.build
+++ b/toolkit/library/moz.build
@@ -120,17 +120,17 @@ USE_LIBS += [
     'gkmedias',
     'mozalloc',
     'nspr',
     'nss',
     'sqlite',
     'zlib',
 ]
 
-if CONFIG['ENABLE_INTL_API']:
+if CONFIG['BUILD_ICU']:
     USE_LIBS += [
         'icu',
     ]
 
 if CONFIG['MOZ_WIDGET_GTK'] and CONFIG['MOZ_ENABLE_GTK3']:
     USE_LIBS += [
         'mozgtk_stub',
     ]