Commit f3f2c8be authored by Tomek Mrugalski's avatar Tomek Mrugalski 🛰

[gitlab9] Detection of Sysrepo-cpp implemented.

parent 6c5f7f3f
......@@ -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
......
......@@ -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)
......
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