Skip to content

Commit 2c716ea

Browse files
committed
Merge remote-tracking branch 'upstream/master' into es-main
2 parents 2a11f1f + cc6937f commit 2c716ea

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+3294
-1174
lines changed

.circleci/config.yml

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,50 @@ jobs:
2121
2222
- run:
2323
name: Configure
24-
command: ./configure --with-readline
24+
command: ./configure --enable-strict --with-readline
2525

2626
- run:
2727
name: Build
28-
command: make 'ADDCFLAGS=-DGCDEBUG=1 -DREF_ASSERTIONS=1'
28+
command: make
29+
30+
- run:
31+
name: Build test helper
32+
command: make testrun
33+
34+
- persist_to_workspace:
35+
root: .
36+
paths:
37+
- es
38+
- testrun
39+
40+
test:
41+
docker:
42+
- image: cimg/base:stable
43+
44+
steps:
45+
- checkout
46+
47+
- attach_workspace:
48+
at: .
2949

3050
- run:
3151
name: Test
32-
command: make trip
52+
command: |
53+
mkdir -p ./test/results
54+
./es -ps < ./test/test.es --junit ./test/tests/* > ./test/results/results.xml
55+
56+
- store_artifacts:
57+
path: ./test/results/
58+
59+
- store_test_results:
60+
path: ./test/results/
61+
62+
63+
workflows:
64+
version: 2
65+
build_and_test:
66+
jobs:
67+
- build
68+
- test:
69+
requires:
70+
- build

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
trip.es diff -a
1+
test/tests/trip.es text diff

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ autom4te.cache
2121
/missing
2222
/stamp-h1
2323
/ltmain.sh
24+
/m4/libtool.m4
25+
/m4/ltoptions.m4
26+
/m4/ltsugar.m4
27+
/m4/ltversion.m4
28+
/m4/lt~obsolete.m4
29+
/config.h.in~
30+
/configure~
2431

2532
Makefile
2633
config.h
@@ -36,3 +43,4 @@ sigmsgs.c
3643
token.h
3744
es
3845
esdump
46+
testrun

INSTALL

Lines changed: 31 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
Basic Installation
22
------------------
33

4-
Es now uses the GNU configure system for configuration. This
5-
means that on nearly all platforms, it should just build and work
6-
fine. To do this, just type:
4+
Es uses the GNU configure system for configuration. This means that
5+
on nearly all platforms, it should just build and work fine. To do
6+
this, just type:
77

88
% ./configure
99
% make
@@ -22,7 +22,7 @@ we ask libtoolize to do the work.
2222
Es needs an ANSI compiler (or at least a compiler that respects
2323
protoypes and provides large portions of the ANSI library).
2424
Otherwise it should build with the basic tools available on most UNIX
25-
platforms.
25+
platforms. Es expects a POSIX.1-2001 compliant OS and C library.
2626

2727
Es obeys the GNU configure convention of allowing you to build in
2828
a directory different from the source directory. To do this, just
@@ -33,30 +33,44 @@ execute configure with a path to the source. For example:
3333
Also obeying the GNU configure convention, configure will take
3434
arguments specifying a variety of directories. Currently the only
3535
relevant ones are the prefix directory (/usr/local by default); bindir,
36-
the directory in which `es' will reside ($prefix/bin by default); and
36+
the directory in which `es' will reside ($prefix/bin by default);
3737
mandir, the directory that will contain the manpage ($prefix/man by
38-
default). These are given to configure by:
38+
default); and datadir, the directory that will contain the es script
39+
library ($prefix/share by default). These are given to configure by:
3940

4041
% ./configure --prefix=directory
4142
% ./configure --bindir=directory --mandir=directory
4243

43-
Similarly, setting the `CC', `CFLAGS', and `LDFLAGS' environmental
44+
Similarly, setting the `CC', `CFLAGS', and `LDFLAGS' environment
4445
variables will cause those to be used in the Makefile.
4546

4647
Es Options
4748
----------
4849

49-
Es can be built to link to two command line editing libraries:
50-
GNU readline and editline. For information about obtaining these, see
51-
the README file. These may used by providing, respectively, the
52-
--with-readline or --with-editline respectively. Readline is currently
53-
enabled by deafult.
50+
Es can be built to link with GNU readline. Readline may be used by
51+
providing the --with-readline flag to ./configure. By default, readline
52+
is enabled if autoconf is able to find a working readline present on the
53+
system; to manually disable it, ./configure --without-readline.
5454

5555
Problems with building
5656
----------------------
5757

58-
The HP-UX yacc program seems to dislike the use of LOCAL in
59-
parse.y. It is not clear to me why this is the case. FSF's bison works
60-
fine. This has not been `fixed' because it is not clear what is
61-
`broken'. This may also be other dependencies that I do not
62-
understand.
58+
OpenBSD requires some additional hoop-jumping to build from source.
59+
A recently successful installation required the following commands
60+
before ./configure. Note that your locally installed autotool versions
61+
may differ.
62+
63+
% libtoolize -qi
64+
% AUTOMAKE_VERSION=1.16 AUTOCONF_VERSION=2.71 autoreconf
65+
66+
In addition, OpenBSD has, by default, a very old version of readline
67+
installed, with which ./configure will detect and attempt to link. To
68+
use the more up-to-date readline library available, the following is
69+
required:
70+
71+
% doas pkg_add readline # your exact command may differ
72+
% ./configure \
73+
--mandir=/usr/local/man \
74+
--with-readline \
75+
READLINE_CFLAGS=-I/usr/local/include/ereadline \
76+
READLINE_LIBS='-L/usr/local/lib -lereadline'

Makefile.in

Lines changed: 72 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -26,38 +26,40 @@
2626
# to get definitions of all signals from <sys/signal.h>.
2727
# _POSIX_SOURCE, _XOPEN_SOURCE are the obvious ones.
2828

29-
datarootdir = @datarootdir@
3029
prefix = @prefix@
30+
datarootdir = @datarootdir@
31+
datadir = @datadir@
3132
exec_prefix = @exec_prefix@
3233
mandir = @mandir@
3334
bindir = @bindir@
3435
srcdir = @srcdir@
36+
testdir = @srcdir@/test
37+
38+
VPATH = $(srcdir)
3539

3640

3741
SHELL = /bin/sh
3842
CC = @CC@
43+
YACC = @YACC@
3944
INSTALL = @INSTALL@
45+
INSTALL_PROGRAM = $(INSTALL)
46+
INSTALL_DATA = $(INSTALL) -m 644
4047
MKDIR_P = @MKDIR_P@
4148

4249

43-
## Bison is generating incorrect parsers. So do not use, for now
44-
# YACC = @YACC@
45-
46-
CFLAGS = $(ADDCFLAGS) -I. -I$(srcdir) -W -Wall -Wno-implicit-fallthrough -Wno-cast-function-type -Wno-missing-field-initializers -Wno-unused-parameter -Wno-clobbered @CFLAGS@
47-
LDFLAGS = $(ADDLDFLAGS) @LDFLAGS@
48-
LIBS = $(ADDLIBS) @LIBS@
49-
50-
VPATH = $(srcdir)
50+
CFLAGS = @STRICT_CFLAGS@ -I. -I$(srcdir) -W -Wall @READLINE_CFLAGS@ @CFLAGS@ $(ADDCFLAGS)
51+
LDFLAGS = @LDFLAGS@ $(ADDLDFLAGS)
52+
LIBS = @READLINE_LIBS@ @LIBS@ $(ADDLIBS)
5153

5254
HFILES = config.h es.h gc.h input.h prim.h print.h sigmsgs.h \
5355
stdenv.h syntax.h term.h var.h
5456
CFILES = access.c closure.c conv.c dict.c eval.c except.c fd.c gc.c glob.c \
55-
glom.c input.c heredoc.c list.c main.c match.c open.c \
57+
glom.c input.c heredoc.c history.c list.c main.c match.c open.c \
5658
prim-ctl.c prim-etc.c prim-io.c prim-sys.c prim-dump.c prim.c print.c proc.c \
5759
sigmsgs.c signal.c split.c status.c str.c syntax.c term.c token.c \
5860
tree.c util.c var.c vec.c version.c y.tab.c dump.c
5961
OFILES = access.o closure.o conv.o dict.o eval.o except.o fd.o gc.o glob.o \
60-
glom.o input.o heredoc.o list.o main.o match.o open.o \
62+
glom.o input.o heredoc.o history.o list.o main.o match.o open.o \
6163
prim-ctl.o prim-etc.o prim-io.o prim-sys.o prim-dump.o prim.o print.o proc.o \
6264
sigmsgs.o signal.o split.o status.o str.o syntax.o term.o token.o \
6365
tree.o util.o var.o vec.o version.o y.tab.o
@@ -66,38 +68,46 @@ GEN = esdump y.tab.c y.tab.h y.output token.h sigmsgs.c initial.c
6668

6769
SIGFILES = @SIGFILES@
6870

69-
es : ${OFILES} initial.o
70-
${CC} -o es ${LDFLAGS} ${OFILES} initial.o ${LIBS}
71+
es : $(OFILES) initial.o
72+
$(CC) -o es $(LDFLAGS) $(OFILES) initial.o $(LIBS)
7173

72-
esdump : ${OFILES} dump.o
73-
${CC} -o esdump ${LDFLAGS} ${OFILES} dump.o ${LIBS}
74+
esdump : $(OFILES) dump.o
75+
$(CC) -o esdump $(LDFLAGS) $(OFILES) dump.o $(LIBS)
7476

7577
clean :
76-
rm -f es ${OFILES} ${GEN} dump.o initial.o
78+
rm -f es $(OFILES) $(GEN) dump.o initial.o
7779

78-
distclean: clean
80+
distclean: clean testclean
7981
rm -f config.cache config.log config.h Makefile cscope.out tags TAGS core cs.out config.status ltmain.sh
80-
rm -rf autom4te.cache
82+
rm -rf autom4te.cache
8183

8284
MANIFEST:
8385
find . -type f | sed s/..// > MANIFEST
8486

8587
install : es
8688
$(MKDIR_P) $(DESTDIR)$(bindir)
87-
$(INSTALL) -s $(srcdir)/es $(DESTDIR)$(bindir)
89+
$(INSTALL_PROGRAM) -s es $(DESTDIR)$(bindir)
8890
$(MKDIR_P) $(DESTDIR)$(mandir)/man1
89-
$(INSTALL) $(srcdir)/doc/es.1 $(DESTDIR)$(mandir)/man1
91+
$(INSTALL_DATA) $(srcdir)/doc/es.1 $(DESTDIR)$(mandir)/man1
92+
$(MKDIR_P) $(DESTDIR)$(datadir)/es
93+
$(INSTALL_DATA) $(srcdir)/share/* $(DESTDIR)$(datadir)/es
9094

91-
test : trip
95+
testrun : $(testdir)/testrun.c
96+
$(CC) -o testrun $(testdir)/testrun.c
9297

93-
trip : es $(srcdir)/trip.es
94-
./es < $(srcdir)/trip.es
98+
test : es testrun $(testdir)/test.es
99+
./es -ps < $(testdir)/test.es $(testdir)/tests/*
100+
101+
testclean :
102+
rm -f testrun
95103

96104
src :
97-
@echo ${OTHER} ${CFILES} ${HFILES}
105+
@echo $(OTHER) $(CFILES) $(HFILES)
106+
107+
y.tab.h : parse.y
108+
$(YACC) -vd $(srcdir)/parse.y
98109

99-
y.tab.c y.tab.h : parse.y
100-
${YACC} -vd $(srcdir)/parse.y
110+
y.tab.c : y.tab.h
101111

102112
token.h : y.tab.h
103113
-cmp -s y.tab.h token.h || cp y.tab.h token.h
@@ -114,39 +124,39 @@ config.h : config.h.in
114124

115125
# --- dependencies ---
116126

117-
access.o : access.c es.h config.h stdenv.h prim.h
118-
closure.o : closure.c es.h config.h stdenv.h gc.h
119-
conv.o : conv.c es.h config.h stdenv.h print.h
120-
dict.o : dict.c es.h config.h stdenv.h gc.h
121-
eval.o : eval.c es.h config.h stdenv.h
122-
except.o : except.c es.h config.h stdenv.h print.h
123-
fd.o : fd.c es.h config.h stdenv.h
124-
gc.o : gc.c es.h config.h stdenv.h gc.h
125-
glob.o : glob.c es.h config.h stdenv.h gc.h
126-
glom.o : glom.c es.h config.h stdenv.h gc.h
127-
input.o : input.c es.h config.h stdenv.h input.h
128-
heredoc.o : heredoc.c es.h config.h stdenv.h gc.h input.h syntax.h
129-
list.o : list.c es.h config.h stdenv.h gc.h
130-
main.o : main.c es.h config.h stdenv.h
131-
match.o : match.c es.h config.h stdenv.h
132-
open.o : open.c es.h config.h stdenv.h
133-
prim.o : prim.c es.h config.h stdenv.h prim.h
134-
prim-ctl.o : prim-ctl.c es.h config.h stdenv.h prim.h
135-
prim-etc.o : prim-etc.c es.h config.h stdenv.h prim.h
136-
prim-io.o : prim-io.c es.h config.h stdenv.h gc.h prim.h
137-
prim-sys.o : prim-sys.c es.h config.h stdenv.h prim.h
138-
prim-dump.o : prim-dump.c es.h config.h stdenv.h prim.h
139-
print.o : print.c es.h config.h stdenv.h print.h
140-
proc.o : proc.c es.h config.h stdenv.h prim.h
141-
signal.o : signal.c es.h config.h stdenv.h sigmsgs.h
142-
split.o : split.c es.h config.h stdenv.h gc.h
143-
status.o : status.c es.h config.h stdenv.h term.h
144-
str.o : str.c es.h config.h stdenv.h gc.h print.h
145-
syntax.o : syntax.c es.h config.h stdenv.h input.h syntax.h token.h
146-
term.o : term.c es.h config.h stdenv.h gc.h term.h
147-
token.o : token.c es.h config.h stdenv.h input.h syntax.h token.h
148-
tree.o : tree.c es.h config.h stdenv.h gc.h
149-
util.o : util.c es.h config.h stdenv.h
150-
var.o : var.c es.h config.h stdenv.h gc.h var.h term.h
151-
vec.o : vec.c es.h config.h stdenv.h gc.h
152-
version.o : version.c es.h config.h stdenv.h
127+
access.o : access.c es.h config.h stdenv.h prim.h
128+
closure.o : closure.c es.h config.h stdenv.h gc.h
129+
conv.o : conv.c es.h config.h stdenv.h print.h
130+
dict.o : dict.c es.h config.h stdenv.h gc.h
131+
eval.o : eval.c es.h config.h stdenv.h
132+
except.o : except.c es.h config.h stdenv.h print.h
133+
fd.o : fd.c es.h config.h stdenv.h
134+
gc.o : gc.c es.h config.h stdenv.h gc.h
135+
glob.o : glob.c es.h config.h stdenv.h gc.h
136+
glom.o : glom.c es.h config.h stdenv.h gc.h
137+
input.o : input.c es.h config.h stdenv.h input.h
138+
heredoc.o : heredoc.c es.h config.h stdenv.h gc.h input.h syntax.h
139+
history.o : history.c es.h config.h stdenv.h gc.h input.h
140+
list.o : list.c es.h config.h stdenv.h gc.h
141+
main.o : main.c es.h config.h stdenv.h
142+
match.o : match.c es.h config.h stdenv.h
143+
open.o : open.c es.h config.h stdenv.h
144+
prim.o : prim.c es.h config.h stdenv.h prim.h
145+
prim-ctl.o : prim-ctl.c es.h config.h stdenv.h prim.h
146+
prim-etc.o : prim-etc.c es.h config.h stdenv.h prim.h
147+
prim-io.o : prim-io.c es.h config.h stdenv.h gc.h prim.h
148+
prim-sys.o : prim-sys.c es.h config.h stdenv.h prim.h
149+
print.o : print.c es.h config.h stdenv.h print.h
150+
proc.o : proc.c es.h config.h stdenv.h prim.h
151+
signal.o : signal.c es.h config.h stdenv.h sigmsgs.h
152+
split.o : split.c es.h config.h stdenv.h gc.h
153+
status.o : status.c es.h config.h stdenv.h term.h
154+
str.o : str.c es.h config.h stdenv.h gc.h print.h
155+
syntax.o : syntax.c es.h config.h stdenv.h input.h syntax.h token.h
156+
term.o : term.c es.h config.h stdenv.h gc.h term.h
157+
token.o : token.c es.h config.h stdenv.h input.h syntax.h token.h
158+
tree.o : tree.c es.h config.h stdenv.h gc.h
159+
util.o : util.c es.h config.h stdenv.h
160+
var.o : var.c es.h config.h stdenv.h gc.h var.h term.h
161+
vec.o : vec.c es.h config.h stdenv.h gc.h
162+
version.o : version.c es.h config.h stdenv.h

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ but all of the relevant information is mirrored in the repository and/or
2424
the website:
2525

2626
http://www.github.com/wryun/es-shell
27-
http://wryun.github.com/es-shell
27+
http://wryun.github.io/es-shell
2828

2929
including the change history and the old mailing list archives.
3030

0 commit comments

Comments
 (0)