PING:
The bison accepts the option, --header-file=whatever.h
"ylwrap" is a wrapper script meant to canonicalize the invocation
of yacc and bison. True enough, if you use --header-file you
had better be using bison, but here is the problem:
I am working on a project that will only build in a GNU tools environment.
Therefore, I know that the .l -> .c transformation tool is flex, not
POSIX lex. The code I am working with presumes that it can use this:
AM_LFLAGS = @LEX_FL@ --header-file=$(LEX_HEADER) -DYY_NO_INPUT=1
So ylwrap fires off the flex program and it runs just fine, the tiny
problem is that it also removes the temporary directory before I can
salvage the generated header. This is inconvenient.
So is this:
diff --git a/bootstrap.sh b/bootstrap.sh
index ec3e89b..d8f24f5 100755
--- a/bootstrap.sh
+++ b/bootstrap.sh
@@ -1 +1,20 @@
-autoreconf --install --force
\ No newline at end of file
+autoreconf --install --force
+
+if test -f ylwrap
+then
+ # ylwrap does not preserve the --header-file output.
+ # Help it out.
+ #
+ txt=$(sed 's/$/\\/;$s/.$//' <<- \_EOF_
+
+ set X *.h
+ case "$2" in
+ y?tab.h | '*.h' ) : ;;
+ * ) mv "$2" .. ;;
+ esac
+ _EOF_
+ )
+
+ sed -i "/# Remove the directory/a${txt}" ylwrap
+else :
+fi