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:
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...