summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2016-06-13 15:44:26 +0200
committerDavid Lamparter <equinox@opensourcerouting.org>2017-03-25 08:52:36 +0100
commit46081234b48eb9569271f868e1fbd5f2bc78c9d6 (patch)
treeb168244328c0781f55d2d83d6a4249e33d0cc84f
parentlib: add hook infrastructure (diff)
downloadfrr-46081234b48eb9569271f868e1fbd5f2bc78c9d6.tar.xz
frr-46081234b48eb9569271f868e1fbd5f2bc78c9d6.zip
build: split off libfrrsnmp
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
-rw-r--r--bgpd/Makefile.am4
-rwxr-xr-xconfigure.ac7
-rw-r--r--lib/Makefile.am13
-rw-r--r--ospf6d/Makefile.am2
-rw-r--r--ospfd/Makefile.am2
-rw-r--r--ripd/Makefile.am2
-rw-r--r--zebra/Makefile.am2
7 files changed, 22 insertions, 10 deletions
diff --git a/bgpd/Makefile.am b/bgpd/Makefile.am
index 50afc7ed6..50cd2d28e 100644
--- a/bgpd/Makefile.am
+++ b/bgpd/Makefile.am
@@ -94,11 +94,11 @@ noinst_HEADERS = \
$(BGP_VNC_RFAPI_HD) bgp_attr_evpn.h bgp_evpn.h bgp_evpn_vty.h bgp_vpn.h
bgpd_SOURCES = bgp_main.c
-bgpd_LDADD = libbgp.a $(BGP_VNC_RFP_LIB) ../lib/libfrr.la @LIBCAP@ @LIBM@
+bgpd_LDADD = libbgp.a $(BGP_VNC_RFP_LIB) ../lib/libfrr.la ../lib/libfrrsnmp.la @LIBCAP@ @LIBM@
bgpd_LDFLAGS = $(BGP_VNC_RFP_LD_FLAGS)
bgp_btoa_SOURCES = bgp_btoa.c
-bgp_btoa_LDADD = libbgp.a $(BGP_VNC_RFP_LIB) ../lib/libfrr.la @LIBCAP@ @LIBM@
+bgp_btoa_LDADD = libbgp.a $(BGP_VNC_RFP_LIB) ../lib/libfrr.la ../lib/libfrrsnmp.la @LIBCAP@ @LIBM@
bgp_btoa_LDFLAGS = $(BGP_VNC_RFP_LD_FLAGS)
examplesdir = $(exampledir)
diff --git a/configure.ac b/configure.ac
index b94b8bb16..27d456191 100755
--- a/configure.ac
+++ b/configure.ac
@@ -1324,8 +1324,8 @@ if test "${enable_snmp}" != ""; then
if test x"$NETSNMP_CONFIG" = x"no"; then
AC_MSG_ERROR([--enable-snmp given but unable to find net-snmp-config])
fi
- LIBS="$LIBS `${NETSNMP_CONFIG} --agent-libs`"
- CFLAGS="`${NETSNMP_CONFIG} --base-cflags` $CFLAGS"
+ SNMP_LIBS="`${NETSNMP_CONFIG} --agent-libs`"
+ SNMP_CFLAGS="`${NETSNMP_CONFIG} --base-cflags`"
AC_MSG_CHECKING([whether we can link to Net-SNMP])
AC_LINK_IFELSE([AC_LANG_PROGRAM([
int main(void);
@@ -1353,6 +1353,9 @@ int main(void);
AH_TEMPLATE([SNMP_AGENTX], [Use SNMP AgentX to interface with snmpd])
AC_DEFINE_UNQUOTED(AS_TR_CPP(SNMP_${SNMP_METHOD}),,SNMP method to interface with snmpd)
fi
+AM_CONDITIONAL([SNMP], [test "x${SNMP_METHOD}" != "x"])
+AC_SUBST(SNMP_LIBS)
+AC_SUBST(SNMP_CFLAGS)
dnl ---------------
dnl dlopen & dlinfo
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 7709ce45e..14259f2e0 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -10,7 +10,7 @@ command_lex.h: command_lex.c
@if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) command_lex.c; else :; fi
command_parse.lo: command_lex.h
-lib_LTLIBRARIES = libfrr.la
+lib_LTLIBRARIES = libfrr.la libfrrsnmp.la
libfrr_la_LDFLAGS = -version-info 0:0:0
libfrr_la_SOURCES = \
@@ -20,7 +20,7 @@ libfrr_la_SOURCES = \
command.c \
sockunion.c prefix.c thread.c if.c buffer.c table.c hash.c \
filter.c routemap.c distribute.c stream.c log.c plist.c \
- zclient.c sockopt.c smux.c agentx.c snmp.c md5.c if_rmap.c keychain.c privs.c \
+ zclient.c sockopt.c md5.c if_rmap.c keychain.c privs.c \
sigevent.c pqueue.c jhash.c workqueue.c nexthop.c json.c \
ptm_lib.c csv.c bfd.c vrf.c systemd.c ns.c memory.c memory_vty.c \
imsg-buffer.c imsg.c skiplist.c \
@@ -40,6 +40,15 @@ BUILT_SOURCES = route_types.h gitversion.h command_parse.h command_lex.h
libfrr_la_LIBADD = @LIBCAP@
+libfrrsnmp_la_CFLAGS = $(WERROR) $(SNMP_CFLAGS)
+libfrrsnmp_la_LDFLAGS = -version-info 0:0:0
+libfrrsnmp_la_LIBADD = libfrr.la $(SNMP_LIBS)
+libfrrsnmp_la_SOURCES = \
+ agentx.c \
+ smux.c \
+ snmp.c \
+ #end
+
pkginclude_HEADERS = \
buffer.h checksum.h filter.h getopt.h hash.h \
if.h linklist.h log.h \
diff --git a/ospf6d/Makefile.am b/ospf6d/Makefile.am
index 06fc7a30a..8e62b1d5b 100644
--- a/ospf6d/Makefile.am
+++ b/ospf6d/Makefile.am
@@ -28,7 +28,7 @@ noinst_HEADERS = \
ospf6d_SOURCES = \
ospf6_main.c $(libospf6_a_SOURCES)
-ospf6d_LDADD = ../lib/libfrr.la @LIBCAP@
+ospf6d_LDADD = ../lib/libfrr.la ../lib/libfrrsnmp.la @LIBCAP@
examplesdir = $(exampledir)
dist_examples_DATA = ospf6d.conf.sample
diff --git a/ospfd/Makefile.am b/ospfd/Makefile.am
index 71e0df0dc..5555fb0da 100644
--- a/ospfd/Makefile.am
+++ b/ospfd/Makefile.am
@@ -31,7 +31,7 @@ noinst_HEADERS = \
ospfd_SOURCES = ospf_main.c
-ospfd_LDADD = libfrrospf.a ../lib/libfrr.la @LIBCAP@ @LIBM@
+ospfd_LDADD = libfrrospf.a ../lib/libfrr.la ../lib/libfrrsnmp.la @LIBCAP@ @LIBM@
EXTRA_DIST = OSPF-MIB.txt OSPF-TRAP-MIB.txt ChangeLog.opaque.txt
diff --git a/ripd/Makefile.am b/ripd/Makefile.am
index 7967ff153..47c471aeb 100644
--- a/ripd/Makefile.am
+++ b/ripd/Makefile.am
@@ -21,7 +21,7 @@ noinst_HEADERS = \
ripd_SOURCES = \
rip_main.c $(librip_a_SOURCES)
-ripd_LDADD = ../lib/libfrr.la @LIBCAP@
+ripd_LDADD = ../lib/libfrr.la ../lib/libfrrsnmp.la @LIBCAP@
examplesdir = $(exampledir)
dist_examples_DATA = ripd.conf.sample
diff --git a/zebra/Makefile.am b/zebra/Makefile.am
index 50bc065c6..4711c5e0b 100644
--- a/zebra/Makefile.am
+++ b/zebra/Makefile.am
@@ -62,7 +62,7 @@ noinst_HEADERS = \
zebra_ns.h zebra_vrf.h ioctl_solaris.h zebra_static.h zebra_mpls.h \
kernel_netlink.h if_netlink.h zebra_mroute.h label_manager.h
-zebra_LDADD = $(otherobj) ../lib/libfrr.la $(LIBCAP) $(Q_FPM_PB_CLIENT_LDOPTS)
+zebra_LDADD = $(otherobj) ../lib/libfrr.la ../lib/libfrrsnmp.la $(LIBCAP) $(Q_FPM_PB_CLIENT_LDOPTS)
testzebra_LDADD = ../lib/libfrr.la $(LIBCAP)