作者: 谢瑞阳 10225101483 徐翔宇 10225101535
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

256 satır
8.3 KiB

Release 1.18 Changes are: * Update version number to 1.18 * Replace the basic fprintf call with a call to fwrite in order to work around the apparent compiler optimization/rewrite failure that we are seeing with the new toolchain/iOS SDKs provided with Xcode6 and iOS8. * Fix ALL the header guards. * Createed a README.md with the LevelDB project description. * A new CONTRIBUTING file. * Don't implicitly convert uint64_t to size_t or int. Either preserve it as uint64_t, or explicitly cast. This fixes MSVC warnings about possible value truncation when compiling this code in Chromium. * Added a DumpFile() library function that encapsulates the guts of the "leveldbutil dump" command. This will allow clients to dump data to their log files instead of stdout. It will also allow clients to supply their own environment. * leveldb: Remove unused function 'ConsumeChar'. * leveldbutil: Remove unused member variables from WriteBatchItemPrinter. * OpenBSD, NetBSD and DragonflyBSD have _LITTLE_ENDIAN, so define PLATFORM_IS_LITTLE_ENDIAN like on FreeBSD. This fixes: * issue #143 * issue #198 * issue #249 * Switch from <cstdatomic> to <atomic>. The former never made it into the standard and doesn't exist in modern gcc versions at all. The later contains everything that leveldb was using from the former. This problem was noticed when porting to Portable Native Client where no memory barrier is defined. The fact that <cstdatomic> is missing normally goes unnoticed since memory barriers are defined for most architectures. * Make Hash() treat its input as unsigned. Before this change LevelDB files from platforms with different signedness of char were not compatible. This change fixes: issue #243 * Verify checksums of index/meta/filter blocks when paranoid_checks set. * Invoke all tools for iOS with xcrun. (This was causing problems with the new XCode 5.1.1 image on pulse.) * include <sys/stat.h> only once, and fix the following linter warning: "Found C system header after C++ system header" * When encountering a corrupted table file, return Status::Corruption instead of Status::InvalidArgument. * Support cygwin as build platform, patch is from https://code.google.com/p/leveldb/issues/detail?id=188 * Fix typo, merge patch from https://code.google.com/p/leveldb/issues/detail?id=159 * Fix typos and comments, and address the following two issues: * issue #166 * issue #241 * Add missing db synchronize after "fillseq" in the benchmark. * Removed unused variable in SeekRandom: value (issue #201)
10 yıl önce
Release 1.18 Changes are: * Update version number to 1.18 * Replace the basic fprintf call with a call to fwrite in order to work around the apparent compiler optimization/rewrite failure that we are seeing with the new toolchain/iOS SDKs provided with Xcode6 and iOS8. * Fix ALL the header guards. * Createed a README.md with the LevelDB project description. * A new CONTRIBUTING file. * Don't implicitly convert uint64_t to size_t or int. Either preserve it as uint64_t, or explicitly cast. This fixes MSVC warnings about possible value truncation when compiling this code in Chromium. * Added a DumpFile() library function that encapsulates the guts of the "leveldbutil dump" command. This will allow clients to dump data to their log files instead of stdout. It will also allow clients to supply their own environment. * leveldb: Remove unused function 'ConsumeChar'. * leveldbutil: Remove unused member variables from WriteBatchItemPrinter. * OpenBSD, NetBSD and DragonflyBSD have _LITTLE_ENDIAN, so define PLATFORM_IS_LITTLE_ENDIAN like on FreeBSD. This fixes: * issue #143 * issue #198 * issue #249 * Switch from <cstdatomic> to <atomic>. The former never made it into the standard and doesn't exist in modern gcc versions at all. The later contains everything that leveldb was using from the former. This problem was noticed when porting to Portable Native Client where no memory barrier is defined. The fact that <cstdatomic> is missing normally goes unnoticed since memory barriers are defined for most architectures. * Make Hash() treat its input as unsigned. Before this change LevelDB files from platforms with different signedness of char were not compatible. This change fixes: issue #243 * Verify checksums of index/meta/filter blocks when paranoid_checks set. * Invoke all tools for iOS with xcrun. (This was causing problems with the new XCode 5.1.1 image on pulse.) * include <sys/stat.h> only once, and fix the following linter warning: "Found C system header after C++ system header" * When encountering a corrupted table file, return Status::Corruption instead of Status::InvalidArgument. * Support cygwin as build platform, patch is from https://code.google.com/p/leveldb/issues/detail?id=188 * Fix typo, merge patch from https://code.google.com/p/leveldb/issues/detail?id=159 * Fix typos and comments, and address the following two issues: * issue #166 * issue #241 * Add missing db synchronize after "fillseq" in the benchmark. * Removed unused variable in SeekRandom: value (issue #201)
10 yıl önce
Release 1.18 Changes are: * Update version number to 1.18 * Replace the basic fprintf call with a call to fwrite in order to work around the apparent compiler optimization/rewrite failure that we are seeing with the new toolchain/iOS SDKs provided with Xcode6 and iOS8. * Fix ALL the header guards. * Createed a README.md with the LevelDB project description. * A new CONTRIBUTING file. * Don't implicitly convert uint64_t to size_t or int. Either preserve it as uint64_t, or explicitly cast. This fixes MSVC warnings about possible value truncation when compiling this code in Chromium. * Added a DumpFile() library function that encapsulates the guts of the "leveldbutil dump" command. This will allow clients to dump data to their log files instead of stdout. It will also allow clients to supply their own environment. * leveldb: Remove unused function 'ConsumeChar'. * leveldbutil: Remove unused member variables from WriteBatchItemPrinter. * OpenBSD, NetBSD and DragonflyBSD have _LITTLE_ENDIAN, so define PLATFORM_IS_LITTLE_ENDIAN like on FreeBSD. This fixes: * issue #143 * issue #198 * issue #249 * Switch from <cstdatomic> to <atomic>. The former never made it into the standard and doesn't exist in modern gcc versions at all. The later contains everything that leveldb was using from the former. This problem was noticed when porting to Portable Native Client where no memory barrier is defined. The fact that <cstdatomic> is missing normally goes unnoticed since memory barriers are defined for most architectures. * Make Hash() treat its input as unsigned. Before this change LevelDB files from platforms with different signedness of char were not compatible. This change fixes: issue #243 * Verify checksums of index/meta/filter blocks when paranoid_checks set. * Invoke all tools for iOS with xcrun. (This was causing problems with the new XCode 5.1.1 image on pulse.) * include <sys/stat.h> only once, and fix the following linter warning: "Found C system header after C++ system header" * When encountering a corrupted table file, return Status::Corruption instead of Status::InvalidArgument. * Support cygwin as build platform, patch is from https://code.google.com/p/leveldb/issues/detail?id=188 * Fix typo, merge patch from https://code.google.com/p/leveldb/issues/detail?id=159 * Fix typos and comments, and address the following two issues: * issue #166 * issue #241 * Add missing db synchronize after "fillseq" in the benchmark. * Removed unused variable in SeekRandom: value (issue #201)
10 yıl önce
Release 1.18 Changes are: * Update version number to 1.18 * Replace the basic fprintf call with a call to fwrite in order to work around the apparent compiler optimization/rewrite failure that we are seeing with the new toolchain/iOS SDKs provided with Xcode6 and iOS8. * Fix ALL the header guards. * Createed a README.md with the LevelDB project description. * A new CONTRIBUTING file. * Don't implicitly convert uint64_t to size_t or int. Either preserve it as uint64_t, or explicitly cast. This fixes MSVC warnings about possible value truncation when compiling this code in Chromium. * Added a DumpFile() library function that encapsulates the guts of the "leveldbutil dump" command. This will allow clients to dump data to their log files instead of stdout. It will also allow clients to supply their own environment. * leveldb: Remove unused function 'ConsumeChar'. * leveldbutil: Remove unused member variables from WriteBatchItemPrinter. * OpenBSD, NetBSD and DragonflyBSD have _LITTLE_ENDIAN, so define PLATFORM_IS_LITTLE_ENDIAN like on FreeBSD. This fixes: * issue #143 * issue #198 * issue #249 * Switch from <cstdatomic> to <atomic>. The former never made it into the standard and doesn't exist in modern gcc versions at all. The later contains everything that leveldb was using from the former. This problem was noticed when porting to Portable Native Client where no memory barrier is defined. The fact that <cstdatomic> is missing normally goes unnoticed since memory barriers are defined for most architectures. * Make Hash() treat its input as unsigned. Before this change LevelDB files from platforms with different signedness of char were not compatible. This change fixes: issue #243 * Verify checksums of index/meta/filter blocks when paranoid_checks set. * Invoke all tools for iOS with xcrun. (This was causing problems with the new XCode 5.1.1 image on pulse.) * include <sys/stat.h> only once, and fix the following linter warning: "Found C system header after C++ system header" * When encountering a corrupted table file, return Status::Corruption instead of Status::InvalidArgument. * Support cygwin as build platform, patch is from https://code.google.com/p/leveldb/issues/detail?id=188 * Fix typo, merge patch from https://code.google.com/p/leveldb/issues/detail?id=159 * Fix typos and comments, and address the following two issues: * issue #166 * issue #241 * Add missing db synchronize after "fillseq" in the benchmark. * Removed unused variable in SeekRandom: value (issue #201)
10 yıl önce
Release 1.18 Changes are: * Update version number to 1.18 * Replace the basic fprintf call with a call to fwrite in order to work around the apparent compiler optimization/rewrite failure that we are seeing with the new toolchain/iOS SDKs provided with Xcode6 and iOS8. * Fix ALL the header guards. * Createed a README.md with the LevelDB project description. * A new CONTRIBUTING file. * Don't implicitly convert uint64_t to size_t or int. Either preserve it as uint64_t, or explicitly cast. This fixes MSVC warnings about possible value truncation when compiling this code in Chromium. * Added a DumpFile() library function that encapsulates the guts of the "leveldbutil dump" command. This will allow clients to dump data to their log files instead of stdout. It will also allow clients to supply their own environment. * leveldb: Remove unused function 'ConsumeChar'. * leveldbutil: Remove unused member variables from WriteBatchItemPrinter. * OpenBSD, NetBSD and DragonflyBSD have _LITTLE_ENDIAN, so define PLATFORM_IS_LITTLE_ENDIAN like on FreeBSD. This fixes: * issue #143 * issue #198 * issue #249 * Switch from <cstdatomic> to <atomic>. The former never made it into the standard and doesn't exist in modern gcc versions at all. The later contains everything that leveldb was using from the former. This problem was noticed when porting to Portable Native Client where no memory barrier is defined. The fact that <cstdatomic> is missing normally goes unnoticed since memory barriers are defined for most architectures. * Make Hash() treat its input as unsigned. Before this change LevelDB files from platforms with different signedness of char were not compatible. This change fixes: issue #243 * Verify checksums of index/meta/filter blocks when paranoid_checks set. * Invoke all tools for iOS with xcrun. (This was causing problems with the new XCode 5.1.1 image on pulse.) * include <sys/stat.h> only once, and fix the following linter warning: "Found C system header after C++ system header" * When encountering a corrupted table file, return Status::Corruption instead of Status::InvalidArgument. * Support cygwin as build platform, patch is from https://code.google.com/p/leveldb/issues/detail?id=188 * Fix typo, merge patch from https://code.google.com/p/leveldb/issues/detail?id=159 * Fix typos and comments, and address the following two issues: * issue #166 * issue #241 * Add missing db synchronize after "fillseq" in the benchmark. * Removed unused variable in SeekRandom: value (issue #201)
10 yıl önce
Release 1.18 Changes are: * Update version number to 1.18 * Replace the basic fprintf call with a call to fwrite in order to work around the apparent compiler optimization/rewrite failure that we are seeing with the new toolchain/iOS SDKs provided with Xcode6 and iOS8. * Fix ALL the header guards. * Createed a README.md with the LevelDB project description. * A new CONTRIBUTING file. * Don't implicitly convert uint64_t to size_t or int. Either preserve it as uint64_t, or explicitly cast. This fixes MSVC warnings about possible value truncation when compiling this code in Chromium. * Added a DumpFile() library function that encapsulates the guts of the "leveldbutil dump" command. This will allow clients to dump data to their log files instead of stdout. It will also allow clients to supply their own environment. * leveldb: Remove unused function 'ConsumeChar'. * leveldbutil: Remove unused member variables from WriteBatchItemPrinter. * OpenBSD, NetBSD and DragonflyBSD have _LITTLE_ENDIAN, so define PLATFORM_IS_LITTLE_ENDIAN like on FreeBSD. This fixes: * issue #143 * issue #198 * issue #249 * Switch from <cstdatomic> to <atomic>. The former never made it into the standard and doesn't exist in modern gcc versions at all. The later contains everything that leveldb was using from the former. This problem was noticed when porting to Portable Native Client where no memory barrier is defined. The fact that <cstdatomic> is missing normally goes unnoticed since memory barriers are defined for most architectures. * Make Hash() treat its input as unsigned. Before this change LevelDB files from platforms with different signedness of char were not compatible. This change fixes: issue #243 * Verify checksums of index/meta/filter blocks when paranoid_checks set. * Invoke all tools for iOS with xcrun. (This was causing problems with the new XCode 5.1.1 image on pulse.) * include <sys/stat.h> only once, and fix the following linter warning: "Found C system header after C++ system header" * When encountering a corrupted table file, return Status::Corruption instead of Status::InvalidArgument. * Support cygwin as build platform, patch is from https://code.google.com/p/leveldb/issues/detail?id=188 * Fix typo, merge patch from https://code.google.com/p/leveldb/issues/detail?id=159 * Fix typos and comments, and address the following two issues: * issue #166 * issue #241 * Add missing db synchronize after "fillseq" in the benchmark. * Removed unused variable in SeekRandom: value (issue #201)
10 yıl önce
  1. #!/bin/sh
  2. #
  3. # Detects OS we're compiling on and outputs a file specified by the first
  4. # argument, which in turn gets read while processing Makefile.
  5. #
  6. # The output will set the following variables:
  7. # CC C Compiler path
  8. # CXX C++ Compiler path
  9. # PLATFORM_LDFLAGS Linker flags
  10. # PLATFORM_LIBS Libraries flags
  11. # PLATFORM_SHARED_EXT Extension for shared libraries
  12. # PLATFORM_SHARED_LDFLAGS Flags for building shared library
  13. # This flag is embedded just before the name
  14. # of the shared library without intervening spaces
  15. # PLATFORM_SHARED_CFLAGS Flags for compiling objects for shared library
  16. # PLATFORM_CCFLAGS C compiler flags
  17. # PLATFORM_CXXFLAGS C++ compiler flags. Will contain:
  18. # PLATFORM_SHARED_VERSIONED Set to 'true' if platform supports versioned
  19. # shared libraries, empty otherwise.
  20. #
  21. # The PLATFORM_CCFLAGS and PLATFORM_CXXFLAGS might include the following:
  22. #
  23. # -DLEVELDB_ATOMIC_PRESENT if <atomic> is present
  24. # -DLEVELDB_PLATFORM_POSIX for Posix-based platforms
  25. # -DSNAPPY if the Snappy library is present
  26. #
  27. OUTPUT=$1
  28. PREFIX=$2
  29. if test -z "$OUTPUT" || test -z "$PREFIX"; then
  30. echo "usage: $0 <output-filename> <directory_prefix>" >&2
  31. exit 1
  32. fi
  33. # Delete existing output, if it exists
  34. rm -f $OUTPUT
  35. touch $OUTPUT
  36. if test -z "$CC"; then
  37. CC=cc
  38. fi
  39. if test -z "$CXX"; then
  40. CXX=g++
  41. fi
  42. if test -z "$TMPDIR"; then
  43. TMPDIR=/tmp
  44. fi
  45. # Detect OS
  46. if test -z "$TARGET_OS"; then
  47. TARGET_OS=`uname -s`
  48. fi
  49. COMMON_FLAGS=
  50. CROSS_COMPILE=
  51. PLATFORM_CCFLAGS=
  52. PLATFORM_CXXFLAGS=
  53. PLATFORM_LDFLAGS=
  54. PLATFORM_LIBS=
  55. PLATFORM_SHARED_EXT="so"
  56. PLATFORM_SHARED_LDFLAGS="-shared -Wl,-soname -Wl,"
  57. PLATFORM_SHARED_CFLAGS="-fPIC"
  58. PLATFORM_SHARED_VERSIONED=true
  59. PLATFORM_SSEFLAGS=
  60. MEMCMP_FLAG=
  61. if [ "$CXX" = "g++" ]; then
  62. # Use libc's memcmp instead of GCC's memcmp. This results in ~40%
  63. # performance improvement on readrandom under gcc 4.4.3 on Linux/x86.
  64. MEMCMP_FLAG="-fno-builtin-memcmp"
  65. fi
  66. case "$TARGET_OS" in
  67. CYGWIN_*)
  68. PLATFORM=OS_LINUX
  69. COMMON_FLAGS="$MEMCMP_FLAG -lpthread -DOS_LINUX -DCYGWIN"
  70. PLATFORM_LDFLAGS="-lpthread"
  71. PORT_FILE=port/port_posix.cc
  72. PORT_SSE_FILE=port/port_posix_sse.cc
  73. ;;
  74. Darwin)
  75. PLATFORM=OS_MACOSX
  76. COMMON_FLAGS="$MEMCMP_FLAG"
  77. PLATFORM_SHARED_EXT=dylib
  78. [ -z "$INSTALL_PATH" ] && INSTALL_PATH=`pwd`
  79. PLATFORM_SHARED_LDFLAGS="-dynamiclib -install_name $INSTALL_PATH/"
  80. PORT_FILE=port/port_posix.cc
  81. PORT_SSE_FILE=port/port_posix_sse.cc
  82. ;;
  83. Linux)
  84. PLATFORM=OS_LINUX
  85. COMMON_FLAGS="$MEMCMP_FLAG -pthread -DOS_LINUX"
  86. PLATFORM_LDFLAGS="-pthread"
  87. PORT_FILE=port/port_posix.cc
  88. PORT_SSE_FILE=port/port_posix_sse.cc
  89. ;;
  90. SunOS)
  91. PLATFORM=OS_SOLARIS
  92. COMMON_FLAGS="$MEMCMP_FLAG -D_REENTRANT -DOS_SOLARIS"
  93. PLATFORM_LIBS="-lpthread -lrt"
  94. PORT_FILE=port/port_posix.cc
  95. PORT_SSE_FILE=port/port_posix_sse.cc
  96. ;;
  97. FreeBSD)
  98. PLATFORM=OS_FREEBSD
  99. COMMON_FLAGS="$MEMCMP_FLAG -D_REENTRANT -DOS_FREEBSD"
  100. PLATFORM_LIBS="-lpthread"
  101. PORT_FILE=port/port_posix.cc
  102. PORT_SSE_FILE=port/port_posix_sse.cc
  103. ;;
  104. NetBSD)
  105. PLATFORM=OS_NETBSD
  106. COMMON_FLAGS="$MEMCMP_FLAG -D_REENTRANT -DOS_NETBSD"
  107. PLATFORM_LIBS="-lpthread -lgcc_s"
  108. PORT_FILE=port/port_posix.cc
  109. PORT_SSE_FILE=port/port_posix_sse.cc
  110. ;;
  111. OpenBSD)
  112. PLATFORM=OS_OPENBSD
  113. COMMON_FLAGS="$MEMCMP_FLAG -D_REENTRANT -DOS_OPENBSD"
  114. PLATFORM_LDFLAGS="-pthread"
  115. PORT_FILE=port/port_posix.cc
  116. PORT_SSE_FILE=port/port_posix_sse.cc
  117. ;;
  118. DragonFly)
  119. PLATFORM=OS_DRAGONFLYBSD
  120. COMMON_FLAGS="$MEMCMP_FLAG -D_REENTRANT -DOS_DRAGONFLYBSD"
  121. PLATFORM_LIBS="-lpthread"
  122. PORT_FILE=port/port_posix.cc
  123. PORT_SSE_FILE=port/port_posix_sse.cc
  124. ;;
  125. OS_ANDROID_CROSSCOMPILE)
  126. PLATFORM=OS_ANDROID
  127. COMMON_FLAGS="$MEMCMP_FLAG -D_REENTRANT -DOS_ANDROID -DLEVELDB_PLATFORM_POSIX"
  128. PLATFORM_LDFLAGS="" # All pthread features are in the Android C library
  129. PORT_FILE=port/port_posix.cc
  130. PORT_SSE_FILE=port/port_posix_sse.cc
  131. CROSS_COMPILE=true
  132. ;;
  133. HP-UX)
  134. PLATFORM=OS_HPUX
  135. COMMON_FLAGS="$MEMCMP_FLAG -D_REENTRANT -DOS_HPUX"
  136. PLATFORM_LDFLAGS="-pthread"
  137. PORT_FILE=port/port_posix.cc
  138. PORT_SSE_FILE=port/port_posix_sse.cc
  139. # man ld: +h internal_name
  140. PLATFORM_SHARED_LDFLAGS="-shared -Wl,+h -Wl,"
  141. ;;
  142. IOS)
  143. PLATFORM=IOS
  144. COMMON_FLAGS="$MEMCMP_FLAG"
  145. [ -z "$INSTALL_PATH" ] && INSTALL_PATH=`pwd`
  146. PORT_FILE=port/port_posix.cc
  147. PORT_SSE_FILE=port/port_posix_sse.cc
  148. PLATFORM_SHARED_EXT=
  149. PLATFORM_SHARED_LDFLAGS=
  150. PLATFORM_SHARED_CFLAGS=
  151. PLATFORM_SHARED_VERSIONED=
  152. ;;
  153. *)
  154. echo "Unknown platform!" >&2
  155. exit 1
  156. esac
  157. # We want to make a list of all cc files within util, db, table, and helpers
  158. # except for the test and benchmark files. By default, find will output a list
  159. # of all files matching either rule, so we need to append -print to make the
  160. # prune take effect.
  161. DIRS="$PREFIX/db $PREFIX/util $PREFIX/table"
  162. set -f # temporarily disable globbing so that our patterns aren't expanded
  163. PRUNE_TEST="-name *test*.cc -prune"
  164. PRUNE_BENCH="-name *_bench.cc -prune"
  165. PRUNE_TOOL="-name leveldbutil.cc -prune"
  166. PORTABLE_FILES=`find $DIRS $PRUNE_TEST -o $PRUNE_BENCH -o $PRUNE_TOOL -o -name '*.cc' -print | sort | sed "s,^$PREFIX/,," | tr "\n" " "`
  167. set +f # re-enable globbing
  168. # The sources consist of the portable files, plus the platform-specific port
  169. # file.
  170. echo "SOURCES=$PORTABLE_FILES $PORT_FILE $PORT_SSE_FILE" >> $OUTPUT
  171. echo "MEMENV_SOURCES=helpers/memenv/memenv.cc" >> $OUTPUT
  172. if [ "$CROSS_COMPILE" = "true" ]; then
  173. # Cross-compiling; do not try any compilation tests.
  174. true
  175. else
  176. CXXOUTPUT="${TMPDIR}/leveldb_build_detect_platform-cxx.$$"
  177. # If -std=c++0x works, use <atomic> as fallback for when memory barriers
  178. # are not available.
  179. $CXX $CXXFLAGS -std=c++0x -x c++ - -o $CXXOUTPUT 2>/dev/null <<EOF
  180. #include <atomic>
  181. int main() {}
  182. EOF
  183. if [ "$?" = 0 ]; then
  184. COMMON_FLAGS="$COMMON_FLAGS -DLEVELDB_PLATFORM_POSIX -DLEVELDB_ATOMIC_PRESENT"
  185. PLATFORM_CXXFLAGS="-std=c++0x"
  186. else
  187. COMMON_FLAGS="$COMMON_FLAGS -DLEVELDB_PLATFORM_POSIX"
  188. fi
  189. # Test whether Snappy library is installed
  190. # http://code.google.com/p/snappy/
  191. $CXX $CXXFLAGS -x c++ - -o $CXXOUTPUT 2>/dev/null <<EOF
  192. #include <snappy.h>
  193. int main() {}
  194. EOF
  195. if [ "$?" = 0 ]; then
  196. COMMON_FLAGS="$COMMON_FLAGS -DSNAPPY"
  197. PLATFORM_LIBS="$PLATFORM_LIBS -lsnappy"
  198. fi
  199. # Test whether tcmalloc is available
  200. $CXX $CXXFLAGS -x c++ - -o $CXXOUTPUT -ltcmalloc 2>/dev/null <<EOF
  201. int main() {}
  202. EOF
  203. if [ "$?" = 0 ]; then
  204. PLATFORM_LIBS="$PLATFORM_LIBS -ltcmalloc"
  205. fi
  206. rm -f $CXXOUTPUT 2>/dev/null
  207. # Test if gcc SSE 4.2 is supported
  208. $CXX $CXXFLAGS -x c++ - -o $CXXOUTPUT -msse4.2 2>/dev/null <<EOF
  209. int main() {}
  210. EOF
  211. if [ "$?" = 0 ]; then
  212. PLATFORM_SSEFLAGS="-msse4.2"
  213. fi
  214. rm -f $CXXOUTPUT 2>/dev/null
  215. fi
  216. # Use the SSE 4.2 CRC32C intrinsics iff runtime checks indicate compiler supports them.
  217. if [ -n "$PLATFORM_SSEFLAGS" ]; then
  218. PLATFORM_SSEFLAGS="$PLATFORM_SSEFLAGS -DLEVELDB_PLATFORM_POSIX_SSE"
  219. fi
  220. PLATFORM_CCFLAGS="$PLATFORM_CCFLAGS $COMMON_FLAGS"
  221. PLATFORM_CXXFLAGS="$PLATFORM_CXXFLAGS $COMMON_FLAGS"
  222. echo "CC=$CC" >> $OUTPUT
  223. echo "CXX=$CXX" >> $OUTPUT
  224. echo "PLATFORM=$PLATFORM" >> $OUTPUT
  225. echo "PLATFORM_LDFLAGS=$PLATFORM_LDFLAGS" >> $OUTPUT
  226. echo "PLATFORM_LIBS=$PLATFORM_LIBS" >> $OUTPUT
  227. echo "PLATFORM_CCFLAGS=$PLATFORM_CCFLAGS" >> $OUTPUT
  228. echo "PLATFORM_CXXFLAGS=$PLATFORM_CXXFLAGS" >> $OUTPUT
  229. echo "PLATFORM_SSEFLAGS=$PLATFORM_SSEFLAGS" >> $OUTPUT
  230. echo "PLATFORM_SHARED_CFLAGS=$PLATFORM_SHARED_CFLAGS" >> $OUTPUT
  231. echo "PLATFORM_SHARED_EXT=$PLATFORM_SHARED_EXT" >> $OUTPUT
  232. echo "PLATFORM_SHARED_LDFLAGS=$PLATFORM_SHARED_LDFLAGS" >> $OUTPUT
  233. echo "PLATFORM_SHARED_VERSIONED=$PLATFORM_SHARED_VERSIONED" >> $OUTPUT