diff options
author | is <is> | 2005-02-25 15:54:58 +0000 |
---|---|---|
committer | is <is> | 2005-02-25 15:54:58 +0000 |
commit | 6bd14e256e3b2dc8f2e705ae638d85ecbcb78cb0 (patch) | |
tree | d64a7ca23c0808be1e203863128a081aede8f89a | |
parent | 032739a8348c51db9f5093781085a8585ca32dc3 (diff) | |
download | pkgsrc-6bd14e256e3b2dc8f2e705ae638d85ecbcb78cb0.tar.gz |
This is the SR, a language for concurrent programming from the
University of Arizona, version 2.3.2.
SR is described in "The SR Programming Language: Concurrency in Practice"
by Gregory R. Andrews and Ronald A. Olsson (Benjamin/Cummings, 1993, ISBN
0-8053-0088-0).
-rw-r--r-- | lang/sr/DESCR | 7 | ||||
-rw-r--r-- | lang/sr/Makefile | 36 | ||||
-rw-r--r-- | lang/sr/PLIST | 61 | ||||
-rw-r--r-- | lang/sr/distinfo | 25 | ||||
-rw-r--r-- | lang/sr/patches/patch-aa | 63 | ||||
-rw-r--r-- | lang/sr/patches/patch-ab | 17 | ||||
-rw-r--r-- | lang/sr/patches/patch-ac | 13 | ||||
-rw-r--r-- | lang/sr/patches/patch-ad | 13 | ||||
-rw-r--r-- | lang/sr/patches/patch-ae | 12 | ||||
-rw-r--r-- | lang/sr/patches/patch-af | 59 | ||||
-rw-r--r-- | lang/sr/patches/patch-ag | 72 | ||||
-rw-r--r-- | lang/sr/patches/patch-ah | 62 | ||||
-rw-r--r-- | lang/sr/patches/patch-ai | 36 | ||||
-rw-r--r-- | lang/sr/patches/patch-aj | 96 | ||||
-rw-r--r-- | lang/sr/patches/patch-ak | 59 | ||||
-rw-r--r-- | lang/sr/patches/patch-al | 11 | ||||
-rw-r--r-- | lang/sr/patches/patch-am | 36 | ||||
-rw-r--r-- | lang/sr/patches/patch-an | 34 | ||||
-rw-r--r-- | lang/sr/patches/patch-ao | 13 | ||||
-rw-r--r-- | lang/sr/patches/patch-ap | 36 | ||||
-rw-r--r-- | lang/sr/patches/patch-aq | 13 | ||||
-rw-r--r-- | lang/sr/patches/patch-ar | 9 | ||||
-rw-r--r-- | lang/sr/patches/patch-as | 13 | ||||
-rw-r--r-- | lang/sr/patches/patch-at | 45 | ||||
-rw-r--r-- | lang/sr/patches/patch-au | 123 |
25 files changed, 964 insertions, 0 deletions
diff --git a/lang/sr/DESCR b/lang/sr/DESCR new file mode 100644 index 00000000000..2bea0ff9736 --- /dev/null +++ b/lang/sr/DESCR @@ -0,0 +1,7 @@ +This is the language SR, Version 2.3.2, from the University of Arizona. + +SR is described in "The SR Programming Language: Concurrency in Practice" +by Gregory R. Andrews and Ronald A. Olsson (Benjamin/Cummings, 1993, ISBN +0-8053-0088-0). Information about concurrent programming in general can be +found in "Concurrent Programming: Principles and Practice" by Gregory R. +Andrews (Benjamin/Cummings, 1991, ISBN 0-8053-0086-4). diff --git a/lang/sr/Makefile b/lang/sr/Makefile new file mode 100644 index 00000000000..b7bb1d9347b --- /dev/null +++ b/lang/sr/Makefile @@ -0,0 +1,36 @@ +# $NetBSD: Makefile,v 1.1.1.1 2005/02/25 15:54:59 is Exp $ +# + +DISTNAME= sr +PKGNAME= sr-2.3.2 +CATEGORIES= lang parallel +MASTER_SITES= ftp://ftp.cs.arizona.edu/sr/ +EXTRACT_SUFX= .tar.Z + +MAINTAINER= is@NetBSD.org +HOMEPAGE= http://www.cs.arizona.edu/sr/ +COMMENT= The SR language compiler and run time system + +WRKSRC= ${WRKDIR} + +ONLY_FOR_PLATFORM= NetBSD-[2-9]*-* + +USE_X11= yes +USE_BUILDLINK3= yes + +pre-configure: + ${MV} ${WRKSRC}/Configuration ${WRKSRC}/Configuration.template + ${SED} -e 's,_LOCALBASE_,${LOCALBASE},' \ + -e 's,_WRKSRC_,${WRKSRC},' \ + ${WRKSRC}/Configuration.template > ${WRKSRC}/Configuration + +pre-install: + -${MKDIR} ${LOCALBASE}/lib/sr + +post-install: + ${INSTALL_PROGRAM} ${WRKSRC}/csw/cstest ${PREFIX}/bin + ${INSTALL_DATA_DIR} ${PREFIX}/share/doc/sr + cd ${WRKSRC}/ps && \ + ${INSTALL_DATA} *.ps ${PREFIX}/share/doc/sr + +.include "../../mk/bsd.pkg.mk" diff --git a/lang/sr/PLIST b/lang/sr/PLIST new file mode 100644 index 00000000000..5f821ec14d5 --- /dev/null +++ b/lang/sr/PLIST @@ -0,0 +1,61 @@ +@comment $NetBSD: PLIST,v 1.1.1.1 2005/02/25 15:54:59 is Exp $ +bin/ccr2sr +bin/csp2sr +bin/cstest +bin/m2sr +bin/sr +bin/srgrind +bin/srl +bin/srlatex +bin/srm +bin/srprof +bin/srtex +lib/sr/SRWin.impl +lib/sr/SRWin.o +lib/sr/SRWin.spec +lib/sr/SRanimator.impl +lib/sr/SRanimator.o +lib/sr/SRanimator.spec +lib/sr/SRgetopt.impl +lib/sr/SRgetopt.o +lib/sr/SRgetopt.spec +lib/sr/ccr2sr.h +lib/sr/csp2sr.h +lib/sr/m2sr.h +lib/sr/sr-mode.el +lib/sr/sr.h +lib/sr/srlatex.sty +lib/sr/srlib.a +lib/sr/srmap +lib/sr/srmulti.h +lib/sr/srwin.o +lib/sr/srx +man/man1/ccr2sr.1 +man/man1/csp2sr.1 +man/man1/m2sr.1 +man/man1/sr.1 +man/man1/srgrind.1 +man/man1/srl.1 +man/man1/srlatex.1 +man/man1/srm.1 +man/man1/srprof.1 +man/man1/srtex.1 +man/man3/sranimator.3 +man/man3/srgetopt.3 +man/man3/srwin.3 +man/man5/srmap.5 +man/man5/srtrace.5 +share/doc/sr/impl.ps +share/doc/sr/install.ps +share/doc/sr/language.ps +share/doc/sr/manpages.ps +share/doc/sr/port.ps +share/doc/sr/rel_2_0.ps +share/doc/sr/rel_2_1.ps +share/doc/sr/rel_2_2.ps +share/doc/sr/release.ps +share/doc/sr/runtime.ps +share/doc/sr/sranimator.ps +share/doc/sr/srwin.ps +@dirrm share/doc/sr +@dirrm lib/sr diff --git a/lang/sr/distinfo b/lang/sr/distinfo new file mode 100644 index 00000000000..ee781e506e3 --- /dev/null +++ b/lang/sr/distinfo @@ -0,0 +1,25 @@ +$NetBSD: distinfo,v 1.1.1.1 2005/02/25 15:54:58 is Exp $ + +SHA1 (sr.tar.Z) = 76278a750d900f1d5f6b2fedaa21ad26f93fc72e +Size (sr.tar.Z) = 1453739 bytes +SHA1 (patch-aa) = 25100667c8a9a48d828253ecba12125d5a7a62aa +SHA1 (patch-ab) = 3d12695fe38cdc372352279738f593e74599c00d +SHA1 (patch-ac) = f412be8e1a2bbdf8249d5f1585805fab447a518a +SHA1 (patch-ad) = 7fc00d7f52a16dc7b814c94c795bb5d7af02e58b +SHA1 (patch-ae) = 7dadae84f42f16a9448c320fd36c424253fe5aca +SHA1 (patch-af) = e77f75e3d3e5baeb225ba1b3a1dd2b1d662ef16c +SHA1 (patch-ag) = 851c7156109d22e30a56f20b70211a016c585b06 +SHA1 (patch-ah) = 66c956161f7a0d1b61e7a887a6ab44d17b398f5e +SHA1 (patch-ai) = e635785b56e29b1a09ee2b1342b414ef50208fe6 +SHA1 (patch-aj) = 4e1939ce234f4b97748d170b1909e588f6dfc793 +SHA1 (patch-ak) = 9b5093037803782a4eb76362cb14fa6c6cd33630 +SHA1 (patch-al) = cd2928fd5a42d2aba1c103313a7849a52fb988fe +SHA1 (patch-am) = d5f53666744d8bb2c2fbca8cfe6abebb753367e1 +SHA1 (patch-an) = 7358faf62d8bd82f92bc650bf0a8deaeb7df16ac +SHA1 (patch-ao) = edb6eaa0d9e7f6adbc9749f0ac5589410a116855 +SHA1 (patch-ap) = c61cb7d239ad08317179fb85c7829736366556f3 +SHA1 (patch-aq) = 364d860fa9ff0019934a6cc43b70f93abffaba24 +SHA1 (patch-ar) = 9a331cdb90959d0cc7475d2fc203d2c302d4bf5c +SHA1 (patch-as) = 89914a0de054781e2830d70f870c5be2a9db8175 +SHA1 (patch-at) = e66f57026322ff22db9bd7be3dfbaccfb466ccc1 +SHA1 (patch-au) = 78201c528aeb97e6b59c98fb0bdaa63852ce6993 diff --git a/lang/sr/patches/patch-aa b/lang/sr/patches/patch-aa new file mode 100644 index 00000000000..0c54cabe6ea --- /dev/null +++ b/lang/sr/patches/patch-aa @@ -0,0 +1,63 @@ +$NetBSD: patch-aa,v 1.1.1.1 2005/02/25 15:54:59 is Exp $ + +--- Configuration.orig 1999-08-14 01:42:02.000000000 +0200 ++++ Configuration +@@ -26,13 +26,13 @@ VERSION = "SR version 2.3.2, August 1999 + # MAN5: directory in which to install the srmap/srtrace(5) man pages + # (extension will be `tr 1 5` of MANEXT) + +-SRSRC = /usr/local/src/sr +-SRCMD = /usr/local/bin +-SRLIB = /usr/local/lib/sr +-MAN1 = /usr/man/manl +-MAN3 = /usr/man/manl +-MAN5 = /usr/man/manl +-MANEXT = l ++SRSRC = _WRKSRC_ ++SRCMD = _LOCALBASE_/bin ++SRLIB = _LOCALBASE_/lib/sr ++MAN1 = _LOCALBASE_/man/man1 ++MAN3 = _LOCALBASE_/man/man3 ++MAN5 = _LOCALBASE_/man/man5 ++MANEXT = 1 + + + +@@ -54,8 +54,8 @@ MANEXT = l + # for Sun Solaris with Sun's C compiler use: CCPATH = /opt/SUNWspro/bin/cc + # for Linux, NetBSD, FreeBSD, or SGI Irix use: CCPATH = /usr/bin/cc + +-CCPATH = /bin/cc +-RSHPATH = /usr/ucb/rsh ++CCPATH = /usr/bin/cc ++RSHPATH = /usr/bin/ssh + + + +@@ -81,7 +81,7 @@ RSHPATH = /usr/ucb/rsh + # LIBC = , LIBR = , LIBM = -lm + + LIBC = +-LIBR = -L/usr/X11/lib ++LIBR = -L/usr/X11R6/lib + LIBM = -lm + + +@@ -98,7 +98,7 @@ LIBM = -lm + # for NetBSD, set XINCL = /usr/X386/include + # for Linux, set XINCL = /usr/X11/include + +-XINCL = /usr/include ++XINCL = /usr/X11R6/include + XTANGO = + + +@@ -107,7 +107,7 @@ XTANGO = + # + # Set these definitions empty if your system does not have vgrind. + +-VFPATH = /usr/lib/vfontedpr ++VFPATH = + VGMACS = + + diff --git a/lang/sr/patches/patch-ab b/lang/sr/patches/patch-ab new file mode 100644 index 00000000000..9f1bbb4e20c --- /dev/null +++ b/lang/sr/patches/patch-ab @@ -0,0 +1,17 @@ +$NetBSD: patch-ab,v 1.1.1.1 2005/02/25 15:54:59 is Exp $ + +--- arch.h.orig 1999-08-09 18:34:12.000000000 +0200 ++++ arch.h +@@ -7,6 +7,12 @@ + * BIGCC arguments passed to CC to enlarge tree space (if needed) + */ + ++ ++#if !defined(ARCH) && defined(__NetBSD__) ++#define ARCH "NetBSD 2.0 and later" ++#define SFILE "i386.s" ++#endif ++ + #ifndef ARCH + + #ifdef apollo diff --git a/lang/sr/patches/patch-ac b/lang/sr/patches/patch-ac new file mode 100644 index 00000000000..9ae04718684 --- /dev/null +++ b/lang/sr/patches/patch-ac @@ -0,0 +1,13 @@ +$NetBSD: patch-ac,v 1.1.1.1 2005/02/25 15:54:59 is Exp $ + +--- csw/asm.c.orig 1999-07-29 00:16:10.000000000 +0200 ++++ csw/asm.c +@@ -8,7 +8,7 @@ + + #include "../arch.h" + +-#if (defined(__linux__) && defined(__ELF__)) || defined(__svr4__) ++#if defined(__ELF__) || defined(__svr4__) + #define SR_BUILD_CONTEXT sr_build_context + #define SR_CHG_CONTEXT sr_chg_context + #define SR_CHECK_STK sr_check_stk diff --git a/lang/sr/patches/patch-ad b/lang/sr/patches/patch-ad new file mode 100644 index 00000000000..d40e89862b0 --- /dev/null +++ b/lang/sr/patches/patch-ad @@ -0,0 +1,13 @@ +$NetBSD: patch-ad,v 1.1.1.1 2005/02/25 15:54:59 is Exp $ + +--- doc/Makefile.orig 1999-07-28 22:42:21.000000000 +0200 ++++ doc/Makefile +@@ -6,7 +6,7 @@ + + MAKE = make + SHELL = /bin/sh +-ROFF = psroff -t ++ROFF = groff -Tps + + D = ../ps + diff --git a/lang/sr/patches/patch-ae b/lang/sr/patches/patch-ae new file mode 100644 index 00000000000..fbf9c52f7cd --- /dev/null +++ b/lang/sr/patches/patch-ae @@ -0,0 +1,12 @@ +$NetBSD: patch-ae,v 1.1.1.1 2005/02/25 15:54:59 is Exp $ + +--- rts/alloc.c.orig 1999-07-28 22:42:24.000000000 +0200 ++++ rts/alloc.c +@@ -5,7 +5,6 @@ + */ + + #include "rts.h" +-#include <varargs.h> + + static Memh all_mem; /* header blocks for SR allocated memory */ + static Mutex mem_mutex; /* protection for all_mem; acquired after res->rmutex.*/ diff --git a/lang/sr/patches/patch-af b/lang/sr/patches/patch-af new file mode 100644 index 00000000000..aab0869a99a --- /dev/null +++ b/lang/sr/patches/patch-af @@ -0,0 +1,59 @@ +$NetBSD: patch-af,v 1.1.1.1 2005/02/25 15:54:59 is Exp $ + +--- rts/array.c.orig 1999-07-28 23:08:48.000000000 +0200 ++++ rts/array.c +@@ -1,7 +1,7 @@ + /* array.c -- runtime support of arrays */ + + #include "rts.h" +-#include <varargs.h> ++#include <stdarg.h> + + + static void slices (); +@@ -22,11 +22,9 @@ static void slices (); + */ + /*VARARGS*/ + Array * +-sr_init_array (va_alist) +-va_dcl ++sr_init_array (char *locn, ...) + { + va_list ap; +- char *locn; + int ndim, elemsize, alcsize, i, n; + Array *addr; + Dim *d; +@@ -39,8 +37,7 @@ va_dcl + /* + * Calculate the size of each dimension. + */ +- va_start (ap); +- locn = va_arg (ap, char *); ++ va_start (ap, locn); + addr = va_arg (ap, Array *); + elemsize = va_arg (ap, int); + initvalue = va_arg (ap, Ptr); +@@ -251,11 +248,9 @@ struct slcinfo { + + /*VARARGS*/ + Ptr +-sr_slice (va_alist) +-va_dcl ++sr_slice (char *locn, ...) + { + va_list ap; +- char *locn; + Array *a1, *a2; + int elemsize, nbounds; + int adim, lb[MAX_DIMENS], ub[MAX_DIMENS]; /* array dims*/ +@@ -266,8 +261,7 @@ va_dcl + sr_check_stk (CUR_STACK); + + /* get fixed arguments */ +- va_start (ap); +- locn = va_arg (ap, char *); /* SR source code location */ ++ va_start (ap, locn); + a1 = va_arg (ap, Array *); /* contiguous array */ + a2 = va_arg (ap, Array *); /* sliced array */ + elemsize = va_arg (ap, int); /* array element size */ diff --git a/lang/sr/patches/patch-ag b/lang/sr/patches/patch-ag new file mode 100644 index 00000000000..72466f1f8bc --- /dev/null +++ b/lang/sr/patches/patch-ag @@ -0,0 +1,72 @@ +$NetBSD: patch-ag,v 1.1.1.1 2005/02/25 15:54:59 is Exp $ + +--- rts/funcs.h.orig 1999-07-28 22:42:24.000000000 +0200 ++++ rts/funcs.h +@@ -6,7 +6,7 @@ extern void sr_abort (); + extern char* sr_fmt_locn (); + extern void sr_malf (); + extern void sr_message (); +-extern int sr_runerr (); ++extern int sr_runerr (char *, ...); + extern void sr_net_abort (); + extern void sr_stk_corrupted (); + extern void sr_stk_overflow (); +@@ -30,8 +30,8 @@ extern Ptr sr_astring (); + extern Array* sr_aswap (); + extern String* sr_chgstr (); + extern Ptr sr_clone (); +-extern Array* sr_init_array (); +-extern Ptr sr_slice (); ++extern Array* sr_init_array (char *, ...); ++extern Ptr sr_slice (char *, ...); + extern Ptr sr_sslice (); + extern Array* sr_strarr (); + +@@ -97,8 +97,8 @@ extern int sr_get_string (); + extern int sr_inchar (); + extern void sr_init_io (); + extern File sr_open (); +-extern void sr_printf (); +-extern int sr_read (); ++extern void sr_printf (char *, ...); ++extern int sr_read (char *, ...); + extern Bool sr_remove (); + extern int sr_seek (); + extern int sr_where (); +@@ -111,14 +111,14 @@ extern void sr_reaccess (); + extern void sr_rm_iop (); + + /* math.c */ +-extern int sr_imax (); +-extern int sr_imin (); ++extern int sr_imax (int, ...); ++extern int sr_imin (int, ...); + extern int sr_imod (); + extern void sr_init_random (); + extern int sr_itoi (); + extern Real sr_random (); +-extern Real sr_rmax (); +-extern Real sr_rmin (); ++extern Real sr_rmax (int, ...); ++extern Real sr_rmin (int, ...); + extern Real sr_rmod (); + extern Real sr_round (); + extern Real sr_rtoi (); +@@ -134,7 +134,7 @@ extern int sr_arg_int (); + extern int sr_arg_ptr (); + extern int sr_arg_real (); + extern int sr_arg_string (); +-extern Ptr sr_cat (); ++extern Ptr sr_cat (String *, ...); + extern void sr_dispose (); + extern Ptr sr_gswap (); + extern void sr_init_misc (); +@@ -210,7 +210,7 @@ extern void sr_init_res (); + extern Ptr sr_literal_rcap (); + + /* scan.c */ +-extern int sr_scanf (); ++extern int sr_scanf (char *, ...); + + /* semaphore.c */ + extern void P (); diff --git a/lang/sr/patches/patch-ah b/lang/sr/patches/patch-ah new file mode 100644 index 00000000000..9f034dc81e9 --- /dev/null +++ b/lang/sr/patches/patch-ah @@ -0,0 +1,62 @@ +$NetBSD: patch-ah,v 1.1.1.1 2005/02/25 15:54:59 is Exp $ + +--- rts/io.c.orig 1999-07-29 00:16:12.000000000 +0200 ++++ rts/io.c +@@ -7,7 +7,7 @@ + */ + + #include <ctype.h> +-#include <varargs.h> ++#include <stdarg.h> + #include "rts.h" + + #define NOTHING /* for use as null macro arg under ANSI C */ +@@ -218,11 +218,9 @@ String *fname; + */ + /*VARARGS*/ + int +-sr_read (va_alist) +-va_dcl ++sr_read (char *locn, ...) + { + va_list ap; +- char *locn; + File fp; + char *argt; + Array *a; +@@ -238,8 +236,7 @@ va_dcl + double d; + + sr_check_stk (CUR_STACK); +- va_start (ap); +- locn = va_arg (ap, char *); ++ va_start (ap, locn); + + fp = va_arg (ap, File); + BEGIN_IO (fp); +@@ -442,8 +439,7 @@ int n; + */ + /*VARARGS*/ + void +-sr_printf (va_alist) +-va_dcl ++sr_printf (char *locn, ...) + { + va_list ap; + File fp; +@@ -451,14 +447,12 @@ va_dcl + double v; + char xbuf[20], fbuf[512], dbuf[512], obuf[512]; + int n; +- char *locn; + String *str, *sp; + int ssize; + Array *arr; + + sr_check_stk (CUR_STACK); +- va_start (ap); +- locn = va_arg (ap, char *); ++ va_start (ap, locn); + fp = va_arg (ap, File); + sp = va_arg (ap, String *); + diff --git a/lang/sr/patches/patch-ai b/lang/sr/patches/patch-ai new file mode 100644 index 00000000000..53c535b22b5 --- /dev/null +++ b/lang/sr/patches/patch-ai @@ -0,0 +1,36 @@ +$NetBSD: patch-ai,v 1.1.1.1 2005/02/25 15:54:59 is Exp $ + +--- rts/main.c.orig 1999-07-28 23:08:48.000000000 +0200 ++++ rts/main.c +@@ -16,7 +16,7 @@ extern local_message_type; /* message ty + #endif + + +-#include <varargs.h> ++#include <stdarg.h> + + #define RUNERR(s,n,m) {n, m}, + static struct err { +@@ -311,20 +311,17 @@ char *buf, *locn; + */ + /*VARARGS*/ + int +-sr_runerr (va_alist) +-va_dcl ++sr_runerr (char *locn, ...) + { + va_list ap; + char c, *f, *o; +- char *locn; + int errnum; + struct err *ep; + char buf[200]; + Dim *d; + String *s; + +- va_start (ap); +- locn = va_arg (ap, char *); ++ va_start (ap, locn); + errnum = va_arg (ap, int); + + diff --git a/lang/sr/patches/patch-aj b/lang/sr/patches/patch-aj new file mode 100644 index 00000000000..1cfd47284ee --- /dev/null +++ b/lang/sr/patches/patch-aj @@ -0,0 +1,96 @@ +$NetBSD: patch-aj,v 1.1.1.1 2005/02/25 15:54:59 is Exp $ + +--- rts/math.c.orig 1999-07-28 22:42:24.000000000 +0200 ++++ rts/math.c +@@ -1,6 +1,6 @@ + /* math.c -- runtime support of arithmetic and math builtins */ + +-#include <varargs.h> ++#include <stdarg.h> + #include "rts.h" + + +@@ -162,17 +162,15 @@ int x, y; + */ + /*VARARGS*/ + int +-sr_imax (va_alist) +-va_dcl ++sr_imax (int n, ...) + { + va_list ap; +- int n, r, v; ++ int r, v; + +- va_start (ap); +- n = va_arg (ap, int); + if (n <= 0) + sr_malf ("no args to sr_imax"); + ++ va_start (ap, n); + r = va_arg (ap, int); /* pick off the first one */ + n--; + +@@ -193,17 +191,15 @@ va_dcl + */ + /*VARARGS*/ + int +-sr_imin (va_alist) +-va_dcl ++sr_imin (int n, ...) + { + va_list ap; +- int n, r, v; ++ int r, v; + +- va_start (ap); +- n = va_arg (ap, int); + if (n <= 0) + sr_malf ("no args to sr_imin"); + ++ va_start (ap, n); + r = va_arg (ap, int); /* pick off the first one */ + n--; + +@@ -222,18 +218,15 @@ va_dcl + */ + /*VARARGS*/ + Real +-sr_rmax (va_alist) +-va_dcl ++sr_rmax (int n, ...) + { + va_list ap; +- int n; + Real r, v; + +- va_start (ap); +- n = va_arg (ap, int); + if (n <= 0) + sr_malf ("no args to sr_rmax"); + ++ va_start (ap, n); + r = va_arg (ap, Real); /* pick off the first one */ + n--; + +@@ -254,18 +247,15 @@ va_dcl + */ + /*VARARGS*/ + Real +-sr_rmin (va_alist) +-va_dcl ++sr_rmin (int n, ...) + { + va_list ap; +- int n; + Real r, v; + +- va_start (ap); +- n = va_arg (ap, int); + if (n <= 0) + sr_malf ("no args to sr_rmin"); + ++ va_start (ap, n); + r = va_arg (ap, Real); /* pick off the first one */ + n--; + diff --git a/lang/sr/patches/patch-ak b/lang/sr/patches/patch-ak new file mode 100644 index 00000000000..26f2e9f0fe1 --- /dev/null +++ b/lang/sr/patches/patch-ak @@ -0,0 +1,59 @@ +$NetBSD: patch-ak,v 1.1.1.1 2005/02/25 15:54:59 is Exp $ + +--- rts/misc.c.orig 1999-07-28 23:08:48.000000000 +0200 ++++ rts/misc.c +@@ -1,6 +1,6 @@ + /* misc.c -- miscellaneous routines supporting the generated code */ + +-#include <varargs.h> ++#include <stdarg.h> + #include "rts.h" + + +@@ -15,8 +15,7 @@ + */ + /*VARARGS*/ + Ptr +-sr_cat (va_alist) +-va_dcl ++sr_cat (String *q, ...) + { + va_list ap; + String *s, *t; +@@ -24,12 +23,15 @@ va_dcl + char *p; + + n = 0; /* total the string lengths */ +- va_start (ap); +- while ((s = va_arg (ap, String *)) != NULL) ++ s = q; ++ va_start (ap, q); ++ while (s != NULL) { + if ((int) s & 1) + n++; /* char argument */ + else + n += s->length; /* String argument */ ++ s = va_arg (ap, String *); ++ } + va_end (ap); + + t = (String *) sr_alc (n + STRING_OVH, 1); +@@ -37,14 +39,16 @@ va_dcl + t->length = n; + + p = DATA (t); +- va_start (ap); +- while ((s = va_arg (ap, String *)) != NULL) { /* for each input string: */ ++ va_start (ap, q); ++ s = q; ++ while (s != NULL) { /* for each input string: */ + if ((int) s & 1) { + *p++ = (int) s >> 2; /* copy in char argument */ + } else { + memcpy (p, DATA (s), s->length); /* copy into new string */ + p += s->length; /* advance pointer*/ + } ++ s = va_arg (ap, String *); + } + va_end (ap); + return (Ptr) t; /* return result address */ diff --git a/lang/sr/patches/patch-al b/lang/sr/patches/patch-al new file mode 100644 index 00000000000..111cb7cd4cf --- /dev/null +++ b/lang/sr/patches/patch-al @@ -0,0 +1,11 @@ +$NetBSD: patch-al,v 1.1.1.1 2005/02/25 15:54:59 is Exp $ + +--- rts/oper.c.orig 1999-08-03 02:09:20.000000000 +0200 ++++ rts/oper.c +@@ -1,6 +1,5 @@ + /* oper.c -- runtime support of operations */ + +-#include <varargs.h> + #include "rts.h" + + static Pool oper_pool; /* pool of operation descriptors */ diff --git a/lang/sr/patches/patch-am b/lang/sr/patches/patch-am new file mode 100644 index 00000000000..76096b32db2 --- /dev/null +++ b/lang/sr/patches/patch-am @@ -0,0 +1,36 @@ +$NetBSD: patch-am,v 1.1.1.1 2005/02/25 15:54:59 is Exp $ + +--- rts/scan.c.orig 1999-07-28 22:42:24.000000000 +0200 ++++ rts/scan.c +@@ -1,7 +1,7 @@ + /* scan.c -- scanf and sscanf */ + + #include <ctype.h> +-#include <varargs.h> ++#include <stdarg.h> + #include "rts.h" + + static int scanToken (), scanInteger (), scanReal (), scanPointer (); +@@ -58,11 +58,9 @@ static int scanTokenFromSet (); + * (or EOF). The number of successful conversions is returned otherwise. + */ + int +-sr_scanf (va_alist) +-va_dcl ++sr_scanf (char *locn, ...) + { + va_list ap; +- char *locn; + Array *a; + String *sp, *sfmt, *sarg; + Real *rp, real; +@@ -84,8 +82,7 @@ va_dcl + + sr_check_stk (CUR_STACK); + +- va_start (ap); +- locn = va_arg (ap, char *); ++ va_start (ap, locn); + fp = va_arg (ap, FILE *); + sarg = va_arg (ap, String *); + sfmt = va_arg (ap, String *); diff --git a/lang/sr/patches/patch-an b/lang/sr/patches/patch-an new file mode 100644 index 00000000000..81dd3c08d84 --- /dev/null +++ b/lang/sr/patches/patch-an @@ -0,0 +1,34 @@ +$NetBSD: patch-an,v 1.1.1.1 2005/02/25 15:54:59 is Exp $ + +--- rts/socket.c.orig 1999-08-09 18:34:34.000000000 +0200 ++++ rts/socket.c +@@ -5,6 +5,7 @@ + + #include "rts.h" + #include <fcntl.h> ++#include <string.h> + + #ifdef __PARAGON__ + #include <nx.h> +@@ -481,17 +482,10 @@ static void + syserr (message) + char *message; + { +- char s1[100], s2[100]; +- extern int sys_nerr; ++ char *s1; ++ char s2[100]; + +-#if !defined(__NetBSD__) && !defined(__FreeBSD__) && !defined(__linux__) +- extern char *sys_errlist[]; +-#endif +- +- if (errno > 0 && errno < sys_nerr) +- strcpy (s1, sys_errlist[errno]); +- else +- sprintf (s1, "error %d", errno); +- sprintf (s2, "%s: %s", message ? message : "network I/O", s1); ++ s1 = strerror(errno); ++ snprintf (s2, sizeof(s2), "%s: %s", message ? message : "network I/O", s1); + sr_net_abort (s2); + } diff --git a/lang/sr/patches/patch-ao b/lang/sr/patches/patch-ao new file mode 100644 index 00000000000..714a3c394ec --- /dev/null +++ b/lang/sr/patches/patch-ao @@ -0,0 +1,13 @@ +$NetBSD: patch-ao,v 1.1.1.1 2005/02/25 15:54:59 is Exp $ + +--- sr.h.orig 1999-07-30 23:11:10.000000000 +0200 ++++ sr.h +@@ -307,7 +307,7 @@ extern double sin(), cos(), tan(), asin( + extern void *memcpy(); + #endif + +-#if defined(__sgi) && ! defined(RTS) ++#if (defined(__sgi) && ! defined(RTS)) || defined(__NetBSD__) + /* SGI needs new-style prototypes when compiling generated code */ + extern Ptr sr_cat(String*, ...); + extern int sr_imax(int, ...); diff --git a/lang/sr/patches/patch-ap b/lang/sr/patches/patch-ap new file mode 100644 index 00000000000..f7b25d5c78d --- /dev/null +++ b/lang/sr/patches/patch-ap @@ -0,0 +1,36 @@ +$NetBSD: patch-ap,v 1.1.1.1 2005/02/25 15:54:59 is Exp $ + +--- sr/output.c.orig 1999-07-28 23:08:50.000000000 +0200 ++++ sr/output.c +@@ -8,7 +8,7 @@ + #include "compiler.h" + #include <ctype.h> + #include <errno.h> +-#include <varargs.h> ++#include <stdarg.h> + + #define NSTREAMS 10 /* number of output streams */ + #define DEFSTREAM 9 /* default stream number */ +@@ -231,11 +231,9 @@ cflush () + + /* VARARGS */ + void +-cprintf (va_alist) +-va_dcl ++cprintf (char *fmt, ...) + { + va_list ap; +- char *fmt; + char *s; + char c; + int n, oldstream; +@@ -244,8 +242,7 @@ va_dcl + + oldstream = outstream; /* save stream number in case changed */ + +- va_start (ap); +- fmt = va_arg (ap, char *); ++ va_start (ap, fmt); + + if (*fmt == ',' && LASTPUT () == '(') + fmt++; /* skip initial comma inside parens */ diff --git a/lang/sr/patches/patch-aq b/lang/sr/patches/patch-aq new file mode 100644 index 00000000000..a8f7a1db8c4 --- /dev/null +++ b/lang/sr/patches/patch-aq @@ -0,0 +1,13 @@ +$NetBSD: patch-aq,v 1.1.1.1 2005/02/25 15:54:59 is Exp $ + +--- sr/protos.h.orig 1999-08-03 02:09:32.000000000 +0200 ++++ sr/protos.h +@@ -148,7 +148,7 @@ extern void mkinter PARAMS ((NOARGS)); + extern void copen PARAMS ((char *fname)); + extern void cdivert PARAMS ((int n)); + extern void undivert PARAMS ((int n)); +-extern void cprintf PARAMS ((/* VARARGS */)); ++extern void cprintf PARAMS ((char *, ...)); + extern void cflush PARAMS (()); + extern void cclose PARAMS ((NOARGS)); + extern void setstream PARAMS ((int n)); diff --git a/lang/sr/patches/patch-ar b/lang/sr/patches/patch-ar new file mode 100644 index 00000000000..c217737a5ca --- /dev/null +++ b/lang/sr/patches/patch-ar @@ -0,0 +1,9 @@ +$NetBSD: patch-ar,v 1.1.1.1 2005/02/25 15:54:59 is Exp $ + +--- vsuite/quick/easy/Make.std.orig 1999-07-28 22:43:18.000000000 +0200 ++++ vsuite/quick/easy/Make.std +@@ -1,3 +1,3 @@ + echo gries.sr +-rm -rf ./Interfaces ++rm -rf ./Interfaces + rm -f core a.out diff --git a/lang/sr/patches/patch-as b/lang/sr/patches/patch-as new file mode 100644 index 00000000000..5ece1a0181c --- /dev/null +++ b/lang/sr/patches/patch-as @@ -0,0 +1,13 @@ +$NetBSD: patch-as,v 1.1.1.1 2005/02/25 15:54:59 is Exp $ + +--- Makefile.orig 2004-09-22 15:20:43.000000000 +0200 ++++ Makefile +@@ -4,7 +4,7 @@ + + + CC = cc +-CFLAGS = -g ++CFLAGS = -O3 + MAKE = make + SHELL = /bin/sh + diff --git a/lang/sr/patches/patch-at b/lang/sr/patches/patch-at new file mode 100644 index 00000000000..9303969ea83 --- /dev/null +++ b/lang/sr/patches/patch-at @@ -0,0 +1,45 @@ +$NetBSD: patch-at,v 1.1.1.1 2005/02/25 15:54:59 is Exp $ + +--- csw/Makefile.orig 1999-07-30 07:01:50.000000000 +0200 ++++ csw/Makefile +@@ -1,6 +1,6 @@ + ## Makefile for the SR context switch routines. + +-CFLAGS = -g ++CFLAGS = -O3 + SHELL = /bin/sh + + SRC = alpha.s ap3000.s bobcat.s encore.s i386.s m68k.s m88k.s mips.s \ +@@ -16,6 +16,8 @@ OKAY: cstest + cmp cstest.out cstest.stdout + echo "`date`: cstest passed" >OKAY + ++_context_u.o: ; ar xv /usr/lib/libpthread.a _context_u.o ++pthread_md.o: ; ar xv /usr/lib/libpthread.a pthread_md.o + + # cstest is the test program + +@@ -27,19 +29,15 @@ cstest: cstest.o asm.o + # csloop is a timing program, built only on request + + csloop: csloop.o asm.o +- . ../paths.sh; $(CC) -O -o csloop csloop.o asm.o $$LIBR $$LIBC ++ . ../paths.sh; $(CC) -g -o csloop csloop.o asm.o $$LIBR $$LIBC + + csloop.o: csloop.c + $(CC) -O -c csloop.c + + +-# asm.o holds the actual context switch code +- +-asm.o: asm.c ../arch.h $(SRC) +- $(CC) $(CFLAGS) -E asm.c | \ +- sed -e '/^ *$$/d' -e '/^#/'d -e 's/ :/:/' >asm.s +- as -o asm.o asm.s +- ++asm.o: netbsd.c pthread_md.o _context_u.o ++ $(CC) $(CFLAGS) -c netbsd.c ++ $(LD) -r -o asm.o netbsd.o pthread_md.o _context_u.o + + + # miscellaneous utility targets diff --git a/lang/sr/patches/patch-au b/lang/sr/patches/patch-au new file mode 100644 index 00000000000..27629efba0e --- /dev/null +++ b/lang/sr/patches/patch-au @@ -0,0 +1,123 @@ +$NetBSD: patch-au,v 1.1.1.1 2005/02/25 15:54:59 is Exp $ + +--- csw/netbsd.c.orig 2004-11-03 23:04:48.000000000 +0100 ++++ csw/netbsd.c +@@ -0,0 +1,118 @@ ++/* ++ * netbsd.c -- context switch code for NetBSD 2. ++ * ++ * Some Makefile changes are needed to use this code. ++ */ ++ ++#include <stdio.h> ++#include <stdlib.h> ++#include <ucontext.h> ++ ++static void startup(); ++void sr_stk_underflow(); ++ ++#ifdef __i386__ ++void pthread__i386_init(void); ++ ++#define _getcontext_u(uc) (*_md_getcontext_u)(uc) ++#define _setcontext_u(uc) (*_md_setcontext_u)(uc) ++#define _swapcontext_u(oc,nc) (*_md_swapcontext_u)(oc,nc) ++ ++static void sr_getcontext_u(ucontext_t *); ++static void sr_setcontext_u(ucontext_t *); ++static void sr_swapcontext_u(ucontext_t *, ucontext_t *); ++ ++void (*_md_getcontext_u) (ucontext_t *) = sr_getcontext_u; ++void (*_md_setcontext_u) (ucontext_t *) = sr_setcontext_u; ++void (*_md_swapcontext_u)(ucontext_t *, ucontext_t *) = sr_swapcontext_u; ++ ++static void ++sr_getcontext_u(ucontext_t *uc) { ++ pthread__i386_init(); ++ _getcontext_u(uc); ++} ++ ++static void ++sr_setcontext_u(ucontext_t *uc) { ++ pthread__i386_init(); ++ _setcontext_u(uc); ++} ++ ++static void ++sr_swapcontext_u(ucontext_t *oldc, ucontext_t *newc) { ++ pthread__i386_init(); ++ _swapcontext_u(oldc, newc); ++} ++#endif ++ ++ ++/* ++ * sr_build_context (func, buf, bufsize, arg1, arg2, arg3, arg4) ++ * ++ * Build a context that will call func(arg1,arg2,arg3,arg4) when activated ++ * and will catch an underflow error if func returns. We use an intermediary ++ * in order to catch that return. ++ */ ++void ++sr_build_context (func, buf, bufsize, arg1, arg2, arg3, arg4) ++void (*func)(); ++char *buf; ++int bufsize; ++unsigned long arg1, arg2, arg3, arg4; ++{ ++ ucontext_t *uc = (ucontext_t *) buf; /* put header at front of buf */ ++ ++ _getcontext_u(uc); /* initialize context */ ++ ++ uc->uc_stack.ss_sp = buf + sizeof (ucontext_t); ++ uc->uc_stack.ss_size = bufsize - sizeof (ucontext_t); ++ ++ makecontext (uc, startup, 5, func, arg1, arg2, arg3, arg4); ++ uc->uc_stack.ss_flags = 0; ++} ++ ++/* ++ * startup (func, stk) -- intermediary for startup and underflow detection. ++ */ ++static void ++startup (func, arg1, arg2, arg3, arg4) ++void (*func)(); ++unsigned long arg1, arg2, arg3, arg4; ++{ ++ (*func) (arg1, arg2, arg3, arg4); ++ sr_stk_underflow(); ++} ++ ++ ++ ++/* ++ * sr_chg_context (newctx, oldctx) -- change contexts. ++ */ ++void ++sr_chg_context (new, old) ++char *new, *old; ++{ ++ ucontext_t *oldu, *newu; ++ newu = (ucontext_t *)new; ++ ++ if (old) { ++ oldu = (ucontext_t *)old; ++ _swapcontext_u(oldu, newu); ++ } else { ++ _setcontext_u(newu); ++ } ++} ++ ++ ++ ++/* ++ * sr_check_stk (stk) -- check for stack overflow. ++ * ++ * We have no idea of how to do that, so we do nothing. ++ */ ++void ++sr_check_stk(stk) ++char *stk; ++{ ++ /* nothing */ ++} |