|
Lines 170-182
if [ "$CROSS_COMPILE" = "true" ]; then
Link Here
|
| 170 |
true |
170 |
true |
| 171 |
else |
171 |
else |
| 172 |
CXXOUTPUT="${TMPDIR}/leveldb_build_detect_platform-cxx.$$" |
172 |
CXXOUTPUT="${TMPDIR}/leveldb_build_detect_platform-cxx.$$" |
| 173 |
|
173 |
if [ "${USE_CXX0X:-auto}" = "auto" ]; then |
| 174 |
# If -std=c++0x works, use <cstdatomic>. Otherwise use port_posix.h. |
174 |
# If -std=c++0x works, use <cstdatomic>. Otherwise use port_posix.h. |
| 175 |
$CXX $CXXFLAGS -std=c++0x -x c++ - -o $CXXOUTPUT 2>/dev/null <<EOF |
175 |
$CXX $CXXFLAGS -std=c++0x -x c++ - -o $CXXOUTPUT 2>/dev/null <<EOF |
| 176 |
#include <cstdatomic> |
176 |
#include <cstdatomic> |
| 177 |
int main() {} |
177 |
int main() {} |
| 178 |
EOF |
178 |
EOF |
| 179 |
if [ "$?" = 0 ]; then |
179 |
if [ "$?" = 0 ]; then |
|
|
180 |
USE_CXX0X="yes" |
| 181 |
fi |
| 182 |
fi |
| 183 |
|
| 184 |
if [ "$USE_CXX0X" = "yes" ]; then |
| 180 |
COMMON_FLAGS="$COMMON_FLAGS -DLEVELDB_PLATFORM_POSIX -DLEVELDB_CSTDATOMIC_PRESENT" |
185 |
COMMON_FLAGS="$COMMON_FLAGS -DLEVELDB_PLATFORM_POSIX -DLEVELDB_CSTDATOMIC_PRESENT" |
| 181 |
PLATFORM_CXXFLAGS="-std=c++0x" |
186 |
PLATFORM_CXXFLAGS="-std=c++0x" |
| 182 |
else |
187 |
else |
|
Lines 185-204
EOF
Link Here
|
| 185 |
|
190 |
|
| 186 |
# Test whether Snappy library is installed |
191 |
# Test whether Snappy library is installed |
| 187 |
# http://code.google.com/p/snappy/ |
192 |
# http://code.google.com/p/snappy/ |
|
|
193 |
if [ "${USE_SNAPPY:-auto}" = "auto" ]; then |
| 188 |
$CXX $CXXFLAGS -x c++ - -o $CXXOUTPUT 2>/dev/null <<EOF |
194 |
$CXX $CXXFLAGS -x c++ - -o $CXXOUTPUT 2>/dev/null <<EOF |
| 189 |
#include <snappy.h> |
195 |
#include <snappy.h> |
| 190 |
int main() {} |
196 |
int main() {} |
| 191 |
EOF |
197 |
EOF |
| 192 |
if [ "$?" = 0 ]; then |
198 |
if [ "$?" = 0 ]; then |
|
|
199 |
USE_SNAPPY="yes" |
| 200 |
fi |
| 201 |
fi |
| 202 |
|
| 203 |
if [ "$USE_SNAPPY" = "yes" ]; then |
| 193 |
COMMON_FLAGS="$COMMON_FLAGS -DSNAPPY" |
204 |
COMMON_FLAGS="$COMMON_FLAGS -DSNAPPY" |
| 194 |
PLATFORM_LIBS="$PLATFORM_LIBS -lsnappy" |
205 |
PLATFORM_LIBS="$PLATFORM_LIBS -lsnappy" |
| 195 |
fi |
206 |
fi |
| 196 |
|
207 |
|
| 197 |
# Test whether tcmalloc is available |
208 |
# Test whether tcmalloc is available |
|
|
209 |
if [ "${USE_TCMALLOC:-auto}" = "auto" ]; then |
| 198 |
$CXX $CXXFLAGS -x c++ - -o $CXXOUTPUT -ltcmalloc 2>/dev/null <<EOF |
210 |
$CXX $CXXFLAGS -x c++ - -o $CXXOUTPUT -ltcmalloc 2>/dev/null <<EOF |
| 199 |
int main() {} |
211 |
int main() {} |
| 200 |
EOF |
212 |
EOF |
| 201 |
if [ "$?" = 0 ]; then |
213 |
if [ "$?" = 0 ]; then |
|
|
214 |
USE_TCMALLOC="yes" |
| 215 |
fi |
| 216 |
fi |
| 217 |
|
| 218 |
if [ "$USE_TCMALLOC" = "yes" ]; then |
| 202 |
PLATFORM_LIBS="$PLATFORM_LIBS -ltcmalloc" |
219 |
PLATFORM_LIBS="$PLATFORM_LIBS -ltcmalloc" |
| 203 |
fi |
220 |
fi |
| 204 |
|
221 |
|