summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
authorAndrew Morrow <acm@mongodb.com>2018-03-03 08:08:08 -0500
committerAndrew Morrow <acm@mongodb.com>2018-03-06 09:57:57 -0500
commit5dfa372b25b1a26bb12e09fdb029ff219b0f5343 (patch)
tree2c23324cb72eae116c4a03a72141d0a9716884d8 /SConstruct
parent80625c63d47a1d9306958d7ea95154d12c10cade (diff)
downloadmongo-5dfa372b25b1a26bb12e09fdb029ff219b0f5343.tar.gz
SERVER-32117 Minimal hygienic build to support mobile dev
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct35
1 files changed, 35 insertions, 0 deletions
diff --git a/SConstruct b/SConstruct
index a16d9aaa967..c32932bfe32 100644
--- a/SConstruct
+++ b/SConstruct
@@ -96,6 +96,14 @@ add_option('prefix',
help='installation prefix',
)
+add_option('install-mode',
+ choices=['legacy', 'hygienic'],
+ default='legacy',
+ help='select type of installation',
+ nargs=1,
+ type='choice',
+)
+
add_option('nostrip',
help='do not strip installed binaries',
nargs=0,
@@ -3151,6 +3159,33 @@ def doConfigure(myenv):
env = doConfigure( env )
+# TODO: Later, this should live somewhere more graceful.
+if get_option('install-mode') == 'hygienic':
+ env.Tool('auto_install_binaries')
+ if env['PLATFORM'] == 'posix':
+ env.AppendUnique(
+ RPATH=[
+ env.Literal('\\$$ORIGIN/../lib')
+ ],
+ LINKFLAGS=[
+ '-Wl,-z,origin',
+ '-Wl,--enable-new-dtags',
+ ],
+ SHLINKFLAGS=[
+ # -h works for both the sun linker and the gnu linker.
+ "-Wl,-h,${TARGET.file}",
+ ]
+ )
+ elif env['PLATFORM'] == 'darwin':
+ env.AppendUnique(
+ LINKFLAGS=[
+ '-Wl,-rpath,@loader_path/../lib'
+ ],
+ SHLINKFLAGS=[
+ "-Wl,-install_name,@loader_path/../lib/${TARGET.file}",
+ ],
+ )
+
# Now that we are done with configure checks, enable icecream, if available.
env.Tool('icecream')