--- a/SConstruct 2012-02-27 01:44:09.000000000 +0100 +++ b/SConstruct 2012-02-29 12:19:27.806016101 +0100 @@ -700,7 +700,7 @@ env["CXX"] = "distcc " + env["CXX"] # -Winvalid-pch Warn if a precompiled header (see Precompiled Headers) is found in the search path but can't be used. - env.Append( CPPFLAGS="-fPIC -fno-strict-aliasing -ggdb -pthread -Wall -Wsign-compare -Wno-unknown-pragmas -Winvalid-pch" ) + env.Append( CPPFLAGS="-fPIC -fno-strict-aliasing -pthread -Wall -Wsign-compare -Wno-unknown-pragmas -Winvalid-pch" ) # env.Append( " -Wconversion" ) TODO: this doesn't really work yet if linux: env.Append( CPPFLAGS=" -Werror " ) @@ -708,7 +708,9 @@ env.Append( CPPFLAGS=" -fno-builtin-memcmp " ) # glibc's memcmp is faster than gcc's env.Append( CPPDEFINES="_FILE_OFFSET_BITS=64" ) + env.Append( CXXFLAGS=os.environ['CXXFLAGS']) env.Append( CXXFLAGS=" -Wnon-virtual-dtor " ) + env.Append( LINKFLAGS=os.environ['LDFLAGS'] ) env.Append( LINKFLAGS=" -fPIC -pthread -rdynamic" ) env.Append( LIBS=[] ) @@ -718,12 +720,13 @@ if linux and has_option( "sharedclient" ): env.Append( LINKFLAGS=" -Wl,--as-needed -Wl,-zdefs " ) + env.Append( SHLINKFLAGS=" -Wl,-soname=libmongoclient.so " ) if debugBuild: env.Append( CPPFLAGS=" -O0 -fstack-protector " ); env['ENV']['GLIBCXX_FORCE_NEW'] = 1; # play nice with valgrind else: - env.Append( CPPFLAGS=" -O3 " ) + env.Append( CXXFLAGS=" -O3 " ) #env.Append( CPPFLAGS=" -fprofile-generate" ) #env.Append( LINKFLAGS=" -fprofile-generate" ) # then: @@ -827,14 +830,16 @@ binaries = ['python2.5', 'python2.6', 'python2.7', 'python25', 'python26', 'python27', 'python'] for binary in binaries: try: - # py-2.4 compatible replacement for shell backticks - out, err = subprocess.Popen([binary, '-V'], stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() - for stream in (out, err): - match = version.search(stream) - if match: - versiontuple = tuple(map(int, match.group(1).split('.'))) - if versiontuple >= (2, 5): - return binary + for path in smokeEnv['ENV']['PATH'].split(':'): + if os.path.isfile( '%s/%s' % (path, binary) ): + # py-2.4 compatible replacement for shell backticks + out, err = subprocess.Popen([binary, '-V'], stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() + for stream in (out, err): + match = version.search(stream) + if match: + versiontuple = tuple(map(int, match.group(1).split('.'))) + if versiontuple >= (2, 5): + return binary except: pass # if that all fails, fall back to "python"