Commit b53521fe authored by Matthieu Dorier's avatar Matthieu Dorier
Browse files

Merge branch 'fix-configure' into 'master'

Fix configure

See merge request !2
parents 942c6147 2e51cd8f
......@@ -69,15 +69,17 @@ LIBS="$MARGO_LIBS $LIBS"
CPPFLAGS="$MARGO_CFLAGS $CPPFLAGS"
CFLAGS="$MARGO_CFLAGS $CFLAGS"
SERVER_DEPS_PKG=""
PKG_CHECK_MODULES([SSG], [ssg], [],
AC_MSG_ERROR([Could not find ssg]) )
CFLAGS="$SSG_CFLAGS $CFLAGS"
SERVER_LIBS="$SSG_LIBS $SERVER_LIBS"
SERVER_LIBS_PKG="$SSG_LIBS $SERVER_LIBS_PKG"
PKG_CHECK_MODULES([CHPLACEMENT], [ch-placement], [],
AC_MSG_ERROR([Could not find ch-placement]) )
CFLAGS="$CHPLACEMENT_CFLAGS $CFLAGS"
SERVER_LIBS="$CHPLAEMENT_LIBS $SERVER_LIBS"
SERVER_LIBS_PKG="$CHPLAEMENT_LIBS $SERVER_LIBS_PKG"
GROUP_LIBS="$CHPLACEMENT_LIBS $CLIENT_LIBS"
# uncertain what the lowest Boost we need is.
......@@ -87,8 +89,7 @@ AX_BOOST_BASE([1.54], ,
AX_BOOST_SYSTEM
AX_BOOST_FILESYSTEM
SERVER_LIBS="$SERVER_LIBS ${BOOST_LDFLAGS} ${BOOST_FILESYSTEM_LIB} ${BOOST_SYSTEM_LIB}"
SERVER_DEPS=""
SERVER_LIBS_EXT="$SERVER_LIBS_EXT ${BOOST_LDFLAGS} ${BOOST_FILESYSTEM_LIB} ${BOOST_SYSTEM_LIB}"
# we have three possible backends for our datastore. If none are selected,
# then nothing will initialize the class and well that doesn't make any sense
......@@ -99,11 +100,6 @@ bwtree_backend=yes
leveldb_backend=no
berkelydb_backend=no
AC_ARG_ENABLE([berkeleydb],
AS_HELP_STRING([--enable-berkeleydb], [Select "berkeleydb" as
storage backend (default is no)]),
[berkelydb_backend=${enableval}]
)
AC_ARG_ENABLE([leveldb],
AS_HELP_STRING([--enable-leveldb], [Select "leveldb" as storage
backend (default is no)]),
......@@ -115,30 +111,35 @@ AC_ARG_ENABLE([bwtree],
[bwtree_backend=${enableval}], [bwtree_backend=no]
)
if test "x${berkelydb_backend}" == xyes ; then
AC_ARG_WITH([berkeleydb],[AS_HELP_STRING([--with-berkeleydb@<:@=DIR@:>@],
[location of BerkeleyDB installation])])
if test "x${with_berkeleydb}" != "x" ; then
AC_LANG_PUSH([C++])
CPPFLAGS="$CPPFLAGS -I${with_berkeleydb}/include"
CXXFLAGS="$CXXFLAGS -I${with_berkeleydb}/include"
LIBS="$LIBS -L${with_berkeleydb}/lib/ -ldb_cxx -ldb_stl"
AC_CHECK_HEADERS([db_cxx.h], ,
AC_ERROR("Could not find Berkely DB C++ headers"))
AC_CHECK_HEADERS([dbstl_map.h],,
AC_ERROR("Could not find Berkely DB STL headers"))
AC_DEFINE([USE_BDB], 1, [Use Berkely DB backend])
SERVER_LIBS="${SERVER_LIBS} -ldb_cxx -ldb_stl"
SERVER_LIBS_EXT="${SERVER_LIBS_EXT} -L${with_berkeleydb}/lib -ldb_cxx -ldb_stl"
AC_LANG_POP
berkelydb_backend=yes
fi
if test "x${leveldb_backend}" == xyes ; then
PKG_CHECK_MODULES([LEVELDB],[leveldb],[
SERVER_LIBS="$LEVELDB_LIBS $SERVER_LIBS"
SERVER_LIBS_PKG="$LEVELDB_LIBS $SERVER_LIBS_PKG"
CPPFLAGS="$LEVELDB_CFLAGS $CPPFLAGS"
CFLAGS="$LEVELDB_CFLAGS $CFLAGS"
SERVER_DEPS="${SERVER_DEPS} leveldb"
SERVER_DEPS_PKG="${SERVER_DEPS_PKG} leveldb"
], [
# fall back to conventional tests if no pkgconfig
AC_CHECK_HEADERS([leveldb/c.h], ,
AC_ERROR("Could not find leveldb headers"))
AC_DEFINE([USE_LEVELDB], 1, [use leveldb backend])
SERVER_LIBS="${SERVER_LIBS} -lleveldb"
SERVER_LIBS_EXT="${SERVER_LIBS_EXT} -lleveldb"
])
fi
......@@ -153,8 +154,12 @@ AM_CONDITIONAL([BUILD_BDB], [test "x${berkelydb_backend}" == xyes])
AM_CONDITIONAL([BUILD_LEVELDB], [test "x${leveldb_backend}" == xyes])
AM_CONDITIONAL([BUILD_BWTREE], [test "x${bwtree_backend}" == xyes])
SERVER_LIBS="$SERVER_LIBS_PKG $SERVER_LIBS_EXT"
AC_SUBST(SERVER_LIBS)
AC_SUBST(SERVER_DEPS)
AC_SUBST(SERVER_LIBS_PKG)
AC_SUBST(SERVER_LIBS_EXT)
AC_SUBST(SERVER_DEPS_PKG)
AC_SUBST(GROUP_LIBS)
AC_CONFIG_FILES([Makefile maint/sdskv-client.pc maint/sdskv-server.pc])
AC_OUTPUT
......
......@@ -7,6 +7,6 @@ Name: sdskv-server
Description: services-based keyval server
Version: 0.1
URL: https://xgitlab.cels.anl.gov/sds/sds-keyval
Requires: margo @SERVER_DEPS@
Libs: -L${libdir} -lsdskv-server @SERVER_LIBS@
Requires: margo ssg ch-placement @SERVER_DEPS_PKG@
Libs: -L${libdir} -lsdskv-server @SERVER_LIBS_EXT@
Cflags: -I${includedir}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment