diff -urpN leveldb-1.15.0.orig/build_detect_platform leveldb-1.15.0/build_detect_platform --- leveldb-1.15.0.orig/build_detect_platform 2014-03-24 19:08:03.861562520 -0700 +++ leveldb-1.15.0/build_detect_platform 2014-03-24 19:09:21.064911973 -0700 @@ -170,13 +170,18 @@ if [ "$CROSS_COMPILE" = "true" ]; then true else CXXOUTPUT="${TMPDIR}/leveldb_build_detect_platform-cxx.$$" - + if [ "${USE_CXX0X:-auto}" = "auto" ]; then # If -std=c++0x works, use . Otherwise use port_posix.h. $CXX $CXXFLAGS -std=c++0x -x c++ - -o $CXXOUTPUT 2>/dev/null < int main() {} EOF if [ "$?" = 0 ]; then + USE_CXX0X="yes" + fi + fi + + if [ "$USE_CXX0X" = "yes" ]; then COMMON_FLAGS="$COMMON_FLAGS -DLEVELDB_PLATFORM_POSIX -DLEVELDB_CSTDATOMIC_PRESENT" PLATFORM_CXXFLAGS="-std=c++0x" else @@ -185,20 +190,32 @@ EOF # Test whether Snappy library is installed # http://code.google.com/p/snappy/ + if [ "${USE_SNAPPY:-auto}" = "auto" ]; then $CXX $CXXFLAGS -x c++ - -o $CXXOUTPUT 2>/dev/null < int main() {} EOF if [ "$?" = 0 ]; then + USE_SNAPPY="yes" + fi + fi + + if [ "$USE_SNAPPY" = "yes" ]; then COMMON_FLAGS="$COMMON_FLAGS -DSNAPPY" PLATFORM_LIBS="$PLATFORM_LIBS -lsnappy" fi # Test whether tcmalloc is available + if [ "${USE_TCMALLOC:-auto}" = "auto" ]; then $CXX $CXXFLAGS -x c++ - -o $CXXOUTPUT -ltcmalloc 2>/dev/null <