]> git.proxmox.com Git - mirror_frr.git/blobdiff - lib/subdir.am
Merge pull request #3472 from donaldsharp/flags
[mirror_frr.git] / lib / subdir.am
index ef0cefe7a5270cadbc6b049ea480e734f766c3e9..43b39100cb3a701675bf540109f9d08db75fee8f 100644 (file)
@@ -2,8 +2,8 @@
 # libfrr
 #
 lib_LTLIBRARIES += lib/libfrr.la
-lib_libfrr_la_LDFLAGS = -version-info 0:0:0
-lib_libfrr_la_LIBADD = @LIBCAP@
+lib_libfrr_la_LDFLAGS = -version-info 0:0:0 -Xlinker -e_libfrr_version
+lib_libfrr_la_LIBADD = @LIBCAP@ $(UNWIND_LIBS) -lyang
 
 lib_libfrr_la_SOURCES = \
        lib/agg_table.c \
@@ -29,6 +29,7 @@ lib_libfrr_la_SOURCES = \
        lib/graph.c \
        lib/hash.c \
        lib/hook.c \
+       lib/id_alloc.c \
        lib/if.c \
        lib/if_rmap.c \
        lib/imsg-buffer.c \
@@ -50,6 +51,9 @@ lib_libfrr_la_SOURCES = \
        lib/netns_linux.c \
        lib/netns_other.c \
        lib/nexthop_group.c \
+       lib/northbound.c \
+       lib/northbound_cli.c \
+       lib/northbound_db.c \
        lib/openbsd-tree.c \
        lib/pid_output.c \
        lib/plist.c \
@@ -80,14 +84,49 @@ lib_libfrr_la_SOURCES = \
        lib/vty.c \
        lib/wheel.c \
        lib/workqueue.c \
+       lib/yang.c \
+       lib/yang_translator.c \
+       lib/yang_wrappers.c \
        lib/zclient.c \
        lib/logicalrouter.c \
+       lib/lua.c \
        # end
 
+nodist_lib_libfrr_la_SOURCES = \
+       yang/frr-interface.yang.c \
+       yang/frr-route-types.yang.c \
+       yang/frr-module-translator.yang.c \
+       # end
+
+vtysh_scan += \
+       $(top_srcdir)/lib/distribute.c \
+       $(top_srcdir)/lib/filter.c \
+       $(top_srcdir)/lib/if.c \
+       $(top_srcdir)/lib/if_rmap.c \
+       $(top_srcdir)/lib/keychain.c \
+       $(top_srcdir)/lib/logicalrouter.c \
+       $(top_srcdir)/lib/nexthop_group.c \
+       $(top_srcdir)/lib/plist.c \
+       $(top_srcdir)/lib/routemap.c \
+       $(top_srcdir)/lib/vrf.c \
+       $(top_srcdir)/lib/vty.c \
+       # end
+# can be loaded as DSO - always include for vtysh
+vtysh_scan += $(top_srcdir)/lib/agentx.c
+
+if SQLITE3
+lib_libfrr_la_LIBADD += -lsqlite3
+lib_libfrr_la_SOURCES += lib/db.c
+endif
+
+lib/if_clippy.c: $(CLIPPY_DEPS)
+lib/if.lo: lib/if_clippy.c
 lib/plist_clippy.c: $(CLIPPY_DEPS)
 lib/plist.lo: lib/plist_clippy.c
 lib/nexthop_group_clippy.c: $(CLIPPY_DEPS)
 lib/nexthop_group.lo: lib/nexthop_group_clippy.c
+lib/northbound_cli_clippy.c: $(CLIPPY_DEPS)
+lib/northbound_cli.lo: lib/northbound_cli_clippy.c
 
 pkginclude_HEADERS += \
        lib/agg_table.h \
@@ -100,6 +139,7 @@ pkginclude_HEADERS += \
        lib/command_match.h \
        lib/compiler.h \
        lib/csv.h \
+       lib/db.h \
        lib/debug.h \
        lib/distribute.h \
        lib/event_counter.h \
@@ -114,6 +154,7 @@ pkginclude_HEADERS += \
        lib/graph.h \
        lib/hash.h \
        lib/hook.h \
+       lib/id_alloc.h \
        lib/if.h \
        lib/if_rmap.h \
        lib/imsg.h \
@@ -135,6 +176,9 @@ pkginclude_HEADERS += \
        lib/network.h \
        lib/nexthop.h \
        lib/nexthop_group.h \
+       lib/northbound.h \
+       lib/northbound_cli.h \
+       lib/northbound_db.h \
        lib/ns.h \
        lib/openbsd-queue.h \
        lib/openbsd-tree.h \
@@ -170,10 +214,14 @@ pkginclude_HEADERS += \
        lib/vxlan.h \
        lib/wheel.h \
        lib/workqueue.h \
+       lib/yang.h \
+       lib/yang_translator.h \
+       lib/yang_wrappers.h \
        lib/zassert.h \
        lib/zclient.h \
        lib/zebra.h \
        lib/logicalrouter.h \
+       lib/lua.h \
        lib/pbr.h \
        # end
 
@@ -189,6 +237,17 @@ noinst_HEADERS += \
        lib/plist_int.h \
        #end
 
+# General note about module and module helper library (libfrrsnmp, libfrrzmq)
+# linking:  If we're linking libfrr statically into daemons, we *must* remove
+# libfrr from modules because modules will always link it in dynamically and
+# thus 2 copies of libfrr will be loaded... hilarity ensues.
+#
+# Not linking libfrr into modules should generally work fine because the
+# executable refers to libfrr either way and the dynamic linker should make
+# libfrr available to modules.  If some OS platform has a dynamic linker that
+# doesn't do that, libfrr needs to be readded to modules, but _only_ _if_
+# it's not linked into daemons statically.
+
 #
 # SNMP support
 #
@@ -198,7 +257,7 @@ endif
 
 lib_libfrrsnmp_la_CFLAGS = $(WERROR) $(SNMP_CFLAGS) -std=gnu99
 lib_libfrrsnmp_la_LDFLAGS = -version-info 0:0:0
-lib_libfrrsnmp_la_LIBADD = lib/libfrr.la $(SNMP_LIBS)
+lib_libfrrsnmp_la_LIBADD = $(SNMP_LIBS)
 lib_libfrrsnmp_la_SOURCES = \
        lib/agentx.c \
        lib/snmp.c \
@@ -214,11 +273,35 @@ endif
 
 lib_libfrrzmq_la_CFLAGS = $(WERROR) $(ZEROMQ_CFLAGS)
 lib_libfrrzmq_la_LDFLAGS = -version-info 0:0:0
-lib_libfrrzmq_la_LIBADD = lib/libfrr.la $(ZEROMQ_LIBS)
+lib_libfrrzmq_la_LIBADD = $(ZEROMQ_LIBS)
 lib_libfrrzmq_la_SOURCES = \
        lib/frr_zmq.c \
        #end
 
+#
+# Tail-f's ConfD support
+#
+if CONFD
+module_LTLIBRARIES += lib/confd.la
+endif
+
+lib_confd_la_CFLAGS = $(WERROR) $(CONFD_CFLAGS)
+lib_confd_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
+lib_confd_la_LIBADD = lib/libfrr.la -lconfd
+lib_confd_la_SOURCES = lib/northbound_confd.c
+
+#
+# Sysrepo support
+#
+if SYSREPO
+module_LTLIBRARIES += lib/sysrepo.la
+endif
+
+lib_sysrepo_la_CFLAGS = $(WERROR)
+lib_sysrepo_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
+lib_sysrepo_la_LIBADD = lib/libfrr.la -lsysrepo
+lib_sysrepo_la_SOURCES = lib/northbound_sysrepo.c
+
 #
 # CLI utilities
 #
@@ -238,9 +321,10 @@ lib_grammar_sandbox_SOURCES = \
 lib_grammar_sandbox_LDADD = \
        lib/libfrr.la
 
-lib_clippy_CPPFLAGS = $(AM_CPPFLAGS) -D_GNU_SOURCE -DBUILDING_CLIPPY @SAN_CLIPPY_FLAGS@
-lib_clippy_CFLAGS = $(PYTHON_CFLAGS) @SAN_CLIPPY_FLAGS@
+lib_clippy_CPPFLAGS = $(AM_CPPFLAGS) -D_GNU_SOURCE -DBUILDING_CLIPPY
+lib_clippy_CFLAGS = $(PYTHON_CFLAGS)
 lib_clippy_LDADD = $(PYTHON_LIBS)
+lib_clippy_LDFLAGS = -export-dynamic
 lib_clippy_SOURCES = \
        lib/clippy.c \
        lib/command_graph.c \
@@ -306,6 +390,7 @@ lib/lib_clippy-command_parse.$(OBJEXT): lib/command_lex.h
 
 lib/route_types.h: $(top_srcdir)/lib/route_types.txt $(top_srcdir)/lib/route_types.pl
        @PERL@ $(top_srcdir)/lib/route_types.pl < $(top_srcdir)/lib/route_types.txt > $@
+DISTCLEANFILES += lib/route_types.h
 
 if GIT_VERSION
 # bit of a trick here to always have up-to-date git stamps without triggering