Bug 1254884 - Make JSON serialization to config.status more readable as python
--- a/configure.py
+++ b/configure.py
@@ -42,16 +42,20 @@ def config_status(config):
# Create config.status. Eventually, we'll want to just do the work it does
# here, when we're able to skip configure tests/use cached results/not rely
# on autoconf.
print("Creating config.status", file=sys.stderr)
encoding = 'mbcs' if sys.platform == 'win32' else 'utf-8'
with codecs.open('config.status', 'w', encoding) as fh:
fh.write('#!%s\n' % config['PYTHON'])
fh.write('# coding=%s\n' % encoding)
+ # Because we're serializing as JSON but reading as python, the values
+ # for True, False and None are true, false and null, which don't exist.
+ # Define them.
+ fh.write('true, false, null = True, False, None\n')
for k, v in sanitized_config.iteritems():
fh.write('%s = ' % k)
json.dump(v, fh, sort_keys=True, indent=4, ensure_ascii=False)
fh.write('\n')
fh.write("__all__ = ['topobjdir', 'topsrcdir', 'defines', "
"'non_global_defines', 'substs']")
if not config.get('BUILDING_JS') or config.get('JS_STANDALONE'):