From: Tomek Mrugalski Date: Fri, 10 Aug 2018 15:35:26 +0000 (+0200) Subject: [gitlab9] Detection of Sysrepo-cpp implemented. X-Git-Tag: gitlab29-base~14 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=f3f2c8be22306e3087ac73a83182060e49950c79;p=thirdparty%2Fkea.git [gitlab9] Detection of Sysrepo-cpp implemented. --- 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 ], + [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)