diff --git a/vvp/config.h.in b/vvp/config.h.in index 6e7dfc00a..79d7c734e 100644 --- a/vvp/config.h.in +++ b/vvp/config.h.in @@ -19,7 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #if !defined(WINNT) -#ident "$Id: config.h.in,v 1.13 2003/03/13 20:31:40 steve Exp $" +#ident "$Id: config.h.in,v 1.14 2003/05/16 03:50:28 steve Exp $" #endif # define SIZEOF_UNSIGNED_LONG_LONG 0 @@ -35,6 +35,16 @@ # undef HAVE_GETOPT_H # undef HAVE_MALLOC_H # undef HAVE_LIBREADLINE +# undef HAVE_READLINE_READLINE_H +# undef HAVE_READLINE_HISTORY_H + +/* Figure if I can use readline. */ +#undef USE_READLINE +#ifdef HAVE_LIB_READLINE +#ifdef HAVE_READLINE_READLINE_H +# define USE_READLINE +#endif +#endif #ifndef MODULE_DIR # define MODULE_DIR "." @@ -63,6 +73,7 @@ typedef unsigned long vvp_time64_t; # undef HAVE_SYS_RESOURCE_H # undef LINUX + /* * When doing dynamic linking, we need a uniform way to identify the * symbol. Some compilers put leading _, some trailing _. The @@ -83,6 +94,9 @@ typedef unsigned long vvp_time64_t; /* * $Log: config.h.in,v $ + * Revision 1.14 2003/05/16 03:50:28 steve + * Fallback functionality if readline is not present. + * * Revision 1.13 2003/03/13 20:31:40 steve * Warnings about long long time. * diff --git a/vvp/configure.in b/vvp/configure.in index abf2a20fc..22e150cd9 100644 --- a/vvp/configure.in +++ b/vvp/configure.in @@ -40,6 +40,7 @@ AC_CHECK_SIZEOF(unsigned) # exist. AC_CHECK_LIB(termcap, tputs) AC_CHECK_LIB(readline, readline) +AC_CHECK_HEADERS(readline/readline.h readline/history.h) # -- # Look for a dl library to use. First look for the standard dlopen diff --git a/vvp/stop.cc b/vvp/stop.cc index d6af7c3b5..3b8912273 100644 --- a/vvp/stop.cc +++ b/vvp/stop.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifdef HAVE_CVS_IDENT -#ident "$Id: stop.cc,v 1.7 2003/03/13 20:31:40 steve Exp $" +#ident "$Id: stop.cc,v 1.8 2003/05/16 03:50:28 steve Exp $" #endif /* @@ -34,8 +34,10 @@ # include "schedule.h" # include # include -#ifdef HAVE_LIBREADLINE +#ifdef HAVE_READLINE_READLINE_H # include +#endif +#ifdef HAVE_READLINE_HISTORY_H # include #endif # include @@ -46,6 +48,8 @@ struct __vpiScope*stop_current_scope = 0; +#ifdef USE_READLINE + static bool interact_flag = true; static void cmd_call(unsigned argc, char*argv[]) @@ -409,7 +413,9 @@ void stop_handler(int rc) first += 1; if (first[0] != 0) { +#ifdef HAVE_READLINE_HISTORY add_history(first); +#endif invoke_command(first); } @@ -419,8 +425,25 @@ void stop_handler(int rc) printf("** Continue **\n"); } +#else + +void stop_handler(int rc) +{ + printf("** VVP Stop(%d) **\n", rc); + printf("** Current simulation time is %" TIME_FMT "u ticks.\n", + schedule_simtime()); + + printf("** Interactive mode not supported, exiting simulation.\n"); + exit(0); +} + +#endif + /* * $Log: stop.cc,v $ + * Revision 1.8 2003/05/16 03:50:28 steve + * Fallback functionality if readline is not present. + * * Revision 1.7 2003/03/13 20:31:40 steve * Warnings about long long time. *