package/syslog-ng: fix build if net-snmp is installed on the host
authorThomas De Schampheleire <thomas.de_schampheleire@nokia.com>
Mon, 16 Mar 2020 15:01:05 +0000 (16:01 +0100)
committerYann E. MORIN <yann.morin.1998@free.fr>
Tue, 17 Mar 2020 20:22:14 +0000 (21:22 +0100)
commit4ff6e5239240a4e1bdf73c41d6e9bff9473ec62c
treeb6deeee8138867e2c8f17949f57ca5695a031d9e
parentc84ce1f98cf47a47b479c209ce88661c8dbcb710
package/syslog-ng: fix build if net-snmp is installed on the host

If syslog-ng is selected in Buildroot and net-snmp is not, but net-snmp is
found on the host machine (at least its net-snmp-config script) then
compilation of syslog-ng fails with:

  CC       modules/snmp-dest/modules_snmp_dest_libsnmpdest_la-snmpdest-grammar.lo
  CC       modules/snmp-dest/modules_snmp_dest_libsnmpdest_la-snmpdest.lo
  CC       modules/snmp-dest/modules_snmp_dest_libsnmpdest_la-snmpdest-plugin.lo
arm-none-linux-gnueabi-gcc: ERROR: unsafe header/library path used in cross-compilation: '-I/usr/include'
make[3]: *** [Makefile:17397: modules/snmp-dest/modules_snmp_dest_libsnmpdest_la-snmpdest-grammar.lo] Error 1
make[3]: *** Waiting for unfinished jobs....
arm-none-linux-gnueabi-gcc: ERROR: unsafe header/library path used in cross-compilation: '-I/usr/include'
make[3]: *** [Makefile:17404: modules/snmp-dest/modules_snmp_dest_libsnmpdest_la-snmpdest.lo] Error 1
arm-none-linux-gnueabi-gcc: ERROR: unsafe header/library path used in cross-compilation: '-I/usr/include'
make[3]: *** [Makefile:17411: modules/snmp-dest/modules_snmp_dest_libsnmpdest_la-snmpdest-plugin.lo] Error 1
make[2]: *** [Makefile:21428: all-recursive] Error 1
make[1]: *** [Makefile:8740: all] Error 2
make[1]: Leaving directory '.../buildroot/output/build/syslog-ng-3.25.1'
make: *** [package/pkg-generic.mk:269: .../buildroot/output/build/syslog-ng-3.25.1/.stamp_built] Error 2

The path /usr/include is obtained via /usr/bin/net-snmp-config.

The fix comprises two parts:
1. only enable net-snmp support in syslog-ng if the net-snmp package is
enabled in Buildroot
2. for the case where net-snmp is selected in Buildroot, fix the configure
script of syslog-ng to allow parsing --with-netsnmp=<path> correctly.

Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
Reviewed-by: Chris Packham <judge.packham@gmail.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
package/syslog-ng/0002-configure.ac-fix-with-netsnmp.patch [new file with mode: 0644]
package/syslog-ng/syslog-ng.mk