瀏覽代碼

package/zabbix: fix shared netsnmp build

Fix the following shared build failure with netsnmp raised since the
addition of the package in commit
42382a171277ead59e365f5920e757f01c04ac77:

configure: error: "libnetsnmp.a static library was not found in /home/buildroot/autobuild/instance-0/output-1/host/powerpc64le-buildroot-linux-gnu/sysroot/usr/bin/../../usr/lib"

Fixes:
 - http://autobuild.buildroot.org/results/0f541e45d1fa27b3302968683bf64949131ec1c9

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
(cherry picked from commit 532e5063f54434cce4afec2ad5371fbf02488b67)
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Fabrice Fontaine 3 年之前
父節點
當前提交
61dfa6a4ef
共有 2 個文件被更改,包括 46 次插入0 次删除
  1. 44 0
      package/zabbix/0001-m4-netsnmp.m4-fix-shared-netsnmp-build.patch
  2. 2 0
      package/zabbix/zabbix.mk

+ 44 - 0
package/zabbix/0001-m4-netsnmp.m4-fix-shared-netsnmp-build.patch

@@ -0,0 +1,44 @@
+From 3e810c0804ec40ad6e111a9791cdb2033ecdad71 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Fri, 25 Feb 2022 23:30:19 +0100
+Subject: [PATCH] m4/netsnmp.m4: fix shared netsnmp build
+
+Since commit fe391e8689c523d3c7ea6b173d25aa5dba3a6902, the build fails
+with the following error if the user provides the path of
+net-snmp-config through the --with-net-snmp option:
+
+configure: error: "libnetsnmp.a static library was not found in /home/buildroot/autobuild/instance-0/output-1/host/powerpc64le-buildroot-linux-gnu/sysroot/usr/bin/../../usr/lib"
+
+However, the assumption that a static library will be provided by the
+system is just plain wrong so replace AC_MSG_ERROR by AC_MSG_WARN
+
+Fixes:
+ - http://autobuild.buildroot.org/results/0f541e45d1fa27b3302968683bf64949131ec1c9
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+[Upstream status: https://github.com/zabbix/zabbix/pull/61]
+---
+ m4/netsnmp.m4 | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/m4/netsnmp.m4 b/m4/netsnmp.m4
+index 5e84d84303..87e21a67e6 100644
+--- a/m4/netsnmp.m4
++++ b/m4/netsnmp.m4
+@@ -140,8 +140,11 @@ AC_HELP_STRING([--with-net-snmp@<:@=ARG@:>@],
+ 			test [ "x$static_linking_support" = "xno" -o -z "$static_linking_support" ] -a -z "$_libsnmp_dir_lib" && AC_MSG_ERROR(["Compiler not support statically linked libs from default folders"])
+ 
+ 			if test "x$static_linking_support" = "xno" -o -z "$static_linking_support"; then
+-				test -f $_libsnmp_dir_lib/libnetsnmp.a || AC_MSG_ERROR(["libnetsnmp.a static library was not found in $_libsnmp_dir_lib"])
+-				SNMP_LIBS=`echo "$SNMP_LIBS"|sed "s|-lnetsnmp|$_libsnmp_dir_lib/libnetsnmp.a|g"`
++				if test -f $_libsnmp_dir_lib/libnetsnmp.a; then
++					SNMP_LIBS=`echo "$SNMP_LIBS"|sed "s|-lnetsnmp|$_libsnmp_dir_lib/libnetsnmp.a|g"`
++				else
++					AC_MSG_WARN(["libnetsnmp.a static library was not found in $_libsnmp_dir_lib"])
++				fi
+ 			else
+ 				SNMP_LIBS=`echo "$SNMP_LIBS"|sed "s/-lnetsnmp/${static_linking_support}static -lnetsnmp ${static_linking_support}dynamic/g"`
+ 			fi
+-- 
+2.34.1
+

+ 2 - 0
package/zabbix/zabbix.mk

@@ -10,6 +10,8 @@ ZABBIX_SITE = https://cdn.zabbix.com/zabbix/sources/stable/$(ZABBIX_VERSION_MAJO
 ZABBIX_LICENSE = GPL-2.0+
 ZABBIX_LICENSE_FILES = README COPYING
 ZABBIX_CPE_ID_VENDOR = zabbix
+# We're patching m4/netsnmp.m4
+ZABBIX_AUTORECONF = YES
 
 ZABBIX_DEPENDENCIES = pcre
 ZABBIX_CONF_OPTS = \