buildconfig.py 630 B

123456789101112131415161718192021
  1. # This Source Code Form is subject to the terms of the Mozilla Public
  2. # License, v. 2.0. If a copy of the MPL was not distributed with this
  3. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
  4. import os
  5. import sys
  6. from mozbuild.base import MozbuildObject
  7. config = MozbuildObject.from_environment()
  8. for var in ('topsrcdir', 'topobjdir', 'defines', 'non_global_defines',
  9. 'substs'):
  10. value = getattr(config, var)
  11. setattr(sys.modules[__name__], var, value)
  12. substs = dict(substs)
  13. for var in os.environ:
  14. if var not in ('CPP', 'CXXCPP', 'SHELL') and var in substs:
  15. substs[var] = os.environ[var]