]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
snmp: link with Net-SNMP later
authorVincent Bernat <vincent@bernat.im>
Sun, 6 Apr 2014 21:41:40 +0000 (23:41 +0200)
committerVincent Bernat <vincent@bernat.im>
Sun, 6 Apr 2014 21:41:40 +0000 (23:41 +0200)
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
tests/Makefile.am

index 48d5c78758751b345dbba0d371d97b4a0bfb83e2..828e0c388d8434632120d9320bc781ac61f24a24 100644 (file)
@@ -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
index c5e2fccbcd8a702fa3324308cdbbc92397119c87..e0aa299b0b471823619391e427591370253d3b0a 100644 (file)
@@ -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)