So far we are taking whatever is `net-snmp-config
--default-mibdirs` returns and using that as MIB_DIR to install
our MIB. This has a drawback that it ignores whatever prefix user
specifies to configure script (which is used by `make distcheck`
too). The fix consists of querying for net-snmp-config --prefix
and replacing that in MIB_DIR var.

Signed-off-by: Michal Privoznik <mpriv...@redhat.com>
---

This is similar to what we do for wireshark in libvirt.

 configure.ac | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/configure.ac b/configure.ac
index baac0e1..f729ac1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -73,6 +73,14 @@ if test "x$with_mibdir" = "x" ; then
     MIB_DIR=$(echo $MIB_DIR | awk -F : '{print $NF}')
 
     AC_MSG_RESULT([found $MIB_DIR])
+
+    dnl Replace net-snmp's exec_prefix with our own.
+    dnl Note that ${exec_prefix} is kept verbatim at this point in time,
+    dnl and will only be expanded later, when make is called: this makes
+    dnl it possible to override such prefix at compilation or installation
+    dnl time
+    MIB_PREFIX="`$SNMP_CONFIG --prefix`"
+    MIB_DIR='${exec_prefix}'"${MIB_DIR#$MIB_PREFIX}"
 else
     AC_MSG_CHECKING([accessibility of $with_mibdir])
     if test ! -d "$with_mibdir" ; then
-- 
2.18.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to