зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1317778 - Emit a depfile with python configure dependencies so Make will know when to re-run configure. r=glandium
MozReview-Commit-ID: AuTHadY7KqO
This commit is contained in:
Родитель
bd0e833124
Коммит
eb8660f21f
|
@ -329,6 +329,10 @@ CONFIG_STATUS_DEPS := \
|
||||||
$(OBJDIR)/.mozconfig.json \
|
$(OBJDIR)/.mozconfig.json \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
|
# Include a dep file emitted by configure to track Python files that
|
||||||
|
# may influence the result of configure.
|
||||||
|
-include $(OBJDIR)/configure.d
|
||||||
|
|
||||||
CONFIGURE_ENV_ARGS += \
|
CONFIGURE_ENV_ARGS += \
|
||||||
MAKE='$(MAKE)' \
|
MAKE='$(MAKE)' \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
17
configure.py
17
configure.py
|
@ -5,6 +5,7 @@
|
||||||
from __future__ import print_function, unicode_literals
|
from __future__ import print_function, unicode_literals
|
||||||
|
|
||||||
import codecs
|
import codecs
|
||||||
|
import itertools
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
@ -14,6 +15,8 @@ import textwrap
|
||||||
base_dir = os.path.abspath(os.path.dirname(__file__))
|
base_dir = os.path.abspath(os.path.dirname(__file__))
|
||||||
sys.path.insert(0, os.path.join(base_dir, 'python', 'mozbuild'))
|
sys.path.insert(0, os.path.join(base_dir, 'python', 'mozbuild'))
|
||||||
from mozbuild.configure import ConfigureSandbox
|
from mozbuild.configure import ConfigureSandbox
|
||||||
|
from mozbuild.makeutil import Makefile
|
||||||
|
from mozbuild.pythonutil import iter_modules_in_path
|
||||||
from mozbuild.util import (
|
from mozbuild.util import (
|
||||||
indented_repr,
|
indented_repr,
|
||||||
encode,
|
encode,
|
||||||
|
@ -46,7 +49,8 @@ def config_status(config):
|
||||||
sanitized_config = {}
|
sanitized_config = {}
|
||||||
sanitized_config['substs'] = {
|
sanitized_config['substs'] = {
|
||||||
k: sanitized_bools(v) for k, v in config.iteritems()
|
k: sanitized_bools(v) for k, v in config.iteritems()
|
||||||
if k not in ('DEFINES', 'non_global_defines', 'TOPSRCDIR', 'TOPOBJDIR')
|
if k not in ('DEFINES', 'non_global_defines', 'TOPSRCDIR', 'TOPOBJDIR',
|
||||||
|
'ALL_CONFIGURE_PATHS')
|
||||||
}
|
}
|
||||||
sanitized_config['defines'] = {
|
sanitized_config['defines'] = {
|
||||||
k: sanitized_bools(v) for k, v in config['DEFINES'].iteritems()
|
k: sanitized_bools(v) for k, v in config['DEFINES'].iteritems()
|
||||||
|
@ -84,6 +88,17 @@ def config_status(config):
|
||||||
config_status(**args)
|
config_status(**args)
|
||||||
'''))
|
'''))
|
||||||
|
|
||||||
|
# Write out a depfile so Make knows to re-run configure when relevant Python
|
||||||
|
# changes.
|
||||||
|
mk = Makefile()
|
||||||
|
rule = mk.create_rule()
|
||||||
|
rule.add_targets(["$(OBJDIR)/config.status"])
|
||||||
|
rule.add_dependencies(itertools.chain(config['ALL_CONFIGURE_PATHS'],
|
||||||
|
iter_modules_in_path(config['TOPOBJDIR'],
|
||||||
|
config['TOPSRCDIR'])))
|
||||||
|
with open('configure.d', 'w') as fh:
|
||||||
|
mk.dump(fh)
|
||||||
|
|
||||||
# Other things than us are going to run this file, so we need to give it
|
# Other things than us are going to run this file, so we need to give it
|
||||||
# executable permissions.
|
# executable permissions.
|
||||||
os.chmod('config.status', 0o755)
|
os.chmod('config.status', 0o755)
|
||||||
|
|
|
@ -338,4 +338,10 @@ def nsis_binary_type(nsis):
|
||||||
|
|
||||||
# Fallthrough to autoconf-based configure
|
# Fallthrough to autoconf-based configure
|
||||||
include('build/moz.configure/old.configure')
|
include('build/moz.configure/old.configure')
|
||||||
# Please do not add anything after the include of old.configure.
|
|
||||||
|
@imports('__sandbox__')
|
||||||
|
def all_paths():
|
||||||
|
return __sandbox__._all_paths
|
||||||
|
|
||||||
|
set_config('ALL_CONFIGURE_PATHS', all_paths())
|
||||||
|
# Please do not add anything after setting ALL_CONFIGURE_PATHS.
|
||||||
|
|
Загрузка…
Ссылка в новой задаче