Bug 958404 - Recurse icu from top-level when building js. r=gps
authorMike Hommey <mh+mozilla@glandium.org>
Mon, 20 Jan 2014 09:13:06 +0900
changeset 164274 5d19bc17175cc1903517b2ac907995ff49cfb163
parent 164273 f7a650bc263ccbf55f6500fb18ee69218b9db66b
child 164275 5fba4f93ae5c11775dfe4b7b19caeec4068566b5
push id4455
push usercbook@mozilla.com
push dateMon, 20 Jan 2014 11:54:56 +0000
treeherderfx-team@8f8b2d541dbd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs958404
milestone29.0a1
Bug 958404 - Recurse icu from top-level when building js. r=gps
intl/icu/Makefile.in
js/src/Makefile.in
moz.build
new file mode 100644
--- /dev/null
+++ b/intl/icu/Makefile.in
@@ -0,0 +1,81 @@
+# 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/.
+
+STANDALONE_MAKEFILE = 1
+SUPPRESS_DEFAULT_RULES = 1
+
+# Ensure that this happens before including rules.mk
+ifdef ENABLE_INTL_API
+  ifndef MOZ_NATIVE_ICU
+  # Library names: On Windows, ICU uses modified library names for static
+  # and debug libraries.
+    ifeq ($(OS_ARCH),WINNT)
+      ifdef MOZ_DEBUG
+        ICU_LIB_SUFFIX=d
+      endif
+    endif # WINNT
+    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)$(ICU_LIB_SUFFIX)$(MOZ_ICU_VERSION).dll)
+        endif
+      else # ! WINNT
+        ifeq ($(OS_ARCH),Darwin)
+          ifdef JS_SHARED_LIBRARY
+            ICU_FILES := $(foreach libname,$(ICU_LIB_NAMES),$(DEPTH)/intl/icu/target/lib/$(DLL_PREFIX)$(libname).$(MOZ_ICU_VERSION)$(DLL_SUFFIX))
+          endif
+        else # ! Darwin
+          ifdef JS_SHARED_LIBRARY
+            ICU_FILES := $(foreach libname,$(ICU_LIB_NAMES),$(DEPTH)/intl/icu/target/lib/$(DLL_PREFIX)$(libname)$(DLL_SUFFIX).$(MOZ_ICU_VERSION))
+          endif
+        endif
+      endif # WINNT
+      ifdef ICU_FILES
+        ICU_DEST := $(DIST)/bin
+        INSTALL_TARGETS += ICU
+        $(ICU_FILES): buildicu
+        ICU_TARGET := default
+      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)$(ICU_LIB_SUFFIX).lib $(DEPTH)/intl/icu/target/lib/$(libname).lib;)
+      endif
+    endif # MOZ_SHARED_ICU
+  endif # !MOZ_NATIVE_ICU
+endif # ENABLE_INTL_API
+
+include $(topsrcdir)/config/rules.mk
+
+ifdef ENABLE_INTL_API
+ifndef MOZ_NATIVE_ICU
+ifdef .PYMAKE
+ICU_MAKE = $(GMAKE)
+else
+ICU_MAKE = $(MAKE)
+endif
+
+default:: buildicu
+
+# - ICU requires GNU make according to its readme.html. pymake can't be used
+#   because it doesn't support order only dependencies.
+# - 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::
+# ICU's build system is full of races, so force non-parallel build.
+ifdef CROSS_COMPILE
+	+$(ICU_MAKE) -j1 -C host STATIC_O=$(OBJ_SUFFIX) GENRBOPTS='-k -R -C'
+endif
+	+$(ICU_MAKE) -j1 -C target STATIC_O=$(OBJ_SUFFIX) GENRBOPTS='-k -R'
+	$(ICU_LIB_RENAME)
+
+distclean clean::
+ifdef CROSS_COMPILE
+	+$(ICU_MAKE) -C host $@ STATIC_O=$(OBJ_SUFFIX)
+endif
+	+$(ICU_MAKE) -C target $@ STATIC_O=$(OBJ_SUFFIX)
+
+endif
+endif
--- a/js/src/Makefile.in
+++ b/js/src/Makefile.in
@@ -93,66 +93,18 @@ ifdef HAVE_DTRACE
 export_files += $(CURDIR)/javascript-trace.h
 endif
 
 INSTALL_TARGETS += jsconfig
 jsconfig_FILES = $(export_files)
 jsconfig_DEST = $(DIST)/include
 jsconfig_TARGET := export
 
-# Ensure that this happens before using $(MOZ_PSEUDO_DERECURSE)
-include $(topsrcdir)/config/config.mk
-
-# Ensure that this happens before including rules.mk
-ifdef ENABLE_INTL_API
-  ifndef MOZ_NATIVE_ICU
-  # Library names: On Windows, ICU uses modified library names for static
-  # and debug libraries.
-    ifeq ($(OS_ARCH),WINNT)
-      ifdef MOZ_DEBUG
-        ICU_LIB_SUFFIX=d
-      endif
-    endif # WINNT
-    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)$(ICU_LIB_SUFFIX)$(MOZ_ICU_VERSION).dll)
-        endif
-      else # ! WINNT
-        ifeq ($(OS_ARCH),Darwin)
-          ifdef JS_SHARED_LIBRARY
-            ICU_FILES := $(foreach libname,$(ICU_LIB_NAMES),$(DEPTH)/intl/icu/target/lib/$(DLL_PREFIX)$(libname).$(MOZ_ICU_VERSION)$(DLL_SUFFIX))
-          endif
-        else # ! Darwin
-          ifdef JS_SHARED_LIBRARY
-            ICU_FILES := $(foreach libname,$(ICU_LIB_NAMES),$(DEPTH)/intl/icu/target/lib/$(DLL_PREFIX)$(libname)$(DLL_SUFFIX).$(MOZ_ICU_VERSION))
-          endif
-        endif
-      endif # WINNT
-      ifdef ICU_FILES
-        ICU_DEST := $(DIST)/bin
-        INSTALL_TARGETS += ICU
-        $(ICU_FILES): buildicu
-        ICU_TARGET := $(if $(MOZ_PSEUDO_DERECURSE),compile,export)
-      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)$(ICU_LIB_SUFFIX).lib $(DEPTH)/intl/icu/target/lib/$(libname).lib;)
-      endif
-    endif # MOZ_SHARED_ICU
-  endif # !MOZ_NATIVE_ICU
-endif # ENABLE_INTL_API
-
 include $(topsrcdir)/config/rules.mk
 
-.PHONY: buildicu
-buildicu:
-$(if $(MOZ_PSEUDO_DERECURSE),compile,export):: buildicu
-
 #############################################
 # BEGIN ECMAScript Internationalization API
 #
 
 # ICU headers need to be available whether we build with the complete
 # Internationalization API or not - ICU stubs rely on them.
 
 ifdef MOZ_NATIVE_ICU
@@ -181,41 +133,16 @@ EXTRA_DSO_LDOPTS += \
   -DELAYLOAD:icudt$(MOZ_ICU_VERSION).dll \
   -DELAYLOAD:icuin$(MOZ_ICU_VERSION).dll \
   -DELAYLOAD:icuuc$(MOZ_ICU_VERSION).dll \
   $(NULL)
 endif
 endif
 endif
 
-ifdef .PYMAKE
-ICU_MAKE = $(GMAKE)
-else
-ICU_MAKE = $(MAKE)
-endif
-
-# - ICU requires GNU make according to its readme.html. pymake can't be used
-#   because it doesn't support order only dependencies.
-# - 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:
-# ICU's build system is full of races, so force non-parallel build.
-ifdef CROSS_COMPILE
-	+$(ICU_MAKE) -j1 -C $(DEPTH)/intl/icu/host STATIC_O=$(OBJ_SUFFIX) GENRBOPTS='-k -R -C'
-endif
-	+$(ICU_MAKE) -j1 -C $(DEPTH)/intl/icu/target STATIC_O=$(OBJ_SUFFIX) GENRBOPTS='-k -R'
-	$(ICU_LIB_RENAME)
-
-distclean clean::
-ifdef CROSS_COMPILE
-	$(call SUBMAKE,$@,$(DEPTH)/intl/icu/host)
-endif
-	$(call SUBMAKE,$@,$(DEPTH)/intl/icu/target)
-
 endif
 endif
 
 #
 # END ECMAScript Internationalization API
 #############################################
 
 
--- a/moz.build
+++ b/moz.build
@@ -9,16 +9,18 @@ CONFIGURE_SUBST_FILES += [
     'config/emptyvars.mk',
 ]
 
 if CONFIG['BUILDING_JS']:
     if CONFIG['JS_STANDALONE']:
         add_tier_dir('base', ['config', 'mfbt'])
     if CONFIG['JS_HAS_CTYPES'] and not CONFIG['MOZ_NATIVE_FFI']:
         add_tier_dir('js', ['js/src/ctypes/libffi'], static=True)
+    add_tier_dir('js', ['intl/icu'], static=True)
+    CONFIGURE_SUBST_FILES += ['intl/icu/Makefile']
     add_tier_dir('js', ['js/src'])
 else:
     CONFIGURE_SUBST_FILES += [
         'mozilla-config.h',
         'tools/update-packaging/Makefile',
     ]
 
     if CONFIG['ENABLE_CLANG_PLUGIN']: