rocksdb: build rocksdb with its own Makefile

This lets us track upstream without mantaining our own autotools fork.

Move back to rocksdb vanilla 3.11.2 (without our autotools patches).

Signed-off-by: Sage Weil <sage@redhat.com>
This commit is contained in:
Sage Weil 2015-10-17 15:43:11 -04:00
parent c1e44293d5
commit ba0d2c333d
9 changed files with 798 additions and 486 deletions

View File

@ -46,5 +46,4 @@ autoconf
autoheader
automake -a --add-missing -Wall
( cd src/gmock && autoreconf -fvi; )
( cd src/rocksdb && autoreconf -fvi; )
exit

View File

@ -789,8 +789,6 @@ AC_ARG_WITH([librocksdb-static],
[with_librocksdb_static=no])
AS_IF([test "x$with_librocksdb_static" = "xcheck" -a "x$HAVE_CXX11" = "x1" ],
[with_librocksdb_static="yes"])
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 "x$with_librocksdb_static" = "xyes" ])

View File

@ -198,10 +198,6 @@ if WITH_LIBZFS
LIBOS += libos_zfs.a -lzfs
endif # WITH_LIBZFS
if WITH_LIBROCKSDB
LIBOS += libos_rocksdb.la
endif # WITH_LIBROCKSDB
if WITH_TCMALLOC_MINIMAL
LIBPERFGLUE += -ltcmalloc_minimal
endif # WITH_TCMALLOC_MINIMAL
@ -232,9 +228,12 @@ LIBMDS += $(LIBPERFGLUE)
# OSD needs types
LIBOSD += $(LIBOSD_TYPES) $(LIBOS_TYPES)
# Always use system leveldb
LIBOS += -lleveldb -lsnappy
# libos linking order is ornery
LIBOS += $(LIBOS_TYPES)
if WITH_SLIBROCKSDB
LIBOS += rocksdb/librocksdb.a
endif
LIBOS += -lbz2 -lz -lleveldb -lsnappy
LIBMON += $(LIBMON_TYPES)

File diff suppressed because it is too large Load Diff

View File

@ -44,7 +44,8 @@ bin_SCRIPTS += \
ceph_osd_SOURCES = ceph_osd.cc
ceph_osd_LDADD = \
$(LIBOSDC) $(LIBOS) $(LIBOSD) $(LIBOSD_TYPES) $(LIBOS_TYPES) \
$(LIBOSDC) $(LIBOSD) $(LIBOSD_TYPES) $(LIBOS_TYPES) \
$(LIBOS) \
$(CEPH_GLOBAL) $(LIBCOMMON)
if WITH_LTTNG
ceph_osd_LDADD += $(LIBOSD_TP)

View File

@ -44,8 +44,9 @@ if WITH_LIBZFS
libos_a_SOURCES += os/ZFSFileStoreBackend.cc
endif
libos_a_CXXFLAGS = ${AM_CXXFLAGS}
libos_a_LIBADD = $(LIBOS_TYPES)
libos_a_CXXFLAGS = ${AM_CXXFLAGS} -I rocksdb/include
libos_a_LIBADD = libos_types.a
if WITH_LTTNG
libos_a_LIBADD += $(LIBOS_TP)
endif
@ -85,19 +86,22 @@ noinst_HEADERS += \
os/ZFSFileStoreBackend.h
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
# build rocksdb with its own makefile
# for some stupid reason this needs -fPIC...
rocksdb/librocksdb.a:
cd rocksdb && EXTRA_CXXFLAGS=-fPIC make -j$(shell nproc) static_lib
libos_a_CXXFLAGS += -I rocksdb/include -fPIC
libos_a_SOURCES += os/RocksDBStore.cc
libos_a_LIBADD += rocksdb/librocksdb.a
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
libos_a_SOURCES += os/RocksDBStore.cc
libos_a_LIBADD += -lrocksdb
noinst_HEADERS += os/RocksDBStore.h
endif
if WITH_LIBZFS
libos_zfs_a_SOURCES = os/ZFS.cc
libos_zfs_a_CXXFLAGS = ${AM_CXXFLAGS} ${LIBZFS_CFLAGS}

@ -1 +1 @@
Subproject commit dcdb0dd29232ece43f093c99220b0eea7ead51ff
Subproject commit add2ac5fb826463e5525a3e3b1a4a1714dfbeffb

View File

@ -0,0 +1,11 @@
#!/bin/sh
cd rocksdb
git clean -dffx
cd ..
echo "EXTRA_DIST += \\" > /tmp/$$
for f in `find rocksdb -type f | grep -v /.git$`; do
echo " $f \\" >> /tmp/$$
done
echo " rocksdb/AUTHORS" >> /tmp/$$
mv /tmp/$$ Makefile-rocksdb.am

View File

@ -214,8 +214,8 @@ endif # WITH_OSD
if WITH_SLIBROCKSDB
unittest_rocksdb_option_static_SOURCES = test/objectstore/TestRocksdbOptionParse.cc
unittest_rocksdb_option_static_LDADD = $(LIBOS) $(UNITTEST_LDADD) $(CEPH_GLOBAL) rocksdb/librocksdb.la
unittest_rocksdb_option_static_CXXFLAGS = $(UNITTEST_CXXFLAGS) ${AM_CXXFLAGS} ${LIBROCKSDB_CFLAGS} -std=gnu++11 -I rocksdb/include
unittest_rocksdb_option_static_LDADD = $(LIBOS) $(UNITTEST_LDADD) $(CEPH_GLOBAL)
unittest_rocksdb_option_static_CXXFLAGS = $(UNITTEST_CXXFLAGS) ${AM_CXXFLAGS} ${LIBROCKSDB_CFLAGS} -I rocksdb/include
check_TESTPROGRAMS += unittest_rocksdb_option_static
endif