Bug 969164 - Traverse js/src moz.builds from top-level configure. r=gps

Before, we would run configure in both top-level and js/src, and both
configures would traverse their own set of moz.builds, without actual
knowledge about the other. With this change, both configures still run,
but only top-level traverses moz.build files, and uses js/src's
config.status when traversing its moz.build files. This allows a better
sharing of information between both build systems and the removal of many
hacks.

This also moves running libffi and icu configure to top-level.

Standalone js builds still have their own configure doing moz.build traversal,
as before.

--HG--
rename : config/autoconf.mk.in => config/autoconf-js.mk.in
rename : config/emptyvars.mk.in => config/emptyvars-js.mk.in
This commit is contained in:
Mike Hommey 2014-02-11 10:37:47 +09:00
parent cb063c5a25
commit 0d839c5b66
17 changed files with 358 additions and 321 deletions

View File

@ -22,4 +22,4 @@
# changes to stick? As of bug 928195, this shouldn't be necessary! Please
# don't change CLOBBER for WebIDL changes any more.
Bug 964200 - Touching webidl files in this bug doesn't work without a clobber. Tried landing already and had to back out.
Bug 969164 changes the directory layout under js/src during gecko builds, and that causes a build failure on incremental builds because of the js shell trying to replace a directory with the same name.

View File

@ -23,14 +23,6 @@ endif
include $(topsrcdir)/config/config.mk
ifndef LIBXUL_SDK
ifdef COMPILE_ENVIRONMENT
ifndef BUILDING_JS
BUILD_JS = 1
endif
endif
endif
GARBAGE_DIRS += dist _javagen _profile staticlib
DIST_GARBAGE = config.cache config.log config.status* config-defs.h \
config/autoconf.mk \
@ -38,7 +30,7 @@ DIST_GARBAGE = config.cache config.log config.status* config-defs.h \
netwerk/necko-config.h xpcom/xpcom-config.h xpcom/xpcom-private.h \
.mozconfig.mk
ifdef BUILDING_JS
ifdef JS_STANDALONE
configure_dir = $(topsrcdir)/js/src
else
configure_dir = $(topsrcdir)
@ -48,8 +40,8 @@ ifndef MOZ_PROFILE_USE
# We need to explicitly put backend.RecursiveMakeBackend here
# otherwise the rule in rules.mk doesn't run early enough.
libs binaries export tools:: CLOBBER $(configure_dir)/configure config.status backend.RecursiveMakeBackend
ifdef BUILD_JS
libs binaries export tools:: js-config-status
ifndef JS_STANDALONE
libs binaries export tools:: $(topsrcdir)/js/src/configure js/src/config.status
endif
endif
@ -64,17 +56,21 @@ CLOBBER: $(topsrcdir)/CLOBBER
@exit 1
endif
$(configure_dir)/configure: $(configure_dir)/configure.in
@echo 'STOP! configure.in has changed, and your configure is out of date.'
$(topsrcdir)/configure: $(topsrcdir)/configure.in
$(topsrcdir)/js/src/configure: $(topsrcdir)/js/src/configure.in
$(topsrcdir)/configure $(topsrcdir)/js/src/configure:
@echo 'STOP! $^ has changed, and your configure is out of date.'
@echo 'Please rerun autoconf and re-configure your build directory.'
@echo 'To ignore this message, touch "configure" in the source directory,'
@echo 'To ignore this message, touch "$@",'
@echo 'but your build might not succeed.'
@exit 1
config.status: $(configure_dir)/configure
@echo 'STOP! configure has changed and needs to be run in this build directory.'
@echo 'Please rerun configure.'
@echo 'To ignore this message, touch "config.status" in the build directory,'
js/src/config.status: $(topsrcdir)/js/src/configure
config.status js/src/config.status:
@echo 'STOP! $^ has changed and needs to be run again.'
@echo 'Please rerun it.'
@echo 'To ignore this message, touch "$(CURDIR)/$@",'
@echo 'but your build might not succeed.'
@exit 1
@ -96,12 +92,6 @@ include backend.RecursiveMakeBackend.pp
default:: backend.RecursiveMakeBackend
ifdef BUILD_JS
.PHONY: js-config-status
js-config-status:
$(call SUBMAKE,backend.RecursiveMakeBackend,js/src,1)
endif
install_manifests := bin idl include public private sdk
install_manifest_depends = \
CLOBBER \
@ -110,8 +100,11 @@ install_manifest_depends = \
backend.RecursiveMakeBackend \
$(NULL)
ifdef BUILD_JS
install_manifest_depends += js-config-status
ifndef JS_STANDALONE
install_manifest_depends += \
$(topsrcdir)/js/src/configure \
js/src/config.status \
$(NULL)
endif
.PHONY: install-manifests
@ -119,24 +112,21 @@ install-manifests: $(addprefix install-dist-,$(install_manifests))
# process_install_manifest needs to be invoked with --no-remove when building
# js as standalone because automated builds are building nspr separately and
# that would remove the resulting files. It is also necessary when building
# js as part of gecko because that would remove the files exported from gecko.
# that would remove the resulting files.
# Eventually, a standalone js build would just be able to build nspr itself,
# removing the need for the former. But that won't likely happen before
# finishing to merge gecko and js build systems, removing the need for the
# latter.
# removing the need for the former.
ifdef BUILDING_JS
NO_REMOVE=1
endif
.PHONY: $(addprefix install-dist-,$(install_manifests))
$(addprefix install-dist-,$(install_manifests)): install-dist-%: $(install_manifest_depends)
$(call py_action,process_install_manifest,$(if $(NO_REMOVE),--no-remove )$(DIST)/$* _build_manifests/install/dist_$* $(if $(BUILD_JS),js/src/_build_manifests/install/dist_$*))
$(call py_action,process_install_manifest,$(if $(NO_REMOVE),--no-remove )$(DIST)/$* _build_manifests/install/dist_$*)
.PHONY: install-tests
install-manifests: install-tests
install-tests: $(install_manifest_depends)
$(call py_action,process_install_manifest,$(if $(NO_REMOVE),--no-remove )_tests _build_manifests/install/tests $(if $(BUILD_JS),js/src/_build_manifests/install/tests))
$(call py_action,process_install_manifest,$(if $(NO_REMOVE),--no-remove )_tests _build_manifests/install/tests)
# _tests should be purged during cleaning. However, we don't want it purged
@ -294,10 +284,7 @@ source-package install:
.PHONY: config/export
config/export:
else
ifdef BUILD_JS
js/src/Makefile: subsrcdir := js/src
endif
ifdef MOZ_PSEUDO_DERECURSE
# Interdependencies for parallel export.
@ -308,5 +295,3 @@ ifdef ENABLE_CLANG_PLUGIN
js/src/export config/export: build/clang-plugin/export
endif
endif
endif
endif

View File

@ -55,7 +55,7 @@ ifelse($#, 2, _MOZ_AC_DEFINE_UNQUOTED($1, $2), $#, 3, _MOZ_AC_DEFINE_UNQUOTED($1
])
dnl Replace AC_OUTPUT to create and call a python config.status
define([_MOZ_AC_OUTPUT],
define([MOZ_CREATE_CONFIG_STATUS],
[dnl Top source directory in Windows format (as opposed to msys format).
WIN_TOP_SRC=
encoding=utf-8
@ -99,7 +99,8 @@ dnl form suitable for make.
topsrcdir = '''${WIN_TOP_SRC:-$srcdir}'''
if not os.path.isabs(topsrcdir):
rel = os.path.join(os.path.dirname(<<<__file__>>>), topsrcdir)
topsrcdir = os.path.normpath(os.path.abspath(rel))
topsrcdir = os.path.abspath(rel)
topsrcdir = os.path.normpath(topsrcdir)
topobjdir = os.path.abspath(os.path.dirname(<<<__file__>>>))
@ -149,14 +150,26 @@ cat >> $CONFIG_STATUS <<EOF
]
__all__ = ['topobjdir', 'topsrcdir', 'defines', 'non_global_defines', 'substs']
EOF
# We don't want js/src/config.status to do anything in gecko builds.
if test -z "$BUILDING_JS" -o -n "$JS_STANDALONE"; then
cat >> $CONFIG_STATUS <<EOF
dnl Do the actual work
if __name__ == '__main__':
args = dict([(name, globals()[name]) for name in __all__])
from mozbuild.config_status import config_status
config_status(**args)
EOF
fi
changequote([, ])
])
define([MOZ_RUN_CONFIG_STATUS],
[
chmod +x $CONFIG_STATUS
rm -fr confdefs* $ac_clean_files
dnl Execute config.status, unless --no-create was passed to configure.
@ -172,7 +185,8 @@ errprint([$1
m4exit(1)
])
define([AC_OUTPUT], [ifelse($#_$1, 1_, [_MOZ_AC_OUTPUT()],
define([AC_OUTPUT], [ifelse($#_$1, 1_, [MOZ_CREATE_CONFIG_STATUS()
MOZ_RUN_CONFIG_STATUS()],
[m4_fatal([Use CONFIGURE_SUBST_FILES in moz.build files to create substituted files.])]
)])

View File

@ -23,66 +23,70 @@ AC_SUBST(MOZ_NATIVE_FFI)
])
AC_DEFUN([MOZ_SUBCONFIGURE_FFI], [
if test "$BUILD_CTYPES" -a -z "$MOZ_NATIVE_FFI"; then
# Run the libffi 'configure' script.
ac_configure_args="--disable-shared --enable-static --disable-raw-api"
if test "$MOZ_DEBUG"; then
ac_configure_args="$ac_configure_args --enable-debug"
fi
if test "$DSO_PIC_CFLAGS"; then
ac_configure_args="$ac_configure_args --with-pic"
fi
for var in AS CC CXX CPP LD AR RANLIB STRIP; do
ac_configure_args="$ac_configure_args $var='`eval echo \\${${var}}`'"
done
if test "$CROSS_COMPILE"; then
export CPPFLAGS CFLAGS LDFLAGS
fi
ac_configure_args="$ac_configure_args --build=$build --host=$target"
if test "$_MSC_VER"; then
# Use a wrapper script for cl and ml that looks more like gcc.
# autotools can't quite handle an MSVC build environment yet.
LDFLAGS=
CFLAGS=
ac_configure_args="$ac_configure_args LD=link CPP=\"cl -nologo -EP\" SHELL=sh.exe"
case "${target_cpu}" in
x86_64)
# Need target since MSYS tools into mozilla-build may be 32bit
ac_configure_args="$ac_configure_args CC=\"$_topsrcdir/js/src/ctypes/libffi/msvcc.sh -m64\""
;;
*)
ac_configure_args="$ac_configure_args CC=$_topsrcdir/js/src/ctypes/libffi/msvcc.sh"
;;
esac
fi
if test "$SOLARIS_SUNPRO_CC"; then
# Always use gcc for libffi on Solaris
if test ! "$HAVE_64BIT_OS"; then
ac_configure_args="$ac_configure_args CC=gcc CFLAGS=-m32 LD= LDFLAGS="
else
ac_configure_args="$ac_configure_args CC=gcc CFLAGS=-m64 LD= LDFLAGS="
if test -z "$BUILDING_JS" -o -n "$JS_STANDALONE"; then
if test "$BUILD_CTYPES" -a -z "$MOZ_NATIVE_FFI"; then
# Run the libffi 'configure' script.
ac_configure_args="--disable-shared --enable-static --disable-raw-api"
if test "$MOZ_DEBUG"; then
ac_configure_args="$ac_configure_args --enable-debug"
fi
fi
if test "$AIX_IBM_XLC"; then
# Always use gcc for libffi on IBM AIX5/AIX6
if test ! "$HAVE_64BIT_OS"; then
ac_configure_args="$ac_configure_args CC=gcc CFLAGS=-maix32"
else
ac_configure_args="$ac_configure_args CC=gcc CFLAGS=-maix64"
if test "$DSO_PIC_CFLAGS"; then
ac_configure_args="$ac_configure_args --with-pic"
fi
for var in AS CC CXX CPP LD AR RANLIB STRIP; do
ac_configure_args="$ac_configure_args $var='`eval echo \\${${var}}`'"
done
if test "$CROSS_COMPILE"; then
export CPPFLAGS CFLAGS LDFLAGS
fi
ac_configure_args="$ac_configure_args --build=$build --host=$target"
if test "$_MSC_VER"; then
# Use a wrapper script for cl and ml that looks more like gcc.
# autotools can't quite handle an MSVC build environment yet.
LDFLAGS=
CFLAGS=
ac_configure_args="$ac_configure_args LD=link CPP=\"cl -nologo -EP\" SHELL=sh.exe"
case "${target_cpu}" in
x86_64)
# Need target since MSYS tools into mozilla-build may be 32bit
ac_configure_args="$ac_configure_args CC=\"$_topsrcdir/js/src/ctypes/libffi/msvcc.sh -m64\""
;;
*)
ac_configure_args="$ac_configure_args CC=$_topsrcdir/js/src/ctypes/libffi/msvcc.sh"
;;
esac
fi
if test "$SOLARIS_SUNPRO_CC"; then
# Always use gcc for libffi on Solaris
if test ! "$HAVE_64BIT_OS"; then
ac_configure_args="$ac_configure_args CC=gcc CFLAGS=-m32 LD= LDFLAGS="
else
ac_configure_args="$ac_configure_args CC=gcc CFLAGS=-m64 LD= LDFLAGS="
fi
fi
if test "$AIX_IBM_XLC"; then
# Always use gcc for libffi on IBM AIX5/AIX6
if test ! "$HAVE_64BIT_OS"; then
ac_configure_args="$ac_configure_args CC=gcc CFLAGS=-maix32"
else
ac_configure_args="$ac_configure_args CC=gcc CFLAGS=-maix64"
fi
fi
# Use a separate cache file for libffi, since it does things differently
# from our configure.
mkdir -p $_objdir/js/src/ctypes/libffi
old_cache_file=$cache_file
cache_file=$_objdir/js/src/ctypes/libffi/config.cache
old_config_files=$CONFIG_FILES
unset CONFIG_FILES
AC_OUTPUT_SUBDIRS(js/src/ctypes/libffi)
cache_file=$old_cache_file
ac_configure_args="$_SUBDIR_CONFIG_ARGS"
CONFIG_FILES=$old_config_files
fi
# Use a separate cache file for libffi, since it does things differently
# from our configure.
mkdir -p $_objdir/js/src/ctypes/libffi
old_cache_file=$cache_file
cache_file=$_objdir/js/src/ctypes/libffi/config.cache
old_config_files=$CONFIG_FILES
unset CONFIG_FILES
AC_OUTPUT_SUBDIRS(js/src/ctypes/libffi)
cache_file=$old_cache_file
ac_configure_args="$_SUBDIR_CONFIG_ARGS"
CONFIG_FILES=$old_config_files
fi
])

View File

@ -89,26 +89,26 @@ if test -n "$ENABLE_INTL_API"; then
if test -n "$MOZ_DEBUG"; then
DBG_SUFFIX=d
fi
MOZ_ICU_LIBS='$(foreach lib,$(ICU_LIB_NAMES),$(DEPTH)$1/intl/icu/target/lib/$(LIB_PREFIX)$(lib)$(DBG_SUFFIX).$(LIB_SUFFIX))'
MOZ_ICU_LIBS='$(foreach lib,$(ICU_LIB_NAMES),$(DEPTH)/intl/icu/target/lib/$(LIB_PREFIX)$(lib)$(DBG_SUFFIX).$(LIB_SUFFIX))'
fi
;;
Darwin)
ICU_LIB_NAMES="icui18n icuuc icudata"
if test -n "$MOZ_SHARED_ICU"; then
MOZ_ICU_LIBS='$(foreach lib,$(ICU_LIB_NAMES),$(DEPTH)$1/intl/icu/target/lib/$(DLL_PREFIX)$(lib).$(MOZ_ICU_VERSION)$(DLL_SUFFIX))'
MOZ_ICU_LIBS='$(foreach lib,$(ICU_LIB_NAMES),$(DEPTH)/intl/icu/target/lib/$(DLL_PREFIX)$(lib).$(MOZ_ICU_VERSION)$(DLL_SUFFIX))'
fi
;;
Linux|DragonFly|FreeBSD|NetBSD|OpenBSD)
ICU_LIB_NAMES="icui18n icuuc icudata"
if test -n "$MOZ_SHARED_ICU"; then
MOZ_ICU_LIBS='$(foreach lib,$(ICU_LIB_NAMES),$(DEPTH)$1/intl/icu/target/lib/$(DLL_PREFIX)$(lib)$(DLL_SUFFIX).$(MOZ_ICU_VERSION))'
MOZ_ICU_LIBS='$(foreach lib,$(ICU_LIB_NAMES),$(DEPTH)/intl/icu/target/lib/$(DLL_PREFIX)$(lib)$(DLL_SUFFIX).$(MOZ_ICU_VERSION))'
fi
;;
*)
AC_MSG_ERROR([ECMAScript Internationalization API is not yet supported on this platform])
esac
if test -z "$MOZ_SHARED_ICU"; then
MOZ_ICU_LIBS='$(call EXPAND_LIBNAME_PATH,$(ICU_LIB_NAMES),$(DEPTH)$1/intl/icu/target/lib)'
MOZ_ICU_LIBS='$(call EXPAND_LIBNAME_PATH,$(ICU_LIB_NAMES),$(DEPTH)/intl/icu/target/lib)'
fi
fi
fi
@ -134,189 +134,194 @@ fi
])
AC_DEFUN([MOZ_SUBCONFIGURE_ICU], [
if test -n "$ENABLE_INTL_API" -a -z "$MOZ_NATIVE_ICU"; then
# Set ICU compile options
ICU_CPPFLAGS=""
# don't use icu namespace automatically in client code
ICU_CPPFLAGS="$ICU_CPPFLAGS -DU_USING_ICU_NAMESPACE=0"
# don't include obsolete header files
ICU_CPPFLAGS="$ICU_CPPFLAGS -DU_NO_DEFAULT_INCLUDE_UTF_HEADERS=1"
# remove chunks of the library that we don't need (yet)
ICU_CPPFLAGS="$ICU_CPPFLAGS -DUCONFIG_NO_LEGACY_CONVERSION"
ICU_CPPFLAGS="$ICU_CPPFLAGS -DUCONFIG_NO_TRANSLITERATION"
ICU_CPPFLAGS="$ICU_CPPFLAGS -DUCONFIG_NO_REGULAR_EXPRESSIONS"
ICU_CPPFLAGS="$ICU_CPPFLAGS -DUCONFIG_NO_BREAK_ITERATION"
ICU_CROSS_BUILD_OPT=""
ICU_SRCDIR=""
if test "$HOST_OS_ARCH" = "WINNT"; then
ICU_SRCDIR="--srcdir=$(cd $srcdir/intl/icu/source; pwd -W)"
fi
if test -z "$BUILDING_JS" -o -n "$JS_STANDALONE"; then
if test "$CROSS_COMPILE"; then
# Building host tools. It is necessary to build target binary.
case "$HOST_OS_ARCH" in
Darwin)
ICU_TARGET=MacOSX
;;
Linux)
ICU_TARGET=Linux
;;
WINNT)
ICU_TARGET=MSYS/MSVC
;;
*bsd*|dragonfly*)
ICU_TARGET=BSD
;;
esac
# Remove _DEPEND_CFLAGS from HOST_FLAGS to avoid configure error
HOST_ICU_CFLAGS="$HOST_CFLAGS"
HOST_ICU_CXXFLAGS="$HOST_CXXFLAGS"
if test -n "$ENABLE_INTL_API" -a -z "$MOZ_NATIVE_ICU"; then
# Set ICU compile options
ICU_CPPFLAGS=""
# don't use icu namespace automatically in client code
ICU_CPPFLAGS="$ICU_CPPFLAGS -DU_USING_ICU_NAMESPACE=0"
# don't include obsolete header files
ICU_CPPFLAGS="$ICU_CPPFLAGS -DU_NO_DEFAULT_INCLUDE_UTF_HEADERS=1"
# remove chunks of the library that we don't need (yet)
ICU_CPPFLAGS="$ICU_CPPFLAGS -DUCONFIG_NO_LEGACY_CONVERSION"
ICU_CPPFLAGS="$ICU_CPPFLAGS -DUCONFIG_NO_TRANSLITERATION"
ICU_CPPFLAGS="$ICU_CPPFLAGS -DUCONFIG_NO_REGULAR_EXPRESSIONS"
ICU_CPPFLAGS="$ICU_CPPFLAGS -DUCONFIG_NO_BREAK_ITERATION"
HOST_ICU_CFLAGS=`echo $HOST_ICU_CFLAGS | sed "s|$_DEPEND_CFLAGS||g"`
HOST_ICU_CXXFLAGS=`echo $HOST_ICU_CFXXLAGS | sed "s|$_DEPEND_CFLAGS||g"`
ICU_CROSS_BUILD_OPT=""
ICU_SRCDIR=""
if test "$HOST_OS_ARCH" = "WINNT"; then
ICU_SRCDIR="--srcdir=$(cd $srcdir/intl/icu/source; pwd -W)"
fi
if test "$CROSS_COMPILE"; then
# Building host tools. It is necessary to build target binary.
case "$HOST_OS_ARCH" in
Darwin)
ICU_TARGET=MacOSX
;;
Linux)
ICU_TARGET=Linux
;;
WINNT)
ICU_TARGET=MSYS/MSVC
;;
*bsd*|dragonfly*)
ICU_TARGET=BSD
;;
esac
# Remove _DEPEND_CFLAGS from HOST_FLAGS to avoid configure error
HOST_ICU_CFLAGS="$HOST_CFLAGS"
HOST_ICU_CXXFLAGS="$HOST_CXXFLAGS"
HOST_ICU_CFLAGS=`echo $HOST_ICU_CFLAGS | sed "s|$_DEPEND_CFLAGS||g"`
HOST_ICU_CXXFLAGS=`echo $HOST_ICU_CFXXLAGS | sed "s|$_DEPEND_CFLAGS||g"`
# ICU requires RTTI
if test "$GNU_CC"; then
HOST_ICU_CXXFLAGS=`echo $HOST_ICU_CXXFLAGS | sed 's|-fno-rtti|-frtti|g'`
elif test "$_MSC_VER"; then
HOST_ICU_CXXFLAGS=`echo $HOST_ICU_CXXFLAGS | sed 's|-GR-|-GR|g'`
fi
HOST_ICU_BUILD_OPTS=""
if test -n "$MOZ_DEBUG"; then
HOST_ICU_BUILD_OPTS="$HOST_ICU_BUILD_OPTS --enable-debug"
fi
abs_srcdir=`(cd $srcdir; pwd)`
mkdir -p $_objdir/intl/icu/host
(cd $_objdir/intl/icu/host
MOZ_SUBCONFIGURE_WRAP([.],[
AR="$HOST_AR" RANLIB="$HOST_RANLIB" \
CC="$HOST_CC" CXX="$HOST_CXX" LD="$HOST_LD" \
CFLAGS="$HOST_ICU_CFLAGS $HOST_OPTIMIZE_FLAGS" \
CPPFLAGS="$ICU_CPPFLAGS" \
CXXFLAGS="$HOST_ICU_CXXFLAGS $HOST_OPTIMIZE_FLAGS" \
LDFLAGS="$HOST_LDFLAGS" \
$SHELL $abs_srcdir/intl/icu/source/runConfigureICU \
$HOST_ICU_BUILD_OPTS \
$ICU_TARGET \
dnl Shell quoting is fun.
${ICU_SRCDIR+"$ICU_SRCDIR"} \
--enable-static --disable-shared \
--enable-extras=no --enable-icuio=no --enable-layout=no \
--enable-tests=no --enable-samples=no || exit 1
])
) || exit 1
# generate config/icucross.mk
$GMAKE -C $_objdir/intl/icu/host/ config/icucross.mk
# --with-cross-build requires absolute path
ICU_HOST_PATH=`cd $_objdir/intl/icu/host && pwd`
ICU_CROSS_BUILD_OPT="--with-cross-build=$ICU_HOST_PATH"
ICU_TARGET_OPT="--build=$build --host=$target"
else
# CROSS_COMPILE isn't set build and target are i386 and x86-64.
# So we must set target for --build and --host.
ICU_TARGET_OPT="--build=$target --host=$target"
fi
if test -z "$MOZ_SHARED_ICU"; then
# To reduce library size, use static linking
ICU_LINK_OPTS="--enable-static --disable-shared"
else
ICU_LINK_OPTS="--disable-static --enable-shared"
fi
# Force the ICU static libraries to be position independent code
ICU_CFLAGS="$DSO_PIC_CFLAGS $CFLAGS"
ICU_CXXFLAGS="$DSO_PIC_CFLAGS $CXXFLAGS"
ICU_BUILD_OPTS=""
if test -n "$MOZ_DEBUG" -o "MOZ_DEBUG_SYMBOLS"; then
ICU_CFLAGS="$ICU_CFLAGS $MOZ_DEBUG_FLAGS"
ICU_CXXFLAGS="$ICU_CXXFLAGS $MOZ_DEBUG_FLAGS"
if test -n "$CROSS_COMPILE" -a "$OS_TARGET" = "Darwin" \
-a "$HOST_OS_ARCH" != "Darwin"
then
# Bug 951758: Cross-OSX builds with non-Darwin hosts have issues
# with -g and friends (like -gdwarf and -gfull) because they try
# to run dsymutil
changequote(,)
ICU_CFLAGS=`echo $ICU_CFLAGS | sed 's|-g[^ \t]*||g'`
ICU_CXXFLAGS=`echo $ICU_CXXFLAGS | sed 's|-g[^ \t]*||g'`
changequote([,])
fi
ICU_LDFLAGS="$MOZ_DEBUG_LDFLAGS"
if test -z "$MOZ_DEBUG"; then
# To generate debug symbols, it requires MOZ_DEBUG_FLAGS.
# But, not debug build.
ICU_CFLAGS="$ICU_CFLAGS -UDEBUG -DNDEBUG"
ICU_CXXFLAGS="$ICU_CXXFLAGS -UDEBUG -DNDEBUG"
else
ICU_BUILD_OPTS="$ICU_BUILD_OPTS --enable-debug"
fi
fi
if test -z "$MOZ_OPTIMIZE"; then
ICU_BUILD_OPTS="$ICU_BUILD_OPTS --disable-release"
else
ICU_CFLAGS="$ICU_CFLAGS $MOZ_OPTIMIZE_FLAGS"
ICU_CXXFLAGS="$ICU_CXXFLAGS $MOZ_OPTIMIZE_FLAGS"
fi
if test "$am_cv_langinfo_codeset" = "no"; then
# ex. Android
ICU_CPPFLAGS="$ICU_CPPFLAGS -DU_HAVE_NL_LANGINFO_CODESET=0"
fi
# ICU requires RTTI
if test "$GNU_CC"; then
HOST_ICU_CXXFLAGS=`echo $HOST_ICU_CXXFLAGS | sed 's|-fno-rtti|-frtti|g'`
elif test "$_MSC_VER"; then
HOST_ICU_CXXFLAGS=`echo $HOST_ICU_CXXFLAGS | sed 's|-GR-|-GR|g'`
ICU_CXXFLAGS=`echo $ICU_CXXFLAGS | sed 's|-fno-rtti|-frtti|g'`
else
if test "$_MSC_VER"; then
ICU_CXXFLAGS=`echo $ICU_CXXFLAGS | sed 's|-GR-|-GR|g'`
fi
# Add RTL flags for MSVCRT.DLL
if test -n "$MOZ_DEBUG"; then
ICU_CFLAGS="$ICU_CFLAGS -MDd"
ICU_CXXFLAGS="$ICU_CXXFLAGS -MDd"
else
ICU_CFLAGS="$ICU_CFLAGS -MD"
ICU_CXXFLAGS="$ICU_CXXFLAGS -MD"
fi
# add disable optimize flag for workaround for bug 899948
if test -z "$MOZ_OPTIMIZE"; then
ICU_CFLAGS="$ICU_CFLAGS -Od"
ICU_CXXFLAGS="$ICU_CXXFLAGS -Od"
fi
fi
HOST_ICU_BUILD_OPTS=""
if test -n "$MOZ_DEBUG"; then
HOST_ICU_BUILD_OPTS="$HOST_ICU_BUILD_OPTS --enable-debug"
fi
abs_srcdir=`(cd $srcdir; pwd)`
mkdir -p $_objdir/intl/icu/host
(cd $_objdir/intl/icu/host
# We cannot use AC_OUTPUT_SUBDIRS since ICU tree is out of spidermonkey.
# When using AC_OUTPUT_SUBDIRS, objdir of ICU is out of objdir
# due to relative path.
# If building ICU moves into root of mozilla tree, we can use
# AC_OUTPUT_SUBDIR instead.
mkdir -p $_objdir/intl/icu/target
(cd $_objdir/intl/icu/target
MOZ_SUBCONFIGURE_WRAP([.],[
AR="$HOST_AR" RANLIB="$HOST_RANLIB" \
CC="$HOST_CC" CXX="$HOST_CXX" LD="$HOST_LD" \
CFLAGS="$HOST_ICU_CFLAGS $HOST_OPTIMIZE_FLAGS" \
CPPFLAGS="$ICU_CPPFLAGS" \
CXXFLAGS="$HOST_ICU_CXXFLAGS $HOST_OPTIMIZE_FLAGS" \
LDFLAGS="$HOST_LDFLAGS" \
$SHELL $abs_srcdir/intl/icu/source/runConfigureICU \
$HOST_ICU_BUILD_OPTS \
$ICU_TARGET \
dnl Shell quoting is fun.
${ICU_SRCDIR+"$ICU_SRCDIR"} \
--enable-static --disable-shared \
--enable-extras=no --enable-icuio=no --enable-layout=no \
--enable-tests=no --enable-samples=no || exit 1
])
AR="$AR" CC="$CC" CXX="$CXX" LD="$LD" \
ARFLAGS="$ARFLAGS" \
CPPFLAGS="$ICU_CPPFLAGS $CPPFLAGS" \
CFLAGS="$ICU_CFLAGS" \
CXXFLAGS="$ICU_CXXFLAGS" \
LDFLAGS="$ICU_LDFLAGS $LDFLAGS" \
$SHELL $_topsrcdir/intl/icu/source/configure \
$ICU_BUILD_OPTS \
$ICU_CROSS_BUILD_OPT \
$ICU_LINK_OPTS \
${ICU_SRCDIR+"$ICU_SRCDIR"} \
$ICU_TARGET_OPT \
--disable-extras --disable-icuio --disable-layout \
--disable-tests --disable-samples || exit 1
])
) || exit 1
# generate config/icucross.mk
$GMAKE -C $_objdir/intl/icu/host/ config/icucross.mk
# --with-cross-build requires absolute path
ICU_HOST_PATH=`cd $_objdir/intl/icu/host && pwd`
ICU_CROSS_BUILD_OPT="--with-cross-build=$ICU_HOST_PATH"
ICU_TARGET_OPT="--build=$build --host=$target"
else
# CROSS_COMPILE isn't set build and target are i386 and x86-64.
# So we must set target for --build and --host.
ICU_TARGET_OPT="--build=$target --host=$target"
fi
if test -z "$MOZ_SHARED_ICU"; then
# To reduce library size, use static linking
ICU_LINK_OPTS="--enable-static --disable-shared"
else
ICU_LINK_OPTS="--disable-static --enable-shared"
fi
# Force the ICU static libraries to be position independent code
ICU_CFLAGS="$DSO_PIC_CFLAGS $CFLAGS"
ICU_CXXFLAGS="$DSO_PIC_CFLAGS $CXXFLAGS"
ICU_BUILD_OPTS=""
if test -n "$MOZ_DEBUG" -o "MOZ_DEBUG_SYMBOLS"; then
ICU_CFLAGS="$ICU_CFLAGS $MOZ_DEBUG_FLAGS"
ICU_CXXFLAGS="$ICU_CXXFLAGS $MOZ_DEBUG_FLAGS"
if test -n "$CROSS_COMPILE" -a "$OS_TARGET" = "Darwin" \
-a "$HOST_OS_ARCH" != "Darwin"
then
# Bug 951758: Cross-OSX builds with non-Darwin hosts have issues
# with -g and friends (like -gdwarf and -gfull) because they try
# to run dsymutil
changequote(,)
ICU_CFLAGS=`echo $ICU_CFLAGS | sed 's|-g[^ \t]*||g'`
ICU_CXXFLAGS=`echo $ICU_CXXFLAGS | sed 's|-g[^ \t]*||g'`
changequote([,])
fi
ICU_LDFLAGS="$MOZ_DEBUG_LDFLAGS"
if test -z "$MOZ_DEBUG"; then
# To generate debug symbols, it requires MOZ_DEBUG_FLAGS.
# But, not debug build.
ICU_CFLAGS="$ICU_CFLAGS -UDEBUG -DNDEBUG"
ICU_CXXFLAGS="$ICU_CXXFLAGS -UDEBUG -DNDEBUG"
else
ICU_BUILD_OPTS="$ICU_BUILD_OPTS --enable-debug"
fi
fi
if test -z "$MOZ_OPTIMIZE"; then
ICU_BUILD_OPTS="$ICU_BUILD_OPTS --disable-release"
else
ICU_CFLAGS="$ICU_CFLAGS $MOZ_OPTIMIZE_FLAGS"
ICU_CXXFLAGS="$ICU_CXXFLAGS $MOZ_OPTIMIZE_FLAGS"
fi
if test "$am_cv_langinfo_codeset" = "no"; then
# ex. Android
ICU_CPPFLAGS="$ICU_CPPFLAGS -DU_HAVE_NL_LANGINFO_CODESET=0"
fi
# ICU requires RTTI
if test "$GNU_CC"; then
ICU_CXXFLAGS=`echo $ICU_CXXFLAGS | sed 's|-fno-rtti|-frtti|g'`
else
if test "$_MSC_VER"; then
ICU_CXXFLAGS=`echo $ICU_CXXFLAGS | sed 's|-GR-|-GR|g'`
fi
# Add RTL flags for MSVCRT.DLL
if test -n "$MOZ_DEBUG"; then
ICU_CFLAGS="$ICU_CFLAGS -MDd"
ICU_CXXFLAGS="$ICU_CXXFLAGS -MDd"
else
ICU_CFLAGS="$ICU_CFLAGS -MD"
ICU_CXXFLAGS="$ICU_CXXFLAGS -MD"
fi
# add disable optimize flag for workaround for bug 899948
if test -z "$MOZ_OPTIMIZE"; then
ICU_CFLAGS="$ICU_CFLAGS -Od"
ICU_CXXFLAGS="$ICU_CXXFLAGS -Od"
fi
fi
# We cannot use AC_OUTPUT_SUBDIRS since ICU tree is out of spidermonkey.
# When using AC_OUTPUT_SUBDIRS, objdir of ICU is out of objdir
# due to relative path.
# If building ICU moves into root of mozilla tree, we can use
# AC_OUTPUT_SUBDIR instead.
mkdir -p $_objdir/intl/icu/target
(cd $_objdir/intl/icu/target
MOZ_SUBCONFIGURE_WRAP([.],[
AR="$AR" CC="$CC" CXX="$CXX" LD="$LD" \
ARFLAGS="$ARFLAGS" \
CPPFLAGS="$ICU_CPPFLAGS $CPPFLAGS" \
CFLAGS="$ICU_CFLAGS" \
CXXFLAGS="$ICU_CXXFLAGS" \
LDFLAGS="$ICU_LDFLAGS $LDFLAGS" \
$SHELL $_topsrcdir/intl/icu/source/configure \
$ICU_BUILD_OPTS \
$ICU_CROSS_BUILD_OPT \
$ICU_LINK_OPTS \
${ICU_SRCDIR+"$ICU_SRCDIR"} \
$ICU_TARGET_OPT \
--disable-extras --disable-icuio --disable-layout \
--disable-tests --disable-samples || exit 1
])
) || exit 1
fi
])

6
config/autoconf-js.mk.in Normal file
View File

@ -0,0 +1,6 @@
ifndef INCLUDED_AUTOCONF_MK
INCLUDED_AUTOCONF_MK = 1
include $(DEPTH)/config/emptyvars-js.mk
@ALLSUBSTS@
include $(topsrcdir)/config/baseconfig.mk
endif

View File

@ -0,0 +1 @@
@ALLEMPTYSUBSTS@

View File

@ -1,7 +0,0 @@
# 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/.
add_tier_dir('js', 'js/src', external=True)

View File

@ -43,11 +43,7 @@ OS_CXXFLAGS += $(DEHYDRA_FLAGS)
endif
ifdef ENABLE_CLANG_PLUGIN
ifndef BUILDING_JS
CLANG_PLUGIN := $(DEPTH)/build/clang-plugin/$(DLL_PREFIX)clang-plugin$(DLL_SUFFIX)
else
CLANG_PLUGIN := $(DEPTH)/../../build/clang-plugin/$(DLL_PREFIX)clang-plugin$(DLL_SUFFIX)
endif
OS_CXXFLAGS += -Xclang -load -Xclang $(CLANG_PLUGIN) -Xclang -add-plugin -Xclang moz-check
OS_CFLAGS += -Xclang -load -Xclang $(CLANG_PLUGIN) -Xclang -add-plugin -Xclang moz-check
endif

View File

@ -92,7 +92,6 @@ _topsrcdir=`cd \`dirname $0\`; pwd`
_objdir=`pwd`
dnl TODO Don't exempt L10N builds once bug 842760 is resolved.
if test "$_topsrcdir" = "$_objdir" -a "${with_l10n_base+set}" != set; then
echo " ***"
@ -8707,15 +8706,19 @@ else
_INTL_API=no
fi
MOZ_CONFIG_ICU(/js/src)
MOZ_CONFIG_ICU()
if test -n "$MOZ_NATIVE_ICU"; then
MOZ_JS_STATIC_LIBS="$MOZ_JS_STATIC_LIBS $MOZ_ICU_LIBS"
fi
export WRITE_MOZINFO=1
AC_OUTPUT()
unset WRITE_MOZINFO
MOZ_CREATE_CONFIG_STATUS()
# No need to run subconfigures when building with LIBXUL_SDK_DIR
if test "$COMPILE_ENVIRONMENT" -a -z "$LIBXUL_SDK_DIR"; then
MOZ_SUBCONFIGURE_ICU()
MOZ_SUBCONFIGURE_FFI()
fi
# Hack around an Apple bug that affects the egrep that comes with OS X 10.7.
# "env ARCHPREFERENCE=i386,x86_64 arch egrep" first tries to use the 32-bit
@ -8949,7 +8952,6 @@ if test -z "$MOZ_NATIVE_NSPR"; then
ac_configure_args="$ac_configure_args --with-nspr-cflags='$NSPR_CFLAGS'"
ac_configure_args="$ac_configure_args --with-nspr-libs='$NSPR_LIBS'"
fi
ac_configure_args="$ac_configure_args --with-dist-dir=../../dist"
ac_configure_args="$ac_configure_args --prefix=$dist"
if test "$MOZ_MEMORY"; then
ac_configure_args="$ac_configure_args --enable-jemalloc"
@ -8985,3 +8987,12 @@ AC_OUTPUT_SUBDIRS(js/src)
ac_configure_args="$_SUBDIR_CONFIG_ARGS"
fi # COMPILE_ENVIRONMENT && !LIBXUL_SDK_DIR
export WRITE_MOZINFO=1
dnl we need to run config.status after js/src subconfigure because we're
dnl traversing its moz.build and we need its config.status for that.
dnl However, writing our own config.status needs to happen before
dnl subconfigures because the setup surrounding subconfigures alters
dnl many AC_SUBSTed variables.
MOZ_RUN_CONFIG_STATUS()
unset WRITE_MOZINFO

View File

@ -159,6 +159,7 @@ fi
AC_SUBST(JS_SHARED_LIBRARY)
if test "$JS_STANDALONE" = no; then
autoconfmk=autoconf-js.mk
JS_STANDALONE=
else
JS_STANDALONE=1
@ -167,6 +168,7 @@ fi
AC_SUBST(JS_STANDALONE)
BUILDING_JS=1
AC_SUBST(BUILDING_JS)
AC_SUBST(autoconfmk)
MOZ_ARG_WITH_STRING(gonk,
[ --with-gonk=DIR
@ -3810,6 +3812,7 @@ MOZ_ARG_ENABLE_BOOL(ctypes,
BUILD_CTYPES= )
JS_HAS_CTYPES=$BUILD_CTYPES
AC_SUBST(JS_HAS_CTYPES)
AC_SUBST(BUILD_CTYPES)
if test "$JS_HAS_CTYPES"; then
dnl Error out if we're on MSVC and MASM is unavailable.
if test -n "$_MSC_VER" -a \( "$AS" != "ml.exe" -a "$AS" != "ml64.exe" \); then
@ -4117,8 +4120,12 @@ AC_SUBST(JS_LIBRARY_NAME)
AC_SUBST(JS_CONFIG_MOZ_JS_LIBS)
AC_SUBST(JS_CONFIG_LIBS)
MOZ_SUBCONFIGURE_FFI()
dnl Spit out some output
dnl ========================================================
AC_OUTPUT()
MOZ_CREATE_CONFIG_STATUS()
MOZ_SUBCONFIGURE_FFI()
if test "$JS_STANDALONE"; then
MOZ_RUN_CONFIG_STATUS()
fi

View File

@ -27,6 +27,12 @@ CONFIGURE_SUBST_FILES += [
'js.pc',
]
if not CONFIG['JS_STANDALONE']:
CONFIGURE_SUBST_FILES += [
'../../config/autoconf-js.mk',
'../../config/emptyvars-js.mk',
]
CONFIGURE_DEFINE_FILES += [
'js-config.h',
]

View File

@ -9,28 +9,22 @@ 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:
if CONFIG['ENABLE_CLANG_PLUGIN']:
add_tier_dir('base', 'build/clang-plugin', external=True)
add_tier_dir('base', ['config', 'python'])
if not CONFIG['JS_STANDALONE']:
CONFIGURE_SUBST_FILES += [
'mozilla-config.h',
'tools/update-packaging/Makefile',
]
if CONFIG['ENABLE_CLANG_PLUGIN']:
add_tier_dir('base', 'build/clang-plugin', external=True)
add_tier_dir('base', ['build', 'probes'])
add_tier_dir('base', ['config', 'build', 'probes', 'python'])
if not CONFIG['LIBXUL_SDK']:
add_tier_dir('base', ['mfbt'])
if not CONFIG['LIBXUL_SDK']:
add_tier_dir('base', ['mfbt'])
if not CONFIG['JS_STANDALONE']:
if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('android', 'gonk'):
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk' and CONFIG['ANDROID_VERSION'] <= '18':
add_tier_dir('base', ['other-licenses/android'])
@ -43,7 +37,25 @@ else:
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 not CONFIG['MOZ_NATIVE_NSPR']:
add_tier_dir('nspr', 'config/nspr')
add_tier_dir('external', 'config/external')
if not CONFIG['MOZ_NATIVE_NSS']:
add_tier_dir('nss', 'security/build')
if CONFIG['COMPILE_ENVIRONMENT'] and not CONFIG['LIBXUL_SDK']:
if CONFIG['BUILD_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'])
if not CONFIG['JS_STANDALONE']:
# Bring in the configuration for the configured application.
include('/' + CONFIG['MOZ_BUILD_APP'] + '/app.mozbuild')

View File

@ -1107,13 +1107,15 @@ class RecursiveMakeBackend(CommonBackend):
with self._get_preprocessor(obj) as pp:
if extra:
pp.context.update(extra)
if not pp.context.get('autoconfmk', ''):
pp.context['autoconfmk'] = 'autoconf.mk'
pp.handleLine(b'# THIS FILE WAS AUTOMATICALLY GENERATED. DO NOT MODIFY BY HAND.\n');
pp.handleLine(b'DEPTH := @DEPTH@\n')
pp.handleLine(b'topsrcdir := @top_srcdir@\n')
pp.handleLine(b'srcdir := @srcdir@\n')
pp.handleLine(b'VPATH := @srcdir@\n')
pp.handleLine(b'relativesrcdir := @relativesrcdir@\n')
pp.handleLine(b'include $(DEPTH)/config/autoconf.mk\n')
pp.handleLine(b'include $(DEPTH)/config/@autoconfmk@\n')
if not stub:
pp.do_include(obj.input_path)
# Empty line to avoid failures when last line in Makefile.in ends

View File

@ -169,6 +169,13 @@ class MozbuildSandbox(Sandbox):
relpath = mozpath.relpath(path, topsrcdir)
reldir = mozpath.dirname(relpath)
if mozpath.dirname(relpath) == 'js/src' and \
not config.substs.get('JS_STANDALONE'):
config = ConfigEnvironment.from_config_status(
mozpath.join(topobjdir, reldir, 'config.status'))
config.topobjdir = topobjdir
self.config = config
with self._globals.allow_all_writes() as d:
d['TOPSRCDIR'] = topsrcdir
d['TOPOBJDIR'] = topobjdir

View File

@ -280,7 +280,6 @@ crashtest-ipc-gpu:
jstestbrowser: TESTS_PATH?=test-package-stage/jsreftest/tests/
jstestbrowser:
$(MAKE) -C $(DEPTH)/config
$(MAKE) -C $(DEPTH)/js/src/config
$(MAKE) stage-jstests
$(call RUN_REFTEST,'$(DIST)/$(TESTS_PATH)/jstests.list' --extra-profile-file=$(DIST)/test-package-stage/jsreftest/tests/user.js)
$(CHECK_TEST_ERROR)
@ -461,7 +460,7 @@ stage-xpcshell: make-stage-dir
$(MAKE) -C $(DEPTH)/testing/xpcshell stage-package
stage-jstests: make-stage-dir
$(MAKE) -C $(DEPTH)/js/src/js/src/tests stage-package
$(MAKE) -C $(DEPTH)/js/src/tests stage-package
stage-android: make-stage-dir
ifdef MOZ_ENABLE_SZIP

View File

@ -6,17 +6,6 @@
if CONFIG['LIBXUL_SDK']:
error('toolkit.mozbuild is not compatible with --enable-libxul-sdk=')
if CONFIG['COMPILE_ENVIRONMENT']:
if not CONFIG['MOZ_NATIVE_NSPR']:
add_tier_dir('nspr', 'config/nspr')
add_tier_dir('external', 'config/external')
if not CONFIG['MOZ_NATIVE_NSS']:
add_tier_dir('nss', 'security/build')
include('/config/js/js.mozbuild')
if CONFIG['MOZ_CONTENT_SANDBOX']:
add_tier_dir('sandbox', 'security/sandbox')