summaryrefslogtreecommitdiff
blob: d25fe01f68352606941dd330bbaeec51637ab16a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
diff --git a/build_detect_platform b/build_detect_platform
index 5801d20..4b4bb0d 100755
--- a/build_detect_platform
+++ b/build_detect_platform
@@ -169,20 +169,30 @@ EOF
 
     # Test whether Snappy library is installed
     # http://code.google.com/p/snappy/
+if [ "${USE_SNAPPY:-auto}" = "auto" ]; then
     $CXX $CXXFLAGS -x c++ - -o /dev/null 2>/dev/null  <<EOF
       #include <snappy.h>
       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 /dev/null -ltcmalloc 2>/dev/null  <<EOF
       int main() {}
 EOF
     if [ "$?" = 0 ]; then
+        USE_TCMALLOC="yes"
+    fi
+fi
+    if [ "$USE_TCMALLOC" = "yes" ]; then
         PLATFORM_LIBS="$PLATFORM_LIBS -ltcmalloc"
     fi
 fi