Make vtysh work on NetBSD, and minor cleanups:

  if --enable-vtysh, look for perl, and substitute into vtysh/extract.pl,
  rather than assuming perl is in /usr/bin

  Look for tputs in libtermcap and libcurses, in addition to
  previously-searched locations.  Follow GNU readlines search order.

  Clean up --enable-vtysh definition in configure.ac.

  Add vtysh/vtysh_cmds.c to CLEANFILES.  This is important if
  extract.pl fails, so that 'make clean && make' will regenerate
  vtysh_cmds.c rhather than using the old zero-length file.
diff --git a/vtysh/ChangeLog b/vtysh/ChangeLog
index d439850..db9f805 100644
--- a/vtysh/ChangeLog
+++ b/vtysh/ChangeLog
@@ -1,3 +1,9 @@
+2004-06-30  Greg Troxel  <gdt@poblano.ir.bbn.com>
+
+	* extract.pl.in: Rename from extract.pl, with @PERL@.
+
+	* Makefile.am: Add vtysh_cmds.c to CLEANFILES.
+
 2004-06-20 Hasso Tepper <hasso@estpak.ee>
 
 	* extract.pl: Zebra daemon has access lists as well.
diff --git a/vtysh/Makefile.am b/vtysh/Makefile.am
index 9118350..fea0cb0 100644
--- a/vtysh/Makefile.am
+++ b/vtysh/Makefile.am
@@ -9,6 +9,7 @@
 
 vtysh_SOURCES = vtysh_main.c vtysh.c vtysh_user.c vtysh_config.c
 nodist_vtysh_SOURCES = vtysh_cmd.c
+CLEANFILES = vtysh_cmd.c
 noinst_HEADERS = vtysh.h vtysh_user.h
 vtysh_LDADD = ../lib/libzebra.a @LIBCAP@
 
diff --git a/vtysh/extract.pl b/vtysh/extract.pl.in
similarity index 99%
rename from vtysh/extract.pl
rename to vtysh/extract.pl.in
index 8488e01..6882b10 100755
--- a/vtysh/extract.pl
+++ b/vtysh/extract.pl.in
@@ -1,4 +1,4 @@
-#! /usr/bin/perl
+#! @PERL@
 ##
 ## Virtual terminal interface shell command extractor.
 ## Copyright (C) 2000 Kunihiro Ishiguro