configure.py 1.0 KB

123456789101112131415161718192021222324252627282930313233
  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. from __future__ import print_function, unicode_literals
  5. import imp
  6. import os
  7. import sys
  8. base_dir = os.path.abspath(os.path.dirname(__file__))
  9. sys.path.append(os.path.join(base_dir, 'platform', 'python', 'mozbuild'))
  10. from mozbuild.configure import ConfigureSandbox
  11. # We can't just import config_status since configure is shadowed by this file!
  12. f, pathname, desc = imp.find_module('configure',
  13. [os.path.join(base_dir, 'platform')])
  14. config_status = imp.load_module('configure', f, pathname, desc).config_status
  15. def main(argv):
  16. config = {}
  17. sandbox = ConfigureSandbox(config, os.environ, argv)
  18. sandbox.run(os.path.join(os.path.dirname(__file__), 'moz.configure'))
  19. if sandbox._help:
  20. return 0
  21. return config_status(config)
  22. if __name__ == '__main__':
  23. sys.exit(main(sys.argv))