diff options
author | Tom Tromey <tromey@redhat.com> | 1998-03-21 05:57:11 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 1998-03-21 05:57:11 +0000 |
commit | de473fa8d72d9d24ba746843ae22d45895cf160a (patch) | |
tree | f46befd1571006103e0c3fa7e329917330291cb9 /lib/missing | |
parent | cccfb856ef0143c17d56f8de7ae6aaf79d245e1c (diff) | |
download | automake-de473fa8d72d9d24ba746843ae22d45895cf160a.tar.gz |
lex fixes for hpux from alexandre oliva
Diffstat (limited to 'lib/missing')
-rwxr-xr-x | lib/missing | 52 |
1 files changed, 49 insertions, 3 deletions
diff --git a/lib/missing b/lib/missing index 79a3e4ed6..cbe2b0ef0 100755 --- a/lib/missing +++ b/lib/missing @@ -41,9 +41,11 @@ Supported PROGRAM values: autoconf touch file \`configure' autoheader touch file \`config.h.in' automake touch all \`Makefile.in' files - bison touch file \`y.tab.c' + bison create \`y.tab.[ch]', if possible, from existing .[ch] + flex create \`lex.yy.c', if possible, from existing .c + lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file - yacc touch file \`y.tab.c'" + yacc create \`y.tab.[ch]', if possible, from existing .[ch]" ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) @@ -108,7 +110,51 @@ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." - touch y.tab.c + rm -f y.tab.c y.tab.h + if [ $# -ne 1 ]; then + eval LASTARG="\${$#}" + case "$LASTARG" in + *.y) + SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" y.tab.c + fi + SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" y.tab.h + fi + ;; + esac + fi + if [ ! -f y.tab.h ]; then + echo >y.tab.h + fi + if [ ! -f y.tab.c ]; then + echo 'main() { return 0; }' >y.tab.c + fi + ;; + + lex|flex) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified a \`.l' file. You may need the \`Flex' package + in order for those modifications to take effect. You can get + \`Flex' from any GNU archive site." + rm -f lex.yy.c + if [ $# -ne 1 ]; then + eval LASTARG="\${$#}" + case "$LASTARG" in + *.l) + SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" lex.yy.c + fi + ;; + esac + fi + if [ ! -f lex.yy.c ]; then + echo 'main() { return 0; }' >lex.yy.c + fi ;; makeinfo) |