--- a/build/autoconf/config.status.m4
+++ b/build/autoconf/config.status.m4
@@ -141,17 +141,17 @@ for ac_subst_arg in $_subconfigure_ac_su
variable='$'$ac_subst_arg
echo " (''' $ac_subst_arg ''', r''' `eval echo $variable` ''')," >> $CONFIG_STATUS
done
cat >> $CONFIG_STATUS <<\EOF
]
dnl List of AC_DEFINEs that aren't to be exposed in ALLDEFINES
-non_global_defines = [
+non_global_config = [
EOF
if test -n "$_NON_GLOBAL_ACDEFINES"; then
for var in $_NON_GLOBAL_ACDEFINES; do
echo " '$var'," >> $CONFIG_STATUS
done
fi
--- a/build/moz.configure/old.configure
+++ b/build/moz.configure/old.configure
@@ -395,18 +395,18 @@ def set_old_configure_define(name, value
def post_old_configure(raw_config):
for k, v in raw_config['substs']:
set_old_configure_config(
k[1:-1], v[1:-1] if isinstance(v, types.StringTypes) else v)
for k, v in dict(raw_config['defines']).iteritems():
set_old_configure_define(k[1:-1], v[1:-1])
- set_old_configure_config('non_global_defines',
- raw_config['non_global_defines'])
+ set_old_configure_config('non_global_config',
+ raw_config['non_global_config'])
# Assuming no other option is declared after this function, handle the
# env options that were injected by mozconfig_options by creating dummy
# Option instances and having the sandbox's CommandLineHelper handle
# them. We only do so for options that haven't been declared so far,
# which should be a proxy for the options that old-configure handles
# and that we don't know anything about.
--- a/configure.py
+++ b/configure.py
@@ -45,23 +45,23 @@ def config_status(config):
return '1'
if v is False:
return ''
return v
sanitized_config = {}
sanitized_config['substs'] = {
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_config', 'TOPSRCDIR', 'TOPOBJDIR',
'ALL_CONFIGURE_PATHS')
}
sanitized_config['defines'] = {
k: sanitized_bools(v) for k, v in config['DEFINES'].iteritems()
}
- sanitized_config['non_global_defines'] = config['non_global_defines']
+ sanitized_config['non_global_config'] = config['non_global_config']
sanitized_config['topsrcdir'] = config['TOPSRCDIR']
sanitized_config['topobjdir'] = config['TOPOBJDIR']
sanitized_config['mozconfig'] = config.get('MOZCONFIG')
# 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)
@@ -74,17 +74,17 @@ def config_status(config):
from mozbuild.util import encode
encoding = '%(encoding)s'
''') % {'python': config['PYTHON'], 'encoding': encoding})
# A lot of the build backend code is currently expecting byte
# strings and breaks in subtle ways with unicode strings. (bug 1296508)
for k, v in sanitized_config.iteritems():
fh.write('%s = encode(%s, encoding)\n' % (k, indented_repr(v)))
fh.write("__all__ = ['topobjdir', 'topsrcdir', 'defines', "
- "'non_global_defines', 'substs', 'mozconfig']")
+ "'non_global_config', 'substs', 'mozconfig']")
if config.get('MOZ_BUILD_APP') != 'js' or config.get('JS_STANDALONE'):
fh.write(textwrap.dedent('''
if __name__ == '__main__':
from mozbuild.util import patch_main
patch_main()
from mozbuild.config_status import config_status
args = dict([(name, globals()[name]) for name in __all__])
--- a/python/mozbuild/mozbuild/backend/configenvironment.py
+++ b/python/mozbuild/mozbuild/backend/configenvironment.py
@@ -31,17 +31,17 @@ class BuildConfig(object):
"""Represents the output of configure."""
_CODE_CACHE = {}
def __init__(self):
self.topsrcdir = None
self.topobjdir = None
self.defines = {}
- self.non_global_defines = []
+ self.non_global_config = []
self.substs = {}
self.files = []
self.mozconfig = None
@classmethod
def from_config_status(cls, path):
"""Create an instance from a config.status file."""
code_cache = cls._CODE_CACHE
@@ -87,22 +87,23 @@ class ConfigEnvironment(object):
There are two types of files: config files and config headers,
each treated through a different member function.
Creating a ConfigEnvironment requires a few arguments:
- topsrcdir and topobjdir are, respectively, the top source and
the top object directory.
- defines is a dict filled from AC_DEFINE and AC_DEFINE_UNQUOTED in
autoconf.
- - non_global_defines are a list of names appearing in defines above
- that are not meant to be exported in ACDEFINES (see below)
+ - non_global_config are a list of names appearing in defines or substs
+ that are not meant to be exported in ACDEFINES, GLOBAL_DEFINES, or ALLSUBSTS
+ (see below)
- substs is a dict filled from AC_SUBST in autoconf.
ConfigEnvironment automatically defines one additional substs variable
- from all the defines not appearing in non_global_defines:
+ from all the defines not appearing in non_global_config:
- ACDEFINES contains the defines in the form -DNAME=VALUE, for use on
preprocessor command lines. The order in which defines were given
when creating the ConfigEnvironment is preserved.
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
Only substs with a VALUE are included, such that the resulting file
doesn't change when new empty substs are added.
@@ -113,23 +114,23 @@ class ConfigEnvironment(object):
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
"srcdir" subst when treating config files. It can either be an absolute
path or a path relative to the topobjdir.
"""
def __init__(self, topsrcdir, topobjdir, defines=None,
- non_global_defines=None, substs=None, source=None, mozconfig=None):
+ non_global_config=None, substs=None, source=None, mozconfig=None):
if not source:
source = mozpath.join(topobjdir, 'config.status')
self.source = source
self.defines = ReadOnlyDict(defines or {})
- self.non_global_defines = non_global_defines or []
+ self.non_global_config = non_global_config or []
self.substs = dict(substs or {})
self.topsrcdir = mozpath.abspath(topsrcdir)
self.topobjdir = mozpath.abspath(topobjdir)
self.mozconfig = mozpath.abspath(mozconfig) if mozconfig else None
self.lib_prefix = self.substs.get('LIB_PREFIX', '')
self.rust_lib_prefix = self.substs.get('RUST_LIB_PREFIX', '')
if 'LIB_SUFFIX' in self.substs:
self.lib_suffix = '.%s' % self.substs['LIB_SUFFIX']
@@ -141,17 +142,17 @@ class ConfigEnvironment(object):
self.import_prefix = self.lib_prefix
self.import_suffix = '.%s' % self.substs['IMPORT_LIB_SUFFIX']
else:
self.import_prefix = self.dll_prefix
self.import_suffix = self.dll_suffix
self.bin_suffix = self.substs.get('BIN_SUFFIX', '')
global_defines = [name for name in self.defines
- if not name in self.non_global_defines]
+ if not name in self.non_global_config]
self.substs['ACDEFINES'] = ' '.join(['-D%s=%s' % (name,
shell_quote(self.defines[name]).replace('$', '$$'))
for name in sorted(global_defines)])
def serialize(name, obj):
if isinstance(obj, StringTypes):
return obj
if isinstance(obj, Iterable):
return ' '.join(obj)
@@ -199,25 +200,25 @@ class ConfigEnvironment(object):
@property
def is_artifact_build(self):
return self.substs.get('MOZ_ARTIFACT_BUILDS', False)
@memoized_property
def acdefines(self):
acdefines = dict((name, self.defines[name])
for name in self.defines
- if name not in self.non_global_defines)
+ if name not in self.non_global_config)
return ReadOnlyDict(acdefines)
@staticmethod
def from_config_status(path):
config = BuildConfig.from_config_status(path)
return ConfigEnvironment(config.topsrcdir, config.topobjdir,
- config.defines, config.non_global_defines, config.substs, path)
+ config.defines, config.non_global_config, config.substs, path)
class PartialConfigDict(object):
"""Facilitates mapping the config.statusd defines & substs with dict-like access.
This allows a buildconfig client to use buildconfig.defines['FOO'] (and
similar for substs), where the value of FOO is delay-loaded until it is
needed.
@@ -320,17 +321,17 @@ class PartialConfigEnvironment(object):
process to handle things like GENERATED_FILES, CONFIGURE_DEFINE_FILES, and
anything else that may need to access specific substs or defines.
Creating a PartialConfigEnvironment requires only the topobjdir, which is
needed to distinguish between the top-level environment and the js/src
environment.
The PartialConfigEnvironment automatically defines one additional subst variable
- from all the defines not appearing in non_global_defines:
+ from all the defines not appearing in non_global_config:
- ACDEFINES contains the defines in the form -DNAME=VALUE, for use on
preprocessor command lines. The order in which defines were given
when creating the ConfigEnvironment is preserved.
and one additional define from all the defines as a dictionary:
- ALLDEFINES contains all of the global defines as a dictionary. This is
intended to be used instead of the defines structure from config.status so
that scripts can depend directly on its value.
@@ -342,17 +343,17 @@ class PartialConfigEnvironment(object):
self.topobjdir = topobjdir
def write_vars(self, config):
substs = config['substs'].copy()
defines = config['defines'].copy()
global_defines = [
name for name in config['defines']
- if name not in config['non_global_defines']
+ if name not in config['non_global_config']
]
acdefines = ' '.join(['-D%s=%s' % (name,
shell_quote(config['defines'][name]).replace('$', '$$'))
for name in sorted(global_defines)])
substs['ACDEFINES'] = acdefines
all_defines = OrderedDict()
for k in global_defines:
--- a/python/mozbuild/mozbuild/base.py
+++ b/python/mozbuild/mozbuild/base.py
@@ -241,18 +241,18 @@ class MozbuildObject(ProcessExecutionMix
return self._config_environment
@property
def defines(self):
return self.config_environment.defines
@property
- def non_global_defines(self):
- return self.config_environment.non_global_defines
+ def non_global_config(self):
+ return self.config_environment.non_global_config
@property
def substs(self):
return self.config_environment.substs
@property
def distdir(self):
return os.path.join(self.topobjdir, 'dist')
--- a/python/mozbuild/mozbuild/config_status.py
+++ b/python/mozbuild/mozbuild/config_status.py
@@ -57,17 +57,17 @@ files by running:
mach build-backend --backend=VisualStudio
===============================
'''.strip()
def config_status(topobjdir='.', topsrcdir='.', defines=None,
- non_global_defines=None, substs=None, source=None,
+ non_global_config=None, substs=None, source=None,
mozconfig=None, args=sys.argv[1:]):
'''Main function, providing config.status functionality.
Contrary to config.status, it doesn't use CONFIG_FILES or CONFIG_HEADERS
variables.
Without the -n option, this program acts as config.status and considers
the current directory as the top object directory, even when config.status
@@ -109,17 +109,17 @@ def config_status(topobjdir='.', topsrcd
help='do everything except writing files out.')
options = parser.parse_args(args)
# Without -n, the current directory is meant to be the top object directory
if not options.not_topobjdir:
topobjdir = os.path.abspath('.')
env = ConfigEnvironment(topsrcdir, topobjdir, defines=defines,
- non_global_defines=non_global_defines, substs=substs,
+ non_global_config=non_global_config, substs=substs,
source=source, mozconfig=mozconfig)
# mozinfo.json only needs written if configure changes and configure always
# passes this environment variable.
if 'WRITE_MOZINFO' in os.environ:
write_mozinfo(os.path.join(topobjdir, 'mozinfo.json'), env, os.environ)
cpu_start = time.clock()
--- a/python/mozbuild/mozbuild/test/backend/common.py
+++ b/python/mozbuild/mozbuild/test/backend/common.py
@@ -25,150 +25,150 @@ log_manager.add_terminal_logging()
test_data_path = mozpath.abspath(mozpath.dirname(__file__))
test_data_path = mozpath.join(test_data_path, 'data')
CONFIGS = defaultdict(lambda: {
'defines': {},
- 'non_global_defines': [],
+ 'non_global_config': [],
'substs': {'OS_TARGET': 'WINNT'},
}, {
'binary-components': {
'defines': {},
- 'non_global_defines': [],
+ 'non_global_config': [],
'substs': {
'LIB_PREFIX': 'lib',
'RUST_LIB_PREFIX': 'lib',
'LIB_SUFFIX': 'a',
'RUST_LIB_SUFFIX': 'a',
'COMPILE_ENVIRONMENT': '1',
},
},
'rust-library': {
'defines': {},
- 'non_global_defines': [],
+ 'non_global_config': [],
'substs': {
'COMPILE_ENVIRONMENT': '1',
'RUST_TARGET': 'x86_64-unknown-linux-gnu',
'LIB_PREFIX': 'lib',
'RUST_LIB_PREFIX': 'lib',
'LIB_SUFFIX': 'a',
'RUST_LIB_SUFFIX': 'a',
},
},
'host-rust-library': {
'defines': {},
- 'non_global_defines': [],
+ 'non_global_config': [],
'substs': {
'COMPILE_ENVIRONMENT': '1',
'RUST_HOST_TARGET': 'x86_64-unknown-linux-gnu',
'RUST_TARGET': 'armv7-linux-androideabi',
'LIB_PREFIX': 'lib',
'RUST_LIB_PREFIX': 'lib',
'LIB_SUFFIX': 'a',
'RUST_LIB_SUFFIX': 'a',
},
},
'host-rust-library-features': {
'defines': {},
- 'non_global_defines': [],
+ 'non_global_config': [],
'substs': {
'COMPILE_ENVIRONMENT': '1',
'RUST_HOST_TARGET': 'x86_64-unknown-linux-gnu',
'RUST_TARGET': 'armv7-linux-androideabi',
'LIB_PREFIX': 'lib',
'RUST_LIB_PREFIX': 'lib',
'LIB_SUFFIX': 'a',
'RUST_LIB_SUFFIX': 'a',
},
},
'rust-library-features': {
'defines': {},
- 'non_global_defines': [],
+ 'non_global_config': [],
'substs': {
'COMPILE_ENVIRONMENT': '1',
'RUST_TARGET': 'x86_64-unknown-linux-gnu',
'LIB_PREFIX': 'lib',
'RUST_LIB_PREFIX': 'lib',
'LIB_SUFFIX': 'a',
'RUST_LIB_SUFFIX': 'a',
},
},
'rust-programs': {
'defines': {},
- 'non_global_defines': [],
+ 'non_global_config': [],
'substs': {
'COMPILE_ENVIRONMENT': '1',
'RUST_TARGET': 'i686-pc-windows-msvc',
'RUST_HOST_TARGET': 'i686-pc-windows-msvc',
'BIN_SUFFIX': '.exe',
'HOST_BIN_SUFFIX': '.exe',
},
},
'test-support-binaries-tracked': {
'defines': {},
- 'non_global_defines': [],
+ 'non_global_config': [],
'substs': {
'COMPILE_ENVIRONMENT': '1',
'LIB_SUFFIX': 'dll',
'BIN_SUFFIX': '.exe',
},
},
'sources': {
'defines': {},
- 'non_global_defines': [],
+ 'non_global_config': [],
'substs': {
'LIB_PREFIX': 'lib',
'LIB_SUFFIX': 'a',
},
},
'stub0': {
'defines': {
'MOZ_TRUE_1': '1',
'MOZ_TRUE_2': '1',
},
- 'non_global_defines': [
+ 'non_global_config': [
'MOZ_NONGLOBAL_1',
'MOZ_NONGLOBAL_2',
],
'substs': {
'MOZ_FOO': 'foo',
'MOZ_BAR': 'bar',
},
},
'substitute_config_files': {
'defines': {},
- 'non_global_defines': [],
+ 'non_global_config': [],
'substs': {
'MOZ_FOO': 'foo',
'MOZ_BAR': 'bar',
},
},
'test_config': {
'defines': {
'foo': 'baz qux',
'baz': 1,
},
- 'non_global_defines': [],
+ 'non_global_config': [],
'substs': {
'foo': 'bar baz',
},
},
'visual-studio': {
'defines': {},
- 'non_global_defines': [],
+ 'non_global_config': [],
'substs': {
'MOZ_APP_NAME': 'my_app',
},
},
'prog-lib-c-only': {
'defines': {},
- 'non_global_defines': [],
+ 'non_global_config': [],
'substs': {
'COMPILE_ENVIRONMENT': '1',
'LIB_SUFFIX': '.a',
'BIN_SUFFIX': '',
},
}
})
--- a/python/mozbuild/mozbuild/test/backend/test_configenvironment.py
+++ b/python/mozbuild/mozbuild/test/backend/test_configenvironment.py
@@ -36,21 +36,21 @@ class ConfigEnvironment(ConfigStatus.Con
class TestEnvironment(unittest.TestCase):
def test_auto_substs(self):
'''Test the automatically set values of ACDEFINES, ALLSUBSTS
and ALLEMPTYSUBSTS.
'''
env = ConfigEnvironment('.', '.',
defines = { 'foo': 'bar', 'baz': 'qux 42',
'abc': "d'e'f", 'extra': 'foobar' },
- non_global_defines = ['extra', 'ignore'],
+ non_global_config = ['extra', 'ignore'],
substs = { 'FOO': 'bar', 'FOOBAR': '', 'ABC': 'def',
'bar': 'baz qux', 'zzz': '"abc def"',
'qux': '' })
- # non_global_defines should be filtered out in ACDEFINES.
+ # non_global_config should be filtered out in ACDEFINES.
# Original order of the defines need to be respected in ACDEFINES
self.assertEqual(env.substs['ACDEFINES'], """-Dabc='d'\\''e'\\''f' -Dbaz='qux 42' -Dfoo=bar""")
# Likewise for ALLSUBSTS, which also must contain ACDEFINES
self.assertEqual(env.substs['ALLSUBSTS'], '''ABC = def
ACDEFINES = -Dabc='d'\\''e'\\''f' -Dbaz='qux 42' -Dfoo=bar
FOO = bar
bar = baz qux
zzz = "abc def"''')
--- a/python/mozbuild/mozbuild/test/backend/test_partialconfigenvironment.py
+++ b/python/mozbuild/mozbuild/test/backend/test_partialconfigenvironment.py
@@ -17,17 +17,17 @@ config = {
'MOZ_BAR': '2',
'MOZ_NON_GLOBAL': '3',
},
'substs': {
'MOZ_SUBST_1': '1',
'MOZ_SUBST_2': '2',
'CPP': 'cpp',
},
- 'non_global_defines': [
+ 'non_global_config': [
'MOZ_NON_GLOBAL',
],
}
class TestPartial(unittest.TestCase):
def setUp(self):
self._old_env = dict(os.environ)