Skip to content

Commit

Permalink
SERVER-27682 Use variables files to configure toolchains
Browse files Browse the repository at this point in the history
(cherry picked from commit 4052dc6)

Only the toolchain variables files for GCC and Clang were taken

(cherry picked from commit b664f75)
  • Loading branch information
acmorrow committed May 1, 2017
1 parent cd517dc commit c607ba4
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
22 changes: 22 additions & 0 deletions etc/scons/mongodbtoolchain_clang.vars
Original file line number Diff line number Diff line change
@@ -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'
22 changes: 22 additions & 0 deletions etc/scons/mongodbtoolchain_gcc.vars
Original file line number Diff line number Diff line change
@@ -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'

0 comments on commit c607ba4

Please sign in to comment.