From 0c2ff31d0b20c082bc1ddd0ba7e21ed90d4a7cc4 Mon Sep 17 00:00:00 2001 From: pnenzi Date: Thu, 17 Mar 2005 21:22:33 +0000 Subject: [PATCH] Applied a set of patches from Steven Borley. See changelog for details. --- ChangeLog | 29 +++++++++++++++++++ configure.in | 30 ++++++++++++-------- src/frontend/aspice.c | 2 +- src/main.c | 9 ++---- src/ngspice.idx | Bin 13464 -> 13464 bytes src/ngspice.txt | 43 +++++++++++++++-------------- src/spicelib/devices/bsim3/b3set.c | 4 +++ tests/bin/check.sh | 9 ++++-- 8 files changed, 85 insertions(+), 41 deletions(-) diff --git a/ChangeLog b/ChangeLog index f7ec1474e..fb5e6b6b6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,32 @@ +2005-03-17 Paolo Nenzi + + * src/main.c: Applied patch sent by Steven Borley + that removed the duplicate + declaration application_name and gnu_history_file, removed the + "static" keyword in shutdown() and set NULL as return value in + function prompt() when non prompt is passed to readline(). + + * src/ngspice.txt: Applied patch sent by Steven Borley + that fixed a few arrors that + corrputed text output. + + * configure.in: Applied patch sent by Steven Borley + that fixes compiler warnings + on MAC OSX (related to the linking order of X libraries). The + remaining changes fix errors in spelling. + + * tests/bin/check.sh: Applied patch sent by Steven Borley + that added support for Mac OSX + and a default case for not (yet) supported architectures. + + * src/frontend/aspice.c: Applied patch sent by Steven Borley + that fixedscompiler warning on + Mac OSX in definition of "status". + + * src/spicelib/devices/bsim3/b3set.c: Applied patch sent by Steven + Borley that remove the compiler + warnings about ambiguos "else". + 2005-03-13 Paolo Nenzi * tests/bin/check.sh: Changed the previous check script with the one diff --git a/configure.in b/configure.in index c6dc2d0b4..48126544c 100644 --- a/configure.in +++ b/configure.in @@ -109,7 +109,7 @@ dnl --enable-experimental : define EXPERIMENTAL_CODE for the code AC_ARG_ENABLE(experimental, [ --enable-experimental Enable some experimental code]) -dnl --enable-expdevices : Enable the compilation of experimental deviced +dnl --enable-expdevices : Enable the compilation of experimental devices AC_ARG_ENABLE(expdevices, [ --enable-expdevices Enable experimental devices (they do not compile)]) @@ -119,11 +119,11 @@ AC_ARG_ENABLE(ekv, dnl --enable-xspice: define XSPICE in the code. This is for xspice support AC_ARG_ENABLE(xspice, - [ --enable-xspice Enable XSpice enchancements, (experimental) ]) + [ --enable-xspice Enable XSpice enhancements, (experimental) ]) dnl --enable-cider: define CIDER in the code. This is for CIDER support AC_ARG_ENABLE(cider, - [ --enable-cider Enable CIDER enchancements, (experimental) ]) + [ --enable-cider Enable CIDER enhancements, (experimental) ]) dnl --enable-cluster: define CLUSTER in the code. This is for cluster support AC_ARG_ENABLE(cluster, @@ -199,7 +199,7 @@ dnl CFLAGS="$CFLAGS -Werror" fi -dnl Chech system we're on , and tune accordingly +dnl Check system we're on , and tune accordingly AC_CANONICAL_HOST @@ -239,13 +239,21 @@ dnl tests and compile without X11 support - otherwise, check if the following dnl libraries are present (error if they are not) dnl In CYGWIN library ordering has to be changed. Is this compatible to LINUX? dnl XShmAttach is a struct in CYGWIN, not a function +dnl SJB: 13th march 2005 +dnl Library order is giving linker warnings on MacOSX +dnl It's not clear to me which order is required for Cygwin (see comment above) +dnl and neither can I find any authoritative answer for the correct link order +dnl for MacOSX or Linux, but +dnl -lXaw -lXmu -lXt -lXext -lX11 +dnl seems to be the popular choice. +dnl (The previous order was -lX11 -lXt -lXext -lXmu -lXaw) if test ! "$no_x" = "yes" ; then - X_LIBS="$X_LIBS -lX11 -lXt" - AC_CHECK_LIB(Xext, XShmAttach,X_LIBS="$X_LIBS -lXext",AC_MSG_ERROR(Couldn't find Xext librairies), $X_LIBS $X_EXTRA_LIBS) - AC_CHECK_LIB(Xmu,main,X_LIBS="$X_LIBS -lXmu",AC_MSG_ERROR(Couldn't find Xmu librairies), $X_LIBS $X_EXTRA_LIBS) - AC_CHECK_LIB(Xaw,main,X_LIBS="$X_LIBS -lXaw",AC_MSG_ERROR(Couldn't find Xaw librairies),$X_LIBS $X_EXTRA_LIBS) - + AC_CHECK_LIB(Xaw,main,X_LIBS="$X_LIBS -lXaw",AC_MSG_ERROR(Couldn't find Xaw library),$X_LIBS $X_EXTRA_LIBS) + AC_CHECK_LIB(Xmu,main,X_LIBS="$X_LIBS -lXmu",AC_MSG_ERROR(Couldn't find Xmu library), $X_LIBS $X_EXTRA_LIBS) + X_LIBS="$X_LIBS -lXt" + AC_CHECK_LIB(Xext, XShmAttach,X_LIBS="$X_LIBS -lXext",AC_MSG_ERROR(Couldn't find Xext library), $X_LIBS $X_EXTRA_LIBS) + X_LIBS="$X_LIBS -lX11" fi ;; @@ -267,7 +275,7 @@ AC_CHECK_HEADERS(ctype.h unistd.h pwd.h fcntl.h string.h) AC_HEADER_SYS_WAIT AC_HEADER_STAT -dnl Check time and ressources headers and functions: +dnl Check time and resources headers and functions: AC_HEADER_TIME AC_STRUCT_TM AC_STRUCT_TIMEZONE @@ -499,7 +507,7 @@ AC_SUBST(XSPICELIB2) AC_SUBST(XSPICETESTS) AC_SUBST(XSPICEINIT) -dnl Add CIDER enhacements to ngspice. +dnl Add CIDER enhancements to ngspice. if test "$enable_cider" = "yes"; then AC_MSG_RESULT(CIDER features enabled) AC_DEFINE(CIDER) diff --git a/src/frontend/aspice.c b/src/frontend/aspice.c index 8a4d269dc..1a8083321 100644 --- a/src/frontend/aspice.c +++ b/src/frontend/aspice.c @@ -178,7 +178,7 @@ sigchild(void) #if defined(__NetBSD__) || defined(SOLARIS) pid_t status; -#elif defined(__FreeBSD__) +#elif defined(__FreeBSD__) || defined(__APPLE__) int status; #else union wait status; diff --git a/src/main.c b/src/main.c index 129e20ca8..0e9ee9489 100644 --- a/src/main.c +++ b/src/main.c @@ -75,11 +75,6 @@ bool ft_intrpt = FALSE; /* Set by the (void) signal handlers. TRUE = we've b bool ft_setflag = FALSE; /* TRUE = Don't abort simulation after an interrupt. */ char *ft_rawfile = "rawspice.raw"; -#ifdef HAVE_GNUREADLINE -char gnu_history_file[512]; -static char *application_name; -#endif - bool oflag = FALSE; /* Output über redefinierte Funktionen */ FILE *flogp; // hvogt 15.12.2001 @@ -323,7 +318,7 @@ int SIMinit(IFfrontEnd *frontEnd, IFsimulator **simulator) /* -------------------------------------------------------------------------- */ /* Shutdown gracefully. */ -int +static int shutdown(int exitval) { cleanvars(); @@ -348,7 +343,7 @@ prompt() char *p = pbuf, *s; if (cp_interactive == FALSE) - return; + return NULL; /* NULL means no prompt */ if (cp_promptstring == NULL) s = "-> "; else diff --git a/src/ngspice.idx b/src/ngspice.idx index 6cda8a5f93aa5a0d22140da056c5a64132aa5e99..0d02a610d9a70f19cfb7580111fa077d0fe539bc 100644 GIT binary patch delta 632 zcmYL{OK1~O6o${8nPf8Rq(tq)Y>ba|64ThGjWs2Nnz>0!im|OpYpCrarZJ4vOh{6K zh@dU*6sgBW6(e@ zFxEmz1~0Wx`EF5!;c^Yh-k1!TH@$avgX1D0ztE zOexO$sJwnogoN3^ye~%Xpx;kP1J5#jgb(~I)wBqGX5HjD1h|FW2Pk=s7nsiAQ>G`- z7NBzXGZFORKHRgtZPw!?`|xUjI*)u3AwD>mJeEl1JaKd>U20-Y1Zq?ZQ%2nrVwJf-VNn++5w0!adWTLT81JNt_S44yMtKqk f+)??XV26>-et}bv1O`P%{uoJWEN9C zM%>u+F~ul}FjA=_*_IN%PU0#*C1uR|8M%oqKU1To2xBK|g(}W%Ns=M-1Q@B|ajpW+ z1(@>itO#lI3>E?@GKs+;BXK;<^&H*{@>ER``pt%EzN32q#w7sJ6m2Cna7JA%tbzmpyzVEhtiobua0eMT$8_vz>HdP%4m3_ys}qd-*G%d z$s%42F-=+eZ^tZKyG*2&fj#zs!-XfqR0zBAPMDJC_&Lm!{Q(K+K;Fu@8sL72({Lsm zwKMmP;-lSE+tlQX3e`fZCqWkQN`wjNFZeD(of{V=80hP@6R7a|j|2zvhjr_|0<-I6$o4Lu zStDHY;io7izcJdyoTW0i%zC%gsKWFmo8lIUkb8BSIM3drainPerimeterGiven) here->BSIM3drainPerimeter = 0.0; if (!here->BSIM3drainSquaresGiven) + { if (model->BSIM3acmMod == 0) here->BSIM3drainSquares = 1.0; else here->BSIM3drainSquares = 0.0; + } if (!here->BSIM3icVBSGiven) here->BSIM3icVBS = 0.0; if (!here->BSIM3icVDSGiven) @@ -927,10 +929,12 @@ IFuid tmpName; if (!here->BSIM3sourcePerimeterGiven) here->BSIM3sourcePerimeter = 0.0; if (!here->BSIM3sourceSquaresGiven) + { if (model->BSIM3acmMod == 0) here->BSIM3sourceSquares = 1.0; else here->BSIM3sourceSquares = 0.0; + } if (!here->BSIM3wGiven) here->BSIM3w = 5.0e-6; if (!here->BSIM3nqsModGiven) diff --git a/tests/bin/check.sh b/tests/bin/check.sh index 060a34fc9..f1617d0ef 100644 --- a/tests/bin/check.sh +++ b/tests/bin/check.sh @@ -8,7 +8,7 @@ FILTER="Note|Circuit|Trying|Reference|Date|Doing|---|v-sweep|time|Error|Warning| testname=`basename $TEST .cir` testdir=`dirname $TEST` -HOST_TYPE=`/bin/uname -srvm` +HOST_TYPE=`uname -srvm` case $HOST_TYPE in MINGW32*) @@ -23,7 +23,7 @@ case $HOST_TYPE in sed -e 's/e-000/e+000/g' $testname.test | sed 's/e-0/e-/g' | sed 's/e+0/e+/g' > $testname.test_tmp mv $testname.test_tmp $testname.test ;; - Linux*) + Linux*|Darwin*) $SPICE --batch $testdir/$testname.cir >$testname.test &&\ egrep -v $FILTER $testname.test > $testname.test_tmp &&\ egrep -v $FILTER $testdir/$testname.out > $testname.out_tmp @@ -43,6 +43,11 @@ case $HOST_TYPE in fi rm -f $testname.test_tmp $testname.out_tmp ;; + *) + echo Unknown system type! + echo $HOST_TYPE + echo ./tests/bin/checks.sh may need updating for your system + ;; esac exit 1