summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
authorAndrew Morrow <acm@10gen.com>2013-06-13 11:07:34 -0400
committerAndrew Morrow <acm@10gen.com>2013-06-13 17:02:51 -0400
commit58f82cf66d180a595c9e6801667c569c6d0eed98 (patch)
treea23d080b854db0b2f3b120e5b88d8f4676deda34 /SConstruct
parent71544f212f797826cb46d2702bb802942e3de4b9 (diff)
downloadmongo-58f82cf66d180a595c9e6801667c569c6d0eed98.tar.gz
SERVER-9890 Force the use of gnulink on solaris, since we always link through the compiler
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct15
1 files changed, 15 insertions, 0 deletions
diff --git a/SConstruct b/SConstruct
index 066a018d837..53cec1b5ea8 100644
--- a/SConstruct
+++ b/SConstruct
@@ -348,6 +348,21 @@ env = Environment( BUILD_DIR=variantDir,
CONFIGURELOG = '#' + scons_data_dir + '/config.log'
)
+# This could be 'if solaris', but unfortuantely that variable hasn't been set yet.
+if "sunos5" == os.sys.platform:
+ # SERVER-9890: On Solaris, SCons preferentially loads the sun linker tool 'sunlink' when
+ # using the 'default' tools as we do above. The sunlink tool sets -G as the flag for
+ # creating a shared library. But we don't want that, since we always drive our link step
+ # through CC or CXX. Instead, we want to let the compiler map GCC's '-shared' flag to the
+ # appropriate linker specs that it has compiled in. We could (and should in the future)
+ # select an empty set of tools above and then enable them as appropriate on a per platform
+ # basis. Until then the simplest solution, as discussed on the scons-users mailing list,
+ # appears to be to simply explicitly run the 'gnulink' tool to overwrite the Environment
+ # changes made by 'sunlink'. See the following thread for more detail:
+ # http://four.pairlist.net/pipermail/scons-users/2013-June/001486.html
+ env.Tool('gnulink')
+
+
if has_option("propagate-shell-environment"):
env['ENV'] = dict(os.environ);