blob: a6d721ac54fb7d064e31fdec7c3bb45cf3935fbd [file] [log] [blame]
Brad Bishop316dfdd2018-06-25 12:45:53 -04001From 53368d3f4adc09dd84234a9af31771bcd8ca2757 Mon Sep 17 00:00:00 2001
2From: Sven Ebenfeld <sven.ebenfeld@gmail.com>
3Date: Fri, 15 Jan 2016 22:41:28 +0100
4Subject: [PATCH] Tell scons to use build settings from environment variables
5
6Signed-off-by: Sven Ebenfeld <sven.ebenfeld@gmail.com>
7---
8 SConstruct | 8 ++++++--
9 src/mongo/util/SConscript | 2 ++
10 2 files changed, 8 insertions(+), 2 deletions(-)
11
12Index: git/SConstruct
13===================================================================
14--- git.orig/SConstruct
15+++ git/SConstruct
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080016@@ -564,6 +564,7 @@ def variable_arch_converter(val):
Brad Bishop316dfdd2018-06-25 12:45:53 -040017 'amd64': 'x86_64',
18 'emt64': 'x86_64',
19 'x86': 'i386',
20+ 'aarch64': 'arm64',
21 }
22 val = val.lower()
23
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080024@@ -652,7 +653,8 @@ env_vars.Add(
Brad Bishop316dfdd2018-06-25 12:45:53 -040025 )
26
27 env_vars.Add('CC',
28- help='Select the C compiler to use')
29+ help='Select the C compiler to use',
30+ default=os.getenv('CC'))
31
32 env_vars.Add('CCFLAGS',
33 help='Sets flags for the C and C++ compiler',
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080034@@ -672,7 +674,8 @@ env_vars.Add('CPPPATH',
Brad Bishop316dfdd2018-06-25 12:45:53 -040035 converter=variable_shlex_converter)
36
37 env_vars.Add('CXX',
38- help='Select the C++ compiler to use')
39+ help='Select the C++ compiler to use',
40+ default=os.getenv('CXX'))
41
42 env_vars.Add('CXXFLAGS',
43 help='Sets flags for the C++ compiler',
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080044@@ -961,6 +964,7 @@ envDict = dict(BUILD_ROOT=buildDir,
Brad Bishop316dfdd2018-06-25 12:45:53 -040045 )
46
47 env = Environment(variables=env_vars, **envDict)
48+env.PrependENVPath('PATH', os.getenv('PATH'))
49 del envDict
50
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080051 env.AddMethod(mongo_platform.env_os_is_wrapper, 'TargetOSIs')
Brad Bishop316dfdd2018-06-25 12:45:53 -040052Index: git/src/mongo/util/SConscript
53===================================================================
54--- git.orig/src/mongo/util/SConscript
55+++ git/src/mongo/util/SConscript
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080056@@ -329,6 +329,8 @@ if env['MONGO_ALLOCATOR'] == 'tcmalloc':
Brad Bishop316dfdd2018-06-25 12:45:53 -040057 'MONGO_HAVE_GPERFTOOLS_SIZE_CLASS_STATS'
58 ]
59 )
60+ if not use_system_version_of_library('valgrind'):
61+ tcmspEnv.InjectThirdPartyIncludePaths('valgrind')
62
63 if not use_system_version_of_library('valgrind'):
64 # Include valgrind since tcmalloc disables itself while running under valgrind