diff --git a/ChangeLog b/ChangeLog index 09428a00b..f538a0a0b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -22,6 +22,10 @@ added the codemodels from xspice in the same structure as spiceopus + * src/frontend/misccoms.c src/tclspice.c src/spinit + src/ngspice.c src/conf.c src/Makefile.am configure.in: + tclspiceised the files and the email addrs. s/ngspice/tclspice/ + .spiceinit and co work 2003-07-18 Vera Albrecht diff --git a/configure.in b/configure.in index 22076595b..ef6f53752 100644 --- a/configure.in +++ b/configure.in @@ -5,7 +5,7 @@ dnl Create a configuration header AM_CONFIG_HEADER(config.h) dnl Initialize automake stuff -AM_INIT_AUTOMAKE(ng-spice-rework,14) +AM_INIT_AUTOMAKE(tclspice,0.2.13) dnl --enable-ftedebug : enable frontend debug macros AC_ARG_ENABLE(ftedebug, @@ -348,7 +348,12 @@ else fi AC_DEFINE_UNQUOTED(NGSPICEBINDIR, "`echo $dprefix/bin`" ) + +if test "x$with_tcl" != "x" -a "$with_tcl" != "no" ; then +AC_DEFINE_UNQUOTED(NGSPICEDATADIR, "`echo $dprefix/share/tclspice`" ) +else AC_DEFINE_UNQUOTED(NGSPICEDATADIR, "`echo $dprefix/share/ng-spice-rework`" ) +fi AC_DEFINE_UNQUOTED(NGSPICEBUILDDATE, "`date`" ) diff --git a/src/Makefile.am b/src/Makefile.am index 5e47bca79..05eae5623 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -181,7 +181,7 @@ CLEANFILES = pkgIndex.tcl libspice.so TCL_PKG_PATH = @TCL_PACKAGE_PATH@ -TCLSPICE_VERSION = 0.2.12 +TCLSPICE_VERSION = @VERSION@ TCL_FILES = libspice.so pkgIndex.tcl @@ -192,7 +192,7 @@ pkgIndex.tcl: pkgIndex.tcl.in sed -e 's;%LIB_DIR%;$(TCL_PKG_PATH);g' pkgIndex.tcl.in | \ sed -e 's;%VERSION%;$(TCLSPICE_VERSION);g' > pkgIndex.tcl -install-tcl: install-tcl-recursive install-tclspice +install-tcl: install-tcl-recursive install-tclspice install-data-am install-tcl-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ diff --git a/src/conf.c b/src/conf.c index ccc8fddf8..2c99b7cfe 100644 --- a/src/conf.c +++ b/src/conf.c @@ -5,14 +5,14 @@ #include "conf.h" char Spice_Version[ ] = VERSION; -char Spice_Notice[ ] = "Please submit bug-reports to: ng-spice-bugs@ieee.ing.uniroma1.it"; +char Spice_Notice[ ] = "Please submit bug-reports to: ngspice-devel@lists.sourceforge.net"; char Spice_Build_Date[ ] = NGSPICEBUILDDATE; char *Spice_Exec_Dir = NGSPICEBINDIR; char *Spice_Lib_Dir = NGSPICEDATADIR; char *Def_Editor = "vi"; int AsciiRawFile = 0; -char *Bug_Addr = "ng-spice-bugs@ieee.ing.uniroma1.it"; +char *Bug_Addr = "ngspice-devel@lists.sourceforge.net"; char *Spice_Host = ""; char *Spiced_Log = ""; diff --git a/src/frontend/misccoms.c b/src/frontend/misccoms.c index b0d338b93..bec8db9b9 100644 --- a/src/frontend/misccoms.c +++ b/src/frontend/misccoms.c @@ -117,7 +117,7 @@ com_bug(wordlist *wl) void com_bug(wordlist *wl) { - fprintf(cp_out, "Send mail to the address ng-spice@ieee.ing.uniroma1.it\n"); + fprintf(cp_out, "Send mail to the address ngspice-devel@lists.sourceforge.net\n"); return; } diff --git a/src/ngspice.c b/src/ngspice.c index 628003d82..dc34e2bd3 100644 --- a/src/ngspice.c +++ b/src/ngspice.c @@ -32,7 +32,7 @@ static IFparm nodeParms[] = { }; IFsimulator SIMinfo = { - "ngspice", /* name */ + "tclspice", /* name */ "Circuit level simulation program", /* more about me */ Spice_Version, /* version */ diff --git a/src/spinit b/src/spinit index 0c03be57f..3ca6af8c2 100644 --- a/src/spinit +++ b/src/spinit @@ -4,4 +4,10 @@ alias acct rusage all set x11lineararcs * For SPICE2 POLYs, edit the below line to point to the location * of your codemode. -* codemodel /usr/local/src/tclspice-0.2.10/src/xspice/icm/spice2poly.cm +* codemodel /usr/lib/spice/spice2poly.cm + +* The other codemodels +* codemodel /usr/lib/spice/analog.cm +* codemodel /usr/lib/spice/digital.cm +* codemodel /usr/lib/spice/xtradev.cm +* codemodel /usr/lib/spice/xtraevt.cm diff --git a/src/tclspice.c b/src/tclspice.c index 9532db619..904a76456 100755 --- a/src/tclspice.c +++ b/src/tclspice.c @@ -1436,6 +1436,7 @@ int Spice_Init(Tcl_Interp *interp) { char *key; Tcl_CmdInfo infoPtr; char buf[256]; + sighandler_t old_sigint; ft_rawfile = NULL; ivars( ); @@ -1461,6 +1462,47 @@ int Spice_Init(Tcl_Interp *interp) { /*Command prompt stuff */ ft_cpinit(); + + /* Read the user config files */ + /* To catch interrupts during .spiceinit... */ + old_sigint = signal(SIGINT, ft_sigintr); + if (setjmp(jbuf) == 1) { + fprintf(cp_err, "Warning: error executing .spiceinit.\n"); + goto bot; + } + +#ifdef HAVE_PWD_H + /* Try to source either .spiceinit or ~/.spiceinit. */ + if (access(".spiceinit", 0) == 0) + inp_source(".spiceinit"); + else { + char *s; + struct passwd *pw; + pw = getpwuid(getuid()); + +#define INITSTR "/.spiceinit" +#ifdef HAVE_ASPRINTF + asprintf(&s, "%s%s", pw->pw_dir,INITSTR); +#else /* ~ HAVE_ASPRINTF */ + s=(char *) tmalloc(1 + strlen(pw->pw_dir)+strlen(INITSTR)); + sprintf(s,"%s%s",pw->pw_dir,INITSTR); +#endif /* HAVE_ASPRINTF */ + if (access(s, 0) == 0) + inp_source(s); + } +#else /* ~ HAVE_PWD_H */ + { + FILE *fp; + /* Try to source the file "spice.rc" in the current directory. */ + if ((fp = fopen("spice.rc", "r")) != NULL) { + (void) fclose(fp); + inp_source("spice.rc"); + } + } +#endif /* ~ HAVE_PWD_H */ +bot: + signal(SIGINT, old_sigint); + /* initilise Tk display */ DevInit();