svn commit: r565477 - in head/lang/siod: . files

Mikhail Teterin mi at FreeBSD.org
Wed Feb 17 03:00:02 UTC 2021


Author: mi
Date: Wed Feb 17 03:00:00 2021
New Revision: 565477
URL: https://svnweb.freebsd.org/changeset/ports/565477

Log:
  Upgrade from circa 2000 to circa 2014 code. Unfortunately, upstream
  are somewhat sloppy about releases -- and do not publish versioned
  files. I'm calling this one 3.6.2, because that's the last version
  found in the change log.
  
  The new build uses bsd.lib.mk and bsd.prog.mk -- in order to:
  	a) build shared libraries cleanly;
  	b) stand a chance of working on the hardware platforms,
  	   where the author never tried it.
  
  The large patches provide for warning-free compiles with WARNS=7 --
  tested on FreeBSD-11/amd64.
  
  We now take care to link with libgnuregex.so -- whether from base
  or provided by devel/libgnuregex instead of using the bundled
  (ancient) version of Henry Spencer's library.
  
  Similarly, the port links with the base -lmd instead of compiling
  its own MD5-implementation.
  
  Additional new feature is options, which currently include:
  
  	. Socket support -- this used to be built unconditionally
  	  and is still on by default. However, someone concerned
  	  about the "network daemon" security warning may want to
  	  to turn this off.
  	. Regex module -- also on by default. But, because it may,
  	  depending on the OS version, drag in a dependency, it
  	  can be turned off.
  	. NDBM -- a never-before built (not on FreeBSD) module
  	  allowing work with NDBM databases. On by default now,
  	  because it has no dependencies.
  	. GD -- the graphics library. Never built before by this
  	  port, it remains off by default because it depends on
  	  graphics/gd (or ukrainian/gd).
  	. SQL_SYBASE -- for interactions with Sybase (and MS-SQL)
  	  database servers. Depends on databases/freetds and therefor
  	  off by default.
  
  There is also sql_oracle module, which is not enabled (for now),
  because databases/oracle8-client is, unfortunately, i386-only.
  
  The peculiarity of installing siod.html into ${PREFIX}/lib/siod
  remains for now -- suggestions welcome.
  
  Sponsored by:	United Marsupials

Added:
  head/lang/siod/files/BSDmakefile   (contents, props changed)
  head/lang/siod/files/BSDmakefile.lib   (contents, props changed)
  head/lang/siod/files/BSDmakefile.module   (contents, props changed)
  head/lang/siod/files/BSDmakefile.prog   (contents, props changed)
  head/lang/siod/files/patch-gd   (contents, props changed)
  head/lang/siod/files/patch-lib
     - copied, changed from r565476, head/lang/siod/files/patch-slibu.c
  head/lang/siod/files/patch-ndbm   (contents, props changed)
  head/lang/siod/files/patch-parser_pratt   (contents, props changed)
  head/lang/siod/files/patch-regex
     - copied, changed from r565476, head/lang/siod/files/patch-regex.c
  head/lang/siod/files/patch-sample.c   (contents, props changed)
  head/lang/siod/files/patch-siod.c   (contents, props changed)
  head/lang/siod/files/patch-sql_sybase   (contents, props changed)
  head/lang/siod/files/patch-ss   (contents, props changed)
  head/lang/siod/files/patch-tar   (contents, props changed)
Deleted:
  head/lang/siod/files/patch-makefile
  head/lang/siod/files/patch-regex.c
  head/lang/siod/files/patch-slibu.c
Modified:
  head/lang/siod/Makefile
  head/lang/siod/distinfo
  head/lang/siod/pkg-plist

Modified: head/lang/siod/Makefile
==============================================================================
--- head/lang/siod/Makefile	Wed Feb 17 02:30:18 2021	(r565476)
+++ head/lang/siod/Makefile	Wed Feb 17 03:00:00 2021	(r565477)
@@ -2,31 +2,69 @@
 # $FreeBSD$
 
 PORTNAME=	siod
-PORTVERSION=	3.4
+PORTVERSION=	3.6.2
 CATEGORIES=	lang scheme
-MASTER_SITES=	LOCAL/jkoshy
+MASTER_SITES=	http://people.delphiforums.com/gjc/
 DISTNAME=	siod
-EXTRACT_SUFX=	.tgz
+DIST_SUBDIR=	${PORTNAME}-${PORTVERSION}	# Upstream aren't versioned :(
 
-MAINTAINER=	ports at FreeBSD.org
+MAINTAINER=	mi at aldan.algebra.com
 COMMENT=	Small footprint implementation of the Scheme programming language
 
-BROKEN_aarch64=		fails to link: ld: error: unable to find library -lm
-BROKEN_armv6=		fails to link: final link failed: Nonrepresentable section on output
-BROKEN_armv7=		fails to link: ld: siod: hidden symbol `__aeabi_uidivmod' in /usr/lib/libgcc.a(aeabi_uidivmod.o) is referenced by DSO
-BROKEN_mips64=		fails to link: final link failed: Nonrepresentable section on output
-BROKEN_riscv64=		fails to link: ld: error: unable to find library -lm
+LICENSE=	LGPL21	# Declared inside slib.c
 
-USE_LDCONFIG=	yes
-LLD_UNSAFE=	yes
+USES=		uidfix tar:tgz dos2unix
 
+USE_LDCONFIG=	${PREFIX}/lib/siod
+
+DOS2UNIX_FILES=	sql_oracle.c ss.c
+OPTIONS_DEFINE=	SQL_SYBASE GD NDBM REGEX SS
+OPTIONS_DEFAULT=NDBM REGEX SS
+SQL_SYBASE_DESC=Build Sybase (and MS-SQL) client-module (using FreeTDS)
+SS_DESC=	Sockets support - required for any network programs
+NDBM_DESC=	Support for NDBM-databases
 NO_WRKSUBDIR=	yes
-MAKEFILE=	makefile
-ALL_TARGET=	freebsd
-MAKE_ENV=	LD_LIBRARY_PATH=.
-MAKE_JOBS_UNSAFE=	yes
+EXTRACT_AFTER_ARGS=--exclude md5\* --exclude regex.h --exclude reg????*.c
+CFLAGS+=	-Werror
+MAKE_ARGS=	VPATH=${WRKSRC} MODULES=${MODULES:Q}
+MAKEFILE=	${FILESDIR}/BSDmakefile
+MAKE_ENV=	MKDIR=${MKDIR:Q} STAGEDIR=${STAGEDIR:Q}
+MAKE_ENV+=	MAN1PREFIX=${MAN1PREFIX} PREFIX=${PREFIX:Q}
+MAKE_ENV+=	INSTALL_MAN=${INSTALL_MAN:Q} INSTALL_SCRIPT=${INSTALL_SCRIPT:Q}
+MAKE_ENV+=	INSTALL_DATA=${INSTALL_DATA:Q}
 
-post-install:
-	@${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/siod
+MODULES=	tar parser_pratt
+
+SQL_SYBASE_LIB_DEPENDS=	libct.so:databases/freetds	# Or freetds-devel
+GD_LIB_DEPENDS=		libgd.so:graphics/gd	# Or ukrainian/gd
+REGEX_LIB_DEPENDS=	libgnuregex.so:devel/libgnuregex
+OPTIONS_SUB=	yes
+
+.if "${PREFIX}" != "/usr/local"
+post-patch:
+	${REINPLACE_CMD} 's|/usr/local|${PREFIX}|g' ${WRKSRC}/slib.c
+.endif
+
+post-build:
+	${REINPLACE_CMD} -e 's|\./siod|env LD_LIBRARY_PATH=lib siod/siod|g' \
+		-e 's|/usr/local|${PREFIX}|g' ${WRKSRC}/makefile
+	${MAKE} -C ${WRKSRC} -f makefile build_driver
+
+.include <bsd.port.options.mk>
+MODULES+=	${SELECTED_OPTIONS:tl}
+
+do-configure:
+	${MKDIR} ${WRKSRC}/lib
+	${LN} -sf ${FILESDIR}/BSDmakefile.lib ${WRKSRC}/lib/BSDmakefile
+.for s in ${MODULES}
+	${MKDIR} ${WRKSRC}/$s
+	${SED} "s,%%MODULE%%,$s,g" ${FILESDIR}/BSDmakefile.module > \
+	    ${WRKSRC}/$s/BSDmakefile
+.endfor
+.for s in siod sample
+	${MKDIR} ${WRKSRC}/$s
+	${SED} "s,%%PROG%%,$s,g" ${FILESDIR}/BSDmakefile.prog >	\
+	    ${WRKSRC}/$s/BSDmakefile
+.endfor
 
 .include <bsd.port.mk>

Modified: head/lang/siod/distinfo
==============================================================================
--- head/lang/siod/distinfo	Wed Feb 17 02:30:18 2021	(r565476)
+++ head/lang/siod/distinfo	Wed Feb 17 03:00:00 2021	(r565477)
@@ -1,2 +1,3 @@
-SHA256 (siod.tgz) = b9b0d19795c49b9665cdbf6ea7d50affef2bc594a382e18c4d8b52c8f1b1e4f0
-SIZE (siod.tgz) = 217202
+TIMESTAMP = 1613414947
+SHA256 (siod-3.6.2/siod.tgz) = 34ddcfabc140ebd7780e03be4a79d293e6eafc88e06cfc5c567d6c52bb9140bd
+SIZE (siod-3.6.2/siod.tgz) = 213446

Added: head/lang/siod/files/BSDmakefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/siod/files/BSDmakefile	Wed Feb 17 03:00:00 2021	(r565477)
@@ -0,0 +1,16 @@
+SUBDIR=	lib ${MODULES} siod sample
+
+beforeinstall:
+	${MKDIR} ${STAGEDIR}${PREFIX}/lib/siod
+
+afterinstall:
+	# Install man-pages
+	set -x; for m in *.man; do	\
+		${INSTALL_MAN} $$m ${STAGEDIR}${MAN1PREFIX}/man/man1/$${m%%.man}.1;	\
+	done
+	${INSTALL_SCRIPT} `${MAKE} -f makefile -V CMDFILES`	\
+		${STAGEDIR}${PREFIX}/bin/
+	${INSTALL_DATA} `${MAKE} -f makefile -V LIBFILES`	\
+		${STAGEDIR}${PREFIX}/lib/siod
+
+.include <bsd.subdir.mk>

Added: head/lang/siod/files/BSDmakefile.lib
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/siod/files/BSDmakefile.lib	Wed Feb 17 03:00:00 2021	(r565477)
@@ -0,0 +1,16 @@
+LIB=		siod
+MK_PROFILE=	no
+SHLIB_MAJOR=	3
+SHLIB_MINOR=	6
+
+WARNS=	7
+
+SRCS=	slib.c sliba.c trace.c slibu.c
+INCS=	siod.h
+CFLAGS+=-DHAVE_SYS_PARAM_H
+LDADD=	-lmd -lm -lcrypt
+
+LIBDIR=	${PREFIX}/lib
+INCSDIR=${PREFIX}/include
+
+.include <bsd.lib.mk>

Added: head/lang/siod/files/BSDmakefile.module
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/siod/files/BSDmakefile.module	Wed Feb 17 03:00:00 2021	(r565477)
@@ -0,0 +1,21 @@
+SHLIB_NAME=	%%MODULE%%.so
+MK_PROFILE=	no
+
+WARNS=	7
+
+# Some modules have dependencies installed by other ports:
+gd_CFLAGS=	-isystem ${LOCALBASE}/include
+gd_LDADD=	-L${LOCALBASE}/lib -lgd
+regex_CFLAGS=	-isystem ${LOCALBASE}/include
+regex_LDADD=	-L${LOCALBASE}/lib -lgnuregex
+sql_sybase_CFLAGS=-isystem ${LOCALBASE}/include
+sql_sybase_LDADD=-L${LOCALBASE}/lib -lct
+
+CFLAGS+=	-DHAVE_SYS_PARAM_H ${%%MODULE%%_CFLAGS}
+LDADD=		${%%MODULE%%_LDADD}
+
+SRCS=	%%MODULE%%.c
+
+LIBDIR=	${PREFIX}/lib/siod
+
+.include <bsd.lib.mk>

Added: head/lang/siod/files/BSDmakefile.prog
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/siod/files/BSDmakefile.prog	Wed Feb 17 03:00:00 2021	(r565477)
@@ -0,0 +1,14 @@
+PROG=	%%PROG%%
+
+WARNS=	7
+
+BINDIR=	${PREFIX}/bin
+MANDIR=	${PREFIX}/man/man
+LDADD=	-L${.CURDIR:H}/lib -lsiod
+MK_MAN=	no
+
+.if "%%PROG%%" == "sample"
+INTERNALPROG=	yes	# We want it built -- as proof -- but not installed
+.endif
+
+.include <bsd.prog.mk>

Added: head/lang/siod/files/patch-gd
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/siod/files/patch-gd	Wed Feb 17 03:00:00 2021	(r565477)
@@ -0,0 +1,391 @@
+--- gd.c	2014-03-25 04:10:42.000000000 -0400
++++ gd.c	2021-02-16 11:58:57.946320000 -0500
+@@ -9,5 +9,11 @@
+ #include <stdlib.h>
+ #include <string.h>
+-#include "gd.h"
++#include <gd.h>
++#include <gdfontg.h>
++#include <gdfontl.h>
++#include <gdfontmb.h>
++#include <gdfonts.h>
++#include <gdfontt.h>
++
+ #include "siod.h"
+ 
+@@ -17,15 +23,9 @@
+ 	NIL);}
+ 
+-long tc_gdimage = 0;
+-long tc_gdfont = 0;
+-long tc_gdpoint = 0;
+-
+-extern gdFontPtr gdFontGiant;
+-extern gdFontPtr gdFontLarge;
+-extern gdFontPtr gdFontMediumBold;
+-extern gdFontPtr gdFontSmall;
+-extern gdFontPtr gdFontTiny;
++static long tc_gdimage = 0;
++static long tc_gdfont = 0;
++static long tc_gdpoint = 0;
+ 
+-LISP lgdImageCreate(LISP sx,LISP sy)
++static LISP lgdImageCreate(LISP sx,LISP sy)
+ {LISP result;
+  long iflag;
+@@ -38,5 +38,5 @@
+  return(result);}
+ 
+-LISP lgdImageCreateFromGif(LISP f)
++static LISP lgdImageCreateFromGif(LISP f)
+ {LISP result;
+  long iflag;
+@@ -49,5 +49,5 @@
+  return(result);}
+ 
+-LISP lgdImageCreateFromXbm(LISP f)
++static LISP lgdImageCreateFromXbm(LISP f)
+ {LISP result;
+  long iflag;
+@@ -61,13 +61,13 @@
+ 
+ 
+-gdImagePtr get_gdImagePtr(LISP ptr)
++static gdImagePtr get_gdImagePtr(LISP ptr)
+ {gdImagePtr im;
+  if (NTYPEP(ptr,tc_gdimage))
+    err("not a gdImage",ptr);
+- if (!(im = (gdImagePtr) ptr->storage_as.string.data))
++ if (!(im = (gdImagePtr)(void *)ptr->storage_as.string.data))
+    err("gd Image deallocated",ptr);
+  return(im);}
+ 
+-LISP lcgdFontCreate(gdFontPtr font)
++static LISP lcgdFontCreate(gdFontPtr font)
+ {LISP result;
+  long iflag;
+@@ -80,13 +80,13 @@
+  return(result);}
+ 
+-gdFontPtr get_gdFontPtr(LISP ptr)
++static gdFontPtr get_gdFontPtr(LISP ptr)
+ {gdFontPtr fn;
+  if (NTYPEP(ptr,tc_gdfont))
+    err("not a gdFont",ptr);
+- if (!(fn = (gdFontPtr) ptr->storage_as.string.data))
++ if (!(fn = (gdFontPtr)(void *)ptr->storage_as.string.data))
+    err("gd Font deallocated",ptr);
+  return(fn);}
+ 
+-LISP lgdPoint(LISP args)
++static LISP lgdPoint(LISP args)
+ {LISP result,l;
+  long iflag,j,m,n = nlength(args);
+@@ -98,5 +98,5 @@
+  result->type = tc_gdpoint;
+  iflag = no_interrupt(1);
+- pt =  (gdPointPtr) must_malloc(sizeof(gdPoint) * m);
++ pt =  must_malloc(sizeof(gdPoint) * m);
+  result->storage_as.string.data = (char *) pt;
+  result->storage_as.string.dim = m;
+@@ -107,14 +107,14 @@
+  return(result);}
+ 
+-gdPointPtr get_gdPointPtr(LISP ptr,long *n)
++static gdPointPtr get_gdPointPtr(LISP ptr,long *n)
+ {gdPointPtr pt;
+  if (NTYPEP(ptr,tc_gdpoint))
+    err("not a gdPoint",ptr);
+- if (!(pt = (gdPointPtr) ptr->storage_as.string.data))
++ if (!(pt = (gdPointPtr)(void *)ptr->storage_as.string.data))
+    err("gd point deallocated",ptr);
+  *n = ptr->storage_as.string.dim;
+  return(pt);}
+ 
+-LISP lgdPointx(LISP ptr,LISP j,LISP value)
++static LISP lgdPointx(LISP ptr,LISP j,LISP value)
+ {long n,i;
+  gdPointPtr pt;
+@@ -129,5 +129,5 @@
+ 
+ 
+-LISP lgdPointy(LISP ptr,LISP j,LISP value)
++static LISP lgdPointy(LISP ptr,LISP j,LISP value)
+ {long n,i;
+  gdPointPtr pt;
+@@ -141,5 +141,5 @@
+  return(value);}
+  
+-LISP lgdImageGif(LISP im,LISP f)
++static LISP lgdImageGif(LISP im,LISP f)
+ {long iflag;
+  iflag = no_interrupt(1);
+@@ -156,19 +156,22 @@
+ #include <unistd.h>
+ 
+-void gdImageGifmem(gdImagePtr im, char *buffer, size_t *len)
++static void gdImageGifmem(gdImagePtr im, char *buffer, size_t *len)
+ {FILE *f;
+  char tmpname[32];
+  struct stat sb;
+- strcpy(tmpname, "/tmp/gd.XXXXXX");
+- mktemp(tmpname);
+- if ((f = fopen(tmpname, "wb+")) != NULL) {
+-     gdImageGif(im, f);
+-     fstat(fileno(f), &sb);
+-     if (sb.st_size < *len) *len = sb.st_size;
+-     rewind(f);
+-     fread(buffer, 1, *len, f);
++ int fd;
++ strcpy(tmpname, "/tmp/gd.XXXXXX.gif");
++ fd = mkstemps(tmpname, 4);
++ if (fd != -1 && (f = fdopen(fd, "wb+")) != NULL) {
++     gdImageGif(im, f);	/* XXX no error-checking from here on */
++     if (fstat(fileno(f), &sb) == 0 && sb.st_size <= (off_t)*len) {
++       *len = sb.st_size;
++       rewind(f);
++       *len = fread(buffer, 1, *len, f);
++     } else
++       *len = 0;
+      fclose(f);
+  } else {
+-     *len = 0;
++     *len = 0;	/* XXX and no reporting for what little checking there is */
+  }
+  unlink(tmpname);
+@@ -177,10 +180,10 @@
+ #endif
+ 
+-LISP lgdImageGifmem(LISP im,LISP b)
+-{long iflag,dim;
++static LISP lgdImageGifmem(LISP im, LISP b)
++{long iflag;
+  size_t len;
+  char *buffer;
+- buffer = get_c_string_dim(b,&dim);
+- len = dim;
++ buffer = get_string_data(b);
++ len = b->storage_as.string.dim;
+  iflag = no_interrupt(1);
+  gdImageGifmem(get_gdImagePtr(im),buffer,&len);
+@@ -188,5 +191,5 @@
+  return(flocons(len));}
+ 
+-LISP lgdImageColorAllocate(LISP l)
++static LISP lgdImageColorAllocate(LISP l)
+ {long iflag;
+  int result;
+@@ -202,5 +205,5 @@
+  return(flocons(result));}
+ 
+-LISP lgdImageColorClosest(LISP l)
++static LISP lgdImageColorClosest(LISP l)
+ {long iflag;
+  int result;
+@@ -216,5 +219,5 @@
+  return(flocons(result));}
+ 
+-LISP lgdImageColorExact(LISP l)
++static LISP lgdImageColorExact(LISP l)
+ {long iflag;
+  int result;
+@@ -230,5 +233,5 @@
+  return(flocons(result));}
+ 
+-LISP lgdImageLine(LISP l)
++static LISP lgdImageLine(LISP l)
+ {gdImagePtr im;
+  int x1,y1,x2,y2,color;
+@@ -242,5 +245,5 @@
+  return(NIL);}
+ 
+-LISP lgdImageSetPixel(LISP l)
++static LISP lgdImageSetPixel(LISP l)
+ {gdImagePtr im;
+  int x,y,color;
+@@ -252,5 +255,5 @@
+  return(NIL);}
+ 
+-LISP lgdImagePolygon(LISP im,LISP points,LISP color)
++static LISP lgdImagePolygon(LISP im,LISP points,LISP color)
+ {gdPointPtr pt;
+  long n;
+@@ -262,5 +265,5 @@
+  return(NIL);}
+ 
+-LISP lgdImageFilledPolygon(LISP im,LISP points,LISP color)
++static LISP lgdImageFilledPolygon(LISP im,LISP points,LISP color)
+ {gdPointPtr pt;
+  long n;
+@@ -272,5 +275,5 @@
+  return(NIL);}
+ 
+-LISP lgdImageRectangle(LISP l)
++static LISP lgdImageRectangle(LISP l)
+ {gdImagePtr im;
+  int x1,y1,x2,y2,color;
+@@ -284,5 +287,5 @@
+  return(NIL);}
+ 
+-LISP lgdImageFilledRectangle(LISP l)
++static LISP lgdImageFilledRectangle(LISP l)
+ {gdImagePtr im;
+  int x1,y1,x2,y2,color;
+@@ -296,5 +299,5 @@
+  return(NIL);}
+ 
+-LISP lgdImageArc(LISP l)
++static LISP lgdImageArc(LISP l)
+ {gdImagePtr im;
+  int cx,cy,w,h,s,e,color;
+@@ -311,5 +314,5 @@
+ 
+ 
+-LISP lgdImageFillToBorder(LISP l)
++static LISP lgdImageFillToBorder(LISP l)
+ {gdImagePtr im;
+  int x,y,border,color;
+@@ -322,5 +325,5 @@
+  return(NIL);}
+ 
+-LISP lgdImageFill(LISP l)
++static LISP lgdImageFill(LISP l)
+ {gdImagePtr im;
+  int x,y,color;
+@@ -331,14 +334,6 @@
+  gdImageFill(im,x,y,color);
+  return(NIL);}
+- 
+-/*
+ 
+-void gdImageSetBrush(gdImagePtr im, gdImagePtr brush)
+-void gdImageSetTile(gdImagePtr im, gdImagePtr tile)
+-void gdImageSetStyle(gdImagePtr im, int *style, int styleLength)
+-
+-*/
+-
+-LISP lgdImageChar(LISP l)
++static LISP lgdImageChar(LISP l)
+ {gdImagePtr im;
+  gdFontPtr font;
+@@ -353,5 +348,5 @@
+  return(NIL);}
+ 
+-LISP lgdImageCharUp(LISP l)
++static LISP lgdImageCharUp(LISP l)
+ {gdImagePtr im;
+  gdFontPtr font;
+@@ -366,5 +361,5 @@
+  return(NIL);}
+ 
+-LISP lgdImageString(LISP l)
++static LISP lgdImageString(LISP l)
+ {gdImagePtr im;
+  gdFontPtr font;
+@@ -375,10 +370,10 @@
+  x = get_c_long(poparg(&l,NIL));
+  y = get_c_long(poparg(&l,NIL));
+- c = get_c_string(poparg(&l,NIL));
++ c = get_string_data(poparg(&l, NIL));
+  color = get_c_long(poparg(&l,NIL));
+  gdImageString(im,font,x,y,c,color);
+  return(NIL);}
+ 
+-LISP lgdImageStringUp(LISP l)
++static LISP lgdImageStringUp(LISP l)
+ {gdImagePtr im;
+  gdFontPtr font;
+@@ -389,21 +384,21 @@
+  x = get_c_long(poparg(&l,NIL));
+  y = get_c_long(poparg(&l,NIL));
+- c = get_c_string(poparg(&l,NIL));
++ c = get_string_data(poparg(&l, NIL));
+  color = get_c_long(poparg(&l,NIL));
+  gdImageStringUp(im,font,x,y,c,color);
+  return(NIL);}
+ 
+-LISP lgdImageColorTransparent(LISP im,LISP color)
++static LISP lgdImageColorTransparent(LISP im,LISP color)
+ {gdImageColorTransparent(get_gdImagePtr(im),get_c_long(color));
+  return(NIL);}
+ 
+-LISP lgdImageInterlace(LISP im,LISP interlace)
++static LISP lgdImageInterlace(LISP im,LISP interlace)
+ {gdImageInterlace(get_gdImagePtr(im),get_c_long(interlace));
+  return(NIL);}
+ 
+-void gdimage_prin1(LISP ptr,struct gen_printio *f)
++static void gdimage_prin1(LISP ptr,struct gen_printio *f)
+ {char buff[256];
+  gdImagePtr im;
+- if ((im = (gdImagePtr) ptr->storage_as.string.data))
++ if ((im = (gdImagePtr)(void *)ptr->storage_as.string.data))
+    sprintf(buff,"#<GDIMAGE %p %d by %d>",
+ 	   im,im->sx,im->sy);
+@@ -412,14 +407,14 @@
+  gput_st(f,buff);}
+ 
+-void gdimage_gc_free(LISP ptr)
++static void gdimage_gc_free(LISP ptr)
+ {gdImagePtr im;
+- if ((im = (gdImagePtr) ptr->storage_as.string.data))
++ if ((im = (gdImagePtr)(void *)ptr->storage_as.string.data))
+    {gdImageDestroy(im);
+     ptr->storage_as.string.data = NULL;}}
+ 
+-void gdfont_prin1(LISP ptr,struct gen_printio *f)
++static void gdfont_prin1(LISP ptr,struct gen_printio *f)
+ {char buff[256];
+  gdFontPtr fnt;
+- if ((fnt = (gdFontPtr) ptr->storage_as.string.data))
++ if ((fnt = (gdFontPtr)(void *)ptr->storage_as.string.data))
+    sprintf(buff,"#<GDFONT %p %d by %d>",
+ 	   fnt,fnt->w,fnt->h);
+@@ -428,7 +423,7 @@
+  gput_st(f,buff);}
+ 
+-void gdfont_gc_free(LISP ptr)
++static void gdfont_gc_free(LISP ptr)
+ {gdFontPtr fnt;
+- if ((fnt = (gdFontPtr) ptr->storage_as.string.data) &&
++ if ((fnt = (gdFontPtr)(void *)ptr->storage_as.string.data) &&
+      ptr->storage_as.string.dim)
+    /* there is no api in gd 1.2 for loading a file from a file.
+@@ -437,29 +432,31 @@
+  }
+ 
+-void gdpoint_prin1(LISP ptr,struct gen_printio *f)
++static void gdpoint_prin1(LISP ptr,struct gen_printio *f)
+ {char buff[256];
+  gdPointPtr pt;
+- pt = (gdPointPtr) ptr->storage_as.string.data;
++ pt = (gdPointPtr)(void *)ptr->storage_as.string.data;
+  sprintf(buff,"#<GDPOINT %p %ld>",
+ 	 pt,ptr->storage_as.string.dim);
+  gput_st(f,buff);}
+ 
+-void gdpoint_gc_free(LISP ptr)
++static void gdpoint_gc_free(LISP ptr)
+ {gdPointPtr pt;
+- if ((pt = (gdPointPtr) ptr->storage_as.string.data))
++ if ((pt = (gdPointPtr)(void *)ptr->storage_as.string.data))
+    {free(pt);
+     ptr->storage_as.string.data = NULL;
+     ptr->storage_as.string.dim = 0;}}
+ 
+-LISP gdfont_w(LISP ptr)
++static LISP gdfont_w(LISP ptr)
+ {gdFontPtr font;
+  font = get_gdFontPtr(ptr);
+  return(flocons(font->w));}
+ 
+-LISP gdfont_h(LISP ptr)
++static LISP gdfont_h(LISP ptr)
+ {gdFontPtr font;
+  font = get_gdFontPtr(ptr);
+  return(flocons(font->h));}
+ 
++void init_gd(void);	/* Module entry point - our sole exported function */
++
+ void init_gd(void)
+ {long j;

Copied and modified: head/lang/siod/files/patch-lib (from r565476, head/lang/siod/files/patch-slibu.c)
==============================================================================
--- head/lang/siod/files/patch-slibu.c	Wed Feb 17 02:30:18 2021	(r565476, copy source)
+++ head/lang/siod/files/patch-lib	Wed Feb 17 03:00:00 2021	(r565477)
@@ -1,7 +1,1616 @@
---- slibu.c.orig	Mon Dec  1 19:16:38 1997
-+++ slibu.c	Thu Jan  6 15:04:04 2000
-@@ -20,6 +20,10 @@
+--- siod.h	2014-03-25 04:10:42.000000000 -0400
++++ siod.h	2021-02-15 20:59:39.714149000 -0500
+@@ -20,5 +20,5 @@
+ 		struct obj * cdr;} cons;
+ 	struct {double data;} flonum;
+-	struct {char *pname;
++	struct {const char *pname;
+ 		struct obj * vcell;} symbol;
+ 	struct {char *name;
+@@ -41,5 +41,5 @@
+  	struct {char *name;
+  		struct obj * (*f)(struct obj **, struct obj **);} subrm;
+-	struct {char *name;
++	struct {const char *name;
+ 		struct obj * (*f)(void *,...);} subr;
+ 	struct {struct obj *env;
+@@ -151,5 +151,5 @@
+ struct gen_printio
+ {int (*putc_fcn)(int,void *);
+- int (*puts_fcn)(char *,void *);
++ int (*puts_fcn)(const char *, void *);
+  void *cb_argument;};
+ 
+@@ -160,10 +160,10 @@
+ 
+ struct repl_hooks
+-{void (*repl_puts)(char *);
++{void (*repl_puts)(const char *);
+  LISP (*repl_read)(void);
+  LISP (*repl_eval)(LISP);
+  void (*repl_print)(LISP);};
+ 
+-void __stdcall process_cla(int argc,char **argv,int warnflag);
++void __stdcall process_cla(int argc, const char **argv, int warnflag);
+ void __stdcall print_welcome(void);
+ void __stdcall print_hs_1(void);
+@@ -172,6 +172,6 @@
+ LISP get_eof_val(void);
+ long repl_driver(long want_sigint,long want_init,struct repl_hooks *);
+-void set_stdout_hooks(void (*puts_f)(char *));
+-void set_repl_hooks(void (*puts_f)(char *),
++void set_stdout_hooks(void (*puts_f)(const char *));
++void set_repl_hooks(void (*puts_f)(const char *),
+ 		    LISP (*read_f)(void),
+ 		    LISP (*eval_f)(LISP),
+@@ -180,7 +180,8 @@
+ LISP err(const char *message, LISP x);
+ LISP errswitch(void);
+-char *get_c_string(LISP x);
+-char *get_c_string_dim(LISP x,long *);
+-char *try_get_c_string(LISP x);
++void *get_string_data(LISP x);
++const char *get_c_string(LISP x);
++const char *get_c_string_dim(LISP x, long *);
++const char *try_get_c_string(LISP x);
+ long get_c_long(LISP x);
+ double get_c_double(LISP x);
+@@ -204,30 +205,30 @@
+ LISP eq(LISP x,LISP y);
+ LISP eql(LISP x,LISP y);
+-LISP symcons(char *pname,LISP vcell);
++LISP symcons(const char *pname, LISP vcell);
+ LISP symbolp(LISP x);
+ LISP symbol_boundp(LISP x,LISP env);
+ LISP symbol_value(LISP x,LISP env);
+-LISP cintern(char *name);
+-LISP rintern(char *name);
+-LISP subrcons(long type, char *name, SUBR_FUNC f);
++LISP cintern(const char *name);
++LISP rintern(const char *name);
++LISP subrcons(long type, const char *name, SUBR_FUNC f);
+ LISP closure(LISP env,LISP code);
+ void gc_protect(LISP *location);
+ void gc_protect_n(LISP *location,long n);
+-void gc_protect_sym(LISP *location,char *st);
++void gc_protect_sym(LISP *location, const char *st);
+ 
+ void __stdcall init_storage(void);
+ void __stdcall init_slibu(void);
+ 
+-void init_subr(char *name, long type, SUBR_FUNC fcn);
+-void init_subr_0(char *name, LISP (*fcn)(void));
+-void init_subr_1(char *name, LISP (*fcn)(LISP));
+-void init_subr_2(char *name, LISP (*fcn)(LISP,LISP));
+-void init_subr_2n(char *name, LISP (*fcn)(LISP,LISP));
+-void init_subr_3(char *name, LISP (*fcn)(LISP,LISP,LISP));
+-void init_subr_4(char *name, LISP (*fcn)(LISP,LISP,LISP,LISP));
+-void init_subr_5(char *name, LISP (*fcn)(LISP,LISP,LISP,LISP,LISP));
+-void init_lsubr(char *name, LISP (*fcn)(LISP));
+-void init_fsubr(char *name, LISP (*fcn)(LISP,LISP));
+-void init_msubr(char *name, LISP (*fcn)(LISP *,LISP *));
++void init_subr(const char *name, long type, SUBR_FUNC fcn);
++void init_subr_0(const char *name, LISP (*fcn)(void));
++void init_subr_1(const char *name, LISP (*fcn)(LISP));
++void init_subr_2(const char *name, LISP (*fcn)(LISP, LISP));
++void init_subr_2n(const char *name, LISP (*fcn)(LISP, LISP));
++void init_subr_3(const char *name, LISP (*fcn)(LISP, LISP, LISP));
++void init_subr_4(const char *name, LISP (*fcn)(LISP, LISP, LISP, LISP));
++void init_subr_5(const char *name, LISP (*fcn)(LISP, LISP, LISP, LISP, LISP));
++void init_lsubr(const char *name, LISP (*fcn)(LISP));
++void init_fsubr(const char *name, LISP (*fcn)(LISP, LISP));
++void init_msubr(const char *name, LISP (*fcn)(LISP *, LISP *));
+ 
+ LISP assq(LISP x,LISP alist);
+@@ -256,5 +257,5 @@
+ 		    LISP (*fcn2)(char *,long, int *));
+ LISP apropos(LISP);
+-LISP vload(char *fname,long cflag,long rflag);
++LISP vload(const char *fname, long cflag, long rflag);
+ LISP load(LISP fname,LISP cflag,LISP rflag);
+ LISP require(LISP fname);
+@@ -293,5 +294,6 @@
+ void __stdcall init_trace(void);
+ long __stdcall repl_c_string(char *,long want_sigint,long want_init,long want_print);
+-char * __stdcall siod_version(void);
++long __stdcall repl_c_string01(const char *, long want_sigint, long want_init, long want_print);
++const char * __stdcall siod_version(void);
+ LISP nreverse(LISP);
+ LISP number2string(LISP,LISP,LISP,LISP);
+@@ -316,8 +318,8 @@
+ LISP lapply(LISP fcn,LISP args);
+ LISP mallocl(void *lplace,long size);
+-void gput_st(struct gen_printio *,char *);
+-void put_st(char *st);
++void gput_st(struct gen_printio *, const char *);
++void put_st(const char *st);
+ LISP listn(long n, ...);
+-char *must_malloc(unsigned long size);
++void *must_malloc(unsigned long size);
+ LISP lstrbreakup(LISP str,LISP lmarker);
+ LISP lstrunbreakup(LISP elems,LISP lmarker);
+@@ -356,5 +358,5 @@
+ 
+ 
+-LISP symalist(char *item,...);
++LISP symalist(const char *item, ...);
+ 
+ LISP encode_st_mode(LISP l);
+@@ -363,5 +365,5 @@
+ int __stdcall siod_main(int argc,char **argv, char **env);
+ void __stdcall siod_shuffle_args(int *pargc,char ***pargv);
+-void __stdcall siod_init(int argc,char **argv);
++void __stdcall siod_init(int argc, const char **argv);
+ 
+ #if defined(WIN32) && defined(_WINDOWS_)
+--- siodp.h	2014-03-25 04:10:42.000000000 -0400
++++ siodp.h	2021-02-15 14:47:39.214446000 -0500
+@@ -18,5 +18,5 @@
+ 
+ extern long siod_verbose_level;
+-extern char *siod_lib;
++extern const char *siod_lib;
+ extern long nointerrupt;
+ extern long interrupt_differed;
+@@ -81,7 +81,7 @@
+ 
+ #define STACK_CHECK(_ptr) \
+-  if (((char *) (_ptr)) < stack_limit_ptr) err_stack((char *) _ptr);
++  if (((char *) (_ptr)) < stack_limit_ptr) err_stack(_ptr);
+ 
+-void err_stack(char *);
++void err_stack(LISP *);
+ 
+ #if defined(VMS) && defined(VAX)
+@@ -95,9 +95,9 @@
+ void err_ctrl_c(void);
+ double myruntime(void);
+-void fput_st(FILE *f,char *st);
+-void put_st(char *st);
+-void grepl_puts(char *,void (*)(char *));
++void fput_st(FILE *f, const char *st);
++void put_st(const char *st);
++void grepl_puts(const char *, void (*)(const char *));
+ void gc_fatal_error(void);
+-LISP gen_intern(char *name,long copyp);
++LISP gen_intern(const char *name, long copyp);
+ void scan_registers(void);
+ void init_storage_1(void);
+@@ -136,5 +136,5 @@
+ LISP leval_quote(LISP args,LISP env);
+ LISP leval_tenv(LISP args,LISP env);
+-int flush_ws(struct gen_readio *f,char *eoferr);
++int flush_ws(struct gen_readio *f, const char *eoferr);
+ int f_getc(FILE *f);
+ void f_ungetc(int c, FILE *f);
+@@ -164,6 +164,6 @@
+ void file_gc_free(LISP ptr);
+ void file_prin1(LISP ptr,struct gen_printio *f);
+-LISP fopen_c(char *name,char *how);
+-LISP fopen_cg(FILE *(*)(const char *,const char *),char *,char *);
++LISP fopen_c(const char *name, const char *how);
++LISP fopen_cg(FILE *(*)(const char *, const char *), const char *, const char *);
+ LISP fopen_l(LISP name,LISP how);
+ LISP fclose_l(LISP p);
+--- slib.c	2014-03-25 04:40:18.000000000 -0400
++++ slib.c	2021-02-15 20:55:35.681648000 -0500
+@@ -77,8 +77,12 @@
  #include <errno.h>
+ 
++#if defined(HAVE_SYS_PARAM_H)
++#include <sys/param.h>
++#endif
++
+ #include "siod.h"
+ #include "siodp.h"
+ 
+-#ifdef linux
++#if defined(linux) || defined(BSD)
+ #define sprintf_s snprintf
+ #endif
+@@ -90,57 +94,57 @@
+ 	NIL);}
+ 
+-char * __stdcall siod_version(void)
++const char * __stdcall siod_version(void)
+ {return("3.6.2 12-MAY-07");}
+ 
+-long nheaps = 2;
+-LISP *heaps;
++static long nheaps = 2;
++static LISP *heaps;
+ LISP heap,heap_end,heap_org;
+-long heap_size = 5000;
+-long old_heap_used;
+-long gc_status_flag = 1;
+-char *init_file = (char *) NULL;
++static long heap_size = 5000;
++static long old_heap_used;
++static long gc_status_flag = 1;
++static const char *init_file = NULL;
+ char *tkbuffer = NULL;
+-long gc_kind_copying = 0;
+-long gc_cells_allocated = 0;
+-double gc_time_taken;
+-LISP *stack_start_ptr = NULL;
+-LISP freelist;
+-jmp_buf errjmp;
++static long gc_kind_copying = 0;
++static long gc_cells_allocated = 0;
++static double gc_time_taken;
++static LISP *stack_start_ptr = NULL;
++static LISP freelist;
++static jmp_buf errjmp;
+ long errjmp_ok = 0;
+ long nointerrupt = 1;
+ long interrupt_differed = 0;
+-LISP oblistvar = NIL;
++static LISP oblistvar = NIL;
+ LISP sym_t = NIL;
+-LISP eof_val = NIL;
+-LISP sym_errobj = NIL;
+-LISP sym_catchall = NIL;
+-LISP sym_progn = NIL;
+-LISP sym_lambda = NIL;
+-LISP sym_quote = NIL;
+-LISP sym_dot = NIL;
+-LISP sym_after_gc = NIL;
+-LISP sym_eval_history_ptr = NIL;
++static LISP eof_val = NIL;
++static LISP sym_errobj = NIL;
++static LISP sym_catchall = NIL;
++static LISP sym_progn = NIL;
++static LISP sym_lambda = NIL;
++static LISP sym_quote = NIL;
++static LISP sym_dot = NIL;
++static LISP sym_after_gc = NIL;
++static LISP sym_eval_history_ptr = NIL;
+ LISP unbound_marker = NIL;
+-LISP *obarray;
+-long obarray_dim = 100;
++static LISP *obarray;
++static long obarray_dim = 100;
+ struct catch_frame *catch_framep = (struct catch_frame *) NULL;
+-void (*repl_puts)(char *) = NULL;
+-LISP (*repl_read)(void) = NULL;
+-LISP (*repl_eval)(LISP) = NULL;
+-void (*repl_print)(LISP) = NULL;
+-void (*stdout_puts)(char *) = NULL;
+-LISP *inums;
+-long inums_dim = 256;
+-struct user_type_hooks *user_types = NULL;
+-long user_tc_next = tc_user_min;
+-struct gc_protected *protected_registers = NULL;
+-jmp_buf save_regs_gc_mark;
+-double gc_rt;
+-long gc_cells_collected;
+-char *user_ch_readm = "";
+-char *user_te_readm = "";
+-LISP (*user_readm)(int, struct gen_readio *) = NULL;
+-LISP (*user_readt)(char *,long, int *) = NULL;
+-void (*fatal_exit_hook)(void) = NULL;
++static void (*repl_puts)(const char *) = NULL;
++static LISP (*repl_read)(void) = NULL;
++static LISP (*repl_eval)(LISP) = NULL;
++static void (*repl_print)(LISP) = NULL;
++static void (*stdout_puts)(const char *) = NULL;
++static LISP *inums;
++static long inums_dim = 256;
++static struct user_type_hooks *user_types = NULL;
++static long user_tc_next = tc_user_min;
++static struct gc_protected *protected_registers = NULL;
++static jmp_buf save_regs_gc_mark;
++static double gc_rt;
++static long gc_cells_collected;
++static const char *user_ch_readm = "";
++static const char *user_te_readm = "";
++static LISP (*user_readm)(int, struct gen_readio *) = NULL;
++static LISP (*user_readt)(char *, long, int *) = NULL;
++static void (*fatal_exit_hook)(void) = NULL;
+ #ifdef THINK_C
+ int ipoll_counter = 0;
+@@ -148,5 +152,5 @@
+ 
+ char *stack_limit_ptr = NULL;
+-long stack_size = 
++static long stack_size = 
+ #ifdef THINK_C
+   10000;
+@@ -170,10 +174,10 @@
+ #endif
+ 
+-char *siod_lib = SIOD_LIB_DEFAULT;
++const char *siod_lib = SIOD_LIB_DEFAULT;
+ 
+-void __stdcall process_cla(int argc,char **argv,int warnflag)
++void __stdcall process_cla(int argc, const char **argv, int warnflag)
+ {int k;
+  char *ptr;
+- static siod_lib_set = 0;
++ static int siod_lib_set = 0;
+  char msgbuff[256];
+ #if !defined(vms)
+@@ -288,5 +292,5 @@
+  return(x);}
+ 
+-void handle_sigfpe(int sig SIG_restargs)
++void handle_sigfpe(int sig SIG_restargs __unused)
+ {
+ #ifdef WIN32
+@@ -296,5 +300,5 @@
+  err("floating point exception",NIL);}
+ 
+-void handle_sigint(int sig SIG_restargs)
++void handle_sigint(int sig SIG_restargs __unused)
+ {signal(SIGINT,handle_sigint);
+ #if defined(WIN32)
+@@ -364,12 +368,12 @@
+  return(rv);}
+ 
+-static void ignore_puts(char *st)
++static void ignore_puts(const char *st __unused)
+ {}
+ 
+-static void noprompt_puts(char *st)
++static void noprompt_puts(const char *st)
+ {if (strcmp(st,"> ") != 0)
+    put_st(st);}
+ 
+-static char *repl_c_string_arg = NULL;
++static const char *repl_c_string_arg = NULL;
+ static char *repl_c_string_out = NULL;
+ static long repl_c_string_flag = 0;
+@@ -386,5 +390,5 @@
+  return(read_from_string(s));}
+ 
+-static void ignore_print(LISP x)
++static void ignore_print(LISP x __unused)
+ {repl_c_string_flag = 1;}
+ 
+@@ -397,5 +401,5 @@
+  char *end;};
+ 
+-static int rcsp_puts(char *from,void *cb)
++static int rcsp_puts(const char *from, void *cb)
+ {long fromlen,intolen,cplen;
+  struct rcsp_puts *p = (struct rcsp_puts *) cb;
+@@ -421,16 +425,11 @@
+  repl_c_string_flag = 1;}
+ 
+-long __stdcall repl_c_string(char *str,
+-		   long want_sigint,long want_init,long want_print)
++long __stdcall repl_c_string01(const char *str,
++		   long want_sigint, long want_init, long want_print)
+ {struct repl_hooks h;
+  long retval;
+  h.repl_read = repl_c_string_read;
+  h.repl_eval = NULL;
+- if (want_print > 1)
+-   {h.repl_puts = ignore_puts;
+-    h.repl_print = repl_c_string_print;
+-    repl_c_string_print_len = want_print;
+-    repl_c_string_out = str;}
+- else if (want_print)
++ if (want_print)
+    {h.repl_puts = noprompt_puts;
+     h.repl_print = not_ignore_print;
+@@ -452,4 +451,25 @@
+   return(2);}
+ 
++long __stdcall repl_c_string(char *str,
++		   long want_sigint, long want_init, long want_print)
++{struct repl_hooks h;
++ long retval;
++ h.repl_read = repl_c_string_read;
++ h.repl_eval = NULL;
++
++ h.repl_puts = ignore_puts;
++ h.repl_print = repl_c_string_print;
++ repl_c_string_print_len = want_print;
++ repl_c_string_out = str;
++ repl_c_string_arg = str;
++ repl_c_string_flag = 0;
++ retval = repl_driver(want_sigint, want_init, &h);
++ if (retval != 0)
++   return(retval);
++ else if (repl_c_string_flag == 1)
++   return(0);
++ else
++  return(2);}
++
+ #ifdef unix
+ #include <sys/types.h>
+@@ -511,11 +531,11 @@
+ #endif

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***


More information about the svn-ports-all mailing list