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