mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 23:31:56 +00:00
a4b157940a
The buildconfig module predates MozbuildObject.from_environment, and it's about time to start factoring things out such that we only have one way to get config.status data. This is step 1: making the buildconfig module use MozbuildObject.from_environment. Eventually, we'll want to remove the buildconfig module uses everywhere.
21 lines
607 B
Python
21 lines
607 B
Python
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
import os
|
|
import sys
|
|
from mozbuild.base import MozbuildObject
|
|
|
|
config = MozbuildObject.from_environment()
|
|
|
|
for var in ('topsrcdir', 'topobjdir', 'defines', 'non_global_defines',
|
|
'substs'):
|
|
value = getattr(config, var)
|
|
setattr(sys.modules[__name__], var, value)
|
|
|
|
substs = dict(substs)
|
|
|
|
for var in os.environ:
|
|
if var != 'SHELL' and var in substs:
|
|
substs[var] = os.environ[var]
|