diff options
| author | David Lamparter <equinox@opensourcerouting.org> | 2022-10-04 18:44:36 +0200 | 
|---|---|---|
| committer | David Lamparter <equinox@opensourcerouting.org> | 2022-10-26 17:12:34 +0100 | 
| commit | 89cb86aeb0262e17ee39c1d791effe9515bd0dc8 (patch) | |
| tree | a1643fa620a97ffdc2da9442abd7cff29d86e434 /lib/subdir.am | |
| parent | 695f387ed872c1bc55ad4149ede95465b48697b9 (diff) | |
build, vtysh: extract vtysh commands from .xref
Rather than running selected source files through the preprocessor and a
bunch of perl regex'ing to get the list of all DEFUNs, use the data
collected in frr.xref.
This not only eliminates issues we've been having with preprocessor
failures due to nonexistent header files, but is also much faster.
Where extract.pl would take 5s, this now finishes in 0.2s.  And since
this is a non-parallelizable build step towards the end of the build
(dependent on a lot of other things being done already), the speedup is
actually noticeable.
Also files containing CLI no longer need to be listed in `vtysh_scan`
since the .xref data covers everything.  `#ifndef VTYSH_EXTRACT_PL`
checks are equally obsolete.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'lib/subdir.am')
| -rw-r--r-- | lib/subdir.am | 29 | 
1 files changed, 6 insertions, 23 deletions
diff --git a/lib/subdir.am b/lib/subdir.am index e04e700eb6..ea6cb9339a 100644 --- a/lib/subdir.am +++ b/lib/subdir.am @@ -139,27 +139,6 @@ nodist_lib_libfrr_la_SOURCES = \  	yang/frr-module-translator.yang.c \  	# end -vtysh_scan += \ -	lib/distribute.c \ -	lib/filter.c \ -	lib/filter_cli.c \ -	lib/if.c \ -	lib/if_rmap.c \ -	lib/keychain.c \ -	lib/lib_vty.c \ -	lib/log_vty.c \ -	lib/nexthop_group.c \ -	lib/plist.c \ -	lib/routemap.c \ -	lib/routemap_cli.c \ -	lib/spf_backoff.c \ -	lib/thread.c \ -	lib/vrf.c \ -	lib/vty.c \ -	# end -# can be loaded as DSO - always include for vtysh -vtysh_scan += lib/agentx.c -  if SQLITE3  lib_libfrr_la_LIBADD += $(SQLITE3_LIBS)  lib_libfrr_la_SOURCES += lib/db.c @@ -347,7 +326,6 @@ lib_libfrrsnmp_la_SOURCES = \  if CARES  lib_LTLIBRARIES += lib/libfrrcares.la  pkginclude_HEADERS += lib/resolver.h -vtysh_scan += lib/resolver.c  endif  lib_libfrrcares_la_CFLAGS = $(AM_CFLAGS) $(CARES_CFLAGS) @@ -478,13 +456,18 @@ SUFFIXES += .xref  # dependencies added in python/makefile.py  frr.xref: -	$(AM_V_XRELFO) $(CLIPPY) $(top_srcdir)/python/xrelfo.py -o $@ $^ +	$(AM_V_XRELFO) $(CLIPPY) $(top_srcdir)/python/xrelfo.py -o $@ -c vtysh/vtysh_cmd.c $^  all-am: frr.xref  clean-xref:  	-rm -rf $(xrefs) frr.xref  clean-local: clean-xref +CLEANFILES += vtysh/vtysh_cmd.c +vtysh/vtysh_cmd.c: frr.xref +	@test -f $@ || rm -f frr.xref || true +	@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) frr.xref +  ## automake's "ylwrap" is a great piece of GNU software... not.  .l.c:  	$(AM_V_LEX)$(am__skiplex) $(LEXCOMPILE) $<  | 
