summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorAndrei Pavel <andrei.pavel@mail.com>2021-07-15 13:57:13 +0200
committerTomek Mrugalski <tomek@isc.org>2021-07-23 12:45:36 +0200
commit9942b35e41cbd8cb5d320ffb23c2fc59c16f0e37 (patch)
tree5cbba21fb5233be649ff515242c0e0ab2045a262 /tools
parent[#1977] Addressed review comments (diff)
downloadkea-9942b35e41cbd8cb5d320ffb23c2fc59c16f0e37.tar.xz
kea-9942b35e41cbd8cb5d320ffb23c2fc59c16f0e37.zip
[#1077] make autotools work with sysrepo 1.4
Diffstat (limited to 'tools')
-rwxr-xr-xtools/sysrepo_config28
-rwxr-xr-xtools/sysrepo_config_defines.sh.sample13
2 files changed, 27 insertions, 14 deletions
diff --git a/tools/sysrepo_config b/tools/sysrepo_config
index 79c45ca01c..248ab75513 100755
--- a/tools/sysrepo_config
+++ b/tools/sysrepo_config
@@ -1,6 +1,6 @@
#!/bin/sh
-# Copyright (C) 2018-2020 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2018-2021 Internet Systems Consortium, Inc. ("ISC")
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -52,7 +52,7 @@ if [ "$1" = "--help" ]; then
echo " get repo path"
echo "libraries:"
echo " libsysrepo"
- echo " libSysrepo-cpp"
+ echo " libsysrepo-cpp"
exit 0
fi
@@ -60,7 +60,7 @@ if [ $# -ne 2 ]; then
echo "Incorrect number of parameters specified"
echo "run: \`$0 --help\` for more help"
exit 0
-elif [ "$2" != "libsysrepo" ] && [ "$2" != "libSysrepo-cpp" ]; then
+elif [ "$2" != "libsysrepo" ] && [ "$2" != "libsysrepo-cpp" ]; then
echo "library $2 not supported"
echo "run: \`$0 --help\` for more help"
exit 0
@@ -71,24 +71,34 @@ if [ "$1" = "--cflags-only-other" ]; then
fi
if [ "$1" = "--cflags-only-I" ]; then
- echo "-I${SYSREPO_PATH}/include/"
+ echo "-I${LIBYANG_PATH}/include/ -I${SYSREPO_PATH}/include/"
exit 0
fi
if [ "$1" = "--libs" ]; then
- # Earlier versions also required -lprotobuf, but it is no longer needed.
- echo "-L${LIBYANG_PATH}/lib/ -L${SYSREPO_PATH}/lib/ -lsysrepo -lSysrepo-cpp -lyang -pthread -lpcre -lev -lavl -lprotobuf-c"
+ printf '%s' "-L${LIBYANG_PATH}/lib/ -L${SYSREPO_PATH}/lib/"
+
+ if [ "$2" = "libsysrepo" ]; then
+ printf '%s' ' -lyang -lsysrepo'
+ fi
+
+ if [ "$2" = "libsysrepo-cpp" ]; then
+ printf '%s' ' -lyang-cpp -lsysrepo-cpp'
+ fi
+
+ printf '\n'
exit 0
fi
if [ "$1" = "--modversion" ]; then
- VERSION=$(sysrepoctl -v | tr -s " " | cut -d " " -f 7)
- echo "${VERSION}"
+ "${SYSREPO_PATH}/bin/sysrepoctl" -V | grep -Eo 'libsysrepo v[0-9\.]*' | \
+ cut -d ' ' -f 2
exit 0
fi
if [ "$1" = "--variable=SR_REPOSITORY_LOC" ]; then
- echo "${SYSREPO_PATH}/build/repository"
+ "${SYSREPO_PATH}/bin/sysrepoctl" -l | head -n 1 | cut -d ':' -f 2- | \
+ cut -d ' ' -f 2-
exit 0
fi
diff --git a/tools/sysrepo_config_defines.sh.sample b/tools/sysrepo_config_defines.sh.sample
index 04de5e1055..34d649b3d9 100755
--- a/tools/sysrepo_config_defines.sh.sample
+++ b/tools/sysrepo_config_defines.sh.sample
@@ -1,10 +1,13 @@
#!/bin/sh
-# This auxiliary script is considered temporary in nature. It will not be
-# necessary once the DataStax cpp-driver project accepts proper cql_config
-# script.
+# Copyright (C) 2018-2021 Internet Systems Consortium, Inc. ("ISC")
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-# This variable should point to the directory where sysrepo is compiled.
-# You can download sysrepo sources from https://github.com/sysrepo/sysrepo.git
+# Variables should point to the installation directories of libyang and sysrepo.
+# You can download libyang sources from https://github.com/CESNET/libyang.git.
+# You can download sysrepo sources from https://github.com/sysrepo/sysrepo.git.
export LIBYANG_PATH="/please/specify/path/to/libyang/in/sysrepo_config_defines.sh"
export SYSREPO_PATH="/please/specify/path/to/sysrepo/in/sysrepo_config_defines.sh"