From ae7f4c2945f058021efaa1660ee74bf4c7a2514a Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Sun, 6 Apr 2014 23:41:40 +0200 Subject: [PATCH] snmp: link with Net-SNMP later Some systems contain static libraries in the output of `net-snmp-config --agent-libs`. It is not possible to build a convenience library with a static library. Therefore, we just link with the appropriate libs in the last step. This should fix #57. --- src/daemon/Makefile.am | 10 +++++----- tests/Makefile.am | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/daemon/Makefile.am b/src/daemon/Makefile.am index 48d5c787..828e0c38 100644 --- a/src/daemon/Makefile.am +++ b/src/daemon/Makefile.am @@ -87,11 +87,15 @@ liblldpd_la_SOURCES += \ priv-bsd.c endif +## lldpd +lldpd_SOURCES = main.c +lldpd_LDADD = liblldpd.la @LIBEVENT_LDFLAGS@ + # Add SNMP support if needed if USE_SNMP liblldpd_la_SOURCES += agent.c agent_priv.c agent.h liblldpd_la_CFLAGS += @NETSNMP_CFLAGS@ -liblldpd_la_LIBADD += @NETSNMP_LIBS@ +lldpd_LDADD += @NETSNMP_LIBS@ endif # seccomp support @@ -110,10 +114,6 @@ liblldpd_la_CFLAGS += @SECCOMP_CFLAGS@ liblldpd_la_LIBADD += @SECCOMP_LIBS@ endif -## lldpd -lldpd_SOURCES = main.c -lldpd_LDADD = liblldpd.la @LIBEVENT_LDFLAGS@ - ## Systemtap/DTrace EXTRA_DIST = dtrace2systemtap.awk if ENABLE_SYSTEMTAP diff --git a/tests/Makefile.am b/tests/Makefile.am index c5e2fccb..e0aa299b 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -36,6 +36,7 @@ TESTS += check_snmp check_snmp_SOURCES = check_snmp.c \ $(top_srcdir)/src/daemon/lldpd.h \ $(top_srcdir)/src/daemon/agent.h +LDADD += @NETSNMP_LIBS@ endif check_PROGRAMS = $(TESTS) -- 2.39.5