You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
2.3 KiB

net-snmp: build against libnl-tiny Instead of causing nondeterministing conditional compilation depending on whether libnl-core happens to be present or not, fixup the net-snmp package to link against libnl-tiny which is present by default on the majority of systems. In order to successfully build against libnl-tiny, a number of things had to be fixed in both the upstream configure and the outer Makefile: - Add a patch which fixes the upstream configure macros to properly handle cases where the cache variables for nl_connect() and netlink.h tests are predefined. Without this patch, all subsequent link tests in configure will fail, causing the build system to assume functions like opendir() or readdir() to be missing, leading to build failures later on due to conflicting redefinitions of structures and function prototypes - In the same patch, stop probing the host systems /usr/include/libnl-3 if ac_cv_header_netlink_netlink_h is given. This brings the proprietary configure bits in line with the behaviour expected from autoconfig in a cross compile setting - Explicitely request nl support by passing the --with-nl flag to configure - Pass the required cache variables to skip the broken tests for nl_connect() and netlink.h - Amend TARGET_CPPFLAGS to let net-snmp's build system discover nl-tiny's netlink/netlink.h and netlink/socket.h - Enable the autoreconf fixup to regenerate the broken shipped configure from patched macros - Adjust the depends to unconditionally require libnl-tiny Signed-off-by: Jo-Philipp Wich <jo@mein.io>
8 years ago
net-snmp: build against libnl-tiny Instead of causing nondeterministing conditional compilation depending on whether libnl-core happens to be present or not, fixup the net-snmp package to link against libnl-tiny which is present by default on the majority of systems. In order to successfully build against libnl-tiny, a number of things had to be fixed in both the upstream configure and the outer Makefile: - Add a patch which fixes the upstream configure macros to properly handle cases where the cache variables for nl_connect() and netlink.h tests are predefined. Without this patch, all subsequent link tests in configure will fail, causing the build system to assume functions like opendir() or readdir() to be missing, leading to build failures later on due to conflicting redefinitions of structures and function prototypes - In the same patch, stop probing the host systems /usr/include/libnl-3 if ac_cv_header_netlink_netlink_h is given. This brings the proprietary configure bits in line with the behaviour expected from autoconfig in a cross compile setting - Explicitely request nl support by passing the --with-nl flag to configure - Pass the required cache variables to skip the broken tests for nl_connect() and netlink.h - Amend TARGET_CPPFLAGS to let net-snmp's build system discover nl-tiny's netlink/netlink.h and netlink/socket.h - Enable the autoreconf fixup to regenerate the broken shipped configure from patched macros - Adjust the depends to unconditionally require libnl-tiny Signed-off-by: Jo-Philipp Wich <jo@mein.io>
8 years ago
net-snmp: build against libnl-tiny Instead of causing nondeterministing conditional compilation depending on whether libnl-core happens to be present or not, fixup the net-snmp package to link against libnl-tiny which is present by default on the majority of systems. In order to successfully build against libnl-tiny, a number of things had to be fixed in both the upstream configure and the outer Makefile: - Add a patch which fixes the upstream configure macros to properly handle cases where the cache variables for nl_connect() and netlink.h tests are predefined. Without this patch, all subsequent link tests in configure will fail, causing the build system to assume functions like opendir() or readdir() to be missing, leading to build failures later on due to conflicting redefinitions of structures and function prototypes - In the same patch, stop probing the host systems /usr/include/libnl-3 if ac_cv_header_netlink_netlink_h is given. This brings the proprietary configure bits in line with the behaviour expected from autoconfig in a cross compile setting - Explicitely request nl support by passing the --with-nl flag to configure - Pass the required cache variables to skip the broken tests for nl_connect() and netlink.h - Amend TARGET_CPPFLAGS to let net-snmp's build system discover nl-tiny's netlink/netlink.h and netlink/socket.h - Enable the autoreconf fixup to regenerate the broken shipped configure from patched macros - Adjust the depends to unconditionally require libnl-tiny Signed-off-by: Jo-Philipp Wich <jo@mein.io>
8 years ago
net-snmp: build against libnl-tiny Instead of causing nondeterministing conditional compilation depending on whether libnl-core happens to be present or not, fixup the net-snmp package to link against libnl-tiny which is present by default on the majority of systems. In order to successfully build against libnl-tiny, a number of things had to be fixed in both the upstream configure and the outer Makefile: - Add a patch which fixes the upstream configure macros to properly handle cases where the cache variables for nl_connect() and netlink.h tests are predefined. Without this patch, all subsequent link tests in configure will fail, causing the build system to assume functions like opendir() or readdir() to be missing, leading to build failures later on due to conflicting redefinitions of structures and function prototypes - In the same patch, stop probing the host systems /usr/include/libnl-3 if ac_cv_header_netlink_netlink_h is given. This brings the proprietary configure bits in line with the behaviour expected from autoconfig in a cross compile setting - Explicitely request nl support by passing the --with-nl flag to configure - Pass the required cache variables to skip the broken tests for nl_connect() and netlink.h - Amend TARGET_CPPFLAGS to let net-snmp's build system discover nl-tiny's netlink/netlink.h and netlink/socket.h - Enable the autoreconf fixup to regenerate the broken shipped configure from patched macros - Adjust the depends to unconditionally require libnl-tiny Signed-off-by: Jo-Philipp Wich <jo@mein.io>
8 years ago
  1. From: Jo-Philipp Wich <jo@mein.io>
  2. Date: Fri, 6 Jan 2017 13:41:00 +0100
  3. Subject: [PATCH] configure: allow overriding hardcoded /usr/include/libnl3
  4. In a cross-compile setting we do not want to probe the host systems
  5. /usr/include path, therfore allow to disable this include path by passing
  6. ac_cv_header_netlink_netlink_h=yes to configure.
  7. Also disable the testing for libraries providing nl_connect when
  8. netsnmp_cv_func_nl_connect_LIBS is predefined since the proprietary
  9. NETSNMP_SEARCH_LIBS() macro will clobber the internal link flags upon
  10. encountering predefined cache variables, causing all subsequent configure
  11. link tests to fail due to a stray "no" word getting passed to the linker.
  12. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
  13. --- a/configure.d/config_os_libs2
  14. +++ b/configure.d/config_os_libs2
  15. @@ -254,14 +254,22 @@ if test "x$with_nl" != "xno"; then
  16. )
  17. netsnmp_save_CPPFLAGS="$CPPFLAGS"
  18. - CPPFLAGS="${LIBNL3_CFLAGS} $CPPFLAGS"
  19. - NETSNMP_SEARCH_LIBS(nl_connect, nl-3,
  20. - [AC_CHECK_HEADERS(netlink/netlink.h)
  21. - EXTERNAL_MIBGROUP_INCLUDES="$EXTERNAL_MIBGROUP_INCLUDES ${LIBNL3_CFLAGS}"],
  22. - [CPPFLAGS="$netsnmp_save_CPPFLAGS"], [], [], [LMIBLIBS])
  23. + netsnmp_netlink_include_flags=""
  24. if test "x$ac_cv_header_netlink_netlink_h" != xyes; then
  25. - NETSNMP_SEARCH_LIBS(nl_connect, nl, [
  26. - AC_CHECK_HEADERS(netlink/netlink.h)], [], [], LMIBLIBS)
  27. + netsnmp_netlink_include_flags="-I/usr/include/libnl3"
  28. + fi
  29. + CPPFLAGS="$netsnmp_netlink_include_flags $CPPFLAGS"
  30. + if test "x$netsnmp_cv_func_nl_connect_LIBS" = x; then
  31. + NETSNMP_SEARCH_LIBS(nl_connect, nl-3,
  32. + [AC_CHECK_HEADERS(netlink/netlink.h)
  33. + EXTERNAL_MIBGROUP_INCLUDES="$EXTERNAL_MIBGROUP_INCLUDES $netsnmp_netlink_include_flags"],
  34. + [CPPFLAGS="$netsnmp_save_CPPFLAGS"], [], [], [LMIBLIBS])
  35. + if test "x$ac_cv_header_netlink_netlink_h" != xyes; then
  36. + NETSNMP_SEARCH_LIBS(nl_connect, nl, [
  37. + AC_CHECK_HEADERS(netlink/netlink.h)], [], [], LMIBLIBS)
  38. + fi
  39. + else
  40. + LMIBLIBS="$LMIBLIBS $netsnmp_cv_func_nl_connect_LIBS"
  41. fi
  42. if test "x$ac_cv_header_netlink_netlink_h" = xyes; then
  43. AC_EGREP_HEADER([nl_socket_free], [netlink/socket.h],