--- mongodb-src-r3.4.2/SConstruct	2017-02-01 20:00:25.000000000 +0100
+++ mongodb-src-r3.4.2-lunar/SConstruct	2017-02-19 19:17:33.934656017 +0100
@@ -889,6 +889,7 @@
                INTEGRATION_TEST_LIST='$BUILD_ROOT/integration_tests.txt',
                CONFIGUREDIR=sconsDataDir.Dir('sconf_temp'),
                CONFIGURELOG=sconsDataDir.File('config.log'),
+	       ENV=os.environ,
                INSTALL_DIR=installDir,
                CONFIG_HEADER_DEFINES={},
                LIBDEPS_TAG_EXPANSIONS=[],
@@ -1557,7 +1558,6 @@
     # -Winvalid-pch Warn if a precompiled header (see Precompiled Headers) is found in the search path but can't be used.
     env.Append( CCFLAGS=["-fno-omit-frame-pointer",
                          "-fno-strict-aliasing",
-                         "-ggdb",
                          "-pthread",
                          "-Wall",
                          "-Wsign-compare",
@@ -1568,7 +1568,9 @@
         if not has_option("disable-warnings-as-errors"):
             env.Append( CCFLAGS=["-Werror"] )
 
+    env.Append( CXXFLAGS=os.environ['CXXFLAGS'] )
     env.Append( CXXFLAGS=["-Woverloaded-virtual"] )
+    env.Append( LINKFLAGS=os.environ['LDFLAGS'] )
     env.Append( LINKFLAGS=["-pthread"] )
 
     # SERVER-9761: Ensure early detection of missing symbols in dependent libraries at program
