From 3a0a51dc58b0cf33537f466729a261ec272baa3e Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Thu, 7 Aug 2014 02:58:52 +0900 Subject: [PATCH] Bug 1049281 - Move third-party build system "drivers" to config/external, and stop using static dirs. r=gps --HG-- rename : intl/icu/Makefile.in => config/external/icu/Makefile.in rename : config/nspr/Makefile.in => config/external/nspr/Makefile.in rename : config/nspr/moz.build => config/external/nspr/moz.build rename : security/build/Makefile.in => config/external/nss/Makefile.in rename : security/build/moz.build => config/external/nss/moz.build rename : security/build/nspr-dummy.def => config/external/nss/nspr-dummy.def rename : security/build/nss.def => config/external/nss/nss.def rename : security/build/nss.mk => config/external/nss/nss.mk --- Makefile.in | 2 +- config/external/ffi/Makefile.in | 6 ++++++ config/external/ffi/moz.build | 5 +++++ config/external/freetype2/Makefile.in | 6 ++++++ config/external/freetype2/moz.build | 5 +++++ {intl => config/external}/icu/Makefile.in | 14 ++++++-------- config/external/icu/moz.build | 5 +++++ config/{ => external}/nspr/Makefile.in | 4 ++-- config/{ => external}/nspr/moz.build | 0 .../build => config/external/nss}/Makefile.in | 8 ++++---- {security/build => config/external/nss}/moz.build | 0 .../build => config/external/nss}/nspr-dummy.def | 0 {security/build => config/external/nss}/nss.def | 0 {security/build => config/external/nss}/nss.mk | 0 moz.build | 10 ++++------ toolkit/toolkit.mozbuild | 3 +-- 16 files changed, 45 insertions(+), 23 deletions(-) create mode 100644 config/external/ffi/Makefile.in create mode 100644 config/external/ffi/moz.build create mode 100644 config/external/freetype2/Makefile.in create mode 100644 config/external/freetype2/moz.build rename {intl => config/external}/icu/Makefile.in (87%) create mode 100644 config/external/icu/moz.build rename config/{ => external}/nspr/Makefile.in (92%) rename config/{ => external}/nspr/moz.build (100%) rename {security/build => config/external/nss}/Makefile.in (97%) rename {security/build => config/external/nss}/moz.build (100%) rename {security/build => config/external/nss}/nspr-dummy.def (100%) rename {security/build => config/external/nss}/nss.def (100%) rename {security/build => config/external/nss}/nss.mk (100%) diff --git a/Makefile.in b/Makefile.in index 1c7526b33f6..2edf0b60d33 100644 --- a/Makefile.in +++ b/Makefile.in @@ -332,7 +332,7 @@ 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) diff --git a/config/external/ffi/Makefile.in b/config/external/ffi/Makefile.in new file mode 100644 index 00000000000..4c79573db76 --- /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 diff --git a/config/external/ffi/moz.build b/config/external/ffi/moz.build new file mode 100644 index 00000000000..c271ec3908c --- /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/. diff --git a/config/external/freetype2/Makefile.in b/config/external/freetype2/Makefile.in new file mode 100644 index 00000000000..86cccc93fcb --- /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 diff --git a/config/external/freetype2/moz.build b/config/external/freetype2/moz.build new file mode 100644 index 00000000000..c271ec3908c --- /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/. diff --git a/intl/icu/Makefile.in b/config/external/icu/Makefile.in similarity index 87% rename from intl/icu/Makefile.in rename to config/external/icu/Makefile.in index 08373cb9302..f7a6a75cb5a 100644 --- a/intl/icu/Makefile.in +++ b/config/external/icu/Makefile.in @@ -2,8 +2,6 @@ # 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 @@ -29,7 +27,7 @@ ifdef ENABLE_INTL_API 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) @@ -44,7 +42,7 @@ 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). @@ -54,16 +52,16 @@ buildicu:: # 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 diff --git a/config/external/icu/moz.build b/config/external/icu/moz.build new file mode 100644 index 00000000000..c271ec3908c --- /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/. diff --git a/config/nspr/Makefile.in b/config/external/nspr/Makefile.in similarity index 92% rename from config/nspr/Makefile.in rename to config/external/nspr/Makefile.in index b814cab064f..705d5f6980a 100644 --- a/config/nspr/Makefile.in +++ b/config/external/nspr/Makefile.in @@ -6,10 +6,10 @@ 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 diff --git a/config/nspr/moz.build b/config/external/nspr/moz.build similarity index 100% rename from config/nspr/moz.build rename to config/external/nspr/moz.build diff --git a/security/build/Makefile.in b/config/external/nss/Makefile.in similarity index 97% rename from security/build/Makefile.in rename to config/external/nss/Makefile.in index 6d0a5bab616..a540f521a1e 100644 --- a/security/build/Makefile.in +++ b/config/external/nss/Makefile.in @@ -332,7 +332,7 @@ 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 @@ -368,7 +368,7 @@ 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) @@ -389,7 +389,7 @@ $(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) @@ -468,4 +468,4 @@ 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) diff --git a/security/build/moz.build b/config/external/nss/moz.build similarity index 100% rename from security/build/moz.build rename to config/external/nss/moz.build diff --git a/security/build/nspr-dummy.def b/config/external/nss/nspr-dummy.def similarity index 100% rename from security/build/nspr-dummy.def rename to config/external/nss/nspr-dummy.def diff --git a/security/build/nss.def b/config/external/nss/nss.def similarity index 100% rename from security/build/nss.def rename to config/external/nss/nss.def diff --git a/security/build/nss.mk b/config/external/nss/nss.mk similarity index 100% rename from security/build/nss.mk rename to config/external/nss/nss.mk diff --git a/moz.build b/moz.build index 66dc1f2edc7..e28e809c1fe 100644 --- a/moz.build +++ b/moz.build @@ -42,7 +42,7 @@ if not CONFIG['JS_STANDALONE']: 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') @@ -51,15 +51,13 @@ if CONFIG['COMPILE_ENVIRONMENT'] and not CONFIG['LIBXUL_SDK']: # 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']: diff --git a/toolkit/toolkit.mozbuild b/toolkit/toolkit.mozbuild index 7b44e65535b..fea17a16552 100644 --- a/toolkit/toolkit.mozbuild +++ b/toolkit/toolkit.mozbuild @@ -27,8 +27,7 @@ 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')