head 1.3; access; symbols; locks; strict; comment @# @; 1.3 date 2020.08.03.00.43.12; author agc; state Exp; branches; next 1.2; commitid 1ifPocxJWEwrjyiC; 1.2 date 2018.01.17.01.38.37; author agc; state Exp; branches; next 1.1; commitid leQVXgIREIQntanA; 1.1 date 2013.05.31.05.56.38; author agc; state Exp; branches; next ; commitid nDg2ioUTUdn4iKRw; desc @@ 1.3 log @Make this compile with gcc 8.4.0 @ text @# $NetBSD: Makefile,v 1.2 2018/01/17 01:38:37 agc Exp $ .include DIST= ${.CURDIR}/../dist .PATH: ${DIST} LIB= eawk SRCS= awkgram.y b.c ext.c lex.c lib.c parse.c proctab.c run.c tran.c CPPFLAGS+= -I. -I${DIST} -DHAS_ISBLANK YFLAGS+= -p eawk_ -d CPPFLAGS.run.c+= -Wno-format-nonliteral CPPFLAGS.tran.c+= -Wno-format-nonliteral CPPFLAGS.lex.c+= -Wno-multistatement-macros #CPPFLAGS+= -DYYPARSE_PARAM_TYPE='void *' #CPPFLAGS+= -DYYPARSE_PARAM=awkp #CPPFLAGS+= -DYYLEX_PARAM=awkp MAN= libeawk.3 LDADD+= -lm DPADD+= ${LIBM} YHEADER= yes .if (defined(HAVE_GCC) && ${HAVE_GCC} == 4) || defined(HAVE_PCC) COPTS= -Wno-pointer-sign .endif WARNS=5 INCS= eawk.h INCSDIR= /usr/include .include @ 1.2 log @Bring eawk up to date, it's had no real love since 2013. 1. Don't use bison, just use standard yacc to build 2. Use pure-parser directive, rather than %pure_parser 3. libarchive has changed its API since 2013 - adapt 4. netpgpverify has also changed its API since 2013 - adapt also 5. There is no sqlite3 sub-directory, so don't descend into it With thanks to yukonbob for the nudge. @ text @d1 1 a1 1 # $NetBSD: Makefile,v 1.1 2013/05/31 05:56:38 agc Exp $ d14 1 @ 1.1 log @Re-do completely the way that external modules are loaded in eawk. For now, use a use("digest") style statement in the script to enable the bindings in a libeawk-digest.so to be loaded via dlopen(3). Also add readrec() and writerec() callbacks for use in embedded programs, so that eawk can really be deeply embedded in other things, and used as a command interpreter, etc. Other headline changes include: + added gawk-style bit arithmetic ops + added gawk-style asort/asorti + added eawk_readrec() and eawk_writerec() callbacks for use in embedded operations + added extension use via use() command + added extensions for base64 c circa db digests dirent getopt2 hmac http mat netdiff netpgp progress rs soundex termcap The upshot is that we can extend awk quite easily, as shown by this example script: % cat scripts/conn2.sh #! /bin/sh env LD_LIBRARY_PATH=lib:extend/c bin/eawk -v host=$1 ' BEGIN { use("c"); if (host == "") print "phooey#0"; addr["ai_family"] = PF_INET; if (getaddrinfo(host, "http", addr) != 0) print "phooey#1"; sd = socket(PF_INET, SOCK_STREAM, 0); if (connect(sd, addr["ai_addr"], addr["ai_addrlen"]) != 0) print "phooey#2"; s = sprintf("GET / HTTP/1.1\r\nHost: %s\r\nUser-Agent: eawk-2.1\r\n\r\n", host); write(sd, s, length(s)); url = read(sd, 4096); print url; close(sd); }' % sh scripts/conn2.sh www.netbsd.org HTTP/1.1 200 OK Date: Fri, 31 May 2013 05:49:44 GMT Server: Apache/2.2.24 (Unix) Last-Modified: Sun, 19 May 2013 17:44:20 GMT ETag: "83765-4fd9-4dd15c40bc500" Accept-Ranges: none Content-Length: 20441 Content-Type: text/html; charset=ISO-8859-1 The NetBSD Project