diff --git a/contrib/bison/AUTHORS b/contrib/bison/AUTHORS new file mode 100644 index 000000000000..0a3ca6fd51fd --- /dev/null +++ b/contrib/bison/AUTHORS @@ -0,0 +1,8 @@ +Authors of GNU Bison. + +Bison was written primarily by Robert Corbett. + +Richard Stallman made it Yacc-compatible. + +Wilfred Hansen of Carnegie Mellon University added multicharacter +string literals and other features. diff --git a/contrib/bison/COPYING b/contrib/bison/COPYING index a43ea2126fb6..d60c31a97a54 100644 --- a/contrib/bison/COPYING +++ b/contrib/bison/COPYING @@ -2,7 +2,7 @@ Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 675 Mass Ave, Cambridge, MA 02139, USA + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -279,7 +279,7 @@ POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS - Appendix: How to Apply These Terms to Your New Programs + How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it @@ -291,7 +291,7 @@ convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. - Copyright (C) 19yy + Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -305,14 +305,15 @@ the "copyright" line and a pointer to where the full notice is found. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: - Gnomovision version 69, Copyright (C) 19yy name of author + Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. diff --git a/contrib/bison/ChangeLog b/contrib/bison/ChangeLog index 10083c2d51af..d155d23d4f57 100644 --- a/contrib/bison/ChangeLog +++ b/contrib/bison/ChangeLog @@ -1,1290 +1,340 @@ -Sat May 11 15:11:15 1996 Richard Stallman +Tue Jul 6 13:19:44 1999 Jesse Thilo - * Version 1.25 released. + * NEWS, README, configure.in: Released version 1.28. - * Makefile.in (dist): Don't use $(srcdir). +Mon Jun 14 22:22:17 1999 Jesse Thilo - * bison.simple (__yy_memcpy): Really reorder the args, as was - supposedly done on Feb 14 1995. + * acconfig.h, configure.in: + Have configure build version string instead of relying on ANSI string + concatentation. + +Sun May 30 13:12:28 1999 Jesse Thilo + + * README: Added a FAQ list. + + * configure.in, acconfig.h: I18n fixes. + +Sun Apr 18 16:50:30 1999 Jesse Thilo + + * configure.in: + Updated AC_INIT file to reflect directory reorganization. + + * configure.in, .cvsignore, Attic/POTFILES.in, Makefile.am: + Reorganized: sources in `src', documentation in `doc'. + +Tue Apr 13 19:53:42 1999 Jesse Thilo + + * configure.in, acconfig.h, acinclude.m4: + Don't declare calloc() and realloc() if not necessary. + +Tue Mar 23 00:48:58 1999 Jesse Thilo + + * Makefile.am, acconfig.h, configure.in: Added i18n support. + +Wed Mar 3 15:45:06 1999 Jesse Thilo + + * Makefile.am: Added support for non-ANSI compilers (ansi2knr). + +Tue Feb 16 11:05:48 1999 Jesse Thilo + + * configure.in: Bumped version number to 1.27. + + * Makefile.am: + Added `bison.simple' to list of files removed by `make distclean'. + +Fri Feb 12 15:18:12 1999 Jesse Thilo + + * Makefile.am, acconfig.h, acinclude.m4, configure.in: + Defined locations of parser files in config.h instead of Makefile. + +Tue Feb 9 03:51:09 1999 Jesse Thilo + + * Makefile.am: Removed inappropriate use of $< macro. + +Wed Jan 27 03:34:47 1999 Jesse Thilo + + * README: Document help-bison list. + + * configure.in: Add check for mkstemp(). + +Wed Jan 20 22:45:49 1999 Jesse Thilo + + * Makefile.am, OChangeLog: + ChangeLog is now automatically generated. Include the old version as + OChangeLog. + +Thu Jan 14 14:58:37 1999 Jesse Thilo + + * acconfig.h: Update FSF address. + +Wed Dec 30 05:27:11 1998 Jesse Thilo + + * configure.in: Use prototypes if the compiler understands them. + + * NEWS: Document 1.26 highlights. + + * Makefile.am: Require Automake 1.3 or later. + + * acconfig.h: Use prototypes if the compiler understands them. + +Tue Dec 29 21:54:26 1998 Jesse Thilo + + * Attic/version.cin, acconfig.h, configure.in: + Use VERSION symbol from automake for version number. + +Sat Nov 28 21:31:37 1998 Jesse Thilo + + * Makefile.am: + Distribute original version of simple parser (bison.s1), not built + version (bison.simple). + +Wed Nov 25 23:18:48 1998 Jesse Thilo + + * Makefile.am: + Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1). + + * configure.in, Attic/version.cin: Build version.c automatically. + + * AUTHORS: Add AUTHORS file. + + * README: Update bug report address. + + * Attic/bison.simple: + Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1). + + * Attic/Makefile.in, Makefile.am, configure.in, stamp-h.in: + Add automake stuff. + +Sat Jun 28 19:43:05 1997 Richard Stallman + + * Attic/Makefile.in (bison_version): New variable. + (dist): Use that variable. + (bison.s1): Substitute the Bison version into bison.simple. + + * Attic/bison.simple: Add a Bison version comment. + +Wed Jun 18 06:38:52 1997 Richard Stallman + + * Attic/Makefile.in: new.h renamed to alloc.h. + +Sat May 17 18:44:24 1997 Richard Stallman + + * Attic/bison.simple: Use malloc, if using alloca is troublesome. + (YYSTACK_USE_ALLOCA): New flag macro. + Define it for some systems and compilers. + (YYSTACK_ALLOC): New macro. + (yyparse): Use YYSTACK_ALLOC to allocate stack. + If it was malloc'd, free it. + +Wed Apr 23 18:01:25 1997 Richard Stallman + + * Attic/bison.simple: + (alloca) [__hpux]: Always define as __builtin_alloca. + +Tue Apr 22 22:23:48 1997 Richard Stallman + + * Attic/bison.simple: [__hpux]: Include alloca.h (right for HPUX 10) + instead of declaring alloca (right for HPUX 9). + + * Attic/bison.simple (__yy_memcpy): + Declare arg `count' as unsigned int. + (yyparse): Cast third arg to __yy_memcpy to unsigned int. + +Thu Jan 2 07:13:01 1997 Richard Stallman + + * Attic/Makefile.in (dist): + Explicitly check for symlinks, and copy them. + +Wed Dec 18 02:18:10 1996 Paul Eggert + + * Attic/bison.simple (yyparse): + If __GNUC__ and YYPARSE_PARAM are both defined, + declare yyparse to have a void * argument. + +Mon Aug 12 22:17:15 1996 Richard Stallman + + * Attic/bison.simple: Test _MSDOS as well as _MSDOS_. + +Wed Jul 31 19:18:57 1996 Richard Stallman + + * Attic/bison.simple: [__sun && __i386]: Include alloca.h. + +Tue Jul 30 04:37:37 1996 Richard Stallman + + * Attic/bison.simple: Comment change. + + * Attic/bison.simple: Test _MSDOS_, not MSDOS. + +Sat Jun 1 22:00:33 1996 Richard Stallman + + * Attic/POTFILES.in: Initial revision + + * Attic/Makefile.in (allocate.o): Define target explicitly. + + * Attic/Makefile.in (CFLAGS): Set to @CFLAGS@. + (LDFLAGS): Set to @LDFLAGS@. + (configure): Run autoconf only if preceding `cd' succeeds. + (bison.s1): Redirect output to temporary file then move the + temporary to the target, rather than redirecting directly to bison.s1. + (clean): Remove config.status and config.log. + (distclean): Don't remove config.status here. + +Sun May 12 22:17:15 1996 Richard Stallman + + * Attic/bison.simple: + (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t. + +Sat May 11 19:20:49 1996 Richard Stallman + + * Attic/Makefile.in (dist): Don't use $(srcdir). + + * Attic/bison.simple (__yy_memcpy): + Really reorder the args, as was supposedly done on Feb 14 1995. (yyparse): Calls changed accordingly. -Wed Jan 24 22:56:29 1996 Richard Stallman +Fri Dec 29 04:29:18 1995 Richard Stallman - * output.c (output_rule_data): Test YYERROR_VERBOSE in the conditional - around the definition of ttyname. + * Attic/bison.simple: Fix line numbers in #line commands. -Thu Dec 28 23:27:32 1995 Richard Stallman +Wed Dec 27 12:43:49 1995 Richard Stallman - * bison.simple: Fix line numbers in #line commands. - -Sun Dec 24 16:59:44 1995 Richard Stallman - - * bison.simple (YYPARSE_PARAM_DECL): In C++, make it always null. + * Attic/bison.simple (YYPARSE_PARAM_DECL): In C++, make it always null. (YYPARSE_PARAM_ARG): New macro. (yyparse): Use YYPARSE_PARAM_ARG. -Sun Oct 15 12:44:09 1995 Richard Stallman +Mon Oct 16 14:10:22 1995 Richard Stallman - * version.c: Version now 1.25. + * NEWS: *** empty log message *** - * main.c (warn): Set `failure'. +Sat May 6 05:35:44 1995 Richard Stallman -Tue Aug 1 12:30:38 EDT 1995 Wilfred J. Hansen + * Attic/bison.simple: Comment change. - * bison.cld, getargs.c, vmsgetargs.c: Added -n, -k, and -raw switches. - (noparserflag, toknumflag, rawtoknumflag): New variables. - - * conflicts.c (resolve_sr_conflict): Remove use of alloca. +Wed May 3 07:13:20 1995 Richard Stallman - * files.c (openfiles, open_extra_files, done): Add faction flag - and actfile file. Handle noparserflag. Both for -n switch. + * Attic/bison.simple: Change distribution terms. - * lex.c: Include getopt.h. Add some extern decls. - (safegetc): New function to deal with EOF gracefully. - (literalchar); new function to deal with reading \ escapes. - (lex): Use literalchar. - (lex): Implemented "..." tokens. - (literalchar, lex, parse_percent_token): Made tokenbuffer - always contain the token. This includes growing the token - buffer while reading an integer. - (parse_percent_token): Replaced if-else statement with percent_table. - (parse_percent_token): Added % declarations as another - way to specify the flags -n, -l, and -r. Also added hooks for - -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires - major changes to files.c. - (lex) Retain in the incoming stream a character following - an incorrect '/'. - (skip_white_space, lex): Revised most error messages - and changed fatal to warn to avoid aborting. - (percent_table): Added %thong declarations. +Tue Feb 14 16:49:32 1995 Jim Meyering - * lex.h: Added THONG and NOOP for alias processing. - Added SETOPT for the new code that allows setting options with %flags. - - * main.c (main): If reader sees an error, don't process the grammar. - (fatals): Updated to not use VARARGS1. - (printable_version, int_to_string, warn, warni, warns, warnss) - (warnsss): New error reporting functions. Avoid abort for error. - - * output.c (output_headers, output_trailers, output, output_gram) - (output_rule_data): Implement noparserflag variable. - Implement toknumflag variable. - (output): Call reader_output_yylsp to output LTYPESTR. - - * reader.c (reader_output_yylsp): New function. - (readgram): Use `#if 0' around code that accepted %command - inside grammar rules: The documentation doesn't allow it, - and it will fail since the %command processors scan for the next %. - (parse_token_decl): Extended the %token - declaration to allow a multi-character symbol as an alias. - (parse_thong_decl): New function. - (read_declarations): Added %thong declarations. - (read_declarations): Handle NOOP to deal with allowing - % declarations as another means to specify the flags. - (readgram): Allow %prec prior to semantics embedded in a rule. - (skip_to_char, read_declarations, copy_definition) - (parse_token_decl, parse_start_decl, parse_type_decl) - (parse_assoc_decl, parse_union_decl, parse_expect_decl) - (get_type_name, copy_guard, copy_action, readgram) - (get_type, packsymbols): Revised most error messages. - Changed `fatal' to `warnxxx' to avoid aborting for error. - Revised and use multiple warnxxx functions to avoid using VARARGS1. - (read_declarations): Improve the error message for - an invalid character. Do not abort. - (read_declarations, copy_guard, copy_action): Use - printable_version to avoid unprintable characters in printed output. - (parse_expect_decl): Error if argument to %expect exceeds 10 digits. - (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type): - Allow the type of a non-terminal can be given - more than once, as long as all specifications give the same type. - - * reduce.c (reduce_grammar): Revise an error message. - (print_notices): Remove final `.' from error message. - - * symtab.h (SALIAS): New #define for adding aliases to %token. - (struct bucket): Added `alias' field. - -Wed May 3 03:12:28 1995 Richard Stallman - - * bison.simple: Change distribution terms. - - * version.c: Version now 1.23. No, 1.24. - -Thu Feb 23 02:43:21 1995 Richard Stallman - - * files.c: Test __VMS_POSIX as well as VMS. - -Tue Feb 14 11:53:05 1995 Jim Meyering (meyering@comco.com) - - * bison.simple (__yy_memcpy): Renamed from __yy_bcopy to avoid + * Attic/bison.simple (__yy_memcpy): Renamed from __yy_bcopy to avoid confusion. Reverse FROM and TO arguments to be consistent with those of memcpy. -Thu Nov 10 16:33:41 1994 David J. MacKenzie +Thu Nov 10 22:34:22 1994 David J. MacKenzie - * Makefile.in (DISTFILES): Include install-sh, not install.sh. - Include NEWS. + * NEWS: reformat + + * NEWS: Initial revision + + * Attic/Makefile.in (DISTFILES): Include NEWS. + + * Attic/Makefile.in (DISTFILES): Include install-sh, not install.sh. * configure.in: Update to Autoconf v2 macro names. -Tue Oct 4 22:25:43 1994 David J. MacKenzie (djm@duality.gnu.ai.mit.edu) +Wed Oct 5 02:26:07 1994 David J. MacKenzie - * Makefile.in (prefix, exec_prefix): Let configure set them. + * Attic/Makefile.in: fix typo -Wed Sep 28 09:55:28 1994 David J. MacKenzie (djm@duality.gnu.ai.mit.edu) + * Attic/Makefile.in (prefix, exec_prefix): Let configure set them. - * Makefile.in: Set datadir to $(prefix)/share. +Wed Sep 28 13:55:25 1994 David J. MacKenzie -Tue Jul 12 16:42:43 1994 Richard Stallman (rms@mole.gnu.ai.mit.edu) + * Attic/Makefile.in: Set datadir to $(prefix)/share. - * reader.c (reader): Rename undefined-token token to `$undefined.'. +Thu Sep 15 21:39:22 1994 Richard Stallman -Thu May 5 14:41:02 1994 David J. MacKenzie (djm@nutrimat.gnu.ai.mit.edu) + * Attic/bison.simple: Update copyright notice and GPL version. - * Makefile.in (DISTFILES): Add install.sh. - (install): Remove chmod commands. +Thu May 5 18:41:55 1994 David J. MacKenzie -Sat Mar 26 15:33:07 1994 Richard Stallman (rms@mole.gnu.ai.mit.edu) + * Attic/Makefile.in: entered into RCS - * bison.simple: Fix #line commands. +Sat Mar 26 20:33:04 1994 Richard Stallman -Thu Mar 24 23:09:07 1994 Richard Stallman (rms@mole.gnu.ai.mit.edu) + * Attic/bison.simple: entered into RCS - * conflicts.c (print_reductions): Increment both fp1 and fp2 - while printing reductions in multi-rule case. +Sun Jan 2 20:52:16 1994 Richard Stallman -Sun Jan 2 15:51:52 1994 Richard Stallman (rms@mole.gnu.ai.mit.edu) + * Attic/Makefile.in: *** empty log message *** - * Makefile.in (LDFLAGS): Make it empty by default. - (bison): Use CFLAGS. +Sun Nov 21 10:25:13 1993 Richard Stallman -Sun Nov 21 05:24:30 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) + * Attic/bison.simple: *** empty log message *** - * bison.simple (YYLEX): Take notice of YYLEX_PARAM. +Tue Oct 19 03:55:14 1993 Richard Stallman -Mon Oct 18 23:52:33 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) + * Attic/bison.simple: *** empty log message *** - * bison.simple (YYPARSE_PARAM_DECL): Always define this. +Thu Oct 14 16:19:10 1993 Richard Stallman -Thu Oct 14 12:19:13 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) + * Attic/bison.simple: *** empty log message *** - * bison.simple (yyparse): Support YYPARSE_PARAM. +Mon Sep 13 22:17:10 1993 Noah Friedman -Mon Sep 13 18:17:14 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu) + * Attic/Makefile.in: *** empty log message *** - * Makefile.in (check): New target. +Mon Sep 6 22:19:19 1993 Noah Friedman -Fri Sep 10 08:10:18 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) + * Attic/Makefile.in: *** empty log message *** - * conflicts.c (alloca): #undef before defining. +Fri Jul 30 00:34:59 1993 David J. MacKenzie - * system.h (bcopy): Don't define if already defined. + * Attic/Makefile.in: *** empty log message *** -Mon Sep 6 15:32:32 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu) +Sat Jul 24 08:00:44 1993 Richard Stallman - * Version 1.22 released. + * Attic/bison.simple: *** empty log message *** - * mkinstalldirs: New file. +Thu Jul 8 23:40:10 1993 David J. MacKenzie - * Makefile.in (dist): Use .gz for extension, not .z. - (DISTFILES): New variable. - (dist): Use it instead of explicit file list. - Try to link each file separately, then copy file if ln fails. - (installdirs): Use mkinstalldirs script. + * Attic/Makefile.in: *** empty log message *** -Thu Jul 29 20:35:02 1993 David J. MacKenzie (djm@wookumz.gnu.ai.mit.edu) +Sun Jul 4 20:07:28 1993 Richard Stallman - * Makefile.in (config.status): Run config.status --recheck, not - configure, to get the right args passed. + * Attic/bison.simple: *** empty log message *** -Sat Jul 24 04:00:52 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) +Wed Jun 16 21:02:31 1993 Richard Stallman - * bison.simple (yyparse): Init yychar1 to avoid warning. + * Attic/bison.simple: *** empty log message *** -Sun Jul 4 16:05:58 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) +Thu Jun 3 17:07:14 1993 Richard Stallman - * bison.simple (yyparse): Don't set yyval when yylen is 0. + * Attic/bison.simple: Initial revision -Sat Jun 26 15:54:04 1993 David J. MacKenzie (djm@wookumz.gnu.ai.mit.edu) +Fri May 7 10:16:54 1993 Noah Friedman - * getargs.c (getargs): Exit after printing the version number. - Add --help and -h options. - (usage): New function. + * Attic/Makefile.in: *** empty log message *** -Fri Jun 25 15:11:25 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) +Sun Apr 18 04:54:09 1993 Noah Friedman - * getargs.c (longopts): Allow `output' as an alternative. + * Attic/Makefile.in: *** empty log message *** -Wed Jun 16 17:02:37 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) +Sat Apr 17 01:24:07 1993 Noah Friedman - * bison.simple (yyparse): Conditionalize the entire call to yyoverflow, - not just two arguments in it. + * Attic/Makefile.in: *** empty log message *** -Thu Jun 3 13:07:19 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) +Thu Apr 15 06:43:42 1993 Noah Friedman - * bison.simple [__hpux] (alloca): Don't specify arg types. + * configure.in: entered into RCS -Fri May 7 05:53:17 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu) + * configure.in: *** empty log message *** - * Makefile.in (install): Depend on `uninstall' and `installdirs'. - (installdirs): New target. + * configure.in: Initial revision -Wed Apr 28 15:15:15 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu) +Wed Apr 14 04:51:13 1993 Richard Stallman - * reader.c: Remove declaration of atoi. + * Attic/Makefile.in: Initial revision -Fri Apr 23 12:29:20 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu) +Fri Sep 25 22:06:24 1992 Richard Stallman - * new.h [!__STDC__] (FREE): Check x != 0. - Make expr to call `free' evaluate to 0. + * configure.bat: entered into RCS -Tue Apr 20 01:43:44 1993 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu) +Mon Apr 20 06:32:57 1992 David J. MacKenzie - * files.c [MSDOS]: Use xmalloc, not malloc. - * allocate.c (xmalloc): Renamed from mallocate. Remove old wrapper. - * conflicts.c, symtab.c, files.c, LR0.c, new.h: Change callers. - * allocate.c (xrealloc): New function. - * new.h: Declare it. - * lex.c, reader.c: Use it. + * README: entered into RCS -Sun Apr 18 00:45:56 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu) +Wed Dec 16 06:53:07 1987 Richard Stallman - * Version 1.21 released. + * REFERENCES: entered into RCS - * reader.c : Don't declare `realloc'. - - * Makefile.in (bison.s1): use `rm -f' since it's quieter. - (dist): make gzipped tar file. - -Fri Apr 16 21:24:10 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu) - - * Makefile.in (Makefile, config.status, configure): New targets. - -Thu Apr 15 15:37:28 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) - - * main.c: Don't declare `abort'. - - * files.c: Don't declare `exit'. - -Thu Apr 15 02:42:38 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu) - - * configure.in: Add AC_CONST. - -Wed Apr 14 00:51:17 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) - - * Makefile.in (all): Depend on bison.s1. - -Tue Apr 13 14:52:32 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) - - * Version 1.20 released. - -Wed Mar 24 21:45:47 1993 Richard Stallman (rms@wookumz.gnu.ai.mit.edu) - - * output.c (output_headers): Rename yynerrs if -p. - -Thu Mar 18 00:02:17 1993 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu) - - * system.h: Don't try to include stdlib.h unless HAVE_STDLIB_H is - defined. - - * configure.in: Check for stdlib.h. - -Wed Mar 17 14:44:27 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) - - * bison.simple [__hpux, not __GNUC__]: Declare alloca. - (yyparse): When printing the expected token types for an error, - Avoid negative indexes in yycheck and yytname. - -Sat Mar 13 23:31:25 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) - - * Makefile.in (files.o, .c.o): Put CPPFLAGS and CFLAGS last. - -Mon Mar 1 17:49:08 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) - - * bison.simple: Test __sgi like __sparc. - -Wed Feb 17 00:04:13 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) - - * conflicts.c (resolve_sr_conflict): Add extra parens in alloca call. - - * bison.simple [__GNUC__] (yyparse): Declare with prototype. - -Fri Jan 15 13:15:17 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) - - * conflicts.c (print_reduction): Near end, increment fp2 when mask - recycles. - -Wed Jan 13 04:15:03 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) - - * Makefile.in (bison.s1): New target. Modifies bison.simple. - (install): Install bison.s1, without changing it. - (clean): Delete bison.s1. - -Mon Jan 4 20:35:58 1993 Richard Stallman (rms@mole.gnu.ai.mit.edu) - - * reader.c (reader): Put Bison version in comment in output file. - -Tue Dec 22 19:00:58 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) - - * files.c (openfiles): Use .output, not .out, for outfile, - regardless of spec_name_prefix. - -Tue Dec 15 19:22:11 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) - - * output.c (output_gram): Include yyrhs in the same #if as yyprhs. - -Tue Dec 15 18:29:16 1992 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu) - - * output.c (output): output directives checking for __cplusplus as - well as __STDC__ to determine when to define "const" as an empty - token. (Patch from Wolfgang Glunz ) - -Tue Dec 8 21:51:23 1992 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu) - - * system.h, conflicts.c: Replace USG with HAVE_STRING_H and - HAVE_MEMORY_H. - -Sat Nov 21 00:37:16 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) - - * Makefile.in: Set and use $(MAKEINFO). - -Fri Nov 20 20:45:57 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) - - * files.c (done) [MSDOS]: Delete the tmpdefsfile with the rest. - -Thu Oct 8 21:55:52 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) - - * Makefile.in (dist): Put configure.bat in the distribution. - -Thu Oct 1 09:16:24 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu) - - * Makefile.in (install): cd to $(srcdir) before installing info files. - -Wed Sep 30 17:18:39 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) - - * Makefile.in (files.o): Supply $(DEFS), and $(CPPFLAGS). - -Fri Sep 25 18:06:28 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) - - * Version 1.19 released. - - * reader.c (parse_union_decl): Fix ending of C++ comment; - don't lose the char after the newline. - - * configure.bat: New file. - -Thu Sep 24 16:23:15 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) - - * conflicts.c: Check for using alloca.h as getopt.c does. - -Sun Sep 6 08:01:53 1992 Karl Berry (karl@hayley) - - * files.c (openfiles): open `fdefines' after we have assigned a name - to `tmpdefsfile', and only if `definesflag' is set. - (done): only create the real .tab.h file if `definesflag' is set. - * reader.c (packsymbols): don't close `fdefines' here. - -Sat Sep 5 15:02:11 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) - - * files.c (openfiles): Open fdefines as temp file, like ftable. - (done): Copy temp defines file to real one, like main output file. - -Fri Aug 21 12:47:48 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) - - * Makefile.in (dist): Don't release mergedir.awk - (install): Use sed, not awk. Don't depend on mergedir.awk. - * mergedir.awk: File effectively deleted. - -Wed Jul 29 00:53:25 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) - - * bison.simple: Test __sparc along with __sparc__. - -Sat Jul 11 14:08:33 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) - - * lex.c (skip_white_space): Count \n just once at end of c++ comment. - -Fri Jun 26 00:00:30 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) - - * bison.simple: Comment fix; #line command updated. - -Wed Jun 24 15:12:42 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) - - * Makefile.in (install): Specify full new file name for the executable. - -Mon Jun 22 16:38:24 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) - - * Makefile.in (dist): Include bison.rnh in distribution. - -Sun Jun 21 22:42:13 1992 Eric Youngdale (youngdale@v6550c.nrl.navy.mil) - - Clean up rough edges in VMS port of bison, add support for remaining - command line options. - - * bison.cld: Add /version, /yacc, /file_prefix, and /name_prefix - switches. - - * build.com: General cleanup: add logic to automatically sense - which C compiler is present; add code to cwd to the directory - that contains bison sources; do not define XPFILE, XPFILE1 - (correct defaults are applied in file.c). - - * files.c: Append _tab, not .tab when using /file_prefix under VMS. - - * system.h: Include string.h instead of strings.h (a la USG). - - * vmsgetargs.c: Add support for all switches added to bison.cld. - -Sun Jun 21 15:53:26 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) - - * Makefile.in (install): Always specify new file name for install. - Redirect awk output to temp file and install that. - -Wed May 27 22:27:50 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) - - * bison.simple (yyparse): Make yybackup and yyerrlab1 always be used. - -Fri May 22 14:58:42 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) - - * Makefile.in (dist): Depend on bison.info - (bison.info): Delete spurious <. - -Sun May 17 21:48:55 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) - - * Makefile.in (.c.o): New rule. Use $(DEFS) directly. - (CFLAGS): Use just -g by default. - (CDEBUG): Variable deleted. - -Thu May 7 00:03:37 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) - - * reader.c (copy_guard): Fix typo skipping comment. - -Mon May 4 01:23:21 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) - - * Version 1.18. - - * getargs.c (getargs): Change '0' to 0 in case for long options. - -Sun Apr 19 10:17:52 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) - - * reader.c (packsymbols): Handle -p when declaring yylval. - -Sat Apr 18 18:18:48 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) - - * output.c (output_gram): Output #endif properly at end of decl. - -Mon Mar 30 01:13:41 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) - - * Version 1.17. - - * Makefile.in (clean): Don't delete configuration files or TAGS. - (distclean): New target; do delete those. - -Sat Mar 28 17:18:50 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) - - * output.c (output_gram): Conditionalize yyprhs on YYDEBUG. - - * LR0.c (augment_automaton): If copying sp->shifts to insert new - shift, handle case of inserting at end. - -Sat Mar 21 23:25:47 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) - - * lex.c (skip_white_space): Handle C++ comments. - * reader.c (copy_definition, parse_union_decl, copy_guard): - (copy_action): Likewise. - -Sun Mar 8 01:22:21 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) - - * bison.simple (YYPOPSTACK): Fix typo. - -Sat Feb 29 03:53:06 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) - - * Makefile.in (install): Install bison.info* files one by one. - -Fri Feb 28 19:55:30 1992 David J. MacKenzie (djm@wookumz.gnu.ai.mit.edu) - - * bison.1: Document long options as starting with `--', not `+'. - -Sat Feb 1 00:08:09 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) - - * getargs.c (getargs): Accept value 0 from getopt_long. - -Thu Jan 30 23:39:15 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) - - * Makefile.in (mostlyclean): Renamed from `clean'. - (clean): Renamed from 'distclean'. Dep on mostlyclean, not realclean. - (realclean): Dep on clean. - -Mon Jan 27 21:59:19 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) - - * bison.simple: Use malloc, not xmalloc, and handle failure explicitly. - -Sun Jan 26 22:40:04 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) - - * conflicts.c (total_conflicts): Delete unused arg to fprintf. - -Tue Jan 21 23:17:44 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) - - * Version 1.16. - -Mon Jan 6 16:50:11 1992 Richard Stallman (rms at mole.gnu.ai.mit.edu) - - * Makefile (distclean): Depend on clean, not realclean. Don't rm TAGS. - (realclean): rm TAGS here. - - * symtab.c (free_symtab): Don't free the type names. - -Sun Dec 29 22:25:40 1991 Richard Stallman (rms at mole.gnu.ai.mit.edu) - - * machine.h: MSDOS has 32-bit ints if __GO32__. - -Wed Dec 25 22:09:07 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu) - - * bison.simple [_AIX]: Indent `#pragma alloca', so old C compilers - don't choke on it. - -Mon Dec 23 02:10:16 1991 Richard Stallman (rms at mole.gnu.ai.mit.edu) - - * getopt.c, getopt1.c, getopt.h: Link them to standard source location. - * alloca.c: Likewise. - * Makefile.in (dist): Copy those files from current dir. - - * getargs.c: Update usage message. - - * LR0.c (augment_automaton): Put new shift in proper order. - -Fri Dec 20 18:39:20 1991 Richard Stallman (rms at mole.gnu.ai.mit.edu) - - * conflicts.c: Use memcpy if ANSI C library. - - * closure.c (set_fderives): Delete redundant assignment to vrow. - - * closure.c (print_firsts): Fix bounds and offset checking tags. - - * closure.c (tags): Declare just once at start of file. - - * LR0.c (allocate_itemsets): Eliminate unused var max. - (augment_automaton): Test sp is non-null. - - * lalr.c (initialize_LA): Make the vectors at least 1 element long. - - * reader.c (readgram): Remove separate YYSTYPE default for MSDOS. - -Wed Dec 18 02:40:32 1991 Richard Stallman (rms at mole.gnu.ai.mit.edu) - - * print.c (print_grammar): Don't print disabled rules. - -Tue Dec 17 03:48:07 1991 Richard Stallman (rms at mole.gnu.ai.mit.edu) - - * lex.c (lex): Parse hex escapes properly. - Handle \v when filling token_buffer. - - * lex.c: Include new.h. - (token_buffer): Change to a pointer. - (init_lex): Allocate initial buffer. - (grow_token_buffer): New function. - (lex, parse_percent_token): Use that. - - * reader.c (read_declarations): Call open_extra_files just once. - (parse_token_decl): Don't free previous typename value. - Don't increment nvars if symbol is already a nonterminal. - (parse_union_decl): Catch unmatched close-brace. - (parse_expect_decl): Null-terminate buffer. - (copy_guard): Set brace_flag for {, not for }. - - * reader.c: Fix %% in calls to fatal. - - * reader.c (token_buffer): Just one extern decl, at top level. - Declare as pointer. - - * symtab.c (free_symtab): Free type_name fields. Free symtab itself. - -Mon Nov 25 23:04:31 1991 Richard Stallman (rms at mole.gnu.ai.mit.edu) - - * bison.simple: Handle alloca for AIX. - - * Makefile.in (mandir): Compute default using manext. - -Sat Nov 2 21:39:32 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu) - - * Update all files to GPL version 2. - -Fri Sep 6 01:51:36 1991 Richard Stallman (rms at mole.gnu.ai.mit.edu) - - * bison.simple (__yy_bcopy): Use builtin if GCC version 2. - -Mon Aug 26 22:09:12 1991 Richard Stallman (rms at mole.gnu.ai.mit.edu) - - * reader.c (parse_assoc_decl): Error if same symbol gets two precs. - -Mon Aug 26 16:42:09 1991 David J. MacKenzie (djm at pogo.gnu.ai.mit.edu) - - * Makefile.in, configure: Only put $< in Makefile if using VPATH, - because older makes don't understand it. - -Fri Aug 23 00:05:54 1991 David J. MacKenzie (djm at apple-gunkies) - - * conflicts.c [_AIX]: #pragma alloca. - * reduce.c: Don't define TRUE and FALSE if already defined. - -Mon Aug 12 22:49:58 1991 Richard Stallman (rms at mole.gnu.ai.mit.edu) - - * Makefile.in: Add deps on system.h. - (install): Add some deps. - -Fri Aug 2 12:19:20 1991 David J. MacKenzie (djm at apple-gunkies) - - * Makefile.in (dist): Include texinfo.tex. - - * configure: Create config.status. Remove it and Makefile if - interrupted while creating them. - -Thu Aug 1 23:14:01 1991 David J. MacKenzie (djm at apple-gunkies) - - * configure: Check for +srcdir etc. arg and look for - Makefile.in in that directory. Set VPATH if srcdir is not `.'. - * Makefile.in (prefix): Renamed from DESTDIR. - -Wed Jul 31 21:29:47 1991 Richard Stallman (rms at mole.gnu.ai.mit.edu) - - * print.c (print_grammar): Make output prettier. Break lines. - -Tue Jul 30 22:38:01 1991 Richard Stallman (rms at mole.gnu.ai.mit.edu) - - * print.c (print_grammar): New function. - (verbose): Call it instead of printing token names here. - -Mon Jul 22 16:39:54 1991 Richard Stallman (rms at mole.gnu.ai.mit.edu) - - * vmsgetargs.c (spec_name_prefix, spec_file_prefix): Define variables. - -Wed Jul 10 01:38:25 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu) - - * configure, Makefile.in: $(INSTALLPROG) -> $(INSTALL), - $(INSTALLTEXT) -> $(INSTALLDATA). - -Tue Jul 9 00:53:58 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu) - - * bison.simple: Don't include malloc.h if __TURBOC__. - -Sat Jul 6 15:18:12 1991 David J. MacKenzie (djm at geech.gnu.ai.mit.edu) - - * Replace Makefile with configure and Makefile.in. - Update README with current compilation instructions. - -Mon Jul 1 23:12:20 1991 Richard Stallman (rms at mole.gnu.ai.mit.edu) - - * reader.c (reader): Make the output define YYBISON. - -Thu Jun 20 16:52:51 1991 David J. MacKenzie (djm at geech.gnu.ai.mit.edu) - - * Makefile (MANDIR, MANEXT): Install man page in - /usr/local/man/man1/bison.1 by default, instead of - /usr/man/manl/bison.l, for consistency with other GNU programs. - * Makefile: Rename BINDIR et al. to lowercase to conform to - GNU coding standards. - (install): Make man page non-executable. - -Fri May 31 23:22:13 1991 Richard Stallman (rms at mole.gnu.ai.mit.edu) - - * Makefile (bison.info): New target. - (realclean): New target. - -Thu May 2 16:36:19 1991 Richard Stallman (rms at mole.gnu.ai.mit.edu) - - * bison.simple: Use YYPRINT to print a token, if it's defined. - -Mon Apr 29 12:22:55 1991 Richard Stallman (rms at mole.gnu.ai.mit.edu) - - * lalr.c (transpose): Rename R to R_arg. - (initialize_LA): Avoid shadowing variable j. - - * reader.c (packsymbols): Avoid shadowing variable i. - - * files.c: Declare exit and perror. - - * machine.h: Define MAXSHORT and MINSHORT for the eta-10. - -Tue Apr 2 20:49:12 1991 Richard Stallman (rms at mole.gnu.ai.mit.edu) - - * allocate.c (mallocate): Always allocate at least one byte. - -Tue Mar 19 22:17:19 1991 Richard Stallman (rms at mole.gnu.ai.mit.edu) - - * Makefile (dist): Put alloca.c into distribution. - -Wed Mar 6 17:45:42 1991 Richard Stallman (rms at mole.ai.mit.edu) - - * print.c (print_actions): Nicer output for final states. - -Thu Feb 21 20:39:53 1991 Richard Stallman (rms at mole.ai.mit.edu) - - * output.c (output_rule_data): Break lines in yytline based on hpos. - -Thu Feb 7 12:54:36 1991 Richard Stallman (rms at mole.ai.mit.edu) - - * bison.simple (yyparse): Move decl of yylsa before use. - -Tue Jan 15 23:41:33 1991 Richard Stallman (rms at mole.ai.mit.edu) - - * Version 1.14. - - * output.c (output_rule_data): Handle NULL in tags[i]. - -Fri Jan 11 17:27:24 1991 Richard Stallman (rms at mole.ai.mit.edu) - - * bison.simple: On MSDOS, include malloc.h. - -Sat Dec 29 19:59:55 1990 David J. MacKenzie (djm at wookumz.ai.mit.edu) - - * files.c: Use `mallocate' instead of `xmalloc' so no extra decl is - needed. - -Wed Dec 19 18:31:21 1990 Richard Stallman (rms at mole.ai.mit.edu) - - * reader.c (readgram): Alternate YYSTYPE defn for MSDOS. - * files.c [MSDOS]: Declare xmalloc. - -Thu Dec 13 12:45:54 1990 Richard Stallman (rms at mole.ai.mit.edu) - - * output.c (output_rule_data): Put all symbols in yytname. - - * bison.simple (yyparse): Delete extra fprintf arg - when printing a result of reduction. - -Mon Dec 10 13:55:15 1990 Richard Stallman (rms at mole.ai.mit.edu) - - * reader.c (packsymbols): Don't declare yylval if pure_parser. - -Tue Oct 30 23:38:09 1990 Richard Stallman (rms at mole.ai.mit.edu) - - * Version 1.12. - - * LR0.c (augment_automaton): Fix bugs adding sp2 to chain of shifts. - -Tue Oct 23 17:41:49 1990 Richard Stallman (rms at mole.ai.mit.edu) - - * bison.simple: Don't define alloca if already defined. - -Sun Oct 21 22:10:53 1990 Richard Stallman (rms at mole.ai.mit.edu) - - * getopt.c: On VMS, use string.h. - - * main.c (main): Return type int. - -Mon Sep 10 16:59:01 1990 Richard Stallman (rms at mole.ai.mit.edu) - - * output.c (output_headers): Output macro defs for -p. - - * reader.c (readgram): Handle consecutive actions. - - * getargs.c (getargs): Rename -a to -p. - * files.c (openfiles): Change names used for -b. - -Mon Aug 27 00:30:15 1990 Richard Stallman (rms at mole.ai.mit.edu) - - * reduce.c (reduce_grammar_tables): Don't map rlhs of disabled rule. - -Sun Aug 26 13:43:32 1990 Richard Stallman (rms at mole.ai.mit.edu) - - * closure.c (print_firsts, print_fderives): Use BITISSET to test bits. - -Thu Aug 23 22:13:40 1990 Richard Stallman (rms at mole.ai.mit.edu) - - * closure.c (print_firsts): vrowsize => varsetsize. - (print_fderives): rrowsize => rulesetsize. - -Fri Aug 10 15:32:11 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - - * bison.simple (alloca): Don't define if already defined. - (__yy_bcopy): Alternate definition for C++. - -Wed Jul 11 00:46:03 1990 David J. MacKenzie (djm at albert.ai.mit.edu) - - * getargs.c (getargs): Mention +yacc in usage message. - -Tue Jul 10 17:29:08 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - - * reader.c (parse_token_decl, copy_action): - Set value_components_used if appropriate. - (readgram): Inhibit output of YYSTYPE definition in that case. - -Sat Jun 30 13:47:57 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - - * output.c (output_parser): Define YYPURE if pure, and not otherwise. - Don't define YYIMPURE. - * bison.simple: Adjust conditionals accordingly. - * bison.simple (YYLEX): If locations not in use, don't pass &yylloc. - -Thu Jun 28 12:32:21 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - - * getargs.c (longopts): Add `yacc'. - -Thu Jun 28 00:40:21 1990 David J. MacKenzie (djm at apple-gunkies) - - * getargs.c (getargs): Add long options. - * Makefile: Link with getopt1.o and add getopt1.c and getopt.h to - dist. - - * Move version number and description back into version.c from - Makefile and getargs.c. - * Makefile (dist): Extract version number from version.c. - -Tue Jun 26 13:16:35 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - - * output.c (output): Always call output_gram. - * bison.simple (yyparse): Print rhs and lhs symbols of reduction rule. - -Thu Jun 21 00:15:40 1990 David J. MacKenzie (djm at albert.ai.mit.edu) - - * main.c: New global var `program_name' to hold argv[0] for error - messages. - * allocate.c, files.c, getargs.c, reader.c: Use `program_name' - in messages instead of hardcoded "bison". - -Wed Jun 20 23:38:34 1990 David J. MacKenzie (djm at albert.ai.mit.edu) - - * Makefile: Specify Bison version here. Add rule to pass it to - version.c. Encode it in distribution directory and tar file names. - * version.c: Use version number from Makefile. - * getargs.c (getargs): Print additional text that used to be part of - version_string in version.c. Use -V instead of -version to print - Bison version info. Print a usage message and exit if given an - invalid option. - -Tue Jun 19 01:15:18 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - - * bison.simple: Fix a #line. - - * Makefile (INSTALL): New parameter. - (install): Use that. - (CFLAGS): Move definition to top. - -Sun Jun 17 17:10:21 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - - * reader.c (parse_type_decl): Ignore semicolon. - Remove excess % from error messages. - -Sat Jun 16 19:15:48 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - - * Version 1.11. - - * Makefile (install): Ensure installed files readable. - -Tue Jun 12 12:50:56 EDT 1990 Jay Fenlason (hack@ai.mit.edu) - - * getargs.c: Declare spec_file_prefix - - * lex.c (lex): \a is '\007' instead of '007' - - * reader.c: include machine.h - - * files.h: Declare extern spec_name_prefix. - - Trivial patch from Thorsten Ohl (td12@ddagsi3.bitnet) - -Thu May 31 22:00:16 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - - * Version 1.10. - - * bison.simple (YYBACKUP, YYRECOVERING): New macros. - (YYINITDEPTH): This is what used to be YYMAXDEPTH. - (YYMAXDEPTH): This is what used to be YYMAXLIMIT. - If the value is 0, use the default instead. - (yyparse): Return 2 on stack overflow. - -Wed May 30 21:09:07 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - - * bison.simple (YYERROR): Jump to new label; don't print error message. - (yyparse): Define label yyerrlab1. - -Wed May 16 13:23:58 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - - * files.c (openfiles): Support -b. - * getargs.c (getargs): Likewise. - - * reader.c (readgram): Error if too many symbols. - - * lex.c (lex): Handle \a. Make error msgs more reliable. - * reader.c (read_declarations): Make error msgs more reliable. - -Sun May 13 15:03:37 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - - * Version 1.09. - - * reduce.c (reduce_grammar_tables): Fix backward test. - -Sat May 12 21:05:34 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - - * Makefile (bison-dist.*): Rename targets and files to bison.*. - (bison.tar): Make tar file to unpack into subdirectory named `bison'. - -Mon Apr 30 03:46:58 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - - * reduce.c (reduce_grammar_tables): Set rlhs to -1 for useless rules. - * nullable.c (set_nullable): Ignore those rules. - * derives.c (set_derives): Likewise. - -Mon Apr 23 15:16:09 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - - * bison.simple (yyparse): Mention rule number as well as line number. - -Thu Mar 29 00:00:43 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - - * bison.simple (__yy_bcopy): New function. - (yyparse): Use that, not bcopy. - -Wed Mar 28 15:23:51 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - - * print.c (print_actions): Don't alter i and j spuriously when errp==0. - -Mon Mar 12 16:22:18 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) - - * bison.simple [__GNUC__]: Use builtin_alloca. - -Wed Mar 7 21:11:36 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - - * Makefile (install): Use mergedir.awk to process bison.simple - for installation. - - * bison.simple (yyparse): New feature to include possible valid - tokens in parse error message. - -Sat Mar 3 14:10:56 1990 Richard Stallman (rms at geech) - - * Version 1.08. - -Mon Feb 26 16:32:21 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) - - * print.c (print_actions) - conflicts.c (print_reductions): Change "shift %d" to - "shift, and go to state %d" and "reduce %d" to "reduce using rule %d" - and "goto %d" to "go to state %d". - print.c (print_core): Change "(%d)" to "(rule %d)". - -Tue Feb 20 14:22:47 EST 1990 Jay Fenlason (hack @ wookumz.ai.mit.edu) - - * bison.simple: Comment out unused yyresume: label. - -Fri Feb 9 16:14:34 EST 1990 Jay Fenlason (hack @ wookumz.ai.mit.edu) - - * bison.simple : surround all declarations and (remaining) uses of - yyls* and yylloc with #ifdef YYLSP_NEEDED This will significantly - cut down on stack usage, and gets rid of unused-variable msgs from - GCC. - -Wed Jan 31 13:06:08 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - - * files.c (done) [VMS]: Don't delete files that weren't used. - [VMS]: Let user override XPFILE and XPFILE1. - -Wed Jan 3 15:52:28 1990 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - - * Version 1.07. - -Sat Dec 16 15:50:21 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - - * gram.c (dummy): New function. - - * reader.c (readgram): Detect error if two consec actions. - -Wed Nov 15 02:06:08 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - - * reduce.c (reduce_grammar_tables): Update rline like other tables. - - * Makefile (install): Install the man page. - -Sat Nov 11 03:21:58 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - - * output.c (output_rule_data): Write #if YYDEBUG around yyrline. - -Wed Oct 18 13:07:55 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - - * Version 1.06. - - * vmsgetargs.c (getargs): Downcase specified output file name. - -Fri Oct 13 17:48:14 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - - * reader.c (readgram): Warn if there is no default to use for $$ - and one is needed. - -Fri Sep 29 12:51:53 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - - * Version 1.05. - - * vmsgetargs.h (getargs): Process outfile option. - -Fri Sep 8 03:05:14 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - - * Version 1.04. - - * reader.c (parse_union_decl): Count newlines even in comments. - -Wed Sep 6 22:03:19 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - - * files.c (openfiles): short_base_length was always == base_length. - -Thu Aug 24 16:55:06 1989 Richard Stallman (rms at apple-gunkies.ai.mit.edu) - - * Version 1.03. - - * files.c (openfiles): Write output into same dir as input, by default. - -Wed Aug 23 15:03:07 1989 Jay Fenlason (hack at gnu) - - * Makefile: Include system.h in bison-dist.tar - -Tue Aug 15 22:30:42 1989 Richard Stallman (rms at hobbes.ai.mit.edu) - - * version 1.03. - - * reader.c (reader): Output LTYPESTR to fdefines - only after reading the grammar. - -Sun Aug 6 16:55:23 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - - * reader.c (read_declarations): Put space before comment - to avoid bug in Green Hills C compiler. - -Mon Jun 19 20:14:01 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - - * allocate.c (xmalloc): New function. - -Fri Jun 16 23:59:40 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - - * build.com: Compile and link reduce.c. - -Fri Jun 9 23:00:54 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - - * reduce.c (reduce_grammar_tables): Adjust start_symbol when #s change. - -Sat May 27 17:57:29 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - - * reader.c (copy_definition, copy_guard): Don't object to \-newline - inside strings. - -Mon May 22 12:30:59 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - - * files.c (openfiles): Alternate file names for MSDOS. - (open_extra_files): Likewise. - (done): On MSDOS, unlink temp files here, not in openfiles. - - * machine.h (BITS_PER_WORD): 16 on MSDOS. - (MAXTABLE): Now defined in this file. - - * system.h: New file includes system-dependent headers. - All relevant .c files include it. - -Thu Apr 27 17:00:47 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - - * version.c: Version 1.01. - -Tue Apr 18 12:46:05 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) - - * conflicts.c (total_conflicts): Fixed typo in yacc style output; - mention conflicts if > 0. - -Sat Apr 15 17:36:18 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - - * reader.c (packsymbols): Start new symbols after 256. - -Wed Apr 12 14:09:09 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - - * reader.c (reader): Always assign code 256 to `error' token. - Always set `translations' to 1 so this code gets handled. - * bison.simple (YYERRCODE): Define it. - -Tue Apr 11 19:26:32 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - - * conflicts.c: If GNU C, use builtin alloca. - - * Makefile (install): Delete parser files before copying them. - -Thu Mar 30 13:51:17 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - - * getargs.c (getargs): Turn off checking of name Bison was invoked by. - - * Makefile (dist): Include ChangeLog in distrib. - -Thu Mar 23 15:19:41 1989 Jay Fenlason (hack at apple-gunkies.ai.mit.edu) - - * LR0.c closure.c conflicts.c derives.c files.c getargs.c lalr.c - lex.c main.c nullable.c output.c print.c reader.c reduce.c - symtab.c warshall.c: A first pass at getting gcc -Wall to shut up. - Mostly declared functions as void, etc. - - * reduce.c moved 'extern int fixed_outfiles;' into print_notices - where it belongs. - -Wed Mar 1 12:33:28 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) - - * types.h, symtab.h, state.h, new.h, machine.h, lex.h, gram.h, - files.h, closure.c, vmsgetargs.c, warshall.c, symtab.c, reduce.c, - reader.c, print.c, output.c, nullable.c, main.c, lex.c, lalr.c, - gram.c, getargs.c, files.c, derives.c, conflicts.c, allocate.c, - LR0.c, Makefile, bison.simple: Changed copyright notices to be in - accord with the new General Public License. - * COPYING: Made a link to the new copying file. - -Wed Feb 22 06:18:20 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - - * new.h (FREE): Alternate definition for __STDC__ avoids error - if `free' returns void. - -Tue Feb 21 15:03:34 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - - * reader.c (read_declarations): Double a `%' in a format string. - (copy_definition, parse_start_decl, parse_token_decl): Likewise. - (parse_type_decl, parse_union_decl, copy_guard, readgram, get_type). - (copy_action): change a `fatal' to `fatals'. - - * lalr.c (map_goto): Initial high-end of binary search was off by 1. - -Sat Feb 18 08:49:57 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - - * bison.simple [sparc]: Include alloca.h. - -Wed Feb 15 06:24:36 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - - * reader.c (packsymbols): Write decl of yylval into .tab.h file. - -Sat Jan 28 18:19:05 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - - * bison.simple: Avoid comments on `#line' lines. - - * reader.c (LTYPESTR): Rearrange to avoid whitespace after \-newline. - -Mon Jan 9 18:43:08 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - - * conflicts.c (total_conflicts): if -y, use output syntax POSIX wants. - * reduce.c (print_notices): likewise. - - * lex.c (lex): Handle \v, and \x hex escapes. - - * reader.c (reader): Merge output_ltype into here. - Don't output YYLTYPE definition to .tab.h file - unless the @ construct is used. - - * bison.simple: Define YYERROR, YYABORT, YYACCEPT here. - * reader.c (output_ltype): Don't output them here. - - * bison.simple: YYDEBUG now should be 0 or 1. - * output.c (output): For YYDEBUG, output conditional to define it - only if not previously defined. - -Mon Jan 2 11:29:55 1989 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - - * bison.simple (yyparse) [YYPURE]: Add local yynerrs. - (yydebug): Declare global, but don't initialize, regardless of YYPURE. - (yyparse): Don't declare yydebug here. - -Thu Dec 22 22:01:22 1988 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - - * reduce.c (print_notices): Typo in message. - -Sun Dec 11 11:32:07 1988 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - - * output.c (pack_table): Free only nonzero the elts of froms & tos. - -Thu Dec 8 16:26:46 1988 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - - * gram.c (rprecsym): New vector indicates the %prec symbol for a rule. - * reader.c (packgram): Allocate it and fill it in. - * reduce.c (inaccessable_symbols): Use it to set V1. - * reduce.c (print_results): Don't complain about useless token - if it's in V1. - -Mon Dec 5 14:33:17 1988 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - - * machine.h (RESETBIT, BITISSET): New macros. - (SETBIT, WORDSIZE): Change to use BITS_PER_WORD. - - * reduce.c: New file, by David Bakin. Reduces the grammar. - * Makefile: Compile it, link it, put it in dist. - - * main.c (main): Call reduce_grammar (in reduce.c). - -Thu Nov 17 18:33:04 1988 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - - * conflicts.c: Don't declare alloca if including alloca.h. - - * bison.cld: Define qualifiers `nolines', `debug'. - * vmsgetargs.c (getargs): Handle them. - - * output.c (output_program): Notice `nolinesflag'. - - * output.c (output_parser): Simplify logic for -l and #line. - Avoid writing EOF char into output. - -Wed Oct 12 18:00:03 1988 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - - * Implement `-l' option. - * getopt.c: Set flag `nolinesflag'. - * reader.c (copy_definition, parse_union_decl, copy_guard, copy_action) - Obey that flag; don't generate #line. - * output.c (output_parser): Discard #line's when copying the parser. - -Mon Sep 12 16:33:17 1988 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - - * reader.c (copy_guard): Fix brace-counting for brace-surrounded guard. - -Thu Sep 8 20:09:53 1988 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - - * bison.simple: Correct number in #line command. - (yyparse): Call YYABORT instead of YYERROR, due to last change in - output_ltype. - -Mon Sep 5 14:55:30 1988 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - - * Makefile: New variable LIBS. Alternatives for USG. - * conflicts.c [USG]: Define bcopy. - * symtab.c [USG]: Include string.h instead of strings.h. - - * conflicts.c [sparc]: Include alloca.h. - -Tue Aug 2 08:38:38 1988 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - - * reader.c (parse_token_decl): Ignore commas. - -Sat Jun 25 10:29:20 1988 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - - * reader.c (output_ltype): Make YYERROR yacc-compatible (like YYFAIL). - -Fri Jun 24 11:25:11 1988 Richard Stallman (rms at sugar-bombs.ai.mit.edu) - - * getargs.c (getargs): -t sets debugflag. - Eliminate upper case duplicate options. - * output.c (output): If debugflag, output `#define YYDEBUG'. - -Thu May 26 06:04:21 1988 Richard Stallman (rms at frosted-flakes.ai.mit.edu) - - * allocate.c (mallocate): New name for `allocate' (which loses in VMS). - Calls changed in LR0.c, conflicts.c, symtab.c, new.h. - - * getargs.c (getargs): If argv[0] is "yacc", set fixed_outfiles. - -Tue May 17 12:15:30 1988 Richard Stallman (rms at frosted-flakes.ai.mit.edu) - - * conflicts.c: Declare alloca. - * reader.c: Declare realloc. - * warshall.c (TC): Fix one arithmetic op that was omitted last time. - -Thu May 5 14:36:03 1988 Richard Stallman (rms at frosted-flakes.ai.mit.edu) - - * bison.simple: Conditionalize most refs to yylsp on YYLSP_NEEDED. - * reader.c (copy_guard, copy_action): Notice if `@' is used. - (reader): If it was, output `#define YYLSP_NEEDED'. - -Mon Apr 18 04:54:32 1988 Richard Stallman (rms at rice-krispies.ai.mit.edu) - - * bison.simple: New variable yynerr counts calls to yyerror. - - * lex.c (lex, case '='): Update lineno when skipping a newline. - - * reader.c (parse_expect_decl): ungetc the char that ends the number; - don't read any further. This handles multi-line comments right - and avoids incorrect lineno. - - * reader.c: Delete duplicate decl of symval. - - * warshall.c (RTC, TC): Cast ptrs to char *, not unsigned, for arith. diff --git a/contrib/bison/ChangeLog.doc b/contrib/bison/ChangeLog.doc new file mode 100644 index 000000000000..5690ebd5d6d9 --- /dev/null +++ b/contrib/bison/ChangeLog.doc @@ -0,0 +1,101 @@ +Tue Jun 8 19:00:57 1999 Jesse Thilo + + * bison.1: Dropped mention of `+' for long-named options. + +Sun May 30 13:07:48 1999 Jesse Thilo + + * FAQ, Makefile.am: Added a FAQ list. + +Sun Apr 18 16:29:23 1999 Jesse Thilo + + * .cvsignore, Makefile.am: + Reorganized: sources in `src', documentation in `doc'. + +Thu Jan 14 15:08:17 1999 Jesse Thilo + + * bison.texinfo: Fix formatting glitch. + + * bison.texinfo: Update FSF address. + +Wed Dec 30 05:24:00 1998 Jesse Thilo + + * bison.texinfo: + Delete comment "consider using @set for edition number, etc..." since + we now are doing so. + +Sat Nov 28 21:44:16 1998 Jesse Thilo + + * bison.texinfo: Add info dir entry. + + * bison.texinfo: Let automake put version number into documentation. + +Thu Nov 26 00:14:37 1998 Jesse Thilo + + * bison.1: Document the BISON_HAIRY and BISON_SIMPLE variables. + +Wed Nov 25 22:11:01 1998 Jesse Thilo + + * bison.texinfo: Clean up some formatting. + +Tue May 5 22:18:45 1998 Richard Stallman + + * bison.texinfo: Explain better why to make a pure parser. + +Wed Nov 29 01:26:22 1995 Daniel Hagerty + + * bison.texinfo: Fixed update date + +Wed Nov 29 01:22:34 1995 Richard Stallman + + * bison.texinfo: + Describe literal string tokens, %raw, %no_lines, %token_table. + +Mon Oct 16 14:12:23 1995 Richard Stallman + + * bison.1, bison.rnh: Add new options. + +Thu Jun 1 13:54:23 1995 Jim Meyering + + * bison.texinfo: *** empty log message *** + +Wed May 3 15:13:10 1995 Richard Stallman + + * bison.texinfo: Rewrite "Conditions for Using Bison". + Update version to 1.24. + +Sun Nov 21 22:03:08 1993 Richard Stallman + + * bison.texinfo: entered into RCS + + * bison.texinfo: *** empty log message *** + +Mon Oct 25 23:45:06 1993 David J. MacKenzie + + * bison.texinfo: *** empty log message *** + +Tue Sep 14 20:43:31 1993 David J. MacKenzie + + * bison.texinfo: *** empty log message *** + +Fri Sep 10 12:02:53 1993 Richard Stallman + + * bison.1: entered into RCS + +Sat Jun 26 20:09:41 1993 David J. MacKenzie + + * bison.texinfo: *** empty log message *** + + * bison.1: Initial revision + +Thu Jun 3 20:24:26 1993 Richard Stallman + + * bison.texinfo: *** empty log message *** + +Wed May 19 03:41:36 1993 Richard Stallman + + * bison.texinfo: Initial revision + +Mon Jun 22 04:07:24 1992 Richard Stallman + + * bison.rnh: entered into RCS + diff --git a/contrib/bison/ChangeLog.src b/contrib/bison/ChangeLog.src new file mode 100644 index 000000000000..429988b58f68 --- /dev/null +++ b/contrib/bison/ChangeLog.src @@ -0,0 +1,480 @@ +Mon Jun 14 22:35:15 1999 Jesse Thilo + + * system.h: Squashed redefinition warning on some systems. + + * Attic/version.c, Makefile.am, getargs.c, reader.c: + Have configure build version string instead of relying on ANSI string + concatentation. + +Sun May 30 13:17:48 1999 Jesse Thilo + + * files.c: Added for unlink(). + + * Makefile.am, system.h: I18n fixes. + +Wed May 19 11:24:34 1999 Jesse Thilo + + * Attic/version.c, alloc.h, symtab.h: + Protected inclusion of "config.h" with HAVE_CONFIG_H. + +Sun Apr 18 16:29:23 1999 Jesse Thilo + + * .cvsignore, Makefile.am: + Reorganized: sources in `src', documentation in `doc'. + + * lex.c (literalchar): + fixed the code for escaping double quotes (thanks + Jonathan Czisny.) + +Tue Apr 13 19:53:41 1999 Jesse Thilo + + * allocate.c: Don't declare calloc() and realloc() if not necessary. + +Mon Mar 22 16:30:00 1999 Jesse Thilo + + * bison.s1: Fixed #line numbers. + +Fri Feb 12 15:18:12 1999 Jesse Thilo + + * files.c, files.h: + Defined locations of parser files in config.h instead of Makefile. + +Wed Jan 20 22:55:06 1999 Jesse Thilo + + * LR0.c, conflicts.c, output.c, reader.c: Hush a few compiler warnings. + + * files.c: Add tryclose(), which verifies that fclose was successful. + Hush a couple of compiler warnings. + +Thu Jan 14 14:58:38 1999 Jesse Thilo + + * gram.h, lalr.c, lex.c, lex.h, machine.h, main.c, nullable.c, output.c, print.c, reader.c, reduce.c, state.h, symtab.c, symtab.h, types.h, vmsgetargs.c, warshall.c, LR0.c, alloc.h, allocate.c, bison.s1, closure.c, conflicts.c, derives.c, files.c, files.h, getargs.c, gram.c: + Update FSF address. + +Fri Jan 8 21:17:26 1999 Jesse Thilo + + * system.h: Don't define PACKAGE here, since config.h defines it. + +Wed Dec 30 06:54:16 1998 Jesse Thilo + + * reader.c: Update copyright date. + + * main.c: + Ditch sprintf to statically-sized buffers in fatal/warn functions in + favor of output directly to stderr (avoids buffer overruns). + + * reader.c: Some checks for premature EOF. + + * LR0.c, alloc.h, allocate.c, closure.c, conflicts.c, derives.c, getargs.c, gram.c, lalr.c, lex.c, main.c, nullable.c, output.c, print.c, reduce.c, symtab.c, symtab.h, warshall.c: + Use prototypes if the compiler understands them. + + * files.c: Honor TMPDIR on Unix hosts. + Use prototypes if the compiler understands them. + + * reader.c: Fix a couple of buffer overrun bugs. + Use prototypes if the compiler understands them. + + * system.h: Include unistd.h and ctype.h. + Use #ifdef instead of #if for NLS symbols. + +Tue Dec 29 21:54:26 1998 Jesse Thilo + + * Attic/version.c: Use VERSION symbol from automake for version number. + +Thu Nov 26 00:44:18 1998 Jesse Thilo + + * bison.cld, build.com, vmshlp.mar: + Add non-RCS files from /gd/gnu/bison. + +Wed Nov 25 22:21:43 1998 Jesse Thilo + + * Attic/version.c: Build version.c automatically. + + * reader.c: Fix token numbering (used to start at 258, not 257). + + * system.h: Include config.h. + + * getargs.c: Update bug report address. + + * alloca.c, getopt.c, getopt.h, getopt1.c: + Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org. + +Mon Jan 5 00:25:39 1998 Richard Stallman + + * files.c (openfiles): [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to + find a temporary directory, if possible. Do not unlink files while + they are open. + +Mon Aug 25 19:40:12 1997 Richard Stallman + + * reader.c (stack_offset;): Change some warni to warns. + + * lex.c (literalchar): Use warns, not warni. + +Sat Jun 28 19:41:24 1997 Richard Stallman + + * bison.s1: Add a Bison version comment. + + * main.c (fatal, warn, berror): Use program_name. + +Wed Jun 18 17:09:27 1997 Richard Stallman + + * main.c (fatal, warn, berror): Make error messages standard. + (toomany): Improve error message text. + + * LR0.c, closure.c, conflicts.c, derives.c, files.c, lalr.c, lex.c, nullable.c, output.c, print.c, reader.c, reduce.c, symtab.c: + new.h renamed to alloc.h. + +Sat May 24 08:04:42 1997 Richard Stallman + + * lex.c (literalchar): Fix the code for escaping \, " and '. + + (lex): Avoid trouble when there are many chars + to discard in a char literal with just several chars in it. + +Sat May 17 18:44:24 1997 Richard Stallman + + * bison.s1: Use malloc, if using alloca is troublesome. + (YYSTACK_USE_ALLOCA): New flag macro. + Define it for some systems and compilers. + (YYSTACK_ALLOC): New macro. + (yyparse): Use YYSTACK_ALLOC to allocate stack. + If it was malloc'd, free it. + +Wed Apr 23 18:01:25 1997 Richard Stallman + + * bison.s1: (alloca) [__hpux]: Always define as __builtin_alloca. + +Tue Apr 22 22:23:48 1997 Richard Stallman + + * bison.s1: [__hpux]: Include alloca.h (right for HPUX 10) + instead of declaring alloca (right for HPUX 9). + + * bison.s1 (__yy_memcpy): Declare arg `count' as unsigned int. + (yyparse): Cast third arg to __yy_memcpy to unsigned int. + +Fri Jan 3 01:24:27 1997 Richard Stallman + + * allocate.c: [__STDC__ or _MSC_VER]: + Declare calloc and realloc to return void *. + +Thu Jan 2 07:03:45 1997 Richard Stallman + + * system.h: [_MSC_VER]: Include stdlib.h and process.h. + [_MSC_VER] (getpid): Define as macro--translate it to _getpid. + + * main.c (main): Return FAILURE as a value. + (printable_version): Declare arg as int, not char. + +Thu Dec 19 08:24:56 1996 Richard Stallman + + * files.c: + [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined. + +Wed Dec 18 02:18:10 1996 Paul Eggert + + * bison.s1 (yyparse): If __GNUC__ and YYPARSE_PARAM are both defined, + declare yyparse to have a void * argument. + +Tue Dec 17 06:20:27 1996 Richard Stallman + + * reduce.c (nbits): Add some casts. + +Mon Aug 12 22:17:15 1996 Richard Stallman + + * bison.s1: Test _MSDOS as well as _MSDOS_. + +Wed Jul 31 19:18:57 1996 Richard Stallman + + * bison.s1: [__sun && __i386]: Include alloca.h. + +Tue Jul 30 04:37:37 1996 Richard Stallman + + * bison.s1: Comment change. + + * bison.s1: Test _MSDOS_, not MSDOS. + +Sat Jun 1 22:10:15 1996 Richard Stallman + + * reduce.c, reader.c, print.c, output.c, nullable.c, lex.c, lalr.c, getargs.c, derives.c, conflicts.c, closure.c, allocate.c: + Insert `_' macro around many string constants. + + * main.c: Insert `_' macro around many string constants. + + (main): Call setlocale, bindtextdomain and textdomain. + + * system.h: [HAVE_LOCALE_H]: Include locale.h. + [! HAVE_LOCALE_H] (setlocale): Define as no-op. + [ENABLE_NLS]: Include libintl.h. + [ENABLE_NLS] (gettext): Define. + [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions. + (N_, PACKAGE, LOCALEDIR): New macros. + +Sun May 12 22:17:15 1996 Richard Stallman + + * bison.s1: + (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t. + +Sat May 11 19:19:55 1996 Richard Stallman + + * bison.s1 (__yy_memcpy): + Really reorder the args, as was supposedly done on Feb 14 1995. + (yyparse): Calls changed accordingly. + +Sat Jan 27 08:26:26 1996 Richard Stallman + + * output.c (output_rule_data): Test YYERROR_VERBOSE in the conditional + around the definition of ttyname. + +Fri Dec 29 04:29:18 1995 Richard Stallman + + * bison.s1: Fix line numbers in #line commands. + +Wed Dec 27 12:43:49 1995 Richard Stallman + + * bison.s1 (YYPARSE_PARAM_DECL): In C++, make it always null. + (YYPARSE_PARAM_ARG): New macro. + (yyparse): Use YYPARSE_PARAM_ARG. + +Mon Oct 16 14:12:01 1995 Richard Stallman + + * Attic/version.c: Version 1.25. + +Sun Oct 15 20:22:50 1995 Richard Stallman + + * vmsgetargs.c, getargs.c: Added -n, -k, and -raw switches. + (noparserflag, toknumflag, rawtoknumflag): New variables. + + * symtab.h (SALIAS): New #define for adding aliases to %token. + (struct bucket): Added `alias' field. + + * reduce.c (reduce_grammar): Revise error message. + (print_notices): Remove final `.' from error message. + + * reader.c (reader_output_yylsp): New function. + (readgram): Use `#if 0' around code that accepted %command + inside grammar rules: The documentation doesn't allow it, + and it will fail since the %command processors scan for the next %. + (parse_token_decl): Extended the %token + declaration to allow a multi-character symbol as an alias. + (parse_thong_decl): New function. + (read_declarations): Added %thong declarations. + (read_declarations): Handle NOOP to deal with allowing + % declarations as another means to specify the flags. + (readgram): Allow %prec prior to semantics embedded in a rule. + (skip_to_char, read_declarations, copy_definition) + (parse_token_decl, parse_start_decl, parse_type_decl) + (parse_assoc_decl, parse_union_decl, parse_expect_decl) + (get_type_name, copy_guard, copy_action, readgram) + (get_type, packsymbols): Revised most error messages. + Changed `fatal' to `warnxxx' to avoid aborting for error. + Revised and use multiple warnxxx functions to avoid using VARARGS1. + (read_declarations): Improve the error message for + an invalid character. Do not abort. + (read_declarations, copy_guard, copy_action): Use + printable_version to avoid unprintable characters in printed output. + (parse_expect_decl): Error if argument to %expect exceeds 10 digits. + (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type): + Allow the type of a non-terminal can be given + more than once, as long as all specifications give the same type. + + * output.c: (output_headers, output_trailers, output, output_gram) + (output_rule_data): Implement noparserflag variable. + Implement toknumflag variable. + (output): Call reader_output_yylsp to output LTYPESTR. + + * main.c (main): If reader sees an error, don't process the grammar. + (fatals): Updated to not use VARARGS1. + (printable_version, int_to_string, warn, warni, warns, warnss) + (warnsss): New error reporting functions. Avoid abort for error. + + * lex.h: Added THONG and NOOP for alias processing. + Added SETOPT for the new code that allows setting options with %flags. + + * lex.c: Include getopt.h. Add some extern decls. + (safegetc): New function to deal with EOF gracefully. + (literalchar); new function to deal with reading \ escapes. + (lex): Use literalchar. + (lex): Implemented "..." tokens. + (literalchar, lex, parse_percent_token): Made tokenbuffer + always contain the token. This includes growing the token + buffer while reading an integer. + (parse_percent_token): Replaced if-else statement with percent_table. + (parse_percent_token): Added % declarations as another + way to specify the flags -n, -l, and -r. Also added hooks for + -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires + major changes to files.c. + (lex) Retain in the incoming stream a character following + an incorrect '/'. + (skip_white_space, lex): Revised most error messages + and changed fatal to warn to avoid aborting. + (percent_table): Added %thong declarations. + + * gram.h: Comment changes. + + * files.c (openfiles, open_extra_files, done): Add faction flag + and actfile file. Handle noparserflag. Both for -n switch. + + * conflicts.c (resolve_sr_conflict): Remove use of alloca. + +Sat May 6 05:35:44 1995 Richard Stallman + + * bison.s1: Comment change. + +Wed May 3 14:56:25 1995 Richard Stallman + + * Attic/version.c: Version now 1.24. + + * bison.s1: Change distribution terms. + + * Attic/version.c: Version now 1.23. + +Thu Feb 23 07:43:50 1995 Richard Stallman + + * files.c: Test __VMS_POSIX as well as VMS. + +Tue Feb 14 16:49:32 1995 Jim Meyering + + * bison.s1 (__yy_memcpy): Renamed from __yy_bcopy to avoid + confusion. Reverse FROM and TO arguments to be consistent with + those of memcpy. + +Thu Sep 15 21:39:22 1994 Richard Stallman + + * bison.s1: Update copyright notice and GPL version. + +Tue Jul 12 20:43:44 1994 Richard Stallman + + * reduce.c, reader.c: entered into RCS + +Sat Mar 26 20:33:04 1994 Richard Stallman + + * bison.s1: entered into RCS + +Fri Mar 25 22:52:41 1994 Richard Stallman + + * main.c: entered into RCS + +Thu Mar 24 22:54:32 1994 Richard Stallman + + * conflicts.c: entered into RCS + +Sun Nov 21 10:25:13 1993 Richard Stallman + + * bison.s1: *** empty log message *** + +Tue Oct 19 03:55:14 1993 Richard Stallman + + * bison.s1: *** empty log message *** + +Thu Oct 14 16:19:10 1993 Richard Stallman + + * bison.s1: *** empty log message *** + +Fri Sep 10 13:41:02 1993 Richard Stallman + + * conflicts.c: *** empty log message *** + + * system.h: entered into RCS + +Mon Sep 6 19:32:26 1993 Noah Friedman + + * Attic/version.c: entered into RCS + +Sat Jul 24 08:00:44 1993 Richard Stallman + + * bison.s1: *** empty log message *** + +Sun Jul 4 20:07:28 1993 Richard Stallman + + * bison.s1: *** empty log message *** + +Sat Jun 26 20:06:51 1993 David J. MacKenzie + + * getargs.c: entered into RCS + +Fri Jun 25 19:11:46 1993 Richard Stallman + + * getargs.c: Initial revision + +Wed Jun 16 21:02:31 1993 Richard Stallman + + * bison.s1: *** empty log message *** + +Thu Jun 3 17:07:14 1993 Richard Stallman + + * bison.s1: Initial revision + +Wed Apr 28 19:15:14 1993 Noah Friedman + + * reader.c: *** empty log message *** + +Fri Apr 23 16:29:13 1993 Noah Friedman + + * alloc.h: entered into RCS + +Tue Apr 20 06:00:53 1993 David J. MacKenzie + + * Attic/version.c: *** empty log message *** + + * files.c, allocate.c: entered into RCS + + * reader.c: *** empty log message *** + + * lex.c: entered into RCS + + * conflicts.c: Initial revision + + * symtab.c: entered into RCS + + * alloc.h: Initial revision + + * LR0.c: entered into RCS + +Sun Apr 18 05:49:49 1993 Noah Friedman + + * reader.c: Initial revision + + * Attic/version.c: *** empty log message *** + +Thu Apr 15 19:37:53 1993 Richard Stallman + + * main.c, files.c: Initial revision + +Tue Apr 13 18:52:55 1993 Richard Stallman + + * Attic/version.c: Initial revision + +Thu Mar 25 02:45:46 1993 Richard Stallman + + * output.c: entered into RCS + +Mon Jun 22 04:07:22 1992 Richard Stallman + + * vmsgetargs.c: entered into RCS + +Wed Jan 22 04:15:36 1992 Richard Stallman + + * machine.h: entered into RCS + +Sat Dec 21 00:17:44 1991 Richard Stallman + + * lalr.c, closure.c: entered into RCS + +Fri Dec 20 23:55:12 1991 Richard Stallman + + * state.h: entered into RCS + +Wed Dec 18 07:39:50 1991 Richard Stallman + + * print.c, nullable.c, derives.c: entered into RCS + +Sun Nov 3 02:39:18 1991 David J. MacKenzie + + * warshall.c, types.h, symtab.h, lex.h, gram.c, gram.h, files.h: + entered into RCS + +Fri Sep 9 01:04:17 1988 Richard Stallman + + * bison.hairy: entered into RCS + diff --git a/contrib/bison/INSTALL b/contrib/bison/INSTALL index a2c8722ccaff..b42a17ac4640 100644 --- a/contrib/bison/INSTALL +++ b/contrib/bison/INSTALL @@ -167,7 +167,9 @@ operates. `--quiet' `--silent' `-q' - Do not print messages saying which checks are being made. + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually @@ -178,4 +180,3 @@ operates. script, and exit. `configure' also accepts some other, not widely useful, options. - diff --git a/contrib/bison/LR0.c b/contrib/bison/LR0.c index 77cc02514b87..1ed8e92ce4bd 100644 --- a/contrib/bison/LR0.c +++ b/contrib/bison/LR0.c @@ -15,7 +15,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bison; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ /* See comments in state.h for the data structures that represent it. @@ -24,7 +25,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include "system.h" #include "machine.h" -#include "new.h" +#include "alloc.h" #include "gram.h" #include "state.h" @@ -40,20 +41,24 @@ core *first_state; shifts *first_shift; reductions *first_reduction; -int get_state(); -core *new_state(); +int get_state PARAMS((int)); +core *new_state PARAMS((int)); -void new_itemsets(); -void append_states(); -void initialize_states(); -void save_shifts(); -void save_reductions(); -void augment_automaton(); -void insert_start_shift(); -extern void initialize_closure(); -extern void closure(); -extern void finalize_closure(); -extern void toomany(); +void allocate_itemsets PARAMS((void)); +void allocate_storage PARAMS((void)); +void free_storage PARAMS((void)); +void generate_states PARAMS((void)); +void new_itemsets PARAMS((void)); +void append_states PARAMS((void)); +void initialize_states PARAMS((void)); +void save_shifts PARAMS((void)); +void save_reductions PARAMS((void)); +void augment_automaton PARAMS((void)); +void insert_start_shift PARAMS((void)); +extern void initialize_closure PARAMS((int)); +extern void closure PARAMS((short *, int)); +extern void finalize_closure PARAMS((void)); +extern void toomany PARAMS((char *)); static core *this_state; static core *last_state; @@ -78,7 +83,7 @@ static core **state_table; void -allocate_itemsets() +allocate_itemsets (void) { register short *itemp; register int symbol; @@ -123,7 +128,7 @@ allocate_itemsets() void -allocate_storage() +allocate_storage (void) { allocate_itemsets(); @@ -134,7 +139,7 @@ allocate_storage() void -free_storage() +free_storage (void) { FREE(shift_symbol); FREE(redset); @@ -150,7 +155,7 @@ free_storage() /* compute the nondeterministic finite state machine (see state.h for details) from the grammar. */ void -generate_states() +generate_states (void) { allocate_storage(); initialize_closure(nitems); @@ -196,7 +201,7 @@ generate_states() a vector of item numbers activated if that symbol is shifted, and kernel_end[symbol] points after the end of that vector. */ void -new_itemsets() +new_itemsets (void) { register int i; register int shiftcount; @@ -244,7 +249,7 @@ new_itemsets() shiftset is set up as a vector of state numbers of those states. */ void -append_states() +append_states (void) { register int i; register int j; @@ -283,8 +288,7 @@ Create a new state if no equivalent one exists already. Used by append_states */ int -get_state(symbol) -int symbol; +get_state (int symbol) { register int key; register short *isp1; @@ -357,8 +361,7 @@ int symbol; /* subroutine of get_state. create a new state for those items, if necessary. */ core * -new_state(symbol) -int symbol; +new_state (int symbol) { register int n; register core *p; @@ -396,7 +399,7 @@ int symbol; void -initialize_states() +initialize_states (void) { register core *p; /* register unsigned *rp1; JF unused */ @@ -410,7 +413,7 @@ initialize_states() void -save_shifts() +save_shifts (void) { register shifts *p; register short *sp1; @@ -418,7 +421,7 @@ save_shifts() register short *send; p = (shifts *) xmalloc((unsigned) (sizeof(shifts) + - (nshifts - 1) * sizeof(short))); + (nshifts - 1) * sizeof(short))); p->number = this_state->number; p->nshifts = nshifts; @@ -447,7 +450,7 @@ save_shifts() /* find which rules can be used for reduction transitions from the current state and make a reductions structure for the state to record their rule numbers. */ void -save_reductions() +save_reductions (void) { register short *isp; register short *rp1; @@ -475,7 +478,7 @@ save_reductions() if (count) { p = (reductions *) xmalloc((unsigned) (sizeof(reductions) + - (count - 1) * sizeof(short))); + (count - 1) * sizeof(short))); p->number = this_state->number; p->nreds = count; @@ -508,7 +511,7 @@ which has a shift going to the final state, which has a shift to the termination state. Create such states and shifts if they don't happen to exist already. */ void -augment_automaton() +augment_automaton (void) { register int i; register int k; @@ -516,7 +519,7 @@ augment_automaton() register core *statep; register shifts *sp; register shifts *sp2; - register shifts *sp1; + register shifts *sp1 = NULL; sp = first_shift; @@ -548,7 +551,7 @@ augment_automaton() if (sp && sp->number == k) { sp2 = (shifts *) xmalloc((unsigned) (sizeof(shifts) - + sp->nshifts * sizeof(short))); + + sp->nshifts * sizeof(short))); sp2->number = k; sp2->nshifts = sp->nshifts + 1; sp2->shifts[0] = nstates; @@ -681,7 +684,7 @@ augment_automaton() Create the next-to-final state, to which a shift has already been made in the initial state. */ void -insert_start_shift() +insert_start_shift (void) { register core *statep; register shifts *sp; diff --git a/contrib/bison/Makefile.am b/contrib/bison/Makefile.am new file mode 100644 index 000000000000..71b8759c6175 --- /dev/null +++ b/contrib/bison/Makefile.am @@ -0,0 +1,27 @@ +## Process this file with automake to produce Makefile.in -*-Makefile-*- +AUTOMAKE_OPTIONS = 1.4 ansi2knr + +bin_PROGRAMS = bison + +bison_SOURCES = LR0.c allocate.c closure.c conflicts.c derives.c \ + files.c getargs.c gram.c lalr.c lex.c main.c nullable.c output.c \ + print.c reader.c reduce.c symtab.c warshall.c getopt.c getopt1.c + +EXTRA_bison_SOURCES = vmsgetargs.c + +bison_LDADD = @INTLLIBS@ @ALLOCA@ +INCLUDES = -I../intl -I$(top_srcdir)/intl + +noinst_HEADERS = alloc.h files.h gram.h lex.h machine.h state.h \ + symtab.h system.h types.h getopt.h + +data_DATA = bison.simple bison.hairy + +EXTRA_DIST = bison.s1 bison.hairy build.com bison.cld vmshlp.mar + +bison.simple: bison.s1 Makefile + -rm -f $@ + sed -e "/^#line/ s|bison|$(datadir)/bison|" -e "s/@bison_version@/$(VERSION)/" < $(srcdir)/bison.s1 > $@-tmp + mv $@-tmp $@ + +DISTCLEANFILES = bison.simple diff --git a/contrib/bison/Makefile.in b/contrib/bison/Makefile.in index baabbf963cbb..2ba72b63db59 100644 --- a/contrib/bison/Makefile.in +++ b/contrib/bison/Makefile.in @@ -1,191 +1,451 @@ -# Makefile for bison -# Copyright (C) 1988, 1989, 1991, 1993 Bob Corbett and Free Software Foundation, Inc. -# -# This file is part of Bison, the GNU Compiler Compiler. -# -# Bison is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# Bison is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Bison; see the file COPYING. If not, write to -# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +# Makefile.in generated automatically by automake 1.4 from Makefile.am -#### Start of system configuration section. #### +# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + +SHELL = @SHELL@ srcdir = @srcdir@ +top_srcdir = @top_srcdir@ VPATH = @srcdir@ - -CC = @CC@ -INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_DATA = @INSTALL_DATA@ -MAKEINFO = makeinfo - -# Things you might add to DEFS: -# -DSTDC_HEADERS If you have ANSI C headers and libraries. -# -DHAVE_STRING_H If you don't have ANSI C headers but have string.h. -# -DHAVE_MEMORY_H If you don't have ANSI C headers and have memory.h. -# -DHAVE_STRERROR If you have strerror function. -DEFS = @DEFS@ - -CFLAGS = -g -LDFLAGS = - -LIBS = @LIBS@ - -# Some System V machines do not come with libPW. If this is true, use -# the GNU alloca.o here. -ALLOCA = @ALLOCA@ - prefix = @prefix@ exec_prefix = @exec_prefix@ -# where the installed binary goes -bindir = $(exec_prefix)/bin +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include -# where the parsers go -datadir = $(prefix)/share +DESTDIR = -# where the info files go -infodir = $(prefix)/info +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ -# where manual pages go and what their extensions should be -mandir = $(prefix)/man/man$(manext) -manext = 1 +top_builddir = .. -#### End of system configuration section. #### +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ -DISTFILES = COPYING ChangeLog Makefile.in configure configure.in \ - REFERENCES bison.1 bison.rnh configure.bat \ - bison.simple bison.hairy \ - LR0.c allocate.c closure.c conflicts.c derives.c \ - files.c getargs.c gram.c lalr.c lex.c main.c nullable.c \ - output.c print.c reader.c reduce.c symtab.c version.c \ - warshall.c files.h gram.h lex.h machine.h new.h state.h \ - symtab.h system.h types.h bison.cld build.com vmsgetargs.c \ - vmshlp.mar README INSTALL NEWS bison.texinfo bison.info* texinfo.tex \ - getopt.c getopt.h getopt1.c alloca.c mkinstalldirs install-sh +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CPP = @CPP@ +DATADIRNAME = @DATADIRNAME@ +GENCAT = @GENCAT@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GT_NO = @GT_NO@ +GT_YES = @GT_YES@ +INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@ +INSTOBJEXT = @INSTOBJEXT@ +INTLDEPS = @INTLDEPS@ +INTLLIBS = @INTLLIBS@ +INTLOBJS = @INTLOBJS@ +MAKEINFO = @MAKEINFO@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +PACKAGE = @PACKAGE@ +POFILES = @POFILES@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +U = @U@ +USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +l = @l@ + +AUTOMAKE_OPTIONS = 1.4 ansi2knr + +bin_PROGRAMS = bison + +bison_SOURCES = LR0.c allocate.c closure.c conflicts.c derives.c files.c getargs.c gram.c lalr.c lex.c main.c nullable.c output.c print.c reader.c reduce.c symtab.c warshall.c getopt.c getopt1.c -SHELL = /bin/sh +EXTRA_bison_SOURCES = vmsgetargs.c -# This rule allows us to supply the necessary -D options -# in addition to whatever the user asks for. -.c.o: - $(CC) -c $(DEFS) -I$(srcdir)/../include $(CPPFLAGS) $(CFLAGS) $< +bison_LDADD = @INTLLIBS@ @ALLOCA@ +INCLUDES = -I../intl -I$(top_srcdir)/intl -# names of parser files -PFILE = bison.simple -PFILE1 = bison.hairy +noinst_HEADERS = alloc.h files.h gram.h lex.h machine.h state.h symtab.h system.h types.h getopt.h -PFILES = -DXPFILE=\"$(datadir)/$(PFILE)\" \ - -DXPFILE1=\"$(datadir)/$(PFILE1)\" -OBJECTS = LR0.o allocate.o closure.o conflicts.o derives.o files.o \ - getargs.o gram.o lalr.o lex.o \ - main.o nullable.o output.o print.o reader.o reduce.o symtab.o \ - warshall.o version.o \ - getopt.o getopt1.o $(ALLOCA) +data_DATA = bison.simple bison.hairy -all: bison bison.info bison.s1 +EXTRA_DIST = bison.s1 bison.hairy build.com bison.cld vmshlp.mar -Makefile: Makefile.in config.status - ./config.status +DISTCLEANFILES = bison.simple +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = ../config.h +CONFIG_CLEAN_FILES = +PROGRAMS = $(bin_PROGRAMS) -config.status: configure - ./config.status --recheck -configure: configure.in - cd $(srcdir); autoconf +DEFS = @DEFS@ -I. -I$(srcdir) -I.. +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +ANSI2KNR = @ANSI2KNR@ +bison_OBJECTS = LR0$U.o allocate$U.o closure$U.o conflicts$U.o \ +derives$U.o files$U.o getargs$U.o gram$U.o lalr$U.o lex$U.o main$U.o \ +nullable$U.o output$U.o print$U.o reader$U.o reduce$U.o symtab$U.o \ +warshall$U.o getopt$U.o getopt1$U.o +bison_DEPENDENCIES = @ALLOCA@ +bison_LDFLAGS = +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ +DATA = $(data_DATA) -# Copy bison.simple, inserting directory name into the #line commands. -bison.s1: bison.simple - -rm -f bison.s1 - sed -e "/^#line/ s|bison|$(datadir)/bison|" < $(srcdir)/$(PFILE) > bison.s1 +HEADERS = $(noinst_HEADERS) -clean: - rm -f *.o core bison bison.s1 +DIST_COMMON = ChangeLog Makefile.am Makefile.in alloca.c ansi2knr.1 \ +ansi2knr.c -mostlyclean: clean -distclean: clean - rm -f Makefile config.status +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) -realclean: distclean - rm -f TAGS *.info* +TAR = tar +GZIP_ENV = --best +SOURCES = $(bison_SOURCES) $(EXTRA_bison_SOURCES) +OBJECTS = $(bison_OBJECTS) -# Most of these deps are in case using RCS. -install: all bison.1 $(srcdir)/$(PFILE) $(srcdir)/$(PFILE1) installdirs uninstall - $(INSTALL_PROGRAM) bison $(bindir)/bison - $(INSTALL_DATA) bison.s1 $(datadir)/$(PFILE) - $(INSTALL_DATA) $(srcdir)/$(PFILE1) $(datadir)/$(PFILE1) - cd $(srcdir); for f in bison.info*; \ - do $(INSTALL_DATA) $$f $(infodir)/$$f; done - -$(INSTALL_DATA) $(srcdir)/bison.1 $(mandir)/bison.$(manext) +all: all-redirect +.SUFFIXES: +.SUFFIXES: .S .c .o .s +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps src/Makefile -# Make sure all installation directories, e.g. $(bindir) actually exist by -# making them if necessary. -installdirs: - -sh $(srcdir)/mkinstalldirs $(bindir) $(datadir) $(libdir) $(infodir) $(mandir) +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status -uninstall: - rm -f $(bindir)/bison - -cd $(datadir); rm -f $(PFILE) $(PFILE1) - rm -f $(mandir)/bison.$(manext) $(infodir)/bison.info* -check: - @echo "No checks implemented (yet)." +mostlyclean-binPROGRAMS: -bison: $(OBJECTS) - $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(OBJECTS) $(LIBS) +clean-binPROGRAMS: + -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) -# We don't use $(srcdir) in this rule -# because it is normally used in the master source dir -# in which configure has not been run. -dist: bison.info - echo bison-`sed -e '/version_string/!d' -e 's/[^0-9.]*\([0-9.]*\).*/\1/' -e q version.c` > .fname - -rm -rf `cat .fname` - mkdir `cat .fname` - dst=`cat .fname`; for f in $(DISTFILES); do \ - ln $$f $$dst/$$f || { echo copying $$f; cp -p $$f $$dst/$$f ; } \ +distclean-binPROGRAMS: + +maintainer-clean-binPROGRAMS: + +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(bindir) + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + if test -f $$p; then \ + echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \ + $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ + else :; fi; \ done - tar --gzip -chf `cat .fname`.tar.gz `cat .fname` - -rm -rf `cat .fname` .fname -bison.info: bison.texinfo - $(MAKEINFO) $(srcdir)/bison.texinfo +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + list='$(bin_PROGRAMS)'; for p in $$list; do \ + rm -f $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ + done -TAGS: *.c *.h - etags *.c *.h +.c.o: + $(COMPILE) -c $< -# This file is different to pass the parser file names to the compiler. -files.o: files.c - $(CC) -c $(PFILES) $(DEFS) $(CPPFLAGS) $(CFLAGS) \ - $(srcdir)/files.c $(OUTPUT_OPTION) +.s.o: + $(COMPILE) -c $< -LR0.o: system.h machine.h new.h gram.h state.h -closure.o: system.h machine.h new.h gram.h -conflicts.o: system.h machine.h new.h files.h gram.h state.h -derives.o: system.h new.h types.h gram.h -files.o: system.h files.h new.h gram.h -getargs.o: system.h files.h -lalr.o: system.h machine.h types.h state.h new.h gram.h -lex.o: system.h files.h symtab.h lex.h -main.o: system.h machine.h -nullable.o: system.h types.h gram.h new.h -output.o: system.h machine.h new.h files.h gram.h state.h -print.o: system.h machine.h new.h files.h gram.h state.h -reader.o: system.h files.h new.h symtab.h lex.h gram.h -reduce.o: system.h machine.h files.h new.h gram.h -symtab.o: system.h new.h symtab.h gram.h -warshall.o: system.h machine.h +.S.o: + $(COMPILE) -c $< -# Prevent GNU make v3 from overflowing arg limit on SysV. +mostlyclean-compile: + -rm -f *.o core *.core + +clean-compile: + +distclean-compile: + -rm -f *.tab.c + +maintainer-clean-compile: + +mostlyclean-krextra: + +clean-krextra: + -rm -f ansi2knr + +distclean-krextra: + +maintainer-clean-krextra: +ansi2knr: ansi2knr.o + $(LINK) ansi2knr.o $(LIBS) +ansi2knr.o: $(CONFIG_HEADER) + + +mostlyclean-kr: + -rm -f *_.c + +clean-kr: + +distclean-kr: + +maintainer-clean-kr: + +bison: $(bison_OBJECTS) $(bison_DEPENDENCIES) + @rm -f bison + $(LINK) $(bison_LDFLAGS) $(bison_OBJECTS) $(bison_LDADD) $(LIBS) +LR0_.c: LR0.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/LR0.c; then echo $(srcdir)/LR0.c; else echo LR0.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > LR0_.c +alloca_.c: alloca.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/alloca.c; then echo $(srcdir)/alloca.c; else echo alloca.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > alloca_.c +allocate_.c: allocate.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/allocate.c; then echo $(srcdir)/allocate.c; else echo allocate.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > allocate_.c +closure_.c: closure.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/closure.c; then echo $(srcdir)/closure.c; else echo closure.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > closure_.c +conflicts_.c: conflicts.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/conflicts.c; then echo $(srcdir)/conflicts.c; else echo conflicts.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > conflicts_.c +derives_.c: derives.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/derives.c; then echo $(srcdir)/derives.c; else echo derives.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > derives_.c +files_.c: files.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/files.c; then echo $(srcdir)/files.c; else echo files.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > files_.c +getargs_.c: getargs.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/getargs.c; then echo $(srcdir)/getargs.c; else echo getargs.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > getargs_.c +getopt_.c: getopt.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/getopt.c; then echo $(srcdir)/getopt.c; else echo getopt.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > getopt_.c +getopt1_.c: getopt1.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/getopt1.c; then echo $(srcdir)/getopt1.c; else echo getopt1.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > getopt1_.c +gram_.c: gram.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/gram.c; then echo $(srcdir)/gram.c; else echo gram.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > gram_.c +lalr_.c: lalr.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/lalr.c; then echo $(srcdir)/lalr.c; else echo lalr.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > lalr_.c +lex_.c: lex.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/lex.c; then echo $(srcdir)/lex.c; else echo lex.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > lex_.c +main_.c: main.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/main.c; then echo $(srcdir)/main.c; else echo main.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > main_.c +nullable_.c: nullable.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/nullable.c; then echo $(srcdir)/nullable.c; else echo nullable.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > nullable_.c +output_.c: output.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/output.c; then echo $(srcdir)/output.c; else echo output.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > output_.c +print_.c: print.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/print.c; then echo $(srcdir)/print.c; else echo print.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > print_.c +reader_.c: reader.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/reader.c; then echo $(srcdir)/reader.c; else echo reader.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > reader_.c +reduce_.c: reduce.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/reduce.c; then echo $(srcdir)/reduce.c; else echo reduce.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > reduce_.c +symtab_.c: symtab.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/symtab.c; then echo $(srcdir)/symtab.c; else echo symtab.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > symtab_.c +vmsgetargs_.c: vmsgetargs.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/vmsgetargs.c; then echo $(srcdir)/vmsgetargs.c; else echo vmsgetargs.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > vmsgetargs_.c +warshall_.c: warshall.c $(ANSI2KNR) + $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/warshall.c; then echo $(srcdir)/warshall.c; else echo warshall.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > warshall_.c +LR0_.o alloca_.o allocate_.o closure_.o conflicts_.o derives_.o \ +files_.o getargs_.o getopt_.o getopt1_.o gram_.o lalr_.o lex_.o main_.o \ +nullable_.o output_.o print_.o reader_.o reduce_.o symtab_.o \ +vmsgetargs_.o warshall_.o : $(ANSI2KNR) + +install-dataDATA: $(data_DATA) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(datadir) + @list='$(data_DATA)'; for p in $$list; do \ + if test -f $(srcdir)/$$p; then \ + echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(datadir)/$$p"; \ + $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(datadir)/$$p; \ + else if test -f $$p; then \ + echo " $(INSTALL_DATA) $$p $(DESTDIR)$(datadir)/$$p"; \ + $(INSTALL_DATA) $$p $(DESTDIR)$(datadir)/$$p; \ + fi; fi; \ + done + +uninstall-dataDATA: + @$(NORMAL_UNINSTALL) + list='$(data_DATA)'; for p in $$list; do \ + rm -f $(DESTDIR)$(datadir)/$$p; \ + done + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $$unique $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = src + +distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done +LR0.o: LR0.c system.h ../config.h getopt.h machine.h alloc.h gram.h \ + state.h +allocate.o: allocate.c system.h ../config.h getopt.h +closure.o: closure.c system.h ../config.h getopt.h machine.h alloc.h \ + gram.h +conflicts.o: conflicts.c system.h ../config.h getopt.h machine.h alloc.h \ + files.h gram.h state.h +derives.o: derives.c system.h ../config.h getopt.h alloc.h types.h \ + gram.h +files.o: files.c system.h ../config.h getopt.h files.h alloc.h gram.h +getargs.o: getargs.c getopt.h system.h ../config.h files.h +getopt.o: getopt.c ../config.h +getopt1.o: getopt1.c ../config.h getopt.h +gram.o: gram.c +lalr.o: lalr.c system.h ../config.h getopt.h machine.h types.h state.h \ + alloc.h gram.h +lex.o: lex.c system.h ../config.h getopt.h files.h symtab.h lex.h \ + alloc.h +main.o: main.c system.h ../config.h getopt.h machine.h +nullable.o: nullable.c system.h ../config.h getopt.h types.h gram.h \ + alloc.h +output.o: output.c system.h ../config.h getopt.h machine.h alloc.h \ + files.h gram.h state.h +print.o: print.c system.h ../config.h getopt.h machine.h alloc.h files.h \ + gram.h state.h +reader.o: reader.c system.h ../config.h getopt.h files.h alloc.h \ + symtab.h lex.h gram.h machine.h +reduce.o: reduce.c system.h ../config.h getopt.h files.h gram.h \ + machine.h alloc.h +symtab.o: symtab.c system.h ../config.h getopt.h alloc.h symtab.h gram.h +warshall.o: warshall.c system.h ../config.h getopt.h machine.h + +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: all-am +check: check-am +installcheck-am: +installcheck: installcheck-am +install-exec-am: install-binPROGRAMS +install-exec: install-exec-am + +install-data-am: install-dataDATA +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: uninstall-binPROGRAMS uninstall-dataDATA +uninstall: uninstall-am +all-am: Makefile $(ANSI2KNR) $(PROGRAMS) $(DATA) $(HEADERS) +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(datadir) + + +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) + +maintainer-clean-generic: +mostlyclean-am: mostlyclean-binPROGRAMS mostlyclean-compile \ + mostlyclean-krextra mostlyclean-kr mostlyclean-tags \ + mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-binPROGRAMS clean-compile clean-krextra clean-kr \ + clean-tags clean-generic mostlyclean-am + +clean: clean-am + +distclean-am: distclean-binPROGRAMS distclean-compile distclean-krextra \ + distclean-kr distclean-tags distclean-generic clean-am + +distclean: distclean-am + +maintainer-clean-am: maintainer-clean-binPROGRAMS \ + maintainer-clean-compile maintainer-clean-krextra \ + maintainer-clean-kr maintainer-clean-tags \ + maintainer-clean-generic distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-am + +.PHONY: mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \ +maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \ +mostlyclean-compile distclean-compile clean-compile \ +maintainer-clean-compile mostlyclean-krextra distclean-krextra \ +clean-krextra maintainer-clean-krextra mostlyclean-kr distclean-kr \ +clean-kr maintainer-clean-kr uninstall-dataDATA install-dataDATA tags \ +mostlyclean-tags distclean-tags clean-tags maintainer-clean-tags \ +distdir info-am info dvi-am dvi check check-am installcheck-am \ +installcheck install-exec-am install-exec install-data-am install-data \ +install-am install uninstall-am uninstall all-redirect all-am all \ +installdirs mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +bison.simple: bison.s1 Makefile + -rm -f $@ + sed -e "/^#line/ s|bison|$(datadir)/bison|" -e "s/@bison_version@/$(VERSION)/" < $(srcdir)/bison.s1 > $@-tmp + mv $@-tmp $@ + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/contrib/bison/NEWS b/contrib/bison/NEWS index db839bdd6783..e147df8f6ffb 100644 --- a/contrib/bison/NEWS +++ b/contrib/bison/NEWS @@ -1,7 +1,39 @@ Bison News ---------- -Change in version 1.25: +Changes in version 1.28: + +* Should compile better now with K&R compilers. + +* Added NLS. + +* Fixed a problem with escaping the double quote character. + +* There is now a FAQ. + +Changes in version 1.27: + +* The make rule which prevented bison.simple from being created on + some systems has been fixed. + +Changes in version 1.26: + +* Bison now uses automake. + +* New mailing lists: and . + +* Token numbers now start at 257 as previously documented, not 258. + +* Bison honors the TMPDIR environment variable. + +* A couple of buffer overruns have been fixed. + +* Problems when closing files should now be reported. + +* Generated parsers should now work even on operating systems which do + not provide alloca(). + +Changes in version 1.25: * Errors in the input grammar are not fatal; Bison keeps reading the grammar file, and reports all the errors found in it. diff --git a/contrib/bison/README b/contrib/bison/README index ea5f743d43ad..9f415dfd4082 100644 --- a/contrib/bison/README +++ b/contrib/bison/README @@ -1,6 +1,7 @@ This directory contains the Bison parser generator. See the file INSTALL for compilation and installation instructions. +See the file doc/FAQ for frequently asked questions. It was once true that, when installing Bison on Sequent (or Pyramid?) systems, you had to be in the Berkeley universe. This may no longer @@ -10,6 +11,13 @@ On VMS, you will probably have to create Makefile from Makefile.in by hand. Remember to do `SET COMMAND BISON' to install the data in `BISON.CLD'. -Send bug reports to bug-gnu-utils@prep.ai.mit.edu. Please include the -version number from `bison --version', and a complete, self-contained -test case in each bug report. +VMS and MS-DOS builds are probably broken right now. If you are able +to build Bison on either platform and you need to make changes to do +so, please submit those changes as a bug report. + +Send bug reports to bug-bison@gnu.org. Please include the version +number from `bison --version', and a complete, self-contained test +case in each bug report. + +If you have questions about using Bison which the documentation does +not answer, send mail to help-bison@gnu.org. diff --git a/contrib/bison/acconfig.h b/contrib/bison/acconfig.h new file mode 100644 index 000000000000..0218c127b582 --- /dev/null +++ b/contrib/bison/acconfig.h @@ -0,0 +1,56 @@ +#ifndef CONFIG_H +#define CONFIG_H +@TOP@ + +/* Name of package. */ +#undef PACKAGE + +/* Version of package. */ +#undef VERSION + +/* Version string. */ +#undef VERSION_STRING + +/* Define if the compiler understands prototypes. */ +#undef PROTOTYPES + +/* Define to 1 if NLS is requested. */ +#undef ENABLE_NLS + +/* Define as 1 if you have catgets and don't want to use GNU gettext. */ +#undef HAVE_CATGETS + +/* Define as 1 if you have gettext and don't want to use GNU gettext. */ +#undef HAVE_GETTEXT + +/* Define if your locale.h file contains LC_MESSAGES. */ +#undef HAVE_LC_MESSAGES + +/* Define to 1 if you have the stpcpy function. */ +#undef HAVE_STPCPY + +/* The location of the simple parser (bison.simple). */ +#undef XPFILE + +/* The location of the semantic parser (bison.hairy). */ +#undef XPFILE1 + +/* The location of the local directory. */ +#undef LOCALEDIR + +/* Define as 1 if realloc must be declared even if is + included. */ +#undef NEED_DECLARATION_REALLOC + +/* Define as 1 if calloc must be declared even if is + included. */ +#undef NEED_DECLARATION_CALLOC +@BOTTOM@ + +#if defined(PROTOTYPES) || defined(__cplusplus) +# define PARAMS(p) p +#else +# define PARAMS(p) () +#endif + +#endif /* CONFIG_H */ diff --git a/contrib/bison/acinclude.m4 b/contrib/bison/acinclude.m4 new file mode 100644 index 000000000000..8c909d2b9161 --- /dev/null +++ b/contrib/bison/acinclude.m4 @@ -0,0 +1,60 @@ +dnl BISON_DEFINE_FILE(VARNAME, FILE) +dnl Defines (with AC_DEFINE) VARNAME to the expansion of the FILE +dnl variable, expanding ${prefix} and such. +dnl Example: BISON_DEFINE_FILE(DATADIR, datadir) +dnl By Alexandre Oliva +AC_DEFUN(BISON_DEFINE_FILE, [ + ac_expanded=`( + test "x$prefix" = xNONE && prefix="$ac_default_prefix" + test "x$exec_prefix" = xNONE && exec_prefix="${prefix}" + eval echo \""[$]$2"\" + )` + AC_DEFINE_UNQUOTED($1, "$ac_expanded") +]) + +dnl See whether we need a declaration for a function. +dnl BISON_NEED_DECLARATION(FUNCTION [, EXTRA-HEADER-FILES]) +AC_DEFUN(BISON_NEED_DECLARATION, +[AC_MSG_CHECKING([whether $1 must be declared]) +AC_CACHE_VAL(bison_cv_decl_needed_$1, +[AC_TRY_COMPILE([ +#include +#ifdef HAVE_STRING_H +#include +#else +#ifdef HAVE_STRINGS_H +#include +#endif +#endif +#ifdef HAVE_STDLIB_H +#include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif +#ifndef HAVE_RINDEX +#define rindex strrchr +#endif +#ifndef HAVE_INDEX +#define index strchr +#endif +$2], +[char *(*pfn) = (char *(*)) $1], +eval "bison_cv_decl_needed_$1=no", eval "bison_cv_decl_needed_$1=yes")]) +if eval "test \"`echo '$bison_cv_decl_needed_'$1`\" = yes"; then + AC_MSG_RESULT(yes) + bison_tr_decl=NEED_DECLARATION_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + AC_DEFINE_UNQUOTED($bison_tr_decl) +else + AC_MSG_RESULT(no) +fi +])dnl + +dnl Check multiple functions to see whether each needs a declaration. +dnl BISON_NEED_DECLARATIONS(FUNCTION... [, EXTRA-HEADER-FILES]) +AC_DEFUN(BISON_NEED_DECLARATIONS, +[for ac_func in $1 +do +BISON_NEED_DECLARATION($ac_func, $2) +done +]) diff --git a/contrib/bison/aclocal.m4 b/contrib/bison/aclocal.m4 new file mode 100644 index 000000000000..b1a3e91698e1 --- /dev/null +++ b/contrib/bison/aclocal.m4 @@ -0,0 +1,682 @@ +dnl aclocal.m4 generated automatically by aclocal 1.4 + +dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without +dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A +dnl PARTICULAR PURPOSE. + +dnl BISON_DEFINE_FILE(VARNAME, FILE) +dnl Defines (with AC_DEFINE) VARNAME to the expansion of the FILE +dnl variable, expanding ${prefix} and such. +dnl Example: BISON_DEFINE_FILE(DATADIR, datadir) +dnl By Alexandre Oliva +AC_DEFUN(BISON_DEFINE_FILE, [ + ac_expanded=`( + test "x$prefix" = xNONE && prefix="$ac_default_prefix" + test "x$exec_prefix" = xNONE && exec_prefix="${prefix}" + eval echo \""[$]$2"\" + )` + AC_DEFINE_UNQUOTED($1, "$ac_expanded") +]) + +dnl See whether we need a declaration for a function. +dnl BISON_NEED_DECLARATION(FUNCTION [, EXTRA-HEADER-FILES]) +AC_DEFUN(BISON_NEED_DECLARATION, +[AC_MSG_CHECKING([whether $1 must be declared]) +AC_CACHE_VAL(bison_cv_decl_needed_$1, +[AC_TRY_COMPILE([ +#include +#ifdef HAVE_STRING_H +#include +#else +#ifdef HAVE_STRINGS_H +#include +#endif +#endif +#ifdef HAVE_STDLIB_H +#include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif +#ifndef HAVE_RINDEX +#define rindex strrchr +#endif +#ifndef HAVE_INDEX +#define index strchr +#endif +$2], +[char *(*pfn) = (char *(*)) $1], +eval "bison_cv_decl_needed_$1=no", eval "bison_cv_decl_needed_$1=yes")]) +if eval "test \"`echo '$bison_cv_decl_needed_'$1`\" = yes"; then + AC_MSG_RESULT(yes) + bison_tr_decl=NEED_DECLARATION_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + AC_DEFINE_UNQUOTED($bison_tr_decl) +else + AC_MSG_RESULT(no) +fi +])dnl + +dnl Check multiple functions to see whether each needs a declaration. +dnl BISON_NEED_DECLARATIONS(FUNCTION... [, EXTRA-HEADER-FILES]) +AC_DEFUN(BISON_NEED_DECLARATIONS, +[for ac_func in $1 +do +BISON_NEED_DECLARATION($ac_func, $2) +done +]) + +# Do all the work for Automake. This macro actually does too much -- +# some checks are only needed if your package does certain things. +# But this isn't really a big deal. + +# serial 1 + +dnl Usage: +dnl AM_INIT_AUTOMAKE(package,version, [no-define]) + +AC_DEFUN(AM_INIT_AUTOMAKE, +[AC_REQUIRE([AC_PROG_INSTALL]) +PACKAGE=[$1] +AC_SUBST(PACKAGE) +VERSION=[$2] +AC_SUBST(VERSION) +dnl test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi +ifelse([$3],, +AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) +AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) +AC_REQUIRE([AM_SANITY_CHECK]) +AC_REQUIRE([AC_ARG_PROGRAM]) +dnl FIXME This is truly gross. +missing_dir=`cd $ac_aux_dir && pwd` +AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) +AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) +AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) +AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) +AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) +AC_REQUIRE([AC_PROG_MAKE_SET])]) + +# +# Check to make sure that the build environment is sane. +# + +AC_DEFUN(AM_SANITY_CHECK, +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "[$]*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "[$]*" != "X $srcdir/configure conftestfile" \ + && test "[$]*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "[$]2" = conftestfile + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +rm -f conftest* +AC_MSG_RESULT(yes)]) + +dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) +dnl The program must properly implement --version. +AC_DEFUN(AM_MISSING_PROG, +[AC_MSG_CHECKING(for working $2) +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if ($2 --version) < /dev/null > /dev/null 2>&1; then + $1=$2 + AC_MSG_RESULT(found) +else + $1="$3/missing $2" + AC_MSG_RESULT(missing) +fi +AC_SUBST($1)]) + +# Like AC_CONFIG_HEADER, but automatically create stamp file. + +AC_DEFUN(AM_CONFIG_HEADER, +[AC_PREREQ([2.12]) +AC_CONFIG_HEADER([$1]) +dnl When config.status generates a header, we must update the stamp-h file. +dnl This file resides in the same directory as the config header +dnl that is generated. We must strip everything past the first ":", +dnl and everything past the last "/". +AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl +ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>, +<>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>, +<>; do + case " <<$>>CONFIG_HEADERS " in + *" <<$>>am_file "*<<)>> + echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx + ;; + esac + am_indx=`expr "<<$>>am_indx" + 1` +done<<>>dnl>>) +changequote([,]))]) + + +# serial 1 + +# @defmac AC_PROG_CC_STDC +# @maindex PROG_CC_STDC +# @ovindex CC +# If the C compiler in not in ANSI C mode by default, try to add an option +# to output variable @code{CC} to make it so. This macro tries various +# options that select ANSI C on some system or another. It considers the +# compiler to be in ANSI C mode if it handles function prototypes correctly. +# +# If you use this macro, you should check after calling it whether the C +# compiler has been set to accept ANSI C; if not, the shell variable +# @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source +# code in ANSI C, you can make an un-ANSIfied copy of it by using the +# program @code{ansi2knr}, which comes with Ghostscript. +# @end defmac + +AC_DEFUN(AM_PROG_CC_STDC, +[AC_REQUIRE([AC_PROG_CC]) +AC_BEFORE([$0], [AC_C_INLINE]) +AC_BEFORE([$0], [AC_C_CONST]) +dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require +dnl a magic option to avoid problems with ANSI preprocessor commands +dnl like #elif. +dnl FIXME: can't do this because then AC_AIX won't work due to a +dnl circular dependency. +dnl AC_BEFORE([$0], [AC_PROG_CPP]) +AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C) +AC_CACHE_VAL(am_cv_prog_cc_stdc, +[am_cv_prog_cc_stdc=no +ac_save_CC="$CC" +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + AC_TRY_COMPILE( +[#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +], [ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; +], +[am_cv_prog_cc_stdc="$ac_arg"; break]) +done +CC="$ac_save_CC" +]) +if test -z "$am_cv_prog_cc_stdc"; then + AC_MSG_RESULT([none needed]) +else + AC_MSG_RESULT($am_cv_prog_cc_stdc) +fi +case "x$am_cv_prog_cc_stdc" in + x|xno) ;; + *) CC="$CC $am_cv_prog_cc_stdc" ;; +esac +]) + + +# serial 1 + +AC_DEFUN(AM_C_PROTOTYPES, +[AC_REQUIRE([AM_PROG_CC_STDC]) +AC_REQUIRE([AC_PROG_CPP]) +AC_MSG_CHECKING([for function prototypes]) +if test "$am_cv_prog_cc_stdc" != no; then + AC_MSG_RESULT(yes) + AC_DEFINE(PROTOTYPES,1,[Define if compiler has function prototypes]) + U= ANSI2KNR= +else + AC_MSG_RESULT(no) + U=_ ANSI2KNR=./ansi2knr + # Ensure some checks needed by ansi2knr itself. + AC_HEADER_STDC + AC_CHECK_HEADERS(string.h) +fi +AC_SUBST(U)dnl +AC_SUBST(ANSI2KNR)dnl +]) + +# Macro to add for using GNU gettext. +# Ulrich Drepper , 1995. +# +# This file can be copied and used freely without restrictions. It can +# be used in projects which are not available under the GNU Public License +# but which still want to provide support for the GNU gettext functionality. +# Please note that the actual code is *not* freely available. + +# serial 5 + +AC_DEFUN(AM_WITH_NLS, + [AC_MSG_CHECKING([whether NLS is requested]) + dnl Default is enabled NLS + AC_ARG_ENABLE(nls, + [ --disable-nls do not use Native Language Support], + USE_NLS=$enableval, USE_NLS=yes) + AC_MSG_RESULT($USE_NLS) + AC_SUBST(USE_NLS) + + USE_INCLUDED_LIBINTL=no + + dnl If we use NLS figure out what method + if test "$USE_NLS" = "yes"; then + AC_DEFINE(ENABLE_NLS) + AC_MSG_CHECKING([whether included gettext is requested]) + AC_ARG_WITH(included-gettext, + [ --with-included-gettext use the GNU gettext library included here], + nls_cv_force_use_gnu_gettext=$withval, + nls_cv_force_use_gnu_gettext=no) + AC_MSG_RESULT($nls_cv_force_use_gnu_gettext) + + nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" + if test "$nls_cv_force_use_gnu_gettext" != "yes"; then + dnl User does not insist on using GNU NLS library. Figure out what + dnl to use. If gettext or catgets are available (in this order) we + dnl use this. Else we have to fall back to GNU NLS library. + dnl catgets is only used if permitted by option --with-catgets. + nls_cv_header_intl= + nls_cv_header_libgt= + CATOBJEXT=NONE + + AC_CHECK_HEADER(libintl.h, + [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc, + [AC_TRY_LINK([#include ], [return (int) gettext ("")], + gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)]) + + if test "$gt_cv_func_gettext_libc" != "yes"; then + AC_CHECK_LIB(intl, bindtextdomain, + [AC_CACHE_CHECK([for gettext in libintl], + gt_cv_func_gettext_libintl, + [AC_CHECK_LIB(intl, gettext, + gt_cv_func_gettext_libintl=yes, + gt_cv_func_gettext_libintl=no)], + gt_cv_func_gettext_libintl=no)]) + fi + + if test "$gt_cv_func_gettext_libc" = "yes" \ + || test "$gt_cv_func_gettext_libintl" = "yes"; then + AC_DEFINE(HAVE_GETTEXT) + AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, + [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl + if test "$MSGFMT" != "no"; then + AC_CHECK_FUNCS(dcgettext) + AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) + AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, + [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) + AC_TRY_LINK(, [extern int _nl_msg_cat_cntr; + return _nl_msg_cat_cntr], + [CATOBJEXT=.gmo + DATADIRNAME=share], + [CATOBJEXT=.mo + DATADIRNAME=lib]) + INSTOBJEXT=.mo + fi + fi + ]) + + if test "$CATOBJEXT" = "NONE"; then + AC_MSG_CHECKING([whether catgets can be used]) + AC_ARG_WITH(catgets, + [ --with-catgets use catgets functions if available], + nls_cv_use_catgets=$withval, nls_cv_use_catgets=no) + AC_MSG_RESULT($nls_cv_use_catgets) + + if test "$nls_cv_use_catgets" = "yes"; then + dnl No gettext in C library. Try catgets next. + AC_CHECK_LIB(i, main) + AC_CHECK_FUNC(catgets, + [AC_DEFINE(HAVE_CATGETS) + INTLOBJS="\$(CATOBJS)" + AC_PATH_PROG(GENCAT, gencat, no)dnl + if test "$GENCAT" != "no"; then + AC_PATH_PROG(GMSGFMT, gmsgfmt, no) + if test "$GMSGFMT" = "no"; then + AM_PATH_PROG_WITH_TEST(GMSGFMT, msgfmt, + [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no) + fi + AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, + [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) + USE_INCLUDED_LIBINTL=yes + CATOBJEXT=.cat + INSTOBJEXT=.cat + DATADIRNAME=lib + INTLDEPS='$(top_builddir)/intl/libintl.a' + INTLLIBS=$INTLDEPS + LIBS=`echo $LIBS | sed -e 's/-lintl//'` + nls_cv_header_intl=intl/libintl.h + nls_cv_header_libgt=intl/libgettext.h + fi]) + fi + fi + + if test "$CATOBJEXT" = "NONE"; then + dnl Neither gettext nor catgets in included in the C library. + dnl Fall back on GNU gettext library. + nls_cv_use_gnu_gettext=yes + fi + fi + + if test "$nls_cv_use_gnu_gettext" = "yes"; then + dnl Mark actions used to generate GNU NLS library. + INTLOBJS="\$(GETTOBJS)" + AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, + [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt) + AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) + AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, + [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) + AC_SUBST(MSGFMT) + USE_INCLUDED_LIBINTL=yes + CATOBJEXT=.gmo + INSTOBJEXT=.mo + DATADIRNAME=share + INTLDEPS='$(top_builddir)/intl/libintl.a' + INTLLIBS=$INTLDEPS + LIBS=`echo $LIBS | sed -e 's/-lintl//'` + nls_cv_header_intl=intl/libintl.h + nls_cv_header_libgt=intl/libgettext.h + fi + + dnl Test whether we really found GNU xgettext. + if test "$XGETTEXT" != ":"; then + dnl If it is no GNU xgettext we define it as : so that the + dnl Makefiles still can work. + if $XGETTEXT --omit-header /dev/null 2> /dev/null; then + : ; + else + AC_MSG_RESULT( + [found xgettext program is not GNU xgettext; ignore it]) + XGETTEXT=":" + fi + fi + + # We need to process the po/ directory. + POSUB=po + else + DATADIRNAME=share + nls_cv_header_intl=intl/libintl.h + nls_cv_header_libgt=intl/libgettext.h + fi + AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl) + AC_OUTPUT_COMMANDS( + [case "$CONFIG_FILES" in *po/Makefile.in*) + sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile + esac]) + + + # If this is used in GNU gettext we have to set USE_NLS to `yes' + # because some of the sources are only built for this goal. + if test "$PACKAGE" = gettext; then + USE_NLS=yes + USE_INCLUDED_LIBINTL=yes + fi + + dnl These rules are solely for the distribution goal. While doing this + dnl we only have to keep exactly one list of the available catalogs + dnl in configure.in. + for lang in $ALL_LINGUAS; do + GMOFILES="$GMOFILES $lang.gmo" + POFILES="$POFILES $lang.po" + done + + dnl Make all variables we use known to autoconf. + AC_SUBST(USE_INCLUDED_LIBINTL) + AC_SUBST(CATALOGS) + AC_SUBST(CATOBJEXT) + AC_SUBST(DATADIRNAME) + AC_SUBST(GMOFILES) + AC_SUBST(INSTOBJEXT) + AC_SUBST(INTLDEPS) + AC_SUBST(INTLLIBS) + AC_SUBST(INTLOBJS) + AC_SUBST(POFILES) + AC_SUBST(POSUB) + ]) + +AC_DEFUN(AM_GNU_GETTEXT, + [AC_REQUIRE([AC_PROG_MAKE_SET])dnl + AC_REQUIRE([AC_PROG_CC])dnl + AC_REQUIRE([AC_PROG_RANLIB])dnl + AC_REQUIRE([AC_ISC_POSIX])dnl + AC_REQUIRE([AC_HEADER_STDC])dnl + AC_REQUIRE([AC_C_CONST])dnl + AC_REQUIRE([AC_C_INLINE])dnl + AC_REQUIRE([AC_TYPE_OFF_T])dnl + AC_REQUIRE([AC_TYPE_SIZE_T])dnl + AC_REQUIRE([AC_FUNC_ALLOCA])dnl + AC_REQUIRE([AC_FUNC_MMAP])dnl + + AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \ +unistd.h sys/param.h]) + AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \ +strdup __argz_count __argz_stringify __argz_next]) + + if test "${ac_cv_func_stpcpy+set}" != "set"; then + AC_CHECK_FUNCS(stpcpy) + fi + if test "${ac_cv_func_stpcpy}" = "yes"; then + AC_DEFINE(HAVE_STPCPY) + fi + + AM_LC_MESSAGES + AM_WITH_NLS + + if test "x$CATOBJEXT" != "x"; then + if test "x$ALL_LINGUAS" = "x"; then + LINGUAS= + else + AC_MSG_CHECKING(for catalogs to be installed) + NEW_LINGUAS= + for lang in ${LINGUAS=$ALL_LINGUAS}; do + case "$ALL_LINGUAS" in + *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;; + esac + done + LINGUAS=$NEW_LINGUAS + AC_MSG_RESULT($LINGUAS) + fi + + dnl Construct list of names of catalog files to be constructed. + if test -n "$LINGUAS"; then + for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done + fi + fi + + dnl The reference to in the installed file + dnl must be resolved because we cannot expect the users of this + dnl to define HAVE_LOCALE_H. + if test $ac_cv_header_locale_h = yes; then + INCLUDE_LOCALE_H="#include " + else + INCLUDE_LOCALE_H="\ +/* The system does not provide the header . Take care yourself. */" + fi + AC_SUBST(INCLUDE_LOCALE_H) + + dnl Determine which catalog format we have (if any is needed) + dnl For now we know about two different formats: + dnl Linux libc-5 and the normal X/Open format + test -d intl || mkdir intl + if test "$CATOBJEXT" = ".cat"; then + AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen) + + dnl Transform the SED scripts while copying because some dumb SEDs + dnl cannot handle comments. + sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed + fi + dnl po2tbl.sed is always needed. + sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \ + $srcdir/intl/po2tbl.sed.in > intl/po2tbl.sed + + dnl In the intl/Makefile.in we have a special dependency which makes + dnl only sense for gettext. We comment this out for non-gettext + dnl packages. + if test "$PACKAGE" = "gettext"; then + GT_NO="#NO#" + GT_YES= + else + GT_NO= + GT_YES="#YES#" + fi + AC_SUBST(GT_NO) + AC_SUBST(GT_YES) + + dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly + dnl find the mkinstalldirs script in another subdir but ($top_srcdir). + dnl Try to locate is. + MKINSTALLDIRS= + if test -n "$ac_aux_dir"; then + MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" + fi + if test -z "$MKINSTALLDIRS"; then + MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" + fi + AC_SUBST(MKINSTALLDIRS) + + dnl *** For now the libtool support in intl/Makefile is not for real. + l= + AC_SUBST(l) + + dnl Generate list of files to be processed by xgettext which will + dnl be included in po/Makefile. + test -d po || mkdir po + if test "x$srcdir" != "x."; then + if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then + posrcprefix="$srcdir/" + else + posrcprefix="../$srcdir/" + fi + else + posrcprefix="../" + fi + rm -f po/POTFILES + sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \ + < $srcdir/po/POTFILES.in > po/POTFILES + ]) + +# Search path for a program which passes the given test. +# Ulrich Drepper , 1996. +# +# This file can be copied and used freely without restrictions. It can +# be used in projects which are not available under the GNU Public License +# but which still want to provide support for the GNU gettext functionality. +# Please note that the actual code is *not* freely available. + +# serial 1 + +dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, +dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) +AC_DEFUN(AM_PATH_PROG_WITH_TEST, +[# Extract the first word of "$2", so it can be a program name with args. +set dummy $2; ac_word=[$]2 +AC_MSG_CHECKING([for $ac_word]) +AC_CACHE_VAL(ac_cv_path_$1, +[case "[$]$1" in + /*) + ac_cv_path_$1="[$]$1" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in ifelse([$5], , $PATH, [$5]); do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if [$3]; then + ac_cv_path_$1="$ac_dir/$ac_word" + break + fi + fi + done + IFS="$ac_save_ifs" +dnl If no 4th arg is given, leave the cache variable unset, +dnl so AC_PATH_PROGS will keep looking. +ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" +])dnl + ;; +esac])dnl +$1="$ac_cv_path_$1" +if test -n "[$]$1"; then + AC_MSG_RESULT([$]$1) +else + AC_MSG_RESULT(no) +fi +AC_SUBST($1)dnl +]) + +# Check whether LC_MESSAGES is available in . +# Ulrich Drepper , 1995. +# +# This file can be copied and used freely without restrictions. It can +# be used in projects which are not available under the GNU Public License +# but which still want to provide support for the GNU gettext functionality. +# Please note that the actual code is *not* freely available. + +# serial 1 + +AC_DEFUN(AM_LC_MESSAGES, + [if test $ac_cv_header_locale_h = yes; then + AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES, + [AC_TRY_LINK([#include ], [return LC_MESSAGES], + am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)]) + if test $am_cv_val_LC_MESSAGES = yes; then + AC_DEFINE(HAVE_LC_MESSAGES) + fi + fi]) + diff --git a/contrib/bison/alloc.h b/contrib/bison/alloc.h new file mode 100644 index 000000000000..9685122e2e31 --- /dev/null +++ b/contrib/bison/alloc.h @@ -0,0 +1,36 @@ +/* Storage allocation interface for bison, + Copyright (C) 1984, 1989 Free Software Foundation, Inc. + +This file is part of Bison, the GNU Compiler Compiler. + +Bison is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +Bison is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Bison; see the file COPYING. If not, write to +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#define NEW(t) ((t *) xmalloc((unsigned) sizeof(t))) +#define NEW2(n, t) ((t *) xmalloc((unsigned) ((n) * sizeof(t)))) + +#ifdef __STDC__ +#define FREE(x) (x ? (void) free((char *) (x)) : (void)0) +#else +#define FREE(x) ((x) != 0 && (free ((char *) (x)), 0)) +#endif + +extern char *xmalloc PARAMS((register unsigned)); +extern char *xrealloc PARAMS((register char *, register unsigned)); diff --git a/contrib/bison/alloca.c b/contrib/bison/alloca.c index 31fb4e0d4e06..8f98b73dbb90 100644 --- a/contrib/bison/alloca.c +++ b/contrib/bison/alloca.c @@ -180,7 +180,7 @@ alloca (size) #endif /* Reclaim garbage, defined as all alloca'd storage that - was allocated from deeper in the stack than currently. */ + was allocated from deeper in the stack than currently. */ { register header *hp; /* Traverses linked list. */ @@ -350,7 +350,7 @@ struct stk_trailer #ifdef CRAY2 /* Determine a "stack measure" for an arbitrary ADDRESS. - I doubt that "lint" will like this much. */ + I doubt that "lint" will like this much. */ static long i00afunc (long *address) diff --git a/contrib/bison/allocate.c b/contrib/bison/allocate.c index a74dc1829767..fdc83856fdc9 100644 --- a/contrib/bison/allocate.c +++ b/contrib/bison/allocate.c @@ -15,20 +15,38 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bison; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ #include +#include "system.h" +#ifdef NEED_DECLARATION_CALLOC +#if defined (__STDC__) || defined (_MSC_VER) +extern void *calloc (); +#else extern char *calloc (); +#endif +#endif /* NEED_DECLARATION_CALLOC */ + +#ifdef NEED_DECLARATION_REALLOC +#if defined (__STDC__) || defined (_MSC_VER) +extern void *realloc (); +#else extern char *realloc (); -extern void done (); +#endif +#endif /* NEED_DECLARATION_REALLOC */ + +char *xmalloc PARAMS((register unsigned)); +char *xrealloc PARAMS((register char *, register unsigned)); + +extern void done PARAMS((int)); extern char *program_name; char * -xmalloc (n) - register unsigned n; +xmalloc (register unsigned n) { register char *block; @@ -38,7 +56,7 @@ xmalloc (n) block = calloc (n, 1); if (block == NULL) { - fprintf (stderr, "%s: memory exhausted\n", program_name); + fprintf (stderr, _("%s: memory exhausted\n"), program_name); done (1); } @@ -46,9 +64,7 @@ xmalloc (n) } char * -xrealloc (block, n) - register char *block; - register unsigned n; +xrealloc (register char *block, register unsigned n) { /* Avoid uncertainty about what an arg of 0 will do. */ if (n == 0) @@ -56,7 +72,7 @@ xrealloc (block, n) block = realloc (block, n); if (block == NULL) { - fprintf (stderr, "%s: memory exhausted\n", program_name); + fprintf (stderr, _("%s: memory exhausted\n"), program_name); done (1); } diff --git a/contrib/bison/bison.1 b/contrib/bison/bison.1 index 0cd949ee422e..471952d93242 100644 --- a/contrib/bison/bison.1 +++ b/contrib/bison/bison.1 @@ -320,14 +320,21 @@ bison \-y $* .ft R .sp .RE -.PP -The long-named options can be introduced with `+' as well as `\-\-', -for compatibility with previous releases. Eventually support for `+' -will be removed, because it is incompatible with the POSIX.2 standard. .SH FILES /usr/local/lib/bison.simple simple parser .br /usr/local/lib/bison.hairy complicated parser +.SH "ENVIRONMENT VARIABLES" +.TP +.SM BISON_SIMPLE +If this is set, it specifies the location in which the +.B bison.simple +parser can be found. +.TP +.SM BISON_HAIRY +If this is set, it specifies the location in which the +.B bison.hairy +parser can be found. .SH SEE ALSO .IR yacc (1) .br diff --git a/contrib/bison/bison.simple b/contrib/bison/bison.simple index aea6b78c20a0..e2a88a90c7f8 100644 --- a/contrib/bison/bison.simple +++ b/contrib/bison/bison.simple @@ -1,5 +1,6 @@ /* -*-C-*- Note some compilers choke on comments on `#line' lines. */ #line 3 "bison.simple" +/* This file comes from bison-@bison_version@. */ /* Skeleton output parser for bison, Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc. @@ -16,47 +17,67 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ /* As a special exception, when this file is copied by Bison into a Bison output file, you may use that output file without restriction. This special exception was added by the Free Software Foundation in version 1.24 of Bison. */ -#ifndef alloca -#ifdef __GNUC__ -#define alloca __builtin_alloca -#else /* not GNU C. */ -#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) -#include -#else /* not sparc */ -#if defined (MSDOS) && !defined (__TURBOC__) -#include -#else /* not MSDOS, or __TURBOC__ */ -#if defined(_AIX) -#include - #pragma alloca -#else /* not MSDOS, __TURBOC__, or _AIX */ -#ifdef __hpux -#ifdef __cplusplus -extern "C" { -void *alloca (unsigned int); -}; -#else /* not __cplusplus */ -void *alloca (); -#endif /* not __cplusplus */ -#endif /* __hpux */ -#endif /* not _AIX */ -#endif /* not MSDOS, or __TURBOC__ */ -#endif /* not sparc. */ -#endif /* not GNU C. */ -#endif /* alloca not defined. */ - /* This is the parser code that is written into each bison parser when the %semantic_parser declaration is not specified in the grammar. It was written by Richard Stallman by simplifying the hairy parser used when %semantic_parser is specified. */ +#ifndef YYSTACK_USE_ALLOCA +#ifdef alloca +#define YYSTACK_USE_ALLOCA +#else /* alloca not defined */ +#ifdef __GNUC__ +#define YYSTACK_USE_ALLOCA +#define alloca __builtin_alloca +#else /* not GNU C. */ +#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386)) +#define YYSTACK_USE_ALLOCA +#include +#else /* not sparc */ +/* We think this test detects Watcom and Microsoft C. */ +/* This used to test MSDOS, but that is a bad idea + since that symbol is in the user namespace. */ +#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__) +#if 0 /* No need for malloc.h, which pollutes the namespace; + instead, just don't use alloca. */ +#include +#endif +#else /* not MSDOS, or __TURBOC__ */ +#if defined(_AIX) +/* I don't know what this was needed for, but it pollutes the namespace. + So I turned it off. rms, 2 May 1997. */ +/* #include */ + #pragma alloca +#define YYSTACK_USE_ALLOCA +#else /* not MSDOS, or __TURBOC__, or _AIX */ +#if 0 +#ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up, + and on HPUX 10. Eventually we can turn this on. */ +#define YYSTACK_USE_ALLOCA +#define alloca __builtin_alloca +#endif /* __hpux */ +#endif +#endif /* not _AIX */ +#endif /* not MSDOS, or __TURBOC__ */ +#endif /* not sparc */ +#endif /* not GNU C */ +#endif /* alloca not defined */ +#endif /* YYSTACK_USE_ALLOCA not defined */ + +#ifdef YYSTACK_USE_ALLOCA +#define YYSTACK_ALLOC alloca +#else +#define YYSTACK_ALLOC malloc +#endif + /* Note: there must be only one dollar sign in this file. It is replaced by the list of actions, each action as one case of the switch. */ @@ -65,8 +86,8 @@ void *alloca (); #define yyclearin (yychar = YYEMPTY) #define YYEMPTY -2 #define YYEOF 0 -#define YYACCEPT return(0) -#define YYABORT return(1) +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab #define YYERROR goto yyerrlab1 /* Like YYERROR except do call yyerror. This remains here temporarily to ease the @@ -147,12 +168,12 @@ int yydebug; /* nonzero means print parse trace */ #ifndef YYMAXDEPTH #define YYMAXDEPTH 10000 #endif - -/* Prevent warning if -Wstrict-prototypes. */ -#ifdef __GNUC__ -int yyparse (void); -#endif +/* Define __yy_memcpy. Note that the size argument + should be passed with type unsigned int, because that is what the non-GCC + definitions require. With GCC, __builtin_memcpy takes an arg + of type size_t, but it can handle unsigned int. */ + #if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ #define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT) #else /* not GNU C or C++ */ @@ -164,7 +185,7 @@ static void __yy_memcpy (to, from, count) char *to; char *from; - int count; + unsigned int count; { register char *f = from; register char *t = to; @@ -179,10 +200,10 @@ __yy_memcpy (to, from, count) /* This is the most reliable way to avoid incompatibilities in available built-in functions on various systems. */ static void -__yy_memcpy (char *to, char *from, int count) +__yy_memcpy (char *to, char *from, unsigned int count) { - register char *f = from; register char *t = to; + register char *f = from; register int i = count; while (i-- > 0) @@ -192,7 +213,7 @@ __yy_memcpy (char *to, char *from, int count) #endif #endif -#line 196 "bison.simple" +#line 217 "bison.simple" /* The user can define YYPARSE_PARAM as the name of an argument to be passed into yyparse. The argument should have type void *. @@ -213,6 +234,15 @@ __yy_memcpy (char *to, char *from, int count) #define YYPARSE_PARAM_DECL #endif /* not YYPARSE_PARAM */ +/* Prevent warning if -Wstrict-prototypes. */ +#ifdef __GNUC__ +#ifdef YYPARSE_PARAM +int yyparse (void *); +#else +int yyparse (void); +#endif +#endif + int yyparse(YYPARSE_PARAM_ARG) YYPARSE_PARAM_DECL @@ -241,6 +271,7 @@ yyparse(YYPARSE_PARAM_ARG) #endif int yystacksize = YYINITDEPTH; + int yyfree_stacks = 0; #ifdef YYPURE int yychar; @@ -325,18 +356,32 @@ yynewstate: if (yystacksize >= YYMAXDEPTH) { yyerror("parser stack overflow"); + if (yyfree_stacks) + { + free (yyss); + free (yyvs); +#ifdef YYLSP_NEEDED + free (yyls); +#endif + } return 2; } yystacksize *= 2; if (yystacksize > YYMAXDEPTH) yystacksize = YYMAXDEPTH; - yyss = (short *) alloca (yystacksize * sizeof (*yyssp)); - __yy_memcpy ((char *)yyss, (char *)yyss1, size * sizeof (*yyssp)); - yyvs = (YYSTYPE *) alloca (yystacksize * sizeof (*yyvsp)); - __yy_memcpy ((char *)yyvs, (char *)yyvs1, size * sizeof (*yyvsp)); +#ifndef YYSTACK_USE_ALLOCA + yyfree_stacks = 1; +#endif + yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp)); + __yy_memcpy ((char *)yyss, (char *)yyss1, + size * (unsigned int) sizeof (*yyssp)); + yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp)); + __yy_memcpy ((char *)yyvs, (char *)yyvs1, + size * (unsigned int) sizeof (*yyvsp)); #ifdef YYLSP_NEEDED - yyls = (YYLTYPE *) alloca (yystacksize * sizeof (*yylsp)); - __yy_memcpy ((char *)yyls, (char *)yyls1, size * sizeof (*yylsp)); + yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp)); + __yy_memcpy ((char *)yyls, (char *)yyls1, + size * (unsigned int) sizeof (*yylsp)); #endif #endif /* no yyoverflow */ @@ -494,7 +539,7 @@ yyreduce: #endif $ /* the action file gets copied in in place of this dollarsign */ -#line 498 "bison.simple" +#line 543 "bison.simple" yyvsp -= yylen; yyssp -= yylen; @@ -689,4 +734,28 @@ yyerrhandle: yystate = yyn; goto yynewstate; + + yyacceptlab: + /* YYACCEPT comes here. */ + if (yyfree_stacks) + { + free (yyss); + free (yyvs); +#ifdef YYLSP_NEEDED + free (yyls); +#endif + } + return 0; + + yyabortlab: + /* YYABORT comes here. */ + if (yyfree_stacks) + { + free (yyss); + free (yyvs); +#ifdef YYLSP_NEEDED + free (yyls); +#endif + } + return 1; } diff --git a/contrib/bison/bison.texinfo b/contrib/bison/bison.texinfo index 61f7b12f62cb..b179e71de0c5 100644 --- a/contrib/bison/bison.texinfo +++ b/contrib/bison/bison.texinfo @@ -1,7 +1,8 @@ \input texinfo @c -*-texinfo-*- @comment %**start of header @setfilename bison.info -@settitle Bison 1.25 +@include version.texi +@settitle Bison @value{VERSION} @setchapternewpage odd @iftex @@ -13,8 +14,6 @@ @c the smallbook format. @c @smallbook -@c next time, consider using @set for edition number, etc... - @c Set following if you have the new `shorttitlepage' command @c @clear shorttitlepage-enabled @c @set shorttitlepage-enabled @@ -36,10 +35,18 @@ @end ifinfo @comment %**end of header +@ifinfo +@format +START-INFO-DIR-ENTRY +* bison: (bison). GNU Project parser generator (yacc replacement). +END-INFO-DIR-ENTRY +@end format +@end ifinfo + @ifinfo This file documents the Bison parser generator. -Copyright (C) 1988, 89, 90, 91, 92, 93, 1995 Free Software Foundation, Inc. +Copyright (C) 1988, 89, 90, 91, 92, 93, 95, 98, 1999 Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice @@ -73,13 +80,13 @@ instead of in the original English. @titlepage @title Bison @subtitle The YACC-compatible Parser Generator -@subtitle November 1995, Bison Version 1.25 +@subtitle @value{UPDATED}, Bison Version @value{VERSION} @author by Charles Donnelly and Richard Stallman @page @vskip 0pt plus 1filll -Copyright @copyright{} 1988, 89, 90, 91, 92, 93, 1995 Free Software +Copyright @copyright{} 1988, 89, 90, 91, 92, 93, 95, 98, 1999 Free Software Foundation @sp 2 @@ -121,7 +128,7 @@ Cover art by Etienne Suvasa. @node Top, Introduction, (dir), (dir) @ifinfo -This manual documents version 1.25 of Bison. +This manual documents version @value{VERSION} of Bison. @end ifinfo @menu @@ -310,7 +317,7 @@ Bison was written primarily by Robert Corbett; Richard Stallman made it Yacc-compatible. Wilfred Hansen of Carnegie Mellon University added multicharacter string literals and other features. -This edition corresponds to version 1.25 of Bison. +This edition corresponds to version @value{VERSION} of Bison. @node Conditions, Copying, Introduction, Top @unnumbered Conditions for Using Bison @@ -346,7 +353,7 @@ using the other GNU tools. @display Copyright @copyright{} 1989, 1991 Free Software Foundation, Inc. -675 Mass Ave, Cambridge, MA 02139, USA +59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -692,7 +699,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software -Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. @end smallexample Also add information on how to contact you by electronic and paper mail. @@ -3098,24 +3106,32 @@ for example, a nonreentrant program may not be safe to call from a signal handler. In systems with multiple threads of control, a nonreentrant program must be called only within interlocks. -The Bison parser is not normally a reentrant program, because it uses -statically allocated variables for communication with @code{yylex}. These -variables include @code{yylval} and @code{yylloc}. +Normally, Bison generates a parser which is not reentrant. This is +suitable for most uses, and it permits compatibility with YACC. (The +standard YACC interfaces are inherently nonreentrant, because they use +statically allocated variables for communication with @code{yylex}, +including @code{yylval} and @code{yylloc}.) -The Bison declaration @code{%pure_parser} says that you want the parser -to be reentrant. It looks like this: +Alternatively, you can generate a pure, reentrant parser. The Bison +declaration @code{%pure_parser} says that you want the parser to be +reentrant. It looks like this: @example %pure_parser @end example -The effect is that the two communication variables become local -variables in @code{yyparse}, and a different calling convention is used -for the lexical analyzer function @code{yylex}. @xref{Pure Calling, -,Calling Conventions for Pure Parsers}, for the details of this. The -variable @code{yynerrs} also becomes local in @code{yyparse} -(@pxref{Error Reporting, ,The Error Reporting Function @code{yyerror}}). -The convention for calling @code{yyparse} itself is unchanged. +The result is that the communication variables @code{yylval} and +@code{yylloc} become local variables in @code{yyparse}, and a different +calling convention is used for the lexical analyzer function +@code{yylex}. @xref{Pure Calling, ,Calling Conventions for Pure +Parsers}, for the details of this. The variable @code{yynerrs} also +becomes local in @code{yyparse} (@pxref{Error Reporting, ,The Error +Reporting Function @code{yyerror}}). The convention for calling +@code{yyparse} itself is unchanged. + +Whether the parser is pure has nothing to do with the grammar rules. +You can generate either a pure parser or a nonreentrant parser from any +valid grammar. @node Decl Summary, , Pure Decl, Declarations @subsection Bison Declaration Summary @@ -3383,7 +3399,8 @@ for (i = 0; i < YYNTOKENS; i++) @{ if (yytname[i] != 0 && yytname[i][0] == '"' - && strncmp (yytname[i] + 1, token_buffer, strlen (token_buffer)) + && strncmp (yytname[i] + 1, token_buffer, + strlen (token_buffer)) && yytname[i][strlen (token_buffer) + 1] == '"' && yytname[i][strlen (token_buffer) + 2] == 0) break; @@ -3718,8 +3735,8 @@ struct @{ @}; @end example -Thus, to get the starting line number of the third component, use -@samp{@@3.first_line}. +Thus, to get the starting line number of the third component, you would +use @samp{@@3.first_line}. In order for the members of this structure to contain valid information, you must make @code{yylex} supply this information about each token. diff --git a/contrib/bison/closure.c b/contrib/bison/closure.c index b354458efd9f..ad349196148e 100644 --- a/contrib/bison/closure.c +++ b/contrib/bison/closure.c @@ -15,7 +15,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bison; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ /* subroutines of file LR0.c. @@ -51,17 +52,20 @@ Frees itemset, ruleset and internal data. #include #include "system.h" #include "machine.h" -#include "new.h" +#include "alloc.h" #include "gram.h" extern short **derives; extern char **tags; -void set_fderives(); -void set_firsts(); +void initialize_closure PARAMS((int)); +void set_fderives PARAMS((void)); +void set_firsts PARAMS((void)); +void closure PARAMS((short *, int)); +void finalize_closure PARAMS((void)); -extern void RTC(); +extern void RTC PARAMS((unsigned *, int)); short *itemset; short *itemsetend; @@ -79,8 +83,7 @@ static int varsetsize; void -initialize_closure(n) -int n; +initialize_closure (int n) { itemset = NEW2(n, short); @@ -98,7 +101,7 @@ int n; the sequence of symbols 8 3 20, and one of the rules for deriving symbol 8 is rule 4, then the [5 - ntokens, 4] bit in fderives is set. */ void -set_fderives() +set_fderives (void) { register unsigned *rrow; register unsigned *vrow; @@ -158,7 +161,7 @@ set_fderives() the symbol 8 can be the beginning of the data for symbol 5, so the bit [8 - ntokens, 5 - ntokens] in firsts is set. */ void -set_firsts() +set_firsts (void) { register unsigned *row; /* register int done; JF unused */ @@ -198,9 +201,7 @@ set_firsts() void -closure(core, n) -short *core; -int n; +closure (short *core, int n) { register int ruleno; register unsigned word; @@ -282,7 +283,7 @@ int n; void -finalize_closure() +finalize_closure (void) { FREE(itemset); FREE(ruleset); @@ -304,18 +305,18 @@ int n; } - -print_firsts() +void +print_firsts (void) { register int i; register int j; register unsigned *rowp; - printf("\n\n\nFIRSTS\n\n"); + printf(_("\n\n\nFIRSTS\n\n")); for (i = ntokens; i < nsyms; i++) { - printf("\n\n%s firsts\n\n", tags[i]); + printf(_("\n\n%s firsts\n\n"), tags[i]); rowp = firsts + ((i - ntokens) * varsetsize); @@ -326,18 +327,18 @@ print_firsts() } - -print_fderives() +void +print_fderives (void) { register int i; register int j; register unsigned *rp; - printf("\n\n\nFDERIVES\n"); + printf(_("\n\n\nFDERIVES\n")); for (i = ntokens; i < nsyms; i++) { - printf("\n\n%s derives\n\n", tags[i]); + printf(_("\n\n%s derives\n\n"), tags[i]); rp = fderives + i * rulesetsize; for (j = 0; j <= nrules; j++) diff --git a/contrib/bison/config.hin b/contrib/bison/config.hin new file mode 100644 index 000000000000..d12df70b53fa --- /dev/null +++ b/contrib/bison/config.hin @@ -0,0 +1,179 @@ +/* config.hin. Generated automatically from configure.in by autoheader. */ +#ifndef CONFIG_H +#define CONFIG_H + +/* Define if using alloca.c. */ +#undef C_ALLOCA + +/* Define to empty if the keyword does not work. */ +#undef const + +/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems. + This function is required for alloca.c support on those systems. */ +#undef CRAY_STACKSEG_END + +/* Define if you have alloca, as a function or macro. */ +#undef HAVE_ALLOCA + +/* Define if you have and it should be used (not on Ultrix). */ +#undef HAVE_ALLOCA_H + +/* Define if you have a working `mmap' system call. */ +#undef HAVE_MMAP + +/* Define as __inline if that's what the C compiler calls it. */ +#undef inline + +/* Define if on MINIX. */ +#undef _MINIX + +/* Define to `long' if doesn't define. */ +#undef off_t + +/* Define if the system does not provide POSIX.1 features except + with this defined. */ +#undef _POSIX_1_SOURCE + +/* Define if you need to in order for stat and other things to work. */ +#undef _POSIX_SOURCE + +/* Define to `unsigned' if doesn't define. */ +#undef size_t + +/* If using the C implementation of alloca, define if you know the + direction of stack growth for your system; otherwise it will be + automatically deduced at run-time. + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown + */ +#undef STACK_DIRECTION + +/* Define if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Version string. */ +#undef VERSION_STRING + +/* Define to 1 if NLS is requested. */ +#undef ENABLE_NLS + +/* Define as 1 if you have catgets and don't want to use GNU gettext. */ +#undef HAVE_CATGETS + +/* Define as 1 if you have gettext and don't want to use GNU gettext. */ +#undef HAVE_GETTEXT + +/* Define if your locale.h file contains LC_MESSAGES. */ +#undef HAVE_LC_MESSAGES + +/* Define to 1 if you have the stpcpy function. */ +#undef HAVE_STPCPY + +/* The location of the simple parser (bison.simple). */ +#undef XPFILE + +/* The location of the semantic parser (bison.hairy). */ +#undef XPFILE1 + +/* The location of the local directory. */ +#undef LOCALEDIR + +/* Define if you have the __argz_count function. */ +#undef HAVE___ARGZ_COUNT + +/* Define if you have the __argz_next function. */ +#undef HAVE___ARGZ_NEXT + +/* Define if you have the __argz_stringify function. */ +#undef HAVE___ARGZ_STRINGIFY + +/* Define if you have the dcgettext function. */ +#undef HAVE_DCGETTEXT + +/* Define if you have the getcwd function. */ +#undef HAVE_GETCWD + +/* Define if you have the getpagesize function. */ +#undef HAVE_GETPAGESIZE + +/* Define if you have the mkstemp function. */ +#undef HAVE_MKSTEMP + +/* Define if you have the munmap function. */ +#undef HAVE_MUNMAP + +/* Define if you have the putenv function. */ +#undef HAVE_PUTENV + +/* Define if you have the setenv function. */ +#undef HAVE_SETENV + +/* Define if you have the setlocale function. */ +#undef HAVE_SETLOCALE + +/* Define if you have the stpcpy function. */ +#undef HAVE_STPCPY + +/* Define if you have the strcasecmp function. */ +#undef HAVE_STRCASECMP + +/* Define if you have the strchr function. */ +#undef HAVE_STRCHR + +/* Define if you have the strdup function. */ +#undef HAVE_STRDUP + +/* Define if you have the header file. */ +#undef HAVE_ARGZ_H + +/* Define if you have the header file. */ +#undef HAVE_CTYPE_H + +/* Define if you have the header file. */ +#undef HAVE_LIMITS_H + +/* Define if you have the header file. */ +#undef HAVE_LOCALE_H + +/* Define if you have the header file. */ +#undef HAVE_MALLOC_H + +/* Define if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define if you have the header file. */ +#undef HAVE_NL_TYPES_H + +/* Define if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define if you have the header file. */ +#undef HAVE_STRING_H + +/* Define if you have the header file. */ +#undef HAVE_SYS_PARAM_H + +/* Define if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define if you have the i library (-li). */ +#undef HAVE_LIBI + +/* Name of package */ +#undef PACKAGE + +/* Version number of package */ +#undef VERSION + +/* Define if compiler has function prototypes */ +#undef PROTOTYPES + + +#if defined(PROTOTYPES) || defined(__cplusplus) +# define PARAMS(p) p +#else +# define PARAMS(p) () +#endif + +#endif /* CONFIG_H */ diff --git a/contrib/bison/configure b/contrib/bison/configure index 3ed1f48c34e2..5f70bfb50553 100755 --- a/contrib/bison/configure +++ b/contrib/bison/configure @@ -1,8 +1,8 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.7 -# Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc. +# Generated automatically using autoconf version 2.13 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. @@ -11,6 +11,12 @@ ac_help= ac_default_prefix=/usr/local # Any additions from configure.in: +ac_help="$ac_help + --disable-nls do not use Native Language Support" +ac_help="$ac_help + --with-included-gettext use the GNU gettext library included here" +ac_help="$ac_help + --with-catgets use catgets functions if available" # Initialize some variables set by options. # The variables have the same names as the options, with @@ -49,6 +55,9 @@ mandir='${prefix}/man' # Initialize some other variables. subdirs= MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 ac_prev= for ac_option @@ -330,7 +339,7 @@ EOF verbose=yes ;; -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 2.7" + echo "configure generated by autoconf version 2.13" exit 0 ;; -with-* | --with-*) @@ -432,11 +441,14 @@ do done # NLS nuisances. -# Only set LANG and LC_ALL to C if already set. -# These must not be set unconditionally because not all systems understand -# e.g. LANG=C (notably SCO). -if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h @@ -445,7 +457,7 @@ echo > confdefs.h # A filename unique to this package, relative to the directory that # configure is in, which we can look for to find out if srcdir is correct. -ac_unique_file=reduce.c +ac_unique_file=src/reduce.c # Find the source files, if location was not specified. if test -z "$srcdir"; then @@ -495,13 +507,13 @@ fi ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='echo $CPP $CPPFLAGS 1>&5; -$CPP $CPPFLAGS' -ac_compile='echo ${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5; -${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5 2>&5' -ac_link='echo ${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5; -${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5 2>&5' +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross +ac_exeext= +ac_objext=o if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then @@ -515,82 +527,6 @@ else fi - -# Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="gcc" - break - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_prog_CC" && ac_cv_prog_CC="cc" -fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - - -echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.c <&5 | egrep yes >/dev/null 2>&1; then - ac_cv_prog_gcc=yes -else - ac_cv_prog_gcc=no -fi -fi - -echo "$ac_t""$ac_cv_prog_gcc" 1>&6 -if test $ac_cv_prog_gcc = yes; then - GCC=yes - if test "${CFLAGS+set}" != set; then - echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_prog_gcc_g'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - echo 'void f(){}' > conftest.c -if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then - ac_cv_prog_gcc_g=yes -else - ac_cv_prog_gcc_g=no -fi -rm -f conftest* - -fi - -echo "$ac_t""$ac_cv_prog_gcc_g" 1>&6 - if test $ac_cv_prog_gcc_g = yes; then - CFLAGS="-g -O" - else - CFLAGS="-O" - fi - fi -else - GCC= - test "${CFLAGS+set}" = set || CFLAGS="-g" -fi - ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then @@ -617,27 +553,30 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:562: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" for ac_dir in $PATH; do # Account for people who put trailing slashes in PATH elements. case "$ac_dir/" in /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. - for ac_prog in ginstall installbsd scoinst install; do + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do if test -f $ac_dir/$ac_prog; then if test $ac_prog = install && grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. - # OSF/1 installbsd also uses dspmsg, but is usable. : else ac_cv_path_install="$ac_dir/$ac_prog -c" @@ -648,7 +587,7 @@ else ;; esac done - IFS="$ac_save_ifs" + IFS="$ac_save_IFS" fi if test "${ac_cv_path_install+set}" = set; then @@ -667,10 +606,410 @@ echo "$ac_t""$INSTALL" 1>&6 # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' +echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 +echo "configure:615: checking whether build environment is sane" >&5 +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "$*" != "X $srcdir/configure conftestfile" \ + && test "$*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { echo "configure: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" 1>&2; exit 1; } + fi + + test "$2" = conftestfile + ) +then + # Ok. + : +else + { echo "configure: error: newly created file is older than distributed files! +Check your system clock" 1>&2; exit 1; } +fi +rm -f conftest* +echo "$ac_t""yes" 1>&6 +if test "$program_transform_name" = s,x,x,; then + program_transform_name= +else + # Double any \ or $. echo might interpret backslashes. + cat <<\EOF_SED > conftestsed +s,\\,\\\\,g; s,\$,$$,g +EOF_SED + program_transform_name="`echo $program_transform_name|sed -f conftestsed`" + rm -f conftestsed +fi +test "$program_prefix" != NONE && + program_transform_name="s,^,${program_prefix},; $program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" + +# sed with no file args requires a program. +test "$program_transform_name" = "" && program_transform_name="s,x,x," + +echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +echo "configure:672: checking whether ${MAKE-make} sets \${MAKE}" >&5 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftestmake <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftestmake +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= +else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + + +PACKAGE=bison + +VERSION=1.28 + +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } +fi +cat >> confdefs.h <> confdefs.h <&6 +echo "configure:718: checking for working aclocal" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (aclocal --version) < /dev/null > /dev/null 2>&1; then + ACLOCAL=aclocal + echo "$ac_t""found" 1>&6 +else + ACLOCAL="$missing_dir/missing aclocal" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 +echo "configure:731: checking for working autoconf" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoconf --version) < /dev/null > /dev/null 2>&1; then + AUTOCONF=autoconf + echo "$ac_t""found" 1>&6 +else + AUTOCONF="$missing_dir/missing autoconf" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working automake""... $ac_c" 1>&6 +echo "configure:744: checking for working automake" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (automake --version) < /dev/null > /dev/null 2>&1; then + AUTOMAKE=automake + echo "$ac_t""found" 1>&6 +else + AUTOMAKE="$missing_dir/missing automake" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 +echo "configure:757: checking for working autoheader" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoheader --version) < /dev/null > /dev/null 2>&1; then + AUTOHEADER=autoheader + echo "$ac_t""found" 1>&6 +else + AUTOHEADER="$missing_dir/missing autoheader" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 +echo "configure:770: checking for working makeinfo" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (makeinfo --version) < /dev/null > /dev/null 2>&1; then + MAKEINFO=makeinfo + echo "$ac_t""found" 1>&6 +else + MAKEINFO="$missing_dir/missing makeinfo" + echo "$ac_t""missing" 1>&6 +fi + + + + + + + +ALL_LINGUAS="de es fr nl" + +# Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:793: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:823: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_prog_rejected=no + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + break + fi + done + IFS="$ac_save_ifs" +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# -gt 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$ac_dir/$ac_word" "$@" + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + if test -z "$CC"; then + case "`uname -s`" in + *win32* | *WIN32*) + # Extract the first word of "cl", so it can be a program name with args. +set dummy cl; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:874: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="cl" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + ;; + esac + fi + test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +fi + +echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 +echo "configure:906: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +cat > conftest.$ac_ext << EOF + +#line 917 "configure" +#include "confdefs.h" + +main(){return(0);} +EOF +if { (eval echo configure:922: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + ac_cv_prog_cc_works=yes + # If we can't run a trivial program, we are probably using a cross compiler. + if (./conftest; exit) 2>/dev/null; then + ac_cv_prog_cc_cross=no + else + ac_cv_prog_cc_cross=yes + fi +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_cv_prog_cc_works=no +fi +rm -fr conftest* +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 +if test $ac_cv_prog_cc_works = no; then + { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } +fi +echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 +echo "configure:948: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 +cross_compiling=$ac_cv_prog_cc_cross + +echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +echo "configure:953: checking whether we are using GNU C" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + +if test $ac_cv_prog_gcc = yes; then + GCC=yes +else + GCC= +fi + +ac_test_CFLAGS="${CFLAGS+set}" +ac_save_CFLAGS="$CFLAGS" +CFLAGS= +echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:981: checking whether ${CC-cc} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_cc_g=yes +else + ac_cv_prog_cc_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 +if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 +echo "configure:1013: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -685,36 +1024,61 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF -eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -ac_err=`grep -v '^ *+' conftest.out` +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1034: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : else echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF -eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -ac_err=`grep -v '^ *+' conftest.out` +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1051: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : else echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP="${CC-cc} -nologo -E" + cat > conftest.$ac_ext < +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1068: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* CPP=/lib/cpp fi rm -f conftest* fi +rm -f conftest* +fi rm -f conftest* ac_cv_prog_CPP="$CPP" fi @@ -724,23 +1088,27 @@ else fi echo "$ac_t""$CPP" 1>&6 -ac_safe=`echo "minix/config.h" | tr './\055' '___'` +ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6 +echo "configure:1094: checking for minix/config.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF -eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -ac_err=`grep -v '^ *+' conftest.out` +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1104: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi @@ -770,6 +1138,7 @@ EOF fi echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6 +echo "configure:1142: checking for POSIXized ISC" >&5 if test -d /etc/conf/kconfig.d && grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 then @@ -790,51 +1159,204 @@ else fi -# If we cannot run a trivial program, we must be cross compiling. -echo $ac_n "checking whether cross-compiling""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_c_cross'+set}'`\" = set"; then + + +echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6 +echo "configure:1166: checking for ${CC-cc} option to accept ANSI C" >&5 +if eval "test \"`echo '$''{'am_cv_prog_cc_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - if test "$cross_compiling" = yes; then - ac_cv_c_cross=yes -else -cat > conftest.$ac_ext < conftest.$ac_ext < +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; + +int main() { + +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + +; return 0; } EOF -eval $ac_link -if test -s conftest && (./conftest; exit) 2>/dev/null; then - ac_cv_c_cross=no +if { (eval echo configure:1219: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + am_cv_prog_cc_stdc="$ac_arg"; break else - ac_cv_c_cross=yes + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 fi -fi -rm -fr conftest* +rm -f conftest* +done +CC="$ac_save_CC" + fi -echo "$ac_t""$ac_cv_c_cross" 1>&6 -cross_compiling=$ac_cv_c_cross +if test -z "$am_cv_prog_cc_stdc"; then + echo "$ac_t""none needed" 1>&6 +else + echo "$ac_t""$am_cv_prog_cc_stdc" 1>&6 +fi +case "x$am_cv_prog_cc_stdc" in + x|xno) ;; + *) CC="$CC $am_cv_prog_cc_stdc" ;; +esac + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:1254: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +# Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1309: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="ranlib" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 +echo "configure:1339: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include #include #include EOF -eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -ac_err=`grep -v '^ *+' conftest.out` +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1352: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* ac_cv_header_stdc=yes else echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_header_stdc=no fi @@ -843,7 +1365,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -861,7 +1383,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -881,8 +1403,8 @@ if test $ac_cv_header_stdc = yes; then if test "$cross_compiling" = yes; then : else -cat > conftest.$ac_ext < conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -893,14 +1415,18 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -eval $ac_link -if test -s conftest && (./conftest; exit) 2>/dev/null; then +if { (eval echo configure:1419: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then : else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* ac_cv_header_stdc=no fi -fi rm -fr conftest* +fi + fi fi @@ -912,25 +1438,29 @@ EOF fi -for ac_hdr in string.h stdlib.h memory.h +for ac_hdr in ctype.h locale.h memory.h stdlib.h string.h unistd.h do -ac_safe=`echo "$ac_hdr" | tr './\055' '___'` +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:1446: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF -eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -ac_err=`grep -v '^ *+' conftest.out` +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1456: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* eval "ac_cv_header_$ac_safe=yes" else echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_header_$ac_safe=no" fi @@ -938,7 +1468,7 @@ rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | tr 'abcdefghijklmnopqrstuvwxyz./\055' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ___'` + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` cat >> confdefs.h <&6 +echo "configure:1486: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_c_const=no fi rm -f conftest* - fi echo "$ac_t""$ac_cv_c_const" 1>&6 @@ -1024,30 +1557,192 @@ EOF fi + +echo $ac_n "checking for function prototypes""... $ac_c" 1>&6 +echo "configure:1563: checking for function prototypes" >&5 +if test "$am_cv_prog_cc_stdc" != no; then + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <<\EOF +#define PROTOTYPES 1 +EOF + + U= ANSI2KNR= +else + echo "$ac_t""no" 1>&6 + U=_ ANSI2KNR=./ansi2knr + # Ensure some checks needed by ansi2knr itself. + echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 +echo "configure:1576: checking for ANSI C header files" >&5 +if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#include +#include +#include +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1589: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + ac_cv_header_stdc=yes +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_header_stdc=no +fi +rm -f conftest* + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. +cat > conftest.$ac_ext < +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "memchr" >/dev/null 2>&1; then + : +else + rm -rf conftest* + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. +cat > conftest.$ac_ext < +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "free" >/dev/null 2>&1; then + : +else + rm -rf conftest* + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. +if test "$cross_compiling" = yes; then + : +else + cat > conftest.$ac_ext < +#define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int main () { int i; for (i = 0; i < 256; i++) +if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); +exit (0); } + +EOF +if { (eval echo configure:1656: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + : +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_header_stdc=no +fi +rm -fr conftest* +fi + +fi +fi + +echo "$ac_t""$ac_cv_header_stdc" 1>&6 +if test $ac_cv_header_stdc = yes; then + cat >> confdefs.h <<\EOF +#define STDC_HEADERS 1 +EOF + +fi + + for ac_hdr in string.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:1683: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1693: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + +fi + + # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 +echo "configure:1725: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < -int main() { return 0; } -int t() { +int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if eval $ac_link; then +if { (eval echo configure:1737: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_header_alloca_h=no fi rm -f conftest* - fi echo "$ac_t""$ac_cv_header_alloca_h" 1>&6 @@ -1059,70 +1754,77 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -if eval "test \"`echo '$''{'ac_cv_func_alloca'+set}'`\" = set"; then +echo "configure:1758: checking for alloca" >&5 +if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < +# ifdef _MSC_VER +# include +# define alloca _alloca # else -# ifdef _AIX - #pragma alloca +# if HAVE_ALLOCA_H +# include # else -# ifndef alloca /* predefined by HP cc +Olibcalls */ +# ifdef _AIX + #pragma alloca +# else +# ifndef alloca /* predefined by HP cc +Olibcalls */ char *alloca (); +# endif # endif # endif # endif #endif -int main() { return 0; } -int t() { +int main() { char *p = (char *) alloca(1); ; return 0; } EOF -if eval $ac_link; then +if { (eval echo configure:1791: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - ac_cv_func_alloca=yes + ac_cv_func_alloca_works=yes else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* - ac_cv_func_alloca=no + ac_cv_func_alloca_works=no fi rm -f conftest* - fi -echo "$ac_t""$ac_cv_func_alloca" 1>&6 -if test $ac_cv_func_alloca = yes; then +echo "$ac_t""$ac_cv_func_alloca_works" 1>&6 +if test $ac_cv_func_alloca_works = yes; then cat >> confdefs.h <<\EOF #define HAVE_ALLOCA 1 EOF fi -if test $ac_cv_func_alloca = no; then +if test $ac_cv_func_alloca_works = no; then # The SVR3 libPW and SVR4 libucb both contain incompatible functions # that cause trouble. Some versions do not even contain alloca or # contain a buggy version. If you still want to use their alloca, # use ar to extract alloca.o from them instead of compiling alloca.c. - ALLOCA=alloca.o + ALLOCA=alloca.${ac_objext} cat >> confdefs.h <<\EOF #define C_ALLOCA 1 EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 +echo "configure:1823: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:1853: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char $ac_func(); -int main() { return 0; } -int t() { +int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named @@ -1173,16 +1877,18 @@ $ac_func(); ; return 0; } EOF -if eval $ac_link; then +if { (eval echo configure:1881: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -f conftest* - fi + if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 cat >> confdefs.h <&6 +echo "configure:1908: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then ac_cv_c_stack_direction=0 else -cat > conftest.$ac_ext < conftest.$ac_ext </dev/null; then +if { (eval echo configure:1935: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then ac_cv_c_stack_direction=1 else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* ac_cv_c_stack_direction=-1 fi -fi rm -fr conftest* fi +fi + echo "$ac_t""$ac_cv_c_stack_direction" 1>&6 cat >> confdefs.h <&6 +echo "configure:1959: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char $ac_func(); -int main() { return 0; } -int t() { +int main() { /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named @@ -1270,16 +1983,18 @@ $ac_func(); ; return 0; } EOF -if eval $ac_link; then +if { (eval echo configure:1987: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -f conftest* - fi + if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` @@ -1292,6 +2007,1600 @@ else fi done +for ac_func in calloc realloc +do +echo $ac_n "checking whether $ac_func must be declared""... $ac_c" 1>&6 +echo "configure:2014: checking whether $ac_func must be declared" >&5 +if eval "test \"`echo '$''{'bison_cv_decl_needed_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#ifdef HAVE_STRING_H +#include +#else +#ifdef HAVE_STRINGS_H +#include +#endif +#endif +#ifdef HAVE_STDLIB_H +#include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif +#ifndef HAVE_RINDEX +#define rindex strrchr +#endif +#ifndef HAVE_INDEX +#define index strchr +#endif + +int main() { +char *(*pfn) = (char *(*)) $ac_func +; return 0; } +EOF +if { (eval echo configure:2047: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + eval "bison_cv_decl_needed_$ac_func=no" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "bison_cv_decl_needed_$ac_func=yes" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$bison_cv_decl_needed_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + bison_tr_decl=NEED_DECLARATION_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi + +done + + +echo $ac_n "checking for inline""... $ac_c" 1>&6 +echo "configure:2074: checking for inline" >&5 +if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_cv_c_inline=no +for ac_kw in inline __inline__ __inline; do + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_c_inline=$ac_kw; break +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +fi +rm -f conftest* +done + +fi + +echo "$ac_t""$ac_cv_c_inline" 1>&6 +case "$ac_cv_c_inline" in + inline | yes) ;; + no) cat >> confdefs.h <<\EOF +#define inline +EOF + ;; + *) cat >> confdefs.h <&6 +echo "configure:2114: checking for off_t" >&5 +if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#if STDC_HEADERS +#include +#include +#endif +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_type_off_t=yes +else + rm -rf conftest* + ac_cv_type_off_t=no +fi +rm -f conftest* + +fi +echo "$ac_t""$ac_cv_type_off_t" 1>&6 +if test $ac_cv_type_off_t = no; then + cat >> confdefs.h <<\EOF +#define off_t long +EOF + +fi + +echo $ac_n "checking for size_t""... $ac_c" 1>&6 +echo "configure:2147: checking for size_t" >&5 +if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#if STDC_HEADERS +#include +#include +#endif +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_type_size_t=yes +else + rm -rf conftest* + ac_cv_type_size_t=no +fi +rm -f conftest* + +fi +echo "$ac_t""$ac_cv_type_size_t" 1>&6 +if test $ac_cv_type_size_t = no; then + cat >> confdefs.h <<\EOF +#define size_t unsigned +EOF + +fi + +for ac_hdr in unistd.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:2183: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:2193: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + +for ac_func in getpagesize +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:2222: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:2250: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + +echo $ac_n "checking for working mmap""... $ac_c" 1>&6 +echo "configure:2275: checking for working mmap" >&5 +if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$cross_compiling" = yes; then + ac_cv_func_mmap_fixed_mapped=no +else + cat > conftest.$ac_ext < +#include +#include + +/* This mess was copied from the GNU getpagesize.h. */ +#ifndef HAVE_GETPAGESIZE +# ifdef HAVE_UNISTD_H +# include +# endif + +/* Assume that all systems that can run configure have sys/param.h. */ +# ifndef HAVE_SYS_PARAM_H +# define HAVE_SYS_PARAM_H 1 +# endif + +# ifdef _SC_PAGESIZE +# define getpagesize() sysconf(_SC_PAGESIZE) +# else /* no _SC_PAGESIZE */ +# ifdef HAVE_SYS_PARAM_H +# include +# ifdef EXEC_PAGESIZE +# define getpagesize() EXEC_PAGESIZE +# else /* no EXEC_PAGESIZE */ +# ifdef NBPG +# define getpagesize() NBPG * CLSIZE +# ifndef CLSIZE +# define CLSIZE 1 +# endif /* no CLSIZE */ +# else /* no NBPG */ +# ifdef NBPC +# define getpagesize() NBPC +# else /* no NBPC */ +# ifdef PAGESIZE +# define getpagesize() PAGESIZE +# endif /* PAGESIZE */ +# endif /* no NBPC */ +# endif /* no NBPG */ +# endif /* no EXEC_PAGESIZE */ +# else /* no HAVE_SYS_PARAM_H */ +# define getpagesize() 8192 /* punt totally */ +# endif /* no HAVE_SYS_PARAM_H */ +# endif /* no _SC_PAGESIZE */ + +#endif /* no HAVE_GETPAGESIZE */ + +#ifdef __cplusplus +extern "C" { void *malloc(unsigned); } +#else +char *malloc(); +#endif + +int +main() +{ + char *data, *data2, *data3; + int i, pagesize; + int fd; + + pagesize = getpagesize(); + + /* + * First, make a file with some known garbage in it. + */ + data = malloc(pagesize); + if (!data) + exit(1); + for (i = 0; i < pagesize; ++i) + *(data + i) = rand(); + umask(0); + fd = creat("conftestmmap", 0600); + if (fd < 0) + exit(1); + if (write(fd, data, pagesize) != pagesize) + exit(1); + close(fd); + + /* + * Next, try to mmap the file at a fixed address which + * already has something else allocated at it. If we can, + * also make sure that we see the same garbage. + */ + fd = open("conftestmmap", O_RDWR); + if (fd < 0) + exit(1); + data2 = malloc(2 * pagesize); + if (!data2) + exit(1); + data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1); + if (data2 != mmap(data2, pagesize, PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_FIXED, fd, 0L)) + exit(1); + for (i = 0; i < pagesize; ++i) + if (*(data + i) != *(data2 + i)) + exit(1); + + /* + * Finally, make sure that changes to the mapped area + * do not percolate back to the file as seen by read(). + * (This is a bug on some variants of i386 svr4.0.) + */ + for (i = 0; i < pagesize; ++i) + *(data2 + i) = *(data2 + i) + 1; + data3 = malloc(pagesize); + if (!data3) + exit(1); + if (read(fd, data3, pagesize) != pagesize) + exit(1); + for (i = 0; i < pagesize; ++i) + if (*(data + i) != *(data3 + i)) + exit(1); + close(fd); + unlink("conftestmmap"); + exit(0); +} + +EOF +if { (eval echo configure:2423: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + ac_cv_func_mmap_fixed_mapped=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_func_mmap_fixed_mapped=no +fi +rm -fr conftest* +fi + +fi + +echo "$ac_t""$ac_cv_func_mmap_fixed_mapped" 1>&6 +if test $ac_cv_func_mmap_fixed_mapped = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_MMAP 1 +EOF + +fi + + + for ac_hdr in argz.h limits.h locale.h nl_types.h malloc.h string.h \ +unistd.h sys/param.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:2451: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:2461: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + + for ac_func in getcwd munmap putenv setenv setlocale strchr strcasecmp \ +strdup __argz_count __argz_stringify __argz_next +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:2491: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:2519: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + + + if test "${ac_cv_func_stpcpy+set}" != "set"; then + for ac_func in stpcpy +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:2548: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:2576: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + + fi + if test "${ac_cv_func_stpcpy}" = "yes"; then + cat >> confdefs.h <<\EOF +#define HAVE_STPCPY 1 +EOF + + fi + + if test $ac_cv_header_locale_h = yes; then + echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6 +echo "configure:2610: checking for LC_MESSAGES" >&5 +if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +int main() { +return LC_MESSAGES +; return 0; } +EOF +if { (eval echo configure:2622: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + am_cv_val_LC_MESSAGES=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + am_cv_val_LC_MESSAGES=no +fi +rm -f conftest* +fi + +echo "$ac_t""$am_cv_val_LC_MESSAGES" 1>&6 + if test $am_cv_val_LC_MESSAGES = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_LC_MESSAGES 1 +EOF + + fi + fi + echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6 +echo "configure:2643: checking whether NLS is requested" >&5 + # Check whether --enable-nls or --disable-nls was given. +if test "${enable_nls+set}" = set; then + enableval="$enable_nls" + USE_NLS=$enableval +else + USE_NLS=yes +fi + + echo "$ac_t""$USE_NLS" 1>&6 + + + USE_INCLUDED_LIBINTL=no + + if test "$USE_NLS" = "yes"; then + cat >> confdefs.h <<\EOF +#define ENABLE_NLS 1 +EOF + + echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6 +echo "configure:2663: checking whether included gettext is requested" >&5 + # Check whether --with-included-gettext or --without-included-gettext was given. +if test "${with_included_gettext+set}" = set; then + withval="$with_included_gettext" + nls_cv_force_use_gnu_gettext=$withval +else + nls_cv_force_use_gnu_gettext=no +fi + + echo "$ac_t""$nls_cv_force_use_gnu_gettext" 1>&6 + + nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" + if test "$nls_cv_force_use_gnu_gettext" != "yes"; then + nls_cv_header_intl= + nls_cv_header_libgt= + CATOBJEXT=NONE + + ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for libintl.h""... $ac_c" 1>&6 +echo "configure:2682: checking for libintl.h" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:2692: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6 +echo "configure:2709: checking for gettext in libc" >&5 +if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +int main() { +return (int) gettext ("") +; return 0; } +EOF +if { (eval echo configure:2721: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + gt_cv_func_gettext_libc=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + gt_cv_func_gettext_libc=no +fi +rm -f conftest* +fi + +echo "$ac_t""$gt_cv_func_gettext_libc" 1>&6 + + if test "$gt_cv_func_gettext_libc" != "yes"; then + echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6 +echo "configure:2737: checking for bindtextdomain in -lintl" >&5 +ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lintl $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6 +echo "configure:2772: checking for gettext in libintl" >&5 +if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo $ac_n "checking for gettext in -lintl""... $ac_c" 1>&6 +echo "configure:2777: checking for gettext in -lintl" >&5 +ac_lib_var=`echo intl'_'gettext | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lintl $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + gt_cv_func_gettext_libintl=yes +else + echo "$ac_t""no" 1>&6 +gt_cv_func_gettext_libintl=no +fi + +fi + +echo "$ac_t""$gt_cv_func_gettext_libintl" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + fi + + if test "$gt_cv_func_gettext_libc" = "yes" \ + || test "$gt_cv_func_gettext_libintl" = "yes"; then + cat >> confdefs.h <<\EOF +#define HAVE_GETTEXT 1 +EOF + + # Extract the first word of "msgfmt", so it can be a program name with args. +set dummy msgfmt; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:2835: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$MSGFMT" in + /*) + ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then + ac_cv_path_MSGFMT="$ac_dir/$ac_word" + break + fi + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT="no" + ;; +esac +fi +MSGFMT="$ac_cv_path_MSGFMT" +if test -n "$MSGFMT"; then + echo "$ac_t""$MSGFMT" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + if test "$MSGFMT" != "no"; then + for ac_func in dcgettext +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:2869: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:2897: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + + # Extract the first word of "gmsgfmt", so it can be a program name with args. +set dummy gmsgfmt; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:2924: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$GMSGFMT" in + /*) + ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_GMSGFMT="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" + ;; +esac +fi +GMSGFMT="$ac_cv_path_GMSGFMT" +if test -n "$GMSGFMT"; then + echo "$ac_t""$GMSGFMT" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + # Extract the first word of "xgettext", so it can be a program name with args. +set dummy xgettext; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:2960: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$XGETTEXT" in + /*) + ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then + ac_cv_path_XGETTEXT="$ac_dir/$ac_word" + break + fi + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" + ;; +esac +fi +XGETTEXT="$ac_cv_path_XGETTEXT" +if test -n "$XGETTEXT"; then + echo "$ac_t""$XGETTEXT" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + CATOBJEXT=.gmo + DATADIRNAME=share +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CATOBJEXT=.mo + DATADIRNAME=lib +fi +rm -f conftest* + INSTOBJEXT=.mo + fi + fi + +else + echo "$ac_t""no" 1>&6 +fi + + + if test "$CATOBJEXT" = "NONE"; then + echo $ac_n "checking whether catgets can be used""... $ac_c" 1>&6 +echo "configure:3023: checking whether catgets can be used" >&5 + # Check whether --with-catgets or --without-catgets was given. +if test "${with_catgets+set}" = set; then + withval="$with_catgets" + nls_cv_use_catgets=$withval +else + nls_cv_use_catgets=no +fi + + echo "$ac_t""$nls_cv_use_catgets" 1>&6 + + if test "$nls_cv_use_catgets" = "yes"; then + echo $ac_n "checking for main in -li""... $ac_c" 1>&6 +echo "configure:3036: checking for main in -li" >&5 +ac_lib_var=`echo i'_'main | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-li $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_lib=HAVE_LIB`echo i | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <&6 +fi + + echo $ac_n "checking for catgets""... $ac_c" 1>&6 +echo "configure:3079: checking for catgets" >&5 +if eval "test \"`echo '$''{'ac_cv_func_catgets'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char catgets(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_catgets) || defined (__stub___catgets) +choke me +#else +catgets(); +#endif + +; return 0; } +EOF +if { (eval echo configure:3107: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_catgets=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_catgets=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'catgets`\" = yes"; then + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <<\EOF +#define HAVE_CATGETS 1 +EOF + + INTLOBJS="\$(CATOBJS)" + # Extract the first word of "gencat", so it can be a program name with args. +set dummy gencat; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:3129: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_GENCAT'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$GENCAT" in + /*) + ac_cv_path_GENCAT="$GENCAT" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_GENCAT="$GENCAT" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_GENCAT="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_GENCAT" && ac_cv_path_GENCAT="no" + ;; +esac +fi +GENCAT="$ac_cv_path_GENCAT" +if test -n "$GENCAT"; then + echo "$ac_t""$GENCAT" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + if test "$GENCAT" != "no"; then + # Extract the first word of "gmsgfmt", so it can be a program name with args. +set dummy gmsgfmt; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:3165: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$GMSGFMT" in + /*) + ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_GMSGFMT="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="no" + ;; +esac +fi +GMSGFMT="$ac_cv_path_GMSGFMT" +if test -n "$GMSGFMT"; then + echo "$ac_t""$GMSGFMT" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + if test "$GMSGFMT" = "no"; then + # Extract the first word of "msgfmt", so it can be a program name with args. +set dummy msgfmt; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:3202: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$GMSGFMT" in + /*) + ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then + ac_cv_path_GMSGFMT="$ac_dir/$ac_word" + break + fi + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="no" + ;; +esac +fi +GMSGFMT="$ac_cv_path_GMSGFMT" +if test -n "$GMSGFMT"; then + echo "$ac_t""$GMSGFMT" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + fi + # Extract the first word of "xgettext", so it can be a program name with args. +set dummy xgettext; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:3237: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$XGETTEXT" in + /*) + ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then + ac_cv_path_XGETTEXT="$ac_dir/$ac_word" + break + fi + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" + ;; +esac +fi +XGETTEXT="$ac_cv_path_XGETTEXT" +if test -n "$XGETTEXT"; then + echo "$ac_t""$XGETTEXT" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + USE_INCLUDED_LIBINTL=yes + CATOBJEXT=.cat + INSTOBJEXT=.cat + DATADIRNAME=lib + INTLDEPS='$(top_builddir)/intl/libintl.a' + INTLLIBS=$INTLDEPS + LIBS=`echo $LIBS | sed -e 's/-lintl//'` + nls_cv_header_intl=intl/libintl.h + nls_cv_header_libgt=intl/libgettext.h + fi +else + echo "$ac_t""no" 1>&6 +fi + + fi + fi + + if test "$CATOBJEXT" = "NONE"; then + nls_cv_use_gnu_gettext=yes + fi + fi + + if test "$nls_cv_use_gnu_gettext" = "yes"; then + INTLOBJS="\$(GETTOBJS)" + # Extract the first word of "msgfmt", so it can be a program name with args. +set dummy msgfmt; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:3295: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$MSGFMT" in + /*) + ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then + ac_cv_path_MSGFMT="$ac_dir/$ac_word" + break + fi + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT="msgfmt" + ;; +esac +fi +MSGFMT="$ac_cv_path_MSGFMT" +if test -n "$MSGFMT"; then + echo "$ac_t""$MSGFMT" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + # Extract the first word of "gmsgfmt", so it can be a program name with args. +set dummy gmsgfmt; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:3329: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$GMSGFMT" in + /*) + ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_GMSGFMT="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" + ;; +esac +fi +GMSGFMT="$ac_cv_path_GMSGFMT" +if test -n "$GMSGFMT"; then + echo "$ac_t""$GMSGFMT" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + # Extract the first word of "xgettext", so it can be a program name with args. +set dummy xgettext; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:3365: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$XGETTEXT" in + /*) + ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then + ac_cv_path_XGETTEXT="$ac_dir/$ac_word" + break + fi + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" + ;; +esac +fi +XGETTEXT="$ac_cv_path_XGETTEXT" +if test -n "$XGETTEXT"; then + echo "$ac_t""$XGETTEXT" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + USE_INCLUDED_LIBINTL=yes + CATOBJEXT=.gmo + INSTOBJEXT=.mo + DATADIRNAME=share + INTLDEPS='$(top_builddir)/intl/libintl.a' + INTLLIBS=$INTLDEPS + LIBS=`echo $LIBS | sed -e 's/-lintl//'` + nls_cv_header_intl=intl/libintl.h + nls_cv_header_libgt=intl/libgettext.h + fi + + if test "$XGETTEXT" != ":"; then + if $XGETTEXT --omit-header /dev/null 2> /dev/null; then + : ; + else + echo "$ac_t""found xgettext program is not GNU xgettext; ignore it" 1>&6 + XGETTEXT=":" + fi + fi + + # We need to process the po/ directory. + POSUB=po + else + DATADIRNAME=share + nls_cv_header_intl=intl/libintl.h + nls_cv_header_libgt=intl/libgettext.h + fi + + + + + # If this is used in GNU gettext we have to set USE_NLS to `yes' + # because some of the sources are only built for this goal. + if test "$PACKAGE" = gettext; then + USE_NLS=yes + USE_INCLUDED_LIBINTL=yes + fi + + for lang in $ALL_LINGUAS; do + GMOFILES="$GMOFILES $lang.gmo" + POFILES="$POFILES $lang.po" + done + + + + + + + + + + + + + + + if test "x$CATOBJEXT" != "x"; then + if test "x$ALL_LINGUAS" = "x"; then + LINGUAS= + else + echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6 +echo "configure:3458: checking for catalogs to be installed" >&5 + NEW_LINGUAS= + for lang in ${LINGUAS=$ALL_LINGUAS}; do + case "$ALL_LINGUAS" in + *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;; + esac + done + LINGUAS=$NEW_LINGUAS + echo "$ac_t""$LINGUAS" 1>&6 + fi + + if test -n "$LINGUAS"; then + for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done + fi + fi + + if test $ac_cv_header_locale_h = yes; then + INCLUDE_LOCALE_H="#include " + else + INCLUDE_LOCALE_H="\ +/* The system does not provide the header . Take care yourself. */" + fi + + + test -d intl || mkdir intl + if test "$CATOBJEXT" = ".cat"; then + ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6 +echo "configure:3486: checking for linux/version.h" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:3496: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + msgformat=linux +else + echo "$ac_t""no" 1>&6 +msgformat=xopen +fi + + + sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed + fi + sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \ + $srcdir/intl/po2tbl.sed.in > intl/po2tbl.sed + + if test "$PACKAGE" = "gettext"; then + GT_NO="#NO#" + GT_YES= + else + GT_NO= + GT_YES="#YES#" + fi + + + + MKINSTALLDIRS= + if test -n "$ac_aux_dir"; then + MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" + fi + if test -z "$MKINSTALLDIRS"; then + MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" + fi + + + l= + + + test -d po || mkdir po + if test "x$srcdir" != "x."; then + if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then + posrcprefix="$srcdir/" + else + posrcprefix="../$srcdir/" + fi + else + posrcprefix="../" + fi + rm -f po/POTFILES + sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \ + < $srcdir/po/POTFILES.in > po/POTFILES + + +# This is necessary so that .o files in LIBOBJS are also built via +# the ANSI2KNR-filtering rules. +LIBOBJS=`echo $LIBOBJS|sed 's/\.o /\$U.o /g;s/\.o$/\$U.o/'` + +cat >> confdefs.h <> confdefs.h <> confdefs.h <> confdefs.h < confcache <<\EOF @@ -1310,11 +3619,25 @@ cat > confcache <<\EOF # --recheck option to rerun configure. # EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. (set) 2>&1 | - sed -n "s/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=\${\1='\2'}/p" \ - >> confcache + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache if cmp -s $cache_file confcache; then : else @@ -1342,19 +3665,7 @@ fi trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 -# Transform confdefs.h into DEFS. -# Protect against shell expansion while executing Makefile rules. -# Protect against Makefile macro expansion. -cat > conftest.defs <<\EOF -s%#define \([A-Za-z_][A-Za-z0-9_]*\) \(.*\)%-D\1=\2%g -s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g -s%\[%\\&%g -s%\]%\\&%g -s%\$%$$%g -EOF -DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` -rm -f conftest.defs - +DEFS=-DHAVE_CONFIG_H # Without the "./", some shells look in PATH for config.status. : ${CONFIG_STATUS=./config.status} @@ -1381,7 +3692,7 @@ do echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; -version | --version | --versio | --versi | --vers | --ver | --ve | --v) - echo "$CONFIG_STATUS generated by autoconf version 2.7" + echo "$CONFIG_STATUS generated by autoconf version 2.13" exit 0 ;; -help | --help | --hel | --he | --h) echo "\$ac_cs_usage"; exit 0 ;; @@ -1392,7 +3703,7 @@ done ac_given_srcdir=$srcdir ac_given_INSTALL="$INSTALL" -trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +trap 'rm -fr `echo "Makefile intl/Makefile po/Makefile.in src/Makefile doc/Makefile config.h:config.hin" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF $ac_vpsub $extrasub +s%@SHELL@%$SHELL%g s%@CFLAGS@%$CFLAGS%g s%@CPPFLAGS@%$CPPFLAGS%g s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g s%@DEFS@%$DEFS%g s%@LDFLAGS@%$LDFLAGS%g s%@LIBS@%$LIBS%g @@ -1422,28 +3735,97 @@ s%@includedir@%$includedir%g s%@oldincludedir@%$oldincludedir%g s%@infodir@%$infodir%g s%@mandir@%$mandir%g -s%@CC@%$CC%g s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@PACKAGE@%$PACKAGE%g +s%@VERSION@%$VERSION%g +s%@ACLOCAL@%$ACLOCAL%g +s%@AUTOCONF@%$AUTOCONF%g +s%@AUTOMAKE@%$AUTOMAKE%g +s%@AUTOHEADER@%$AUTOHEADER%g +s%@MAKEINFO@%$MAKEINFO%g +s%@SET_MAKE@%$SET_MAKE%g +s%@CC@%$CC%g s%@CPP@%$CPP%g +s%@RANLIB@%$RANLIB%g +s%@U@%$U%g +s%@ANSI2KNR@%$ANSI2KNR%g s%@ALLOCA@%$ALLOCA%g +s%@USE_NLS@%$USE_NLS%g +s%@MSGFMT@%$MSGFMT%g +s%@GMSGFMT@%$GMSGFMT%g +s%@XGETTEXT@%$XGETTEXT%g +s%@GENCAT@%$GENCAT%g +s%@USE_INCLUDED_LIBINTL@%$USE_INCLUDED_LIBINTL%g +s%@CATALOGS@%$CATALOGS%g +s%@CATOBJEXT@%$CATOBJEXT%g +s%@DATADIRNAME@%$DATADIRNAME%g +s%@GMOFILES@%$GMOFILES%g +s%@INSTOBJEXT@%$INSTOBJEXT%g +s%@INTLDEPS@%$INTLDEPS%g +s%@INTLLIBS@%$INTLLIBS%g +s%@INTLOBJS@%$INTLOBJS%g +s%@POFILES@%$POFILES%g +s%@POSUB@%$POSUB%g +s%@INCLUDE_LOCALE_H@%$INCLUDE_LOCALE_H%g +s%@GT_NO@%$GT_NO%g +s%@GT_YES@%$GT_YES%g +s%@MKINSTALLDIRS@%$MKINSTALLDIRS%g +s%@l@%$l%g CEOF EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then - # Support "outfile[:infile]", defaulting infile="outfile.in". + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'` + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; *) ac_file_in="${ac_file}.in" ;; esac - # Adjust relative srcdir, etc. for subdirectories. + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. # Remove last slash and all that follows it. Not all systems have dirname. ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` @@ -1471,6 +3853,7 @@ for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then [/$]*) INSTALL="$ac_given_INSTALL" ;; *) INSTALL="$ac_dots$ac_given_INSTALL" ;; esac + echo creating "$ac_file" rm -f "$ac_file" configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." @@ -1479,17 +3862,181 @@ for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then # $configure_input" ;; *) ac_comsub= ;; esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` sed -e "$ac_comsub s%@configure_input@%$configure_input%g s%@srcdir@%$srcdir%g s%@top_srcdir@%$top_srcdir%g s%@INSTALL@%$INSTALL%g -" -f conftest.subs $ac_given_srcdir/$ac_file_in > $ac_file +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file fi; done -rm -f conftest.subs +rm -f conftest.s* + +# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where +# NAME is the cpp macro being defined and VALUE is the value it is being given. +# +# ac_d sets the value in "#define NAME VALUE" lines. +ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)' +ac_dB='\([ ][ ]*\)[^ ]*%\1#\2' +ac_dC='\3' +ac_dD='%g' +# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE". +ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_uB='\([ ]\)%\1#\2define\3' +ac_uC=' ' +ac_uD='\4%g' +# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE". +ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_eB='$%\1#\2define\3' +ac_eC=' ' +ac_eD='%g' + +if test "${CONFIG_HEADERS+set}" != set; then +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +fi +for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + echo creating $ac_file + + rm -f conftest.frag conftest.in conftest.out + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + cat $ac_file_inputs > conftest.in + +EOF + +# Transform confdefs.h into a sed script conftest.vals that substitutes +# the proper values into config.h.in to produce config.h. And first: +# Protect against being on the right side of a sed subst in config.status. +# Protect against being in an unquoted here document in config.status. +rm -f conftest.vals +cat > conftest.hdr <<\EOF +s/[\\&%]/\\&/g +s%[\\$`]%\\&%g +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp +s%ac_d%ac_u%gp +s%ac_u%ac_e%gp +EOF +sed -n -f conftest.hdr confdefs.h > conftest.vals +rm -f conftest.hdr + +# This sed command replaces #undef with comments. This is necessary, for +# example, in the case of _POSIX_SOURCE, which is predefined and required +# on some systems where configure will not decide to define it. +cat >> conftest.vals <<\EOF +s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */% +EOF + +# Break up conftest.vals because some shells have a limit on +# the size of here documents, and old seds have small limits too. + +rm -f conftest.tail +while : +do + ac_lines=`grep -c . conftest.vals` + # grep -c gives empty output for an empty file on some AIX systems. + if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi + # Write a limited-size here document to conftest.frag. + echo ' cat > conftest.frag <> $CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS + echo 'CEOF + sed -f conftest.frag conftest.in > conftest.out + rm -f conftest.in + mv conftest.out conftest.in +' >> $CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail + rm -f conftest.vals + mv conftest.tail conftest.vals +done +rm -f conftest.vals + +cat >> $CONFIG_STATUS <<\EOF + rm -f conftest.frag conftest.h + echo "/* $ac_file. Generated automatically by configure. */" > conftest.h + cat conftest.in >> conftest.h + rm -f conftest.in + if cmp -s $ac_file conftest.h 2>/dev/null; then + echo "$ac_file is unchanged" + rm -f conftest.h + else + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + fi + rm -f $ac_file + mv conftest.h $ac_file + fi +fi; done + +EOF + +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +srcdir=$ac_given_srcdir +while test -n "$ac_sources"; do + set $ac_dests; ac_dest=$1; shift; ac_dests=$* + set $ac_sources; ac_source=$1; shift; ac_sources=$* + + echo "linking $srcdir/$ac_source to $ac_dest" + + if test ! -r $srcdir/$ac_source; then + { echo "configure: error: $srcdir/$ac_source: File not found" 1>&2; exit 1; } + fi + rm -f $ac_dest + + # Make relative symlinks. + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dest_dir=`echo $ac_dest|sed 's%/[^/][^/]*$%%'` + if test "$ac_dest_dir" != "$ac_dest" && test "$ac_dest_dir" != .; then + # The dest file is in a subdirectory. + test ! -d "$ac_dest_dir" && mkdir "$ac_dest_dir" + ac_dest_dir_suffix="/`echo $ac_dest_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dest_dir_suffix. + ac_dots=`echo $ac_dest_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dest_dir_suffix= ac_dots= + fi + + case "$srcdir" in + [/$]*) ac_rel_source="$srcdir/$ac_source" ;; + *) ac_rel_source="$ac_dots$srcdir/$ac_source" ;; + esac + + # Make a symlink if possible; otherwise try a hard link. + if ln -s $ac_rel_source $ac_dest 2>/dev/null || + ln $srcdir/$ac_source $ac_dest; then : + else + { echo "configure: error: can not link $ac_dest to $srcdir/$ac_source" 1>&2; exit 1; } + fi +done +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h +case "$CONFIG_FILES" in *po/Makefile.in*) + sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile + esac + exit 0 EOF chmod +x $CONFIG_STATUS diff --git a/contrib/bison/configure.in b/contrib/bison/configure.in index 4456254d9ea7..b04448111305 100644 --- a/contrib/bison/configure.in +++ b/contrib/bison/configure.in @@ -1,22 +1,50 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT(reduce.c) +AC_INIT(src/reduce.c) +AM_INIT_AUTOMAKE(bison,1.28) +AM_CONFIG_HEADER(config.h:config.hin) +AC_PREREQ(2.13) + +ALL_LINGUAS="de es fr nl" dnl Checks for programs. AC_PROG_CC -AC_PROG_INSTALL - AC_MINIX AC_ISC_POSIX +AM_PROG_CC_STDC +AC_PROG_INSTALL +AC_PROG_RANLIB + +dnl Checks for libraries. dnl Checks for header files. AC_HEADER_STDC -AC_CHECK_HEADERS(string.h stdlib.h memory.h) +AC_CHECK_HEADERS(ctype.h locale.h memory.h stdlib.h string.h unistd.h) -dnl Checks for typedefs, structures, and compiler characteristics. +dnl Checks for typedefs. + +dnl Checks for structures. + +dnl Checks for compiler characteristics. AC_C_CONST +AM_C_PROTOTYPES dnl Checks for library functions. AC_FUNC_ALLOCA -AC_CHECK_FUNCS(strerror) +AC_CHECK_FUNCS(mkstemp setlocale) +BISON_NEED_DECLARATIONS(calloc realloc) -AC_OUTPUT(Makefile) +AM_GNU_GETTEXT + +# This is necessary so that .o files in LIBOBJS are also built via +# the ANSI2KNR-filtering rules. +LIBOBJS=`echo $LIBOBJS|sed 's/\.o /\$U.o /g;s/\.o$/\$U.o/'` + +AC_DEFINE_UNQUOTED(VERSION_STRING, "GNU Bison version ${VERSION}") +XPFILE="${datadir}/bison.simple" +BISON_DEFINE_FILE(XPFILE, XPFILE) +XPFILE1="${datadir}/bison.hairy" +BISON_DEFINE_FILE(XPFILE1, XPFILE1) +LOCALEDIR="${datadir}/locale" +BISON_DEFINE_FILE(LOCALEDIR, LOCALEDIR) + +AC_OUTPUT(Makefile intl/Makefile po/Makefile.in src/Makefile doc/Makefile) diff --git a/contrib/bison/conflicts.c b/contrib/bison/conflicts.c index 29656f320782..92f548765b0b 100644 --- a/contrib/bison/conflicts.c +++ b/contrib/bison/conflicts.c @@ -15,12 +15,13 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bison; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ #include #include "system.h" #include "machine.h" -#include "new.h" +#include "alloc.h" #include "files.h" #include "gram.h" #include "state.h" @@ -35,14 +36,20 @@ extern unsigned *LA; extern short *LAruleno; extern short *lookaheads; extern int verboseflag; +extern int fixed_outfiles; -void set_conflicts(); -void resolve_sr_conflict(); -void flush_shift(); -void log_resolution(); -void total_conflicts(); -void count_sr_conflicts(); -void count_rr_conflicts(); +void initialize_conflicts PARAMS((void)); +void set_conflicts PARAMS((int)); +void resolve_sr_conflict PARAMS((int, int)); +void flush_shift PARAMS((int, int)); +void log_resolution PARAMS((int, int, int, char *)); +void conflict_log PARAMS((void)); +void verbose_conflict_log PARAMS((void)); +void total_conflicts PARAMS((void)); +void count_sr_conflicts PARAMS((int)); +void count_rr_conflicts PARAMS((int)); +void print_reductions PARAMS((int)); +void finalize_conflicts PARAMS((void)); char any_conflicts; char *conflicts; @@ -59,7 +66,7 @@ static int rrc_count; void -initialize_conflicts() +initialize_conflicts (void) { register int i; /* register errs *sp; JF unused */ @@ -78,8 +85,7 @@ initialize_conflicts() void -set_conflicts(state) -int state; +set_conflicts (int state) { register int i; register int k; @@ -165,9 +171,7 @@ A conflict is resolved by modifying the shift or reduce tables so that there is no longer a conflict. */ void -resolve_sr_conflict(state, lookaheadnum) -int state; -int lookaheadnum; +resolve_sr_conflict (int state, int lookaheadnum) { register int i; register int mask; @@ -192,13 +196,13 @@ int lookaheadnum; { if (sprec[i] < redprec) { - if (verboseflag) log_resolution(state, lookaheadnum, i, "reduce"); + if (verboseflag) log_resolution(state, lookaheadnum, i, _("reduce")); *fp2 &= ~mask; /* flush the shift for this token */ flush_shift(state, i); } else if (sprec[i] > redprec) { - if (verboseflag) log_resolution(state, lookaheadnum, i, "shift"); + if (verboseflag) log_resolution(state, lookaheadnum, i, _("shift")); *fp1 &= ~mask; /* flush the reduce for this token */ } else @@ -212,15 +216,15 @@ int lookaheadnum; { case RIGHT_ASSOC: - if (verboseflag) log_resolution(state, lookaheadnum, i, "shift"); + if (verboseflag) log_resolution(state, lookaheadnum, i, _("shift")); break; case LEFT_ASSOC: - if (verboseflag) log_resolution(state, lookaheadnum, i, "reduce"); + if (verboseflag) log_resolution(state, lookaheadnum, i, _("reduce")); break; case NON_ASSOC: - if (verboseflag) log_resolution(state, lookaheadnum, i, "an error"); + if (verboseflag) log_resolution(state, lookaheadnum, i, _("an error")); break; } @@ -268,9 +272,7 @@ int lookaheadnum; Used when we resolve a shift-reduce conflict in favor of the reduction. */ void -flush_shift(state, token) -int state; -int token; +flush_shift (int state, int token) { register shifts *shiftp; register int k, i; @@ -291,18 +293,16 @@ int token; void -log_resolution(state, LAno, token, resolution) -int state, LAno, token; -char *resolution; +log_resolution (int state, int LAno, int token, char *resolution) { fprintf(foutput, - "Conflict in state %d between rule %d and token %s resolved as %s.\n", + _("Conflict in state %d between rule %d and token %s resolved as %s.\n"), state, LAruleno[LAno], tags[token], resolution); } void -conflict_log() +conflict_log (void) { register int i; @@ -325,7 +325,7 @@ conflict_log() void -verbose_conflict_log() +verbose_conflict_log (void) { register int i; @@ -341,20 +341,20 @@ verbose_conflict_log() src_total += src_count; rrc_total += rrc_count; - fprintf(foutput, "State %d contains", i); + fprintf(foutput, _("State %d contains"), i); if (src_count == 1) - fprintf(foutput, " 1 shift/reduce conflict"); + fprintf(foutput, _(" 1 shift/reduce conflict")); else if (src_count > 1) - fprintf(foutput, " %d shift/reduce conflicts", src_count); + fprintf(foutput, _(" %d shift/reduce conflicts"), src_count); if (src_count > 0 && rrc_count > 0) - fprintf(foutput, " and"); + fprintf(foutput, _(" and")); if (rrc_count == 1) - fprintf(foutput, " 1 reduce/reduce conflict"); + fprintf(foutput, _(" 1 reduce/reduce conflict")); else if (rrc_count > 1) - fprintf(foutput, " %d reduce/reduce conflicts", rrc_count); + fprintf(foutput, _(" %d reduce/reduce conflicts"), rrc_count); putc('.', foutput); putc('\n', foutput); @@ -366,10 +366,8 @@ verbose_conflict_log() void -total_conflicts() +total_conflicts (void) { - extern int fixed_outfiles; - if (src_total == expected_conflicts && rrc_total == 0) return; @@ -377,31 +375,31 @@ total_conflicts() { /* If invoked under the name `yacc', use the output format specified by POSIX. */ - fprintf(stderr, "conflicts: "); + fprintf(stderr, _("conflicts: ")); if (src_total > 0) - fprintf(stderr, " %d shift/reduce", src_total); + fprintf(stderr, _(" %d shift/reduce"), src_total); if (src_total > 0 && rrc_total > 0) fprintf(stderr, ","); if (rrc_total > 0) - fprintf(stderr, " %d reduce/reduce", rrc_total); + fprintf(stderr, _(" %d reduce/reduce"), rrc_total); putc('\n', stderr); } else { - fprintf(stderr, "%s contains", infile); + fprintf(stderr, _("%s contains"), infile); if (src_total == 1) - fprintf(stderr, " 1 shift/reduce conflict"); + fprintf(stderr, _(" 1 shift/reduce conflict")); else if (src_total > 1) - fprintf(stderr, " %d shift/reduce conflicts", src_total); + fprintf(stderr, _(" %d shift/reduce conflicts"), src_total); if (src_total > 0 && rrc_total > 0) - fprintf(stderr, " and"); + fprintf(stderr, _(" and")); if (rrc_total == 1) - fprintf(stderr, " 1 reduce/reduce conflict"); + fprintf(stderr, _(" 1 reduce/reduce conflict")); else if (rrc_total > 1) - fprintf(stderr, " %d reduce/reduce conflicts", rrc_total); + fprintf(stderr, _(" %d reduce/reduce conflicts"), rrc_total); putc('.', stderr); putc('\n', stderr); @@ -410,8 +408,7 @@ total_conflicts() void -count_sr_conflicts(state) -int state; +count_sr_conflicts (int state) { register int i; register int k; @@ -478,8 +475,7 @@ int state; void -count_rr_conflicts(state) -int state; +count_rr_conflicts (int state) { register int i; register int j; @@ -525,8 +521,7 @@ int state; void -print_reductions(state) -int state; +print_reductions (int state) { register int i; register int j; @@ -541,7 +536,7 @@ int state; register int m; register int n; register int default_LA; - register int default_rule; + register int default_rule = 0; register int cmax; register int count; register shifts *shiftp; @@ -600,7 +595,7 @@ int state; for (i = 0; i < ntokens; i++) { if (mask & *fp3) - fprintf(foutput, " %-4s\t[reduce using rule %d (%s)]\n", + fprintf(foutput, _(" %-4s\t[reduce using rule %d (%s)]\n"), tags[i], default_rule, tags[rlhs[default_rule]]); mask <<= 1; @@ -611,7 +606,7 @@ int state; } } - fprintf(foutput, " $default\treduce using rule %d (%s)\n\n", + fprintf(foutput, _(" $default\treduce using rule %d (%s)\n\n"), default_rule, tags[rlhs[default_rule]]); } else if (n - m >= 1) @@ -697,7 +692,7 @@ int state; if (j != default_LA) { rule = LAruleno[j]; - fprintf(foutput, " %-4s\treduce using rule %d (%s)\n", + fprintf(foutput, _(" %-4s\treduce using rule %d (%s)\n"), tags[i], rule, tags[rlhs[rule]]); } else defaulted = 1; @@ -709,12 +704,12 @@ int state; if (defaulted) { rule = LAruleno[default_LA]; - fprintf(foutput, " %-4s\treduce using rule %d (%s)\n", + fprintf(foutput, _(" %-4s\treduce using rule %d (%s)\n"), tags[i], rule, tags[rlhs[rule]]); defaulted = 0; } rule = LAruleno[j]; - fprintf(foutput, " %-4s\t[reduce using rule %d (%s)]\n", + fprintf(foutput, _(" %-4s\t[reduce using rule %d (%s)]\n"), tags[i], rule, tags[rlhs[rule]]); } } @@ -735,7 +730,7 @@ int state; if (default_LA >= 0) { - fprintf(foutput, " $default\treduce using rule %d (%s)\n", + fprintf(foutput, _(" $default\treduce using rule %d (%s)\n"), default_rule, tags[rlhs[default_rule]]); } @@ -745,7 +740,7 @@ int state; void -finalize_conflicts() +finalize_conflicts (void) { FREE(conflicts); FREE(shiftset); diff --git a/contrib/bison/derives.c b/contrib/bison/derives.c index f7dfaf736e13..6002b88f9305 100644 --- a/contrib/bison/derives.c +++ b/contrib/bison/derives.c @@ -15,7 +15,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bison; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ /* set_derives finds, for each variable (nonterminal), which rules can derive it. @@ -25,15 +26,17 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include "system.h" -#include "new.h" +#include "alloc.h" #include "types.h" #include "gram.h" +void set_derives PARAMS((void)); +void free_derives PARAMS((void)); short **derives; void -set_derives() +set_derives (void) { register int i; register int lhs; @@ -82,7 +85,7 @@ set_derives() } void -free_derives() +free_derives (void) { FREE(derives[ntokens]); FREE(derives + ntokens); @@ -92,18 +95,19 @@ free_derives() #ifdef DEBUG -print_derives() +void +print_derives (void) { register int i; register short *sp; extern char **tags; - printf("\n\n\nDERIVES\n\n"); + printf(_("\n\n\nDERIVES\n\n")); for (i = ntokens; i < nsyms; i++) { - printf("%s derives", tags[i]); + printf(_("%s derives"), tags[i]); for (sp = derives[i]; *sp > 0; sp++) { printf(" %d", *sp); @@ -115,4 +119,3 @@ print_derives() } #endif - diff --git a/contrib/bison/files.c b/contrib/bison/files.c index e47b0eeb6d58..a353f575b3bf 100644 --- a/contrib/bison/files.c +++ b/contrib/bison/files.c @@ -15,9 +15,12 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bison; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ +#include "system.h" + #if defined (VMS) & !defined (__VMS_POSIX) #include #define unlink delete @@ -29,10 +32,23 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #endif #endif +#if defined (_MSC_VER) +#ifndef XPFILE +#define XPFILE "c:/usr/local/lib/bison.simple" +#endif +#ifndef XPFILE1 +#define XPFILE1 "c:/usr/local/lib/bison.hairy" +#endif +#endif + #include -#include "system.h" + +#ifdef HAVE_UNISTD_H +#include +#endif + #include "files.h" -#include "new.h" +#include "alloc.h" #include "gram.h" FILE *finput = NULL; @@ -63,8 +79,13 @@ extern int noparserflag; extern char *mktemp(); /* So the compiler won't complain */ extern char *getenv(); extern void perror(); -FILE *tryopen(); /* This might be a good idea */ -void done(); + +char *stringappend PARAMS((char *, int, char *)); +void openfiles PARAMS((void)); +void open_extra_files PARAMS((void)); +FILE *tryopen PARAMS((char *, char *)); /* This might be a good idea */ +int tryclose PARAMS((FILE *)); +void done PARAMS((int)); extern char *program_name; extern int verboseflag; @@ -72,11 +93,8 @@ extern int definesflag; int fixed_outfiles = 0; -char* -stringappend(string1, end1, string2) -char *string1; -int end1; -char *string2; +char * +stringappend (char *string1, int end1, char *string2) { register char *ostring; register char *cp, *cp1; @@ -93,7 +111,8 @@ char *string2; *cp++ = *cp1++; cp1 = string2; - while (*cp++ = *cp1++) ; + while ((*cp++ = *cp1++)) + ; return ostring; } @@ -102,10 +121,12 @@ char *string2; /* JF this has been hacked to death. Nowaday it sets up the file names for the output files, and opens the tmp files and the parser */ void -openfiles() +openfiles (void) { char *name_base; +#ifdef MSDOS register char *cp; +#endif char *filename; int base_length; int short_base_length; @@ -124,6 +145,24 @@ openfiles() strlwr (infile); #endif /* MSDOS */ +#if (defined(_WIN32) && !defined(__CYGWIN32__)) + tmp_base = getenv ("TEMP"); /* Windows95 defines this ... */ + if (tmp_base == 0) + tmp_base = getenv ("Temp"); /* ... while NT prefers this */ + if (tmp_base == 0) + tmp_base = ""; + strlwr (infile); +#endif /* _WIN32 && !__CYGWIN32__ */ + +#if (defined(unix) || defined(__unix) || defined(__unix__)) + { + char *tmp_ptr = getenv("TMPDIR"); + + if (tmp_ptr != 0) + tmp_base = stringappend (tmp_ptr, strlen (tmp_ptr), "/b."); + } +#endif /* unix || __unix || __unix__ */ + tmp_len = strlen (tmp_base); if (spec_outfile) @@ -254,13 +293,13 @@ openfiles() fdefines = tryopen(tmpdefsfile, "w+"); } -#ifndef MSDOS +#if !(defined (MSDOS) || (defined(_WIN32) && !defined(__CYGWIN32__))) if (! noparserflag) unlink(actfile); unlink(tmpattrsfile); unlink(tmptabfile); unlink(tmpdefsfile); -#endif +#endif /* MSDOS || (_WIN32 && !__CYGWIN32__) */ /* These are opened by `done' or `open_extra_files', if at all */ if (spec_outfile) @@ -288,14 +327,16 @@ openfiles() This is done when %semantic_parser is seen in the declarations section. */ void -open_extra_files() +open_extra_files (void) { FILE *ftmp; int c; - char *filename, *cp; + char *filename; +#ifdef MSDOS + char *cp; +#endif - if (fparser) - fclose(fparser); + tryclose(fparser); if (! noparserflag) { @@ -320,7 +361,7 @@ open_extra_files() rewind(fattrs); while((c=getc(fattrs))!=EOF) /* Thank god for buffering */ putc(c,ftmp); - fclose(fattrs); + tryclose(fattrs); fattrs=ftmp; fguard = tryopen(guardfile, "w"); @@ -330,9 +371,7 @@ open_extra_files() /* JF to make file opening easier. This func tries to open file NAME with mode MODE, and prints an error message if it fails. */ FILE * -tryopen(name, mode) -char *name; -char *mode; +tryopen (char *name, char *mode) { FILE *ptr; @@ -346,27 +385,33 @@ char *mode; return ptr; } -void -done(k) -int k; +int +tryclose (FILE *ptr) { - if (faction) - fclose(faction); + int result; - if (fattrs) - fclose(fattrs); + if (ptr == NULL) + return 0; - if (fguard) - fclose(fguard); + result = fclose (ptr); + if (result == EOF) + { + fprintf (stderr, "%s: ", program_name); + perror ("fclose"); + done (2); + } + return result; +} - if (finput) - fclose(finput); - - if (fparser) - fclose(fparser); - - if (foutput) - fclose(foutput); +void +done (int k) +{ + tryclose(faction); + tryclose(fattrs); + tryclose(fguard); + tryclose(finput); + tryclose(fparser); + tryclose(foutput); /* JF write out the output file */ if (k == 0 && ftable) @@ -378,8 +423,8 @@ int k; rewind(ftable); while((c=getc(ftable)) != EOF) putc(c,ftmp); - fclose(ftmp); - fclose(ftable); + tryclose(ftmp); + tryclose(ftable); if (definesflag) { @@ -388,8 +433,8 @@ int k; rewind(fdefines); while((c=getc(fdefines)) != EOF) putc(c,ftmp); - fclose(ftmp); - fclose(fdefines); + tryclose(ftmp); + tryclose(fdefines); } } @@ -403,12 +448,12 @@ int k; if (k==0) sys$exit(SS$_NORMAL); sys$exit(SS$_ABORT); #else -#ifdef MSDOS +#if (defined (MSDOS) || (defined(_WIN32) && !defined(__CYGWIN32__))) if (actfile && ! noparserflag) unlink(actfile); if (tmpattrsfile) unlink(tmpattrsfile); if (tmptabfile) unlink(tmptabfile); if (tmpdefsfile) unlink(tmpdefsfile); -#endif /* MSDOS */ +#endif /* MSDOS || (_WIN32 && !__CYGWIN32__) */ exit(k); #endif /* not VMS, or __VMS_POSIX */ } diff --git a/contrib/bison/files.h b/contrib/bison/files.h index 8d24890e5daf..6bc1e4e5b203 100644 --- a/contrib/bison/files.h +++ b/contrib/bison/files.h @@ -15,12 +15,13 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bison; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ /* These two should be pathnames for opening the sample parser files. When bison is installed, they should be absolute pathnames. - XPFILE1 and XPFILE2 normally come from the Makefile. */ + XPFILE1 and XPFILE2 normally come from config.h. */ #define PFILE XPFILE /* Simple parser */ #define PFILE1 XPFILE1 /* Semantic parser */ diff --git a/contrib/bison/getargs.c b/contrib/bison/getargs.c index ce6d77962d28..ee1a03a7ea8b 100644 --- a/contrib/bison/getargs.c +++ b/contrib/bison/getargs.c @@ -15,7 +15,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bison; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ #include @@ -34,10 +35,12 @@ char *spec_name_prefix; /* for -p. */ char *spec_file_prefix; /* for -b. */ extern int fixed_outfiles;/* for -y */ -extern char *program_name; -extern char *version_string; +void usage PARAMS((FILE *)); +void getargs PARAMS((int, char *[])); -extern void warns(); /* main.c */ +extern char *program_name; + +extern void warns PARAMS((char *, char *)); /* main.c */ struct option longopts[] = { @@ -60,23 +63,21 @@ struct option longopts[] = }; void -usage (stream) - FILE *stream; +usage (FILE *stream) { - fprintf (stream, "\ + fprintf (stream, _("\ Usage: %s [-dhklntvyV] [-b file-prefix] [-o outfile] [-p name-prefix]\n\ [--debug] [--defines] [--fixed-output-files] [--no-lines]\n\ [--verbose] [--version] [--help] [--yacc]\n\ [--no-parser] [--token-table]\n\ [--file-prefix=prefix] [--name-prefix=prefix]\n\ - [--output=outfile] grammar-file\n", + [--output=outfile] grammar-file\n\n\ +Report bugs to bug-bison@gnu.org\n"), program_name); } void -getargs(argc, argv) - int argc; - char *argv[]; +getargs (int argc, char *argv[]) { register int c; @@ -106,7 +107,7 @@ getargs(argc, argv) exit (0); case 'V': - printf ("%s", version_string); + printf ("%s\n", VERSION_STRING); exit (0); case 'v': @@ -157,11 +158,11 @@ getargs(argc, argv) if (optind == argc) { - fprintf(stderr, "%s: no grammar file given\n", program_name); + fprintf(stderr, _("%s: no grammar file given\n"), program_name); exit(1); } if (optind < argc - 1) - fprintf(stderr, "%s: extra arguments ignored after '%s'\n", + fprintf(stderr, _("%s: extra arguments ignored after '%s'\n"), program_name, argv[optind]); infile = argv[optind]; diff --git a/contrib/bison/getopt.c b/contrib/bison/getopt.c index ab534de5e48a..03effcbdb3e1 100644 --- a/contrib/bison/getopt.c +++ b/contrib/bison/getopt.c @@ -1,11 +1,14 @@ /* Getopt for GNU. NOTE: getopt is now part of the C library, so if you don't know what - "Keep this file name-space clean" means, talk to roland@gnu.ai.mit.edu + "Keep this file name-space clean" means, talk to drepper@gnu.org before changing it! - Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 1996 + Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98 Free Software Foundation, Inc. + NOTE: The canonical source of this file is maintained with the GNU C Library. + Bugs can be reported to bug-glibc@gnu.org. + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any @@ -24,19 +27,19 @@ /* This tells Alpha OSF/1 not to define a getopt prototype in . Ditto for AIX 3.2 and . */ #ifndef _NO_PROTO -#define _NO_PROTO +# define _NO_PROTO #endif #ifdef HAVE_CONFIG_H -#include +# include #endif -#if !defined (__STDC__) || !__STDC__ +#if !defined __STDC__ || !__STDC__ /* This is a separate conditional since some stdc systems reject `defined (const)'. */ -#ifndef const -#define const -#endif +# ifndef const +# define const +# endif #endif #include @@ -49,7 +52,15 @@ program understand `configure --with-gnu-libc' and omit the object files, it is simpler to just do this in the source for each such file. */ -#if defined (_LIBC) || !defined (__GNU_LIBRARY__) +#define GETOPT_INTERFACE_VERSION 2 +#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2 +# include +# if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION +# define ELIDE_CODE +# endif +#endif + +#ifndef ELIDE_CODE /* This needs to come after some library #include @@ -57,19 +68,26 @@ #ifdef __GNU_LIBRARY__ /* Don't include stdlib.h for non-GNU C libraries because some of them contain conflicting prototypes for getopt. */ -#include -#include +# include +# include #endif /* GNU C library. */ +#ifdef VMS +# include +# if HAVE_STRING_H - 0 +# include +# endif +#endif + #ifndef _ /* This is for other GNU distributions with internationalized messages. When compiling libc, the _ macro is predefined. */ -#ifdef HAVE_LIBINTL_H -# include -# define _(msgid) gettext (msgid) -#else -# define _(msgid) (msgid) -#endif +# ifdef HAVE_LIBINTL_H +# include +# define _(msgid) gettext (msgid) +# else +# define _(msgid) (msgid) +# endif #endif /* This version of `getopt' appears to the caller like standard Unix `getopt' @@ -102,14 +120,20 @@ char *optarg = NULL; On entry to `getopt', zero means this is the first call; initialize. - When `getopt' returns EOF, this is the index of the first of the + When `getopt' returns -1, this is the index of the first of the non-option elements that the caller should itself scan. Otherwise, `optind' communicates from one call to the next how much of ARGV has been scanned so far. */ -/* XXX 1003.2 says this must be 1 before any call. */ -int optind = 0; +/* 1003.2 says this must be 1 before any call. */ +int optind = 1; + +/* Formerly, initialization of getopt depended on optind==0, which + causes problems with re-calling getopt as programs generally don't + know that. */ + +int __getopt_initialized = 0; /* The next char to be scanned in the option-element in which the last option character we returned was found. @@ -158,7 +182,7 @@ int optopt = '?'; The special argument `--' forces an end of option-scanning regardless of the value of `ordering'. In the case of RETURN_IN_ORDER, only - `--' can cause `getopt' to return EOF with `optind' != ARGC. */ + `--' can cause `getopt' to return -1 with `optind' != ARGC. */ static enum { @@ -173,14 +197,22 @@ static char *posixly_correct; because there are many ways it can cause trouble. On some systems, it contains special magic macros that don't work in GCC. */ -#include -#define my_index strchr +# include +# define my_index strchr #else +# if HAVE_STRING_H +# include +# else +# include +# endif + /* Avoid depending on library functions or files whose names are inconsistent. */ -char *getenv (); +#ifndef getenv +extern char *getenv (); +#endif static char * my_index (str, chr) @@ -201,11 +233,11 @@ my_index (str, chr) #ifdef __GNUC__ /* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h. That was relevant to code that was here before. */ -#if !defined (__STDC__) || !__STDC__ +# if (!defined __STDC__ || !__STDC__) && !defined strlen /* gcc with -traditional declares the built-in strlen to return int, and has done so at least since version 2.4.5. -- rms. */ extern int strlen (const char *); -#endif /* not __STDC__ */ +# endif /* not __STDC__ */ #endif /* __GNUC__ */ #endif /* not __GNU_LIBRARY__ */ @@ -219,12 +251,46 @@ extern int strlen (const char *); static int first_nonopt; static int last_nonopt; +#ifdef _LIBC /* Bash 2.0 gives us an environment variable containing flags indicating ARGV elements that should not be considered arguments. */ -static const char *nonoption_flags; +/* Defined in getopt_init.c */ +extern char *__getopt_nonoption_flags; + +static int nonoption_flags_max_len; static int nonoption_flags_len; +static int original_argc; +static char *const *original_argv; + +/* Make sure the environment variable bash 2.0 puts in the environment + is valid for the getopt call we must make sure that the ARGV passed + to getopt is that one passed to the process. */ +static void +__attribute__ ((unused)) +store_args_and_env (int argc, char *const *argv) +{ + /* XXX This is no good solution. We should rather copy the args so + that we can compare them later. But we must not use malloc(3). */ + original_argc = argc; + original_argv = argv; +} +# ifdef text_set_element +text_set_element (__libc_subinit, store_args_and_env); +# endif /* text_set_element */ + +# define SWAP_FLAGS(ch1, ch2) \ + if (nonoption_flags_len > 0) \ + { \ + char __tmp = __getopt_nonoption_flags[ch1]; \ + __getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2]; \ + __getopt_nonoption_flags[ch2] = __tmp; \ + } +#else /* !_LIBC */ +# define SWAP_FLAGS(ch1, ch2) +#endif /* _LIBC */ + /* Exchange two adjacent subsequences of ARGV. One subsequence is elements [first_nonopt,last_nonopt) which contains all the non-options that have been skipped so far. @@ -234,7 +300,7 @@ static int nonoption_flags_len; `first_nonopt' and `last_nonopt' are relocated so that they describe the new indices of the non-options in ARGV after they are moved. */ -#if defined (__STDC__) && __STDC__ +#if defined __STDC__ && __STDC__ static void exchange (char **); #endif @@ -252,6 +318,28 @@ exchange (argv) It leaves the longer segment in the right place overall, but it consists of two parts that need to be swapped next. */ +#ifdef _LIBC + /* First make sure the handling of the `__getopt_nonoption_flags' + string can work normally. Our top argument must be in the range + of the string. */ + if (nonoption_flags_len > 0 && top >= nonoption_flags_max_len) + { + /* We must extend the array. The user plays games with us and + presents new arguments. */ + char *new_str = malloc (top + 1); + if (new_str == NULL) + nonoption_flags_len = nonoption_flags_max_len = 0; + else + { + memset (__mempcpy (new_str, __getopt_nonoption_flags, + nonoption_flags_max_len), + '\0', top + 1 - nonoption_flags_max_len); + nonoption_flags_max_len = top + 1; + __getopt_nonoption_flags = new_str; + } + } +#endif + while (top > middle && middle > bottom) { if (top - middle > middle - bottom) @@ -266,6 +354,7 @@ exchange (argv) tem = argv[bottom + i]; argv[bottom + i] = argv[top - (middle - bottom) + i]; argv[top - (middle - bottom) + i] = tem; + SWAP_FLAGS (bottom + i, top - (middle - bottom) + i); } /* Exclude the moved bottom segment from further swapping. */ top -= len; @@ -282,6 +371,7 @@ exchange (argv) tem = argv[bottom + i]; argv[bottom + i] = argv[middle + i]; argv[middle + i] = tem; + SWAP_FLAGS (bottom + i, middle + i); } /* Exclude the moved top segment from further swapping. */ bottom += len; @@ -296,18 +386,20 @@ exchange (argv) /* Initialize the internal data when the first call is made. */ -#if defined (__STDC__) && __STDC__ -static const char *_getopt_initialize (const char *); +#if defined __STDC__ && __STDC__ +static const char *_getopt_initialize (int, char *const *, const char *); #endif static const char * -_getopt_initialize (optstring) +_getopt_initialize (argc, argv, optstring) + int argc; + char *const *argv; const char *optstring; { /* Start processing options with ARGV-element 1 (since ARGV-element 0 is the program name); the sequence of previously skipped non-option ARGV-elements is empty. */ - first_nonopt = last_nonopt = optind = 1; + first_nonopt = last_nonopt = optind; nextchar = NULL; @@ -330,20 +422,35 @@ _getopt_initialize (optstring) else ordering = PERMUTE; - if (posixly_correct == NULL) +#ifdef _LIBC + if (posixly_correct == NULL + && argc == original_argc && argv == original_argv) { - /* Bash 2.0 puts a special variable in the environment for each - command it runs, specifying which ARGV elements are the results of - file name wildcard expansion and therefore should not be - considered as options. */ - char var[100]; - sprintf (var, "_%d_GNU_nonoption_argv_flags_", getpid ()); - nonoption_flags = getenv (var); - if (nonoption_flags == NULL) - nonoption_flags_len = 0; - else - nonoption_flags_len = strlen (nonoption_flags); + if (nonoption_flags_max_len == 0) + { + if (__getopt_nonoption_flags == NULL + || __getopt_nonoption_flags[0] == '\0') + nonoption_flags_max_len = -1; + else + { + const char *orig_str = __getopt_nonoption_flags; + int len = nonoption_flags_max_len = strlen (orig_str); + if (nonoption_flags_max_len < argc) + nonoption_flags_max_len = argc; + __getopt_nonoption_flags = + (char *) malloc (nonoption_flags_max_len); + if (__getopt_nonoption_flags == NULL) + nonoption_flags_max_len = -1; + else + memset (__mempcpy (__getopt_nonoption_flags, orig_str, len), + '\0', nonoption_flags_max_len - len); + } + } + nonoption_flags_len = nonoption_flags_max_len; } + else + nonoption_flags_len = 0; +#endif return optstring; } @@ -361,7 +468,7 @@ _getopt_initialize (optstring) updating `optind' and `nextchar' so that the next call to `getopt' can resume the scan with the following option character or ARGV-element. - If there are no more option characters, `getopt' returns `EOF'. + If there are no more option characters, `getopt' returns -1. Then `optind' is the index in ARGV of the first ARGV-element that is not an option. (The ARGV-elements have been permuted so that those that are not options now come last.) @@ -415,18 +522,25 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only) { optarg = NULL; - if (optind == 0) + if (optind == 0 || !__getopt_initialized) { - optstring = _getopt_initialize (optstring); - optind = 1; /* Don't scan ARGV[0], the program name. */ + if (optind == 0) + optind = 1; /* Don't scan ARGV[0], the program name. */ + optstring = _getopt_initialize (argc, argv, optstring); + __getopt_initialized = 1; } /* Test whether ARGV[optind] points to a non-option argument. Either it does not have option syntax, or there is an environment flag - from the shell indicating it is not an option. */ -#define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \ - || (optind < nonoption_flags_len \ - && nonoption_flags[optind] == '1')) + from the shell indicating it is not an option. The later information + is only used when the used in the GNU libc. */ +#ifdef _LIBC +# define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \ + || (optind < nonoption_flags_len \ + && __getopt_nonoption_flags[optind] == '1')) +#else +# define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0') +#endif if (nextchar == NULL || *nextchar == '\0') { @@ -484,7 +598,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only) that we previously skipped, so the caller will digest them. */ if (first_nonopt != last_nonopt) optind = first_nonopt; - return EOF; + return -1; } /* If we have come to a non-option and did not permute it, @@ -493,7 +607,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only) if (NONOPTION_P) { if (ordering == REQUIRE_ORDER) - return EOF; + return -1; optarg = argv[optind++]; return 1; } @@ -529,7 +643,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only) const struct option *pfound = NULL; int exact = 0; int ambig = 0; - int indfound; + int indfound = -1; int option_index; for (nameend = nextchar; *nameend && *nameend != '='; nameend++) @@ -540,7 +654,8 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only) for (p = longopts, option_index = 0; p->name; p++, option_index++) if (!strncmp (p->name, nextchar, nameend - nextchar)) { - if (nameend - nextchar == strlen (p->name)) + if ((unsigned int) (nameend - nextchar) + == (unsigned int) strlen (p->name)) { /* Exact match found. */ pfound = p; @@ -676,6 +791,130 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only) optopt = c; return '?'; } + /* Convenience. Treat POSIX -W foo same as long option --foo */ + if (temp[0] == 'W' && temp[1] == ';') + { + char *nameend; + const struct option *p; + const struct option *pfound = NULL; + int exact = 0; + int ambig = 0; + int indfound = 0; + int option_index; + + /* This is an option that requires an argument. */ + if (*nextchar != '\0') + { + optarg = nextchar; + /* If we end this ARGV-element by taking the rest as an arg, + we must advance to the next element now. */ + optind++; + } + else if (optind == argc) + { + if (opterr) + { + /* 1003.2 specifies the format of this message. */ + fprintf (stderr, _("%s: option requires an argument -- %c\n"), + argv[0], c); + } + optopt = c; + if (optstring[0] == ':') + c = ':'; + else + c = '?'; + return c; + } + else + /* We already incremented `optind' once; + increment it again when taking next ARGV-elt as argument. */ + optarg = argv[optind++]; + + /* optarg is now the argument, see if it's in the + table of longopts. */ + + for (nextchar = nameend = optarg; *nameend && *nameend != '='; nameend++) + /* Do nothing. */ ; + + /* Test all long options for either exact match + or abbreviated matches. */ + for (p = longopts, option_index = 0; p->name; p++, option_index++) + if (!strncmp (p->name, nextchar, nameend - nextchar)) + { + if ((unsigned int) (nameend - nextchar) == strlen (p->name)) + { + /* Exact match found. */ + pfound = p; + indfound = option_index; + exact = 1; + break; + } + else if (pfound == NULL) + { + /* First nonexact match found. */ + pfound = p; + indfound = option_index; + } + else + /* Second or later nonexact match found. */ + ambig = 1; + } + if (ambig && !exact) + { + if (opterr) + fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"), + argv[0], argv[optind]); + nextchar += strlen (nextchar); + optind++; + return '?'; + } + if (pfound != NULL) + { + option_index = indfound; + if (*nameend) + { + /* Don't test has_arg with >, because some C compilers don't + allow it to be used on enums. */ + if (pfound->has_arg) + optarg = nameend + 1; + else + { + if (opterr) + fprintf (stderr, _("\ +%s: option `-W %s' doesn't allow an argument\n"), + argv[0], pfound->name); + + nextchar += strlen (nextchar); + return '?'; + } + } + else if (pfound->has_arg == 1) + { + if (optind < argc) + optarg = argv[optind++]; + else + { + if (opterr) + fprintf (stderr, + _("%s: option `%s' requires an argument\n"), + argv[0], argv[optind - 1]); + nextchar += strlen (nextchar); + return optstring[0] == ':' ? ':' : '?'; + } + } + nextchar += strlen (nextchar); + if (longind != NULL) + *longind = option_index; + if (pfound->flag) + { + *(pfound->flag) = pfound->val; + return 0; + } + return pfound->val; + } + nextchar = NULL; + return 'W'; /* Let the application handle it. */ + } if (temp[1] == ':') { if (temp[2] == ':') @@ -738,7 +977,7 @@ getopt (argc, argv, optstring) 0); } -#endif /* _LIBC or not __GNU_LIBRARY__. */ +#endif /* Not ELIDE_CODE. */ #ifdef TEST @@ -758,7 +997,7 @@ main (argc, argv) int this_option_optind = optind ? optind : 1; c = getopt (argc, argv, "abc:d:0123456789"); - if (c == EOF) + if (c == -1) break; switch (c) diff --git a/contrib/bison/getopt.h b/contrib/bison/getopt.h index 0de18814f789..fb30719a8602 100644 --- a/contrib/bison/getopt.h +++ b/contrib/bison/getopt.h @@ -1,5 +1,8 @@ /* Declarations for getopt. - Copyright (C) 1989, 90, 91, 92, 93, 94 Free Software Foundation, Inc. + Copyright (C) 1989,90,91,92,93,94,96,97 Free Software Foundation, Inc. + + NOTE: The canonical source of this file is maintained with the GNU C Library. + Bugs can be reported to bug-glibc@gnu.org. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the @@ -37,7 +40,7 @@ extern char *optarg; On entry to `getopt', zero means this is the first call; initialize. - When `getopt' returns EOF, this is the index of the first of the + When `getopt' returns -1, this is the index of the first of the non-option elements that the caller should itself scan. Otherwise, `optind' communicates from one call to the next @@ -127,4 +130,4 @@ extern int _getopt_internal (); } #endif -#endif /* _GETOPT_H */ +#endif /* getopt.h */ diff --git a/contrib/bison/getopt1.c b/contrib/bison/getopt1.c index 9d394e683938..ff257374c335 100644 --- a/contrib/bison/getopt1.c +++ b/contrib/bison/getopt1.c @@ -1,6 +1,9 @@ /* getopt_long and getopt_long_only entry points for GNU getopt. - Copyright (C) 1987, 88, 89, 90, 91, 92, 1993, 1994 - Free Software Foundation, Inc. + Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98 + Free Software Foundation, Inc. + + NOTE: The canonical source of this file is maintained with the GNU C Library. + Bugs can be reported to bug-glibc@gnu.org. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the @@ -23,7 +26,7 @@ #include "getopt.h" -#if !defined (__STDC__) || !__STDC__ +#if !defined __STDC__ || !__STDC__ /* This is a separate conditional since some stdc systems reject `defined (const)'. */ #ifndef const @@ -41,15 +44,21 @@ program understand `configure --with-gnu-libc' and omit the object files, it is simpler to just do this in the source for each such file. */ -#if defined (_LIBC) || !defined (__GNU_LIBRARY__) +#define GETOPT_INTERFACE_VERSION 2 +#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2 +#include +#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION +#define ELIDE_CODE +#endif +#endif + +#ifndef ELIDE_CODE /* This needs to come after some library #include to get __GNU_LIBRARY__ defined. */ #ifdef __GNU_LIBRARY__ #include -#else -char *getenv (); #endif #ifndef NULL @@ -84,7 +93,7 @@ getopt_long_only (argc, argv, options, long_options, opt_index) } -#endif /* _LIBC or not __GNU_LIBRARY__. */ +#endif /* Not ELIDE_CODE. */ #ifdef TEST @@ -115,7 +124,7 @@ main (argc, argv) c = getopt_long (argc, argv, "abc:d:0123456789", long_options, &option_index); - if (c == EOF) + if (c == -1) break; switch (c) diff --git a/contrib/bison/gram.c b/contrib/bison/gram.c index cc1418d9db6d..bf62d74ec53c 100644 --- a/contrib/bison/gram.c +++ b/contrib/bison/gram.c @@ -15,7 +15,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bison; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ /* comments for these variables are in gram.h */ @@ -53,6 +54,6 @@ int error_token_number; when the file in question contains data definitions only. */ void -dummy() +dummy (void) { } diff --git a/contrib/bison/gram.h b/contrib/bison/gram.h index 080ce0d9fe4c..a83dd36feff0 100644 --- a/contrib/bison/gram.h +++ b/contrib/bison/gram.h @@ -15,7 +15,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bison; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ /* representation of the grammar rules: diff --git a/contrib/bison/install-sh b/contrib/bison/install-sh index 58719246f040..e9de23842dcd 100755 --- a/contrib/bison/install-sh +++ b/contrib/bison/install-sh @@ -1,15 +1,27 @@ -#! /bin/sh +#!/bin/sh # # install - install a program, script, or datafile -# This comes from X11R5. +# This comes from X11R5 (mit/util/scripts/install.sh). +# +# Copyright 1991 by the Massachusetts Institute of Technology +# +# Permission to use, copy, modify, distribute, and sell this software and its +# documentation for any purpose is hereby granted without fee, provided that +# the above copyright notice appear in all copies and that both that +# copyright notice and this permission notice appear in supporting +# documentation, and that the name of M.I.T. not be used in advertising or +# publicity pertaining to distribution of the software without specific, +# written prior permission. M.I.T. makes no representations about the +# suitability of this software for any purpose. It is provided "as is" +# without express or implied warranty. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written -# from scratch. -# +# from scratch. It can only install one file at a time, a restriction +# shared with many OS's install programs. # set DOITPROG to echo to test this script @@ -106,6 +118,7 @@ if [ x"$dir_arg" != x ]; then if [ -d $dst ]; then instcmd=: + chmodcmd="" else instcmd=mkdir fi diff --git a/contrib/bison/lalr.c b/contrib/bison/lalr.c index 32a5f29dd5cb..117f2b9fa9d1 100644 --- a/contrib/bison/lalr.c +++ b/contrib/bison/lalr.c @@ -15,7 +15,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bison; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ /* Compute how to make the finite state machine deterministic; @@ -52,7 +53,7 @@ If LA[l, i] and LA[l, j] are both 1 for i != j, it is a conflict. #include "machine.h" #include "types.h" #include "state.h" -#include "new.h" +#include "alloc.h" #include "gram.h" @@ -73,24 +74,26 @@ short *goto_map; short *from_state; short *to_state; -short **transpose(); -void set_state_table(); -void set_accessing_symbol(); -void set_shift_table(); -void set_reduction_table(); -void set_maxrhs(); -void initialize_LA(); -void set_goto_map(); -void initialize_F(); -void build_relations(); -void add_lookback_edge(); -void compute_FOLLOWS(); -void compute_lookaheads(); -void digraph(); -void traverse(); +void lalr PARAMS((void)); +short **transpose PARAMS((short **, int)); +void set_state_table PARAMS((void)); +void set_accessing_symbol PARAMS((void)); +void set_shift_table PARAMS((void)); +void set_reduction_table PARAMS((void)); +void set_maxrhs PARAMS((void)); +void initialize_LA PARAMS((void)); +void set_goto_map PARAMS((void)); +int map_goto PARAMS((int, int)); +void initialize_F PARAMS((void)); +void build_relations PARAMS((void)); +void add_lookback_edge PARAMS((int, int, int)); +void compute_FOLLOWS PARAMS((void)); +void compute_lookaheads PARAMS((void)); +void digraph PARAMS((short **)); +void traverse PARAMS((register int)); -extern void toomany(); -extern void berror(); +extern void toomany PARAMS((char *)); +extern void berror PARAMS((char *)); static int infinity; static int maxrhs; @@ -105,7 +108,7 @@ static int top; void -lalr() +lalr (void) { tokensetsize = WORDSIZE(ntokens); @@ -124,7 +127,7 @@ lalr() void -set_state_table() +set_state_table (void) { register core *sp; @@ -136,7 +139,7 @@ set_state_table() void -set_accessing_symbol() +set_accessing_symbol (void) { register core *sp; @@ -148,7 +151,7 @@ set_accessing_symbol() void -set_shift_table() +set_shift_table (void) { register shifts *sp; @@ -160,7 +163,7 @@ set_shift_table() void -set_reduction_table() +set_reduction_table (void) { register reductions *rp; @@ -172,7 +175,7 @@ set_reduction_table() void -set_maxrhs() +set_maxrhs (void) { register short *itemp; register int length; @@ -198,7 +201,7 @@ set_maxrhs() void -initialize_LA() +initialize_LA (void) { register int i; register int j; @@ -256,7 +259,7 @@ initialize_LA() { if (!consistent[i]) { - if (rp = reduction_table[i]) + if ((rp = reduction_table[i])) for (j = 0; j < rp->nreds; j++) *np++ = rp->rules[j]; } @@ -265,7 +268,7 @@ initialize_LA() void -set_goto_map() +set_goto_map (void) { register shifts *sp; register int i; @@ -288,7 +291,7 @@ set_goto_map() if (ISTOKEN(symbol)) break; if (ngotos == MAXSHORT) - toomany("gotos"); + toomany(_("gotos")); ngotos++; goto_map[symbol]++; @@ -335,9 +338,7 @@ set_goto_map() /* Map_goto maps a state/symbol pair into its numeric representation. */ int -map_goto(state, symbol) -int state; -int symbol; +map_goto (int state, int symbol) { register int high; register int low; @@ -366,7 +367,7 @@ int symbol; void -initialize_F() +initialize_F (void) { register int i; register int j; @@ -442,7 +443,7 @@ initialize_F() void -build_relations() +build_relations (void) { register int i; register int j; @@ -537,10 +538,7 @@ build_relations() void -add_lookback_edge(stateno, ruleno, gotono) -int stateno; -int ruleno; -int gotono; +add_lookback_edge (int stateno, int ruleno, int gotono) { register int i; register int k; @@ -570,9 +568,7 @@ int gotono; short ** -transpose(R_arg, n) -short **R_arg; -int n; +transpose (short **R_arg, int n) { register short **new_R; register short **temp_R; @@ -627,7 +623,7 @@ int n; void -compute_FOLLOWS() +compute_FOLLOWS (void) { register int i; @@ -643,7 +639,7 @@ compute_FOLLOWS() void -compute_lookaheads() +compute_lookaheads (void) { register int i; register int n; @@ -686,8 +682,7 @@ compute_lookaheads() void -digraph(relation) -short **relation; +digraph (short **relation) { register int i; @@ -713,8 +708,7 @@ short **relation; void -traverse(i) -register int i; +traverse (register int i) { register unsigned *fp1; register unsigned *fp2; diff --git a/contrib/bison/lex.c b/contrib/bison/lex.c index 7ae1387e4d5c..3a51c9741e84 100644 --- a/contrib/bison/lex.c +++ b/contrib/bison/lex.c @@ -15,10 +15,11 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bison; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ -/* +/* lex is the entry point. It is called from reader.c. It returns one of the token-type codes defined in lex.h. When an identifier is seen, the code IDENTIFIER is returned @@ -26,13 +27,12 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ symval is set to a pointer to the entry found. */ #include -#include #include "system.h" #include "files.h" #include "getopt.h" /* for optarg */ #include "symtab.h" #include "lex.h" -#include "new.h" +#include "alloc.h" /* flags set by % directives */ extern int definesflag; /* for -d */ @@ -50,19 +50,27 @@ extern char *spec_file_prefix; /* for -b */ extern int lineno; extern int translations; -int parse_percent_token(); +void init_lex PARAMS((void)); +char *grow_token_buffer PARAMS((char *)); +int skip_white_space PARAMS((void)); +int safegetc PARAMS((FILE *)); +int literalchar PARAMS((char **, int *, char)); +void unlex PARAMS((int)); +int lex PARAMS((void)); +int parse_percent_token PARAMS((void)); /* functions from main.c */ -extern char *printable_version(); -extern void fatal(); -extern void warni(); -extern void warn(); +extern char *printable_version PARAMS((int)); +extern void fatal PARAMS((char *)); +extern void warn PARAMS((char *)); +extern void warni PARAMS((char *, int)); +extern void warns PARAMS((char *, char *)); /* Buffer for storing the current token. */ char *token_buffer; /* Allocated size of token_buffer, not including space for terminator. */ -static int maxtoken; +int maxtoken; bucket *symval; int numval; @@ -72,7 +80,7 @@ static bucket *unlexed_symval; /* by the next call to lex */ void -init_lex() +init_lex (void) { maxtoken = 100; token_buffer = NEW2 (maxtoken + 1, char); @@ -80,9 +88,8 @@ init_lex() } -static char * -grow_token_buffer (p) - char *p; +char * +grow_token_buffer (char *p) { int offset = p - token_buffer; maxtoken *= 2; @@ -92,7 +99,7 @@ grow_token_buffer (p) int -skip_white_space() +skip_white_space (void) { register int c; register int inside; @@ -107,9 +114,9 @@ skip_white_space() { case '/': c = getc(finput); - if (c != '*' && c != '/') + if (c != '*' && c != '/') { - warn("unexpected `/' found and ignored"); + warn(_("unexpected `/' found and ignored")); break; } cplus_comment = (c == '/'); @@ -138,7 +145,7 @@ skip_white_space() c = getc(finput); } else if (c == EOF) - fatal("unterminated comment"); + fatal(_("unterminated comment")); else c = getc(finput); } @@ -162,12 +169,11 @@ skip_white_space() /* do a getc, but give error message if EOF encountered */ int -safegetc(f) - FILE *f; +safegetc (FILE *f) { register int c = getc(f); if (c == EOF) - fatal("Unexpected end of file"); + fatal(_("Unexpected end of file")); return c; } @@ -178,10 +184,7 @@ safegetc(f) report error for \n */ int -literalchar(pp, pcode, term) - char **pp; - int *pcode; - char term; +literalchar (char **pp, int *pcode, char term) { register int c; register char *p; @@ -189,9 +192,9 @@ literalchar(pp, pcode, term) int wasquote = 0; c = safegetc(finput); - if (c == '\n') + if (c == '\n') { - warn("unescaped newline in constant"); + warn(_("unescaped newline in constant")); ungetc(c, finput); code = '?'; wasquote = 1; @@ -199,7 +202,7 @@ literalchar(pp, pcode, term) else if (c != '\\') { code = c; - if (c == term) + if (c == term) wasquote = 1; } else @@ -211,7 +214,7 @@ literalchar(pp, pcode, term) else if (c == 'r') code = '\r'; else if (c == 'f') code = '\f'; else if (c == 'b') code = '\b'; - else if (c == 'v') code = 013; + else if (c == 'v') code = '\013'; else if (c == '\\') code = '\\'; else if (c == '\'') code = '\''; else if (c == '\"') code = '\"'; @@ -223,7 +226,7 @@ literalchar(pp, pcode, term) code = (code * 8) + (c - '0'); if (code >= 256 || code < 0) { - warni("octal value outside range 0...255: `\\%o'", code); + warni(_("octal value outside range 0...255: `\\%o'"), code); code &= 0xFF; break; } @@ -243,11 +246,11 @@ literalchar(pp, pcode, term) code *= 16, code += c - 'a' + 10; else if (c >= 'A' && c <= 'F') code *= 16, code += c - 'A' + 10; - else + else break; if (code >= 256 || code<0) { - warni("hexadecimal value above 255: `\\x%x'", code); + warni(_("hexadecimal value above 255: `\\x%x'"), code); code &= 0xFF; break; } @@ -257,7 +260,7 @@ literalchar(pp, pcode, term) } else { - warni ("unknown escape sequence: `\\' followed by `%s'", + warns (_("unknown escape sequence: `\\' followed by `%s'"), printable_version(c)); code = '?'; } @@ -268,11 +271,13 @@ literalchar(pp, pcode, term) so that `\012' and `\n' can be interchangeable. */ p = *pp; - if (code >= 040 && code < 0177) + if (code == term && wasquote) *p++ = code; else if (code == '\\') {*p++ = '\\'; *p++ = '\\';} else if (code == '\'') {*p++ = '\\'; *p++ = '\'';} else if (code == '\"') {*p++ = '\\'; *p++ = '\"';} + else if (code >= 040 && code < 0177) + *p++ = code; else if (code == '\t') {*p++ = '\\'; *p++ = 't';} else if (code == '\n') {*p++ = '\\'; *p++ = 'n';} else if (code == '\r') {*p++ = '\\'; *p++ = 'r';} @@ -293,8 +298,7 @@ literalchar(pp, pcode, term) void -unlex(token) - int token; +unlex (int token) { unlexed = token; unlexed_symval = symval; @@ -302,7 +306,7 @@ unlex(token) int -lex() +lex (void) { register int c; char *p; @@ -381,6 +385,7 @@ lex() { int code, discode; char discard[10], *dp; + p = token_buffer; *p++ = '\''; literalchar(&p, &code, '\''); @@ -388,9 +393,13 @@ lex() c = getc(finput); if (c != '\'') { - warn("use \"...\" for multi-character literal tokens"); - dp = discard; - while (literalchar(&dp, &discode, '\'')) {} + warn(_("use \"...\" for multi-character literal tokens")); + while (1) + { + dp = discard; + if (! literalchar(&dp, &discode, '\'')) + break; + } } *p++ = '\''; *p = 0; @@ -463,10 +472,10 @@ lex() while (c != '>') { if (c == EOF) - fatal("unterminated type name at end of file"); - if (c == '\n') + fatal(_("unterminated type name at end of file")); + if (c == '\n') { - warn("unterminated type name"); + warn(_("unterminated type name")); ungetc(c, finput); break; } @@ -479,7 +488,7 @@ lex() } *p = 0; return (TYPENAME); - + case '%': return (parse_percent_token()); @@ -489,13 +498,13 @@ lex() } } -/* the following table dictates the action taken for the various +/* the following table dictates the action taken for the various % directives. A setflag value causes the named flag to be set. A retval action returns the code. */ struct percent_table_struct { char *name; - void *setflag; + void *setflag; int retval; } percent_table[] = { @@ -537,8 +546,8 @@ struct percent_table_struct { /* These would be acceptable, but they do not affect processing */ {"verbose", &verboseflag, NOOP}, /* -v */ {"debug", &debugflag, NOOP}, /* -t */ - /* {"help", , NOOP}, /* -h */ - /* {"version", , NOOP}, /* -V */ + /* {"help", , NOOP},*/ /* -h */ + /* {"version", , NOOP},*/ /* -V */ #endif {NULL, NULL, ILLEGAL} @@ -548,7 +557,7 @@ struct percent_table_struct { Assumes the % has already been read and discarded. */ int -parse_percent_token () +parse_percent_token (void) { register int c; register char *p; @@ -583,7 +592,7 @@ parse_percent_token () case '=': return (PREC); } - if (!isalpha(c)) + if (!isalpha(c)) return (ILLEGAL); p = token_buffer; diff --git a/contrib/bison/lex.h b/contrib/bison/lex.h index 6cbaebcbb4a6..997949254f4e 100644 --- a/contrib/bison/lex.h +++ b/contrib/bison/lex.h @@ -15,7 +15,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bison; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ #define ENDFILE 0 diff --git a/contrib/bison/machine.h b/contrib/bison/machine.h index 6c05691f793d..738c0d209aeb 100644 --- a/contrib/bison/machine.h +++ b/contrib/bison/machine.h @@ -15,7 +15,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bison; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ #ifdef eta10 #define MAXSHORT 2147483647 diff --git a/contrib/bison/main.c b/contrib/bison/main.c index e27e1a547544..88b0dd3bf188 100644 --- a/contrib/bison/main.c +++ b/contrib/bison/main.c @@ -15,7 +15,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bison; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ #include @@ -24,6 +25,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ extern int lineno; extern int verboseflag; +extern char *infile; /* Nonzero means failure has been detected; don't write a parser file. */ int failure; @@ -31,20 +33,43 @@ int failure; /* The name this program was run with, for messages. */ char *program_name; -extern void getargs(), openfiles(), reader(), reduce_grammar(); -extern void set_derives(), set_nullable(), generate_states(); -extern void lalr(), initialize_conflicts(), verbose(), terse(); -extern void output(), done(); +char *printable_version PARAMS((int)); +char *int_to_string PARAMS((int)); +void fatal PARAMS((char *)); +void fatals PARAMS((char *, char *)); +void warn PARAMS((char *)); +void warni PARAMS((char *, int)); +void warns PARAMS((char *, char *)); +void warnss PARAMS((char *, char *, char *)); +void warnsss PARAMS((char *, char *, char *, char *)); +void toomany PARAMS((char *)); +void berror PARAMS((char *)); + +extern void getargs PARAMS((int, char *[])); +extern void openfiles PARAMS((void)); +extern void reader PARAMS((void)); +extern void reduce_grammar PARAMS((void)); +extern void set_derives PARAMS((void)); +extern void set_nullable PARAMS((void)); +extern void generate_states PARAMS((void)); +extern void lalr PARAMS((void)); +extern void initialize_conflicts PARAMS((void)); +extern void verbose PARAMS((void)); +extern void terse PARAMS((void)); +extern void output PARAMS((void)); +extern void done PARAMS((int)); /* VMS complained about using `int'. */ int -main(argc, argv) - int argc; - char *argv[]; +main (int argc, char *argv[]) { program_name = argv[0]; + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); + failure = 0; lineno = 0; getargs(argc, argv); @@ -86,6 +111,7 @@ main(argc, argv) /* output the tables and the parser to ftable. In file output. */ output(); done(failure); + return failure; } /* functions to report errors which prevent a parser from being generated */ @@ -95,8 +121,7 @@ main(argc, argv) either C itself, or the corresponding \DDD code. */ char * -printable_version(c) - char c; +printable_version (int c) { static char buf[10]; if (c < ' ' || c >= '\177') @@ -113,27 +138,31 @@ printable_version(c) Return a ptr to internal memory containing the string. */ char * -int_to_string(i) - int i; +int_to_string (int i) { static char buf[20]; sprintf(buf, "%d", i); return buf; } +static void +fatal_banner (void) +{ + if (infile == 0) + fprintf(stderr, _("%s: fatal error: "), program_name); + else + fprintf(stderr, _("%s:%d: fatal error: "), infile, lineno); +} + /* Print the message S for a fatal error. */ void -fatal(s) - char *s; +fatal (char *s) { - extern char *infile; - - if (infile == 0) - fprintf(stderr, "fatal error: %s\n", s); - else - fprintf(stderr, "\"%s\", line %d: %s\n", infile, lineno, s); - done(1); + fatal_banner (); + fputs (s, stderr); + fputc ('\n', stderr); + done (1); } @@ -141,98 +170,95 @@ fatal(s) and incorporate string X1. */ void -fatals(fmt, x1) - char *fmt, *x1; +fatals (char *fmt, char *x1) { - char buffer[200]; - sprintf(buffer, fmt, x1); - fatal(buffer); + fatal_banner (); + fprintf (stderr, fmt, x1); + fputc ('\n', stderr); + done (1); +} + +static void +warn_banner (void) +{ + if (infile == 0) + fprintf(stderr, _("%s: "), program_name); + else + fprintf(stderr, _("%s:%d: "), infile, lineno); + failure = 1; } /* Print a warning message S. */ void -warn(s) - char *s; +warn (char *s) { - extern char *infile; - - if (infile == 0) - fprintf(stderr, "error: %s\n", s); - else - fprintf(stderr, "(\"%s\", line %d) error: %s\n", - infile, lineno, s); - - failure = 1; + warn_banner (); + fputs (s, stderr); + fputc ('\n', stderr); } /* Print a warning message containing the string for the integer X1. The message is given by the format FMT. */ void -warni(fmt, x1) - char *fmt; - int x1; +warni (char *fmt, int x1) { - char buffer[200]; - sprintf(buffer, fmt, x1); - warn(buffer); + warn_banner (); + fprintf (stderr, fmt, x1); + fputc ('\n', stderr); } /* Print a warning message containing the string X1. The message is given by the format FMT. */ void -warns(fmt, x1) - char *fmt, *x1; +warns (char *fmt, char *x1) { - char buffer[200]; - sprintf(buffer, fmt, x1); - warn(buffer); + warn_banner (); + fprintf (stderr, fmt, x1); + fputc ('\n', stderr); } /* Print a warning message containing the two strings X1 and X2. The message is given by the format FMT. */ void -warnss(fmt, x1, x2) - char *fmt, *x1, *x2; +warnss (char *fmt, char *x1, char *x2) { - char buffer[200]; - sprintf(buffer, fmt, x1, x2); - warn(buffer); + warn_banner (); + fprintf (stderr, fmt, x1, x2); + fputc ('\n', stderr); } /* Print a warning message containing the 3 strings X1, X2, X3. The message is given by the format FMT. */ void -warnsss(fmt, x1, x2, x3) - char *fmt, *x1, *x2, *x3; +warnsss (char *fmt, char *x1, char *x2, char *x3) { - char buffer[200]; - sprintf(buffer, fmt, x1, x2, x3); - warn(buffer); + warn_banner (); + fprintf (stderr, fmt, x1, x2, x3); + fputc ('\n', stderr); } /* Print a message for the fatal occurence of more than MAXSHORT instances of whatever is denoted by the string S. */ void -toomany(s) - char *s; +toomany (char *s) { - char buffer[200]; - sprintf(buffer, "limit of %d exceeded, too many %s", MAXSHORT, s); - fatal(buffer); + fatal_banner (); + fprintf (stderr, _("too many %s (max %d)"), s, MAXSHORT); + fputc ('\n', stderr); + done (1); } /* Abort for an internal error denoted by string S. */ void -berror(s) - char *s; +berror (char *s) { - fprintf(stderr, "internal error, %s\n", s); + fprintf(stderr, _("%s: internal error: %s\n"), program_name, s); abort(); } diff --git a/contrib/bison/mkinstalldirs b/contrib/bison/mkinstalldirs index a01481be4367..b7f218d27d28 100755 --- a/contrib/bison/mkinstalldirs +++ b/contrib/bison/mkinstalldirs @@ -4,9 +4,29 @@ # Created: 1993-05-16 # Public domain -# $Id: mkinstalldirs,v 1.10 1996/05/03 07:37:52 friedman Exp $ +# $Id: mkinstalldirs,v 1.2 1999/04/11 00:23:56 bje Exp $ errstatus=0 +dirmode="" + +usage="\ +Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..." + +# process command line arguments +while test $# -gt 0 ; do + case "${1}" in + -h | --help | --h* ) # -h for help + echo "${usage}" 1>&2; exit 0 ;; + -m ) # -m PERM arg + shift + test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; } + dirmode="${1}" + shift ;; + -- ) shift; break ;; # stop option processing + -* ) echo "${usage}" 1>&2; exit 1 ;; # unknown option + * ) break ;; # first non-opt arg + esac +done for file do @@ -22,12 +42,23 @@ do esac if test ! -d "$pathcomp"; then - echo "mkdir $pathcomp" 1>&2 + echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr + else + if test ! -z "$dirmode"; then + echo "chmod $dirmode $pathcomp" + + lasterr="" + chmod $dirmode "$pathcomp" || lasterr=$? + + if test ! -z "$lasterr"; then + errstatus=$lasterr + fi + fi fi fi @@ -37,4 +68,7 @@ done exit $errstatus -# mkinstalldirs ends here +# Local Variables: +# mode:shell-script +# sh-indentation:3 +# End: diff --git a/contrib/bison/nullable.c b/contrib/bison/nullable.c index b85dec610d51..de4551a898ec 100644 --- a/contrib/bison/nullable.c +++ b/contrib/bison/nullable.c @@ -15,7 +15,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bison; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ /* set up nullable, a vector saying which nonterminals can expand into the null string. @@ -25,14 +26,16 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "system.h" #include "types.h" #include "gram.h" -#include "new.h" +#include "alloc.h" char *nullable; +void free_nullable PARAMS((void)); +void set_nullable PARAMS((void)); void -set_nullable() +set_nullable (void) { register short *r; register short *s1; @@ -49,7 +52,7 @@ set_nullable() short *r1; #ifdef TRACE - fprintf(stderr, "Entering set_nullable"); + fprintf(stderr, _("Entering set_nullable")); #endif nullable = NEW2(nvars, char) - ntokens; @@ -130,7 +133,7 @@ set_nullable() void -free_nullable() +free_nullable (void) { FREE(nullable + ntokens); } diff --git a/contrib/bison/output.c b/contrib/bison/output.c index 8b2d314f6bf3..84581843d546 100644 --- a/contrib/bison/output.c +++ b/contrib/bison/output.c @@ -15,7 +15,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bison; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ /* functions to output parsing data to various files. Entries are: @@ -105,7 +106,7 @@ YYNTBASE = ntokens. #include #include "system.h" #include "machine.h" -#include "new.h" +#include "alloc.h" #include "files.h" #include "gram.h" #include "state.h" @@ -132,37 +133,40 @@ extern char *consistent; extern short *goto_map; extern short *from_state; extern short *to_state; +extern int lineno; -void output_token_translations(); -void output_gram(); -void output_stos(); -void output_rule_data(); -void output_defines(); -void output_actions(); -void token_actions(); -void save_row(); -void goto_actions(); -void save_column(); -void sort_actions(); -void pack_table(); -void output_base(); -void output_table(); -void output_check(); -void output_parser(); -void output_program(); -void free_itemset(); -void free_shifts(); -void free_reductions(); -void free_itemsets(); -int action_row(); -int default_goto(); -int matching_state(); -int pack_vector(); +void output_headers PARAMS((void)); +void output_trailers PARAMS((void)); +void output PARAMS((void)); +void output_token_translations PARAMS((void)); +void output_gram PARAMS((void)); +void output_stos PARAMS((void)); +void output_rule_data PARAMS((void)); +void output_defines PARAMS((void)); +void output_actions PARAMS((void)); +void token_actions PARAMS((void)); +void save_row PARAMS((int)); +void goto_actions PARAMS((void)); +void save_column PARAMS((int, int)); +void sort_actions PARAMS((void)); +void pack_table PARAMS((void)); +void output_base PARAMS((void)); +void output_table PARAMS((void)); +void output_check PARAMS((void)); +void output_parser PARAMS((void)); +void output_program PARAMS((void)); +void free_shifts PARAMS((void)); +void free_reductions PARAMS((void)); +void free_itemsets PARAMS((void)); +int action_row PARAMS((int)); +int default_goto PARAMS((int)); +int matching_state PARAMS((int)); +int pack_vector PARAMS((int)); -extern void berror(); -extern void fatals(); -extern char *int_to_string(); -extern void reader_output_yylsp(); +extern void berror PARAMS((char *)); +extern void fatals PARAMS((char *, char *)); +extern char *int_to_string PARAMS((int)); +extern void reader_output_yylsp PARAMS((FILE *)); static int nvectors; static int nentries; @@ -197,7 +201,7 @@ register YYLTYPE *yylsp;\n{\n switch (n)\n{" void -output_headers() +output_headers (void) { if (semantic_parser) fprintf(fguard, GUARDSTR, attrsfile); @@ -226,7 +230,7 @@ output_headers() void -output_trailers() +output_trailers (void) { if (semantic_parser) fprintf(fguard, "\n }\n}\n"); @@ -243,7 +247,7 @@ output_trailers() void -output() +output (void) { int c; @@ -286,7 +290,7 @@ output() void -output_token_translations() +output_token_translations (void) { register int i, j; /* register short *sp; JF unused */ @@ -330,7 +334,7 @@ output_token_translations() void -output_gram() +output_gram (void) { register int i; register int j; @@ -395,7 +399,7 @@ output_gram() void -output_stos() +output_stos (void) { register int i; register int j; @@ -425,7 +429,7 @@ output_stos() void -output_rule_data() +output_rule_data (void) { register int i; register int j; @@ -600,7 +604,7 @@ output_rule_data() void -output_defines() +output_defines (void) { fprintf(ftable, "\n\n#define\tYYFINAL\t\t%d\n", final_state); fprintf(ftable, "#define\tYYFLAG\t\t%d\n", MINSHORT); @@ -612,7 +616,7 @@ output_defines() /* compute and output yydefact, yydefgoto, yypact, yypgoto, yytable and yycheck. */ void -output_actions() +output_actions (void) { nvectors = nstates + nvars; @@ -649,7 +653,7 @@ output_actions() is saved for putting into yytable later. */ void -token_actions() +token_actions (void) { register int i; register int j; @@ -699,14 +703,13 @@ token_actions() a token gets to handle it. */ int -action_row(state) -int state; +action_row (int state) { register int i; register int j; register int k; - register int m; - register int n; + register int m = 0; + register int n = 0; register int count; register int default_rule; register int nreds; @@ -863,8 +866,7 @@ int state; void -save_row(state) -int state; +save_row (int state) { register int i; register int count; @@ -908,7 +910,7 @@ int state; is saved for putting into yytable later. */ void -goto_actions() +goto_actions (void) { register int i; register int j; @@ -947,8 +949,7 @@ goto_actions() int -default_goto(symbol) -int symbol; +default_goto (int symbol) { register int i; register int m; @@ -985,9 +986,7 @@ int symbol; void -save_column(symbol, default_state) -int symbol; -int default_state; +save_column (int symbol, int default_state) { register int i; register int m; @@ -1035,7 +1034,7 @@ int default_state; the actions and gotos information into yytable. */ void -sort_actions() +sort_actions (void) { register int i; register int j; @@ -1071,7 +1070,7 @@ sort_actions() void -pack_table() +pack_table (void) { register int i; register int place; @@ -1120,8 +1119,7 @@ pack_table() int -matching_state(vector) -int vector; +matching_state (int vector) { register int i; register int j; @@ -1161,14 +1159,13 @@ int vector; int -pack_vector(vector) -int vector; +pack_vector (int vector) { register int i; register int j; register int k; register int t; - register int loc; + register int loc = 0; register int ok; register short *from; register short *to; @@ -1190,7 +1187,7 @@ int vector; { loc = j + from[k]; if (loc > MAXTABLE) - fatals("maximum table size (%s) exceeded", int_to_string(MAXTABLE)); + fatals(_("maximum table size (%s) exceeded"), int_to_string(MAXTABLE)); if (table[loc] != 0) ok = 0; @@ -1231,7 +1228,7 @@ int vector; and the vectors whose elements index the portion starts */ void -output_base() +output_base (void) { register int i; register int j; @@ -1282,7 +1279,7 @@ output_base() void -output_table() +output_table (void) { register int i; register int j; @@ -1314,7 +1311,7 @@ output_table() void -output_check() +output_check (void) { register int i; register int j; @@ -1348,7 +1345,7 @@ output_check() /* copy the parser code into the ftable file at the end. */ void -output_parser() +output_parser (void) { register int c; #ifdef DONTDEF @@ -1407,7 +1404,7 @@ output_parser() /* now write out the line... */ for (; c != '\n' && c != EOF; c = getc(fpars)) - if (write_line) + if (write_line) { if (c == '$') { /* `$' in the parser file indicates where to put the actions. @@ -1418,6 +1415,7 @@ output_parser() } else putc(c, ftable); + } if (c == EOF) break; putc(c, ftable); @@ -1425,10 +1423,9 @@ output_parser() } void -output_program() +output_program (void) { register int c; - extern int lineno; if (!nolinesflag) fprintf(ftable, "#line %d \"%s\"\n", lineno, infile); @@ -1443,7 +1440,7 @@ output_program() void -free_itemsets() +free_itemsets (void) { register core *cp,*cptmp; @@ -1457,7 +1454,7 @@ free_itemsets() void -free_shifts() +free_shifts (void) { register shifts *sp,*sptmp;/* JF derefrenced freed ptr */ @@ -1471,7 +1468,7 @@ free_shifts() void -free_reductions() +free_reductions (void) { register reductions *rp,*rptmp;/* JF fixed freed ptr */ diff --git a/contrib/bison/print.c b/contrib/bison/print.c index 17a47ab4fdad..ecd5d92601fa 100644 --- a/contrib/bison/print.c +++ b/contrib/bison/print.c @@ -15,13 +15,14 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bison; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ #include #include "system.h" #include "machine.h" -#include "new.h" +#include "alloc.h" #include "files.h" #include "gram.h" #include "state.h" @@ -39,18 +40,20 @@ extern char any_conflicts; extern char *conflicts; extern int final_state; -extern void conflict_log(); -extern void verbose_conflict_log(); -extern void print_reductions(); +extern void conflict_log PARAMS((void)); +extern void verbose_conflict_log PARAMS((void)); +extern void print_reductions PARAMS((int)); -void print_token(); -void print_state(); -void print_core(); -void print_actions(); -void print_grammar(); +void terse PARAMS((void)); +void verbose PARAMS((void)); +void print_token PARAMS((int, int)); +void print_state PARAMS((int)); +void print_core PARAMS((int)); +void print_actions PARAMS((int)); +void print_grammar PARAMS((void)); void -terse() +terse (void) { if (any_conflicts) { @@ -60,7 +63,7 @@ terse() void -verbose() +verbose (void) { register int i; @@ -77,26 +80,23 @@ verbose() void -print_token(extnum, token) -int extnum, token; +print_token (int extnum, int token) { - fprintf(foutput, " type %d is %s\n", extnum, tags[token]); + fprintf(foutput, _(" type %d is %s\n"), extnum, tags[token]); } void -print_state(state) -int state; +print_state (int state) { - fprintf(foutput, "\n\nstate %d\n\n", state); + fprintf(foutput, _("\n\nstate %d\n\n"), state); print_core(state); print_actions(state); } void -print_core(state) -int state; +print_core (int state) { register int i; register int k; @@ -133,7 +133,7 @@ int state; sp++; } - fprintf (foutput, " (rule %d)", rule); + fprintf (foutput, _(" (rule %d)"), rule); putc('\n', foutput); } @@ -142,8 +142,7 @@ int state; void -print_actions(state) -int state; +print_actions (int state) { register int i; register int k; @@ -161,9 +160,9 @@ int state; if (!shiftp && !redp) { if (final_state == state) - fprintf(foutput, " $default\taccept\n"); + fprintf(foutput, _(" $default\taccept\n")); else - fprintf(foutput, " NO ACTIONS\n"); + fprintf(foutput, _(" NO ACTIONS\n")); return; } @@ -179,9 +178,9 @@ int state; /* The following line used to be turned off. */ if (ISVAR(symbol)) break; if (symbol==0) /* I.e. strcmp(tags[symbol],"$")==0 */ - fprintf(foutput, " $ \tgo to state %d\n", state1); + fprintf(foutput, _(" $ \tgo to state %d\n"), state1); else - fprintf(foutput, " %-4s\tshift, and go to state %d\n", + fprintf(foutput, _(" %-4s\tshift, and go to state %d\n"), tags[symbol], state1); } @@ -204,7 +203,7 @@ int state; { if (! errp->errs[j]) continue; symbol = errp->errs[j]; - fprintf(foutput, " %-4s\terror (nonassociative)\n", tags[symbol]); + fprintf(foutput, _(" %-4s\terror (nonassociative)\n"), tags[symbol]); } if (j > 0) @@ -215,7 +214,7 @@ int state; { rule = redp->rules[0]; symbol = rlhs[rule]; - fprintf(foutput, " $default\treduce using rule %d (%s)\n\n", + fprintf(foutput, _(" $default\treduce using rule %d (%s)\n\n"), rule, tags[symbol]); } else if (redp) @@ -230,7 +229,7 @@ int state; if (! shiftp->shifts[i]) continue; state1 = shiftp->shifts[i]; symbol = accessing_symbol[state1]; - fprintf(foutput, " %-4s\tgo to state %d\n", tags[symbol], state1); + fprintf(foutput, _(" %-4s\tgo to state %d\n"), tags[symbol], state1); } putc('\n', foutput); @@ -243,7 +242,7 @@ int state; else void -print_grammar() +print_grammar (void) { int i, j; short* rule; @@ -251,23 +250,23 @@ print_grammar() int column = 0; /* rule # : LHS -> RHS */ - fputs("\nGrammar\n", foutput); + fputs(_("\nGrammar\n"), foutput); for (i = 1; i <= nrules; i++) /* Don't print rules disabled in reduce_grammar_tables. */ if (rlhs[i] >= 0) { - fprintf(foutput, "rule %-4d %s ->", i, tags[rlhs[i]]); + fprintf(foutput, _("rule %-4d %s ->"), i, tags[rlhs[i]]); rule = &ritem[rrhs[i]]; if (*rule > 0) while (*rule > 0) fprintf(foutput, " %s", tags[*rule++]); else - fputs (" /* empty */", foutput); + fputs (_(" /* empty */"), foutput); putc('\n', foutput); } /* TERMINAL (type #) : rule #s terminal is on RHS */ - fputs("\nTerminals, with rules where they appear\n\n", foutput); + fputs(_("\nTerminals, with rules where they appear\n\n"), foutput); fprintf(foutput, "%s (-1)\n", tags[0]); if (translations) { @@ -315,7 +314,7 @@ print_grammar() fprintf (foutput, "%s\n", buffer); } - fputs("\nNonterminals, with rules where they appear\n\n", foutput); + fputs(_("\nNonterminals, with rules where they appear\n\n"), foutput); for (i = ntokens; i <= nsyms - 1; i++) { int left_count = 0, right_count = 0; @@ -341,7 +340,7 @@ print_grammar() if (left_count > 0) { END_TEST (50); - sprintf (buffer + strlen(buffer), " on left:"); + sprintf (buffer + strlen(buffer), _(" on left:")); for (j = 1; j <= nrules; j++) { @@ -356,7 +355,7 @@ print_grammar() if (left_count > 0) sprintf (buffer + strlen(buffer), ","); END_TEST (50); - sprintf (buffer + strlen(buffer), " on right:"); + sprintf (buffer + strlen(buffer), _(" on right:")); for (j = 1; j <= nrules; j++) { for (rule = &ritem[rrhs[j]]; *rule > 0; rule++) diff --git a/contrib/bison/reader.c b/contrib/bison/reader.c index 662353b307ef..e67a11891793 100644 --- a/contrib/bison/reader.c +++ b/contrib/bison/reader.c @@ -1,5 +1,5 @@ /* Input parser for bison - Copyright (C) 1984, 1986, 1989, 1992 Free Software Foundation, Inc. + Copyright (C) 1984, 1986, 1989, 1992, 1998 Free Software Foundation, Inc. This file is part of Bison, the GNU Compiler Compiler. @@ -15,7 +15,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bison; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ /* read in the grammar specification and record it in the format described in gram.h. @@ -26,10 +27,9 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ The entry point is reader(). */ #include -#include #include "system.h" #include "files.h" -#include "new.h" +#include "alloc.h" #include "symtab.h" #include "lex.h" #include "gram.h" @@ -52,46 +52,30 @@ extern bucket *symval; extern int numval; extern int expected_conflicts; extern char *token_buffer; +extern int maxtoken; -extern void init_lex(); -extern void tabinit(); -extern void output_headers(); -extern void output_trailers(); -extern void free_symtab(); -extern void open_extra_files(); -extern char *int_to_string(); -extern void fatal(); -extern void fatals(); -extern void warn(); -extern void warni(); -extern void warns(); -extern void warnss(); -extern void warnsss(); -extern void unlex(); -extern void done(); +extern void init_lex PARAMS((void)); +extern char *grow_token_buffer PARAMS((char *)); +extern void tabinit PARAMS((void)); +extern void output_headers PARAMS((void)); +extern void output_trailers PARAMS((void)); +extern void free_symtab PARAMS((void)); +extern void open_extra_files PARAMS((void)); +extern char *int_to_string PARAMS((int)); +extern char *printable_version PARAMS((int)); +extern void fatal PARAMS((char *)); +extern void fatals PARAMS((char *, char *)); +extern void warn PARAMS((char *)); +extern void warni PARAMS((char *, int)); +extern void warns PARAMS((char *, char *)); +extern void warnss PARAMS((char *, char *, char *)); +extern void warnsss PARAMS((char *, char *, char *, char *)); +extern void unlex PARAMS((int)); +extern void done PARAMS((int)); -extern int skip_white_space(); -extern int parse_percent_token(); -extern int lex(); - -void reader_output_yylsp(); -void read_declarations(); -void copy_definition(); -void parse_token_decl(); -void parse_start_decl(); -void parse_type_decl(); -void parse_assoc_decl(); -void parse_union_decl(); -void parse_expect_decl(); -void parse_thong_decl(); -void copy_action(); -void readgram(); -void record_rule_line(); -void packsymbols(); -void output_token_defines(); -void packgram(); -int read_signed_integer(); -static int get_type(); +extern int skip_white_space PARAMS((void)); +extern int parse_percent_token PARAMS((void)); +extern int lex PARAMS((void)); typedef struct symbol_list @@ -103,6 +87,31 @@ typedef symbol_list; +void reader PARAMS((void)); +void reader_output_yylsp PARAMS((FILE *)); +void read_declarations PARAMS((void)); +void copy_definition PARAMS((void)); +void parse_token_decl PARAMS((int, int)); +void parse_start_decl PARAMS((void)); +void parse_type_decl PARAMS((void)); +void parse_assoc_decl PARAMS((int)); +void parse_union_decl PARAMS((void)); +void parse_expect_decl PARAMS((void)); +char *get_type_name PARAMS((int, symbol_list *)); +void copy_guard PARAMS((symbol_list *, int)); +void parse_thong_decl PARAMS((void)); +void copy_action PARAMS((symbol_list *, int)); +bucket *gensym PARAMS((void)); +void readgram PARAMS((void)); +void record_rule_line PARAMS((void)); +void packsymbols PARAMS((void)); +void output_token_defines PARAMS((FILE *)); +void packgram PARAMS((void)); +int read_signed_integer PARAMS((FILE *)); + +#if 0 +static int get_type PARAMS((void)); +#endif int lineno; symbol_list *grammar; @@ -122,33 +131,31 @@ static int lastprec; /* incremented for each %left, %right or %nonassoc seen */ static int gensym_count; /* incremented for each generated symbol */ static bucket *errtoken; +static bucket *undeftoken; /* Nonzero if any action or guard uses the @n construct. */ static int yylsp_needed; -extern char *version_string; - static void -skip_to_char(target) - int target; +skip_to_char (int target) { int c; if (target == '\n') - warn(" Skipping to next \\n"); + warn(_(" Skipping to next \\n")); else - warni(" Skipping to next %c", target); + warni(_(" Skipping to next %c"), target); do c = skip_white_space(); while (c != target && c != EOF); - if (c != EOF) + if (c != EOF) ungetc(c, finput); } void -reader() +reader (void) { start_flag = 0; startval = NULL; /* start symbol not specified yet. */ @@ -190,15 +197,17 @@ reader() errtoken->user_token_number = 256; /* Value specified by posix. */ /* construct a token that represents all undefined literal tokens. */ /* it is always token number 2. */ - getsym("$undefined.")->class = STOKEN; + undeftoken = getsym("$undefined."); + undeftoken->class = STOKEN; + undeftoken->user_token_number = 2; /* Read the declaration section. Copy %{ ... %} groups to ftable and fdefines file. Also notice any %token, %left, etc. found there. */ - if (noparserflag) + if (noparserflag) fprintf(ftable, "\n/* Bison-generated parse tables, made from %s\n", infile); else fprintf(ftable, "\n/* A Bison parser, made from %s\n", infile); - fprintf(ftable, " by %s */\n\n", version_string); + fprintf(ftable, " by %s */\n\n", VERSION_STRING); fprintf(ftable, "#define YYBISON 1 /* Identify Bison output. */\n\n"); read_declarations(); /* start writing the guard and action files, if they are needed. */ @@ -224,8 +233,7 @@ reader() } void -reader_output_yylsp(f) - FILE *f; +reader_output_yylsp (FILE *f) { if (yylsp_needed) fprintf(f, LTYPESTR); @@ -236,7 +244,7 @@ Handle any % declarations, and copy the contents of any %{ ... %} groups to fattrs. */ void -read_declarations () +read_declarations (void) { register int c; register int tok; @@ -261,23 +269,23 @@ read_declarations () case TOKEN: parse_token_decl (STOKEN, SNTERM); break; - + case NTERM: parse_token_decl (SNTERM, STOKEN); break; - + case TYPE: parse_type_decl(); break; - + case START: parse_start_decl(); break; - + case UNION: parse_union_decl(); break; - + case EXPECT: parse_expect_decl(); break; @@ -312,16 +320,16 @@ read_declarations () break; default: - warns("unrecognized: %s", token_buffer); + warns(_("unrecognized: %s"), token_buffer); skip_to_char('%'); } } else if (c == EOF) - fatal("no input grammar"); + fatal(_("no input grammar")); else { char buff[100]; - sprintf(buff, "unknown character: %s", printable_version(c)); + sprintf(buff, _("unknown character: %s"), printable_version(c)); warn(buff); skip_to_char('%'); } @@ -333,7 +341,7 @@ read_declarations () The %{ has already been read. Return after reading the %}. */ void -copy_definition () +copy_definition (void) { register int c; register int match; @@ -360,7 +368,7 @@ copy_definition () case '%': after_percent = -1; break; - + case '\'': case '"': match = c; @@ -370,22 +378,22 @@ copy_definition () while (c != match) { if (c == EOF) - fatal("unterminated string at end of file"); + fatal(_("unterminated string at end of file")); if (c == '\n') { - warn("unterminated string"); + warn(_("unterminated string")); ungetc(c, finput); c = match; continue; } putc(c, fattrs); - + if (c == '\\') { c = getc(finput); if (c == EOF) - fatal("unterminated string at end of file"); + fatal(_("unterminated string at end of file")); putc(c, fattrs); if (c == '\n') lineno++; @@ -434,7 +442,7 @@ copy_definition () c = getc(finput); } else if (c == EOF) - fatal("unterminated comment in `%{' definition"); + fatal(_("unterminated comment in `%{' definition")); else { putc(c, fattrs); @@ -445,7 +453,7 @@ copy_definition () break; case EOF: - fatal("unterminated `%{' definition"); + fatal(_("unterminated `%{' definition")); default: putc(c, fattrs); @@ -472,8 +480,7 @@ For %token, what_is is STOKEN and what_is_not is SNTERM. For %nterm, the arguments are reversed. */ void -parse_token_decl (what_is, what_is_not) - int what_is, what_is_not; +parse_token_decl (int what_is, int what_is_not) { register int token = 0; register char *typename = 0; @@ -482,8 +489,13 @@ parse_token_decl (what_is, what_is_not) for (;;) { - if(ungetc(skip_white_space(), finput) == '%') + int tmp_char = ungetc (skip_white_space (), finput); + + if (tmp_char == '%') return; + if (tmp_char == EOF) + fatals ("Premature EOF after %s", token_buffer); + token = lex(); if (token == COMMA) { @@ -499,7 +511,7 @@ parse_token_decl (what_is, what_is_not) symbol = NULL; } else if (token == IDENTIFIER && *symval->tag == '\"' - && symbol) + && symbol) { translations = 1; symval->class = STOKEN; @@ -507,8 +519,8 @@ parse_token_decl (what_is, what_is_not) symval->user_token_number = symbol->user_token_number; symbol->user_token_number = SALIAS; - symval->alias = symbol; - symbol->alias = symval; + symval->alias = symbol; + symbol->alias = symval; symbol = NULL; nsyms--; /* symbol and symval combined are only one symbol */ @@ -519,7 +531,7 @@ parse_token_decl (what_is, what_is_not) symbol = symval; if (symbol->class == what_is_not) - warns("symbol %s redefined", symbol->tag); + warns(_("symbol %s redefined"), symbol->tag); symbol->class = what_is; if (what_is == SNTERM && oldclass != SNTERM) symbol->value = nvars++; @@ -529,7 +541,7 @@ parse_token_decl (what_is, what_is_not) if (symbol->type_name == NULL) symbol->type_name = typename; else if (strcmp(typename, symbol->type_name) != 0) - warns("type redeclaration for %s", symbol->tag); + warns(_("type redeclaration for %s"), symbol->tag); } } else if (symbol && token == NUMBER) @@ -539,8 +551,8 @@ parse_token_decl (what_is, what_is_not) } else { - warnss("`%s' is invalid in %s", - token_buffer, + warnss(_("`%s' is invalid in %s"), + token_buffer, (what_is == STOKEN) ? "%token" : "%nterm"); skip_to_char('%'); } @@ -548,7 +560,7 @@ parse_token_decl (what_is, what_is_not) } -/* parse what comes after %thong +/* parse what comes after %thong the full syntax is %thong token number literal the or number may be omitted. The number specifies the @@ -559,14 +571,14 @@ parse_token_decl (what_is, what_is_not) The ->user_token_number of the first is SALIAS and the ->user_token_number of the second is set to the number, if any, from the declaration. The two symbols are linked via pointers in their ->alias fields. - + during output_defines_table, the symbol is reported thereafter, only the literal string is retained it is the literal string that is output to yytname */ void -parse_thong_decl () +parse_thong_decl (void) { register int token; register struct bucket *symbol; @@ -585,9 +597,9 @@ parse_thong_decl () /* process first token */ - if (token != IDENTIFIER) + if (token != IDENTIFIER) { - warns("unrecognized item %s, expected an identifier", + warns(_("unrecognized item %s, expected an identifier"), token_buffer); skip_to_char('%'); return; @@ -598,7 +610,7 @@ parse_thong_decl () symbol = symval; token = lex(); /* get number or literal string */ - + if (token == NUMBER) { usrtoknum = numval; token = lex(); /* okay, did number, now get literal */ @@ -607,9 +619,9 @@ parse_thong_decl () /* process literal string token */ - if (token != IDENTIFIER || *symval->tag != '\"') + if (token != IDENTIFIER || *symval->tag != '\"') { - warns("expected string constant instead of %s", + warns(_("expected string constant instead of %s"), token_buffer); skip_to_char('%'); return; @@ -618,8 +630,8 @@ parse_thong_decl () symval->type_name = typename; symval->user_token_number = usrtoknum; - symval->alias = symbol; - symbol->alias = symval; + symval->alias = symbol; + symbol->alias = symval; nsyms--; /* symbol and symval combined are only one symbol */ } @@ -628,12 +640,12 @@ parse_thong_decl () /* parse what comes after %start */ void -parse_start_decl () +parse_start_decl (void) { if (start_flag) - warn("multiple %start declarations"); + warn(_("multiple %start declarations")); if (lex() != IDENTIFIER) - warn("invalid %start declaration"); + warn(_("invalid %start declaration")); else { start_flag = 1; @@ -646,14 +658,14 @@ parse_start_decl () /* read in a %type declaration and record its information for get_type_name to access */ void -parse_type_decl () +parse_type_decl (void) { register int k; register char *name; if (lex() != TYPENAME) { - warn("%type declaration has no "); + warn(_("%type declaration has no ")); skip_to_char('%'); return; } @@ -665,9 +677,12 @@ parse_type_decl () for (;;) { register int t; + int tmp_char = ungetc (skip_white_space (), finput); - if(ungetc(skip_white_space(), finput) == '%') + if (tmp_char == '%') return; + if (tmp_char == EOF) + fatals ("Premature EOF after %s", token_buffer); t = lex(); @@ -682,12 +697,12 @@ parse_type_decl () if (symval->type_name == NULL) symval->type_name = name; else if (strcmp(name, symval->type_name) != 0) - warns("type redeclaration for %s", symval->tag); + warns(_("type redeclaration for %s"), symval->tag); break; default: - warns("invalid %%type declaration due to item: `%s'", token_buffer); + warns(_("invalid %%type declaration due to item: `%s'"), token_buffer); skip_to_char('%'); } } @@ -699,8 +714,7 @@ parse_type_decl () /* assoc is either LEFT_ASSOC, RIGHT_ASSOC or NON_ASSOC. */ void -parse_assoc_decl (assoc) -int assoc; +parse_assoc_decl (int assoc) { register int k; register char *name = NULL; @@ -711,9 +725,12 @@ int assoc; for (;;) { register int t; + int tmp_char = ungetc (skip_white_space (), finput); - if(ungetc(skip_white_space(), finput) == '%') + if (tmp_char == '%') return; + if (tmp_char == EOF) + fatals ("Premature EOF after %s", token_buffer); t = lex(); @@ -731,18 +748,18 @@ int assoc; case IDENTIFIER: if (symval->prec != 0) - warns("redefining precedence of %s", symval->tag); + warns(_("redefining precedence of %s"), symval->tag); symval->prec = lastprec; symval->assoc = assoc; if (symval->class == SNTERM) - warns("symbol %s redefined", symval->tag); + warns(_("symbol %s redefined"), symval->tag); symval->class = STOKEN; if (name) { /* record the type, if one is specified */ if (symval->type_name == NULL) symval->type_name = name; else if (strcmp(name, symval->type_name) != 0) - warns("type redeclaration for %s", symval->tag); + warns(_("type redeclaration for %s"), symval->tag); } break; @@ -752,9 +769,9 @@ int assoc; symval->user_token_number = numval; translations = 1; } - else + else { - warns("invalid text (%s) - number should be after identifier", + warns(_("invalid text (%s) - number should be after identifier"), token_buffer); skip_to_char('%'); } @@ -764,7 +781,7 @@ int assoc; return; default: - warns("unexpected item: %s", token_buffer); + warns(_("unexpected item: %s"), token_buffer); skip_to_char('%'); } @@ -780,7 +797,7 @@ int assoc; definition of YYSTYPE, the type of elements of the parser value stack. */ void -parse_union_decl() +parse_union_decl (void) { register int c; register int count; @@ -788,7 +805,7 @@ parse_union_decl() int cplus_comment; if (typed) - warn("multiple %union declarations"); + warn(_("multiple %union declarations")); typed = 1; @@ -846,7 +863,7 @@ parse_union_decl() } } if (c == EOF) - fatal("unterminated comment at end of file"); + fatal(_("unterminated comment at end of file")); if (!cplus_comment && c == '*') { @@ -872,7 +889,7 @@ parse_union_decl() case '}': if (count == 0) - warn ("unmatched close-brace (`}')"); + warn (_("unmatched close-brace (`}')")); count--; if (count <= 0) { @@ -894,7 +911,7 @@ parse_union_decl() shift-reduce conflicts. */ void -parse_expect_decl() +parse_expect_decl (void) { register int c; register int count; @@ -916,7 +933,7 @@ parse_expect_decl() ungetc (c, finput); if (count <= 0 || count > 10) - warn("argument of %expect is not an integer"); + warn(_("argument of %expect is not an integer")); expected_conflicts = atoi (buffer); } @@ -925,18 +942,16 @@ parse_expect_decl() /* Get the data type (alternative in the union) of the value for symbol n in rule rule. */ char * -get_type_name(n, rule) -int n; -symbol_list *rule; +get_type_name (int n, symbol_list *rule) { - static char *msg = "invalid $ value"; + static char *msg = N_("invalid $ value"); register int i; register symbol_list *rp; if (n < 0) { - warn(msg); + warn(_(msg)); return NULL; } @@ -948,7 +963,7 @@ symbol_list *rule; rp = rp->next; if (rp == NULL || rp->sym == NULL) { - warn(msg); + warn(_(msg)); return NULL; } i++; @@ -966,9 +981,7 @@ which says where to find $0 with respect to the top of the stack, for the simple parser in which the stack is not popped until after the guard is run. */ void -copy_guard(rule, stack_offset) -symbol_list *rule; -int stack_offset; +copy_guard (symbol_list *rule, int stack_offset) { register int c; register int n; @@ -1009,9 +1022,9 @@ int stack_offset; putc(c, fguard); if (count > 0) count--; - else + else { - warn("unmatched right brace (`}')"); + warn(_("unmatched right brace (`}')")); c = getc(finput); /* skip it */ } break; @@ -1025,22 +1038,22 @@ int stack_offset; while (c != match) { if (c == EOF) - fatal("unterminated string at end of file"); - if (c == '\n') + fatal(_("unterminated string at end of file")); + if (c == '\n') { - warn("unterminated string"); + warn(_("unterminated string")); ungetc(c, finput); c = match; /* invent terminator */ continue; } putc(c, fguard); - + if (c == '\\') { c = getc(finput); if (c == EOF) - fatal("unterminated string"); + fatal(_("unterminated string")); putc(c, fguard); if (c == '\n') lineno++; @@ -1089,7 +1102,7 @@ int stack_offset; c = getc(finput); } else if (c == EOF) - fatal("unterminated comment"); + fatal(_("unterminated comment")); else { putc(c, fguard); @@ -1108,7 +1121,12 @@ int stack_offset; register char *cp = token_buffer; while ((c = getc(finput)) != '>' && c > 0) - *cp++ = c; + { + if (cp == token_buffer + maxtoken) + cp = grow_token_buffer(cp); + + *cp++ = c; + } *cp = 0; type_name = token_buffer; @@ -1122,7 +1140,7 @@ int stack_offset; if (type_name) fprintf(fguard, ".%s", type_name); if(!type_name && typed) - warns("$$ of `%s' has no declared type", rule->sym->tag); + warns(_("$$ of `%s' has no declared type"), rule->sym->tag); } else if (isdigit(c) || c == '-') @@ -1138,11 +1156,11 @@ int stack_offset; if (type_name) fprintf(fguard, ".%s", type_name); if(!type_name && typed) - warnss("$%s of `%s' has no declared type", int_to_string(n), rule->sym->tag); + warnss(_("$%s of `%s' has no declared type"), int_to_string(n), rule->sym->tag); continue; } else - warni("$%s is invalid", printable_version(c)); + warns(_("$%s is invalid"), printable_version(c)); break; @@ -1156,7 +1174,7 @@ int stack_offset; } else { - warni("@%s is invalid", printable_version(c)); + warns(_("@%s is invalid"), printable_version(c)); n = 1; } @@ -1166,7 +1184,7 @@ int stack_offset; continue; case EOF: - fatal("unterminated %%guard clause"); + fatal(_("unterminated %%guard clause")); default: putc(c, fguard); @@ -1199,9 +1217,7 @@ stack_offset is the number of values in the current rule so far, which says where to find $0 with respect to the top of the stack. */ void -copy_action(rule, stack_offset) -symbol_list *rule; -int stack_offset; +copy_action (symbol_list *rule, int stack_offset) { register int c; register int n; @@ -1248,13 +1264,13 @@ int stack_offset; { if (c == '\n') { - warn("unterminated string"); + warn(_("unterminated string")); ungetc(c, finput); c = match; continue; } else if (c == EOF) - fatal("unterminated string at end of file"); + fatal(_("unterminated string at end of file")); putc(c, faction); @@ -1262,7 +1278,7 @@ int stack_offset; { c = getc(finput); if (c == EOF) - fatal("unterminated string"); + fatal(_("unterminated string")); putc(c, faction); if (c == '\n') lineno++; @@ -1311,7 +1327,7 @@ int stack_offset; c = getc(finput); } else if (c == EOF) - fatal("unterminated comment"); + fatal(_("unterminated comment")); else { putc(c, faction); @@ -1330,7 +1346,12 @@ int stack_offset; register char *cp = token_buffer; while ((c = getc(finput)) != '>' && c > 0) - *cp++ = c; + { + if (cp == token_buffer + maxtoken) + cp = grow_token_buffer(cp); + + *cp++ = c; + } *cp = 0; type_name = token_buffer; value_components_used = 1; @@ -1343,8 +1364,8 @@ int stack_offset; if (!type_name) type_name = get_type_name(0, rule); if (type_name) fprintf(faction, ".%s", type_name); - if(!type_name && typed) - warns("$$ of `%s' has no declared type", rule->sym->tag); + if(!type_name && typed) + warns(_("$$ of `%s' has no declared type"), rule->sym->tag); } else if (isdigit(c) || c == '-') { @@ -1358,13 +1379,13 @@ int stack_offset; fprintf(faction, "yyvsp[%d]", n - stack_offset); if (type_name) fprintf(faction, ".%s", type_name); - if(!type_name && typed) - warnss("$%s of `%s' has no declared type", + if(!type_name && typed) + warnss(_("$%s of `%s' has no declared type"), int_to_string(n), rule->sym->tag); continue; } else - warni("$%s is invalid", printable_version(c)); + warns(_("$%s is invalid"), printable_version(c)); break; @@ -1378,7 +1399,7 @@ int stack_offset; } else { - warn("invalid @-construct"); + warn(_("invalid @-construct")); n = 1; } @@ -1388,7 +1409,7 @@ int stack_offset; continue; case EOF: - fatal("unmatched `{'"); + fatal(_("unmatched `{'")); default: putc(c, faction); @@ -1415,7 +1436,7 @@ int stack_offset; whose name cannot conflict with the user's names. */ bucket * -gensym() +gensym (void) { register bucket *sym; @@ -1436,10 +1457,10 @@ All guards and actions are copied out to the appropriate files, labelled by the rule number they apply to. */ void -readgram() +readgram (void) { register int t; - register bucket *lhs; + register bucket *lhs = NULL; register symbol_list *p; register symbol_list *p1; register bucket *bp; @@ -1470,18 +1491,18 @@ readgram() startval = lhs; start_flag = 1; } - + t = lex(); if (t != COLON) { - warn("ill-formed rule: initial symbol not followed by colon"); + warn(_("ill-formed rule: initial symbol not followed by colon")); unlex(t); } } if (nrules == 0 && t == BAR) { - warn("grammar starts with vertical bar"); + warn(_("grammar starts with vertical bar")); lhs = symval; /* BOGUS: use a random symval */ } /* start a new rule and record its lhs. */ @@ -1512,7 +1533,7 @@ readgram() nvars++; } else if (lhs->class == STOKEN) - warns("rule given for %s, which is a token", lhs->tag); + warns(_("rule given for %s, which is a token"), lhs->tag); /* read the rhs of the rule. */ @@ -1610,7 +1631,7 @@ readgram() if (t == PREC) { - warn("two @prec's in a row"); + warn(_("two @prec's in a row")); t = lex(); crule->ruleprec = symval; t = lex(); @@ -1618,7 +1639,7 @@ readgram() if (t == GUARD) { if (! semantic_parser) - warn("%%guard present but %%semantic_parser not specified"); + warn(_("%%guard present but %%semantic_parser not specified")); copy_guard(crule, rulelength); t = lex(); @@ -1626,7 +1647,7 @@ readgram() else if (t == LEFT_CURLY) { /* This case never occurs -wjh */ - if (actionflag) warn("two actions at end of one rule"); + if (actionflag) warn(_("two actions at end of one rule")); copy_action(crule, rulelength); actionflag = 1; xactions++; /* -wjh */ @@ -1638,16 +1659,16 @@ readgram() { if (lhs->type_name == 0 || first_rhs->type_name == 0 || strcmp(lhs->type_name,first_rhs->type_name)) - warnss("type clash (`%s' `%s') on default action", + warnss(_("type clash (`%s' `%s') on default action"), lhs->type_name ? lhs->type_name : "", first_rhs->type_name ? first_rhs->type_name : ""); } /* Warn if there is no default for $$ but we need one. */ else if (!xactions && !first_rhs && lhs->type_name != 0) - warn("empty rule for typed nonterminal, and no action"); + warn(_("empty rule for typed nonterminal, and no action")); if (t == SEMICOLON) t = lex(); - } + } #if 0 /* these things can appear as alternatives to rules. */ /* NO, they cannot. @@ -1688,7 +1709,7 @@ readgram() else { - warns("invalid input: %s", token_buffer); + warns(_("invalid input: %s"), token_buffer); t = lex(); } } @@ -1696,10 +1717,10 @@ readgram() /* grammar has been read. Do some checking */ if (nsyms > MAXSHORT) - fatals("too many symbols (tokens plus nonterminals); maximum %s", + fatals(_("too many symbols (tokens plus nonterminals); maximum %s"), int_to_string(MAXSHORT)); if (nrules == 0) - fatal("no rules in the input grammar"); + fatal(_("no rules in the input grammar")); if (typed == 0 /* JF put out same default YYSTYPE as YACC does */ && !value_components_used) @@ -1717,7 +1738,7 @@ readgram() for (bp = firstsymbol; bp; bp = bp->next) if (bp->class == SUNKNOWN) { - warns("symbol %s is used, but is not defined as a token and has no rules", + warns(_("symbol %s is used, but is not defined as a token and has no rules"), bp->tag); bp->class = SNTERM; bp->value = nvars++; @@ -1728,24 +1749,25 @@ readgram() void -record_rule_line () +record_rule_line (void) { /* Record each rule's source line number in rline table. */ if (nrules >= rline_allocated) { rline_allocated = nrules * 2; - rline = (short *) xrealloc (rline, - rline_allocated * sizeof (short)); + rline = (short *) xrealloc ((char *) rline, + rline_allocated * sizeof (short)); } rline[nrules] = lineno; } +#if 0 /* read in a %type declaration and record its information for get_type_name to access */ /* this is unused. it is only called from the #if 0 part of readgram */ static int -get_type() +get_type (void) { register int k; register int t; @@ -1753,9 +1775,9 @@ get_type() t = lex(); - if (t != TYPENAME) + if (t != TYPENAME) { - warn("ill-formed %type declaration"); + warn(_("ill-formed %type declaration")); return t; } @@ -1779,7 +1801,7 @@ get_type() if (symval->type_name == NULL) symval->type_name = name; else if (strcmp(name, symval->type_name) != 0) - warns("type redeclaration for %s", symval->tag); + warns(_("type redeclaration for %s"), symval->tag); break; @@ -1788,14 +1810,14 @@ get_type() } } } - +#endif /* assign symbol numbers, and write definition of token names into fdefines. Set up vectors tags and sprec of names and precedences of symbols. */ void -packsymbols() +packsymbols (void) { register bucket *bp; register int tokno = 1; @@ -1825,7 +1847,7 @@ packsymbols() { /* this symbol and its alias are a single token defn. allocate a tokno, and assign to both - check agreement of ->prec and ->assoc fields + check agreement of ->prec and ->assoc fields and make both the same */ if (bp->value == 0) @@ -1834,7 +1856,7 @@ packsymbols() if (bp->prec != bp->alias->prec) { if (bp->prec != 0 && bp->alias->prec != 0 && bp->user_token_number == SALIAS) - warnss("conflicting precedences for %s and %s", + warnss(_("conflicting precedences for %s and %s"), bp->tag, bp->alias->tag); if (bp->prec != 0) bp->alias->prec = bp->prec; else bp->prec = bp->alias->prec; @@ -1843,7 +1865,7 @@ packsymbols() if (bp->assoc != bp->alias->assoc) { if (bp->assoc != 0 && bp->alias->assoc != 0 && bp->user_token_number == SALIAS) - warnss("conflicting assoc values for %s and %s", + warnss(_("conflicting assoc values for %s and %s"), bp->tag, bp->alias->tag); if (bp->assoc != 0) bp->alias->assoc = bp->assoc; else bp->assoc = bp->alias->assoc; @@ -1883,14 +1905,14 @@ packsymbols() the internal token number for $undefined., which represents all invalid inputs. */ for (i = 0; i <= max_user_token_number; i++) - token_translations[i] = 2; + token_translations[i] = 2; for (bp = firstsymbol; bp; bp = bp->next) { if (bp->value >= ntokens) continue; /* non-terminal */ - if (bp->user_token_number == SALIAS) continue; + if (bp->user_token_number == SALIAS) continue; if (token_translations[bp->user_token_number] != 2) - warnsss("tokens %s and %s both assigned number %s", + warnsss(_("tokens %s and %s both assigned number %s"), tags[token_translations[bp->user_token_number]], bp->tag, int_to_string(bp->user_token_number)); @@ -1904,9 +1926,9 @@ packsymbols() output_token_defines(ftable); if (startval->class == SUNKNOWN) - fatals("the start symbol %s is undefined", startval->tag); + fatals(_("the start symbol %s is undefined"), startval->tag); else if (startval->class == STOKEN) - fatals("the start symbol %s is a token", startval->tag); + fatals(_("the start symbol %s is a token"), startval->tag); start_symbol = startval->value; @@ -1937,13 +1959,12 @@ packsymbols() #endif } } - -/* For named tokens, but not literal ones, define the name. - The value is the user token number. + +/* For named tokens, but not literal ones, define the name. + The value is the user token number. */ void -output_token_defines(file) -FILE *file; +output_token_defines (FILE *file) { bucket *bp; register char *cp, *symbol; @@ -1957,7 +1978,7 @@ FILE *file; if (bp->user_token_number == SALIAS) continue; if ('\'' == *symbol) continue; /* skip literal character */ if (bp == errtoken) continue; /* skip error token */ - if ('\"' == *symbol) + if ('\"' == *symbol) { /* use literal string only if given a symbol with an alias */ if (bp->alias) @@ -1972,8 +1993,8 @@ FILE *file; if (c != '\0') continue; fprintf(file, "#define\t%s\t%d\n", symbol, - ((translations && ! rawtoknumflag) - ? bp->user_token_number + ((translations && ! rawtoknumflag) + ? bp->user_token_number : bp->value)); if (semantic_parser) fprintf(file, "#define\tT%s\t%d\n", symbol, bp->value); @@ -1987,7 +2008,7 @@ FILE *file; /* convert the rules into the representation using rrhs, rlhs and ritems. */ void -packgram() +packgram (void) { register int itemno; register int ruleno; @@ -2048,8 +2069,7 @@ packgram() /* Read a signed integer from STREAM and return its value. */ int -read_signed_integer (stream) - FILE *stream; +read_signed_integer (FILE *stream) { register int c = getc(stream); register int sign = 1; diff --git a/contrib/bison/reduce.c b/contrib/bison/reduce.c index 13e62ca357b8..5e69a69b117d 100644 --- a/contrib/bison/reduce.c +++ b/contrib/bison/reduce.c @@ -15,7 +15,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bison; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ /* @@ -33,12 +34,13 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "files.h" #include "gram.h" #include "machine.h" -#include "new.h" +#include "alloc.h" extern char **tags; /* reader.c */ extern int verboseflag; /* getargs.c */ static int statisticsflag; /* XXXXXXX */ +extern int fixed_outfiles; #ifndef TRUE #define TRUE (1) @@ -61,21 +63,22 @@ static int nuseful_productions, nuseless_productions, nuseful_nonterminals, nuseless_nonterminals; -static void useless_nonterminals(); -static void inaccessable_symbols(); -static void reduce_grammar_tables(); -static void print_results(); -static void print_notices(); -void dump_grammar(); +bool bits_equal PARAMS((BSet, BSet, int)); +int nbits PARAMS((unsigned)); +int bits_size PARAMS((BSet, int)); +void reduce_grammar PARAMS((void)); +static void useless_nonterminals PARAMS((void)); +static void inaccessable_symbols PARAMS((void)); +static void reduce_grammar_tables PARAMS((void)); +static void print_results PARAMS((void)); +static void print_notices PARAMS((void)); +void dump_grammar PARAMS((void)); -extern void fatals (); +extern void fatals PARAMS((char *, char *)); bool -bits_equal (L, R, n) -BSet L; -BSet R; -int n; +bits_equal (BSet L, BSet R, int n) { int i; @@ -87,13 +90,12 @@ int n; int -nbits (i) -unsigned i; +nbits (unsigned i) { int count = 0; while (i != 0) { - i ^= (i & -i); + i ^= (i & ((unsigned) (- (int) i))); ++count; } return count; @@ -101,9 +103,7 @@ unsigned i; int -bits_size (S, n) -BSet S; -int n; +bits_size (BSet S, int n) { int i, count = 0; @@ -113,7 +113,7 @@ int n; } void -reduce_grammar () +reduce_grammar (void) { bool reduced; @@ -138,7 +138,7 @@ reduce_grammar () print_notices(); if (!BITISSET(N, start_symbol - ntokens)) - fatals("Start symbol %s does not derive any sentence", + fatals(_("Start symbol %s does not derive any sentence"), tags[start_symbol]); reduce_grammar_tables(); @@ -151,8 +151,8 @@ reduce_grammar () /**/ statisticsflag = FALSE; /* someday getopts should handle this */ if (statisticsflag == TRUE) fprintf(stderr, - "reduced %s defines %d terminal%s, %d nonterminal%s\ -, and %d production%s.\n", infile, + _("reduced %s defines %d terminal%s, %d nonterminal%s\ +, and %d production%s.\n"), infile, ntokens, (ntokens == 1 ? "" : "s"), nvars, (nvars == 1 ? "" : "s"), nrules, (nrules == 1 ? "" : "s")); @@ -169,14 +169,12 @@ reduce_grammar () /* * Another way to do this would be with a set for each production and then do - * subset tests against N, but even for the C grammar the whole reducing + * subset tests against N0, but even for the C grammar the whole reducing * process takes only 2 seconds on my 8Mhz AT. */ -static bool -useful_production (i, N) -int i; -BSet N; +static bool +useful_production (int i, BSet N0) { rule r; short n; @@ -188,7 +186,7 @@ BSet N; for (r = &ritem[rrhs[i]]; *r > 0; r++) if (ISVAR(n = *r)) - if (!BITISSET(N, n - ntokens)) + if (!BITISSET(N0, n - ntokens)) return FALSE; return TRUE; } @@ -196,8 +194,8 @@ BSet N; /* Remember that rules are 1-origin, symbols are 0-origin. */ -static void -useless_nonterminals () +static void +useless_nonterminals (void) { BSet Np, Ns; int i, n; @@ -218,7 +216,7 @@ useless_nonterminals () * set being computed remains unchanged. Any nonterminals not in the * set at that point are useless in that they will never be used in * deriving a sentence of the language. - * + * * This iteration doesn't use any special traversal over the * productions. A set is kept of all productions for which all the * nonterminals in the RHS are in useful. Only productions not in @@ -253,8 +251,8 @@ useless_nonterminals () N = Np; } -static void -inaccessable_symbols () +static void +inaccessable_symbols (void) { BSet Vp, Vs, Pp; int i, n; @@ -270,13 +268,13 @@ inaccessable_symbols () * reachable symbols, add the production to the set of reachable * productions, and add all of the nonterminals in the RHS of the * production to the set of reachable symbols. - * + * * Consider only the (partially) reduced grammar which has only * nonterminals in N and productions in P. - * + * * The result is the set P of productions in the reduced grammar, and * the set V of symbols in the reduced grammar. - * + * * Although this algorithm also computes the set of terminals which are * reachable, no terminal will be deleted from the grammar. Some * terminals might not be in the grammar but might be generated by @@ -302,7 +300,7 @@ inaccessable_symbols () Vp[i] = V[i]; for (i = 1; i <= nrules; i++) { - if (!BITISSET(Pp, i) && BITISSET(P, i) && + if (!BITISSET(Pp, i) && BITISSET(P, i) && BITISSET(V, rlhs[i])) { for (r = &ritem[rrhs[i]]; *r >= 0; r++) @@ -352,8 +350,8 @@ inaccessable_symbols () SETBIT(V1, rprecsym[i]); } -static void -reduce_grammar_tables () +static void +reduce_grammar_tables (void) { /* This is turned off because we would need to change the numbers in the case statements in the actions file. */ @@ -481,8 +479,8 @@ reduce_grammar_tables () } } -static void -print_results () +static void +print_results (void) { int i; /* short j; JF unused */ @@ -491,7 +489,7 @@ print_results () if (nuseless_nonterminals > 0) { - fprintf(foutput, "Useless nonterminals:\n\n"); + fprintf(foutput, _("Useless nonterminals:\n\n")); for (i = ntokens; i < nsyms; i++) if (!BITISSET(V, i)) fprintf(foutput, " %s\n", tags[i]); @@ -503,7 +501,7 @@ print_results () { if (!b) { - fprintf(foutput, "\n\nTerminals which are not used:\n\n"); + fprintf(foutput, _("\n\nTerminals which are not used:\n\n")); b = TRUE; } fprintf(foutput, " %s\n", tags[i]); @@ -512,7 +510,7 @@ print_results () if (nuseless_productions > 0) { - fprintf(foutput, "\n\nUseless rules:\n\n"); + fprintf(foutput, _("\n\nUseless rules:\n\n")); for (i = 1; i <= nrules; i++) { if (!BITISSET(P, i)) @@ -531,8 +529,8 @@ print_results () fprintf(foutput, "\n\n"); } -void -dump_grammar () +void +dump_grammar (void) { int i; rule r; @@ -540,23 +538,23 @@ dump_grammar () fprintf(foutput, "ntokens = %d, nvars = %d, nsyms = %d, nrules = %d, nitems = %d\n\n", ntokens, nvars, nsyms, nrules, nitems); - fprintf(foutput, "Variables\n---------\n\n"); - fprintf(foutput, "Value Sprec Sassoc Tag\n"); + fprintf(foutput, _("Variables\n---------\n\n")); + fprintf(foutput, _("Value Sprec Sassoc Tag\n")); for (i = ntokens; i < nsyms; i++) fprintf(foutput, "%5d %5d %5d %s\n", i, sprec[i], sassoc[i], tags[i]); fprintf(foutput, "\n\n"); - fprintf(foutput, "Rules\n-----\n\n"); + fprintf(foutput, _("Rules\n-----\n\n")); for (i = 1; i <= nrules; i++) { - fprintf(foutput, "%-5d(%5d%5d)%5d : (@%-5d)", + fprintf(foutput, "%-5d(%5d%5d)%5d : (@%-5d)", i, rprec[i], rassoc[i], rlhs[i], rrhs[i]); for (r = &ritem[rrhs[i]]; *r > 0; r++) fprintf(foutput, "%5d", *r); fprintf(foutput, " [%d]\n", -(*r)); } fprintf(foutput, "\n\n"); - fprintf(foutput, "Rules interpreted\n-----------------\n\n"); + fprintf(foutput, _("Rules interpreted\n-----------------\n\n")); for (i = 1; i <= nrules; i++) { fprintf(foutput, "%-5d %s :", i, tags[rlhs[i]]); @@ -568,28 +566,26 @@ dump_grammar () } -static void -print_notices () +static void +print_notices (void) { - extern int fixed_outfiles; - if (fixed_outfiles && nuseless_productions) - fprintf(stderr, "%d rules never reduced\n", nuseless_productions); + fprintf(stderr, _("%d rules never reduced\n"), nuseless_productions); - fprintf(stderr, "%s contains ", infile); + fprintf(stderr, _("%s contains "), infile); if (nuseless_nonterminals > 0) { - fprintf(stderr, "%d useless nonterminal%s", + fprintf(stderr, _("%d useless nonterminal%s"), nuseless_nonterminals, (nuseless_nonterminals == 1 ? "" : "s")); } if (nuseless_nonterminals > 0 && nuseless_productions > 0) - fprintf(stderr, " and "); + fprintf(stderr, _(" and ")); if (nuseless_productions > 0) { - fprintf(stderr, "%d useless rule%s", + fprintf(stderr, _("%d useless rule%s"), nuseless_productions, (nuseless_productions == 1 ? "" : "s")); } diff --git a/contrib/bison/stamp-vti b/contrib/bison/stamp-vti new file mode 100644 index 000000000000..656afa037c12 --- /dev/null +++ b/contrib/bison/stamp-vti @@ -0,0 +1,3 @@ +@set UPDATED 14 January 1999 +@set EDITION 1.28 +@set VERSION 1.28 diff --git a/contrib/bison/state.h b/contrib/bison/state.h index 53f9d094bcbe..67b78cfce276 100644 --- a/contrib/bison/state.h +++ b/contrib/bison/state.h @@ -15,7 +15,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bison; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ /* These type definitions are used to represent a nondeterministic diff --git a/contrib/bison/symtab.c b/contrib/bison/symtab.c index adfe39011cfc..281239c73840 100644 --- a/contrib/bison/symtab.c +++ b/contrib/bison/symtab.c @@ -15,12 +15,13 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bison; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ #include #include "system.h" -#include "new.h" +#include "alloc.h" #include "symtab.h" #include "gram.h" @@ -29,11 +30,12 @@ bucket **symtab; bucket *firstsymbol; bucket *lastsymbol; +void tabinit PARAMS((void)); +void free_symtab PARAMS((void)); -int -hash(key) -char *key; +static int +hash (char *key) { register char *cp; register int k; @@ -48,9 +50,8 @@ char *key; -char * -copys(s) -char *s; +static char * +copys (char *s) { register int i; register char *cp; @@ -67,7 +68,7 @@ char *s; void -tabinit() +tabinit (void) { /* register int i; JF unused */ @@ -79,8 +80,7 @@ tabinit() bucket * -getsym(key) -char *key; +getsym (char *key) { register int hashval; register bucket *bp; @@ -127,7 +127,7 @@ char *key; void -free_symtab() +free_symtab (void) { register int i; register bucket *bp,*bptmp;/* JF don't use ptr after free */ diff --git a/contrib/bison/symtab.h b/contrib/bison/symtab.h index f515721d6b54..03e2ea1cab97 100644 --- a/contrib/bison/symtab.h +++ b/contrib/bison/symtab.h @@ -15,8 +15,12 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bison; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #define TABSIZE 1009 @@ -53,4 +57,4 @@ typedef extern bucket **symtab; extern bucket *firstsymbol; -extern bucket *getsym(); +extern bucket *getsym PARAMS((char *)); diff --git a/contrib/bison/system.h b/contrib/bison/system.h index 8d3562c9b072..e53fef40cdd4 100644 --- a/contrib/bison/system.h +++ b/contrib/bison/system.h @@ -1,11 +1,28 @@ +#ifndef BISON_SYSTEM_H +#define BISON_SYSTEM_H + +#ifdef HAVE_CONFIG_H +# include +#endif + #ifdef MSDOS #include #endif +#ifdef _MSC_VER +#include +#include +#define getpid _getpid +#endif + #if defined(HAVE_STDLIB_H) || defined(MSDOS) #include #endif +#if defined(HAVE_UNISTD_H) +#include +#endif + #if (defined(VMS) || defined(MSDOS)) && !defined(HAVE_STRING_H) #define HAVE_STRING_H 1 #endif @@ -23,3 +40,32 @@ #include /* memory.h and strings.h conflict on some systems. */ #endif /* not STDC_HEADERS and not HAVE_STRING_H */ + +#if defined(STDC_HEADERS) || defined(HAVE_CTYPE_H) +#include +#endif + +#ifdef HAVE_LOCALE_H +# include +#endif +#ifndef HAVE_SETLOCALE +# define setlocale(Category, Locale) +#endif + +#ifdef ENABLE_NLS +# include +# define _(Text) gettext (Text) +#else +# undef bindtextdomain +# define bindtextdomain(Domain, Directory) +# undef textdomain +# define textdomain(Domain) +# define _(Text) Text +#endif +#define N_(Text) Text + +#ifndef LOCALEDIR +#define LOCALEDIR "/usr/local/share/locale" +#endif + +#endif /* BISON_SYSTEM_H */ diff --git a/contrib/bison/types.h b/contrib/bison/types.h index a4aa0a750125..25cf78858759 100644 --- a/contrib/bison/types.h +++ b/contrib/bison/types.h @@ -15,7 +15,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bison; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ typedef diff --git a/contrib/bison/version.texi b/contrib/bison/version.texi new file mode 100644 index 000000000000..656afa037c12 --- /dev/null +++ b/contrib/bison/version.texi @@ -0,0 +1,3 @@ +@set UPDATED 14 January 1999 +@set EDITION 1.28 +@set VERSION 1.28 diff --git a/contrib/bison/vmsgetargs.c b/contrib/bison/vmsgetargs.c index 83cb8bfcfade..7431c4ca7f11 100644 --- a/contrib/bison/vmsgetargs.c +++ b/contrib/bison/vmsgetargs.c @@ -15,7 +15,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bison; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ #include diff --git a/contrib/bison/warshall.c b/contrib/bison/warshall.c index 65487cbfb3b6..862f0eabc2a0 100644 --- a/contrib/bison/warshall.c +++ b/contrib/bison/warshall.c @@ -15,21 +15,22 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bison; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ +the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ #include #include "system.h" #include "machine.h" +void RTC PARAMS((unsigned *, int)); + /* given n by n matrix of bits R, modify its contents to be the transive closure of what was given. */ -void -TC(R, n) -unsigned *R; -int n; +static void +TC (unsigned *R, int n) { register int rowsize; register unsigned mask; @@ -87,9 +88,7 @@ int n; and then set all the bits on the diagonal of R. */ void -RTC(R, n) -unsigned *R; -int n; +RTC (unsigned *R, int n) { register int rowsize; register unsigned mask;