diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2013-08-18 00:58:04 +0200 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2013-08-18 00:58:04 +0200 |
commit | 4a9a8f3f48f7820cff2964489f09a34160b1671b (patch) | |
tree | 417244fb281fca8d19efcbbae5fa6d371ff89ba4 /src/leveldb/build_detect_platform | |
parent | 317f57ec87da566ee2ae648853a9105a4136efef (diff) | |
parent | 84d6d69fc69662b2709fffbeaf3c3b4f53c535b1 (diff) |
Merge commit '84d6d69fc69662b2709fffbeaf3c3b4f53c535b1'
Diffstat (limited to 'src/leveldb/build_detect_platform')
-rwxr-xr-x | src/leveldb/build_detect_platform | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/leveldb/build_detect_platform b/src/leveldb/build_detect_platform index a3ad057eee..bdfd64172c 100755 --- a/src/leveldb/build_detect_platform +++ b/src/leveldb/build_detect_platform @@ -44,6 +44,10 @@ if test -z "$CXX"; then CXX=g++ fi +if test -z "$TMPDIR"; then + TMPDIR=/tmp +fi + # Detect OS if test -z "$TARGET_OS"; then TARGET_OS=`uname -s` @@ -169,8 +173,10 @@ if [ "$CROSS_COMPILE" = "true" ]; then # Cross-compiling; do not try any compilation tests. true else + CXXOUTPUT="${TMPDIR}/leveldb_build_detect_platform-cxx.$$" + # If -std=c++0x works, use <cstdatomic>. Otherwise use port_posix.h. - $CXX $CXXFLAGS -std=c++0x -x c++ - -o /dev/null 2>/dev/null <<EOF + $CXX $CXXFLAGS -std=c++0x -x c++ - -o $CXXOUTPUT 2>/dev/null <<EOF #include <cstdatomic> int main() {} EOF @@ -182,12 +188,14 @@ EOF fi # Test whether tcmalloc is available - $CXX $CXXFLAGS -x c++ - -o /dev/null -ltcmalloc 2>/dev/null <<EOF + $CXX $CXXFLAGS -x c++ - -o $CXXOUTPUT -ltcmalloc 2>/dev/null <<EOF int main() {} EOF if [ "$?" = 0 ]; then PLATFORM_LIBS="$PLATFORM_LIBS -ltcmalloc" fi + + rm -f $CXXOUTPUT 2>/dev/null fi PLATFORM_CCFLAGS="$PLATFORM_CCFLAGS $COMMON_FLAGS" |