bug 465988 - Port
bug 462451,
bug 464379,
bug 464127 to comm-central, r=Standard8
--- a/client.mk
+++ b/client.mk
@@ -257,17 +257,16 @@ EXTRA_CONFIG_DEPS := \
cd $(@D); $(AUTOCONF)
CONFIG_STATUS_DEPS := \
$(wildcard $(CONFIGURES)) \
$(TOPSRCDIR)/allmakefiles.sh \
$(TOPSRCDIR)/.mozconfig.mk \
$(TOPSRCDIR)/mozilla/allmakefiles.sh \
$(wildcard $(TOPSRCDIR)/mozilla/nsprpub/configure) \
- $(wildcard $(TOPSRCDIR)/mozilla/js/src/configure) \
$(wildcard $(TOPSRCDIR)/mozilla/config/milestone.txt) \
$(wildcard $(TOPSRCDIR)/directory/c-sdk/configure) \
$(wildcard $(addsuffix confvars.sh,$(wildcard $(TOPSRCDIR)/*/))) \
$(NULL)
# configure uses the program name to determine @srcdir@. Calling it without
# $(TOPSRCDIR) will set @srcdir@ to "."; otherwise, it is set to the full
# path of $(TOPSRCDIR).
--- a/config/rules.mk
+++ b/config/rules.mk
@@ -389,18 +389,20 @@ ifndef PROGOBJS
PROGOBJS = $(OBJS)
endif
ifndef HOST_PROGOBJS
HOST_PROGOBJS = $(HOST_OBJS)
endif
# MAKE_DIRS: List of directories to build while looping over directories.
-ifneq (,$(OBJS)$(XPIDLSRCS)$(SDK_XPIDLSRCS)$(SIMPLE_PROGRAMS))
-MAKE_DIRS += $(MDDEPDIR)
+# A Makefile that needs $(MDDEPDIR) created but doesn't set any of these
+# variables we know to check can just set NEED_MDDEPDIR explicitly.
+ifneq (,$(OBJS)$(XPIDLSRCS)$(SDK_XPIDLSRCS)$(SIMPLE_PROGRAMS)$(NEED_MDDEPDIR))
+MAKE_DIRS += $(CURDIR)/$(MDDEPDIR)
GARBAGE_DIRS += $(MDDEPDIR)
endif
#
# Tags: emacs (etags), vi (ctags)
# TAG_PROGRAM := ctags -L -
#
TAG_PROGRAM = xargs etags -a
@@ -1918,17 +1920,23 @@ endif # COMPILER_DEPEND
#############################################################################
# MDDEPDIR is the subdirectory where all the dependency files are placed.
# This uses a make rule (instead of a macro) to support parallel
# builds (-jN). If this were done in the LOOP_OVER_DIRS macro, two
# processes could simultaneously try to create the same directory.
#
-$(MDDEPDIR):
+# We use $(CURDIR) in the rule's target to ensure that we don't find
+# a dependency directory in the source tree via VPATH (perhaps from
+# a previous build in the source tree) and thus neglect to create a
+# dependency directory in the object directory, where we really need
+# it.
+
+$(CURDIR)/$(MDDEPDIR):
@if test ! -d $@; then echo Creating $@; rm -rf $@; mkdir $@; else true; fi
ifneq (,$(filter-out all chrome default export realchrome tools clean clobber clobber_all distclean realclean,$(MAKECMDGOALS)))
ifneq (,$(OBJS)$(XPIDLSRCS)$(SDK_XPIDLSRCS)$(SIMPLE_PROGRAMS))
MDDEPEND_FILES := $(strip $(wildcard $(MDDEPDIR)/*.pp))
ifneq (,$(MDDEPEND_FILES))
ifdef PERL
--- a/configure.in
+++ b/configure.in
@@ -687,17 +687,16 @@ if test "$_perl_res" != 0; then
else
AC_MSG_RESULT([yes])
fi
AC_PATH_PROGS(PYTHON, $PYTHON python)
if test -z "$PYTHON"; then
AC_MSG_ERROR([python was not found in \$PATH])
fi
-echo PYTHON="$PYTHON"
AC_PATH_PROGS(NSINSTALL_BIN, nsinstall )
if test -z "$COMPILE_ENVIRONMENT"; then
if test -z "$NSINSTALL_BIN" || test "$NSINSTALL_BIN" = ":"; then
NSINSTALL_BIN='$(PYTHON) $(MOZILLA_SRCDIR)/config/nsinstall.py'
fi
fi
AC_SUBST(NSINSTALL_BIN)
@@ -1833,32 +1832,39 @@ case "$target" in
MOZ_FIX_LINK_PATHS=
fi
if test -z "$GNU_CXX"; then
MIPSPRO_CXX=1
fi
;;
*-*linux*)
- if test "$GNU_CC"; then
+ # Note: both GNU_CC and INTEL_CC are set when using Intel's C compiler.
+ # Similarly for GNU_CXX and INTEL_CXX.
+ if test "$INTEL_CC" || test "$INTEL_CXX"; then
+ # -Os has been broken on Intel's C/C++ compilers for quite a
+ # while; Intel recommends against using it.
+ MOZ_OPTIMIZE_FLAGS="-O2"
+ MOZ_DEBUG_FLAGS="-g -fno-inline"
+ elif test "$GNU_CC" || test "$GNU_CXX"; then
GCC_VERSION=`$CC -v 2>&1 | awk '/^gcc version/ { print $3 }'`
case $GCC_VERSION in
4.1.*|4.2.*)
# -Os is broken on gcc 4.1.x and 4.2.x, we need to tweak it to get good results.
MOZ_OPTIMIZE_SIZE_TWEAK="-finline-limit=50"
esac
+ MOZ_OPTIMIZE_FLAGS="-Os -freorder-blocks -fno-reorder-functions $MOZ_OPTIMIZE_SIZE_TWEAK"
+ MOZ_DEBUG_FLAGS="-g -fno-inline" # most people on linux use gcc/gdb,
+ # and that combo is not yet good at
+ # debugging inlined functions (even
+ # when using DWARF2 as the debugging
+ # format)
fi
TARGET_NSPR_MDCPUCFG='\"md/_linux.cfg\"'
- MOZ_OPTIMIZE_FLAGS="-Os -freorder-blocks -fno-reorder-functions $MOZ_OPTIMIZE_SIZE_TWEAK"
- MOZ_DEBUG_FLAGS="-g -fno-inline" # most people on linux use gcc/gdb,
- # and that combo is not yet good at
- # debugging inlined functions (even
- # when using DWARF2 as the debugging
- # format)
MOZ_MEMORY=1
case "${target_cpu}" in
alpha*)
CFLAGS="$CFLAGS -mieee"
CXXFLAGS="$CXXFLAGS -mieee"
;;