mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-14 20:22:00 +00:00
Bug 1664077 - Remove _NON_GLOBAL_ACDEFINES. r=firefox-build-system-reviewers,mhentges,rstewart
I think they're remnants from the past that we don't really need anymore. And they're making things more complicated for some pending work of mine. Differential Revision: https://phabricator.services.mozilla.com/D89687
This commit is contained in:
parent
a60555aa8c
commit
b297cc22e4
@ -149,19 +149,6 @@ done
|
||||
cat >> $CONFIG_STATUS <<\EOF
|
||||
]
|
||||
|
||||
dnl List of AC_DEFINEs that aren't to be exposed in ALLDEFINES
|
||||
non_global_defines = [
|
||||
EOF
|
||||
|
||||
if test -n "$_NON_GLOBAL_ACDEFINES"; then
|
||||
for var in $_NON_GLOBAL_ACDEFINES; do
|
||||
echo " '$var'," >> $CONFIG_STATUS
|
||||
done
|
||||
fi
|
||||
|
||||
cat >> $CONFIG_STATUS <<EOF
|
||||
]
|
||||
|
||||
flags = [
|
||||
undivert(MOZ_DIVERSION_ARGS)dnl
|
||||
]
|
||||
|
@ -316,9 +316,6 @@ def post_old_configure(raw_config):
|
||||
for k, v in iteritems(dict(raw_config['defines'])):
|
||||
set_old_configure_define(k, v)
|
||||
|
||||
set_old_configure_config('non_global_defines',
|
||||
raw_config['non_global_defines'])
|
||||
|
||||
|
||||
# Assuming no other option is declared after this function, handle the
|
||||
# env options that were injected by mozconfig_options by creating dummy
|
||||
|
@ -97,13 +97,11 @@ def config_status(config):
|
||||
sanitized_config = {}
|
||||
sanitized_config['substs'] = {
|
||||
k: sanitize_config(v) for k, v in six.iteritems(config)
|
||||
if k not in ('DEFINES', 'non_global_defines', 'TOPSRCDIR', 'TOPOBJDIR',
|
||||
'CONFIG_STATUS_DEPS')
|
||||
if k not in ('DEFINES', 'TOPSRCDIR', 'TOPOBJDIR', 'CONFIG_STATUS_DEPS')
|
||||
}
|
||||
sanitized_config['defines'] = {
|
||||
k: sanitize_config(v) for k, v in six.iteritems(config['DEFINES'])
|
||||
}
|
||||
sanitized_config['non_global_defines'] = config['non_global_defines']
|
||||
sanitized_config['topsrcdir'] = config['TOPSRCDIR']
|
||||
sanitized_config['topobjdir'] = config['TOPOBJDIR']
|
||||
sanitized_config['mozconfig'] = config.get('MOZCONFIG')
|
||||
@ -127,7 +125,7 @@ def config_status(config):
|
||||
fh.write('%s = ' % k)
|
||||
write_indented_repr(fh, v)
|
||||
fh.write("__all__ = ['topobjdir', 'topsrcdir', 'defines', "
|
||||
"'non_global_defines', 'substs', 'mozconfig']")
|
||||
"'substs', 'mozconfig']")
|
||||
|
||||
if config.get('MOZ_BUILD_APP') != 'js' or config.get('JS_STANDALONE'):
|
||||
fh.write(textwrap.dedent('''
|
||||
|
@ -2487,7 +2487,6 @@ if test "$NECKO_WIFI"; then
|
||||
AC_MSG_ERROR([Necko WiFi scanning needs DBus on your platform, remove --disable-dbus or use --disable-necko-wifi])
|
||||
fi
|
||||
AC_DEFINE(NECKO_WIFI)
|
||||
_NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES NECKO_WIFI"
|
||||
fi
|
||||
AC_SUBST(NECKO_WIFI)
|
||||
AC_SUBST(NECKO_WIFI_DBUS)
|
||||
@ -2834,19 +2833,6 @@ fi
|
||||
dnl Spit out some output
|
||||
dnl ========================================================
|
||||
|
||||
dnl The following defines are used by xpcom
|
||||
_NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES
|
||||
HAVE_GETPAGESIZE
|
||||
HAVE_STATVFS64
|
||||
HAVE_STATVFS
|
||||
HAVE_STATFS64
|
||||
HAVE_STATFS
|
||||
HAVE_SYS_STATVFS_H
|
||||
HAVE_SYS_STATFS_H
|
||||
HAVE_SYS_VFS_H
|
||||
HAVE_SYS_MOUNT_H
|
||||
"
|
||||
|
||||
# Avoid using obsolete NSPR features
|
||||
AC_DEFINE(NO_NSPR_10_SUPPORT)
|
||||
|
||||
|
@ -36,7 +36,6 @@ class BuildConfig(object):
|
||||
self.topsrcdir = None
|
||||
self.topobjdir = None
|
||||
self.defines = {}
|
||||
self.non_global_defines = []
|
||||
self.substs = {}
|
||||
self.files = []
|
||||
self.mozconfig = None
|
||||
@ -95,12 +94,10 @@ class ConfigEnvironment(object):
|
||||
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)
|
||||
- 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:
|
||||
- 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.
|
||||
@ -121,13 +118,12 @@ class ConfigEnvironment(object):
|
||||
"""
|
||||
|
||||
def __init__(self, topsrcdir, topobjdir, defines=None,
|
||||
non_global_defines=None, substs=None, source=None, mozconfig=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.substs = dict(substs or {})
|
||||
self.topsrcdir = mozpath.abspath(topsrcdir)
|
||||
self.topobjdir = mozpath.abspath(topobjdir)
|
||||
@ -150,8 +146,7 @@ class ConfigEnvironment(object):
|
||||
self.import_suffix = self.dll_suffix
|
||||
self.bin_suffix = self.substs.get('BIN_SUFFIX', '')
|
||||
|
||||
global_defines = [name for name in self.defines
|
||||
if name not in self.non_global_defines]
|
||||
global_defines = [name for name in self.defines]
|
||||
self.substs["ACDEFINES"] = ' '.join(
|
||||
[
|
||||
'-D%s=%s' % (name, shell_quote(self.defines[name]).replace('$', '$$'))
|
||||
@ -190,8 +185,7 @@ class ConfigEnvironment(object):
|
||||
@memoized_property
|
||||
def acdefines(self):
|
||||
acdefines = dict((name, self.defines[name])
|
||||
for name in self.defines
|
||||
if name not in self.non_global_defines)
|
||||
for name in self.defines)
|
||||
return ReadOnlyDict(acdefines)
|
||||
|
||||
@staticmethod
|
||||
@ -199,7 +193,7 @@ class ConfigEnvironment(object):
|
||||
config = BuildConfig.from_config_status(path)
|
||||
|
||||
return ConfigEnvironment(config.topsrcdir, config.topobjdir,
|
||||
config.defines, config.non_global_defines, config.substs, path)
|
||||
config.defines, config.substs, path)
|
||||
|
||||
|
||||
class PartialConfigDict(object):
|
||||
@ -314,7 +308,7 @@ class PartialConfigEnvironment(object):
|
||||
environment.
|
||||
|
||||
The PartialConfigEnvironment automatically defines one additional subst variable
|
||||
from all the defines not appearing in non_global_defines:
|
||||
from all the defines:
|
||||
- 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.
|
||||
@ -337,7 +331,6 @@ class PartialConfigEnvironment(object):
|
||||
|
||||
global_defines = [
|
||||
name for name in config['defines']
|
||||
if name not in config['non_global_defines']
|
||||
]
|
||||
acdefines = ' '.join(['-D%s=%s' % (name,
|
||||
shell_quote(config['defines'][name]).replace('$', '$$'))
|
||||
|
@ -374,10 +374,6 @@ class MozbuildObject(ProcessExecutionMixin):
|
||||
def defines(self):
|
||||
return self.config_environment.defines
|
||||
|
||||
@property
|
||||
def non_global_defines(self):
|
||||
return self.config_environment.non_global_defines
|
||||
|
||||
@property
|
||||
def substs(self):
|
||||
return self.config_environment.substs
|
||||
|
@ -61,9 +61,8 @@ files by running:
|
||||
'''.strip()
|
||||
|
||||
|
||||
def config_status(topobjdir='.', topsrcdir='.', defines=None,
|
||||
non_global_defines=None, substs=None, source=None,
|
||||
mozconfig=None, args=sys.argv[1:]):
|
||||
def config_status(topobjdir='.', topsrcdir='.', defines=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
|
||||
@ -113,8 +112,7 @@ def config_status(topobjdir='.', topsrcdir='.', defines=None,
|
||||
if not options.not_topobjdir:
|
||||
topobjdir = os.path.realpath('.')
|
||||
|
||||
env = ConfigEnvironment(topsrcdir, topobjdir, defines=defines,
|
||||
non_global_defines=non_global_defines, substs=substs,
|
||||
env = ConfigEnvironment(topsrcdir, topobjdir, defines=defines, substs=substs,
|
||||
source=source, mozconfig=mozconfig)
|
||||
|
||||
with FileAvoidWrite(os.path.join(topobjdir, 'mozinfo.json')) as f:
|
||||
|
@ -30,12 +30,10 @@ test_data_path = mozpath.join(test_data_path, 'data')
|
||||
|
||||
CONFIGS = defaultdict(lambda: {
|
||||
'defines': {},
|
||||
'non_global_defines': [],
|
||||
'substs': {'OS_TARGET': 'WINNT'},
|
||||
}, {
|
||||
'binary-components': {
|
||||
'defines': {},
|
||||
'non_global_defines': [],
|
||||
'substs': {
|
||||
'LIB_PREFIX': 'lib',
|
||||
'RUST_LIB_PREFIX': 'lib',
|
||||
@ -46,7 +44,6 @@ CONFIGS = defaultdict(lambda: {
|
||||
},
|
||||
'rust-library': {
|
||||
'defines': {},
|
||||
'non_global_defines': [],
|
||||
'substs': {
|
||||
'COMPILE_ENVIRONMENT': '1',
|
||||
'RUST_TARGET': 'x86_64-unknown-linux-gnu',
|
||||
@ -58,7 +55,6 @@ CONFIGS = defaultdict(lambda: {
|
||||
},
|
||||
'host-rust-library': {
|
||||
'defines': {},
|
||||
'non_global_defines': [],
|
||||
'substs': {
|
||||
'COMPILE_ENVIRONMENT': '1',
|
||||
'RUST_HOST_TARGET': 'x86_64-unknown-linux-gnu',
|
||||
@ -71,7 +67,6 @@ CONFIGS = defaultdict(lambda: {
|
||||
},
|
||||
'host-rust-library-features': {
|
||||
'defines': {},
|
||||
'non_global_defines': [],
|
||||
'substs': {
|
||||
'COMPILE_ENVIRONMENT': '1',
|
||||
'RUST_HOST_TARGET': 'x86_64-unknown-linux-gnu',
|
||||
@ -84,7 +79,6 @@ CONFIGS = defaultdict(lambda: {
|
||||
},
|
||||
'rust-library-features': {
|
||||
'defines': {},
|
||||
'non_global_defines': [],
|
||||
'substs': {
|
||||
'COMPILE_ENVIRONMENT': '1',
|
||||
'RUST_TARGET': 'x86_64-unknown-linux-gnu',
|
||||
@ -96,7 +90,6 @@ CONFIGS = defaultdict(lambda: {
|
||||
},
|
||||
'rust-programs': {
|
||||
'defines': {},
|
||||
'non_global_defines': [],
|
||||
'substs': {
|
||||
'COMPILE_ENVIRONMENT': '1',
|
||||
'RUST_TARGET': 'i686-pc-windows-msvc',
|
||||
@ -107,7 +100,6 @@ CONFIGS = defaultdict(lambda: {
|
||||
},
|
||||
'test-support-binaries-tracked': {
|
||||
'defines': {},
|
||||
'non_global_defines': [],
|
||||
'substs': {
|
||||
'COMPILE_ENVIRONMENT': '1',
|
||||
'LIB_SUFFIX': 'dll',
|
||||
@ -116,7 +108,6 @@ CONFIGS = defaultdict(lambda: {
|
||||
},
|
||||
'sources': {
|
||||
'defines': {},
|
||||
'non_global_defines': [],
|
||||
'substs': {
|
||||
'LIB_PREFIX': 'lib',
|
||||
'LIB_SUFFIX': 'a',
|
||||
@ -127,10 +118,6 @@ CONFIGS = defaultdict(lambda: {
|
||||
'MOZ_TRUE_1': '1',
|
||||
'MOZ_TRUE_2': '1',
|
||||
},
|
||||
'non_global_defines': [
|
||||
'MOZ_NONGLOBAL_1',
|
||||
'MOZ_NONGLOBAL_2',
|
||||
],
|
||||
'substs': {
|
||||
'MOZ_FOO': 'foo',
|
||||
'MOZ_BAR': 'bar',
|
||||
@ -138,7 +125,6 @@ CONFIGS = defaultdict(lambda: {
|
||||
},
|
||||
'substitute_config_files': {
|
||||
'defines': {},
|
||||
'non_global_defines': [],
|
||||
'substs': {
|
||||
'MOZ_FOO': 'foo',
|
||||
'MOZ_BAR': 'bar',
|
||||
@ -149,21 +135,18 @@ CONFIGS = defaultdict(lambda: {
|
||||
'foo': 'baz qux',
|
||||
'baz': 1,
|
||||
},
|
||||
'non_global_defines': [],
|
||||
'substs': {
|
||||
'foo': 'bar baz',
|
||||
},
|
||||
},
|
||||
'visual-studio': {
|
||||
'defines': {},
|
||||
'non_global_defines': [],
|
||||
'substs': {
|
||||
'MOZ_APP_NAME': 'my_app',
|
||||
},
|
||||
},
|
||||
'prog-lib-c-only': {
|
||||
'defines': {},
|
||||
'non_global_defines': [],
|
||||
'substs': {
|
||||
'COMPILE_ENVIRONMENT': '1',
|
||||
'LIB_SUFFIX': '.a',
|
||||
@ -172,7 +155,6 @@ CONFIGS = defaultdict(lambda: {
|
||||
},
|
||||
'gn-processor': {
|
||||
'defines': {},
|
||||
'non_global_defines': [],
|
||||
'substs': {
|
||||
'BUILD_BACKENDS': [
|
||||
'GnMozbuildWriter',
|
||||
@ -190,7 +172,6 @@ CONFIGS = defaultdict(lambda: {
|
||||
},
|
||||
'ipdl_sources': {
|
||||
'defines': {},
|
||||
'non_global_defines': [],
|
||||
'substs': {
|
||||
'COMPILE_ENVIRONMENT': '1',
|
||||
'LIB_SUFFIX': '.a',
|
||||
@ -199,7 +180,6 @@ CONFIGS = defaultdict(lambda: {
|
||||
},
|
||||
'program-paths': {
|
||||
'defines': {},
|
||||
'non_global_defines': [],
|
||||
'substs': {
|
||||
'COMPILE_ENVIRONMENT': '1',
|
||||
'BIN_SUFFIX': '.prog',
|
||||
@ -207,7 +187,6 @@ CONFIGS = defaultdict(lambda: {
|
||||
},
|
||||
'linkage': {
|
||||
'defines': {},
|
||||
'non_global_defines': [],
|
||||
'substs': {
|
||||
'CC_TYPE': 'clang',
|
||||
'COMPILE_ENVIRONMENT': '1',
|
||||
|
@ -37,12 +37,10 @@ class TestEnvironment(unittest.TestCase):
|
||||
'''
|
||||
env = ConfigEnvironment('.', '.',
|
||||
defines={'foo': 'bar', 'baz': 'qux 42',
|
||||
'abc': "d'e'f", 'extra': 'foobar'},
|
||||
non_global_defines=['extra', 'ignore'],
|
||||
'abc': "d'e'f"},
|
||||
substs={'FOO': 'bar', 'FOOBAR': '', 'ABC': 'def',
|
||||
'bar': 'baz qux', 'zzz': '"abc def"',
|
||||
'qux': ''})
|
||||
# non_global_defines 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""")
|
||||
|
@ -18,16 +18,12 @@ config = {
|
||||
'defines': {
|
||||
'MOZ_FOO': '1',
|
||||
'MOZ_BAR': '2',
|
||||
'MOZ_NON_GLOBAL': '3',
|
||||
},
|
||||
'substs': {
|
||||
'MOZ_SUBST_1': '1',
|
||||
'MOZ_SUBST_2': '2',
|
||||
'CPP': 'cpp',
|
||||
},
|
||||
'non_global_defines': [
|
||||
'MOZ_NON_GLOBAL',
|
||||
],
|
||||
}
|
||||
|
||||
|
||||
|
@ -304,10 +304,9 @@ class TestMozbuildObject(unittest.TestCase):
|
||||
fh.write("topsrcdir = '%s'\n" % topsrcdir)
|
||||
fh.write("mozconfig = None\n")
|
||||
fh.write("defines = { 'FOO': 'foo' }\n")
|
||||
fh.write("non_global_defines = ['BAR']\n")
|
||||
fh.write("substs = { 'QUX': 'qux' }\n")
|
||||
fh.write("__all__ = ['topobjdir', 'topsrcdir', 'defines', "
|
||||
"'non_global_defines', 'substs', 'mozconfig']")
|
||||
"'substs', 'mozconfig']")
|
||||
|
||||
base = self.get_base(topobjdir=d)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user