From: Kefu Chai Date: Wed, 23 Dec 2015 09:32:46 +0000 (-0800) Subject: configure: link against bz2 and lz4 if detected X-Git-Tag: v10.0.3~146^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=911e7a02a244a75595eac8644bb75b0f2011b04e;p=ceph.git configure: link against bz2 and lz4 if detected 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 --- diff --git a/configure.ac b/configure.ac index 848b7a91dd9f..34a4f803ffe0 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/src/Makefile-env.am b/src/Makefile-env.am index 3d8a252e378b..2501b9b640e0 100644 --- a/src/Makefile-env.am +++ b/src/Makefile-env.am @@ -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)