diff --git a/README.md b/README.md index 8d96bcf4..a98136eb 100644 --- a/README.md +++ b/README.md @@ -265,11 +265,13 @@ cope here. `m4` is the first piece of software we need in the autotools suite. It allows macros to be defined and files to be generated from those macros. -#### Part 20: flex 2.5.11 +#### Part 22: flex 2.5.11 `flex` is a tool for generating lexers or scanners: programs that recognize lexical patters. Unfortunately `flex` also depends on itself for compiling its own scanner, so first flex 2.5.11 is compiled, with its scanner definition manually modified so that it can be processed by lex for the Heirloom project (the required modifications are mostly syntactical, plus a few workarounds to avoid some flex advanced features). -Then we recompile `flex` using its own lexer. + +### Part 23 flex 2.5.14 +Then we recompile unpatched `flex` using its own lexer. diff --git a/rootfs.sh b/rootfs.sh index 5ebda989..89f2d022 100755 --- a/rootfs.sh +++ b/rootfs.sh @@ -132,6 +132,9 @@ get_file https://ftp.gnu.org/gnu/m4/m4-1.4.tar.gz # flex 2.5.11 get_file http://download.nust.na/pub2/openpkg1/sources/DST/flex/flex-2.5.11.tar.gz +# flex 2.5.14 +get_file http://download.nust.na/pub2/openpkg1/sources/DST/flex/flex-2.5.14.tar.gz + # General cleanup find tmp -name .git -exec rm -rf \; diff --git a/sysa/flex-2.5.14/flex-2.5.14.sh b/sysa/flex-2.5.14/flex-2.5.14.sh new file mode 100755 index 00000000..edf31deb --- /dev/null +++ b/sysa/flex-2.5.14/flex-2.5.14.sh @@ -0,0 +1,6 @@ +src_prepare() { + default_src_prepare + + touch config.h + rm parse.c parse.h scan.c +} diff --git a/sysa/flex-2.5.14/mk/main.mk b/sysa/flex-2.5.14/mk/main.mk new file mode 100644 index 00000000..caf85a22 --- /dev/null +++ b/sysa/flex-2.5.14/mk/main.mk @@ -0,0 +1,29 @@ +CFLAGS = -I . \ + -DVERSION=\"2.5.14\" + +all: flex + +flex: ccl.o dfa.o ecs.o gen.o main.o misc.o nfa.o parse.o scan.o skel.o sym.o tblcmp.o yylex.o options.o scanopt.o buf.o + tcc -o $@ $^ + +%.o: %.c + tcc -g -c $(CFLAGS) -o $@ $< + +scan.o: parse.h +yylex.o: parse.h + +parse.c parse.h: parse.y + yacc -d parse.y + mv y.tab.h parse.h + mv y.tab.c parse.c + +scan.c: scan.l + flex scan.l + mv lex.yy.c scan.c + +skel.c: mkskel.sh flex.skl + /bin/sh ./mkskel.sh ./flex.skl > skel.c + +install: all + install flex $(PREFIX)/bin + ln -sf $(PREFIX)/bin/flex $(PREFIX)/bin/lex diff --git a/sysa/flex-2.5.14/src/.placeholder b/sysa/flex-2.5.14/src/.placeholder new file mode 100644 index 00000000..e69de29b diff --git a/sysa/run.sh b/sysa/run.sh index d5ecd18f..579ab881 100755 --- a/sysa/run.sh +++ b/sysa/run.sh @@ -14,6 +14,8 @@ build m4-1.4 # Part 22 build flex-2.5.11 -build flex-2.5.11 + +# Part 23 +build flex-2.5.14 echo "Bootstrapping completed."