net-snmp: build against libnl-tiny 3775/head
authorJo-Philipp Wich <jo@mein.io>
Fri, 6 Jan 2017 15:07:38 +0000 (16:07 +0100)
committerJo-Philipp Wich <jo@mein.io>
Fri, 6 Jan 2017 15:46:28 +0000 (16:46 +0100)
commit399d0e57cdf46b27b40a19b348191c3f4d6ea0d8
tree04cb0c0123f70a0692d48d9a99e24e999fbdf01f
parenta3e7b2dc0ef11ed24dbac06ac3933e85e4d5d829
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>
net/net-snmp/Makefile
net/net-snmp/patches/000-cross-compile.patch [new file with mode: 0644]