summaryrefslogtreecommitdiffstats
path: root/vtysh
diff options
context:
space:
mode:
authorIgor Ryzhov <iryzhov@nfware.com>2020-09-30 00:08:17 +0200
committerIgor Ryzhov <iryzhov@nfware.com>2020-09-30 00:08:17 +0200
commit97fc5adacb4239a5cb73f69ff4564bc2afa06a30 (patch)
treead54aa23e21e58076dd53f13e73117663f149885 /vtysh
parentMerge pull request #7198 from idryzhov/vtysh-disable-daemon (diff)
downloadfrr-97fc5adacb4239a5cb73f69ff4564bc2afa06a30.tar.xz
frr-97fc5adacb4239a5cb73f69ff4564bc2afa06a30.zip
vtysh: fix commands when building only isisd or fabricd
* add files to vtysh_scan when building only fabricd * don't add isisd/fabricd commands when daemon build is disabled Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Diffstat (limited to 'vtysh')
-rwxr-xr-xvtysh/extract.pl.in23
-rw-r--r--vtysh/subdir.am14
2 files changed, 32 insertions, 5 deletions
diff --git a/vtysh/extract.pl.in b/vtysh/extract.pl.in
index 60c31bd84..53067c43f 100755
--- a/vtysh/extract.pl.in
+++ b/vtysh/extract.pl.in
@@ -23,6 +23,8 @@
## 02111-1307, USA.
##
+use Getopt::Long;
+
print <<EOF;
#include <zebra.h>
@@ -199,18 +201,31 @@ sub scan_file {
}
}
+my $have_isisd = 0;
+my $have_fabricd = 0;
+
+GetOptions('have-isisd' => \$have_isisd, 'have-fabricd' => \$have_fabricd);
+
foreach (@ARGV) {
if (/(^|\/)isisd\//) {
# We scan all the IS-IS files twice, once for isisd,
# once for fabricd. Exceptions are made for the files
# that are not shared between the two.
if (/isis_vty_isisd.c/) {
- scan_file($_, 0);
+ if ( $have_isisd ) {
+ scan_file($_, 0);
+ }
} elsif (/isis_vty_fabricd.c/) {
- scan_file($_, 1);
+ if ( $have_fabricd ) {
+ scan_file($_, 1);
+ }
} else {
- scan_file($_, 0);
- scan_file($_, 1);
+ if ( $have_isisd ) {
+ scan_file($_, 0);
+ }
+ if ( $have_fabricd ) {
+ scan_file($_, 1);
+ }
}
} else {
scan_file($_, 0);
diff --git a/vtysh/subdir.am b/vtysh/subdir.am
index 3e9b8a3dc..e7a1049b6 100644
--- a/vtysh/subdir.am
+++ b/vtysh/subdir.am
@@ -31,5 +31,17 @@ am__v_EXTRACT_ = $(am__v_EXTRACT_$(AM_DEFAULT_VERBOSITY))
am__v_EXTRACT_0 = @echo " EXTRACT " $@;
am__v_EXTRACT_1 =
+if ISISD
+HAVE_ISISD = --have-isisd
+else
+HAVE_ISISD =
+endif
+
+if FABRICD
+HAVE_FABRICD = --have-fabricd
+else
+HAVE_FABRICD =
+endif
+
vtysh/vtysh_cmd.c: vtysh/extract.pl $(vtysh_scan)
- $(AM_V_EXTRACT) $^ > vtysh/vtysh_cmd.c
+ $(AM_V_EXTRACT) $^ $(HAVE_ISISD) $(HAVE_FABRICD) > vtysh/vtysh_cmd.c