[libvirt] [snmp PATCH] configure: Fix MIB_DIR's prefix

Martin Kletzander mkletzan at redhat.com
Thu Oct 25 13:28:44 UTC 2018


On Wed, Oct 24, 2018 at 02:52:12PM +0100, Michal Privoznik wrote:
>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 <mprivozn at redhat.com>
>---
>

WFM, looks OK.

Reviewed-by: Martin Kletzander <mkletzan at 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
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20181025/7884ba52/attachment-0001.sig>


More information about the libvir-list mailing list