2019-04-10 17:42:47 +02:00
|
|
|
#!/usr/bin/env python3
|
2018-03-27 20:30:46 +02:00
|
|
|
"""Scons module."""
|
2017-03-28 17:04:13 +02:00
|
|
|
|
2016-07-12 04:17:22 +02:00
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
|
2019-12-20 15:03:04 +01:00
|
|
|
SCONS_VERSION = os.environ.get('SCONS_VERSION', "3.1.2")
|
2016-07-12 04:17:22 +02:00
|
|
|
|
2018-03-27 20:30:46 +02: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 17:04:13 +02:00
|
|
|
'scons-local-' + SCONS_VERSION)
|
|
|
|
|
2018-03-27 20:30:46 +02:00
|
|
|
if not os.path.exists(SCONS_DIR):
|
|
|
|
print("Could not find SCons in '%s'" % (SCONS_DIR))
|
2017-03-28 17:04:13 +02:00
|
|
|
sys.exit(1)
|
|
|
|
|
2021-02-04 20:49:50 +01:00
|
|
|
SITE_TOOLS_DIR = os.path.join(MONGODB_ROOT, 'site_scons')
|
|
|
|
|
|
|
|
sys.path = [SCONS_DIR, SITE_TOOLS_DIR] + sys.path
|
|
|
|
|
|
|
|
# pylint: disable=C0413
|
|
|
|
from mongo.pip_requirements import verify_requirements, MissingRequirements
|
|
|
|
|
|
|
|
try:
|
|
|
|
verify_requirements('etc/pip/compile-requirements.txt')
|
|
|
|
except MissingRequirements as ex:
|
|
|
|
print(ex)
|
|
|
|
sys.exit(1)
|
2016-07-12 04:17:22 +02:00
|
|
|
|
2017-03-28 17:04:13 +02:00
|
|
|
try:
|
|
|
|
import SCons.Script
|
2019-10-01 16:11:47 +02:00
|
|
|
except ImportError as import_err:
|
2019-09-25 20:08:26 +02:00
|
|
|
print("Could not import SCons from '%s'" % (SCONS_DIR))
|
2019-10-01 16:11:47 +02:00
|
|
|
print("ImportError:", import_err)
|
2017-03-28 17:04:13 +02:00
|
|
|
sys.exit(1)
|
2017-03-09 19:47:54 +01:00
|
|
|
|
2020-10-20 17:43:36 +02:00
|
|
|
if __name__ == '__main__':
|
|
|
|
SCons.Script.main()
|