Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit b7e1764

Browse files
committed
Bug 861453 - Restore empty substs after bug 857557, but put them in a separate file, unlisted as a dependency for everything. r=gps
1 parent df81c25 commit b7e1764

9 files changed

Lines changed: 18 additions & 5 deletions

File tree

build/macosx/universal/flight.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ OBJDIR = $(OBJDIR_ARCH_1)
1616
endif
1717

1818
topsrcdir = $(TOPSRCDIR)
19+
DEPTH = $(OBJDIR)
1920
include $(OBJDIR)/config/autoconf.mk
2021

2122
core_abspath = $(if $(filter /%,$(1)),$(1),$(CURDIR)/$(1))

config/autoconf.mk.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
include $(DEPTH)/config/emptyvars.mk
12
@ALLSUBSTS@
23
include $(topsrcdir)/config/baseconfig.mk

config/emptyvars.mk.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@ALLEMPTYSUBSTS@

config/moz.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
CONFIGURE_SUBST_FILES += [
88
'autoconf.mk',
9+
'emptyvars.mk',
910
'doxygen.cfg',
1011
'makefiles/test/Makefile',
1112
'tests/makefiles/autodeps/Makefile',

js/src/config/autoconf.mk.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
include $(DEPTH)/config/emptyvars.mk
12
@ALLSUBSTS@
23
include $(topsrcdir)/config/baseconfig.mk

js/src/config/emptyvars.mk.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@ALLEMPTYSUBSTS@

js/src/configure.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4384,7 +4384,7 @@ AC_SUBST(ac_configure_args)
43844384
dnl Spit out some output
43854385
dnl ========================================================
43864386

4387-
AC_OUTPUT([js-confdefs.h Makefile config/autoconf.mk])
4387+
AC_OUTPUT([js-confdefs.h Makefile config/autoconf.mk config/emptyvars.mk])
43884388

43894389
# Produce the js-config script at configure time; see the comments for
43904390
# 'js-config' in Makefile.in.

python/mozbuild/mozbuild/backend/configenvironment.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,15 @@ class ConfigEnvironment(object):
8686
- ALLDEFINES contains the defines in the form #define NAME VALUE, in
8787
sorted order, for use in config files, for an automatic listing of
8888
defines.
89-
and another additional subst variable from all the other substs:
89+
and two other additional subst variables from all the other substs:
9090
- ALLSUBSTS contains the substs in the form NAME = VALUE, in sorted
9191
order, for use in autoconf.mk. It includes ACDEFINES, but doesn't
9292
include ALLDEFINES. Only substs with a VALUE are included, such that
9393
the resulting file doesn't change when new empty substs are added.
9494
This results in less invalidation of build dependencies in the case
9595
of autoconf.mk..
96+
- ALLEMPTYSUBSTS contains the substs with an empty value, in the form
97+
NAME =.
9698
9799
ConfigEnvironment expects a "top_srcdir" subst to be set with the top
98100
source directory, in msys format on windows. It is used to derive a
@@ -113,6 +115,8 @@ def __init__(self, topsrcdir, topobjdir, defines=[], non_global_defines=[],
113115
shell_escape(self.defines[name])) for name in global_defines])
114116
self.substs['ALLSUBSTS'] = '\n'.join(sorted(['%s = %s' % (name,
115117
self.substs[name]) for name in self.substs if self.substs[name]]))
118+
self.substs['ALLEMPTYSUBSTS'] = '\n'.join(sorted(['%s =' % name
119+
for name in self.substs if not self.substs[name]]))
116120
self.substs['ALLDEFINES'] = '\n'.join(sorted(['#define %s %s' % (name,
117121
self.defines[name]) for name in global_defines]))
118122

python/mozbuild/mozbuild/test/backend/test_configenvironment.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ def __init__(self, *args, **kwargs):
2222

2323
class TestEnvironment(unittest.TestCase):
2424
def test_auto_substs(self):
25-
'''Test the automatically set values of ACDEFINES, ALLDEFINES
26-
and ALLSUBSTS.
25+
'''Test the automatically set values of ACDEFINES, ALLDEFINES,
26+
ALLSUBSTS and ALLEMPTYSUBSTS.
2727
'''
2828
env = ConfigEnvironment('.', '.',
2929
defines = [ ('foo', 'bar'), ('baz', 'qux 42'),
3030
('abc', 'def'), ('extra', 'foobar') ],
3131
non_global_defines = ['extra', 'ignore'],
32-
substs = [ ('FOO', 'bar'), ('ABC', 'def'),
32+
substs = [ ('FOO', 'bar'), ('FOOBAR', ''), ('ABC', 'def'),
3333
('bar', 'baz qux'), ('zzz', '"abc def"'),
3434
('qux', '') ])
3535
# non_global_defines should be filtered out in ACDEFINES and
@@ -47,6 +47,9 @@ def test_auto_substs(self):
4747
FOO = bar
4848
bar = baz qux
4949
zzz = "abc def"''')
50+
# ALLEMPTYSUBSTS contains all substs with no value.
51+
self.assertEqual(env.substs['ALLEMPTYSUBSTS'], '''FOOBAR =
52+
qux =''')
5053

5154
def test_config_file(self):
5255
'''Test the creation of config files.

0 commit comments

Comments
 (0)