Bug 969164 - Move icu subconfigure invocation in build/autoconf/icu.m4. r=gps
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 11 Feb 2014 10:37:47 +0900
changeset 167968 ff614668cec33023bca622859a01594ea499d080
parent 167967 c13cfe6108e5a77505d74ed73520e3832d601df0
child 167969 4a90387184174c673332acd5e878ab1dda5dbf24
push id39611
push usermh@glandium.org
push dateTue, 11 Feb 2014 01:41:03 +0000
treeherdermozilla-inbound@4e3b435b7d39 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs969164
milestone30.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 969164 - Move icu subconfigure invocation in build/autoconf/icu.m4. r=gps
build/autoconf/icu.m4
js/src/configure.in
--- a/build/autoconf/icu.m4
+++ b/build/autoconf/icu.m4
@@ -127,8 +127,196 @@ if test -n "$ENABLE_INTL_API" -a -z "$MO
     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 -n "$ENABLE_INTL_API" -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"
+    ICU_CPPFLAGS="$ICU_CPPFLAGS -DUCONFIG_NO_TRANSLITERATION"
+    ICU_CPPFLAGS="$ICU_CPPFLAGS -DUCONFIG_NO_REGULAR_EXPRESSIONS"
+    ICU_CPPFLAGS="$ICU_CPPFLAGS -DUCONFIG_NO_BREAK_ITERATION"
+
+    ICU_CROSS_BUILD_OPT=""
+    ICU_SRCDIR=""
+    if test "$HOST_OS_ARCH" = "WINNT"; then
+        ICU_SRCDIR="--srcdir=$(cd $srcdir/intl/icu/source; pwd -W)"
+    fi
+
+    if test "$CROSS_COMPILE"; then
+        # Building host tools.  It is necessary to build target binary.
+        case "$HOST_OS_ARCH" in
+            Darwin)
+                ICU_TARGET=MacOSX
+                ;;
+            Linux)
+                ICU_TARGET=Linux
+                ;;
+            WINNT)
+                ICU_TARGET=MSYS/MSVC
+                ;;
+            *bsd*|dragonfly*)
+                ICU_TARGET=BSD
+                ;;
+        esac
+        # Remove _DEPEND_CFLAGS from HOST_FLAGS to avoid configure error
+        HOST_ICU_CFLAGS="$HOST_CFLAGS"
+        HOST_ICU_CXXFLAGS="$HOST_CXXFLAGS"
+
+        HOST_ICU_CFLAGS=`echo $HOST_ICU_CFLAGS | sed "s|$_DEPEND_CFLAGS||g"`
+        HOST_ICU_CXXFLAGS=`echo $HOST_ICU_CFXXLAGS | sed "s|$_DEPEND_CFLAGS||g"`
+
+        # ICU requires RTTI
+        if test "$GNU_CC"; then
+            HOST_ICU_CXXFLAGS=`echo $HOST_ICU_CXXFLAGS | sed 's|-fno-rtti|-frtti|g'`
+        elif test "$_MSC_VER"; then
+            HOST_ICU_CXXFLAGS=`echo $HOST_ICU_CXXFLAGS | sed 's|-GR-|-GR|g'`
+        fi
+
+        HOST_ICU_BUILD_OPTS=""
+        if test -n "$MOZ_DEBUG"; then
+            HOST_ICU_BUILD_OPTS="$HOST_ICU_BUILD_OPTS --enable-debug"
+        fi
+
+        abs_srcdir=`(cd $srcdir; pwd)`
+        mkdir -p $_objdir/intl/icu/host
+        (cd $_objdir/intl/icu/host
+         MOZ_SUBCONFIGURE_WRAP([.],[
+         AR="$HOST_AR" RANLIB="$HOST_RANLIB" \
+         CC="$HOST_CC" CXX="$HOST_CXX" LD="$HOST_LD" \
+         CFLAGS="$HOST_ICU_CFLAGS $HOST_OPTIMIZE_FLAGS" \
+         CPPFLAGS="$ICU_CPPFLAGS" \
+         CXXFLAGS="$HOST_ICU_CXXFLAGS $HOST_OPTIMIZE_FLAGS" \
+         LDFLAGS="$HOST_LDFLAGS" \
+                $SHELL $abs_srcdir/intl/icu/source/runConfigureICU \
+                $HOST_ICU_BUILD_OPTS \
+                $ICU_TARGET \
+        dnl Shell quoting is fun.
+                ${ICU_SRCDIR+"$ICU_SRCDIR"} \
+                --enable-static --disable-shared \
+                --enable-extras=no --enable-icuio=no --enable-layout=no \
+                --enable-tests=no --enable-samples=no || exit 1
+         ])
+        ) || exit 1
+        # generate config/icucross.mk
+        $GMAKE -C $_objdir/intl/icu/host/ config/icucross.mk
+
+        # --with-cross-build requires absolute path
+        ICU_HOST_PATH=`cd $_objdir/intl/icu/host && pwd`
+        ICU_CROSS_BUILD_OPT="--with-cross-build=$ICU_HOST_PATH"
+        ICU_TARGET_OPT="--build=$build --host=$target"
+    else
+        # CROSS_COMPILE isn't set build and target are i386 and x86-64.
+        # So we must set target for --build and --host.
+        ICU_TARGET_OPT="--build=$target --host=$target"
+    fi
+
+    if test -z "$MOZ_SHARED_ICU"; then
+        # To reduce library size, use static linking
+        ICU_LINK_OPTS="--enable-static --disable-shared"
+    else
+        ICU_LINK_OPTS="--disable-static --enable-shared"
+    fi
+    # Force the ICU static libraries to be position independent code
+    ICU_CFLAGS="$DSO_PIC_CFLAGS $CFLAGS"
+    ICU_CXXFLAGS="$DSO_PIC_CFLAGS $CXXFLAGS"
+
+    ICU_BUILD_OPTS=""
+    if test -n "$MOZ_DEBUG" -o "MOZ_DEBUG_SYMBOLS"; then
+        ICU_CFLAGS="$ICU_CFLAGS $MOZ_DEBUG_FLAGS"
+        ICU_CXXFLAGS="$ICU_CXXFLAGS $MOZ_DEBUG_FLAGS"
+        if test -n "$CROSS_COMPILE" -a "$OS_TARGET" = "Darwin" \
+                -a "$HOST_OS_ARCH" != "Darwin"
+        then
+            # Bug 951758: Cross-OSX builds with non-Darwin hosts have issues
+            # with -g and friends (like -gdwarf and -gfull) because they try
+            # to run dsymutil
+            changequote(,)
+            ICU_CFLAGS=`echo $ICU_CFLAGS | sed 's|-g[^ \t]*||g'`
+            ICU_CXXFLAGS=`echo $ICU_CXXFLAGS | sed 's|-g[^ \t]*||g'`
+            changequote([,])
+        fi
+
+        ICU_LDFLAGS="$MOZ_DEBUG_LDFLAGS"
+        if test -z "$MOZ_DEBUG"; then
+            # To generate debug symbols, it requires MOZ_DEBUG_FLAGS.
+            # But, not debug build.
+            ICU_CFLAGS="$ICU_CFLAGS -UDEBUG -DNDEBUG"
+            ICU_CXXFLAGS="$ICU_CXXFLAGS -UDEBUG -DNDEBUG"
+        else
+            ICU_BUILD_OPTS="$ICU_BUILD_OPTS --enable-debug"
+        fi
+    fi
+    if test -z "$MOZ_OPTIMIZE"; then
+        ICU_BUILD_OPTS="$ICU_BUILD_OPTS --disable-release"
+    else
+        ICU_CFLAGS="$ICU_CFLAGS $MOZ_OPTIMIZE_FLAGS"
+        ICU_CXXFLAGS="$ICU_CXXFLAGS $MOZ_OPTIMIZE_FLAGS"
+    fi
+
+    if test "$am_cv_langinfo_codeset" = "no"; then
+        # ex. Android
+        ICU_CPPFLAGS="$ICU_CPPFLAGS -DU_HAVE_NL_LANGINFO_CODESET=0"
+    fi
+
+    # ICU requires RTTI
+    if test "$GNU_CC"; then
+        ICU_CXXFLAGS=`echo $ICU_CXXFLAGS | sed 's|-fno-rtti|-frtti|g'`
+    else
+        if test "$_MSC_VER"; then
+            ICU_CXXFLAGS=`echo $ICU_CXXFLAGS | sed 's|-GR-|-GR|g'`
+        fi
+
+        # Add RTL flags for MSVCRT.DLL
+        if test -n "$MOZ_DEBUG"; then
+            ICU_CFLAGS="$ICU_CFLAGS -MDd"
+            ICU_CXXFLAGS="$ICU_CXXFLAGS -MDd"
+        else
+            ICU_CFLAGS="$ICU_CFLAGS -MD"
+            ICU_CXXFLAGS="$ICU_CXXFLAGS -MD"
+        fi
+
+        # add disable optimize flag for workaround for bug 899948
+        if test -z "$MOZ_OPTIMIZE"; then
+            ICU_CFLAGS="$ICU_CFLAGS -Od"
+            ICU_CXXFLAGS="$ICU_CXXFLAGS -Od"
+        fi
+    fi
+
+    # We cannot use AC_OUTPUT_SUBDIRS since ICU tree is out of spidermonkey.
+    # When using AC_OUTPUT_SUBDIRS, objdir of ICU is out of objdir
+    # due to relative path.
+    # If building ICU moves into root of mozilla tree, we can use
+    # AC_OUTPUT_SUBDIR instead.
+    mkdir -p $_objdir/intl/icu/target
+    (cd $_objdir/intl/icu/target
+     MOZ_SUBCONFIGURE_WRAP([.],[
+       AR="$AR" CC="$CC" CXX="$CXX" LD="$LD" \
+       ARFLAGS="$ARFLAGS" \
+       CPPFLAGS="$ICU_CPPFLAGS $CPPFLAGS" \
+       CFLAGS="$ICU_CFLAGS" \
+       CXXFLAGS="$ICU_CXXFLAGS" \
+       LDFLAGS="$ICU_LDFLAGS $LDFLAGS" \
+       $SHELL $_topsrcdir/intl/icu/source/configure \
+                $ICU_BUILD_OPTS \
+                $ICU_CROSS_BUILD_OPT \
+                $ICU_LINK_OPTS \
+                ${ICU_SRCDIR+"$ICU_SRCDIR"} \
+                $ICU_TARGET_OPT \
+                --disable-extras --disable-icuio --disable-layout \
+                --disable-tests --disable-samples || exit 1
+       ])
+    ) || exit 1
+fi
+
+])
--- a/js/src/configure.in
+++ b/js/src/configure.in
@@ -4081,204 +4081,17 @@ dnl ====================================
 dnl ECMAScript Internationalization API Support (uses ICU)
 dnl ========================================================
 
 dnl top-level configure may override this with --without-intl-api
 _INTL_API=yes
 
 MOZ_CONFIG_ICU()
 
-dnl Settings for ICU
-if test -n "$ENABLE_INTL_API" -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"
-    ICU_CPPFLAGS="$ICU_CPPFLAGS -DUCONFIG_NO_TRANSLITERATION"
-    ICU_CPPFLAGS="$ICU_CPPFLAGS -DUCONFIG_NO_REGULAR_EXPRESSIONS"
-    ICU_CPPFLAGS="$ICU_CPPFLAGS -DUCONFIG_NO_BREAK_ITERATION"
-
-    ICU_CROSS_BUILD_OPT=""
-    ICU_SRCDIR=""
-    if test "$HOST_OS_ARCH" = "WINNT"; then
-        ICU_SRCDIR="--srcdir=$(cd $srcdir/intl/icu/source; pwd -W)"
-    fi
-
-    if test "$CROSS_COMPILE"; then
-        # Building host tools.  It is necessary to build target binary.
-        case "$HOST_OS_ARCH" in
-            Darwin)
-                ICU_TARGET=MacOSX
-                ;;
-            Linux)
-                ICU_TARGET=Linux
-                ;;
-            WINNT)
-                ICU_TARGET=MSYS/MSVC
-                ;;
-            *bsd*|dragonfly*)
-                ICU_TARGET=BSD
-                ;;
-        esac
-
-        # Remove _DEPEND_CFLAGS from HOST_FLAGS to avoid configure error
-        HOST_ICU_CFLAGS="$HOST_CFLAGS"
-        HOST_ICU_CXXFLAGS="$HOST_CXXFLAGS"
-
-        HOST_ICU_CFLAGS=`echo $HOST_ICU_CFLAGS | sed "s|$_DEPEND_CFLAGS||g"`
-        HOST_ICU_CXXFLAGS=`echo $HOST_ICU_CFXXLAGS | sed "s|$_DEPEND_CFLAGS||g"`
-
-        # ICU requires RTTI
-        if test "$GNU_CC"; then
-            HOST_ICU_CXXFLAGS=`echo $HOST_ICU_CXXFLAGS | sed 's|-fno-rtti|-frtti|g'`
-        elif test "$_MSC_VER"; then
-            HOST_ICU_CXXFLAGS=`echo $HOST_ICU_CXXFLAGS | sed 's|-GR-|-GR|g'`
-        fi
-
-        HOST_ICU_BUILD_OPTS=""
-        if test -n "$MOZ_DEBUG"; then
-            HOST_ICU_BUILD_OPTS="$HOST_ICU_BUILD_OPTS --enable-debug"
-        fi
-
-        abs_srcdir=`(cd $srcdir; pwd)`
-        mkdir -p $_objdir/intl/icu/host
-        (cd $_objdir/intl/icu/host
-         MOZ_SUBCONFIGURE_WRAP([.],[
-         AR="$HOST_AR" RANLIB="$HOST_RANLIB" \
-         CC="$HOST_CC" CXX="$HOST_CXX" LD="$HOST_LD" \
-         CFLAGS="$HOST_ICU_CFLAGS $HOST_OPTIMIZE_FLAGS" \
-         CPPFLAGS="$ICU_CPPFLAGS" \
-         CXXFLAGS="$HOST_ICU_CXXFLAGS $HOST_OPTIMIZE_FLAGS" \
-         LDFLAGS="$HOST_LDFLAGS" \
-                $SHELL $abs_srcdir/intl/icu/source/runConfigureICU \
-                $HOST_ICU_BUILD_OPTS \
-                $ICU_TARGET \
-        dnl Shell quoting is fun.
-                ${ICU_SRCDIR+"$ICU_SRCDIR"} \
-                --enable-static --disable-shared \
-                --enable-extras=no --enable-icuio=no --enable-layout=no \
-                --enable-tests=no --enable-samples=no || exit 1
-         ])
-        ) || exit 1
-
-        # generate config/icucross.mk
-        $GMAKE -C $_objdir/intl/icu/host/ config/icucross.mk
-
-        # --with-cross-build requires absolute path
-        ICU_HOST_PATH=`cd $_objdir/intl/icu/host && pwd`
-        ICU_CROSS_BUILD_OPT="--with-cross-build=$ICU_HOST_PATH"
-        ICU_TARGET_OPT="--build=$build --host=$target"
-    else
-        # CROSS_COMPILE isn't set build and target are i386 and x86-64.
-        # So we must set target for --build and --host.
-        ICU_TARGET_OPT="--build=$target --host=$target"
-    fi
-
-    if test -z "$MOZ_SHARED_ICU"; then
-        # To reduce library size, use static linking
-        ICU_LINK_OPTS="--enable-static --disable-shared"
-    else
-        ICU_LINK_OPTS="--disable-static --enable-shared"
-    fi
-    # Force the ICU static libraries to be position independent code
-    ICU_CFLAGS="$DSO_PIC_CFLAGS $CFLAGS"
-    ICU_CXXFLAGS="$DSO_PIC_CFLAGS $CXXFLAGS"
-
-    ICU_BUILD_OPTS=""
-    if test -n "$MOZ_DEBUG" -o "MOZ_DEBUG_SYMBOLS"; then
-        ICU_CFLAGS="$ICU_CFLAGS $MOZ_DEBUG_FLAGS"
-        ICU_CXXFLAGS="$ICU_CXXFLAGS $MOZ_DEBUG_FLAGS"
-        if test -n "$CROSS_COMPILE" -a "$OS_TARGET" = "Darwin" \
-                -a "$HOST_OS_ARCH" != "Darwin"
-        then
-            # Bug 951758: Cross-OSX builds with non-Darwin hosts have issues
-            # with -g and friends (like -gdwarf and -gfull) because they try
-            # to run dsymutil
-            changequote(,)
-            ICU_CFLAGS=`echo $ICU_CFLAGS | sed 's|-g[^ \t]*||g'`
-            ICU_CXXFLAGS=`echo $ICU_CXXFLAGS | sed 's|-g[^ \t]*||g'`
-            changequote([,])
-        fi
-
-        ICU_LDFLAGS="$MOZ_DEBUG_LDFLAGS"
-        if test -z "$MOZ_DEBUG"; then
-            # To generate debug symbols, it requires MOZ_DEBUG_FLAGS.
-            # But, not debug build.
-            ICU_CFLAGS="$ICU_CFLAGS -UDEBUG -DNDEBUG"
-            ICU_CXXFLAGS="$ICU_CXXFLAGS -UDEBUG -DNDEBUG"
-        else
-            ICU_BUILD_OPTS="$ICU_BUILD_OPTS --enable-debug"
-        fi
-    fi
-    if test -z "$MOZ_OPTIMIZE"; then
-        ICU_BUILD_OPTS="$ICU_BUILD_OPTS --disable-release"
-    else
-        ICU_CFLAGS="$ICU_CFLAGS $MOZ_OPTIMIZE_FLAGS"
-        ICU_CXXFLAGS="$ICU_CXXFLAGS $MOZ_OPTIMIZE_FLAGS"
-    fi
-
-    if test "$am_cv_langinfo_codeset" = "no"; then
-        # ex. Android
-        ICU_CPPFLAGS="$ICU_CPPFLAGS -DU_HAVE_NL_LANGINFO_CODESET=0"
-    fi
-
-    # ICU requires RTTI
-    if test "$GNU_CC"; then
-        ICU_CXXFLAGS=`echo $ICU_CXXFLAGS | sed 's|-fno-rtti|-frtti|g'`
-    else
-        if test "$_MSC_VER"; then
-            ICU_CXXFLAGS=`echo $ICU_CXXFLAGS | sed 's|-GR-|-GR|g'`
-        fi
-
-        # Add RTL flags for MSVCRT.DLL
-        if test -n "$MOZ_DEBUG"; then
-            ICU_CFLAGS="$ICU_CFLAGS -MDd"
-            ICU_CXXFLAGS="$ICU_CXXFLAGS -MDd"
-        else
-            ICU_CFLAGS="$ICU_CFLAGS -MD"
-            ICU_CXXFLAGS="$ICU_CXXFLAGS -MD"
-        fi
-
-        # add disable optimize flag for workaround for bug 899948
-        if test -z "$MOZ_OPTIMIZE"; then
-            ICU_CFLAGS="$ICU_CFLAGS -Od"
-            ICU_CXXFLAGS="$ICU_CXXFLAGS -Od"
-        fi
-    fi
-
-    # We cannot use AC_OUTPUT_SUBDIRS since ICU tree is out of spidermonkey.
-    # When using AC_OUTPUT_SUBDIRS, objdir of ICU is out of objdir
-    # due to relative path.
-    # If building ICU moves into root of mozilla tree, we can use
-    # AC_OUTPUT_SUBDIR instead.
-    mkdir -p $_objdir/intl/icu/target
-    (cd $_objdir/intl/icu/target
-     MOZ_SUBCONFIGURE_WRAP([.],[
-       AR="$AR" CC="$CC" CXX="$CXX" LD="$LD" \
-       ARFLAGS="$ARFLAGS" \
-       CPPFLAGS="$ICU_CPPFLAGS $CPPFLAGS" \
-       CFLAGS="$ICU_CFLAGS" \
-       CXXFLAGS="$ICU_CXXFLAGS" \
-       LDFLAGS="$ICU_LDFLAGS $LDFLAGS" \
-       $SHELL $_topsrcdir/intl/icu/source/configure \
-                $ICU_BUILD_OPTS \
-                $ICU_CROSS_BUILD_OPT \
-                $ICU_LINK_OPTS \
-                ${ICU_SRCDIR+"$ICU_SRCDIR"} \
-                $ICU_TARGET_OPT \
-                --disable-extras --disable-icuio --disable-layout \
-                --disable-tests --disable-samples || exit 1
-       ])
-    ) || exit 1
-fi
-
+MOZ_SUBCONFIGURE_ICU()
 
 dnl ========================================================
 dnl JavaScript shell
 dnl ========================================================
 
 AC_HAVE_FUNCS(setlocale)
 AC_HAVE_FUNCS(localeconv)