From ea546aef0c86da521f8a360d4bfd10315af3f46b Mon Sep 17 00:00:00 2001 From: Gary Lowell Date: Fri, 15 Feb 2013 17:58:48 -0800 Subject: [PATCH] Build: Change build to always use system leveldb Dynamically link to the leveldb installed on the system rather than statically linking ceph copy. Remove the --with-system-leveldb config option, and add a requirement for leveldb libraries for rpm and debian packages. Bug 3945. Signed-off-by: Gary Lowell --- autogen.sh | 1 - ceph.spec.in | 1 + configure.ac | 13 ++----------- debian/control | 2 +- src/Makefile.am | 9 ++------- 5 files changed, 6 insertions(+), 20 deletions(-) diff --git a/autogen.sh b/autogen.sh index 9d6a77bae63d4..f90c49de20a3c 100755 --- a/autogen.sh +++ b/autogen.sh @@ -19,5 +19,4 @@ autoconf autoheader automake -a --add-missing -Wall ( cd src/gtest && autoreconf -fvi; ) -( cd src/leveldb && mkdir -p m4 && autoreconf -fvi; ) exit diff --git a/ceph.spec.in b/ceph.spec.in index 2ba4c7533f3c0..da05b44e234d6 100644 --- a/ceph.spec.in +++ b/ceph.spec.in @@ -25,6 +25,7 @@ Requires: librbd1 = %{version}-%{release} Requires: librados2 = %{version}-%{release} Requires: libcephfs1 = %{version}-%{release} Requires: python +Requires: leveldb > 1.2 Requires(post): binutils BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: gcc-c++ diff --git a/configure.ac b/configure.ac index 2d445e55b0fac..c7bb3d0515cc2 100644 --- a/configure.ac +++ b/configure.ac @@ -24,7 +24,6 @@ AC_MSG_NOTICE([RPM_RELEASE='$RPM_RELEASE']) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_SUBDIRS([src/gtest]) -AC_CONFIG_SUBDIRS([src/leveldb]) # Environment AC_CANONICAL_HOST @@ -413,16 +412,8 @@ AC_ARG_WITH([ocf], [with_ocf=no]) AM_CONDITIONAL(WITH_OCF, [ test "$with_ocf" = "yes" ]) -# use system leveldb? -AC_ARG_WITH([system-leveldb], - [AS_HELP_STRING([--with-system-leveldb], [use system leveldb])], - , - [with_system_leveldb=no]) -AS_IF([test "x$with_system_leveldb" = xyes], - [AC_CHECK_LIB([leveldb], [leveldb_open], [], [AC_MSG_FAILURE([libleveldb not found])], [-lsnappy -lpthread])]) -AS_IF([test "x$with_system_leveldb" = xcheck], - [AC_CHECK_LIB([leveldb], [leveldb_open], [with_system_leveldb=yes], [], [-lsnappy -lpthread])]) -AM_CONDITIONAL(WITH_SYSTEM_LEVELDB, [ test "$with_system_leveldb" = "yes" ]) +# use system leveldb +AC_CHECK_LIB([leveldb], [leveldb_open], [], [AC_MSG_FAILURE([libleveldb not found])], [-lsnappy -lpthread]) # use system libs3? AC_ARG_WITH([system-libs3], diff --git a/debian/control b/debian/control index eefb4ee3b3097..85c9e1eb5ff78 100644 --- a/debian/control +++ b/debian/control @@ -11,7 +11,7 @@ Standards-Version: 3.9.3 Package: ceph Architecture: linux-any -Depends: ${shlibs:Depends}, ${misc:Depends}, sdparm | hdparm, binutils, ceph-common, uuid-runtime, python, xfsprogs, gdisk, parted +Depends: ${shlibs:Depends}, ${misc:Depends}, sdparm | hdparm, binutils, ceph-common, uuid-runtime, python, xfsprogs, gdisk, parted, libleveldb1 (> 1.2) Recommends: ceph-mds, librados2, librbd1, btrfs-tools Description: distributed storage and file system Ceph is a distributed storage system designed to provide excellent diff --git a/src/Makefile.am b/src/Makefile.am index 9c453df1f53b3..9daf3f22182eb 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,6 +1,6 @@ AUTOMAKE_OPTIONS = gnu SUBDIRS = ocf java -DIST_SUBDIRS = gtest ocf leveldb libs3 java +DIST_SUBDIRS = gtest ocf libs3 java EXTRA_DIST = \ libs3/COPYING \ @@ -64,14 +64,9 @@ if WITH_LIBAIO LIBOS_LDA += -laio endif -if WITH_SYSTEM_LEVELDB +# use system leveldb LIBOS_LDA += -lleveldb -lsnappy LEVELDB_INCLUDE = -else -LIBOS_LDA += leveldb/libleveldb.a -SUBDIRS += leveldb -LEVELDB_INCLUDE = -I$(top_srcdir)/src/leveldb/include -endif # monitor ceph_mon_SOURCES = ceph_mon.cc