From b2bbb06ddee817dc3b3f3038911005a3b1f9e0e4 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Sat, 21 Mar 1998 05:56:30 +0000 Subject: [PATCH] lex fixes for hpux from alexandre oliva --- ChangeLog | 17 +++++++++++ Makefile.in | 77 ++++++++++++++++++++++++----------------------- automake.in | 16 ++++++++++ automake.texi | 6 ++++ lib/missing | 52 ++++++++++++++++++++++++++++++-- m4/Makefile.am | 6 ++-- m4/Makefile.in | 36 +++++++++++----------- m4/lex.m4 | 9 ++++++ missing | 52 ++++++++++++++++++++++++++++++-- tests/ChangeLog | 2 ++ tests/Makefile.am | 3 +- tests/Makefile.in | 23 +++++++------- tests/lex.test | 3 +- tests/lex2.test | 22 ++++++++++++++ 14 files changed, 245 insertions(+), 79 deletions(-) create mode 100644 m4/lex.m4 create mode 100755 tests/lex2.test diff --git a/ChangeLog b/ChangeLog index c832bbee..0ca49531 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,20 @@ +Fri Mar 20 22:42:30 1998 Tom Tromey + + * automake.in (scan_one_configure_file): Use &am_conf_line_error, + not warn. Check to make sure warnings happen only for + configure.in, not for "not aclocal.m4". + +Fri Mar 20 22:35:31 1998 Alexandre Oliva + + * automake.in: understand AM_PROG_LEX as a replacement for + AC_PROG_LEX and AC_DECL_YYTEXT + warn if the replaced macros are used. + * m4/Makefile.am: add lex.m4 + * m4/lex.m4 (AM_PROG_LEX): new file and macro + * missing: added lex/flex support + instead of touching flex and bison output files, try to copy + them from a filename based on the last given argument + Fri Mar 20 00:26:10 1998 Tom Tromey * m4/protos.m4: Require AC_PROG_CPP. diff --git a/Makefile.in b/Makefile.in index f85dd9a5..1cfaaee2 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated automatically by automake 1.2f from Makefile.am +# Makefile.in generated automatically by automake 1.2g from Makefile.am # Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation @@ -32,6 +32,8 @@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include +DISTDIR = + pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ @@ -109,14 +111,14 @@ stamp-vti texinfo.tex version.texi ylwrap DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) GZIP = --best -default: all +all: all-recursive all-am .SUFFIXES: .SUFFIXES: .dvi .info .ps .texi .texinfo .txi -$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --gnits Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) cd $(top_builddir) \ && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status @@ -134,40 +136,40 @@ aclocal: $(top_builddir)/config.status aclocal.in install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) - $(mkinstalldirs) $(bindir) + $(mkinstalldirs) $(DESTDIR)$(bindir) @list='$(bin_SCRIPTS)'; for p in $$list; do \ if test -f $$p; then \ - echo " $(INSTALL_SCRIPT) $$p $(bindir)/`echo $$p|sed '$(transform)'`"; \ - $(INSTALL_SCRIPT) $$p $(bindir)/`echo $$p|sed '$(transform)'`; \ + echo " $(INSTALL_SCRIPT) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`"; \ + $(INSTALL_SCRIPT) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \ else if test -f $(srcdir)/$$p; then \ - echo " $(INSTALL_SCRIPT) $(srcdir)/$$p $(bindir)/`echo $$p|sed '$(transform)'`"; \ - $(INSTALL_SCRIPT) $(srcdir)/$$p $(bindir)/`echo $$p|sed '$(transform)'`; \ + echo " $(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`"; \ + $(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \ else :; fi; fi; \ done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) list='$(bin_SCRIPTS)'; for p in $$list; do \ - rm -f $(bindir)/`echo $$p|sed '$(transform)'`; \ + rm -f $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \ done install-pkgdataSCRIPTS: $(pkgdata_SCRIPTS) @$(NORMAL_INSTALL) - $(mkinstalldirs) $(pkgdatadir) + $(mkinstalldirs) $(DESTDIR)$(pkgdatadir) @list='$(pkgdata_SCRIPTS)'; for p in $$list; do \ if test -f $$p; then \ - echo " $(INSTALL_SCRIPT) $$p $(pkgdatadir)/`echo $$p|sed '$(transform)'`"; \ - $(INSTALL_SCRIPT) $$p $(pkgdatadir)/`echo $$p|sed '$(transform)'`; \ + echo " $(INSTALL_SCRIPT) $$p $(DESTDIR)$(pkgdatadir)/`echo $$p|sed '$(transform)'`"; \ + $(INSTALL_SCRIPT) $$p $(DESTDIR)$(pkgdatadir)/`echo $$p|sed '$(transform)'`; \ else if test -f $(srcdir)/$$p; then \ - echo " $(INSTALL_SCRIPT) $(srcdir)/$$p $(pkgdatadir)/`echo $$p|sed '$(transform)'`"; \ - $(INSTALL_SCRIPT) $(srcdir)/$$p $(pkgdatadir)/`echo $$p|sed '$(transform)'`; \ + echo " $(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(pkgdatadir)/`echo $$p|sed '$(transform)'`"; \ + $(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(pkgdatadir)/`echo $$p|sed '$(transform)'`; \ else :; fi; fi; \ done uninstall-pkgdataSCRIPTS: @$(NORMAL_UNINSTALL) list='$(pkgdata_SCRIPTS)'; for p in $$list; do \ - rm -f $(pkgdatadir)/`echo $$p|sed '$(transform)'`; \ + rm -f $(DESTDIR)$(pkgdatadir)/`echo $$p|sed '$(transform)'`; \ done version.texi: stamp-vti @@ -245,21 +247,21 @@ DVIPS = dvips install-info-am: $(INFO_DEPS) @$(NORMAL_INSTALL) - $(mkinstalldirs) $(infodir) + $(mkinstalldirs) $(DESTDIR)$(infodir) @for file in $(INFO_DEPS); do \ d=$(srcdir); \ for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \ if test -f $$d/$$ifile; then \ - echo " $(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile"; \ - $(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile; \ + echo " $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile"; \ + $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile; \ else : ; fi; \ done; \ done @$(POST_INSTALL) @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \ for file in $(INFO_DEPS); do \ - echo " install-info --info-dir=$(infodir) $(infodir)/$$file";\ - install-info --info-dir=$(infodir) $(infodir)/$$file || :;\ + echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file";\ + install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file || :;\ done; \ else : ; fi @@ -270,11 +272,11 @@ uninstall-info: else ii=; fi; \ for file in $(INFO_DEPS); do \ test -z "$ii" \ - || install-info --info-dir=$(infodir) --remove $$file; \ + || install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; \ done @$(NORMAL_UNINSTALL) for file in $(INFO_DEPS); do \ - (cd $(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \ + (cd $(DESTDIR)$(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \ done dist-info: $(INFO_DEPS) @@ -308,21 +310,21 @@ maintainer-clean-aminfo: install-pkgdataDATA: $(pkgdata_DATA) @$(NORMAL_INSTALL) - $(mkinstalldirs) $(pkgdatadir) + $(mkinstalldirs) $(DESTDIR)$(pkgdatadir) @list='$(pkgdata_DATA)'; for p in $$list; do \ if test -f $(srcdir)/$$p; then \ - echo " $(INSTALL_DATA) $(srcdir)/$$p $(pkgdatadir)/$$p"; \ - $(INSTALL_DATA) $(srcdir)/$$p $(pkgdatadir)/$$p; \ + echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(pkgdatadir)/$$p"; \ + $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(pkgdatadir)/$$p; \ else if test -f $$p; then \ - echo " $(INSTALL_DATA) $$p $(pkgdatadir)/$$p"; \ - $(INSTALL_DATA) $$p $(pkgdatadir)/$$p; \ + echo " $(INSTALL_DATA) $$p $(DESTDIR)$(pkgdatadir)/$$p"; \ + $(INSTALL_DATA) $$p $(DESTDIR)$(pkgdatadir)/$$p; \ fi; fi; \ done uninstall-pkgdataDATA: @$(NORMAL_UNINSTALL) list='$(pkgdata_DATA)'; for p in $$list; do \ - rm -f $(pkgdatadir)/$$p; \ + rm -f $(DESTDIR)$(pkgdatadir)/$$p; \ done # This directory's subdirectories are mostly independent; you can cd @@ -474,12 +476,11 @@ install: install-recursive install-exec-am install-data-am uninstall: uninstall-recursive uninstall-am -all: all-recursive all-am - install-strip: $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install installdirs: installdirs-recursive - $(mkinstalldirs) $(bindir) $(pkgdatadir) $(infodir) $(pkgdatadir) + $(mkinstalldirs) $(DATADIR)$(bindir) $(DATADIR)$(pkgdatadir) \ + $(DESTDIR)$(infodir) $(DATADIR)$(pkgdatadir) mostlyclean-generic: @@ -521,12 +522,12 @@ maintainer-clean: maintainer-clean-recursive maintainer-clean-am @echo "it deletes files that may require special tools to rebuild." -rm -f config.status -.PHONY: default uninstall-binSCRIPTS install-binSCRIPTS \ -uninstall-pkgdataSCRIPTS install-pkgdataSCRIPTS mostlyclean-vti \ -distclean-vti clean-vti maintainer-clean-vti install-info-am \ -uninstall-info mostlyclean-aminfo distclean-aminfo clean-aminfo \ -maintainer-clean-aminfo uninstall-pkgdataDATA install-pkgdataDATA \ -install-data-recursive uninstall-data-recursive install-exec-recursive \ +.PHONY: uninstall-binSCRIPTS install-binSCRIPTS uninstall-pkgdataSCRIPTS \ +install-pkgdataSCRIPTS mostlyclean-vti distclean-vti clean-vti \ +maintainer-clean-vti install-info-am uninstall-info mostlyclean-aminfo \ +distclean-aminfo clean-aminfo maintainer-clean-aminfo \ +uninstall-pkgdataDATA install-pkgdataDATA install-data-recursive \ +uninstall-data-recursive install-exec-recursive \ uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \ all-recursive check-recursive installcheck-recursive info-recursive \ dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \ diff --git a/automake.in b/automake.in index 7f46507e..aec2b2f0 100755 --- a/automake.in +++ b/automake.in @@ -4217,6 +4217,22 @@ sub scan_one_configure_file $seen_make_set = 1 if /AC_PROG_MAKE_SET/; $seen_arg_prog = 1 if /AC_ARG_PROGRAM/; + if (/AM_PROG_LEX/) + { + $configure_vars{'LEX'} = 1; + $seen_decl_yytext = 1; + } + if (/AC_DECL_YYTEXT/ && $filename =~ /configure\.in$/) + { + &am_conf_line_error ($filename, $., + "\`AC_DECL_YYTEXT' is obsolete; use \`AM_PROG_LEX'"); + } + if (/AC_PROG_LEX/ && $filename =~ /configure\.in$/) + { + &am_conf_line_error ($filename, $., + "\`AC_PROG_LEX' is obsolete; use \`AM_PROG_LEX'"); + } + if (/AC_PROG_(YACC|RANLIB|CC|CXXCPP|CXX|LEX|AWK|CPP|LN_S)/) { $configure_vars{$1} = 1; diff --git a/automake.texi b/automake.texi index 5c9bd2cf..30d1e187 100644 --- a/automake.texi +++ b/automake.texi @@ -1158,6 +1158,12 @@ code in ANSI C, you can make an un-ANSIfied copy of it by using the Like @code{AC_PROG_INSTALL}, but also defines @code{INSTALL_SCRIPT}. @cvindex AM_PROG_INSTALL +@item AM_PROG_LEX +Like @code{AC_PROG_LEX} with @code{AC_DECL_YYTEXT}, but uses the +@code{missing} script on systems that do not have lex. @samp{HP-UX 10} +is one such system. +@cvindex AM_PROG_LEX + @item AM_SANITY_CHECK This checks to make sure that a file created in the build directory is newer than a file in the source directory. This can fail on systems diff --git a/lib/missing b/lib/missing index 79a3e4ed..cbe2b0ef 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) diff --git a/m4/Makefile.am b/m4/Makefile.am index 4f7edf3d..baa6d5a0 100644 --- a/m4/Makefile.am +++ b/m4/Makefile.am @@ -5,8 +5,8 @@ MAINT_CHARSET = latin1 m4datadir = $(datadir)/aclocal m4data_DATA = ccstdc.m4 cond.m4 cygwin.m4 dmalloc.m4 exeext.m4 init.m4 \ -install.m4 lispdir.m4 maintainer.m4 mingw.m4 protos.m4 ptrdiff.m4 \ -regex.m4 strtod.m4 termios.m4 winsz.m4 mktime.m4 error.m4 obstack.m4 \ -sanity.m4 header.m4 missing.m4 +install.m4 lex.m4 lispdir.m4 maintainer.m4 mingw.m4 protos.m4 \ +ptrdiff.m4 regex.m4 strtod.m4 termios.m4 winsz.m4 mktime.m4 error.m4 \ +obstack.m4 sanity.m4 header.m4 missing.m4 EXTRA_DIST = $(m4data_DATA) diff --git a/m4/Makefile.in b/m4/Makefile.in index 73b2d0ac..17735d99 100644 --- a/m4/Makefile.in +++ b/m4/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated automatically by automake 1.2f from Makefile.am +# Makefile.in generated automatically by automake 1.2g from Makefile.am # Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation @@ -32,6 +32,8 @@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include +DISTDIR = + pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ @@ -66,9 +68,9 @@ MAINT_CHARSET = latin1 m4datadir = $(datadir)/aclocal m4data_DATA = ccstdc.m4 cond.m4 cygwin.m4 dmalloc.m4 exeext.m4 init.m4 \ -install.m4 lispdir.m4 maintainer.m4 mingw.m4 protos.m4 ptrdiff.m4 \ -regex.m4 strtod.m4 termios.m4 winsz.m4 mktime.m4 error.m4 obstack.m4 \ -sanity.m4 header.m4 missing.m4 +install.m4 lex.m4 lispdir.m4 maintainer.m4 mingw.m4 protos.m4 \ +ptrdiff.m4 regex.m4 strtod.m4 termios.m4 winsz.m4 mktime.m4 error.m4 \ +obstack.m4 sanity.m4 header.m4 missing.m4 EXTRA_DIST = $(m4data_DATA) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs @@ -81,34 +83,34 @@ DIST_COMMON = Makefile.am Makefile.in DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) GZIP = --best -default: all +all: Makefile $(DATA) .SUFFIXES: -$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --gnits m4/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status install-m4dataDATA: $(m4data_DATA) @$(NORMAL_INSTALL) - $(mkinstalldirs) $(m4datadir) + $(mkinstalldirs) $(DESTDIR)$(m4datadir) @list='$(m4data_DATA)'; for p in $$list; do \ if test -f $(srcdir)/$$p; then \ - echo " $(INSTALL_DATA) $(srcdir)/$$p $(m4datadir)/$$p"; \ - $(INSTALL_DATA) $(srcdir)/$$p $(m4datadir)/$$p; \ + echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(m4datadir)/$$p"; \ + $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(m4datadir)/$$p; \ else if test -f $$p; then \ - echo " $(INSTALL_DATA) $$p $(m4datadir)/$$p"; \ - $(INSTALL_DATA) $$p $(m4datadir)/$$p; \ + echo " $(INSTALL_DATA) $$p $(DESTDIR)$(m4datadir)/$$p"; \ + $(INSTALL_DATA) $$p $(DESTDIR)$(m4datadir)/$$p; \ fi; fi; \ done uninstall-m4dataDATA: @$(NORMAL_UNINSTALL) list='$(m4data_DATA)'; for p in $$list; do \ - rm -f $(m4datadir)/$$p; \ + rm -f $(DESTDIR)$(m4datadir)/$$p; \ done tags: TAGS TAGS: @@ -146,12 +148,10 @@ install: install-exec install-data all uninstall: uninstall-m4dataDATA -all: Makefile $(DATA) - install-strip: $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install installdirs: - $(mkinstalldirs) $(m4datadir) + $(mkinstalldirs) $(DATADIR)$(m4datadir) mostlyclean-generic: @@ -179,8 +179,8 @@ maintainer-clean: maintainer-clean-generic distclean @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." -.PHONY: default uninstall-m4dataDATA install-m4dataDATA tags distdir \ -info dvi installcheck install-exec install-data install uninstall all \ +.PHONY: uninstall-m4dataDATA install-m4dataDATA tags distdir info dvi \ +installcheck install-exec install-data install uninstall all \ installdirs mostlyclean-generic distclean-generic clean-generic \ maintainer-clean-generic clean mostlyclean distclean maintainer-clean diff --git a/m4/lex.m4 b/m4/lex.m4 new file mode 100644 index 00000000..7812aa5e --- /dev/null +++ b/m4/lex.m4 @@ -0,0 +1,9 @@ +## Replacement for AC_PROG_LEX and AC_DECL_YYTEXT +## by Alexandre Oliva + +dnl AM_PROG_LEX +dnl Look for flex, lex or missing, then run AC_PROG_LEX and AC_DECL_YYTEXT +AC_DEFUN(AM_PROG_LEX, +[AC_CHECK_PROGS(LEX, flex lex, "$1/missing flex") +AC_PROG_LEX +AC_DECL_YYTEXT]) diff --git a/missing b/missing index 79a3e4ed..cbe2b0ef 100755 --- a/missing +++ b/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) diff --git a/tests/ChangeLog b/tests/ChangeLog index 06bf8135..bec14b6a 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,5 +1,7 @@ Fri Mar 20 00:32:16 1998 Tom Tromey + * lex2.test: New file. + * aclocalii.test: New file. * javasubst.test: New file. diff --git a/tests/Makefile.am b/tests/Makefile.am index f0bebc68..9fb4766f 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -29,7 +29,8 @@ xsource.test libobj6.test depend3.test output5.test ammissing.test \ install.test libobj7.test objc.test cond3.test cxxcpp.test \ aclocal.test alpha.test whoami.test unused.test condman.test \ texinfo5.test aclocali.test texinfo6.test condman2.test colon4.test \ -java.test sinclude.test javaprim.test javasubst.test aclocalii.test +java.test sinclude.test javaprim.test javasubst.test aclocalii.test \ +lex2.test EXTRA_DIST = defs $(TESTS) diff --git a/tests/Makefile.in b/tests/Makefile.in index c935f830..dd173249 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated automatically by automake 1.2f from Makefile.am +# Makefile.in generated automatically by automake 1.2g from Makefile.am # Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation @@ -32,6 +32,8 @@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include +DISTDIR = + pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ @@ -90,7 +92,8 @@ xsource.test libobj6.test depend3.test output5.test ammissing.test \ install.test libobj7.test objc.test cond3.test cxxcpp.test \ aclocal.test alpha.test whoami.test unused.test condman.test \ texinfo5.test aclocali.test texinfo6.test condman2.test colon4.test \ -java.test sinclude.test javaprim.test javasubst.test aclocalii.test +java.test sinclude.test javaprim.test javasubst.test aclocalii.test \ +lex2.test EXTRA_DIST = defs $(TESTS) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs @@ -101,13 +104,13 @@ DIST_COMMON = ChangeLog Makefile.am Makefile.in DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) GZIP = --best -default: all +all: Makefile .SUFFIXES: -$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --gnits tests/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status @@ -172,8 +175,6 @@ install: install-exec install-data all uninstall: -all: Makefile - install-strip: $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install installdirs: @@ -204,10 +205,10 @@ maintainer-clean: maintainer-clean-generic distclean @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." -.PHONY: default tags distdir check-TESTS info dvi installcheck \ -install-exec install-data install uninstall all installdirs \ -mostlyclean-generic distclean-generic clean-generic \ -maintainer-clean-generic clean mostlyclean distclean maintainer-clean +.PHONY: tags distdir check-TESTS info dvi installcheck install-exec \ +install-data install uninstall all installdirs mostlyclean-generic \ +distclean-generic clean-generic maintainer-clean-generic clean \ +mostlyclean distclean maintainer-clean distclean-local: diff --git a/tests/lex.test b/tests/lex.test index 97d7f5e5..e9b565e4 100755 --- a/tests/lex.test +++ b/tests/lex.test @@ -6,8 +6,7 @@ cat >> configure.in << 'END' AC_PROG_CC -AC_PROG_LEX -AC_DECL_YYTEXT +AM_PROG_LEX END cat > Makefile.am << 'END' diff --git a/tests/lex2.test b/tests/lex2.test new file mode 100755 index 00000000..a8154550 --- /dev/null +++ b/tests/lex2.test @@ -0,0 +1,22 @@ +#! /bin/sh + +# Test to make sure AC_PROG_LEX is an error. + +. $srcdir/defs || exit 1 + +cat >> configure.in << 'END' +AC_PROG_CC +AC_PROG_LEX +AC_DECL_YYTEXT +END + +cat > Makefile.am << 'END' +bin_PROGRAMS = zot +zot_SOURCES = joe.l +LDADD = @LEXLIB@ +END + +: > joe.l + +$AUTOMAKE && exit 1 +exit 0 -- 2.43.5