From e8d125eaf75a3dfd96d5adeaf131ac218bbac6b0 Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Tue, 16 Apr 2013 08:23:18 +0200 Subject: [PATCH] Bug 861453 - Restore empty substs after bug 857557, but put them in a separate file, unlisted as a dependency for everything. r=gps --- config/autoconf.mk.in | 1 + config/emptyvars.mk.in | 1 + config/moz.build | 1 + js/src/config/autoconf.mk.in | 1 + js/src/config/emptyvars.mk.in | 1 + js/src/configure.in | 2 +- python/mozbuild/mozbuild/backend/configenvironment.py | 6 +++++- .../mozbuild/test/backend/test_configenvironment.py | 9 ++++++--- 8 files changed, 17 insertions(+), 5 deletions(-) create mode 100644 config/emptyvars.mk.in create mode 100644 js/src/config/emptyvars.mk.in diff --git a/config/autoconf.mk.in b/config/autoconf.mk.in index 3a1f0d8f49e..41f7854eeef 100644 --- a/config/autoconf.mk.in +++ b/config/autoconf.mk.in @@ -1,2 +1,3 @@ +include $(DEPTH)/config/emptyvars.mk @ALLSUBSTS@ include $(topsrcdir)/config/baseconfig.mk diff --git a/config/emptyvars.mk.in b/config/emptyvars.mk.in new file mode 100644 index 00000000000..388cf2a3598 --- /dev/null +++ b/config/emptyvars.mk.in @@ -0,0 +1 @@ +@ALLEMPTYSUBSTS@ diff --git a/config/moz.build b/config/moz.build index 8c98eb6c345..422455a9960 100644 --- a/config/moz.build +++ b/config/moz.build @@ -6,6 +6,7 @@ CONFIGURE_SUBST_FILES += [ 'autoconf.mk', + 'emptyvars.mk', 'doxygen.cfg', 'makefiles/test/Makefile', 'tests/makefiles/autodeps/Makefile', diff --git a/js/src/config/autoconf.mk.in b/js/src/config/autoconf.mk.in index 3a1f0d8f49e..41f7854eeef 100644 --- a/js/src/config/autoconf.mk.in +++ b/js/src/config/autoconf.mk.in @@ -1,2 +1,3 @@ +include $(DEPTH)/config/emptyvars.mk @ALLSUBSTS@ include $(topsrcdir)/config/baseconfig.mk diff --git a/js/src/config/emptyvars.mk.in b/js/src/config/emptyvars.mk.in new file mode 100644 index 00000000000..388cf2a3598 --- /dev/null +++ b/js/src/config/emptyvars.mk.in @@ -0,0 +1 @@ +@ALLEMPTYSUBSTS@ diff --git a/js/src/configure.in b/js/src/configure.in index 1e6636dc0fe..3ec29c04489 100644 --- a/js/src/configure.in +++ b/js/src/configure.in @@ -4384,7 +4384,7 @@ AC_SUBST(ac_configure_args) dnl Spit out some output dnl ======================================================== -AC_OUTPUT([js-confdefs.h Makefile config/autoconf.mk]) +AC_OUTPUT([js-confdefs.h Makefile config/autoconf.mk config/emptyvars.mk]) # Produce the js-config script at configure time; see the comments for # 'js-config' in Makefile.in. diff --git a/python/mozbuild/mozbuild/backend/configenvironment.py b/python/mozbuild/mozbuild/backend/configenvironment.py index 89d8a568429..dc63edcf4ea 100644 --- a/python/mozbuild/mozbuild/backend/configenvironment.py +++ b/python/mozbuild/mozbuild/backend/configenvironment.py @@ -86,13 +86,15 @@ class ConfigEnvironment(object): - ALLDEFINES contains the defines in the form #define NAME VALUE, in sorted order, for use in config files, for an automatic listing of defines. - and another additional subst variable from all the other substs: + and two other additional subst variables from all the other substs: - ALLSUBSTS contains the substs in the form NAME = VALUE, in sorted order, for use in autoconf.mk. It includes ACDEFINES, but doesn't include ALLDEFINES. Only substs with a VALUE are included, such that the resulting file doesn't change when new empty substs are added. This results in less invalidation of build dependencies in the case of autoconf.mk.. + - ALLEMPTYSUBSTS contains the substs with an empty value, in the form + NAME =. ConfigEnvironment expects a "top_srcdir" subst to be set with the top source directory, in msys format on windows. It is used to derive a @@ -113,6 +115,8 @@ class ConfigEnvironment(object): shell_escape(self.defines[name])) for name in global_defines]) self.substs['ALLSUBSTS'] = '\n'.join(sorted(['%s = %s' % (name, self.substs[name]) for name in self.substs if self.substs[name]])) + self.substs['ALLEMPTYSUBSTS'] = '\n'.join(sorted(['%s =' % name + for name in self.substs if not self.substs[name]])) self.substs['ALLDEFINES'] = '\n'.join(sorted(['#define %s %s' % (name, self.defines[name]) for name in global_defines])) diff --git a/python/mozbuild/mozbuild/test/backend/test_configenvironment.py b/python/mozbuild/mozbuild/test/backend/test_configenvironment.py index a93ac9495cc..dd202a3b290 100644 --- a/python/mozbuild/mozbuild/test/backend/test_configenvironment.py +++ b/python/mozbuild/mozbuild/test/backend/test_configenvironment.py @@ -22,14 +22,14 @@ class ConfigEnvironment(ConfigStatus.ConfigEnvironment): class TestEnvironment(unittest.TestCase): def test_auto_substs(self): - '''Test the automatically set values of ACDEFINES, ALLDEFINES - and ALLSUBSTS. + '''Test the automatically set values of ACDEFINES, ALLDEFINES, + ALLSUBSTS and ALLEMPTYSUBSTS. ''' env = ConfigEnvironment('.', '.', defines = [ ('foo', 'bar'), ('baz', 'qux 42'), ('abc', 'def'), ('extra', 'foobar') ], non_global_defines = ['extra', 'ignore'], - substs = [ ('FOO', 'bar'), ('ABC', 'def'), + substs = [ ('FOO', 'bar'), ('FOOBAR', ''), ('ABC', 'def'), ('bar', 'baz qux'), ('zzz', '"abc def"'), ('qux', '') ]) # non_global_defines should be filtered out in ACDEFINES and @@ -47,6 +47,9 @@ ACDEFINES = -Dfoo=bar -Dbaz=qux\ 42 -Dabc=def FOO = bar bar = baz qux zzz = "abc def"''') + # ALLEMPTYSUBSTS contains all substs with no value. + self.assertEqual(env.substs['ALLEMPTYSUBSTS'], '''FOOBAR = +qux =''') def test_config_file(self): '''Test the creation of config files.