Index: head/contrib/byacc/CHANGES =================================================================== --- head/contrib/byacc/CHANGES (revision 297275) +++ head/contrib/byacc/CHANGES (revision 297276) @@ -1,2372 +1,2397 @@ +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 Thomas E. Dickey +2000-02-23 dickey * 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 297275) +++ head/contrib/byacc/MANIFEST (revision 297276) @@ -1,667 +1,667 @@ -MANIFEST for byacc-20150711, version t20150711 +MANIFEST for byacc-20160324, version t20160324 -------------------------------------------------------------------------------- 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/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/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/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/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/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 297275) +++ head/contrib/byacc/VERSION (revision 297276) @@ -1 +1 @@ -20150711 +20160324 Index: head/contrib/byacc/aclocal.m4 =================================================================== --- head/contrib/byacc/aclocal.m4 (revision 297275) +++ head/contrib/byacc/aclocal.m4 (revision 297276) @@ -1,1415 +1,1418 @@ -dnl $Id: aclocal.m4,v 1.38 2015/07/05 22:16:23 tom Exp $ +dnl $Id: aclocal.m4,v 1.39 2016/03/25 00:06:44 tom Exp $ dnl Macros for byacc configure script (Thomas E. Dickey) dnl --------------------------------------------------------------------------- -dnl Copyright 2004-2014,2015 Thomas E. Dickey +dnl Copyright 2004-2015,2016 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: 2 updated: 2015/04/12 15:39: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 with dnl options, but eliminates a more common category of user confusion. 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 (*[[\ \ ]]-[[IUD]]*) 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/^[[^ ]]*[[ ]]//'` CC=`echo "$CC" | sed -e 's/[[ ]].*//'` CF_ADD_CFLAGS($cf_flags) ;; (*) 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" ]) ]) test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" ])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 ---------- 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_CACHE_CHECK(for working mkstemp, cf_cv_func_mkstemp,[ rm -rf conftest* AC_TRY_RUN([ #include #include #include #include #include int main() { 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: 2 updated: 2009/08/12 04:43:14 dnl ------------ AC_DEFUN([CF_PROG_LINT], [ AC_CHECK_PROGS(LINT, tdlint lint alint splint lclint) 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: 4 updated: 2015/05/03 19:10:48 +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 + ;; +(os2*) + cf_XOPEN_SOURCE= ;; (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 297275) +++ head/contrib/byacc/config.guess (revision 297276) @@ -1,1438 +1,1447 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2015 Free Software Foundation, Inc. +# Copyright 1992-2016 Free Software Foundation, Inc. -timestamp='2015-03-04' +timestamp='2016-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;hb=HEAD +# 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-2015 Free Software Foundation, Inc. +Copyright 1992-2016 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. case "${UNAME_MACHINE_ARCH}" in arm*|earm*|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/[-_].*/\./'` + 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 ;; *: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 '[A-Z]' '[a-z]'``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; } ;; 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 ;; 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}-unknown-linux-${LIBC} + 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 configury will decide that + # 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 ;; 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 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp 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` /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 297275) +++ head/contrib/byacc/config.sub (revision 297276) @@ -1,1810 +1,1813 @@ #! /bin/sh # Configuration validation subroutine script. -# Copyright 1992-2015 Free Software Foundation, Inc. +# Copyright 1992-2016 Free Software Foundation, Inc. -timestamp='2015-03-08' +timestamp='2016-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;hb=HEAD +# 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 - $0 [OPTION] ALIAS +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-2015 Free Software Foundation, Inc. +Copyright 1992-2016 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* | \ 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 \ | pyramid \ | riscv32 | riscv64 \ | rl78 | rx \ | score \ - | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | 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-* \ | 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?-* \ + | 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) + 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 ;; 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 | ppc-le | powerpc-little) 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 | ppc64-le | powerpc64-little) 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* \ + | -aos* | -aros* | -cloudabi* | -sortix* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -bitrig* | -openbsd* | -solidbsd* \ | -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* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -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* | -tirtos*) + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ + | -onefs* | -tirtos*) # 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*) ;; -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 ;; *-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/main.c =================================================================== --- head/contrib/byacc/main.c (revision 297275) +++ head/contrib/byacc/main.c (revision 297276) @@ -1,711 +1,725 @@ -/* $Id: main.c,v 1.55 2015/07/11 00:34:19 tom Exp $ */ +/* $Id: main.c,v 1.56 2016/03/25 00:16:28 Jung-uk.Kim 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 *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; #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 */ #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]; } 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 *prefix; + char *suffix; - prefix = NULL; + 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 (!(prefix = strstr(output_file_name, OUTPUT_SUFFIX)) - && (prefix = strstr(output_file_name, ".c"))) + if (!(suffix = find_suffix(output_file_name, OUTPUT_SUFFIX)) + && (suffix = find_suffix(output_file_name, ".c"))) { defines_suffix = ".h"; externs_suffix = ".i"; } } - if (prefix != NULL) + if (suffix != NULL) { - len = (size_t) (prefix - output_file_name); + 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 (prefix != NULL) + 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 297275) +++ head/contrib/byacc/package/byacc.spec (revision 297276) @@ -1,60 +1,60 @@ Summary: byacc - public domain Berkeley LALR Yacc parser generator %define AppProgram byacc -%define AppVersion 20150711 +%define AppVersion 20160324 %define UseProgram yacc -# $XTermId: byacc.spec,v 1.28 2015/07/11 00:53:15 tom Exp $ +# $XTermId: byacc.spec,v 1.29 2016/03/24 23:55:52 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 297275) +++ head/contrib/byacc/package/debian/changelog (revision 297276) @@ -1,308 +1,314 @@ +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 297275) +++ head/contrib/byacc/package/debian/copyright (revision 297276) @@ -1,120 +1,120 @@ -Upstream source http://dickey.his.com/byacc/byacc.html +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-2014,2015 by Thomas E. Dickey +Copyright: 2004-2015,2016 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 297275) +++ head/contrib/byacc/package/mingw-byacc.spec (revision 297276) @@ -1,60 +1,60 @@ Summary: byacc - public domain Berkeley LALR Yacc parser generator %define AppProgram byacc -%define AppVersion 20150711 +%define AppVersion 20160324 %define UseProgram yacc -# $XTermId: mingw-byacc.spec,v 1.10 2015/07/11 00:53:15 tom Exp $ +# $XTermId: mingw-byacc.spec,v 1.11 2016/03/24 23:55:52 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 297275) +++ head/contrib/byacc/package/pkgsrc/Makefile (revision 297276) @@ -1,19 +1,19 @@ # $NetBSD: Makefile,v 1.9 2008/07/24 17:13:00 tonnerre Exp $ # -DISTNAME= byacc-20150711 +DISTNAME= byacc-20160324 PKGREVISION= 1 CATEGORIES= devel MASTER_SITES= ftp://invisible-island.net/byacc/ EXTRACT_SUFX= .tgz MAINTAINER= pkgsrc-users@NetBSD.org -HOMEPAGE= http://dickey.his.com/byacc/byacc.html +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 297275) +++ head/contrib/byacc/reader.c (revision 297276) @@ -1,3496 +1,3496 @@ -/* $Id: reader.c,v 1.59 2015/07/11 00:39:03 tom Exp $ */ +/* $Id: reader.c,v 1.60 2016/03/25 00:51:07 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_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; 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) { FILE *f = input_file; int c; int i; if (saw_eof || (c = getc(f)) == EOF) { if (line) { FREE(line); line = 0; } cptr = 0; saw_eof = 1; return; } if (line == 0 || linesize != (LINESIZE + 1)) { if (line) FREE(line); linesize = LINESIZE + 1; line = TMALLOC(char, linesize); NO_SPACE(line); } i = 0; ++lineno; for (;;) { 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'; cptr = line; return; } static char * dup_line(void) { char *p, *s, *t; if (line == 0) return (0); 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; int st_lineno = lineno; char *st_line = dup_line(); char *st_cptr = st_line + (cptr - line); s = cptr + 2; for (;;) { if (*s == '*' && s[1] == '/') { cptr = s + 2; FREE(st_line); return; } if (*s == '\n') { get_line(); if (line == 0) unterminated_comment(st_lineno, st_line, st_cptr); s = cptr; } else ++s; } } static int next_inline(void) { char *s; if (line == 0) { get_line(); if (line == 0) 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 == 0) 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[13]; int token; } keywords[] = { { "binary", NONASSOC }, #if defined(YYBTYACC) { "destructor", DESTRUCTOR }, #endif { "expect", EXPECT }, { "expect-rr", EXPECT_RR }, { "ident", IDENT }, { "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); return (-1); } 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; int s_lineno = lineno; char *s_line = dup_line(); char *s_cptr = s_line + (cptr - line - 1); for (;;) { c = *cptr++; mputc(temp, c); if (c == quote) { FREE(s_line); return msdone(temp); } if (c == '\n') unterminated_string(s_lineno, s_line, s_cptr); if (c == '\\') { c = *cptr++; mputc(temp, c); if (c == '\n') { get_line(); if (line == 0) unterminated_string(s_lineno, s_line, s_cptr); } } } } 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 == '*') { int c_lineno = lineno; char *c_line = dup_line(); char *c_cptr = c_line + (cptr - line - 1); mputc(temp, c); ++cptr; for (;;) { c = *cptr++; mputc(temp, c); if (c == '*' && *cptr == '/') { mputc(temp, '/'); ++cptr; FREE(c_line); return msdone(temp); } if (c == '\n') { get_line(); if (line == 0) unterminated_comment(c_lineno, c_line, c_cptr); } } } return msdone(temp); } static void copy_text(void) { int c; FILE *f = text_file; int need_newline = 0; int t_lineno = lineno; char *t_line = dup_line(); char *t_cptr = t_line + (cptr - line - 2); if (*cptr == '\n') { get_line(); if (line == 0) unterminated_text(t_lineno, t_line, t_cptr); } 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(t_lineno, t_line, t_cptr); 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(t_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; int u_lineno = lineno; char *u_line = dup_line(); char *u_cptr = u_line + (cptr - line - 6); if (unionized) over_unionized(cptr - 6); unionized = 1; if (!lflag) fprintf(text_file, line_format, lineno, input_file_name); 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"); puts_both("typedef union"); depth = 0; loop: c = *cptr++; putc_both(c); switch (c) { case '\n': get_line(); if (line == 0) unterminated_union(u_lineno, u_line, u_cptr); 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(u_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 == 0) 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'; - i = trim_blanks(buf); + (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; int s_lineno = lineno; char *s_line = dup_line(); char *s_cptr = s_line + (cptr - line); quote = *cptr++; cinc = 0; for (;;) { c = *cptr++; if (c == quote) break; if (c == '\n') unterminated_string(s_lineno, s_line, s_cptr); if (c == '\\') { char *c_cptr = cptr - 1; c = *cptr++; switch (c) { case '\n': get_line(); if (line == 0) unterminated_string(s_lineno, s_line, s_cptr); 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(s_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(*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(); 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; 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; #if defined(YYBTYACC) case LOCATIONS: locations = 1; break; case DESTRUCTOR: destructor = 1; copy_destructor(); break; #endif 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; int a_lineno = lineno; char *a_line = dup_line(); char *a_cptr = 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_lineno, a_line, a_cptr); else unterminated_arglist(a_lineno, a_line, a_cptr); } } 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_line); return msdone(s); } static char * parse_id(char *p, char **save) { char *b; while (isspace(*p)) if (*p++ == '\n') rescan_lineno++; if (!isalpha(*p) && *p != '_') return NULL; b = p; while (isalnum(*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(*p)) if (*p++ == '\n') rescan_lineno++; if (*p == '-') { neg = 1; p++; } if (!isdigit(*p)) return NULL; while (isdigit(*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(*p)) if (*p++ == '\n') rescan_lineno++; if (*p++ != '$') bad_formals(); while (isspace(*p)) if (*p++ == '\n') rescan_lineno++; if (*p == '<') { havetags = 1; if (!(p = parse_id(p + 1, &tmp))) bad_formals(); while (isspace(*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(*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(*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(*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); } #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 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(); } else { default_action_warning(); } } 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); 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 = 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 (bp->args > 0 && argslen > 0) { char *ap; int i; for (ap = args, i = 0; 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 trialaction = 0; int haveyyval = 0; #endif char *tag; FILE *f = action_file; int a_lineno = lineno; char *a_line = dup_line(); char *a_cptr = a_line + (cptr - line); Value_t *offsets = NULL, maxoffset; bucket **rhs; if (last_was_action) insert_empty_rule(); last_was_action = 1; fprintf(f, "case %d:\n", nrules - 2); #if defined(YYBTYACC) if (backtrack) { if (*cptr != L_BRAC) fprintf(f, " if (!yytrial)\n"); else trialaction = 1; } #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(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; } } #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_line); if (maxoffset > 0) FREE(offsets); return; } } #endif putc(c, f); switch (c) { case '\n': get_line(); if (line) goto loop; unterminated_action(a_lineno, a_line, a_cptr); case ';': if (depth > 0) goto loop; fprintf(f, "\nbreak;\n"); free(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_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 void copy_destructor(void) { int c; int depth; char *tag; bucket *bp; struct mstring *destructor_text = msnew(); char *code_text; int a_lineno; char *a_line; char *a_cptr; if (!lflag) msprintf(destructor_text, 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(destructor_text, '\t'); else syntax_error(lineno, line, cptr); a_lineno = lineno; a_line = dup_line(); a_cptr = 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(destructor_text, "(*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(destructor_text, "$$"); 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(destructor_text, "(*loc)"); cptr += 2; goto loop; } if (isalpha(c) || c == '_' || c == '$') { do { mputc(destructor_text, c); c = *++cptr; } while (isalnum(c) || c == '_' || c == '$'); goto loop; } ++cptr; mputc(destructor_text, c); switch (c) { case '\n': get_line(); if (line) goto loop; unterminated_action(a_lineno, a_line, a_cptr); case L_CURL: ++depth; goto loop; case R_CURL: if (--depth > 0) goto loop; goto process_symbols; case '\'': case '"': { char *s = copy_string(c); msprintf(destructor_text, "%s", s); free(s); } goto loop; case '/': { char *s = copy_comment(); msprintf(destructor_text, "%s", s); free(s); } goto loop; default: goto loop; } process_symbols: code_text = msdone(destructor_text); 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_lineno, a_line, a_cptr); 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_lineno, a_line, a_cptr); 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 */ tag = get_tag(); bp = lookup_type_destructor(tag); if (bp->destructor != NULL) destructor_redeclared_warning(a_lineno, a_line, a_cptr); 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_lineno, a_line, a_cptr); 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_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); } 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 =================================================================== --- head/contrib/byacc (revision 297275) +++ head/contrib/byacc (revision 297276) Property changes on: head/contrib/byacc ___________________________________________________________________ Modified: svn:mergeinfo ## -0,0 +0,1 ## Merged /vendor/byacc/dist:r297274