I have a small diff but I am waiting for legal to let me know whether I can share that so I will describe the change. I am building MongoDB with a compiler and library toolchain that works "in production" so I don't want to use the default locations for libraries and include files. I ended up needing two options in the top-level SConstruct to make this work:
1) --dont-add-local-paths - this changes MongoDB to not add local paths. For example, I want to keep this from being added for 64-bit linux:
env.Append( EXTRALIBPATH=["/usr/lib64" , "/lib64" ] )
2) --linkflags - values here get appended to LINKFLAGS. I used this to add extra flags and libraries to link with jemalloc. I ended up using ":" as the option separator because options already use "," and the following is an example of a value I used:
--linkflags="-Wl,--whole-archive /path/to/libjemalloc.a:-Wl,--no-whole-archive"
I can also use this to set rpath options, although I don't need to do that yet we do that for other binaries like mysqld...
--linkflags="--enable-new-dtags:-Wl,-rpath=/path/to/production/lib"
- is depended on by
-
SERVER-16791 Improve architecture detection in scons and deprecate --64/--32
- Closed
-
CXX-286 Support additional custom compiler and linker options when invoking scons (e.g. rpath)
- Closed
- related to
-
SERVER-9554 Use SCons Variables or similar instead of per flag Options.
- Closed