Safeguard against usage of --with-readline or --with-editline

Some package maintainers have erroneously used the above ./configure
flags during compiling libngspice-0.so. This has led to an unresolved
symbol history_file with ngspice-34.
This commit is contained in:
Holger Vogt 2021-02-12 10:05:53 +01:00
parent 8076e2b4cf
commit b86c85f85b
1 changed files with 4 additions and 0 deletions

View File

@ -23,6 +23,7 @@ Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group
#include "variable.h"
#include "com_unset.h"
#ifndef SHARED_MODULE
#ifdef HAVE_GNUREADLINE
#include <readline/readline.h>
#include <readline/history.h>
@ -33,6 +34,7 @@ extern char history_file[];
#include <editline/readline.h>
extern char history_file[];
#endif
#endif
#ifdef SHARED_MODULE
extern void rem_controls(void);
@ -291,12 +293,14 @@ static void
byemesg(void)
{
#ifndef SHARED_MODULE
#if defined(HAVE_GNUREADLINE) || defined(HAVE_BSDEDITLINE)
/* write out command history only when saying goodbye. */
if (cp_interactive && (cp_maxhistlength > 0)) {
stifle_history(cp_maxhistlength);
write_history(history_file);
}
#endif
#endif
printf("%s-%s done\n", ft_sim->simulator, ft_sim->version);