aboutsummaryrefslogtreecommitdiff
path: root/src/leveldb/build_detect_platform
diff options
context:
space:
mode:
authorGregory Maxwell <greg@xiph.org>2013-08-17 17:05:19 -0700
committerGregory Maxwell <greg@xiph.org>2013-08-17 17:05:19 -0700
commit4bc9a192696273c88966c39debf8d17f16ebe471 (patch)
tree417244fb281fca8d19efcbbae5fa6d371ff89ba4 /src/leveldb/build_detect_platform
parent317f57ec87da566ee2ae648853a9105a4136efef (diff)
parent4a9a8f3f48f7820cff2964489f09a34160b1671b (diff)
downloadbitcoin-4bc9a192696273c88966c39debf8d17f16ebe471.tar.xz
Merge pull request #2907 from sipa/leveldb-noripple
Switch to cleaned-up LevelDB 1.12 branch.
Diffstat (limited to 'src/leveldb/build_detect_platform')
-rwxr-xr-xsrc/leveldb/build_detect_platform12
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"