Bug 1246871 - Generate platform.ini with the preprocessor instead of an ad-hoc script. r=mshal

This commit is contained in:
Mike Hommey 2016-02-09 15:16:25 +09:00
parent bbdff60430
commit 26cdd33c00
4 changed files with 22 additions and 29 deletions

View File

@ -37,11 +37,6 @@
# Targets to be triggered for a default build # Targets to be triggered for a default build
default: $(addprefix install-,$(INSTALL_MANIFESTS)) default: $(addprefix install-,$(INSTALL_MANIFESTS))
# Explicit files to be built for a default build
ifndef TEST_MOZBUILD
default: $(TOPOBJDIR)/dist/bin/platform.ini
endif
ifndef NO_XPIDL ifndef NO_XPIDL
# Targets from the recursive make backend to be built for a default build # Targets from the recursive make backend to be built for a default build
default: $(TOPOBJDIR)/config/makefiles/xpidl/xpidl default: $(TOPOBJDIR)/config/makefiles/xpidl/xpidl
@ -72,13 +67,6 @@ ACDEFINES += -DBUILD_FASTER
# fallback # fallback
$(TOPOBJDIR)/faster/%: ; $(TOPOBJDIR)/faster/%: ;
# And files under dist/ are meant to be copied from their first dependency
# if there is no other rule.
$(TOPOBJDIR)/dist/%:
rm -f $@
mkdir -p $(@D)
cp $< $@
# Generic rule to fall back to the recursive make backend. # Generic rule to fall back to the recursive make backend.
# This needs to stay after other $(TOPOBJDIR)/* rules because GNU Make # This needs to stay after other $(TOPOBJDIR)/* rules because GNU Make
# <3.82 apply pattern rules in definition order, not stem length like # <3.82 apply pattern rules in definition order, not stem length like
@ -111,11 +99,6 @@ $(addprefix install-,$(INSTALL_MANIFESTS)): install-%: $(TOPOBJDIR)/config/build
# Below is a set of additional dependencies and variables used to build things # Below is a set of additional dependencies and variables used to build things
# that are not supported by data in moz.build. # that are not supported by data in moz.build.
# Files to build with the recursive backend and simply copy
$(TOPOBJDIR)/dist/bin/platform.ini: $(TOPOBJDIR)/toolkit/xre/platform.ini
$(TOPOBJDIR)/toolkit/xre/platform.ini: $(TOPOBJDIR)/config/buildid
# The xpidl target in config/makefiles/xpidl requires the install manifest for # The xpidl target in config/makefiles/xpidl requires the install manifest for
# dist/idl to have been processed. When using the hybrid # dist/idl to have been processed. When using the hybrid
# FasterMake/RecursiveMake backend, this dependency is handled in the top-level # FasterMake/RecursiveMake backend, this dependency is handled in the top-level

View File

@ -13,16 +13,16 @@ milestone_txt = $(topsrcdir)/config/milestone.txt
include $(topsrcdir)/config/rules.mk include $(topsrcdir)/config/rules.mk
MOZ_SOURCE_STAMP ?= $(firstword $(shell hg -R $(topsrcdir) parent --template='{node}\n' 2>/dev/null)) MOZ_SOURCE_STAMP ?= $(firstword $(shell hg -R $(topsrcdir) parent --template='{node}\n' 2>/dev/null))
ifdef MOZ_SOURCE_STAMP ifneq (,$(strip $(MOZ_SOURCE_STAMP)))
INIARGS = --sourcestamp=$(MOZ_SOURCE_STAMP) DEFINES += -DMOZ_SOURCE_STAMP=$(MOZ_SOURCE_STAMP)
ifdef MOZ_INCLUDE_SOURCE_INFO ifdef MOZ_INCLUDE_SOURCE_INFO
source_repo := $(call getSourceRepo) source_repo := $(call getSourceRepo)
# extra sanity check for old versions of hg, no showconfig support # extra sanity check for old versions of hg, no showconfig support
ifneq (,$(filter http%,$(source_repo))) ifneq (,$(filter http%,$(source_repo)))
INIARGS += --sourcerepo=$(source_repo) DEFINES += -DMOZ_SOURCE_REPO=$(source_repo)
endif endif
endif endif
@ -34,12 +34,3 @@ $(call errorIfEmpty,GRE_MILESTONE MOZ_BUILDID)
DEFINES += -DMOZ_BUILDID=$(MOZ_BUILDID) DEFINES += -DMOZ_BUILDID=$(MOZ_BUILDID)
$(srcdir)/nsAppRunner.cpp: $(DEPTH)/config/buildid $(milestone_txt) $(srcdir)/nsAppRunner.cpp: $(DEPTH)/config/buildid $(milestone_txt)
platform.ini: FORCE
$(PYTHON) $(srcdir)/make-platformini.py --buildid=$(MOZ_BUILDID) $(INIARGS) $(milestone_txt) > $@
GARBAGE += platform.ini
# Moving this out of libs breaks packaging.
libs:: platform.ini
$(INSTALL) $^ $(DIST)/bin

View File

@ -179,3 +179,7 @@ CXXFLAGS += CONFIG['MOZ_DBUS_GLIB_CFLAGS']
if CONFIG['MOZ_WIDGET_GTK']: if CONFIG['MOZ_WIDGET_GTK']:
CXXFLAGS += CONFIG['MOZ_PANGO_CFLAGS'] CXXFLAGS += CONFIG['MOZ_PANGO_CFLAGS']
FINAL_TARGET_PP_FILES += [
'platform.ini'
]

15
toolkit/xre/platform.ini Normal file
View File

@ -0,0 +1,15 @@
#if 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/.
#endif
#filter substitution
[Build]
BuildID=@MOZ_BUILDID@
Milestone=@GRE_MILESTONE@
#ifdef MOZ_SOURCE_REPO
SourceRepository=@MOZ_SOURCE_REPO@
#endif
#ifdef MOZ_SOURCE_STAMP
SourceStamp=@MOZ_SOURCE_STAMP@
#endif