From 3bbc5c49cd2a6d373bd46029d8d76342e650bf4c Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Wed, 29 Mar 2023 07:12:13 +0200 Subject: [PATCH] src/confd: derive YANG module search path from configure Signed-off-by: Joachim Wiberg --- src/confd/configure.ac | 3 +++ src/confd/src/Makefile.am | 2 ++ src/confd/src/ietf-system.c | 2 -- src/confd/yang/Makefile.am | 2 +- src/confd/yang/iana-crypt-hash.yang | 1 + 5 files changed, 7 insertions(+), 3 deletions(-) create mode 120000 src/confd/yang/iana-crypt-hash.yang diff --git a/src/confd/configure.ac b/src/confd/configure.ac index 3ed9eeca..fe2923ee 100644 --- a/src/confd/configure.ac +++ b/src/confd/configure.ac @@ -33,6 +33,9 @@ DATAROOTDIR=`eval echo $datarootdir` DATAROOTDIR=`eval echo $DATAROOTDIR` AC_SUBST(DATAROOTDIR) +YANGDIR=`eval echo $datarootdir/yang/modules/confd` +AC_SUBST(YANGDIR) + LIBDIR=`eval echo $libdir` LIBDIR=`eval echo $LIBDIR` AC_SUBST(LIBDIR) diff --git a/src/confd/src/Makefile.am b/src/confd/src/Makefile.am index aba4347a..7c9edbd4 100644 --- a/src/confd/src/Makefile.am +++ b/src/confd/src/Makefile.am @@ -1,3 +1,5 @@ +AM_CPPFLAGS = -DYANG_PATH_=\"$(YANGDIR)/\" + plugindir = $(srpdplugindir) plugin_LTLIBRARIES = confd-plugin.la diff --git a/src/confd/src/ietf-system.c b/src/confd/src/ietf-system.c index 04aa23c4..a516a060 100644 --- a/src/confd/src/ietf-system.c +++ b/src/confd/src/ietf-system.c @@ -247,8 +247,6 @@ free_vals: return SR_ERR_OK; } -#define YANG_PATH_ "/usr/share/yang/modules/sysrepo/" - int sr_plugin_init_cb(sr_session_ctx_t *sess, void **priv) { int r; diff --git a/src/confd/yang/Makefile.am b/src/confd/yang/Makefile.am index c36471ee..3e287aca 100644 --- a/src/confd/yang/Makefile.am +++ b/src/confd/yang/Makefile.am @@ -1,2 +1,2 @@ -yangdir = $(datarootdir)/yang/modules/sysrepo +yangdir = $(YANGDIR) yang_DATA = $(wildcard *.yang) diff --git a/src/confd/yang/iana-crypt-hash.yang b/src/confd/yang/iana-crypt-hash.yang new file mode 120000 index 00000000..6c6431e3 --- /dev/null +++ b/src/confd/yang/iana-crypt-hash.yang @@ -0,0 +1 @@ +iana-crypt-hash@2014-08-06.yang \ No newline at end of file