Skip to content

Commit

Permalink
configure: link against bz2 and lz4 if detected
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
tchaikov committed Dec 23, 2015
1 parent f14fe56 commit 911e7a0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
7 changes: 7 additions & 0 deletions configure.ac
Expand Up @@ -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
Expand Down
8 changes: 7 additions & 1 deletion src/Makefile-env.am
Expand Up @@ -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)
Expand Down

0 comments on commit 911e7a0

Please sign in to comment.