Skip to content

Commit

Permalink
add --with-librocksdb-static configure options
Browse files Browse the repository at this point in the history
with this options, ceph will build rocksdb from submodule

Signed-off-by: xinxin shu <[email protected]>
  • Loading branch information
xinxin shu authored and liewegas committed Jul 30, 2014
1 parent 101954c commit 708b5b8
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 16 deletions.
1 change: 1 addition & 0 deletions autogen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,5 @@ autoconf
autoheader
automake -a --add-missing -Wall
( cd src/gtest && autoreconf -fvi; )
( cd src/rocksdb && autoreconf -fvi; )
exit
25 changes: 11 additions & 14 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -538,21 +538,18 @@ AS_IF([test "x$with_librocksdb" = "xyes"],
[PKG_CHECK_MODULES([LIBROCKSDB], [rocksdb], [], [true])])
AS_IF([test "x$with_librocksdb" = "xyes"],
[AC_DEFINE([HAVE_LIBROCKSDB], [1], [Defined if you have librocksdb enabled])])
AM_CONDITIONAL(WITH_LIBROCKSDB, [ test "$with_librocksdb" = "yes" ])
AM_CONDITIONAL(WITH_DLIBROCKSDB, [ test "$with_librocksdb" = "yes" ])

#add rocksdb support
# check libz
AS_IF([test "x$with_librocksdb" = "xyes"],
[AC_CHECK_LIB([z], [gzread], [], [AC_MSG_FAILURE([libz not found])])])
# check libbz2
AS_IF([test "x$with_librocksdb" = "xyes"],
[AC_CHECK_LIB([bz2], [BZ2_bzCompressInit], [], [AC_MSG_FAILURE([libbz2 not found])])])
# check librt
AS_IF([test "x$with_librocksdb" = "xyes"],
[AC_CHECK_LIB([rt], [clock_gettime], [], [AC_MSG_FAILURE([librt not found])])])
# use system rocksdb
#AC_CHECK_LIB([rocksdb], [rocksdb_open], [], [AC_MSG_FAILURE([librocks not found])],[-lsnappy -lpthread -lrt -lbz2 -lz])
#AC_CHECK_LIB([rocksdb], [open], [], [AC_MSG_FAILURE([librocks not found])],[-lsnappy -lpthread -lrt -lbz2 -lz])
AC_ARG_WITH([librocksdb-static],
[AS_HELP_STRING([--with-librocksdb-static], [build rocksdb support])],
[],
[with_librocksdb_static=no])
AS_IF([test "x$with_librocksdb_static" = "xyes"],
[AC_CONFIG_SUBDIRS([src/rocksdb])])
AS_IF([test "x$with_librocksdb_static" = "xyes"],
[AC_DEFINE([HAVE_LIBROCKSDB], [1], [Defined if you have librocksdb enabled])])
AM_CONDITIONAL(WITH_SLIBROCKSDB, [ test "$with_librocksdb_static" = "yes" ])
AM_CONDITIONAL(WITH_LIBROCKSDB, [ test "$with_librocksdb_static" = "yes" -o "$with_librocksdb" = "yes" ])

# use system libs3?
AC_ARG_WITH([system-libs3],
Expand Down
2 changes: 1 addition & 1 deletion src/Makefile-env.am
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ LIBOS += libos_zfs.a -lzfs
endif # WITH_LIBZFS

if WITH_LIBROCKSDB
LIBOS += libos_rocksdb.la -lrocksdb
LIBOS += libos_rocksdb.la
endif # WITH_LIBROCKSDB

if WITH_TCMALLOC
Expand Down
4 changes: 4 additions & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ include Makefile-env.am
SUBDIRS += ocf java
DIST_SUBDIRS += gtest ocf libs3 java

if WITH_SLIBROCKSDB
SUBDIRS += rocksdb
endif


# subdirs

Expand Down
10 changes: 9 additions & 1 deletion src/os/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,17 @@ noinst_HEADERS += \
os/XfsFileStoreBackend.h \
os/ZFSFileStoreBackend.h

if WITH_LIBROCKSDB
if WITH_SLIBROCKSDB
libos_rocksdb_la_SOURCES = os/RocksDBStore.cc
libos_rocksdb_la_CXXFLAGS = ${AM_CXXFLAGS} ${LIBROCKSDB_CFLAGS} -std=gnu++11 -I rocksdb/include
libos_rocksdb_la_LIBADD = rocksdb/librocksdb.la
noinst_LTLIBRARIES += libos_rocksdb.la
noinst_HEADERS += os/RocksDBStore.h
endif
if WITH_DLIBROCKSDB
libos_rocksdb_la_SOURCES = os/RocksDBStore.cc
libos_rocksdb_la_CXXFLAGS = ${AM_CXXFLAGS} ${LIBROCKSDB_CFLAGS} -std=gnu++11
libos_rocksdb_la_LIBADD = -lrocksdb
noinst_LTLIBRARIES += libos_rocksdb.la
noinst_HEADERS += os/RocksDBStore.h
endif
Expand Down

0 comments on commit 708b5b8

Please sign in to comment.