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-01-23 11:58:20 -05:00
|
|
|
SCONS_VERSION = os.environ.get('SCONS_VERSION', "3.0.4")
|
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
|
|
|
|
|
except ImportError:
|
2018-03-27 14:30:46 -04:00
|
|
|
print("Could not find SCons in '%s'" % (SCONS_DIR))
|
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()
|