From: Vincent Bernat Date: Wed, 21 Feb 2018 18:19:37 +0000 (+0100) Subject: build: isolate SNMP-related files during compilation X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fheads%2Ffix%2Fbuild-netsnmp-cflags;p=thirdparty%2Flldpd.git build: isolate SNMP-related files during compilation @NETSNMP_CFLAGS@ is likely to contain some extensively damaged flags. Ensure we use them only to compile SNMP-related files. This should fix #231. --- diff --git a/src/daemon/Makefile.am b/src/daemon/Makefile.am index 5363a4c3..1e40bb1f 100644 --- a/src/daemon/Makefile.am +++ b/src/daemon/Makefile.am @@ -100,13 +100,6 @@ liblldpd_la_SOURCES += \ priv-bsd.c endif -# Add SNMP support if needed -if USE_SNMP -liblldpd_la_SOURCES += agent.c agent_priv.c agent.h -liblldpd_la_CFLAGS += @NETSNMP_CFLAGS@ -lldpd_LDADD += @NETSNMP_LIBS@ -endif - # seccomp support if USE_SECCOMP BUILT_SOURCES += syscall-names.h @@ -123,6 +116,16 @@ liblldpd_la_CFLAGS += @SECCOMP_CFLAGS@ liblldpd_la_LIBADD += @SECCOMP_LIBS@ endif +# Add SNMP support if needed +if USE_SNMP +noinst_LTLIBRARIES += liblldpd-snmp.la +liblldpd_snmp_la_SOURCES = agent.c agent_priv.c agent.h +liblldpd_snmp_la_CFLAGS = $(liblldpd_la_CFLAGS) @NETSNMP_CFLAGS@ +liblldpd_snmp_la_CPPFLAGS = $(liblldpd_la_CPPFLAGS) +liblldpd_la_LIBADD += liblldpd-snmp.la +lldpd_LDADD += @NETSNMP_LIBS@ +endif + ## Systemtap/DTrace EXTRA_DIST = dtrace2systemtap.awk if ENABLE_SYSTEMTAP