diff -Naur mongo-cxx-driver-legacy-0.0-26compat-2.6.3/SConstruct mongo-cxx-driver-legacy-0.0-26compat-2.6.3-lunar/SConstruct
--- mongo-cxx-driver-legacy-0.0-26compat-2.6.3/SConstruct	2014-07-08 00:33:06.000000000 +0200
+++ mongo-cxx-driver-legacy-0.0-26compat-2.6.3-lunar/SConstruct	2014-07-28 19:07:20.815997774 +0200
@@ -834,7 +834,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=["-fPIC",
                          "-fno-strict-aliasing",
-                         "-ggdb",
                          "-pthread",
                          "-Wall",
                          "-Wsign-compare",
@@ -842,13 +841,13 @@
                          "-Winvalid-pch"] )
     # env.Append( " -Wconversion" ) TODO: this doesn't really work yet
     if linux or darwin:
-        env.Append( CCFLAGS=["-pipe"] )
         if not has_option("disable-warnings-as-errors"):
             env.Append( CCFLAGS=["-Werror"] )
 
     env.Append( CPPDEFINES=["_FILE_OFFSET_BITS=64"] )
-    env.Append( CXXFLAGS=["-Wnon-virtual-dtor", "-Woverloaded-virtual"] )
     env.Append( LINKFLAGS=["-fPIC", "-pthread"] )
+    env.Append( CXXFLAGS=os.environ['CXXFLAGS'] )
+    env.Append( LINKFLAGS=os.environ['LDFLAGS'] )
 
     # SERVER-9761: Ensure early detection of missing symbols in dependent libraries at program
     # startup.
