]> git.proxmox.com Git - mirror_frr.git/blob - lib/subdir.am
lib, configure.ac: initial LTTng support
[mirror_frr.git] / lib / subdir.am
1 #
2 # libfrr
3 #
4 lib_LTLIBRARIES += lib/libfrr.la
5 lib_libfrr_la_LDFLAGS = -version-info 0:0:0 -Xlinker -e_libfrr_version
6 lib_libfrr_la_LIBADD = $(LIBCAP) $(UNWIND_LIBS) $(LIBYANG_LIBS) $(LUA_LIB) $(UST_LIBS) $(LIBM)
7
8 lib_libfrr_la_SOURCES = \
9 lib/agg_table.c \
10 lib/atomlist.c \
11 lib/bfd.c \
12 lib/buffer.c \
13 lib/checksum.c \
14 lib/command.c \
15 lib/command_graph.c \
16 lib/command_lex.l \
17 lib/command_match.c \
18 lib/command_parse.y \
19 lib/csv.c \
20 lib/debug.c \
21 lib/defaults.c \
22 lib/distribute.c \
23 lib/ferr.c \
24 lib/filter.c \
25 lib/filter_cli.c \
26 lib/filter_nb.c \
27 lib/frrcu.c \
28 lib/frrlua.c \
29 lib/frr_pthread.c \
30 lib/frrstr.c \
31 lib/getopt.c \
32 lib/getopt1.c \
33 lib/grammar_sandbox.c \
34 lib/graph.c \
35 lib/hash.c \
36 lib/hook.c \
37 lib/id_alloc.c \
38 lib/if.c \
39 lib/if_rmap.c \
40 lib/imsg-buffer.c \
41 lib/imsg.c \
42 lib/jhash.c \
43 lib/json.c \
44 lib/keychain.c \
45 lib/ldp_sync.c \
46 lib/lib_errors.c \
47 lib/lib_vty.c \
48 lib/libfrr.c \
49 lib/linklist.c \
50 lib/log.c \
51 lib/log_filter.c \
52 lib/log_vty.c \
53 lib/md5.c \
54 lib/memory.c \
55 lib/mlag.c \
56 lib/module.c \
57 lib/mpls.c \
58 lib/srv6.c \
59 lib/network.c \
60 lib/nexthop.c \
61 lib/netns_linux.c \
62 lib/netns_other.c \
63 lib/nexthop_group.c \
64 lib/northbound.c \
65 lib/northbound_cli.c \
66 lib/northbound_db.c \
67 lib/ntop.c \
68 lib/openbsd-tree.c \
69 lib/pid_output.c \
70 lib/plist.c \
71 lib/prefix.c \
72 lib/privs.c \
73 lib/ptm_lib.c \
74 lib/pullwr.c \
75 lib/qobj.c \
76 lib/ringbuf.c \
77 lib/routemap.c \
78 lib/routemap_cli.c \
79 lib/routemap_northbound.c \
80 lib/sbuf.c \
81 lib/seqlock.c \
82 lib/sha256.c \
83 lib/sigevent.c \
84 lib/skiplist.c \
85 lib/sockopt.c \
86 lib/sockunion.c \
87 lib/spf_backoff.c \
88 lib/srcdest_table.c \
89 lib/stream.c \
90 lib/strlcat.c \
91 lib/strlcpy.c \
92 lib/systemd.c \
93 lib/table.c \
94 lib/termtable.c \
95 lib/thread.c \
96 lib/trace.c \
97 lib/typerb.c \
98 lib/typesafe.c \
99 lib/vector.c \
100 lib/vrf.c \
101 lib/vty.c \
102 lib/wheel.c \
103 lib/workqueue.c \
104 lib/yang.c \
105 lib/yang_translator.c \
106 lib/yang_wrappers.c \
107 lib/zclient.c \
108 lib/zlog.c \
109 lib/zlog_targets.c \
110 lib/printf/printf-pos.c \
111 lib/printf/vfprintf.c \
112 lib/printf/glue.c \
113 lib/routing_nb.c \
114 lib/routing_nb_config.c \
115 # end
116
117 nodist_lib_libfrr_la_SOURCES = \
118 yang/frr-filter.yang.c \
119 yang/frr-interface.yang.c \
120 yang/frr-route-map.yang.c \
121 yang/frr-route-types.yang.c \
122 yang/frr-vrf.yang.c \
123 yang/frr-routing.yang.c \
124 yang/frr-nexthop.yang.c \
125 yang/ietf/ietf-routing-types.yang.c \
126 yang/ietf/ietf-interfaces.yang.c \
127 yang/ietf/ietf-bgp-types.yang.c \
128 yang/frr-module-translator.yang.c \
129 yang/frr-nexthop.yang.c \
130 # end
131
132 vtysh_scan += \
133 lib/distribute.c \
134 lib/filter.c \
135 lib/filter_cli.c \
136 lib/if.c \
137 lib/if_rmap.c \
138 lib/keychain.c \
139 lib/lib_vty.c \
140 lib/nexthop_group.c \
141 lib/plist.c \
142 lib/routemap.c \
143 lib/routemap_cli.c \
144 lib/vrf.c \
145 lib/vty.c \
146 # end
147 # can be loaded as DSO - always include for vtysh
148 vtysh_scan += lib/agentx.c
149
150 if SQLITE3
151 lib_libfrr_la_LIBADD += $(SQLITE3_LIBS)
152 lib_libfrr_la_SOURCES += lib/db.c
153 endif
154
155 clippy_scan += \
156 lib/if.c \
157 lib/filter_cli.c \
158 lib/log_vty.c \
159 lib/nexthop_group.c \
160 lib/northbound_cli.c \
161 lib/plist.c \
162 lib/routemap_cli.c \
163 lib/vty.c \
164 # end
165
166 pkginclude_HEADERS += \
167 lib/agg_table.h \
168 lib/atomlist.h \
169 lib/bfd.h \
170 lib/bitfield.h \
171 lib/buffer.h \
172 lib/checksum.h \
173 lib/mlag.h \
174 lib/command.h \
175 lib/command_graph.h \
176 lib/command_match.h \
177 lib/compiler.h \
178 lib/csv.h \
179 lib/db.h \
180 lib/debug.h \
181 lib/defaults.h \
182 lib/distribute.h \
183 lib/ferr.h \
184 lib/filter.h \
185 lib/freebsd-queue.h \
186 lib/frrlua.h \
187 lib/frr_pthread.h \
188 lib/frratomic.h \
189 lib/frrcu.h \
190 lib/frrstr.h \
191 lib/getopt.h \
192 lib/graph.h \
193 lib/hash.h \
194 lib/hook.h \
195 lib/iana_afi.h \
196 lib/id_alloc.h \
197 lib/if.h \
198 lib/if_rmap.h \
199 lib/imsg.h \
200 lib/ipaddr.h \
201 lib/jhash.h \
202 lib/json.h \
203 lib/keychain.h \
204 lib/ldp_sync.h \
205 lib/lib_errors.h \
206 lib/lib_vty.h \
207 lib/libfrr.h \
208 lib/libospf.h \
209 lib/linklist.h \
210 lib/log.h \
211 lib/log_vty.h \
212 lib/md5.h \
213 lib/memory.h \
214 lib/module.h \
215 lib/monotime.h \
216 lib/mpls.h \
217 lib/srv6.h \
218 lib/network.h \
219 lib/nexthop.h \
220 lib/nexthop_group.h \
221 lib/nexthop_group_private.h \
222 lib/northbound.h \
223 lib/northbound_cli.h \
224 lib/northbound_db.h \
225 lib/ns.h \
226 lib/openbsd-queue.h \
227 lib/openbsd-tree.h \
228 lib/plist.h \
229 lib/prefix.h \
230 lib/printfrr.h \
231 lib/privs.h \
232 lib/ptm_lib.h \
233 lib/pullwr.h \
234 lib/pw.h \
235 lib/qobj.h \
236 lib/queue.h \
237 lib/ringbuf.h \
238 lib/routemap.h \
239 lib/sbuf.h \
240 lib/seqlock.h \
241 lib/sha256.h \
242 lib/sigevent.h \
243 lib/skiplist.h \
244 lib/smux.h \
245 lib/sockopt.h \
246 lib/sockunion.h \
247 lib/spf_backoff.h \
248 lib/srcdest_table.h \
249 lib/srte.h \
250 lib/stream.h \
251 lib/systemd.h \
252 lib/table.h \
253 lib/termtable.h \
254 lib/thread.h \
255 lib/trace.h \
256 lib/typerb.h \
257 lib/typesafe.h \
258 lib/vector.h \
259 lib/vlan.h \
260 lib/vrf.h \
261 lib/vrf_int.h \
262 lib/vty.h \
263 lib/vxlan.h \
264 lib/wheel.h \
265 lib/workqueue.h \
266 lib/yang.h \
267 lib/yang_translator.h \
268 lib/yang_wrappers.h \
269 lib/zassert.h \
270 lib/zclient.h \
271 lib/zebra.h \
272 lib/zlog.h \
273 lib/zlog_targets.h \
274 lib/pbr.h \
275 lib/routing_nb.h \
276 # end
277
278
279 nodist_pkginclude_HEADERS += \
280 lib/route_types.h \
281 lib/version.h \
282 # end
283
284 noinst_HEADERS += \
285 lib/clippy.h \
286 lib/plist_int.h \
287 lib/printf/printfcommon.h \
288 lib/printf/printflocal.h \
289 #end
290
291 # General note about module and module helper library (libfrrsnmp, libfrrzmq)
292 # linking: If we're linking libfrr statically into daemons, we *must* remove
293 # libfrr from modules because modules will always link it in dynamically and
294 # thus 2 copies of libfrr will be loaded... hilarity ensues.
295 #
296 # Not linking libfrr into modules should generally work fine because the
297 # executable refers to libfrr either way and the dynamic linker should make
298 # libfrr available to modules. If some OS platform has a dynamic linker that
299 # doesn't do that, libfrr needs to be readded to modules, but _only_ _if_
300 # it's not linked into daemons statically.
301
302 #
303 # SNMP support
304 #
305 if SNMP
306 lib_LTLIBRARIES += lib/libfrrsnmp.la
307 endif
308
309 lib_libfrrsnmp_la_CFLAGS = $(WERROR) $(SNMP_CFLAGS) -std=gnu99
310 lib_libfrrsnmp_la_LDFLAGS = -version-info 0:0:0
311 lib_libfrrsnmp_la_LIBADD = $(SNMP_LIBS)
312 lib_libfrrsnmp_la_SOURCES = \
313 lib/agentx.c \
314 lib/snmp.c \
315 # end
316
317 #
318 # c-ares support
319 #
320 if CARES
321 lib_LTLIBRARIES += lib/libfrrcares.la
322 pkginclude_HEADERS += lib/resolver.h
323 endif
324
325 lib_libfrrcares_la_CFLAGS = $(WERROR) $(CARES_CFLAGS)
326 lib_libfrrcares_la_LDFLAGS = -version-info 0:0:0
327 lib_libfrrcares_la_LIBADD = $(CARES_LIBS)
328 lib_libfrrcares_la_SOURCES = \
329 lib/resolver.c \
330 #end
331
332 #
333 # ZeroMQ support
334 #
335 if ZEROMQ
336 lib_LTLIBRARIES += lib/libfrrzmq.la
337 pkginclude_HEADERS += lib/frr_zmq.h
338 endif
339
340 lib_libfrrzmq_la_CFLAGS = $(WERROR) $(ZEROMQ_CFLAGS)
341 lib_libfrrzmq_la_LDFLAGS = -version-info 0:0:0
342 lib_libfrrzmq_la_LIBADD = $(ZEROMQ_LIBS)
343 lib_libfrrzmq_la_SOURCES = \
344 lib/frr_zmq.c \
345 #end
346
347 #
348 # Tail-f's ConfD support
349 #
350 if CONFD
351 module_LTLIBRARIES += lib/confd.la
352 endif
353
354 lib_confd_la_CFLAGS = $(WERROR) $(CONFD_CFLAGS)
355 lib_confd_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
356 lib_confd_la_LIBADD = lib/libfrr.la $(CONFD_LIBS)
357 lib_confd_la_SOURCES = lib/northbound_confd.c
358
359 #
360 # Sysrepo support
361 #
362 if SYSREPO
363 module_LTLIBRARIES += lib/sysrepo.la
364 endif
365
366 lib_sysrepo_la_CFLAGS = $(WERROR) $(SYSREPO_CFLAGS)
367 lib_sysrepo_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
368 lib_sysrepo_la_LIBADD = lib/libfrr.la $(SYSREPO_LIBS)
369 lib_sysrepo_la_SOURCES = lib/northbound_sysrepo.c
370
371 #
372 # gRPC northbound plugin
373 #
374 if GRPC
375 module_LTLIBRARIES += lib/grpc.la
376 endif
377
378 lib_grpc_la_CXXFLAGS = $(WERROR) $(GRPC_CFLAGS)
379 lib_grpc_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
380 lib_grpc_la_LIBADD = lib/libfrr.la grpc/libfrrgrpc_pb.la $(GRPC_LIBS)
381 lib_grpc_la_SOURCES = lib/northbound_grpc.cpp
382
383 #
384 # CLI utilities
385 #
386 noinst_PROGRAMS += \
387 lib/grammar_sandbox \
388 # end
389
390 if BUILD_CLIPPY
391 noinst_PROGRAMS += lib/clippy
392 else
393 if HOSTTOOLS_CLIPPY
394 $(CLIPPY):
395 @$(MAKE) -C $(top_builddir)/hosttools lib/route_types.h lib/clippy
396 endif
397 endif
398
399 lib_grammar_sandbox_SOURCES = \
400 lib/grammar_sandbox_main.c
401 lib_grammar_sandbox_LDADD = \
402 lib/libfrr.la
403
404 lib_clippy_CPPFLAGS = $(AM_CPPFLAGS) -D_GNU_SOURCE -DBUILDING_CLIPPY
405 lib_clippy_CFLAGS = $(PYTHON_CFLAGS)
406 lib_clippy_LDADD = $(PYTHON_LIBS)
407 lib_clippy_LDFLAGS = -export-dynamic
408 lib_clippy_SOURCES = \
409 lib/clippy.c \
410 lib/command_graph.c \
411 lib/command_lex.l \
412 lib/command_parse.y \
413 lib/command_py.c \
414 lib/defun_lex.l \
415 lib/graph.c \
416 lib/memory.c \
417 lib/vector.c \
418 # end
419
420 # (global) clippy rules for all directories
421
422 AM_V_CLIPPY = $(am__v_CLIPPY_$(V))
423 am__v_CLIPPY_ = $(am__v_CLIPPY_$(AM_DEFAULT_VERBOSITY))
424 am__v_CLIPPY_0 = @echo " CLIPPY " $@;
425 am__v_CLIPPY_1 =
426
427 CLIPPY_DEPS = $(CLIPPY) $(top_srcdir)/python/clidef.py
428
429 SUFFIXES += _clippy.c
430 .c_clippy.c:
431 $(AM_V_CLIPPY) $(CLIPPY) $(top_srcdir)/python/clidef.py -o $@ $<
432
433 ## automake's "ylwrap" is a great piece of GNU software... not.
434 .l.c:
435 $(AM_V_LEX)$(am__skiplex) $(LEXCOMPILE) $<
436 .y.c:
437 $(AM_V_YACC)$(am__skipyacc) $(YACCCOMPILE) $<
438
439 #
440 # generated sources & extra foo
441 #
442 EXTRA_DIST += \
443 lib/command_lex.h \
444 lib/command_parse.h \
445 lib/gitversion.pl \
446 lib/route_types.pl \
447 lib/route_types.txt \
448 # end
449
450 BUILT_SOURCES += \
451 lib/gitversion.h \
452 lib/route_types.h \
453 # end
454
455 ## force route_types.h
456 $(lib_clippy_OBJECTS): lib/route_types.h
457 $(lib_libfrr_la_OBJECTS): lib/route_types.h
458
459 AM_YFLAGS = -d -Dapi.prefix=@BISON_OPENBRACE@cmd_yy@BISON_CLOSEBRACE@ @BISON_VERBOSE@
460
461 lib/command_lex.h: lib/command_lex.c
462 @if test ! -f $@; then rm -f "lib/command_lex.c"; else :; fi
463 @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) "lib/command_lex.c"; else :; fi
464 lib/command_lex.lo: lib/command_parse.h
465 lib/command_parse.lo: lib/command_lex.h
466 lib/clippy-command_lex.$(OBJEXT): lib/command_parse.h
467 lib/clippy-command_parse.$(OBJEXT): lib/command_lex.h
468 lib/lib_clippy-command_lex.$(OBJEXT): lib/command_parse.h
469 lib/lib_clippy-command_parse.$(OBJEXT): lib/command_lex.h
470
471 lib/route_types.h: $(top_srcdir)/lib/route_types.txt $(top_srcdir)/lib/route_types.pl
472 $(PERL) $(top_srcdir)/lib/route_types.pl < $(top_srcdir)/lib/route_types.txt > $@
473 DISTCLEANFILES += lib/route_types.h
474
475 if GIT_VERSION
476 # bit of a trick here to always have up-to-date git stamps without triggering
477 # unneccessary rebuilds. .PHONY causes the .tmp file to be rebuilt always,
478 # but if we use that on gitversion.h it'll ripple through the .c file deps.
479 # (even if gitversion.h's file timestamp doesn't change, make will think it
480 # did, because of .PHONY...)
481
482 PHONY_GITVERSION=lib/gitversion.h.tmp
483 .SILENT: lib/gitversion.h lib/gitversion.h.tmp
484 GITH=lib/gitversion.h
485 lib/gitversion.h.tmp: $(top_srcdir)/.git
486 $(PERL) $(top_srcdir)/lib/gitversion.pl $(top_srcdir) > ${GITH}.tmp
487 lib/gitversion.h: lib/gitversion.h.tmp
488 { test -f ${GITH} && diff -s -q ${GITH}.tmp ${GITH}; } || cp ${GITH}.tmp ${GITH}
489
490 else
491 PHONY_GITVERSION=lib/gitversion.h
492 lib/gitversion.h:
493 true
494 endif
495 .PHONY: $(PHONY_GITVERSION)