2012-09-20 11:52:12 +04:00
|
|
|
# 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
|
2016-06-07 02:25:10 +03:00
|
|
|
from mozbuild.base import MozbuildObject
|
2012-09-20 11:52:12 +04:00
|
|
|
|
2016-06-07 02:25:10 +03:00
|
|
|
config = MozbuildObject.from_environment()
|
2012-09-20 11:52:12 +04:00
|
|
|
|
2016-06-07 02:25:10 +03:00
|
|
|
for var in ('topsrcdir', 'topobjdir', 'defines', 'non_global_defines',
|
|
|
|
'substs'):
|
2012-09-20 11:52:12 +04:00
|
|
|
value = getattr(config, var)
|
|
|
|
setattr(sys.modules[__name__], var, value)
|
2013-01-23 14:23:15 +04:00
|
|
|
|
2016-06-07 02:25:10 +03:00
|
|
|
substs = dict(substs)
|
|
|
|
|
2013-01-23 14:23:15 +04:00
|
|
|
for var in os.environ:
|
2017-02-24 01:01:18 +03:00
|
|
|
if var not in ('CPP', 'CXXCPP', 'SHELL') and var in substs:
|
2013-01-23 14:23:15 +04:00
|
|
|
substs[var] = os.environ[var]
|