ibm-s390-linux / s390-tools

Tools for use with the s390 Linux kernel and device drivers
MIT License
63 stars 59 forks source link

osasnmpd/Makefile: fix cross-compilation #99

Closed ffontaine closed 3 years ago

ffontaine commented 3 years ago

Fix the following build failure by allowing the user to provide NET_SNMP_CONFIG:

/bin/sh: net-snmp-config: command not found
/home/buildroot/autobuild/run/instance-2/output-1/host/lib/gcc/s390x-buildroot-linux-gnu/9.3.0/../../../../s390x-buildroot-linux-gnu/bin/ld: osasnmpd.o: in function `main':
osasnmpd.c:(.text.startup+0xcc): undefined reference to `snmp_log_perror'

Fixes:

Signed-off-by: Fabrice Fontaine fontaine.fabrice@gmail.com

sharkcz commented 3 years ago

LGTM, but I think there will be similar issues in other (optional) components. Other option is to make osasnmpd optional that depends on availability of net-snmp.

ffontaine commented 3 years ago

We are already managing most (all?) of the optional components of s390-tools on buildroot: https://git.buildroot.net/buildroot/tree/package/s390-tools/s390-tools.mk This patch is needed to fix cross-compilation when net-snmp is available. Indeed, when you're cross-compiling, net-snmp-config won't be found on the host. So buildroot will provide it (e.g. https://patchwork.ozlabs.org/project/buildroot/patch/20201128095108.1069483-1-fontaine.fabrice@gmail.com/)

mhartmay commented 3 years ago

LGTM.

Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>