diff options
author | Pav Lucistnik <pav@FreeBSD.org> | 2003-11-21 22:32:47 +0000 |
---|---|---|
committer | Pav Lucistnik <pav@FreeBSD.org> | 2003-11-21 22:32:47 +0000 |
commit | 7330bcc8bf921ac6b68d3cdc19673893cb810bbf (patch) | |
tree | 2b2bd01b4a91b0202428eaa5a46c2c78a67d8595 | |
parent | - Update checksum again, seems author removes .ps version of documentation (diff) |
- Don't link with randline
PR: ports/58238
Submitted by: AMAKAWA Shuhei <sa264@cam.ac.uk> (maintainer)
Approved by: adamw (mentor)
Notes
Notes:
svn path=/head/; revision=94674
-rw-r--r-- | cad/cider/Makefile | 3 | ||||
-rw-r--r-- | cad/cider/files/FreeBSD | 4 | ||||
-rw-r--r-- | cad/cider/files/patch-ad | 184 | ||||
-rw-r--r-- | cad/cider/files/patch-ae | 81 | ||||
-rw-r--r-- | cad/cider/files/patch-af | 36 | ||||
-rw-r--r-- | cad/cider/files/patch-ag | 23 | ||||
-rw-r--r-- | cad/cider/files/patch-ah | 20 | ||||
-rw-r--r-- | cad/cider/files/patch-ai | 20 | ||||
-rw-r--r-- | cad/cider/files/patch-bc | 184 |
9 files changed, 16 insertions, 539 deletions
diff --git a/cad/cider/Makefile b/cad/cider/Makefile index 2a51f59b425d..f08f3b131c73 100644 --- a/cad/cider/Makefile +++ b/cad/cider/Makefile @@ -7,7 +7,7 @@ PORTNAME= cider PORTVERSION= 1.b1 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= cad MASTER_SITES= ftp://ic.eecs.berkeley.edu/pub/Cider/new/ DISTNAME= cider1b1 @@ -15,6 +15,7 @@ DISTNAME= cider1b1 MAINTAINER= amakawa@jp.FreeBSD.org COMMENT= A mixed-level circuit and device simulator (includes SPICE3) +CONFLICTS= spice-* WRKSRC= ${WRKDIR}/sim USE_XLIB= yes MAN1= sconvert.1 nutmeg.1 spice.1 cider.1 diff --git a/cad/cider/files/FreeBSD b/cad/cider/files/FreeBSD index f23cb4143148..a0906fa3d811 100644 --- a/cad/cider/files/FreeBSD +++ b/cad/cider/files/FreeBSD @@ -5,6 +5,6 @@ INTERFACE_OPTS = -DWANT_X11 CC_OPT = $(CFLAGS) #CC_OPT_SAFE = $(CFLAGS) -fno-strength-reduce X_DIR = $(X11BASE) -LDFLAGS = -L$(X11BASE)/lib -lreadline -lm -ltermcap +LDFLAGS = -L$(X11BASE)/lib -lm -ltermcap ASM_HACK = < /dev/null -SYS_CFLAGS = -Dbsd -DHAS_GNUREADLINE +SYS_CFLAGS = -Dbsd diff --git a/cad/cider/files/patch-ad b/cad/cider/files/patch-ad index 2762c1e16cd7..b6f5736836b9 100644 --- a/cad/cider/files/patch-ad +++ b/cad/cider/files/patch-ad @@ -1,20 +1,6 @@ --- spice/common/src/bin/main.c.orig Sat Mar 12 08:22:28 1994 -+++ spice/common/src/bin/main.c Wed Sep 19 11:06:34 2001 -@@ -25,6 +25,13 @@ - #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,6 +43,11 @@ ++++ spice/common/src/bin/main.c Fri Oct 17 22:11:28 2003 +@@ -36,6 +36,11 @@ #endif #include "patchlev.h" @@ -26,172 +12,14 @@ #include "suffix.h" /* (Virtual) Machine architecture parameters */ -@@ -53,6 +65,11 @@ - bool ft_intrpt = false; /* Set by the (void) signal handlers. */ - bool ft_setflag = false; /* Don't abort after an interrupt. */ +@@ -214,6 +219,10 @@ + FILE *fp; + FILE *circuit_file; -+#ifdef HAS_GNUREADLINE -+char gnu_history_file[512]; -+static char *application_name; +#endif + - struct variable *(*if_getparam)( ); - - #ifdef BATCH -@@ -185,6 +202,95 @@ - - #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]; -+ int n = sizeof(pbuf); -+ 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 && (n > 1)) { -+ int w; -+ switch (strip(*s)) { -+ case '!': -+ w = snprintf(p, n, "%d", where_history() + 1); -+ w = (w >= n) ? n - 1 : w; -+ p += w; -+ n -= w; -+ break; -+ case '\\': -+ if (*(s + 1)) ++s; -+ default: -+ *p = strip(*s); ++p; -+ --n; -+ 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); -+ else if (line == NULL) cp_evloop("quit"); -+ } -+ /* History gets written in ../fte/misccoms.c com_quit */ -+} -+#endif /* HAS_GNUREADLINE */ -+ - char *hlp_filelist[] = { "spice", 0 }; - - void -@@ -216,6 +322,10 @@ - - #endif - +#ifdef __FreeBSD__ + fpsetmask(fpgetmask() & ~FP_X_INV & ~FP_X_DZ & ~FP_X_OFL); -+#endif -+ - /* MFB tends to jump to 0 on errors. This tends to catch it. */ - if (started) { - fprintf(cp_err, "main: Internal Error: jump to zero\n"); -@@ -236,6 +346,13 @@ - ARCHsize = 1; - #endif /* PARALLEL_ARCH */ - -+#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 -@@ -472,7 +589,11 @@ - # 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); -@@ -668,7 +789,11 @@ - } 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 */ -@@ -708,7 +833,11 @@ - /* 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 + /* MFB tends to jump to 0 on errors. This tends to catch it. */ diff --git a/cad/cider/files/patch-ae b/cad/cider/files/patch-ae deleted file mode 100644 index 7969e0cf8ca9..000000000000 --- a/cad/cider/files/patch-ae +++ /dev/null @@ -1,81 +0,0 @@ -*** spice/common/src/lib/cp/history.c.orig Sat Jan 29 18:44:09 1994 ---- spice/common/src/lib/cp/history.c Sun Dec 12 14:56:43 1999 -*************** -*** 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/cider/files/patch-af b/cad/cider/files/patch-af deleted file mode 100644 index 6f736feab5cb..000000000000 --- a/cad/cider/files/patch-af +++ /dev/null @@ -1,36 +0,0 @@ -*** spice/common/src/lib/fte/misccoms.c.orig Wed Mar 9 04:15:44 1994 ---- spice/common/src/lib/fte/misccoms.c Sun Dec 12 14:56:44 1999 -*************** -*** 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/cider/files/patch-ag b/cad/cider/files/patch-ag deleted file mode 100644 index 9dfb4b374c0e..000000000000 --- a/cad/cider/files/patch-ag +++ /dev/null @@ -1,23 +0,0 @@ -*** spice/common/src/lib/fte/signal.c.orig Sat Jan 29 18:48:38 1994 ---- spice/common/src/lib/fte/signal.c Sun Dec 12 14:56:46 1999 -*************** -*** 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/cider/files/patch-ah b/cad/cider/files/patch-ah deleted file mode 100644 index ae6d04ea0d57..000000000000 --- a/cad/cider/files/patch-ah +++ /dev/null @@ -1,20 +0,0 @@ -*** spice/common/src/lib/fte/x10.c.orig Sat Jan 29 18:47:11 1994 ---- spice/common/src/lib/fte/x10.c Sun Dec 12 14:56:48 1999 -*************** -*** 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/cider/files/patch-ai b/cad/cider/files/patch-ai deleted file mode 100644 index d763d5e78951..000000000000 --- a/cad/cider/files/patch-ai +++ /dev/null @@ -1,20 +0,0 @@ -*** spice/common/src/lib/fte/x11.c.orig Sat Jan 29 18:48:34 1994 ---- spice/common/src/lib/fte/x11.c Sun Dec 12 14:56:50 1999 -*************** -*** 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/cider/files/patch-bc b/cad/cider/files/patch-bc index fa587adfce07..d860044fff49 100644 --- a/cad/cider/files/patch-bc +++ b/cad/cider/files/patch-bc @@ -1,20 +1,6 @@ --- cider/common/src/bin/main.c.orig Sat Mar 12 08:20:59 1994 -+++ cider/common/src/bin/main.c Wed Sep 19 11:07:47 2001 -@@ -25,6 +25,13 @@ - #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,6 +43,11 @@ ++++ cider/common/src/bin/main.c Fri Oct 17 22:19:55 2003 +@@ -36,6 +36,11 @@ #endif #include "patchlev.h" @@ -26,172 +12,14 @@ #include "suffix.h" /* (Virtual) Machine architecture parameters */ -@@ -53,6 +65,11 @@ - bool ft_intrpt = false; /* Set by the (void) signal handlers. */ - bool ft_setflag = false; /* Don't abort after an interrupt. */ +@@ -214,6 +219,10 @@ + FILE *fp; + FILE *circuit_file; -+#ifdef HAS_GNUREADLINE -+char gnu_history_file[512]; -+static char *application_name; +#endif + - struct variable *(*if_getparam)( ); - - #ifdef BATCH -@@ -185,6 +202,95 @@ - - #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]; -+ int n = sizeof(pbuf); -+ 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 && (n > 1)) { -+ int w; -+ switch (strip(*s)) { -+ case '!': -+ w = snprintf(p, n, "%d", where_history() + 1); -+ w = (w >= n) ? n - 1 : w; -+ p += w; -+ n -= w; -+ break; -+ case '\\': -+ if (*(s + 1)) ++s; -+ default: -+ *p = strip(*s); ++p; -+ --n; -+ 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); -+ else if (line == NULL) cp_evloop("quit"); -+ } -+ /* History gets written in ../fte/misccoms.c com_quit */ -+} -+#endif /* HAS_GNUREADLINE */ -+ - char *hlp_filelist[] = { "spice", "cider", 0 }; - - void -@@ -216,6 +322,10 @@ - - #endif - +#ifdef __FreeBSD__ + fpsetmask(fpgetmask() & ~FP_X_INV & ~FP_X_DZ & ~FP_X_OFL); -+#endif -+ - /* MFB tends to jump to 0 on errors. This tends to catch it. */ - if (started) { - fprintf(cp_err, "main: Internal Error: jump to zero\n"); -@@ -236,6 +346,13 @@ - ARCHsize = 1; - #endif /* PARALLEL_ARCH */ - -+#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 -@@ -472,7 +589,11 @@ - # 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); -@@ -668,7 +789,11 @@ - } 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 */ -@@ -708,7 +833,11 @@ - /* 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 + /* MFB tends to jump to 0 on errors. This tends to catch it. */ |