Index: head/contrib/byacc/CHANGES =================================================================== --- head/contrib/byacc/CHANGES (revision 313104) +++ head/contrib/byacc/CHANGES (revision 313105) @@ -1,2595 +1,2625 @@ +2017-02-01 Thomas E. Dickey + + * test/btyacc/expr.oxout.error, test/btyacc/expr.oxout.output, test/btyacc/expr.oxout.tab.c, test/btyacc/expr.oxout.tab.h, test/yacc/expr.oxout.error, test/yacc/expr.oxout.output, test/yacc/expr.oxout.tab.c, test/yacc/expr.oxout.tab.h: + RCS_BASE + + * package/debian/copyright: update copyright + + * reader.c, defs.h, main.c: + avoid using regex.h since some low-end platforms do not have this + + * test/expr.oxout.y: RCS_BASE + + * configure: regen + + * aclocal.m4: quiet a strict gcc warning in CF_MKSTEMP + +2017-02-01 Tom.Shields + + * main.c, reader.c, defs.h: + process #line directives, like bison and flex + +2017-02-01 Thomas E. Dickey + + * VERSION, package/byacc.spec, package/debian/changelog, package/mingw-byacc.spec, package/pkgsrc/Makefile: + bump + +2016-12-31 Thomas E. Dickey + + * config.guess, config.sub: 2017-01-01 + 2016-12-02 Thomas E. Dickey * test/btyacc/quote_calc4-s.tab.c, test/btyacc/varsyntax_calc1.tab.c, test/btyacc/error.tab.c, test/btyacc/grammar.tab.c, test/btyacc/inherit0.tab.c, test/btyacc/inherit1.tab.c, test/btyacc/inherit2.tab.c, test/btyacc/ok_syntax1.tab.c, test/btyacc/pure_calc.tab.c, test/btyacc/pure_error.tab.c, test/btyacc/quote_calc-s.tab.c, test/btyacc/quote_calc.tab.c, test/btyacc/quote_calc2-s.tab.c, test/btyacc/quote_calc2.tab.c, test/btyacc/quote_calc3-s.tab.c, test/btyacc/quote_calc3.tab.c, test/btyacc/quote_calc4.tab.c, test/btyacc/calc.tab.c, test/btyacc/calc1.tab.c, test/btyacc/calc2.tab.c, test/btyacc/calc3.tab.c, test/btyacc/code_calc.code.c, test/btyacc/code_error.code.c, test/btyacc/empty.tab.c, test/btyacc/err_inherit3.tab.c, test/btyacc/err_inherit4.tab.c, test/btyacc/err_syntax10.tab.c, test/btyacc/err_syntax11.tab.c, test/btyacc/err_syntax12.tab.c, test/btyacc/err_syntax18.tab.c, test/btyacc/err_syntax20.tab.c, test/btyacc/rename_debug.c, test/btyacc/btyacc_calc1.tab.c, test/btyacc/btyacc_demo.tab.c, test/btyacc/btyacc_destroy1.tab.c, test/btyacc/btyacc_destroy2.tab.c, test/btyacc/btyacc_destroy3.tab.c, btyaccpar.c: regen * btyaccpar.skel: changes from NetBSD + use YYINT rather than short in btyaccpar.skel (some of this had already been done by Tom Shields) + remove some casts of malloc/realloc * yaccpar.c, yaccpar.skel, output.c: changes from NetBSD - Add some more bison stuff to make the mesa/gallium parser work: %initial-action (add missing source struct member in location) %debug (unimplemented) %error-verbose (unimplemented) This changes some existing code: + yylloc is now a pointer, so + the first parameter to YYERROR_DECL() is a pointer + struct YYLTYPE now has a "source" field * test/btyacc/btyacc_demo.tab.h, test/btyacc/code_calc.tab.c, test/btyacc/code_error.tab.c, test/btyacc/err_inherit4.tab.h: regen * btyaccpar.c, btyaccpar.skel, reader.c: changes from NetBSD - Add some more bison stuff to make the mesa/gallium parser work: %initial-action (add missing source struct member in location) %debug (unimplemented) %error-verbose (unimplemented) This changes some existing code: + yylloc is now a pointer, so + the first parameter to YYERROR_DECL() is a pointer + struct YYLTYPE now has a "source" field * reader.c: fix from NetBSD: correct off-by-one when adding a null in copy_param() * reader.c: adapted from NetBSD - Convert *most* error fingerprints to: -unterminated_arglist(int a_lineno, char *a_line, char *a_cptr) +unterminated_arglist(const struct ainfo *a) - Cast new args to unsigned char * defs.h: changes from NetBSD - Add some more bison stuff to make the mesa/gallium parser work: %initial-action (add missing source struct member in location) %debug (unimplemented) %error-verbose (unimplemented) This changes some existing code: + yylloc is now a pointer, so + the first parameter to YYERROR_DECL() is a pointer + struct YYLTYPE now has a "source" field * defs.h: adapted from NetBSD - Convert *most* error fingerprints to: -unterminated_arglist(int a_lineno, char *a_line, char *a_cptr) +unterminated_arglist(const struct ainfo *a) - Cast new args to unsigned char * main.c: changes from NetBSD - Add some more bison stuff to make the mesa/gallium parser work: %initial-action (add missing source struct member in location) %debug (unimplemented) %error-verbose (unimplemented) This changes some existing code: + yylloc is now a pointer, so + the first parameter to YYERROR_DECL() is a pointer + struct YYLTYPE now has a "source" field * error.c: adapted from NetBSD - Convert *most* error fingerprints to: -unterminated_arglist(int a_lineno, char *a_line, char *a_cptr) +unterminated_arglist(const struct ainfo *a) - Cast new args to unsigned char * mstring.c: adapted change from NetBSD to add casts for ctype macros * test/btyacc/btyacc_demo.tab.h, test/btyacc/err_inherit4.tab.h: regen * output.c: reorder to eliminate a forward-reference 2016-12-02 Tom.Shields * output.c: modify output to enable compilation of a lexer generated by flex (using "%option bison-bridge" and "%option bison-locations") to be used with a parser generated by b(t)yacc (using directives "%locations" and "%pure-parser"). 2016-12-02 Thomas E. Dickey * configure: regen * aclocal.m4: Improved autoconf macros CF_CC_ENV_FLAGS + improve split between compiler and options, prompted by report where user had "ccache" before the compiler + leave non-preprocessor options in "$CC" (but still copy them to "$CFLAGS" since that's where they should be) CF_GNU_SOURCE,v + recent glibc (Debian 2.23-4 for example) has misordered ifdef/checks for new symbol _DEFAULT_SOURCE, producing warning messages when only _GNU_SOURCE is defined. Add a followup check to define _DEFAULT_SOURCE. CF_XOPEN_SOURCE + add "uclinux" to list of Linux's (patch by Yann E. Morin) + use _GNU_SOURCE for cygwin headers + build-fixes for OS/2 * VERSION, package/byacc.spec, package/debian/changelog, package/mingw-byacc.spec, package/pkgsrc/Makefile: bump 2016-11-20 Thomas E. Dickey * config.sub: 2016-11-19 * config.guess: 2016-10-02 2016-06-06 Thomas E. Dickey * configure: regen * aclocal.m4: improved autoconf macros: CF_CC_ENV_FLAGS - don't limit the check to -I, -U and -D options, since the added options can include various compiler options before and after preprocessor options. CF_PROG_LINT - add cpplint to programs to use; drop ad hoc tdlint and alint. * VERSION, package/byacc.spec, package/debian/changelog, package/mingw-byacc.spec, package/pkgsrc/Makefile: bump * lalr.c: indented * btyaccpar.c: regen * skel2c: adjust whitespace so that generated skeleton will follow the same format as other code * mkpar.c, verbose.c, lr0.c, reader.c, error.c, output.c: indented * reader.c: fix two compiler warnings * test/btyacc/inherit2.tab.c, test/btyacc/ok_syntax1.tab.c, test/btyacc/pure_calc.tab.c, test/btyacc/pure_error.tab.c, test/btyacc/quote_calc-s.tab.c, test/btyacc/quote_calc.tab.c, test/btyacc/quote_calc2-s.tab.c, test/btyacc/quote_calc2.tab.c, test/btyacc/quote_calc3-s.tab.c, test/btyacc/quote_calc3.tab.c, test/btyacc/quote_calc4-s.tab.c, test/btyacc/quote_calc4.tab.c, test/btyacc/varsyntax_calc1.tab.c, test/btyacc/err_syntax12.tab.c, test/btyacc/err_syntax18.tab.c, test/btyacc/err_syntax20.tab.c, test/btyacc/error.tab.c, test/btyacc/grammar.tab.c, test/btyacc/inherit0.tab.c, test/btyacc/inherit1.tab.c, test/btyacc/btyacc_calc1.tab.c, test/btyacc/btyacc_demo.tab.c, test/btyacc/btyacc_destroy1.tab.c, test/btyacc/btyacc_destroy2.tab.c, test/btyacc/btyacc_destroy3.tab.c, test/btyacc/calc.tab.c, test/btyacc/calc1.tab.c, test/btyacc/calc2.tab.c, test/btyacc/calc3.tab.c, test/btyacc/code_calc.code.c, test/btyacc/code_error.code.c, test/btyacc/empty.tab.c, test/btyacc/err_inherit3.tab.c, test/btyacc/err_inherit4.tab.c, test/btyacc/err_syntax10.tab.c, test/btyacc/err_syntax11.tab.c, test/btyacc/rename_debug.c, btyaccpar.c, test/yacc/quote_calc2-s.tab.c, test/yacc/quote_calc2.tab.c, test/yacc/quote_calc3-s.tab.c, test/yacc/quote_calc3.tab.c, test/yacc/quote_calc4-s.tab.c, test/yacc/quote_calc4.tab.c, test/yacc/varsyntax_calc1.tab.c, test/yacc/err_syntax20.tab.c, test/yacc/error.tab.c, test/yacc/grammar.tab.c, test/yacc/ok_syntax1.tab.c, test/yacc/pure_calc.tab.c, test/yacc/pure_error.tab.c, test/yacc/quote_calc-s.tab.c, test/yacc/quote_calc.tab.c, test/yacc/calc.tab.c, test/yacc/calc1.tab.c, test/yacc/calc2.tab.c, test/yacc/calc3.tab.c, test/yacc/code_calc.code.c, test/yacc/code_error.code.c, test/yacc/empty.tab.c, test/yacc/err_syntax10.tab.c, test/yacc/err_syntax11.tab.c, test/yacc/err_syntax12.tab.c, test/yacc/err_syntax18.tab.c, test/yacc/rename_debug.c, yaccpar.c: regen 2016-06-06 Tom.Shields * btyaccpar.skel, yaccpar.skel: small fix for an edge case of initialized data in Chris Dodd's btyacc changes: "Avoid crash when input pops up an Action error at the first token" 2016-06-01 Thomas E. Dickey * test/yacc/quote_calc2-s.tab.c, test/yacc/quote_calc3-s.tab.c, test/yacc/quote_calc3.tab.c, test/yacc/quote_calc4-s.tab.c, test/yacc/quote_calc4.tab.c, test/yacc/varsyntax_calc1.tab.c, test/yacc/err_syntax18.tab.c, test/yacc/err_syntax20.tab.c, test/yacc/err_syntax24.error, test/yacc/error.tab.c, test/yacc/grammar.tab.c, test/yacc/ok_syntax1.tab.c, test/yacc/pure_calc.tab.c, test/yacc/pure_error.tab.c, test/yacc/quote_calc-s.tab.c, test/yacc/quote_calc.tab.c, test/yacc/quote_calc2.tab.c, test/yacc/calc.tab.c, test/yacc/calc1.tab.c, test/yacc/calc2.tab.c, test/yacc/calc3.tab.c, test/yacc/code_calc.code.c, test/yacc/code_calc.tab.c, test/yacc/code_calc.tab.h, test/yacc/code_error.code.c, test/yacc/empty.tab.c, test/yacc/err_syntax10.tab.c, test/yacc/err_syntax11.tab.c, test/yacc/err_syntax12.tab.c, test/yacc/rename_debug.c, yaccpar.c, test/btyacc/quote_calc-s.tab.c, test/btyacc/quote_calc.tab.c, test/btyacc/quote_calc2-s.tab.c, test/btyacc/quote_calc2.tab.c, test/btyacc/quote_calc3-s.tab.c, test/btyacc/quote_calc3.tab.c, test/btyacc/quote_calc4-s.tab.c, test/btyacc/quote_calc4.tab.c, test/btyacc/varsyntax_calc1.tab.c, test/btyacc/err_syntax13.tab.c, test/btyacc/err_syntax14.tab.c, test/btyacc/err_syntax15.tab.c, test/btyacc/err_syntax16.tab.c, test/btyacc/err_syntax17.tab.c, test/btyacc/err_syntax18.tab.c, test/btyacc/err_syntax19.tab.c, test/btyacc/err_syntax2.tab.c, test/btyacc/err_syntax20.tab.c, test/btyacc/err_syntax21.tab.c, test/btyacc/err_syntax22.tab.c, test/btyacc/err_syntax23.tab.c, test/btyacc/err_syntax24.error, test/btyacc/err_syntax24.tab.c, test/btyacc/err_syntax25.tab.c, test/btyacc/err_syntax26.tab.c, test/btyacc/err_syntax27.tab.c, test/btyacc/err_syntax3.tab.c, test/btyacc/err_syntax4.tab.c, test/btyacc/err_syntax5.tab.c, test/btyacc/err_syntax6.tab.c, test/btyacc/err_syntax7.tab.c, test/btyacc/err_syntax7a.tab.c, test/btyacc/err_syntax7b.tab.c, test/btyacc/err_syntax8.tab.c, test/btyacc/err_syntax8a.tab.c, test/btyacc/err_syntax9.tab.c, test/btyacc/error.tab.c, test/btyacc/grammar.tab.c, test/btyacc/inherit0.tab.c, test/btyacc/inherit1.tab.c, test/btyacc/inherit2.output, test/btyacc/inherit2.tab.c, test/btyacc/ok_syntax1.tab.c, test/btyacc/pure_calc.tab.c, test/btyacc/pure_error.tab.c, test/btyacc/btyacc_calc1.tab.c, test/btyacc/btyacc_demo.error, test/btyacc/btyacc_demo.output, test/btyacc/btyacc_demo.tab.c, test/btyacc/btyacc_destroy1.tab.c, test/btyacc/btyacc_destroy2.tab.c, test/btyacc/btyacc_destroy3.tab.c, test/btyacc/calc.tab.c, test/btyacc/calc1.tab.c, test/btyacc/calc2.tab.c, test/btyacc/calc3.tab.c, test/btyacc/code_calc.code.c, test/btyacc/code_calc.tab.c, test/btyacc/code_calc.tab.h, test/btyacc/code_error.code.c, test/btyacc/empty.tab.c, test/btyacc/err_inherit1.tab.c, test/btyacc/err_inherit2.tab.c, test/btyacc/err_inherit3.output, test/btyacc/err_inherit3.tab.c, test/btyacc/err_inherit4.output, test/btyacc/err_inherit4.tab.c, test/btyacc/err_inherit5.tab.c, test/btyacc/err_syntax1.tab.c, test/btyacc/err_syntax10.tab.c, test/btyacc/err_syntax11.tab.c, test/btyacc/err_syntax12.tab.c, test/btyacc/rename_debug.c, btyaccpar.c: regen 2016-06-01 Tom.Shields * btyaccpar.skel, defs.h, error.c, output.c, reader.c, test/code_calc.y, test/err_inherit4.y, test/run_make.sh, yaccpar.skel: fixes for issues in btyacc (report by Francis Andre): + correction to the placement of the #line directive for a %union specification + recovery of a set of casts originally added into btyaccpar.c rather than into btyaccpar.skel, and so are lost whenever building from scratch + Chris Dodd's btyacc improved handling of inherited attributes to eliminate implicit empty copy rules that are not necessary, and thereby avoiding the introduction of extra parsing ambiguity + Chris Dodd's added support for @-N syntax to reference inherited position information + correction to bad interaction between %token-table and YYDEBUG, where YYDEBUG was required to be defined in order to compile the generated code + correction to yyname[] access in code included with YYDEBUG defined for single character symbols not recognized (e.g., input containing '&' character where grammar doesn't define that as a symbol) - map to existing "illegal-symbol" entry in byname[] + fixes to test/run_make.sh: skip test-err_* files; in the bison test phase skip additional files that contain features not supported by bison and inhibit new bison warning messages + minor changes to btyaccpar.skel & yaccpar.skel so they are more similar in their commonality; makes it easier to maintain the pair of files using vimdiff + changes to a couple of test cases for coverage of #3, #4 and #5 above 2016-06-01 Thomas E. Dickey * VERSION, package/byacc.spec, package/debian/changelog, package/mingw-byacc.spec, package/pkgsrc/Makefile: bump 2016-03-24 Thomas E. Dickey * reader.c: unused variable * package/pkgsrc/Makefile, package/debian/copyright: bump 2016-03-24 Jung-uk.Kim * main.c: correct logic for finding output suffix in the "-o" option, which matched the first occurrence of ".c" in the name in 2005-08-13 changes rather than at the end of the filename (patch by Jung-uk Kim) 2016-03-24 Thomas E. Dickey * aclocal.m4: update CF_WITH_MAN2HTML to use configured shell rather than /bin/sh * VERSION, package/byacc.spec, package/debian/changelog, package/mingw-byacc.spec, package/pkgsrc/Makefile: bump 2016-01-25 Thomas E. Dickey * config.guess, config.sub: 2016-01-01 2015-07-10 Thomas E. Dickey * lr0.c: fix a duplicate-free in the leak-checking * VERSION, package/byacc.spec, package/debian/changelog, package/mingw-byacc.spec, package/pkgsrc/Makefile: bump * reader.c: make cache-size clearer (prompted by discussion with Pedro Giffuni, Oliver Pinter) * main.c: make relationship with format/size clearer (prompted by discussion with Pedro Giffuni, Oliver Pinter) 2015-07-05 Thomas E. Dickey * configure: regen * package/pkgsrc/Makefile, package/mingw-byacc.spec, package/debian/copyright, package/debian/changelog, package/byacc.spec, VERSION: bump * aclocal.m4: resync with my-autoconf add configure option --with-man2html * makefile.in: add configure options --with-man2html * configure.in: add configure option --with-man2html 2015-05-02 Thomas E. Dickey * config.guess: 2015-03-04 * config.sub: 2015-03-08 2014-11-28 Thomas E. Dickey * lr0.c: coverity #39181: memory leak * VERSION, package/byacc.spec, package/debian/changelog, package/mingw-byacc.spec, package/pkgsrc/Makefile: bump 2014-11-13 Jouk.Jansen * descrip.mms: I sucessfully compiled byacc on my OpenVMS systems. However, I had to update the descrip.mms to include some extra c-source files and some dependenxcies so that it also works when the distribution is located on an ODS5 disk. The patched descrip.mms file can be found at: http://nchrem.tnw.tudelft.nl/openvms/software2.html#BYACC Please feel free to insert the file in your distribution. Regards Jouk. 2014-10-06 Thomas E. Dickey * package/debian/source/format: change to native format to work around regression in Debian packaging. * VERSION, package/byacc.spec, package/debian/changelog, package/mingw-byacc.spec, package/pkgsrc/Makefile: bump * configure: regen * main.c: correct parameter for umask - for very old mkstemp's - and use type mode_t to quiet compiler warning * configure.in: add configure check for mode_t * reader.c: better fix for get_line, by ensuring there is enough space to null-terminate its result (prompted by discussion with Craig Rodrigues). 2014-10-05 Thomas E. Dickey * main.c: make change to umask before calling mkstemp, as suggested in Coverity #56902 * reader.c: adjust logic in copy_action to avoid potential null-pointer dereference (Coverity #56901) * reader.c: adjust logic to avoid potential null-pointer dereference in compile_args (Coverity #63407) * reader.c: eliminate strcpy into fixed-size buffer (Coverity #63408) * yacc.1: document changes made with respect to %parse-param * output.c: add parameters from %parse-param to destructor. The order of the parameters is intentionally inconsistent with yyparse/yyerror, for "compatibility" with bison. * test/btyacc/btyacc_destroy1.tab.c, test/btyacc/btyacc_destroy2.tab.c, test/btyacc/btyacc_destroy3.tab.c: regen * output.c: use puts_param_types/puts_param_names to output lex_param data. * test/btyacc/ok_syntax1.tab.c, test/btyacc/calc2.tab.c, test/btyacc/calc3.tab.c, test/yacc/ok_syntax1.tab.c, test/yacc/calc2.tab.c, test/yacc/calc3.tab.c, test/btyacc/error.tab.c, test/btyacc/grammar.tab.c, test/btyacc/inherit0.tab.c, test/btyacc/inherit1.tab.c, test/btyacc/inherit2.tab.c, test/btyacc/pure_calc.tab.c, test/btyacc/pure_error.tab.c, test/btyacc/quote_calc-s.tab.c, test/btyacc/quote_calc.tab.c, test/btyacc/quote_calc2-s.tab.c, test/btyacc/quote_calc2.tab.c, test/btyacc/quote_calc3-s.tab.c, test/btyacc/quote_calc3.tab.c, test/btyacc/quote_calc4-s.tab.c, test/btyacc/quote_calc4.tab.c, test/btyacc/varsyntax_calc1.tab.c, test/btyacc/btyacc_calc1.tab.c, test/btyacc/btyacc_demo.tab.c, test/btyacc/calc.tab.c, test/btyacc/calc1.tab.c, test/btyacc/code_calc.code.c, test/btyacc/code_error.code.c, test/btyacc/empty.tab.c, test/btyacc/err_inherit3.tab.c, test/btyacc/err_inherit4.tab.c, test/btyacc/err_syntax10.tab.c, test/btyacc/err_syntax11.tab.c, test/btyacc/err_syntax12.tab.c, test/btyacc/err_syntax18.tab.c, test/btyacc/err_syntax20.tab.c, test/btyacc/rename_debug.c: regen * btyaccpar.c: add casts, change types to fix strict compiler warnings * test/btyacc/err_syntax17.tab.c, test/btyacc/err_syntax19.tab.c, test/btyacc/err_syntax2.tab.c, test/btyacc/err_syntax21.tab.c, test/btyacc/err_syntax22.tab.c, test/btyacc/err_syntax23.tab.c, test/btyacc/err_syntax24.tab.c, test/btyacc/err_syntax25.tab.c, test/btyacc/err_syntax26.tab.c, test/btyacc/err_syntax27.tab.c, test/btyacc/err_syntax3.tab.c, test/btyacc/err_syntax4.tab.c, test/btyacc/err_syntax5.tab.c, test/btyacc/err_syntax6.tab.c, test/btyacc/err_syntax7.tab.c, test/btyacc/err_syntax7a.tab.c, test/btyacc/err_syntax7b.tab.c, test/btyacc/err_syntax8.tab.c, test/btyacc/err_syntax8a.tab.c, test/btyacc/err_syntax9.tab.c, test/btyacc/err_inherit1.tab.c, test/btyacc/err_inherit2.tab.c, test/btyacc/err_inherit5.tab.c, test/btyacc/err_syntax1.tab.c, test/btyacc/err_syntax13.tab.c, test/btyacc/err_syntax14.tab.c, test/btyacc/err_syntax15.tab.c, test/btyacc/err_syntax16.tab.c: regen * output.c: gcc-warning * test/btyacc/code_calc.tab.c, test/btyacc/code_error.tab.c: regen * output.c: fix limit when merging real/workaround tables * output.c: for btyacc, it is possible to have no conflicts - but in that case, the "ctable" was not generated at all, while the skeleton uses the table. The most straightforward (workaround) is generating a dummy table which rejects any state. * test/btyacc_destroy3.y, test/btyacc_destroy2.y, test/btyacc_destroy1.y: fix "make check_make" * test/yacc/calc3.tab.c, test/yacc/ok_syntax1.tab.c, test/yacc/calc2.tab.c, test/btyacc/btyacc_destroy1.tab.c, test/btyacc/btyacc_destroy2.tab.c: regen * reader.c: trim blanks from interim value in copy_param() to handle special case when a space precedes a comma. * output.c: use two new functions, puts_param_types and puts_param_names, to improve format of the parse_param list (by trimming space after "*") as well as correcting the output of the comma-separated names (only the last name was output). * test/btyacc/ok_syntax1.tab.c, test/btyacc/btyacc_destroy3.tab.c, test/btyacc/calc2.tab.c, test/btyacc/calc3.tab.c: regen * reader.c: modify copy_param() to handle resulting comma-separated list. Before, it only expected a single parameter. 2014-10-04 Thomas E. Dickey * reader.c: split-out save_param() from copy_param() * reader.c: trim_blanks() did not always convert spaces - fix. * reader.c: fix some minor regressions with error-reporting * aclocal.m4: update CF_XOPEN_SOURCE for Unixware change from lynx * VERSION, package/byacc.spec, package/debian/changelog, package/mingw-byacc.spec, package/pkgsrc/Makefile: bump * reader.c: modify copy_param() to accept multiple parameters, each in curly braces like recent bison, as well as honoring bison's undocumented feature to accept the parameters as a comma-separated list. * test/btyacc/btyacc_destroy3.tab.c, test/btyacc/btyacc_destroy1.tab.c, test/btyacc/btyacc_destroy2.tab.c, test/btyacc/btyacc_destroy3.error, test/btyacc/btyacc_destroy3.output, test/btyacc/btyacc_destroy3.tab.h, test/btyacc/btyacc_destroy2.error, test/btyacc/btyacc_destroy2.output, test/btyacc/btyacc_destroy2.tab.h: RCS_BASE 2014-10-03 Thomas E. Dickey * test/btyacc/btyacc_demo2.error, test/btyacc/btyacc_demo2.output, test/btyacc/btyacc_demo2.tab.c, test/btyacc/btyacc_demo2.tab.h, test/btyacc/btyacc_destroy1.error, test/btyacc/btyacc_destroy1.output, test/btyacc/btyacc_destroy1.tab.h, test/btyacc_destroy3.y, test/btyacc_destroy1.y, test/btyacc_destroy2.y: RCS_BASE 2014-10-02 Thomas E. Dickey * main.c, reader.c, defs.h: use calloc in get_line() when allocating line to ensure it is fully initialized, fixes a later uninitialized value in copy_param() (FreeBSD #193499). 2014-09-17 Thomas E. Dickey * closure.c, lalr.c, output.c, defs.h: rephrase odd addressing to fix Coverity #48848, #38950, #38860, not actually a bug. 2014-09-01 Thomas E. Dickey * config.sub: update to 2014-07-28 2014-07-27 Thomas E. Dickey * configure: regen * aclocal.m4: modified to support port to Minix3.2 * package/pkgsrc/Makefile, VERSION, package/byacc.spec, package/debian/changelog, package/mingw-byacc.spec: bump 2014-07-15 Thomas E. Dickey * aclocal.m4: resync with my-autoconf (no change to configure script) * VERSION, package/byacc.spec, package/debian/changelog, package/mingw-byacc.spec, package/pkgsrc/Makefile: bump * test/run_test.sh: make top-level "make check" work again, by adding another step to filtering the test results. 2014-07-14 Thomas E. Dickey * test/run_test.sh: changes from Garrett Cooper's patch: a) ensure that the script returns an error-code if there are differences b) escape "." character in left side of sed expression for $YACC c) ensure that $ifBTYACC has a value * test/btyacc/big_b.output, test/btyacc/big_l.output, test/btyacc/help.output, test/btyacc/no_b_opt.output, test/btyacc/no_output2.output, test/btyacc/no_p_opt.output, test/btyacc/nostdin.output: regen (reminder by Garrett Cooper) 2014-07-14 Garrett.Cooper * test/btyacc/err_inherit1.error, test/btyacc/err_inherit2.error, test/btyacc/err_inherit3.error, test/btyacc/err_inherit4.error, test/btyacc/err_inherit5.error, test/btyacc/err_syntax1.error, test/btyacc/err_syntax10.error, test/btyacc/err_syntax11.error, test/btyacc/err_syntax12.error, test/btyacc/err_syntax13.error, test/btyacc/err_syntax14.error, test/btyacc/err_syntax15.error, test/btyacc/err_syntax16.error, test/btyacc/err_syntax17.error, test/btyacc/err_syntax18.error, test/btyacc/err_syntax19.error, test/btyacc/err_syntax2.error, test/btyacc/err_syntax21.error, test/btyacc/err_syntax22.error, test/btyacc/err_syntax23.error, test/btyacc/err_syntax24.error, test/btyacc/err_syntax25.error, test/btyacc/err_syntax26.error, test/btyacc/err_syntax27.error, test/btyacc/err_syntax3.error, test/btyacc/err_syntax4.error, test/btyacc/err_syntax5.error, test/btyacc/err_syntax6.error, test/btyacc/err_syntax7.error, test/btyacc/err_syntax7a.error, test/btyacc/err_syntax7b.error, test/btyacc/err_syntax8.error, test/btyacc/err_syntax8a.error, test/btyacc/err_syntax9.error, test/yacc/err_syntax1.error, test/yacc/err_syntax10.error, test/yacc/err_syntax11.error, test/yacc/err_syntax12.error, test/yacc/err_syntax13.error, test/yacc/err_syntax14.error, test/yacc/err_syntax15.error, test/yacc/err_syntax16.error, test/yacc/err_syntax17.error, test/yacc/err_syntax18.error, test/yacc/err_syntax19.error, test/yacc/err_syntax2.error, test/yacc/err_syntax21.error, test/yacc/err_syntax22.error, test/yacc/err_syntax23.error, test/yacc/err_syntax24.error, test/yacc/err_syntax25.error, test/yacc/err_syntax26.error, test/yacc/err_syntax27.error, test/yacc/err_syntax3.error, test/yacc/err_syntax4.error, test/yacc/err_syntax5.error, test/yacc/err_syntax6.error, test/yacc/err_syntax7.error, test/yacc/err_syntax7a.error, test/yacc/err_syntax7b.error, test/yacc/err_syntax8.error, test/yacc/err_syntax8a.error, test/yacc/err_syntax9.error: regen 2014-05-27 Tom.Shields * main.c: remove obsolete -D option from usage message 2014-05-27 Thomas E. Dickey * VERSION, package/byacc.spec, package/debian/changelog, test/yacc/big_b.output, test/yacc/big_l.output, test/yacc/help.output, test/yacc/no_b_opt.output, test/yacc/no_output2.output, test/yacc/no_p_opt.output, test/yacc/nostdin.output: bump 2014-04-22 Thomas E. Dickey * mstring.c: use vsnprintf() to ensure that msprintf's buffer is large enough. * main.c, defs.h: add mstring_leaks() * configure: regen * output.c: fix a complementary warning * mstring.c: introduce vsnprintf * configure.in, config_h.in: add check for vsnprintf * output.c: quiet a type-conversion warning * mstring.c: fix a potential memory leak on ENOMEM quiet a couple of type-conversion warnings * defs.h: add/use GCC_PRINTFLIKE for msprintf() 2014-04-22 Tom.Shields * README.BTYACC: drop "NOTES-btyacc-Changes" and "NOTES-btyacc-Disposition", merging relevant content into README.BTYACC 2014-04-22 Thomas E. Dickey * package/pkgsrc/Makefile, VERSION, package/byacc.spec, package/debian/changelog, package/mingw-byacc.spec: bump 2014-04-19 Thomas E. Dickey * config.sub: 2014-04-03 * config.guess: 2014-03-23 2014-04-09 Rick.Spates * main.c, defs.h: patch to allow DEBUG build with WIN32 system 2014-04-09 Thomas E. Dickey * output.c, reader.c: gcc warnings * reader.c: fix const-cast warnings * test/btyacc/quote_calc-s.tab.c, test/btyacc/quote_calc.tab.c, test/btyacc/quote_calc3-s.tab.c, test/btyacc/quote_calc4-s.tab.c, test/btyacc/quote_calc4.tab.c, test/btyacc/varsyntax_calc1.tab.c, test/btyacc/grammar.tab.c, test/btyacc/inherit0.tab.c, test/btyacc/inherit1.tab.c, test/btyacc/inherit2.tab.c, test/btyacc/ok_syntax1.tab.c, test/btyacc/pure_calc.tab.c, test/btyacc/pure_error.tab.c, test/btyacc/quote_calc2-s.tab.c, test/btyacc/quote_calc2.tab.c, test/btyacc/quote_calc3.tab.c, test/btyacc/err_syntax18.tab.c, test/btyacc/err_syntax20.tab.c, test/btyacc/code_error.tab.c, test/btyacc/empty.tab.c, test/btyacc/err_inherit3.tab.c, test/btyacc/err_inherit4.tab.c, test/btyacc/err_syntax10.tab.c, test/btyacc/err_syntax11.tab.c, test/btyacc/err_syntax12.tab.c, test/btyacc/error.tab.c, test/btyacc/rename_debug.c, test/btyacc/calc.tab.c, test/btyacc/calc1.tab.c, test/btyacc/calc2.tab.c, test/btyacc/calc3.tab.c, test/btyacc/code_calc.tab.c, output.c: fix a few clang --analyze warnings; one was a case where output_ctable emitted an empty table (which should be an error). * reader.c: appease clang --analyze * defs.h: mark two functions as no-return. * package/debian/changelog: reason for release * VERSION, package/byacc.spec, package/debian/changelog, package/mingw-byacc.spec, package/pkgsrc/Makefile: bump * makefile.in: use $LINT_OPTS from environment via configure script * test/btyacc/ok_syntax1.output, test/btyacc/ok_syntax1.tab.c, test/yacc/ok_syntax1.tab.c, test/ok_syntax1.y, test/yacc/ok_syntax1.output: tweaks to make generated files from ok_syntax1.y compile with check_make rule * test/btyacc/rename_debug.c, test/btyacc/rename_debug.error, test/btyacc/rename_debug.h, test/btyacc/rename_debug.i, test/btyacc/rename_debug.output, test/yacc/rename_debug.c: reference output for testing * test/run_test.sh: retain the renaming done for code_debug.y so that check_make will work. * test/yacc/rename_debug.error, test/yacc/rename_debug.h, test/yacc/rename_debug.i, test/yacc/rename_debug.output: reference output for testing * test/btyacc/ok_syntax1.error: RCS_BASE * test/yacc/quote_calc4-s.tab.c, test/yacc/varsyntax_calc1.tab.c, test/yacc/code_error.code.c, test/yacc/empty.tab.c, test/yacc/err_syntax10.tab.c, test/yacc/err_syntax11.tab.c, test/yacc/err_syntax12.tab.c, test/yacc/err_syntax18.tab.c, test/yacc/err_syntax20.tab.c, test/yacc/error.tab.c, test/yacc/grammar.tab.c, test/yacc/ok_syntax1.tab.c, test/yacc/pure_calc.tab.c, test/yacc/pure_error.tab.c, test/yacc/quote_calc-s.tab.c, test/yacc/quote_calc.tab.c, test/yacc/quote_calc2-s.tab.c, test/yacc/quote_calc2.tab.c, test/yacc/quote_calc3-s.tab.c, test/yacc/quote_calc3.tab.c, test/yacc/quote_calc4.tab.c, test/yacc/calc.tab.c, test/yacc/calc1.tab.c, test/yacc/calc2.tab.c, test/yacc/calc3.tab.c, test/yacc/code_calc.code.c, yaccpar.c: regen * yacc.1: clarify relationship of btyacc features to default configuration. 2014-04-08 Thomas E. Dickey * test/yacc/ok_syntax1.output, test/yacc/ok_syntax1.tab.c, test/yacc/ok_syntax1.tab.h, test/btyacc/ok_syntax1.output, test/btyacc/ok_syntax1.tab.c, test/btyacc/ok_syntax1.tab.h: reference output for testing * test/ok_syntax1.y: RCS_BASE * test/yacc/ok_syntax1.error: reference output for testing * test/yacc/big_b.error, test/yacc/big_b.output, test/yacc/big_l.error, test/yacc/big_l.output, test/btyacc/big_b.error, test/btyacc/big_b.output, test/btyacc/big_l.error, test/btyacc/big_l.output, test/run_test.sh: exercise -L/-B options * test/yacc/code_debug.c, test/btyacc/code_debug.c, test/yacc/err_syntax15.tab.c, test/yacc/err_syntax16.tab.c, test/yacc/err_syntax17.tab.c, test/yacc/err_syntax18.tab.c, test/yacc/err_syntax19.tab.c, test/yacc/err_syntax2.tab.c, test/yacc/err_syntax20.tab.c, test/yacc/err_syntax21.tab.c, test/yacc/err_syntax22.tab.c, test/yacc/err_syntax23.tab.c, test/yacc/err_syntax24.tab.c, test/yacc/err_syntax25.tab.c, test/yacc/err_syntax26.tab.c, test/yacc/err_syntax27.tab.c, test/yacc/err_syntax3.tab.c, test/yacc/err_syntax4.tab.c, test/yacc/err_syntax5.tab.c, test/yacc/err_syntax6.tab.c, test/yacc/err_syntax7.tab.c, test/yacc/err_syntax7a.tab.c, test/yacc/err_syntax7b.tab.c, test/yacc/err_syntax8.tab.c, test/yacc/err_syntax8a.tab.c, test/yacc/err_syntax9.tab.c, test/yacc/error.tab.c, test/yacc/grammar.tab.c, test/yacc/pure_calc.tab.c, test/yacc/pure_error.tab.c, test/yacc/quote_calc-s.tab.c, test/yacc/quote_calc.tab.c, test/yacc/quote_calc2-s.tab.c, test/yacc/quote_calc2.tab.c, test/yacc/quote_calc3-s.tab.c, test/yacc/quote_calc3.tab.c, test/yacc/quote_calc4-s.tab.c, test/yacc/quote_calc4.tab.c, test/yacc/varsyntax_calc1.tab.c, test/yacc/calc.tab.c, test/yacc/calc1.tab.c, test/yacc/calc2.tab.c, test/yacc/calc3.tab.c, test/yacc/code_calc.code.c, test/yacc/code_error.code.c, test/yacc/empty.tab.c, test/yacc/err_syntax1.tab.c, test/yacc/err_syntax10.tab.c, test/yacc/err_syntax11.tab.c, test/yacc/err_syntax12.tab.c, test/yacc/err_syntax13.tab.c, test/yacc/err_syntax14.tab.c, test/btyacc/err_syntax13.tab.c, test/btyacc/err_syntax14.tab.c, test/btyacc/err_syntax15.tab.c, test/btyacc/err_syntax16.tab.c, test/btyacc/err_syntax17.tab.c, test/btyacc/err_syntax18.tab.c, test/btyacc/err_syntax19.tab.c, test/btyacc/err_syntax2.tab.c, test/btyacc/err_syntax20.tab.c, test/btyacc/err_syntax21.tab.c, test/btyacc/err_syntax22.tab.c, test/btyacc/err_syntax23.tab.c, test/btyacc/err_syntax24.tab.c, test/btyacc/err_syntax25.tab.c, test/btyacc/err_syntax26.tab.c, test/btyacc/err_syntax27.tab.c, test/btyacc/err_syntax3.tab.c, test/btyacc/err_syntax4.tab.c, test/btyacc/err_syntax5.tab.c, test/btyacc/err_syntax6.tab.c, test/btyacc/err_syntax7.tab.c, test/btyacc/err_syntax7a.tab.c, test/btyacc/err_syntax7b.tab.c, test/btyacc/err_syntax8.tab.c, test/btyacc/err_syntax8a.tab.c, test/btyacc/err_syntax9.tab.c, test/btyacc/error.tab.c, test/btyacc/grammar.tab.c, test/btyacc/inherit0.tab.c, test/btyacc/inherit1.tab.c, test/btyacc/inherit2.tab.c, test/btyacc/pure_error.tab.c, test/btyacc/btyacc_demo.tab.c, test/btyacc/code_error.code.c, test/btyacc/empty.tab.c, test/btyacc/err_inherit1.tab.c, test/btyacc/err_inherit2.tab.c, test/btyacc/err_inherit3.tab.c, test/btyacc/err_inherit4.tab.c, test/btyacc/err_inherit5.tab.c, test/btyacc/err_syntax1.tab.c, test/btyacc/err_syntax10.tab.c, test/btyacc/err_syntax11.tab.c, test/btyacc/err_syntax12.tab.c, test/btyacc/pure_calc.tab.c, test/btyacc/quote_calc-s.tab.c, test/btyacc/quote_calc.tab.c, test/btyacc/quote_calc2-s.tab.c, test/btyacc/quote_calc2.tab.c, test/btyacc/quote_calc3-s.tab.c, test/btyacc/quote_calc3.tab.c, test/btyacc/quote_calc4-s.tab.c, test/btyacc/quote_calc4.tab.c, test/btyacc/varsyntax_calc1.tab.c, test/btyacc/btyacc_calc1.tab.c, test/btyacc/calc.tab.c, test/btyacc/calc1.tab.c, test/btyacc/calc2.tab.c, test/btyacc/calc3.tab.c, test/btyacc/code_calc.code.c, test/run_test.sh, test/yacc/no_b_opt1.output: use a better renaming of the YYPATCH definition (none of the test-cases rely upon it, but redefinition in the "make check_make" rule is a problem). * test/btyacc/err_syntax1.tab.c, test/btyacc/err_syntax13.tab.c, test/btyacc/err_syntax2.tab.c, test/btyacc/err_syntax25.tab.c, test/btyacc/err_syntax26.tab.c, test/btyacc/err_syntax27.tab.c, test/btyacc/err_syntax3.tab.c, test/btyacc/err_syntax4.tab.c, test/btyacc/err_syntax5.tab.c, test/btyacc/err_syntax6.tab.c, test/btyacc/err_syntax7.tab.c, test/btyacc/err_syntax7a.tab.c, test/btyacc/err_syntax7b.tab.c, test/btyacc/err_syntax8.tab.c, test/btyacc/err_syntax8a.tab.c, test/btyacc/err_syntax9.tab.c, test/btyacc/varsyntax_calc1.tab.c: undid temporary reordering in reader() by Tom Shields to align with byacc outputs * test/run_test.sh: remove a repeated test-case * mstring.c: minor reformatting to make coverage analysis simpler 2014-04-07 Thomas E. Dickey * test/run_test.sh: tidy * test/yacc/help.error, test/yacc/help.output, test/yacc/no_b_opt.error, test/yacc/no_b_opt.output, test/yacc/no_b_opt1.error, test/yacc/no_b_opt1.output, test/yacc/no_code_c.error, test/yacc/no_code_c.output, test/yacc/no_defines.error, test/yacc/no_defines.output, test/yacc/no_graph.error, test/yacc/no_graph.output, test/yacc/no_include.error, test/yacc/no_include.output, test/yacc/no_opts.error, test/yacc/no_opts.output, test/yacc/no_output.error, test/yacc/no_output.output, test/yacc/no_output1.error, test/yacc/no_output1.output, test/yacc/no_output2.error, test/yacc/no_output2.output, test/yacc/no_p_opt.error, test/yacc/no_p_opt.output, test/yacc/no_p_opt1.error, test/yacc/no_p_opt1.output, test/yacc/no_verbose.error, test/yacc/no_verbose.output, test/yacc/nostdin.error, test/yacc/nostdin.output, test/yacc/test-no_b_opt1.output: reference output for testing * test/run_test.sh: add special checks for flags which depend on writable/existing files * test/btyacc/no_b_opt1.output, test/btyacc/no_p_opt1.output, test/btyacc/no_b_opt.error, test/btyacc/no_b_opt.output, test/btyacc/no_b_opt1.error, test/btyacc/no_code_c.output, test/btyacc/no_p_opt.error, test/btyacc/no_p_opt.output, test/btyacc/no_p_opt1.error, test/btyacc/no_output2.output, test/btyacc/no_code_c.error, test/btyacc/no_output2.error, test/btyacc/no_include.error, test/btyacc/no_include.output, test/btyacc/no_defines.output, test/btyacc/no_defines.error, test/btyacc/no_verbose.output, test/btyacc/no_graph.output, test/btyacc/no_graph.error, test/btyacc/no_opts.error, test/btyacc/no_opts.output, test/btyacc/no_verbose.error, test/btyacc/nostdin.error, test/btyacc/nostdin.output, test/btyacc/no_output.error, test/btyacc/no_output.output, test/btyacc/no_output1.error, test/btyacc/no_output1.output: reference output for testing * main.c: change CREATE_FILE_NAMES() to use local function rather than inline code, to simplify coverage analysis. * test/btyacc/err_syntax27.error, test/btyacc/err_syntax27.output, test/btyacc/err_syntax27.tab.c, test/btyacc/err_syntax27.tab.h, test/btyacc/help.error, test/btyacc/help.output, test/yacc/err_syntax27.error, test/yacc/err_syntax27.output, test/yacc/err_syntax27.tab.c, test/yacc/err_syntax27.tab.h: reference output for testing * test/err_syntax27.y: testcase for missing_brace() * error.c: ifdef'd non-btyacc function * lr0.c: ifdef'd debug-code * yaccpar.skel: use YYINT's to replace short's as in btyaccpar.skel * test/btyacc/code_debug.c, test/btyacc/err_syntax12.tab.c, test/btyacc/err_syntax14.tab.c, test/btyacc/err_syntax15.tab.c, test/btyacc/err_syntax16.tab.c, test/btyacc/err_syntax17.tab.c, test/btyacc/err_syntax18.tab.c, test/btyacc/err_syntax19.tab.c, test/btyacc/err_syntax20.tab.c, test/btyacc/err_syntax21.tab.c, test/btyacc/err_syntax22.tab.c, test/btyacc/err_syntax23.tab.c, test/btyacc/err_syntax24.tab.c, test/btyacc/error.tab.c, test/btyacc/grammar.tab.c, test/btyacc/inherit0.tab.c, test/btyacc/inherit1.tab.c, test/btyacc/inherit2.tab.c, test/btyacc/pure_calc.tab.c, test/btyacc/pure_error.tab.c, test/btyacc/quote_calc-s.tab.c, test/btyacc/quote_calc.tab.c, test/btyacc/quote_calc2-s.tab.c, test/btyacc/quote_calc2.tab.c, test/btyacc/quote_calc3-s.tab.c, test/btyacc/quote_calc3.tab.c, test/btyacc/quote_calc4-s.tab.c, test/btyacc/quote_calc4.tab.c, test/btyacc/varsyntax_calc1.tab.c, test/btyacc/btyacc_calc1.tab.c, test/btyacc/btyacc_demo.tab.c, test/btyacc/calc.tab.c, test/btyacc/calc1.tab.c, test/btyacc/calc2.tab.c, test/btyacc/calc3.tab.c, test/btyacc/code_calc.code.c, test/btyacc/code_error.code.c, test/btyacc/empty.tab.c, test/btyacc/err_inherit1.tab.c, test/btyacc/err_inherit2.tab.c, test/btyacc/err_inherit3.tab.c, test/btyacc/err_inherit4.tab.c, test/btyacc/err_inherit5.tab.c, test/btyacc/err_syntax10.tab.c, test/btyacc/err_syntax11.tab.c, test/yacc/err_syntax11.tab.c, test/yacc/err_syntax12.tab.c, test/yacc/err_syntax18.tab.c, test/yacc/err_syntax20.tab.c, test/yacc/error.tab.c, test/yacc/grammar.tab.c, test/yacc/pure_calc.tab.c, test/yacc/pure_error.tab.c, test/yacc/quote_calc-s.tab.c, test/yacc/quote_calc.tab.c, test/yacc/quote_calc2-s.tab.c, test/yacc/quote_calc2.tab.c, test/yacc/quote_calc3-s.tab.c, test/yacc/quote_calc3.tab.c, test/yacc/quote_calc4-s.tab.c, test/yacc/quote_calc4.tab.c, test/yacc/varsyntax_calc1.tab.c, test/yacc/calc.tab.c, test/yacc/calc1.tab.c, test/yacc/calc2.tab.c, test/yacc/calc3.tab.c, test/yacc/code_calc.code.c, test/yacc/code_debug.c, test/yacc/code_error.code.c, test/yacc/empty.tab.c, test/yacc/err_syntax10.tab.c, output.c, test/yacc/err_syntax1.tab.c, test/yacc/err_syntax13.tab.c, test/yacc/err_syntax14.tab.c, test/yacc/err_syntax15.tab.c, test/yacc/err_syntax16.tab.c, test/yacc/err_syntax17.tab.c, test/yacc/err_syntax19.tab.c, test/yacc/err_syntax2.tab.c, test/yacc/err_syntax21.tab.c, test/yacc/err_syntax22.tab.c, test/yacc/err_syntax23.tab.c, test/yacc/err_syntax24.tab.c, test/yacc/err_syntax25.tab.c, test/yacc/err_syntax26.tab.c, test/yacc/err_syntax3.tab.c, test/yacc/err_syntax4.tab.c, test/yacc/err_syntax5.tab.c, test/yacc/err_syntax6.tab.c, test/yacc/err_syntax7.tab.c, test/yacc/err_syntax7a.tab.c, test/yacc/err_syntax7b.tab.c, test/yacc/err_syntax8.tab.c, test/yacc/err_syntax8a.tab.c, test/yacc/err_syntax9.tab.c, test/run_test.sh: 2010/11/26 simplification of output.c using putc_code() and putl_code() omitted an adjustment of the #line value used for code-file. Fix that. Also, amend 2005/05/04 change to run_test.sh to retain a dummy line for YYPATCH #define's to make test-outputs easier to compare #line's (report by Tom Shields) 2014-04-06 Thomas E. Dickey * reader.c: fix for valgrind (the calloc's are intentional - valgrind reported use of uninitialized memory) * lr0.c, output.c: fix for valgrind * test/btyacc/code_debug.c, test/btyacc/code_debug.error, test/btyacc/code_debug.h, test/btyacc/code_debug.i, test/btyacc/code_debug.output: RCS_BASE * test/yacc/code_debug.c, test/yacc/code_debug.h: exercise the -i option * test/yacc/code_debug.i: reference output for testing * test/run_test.sh: exercise the -i option * test/yacc/code_debug.c: reference output for testing * test/run_test.sh: exercise the "-o" option * test/yacc/code_debug.error, test/yacc/code_debug.h, test/yacc/code_debug.output: reference output for testing * output.c: don't call exit() without giving a chance to cleanup. * mstring.c: ifdef'd functions not used in byacc * btyaccpar.c: generated from btyaccpar.skel * yaccpar.c: generated from yaccpar.skel * skel2c: change the generated-by comment to show which version of this script (and which version of the given skeleton file) were used to produce the C-file. * configure: regen * makefile.in: add rules to generate byacc and btyacc parser skeleton files independently * aclocal.m4: CF_PROG_AWK - add to byacc's configure script CF_INTEL_COMPILER cleanup the -no-gcc option which was leftover from testing - prcs does not build with this option. CF_MAKE_DOCS protect $2 from substitution, for luit's "$(manext)" CF_XOPEN_SOURCE for Solaris (tested with gcc/g++ 3.4.3 on Solaris 10 and gcc/g++ 4.5.2 on Solaris 11), suppress the followup check for defining _XOPEN_SOURCE because it is not needed, as well as because g++ 4.7.3 (no package, used in Sage for Solaris 10) has some unspecified header breakage which is triggered by the duplicate definition. * configure.in: modify so skeleton-source is determined by configure options rather than by having developer rename yaccpar.skel.old to yaccpar.skel * descrip.mms: rename skeleton * vmsbuild.com: fwiw, renamed the skeleton for consistency with makefile * skel2c, skeleton.c: resync skeleton and its generating files * yaccpar.skel: renamed yaccpar.skel.old to yaccpar.skel, to allow using makefile suffix rules * yaccpar.skel.old: resync skeleton and its generating files * test/run_make.sh: improve cleanup after error recovery * test/yacc/calc.tab.c, test/yacc/calc1.tab.c, test/yacc/calc2.tab.c, test/yacc/calc3.tab.c, test/yacc/code_calc.code.c, test/yacc/code_error.code.c, test/yacc/empty.tab.c, test/yacc/err_syntax10.tab.c, test/yacc/err_syntax11.tab.c, test/yacc/err_syntax12.tab.c, test/yacc/err_syntax18.tab.c, test/yacc/err_syntax20.tab.c, test/yacc/error.tab.c, test/yacc/grammar.tab.c, test/yacc/pure_calc.tab.c, test/yacc/pure_error.tab.c, test/yacc/quote_calc-s.tab.c, test/yacc/quote_calc.tab.c, test/yacc/quote_calc2-s.tab.c, test/yacc/quote_calc2.tab.c, test/yacc/quote_calc3-s.tab.c, test/yacc/quote_calc3.tab.c, test/yacc/quote_calc4-s.tab.c, test/yacc/quote_calc4.tab.c, test/yacc/varsyntax_calc1.tab.c, output.c, skeleton.c, defs.h: use improvement from Tom Shield's btyacc changes, getting rid of special cases for generating two yyerror calls in skeleton * output.c: simplify output_yyerror_decl() * test/yacc/pure_error.tab.c, test/yacc/quote_calc-s.tab.c, test/yacc/quote_calc.tab.c, test/yacc/quote_calc2-s.tab.c, test/yacc/quote_calc2.tab.c, test/yacc/quote_calc3-s.tab.c, test/yacc/quote_calc3.tab.c, test/yacc/quote_calc4-s.tab.c, test/yacc/quote_calc4.tab.c, test/yacc/varsyntax_calc1.tab.c, test/yacc/calc.tab.c, test/yacc/calc1.tab.c, test/yacc/calc2.tab.c, test/yacc/calc3.tab.c, test/yacc/code_calc.tab.c, test/yacc/code_error.tab.c, test/yacc/empty.tab.c, test/yacc/err_syntax10.tab.c, test/yacc/err_syntax11.tab.c, test/yacc/err_syntax12.tab.c, test/yacc/err_syntax18.tab.c, test/yacc/err_syntax20.tab.c, test/yacc/error.tab.c, test/yacc/grammar.tab.c, test/yacc/pure_calc.tab.c, output.c: add second "const" to string-table declarations, from Tom Shield's btyacc changes * test/btyacc/err_syntax20.tab.c, test/btyacc/error.tab.c, test/btyacc/grammar.tab.c, test/btyacc/inherit0.tab.c, test/btyacc/inherit1.tab.c, test/btyacc/inherit2.tab.c, test/btyacc/pure_calc.tab.c, test/btyacc/pure_error.tab.c, test/btyacc/quote_calc-s.tab.c, test/btyacc/quote_calc.tab.c, test/btyacc/quote_calc2-s.tab.c, test/btyacc/quote_calc2.tab.c, test/btyacc/quote_calc3-s.tab.c, test/btyacc/quote_calc3.tab.c, test/btyacc/quote_calc4-s.tab.c, test/btyacc/quote_calc4.tab.c, test/btyacc/varsyntax_calc1.tab.c, test/btyacc/btyacc_calc1.tab.c, test/btyacc/btyacc_demo.tab.c, test/btyacc/calc.tab.c, test/btyacc/calc1.tab.c, test/btyacc/calc2.tab.c, test/btyacc/calc3.tab.c, test/btyacc/empty.tab.c, test/btyacc/err_inherit3.tab.c, test/btyacc/err_inherit4.tab.c, test/btyacc/err_syntax10.tab.c, test/btyacc/err_syntax11.tab.c, test/btyacc/err_syntax12.tab.c, test/btyacc/err_syntax18.tab.c: discard unnecessary call on write_code_lineno() from Tom Shield's changes * test/yacc/error.tab.c, test/yacc/grammar.tab.c, test/yacc/pure_calc.tab.c, test/yacc/pure_error.tab.c, test/yacc/quote_calc-s.tab.c, test/yacc/quote_calc.tab.c, test/yacc/quote_calc2-s.tab.c, test/yacc/quote_calc2.tab.c, test/yacc/quote_calc3-s.tab.c, test/yacc/quote_calc3.tab.c, test/yacc/quote_calc4-s.tab.c, test/yacc/quote_calc4.tab.c, test/yacc/varsyntax_calc1.tab.c, test/yacc/calc.tab.c, test/yacc/calc1.tab.c, test/yacc/calc2.tab.c, test/yacc/calc3.tab.c, test/yacc/code_calc.code.c, test/yacc/code_calc.tab.c, test/yacc/code_error.code.c, test/yacc/code_error.tab.c, test/yacc/empty.tab.c, test/yacc/err_syntax10.tab.c, test/yacc/err_syntax11.tab.c, test/yacc/err_syntax12.tab.c, test/yacc/err_syntax18.tab.c, test/yacc/err_syntax20.tab.c, output.c: use YYINT typedef from Tom Shield's btyacc changes to replace explicit "short" * test/yacc/code_calc.code.c, test/yacc/code_error.code.c, output.c: use fix from Tom Shield's btyacc changes: remove redundant extern-declaration for YYPARSE_DECL() * test/btyacc/err_syntax18.tab.c, test/btyacc/err_syntax20.tab.c, test/btyacc/error.tab.c, test/btyacc/grammar.tab.c, test/btyacc/inherit0.tab.c, test/btyacc/inherit1.tab.c, test/btyacc/inherit2.tab.c, test/btyacc/pure_calc.tab.c, test/btyacc/pure_error.tab.c, test/btyacc/quote_calc-s.tab.c, test/btyacc/quote_calc.tab.c, test/btyacc/quote_calc2-s.tab.c, test/btyacc/quote_calc2.tab.c, test/btyacc/quote_calc3-s.tab.c, test/btyacc/quote_calc3.tab.c, test/btyacc/quote_calc4-s.tab.c, test/btyacc/quote_calc4.tab.c, test/btyacc/varsyntax_calc1.tab.c, test/btyacc/btyacc_calc1.tab.c, test/btyacc/btyacc_demo.tab.c, test/btyacc/calc.tab.c, test/btyacc/calc1.tab.c, test/btyacc/calc2.tab.c, test/btyacc/calc3.tab.c, test/btyacc/code_calc.code.c, test/btyacc/code_error.code.c, test/btyacc/empty.tab.c, test/btyacc/err_inherit3.tab.c, test/btyacc/err_inherit4.tab.c, test/btyacc/err_syntax10.tab.c, test/btyacc/err_syntax11.tab.c, test/btyacc/err_syntax12.tab.c: discard unnecessary call on write_code_lineno() from Tom Shield's changes * output.c, test/yacc/code_calc.code.c, test/yacc/code_error.code.c, test/yacc/code_calc.tab.c, test/yacc/code_error.tab.c: use fix from Tom Shield's btyacc changes: prefix-definitions went to the output (.tab.c) file in a case where they should have gone to the code (.code.c) file. Remove now-redundant call to output_prefix(). * main.c: do the same for help-message * main.c: use OUTPUT_SUFFIX symbol in an overlooked case * test/run_make.sh: modify to avoid use of VPATH, which has no standard implementation 2014-04-05 Thomas E. Dickey * test/btyacc/grammar.tab.c, test/btyacc/inherit0.tab.c, test/btyacc/inherit1.tab.c, test/btyacc/inherit2.tab.c, test/btyacc/pure_calc.tab.c, test/btyacc/pure_error.tab.c, test/btyacc/quote_calc-s.tab.c, test/btyacc/quote_calc.tab.c, test/btyacc/quote_calc2-s.tab.c, test/btyacc/quote_calc2.tab.c, test/btyacc/quote_calc3-s.tab.c, test/btyacc/quote_calc3.tab.c, test/btyacc/quote_calc4-s.tab.c, test/btyacc/quote_calc4.tab.c, test/btyacc/varsyntax_calc1.tab.c, test/btyacc/btyacc_calc1.tab.c, test/btyacc/btyacc_demo.tab.c, test/btyacc/calc.tab.c, test/btyacc/calc1.tab.c, test/btyacc/calc2.tab.c, test/btyacc/calc3.tab.c, test/btyacc/code_calc.code.c, test/btyacc/code_error.code.c, test/btyacc/empty.tab.c, test/btyacc/err_inherit3.tab.c, test/btyacc/err_inherit4.tab.c, test/btyacc/err_syntax10.tab.c, test/btyacc/err_syntax11.tab.c, test/btyacc/err_syntax12.tab.c, test/btyacc/err_syntax18.tab.c, test/btyacc/err_syntax20.tab.c, test/btyacc/error.tab.c: discard a change which merged CountLines() with explicit comparisons against code_file because that adds extra to the #line values * test/yacc/pure_calc.tab.c, test/yacc/pure_error.tab.c, test/yacc/quote_calc-s.tab.c, test/yacc/quote_calc.tab.c, test/yacc/quote_calc2-s.tab.c, test/yacc/quote_calc2.tab.c, test/yacc/quote_calc3-s.tab.c, test/yacc/quote_calc3.tab.c, test/yacc/quote_calc4-s.tab.c, test/yacc/quote_calc4.tab.c, test/yacc/calc.tab.c, test/yacc/calc2.tab.c, test/yacc/calc3.tab.c, test/yacc/code_calc.code.c, test/yacc/code_error.code.c, test/yacc/empty.tab.c, test/yacc/err_syntax11.tab.c, test/yacc/err_syntax12.tab.c, test/yacc/err_syntax18.tab.c, test/yacc/error.tab.c, output.c: add Tom Shield's change to allow definition of YYSTYPE_IS_DECLARED symbol to override fallback typedef for YYSTYPE when that symbol is undefined * test/btyacc/error.tab.c, test/btyacc/inherit0.tab.c, test/btyacc/pure_calc.tab.c, test/btyacc/pure_error.tab.c, test/btyacc/quote_calc-s.tab.c, test/btyacc/quote_calc.tab.c, test/btyacc/quote_calc2-s.tab.c, test/btyacc/quote_calc2.tab.c, test/btyacc/quote_calc3-s.tab.c, test/btyacc/quote_calc3.tab.c, test/btyacc/quote_calc4-s.tab.c, test/btyacc/quote_calc4.tab.c, test/btyacc/calc.tab.c, test/btyacc/calc2.tab.c, test/btyacc/calc3.tab.c, test/btyacc/code_calc.code.c, test/btyacc/code_error.code.c, test/btyacc/empty.tab.c, test/btyacc/err_syntax11.tab.c, test/btyacc/err_syntax12.tab.c, test/btyacc/err_syntax18.tab.c: minor tweak to coding style - use parenthesis for "defined" operator's parameter * test/btyacc/err_syntax11.tab.c, test/btyacc/err_syntax12.tab.c, test/btyacc/err_syntax18.tab.c, test/btyacc/err_syntax20.tab.c, test/btyacc/error.tab.c, test/btyacc/grammar.tab.c, test/btyacc/inherit0.tab.c, test/btyacc/inherit1.tab.c, test/btyacc/inherit2.tab.c, test/btyacc/pure_calc.tab.c, test/btyacc/pure_error.tab.c, test/btyacc/quote_calc-s.tab.c, test/btyacc/quote_calc.tab.c, test/btyacc/quote_calc2-s.tab.c, test/btyacc/quote_calc2.tab.c, test/btyacc/quote_calc3-s.tab.c, test/btyacc/quote_calc3.tab.c, test/btyacc/quote_calc4-s.tab.c, test/btyacc/quote_calc4.tab.c, test/btyacc/varsyntax_calc1.tab.c, test/btyacc/btyacc_calc1.tab.c, test/btyacc/btyacc_demo.tab.c, test/btyacc/calc.tab.c, test/btyacc/calc1.tab.c, test/btyacc/calc2.tab.c, test/btyacc/calc3.tab.c, test/btyacc/code_calc.code.c, test/btyacc/code_error.code.c, test/btyacc/empty.tab.c, test/btyacc/err_inherit3.tab.c, test/btyacc/err_inherit4.tab.c, test/btyacc/err_syntax10.tab.c: regen to make YYMAXTOKEN and YYUNDFTOKEN adjacent * test/yacc/err_syntax20.tab.c, test/yacc/grammar.tab.c, test/yacc/quote_calc2-s.tab.c, test/yacc/quote_calc2.tab.c, test/yacc/quote_calc3-s.tab.c, test/yacc/quote_calc3.tab.c, test/yacc/quote_calc4-s.tab.c, test/yacc/quote_calc4.tab.c, test/yacc/varsyntax_calc1.tab.c, test/yacc/calc.tab.c, test/yacc/calc1.tab.c, test/yacc/calc2.tab.c, test/yacc/calc3.tab.c, test/yacc/code_calc.code.c, test/yacc/code_calc.tab.c, test/yacc/code_error.code.c, test/yacc/code_error.tab.c, test/yacc/empty.tab.c, test/yacc/err_syntax10.tab.c, test/yacc/err_syntax11.tab.c, test/yacc/err_syntax12.tab.c: regen after adding the YYUNDFTOKEN symbol * output.c: integrate Tom Shield's btyacc changes which introduce the YYUNDFTOKEN symbol (I changed order of output to keep this adjacent to YYMAXTOKEN) * reader.c: merge all but one small change from Tom Shield's btyacc changes - that changes the order of code-file in the tests. * test/btyacc/btyacc_demo.tab.c: regen * test/btyacc_demo.y: fix prototypes 2014-04-04 Thomas E. Dickey * reader.c, defs.h, main.c: more merging of Tom Shield's btyacc changes. In the merge, I moved the symbol_pval inside the btyacc ifdef's and added some more btyacc ifdefs 2014-04-03 Thomas E. Dickey * reader.c: merge-in 3/4 of btyacc's changes, deferring those which change test-outputs. Tom Shield's changes split-out copy_string() and copy_comment() functions to simplify some logic, as well as adding btyacc-only chunks * makefile.in: build mstring.o, needed for changes in reader.c * output.c: merge-in all of btyacc's changes which do not change byacc's test-output. Some of the merge uses ifdef-changes which I applied to ongoing resync, e.g., the introduction of PER_STATE. 2014-04-02 Thomas E. Dickey * test/btyacc/pure_calc.tab.c, test/btyacc/pure_error.tab.c: regen * output.c: fix typo * output.c, reader.c: merge in some chunks of reader and output files which do not affect byacc tests * test/yacc/calc2.tab.c, test/yacc/calc3.tab.c: regen * test/yacc/err_syntax6.tab.c, test/yacc/err_syntax7.tab.c, test/yacc/err_syntax7a.tab.c, test/yacc/err_syntax7b.tab.c, test/yacc/err_syntax8.tab.c, test/yacc/err_syntax8a.tab.c, test/yacc/err_syntax9.tab.c, test/yacc/error.tab.c, test/yacc/grammar.tab.c, test/yacc/pure_calc.tab.c, test/yacc/pure_error.tab.c, test/yacc/quote_calc-s.tab.c, test/yacc/quote_calc.tab.c, test/yacc/quote_calc2-s.tab.c, test/yacc/quote_calc2.tab.c, test/yacc/quote_calc3-s.tab.c, test/yacc/quote_calc3.tab.c, test/yacc/quote_calc4-s.tab.c, test/yacc/quote_calc4.tab.c, test/yacc/varsyntax_calc1.tab.c, test/yacc/calc.tab.c, test/yacc/calc1.tab.c, test/yacc/calc2.tab.c, test/yacc/calc3.tab.c, test/yacc/code_calc.code.c, test/yacc/code_error.code.c, test/yacc/empty.tab.c, test/yacc/err_syntax1.tab.c, test/yacc/err_syntax10.tab.c, test/yacc/err_syntax11.tab.c, test/yacc/err_syntax12.tab.c, test/yacc/err_syntax13.tab.c, test/yacc/err_syntax14.tab.c, test/yacc/err_syntax15.tab.c, test/yacc/err_syntax16.tab.c, test/yacc/err_syntax17.tab.c, test/yacc/err_syntax18.tab.c, test/yacc/err_syntax19.tab.c, test/yacc/err_syntax2.tab.c, test/yacc/err_syntax20.tab.c, test/yacc/err_syntax21.tab.c, test/yacc/err_syntax22.tab.c, test/yacc/err_syntax23.tab.c, test/yacc/err_syntax24.tab.c, test/yacc/err_syntax25.tab.c, test/yacc/err_syntax26.tab.c, test/yacc/err_syntax3.tab.c, test/yacc/err_syntax4.tab.c, test/yacc/err_syntax5.tab.c, skeleton.c: incorporate YYENOMEM and YYEOF symbols from btyacc * output.c: merge chunk from btyacc changes for header-guards * btyaccpar.skel: RCS_BASE * yaccpar.skel: comment-out yysccsid[], for FreeBSD build-issues remove GCC_UNUSED to reduce name-pollution as well as being simpler * main.c: move a btyacc symbol outside ifdef to work around current state of merge * defs.h: add USE_HEADER_GUARDS to defer whether to modify byacc's header-output * test/run_make.sh: do not try to compile files used for testing syntax-errors, since they are likely to be incomplete 2014-04-02 Tom.Shields * main.c: changes for btyacc 2014-04-01 Thomas E. Dickey * reader.c: integrate change by Tom Shields to use bsearch rather than successive calls to matchec() * defs.h: typedef __compar_fn_t is unnecessary * test/btyacc/err_syntax20.tab.c, test/btyacc/error.tab.c, test/btyacc/grammar.tab.c, test/btyacc/inherit0.tab.c, test/btyacc/inherit1.tab.c, test/btyacc/inherit2.tab.c, test/btyacc/pure_calc.tab.c, test/btyacc/pure_error.tab.c, test/btyacc/quote_calc-s.tab.c, test/btyacc/quote_calc.tab.c, test/btyacc/quote_calc2-s.tab.c, test/btyacc/quote_calc2.tab.c, test/btyacc/quote_calc3-s.tab.c, test/btyacc/quote_calc3.tab.c, test/btyacc/quote_calc4-s.tab.c, test/btyacc/quote_calc4.tab.c, test/btyacc/varsyntax_calc1.tab.c, test/btyacc/btyacc_calc1.tab.c, test/btyacc/btyacc_demo.tab.c, test/btyacc/calc.tab.c, test/btyacc/calc1.tab.c, test/btyacc/calc2.tab.c, test/btyacc/calc3.tab.c, test/btyacc/code_calc.code.c, test/btyacc/code_error.code.c, test/btyacc/empty.tab.c, test/btyacc/err_inherit3.tab.c, test/btyacc/err_inherit4.tab.c, test/btyacc/err_syntax10.tab.c, test/btyacc/err_syntax11.tab.c, test/btyacc/err_syntax12.tab.c, test/btyacc/err_syntax18.tab.c: omit the GCC_UNUSED, as noted by Tom Shields not really essential 2014-04-01 Tom.Shields * verbose.c: changes for btyacc, ifdef'd 2014-04-01 Thomas E. Dickey * mkpar.c: eliminate most of the ifdef's using macros 2014-04-01 Tom.Shields * mkpar.c: merge btyacc changes (ifdef'd - no change to byacc) * error.c: new functions used for reporting errors from the btyacc configuration (I reordered some, and ifdef'd the new ones -TD) 2014-03-31 Thomas E. Dickey * test/btyacc/code_calc.code.c, test/btyacc/code_error.code.c: omit the GCC_UNUSED, as noted by Tom Shields not really essential * test/btyacc/empty.tab.c, test/btyacc/err_inherit1.tab.c, test/btyacc/err_inherit2.tab.c, test/btyacc/err_inherit3.tab.c, test/btyacc/err_inherit4.tab.c, test/btyacc/err_inherit5.tab.c, test/btyacc/err_syntax10.tab.c, test/btyacc/err_syntax11.tab.c, test/btyacc/err_syntax12.tab.c, test/btyacc/err_syntax14.tab.c, test/btyacc/err_syntax15.tab.c, test/btyacc/err_syntax16.tab.c, test/btyacc/err_syntax17.tab.c, test/btyacc/err_syntax18.tab.c, test/btyacc/err_syntax19.tab.c, test/btyacc/err_syntax20.tab.c, test/btyacc/err_syntax21.tab.c, test/btyacc/err_syntax22.tab.c, test/btyacc/err_syntax23.tab.c, test/btyacc/err_syntax24.tab.c: regen 2014-03-29 Thomas E. Dickey * test/yacc/err_syntax22.tab.c, test/yacc/err_syntax23.tab.c, test/yacc/err_syntax24.tab.c, test/yacc/err_syntax25.tab.c, test/yacc/err_syntax26.tab.c, test/yacc/err_syntax3.tab.c, test/yacc/err_syntax4.tab.c, test/yacc/err_syntax5.tab.c, test/yacc/err_syntax6.tab.c, test/yacc/err_syntax7.tab.c, test/yacc/err_syntax7a.tab.c, test/yacc/err_syntax7b.tab.c, test/yacc/err_syntax8.tab.c, test/yacc/err_syntax8a.tab.c, test/yacc/err_syntax9.tab.c, test/yacc/error.tab.c, test/yacc/grammar.tab.c, test/yacc/pure_calc.tab.c, test/yacc/pure_error.tab.c, test/yacc/quote_calc-s.tab.c, test/yacc/quote_calc.tab.c, test/yacc/quote_calc2-s.tab.c, test/yacc/quote_calc2.tab.c, test/yacc/quote_calc3-s.tab.c, test/yacc/quote_calc3.tab.c, test/yacc/quote_calc4-s.tab.c, test/yacc/quote_calc4.tab.c, test/yacc/varsyntax_calc1.tab.c, test/yacc/calc.tab.c, test/yacc/calc1.tab.c, test/yacc/calc2.tab.c, test/yacc/calc3.tab.c, test/yacc/code_calc.code.c, test/yacc/code_error.code.c, test/yacc/empty.tab.c, test/yacc/err_syntax1.tab.c, test/yacc/err_syntax10.tab.c, test/yacc/err_syntax11.tab.c, test/yacc/err_syntax12.tab.c, test/yacc/err_syntax13.tab.c, test/yacc/err_syntax14.tab.c, test/yacc/err_syntax15.tab.c, test/yacc/err_syntax16.tab.c, test/yacc/err_syntax17.tab.c, test/yacc/err_syntax18.tab.c, test/yacc/err_syntax19.tab.c, test/yacc/err_syntax2.tab.c, test/yacc/err_syntax20.tab.c, test/yacc/err_syntax21.tab.c, skeleton.c: comment-out yysccsid in the banner because it produces unnecessary compiler warnings. The suggested alternative (using #pragma ident) in the preceding comment is also obsolete; remove that comment (request by Gleb Smirnoff). * test/run_test.sh: for yacc, ignore the inherit testcases, since they are btyacc-specific 2014-03-28 Thomas E. Dickey * test/yacc/varsyntax_calc1.error, test/yacc/varsyntax_calc1.output, test/yacc/varsyntax_calc1.tab.c, test/yacc/varsyntax_calc1.tab.h, test/yacc/err_inherit3.error, test/yacc/err_inherit3.output, test/yacc/err_inherit3.tab.c, test/yacc/err_inherit3.tab.h, test/yacc/err_inherit4.error, test/yacc/err_inherit4.output, test/yacc/err_inherit4.tab.c, test/yacc/err_inherit4.tab.h, test/yacc/err_inherit5.error, test/yacc/err_inherit5.output, test/yacc/err_inherit5.tab.c, test/yacc/err_inherit5.tab.h, test/yacc/inherit0.error, test/yacc/inherit0.output, test/yacc/inherit0.tab.c, test/yacc/inherit0.tab.h, test/yacc/inherit1.error, test/yacc/inherit1.output, test/yacc/inherit1.tab.c, test/yacc/inherit1.tab.h, test/yacc/inherit2.error, test/yacc/inherit2.output, test/yacc/inherit2.tab.c, test/yacc/inherit2.tab.h, test/yacc/empty.error, test/yacc/empty.output, test/yacc/empty.tab.c, test/yacc/empty.tab.h, test/yacc/err_inherit1.error, test/yacc/err_inherit1.output, test/yacc/err_inherit1.tab.c, test/yacc/err_inherit1.tab.h, test/yacc/err_inherit2.error, test/yacc/err_inherit2.output, test/yacc/err_inherit2.tab.c, test/yacc/err_inherit2.tab.h: reference output for testing * test/run_lint.sh, test/run_make.sh, test/run_test.sh: moving #define's out of makefile broke check for yacc vs btyacc (fix) 2014-03-28 Tom.Shields * test/btyacc/btyacc_demo.tab.c, test/btyacc/err_inherit3.error, test/btyacc/err_inherit3.output, test/btyacc/err_inherit3.tab.c, test/btyacc/err_inherit3.tab.h, test/btyacc/err_inherit2.error, test/btyacc/err_inherit2.output, test/btyacc/err_inherit2.tab.c, test/btyacc/err_inherit2.tab.h, test/btyacc/err_inherit4.error, test/btyacc/err_inherit4.output, test/btyacc/err_inherit4.tab.c, test/btyacc/err_inherit4.tab.h, test/btyacc/err_inherit5.error, test/btyacc/err_inherit5.output, test/btyacc/err_inherit5.tab.c, test/btyacc/err_inherit5.tab.h, test/btyacc/inherit0.error, test/btyacc/inherit0.output, test/btyacc/inherit0.tab.c, test/btyacc/inherit0.tab.h, test/btyacc/inherit1.error, test/btyacc/inherit1.output, test/btyacc/inherit1.tab.c, test/btyacc/inherit1.tab.h, test/btyacc/inherit2.error, test/btyacc/inherit2.output, test/btyacc/inherit2.tab.c, test/btyacc/inherit2.tab.h, test/btyacc/calc.error, test/btyacc/err_inherit1.error, test/btyacc/err_inherit1.output, test/btyacc/err_inherit1.tab.c, test/btyacc/err_inherit1.tab.h: reference output for testing * defs.h: new functions/variables for btyacc (I reordered and ifdef'd -TD) * test/inherit0.y, test/inherit1.y: testcase for btyacc 2014-03-27 Tom.Shields * test/err_inherit5.y, test/err_inherit4.y, test/err_inherit3.y, test/err_inherit2.y, test/err_inherit1.y, test/inherit2.y: testcase for btyacc 2014-03-25 Tom.Shields * symtab.c: extra initialization needed for btyacc (I ifdef'd -TD) * yacc.1: document -L/-B features from btyacc 2014-03-25 Thomas E. Dickey * yacc.1: typo * configure: regen * configure.in: modified new options to act like those in my other configure-scripts, e.g., showing what option is being tested, and the resulting value. Put the definitions in config.h rather than in the makefile. 2014-03-25 Tom.Shields * makefile.in: add/use LINTFLAGS variable make all of the objects (not just skeleton) rebuild if makefile changes modify check-rule to reflect updates to run_test.sh vs subdirectory * mstring.c: byacc-btyacc-20140323 2014-03-25 Thomas E. Dickey * test/btyacc/RCS, test/yacc/RCS: PERMIT FILE * config_h.in: updated with autoheader-252 2014-03-25 Tom.Shields * README.BTYACC: byacc-btyacc-20140323 2014-03-24 Tom.Shields * test/btyacc/err_syntax1.output, test/btyacc/err_syntax1.tab.c, test/btyacc/err_syntax1.tab.h, test/btyacc/err_syntax10.error, test/btyacc/err_syntax10.output, test/btyacc/err_syntax10.tab.c, test/btyacc/err_syntax10.tab.h, test/btyacc/err_syntax11.error, test/btyacc/err_syntax11.output, test/btyacc/err_syntax11.tab.c, test/btyacc/err_syntax11.tab.h, test/btyacc/err_syntax12.error, test/btyacc/err_syntax12.output, test/btyacc/err_syntax12.tab.c, test/btyacc/err_syntax12.tab.h, test/btyacc/err_syntax13.error, test/btyacc/err_syntax13.output, test/btyacc/err_syntax13.tab.c, test/btyacc/err_syntax13.tab.h, test/btyacc/err_syntax14.error, test/btyacc/err_syntax14.output, test/btyacc/err_syntax14.tab.c, test/btyacc/err_syntax14.tab.h, test/btyacc/err_syntax15.error, test/btyacc/err_syntax15.output, test/btyacc/err_syntax15.tab.c, test/btyacc/err_syntax15.tab.h, test/btyacc/err_syntax16.error, test/btyacc/err_syntax16.output, test/btyacc/err_syntax16.tab.c, test/btyacc/err_syntax16.tab.h, test/btyacc/err_syntax17.error, test/btyacc/err_syntax17.output, test/btyacc/err_syntax17.tab.c, test/btyacc/err_syntax17.tab.h, test/btyacc/err_syntax18.error, test/btyacc/err_syntax18.output, test/btyacc/err_syntax18.tab.c, test/btyacc/err_syntax18.tab.h, test/btyacc/err_syntax19.error, test/btyacc/err_syntax19.output, test/btyacc/err_syntax19.tab.c, test/btyacc/err_syntax19.tab.h, test/btyacc/err_syntax2.output, test/btyacc/err_syntax2.tab.c, test/btyacc/err_syntax2.tab.h, test/btyacc/err_syntax20.error, test/btyacc/err_syntax20.output, test/btyacc/err_syntax20.tab.c, test/btyacc/err_syntax20.tab.h, test/btyacc/err_syntax21.error, test/btyacc/err_syntax21.output, test/btyacc/err_syntax21.tab.c, test/btyacc/err_syntax21.tab.h, test/btyacc/err_syntax22.error, test/btyacc/err_syntax22.output, test/btyacc/err_syntax22.tab.c, test/btyacc/err_syntax22.tab.h, test/btyacc/err_syntax23.error, test/btyacc/err_syntax23.output, test/btyacc/err_syntax23.tab.c, test/btyacc/err_syntax23.tab.h, test/btyacc/err_syntax24.error, test/btyacc/err_syntax24.output, test/btyacc/err_syntax24.tab.c, test/btyacc/err_syntax24.tab.h, test/btyacc/err_syntax25.error, test/btyacc/err_syntax25.output, test/btyacc/err_syntax25.tab.c, test/btyacc/err_syntax25.tab.h, test/btyacc/err_syntax26.error, test/btyacc/err_syntax26.output, test/btyacc/err_syntax26.tab.c, test/btyacc/err_syntax26.tab.h, test/btyacc/err_syntax3.output, test/btyacc/err_syntax3.tab.c, test/btyacc/err_syntax3.tab.h, test/btyacc/err_syntax4.output, test/btyacc/err_syntax4.tab.c, test/btyacc/err_syntax4.tab.h, test/btyacc/err_syntax5.output, test/btyacc/err_syntax5.tab.c, test/btyacc/err_syntax5.tab.h, test/btyacc/err_syntax6.output, test/btyacc/err_syntax6.tab.c, test/btyacc/err_syntax6.tab.h, test/btyacc/err_syntax7.output, test/btyacc/err_syntax7.tab.c, test/btyacc/err_syntax7.tab.h, test/btyacc/err_syntax7a.output, test/btyacc/err_syntax7a.tab.c, test/btyacc/err_syntax7a.tab.h, test/btyacc/err_syntax7b.output, test/btyacc/err_syntax7b.tab.c, test/btyacc/err_syntax7b.tab.h, test/btyacc/err_syntax8.output, test/btyacc/err_syntax8.tab.c, test/btyacc/err_syntax8.tab.h, test/btyacc/err_syntax8a.output, test/btyacc/err_syntax8a.tab.c, test/btyacc/err_syntax8a.tab.h, test/btyacc/err_syntax9.output, test/btyacc/err_syntax9.tab.c, test/btyacc/err_syntax9.tab.h: reference output for testing 2014-03-24 Thomas E. Dickey * defs.h: fix compiler warnings due to mputc() 2014-03-23 Tom.Shields * test/btyacc_demo.y: testcase for btyacc * test/btyacc/varsyntax_calc1.error, test/btyacc/varsyntax_calc1.output, test/btyacc/varsyntax_calc1.tab.c, test/btyacc/varsyntax_calc1.tab.h: reference output for testing * test/varsyntax_calc1.y, test/btyacc_calc1.y: testcase for btyacc 2014-03-23 Thomas E. Dickey * test/err_syntax26.error, test/err_syntax26.output, test/err_syntax26.tab.c, test/err_syntax26.tab.h, test/yacc/err_syntax26.error, test/yacc/err_syntax26.output, test/yacc/err_syntax26.tab.c, test/yacc/err_syntax26.tab.h: reference output for testing * test/err_syntax26.y: testcase for missing_brace() * test/err_syntax25.error, test/err_syntax25.output, test/err_syntax25.tab.c, test/err_syntax25.tab.h, test/yacc/err_syntax25.error, test/yacc/err_syntax25.output, test/yacc/err_syntax25.tab.c, test/yacc/err_syntax25.tab.h: reference output for testing * test/err_syntax25.y: testcase for over_unionized() * test/err_syntax24.error, test/err_syntax24.output, test/err_syntax24.tab.c, test/err_syntax24.tab.h, test/yacc/err_syntax24.error, test/yacc/err_syntax24.output, test/yacc/err_syntax24.tab.c, test/yacc/err_syntax24.tab.h: reference output for testing * test/err_syntax24.y: testcase for default_action_warning() 2014-03-23 Tom.Shields * test/btyacc/quote_calc3-s.error, test/btyacc/quote_calc4-s.error, test/btyacc/quote_calc4.error, test/btyacc/grammar.dot, test/btyacc/grammar.error, test/btyacc/pure_calc.error, test/btyacc/pure_error.error, test/btyacc/quote_calc-s.error, test/btyacc/quote_calc.error, test/btyacc/quote_calc2-s.error, test/btyacc/quote_calc2.error, test/btyacc/quote_calc3.error, test/btyacc/err_syntax2.error, test/btyacc/err_syntax3.error, test/btyacc/err_syntax4.error, test/btyacc/err_syntax5.error, test/btyacc/err_syntax6.error, test/btyacc/err_syntax7.error, test/btyacc/err_syntax7a.error, test/btyacc/err_syntax7b.error, test/btyacc/err_syntax8.error, test/btyacc/err_syntax8a.error, test/btyacc/err_syntax9.error, test/btyacc/error.error, test/btyacc/calc1.error, test/btyacc/calc2.error, test/btyacc/calc3.error, test/btyacc/code_calc.error, test/btyacc/code_error.error, test/btyacc/empty.error, test/btyacc/err_syntax1.error, test/btyacc/btyacc_calc1.error, test/btyacc/btyacc_demo.error: reference output for testing 2014-03-23 Thomas E. Dickey * test/err_syntax23.error, test/err_syntax23.output, test/err_syntax23.tab.c, test/err_syntax23.tab.h, test/yacc/err_syntax23.error, test/yacc/err_syntax23.output, test/yacc/err_syntax23.tab.c, test/yacc/err_syntax23.tab.h: reference output for testing * test/err_syntax23.y: testcase for untyped_lhs() 2014-03-23 Tom.Shields * test/run_test.sh: move test-outputs into subdirectories to keep btyacc/yacc results separate 2014-03-23 Thomas E. Dickey * test/err_syntax22.error, test/err_syntax22.output, test/err_syntax22.tab.c, test/err_syntax22.tab.h, test/yacc/err_syntax22.error, test/yacc/err_syntax22.output, test/yacc/err_syntax22.tab.c, test/yacc/err_syntax22.tab.h: reference output for testing * test/err_syntax22.y: testcase for untyped_rhs() * test/err_syntax21.error, test/err_syntax21.output, test/err_syntax21.tab.c, test/err_syntax21.tab.h, test/yacc/err_syntax21.error, test/yacc/err_syntax21.output, test/yacc/err_syntax21.tab.c, test/yacc/err_syntax21.tab.h, test/err_syntax20.error, test/err_syntax20.output, test/err_syntax20.tab.c, test/err_syntax20.tab.h, test/yacc/err_syntax20.error, test/yacc/err_syntax20.output, test/yacc/err_syntax20.tab.c, test/yacc/err_syntax20.tab.h: reference output for testing * test/err_syntax20.y: testcase for undefined_symbol_warning() * test/err_syntax21.y: testcase for unknown_rhs() * test/err_syntax19.error, test/err_syntax19.output, test/err_syntax19.tab.c, test/err_syntax19.tab.h, test/yacc/err_syntax19.error, test/yacc/err_syntax19.output, test/yacc/err_syntax19.tab.c, test/yacc/err_syntax19.tab.h: reference output for testing * test/err_syntax19.y: testcase for dollar_error() * test/err_syntax18.error, test/err_syntax18.output, test/err_syntax18.tab.c, test/err_syntax18.tab.h, test/yacc/err_syntax18.error, test/yacc/err_syntax18.output, test/yacc/err_syntax18.tab.c, test/yacc/err_syntax18.tab.h: reference output for testing * test/err_syntax18.y: testcase for dollar_warning() * test/err_syntax17.error, test/err_syntax17.output, test/err_syntax17.tab.c, test/err_syntax17.tab.h, test/yacc/err_syntax17.error, test/yacc/err_syntax17.output, test/yacc/err_syntax17.tab.c, test/yacc/err_syntax17.tab.h: reference output for testing * test/err_syntax17.y: testcase for unterminated_action() 2014-03-22 Thomas E. Dickey * test/err_syntax16.error, test/err_syntax16.output, test/err_syntax16.tab.c, test/err_syntax16.tab.h, test/yacc/err_syntax16.error, test/yacc/err_syntax16.output, test/yacc/err_syntax16.tab.c, test/yacc/err_syntax16.tab.h: reference output for testing * test/err_syntax16.y: testcase for terminal_lhs() * test/err_syntax15.error, test/err_syntax15.output, test/err_syntax15.tab.c, test/err_syntax15.tab.h, test/yacc/err_syntax15.error, test/yacc/err_syntax15.output, test/yacc/err_syntax15.tab.c, test/yacc/err_syntax15.tab.h: reference output for testing * test/err_syntax15.y: testcase for no_grammar() * test/err_syntax14.error, test/err_syntax14.output, test/err_syntax14.tab.c, test/err_syntax14.tab.h, test/yacc/err_syntax14.error, test/yacc/err_syntax14.output, test/yacc/err_syntax14.tab.c, test/yacc/err_syntax14.tab.h: reference output for testing * test/err_syntax14.y: testcase for restarted_warning() and undefined_goal() * test/err_syntax13.error, test/err_syntax13.output, test/err_syntax13.tab.c, test/err_syntax13.tab.h, test/yacc/err_syntax13.error, test/yacc/err_syntax13.output, test/yacc/err_syntax13.tab.c, test/yacc/err_syntax13.tab.h: reference output for testing * test/err_syntax13.y: testcase for terminal_start() * test/err_syntax12.error, test/err_syntax12.output, test/err_syntax12.tab.c, test/err_syntax12.tab.h, test/yacc/err_syntax12.error, test/yacc/err_syntax12.output, test/yacc/err_syntax12.tab.c, test/yacc/err_syntax12.tab.h: reference output for testing * test/err_syntax12.y: testcase for revalued_warning() * test/err_syntax11.error, test/err_syntax11.output, test/err_syntax11.tab.c, test/err_syntax11.tab.h, test/yacc/err_syntax11.error, test/yacc/err_syntax11.output, test/yacc/err_syntax11.tab.c, test/yacc/err_syntax11.tab.h: reference output for testing * test/err_syntax11.y: testcase for reprec_warning() * test/err_syntax10.error, test/err_syntax10.output, test/err_syntax10.tab.c, test/err_syntax10.tab.h, test/yacc/err_syntax10.error, test/yacc/err_syntax10.output, test/yacc/err_syntax10.tab.c, test/yacc/err_syntax10.tab.h: reference output for testing * test/err_syntax10.y: testcase for retyped_warning() 2014-03-21 Thomas E. Dickey * test/err_syntax9.error, test/err_syntax9.output, test/err_syntax9.tab.c, test/err_syntax9.tab.h, test/yacc/err_syntax9.error, test/yacc/err_syntax9.output, test/yacc/err_syntax9.tab.c, test/yacc/err_syntax9.tab.h: reference output for testing * test/err_syntax9.y: testcase for tokenized_start() * test/err_syntax8.error, test/err_syntax8.output, test/err_syntax8.tab.c, test/err_syntax8.tab.h, test/err_syntax8a.error, test/err_syntax8a.output, test/err_syntax8a.tab.c, test/err_syntax8a.tab.h, test/yacc/err_syntax8.error, test/yacc/err_syntax8.output, test/yacc/err_syntax8.tab.c, test/yacc/err_syntax8.tab.h, test/yacc/err_syntax8a.error, test/yacc/err_syntax8a.output, test/yacc/err_syntax8a.tab.c, test/yacc/err_syntax8a.tab.h: reference output for testing * test/err_syntax8a.y, test/err_syntax8.y: testcase for used_reserved() * test/err_syntax7.error, test/err_syntax7.output, test/err_syntax7.tab.c, test/err_syntax7.tab.h, test/err_syntax7a.error, test/err_syntax7a.output, test/err_syntax7a.tab.c, test/err_syntax7a.tab.h, test/err_syntax7b.error, test/err_syntax7b.output, test/err_syntax7b.tab.c, test/err_syntax7b.tab.h, test/yacc/err_syntax7.error, test/yacc/err_syntax7.output, test/yacc/err_syntax7.tab.c, test/yacc/err_syntax7.tab.h, test/yacc/err_syntax7a.error, test/yacc/err_syntax7a.output, test/yacc/err_syntax7a.tab.c, test/yacc/err_syntax7a.tab.h, test/yacc/err_syntax7b.error, test/yacc/err_syntax7b.output, test/yacc/err_syntax7b.tab.c, test/yacc/err_syntax7b.tab.h: reference output for testing * test/err_syntax7b.y, test/err_syntax7a.y, test/err_syntax7.y: testcase for illegal_character() * test/err_syntax6.error, test/err_syntax6.output, test/err_syntax6.tab.c, test/err_syntax6.tab.h, test/yacc/err_syntax6.error, test/yacc/err_syntax6.output, test/yacc/err_syntax6.tab.c, test/yacc/err_syntax6.tab.h: reference output for testing * test/err_syntax6.y: testcase for illegal_tag() * test/err_syntax5.error, test/err_syntax5.output, test/err_syntax5.tab.c, test/err_syntax5.tab.h, test/yacc/err_syntax5.error, test/yacc/err_syntax5.output, test/yacc/err_syntax5.tab.c, test/yacc/err_syntax5.tab.h: reference output for testing * test/err_syntax5.y: testcase for unterminated_union() * test/err_syntax4.error, test/err_syntax4.output, test/err_syntax4.tab.c, test/err_syntax4.tab.h, test/yacc/err_syntax4.error, test/yacc/err_syntax4.output, test/yacc/err_syntax4.tab.c, test/yacc/err_syntax4.tab.h: reference output for testing * test/err_syntax4.y: testcase for unterminated_text() * test/err_syntax3.error, test/err_syntax3.output, test/err_syntax3.tab.c, test/err_syntax3.tab.h, test/yacc/err_syntax3.error, test/yacc/err_syntax3.output, test/yacc/err_syntax3.tab.c, test/yacc/err_syntax3.tab.h: reference output for testing * test/err_syntax3.y: testcase for unterminated_string() * test/err_syntax2.error, test/err_syntax2.output, test/err_syntax2.tab.c, test/err_syntax2.tab.h, test/yacc/err_syntax2.error, test/yacc/err_syntax2.output, test/yacc/err_syntax2.tab.c, test/yacc/err_syntax2.tab.h: reference output for testing * test/err_syntax2.y: testcase for unterminated_comment() * test/err_syntax1.error, test/yacc/err_syntax1.error: reference output for testing * test/err_syntax1.y: test-case with syntax error (and nonprinting character) * test/calc.error, test/calc1.error, test/calc2.error, test/calc3.error, test/code_calc.error, test/code_error.error, test/err_syntax1.error, test/error.error, test/grammar.error, test/pure_calc.error, test/pure_error.error, test/quote_calc-s.error, test/quote_calc.error, test/quote_calc2-s.error, test/quote_calc2.error, test/quote_calc3-s.error, test/quote_calc3.error, test/quote_calc4-s.error, test/quote_calc4.error, test/yacc/calc.error, test/yacc/calc1.error, test/yacc/calc2.error, test/yacc/calc3.error, test/yacc/code_calc.error, test/yacc/code_error.error, test/yacc/error.error, test/yacc/grammar.error, test/yacc/pure_calc.error, test/yacc/pure_error.error, test/yacc/quote_calc-s.error, test/yacc/quote_calc.error, test/yacc/quote_calc2-s.error, test/yacc/quote_calc2.error, test/yacc/quote_calc3-s.error, test/yacc/quote_calc3.error, test/yacc/quote_calc4-s.error, test/yacc/quote_calc4.error: reference output for testing * test/run_test.sh: save stderr to reference files, to capture shift/reduce messages as well as syntax-error messages * test/err_syntax1.output, test/err_syntax1.tab.c, test/err_syntax1.tab.h, test/yacc/err_syntax1.output, test/yacc/err_syntax1.tab.c, test/yacc/err_syntax1.tab.h: reference output for testing * test/run_test.sh: generate a ".dot" file for the grammar file * test/grammar.dot: RCS_BASE * test/yacc/grammar.dot: reference output for testing 2014-03-19 Tom.Shields * output.c: rename MAXSHORT to MAXYYINT 2014-03-18 Tom.Shields * yaccpar.skel: skeleton with btyacc additions * NOTES-btyacc-Changes: byacc-btyacc-20140323 * test/btyacc/btyacc_calc1.output, test/btyacc/btyacc_calc1.tab.c, test/btyacc/btyacc_calc1.tab.h: reference output for testing * test/run_make.sh: move test-outputs into subdirectories to keep btyacc/yacc results separate * test/btyacc/pure_calc.tab.c, test/btyacc/pure_calc.tab.h, test/btyacc/pure_error.output, test/btyacc/pure_error.tab.c, test/btyacc/pure_error.tab.h, test/btyacc/quote_calc-s.output, test/btyacc/quote_calc-s.tab.c, test/btyacc/quote_calc-s.tab.h, test/btyacc/quote_calc.output, test/btyacc/quote_calc.tab.c, test/btyacc/quote_calc.tab.h, test/btyacc/quote_calc2-s.output, test/btyacc/quote_calc2-s.tab.c, test/btyacc/quote_calc2-s.tab.h, test/btyacc/quote_calc2.output, test/btyacc/quote_calc2.tab.c, test/btyacc/quote_calc2.tab.h, test/btyacc/quote_calc3-s.output, test/btyacc/quote_calc3-s.tab.c, test/btyacc/quote_calc3-s.tab.h, test/btyacc/quote_calc3.output, test/btyacc/quote_calc3.tab.c, test/btyacc/quote_calc3.tab.h, test/btyacc/quote_calc4-s.output, test/btyacc/quote_calc4-s.tab.c, test/btyacc/quote_calc4-s.tab.h, test/btyacc/quote_calc4.output, test/btyacc/quote_calc4.tab.c, test/btyacc/quote_calc4.tab.h, test/btyacc/calc1.output, test/btyacc/calc1.tab.c, test/btyacc/calc1.tab.h, test/btyacc/calc2.output, test/btyacc/calc2.tab.c, test/btyacc/calc2.tab.h, test/btyacc/calc3.output, test/btyacc/calc3.tab.c, test/btyacc/calc3.tab.h, test/btyacc/code_calc.code.c, test/btyacc/code_calc.output, test/btyacc/code_calc.tab.c, test/btyacc/code_calc.tab.h, test/btyacc/code_error.code.c, test/btyacc/code_error.output, test/btyacc/code_error.tab.c, test/btyacc/code_error.tab.h, test/btyacc/empty.output, test/btyacc/empty.tab.c, test/btyacc/empty.tab.h, test/btyacc/error.output, test/btyacc/error.tab.c, test/btyacc/error.tab.h, test/btyacc/grammar.output, test/btyacc/grammar.tab.c, test/btyacc/grammar.tab.h, test/btyacc/pure_calc.output, test/btyacc/btyacc_demo.output, test/btyacc/btyacc_demo.tab.h, test/btyacc/calc.output, test/btyacc/calc.tab.c, test/btyacc/calc.tab.h: reference output for testing * defs.h: several changes to help decouple the use of 'short' as the type of value used in yacc parsers. * NOTES-btyacc-Disposition: byacc-btyacc-20140323 2014-03-17 Tom.Shields * skel2c, yaccpar.skel, yaccpar.skel.old: RCS_BASE * test/run_lint.sh: move test-outputs into subdirectories to keep btyacc/yacc results separate * configure.in: add --with-max-table-size and --enable-btyacc options 2014-03-16 Tom.Shields * main.c: use Value_t rather than short 2014-03-11 Tom.Shields * test/empty.y: testcase for btyacc 2014-03-10 Tom.Shields * test/calc3.y, test/calc2.y: fix unused-variable warning 2014-02-18 Tom.Shields * lr0.c, graph.c: use Value_t rather than short * closure.c: use Value_t rather than short ifdef'd forward-reference prototypes to match ifdef'ing of the actual functions * lalr.c: rename MAXSHORT to MAXYYINT 2014-01-01 Thomas E. Dickey * yacc.1: document %token-table, improve presentation of double-quotes * VERSION, package/byacc.spec, package/debian/changelog: bump * test/yacc/calc.tab.c, test/yacc/calc1.tab.c, test/yacc/calc2.tab.c, test/yacc/calc3.tab.c, test/yacc/code_calc.code.c, test/yacc/code_calc.tab.c, test/yacc/code_error.code.c, test/yacc/code_error.tab.c, test/yacc/error.tab.c, test/yacc/grammar.tab.c, test/yacc/pure_calc.tab.c, test/yacc/pure_error.tab.c, test/yacc/quote_calc-s.tab.c, test/yacc/quote_calc.tab.c, test/yacc/quote_calc2-s.tab.c, test/yacc/quote_calc2.tab.c, test/yacc/quote_calc3-s.tab.c, test/yacc/quote_calc3.tab.c, test/yacc/quote_calc4-s.tab.c, test/yacc/quote_calc4.tab.c: reference output for testing * test/calc.tab.c, test/calc1.tab.c, test/calc2.tab.c, test/calc3.tab.c, test/code_calc.code.c, test/code_calc.tab.c, test/code_error.code.c, test/code_error.tab.c, test/error.tab.c, test/ftp.tab.c, test/grammar.tab.c, test/pure_calc.tab.c, test/pure_error.tab.c, test/quote_calc-s.tab.c, test/quote_calc.tab.c, test/quote_calc2-s.tab.c, test/quote_calc2.tab.c, test/quote_calc3-s.tab.c, test/quote_calc3.tab.c, test/quote_calc4-s.tab.c, test/quote_calc4.tab.c: regen * output.c, skeleton.c: amend the last change so that yytname is #define'd as needed rather than permanent - to avoid breaking cproto for instance. 2014-01-01 Christos.Zoulas * output.c, defs.h, main.c, reader.c, skeleton.c: changes to build ntpd using byacc: - rename yyname[] to yytname[] - add YYTRANSLATE() macro - recognize bison's %token-table declaration 2014-01-01 Thomas E. Dickey * configure: regen * yacc.1: s/EE/XE/ to work around groff bug on Debian 6 * makefile.in: use CF_MAKE_DOCS * aclocal.m4: add CF_MAKE_DOCS * configure.in: use CF_MAKE_DOCS 2013-12-26 Thomas E. Dickey * config.guess: 2013-11-29 2013-11-19 Thomas E. Dickey * aclocal.m4: resync with my-autoconf (fixes for clang and mingw) 2013-10-25 Thomas E. Dickey * config.sub: 2013-10-01 2013-09-25 Thomas E. Dickey * reader.c: fix two loop-limits found by clang 3.3 --analyze * configure: regen * aclocal.m4: tweaks to CF_MIXEDCASE_FILENAMES and CF_XOPEN_SOURCE for msys from ncurses * package/mingw-byacc.spec: RCS_BASE * test/calc.tab.c, test/calc1.tab.c, test/calc2.tab.c, test/calc3.tab.c, test/code_calc.code.c, test/code_error.code.c, test/error.tab.c, test/ftp.tab.c, test/grammar.tab.c, test/pure_calc.tab.c, test/pure_error.tab.c, test/quote_calc-s.tab.c, test/quote_calc.tab.c, test/quote_calc2-s.tab.c, test/quote_calc2.tab.c, test/quote_calc3-s.tab.c, test/quote_calc3.tab.c, test/quote_calc4-s.tab.c, test/quote_calc4.tab.c: regen * skeleton.c: Increase default stack-size to match FreeBSD version noted as from "BSD 4.4 Lite Usr.bin Sources". See http://svnweb.freebsd.org/base/vendor/CSRG/dist/usr.bin/yacc/ http://svnweb.freebsd.org/base/head/usr.bin/yacc/ http://svnweb.freebsd.org/base/vendor/byacc/ The original 1.9 sources (on which I based development) used 500 for stacksize; the BSD Lite sources (a year or two later) used 10000. This is a change to default values; the YYMAXDEPTH and YYSTACKSIZE symbols have "always" been overridable by applications, but rarely needed to do this. RedHat began using the FreeBSD source in 2000, and switched to this source in 2007 using the 20050813 snapshot. RedHat #743343 misattributed the change in default stacksize to a regression in byacc, but did not report the issue upstream. * package/debian/changelog, VERSION, package/byacc.spec: bump 2013-09-07 Thomas E. Dickey * config.sub: update to 2013-09-15 * config.guess: update to 2013-06-10 2013-03-04 Thomas E. Dickey * package/debian/changelog, VERSION, package/byacc.spec: bump * aclocal.m4: adapt tweak from Dave Becket to work around long-ago breakage in "new" autoconf. * output.c: fix bogus #include if "-i" is given but not "-d" (report by Richard Mitton). also while testing that, found a case where the union_file is unused; added a check for address that. * test/ftp.output, test/ftp.tab.c, test/ftp.tab.h: regen * test/ftp.y: fix most compiler warnings for "make check_make" * test/calc1.tab.c: regen * test/calc1.y: fix most compiler warnings for "make check_make" * test/calc.tab.c, test/calc1.tab.c, test/calc2.tab.c, test/calc3.tab.c, test/code_calc.code.c, test/code_error.code.c, test/error.tab.c, test/ftp.tab.c, test/grammar.tab.c, test/pure_calc.tab.c, test/pure_error.tab.c, test/quote_calc-s.tab.c, test/quote_calc.tab.c, test/quote_calc2-s.tab.c, test/quote_calc2.tab.c, test/quote_calc3-s.tab.c, test/quote_calc3.tab.c, test/quote_calc4-s.tab.c, test/quote_calc4.tab.c: regen * skeleton.c: quiet a gcc conversion-warning in yygrowstack() * configure: regen * aclocal.m4: another fix for CF_GCC_VERSION to handle Debian's modification of gcc message. 2013-02-10 Thomas E. Dickey * config.sub, config.guess: update to 2013-02-04 2012-10-03 Thomas E. Dickey * package/debian/changelog, package/byacc.spec, VERSION: bump * configure: regen * configure.in: moved AC_PROG_CC_STDC call into CF_PROG_CC * aclocal.m4: moved AC_PROG_CC_STDC call into CF_PROG_CC and (for other uses than byacc) the CF_PROG_CC macro provides the CF_ANSI_CC_REQD for the 2.13 flavor. * aclocal.m4, configure.in: Arian's change dropped my check for misused $CC variable - restore that with alternate macro CF_PROG_CC. 2012-10-03 Adrian.Bunk * aclocal.m4: suggested patch: drop CF_ANSI_CC_REQD, CF_ANSI_CC_CHECK, CF_PROG_EXT since they are not needed. 2012-10-03 Thomas E. Dickey * aclocal.m4: split-out CF_CC_ENV_FLAGS from CF_ANSI_CC_CHECK to avoid losing it in Adrian's suggested changes. * aclocal.m4: CF_CLANG_COMPILER - check if the given compiler is really clang. * aclocal.m4: add check for clang to CF_GCC_WARNINGS. modify CF_GCC_WARNINGS to work around old gcc warning: ncurses change to (try to) use gnatgcc exposed gnatgcc 2.8.1 on my Sarge system (versus 3.3.5 for the normal gcc). The 2.8.1's pointer-arithmetic checks fell afoul of gcc's misuse of void* in string.h; work around by excluding that check for pre-3.x compilers. * aclocal.m4: modify CF_GCC_ATTRIBUTES so that autoheader is able to see the definitions provided by this macro. use AC_DEFINE_UNQUOTED() in CF_GCC_ATTRIBUTES rather than appending to confdefs.h, since long-ago concern about the ability to pass-through parameterized macros appears to be not a problem, testing with 2.13 and 2.52 2012-10-03 Adrian.Bunk * aclocal.m4: add parameter to AC_DEFINE_UNQUOTED() to allow it to be recognized by autoheader, updated macros: CF_CHECK_CACHE CF_DISABLE_LEAKS CF_MKSTEMP CF_MIXEDCASE_FILENAMES CF_NO_LEAKS_OPTION 2012-10-03 Thomas E. Dickey * aclocal.m4: move existence-check for mkstemp out of the AC_TRY_RUN, to help with cross-compiles 2012-10-02 Thomas E. Dickey * config_h.in: Adrian Bunk request - replace this with the output from autoheader 2012-09-29 Adrian.Bunk * configure.in: suggested change: replace CF_ANSI_CC_REQD by AC_PROG_CC_STDC (since no check is needed anymore for standard C compilers), drop AC_CONST (same reason), modify AC_OUTPUT to rely upon template generated by autoheader. bump requirement to autoconf 2.52.20011201 and drop check for CF_PROG_EXT as being obsolete with autoconf 2.52x * configure.in, main.c: drop check for atexit, because it is standard C * makefile.in: add assignment for datarootdir variable. 2012-05-26 Thomas E. Dickey * package/debian/changelog, package/byacc.spec, VERSION: bump * reader.c: some versions of gcc may warn that bp is not set in mark_symbol, e.g., if GCC_NORETURN is not handled; appease the compiler. * reader.c: use the declared types Assoc_t and Value_t in some places where compiler only cared about char versus short. * reader.c: use TMALLOC() and TREALLOC() macros to simplify allocation/reallocation (no object change) * defs.h: add fallbacks for GCC_NORETURN and GCC_UNUSED to make it simpler for *BSD packagers to build without configure script. Also remove duplicate declaration of pure_parser variable (prompted by patch by Baptiste Daroussin). Also define new TMALLOC and TREALLOC macros to simplify/replace MALLOC and REALLOC macros. * symtab.c: use TMALLOC() and TREALLOC() macros to simplify allocation/reallocation (no object change) 2012-05-25 Thomas E. Dickey * output.c, main.c, verbose.c, mkpar.c, lr0.c: use TMALLOC() and TREALLOC() macros to simplify allocation/reallocation (no object change) 2012-01-15 Thomas E. Dickey * package/debian/copyright: bump * test/run_make.sh: workaround for breakage due to GNU make 3.82 * test/run_make.sh: tested with Solaris 10 (bison 1.875) and added scripting to exercise the /usr/ccs/bin/yacc executable * test/grammar.tab.c: regen * test/grammar.y: modify to also build with Solaris yacc * VERSION, package/debian/changelog, package/byacc.spec: bump * test/yacc/calc1.output: reference output for testing * test/calc1.output, test/calc1.tab.c: regen * test/calc1.y: undo the change made to appease bison, since it was only a warning. * test/pure_calc.tab.c, test/pure_error.tab.c: regen * test/run_make.sh: another fix for running from top-level directory * makefile.in: ensure that check_make rule depends on having byacc built. * test/run_make.sh: fixes for building from parent directory * test/pure_error.y, test/pure_calc.y: bison-fixes * test/calc2.tab.c, test/calc3.tab.c, test/code_error.code.c, test/ftp.tab.c, test/pure_calc.tab.c, test/pure_error.tab.c: regen * test/code_debug.y: RCS_BASE * test/calc2.y, test/calc3.y, test/code_error.y, test/ftp.y: byacc already declares yyerror * test/pure_error.y, test/pure_calc.y: modified to help make the files build with bison * test/run_make.sh: supply a "%pure-parser" directive when bison needs it. * test/code_calc.code.c: regen * test/code_calc.y: modified to help make the files build with bison * yacc.1: in testing, found that %expect did not work as documented for bison. do not recommend it for portable code. * test/run_make.sh: workaround breakage in bison's %expect directive * test/grammar.y: modified to help make the files build with bison * test/calc1.output, test/calc1.tab.c, test/grammar.tab.c: regen * test/calc1.y: quiet a spurious warning from bison 2.3 * test/calc1.tab.c: regen * test/calc1.y: modified to help make the files build with bison * yacc.1: comment on "-y" and "-P" options. * yacc.1: comment on portability * test/ftp.tab.c, test/quote_calc-s.tab.c, test/quote_calc.tab.c, test/quote_calc2-s.tab.c, test/quote_calc3-s.tab.c: regen * test/ftp.y: modified to help make the files build with bison (bison's "-y" option is of no use in providing "yacc" compatibility) * test/quote_calc2.tab.c, test/quote_calc3.tab.c, test/quote_calc4-s.tab.c, test/quote_calc4.tab.c: regen * test/code_calc.y, test/quote_calc2.y, test/quote_calc.y, test/quote_calc4.y, test/quote_calc3.y: modified to help make the files build with bison * test/calc.tab.c: regen * test/calc.y: modified to help make the files build with bison * test/error.tab.c: regen * test/error.y: modified to help make the files build with bison * test/calc2.tab.c, test/calc3.tab.c, test/code_error.code.c: regen * test/run_make.sh: check for older bisons which (2.3 for instance) do not support pure parsers * test/code_error.y, test/calc3.y, test/calc2.y: modified to help make the files build with bison * test/run_test.sh: use $opt2 in filenames of the generated files * test/quote_calc2-s.tab.c, test/quote_calc3-s.tab.c, test/quote_calc4-s.tab.c, test/quote_calc-s.tab.c, test/quote_calc.tab.c, test/quote_calc2.tab.c, test/quote_calc3.tab.c, test/quote_calc4.tab.c: regen 2012-01-14 Thomas E. Dickey * test/calc2.tab.c, test/code_calc.code.c, test/code_error.code.c, test/error.tab.c, test/ftp.tab.c, test/grammar.tab.c, test/calc.tab.c, test/calc1.tab.c: regen * output.c: Several changes: a) add YYLEX_PARAM_TYPE, like YYPARSE_PARAM_TYPE, but for yylex. b) modify definitions for YYLEX_DECL to be more like YYPARSE_DECL, using YYLEX_PARAM_TYPE and YYLEX_PARAM. c) add ifdef's around #define's for YYERROR_DECL and YYERROR_CALL, to help with redefinitions. * test/pure_calc.tab.c: modified to help make the files build with bison * test/run_make.sh: start work on followup, to check if the generated files build with bison. * test/pure_calc.y, test/pure_error.tab.c: modified to help make the files build with bison * test/calc3.tab.c: regen * test/quote_calc-s.output, test/quote_calc-s.tab.c, test/quote_calc-s.tab.h, test/quote_calc2-s.output, test/quote_calc2-s.tab.c, test/quote_calc2-s.tab.h, test/quote_calc3-s.output, test/quote_calc3-s.tab.c, test/quote_calc3-s.tab.h, test/quote_calc4-s.output, test/quote_calc4-s.tab.c, test/quote_calc4-s.tab.h: RCS_BASE * test/yacc/quote_calc-s.output, test/yacc/quote_calc-s.tab.h, test/yacc/quote_calc2-s.output, test/yacc/quote_calc2-s.tab.h, test/yacc/quote_calc3-s.output, test/yacc/quote_calc3-s.tab.h, test/yacc/quote_calc4-s.output, test/yacc/quote_calc4-s.tab.h: reference output for testing * test/run_test.sh: generate/test with "-s" option applied. 2012-01-13 Thomas E. Dickey * package/debian/changelog, package/byacc.spec, VERSION: bump * yacc.1: improve documentation of -s option * yacc.1: note that yacc ignores -y * main.c: add -s option to usage message. * test/quote_calc3.output, test/quote_calc3.tab.c, test/quote_calc4.output, test/quote_calc4.tab.c, test/quote_calc4.tab.h: RCS_BASE * test/yacc/quote_calc3.output, test/yacc/quote_calc4.output, test/yacc/quote_calc4.tab.h: reference output for testing * test/quote_calc3.y, test/quote_calc.tab.h: RCS_BASE * test/yacc/quote_calc.tab.h: reference output for testing * test/quote_calc.output, test/quote_calc.tab.c, test/quote_calc2.output, test/quote_calc2.tab.c, test/quote_calc2.tab.h, test/quote_calc3.tab.h: RCS_BASE * test/yacc/quote_calc.output, test/yacc/quote_calc2.output, test/yacc/quote_calc2.tab.h, test/yacc/quote_calc3.tab.h: reference output for testing * test/quote_calc4.y, test/quote_calc.y, test/quote_calc2.y: RCS_BASE * configure: regen * aclocal.m4: resync with my-autoconf, i.e., fixes for CF_XOPEN_SOURCE 2011-12-19 Thomas E. Dickey * package/debian/changelog, package/byacc.spec, VERSION: bump * yacc.1, output.c, main.c, defs.h: add "-s" option to suppress generating #define's based on string contents in a %token statement. For instance %token EQLS "Equals" would generate #define EQLS 256 #define Equals 257 Simply suppressing the second #define makes the behavior closer to yacc. (report by Paulo Andrade). 2011-09-08 Thomas E. Dickey * package/debian/changelog, package/byacc.spec, VERSION: bump * output.c: fix some more interaction between -i and -d flags to ensure YYERRCODE and YYSTYPE are declared, tested with cproto. 2011-09-07 Thomas E. Dickey * yacc.1: document "-i" option. * package/debian/changelog, package/byacc.spec, VERSION: bump * output.c: fix an interaction between -i and -d * test/code_error.code.c, test/error.tab.c, test/ftp.tab.c, test/grammar.tab.c, test/pure_calc.tab.c, test/pure_error.tab.c, test/calc.tab.c, test/calc1.tab.c, test/calc2.tab.c, test/calc3.tab.c, test/code_calc.code.c: regen - changes for "-i" option move the global/impure variables near the macros that may add a prefix, etc. * skeleton.c, output.c, defs.h: changes to support "-i" option. 2011-09-06 Thomas E. Dickey * reader.c: pass explicit file-pointer to write_section() * main.c: add "-i" option, to generate interface-file (suggested by Denis M. Wilson) 2011-09-05 Thomas E. Dickey * configure: regen * aclocal.m4: resync with my-autoconf: CF_ANSI_CC_CHECK (check for $CFLAGS in $CC) and CF_XOPEN_SOURCE (update aix, cygwin and netbsd checks) * defs.h, error.c, reader.c: add check for missing "}" on %parse-param and %lex-param lines (report by Denis M Wilson) 2011-04-01 Thomas E. Dickey * config.sub: update to 2011-04-01 2011-02-02 Thomas E. Dickey * config.guess: update to 2011-01-01 2010-12-29 Thomas E. Dickey * defs.h, skeleton.c: add const qualifier to skeleton data, per NetBSD changes (report by Christos Zoulas) * defs.h: mark all of the error-functions as non-returning (report by Christos Zoulas) * test/grammar.tab.c, test/pure_calc.tab.c, test/pure_error.tab.c, test/calc.tab.c, test/calc1.tab.c, test/calc2.tab.c, test/calc3.tab.c, test/code_calc.code.c, test/code_error.code.c, test/error.tab.c, test/ftp.tab.c: regen * skeleton.c: use only realloc() rather than realloc+malloc, agree that systems needing this are very rare (prompted by NetBSD change). * test/ftp.tab.c: regen 2010-12-29 Christos.Zoulas * test/ftp.y: improve example, which was stuck in 19XX and assumed file sizes were longs. 2010-12-29 Thomas E. Dickey * test/ftp.tab.c, test/grammar.tab.c, test/pure_calc.tab.c, test/pure_error.tab.c, test/calc.tab.c, test/calc1.tab.c, test/calc2.tab.c, test/calc3.tab.c, test/code_calc.code.c, test/code_error.code.c, test/error.tab.c: regen * test/pure_error.y, test/pure_calc.y, test/ftp.y, test/error.y, test/code_error.y, test/code_calc.y, test/calc.y, test/calc3.y, test/calc2.y, test/calc1.y: use byacc's YYLEX_DECL/YYERROR_DECL symbols to prototype yylex/yyerror * skeleton.c: remove explicit prototype for yylex() via YYLEX_DECL() macro, since that would prevent declaring yylex() static (request by Christos Zoulas). * test/calc2.tab.c, test/calc3.tab.c: regen 2010-12-29 Christos.Zoulas * output.c: correct definition for YYERROR_DECL() 2010-12-29 Thomas E. Dickey * package/debian/changelog, package/byacc.spec, VERSION: bump 2010-12-26 Thomas E. Dickey * defs.h, main.c: change return-type of allocate() to avoid warnings of alignment problems * main.c: Solaris declares chmod() in * configure: regen * main.c: ifdef'd use of fcntl.h * configure.in: add configure checks for fcntl.h, atexit and mkstemp * main.c: for cases where mkstemp() is not available, use tempnam/open * aclocal.m4: add CF_MKSTEMP * aclocal.m4: improve quoting, deprecate ${name-value} in favor of standard ${name:-value} 2010-12-25 Thomas E. Dickey * main.c: start revising use of tmpfile(), to make this work with MinGW. Start by implementing a mkstemp() alternative - noting that mkstemp() also is broken for MinGW. * package/debian/changelog, package/byacc.spec, VERSION: bump 2010-11-27 Thomas E. Dickey * package/byacc.spec, package/debian/changelog, VERSION: bump * test/calc2.tab.c, test/calc3.tab.c: regen * output.c: corrected use of %parse-param value in yyerror(); it doesn't use &yylval (report by Clifford Yapp) 2010-11-26 Thomas E. Dickey * skeleton.c: typo * output.c: correct line-numbering when "-r" option is used; the 'outline' variable should only be incremented when writing to the code-file. * test/code_calc.code.c, test/code_error.code.c: regen * yacc.1: bump date * yacc.1: comment on -b option vs -r * test/calc2.tab.c, test/calc2.y, test/calc3.tab.c, test/calc3.y, test/ftp.tab.c, test/grammar.tab.c, test/pure_calc.tab.c, test/pure_error.tab.c, test/calc.tab.c, test/calc1.tab.c, test/code_calc.code.c, test/code_error.code.c, test/error.tab.c: regen * output.c: improve on YYERROR_DECL(), adding dummy params which can be used for the actual function declaration. Also add YYERROR_CALL(). The two macros simplify maintaining sets of grammars which may/may not be pure. * test/calc1.y, test/ftp.tab.c, test/grammar.tab.c, test/pure_calc.tab.c, test/pure_error.tab.c, test/calc.tab.c, test/calc1.tab.c, test/calc2.tab.c, test/calc3.tab.c, test/code_calc.code.c, test/code_error.code.c, test/error.tab.c: regen * output.c: generate yyerror() calls in output.c This is for compatibility with bison, which passes the yylval to yyerror when the %parse-param feature is used. * skeleton.c, defs.h: generate yyerror() calls in output.c * output.c: simplified a little, using putc_code() and putl_code() * test/yacc/calc1.tab.h: reference output for testing * test/calc1.tab.h: regen * reader.c: improve ifdef for YYSTYPE union declaration (report by Clifford Yapp) * reader.c: accept underscore as a replacement for dash in command names, e.g., "%pure_parser" vs "%pure-parser". * test/calc1.tab.c: regen * output.c, reader.c: also ifdef YYSTYPE declaration in the generated code (report by Clifford Yapp) * package/debian/changelog, package/byacc.spec, VERSION: bump 2010-11-24 Thomas E. Dickey * main.c, defs.h, symtab.c, error.c: reduce global variables * package/debian/changelog, package/byacc.spec, VERSION: bump * reader.c: amend fix for Redhat #112617 to still call default_action_warning() for empty rules (report by Bruce Cran). 2010-11-22 Thomas E. Dickey * output.c: add ifdef to guard against redefinition of YYSTYPE union (request by Clifford Yapp). * test/calc1.tab.c: regen * test/calc1.y: cleanup compiler warnings * test/grammar.y: add "%expect" * test/calc1.tab.h: regen * test/calc1.output, test/calc1.tab.c, test/calc1.tab.h: RCS_BASE * test/calc2.tab.c, test/calc3.tab.c: regen * test/calc1.y: advanced example from Steve Johnson's paper, uses unions * test/calc3.y, test/calc2.y: init 'base', so examples can run * test/ftp.tab.c, test/ftp.y: tweaks to compile with g++ * output.c: compensate for fix in reader.c * reader.c: add/use putc_both() and puts_both(), incidentally fixing a place where a union copied to the union_file may be missing the end of the last line. * package/debian/changelog, package/byacc.spec, VERSION: bump 2010-09-28 Thomas E. Dickey * config.guess: update to 2010-09-24 2010-09-10 Thomas E. Dickey * config.sub: update to 2010-09-11 2010-06-10 Thomas E. Dickey * yacc.1, package/debian/changelog, package/byacc.spec, VERSION: bump to 2010/06/10 2010-06-09 Thomas E. Dickey * reader.c: free declarations in leak-testing code. * main.c: close code_file if -r option used, for leak-testing * defs.h, reader.c: improve %lex-param / %parse-param implementation by allowing for arrays to be passed as parameters, e.g., "int regs[26]". * test/calc3.tab.c, test/calc3.y, test/calc3.output, test/calc3.tab.h: RCS_BASE * test/yacc/calc3.output, test/yacc/calc3.tab.h: reference output for testing * test/calc2.tab.c, test/calc2.y, test/calc2.tab.h: RCS_BASE * test/yacc/calc2.tab.h: reference output for testing * test/calc2.output: RCS_BASE * test/yacc/calc2.output: reference output for testing * output.c: improve %lex-param / %parse-param implementation by allowing for arrays to be passed as parameters, e.g., "int regs[26]". * test/calc.tab.c, test/calc.y: test-cases and reference files for %lex-param / %parse-param * makefile.in: add docs-rule, for html/pdf/txt form of manpage * configure: regen * aclocal.m4: add CF_XOPEN_SOURCE, etc. * configure.in: use CF_XOPEN_SOURCE check to ensure that strdup is in scope, e.g., for c89 * test/ftp.tab.c, test/ftp.y, reader.c, symtab.c, verbose.c, lr0.c, main.c, mkpar.c, output.c, defs.h, closure.c: fix warnings from clang --analyze 2010-06-08 Thomas E. Dickey * output.c: fix to build with c89, etc. * reader.c: gcc warning * test/ftp.tab.c, test/ftp.y, test/calc.tab.c, test/code_calc.code.c, test/code_error.code.c, test/code_error.y, test/code_calc.y, test/calc.y, test/pure_error.tab.c, test/error.tab.c, test/error.y, test/pure_error.y, test/pure_calc.tab.c, test/pure_calc.y: modified test-cases to allow them to compile, to validate pure-parser changes. updated reference files to match. * output.c: move call for output_stype() earlier since it is used in pure-parser declarations * test/grammar.tab.c, test/grammar.y: modified test-cases to allow them to compile, to validate pure-parser changes. updated reference files to match. * test/calc.tab.c, test/error.tab.c, test/ftp.tab.c, test/grammar.tab.c: regen * yacc.1: document %lex-param and %parse-param * test/run_lint.sh, test/run_make.sh: RCS_BASE * test/run_test.sh: further modify to allow build-directory to be in a different location by passing this directory's location as a parameter to the script. * makefile.in: add check_make and check_lint rules to help validate the generated files in the test-directory 2010-06-07 Thomas E. Dickey * test/pure_calc.tab.c, test/pure_error.tab.c: RCS_BASE * test/run_test.sh: provide for testing -r and -P options by checking if the ".y" filename begins with "code_" or "pure_", respectively. * test/code_error.code.c, test/code_error.tab.c, test/code_error.tab.h: RCS_BASE * test/yacc/code_error.tab.h: reference output for testing * test/code_calc.code.c, test/code_calc.tab.c, test/code_calc.tab.h: RCS_BASE * test/yacc/code_calc.tab.h: reference output for testing * test/pure_calc.output, test/pure_calc.tab.h, test/pure_error.output, test/pure_error.tab.h: RCS_BASE * test/yacc/pure_calc.output, test/yacc/pure_calc.tab.h, test/yacc/pure_error.output, test/yacc/pure_error.tab.h: reference output for testing * test/code_calc.output, test/code_error.output: RCS_BASE * test/yacc/code_calc.output, test/yacc/code_error.output: reference output for testing * test/error.tab.c, test/ftp.tab.c, test/grammar.tab.c: regen * test/run_test.sh: changes to support running "make check" in a separate build-tree * main.c: add "-P" to usage message * reader.c: use UCH() macro to hide casts. 2010-06-07 Andres.Mejia * main.c, output.c, reader.c, defs.h, skeleton.c: Fix the output order of the generated parse code file. This allows for the use of YYPARSE_PARAM, by having the output that checks for YYPARSE_PARAM to be defined come after the C code block in the definitions section of a yacc file. Implement support for YYLEX_PARAM, similar to bison. This is useful for support for building reentrant lexers with flex. Fix a compatibility issue with bison's pure-parser option. Bison defines yylex as sending at least one parameter, &yylval, as the first parameter and doesn't seem to have an easy way to remove that parameter. This on the other hand is rather convenient to support saving to yylval from flex when building reentrant lexers and parsers. Add support for the %parse-param and %lex-param directives used in bison. This change bears some similarity to NetBSD's changes to byacc at http://www.mail-archive.com/source-changes-full@netbsd.org/msg08143.html Bison allows for POSIX yacc emulation via a yacc directive in the yacc file, and also via a command line switch. Implement this feature as a no-op for byacc, since byacc is designed to be POSIX yacc compatible anyway. This allows for better compatibility with yacc sources written for bison. 2010-06-07 Thomas E. Dickey * VERSION: bump to 2010/06/07 2010-06-06 Thomas E. Dickey * test/calc.tab.c, configure: regen * skeleton.c: move #include's down into the generated code, to allow user-defined code to override feature definitions, particularly with stdlib.h (request by Marcus Kool). * lr0.c, error.c, reader.c, defs.h: strict gcc 3.4.6 warnings on 64-bit platform * aclocal.m4, configure.in: add check for lint * makefile.in: add lint rule * defs.h, closure.c, lr0.c, warshall.c, main.c: fix gcc warnings, mostly for 64-bit platform * aclocal.m4: add macros for checking ctags/etags, e.g., to work with NetBSD pkgsrc * makefile.in: add etags/TAGS if available * configure.in: add configure check for actual ctags and etags programs * package/debian/copyright: add copyright notices for non-PD files * package/debian/changelog: incorporated scripts in upstream to use for test-builds * makefile.in: drop mkdirs.sh, just use "mkdir -p" * AUTHORS: nicknames for some contributors (see CHANGES for details) * package/byacc.spec: RPM file for byacc * VERSION: bump to 2010/06/06 * aclocal.m4: add copyright notice, from "my-autoconf" macros http://invisible-island.net/autoconf/autoconf.html * package/RCS, package/debian/RCS, package/debian/source/RCS, package/pkgsrc/RCS: PERMIT FILE * aclocal.m4: resync with my-autoconf. summary of changes: a) CF_ADD_CFLAGS, etc., improve quoting of ifelse() parameter b) CF_DISABLE_ECHO, change indent-convention for substituted makefile c) CF_GCC_VERSION, ignore stderr d) CF_GCC_WARNINGS, adjust options to work with c89 wrapper of gcc 2010-04-20 Thomas E. Dickey * package/debian/changelog, package/debian/compat, package/debian/control, package/debian/copyright, package/debian/docs, package/debian/postinst, package/debian/prerm, package/debian/rules, package/debian/watch: scripts from Debian package 2010-02-16 Thomas E. Dickey * yacc.1: document -P and bison-extensions * test/ftp.tab.c, test/grammar.tab.c, test/calc.tab.c, test/error.tab.c: regen * output.c: implement %pure-parser * skeleton.c: implement %pure-parser, like bison. To help with this, changed the stack variables, putting them into a struct. * reader.c: implement %pure-parser * defs.h: modified skeleton to support %pure-parser feature * main.c: add -P option to set %pure-parser * output.c: make -r and -p options work together. The -r option splits the generated parser into code/table files; for this case we cannot use static data. Also, we have to repeat the #define's used for prefix (-p) as well as the redeclaration of yyparse(). Finally, allow any of the prefixed names to be overridden, e.g., by passing a -D option to the compiler. Make that a little more readable by putting a blank line before each chunk. * defs.h: add definitions for %pure-parser * skeleton.c: put blank line before/after the redeclaration of yyparse() * output.c: allow for other program redefining yylex() * skeleton.c: split-off xdecls[] array, to move declaration of yyparse() after #define's * defs.h: split-out xdecls[] * VERSION: bump * configure: regen * aclocal.m4: add CF_REMOVE_DEFINE, needed by CF_ADD_CFLAGS * aclocal.m4: resync with my-autoconf CF_ADD_CFLAGS and CF_DISABLE_ECHO changes. 2010-02-16 Ostap.Cherkashi * skeleton.c: fix a memory leak in the generated skeleton 2010-01-01 Thomas E. Dickey * package/debian/source/format: scripts from Debian package 2009-12-31 Thomas E. Dickey * config.guess: update to 2009-12-30 * config.sub: update to 2009-12-31 2009-10-27 Thomas E. Dickey * VERSION: 20091027 * output.c, mkpar.c, defs.h, lalr.c, closure.c, graph.c, lr0.c, verbose.c, main.c, reader.c: strict compiler warnings 2009-10-26 Thomas E. Dickey * test/ftp.tab.c, test/grammar.tab.c, test/calc.tab.c, test/error.tab.c: resync * main.c, defs.h: introduce some typedefs for portability, etc. * makefile.in: don't remove "*.log" in mostlyclean rule since it interferes with regression script. * configure: regen * aclocal.m4: resync with my-autoconf 2009-08-25 Thomas E. Dickey * config.guess, config.sub: update to 2009-08-19 2009-02-21 Thomas E. Dickey * VERSION: bump * output.c: restore "yylval" symbol, omitted in cleanup on 2008/8/25 2008-12-26 Thomas E. Dickey * configure: regen with autoconf-2.52 (patched) 2008-12-25 Thomas E. Dickey * test/error.tab.c, test/ftp.tab.c, test/grammar.tab.c, test/calc.tab.c: regenerated 2008-12-24 Thomas E. Dickey * VERSION: bump * skeleton.c: remove ifdef-lint from goto yyerrlab, to quiet gcc warning 2008-11-26 Thomas E. Dickey * verbose.c, main.c, defs.h, mkpar.c, reader.c: completed implementation of "%expect" (report by Perry E. Metzger). add "%expect-rr", which is (unlike bison) allowable in LALR parsers. 2008-11-24 Thomas E. Dickey * closure.c, defs.h, error.c, graph.c, lalr.c, lr0.c, main.c, mkpar.c, output.c, reader.c, skeleton.c, symtab.c, verbose.c, warshall.c: change indent-style (request by Perry E. Metzger) 2008-08-27 Thomas E. Dickey * test/calc.tab.c, test/error.tab.c, test/ftp.tab.c, test/grammar.tab.c: better implementation of YYPARSE_PARAM, using YYPARSE_DECL() macro * VERSION: bump * skeleton.c: better implementation of YYPARSE_PARAM, using YYPARSE_DECL() macro * test/calc.tab.c, test/error.tab.c, test/ftp.tab.c, test/grammar.tab.c, skeleton.c: change YYRECOVERING to YYRECOVERING(), for compatibility with other yacc's. * configure: regen'd * configure.in: add -Wwrite-strings to warnings * test/ftp.tab.c, test/grammar.tab.c, test/calc.tab.c, test/error.tab.c: add YYPARSE_PARAM and YYPARSE_PARAM_TYPE * skeleton.c: add YYPARSE_PARAM (bison) and YYPARSE_PARAM_TYPE (FreeBSD) features. * main.c, defs.h, output.c, skeleton.c, symtab.c, error.c, reader.c: fixes for gcc -Wwrite-strings * test/calc.tab.c, test/error.tab.c, test/ftp.tab.c, test/grammar.tab.c: generate the tables as static-const (this is an interface change) * output.c: realign columns in start_table() * output.c: generate the tables as static-const (this is an interface change) * output.c: reorder functions to eliminate forward-references * test/calc.tab.c, test/error.tab.c, test/ftp.tab.c, test/grammar.tab.c: remove 'register' keywords 2008-08-26 Thomas E. Dickey * warshall.c, verbose.c, symtab.c, skeleton.c, reader.c, output.c, mkpar.c, main.c, lr0.c, lalr.c, graph.c, error.c, closure.c: remove 'register' keywords 2008-08-25 Thomas E. Dickey * test/ftp.tab.c: regen'd * reader.c: improve the left-curly fix by testing after blanks, to avoid having a " {" at the beginning of a line. * test/error.tab.c, test/grammar.tab.c: regen'd * output.c: move the remaining newline-counting into write_XXX functions. * test/calc.tab.c: regen'd * output.c: simplify part of the output_file formatting using new functions, e.g., start_int_table(), output_newline(). * reader.c: modify copy_action() to indent the first character, it if is is left-curly brace. That makes the output look more like the original, as well as makes it simpler to edit (not confuse editors which look for a left-curly in the first column as if it were the beginning of a function). * skeleton.c: minor fixes to avoid gcc -Wconversion warnings * output.c: align the #define's produced for "-p" option * test/run_test.sh: use the "-p" option for better coverage. * output.c: simplify output_prefix() with new define_prefixed() * skeleton.c: include string.h, for memset() change stack size to unsigned to fix gcc -Wconversion warnings. * VERSION: bump to 2008/8/25 * makefile.in: add dependency on VERSION file. 2008-08-24 Thomas E. Dickey * VERSION: bump * lalr.c: improved memory-leak checking by freeing data in includes[] * test/error.tab.c, test/ftp.tab.c, test/grammar.tab.c, test/calc.tab.c: update to match skeleton-change * configure: regen'd * skeleton.c: Add fix for stack discussed http://undeadly.org/cgi?action=article&sid=20080708155228 and applied http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/yacc/skeleton.c.diff?r1=1.28&r2=1.29 * aclocal.m4: resync with my-autoconf (no major changes) 2008-07-24 Thomas E. Dickey * package/pkgsrc/Makefile, package/pkgsrc/distinfo: scripts from NetBSD pkgsrc, for test-builds 2008-03-14 Thomas E. Dickey * config.sub: update to 2008-03-08 * config.guess: update to 2008-03-12 2007-05-09 Thomas E. Dickey * main.c: close graph, verbose files if opened, on exit. * main.c: audit memory leaks - valgrind reported some memory still in use on exit. * lalr.c, output.c, reader.c, mkpar.c, lr0.c: add hook for auditing memory leaks * defs.h: add hooks for auditing memory leaks * configure: regen'd * configure.in: use CF_DISABLE_LEAKS, which combines --disable-leaks, --with-valgrind, --with-dbmalloc and --with-dmalloc * aclocal.m4: add CF_DISABLE_LEAKS and CF_WITH_VALGRIND * aclocal.m4: improve version-checking in CF_GCC_VERSION rework dbmalloc/dmalloc options using CF_NO_LEAKS_OPTION macro * VERSION: 2007/5/9 * main.c: file_prefix did not always have a trailing null. 2007-03-25 Thomas E. Dickey * mkdirs.sh: improved version for "make -j" 2006-12-22 Thomas E. Dickey * config.guess: update to 2006/12/22 2006-12-08 Thomas E. Dickey * config.sub: update to 2006/12/08 2005-08-13 Thomas E. Dickey * main.c: add -V to usage message * makefile.in: remove -t option from ctags * VERSION: 2005/8/13 2005-08-13 schmitz * main.c: Sylvain Schmitz: modify the '-o' option to work like bison's, which sets the file-prefix. 2005-08-13 Matt.Kraai * output.c: Debian #322858 (don't close union_file, which contained data). This feature is used in groff. 2005-08-13 Thomas E. Dickey * configure: regenerated * aclocal.m4: improve checks for Intel compiler warnings 2005-06-25 Thomas E. Dickey * config.sub: update to 2005/6/2 * config.guess: update to 2005/5/27 2005-05-05 Thomas E. Dickey * defs.h: add a fallback for GCC_UNUSED 2005-05-04 Thomas E. Dickey * makefile.in: add "." to include-path to pickup config.h * reader.c: apply fix suggested by Steve Dum for end_rule() in Redhat Bugzilla #112617. * output.c: correct a limit check in pack_vector() - report/analysis by William Evans * main.c: exit after printing version. Otherwise "yacc -V" will exit with an erro after printing the usage message. * test/calc.tab.c, test/error.tab.c, test/ftp.tab.c, test/grammar.tab.c: regenerated after skeleton-changes * skeleton.c: replace a few -1's with YYEMPTY * skeleton.c: delete yynewerror (no one uses it any more, and it just makes compiler warnings) * skeleton.c: adapt yygrowstack() and related definitions from FreeBSD * test/run_test.sh: filter out lines with YYPATCH, since that will change with each update * yacc.1: add -V option * main.c: add -V option to print the version. simplify option-parsing by moving the duplicate logic for setting flags into new function setflag(). * skeleton.c: move the actual definition of YYMAJOR and YYMINOR to defs.h (as numbers). add YYPATCH here so it can be tested by applications. * defs.h: add macros to define VERSION in terms of the (numeric) YYMAJOR, YYMINOR and YYPATCH symbols. * lalr.c, lr0.c, mkpar.c, defs.h, closure.c, warshall.c, output.c, verbose.c, graph.c, reader.c, main.c, symtab.c: reduce externs by making static the procedures that are not referenced outside the module in which they are defined. * makefile.in: the VERSION file holds the patch-date. Define YYPATCH, so this will be compiled into the skeleton. * VERSION: patch-level for byacc * main.c: add "-o" to usage message. It is too long for a single line; rewrite usage() to show one option per line. 2005-05-03 Thomas E. Dickey * main.c: add -o option, to work with scripts that assume bison. simplify create_file_names() with a macro. simplify done() with a macro. adapt fix from FreeBSD for signal race, e.g., if done() is interrupted by onintr(), do not flush output via exit(), but use _exit() instead. * defs.h: remove unnecessary externs for main.c * yacc.1: add -o option * graph.c: remove unused parameter * mkpar.c, defs.h, reader.c: add support for "%expect", a bison feature from FreeBSD sources * lr0.c, reader.c, main.c, skeleton.c, graph.c, symtab.c, closure.c, mkpar.c, lalr.c, error.c, warshall.c, verbose.c, output.c: indent'd * configure: regenerated for 2005/5/5 * aclocal.m4: miscellaneous updates (adds CF_INTEL_COMPILER) 2005-04-27 schmitz * defs.h, graph.c, lr0.c, main.c, makefile.in, reader.c, yacc.1: Sylvain Schmitz : add graphical output of the LALR(1) automaton for graphviz, associated with command-line option `-g' 2005-04-16 Thomas E. Dickey * config.sub: update to 2005/2/10 * config.guess: update to 2005/3/24 2005-04-13 Thomas E. Dickey * package/pkgsrc/PLIST: scripts from NetBSD pkgsrc, for test-builds 2005-03-21 Thomas E. Dickey * package/pkgsrc/DESCR: scripts from NetBSD pkgsrc, for test-builds 2004-03-28 Thomas E. Dickey * test/calc.tab.c, test/error.tab.c, test/ftp.tab.c, test/grammar.tab.c: updates due to adding yyparse() prototype * configure: RCS_BASE * configure.in: add AC_ARG_PROGRAM to make --program-prefix, etc., work. * makefile.in: first cut of script to support --program-prefix * configure.in: reorder AC_INIT/AC_CONFIG_HEADER to make this "work" with autoconf 2.52 * makefile.in: modify so DESTDIR works * makefile.in: use EXEEXT and OBJEXT * configure.in: use CF_PROG_EXT generate a config.h * defs.h: make this use the generated config.h * skeleton.c: add a forward-reference for yyparse() * aclocal.m4: add CF_CHECK_CACHE, needed for CF_PROG_EXT * yacc.1: remove the discussion of TMPDIR since it is obsolete * skeleton.c: fix a couple of minor compiler-warnings in the skeleton * defs.h: remove action_file_name, etc., since we use tmpfile() now. * main.c: use tmpfile() for opening the working files. This quiets a warning advising the use of mkstemp(). * output.c: Do not close temporary-files here, since they are opened with tmpfile(). Just rewind them, and they're ready to read back the data stored in them. * test/grammar.output, test/grammar.tab.c, test/grammar.tab.h: RCS_BASE * test/yacc/grammar.output, test/yacc/grammar.tab.h: reference output for testing * makefile.in: turn on "make check" rule * test/calc.output: RCS_BASE * test/yacc/calc.output: reference output for testing * test/run_test.sh, test/calc.tab.h: RCS_BASE * test/yacc/calc.tab.h: reference output for testing * test/ftp.tab.c: yyparse() is now yyparse(void) * test/calc.tab.c: RCS_BASE * test/error.tab.c: yyparse() is now yyparse(void) * test/README: RCS_BASE * yacc.1: various typography fixes prompted by Debian #100947 * aclocal.m4, makefile.in, configure.in: RCS_BASE * README: updated to note that this is not the original 2004-03-24 Thomas E. Dickey * test/grammar.y: RCS_BASE 2004-02-23 Thomas E. Dickey * config.sub: RCS_BASE 2004-02-17 Thomas E. Dickey * config.guess: RCS_BASE 2003-11-29 Thomas E. Dickey * install-sh: improved quoting 2002-06-29 Thomas E. Dickey * mkdirs.sh: don't use character range, since some locales don't work as expected 2001-06-22 Thomas E. Dickey * install-sh: RCS_BASE 2000-11-20 Thomas E. Dickey * test/calc.y: RCS_BASE * test/code_calc.y, test/pure_calc.y: copy of calc.y * vmsbuild.com: original version 2000-02-23 dickey@clark.net * test/RCS, RCS: PERMIT FILE 2000-02-14 Thomas E. Dickey * main.c: fix for VMS port - making pathname for temp-file * descrip.mms: original version 2000-02-13 Thomas E. Dickey * defs.h, verbose.c, reader.c, main.c, skeleton.c, warshall.c, symtab.c, closure.c, mkpar.c, lalr.c, lr0.c, output.c, error.c: ansify 1999-11-30 Thomas E. Dickey * mkdirs.sh: RCS_BASE 1995-01-01 Thomas E. Dickey * config_h.in: RCS_BASE 1993-12-23 unknown * README.DOS, main.c: MSDOS-port 1993-12-22 unknown * reader.c, defs.h: MSDOS-port 1993-03-02 unknown * README: original version 1993-02-22 unknown * test/ftp.output, test/ftp.tab.c, test/ftp.tab.h: RCS_BASE 1993-02-22 Thomas E. Dickey * test/yacc/error.output, test/yacc/error.tab.h: reference output for testing 1993-02-22 unknown * test/error.output, test/error.tab.c, test/error.tab.h: RCS_BASE * skeleton.c, warshall.c, main.c, output.c, reader.c, closure.c, NOTES: original version 1992-10-12 unknown * yacc.1: original version 1992-10-11 unknown * defs.h: original version 1991-01-20 unknown * mkpar.c, verbose.c: original version 1991-01-14 unknown * lr0.c, Makefile, Makefile.old: original version 1990-07-16 unknown * NEW_FEATURES: original version 1990-06-03 unknown * ACKNOWLEDGEMENTS: original version 1990-02-05 unknown * symtab.c, lalr.c, error.c: original version 1990-01-16 Thomas E. Dickey * test/code_error.y, test/pure_error.y: RCS_BASE 1990-01-16 unknown * test/error.y: RCS_BASE 1989-11-22 unknown * NO_WARRANTY: original version 1989-09-23 unknown * test/ftp.y: RCS_BASE Index: head/contrib/byacc/MANIFEST =================================================================== --- head/contrib/byacc/MANIFEST (revision 313104) +++ head/contrib/byacc/MANIFEST (revision 313105) @@ -1,667 +1,695 @@ -MANIFEST for byacc-20161202, version t20161202 +MANIFEST for byacc-20170201, version t20170201 -------------------------------------------------------------------------------- MANIFEST this file ACKNOWLEDGEMENTS original version of byacc - 1993 AUTHORS nicknames for some contributors (see CHANGES for details) Makefile.old renamed from Makefile NEW_FEATURES original version of byacc - 1993 NOTES original version of byacc - 1993 NO_WARRANTY original version of byacc - 1993 README original version of byacc - 1993 README.BTYACC byacc-btyacc-20140323 VERSION patch-level aclocal.m4 macros for configure-script btyaccpar.c generated from btyaccpar.skel btyaccpar.skel bytacc's parser skeleton (renamed from yaccpar.skel) closure.c original version of byacc - 1993 config.guess configure-script utility config.sub configure-script utility config_h.in template for config.h configure snapshot 2004/3/28 configure.in template for configure-script defs.h original version of byacc - 1993 descrip.mms build-script for VMS error.c original version of byacc - 1993 graph.c write the file y.dot in graphviz format install-sh install-script lalr.c original version of byacc - 1993 lr0.c original version of byacc - 1993 main.c original version of byacc - 1993 makefile.in template for makefile mkpar.c original version of byacc - 1993 mstring.c string-utilities output.c original version of byacc - 1993 reader.c original version of byacc - 1993 skel2c awk script to transform yaccpar.skel into skeleton.c symtab.c original version of byacc - 1993 verbose.c original version of byacc - 1993 vmsbuild.com build-script for VMS warshall.c original version of byacc - 1993 yacc.1 original version of byacc - 1993 yaccpar.c generated from yaccpar.skel yaccpar.skel data which can be transformed into skeleton.c package subdirectory package/byacc.spec RPM file for byacc package/debian subdirectory package/debian/changelog scripts from Debian package package/debian/compat scripts from Debian package package/debian/control scripts from Debian package package/debian/copyright scripts from Debian package package/debian/docs scripts from Debian package package/debian/postinst scripts from Debian package package/debian/prerm scripts from Debian package package/debian/rules scripts from Debian package package/debian/source subdirectory package/debian/source/format scripts from Debian package package/debian subdirectory package/debian/watch scripts from Debian package package subdirectory package/mingw-byacc.spec mingw spec-file, for cross-compiles package/pkgsrc subdirectory package/pkgsrc/DESCR scripts from NetBSD pkgsrc, for test-builds package/pkgsrc/Makefile scripts from NetBSD pkgsrc, for test-builds package/pkgsrc/PLIST scripts from NetBSD pkgsrc, for test-builds package/pkgsrc/distinfo scripts from NetBSD pkgsrc, for test-builds test subdirectory test/README describe contents of "test" subdirectory test/btyacc subdirectory test/btyacc/big_b.error exercise -L/-B options test/btyacc/big_b.output exercise -L/-B options test/btyacc/big_l.error exercise -L/-B options test/btyacc/big_l.output exercise -L/-B options test/btyacc/btyacc_calc1.error reference output for testing test/btyacc/btyacc_calc1.output reference output for testing test/btyacc/btyacc_calc1.tab.c reference output for testing test/btyacc/btyacc_calc1.tab.h reference output for testing test/btyacc/btyacc_demo.error reference output for testing test/btyacc/btyacc_demo.output reference output for testing test/btyacc/btyacc_demo.tab.c reference output for testing test/btyacc/btyacc_demo.tab.h reference output for testing +test/btyacc/btyacc_demo2.error reference output for testing +test/btyacc/btyacc_demo2.output reference output for testing +test/btyacc/btyacc_demo2.tab.c reference output for testing +test/btyacc/btyacc_demo2.tab.h reference output for testing +test/btyacc/btyacc_destroy1.error reference output for testing +test/btyacc/btyacc_destroy1.output reference output for testing +test/btyacc/btyacc_destroy1.tab.c reference output for testing +test/btyacc/btyacc_destroy1.tab.h reference output for testing +test/btyacc/btyacc_destroy2.error reference output for testing +test/btyacc/btyacc_destroy2.output reference output for testing +test/btyacc/btyacc_destroy2.tab.c reference output for testing +test/btyacc/btyacc_destroy2.tab.h reference output for testing +test/btyacc/btyacc_destroy3.error reference output for testing +test/btyacc/btyacc_destroy3.output reference output for testing +test/btyacc/btyacc_destroy3.tab.c reference output for testing +test/btyacc/btyacc_destroy3.tab.h reference output for testing test/btyacc/calc.error reference output for testing test/btyacc/calc.output reference output for testing test/btyacc/calc.tab.c reference output for testing test/btyacc/calc.tab.h reference output for testing test/btyacc/calc1.error reference output for testing test/btyacc/calc1.output reference output for testing test/btyacc/calc1.tab.c reference output for testing test/btyacc/calc1.tab.h reference output for testing test/btyacc/calc2.error reference output for testing test/btyacc/calc2.output reference output for testing test/btyacc/calc2.tab.c reference output for testing test/btyacc/calc2.tab.h reference output for testing test/btyacc/calc3.error reference output for testing test/btyacc/calc3.output reference output for testing test/btyacc/calc3.tab.c reference output for testing test/btyacc/calc3.tab.h reference output for testing test/btyacc/code_calc.code.c reference output for testing test/btyacc/code_calc.error reference output for testing test/btyacc/code_calc.output reference output for testing test/btyacc/code_calc.tab.c reference output for testing test/btyacc/code_calc.tab.h reference output for testing test/btyacc/code_debug.c reference for test-output test/btyacc/code_debug.error reference for test-output test/btyacc/code_debug.h reference for test-output test/btyacc/code_debug.i reference for test-output test/btyacc/code_debug.output reference for test-output test/btyacc/code_error.code.c reference output for testing test/btyacc/code_error.error reference output for testing test/btyacc/code_error.output reference output for testing test/btyacc/code_error.tab.c reference output for testing test/btyacc/code_error.tab.h reference output for testing test/btyacc/empty.error reference output for testing test/btyacc/empty.output reference output for testing test/btyacc/empty.tab.c reference output for testing test/btyacc/empty.tab.h reference output for testing test/btyacc/err_inherit1.error reference output for testing test/btyacc/err_inherit1.output reference output for testing test/btyacc/err_inherit1.tab.c reference output for testing test/btyacc/err_inherit1.tab.h reference output for testing test/btyacc/err_inherit2.error reference output for testing test/btyacc/err_inherit2.output reference output for testing test/btyacc/err_inherit2.tab.c reference output for testing test/btyacc/err_inherit2.tab.h reference output for testing test/btyacc/err_inherit3.error reference output for testing test/btyacc/err_inherit3.output reference output for testing test/btyacc/err_inherit3.tab.c reference output for testing test/btyacc/err_inherit3.tab.h reference output for testing test/btyacc/err_inherit4.error reference output for testing test/btyacc/err_inherit4.output reference output for testing test/btyacc/err_inherit4.tab.c reference output for testing test/btyacc/err_inherit4.tab.h reference output for testing test/btyacc/err_inherit5.error reference output for testing test/btyacc/err_inherit5.output reference output for testing test/btyacc/err_inherit5.tab.c reference output for testing test/btyacc/err_inherit5.tab.h reference output for testing test/btyacc/err_syntax1.error reference output for testing test/btyacc/err_syntax1.output reference output for testing test/btyacc/err_syntax1.tab.c reference output for testing test/btyacc/err_syntax1.tab.h reference output for testing test/btyacc/err_syntax10.error reference output for testing test/btyacc/err_syntax10.output reference output for testing test/btyacc/err_syntax10.tab.c reference output for testing test/btyacc/err_syntax10.tab.h reference output for testing test/btyacc/err_syntax11.error reference output for testing test/btyacc/err_syntax11.output reference output for testing test/btyacc/err_syntax11.tab.c reference output for testing test/btyacc/err_syntax11.tab.h reference output for testing test/btyacc/err_syntax12.error reference output for testing test/btyacc/err_syntax12.output reference output for testing test/btyacc/err_syntax12.tab.c reference output for testing test/btyacc/err_syntax12.tab.h reference output for testing test/btyacc/err_syntax13.error reference output for testing test/btyacc/err_syntax13.output reference output for testing test/btyacc/err_syntax13.tab.c reference output for testing test/btyacc/err_syntax13.tab.h reference output for testing test/btyacc/err_syntax14.error reference output for testing test/btyacc/err_syntax14.output reference output for testing test/btyacc/err_syntax14.tab.c reference output for testing test/btyacc/err_syntax14.tab.h reference output for testing test/btyacc/err_syntax15.error reference output for testing test/btyacc/err_syntax15.output reference output for testing test/btyacc/err_syntax15.tab.c reference output for testing test/btyacc/err_syntax15.tab.h reference output for testing test/btyacc/err_syntax16.error reference output for testing test/btyacc/err_syntax16.output reference output for testing test/btyacc/err_syntax16.tab.c reference output for testing test/btyacc/err_syntax16.tab.h reference output for testing test/btyacc/err_syntax17.error reference output for testing test/btyacc/err_syntax17.output reference output for testing test/btyacc/err_syntax17.tab.c reference output for testing test/btyacc/err_syntax17.tab.h reference output for testing test/btyacc/err_syntax18.error reference output for testing test/btyacc/err_syntax18.output reference output for testing test/btyacc/err_syntax18.tab.c reference output for testing test/btyacc/err_syntax18.tab.h reference output for testing test/btyacc/err_syntax19.error reference output for testing test/btyacc/err_syntax19.output reference output for testing test/btyacc/err_syntax19.tab.c reference output for testing test/btyacc/err_syntax19.tab.h reference output for testing test/btyacc/err_syntax2.error reference output for testing test/btyacc/err_syntax2.output reference output for testing test/btyacc/err_syntax2.tab.c reference output for testing test/btyacc/err_syntax2.tab.h reference output for testing test/btyacc/err_syntax20.error reference output for testing test/btyacc/err_syntax20.output reference output for testing test/btyacc/err_syntax20.tab.c reference output for testing test/btyacc/err_syntax20.tab.h reference output for testing test/btyacc/err_syntax21.error reference output for testing test/btyacc/err_syntax21.output reference output for testing test/btyacc/err_syntax21.tab.c reference output for testing test/btyacc/err_syntax21.tab.h reference output for testing test/btyacc/err_syntax22.error reference output for testing test/btyacc/err_syntax22.output reference output for testing test/btyacc/err_syntax22.tab.c reference output for testing test/btyacc/err_syntax22.tab.h reference output for testing test/btyacc/err_syntax23.error reference output for testing test/btyacc/err_syntax23.output reference output for testing test/btyacc/err_syntax23.tab.c reference output for testing test/btyacc/err_syntax23.tab.h reference output for testing test/btyacc/err_syntax24.error reference output for testing test/btyacc/err_syntax24.output reference output for testing test/btyacc/err_syntax24.tab.c reference output for testing test/btyacc/err_syntax24.tab.h reference output for testing test/btyacc/err_syntax25.error reference output for testing test/btyacc/err_syntax25.output reference output for testing test/btyacc/err_syntax25.tab.c reference output for testing test/btyacc/err_syntax25.tab.h reference output for testing test/btyacc/err_syntax26.error reference output for testing test/btyacc/err_syntax26.output reference output for testing test/btyacc/err_syntax26.tab.c reference output for testing test/btyacc/err_syntax26.tab.h reference output for testing test/btyacc/err_syntax27.error reference output for testing test/btyacc/err_syntax27.output reference output for testing test/btyacc/err_syntax27.tab.c reference output for testing test/btyacc/err_syntax27.tab.h reference output for testing test/btyacc/err_syntax3.error reference output for testing test/btyacc/err_syntax3.output reference output for testing test/btyacc/err_syntax3.tab.c reference output for testing test/btyacc/err_syntax3.tab.h reference output for testing test/btyacc/err_syntax4.error reference output for testing test/btyacc/err_syntax4.output reference output for testing test/btyacc/err_syntax4.tab.c reference output for testing test/btyacc/err_syntax4.tab.h reference output for testing test/btyacc/err_syntax5.error reference output for testing test/btyacc/err_syntax5.output reference output for testing test/btyacc/err_syntax5.tab.c reference output for testing test/btyacc/err_syntax5.tab.h reference output for testing test/btyacc/err_syntax6.error reference output for testing test/btyacc/err_syntax6.output reference output for testing test/btyacc/err_syntax6.tab.c reference output for testing test/btyacc/err_syntax6.tab.h reference output for testing test/btyacc/err_syntax7.error reference output for testing test/btyacc/err_syntax7.output reference output for testing test/btyacc/err_syntax7.tab.c reference output for testing test/btyacc/err_syntax7.tab.h reference output for testing test/btyacc/err_syntax7a.error reference output for testing test/btyacc/err_syntax7a.output reference output for testing test/btyacc/err_syntax7a.tab.c reference output for testing test/btyacc/err_syntax7a.tab.h reference output for testing test/btyacc/err_syntax7b.error reference output for testing test/btyacc/err_syntax7b.output reference output for testing test/btyacc/err_syntax7b.tab.c reference output for testing test/btyacc/err_syntax7b.tab.h reference output for testing test/btyacc/err_syntax8.error reference output for testing test/btyacc/err_syntax8.output reference output for testing test/btyacc/err_syntax8.tab.c reference output for testing test/btyacc/err_syntax8.tab.h reference output for testing test/btyacc/err_syntax8a.error reference output for testing test/btyacc/err_syntax8a.output reference output for testing test/btyacc/err_syntax8a.tab.c reference output for testing test/btyacc/err_syntax8a.tab.h reference output for testing test/btyacc/err_syntax9.error reference output for testing test/btyacc/err_syntax9.output reference output for testing test/btyacc/err_syntax9.tab.c reference output for testing test/btyacc/err_syntax9.tab.h reference output for testing test/btyacc/error.error reference output for testing test/btyacc/error.output reference output for testing test/btyacc/error.tab.c reference output for testing test/btyacc/error.tab.h reference output for testing +test/btyacc/expr.oxout.error reference output for testing +test/btyacc/expr.oxout.output reference output for testing +test/btyacc/expr.oxout.tab.c reference output for testing +test/btyacc/expr.oxout.tab.h reference output for testing test/btyacc/grammar.dot reference output for testing test/btyacc/grammar.error reference output for testing test/btyacc/grammar.output reference output for testing test/btyacc/grammar.tab.c reference output for testing test/btyacc/grammar.tab.h reference output for testing test/btyacc/help.error reference output for testing test/btyacc/help.output reference output for testing test/btyacc/inherit0.error reference output for testing test/btyacc/inherit0.output reference output for testing test/btyacc/inherit0.tab.c reference output for testing test/btyacc/inherit0.tab.h reference output for testing test/btyacc/inherit1.error reference output for testing test/btyacc/inherit1.output reference output for testing test/btyacc/inherit1.tab.c reference output for testing test/btyacc/inherit1.tab.h reference output for testing test/btyacc/inherit2.error reference output for testing test/btyacc/inherit2.output reference output for testing test/btyacc/inherit2.tab.c reference output for testing test/btyacc/inherit2.tab.h reference output for testing test/btyacc/no_b_opt.error reference output for testing test/btyacc/no_b_opt.output reference output for testing test/btyacc/no_b_opt1.error reference output for testing test/btyacc/no_b_opt1.output reference output for testing test/btyacc/no_code_c.error reference output for testing test/btyacc/no_code_c.output reference output for testing test/btyacc/no_defines.error reference output for testing test/btyacc/no_defines.output reference output for testing test/btyacc/no_graph.error reference output for testing test/btyacc/no_graph.output reference output for testing test/btyacc/no_include.error reference output for testing test/btyacc/no_include.output reference output for testing test/btyacc/no_opts.error reference output for testing test/btyacc/no_opts.output reference output for testing test/btyacc/no_output.error reference output for testing test/btyacc/no_output.output reference output for testing test/btyacc/no_output1.error reference output for testing test/btyacc/no_output1.output reference output for testing test/btyacc/no_output2.error reference output for testing test/btyacc/no_output2.output reference output for testing test/btyacc/no_p_opt.error reference output for testing test/btyacc/no_p_opt.output reference output for testing test/btyacc/no_p_opt1.error reference output for testing test/btyacc/no_p_opt1.output reference output for testing test/btyacc/no_verbose.error reference output for testing test/btyacc/no_verbose.output reference output for testing test/btyacc/nostdin.error reference output for testing test/btyacc/nostdin.output reference output for testing test/btyacc/ok_syntax1.error reference output for testing test/btyacc/ok_syntax1.output reference output for testing test/btyacc/ok_syntax1.tab.c reference output for testing test/btyacc/ok_syntax1.tab.h reference output for testing test/btyacc/pure_calc.error reference output for testing test/btyacc/pure_calc.output reference output for testing test/btyacc/pure_calc.tab.c reference output for testing test/btyacc/pure_calc.tab.h reference output for testing test/btyacc/pure_error.error reference output for testing test/btyacc/pure_error.output reference output for testing test/btyacc/pure_error.tab.c reference output for testing test/btyacc/pure_error.tab.h reference output for testing test/btyacc/quote_calc-s.error reference output for testing test/btyacc/quote_calc-s.output reference output for testing test/btyacc/quote_calc-s.tab.c reference output for testing test/btyacc/quote_calc-s.tab.h reference output for testing test/btyacc/quote_calc.error reference output for testing test/btyacc/quote_calc.output reference output for testing test/btyacc/quote_calc.tab.c reference output for testing test/btyacc/quote_calc.tab.h reference output for testing test/btyacc/quote_calc2-s.error reference output for testing test/btyacc/quote_calc2-s.output reference output for testing test/btyacc/quote_calc2-s.tab.c reference output for testing test/btyacc/quote_calc2-s.tab.h reference output for testing test/btyacc/quote_calc2.error reference output for testing test/btyacc/quote_calc2.output reference output for testing test/btyacc/quote_calc2.tab.c reference output for testing test/btyacc/quote_calc2.tab.h reference output for testing test/btyacc/quote_calc3-s.error reference output for testing test/btyacc/quote_calc3-s.output reference output for testing test/btyacc/quote_calc3-s.tab.c reference output for testing test/btyacc/quote_calc3-s.tab.h reference output for testing test/btyacc/quote_calc3.error reference output for testing test/btyacc/quote_calc3.output reference output for testing test/btyacc/quote_calc3.tab.c reference output for testing test/btyacc/quote_calc3.tab.h reference output for testing test/btyacc/quote_calc4-s.error reference output for testing test/btyacc/quote_calc4-s.output reference output for testing test/btyacc/quote_calc4-s.tab.c reference output for testing test/btyacc/quote_calc4-s.tab.h reference output for testing test/btyacc/quote_calc4.error reference output for testing test/btyacc/quote_calc4.output reference output for testing test/btyacc/quote_calc4.tab.c reference output for testing test/btyacc/quote_calc4.tab.h reference output for testing test/btyacc/rename_debug.c reference output for testing test/btyacc/rename_debug.error reference output for testing test/btyacc/rename_debug.h reference output for testing test/btyacc/rename_debug.i reference output for testing test/btyacc/rename_debug.output reference output for testing test/btyacc/varsyntax_calc1.error reference output for testing test/btyacc/varsyntax_calc1.output reference output for testing test/btyacc/varsyntax_calc1.tab.c reference output for testing test/btyacc/varsyntax_calc1.tab.h reference output for testing test subdirectory test/btyacc_calc1.y testcase for btyacc test/btyacc_demo.y testcase for btyacc +test/btyacc_destroy1.y btyacc test-case for %parse-param +test/btyacc_destroy2.y btyacc test-case for %parse-param +test/btyacc_destroy3.y btyacc test-case for %parse-param test/calc.y example from VMS freeware version of byacc test/calc1.y advanced example from Steve Johnson's paper. test/calc2.y test-cases and reference files for %lex-param / %parse-param test/calc3.y test-cases and reference files for %lex-param / %parse-param test/code_calc.y reference input for testing test/code_debug.y test-input, for -i, -o, -d options test/code_error.y reference input for testing test/empty.y testcase for btyacc test/err_inherit1.y testcase for btyacc test/err_inherit2.y testcase for btyacc test/err_inherit3.y testcase for btyacc test/err_inherit4.y testcase for btyacc test/err_inherit5.y testcase for btyacc test/err_syntax1.y test-case with syntax error (and nonprinting character) test/err_syntax10.y testcase for retyped_warning() test/err_syntax11.y testcase for reprec_warning() test/err_syntax12.y testcase for revalued_warning() test/err_syntax13.y testcase for terminal_start() test/err_syntax14.y testcase for restarted_warning() and undefined_goal() test/err_syntax15.y testcase for no_grammar() test/err_syntax16.y testcase for terminal_lhs() test/err_syntax17.y testcase for unterminated_action() test/err_syntax18.y testcase for dollar_warning() test/err_syntax19.y testcase for dollar_error() test/err_syntax2.y testcase for unterminated_comment() test/err_syntax20.y testcase for undefined_symbol_warning() test/err_syntax21.y testcase for unknown_rhs() test/err_syntax22.y testcase for untyped_rhs() test/err_syntax23.y testcase for untyped_lhs() test/err_syntax24.y testcase for default_action_warning() test/err_syntax25.y testcase for over_unionized() test/err_syntax26.y testcase for unexpected_EOF() test/err_syntax27.y testcase for missing_brace() test/err_syntax3.y testcase for unterminated_string() test/err_syntax4.y testcase for unterminated_text() test/err_syntax5.y testcase for unterminated_union() test/err_syntax6.y testcase for illegal_tag() test/err_syntax7.y testcase for illegal_character() test/err_syntax7a.y testcase for illegal_character() test/err_syntax7b.y testcase for illegal_character() test/err_syntax8.y testcase for used_reserved() test/err_syntax8a.y testcase for used_reserved() test/err_syntax9.y testcase for tokenized_start() test/error.y original version of byacc - 1993 +test/expr.oxout.y test-case for "#line" feature test/grammar.y grammar from cproto test/inherit0.y testcase for btyacc test/inherit1.y testcase for btyacc test/inherit2.y testcase for btyacc test/ok_syntax1.y testcase for valid literal syntax test/pure_calc.y reference input for testing test/pure_error.y reference input for testing test/quote_calc.y test-case for %token using quoted name test/quote_calc2.y test-case for %token using quoted name test/quote_calc3.y test-case for %token using quoted name test/quote_calc4.y test-case for %token using quoted name test/run_lint.sh run lint, using the build-directory's makefile, on each ".c" file in test-directory test/run_make.sh do a test-compile of each ".c" file in the test-directory test/run_test.sh test-script for byacc test/varsyntax_calc1.y testcase for btyacc test/yacc subdirectory test/yacc/big_b.error exercise -L/-B options test/yacc/big_b.output exercise -L/-B options test/yacc/big_l.error exercise -L/-B options test/yacc/big_l.output exercise -L/-B options test/yacc/calc.error reference output for testing test/yacc/calc.output reference output for testing test/yacc/calc.tab.c reference output for testing test/yacc/calc.tab.h reference output for testing test/yacc/calc1.error reference output for testing test/yacc/calc1.output reference output for testing test/yacc/calc1.tab.c reference output for testing test/yacc/calc1.tab.h reference output for testing test/yacc/calc2.error reference output for testing test/yacc/calc2.output reference output for testing test/yacc/calc2.tab.c reference output for testing test/yacc/calc2.tab.h reference output for testing test/yacc/calc3.error reference output for testing test/yacc/calc3.output reference output for testing test/yacc/calc3.tab.c reference output for testing test/yacc/calc3.tab.h reference output for testing test/yacc/code_calc.code.c reference output for testing test/yacc/code_calc.error reference output for testing test/yacc/code_calc.output reference output for testing test/yacc/code_calc.tab.c reference output for testing test/yacc/code_calc.tab.h reference output for testing test/yacc/code_error.code.c reference output for testing test/yacc/code_error.error reference output for testing test/yacc/code_error.output reference output for testing test/yacc/code_error.tab.c reference output for testing test/yacc/code_error.tab.h reference output for testing test/yacc/empty.error reference output for testing test/yacc/empty.output reference output for testing test/yacc/empty.tab.c reference output for testing test/yacc/empty.tab.h reference output for testing test/yacc/err_syntax1.error reference output for testing test/yacc/err_syntax1.output reference output for testing test/yacc/err_syntax1.tab.c reference output for testing test/yacc/err_syntax1.tab.h reference output for testing test/yacc/err_syntax10.error reference output for testing test/yacc/err_syntax10.output reference output for testing test/yacc/err_syntax10.tab.c reference output for testing test/yacc/err_syntax10.tab.h reference output for testing test/yacc/err_syntax11.error reference output for testing test/yacc/err_syntax11.output reference output for testing test/yacc/err_syntax11.tab.c reference output for testing test/yacc/err_syntax11.tab.h reference output for testing test/yacc/err_syntax12.error reference output for testing test/yacc/err_syntax12.output reference output for testing test/yacc/err_syntax12.tab.c reference output for testing test/yacc/err_syntax12.tab.h reference output for testing test/yacc/err_syntax13.error reference output for testing test/yacc/err_syntax13.output reference output for testing test/yacc/err_syntax13.tab.c reference output for testing test/yacc/err_syntax13.tab.h reference output for testing test/yacc/err_syntax14.error reference output for testing test/yacc/err_syntax14.output reference output for testing test/yacc/err_syntax14.tab.c reference output for testing test/yacc/err_syntax14.tab.h reference output for testing test/yacc/err_syntax15.error reference output for testing test/yacc/err_syntax15.output reference output for testing test/yacc/err_syntax15.tab.c reference output for testing test/yacc/err_syntax15.tab.h reference output for testing test/yacc/err_syntax16.error reference output for testing test/yacc/err_syntax16.output reference output for testing test/yacc/err_syntax16.tab.c reference output for testing test/yacc/err_syntax16.tab.h reference output for testing test/yacc/err_syntax17.error reference output for testing test/yacc/err_syntax17.output reference output for testing test/yacc/err_syntax17.tab.c reference output for testing test/yacc/err_syntax17.tab.h reference output for testing test/yacc/err_syntax18.error reference output for testing test/yacc/err_syntax18.output reference output for testing test/yacc/err_syntax18.tab.c reference output for testing test/yacc/err_syntax18.tab.h reference output for testing test/yacc/err_syntax19.error reference output for testing test/yacc/err_syntax19.output reference output for testing test/yacc/err_syntax19.tab.c reference output for testing test/yacc/err_syntax19.tab.h reference output for testing test/yacc/err_syntax2.error reference output for testing test/yacc/err_syntax2.output reference output for testing test/yacc/err_syntax2.tab.c reference output for testing test/yacc/err_syntax2.tab.h reference output for testing test/yacc/err_syntax20.error reference output for testing test/yacc/err_syntax20.output reference output for testing test/yacc/err_syntax20.tab.c reference output for testing test/yacc/err_syntax20.tab.h reference output for testing test/yacc/err_syntax21.error reference output for testing test/yacc/err_syntax21.output reference output for testing test/yacc/err_syntax21.tab.c reference output for testing test/yacc/err_syntax21.tab.h reference output for testing test/yacc/err_syntax22.error reference output for testing test/yacc/err_syntax22.output reference output for testing test/yacc/err_syntax22.tab.c reference output for testing test/yacc/err_syntax22.tab.h reference output for testing test/yacc/err_syntax23.error reference output for testing test/yacc/err_syntax23.output reference output for testing test/yacc/err_syntax23.tab.c reference output for testing test/yacc/err_syntax23.tab.h reference output for testing test/yacc/err_syntax24.error reference output for testing test/yacc/err_syntax24.output reference output for testing test/yacc/err_syntax24.tab.c reference output for testing test/yacc/err_syntax24.tab.h reference output for testing test/yacc/err_syntax25.error reference output for testing test/yacc/err_syntax25.output reference output for testing test/yacc/err_syntax25.tab.c reference output for testing test/yacc/err_syntax25.tab.h reference output for testing test/yacc/err_syntax26.error reference output for testing test/yacc/err_syntax26.output reference output for testing test/yacc/err_syntax26.tab.c reference output for testing test/yacc/err_syntax26.tab.h reference output for testing test/yacc/err_syntax27.error reference output for testing test/yacc/err_syntax27.output reference output for testing test/yacc/err_syntax27.tab.c reference output for testing test/yacc/err_syntax27.tab.h reference output for testing test/yacc/err_syntax3.error reference output for testing test/yacc/err_syntax3.output reference output for testing test/yacc/err_syntax3.tab.c reference output for testing test/yacc/err_syntax3.tab.h reference output for testing test/yacc/err_syntax4.error reference output for testing test/yacc/err_syntax4.output reference output for testing test/yacc/err_syntax4.tab.c reference output for testing test/yacc/err_syntax4.tab.h reference output for testing test/yacc/err_syntax5.error reference output for testing test/yacc/err_syntax5.output reference output for testing test/yacc/err_syntax5.tab.c reference output for testing test/yacc/err_syntax5.tab.h reference output for testing test/yacc/err_syntax6.error reference output for testing test/yacc/err_syntax6.output reference output for testing test/yacc/err_syntax6.tab.c reference output for testing test/yacc/err_syntax6.tab.h reference output for testing test/yacc/err_syntax7.error reference output for testing test/yacc/err_syntax7.output reference output for testing test/yacc/err_syntax7.tab.c reference output for testing test/yacc/err_syntax7.tab.h reference output for testing test/yacc/err_syntax7a.error reference output for testing test/yacc/err_syntax7a.output reference output for testing test/yacc/err_syntax7a.tab.c reference output for testing test/yacc/err_syntax7a.tab.h reference output for testing test/yacc/err_syntax7b.error reference output for testing test/yacc/err_syntax7b.output reference output for testing test/yacc/err_syntax7b.tab.c reference output for testing test/yacc/err_syntax7b.tab.h reference output for testing test/yacc/err_syntax8.error reference output for testing test/yacc/err_syntax8.output reference output for testing test/yacc/err_syntax8.tab.c reference output for testing test/yacc/err_syntax8.tab.h reference output for testing test/yacc/err_syntax8a.error reference output for testing test/yacc/err_syntax8a.output reference output for testing test/yacc/err_syntax8a.tab.c reference output for testing test/yacc/err_syntax8a.tab.h reference output for testing test/yacc/err_syntax9.error reference output for testing test/yacc/err_syntax9.output reference output for testing test/yacc/err_syntax9.tab.c reference output for testing test/yacc/err_syntax9.tab.h reference output for testing test/yacc/error.error reference output for testing test/yacc/error.output reference output for testing test/yacc/error.tab.c reference output for testing test/yacc/error.tab.h reference output for testing +test/yacc/expr.oxout.error reference output for testing +test/yacc/expr.oxout.output reference output for testing +test/yacc/expr.oxout.tab.c reference output for testing +test/yacc/expr.oxout.tab.h reference output for testing test/yacc/grammar.dot reference output for testing test/yacc/grammar.error reference output for testing test/yacc/grammar.output reference output for testing test/yacc/grammar.tab.c reference output for testing test/yacc/grammar.tab.h reference output for testing test/yacc/help.error reference output for testing test/yacc/help.output reference output for testing test/yacc/no_b_opt.error reference output for testing test/yacc/no_b_opt.output reference output for testing test/yacc/no_b_opt1.error reference output for testing test/yacc/no_b_opt1.output reference output for testing test/yacc/no_code_c.error reference output for testing test/yacc/no_code_c.output reference output for testing test/yacc/no_defines.error reference output for testing test/yacc/no_defines.output reference output for testing test/yacc/no_graph.error reference output for testing test/yacc/no_graph.output reference output for testing test/yacc/no_include.error reference output for testing test/yacc/no_include.output reference output for testing test/yacc/no_opts.error reference output for testing test/yacc/no_opts.output reference output for testing test/yacc/no_output.error reference output for testing test/yacc/no_output.output reference output for testing test/yacc/no_output1.error reference output for testing test/yacc/no_output1.output reference output for testing test/yacc/no_output2.error reference output for testing test/yacc/no_output2.output reference output for testing test/yacc/no_p_opt.error reference output for testing test/yacc/no_p_opt.output reference output for testing test/yacc/no_p_opt1.error reference output for testing test/yacc/no_p_opt1.output reference output for testing test/yacc/no_verbose.error reference output for testing test/yacc/no_verbose.output reference output for testing test/yacc/nostdin.error reference output for testing test/yacc/nostdin.output reference output for testing test/yacc/ok_syntax1.error reference output for testing test/yacc/ok_syntax1.output reference output for testing test/yacc/ok_syntax1.tab.c reference output for testing test/yacc/ok_syntax1.tab.h reference output for testing test/yacc/pure_calc.error reference output for testing test/yacc/pure_calc.output reference output for testing test/yacc/pure_calc.tab.c reference output for testing test/yacc/pure_calc.tab.h reference output for testing test/yacc/pure_error.error reference output for testing test/yacc/pure_error.output reference output for testing test/yacc/pure_error.tab.c reference output for testing test/yacc/pure_error.tab.h reference output for testing test/yacc/quote_calc-s.error reference output for testing test/yacc/quote_calc-s.output reference output for testing test/yacc/quote_calc-s.tab.c reference output for testing test/yacc/quote_calc-s.tab.h reference output for testing test/yacc/quote_calc.error reference output for testing test/yacc/quote_calc.output reference output for testing test/yacc/quote_calc.tab.c reference output for testing test/yacc/quote_calc.tab.h reference output for testing test/yacc/quote_calc2-s.error reference output for testing test/yacc/quote_calc2-s.output reference output for testing test/yacc/quote_calc2-s.tab.c reference output for testing test/yacc/quote_calc2-s.tab.h reference output for testing test/yacc/quote_calc2.error reference output for testing test/yacc/quote_calc2.output reference output for testing test/yacc/quote_calc2.tab.c reference output for testing test/yacc/quote_calc2.tab.h reference output for testing test/yacc/quote_calc3-s.error reference output for testing test/yacc/quote_calc3-s.output reference output for testing test/yacc/quote_calc3-s.tab.c reference output for testing test/yacc/quote_calc3-s.tab.h reference output for testing test/yacc/quote_calc3.error reference output for testing test/yacc/quote_calc3.output reference output for testing test/yacc/quote_calc3.tab.c reference output for testing test/yacc/quote_calc3.tab.h reference output for testing test/yacc/quote_calc4-s.error reference output for testing test/yacc/quote_calc4-s.output reference output for testing test/yacc/quote_calc4-s.tab.c reference output for testing test/yacc/quote_calc4-s.tab.h reference output for testing test/yacc/quote_calc4.error reference output for testing test/yacc/quote_calc4.output reference output for testing test/yacc/quote_calc4.tab.c reference output for testing test/yacc/quote_calc4.tab.h reference output for testing test/yacc/rename_debug.c reference output for testing test/yacc/rename_debug.error reference output for testing test/yacc/rename_debug.h reference output for testing test/yacc/rename_debug.i reference output for testing test/yacc/rename_debug.output reference output for testing test/yacc/varsyntax_calc1.error reference output for testing test/yacc/varsyntax_calc1.output reference output for testing test/yacc/varsyntax_calc1.tab.c reference output for testing test/yacc/varsyntax_calc1.tab.h reference output for testing Index: head/contrib/byacc/VERSION =================================================================== --- head/contrib/byacc/VERSION (revision 313104) +++ head/contrib/byacc/VERSION (revision 313105) @@ -1 +1 @@ -20161202 +20170201 Index: head/contrib/byacc/aclocal.m4 =================================================================== --- head/contrib/byacc/aclocal.m4 (revision 313104) +++ head/contrib/byacc/aclocal.m4 (revision 313105) @@ -1,1448 +1,1454 @@ -dnl $Id: aclocal.m4,v 1.41 2016/12/02 13:03:06 tom Exp $ +dnl $Id: aclocal.m4,v 1.42 2017/02/01 10:12:21 tom Exp $ dnl Macros for byacc configure script (Thomas E. Dickey) dnl --------------------------------------------------------------------------- -dnl Copyright 2004-2015,2016 Thomas E. Dickey +dnl Copyright 2004-2016,2017 Thomas E. Dickey dnl dnl Permission is hereby granted, free of charge, to any person obtaining a dnl copy of this software and associated documentation files (the dnl "Software"), to deal in the Software without restriction, including dnl without limitation the rights to use, copy, modify, merge, publish, dnl distribute, distribute with modifications, sublicense, and/or sell dnl copies of the Software, and to permit persons to whom the Software is dnl furnished to do so, subject to the following conditions: dnl dnl The above copyright notice and this permission notice shall be included dnl in all copies or portions of the Software. dnl dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. dnl IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, dnl DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR dnl OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR dnl THE USE OR OTHER DEALINGS IN THE SOFTWARE. dnl dnl Except as contained in this notice, the name(s) of the above copyright dnl holders shall not be used in advertising or otherwise to promote the dnl sale, use or other dealings in this Software without prior written dnl authorization. dnl --------------------------------------------------------------------------- dnl --------------------------------------------------------------------------- dnl CF_ACVERSION_CHECK version: 5 updated: 2014/06/04 19:11:49 dnl ------------------ dnl Conditionally generate script according to whether we're using a given autoconf. dnl dnl $1 = version to compare against dnl $2 = code to use if AC_ACVERSION is at least as high as $1. dnl $3 = code to use if AC_ACVERSION is older than $1. define([CF_ACVERSION_CHECK], [ ifdef([AC_ACVERSION], ,[ifdef([AC_AUTOCONF_VERSION],[m4_copy([AC_AUTOCONF_VERSION],[AC_ACVERSION])],[m4_copy([m4_PACKAGE_VERSION],[AC_ACVERSION])])])dnl ifdef([m4_version_compare], [m4_if(m4_version_compare(m4_defn([AC_ACVERSION]), [$1]), -1, [$3], [$2])], [CF_ACVERSION_COMPARE( AC_PREREQ_CANON(AC_PREREQ_SPLIT([$1])), AC_PREREQ_CANON(AC_PREREQ_SPLIT(AC_ACVERSION)), AC_ACVERSION, [$2], [$3])])])dnl dnl --------------------------------------------------------------------------- dnl CF_ACVERSION_COMPARE version: 3 updated: 2012/10/03 18:39:53 dnl -------------------- dnl CF_ACVERSION_COMPARE(MAJOR1, MINOR1, TERNARY1, dnl MAJOR2, MINOR2, TERNARY2, dnl PRINTABLE2, not FOUND, FOUND) define([CF_ACVERSION_COMPARE], [ifelse(builtin([eval], [$2 < $5]), 1, [ifelse([$8], , ,[$8])], [ifelse([$9], , ,[$9])])])dnl dnl --------------------------------------------------------------------------- dnl CF_ADD_CFLAGS version: 12 updated: 2015/04/12 15:39:00 dnl ------------- dnl Copy non-preprocessor flags to $CFLAGS, preprocessor flags to $CPPFLAGS dnl The second parameter if given makes this macro verbose. dnl dnl Put any preprocessor definitions that use quoted strings in $EXTRA_CPPFLAGS, dnl to simplify use of $CPPFLAGS in compiler checks, etc., that are easily dnl confused by the quotes (which require backslashes to keep them usable). AC_DEFUN([CF_ADD_CFLAGS], [ cf_fix_cppflags=no cf_new_cflags= cf_new_cppflags= cf_new_extra_cppflags= for cf_add_cflags in $1 do case $cf_fix_cppflags in (no) case $cf_add_cflags in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) case $cf_add_cflags in (-D*) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[[^=]]*='\''\"[[^"]]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" continue elif test "${cf_tst_cflags}" = "\"'" ; then cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" continue fi ;; esac case "$CPPFLAGS" in (*$cf_add_cflags) ;; (*) case $cf_add_cflags in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` CF_REMOVE_DEFINE(CPPFLAGS,$CPPFLAGS,$cf_tst_cppflags) ;; esac cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" ;; esac ;; (*) cf_new_cflags="$cf_new_cflags $cf_add_cflags" ;; esac ;; (yes) cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[[^"]]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=no ;; esac done if test -n "$cf_new_cflags" ; then ifelse([$2],,,[CF_VERBOSE(add to \$CFLAGS $cf_new_cflags)]) CFLAGS="$CFLAGS $cf_new_cflags" fi if test -n "$cf_new_cppflags" ; then ifelse([$2],,,[CF_VERBOSE(add to \$CPPFLAGS $cf_new_cppflags)]) CPPFLAGS="$CPPFLAGS $cf_new_cppflags" fi if test -n "$cf_new_extra_cppflags" ; then ifelse([$2],,,[CF_VERBOSE(add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags)]) EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" fi AC_SUBST(EXTRA_CPPFLAGS) ])dnl dnl --------------------------------------------------------------------------- dnl CF_ARG_DISABLE version: 3 updated: 1999/03/30 17:24:31 dnl -------------- dnl Allow user to disable a normally-on option. AC_DEFUN([CF_ARG_DISABLE], [CF_ARG_OPTION($1,[$2],[$3],[$4],yes)])dnl dnl --------------------------------------------------------------------------- dnl CF_ARG_OPTION version: 5 updated: 2015/05/10 19:52:14 dnl ------------- dnl Restricted form of AC_ARG_ENABLE that ensures user doesn't give bogus dnl values. dnl dnl Parameters: dnl $1 = option name dnl $2 = help-string dnl $3 = action to perform if option is not default dnl $4 = action if perform if option is default dnl $5 = default option value (either 'yes' or 'no') AC_DEFUN([CF_ARG_OPTION], [AC_ARG_ENABLE([$1],[$2],[test "$enableval" != ifelse([$5],no,yes,no) && enableval=ifelse([$5],no,no,yes) if test "$enableval" != "$5" ; then ifelse([$3],,[ :]dnl ,[ $3]) ifelse([$4],,,[ else $4]) fi],[enableval=$5 ifelse([$4],,,[ $4 ])dnl ])])dnl dnl --------------------------------------------------------------------------- dnl CF_CC_ENV_FLAGS version: 6 updated: 2016/08/29 20:57:00 dnl --------------- dnl Check for user's environment-breakage by stuffing CFLAGS/CPPFLAGS content dnl into CC. This will not help with broken scripts that wrap the compiler dnl with options, but eliminates a more common category of user confusion. dnl dnl In particular, it addresses the problem of being able to run the C dnl preprocessor in a consistent manner. dnl dnl Caveat: this also disallows blanks in the pathname for the compiler, but dnl the nuisance of having inconsistent settings for compiler and preprocessor dnl outweighs that limitation. AC_DEFUN([CF_CC_ENV_FLAGS], [ # This should have been defined by AC_PROG_CC : ${CC:=cc} AC_MSG_CHECKING(\$CC variable) case "$CC" in (*[[\ \ ]]-*) AC_MSG_RESULT(broken) AC_MSG_WARN(your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options) # humor him... cf_flags=`echo "$CC" | sed -e 's/^.*[[ ]]\(-[[^ ]]\)/\1/'` CC=`echo "$CC " | sed -e 's/[[ ]]-[[^ ]].*$//' -e 's/[[ ]]*$//'` for cf_arg in $cf_flags do case "x$cf_arg" in (x-[[IUDfgOW]]*) CF_ADD_CFLAGS($cf_flags) ;; (*) CC="$CC $cf_arg" ;; esac done CF_VERBOSE(resulting CC: '$CC') CF_VERBOSE(resulting CFLAGS: '$CFLAGS') CF_VERBOSE(resulting CPPFLAGS: '$CPPFLAGS') ;; (*) AC_MSG_RESULT(ok) ;; esac ])dnl dnl --------------------------------------------------------------------------- dnl CF_CHECK_CACHE version: 12 updated: 2012/10/02 20:55:03 dnl -------------- dnl Check if we're accidentally using a cache from a different machine. dnl Derive the system name, as a check for reusing the autoconf cache. dnl dnl If we've packaged config.guess and config.sub, run that (since it does a dnl better job than uname). Normally we'll use AC_CANONICAL_HOST, but allow dnl an extra parameter that we may override, e.g., for AC_CANONICAL_SYSTEM dnl which is useful in cross-compiles. dnl dnl Note: we would use $ac_config_sub, but that is one of the places where dnl autoconf 2.5x broke compatibility with autoconf 2.13 AC_DEFUN([CF_CHECK_CACHE], [ if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then ifelse([$1],,[AC_CANONICAL_HOST],[$1]) system_name="$host_os" else system_name="`(uname -s -r) 2>/dev/null`" if test -z "$system_name" ; then system_name="`(hostname) 2>/dev/null`" fi fi test -n "$system_name" && AC_DEFINE_UNQUOTED(SYSTEM_NAME,"$system_name",[Define to the system name.]) AC_CACHE_VAL(cf_cv_system_name,[cf_cv_system_name="$system_name"]) test -z "$system_name" && system_name="$cf_cv_system_name" test -n "$cf_cv_system_name" && AC_MSG_RESULT(Configuring for $cf_cv_system_name) if test ".$system_name" != ".$cf_cv_system_name" ; then AC_MSG_RESULT(Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)) AC_MSG_ERROR("Please remove config.cache and try again.") fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_CLANG_COMPILER version: 2 updated: 2013/11/19 19:23:35 dnl ----------------- dnl Check if the given compiler is really clang. clang's C driver defines dnl __GNUC__ (fooling the configure script into setting $GCC to yes) but does dnl not ignore some gcc options. dnl dnl This macro should be run "soon" after AC_PROG_CC or AC_PROG_CPLUSPLUS, to dnl ensure that it is not mistaken for gcc/g++. It is normally invoked from dnl the wrappers for gcc and g++ warnings. dnl dnl $1 = GCC (default) or GXX dnl $2 = CLANG_COMPILER (default) dnl $3 = CFLAGS (default) or CXXFLAGS AC_DEFUN([CF_CLANG_COMPILER],[ ifelse([$2],,CLANG_COMPILER,[$2])=no if test "$ifelse([$1],,[$1],GCC)" = yes ; then AC_MSG_CHECKING(if this is really Clang ifelse([$1],GXX,C++,C) compiler) cf_save_CFLAGS="$ifelse([$3],,CFLAGS,[$3])" ifelse([$3],,CFLAGS,[$3])="$ifelse([$3],,CFLAGS,[$3]) -Qunused-arguments" AC_TRY_COMPILE([],[ #ifdef __clang__ #else make an error #endif ],[ifelse([$2],,CLANG_COMPILER,[$2])=yes cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments" ],[]) ifelse([$3],,CFLAGS,[$3])="$cf_save_CFLAGS" AC_MSG_RESULT($ifelse([$2],,CLANG_COMPILER,[$2])) fi ]) dnl --------------------------------------------------------------------------- dnl CF_DISABLE_ECHO version: 13 updated: 2015/04/18 08:56:57 dnl --------------- dnl You can always use "make -n" to see the actual options, but it's hard to dnl pick out/analyze warning messages when the compile-line is long. dnl dnl Sets: dnl ECHO_LT - symbol to control if libtool is verbose dnl ECHO_LD - symbol to prefix "cc -o" lines dnl RULE_CC - symbol to put before implicit "cc -c" lines (e.g., .c.o) dnl SHOW_CC - symbol to put before explicit "cc -c" lines dnl ECHO_CC - symbol to put before any "cc" line dnl AC_DEFUN([CF_DISABLE_ECHO],[ AC_MSG_CHECKING(if you want to see long compiling messages) CF_ARG_DISABLE(echo, [ --disable-echo do not display "compiling" commands], [ ECHO_LT='--silent' ECHO_LD='@echo linking [$]@;' RULE_CC='@echo compiling [$]<' SHOW_CC='@echo compiling [$]@' ECHO_CC='@' ],[ ECHO_LT='' ECHO_LD='' RULE_CC='' SHOW_CC='' ECHO_CC='' ]) AC_MSG_RESULT($enableval) AC_SUBST(ECHO_LT) AC_SUBST(ECHO_LD) AC_SUBST(RULE_CC) AC_SUBST(SHOW_CC) AC_SUBST(ECHO_CC) ])dnl dnl --------------------------------------------------------------------------- dnl CF_DISABLE_LEAKS version: 7 updated: 2012/10/02 20:55:03 dnl ---------------- dnl Combine no-leak checks with the libraries or tools that are used for the dnl checks. AC_DEFUN([CF_DISABLE_LEAKS],[ AC_REQUIRE([CF_WITH_DMALLOC]) AC_REQUIRE([CF_WITH_DBMALLOC]) AC_REQUIRE([CF_WITH_VALGRIND]) AC_MSG_CHECKING(if you want to perform memory-leak testing) AC_ARG_ENABLE(leaks, [ --disable-leaks test: free permanent memory, analyze leaks], [if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi], : ${with_no_leaks:=no}) AC_MSG_RESULT($with_no_leaks) if test "$with_no_leaks" = yes ; then AC_DEFINE(NO_LEAKS,1,[Define to 1 if you want to perform memory-leak testing.]) AC_DEFINE(YY_NO_LEAKS,1,[Define to 1 if you want to perform memory-leak testing.]) fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_GCC_ATTRIBUTES version: 17 updated: 2015/04/12 15:39:00 dnl ----------------- dnl Test for availability of useful gcc __attribute__ directives to quiet dnl compiler warnings. Though useful, not all are supported -- and contrary dnl to documentation, unrecognized directives cause older compilers to barf. AC_DEFUN([CF_GCC_ATTRIBUTES], [ if test "$GCC" = yes then cat > conftest.i < conftest.$ac_ext <&AC_FD_CC case $cf_attribute in (printf) cf_printf_attribute=yes cat >conftest.h <conftest.h <conftest.h <>confdefs.h case $cf_attribute in (noreturn) AC_DEFINE_UNQUOTED(GCC_NORETURN,$cf_directive,[Define to noreturn-attribute for gcc]) ;; (printf) cf_value='/* nothing */' if test "$cf_printf_attribute" != no ; then cf_value='__attribute__((format(printf,fmt,var)))' AC_DEFINE(GCC_PRINTF,1,[Define to 1 if the compiler supports gcc-like printf attribute.]) fi AC_DEFINE_UNQUOTED(GCC_PRINTFLIKE(fmt,var),$cf_value,[Define to printf-attribute for gcc]) ;; (scanf) cf_value='/* nothing */' if test "$cf_scanf_attribute" != no ; then cf_value='__attribute__((format(scanf,fmt,var)))' AC_DEFINE(GCC_SCANF,1,[Define to 1 if the compiler supports gcc-like scanf attribute.]) fi AC_DEFINE_UNQUOTED(GCC_SCANFLIKE(fmt,var),$cf_value,[Define to sscanf-attribute for gcc]) ;; (unused) AC_DEFINE_UNQUOTED(GCC_UNUSED,$cf_directive,[Define to unused-attribute for gcc]) ;; esac fi done else fgrep define conftest.i >>confdefs.h fi rm -rf conftest* fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_GCC_VERSION version: 7 updated: 2012/10/18 06:46:33 dnl -------------- dnl Find version of gcc AC_DEFUN([CF_GCC_VERSION],[ AC_REQUIRE([AC_PROG_CC]) GCC_VERSION=none if test "$GCC" = yes ; then AC_MSG_CHECKING(version of $CC) GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC[[^)]]*) //' -e 's/^.*(Debian[[^)]]*) //' -e 's/^[[^0-9.]]*//' -e 's/[[^0-9.]].*//'`" test -z "$GCC_VERSION" && GCC_VERSION=unknown AC_MSG_RESULT($GCC_VERSION) fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_GCC_WARNINGS version: 32 updated: 2015/04/12 15:39:00 dnl --------------- dnl Check if the compiler supports useful warning options. There's a few that dnl we don't use, simply because they're too noisy: dnl dnl -Wconversion (useful in older versions of gcc, but not in gcc 2.7.x) dnl -Wredundant-decls (system headers make this too noisy) dnl -Wtraditional (combines too many unrelated messages, only a few useful) dnl -Wwrite-strings (too noisy, but should review occasionally). This dnl is enabled for ncurses using "--enable-const". dnl -pedantic dnl dnl Parameter: dnl $1 is an optional list of gcc warning flags that a particular dnl application might want to use, e.g., "no-unused" for dnl -Wno-unused dnl Special: dnl If $with_ext_const is "yes", add a check for -Wwrite-strings dnl AC_DEFUN([CF_GCC_WARNINGS], [ AC_REQUIRE([CF_GCC_VERSION]) CF_INTEL_COMPILER(GCC,INTEL_COMPILER,CFLAGS) CF_CLANG_COMPILER(GCC,CLANG_COMPILER,CFLAGS) cat > conftest.$ac_ext <],[ #ifndef _XOPEN_SOURCE make an error #endif], [cf_cv_gnu_source=no], [cf_save="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" AC_TRY_COMPILE([#include ],[ #ifdef _XOPEN_SOURCE make an error #endif], [cf_cv_gnu_source=no], [cf_cv_gnu_source=yes]) CPPFLAGS="$cf_save" ]) ]) if test "$cf_cv_gnu_source" = yes then AC_CACHE_CHECK(if we should also define _DEFAULT_SOURCE,cf_cv_default_source,[ CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" AC_TRY_COMPILE([#include ],[ #ifdef _DEFAULT_SOURCE make an error #endif], [cf_cv_default_source=no], [cf_cv_default_source=yes]) ]) test "$cf_cv_default_source" = yes && CPPFLAGS="$CPPFLAGS -D_DEFAULT_SOURCE" fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_INTEL_COMPILER version: 7 updated: 2015/04/12 15:39:00 dnl ----------------- dnl Check if the given compiler is really the Intel compiler for Linux. It dnl tries to imitate gcc, but does not return an error when it finds a mismatch dnl between prototypes, e.g., as exercised by CF_MISSING_CHECK. dnl dnl This macro should be run "soon" after AC_PROG_CC or AC_PROG_CPLUSPLUS, to dnl ensure that it is not mistaken for gcc/g++. It is normally invoked from dnl the wrappers for gcc and g++ warnings. dnl dnl $1 = GCC (default) or GXX dnl $2 = INTEL_COMPILER (default) or INTEL_CPLUSPLUS dnl $3 = CFLAGS (default) or CXXFLAGS AC_DEFUN([CF_INTEL_COMPILER],[ AC_REQUIRE([AC_CANONICAL_HOST]) ifelse([$2],,INTEL_COMPILER,[$2])=no if test "$ifelse([$1],,[$1],GCC)" = yes ; then case $host_os in (linux*|gnu*) AC_MSG_CHECKING(if this is really Intel ifelse([$1],GXX,C++,C) compiler) cf_save_CFLAGS="$ifelse([$3],,CFLAGS,[$3])" ifelse([$3],,CFLAGS,[$3])="$ifelse([$3],,CFLAGS,[$3]) -no-gcc" AC_TRY_COMPILE([],[ #ifdef __INTEL_COMPILER #else make an error #endif ],[ifelse([$2],,INTEL_COMPILER,[$2])=yes cf_save_CFLAGS="$cf_save_CFLAGS -we147" ],[]) ifelse([$3],,CFLAGS,[$3])="$cf_save_CFLAGS" AC_MSG_RESULT($ifelse([$2],,INTEL_COMPILER,[$2])) ;; esac fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_MAKE_DOCS version: 4 updated: 2015/07/04 21:43:03 dnl ------------ dnl $1 = name(s) to generate rules for dnl $2 = suffix of corresponding manpages used as input. dnl dnl This works best if called at the end of configure.in, following CF_WITH_MAN2HTML define([CF_MAKE_DOCS],[ test -z "$cf_make_docs" && cf_make_docs=0 cf_output=makefile test -f "$cf_output" || cf_output=Makefile if test "$cf_make_docs" = 0 then cat >>$cf_output <[\$]@ ${GROFF_NOTE}.ps.pdf : ${GROFF_NOTE} ps2pdf [\$]*.ps ${GROFF_NOTE} ${GROFF_NOTE}.$2.ps : ${GROFF_NOTE} [\$](SHELL) -c "tbl [\$]*.$2 | groff -man" >[\$]@ ${GROFF_NOTE} ${GROFF_NOTE}.$2.txt : ${GROFF_NOTE} GROFF_NO_SGR=stupid [\$](SHELL) -c "tbl [\$]*.$2 | nroff -Tascii -man | col -bx" >[\$]@ ${MAN2HTML_NOTE}.$2.html : ${MAN2HTML_NOTE} ./${MAN2HTML_TEMP} [\$]* $2 man >[\$]@ CF_EOF cf_make_docs=1 fi for cf_name in $1 do cat >>$cf_output <conftest if test -f CONFTEST ; then cf_cv_mixedcase=no else cf_cv_mixedcase=yes fi rm -f conftest CONFTEST fi ]) test "$cf_cv_mixedcase" = yes && AC_DEFINE(MIXEDCASE_FILENAMES,1,[Define to 1 if filesystem supports mixed-case filenames.]) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_MKSTEMP version: 9 updated: 2012/10/03 04:34:49 +dnl CF_MKSTEMP version: 10 updated: 2017/01/21 11:12:16 dnl ---------- dnl Check for a working mkstemp. This creates two files, checks that they are dnl successfully created and distinct (AmigaOS apparently fails on the last). AC_DEFUN([CF_MKSTEMP],[ +AC_CHECK_HEADERS( \ +unistd.h \ +) AC_CACHE_CHECK(for working mkstemp, cf_cv_func_mkstemp,[ rm -rf conftest* AC_TRY_RUN([ #include +#ifdef HAVE_UNISTD_H +#include +#endif #include #include #include #include -int main() +int main(void) { char *tmpl = "conftestXXXXXX"; char name[2][80]; int n; int result = 0; int fd; struct stat sb; umask(077); for (n = 0; n < 2; ++n) { strcpy(name[n], tmpl); if ((fd = mkstemp(name[n])) >= 0) { if (!strcmp(name[n], tmpl) || stat(name[n], &sb) != 0 || (sb.st_mode & S_IFMT) != S_IFREG || (sb.st_mode & 077) != 0) { result = 1; } close(fd); } } if (result == 0 && !strcmp(name[0], name[1])) result = 1; ${cf_cv_main_return:-return}(result); } ],[cf_cv_func_mkstemp=yes ],[cf_cv_func_mkstemp=no ],[cf_cv_func_mkstemp=maybe]) ]) if test "x$cf_cv_func_mkstemp" = xmaybe ; then AC_CHECK_FUNC(mkstemp) fi if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then AC_DEFINE(HAVE_MKSTEMP,1,[Define to 1 if mkstemp() is available and working.]) fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_MSG_LOG version: 5 updated: 2010/10/23 15:52:32 dnl ---------- dnl Write a debug message to config.log, along with the line number in the dnl configure script. AC_DEFUN([CF_MSG_LOG],[ echo "${as_me:-configure}:__oline__: testing $* ..." 1>&AC_FD_CC ])dnl dnl --------------------------------------------------------------------------- dnl CF_NO_LEAKS_OPTION version: 6 updated: 2015/04/12 15:39:00 dnl ------------------ dnl see CF_WITH_NO_LEAKS AC_DEFUN([CF_NO_LEAKS_OPTION],[ AC_MSG_CHECKING(if you want to use $1 for testing) AC_ARG_WITH($1, [$2], [AC_DEFINE_UNQUOTED($3,1,"Define to 1 if you want to use $1 for testing.")ifelse([$4],,[ $4 ]) : ${with_cflags:=-g} : ${with_no_leaks:=yes} with_$1=yes], [with_$1=]) AC_MSG_RESULT(${with_$1:-no}) case .$with_cflags in (.*-g*) case .$CFLAGS in (.*-g*) ;; (*) CF_ADD_CFLAGS([-g]) ;; esac ;; esac ])dnl dnl --------------------------------------------------------------------------- dnl CF_PATH_SYNTAX version: 16 updated: 2015/04/18 08:56:57 dnl -------------- dnl Check the argument to see that it looks like a pathname. Rewrite it if it dnl begins with one of the prefix/exec_prefix variables, and then again if the dnl result begins with 'NONE'. This is necessary to work around autoconf's dnl delayed evaluation of those symbols. AC_DEFUN([CF_PATH_SYNTAX],[ if test "x$prefix" != xNONE; then cf_path_syntax="$prefix" else cf_path_syntax="$ac_default_prefix" fi case ".[$]$1" in (.\[$]\(*\)*|.\'*\'*) ;; (..|./*|.\\*) ;; (.[[a-zA-Z]]:[[\\/]]*) # OS/2 EMX ;; (.\[$]{*prefix}*|.\[$]{*dir}*) eval $1="[$]$1" case ".[$]$1" in (.NONE/*) $1=`echo [$]$1 | sed -e s%NONE%$cf_path_syntax%` ;; esac ;; (.no|.NONE/*) $1=`echo [$]$1 | sed -e s%NONE%$cf_path_syntax%` ;; (*) ifelse([$2],,[AC_MSG_ERROR([expected a pathname, not \"[$]$1\"])],$2) ;; esac ])dnl dnl --------------------------------------------------------------------------- dnl CF_POSIX_C_SOURCE version: 9 updated: 2015/04/12 15:39:00 dnl ----------------- dnl Define _POSIX_C_SOURCE to the given level, and _POSIX_SOURCE if needed. dnl dnl POSIX.1-1990 _POSIX_SOURCE dnl POSIX.1-1990 and _POSIX_SOURCE and dnl POSIX.2-1992 C-Language _POSIX_C_SOURCE=2 dnl Bindings Option dnl POSIX.1b-1993 _POSIX_C_SOURCE=199309L dnl POSIX.1c-1996 _POSIX_C_SOURCE=199506L dnl X/Open 2000 _POSIX_C_SOURCE=200112L dnl dnl Parameters: dnl $1 is the nominal value for _POSIX_C_SOURCE AC_DEFUN([CF_POSIX_C_SOURCE], [ cf_POSIX_C_SOURCE=ifelse([$1],,199506L,[$1]) cf_save_CFLAGS="$CFLAGS" cf_save_CPPFLAGS="$CPPFLAGS" CF_REMOVE_DEFINE(cf_trim_CFLAGS,$cf_save_CFLAGS,_POSIX_C_SOURCE) CF_REMOVE_DEFINE(cf_trim_CPPFLAGS,$cf_save_CPPFLAGS,_POSIX_C_SOURCE) AC_CACHE_CHECK(if we should define _POSIX_C_SOURCE,cf_cv_posix_c_source,[ CF_MSG_LOG(if the symbol is already defined go no further) AC_TRY_COMPILE([#include ],[ #ifndef _POSIX_C_SOURCE make an error #endif], [cf_cv_posix_c_source=no], [cf_want_posix_source=no case .$cf_POSIX_C_SOURCE in (.[[12]]??*) cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE" ;; (.2) cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE" cf_want_posix_source=yes ;; (.*) cf_want_posix_source=yes ;; esac if test "$cf_want_posix_source" = yes ; then AC_TRY_COMPILE([#include ],[ #ifdef _POSIX_SOURCE make an error #endif],[], cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE") fi CF_MSG_LOG(ifdef from value $cf_POSIX_C_SOURCE) CFLAGS="$cf_trim_CFLAGS" CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source" CF_MSG_LOG(if the second compile does not leave our definition intact error) AC_TRY_COMPILE([#include ],[ #ifndef _POSIX_C_SOURCE make an error #endif],, [cf_cv_posix_c_source=no]) CFLAGS="$cf_save_CFLAGS" CPPFLAGS="$cf_save_CPPFLAGS" ]) ]) if test "$cf_cv_posix_c_source" != no ; then CFLAGS="$cf_trim_CFLAGS" CPPFLAGS="$cf_trim_CPPFLAGS" CF_ADD_CFLAGS($cf_cv_posix_c_source) fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_PROG_AWK version: 1 updated: 2006/09/16 11:40:59 dnl ----------- dnl Check for awk, ensure that the check found something. AC_DEFUN([CF_PROG_AWK], [ AC_PROG_AWK test -z "$AWK" && AC_MSG_ERROR(No awk program found) ])dnl dnl --------------------------------------------------------------------------- dnl CF_PROG_CC version: 4 updated: 2014/07/12 18:57:58 dnl ---------- dnl standard check for CC, plus followup sanity checks dnl $1 = optional parameter to pass to AC_PROG_CC to specify compiler name AC_DEFUN([CF_PROG_CC],[ ifelse($1,,[AC_PROG_CC],[AC_PROG_CC($1)]) CF_GCC_VERSION CF_ACVERSION_CHECK(2.52, [AC_PROG_CC_STDC], [CF_ANSI_CC_REQD]) CF_CC_ENV_FLAGS ])dnl dnl --------------------------------------------------------------------------- dnl CF_PROG_GROFF version: 2 updated: 2015/07/04 11:16:27 dnl ------------- dnl Check if groff is available, for cases (such as html output) where nroff dnl is not enough. AC_DEFUN([CF_PROG_GROFF],[ AC_PATH_PROG(GROFF_PATH,groff,no) AC_PATH_PROG(NROFF_PATH,nroff,no) if test "x$GROFF_PATH" = xno then NROFF_NOTE= GROFF_NOTE="#" else NROFF_NOTE="#" GROFF_NOTE= fi AC_SUBST(GROFF_NOTE) AC_SUBST(NROFF_NOTE) ])dnl dnl --------------------------------------------------------------------------- dnl CF_PROG_LINT version: 3 updated: 2016/05/22 15:25:54 dnl ------------ AC_DEFUN([CF_PROG_LINT], [ AC_CHECK_PROGS(LINT, lint cppcheck splint) AC_SUBST(LINT_OPTS) ])dnl dnl --------------------------------------------------------------------------- dnl CF_REMOVE_DEFINE version: 3 updated: 2010/01/09 11:05:50 dnl ---------------- dnl Remove all -U and -D options that refer to the given symbol from a list dnl of C compiler options. This works around the problem that not all dnl compilers process -U and -D options from left-to-right, so a -U option dnl cannot be used to cancel the effect of a preceding -D option. dnl dnl $1 = target (which could be the same as the source variable) dnl $2 = source (including '$') dnl $3 = symbol to remove define([CF_REMOVE_DEFINE], [ $1=`echo "$2" | \ sed -e 's/-[[UD]]'"$3"'\(=[[^ ]]*\)\?[[ ]]/ /g' \ -e 's/-[[UD]]'"$3"'\(=[[^ ]]*\)\?[$]//g'` ])dnl dnl --------------------------------------------------------------------------- dnl CF_TRY_XOPEN_SOURCE version: 1 updated: 2011/10/30 17:09:50 dnl ------------------- dnl If _XOPEN_SOURCE is not defined in the compile environment, check if we dnl can define it successfully. AC_DEFUN([CF_TRY_XOPEN_SOURCE],[ AC_CACHE_CHECK(if we should define _XOPEN_SOURCE,cf_cv_xopen_source,[ AC_TRY_COMPILE([ #include #include #include ],[ #ifndef _XOPEN_SOURCE make an error #endif], [cf_cv_xopen_source=no], [cf_save="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" AC_TRY_COMPILE([ #include #include #include ],[ #ifdef _XOPEN_SOURCE make an error #endif], [cf_cv_xopen_source=no], [cf_cv_xopen_source=$cf_XOPEN_SOURCE]) CPPFLAGS="$cf_save" ]) ]) if test "$cf_cv_xopen_source" != no ; then CF_REMOVE_DEFINE(CFLAGS,$CFLAGS,_XOPEN_SOURCE) CF_REMOVE_DEFINE(CPPFLAGS,$CPPFLAGS,_XOPEN_SOURCE) cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source" CF_ADD_CFLAGS($cf_temp_xopen_source) fi ]) dnl --------------------------------------------------------------------------- dnl CF_UPPER version: 5 updated: 2001/01/29 23:40:59 dnl -------- dnl Make an uppercase version of a variable dnl $1=uppercase($2) AC_DEFUN([CF_UPPER], [ $1=`echo "$2" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` ])dnl dnl --------------------------------------------------------------------------- dnl CF_VERBOSE version: 3 updated: 2007/07/29 09:55:12 dnl ---------- dnl Use AC_VERBOSE w/o the warnings AC_DEFUN([CF_VERBOSE], [test -n "$verbose" && echo " $1" 1>&AC_FD_MSG CF_MSG_LOG([$1]) ])dnl dnl --------------------------------------------------------------------------- dnl CF_WITH_DBMALLOC version: 7 updated: 2010/06/21 17:26:47 dnl ---------------- dnl Configure-option for dbmalloc. The optional parameter is used to override dnl the updating of $LIBS, e.g., to avoid conflict with subsequent tests. AC_DEFUN([CF_WITH_DBMALLOC],[ CF_NO_LEAKS_OPTION(dbmalloc, [ --with-dbmalloc test: use Conor Cahill's dbmalloc library], [USE_DBMALLOC]) if test "$with_dbmalloc" = yes ; then AC_CHECK_HEADER(dbmalloc.h, [AC_CHECK_LIB(dbmalloc,[debug_malloc]ifelse([$1],,[],[,$1]))]) fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_WITH_DMALLOC version: 7 updated: 2010/06/21 17:26:47 dnl --------------- dnl Configure-option for dmalloc. The optional parameter is used to override dnl the updating of $LIBS, e.g., to avoid conflict with subsequent tests. AC_DEFUN([CF_WITH_DMALLOC],[ CF_NO_LEAKS_OPTION(dmalloc, [ --with-dmalloc test: use Gray Watson's dmalloc library], [USE_DMALLOC]) if test "$with_dmalloc" = yes ; then AC_CHECK_HEADER(dmalloc.h, [AC_CHECK_LIB(dmalloc,[dmalloc_debug]ifelse([$1],,[],[,$1]))]) fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_WITH_MAN2HTML version: 5 updated: 2015/08/20 04:51:36 dnl ---------------- dnl Check for man2html and groff. Optionally prefer man2html over groff. dnl Generate a shell script which hides the differences between the two. dnl dnl We name that "man2html.tmp". dnl dnl The shell script can be removed later, e.g., using "make distclean". AC_DEFUN([CF_WITH_MAN2HTML],[ AC_REQUIRE([CF_PROG_GROFF]) AC_MSG_CHECKING(for program to convert manpage to html) AC_ARG_WITH(man2html, [ --with-man2html=XXX use XXX rather than groff], [cf_man2html=$withval], [cf_man2html=$GROFF_PATH]) cf_with_groff=no case $cf_man2html in (yes) AC_MSG_RESULT(man2html) AC_PATH_PROG(cf_man2html,man2html,no) ;; (no|groff|*/groff*) cf_with_groff=yes cf_man2html=$GROFF_PATH AC_MSG_RESULT($cf_man2html) ;; (*) AC_MSG_RESULT($cf_man2html) ;; esac MAN2HTML_TEMP="man2html.tmp" cat >$MAN2HTML_TEMP <>$MAN2HTML_TEMP <conftest.in <conftest.out cf_man2html_1st=`fgrep -n MARKER conftest.out |sed -e 's/^[[^0-9]]*://' -e 's/:.*//'` cf_man2html_top=`expr $cf_man2html_1st - 2` cf_man2html_bot=`wc -l conftest.out |sed -e 's/[[^0-9]]//g'` cf_man2html_bot=`expr $cf_man2html_bot - 2 - $cf_man2html_top` cf_man2html_top_bot="-topm=$cf_man2html_top -botm=$cf_man2html_bot" AC_MSG_RESULT($cf_man2html_top_bot) AC_MSG_CHECKING(for pagesize to use) for cf_block in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 do cat >>conftest.in <conftest.out cf_man2html_page=`fgrep -n HEAD1 conftest.out |tail -n 1 |sed -e 's/^[[^0-9]]*://' -e 's/:.*//'` test -z "$cf_man2html_page" && cf_man2html_page=99999 test "$cf_man2html_page" -gt 100 && cf_man2html_page=99999 rm -rf conftest* AC_MSG_RESULT($cf_man2html_page) cat >>$MAN2HTML_TEMP < and other headers which use u_int / u_short types cf_XOPEN_SOURCE= CF_POSIX_C_SOURCE($cf_POSIX_C_SOURCE) ;; (netbsd*) cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw ;; (openbsd[[4-9]]*) # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw cf_xopen_source="-D_BSD_SOURCE" cf_XOPEN_SOURCE=600 ;; (openbsd*) # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw ;; (osf[[45]]*) cf_xopen_source="-D_OSF_SOURCE" ;; (nto-qnx*) cf_xopen_source="-D_QNX_SOURCE" ;; (sco*) # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer ;; (solaris2.*) cf_xopen_source="-D__EXTENSIONS__" cf_cv_xopen_source=broken ;; (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2) cf_XOPEN_SOURCE= cf_POSIX_C_SOURCE= ;; (*) CF_TRY_XOPEN_SOURCE CF_POSIX_C_SOURCE($cf_POSIX_C_SOURCE) ;; esac if test -n "$cf_xopen_source" ; then CF_ADD_CFLAGS($cf_xopen_source,true) fi dnl In anything but the default case, we may have system-specific setting dnl which is still not guaranteed to provide all of the entrypoints that dnl _XOPEN_SOURCE would yield. if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then AC_MSG_CHECKING(if _XOPEN_SOURCE really is set) AC_TRY_COMPILE([#include ],[ #ifndef _XOPEN_SOURCE make an error #endif], [cf_XOPEN_SOURCE_set=yes], [cf_XOPEN_SOURCE_set=no]) AC_MSG_RESULT($cf_XOPEN_SOURCE_set) if test $cf_XOPEN_SOURCE_set = yes then AC_TRY_COMPILE([#include ],[ #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE make an error #endif], [cf_XOPEN_SOURCE_set_ok=yes], [cf_XOPEN_SOURCE_set_ok=no]) if test $cf_XOPEN_SOURCE_set_ok = no then AC_MSG_WARN(_XOPEN_SOURCE is lower than requested) fi else CF_TRY_XOPEN_SOURCE fi fi ]) Index: head/contrib/byacc/config.guess =================================================================== --- head/contrib/byacc/config.guess (revision 313104) +++ head/contrib/byacc/config.guess (revision 313105) @@ -1,1462 +1,1462 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2016 Free Software Foundation, Inc. +# Copyright 1992-2017 Free Software Foundation, Inc. -timestamp='2016-10-02' +timestamp='2017-01-01' # This file 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 3 of the License, or # (at your option) any later version. # # This program 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 this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess # # Please send patches to . me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2016 Free Software Foundation, Inc. +Copyright 1992-2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case "${UNAME_SYSTEM}" in Linux|GNU|GNU/*) # If the system lacks a compiler, then just pick glibc. # We could probably try harder. LIBC=gnu eval $set_cc_for_build cat <<-EOF > $dummy.c #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #else LIBC=gnu #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` ;; esac # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ /sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || \ echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; earmv*) arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'` endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'` machine=${arch}${endian}-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently (or will in the future) and ABI. case "${UNAME_MACHINE_ARCH}" in earm*) os=netbsdelf ;; arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # Determine ABI tags. case "${UNAME_MACHINE_ARCH}" in earm*) expr='s/^earmv[0-9]/-eabi/;s/eb$//' abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"` ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}${abi}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:LibertyBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; *:Sortix:*:*) echo ${UNAME_MACHINE}-unknown-sortix exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE=alpha ;; "EV4.5 (21064)") UNAME_MACHINE=alpha ;; "LCA4 (21066/21068)") UNAME_MACHINE=alpha ;; "EV5 (21164)") UNAME_MACHINE=alphaev5 ;; "EV5.6 (21164A)") UNAME_MACHINE=alphaev56 ;; "EV5.6 (21164PC)") UNAME_MACHINE=alphapca56 ;; "EV5.7 (21164PC)") UNAME_MACHINE=alphapca57 ;; "EV6 (21264)") UNAME_MACHINE=alphaev6 ;; "EV6.7 (21264A)") UNAME_MACHINE=alphaev67 ;; "EV6.8CB (21264C)") UNAME_MACHINE=alphaev68 ;; "EV6.8AL (21264B)") UNAME_MACHINE=alphaev68 ;; "EV6.8CX (21264D)") UNAME_MACHINE=alphaev68 ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE=alphaev69 ;; "EV7 (21364)") UNAME_MACHINE=alphaev7 ;; "EV7.9 (21364A)") UNAME_MACHINE=alphaev79 ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH=i386 # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH=x86_64 fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = x && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/lslpp ] ; then IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH=hppa2.0n ;; 64) HP_ARCH=hppa2.0w ;; '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS="" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = hppa2.0w ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH=hppa2.0w else HP_ARCH=hppa64 fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW64*:*) echo ${UNAME_MACHINE}-pc-mingw64 exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; *:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC=gnulibc1 ; fi echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arc:Linux:*:* | arceb:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-${LIBC} else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi else echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; cris:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; e2k:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; hexagon:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:Linux:*:*) echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; k1om:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; mips64el:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; openrisc*:Linux:*:*) echo or1k-unknown-linux-${LIBC} exit ;; or32:Linux:*:* | or1k*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) echo sparc-unknown-linux-${LIBC} exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; *) echo hppa-unknown-linux-${LIBC} ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-${LIBC} exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-${LIBC} exit ;; ppc64le:Linux:*:*) echo powerpc64le-unknown-linux-${LIBC} exit ;; ppcle:Linux:*:*) echo powerpcle-unknown-linux-${LIBC} exit ;; riscv32:Linux:*:* | riscv64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux-${LIBC} exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; x86_64:Haiku:*:*) echo x86_64-unknown-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; SX-ACE:SUPER-UX:*:*) echo sxace-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown eval $set_cc_for_build if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi fi elif test "$UNAME_PROCESSOR" = i386 ; then # Avoid executing cc on OS X 10.9, as it ships with a stub # that puts up a graphical alert prompting to install # developer tools. Any system running Mac OS X 10.7 or # later (Darwin 11 and later) is required to have a 64-bit # processor. This is not true of the ARM version of Darwin # that Apple uses in portable devices. UNAME_PROCESSOR=x86_64 fi echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = 386; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'` exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx exit ;; amd64:Isilon\ OneFS:*:*) echo x86_64-unknown-onefs exit ;; esac cat >&2 </dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: Index: head/contrib/byacc/config.sub =================================================================== --- head/contrib/byacc/config.sub (revision 313104) +++ head/contrib/byacc/config.sub (revision 313105) @@ -1,1825 +1,1828 @@ #! /bin/sh # Configuration validation subroutine script. -# Copyright 1992-2016 Free Software Foundation, Inc. +# Copyright 1992-2017 Free Software Foundation, Inc. -timestamp='2016-11-19' +timestamp='2017-01-01' # This file 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 3 of the License, or # (at your option) any later version. # # This program 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 this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches to . # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) -Copyright 1992-2016 Free Software Foundation, Inc. +Copyright 1992-2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ kopensolaris*-gnu* | cloudabi*-eabi* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze*) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*178) os=-lynxos178 ;; -lynx*5) os=-lynxos5 ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ | ba \ | be32 | be64 \ | bfin \ | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ | e2k | epiphany \ | fido | fr30 | frv | ft32 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | k1om \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa32r6 | mipsisa32r6el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64r6 | mipsisa64r6el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 | or1k | or1knd | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pru \ | pyramid \ | riscv32 | riscv64 \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | visium \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; leon|leon[3-9]) basic_machine=sparc-$basic_machine ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=-none ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | ba-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | e2k-* | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | k1om-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | microblaze-* | microblazeel-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa32r6-* | mipsisa32r6el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64r6-* | mipsisa64r6el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | or1k*-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pru-* \ | pyramid-* \ | riscv32-* | riscv64-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | visium-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; asmjs) basic_machine=asmjs-unknown ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; e500v[12]) basic_machine=powerpc-unknown os=$os"spe" ;; e500v[12]-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` os=$os"spe" ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; leon-*|leon[3-9]-*) basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze*) basic_machine=microblaze-xilinx ;; mingw64) basic_machine=x86_64-pc os=-mingw64 ;; mingw32) basic_machine=i686-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; moxiebox) basic_machine=moxie-unknown os=-moxiebox ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i686-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos | rdos64) basic_machine=x86_64-pc os=-rdos ;; rdos32) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* | -cloudabi* | -sortix* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ - | -onefs* | -tirtos* | -phoenix* | -fuchsia*) + | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -ios) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; c8051-*) os=-elf ;; hexagon-*) os=-elf ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 + ;; + pru-*) + os=-elf ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: Index: head/contrib/byacc/configure =================================================================== --- head/contrib/byacc/configure (revision 313104) +++ head/contrib/byacc/configure (revision 313105) @@ -1,6648 +1,6701 @@ #! /bin/sh # From configure.in Revision: 1.21 . # Guess values for system-dependent variables and create Makefiles. # Generated by Autoconf 2.52.20150926. # # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # Sed expression to map a string onto a valid variable name. as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi # Name of the executable. as_me=`echo "$0" |sed 's,.*[\\/],,'` if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file as_executable_p="test -f" # Support unset when possible. if (FOO=FOO; unset FOO) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # NLS nuisances. $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; } $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; } $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; } $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; } $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; } $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; } $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; } $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; } # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; } # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` exec 6>&1 # # Initializations. # ac_default_prefix=/usr/local cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. # This variable seems obsolete. It should probably be removed, and # only ac_max_sed_lines should be used. : ${ac_max_here_lines=38} ac_unique_file="main.c" # Factoring default headers for most tests. ac_includes_default="\ #include #if HAVE_SYS_TYPES_H # include #endif #if HAVE_SYS_STAT_H # include #endif #if STDC_HEADERS # include # include #else # if HAVE_STDLIB_H # include # endif #endif #if HAVE_STRING_H # if !STDC_HEADERS && HAVE_MEMORY_H # include # endif # include #endif #if HAVE_STRINGS_H # include #endif #if HAVE_INTTYPES_H # include #else # if HAVE_STDINT_H # include # endif #endif #if HAVE_UNISTD_H # include #endif" # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${datarootdir}/info' mandir='${datarootdir}/man' # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` eval "$ac_envvar='$ac_optarg'" export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute paths. for ac_var in exec_prefix prefix do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* | NONE | '' ) ;; *) { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir \ localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* ) ;; *) { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. build=$build_alias host=$host_alias target=$target_alias # FIXME: should be removed in autoconf 3.0. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_prog=$0 ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'` test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } else { echo "$as_me: error: cannot find sources in $srcdir" >&2 { (exit 1); exit 1; }; } fi fi srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias ac_cv_env_build_alias_set=${build_alias+set} ac_cv_env_build_alias_value=$build_alias ac_env_host_alias_set=${host_alias+set} ac_env_host_alias_value=$host_alias ac_cv_env_host_alias_set=${host_alias+set} ac_cv_env_host_alias_value=$host_alias ac_env_target_alias_set=${target_alias+set} ac_env_target_alias_value=$target_alias ac_cv_env_target_alias_set=${target_alias+set} ac_cv_env_target_alias_value=$target_alias ac_env_CC_set=${CC+set} ac_env_CC_value=$CC ac_cv_env_CC_set=${CC+set} ac_cv_env_CC_value=$CC ac_env_CFLAGS_set=${CFLAGS+set} ac_env_CFLAGS_value=$CFLAGS ac_cv_env_CFLAGS_set=${CFLAGS+set} ac_cv_env_CFLAGS_value=$CFLAGS ac_env_LDFLAGS_set=${LDFLAGS+set} ac_env_LDFLAGS_value=$LDFLAGS ac_cv_env_LDFLAGS_set=${LDFLAGS+set} ac_cv_env_LDFLAGS_value=$LDFLAGS ac_env_CPPFLAGS_set=${CPPFLAGS+set} ac_env_CPPFLAGS_value=$CPPFLAGS ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} ac_cv_env_CPPFLAGS_value=$CPPFLAGS ac_env_CPP_set=${CPP+set} ac_env_CPP_value=$CPP ac_cv_env_CPP_set=${CPP+set} ac_cv_env_CPP_value=$CPP # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat < if you have libraries in a nonstandard directory CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. EOF fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. ac_popdir=`pwd` for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue cd $ac_subdir # A "../" for each directory in /$ac_subdir. ac_dots=`echo $ac_subdir | sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'` case $srcdir in .) # No --srcdir option. We are building in place. ac_sub_srcdir=$srcdir ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_sub_srcdir=$srcdir/$ac_subdir ;; *) # Relative path. ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;; esac # Check for guested configure; otherwise get Cygnus style configure. if test -f $ac_sub_srcdir/configure.gnu; then echo $SHELL $ac_sub_srcdir/configure.gnu --help=recursive elif test -f $ac_sub_srcdir/configure; then echo $SHELL $ac_sub_srcdir/configure --help=recursive elif test -f $ac_sub_srcdir/configure.ac || test -f $ac_sub_srcdir/configure.in; then echo $ac_configure --help else echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2 fi cd $ac_popdir done fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\EOF Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. EOF exit 0 fi exec 5>config.log cat >&5 </dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` hostinfo = `(hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` PATH = $PATH _ASUNAME } >&5 cat >&5 <\?\"\']*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" ac_sep=" " ;; *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg" ac_sep=" " ;; esac # Get rid of the leading space. done # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. trap 'exit_status=$? # Save into config.log some information that might help in debugging. echo >&5 echo "## ----------------- ##" >&5 echo "## Cache variables. ##" >&5 echo "## ----------------- ##" >&5 echo >&5 # The following way of writing the cache mishandles newlines in values, { (set) 2>&1 | case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } >&5 sed "/^$/d" confdefs.h >conftest.log if test -s conftest.log; then echo >&5 echo "## ------------ ##" >&5 echo "## confdefs.h. ##" >&5 echo "## ------------ ##" >&5 echo >&5 cat conftest.log >&5 fi (echo; echo) >&5 test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" >&5 echo "$as_me: exit $exit_status" >&5 rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo >confdefs.h # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then { echo "$as_me:894: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} cat "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:905: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; *) . ./$cache_file;; esac fi else { echo "$as_me:913: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in `(set) 2>&1 | sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val="\$ac_cv_env_${ac_var}_value" eval ac_new_val="\$ac_env_${ac_var}_value" case $ac_old_set,$ac_new_set in set,) { echo "$as_me:929: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:933: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:939: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:941: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:943: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. It doesn't matter if # we pass some twice (in addition to the command line arguments). if test "$ac_new_set" = set; then case $ac_new_val in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ac_configure_args="$ac_configure_args '$ac_arg'" ;; *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:962: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:964: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_main_return=return case `echo "testing\c" 2>/dev/null; echo 1,2,3`,`echo -n testing 2>/dev/null; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C= # newlines do not sed ;-) only broken shells would use this case anyway ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac echo "#! $SHELL" >conftest.sh echo "exit 0" >>conftest.sh chmod +x conftest.sh if { (echo "$as_me:985: PATH=\".;.\"; conftest.sh") >&5 (PATH=".;."; conftest.sh) 2>&5 ac_status=$? echo "$as_me:988: \$? = $ac_status" >&5 (exit $ac_status); }; then ac_path_separator=';' else ac_path_separator=: fi PATH_SEPARATOR="$ac_path_separator" rm -f conftest.sh ac_config_headers="$ac_config_headers config.h:config_h.in" ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f $ac_dir/shtool; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:1016: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} { (exit 1); exit 1; }; } fi ac_config_guess="$SHELL $ac_aux_dir/config.guess" ac_config_sub="$SHELL $ac_aux_dir/config.sub" ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # Make sure we can run config.sub. $ac_config_sub sun4 >/dev/null 2>&1 || { { echo "$as_me:1026: error: cannot run $ac_config_sub" >&5 echo "$as_me: error: cannot run $ac_config_sub" >&2;} { (exit 1); exit 1; }; } echo "$as_me:1030: checking build system type" >&5 echo $ECHO_N "checking build system type... $ECHO_C" >&6 if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_build_alias=$build_alias test -z "$ac_cv_build_alias" && ac_cv_build_alias=`$ac_config_guess` test -z "$ac_cv_build_alias" && { { echo "$as_me:1039: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || { { echo "$as_me:1043: error: $ac_config_sub $ac_cv_build_alias failed." >&5 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:1048: result: $ac_cv_build" >&5 echo "${ECHO_T}$ac_cv_build" >&6 build=$ac_cv_build build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$as_me:1055: checking host system type" >&5 echo $ECHO_N "checking host system type... $ECHO_C" >&6 if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_host_alias=$host_alias test -z "$ac_cv_host_alias" && ac_cv_host_alias=$ac_cv_build_alias ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || { { echo "$as_me:1064: error: $ac_config_sub $ac_cv_host_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:1069: result: $ac_cv_host" >&5 echo "${ECHO_T}$ac_cv_host" >&6 host=$ac_cv_host host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then echo "$as_me:1077: checking target system type" >&5 echo $ECHO_N "checking target system type... $ECHO_C" >&6 if test "${ac_cv_target+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_target_alias=$target_alias test "x$ac_cv_target_alias" = "x" && ac_cv_target_alias=$ac_cv_host_alias ac_cv_target=`$ac_config_sub $ac_cv_target_alias` || { { echo "$as_me:1086: error: $ac_config_sub $ac_cv_target_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:1091: result: $ac_cv_target" >&5 echo "${ECHO_T}$ac_cv_target" >&6 target=$ac_cv_target target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` # The aliases save the names the user supplied, while $host etc. # will get canonicalized. test -n "$target_alias" && test "$program_prefix$program_suffix$program_transform_name" = \ NONENONEs,x,x, && program_prefix=${target_alias}- system_name="$host_os" else system_name="`(uname -s -r) 2>/dev/null`" if test -z "$system_name" ; then system_name="`(hostname) 2>/dev/null`" fi fi test -n "$system_name" && cat >>confdefs.h <&6 else cf_cv_system_name="$system_name" fi test -z "$system_name" && system_name="$cf_cv_system_name" test -n "$cf_cv_system_name" && echo "$as_me:1123: result: Configuring for $cf_cv_system_name" >&5 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6 if test ".$system_name" != ".$cf_cv_system_name" ; then echo "$as_me:1127: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6 { { echo "$as_me:1129: error: \"Please remove config.cache and try again.\"" >&5 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;} { (exit 1); exit 1; }; } 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" # Double any \ or $. echo might interpret backslashes. # By default was `s,x,x', remove it if useless. cat <<\_ACEOF >conftest.sed s/[\\$]/&&/g;s/;s,x,x,$// _ACEOF program_transform_name=`echo $program_transform_name | sed -f conftest.sed` rm conftest.sed ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_main_return=return if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 echo "$as_me:1156: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:1171: found $ac_dir/$ac_word" >&5 break done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:1179: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:1182: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo "$as_me:1191: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:1206: found $ac_dir/$ac_word" >&5 break done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:1214: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:1217: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 echo "$as_me:1230: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:1245: found $ac_dir/$ac_word" >&5 break done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:1253: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:1256: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:1265: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_ac_ct_CC="cc" echo "$as_me:1280: found $ac_dir/$ac_word" >&5 break done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:1288: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:1291: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi 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 "$as_me:1304: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:1324: found $ac_dir/$ac_word" >&5 break done 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 $# != 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" ${1+"$@"} shift ac_cv_prog_CC="$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:1346: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:1349: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:1360: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:1375: found $ac_dir/$ac_word" >&5 break done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:1383: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:1386: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:1399: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:1414: found $ac_dir/$ac_word" >&5 break done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:1422: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:1425: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CC" && break done CC=$ac_ct_CC fi fi test -z "$CC" && { { echo "$as_me:1437: error: no acceptable cc found in \$PATH" >&5 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:1442:" \ "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:1445: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:1448: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:1450: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:1453: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:1455: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:1458: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF #line 1462 "configure" #include "confdefs.h" int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. echo "$as_me:1478: checking for C compiler default output" >&5 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` if { (eval echo "$as_me:1481: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 ac_status=$? echo "$as_me:1484: \$? = $ac_status" >&5 (exit $ac_status); }; then # Find the output, starting from the most likely. This scheme is # not robust to junk in `.', hence go to wildcards (a.*) only as a last # resort. for ac_file in `ls a.exe conftest.exe 2>/dev/null; ls a.out conftest 2>/dev/null; ls a.* conftest.* 2>/dev/null`; do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; a.out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` # FIXME: I believe we export ac_cv_exeext for Libtool --akim. export ac_cv_exeext break;; * ) break;; esac done else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 { { echo "$as_me:1507: error: C compiler cannot create executables" >&5 echo "$as_me: error: C compiler cannot create executables" >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext echo "$as_me:1513: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6 # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:1518: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (eval echo "$as_me:1524: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:1527: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:1534: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'." >&2;} { (exit 1); exit 1; }; } fi fi fi echo "$as_me:1542: result: yes" >&5 echo "${ECHO_T}yes" >&6 rm -f a.out a.exe conftest$ac_cv_exeext ac_clean_files=$ac_clean_files_save # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:1549: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 echo "$as_me:1551: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6 echo "$as_me:1554: checking for executable suffix" >&5 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6 if { (eval echo "$as_me:1556: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:1559: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` export ac_cv_exeext break;; * ) break;; esac done else { { echo "$as_me:1575: error: cannot compute EXEEXT: cannot compile and link" >&5 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext echo "$as_me:1581: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6 rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT echo "$as_me:1587: checking for object suffix" >&5 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6 if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 1593 "configure" #include "confdefs.h" int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (eval echo "$as_me:1605: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:1608: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 { { echo "$as_me:1620: error: cannot compute OBJEXT: cannot compile" >&5 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi echo "$as_me:1627: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6 OBJEXT=$ac_cv_objext ac_objext=$OBJEXT echo "$as_me:1631: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 1637 "configure" #include "confdefs.h" int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:1652: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:1655: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:1658: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:1661: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:1673: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS CFLAGS="-g" echo "$as_me:1679: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 1685 "configure" #include "confdefs.h" int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:1697: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:1700: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:1703: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:1706: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_prog_cc_g=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:1716: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&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 # Some people use a C++ compiler to compile C. Since we use `exit', # in C++ we need to declare it. In case someone uses the same compiler # for both compiling C and C++ we need to have the C++ compiler decide # the declaration of exit, since it's the most demanding environment. cat >conftest.$ac_ext <<_ACEOF #ifndef __cplusplus choke me #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:1743: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:1746: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:1749: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:1752: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ ''\ '#include ' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF #line 1764 "configure" #include "confdefs.h" #include $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:1777: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:1780: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:1783: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:1786: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 continue fi rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF #line 1796 "configure" #include "confdefs.h" $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:1808: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:1811: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:1814: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:1817: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext done rm -rf conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_main_return=return GCC_VERSION=none if test "$GCC" = yes ; then echo "$as_me:1847: checking version of $CC" >&5 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6 GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC[^)]*) //' -e 's/^.*(Debian[^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`" test -z "$GCC_VERSION" && GCC_VERSION=unknown echo "$as_me:1851: result: $GCC_VERSION" >&5 echo "${ECHO_T}$GCC_VERSION" >&6 fi echo "$as_me:1855: checking for $CC option to accept ANSI C" >&5 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 if test "${ac_cv_prog_cc_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF #line 1863 "configure" #include "confdefs.h" #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; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF # 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 10.20 and later -Ae # HP-UX older versions -Aa -D_HPUX_SOURCE # SVR4 -Xc -D__EXTENSIONS__ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (eval echo "$as_me:1912: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:1915: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:1918: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:1921: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_stdc=$ac_arg break else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext done rm -f conftest.$ac_ext conftest.$ac_objext CC=$ac_save_CC fi case "x$ac_cv_prog_cc_stdc" in x|xno) echo "$as_me:1938: result: none needed" >&5 echo "${ECHO_T}none needed" >&6 ;; *) echo "$as_me:1941: result: $ac_cv_prog_cc_stdc" >&5 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 CC="$CC $ac_cv_prog_cc_stdc" ;; esac # This should have been defined by AC_PROG_CC : ${CC:=cc} echo "$as_me:1949: checking \$CC variable" >&5 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6 case "$CC" in (*[\ \ ]-*) echo "$as_me:1953: result: broken" >&5 echo "${ECHO_T}broken" >&6 { echo "$as_me:1955: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&5 echo "$as_me: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;} # humor him... cf_flags=`echo "$CC" | sed -e 's/^.*[ ]\(-[^ ]\)/\1/'` CC=`echo "$CC " | sed -e 's/[ ]-[^ ].*$//' -e 's/[ ]*$//'` for cf_arg in $cf_flags do case "x$cf_arg" in (x-[IUDfgOW]*) cf_fix_cppflags=no cf_new_cflags= cf_new_cppflags= cf_new_extra_cppflags= for cf_add_cflags in $cf_flags do case $cf_fix_cppflags in (no) case $cf_add_cflags in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) case $cf_add_cflags in (-D*) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" continue elif test "${cf_tst_cflags}" = "\"'" ; then cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" continue fi ;; esac case "$CPPFLAGS" in (*$cf_add_cflags) ;; (*) case $cf_add_cflags in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` CPPFLAGS=`echo "$CPPFLAGS" | \ sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'` ;; esac cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" ;; esac ;; (*) cf_new_cflags="$cf_new_cflags $cf_add_cflags" ;; esac ;; (yes) cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=no ;; esac done if test -n "$cf_new_cflags" ; then CFLAGS="$CFLAGS $cf_new_cflags" fi if test -n "$cf_new_cppflags" ; then CPPFLAGS="$CPPFLAGS $cf_new_cppflags" fi if test -n "$cf_new_extra_cppflags" ; then EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" fi ;; (*) CC="$CC $cf_arg" ;; esac done test -n "$verbose" && echo " resulting CC: '$CC'" 1>&6 echo "${as_me:-configure}:2051: testing resulting CC: '$CC' ..." 1>&5 test -n "$verbose" && echo " resulting CFLAGS: '$CFLAGS'" 1>&6 echo "${as_me:-configure}:2055: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5 test -n "$verbose" && echo " resulting CPPFLAGS: '$CPPFLAGS'" 1>&6 echo "${as_me:-configure}:2059: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5 ;; (*) echo "$as_me:2063: result: ok" >&5 echo "${ECHO_T}ok" >&6 ;; esac echo "$as_me:2068: checking whether ${MAKE-make} sets \${MAKE}" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\EOF all: @echo 'ac_maketemp="${MAKE}"' EOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftest.make 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 conftest.make fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then echo "$as_me:2088: result: yes" >&5 echo "${ECHO_T}yes" >&6 SET_MAKE= else echo "$as_me:2092: result: no" >&5 echo "${ECHO_T}no" >&6 SET_MAKE="MAKE=${MAKE-make}" fi # 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 # AmigaOS /C/install, which installs bootblocks on floppy discs # 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 "$as_me:2109: checking for a BSD compatible install" >&5 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_save_IFS=$IFS; IFS=$ac_path_separator for ac_dir in $PATH; do IFS=$ac_save_IFS # Account for people who put trailing slashes in PATH elements. case $ac_dir/ in / | ./ | .// | /cC/* \ | /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 $as_executable_p "$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. : elif test $ac_prog = install && grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$ac_dir/$ac_prog -c" break 2 fi fi done ;; esac done 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 "$as_me:2158: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&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}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo "$as_me:2169: checking if filesystem supports mixed-case filenames" >&5 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6 if test "${cf_cv_mixedcase+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes ; then case $target_alias in (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*) cf_cv_mixedcase=no ;; (*) cf_cv_mixedcase=yes ;; esac else rm -f conftest CONFTEST echo test >conftest if test -f CONFTEST ; then cf_cv_mixedcase=no else cf_cv_mixedcase=yes fi rm -f conftest CONFTEST fi fi echo "$as_me:2196: result: $cf_cv_mixedcase" >&5 echo "${ECHO_T}$cf_cv_mixedcase" >&6 test "$cf_cv_mixedcase" = yes && cat >>confdefs.h <<\EOF #define MIXEDCASE_FILENAMES 1 EOF for ac_prog in exctags ctags do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:2207: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CTAGS+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CTAGS"; then ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_CTAGS="$ac_prog" echo "$as_me:2222: found $ac_dir/$ac_word" >&5 break done fi fi CTAGS=$ac_cv_prog_CTAGS if test -n "$CTAGS"; then echo "$as_me:2230: result: $CTAGS" >&5 echo "${ECHO_T}$CTAGS" >&6 else echo "$as_me:2233: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CTAGS" && break done for ac_prog in exetags etags do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:2244: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ETAGS+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ETAGS"; then ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_ETAGS="$ac_prog" echo "$as_me:2259: found $ac_dir/$ac_word" >&5 break done fi fi ETAGS=$ac_cv_prog_ETAGS if test -n "$ETAGS"; then echo "$as_me:2267: result: $ETAGS" >&5 echo "${ECHO_T}$ETAGS" >&6 else echo "$as_me:2270: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ETAGS" && break done # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args. set dummy ${CTAGS:-ctags}; ac_word=$2 echo "$as_me:2279: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$MAKE_LOWER_TAGS"; then ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_MAKE_LOWER_TAGS="yes" echo "$as_me:2294: found $ac_dir/$ac_word" >&5 break done test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no" fi fi MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS if test -n "$MAKE_LOWER_TAGS"; then echo "$as_me:2303: result: $MAKE_LOWER_TAGS" >&5 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6 else echo "$as_me:2306: result: no" >&5 echo "${ECHO_T}no" >&6 fi if test "$cf_cv_mixedcase" = yes ; then # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args. set dummy ${ETAGS:-etags}; ac_word=$2 echo "$as_me:2313: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$MAKE_UPPER_TAGS"; then ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_MAKE_UPPER_TAGS="yes" echo "$as_me:2328: found $ac_dir/$ac_word" >&5 break done test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no" fi fi MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS if test -n "$MAKE_UPPER_TAGS"; then echo "$as_me:2337: result: $MAKE_UPPER_TAGS" >&5 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6 else echo "$as_me:2340: result: no" >&5 echo "${ECHO_T}no" >&6 fi else MAKE_UPPER_TAGS=no fi if test "$MAKE_UPPER_TAGS" = yes ; then MAKE_UPPER_TAGS= else MAKE_UPPER_TAGS="#" fi if test "$MAKE_LOWER_TAGS" = yes ; then MAKE_LOWER_TAGS= else MAKE_LOWER_TAGS="#" fi for ac_prog in mawk gawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:2364: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AWK+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_AWK="$ac_prog" echo "$as_me:2379: found $ac_dir/$ac_word" >&5 break done fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then echo "$as_me:2387: result: $AWK" >&5 echo "${ECHO_T}$AWK" >&6 else echo "$as_me:2390: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$AWK" && break done test -z "$AWK" && { { echo "$as_me:2397: error: No awk program found" >&5 echo "$as_me: error: No awk program found" >&2;} { (exit 1); exit 1; }; } for ac_prog in lint cppcheck splint do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:2405: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_LINT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$LINT"; then ac_cv_prog_LINT="$LINT" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_LINT="$ac_prog" echo "$as_me:2420: found $ac_dir/$ac_word" >&5 break done fi fi LINT=$ac_cv_prog_LINT if test -n "$LINT"; then echo "$as_me:2428: result: $LINT" >&5 echo "${ECHO_T}$LINT" >&6 else echo "$as_me:2431: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$LINT" && break done cf_XOPEN_SOURCE=500 cf_POSIX_C_SOURCE=199506L cf_xopen_source= case $host_os in (aix[4-7]*) cf_xopen_source="-D_ALL_SOURCE" ;; (msys) cf_XOPEN_SOURCE=600 ;; (darwin[0-8].*) cf_xopen_source="-D_APPLE_C_SOURCE" ;; (darwin*) cf_xopen_source="-D_DARWIN_C_SOURCE" cf_XOPEN_SOURCE= ;; (freebsd*|dragonfly*) # 5.x headers associate # _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L # _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L cf_POSIX_C_SOURCE=200112L cf_XOPEN_SOURCE=600 cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" ;; (hpux11*) cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500" ;; (hpux*) cf_xopen_source="-D_HPUX_SOURCE" ;; (irix[56].*) cf_xopen_source="-D_SGI_SOURCE" cf_XOPEN_SOURCE= ;; (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin) echo "$as_me:2476: checking if we must define _GNU_SOURCE" >&5 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6 if test "${cf_cv_gnu_source+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 2483 "configure" #include "confdefs.h" #include int main () { #ifndef _XOPEN_SOURCE make an error #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:2498: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:2501: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:2504: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:2507: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_gnu_source=no else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_save="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" cat >conftest.$ac_ext <<_ACEOF #line 2516 "configure" #include "confdefs.h" #include int main () { #ifdef _XOPEN_SOURCE make an error #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:2531: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:2534: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:2537: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:2540: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_gnu_source=no else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_cv_gnu_source=yes fi rm -f conftest.$ac_objext conftest.$ac_ext CPPFLAGS="$cf_save" fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:2555: result: $cf_cv_gnu_source" >&5 echo "${ECHO_T}$cf_cv_gnu_source" >&6 if test "$cf_cv_gnu_source" = yes then echo "$as_me:2560: checking if we should also define _DEFAULT_SOURCE" >&5 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6 if test "${cf_cv_default_source+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" cat >conftest.$ac_ext <<_ACEOF #line 2568 "configure" #include "confdefs.h" #include int main () { #ifdef _DEFAULT_SOURCE make an error #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:2583: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:2586: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:2589: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:2592: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_default_source=no else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_cv_default_source=yes fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:2603: result: $cf_cv_default_source" >&5 echo "${ECHO_T}$cf_cv_default_source" >&6 test "$cf_cv_default_source" = yes && CPPFLAGS="$CPPFLAGS -D_DEFAULT_SOURCE" fi ;; (minix*) cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this... ;; (mirbsd*) # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks and other headers which use u_int / u_short types cf_XOPEN_SOURCE= cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE cf_save_CFLAGS="$CFLAGS" cf_save_CPPFLAGS="$CPPFLAGS" cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \ sed -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?$//g'` cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \ sed -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?$//g'` echo "$as_me:2629: checking if we should define _POSIX_C_SOURCE" >&5 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6 if test "${cf_cv_posix_c_source+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else echo "${as_me:-configure}:2635: testing if the symbol is already defined go no further ..." 1>&5 cat >conftest.$ac_ext <<_ACEOF #line 2638 "configure" #include "confdefs.h" #include int main () { #ifndef _POSIX_C_SOURCE make an error #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:2653: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:2656: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:2659: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:2662: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_posix_c_source=no else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_want_posix_source=no case .$cf_POSIX_C_SOURCE in (.[12]??*) cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE" ;; (.2) cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE" cf_want_posix_source=yes ;; (.*) cf_want_posix_source=yes ;; esac if test "$cf_want_posix_source" = yes ; then cat >conftest.$ac_ext <<_ACEOF #line 2683 "configure" #include "confdefs.h" #include int main () { #ifdef _POSIX_SOURCE make an error #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:2698: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:2701: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:2704: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:2707: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE" fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "${as_me:-configure}:2718: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5 CFLAGS="$cf_trim_CFLAGS" CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source" echo "${as_me:-configure}:2723: testing if the second compile does not leave our definition intact error ..." 1>&5 cat >conftest.$ac_ext <<_ACEOF #line 2726 "configure" #include "confdefs.h" #include int main () { #ifndef _POSIX_C_SOURCE make an error #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:2741: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:2744: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:2747: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:2750: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_cv_posix_c_source=no fi rm -f conftest.$ac_objext conftest.$ac_ext CFLAGS="$cf_save_CFLAGS" CPPFLAGS="$cf_save_CPPFLAGS" fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:2766: result: $cf_cv_posix_c_source" >&5 echo "${ECHO_T}$cf_cv_posix_c_source" >&6 if test "$cf_cv_posix_c_source" != no ; then CFLAGS="$cf_trim_CFLAGS" CPPFLAGS="$cf_trim_CPPFLAGS" cf_fix_cppflags=no cf_new_cflags= cf_new_cppflags= cf_new_extra_cppflags= for cf_add_cflags in $cf_cv_posix_c_source do case $cf_fix_cppflags in (no) case $cf_add_cflags in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) case $cf_add_cflags in (-D*) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" continue elif test "${cf_tst_cflags}" = "\"'" ; then cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" continue fi ;; esac case "$CPPFLAGS" in (*$cf_add_cflags) ;; (*) case $cf_add_cflags in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` CPPFLAGS=`echo "$CPPFLAGS" | \ sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'` ;; esac cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" ;; esac ;; (*) cf_new_cflags="$cf_new_cflags $cf_add_cflags" ;; esac ;; (yes) cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=no ;; esac done if test -n "$cf_new_cflags" ; then CFLAGS="$CFLAGS $cf_new_cflags" fi if test -n "$cf_new_cppflags" ; then CPPFLAGS="$CPPFLAGS $cf_new_cppflags" fi if test -n "$cf_new_extra_cppflags" ; then EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" fi fi ;; (netbsd*) cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw ;; (openbsd[4-9]*) # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw cf_xopen_source="-D_BSD_SOURCE" cf_XOPEN_SOURCE=600 ;; (openbsd*) # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw ;; (osf[45]*) cf_xopen_source="-D_OSF_SOURCE" ;; (nto-qnx*) cf_xopen_source="-D_QNX_SOURCE" ;; (sco*) # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer ;; (solaris2.*) cf_xopen_source="-D__EXTENSIONS__" cf_cv_xopen_source=broken ;; (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2) cf_XOPEN_SOURCE= cf_POSIX_C_SOURCE= ;; (*) echo "$as_me:2884: checking if we should define _XOPEN_SOURCE" >&5 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6 if test "${cf_cv_xopen_source+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 2891 "configure" #include "confdefs.h" #include #include #include int main () { #ifndef _XOPEN_SOURCE make an error #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:2910: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:2913: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:2916: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:2919: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_xopen_source=no else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_save="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" cat >conftest.$ac_ext <<_ACEOF #line 2928 "configure" #include "confdefs.h" #include #include #include int main () { #ifdef _XOPEN_SOURCE make an error #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:2947: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:2950: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:2953: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:2956: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_xopen_source=no else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_cv_xopen_source=$cf_XOPEN_SOURCE fi rm -f conftest.$ac_objext conftest.$ac_ext CPPFLAGS="$cf_save" fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:2971: result: $cf_cv_xopen_source" >&5 echo "${ECHO_T}$cf_cv_xopen_source" >&6 if test "$cf_cv_xopen_source" != no ; then CFLAGS=`echo "$CFLAGS" | \ sed -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?$//g'` CPPFLAGS=`echo "$CPPFLAGS" | \ sed -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?$//g'` cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source" cf_fix_cppflags=no cf_new_cflags= cf_new_cppflags= cf_new_extra_cppflags= for cf_add_cflags in $cf_temp_xopen_source do case $cf_fix_cppflags in (no) case $cf_add_cflags in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) case $cf_add_cflags in (-D*) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" continue elif test "${cf_tst_cflags}" = "\"'" ; then cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" continue fi ;; esac case "$CPPFLAGS" in (*$cf_add_cflags) ;; (*) case $cf_add_cflags in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` CPPFLAGS=`echo "$CPPFLAGS" | \ sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'` ;; esac cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" ;; esac ;; (*) cf_new_cflags="$cf_new_cflags $cf_add_cflags" ;; esac ;; (yes) cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=no ;; esac done if test -n "$cf_new_cflags" ; then CFLAGS="$CFLAGS $cf_new_cflags" fi if test -n "$cf_new_cppflags" ; then CPPFLAGS="$CPPFLAGS $cf_new_cppflags" fi if test -n "$cf_new_extra_cppflags" ; then EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" fi fi cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE cf_save_CFLAGS="$CFLAGS" cf_save_CPPFLAGS="$CPPFLAGS" cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \ sed -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?$//g'` cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \ sed -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?$//g'` echo "$as_me:3079: checking if we should define _POSIX_C_SOURCE" >&5 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6 if test "${cf_cv_posix_c_source+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else echo "${as_me:-configure}:3085: testing if the symbol is already defined go no further ..." 1>&5 cat >conftest.$ac_ext <<_ACEOF #line 3088 "configure" #include "confdefs.h" #include int main () { #ifndef _POSIX_C_SOURCE make an error #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:3103: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:3106: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:3109: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:3112: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_posix_c_source=no else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_want_posix_source=no case .$cf_POSIX_C_SOURCE in (.[12]??*) cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE" ;; (.2) cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE" cf_want_posix_source=yes ;; (.*) cf_want_posix_source=yes ;; esac if test "$cf_want_posix_source" = yes ; then cat >conftest.$ac_ext <<_ACEOF #line 3133 "configure" #include "confdefs.h" #include int main () { #ifdef _POSIX_SOURCE make an error #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:3148: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:3151: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:3154: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:3157: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE" fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "${as_me:-configure}:3168: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5 CFLAGS="$cf_trim_CFLAGS" CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source" echo "${as_me:-configure}:3173: testing if the second compile does not leave our definition intact error ..." 1>&5 cat >conftest.$ac_ext <<_ACEOF #line 3176 "configure" #include "confdefs.h" #include int main () { #ifndef _POSIX_C_SOURCE make an error #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:3191: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:3194: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:3197: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:3200: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_cv_posix_c_source=no fi rm -f conftest.$ac_objext conftest.$ac_ext CFLAGS="$cf_save_CFLAGS" CPPFLAGS="$cf_save_CPPFLAGS" fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:3216: result: $cf_cv_posix_c_source" >&5 echo "${ECHO_T}$cf_cv_posix_c_source" >&6 if test "$cf_cv_posix_c_source" != no ; then CFLAGS="$cf_trim_CFLAGS" CPPFLAGS="$cf_trim_CPPFLAGS" cf_fix_cppflags=no cf_new_cflags= cf_new_cppflags= cf_new_extra_cppflags= for cf_add_cflags in $cf_cv_posix_c_source do case $cf_fix_cppflags in (no) case $cf_add_cflags in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) case $cf_add_cflags in (-D*) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" continue elif test "${cf_tst_cflags}" = "\"'" ; then cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" continue fi ;; esac case "$CPPFLAGS" in (*$cf_add_cflags) ;; (*) case $cf_add_cflags in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` CPPFLAGS=`echo "$CPPFLAGS" | \ sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'` ;; esac cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" ;; esac ;; (*) cf_new_cflags="$cf_new_cflags $cf_add_cflags" ;; esac ;; (yes) cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=no ;; esac done if test -n "$cf_new_cflags" ; then CFLAGS="$CFLAGS $cf_new_cflags" fi if test -n "$cf_new_cppflags" ; then CPPFLAGS="$CPPFLAGS $cf_new_cppflags" fi if test -n "$cf_new_extra_cppflags" ; then EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" fi fi ;; esac if test -n "$cf_xopen_source" ; then cf_fix_cppflags=no cf_new_cflags= cf_new_cppflags= cf_new_extra_cppflags= for cf_add_cflags in $cf_xopen_source do case $cf_fix_cppflags in (no) case $cf_add_cflags in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) case $cf_add_cflags in (-D*) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" continue elif test "${cf_tst_cflags}" = "\"'" ; then cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" continue fi ;; esac case "$CPPFLAGS" in (*$cf_add_cflags) ;; (*) case $cf_add_cflags in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` CPPFLAGS=`echo "$CPPFLAGS" | \ sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'` ;; esac cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" ;; esac ;; (*) cf_new_cflags="$cf_new_cflags $cf_add_cflags" ;; esac ;; (yes) cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=no ;; esac done if test -n "$cf_new_cflags" ; then test -n "$verbose" && echo " add to \$CFLAGS $cf_new_cflags" 1>&6 echo "${as_me:-configure}:3374: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5 CFLAGS="$CFLAGS $cf_new_cflags" fi if test -n "$cf_new_cppflags" ; then test -n "$verbose" && echo " add to \$CPPFLAGS $cf_new_cppflags" 1>&6 echo "${as_me:-configure}:3382: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5 CPPFLAGS="$CPPFLAGS $cf_new_cppflags" fi if test -n "$cf_new_extra_cppflags" ; then test -n "$verbose" && echo " add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6 echo "${as_me:-configure}:3390: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5 EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" fi fi if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then echo "$as_me:3398: checking if _XOPEN_SOURCE really is set" >&5 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line 3401 "configure" #include "confdefs.h" #include int main () { #ifndef _XOPEN_SOURCE make an error #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:3416: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:3419: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:3422: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:3425: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_XOPEN_SOURCE_set=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_XOPEN_SOURCE_set=no fi rm -f conftest.$ac_objext conftest.$ac_ext echo "$as_me:3434: result: $cf_XOPEN_SOURCE_set" >&5 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6 if test $cf_XOPEN_SOURCE_set = yes then cat >conftest.$ac_ext <<_ACEOF #line 3439 "configure" #include "confdefs.h" #include int main () { #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE make an error #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:3454: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:3457: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:3460: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:3463: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_XOPEN_SOURCE_set_ok=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_XOPEN_SOURCE_set_ok=no fi rm -f conftest.$ac_objext conftest.$ac_ext if test $cf_XOPEN_SOURCE_set_ok = no then { echo "$as_me:3474: WARNING: _XOPEN_SOURCE is lower than requested" >&5 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;} fi else echo "$as_me:3479: checking if we should define _XOPEN_SOURCE" >&5 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6 if test "${cf_cv_xopen_source+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 3486 "configure" #include "confdefs.h" #include #include #include int main () { #ifndef _XOPEN_SOURCE make an error #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:3505: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:3508: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:3511: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:3514: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_xopen_source=no else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_save="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" cat >conftest.$ac_ext <<_ACEOF #line 3523 "configure" #include "confdefs.h" #include #include #include int main () { #ifdef _XOPEN_SOURCE make an error #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:3542: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:3545: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:3548: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:3551: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_xopen_source=no else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_cv_xopen_source=$cf_XOPEN_SOURCE fi rm -f conftest.$ac_objext conftest.$ac_ext CPPFLAGS="$cf_save" fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:3566: result: $cf_cv_xopen_source" >&5 echo "${ECHO_T}$cf_cv_xopen_source" >&6 if test "$cf_cv_xopen_source" != no ; then CFLAGS=`echo "$CFLAGS" | \ sed -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?$//g'` CPPFLAGS=`echo "$CPPFLAGS" | \ sed -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?$//g'` cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source" cf_fix_cppflags=no cf_new_cflags= cf_new_cppflags= cf_new_extra_cppflags= for cf_add_cflags in $cf_temp_xopen_source do case $cf_fix_cppflags in (no) case $cf_add_cflags in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) case $cf_add_cflags in (-D*) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" continue elif test "${cf_tst_cflags}" = "\"'" ; then cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" continue fi ;; esac case "$CPPFLAGS" in (*$cf_add_cflags) ;; (*) case $cf_add_cflags in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` CPPFLAGS=`echo "$CPPFLAGS" | \ sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'` ;; esac cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" ;; esac ;; (*) cf_new_cflags="$cf_new_cflags $cf_add_cflags" ;; esac ;; (yes) cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=no ;; esac done if test -n "$cf_new_cflags" ; then CFLAGS="$CFLAGS $cf_new_cflags" fi if test -n "$cf_new_cppflags" ; then CPPFLAGS="$CPPFLAGS $cf_new_cppflags" fi if test -n "$cf_new_extra_cppflags" ; then EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" fi fi fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_main_return=return echo "$as_me:3670: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF #line 3691 "configure" #include "confdefs.h" #include Syntax error _ACEOF if { (eval echo "$as_me:3696: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:3702: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF #line 3725 "configure" #include "confdefs.h" #include _ACEOF if { (eval echo "$as_me:3729: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:3735: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi echo "$as_me:3772: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6 ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF #line 3782 "configure" #include "confdefs.h" #include Syntax error _ACEOF if { (eval echo "$as_me:3787: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:3793: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF #line 3816 "configure" #include "confdefs.h" #include _ACEOF if { (eval echo "$as_me:3820: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:3826: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:3854: error: C preprocessor \"$CPP\" fails sanity check" >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_main_return=return for ac_header in fcntl.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:3869: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line 3875 "configure" #include "confdefs.h" #include <$ac_header> _ACEOF if { (eval echo "$as_me:3879: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:3885: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.err conftest.$ac_ext fi echo "$as_me:3904: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <&5 +for ac_header in \ +unistd.h \ + +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:3919: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 3925 "configure" +#include "confdefs.h" +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:3929: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:3935: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + eval "$as_ac_Header=no" +fi +rm -f conftest.err conftest.$ac_ext +fi +echo "$as_me:3954: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <&5 echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6 if test "${cf_cv_func_mkstemp+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else rm -rf conftest* if test "$cross_compiling" = yes; then cf_cv_func_mkstemp=maybe else cat >conftest.$ac_ext <<_ACEOF -#line 3925 "configure" +#line 3975 "configure" #include "confdefs.h" #include +#ifdef HAVE_UNISTD_H +#include +#endif #include #include #include #include -int main() +int main(void) { char *tmpl = "conftestXXXXXX"; char name[2][80]; int n; int result = 0; int fd; struct stat sb; umask(077); for (n = 0; n < 2; ++n) { strcpy(name[n], tmpl); if ((fd = mkstemp(name[n])) >= 0) { if (!strcmp(name[n], tmpl) || stat(name[n], &sb) != 0 || (sb.st_mode & S_IFMT) != S_IFREG || (sb.st_mode & 077) != 0) { result = 1; } close(fd); } } if (result == 0 && !strcmp(name[0], name[1])) result = 1; ${cf_cv_main_return:-return}(result); } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:3963: \"$ac_link\"") >&5 +if { (eval echo "$as_me:4016: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:3966: \$? = $ac_status" >&5 + echo "$as_me:4019: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:3968: \"$ac_try\"") >&5 + { (eval echo "$as_me:4021: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3971: \$? = $ac_status" >&5 + echo "$as_me:4024: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_func_mkstemp=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_cv_func_mkstemp=no fi rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -echo "$as_me:3986: result: $cf_cv_func_mkstemp" >&5 +echo "$as_me:4039: result: $cf_cv_func_mkstemp" >&5 echo "${ECHO_T}$cf_cv_func_mkstemp" >&6 if test "x$cf_cv_func_mkstemp" = xmaybe ; then - echo "$as_me:3989: checking for mkstemp" >&5 + echo "$as_me:4042: checking for mkstemp" >&5 echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6 if test "${ac_cv_func_mkstemp+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 3995 "configure" +#line 4048 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char mkstemp (); below. */ #include /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char mkstemp (); char (*f) (); 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_mkstemp) || defined (__stub___mkstemp) choke me #else f = mkstemp; /* workaround for ICC 12.0.3 */ if (f == 0) return 1; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:4026: \"$ac_link\"") >&5 +if { (eval echo "$as_me:4079: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:4029: \$? = $ac_status" >&5 + echo "$as_me:4082: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:4032: \"$ac_try\"") >&5 + { (eval echo "$as_me:4085: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4035: \$? = $ac_status" >&5 + echo "$as_me:4088: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_mkstemp=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_func_mkstemp=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:4045: result: $ac_cv_func_mkstemp" >&5 +echo "$as_me:4098: result: $ac_cv_func_mkstemp" >&5 echo "${ECHO_T}$ac_cv_func_mkstemp" >&6 fi if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then cat >>confdefs.h <<\EOF #define HAVE_MKSTEMP 1 EOF fi for ac_func in vsnprintf do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:4060: checking for $ac_func" >&5 +echo "$as_me:4113: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 4066 "configure" +#line 4119 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. */ #include /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* 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 (); char (*f) (); 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 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:4097: \"$ac_link\"") >&5 +if { (eval echo "$as_me:4150: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:4100: \$? = $ac_status" >&5 + echo "$as_me:4153: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:4103: \"$ac_try\"") >&5 + { (eval echo "$as_me:4156: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4106: \$? = $ac_status" >&5 + echo "$as_me:4159: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:4116: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "$as_me:4169: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <&5 +echo "$as_me:4179: checking for maximum table size" >&5 echo $ECHO_N "checking for maximum table size... $ECHO_C" >&6 # Check whether --with-max-table-size or --without-max-table-size was given. if test "${with_max_table_size+set}" = set; then withval="$with_max_table_size" fi; if test -n "$with_max_table_size" then - echo "$as_me:4136: result: $with_max_table_size" >&5 + echo "$as_me:4189: result: $with_max_table_size" >&5 echo "${ECHO_T}$with_max_table_size" >&6 check=`expr "$with_max_table_size" + 0` if test "x$check" != "x$with_max_table_size" then - { { echo "$as_me:4141: error: invalid value for --with-max-table-size: $with_max_table_size" >&5 + { { echo "$as_me:4194: error: invalid value for --with-max-table-size: $with_max_table_size" >&5 echo "$as_me: error: invalid value for --with-max-table-size: $with_max_table_size" >&2;} { (exit 1); exit 1; }; } fi cat >>confdefs.h <&5 + echo "$as_me:4204: result: default" >&5 echo "${ECHO_T}default" >&6 fi -echo "$as_me:4155: checking if backtracking extension is wanted" >&5 +echo "$as_me:4208: checking if backtracking extension is wanted" >&5 echo $ECHO_N "checking if backtracking extension is wanted... $ECHO_C" >&6 # Check whether --enable-btyacc or --disable-btyacc was given. if test "${enable_btyacc+set}" = set; then enableval="$enable_btyacc" fi; -echo "$as_me:4163: result: $enable_btyacc" >&5 +echo "$as_me:4216: result: $enable_btyacc" >&5 echo "${ECHO_T}$enable_btyacc" >&6 if test "$enable_btyacc" = "yes"; then cat >>confdefs.h <<\EOF #define YYBTYACC 1 EOF SKELETON=btyaccpar else SKELETON=yaccpar fi if ( test "$GCC" = yes || test "$GXX" = yes ) then -echo "$as_me:4178: checking if you want to check for gcc warnings" >&5 +echo "$as_me:4231: checking if you want to check for gcc warnings" >&5 echo $ECHO_N "checking if you want to check for gcc warnings... $ECHO_C" >&6 # Check whether --with-warnings or --without-warnings was given. if test "${with_warnings+set}" = set; then withval="$with_warnings" cf_opt_with_warnings=$withval else cf_opt_with_warnings=no fi; -echo "$as_me:4188: result: $cf_opt_with_warnings" >&5 +echo "$as_me:4241: result: $cf_opt_with_warnings" >&5 echo "${ECHO_T}$cf_opt_with_warnings" >&6 if test "$cf_opt_with_warnings" != no ; then if test "$GCC" = yes then cat > conftest.i <&5 + { echo "$as_me:4263: checking for $CC __attribute__ directives..." >&5 echo "$as_me: checking for $CC __attribute__ directives..." >&6;} cat > conftest.$ac_ext <&5 case $cf_attribute in (printf) cf_printf_attribute=yes cat >conftest.h <conftest.h <conftest.h <&5 + if { (eval echo "$as_me:4315: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:4265: \$? = $ac_status" >&5 + echo "$as_me:4318: \$? = $ac_status" >&5 (exit $ac_status); }; then - test -n "$verbose" && echo "$as_me:4267: result: ... $cf_attribute" >&5 + test -n "$verbose" && echo "$as_me:4320: result: ... $cf_attribute" >&5 echo "${ECHO_T}... $cf_attribute" >&6 cat conftest.h >>confdefs.h case $cf_attribute in (noreturn) cat >>confdefs.h <>confdefs.h <<\EOF #define GCC_PRINTF 1 EOF fi cat >>confdefs.h <>confdefs.h <<\EOF #define GCC_SCANF 1 EOF fi cat >>confdefs.h <>confdefs.h <>confdefs.h fi rm -rf conftest* fi INTEL_COMPILER=no if test "$GCC" = yes ; then case $host_os in (linux*|gnu*) - echo "$as_me:4331: checking if this is really Intel C compiler" >&5 + echo "$as_me:4384: checking if this is really Intel C compiler" >&5 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6 cf_save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -no-gcc" cat >conftest.$ac_ext <<_ACEOF -#line 4336 "configure" +#line 4389 "configure" #include "confdefs.h" int main () { #ifdef __INTEL_COMPILER #else make an error #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:4353: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:4406: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:4356: \$? = $ac_status" >&5 + echo "$as_me:4409: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:4359: \"$ac_try\"") >&5 + { (eval echo "$as_me:4412: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4362: \$? = $ac_status" >&5 + echo "$as_me:4415: \$? = $ac_status" >&5 (exit $ac_status); }; }; then INTEL_COMPILER=yes cf_save_CFLAGS="$cf_save_CFLAGS -we147" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext CFLAGS="$cf_save_CFLAGS" - echo "$as_me:4373: result: $INTEL_COMPILER" >&5 + echo "$as_me:4426: result: $INTEL_COMPILER" >&5 echo "${ECHO_T}$INTEL_COMPILER" >&6 ;; esac fi CLANG_COMPILER=no if test "$GCC" = yes ; then - echo "$as_me:4382: checking if this is really Clang C compiler" >&5 + echo "$as_me:4435: checking if this is really Clang C compiler" >&5 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6 cf_save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Qunused-arguments" cat >conftest.$ac_ext <<_ACEOF -#line 4387 "configure" +#line 4440 "configure" #include "confdefs.h" int main () { #ifdef __clang__ #else make an error #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:4404: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:4457: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:4407: \$? = $ac_status" >&5 + echo "$as_me:4460: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:4410: \"$ac_try\"") >&5 + { (eval echo "$as_me:4463: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4413: \$? = $ac_status" >&5 + echo "$as_me:4466: \$? = $ac_status" >&5 (exit $ac_status); }; }; then CLANG_COMPILER=yes cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext CFLAGS="$cf_save_CFLAGS" - echo "$as_me:4424: result: $CLANG_COMPILER" >&5 + echo "$as_me:4477: result: $CLANG_COMPILER" >&5 echo "${ECHO_T}$CLANG_COMPILER" >&6 fi cat > conftest.$ac_ext <&5 + { echo "$as_me:4499: checking for $CC warning options..." >&5 echo "$as_me: checking for $CC warning options..." >&6;} cf_save_CFLAGS="$CFLAGS" EXTRA_CFLAGS="-Wall" for cf_opt in \ wd1419 \ wd1683 \ wd1684 \ wd193 \ wd593 \ wd279 \ wd810 \ wd869 \ wd981 do CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt" - if { (eval echo "$as_me:4462: \"$ac_compile\"") >&5 + if { (eval echo "$as_me:4515: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:4465: \$? = $ac_status" >&5 + echo "$as_me:4518: \$? = $ac_status" >&5 (exit $ac_status); }; then - test -n "$verbose" && echo "$as_me:4467: result: ... -$cf_opt" >&5 + test -n "$verbose" && echo "$as_me:4520: result: ... -$cf_opt" >&5 echo "${ECHO_T}... -$cf_opt" >&6 EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt" fi done CFLAGS="$cf_save_CFLAGS" elif test "$GCC" = yes then - { echo "$as_me:4476: checking for $CC warning options..." >&5 + { echo "$as_me:4529: checking for $CC warning options..." >&5 echo "$as_me: checking for $CC warning options..." >&6;} cf_save_CFLAGS="$CFLAGS" EXTRA_CFLAGS= cf_warn_CONST="" test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings" cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs" test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings= for cf_opt in W Wall \ Wbad-function-cast \ Wcast-align \ Wcast-qual \ Wdeclaration-after-statement \ Wextra \ Winline \ Wmissing-declarations \ Wmissing-prototypes \ Wnested-externs \ Wpointer-arith \ Wshadow \ Wstrict-prototypes \ Wundef $cf_gcc_warnings $cf_warn_CONST Wwrite-strings do CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt" - if { (eval echo "$as_me:4500: \"$ac_compile\"") >&5 + if { (eval echo "$as_me:4553: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:4503: \$? = $ac_status" >&5 + echo "$as_me:4556: \$? = $ac_status" >&5 (exit $ac_status); }; then - test -n "$verbose" && echo "$as_me:4505: result: ... -$cf_opt" >&5 + test -n "$verbose" && echo "$as_me:4558: result: ... -$cf_opt" >&5 echo "${ECHO_T}... -$cf_opt" >&6 case $cf_opt in (Wcast-qual) CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES" ;; (Winline) case $GCC_VERSION in ([34].*) test -n "$verbose" && echo " feature is broken in gcc $GCC_VERSION" 1>&6 -echo "${as_me:-configure}:4516: testing feature is broken in gcc $GCC_VERSION ..." 1>&5 +echo "${as_me:-configure}:4569: testing feature is broken in gcc $GCC_VERSION ..." 1>&5 continue;; esac ;; (Wpointer-arith) case $GCC_VERSION in ([12].*) test -n "$verbose" && echo " feature is broken in gcc $GCC_VERSION" 1>&6 -echo "${as_me:-configure}:4526: testing feature is broken in gcc $GCC_VERSION ..." 1>&5 +echo "${as_me:-configure}:4579: testing feature is broken in gcc $GCC_VERSION ..." 1>&5 continue;; esac ;; esac EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt" fi done CFLAGS="$cf_save_CFLAGS" fi rm -rf conftest* fi fi -echo "$as_me:4542: checking if you want to see long compiling messages" >&5 +echo "$as_me:4595: checking if you want to see long compiling messages" >&5 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6 # Check whether --enable-echo or --disable-echo was given. if test "${enable_echo+set}" = set; then enableval="$enable_echo" test "$enableval" != no && enableval=yes if test "$enableval" != "yes" ; then ECHO_LT='--silent' ECHO_LD='@echo linking $@;' RULE_CC='@echo compiling $<' SHOW_CC='@echo compiling $@' ECHO_CC='@' else ECHO_LT='' ECHO_LD='' RULE_CC='' SHOW_CC='' ECHO_CC='' fi else enableval=yes ECHO_LT='' ECHO_LD='' RULE_CC='' SHOW_CC='' ECHO_CC='' fi; -echo "$as_me:4576: result: $enableval" >&5 +echo "$as_me:4629: result: $enableval" >&5 echo "${ECHO_T}$enableval" >&6 -echo "$as_me:4579: checking if you want to use dmalloc for testing" >&5 +echo "$as_me:4632: checking if you want to use dmalloc for testing" >&5 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6 # Check whether --with-dmalloc or --without-dmalloc was given. if test "${with_dmalloc+set}" = set; then withval="$with_dmalloc" cat >>confdefs.h <&5 +echo "$as_me:4649: result: ${with_dmalloc:-no}" >&5 echo "${ECHO_T}${with_dmalloc:-no}" >&6 case .$with_cflags in (.*-g*) case .$CFLAGS in (.*-g*) ;; (*) cf_fix_cppflags=no cf_new_cflags= cf_new_cppflags= cf_new_extra_cppflags= for cf_add_cflags in -g do case $cf_fix_cppflags in (no) case $cf_add_cflags in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) case $cf_add_cflags in (-D*) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" continue elif test "${cf_tst_cflags}" = "\"'" ; then cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" continue fi ;; esac case "$CPPFLAGS" in (*$cf_add_cflags) ;; (*) case $cf_add_cflags in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` CPPFLAGS=`echo "$CPPFLAGS" | \ sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'` ;; esac cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" ;; esac ;; (*) cf_new_cflags="$cf_new_cflags $cf_add_cflags" ;; esac ;; (yes) cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=no ;; esac done if test -n "$cf_new_cflags" ; then CFLAGS="$CFLAGS $cf_new_cflags" fi if test -n "$cf_new_cppflags" ; then CPPFLAGS="$CPPFLAGS $cf_new_cppflags" fi if test -n "$cf_new_extra_cppflags" ; then EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" fi ;; esac ;; esac if test "$with_dmalloc" = yes ; then - echo "$as_me:4690: checking for dmalloc.h" >&5 + echo "$as_me:4743: checking for dmalloc.h" >&5 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6 if test "${ac_cv_header_dmalloc_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 4696 "configure" +#line 4749 "configure" #include "confdefs.h" #include _ACEOF -if { (eval echo "$as_me:4700: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:4753: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:4706: \$? = $ac_status" >&5 + echo "$as_me:4759: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_cv_header_dmalloc_h=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_header_dmalloc_h=no fi rm -f conftest.err conftest.$ac_ext fi -echo "$as_me:4725: result: $ac_cv_header_dmalloc_h" >&5 +echo "$as_me:4778: result: $ac_cv_header_dmalloc_h" >&5 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6 if test $ac_cv_header_dmalloc_h = yes; then -echo "$as_me:4729: checking for dmalloc_debug in -ldmalloc" >&5 +echo "$as_me:4782: checking for dmalloc_debug in -ldmalloc" >&5 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldmalloc $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 4737 "configure" +#line 4790 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dmalloc_debug (); int main () { dmalloc_debug (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:4756: \"$ac_link\"") >&5 +if { (eval echo "$as_me:4809: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:4759: \$? = $ac_status" >&5 + echo "$as_me:4812: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:4762: \"$ac_try\"") >&5 + { (eval echo "$as_me:4815: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4765: \$? = $ac_status" >&5 + echo "$as_me:4818: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dmalloc_dmalloc_debug=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_dmalloc_dmalloc_debug=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:4776: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5 +echo "$as_me:4829: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6 if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then cat >>confdefs.h <&5 +echo "$as_me:4844: checking if you want to use dbmalloc for testing" >&5 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6 # Check whether --with-dbmalloc or --without-dbmalloc was given. if test "${with_dbmalloc+set}" = set; then withval="$with_dbmalloc" cat >>confdefs.h <&5 +echo "$as_me:4861: result: ${with_dbmalloc:-no}" >&5 echo "${ECHO_T}${with_dbmalloc:-no}" >&6 case .$with_cflags in (.*-g*) case .$CFLAGS in (.*-g*) ;; (*) cf_fix_cppflags=no cf_new_cflags= cf_new_cppflags= cf_new_extra_cppflags= for cf_add_cflags in -g do case $cf_fix_cppflags in (no) case $cf_add_cflags in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) case $cf_add_cflags in (-D*) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" continue elif test "${cf_tst_cflags}" = "\"'" ; then cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" continue fi ;; esac case "$CPPFLAGS" in (*$cf_add_cflags) ;; (*) case $cf_add_cflags in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` CPPFLAGS=`echo "$CPPFLAGS" | \ sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'` ;; esac cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" ;; esac ;; (*) cf_new_cflags="$cf_new_cflags $cf_add_cflags" ;; esac ;; (yes) cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=no ;; esac done if test -n "$cf_new_cflags" ; then CFLAGS="$CFLAGS $cf_new_cflags" fi if test -n "$cf_new_cppflags" ; then CPPFLAGS="$CPPFLAGS $cf_new_cppflags" fi if test -n "$cf_new_extra_cppflags" ; then EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" fi ;; esac ;; esac if test "$with_dbmalloc" = yes ; then - echo "$as_me:4902: checking for dbmalloc.h" >&5 + echo "$as_me:4955: checking for dbmalloc.h" >&5 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6 if test "${ac_cv_header_dbmalloc_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 4908 "configure" +#line 4961 "configure" #include "confdefs.h" #include _ACEOF -if { (eval echo "$as_me:4912: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:4965: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:4918: \$? = $ac_status" >&5 + echo "$as_me:4971: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_cv_header_dbmalloc_h=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_header_dbmalloc_h=no fi rm -f conftest.err conftest.$ac_ext fi -echo "$as_me:4937: result: $ac_cv_header_dbmalloc_h" >&5 +echo "$as_me:4990: result: $ac_cv_header_dbmalloc_h" >&5 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6 if test $ac_cv_header_dbmalloc_h = yes; then -echo "$as_me:4941: checking for debug_malloc in -ldbmalloc" >&5 +echo "$as_me:4994: checking for debug_malloc in -ldbmalloc" >&5 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldbmalloc $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 4949 "configure" +#line 5002 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char debug_malloc (); int main () { debug_malloc (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:4968: \"$ac_link\"") >&5 +if { (eval echo "$as_me:5021: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:4971: \$? = $ac_status" >&5 + echo "$as_me:5024: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:4974: \"$ac_try\"") >&5 + { (eval echo "$as_me:5027: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4977: \$? = $ac_status" >&5 + echo "$as_me:5030: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dbmalloc_debug_malloc=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_dbmalloc_debug_malloc=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:4988: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5 +echo "$as_me:5041: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6 if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then cat >>confdefs.h <&5 +echo "$as_me:5056: checking if you want to use valgrind for testing" >&5 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6 # Check whether --with-valgrind or --without-valgrind was given. if test "${with_valgrind+set}" = set; then withval="$with_valgrind" cat >>confdefs.h <&5 +echo "$as_me:5073: result: ${with_valgrind:-no}" >&5 echo "${ECHO_T}${with_valgrind:-no}" >&6 case .$with_cflags in (.*-g*) case .$CFLAGS in (.*-g*) ;; (*) cf_fix_cppflags=no cf_new_cflags= cf_new_cppflags= cf_new_extra_cppflags= for cf_add_cflags in -g do case $cf_fix_cppflags in (no) case $cf_add_cflags in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) case $cf_add_cflags in (-D*) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" continue elif test "${cf_tst_cflags}" = "\"'" ; then cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" continue fi ;; esac case "$CPPFLAGS" in (*$cf_add_cflags) ;; (*) case $cf_add_cflags in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` CPPFLAGS=`echo "$CPPFLAGS" | \ sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'` ;; esac cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" ;; esac ;; (*) cf_new_cflags="$cf_new_cflags $cf_add_cflags" ;; esac ;; (yes) cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=no ;; esac done if test -n "$cf_new_cflags" ; then CFLAGS="$CFLAGS $cf_new_cflags" fi if test -n "$cf_new_cppflags" ; then CPPFLAGS="$CPPFLAGS $cf_new_cppflags" fi if test -n "$cf_new_extra_cppflags" ; then EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" fi ;; esac ;; esac -echo "$as_me:5113: checking if you want to perform memory-leak testing" >&5 +echo "$as_me:5166: checking if you want to perform memory-leak testing" >&5 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6 # Check whether --enable-leaks or --disable-leaks was given. if test "${enable_leaks+set}" = set; then enableval="$enable_leaks" if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi else : ${with_no_leaks:=no} fi; -echo "$as_me:5123: result: $with_no_leaks" >&5 +echo "$as_me:5176: result: $with_no_leaks" >&5 echo "${ECHO_T}$with_no_leaks" >&6 if test "$with_no_leaks" = yes ; then cat >>confdefs.h <<\EOF #define NO_LEAKS 1 EOF cat >>confdefs.h <<\EOF #define YY_NO_LEAKS 1 EOF fi # Extract the first word of "groff", so it can be a program name with args. set dummy groff; ac_word=$2 -echo "$as_me:5140: checking for $ac_word" >&5 +echo "$as_me:5193: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_GROFF_PATH+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $GROFF_PATH in [\\/]* | ?:[\\/]*) ac_cv_path_GROFF_PATH="$GROFF_PATH" # Let the user override the test with a path. ;; *) ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. if $as_executable_p "$ac_dir/$ac_word"; then ac_cv_path_GROFF_PATH="$ac_dir/$ac_word" - echo "$as_me:5157: found $ac_dir/$ac_word" >&5 + echo "$as_me:5210: found $ac_dir/$ac_word" >&5 break fi done test -z "$ac_cv_path_GROFF_PATH" && ac_cv_path_GROFF_PATH="no" ;; esac fi GROFF_PATH=$ac_cv_path_GROFF_PATH if test -n "$GROFF_PATH"; then - echo "$as_me:5169: result: $GROFF_PATH" >&5 + echo "$as_me:5222: result: $GROFF_PATH" >&5 echo "${ECHO_T}$GROFF_PATH" >&6 else - echo "$as_me:5172: result: no" >&5 + echo "$as_me:5225: result: no" >&5 echo "${ECHO_T}no" >&6 fi # Extract the first word of "nroff", so it can be a program name with args. set dummy nroff; ac_word=$2 -echo "$as_me:5178: checking for $ac_word" >&5 +echo "$as_me:5231: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_NROFF_PATH+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $NROFF_PATH in [\\/]* | ?:[\\/]*) ac_cv_path_NROFF_PATH="$NROFF_PATH" # Let the user override the test with a path. ;; *) ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. if $as_executable_p "$ac_dir/$ac_word"; then ac_cv_path_NROFF_PATH="$ac_dir/$ac_word" - echo "$as_me:5195: found $ac_dir/$ac_word" >&5 + echo "$as_me:5248: found $ac_dir/$ac_word" >&5 break fi done test -z "$ac_cv_path_NROFF_PATH" && ac_cv_path_NROFF_PATH="no" ;; esac fi NROFF_PATH=$ac_cv_path_NROFF_PATH if test -n "$NROFF_PATH"; then - echo "$as_me:5207: result: $NROFF_PATH" >&5 + echo "$as_me:5260: result: $NROFF_PATH" >&5 echo "${ECHO_T}$NROFF_PATH" >&6 else - echo "$as_me:5210: result: no" >&5 + echo "$as_me:5263: result: no" >&5 echo "${ECHO_T}no" >&6 fi if test "x$GROFF_PATH" = xno then NROFF_NOTE= GROFF_NOTE="#" else NROFF_NOTE="#" GROFF_NOTE= fi -echo "$as_me:5223: checking for program to convert manpage to html" >&5 +echo "$as_me:5276: checking for program to convert manpage to html" >&5 echo $ECHO_N "checking for program to convert manpage to html... $ECHO_C" >&6 # Check whether --with-man2html or --without-man2html was given. if test "${with_man2html+set}" = set; then withval="$with_man2html" cf_man2html=$withval else cf_man2html=$GROFF_PATH fi; cf_with_groff=no case $cf_man2html in (yes) - echo "$as_me:5238: result: man2html" >&5 + echo "$as_me:5291: result: man2html" >&5 echo "${ECHO_T}man2html" >&6 # Extract the first word of "man2html", so it can be a program name with args. set dummy man2html; ac_word=$2 -echo "$as_me:5242: checking for $ac_word" >&5 +echo "$as_me:5295: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_cf_man2html+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $cf_man2html in [\\/]* | ?:[\\/]*) ac_cv_path_cf_man2html="$cf_man2html" # Let the user override the test with a path. ;; *) ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. if $as_executable_p "$ac_dir/$ac_word"; then ac_cv_path_cf_man2html="$ac_dir/$ac_word" - echo "$as_me:5259: found $ac_dir/$ac_word" >&5 + echo "$as_me:5312: found $ac_dir/$ac_word" >&5 break fi done test -z "$ac_cv_path_cf_man2html" && ac_cv_path_cf_man2html="no" ;; esac fi cf_man2html=$ac_cv_path_cf_man2html if test -n "$cf_man2html"; then - echo "$as_me:5271: result: $cf_man2html" >&5 + echo "$as_me:5324: result: $cf_man2html" >&5 echo "${ECHO_T}$cf_man2html" >&6 else - echo "$as_me:5274: result: no" >&5 + echo "$as_me:5327: result: no" >&5 echo "${ECHO_T}no" >&6 fi ;; (no|groff|*/groff*) cf_with_groff=yes cf_man2html=$GROFF_PATH - echo "$as_me:5282: result: $cf_man2html" >&5 + echo "$as_me:5335: result: $cf_man2html" >&5 echo "${ECHO_T}$cf_man2html" >&6 ;; (*) - echo "$as_me:5286: result: $cf_man2html" >&5 + echo "$as_me:5339: result: $cf_man2html" >&5 echo "${ECHO_T}$cf_man2html" >&6 ;; esac MAN2HTML_TEMP="man2html.tmp" cat >$MAN2HTML_TEMP <>$MAN2HTML_TEMP <&5 + { { echo "$as_me:5403: error: expected a pathname, not \"$cf_man2html\"" >&5 echo "$as_me: error: expected a pathname, not \"$cf_man2html\"" >&2;} { (exit 1); exit 1; }; } ;; esac MAN2HTML_PATH="$cf_man2html" - echo "$as_me:5357: checking for $cf_man2html top/bottom margins" >&5 + echo "$as_me:5410: checking for $cf_man2html top/bottom margins" >&5 echo $ECHO_N "checking for $cf_man2html top/bottom margins... $ECHO_C" >&6 # for this example, expect 3 lines of content, the remainder is head/foot cat >conftest.in <conftest.out cf_man2html_1st=`fgrep -n MARKER conftest.out |sed -e 's/^[^0-9]*://' -e 's/:.*//'` cf_man2html_top=`expr $cf_man2html_1st - 2` cf_man2html_bot=`wc -l conftest.out |sed -e 's/[^0-9]//g'` cf_man2html_bot=`expr $cf_man2html_bot - 2 - $cf_man2html_top` cf_man2html_top_bot="-topm=$cf_man2html_top -botm=$cf_man2html_bot" - echo "$as_me:5375: result: $cf_man2html_top_bot" >&5 + echo "$as_me:5428: result: $cf_man2html_top_bot" >&5 echo "${ECHO_T}$cf_man2html_top_bot" >&6 - echo "$as_me:5378: checking for pagesize to use" >&5 + echo "$as_me:5431: checking for pagesize to use" >&5 echo $ECHO_N "checking for pagesize to use... $ECHO_C" >&6 for cf_block in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 do cat >>conftest.in <conftest.out cf_man2html_page=`fgrep -n HEAD1 conftest.out |tail -n 1 |sed -e 's/^[^0-9]*://' -e 's/:.*//'` test -z "$cf_man2html_page" && cf_man2html_page=99999 test "$cf_man2html_page" -gt 100 && cf_man2html_page=99999 rm -rf conftest* - echo "$as_me:5403: result: $cf_man2html_page" >&5 + echo "$as_me:5456: result: $cf_man2html_page" >&5 echo "${ECHO_T}$cf_man2html_page" >&6 cat >>$MAN2HTML_TEMP <&5 +echo "$as_me:5475: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 5428 "configure" +#line 5481 "configure" #include "confdefs.h" #include #include #include #include _ACEOF -if { (eval echo "$as_me:5436: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:5489: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:5442: \$? = $ac_status" >&5 + echo "$as_me:5495: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f conftest.err conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF -#line 5464 "configure" +#line 5517 "configure" #include "confdefs.h" #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -rf 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 <<_ACEOF -#line 5482 "configure" +#line 5535 "configure" #include "confdefs.h" #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -rf 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 <<_ACEOF -#line 5503 "configure" +#line 5556 "configure" #include "confdefs.h" #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #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)) $ac_main_return(2); $ac_main_return (0); } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:5529: \"$ac_link\"") >&5 +if { (eval echo "$as_me:5582: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:5532: \$? = $ac_status" >&5 + echo "$as_me:5585: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:5534: \"$ac_try\"") >&5 + { (eval echo "$as_me:5587: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:5537: \$? = $ac_status" >&5 + echo "$as_me:5590: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi -echo "$as_me:5550: result: $ac_cv_header_stdc" >&5 +echo "$as_me:5603: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\EOF #define STDC_HEADERS 1 EOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:5566: checking for $ac_header" >&5 +echo "$as_me:5619: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 5572 "configure" +#line 5625 "configure" #include "confdefs.h" $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:5578: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:5631: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:5581: \$? = $ac_status" >&5 + echo "$as_me:5634: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:5584: \"$ac_try\"") >&5 + { (eval echo "$as_me:5637: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:5587: \$? = $ac_status" >&5 + echo "$as_me:5640: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:5597: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "$as_me:5650: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <&5 +echo "$as_me:5660: checking for mode_t" >&5 echo $ECHO_N "checking for mode_t... $ECHO_C" >&6 if test "${ac_cv_type_mode_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 5613 "configure" +#line 5666 "configure" #include "confdefs.h" $ac_includes_default int main () { if ((mode_t *) 0) return 0; if (sizeof (mode_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:5628: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:5681: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:5631: \$? = $ac_status" >&5 + echo "$as_me:5684: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:5634: \"$ac_try\"") >&5 + { (eval echo "$as_me:5687: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:5637: \$? = $ac_status" >&5 + echo "$as_me:5690: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_mode_t=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_type_mode_t=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:5647: result: $ac_cv_type_mode_t" >&5 +echo "$as_me:5700: result: $ac_cv_type_mode_t" >&5 echo "${ECHO_T}$ac_cv_type_mode_t" >&6 if test $ac_cv_type_mode_t = yes; then : else cat >>confdefs.h <confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overriden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # 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 | 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 \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | sed ' t clear : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache if cmp -s $cache_file confcache; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; s/^[^=]*=[ ]*$//; }' fi DEFS=-DHAVE_CONFIG_H : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ echo "$as_me:5740: creating $CONFIG_STATUS" >&5 +{ echo "$as_me:5793: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated automatically by configure. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false SHELL=\${CONFIG_SHELL-$SHELL} ac_cs_invocation="\$0 \$@" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi # Name of the executable. as_me=`echo "$0" |sed 's,.*[\\/],,'` if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file as_executable_p="test -f" # Support unset when possible. if (FOO=FOO; unset FOO) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # NLS nuisances. $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; } $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; } $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; } $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; } $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; } $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; } $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; } $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; } # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; } exec 6>&1 _ACEOF # Files that config.status was made for. if test -n "$ac_config_files"; then echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS fi if test -n "$ac_config_headers"; then echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS fi if test -n "$ac_config_links"; then echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS fi if test -n "$ac_config_commands"; then echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS fi cat >>$CONFIG_STATUS <<\EOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number, then exit -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Report bugs to ." EOF cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "x$1" : 'x\([^=]*\)='` ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` shift set dummy "$ac_option" "$ac_optarg" ${1+"$@"} shift ;; -*);; *) # This is not an option, so the user has probably given explicit # arguments. ac_need_defaults=false;; esac case $1 in # Handling of the options. EOF cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header - { { echo "$as_me:5913: error: ambiguous option: $1 + { { echo "$as_me:5966: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) shift CONFIG_FILES="$CONFIG_FILES $1" ac_need_defaults=false;; --header | --heade | --head | --hea ) shift CONFIG_HEADERS="$CONFIG_HEADERS $1" ac_need_defaults=false;; # This is an error. - -*) { { echo "$as_me:5932: error: unrecognized option: $1 + -*) { { echo "$as_me:5985: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ;; esac shift done exec 5>>config.log cat >&5 << _ACEOF ## ----------------------- ## ## Running config.status. ## ## ----------------------- ## This file was extended by $as_me 2.52.20150926, executed with CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS > $ac_cs_invocation on `(hostname || uname -n) 2>/dev/null | sed 1q` _ACEOF EOF cat >>$CONFIG_STATUS <<\EOF for ac_config_target in $ac_config_targets do case "$ac_config_target" in # Handling of arguments. "makefile" ) CONFIG_FILES="$CONFIG_FILES makefile" ;; "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h:config_h.in" ;; - *) { { echo "$as_me:5969: error: invalid argument: $ac_config_target" >&5 + *) { { echo "$as_me:6022: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers fi # Create a temporary directory, and hook for its removal unless debugging. $debug || { trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. : ${TMPDIR=/tmp} { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=$TMPDIR/cs$$-$RANDOM (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 { (exit 1); exit 1; } } EOF cat >>$CONFIG_STATUS <\$tmp/subs.sed <<\\CEOF s,@SHELL@,$SHELL,;t t s,@exec_prefix@,$exec_prefix,;t t s,@prefix@,$prefix,;t t s,@program_transform_name@,$program_transform_name,;t t s,@bindir@,$bindir,;t t s,@sbindir@,$sbindir,;t t s,@libexecdir@,$libexecdir,;t t s,@datarootdir@,$datarootdir,;t t s,@datadir@,$datadir,;t t s,@sysconfdir@,$sysconfdir,;t t s,@sharedstatedir@,$sharedstatedir,;t t s,@localstatedir@,$localstatedir,;t t s,@libdir@,$libdir,;t t s,@includedir@,$includedir,;t t s,@oldincludedir@,$oldincludedir,;t t s,@infodir@,$infodir,;t t s,@mandir@,$mandir,;t t s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t s,@build_alias@,$build_alias,;t t s,@host_alias@,$host_alias,;t t s,@target_alias@,$target_alias,;t t s,@ECHO_C@,$ECHO_C,;t t s,@ECHO_N@,$ECHO_N,;t t s,@ECHO_T@,$ECHO_T,;t t s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t s,@DEFS@,$DEFS,;t t s,@LIBS@,$LIBS,;t t s,@build@,$build,;t t s,@build_cpu@,$build_cpu,;t t s,@build_vendor@,$build_vendor,;t t s,@build_os@,$build_os,;t t s,@host@,$host,;t t s,@host_cpu@,$host_cpu,;t t s,@host_vendor@,$host_vendor,;t t s,@host_os@,$host_os,;t t s,@target@,$target,;t t s,@target_cpu@,$target_cpu,;t t s,@target_vendor@,$target_vendor,;t t s,@target_os@,$target_os,;t t s,@CC@,$CC,;t t s,@CFLAGS@,$CFLAGS,;t t s,@LDFLAGS@,$LDFLAGS,;t t s,@CPPFLAGS@,$CPPFLAGS,;t t s,@ac_ct_CC@,$ac_ct_CC,;t t s,@EXEEXT@,$EXEEXT,;t t s,@OBJEXT@,$OBJEXT,;t t s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t s,@SET_MAKE@,$SET_MAKE,;t t s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t s,@INSTALL_DATA@,$INSTALL_DATA,;t t s,@CTAGS@,$CTAGS,;t t s,@ETAGS@,$ETAGS,;t t s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t s,@AWK@,$AWK,;t t s,@LINT@,$LINT,;t t s,@LINT_OPTS@,$LINT_OPTS,;t t s,@CPP@,$CPP,;t t s,@SKELETON@,$SKELETON,;t t s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t s,@ECHO_LT@,$ECHO_LT,;t t s,@ECHO_LD@,$ECHO_LD,;t t s,@RULE_CC@,$RULE_CC,;t t s,@SHOW_CC@,$SHOW_CC,;t t s,@ECHO_CC@,$ECHO_CC,;t t s,@GROFF_PATH@,$GROFF_PATH,;t t s,@NROFF_PATH@,$NROFF_PATH,;t t s,@GROFF_NOTE@,$GROFF_NOTE,;t t s,@NROFF_NOTE@,$NROFF_NOTE,;t t s,@cf_man2html@,$cf_man2html,;t t s,@MAN2HTML_NOTE@,$MAN2HTML_NOTE,;t t s,@MAN2HTML_PATH@,$MAN2HTML_PATH,;t t s,@MAN2HTML_TEMP@,$MAN2HTML_TEMP,;t t 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_lines=48 ac_sed_frag=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_lines # 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" $tmp/subs.sed >$tmp/subs.frag else sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag fi if test ! -s $tmp/subs.frag; then ac_more_lines=false else # The purpose of the label and of the branching condition is to # speed up the sed processing (if there are no `@' at all, there # is no need to browse any of the substitutions). # These are the two extra sed commands mentioned above. (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed # It is possible to make a multiline substitution using escaped newlines. # Ensure that we do not split the substitution between script fragments. ac_BEG=$ac_end ac_END=`expr $ac_end + $ac_max_sed_lines` sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next if test -s $tmp/subs.next; then grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit if test ! -s $tmp/subs.edit; then grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit if test ! -s $tmp/subs.edit; then if test $ac_beg -gt 1; then ac_end=`expr $ac_end - 1` continue fi fi fi fi if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_lines` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi fi # test -n "$CONFIG_FILES" EOF cat >>$CONFIG_STATUS <<\EOF for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`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 # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then { case "$ac_dir" in [\\/]* | ?:[\\/]* ) as_incr_dir=;; *) as_incr_dir=.;; esac as_dummy="$ac_dir" for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do case $as_mkdir_dir in # Skip DOS drivespec ?:) as_incr_dir=$as_mkdir_dir ;; *) as_incr_dir=$as_incr_dir/$as_mkdir_dir test -d "$as_incr_dir" || mkdir "$as_incr_dir" ;; esac done; } ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`" # A "../" for each directory in $ac_dir_suffix. ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'` else ac_dir_suffix= ac_dots= fi case $srcdir in .) ac_srcdir=. if test -z "$ac_dots"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_dots$srcdir$ac_dir_suffix ac_top_srcdir=$ac_dots$srcdir ;; esac case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_dots$INSTALL ;; esac if test x"$ac_file" != x-; then - { echo "$as_me:6230: creating $ac_file" >&5 + { echo "$as_me:6283: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated automatically by config.status. */ configure_input="Generated automatically from `echo $ac_file_in | sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:6248: error: cannot find input file: $f" >&5 + test -f "$f" || { { echo "$as_me:6301: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo $f;; *) # Relative if test -f "$f"; then # Build tree echo $f elif test -f "$srcdir/$f"; then # Source tree echo $srcdir/$f else # /dev/null tree - { { echo "$as_me:6261: error: cannot find input file: $f" >&5 + { { echo "$as_me:6314: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } EOF cat >>$CONFIG_STATUS <<\EOF ac_warn_datarootdir=no if test x"$ac_file" != x-; then for ac_item in $ac_file_inputs do ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item` if test -n "$ac_seen"; then ac_used=`grep '@datarootdir@' $ac_item` if test -z "$ac_used"; then - { echo "$as_me:6277: WARNING: datarootdir was used implicitly but not set: + { echo "$as_me:6330: WARNING: datarootdir was used implicitly but not set: $ac_seen" >&5 echo "$as_me: WARNING: datarootdir was used implicitly but not set: $ac_seen" >&2;} ac_warn_datarootdir=yes fi fi ac_seen=`grep '${datarootdir}' $ac_item` if test -n "$ac_seen"; then - { echo "$as_me:6286: WARNING: datarootdir was used explicitly but not set: + { echo "$as_me:6339: WARNING: datarootdir was used explicitly but not set: $ac_seen" >&5 echo "$as_me: WARNING: datarootdir was used explicitly but not set: $ac_seen" >&2;} ac_warn_datarootdir=yes fi done fi if test "x$ac_warn_datarootdir" = xyes; then ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'" fi EOF cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s,@configure_input@,$configure_input,;t t s,@srcdir@,$ac_srcdir,;t t s,@top_srcdir@,$ac_top_srcdir,;t t s,@INSTALL@,$ac_INSTALL,;t t " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out rm -f $tmp/stdin if test x"$ac_file" != x-; then cp $tmp/out $ac_file for ac_name in prefix exec_prefix datarootdir do ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file` if test -n "$ac_seen"; then ac_init=`egrep '[ ]*'$ac_name'[ ]*=' $ac_file` if test -z "$ac_init"; then ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'` - { echo "$as_me:6323: WARNING: Variable $ac_name is used but was not set: + { echo "$as_me:6376: WARNING: Variable $ac_name is used but was not set: $ac_seen" >&5 echo "$as_me: WARNING: Variable $ac_name is used but was not set: $ac_seen" >&2;} fi fi done egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out if test -s $tmp/out; then ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out` - { echo "$as_me:6334: WARNING: Some variables may not be substituted: + { echo "$as_me:6387: WARNING: Some variables may not be substituted: $ac_seen" >&5 echo "$as_me: WARNING: Some variables may not be substituted: $ac_seen" >&2;} fi else cat $tmp/out fi rm -f $tmp/out done EOF cat >>$CONFIG_STATUS <<\EOF # # CONFIG_HEADER section. # # 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=' ' ac_dD=',;t' # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE". ac_iA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_iB='\([ ]\),\1#\2define\3' ac_iC=' ' ac_iD='\4,;t' # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_uB='$,\1#\2define\3' ac_uC=' ' ac_uD=',;t' for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`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 - test x"$ac_file" != x- && { echo "$as_me:6383: creating $ac_file" >&5 + test x"$ac_file" != x- && { echo "$as_me:6436: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:6394: error: cannot find input file: $f" >&5 + test -f "$f" || { { echo "$as_me:6447: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo $f;; *) # Relative if test -f "$f"; then # Build tree echo $f elif test -f "$srcdir/$f"; then # Source tree echo $srcdir/$f else # /dev/null tree - { { echo "$as_me:6407: error: cannot find input file: $f" >&5 + { { echo "$as_me:6460: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } # Remove the trailing spaces. sed 's/[ ]*$//' $ac_file_inputs >$tmp/in EOF # Transform confdefs.h into two sed scripts, `conftest.defines' and # `conftest.undefs', that substitutes the proper values into # config.h.in to produce config.h. The first handles `#define' # templates, and the second `#undef' templates. # 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.defines conftest.undefs # Using a here document instead of a string reduces the quoting nightmare. # Putting comments in sed scripts is not portable. # # `end' is used to avoid that the second main sed command (meant for # 0-ary CPP macros) applies to n-ary macro definitions. # See the Autoconf documentation for `clear'. cat >confdef2sed.sed <<\EOF s/[\\&,]/\\&/g s,[\\$`],\\&,g t clear : clear s,^[ ]*#[ ]*define[ ][ ]*\(\([^ (][^ (]*\)([^)]*)\)[ ]*\(.*\)$,${ac_dA}\2${ac_dB}\1${ac_dC}\3${ac_dD},gp t end s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp : end EOF # If some macros were called several times there might be several times # the same #defines, which is useless. Nevertheless, we may not want to # sort them, since we want the *last* AC-DEFINE to be honored. uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs sed 's/ac_d/ac_i/g' conftest.defines >>conftest.undefs rm -f confdef2sed.sed # 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.undefs <<\EOF s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, EOF # Break up conftest.defines because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS echo ' if egrep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS echo ' :' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.defines >/dev/null do # Write a limited-size here document to $tmp/defines.sed. echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS # Speed up: don't consider the non `#define' lines. echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/defines.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines echo ' fi # egrep' >>$CONFIG_STATUS echo >>$CONFIG_STATUS # Break up conftest.undefs because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #undef templates' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.undefs >/dev/null do # Write a limited-size here document to $tmp/undefs.sed. echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS # Speed up: don't consider the non `#undef' echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/undefs.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail rm -f conftest.undefs mv conftest.tail conftest.undefs done rm -f conftest.undefs cat >>$CONFIG_STATUS <<\EOF # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated automatically by config.status. */ if test x"$ac_file" = x-; then echo "/* Generated automatically by configure. */" >$tmp/config.h else echo "/* $ac_file. Generated automatically by configure. */" >$tmp/config.h fi cat $tmp/in >>$tmp/config.h rm -f $tmp/in if test x"$ac_file" != x-; then if cmp -s $ac_file $tmp/config.h 2>/dev/null; then - { echo "$as_me:6525: $ac_file is unchanged" >&5 + { echo "$as_me:6578: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then { case "$ac_dir" in [\\/]* | ?:[\\/]* ) as_incr_dir=;; *) as_incr_dir=.;; esac as_dummy="$ac_dir" for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do case $as_mkdir_dir in # Skip DOS drivespec ?:) as_incr_dir=$as_mkdir_dir ;; *) as_incr_dir=$as_incr_dir/$as_mkdir_dir test -d "$as_incr_dir" || mkdir "$as_incr_dir" ;; esac done; } fi rm -f $ac_file mv $tmp/config.h $ac_file fi else cat $tmp/config.h rm -f $tmp/config.h fi done EOF cat >>$CONFIG_STATUS <<\EOF { (exit 0); exit 0; } EOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: exec 5>/dev/null $SHELL $CONFIG_STATUS || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi test -z "$cf_make_docs" && cf_make_docs=0 cf_output=makefile test -f "$cf_output" || cf_output=Makefile if test "$cf_make_docs" = 0 then cat >>$cf_output <\$@ ${GROFF_NOTE}.ps.pdf : ${GROFF_NOTE} ps2pdf \$*.ps ${GROFF_NOTE} ${GROFF_NOTE}.1.ps : ${GROFF_NOTE} \$(SHELL) -c "tbl \$*.1 | groff -man" >\$@ ${GROFF_NOTE} ${GROFF_NOTE}.1.txt : ${GROFF_NOTE} GROFF_NO_SGR=stupid \$(SHELL) -c "tbl \$*.1 | nroff -Tascii -man | col -bx" >\$@ ${MAN2HTML_NOTE}.1.html : ${MAN2HTML_NOTE} ./${MAN2HTML_TEMP} \$* 1 man >\$@ CF_EOF cf_make_docs=1 fi for cf_name in yacc do cat >>$cf_output < #endif #include #include #include #include #include #include #include #if defined(__cplusplus) /* __cplusplus, etc. */ #define class myClass #endif #define YYMAJOR 1 #define YYMINOR 9 #define CONCAT(first,second) first #second #define CONCAT1(string,number) CONCAT(string, number) #define CONCAT2(first,second) #first "." #second #ifdef YYPATCH #define VSTRING(a,b) CONCAT2(a,b) CONCAT1(" ",YYPATCH) #else #define VSTRING(a,b) CONCAT2(a,b) #endif #define VERSION VSTRING(YYMAJOR, YYMINOR) /* machine-dependent definitions: */ /* MAXCHAR is the largest unsigned character value */ /* MAXTABLE is the maximum table size */ /* YYINT is the smallest C integer type that can be */ /* used to address a table of size MAXTABLE */ /* MAXYYINT is the largest value of a YYINT */ /* MINYYINT is the most negative value of a YYINT */ /* BITS_PER_WORD is the number of bits in a C unsigned */ /* WORDSIZE computes the number of words needed to */ /* store n bits */ /* BIT returns the value of the n-th bit starting */ /* from r (0-indexed) */ /* SETBIT sets the n-th bit starting from r */ #define MAXCHAR UCHAR_MAX #ifndef MAXTABLE #define MAXTABLE 32500 #endif #if MAXTABLE <= SHRT_MAX #define YYINT short #define MAXYYINT SHRT_MAX #define MINYYINT SHRT_MIN #elif MAXTABLE <= INT_MAX #define YYINT int #define MAXYYINT INT_MAX #define MINYYINT INT_MIN #else #error "MAXTABLE is too large for this machine architecture!" #endif #define BITS_PER_WORD ((int) sizeof (unsigned) * CHAR_BIT) #define WORDSIZE(n) (((n)+(BITS_PER_WORD-1))/BITS_PER_WORD) #define BIT(r, n) ((((r)[(n)/BITS_PER_WORD])>>((n)&(BITS_PER_WORD-1)))&1) #define SETBIT(r, n) ((r)[(n)/BITS_PER_WORD]|=((unsigned)1<<((n)&(BITS_PER_WORD-1)))) /* character names */ #define NUL '\0' /* the null character */ #define NEWLINE '\n' /* line feed */ #define SP ' ' /* space */ #define BS '\b' /* backspace */ #define HT '\t' /* horizontal tab */ #define VT '\013' /* vertical tab */ #define CR '\r' /* carriage return */ #define FF '\f' /* form feed */ #define QUOTE '\'' /* single quote */ #define DOUBLE_QUOTE '\"' /* double quote */ #define BACKSLASH '\\' /* backslash */ #define UCH(c) (unsigned char)(c) /* defines for constructing filenames */ #if defined(VMS) #define CODE_SUFFIX "_code.c" #define DEFINES_SUFFIX "_tab.h" #define EXTERNS_SUFFIX "_tab.i" #define OUTPUT_SUFFIX "_tab.c" #else #define CODE_SUFFIX ".code.c" #define DEFINES_SUFFIX ".tab.h" #define EXTERNS_SUFFIX ".tab.i" #define OUTPUT_SUFFIX ".tab.c" #endif #define VERBOSE_SUFFIX ".output" #define GRAPH_SUFFIX ".dot" /* keyword codes */ #define TOKEN 0 #define LEFT 1 #define RIGHT 2 #define NONASSOC 3 #define MARK 4 #define TEXT 5 #define TYPE 6 #define START 7 #define UNION 8 #define IDENT 9 #define EXPECT 10 #define EXPECT_RR 11 #define PURE_PARSER 12 #define PARSE_PARAM 13 #define LEX_PARAM 14 #define POSIX_YACC 15 #define TOKEN_TABLE 16 #define ERROR_VERBOSE 17 #define XXXDEBUG 18 #if defined(YYBTYACC) #define LOCATIONS 19 #define DESTRUCTOR 20 #define INITIAL_ACTION 21 #endif /* symbol classes */ #define UNKNOWN 0 #define TERM 1 #define NONTERM 2 #define ACTION 3 #define ARGUMENT 4 /* the undefined value */ #define UNDEFINED (-1) /* action codes */ #define SHIFT 1 #define REDUCE 2 /* character macros */ #define IS_IDENT(c) (isalnum(c) || (c) == '_' || (c) == '.' || (c) == '$') #define IS_OCTAL(c) ((c) >= '0' && (c) <= '7') #define NUMERIC_VALUE(c) ((c) - '0') /* symbol macros */ #define ISTOKEN(s) ((s) < start_symbol) #define ISVAR(s) ((s) >= start_symbol) /* storage allocation macros */ #define CALLOC(k,n) (calloc((size_t)(k),(size_t)(n))) #define FREE(x) (free((char*)(x))) #define MALLOC(n) (malloc((size_t)(n))) #define TCMALLOC(t,n) ((t*) calloc((size_t)(n), sizeof(t))) #define TMALLOC(t,n) ((t*) malloc((size_t)(n) * sizeof(t))) #define NEW(t) ((t*)allocate(sizeof(t))) #define NEW2(n,t) ((t*)allocate(((size_t)(n)*sizeof(t)))) #define REALLOC(p,n) (realloc((char*)(p),(size_t)(n))) #define TREALLOC(t,p,n) ((t*)realloc((char*)(p), (size_t)(n) * sizeof(t))) #define DO_FREE(x) if (x) { FREE(x); x = 0; } #define NO_SPACE(p) if (p == 0) no_space(); assert(p != 0) /* messages */ #define PLURAL(n) ((n) > 1 ? "s" : "") /* * Features which depend indirectly on the btyacc configuration, but are not * essential. */ #if defined(YYBTYACC) #define USE_HEADER_GUARDS 1 #else #define USE_HEADER_GUARDS 0 #endif typedef char Assoc_t; typedef char Class_t; typedef YYINT Index_t; typedef YYINT Value_t; /* the structure of a symbol table entry */ typedef struct bucket bucket; struct bucket { struct bucket *link; struct bucket *next; char *name; char *tag; #if defined(YYBTYACC) char **argnames; char **argtags; int args; char *destructor; #endif Value_t value; Index_t index; Value_t prec; Class_t class; Assoc_t assoc; }; /* the structure of the LR(0) state machine */ typedef struct core core; struct core { struct core *next; struct core *link; Value_t number; Value_t accessing_symbol; Value_t nitems; Value_t items[1]; }; /* the structure used to record shifts */ typedef struct shifts shifts; struct shifts { struct shifts *next; Value_t number; Value_t nshifts; Value_t shift[1]; }; /* the structure used to store reductions */ typedef struct reductions reductions; struct reductions { struct reductions *next; Value_t number; Value_t nreds; Value_t rules[1]; }; /* the structure used to represent parser actions */ typedef struct action action; struct action { struct action *next; Value_t symbol; Value_t number; Value_t prec; char action_code; Assoc_t assoc; char suppressed; }; /* the structure used to store parse/lex parameters */ typedef struct param param; struct param { struct param *next; char *name; /* parameter name */ char *type; /* everything before parameter name */ char *type2; /* everything after parameter name */ }; /* global variables */ extern char dflag; extern char gflag; extern char iflag; extern char lflag; extern char rflag; extern char sflag; extern char tflag; extern char vflag; extern const char *symbol_prefix; extern const char *myname; extern char *cptr; extern char *line; extern int lineno; extern int outline; extern int exit_code; extern int pure_parser; extern int token_table; extern int error_verbose; #if defined(YYBTYACC) extern int locations; extern int backtrack; extern int destructor; extern char *initial_action; #endif extern const char *const banner[]; extern const char *const xdecls[]; extern const char *const tables[]; extern const char *const global_vars[]; extern const char *const impure_vars[]; extern const char *const hdr_defs[]; extern const char *const hdr_vars[]; extern const char *const body_1[]; extern const char *const body_vars[]; extern const char *const body_2[]; extern const char *const body_3[]; extern const char *const trailer[]; extern char *code_file_name; extern char *input_file_name; +extern size_t input_file_name_len; extern char *defines_file_name; extern char *externs_file_name; extern FILE *action_file; extern FILE *code_file; extern FILE *defines_file; extern FILE *externs_file; extern FILE *input_file; extern FILE *output_file; extern FILE *text_file; extern FILE *union_file; extern FILE *verbose_file; extern FILE *graph_file; extern Value_t nitems; extern Value_t nrules; extern Value_t nsyms; extern Value_t ntokens; extern Value_t nvars; extern int ntags; extern char unionized; extern char line_format[]; extern Value_t start_symbol; extern char **symbol_name; extern char **symbol_pname; extern Value_t *symbol_value; extern Value_t *symbol_prec; extern char *symbol_assoc; #if defined(YYBTYACC) extern Value_t *symbol_pval; extern char **symbol_destructor; extern char **symbol_type_tag; #endif extern Value_t *ritem; extern Value_t *rlhs; extern Value_t *rrhs; extern Value_t *rprec; extern Assoc_t *rassoc; extern Value_t **derives; extern char *nullable; extern bucket *first_symbol; extern bucket *last_symbol; extern int nstates; extern core *first_state; extern shifts *first_shift; extern reductions *first_reduction; extern Value_t *accessing_symbol; extern core **state_table; extern shifts **shift_table; extern reductions **reduction_table; extern unsigned *LA; extern Value_t *LAruleno; extern Value_t *lookaheads; extern Value_t *goto_base; extern Value_t *goto_map; extern Value_t *from_state; extern Value_t *to_state; extern action **parser; extern int SRexpect; extern int RRexpect; extern int SRtotal; extern int RRtotal; extern Value_t *SRconflicts; extern Value_t *RRconflicts; extern Value_t *defred; extern Value_t *rules_used; extern Value_t nunused; extern Value_t final_state; extern Value_t *itemset; extern Value_t *itemsetend; extern unsigned *ruleset; extern param *lex_param; extern param *parse_param; /* global functions */ #ifndef GCC_NORETURN #if defined(__dead2) #define GCC_NORETURN __dead2 #elif defined(__dead) #define GCC_NORETURN __dead #else #define GCC_NORETURN /* nothing */ #endif #endif #ifndef GCC_UNUSED #if defined(__unused) #define GCC_UNUSED __unused #else #define GCC_UNUSED /* nothing */ #endif #endif #ifndef GCC_PRINTFLIKE #define GCC_PRINTFLIKE(fmt,var) /*nothing */ #endif /* closure.c */ extern void closure(Value_t *nucleus, int n); extern void finalize_closure(void); extern void set_first_derives(void); /* error.c */ struct ainfo { int a_lineno; char *a_line; char *a_cptr; }; extern void arg_number_disagree_warning(int a_lineno, char *a_name); extern void arg_type_disagree_warning(int a_lineno, int i, char *a_name); extern void at_error(int a_lineno, char *a_line, char *a_cptr) GCC_NORETURN; extern void at_warning(int a_lineno, int i); extern void bad_formals(void) GCC_NORETURN; extern void default_action_warning(char *s); extern void destructor_redeclared_warning(const struct ainfo *); extern void dollar_error(int a_lineno, char *a_line, char *a_cptr) GCC_NORETURN; extern void dollar_warning(int a_lineno, int i); extern void fatal(const char *msg) GCC_NORETURN; extern void illegal_character(char *c_cptr) GCC_NORETURN; extern void illegal_tag(int t_lineno, char *t_line, char *t_cptr) GCC_NORETURN; extern void missing_brace(void) GCC_NORETURN; extern void no_grammar(void) GCC_NORETURN; extern void no_space(void) GCC_NORETURN; extern void open_error(const char *filename) GCC_NORETURN; extern void over_unionized(char *u_cptr) GCC_NORETURN; extern void prec_redeclared(void); extern void reprec_warning(char *s); extern void restarted_warning(void); extern void retyped_warning(char *s); extern void revalued_warning(char *s); extern void start_requires_args(char *a_name); extern void syntax_error(int st_lineno, char *st_line, char *st_cptr) GCC_NORETURN; extern void terminal_lhs(int s_lineno) GCC_NORETURN; extern void terminal_start(char *s) GCC_NORETURN; extern void tokenized_start(char *s) GCC_NORETURN; extern void undefined_goal(char *s) GCC_NORETURN; extern void undefined_symbol_warning(char *s); extern void unexpected_EOF(void) GCC_NORETURN; extern void unknown_arg_warning(int d_lineno, const char *dlr_opt, const char *d_arg, const char *d_line, const char *d_cptr); extern void unknown_rhs(int i) GCC_NORETURN; extern void unsupported_flag_warning(const char *flag, const char *details); extern void unterminated_action(const struct ainfo *) GCC_NORETURN; extern void unterminated_comment(const struct ainfo *) GCC_NORETURN; extern void unterminated_string(const struct ainfo *) GCC_NORETURN; extern void unterminated_text(const struct ainfo *) GCC_NORETURN; extern void unterminated_union(const struct ainfo *) GCC_NORETURN; extern void untyped_arg_warning(int a_lineno, const char *dlr_opt, const char *a_name); extern void untyped_lhs(void) GCC_NORETURN; extern void untyped_rhs(int i, char *s) GCC_NORETURN; extern void used_reserved(char *s) GCC_NORETURN; extern void unterminated_arglist(const struct ainfo *) GCC_NORETURN; extern void wrong_number_args_warning(const char *which, const char *a_name); extern void wrong_type_for_arg_warning(int i, char *a_name); /* graph.c */ extern void graph(void); /* lalr.c */ extern void lalr(void); /* lr0.c */ extern void lr0(void); extern void show_cores(void); extern void show_ritems(void); extern void show_rrhs(void); extern void show_shifts(void); /* main.c */ extern void *allocate(size_t n); extern void done(int k) GCC_NORETURN; /* mkpar.c */ extern void free_parser(void); extern void make_parser(void); /* mstring.c */ struct mstring { char *base, *ptr, *end; }; extern void msprintf(struct mstring *, const char *, ...) GCC_PRINTFLIKE(2,3); extern int mputchar(struct mstring *, int); extern struct mstring *msnew(void); extern char *msdone(struct mstring *); extern int strnscmp(const char *, const char *); extern unsigned int strnshash(const char *); #define mputc(m, ch) (((m)->ptr == (m)->end) \ ? mputchar(m,ch) \ : (*(m)->ptr++ = (char) (ch))) /* output.c */ extern void output(void); /* reader.c */ extern void reader(void); /* skeleton.c (generated by skel2c) */ extern void write_section(FILE * fp, const char *const section[]); /* symtab.c */ extern bucket *make_bucket(const char *); extern bucket *lookup(const char *); extern void create_symbol_table(void); extern void free_symbol_table(void); extern void free_symbols(void); /* verbose.c */ extern void verbose(void); /* warshall.c */ extern void reflexive_transitive_closure(unsigned *R, int n); #ifdef DEBUG /* closure.c */ extern void print_closure(int n); extern void print_EFF(void); extern void print_first_derives(void); /* lr0.c */ extern void print_derives(void); #endif #ifdef NO_LEAKS extern void lr0_leaks(void); extern void lalr_leaks(void); extern void mkpar_leaks(void); extern void output_leaks(void); extern void mstring_leaks(void); extern void reader_leaks(void); #endif Index: head/contrib/byacc/main.c =================================================================== --- head/contrib/byacc/main.c (revision 313104) +++ head/contrib/byacc/main.c (revision 313105) @@ -1,727 +1,730 @@ -/* $Id: main.c,v 1.57 2016/12/02 18:44:44 tom Exp $ */ +/* $Id: main.c,v 1.59 2017/02/02 00:44:38 tom Exp $ */ #include #ifndef _WIN32 #include /* for _exit() */ #else #include /* for _exit() */ #endif #include "defs.h" #ifdef HAVE_MKSTEMP # define USE_MKSTEMP 1 #elif defined(HAVE_FCNTL_H) # define USE_MKSTEMP 1 # include /* for open(), O_EXCL, etc. */ #else # define USE_MKSTEMP 0 #endif #if USE_MKSTEMP #include #include typedef struct _my_tmpfiles { struct _my_tmpfiles *next; char *name; } MY_TMPFILES; static MY_TMPFILES *my_tmpfiles; #endif /* USE_MKSTEMP */ char dflag; char gflag; char iflag; char lflag; static char oflag; char rflag; char sflag; char tflag; char vflag; const char *symbol_prefix; const char *myname = "yacc"; int lineno; int outline; -static char empty_string[] = ""; static char default_file_prefix[] = "y"; static char *file_prefix = default_file_prefix; char *code_file_name; -char *input_file_name = empty_string; +char *input_file_name; +size_t input_file_name_len = 0; char *defines_file_name; char *externs_file_name; static char *graph_file_name; static char *output_file_name; static char *verbose_file_name; FILE *action_file; /* a temp file, used to save actions associated */ /* with rules until the parser is written */ FILE *code_file; /* y.code.c (used when the -r option is specified) */ FILE *defines_file; /* y.tab.h */ FILE *externs_file; /* y.tab.i */ FILE *input_file; /* the input file */ FILE *output_file; /* y.tab.c */ FILE *text_file; /* a temp file, used to save text until all */ /* symbols have been defined */ FILE *union_file; /* a temp file, used to save the union */ /* definition until all symbol have been */ /* defined */ FILE *verbose_file; /* y.output */ FILE *graph_file; /* y.dot */ Value_t nitems; Value_t nrules; Value_t nsyms; Value_t ntokens; Value_t nvars; Value_t start_symbol; char **symbol_name; char **symbol_pname; Value_t *symbol_value; Value_t *symbol_prec; char *symbol_assoc; int pure_parser; int token_table; int error_verbose; #if defined(YYBTYACC) Value_t *symbol_pval; char **symbol_destructor; char **symbol_type_tag; int locations = 0; /* default to no position processing */ int backtrack = 0; /* default is no backtracking */ char *initial_action = NULL; #endif int exit_code; Value_t *ritem; Value_t *rlhs; Value_t *rrhs; Value_t *rprec; Assoc_t *rassoc; Value_t **derives; char *nullable; /* * Since fclose() is called via the signal handler, it might die. Don't loop * if there is a problem closing a file. */ #define DO_CLOSE(fp) \ if (fp != 0) { \ FILE *use = fp; \ fp = 0; \ fclose(use); \ } static int got_intr = 0; void done(int k) { DO_CLOSE(input_file); DO_CLOSE(output_file); if (iflag) DO_CLOSE(externs_file); if (rflag) DO_CLOSE(code_file); DO_CLOSE(action_file); DO_CLOSE(defines_file); DO_CLOSE(graph_file); DO_CLOSE(text_file); DO_CLOSE(union_file); DO_CLOSE(verbose_file); if (got_intr) _exit(EXIT_FAILURE); #ifdef NO_LEAKS if (rflag) DO_FREE(code_file_name); if (dflag) DO_FREE(defines_file_name); if (iflag) DO_FREE(externs_file_name); if (oflag) DO_FREE(output_file_name); if (vflag) DO_FREE(verbose_file_name); if (gflag) DO_FREE(graph_file_name); lr0_leaks(); lalr_leaks(); mkpar_leaks(); mstring_leaks(); output_leaks(); reader_leaks(); #endif exit(k); } static void onintr(int sig GCC_UNUSED) { got_intr = 1; done(EXIT_FAILURE); } static void set_signals(void) { #ifdef SIGINT if (signal(SIGINT, SIG_IGN) != SIG_IGN) signal(SIGINT, onintr); #endif #ifdef SIGTERM if (signal(SIGTERM, SIG_IGN) != SIG_IGN) signal(SIGTERM, onintr); #endif #ifdef SIGHUP if (signal(SIGHUP, SIG_IGN) != SIG_IGN) signal(SIGHUP, onintr); #endif } static void usage(void) { static const char *msg[] = { "" ,"Options:" ," -b file_prefix set filename prefix (default \"y.\")" ," -B create a backtracking parser" ," -d write definitions (" DEFINES_SUFFIX ")" ," -i write interface (y.tab.i)" ," -g write a graphical description" ," -l suppress #line directives" ," -L enable position processing, e.g., \"%locations\"" ," -o output_file (default \"" OUTPUT_SUFFIX "\")" ," -p symbol_prefix set symbol prefix (default \"yy\")" ," -P create a reentrant parser, e.g., \"%pure-parser\"" ," -r produce separate code and table files (y.code.c)" ," -s suppress #define's for quoted names in %token lines" ," -t add debugging support" ," -v write description (y.output)" ," -V show version information and exit" }; unsigned n; fflush(stdout); fprintf(stderr, "Usage: %s [options] filename\n", myname); for (n = 0; n < sizeof(msg) / sizeof(msg[0]); ++n) fprintf(stderr, "%s\n", msg[n]); exit(1); } static void setflag(int ch) { switch (ch) { case 'B': #if defined(YYBTYACC) backtrack = 1; #else unsupported_flag_warning("-B", "reconfigure with --enable-btyacc"); #endif break; case 'd': dflag = 1; break; case 'g': gflag = 1; break; case 'i': iflag = 1; break; case 'l': lflag = 1; break; case 'L': #if defined(YYBTYACC) locations = 1; #else unsupported_flag_warning("-B", "reconfigure with --enable-btyacc"); #endif break; case 'P': pure_parser = 1; break; case 'r': rflag = 1; break; case 's': sflag = 1; break; case 't': tflag = 1; break; case 'v': vflag = 1; break; case 'V': printf("%s - %s\n", myname, VERSION); exit(EXIT_SUCCESS); case 'y': /* noop for bison compatibility. byacc is already designed to be posix * yacc compatible. */ break; default: usage(); } } static void getargs(int argc, char *argv[]) { int i; char *s; int ch; if (argc > 0) myname = argv[0]; for (i = 1; i < argc; ++i) { s = argv[i]; if (*s != '-') break; switch (ch = *++s) { case '\0': input_file = stdin; if (i + 1 < argc) usage(); return; case '-': ++i; goto no_more_options; case 'b': if (*++s) file_prefix = s; else if (++i < argc) file_prefix = argv[i]; else usage(); continue; case 'o': if (*++s) output_file_name = s; else if (++i < argc) output_file_name = argv[i]; else usage(); continue; case 'p': if (*++s) symbol_prefix = s; else if (++i < argc) symbol_prefix = argv[i]; else usage(); continue; default: setflag(ch); break; } for (;;) { switch (ch = *++s) { case '\0': goto end_of_option; default: setflag(ch); break; } } end_of_option:; } no_more_options:; if (i + 1 != argc) usage(); - input_file_name = argv[i]; + input_file_name_len = strlen(argv[i]); + input_file_name = TMALLOC(char, input_file_name_len + 1); + NO_SPACE(input_file_name); + strcpy(input_file_name, argv[i]); } void * allocate(size_t n) { void *p; p = NULL; if (n) { p = CALLOC(1, n); NO_SPACE(p); } return (p); } #define CREATE_FILE_NAME(dest, suffix) \ dest = alloc_file_name(len, suffix) static char * alloc_file_name(size_t len, const char *suffix) { char *result = TMALLOC(char, len + strlen(suffix) + 1); if (result == 0) no_space(); strcpy(result, file_prefix); strcpy(result + len, suffix); return result; } static char * find_suffix(char *name, const char *suffix) { size_t len = strlen(name); size_t slen = strlen(suffix); if (len >= slen) { name += len - slen; if (strcmp(name, suffix) == 0) return name; } return NULL; } static void create_file_names(void) { size_t len; const char *defines_suffix; const char *externs_suffix; char *suffix; suffix = NULL; defines_suffix = DEFINES_SUFFIX; externs_suffix = EXTERNS_SUFFIX; /* compute the file_prefix from the user provided output_file_name */ if (output_file_name != 0) { if (!(suffix = find_suffix(output_file_name, OUTPUT_SUFFIX)) && (suffix = find_suffix(output_file_name, ".c"))) { defines_suffix = ".h"; externs_suffix = ".i"; } } if (suffix != NULL) { len = (size_t) (suffix - output_file_name); file_prefix = TMALLOC(char, len + 1); NO_SPACE(file_prefix); strncpy(file_prefix, output_file_name, len)[len] = 0; } else len = strlen(file_prefix); /* if "-o filename" was not given */ if (output_file_name == 0) { oflag = 1; CREATE_FILE_NAME(output_file_name, OUTPUT_SUFFIX); } if (rflag) { CREATE_FILE_NAME(code_file_name, CODE_SUFFIX); } else code_file_name = output_file_name; if (dflag) { CREATE_FILE_NAME(defines_file_name, defines_suffix); } if (iflag) { CREATE_FILE_NAME(externs_file_name, externs_suffix); } if (vflag) { CREATE_FILE_NAME(verbose_file_name, VERBOSE_SUFFIX); } if (gflag) { CREATE_FILE_NAME(graph_file_name, GRAPH_SUFFIX); } if (suffix != NULL) { FREE(file_prefix); } } #if USE_MKSTEMP static void close_tmpfiles(void) { while (my_tmpfiles != 0) { MY_TMPFILES *next = my_tmpfiles->next; (void)chmod(my_tmpfiles->name, 0644); (void)unlink(my_tmpfiles->name); free(my_tmpfiles->name); free(my_tmpfiles); my_tmpfiles = next; } } #ifndef HAVE_MKSTEMP static int my_mkstemp(char *temp) { int fd; char *dname; char *fname; char *name; /* * Split-up to use tempnam, rather than tmpnam; the latter (like * mkstemp) is unusable on Windows. */ if ((fname = strrchr(temp, '/')) != 0) { dname = strdup(temp); dname[++fname - temp] = '\0'; } else { dname = 0; fname = temp; } if ((name = tempnam(dname, fname)) != 0) { fd = open(name, O_CREAT | O_EXCL | O_RDWR); strcpy(temp, name); } else { fd = -1; } if (dname != 0) free(dname); return fd; } #define mkstemp(s) my_mkstemp(s) #endif #endif /* * tmpfile() should be adequate, except that it may require special privileges * to use, e.g., MinGW and Windows 7 where it tries to use the root directory. */ static FILE * open_tmpfile(const char *label) { #define MY_FMT "%s/%.*sXXXXXX" FILE *result; #if USE_MKSTEMP int fd; const char *tmpdir; char *name; const char *mark; if ((tmpdir = getenv("TMPDIR")) == 0 || access(tmpdir, W_OK) != 0) { #ifdef P_tmpdir tmpdir = P_tmpdir; #else tmpdir = "/tmp"; #endif if (access(tmpdir, W_OK) != 0) tmpdir = "."; } /* The size of the format is guaranteed to be longer than the result from * printing empty strings with it; this calculation accounts for the * string-lengths as well. */ name = malloc(strlen(tmpdir) + sizeof(MY_FMT) + strlen(label)); result = 0; if (name != 0) { mode_t save_umask = umask(0177); if ((mark = strrchr(label, '_')) == 0) mark = label + strlen(label); sprintf(name, MY_FMT, tmpdir, (int)(mark - label), label); fd = mkstemp(name); if (fd >= 0) { result = fdopen(fd, "w+"); if (result != 0) { MY_TMPFILES *item; if (my_tmpfiles == 0) { atexit(close_tmpfiles); } item = NEW(MY_TMPFILES); NO_SPACE(item); item->name = name; NO_SPACE(item->name); item->next = my_tmpfiles; my_tmpfiles = item; } } (void)umask(save_umask); } #else result = tmpfile(); #endif if (result == 0) open_error(label); return result; #undef MY_FMT } static void open_files(void) { create_file_names(); if (input_file == 0) { input_file = fopen(input_file_name, "r"); if (input_file == 0) open_error(input_file_name); } action_file = open_tmpfile("action_file"); text_file = open_tmpfile("text_file"); if (vflag) { verbose_file = fopen(verbose_file_name, "w"); if (verbose_file == 0) open_error(verbose_file_name); } if (gflag) { graph_file = fopen(graph_file_name, "w"); if (graph_file == 0) open_error(graph_file_name); fprintf(graph_file, "digraph %s {\n", file_prefix); fprintf(graph_file, "\tedge [fontsize=10];\n"); fprintf(graph_file, "\tnode [shape=box,fontsize=10];\n"); fprintf(graph_file, "\torientation=landscape;\n"); fprintf(graph_file, "\trankdir=LR;\n"); fprintf(graph_file, "\t/*\n"); fprintf(graph_file, "\tmargin=0.2;\n"); fprintf(graph_file, "\tpage=\"8.27,11.69\"; // for A4 printing\n"); fprintf(graph_file, "\tratio=auto;\n"); fprintf(graph_file, "\t*/\n"); } if (dflag) { defines_file = fopen(defines_file_name, "w"); if (defines_file == 0) open_error(defines_file_name); union_file = open_tmpfile("union_file"); } if (iflag) { externs_file = fopen(externs_file_name, "w"); if (externs_file == 0) open_error(externs_file_name); } output_file = fopen(output_file_name, "w"); if (output_file == 0) open_error(output_file_name); if (rflag) { code_file = fopen(code_file_name, "w"); if (code_file == 0) open_error(code_file_name); } else code_file = output_file; } int main(int argc, char *argv[]) { SRexpect = -1; RRexpect = -1; exit_code = EXIT_SUCCESS; set_signals(); getargs(argc, argv); open_files(); reader(); lr0(); lalr(); make_parser(); graph(); finalize_closure(); verbose(); output(); done(exit_code); /*NOTREACHED */ } Index: head/contrib/byacc/package/byacc.spec =================================================================== --- head/contrib/byacc/package/byacc.spec (revision 313104) +++ head/contrib/byacc/package/byacc.spec (revision 313105) @@ -1,60 +1,60 @@ Summary: byacc - public domain Berkeley LALR Yacc parser generator %define AppProgram byacc -%define AppVersion 20161202 +%define AppVersion 20170201 %define UseProgram yacc -# $XTermId: byacc.spec,v 1.32 2016/12/02 12:58:46 tom Exp $ +# $XTermId: byacc.spec,v 1.33 2017/02/01 09:55:04 tom Exp $ Name: %{AppProgram} Version: %{AppVersion} Release: 1 License: Public Domain, MIT Group: Applications/Development URL: ftp://invisible-island.net/%{AppProgram} Source0: %{AppProgram}-%{AppVersion}.tgz Packager: Thomas Dickey %description This package provides a parser generator utility that reads a grammar specification from a file and generates an LR(1) parser for it. The parsers consist of a set of LALR(1) parsing tables and a driver routine written in the C programming language. It has a public domain license which includes the generated C. %prep %setup -q -n %{AppProgram}-%{AppVersion} %build INSTALL_PROGRAM='${INSTALL}' \ ./configure \ --program-prefix=b \ --target %{_target_platform} \ --prefix=%{_prefix} \ --bindir=%{_bindir} \ --libdir=%{_libdir} \ --mandir=%{_mandir} make %install [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT make install DESTDIR=$RPM_BUILD_ROOT ( cd $RPM_BUILD_ROOT%{_bindir} && ln -s %{AppProgram} %{UseProgram} ) strip $RPM_BUILD_ROOT%{_bindir}/%{AppProgram} %clean [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) %{_prefix}/bin/%{AppProgram} %{_prefix}/bin/%{UseProgram} %{_mandir}/man1/%{AppProgram}.* %changelog # each patch should add its ChangeLog entries here * Sun Jun 06 2010 Thomas Dickey - initial version Index: head/contrib/byacc/package/debian/changelog =================================================================== --- head/contrib/byacc/package/debian/changelog (revision 313104) +++ head/contrib/byacc/package/debian/changelog (revision 313105) @@ -1,332 +1,338 @@ +byacc (20170201) unstable; urgency=low + + * maintenance updates + + -- Thomas E. Dickey Wed, 01 Feb 2017 04:55:04 -0500 + byacc (20161202) unstable; urgency=low * maintenance updates -- Thomas E. Dickey Fri, 02 Dec 2016 07:58:46 -0500 byacc (20160606) unstable; urgency=low * maintenance updates -- Thomas E. Dickey Mon, 06 Jun 2016 20:44:26 -0400 byacc (20160601) unstable; urgency=low * maintenance updates -- Thomas E. Dickey Mon, 06 Jun 2016 05:21:18 -0400 byacc (20160324) unstable; urgency=low * maintenance updates -- Thomas E. Dickey Thu, 24 Mar 2016 19:55:52 -0400 byacc (20150711) unstable; urgency=low * maintenance updates -- Thomas E. Dickey Fri, 10 Jul 2015 20:53:15 -0400 byacc (20150705) unstable; urgency=low * maintenance updates -- Thomas E. Dickey Sun, 05 Jul 2015 18:24:51 -0400 byacc (20141128) unstable; urgency=low * maintenance updates -- Thomas E. Dickey Fri, 28 Nov 2014 10:42:17 -0500 byacc (20141006) unstable; urgency=low * maintenance updates -- Thomas E. Dickey Mon, 06 Oct 2014 18:52:03 -0400 byacc (20141005) unstable; urgency=low * maintenance updates -- Thomas E. Dickey Sun, 27 Jul 2014 10:45:06 -0400 byacc (20140715) unstable; urgency=low * maintenance updates -- Thomas E. Dickey Tue, 15 Jul 2014 15:36:54 -0400 byacc (20140527) unstable; urgency=low * remove obsolete option from usage message -- Thomas E. Dickey Tue, 27 May 2014 22:01:55 -0400 byacc (20140422) unstable; urgency=low * maintenance updates -- Thomas E. Dickey Tue, 22 Apr 2014 04:13:20 -0400 byacc (20140409) unstable; urgency=low * integrate Tom Shield's btyacc-related changes * add test-cases to fill in gaps reported by lcov -- Thomas E. Dickey Wed, 09 Apr 2014 15:53:59 -0400 byacc (20140101) unstable; urgency=low * yytname[] changes -- Thomas E. Dickey Wed, 01 Jan 2014 10:02:12 -0500 byacc (20130925) unstable; urgency=low * increase default stack-size -- Thomas E. Dickey Wed, 25 Sep 2013 18:41:54 -0400 byacc (20130304) unstable; urgency=low * changes prompted by Richard Mitton bug-report -- Thomas E. Dickey Mon, 04 Mar 2013 20:17:32 -0500 byacc (20121003) unstable; urgency=low * changes from or prompted by Adrian Bunk. -- Thomas E. Dickey Sat, 29 Sep 2012 09:14:31 -0400 byacc (20120526) unstable; urgency=low * minor code-cleanup. -- Thomas E. Dickey Sat, 26 May 2012 12:14:17 -0400 byacc (20120115) unstable; urgency=low * add testcases, improve documentation for "-s" option. -- Thomas E. Dickey Fri, 13 Jan 2012 20:44:34 -0500 byacc (20111219) unstable; urgency=low * add "-s" option. -- Thomas E. Dickey Mon, 19 Dec 2011 20:54:09 -0500 byacc (20110908) unstable; urgency=low * add "-i" option. * add error-check in reader.c -- Thomas E. Dickey Mon, 05 Sep 2011 20:05:51 -0400 byacc (20101229) unstable; urgency=low * fixes from Christos Zoulos -- Thomas E. Dickey Wed, 29 Dec 2010 13:03:50 -0500 byacc (20101226) unstable; urgency=low * portability fix for MinGW -- Thomas E. Dickey Sat, 25 Dec 2010 19:37:54 -0500 byacc (20101127) unstable; urgency=low * corrected yyerror use of %parse-param data -- Thomas E. Dickey Sat, 27 Nov 2010 12:32:00 -0500 byacc (20101126) unstable; urgency=low * additional fix to generated code to avoid symbol conflict -- Thomas E. Dickey Fri, 26 Nov 2010 04:23:08 -0500 byacc (20101124) unstable; urgency=low * amend fix for Red Hat #112617 to restore warning message. -- Thomas E. Dickey Mon, 22 Nov 2010 08:21:23 -0500 byacc (20101122) unstable; urgency=low * fix for generated header to avoid symbol conflict -- Thomas E. Dickey Mon, 22 Nov 2010 08:21:23 -0500 byacc (20100610) unstable; urgency=low * Add package scripts to upstream source, for test-builds. -- Thomas E. Dickey Thu, 10 Jun 2010 08:59:11 -0400 byacc (20100216-1) unstable; urgency=low * New upstream release * debian/source/format: Added using format "3.0 (quilt)" -- Dave Beckett Tue, 20 Apr 2010 12:56:11 -0700 byacc (20091027-1) unstable; urgency=low * New upstream release * debian/control: - Updated to policy 3.8.4 - Add ${misc:Depends} -- Dave Beckett Tue, 02 Feb 2010 21:36:34 -0800 byacc (20090221-1) unstable; urgency=low * New upstream release -- Dave Beckett Thu, 26 Feb 2009 21:06:20 -0800 byacc (20080826-1) unstable; urgency=high * New upstream release * debian/patches/02-skeleton.patch: Removed - merged upstream * debian/control: Updated to policy 3.8.0 * debian/preinst, debian/postrm: removed - empty (lintian) * debian/watch: version 3 and make FTP passive * Acknowledge NMU - thanks. -- Dave Beckett Wed, 11 Sep 2008 23:58:00 -0700 byacc (20070509-1.1) unstable; urgency=high * Non-maintainer upload. * Fix stack overflow in skeleton.c with upstream patch. Closes: #491182 aka CVE-2008-3196 -- Thomas Viehmann Sun, 24 Aug 2008 23:13:07 +0200 byacc (20070509-1) unstable; urgency=low * New upstream release * debian/watch: Fix to use passive FTP * debian/compat: added instead of use of DH_COMPAT in debian/rules -- Dave Beckett Tue, 26 Jun 2007 22:39:45 -0700 byacc (20050813-1) unstable; urgency=low * New upstream release: - Do not close union_file for -d option (Closes: #322858) -- Dave Beckett Sun, 14 Aug 2005 10:14:12 +0100 byacc (20050505-1) unstable; urgency=low * New maintainer (Closes: #321377) * Switch to new upstream and new source (Closes: #240662) * debian/copyright: Update to new upstream and add source information (Closes: #166300) * Acknowledge fix in NMUs (Closes: #283174) * New manual page does not have the formatting problem (Closes: #100947) * Added debian/watch file. -- Dave Beckett Fri, 5 Aug 2005 22:50:20 +0100 byacc (1.9.1-1.1) unstable; urgency=low * Remove alternative in prerm. Closes: #283174 -- LaMont Jones Fri, 26 Nov 2004 18:49:09 -0700 byacc (1.9.1-1) unstable; urgency=low * Maintainer upload. * Fixed alternatives entry, closes: Bug#146195; * Changed priority to "extra" at behest of Daniel Bungert, closes: Bug#142271. * Fixed awful packaging error which meant the test/ directory was excluded from the orig.tar.gz. -- Jason Henry Parker Fri, 27 Sep 2002 16:25:27 -0400 byacc (1.9-13.1) unstable; urgency=low * Non-maintainer upload * Removed erraneous escapes in manpage - some data wasn't visable, closes: Bug#100947 * Alternatives entry added, closes: Bug#113168 * Standards-version: 3.5.6 * Maintainer script cleaning -- Daniel Bungert Fri, 29 Mar 2002 16:58:30 -0500 byacc (1.9-13) unstable; urgency=low * Applied patch from "Randolph Chung" to fix build problems on ia64, closes: Bug#91966 -- Jason Henry Parker Thu, 29 Mar 2001 21:41:19 +1000 byacc (1.9-12) unstable; urgency=low * Updated to latest version of debhelper, and Standards-Version: 3.2.1.0, closes: Bug#81444 * Added Build-Depends: debhelper, closes: Bug#70207 * Removed mktemp() calls in main.c -- Jason Henry Parker Mon, 18 Dec 2000 08:02:54 +1000 byacc (1.9-11.7) unstable; urgency=low * New maintainer. * Updated to dh_make and standards version 2.4.0.0, no lintian errors or warnings. * Added several more files from the upstream distribution to /usr/doc/byacc. -- Jason Henry Parker Sat, 2 Jan 1999 03:04:17 +1000 byacc (1.9-11.6) unstable; urgency=low * Patch by to remove some superfluous files that can interfere with the build process on other architectures. (Bug #21607). -- Vincent Renardias Fri, 24 Apr 1998 19:56:58 +0200 byacc (1.9-11.5) unstable; urgency=low * Added 'binary-arch' target in debian/rules (Bug #12742). -- Vincent Renardias Sun, 9 Nov 1997 23:37:31 +0100 byacc (1.9-11.4) unstable; urgency=low * Cosmetic change (Fix bug #9623). -- Vincent Renardias Fri, 9 May 1997 16:30:24 +0200 byacc (1.9-11.3) unstable; urgency=low * Rebuilt with libc6. -- Debian QA Group Thu, 1 May 1997 22:02:04 +0200 byacc (1.9-11.2) unstable; urgency=low * Orphaned the package at his maintainer's request (dgregor@coil.com). -- Debian QA Group Sun, 20 Apr 1997 20:03:03 +0200 byacc (1.9-11.1) unstable; urgency=low * Converted to new source format (Fixes #8085). * Compressed manpage. * Fixed to allow compilation on non-i386 (Fixes #3361). * Added extended description (Fixes #3567). * Added diversion to avoid conflict with bison (Fixes #8086). -- Vincent Renardias Sun, 20 Apr 1997 15:59:28 +0200 Index: head/contrib/byacc/package/debian/copyright =================================================================== --- head/contrib/byacc/package/debian/copyright (revision 313104) +++ head/contrib/byacc/package/debian/copyright (revision 313105) @@ -1,120 +1,120 @@ Upstream source http://invisible-island.net/byacc/byacc.html Berkeley Yacc is in the public domain; changes made to it by the current maintainer are likewise unrestricted. That applies to most of the files. A few files (currently those related to autoconf scripting) have other licenses as noted here. Current byacc upstream maintainer: Thomas Dickey Public domain notice and no warranty: ------------------------------------------------------------------------------- Berkeley Yacc is an LALR(1) parser generator. Berkeley Yacc has been made as compatible as possible with AT&T Yacc. Berkeley Yacc can accept any input specification that conforms to the AT&T Yacc documentation. Specifications that take advantage of undocumented features of AT&T Yacc will probably be rejected. Berkeley Yacc is distributed with no warranty whatever. The code is certain to contain errors. Neither the author nor any contributor takes responsibility for any consequences of its use. Berkeley Yacc is in the public domain. The data structures and algorithms used in Berkeley Yacc are all either taken from documents available to the general public or are inventions of the author. Anyone may freely distribute source or binary forms of Berkeley Yacc whether unchanged or modified. Distributers may charge whatever fees they can obtain for Berkeley Yacc. Programs generated by Berkeley Yacc may be distributed freely. Please report bugs to robert.corbett@eng.Sun.COM Include a small example if possible. Please include the banner string from skeleton.c with the bug report. Do not expect rapid responses. ------------------------------------------------------------------------------- Files: aclocal.m4 Licence: other-BSD -Copyright: 2004-2015,2016 by Thomas E. Dickey +Copyright: 2004-2016,2017 by Thomas E. Dickey Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, distribute with modifications, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name(s) of the above copyright holders shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization. Files: install-sh Copyright: 1994 X Consortium Licence: other-BSD Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of the X Consortium shall not be used in advertising or otherwise to promote the sale, use or other deal- ings in this Software without prior written authorization from the X Consor- tium. FSF changes to this file are in the public domain. 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. It can only install one file at a time, a restriction shared with many OS's install programs. Files: debian/* Copyright: 2012 Thomas E. Dickey Licence: other-BSD Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, 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 the above listed copyright holder(s) not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. On Debian systems, the complete text of the GNU General Public License can be found in '/usr/share/common-licenses/GPL-2' Index: head/contrib/byacc/package/mingw-byacc.spec =================================================================== --- head/contrib/byacc/package/mingw-byacc.spec (revision 313104) +++ head/contrib/byacc/package/mingw-byacc.spec (revision 313105) @@ -1,60 +1,60 @@ Summary: byacc - public domain Berkeley LALR Yacc parser generator %define AppProgram byacc -%define AppVersion 20161202 +%define AppVersion 20170201 %define UseProgram yacc -# $XTermId: mingw-byacc.spec,v 1.14 2016/12/02 12:58:46 tom Exp $ +# $XTermId: mingw-byacc.spec,v 1.15 2017/02/01 09:55:04 tom Exp $ Name: %{AppProgram} Version: %{AppVersion} Release: 1 License: Public Domain, MIT Group: Applications/Development URL: ftp://invisible-island.net/%{AppProgram} Source0: %{AppProgram}-%{AppVersion}.tgz Packager: Thomas Dickey %description This package provides a parser generator utility that reads a grammar specification from a file and generates an LR(1) parser for it. The parsers consist of a set of LALR(1) parsing tables and a driver routine written in the C programming language. It has a public domain license which includes the generated C. %prep %setup -q -n %{AppProgram}-%{AppVersion} %build INSTALL_PROGRAM='${INSTALL}' \ ./configure \ --program-prefix=b \ --target %{_target_platform} \ --prefix=%{_prefix} \ --bindir=%{_bindir} \ --libdir=%{_libdir} \ --mandir=%{_mandir} make %install [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT make install DESTDIR=$RPM_BUILD_ROOT ( cd $RPM_BUILD_ROOT%{_bindir} && ln -s %{AppProgram} %{UseProgram} ) strip $RPM_BUILD_ROOT%{_bindir}/%{AppProgram} %clean [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) %{_prefix}/bin/%{AppProgram} %{_prefix}/bin/%{UseProgram} %{_mandir}/man1/%{AppProgram}.* %changelog # each patch should add its ChangeLog entries here * Wed Sep 25 2013 Thomas Dickey - cloned from byacc.spec Index: head/contrib/byacc/package/pkgsrc/Makefile =================================================================== --- head/contrib/byacc/package/pkgsrc/Makefile (revision 313104) +++ head/contrib/byacc/package/pkgsrc/Makefile (revision 313105) @@ -1,19 +1,19 @@ # $NetBSD: Makefile,v 1.9 2008/07/24 17:13:00 tonnerre Exp $ # -DISTNAME= byacc-20161202 +DISTNAME= byacc-20170201 PKGREVISION= 1 CATEGORIES= devel MASTER_SITES= ftp://invisible-island.net/byacc/ EXTRACT_SUFX= .tgz MAINTAINER= pkgsrc-users@NetBSD.org HOMEPAGE= http://invisible-island.net/byacc/byacc.html COMMENT= Berkeley Yacc PKG_DESTDIR_SUPPORT= user-destdir GNU_CONFIGURE= YES MAKE_FILE= makefile .include "../../mk/bsd.pkg.mk" Index: head/contrib/byacc/reader.c =================================================================== --- head/contrib/byacc/reader.c (revision 313104) +++ head/contrib/byacc/reader.c (revision 313105) @@ -1,3655 +1,3787 @@ -/* $Id: reader.c,v 1.66 2016/12/02 20:14:34 tom Exp $ */ +/* $Id: reader.c,v 1.68 2017/02/02 01:05:36 tom Exp $ */ #include "defs.h" /* The line size must be a positive integer. One hundred was chosen */ /* because few lines in Yacc input grammars exceed 100 characters. */ /* Note that if a line exceeds LINESIZE characters, the line buffer */ /* will be expanded to accomodate it. */ #define LINESIZE 100 #define L_CURL '{' #define R_CURL '}' #define L_PAREN '(' #define R_PAREN ')' #define L_BRAC '[' #define R_BRAC ']' /* the maximum number of arguments (inherited attributes) to a non-terminal */ /* this is a hard limit, but seems more than adequate */ #define MAXARGS 20 static void start_rule(bucket *bp, int s_lineno); #if defined(YYBTYACC) static void copy_initial_action(void); static void copy_destructor(void); static char *process_destructor_XX(char *code, char *tag); #endif #define CACHE_SIZE 256 static char *cache; static int cinc, cache_size; int ntags; static int tagmax, havetags; static char **tag_table; static char saw_eof; char unionized; char *cptr, *line; static int linesize; static bucket *goal; static Value_t prec; static int gensym; static char last_was_action; #if defined(YYBTYACC) static int trialaction; #endif static int maxitems; static bucket **pitem; static int maxrules; static bucket **plhs; static size_t name_pool_size; static char *name_pool; char line_format[] = "#line %d \"%s\"\n"; param *lex_param; param *parse_param; #if defined(YYBTYACC) int destructor = 0; /* =1 if at least one %destructor */ static bucket *default_destructor[3] = {0, 0, 0}; #define UNTYPED_DEFAULT 0 #define TYPED_DEFAULT 1 #define TYPE_SPECIFIED 2 static bucket * lookup_type_destructor(char *tag) { const char fmt[] = "%.*s destructor"; char name[1024] = "\0"; bucket *bp, **bpp = &default_destructor[TYPE_SPECIFIED]; while ((bp = *bpp) != NULL) { if (bp->tag == tag) return (bp); bpp = &bp->link; } sprintf(name, fmt, (int)(sizeof(name) - sizeof(fmt)), tag); *bpp = bp = make_bucket(name); bp->tag = tag; return (bp); } #endif /* defined(YYBTYACC) */ static void cachec(int c) { assert(cinc >= 0); if (cinc >= cache_size) { cache_size += CACHE_SIZE; cache = TREALLOC(char, cache, cache_size); NO_SPACE(cache); } cache[cinc] = (char)c; ++cinc; } -static void -get_line(void) +typedef enum { - FILE *f = input_file; - int c; - int i; + ldSPC1, + ldSPC2, + ldNAME, + ldSPC3, + ldNUM, + ldSPC4, + ldFILE, + ldOK, + ldERR +} +LINE_DIR; - if (saw_eof || (c = getc(f)) == EOF) +/* + * Expect this pattern: + * /^[[:space:]]*#[[:space:]]* + * line[[:space:]]+ + * [[:digit:]]+ + * ([[:space:]]*|[[:space:]]+"[^"]+")/ + */ +static int +line_directive(void) +{ +#define UNLESS(what) if (what) { ld = ldERR; break; } + int n; + int line_1st = -1; + int name_1st = -1; + int name_end = -1; + LINE_DIR ld = ldSPC1; + for (n = 0; (ld <= ldOK) && (line[n] != '\0'); ++n) { - if (line) + int ch = UCH(line[n]); + switch (ld) { - FREE(line); - line = 0; + case ldSPC1: + if (isspace(ch)) + { + break; + } + else + UNLESS(ch != '#'); + ld = ldSPC2; + break; + case ldSPC2: + if (isspace(ch)) + { + break; + } + /* FALLTHRU */ + case ldNAME: + UNLESS(strncmp(line + n, "line", 4)); + n += 4; + if (line[n] == '\0') + { + ld = ldOK; + break; + } + else + UNLESS(!isspace(UCH(line[n]))); + ld = ldSPC3; + break; + case ldSPC3: + if (isspace(ch)) + { + break; + } + else + UNLESS(!isdigit(ch)); + line_1st = n; + ld = ldNUM; + /* FALLTHRU */ + case ldNUM: + if (isdigit(ch)) + { + break; + } + else + UNLESS(!isspace(ch)); + ld = ldSPC4; + break; + case ldSPC4: + if (isspace(ch)) + { + break; + } + else + UNLESS(ch != '"'); + UNLESS(line[n + 1] == '"'); + ld = ldFILE; + name_1st = n; + break; + case ldFILE: + if (ch != '"') + { + break; + } + ld = ldOK; + name_end = n; + /* FALLTHRU */ + case ldERR: + case ldOK: + break; } - cptr = 0; - saw_eof = 1; - return; } - if (line == NULL || linesize != (LINESIZE + 1)) + if (ld == ldOK) { - if (line) - FREE(line); - linesize = LINESIZE + 1; - line = TMALLOC(char, linesize); - NO_SPACE(line); + size_t need = (size_t) (name_end - name_1st); + if (need > input_file_name_len) + { + input_file_name_len = need; + input_file_name = TREALLOC(char, input_file_name, need + 1); + NO_SPACE(input_file_name); + } + memcpy(input_file_name, line + name_1st + 1, need - 1); + input_file_name[need - 1] = '\0'; } - i = 0; - ++lineno; - for (;;) + if (ld >= ldNUM && ld < ldERR) { - line[i++] = (char)c; - if (c == '\n') - break; - if ((i + 3) >= linesize) + lineno = (int)strtol(line + line_1st, NULL, 10) - 1; + } + + return (ld == ldOK); +#undef UNLESS +} + +static void +get_line(void) +{ + FILE *f = input_file; + int c; + int i; + + do + { + if (saw_eof || (c = getc(f)) == EOF) { - linesize += LINESIZE; - line = TREALLOC(char, line, linesize); + if (line) + { + FREE(line); + line = 0; + } + cptr = 0; + saw_eof = 1; + return; + } + + if (line == NULL || linesize != (LINESIZE + 1)) + { + if (line) + FREE(line); + linesize = LINESIZE + 1; + line = TMALLOC(char, linesize); NO_SPACE(line); } - c = getc(f); - if (c == EOF) + + i = 0; + ++lineno; + for (;;) { - line[i++] = '\n'; - saw_eof = 1; - break; + line[i++] = (char)c; + if (c == '\n') + break; + if ((i + 3) >= linesize) + { + linesize += LINESIZE; + line = TREALLOC(char, line, linesize); + NO_SPACE(line); + } + c = getc(f); + if (c == EOF) + { + line[i++] = '\n'; + saw_eof = 1; + break; + } } + line[i] = '\0'; } - line[i] = '\0'; + while (line_directive()); cptr = line; return; } static char * dup_line(void) { char *p, *s, *t; if (line == NULL) return (NULL); s = line; while (*s != '\n') ++s; p = TMALLOC(char, s - line + 1); NO_SPACE(p); s = line; t = p; while ((*t++ = *s++) != '\n') continue; return (p); } static void skip_comment(void) { char *s; struct ainfo a; a.a_lineno = lineno; a.a_line = dup_line(); a.a_cptr = a.a_line + (cptr - line); s = cptr + 2; for (;;) { if (*s == '*' && s[1] == '/') { cptr = s + 2; FREE(a.a_line); return; } if (*s == '\n') { get_line(); if (line == NULL) unterminated_comment(&a); s = cptr; } else ++s; } } static int next_inline(void) { char *s; if (line == NULL) { get_line(); if (line == NULL) return (EOF); } s = cptr; for (;;) { switch (*s) { case '/': if (s[1] == '*') { cptr = s; skip_comment(); s = cptr; break; } else if (s[1] == '/') { get_line(); if (line == NULL) return (EOF); s = cptr; break; } /* FALLTHRU */ default: cptr = s; return (*s); } } } static int nextc(void) { int ch; int finish = 0; do { switch (ch = next_inline()) { case '\n': get_line(); break; case ' ': case '\t': case '\f': case '\r': case '\v': case ',': case ';': ++cptr; break; case '\\': ch = '%'; /* FALLTHRU */ default: finish = 1; break; } } while (!finish); return ch; } /* *INDENT-OFF* */ static struct keyword { char name[14]; int token; } keywords[] = { { "binary", NONASSOC }, { "debug", XXXDEBUG }, #if defined(YYBTYACC) { "destructor", DESTRUCTOR }, #endif { "error-verbose",ERROR_VERBOSE }, { "expect", EXPECT }, { "expect-rr", EXPECT_RR }, { "ident", IDENT }, #if defined(YYBTYACC) { "initial-action", INITIAL_ACTION }, #endif { "left", LEFT }, { "lex-param", LEX_PARAM }, #if defined(YYBTYACC) { "locations", LOCATIONS }, #endif { "nonassoc", NONASSOC }, { "parse-param", PARSE_PARAM }, { "pure-parser", PURE_PARSER }, { "right", RIGHT }, { "start", START }, { "term", TOKEN }, { "token", TOKEN }, { "token-table", TOKEN_TABLE }, { "type", TYPE }, { "union", UNION }, { "yacc", POSIX_YACC }, }; /* *INDENT-ON* */ static int compare_keys(const void *a, const void *b) { const struct keyword *p = (const struct keyword *)a; const struct keyword *q = (const struct keyword *)b; return strcmp(p->name, q->name); } static int keyword(void) { int c; char *t_cptr = cptr; struct keyword *key; c = *++cptr; if (isalpha(c)) { cinc = 0; for (;;) { if (isalpha(c)) { if (isupper(c)) c = tolower(c); cachec(c); } else if (isdigit(c) || c == '-' || c == '.' || c == '$') { cachec(c); } else if (c == '_') { /* treat keywords spelled with '_' as if it were '-' */ cachec('-'); } else { break; } c = *++cptr; } cachec(NUL); if ((key = bsearch(cache, keywords, sizeof(keywords) / sizeof(*key), sizeof(*key), compare_keys))) return key->token; } else { ++cptr; if (c == L_CURL) return (TEXT); if (c == '%' || c == '\\') return (MARK); if (c == '<') return (LEFT); if (c == '>') return (RIGHT); if (c == '0') return (TOKEN); if (c == '2') return (NONASSOC); } syntax_error(lineno, line, t_cptr); /*NOTREACHED */ } static void copy_ident(void) { int c; FILE *f = output_file; c = nextc(); if (c == EOF) unexpected_EOF(); if (c != '"') syntax_error(lineno, line, cptr); ++outline; fprintf(f, "#ident \""); for (;;) { c = *++cptr; if (c == '\n') { fprintf(f, "\"\n"); return; } putc(c, f); if (c == '"') { putc('\n', f); ++cptr; return; } } } static char * copy_string(int quote) { struct mstring *temp = msnew(); int c; struct ainfo a; a.a_lineno = lineno; a.a_line = dup_line(); a.a_cptr = a.a_line + (cptr - line - 1); for (;;) { c = *cptr++; mputc(temp, c); if (c == quote) { FREE(a.a_line); return msdone(temp); } if (c == '\n') unterminated_string(&a); if (c == '\\') { c = *cptr++; mputc(temp, c); if (c == '\n') { get_line(); if (line == NULL) unterminated_string(&a); } } } } static char * copy_comment(void) { struct mstring *temp = msnew(); int c; c = *cptr; if (c == '/') { mputc(temp, '*'); while ((c = *++cptr) != '\n') { mputc(temp, c); if (c == '*' && cptr[1] == '/') mputc(temp, ' '); } mputc(temp, '*'); mputc(temp, '/'); } else if (c == '*') { struct ainfo a; a.a_lineno = lineno; a.a_line = dup_line(); a.a_cptr = a.a_line + (cptr - line - 1); mputc(temp, c); ++cptr; for (;;) { c = *cptr++; mputc(temp, c); if (c == '*' && *cptr == '/') { mputc(temp, '/'); ++cptr; FREE(a.a_line); return msdone(temp); } if (c == '\n') { get_line(); if (line == NULL) unterminated_comment(&a); } } } return msdone(temp); } static void copy_text(void) { int c; FILE *f = text_file; int need_newline = 0; struct ainfo a; a.a_lineno = lineno; a.a_line = dup_line(); a.a_cptr = a.a_line + (cptr - line - 2); if (*cptr == '\n') { get_line(); if (line == NULL) unterminated_text(&a); } if (!lflag) fprintf(f, line_format, lineno, input_file_name); loop: c = *cptr++; switch (c) { case '\n': putc('\n', f); need_newline = 0; get_line(); if (line) goto loop; unterminated_text(&a); case '\'': case '"': putc(c, f); { char *s = copy_string(c); fputs(s, f); free(s); } need_newline = 1; goto loop; case '/': putc(c, f); { char *s = copy_comment(); fputs(s, f); free(s); } need_newline = 1; goto loop; case '%': case '\\': if (*cptr == R_CURL) { if (need_newline) putc('\n', f); ++cptr; FREE(a.a_line); return; } /* FALLTHRU */ default: putc(c, f); need_newline = 1; goto loop; } } static void puts_both(const char *s) { fputs(s, text_file); if (dflag) fputs(s, union_file); } static void putc_both(int c) { putc(c, text_file); if (dflag) putc(c, union_file); } static void copy_union(void) { int c; int depth; struct ainfo a; a.a_lineno = lineno; a.a_line = dup_line(); a.a_cptr = a.a_line + (cptr - line - 6); if (unionized) over_unionized(cptr - 6); unionized = 1; puts_both("#ifdef YYSTYPE\n"); puts_both("#undef YYSTYPE_IS_DECLARED\n"); puts_both("#define YYSTYPE_IS_DECLARED 1\n"); puts_both("#endif\n"); puts_both("#ifndef YYSTYPE_IS_DECLARED\n"); puts_both("#define YYSTYPE_IS_DECLARED 1\n"); if (!lflag) fprintf(text_file, line_format, lineno, input_file_name); puts_both("typedef union"); depth = 0; loop: c = *cptr++; putc_both(c); switch (c) { case '\n': get_line(); if (line == NULL) unterminated_union(&a); goto loop; case L_CURL: ++depth; goto loop; case R_CURL: if (--depth == 0) { puts_both(" YYSTYPE;\n"); puts_both("#endif /* !YYSTYPE_IS_DECLARED */\n"); FREE(a.a_line); return; } goto loop; case '\'': case '"': { char *s = copy_string(c); puts_both(s); free(s); } goto loop; case '/': { char *s = copy_comment(); puts_both(s); free(s); } goto loop; default: goto loop; } } static char * after_blanks(char *s) { while (*s != '\0' && isspace(UCH(*s))) ++s; return s; } /* * Trim leading/trailing blanks, and collapse multiple embedded blanks to a * single space. Return index to last character in the buffer. */ static int trim_blanks(char *buffer) { if (*buffer != '\0') { char *d = buffer; char *s = after_blanks(d); while ((*d++ = *s++) != '\0') { ; } --d; while ((--d != buffer) && isspace(UCH(*d))) *d = '\0'; for (s = d = buffer; (*d++ = *s++) != '\0';) { if (isspace(UCH(*s))) { *s = ' '; while (isspace(UCH(*s))) { *s++ = ' '; } --s; } } } return (int)strlen(buffer) - 1; } /* * Scan forward in the current line-buffer looking for a right-curly bracket. * * Parameters begin with a left-curly bracket, and continue until there are no * more interesting characters after the last right-curly bracket on the * current line. Bison documents parameters as separated like this: * {type param1} {type2 param2} * but also accepts commas (although some versions of bison mishandle this) * {type param1, type2 param2} */ static int more_curly(void) { char *save = cptr; int result = 0; int finish = 0; do { switch (next_inline()) { case 0: case '\n': finish = 1; break; case R_CURL: finish = 1; result = 1; break; } ++cptr; } while (!finish); cptr = save; return result; } static void save_param(int k, char *buffer, int name, int type2) { param *head, *p; p = TMALLOC(param, 1); NO_SPACE(p); p->type2 = strdup(buffer + type2); NO_SPACE(p->type2); buffer[type2] = '\0'; (void)trim_blanks(p->type2); p->name = strdup(buffer + name); NO_SPACE(p->name); buffer[name] = '\0'; (void)trim_blanks(p->name); p->type = strdup(buffer); NO_SPACE(p->type); (void)trim_blanks(p->type); if (k == LEX_PARAM) head = lex_param; else head = parse_param; if (head != NULL) { while (head->next) head = head->next; head->next = p; } else { if (k == LEX_PARAM) lex_param = p; else parse_param = p; } p->next = NULL; } /* * Keep a linked list of parameters. This may be multi-line, if the trailing * right-curly bracket is absent. */ static void copy_param(int k) { int c; int name, type2; int curly = 0; char *buf = 0; int i = -1; size_t buf_size = 0; int st_lineno = lineno; char *comma; do { int state = curly; c = next_inline(); switch (c) { case EOF: unexpected_EOF(); break; case L_CURL: if (curly == 1) { goto oops; } curly = 1; st_lineno = lineno; break; case R_CURL: if (curly != 1) { goto oops; } curly = 2; break; case '\n': if (curly == 0) { goto oops; } break; case '%': if ((curly == 1) && (cptr == line)) { lineno = st_lineno; missing_brace(); } /* FALLTHRU */ case '"': case '\'': goto oops; default: if (curly == 0 && !isspace(UCH(c))) { goto oops; } break; } if (buf == 0) { buf_size = (size_t) linesize; buf = TMALLOC(char, buf_size); } else if (c == '\n') { get_line(); if (line == NULL) unexpected_EOF(); --cptr; buf_size += (size_t) linesize; buf = TREALLOC(char, buf, buf_size); } NO_SPACE(buf); if (curly) { if ((state == 2) && (c == L_CURL)) { buf[++i] = ','; } else if ((state == 2) && isspace(UCH(c))) { ; } else if ((c != L_CURL) && (c != R_CURL)) { buf[++i] = (char)c; } } cptr++; } while (curly < 2 || more_curly()); if (i == 0) { if (curly == 1) { lineno = st_lineno; missing_brace(); } goto oops; } buf[++i] = '\0'; (void)trim_blanks(buf); comma = buf - 1; do { char *parms = (comma + 1); comma = strchr(parms, ','); if (comma != 0) *comma = '\0'; (void)trim_blanks(parms); i = (int)strlen(parms) - 1; if (i < 0) { goto oops; } if (parms[i] == ']') { int level = 1; while (i >= 0 && level > 0 && parms[i] != '[') { if (parms[i] == ']') ++level; else if (parms[i] == '[') --level; i--; } if (i <= 0) unexpected_EOF(); type2 = i--; } else { type2 = i + 1; } while (i > 0 && (isalnum(UCH(parms[i])) || UCH(parms[i]) == '_')) i--; if (!isspace(UCH(parms[i])) && parms[i] != '*') goto oops; name = i + 1; save_param(k, parms, name, type2); } while (comma != 0); FREE(buf); return; oops: FREE(buf); syntax_error(lineno, line, cptr); } static int hexval(int c) { if (c >= '0' && c <= '9') return (c - '0'); if (c >= 'A' && c <= 'F') return (c - 'A' + 10); if (c >= 'a' && c <= 'f') return (c - 'a' + 10); return (-1); } static bucket * get_literal(void) { int c, quote; int i; int n; char *s; bucket *bp; struct ainfo a; a.a_lineno = lineno; a.a_line = dup_line(); a.a_cptr = a.a_line + (cptr - line); quote = *cptr++; cinc = 0; for (;;) { c = *cptr++; if (c == quote) break; if (c == '\n') unterminated_string(&a); if (c == '\\') { char *c_cptr = cptr - 1; c = *cptr++; switch (c) { case '\n': get_line(); if (line == NULL) unterminated_string(&a); continue; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': n = c - '0'; c = *cptr; if (IS_OCTAL(c)) { n = (n << 3) + (c - '0'); c = *++cptr; if (IS_OCTAL(c)) { n = (n << 3) + (c - '0'); ++cptr; } } if (n > MAXCHAR) illegal_character(c_cptr); c = n; break; case 'x': c = *cptr++; n = hexval(c); if (n < 0 || n >= 16) illegal_character(c_cptr); for (;;) { c = *cptr; i = hexval(c); if (i < 0 || i >= 16) break; ++cptr; n = (n << 4) + i; if (n > MAXCHAR) illegal_character(c_cptr); } c = n; break; case 'a': c = 7; break; case 'b': c = '\b'; break; case 'f': c = '\f'; break; case 'n': c = '\n'; break; case 'r': c = '\r'; break; case 't': c = '\t'; break; case 'v': c = '\v'; break; } } cachec(c); } FREE(a.a_line); n = cinc; s = TMALLOC(char, n); NO_SPACE(s); for (i = 0; i < n; ++i) s[i] = cache[i]; cinc = 0; if (n == 1) cachec('\''); else cachec('"'); for (i = 0; i < n; ++i) { c = UCH(s[i]); if (c == '\\' || c == cache[0]) { cachec('\\'); cachec(c); } else if (isprint(c)) cachec(c); else { cachec('\\'); switch (c) { case 7: cachec('a'); break; case '\b': cachec('b'); break; case '\f': cachec('f'); break; case '\n': cachec('n'); break; case '\r': cachec('r'); break; case '\t': cachec('t'); break; case '\v': cachec('v'); break; default: cachec(((c >> 6) & 7) + '0'); cachec(((c >> 3) & 7) + '0'); cachec((c & 7) + '0'); break; } } } if (n == 1) cachec('\''); else cachec('"'); cachec(NUL); bp = lookup(cache); bp->class = TERM; if (n == 1 && bp->value == UNDEFINED) bp->value = UCH(*s); FREE(s); return (bp); } static int is_reserved(char *name) { char *s; if (strcmp(name, ".") == 0 || strcmp(name, "$accept") == 0 || strcmp(name, "$end") == 0) return (1); if (name[0] == '$' && name[1] == '$' && isdigit(UCH(name[2]))) { s = name + 3; while (isdigit(UCH(*s))) ++s; if (*s == NUL) return (1); } return (0); } static bucket * get_name(void) { int c; cinc = 0; for (c = *cptr; IS_IDENT(c); c = *++cptr) cachec(c); cachec(NUL); if (is_reserved(cache)) used_reserved(cache); return (lookup(cache)); } static Value_t get_number(void) { int c; Value_t n; n = 0; for (c = *cptr; isdigit(c); c = *++cptr) n = (Value_t)(10 * n + (c - '0')); return (n); } static char * cache_tag(char *tag, size_t len) { int i; char *s; for (i = 0; i < ntags; ++i) { if (strncmp(tag, tag_table[i], len) == 0 && tag_table[i][len] == NUL) return (tag_table[i]); } if (ntags >= tagmax) { tagmax += 16; tag_table = (tag_table ? TREALLOC(char *, tag_table, tagmax) : TMALLOC(char *, tagmax)); NO_SPACE(tag_table); } s = TMALLOC(char, len + 1); NO_SPACE(s); strncpy(s, tag, len); s[len] = 0; tag_table[ntags++] = s; return s; } static char * get_tag(void) { int c; int t_lineno = lineno; char *t_line = dup_line(); char *t_cptr = t_line + (cptr - line); ++cptr; c = nextc(); if (c == EOF) unexpected_EOF(); if (!isalpha(c) && c != '_' && c != '$') illegal_tag(t_lineno, t_line, t_cptr); cinc = 0; do { cachec(c); c = *++cptr; } while (IS_IDENT(c)); cachec(NUL); c = nextc(); if (c == EOF) unexpected_EOF(); if (c != '>') illegal_tag(t_lineno, t_line, t_cptr); ++cptr; FREE(t_line); havetags = 1; return cache_tag(cache, (size_t) cinc); } #if defined(YYBTYACC) static char * scan_id(void) { char *b = cptr; while (isalnum(UCH(*cptr)) || *cptr == '_' || *cptr == '$') cptr++; return cache_tag(b, (size_t) (cptr - b)); } #endif static void declare_tokens(int assoc) { int c; bucket *bp; Value_t value; char *tag = 0; if (assoc != TOKEN) ++prec; c = nextc(); if (c == EOF) unexpected_EOF(); if (c == '<') { tag = get_tag(); c = nextc(); if (c == EOF) unexpected_EOF(); } for (;;) { if (isalpha(c) || c == '_' || c == '.' || c == '$') bp = get_name(); else if (c == '\'' || c == '"') bp = get_literal(); else return; if (bp == goal) tokenized_start(bp->name); bp->class = TERM; if (tag) { if (bp->tag && tag != bp->tag) retyped_warning(bp->name); bp->tag = tag; } if (assoc != TOKEN) { if (bp->prec && prec != bp->prec) reprec_warning(bp->name); bp->assoc = (Assoc_t)assoc; bp->prec = prec; } c = nextc(); if (c == EOF) unexpected_EOF(); value = UNDEFINED; if (isdigit(c)) { value = get_number(); if (bp->value != UNDEFINED && value != bp->value) revalued_warning(bp->name); bp->value = value; c = nextc(); if (c == EOF) unexpected_EOF(); } } } /* * %expect requires special handling * as it really isn't part of the yacc * grammar only a flag for yacc proper. */ static void declare_expect(int assoc) { int c; if (assoc != EXPECT && assoc != EXPECT_RR) ++prec; /* * Stay away from nextc - doesn't * detect EOL and will read to EOF. */ c = *++cptr; if (c == EOF) unexpected_EOF(); for (;;) { if (isdigit(c)) { if (assoc == EXPECT) SRexpect = get_number(); else RRexpect = get_number(); break; } /* * Looking for number before EOL. * Spaces, tabs, and numbers are ok, * words, punc., etc. are syntax errors. */ else if (c == '\n' || isalpha(c) || !isspace(c)) { syntax_error(lineno, line, cptr); } else { c = *++cptr; if (c == EOF) unexpected_EOF(); } } } #if defined(YYBTYACC) static void declare_argtypes(bucket *bp) { char *tags[MAXARGS]; int args = 0, c; if (bp->args >= 0) retyped_warning(bp->name); cptr++; /* skip open paren */ for (;;) { c = nextc(); if (c == EOF) unexpected_EOF(); if (c != '<') syntax_error(lineno, line, cptr); tags[args++] = get_tag(); c = nextc(); if (c == R_PAREN) break; if (c == EOF) unexpected_EOF(); } cptr++; /* skip close paren */ bp->args = args; bp->argnames = TMALLOC(char *, args); NO_SPACE(bp->argnames); bp->argtags = CALLOC(sizeof(char *), args + 1); NO_SPACE(bp->argtags); while (--args >= 0) { bp->argtags[args] = tags[args]; bp->argnames[args] = NULL; } } #endif static void declare_types(void) { int c; bucket *bp = NULL; char *tag = NULL; c = nextc(); if (c == EOF) unexpected_EOF(); if (c == '<') tag = get_tag(); for (;;) { c = nextc(); if (c == EOF) unexpected_EOF(); if (isalpha(c) || c == '_' || c == '.' || c == '$') { bp = get_name(); #if defined(YYBTYACC) if (nextc() == L_PAREN) declare_argtypes(bp); else bp->args = 0; #endif } else if (c == '\'' || c == '"') { bp = get_literal(); #if defined(YYBTYACC) bp->args = 0; #endif } else return; if (tag) { if (bp->tag && tag != bp->tag) retyped_warning(bp->name); bp->tag = tag; } } } static void declare_start(void) { int c; bucket *bp; c = nextc(); if (c == EOF) unexpected_EOF(); if (!isalpha(c) && c != '_' && c != '.' && c != '$') syntax_error(lineno, line, cptr); bp = get_name(); if (bp->class == TERM) terminal_start(bp->name); if (goal && goal != bp) restarted_warning(); goal = bp; } static void read_declarations(void) { int c, k; cache_size = CACHE_SIZE; cache = TMALLOC(char, cache_size); NO_SPACE(cache); for (;;) { c = nextc(); if (c == EOF) unexpected_EOF(); if (c != '%') syntax_error(lineno, line, cptr); switch (k = keyword()) { case MARK: return; case IDENT: copy_ident(); break; case TEXT: copy_text(); break; case UNION: copy_union(); break; case TOKEN: case LEFT: case RIGHT: case NONASSOC: declare_tokens(k); break; case EXPECT: case EXPECT_RR: declare_expect(k); break; case TYPE: declare_types(); break; case START: declare_start(); break; case PURE_PARSER: pure_parser = 1; break; case PARSE_PARAM: case LEX_PARAM: copy_param(k); break; case TOKEN_TABLE: token_table = 1; break; case ERROR_VERBOSE: error_verbose = 1; break; #if defined(YYBTYACC) case LOCATIONS: locations = 1; break; case DESTRUCTOR: destructor = 1; copy_destructor(); break; case INITIAL_ACTION: copy_initial_action(); break; #endif case XXXDEBUG: /* XXX: FIXME */ break; case POSIX_YACC: /* noop for bison compatibility. byacc is already designed to be posix * yacc compatible. */ break; } } } static void initialize_grammar(void) { nitems = 4; maxitems = 300; pitem = TMALLOC(bucket *, maxitems); NO_SPACE(pitem); pitem[0] = 0; pitem[1] = 0; pitem[2] = 0; pitem[3] = 0; nrules = 3; maxrules = 100; plhs = TMALLOC(bucket *, maxrules); NO_SPACE(plhs); plhs[0] = 0; plhs[1] = 0; plhs[2] = 0; rprec = TMALLOC(Value_t, maxrules); NO_SPACE(rprec); rprec[0] = 0; rprec[1] = 0; rprec[2] = 0; rassoc = TMALLOC(Assoc_t, maxrules); NO_SPACE(rassoc); rassoc[0] = TOKEN; rassoc[1] = TOKEN; rassoc[2] = TOKEN; } static void expand_items(void) { maxitems += 300; pitem = TREALLOC(bucket *, pitem, maxitems); NO_SPACE(pitem); } static void expand_rules(void) { maxrules += 100; plhs = TREALLOC(bucket *, plhs, maxrules); NO_SPACE(plhs); rprec = TREALLOC(Value_t, rprec, maxrules); NO_SPACE(rprec); rassoc = TREALLOC(Assoc_t, rassoc, maxrules); NO_SPACE(rassoc); } /* set immediately prior to where copy_args() could be called, and incremented by the various routines that will rescan the argument list as appropriate */ static int rescan_lineno; #if defined(YYBTYACC) static char * copy_args(int *alen) { struct mstring *s = msnew(); int depth = 0, len = 1; char c, quote = 0; struct ainfo a; a.a_lineno = lineno; a.a_line = dup_line(); a.a_cptr = a.a_line + (cptr - line - 1); while ((c = *cptr++) != R_PAREN || depth || quote) { if (c == ',' && !quote && !depth) { len++; mputc(s, 0); continue; } mputc(s, c); if (c == '\n') { get_line(); if (!line) { if (quote) unterminated_string(&a); else unterminated_arglist(&a); } } else if (quote) { if (c == quote) quote = 0; else if (c == '\\') { if (*cptr != '\n') mputc(s, *cptr++); } } else { if (c == L_PAREN) depth++; else if (c == R_PAREN) depth--; else if (c == '\"' || c == '\'') quote = c; } } if (alen) *alen = len; FREE(a.a_line); return msdone(s); } static char * parse_id(char *p, char **save) { char *b; while (isspace(UCH(*p))) if (*p++ == '\n') rescan_lineno++; if (!isalpha(UCH(*p)) && *p != '_') return NULL; b = p; while (isalnum(UCH(*p)) || *p == '_' || *p == '$') p++; if (save) { *save = cache_tag(b, (size_t) (p - b)); } return p; } static char * parse_int(char *p, int *save) { int neg = 0, val = 0; while (isspace(UCH(*p))) if (*p++ == '\n') rescan_lineno++; if (*p == '-') { neg = 1; p++; } if (!isdigit(UCH(*p))) return NULL; while (isdigit(UCH(*p))) val = val * 10 + *p++ - '0'; if (neg) val = -val; if (save) *save = val; return p; } static void parse_arginfo(bucket *a, char *args, int argslen) { char *p = args, *tmp; int i, redec = 0; if (a->args >= 0) { if (a->args != argslen) arg_number_disagree_warning(rescan_lineno, a->name); redec = 1; } else { if ((a->args = argslen) == 0) return; a->argnames = TMALLOC(char *, argslen); NO_SPACE(a->argnames); a->argtags = TMALLOC(char *, argslen); NO_SPACE(a->argtags); } if (!args) return; for (i = 0; i < argslen; i++) { while (isspace(UCH(*p))) if (*p++ == '\n') rescan_lineno++; if (*p++ != '$') bad_formals(); while (isspace(UCH(*p))) if (*p++ == '\n') rescan_lineno++; if (*p == '<') { havetags = 1; if (!(p = parse_id(p + 1, &tmp))) bad_formals(); while (isspace(UCH(*p))) if (*p++ == '\n') rescan_lineno++; if (*p++ != '>') bad_formals(); if (redec) { if (a->argtags[i] != tmp) arg_type_disagree_warning(rescan_lineno, i + 1, a->name); } else a->argtags[i] = tmp; } else if (!redec) a->argtags[i] = NULL; if (!(p = parse_id(p, &a->argnames[i]))) bad_formals(); while (isspace(UCH(*p))) if (*p++ == '\n') rescan_lineno++; if (*p++) bad_formals(); } free(args); } static char * compile_arg(char **theptr, char *yyvaltag) { char *p = *theptr; struct mstring *c = msnew(); int i, j, n; Value_t *offsets = NULL, maxoffset; bucket **rhs; maxoffset = 0; n = 0; for (i = nitems - 1; pitem[i]; --i) { n++; if (pitem[i]->class != ARGUMENT) maxoffset++; } if (maxoffset > 0) { offsets = TMALLOC(Value_t, maxoffset + 1); NO_SPACE(offsets); for (j = 0, i++; i < nitems; i++) if (pitem[i]->class != ARGUMENT) offsets[++j] = (Value_t)(i - nitems + 1); } rhs = pitem + nitems - 1; if (yyvaltag) msprintf(c, "yyval.%s = ", yyvaltag); else msprintf(c, "yyval = "); while (*p) { if (*p == '$') { char *tag = NULL; if (*++p == '<') if (!(p = parse_id(++p, &tag)) || *p++ != '>') illegal_tag(rescan_lineno, NULL, NULL); if (isdigit(UCH(*p)) || *p == '-') { int val; if (!(p = parse_int(p, &val))) dollar_error(rescan_lineno, NULL, NULL); if (val <= 0) i = val - n; else if (val > maxoffset) { dollar_warning(rescan_lineno, val); i = val - maxoffset; } else if (maxoffset > 0) { i = offsets[val]; if (!tag && !(tag = rhs[i]->tag) && havetags) untyped_rhs(val, rhs[i]->name); } msprintf(c, "yystack.l_mark[%d]", i); if (tag) msprintf(c, ".%s", tag); else if (havetags) unknown_rhs(val); } else if (isalpha(UCH(*p)) || *p == '_') { char *arg; if (!(p = parse_id(p, &arg))) dollar_error(rescan_lineno, NULL, NULL); for (i = plhs[nrules]->args - 1; i >= 0; i--) if (arg == plhs[nrules]->argnames[i]) break; if (i < 0) unknown_arg_warning(rescan_lineno, "$", arg, NULL, NULL); else if (!tag) tag = plhs[nrules]->argtags[i]; msprintf(c, "yystack.l_mark[%d]", i - plhs[nrules]->args + 1 - n); if (tag) msprintf(c, ".%s", tag); else if (havetags) untyped_arg_warning(rescan_lineno, "$", arg); } else dollar_error(rescan_lineno, NULL, NULL); } else if (*p == '@') { at_error(rescan_lineno, NULL, NULL); } else { if (*p == '\n') rescan_lineno++; mputc(c, *p++); } } *theptr = p; if (maxoffset > 0) FREE(offsets); return msdone(c); } static int can_elide_arg(char **theptr, char *yyvaltag) { char *p = *theptr; int rv = 0; int i, j, n = 0; Value_t *offsets = NULL, maxoffset = 0; bucket **rhs; char *tag = 0; if (*p++ != '$') return 0; if (*p == '<') { if (!(p = parse_id(++p, &tag)) || *p++ != '>') return 0; } for (i = nitems - 1; pitem[i]; --i) { n++; if (pitem[i]->class != ARGUMENT) maxoffset++; } if (maxoffset > 0) { offsets = TMALLOC(Value_t, maxoffset + 1); NO_SPACE(offsets); for (j = 0, i++; i < nitems; i++) if (pitem[i]->class != ARGUMENT) offsets[++j] = (Value_t)(i - nitems + 1); } rhs = pitem + nitems - 1; if (isdigit(UCH(*p)) || *p == '-') { int val; if (!(p = parse_int(p, &val))) rv = 0; else { if (val <= 0) rv = 1 - val + n; else if (val > maxoffset) rv = 0; else { i = offsets[val]; rv = 1 - i; if (!tag) tag = rhs[i]->tag; } } } else if (isalpha(UCH(*p)) || *p == '_') { char *arg; if (!(p = parse_id(p, &arg))) return 0; for (i = plhs[nrules]->args - 1; i >= 0; i--) if (arg == plhs[nrules]->argnames[i]) break; if (i >= 0) { if (!tag) tag = plhs[nrules]->argtags[i]; rv = plhs[nrules]->args + n - i; } } if (tag && yyvaltag) { if (strcmp(tag, yyvaltag)) rv = 0; } else if (tag || yyvaltag) rv = 0; if (maxoffset > 0) FREE(offsets); if (*p || rv <= 0) return 0; *theptr = p + 1; return rv; } #define ARG_CACHE_SIZE 1024 static struct arg_cache { struct arg_cache *next; char *code; int rule; } *arg_cache[ARG_CACHE_SIZE]; static int lookup_arg_cache(char *code) { struct arg_cache *entry; entry = arg_cache[strnshash(code) % ARG_CACHE_SIZE]; while (entry) { if (!strnscmp(entry->code, code)) return entry->rule; entry = entry->next; } return -1; } static void insert_arg_cache(char *code, int rule) { struct arg_cache *entry = NEW(struct arg_cache); int i; NO_SPACE(entry); i = strnshash(code) % ARG_CACHE_SIZE; entry->code = code; entry->rule = rule; entry->next = arg_cache[i]; arg_cache[i] = entry; } static void clean_arg_cache(void) { struct arg_cache *e, *t; int i; for (i = 0; i < ARG_CACHE_SIZE; i++) { for (e = arg_cache[i]; (t = e); e = e->next, FREE(t)) free(e->code); arg_cache[i] = NULL; } } #endif /* defined(YYBTYACC) */ static void advance_to_start(void) { int c; bucket *bp; char *s_cptr; int s_lineno; #if defined(YYBTYACC) char *args = NULL; int argslen = 0; #endif for (;;) { c = nextc(); if (c != '%') break; s_cptr = cptr; switch (keyword()) { case MARK: no_grammar(); case TEXT: copy_text(); break; case START: declare_start(); break; default: syntax_error(lineno, line, s_cptr); } } c = nextc(); if (!isalpha(c) && c != '_' && c != '.' && c != '_') syntax_error(lineno, line, cptr); bp = get_name(); if (goal == 0) { if (bp->class == TERM) terminal_start(bp->name); goal = bp; } s_lineno = lineno; c = nextc(); if (c == EOF) unexpected_EOF(); rescan_lineno = lineno; /* line# for possible inherited args rescan */ #if defined(YYBTYACC) if (c == L_PAREN) { ++cptr; args = copy_args(&argslen); NO_SPACE(args); c = nextc(); } #endif if (c != ':') syntax_error(lineno, line, cptr); start_rule(bp, s_lineno); #if defined(YYBTYACC) parse_arginfo(bp, args, argslen); #endif ++cptr; } static void start_rule(bucket *bp, int s_lineno) { if (bp->class == TERM) terminal_lhs(s_lineno); bp->class = NONTERM; if (!bp->index) bp->index = nrules; if (nrules >= maxrules) expand_rules(); plhs[nrules] = bp; rprec[nrules] = UNDEFINED; rassoc[nrules] = TOKEN; } static void end_rule(void) { int i; if (!last_was_action && plhs[nrules]->tag) { if (pitem[nitems - 1]) { for (i = nitems - 1; (i > 0) && pitem[i]; --i) continue; if (pitem[i + 1] == 0 || pitem[i + 1]->tag != plhs[nrules]->tag) default_action_warning(plhs[nrules]->name); } else default_action_warning(plhs[nrules]->name); } last_was_action = 0; if (nitems >= maxitems) expand_items(); pitem[nitems] = 0; ++nitems; ++nrules; } static void insert_empty_rule(void) { bucket *bp, **bpp; assert(cache); assert(cache_size >= CACHE_SIZE); sprintf(cache, "$$%d", ++gensym); bp = make_bucket(cache); last_symbol->next = bp; last_symbol = bp; bp->tag = plhs[nrules]->tag; bp->class = ACTION; #if defined(YYBTYACC) bp->args = 0; #endif nitems = (Value_t)(nitems + 2); if (nitems > maxitems) expand_items(); bpp = pitem + nitems - 1; *bpp-- = bp; while ((bpp[0] = bpp[-1]) != 0) --bpp; if (++nrules >= maxrules) expand_rules(); plhs[nrules] = plhs[nrules - 1]; plhs[nrules - 1] = bp; rprec[nrules] = rprec[nrules - 1]; rprec[nrules - 1] = 0; rassoc[nrules] = rassoc[nrules - 1]; rassoc[nrules - 1] = TOKEN; } #if defined(YYBTYACC) static char * insert_arg_rule(char *arg, char *tag) { int line_number = rescan_lineno; char *code = compile_arg(&arg, tag); int rule = lookup_arg_cache(code); FILE *f = action_file; if (rule < 0) { rule = nrules; insert_arg_cache(code, rule); trialaction = 1; /* arg rules always run in trial mode */ fprintf(f, "case %d:\n", rule - 2); if (!lflag) fprintf(f, line_format, line_number, input_file_name); fprintf(f, "%s;\n", code); fprintf(f, "break;\n"); insert_empty_rule(); plhs[rule]->tag = cache_tag(tag, strlen(tag)); plhs[rule]->class = ARGUMENT; } else { if (++nitems > maxitems) expand_items(); pitem[nitems - 1] = plhs[rule]; free(code); } return arg + 1; } #endif static void add_symbol(void) { int c; bucket *bp; int s_lineno = lineno; #if defined(YYBTYACC) char *args = NULL; int argslen = 0; #endif c = *cptr; if (c == '\'' || c == '"') bp = get_literal(); else bp = get_name(); c = nextc(); rescan_lineno = lineno; /* line# for possible inherited args rescan */ #if defined(YYBTYACC) if (c == L_PAREN) { ++cptr; args = copy_args(&argslen); NO_SPACE(args); c = nextc(); } #endif if (c == ':') { end_rule(); start_rule(bp, s_lineno); #if defined(YYBTYACC) parse_arginfo(bp, args, argslen); #endif ++cptr; return; } if (last_was_action) insert_empty_rule(); last_was_action = 0; #if defined(YYBTYACC) if (bp->args < 0) bp->args = argslen; if (argslen == 0 && bp->args > 0 && pitem[nitems - 1] == NULL) { int i; if (plhs[nrules]->args != bp->args) wrong_number_args_warning("default ", bp->name); for (i = bp->args - 1; i >= 0; i--) if (plhs[nrules]->argtags[i] != bp->argtags[i]) wrong_type_for_arg_warning(i + 1, bp->name); } else if (bp->args != argslen) wrong_number_args_warning("", bp->name); if (args != 0) { char *ap = args; int i = 0; int elide_cnt = can_elide_arg(&ap, bp->argtags[0]); if (elide_cnt > argslen) elide_cnt = 0; if (elide_cnt) { for (i = 1; i < elide_cnt; i++) if (can_elide_arg(&ap, bp->argtags[i]) != elide_cnt - i) { elide_cnt = 0; break; } } if (elide_cnt) { assert(i == elide_cnt); } else { ap = args; i = 0; } for (; i < argslen; i++) ap = insert_arg_rule(ap, bp->argtags[i]); free(args); } #endif /* defined(YYBTYACC) */ if (++nitems > maxitems) expand_items(); pitem[nitems - 1] = bp; } static void copy_action(void) { int c; int i, j, n; int depth; #if defined(YYBTYACC) int haveyyval = 0; #endif char *tag; FILE *f = action_file; struct ainfo a; Value_t *offsets = NULL, maxoffset; bucket **rhs; a.a_lineno = lineno; a.a_line = dup_line(); a.a_cptr = a.a_line + (cptr - line); if (last_was_action) insert_empty_rule(); last_was_action = 1; #if defined(YYBTYACC) trialaction = (*cptr == L_BRAC); #endif fprintf(f, "case %d:\n", nrules - 2); #if defined(YYBTYACC) if (backtrack) { if (!trialaction) fprintf(f, " if (!yytrial)\n"); } #endif if (!lflag) fprintf(f, line_format, lineno, input_file_name); if (*cptr == '=') ++cptr; /* avoid putting curly-braces in first column, to ease editing */ if (*after_blanks(cptr) == L_CURL) { putc('\t', f); cptr = after_blanks(cptr); } maxoffset = 0; n = 0; for (i = nitems - 1; pitem[i]; --i) { ++n; if (pitem[i]->class != ARGUMENT) maxoffset++; } if (maxoffset > 0) { offsets = TMALLOC(Value_t, maxoffset + 1); NO_SPACE(offsets); for (j = 0, i++; i < nitems; i++) { if (pitem[i]->class != ARGUMENT) { offsets[++j] = (Value_t)(i - nitems + 1); } } } rhs = pitem + nitems - 1; depth = 0; loop: c = *cptr; if (c == '$') { if (cptr[1] == '<') { int d_lineno = lineno; char *d_line = dup_line(); char *d_cptr = d_line + (cptr - line); ++cptr; tag = get_tag(); c = *cptr; if (c == '$') { fprintf(f, "yyval.%s", tag); ++cptr; FREE(d_line); goto loop; } else if (isdigit(c)) { i = get_number(); if (i == 0) fprintf(f, "yystack.l_mark[%d].%s", -n, tag); else if (i > maxoffset) { dollar_warning(d_lineno, i); fprintf(f, "yystack.l_mark[%d].%s", i - maxoffset, tag); } else if (offsets) fprintf(f, "yystack.l_mark[%d].%s", offsets[i], tag); FREE(d_line); goto loop; } else if (c == '-' && isdigit(UCH(cptr[1]))) { ++cptr; i = -get_number() - n; fprintf(f, "yystack.l_mark[%d].%s", i, tag); FREE(d_line); goto loop; } #if defined(YYBTYACC) else if (isalpha(c) || c == '_') { char *arg = scan_id(); for (i = plhs[nrules]->args - 1; i >= 0; i--) if (arg == plhs[nrules]->argnames[i]) break; if (i < 0) unknown_arg_warning(d_lineno, "$", arg, d_line, d_cptr); fprintf(f, "yystack.l_mark[%d].%s", i - plhs[nrules]->args + 1 - n, tag); FREE(d_line); goto loop; } #endif else dollar_error(d_lineno, d_line, d_cptr); } else if (cptr[1] == '$') { if (havetags) { tag = plhs[nrules]->tag; if (tag == 0) untyped_lhs(); fprintf(f, "yyval.%s", tag); } else fprintf(f, "yyval"); cptr += 2; #if defined(YYBTYACC) haveyyval = 1; #endif goto loop; } else if (isdigit(UCH(cptr[1]))) { ++cptr; i = get_number(); if (havetags && offsets) { if (i <= 0 || i > maxoffset) unknown_rhs(i); tag = rhs[offsets[i]]->tag; if (tag == 0) untyped_rhs(i, rhs[offsets[i]]->name); fprintf(f, "yystack.l_mark[%d].%s", offsets[i], tag); } else { if (i == 0) fprintf(f, "yystack.l_mark[%d]", -n); else if (i > maxoffset) { dollar_warning(lineno, i); fprintf(f, "yystack.l_mark[%d]", i - maxoffset); } else if (offsets) fprintf(f, "yystack.l_mark[%d]", offsets[i]); } goto loop; } else if (cptr[1] == '-') { cptr += 2; i = get_number(); if (havetags) unknown_rhs(-i); fprintf(f, "yystack.l_mark[%d]", -i - n); goto loop; } #if defined(YYBTYACC) else if (isalpha(UCH(cptr[1])) || cptr[1] == '_') { char *arg; ++cptr; arg = scan_id(); for (i = plhs[nrules]->args - 1; i >= 0; i--) if (arg == plhs[nrules]->argnames[i]) break; if (i < 0) unknown_arg_warning(lineno, "$", arg, line, cptr); tag = (i < 0 ? NULL : plhs[nrules]->argtags[i]); fprintf(f, "yystack.l_mark[%d]", i - plhs[nrules]->args + 1 - n); if (tag) fprintf(f, ".%s", tag); else if (havetags) untyped_arg_warning(lineno, "$", arg); goto loop; } #endif } #if defined(YYBTYACC) if (c == '@') { if (!locations) { int l_lineno = lineno; char *l_line = dup_line(); char *l_cptr = l_line + (cptr - line); syntax_error(l_lineno, l_line, l_cptr); } if (cptr[1] == '$') { fprintf(f, "yyloc"); cptr += 2; goto loop; } else if (isdigit(UCH(cptr[1]))) { ++cptr; i = get_number(); if (i == 0) fprintf(f, "yystack.p_mark[%d]", -n); else if (i > maxoffset) { at_warning(lineno, i); fprintf(f, "yystack.p_mark[%d]", i - maxoffset); } else if (offsets) fprintf(f, "yystack.p_mark[%d]", offsets[i]); goto loop; } else if (cptr[1] == '-') { cptr += 2; i = get_number(); fprintf(f, "yystack.p_mark[%d]", -i - n); goto loop; } } #endif if (isalpha(c) || c == '_' || c == '$') { do { putc(c, f); c = *++cptr; } while (isalnum(c) || c == '_' || c == '$'); goto loop; } ++cptr; #if defined(YYBTYACC) if (backtrack) { if (trialaction && c == L_BRAC && depth == 0) { ++depth; putc(L_CURL, f); goto loop; } if (trialaction && c == R_BRAC && depth == 1) { --depth; putc(R_CURL, f); c = nextc(); if (c == L_BRAC && !haveyyval) { goto loop; } if (c == L_CURL && !haveyyval) { fprintf(f, " if (!yytrial)\n"); if (!lflag) fprintf(f, line_format, lineno, input_file_name); trialaction = 0; goto loop; } fprintf(f, "\nbreak;\n"); FREE(a.a_line); if (maxoffset > 0) FREE(offsets); return; } } #endif putc(c, f); switch (c) { case '\n': get_line(); if (line) goto loop; unterminated_action(&a); case ';': if (depth > 0) goto loop; fprintf(f, "\nbreak;\n"); free(a.a_line); if (maxoffset > 0) FREE(offsets); return; #if defined(YYBTYACC) case L_BRAC: if (backtrack) ++depth; goto loop; case R_BRAC: if (backtrack) --depth; goto loop; #endif case L_CURL: ++depth; goto loop; case R_CURL: if (--depth > 0) goto loop; #if defined(YYBTYACC) if (backtrack) { c = nextc(); if (c == L_BRAC && !haveyyval) { trialaction = 1; goto loop; } if (c == L_CURL && !haveyyval) { fprintf(f, " if (!yytrial)\n"); if (!lflag) fprintf(f, line_format, lineno, input_file_name); goto loop; } } #endif fprintf(f, "\nbreak;\n"); free(a.a_line); if (maxoffset > 0) FREE(offsets); return; case '\'': case '"': { char *s = copy_string(c); fputs(s, f); free(s); } goto loop; case '/': { char *s = copy_comment(); fputs(s, f); free(s); } goto loop; default: goto loop; } } #if defined(YYBTYACC) static char * get_code(struct ainfo *a, const char *loc) { int c; int depth; char *tag; struct mstring *code_mstr = msnew(); if (!lflag) msprintf(code_mstr, line_format, lineno, input_file_name); cptr = after_blanks(cptr); if (*cptr == L_CURL) /* avoid putting curly-braces in first column, to ease editing */ mputc(code_mstr, '\t'); else syntax_error(lineno, line, cptr); a->a_lineno = lineno; a->a_line = dup_line(); a->a_cptr = a->a_line + (cptr - line); depth = 0; loop: c = *cptr; if (c == '$') { if (cptr[1] == '<') { int d_lineno = lineno; char *d_line = dup_line(); char *d_cptr = d_line + (cptr - line); ++cptr; tag = get_tag(); c = *cptr; if (c == '$') { msprintf(code_mstr, "(*val).%s", tag); ++cptr; FREE(d_line); goto loop; } else dollar_error(d_lineno, d_line, d_cptr); } else if (cptr[1] == '$') { /* process '$$' later; replacement is context dependent */ msprintf(code_mstr, "$$"); cptr += 2; goto loop; } } if (c == '@' && cptr[1] == '$') { if (!locations) { int l_lineno = lineno; char *l_line = dup_line(); char *l_cptr = l_line + (cptr - line); syntax_error(l_lineno, l_line, l_cptr); } msprintf(code_mstr, "%s", loc); cptr += 2; goto loop; } if (isalpha(c) || c == '_' || c == '$') { do { mputc(code_mstr, c); c = *++cptr; } while (isalnum(c) || c == '_' || c == '$'); goto loop; } ++cptr; mputc(code_mstr, c); switch (c) { case '\n': get_line(); if (line) goto loop; unterminated_action(a); case L_CURL: ++depth; goto loop; case R_CURL: if (--depth > 0) goto loop; goto out; case '\'': case '"': { char *s = copy_string(c); msprintf(code_mstr, "%s", s); free(s); } goto loop; case '/': { char *s = copy_comment(); msprintf(code_mstr, "%s", s); free(s); } goto loop; default: goto loop; } out: return msdone(code_mstr); } static void copy_initial_action(void) { struct ainfo a; initial_action = get_code(&a, "yyloc"); free(a.a_line); } static void copy_destructor(void) { char *code_text; int c; struct ainfo a; bucket *bp; code_text = get_code(&a, "(*loc)"); for (;;) { c = nextc(); if (c == EOF) unexpected_EOF(); if (c == '<') { if (cptr[1] == '>') { /* "no semantic type" default destructor */ cptr += 2; if ((bp = default_destructor[UNTYPED_DEFAULT]) == NULL) { static char untyped_default[] = "<>"; bp = make_bucket("untyped default"); bp->tag = untyped_default; default_destructor[UNTYPED_DEFAULT] = bp; } if (bp->destructor != NULL) destructor_redeclared_warning(&a); else /* replace "$$" with "(*val)" in destructor code */ bp->destructor = process_destructor_XX(code_text, NULL); } else if (cptr[1] == '*' && cptr[2] == '>') { /* "no per-symbol or per-type" default destructor */ cptr += 3; if ((bp = default_destructor[TYPED_DEFAULT]) == NULL) { static char typed_default[] = "<*>"; bp = make_bucket("typed default"); bp->tag = typed_default; default_destructor[TYPED_DEFAULT] = bp; } if (bp->destructor != NULL) destructor_redeclared_warning(&a); else { /* postpone re-processing destructor $$s until end of grammar spec */ bp->destructor = TMALLOC(char, strlen(code_text) + 1); NO_SPACE(bp->destructor); strcpy(bp->destructor, code_text); } } else { /* "semantic type" default destructor */ char *tag = get_tag(); bp = lookup_type_destructor(tag); if (bp->destructor != NULL) destructor_redeclared_warning(&a); else /* replace "$$" with "(*val).tag" in destructor code */ bp->destructor = process_destructor_XX(code_text, tag); } } else if (isalpha(c) || c == '_' || c == '.' || c == '$') { /* "symbol" destructor */ bp = get_name(); if (bp->destructor != NULL) destructor_redeclared_warning(&a); else { /* postpone re-processing destructor $$s until end of grammar spec */ bp->destructor = TMALLOC(char, strlen(code_text) + 1); NO_SPACE(bp->destructor); strcpy(bp->destructor, code_text); } } else break; } free(a.a_line); free(code_text); } static char * process_destructor_XX(char *code, char *tag) { int c; int quote; int depth; struct mstring *new_code = msnew(); char *codeptr = code; depth = 0; loop: /* step thru code */ c = *codeptr; if (c == '$' && codeptr[1] == '$') { codeptr += 2; if (tag == NULL) msprintf(new_code, "(*val)"); else msprintf(new_code, "(*val).%s", tag); goto loop; } if (isalpha(c) || c == '_' || c == '$') { do { mputc(new_code, c); c = *++codeptr; } while (isalnum(c) || c == '_' || c == '$'); goto loop; } ++codeptr; mputc(new_code, c); switch (c) { case L_CURL: ++depth; goto loop; case R_CURL: if (--depth > 0) goto loop; return msdone(new_code); case '\'': case '"': quote = c; for (;;) { c = *codeptr++; mputc(new_code, c); if (c == quote) goto loop; if (c == '\\') { c = *codeptr++; mputc(new_code, c); } } case '/': c = *codeptr; if (c == '*') { mputc(new_code, c); ++codeptr; for (;;) { c = *codeptr++; mputc(new_code, c); if (c == '*' && *codeptr == '/') { mputc(new_code, '/'); ++codeptr; goto loop; } } } goto loop; default: goto loop; } } #endif /* defined(YYBTYACC) */ static int mark_symbol(void) { int c; bucket *bp = NULL; c = cptr[1]; if (c == '%' || c == '\\') { cptr += 2; return (1); } if (c == '=') cptr += 2; else if ((c == 'p' || c == 'P') && ((c = cptr[2]) == 'r' || c == 'R') && ((c = cptr[3]) == 'e' || c == 'E') && ((c = cptr[4]) == 'c' || c == 'C') && ((c = cptr[5], !IS_IDENT(c)))) cptr += 5; else syntax_error(lineno, line, cptr); c = nextc(); if (isalpha(c) || c == '_' || c == '.' || c == '$') bp = get_name(); else if (c == '\'' || c == '"') bp = get_literal(); else { syntax_error(lineno, line, cptr); /*NOTREACHED */ } if (rprec[nrules] != UNDEFINED && bp->prec != rprec[nrules]) prec_redeclared(); rprec[nrules] = bp->prec; rassoc[nrules] = bp->assoc; return (0); } static void read_grammar(void) { int c; initialize_grammar(); advance_to_start(); for (;;) { c = nextc(); if (c == EOF) break; if (isalpha(c) || c == '_' || c == '.' || c == '$' || c == '\'' || c == '"') add_symbol(); #if defined(YYBTYACC) else if (c == L_CURL || c == '=' || (backtrack && c == L_BRAC)) #else else if (c == L_CURL || c == '=') #endif copy_action(); else if (c == '|') { end_rule(); start_rule(plhs[nrules - 1], 0); ++cptr; } else if (c == '%') { if (mark_symbol()) break; } else syntax_error(lineno, line, cptr); } end_rule(); #if defined(YYBTYACC) if (goal->args > 0) start_requires_args(goal->name); #endif } static void free_tags(void) { int i; if (tag_table == 0) return; for (i = 0; i < ntags; ++i) { assert(tag_table[i]); FREE(tag_table[i]); } FREE(tag_table); } static void pack_names(void) { bucket *bp; char *p, *s, *t; name_pool_size = 13; /* 13 == sizeof("$end") + sizeof("$accept") */ for (bp = first_symbol; bp; bp = bp->next) name_pool_size += strlen(bp->name) + 1; name_pool = TMALLOC(char, name_pool_size); NO_SPACE(name_pool); strcpy(name_pool, "$accept"); strcpy(name_pool + 8, "$end"); t = name_pool + 13; for (bp = first_symbol; bp; bp = bp->next) { p = t; s = bp->name; while ((*t++ = *s++) != 0) continue; FREE(bp->name); bp->name = p; } } static void check_symbols(void) { bucket *bp; if (goal->class == UNKNOWN) undefined_goal(goal->name); for (bp = first_symbol; bp; bp = bp->next) { if (bp->class == UNKNOWN) { undefined_symbol_warning(bp->name); bp->class = TERM; } } } static void protect_string(char *src, char **des) { unsigned len; char *s; char *d; *des = src; if (src) { len = 1; s = src; while (*s) { if ('\\' == *s || '"' == *s) len++; s++; len++; } *des = d = TMALLOC(char, len); NO_SPACE(d); s = src; while (*s) { if ('\\' == *s || '"' == *s) *d++ = '\\'; *d++ = *s++; } *d = '\0'; } } static void pack_symbols(void) { bucket *bp; bucket **v; Value_t i, j, k, n; #if defined(YYBTYACC) Value_t max_tok_pval; #endif nsyms = 2; ntokens = 1; for (bp = first_symbol; bp; bp = bp->next) { ++nsyms; if (bp->class == TERM) ++ntokens; } start_symbol = (Value_t)ntokens; nvars = (Value_t)(nsyms - ntokens); symbol_name = TMALLOC(char *, nsyms); NO_SPACE(symbol_name); symbol_value = TMALLOC(Value_t, nsyms); NO_SPACE(symbol_value); symbol_prec = TMALLOC(Value_t, nsyms); NO_SPACE(symbol_prec); symbol_assoc = TMALLOC(char, nsyms); NO_SPACE(symbol_assoc); #if defined(YYBTYACC) symbol_pval = TMALLOC(Value_t, nsyms); NO_SPACE(symbol_pval); if (destructor) { symbol_destructor = CALLOC(sizeof(char *), nsyms); NO_SPACE(symbol_destructor); symbol_type_tag = CALLOC(sizeof(char *), nsyms); NO_SPACE(symbol_type_tag); } #endif v = TMALLOC(bucket *, nsyms); NO_SPACE(v); v[0] = 0; v[start_symbol] = 0; i = 1; j = (Value_t)(start_symbol + 1); for (bp = first_symbol; bp; bp = bp->next) { if (bp->class == TERM) v[i++] = bp; else v[j++] = bp; } assert(i == ntokens && j == nsyms); for (i = 1; i < ntokens; ++i) v[i]->index = i; goal->index = (Index_t)(start_symbol + 1); k = (Value_t)(start_symbol + 2); while (++i < nsyms) if (v[i] != goal) { v[i]->index = k; ++k; } goal->value = 0; k = 1; for (i = (Value_t)(start_symbol + 1); i < nsyms; ++i) { if (v[i] != goal) { v[i]->value = k; ++k; } } k = 0; for (i = 1; i < ntokens; ++i) { n = v[i]->value; if (n > 256) { for (j = k++; j > 0 && symbol_value[j - 1] > n; --j) symbol_value[j] = symbol_value[j - 1]; symbol_value[j] = n; } } assert(v[1] != 0); if (v[1]->value == UNDEFINED) v[1]->value = 256; j = 0; n = 257; for (i = 2; i < ntokens; ++i) { if (v[i]->value == UNDEFINED) { while (j < k && n == symbol_value[j]) { while (++j < k && n == symbol_value[j]) continue; ++n; } v[i]->value = n; ++n; } } symbol_name[0] = name_pool + 8; symbol_value[0] = 0; symbol_prec[0] = 0; symbol_assoc[0] = TOKEN; #if defined(YYBTYACC) symbol_pval[0] = 0; max_tok_pval = 0; #endif for (i = 1; i < ntokens; ++i) { symbol_name[i] = v[i]->name; symbol_value[i] = v[i]->value; symbol_prec[i] = v[i]->prec; symbol_assoc[i] = v[i]->assoc; #if defined(YYBTYACC) symbol_pval[i] = v[i]->value; if (symbol_pval[i] > max_tok_pval) max_tok_pval = symbol_pval[i]; if (destructor) { symbol_destructor[i] = v[i]->destructor; symbol_type_tag[i] = v[i]->tag; } #endif } symbol_name[start_symbol] = name_pool; symbol_value[start_symbol] = -1; symbol_prec[start_symbol] = 0; symbol_assoc[start_symbol] = TOKEN; #if defined(YYBTYACC) symbol_pval[start_symbol] = (Value_t)(max_tok_pval + 1); #endif for (++i; i < nsyms; ++i) { k = v[i]->index; symbol_name[k] = v[i]->name; symbol_value[k] = v[i]->value; symbol_prec[k] = v[i]->prec; symbol_assoc[k] = v[i]->assoc; #if defined(YYBTYACC) symbol_pval[k] = (Value_t)((max_tok_pval + 1) + v[i]->value + 1); if (destructor) { symbol_destructor[k] = v[i]->destructor; symbol_type_tag[k] = v[i]->tag; } #endif } if (gflag) { symbol_pname = TMALLOC(char *, nsyms); NO_SPACE(symbol_pname); for (i = 0; i < nsyms; ++i) protect_string(symbol_name[i], &(symbol_pname[i])); } FREE(v); } static void pack_grammar(void) { int i; Value_t j; Assoc_t assoc; Value_t prec2; ritem = TMALLOC(Value_t, nitems); NO_SPACE(ritem); rlhs = TMALLOC(Value_t, nrules); NO_SPACE(rlhs); rrhs = TMALLOC(Value_t, nrules + 1); NO_SPACE(rrhs); rprec = TREALLOC(Value_t, rprec, nrules); NO_SPACE(rprec); rassoc = TREALLOC(Assoc_t, rassoc, nrules); NO_SPACE(rassoc); ritem[0] = -1; ritem[1] = goal->index; ritem[2] = 0; ritem[3] = -2; rlhs[0] = 0; rlhs[1] = 0; rlhs[2] = start_symbol; rrhs[0] = 0; rrhs[1] = 0; rrhs[2] = 1; j = 4; for (i = 3; i < nrules; ++i) { #if defined(YYBTYACC) if (plhs[i]->args > 0) { if (plhs[i]->argnames) { FREE(plhs[i]->argnames); plhs[i]->argnames = NULL; } if (plhs[i]->argtags) { FREE(plhs[i]->argtags); plhs[i]->argtags = NULL; } } #endif /* defined(YYBTYACC) */ rlhs[i] = plhs[i]->index; rrhs[i] = j; assoc = TOKEN; prec2 = 0; while (pitem[j]) { ritem[j] = pitem[j]->index; if (pitem[j]->class == TERM) { prec2 = pitem[j]->prec; assoc = pitem[j]->assoc; } ++j; } ritem[j] = (Value_t)-i; ++j; if (rprec[i] == UNDEFINED) { rprec[i] = prec2; rassoc[i] = assoc; } } rrhs[i] = j; FREE(plhs); FREE(pitem); #if defined(YYBTYACC) clean_arg_cache(); #endif } static void print_grammar(void) { int i, k; size_t j, spacing = 0; FILE *f = verbose_file; if (!vflag) return; k = 1; for (i = 2; i < nrules; ++i) { if (rlhs[i] != rlhs[i - 1]) { if (i != 2) fprintf(f, "\n"); fprintf(f, "%4d %s :", i - 2, symbol_name[rlhs[i]]); spacing = strlen(symbol_name[rlhs[i]]) + 1; } else { fprintf(f, "%4d ", i - 2); j = spacing; while (j-- != 0) putc(' ', f); putc('|', f); } while (ritem[k] >= 0) { fprintf(f, " %s", symbol_name[ritem[k]]); ++k; } ++k; putc('\n', f); } } #if defined(YYBTYACC) static void finalize_destructors(void) { int i; bucket *bp; char *tag; for (i = 2; i < nsyms; ++i) { tag = symbol_type_tag[i]; if (symbol_destructor[i] == NULL) { if (tag == NULL) { /* use <> destructor, if there is one */ if ((bp = default_destructor[UNTYPED_DEFAULT]) != NULL) { symbol_destructor[i] = TMALLOC(char, strlen(bp->destructor) + 1); NO_SPACE(symbol_destructor[i]); strcpy(symbol_destructor[i], bp->destructor); } } else { /* use type destructor for this tag, if there is one */ bp = lookup_type_destructor(tag); if (bp->destructor != NULL) { symbol_destructor[i] = TMALLOC(char, strlen(bp->destructor) + 1); NO_SPACE(symbol_destructor[i]); strcpy(symbol_destructor[i], bp->destructor); } else { /* use <*> destructor, if there is one */ if ((bp = default_destructor[TYPED_DEFAULT]) != NULL) /* replace "$$" with "(*val).tag" in destructor code */ symbol_destructor[i] = process_destructor_XX(bp->destructor, tag); } } } else { /* replace "$$" with "(*val)[.tag]" in destructor code */ symbol_destructor[i] = process_destructor_XX(symbol_destructor[i], tag); } } /* 'symbol_type_tag[]' elements are freed by 'free_tags()' */ DO_FREE(symbol_type_tag); /* no longer needed */ if ((bp = default_destructor[UNTYPED_DEFAULT]) != NULL) { FREE(bp->name); /* 'bp->tag' is a static value, don't free */ FREE(bp->destructor); FREE(bp); } if ((bp = default_destructor[TYPED_DEFAULT]) != NULL) { FREE(bp->name); /* 'bp->tag' is a static value, don't free */ FREE(bp->destructor); FREE(bp); } if ((bp = default_destructor[TYPE_SPECIFIED]) != NULL) { bucket *p; for (; bp; bp = p) { p = bp->link; FREE(bp->name); /* 'bp->tag' freed by 'free_tags()' */ FREE(bp->destructor); FREE(bp); } } } #endif /* defined(YYBTYACC) */ void reader(void) { write_section(code_file, banner); create_symbol_table(); read_declarations(); read_grammar(); free_symbol_table(); pack_names(); check_symbols(); pack_symbols(); pack_grammar(); free_symbols(); print_grammar(); #if defined(YYBTYACC) if (destructor) finalize_destructors(); #endif free_tags(); } #ifdef NO_LEAKS static param * free_declarations(param *list) { while (list != 0) { param *next = list->next; free(list->type); free(list->name); free(list->type2); free(list); list = next; } return list; } void reader_leaks(void) { lex_param = free_declarations(lex_param); parse_param = free_declarations(parse_param); DO_FREE(line); DO_FREE(rrhs); DO_FREE(rlhs); DO_FREE(rprec); DO_FREE(ritem); DO_FREE(rassoc); DO_FREE(cache); DO_FREE(name_pool); DO_FREE(symbol_name); DO_FREE(symbol_prec); DO_FREE(symbol_assoc); DO_FREE(symbol_value); #if defined(YYBTYACC) DO_FREE(symbol_pval); DO_FREE(symbol_destructor); DO_FREE(symbol_type_tag); #endif } #endif Index: head/contrib/byacc/test/btyacc/expr.oxout.error =================================================================== --- head/contrib/byacc/test/btyacc/expr.oxout.error (nonexistent) +++ head/contrib/byacc/test/btyacc/expr.oxout.error (revision 313105) @@ -0,0 +1 @@ +YACC: w - line 6 of "expr.Y", the precedence of '*' has been redeclared Index: head/contrib/byacc/test/btyacc/expr.oxout.output =================================================================== --- head/contrib/byacc/test/btyacc/expr.oxout.output (nonexistent) +++ head/contrib/byacc/test/btyacc/expr.oxout.output (revision 313105) @@ -0,0 +1,227 @@ + 0 $accept : yyyAugNonterm $end + + 1 $$1 : + + 2 yyyAugNonterm : $$1 s + + 3 s : expr + + 4 expr : expr '*' expr + 5 | expr '+' expr + 6 | expr '/' expr + 7 | expr '-' expr + 8 | '(' expr ')' + 9 | ID + 10 | CONST + +state 0 + $accept : . yyyAugNonterm $end (0) + $$1 : . (1) + + . reduce 1 + + yyyAugNonterm goto 1 + $$1 goto 2 + + +state 1 + $accept : yyyAugNonterm . $end (0) + + $end accept + + +state 2 + yyyAugNonterm : $$1 . s (2) + + ID shift 3 + CONST shift 4 + '(' shift 5 + . error + + s goto 6 + expr goto 7 + + +state 3 + expr : ID . (9) + + . reduce 9 + + +state 4 + expr : CONST . (10) + + . reduce 10 + + +state 5 + expr : '(' . expr ')' (8) + + ID shift 3 + CONST shift 4 + '(' shift 5 + . error + + expr goto 8 + + +state 6 + yyyAugNonterm : $$1 s . (2) + + . reduce 2 + + +state 7 + s : expr . (3) + expr : expr . '*' expr (4) + expr : expr . '+' expr (5) + expr : expr . '/' expr (6) + expr : expr . '-' expr (7) + + '+' shift 9 + '-' shift 10 + '*' shift 11 + '/' shift 12 + $end reduce 3 + + +state 8 + expr : expr . '*' expr (4) + expr : expr . '+' expr (5) + expr : expr . '/' expr (6) + expr : expr . '-' expr (7) + expr : '(' expr . ')' (8) + + '+' shift 9 + '-' shift 10 + '*' shift 11 + '/' shift 12 + ')' shift 13 + . error + + +state 9 + expr : expr '+' . expr (5) + + ID shift 3 + CONST shift 4 + '(' shift 5 + . error + + expr goto 14 + + +state 10 + expr : expr '-' . expr (7) + + ID shift 3 + CONST shift 4 + '(' shift 5 + . error + + expr goto 15 + + +state 11 + expr : expr '*' . expr (4) + + ID shift 3 + CONST shift 4 + '(' shift 5 + . error + + expr goto 16 + + +state 12 + expr : expr '/' . expr (6) + + ID shift 3 + CONST shift 4 + '(' shift 5 + . error + + expr goto 17 + + +state 13 + expr : '(' expr ')' . (8) + + . reduce 8 + + +state 14 + expr : expr . '*' expr (4) + expr : expr . '+' expr (5) + expr : expr '+' expr . (5) + expr : expr . '/' expr (6) + expr : expr . '-' expr (7) + + '*' shift 11 + '/' shift 12 + $end reduce 5 + '+' reduce 5 + '-' reduce 5 + ')' reduce 5 + + +state 15 + expr : expr . '*' expr (4) + expr : expr . '+' expr (5) + expr : expr . '/' expr (6) + expr : expr . '-' expr (7) + expr : expr '-' expr . (7) + + '*' shift 11 + '/' shift 12 + $end reduce 7 + '+' reduce 7 + '-' reduce 7 + ')' reduce 7 + + +state 16 + expr : expr . '*' expr (4) + expr : expr '*' expr . (4) + expr : expr . '+' expr (5) + expr : expr . '/' expr (6) + expr : expr . '-' expr (7) + + . reduce 4 + + +state 17 + expr : expr . '*' expr (4) + expr : expr . '+' expr (5) + expr : expr . '/' expr (6) + expr : expr '/' expr . (6) + expr : expr . '-' expr (7) + + '*' shift 11 + $end reduce 6 + '+' reduce 6 + '-' reduce 6 + '/' reduce 6 + ')' reduce 6 + + +10 terminals, 5 nonterminals +11 grammar rules, 18 states + +grammar parser grammar +symbol# value# symbol + 0 0 $end + 1 256 error + 2 257 ID + 3 258 CONST + 4 43 '+' + 5 45 '-' + 6 42 '*' + 7 47 '/' + 8 40 '(' + 9 41 ')' + 10 259 $accept + 11 260 yyyAugNonterm + 12 261 s + 13 262 $$1 + 14 263 expr Index: head/contrib/byacc/test/btyacc/expr.oxout.tab.c =================================================================== --- head/contrib/byacc/test/btyacc/expr.oxout.tab.c (nonexistent) +++ head/contrib/byacc/test/btyacc/expr.oxout.tab.c (revision 313105) @@ -0,0 +1,2752 @@ +/* original parser id follows */ +/* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ +/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */ + +#define YYBYACC 1 +#define YYMAJOR 1 +#define YYMINOR 9 +#define YYCHECK "yyyymmdd" + +#define YYEMPTY (-1) +#define yyclearin (yychar = YYEMPTY) +#define yyerrok (yyerrflag = 0) +#define YYRECOVERING() (yyerrflag != 0) +#define YYENOMEM (-2) +#define YYEOF 0 +#undef YYBTYACC +#define YYBTYACC 0 +#define YYDEBUGSTR YYPREFIX "debug" + +#ifndef yyparse +#define yyparse expr.oxout_parse +#endif /* yyparse */ + +#ifndef yylex +#define yylex expr.oxout_lex +#endif /* yylex */ + +#ifndef yyerror +#define yyerror expr.oxout_error +#endif /* yyerror */ + +#ifndef yychar +#define yychar expr.oxout_char +#endif /* yychar */ + +#ifndef yyval +#define yyval expr.oxout_val +#endif /* yyval */ + +#ifndef yylval +#define yylval expr.oxout_lval +#endif /* yylval */ + +#ifndef yydebug +#define yydebug expr.oxout_debug +#endif /* yydebug */ + +#ifndef yynerrs +#define yynerrs expr.oxout_nerrs +#endif /* yynerrs */ + +#ifndef yyerrflag +#define yyerrflag expr.oxout_errflag +#endif /* yyerrflag */ + +#ifndef yylhs +#define yylhs expr.oxout_lhs +#endif /* yylhs */ + +#ifndef yylen +#define yylen expr.oxout_len +#endif /* yylen */ + +#ifndef yydefred +#define yydefred expr.oxout_defred +#endif /* yydefred */ + +#ifndef yystos +#define yystos expr.oxout_stos +#endif /* yystos */ + +#ifndef yydgoto +#define yydgoto expr.oxout_dgoto +#endif /* yydgoto */ + +#ifndef yysindex +#define yysindex expr.oxout_sindex +#endif /* yysindex */ + +#ifndef yyrindex +#define yyrindex expr.oxout_rindex +#endif /* yyrindex */ + +#ifndef yygindex +#define yygindex expr.oxout_gindex +#endif /* yygindex */ + +#ifndef yytable +#define yytable expr.oxout_table +#endif /* yytable */ + +#ifndef yycheck +#define yycheck expr.oxout_check +#endif /* yycheck */ + +#ifndef yyname +#define yyname expr.oxout_name +#endif /* yyname */ + +#ifndef yyrule +#define yyrule expr.oxout_rule +#endif /* yyrule */ + +#if YYBTYACC + +#ifndef yycindex +#define yycindex expr.oxout_cindex +#endif /* yycindex */ + +#ifndef yyctable +#define yyctable expr.oxout_ctable +#endif /* yyctable */ + +#endif /* YYBTYACC */ + +#define YYPREFIX "expr.oxout_" + +#define YYPURE 0 + +#line 5 "expr.oxout.y" +#include +#include +#line 8 "expr.Y" + +#include "expr.oxout.h" +#include + +extern int yylex(void); +extern void yyerror(const char *); +#line 27 "expr.oxout.y" +#include +#define yyyR USHRT_MAX +#ifdef YYSTYPE +#undef YYSTYPE_IS_DECLARED +#define YYSTYPE_IS_DECLARED 1 +#endif +#ifndef YYSTYPE_IS_DECLARED +#define YYSTYPE_IS_DECLARED 1 +#line 31 "expr.oxout.y" +typedef union { +struct yyyOxAttrbs { +struct yyyStackItem *yyyOxStackItem; +} yyyOxAttrbs; +} YYSTYPE; +#endif /* !YYSTYPE_IS_DECLARED */ +#line 38 "expr.oxout.y" +#include +#include + +static int yyyYok = 1; + +extern yyyFT yyyRCIL[]; + +void yyyExecuteRRsection(yyyGNT *rootNode); +void yyyYoxInit(void); +void yyyDecorate(void); +struct yyyOxAttrbs; /* hack required to compensate for 'msta' behavior */ +void yyyGenIntNode(long yyyProdNum, int yyyRHSlength, int yyyNattrbs, struct yyyOxAttrbs *yyval_OxAttrbs, ...); +void yyyAdjustINRC(long yyyProdNum, int yyyRHSlength, long startP, long stopP, struct yyyOxAttrbs *yyval_OxAttrbs, ...); +void yyyCheckUnsolvedInstTrav(yyyGNT *rootNode,long *nNZrc,long *cycleSum); +void yyyUnsolvedInstSearchTrav(yyyGNT *pNode); +void yyyUnsolvedInstSearchTravAux(yyyGNT *pNode); +void yyyabort(void); + +#line 166 "expr.oxout.tab.c" + +/* compatibility with bison */ +#ifdef YYPARSE_PARAM +/* compatibility with FreeBSD */ +# ifdef YYPARSE_PARAM_TYPE +# define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM) +# else +# define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM) +# endif +#else +# define YYPARSE_DECL() yyparse(void) +#endif + +/* Parameters sent to lex. */ +#ifdef YYLEX_PARAM +# define YYLEX_DECL() yylex(void *YYLEX_PARAM) +# define YYLEX yylex(YYLEX_PARAM) +#else +# define YYLEX_DECL() yylex(void) +# define YYLEX yylex() +#endif + +/* Parameters sent to yyerror. */ +#ifndef YYERROR_DECL +#define YYERROR_DECL() yyerror(const char *s) +#endif +#ifndef YYERROR_CALL +#define YYERROR_CALL(msg) yyerror(msg) +#endif + +extern int YYPARSE_DECL(); + +#define ID 257 +#define CONST 258 +#define YYERRCODE 256 +typedef short YYINT; +static const YYINT expr.oxout_lhs[] = { -1, + 2, 0, 1, 3, 3, 3, 3, 3, 3, 3, +}; +static const YYINT expr.oxout_len[] = { 2, + 0, 2, 1, 3, 3, 3, 3, 3, 1, 1, +}; +static const YYINT expr.oxout_defred[] = { 1, + 0, 0, 9, 10, 0, 2, 0, 0, 0, 0, + 0, 0, 8, 0, 0, 4, 0, +}; +#if defined(YYDESTRUCT_CALL) || defined(YYSTYPE_TOSTRING) +static const YYINT expr.oxout_stos[] = { 0, + 260, 262, 257, 258, 40, 261, 263, 263, 43, 45, + 42, 47, 41, 263, 263, 263, 263, +}; +#endif /* YYDESTRUCT_CALL || YYSTYPE_TOSTRING */ +static const YYINT expr.oxout_dgoto[] = { 1, + 6, 2, 7, +}; +static const YYINT expr.oxout_sindex[] = { 0, + 0, -40, 0, 0, -40, 0, -18, -24, -40, -40, + -40, -40, 0, -37, -37, 0, -39, +}; +static const YYINT expr.oxout_rindex[] = { 0, + 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, + 0, 0, 0, 2, 8, 0, 1, +}; +#if YYBTYACC +static const YYINT expr.oxout_cindex[] = { 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, +}; +#endif +static const YYINT expr.oxout_gindex[] = { 0, + 0, 0, 4, +}; +#define YYTABLESIZE 218 +static const YYINT expr.oxout_table[] = { 5, + 6, 5, 11, 0, 11, 3, 0, 7, 8, 12, + 0, 0, 14, 15, 16, 17, 13, 11, 9, 0, + 10, 0, 12, 11, 9, 0, 10, 0, 12, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 6, 5, 6, 5, 6, 5, 6, 7, 0, + 7, 0, 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 3, 4, +}; +static const YYINT expr.oxout_check[] = { 40, + 0, 0, 42, -1, 42, 0, -1, 0, 5, 47, + -1, -1, 9, 10, 11, 12, 41, 42, 43, -1, + 45, -1, 47, 42, 43, -1, 45, -1, 47, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 41, 41, 43, 43, 45, 45, 47, 41, -1, + 43, -1, 45, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 257, 258, +}; +#if YYBTYACC +static const YYINT expr.oxout_ctable[] = { -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, +}; +#endif +#define YYFINAL 1 +#ifndef YYDEBUG +#define YYDEBUG 0 +#endif +#define YYMAXTOKEN 258 +#define YYUNDFTOKEN 264 +#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a)) +#if YYDEBUG +static const char *const expr.oxout_name[] = { + +"$end",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,"'('","')'","'*'","'+'",0,"'-'",0,"'/'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"error","ID", +"CONST","$accept","yyyAugNonterm","s","$$1","expr","illegal-symbol", +}; +static const char *const expr.oxout_rule[] = { +"$accept : yyyAugNonterm", +"$$1 :", +"yyyAugNonterm : $$1 s", +"s : expr", +"expr : expr '*' expr", +"expr : expr '+' expr", +"expr : expr '/' expr", +"expr : expr '-' expr", +"expr : '(' expr ')'", +"expr : ID", +"expr : CONST", + +}; +#endif + +int yydebug; +int yynerrs; + +int yyerrflag; +int yychar; +YYSTYPE yyval; +YYSTYPE yylval; +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) +YYLTYPE yyloc; /* position returned by actions */ +YYLTYPE yylloc; /* position from the lexer */ +#endif + +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) +#ifndef YYLLOC_DEFAULT +#define YYLLOC_DEFAULT(loc, rhs, n) \ +do \ +{ \ + if (n == 0) \ + { \ + (loc).first_line = ((rhs)[-1]).last_line; \ + (loc).first_column = ((rhs)[-1]).last_column; \ + (loc).last_line = ((rhs)[-1]).last_line; \ + (loc).last_column = ((rhs)[-1]).last_column; \ + } \ + else \ + { \ + (loc).first_line = ((rhs)[ 0 ]).first_line; \ + (loc).first_column = ((rhs)[ 0 ]).first_column; \ + (loc).last_line = ((rhs)[n-1]).last_line; \ + (loc).last_column = ((rhs)[n-1]).last_column; \ + } \ +} while (0) +#endif /* YYLLOC_DEFAULT */ +#endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */ +#if YYBTYACC + +#ifndef YYLVQUEUEGROWTH +#define YYLVQUEUEGROWTH 32 +#endif +#endif /* YYBTYACC */ + +/* define the initial stack-sizes */ +#ifdef YYSTACKSIZE +#undef YYMAXDEPTH +#define YYMAXDEPTH YYSTACKSIZE +#else +#ifdef YYMAXDEPTH +#define YYSTACKSIZE YYMAXDEPTH +#else +#define YYSTACKSIZE 10000 +#define YYMAXDEPTH 10000 +#endif +#endif + +#ifndef YYINITSTACKSIZE +#define YYINITSTACKSIZE 200 +#endif + +typedef struct { + unsigned stacksize; + YYINT *s_base; + YYINT *s_mark; + YYINT *s_last; + YYSTYPE *l_base; + YYSTYPE *l_mark; +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + YYLTYPE *p_base; + YYLTYPE *p_mark; +#endif +} YYSTACKDATA; +#if YYBTYACC + +struct YYParseState_s +{ + struct YYParseState_s *save; /* Previously saved parser state */ + YYSTACKDATA yystack; /* saved parser stack */ + int state; /* saved parser state */ + int errflag; /* saved error recovery status */ + int lexeme; /* saved index of the conflict lexeme in the lexical queue */ + YYINT ctry; /* saved index in yyctable[] for this conflict */ +}; +typedef struct YYParseState_s YYParseState; +#endif /* YYBTYACC */ +/* variables for the parser stack */ +static YYSTACKDATA yystack; +#if YYBTYACC + +/* Current parser state */ +static YYParseState *yyps = 0; + +/* yypath != NULL: do the full parse, starting at *yypath parser state. */ +static YYParseState *yypath = 0; + +/* Base of the lexical value queue */ +static YYSTYPE *yylvals = 0; + +/* Current position at lexical value queue */ +static YYSTYPE *yylvp = 0; + +/* End position of lexical value queue */ +static YYSTYPE *yylve = 0; + +/* The last allocated position at the lexical value queue */ +static YYSTYPE *yylvlim = 0; + +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) +/* Base of the lexical position queue */ +static YYLTYPE *yylpsns = 0; + +/* Current position at lexical position queue */ +static YYLTYPE *yylpp = 0; + +/* End position of lexical position queue */ +static YYLTYPE *yylpe = 0; + +/* The last allocated position at the lexical position queue */ +static YYLTYPE *yylplim = 0; +#endif + +/* Current position at lexical token queue */ +static YYINT *yylexp = 0; + +static YYINT *yylexemes = 0; +#endif /* YYBTYACC */ +#line 53 "expr.Y" + + +int yyparse(void); + +int main() + {yyparse(); + } + + + +#line 138 "expr.oxout.y" +long yyySSALspaceSize = 20000; +long yyyRSmaxSize = 1000; +long yyyTravStackMaxSize = 2000; + +struct yyySolvedSAlistCell {yyyWAT attrbNum; + long next; + }; + +#define yyyLambdaSSAL 0 +long yyySSALCfreeList = yyyLambdaSSAL; +long yyyNewSSALC = 1; + +struct yyySolvedSAlistCell *yyySSALspace; + +long yyyNbytesStackStg; + + + +yyyFT yyyRCIL[1]; + +short yyyIIIEL[] = {0, +0,2,6,10,14,18,22,24, +}; + +long yyyIIEL[] = { +0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0, +1,1, +}; + +long yyyIEL[] = { +0,0,0, +}; + +yyyFT yyyEntL[1]; + +void yyyfatal(char *msg) +{fputs(msg,stderr);exit(-1);} + + + +#define yyySSALof 'S' +#define yyyRSof 'q' +#define yyyTSof 't' + + + +void yyyHandleOverflow(char which) + {char *msg1,*msg2; + long oldSize,newSize; + switch(which) + { + case yyySSALof : + msg1 = "SSAL overflow: "; + oldSize = yyySSALspaceSize; + break; + case yyyRSof : + msg1 = "ready set overflow: "; + oldSize = yyyRSmaxSize; + break; + case yyyTSof : + msg1 = "traversal stack overflow: "; + oldSize = yyyTravStackMaxSize; + break; + default :; + } + newSize = (3*oldSize)/2; + if (newSize < 100) newSize = 100; + fputs(msg1,stderr); + fprintf(stderr,"size was %ld.\n",oldSize); + msg2 = " Have to modify evaluator: -Y%c%ld.\n"; + fprintf(stderr,msg2,which,newSize); + exit(-1); + } + + + +void yyySignalEnts(yyyGNT *node,long startP,long stopP) + {yyyGNT *dumNode; + + while (startP < stopP) + { + if (!yyyEntL[startP]) dumNode = node; + else dumNode = (node->cL)[yyyEntL[startP]-1]; + if (!(--((dumNode->refCountList)[yyyEntL[startP+1]] + ) + ) + ) + { + if (++yyyRSTop == yyyAfterRS) + {yyyHandleOverflow(yyyRSof); + break; + } + yyyRSTop->node = dumNode; + yyyRSTop->whichSym = yyyEntL[startP]; + yyyRSTop->wa = yyyEntL[startP+1]; + } + startP += 2; + } + } + + + + + + +void yyySolveAndSignal() { +long yyyiDum,*yyypL; +int yyyws,yyywa; +yyyGNT *yyyRSTopN,*yyyRefN; +yyyParent yyyRSTopNp; + + +yyyRSTopNp = (yyyRSTopN = yyyRSTop->node)->parent; +yyyRefN= (yyyws = (yyyRSTop->whichSym))?yyyRSTopNp.noderef:yyyRSTopN; +yyywa = yyyRSTop->wa; +yyyRSTop--; +switch(yyyRefN->prodNum) { +case 1: /***yacc rule 1***/ + switch (yyyws) { + } +break; +case 2: /***yacc rule 2***/ + switch (yyyws) { + } +break; +case 3: /***yacc rule 3***/ + switch (yyyws) { + } +break; +case 4: /***yacc rule 4***/ + switch (yyyws) { + } +break; +case 5: /***yacc rule 5***/ + switch (yyyws) { + } +break; +case 6: /***yacc rule 6***/ + switch (yyyws) { + } +break; +case 7: /***yacc rule 7***/ + switch (yyyws) { + case 1: /**/ + switch (yyywa) { + } + break; + } +break; +case 8: /***yacc rule 8***/ + switch (yyyws) { + case 1: /**/ + switch (yyywa) { + } + break; + } +break; +} /* switch */ + +if (yyyws) /* the just-solved instance was inherited. */ + {if (yyyRSTopN->prodNum) + {yyyiDum = yyyIIEL[yyyIIIEL[yyyRSTopN->prodNum]] + yyywa; + yyySignalEnts(yyyRSTopN,yyyIEL[yyyiDum], + yyyIEL[yyyiDum+1] + ); + } + } + else /* the just-solved instance was synthesized. */ + {if (!(yyyRSTopN->parentIsStack)) /* node has a parent. */ + {yyyiDum = yyyIIEL[yyyIIIEL[yyyRSTopNp.noderef->prodNum] + + yyyRSTopN->whichSym + ] + + yyywa; + yyySignalEnts(yyyRSTopNp.noderef, + yyyIEL[yyyiDum], + yyyIEL[yyyiDum+1] + ); + } + else /* node is still on the stack--it has no parent yet. */ + {yyypL = &(yyyRSTopNp.stackref->solvedSAlist); + if (yyySSALCfreeList == yyyLambdaSSAL) + {yyySSALspace[yyyNewSSALC].next = *yyypL; + if ((*yyypL = yyyNewSSALC++) == yyySSALspaceSize) + yyyHandleOverflow(yyySSALof); + } + else + {yyyiDum = yyySSALCfreeList; + yyySSALCfreeList = yyySSALspace[yyySSALCfreeList].next; + yyySSALspace[yyyiDum].next = *yyypL; + *yyypL = yyyiDum; + } + yyySSALspace[*yyypL].attrbNum = yyywa; + } + } + +} /* yyySolveAndSignal */ + + + + + + +#define condStg unsigned int conds; +#define yyyClearConds {yyyTST->conds = 0;} +#define yyySetCond(n) {yyyTST->conds += (1<<(n));} +#define yyyCond(n) ((yyyTST->conds & (1<<(n)))?1:0) + + + +struct yyyTravStackItem {yyyGNT *node; + char isReady; + condStg + }; + + + +void yyyDoTraversals(yyyGNT *rootNode) +{struct yyyTravStackItem *yyyTravStack,*yyyTST,*yyyAfterTravStack; + yyyGNT *yyyTSTn,**yyyCLptr2; + int yyyi,yyyRL,yyyPass; + int i; + + if (!yyyYok) return; + if ((yyyTravStack = + ((struct yyyTravStackItem *) + calloc((size_t)yyyTravStackMaxSize, + (size_t)sizeof(struct yyyTravStackItem) + ) + ) + ) + == + (struct yyyTravStackItem *)NULL + ) + {fputs("malloc error in traversal stack allocation\n",stderr); + exit(-1); + } + +yyyAfterTravStack = yyyTravStack + yyyTravStackMaxSize; +yyyTravStack++; + + +for (yyyi=0; yyyi<2; yyyi++) { +yyyTST = yyyTravStack; +yyyTST->node = rootNode; +yyyTST->isReady = 0; +yyyClearConds + +while(yyyTST >= yyyTravStack) + {yyyTSTn = yyyTST->node; + if (yyyTST->isReady) + {yyyPass = 1; + goto yyyTravSwitch; +yyyTpop: + yyyTST--; + } + else + {yyyPass = 0; + goto yyyTravSwitch; +yyyTpush: + yyyTST->isReady = 1; + if (yyyTSTn->prodNum) + {if (yyyRL) + {yyyCLptr2 = yyyTSTn->cL; + i = yyyTSTn->cLlen; + while (i--) + {if (++yyyTST == yyyAfterTravStack) + yyyHandleOverflow(yyyTSof); + else + {yyyTST->node = *yyyCLptr2; + yyyTST->isReady = 0; + yyyClearConds + } + yyyCLptr2++; + } + } /* right to left */ + else /* left to right */ + {i = yyyTSTn->cLlen; + yyyCLptr2 = yyyTSTn->cL + i; + while (i--) + {yyyCLptr2--; + if (++yyyTST == yyyAfterTravStack) + yyyHandleOverflow(yyyTSof); + else + {yyyTST->node = *yyyCLptr2; + yyyTST->isReady = 0; + yyyClearConds + } + } + } /* left to right */ + } + } /* else */ + continue; +yyyTravSwitch: + switch(yyyTSTn->prodNum) { +case 1: + switch(yyyi) { + case 0: + switch(yyyPass) { + case 0: +yyyRL = 0;yyySetCond(0) + +if (! +#line 24 "expr.Y" + (1) +#line 444 "expr.oxout.y" +) yyySetCond(1) +yyySetCond(2) + + case 1: + +if (yyyCond(0) != yyyPass) { +#line 24 "expr.Y" + +#line 453 "expr.oxout.y" +} +if (yyyCond(1) != yyyPass) { +#line 24 "expr.Y" + printf("\n"); + +#line 459 "expr.oxout.y" +} +if (yyyCond(2) != yyyPass) { +#line 25 "expr.Y" + printf("prefix: "); + +#line 465 "expr.oxout.y" +} + break; + } + break; + case 1: + switch(yyyPass) { + case 0: +yyyRL = 0; +if ( +#line 23 "expr.Y" + (1) +#line 477 "expr.oxout.y" +) yyySetCond(2) + + case 1: + +if (yyyCond(0) != yyyPass) { +#line 22 "expr.Y" + printf("\n"); + +#line 486 "expr.oxout.y" +} +if (yyyCond(1) != yyyPass) { +#line 23 "expr.Y" + +#line 491 "expr.oxout.y" +} +if (yyyCond(2) != yyyPass) { +#line 23 "expr.Y" + printf("postfix: ")/* missing ; */ + +#line 497 "expr.oxout.y" +} + break; + } + break; + } + +break; +case 2: + switch(yyyi) { + case 0: + switch(yyyPass) { + case 0: +yyyRL = 0;yyySetCond(0) + + case 1: + +if (yyyCond(0) != yyyPass) { +#line 29 "expr.Y" + printf(" * "); + +#line 518 "expr.oxout.y" +} + break; + } + break; + case 1: + switch(yyyPass) { + case 0: +yyyRL = 0; + case 1: + +if (yyyCond(0) != yyyPass) { +#line 28 "expr.Y" + printf(" * "); + +#line 533 "expr.oxout.y" +} + break; + } + break; + } + +break; +case 3: + switch(yyyi) { + case 0: + switch(yyyPass) { + case 0: +yyyRL = 0;yyySetCond(0) + + case 1: + +if (yyyCond(0) != yyyPass) { +#line 32 "expr.Y" + printf(" + "); + +#line 554 "expr.oxout.y" +} + break; + } + break; + case 1: + switch(yyyPass) { + case 0: +yyyRL = 0; + case 1: + +if (yyyCond(0) != yyyPass) { +#line 33 "expr.Y" + printf(" + "); + +#line 569 "expr.oxout.y" +} + break; + } + break; + } + +break; +case 4: + switch(yyyi) { + case 0: + switch(yyyPass) { + case 0: +yyyRL = 0;yyySetCond(0) + + case 1: + +if (yyyCond(0) != yyyPass) { +#line 37 "expr.Y" + printf(" / "); + +#line 590 "expr.oxout.y" +} + break; + } + break; + case 1: + switch(yyyPass) { + case 0: +yyyRL = 0; + case 1: + +if (yyyCond(0) != yyyPass) { +#line 36 "expr.Y" + printf(" / "); + +#line 605 "expr.oxout.y" +} + break; + } + break; + } + +break; +case 5: + switch(yyyi) { + case 0: + switch(yyyPass) { + case 0: +yyyRL = 0;yyySetCond(0) + + case 1: + +if (yyyCond(0) != yyyPass) { +#line 41 "expr.Y" + printf(" - "); + +#line 626 "expr.oxout.y" +} + break; + } + break; + case 1: + switch(yyyPass) { + case 0: +yyyRL = 0; + case 1: + +if (yyyCond(0) != yyyPass) { +#line 40 "expr.Y" + printf(" - "); + +#line 641 "expr.oxout.y" +} + break; + } + break; + } + +break; +case 6: + switch(yyyi) { + case 0: + switch(yyyPass) { + case 0: +yyyRL = 0; + case 1: + + break; + } + break; + case 1: + switch(yyyPass) { + case 0: +yyyRL = 0; + case 1: + + break; + } + break; + } + +break; +case 7: + switch(yyyi) { + case 0: + switch(yyyPass) { + case 0: +yyyRL = 0;yyySetCond(0) + + case 1: + +if (yyyCond(0) != yyyPass) { +#line 46 "expr.Y" + printf(" %s ",yyyTSTn->cL[0]->yyyAttrbs.yyyAttrb1.lexeme); + +#line 685 "expr.oxout.y" +} + break; + } + break; + case 1: + switch(yyyPass) { + case 0: +yyyRL = 0; + case 1: + +if (yyyCond(0) != yyyPass) { +#line 45 "expr.Y" + printf(" %s ",yyyTSTn->cL[0]->yyyAttrbs.yyyAttrb1.lexeme); + +#line 700 "expr.oxout.y" +} + break; + } + break; + } + +break; +case 8: + switch(yyyi) { + case 0: + switch(yyyPass) { + case 0: +yyyRL = 0;yyySetCond(0) + + case 1: + +if (yyyCond(0) != yyyPass) { +#line 50 "expr.Y" + printf(" %s ",yyyTSTn->cL[0]->yyyAttrbs.yyyAttrb1.lexeme); + +#line 721 "expr.oxout.y" +} + break; + } + break; + case 1: + switch(yyyPass) { + case 0: +yyyRL = 0; + case 1: + +if (yyyCond(0) != yyyPass) { +#line 49 "expr.Y" + printf(" %s ",yyyTSTn->cL[0]->yyyAttrbs.yyyAttrb1.lexeme); + +#line 736 "expr.oxout.y" +} + break; + } + break; + } + +break; + } /* switch */ + if (yyyPass) goto yyyTpop; else goto yyyTpush; + } /* while */ + } /* for */ +} /* yyyDoTraversals */ + +void yyyExecuteRRsection(yyyGNT *rootNode) { + int yyyi; + long cycleSum = 0; + long nNZrc = 0; + + if (!yyyYok) return; + yyyCheckUnsolvedInstTrav(rootNode,&nNZrc,&cycleSum); + if (nNZrc) + { + fputs("\n\n\n**********\n",stderr); + fputs("cycle detected in completed parse tree",stderr); + fputs(" after decoration.\n",stderr); +#if CYCLE_VERBOSE + fprintf(stderr, + "number of unsolved attribute instances == %ld.\n", + nNZrc + ); + fprintf(stderr, + "total number of remaining dependencies == %ld.\n", + cycleSum + ); + fputs("average number of remaining dependencies\n",stderr); + fprintf(stderr," per unsolved instance == %f.\n", + ((float)(cycleSum)/(float)(nNZrc)) + ); +#endif + fprintf(stderr, + "searching parse tree for %ld unsolved instances:\n", + nNZrc + ); + yyyUnsolvedInstSearchTravAux(rootNode); + } + yyyDoTraversals(rootNode); +} /* yyyExecuteRRsection */ + + + +yyyWAT yyyLRCIL[2] = {0,0, +}; + + + +void yyyYoxInit(void) + { + static int yyyInitDone = 0; + if (yyyInitDone) return; + + if ((yyyRS = (struct yyyRSitem *) + calloc((size_t)(yyyRSmaxSize+1), (size_t)sizeof(struct yyyRSitem)) + ) + == + ((struct yyyRSitem *) NULL) + ) + yyyfatal("malloc error in ox ready set space allocation\n"); + yyyRS++; + yyyAfterRS = yyyRS + yyyRSmaxSize; + + + if ((yyySSALspace = (struct yyySolvedSAlistCell *) + calloc((size_t)(yyySSALspaceSize+1), (size_t)sizeof(struct yyySolvedSAlistCell)) + ) + == + ((struct yyySolvedSAlistCell *) NULL) + ) + yyyfatal("malloc error in stack solved list space allocation\n"); + yyyInitDone = 1; + + yyyRSTop = yyyRS - 1; + } /* yyyYoxInit */ + + + +void yyyDecorate(void) + { + while (yyyRSTop >= yyyRS) + yyySolveAndSignal(); + } + + + +void yyyGenIntNode(long yyyProdNum, int yyyRHSlength, int yyyNattrbs, struct yyyOxAttrbs *yyval_OxAttrbs, ...) + {yyyWST i; + yyySIT **yyyOxStackItem = &yyval_OxAttrbs->yyyOxStackItem; + yyyGNT *gnpDum; + va_list ap; + + *yyyOxStackItem = (yyySIT *) malloc((size_t)sizeof(yyySIT)); + if (*yyyOxStackItem == (yyySIT *) NULL) + yyyfatal("malloc error in ox yacc semantic stack space allocation\n"); + (*yyyOxStackItem)->node = + (yyyGNT *) malloc((size_t)sizeof(yyyGNT)); + if ((*yyyOxStackItem)->node == (yyyGNT *) NULL) + yyyfatal("malloc error in ox node space allocation\n"); + (*yyyOxStackItem)->solvedSAlist = yyyLambdaSSAL; + (*yyyOxStackItem)->node->parent.stackref = *yyyOxStackItem; + (*yyyOxStackItem)->node->parentIsStack = 1; + (*yyyOxStackItem)->node->cLlen = yyyRHSlength; + (*yyyOxStackItem)->node->cL = + (yyyGNT **) calloc((size_t)yyyRHSlength, (size_t)sizeof(yyyGNT *)); + if ((*yyyOxStackItem)->node->cL == (yyyGNT **) NULL) + yyyfatal("malloc error in ox child list space allocation\n"); + (*yyyOxStackItem)->node->refCountListLen = yyyNattrbs; + (*yyyOxStackItem)->node->refCountList = + (yyyRCT *) calloc((size_t)yyyNattrbs, (size_t)sizeof(yyyRCT)); + if ((*yyyOxStackItem)->node->refCountList == (yyyRCT *) NULL) + yyyfatal("malloc error in ox reference count list space allocation\n"); + (*yyyOxStackItem)->node->prodNum = yyyProdNum; + va_start(ap, yyval_OxAttrbs); + for (i=1;i<=yyyRHSlength;i++) + {yyySIT *yaccStDum = va_arg(ap,struct yyyOxAttrbs *)->yyyOxStackItem; + gnpDum = (*yyyOxStackItem)->node->cL[i-1] = yaccStDum->node; + gnpDum->whichSym = i; + gnpDum->parent.noderef = (*yyyOxStackItem)->node; + gnpDum->parentIsStack = 0; + } + va_end(ap); + } + + + +#define yyyDECORfREQ 50 + + + +void yyyAdjustINRC(long yyyProdNum, int yyyRHSlength, long startP, long stopP, struct yyyOxAttrbs *yyval_OxAttrbs, ...) + {yyyWST i; + yyySIT *yyyOxStackItem = yyval_OxAttrbs->yyyOxStackItem; + long SSALptr,SSALptrHead,*cPtrPtr; + long *pL; + yyyGNT *gnpDum; + long iTemp; + long nextP; + static unsigned short intNodeCount = yyyDECORfREQ; + va_list ap; + + nextP = startP; + while (nextP < stopP) + {if (yyyRCIL[nextP] == yyyR) + {(yyyOxStackItem->node->refCountList)[yyyRCIL[nextP+1]] = yyyRCIL[nextP+2]; + } + else + {(((yyyOxStackItem->node->cL)[yyyRCIL[nextP]])->refCountList)[yyyRCIL[nextP+1]] = yyyRCIL[nextP+2]; + } + nextP += 3; + } + pL = yyyIIEL + yyyIIIEL[yyyProdNum]; + va_start(ap, yyval_OxAttrbs); + for (i=1;i<=yyyRHSlength;i++) + {yyySIT *yaccStDum = va_arg(ap,struct yyyOxAttrbs *)->yyyOxStackItem; + pL++; + SSALptrHead = SSALptr = *(cPtrPtr = &(yaccStDum->solvedSAlist)); + if (SSALptr != yyyLambdaSSAL) + {*cPtrPtr = yyyLambdaSSAL; + do + { + iTemp = (*pL+yyySSALspace[SSALptr].attrbNum); + yyySignalEnts(yyyOxStackItem->node, + yyyIEL[iTemp], + yyyIEL[iTemp+1] + ); + SSALptr = *(cPtrPtr = &(yyySSALspace[SSALptr].next)); + } + while (SSALptr != yyyLambdaSSAL); + *cPtrPtr = yyySSALCfreeList; + yyySSALCfreeList = SSALptrHead; + } + } + va_end(ap); + nextP = startP + 2; + while (nextP < stopP) + {if (!yyyRCIL[nextP]) + {if (yyyRCIL[nextP-2] == yyyR) + {pL = &(yyyOxStackItem->solvedSAlist); + if (yyySSALCfreeList == yyyLambdaSSAL) + {yyySSALspace[yyyNewSSALC].next = *pL; + if ((*pL = yyyNewSSALC++) == yyySSALspaceSize) + yyyHandleOverflow(yyySSALof); + } + else + {iTemp = yyySSALCfreeList; + yyySSALCfreeList = yyySSALspace[yyySSALCfreeList].next; + yyySSALspace[iTemp].next = *pL; + *pL = iTemp; + } + yyySSALspace[*pL].attrbNum = yyyRCIL[nextP-1]; + } + else + {if ((gnpDum = (yyyOxStackItem->node->cL)[yyyRCIL[nextP-2]])->prodNum != 0) + { + iTemp = yyyIIEL[yyyIIIEL[gnpDum->prodNum]] + yyyRCIL[nextP-1]; + yyySignalEnts(gnpDum, + yyyIEL[iTemp], + yyyIEL[iTemp+1] + ); + } + } + } + nextP += 3; + } + if (!--intNodeCount) + {intNodeCount = yyyDECORfREQ; + yyyDecorate(); + } + } + + + +void yyyGenLeaf(int nAttrbs,int typeNum,long startP,long stopP,YYSTYPE *yylval) + {yyyRCT *rcPdum; + yyySIT **yyyOxStackItem = &yylval->yyyOxAttrbs.yyyOxStackItem; + (*yyyOxStackItem) = (yyySIT *) malloc((size_t)sizeof(yyySIT)); + if ((*yyyOxStackItem) == (yyySIT *) NULL) + yyyfatal("malloc error in ox yacc semantic stack space allocation\n"); + (*yyyOxStackItem)->node = + (yyyGNT *) malloc((size_t)sizeof(yyyGNT)) + ; + if ((*yyyOxStackItem)->node == (yyyGNT *) NULL) + yyyfatal("malloc error in ox node space allocation\n"); + (*yyyOxStackItem)->solvedSAlist = yyyLambdaSSAL; + (*yyyOxStackItem)->node->parent.stackref = *yyyOxStackItem; + (*yyyOxStackItem)->node->parentIsStack = 1; + (*yyyOxStackItem)->node->cLlen = 0; + (*yyyOxStackItem)->node->cL = (yyyGNT **)NULL; + (*yyyOxStackItem)->node->refCountListLen = nAttrbs; + rcPdum = (*yyyOxStackItem)->node->refCountList = + (yyyRCT *) calloc((size_t)nAttrbs, (size_t)sizeof(yyyRCT)); + if (rcPdum == (yyyRCT *) NULL) + yyyfatal("malloc error in ox reference count list space allocation\n"); + while (startP < stopP) rcPdum[yyyLRCIL[startP++]] = 0; + (*yyyOxStackItem)->node->prodNum = 0; + (*yyyOxStackItem)->node->whichSym = 0; + } + + + +void yyyabort(void) + {yyyYok = 0; + } + + + + + +#define yyyLastProdNum 8 + + +#define yyyNsorts 1 + + +int yyyProdsInd[] = { + 0, + 0, 2, 6, 10, 14, 18, 22, 24, + 26, +}; + + +int yyyProds[][2] = { +{ 116, 0},{ 462, 0},{ 462, 0},{ 462, 0},{ 412, 0}, +{ 462, 0},{ 462, 0},{ 462, 0},{ 420, 0},{ 462, 0}, +{ 462, 0},{ 462, 0},{ 452, 0},{ 462, 0},{ 462, 0}, +{ 462, 0},{ 436, 0},{ 462, 0},{ 462, 0},{ 396, 0}, +{ 462, 0},{ 404, 0},{ 462, 0},{ 619, 1},{ 462, 0}, +{ 567, 1}, +}; + + +int yyySortsInd[] = { + 0, + 0, + 1, +}; + + +int yyySorts[] = { + 413, +}; + + + +char *yyyStringTab[] = { +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,"s",0,0,0, +0,0,"y",0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,"LRpre",0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,"'('",0,0,0, +0,0,0,0,"')'", +0,0,0,0,0, +0,0,"'*'","lexeme",0, +0,0,0,0,0, +"'+'",0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,"'-'",0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,"'/'",0,0, +0,0,0,0,0, +0,0,"expr",0,0, +0,0,0,0,0, +0,0,0,0,0, +0,"printf",0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,"CONST","LRpost",0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,"ID", +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0, +}; + + + +#define yyySizeofProd(num) (yyyProdsInd[(num)+1] - yyyProdsInd[(num)]) + +#define yyyGSoccurStr(prodNum,symPos) \ + (yyyStringTab[yyyProds[yyyProdsInd[(prodNum)] + (symPos)][0]]) + +#define yyySizeofSort(num) (yyySortsInd[(num)+1] - yyySortsInd[(num)]) + +#define yyySortOf(prodNum,symPos) \ + (yyyProds[yyyProdsInd[(prodNum)] + (symPos)][1]) + +#define yyyAttrbStr(prodNum,symPos,attrbNum) \ + (yyyStringTab[yyySorts[yyySortsInd[yyySortOf(prodNum,symPos)] + \ + (attrbNum) \ + ] \ + ] \ + ) + + + +void yyyShowProd(int i) + {int j,nSyms; + + nSyms = yyySizeofProd(i); + for (j=0; j\n",stderr); + else + putc('\n',stderr); + } + } + } + + + +void yyyCheckNodeInstancesSolved(yyyGNT *np) + {int mysort,sortSize,i,prodNum,symPos,inTerminalNode; + int nUnsolvedInsts = 0; + + if (np->prodNum != 0) + {inTerminalNode = 0; + prodNum = np->prodNum; + symPos = 0; + } + else + {inTerminalNode = 1; + prodNum = np->parent.noderef->prodNum; + symPos = np->whichSym; + } + mysort = yyySortOf(prodNum,symPos); + sortSize = yyySizeofSort(mysort); + for (i=0; irefCountList)[i] != 0) nUnsolvedInsts += 1; + if (nUnsolvedInsts) + {fprintf(stderr, + "\nFound node that has %d unsolved attribute instance(s).\n", + nUnsolvedInsts + ); + fprintf(stderr,"Node is labeled \"%s\".\n", + yyyGSoccurStr(prodNum,symPos)); + if (inTerminalNode) + {fputs("Node is terminal. Its parent production is:\n ",stderr); + yyyShowProd(prodNum); + } + else + {fputs("Node is nonterminal. ",stderr); + if (!(np->parentIsStack)) + {fprintf(stderr, + "Node is %dth child in its parent production:\n ", + np->whichSym + ); + yyyShowProd(np->parent.noderef->prodNum); + } + fputs("Node is on left hand side of this production:\n ",stderr); + yyyShowProd(np->prodNum); + } + fputs("The following instances are unsolved:\n",stderr); + for (i=0; irefCountList)[i] != 0) + fprintf(stderr," %-16s still has %1d dependencies.\n", + yyyAttrbStr(prodNum,symPos,i),(np->refCountList)[i]); + } + } + + + +void yyyCheckUnsolvedInstTrav(yyyGNT *pNode,long *nNZrc,long *cycleSum) + {yyyGNT **yyyCLpdum; + yyyRCT *rcp; + int i; + + /* visit the refCountList of each node in the tree, and sum the non-zero refCounts */ + rcp = pNode->refCountList; + i = pNode->refCountListLen; + while (i--) + if (*rcp++) {*cycleSum += *(rcp - 1); (*nNZrc)++;} + yyyCLpdum = pNode->cL; + i = pNode->cLlen; + while (i--) + { + yyyCheckUnsolvedInstTrav(*yyyCLpdum,nNZrc,cycleSum); + yyyCLpdum++; + } + } + + + +void yyyUnsolvedInstSearchTravAux(yyyGNT *pNode) + {yyyGNT **yyyCLpdum; + int i; + + yyyCheckNodeInstancesSolved(pNode); + yyyCLpdum = pNode->cL; + i = pNode->cLlen; + while (i--) + { + yyyUnsolvedInstSearchTravAux(*yyyCLpdum); + yyyCLpdum++; + } + } + + + +void yyyUnsolvedInstSearchTrav(yyyGNT *pNode) + {yyyGNT **yyyCLpdum; + int i; + + yyyCLpdum = pNode->cL; + i = pNode->cLlen; + while (i--) + { + yyyUnsolvedInstSearchTravAux(*yyyCLpdum); + yyyCLpdum++; + } + } + + + +#line 1794 "expr.oxout.tab.c" + +/* For use in generated program */ +#define yydepth (int)(yystack.s_mark - yystack.s_base) +#if YYBTYACC +#define yytrial (yyps->save) +#endif /* YYBTYACC */ + +#if YYDEBUG +#include /* needed for printf */ +#endif + +#include /* needed for malloc, etc */ +#include /* needed for memset */ + +/* allocate initial stack or double stack size, up to YYMAXDEPTH */ +static int yygrowstack(YYSTACKDATA *data) +{ + int i; + unsigned newsize; + YYINT *newss; + YYSTYPE *newvs; +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + YYLTYPE *newps; +#endif + + if ((newsize = data->stacksize) == 0) + newsize = YYINITSTACKSIZE; + else if (newsize >= YYMAXDEPTH) + return YYENOMEM; + else if ((newsize *= 2) > YYMAXDEPTH) + newsize = YYMAXDEPTH; + + i = (int) (data->s_mark - data->s_base); + newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss)); + if (newss == 0) + return YYENOMEM; + + data->s_base = newss; + data->s_mark = newss + i; + + newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs)); + if (newvs == 0) + return YYENOMEM; + + data->l_base = newvs; + data->l_mark = newvs + i; + +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + newps = (YYLTYPE *)realloc(data->p_base, newsize * sizeof(*newps)); + if (newps == 0) + return YYENOMEM; + + data->p_base = newps; + data->p_mark = newps + i; +#endif + + data->stacksize = newsize; + data->s_last = data->s_base + newsize - 1; + +#if YYDEBUG + if (yydebug) + fprintf(stderr, "%sdebug: stack size increased to %d\n", YYPREFIX, newsize); +#endif + return 0; +} + +#if YYPURE || defined(YY_NO_LEAKS) +static void yyfreestack(YYSTACKDATA *data) +{ + free(data->s_base); + free(data->l_base); +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + free(data->p_base); +#endif + memset(data, 0, sizeof(*data)); +} +#else +#define yyfreestack(data) /* nothing */ +#endif /* YYPURE || defined(YY_NO_LEAKS) */ +#if YYBTYACC + +static YYParseState * +yyNewState(unsigned size) +{ + YYParseState *p = (YYParseState *) malloc(sizeof(YYParseState)); + if (p == NULL) return NULL; + + p->yystack.stacksize = size; + if (size == 0) + { + p->yystack.s_base = NULL; + p->yystack.l_base = NULL; +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + p->yystack.p_base = NULL; +#endif + return p; + } + p->yystack.s_base = (YYINT *) malloc(size * sizeof(YYINT)); + if (p->yystack.s_base == NULL) return NULL; + p->yystack.l_base = (YYSTYPE *) malloc(size * sizeof(YYSTYPE)); + if (p->yystack.l_base == NULL) return NULL; + memset(p->yystack.l_base, 0, size * sizeof(YYSTYPE)); +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + p->yystack.p_base = (YYLTYPE *) malloc(size * sizeof(YYLTYPE)); + if (p->yystack.p_base == NULL) return NULL; + memset(p->yystack.p_base, 0, size * sizeof(YYLTYPE)); +#endif + + return p; +} + +static void +yyFreeState(YYParseState *p) +{ + yyfreestack(&p->yystack); + free(p); +} +#endif /* YYBTYACC */ + +#define YYABORT goto yyabort +#define YYREJECT goto yyabort +#define YYACCEPT goto yyaccept +#define YYERROR goto yyerrlab +#if YYBTYACC +#define YYVALID do { if (yyps->save) goto yyvalid; } while(0) +#define YYVALID_NESTED do { if (yyps->save && \ + yyps->save->save == 0) goto yyvalid; } while(0) +#endif /* YYBTYACC */ + +int +YYPARSE_DECL() +{ + int yym, yyn, yystate, yyresult; +#if YYBTYACC + int yynewerrflag; + YYParseState *yyerrctx = NULL; +#endif /* YYBTYACC */ +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + YYLTYPE yyerror_loc_range[2]; /* position of error start & end */ +#endif +#if YYDEBUG + const char *yys; + + if ((yys = getenv("YYDEBUG")) != 0) + { + yyn = *yys; + if (yyn >= '0' && yyn <= '9') + yydebug = yyn - '0'; + } + if (yydebug) + fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); +#endif + +#if YYBTYACC + yyps = yyNewState(0); if (yyps == 0) goto yyenomem; + yyps->save = 0; +#endif /* YYBTYACC */ + yym = 0; + yyn = 0; + yynerrs = 0; + yyerrflag = 0; + yychar = YYEMPTY; + yystate = 0; + +#if YYPURE + memset(&yystack, 0, sizeof(yystack)); +#endif + + if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow; + yystack.s_mark = yystack.s_base; + yystack.l_mark = yystack.l_base; +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + yystack.p_mark = yystack.p_base; +#endif + yystate = 0; + *yystack.s_mark = 0; + +yyloop: + if ((yyn = yydefred[yystate]) != 0) goto yyreduce; + if (yychar < 0) + { +#if YYBTYACC + do { + if (yylvp < yylve) + { + /* we're currently re-reading tokens */ + yylval = *yylvp++; +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + yylloc = *yylpp++; +#endif + yychar = *yylexp++; + break; + } + if (yyps->save) + { + /* in trial mode; save scanner results for future parse attempts */ + if (yylvp == yylvlim) + { /* Enlarge lexical value queue */ + size_t p = (size_t) (yylvp - yylvals); + size_t s = (size_t) (yylvlim - yylvals); + + s += YYLVQUEUEGROWTH; + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; +#endif + yylvp = yylve = yylvals + p; + yylvlim = yylvals + s; +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + yylpp = yylpe = yylpsns + p; + yylplim = yylpsns + s; +#endif + yylexp = yylexemes + p; + } + *yylexp = (YYINT) YYLEX; + *yylvp++ = yylval; + yylve++; +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + *yylpp++ = yylloc; + yylpe++; +#endif + yychar = *yylexp++; + break; + } + /* normal operation, no conflict encountered */ +#endif /* YYBTYACC */ + yychar = YYLEX; +#if YYBTYACC + } while (0); +#endif /* YYBTYACC */ + if (yychar < 0) yychar = YYEOF; +#if YYDEBUG + if (yydebug) + { + if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN]; + fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)", + YYDEBUGSTR, yydepth, yystate, yychar, yys); +#ifdef YYSTYPE_TOSTRING +#if YYBTYACC + if (!yytrial) +#endif /* YYBTYACC */ + fprintf(stderr, " <%s>", YYSTYPE_TOSTRING(yychar, yylval)); +#endif + fputc('\n', stderr); + } +#endif + } +#if YYBTYACC + + /* Do we have a conflict? */ + if (((yyn = yycindex[yystate]) != 0) && (yyn += yychar) >= 0 && + yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar) + { + YYINT ctry; + + if (yypath) + { + YYParseState *save; +#if YYDEBUG + if (yydebug) + fprintf(stderr, "%s[%d]: CONFLICT in state %d: following successful trial parse\n", + YYDEBUGSTR, yydepth, yystate); +#endif + /* Switch to the next conflict context */ + save = yypath; + yypath = save->save; + save->save = NULL; + ctry = save->ctry; + if (save->state != yystate) YYABORT; + yyFreeState(save); + + } + else + { + + /* Unresolved conflict - start/continue trial parse */ + YYParseState *save; +#if YYDEBUG + if (yydebug) + { + fprintf(stderr, "%s[%d]: CONFLICT in state %d. ", YYDEBUGSTR, yydepth, yystate); + if (yyps->save) + fputs("ALREADY in conflict, continuing trial parse.\n", stderr); + else + fputs("Starting trial parse.\n", stderr); + } +#endif + save = yyNewState((unsigned)(yystack.s_mark - yystack.s_base + 1)); + if (save == NULL) goto yyenomem; + save->save = yyps->save; + save->state = yystate; + save->errflag = yyerrflag; + save->yystack.s_mark = save->yystack.s_base + (yystack.s_mark - yystack.s_base); + memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT)); + save->yystack.l_mark = save->yystack.l_base + (yystack.l_mark - yystack.l_base); + memcpy (save->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE)); +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + save->yystack.p_mark = save->yystack.p_base + (yystack.p_mark - yystack.p_base); + memcpy (save->yystack.p_base, yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE)); +#endif + ctry = yytable[yyn]; + if (yyctable[ctry] == -1) + { +#if YYDEBUG + if (yydebug && yychar >= YYEOF) + fprintf(stderr, "%s[%d]: backtracking 1 token\n", YYDEBUGSTR, yydepth); +#endif + ctry++; + } + save->ctry = ctry; + if (yyps->save == NULL) + { + /* If this is a first conflict in the stack, start saving lexemes */ + if (!yylexemes) + { + yylexemes = malloc((YYLVQUEUEGROWTH) * sizeof(YYINT)); + if (yylexemes == NULL) goto yyenomem; + yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE)); + if (yylvals == NULL) goto yyenomem; + yylvlim = yylvals + YYLVQUEUEGROWTH; +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + yylpsns = (YYLTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYLTYPE)); + if (yylpsns == NULL) goto yyenomem; + yylplim = yylpsns + YYLVQUEUEGROWTH; +#endif + } + if (yylvp == yylve) + { + yylvp = yylve = yylvals; +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + yylpp = yylpe = yylpsns; +#endif + yylexp = yylexemes; + if (yychar >= YYEOF) + { + *yylve++ = yylval; +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + *yylpe++ = yylloc; +#endif + *yylexp = (YYINT) yychar; + yychar = YYEMPTY; + } + } + } + if (yychar >= YYEOF) + { + yylvp--; +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + yylpp--; +#endif + yylexp--; + yychar = YYEMPTY; + } + save->lexeme = (int) (yylvp - yylvals); + yyps->save = save; + } + if (yytable[yyn] == ctry) + { +#if YYDEBUG + if (yydebug) + fprintf(stderr, "%s[%d]: state %d, shifting to state %d\n", + YYDEBUGSTR, yydepth, yystate, yyctable[ctry]); +#endif + if (yychar < 0) + { + yylvp++; +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + yylpp++; +#endif + yylexp++; + } + if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) + goto yyoverflow; + yystate = yyctable[ctry]; + *++yystack.s_mark = (YYINT) yystate; + *++yystack.l_mark = yylval; +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + *++yystack.p_mark = yylloc; +#endif + yychar = YYEMPTY; + if (yyerrflag > 0) --yyerrflag; + goto yyloop; + } + else + { + yyn = yyctable[ctry]; + goto yyreduce; + } + } /* End of code dealing with conflicts */ +#endif /* YYBTYACC */ + if (((yyn = yysindex[yystate]) != 0) && (yyn += yychar) >= 0 && + yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar) + { +#if YYDEBUG + if (yydebug) + fprintf(stderr, "%s[%d]: state %d, shifting to state %d\n", + YYDEBUGSTR, yydepth, yystate, yytable[yyn]); +#endif + if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow; + yystate = yytable[yyn]; + *++yystack.s_mark = yytable[yyn]; + *++yystack.l_mark = yylval; +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + *++yystack.p_mark = yylloc; +#endif + yychar = YYEMPTY; + if (yyerrflag > 0) --yyerrflag; + goto yyloop; + } + if (((yyn = yyrindex[yystate]) != 0) && (yyn += yychar) >= 0 && + yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar) + { + yyn = yytable[yyn]; + goto yyreduce; + } + if (yyerrflag != 0) goto yyinrecovery; +#if YYBTYACC + + yynewerrflag = 1; + goto yyerrhandler; + goto yyerrlab; /* redundant goto avoids 'unused label' warning */ + +yyerrlab: + /* explicit YYERROR from an action -- pop the rhs of the rule reduced + * before looking for error recovery */ + yystack.s_mark -= yym; + yystate = *yystack.s_mark; + yystack.l_mark -= yym; +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + yystack.p_mark -= yym; +#endif + + yynewerrflag = 0; +yyerrhandler: + while (yyps->save) + { + int ctry; + YYParseState *save = yyps->save; +#if YYDEBUG + if (yydebug) + fprintf(stderr, "%s[%d]: ERROR in state %d, CONFLICT BACKTRACKING to state %d, %d tokens\n", + YYDEBUGSTR, yydepth, yystate, yyps->save->state, + (int)(yylvp - yylvals - yyps->save->lexeme)); +#endif + /* Memorize most forward-looking error state in case it's really an error. */ + if (yyerrctx == NULL || yyerrctx->lexeme < yylvp - yylvals) + { + /* Free old saved error context state */ + if (yyerrctx) yyFreeState(yyerrctx); + /* Create and fill out new saved error context state */ + yyerrctx = yyNewState((unsigned)(yystack.s_mark - yystack.s_base + 1)); + if (yyerrctx == NULL) goto yyenomem; + yyerrctx->save = yyps->save; + yyerrctx->state = yystate; + yyerrctx->errflag = yyerrflag; + yyerrctx->yystack.s_mark = yyerrctx->yystack.s_base + (yystack.s_mark - yystack.s_base); + memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT)); + yyerrctx->yystack.l_mark = yyerrctx->yystack.l_base + (yystack.l_mark - yystack.l_base); + memcpy (yyerrctx->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE)); +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + yyerrctx->yystack.p_mark = yyerrctx->yystack.p_base + (yystack.p_mark - yystack.p_base); + memcpy (yyerrctx->yystack.p_base, yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE)); +#endif + yyerrctx->lexeme = (int) (yylvp - yylvals); + } + yylvp = yylvals + save->lexeme; +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + yylpp = yylpsns + save->lexeme; +#endif + yylexp = yylexemes + save->lexeme; + yychar = YYEMPTY; + yystack.s_mark = yystack.s_base + (save->yystack.s_mark - save->yystack.s_base); + memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT)); + yystack.l_mark = yystack.l_base + (save->yystack.l_mark - save->yystack.l_base); + memcpy (yystack.l_base, save->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE)); +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + yystack.p_mark = yystack.p_base + (save->yystack.p_mark - save->yystack.p_base); + memcpy (yystack.p_base, save->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE)); +#endif + ctry = ++save->ctry; + yystate = save->state; + /* We tried shift, try reduce now */ + if ((yyn = yyctable[ctry]) >= 0) goto yyreduce; + yyps->save = save->save; + save->save = NULL; + yyFreeState(save); + + /* Nothing left on the stack -- error */ + if (!yyps->save) + { +#if YYDEBUG + if (yydebug) + fprintf(stderr, "%sdebug[%d,trial]: trial parse FAILED, entering ERROR mode\n", + YYPREFIX, yydepth); +#endif + /* Restore state as it was in the most forward-advanced error */ + yylvp = yylvals + yyerrctx->lexeme; +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + yylpp = yylpsns + yyerrctx->lexeme; +#endif + yylexp = yylexemes + yyerrctx->lexeme; + yychar = yylexp[-1]; + yylval = yylvp[-1]; +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + yylloc = yylpp[-1]; +#endif + yystack.s_mark = yystack.s_base + (yyerrctx->yystack.s_mark - yyerrctx->yystack.s_base); + memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT)); + yystack.l_mark = yystack.l_base + (yyerrctx->yystack.l_mark - yyerrctx->yystack.l_base); + memcpy (yystack.l_base, yyerrctx->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE)); +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + yystack.p_mark = yystack.p_base + (yyerrctx->yystack.p_mark - yyerrctx->yystack.p_base); + memcpy (yystack.p_base, yyerrctx->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE)); +#endif + yystate = yyerrctx->state; + yyFreeState(yyerrctx); + yyerrctx = NULL; + } + yynewerrflag = 1; + } + if (yynewerrflag == 0) goto yyinrecovery; +#endif /* YYBTYACC */ + + YYERROR_CALL("syntax error"); +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + yyerror_loc_range[0] = yylloc; /* lookahead position is error start position */ +#endif + +#if !YYBTYACC + goto yyerrlab; /* redundant goto avoids 'unused label' warning */ +yyerrlab: +#endif + ++yynerrs; + +yyinrecovery: + if (yyerrflag < 3) + { + yyerrflag = 3; + for (;;) + { + if (((yyn = yysindex[*yystack.s_mark]) != 0) && (yyn += YYERRCODE) >= 0 && + yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) YYERRCODE) + { +#if YYDEBUG + if (yydebug) + fprintf(stderr, "%s[%d]: state %d, error recovery shifting to state %d\n", + YYDEBUGSTR, yydepth, *yystack.s_mark, yytable[yyn]); +#endif + if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow; + yystate = yytable[yyn]; + *++yystack.s_mark = yytable[yyn]; + *++yystack.l_mark = yylval; +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + /* lookahead position is error end position */ + yyerror_loc_range[1] = yylloc; + YYLLOC_DEFAULT(yyloc, yyerror_loc_range, 2); /* position of error span */ + *++yystack.p_mark = yyloc; +#endif + goto yyloop; + } + else + { +#if YYDEBUG + if (yydebug) + fprintf(stderr, "%s[%d]: error recovery discarding state %d\n", + YYDEBUGSTR, yydepth, *yystack.s_mark); +#endif + if (yystack.s_mark <= yystack.s_base) goto yyabort; +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + /* the current TOS position is the error start position */ + yyerror_loc_range[0] = *yystack.p_mark; +#endif +#if defined(YYDESTRUCT_CALL) +#if YYBTYACC + if (!yytrial) +#endif /* YYBTYACC */ +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + YYDESTRUCT_CALL("error: discarding state", + yystos[*yystack.s_mark], yystack.l_mark, yystack.p_mark); +#else + YYDESTRUCT_CALL("error: discarding state", + yystos[*yystack.s_mark], yystack.l_mark); +#endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */ +#endif /* defined(YYDESTRUCT_CALL) */ + --yystack.s_mark; + --yystack.l_mark; +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + --yystack.p_mark; +#endif + } + } + } + else + { + if (yychar == YYEOF) goto yyabort; +#if YYDEBUG + if (yydebug) + { + if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN]; + fprintf(stderr, "%s[%d]: state %d, error recovery discarding token %d (%s)\n", + YYDEBUGSTR, yydepth, yystate, yychar, yys); + } +#endif +#if defined(YYDESTRUCT_CALL) +#if YYBTYACC + if (!yytrial) +#endif /* YYBTYACC */ +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + YYDESTRUCT_CALL("error: discarding token", yychar, &yylval, &yylloc); +#else + YYDESTRUCT_CALL("error: discarding token", yychar, &yylval); +#endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */ +#endif /* defined(YYDESTRUCT_CALL) */ + yychar = YYEMPTY; + goto yyloop; + } + +yyreduce: + yym = yylen[yyn]; +#if YYDEBUG + if (yydebug) + { + fprintf(stderr, "%s[%d]: state %d, reducing by rule %d (%s)", + YYDEBUGSTR, yydepth, yystate, yyn, yyrule[yyn]); +#ifdef YYSTYPE_TOSTRING +#if YYBTYACC + if (!yytrial) +#endif /* YYBTYACC */ + if (yym > 0) + { + int i; + fputc('<', stderr); + for (i = yym; i > 0; i--) + { + if (i != yym) fputs(", ", stderr); + fputs(YYSTYPE_TOSTRING(yystos[yystack.s_mark[1-i]], + yystack.l_mark[1-i]), stderr); + } + fputc('>', stderr); + } +#endif + fputc('\n', stderr); + } +#endif + if (yym > 0) + yyval = yystack.l_mark[1-yym]; + else + memset(&yyval, 0, sizeof yyval); +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + + /* Perform position reduction */ + memset(&yyloc, 0, sizeof(yyloc)); +#if YYBTYACC + if (!yytrial) +#endif /* YYBTYACC */ + { + YYLLOC_DEFAULT(yyloc, &yystack.p_mark[1-yym], yym); + /* just in case YYERROR is invoked within the action, save + the start of the rhs as the error start position */ + yyerror_loc_range[0] = yystack.p_mark[1-yym]; + } +#endif + + switch (yyn) + { +case 1: +#line 64 "expr.oxout.y" + {yyyYoxInit();} +break; +case 2: +#line 66 "expr.oxout.y" + { + yyyDecorate(); yyyExecuteRRsection(yystack.l_mark[0].yyyOxAttrbs.yyyOxStackItem->node); + } +break; +case 3: +#line 73 "expr.oxout.y" + {if(yyyYok){ +yyyGenIntNode(1,1,0,&yyval.yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs); +yyyAdjustINRC(1,1,0,0,&yyval.yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs);}} +break; +case 4: +#line 80 "expr.oxout.y" + {if(yyyYok){ +yyyGenIntNode(2,3,0,&yyval.yyyOxAttrbs,&yystack.l_mark[-2].yyyOxAttrbs,&yystack.l_mark[-1].yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs); +yyyAdjustINRC(2,3,0,0,&yyval.yyyOxAttrbs,&yystack.l_mark[-2].yyyOxAttrbs,&yystack.l_mark[-1].yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs);}} +break; +case 5: +#line 87 "expr.oxout.y" + {if(yyyYok){ +yyyGenIntNode(3,3,0,&yyval.yyyOxAttrbs,&yystack.l_mark[-2].yyyOxAttrbs,&yystack.l_mark[-1].yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs); +yyyAdjustINRC(3,3,0,0,&yyval.yyyOxAttrbs,&yystack.l_mark[-2].yyyOxAttrbs,&yystack.l_mark[-1].yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs);}} +break; +case 6: +#line 94 "expr.oxout.y" + {if(yyyYok){ +yyyGenIntNode(4,3,0,&yyval.yyyOxAttrbs,&yystack.l_mark[-2].yyyOxAttrbs,&yystack.l_mark[-1].yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs); +yyyAdjustINRC(4,3,0,0,&yyval.yyyOxAttrbs,&yystack.l_mark[-2].yyyOxAttrbs,&yystack.l_mark[-1].yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs);}} +break; +case 7: +#line 101 "expr.oxout.y" + {if(yyyYok){ +yyyGenIntNode(5,3,0,&yyval.yyyOxAttrbs,&yystack.l_mark[-2].yyyOxAttrbs,&yystack.l_mark[-1].yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs); +yyyAdjustINRC(5,3,0,0,&yyval.yyyOxAttrbs,&yystack.l_mark[-2].yyyOxAttrbs,&yystack.l_mark[-1].yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs);}} +break; +case 8: +#line 108 "expr.oxout.y" + {if(yyyYok){ +yyyGenIntNode(6,3,0,&yyval.yyyOxAttrbs,&yystack.l_mark[-2].yyyOxAttrbs,&yystack.l_mark[-1].yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs); +yyyAdjustINRC(6,3,0,0,&yyval.yyyOxAttrbs,&yystack.l_mark[-2].yyyOxAttrbs,&yystack.l_mark[-1].yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs);}} +break; +case 9: +#line 114 "expr.oxout.y" + {if(yyyYok){ +yyyGenIntNode(7,1,0,&yyval.yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs); +yyyAdjustINRC(7,1,0,0,&yyval.yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs);}} +break; +case 10: +#line 121 "expr.oxout.y" + {if(yyyYok){ +yyyGenIntNode(8,1,0,&yyval.yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs); +yyyAdjustINRC(8,1,0,0,&yyval.yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs);}} +break; +#line 2519 "expr.oxout.tab.c" + default: + break; + } + yystack.s_mark -= yym; + yystate = *yystack.s_mark; + yystack.l_mark -= yym; +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + yystack.p_mark -= yym; +#endif + yym = yylhs[yyn]; + if (yystate == 0 && yym == 0) + { +#if YYDEBUG + if (yydebug) + { + fprintf(stderr, "%s[%d]: after reduction, ", YYDEBUGSTR, yydepth); +#ifdef YYSTYPE_TOSTRING +#if YYBTYACC + if (!yytrial) +#endif /* YYBTYACC */ + fprintf(stderr, "result is <%s>, ", YYSTYPE_TOSTRING(yystos[YYFINAL], yyval)); +#endif + fprintf(stderr, "shifting from state 0 to final state %d\n", YYFINAL); + } +#endif + yystate = YYFINAL; + *++yystack.s_mark = YYFINAL; + *++yystack.l_mark = yyval; +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + *++yystack.p_mark = yyloc; +#endif + if (yychar < 0) + { +#if YYBTYACC + do { + if (yylvp < yylve) + { + /* we're currently re-reading tokens */ + yylval = *yylvp++; +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + yylloc = *yylpp++; +#endif + yychar = *yylexp++; + break; + } + if (yyps->save) + { + /* in trial mode; save scanner results for future parse attempts */ + if (yylvp == yylvlim) + { /* Enlarge lexical value queue */ + size_t p = (size_t) (yylvp - yylvals); + size_t s = (size_t) (yylvlim - yylvals); + + s += YYLVQUEUEGROWTH; + if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) + goto yyenomem; + if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) + goto yyenomem; +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) + goto yyenomem; +#endif + yylvp = yylve = yylvals + p; + yylvlim = yylvals + s; +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + yylpp = yylpe = yylpsns + p; + yylplim = yylpsns + s; +#endif + yylexp = yylexemes + p; + } + *yylexp = (YYINT) YYLEX; + *yylvp++ = yylval; + yylve++; +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + *yylpp++ = yylloc; + yylpe++; +#endif + yychar = *yylexp++; + break; + } + /* normal operation, no conflict encountered */ +#endif /* YYBTYACC */ + yychar = YYLEX; +#if YYBTYACC + } while (0); +#endif /* YYBTYACC */ + if (yychar < 0) yychar = YYEOF; +#if YYDEBUG + if (yydebug) + { + if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN]; + fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)\n", + YYDEBUGSTR, yydepth, YYFINAL, yychar, yys); + } +#endif + } + if (yychar == YYEOF) goto yyaccept; + goto yyloop; + } + if (((yyn = yygindex[yym]) != 0) && (yyn += yystate) >= 0 && + yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yystate) + yystate = yytable[yyn]; + else + yystate = yydgoto[yym]; +#if YYDEBUG + if (yydebug) + { + fprintf(stderr, "%s[%d]: after reduction, ", YYDEBUGSTR, yydepth); +#ifdef YYSTYPE_TOSTRING +#if YYBTYACC + if (!yytrial) +#endif /* YYBTYACC */ + fprintf(stderr, "result is <%s>, ", YYSTYPE_TOSTRING(yystos[yystate], yyval)); +#endif + fprintf(stderr, "shifting from state %d to state %d\n", *yystack.s_mark, yystate); + } +#endif + if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow; + *++yystack.s_mark = (YYINT) yystate; + *++yystack.l_mark = yyval; +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + *++yystack.p_mark = yyloc; +#endif + goto yyloop; +#if YYBTYACC + + /* Reduction declares that this path is valid. Set yypath and do a full parse */ +yyvalid: + if (yypath) YYABORT; + while (yyps->save) + { + YYParseState *save = yyps->save; + yyps->save = save->save; + save->save = yypath; + yypath = save; + } +#if YYDEBUG + if (yydebug) + fprintf(stderr, "%s[%d]: state %d, CONFLICT trial successful, backtracking to state %d, %d tokens\n", + YYDEBUGSTR, yydepth, yystate, yypath->state, (int)(yylvp - yylvals - yypath->lexeme)); +#endif + if (yyerrctx) + { + yyFreeState(yyerrctx); + yyerrctx = NULL; + } + yylvp = yylvals + yypath->lexeme; +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + yylpp = yylpsns + yypath->lexeme; +#endif + yylexp = yylexemes + yypath->lexeme; + yychar = YYEMPTY; + yystack.s_mark = yystack.s_base + (yypath->yystack.s_mark - yypath->yystack.s_base); + memcpy (yystack.s_base, yypath->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT)); + yystack.l_mark = yystack.l_base + (yypath->yystack.l_mark - yypath->yystack.l_base); + memcpy (yystack.l_base, yypath->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE)); +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + yystack.p_mark = yystack.p_base + (yypath->yystack.p_mark - yypath->yystack.p_base); + memcpy (yystack.p_base, yypath->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE)); +#endif + yystate = yypath->state; + goto yyloop; +#endif /* YYBTYACC */ + +yyoverflow: + YYERROR_CALL("yacc stack overflow"); +#if YYBTYACC + goto yyabort_nomem; +yyenomem: + YYERROR_CALL("memory exhausted"); +yyabort_nomem: +#endif /* YYBTYACC */ + yyresult = 2; + goto yyreturn; + +yyabort: + yyresult = 1; + goto yyreturn; + +yyaccept: +#if YYBTYACC + if (yyps->save) goto yyvalid; +#endif /* YYBTYACC */ + yyresult = 0; + +yyreturn: +#if defined(YYDESTRUCT_CALL) + if (yychar != YYEOF && yychar != YYEMPTY) +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + YYDESTRUCT_CALL("cleanup: discarding token", yychar, &yylval, &yylloc); +#else + YYDESTRUCT_CALL("cleanup: discarding token", yychar, &yylval); +#endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */ + + { + YYSTYPE *pv; +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + YYLTYPE *pp; + + for (pv = yystack.l_base, pp = yystack.p_base; pv <= yystack.l_mark; ++pv, ++pp) + YYDESTRUCT_CALL("cleanup: discarding state", + yystos[*(yystack.s_base + (pv - yystack.l_base))], pv, pp); +#else + for (pv = yystack.l_base; pv <= yystack.l_mark; ++pv) + YYDESTRUCT_CALL("cleanup: discarding state", + yystos[*(yystack.s_base + (pv - yystack.l_base))], pv); +#endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */ + } +#endif /* defined(YYDESTRUCT_CALL) */ + +#if YYBTYACC + if (yyerrctx) + { + yyFreeState(yyerrctx); + yyerrctx = NULL; + } + while (yyps) + { + YYParseState *save = yyps; + yyps = save->save; + save->save = NULL; + yyFreeState(save); + } + while (yypath) + { + YYParseState *save = yypath; + yypath = save->save; + save->save = NULL; + yyFreeState(save); + } +#endif /* YYBTYACC */ + yyfreestack(&yystack); + return (yyresult); +} Property changes on: head/contrib/byacc/test/btyacc/expr.oxout.tab.c ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/contrib/byacc/test/btyacc/expr.oxout.tab.h =================================================================== --- head/contrib/byacc/test/btyacc/expr.oxout.tab.h (nonexistent) +++ head/contrib/byacc/test/btyacc/expr.oxout.tab.h (revision 313105) @@ -0,0 +1,20 @@ +#ifndef _expr.oxout__defines_h_ +#define _expr.oxout__defines_h_ + +#define ID 257 +#define CONST 258 +#ifdef YYSTYPE +#undef YYSTYPE_IS_DECLARED +#define YYSTYPE_IS_DECLARED 1 +#endif +#ifndef YYSTYPE_IS_DECLARED +#define YYSTYPE_IS_DECLARED 1 +typedef union { +struct yyyOxAttrbs { +struct yyyStackItem *yyyOxStackItem; +} yyyOxAttrbs; +} YYSTYPE; +#endif /* !YYSTYPE_IS_DECLARED */ +extern YYSTYPE expr.oxout_lval; + +#endif /* _expr.oxout__defines_h_ */ Property changes on: head/contrib/byacc/test/btyacc/expr.oxout.tab.h ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/contrib/byacc/test/expr.oxout.y =================================================================== --- head/contrib/byacc/test/expr.oxout.y (nonexistent) +++ head/contrib/byacc/test/expr.oxout.y (revision 313105) @@ -0,0 +1,1446 @@ +/* output from Ox version G1.04 */ +#line 1 "expr.Y" +#line 4 "expr.oxout.y" +%{ +#include +#include +%} +#line 1 "expr.Y" +/* Y-file for translation of infix expressions to prefix and postfix */ +%token ID CONST +%start yyyAugNonterm +%left '+' '-' +%left '*' '/' +%nonassoc '*' + +%{ +#include "expr.oxout.h" +#include + +extern int yylex(void); +extern void yyerror(const char *); +%} + +#line 25 "expr.oxout.y" + +%{ +#include +#define yyyR USHRT_MAX +%} +%type yyyAugNonterm +%union { +struct yyyOxAttrbs { +struct yyyStackItem *yyyOxStackItem; +} yyyOxAttrbs; +} + +%{ +#include +#include + +static int yyyYok = 1; + +extern yyyFT yyyRCIL[]; + +void yyyExecuteRRsection(yyyGNT *rootNode); +void yyyYoxInit(void); +void yyyDecorate(void); +struct yyyOxAttrbs; /* hack required to compensate for 'msta' behavior */ +void yyyGenIntNode(long yyyProdNum, int yyyRHSlength, int yyyNattrbs, struct yyyOxAttrbs *yyval_OxAttrbs, ...); +void yyyAdjustINRC(long yyyProdNum, int yyyRHSlength, long startP, long stopP, struct yyyOxAttrbs *yyval_OxAttrbs, ...); +void yyyCheckUnsolvedInstTrav(yyyGNT *rootNode,long *nNZrc,long *cycleSum); +void yyyUnsolvedInstSearchTrav(yyyGNT *pNode); +void yyyUnsolvedInstSearchTravAux(yyyGNT *pNode); +void yyyabort(void); + +%} + + +#line 20 "expr.Y" +%% + +#line 63 "expr.oxout.y" +yyyAugNonterm + : {yyyYoxInit();} + s + { + yyyDecorate(); yyyExecuteRRsection($2.yyyOxStackItem->node); + } + ; +#line 21 "expr.Y" +s : expr +#line 73 "expr.oxout.y" +{if(yyyYok){ +yyyGenIntNode(1,1,0,&$$,&$1); +yyyAdjustINRC(1,1,0,0,&$$,&$1);}} + +#line 27 "expr.Y" +expr : expr '*' expr +#line 80 "expr.oxout.y" +{if(yyyYok){ +yyyGenIntNode(2,3,0,&$$,&$1,&$2,&$3); +yyyAdjustINRC(2,3,0,0,&$$,&$1,&$2,&$3);}} + +#line 31 "expr.Y" + | expr '+' expr +#line 87 "expr.oxout.y" +{if(yyyYok){ +yyyGenIntNode(3,3,0,&$$,&$1,&$2,&$3); +yyyAdjustINRC(3,3,0,0,&$$,&$1,&$2,&$3);}} + +#line 35 "expr.Y" + | expr '/' expr +#line 94 "expr.oxout.y" +{if(yyyYok){ +yyyGenIntNode(4,3,0,&$$,&$1,&$2,&$3); +yyyAdjustINRC(4,3,0,0,&$$,&$1,&$2,&$3);}} + +#line 39 "expr.Y" + | expr '-' expr +#line 101 "expr.oxout.y" +{if(yyyYok){ +yyyGenIntNode(5,3,0,&$$,&$1,&$2,&$3); +yyyAdjustINRC(5,3,0,0,&$$,&$1,&$2,&$3);}} + +#line 43 "expr.Y" + | '(' expr ')' +#line 108 "expr.oxout.y" +{if(yyyYok){ +yyyGenIntNode(6,3,0,&$$,&$1,&$2,&$3); +yyyAdjustINRC(6,3,0,0,&$$,&$1,&$2,&$3);}} +#line 44 "expr.Y" + | ID +#line 114 "expr.oxout.y" +{if(yyyYok){ +yyyGenIntNode(7,1,0,&$$,&$1); +yyyAdjustINRC(7,1,0,0,&$$,&$1);}} + +#line 48 "expr.Y" + | CONST +#line 121 "expr.oxout.y" +{if(yyyYok){ +yyyGenIntNode(8,1,0,&$$,&$1); +yyyAdjustINRC(8,1,0,0,&$$,&$1);}} + +#line 52 "expr.Y" + ; +%% + +int yyparse(void); + +int main() + {yyparse(); + } + + + +#line 138 "expr.oxout.y" +long yyySSALspaceSize = 20000; +long yyyRSmaxSize = 1000; +long yyyTravStackMaxSize = 2000; + +struct yyySolvedSAlistCell {yyyWAT attrbNum; + long next; + }; + +#define yyyLambdaSSAL 0 +long yyySSALCfreeList = yyyLambdaSSAL; +long yyyNewSSALC = 1; + +struct yyySolvedSAlistCell *yyySSALspace; + +long yyyNbytesStackStg; + + + +yyyFT yyyRCIL[1]; + +short yyyIIIEL[] = {0, +0,2,6,10,14,18,22,24, +}; + +long yyyIIEL[] = { +0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0, +1,1, +}; + +long yyyIEL[] = { +0,0,0, +}; + +yyyFT yyyEntL[1]; + +void yyyfatal(char *msg) +{fputs(msg,stderr);exit(-1);} + + + +#define yyySSALof 'S' +#define yyyRSof 'q' +#define yyyTSof 't' + + + +void yyyHandleOverflow(char which) + {char *msg1,*msg2; + long oldSize,newSize; + switch(which) + { + case yyySSALof : + msg1 = "SSAL overflow: "; + oldSize = yyySSALspaceSize; + break; + case yyyRSof : + msg1 = "ready set overflow: "; + oldSize = yyyRSmaxSize; + break; + case yyyTSof : + msg1 = "traversal stack overflow: "; + oldSize = yyyTravStackMaxSize; + break; + default :; + } + newSize = (3*oldSize)/2; + if (newSize < 100) newSize = 100; + fputs(msg1,stderr); + fprintf(stderr,"size was %ld.\n",oldSize); + msg2 = " Have to modify evaluator: -Y%c%ld.\n"; + fprintf(stderr,msg2,which,newSize); + exit(-1); + } + + + +void yyySignalEnts(yyyGNT *node,long startP,long stopP) + {yyyGNT *dumNode; + + while (startP < stopP) + { + if (!yyyEntL[startP]) dumNode = node; + else dumNode = (node->cL)[yyyEntL[startP]-1]; + if (!(--((dumNode->refCountList)[yyyEntL[startP+1]] + ) + ) + ) + { + if (++yyyRSTop == yyyAfterRS) + {yyyHandleOverflow(yyyRSof); + break; + } + yyyRSTop->node = dumNode; + yyyRSTop->whichSym = yyyEntL[startP]; + yyyRSTop->wa = yyyEntL[startP+1]; + } + startP += 2; + } + } + + + + + + +void yyySolveAndSignal() { +long yyyiDum,*yyypL; +int yyyws,yyywa; +yyyGNT *yyyRSTopN,*yyyRefN; +yyyParent yyyRSTopNp; + + +yyyRSTopNp = (yyyRSTopN = yyyRSTop->node)->parent; +yyyRefN= (yyyws = (yyyRSTop->whichSym))?yyyRSTopNp.noderef:yyyRSTopN; +yyywa = yyyRSTop->wa; +yyyRSTop--; +switch(yyyRefN->prodNum) { +case 1: /***yacc rule 1***/ + switch (yyyws) { + } +break; +case 2: /***yacc rule 2***/ + switch (yyyws) { + } +break; +case 3: /***yacc rule 3***/ + switch (yyyws) { + } +break; +case 4: /***yacc rule 4***/ + switch (yyyws) { + } +break; +case 5: /***yacc rule 5***/ + switch (yyyws) { + } +break; +case 6: /***yacc rule 6***/ + switch (yyyws) { + } +break; +case 7: /***yacc rule 7***/ + switch (yyyws) { + case 1: /**/ + switch (yyywa) { + } + break; + } +break; +case 8: /***yacc rule 8***/ + switch (yyyws) { + case 1: /**/ + switch (yyywa) { + } + break; + } +break; +} /* switch */ + +if (yyyws) /* the just-solved instance was inherited. */ + {if (yyyRSTopN->prodNum) + {yyyiDum = yyyIIEL[yyyIIIEL[yyyRSTopN->prodNum]] + yyywa; + yyySignalEnts(yyyRSTopN,yyyIEL[yyyiDum], + yyyIEL[yyyiDum+1] + ); + } + } + else /* the just-solved instance was synthesized. */ + {if (!(yyyRSTopN->parentIsStack)) /* node has a parent. */ + {yyyiDum = yyyIIEL[yyyIIIEL[yyyRSTopNp.noderef->prodNum] + + yyyRSTopN->whichSym + ] + + yyywa; + yyySignalEnts(yyyRSTopNp.noderef, + yyyIEL[yyyiDum], + yyyIEL[yyyiDum+1] + ); + } + else /* node is still on the stack--it has no parent yet. */ + {yyypL = &(yyyRSTopNp.stackref->solvedSAlist); + if (yyySSALCfreeList == yyyLambdaSSAL) + {yyySSALspace[yyyNewSSALC].next = *yyypL; + if ((*yyypL = yyyNewSSALC++) == yyySSALspaceSize) + yyyHandleOverflow(yyySSALof); + } + else + {yyyiDum = yyySSALCfreeList; + yyySSALCfreeList = yyySSALspace[yyySSALCfreeList].next; + yyySSALspace[yyyiDum].next = *yyypL; + *yyypL = yyyiDum; + } + yyySSALspace[*yyypL].attrbNum = yyywa; + } + } + +} /* yyySolveAndSignal */ + + + + + + +#define condStg unsigned int conds; +#define yyyClearConds {yyyTST->conds = 0;} +#define yyySetCond(n) {yyyTST->conds += (1<<(n));} +#define yyyCond(n) ((yyyTST->conds & (1<<(n)))?1:0) + + + +struct yyyTravStackItem {yyyGNT *node; + char isReady; + condStg + }; + + + +void yyyDoTraversals(yyyGNT *rootNode) +{struct yyyTravStackItem *yyyTravStack,*yyyTST,*yyyAfterTravStack; + yyyGNT *yyyTSTn,**yyyCLptr2; + int yyyi,yyyRL,yyyPass; + int i; + + if (!yyyYok) return; + if ((yyyTravStack = + ((struct yyyTravStackItem *) + calloc((size_t)yyyTravStackMaxSize, + (size_t)sizeof(struct yyyTravStackItem) + ) + ) + ) + == + (struct yyyTravStackItem *)NULL + ) + {fputs("malloc error in traversal stack allocation\n",stderr); + exit(-1); + } + +yyyAfterTravStack = yyyTravStack + yyyTravStackMaxSize; +yyyTravStack++; + + +for (yyyi=0; yyyi<2; yyyi++) { +yyyTST = yyyTravStack; +yyyTST->node = rootNode; +yyyTST->isReady = 0; +yyyClearConds + +while(yyyTST >= yyyTravStack) + {yyyTSTn = yyyTST->node; + if (yyyTST->isReady) + {yyyPass = 1; + goto yyyTravSwitch; +yyyTpop: + yyyTST--; + } + else + {yyyPass = 0; + goto yyyTravSwitch; +yyyTpush: + yyyTST->isReady = 1; + if (yyyTSTn->prodNum) + {if (yyyRL) + {yyyCLptr2 = yyyTSTn->cL; + i = yyyTSTn->cLlen; + while (i--) + {if (++yyyTST == yyyAfterTravStack) + yyyHandleOverflow(yyyTSof); + else + {yyyTST->node = *yyyCLptr2; + yyyTST->isReady = 0; + yyyClearConds + } + yyyCLptr2++; + } + } /* right to left */ + else /* left to right */ + {i = yyyTSTn->cLlen; + yyyCLptr2 = yyyTSTn->cL + i; + while (i--) + {yyyCLptr2--; + if (++yyyTST == yyyAfterTravStack) + yyyHandleOverflow(yyyTSof); + else + {yyyTST->node = *yyyCLptr2; + yyyTST->isReady = 0; + yyyClearConds + } + } + } /* left to right */ + } + } /* else */ + continue; +yyyTravSwitch: + switch(yyyTSTn->prodNum) { +case 1: + switch(yyyi) { + case 0: + switch(yyyPass) { + case 0: +yyyRL = 0;yyySetCond(0) + +if (! +#line 24 "expr.Y" + (1) +#line 444 "expr.oxout.y" +) yyySetCond(1) +yyySetCond(2) + + case 1: + +if (yyyCond(0) != yyyPass) { +#line 24 "expr.Y" + +#line 453 "expr.oxout.y" +} +if (yyyCond(1) != yyyPass) { +#line 24 "expr.Y" + printf("\n"); + +#line 459 "expr.oxout.y" +} +if (yyyCond(2) != yyyPass) { +#line 25 "expr.Y" + printf("prefix: "); + +#line 465 "expr.oxout.y" +} + break; + } + break; + case 1: + switch(yyyPass) { + case 0: +yyyRL = 0; +if ( +#line 23 "expr.Y" + (1) +#line 477 "expr.oxout.y" +) yyySetCond(2) + + case 1: + +if (yyyCond(0) != yyyPass) { +#line 22 "expr.Y" + printf("\n"); + +#line 486 "expr.oxout.y" +} +if (yyyCond(1) != yyyPass) { +#line 23 "expr.Y" + +#line 491 "expr.oxout.y" +} +if (yyyCond(2) != yyyPass) { +#line 23 "expr.Y" + printf("postfix: ")/* missing ; */ + +#line 497 "expr.oxout.y" +} + break; + } + break; + } + +break; +case 2: + switch(yyyi) { + case 0: + switch(yyyPass) { + case 0: +yyyRL = 0;yyySetCond(0) + + case 1: + +if (yyyCond(0) != yyyPass) { +#line 29 "expr.Y" + printf(" * "); + +#line 518 "expr.oxout.y" +} + break; + } + break; + case 1: + switch(yyyPass) { + case 0: +yyyRL = 0; + case 1: + +if (yyyCond(0) != yyyPass) { +#line 28 "expr.Y" + printf(" * "); + +#line 533 "expr.oxout.y" +} + break; + } + break; + } + +break; +case 3: + switch(yyyi) { + case 0: + switch(yyyPass) { + case 0: +yyyRL = 0;yyySetCond(0) + + case 1: + +if (yyyCond(0) != yyyPass) { +#line 32 "expr.Y" + printf(" + "); + +#line 554 "expr.oxout.y" +} + break; + } + break; + case 1: + switch(yyyPass) { + case 0: +yyyRL = 0; + case 1: + +if (yyyCond(0) != yyyPass) { +#line 33 "expr.Y" + printf(" + "); + +#line 569 "expr.oxout.y" +} + break; + } + break; + } + +break; +case 4: + switch(yyyi) { + case 0: + switch(yyyPass) { + case 0: +yyyRL = 0;yyySetCond(0) + + case 1: + +if (yyyCond(0) != yyyPass) { +#line 37 "expr.Y" + printf(" / "); + +#line 590 "expr.oxout.y" +} + break; + } + break; + case 1: + switch(yyyPass) { + case 0: +yyyRL = 0; + case 1: + +if (yyyCond(0) != yyyPass) { +#line 36 "expr.Y" + printf(" / "); + +#line 605 "expr.oxout.y" +} + break; + } + break; + } + +break; +case 5: + switch(yyyi) { + case 0: + switch(yyyPass) { + case 0: +yyyRL = 0;yyySetCond(0) + + case 1: + +if (yyyCond(0) != yyyPass) { +#line 41 "expr.Y" + printf(" - "); + +#line 626 "expr.oxout.y" +} + break; + } + break; + case 1: + switch(yyyPass) { + case 0: +yyyRL = 0; + case 1: + +if (yyyCond(0) != yyyPass) { +#line 40 "expr.Y" + printf(" - "); + +#line 641 "expr.oxout.y" +} + break; + } + break; + } + +break; +case 6: + switch(yyyi) { + case 0: + switch(yyyPass) { + case 0: +yyyRL = 0; + case 1: + + break; + } + break; + case 1: + switch(yyyPass) { + case 0: +yyyRL = 0; + case 1: + + break; + } + break; + } + +break; +case 7: + switch(yyyi) { + case 0: + switch(yyyPass) { + case 0: +yyyRL = 0;yyySetCond(0) + + case 1: + +if (yyyCond(0) != yyyPass) { +#line 46 "expr.Y" + printf(" %s ",yyyTSTn->cL[0]->yyyAttrbs.yyyAttrb1.lexeme); + +#line 685 "expr.oxout.y" +} + break; + } + break; + case 1: + switch(yyyPass) { + case 0: +yyyRL = 0; + case 1: + +if (yyyCond(0) != yyyPass) { +#line 45 "expr.Y" + printf(" %s ",yyyTSTn->cL[0]->yyyAttrbs.yyyAttrb1.lexeme); + +#line 700 "expr.oxout.y" +} + break; + } + break; + } + +break; +case 8: + switch(yyyi) { + case 0: + switch(yyyPass) { + case 0: +yyyRL = 0;yyySetCond(0) + + case 1: + +if (yyyCond(0) != yyyPass) { +#line 50 "expr.Y" + printf(" %s ",yyyTSTn->cL[0]->yyyAttrbs.yyyAttrb1.lexeme); + +#line 721 "expr.oxout.y" +} + break; + } + break; + case 1: + switch(yyyPass) { + case 0: +yyyRL = 0; + case 1: + +if (yyyCond(0) != yyyPass) { +#line 49 "expr.Y" + printf(" %s ",yyyTSTn->cL[0]->yyyAttrbs.yyyAttrb1.lexeme); + +#line 736 "expr.oxout.y" +} + break; + } + break; + } + +break; + } /* switch */ + if (yyyPass) goto yyyTpop; else goto yyyTpush; + } /* while */ + } /* for */ +} /* yyyDoTraversals */ + +void yyyExecuteRRsection(yyyGNT *rootNode) { + int yyyi; + long cycleSum = 0; + long nNZrc = 0; + + if (!yyyYok) return; + yyyCheckUnsolvedInstTrav(rootNode,&nNZrc,&cycleSum); + if (nNZrc) + { + fputs("\n\n\n**********\n",stderr); + fputs("cycle detected in completed parse tree",stderr); + fputs(" after decoration.\n",stderr); +#if CYCLE_VERBOSE + fprintf(stderr, + "number of unsolved attribute instances == %ld.\n", + nNZrc + ); + fprintf(stderr, + "total number of remaining dependencies == %ld.\n", + cycleSum + ); + fputs("average number of remaining dependencies\n",stderr); + fprintf(stderr," per unsolved instance == %f.\n", + ((float)(cycleSum)/(float)(nNZrc)) + ); +#endif + fprintf(stderr, + "searching parse tree for %ld unsolved instances:\n", + nNZrc + ); + yyyUnsolvedInstSearchTravAux(rootNode); + } + yyyDoTraversals(rootNode); +} /* yyyExecuteRRsection */ + + + +yyyWAT yyyLRCIL[2] = {0,0, +}; + + + +void yyyYoxInit(void) + { + static int yyyInitDone = 0; + if (yyyInitDone) return; + + if ((yyyRS = (struct yyyRSitem *) + calloc((size_t)(yyyRSmaxSize+1), (size_t)sizeof(struct yyyRSitem)) + ) + == + ((struct yyyRSitem *) NULL) + ) + yyyfatal("malloc error in ox ready set space allocation\n"); + yyyRS++; + yyyAfterRS = yyyRS + yyyRSmaxSize; + + + if ((yyySSALspace = (struct yyySolvedSAlistCell *) + calloc((size_t)(yyySSALspaceSize+1), (size_t)sizeof(struct yyySolvedSAlistCell)) + ) + == + ((struct yyySolvedSAlistCell *) NULL) + ) + yyyfatal("malloc error in stack solved list space allocation\n"); + yyyInitDone = 1; + + yyyRSTop = yyyRS - 1; + } /* yyyYoxInit */ + + + +void yyyDecorate(void) + { + while (yyyRSTop >= yyyRS) + yyySolveAndSignal(); + } + + + +void yyyGenIntNode(long yyyProdNum, int yyyRHSlength, int yyyNattrbs, struct yyyOxAttrbs *yyval_OxAttrbs, ...) + {yyyWST i; + yyySIT **yyyOxStackItem = &yyval_OxAttrbs->yyyOxStackItem; + yyyGNT *gnpDum; + va_list ap; + + *yyyOxStackItem = (yyySIT *) malloc((size_t)sizeof(yyySIT)); + if (*yyyOxStackItem == (yyySIT *) NULL) + yyyfatal("malloc error in ox yacc semantic stack space allocation\n"); + (*yyyOxStackItem)->node = + (yyyGNT *) malloc((size_t)sizeof(yyyGNT)); + if ((*yyyOxStackItem)->node == (yyyGNT *) NULL) + yyyfatal("malloc error in ox node space allocation\n"); + (*yyyOxStackItem)->solvedSAlist = yyyLambdaSSAL; + (*yyyOxStackItem)->node->parent.stackref = *yyyOxStackItem; + (*yyyOxStackItem)->node->parentIsStack = 1; + (*yyyOxStackItem)->node->cLlen = yyyRHSlength; + (*yyyOxStackItem)->node->cL = + (yyyGNT **) calloc((size_t)yyyRHSlength, (size_t)sizeof(yyyGNT *)); + if ((*yyyOxStackItem)->node->cL == (yyyGNT **) NULL) + yyyfatal("malloc error in ox child list space allocation\n"); + (*yyyOxStackItem)->node->refCountListLen = yyyNattrbs; + (*yyyOxStackItem)->node->refCountList = + (yyyRCT *) calloc((size_t)yyyNattrbs, (size_t)sizeof(yyyRCT)); + if ((*yyyOxStackItem)->node->refCountList == (yyyRCT *) NULL) + yyyfatal("malloc error in ox reference count list space allocation\n"); + (*yyyOxStackItem)->node->prodNum = yyyProdNum; + va_start(ap, yyval_OxAttrbs); + for (i=1;i<=yyyRHSlength;i++) + {yyySIT *yaccStDum = va_arg(ap,struct yyyOxAttrbs *)->yyyOxStackItem; + gnpDum = (*yyyOxStackItem)->node->cL[i-1] = yaccStDum->node; + gnpDum->whichSym = i; + gnpDum->parent.noderef = (*yyyOxStackItem)->node; + gnpDum->parentIsStack = 0; + } + va_end(ap); + } + + + +#define yyyDECORfREQ 50 + + + +void yyyAdjustINRC(long yyyProdNum, int yyyRHSlength, long startP, long stopP, struct yyyOxAttrbs *yyval_OxAttrbs, ...) + {yyyWST i; + yyySIT *yyyOxStackItem = yyval_OxAttrbs->yyyOxStackItem; + long SSALptr,SSALptrHead,*cPtrPtr; + long *pL; + yyyGNT *gnpDum; + long iTemp; + long nextP; + static unsigned short intNodeCount = yyyDECORfREQ; + va_list ap; + + nextP = startP; + while (nextP < stopP) + {if (yyyRCIL[nextP] == yyyR) + {(yyyOxStackItem->node->refCountList)[yyyRCIL[nextP+1]] = yyyRCIL[nextP+2]; + } + else + {(((yyyOxStackItem->node->cL)[yyyRCIL[nextP]])->refCountList)[yyyRCIL[nextP+1]] = yyyRCIL[nextP+2]; + } + nextP += 3; + } + pL = yyyIIEL + yyyIIIEL[yyyProdNum]; + va_start(ap, yyval_OxAttrbs); + for (i=1;i<=yyyRHSlength;i++) + {yyySIT *yaccStDum = va_arg(ap,struct yyyOxAttrbs *)->yyyOxStackItem; + pL++; + SSALptrHead = SSALptr = *(cPtrPtr = &(yaccStDum->solvedSAlist)); + if (SSALptr != yyyLambdaSSAL) + {*cPtrPtr = yyyLambdaSSAL; + do + { + iTemp = (*pL+yyySSALspace[SSALptr].attrbNum); + yyySignalEnts(yyyOxStackItem->node, + yyyIEL[iTemp], + yyyIEL[iTemp+1] + ); + SSALptr = *(cPtrPtr = &(yyySSALspace[SSALptr].next)); + } + while (SSALptr != yyyLambdaSSAL); + *cPtrPtr = yyySSALCfreeList; + yyySSALCfreeList = SSALptrHead; + } + } + va_end(ap); + nextP = startP + 2; + while (nextP < stopP) + {if (!yyyRCIL[nextP]) + {if (yyyRCIL[nextP-2] == yyyR) + {pL = &(yyyOxStackItem->solvedSAlist); + if (yyySSALCfreeList == yyyLambdaSSAL) + {yyySSALspace[yyyNewSSALC].next = *pL; + if ((*pL = yyyNewSSALC++) == yyySSALspaceSize) + yyyHandleOverflow(yyySSALof); + } + else + {iTemp = yyySSALCfreeList; + yyySSALCfreeList = yyySSALspace[yyySSALCfreeList].next; + yyySSALspace[iTemp].next = *pL; + *pL = iTemp; + } + yyySSALspace[*pL].attrbNum = yyyRCIL[nextP-1]; + } + else + {if ((gnpDum = (yyyOxStackItem->node->cL)[yyyRCIL[nextP-2]])->prodNum != 0) + { + iTemp = yyyIIEL[yyyIIIEL[gnpDum->prodNum]] + yyyRCIL[nextP-1]; + yyySignalEnts(gnpDum, + yyyIEL[iTemp], + yyyIEL[iTemp+1] + ); + } + } + } + nextP += 3; + } + if (!--intNodeCount) + {intNodeCount = yyyDECORfREQ; + yyyDecorate(); + } + } + + + +void yyyGenLeaf(int nAttrbs,int typeNum,long startP,long stopP,YYSTYPE *yylval) + {yyyRCT *rcPdum; + yyySIT **yyyOxStackItem = &yylval->yyyOxAttrbs.yyyOxStackItem; + (*yyyOxStackItem) = (yyySIT *) malloc((size_t)sizeof(yyySIT)); + if ((*yyyOxStackItem) == (yyySIT *) NULL) + yyyfatal("malloc error in ox yacc semantic stack space allocation\n"); + (*yyyOxStackItem)->node = + (yyyGNT *) malloc((size_t)sizeof(yyyGNT)) + ; + if ((*yyyOxStackItem)->node == (yyyGNT *) NULL) + yyyfatal("malloc error in ox node space allocation\n"); + (*yyyOxStackItem)->solvedSAlist = yyyLambdaSSAL; + (*yyyOxStackItem)->node->parent.stackref = *yyyOxStackItem; + (*yyyOxStackItem)->node->parentIsStack = 1; + (*yyyOxStackItem)->node->cLlen = 0; + (*yyyOxStackItem)->node->cL = (yyyGNT **)NULL; + (*yyyOxStackItem)->node->refCountListLen = nAttrbs; + rcPdum = (*yyyOxStackItem)->node->refCountList = + (yyyRCT *) calloc((size_t)nAttrbs, (size_t)sizeof(yyyRCT)); + if (rcPdum == (yyyRCT *) NULL) + yyyfatal("malloc error in ox reference count list space allocation\n"); + while (startP < stopP) rcPdum[yyyLRCIL[startP++]] = 0; + (*yyyOxStackItem)->node->prodNum = 0; + (*yyyOxStackItem)->node->whichSym = 0; + } + + + +void yyyabort(void) + {yyyYok = 0; + } + + + + + +#define yyyLastProdNum 8 + + +#define yyyNsorts 1 + + +int yyyProdsInd[] = { + 0, + 0, 2, 6, 10, 14, 18, 22, 24, + 26, +}; + + +int yyyProds[][2] = { +{ 116, 0},{ 462, 0},{ 462, 0},{ 462, 0},{ 412, 0}, +{ 462, 0},{ 462, 0},{ 462, 0},{ 420, 0},{ 462, 0}, +{ 462, 0},{ 462, 0},{ 452, 0},{ 462, 0},{ 462, 0}, +{ 462, 0},{ 436, 0},{ 462, 0},{ 462, 0},{ 396, 0}, +{ 462, 0},{ 404, 0},{ 462, 0},{ 619, 1},{ 462, 0}, +{ 567, 1}, +}; + + +int yyySortsInd[] = { + 0, + 0, + 1, +}; + + +int yyySorts[] = { + 413, +}; + + + +char *yyyStringTab[] = { +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,"s",0,0,0, +0,0,"y",0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,"LRpre",0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,"'('",0,0,0, +0,0,0,0,"')'", +0,0,0,0,0, +0,0,"'*'","lexeme",0, +0,0,0,0,0, +"'+'",0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,"'-'",0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,"'/'",0,0, +0,0,0,0,0, +0,0,"expr",0,0, +0,0,0,0,0, +0,0,0,0,0, +0,"printf",0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,"CONST","LRpost",0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,"ID", +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0, +}; + + + +#define yyySizeofProd(num) (yyyProdsInd[(num)+1] - yyyProdsInd[(num)]) + +#define yyyGSoccurStr(prodNum,symPos) \ + (yyyStringTab[yyyProds[yyyProdsInd[(prodNum)] + (symPos)][0]]) + +#define yyySizeofSort(num) (yyySortsInd[(num)+1] - yyySortsInd[(num)]) + +#define yyySortOf(prodNum,symPos) \ + (yyyProds[yyyProdsInd[(prodNum)] + (symPos)][1]) + +#define yyyAttrbStr(prodNum,symPos,attrbNum) \ + (yyyStringTab[yyySorts[yyySortsInd[yyySortOf(prodNum,symPos)] + \ + (attrbNum) \ + ] \ + ] \ + ) + + + +void yyyShowProd(int i) + {int j,nSyms; + + nSyms = yyySizeofProd(i); + for (j=0; j\n",stderr); + else + putc('\n',stderr); + } + } + } + + + +void yyyCheckNodeInstancesSolved(yyyGNT *np) + {int mysort,sortSize,i,prodNum,symPos,inTerminalNode; + int nUnsolvedInsts = 0; + + if (np->prodNum != 0) + {inTerminalNode = 0; + prodNum = np->prodNum; + symPos = 0; + } + else + {inTerminalNode = 1; + prodNum = np->parent.noderef->prodNum; + symPos = np->whichSym; + } + mysort = yyySortOf(prodNum,symPos); + sortSize = yyySizeofSort(mysort); + for (i=0; irefCountList)[i] != 0) nUnsolvedInsts += 1; + if (nUnsolvedInsts) + {fprintf(stderr, + "\nFound node that has %d unsolved attribute instance(s).\n", + nUnsolvedInsts + ); + fprintf(stderr,"Node is labeled \"%s\".\n", + yyyGSoccurStr(prodNum,symPos)); + if (inTerminalNode) + {fputs("Node is terminal. Its parent production is:\n ",stderr); + yyyShowProd(prodNum); + } + else + {fputs("Node is nonterminal. ",stderr); + if (!(np->parentIsStack)) + {fprintf(stderr, + "Node is %dth child in its parent production:\n ", + np->whichSym + ); + yyyShowProd(np->parent.noderef->prodNum); + } + fputs("Node is on left hand side of this production:\n ",stderr); + yyyShowProd(np->prodNum); + } + fputs("The following instances are unsolved:\n",stderr); + for (i=0; irefCountList)[i] != 0) + fprintf(stderr," %-16s still has %1d dependencies.\n", + yyyAttrbStr(prodNum,symPos,i),(np->refCountList)[i]); + } + } + + + +void yyyCheckUnsolvedInstTrav(yyyGNT *pNode,long *nNZrc,long *cycleSum) + {yyyGNT **yyyCLpdum; + yyyRCT *rcp; + int i; + + /* visit the refCountList of each node in the tree, and sum the non-zero refCounts */ + rcp = pNode->refCountList; + i = pNode->refCountListLen; + while (i--) + if (*rcp++) {*cycleSum += *(rcp - 1); (*nNZrc)++;} + yyyCLpdum = pNode->cL; + i = pNode->cLlen; + while (i--) + { + yyyCheckUnsolvedInstTrav(*yyyCLpdum,nNZrc,cycleSum); + yyyCLpdum++; + } + } + + + +void yyyUnsolvedInstSearchTravAux(yyyGNT *pNode) + {yyyGNT **yyyCLpdum; + int i; + + yyyCheckNodeInstancesSolved(pNode); + yyyCLpdum = pNode->cL; + i = pNode->cLlen; + while (i--) + { + yyyUnsolvedInstSearchTravAux(*yyyCLpdum); + yyyCLpdum++; + } + } + + + +void yyyUnsolvedInstSearchTrav(yyyGNT *pNode) + {yyyGNT **yyyCLpdum; + int i; + + yyyCLpdum = pNode->cL; + i = pNode->cLlen; + while (i--) + { + yyyUnsolvedInstSearchTravAux(*yyyCLpdum); + yyyCLpdum++; + } + } + + + Index: head/contrib/byacc/test/yacc/expr.oxout.error =================================================================== --- head/contrib/byacc/test/yacc/expr.oxout.error (nonexistent) +++ head/contrib/byacc/test/yacc/expr.oxout.error (revision 313105) @@ -0,0 +1 @@ +YACC: w - line 6 of "expr.Y", the precedence of '*' has been redeclared Index: head/contrib/byacc/test/yacc/expr.oxout.output =================================================================== --- head/contrib/byacc/test/yacc/expr.oxout.output (nonexistent) +++ head/contrib/byacc/test/yacc/expr.oxout.output (revision 313105) @@ -0,0 +1,209 @@ + 0 $accept : yyyAugNonterm $end + + 1 $$1 : + + 2 yyyAugNonterm : $$1 s + + 3 s : expr + + 4 expr : expr '*' expr + 5 | expr '+' expr + 6 | expr '/' expr + 7 | expr '-' expr + 8 | '(' expr ')' + 9 | ID + 10 | CONST + +state 0 + $accept : . yyyAugNonterm $end (0) + $$1 : . (1) + + . reduce 1 + + yyyAugNonterm goto 1 + $$1 goto 2 + + +state 1 + $accept : yyyAugNonterm . $end (0) + + $end accept + + +state 2 + yyyAugNonterm : $$1 . s (2) + + ID shift 3 + CONST shift 4 + '(' shift 5 + . error + + s goto 6 + expr goto 7 + + +state 3 + expr : ID . (9) + + . reduce 9 + + +state 4 + expr : CONST . (10) + + . reduce 10 + + +state 5 + expr : '(' . expr ')' (8) + + ID shift 3 + CONST shift 4 + '(' shift 5 + . error + + expr goto 8 + + +state 6 + yyyAugNonterm : $$1 s . (2) + + . reduce 2 + + +state 7 + s : expr . (3) + expr : expr . '*' expr (4) + expr : expr . '+' expr (5) + expr : expr . '/' expr (6) + expr : expr . '-' expr (7) + + '+' shift 9 + '-' shift 10 + '*' shift 11 + '/' shift 12 + $end reduce 3 + + +state 8 + expr : expr . '*' expr (4) + expr : expr . '+' expr (5) + expr : expr . '/' expr (6) + expr : expr . '-' expr (7) + expr : '(' expr . ')' (8) + + '+' shift 9 + '-' shift 10 + '*' shift 11 + '/' shift 12 + ')' shift 13 + . error + + +state 9 + expr : expr '+' . expr (5) + + ID shift 3 + CONST shift 4 + '(' shift 5 + . error + + expr goto 14 + + +state 10 + expr : expr '-' . expr (7) + + ID shift 3 + CONST shift 4 + '(' shift 5 + . error + + expr goto 15 + + +state 11 + expr : expr '*' . expr (4) + + ID shift 3 + CONST shift 4 + '(' shift 5 + . error + + expr goto 16 + + +state 12 + expr : expr '/' . expr (6) + + ID shift 3 + CONST shift 4 + '(' shift 5 + . error + + expr goto 17 + + +state 13 + expr : '(' expr ')' . (8) + + . reduce 8 + + +state 14 + expr : expr . '*' expr (4) + expr : expr . '+' expr (5) + expr : expr '+' expr . (5) + expr : expr . '/' expr (6) + expr : expr . '-' expr (7) + + '*' shift 11 + '/' shift 12 + $end reduce 5 + '+' reduce 5 + '-' reduce 5 + ')' reduce 5 + + +state 15 + expr : expr . '*' expr (4) + expr : expr . '+' expr (5) + expr : expr . '/' expr (6) + expr : expr . '-' expr (7) + expr : expr '-' expr . (7) + + '*' shift 11 + '/' shift 12 + $end reduce 7 + '+' reduce 7 + '-' reduce 7 + ')' reduce 7 + + +state 16 + expr : expr . '*' expr (4) + expr : expr '*' expr . (4) + expr : expr . '+' expr (5) + expr : expr . '/' expr (6) + expr : expr . '-' expr (7) + + . reduce 4 + + +state 17 + expr : expr . '*' expr (4) + expr : expr . '+' expr (5) + expr : expr . '/' expr (6) + expr : expr '/' expr . (6) + expr : expr . '-' expr (7) + + '*' shift 11 + $end reduce 6 + '+' reduce 6 + '-' reduce 6 + '/' reduce 6 + ')' reduce 6 + + +10 terminals, 5 nonterminals +11 grammar rules, 18 states Index: head/contrib/byacc/test/yacc/expr.oxout.tab.c =================================================================== --- head/contrib/byacc/test/yacc/expr.oxout.tab.c (nonexistent) +++ head/contrib/byacc/test/yacc/expr.oxout.tab.c (revision 313105) @@ -0,0 +1,1958 @@ +/* original parser id follows */ +/* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ +/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */ + +#define YYBYACC 1 +#define YYMAJOR 1 +#define YYMINOR 9 +#define YYCHECK "yyyymmdd" + +#define YYEMPTY (-1) +#define yyclearin (yychar = YYEMPTY) +#define yyerrok (yyerrflag = 0) +#define YYRECOVERING() (yyerrflag != 0) +#define YYENOMEM (-2) +#define YYEOF 0 + +#ifndef yyparse +#define yyparse expr.oxout_parse +#endif /* yyparse */ + +#ifndef yylex +#define yylex expr.oxout_lex +#endif /* yylex */ + +#ifndef yyerror +#define yyerror expr.oxout_error +#endif /* yyerror */ + +#ifndef yychar +#define yychar expr.oxout_char +#endif /* yychar */ + +#ifndef yyval +#define yyval expr.oxout_val +#endif /* yyval */ + +#ifndef yylval +#define yylval expr.oxout_lval +#endif /* yylval */ + +#ifndef yydebug +#define yydebug expr.oxout_debug +#endif /* yydebug */ + +#ifndef yynerrs +#define yynerrs expr.oxout_nerrs +#endif /* yynerrs */ + +#ifndef yyerrflag +#define yyerrflag expr.oxout_errflag +#endif /* yyerrflag */ + +#ifndef yylhs +#define yylhs expr.oxout_lhs +#endif /* yylhs */ + +#ifndef yylen +#define yylen expr.oxout_len +#endif /* yylen */ + +#ifndef yydefred +#define yydefred expr.oxout_defred +#endif /* yydefred */ + +#ifndef yydgoto +#define yydgoto expr.oxout_dgoto +#endif /* yydgoto */ + +#ifndef yysindex +#define yysindex expr.oxout_sindex +#endif /* yysindex */ + +#ifndef yyrindex +#define yyrindex expr.oxout_rindex +#endif /* yyrindex */ + +#ifndef yygindex +#define yygindex expr.oxout_gindex +#endif /* yygindex */ + +#ifndef yytable +#define yytable expr.oxout_table +#endif /* yytable */ + +#ifndef yycheck +#define yycheck expr.oxout_check +#endif /* yycheck */ + +#ifndef yyname +#define yyname expr.oxout_name +#endif /* yyname */ + +#ifndef yyrule +#define yyrule expr.oxout_rule +#endif /* yyrule */ +#define YYPREFIX "expr.oxout_" + +#define YYPURE 0 + +#line 5 "expr.oxout.y" +#include +#include +#line 8 "expr.Y" + +#include "expr.oxout.h" +#include + +extern int yylex(void); +extern void yyerror(const char *); +#line 27 "expr.oxout.y" +#include +#define yyyR USHRT_MAX +#ifdef YYSTYPE +#undef YYSTYPE_IS_DECLARED +#define YYSTYPE_IS_DECLARED 1 +#endif +#ifndef YYSTYPE_IS_DECLARED +#define YYSTYPE_IS_DECLARED 1 +#line 31 "expr.oxout.y" +typedef union { +struct yyyOxAttrbs { +struct yyyStackItem *yyyOxStackItem; +} yyyOxAttrbs; +} YYSTYPE; +#endif /* !YYSTYPE_IS_DECLARED */ +#line 38 "expr.oxout.y" +#include +#include + +static int yyyYok = 1; + +extern yyyFT yyyRCIL[]; + +void yyyExecuteRRsection(yyyGNT *rootNode); +void yyyYoxInit(void); +void yyyDecorate(void); +struct yyyOxAttrbs; /* hack required to compensate for 'msta' behavior */ +void yyyGenIntNode(long yyyProdNum, int yyyRHSlength, int yyyNattrbs, struct yyyOxAttrbs *yyval_OxAttrbs, ...); +void yyyAdjustINRC(long yyyProdNum, int yyyRHSlength, long startP, long stopP, struct yyyOxAttrbs *yyval_OxAttrbs, ...); +void yyyCheckUnsolvedInstTrav(yyyGNT *rootNode,long *nNZrc,long *cycleSum); +void yyyUnsolvedInstSearchTrav(yyyGNT *pNode); +void yyyUnsolvedInstSearchTravAux(yyyGNT *pNode); +void yyyabort(void); + +#line 146 "expr.oxout.tab.c" + +/* compatibility with bison */ +#ifdef YYPARSE_PARAM +/* compatibility with FreeBSD */ +# ifdef YYPARSE_PARAM_TYPE +# define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM) +# else +# define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM) +# endif +#else +# define YYPARSE_DECL() yyparse(void) +#endif + +/* Parameters sent to lex. */ +#ifdef YYLEX_PARAM +# define YYLEX_DECL() yylex(void *YYLEX_PARAM) +# define YYLEX yylex(YYLEX_PARAM) +#else +# define YYLEX_DECL() yylex(void) +# define YYLEX yylex() +#endif + +/* Parameters sent to yyerror. */ +#ifndef YYERROR_DECL +#define YYERROR_DECL() yyerror(const char *s) +#endif +#ifndef YYERROR_CALL +#define YYERROR_CALL(msg) yyerror(msg) +#endif + +extern int YYPARSE_DECL(); + +#define ID 257 +#define CONST 258 +#define YYERRCODE 256 +typedef short YYINT; +static const YYINT expr.oxout_lhs[] = { -1, + 2, 0, 1, 3, 3, 3, 3, 3, 3, 3, +}; +static const YYINT expr.oxout_len[] = { 2, + 0, 2, 1, 3, 3, 3, 3, 3, 1, 1, +}; +static const YYINT expr.oxout_defred[] = { 1, + 0, 0, 9, 10, 0, 2, 0, 0, 0, 0, + 0, 0, 8, 0, 0, 4, 0, +}; +static const YYINT expr.oxout_dgoto[] = { 1, + 6, 2, 7, +}; +static const YYINT expr.oxout_sindex[] = { 0, + 0, -40, 0, 0, -40, 0, -18, -24, -40, -40, + -40, -40, 0, -37, -37, 0, -39, +}; +static const YYINT expr.oxout_rindex[] = { 0, + 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, + 0, 0, 0, 2, 8, 0, 1, +}; +static const YYINT expr.oxout_gindex[] = { 0, + 0, 0, 4, +}; +#define YYTABLESIZE 218 +static const YYINT expr.oxout_table[] = { 5, + 6, 5, 11, 0, 11, 3, 0, 7, 8, 12, + 0, 0, 14, 15, 16, 17, 13, 11, 9, 0, + 10, 0, 12, 11, 9, 0, 10, 0, 12, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 6, 5, 6, 5, 6, 5, 6, 7, 0, + 7, 0, 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 3, 4, +}; +static const YYINT expr.oxout_check[] = { 40, + 0, 0, 42, -1, 42, 0, -1, 0, 5, 47, + -1, -1, 9, 10, 11, 12, 41, 42, 43, -1, + 45, -1, 47, 42, 43, -1, 45, -1, 47, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 41, 41, 43, 43, 45, 45, 47, 41, -1, + 43, -1, 45, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 257, 258, +}; +#define YYFINAL 1 +#ifndef YYDEBUG +#define YYDEBUG 0 +#endif +#define YYMAXTOKEN 258 +#define YYUNDFTOKEN 264 +#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a)) +#if YYDEBUG +static const char *const expr.oxout_name[] = { + +"end-of-file",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,"'('","')'","'*'","'+'",0,"'-'",0,"'/'",0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"ID", +"CONST",0,0,0,0,0,"illegal-symbol", +}; +static const char *const expr.oxout_rule[] = { +"$accept : yyyAugNonterm", +"$$1 :", +"yyyAugNonterm : $$1 s", +"s : expr", +"expr : expr '*' expr", +"expr : expr '+' expr", +"expr : expr '/' expr", +"expr : expr '-' expr", +"expr : '(' expr ')'", +"expr : ID", +"expr : CONST", + +}; +#endif + +int yydebug; +int yynerrs; + +int yyerrflag; +int yychar; +YYSTYPE yyval; +YYSTYPE yylval; + +/* define the initial stack-sizes */ +#ifdef YYSTACKSIZE +#undef YYMAXDEPTH +#define YYMAXDEPTH YYSTACKSIZE +#else +#ifdef YYMAXDEPTH +#define YYSTACKSIZE YYMAXDEPTH +#else +#define YYSTACKSIZE 10000 +#define YYMAXDEPTH 10000 +#endif +#endif + +#define YYINITSTACKSIZE 200 + +typedef struct { + unsigned stacksize; + YYINT *s_base; + YYINT *s_mark; + YYINT *s_last; + YYSTYPE *l_base; + YYSTYPE *l_mark; +} YYSTACKDATA; +/* variables for the parser stack */ +static YYSTACKDATA yystack; +#line 53 "expr.Y" + + +int yyparse(void); + +int main() + {yyparse(); + } + + + +#line 138 "expr.oxout.y" +long yyySSALspaceSize = 20000; +long yyyRSmaxSize = 1000; +long yyyTravStackMaxSize = 2000; + +struct yyySolvedSAlistCell {yyyWAT attrbNum; + long next; + }; + +#define yyyLambdaSSAL 0 +long yyySSALCfreeList = yyyLambdaSSAL; +long yyyNewSSALC = 1; + +struct yyySolvedSAlistCell *yyySSALspace; + +long yyyNbytesStackStg; + + + +yyyFT yyyRCIL[1]; + +short yyyIIIEL[] = {0, +0,2,6,10,14,18,22,24, +}; + +long yyyIIEL[] = { +0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0, +1,1, +}; + +long yyyIEL[] = { +0,0,0, +}; + +yyyFT yyyEntL[1]; + +void yyyfatal(char *msg) +{fputs(msg,stderr);exit(-1);} + + + +#define yyySSALof 'S' +#define yyyRSof 'q' +#define yyyTSof 't' + + + +void yyyHandleOverflow(char which) + {char *msg1,*msg2; + long oldSize,newSize; + switch(which) + { + case yyySSALof : + msg1 = "SSAL overflow: "; + oldSize = yyySSALspaceSize; + break; + case yyyRSof : + msg1 = "ready set overflow: "; + oldSize = yyyRSmaxSize; + break; + case yyyTSof : + msg1 = "traversal stack overflow: "; + oldSize = yyyTravStackMaxSize; + break; + default :; + } + newSize = (3*oldSize)/2; + if (newSize < 100) newSize = 100; + fputs(msg1,stderr); + fprintf(stderr,"size was %ld.\n",oldSize); + msg2 = " Have to modify evaluator: -Y%c%ld.\n"; + fprintf(stderr,msg2,which,newSize); + exit(-1); + } + + + +void yyySignalEnts(yyyGNT *node,long startP,long stopP) + {yyyGNT *dumNode; + + while (startP < stopP) + { + if (!yyyEntL[startP]) dumNode = node; + else dumNode = (node->cL)[yyyEntL[startP]-1]; + if (!(--((dumNode->refCountList)[yyyEntL[startP+1]] + ) + ) + ) + { + if (++yyyRSTop == yyyAfterRS) + {yyyHandleOverflow(yyyRSof); + break; + } + yyyRSTop->node = dumNode; + yyyRSTop->whichSym = yyyEntL[startP]; + yyyRSTop->wa = yyyEntL[startP+1]; + } + startP += 2; + } + } + + + + + + +void yyySolveAndSignal() { +long yyyiDum,*yyypL; +int yyyws,yyywa; +yyyGNT *yyyRSTopN,*yyyRefN; +yyyParent yyyRSTopNp; + + +yyyRSTopNp = (yyyRSTopN = yyyRSTop->node)->parent; +yyyRefN= (yyyws = (yyyRSTop->whichSym))?yyyRSTopNp.noderef:yyyRSTopN; +yyywa = yyyRSTop->wa; +yyyRSTop--; +switch(yyyRefN->prodNum) { +case 1: /***yacc rule 1***/ + switch (yyyws) { + } +break; +case 2: /***yacc rule 2***/ + switch (yyyws) { + } +break; +case 3: /***yacc rule 3***/ + switch (yyyws) { + } +break; +case 4: /***yacc rule 4***/ + switch (yyyws) { + } +break; +case 5: /***yacc rule 5***/ + switch (yyyws) { + } +break; +case 6: /***yacc rule 6***/ + switch (yyyws) { + } +break; +case 7: /***yacc rule 7***/ + switch (yyyws) { + case 1: /**/ + switch (yyywa) { + } + break; + } +break; +case 8: /***yacc rule 8***/ + switch (yyyws) { + case 1: /**/ + switch (yyywa) { + } + break; + } +break; +} /* switch */ + +if (yyyws) /* the just-solved instance was inherited. */ + {if (yyyRSTopN->prodNum) + {yyyiDum = yyyIIEL[yyyIIIEL[yyyRSTopN->prodNum]] + yyywa; + yyySignalEnts(yyyRSTopN,yyyIEL[yyyiDum], + yyyIEL[yyyiDum+1] + ); + } + } + else /* the just-solved instance was synthesized. */ + {if (!(yyyRSTopN->parentIsStack)) /* node has a parent. */ + {yyyiDum = yyyIIEL[yyyIIIEL[yyyRSTopNp.noderef->prodNum] + + yyyRSTopN->whichSym + ] + + yyywa; + yyySignalEnts(yyyRSTopNp.noderef, + yyyIEL[yyyiDum], + yyyIEL[yyyiDum+1] + ); + } + else /* node is still on the stack--it has no parent yet. */ + {yyypL = &(yyyRSTopNp.stackref->solvedSAlist); + if (yyySSALCfreeList == yyyLambdaSSAL) + {yyySSALspace[yyyNewSSALC].next = *yyypL; + if ((*yyypL = yyyNewSSALC++) == yyySSALspaceSize) + yyyHandleOverflow(yyySSALof); + } + else + {yyyiDum = yyySSALCfreeList; + yyySSALCfreeList = yyySSALspace[yyySSALCfreeList].next; + yyySSALspace[yyyiDum].next = *yyypL; + *yyypL = yyyiDum; + } + yyySSALspace[*yyypL].attrbNum = yyywa; + } + } + +} /* yyySolveAndSignal */ + + + + + + +#define condStg unsigned int conds; +#define yyyClearConds {yyyTST->conds = 0;} +#define yyySetCond(n) {yyyTST->conds += (1<<(n));} +#define yyyCond(n) ((yyyTST->conds & (1<<(n)))?1:0) + + + +struct yyyTravStackItem {yyyGNT *node; + char isReady; + condStg + }; + + + +void yyyDoTraversals(yyyGNT *rootNode) +{struct yyyTravStackItem *yyyTravStack,*yyyTST,*yyyAfterTravStack; + yyyGNT *yyyTSTn,**yyyCLptr2; + int yyyi,yyyRL,yyyPass; + int i; + + if (!yyyYok) return; + if ((yyyTravStack = + ((struct yyyTravStackItem *) + calloc((size_t)yyyTravStackMaxSize, + (size_t)sizeof(struct yyyTravStackItem) + ) + ) + ) + == + (struct yyyTravStackItem *)NULL + ) + {fputs("malloc error in traversal stack allocation\n",stderr); + exit(-1); + } + +yyyAfterTravStack = yyyTravStack + yyyTravStackMaxSize; +yyyTravStack++; + + +for (yyyi=0; yyyi<2; yyyi++) { +yyyTST = yyyTravStack; +yyyTST->node = rootNode; +yyyTST->isReady = 0; +yyyClearConds + +while(yyyTST >= yyyTravStack) + {yyyTSTn = yyyTST->node; + if (yyyTST->isReady) + {yyyPass = 1; + goto yyyTravSwitch; +yyyTpop: + yyyTST--; + } + else + {yyyPass = 0; + goto yyyTravSwitch; +yyyTpush: + yyyTST->isReady = 1; + if (yyyTSTn->prodNum) + {if (yyyRL) + {yyyCLptr2 = yyyTSTn->cL; + i = yyyTSTn->cLlen; + while (i--) + {if (++yyyTST == yyyAfterTravStack) + yyyHandleOverflow(yyyTSof); + else + {yyyTST->node = *yyyCLptr2; + yyyTST->isReady = 0; + yyyClearConds + } + yyyCLptr2++; + } + } /* right to left */ + else /* left to right */ + {i = yyyTSTn->cLlen; + yyyCLptr2 = yyyTSTn->cL + i; + while (i--) + {yyyCLptr2--; + if (++yyyTST == yyyAfterTravStack) + yyyHandleOverflow(yyyTSof); + else + {yyyTST->node = *yyyCLptr2; + yyyTST->isReady = 0; + yyyClearConds + } + } + } /* left to right */ + } + } /* else */ + continue; +yyyTravSwitch: + switch(yyyTSTn->prodNum) { +case 1: + switch(yyyi) { + case 0: + switch(yyyPass) { + case 0: +yyyRL = 0;yyySetCond(0) + +if (! +#line 24 "expr.Y" + (1) +#line 444 "expr.oxout.y" +) yyySetCond(1) +yyySetCond(2) + + case 1: + +if (yyyCond(0) != yyyPass) { +#line 24 "expr.Y" + +#line 453 "expr.oxout.y" +} +if (yyyCond(1) != yyyPass) { +#line 24 "expr.Y" + printf("\n"); + +#line 459 "expr.oxout.y" +} +if (yyyCond(2) != yyyPass) { +#line 25 "expr.Y" + printf("prefix: "); + +#line 465 "expr.oxout.y" +} + break; + } + break; + case 1: + switch(yyyPass) { + case 0: +yyyRL = 0; +if ( +#line 23 "expr.Y" + (1) +#line 477 "expr.oxout.y" +) yyySetCond(2) + + case 1: + +if (yyyCond(0) != yyyPass) { +#line 22 "expr.Y" + printf("\n"); + +#line 486 "expr.oxout.y" +} +if (yyyCond(1) != yyyPass) { +#line 23 "expr.Y" + +#line 491 "expr.oxout.y" +} +if (yyyCond(2) != yyyPass) { +#line 23 "expr.Y" + printf("postfix: ")/* missing ; */ + +#line 497 "expr.oxout.y" +} + break; + } + break; + } + +break; +case 2: + switch(yyyi) { + case 0: + switch(yyyPass) { + case 0: +yyyRL = 0;yyySetCond(0) + + case 1: + +if (yyyCond(0) != yyyPass) { +#line 29 "expr.Y" + printf(" * "); + +#line 518 "expr.oxout.y" +} + break; + } + break; + case 1: + switch(yyyPass) { + case 0: +yyyRL = 0; + case 1: + +if (yyyCond(0) != yyyPass) { +#line 28 "expr.Y" + printf(" * "); + +#line 533 "expr.oxout.y" +} + break; + } + break; + } + +break; +case 3: + switch(yyyi) { + case 0: + switch(yyyPass) { + case 0: +yyyRL = 0;yyySetCond(0) + + case 1: + +if (yyyCond(0) != yyyPass) { +#line 32 "expr.Y" + printf(" + "); + +#line 554 "expr.oxout.y" +} + break; + } + break; + case 1: + switch(yyyPass) { + case 0: +yyyRL = 0; + case 1: + +if (yyyCond(0) != yyyPass) { +#line 33 "expr.Y" + printf(" + "); + +#line 569 "expr.oxout.y" +} + break; + } + break; + } + +break; +case 4: + switch(yyyi) { + case 0: + switch(yyyPass) { + case 0: +yyyRL = 0;yyySetCond(0) + + case 1: + +if (yyyCond(0) != yyyPass) { +#line 37 "expr.Y" + printf(" / "); + +#line 590 "expr.oxout.y" +} + break; + } + break; + case 1: + switch(yyyPass) { + case 0: +yyyRL = 0; + case 1: + +if (yyyCond(0) != yyyPass) { +#line 36 "expr.Y" + printf(" / "); + +#line 605 "expr.oxout.y" +} + break; + } + break; + } + +break; +case 5: + switch(yyyi) { + case 0: + switch(yyyPass) { + case 0: +yyyRL = 0;yyySetCond(0) + + case 1: + +if (yyyCond(0) != yyyPass) { +#line 41 "expr.Y" + printf(" - "); + +#line 626 "expr.oxout.y" +} + break; + } + break; + case 1: + switch(yyyPass) { + case 0: +yyyRL = 0; + case 1: + +if (yyyCond(0) != yyyPass) { +#line 40 "expr.Y" + printf(" - "); + +#line 641 "expr.oxout.y" +} + break; + } + break; + } + +break; +case 6: + switch(yyyi) { + case 0: + switch(yyyPass) { + case 0: +yyyRL = 0; + case 1: + + break; + } + break; + case 1: + switch(yyyPass) { + case 0: +yyyRL = 0; + case 1: + + break; + } + break; + } + +break; +case 7: + switch(yyyi) { + case 0: + switch(yyyPass) { + case 0: +yyyRL = 0;yyySetCond(0) + + case 1: + +if (yyyCond(0) != yyyPass) { +#line 46 "expr.Y" + printf(" %s ",yyyTSTn->cL[0]->yyyAttrbs.yyyAttrb1.lexeme); + +#line 685 "expr.oxout.y" +} + break; + } + break; + case 1: + switch(yyyPass) { + case 0: +yyyRL = 0; + case 1: + +if (yyyCond(0) != yyyPass) { +#line 45 "expr.Y" + printf(" %s ",yyyTSTn->cL[0]->yyyAttrbs.yyyAttrb1.lexeme); + +#line 700 "expr.oxout.y" +} + break; + } + break; + } + +break; +case 8: + switch(yyyi) { + case 0: + switch(yyyPass) { + case 0: +yyyRL = 0;yyySetCond(0) + + case 1: + +if (yyyCond(0) != yyyPass) { +#line 50 "expr.Y" + printf(" %s ",yyyTSTn->cL[0]->yyyAttrbs.yyyAttrb1.lexeme); + +#line 721 "expr.oxout.y" +} + break; + } + break; + case 1: + switch(yyyPass) { + case 0: +yyyRL = 0; + case 1: + +if (yyyCond(0) != yyyPass) { +#line 49 "expr.Y" + printf(" %s ",yyyTSTn->cL[0]->yyyAttrbs.yyyAttrb1.lexeme); + +#line 736 "expr.oxout.y" +} + break; + } + break; + } + +break; + } /* switch */ + if (yyyPass) goto yyyTpop; else goto yyyTpush; + } /* while */ + } /* for */ +} /* yyyDoTraversals */ + +void yyyExecuteRRsection(yyyGNT *rootNode) { + int yyyi; + long cycleSum = 0; + long nNZrc = 0; + + if (!yyyYok) return; + yyyCheckUnsolvedInstTrav(rootNode,&nNZrc,&cycleSum); + if (nNZrc) + { + fputs("\n\n\n**********\n",stderr); + fputs("cycle detected in completed parse tree",stderr); + fputs(" after decoration.\n",stderr); +#if CYCLE_VERBOSE + fprintf(stderr, + "number of unsolved attribute instances == %ld.\n", + nNZrc + ); + fprintf(stderr, + "total number of remaining dependencies == %ld.\n", + cycleSum + ); + fputs("average number of remaining dependencies\n",stderr); + fprintf(stderr," per unsolved instance == %f.\n", + ((float)(cycleSum)/(float)(nNZrc)) + ); +#endif + fprintf(stderr, + "searching parse tree for %ld unsolved instances:\n", + nNZrc + ); + yyyUnsolvedInstSearchTravAux(rootNode); + } + yyyDoTraversals(rootNode); +} /* yyyExecuteRRsection */ + + + +yyyWAT yyyLRCIL[2] = {0,0, +}; + + + +void yyyYoxInit(void) + { + static int yyyInitDone = 0; + if (yyyInitDone) return; + + if ((yyyRS = (struct yyyRSitem *) + calloc((size_t)(yyyRSmaxSize+1), (size_t)sizeof(struct yyyRSitem)) + ) + == + ((struct yyyRSitem *) NULL) + ) + yyyfatal("malloc error in ox ready set space allocation\n"); + yyyRS++; + yyyAfterRS = yyyRS + yyyRSmaxSize; + + + if ((yyySSALspace = (struct yyySolvedSAlistCell *) + calloc((size_t)(yyySSALspaceSize+1), (size_t)sizeof(struct yyySolvedSAlistCell)) + ) + == + ((struct yyySolvedSAlistCell *) NULL) + ) + yyyfatal("malloc error in stack solved list space allocation\n"); + yyyInitDone = 1; + + yyyRSTop = yyyRS - 1; + } /* yyyYoxInit */ + + + +void yyyDecorate(void) + { + while (yyyRSTop >= yyyRS) + yyySolveAndSignal(); + } + + + +void yyyGenIntNode(long yyyProdNum, int yyyRHSlength, int yyyNattrbs, struct yyyOxAttrbs *yyval_OxAttrbs, ...) + {yyyWST i; + yyySIT **yyyOxStackItem = &yyval_OxAttrbs->yyyOxStackItem; + yyyGNT *gnpDum; + va_list ap; + + *yyyOxStackItem = (yyySIT *) malloc((size_t)sizeof(yyySIT)); + if (*yyyOxStackItem == (yyySIT *) NULL) + yyyfatal("malloc error in ox yacc semantic stack space allocation\n"); + (*yyyOxStackItem)->node = + (yyyGNT *) malloc((size_t)sizeof(yyyGNT)); + if ((*yyyOxStackItem)->node == (yyyGNT *) NULL) + yyyfatal("malloc error in ox node space allocation\n"); + (*yyyOxStackItem)->solvedSAlist = yyyLambdaSSAL; + (*yyyOxStackItem)->node->parent.stackref = *yyyOxStackItem; + (*yyyOxStackItem)->node->parentIsStack = 1; + (*yyyOxStackItem)->node->cLlen = yyyRHSlength; + (*yyyOxStackItem)->node->cL = + (yyyGNT **) calloc((size_t)yyyRHSlength, (size_t)sizeof(yyyGNT *)); + if ((*yyyOxStackItem)->node->cL == (yyyGNT **) NULL) + yyyfatal("malloc error in ox child list space allocation\n"); + (*yyyOxStackItem)->node->refCountListLen = yyyNattrbs; + (*yyyOxStackItem)->node->refCountList = + (yyyRCT *) calloc((size_t)yyyNattrbs, (size_t)sizeof(yyyRCT)); + if ((*yyyOxStackItem)->node->refCountList == (yyyRCT *) NULL) + yyyfatal("malloc error in ox reference count list space allocation\n"); + (*yyyOxStackItem)->node->prodNum = yyyProdNum; + va_start(ap, yyval_OxAttrbs); + for (i=1;i<=yyyRHSlength;i++) + {yyySIT *yaccStDum = va_arg(ap,struct yyyOxAttrbs *)->yyyOxStackItem; + gnpDum = (*yyyOxStackItem)->node->cL[i-1] = yaccStDum->node; + gnpDum->whichSym = i; + gnpDum->parent.noderef = (*yyyOxStackItem)->node; + gnpDum->parentIsStack = 0; + } + va_end(ap); + } + + + +#define yyyDECORfREQ 50 + + + +void yyyAdjustINRC(long yyyProdNum, int yyyRHSlength, long startP, long stopP, struct yyyOxAttrbs *yyval_OxAttrbs, ...) + {yyyWST i; + yyySIT *yyyOxStackItem = yyval_OxAttrbs->yyyOxStackItem; + long SSALptr,SSALptrHead,*cPtrPtr; + long *pL; + yyyGNT *gnpDum; + long iTemp; + long nextP; + static unsigned short intNodeCount = yyyDECORfREQ; + va_list ap; + + nextP = startP; + while (nextP < stopP) + {if (yyyRCIL[nextP] == yyyR) + {(yyyOxStackItem->node->refCountList)[yyyRCIL[nextP+1]] = yyyRCIL[nextP+2]; + } + else + {(((yyyOxStackItem->node->cL)[yyyRCIL[nextP]])->refCountList)[yyyRCIL[nextP+1]] = yyyRCIL[nextP+2]; + } + nextP += 3; + } + pL = yyyIIEL + yyyIIIEL[yyyProdNum]; + va_start(ap, yyval_OxAttrbs); + for (i=1;i<=yyyRHSlength;i++) + {yyySIT *yaccStDum = va_arg(ap,struct yyyOxAttrbs *)->yyyOxStackItem; + pL++; + SSALptrHead = SSALptr = *(cPtrPtr = &(yaccStDum->solvedSAlist)); + if (SSALptr != yyyLambdaSSAL) + {*cPtrPtr = yyyLambdaSSAL; + do + { + iTemp = (*pL+yyySSALspace[SSALptr].attrbNum); + yyySignalEnts(yyyOxStackItem->node, + yyyIEL[iTemp], + yyyIEL[iTemp+1] + ); + SSALptr = *(cPtrPtr = &(yyySSALspace[SSALptr].next)); + } + while (SSALptr != yyyLambdaSSAL); + *cPtrPtr = yyySSALCfreeList; + yyySSALCfreeList = SSALptrHead; + } + } + va_end(ap); + nextP = startP + 2; + while (nextP < stopP) + {if (!yyyRCIL[nextP]) + {if (yyyRCIL[nextP-2] == yyyR) + {pL = &(yyyOxStackItem->solvedSAlist); + if (yyySSALCfreeList == yyyLambdaSSAL) + {yyySSALspace[yyyNewSSALC].next = *pL; + if ((*pL = yyyNewSSALC++) == yyySSALspaceSize) + yyyHandleOverflow(yyySSALof); + } + else + {iTemp = yyySSALCfreeList; + yyySSALCfreeList = yyySSALspace[yyySSALCfreeList].next; + yyySSALspace[iTemp].next = *pL; + *pL = iTemp; + } + yyySSALspace[*pL].attrbNum = yyyRCIL[nextP-1]; + } + else + {if ((gnpDum = (yyyOxStackItem->node->cL)[yyyRCIL[nextP-2]])->prodNum != 0) + { + iTemp = yyyIIEL[yyyIIIEL[gnpDum->prodNum]] + yyyRCIL[nextP-1]; + yyySignalEnts(gnpDum, + yyyIEL[iTemp], + yyyIEL[iTemp+1] + ); + } + } + } + nextP += 3; + } + if (!--intNodeCount) + {intNodeCount = yyyDECORfREQ; + yyyDecorate(); + } + } + + + +void yyyGenLeaf(int nAttrbs,int typeNum,long startP,long stopP,YYSTYPE *yylval) + {yyyRCT *rcPdum; + yyySIT **yyyOxStackItem = &yylval->yyyOxAttrbs.yyyOxStackItem; + (*yyyOxStackItem) = (yyySIT *) malloc((size_t)sizeof(yyySIT)); + if ((*yyyOxStackItem) == (yyySIT *) NULL) + yyyfatal("malloc error in ox yacc semantic stack space allocation\n"); + (*yyyOxStackItem)->node = + (yyyGNT *) malloc((size_t)sizeof(yyyGNT)) + ; + if ((*yyyOxStackItem)->node == (yyyGNT *) NULL) + yyyfatal("malloc error in ox node space allocation\n"); + (*yyyOxStackItem)->solvedSAlist = yyyLambdaSSAL; + (*yyyOxStackItem)->node->parent.stackref = *yyyOxStackItem; + (*yyyOxStackItem)->node->parentIsStack = 1; + (*yyyOxStackItem)->node->cLlen = 0; + (*yyyOxStackItem)->node->cL = (yyyGNT **)NULL; + (*yyyOxStackItem)->node->refCountListLen = nAttrbs; + rcPdum = (*yyyOxStackItem)->node->refCountList = + (yyyRCT *) calloc((size_t)nAttrbs, (size_t)sizeof(yyyRCT)); + if (rcPdum == (yyyRCT *) NULL) + yyyfatal("malloc error in ox reference count list space allocation\n"); + while (startP < stopP) rcPdum[yyyLRCIL[startP++]] = 0; + (*yyyOxStackItem)->node->prodNum = 0; + (*yyyOxStackItem)->node->whichSym = 0; + } + + + +void yyyabort(void) + {yyyYok = 0; + } + + + + + +#define yyyLastProdNum 8 + + +#define yyyNsorts 1 + + +int yyyProdsInd[] = { + 0, + 0, 2, 6, 10, 14, 18, 22, 24, + 26, +}; + + +int yyyProds[][2] = { +{ 116, 0},{ 462, 0},{ 462, 0},{ 462, 0},{ 412, 0}, +{ 462, 0},{ 462, 0},{ 462, 0},{ 420, 0},{ 462, 0}, +{ 462, 0},{ 462, 0},{ 452, 0},{ 462, 0},{ 462, 0}, +{ 462, 0},{ 436, 0},{ 462, 0},{ 462, 0},{ 396, 0}, +{ 462, 0},{ 404, 0},{ 462, 0},{ 619, 1},{ 462, 0}, +{ 567, 1}, +}; + + +int yyySortsInd[] = { + 0, + 0, + 1, +}; + + +int yyySorts[] = { + 413, +}; + + + +char *yyyStringTab[] = { +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,"s",0,0,0, +0,0,"y",0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,"LRpre",0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,"'('",0,0,0, +0,0,0,0,"')'", +0,0,0,0,0, +0,0,"'*'","lexeme",0, +0,0,0,0,0, +"'+'",0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,"'-'",0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,"'/'",0,0, +0,0,0,0,0, +0,0,"expr",0,0, +0,0,0,0,0, +0,0,0,0,0, +0,"printf",0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,"CONST","LRpost",0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,"ID", +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0,0,0,0,0, +0, +}; + + + +#define yyySizeofProd(num) (yyyProdsInd[(num)+1] - yyyProdsInd[(num)]) + +#define yyyGSoccurStr(prodNum,symPos) \ + (yyyStringTab[yyyProds[yyyProdsInd[(prodNum)] + (symPos)][0]]) + +#define yyySizeofSort(num) (yyySortsInd[(num)+1] - yyySortsInd[(num)]) + +#define yyySortOf(prodNum,symPos) \ + (yyyProds[yyyProdsInd[(prodNum)] + (symPos)][1]) + +#define yyyAttrbStr(prodNum,symPos,attrbNum) \ + (yyyStringTab[yyySorts[yyySortsInd[yyySortOf(prodNum,symPos)] + \ + (attrbNum) \ + ] \ + ] \ + ) + + + +void yyyShowProd(int i) + {int j,nSyms; + + nSyms = yyySizeofProd(i); + for (j=0; j\n",stderr); + else + putc('\n',stderr); + } + } + } + + + +void yyyCheckNodeInstancesSolved(yyyGNT *np) + {int mysort,sortSize,i,prodNum,symPos,inTerminalNode; + int nUnsolvedInsts = 0; + + if (np->prodNum != 0) + {inTerminalNode = 0; + prodNum = np->prodNum; + symPos = 0; + } + else + {inTerminalNode = 1; + prodNum = np->parent.noderef->prodNum; + symPos = np->whichSym; + } + mysort = yyySortOf(prodNum,symPos); + sortSize = yyySizeofSort(mysort); + for (i=0; irefCountList)[i] != 0) nUnsolvedInsts += 1; + if (nUnsolvedInsts) + {fprintf(stderr, + "\nFound node that has %d unsolved attribute instance(s).\n", + nUnsolvedInsts + ); + fprintf(stderr,"Node is labeled \"%s\".\n", + yyyGSoccurStr(prodNum,symPos)); + if (inTerminalNode) + {fputs("Node is terminal. Its parent production is:\n ",stderr); + yyyShowProd(prodNum); + } + else + {fputs("Node is nonterminal. ",stderr); + if (!(np->parentIsStack)) + {fprintf(stderr, + "Node is %dth child in its parent production:\n ", + np->whichSym + ); + yyyShowProd(np->parent.noderef->prodNum); + } + fputs("Node is on left hand side of this production:\n ",stderr); + yyyShowProd(np->prodNum); + } + fputs("The following instances are unsolved:\n",stderr); + for (i=0; irefCountList)[i] != 0) + fprintf(stderr," %-16s still has %1d dependencies.\n", + yyyAttrbStr(prodNum,symPos,i),(np->refCountList)[i]); + } + } + + + +void yyyCheckUnsolvedInstTrav(yyyGNT *pNode,long *nNZrc,long *cycleSum) + {yyyGNT **yyyCLpdum; + yyyRCT *rcp; + int i; + + /* visit the refCountList of each node in the tree, and sum the non-zero refCounts */ + rcp = pNode->refCountList; + i = pNode->refCountListLen; + while (i--) + if (*rcp++) {*cycleSum += *(rcp - 1); (*nNZrc)++;} + yyyCLpdum = pNode->cL; + i = pNode->cLlen; + while (i--) + { + yyyCheckUnsolvedInstTrav(*yyyCLpdum,nNZrc,cycleSum); + yyyCLpdum++; + } + } + + + +void yyyUnsolvedInstSearchTravAux(yyyGNT *pNode) + {yyyGNT **yyyCLpdum; + int i; + + yyyCheckNodeInstancesSolved(pNode); + yyyCLpdum = pNode->cL; + i = pNode->cLlen; + while (i--) + { + yyyUnsolvedInstSearchTravAux(*yyyCLpdum); + yyyCLpdum++; + } + } + + + +void yyyUnsolvedInstSearchTrav(yyyGNT *pNode) + {yyyGNT **yyyCLpdum; + int i; + + yyyCLpdum = pNode->cL; + i = pNode->cLlen; + while (i--) + { + yyyUnsolvedInstSearchTravAux(*yyyCLpdum); + yyyCLpdum++; + } + } + + + +#line 1645 "expr.oxout.tab.c" + +#if YYDEBUG +#include /* needed for printf */ +#endif + +#include /* needed for malloc, etc */ +#include /* needed for memset */ + +/* allocate initial stack or double stack size, up to YYMAXDEPTH */ +static int yygrowstack(YYSTACKDATA *data) +{ + int i; + unsigned newsize; + YYINT *newss; + YYSTYPE *newvs; + + if ((newsize = data->stacksize) == 0) + newsize = YYINITSTACKSIZE; + else if (newsize >= YYMAXDEPTH) + return YYENOMEM; + else if ((newsize *= 2) > YYMAXDEPTH) + newsize = YYMAXDEPTH; + + i = (int) (data->s_mark - data->s_base); + newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss)); + if (newss == 0) + return YYENOMEM; + + data->s_base = newss; + data->s_mark = newss + i; + + newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs)); + if (newvs == 0) + return YYENOMEM; + + data->l_base = newvs; + data->l_mark = newvs + i; + + data->stacksize = newsize; + data->s_last = data->s_base + newsize - 1; + return 0; +} + +#if YYPURE || defined(YY_NO_LEAKS) +static void yyfreestack(YYSTACKDATA *data) +{ + free(data->s_base); + free(data->l_base); + memset(data, 0, sizeof(*data)); +} +#else +#define yyfreestack(data) /* nothing */ +#endif + +#define YYABORT goto yyabort +#define YYREJECT goto yyabort +#define YYACCEPT goto yyaccept +#define YYERROR goto yyerrlab + +int +YYPARSE_DECL() +{ + int yym, yyn, yystate; +#if YYDEBUG + const char *yys; + + if ((yys = getenv("YYDEBUG")) != 0) + { + yyn = *yys; + if (yyn >= '0' && yyn <= '9') + yydebug = yyn - '0'; + } +#endif + + yym = 0; + yyn = 0; + yynerrs = 0; + yyerrflag = 0; + yychar = YYEMPTY; + yystate = 0; + +#if YYPURE + memset(&yystack, 0, sizeof(yystack)); +#endif + + if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow; + yystack.s_mark = yystack.s_base; + yystack.l_mark = yystack.l_base; + yystate = 0; + *yystack.s_mark = 0; + +yyloop: + if ((yyn = yydefred[yystate]) != 0) goto yyreduce; + if (yychar < 0) + { + yychar = YYLEX; + if (yychar < 0) yychar = YYEOF; +#if YYDEBUG + if (yydebug) + { + if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN]; + printf("%sdebug: state %d, reading %d (%s)\n", + YYPREFIX, yystate, yychar, yys); + } +#endif + } + if (((yyn = yysindex[yystate]) != 0) && (yyn += yychar) >= 0 && + yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar) + { +#if YYDEBUG + if (yydebug) + printf("%sdebug: state %d, shifting to state %d\n", + YYPREFIX, yystate, yytable[yyn]); +#endif + if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow; + yystate = yytable[yyn]; + *++yystack.s_mark = yytable[yyn]; + *++yystack.l_mark = yylval; + yychar = YYEMPTY; + if (yyerrflag > 0) --yyerrflag; + goto yyloop; + } + if (((yyn = yyrindex[yystate]) != 0) && (yyn += yychar) >= 0 && + yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar) + { + yyn = yytable[yyn]; + goto yyreduce; + } + if (yyerrflag != 0) goto yyinrecovery; + + YYERROR_CALL("syntax error"); + + goto yyerrlab; /* redundant goto avoids 'unused label' warning */ +yyerrlab: + ++yynerrs; + +yyinrecovery: + if (yyerrflag < 3) + { + yyerrflag = 3; + for (;;) + { + if (((yyn = yysindex[*yystack.s_mark]) != 0) && (yyn += YYERRCODE) >= 0 && + yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) YYERRCODE) + { +#if YYDEBUG + if (yydebug) + printf("%sdebug: state %d, error recovery shifting\ + to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]); +#endif + if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow; + yystate = yytable[yyn]; + *++yystack.s_mark = yytable[yyn]; + *++yystack.l_mark = yylval; + goto yyloop; + } + else + { +#if YYDEBUG + if (yydebug) + printf("%sdebug: error recovery discarding state %d\n", + YYPREFIX, *yystack.s_mark); +#endif + if (yystack.s_mark <= yystack.s_base) goto yyabort; + --yystack.s_mark; + --yystack.l_mark; + } + } + } + else + { + if (yychar == YYEOF) goto yyabort; +#if YYDEBUG + if (yydebug) + { + if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN]; + printf("%sdebug: state %d, error recovery discards token %d (%s)\n", + YYPREFIX, yystate, yychar, yys); + } +#endif + yychar = YYEMPTY; + goto yyloop; + } + +yyreduce: +#if YYDEBUG + if (yydebug) + printf("%sdebug: state %d, reducing by rule %d (%s)\n", + YYPREFIX, yystate, yyn, yyrule[yyn]); +#endif + yym = yylen[yyn]; + if (yym > 0) + yyval = yystack.l_mark[1-yym]; + else + memset(&yyval, 0, sizeof yyval); + + switch (yyn) + { +case 1: +#line 64 "expr.oxout.y" + {yyyYoxInit();} +break; +case 2: +#line 66 "expr.oxout.y" + { + yyyDecorate(); yyyExecuteRRsection(yystack.l_mark[0].yyyOxAttrbs.yyyOxStackItem->node); + } +break; +case 3: +#line 73 "expr.oxout.y" + {if(yyyYok){ +yyyGenIntNode(1,1,0,&yyval.yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs); +yyyAdjustINRC(1,1,0,0,&yyval.yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs);}} +break; +case 4: +#line 80 "expr.oxout.y" + {if(yyyYok){ +yyyGenIntNode(2,3,0,&yyval.yyyOxAttrbs,&yystack.l_mark[-2].yyyOxAttrbs,&yystack.l_mark[-1].yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs); +yyyAdjustINRC(2,3,0,0,&yyval.yyyOxAttrbs,&yystack.l_mark[-2].yyyOxAttrbs,&yystack.l_mark[-1].yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs);}} +break; +case 5: +#line 87 "expr.oxout.y" + {if(yyyYok){ +yyyGenIntNode(3,3,0,&yyval.yyyOxAttrbs,&yystack.l_mark[-2].yyyOxAttrbs,&yystack.l_mark[-1].yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs); +yyyAdjustINRC(3,3,0,0,&yyval.yyyOxAttrbs,&yystack.l_mark[-2].yyyOxAttrbs,&yystack.l_mark[-1].yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs);}} +break; +case 6: +#line 94 "expr.oxout.y" + {if(yyyYok){ +yyyGenIntNode(4,3,0,&yyval.yyyOxAttrbs,&yystack.l_mark[-2].yyyOxAttrbs,&yystack.l_mark[-1].yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs); +yyyAdjustINRC(4,3,0,0,&yyval.yyyOxAttrbs,&yystack.l_mark[-2].yyyOxAttrbs,&yystack.l_mark[-1].yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs);}} +break; +case 7: +#line 101 "expr.oxout.y" + {if(yyyYok){ +yyyGenIntNode(5,3,0,&yyval.yyyOxAttrbs,&yystack.l_mark[-2].yyyOxAttrbs,&yystack.l_mark[-1].yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs); +yyyAdjustINRC(5,3,0,0,&yyval.yyyOxAttrbs,&yystack.l_mark[-2].yyyOxAttrbs,&yystack.l_mark[-1].yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs);}} +break; +case 8: +#line 108 "expr.oxout.y" + {if(yyyYok){ +yyyGenIntNode(6,3,0,&yyval.yyyOxAttrbs,&yystack.l_mark[-2].yyyOxAttrbs,&yystack.l_mark[-1].yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs); +yyyAdjustINRC(6,3,0,0,&yyval.yyyOxAttrbs,&yystack.l_mark[-2].yyyOxAttrbs,&yystack.l_mark[-1].yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs);}} +break; +case 9: +#line 114 "expr.oxout.y" + {if(yyyYok){ +yyyGenIntNode(7,1,0,&yyval.yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs); +yyyAdjustINRC(7,1,0,0,&yyval.yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs);}} +break; +case 10: +#line 121 "expr.oxout.y" + {if(yyyYok){ +yyyGenIntNode(8,1,0,&yyval.yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs); +yyyAdjustINRC(8,1,0,0,&yyval.yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs);}} +break; +#line 1902 "expr.oxout.tab.c" + } + yystack.s_mark -= yym; + yystate = *yystack.s_mark; + yystack.l_mark -= yym; + yym = yylhs[yyn]; + if (yystate == 0 && yym == 0) + { +#if YYDEBUG + if (yydebug) + printf("%sdebug: after reduction, shifting from state 0 to\ + state %d\n", YYPREFIX, YYFINAL); +#endif + yystate = YYFINAL; + *++yystack.s_mark = YYFINAL; + *++yystack.l_mark = yyval; + if (yychar < 0) + { + yychar = YYLEX; + if (yychar < 0) yychar = YYEOF; +#if YYDEBUG + if (yydebug) + { + if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN]; + printf("%sdebug: state %d, reading %d (%s)\n", + YYPREFIX, YYFINAL, yychar, yys); + } +#endif + } + if (yychar == YYEOF) goto yyaccept; + goto yyloop; + } + if (((yyn = yygindex[yym]) != 0) && (yyn += yystate) >= 0 && + yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yystate) + yystate = yytable[yyn]; + else + yystate = yydgoto[yym]; +#if YYDEBUG + if (yydebug) + printf("%sdebug: after reduction, shifting from state %d \ +to state %d\n", YYPREFIX, *yystack.s_mark, yystate); +#endif + if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow; + *++yystack.s_mark = (YYINT) yystate; + *++yystack.l_mark = yyval; + goto yyloop; + +yyoverflow: + YYERROR_CALL("yacc stack overflow"); + +yyabort: + yyfreestack(&yystack); + return (1); + +yyaccept: + yyfreestack(&yystack); + return (0); +} Property changes on: head/contrib/byacc/test/yacc/expr.oxout.tab.c ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/contrib/byacc/test/yacc/expr.oxout.tab.h =================================================================== --- head/contrib/byacc/test/yacc/expr.oxout.tab.h (nonexistent) +++ head/contrib/byacc/test/yacc/expr.oxout.tab.h (revision 313105) @@ -0,0 +1,15 @@ +#define ID 257 +#define CONST 258 +#ifdef YYSTYPE +#undef YYSTYPE_IS_DECLARED +#define YYSTYPE_IS_DECLARED 1 +#endif +#ifndef YYSTYPE_IS_DECLARED +#define YYSTYPE_IS_DECLARED 1 +typedef union { +struct yyyOxAttrbs { +struct yyyStackItem *yyyOxStackItem; +} yyyOxAttrbs; +} YYSTYPE; +#endif /* !YYSTYPE_IS_DECLARED */ +extern YYSTYPE expr.oxout_lval; Property changes on: head/contrib/byacc/test/yacc/expr.oxout.tab.h ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/contrib/byacc =================================================================== --- head/contrib/byacc (revision 313104) +++ head/contrib/byacc (revision 313105) Property changes on: head/contrib/byacc ___________________________________________________________________ Modified: svn:mergeinfo ## -0,0 +0,1 ## Merged /vendor/byacc/dist:r313101