summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomek Mrugalski <tomasz@isc.org>2018-08-10 17:35:26 +0200
committerTomek Mrugalski <tomasz@isc.org>2018-08-21 12:18:56 +0200
commitf3f2c8be22306e3087ac73a83182060e49950c79 (patch)
tree961b15c1baf160b5fb86895098c2caea144f82c7
parent[gitlab9] v4 model renamed. (diff)
downloadkea-f3f2c8be22306e3087ac73a83182060e49950c79.tar.xz
kea-f3f2c8be22306e3087ac73a83182060e49950c79.zip
[gitlab9] Detection of Sysrepo-cpp implemented.
-rw-r--r--configure.ac30
-rw-r--r--src/bin/netconf/tests/Makefile.am2
2 files changed, 31 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index dcab81dfab..49f8dab192 100644
--- a/configure.ac
+++ b/configure.ac
@@ -878,11 +878,32 @@ if test "SYSREPO_CONFIG" != "" ; then
AC_MSG_ERROR([--with-sysrepo should point to a sysrepo_config program])
fi
+ # Let's get the configuration environment for pure Sysrepo (written in C) first
SYSREPO_INCLUDEDIR=`$SYSREPO_CONFIG --cflags-only-I libsysrepo`
SYSREPO_CPPFLAGS="$SYSREPO_INCLUDEDIR `$SYSREPO_CONFIG --cflags-only-other libsysrepo`"
SYSREPO_LIBS="`$SYSREPO_CONFIG --libs libsysrepo`"
SYSREPO_VERSION=`$SYSREPO_CONFIG --modversion libsysrepo`
+ # Now get the environment for C++ bindings for Sysrepo.
+ SYSREPOCPP_INCLUDEDIR=`$SYSREPO_CONFIG --cflags-only-I libSysrepo-cpp`
+ SYSREPOCPP_CPPFLAGS="$SYSREPO_INCLUDEDIR `$SYSREPO_CONFIG --cflags-only-other libSysrepo-cpp`"
+ SYSREPOCPP_LIBS="`$SYSREPO_CONFIG --libs libSysrepo-cpp`"
+ SYSREPOCPP_VERSION=`$SYSREPO_CONFIG --modversion libSysrepo-cpp`
+
+ # If include paths are equal, there's no need to include both. But if they're different,
+ # we need both.
+ if test "${SYSREPO_INCLUDEDIR}" != "${SYSREPOCPP_INCLUDEDIR}"; then
+ SYSREPO_INCLUDEDIR="${SYSREPO_INCLUDEDIR} ${SYSREPOCPP_INCLUDEDIR}"
+ fi
+
+ if test "${SYSREPO_CPPFLAGS}" != "${SYSREPOCPP_CPPFLAGS}"; then
+ SYSREPO_CPPFLAGS="${SYSREPO_CPPFLAGS} ${SYSREPOCPP_CPPFLAGS}"
+ fi
+
+ if test "${SYSREPO_LIBS}" != "${SYSREPOCPP_LIBS}"; then
+ SYSREPO_LIBS="${SYSREPO_LIBS} ${SYSREPOCPP_LIBS}"
+ fi
+
AC_SUBST(SYSREPO_CPPFLAGS)
AC_SUBST(SYSREPO_LIBS)
@@ -905,6 +926,15 @@ if test "SYSREPO_CONFIG" != "" ; then
[AC_MSG_RESULT([checking for Sysrepo headers and library... no])
AC_MSG_ERROR([Needs Sysrepo library])]
)
+
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM([#include <sysrepo-cpp/Session.h>],
+ [Connection("conn-name");])],
+ [AC_MSG_RESULT([checking for Sysrepo C++ bindings headers and library... yes])],
+ [AC_MSG_RESULT([checking for Sysrepo C++ bindings headers and library... no])
+ AC_MSG_ERROR([Needs Sysrepo C++ bindings (unable to find Sysrepo-ccp library. To get it, you need to compile sysrepo with -DGEN_CPP_BINDINGS=ON.])]
+ )
+
CPPFLAGS=$CPPFLAGS_SAVED
LIBS=$LIBS_SAVED
diff --git a/src/bin/netconf/tests/Makefile.am b/src/bin/netconf/tests/Makefile.am
index 63ab0ca16f..7285f8daa0 100644
--- a/src/bin/netconf/tests/Makefile.am
+++ b/src/bin/netconf/tests/Makefile.am
@@ -14,7 +14,7 @@ AM_CPPFLAGS += -I$(top_srcdir)/src -I$(top_builddir)/src
AM_CPPFLAGS += -I$(top_srcdir)/src/bin -I$(top_builddir)/src/bin
AM_CPPFLAGS += $(BOOST_INCLUDES)
-CLEANFILES += *.json *.log
+CLEANFILES = *.json *.log
AM_CXXFLAGS = $(KEA_CXXFLAGS)