Module: monitoring-plugins
 Branch: sthen_pkg_conf
 Commit: e2694816e78986f7a97691dc5b013cbeb7eede4f
 Author: Stuart Henderson <[email protected]>
   Date: Wed Dec 24 14:57:57 2025 +0000
    URL: 
https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=e2694816

use pkg-config XX netsnmp instead of net-snmp-config XX

net-snmp-config --cflags returns the flags used to build Net-SNMP,
which in 5.9.5+ includes -Werror=declaration-after-statement; code in
check_snmp.c is not ready for this. "pkg-config --cflags netsnmp"
just returns flags needed to build against the library.

---

 plugins/Makefile.am | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/plugins/Makefile.am b/plugins/Makefile.am
index d098fa8a..cf06c70c 100644
--- a/plugins/Makefile.am
+++ b/plugins/Makefile.am
@@ -164,8 +164,8 @@ check_radius_LDADD = $(NETLIBS) $(RADIUSLIBS)
 check_real_LDADD = $(NETLIBS)
 check_snmp_SOURCES = check_snmp.c check_snmp.d/check_snmp_helpers.c
 check_snmp_LDADD = $(BASEOBJS)
-check_snmp_LDFLAGS = $(AM_LDFLAGS) `net-snmp-config --libs`
-check_snmp_CFLAGS = $(AM_CFLAGS) `net-snmp-config --cflags`
+check_snmp_LDFLAGS = $(AM_LDFLAGS) `pkg-config --libs netsnmp`
+check_snmp_CFLAGS = $(AM_CFLAGS) `pkg-config --cflags netsnmp`
 check_smtp_LDADD = $(SSLOBJS)
 check_ssh_LDADD = $(NETLIBS)
 check_swap_SOURCES = check_swap.c check_swap.d/swap.c

Reply via email to