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

Michal Privoznik posted 1 patch 3 years, 6 months ago
Failed in applying to current master (apply log)
configure.ac | 8 ++++++++
1 file changed, 8 insertions(+)
[libvirt] [snmp PATCH] configure: Fix MIB_DIR's prefix
Posted by Michal Privoznik 3 years, 6 months ago
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@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
Re: [libvirt] [snmp PATCH] configure: Fix MIB_DIR's prefix
Posted by Martin Kletzander 3 years, 6 months ago
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@redhat.com>
>---
>

WFM, looks OK.

Reviewed-by: Martin Kletzander <mkletzan@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