summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Morrow <acm@mongodb.com>2017-02-26 18:06:46 -0500
committerAndrew Morrow <acm@mongodb.com>2017-05-01 11:03:05 -0400
commitc607ba44abf6bd2e0b32e778eb1f009c105ef7d6 (patch)
treedaae6ec2c0af0f0559d329e814a47dcd368044f9
parentcd517dc32530d347dc48f1ffc6345f461a77b06f (diff)
downloadmongo-c607ba44abf6bd2e0b32e778eb1f009c105ef7d6.tar.gz
SERVER-27682 Use variables files to configure toolchains
(cherry picked from commit 4052dc6ee87489d8f9d0b785680ea6e1568db496) Only the toolchain variables files for GCC and Clang were taken (cherry picked from commit b664f75368adcb7b2b123b3c853e129af0891143)
-rw-r--r--etc/scons/mongodbtoolchain_clang.vars22
-rw-r--r--etc/scons/mongodbtoolchain_gcc.vars22
2 files changed, 44 insertions, 0 deletions
diff --git a/etc/scons/mongodbtoolchain_clang.vars b/etc/scons/mongodbtoolchain_clang.vars
new file mode 100644
index 00000000000..791a44745ca
--- /dev/null
+++ b/etc/scons/mongodbtoolchain_clang.vars
@@ -0,0 +1,22 @@
+# Configures the build to use the Clang toolchain in /opt/mongodbtoolchain/v2
+
+import os
+import SCons.Defaults
+
+# Get the default SCons path as a list
+default_path = SCons.Defaults.DefaultEnvironment()['ENV']['PATH'].split(os.pathsep)
+
+# Put the toolchain path first so we prefer all tools from there in subprocs.
+ENV = {
+ 'PATH' : os.pathsep.join(['/opt/mongodbtoolchain/v2/bin'] + default_path)
+}
+
+# Set any Variables for Tools from the toolchain here. Technically, we
+# shouldn't need the full paths since SCons will find the toolchain
+# ones first, but we don't want to accidentally get the system version
+# if, say, the toolchain is missing. Also, it is clearer that we are
+# getting the right toolchain in build log output when the path is
+# printed for each compiler invocation.
+CC = '/opt/mongodbtoolchain/v2/bin/clang'
+CXX = '/opt/mongodbtoolchain/v2/bin/clang++'
+OBJCOPY = '/opt/mongodbtoolchain/v2/bin/objcopy'
diff --git a/etc/scons/mongodbtoolchain_gcc.vars b/etc/scons/mongodbtoolchain_gcc.vars
new file mode 100644
index 00000000000..061665d7d69
--- /dev/null
+++ b/etc/scons/mongodbtoolchain_gcc.vars
@@ -0,0 +1,22 @@
+# Configures the build to use the GCC toolchain in /opt/mongodbtoolchain/v2
+
+import os
+import SCons.Defaults
+
+# Get the default SCons path as a list
+default_path = SCons.Defaults.DefaultEnvironment()['ENV']['PATH'].split(os.pathsep)
+
+# Put the toolchain path first so we prefer all tools from there in subprocs
+ENV = {
+ 'PATH' : os.pathsep.join(['/opt/mongodbtoolchain/v2/bin'] + default_path)
+}
+
+# Set any Variables for Tools from the toolchain here. Technically, we
+# shouldn't need the full paths since SCons will find the toolchain
+# ones first, but we don't want to accidentally get the system version
+# if, say, the toolchain is missing. Also, it is clearer that we are
+# getting the right toolchain in build log output when the path is
+# printed for each compiler invocation.
+CC = '/opt/mongodbtoolchain/v2/bin/gcc'
+CXX = '/opt/mongodbtoolchain/v2/bin/g++'
+OBJCOPY = '/opt/mongodbtoolchain/v2/bin/objcopy'