Bug 870401 - Fix up the MFBT exports and the sources. r=mshal

This commit is contained in:
Brian O'Keefe 2013-10-28 10:21:29 -04:00
Родитель 37ee9de83c
Коммит 6f411f2bfd
8 изменённых файлов: 107 добавлений и 129 удалений

Просмотреть файл

@ -33,13 +33,6 @@ FORCE_SHARED_LIB = 1
endif
DIST_INSTALL = 1
###############################################
# BEGIN include sources for low-level code shared with mfbt
#
MFBT_ROOT = $(srcdir)/../../mfbt
VPATH += $(MFBT_ROOT)
include $(MFBT_ROOT)/exported_headers.mk
VPATH += \
$(srcdir) \
$(srcdir)/builtin \
@ -133,8 +126,6 @@ endif
endif # JS_HAS_CTYPES
LOCAL_INCLUDES += -I$(MFBT_ROOT)/double-conversion
# PerfMeasurement is available regardless of low-level support for it;
# it just doesn't necessarily do anything useful. There is one
# implementation source file per supported operating system, plus a stub
@ -149,13 +140,6 @@ else
SDK_LIBRARY = $(SHARED_LIBRARY)
endif
ifeq (,$(MOZ_GLUE_PROGRAM_LDFLAGS))
# When building standalone, we need to include mfbt sources, and to declare
# "exported" mfbt symbols on its behalf when we use its headers.
include $(MFBT_ROOT)/sources.mk
DEFINES += -DIMPL_MFBT
endif
EXTRA_DSO_LDOPTS += $(NSPR_LIBS)
# Define keyword generator before rules.mk, see bug 323979 comment 50

Просмотреть файл

@ -2970,6 +2970,19 @@ MOZ_ARG_HEADER(Application)
ENABLE_TESTS=1
dnl ========================================================
dnl Tell the build system that ../../mfbt exists outside
dnl the source tree, but files from there are included from
dnl inside the tree.
dnl
dnl This should probably be a --with-external-source-dir
dnl option, like the root mozilla-central configure, but
dnl then anyone building the standalone js shell would need
dnl to remember to pass it, and it is only used in one file.
dnl ========================================================
EXTERNAL_SOURCE_DIR=../../mfbt
AC_SUBST(EXTERNAL_SOURCE_DIR)
USE_ARM_KUSER=
case "${target}" in

Просмотреть файл

@ -20,8 +20,15 @@ TEST_DIRS += ['jsapi-tests', 'tests', 'gdb']
MODULE = 'js'
mfbt_root = '../../mfbt'
LOCAL_INCLUDES += ['%s/double-conversion' % mfbt_root]
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'

Просмотреть файл

@ -3,16 +3,3 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
STL_FLAGS =
# exported_headers.mk defines the headers exported by mfbt. It is included by
# mfbt itself and by the JS engine, which, when built standalone, must do the
# work to install mfbt's exported headers itself.
include $(srcdir)/exported_headers.mk
# sources.mk defines the source files built for mfbt. It is included by mfbt
# itself and by the JS engine, which, when built standalone, must do the work
# to build mfbt sources itself.
MFBT_ROOT = $(srcdir)
include $(MFBT_ROOT)/sources.mk
DEFINES += -DIMPL_MFBT

84
mfbt/common.mozbuild Normal file
Просмотреть файл

@ -0,0 +1,84 @@
# -*- 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',
'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',
'Scoped.h',
'SHA1.h',
'SplayTree.h',
'TemplateLib.h',
'ThreadLocal.h',
'TypedEnum.h',
'Types.h',
'TypeTraits.h',
'Util.h',
'Vector.h',
'WeakPtr.h',
]
mfbt_sources = [
'Compression.cpp',
'decimal/Decimal.cpp',
'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]
SOURCES += ['%s/%s' % (mfbt_root, src) for src in mfbt_sources]

Просмотреть файл

@ -1,61 +0,0 @@
# 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 mfbt. It is included by mfbt
# itself and by the JS engine, which, when built standalone, must install
# mfbt's exported headers itself.
EXPORTS_mozilla_DEST := $(DIST)/include/mozilla
EXPORTS_mozilla_TARGET := export
INSTALL_TARGETS += EXPORTS_mozilla
EXPORTS_mozilla_FILES += \
Alignment.h \
AllocPolicy.h \
Array.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 \
MSIntTypes.h \
Move.h \
NullPtr.h \
NumericLimits.h \
PodOperations.h \
Poison.h \
Range.h \
RangedPtr.h \
ReentrancyGuard.h \
RefPtr.h \
Scoped.h \
SHA1.h \
SplayTree.h \
TemplateLib.h \
ThreadLocal.h \
TypedEnum.h \
Types.h \
TypeTraits.h \
Util.h \
Vector.h \
WeakPtr.h \
$(NULL)

Просмотреть файл

@ -11,3 +11,6 @@ MODULE = 'mozglue'
LIBRARY_NAME = 'mfbt'
FORCE_STATIC_LIB = True
mfbt_root = '.'
include('common.mozbuild')

Просмотреть файл

@ -1,39 +0,0 @@
# 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/.
ifndef MFBT_ROOT
$(error Before including this file, you must define MFBT_ROOT to point to \
the MFBT source directory)
endif
CPPSRCS += \
Compression.cpp \
FloatingPoint.cpp \
HashFunctions.cpp \
Poison.cpp \
SHA1.cpp \
$(NULL)
# Imported double-conversion sources.
VPATH += $(MFBT_ROOT)/double-conversion \
$(NULL)
CPPSRCS += \
bignum-dtoa.cc \
bignum.cc \
cached-powers.cc \
diy-fp.cc \
double-conversion.cc \
fast-dtoa.cc \
fixed-dtoa.cc \
strtod.cc \
$(NULL)
# Imported decimal sources.
VPATH += $(MFBT_ROOT)/decimal \
$(NULL)
CPPSRCS += \
Decimal.cpp