Build flex 2.5.14.
This commit is contained in:
parent
de9548dbff
commit
2b8394e1f5
|
@ -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.
|
||||
|
|
|
@ -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 \;
|
||||
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
src_prepare() {
|
||||
default_src_prepare
|
||||
|
||||
touch config.h
|
||||
rm parse.c parse.h scan.c
|
||||
}
|
|
@ -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
|
|
@ -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."
|
||||
|
|
Loading…
Reference in New Issue