Bug 1099430, mozilla-central parts: Eliminate the duplication of the build system in comm-central, r=glandium.

See the revisions a few steps prior for more fine-grained information. This just
needs to be relanded because our automation doesn't like non-ASCII commit
messages.

--HG--
extra : amend_source : 0ee4e0da1ea9ada815abfe989c51030db24aac56
This commit is contained in:
Joshua Cranmer 2014-11-29 19:45:31 -06:00
parent 9edb638106
commit 4a4c68428e
7 changed files with 52 additions and 36 deletions

View File

@ -131,3 +131,10 @@ $(foreach var,$(_MOZBUILD_EXTERNAL_VARIABLES) $(_DEPRECATED_VARIABLES),$(eval $(
TIERS := export $(if $(COMPILE_ENVIRONMENT),compile )misc libs tools
endif
# These defines are used to support the twin-topsrcdir model for comm-central.
ifdef MOZILLA_SRCDIR
MOZILLA_DIR = $(MOZILLA_SRCDIR)
else
MOZILLA_DIR = $(topsrcdir)
endif

View File

@ -94,7 +94,7 @@ check-variable = $(if $(filter-out 0 1,$(words $($(x))z)),$(error Spaces are not
$(foreach x,$(CHECK_VARS),$(check-variable))
ifndef INCLUDED_FUNCTIONS_MK
include $(topsrcdir)/config/makefiles/functions.mk
include $(MOZILLA_DIR)/config/makefiles/functions.mk
endif
RM = rm -f
@ -122,15 +122,23 @@ endif
VERSION_NUMBER = 50
ifeq ($(HOST_OS_ARCH),WINNT)
win_srcdir := $(subst $(topsrcdir),$(WIN_TOP_SRC),$(srcdir))
BUILD_TOOLS = $(WIN_TOP_SRC)/build/unix
ifeq ($(MOZILLA_DIR),$(topsrcdir))
win_srcdir := $(subst $(topsrcdir),$(WIN_TOP_SRC),$(srcdir))
else
# This means we're in comm-central's topsrcdir, so we need to adjust
# WIN_TOP_SRC (which points to mozilla's topsrcdir) for the substitution
# to win_srcdir.
cc_WIN_TOP_SRC := $(WIN_TOP_SRC:%/mozilla=%)
win_srcdir := $(subst $(topsrcdir),$(cc_WIN_TOP_SRC),$(srcdir))
endif
BUILD_TOOLS = $(WIN_TOP_SRC)/build/unix
else
win_srcdir := $(srcdir)
BUILD_TOOLS = $(topsrcdir)/build/unix
win_srcdir := $(srcdir)
BUILD_TOOLS = $(MOZILLA_DIR)/build/unix
endif
CONFIG_TOOLS = $(MOZ_BUILD_ROOT)/config
AUTOCONF_TOOLS = $(topsrcdir)/build/autoconf
AUTOCONF_TOOLS = $(MOZILLA_DIR)/build/autoconf
#
# Strip off the excessively long version numbers on these platforms,
@ -329,7 +337,7 @@ OS_INCLUDES := \
$(NULL)
endif
include $(topsrcdir)/config/static-checking-config.mk
include $(MOZILLA_DIR)/config/static-checking-config.mk
CFLAGS = $(OS_CPPFLAGS) $(OS_CFLAGS)
CXXFLAGS = $(OS_CPPFLAGS) $(OS_CXXFLAGS)
@ -520,7 +528,7 @@ endif
PWD := $(CURDIR)
endif
NSINSTALL_PY := $(PYTHON) $(abspath $(topsrcdir)/config/nsinstall.py)
NSINSTALL_PY := $(PYTHON) $(abspath $(MOZILLA_DIR)/config/nsinstall.py)
# For Pymake, wherever we use nsinstall.py we're also going to try to make it
# a native command where possible. Since native commands can't be used outside
# of single-line commands, we continue to provide INSTALL for general use.
@ -621,13 +629,13 @@ ifdef MOZ_DEBUG
JAVAC_FLAGS += -g
endif
CREATE_PRECOMPLETE_CMD = $(PYTHON) $(abspath $(topsrcdir)/config/createprecomplete.py)
CREATE_PRECOMPLETE_CMD = $(PYTHON) $(abspath $(MOZILLA_DIR)/config/createprecomplete.py)
# MDDEPDIR is the subdirectory where dependency files are stored
MDDEPDIR := .deps
EXPAND_LIBS_EXEC = $(PYTHON) $(topsrcdir)/config/expandlibs_exec.py
EXPAND_LIBS_GEN = $(PYTHON) $(topsrcdir)/config/expandlibs_gen.py
EXPAND_LIBS_EXEC = $(PYTHON) $(MOZILLA_DIR)/config/expandlibs_exec.py
EXPAND_LIBS_GEN = $(PYTHON) $(MOZILLA_DIR)/config/expandlibs_gen.py
EXPAND_AR = $(EXPAND_LIBS_EXEC) --extract -- $(AR)
EXPAND_CC = $(EXPAND_LIBS_EXEC) --uselist -- $(CC)
EXPAND_CCC = $(EXPAND_LIBS_EXEC) --uselist -- $(CCC)
@ -681,7 +689,7 @@ endif
endif
endif
PLY_INCLUDE = -I$(topsrcdir)/other-licenses/ply
PLY_INCLUDE = -I$(MOZILLA_DIR)/other-licenses/ply
export CL_INCLUDES_PREFIX
# Make sure that the build system can handle non-ASCII characters

View File

@ -107,7 +107,11 @@ endif #}
###########################################################################
## Common makefile library loader
###########################################################################
topORerr =$(if $(topsrcdir),$(topsrcdir),$(error topsrcdir is not defined))
ifdef MOZILLA_DIR
topORerr = $(MOZILLA_DIR)
else
topORerr = $(if $(topsrcdir),$(topsrcdir),$(error topsrcdir is not defined))
endif
ifdef USE_AUTOTARGETS_MK # mkdir_deps
include $(topORerr)/config/makefiles/autotargets.mk

View File

@ -20,20 +20,16 @@ INCLUDED_RULES_MK = 1
# overwritten after including config.mk.
_eval_for_side_effects := $(CHECK_MOZBUILD_VARIABLES)
ifndef MOZILLA_DIR
MOZILLA_DIR = $(topsrcdir)
endif
ifndef INCLUDED_CONFIG_MK
include $(topsrcdir)/config/config.mk
endif
ifndef INCLUDED_VERSION_MK
include $(topsrcdir)/config/version.mk
include $(MOZILLA_DIR)/config/version.mk
endif
USE_AUTOTARGETS_MK = 1
include $(topsrcdir)/config/makefiles/makeutils.mk
include $(MOZILLA_DIR)/config/makefiles/makeutils.mk
ifdef REBUILD_CHECK
REPORT_BUILD = $(info $(shell $(PYTHON) $(MOZILLA_DIR)/config/rebuild_check.py $@ $^))
@ -91,12 +87,12 @@ INSTALL_TARGETS += CPP_UNIT_TESTS
endif
run-cppunittests::
@$(PYTHON) $(topsrcdir)/testing/runcppunittests.py --xre-path=$(DIST)/bin --symbols-path=$(DIST)/crashreporter-symbols $(CPP_UNIT_TESTS)
@$(PYTHON) $(MOZILLA_DIR)/testing/runcppunittests.py --xre-path=$(DIST)/bin --symbols-path=$(DIST)/crashreporter-symbols $(CPP_UNIT_TESTS)
cppunittests-remote: DM_TRANS?=adb
cppunittests-remote:
@if [ '${TEST_DEVICE}' != '' -o '$(DM_TRANS)' = 'adb' ]; then \
$(PYTHON) -u $(topsrcdir)/testing/remotecppunittests.py \
$(PYTHON) -u $(MOZILLA_DIR)/testing/remotecppunittests.py \
--xre-path=$(DEPTH)/dist/bin \
--localLib=$(DEPTH)/dist/$(MOZ_APP_NAME) \
--dm_trans=$(DM_TRANS) \
@ -224,7 +220,7 @@ endif # WINNT
ifeq ($(SOLARIS_SUNPRO_CXX),1)
ifeq (86,$(findstring 86,$(OS_TEST)))
OS_LDFLAGS += -M $(topsrcdir)/config/solaris_ia32.map
OS_LDFLAGS += -M $(MOZILLA_DIR)/config/solaris_ia32.map
endif # x86
endif # Solaris Sun Studio C++
@ -561,7 +557,7 @@ STATIC_LIB_DEP = $(if $(wildcard $(1).$(LIBS_DESC_SUFFIX)),$(1).$(LIBS_DESC_SUFF
STATIC_LIBS_DEPS := $(foreach l,$(STATIC_LIBS),$(call STATIC_LIB_DEP,$(l)))
# Dependencies which, if modified, should cause everything to rebuild
GLOBAL_DEPS += Makefile $(addprefix $(DEPTH)/config/,$(INCLUDED_AUTOCONF_MK)) $(topsrcdir)/config/config.mk
GLOBAL_DEPS += Makefile $(addprefix $(DEPTH)/config/,$(INCLUDED_AUTOCONF_MK)) $(MOZILLA_DIR)/config/config.mk
##############################################
ifdef COMPILE_ENVIRONMENT
@ -573,7 +569,7 @@ host:: $(HOST_LIBRARY) $(HOST_PROGRAM) $(HOST_SIMPLE_PROGRAMS)
target:: $(LIBRARY) $(SHARED_LIBRARY) $(PROGRAM) $(SIMPLE_PROGRAMS)
include $(topsrcdir)/config/makefiles/target_binaries.mk
include $(MOZILLA_DIR)/config/makefiles/target_binaries.mk
endif
##############################################
@ -598,11 +594,11 @@ endif
ifneq (,$(SHARED_LIBRARY)$(PROGRAM))
export::
ifdef PROGRAM
$(PYTHON) $(topsrcdir)/build/win32/pgomerge.py \
$(PYTHON) $(MOZILLA_DIR)/build/win32/pgomerge.py \
$(PROGRAM:$(BIN_SUFFIX)=) $(DIST)/bin
endif
ifdef SHARED_LIBRARY
$(PYTHON) $(topsrcdir)/build/win32/pgomerge.py \
$(PYTHON) $(MOZILLA_DIR)/build/win32/pgomerge.py \
$(patsubst $(DLL_PREFIX)%$(DLL_SUFFIX),%,$(SHARED_LIBRARY)) $(DIST)/bin
endif
endif # SHARED_LIBRARY || PROGRAM
@ -856,14 +852,14 @@ define MAKE_DEPS_AUTO_CC
if test -d $(@D); then \
echo 'Building deps for $< using Sun Studio cc'; \
$(CC) $(COMPILE_CFLAGS) -xM $< >$(_MDDEPFILE) ; \
$(PYTHON) $(topsrcdir)/build/unix/add_phony_targets.py $(_MDDEPFILE) ; \
$(PYTHON) $(MOZILLA_DIR)/build/unix/add_phony_targets.py $(_MDDEPFILE) ; \
fi
endef
define MAKE_DEPS_AUTO_CXX
if test -d $(@D); then \
echo 'Building deps for $< using Sun Studio CC'; \
$(CXX) $(COMPILE_CXXFLAGS) -xM $< >$(_MDDEPFILE) ; \
$(PYTHON) $(topsrcdir)/build/unix/add_phony_targets.py $(_MDDEPFILE) ; \
$(PYTHON) $(MOZILLA_DIR)/build/unix/add_phony_targets.py $(_MDDEPFILE) ; \
fi
endef
endif # Sun Studio on Solaris
@ -1101,7 +1097,7 @@ endif
# Java rules
###############################################################################
ifneq (,$(JAVAFILES)$(ANDROID_RESFILES)$(ANDROID_APKNAME)$(JAVA_JAR_TARGETS))
include $(topsrcdir)/config/makefiles/java-build.mk
include $(MOZILLA_DIR)/config/makefiles/java-build.mk
endif
###############################################################################
@ -1547,7 +1543,7 @@ endif
# Pull in non-recursive targets if this is a partial tree build.
ifndef TOPLEVEL_BUILD
include $(topsrcdir)/config/makefiles/nonrecursive.mk
include $(MOZILLA_DIR)/config/makefiles/nonrecursive.mk
endif
################################################################################
@ -1582,7 +1578,7 @@ TAGS: $(CSRCS) $(CPPSRCS) $(wildcard *.h)
ifndef INCLUDED_DEBUGMAKE_MK #{
## Only parse when an echo* or show* target is requested
ifneq (,$(call isTargetStem,echo,show))
include $(topsrcdir)/config/makefiles/debugmake.mk
include $(MOZILLA_DIR)/config/makefiles/debugmake.mk
endif #}
endif #}
@ -1632,7 +1628,7 @@ $(PURGECACHES_FILES):
#############################################################################
# Derived targets and dependencies
include $(topsrcdir)/config/makefiles/autotargets.mk
include $(MOZILLA_DIR)/config/makefiles/autotargets.mk
ifneq ($(NULL),$(AUTO_DEPS))
default all libs tools export:: $(AUTO_DEPS)
endif

View File

@ -43,6 +43,7 @@ MKDIR ?= mkdir -p
TOUCH ?= touch
INCLUDED_CONFIG_MK = 1
MOZILLA_DIR := $(topsrcdir)
include $(topsrcdir)/config/rules.mk
##-------------------##

View File

@ -15,7 +15,7 @@ ifeq ($(MOZ_WIDGET_TOOLKIT),windows)
ifndef RESFILE
RCFILE=./module.rc
RESFILE=./module.res
_RC_STRING = -QUIET 1 -DEPTH $(DEPTH) -TOPSRCDIR $(topsrcdir) -OBJDIR . -SRCDIR $(srcdir) -DISPNAME $(MOZ_APP_DISPLAYNAME) -APPVERSION $(MOZ_APP_VERSION)
_RC_STRING = -QUIET 1 -DEPTH $(DEPTH) -TOPSRCDIR $(MOZILLA_DIR) -OBJDIR . -SRCDIR $(srcdir) -DISPNAME $(MOZ_APP_DISPLAYNAME) -APPVERSION $(MOZ_APP_VERSION)
ifdef MOZILLA_OFFICIAL
_RC_STRING += -OFFICIAL 1
endif
@ -42,8 +42,8 @@ GARBAGE += $(RESFILE) $(RCFILE)
#dummy target so $(RCFILE) doesn't become the default =P
all::
$(RCFILE): $(RCINCLUDE) $(topsrcdir)/config/version_win.pl
$(PERL) $(topsrcdir)/config/version_win.pl $(_RC_STRING)
$(RCFILE): $(RCINCLUDE) $(MOZILLA_DIR)/config/version_win.pl
$(PERL) $(MOZILLA_DIR)/config/version_win.pl $(_RC_STRING)
endif # RESFILE
endif # Windows

View File

@ -139,7 +139,7 @@ endif
ifndef INCLUDED_RCS_MK
USE_RCS_MK := 1
include $(topsrcdir)/config/makefiles/makeutils.mk
include $(MOZILLA_DIR)/config/makefiles/makeutils.mk
endif
MOZ_SOURCE_STAMP = $(firstword $(shell hg -R $(MOZILLA_DIR) parent --template="{node|short}\n" 2>/dev/null))