]> git-server-git.apps.pok.os.sepia.ceph.com Git - rocksdb.git/commitdiff
Make rocksdb work with all versions of lz4
authorIgor Canadi <icanadi@fb.com>
Mon, 5 May 2014 18:35:40 +0000 (11:35 -0700)
committerIgor Canadi <icanadi@fb.com>
Mon, 5 May 2014 18:35:40 +0000 (11:35 -0700)
Summary:
There are some projects in fbcode that define lz4 dependency on r108. We, however, defined dependency on r117. That produced some interesting issues and our build system was not happy.

This diff makes rocksdb work with both r108 and r117. Hopefully this will fix our problems.

Test Plan: compiled rocksdb with both r108 and r117 lz4

Reviewers: dhruba, sdong, haobo

Reviewed By: sdong

CC: leveldb
Differential Revision: https://reviews.facebook.net/D18465

build_tools/fbcode.gcc481.sh
port/port_posix.h

index 556d15af24a8834d863bf3e4dbcc8b9c2bf00e1a..d02596f052432b69a323ff334d2954f0e3341db2 100644 (file)
@@ -44,8 +44,8 @@ BZIP_INCLUDE=" -I $TOOLCHAIN_LIB_BASE/bzip2/bzip2-1.0.6/c3f970a/include"
 BZIP_LIBS=" $TOOLCHAIN_LIB_BASE/bzip2/bzip2-1.0.6/c3f970a/lib/libbz2.a"
 
 LZ4_REV=065ec7e38fe83329031f6668c43bef83eff5808b
-LZ4_INCLUDE=" -I /mnt/gvfs/third-party2/lz4/$LZ4_REV/r117/gcc-4.8.1-glibc-2.17/c3f970a/include"
-LZ4_LIBS=" /mnt/gvfs/third-party2/lz4/$LZ4_REV/r117/gcc-4.8.1-glibc-2.17/c3f970a/lib/liblz4.a"
+LZ4_INCLUDE=" -I /mnt/gvfs/third-party2/lz4/$LZ4_REV/r108/gcc-4.8.1-glibc-2.17/c3f970a/include"
+LZ4_LIBS=" /mnt/gvfs/third-party2/lz4/$LZ4_REV/r108/gcc-4.8.1-glibc-2.17/c3f970a/lib/liblz4.a"
 
 # location of gflags headers and libraries
 GFLAGS_INCLUDE=" -I $TOOLCHAIN_LIB_BASE/gflags/gflags-1.6/c3f970a/include"
index b2d162468ae87e32623c8fbd5349dc5e692f8de2..d20a5dff2c51101e522d131146b824557513062d 100644 (file)
@@ -465,8 +465,12 @@ inline bool LZ4HC_Compress(const CompressionOptions &opts, const char* input,
   char *p = const_cast<char *>(output->c_str());
   memcpy(p, &length, sizeof(length));
   size_t outlen;
+#ifdef LZ4_VERSION_MAJOR  // they only started defining this since r113
   outlen = LZ4_compressHC2_limitedOutput(input, p + 8, length, compressBound,
                                          opts.level);
+#else
+  outlen = LZ4_compressHC_limitedOutput(input, p + 8, length, compressBound);
+#endif
   if (outlen == 0) {
     return false;
   }