From: Vincent Bernat Date: Tue, 24 Jan 2012 06:45:44 +0000 (+0100) Subject: Use LIBADD instead of LDADD when appropriate. X-Git-Tag: 0.6.0~58 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=132d1e41c368074e805e0da3cd45bc642c498662;p=thirdparty%2Flldpd.git Use LIBADD instead of LDADD when appropriate. --- diff --git a/src/Makefile.am b/src/Makefile.am index 006ac624..3778ab97 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,14 +1,20 @@ sbin_PROGRAMS = lldpd lldpctl noinst_LTLIBRARIES = liblldpd.la libcommon.la -## Shared by all executables +## Convenience library for lldpd, lldpctl and tests libcommon_la_SOURCES = log.c ctl.c marshal.c marshal.h lldpd.h lldp.h cdp.h compat.h sonmp.h edp.h libcommon_la_LIBADD = @LTLIBOBJS@ -## Used for lldpd and tests +## Convenience library for lldpd and tests liblldpd_la_SOURCES = frame.h frame.c lldpd.c lldp.c cdp.c sonmp.c edp.c \ interfaces.c client.c priv.c privsep_fdpass.c dmi.c ctl-server.c liblldpd_la_LIBADD = libcommon.la +# 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@ +endif ## lldpd lldpd_SOURCES = main.c @@ -17,18 +23,8 @@ lldpd_LDADD = liblldpd.la ## lldpctl lldpctl_SOURCES = lldpctl.h lldpctl.c display.c writer.h text_writer.c kv_writer.c lldpctl_LDADD = libcommon.la - -## With SNMP... -if USE_SNMP -liblldpd_la_SOURCES += agent.c agent_priv.c agent.h -liblldpd_la_CFLAGS = @NETSNMP_CFLAGS@ -lldpd_LDADD += @NETSNMP_LIBS@ -endif - if USE_XML lldpctl_SOURCES += xml_writer.c lldpctl_CFLAGS = @XML2_CFLAGS@ lldpctl_LDADD += @XML2_LIBS@ endif - - diff --git a/tests/Makefile.am b/tests/Makefile.am index df67292b..9f6ae471 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -33,8 +33,6 @@ TESTS += check_snmp check_snmp_SOURCES = check_snmp.c \ $(top_builddir)/src/lldpd.h \ $(top_builddir)/src/agent.h - -LDADD += @NETSNMP_LIBS@ endif check_PROGRAMS = $(TESTS)