aboutsummaryrefslogtreecommitdiffstats
path: root/cad/spice
diff options
context:
space:
mode:
authormaho <maho@FreeBSD.org>2003-07-19 11:13:48 +0800
committermaho <maho@FreeBSD.org>2003-07-19 11:13:48 +0800
commitdc2677ab3333caedb1297926170c3d727f46e9d5 (patch)
tree2073426ac7c87dcdb0f427915333b88baf51a2c8 /cad/spice
parent3ae4198324d799f6bfcd01d7af33786d0c26b71d (diff)
downloadfreebsd-ports-gnome-dc2677ab3333caedb1297926170c3d727f46e9d5.tar.gz
freebsd-ports-gnome-dc2677ab3333caedb1297926170c3d727f46e9d5.tar.zst
freebsd-ports-gnome-dc2677ab3333caedb1297926170c3d727f46e9d5.zip
1. REAL cleaning on this port. The files dir is now organized so the
port can be maintained: previously there were multifile patches and several patches for the same file, now it is a lot cleaner. 2. I also merged a memory leak fix and some fixes from spice3f5-spaghetti. 4. MFB and removed GNUREADLINE support 5. honor CFLAGS and CC. 6. Add documentation. 7. Maho didn't change the name of port spice to spice3. because spice4 might :) appear in the future. version number should be listed on *only* PORTVERSION. 8. drom maintainership PR: 54603 Submitted by: "Pedro F. Giffuni" <giffunip@yahoo.com>
Diffstat (limited to 'cad/spice')
-rw-r--r--cad/spice/Makefile25
-rw-r--r--cad/spice/distinfo5
-rw-r--r--cad/spice/files/FreeBSD8
-rw-r--r--cad/spice/files/Makefile6
-rw-r--r--cad/spice/files/patch-aa190
-rw-r--r--cad/spice/files/patch-ac62
-rw-r--r--cad/spice/files/patch-ad192
-rw-r--r--cad/spice/files/patch-ae82
-rw-r--r--cad/spice/files/patch-af37
-rw-r--r--cad/spice/files/patch-ag24
-rw-r--r--cad/spice/files/patch-ah21
-rw-r--r--cad/spice/files/patch-ai20
-rw-r--r--cad/spice/files/patch-al112
-rw-r--r--cad/spice/files/patch-am102
-rw-r--r--cad/spice/files/patch-as19
-rw-r--r--cad/spice/files/patch-ba38
-rw-r--r--cad/spice/files/patch-bb11
-rw-r--r--cad/spice/files/patch-bc17
-rw-r--r--cad/spice/files/patch-conf_defaults45
-rw-r--r--cad/spice/files/patch-level123
-rw-r--r--cad/spice/files/patch-sp3f5 (renamed from cad/spice/files/patch-ab)2
-rw-r--r--cad/spice/files/patch-src_bin_sconvert_c26
-rw-r--r--cad/spice/files/patch-src_include_misc_h31
-rw-r--r--cad/spice/files/patch-src_include_os_bsd_h38
-rw-r--r--cad/spice/files/patch-src_include_patchlev_h5
-rw-r--r--cad/spice/files/patch-src_lib_ckt_dctrcurv_c135
-rw-r--r--cad/spice/files/patch-src_lib_fte_aspice_c (renamed from cad/spice/files/patch-ap)0
-rw-r--r--cad/spice/files/patch-src_lib_fte_cpitf_c13
-rw-r--r--cad/spice/files/patch-src_lib_fte_device_c13
-rw-r--r--cad/spice/files/patch-src_lib_fte_dimens_c (renamed from cad/spice/files/patch-an)4
-rw-r--r--cad/spice/files/patch-src_lib_fte_doplot_c (renamed from cad/spice/files/patch-bd)13
-rw-r--r--cad/spice/files/patch-src_lib_fte_graf_c30
-rw-r--r--cad/spice/files/patch-src_lib_fte_grid_c62
-rw-r--r--cad/spice/files/patch-src_lib_fte_inp_c11
-rw-r--r--cad/spice/files/patch-src_lib_fte_postcoms_c11
-rw-r--r--cad/spice/files/patch-src_lib_fte_resource_c12
-rw-r--r--cad/spice/files/patch-src_lib_fte_vectors_c82
-rw-r--r--cad/spice/files/patch-src_lib_fte_x11_c67
-rw-r--r--cad/spice/files/patch-src_lib_hlp_readhelp_c (renamed from cad/spice/files/patch-ao)0
-rw-r--r--cad/spice/files/patch-src_lib_inp_inpfindl_c107
-rw-r--r--cad/spice/files/patch-util_build11
-rw-r--r--cad/spice/files/patch-util_skeleton_make_def_bd11
-rw-r--r--cad/spice/pkg-plist61
43 files changed, 808 insertions, 976 deletions
diff --git a/cad/spice/Makefile b/cad/spice/Makefile
index c584172e2bb3..7c4d14f30323 100644
--- a/cad/spice/Makefile
+++ b/cad/spice/Makefile
@@ -8,26 +8,37 @@
PORTNAME= spice
PORTVERSION= 3f5.2
CATEGORIES= cad
-MASTER_SITES= ftp://ic.eecs.berkeley.edu/pub/Spice3/
-DISTNAME= sp3f4.kit
+MASTER_SITES= ftp://ic.eecs.berkeley.edu/pub/Spice3/:sources \
+ ftp://ic.eecs.berkeley.edu/pub/Spice3/um.3f3.ps/:docs
EXTRACT_SUFX= .tar.Z
+DISTFILES= sp3f4.kit${EXTRACT_SUFX}:sources \
+ cp.ps:docs toc.ps:docs doc.ps:docs
+DIST_SUBDIR= spice
+EXTRACT_ONLY= sp3f4.kit${EXTRACT_SUFX}
-MAINTAINER= maho@FreeBSD.org
+MAINTAINER= ports@FreeBSD.org
COMMENT= A general-purpose circuit simulation program
-# documentation in ftp://ic.eecs.berkeley.edu/pub/Spice3/um.3f3.ps/
-
USE_XLIB= yes
+USE_REINPLACE= yes
NO_WRKSUBDIR= yes
MAN1= sconvert.1 nutmeg.1 spice.1
MAN3= mfb.3
MAN5= mfbcap.5
MLINKS= spice.1 spice3.1
+post-configure:
+ @${REINPLACE_CMD} -e 's+@CC@+${CC}+ ; s+@CFLAGS@+${CFLAGS}+ ; \
+ s+@X11BASE@+${X11BASE}+;' \
+ ${WRKSRC}/conf/FreeBSD
+
post-install:
.if !defined(NOPORTDOCS)
- ${MKDIR} ${PREFIX}/share/examples/spice3
- ${INSTALL_DATA} ${WRKSRC}/examples/*.cir ${PREFIX}/share/examples/spice3
+ ${MKDIR} ${DOCSDIR}
+ ${CAT} ${DISTDIR}/${DIST_SUBDIR}/*.ps > ${DOCSDIR}/spice3f3.ps
+ ${GZIP_CMD} ${DOCSDIR}/*.ps
+ ${MKDIR} ${EXAMPLESDIR}
+ ${INSTALL_DATA} ${WRKSRC}/examples/*.cir ${EXAMPLESDIR}
.endif
.include <bsd.port.mk>
diff --git a/cad/spice/distinfo b/cad/spice/distinfo
index 06e45db8691c..56a0985df495 100644
--- a/cad/spice/distinfo
+++ b/cad/spice/distinfo
@@ -1 +1,4 @@
-MD5 (sp3f4.kit.tar.Z) = d55eb08a7f523248b1b509092a444aeb
+MD5 (spice/sp3f4.kit.tar.Z) = d55eb08a7f523248b1b509092a444aeb
+MD5 (spice/cp.ps) = ee9065de6e11e82fa3fe34318c2373fc
+MD5 (spice/toc.ps) = f84ccdd9ca423e112ec68121a86c032c
+MD5 (spice/doc.ps) = bcea417f3bde8543f428785bfb5a4d62
diff --git a/cad/spice/files/FreeBSD b/cad/spice/files/FreeBSD
index 6bf2a859ffd5..bebc7251e090 100644
--- a/cad/spice/files/FreeBSD
+++ b/cad/spice/files/FreeBSD
@@ -1,8 +1,8 @@
# FreeBSD config exception file
MAKE = /usr/bin/make
-INTERFACE_OPTS = -DWANT_X11
-CC = cc
-CC_OPT_SAFE += -O2
-LDFLAGS = -L$(X11BASE)/lib -lm -ltermcap
+INTERFACE_OPTS = -DWANT_MFB -DWANT_X11
+CC = @CC@
+CC_OPT += @CFLAGS@
+LDFLAGS += -L@X11BASE@/lib -lm -ltermcap
SYS_CFLAGS = -Dbsd
diff --git a/cad/spice/files/Makefile b/cad/spice/files/Makefile
index 6ca93e2439f6..41806edee520 100644
--- a/cad/spice/files/Makefile
+++ b/cad/spice/files/Makefile
@@ -1,4 +1,6 @@
-
+#
+# $FreeBSD$
+#
all:
util/build FreeBSD default
@@ -10,7 +12,7 @@ install:
strip ${PREFIX}/bin/spice3 ${PREFIX}/bin/nutmeg \
${PREFIX}/bin/sconvert ${PREFIX}/bin/help \
${PREFIX}/bin/proc2mod ${PREFIX}/bin/multidec
- chmod -R a+rX ${PREFIX}/share/spice3
+ chmod -R a+rX ${PREFIX}/share/spice
install -c -m 644 -o bin -g bin man/man5/mfbcap.5 ${PREFIX}/man/man5/mfbcap.5
install -c -m 644 -o bin -g bin man/man1/sconvert.1 ${PREFIX}/man/man1/sconvert.1
install -c -m 644 -o bin -g bin man/man1/nutmeg.1 ${PREFIX}/man/man1/nutmeg.1
diff --git a/cad/spice/files/patch-aa b/cad/spice/files/patch-aa
deleted file mode 100644
index df2b114a1525..000000000000
--- a/cad/spice/files/patch-aa
+++ /dev/null
@@ -1,190 +0,0 @@
-*** conf/defaults.orig Thu Jul 29 16:33:56 1993
---- conf/defaults Sat Jun 6 23:40:14 1998
-***************
-*** 65,71 ****
- # the following definition:
- # SYS_DIR = $(DIST_DIR)
-
-! SYS_DIR = $(TOP1)/$(SYSTEM)
-
- # OBJ_TOP is the directory in which intermidiate files reside
- # These are ".o" files, synthesized ".c" files, ".a" files,
---- 65,71 ----
- # the following definition:
- # SYS_DIR = $(DIST_DIR)
-
-! SYS_DIR = $(TOP0)/$(SYSTEM)
-
- # OBJ_TOP is the directory in which intermidiate files reside
- # These are ".o" files, synthesized ".c" files, ".a" files,
-***************
-*** 105,116 ****
- # identified as and SYSTEM is the name of the per-system definitions
- # file listed on the "build" command line.
-
-! SPICE_DIR = $(TOP1)/$(SYSTEM)
-! SPICE_LIB_DIR = $(SPICE_DIR)/lib
- SPICE_EXEC_DIR = $(SPICE_DIR)/bin
-
- S_SPICE_DIR = $(SPICE_DIR)
-! S_SPICE_LIB_DIR = $(S_SPICE_DIR)/lib
- S_SPICE_EXEC_DIR= $(S_SPICE_DIR)/bin
-
- # INSTALL_DIRS lists the directories that need to be created before
---- 105,116 ----
- # identified as and SYSTEM is the name of the per-system definitions
- # file listed on the "build" command line.
-
-! SPICE_DIR = ${PREFIX}
-! SPICE_LIB_DIR = $(SPICE_DIR)/share/spice3
- SPICE_EXEC_DIR = $(SPICE_DIR)/bin
-
- S_SPICE_DIR = $(SPICE_DIR)
-! S_SPICE_LIB_DIR = $(S_SPICE_DIR)/share/spice3
- S_SPICE_EXEC_DIR= $(S_SPICE_DIR)/bin
-
- # INSTALL_DIRS lists the directories that need to be created before
-***************
-*** 129,139 ****
- # an extra definition to work around the same strange bug. See either
- # file "conf/vax" or "conf/gcc".
-
-! CC = cc
-
- # CC_OPT: Default compile options (optimization/debug level, other)
-
-! CC_OPT = -O
-
- # CC_OPT_SAFE: Special compile options to override CC_OPT for code
- # which typically causes problems for most compilers (bsim1 and bsim2).
---- 129,139 ----
- # an extra definition to work around the same strange bug. See either
- # file "conf/vax" or "conf/gcc".
-
-! CC = gcc
-
- # CC_OPT: Default compile options (optimization/debug level, other)
-
-! CC_OPT += -Os -pipe
-
- # CC_OPT_SAFE: Special compile options to override CC_OPT for code
- # which typically causes problems for most compilers (bsim1 and bsim2).
-***************
-*** 203,209 ****
- # X_DIR indicates the top of the X11 lib/include hierarchy; it is only
- # a convenience that is used in the following definitions.
-
-! X_DIR = /usr
-
- # INCX lists the X include directories. This may be different between
- # MIT X11r5, X11r4, and your vendor's version of X11, though listing
---- 203,209 ----
- # X_DIR indicates the top of the X11 lib/include hierarchy; it is only
- # a convenience that is used in the following definitions.
-
-! X_DIR = ${X11BASE}
-
- # INCX lists the X include directories. This may be different between
- # MIT X11r5, X11r4, and your vendor's version of X11, though listing
-*** util/build.orig Sun Mar 31 10:56:09 1996
---- util/build Sun Mar 31 10:57:21 1996
-***************
-*** 96,102 ****
-
- TMP_LEADER="${TMP_DIR}/buildl$$"
- TMP_TRAILER="${TMP_DIR}/buildt$$"
-! trap 'rm -f ${TMP_LEADER} ${TMP_TRAILER}; exit 1' 1 2 3 4 6 7 8 9 10 12 13 14 15
- echo > "${TMP_TRAILER}"
- BAD=false
- DEBUG=
---- 96,102 ----
-
- TMP_LEADER="${TMP_DIR}/buildl$$"
- TMP_TRAILER="${TMP_DIR}/buildt$$"
-! trap 'rm -f ${TMP_LEADER} ${TMP_TRAILER}; exit 1' 1 2 3 4 6 7 8 10 12 13 14 15
- echo > "${TMP_TRAILER}"
- BAD=false
- DEBUG=
-*** src/lib/fte/resource.c.orig Sun Mar 31 10:59:57 1996
---- src/lib/fte/resource.c Sun Mar 31 11:00:57 1996
-***************
-*** 369,375 ****
---- 369,377 ----
- long x;
- SIGNAL_TYPE (*orig_signal)( );
-
-+ #ifndef __FreeBSD__
- if (getenv("SPICE_NO_DATASEG_CHECK"))
-+ #endif
- return 0;
-
- low = 0;
-*** src/include/misc.h.orig Thu Dec 1 09:17:02 1994
---- src/include/misc.h Sun Mar 31 12:32:58 1996
-***************
-*** 86,92 ****
---- 86,94 ----
- extern char *realloc();
- extern char *getenv();
- extern int errno;
-+ #ifndef __FreeBSD__
- extern char *sys_errlist[];
-+ #endif
- extern char *getenv();
- extern char *getwd();
- extern int rand();
-***************
-*** 111,122 ****
---- 111,124 ----
- # endif /* clearerr */
- # endif /* HAS_CLEARERR */
-
-+ #ifndef __FreeBSD__
- # ifndef bzero
- extern int bzero();
- # endif
- # ifndef bcopy
- extern void bcopy();
- # endif
-+ #endif /* __FreeBSD__ */
-
- # ifndef index
- # ifdef HAS_INDEX
---- src/include/os_bsd.h.orig Sun Apr 25 01:09:46 1993
-+++ src/include/os_bsd.h Sun Aug 25 21:09:59 2002
-@@ -8,18 +8,31 @@
-
- #include "os_unix.h"
-
-+#ifdef __FreeBSD__
-+#define HAS_SYSVDIRS /* <sys/dirent.h> */
-+#define HAS_INTWAITSTATUS /* wait(3) takes an int *, not a union */
-+#else
- #define HAS_NO_ATRIGH_DECL /* if asinh( ) is not in math.h */
--#define HAS_ATRIGH /* acosh( ), asinh( ), atanh( ) */
- #define HAS_FTIME /* ftime( ), <times.h> */
-+#define HAS_INDEX /* index( ) instead of strchr( ) */
-+#define HAS_STRINGS /* use <strings.h> instead of <string.h> */
-+#define HAS_BSDDIRS /* <sys/dir.h> */
-+#endif
-+
-+#define HAS_ATRIGH /* acosh( ), asinh( ), atanh( ) */
- #define HAS_TERMCAP /* tgetxxx( ) */
- #define HAS_VFORK /* BSD-ism, should not be necessary */
--#define HAS_INDEX /* index( ) instead of strchr( ) */
- #define HAS_BCOPY /* bcopy( ), bzero( ) */
- #define HAS_BSDRANDOM /* srandom( ) and random( ) */
- #define HAS_BSDTTY /* <sgtty.h> */
--#define HAS_BSDDIRS /* <sys/dir.h> */
- #define HAS_BSDRUSAGE /* getrusage( ) */
- #define HAS_BSDRLIMIT /* getrlimit( ) */
- #define HAS_DUP2
- #define HAS_GETWD /* getwd(buf) */
--#define HAS_STRINGS /* use <strings.h> instead of <string.h> */
-+
-+#ifdef __FreeBSD__
-+#define HAS_BSDSOCKETS /* <net/inet.h>, socket( ), etc. */
-+#define HAS_BSDTIME /* gettimeofday( ) return time */
-+#define HAS_FLOAT_H /* float.h */
-+#define HAS_STRCHR /* strchr( ) instead of index( ) */
-+#endif
diff --git a/cad/spice/files/patch-ac b/cad/spice/files/patch-ac
deleted file mode 100644
index 8ad35674f7b2..000000000000
--- a/cad/spice/files/patch-ac
+++ /dev/null
@@ -1,62 +0,0 @@
-*** src/bin/sconvert.c.orig Tue Aug 19 17:44:17 1997
---- src/bin/sconvert.c Tue Aug 19 17:47:11 1997
-***************
-*** 80,98 ****
-
- case 1: printf("Input file: ");
- (void) fflush(stdout);
-! (void) gets(buf);
- sf = copy(buf);
- printf("Input type: ");
- (void) fflush(stdout);
-! (void) gets(buf);
- f = buf[0];
- printf("Output file: ");
- (void) fflush(stdout);
-! (void) gets(buf);
- af = copy(buf);
- printf("Output type: ");
- (void) fflush(stdout);
-! (void) gets(buf);
- t = buf[0];
- break;
- default:
---- 80,98 ----
-
- case 1: printf("Input file: ");
- (void) fflush(stdout);
-! (void) fgets(buf,BSIZE_SP,stdin);
- sf = copy(buf);
- printf("Input type: ");
- (void) fflush(stdout);
-! (void) fgets(buf,BSIZE_SP,stdin);
- f = buf[0];
- printf("Output file: ");
- (void) fflush(stdout);
-! (void) fgets(buf,BSIZE_SP,stdin);
- af = copy(buf);
- printf("Output type: ");
- (void) fflush(stdout);
-! (void) fgets(buf,BSIZE_SP,stdin);
- t = buf[0];
- break;
- default:
-*** src/lib/fte/inp.c.orig Tue Aug 19 17:38:25 1997
---- src/lib/fte/inp.c Tue Aug 19 17:33:01 1997
-***************
-*** 666,672 ****
-
- fprintf(cp_out, "run circuit? ");
- fflush(cp_out);
-! (void) gets(buf);
- if (buf[0] != 'n') {
- fprintf(cp_out, "running circuit\n");
- com_run(NULL);
---- 666,672 ----
-
- fprintf(cp_out, "run circuit? ");
- fflush(cp_out);
-! (void) fgets(buf,BSIZE_SP,stdin);
- if (buf[0] != 'n') {
- fprintf(cp_out, "running circuit\n");
- com_run(NULL);
diff --git a/cad/spice/files/patch-ad b/cad/spice/files/patch-ad
deleted file mode 100644
index 3e8980eca6d2..000000000000
--- a/cad/spice/files/patch-ad
+++ /dev/null
@@ -1,192 +0,0 @@
-*** src/bin/main.c.orig Thu Jul 29 00:48:32 1993
---- src/bin/main.c Fri Jan 31 15:59:00 2003
-***************
-*** 25,30 ****
---- 25,37 ----
- #include <pwd.h>
- #endif
-
-+ #ifdef HAS_GNUREADLINE
-+ /* Added GNU Readline Support 11/3/97 -- Andrew Veliath <veliaa@rpi.edu> */
-+ #include <readline/readline.h>
-+ #include <readline/history.h>
-+ #include "fteinput.h"
-+ #endif
-+
- #ifdef HAS_UNIX_SIGS
- #include <signal.h>
- #endif
-***************
-*** 36,41 ****
---- 43,49 ----
- #endif
-
- #include "patchlev.h"
-+
- #include "suffix.h"
-
- int Patch_Level = PATCHLEVEL;
-***************
-*** 49,54 ****
---- 57,67 ----
- bool ft_intrpt = false; /* Set by the (void) signal handlers. */
- bool ft_setflag = false; /* Don't abort after an interrupt. */
-
-+ #ifdef HAS_GNUREADLINE
-+ char gnu_history_file[512];
-+ static char *application_name;
-+ #endif
-+
- struct variable *(*if_getparam)( );
-
- #ifdef BATCH
-***************
-*** 181,186 ****
---- 194,282 ----
-
- #endif
-
-+ #ifdef HAS_GNUREADLINE
-+ /* Adapted ../lib/cp/lexical.c:prompt() for GNU Readline -- Andrew Veliath <veliaa@rpi.edu> */
-+ static char *
-+ prompt()
-+ {
-+ static char pbuf[128];
-+ char *p = pbuf, *s;
-+
-+ if (cp_interactive == false)
-+ return;
-+ if (cp_promptstring == NULL)
-+ s = "-> ";
-+ else
-+ s = cp_promptstring;
-+ if (cp_altprompt)
-+ s = cp_altprompt;
-+ while (*s) {
-+ switch (strip(*s)) {
-+ case '!':
-+ p += sprintf(p, "%d", where_history() + 1);
-+ break;
-+ case '\\':
-+ if (*(s + 1))
-+ p += sprintf(p, "%c", strip(*++s));
-+ default:
-+ *p = strip(*s); ++p;
-+ break;
-+ }
-+ s++;
-+ }
-+ *p = 0;
-+ return pbuf;
-+ }
-+
-+ /* Process device events in Readline's hook since there is no where
-+ else to do it now - AV */
-+ int rl_event_func()
-+ {
-+ static REQUEST reqst = { checkup_option, 0 };
-+ Input(&reqst, NULL);
-+ return 0;
-+ }
-+
-+ /* Added GNU Readline Support -- Andrew Veliath <veliaa@rpi.edu> */
-+ void app_rl_readlines()
-+ {
-+ char *line, *expanded_line;
-+
-+ strcpy(gnu_history_file, getenv("HOME"));
-+ strcat(gnu_history_file, "/.");
-+ strcat(gnu_history_file, application_name);
-+ strcat(gnu_history_file, "_history");
-+
-+ using_history();
-+ read_history(gnu_history_file);
-+
-+ rl_readline_name = application_name;
-+ rl_instream = cp_in;
-+ rl_outstream = cp_out;
-+ rl_event_hook = rl_event_func;
-+
-+ while (1) {
-+ history_set_pos(history_length);
-+ line = readline(prompt());
-+ if (line && *line) {
-+ int s = history_expand(line, &expanded_line);
-+
-+ if (s == 2) {
-+ fprintf(stderr, "-> %s\n", expanded_line);
-+ } else if (s == -1) {
-+ fprintf(stderr, "readline: %s\n", expanded_line);
-+ } else {
-+ cp_evloop(expanded_line);
-+ add_history(expanded_line);
-+ }
-+ free(expanded_line);
-+ }
-+ if (line) free(line);
-+ }
-+ /* History gets written in ../fte/misccoms.c com_quit */
-+ }
-+ #endif /* HAS_GNUREADLINE */
-+
- char *hlp_filelist[] = { "spice", 0 };
-
- void
-***************
-*** 217,222 ****
---- 313,325 ----
- }
- started = true;
-
-+ #ifdef HAS_GNUREADLINE
-+ if (!(application_name = strrchr(av[0],'/')))
-+ application_name = av[0];
-+ else
-+ ++application_name;
-+ #endif
-+
- #ifdef HAS_MAC_ARGCARGV
- ac = initmac(&av);
- #endif
-***************
-*** 393,399 ****
---- 496,506 ----
- # ifdef HAS_UNIX_SIGS
- /* Set up (void) signal handling */
- if (!ft_batchmode) {
-+ # ifdef HAS_GNUREADLINE
-+ (void) signal(SIGINT, SIG_IGN);
-+ # else
- (void) signal(SIGINT, ft_sigintr);
-+ # endif
- (void) signal(SIGFPE, sigfloat);
- # ifdef SIGTSTP
- (void) signal(SIGTSTP, sigstop);
-***************
-*** 588,594 ****
---- 695,705 ----
- } else {
- (void) setjmp(jbuf);
- cp_interactive = true;
-+ #ifdef HAS_GNUREADLINE
-+ app_rl_readlines();
-+ #else
- while (cp_evloop((char *) NULL) == 1) ;
-+ #endif /* ifelse HAS_GNUREADLINE */
- }
-
- # else /* if BATCH */
-***************
-*** 627,633 ****
---- 738,748 ----
- /* Nutmeg "main" */
- (void) setjmp(jbuf);
- cp_interactive = true;
-+ #ifdef HAS_GNUREADLINE
-+ app_rl_readlines();
-+ #else
- while (cp_evloop((char *) NULL) == 1) ;
-+ #endif /* ifelse HAS_GNUREADLINE */
-
- #endif
-
diff --git a/cad/spice/files/patch-ae b/cad/spice/files/patch-ae
deleted file mode 100644
index edef5cc3890c..000000000000
--- a/cad/spice/files/patch-ae
+++ /dev/null
@@ -1,82 +0,0 @@
-diff -cr spice3f4/src/lib/cp/history.c src/lib/cp/history.c
-*** spice3f4/src/lib/cp/history.c Thu Jun 17 17:32:40 1993
---- src/lib/cp/history.c Tue Nov 4 22:18:54 1997
-***************
-*** 11,16 ****
---- 11,24 ----
- #include "cpdefs.h"
- #include "suffix.h"
-
-+ #ifdef HAS_GNUREADLINE
-+
-+ /* Added GNU Readline Support -- Andrew Veliath <veliaa@rpi.edu> */
-+ #include <readline/readline.h>
-+ #include <readline/history.h>
-+
-+ #endif /* HAS_GNUREADLINE */
-+
- static char *dohs();
- static void freehist();
- static wordlist *dohmod();
-***************
-*** 19,24 ****
---- 27,33 ----
- static wordlist *hpattern();
- static wordlist *hprefix();
-
-+
- struct histent *cp_lastone = NULL;
- int cp_maxhistlength = 1000;
- char cp_hat = '^';
-***************
-*** 345,352 ****
---- 354,363 ----
- cp_lastone->hi_next = NULL;
- cp_lastone->hi_event = event;
- cp_lastone->hi_wlist = wl_copy(wlist);
-+ #ifndef HAS_GNUREADLINE
- freehist(histlength - cp_maxhistlength);
- histlength++;
-+ #endif
- return;
- }
-
-***************
-*** 483,492 ****
---- 494,529 ----
- wl = wl->wl_next;
- rev = true;
- }
-+ #ifdef HAS_GNUREADLINE
-+ /* Added GNU Readline Support -- Andrew Veliath <veliaa@rpi.edu> */
-+ {
-+ HIST_ENTRY *he;
-+ int i, N;
-+
-+ N = (wl == NULL) ? history_length : atoi(wl->wl_word);
-+
-+ if (N < 0) N = 0;
-+ if (N > history_length) N = history_length;
-+
-+ if (rev)
-+ for (i = history_length; i > 0 && N; --i, --N) {
-+ he = history_get(i);
-+ if (!he) return;
-+ fprintf(cp_out, "%d\t%s\n", i, he->line);
-+ }
-+ else
-+ for (i = history_length - N + 1; i <= history_length; ++i) {
-+ he = history_get(i);
-+ if (!he) return;
-+ fprintf(cp_out, "%d\t%s\n", i, he->line);
-+ }
-+ }
-+ #else
- if (wl == NULL)
- cp_hprint(cp_event - 1, cp_event - histlength, rev);
- else
- cp_hprint(cp_event - 1, cp_event - 1 - atoi(wl->wl_word), rev);
-+ #endif /* ifelse HAS_GNUREADLINE */
- return;
- }
-
diff --git a/cad/spice/files/patch-af b/cad/spice/files/patch-af
deleted file mode 100644
index de9afa6d9613..000000000000
--- a/cad/spice/files/patch-af
+++ /dev/null
@@ -1,37 +0,0 @@
-diff -cr spice3f4/src/lib/fte/misccoms.c src/lib/fte/misccoms.c
-*** spice3f4/src/lib/fte/misccoms.c Thu Jun 17 17:32:53 1993
---- src/lib/fte/misccoms.c Tue Nov 4 22:18:54 1997
-***************
-*** 11,16 ****
---- 11,24 ----
- #include "hlpdefs.h"
- #include "suffix.h"
-
-+ #ifdef HAS_GNUREADLINE
-+ #include <readline/readline.h>
-+ #include <readline/history.h>
-+
-+ extern int gnu_history_lines;
-+ extern char gnu_history_file[];
-+ #endif
-+
- static void byemesg();
-
- void
-***************
-*** 299,304 ****
---- 307,320 ----
- byemesg();
- } else
- byemesg();
-+
-+ #ifdef HAS_GNUREADLINE
-+ /* Added GNU Readline Support -- Andrew Veliath <veliaa@rpi.edu> */
-+ if (cp_interactive && (cp_maxhistlength > 0)) {
-+ stifle_history(cp_maxhistlength);
-+ write_history(gnu_history_file);
-+ }
-+ #endif /* HAS_GNUREADLINE */
-
- exit(EXIT_NORMAL);
- /* NOTREACHED */
diff --git a/cad/spice/files/patch-ag b/cad/spice/files/patch-ag
deleted file mode 100644
index a7dcec3bb76b..000000000000
--- a/cad/spice/files/patch-ag
+++ /dev/null
@@ -1,24 +0,0 @@
-diff -cr spice3f4/src/lib/fte/signal.c src/lib/fte/signal.c
-*** spice3f4/src/lib/fte/signal.c Thu Jun 17 17:32:59 1993
---- src/lib/fte/signal.c Tue Nov 4 22:19:01 1997
-***************
-*** 32,37 ****
---- 32,39 ----
- * is true.
- */
-
-+ /* not using SIGINT with GNU Readline - AV */
-+ #ifndef HAS_GNUREADLINE
- SIGNAL_TYPE
- ft_sigintr()
- {
-***************
-*** 58,63 ****
---- 60,66 ----
- cp_resetcontrol();
- longjmp(jbuf, 1);
- }
-+ #endif /* !HAS_GNUREADLINE */
-
- /* ARGSUSED */
- SIGNAL_TYPE
diff --git a/cad/spice/files/patch-ah b/cad/spice/files/patch-ah
deleted file mode 100644
index 8a743e3cdb66..000000000000
--- a/cad/spice/files/patch-ah
+++ /dev/null
@@ -1,21 +0,0 @@
-diff -cr spice3f4/src/lib/fte/x10.c src/lib/fte/x10.c
-*** spice3f4/src/lib/fte/x10.c Thu Jun 17 17:32:54 1993
---- src/lib/fte/x10.c Tue Nov 4 22:18:54 1997
-***************
-*** 726,737 ****
---- 726,740 ----
- graph->commandline, fx0, fx1, fy0, fy1);
- }
-
-+ /* don't use the following if using GNU Readline - AV */
-+ #ifndef HAS_GNUREADLINE
- /* hack for Gordon Jacobs */
- /* add to history list if plothistory is set */
- if (cp_getvar("plothistory", VT_BOOL, (char *) &dummy)) {
- wl = cp_parse(buf);
- (void) cp_addhistent(cp_event++, wl);
- }
-+ #endif /* HAS_GNUREADLINE */
-
- (void) cp_evloop(buf);
-
diff --git a/cad/spice/files/patch-ai b/cad/spice/files/patch-ai
deleted file mode 100644
index a462128cf45e..000000000000
--- a/cad/spice/files/patch-ai
+++ /dev/null
@@ -1,20 +0,0 @@
-diff -cr spice3f4/src/lib/fte/x11.c src/lib/fte/x11.c
-*** spice3f4/src/lib/fte/x11.c Thu Jun 17 17:32:59 1993
---- src/lib/fte/x11.c Tue Nov 4 22:18:54 1997
-***************
-*** 773,784 ****
---- 773,787 ----
- graph->commandline, fx0, fx1, fy0, fy1);
- }
-
-+ /* don't use the following if using GNU Readline - AV */
-+ #ifndef HAS_GNUREADLINE
- /* hack for Gordon Jacobs */
- /* add to history list if plothistory is set */
- if (cp_getvar("plothistory", VT_BOOL, (char *) &dummy)) {
- wl = cp_parse(buf);
- (void) cp_addhistent(cp_event++, wl);
- }
-+ #endif /* HAS_GNUREADLINE */
-
- (void) cp_evloop(buf);
diff --git a/cad/spice/files/patch-al b/cad/spice/files/patch-al
deleted file mode 100644
index 86a9b7a54f63..000000000000
--- a/cad/spice/files/patch-al
+++ /dev/null
@@ -1,112 +0,0 @@
-*** spice3f4/src/lib/fte/cpitf.c.orig Sun Dec 7 13:40:46 1997
---- src/lib/fte/cpitf.c Sun Dec 7 13:41:41 1997
-***************
-*** 212,218 ****
- cp_interactive = false;
- inp_spsource(fp, true, buf);
- cp_interactive = true;
-! (void) fclose(fp);
- found = true;
- break;
- } else if (ft_controldb)
---- 212,220 ----
- cp_interactive = false;
- inp_spsource(fp, true, buf);
- cp_interactive = true;
-! /* the following caused me SIGSEGV's since inp_spsource
-! already closes fp - A. Veliath 12/7/97 */
-! /* (void) fclose(fp); */
- found = true;
- break;
- } else if (ft_controldb)
-*** spice3f4/src/lib/fte/device.c Wed Nov 30 21:48:12 1994
---- src/lib/fte/device.c Fri Jan 22 22:33:24 1999
-***************
-*** 661,667 ****
- }
-
- dv = ft_evaluate(n2->pn_right);
-! free_pnode(names);
- if (!dv)
- return;
- if (dv->v_length < 1) {
---- 661,669 ----
- }
-
- dv = ft_evaluate(n2->pn_right);
-! /* prevent names from getting freed twice
-! Guenther Roehrich 22-Jan-99 */
-! /* free_pnode(names); */
- if (!dv)
- return;
- if (dv->v_length < 1) {
-*** spice3f4/src/lib/fte/x11.c Fri Jan 22 22:17:56 1999
---- src/lib/fte/x11.c Fri Jan 22 22:26:29 1999
-***************
-*** 120,126 ****
- /* "invert" works better than "xor" for B&W */
-
- /* xor gc should be a function of the pixels that are written on */
-! gcvalues.function = GXxor;
- gcvalues.line_width = 1;
- gcvalues.foreground = 1;
- gcvalues.background = 0;
---- 120,129 ----
- /* "invert" works better than "xor" for B&W */
-
- /* xor gc should be a function of the pixels that are written on */
-! /* gcvalues.function = GXxor; */
-! /* this patch makes lines visible on true color displays
-! Guenther Roehrich 22-Jan-99 */
-! gcvalues.function = GXinvert;
- gcvalues.line_width = 1;
- gcvalues.foreground = 1;
- gcvalues.background = 0;
-*** spice3f4/src/lib/fte/graf.c Thu Jun 17 23:32:52 1993
---- src/lib/fte/graf.c Fri Jan 22 23:11:43 1999
-***************
-*** 289,297 ****
- if (*tics == (double) np) {
- Text("x", (int) (tox - currentgraph->fontwidth / 2),
- (int) (toy - currentgraph->fontheight / 2));
-! SaveText(currentgraph, "x",
- (int) (tox - currentgraph->fontwidth / 2),
-! (int) (toy - currentgraph->fontheight / 2));
- break;
- }
- }
---- 289,299 ----
- if (*tics == (double) np) {
- Text("x", (int) (tox - currentgraph->fontwidth / 2),
- (int) (toy - currentgraph->fontheight / 2));
-! /* gr_redraw will redraw this w/o our having to save it
-! Guenther Roehrich 22-Jan-99 */
-! /* SaveText(currentgraph, "x",
- (int) (tox - currentgraph->fontwidth / 2),
-! (int) (toy - currentgraph->fontheight / 2)); */
- break;
- }
- }
-***************
-*** 301,309 ****
- /* Draw an 'x' */
- Text("x", (int) (tox - currentgraph->fontwidth / 2),
- (int) (toy - currentgraph->fontheight / 2));
-! SaveText(currentgraph, "x",
- (int) (tox - currentgraph->fontwidth / 2),
-! (int) (toy - currentgraph->fontheight / 2));
- }
- break;
- case PLOT_COMB:
---- 303,313 ----
- /* Draw an 'x' */
- Text("x", (int) (tox - currentgraph->fontwidth / 2),
- (int) (toy - currentgraph->fontheight / 2));
-! /* gr_redraw will redraw this w/o our having to save it
-! Guenther Roehrich 22-Jan-99 */
-! /* SaveText(currentgraph, "x",
- (int) (tox - currentgraph->fontwidth / 2),
-! (int) (toy - currentgraph->fontheight / 2)); */
- }
- break;
- case PLOT_COMB:
diff --git a/cad/spice/files/patch-am b/cad/spice/files/patch-am
deleted file mode 100644
index ddaa44643180..000000000000
--- a/cad/spice/files/patch-am
+++ /dev/null
@@ -1,102 +0,0 @@
-*** spice3f4/src/lib/fte/grid.c Fri Jan 22 22:17:24 1999
---- src/lib/fte/grid.c Fri Jan 22 22:43:14 1999
-***************
-*** 1231,1237 ****
-
- /* SetLinestyle(1); takes too long */
- /* Problems with Suns on very large radii && linestyle */
-! SetLinestyle(0);
-
- /* Now plot all the arc sets. Go as high as 5 times the radius that
- * will fit on the screen. The base magnitude is one more than
---- 1231,1240 ----
-
- /* SetLinestyle(1); takes too long */
- /* Problems with Suns on very large radii && linestyle */
-! /* SetLinestyle(0); */
-! /* linestyle 1 looks better
-! Guenther Roehrich 22-Jan-99 */
-! SetLinestyle(1);
-
- /* Now plot all the arc sets. Go as high as 5 times the radius that
- * will fit on the screen. The base magnitude is one more than
-***************
-*** 1410,1416 ****
- /* Let's be lazy and just draw everything -- we won't get called too
- * much and the circles get clipped anyway...
- */
-! SetColor(18);
-
- cliparc((double) (centx + xoffset + radoff - rad),
- (double) (centy + yoffset), rad, 2*angle,
---- 1413,1422 ----
- /* Let's be lazy and just draw everything -- we won't get called too
- * much and the circles get clipped anyway...
- */
-! /* SetColor(18); */
-! /* draw everything in black
-! Guenther Roehrich 22-Jan-99 */
-! SetColor(1);
-
- cliparc((double) (centx + xoffset + radoff - rad),
- (double) (centy + yoffset), rad, 2*angle,
-***************
-*** 1425,1431 ****
- M_PI - 2 * angle, centx, centy, maxrad, 0);
-
- /* Draw the upper and lower circles. */
-! SetColor(19);
- aclip = cliparc((double) (centx + xoffset + radoff),
- (double) (centy + yoffset + irad), irad,
- (double) (M_PI * 1.5 + 2 * iangle),
---- 1431,1440 ----
- M_PI - 2 * angle, centx, centy, maxrad, 0);
-
- /* Draw the upper and lower circles. */
-! /* SetColor(19); */
-! /* draw everything in black
-! Guenther Roehrich 22-Jan-99 */
-! SetColor(1);
- aclip = cliparc((double) (centx + xoffset + radoff),
- (double) (centy + yoffset + irad), irad,
- (double) (M_PI * 1.5 + 2 * iangle),
-***************
-*** 1442,1448 ****
- adddeglabel(graph, ndeg, xlab, ylab,
- gr_xcenter, gr_ycenter, gr_xcenter, gr_ycenter);
- */
-! SetColor(19);
- }
- }
- aclip = cliparc((double) (centx + xoffset + radoff),
---- 1451,1460 ----
- adddeglabel(graph, ndeg, xlab, ylab,
- gr_xcenter, gr_ycenter, gr_xcenter, gr_ycenter);
- */
-! /* SetColor(19); */
-! /* draw everything in black
-! Guenther Roehrich 22-Jan-99 */
-! SetColor(1);
- }
- }
- aclip = cliparc((double) (centx + xoffset + radoff),
-***************
-*** 1456,1462 ****
- SetColor(1);
- adddeglabel(graph, ndeg, xlab, ylab,
- gr_xcenter, gr_ycenter, gr_xcenter, gr_ycenter);
-! SetColor(19);
- }
-
- /* Now toss the labels on... */
---- 1468,1477 ----
- SetColor(1);
- adddeglabel(graph, ndeg, xlab, ylab,
- gr_xcenter, gr_ycenter, gr_xcenter, gr_ycenter);
-! /* SetColor(19); */
-! /* draw everything in black
-! Guenther Roehrich 22-Jan-99 */
-! SetColor(1);
- }
-
- /* Now toss the labels on... */
diff --git a/cad/spice/files/patch-as b/cad/spice/files/patch-as
deleted file mode 100644
index 587f90a66572..000000000000
--- a/cad/spice/files/patch-as
+++ /dev/null
@@ -1,19 +0,0 @@
-*** util/skeleton/make_def.bd.orig Thu Jul 29 16:35:18 1993
---- util/skeleton/make_def.bd Fri Oct 1 01:47:31 1999
-***************
-*** 8,14 ****
- PATH_SEP = /
- PS = /
- REVISION =
-! VERSION = 3f4
- VERSION_REVISION= $(VERSION)$(REVISION)
- NOTICE =
- TOP = /projects/spice3/spice$(VERSION)
---- 8,14 ----
- PATH_SEP = /
- PS = /
- REVISION =
-! VERSION = 3f5
- VERSION_REVISION= $(VERSION)$(REVISION)
- NOTICE =
- TOP = /projects/spice3/spice$(VERSION)
diff --git a/cad/spice/files/patch-ba b/cad/spice/files/patch-ba
deleted file mode 100644
index 9ea7b915dc67..000000000000
--- a/cad/spice/files/patch-ba
+++ /dev/null
@@ -1,38 +0,0 @@
-# spice3f4/3f5 patch level 1
-# June 22, 1994
-# Anthony Parker (tonyp@mpce.mq.edu.au)
-# Macquarie University, Sydney Australia 2109
-#
-*** spice3f4/src/lib/dev/mos6/mos6itf.h Mon Sep 28 03:25:22 1992
---- src/lib/dev/mos6/mos6itf.h Fri Jun 17 12:59:58 1994
-***************
-*** 46,58 ****
- NULL, /* MOS6acLoad, XXX */
- NULL,
- MOS6destroy,
-! #ifdef DELETES
-! MOS6mDelete,
-! MOS6delete,
-! #else /* DELETES */
-! NULL,
-! NULL,
-! #endif /* DELETES */
- MOS6getic,
- MOS6ask,
- MOS6mAsk,
---- 46,53 ----
- NULL, /* MOS6acLoad, XXX */
- NULL,
- MOS6destroy,
-! NULL, /* DELETES */
-! NULL,/* DELETES */
- MOS6getic,
- MOS6ask,
- MOS6mAsk,
-*** spice3f4/src/include/patchlev.h Wed Jun 15 14:32:24 1994
---- src/include/patchlev.h Wed Jun 22 08:34:07 1994
-***************
-*** 1 ****
-! #define PATCHLEVEL 0
---- 1 ----
-! #define PATCHLEVEL 2
diff --git a/cad/spice/files/patch-bb b/cad/spice/files/patch-bb
deleted file mode 100644
index 864d6f4ba39a..000000000000
--- a/cad/spice/files/patch-bb
+++ /dev/null
@@ -1,11 +0,0 @@
---- src/lib/fte/doplot.c.orig Sun Apr 25 23:48:45 1993
-+++ src/lib/fte/doplot.c Mon Feb 26 18:03:20 2001
-@@ -117,7 +117,7 @@
- }
-
- if (!cp_getvar("hcopydevtype", VT_STRING, buf)) {
-- devtype = "plot5";
-+ devtype = "postscript";
- } else {
- devtype = buf;
- }
diff --git a/cad/spice/files/patch-bc b/cad/spice/files/patch-bc
deleted file mode 100644
index 22a05ee078a1..000000000000
--- a/cad/spice/files/patch-bc
+++ /dev/null
@@ -1,17 +0,0 @@
---- src/lib/fte/x11.c~ Fri Mar 22 00:12:59 2002
-+++ src/lib/fte/x11.c Fri Mar 22 00:25:41 2002
-@@ -808,11 +808,13 @@
- {
-
- GRAPH *graph = (GRAPH *) client_data;
-+ Widget w;
-
- /* Iplots are done asynchronously */
- DEVDEP(graph).isopen = 0;
-+ w = DEVDEP(graph).shell;
- DestroyGraph(graph->graphid);
-- XtDestroyWidget(DEVDEP(graph).shell);
-+ XtDestroyWidget(w);
-
- }
-
diff --git a/cad/spice/files/patch-conf_defaults b/cad/spice/files/patch-conf_defaults
new file mode 100644
index 000000000000..22608904f2d1
--- /dev/null
+++ b/cad/spice/files/patch-conf_defaults
@@ -0,0 +1,45 @@
+--- conf/defaults.orig Thu Jul 17 16:40:51 2003
++++ conf/defaults Thu Jul 17 16:51:19 2003
+@@ -65,7 +65,7 @@
+ # the following definition:
+ # SYS_DIR = $(DIST_DIR)
+
+-SYS_DIR = $(TOP1)/$(SYSTEM)
++SYS_DIR = $(TOP0)/$(SYSTEM)
+
+ # OBJ_TOP is the directory in which intermidiate files reside
+ # These are ".o" files, synthesized ".c" files, ".a" files,
+@@ -105,12 +105,12 @@
+ # identified as and SYSTEM is the name of the per-system definitions
+ # file listed on the "build" command line.
+
+-SPICE_DIR = $(TOP1)/$(SYSTEM)
+-SPICE_LIB_DIR = $(SPICE_DIR)/lib
++SPICE_DIR = ${PREFIX}
++SPICE_LIB_DIR = $(SPICE_DIR)/share/spice
+ SPICE_EXEC_DIR = $(SPICE_DIR)/bin
+
+ S_SPICE_DIR = $(SPICE_DIR)
+-S_SPICE_LIB_DIR = $(S_SPICE_DIR)/lib
++S_SPICE_LIB_DIR = $(S_SPICE_DIR)/share/spice
+ S_SPICE_EXEC_DIR= $(S_SPICE_DIR)/bin
+
+ # INSTALL_DIRS lists the directories that need to be created before
+@@ -133,7 +133,7 @@
+
+ # CC_OPT: Default compile options (optimization/debug level, other)
+
+-CC_OPT = -O
++CC_OPT =
+
+ # CC_OPT_SAFE: Special compile options to override CC_OPT for code
+ # which typically causes problems for most compilers (bsim1 and bsim2).
+@@ -203,7 +203,7 @@
+ # X_DIR indicates the top of the X11 lib/include hierarchy; it is only
+ # a convenience that is used in the following definitions.
+
+-X_DIR = /usr
++X_DIR = ${X11BASE}
+
+ # INCX lists the X include directories. This may be different between
+ # MIT X11r5, X11r4, and your vendor's version of X11, though listing
diff --git a/cad/spice/files/patch-level1 b/cad/spice/files/patch-level1
new file mode 100644
index 000000000000..7e3ddad09395
--- /dev/null
+++ b/cad/spice/files/patch-level1
@@ -0,0 +1,23 @@
+# spice3f4/3f5 patch level 1
+# June 22, 1994
+# Anthony Parker (tonyp@mpce.mq.edu.au)
+# Macquarie University, Sydney Australia 2109
+#
+--- src/lib/dev/mos6/mos6itf.h.orig Mon Sep 28 03:25:22 1992
++++ src/lib/dev/mos6/mos6itf.h Thu Jul 17 00:21:33 2003
+@@ -46,13 +46,8 @@
+ NULL, /* MOS6acLoad, XXX */
+ NULL,
+ MOS6destroy,
+-#ifdef DELETES
+- MOS6mDelete,
+- MOS6delete,
+-#else /* DELETES */
+- NULL,
+- NULL,
+-#endif /* DELETES */
++ NULL, /* DELETES */
++ NULL,/* DELETES */
+ MOS6getic,
+ MOS6ask,
+ MOS6mAsk,
diff --git a/cad/spice/files/patch-ab b/cad/spice/files/patch-sp3f5
index b271cc97905d..f9606a6b4cc1 100644
--- a/cad/spice/files/patch-ab
+++ b/cad/spice/files/patch-sp3f5
@@ -1,4 +1,4 @@
-NOTE: This are Berkeley patches for 3F4
+These are official Berkeley fixes for sp3f4
*** src/lib/fte/grid.c.orig Sun Apr 25 14:53:11 1993
--- src/lib/fte/grid.c Sat Jan 29 10:47:59 1994
***************
diff --git a/cad/spice/files/patch-src_bin_sconvert_c b/cad/spice/files/patch-src_bin_sconvert_c
new file mode 100644
index 000000000000..97f904a0cd63
--- /dev/null
+++ b/cad/spice/files/patch-src_bin_sconvert_c
@@ -0,0 +1,26 @@
+--- src/bin/sconvert.c.orig Mon Sep 14 21:30:41 1992
++++ src/bin/sconvert.c Thu Jul 17 00:47:50 2003
+@@ -80,19 +80,19 @@
+
+ case 1: printf("Input file: ");
+ (void) fflush(stdout);
+- (void) gets(buf);
++ (void) fgets(buf,BSIZE_SP,stdin);
+ sf = copy(buf);
+ printf("Input type: ");
+ (void) fflush(stdout);
+- (void) gets(buf);
++ (void) fgets(buf,BSIZE_SP,stdin);
+ f = buf[0];
+ printf("Output file: ");
+ (void) fflush(stdout);
+- (void) gets(buf);
++ (void) fgets(buf,BSIZE_SP,stdin);
+ af = copy(buf);
+ printf("Output type: ");
+ (void) fflush(stdout);
+- (void) gets(buf);
++ (void) fgets(buf,BSIZE_SP,stdin);
+ t = buf[0];
+ break;
+ default:
diff --git a/cad/spice/files/patch-src_include_misc_h b/cad/spice/files/patch-src_include_misc_h
new file mode 100644
index 000000000000..a772f63793e2
--- /dev/null
+++ b/cad/spice/files/patch-src_include_misc_h
@@ -0,0 +1,31 @@
+*** src/include/misc.h.orig Thu Dec 1 09:17:02 1994
+--- src/include/misc.h Sun Mar 31 12:32:58 1996
+***************
+*** 86,92 ****
+--- 86,94 ----
+ extern char *realloc();
+ extern char *getenv();
+ extern int errno;
++ #ifndef __FreeBSD__
+ extern char *sys_errlist[];
++ #endif
+ extern char *getenv();
+ extern char *getwd();
+ extern int rand();
+***************
+*** 111,122 ****
+--- 111,124 ----
+ # endif /* clearerr */
+ # endif /* HAS_CLEARERR */
+
++ #ifndef __FreeBSD__
+ # ifndef bzero
+ extern int bzero();
+ # endif
+ # ifndef bcopy
+ extern void bcopy();
+ # endif
++ #endif /* __FreeBSD__ */
+
+ # ifndef index
+ # ifdef HAS_INDEX
diff --git a/cad/spice/files/patch-src_include_os_bsd_h b/cad/spice/files/patch-src_include_os_bsd_h
new file mode 100644
index 000000000000..bcd219cedfa0
--- /dev/null
+++ b/cad/spice/files/patch-src_include_os_bsd_h
@@ -0,0 +1,38 @@
+--- src/include/os_bsd.h.orig Sat Apr 24 18:09:46 1993
++++ src/include/os_bsd.h Thu Jul 17 01:26:36 2003
+@@ -8,18 +8,31 @@
+
+ #include "os_unix.h"
+
++#ifdef __FreeBSD__
++#define HAS_SYSVDIRS /* <sys/dirent.h> */
++#define HAS_INTWAITSTATUS /* wait(3) takes an int *, not a union */
++#else
+ #define HAS_NO_ATRIGH_DECL /* if asinh( ) is not in math.h */
+-#define HAS_ATRIGH /* acosh( ), asinh( ), atanh( ) */
+ #define HAS_FTIME /* ftime( ), <times.h> */
++#define HAS_INDEX /* index( ) instead of strchr( ) */
++#define HAS_STRINGS /* use <strings.h> instead of <string.h> */
++#define HAS_BSDDIRS /* <sys/dir.h> */
++#endif
++
++#define HAS_ATRIGH /* acosh( ), asinh( ), atanh( ) */
+ #define HAS_TERMCAP /* tgetxxx( ) */
+ #define HAS_VFORK /* BSD-ism, should not be necessary */
+-#define HAS_INDEX /* index( ) instead of strchr( ) */
+ #define HAS_BCOPY /* bcopy( ), bzero( ) */
+ #define HAS_BSDRANDOM /* srandom( ) and random( ) */
+ #define HAS_BSDTTY /* <sgtty.h> */
+-#define HAS_BSDDIRS /* <sys/dir.h> */
+ #define HAS_BSDRUSAGE /* getrusage( ) */
+ #define HAS_BSDRLIMIT /* getrlimit( ) */
+ #define HAS_DUP2
+ #define HAS_GETWD /* getwd(buf) */
+-#define HAS_STRINGS /* use <strings.h> instead of <string.h> */
++
++#ifdef __FreeBSD__
++#define HAS_BSDSOCKETS /* <net/inet.h>, socket( ), etc. */
++#define HAS_BSDTIME /* gettimeofday( ) return time */
++#define HAS_FLOAT_H /* float.h */
++#define HAS_STRCHR /* strchr( ) instead of index( ) */
++#endif
diff --git a/cad/spice/files/patch-src_include_patchlev_h b/cad/spice/files/patch-src_include_patchlev_h
new file mode 100644
index 000000000000..b5072c389750
--- /dev/null
+++ b/cad/spice/files/patch-src_include_patchlev_h
@@ -0,0 +1,5 @@
+--- src/include/patchlev.h.orig Thu Jul 29 05:30:30 1993
++++ src/include/patchlev.h Thu Jul 17 00:21:33 2003
+@@ -1 +1 @@
+-#define PATCHLEVEL 0
++#define PATCHLEVEL 2
diff --git a/cad/spice/files/patch-src_lib_ckt_dctrcurv_c b/cad/spice/files/patch-src_lib_ckt_dctrcurv_c
new file mode 100644
index 000000000000..4ca7bfebdb6a
--- /dev/null
+++ b/cad/spice/files/patch-src_lib_ckt_dctrcurv_c
@@ -0,0 +1,135 @@
+--- src/lib/ckt/dctrcurv.c.orig Mon Apr 5 19:50:20 1993
++++ src/lib/ckt/dctrcurv.c Thu Jul 17 02:52:24 2003
+@@ -15,6 +15,7 @@
+ #endif
+ #include "cktdefs.h"
+ #include "util.h"
++#include "const.h"
+ #include "sperror.h"
+ #include "suffix.h"
+
+@@ -38,17 +39,6 @@
+ int firstTime=1;
+ static GENERIC *plot;
+
+-#ifdef HAS_SENSE2
+-#ifdef SENSDEBUG
+- if(ckt->CKTsenInfo && (ckt->CKTsenInfo->SENmode&DCSEN) ){
+- printf("\nDC Sensitivity Results\n\n");
+- CKTsenPrint(ckt);
+- }
+-#endif /* SENSDEBUG */
+-#endif
+-
+-
+-
+ vcode = CKTtypelook("Vsource");
+ icode = CKTtypelook("Isource");
+ if(!restart && cv->TRCVnestState >= 0) {
+@@ -106,15 +96,37 @@
+ }
+ }
+ }
++#ifndef TEMP_CODE
++#define TEMP_CODE 1023
++#endif
++ if(!strcmp(cv->TRCVvName[i], "temp"))
++ {
++ cv->TRCVvSave[i]=ckt->CKTtemp;
++ cv->TRCVvType[i]=TEMP_CODE;
++ ckt->CKTtemp = cv->TRCVvStart[i] + CONSTCtoK;
++ goto found;
++ }
++
+ (*(SPfrontEnd->IFerror))(ERR_FATAL,
+ "DCtrCurv: source %s not in circuit", &(cv->TRCVvName[i]));
+ return(E_NODEV);
+ found:;
+ }
++ i--;
+ error = CKTnames(ckt,&numNames,&nameList);
+ if(error) return(error);
+- (*(SPfrontEnd->IFnewUid))((GENERIC *)ckt,&varUid,(IFuid )NULL,
+- "sweep", UID_OTHER, (GENERIC **)NULL);
++ if (cv->TRCVvType[i]==vcode)
++ (*(SPfrontEnd->IFnewUid))((GENERIC *)ckt,&varUid,(IFuid )NULL,
++ "v-sweep", UID_OTHER, (GENERIC **)NULL);
++ else if (cv->TRCVvType[i]==icode)
++ (*(SPfrontEnd->IFnewUid))((GENERIC *)ckt,&varUid,(IFuid )NULL,
++ "i-sweep", UID_OTHER, (GENERIC **)NULL);
++ else if (cv->TRCVvType[i]==TEMP_CODE)
++ (*(SPfrontEnd->IFnewUid))((GENERIC *)ckt,&varUid,(IFuid )NULL,
++ "temp-sweep", UID_OTHER, (GENERIC **)NULL);
++ else
++ (*(SPfrontEnd->IFnewUid))((GENERIC *)ckt,&varUid,(IFuid )NULL,
++ "?-sweep", UID_OTHER, (GENERIC **)NULL);
+ error = (*(SPfrontEnd->OUTpBeginPlot))((GENERIC *)ckt,
+ (GENERIC*)ckt->CKTcurJob, ckt->CKTcurJob->JOBname,
+ varUid,IF_REAL,numNames,nameList, IF_REAL,&plot);
+@@ -150,6 +162,16 @@
+ if (i > cv->TRCVnestLevel ) break ;
+ goto nextstep;
+ }
++ } else if(cv->TRCVvType[i]==TEMP_CODE) {
++ if(ckt->CKTtemp - CONSTCtoK > cv->TRCVvStop[i])
++ {
++ i++ ;
++ firstTime=1;
++ ckt->CKTmode = (ckt->CKTmode & MODEUIC) |
++ MODEDCTRANCURVE | MODEINITJCT ;
++ if (i > cv->TRCVnestLevel ) break ;
++ goto nextstep;
++ }
+ } /* else not possible */
+ while (i > 0) {
+ /* init(i); */
+@@ -160,6 +182,9 @@
+ } else if(cv->TRCVvType[i]==icode) { /* current source */
+ ((ISRCinstance *)(cv->TRCVvElt[i]))->ISRCdcValue =
+ cv->TRCVvStart[i];
++ } else if(cv->TRCVvType[i]==TEMP_CODE) {
++ ckt->CKTtemp = cv->TRCVvStart[i] + CONSTCtoK;
++ CKTtemp(ckt);
+ } /* else not possible */
+ }
+
+@@ -188,7 +213,11 @@
+ ckt->CKTtime = ((ISRCinstance *)(cv->TRCVvElt[i]))
+ ->ISRCdcValue ;
+ }
+-
++ else
++ {
++ fprintf(stdout, "Shuldn't pass through here!\n");
++ exit(1);
++ }
+ #ifdef HAS_SENSE2
+ /*
+ if(!ckt->CKTsenInfo) printf("sensitivity structure does not exist\n");
+@@ -232,6 +261,12 @@
+ } else if(cv->TRCVvType[i]==icode) { /* current source */
+ ((ISRCinstance*)(cv->TRCVvElt[i]))->ISRCdcValue +=
+ cv->TRCVvStep[i];
++ }
++/* serban */
++ else if (cv->TRCVvType[i]==TEMP_CODE)
++ {
++ ckt->CKTtemp += cv->TRCVvStep[i];
++ CKTtemp(ckt);
+ } /* else not possible */
+ if( (*(SPfrontEnd->IFpauseTest))() ) {
+ /* user asked us to pause, so save state */
+@@ -247,10 +282,12 @@
+ ((VSRCinstance*)(cv->TRCVvElt[i]))->VSRCdcValue =
+ cv->TRCVvSave[i];
+ ((VSRCinstance*)(cv->TRCVvElt[i]))->VSRCdcGiven = cv->TRCVgSave[i];
+- } else /* if(cv->TRCVvType[i] == icode) current source */ {
++ } else if(cv->TRCVvType[i] == icode) {
+ ((ISRCinstance*)(cv->TRCVvElt[i]))->ISRCdcValue =
+ cv->TRCVvSave[i];
+ ((ISRCinstance*)(cv->TRCVvElt[i]))->ISRCdcGiven = cv->TRCVgSave[i];
++ } else if(cv->TRCVvType[i] == TEMP_CODE) {
++ ckt->CKTtemp = cv->TRCVvSave[i];
+ } /* else not possible */
+ }
+ (*(SPfrontEnd->OUTendPlot))(plot);
diff --git a/cad/spice/files/patch-ap b/cad/spice/files/patch-src_lib_fte_aspice_c
index d17e47182a0c..d17e47182a0c 100644
--- a/cad/spice/files/patch-ap
+++ b/cad/spice/files/patch-src_lib_fte_aspice_c
diff --git a/cad/spice/files/patch-src_lib_fte_cpitf_c b/cad/spice/files/patch-src_lib_fte_cpitf_c
new file mode 100644
index 000000000000..684cf9ae5693
--- /dev/null
+++ b/cad/spice/files/patch-src_lib_fte_cpitf_c
@@ -0,0 +1,13 @@
+--- src/lib/fte/cpitf.c.orig Tue Mar 30 16:55:42 1993
++++ src/lib/fte/cpitf.c Thu Jul 17 00:47:50 2003
+@@ -212,7 +212,9 @@
+ cp_interactive = false;
+ inp_spsource(fp, true, buf);
+ cp_interactive = true;
+- (void) fclose(fp);
++ /* the following caused me SIGSEGV's since inp_spsource
++ already closes fp - A. Veliath 12/7/97 */
++ /* (void) fclose(fp); */
+ found = true;
+ break;
+ } else if (ft_controldb)
diff --git a/cad/spice/files/patch-src_lib_fte_device_c b/cad/spice/files/patch-src_lib_fte_device_c
new file mode 100644
index 000000000000..26c4e60b0998
--- /dev/null
+++ b/cad/spice/files/patch-src_lib_fte_device_c
@@ -0,0 +1,13 @@
+--- src/lib/fte/device.c.orig Thu Jul 29 21:09:59 1993
++++ src/lib/fte/device.c Thu Jul 17 00:47:50 2003
+@@ -661,7 +661,9 @@
+ }
+
+ dv = ft_evaluate(n2->pn_right);
+- free_pnode(names);
++ /* prevent names from getting freed twice
++ Guenther Roehrich 22-Jan-99 */
++ /* free_pnode(names); */
+ if (!dv)
+ return;
+ if (dv->v_length < 1) {
diff --git a/cad/spice/files/patch-an b/cad/spice/files/patch-src_lib_fte_dimens_c
index a61223c0a9c3..2e6e5157b5de 100644
--- a/cad/spice/files/patch-an
+++ b/cad/spice/files/patch-src_lib_fte_dimens_c
@@ -1,5 +1,5 @@
---- src/lib/fte//dimens.c.orig Sun Apr 25 18:03:19 1993
-+++ src/lib/fte//dimens.c Thu Sep 30 10:02:10 1999
+--- src/lib/fte/dimens.c.orig Sun Apr 25 18:03:19 1993
++++ src/lib/fte/dimens.c Thu Sep 30 10:02:10 1999
@@ -21,9 +21,21 @@
{
int i;
diff --git a/cad/spice/files/patch-bd b/cad/spice/files/patch-src_lib_fte_doplot_c
index cd9e272a2e75..7e100f1ff332 100644
--- a/cad/spice/files/patch-bd
+++ b/cad/spice/files/patch-src_lib_fte_doplot_c
@@ -1,5 +1,14 @@
---- src/lib/fte/doplot.c.orig Fri Mar 22 21:02:55 2002
-+++ src/lib/fte/doplot.c Fri Mar 22 22:14:07 2002
+--- src/lib/fte/doplot.c.orig Sun Apr 25 23:48:45 1993
++++ src/lib/fte/doplot.c Mon Feb 26 18:03:20 2001
+@@ -117,7 +117,7 @@
+ }
+
+ if (!cp_getvar("hcopydevtype", VT_STRING, buf)) {
+- devtype = "plot5";
++ devtype = "postscript";
+ } else {
+ devtype = buf;
+ }
@@ -147,10 +147,23 @@
DevSwitch(NULL);
return;
diff --git a/cad/spice/files/patch-src_lib_fte_graf_c b/cad/spice/files/patch-src_lib_fte_graf_c
new file mode 100644
index 000000000000..1b87553b75f8
--- /dev/null
+++ b/cad/spice/files/patch-src_lib_fte_graf_c
@@ -0,0 +1,30 @@
+--- src/lib/fte/graf.c.orig Tue Jan 5 16:43:44 1993
++++ src/lib/fte/graf.c Thu Jul 17 12:16:42 2003
+@@ -289,9 +289,11 @@
+ if (*tics == (double) np) {
+ Text("x", (int) (tox - currentgraph->fontwidth / 2),
+ (int) (toy - currentgraph->fontheight / 2));
+- SaveText(currentgraph, "x",
++ /* gr_redraw will redraw this w/o our having to save it
++ Guenther Roehrich 22-Jan-99 */
++ /* SaveText(currentgraph, "x",
+ (int) (tox - currentgraph->fontwidth / 2),
+- (int) (toy - currentgraph->fontheight / 2));
++ (int) (toy - currentgraph->fontheight / 2)); */
+ break;
+ }
+ }
+@@ -301,9 +303,11 @@
+ /* Draw an 'x' */
+ Text("x", (int) (tox - currentgraph->fontwidth / 2),
+ (int) (toy - currentgraph->fontheight / 2));
+- SaveText(currentgraph, "x",
++ /* gr_redraw will redraw this w/o our having to save it
++ Guenther Roehrich 22-Jan-99 */
++ /* SaveText(currentgraph, "x",
+ (int) (tox - currentgraph->fontwidth / 2),
+- (int) (toy - currentgraph->fontheight / 2));
++ (int) (toy - currentgraph->fontheight / 2)); */
+ }
+ break;
+ case PLOT_COMB:
diff --git a/cad/spice/files/patch-src_lib_fte_grid_c b/cad/spice/files/patch-src_lib_fte_grid_c
new file mode 100644
index 000000000000..7521d0460c42
--- /dev/null
+++ b/cad/spice/files/patch-src_lib_fte_grid_c
@@ -0,0 +1,62 @@
+--- src/lib/fte/grid.c.orig Sun Apr 25 16:53:11 1993
++++ src/lib/fte/grid.c Thu Jul 17 00:47:51 2003
+@@ -1230,7 +1230,10 @@
+
+ /* SetLinestyle(1); takes too long */
+ /* Problems with Suns on very large radii && linestyle */
+- SetLinestyle(0);
++ /* SetLinestyle(0); */
++ /* linestyle 1 looks better
++ Guenther Roehrich 22-Jan-99 */
++ SetLinestyle(1);
+
+ /* Now plot all the arc sets. Go as high as 5 times the radius that
+ * will fit on the screen. The base magnitude is one more than
+@@ -1409,7 +1412,10 @@
+ /* Let's be lazy and just draw everything -- we won't get called too
+ * much and the circles get clipped anyway...
+ */
+- SetColor(18);
++ /* SetColor(18); */
++ /* draw everything in black
++ Guenther Roehrich 22-Jan-99 */
++ SetColor(1);
+
+ cliparc((double) (centx + xoffset + radoff - rad),
+ (double) (centy + yoffset), rad, 2*angle,
+@@ -1424,7 +1430,10 @@
+ M_PI - 2 * angle, centx, centy, maxrad, 0);
+
+ /* Draw the upper and lower circles. */
+- SetColor(19);
++ /* SetColor(19); */
++ /* draw everything in black
++ Guenther Roehrich 22-Jan-99 */
++ SetColor(1);
+ aclip = cliparc((double) (centx + xoffset + radoff),
+ (double) (centy + yoffset + irad), irad,
+ (double) (M_PI * 1.5 + 2 * iangle),
+@@ -1441,7 +1450,10 @@
+ adddeglabel(graph, ndeg, xlab, ylab,
+ gr_xcenter, gr_ycenter, gr_xcenter, gr_ycenter);
+ */
+- SetColor(19);
++ /* SetColor(19); */
++ /* draw everything in black
++ Guenther Roehrich 22-Jan-99 */
++ SetColor(1);
+ }
+ }
+ aclip = cliparc((double) (centx + xoffset + radoff),
+@@ -1455,7 +1467,10 @@
+ SetColor(1);
+ adddeglabel(graph, ndeg, xlab, ylab,
+ gr_xcenter, gr_ycenter, gr_xcenter, gr_ycenter);
+- SetColor(19);
++ /* SetColor(19); */
++ /* draw everything in black
++ Guenther Roehrich 22-Jan-99 */
++ SetColor(1);
+ }
+
+ /* Now toss the labels on... */
diff --git a/cad/spice/files/patch-src_lib_fte_inp_c b/cad/spice/files/patch-src_lib_fte_inp_c
new file mode 100644
index 000000000000..bceb37e0b0c4
--- /dev/null
+++ b/cad/spice/files/patch-src_lib_fte_inp_c
@@ -0,0 +1,11 @@
+--- src/lib/fte/inp.c.orig Thu Apr 29 18:06:28 1993
++++ src/lib/fte/inp.c Thu Jul 17 00:47:50 2003
+@@ -666,7 +666,7 @@
+
+ fprintf(cp_out, "run circuit? ");
+ fflush(cp_out);
+- (void) gets(buf);
++ (void) fgets(buf,BSIZE_SP,stdin);
+ if (buf[0] != 'n') {
+ fprintf(cp_out, "running circuit\n");
+ com_run(NULL);
diff --git a/cad/spice/files/patch-src_lib_fte_postcoms_c b/cad/spice/files/patch-src_lib_fte_postcoms_c
new file mode 100644
index 000000000000..aa8dc564671d
--- /dev/null
+++ b/cad/spice/files/patch-src_lib_fte_postcoms_c
@@ -0,0 +1,11 @@
+--- src/lib/fte/postcoms.c.orig Sat Jul 17 19:28:05 1999
++++ src/lib/fte/postcoms.c Thu Jul 17 10:23:13 2003
+@@ -135,7 +145,7 @@
+ }
+ t = ft_evaluate(nn);
+ if (!t) {
+- /* XXX error message */
++ fprintf(cp_err, "Error: Can't evaluate %s\n", rhs);
+ tfree(p);
+ return;
+ }
diff --git a/cad/spice/files/patch-src_lib_fte_resource_c b/cad/spice/files/patch-src_lib_fte_resource_c
new file mode 100644
index 000000000000..b6ab6b0239c0
--- /dev/null
+++ b/cad/spice/files/patch-src_lib_fte_resource_c
@@ -0,0 +1,12 @@
+--- src/lib/fte/resource.c.orig Wed Apr 28 17:39:03 1993
++++ src/lib/fte/resource.c Thu Jul 17 00:47:50 2003
+@@ -369,7 +369,9 @@
+ long x;
+ SIGNAL_TYPE (*orig_signal)( );
+
++#ifndef __FreeBSD__
+ if (getenv("SPICE_NO_DATASEG_CHECK"))
++#endif
+ return 0;
+
+ low = 0;
diff --git a/cad/spice/files/patch-src_lib_fte_vectors_c b/cad/spice/files/patch-src_lib_fte_vectors_c
new file mode 100644
index 000000000000..eb38e9ad22eb
--- /dev/null
+++ b/cad/spice/files/patch-src_lib_fte_vectors_c
@@ -0,0 +1,82 @@
+--- src/lib/fte/vectors.c.orig Sat Jul 17 19:28:05 1999
++++ src/lib/fte/vectors.c Sat Jul 17 19:28:05 1999
+@@ -200,7 +200,7 @@
+ {
+ struct dvec *d, *end = NULL, *newv = NULL;
+ struct plot *pl;
+- char buf[BSIZE_SP], *s, *wd, *name, *param;
++ char buf[BSIZE_SP], *s, *wd, *whole, *name = NULL, *param;
+ int i = 0;
+ struct variable *vv;
+
+@@ -251,19 +251,28 @@
+ fprintf(cp_err,
+ "Error: plot wildcard (name %s) matches nothing\n",
+ word);
++
++ /* MW. I don't want core leaks here */
++ tfree(wd);
+ return (NULL);
+ }
+ }
++
+ if (!d && (*word == SPECCHAR)) {
+ /* This is a special quantity... */
+ if (ft_nutmeg) {
+ fprintf(cp_err,
+ "Error: circuit parameters only available with spice\n");
++
++ tfree(wd); /* MW. Memory leak fixed again */
+ return (false);
+ }
+- name = ++word;
++
++ whole=copy(word);
++ name = ++word;
+ for (param = name; *param && (*param != '['); param++)
+- ;
++ ;
++
+ if (*param) {
+ *param++ = '\0';
+ for (s = param; *s && *s != ']'; s++)
+@@ -271,27 +280,36 @@
+ *s = '\0';
+ } else
+ param = NULL;
+-
++
++
+ if (ft_curckt) {
++
+ vv = (*if_getparam)(ft_curckt->ci_ckt, &name, param, 0, 0);
+ if (!vv) {
++ tfree(whole);
++ tfree(wd);
+ return (NULL);
+ }
+ } else {
+ fprintf(cp_err, "Error: No circuit loaded.\n");
++ tfree(whole);
++ tfree(wd);
+ return (NULL);
+ }
+
+- tfree(wd);
+ d = alloc(struct dvec);
+ ZERO(d, struct dvec);
+- d->v_name = copy(word);
++ d->v_name = copy(whole); /* MW. The same as word before */
+ d->v_type = SV_NOTYPE;
+ d->v_flags |= VF_REAL; /* No complex values yet... */
+ d->v_realdata = (double *) tmalloc(sizeof (double));
+ d->v_length = 1;
+ *d->v_realdata = vv->va_real;
++
++ tfree(wd);
+ vec_new(d);
++ tfree(whole);
++ tfree(wd);
+ return (d);
+ }
+
diff --git a/cad/spice/files/patch-src_lib_fte_x11_c b/cad/spice/files/patch-src_lib_fte_x11_c
new file mode 100644
index 000000000000..b10456e700a8
--- /dev/null
+++ b/cad/spice/files/patch-src_lib_fte_x11_c
@@ -0,0 +1,67 @@
+--- src/lib/fte/x11.c.orig Thu Jul 17 10:55:00 2003
++++ src/lib/fte/x11.c Thu Jul 17 11:39:05 2003
+@@ -120,7 +120,10 @@
+ /* "invert" works better than "xor" for B&W */
+
+ /* xor gc should be a function of the pixels that are written on */
+- gcvalues.function = GXxor;
++ /* gcvalues.function = GXxor; */
++ /* this patch makes lines visible on true color displays
++ Guenther Roehrich 22-Jan-99 */
++ gcvalues.function = GXinvert;
+ gcvalues.line_width = 1;
+ gcvalues.foreground = 1;
+ gcvalues.background = 0;
+@@ -302,7 +305,7 @@
+ return (0);
+ }
+
+-static
++/* PN static */
+ initlinestyles()
+ {
+
+@@ -318,7 +321,7 @@
+ return;
+ }
+
+-static
++/* PN static */
+ initcolors(graph)
+ GRAPH *graph;
+ {
+@@ -805,11 +808,13 @@
+ {
+
+ GRAPH *graph = (GRAPH *) client_data;
++ Widget w;
+
+ /* Iplots are done asynchronously */
+ DEVDEP(graph).isopen = 0;
++ w = DEVDEP(graph).shell;
+ DestroyGraph(graph->graphid);
+- XtDestroyWidget(DEVDEP(graph).shell);
++ XtDestroyWidget(w);
+
+ }
+
+@@ -945,7 +950,8 @@
+ 1 << ConnectionNumber(display);
+
+ /* block on ConnectionNumber and request->fp */
+- select(nfds + 1, &readfds, (int *) NULL, (int *) NULL, NULL);
++ /* PN added fd_set * casting */
++ select(nfds + 1, (fd_set *) &readfds, (fd_set *) NULL, (fd_set *) NULL, NULL);
+
+ /* handle X events first */
+ if (readfds & (1 << ConnectionNumber(display))) {
+@@ -998,7 +1004,8 @@
+
+ }
+
+-static X_ScreentoData(graph, x, y, fx, fy)
++/* PN static */
++X_ScreentoData(graph, x, y, fx, fy)
+ GRAPH *graph;
+ int x,y;
+ double *fx, *fy;
diff --git a/cad/spice/files/patch-ao b/cad/spice/files/patch-src_lib_hlp_readhelp_c
index 449ae1e496a2..449ae1e496a2 100644
--- a/cad/spice/files/patch-ao
+++ b/cad/spice/files/patch-src_lib_hlp_readhelp_c
diff --git a/cad/spice/files/patch-src_lib_inp_inpfindl_c b/cad/spice/files/patch-src_lib_inp_inpfindl_c
new file mode 100644
index 000000000000..c7d55cb9da97
--- /dev/null
+++ b/cad/spice/files/patch-src_lib_inp_inpfindl_c
@@ -0,0 +1,107 @@
+--- src/lib/inp/inpfindl.c.orig Mon Apr 8 23:41:39 1991
++++ src/lib/inp/inpfindl.c Thu Jul 17 02:45:08 2003
+@@ -1,11 +1,13 @@
+ /**********
+ Copyright 1990 Regents of the University of California. All rights reserved.
+ Author: 1985 Thomas L. Quarles
++Modified: 1999 Paolo Nenzi - Now we can use a two digits level code -
+ **********/
+
+- /* INPfindLev(line)
++ /* INPfindLev(line,level)
+ * find the 'level' parameter on the given line and return its
+- * value (1,2,or 3 for now, 1 default)
++ * value (1,2,..,99 for now, 1 default)
++ * NOTE: now limited to 9 for compatibility
+ */
+
+ #include "spice.h"
+@@ -24,58 +26,41 @@
+ char *where;
+
+ where = line;
+-
+- while(1) {
+- where = index(where,'l');
+- if(where == 0) { /* no 'l' in the line => no 'level' => default */
+- *level = 1;
+- return((char *)NULL);
+- }
+- if(strncmp(where,"level",5)!=0) { /* this l isn't in the word
+- * 'level', so lets try again */
+- where++; /* make sure we don't match same char again */
+- continue;
+- }
+- /* found the word level, lets look at the rest of the line */
+- where += 5;
++
++ where=strstr(line, "level");
++
++ if (where!=NULL) { /* found a level keyword on the line */
++
++ where += 5; /* skip the level keyword */
+ while( (*where == ' ') || (*where == '\t') || (*where == '=') ||
+ (*where == ',') || (*where == '(') || (*where == ')') ||
+ (*where == '+') ) { /* legal white space - ignore */
+- where++;
++ where++;
+ }
++
+ /* now the magic number */
+- switch(*where) {
+- case '1':
++ sscanf(where,"%2d",level); /* We get the level number */
++ if (*level<0) {
++ *level=1;
++ return(INPmkTemp(" illegal (negative) argument to level parameter - level=1 assumed"));
++ }
++
++ if (*level>9) { /* Limit to change in the future */
+ *level=1;
++ return(INPmkTemp(" illegal (too high) argument to level parameter - level=1 assumed"));
++ }
++
+ return((char *)NULL);
+- case '2':
+- *level=2;
+- return((char *)NULL);
+- case '3':
+- *level=3;
+- return((char *)NULL);
+- case '4':
+- *level=4;
+- return((char *)NULL);
+- case '5':
+- *level=5;
+- return((char *)NULL);
+- case '6':
+- *level=6;
+- return((char *)NULL);
+- case '7':
+- *level=7;
+- return((char *)NULL);
+- case '8':
+- *level=8;
+- return((char *)NULL);
+- case '9':
+- *level=9;
+- return((char *)NULL);
+- default:
+- *level=1;
+- return(INPmkTemp(
+- " illegal argument to level parameter - level=1 assumed"));
+- }
+- }
++ }
++
++
++
++ else { /* no level on the line => default */
++ *level = 1;
++ return((char *)NULL);
++ }
++
++
++
++
+ }
diff --git a/cad/spice/files/patch-util_build b/cad/spice/files/patch-util_build
new file mode 100644
index 000000000000..de7b2dd1c6e3
--- /dev/null
+++ b/cad/spice/files/patch-util_build
@@ -0,0 +1,11 @@
+--- util/build.orig Thu Jul 29 03:46:39 1993
++++ util/build Thu Jul 17 00:47:50 2003
+@@ -96,7 +96,7 @@
+
+ TMP_LEADER="${TMP_DIR}/buildl$$"
+ TMP_TRAILER="${TMP_DIR}/buildt$$"
+-trap 'rm -f ${TMP_LEADER} ${TMP_TRAILER}; exit 1' 1 2 3 4 6 7 8 9 10 12 13 14 15
++trap 'rm -f ${TMP_LEADER} ${TMP_TRAILER}; exit 1' 1 2 3 4 6 7 8 10 12 13 14 15
+ echo > "${TMP_TRAILER}"
+ BAD=false
+ DEBUG=
diff --git a/cad/spice/files/patch-util_skeleton_make_def_bd b/cad/spice/files/patch-util_skeleton_make_def_bd
new file mode 100644
index 000000000000..aa0f36710f81
--- /dev/null
+++ b/cad/spice/files/patch-util_skeleton_make_def_bd
@@ -0,0 +1,11 @@
+--- util/skeleton/make_def.bd.orig Thu Jul 29 16:35:18 1993
++++ util/skeleton/make_def.bd Thu Jul 17 00:47:51 2003
+@@ -8,7 +8,7 @@
+ PATH_SEP = /
+ PS = /
+ REVISION =
+-VERSION = 3f4
++VERSION = 3f5
+ VERSION_REVISION= $(VERSION)$(REVISION)
+ NOTICE =
+ TOP = /projects/spice3/spice$(VERSION)
diff --git a/cad/spice/pkg-plist b/cad/spice/pkg-plist
index 19338084d691..559369e7394c 100644
--- a/cad/spice/pkg-plist
+++ b/cad/spice/pkg-plist
@@ -4,33 +4,34 @@ bin/sconvert
bin/help
bin/proc2mod
bin/multidec
-%%PORTDOCS%%share/examples/spice3/bjtnoise.cir
-%%PORTDOCS%%share/examples/spice3/bsim1tst.cir
-%%PORTDOCS%%share/examples/spice3/bsim2tst.cir
-%%PORTDOCS%%share/examples/spice3/diffpair.cir
-%%PORTDOCS%%share/examples/spice3/diodisto.cir
-%%PORTDOCS%%share/examples/spice3/ltra_1.cir
-%%PORTDOCS%%share/examples/spice3/ltra_2.cir
-%%PORTDOCS%%share/examples/spice3/ltra_3.cir
-%%PORTDOCS%%share/examples/spice3/mixdisto.cir
-%%PORTDOCS%%share/examples/spice3/mos6inv.cir
-%%PORTDOCS%%share/examples/spice3/mosamp2.cir
-%%PORTDOCS%%share/examples/spice3/mosmem.cir
-%%PORTDOCS%%share/examples/spice3/pz2.cir
-%%PORTDOCS%%share/examples/spice3/pzt.cir
-%%PORTDOCS%%share/examples/spice3/rc.cir
-%%PORTDOCS%%share/examples/spice3/rca3040.cir
-%%PORTDOCS%%share/examples/spice3/resnoise.cir
-%%PORTDOCS%%share/examples/spice3/rtlinv.cir
-%%PORTDOCS%%share/examples/spice3/schmitt.cir
-%%PORTDOCS%%share/examples/spice3/simplepz.cir
-share/spice3/helpdir/spice.txt
-share/spice3/helpdir/spice.idx
-share/spice3/scripts/setplot
-share/spice3/scripts/spinit
-share/spice3/mfbcap
-share/spice3/news
-%%PORTDOCS%%@dirrm share/examples/spice3
-@dirrm share/spice3/helpdir
-@dirrm share/spice3/scripts
-@dirrm share/spice3
+share/spice/helpdir/spice.txt
+share/spice/helpdir/spice.idx
+share/spice/scripts/setplot
+share/spice/scripts/spinit
+share/spice/mfbcap
+share/spice/news
+@dirrm share/spice/helpdir
+@dirrm share/spice/scripts
+@dirrm share/spice
+%%PORTDOCS%%%%DOCSDIR%%/spice3f3.ps.gz
+%%PORTDOCS%%%%EXAMPLESDIR%%/bjtnoise.cir
+%%PORTDOCS%%%%EXAMPLESDIR%%/bsim1tst.cir
+%%PORTDOCS%%%%EXAMPLESDIR%%/bsim2tst.cir
+%%PORTDOCS%%%%EXAMPLESDIR%%/diffpair.cir
+%%PORTDOCS%%%%EXAMPLESDIR%%/diodisto.cir
+%%PORTDOCS%%%%EXAMPLESDIR%%/ltra_1.cir
+%%PORTDOCS%%%%EXAMPLESDIR%%/ltra_2.cir
+%%PORTDOCS%%%%EXAMPLESDIR%%/ltra_3.cir
+%%PORTDOCS%%%%EXAMPLESDIR%%/mixdisto.cir
+%%PORTDOCS%%%%EXAMPLESDIR%%/mos6inv.cir
+%%PORTDOCS%%%%EXAMPLESDIR%%/mosamp2.cir
+%%PORTDOCS%%%%EXAMPLESDIR%%/mosmem.cir
+%%PORTDOCS%%%%EXAMPLESDIR%%/pz2.cir
+%%PORTDOCS%%%%EXAMPLESDIR%%/pzt.cir
+%%PORTDOCS%%%%EXAMPLESDIR%%/rc.cir
+%%PORTDOCS%%%%EXAMPLESDIR%%/rca3040.cir
+%%PORTDOCS%%%%EXAMPLESDIR%%/resnoise.cir
+%%PORTDOCS%%%%EXAMPLESDIR%%/rtlinv.cir
+%%PORTDOCS%%%%EXAMPLESDIR%%/schmitt.cir
+%%PORTDOCS%%%%EXAMPLESDIR%%/simplepz.cir
+%%PORTDOCS%%@dirrm share/examples/spice