0001-m4-netsnmp.m4-fix-shared-netsnmp-build.patch 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. From 3e810c0804ec40ad6e111a9791cdb2033ecdad71 Mon Sep 17 00:00:00 2001
  2. From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  3. Date: Fri, 25 Feb 2022 23:30:19 +0100
  4. Subject: [PATCH] m4/netsnmp.m4: fix shared netsnmp build
  5. Since commit fe391e8689c523d3c7ea6b173d25aa5dba3a6902, the build fails
  6. with the following error if the user provides the path of
  7. net-snmp-config through the --with-net-snmp option:
  8. 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"
  9. However, the assumption that a static library will be provided by the
  10. system is just plain wrong so replace AC_MSG_ERROR by AC_MSG_WARN
  11. Fixes:
  12. - http://autobuild.buildroot.org/results/0f541e45d1fa27b3302968683bf64949131ec1c9
  13. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  14. [Upstream status: https://github.com/zabbix/zabbix/pull/61]
  15. ---
  16. m4/netsnmp.m4 | 7 +++++--
  17. 1 file changed, 5 insertions(+), 2 deletions(-)
  18. diff --git a/m4/netsnmp.m4 b/m4/netsnmp.m4
  19. index 5e84d84303..87e21a67e6 100644
  20. --- a/m4/netsnmp.m4
  21. +++ b/m4/netsnmp.m4
  22. @@ -140,8 +140,11 @@ AC_HELP_STRING([--with-net-snmp@<:@=ARG@:>@],
  23. 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"])
  24. if test "x$static_linking_support" = "xno" -o -z "$static_linking_support"; then
  25. - test -f $_libsnmp_dir_lib/libnetsnmp.a || AC_MSG_ERROR(["libnetsnmp.a static library was not found in $_libsnmp_dir_lib"])
  26. - SNMP_LIBS=`echo "$SNMP_LIBS"|sed "s|-lnetsnmp|$_libsnmp_dir_lib/libnetsnmp.a|g"`
  27. + if test -f $_libsnmp_dir_lib/libnetsnmp.a; then
  28. + SNMP_LIBS=`echo "$SNMP_LIBS"|sed "s|-lnetsnmp|$_libsnmp_dir_lib/libnetsnmp.a|g"`
  29. + else
  30. + AC_MSG_WARN(["libnetsnmp.a static library was not found in $_libsnmp_dir_lib"])
  31. + fi
  32. else
  33. SNMP_LIBS=`echo "$SNMP_LIBS"|sed "s/-lnetsnmp/${static_linking_support}static -lnetsnmp ${static_linking_support}dynamic/g"`
  34. fi
  35. --
  36. 2.34.1