]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
configure: link against bz2 and lz4 if detected
authorKefu Chai <kchai@redhat.com>
Wed, 23 Dec 2015 09:32:46 +0000 (01:32 -0800)
committerKefu Chai <kchai@redhat.com>
Wed, 23 Dec 2015 09:39:50 +0000 (01:39 -0800)
if we configure --with-librocksdb-static, the rocksdb's Makefile
will detect the installed libbz2 and libz4 by its own. if the
building env happens to have these libraries installed, a link
time dependency is introduced. so we are forced to link against
them.

Fixes: #13850
Fixes: #13981
Signed-off-by: Kefu Chai <kchai@redhat.com>
configure.ac
src/Makefile-env.am

index 848b7a91dd9ffcfdf3700656a3e72bcb828d7a47..34a4f803ffe070f27d98476df0e6b1ad4db56efb 100644 (file)
@@ -819,6 +819,13 @@ AS_IF([test "x$with_librocksdb_static" = "xyes"],
 AM_CONDITIONAL(WITH_SLIBROCKSDB, [ test "x$with_librocksdb_static" = "xyes" ])
 AM_CONDITIONAL(WITH_LIBROCKSDB, [ test "x$with_librocksdb_static" = "xyes" -o "x$with_librocksdb" = "xyes" ])
 
+# rocksdb detects bzlib and lz4 in its Makefile, which forces us to do the same.
+AS_IF([test "x$with_librocksdb_static" = "xyes"], [
+  AC_CHECK_HEADER([bzlib.h], [have_bzlib=yes])
+  AC_CHECK_HEADER([lz4.h], [have_lz4=yes])])
+AM_CONDITIONAL(HAVE_BZLIB, [test "x$have_bzlib" = "xyes"])
+AM_CONDITIONAL(HAVE_LZ4, [test "x$have_lz4" = "xyes"])
+
 # error out if --with-jemalloc and --with-librocksdb_static as rocksdb uses tcmalloc
 if test "x$with_jemalloc" = "xyes"; then
        if test "x$with_librocksdb_static" != "xno"; then
index 3d8a252e378be7390c3e16414d37ccc3a9aec206..2501b9b640e05d50d21c41a5ab0a49e7ccb51549 100644 (file)
@@ -266,8 +266,14 @@ LIBOSD += $(LIBOSD_TYPES) $(LIBOS_TYPES)
 # libkv/libos linking order is ornery
 if WITH_SLIBROCKSDB
 LIBKV += rocksdb/librocksdb.a
+if HAVE_BZLIB
+LIBKV += -lbz2
 endif
-LIBKV += -lbz2 -lz -lleveldb -lsnappy
+if HAVE_LZ4
+LIBKV += -llz4
+endif
+endif # WITH_SLIBROCKSDB
+LIBKV += -lz -lleveldb -lsnappy
 LIBOS += $(LIBOS_TYPES) $(LIBKV)
 
 LIBMON += $(LIBMON_TYPES)