The lex Makefile says:
"To bootstrap lex, cp initscan.c to scan.c and run make."
On amd64-current this doesn't seem to build:
--------------------------------
[/usr/src/usr.bin/lex] cp initscan.c scan.c
[/usr/src/usr.bin/lex] make
yacc -d parse.y
mv y.tab.c parse.c
mv y.tab.h parse.h
cc -O2 -pipe -I. -I/usr/src/usr.bin/lex -c scan.c
scan.c:3136: error: static declaration of 'input' follows non-static
declaration
scan.l:411: error: previous implicit declaration of 'input' was here
*** Error code 1
Stop in /usr/src/usr.bin/lex (line 92 of /usr/share/mk/sys.mk).
--------------------------------
Possible fix below...
Index: initscan.c
===================================================================
RCS file: /cvs/src/usr.bin/lex/initscan.c,v
retrieving revision 1.13
diff -u -r1.13 initscan.c
--- initscan.c 26 Jan 2007 14:38:19 -0000 1.13
+++ initscan.c 5 Aug 2011 04:39:24 -0000
@@ -1362,7 +1362,7 @@
static int yy_flex_strlen YY_PROTO(( yyconst char * ));
#endif
-#if defined(YY_NO_INPUT) && YY_NO_INPUT
+#ifndef YY_NO_INPUT
#ifdef __cplusplus
static int yyinput YY_PROTO(( void ));
#else
@@ -3136,6 +3136,7 @@
#endif /* ifndef YY_NO_UNPUT */
+#ifndef YY_NO_INPUT
#ifdef __cplusplus
static int yyinput()
#else
@@ -3208,6 +3209,7 @@
return c;
}
+#endif /* ifndef YY_NO_INPUT */
#ifdef YY_USE_PROTOS