Bug 1049281 - Move third-party build system "drivers" to config/external, and stop using static dirs. r=gps
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 07 Aug 2014 02:58:52 +0900
changeset 198222 5bf969f77c3de125f00c3d64d62c1adc16a8501a
parent 198221 b5abd8d46814c064db71a22a1bc9020e7ce0f940
child 198223 6fe031b07d2fd04d7808dd74d72116a12138f457
push id8089
push usernigelbabu@gmail.com
push dateThu, 07 Aug 2014 03:54:40 +0000
treeherderfx-team@48c9243ab15a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs1049281
milestone34.0a1
Bug 1049281 - Move third-party build system "drivers" to config/external, and stop using static dirs. r=gps
Makefile.in
config/external/ffi/Makefile.in
config/external/ffi/moz.build
config/external/freetype2/Makefile.in
config/external/freetype2/moz.build
config/external/icu/Makefile.in
config/external/icu/moz.build
config/external/nspr/Makefile.in
config/external/nspr/moz.build
config/external/nss/Makefile.in
config/external/nss/moz.build
config/external/nss/nspr-dummy.def
config/external/nss/nss.def
config/external/nss/nss.mk
config/nspr/Makefile.in
config/nspr/moz.build
intl/icu/Makefile.in
moz.build
security/build/Makefile.in
security/build/moz.build
security/build/nspr-dummy.def
security/build/nss.def
security/build/nss.mk
toolkit/toolkit.mozbuild
--- a/Makefile.in
+++ b/Makefile.in
@@ -327,14 +327,14 @@ endif
 ifeq ($(MOZ_WIDGET_TOOLKIT),gtk3)
 toolkit/library/target: widget/gtk/mozgtk/gtk3/target
 endif
 ifdef MOZ_LDAP_XPCOM
 toolkit/library/target: ../ldap/target
 endif
 ifndef MOZ_FOLD_LIBS
 ifndef MOZ_NATIVE_SQLITE
-security/build/target: db/sqlite3/src/target
+config/external/nss/target: db/sqlite3/src/target
 endif
 endif
 ifeq ($(MOZ_REPLACE_MALLOC_LINKAGE),dummy library)
 mozglue/build/target: memory/replace/dummy/target
 endif
new file mode 100644
--- /dev/null
+++ b/config/external/ffi/Makefile.in
@@ -0,0 +1,6 @@
+# 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/.
+
+target::
+	$(MAKE) -C $(DEPTH)/js/src/ctypes/libffi
new file mode 100644
--- /dev/null
+++ b/config/external/ffi/moz.build
@@ -0,0 +1,5 @@
+# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
+# vim: set filetype=python:
+# 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/.
new file mode 100644
--- /dev/null
+++ b/config/external/freetype2/Makefile.in
@@ -0,0 +1,6 @@
+# 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/.
+
+target::
+	$(MAKE) -C $(DEPTH)/modules/freetype2
new file mode 100644
--- /dev/null
+++ b/config/external/freetype2/moz.build
@@ -0,0 +1,5 @@
+# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
+# vim: set filetype=python:
+# 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/.
rename from intl/icu/Makefile.in
rename to config/external/icu/Makefile.in
--- a/intl/icu/Makefile.in
+++ b/config/external/icu/Makefile.in
@@ -1,14 +1,12 @@
 # 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
-
 # 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.
     ifdef MOZ_SHARED_ICU
       ifeq ($(OS_ARCH),WINNT)
         ifdef JS_SHARED_LIBRARY
@@ -24,46 +22,46 @@ ifdef ENABLE_INTL_API
             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
+        ICU_TARGET := target
       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
 
 include $(topsrcdir)/config/rules.mk
 
 ifdef ENABLE_INTL_API
 ifndef MOZ_NATIVE_ICU
-default:: buildicu
+target:: 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::
 # ICU's build system is full of races, so force non-parallel build.
 # Msys screws up GENRBOPTS when it contains spaces, so all genrb flags need
 # to be stuck together. See https://bugzilla.mozilla.org/show_bug.cgi?id=1034594#c34
 ifdef CROSS_COMPILE
-	+$(MAKE) -j1 -C host STATIC_O=$(OBJ_SUFFIX) GENRBOPTS='-kRC'
+	+$(MAKE) -j1 -C $(DEPTH)/intl/icu/host STATIC_O=$(OBJ_SUFFIX) GENRBOPTS='-kRC'
 endif
-	+$(MAKE) -j1 -C target STATIC_O=$(OBJ_SUFFIX) GENRBOPTS='-kR'
+	+$(MAKE) -j1 -C $(DEPTH)/intl/icu/target STATIC_O=$(OBJ_SUFFIX) GENRBOPTS='-kR'
 	$(ICU_LIB_RENAME)
 
 distclean clean::
 ifdef CROSS_COMPILE
-	+$(MAKE) -C host $@ STATIC_O=$(OBJ_SUFFIX)
+	+$(MAKE) -C $(DEPTH)/intl/icu/host $@ STATIC_O=$(OBJ_SUFFIX)
 endif
-	+$(MAKE) -C target $@ STATIC_O=$(OBJ_SUFFIX)
+	+$(MAKE) -C $(DEPTH)/intl/icu/target $@ STATIC_O=$(OBJ_SUFFIX)
 
 endif
 endif
new file mode 100644
--- /dev/null
+++ b/config/external/icu/moz.build
@@ -0,0 +1,5 @@
+# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
+# vim: set filetype=python:
+# 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/.
rename from config/nspr/Makefile.in
rename to config/external/nspr/Makefile.in
--- a/config/nspr/Makefile.in
+++ b/config/external/nspr/Makefile.in
@@ -1,20 +1,20 @@
 #
 # 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/.
 
 include $(topsrcdir)/config/rules.mk
 
 ifdef LIBXUL_SDK
-$(error config/nspr/Makefile.in is not compatible with --enable-libxul-sdk=)
+$(error config/external/nspr/Makefile.in is not compatible with --enable-libxul-sdk=)
 endif
 ifdef MOZ_NATIVE_NSPR
-$(error config/nspr/Makefile.in is not compatible with MOZ_NATIVE_NSPR)
+$(error config/external/nspr/Makefile.in is not compatible with MOZ_NATIVE_NSPR)
 endif
 
 # Copy NSPR to the SDK
 ABS_DIST = $(abspath $(DIST))
 
 ifdef MOZ_FOLD_LIBS
 # Trick the nspr build system into not building shared libraries.
 # bug #851869.
rename from config/nspr/moz.build
rename to config/external/nspr/moz.build
rename from security/build/Makefile.in
rename to config/external/nss/Makefile.in
--- a/security/build/Makefile.in
+++ b/config/external/nss/Makefile.in
@@ -327,17 +327,17 @@ SUFFIX = .$(LIB_SUFFIX)
 endif
 
 # Fold NSPR libs
 EXTRA_LIBS += $(DEPTH)/nsprpub/pr/src/$(LIB_PREFIX)nspr4$(SUFFIX)
 EXTRA_LIBS += $(DEPTH)/nsprpub/lib/ds/$(LIB_PREFIX)plds4$(SUFFIX)
 EXTRA_LIBS += $(DEPTH)/nsprpub/lib/libc/src/$(LIB_PREFIX)plc4$(SUFFIX)
 
 # Add all static libraries for nss, smime, ssl and nssutil
-EXTRA_LIBS += $(addprefix ../,$(NSS_STATIC_LIBS))
+EXTRA_LIBS += $(addprefix $(DEPTH)/security/,$(NSS_STATIC_LIBS))
 
 nss_def_file := $(srcdir)/nss.def
 
 ifeq (WINNT,$(OS_TARGET))
 # Create a .def file based on the various .def files for nss, smime, ssl and
 # nssutil.
 nss3.def: $(nss_def_file) $(DEPTH)/db/sqlite3/src/sqlite-processed.def
 	echo LIBRARY nss3$(DLL_SUFFIX) > $@.tmp
@@ -363,17 +363,17 @@ endif # WINNT
 endif # MOZ_FOLD_LIBS
 
 include $(topsrcdir)/config/rules.mk
 
 ifdef MOZ_FOLD_LIBS
 # Force the linker to include everything from the static libraries.
 EXPAND_LIBS_EXEC += --extract
 
-$(SHARED_LIBRARY): $(addprefix ../,$(NSS_STATIC_LIBS))
+$(SHARED_LIBRARY): $(addprefix $(DEPTH)/security/,$(NSS_STATIC_LIBS))
 
 ifdef IMPORT_LIB_SUFFIX
 IMPORT_PREFIX = $(LIB_PREFIX)
 IMPORT_SUFFIX = .$(IMPORT_LIB_SUFFIX)
 else
 IMPORT_PREFIX = $(DLL_PREFIX)
 IMPORT_SUFFIX = $(DLL_SUFFIX)
 endif
@@ -384,17 +384,17 @@ SQLITE_IMPORT_LIB = $(DIST)/lib/$(IMPORT
 # TODO: The following can be replaced by something simpler when bug 844884
 # is fixed.
 # Associate target files with the rules that build them.
 $(DIST)/lib/$(LIB_PREFIX)crmf.$(LIB_SUFFIX): libs-nss/lib/crmf
 $(DIST)/lib/$(DLL_PREFIX)freebl3$(DLL_SUFFIX): libs-nss/lib/freebl
 $(DIST)/lib/$(DLL_PREFIX)nssckbi$(DLL_SUFFIX): libs-nss/lib/ckfw
 $(DIST)/lib/$(DLL_PREFIX)softokn3$(DLL_SUFFIX): libs-nss/lib/softoken
 $(DIST)/lib/$(DLL_PREFIX)nssdbm3$(DLL_SUFFIX): libs-nss/lib/softoken
-$(foreach lib,$(NSS_STATIC_LIBS),$(eval ../$(lib): libs-$(patsubst %/,%,$(dir $(lib)))))
+$(foreach lib,$(NSS_STATIC_LIBS),$(eval $(DEPTH)/security/$(lib): libs-$(patsubst %/,%,$(dir $(lib)))))
 
 # Create fake import libraries for the folded libraries, so that linking
 # against them works both for the NSS build system (see dependencies below)
 # and for the rest of the mozilla build system.
 $(NSPR_IMPORT_LIBS) \
 $(SQLITE_IMPORT_LIB) \
 $(DIST)/lib/$(IMPORT_PREFIX)nssutil3$(IMPORT_SUFFIX) \
 $(DIST)/lib/$(IMPORT_PREFIX)ssl3$(IMPORT_SUFFIX) \
@@ -463,9 +463,9 @@ libs-nss/cmd/modutil: libs-nss/lib/zlib
 endif
 $(NSS_CMD_TARGETS): libs-nss/cmd/lib
 else
 $(NSS_CMD_TARGETS): libs-nss/lib libs-nss/cmd/lib
 endif # MOZ_FOLD_LIBS
 
 # Work around NSS build system race condition creating certdata.c in
 # security/nss/lib/ckfw/builtins. See bug #836220.
-libs-nss/lib$(if $(MOZ_FOLD_LIBS),/ckfw): $(call mkdir_deps,../nss/lib/ckfw/builtins)
+libs-nss/lib$(if $(MOZ_FOLD_LIBS),/ckfw): $(call mkdir_deps,$(DEPTH)/security/nss/lib/ckfw/builtins)
rename from security/build/moz.build
rename to config/external/nss/moz.build
rename from security/build/nspr-dummy.def
rename to config/external/nss/nspr-dummy.def
rename from security/build/nss.def
rename to config/external/nss/nss.def
rename from security/build/nss.mk
rename to config/external/nss/nss.mk
--- a/moz.build
+++ b/moz.build
@@ -37,31 +37,29 @@ if not CONFIG['LIBXUL_SDK']:
         add_tier_dir('base', ['mozglue', 'memory/mozalloc'])
 
 
 if not CONFIG['JS_STANDALONE']:
     add_tier_dir('precompile', 'xpcom/xpidl')
 
 if CONFIG['COMPILE_ENVIRONMENT'] and not CONFIG['LIBXUL_SDK']:
     if CONFIG['MOZ_BUILD_NSPR']:
-        add_tier_dir('nspr', 'config/nspr', trigger='NSPR_LIBS')
+        add_tier_dir('nspr', 'config/external/nspr', trigger='NSPR_LIBS')
 
     if not CONFIG['JS_STANDALONE']:
         add_tier_dir('external', 'config/external')
         if not CONFIG['MOZ_NATIVE_NSS']:
             # We want security/build to be built before anything using
             # NSPR_LIBS when MOZ_FOLD_LIBS is set, because that's where NSPR
             # actually ends up being linked. All places using NSS_LIBS also
             # use NSPR_LIBS so it's safe to use the latter.
-            add_tier_dir('nss', 'security/build',
+            add_tier_dir('nss', 'config/external/nss',
                 trigger='NSPR_LIBS' if CONFIG['MOZ_FOLD_LIBS'] else 'NSS_LIBS')
 
     if CONFIG['BUILD_CTYPES'] and not CONFIG['MOZ_NATIVE_FFI']:
-        add_tier_dir('js', ['js/src/ctypes/libffi'], static=True,
-            trigger='MOZ_FFI_LIBS')
+        add_tier_dir('js', ['config/external/ffi'], trigger='MOZ_FFI_LIBS')
     if CONFIG['ENABLE_INTL_API'] and not CONFIG['MOZ_NATIVE_ICU']:
-        add_tier_dir('js', ['intl/icu'], static=True, trigger='MOZ_ICU_LIBS')
-        CONFIGURE_SUBST_FILES += ['intl/icu/Makefile']
+        add_tier_dir('js', ['config/external/icu'], trigger='MOZ_ICU_LIBS')
     add_tier_dir('js', ['js/src'])
 
 if not CONFIG['JS_STANDALONE']:
     # Bring in the configuration for the configured application.
     include('/' + CONFIG['MOZ_BUILD_APP'] + '/app.mozbuild')
--- a/toolkit/toolkit.mozbuild
+++ b/toolkit/toolkit.mozbuild
@@ -22,18 +22,17 @@ if CONFIG['MOZ_UPDATER']:
 
 if CONFIG['NS_TRACE_MALLOC']:
     add_tier_dir('platform', 'tools/trace-malloc/lib')
 
 if CONFIG['MOZ_DMD']:
     add_tier_dir('platform', 'memory/replace/dmd')
 
 if CONFIG['MOZ_TREE_FREETYPE']:
-    add_tier_dir('platform', 'modules/freetype2', static=True,
-        trigger='FT2_LIBS')
+    add_tier_dir('platform', 'config/external/freetype2', trigger='FT2_LIBS')
 
 add_tier_dir('platform', 'xpcom')
 
 add_tier_dir('platform', [
     'modules/libpref',
     'intl',
     'netwerk',
 ])