Bug 958404 - Recurse mfbt from top-level when building js standalone. r=gps
authorMike Hommey <mh+mozilla@glandium.org>
Mon, 20 Jan 2014 09:11:45 +0900
changeset 181269 c8356a0b4158144bad2b4b6a968b2c6488e62c7f
parent 181268 17c463691232faa0b4c1c55dc38662b42c70ab09
child 181270 f7a650bc263ccbf55f6500fb18ee69218b9db66b
push id462
push userraliiev@mozilla.com
push dateTue, 22 Apr 2014 00:22:30 +0000
treeherdermozilla-release@ac5db8c74ac0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs958404
milestone29.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 958404 - Recurse mfbt from top-level when building js standalone. r=gps
js/src/Makefile.in
js/src/moz.build
mfbt/common.mozbuild
mfbt/moz.build
moz.build
mozglue/build/Makefile.in
--- a/js/src/Makefile.in
+++ b/js/src/Makefile.in
@@ -17,16 +17,20 @@ endif
 TOPLEVEL_BUILD := 1
 
 run_for_side_effects := $(shell echo 'MAKE: $(MAKE)')
 STATIC_LIBRARY_NAME = js_static
 LIBS		= $(NSPR_LIBS)
 
 DIST_INSTALL = 1
 
+ifdef JS_STANDALONE
+SHARED_LIBRARY_LIBS += $(call EXPAND_LIBNAME_PATH,mfbt,$(DEPTH)/mfbt)
+endif
+
 ifdef JS_HAS_CTYPES
 ifdef MOZ_NATIVE_FFI
 LOCAL_INCLUDES = $(MOZ_FFI_CFLAGS)
 else
 LOCAL_INCLUDES = -Ictypes/libffi/include
 endif
 
 ifdef MOZ_NATIVE_FFI
--- a/js/src/moz.build
+++ b/js/src/moz.build
@@ -11,25 +11,20 @@ if CONFIG['JS_NATIVE_EDITLINE']:
     DIRS += ['editline']
 
 # editline needs to get built before the shell
 if not CONFIG['JS_DISABLE_SHELL']:
     DIRS += ['shell']
 
 TEST_DIRS += ['jsapi-tests', 'tests', 'gdb']
 
-mfbt_root = '../../mfbt'
-LOCAL_INCLUDES += ['%s/double-conversion' % mfbt_root]
+LOCAL_INCLUDES += ['../../mfbt/double-conversion']
 
 if CONFIG['JS_STANDALONE']:
     LIBRARY_NAME = 'mozjs-%s' % CONFIG['MOZILLA_SYMBOLVERSION']
-
-    # When building standalone, we need to include mfbt sources, and to declare
-    # "exported" mfbt symbols on its behalf when we use its headers.
-    include('%s/common.mozbuild' % mfbt_root)
 else:
     LIBRARY_NAME = 'mozjs'
 
 CONFIGURE_SUBST_FILES += [
     'devtools/rootAnalysis/Makefile',
     'js-confdefs.h',
 ]
 
deleted file mode 100644
--- a/mfbt/common.mozbuild
+++ /dev/null
@@ -1,90 +0,0 @@
-# -*- 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/.
-
-# This file defines the headers exported by and the sources build for mfbt.
-# It is included by mfbt itself and by the JS engine, which, when built
-# standalone, must install mfbt's exported headers and build mfbt sources
-# itself. It expects that mfbt_root is set to the relative path to mfbt
-# before this file in included.
-
-mfbt_headers = [
-    'Alignment.h',
-    'AllocPolicy.h',
-    'Array.h',
-    'ArrayUtils.h',
-    'Assertions.h',
-    'Atomics.h',
-    'Attributes.h',
-    'BloomFilter.h',
-    'Casting.h',
-    'Char16.h',
-    'CheckedInt.h',
-    'Compiler.h',
-    'Compression.h',
-    'Constants.h',
-    'DebugOnly.h',
-    'decimal/Decimal.h',
-    'Endian.h',
-    'EnumSet.h',
-    'FloatingPoint.h',
-    'GuardObjects.h',
-    'HashFunctions.h',
-    'IntegerPrintfMacros.h',
-    'Likely.h',
-    'LinkedList.h',
-    'MathAlgorithms.h',
-    'Maybe.h',
-    'MemoryChecking.h',
-    'MemoryReporting.h',
-    'Move.h',
-    'MSIntTypes.h',
-    'NullPtr.h',
-    'NumericLimits.h',
-    'PodOperations.h',
-    'Poison.h',
-    'Range.h',
-    'RangedPtr.h',
-    'ReentrancyGuard.h',
-    'RefPtr.h',
-    'RollingMean.h',
-    'Scoped.h',
-    'SHA1.h',
-    'SplayTree.h',
-    'TemplateLib.h',
-    'ThreadLocal.h',
-    'TypedEnum.h',
-    'Types.h',
-    'TypeTraits.h',
-    'Vector.h',
-    'WeakPtr.h',
-]
-
-mfbt_sources = [
-    'double-conversion/bignum-dtoa.cc',
-    'double-conversion/bignum.cc',
-    'double-conversion/cached-powers.cc',
-    'double-conversion/diy-fp.cc',
-    'double-conversion/double-conversion.cc',
-    'double-conversion/fast-dtoa.cc',
-    'double-conversion/fixed-dtoa.cc',
-    'double-conversion/strtod.cc',
-    'FloatingPoint.cpp',
-    'HashFunctions.cpp',
-    'Poison.cpp',
-    'SHA1.cpp',
-]
-
-DEFINES['IMPL_MFBT'] = True
-
-EXPORTS.mozilla += ['%s/%s' % (mfbt_root, header) for header in mfbt_headers]
-UNIFIED_SOURCES += ['%s/%s' % (mfbt_root, src) for src in mfbt_sources]
-
-# Compression.cpp cannot be built in unified mode because it pulls in Windows system headers.
-# Decimal.cpp doesn't build in unified mode with gcc.
-SOURCES += [
-    mfbt_root + '/Compression.cpp',
-    mfbt_root + '/decimal/Decimal.cpp',
-]
--- a/mfbt/moz.build
+++ b/mfbt/moz.build
@@ -3,12 +3,83 @@
 # 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/.
 
 TEST_DIRS += ['tests']
 
 LIBRARY_NAME = 'mfbt'
 
-mfbt_root = '.'
-include('common.mozbuild')
+EXPORTS.mozilla = [
+    'Alignment.h',
+    'AllocPolicy.h',
+    'Array.h',
+    'ArrayUtils.h',
+    'Assertions.h',
+    'Atomics.h',
+    'Attributes.h',
+    'BloomFilter.h',
+    'Casting.h',
+    'Char16.h',
+    'CheckedInt.h',
+    'Compiler.h',
+    'Compression.h',
+    'Constants.h',
+    'DebugOnly.h',
+    'decimal/Decimal.h',
+    'Endian.h',
+    'EnumSet.h',
+    'FloatingPoint.h',
+    'GuardObjects.h',
+    'HashFunctions.h',
+    'IntegerPrintfMacros.h',
+    'Likely.h',
+    'LinkedList.h',
+    'MathAlgorithms.h',
+    'Maybe.h',
+    'MemoryChecking.h',
+    'MemoryReporting.h',
+    'Move.h',
+    'MSIntTypes.h',
+    'NullPtr.h',
+    'NumericLimits.h',
+    'PodOperations.h',
+    'Poison.h',
+    'Range.h',
+    'RangedPtr.h',
+    'ReentrancyGuard.h',
+    'RefPtr.h',
+    'RollingMean.h',
+    'Scoped.h',
+    'SHA1.h',
+    'SplayTree.h',
+    'TemplateLib.h',
+    'ThreadLocal.h',
+    'TypedEnum.h',
+    'Types.h',
+    'TypeTraits.h',
+    'Vector.h',
+    'WeakPtr.h',
+]
 
-FINAL_LIBRARY = 'mozglue'
+UNIFIED_SOURCES = [
+    'double-conversion/bignum-dtoa.cc',
+    'double-conversion/bignum.cc',
+    'double-conversion/cached-powers.cc',
+    'double-conversion/diy-fp.cc',
+    'double-conversion/double-conversion.cc',
+    'double-conversion/fast-dtoa.cc',
+    'double-conversion/fixed-dtoa.cc',
+    'double-conversion/strtod.cc',
+    'FloatingPoint.cpp',
+    'HashFunctions.cpp',
+    'Poison.cpp',
+    'SHA1.cpp',
+]
+
+DEFINES['IMPL_MFBT'] = True
+
+# Compression.cpp cannot be built in unified mode because it pulls in Windows system headers.
+# Decimal.cpp doesn't build in unified mode with gcc.
+SOURCES += [
+    'Compression.cpp',
+    'decimal/Decimal.cpp',
+]
--- a/moz.build
+++ b/moz.build
@@ -6,17 +6,17 @@
 
 CONFIGURE_SUBST_FILES += [
     'config/autoconf.mk',
     'config/emptyvars.mk',
 ]
 
 if CONFIG['BUILDING_JS']:
     if CONFIG['JS_STANDALONE']:
-        add_tier_dir('base', ['config'])
+        add_tier_dir('base', ['config', 'mfbt'])
     add_tier_dir('js', ['js/src'])
 else:
     CONFIGURE_SUBST_FILES += [
         'mozilla-config.h',
         'tools/update-packaging/Makefile',
     ]
 
     if CONFIG['ENABLE_CLANG_PLUGIN']:
--- a/mozglue/build/Makefile.in
+++ b/mozglue/build/Makefile.in
@@ -19,16 +19,18 @@ else
 SDK_LIBRARY = $(REAL_LIBRARY)
 endif
 endif
 
 endif
  
 MOZ_GLUE_LDFLAGS = # Don't link against ourselves
 
+SHARED_LIBRARY_LIBS += $(call EXPAND_LIBNAME_PATH,mfbt,$(DEPTH)/mfbt)
+
 ifneq (,$(ZLIB_IN_MOZGLUE)$(MOZ_LINKER))
 ifdef MOZ_NATIVE_ZLIB
 EXTRA_DSO_LDOPTS += $(MOZ_ZLIB_LIBS)
 else
 SHARED_LIBRARY_LIBS += $(MOZ_ZLIB_LIBS)
 endif
 endif