]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
build: isolate SNMP-related files during compilation
authorVincent Bernat <vincent@bernat.im>
Wed, 21 Feb 2018 18:19:37 +0000 (19:19 +0100)
committerVincent Bernat <vincent@bernat.im>
Wed, 21 Feb 2018 20:20:03 +0000 (21:20 +0100)
@NETSNMP_CFLAGS@ is likely to contain some extensively damaged
flags. Ensure we use them only to compile SNMP-related files.

This should fix #231.

src/daemon/Makefile.am

index 5363a4c38f4442459bc98ad1c9705536237dfbc7..1e40bb1f2d9c2065ea44e04d69347fee8d508fc3 100644 (file)
@@ -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