net-snmp: update to 5.9.4
[feed/packages.git] / net / net-snmp / patches / 000-cross-compile.patch
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
5 In a cross-compile setting we do not want to probe the host systems
6 /usr/include path, therfore allow to disable this include path by passing
7 ac_cv_header_netlink_netlink_h=yes to configure.
8
9 Also disable the testing for libraries providing nl_connect when
10 netsnmp_cv_func_nl_connect_LIBS is predefined since the proprietary
11 NETSNMP_SEARCH_LIBS() macro will clobber the internal link flags upon
12 encountering predefined cache variables, causing all subsequent configure
13 link tests to fail due to a stray "no" word getting passed to the linker.
14
15 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
16 --- a/configure.d/config_os_libs2
17 +++ b/configure.d/config_os_libs2
18 @@ -252,14 +252,22 @@ if test "x$with_nl" != "xno"; then
19 case $target_os in
20 linux*) # Check for libnl (linux)
21 netsnmp_save_CPPFLAGS="$CPPFLAGS"
22 - CPPFLAGS="${LIBNL3_CFLAGS} ${LIBNLROUTE3_CFLAGS} $CPPFLAGS"
23 - NETSNMP_SEARCH_LIBS(nl_connect, nl-3,
24 - [AC_CHECK_HEADERS(netlink/netlink.h)
25 - EXTERNAL_MIBGROUP_INCLUDES="$EXTERNAL_MIBGROUP_INCLUDES ${LIBNL3_CFLAGS}"],
26 - [CPPFLAGS="$netsnmp_save_CPPFLAGS"], [], [LMIBLIBS])
27 + netsnmp_netlink_include_flags=""
28 if test "x$ac_cv_header_netlink_netlink_h" != xyes; then
29 - NETSNMP_SEARCH_LIBS(nl_connect, nl, [
30 - AC_CHECK_HEADERS(netlink/netlink.h)], [], [], LMIBLIBS)
31 + netsnmp_netlink_include_flags="-I/usr/include/libnl3"
32 + fi
33 + CPPFLAGS="$netsnmp_netlink_include_flags $CPPFLAGS"
34 + if test "x$netsnmp_cv_func_nl_connect_LIBS" = x; then
35 + NETSNMP_SEARCH_LIBS(nl_connect, nl-3,
36 + [AC_CHECK_HEADERS(netlink/netlink.h)
37 + EXTERNAL_MIBGROUP_INCLUDES="$EXTERNAL_MIBGROUP_INCLUDES $netsnmp_netlink_include_flags"],
38 + [CPPFLAGS="$netsnmp_save_CPPFLAGS"], [], [], [LMIBLIBS])
39 + if test "x$ac_cv_header_netlink_netlink_h" != xyes; then
40 + NETSNMP_SEARCH_LIBS(nl_connect, nl, [
41 + AC_CHECK_HEADERS(netlink/netlink.h)], [], [], LMIBLIBS)
42 + fi
43 + else
44 + LMIBLIBS="$LMIBLIBS $netsnmp_cv_func_nl_connect_LIBS"
45 fi
46 if test "x$ac_cv_header_netlink_netlink_h" = xyes; then
47 AC_EGREP_HEADER([nl_socket_free], [netlink/socket.h],