2019-04-10 11:42:47 -04:00
|
|
|
#!/usr/bin/env python3
|
2018-03-27 14:30:46 -04:00
|
|
|
"""Scons module."""
|
2017-03-28 11:04:13 -04:00
|
|
|
|
2016-07-11 22:17:22 -04:00
|
|
|
import os
|
|
|
|
|
import sys
|
|
|
|
|
|
2019-12-20 14:03:04 +00:00
|
|
|
SCONS_VERSION = os.environ.get('SCONS_VERSION', "3.1.2")
|
2016-07-11 22:17:22 -04:00
|
|
|
|
2018-03-27 14:30:46 -04:00
|
|
|
MONGODB_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
|
|
|
|
|
SCONS_DIR = os.path.join(MONGODB_ROOT, 'src', 'third_party', 'scons-' + SCONS_VERSION,
|
2017-03-28 11:04:13 -04:00
|
|
|
'scons-local-' + SCONS_VERSION)
|
|
|
|
|
|
2018-03-27 14:30:46 -04:00
|
|
|
if not os.path.exists(SCONS_DIR):
|
|
|
|
|
print("Could not find SCons in '%s'" % (SCONS_DIR))
|
2017-03-28 11:04:13 -04:00
|
|
|
sys.exit(1)
|
|
|
|
|
|
2018-03-27 14:30:46 -04:00
|
|
|
sys.path = [SCONS_DIR] + sys.path
|
2016-07-11 22:17:22 -04:00
|
|
|
|
2017-03-28 11:04:13 -04:00
|
|
|
try:
|
|
|
|
|
import SCons.Script
|
2019-10-01 14:11:47 +00:00
|
|
|
except ImportError as import_err:
|
2019-09-25 18:08:26 +00:00
|
|
|
print("Could not import SCons from '%s'" % (SCONS_DIR))
|
2019-10-01 14:11:47 +00:00
|
|
|
print("ImportError:", import_err)
|
2017-03-28 11:04:13 -04:00
|
|
|
sys.exit(1)
|
2017-03-09 13:47:54 -05:00
|
|
|
|
2017-03-28 11:04:13 -04:00
|
|
|
SCons.Script.main()
|