summaryrefslogtreecommitdiff
blob: ba30fc731ad5449b561b85729c4d0a759d532dc8 (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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
we'll handle configure ourselves in src_configure

--- a/Makefile
+++ b/Makefile
@@ -14,9 +14,6 @@ OPT ?= -O2 -DNDEBUG
 # OPT ?= -O2 -g2 -DNDEBUG
 #-----------------------------------------------
 
-# detect what platform we're building on
-$(shell CC="$(CC)" CXX="$(CXX)" TARGET_OS="$(TARGET_OS)" \
-    ./build_detect_platform build_config.mk ./)
 # this file is generated by the previous line to set build flags and sources
 include build_config.mk
 

control snappy/tcmalloc explicitly

--- a/build_detect_platform
+++ a/build_detect_platform
@@ -190,6 +190,7 @@
         COMMON_FLAGS="$COMMON_FLAGS -DLEVELDB_PLATFORM_POSIX"
     fi
 
+if [ "${USE_SNAPPY:-auto}" = "auto" ]; then
     # Test whether Snappy library is installed
     # http://code.google.com/p/snappy/
     $CXX $CXXFLAGS -x c++ - -o $CXXOUTPUT 2>/dev/null  <<EOF
@@ -197,15 +198,24 @@
       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
 
+if [ "${USE_TCMALLOC:-auto}" = "auto" ]; then
     # Test whether tcmalloc is available
     $CXX $CXXFLAGS -x c++ - -o $CXXOUTPUT -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