Commit 3b9695fa authored by Francis Dupont's avatar Francis Dupont

[65-libyang-config-build_rebased] Rebased on last master

parents 52f787c5 2ccc3237
...@@ -14,6 +14,7 @@ DISTCHECK_LOG4CPLUS_CONFIGURE_FLAG=@DISTCHECK_LOG4CPLUS_CONFIGURE_FLAG@ ...@@ -14,6 +14,7 @@ DISTCHECK_LOG4CPLUS_CONFIGURE_FLAG=@DISTCHECK_LOG4CPLUS_CONFIGURE_FLAG@
DISTCHECK_KEA_SHELL_CONFIGURE_FLAG=@DISTCHECK_KEA_SHELL_CONFIGURE_FLAG@ DISTCHECK_KEA_SHELL_CONFIGURE_FLAG=@DISTCHECK_KEA_SHELL_CONFIGURE_FLAG@
DISTCHECK_PREMIUM_CONFIGURE_FLAG=@DISTCHECK_PREMIUM_CONFIGURE_FLAG@ DISTCHECK_PREMIUM_CONFIGURE_FLAG=@DISTCHECK_PREMIUM_CONFIGURE_FLAG@
DISTCHECK_CONTRIB_CONFIGURE_FLAG=@DISTCHECK_CONTRIB_CONFIGURE_FLAG@ DISTCHECK_CONTRIB_CONFIGURE_FLAG=@DISTCHECK_CONTRIB_CONFIGURE_FLAG@
DISTCHECK_SYSREPO_CONFIGURE_FLAG=@DISTCHECK_SYSREPO_CONFIGURE_FLAG@
OVERALL_COVERAGE_DIR=$(abs_top_builddir)/coverage-cpp-html OVERALL_COVERAGE_DIR=$(abs_top_builddir)/coverage-cpp-html
...@@ -43,6 +44,9 @@ DISTCHECK_CONFIGURE_FLAGS += $(DISTCHECK_PREMIUM_CONFIGURE_FLAG) ...@@ -43,6 +44,9 @@ DISTCHECK_CONFIGURE_FLAGS += $(DISTCHECK_PREMIUM_CONFIGURE_FLAG)
# Keep the contrib config # Keep the contrib config
DISTCHECK_CONFIGURE_FLAGS += $(DISTCHECK_CONTRIB_CONFIGURE_FLAG) DISTCHECK_CONFIGURE_FLAGS += $(DISTCHECK_CONTRIB_CONFIGURE_FLAG)
# keerp the sysrepo config
DISTCHECK_CONFIGURE_FLAGS += $(DISTCHECK_SYSREPO_CONFIGURE_FLAG)
dist_doc_DATA = AUTHORS COPYING ChangeLog README dist_doc_DATA = AUTHORS COPYING ChangeLog README
.PHONY: check-valgrind check-valgrind-suppress .PHONY: check-valgrind check-valgrind-suppress
......
...@@ -867,6 +867,7 @@ fi ...@@ -867,6 +867,7 @@ fi
# ... and at the shell level, so Makefile.am can take action depending on this. # ... and at the shell level, so Makefile.am can take action depending on this.
AM_CONDITIONAL(HAVE_CQL, test "$CQL_CONFIG" != "") AM_CONDITIONAL(HAVE_CQL, test "$CQL_CONFIG" != "")
DISTCHECK_SYSREPO_CONFIGURE_FLAG=
sysrepo_config="no" sysrepo_config="no"
AC_ARG_WITH([sysrepo], AC_ARG_WITH([sysrepo],
AC_HELP_STRING([--with-sysrepo=PATH], AC_HELP_STRING([--with-sysrepo=PATH],
...@@ -875,13 +876,16 @@ AC_ARG_WITH([sysrepo], ...@@ -875,13 +876,16 @@ AC_ARG_WITH([sysrepo],
if test "${sysrepo_config}" = "yes" ; then if test "${sysrepo_config}" = "yes" ; then
SYSREPO_CONFIG="$PKG_CONFIG" SYSREPO_CONFIG="$PKG_CONFIG"
DISTCHECK_SYSREPO_CONFIGURE_FLAG="-with-sysrepo=${sysrepo_config}"
elif test "${sysrepo_config}" != "no" ; then elif test "${sysrepo_config}" != "no" ; then
SYSREPO_CONFIG="${sysrepo_config}" SYSREPO_CONFIG="${sysrepo_config}"
DISTCHECK_SYSREPO_CONFIGURE_FLAG="-with-sysrepo=${sysrepo_config}"
fi fi
AC_SUBST(DISTCHECK_SYSREPO_CONFIGURE_FLAG)
if test "$SYSREPO_CONFIG" != "" ; then if test "$SYSREPO_CONFIG" != "" ; then
if test -d "$SYSREPO_CONFIG" -o ! -x "$SYSREPO_CONFIG" ; then if test -d "$SYSREPO_CONFIG" -o ! -x "$SYSREPO_CONFIG" ; then
AC_MSG_ERROR([--with-sysrepo should point to a sysrepo_config program]) AC_MSG_ERROR([--with-sysrepo should point to a pkg-config or sysrepo_config program])
fi fi
# Let's get the configuration environment for pure Sysrepo (written in C) first # Let's get the configuration environment for pure Sysrepo (written in C) first
...@@ -889,6 +893,7 @@ if test "$SYSREPO_CONFIG" != "" ; then ...@@ -889,6 +893,7 @@ if test "$SYSREPO_CONFIG" != "" ; then
SYSREPO_CPPFLAGS="$SYSREPO_INCLUDEDIR `$SYSREPO_CONFIG --cflags-only-other libsysrepo`" SYSREPO_CPPFLAGS="$SYSREPO_INCLUDEDIR `$SYSREPO_CONFIG --cflags-only-other libsysrepo`"
SYSREPO_LIBS="`$SYSREPO_CONFIG --libs libsysrepo`" SYSREPO_LIBS="`$SYSREPO_CONFIG --libs libsysrepo`"
SYSREPO_VERSION=`$SYSREPO_CONFIG --modversion libsysrepo` SYSREPO_VERSION=`$SYSREPO_CONFIG --modversion libsysrepo`
SYSREPO_REPO=`$SYSREPO_CONFIG --variable=SR_REPOSITORY_LOC libsysrepo`
# Now get the environment for C++ bindings for Sysrepo. # Now get the environment for C++ bindings for Sysrepo.
SYSREPOCPP_INCLUDEDIR=`$SYSREPO_CONFIG --cflags-only-I libSysrepo-cpp` SYSREPOCPP_INCLUDEDIR=`$SYSREPO_CONFIG --cflags-only-I libSysrepo-cpp`
...@@ -912,6 +917,7 @@ if test "$SYSREPO_CONFIG" != "" ; then ...@@ -912,6 +917,7 @@ if test "$SYSREPO_CONFIG" != "" ; then
AC_SUBST(SYSREPO_CPPFLAGS) AC_SUBST(SYSREPO_CPPFLAGS)
AC_SUBST(SYSREPO_LIBS) AC_SUBST(SYSREPO_LIBS)
AC_SUBST(SYSREPO_REPO)
# Check that a simple program using Sysrepo functions can compile and link. # Check that a simple program using Sysrepo functions can compile and link.
CPPFLAGS_SAVED="$CPPFLAGS" CPPFLAGS_SAVED="$CPPFLAGS"
...@@ -1815,6 +1821,7 @@ Sysrepo: ...@@ -1815,6 +1821,7 @@ Sysrepo:
SYSREPO_VERSION: ${SYSREPO_VERSION} SYSREPO_VERSION: ${SYSREPO_VERSION}
SYSREPO_CPPFLAGS: ${SYSREPO_CPPFLAGS} SYSREPO_CPPFLAGS: ${SYSREPO_CPPFLAGS}
SYSREPO_LIBS: ${SYSREPO_LIBS} SYSREPO_LIBS: ${SYSREPO_LIBS}
SYSREPO_REPO: ${SYSREPO_REPO}
END END
else else
cat >> config.report << END cat >> config.report << END
......
...@@ -39,6 +39,8 @@ then ...@@ -39,6 +39,8 @@ then
echo " get lib path" echo " get lib path"
echo "--modversion" echo "--modversion"
echo " get version" echo " get version"
echo "--variable=SR_REPOSITORY_LOC"
echo " get repo path"
echo "libraries:" echo "libraries:"
echo " libsysrepo" echo " libsysrepo"
exit 0 exit 0
...@@ -67,7 +69,8 @@ then ...@@ -67,7 +69,8 @@ then
fi fi
if [ $1 == "--libs" ] if [ $1 == "--libs" ]
then then
echo "-L${SYSREPO_PATH}/build/src -L${SYSREPO_PATH}/build/swig -L$YANG_LIBRARY_PATH -l:${sysrepo_lib}.a -lSysrepo-cpp -lyang -pthread -lpcre -lev -lprotobuf -lavl -lprotobuf-c" # Earlier versions also required -lprotobuf, but it is no longer needed.
echo "-L${SYSREPO_PATH}/build/src -L${SYSREPO_PATH}/build/swig -L$YANG_LIBRARY_PATH -l:${sysrepo_lib}.a -lSysrepo-cpp -lyang -pthread -lpcre -lev -lavl -lprotobuf-c"
exit 0 exit 0
fi fi
if [ $1 == "--modversion" ] if [ $1 == "--modversion" ]
...@@ -78,5 +81,9 @@ then ...@@ -78,5 +81,9 @@ then
echo "${MAJOR}.${MINOR}.${PATCH}" echo "${MAJOR}.${MINOR}.${PATCH}"
exit 0 exit 0
fi fi
if [ $1 == "--variable=SR_REPOSITORY_LOC" ]
then
echo "${SYSREPO_PATH}/build/repository"
fi
echo "wrong parameter" echo "wrong parameter"
echo "run: \`$0 --help\` for more help" echo "run: \`$0 --help\` for more help"
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