diff options
author | Andrei Pavel <andrei@isc.org> | 2021-07-27 22:32:24 +0200 |
---|---|---|
committer | Andrei Pavel <andrei@isc.org> | 2021-08-12 17:33:26 +0200 |
commit | 06b776a298d691ce07b6eba1e2c9bb273e026b3b (patch) | |
tree | cd67ac99647965b97a43c07a851fda4c72367fda /m4macros | |
parent | [#1990] typo: LIBRARY_CPFFLAGS -> LIBRARY_CPPFLAGS (diff) | |
download | kea-06b776a298d691ce07b6eba1e2c9bb273e026b3b.tar.xz kea-06b776a298d691ce07b6eba1e2c9bb273e026b3b.zip |
[#1990] allow NETCONF to compile only with --with-sysrepo
Diffstat (limited to 'm4macros')
-rw-r--r-- | m4macros/ax_sysrepo.m4 | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/m4macros/ax_sysrepo.m4 b/m4macros/ax_sysrepo.m4 index f1706b2168..976d9b15d1 100644 --- a/m4macros/ax_sysrepo.m4 +++ b/m4macros/ax_sysrepo.m4 @@ -2,10 +2,20 @@ AC_DEFUN([AX_SYSREPO], [ AC_ARG_WITH([libyang], AS_HELP_STRING([--with-libyang=PATH], [optional path to the libyang installation directory]), - [with_library="${withval}"]) + [with_libyang="${withval}"]) + + AC_ARG_WITH([sysrepo], + AS_HELP_STRING([--with-sysrepo=PATH], [optional path to the sysrepo installation directory]), + [with_sysrepo="${withval}"]) + + # If --with-libyang was omitted, assume it was passed and give it the value + # from --with-sysrepo. + if test -z "${with_libyang}"; then + with_libyang="${with_sysrepo}" + fi AC_MSG_CHECKING([libyang]) - AX_FIND_LIBRARY([libyang], ["${with_library}"], [libyang/libyang.h], [libyang.so], [LIBYANG_SOVERSION]) + AX_FIND_LIBRARY([libyang], ["${with_libyang}"], [libyang/libyang.h], [libyang.so], [LIBYANG_SOVERSION]) if "${LIBRARY_FOUND}"; then LIBYANG_CPPFLAGS="${LIBRARY_CPPFLAGS}" LIBYANG_INCLUDEDIR="${LIBRARY_INCLUDEDIR}" @@ -21,7 +31,7 @@ AC_DEFUN([AX_SYSREPO], [ fi AC_MSG_CHECKING([libyang-cpp]) - AX_FIND_LIBRARY([libyang-cpp], ["${with_library}"], [libyang/Libyang.hpp], [libyang-cpp.so]) + AX_FIND_LIBRARY([libyang-cpp], ["${with_libyang}"], [libyang/Libyang.hpp], [libyang-cpp.so]) if "${LIBRARY_FOUND}"; then LIBYANGCPP_CPPFLAGS="${LIBRARY_CPPFLAGS}" @@ -51,12 +61,8 @@ AC_DEFUN([AX_SYSREPO], [ AC_MSG_RESULT([no]) fi - AC_ARG_WITH([sysrepo], - AS_HELP_STRING([--with-sysrepo=PATH], [optional path to the sysrepo installation directory]), - [with_library="${withval}"]) - AC_MSG_CHECKING([sysrepo]) - AX_FIND_LIBRARY([sysrepo], ["${with_library}"], [sysrepo.h], [libsysrepo.so], [], ["${LIBYANG_PREFIX}/lib/pkgconfig"]) + AX_FIND_LIBRARY([sysrepo], ["${with_sysrepo}"], [sysrepo.h], [libsysrepo.so], [], ["${LIBYANG_PREFIX}/lib/pkgconfig"]) if "${LIBRARY_FOUND}"; then SYSREPO_CPPFLAGS="${LIBRARY_CPPFLAGS} ${LIBYANG_CPPFLAGS}" SYSREPO_INCLUDEDIR="${LIBRARY_INCLUDEDIR} ${LIBYANG_INCLUDEDIR}" @@ -104,7 +110,7 @@ AC_DEFUN([AX_SYSREPO], [ AC_MSG_CHECKING([sysrepo-cpp]) - AX_FIND_LIBRARY([sysrepo-cpp], ["${with_library}"], [sysrepo-cpp/Session.hpp], [libsysrepo-cpp.so], [SR_REPO_PATH,SRPD_PLUGINS_PATH], ["${LIBYANGCPP_PREFIX}/lib/pkgconfig"]) + AX_FIND_LIBRARY([sysrepo-cpp], ["${with_sysrepo}"], [sysrepo-cpp/Session.hpp], [libsysrepo-cpp.so], [SR_REPO_PATH,SRPD_PLUGINS_PATH], ["${LIBYANGCPP_PREFIX}/lib/pkgconfig"]) if "${LIBRARY_FOUND}"; then SYSREPOCPP_CPPFLAGS="${LIBRARY_CPPFLAGS}" SYSREPOCPP_INCLUDEDIR="${LIBRARY_INCLUDEDIR}" |