gecko-dev/build/buildconfig.py
Mike Hommey a4b157940a Bug 1278415 - Make the buildconfig module use MozbuildObject.from_environment. r=gps
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.
2016-06-16 11:43:35 +09:00

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]