diff options
author | Jung-uk Kim <jkim@FreeBSD.org> | 2020-06-22 22:42:20 +0000 |
---|---|---|
committer | Jung-uk Kim <jkim@FreeBSD.org> | 2020-06-22 22:42:20 +0000 |
commit | 5dd99b746d26517ef72ee914e30ece2761079321 (patch) | |
tree | 30d932dc7c9813aee58587bffceac1350e1ff900 | |
parent | 8bb3d1b8fb77d3704e1de225c83b8b66ca673da8 (diff) | |
download | src-vendor/byacc.tar.gz src-vendor/byacc.zip |
Import byacc 20200330.vendor/byacc/20200330vendor/byacc
Notes
Notes:
svn path=/vendor/byacc/dist/; revision=362513
svn path=/vendor/byacc/20200330/; revision=362514; tag=vendor/byacc/20200330
267 files changed, 36060 insertions, 4519 deletions
@@ -1,3 +1,423 @@ +2020-03-30 Thomas E. Dickey <dickey@invisible-island.net> + + * package/debian/copyright: bump + + * test/yacc/grammar.tab.c, test/btyacc/grammar.tab.c, test/grammar.y, reader.c: + typo found with codespell + + * yacc.1: fixes noted in the original report, overlooked in followup + +2020-03-30 Bjarni.Ingi.Gislason + + * yacc.1: typography/spelling fixes - Debian #955175 + +2020-03-30 Thomas E. Dickey <dickey@invisible-island.net> + + * VERSION, package/byacc.spec, package/debian/changelog, package/mingw-byacc.spec, package/pkgsrc/Makefile: + bump + +2020-03-10 Thomas E. Dickey <dickey@invisible-island.net> + + * configure: regen + + * aclocal.m4: + resync with my-autoconf, mostly fixes for compiler-warnings + + * configure.in: use macro to suppress X-dependency from newer macros + +2019-12-20 Thomas E. Dickey <dickey@invisible-island.net> + + * config.guess: 2019-12-21 + +2019-11-25 Tom.Shields + + * main.c: + fix an inconsistency between the getopt and non-getopt configuration. + In the former, getopt always used "yacc", not the name of the executable. + +2019-11-25 Thomas E. Dickey <dickey@invisible-island.net> + + * test/run_make.sh: + suppress bison's -Wyacc warning, which is not useful. + + * VERSION, package/byacc.spec, package/debian/changelog, package/mingw-byacc.spec, package/pkgsrc/Makefile: + bump + +2019-11-19 Thomas E. Dickey <dickey@invisible-island.net> + + * yacc.1: new version of manpage + + * VERSION, package/byacc.spec, package/debian/changelog, package/mingw-byacc.spec, package/pkgsrc/Makefile: + bump + + * yacc.1: document %code + + * test/btyacc/calc_code_all.error, test/btyacc/calc_code_all.output, test/btyacc/calc_code_all.tab.c, test/btyacc/calc_code_all.tab.h, test/btyacc/calc_code_default.error, test/btyacc/calc_code_default.output, test/btyacc/calc_code_default.tab.c, test/btyacc/calc_code_default.tab.h, test/btyacc/calc_code_imports.error, test/btyacc/calc_code_imports.output, test/btyacc/calc_code_imports.tab.c, test/btyacc/calc_code_imports.tab.h, test/btyacc/calc_code_provides.error, test/btyacc/calc_code_provides.output, test/btyacc/calc_code_provides.tab.c, test/btyacc/calc_code_provides.tab.h, test/btyacc/calc_code_requires.error, test/btyacc/calc_code_requires.output, test/btyacc/calc_code_requires.tab.c, test/btyacc/calc_code_requires.tab.h, test/btyacc/calc_code_top.error, test/btyacc/calc_code_top.output, test/btyacc/calc_code_top.tab.c, test/btyacc/calc_code_top.tab.h, test/yacc/calc_code_all.tab.c, test/yacc/calc_code_all.tab.h, test/yacc/calc_code_default.tab.c, test/yacc/calc_code_provides.tab.c, test/yacc/calc_code_provides.tab.h, test/yacc/calc_code_requires.tab.c, test/yacc/calc_code_requires.tab.h, test/yacc/calc_code_top.tab.c: + RCS_BASE + + * output.c: + amend updates for 'outline' when processing "%code" in code-file + + * output.c: + modify output_code_lines() to show begin/end block comments which were in + reader.c, and to generate a #line for the code-file. + + * reader.c: + modify copy_code() to allow for multiple %code directives for a given + section, recording the input line-number for each directive as a #line + in the resulting string. remove the block start/end comments, since those + will be done for a whole section in output.c + + * mstring.c, defs.h: add msrenew() + + * test/yacc/calc_code_all.error, test/yacc/calc_code_all.output, test/yacc/calc_code_default.error, test/yacc/calc_code_default.output, test/yacc/calc_code_default.tab.h, test/yacc/calc_code_imports.error, test/yacc/calc_code_imports.output, test/yacc/calc_code_imports.tab.c, test/yacc/calc_code_imports.tab.h, test/yacc/calc_code_provides.error, test/yacc/calc_code_provides.output, test/yacc/calc_code_requires.error, test/yacc/calc_code_requires.output, test/yacc/calc_code_top.error, test/yacc/calc_code_top.output, test/yacc/calc_code_top.tab.h: + RCS_BASE + +2019-11-18 Thomas E. Dickey <dickey@invisible-island.net> + + * test/calc_code_imports.y, test/calc_code_all.y, test/calc_code_default.y, test/calc_code_top.y, test/calc_code_provides.y, test/calc_code_requires.y: + RCS_BASE + +2019-11-04 Michael.Forney + + * defs.h: add missing "extern" for new variable "code_lines" + +2019-11-03 Thomas E. Dickey <dickey@invisible-island.net> + + * main.c: build-fix for MinGW cross-compiling + + * output.c, reader.c: gcc-warnings + + * output.c: check validity of text_file before rewind + remove redundant check of iflag + + * main.c: fix memory-leak reported by clang + + * mkpar.c: guard against a null-reference reported by clang (unlikely) + + * reader.c: fix two coverity warnings: + a) resource leak on malloc-failure + b) possible null-pointer dereference on parse-error + + * test/btyacc/err_inherit4.tab.h, test/btyacc/btyacc_demo.tab.h: regen + + * defs.h: use enum's to simplify recent change + + * mstring.c: + enable mstring() in regular byacc, since Zoulas' change relies upon it + +2019-11-03 Christos.Zoulas + + * defs.h, reader.c, output.c: add support for bison's "%code" feature + also fix a small bug: declare YYLTYPE externally when producing locations + +2019-11-03 Thomas E. Dickey <dickey@invisible-island.net> + + * test/btyacc/help.error, test/btyacc/no_b_opt.error, test/btyacc/no_output2.error, test/btyacc/no_p_opt.error, test/yacc/help.error, test/yacc/no_b_opt.error, test/yacc/no_output2.error, test/yacc/no_p_opt.error: + regen + + * test/run_test.sh: + there's no standard wording for the options-errors from getopt; + filter that to "error message" in the test reference files. + + * main.c: + provide for using getopt(), to accommodate a case where developers have + relied upon non-POSIX behavior. + + * test/run_test.sh: + getopt's messages do not print the full pathname of yacc in some cases; + adjust the sed-script which changes those to "YACC" + + * configure: regen + + * config_h.in: regen, using autoheader-252 + + * configure.in: add configure check for getopt + + * configure: regen + + * aclocal.m4: + resync with my-autoconf adds a fix which accommodates a difference in + warning options between gcc/clang when --enable-warnings is not set. + + * VERSION, package/byacc.spec, package/debian/changelog, package/mingw-byacc.spec, package/pkgsrc/Makefile: + bump + +2019-09-11 Thomas E. Dickey <dickey@invisible-island.net> + + * config.guess, config.sub: 2019-09-10 + +2019-06-17 Thomas E. Dickey <dickey@invisible-island.net> + + * test/btyacc/big_b.error, test/btyacc/big_l.error, test/btyacc/help.error, test/btyacc/no_b_opt.error, test/btyacc/no_output2.error, test/btyacc/no_p_opt.error, test/btyacc/nostdin.error, test/yacc/big_b.error, test/yacc/big_l.error, test/yacc/help.error, test/yacc/no_b_opt.error, test/yacc/no_output2.error, test/yacc/no_p_opt.error, test/yacc/nostdin.error: + regen + + * test/run_test.sh: test "-H" rather than "-D" + +2019-06-16 Thomas E. Dickey <dickey@invisible-island.net> + + * main.c, yacc.1: + change "-D" option to "-H" (discussion with Ethan Sommer) + + * VERSION, package/byacc.spec, package/debian/changelog, package/mingw-byacc.spec, package/pkgsrc/Makefile: + bump + + * test/btyacc/defines1.calc.c, test/btyacc/defines2.calc.c, test/btyacc/defines3.calc.c: + RCS_BASE + + * test/run_test.sh: in test_defines, save the ".c" file too + + * test/yacc/defines3.calc.c, test/yacc/defines2.calc.c, test/yacc/defines1.calc.c: + RCS_BASE + + * test/run_test.sh: + output of test_defines should be a header ".h", not ".c" + + * test/btyacc/defines1.calc.h, test/btyacc/defines1.error, test/btyacc/defines1.output, test/btyacc/defines2.calc.h, test/btyacc/defines2.error, test/btyacc/defines2.output, test/btyacc/defines3.calc.h, test/btyacc/defines3.error, test/btyacc/defines3.output: + RCS_BASE + + * main.c: however, a subsequent -d cancels -D + + * test/yacc/defines1.calc.h, test/yacc/defines3.calc.h: RCS_BASE + + * main.c: -D option implies -d + + * test/yacc/defines1.error, test/yacc/defines1.output, test/yacc/defines2.calc.h, test/yacc/defines2.error, test/yacc/defines2.output, test/yacc/defines3.error, test/yacc/defines3.output: + RCS_BASE + + * yacc.1: align macro definitions with my other manpages + + * test/run_test.sh: add test for -D after -d or -b options + + * test/btyacc/stdin1.calc.c, test/btyacc/stdin1.error, test/btyacc/stdin1.output, test/btyacc/stdin2.calc.c, test/btyacc/stdin2.error, test/btyacc/stdin2.output: + RCS_BASE + + * test/btyacc/big_b.error, test/btyacc/big_b.output, test/btyacc/big_l.error, test/btyacc/big_l.output, test/btyacc/help.error, test/btyacc/help.output, test/btyacc/no_b_opt.error, test/btyacc/no_b_opt.output, test/btyacc/no_b_opt1.error, test/btyacc/no_b_opt1.output, test/btyacc/no_code_c.error, test/btyacc/no_code_c.output, test/btyacc/no_defines.error, test/btyacc/no_defines.output, test/btyacc/no_graph.error, test/btyacc/no_graph.output, test/btyacc/no_include.error, test/btyacc/no_include.output, test/btyacc/no_opts.error, test/btyacc/no_opts.output, test/btyacc/no_output.error, test/btyacc/no_output.output, test/btyacc/no_output1.error, test/btyacc/no_output1.output, test/btyacc/no_output2.error, test/btyacc/no_output2.output, test/btyacc/no_p_opt.error, test/btyacc/no_p_opt.output, test/btyacc/no_p_opt1.error, test/btyacc/no_p_opt1.output, test/btyacc/no_verbose.error, test/btyacc/no_verbose.output, test/btyacc/nostdin.error, test/btyacc/nostdin.output, test/yacc/big_b.error, test/yacc/big_b.output, test/yacc/big_l.error, test/yacc/big_l.output, 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: + regen + + * test/run_test.sh: + add a test for stdin "-" vs end-options "--", and correct a redirection + of stderr in test_flags + + * test/yacc/stdin2.output, test/yacc/stdin2.calc.c, test/yacc/stdin1.calc.c, test/yacc/stdin1.error, test/yacc/stdin1.output, test/yacc/stdin2.error: + RCS_BASE + + * 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, 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: + regen + + * main.c: add -D option, to specify filename vs y.tab.h for -d + + * defs.h: add dflag2, for -D option + + * yacc.1: document -D option + + * config_h.in: updated with autoheader-252 + + * configure: regen + + * package/debian/copyright: bump + + * aclocal.m4: add CF_GETOPT_HEADER + + * aclocal.m4: Improved autoconf macros: + + CF_CC_ENV_FLAGS + putting preprocessor flags in CFLAGS also is a nuisance, which can be + addressed in the same way. + + CF_GCC_WARNINGS + factor out workaround for XTSTRINGDEFINES as CF_CONST_X_STRING + + CF_GNU_SOURCE + The check for _DEFAULT_SOURCE should apply to "recent" Cygwin (since early 2016), + and except for "NEWLIB" vs "GLIBC" in the test, acts the same if I pretend + that "newlib" is the GNU C library. Without this, the check falls through + to the _XOPEN_SOURCE test, which breaks the pseudoterminal checks for xterm. + + CF_POSIX_C_SOURCE + add/use CF_POSIX_VISIBLE + + CF_TRY_XOPEN_SOURCE + use CF_APPEND_TEXT + + CF_WITH_MAN2HTML + use sed to work around non-POSIX tail utility + + CF_XOPEN_SOURCE + use CF_APPEND_TEXT + add/use CF_POSIX_VISIBLE + + * VERSION, package/byacc.spec, package/debian/changelog, package/mingw-byacc.spec, package/pkgsrc/Makefile: + bump + +2019-06-10 Thomas E. Dickey <dickey@invisible-island.net> + + * config.guess: 2019-06-10 + +2019-05-22 Thomas E. Dickey <dickey@invisible-island.net> + + * config.sub: 2019-05-22 + +2018-06-09 Thomas E. Dickey <dickey@invisible-island.net> + + * yacc.1: minor typographical fixes + + * test/btyacc/err_syntax20.tab.c, test/btyacc/error.tab.c, test/btyacc/expr.oxout.tab.c, test/btyacc/grammar.tab.c, test/btyacc/inherit0.tab.c, test/btyacc/inherit1.tab.c, test/btyacc/inherit2.tab.c, test/btyacc/ok_syntax1.tab.c, test/btyacc/pure_calc.tab.c, test/btyacc/pure_error.tab.c, test/btyacc/quote_calc-s.tab.c, test/btyacc/quote_calc.tab.c, test/btyacc/quote_calc2-s.tab.c, test/btyacc/quote_calc2.tab.c, test/btyacc/quote_calc3-s.tab.c, test/btyacc/quote_calc3.tab.c, test/btyacc/quote_calc4-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/btyacc_destroy1.tab.c, test/btyacc/btyacc_destroy2.tab.c, test/btyacc/btyacc_destroy3.tab.c, test/btyacc/calc.tab.c, test/btyacc/calc1.tab.c, test/btyacc/calc2.tab.c, test/btyacc/calc3.tab.c, test/btyacc/code_calc.code.c, test/btyacc/code_error.code.c, test/btyacc/empty.tab.c, test/btyacc/err_inherit3.tab.c, test/btyacc/err_inherit4.tab.c, test/btyacc/err_syntax10.tab.c, test/btyacc/err_syntax11.tab.c, test/btyacc/err_syntax12.tab.c, test/btyacc/err_syntax18.tab.c, test/btyacc/rename_debug.c, btyaccpar.c: + regen + + * VERSION, package/byacc.spec, package/debian/changelog, package/mingw-byacc.spec, package/pkgsrc/Makefile: + bump + +2018-06-09 Tom.Shields + + * btyaccpar.skel: + add casts to fix g++ (clang++) compile errors in the backtracking skeleton + due to assignment of ‘void *’ to another pointer type. + +2018-05-25 Thomas E. Dickey <dickey@invisible-island.net> + + * test/run_make.sh: + check if this is bison 3+ before adding options to suppress warnings + + * package/byacc.spec: build-fix for Mageia 6 + + * package/byacc.spec: add btyacc package + + * VERSION, package/byacc.spec, package/debian/changelog, package/mingw-byacc.spec, package/pkgsrc/Makefile: + bump + + * package/debian/control: add a package for btyacc + + * package/debian/rules: generate a package for btyacc + +2018-05-24 Thomas E. Dickey <dickey@invisible-island.net> + + * 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/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, test/btyacc/expr.oxout.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, btyaccpar.c, test/btyacc/btyacc_calc1.tab.c, test/btyacc/btyacc_demo.tab.c, test/btyacc/btyacc_destroy1.tab.c, test/btyacc/btyacc_destroy2.tab.c, test/btyacc/btyacc_destroy3.tab.c, test/btyacc/calc.tab.c, test/btyacc/calc1.tab.c, test/btyacc/calc2.tab.c, test/btyacc/calc3.tab.c, test/btyacc/code_calc.code.c, test/btyacc/rename_debug.c: + regen + + * btyaccpar.skel: fix typo + +2018-05-21 Thomas E. Dickey <dickey@invisible-island.net> + + * test/run_make.sh: + ignore case for "%" directives to skip with old-yacc, and add %token-table + to the list + + * btyaccpar.c: regen + +2018-05-21 Christos.Zoulas + + * btyaccpar.skel: + improve compatibility with bison by changing the YYLLOC_DEFAULT macro to use + YYRHSLOC() macro, and adjusting the array indices of yyerror_loc_range[] for + consistency. + +2018-05-10 Thomas E. Dickey <dickey@invisible-island.net> + + * output.c: + add a fallback definition for YYDEBUG to the -i externs file. + + * test/btyacc/rename_debug.i, test/yacc/rename_debug.i: regen + + * VERSION, package/byacc.spec, package/debian/changelog, package/mingw-byacc.spec, package/pkgsrc/Makefile: + bump + +2018-05-09 Thomas E. Dickey <dickey@invisible-island.net> + + * configure: regen + + * aclocal.m4: resync with my-autoconf + + * VERSION, package/byacc.spec, package/debian/changelog, package/mingw-byacc.spec, package/pkgsrc/Makefile: + bump + + * test/btyacc/rename_debug.i, btyaccpar.c, test/btyacc/btyacc_calc1.tab.c, test/btyacc/btyacc_demo.tab.c, test/btyacc/btyacc_destroy1.tab.c, test/btyacc/btyacc_destroy2.tab.c, test/btyacc/btyacc_destroy3.tab.c, test/btyacc/calc.tab.c, test/btyacc/calc1.tab.c, test/btyacc/calc2.tab.c, test/btyacc/calc3.tab.c, test/btyacc/code_calc.code.c, test/btyacc/code_error.code.c, test/btyacc/empty.tab.c, test/btyacc/err_inherit3.tab.c, test/btyacc/err_inherit4.tab.c, test/btyacc/err_syntax10.tab.c, test/btyacc/err_syntax11.tab.c, test/btyacc/err_syntax12.tab.c, test/btyacc/err_syntax18.tab.c, test/btyacc/err_syntax20.tab.c, test/btyacc/error.tab.c, test/btyacc/expr.oxout.tab.c, test/btyacc/grammar.tab.c, test/btyacc/inherit0.tab.c, test/btyacc/inherit1.tab.c, test/btyacc/inherit2.tab.c, test/btyacc/ok_syntax1.tab.c, test/btyacc/pure_calc.tab.c, test/btyacc/pure_error.tab.c, test/btyacc/quote_calc-s.tab.c, test/btyacc/quote_calc.tab.c, test/btyacc/quote_calc2-s.tab.c, test/btyacc/quote_calc2.tab.c, test/btyacc/quote_calc3-s.tab.c, test/btyacc/quote_calc3.tab.c, test/btyacc/quote_calc4-s.tab.c, test/btyacc/quote_calc4.tab.c, test/btyacc/rename_debug.c, test/btyacc/varsyntax_calc1.tab.c: + regen + + * btyaccpar.skel: apply Guy Harris' changes here as well + + * test/btyacc/rename_debug.i, test/yacc/rename_debug.i: regen + + * output.c: correct/improve fallback prototype for yylex() + + * test/btyacc/rename_debug.i, test/yacc/rename_debug.i: regen + +2018-05-08 Thomas E. Dickey <dickey@invisible-island.net> + + * test/btyacc/grammar.tab.c, test/yacc/grammar.tab.c: regen + + * test/grammar.y: + quiet some warnings from gcc 7 when doing "make check_make" + + * package/debian/watch, package/pkgsrc/Makefile: update ftp-url + + * test/btyacc/ok_syntax1.tab.h, test/btyacc/btyacc_calc1.tab.h: regen + + * output.c: + provide yylex() declaration for simple case (request by "Mutiny") + + * test/yacc/err_syntax20.tab.c, test/yacc/error.tab.c, test/yacc/expr.oxout.tab.c, test/yacc/grammar.tab.c, test/yacc/ok_syntax1.tab.c, test/yacc/ok_syntax1.tab.h, 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_syntax10.tab.c, test/yacc/err_syntax11.tab.c, test/yacc/err_syntax12.tab.c, test/yacc/err_syntax18.tab.c, test/yacc/rename_debug.c, test/yacc/rename_debug.i, yaccpar.c: + regen + + * VERSION, package/byacc.spec, package/debian/changelog, package/debian/copyright, package/mingw-byacc.spec, package/pkgsrc/Makefile: + bump + +2018-05-06 Guy.Harris + + * yaccpar.skel: two fixes: + 1) define yydebug only if YYDEBUG is defined and + 2) make yynerrs a parser-local variable if the parser is reentrant. + +2018-02-24 Guy.Harris + + * output.c: do not emit "extern YYSTYPE yylval;" for pure parsers + +2018-02-05 Thomas E. Dickey <dickey@invisible-island.net> + + * config.sub: 2018-01-15 + + * config.guess: 2018-01-26 + +2017-12-04 erik.b.andersen + + * main.c: A proper path for temporary files is needed by byacc under + Windows commandline, otherwise there's a risk of empty files. + The TEMP environment variable is always defined in Windows. + + * defs.h: The noreturn attribute needs to be specified before function + to be portable among compilers (gcc, clang, msvc). + +2017-12-04 Thomas E. Dickey <dickey@invisible-island.net> + + * reader.c: adapted fix by Erik B: + a) increase the length of name[] to account for a trailing null + b) note that calling syntax_error() from get_number() does not return + +2017-09-14 Tom.Shields + + * yacc.1: fix typo + +2017-07-09 Thomas E. Dickey <dickey@invisible-island.net> + + * package/byacc.spec, package/mingw-byacc.spec: + use predefined "configure" + + * reader.c: remove unused assignment + + * package/debian/rules: use dpkg-buildflags + + * configure: regen + + * aclocal.m4: resync with my-autoconf + + * reader.c, output.c, defs.h: + add/use IS_NAME1() and IS_NAME2() to reduce clutter + + * reader.c, output.c, defs.h: + guard against sign-extension in ctype-macros + + * VERSION, package/byacc.spec, package/debian/changelog, package/mingw-byacc.spec, package/pkgsrc/Makefile: + bump + + * reader.c: check for numeric overflow in get_number() + + * reader.c: + correct limit-checks for input filename and line-number, in case no valid + filename and/or number was found. + 2017-04-30 Thomas E. Dickey <dickey@invisible-island.net> * test/btyacc/quote_calc-s.tab.c, test/btyacc/quote_calc2-s.tab.c, test/btyacc/quote_calc2.tab.c, test/btyacc/quote_calc3-s.tab.c, test/btyacc/quote_calc3.tab.c, test/btyacc/quote_calc4-s.tab.c, test/btyacc/quote_calc4.tab.c, test/btyacc/varsyntax_calc1.tab.c, test/btyacc/err_syntax18.tab.c, test/btyacc/err_syntax20.tab.c, test/btyacc/error.tab.c, test/btyacc/expr.oxout.tab.c, test/btyacc/grammar.tab.c, test/btyacc/inherit0.tab.c, test/btyacc/inherit1.tab.c, test/btyacc/inherit2.tab.c, test/btyacc/ok_syntax1.tab.c, test/btyacc/pure_calc.tab.c, test/btyacc/pure_error.tab.c, test/btyacc/quote_calc.tab.c, test/btyacc/btyacc_calc1.tab.c, test/btyacc/btyacc_demo.tab.c, test/btyacc/btyacc_destroy1.tab.c, test/btyacc/btyacc_destroy2.tab.c, test/btyacc/btyacc_destroy3.tab.c, test/btyacc/calc.tab.c, test/btyacc/calc1.tab.c, test/btyacc/calc2.tab.c, test/btyacc/calc3.tab.c, test/btyacc/code_calc.code.c, test/btyacc/code_error.code.c, test/btyacc/empty.tab.c, test/btyacc/err_inherit3.tab.c, test/btyacc/err_inherit4.tab.c, test/btyacc/err_syntax10.tab.c, test/btyacc/err_syntax11.tab.c, test/btyacc/err_syntax12.tab.c, test/btyacc/rename_debug.c, btyaccpar.c, btyaccpar.skel: @@ -22,6 +442,10 @@ * VERSION, package/byacc.spec, package/debian/changelog, package/mingw-byacc.spec, package/pkgsrc/Makefile: bump +2017-04-29 Thomas E. Dickey <dickey@invisible-island.net> + + * config.sub: 2017-04-02 + 2017-03-18 Thomas E. Dickey <dickey@invisible-island.net> * config.sub: 2017-02-07 @@ -2558,7 +2982,7 @@ * vmsbuild.com: original version -2000-02-23 dickey@clark.net +2000-02-23 Thomas E. Dickey <dickey@clark.net> * test/RCS, RCS: PERMIT FILE @@ -2597,7 +3021,7 @@ * test/ftp.output, test/ftp.tab.c, test/ftp.tab.h: RCS_BASE -1993-02-22 Thomas E. Dickey <dickey@software.org> +1993-02-22 dickey@software.org * test/yacc/error.output, test/yacc/error.tab.h: reference output for testing @@ -2637,7 +3061,7 @@ * symtab.c, lalr.c, error.c: original version -1990-01-16 Thomas E. Dickey <dickey@software.org> +1990-01-16 dickey@software.org * test/code_error.y, test/pure_error.y: RCS_BASE @@ -1,4 +1,4 @@ -MANIFEST for byacc-20170430, version t20170430 +MANIFEST for byacc-20200330, version t20200330 -------------------------------------------------------------------------------- MANIFEST this file ACKNOWLEDGEMENTS original version of byacc - 1993 @@ -77,10 +77,6 @@ test/btyacc/btyacc_demo.error reference output for testing test/btyacc/btyacc_demo.output reference output for testing test/btyacc/btyacc_demo.tab.c reference output for testing test/btyacc/btyacc_demo.tab.h reference output for testing -test/btyacc/btyacc_demo2.error reference output for testing -test/btyacc/btyacc_demo2.output reference output for testing -test/btyacc/btyacc_demo2.tab.c reference output for testing -test/btyacc/btyacc_demo2.tab.h reference output for testing test/btyacc/btyacc_destroy1.error reference output for testing test/btyacc/btyacc_destroy1.output reference output for testing test/btyacc/btyacc_destroy1.tab.c reference output for testing @@ -114,11 +110,6 @@ 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 @@ -382,6 +373,7 @@ test/btyacc_demo.y testcase for btyacc test/btyacc_destroy1.y btyacc test-case for %parse-param test/btyacc_destroy2.y btyacc test-case for %parse-param test/btyacc_destroy3.y btyacc test-case for %parse-param +test/calc.tab.c c-file for calc.y 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 @@ -1 +1 @@ -20170430 +20200330 diff --git a/aclocal.m4 b/aclocal.m4 index a3d6aa04d5f2..22570b68b3e4 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,7 +1,7 @@ -dnl $Id: aclocal.m4,v 1.42 2017/02/01 10:12:21 tom Exp $ +dnl $Id: aclocal.m4,v 1.48 2020/03/10 22:53:47 tom Exp $ dnl Macros for byacc configure script (Thomas E. Dickey) dnl --------------------------------------------------------------------------- -dnl Copyright 2004-2016,2017 Thomas E. Dickey +dnl Copyright 2004-2019,2020 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 @@ -54,7 +54,7 @@ define([CF_ACVERSION_COMPARE], [ifelse([$8], , ,[$8])], [ifelse([$9], , ,[$9])])])dnl dnl --------------------------------------------------------------------------- -dnl CF_ADD_CFLAGS version: 12 updated: 2015/04/12 15:39:00 +dnl CF_ADD_CFLAGS version: 13 updated: 2017/02/25 18:57:40 dnl ------------- dnl Copy non-preprocessor flags to $CFLAGS, preprocessor flags to $CPPFLAGS dnl The second parameter if given makes this macro verbose. @@ -84,10 +84,10 @@ case $cf_fix_cppflags in && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + CF_APPEND_TEXT(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" + CF_APPEND_TEXT(cf_new_extra_cppflags,$cf_add_cflags) continue fi ;; @@ -102,17 +102,17 @@ case $cf_fix_cppflags in CF_REMOVE_DEFINE(CPPFLAGS,$CPPFLAGS,$cf_tst_cppflags) ;; esac - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + CF_APPEND_TEXT(cf_new_cppflags,$cf_add_cflags) ;; esac ;; (*) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" + CF_APPEND_TEXT(cf_new_cflags,$cf_add_cflags) ;; esac ;; (yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + CF_APPEND_TEXT(cf_new_extra_cppflags,$cf_add_cflags) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[[^"]]*"'\''//'` @@ -125,23 +125,33 @@ done if test -n "$cf_new_cflags" ; then ifelse([$2],,,[CF_VERBOSE(add to \$CFLAGS $cf_new_cflags)]) - CFLAGS="$CFLAGS $cf_new_cflags" + CF_APPEND_TEXT(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" + CF_APPEND_TEXT(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" + CF_APPEND_TEXT(EXTRA_CPPFLAGS,$cf_new_extra_cppflags) fi AC_SUBST(EXTRA_CPPFLAGS) ])dnl dnl --------------------------------------------------------------------------- +dnl CF_APPEND_TEXT version: 1 updated: 2017/02/25 18:58:55 +dnl -------------- +dnl use this macro for appending text without introducing an extra blank at +dnl the beginning +define([CF_APPEND_TEXT], +[ + test -n "[$]$1" && $1="[$]$1 " + $1="[$]{$1}$2" +])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. @@ -171,7 +181,7 @@ ifelse([$3],,[ :]dnl ])dnl ])])dnl dnl --------------------------------------------------------------------------- -dnl CF_CC_ENV_FLAGS version: 6 updated: 2016/08/29 20:57:00 +dnl CF_CC_ENV_FLAGS version: 9 updated: 2018/07/29 18:03:26 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 @@ -188,19 +198,37 @@ AC_DEFUN([CF_CC_ENV_FLAGS], # This should have been defined by AC_PROG_CC : ${CC:=cc} +AC_MSG_CHECKING(\$CFLAGS variable) +case "x$CFLAGS" in +(*-[[IUD]]*) + AC_MSG_RESULT(broken) + AC_MSG_WARN(your environment uses the CFLAGS variable to hold CPPFLAGS options) + cf_flags="$CFLAGS" + CFLAGS= + for cf_arg in $cf_flags + do + CF_ADD_CFLAGS($cf_arg) + done + ;; +(*) + AC_MSG_RESULT(ok) + ;; +esac + AC_MSG_CHECKING(\$CC variable) case "$CC" in (*[[\ \ ]]-*) AC_MSG_RESULT(broken) - AC_MSG_WARN(your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options) + AC_MSG_WARN(your environment uses the CC variable to hold CFLAGS/CPPFLAGS options) # humor him... - cf_flags=`echo "$CC" | sed -e 's/^.*[[ ]]\(-[[^ ]]\)/\1/'` - CC=`echo "$CC " | sed -e 's/[[ ]]-[[^ ]].*$//' -e 's/[[ ]]*$//'` + cf_prog=`echo "$CC" | sed -e 's/ / /g' -e 's/[[ ]]* / /g' -e 's/[[ ]]*[[ ]]-[[^ ]].*//'` + cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", [substr]([$]0,1+length(prog))); }'` + CC="$cf_prog" for cf_arg in $cf_flags do case "x$cf_arg" in (x-[[IUDfgOW]]*) - CF_ADD_CFLAGS($cf_flags) + CF_ADD_CFLAGS($cf_arg) ;; (*) CC="$CC $cf_arg" @@ -285,6 +313,66 @@ cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments" fi ]) dnl --------------------------------------------------------------------------- +dnl CF_CONST_X_STRING version: 4 updated: 2020/03/10 18:53:47 +dnl ----------------- +dnl The X11R4-X11R6 Xt specification uses an ambiguous String type for most +dnl character-strings. +dnl +dnl It is ambiguous because the specification accommodated the pre-ANSI +dnl compilers bundled by more than one vendor in lieu of providing a standard C +dnl compiler other than by costly add-ons. Because of this, the specification +dnl did not take into account the use of const for telling the compiler that +dnl string literals would be in readonly memory. +dnl +dnl As a workaround, one could (starting with X11R5) define XTSTRINGDEFINES, to +dnl let the compiler decide how to represent Xt's strings which were #define'd. +dnl That does not solve the problem of using the block of Xt's strings which +dnl are compiled into the library (and is less efficient than one might want). +dnl +dnl Xt specification 7 introduces the _CONST_X_STRING symbol which is used both +dnl when compiling the library and compiling using the library, to tell the +dnl compiler that String is const. +AC_DEFUN([CF_CONST_X_STRING], +[ +AC_REQUIRE([AC_PATH_XTRA]) + +CF_SAVE_XTRA_FLAGS([CF_CONST_X_STRING]) + +AC_TRY_COMPILE( +[ +#include <stdlib.h> +#include <X11/Intrinsic.h> +], +[String foo = malloc(1); (void)foo],[ + +AC_CACHE_CHECK(for X11/Xt const-feature,cf_cv_const_x_string,[ + AC_TRY_COMPILE( + [ +#define _CONST_X_STRING /* X11R7.8 (perhaps) */ +#undef XTSTRINGDEFINES /* X11R5 and later */ +#include <stdlib.h> +#include <X11/Intrinsic.h> + ],[String foo = malloc(1); *foo = 0],[ + cf_cv_const_x_string=no + ],[ + cf_cv_const_x_string=yes + ]) +]) + +CF_RESTORE_XTRA_FLAGS([CF_CONST_X_STRING]) + +case $cf_cv_const_x_string in +(no) + CF_APPEND_TEXT(CPPFLAGS,-DXTSTRINGDEFINES) + ;; +(*) + CF_APPEND_TEXT(CPPFLAGS,-D_CONST_X_STRING) + ;; +esac + +]) +])dnl +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 @@ -345,7 +433,7 @@ if test "$with_no_leaks" = yes ; then fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_GCC_ATTRIBUTES version: 17 updated: 2015/04/12 15:39:00 +dnl CF_GCC_ATTRIBUTES version: 18 updated: 2020/03/10 18:53:47 dnl ----------------- dnl Test for availability of useful gcc __attribute__ directives to quiet dnl compiler warnings. Though useful, not all are supported -- and contrary @@ -389,7 +477,7 @@ cat > conftest.$ac_ext <<EOF extern void wow(char *,...) GCC_SCANFLIKE(1,2); extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN; extern void foo(void) GCC_NORETURN; -int main(int argc GCC_UNUSED, char *argv[[]] GCC_UNUSED) { return 0; } +int main(int argc GCC_UNUSED, char *argv[[]] GCC_UNUSED) { (void)argc; (void)argv; return 0; } EOF cf_printf_attribute=no cf_scanf_attribute=no @@ -455,9 +543,10 @@ rm -rf conftest* fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_GCC_VERSION version: 7 updated: 2012/10/18 06:46:33 +dnl CF_GCC_VERSION version: 8 updated: 2019/09/07 13:38:36 dnl -------------- -dnl Find version of gcc +dnl Find version of gcc, and (because icc/clang pretend to be gcc without being +dnl compatible), attempt to determine if icc/clang is actually used. AC_DEFUN([CF_GCC_VERSION],[ AC_REQUIRE([AC_PROG_CC]) GCC_VERSION=none @@ -467,14 +556,17 @@ if test "$GCC" = yes ; then test -z "$GCC_VERSION" && GCC_VERSION=unknown AC_MSG_RESULT($GCC_VERSION) fi +CF_INTEL_COMPILER(GCC,INTEL_COMPILER,CFLAGS) +CF_CLANG_COMPILER(GCC,CLANG_COMPILER,CFLAGS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_GCC_WARNINGS version: 32 updated: 2015/04/12 15:39:00 +dnl CF_GCC_WARNINGS version: 37 updated: 2020/01/05 20:04:12 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 -Winline (usually not worthwhile) 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 @@ -491,14 +583,11 @@ 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) - +if test "x$have_x" = xyes; then CF_CONST_X_STRING fi cat > conftest.$ac_ext <<EOF #line __oline__ "${as_me:-configure}" int main(int argc, char *argv[[]]) { return (argv[[argc-1]] == 0) ; } EOF - if test "$INTEL_COMPILER" = yes then # The "-wdXXX" options suppress warnings: @@ -533,8 +622,7 @@ then fi done CFLAGS="$cf_save_CFLAGS" - -elif test "$GCC" = yes +elif test "$GCC" = yes && test "$GCC_VERSION" != "unknown" then AC_CHECKING([for $CC warning options]) cf_save_CFLAGS="$CFLAGS" @@ -556,15 +644,12 @@ then Wpointer-arith \ Wshadow \ Wstrict-prototypes \ - Wundef $cf_gcc_warnings $cf_warn_CONST $1 + Wundef Wno-inline $cf_gcc_warnings $cf_warn_CONST $1 do CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt" if AC_TRY_EVAL(ac_compile); then test -n "$verbose" && AC_MSG_RESULT(... -$cf_opt) case $cf_opt in - (Wcast-qual) - CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES" - ;; (Winline) case $GCC_VERSION in ([[34]].*) @@ -590,7 +675,33 @@ rm -rf conftest* AC_SUBST(EXTRA_CFLAGS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_GNU_SOURCE version: 7 updated: 2016/08/05 05:15:37 +dnl CF_GETOPT_HEADER version: 6 updated: 2014/07/22 14:45:54 +dnl ---------------- +dnl Check for getopt's variables which are commonly defined in stdlib.h, +dnl unistd.h or (nonstandard) in getopt.h +AC_DEFUN([CF_GETOPT_HEADER], +[ +AC_HAVE_HEADERS(unistd.h getopt.h) +AC_CACHE_CHECK(for header declaring getopt variables,cf_cv_getopt_header,[ +cf_cv_getopt_header=none +for cf_header in stdio.h stdlib.h unistd.h getopt.h +do +AC_TRY_COMPILE([ +#include <$cf_header>], +[int x = optind; char *y = optarg], +[cf_cv_getopt_header=$cf_header + break]) +done +]) +if test $cf_cv_getopt_header != none ; then + AC_DEFINE(HAVE_GETOPT_HEADER,1,[Define to 1 if getopt variables are declared in header]) +fi +if test $cf_cv_getopt_header = getopt.h ; then + AC_DEFINE(NEED_GETOPT_H,1,[Define to 1 if we must include getopt.h]) +fi +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_GNU_SOURCE version: 10 updated: 2018/12/10 20:09:41 dnl ------------- dnl Check if we must define _GNU_SOURCE to get a reasonable value for dnl _XOPEN_SOURCE, upon which many POSIX definitions depend. This is a defect @@ -598,38 +709,106 @@ dnl (or misfeature) of glibc2, which breaks portability of many applications, dnl since it is interwoven with GNU extensions. dnl dnl Well, yes we could work around it... +dnl +dnl Parameters: +dnl $1 is the nominal value for _XOPEN_SOURCE AC_DEFUN([CF_GNU_SOURCE], [ -AC_CACHE_CHECK(if we must define _GNU_SOURCE,cf_cv_gnu_source,[ +cf_gnu_xopen_source=ifelse($1,,500,$1) + +AC_CACHE_CHECK(if this is the GNU C library,cf_cv_gnu_library,[ AC_TRY_COMPILE([#include <sys/types.h>],[ -#ifndef _XOPEN_SOURCE -make an error -#endif], - [cf_cv_gnu_source=no], - [cf_save="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" - AC_TRY_COMPILE([#include <sys/types.h>],[ -#ifdef _XOPEN_SOURCE -make an error -#endif], - [cf_cv_gnu_source=no], - [cf_cv_gnu_source=yes]) - CPPFLAGS="$cf_save" - ]) + #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0 + return 0; + #elif __NEWLIB__ > 0 && __NEWLIB_MINOR__ >= 0 + return 0; + #else + # error not GNU C library + #endif], + [cf_cv_gnu_library=yes], + [cf_cv_gnu_library=no]) ]) -if test "$cf_cv_gnu_source" = yes -then -AC_CACHE_CHECK(if we should also define _DEFAULT_SOURCE,cf_cv_default_source,[ -CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" - AC_TRY_COMPILE([#include <sys/types.h>],[ -#ifdef _DEFAULT_SOURCE -make an error -#endif], - [cf_cv_default_source=no], - [cf_cv_default_source=yes]) +if test x$cf_cv_gnu_library = xyes; then + + # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE + # was changed to help a little. newlib incorporated the change about 4 + # years later. + AC_CACHE_CHECK(if _DEFAULT_SOURCE can be used as a basis,cf_cv_gnu_library_219,[ + cf_save="$CPPFLAGS" + CF_APPEND_TEXT(CPPFLAGS,-D_DEFAULT_SOURCE) + AC_TRY_COMPILE([#include <sys/types.h>],[ + #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2) + return 0; + #elif (__NEWLIB__ == 2 && __NEWLIB_MINOR__ >= 4) || (__GLIBC__ > 3) + return 0; + #else + # error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old + #endif], + [cf_cv_gnu_library_219=yes], + [cf_cv_gnu_library_219=no]) + CPPFLAGS="$cf_save" ]) -test "$cf_cv_default_source" = yes && CPPFLAGS="$CPPFLAGS -D_DEFAULT_SOURCE" + + if test "x$cf_cv_gnu_library_219" = xyes; then + cf_save="$CPPFLAGS" + AC_CACHE_CHECK(if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE,cf_cv_gnu_dftsrc_219,[ + CF_ADD_CFLAGS(-D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source) + AC_TRY_COMPILE([ + #include <limits.h> + #include <sys/types.h> + ],[ + #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1) + return 0; + #else + # error GNU C library is too old + #endif], + [cf_cv_gnu_dftsrc_219=yes], + [cf_cv_gnu_dftsrc_219=no]) + ]) + test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save" + else + cf_cv_gnu_dftsrc_219=maybe + fi + + if test "x$cf_cv_gnu_dftsrc_219" != xyes; then + + AC_CACHE_CHECK(if we must define _GNU_SOURCE,cf_cv_gnu_source,[ + AC_TRY_COMPILE([#include <sys/types.h>],[ + #ifndef _XOPEN_SOURCE + #error expected _XOPEN_SOURCE to be defined + #endif], + [cf_cv_gnu_source=no], + [cf_save="$CPPFLAGS" + CF_ADD_CFLAGS(-D_GNU_SOURCE) + AC_TRY_COMPILE([#include <sys/types.h>],[ + #ifdef _XOPEN_SOURCE + #error expected _XOPEN_SOURCE to be undefined + #endif], + [cf_cv_gnu_source=no], + [cf_cv_gnu_source=yes]) + CPPFLAGS="$cf_save" + ]) + ]) + + if test "$cf_cv_gnu_source" = yes + then + AC_CACHE_CHECK(if we should also define _DEFAULT_SOURCE,cf_cv_default_source,[ + CF_APPEND_TEXT(CPPFLAGS,-D_GNU_SOURCE) + AC_TRY_COMPILE([#include <sys/types.h>],[ + #ifdef _DEFAULT_SOURCE + #error expected _DEFAULT_SOURCE to be undefined + #endif], + [cf_cv_default_source=no], + [cf_cv_default_source=yes]) + ]) + if test "$cf_cv_default_source" = yes + then + CF_APPEND_TEXT(CPPFLAGS,-D_DEFAULT_SOURCE) + fi + fi + fi + fi ])dnl dnl --------------------------------------------------------------------------- @@ -935,7 +1114,7 @@ case ".[$]$1" in esac ])dnl dnl --------------------------------------------------------------------------- -dnl CF_POSIX_C_SOURCE version: 9 updated: 2015/04/12 15:39:00 +dnl CF_POSIX_C_SOURCE version: 11 updated: 2018/12/31 20:46:17 dnl ----------------- dnl Define _POSIX_C_SOURCE to the given level, and _POSIX_SOURCE if needed. dnl @@ -950,7 +1129,10 @@ dnl dnl Parameters: dnl $1 is the nominal value for _POSIX_C_SOURCE AC_DEFUN([CF_POSIX_C_SOURCE], -[ +[AC_REQUIRE([CF_POSIX_VISIBLE])dnl + +if test "$cf_cv_posix_visible" = no; then + cf_POSIX_C_SOURCE=ifelse([$1],,199506L,[$1]) cf_save_CFLAGS="$CFLAGS" @@ -988,7 +1170,8 @@ make an error fi CF_MSG_LOG(ifdef from value $cf_POSIX_C_SOURCE) CFLAGS="$cf_trim_CFLAGS" - CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source" + CPPFLAGS="$cf_trim_CPPFLAGS" + CF_APPEND_TEXT(CPPFLAGS,$cf_cv_posix_c_source) CF_MSG_LOG(if the second compile does not leave our definition intact error) AC_TRY_COMPILE([#include <sys/types.h>],[ #ifndef _POSIX_C_SOURCE @@ -1006,6 +1189,35 @@ if test "$cf_cv_posix_c_source" != no ; then CF_ADD_CFLAGS($cf_cv_posix_c_source) fi +fi # cf_cv_posix_visible + +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_POSIX_VISIBLE version: 1 updated: 2018/12/31 20:46:17 +dnl ---------------- +dnl POSIX documents test-macros which an application may set before any system +dnl headers are included to make features available. +dnl +dnl Some BSD platforms (originally FreeBSD, but copied by a few others) +dnl diverged from POSIX in 2002 by setting symbols which make all of the most +dnl recent features visible in the system header files unless the application +dnl overrides the corresponding test-macros. Doing that introduces portability +dnl problems. +dnl +dnl This macro makes a special check for the symbols used for this, to avoid a +dnl conflicting definition. +AC_DEFUN([CF_POSIX_VISIBLE], +[ +AC_CACHE_CHECK(if the POSIX test-macros are already defined,cf_cv_posix_visible,[ +AC_TRY_COMPILE([#include <stdio.h>],[ +#if defined(__POSIX_VISIBLE) && ((__POSIX_VISIBLE - 0L) > 0) \ + && defined(__XSI_VISIBLE) && ((__XSI_VISIBLE - 0L) > 0) \ + && defined(__BSD_VISIBLE) && ((__BSD_VISIBLE - 0L) > 0) \ + && defined(__ISO_C_VISIBLE) && ((__ISO_C_VISIBLE - 0L) > 0) +#error conflicting symbols found +#endif +],[cf_cv_posix_visible=no],[cf_cv_posix_visible=yes]) +]) ])dnl dnl --------------------------------------------------------------------------- dnl CF_PROG_AWK version: 1 updated: 2006/09/16 11:40:59 @@ -1017,11 +1229,15 @@ 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 CF_PROG_CC version: 5 updated: 2019/12/31 08:53:54 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],[ +CF_ACVERSION_CHECK(2.53, + [AC_MSG_WARN(this will incorrectly handle gnatgcc choice) + AC_REQUIRE([AC_PROG_CC])], + []) ifelse($1,,[AC_PROG_CC],[AC_PROG_CC($1)]) CF_GCC_VERSION CF_ACVERSION_CHECK(2.52, @@ -1030,13 +1246,14 @@ CF_ACVERSION_CHECK(2.52, CF_CC_ENV_FLAGS ])dnl dnl --------------------------------------------------------------------------- -dnl CF_PROG_GROFF version: 2 updated: 2015/07/04 11:16:27 +dnl CF_PROG_GROFF version: 3 updated: 2018/01/07 13:16:19 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) +AC_PATH_PROGS(NROFF_PATH,nroff mandoc,no) +AC_PATH_PROG(TBL_PATH,tbl,cat) if test "x$GROFF_PATH" = xno then NROFF_NOTE= @@ -1049,11 +1266,16 @@ AC_SUBST(GROFF_NOTE) AC_SUBST(NROFF_NOTE) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_PROG_LINT version: 3 updated: 2016/05/22 15:25:54 +dnl CF_PROG_LINT version: 4 updated: 2019/11/20 18:55:37 dnl ------------ AC_DEFUN([CF_PROG_LINT], [ AC_CHECK_PROGS(LINT, lint cppcheck splint) +case "x$LINT" in +(xcppcheck|x*/cppcheck) + test -z "$LINT_OPTS" && LINT_OPTS="--enable=all" + ;; +esac AC_SUBST(LINT_OPTS) ])dnl dnl --------------------------------------------------------------------------- @@ -1074,7 +1296,7 @@ $1=`echo "$2" | \ -e 's/-[[UD]]'"$3"'\(=[[^ ]]*\)\?[$]//g'` ])dnl dnl --------------------------------------------------------------------------- -dnl CF_TRY_XOPEN_SOURCE version: 1 updated: 2011/10/30 17:09:50 +dnl CF_TRY_XOPEN_SOURCE version: 2 updated: 2018/06/20 20:23:13 dnl ------------------- dnl If _XOPEN_SOURCE is not defined in the compile environment, check if we dnl can define it successfully. @@ -1090,7 +1312,7 @@ make an error #endif], [cf_cv_xopen_source=no], [cf_save="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" + CF_APPEND_TEXT(CPPFLAGS,-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE) AC_TRY_COMPILE([ #include <stdlib.h> #include <string.h> @@ -1130,6 +1352,14 @@ AC_DEFUN([CF_VERBOSE], CF_MSG_LOG([$1]) ])dnl dnl --------------------------------------------------------------------------- +dnl CF_WITHOUT_X version: 1 updated: 2020/03/03 18:27:24 +dnl ------------ +dnl Use this to cancel the check for X headers/libraries which would be pulled +dnl in via CF_GCC_WARNINGS. +define([CF_WITHOUT_X], +AC_DEFUN([CF_CONST_X_STRING],[echo "skipping X-const check";])dnl +[])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 @@ -1160,9 +1390,13 @@ if test "$with_dmalloc" = yes ; then fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_WITH_MAN2HTML version: 5 updated: 2015/08/20 04:51:36 +dnl CF_WITH_MAN2HTML version: 8 updated: 2018/06/27 18:44:03 dnl ---------------- -dnl Check for man2html and groff. Optionally prefer man2html over groff. +dnl Check for man2html and groff. Prefer man2html over groff, but use groff +dnl as a fallback. See +dnl +dnl http://invisible-island.net/scripts/man2html.html +dnl dnl Generate a shell script which hides the differences between the two. dnl dnl We name that "man2html.tmp". @@ -1171,11 +1405,35 @@ dnl The shell script can be removed later, e.g., using "make distclean". AC_DEFUN([CF_WITH_MAN2HTML],[ AC_REQUIRE([CF_PROG_GROFF]) +case "x${with_man2html}" in +(xno) + cf_man2html=no + ;; +(x|xyes) + AC_PATH_PROG(cf_man2html,man2html,no) + case "x$cf_man2html" in + (x/*) + AC_MSG_CHECKING(for the modified Earl Hood script) + if ( $cf_man2html -help 2>&1 | grep 'Make an index of headers at the end' >/dev/null ) + then + cf_man2html_ok=yes + else + cf_man2html=no + cf_man2html_ok=no + fi + AC_MSG_RESULT($cf_man2html_ok) + ;; + (*) + cf_man2html=no + ;; + esac +esac + 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_man2html=$cf_man2html]) cf_with_groff=no @@ -1223,7 +1481,7 @@ then MAN2HTML_NOTE="$GROFF_NOTE" MAN2HTML_PATH="$GROFF_PATH" cat >>$MAN2HTML_TEMP <<CF_EOF -$SHELL -c "tbl \${ROOT}.\${TYPE} | $GROFF_PATH -P -o0 -I\${ROOT}_ -Thtml -\${MACS}" +$SHELL -c "$TBL_PATH \${ROOT}.\${TYPE} | $GROFF_PATH -P -o0 -I\${ROOT}_ -Thtml -\${MACS}" CF_EOF else MAN2HTML_NOTE="" @@ -1238,7 +1496,7 @@ else MARKER CF_EOF - LC_ALL=C LC_CTYPE=C LANG=C LANGUAGE=C nroff -man conftest.in >conftest.out + LC_ALL=C LC_CTYPE=C LANG=C LANGUAGE=C $NROFF_PATH -man 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` @@ -1266,8 +1524,8 @@ CF_EOF CF_EOF done - LC_ALL=C LC_CTYPE=C LANG=C LANGUAGE=C nroff -man conftest.in >conftest.out - cf_man2html_page=`fgrep -n HEAD1 conftest.out |tail -n 1 |sed -e 's/^[[^0-9]]*://' -e 's/:.*//'` + LC_ALL=C LC_CTYPE=C LANG=C LANGUAGE=C $NROFF_PATH -man conftest.in >conftest.out + cf_man2html_page=`fgrep -n HEAD1 conftest.out |sed -n '$p' |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 @@ -1279,10 +1537,10 @@ CF_EOF MAN2HTML_OPTS="\$MAN2HTML_OPTS -index -title="\$ROOT\(\$TYPE\)" -compress -pgsize $cf_man2html_page" case \${TYPE} in (ms) - tbl \${ROOT}.\${TYPE} | nroff -\${MACS} | \$MAN2HTML_PATH -topm=0 -botm=0 \$MAN2HTML_OPTS + $TBL_PATH \${ROOT}.\${TYPE} | $NROFF_PATH -\${MACS} | \$MAN2HTML_PATH -topm=0 -botm=0 \$MAN2HTML_OPTS ;; (*) - tbl \${ROOT}.\${TYPE} | nroff -\${MACS} | \$MAN2HTML_PATH $cf_man2html_top_bot \$MAN2HTML_OPTS + $TBL_PATH \${ROOT}.\${TYPE} | $NROFF_PATH -\${MACS} | \$MAN2HTML_PATH $cf_man2html_top_bot \$MAN2HTML_OPTS ;; esac CF_EOF @@ -1326,7 +1584,7 @@ fi fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_XOPEN_SOURCE version: 52 updated: 2016/08/27 12:21:42 +dnl CF_XOPEN_SOURCE version: 55 updated: 2018/12/31 20:46:17 dnl --------------- dnl Try to get _XOPEN_SOURCE defined properly that we can use POSIX functions, dnl or adapt to the vendor's definitions to get equivalent functionality, @@ -1337,6 +1595,9 @@ dnl $1 is the nominal value for _XOPEN_SOURCE dnl $2 is the nominal value for _POSIX_C_SOURCE AC_DEFUN([CF_XOPEN_SOURCE],[ AC_REQUIRE([AC_CANONICAL_HOST]) +AC_REQUIRE([CF_POSIX_VISIBLE]) + +if test "$cf_cv_posix_visible" = no; then cf_XOPEN_SOURCE=ifelse([$1],,500,[$1]) cf_POSIX_C_SOURCE=ifelse([$2],,199506L,[$2]) @@ -1356,7 +1617,7 @@ case $host_os in cf_xopen_source="-D_DARWIN_C_SOURCE" cf_XOPEN_SOURCE= ;; -(freebsd*|dragonfly*) +(freebsd*|dragonfly*|midnightbsd*) # 5.x headers associate # _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L # _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L @@ -1375,7 +1636,7 @@ case $host_os in cf_XOPEN_SOURCE= ;; (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin) - CF_GNU_SOURCE + CF_GNU_SOURCE($cf_XOPEN_SOURCE) ;; (minix*) cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this... @@ -1451,4 +1712,5 @@ make an error CF_TRY_XOPEN_SOURCE fi fi +fi # cf_cv_posix_visible ]) diff --git a/btyaccpar.c b/btyaccpar.c index 786978afd817..64a9febd17e4 100644 --- a/btyaccpar.c +++ b/btyaccpar.c @@ -2,7 +2,7 @@ * @Id: skel2c,v 1.4 2016/06/07 00:26:09 tom Exp @ */ -/* @Id: btyaccpar.skel,v 1.6 2017/04/30 23:40:34 tom Exp @ */ +/* @Id: btyaccpar.skel,v 1.10 2018/05/25 01:03:46 tom Exp @ */ #include "defs.h" @@ -78,8 +78,9 @@ const char *const tables[] = const char *const global_vars[] = { "", + "#if YYDEBUG", "int yydebug;", - "int yynerrs;", + "#endif", 0 }; @@ -90,6 +91,8 @@ const char *const impure_vars[] = "int yychar;", "YYSTYPE yyval;", "YYSTYPE yylval;", + "int yynerrs;", + "", "#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)", "YYLTYPE yyloc; /* position returned by actions */", "YYLTYPE yylloc; /* position from the lexer */", @@ -107,17 +110,17 @@ const char *const hdr_defs[] = "{ \\", " if (n == 0) \\", " { \\", - " (loc).first_line = ((rhs)[-1]).last_line; \\", - " (loc).first_column = ((rhs)[-1]).last_column; \\", - " (loc).last_line = ((rhs)[-1]).last_line; \\", - " (loc).last_column = ((rhs)[-1]).last_column; \\", + " (loc).first_line = YYRHSLOC(rhs, 0).last_line; \\", + " (loc).first_column = YYRHSLOC(rhs, 0).last_column; \\", + " (loc).last_line = YYRHSLOC(rhs, 0).last_line; \\", + " (loc).last_column = YYRHSLOC(rhs, 0).last_column; \\", " } \\", " else \\", " { \\", - " (loc).first_line = ((rhs)[ 0 ]).first_line; \\", - " (loc).first_column = ((rhs)[ 0 ]).first_column; \\", - " (loc).last_line = ((rhs)[n-1]).last_line; \\", - " (loc).last_column = ((rhs)[n-1]).last_column; \\", + " (loc).first_line = YYRHSLOC(rhs, 1).first_line; \\", + " (loc).first_column = YYRHSLOC(rhs, 1).first_column; \\", + " (loc).last_line = YYRHSLOC(rhs, n).last_line; \\", + " (loc).last_column = YYRHSLOC(rhs, n).last_column; \\", " } \\", "} while (0)", "#endif /* YYLLOC_DEFAULT */", @@ -232,6 +235,8 @@ const char *const body_vars[] = " int yychar;", " YYSTYPE yyval;", " YYSTYPE yylval;", + " int yynerrs;", + "", "#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)", " YYLTYPE yyloc; /* position returned by actions */", " YYLTYPE yylloc; /* position from the lexer */", @@ -436,7 +441,7 @@ const char *const body_2[] = "#endif /* YYBTYACC */", #endif /* defined(YYBTYACC) */ "#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)", - " YYLTYPE yyerror_loc_range[2]; /* position of error start & end */", + " YYLTYPE yyerror_loc_range[3]; /* position of error start/end (0 unused) */", "#endif", "#if YYDEBUG", " const char *yys;", @@ -525,10 +530,10 @@ const char *const body_3[] = " size_t s = (size_t) (yylvlim - yylvals);", "", " s += YYLVQUEUEGROWTH;", - " if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem;", - " if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem;", + " if ((yylexemes = (YYINT *)realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem;", + " if ((yylvals = (YYSTYPE *)realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem;", "#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)", - " if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem;", + " if ((yylpsns = (YYLTYPE *)realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem;", "#endif", " yylvp = yylve = yylvals + p;", " yylvlim = yylvals + s;", @@ -645,7 +650,7 @@ const char *const body_3[] = " /* If this is a first conflict in the stack, start saving lexemes */", " if (!yylexemes)", " {", - " yylexemes = malloc((YYLVQUEUEGROWTH) * sizeof(YYINT));", + " yylexemes = (YYINT *) malloc((YYLVQUEUEGROWTH) * sizeof(YYINT));", " if (yylexemes == NULL) goto yyenomem;", " yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE));", " if (yylvals == NULL) goto yyenomem;", @@ -858,7 +863,7 @@ const char *const body_3[] = "", " YYERROR_CALL(\"syntax error\");", "#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)", - " yyerror_loc_range[0] = yylloc; /* lookahead position is error start position */", + " yyerror_loc_range[1] = yylloc; /* lookahead position is error start position */", "#endif", "", "#if !YYBTYACC", @@ -887,7 +892,7 @@ const char *const body_3[] = " *++yystack.l_mark = yylval;", "#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)", " /* lookahead position is error end position */", - " yyerror_loc_range[1] = yylloc;", + " yyerror_loc_range[2] = yylloc;", " YYLLOC_DEFAULT(yyloc, yyerror_loc_range, 2); /* position of error span */", " *++yystack.p_mark = yyloc;", "#endif", @@ -903,7 +908,7 @@ const char *const body_3[] = " if (yystack.s_mark <= yystack.s_base) goto yyabort;", "#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)", " /* the current TOS position is the error start position */", - " yyerror_loc_range[0] = *yystack.p_mark;", + " yyerror_loc_range[1] = *yystack.p_mark;", "#endif", "#if defined(YYDESTRUCT_CALL)", #if defined(YYBTYACC) @@ -997,10 +1002,10 @@ const char *const body_3[] = "#endif /* YYBTYACC */", #endif /* defined(YYBTYACC) */ " {", - " YYLLOC_DEFAULT(yyloc, &yystack.p_mark[1-yym], yym);", + " YYLLOC_DEFAULT(yyloc, &yystack.p_mark[-yym], yym);", " /* just in case YYERROR is invoked within the action, save", " the start of the rhs as the error start position */", - " yyerror_loc_range[0] = yystack.p_mark[1-yym];", + " yyerror_loc_range[1] = yystack.p_mark[1-yym];", " }", "#endif", "", @@ -1068,12 +1073,12 @@ const char *const trailer[] = " size_t s = (size_t) (yylvlim - yylvals);", "", " s += YYLVQUEUEGROWTH;", - " if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL)", + " if ((yylexemes = (YYINT *)realloc(yylexemes, s * sizeof(YYINT))) == NULL)", " goto yyenomem;", - " if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL)", + " if ((yylvals = (YYSTYPE *)realloc(yylvals, s * sizeof(YYSTYPE))) == NULL)", " goto yyenomem;", "#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED)", - " if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL)", + " if ((yylpsns = (YYLTYPE *)realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL)", " goto yyenomem;", "#endif", " yylvp = yylve = yylvals + p;", diff --git a/btyaccpar.skel b/btyaccpar.skel index 6f20d7dc5a54..009942ee041f 100644 --- a/btyaccpar.skel +++ b/btyaccpar.skel @@ -1,4 +1,4 @@ -/* $Id: btyaccpar.skel,v 1.7 2017/05/01 00:13:19 tom Exp $ */ +/* $Id: btyaccpar.skel,v 1.11 2018/06/10 00:41:06 Tom.Shields Exp $ */ #include "defs.h" @@ -53,14 +53,17 @@ extern const char *const yyrule[]; #endif %% global_vars +#if YYDEBUG int yydebug; -int yynerrs; +#endif %% impure_vars int yyerrflag; int yychar; YYSTYPE yyval; YYSTYPE yylval; +int yynerrs; + #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) YYLTYPE yyloc; /* position returned by actions */ YYLTYPE yylloc; /* position from the lexer */ @@ -74,17 +77,17 @@ do \ { \ if (n == 0) \ { \ - (loc).first_line = ((rhs)[-1]).last_line; \ - (loc).first_column = ((rhs)[-1]).last_column; \ - (loc).last_line = ((rhs)[-1]).last_line; \ - (loc).last_column = ((rhs)[-1]).last_column; \ + (loc).first_line = YYRHSLOC(rhs, 0).last_line; \ + (loc).first_column = YYRHSLOC(rhs, 0).last_column; \ + (loc).last_line = YYRHSLOC(rhs, 0).last_line; \ + (loc).last_column = YYRHSLOC(rhs, 0).last_column; \ } \ else \ { \ - (loc).first_line = ((rhs)[ 0 ]).first_line; \ - (loc).first_column = ((rhs)[ 0 ]).first_column; \ - (loc).last_line = ((rhs)[n-1]).last_line; \ - (loc).last_column = ((rhs)[n-1]).last_column; \ + (loc).first_line = YYRHSLOC(rhs, 1).first_line; \ + (loc).first_column = YYRHSLOC(rhs, 1).first_column; \ + (loc).last_line = YYRHSLOC(rhs, n).last_line; \ + (loc).last_column = YYRHSLOC(rhs, n).last_column; \ } \ } while (0) #endif /* YYLLOC_DEFAULT */ @@ -185,6 +188,8 @@ static YYINT *yylexemes = 0; int yychar; YYSTYPE yyval; YYSTYPE yylval; + int yynerrs; + #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) YYLTYPE yyloc; /* position returned by actions */ YYLTYPE yylloc; /* position from the lexer */ @@ -371,7 +376,7 @@ YYPARSE_DECL() YYParseState *yyerrctx = NULL; %%endif #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - YYLTYPE yyerror_loc_range[2]; /* position of error start & end */ + YYLTYPE yyerror_loc_range[3]; /* position of error start/end (0 unused) */ #endif #if YYDEBUG const char *yys; @@ -449,10 +454,10 @@ yyloop: size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; - if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; + if ((yylexemes = (YYINT *)realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; + if ((yylvals = (YYSTYPE *)realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; + if ((yylpsns = (YYLTYPE *)realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; yylvlim = yylvals + s; @@ -563,7 +568,7 @@ yyloop: /* If this is a first conflict in the stack, start saving lexemes */ if (!yylexemes) { - yylexemes = malloc((YYLVQUEUEGROWTH) * sizeof(YYINT)); + yylexemes = (YYINT *) malloc((YYLVQUEUEGROWTH) * sizeof(YYINT)); if (yylexemes == NULL) goto yyenomem; yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE)); if (yylvals == NULL) goto yyenomem; @@ -773,7 +778,7 @@ yyerrhandler: YYERROR_CALL("syntax error"); #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - yyerror_loc_range[0] = yylloc; /* lookahead position is error start position */ + yyerror_loc_range[1] = yylloc; /* lookahead position is error start position */ #endif #if !YYBTYACC @@ -802,7 +807,7 @@ yyinrecovery: *++yystack.l_mark = yylval; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) /* lookahead position is error end position */ - yyerror_loc_range[1] = yylloc; + yyerror_loc_range[2] = yylloc; YYLLOC_DEFAULT(yyloc, yyerror_loc_range, 2); /* position of error span */ *++yystack.p_mark = yyloc; #endif @@ -818,7 +823,7 @@ yyinrecovery: if (yystack.s_mark <= yystack.s_base) goto yyabort; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) /* the current TOS position is the error start position */ - yyerror_loc_range[0] = *yystack.p_mark; + yyerror_loc_range[1] = *yystack.p_mark; #endif #if defined(YYDESTRUCT_CALL) %%ifdef YYBTYACC @@ -904,10 +909,10 @@ yyreduce: if (!yytrial) %%endif { - YYLLOC_DEFAULT(yyloc, &yystack.p_mark[1-yym], yym); + YYLLOC_DEFAULT(yyloc, &yystack.p_mark[-yym], yym); /* just in case YYERROR is invoked within the action, save the start of the rhs as the error start position */ - yyerror_loc_range[0] = yystack.p_mark[1-yym]; + yyerror_loc_range[1] = yystack.p_mark[1-yym]; } #endif @@ -968,12 +973,12 @@ yyreduce: size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) + if ((yylexemes = (YYINT *)realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; - if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) + if ((yylvals = (YYSTYPE *)realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) + if ((yylpsns = (YYLTYPE *)realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; diff --git a/config.guess b/config.guess index 69ed3e573bb3..95b16c7747a1 100755 --- a/config.guess +++ b/config.guess @@ -1,8 +1,8 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2017 Free Software Foundation, Inc. +# Copyright 1992-2019 Free Software Foundation, Inc. -timestamp='2017-03-05' +timestamp='2019-12-21' # 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 @@ -15,7 +15,7 @@ timestamp='2017-03-05' # 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 <http://www.gnu.org/licenses/>. +# along with this program; if not, see <https://www.gnu.org/licenses/>. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -27,7 +27,7 @@ timestamp='2017-03-05' # 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 +# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess # # Please send patches to <config-patches@gnu.org>. @@ -39,7 +39,7 @@ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. -Operation modes: +Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit @@ -50,7 +50,7 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2017 Free Software Foundation, Inc. +Copyright 1992-2019 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." @@ -84,8 +84,6 @@ if test $# != 0; then 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 @@ -96,34 +94,40 @@ trap 'exit 1' 1 2 15 # 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= ;' +tmp= +# shellcheck disable=SC2172 +trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15 + +set_cc_for_build() { + # prevent multiple calls if $tmp is already set + test "$tmp" && return 0 + : "${TMPDIR=/tmp}" + # shellcheck disable=SC2039 + { 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" 2>/dev/null) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } + dummy=$tmp/dummy + case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in + ,,) echo "int x;" > "$dummy.c" + for driver in cc gcc c89 c99 ; do + if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then + CC_FOR_BUILD="$driver" + 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 +} # 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 +if test -f /.attbin/uname ; then PATH=$PATH:/.attbin ; export PATH fi @@ -132,14 +136,14 @@ 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 +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 + set_cc_for_build + cat <<-EOF > "$dummy.c" #include <features.h> #if defined(__UCLIBC__) LIBC=uclibc @@ -149,13 +153,20 @@ Linux|GNU|GNU/*) LIBC=gnu #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` + eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`" + + # If ldd exists, use it to detect musl libc. + if command -v ldd >/dev/null && \ + ldd --version 2>&1 | grep -q ^musl + then + LIBC=musl + fi ;; esac # Note: order is significant - the case branches are not exclusive. -case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in +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*, @@ -169,30 +180,30 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # 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 || \ + "/sbin/$sysctl" 2>/dev/null || \ + "/usr/sbin/$sysctl" 2>/dev/null || \ echo unknown)` - case "${UNAME_MACHINE_ARCH}" in + 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 + 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 ;; + *) machine="$UNAME_MACHINE_ARCH"-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently (or will in the future) and ABI. - case "${UNAME_MACHINE_ARCH}" in + case "$UNAME_MACHINE_ARCH" in earm*) os=netbsdelf ;; arm*|i386|m68k|ns32k|sh3*|sparc|vax) - eval $set_cc_for_build + set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then @@ -208,10 +219,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in ;; esac # Determine ABI tags. - case "${UNAME_MACHINE_ARCH}" in + case "$UNAME_MACHINE_ARCH" in earm*) expr='s/^earmv[0-9]/-eabi/;s/eb$//' - abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"` + abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` ;; esac # The OS release @@ -219,45 +230,60 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # 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 + case "$UNAME_VERSION" in Debian*) release='-gnu' ;; *) - release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2` + 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}" + echo "$machine-${os}${release}${abi-}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} + 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} + echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" exit ;; *:LibertyBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE} + echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" + exit ;; + *:MidnightBSD:*:*) + echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE" exit ;; *:ekkoBSD:*:*) - echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE" exit ;; *:SolidBSD:*:*) - echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE" + exit ;; + *:OS108:*:*) + echo "$UNAME_MACHINE"-unknown-os108_"$UNAME_RELEASE" exit ;; macppc:MirBSD:*:*) - echo powerpc-unknown-mirbsd${UNAME_RELEASE} + echo powerpc-unknown-mirbsd"$UNAME_RELEASE" exit ;; *:MirBSD:*:*) - echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE" exit ;; *:Sortix:*:*) - echo ${UNAME_MACHINE}-unknown-sortix + echo "$UNAME_MACHINE"-unknown-sortix + exit ;; + *:Twizzler:*:*) + echo "$UNAME_MACHINE"-unknown-twizzler + exit ;; + *:Redox:*:*) + echo "$UNAME_MACHINE"-unknown-redox + exit ;; + mips:OSF1:*.*) + echo mips-dec-osf1 exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in @@ -310,28 +336,19 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # 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` + 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 + echo "$UNAME_MACHINE"-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-morphos + echo "$UNAME_MACHINE"-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition @@ -343,7 +360,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix${UNAME_RELEASE} + echo arm-acorn-riscix"$UNAME_RELEASE" exit ;; arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos @@ -370,19 +387,19 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) - echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + 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/[^.]*//'` + 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/[^.]*//'` + echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) - echo i386-pc-auroraux${UNAME_RELEASE} + echo i386-pc-auroraux"$UNAME_RELEASE" exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) - eval $set_cc_for_build + 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. @@ -395,13 +412,13 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in SUN_ARCH=x86_64 fi fi - echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + 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/[^.]*//'` + echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in @@ -410,25 +427,25 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`" exit ;; sun3*:SunOS:*:*) - echo m68k-sun-sunos${UNAME_RELEASE} + 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 + test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) - echo m68k-sun-sunos${UNAME_RELEASE} + echo m68k-sun-sunos"$UNAME_RELEASE" ;; sun4) - echo sparc-sun-sunos${UNAME_RELEASE} + echo sparc-sun-sunos"$UNAME_RELEASE" ;; esac exit ;; aushp:SunOS:*:*) - echo sparc-auspex-sunos${UNAME_RELEASE} + 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 @@ -439,44 +456,44 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # 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} + echo m68k-atari-mint"$UNAME_RELEASE" exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint"$UNAME_RELEASE" exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint"$UNAME_RELEASE" exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} + echo m68k-milan-mint"$UNAME_RELEASE" exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} + echo m68k-hades-mint"$UNAME_RELEASE" exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} + echo m68k-unknown-mint"$UNAME_RELEASE" exit ;; m68k:machten:*:*) - echo m68k-apple-machten${UNAME_RELEASE} + echo m68k-apple-machten"$UNAME_RELEASE" exit ;; powerpc:machten:*:*) - echo powerpc-apple-machten${UNAME_RELEASE} + echo powerpc-apple-machten"$UNAME_RELEASE" exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) - echo mips-dec-ultrix${UNAME_RELEASE} + echo mips-dec-ultrix"$UNAME_RELEASE" exit ;; VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix${UNAME_RELEASE} + echo vax-dec-ultrix"$UNAME_RELEASE" exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix${UNAME_RELEASE} + echo clipper-intergraph-clix"$UNAME_RELEASE" exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" #ifdef __cplusplus #include <stdio.h> /* for printf() prototype */ int main (int argc, char *argv[]) { @@ -485,23 +502,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) - printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + 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); + 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); + 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` && + $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} + echo mips-mips-riscos"$UNAME_RELEASE" exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax @@ -527,17 +544,17 @@ EOF AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ] then - if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ - [ ${TARGET_BINARY_INTERFACE}x = x ] + if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \ + [ "$TARGET_BINARY_INTERFACE"x = x ] then - echo m88k-dg-dgux${UNAME_RELEASE} + echo m88k-dg-dgux"$UNAME_RELEASE" else - echo m88k-dg-dguxbcs${UNAME_RELEASE} + echo m88k-dg-dguxbcs"$UNAME_RELEASE" fi else - echo i586-dg-dgux${UNAME_RELEASE} + echo i586-dg-dgux"$UNAME_RELEASE" fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) @@ -554,7 +571,7 @@ EOF echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) - echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + 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 @@ -566,14 +583,14 @@ EOF if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi - echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + 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 + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" #include <sys/systemcfg.h> main() @@ -584,7 +601,7 @@ EOF exit(0); } EOF - if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` then echo "$SYSTEM_NAME" else @@ -598,7 +615,7 @@ EOF 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 + if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc @@ -607,18 +624,18 @@ EOF 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} + IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi - echo ${IBM_ARCH}-ibm-aix${IBM_REV} + echo "$IBM_ARCH"-ibm-aix"$IBM_REV" exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; - ibmrt:4.4BSD:*|romp-ibm:BSD:*) + ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) 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 + echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx @@ -633,28 +650,28 @@ EOF 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 ;; + 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 + 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 + 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 + if [ "$HP_ARCH" = "" ]; then + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" #define _HPUX_SOURCE #include <stdlib.h> @@ -687,13 +704,13 @@ EOF exit (0); } EOF - (CCOPTS="" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + (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 ] + if [ "$HP_ARCH" = hppa2.0w ] then - eval $set_cc_for_build + 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 @@ -712,15 +729,15 @@ EOF HP_ARCH=hppa64 fi fi - echo ${HP_ARCH}-hp-hpux${HPUX_REV} + 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} + 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 + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" #include <unistd.h> int main () @@ -745,11 +762,11 @@ EOF exit (0); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + $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:*:* ) + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) @@ -758,7 +775,7 @@ EOF *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; - hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) @@ -766,9 +783,9 @@ EOF exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then - echo ${UNAME_MACHINE}-unknown-osf1mk + echo "$UNAME_MACHINE"-unknown-osf1mk else - echo ${UNAME_MACHINE}-unknown-osf1 + echo "$UNAME_MACHINE"-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) @@ -793,131 +810,123 @@ EOF echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) - echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + 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/' + echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) - echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) - echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + 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/ /_/'` + 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/ /_/'` + 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} + echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE" exit ;; sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi${UNAME_RELEASE} + echo sparc-unknown-bsdi"$UNAME_RELEASE" exit ;; *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE" + exit ;; + arm:FreeBSD:*:*) + UNAME_PROCESSOR=`uname -p` + set_cc_for_build + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabi + else + echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabihf + fi exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` - case ${UNAME_PROCESSOR} in + case "$UNAME_PROCESSOR" in amd64) UNAME_PROCESSOR=x86_64 ;; i386) UNAME_PROCESSOR=i586 ;; esac - echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" exit ;; i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin + echo "$UNAME_MACHINE"-pc-cygwin exit ;; *:MINGW64*:*) - echo ${UNAME_MACHINE}-pc-mingw64 + echo "$UNAME_MACHINE"-pc-mingw64 exit ;; *:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 + 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 + echo "$UNAME_MACHINE"-pc-msys exit ;; i*:PW*:*) - echo ${UNAME_MACHINE}-pc-pw32 + echo "$UNAME_MACHINE"-pc-pw32 exit ;; *:Interix*:*) - case ${UNAME_MACHINE} in + case "$UNAME_MACHINE" in x86) - echo i586-pc-interix${UNAME_RELEASE} + echo i586-pc-interix"$UNAME_RELEASE" exit ;; authenticamd | genuineintel | EM64T) - echo x86_64-unknown-interix${UNAME_RELEASE} + echo x86_64-unknown-interix"$UNAME_RELEASE" exit ;; IA64) - echo ia64-unknown-interix${UNAME_RELEASE} + 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 + echo "$UNAME_MACHINE"-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) - echo x86_64-unknown-cygwin - exit ;; - p*:CYGWIN*:*) - echo powerpcle-unknown-cygwin + echo x86_64-pc-cygwin exit ;; prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + 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,/.*$,,'` + echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`" exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} + echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC" exit ;; - i*86:Minix:*:*) - echo ${UNAME_MACHINE}-pc-minix + *:Minix:*:*) + echo "$UNAME_MACHINE"-unknown-minix exit ;; aarch64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; @@ -928,140 +937,168 @@ EOF esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC=gnulibc1 ; fi - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; arc:Linux:*:* | arceb:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; arm*:Linux:*:*) - eval $set_cc_for_build + 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} + 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 + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi else - echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf fi fi exit ;; avr32*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; cris:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-${LIBC} + echo "$UNAME_MACHINE"-axis-linux-"$LIBC" exit ;; crisv32:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-${LIBC} + echo "$UNAME_MACHINE"-axis-linux-"$LIBC" exit ;; e2k:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; frv:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; hexagon:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; i*86:Linux:*:*) - echo ${UNAME_MACHINE}-pc-linux-${LIBC} + echo "$UNAME_MACHINE"-pc-linux-"$LIBC" exit ;; ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; k1om:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; mips:Linux:*:* | mips64:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + set_cc_for_build + IS_GLIBC=0 + test x"${LIBC}" = xgnu && IS_GLIBC=1 + sed 's/^ //' << EOF > "$dummy.c" #undef CPU - #undef ${UNAME_MACHINE} - #undef ${UNAME_MACHINE}el + #undef mips + #undef mipsel + #undef mips64 + #undef mips64el + #if ${IS_GLIBC} && defined(_ABI64) + LIBCABI=gnuabi64 + #else + #if ${IS_GLIBC} && defined(_ABIN32) + LIBCABI=gnuabin32 + #else + LIBCABI=${LIBC} + #endif + #endif + + #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 + CPU=mipsisa64r6 + #else + #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 + CPU=mipsisa32r6 + #else + #if defined(__mips64) + CPU=mips64 + #else + CPU=mips + #endif + #endif + #endif + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=${UNAME_MACHINE}el + MIPS_ENDIAN=el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=${UNAME_MACHINE} + MIPS_ENDIAN= #else - CPU= + MIPS_ENDIAN= #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; } + eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'`" + test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; } ;; mips64el:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; openrisc*:Linux:*:*) - echo or1k-unknown-linux-${LIBC} + echo or1k-unknown-linux-"$LIBC" exit ;; or32:Linux:*:* | or1k*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; padre:Linux:*:*) - echo sparc-unknown-linux-${LIBC} + echo sparc-unknown-linux-"$LIBC" exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-${LIBC} + 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} ;; + 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} + echo powerpc64-unknown-linux-"$LIBC" exit ;; ppc:Linux:*:*) - echo powerpc-unknown-linux-${LIBC} + echo powerpc-unknown-linux-"$LIBC" exit ;; ppc64le:Linux:*:*) - echo powerpc64le-unknown-linux-${LIBC} + echo powerpc64le-unknown-linux-"$LIBC" exit ;; ppcle:Linux:*:*) - echo powerpcle-unknown-linux-${LIBC} + echo powerpcle-unknown-linux-"$LIBC" exit ;; riscv32:Linux:*:* | riscv64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux-${LIBC} + echo "$UNAME_MACHINE"-ibm-linux-"$LIBC" exit ;; sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; tile*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; vax:Linux:*:*) - echo ${UNAME_MACHINE}-dec-linux-${LIBC} + echo "$UNAME_MACHINE"-dec-linux-"$LIBC" exit ;; x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-pc-linux-${LIBC} + echo "$UNAME_MACHINE"-pc-linux-"$LIBC" exit ;; xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. @@ -1075,34 +1112,34 @@ EOF # 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} + 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 + echo "$UNAME_MACHINE"-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) - echo ${UNAME_MACHINE}-unknown-stop + echo "$UNAME_MACHINE"-unknown-stop exit ;; i*86:atheos:*:*) - echo ${UNAME_MACHINE}-unknown-atheos + echo "$UNAME_MACHINE"-unknown-atheos exit ;; i*86:syllable:*:*) - echo ${UNAME_MACHINE}-pc-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} + echo i386-unknown-lynxos"$UNAME_RELEASE" exit ;; i*86:*DOS:*:*) - echo ${UNAME_MACHINE}-pc-msdosdjgpp + echo "$UNAME_MACHINE"-pc-msdosdjgpp exit ;; - i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) - UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + i*86:*: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} + echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL" else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL" fi exit ;; i*86:*:5:[678]*) @@ -1112,12 +1149,12 @@ EOF *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac - echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + 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' </usr/options/cb.name` - echo ${UNAME_MACHINE}-pc-isc$UNAME_REL + echo "$UNAME_MACHINE"-pc-isc"$UNAME_REL" elif /bin/uname -X 2>/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 @@ -1127,9 +1164,9 @@ EOF && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 - echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL" else - echo ${UNAME_MACHINE}-pc-sysv32 + echo "$UNAME_MACHINE"-pc-sysv32 fi exit ;; pc:*:*:*) @@ -1149,9 +1186,9 @@ EOF 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 + 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 + echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) @@ -1171,9 +1208,9 @@ EOF 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; } + && { 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; } ;; + && { 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; } ;; @@ -1182,28 +1219,28 @@ EOF 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; } + && { 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; } + && { 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; } ;; + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos${UNAME_RELEASE} + 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} + echo sparc-unknown-lynxos"$UNAME_RELEASE" exit ;; rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos${UNAME_RELEASE} + echo rs6000-unknown-lynxos"$UNAME_RELEASE" exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) - echo powerpc-unknown-lynxos${UNAME_RELEASE} + echo powerpc-unknown-lynxos"$UNAME_RELEASE" exit ;; SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv${UNAME_RELEASE} + echo mips-dde-sysv"$UNAME_RELEASE" exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 @@ -1214,7 +1251,7 @@ EOF *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` - echo ${UNAME_MACHINE}-sni-sysv4 + echo "$UNAME_MACHINE"-sni-sysv4 else echo ns32k-sni-sysv fi @@ -1234,23 +1271,23 @@ EOF exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. - echo ${UNAME_MACHINE}-stratus-vos + 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} + 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} + echo mips-nec-sysv"$UNAME_RELEASE" else - echo mips-unknown-sysv${UNAME_RELEASE} + echo mips-unknown-sysv"$UNAME_RELEASE" fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. @@ -1269,60 +1306,68 @@ EOF echo x86_64-unknown-haiku exit ;; SX-4:SUPER-UX:*:*) - echo sx4-nec-superux${UNAME_RELEASE} + echo sx4-nec-superux"$UNAME_RELEASE" exit ;; SX-5:SUPER-UX:*:*) - echo sx5-nec-superux${UNAME_RELEASE} + echo sx5-nec-superux"$UNAME_RELEASE" exit ;; SX-6:SUPER-UX:*:*) - echo sx6-nec-superux${UNAME_RELEASE} + echo sx6-nec-superux"$UNAME_RELEASE" exit ;; SX-7:SUPER-UX:*:*) - echo sx7-nec-superux${UNAME_RELEASE} + echo sx7-nec-superux"$UNAME_RELEASE" exit ;; SX-8:SUPER-UX:*:*) - echo sx8-nec-superux${UNAME_RELEASE} + echo sx8-nec-superux"$UNAME_RELEASE" exit ;; SX-8R:SUPER-UX:*:*) - echo sx8r-nec-superux${UNAME_RELEASE} + echo sx8r-nec-superux"$UNAME_RELEASE" exit ;; SX-ACE:SUPER-UX:*:*) - echo sxace-nec-superux${UNAME_RELEASE} + echo sxace-nec-superux"$UNAME_RELEASE" exit ;; Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody${UNAME_RELEASE} + echo powerpc-apple-rhapsody"$UNAME_RELEASE" exit ;; *:Rhapsody:*:*) - echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + 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 + UNAME_PROCESSOR=`uname -p` + case $UNAME_PROCESSOR in + unknown) UNAME_PROCESSOR=powerpc ;; + esac + if command -v xcode-select > /dev/null 2> /dev/null && \ + ! xcode-select --print-path > /dev/null 2> /dev/null ; then + # Avoid executing cc if there is no toolchain installed as + # cc will be a stub that puts up a graphical alert + # prompting the user to install developer tools. + CC_FOR_BUILD=no_compiler_found + else + set_cc_for_build 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 + 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 + # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc + if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_PPC >/dev/null + then + UNAME_PROCESSOR=powerpc 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 + # uname -m returns i386 or x86_64 + UNAME_PROCESSOR=$UNAME_MACHINE fi - echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE" exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` @@ -1330,22 +1375,25 @@ EOF UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi - echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + 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} + NEO-*:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk"$UNAME_RELEASE" exit ;; NSE-*:NONSTOP_KERNEL:*:*) - echo nse-tandem-nsk${UNAME_RELEASE} + echo nse-tandem-nsk"$UNAME_RELEASE" exit ;; - NSR-?:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk${UNAME_RELEASE} + NSR-*:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk"$UNAME_RELEASE" exit ;; - NSX-?:NONSTOP_KERNEL:*:*) - echo nsx-tandem-nsk${UNAME_RELEASE} + NSV-*:NONSTOP_KERNEL:*:*) + echo nsv-tandem-nsk"$UNAME_RELEASE" + exit ;; + NSX-*:NONSTOP_KERNEL:*:*) + echo nsx-tandem-nsk"$UNAME_RELEASE" exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux @@ -1354,18 +1402,19 @@ EOF echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) - echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + 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. + # shellcheck disable=SC2154 if test "$cputype" = 386; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi - echo ${UNAME_MACHINE}-unknown-plan9 + echo "$UNAME_MACHINE"-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 @@ -1386,14 +1435,14 @@ EOF echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} + echo mips-sei-seiux"$UNAME_RELEASE" exit ;; *:DragonFly:*:*) - echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` - case "${UNAME_MACHINE}" in + case "$UNAME_MACHINE" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; @@ -1402,32 +1451,184 @@ EOF echo i386-pc-xenix exit ;; i*86:skyos:*:*) - echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'` + echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`" exit ;; i*86:rdos:*:*) - echo ${UNAME_MACHINE}-pc-rdos + echo "$UNAME_MACHINE"-pc-rdos exit ;; i*86:AROS:*:*) - echo ${UNAME_MACHINE}-pc-aros + echo "$UNAME_MACHINE"-pc-aros exit ;; x86_64:VMkernel:*:*) - echo ${UNAME_MACHINE}-unknown-esx + echo "$UNAME_MACHINE"-unknown-esx exit ;; amd64:Isilon\ OneFS:*:*) echo x86_64-unknown-onefs exit ;; + *:Unleashed:*:*) + echo "$UNAME_MACHINE"-unknown-unleashed"$UNAME_RELEASE" + exit ;; +esac + +# No uname command or uname output not recognized. +set_cc_for_build +cat > "$dummy.c" <<EOF +#ifdef _SEQUENT_ +#include <sys/types.h> +#include <sys/utsname.h> +#endif +#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) +#if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) +#include <signal.h> +#if defined(_SIZE_T_) || defined(SIGLOST) +#include <sys/utsname.h> +#endif +#endif +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include <sys/param.h> + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); +#endif + +#if defined (vax) +#if !defined (ultrix) +#include <sys/param.h> +#if defined (BSD) +#if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +#else +#if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +#else + printf ("vax-dec-bsd\n"); exit (0); +#endif +#endif +#else + printf ("vax-dec-bsd\n"); exit (0); +#endif +#else +#if defined(_SIZE_T_) || defined(SIGLOST) + struct utsname un; + uname (&un); + printf ("vax-dec-ultrix%s\n", un.release); exit (0); +#else + printf ("vax-dec-ultrix\n"); exit (0); +#endif +#endif +#endif +#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) +#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) +#if defined(_SIZE_T_) || defined(SIGLOST) + struct utsname *un; + uname (&un); + printf ("mips-dec-ultrix%s\n", un.release); exit (0); +#else + printf ("mips-dec-ultrix\n"); exit (0); +#endif +#endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. +test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; } + +echo "$0: unable to guess system type" >&2 + +case "$UNAME_MACHINE:$UNAME_SYSTEM" in + mips:Linux | mips64:Linux) + # If we got here on MIPS GNU/Linux, output extra information. + cat >&2 <<EOF + +NOTE: MIPS GNU/Linux systems require a C compiler to fully recognize +the system type. Please install a C compiler and try again. +EOF + ;; esac cat >&2 <<EOF -$0: unable to guess system type This script (version $timestamp), has failed to recognize the -operating system you are using. If your script is old, overwrite -config.guess and config.sub with the latest versions from: +operating system you are using. If your script is old, overwrite *all* +copies of config.guess and config.sub with the latest versions from: - http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess + https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess and - http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub + https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub If $0 has already been updated, send the following data and any information you think might be pertinent to config-patches@gnu.org to @@ -1450,16 +1651,16 @@ hostinfo = `(hostinfo) 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} +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) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" diff --git a/config.sub b/config.sub index 87abeab6cdfc..0f2234c174d4 100755 --- a/config.sub +++ b/config.sub @@ -1,8 +1,8 @@ #! /bin/sh # Configuration validation subroutine script. -# Copyright 1992-2017 Free Software Foundation, Inc. +# Copyright 1992-2019 Free Software Foundation, Inc. -timestamp='2017-02-07' +timestamp='2019-06-30' # 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 @@ -15,7 +15,7 @@ timestamp='2017-02-07' # 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 <http://www.gnu.org/licenses/>. +# along with this program; if not, see <https://www.gnu.org/licenses/>. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -33,7 +33,7 @@ timestamp='2017-02-07' # 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 +# https://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 @@ -57,7 +57,7 @@ Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS Canonicalize a configuration name. -Operation modes: +Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit @@ -67,7 +67,7 @@ Report bugs and patches to <config-patches@gnu.org>." version="\ GNU config.sub ($timestamp) -Copyright 1992-2017 Free Software Foundation, Inc. +Copyright 1992-2019 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." @@ -89,12 +89,12 @@ while test $# -gt 0 ; do - ) # Use stdin as input. break ;; -* ) - echo "$me: invalid option $1$help" + echo "$me: invalid option $1$help" >&2 exit 1 ;; *local*) # First pass through any local machine types. - echo $1 + echo "$1" exit ;; * ) @@ -110,1247 +110,1164 @@ case $# in exit 1;; esac -# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). -# Here we must recognize all the valid KERNEL-OS combinations. -maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` -case $maybe_os in - nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ - linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ - knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ - kopensolaris*-gnu* | cloudabi*-eabi* | \ - storm-chaos* | os2-emx* | rtmk-nova*) - os=-$maybe_os - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` - ;; - android-linux) - os=-linux-android - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown - ;; - *) - basic_machine=`echo $1 | sed 's/-[^-]*$//'` - if [ $basic_machine != $1 ] - then os=`echo $1 | sed 's/.*-/-/'` - else os=; fi - ;; -esac +# Split fields of configuration type +# shellcheck disable=SC2162 +IFS="-" read field1 field2 field3 field4 <<EOF +$1 +EOF -### 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 +# Separate into logical components for further validation +case $1 in + *-*-*-*-*) + echo Invalid configuration \`"$1"\': more than four components >&2 + exit 1 ;; - -ptx*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + *-*-*-*) + basic_machine=$field1-$field2 + os=$field3-$field4 ;; - -windowsnt*) - os=`echo $os | sed -e 's/windowsnt/winnt/'` + *-*-*) + # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two + # parts + maybe_os=$field2-$field3 + case $maybe_os in + nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc \ + | linux-newlib* | linux-musl* | linux-uclibc* | uclinux-uclibc* \ + | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ + | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ + | storm-chaos* | os2-emx* | rtmk-nova*) + basic_machine=$field1 + os=$maybe_os + ;; + android-linux) + basic_machine=$field1-unknown + os=linux-android + ;; + *) + basic_machine=$field1-$field2 + os=$field3 + ;; + esac ;; - -psos*) - os=-psos + *-*) + # A lone config we happen to match not fitting any pattern + case $field1-$field2 in + decstation-3100) + basic_machine=mips-dec + os= + ;; + *-*) + # Second component is usually, but not always the OS + case $field2 in + # Prevent following clause from handling this valid os + sun*os*) + basic_machine=$field1 + os=$field2 + ;; + # Manufacturers + dec* | mips* | sequent* | encore* | pc533* | 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* | sim | cisco \ + | oki | wec | wrs | winbond) + basic_machine=$field1-$field2 + os= + ;; + *) + basic_machine=$field1 + os=$field2 + ;; + esac + ;; + esac ;; - -mint | -mint[0-9]*) - basic_machine=m68k-atari - os=-mint + *) + # Convert single-component short-hands not valid as part of + # multi-component configurations. + case $field1 in + 386bsd) + basic_machine=i386-pc + os=bsd + ;; + a29khif) + basic_machine=a29k-amd + os=udi + ;; + adobe68k) + basic_machine=m68010-adobe + os=scout + ;; + alliant) + basic_machine=fx80-alliant + os= + ;; + altos | altos3068) + basic_machine=m68k-altos + os= + ;; + am29k) + basic_machine=a29k-none + os=bsd + ;; + amdahl) + basic_machine=580-amdahl + os=sysv + ;; + amiga) + basic_machine=m68k-unknown + os= + ;; + 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 + ;; + aux) + basic_machine=m68k-apple + os=aux + ;; + balance) + basic_machine=ns32k-sequent + os=dynix + ;; + blackfin) + basic_machine=bfin-unknown + os=linux + ;; + 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) + basic_machine=j90-cray + os=unicos + ;; + crds | unos) + basic_machine=m68k-crds + os= + ;; + da30) + basic_machine=m68k-da30 + os= + ;; + decstation | pmax | pmin | dec3100 | decstatn) + basic_machine=mips-dec + os= + ;; + delta88) + basic_machine=m88k-motorola + os=sysv3 + ;; + dicos) + basic_machine=i686-pc + os=dicos + ;; + djgpp) + basic_machine=i586-pc + os=msdosdjgpp + ;; + ebmon29k) + basic_machine=a29k-amd + os=ebmon + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=ose + ;; + gmicro) + basic_machine=tron-gmicro + os=sysv + ;; + go32) + basic_machine=i386-pc + os=go32 + ;; + 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 | hp300hpux) + basic_machine=m68k-hp + os=hpux + ;; + hp300bsd) + basic_machine=m68k-hp + os=bsd + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=proelf + ;; + i386mach) + basic_machine=i386-mach + os=mach + ;; + isi68 | isi) + basic_machine=m68k-isi + os=sysv + ;; + m68knommu) + basic_machine=m68k-unknown + os=linux + ;; + magnum | m3230) + basic_machine=mips-mips + os=sysv + ;; + merlin) + basic_machine=ns32k-utek + os=sysv + ;; + mingw64) + basic_machine=x86_64-pc + os=mingw64 + ;; + mingw32) + basic_machine=i686-pc + os=mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + os=mingw32ce + ;; + 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 + ;; + 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-pc + 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 + ;; + necv70) + basic_machine=v70-nec + os=sysv + ;; + 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 + ;; + os400) + basic_machine=powerpc-ibm + os=os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=ose + ;; + os68k) + basic_machine=m68k-none + os=os68k + ;; + paragon) + basic_machine=i860-intel + os=osf + ;; + parisc) + basic_machine=hppa-unknown + os=linux + ;; + 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 + ;; + sa29200) + basic_machine=a29k-amd + os=udi + ;; + sei) + basic_machine=mips-sei + os=seiux + ;; + sequent) + basic_machine=i386-sequent + os= + ;; + sps7) + basic_machine=m68k-bull + os=sysv2 + ;; + st2000) + basic_machine=m68k-tandem + os= + ;; + stratus) + basic_machine=i860-stratus + os=sysv4 + ;; + sun2) + basic_machine=m68000-sun + os= + ;; + sun2os3) + basic_machine=m68000-sun + os=sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=sunos4 + ;; + sun3) + basic_machine=m68k-sun + os= + ;; + sun3os3) + basic_machine=m68k-sun + os=sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=sunos4 + ;; + sun4) + basic_machine=sparc-sun + os= + ;; + sun4os3) + basic_machine=sparc-sun + os=sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=solaris2 + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + os= + ;; + 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 + ;; + toad1) + basic_machine=pdp10-xkl + os=tops20 + ;; + 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 + ;; + vsta) + basic_machine=i386-pc + os=vsta + ;; + vxworks960) + basic_machine=i960-wrs + os=vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=vxworks + ;; + xbox) + basic_machine=i686-pc + os=mingw32 + ;; + ymp) + basic_machine=ymp-cray + os=unicos + ;; + *) + basic_machine=$1 + os= + ;; + esac ;; esac -# Decode aliases for certain CPU-COMPANY combinations. +# Decode 1-component or ad-hoc basic machines case $basic_machine in - # Recognize the basic CPU types without company name. - # Some are omitted here because they have special meanings below. - 1750a | 580 \ - | a29k \ - | aarch64 | aarch64_be \ - | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ - | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ - | am33_2.0 \ - | arc | arceb \ - | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ - | avr | avr32 \ - | ba \ - | be32 | be64 \ - | bfin \ - | c4x | c8051 | clipper \ - | d10v | d30v | dlx | dsp16xx \ - | e2k | epiphany \ - | fido | fr30 | frv | ft32 \ - | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ - | hexagon \ - | i370 | i860 | i960 | ia64 \ - | ip2k | iq2000 \ - | k1om \ - | le32 | le64 \ - | lm32 \ - | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ - | mips | mipsbe | mipseb | mipsel | mipsle \ - | mips16 \ - | mips64 | mips64el \ - | mips64octeon | mips64octeonel \ - | mips64orion | mips64orionel \ - | mips64r5900 | mips64r5900el \ - | mips64vr | mips64vrel \ - | mips64vr4100 | mips64vr4100el \ - | mips64vr4300 | mips64vr4300el \ - | mips64vr5000 | mips64vr5000el \ - | mips64vr5900 | mips64vr5900el \ - | mipsisa32 | mipsisa32el \ - | mipsisa32r2 | mipsisa32r2el \ - | mipsisa32r6 | mipsisa32r6el \ - | mipsisa64 | mipsisa64el \ - | mipsisa64r2 | mipsisa64r2el \ - | mipsisa64r6 | mipsisa64r6el \ - | mipsisa64sb1 | mipsisa64sb1el \ - | mipsisa64sr71k | mipsisa64sr71kel \ - | mipsr5900 | mipsr5900el \ - | mipstx39 | mipstx39el \ - | mn10200 | mn10300 \ - | moxie \ - | mt \ - | msp430 \ - | nds32 | nds32le | nds32be \ - | nios | nios2 | nios2eb | nios2el \ - | ns16k | ns32k \ - | open8 | or1k | or1knd | or32 \ - | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle \ - | pru \ - | pyramid \ - | riscv32 | riscv64 \ - | rl78 | rx \ - | score \ - | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ - | sh64 | sh64le \ - | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ - | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ - | spu \ - | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ - | ubicom32 \ - | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ - | visium \ - | we32k \ - | x86 | xc16x | xstormy16 | xtensa \ - | z8k | z80) - basic_machine=$basic_machine-unknown - ;; - c54x) - basic_machine=tic54x-unknown - ;; - c55x) - basic_machine=tic55x-unknown - ;; - c6x) - basic_machine=tic6x-unknown - ;; - leon|leon[3-9]) - basic_machine=sparc-$basic_machine + # 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) + cpu=hppa1.1 + vendor=winbond ;; - m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) - basic_machine=$basic_machine-unknown - os=-none + op50n) + cpu=hppa1.1 + vendor=oki ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + op60c) + cpu=hppa1.1 + vendor=oki ;; - ms1) - basic_machine=mt-unknown + ibm*) + cpu=i370 + vendor=ibm ;; - - strongarm | thumb | xscale) - basic_machine=arm-unknown - ;; - xgate) - basic_machine=$basic_machine-unknown - os=-none + orion105) + cpu=clipper + vendor=highlevel ;; - xscaleeb) - basic_machine=armeb-unknown + mac | mpw | mac-mpw) + cpu=m68k + vendor=apple ;; - - xscaleel) - basic_machine=armel-unknown + pmac | pmac-mpw) + cpu=powerpc + vendor=apple ;; - # We use `pc' rather than `unknown' - # because (1) that's what they normally are, and - # (2) the word "unknown" tends to confuse beginning users. - i*86 | x86_64) - basic_machine=$basic_machine-pc - ;; - # Object if more than one company name word. - *-*-*) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; - # Recognize the basic CPU types with company name. - 580-* \ - | a29k-* \ - | aarch64-* | aarch64_be-* \ - | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ - | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ - | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ - | avr-* | avr32-* \ - | ba-* \ - | be32-* | be64-* \ - | bfin-* | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* \ - | c8051-* | clipper-* | craynv-* | cydra-* \ - | d10v-* | d30v-* | dlx-* \ - | e2k-* | elxsi-* \ - | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ - | h8300-* | h8500-* \ - | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ - | hexagon-* \ - | i*86-* | i860-* | i960-* | ia64-* \ - | ip2k-* | iq2000-* \ - | k1om-* \ - | le32-* | le64-* \ - | lm32-* \ - | m32c-* | m32r-* | m32rle-* \ - | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ - | microblaze-* | microblazeel-* \ - | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ - | mips16-* \ - | mips64-* | mips64el-* \ - | mips64octeon-* | mips64octeonel-* \ - | mips64orion-* | mips64orionel-* \ - | mips64r5900-* | mips64r5900el-* \ - | mips64vr-* | mips64vrel-* \ - | mips64vr4100-* | mips64vr4100el-* \ - | mips64vr4300-* | mips64vr4300el-* \ - | mips64vr5000-* | mips64vr5000el-* \ - | mips64vr5900-* | mips64vr5900el-* \ - | mipsisa32-* | mipsisa32el-* \ - | mipsisa32r2-* | mipsisa32r2el-* \ - | mipsisa32r6-* | mipsisa32r6el-* \ - | mipsisa64-* | mipsisa64el-* \ - | mipsisa64r2-* | mipsisa64r2el-* \ - | mipsisa64r6-* | mipsisa64r6el-* \ - | mipsisa64sb1-* | mipsisa64sb1el-* \ - | mipsisa64sr71k-* | mipsisa64sr71kel-* \ - | mipsr5900-* | mipsr5900el-* \ - | mipstx39-* | mipstx39el-* \ - | mmix-* \ - | mt-* \ - | msp430-* \ - | nds32-* | nds32le-* | nds32be-* \ - | nios-* | nios2-* | nios2eb-* | nios2el-* \ - | none-* | np1-* | ns16k-* | ns32k-* \ - | open8-* \ - | or1k*-* \ - | orion-* \ - | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ - | pru-* \ - | pyramid-* \ - | riscv32-* | riscv64-* \ - | rl78-* | romp-* | rs6000-* | rx-* \ - | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ - | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ - | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ - | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ - | tahoe-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ - | tile*-* \ - | tron-* \ - | ubicom32-* \ - | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ - | vax-* \ - | visium-* \ - | we32k-* \ - | x86-* | x86_64-* | xc16x-* | xps100-* \ - | xstormy16-* | xtensa*-* \ - | ymp-* \ - | z8k-* | z80-*) - ;; - # Recognize the basic CPU types without company name, with glob match. - xtensa*) - basic_machine=$basic_machine-unknown - ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. - 386bsd) - basic_machine=i386-unknown - os=-bsd - ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) - basic_machine=m68000-att + cpu=m68000 + vendor=att ;; 3b*) - basic_machine=we32k-att - ;; - a29khif) - basic_machine=a29k-amd - os=-udi - ;; - abacus) - basic_machine=abacus-unknown - ;; - adobe68k) - basic_machine=m68010-adobe - os=-scout - ;; - alliant | fx80) - basic_machine=fx80-alliant - ;; - altos | altos3068) - basic_machine=m68k-altos - ;; - am29k) - basic_machine=a29k-none - os=-bsd - ;; - amd64) - basic_machine=x86_64-pc - ;; - amd64-*) - basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - amdahl) - basic_machine=580-amdahl - os=-sysv - ;; - amiga | amiga-*) - basic_machine=m68k-unknown - ;; - amigaos | amigados) - basic_machine=m68k-unknown - os=-amigaos - ;; - amigaunix | amix) - basic_machine=m68k-unknown - os=-sysv4 - ;; - apollo68) - basic_machine=m68k-apollo - os=-sysv - ;; - apollo68bsd) - basic_machine=m68k-apollo - os=-bsd - ;; - aros) - basic_machine=i386-pc - os=-aros - ;; - asmjs) - basic_machine=asmjs-unknown - ;; - aux) - basic_machine=m68k-apple - os=-aux - ;; - balance) - basic_machine=ns32k-sequent - os=-dynix - ;; - blackfin) - basic_machine=bfin-unknown - os=-linux - ;; - blackfin-*) - basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux + cpu=we32k + vendor=att ;; 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 + cpu=powerpc + vendor=ibm + os=cnk ;; decsystem10* | dec10*) - basic_machine=pdp10-dec - os=-tops10 + cpu=pdp10 + vendor=dec + os=tops10 ;; decsystem20* | dec20*) - basic_machine=pdp10-dec - os=-tops20 + cpu=pdp10 + vendor=dec + os=tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) - basic_machine=m68k-motorola + cpu=m68k + vendor=motorola ;; - delta88) - basic_machine=m88k-motorola - os=-sysv3 - ;; - dicos) - basic_machine=i686-pc - os=-dicos - ;; - djgpp) - basic_machine=i586-pc - os=-msdosdjgpp - ;; - dpx20 | dpx20-*) - basic_machine=rs6000-bull - os=-bosx - ;; - dpx2* | dpx2*-bull) - basic_machine=m68k-bull - os=-sysv3 - ;; - e500v[12]) - basic_machine=powerpc-unknown - os=$os"spe" - ;; - e500v[12]-*) - basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` - os=$os"spe" - ;; - ebmon29k) - basic_machine=a29k-amd - os=-ebmon - ;; - elxsi) - basic_machine=elxsi-elxsi - os=-bsd + dpx2*) + cpu=m68k + vendor=bull + os=sysv3 ;; encore | umax | mmax) - basic_machine=ns32k-encore + cpu=ns32k + vendor=encore ;; - es1800 | OSE68k | ose68k | ose | OSE) - basic_machine=m68k-ericsson - os=-ose + elxsi) + cpu=elxsi + vendor=elxsi + os=${os:-bsd} ;; fx2800) - basic_machine=i860-alliant + cpu=i860 + vendor=alliant ;; genix) - basic_machine=ns32k-ns - ;; - gmicro) - basic_machine=tron-gmicro - os=-sysv - ;; - go32) - basic_machine=i386-pc - os=-go32 + cpu=ns32k + vendor=ns ;; 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 + cpu=hppa1.1 + vendor=hitachi + os=hiuxwe2 ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) - basic_machine=hppa1.0-hp + cpu=hppa1.0 + vendor=hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) - basic_machine=m68000-hp + cpu=m68000 + vendor=hp ;; hp9k3[2-9][0-9]) - basic_machine=m68k-hp + cpu=m68k + vendor=hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) - basic_machine=hppa1.0-hp + cpu=hppa1.0 + vendor=hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) - basic_machine=hppa1.1-hp + cpu=hppa1.1 + vendor=hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp + cpu=hppa1.1 + vendor=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 + cpu=hppa1.1 + vendor=hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) - basic_machine=hppa1.1-hp + cpu=hppa1.1 + vendor=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 + cpu=hppa1.0 + vendor=hp ;; i*86v32) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv32 + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + os=sysv32 ;; i*86v4*) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv4 + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + os=sysv4 ;; i*86v) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + os=sysv ;; i*86sol2) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-solaris2 - ;; - i386mach) - basic_machine=i386-mach - os=-mach + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + os=solaris2 ;; - i386-vsta | vsta) - basic_machine=i386-unknown - os=-vsta + j90 | j90-cray) + cpu=j90 + vendor=cray + os=${os:-unicos} ;; iris | iris4d) - basic_machine=mips-sgi + cpu=mips + vendor=sgi case $os in - -irix*) + irix*) ;; *) - os=-irix4 + 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 + cpu=m68000 + vendor=convergent ;; - 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 + *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*) + cpu=m68k + vendor=atari + os=mint ;; news-3600 | risc-news) - basic_machine=mips-sony - os=-newsos + cpu=mips + vendor=sony + os=newsos ;; - necv70) - basic_machine=v70-nec - os=-sysv - ;; - next | m*-next ) - basic_machine=m68k-next + next | m*-next) + cpu=m68k + vendor=next case $os in - -nextstep* ) + openstep*) + ;; + nextstep*) ;; - -ns2*) - os=-nextstep2 + ns2*) + os=nextstep2 ;; *) - os=-nextstep3 + 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 - ;; - nsx-tandem) - basic_machine=nsx-tandem + cpu=np1 + vendor=gould ;; 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 + cpu=hppa1.1 + vendor=oki + os=proelf ;; 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 + cpu=hppa1.1 + vendor=hitachi + os=hiuxwe2 ;; pbd) - basic_machine=sparc-tti + cpu=sparc + vendor=tti ;; pbb) - basic_machine=m68k-tti + cpu=m68k + vendor=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/^[^-]*-//'` + pc532) + cpu=ns32k + vendor=pc532 ;; pn) - basic_machine=pn-gould - ;; - power) basic_machine=power-ibm + cpu=pn + vendor=gould ;; - ppc | ppcbe) basic_machine=powerpc-unknown - ;; - ppc-* | ppcbe-*) - basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppcle | powerpclittle) - basic_machine=powerpcle-unknown - ;; - ppcle-* | powerpclittle-*) - basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64) basic_machine=powerpc64-unknown - ;; - ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64le | powerpc64little) - basic_machine=powerpc64le-unknown - ;; - ppc64le-* | powerpc64little-*) - basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + power) + cpu=power + vendor=ibm ;; 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 + cpu=i386 + vendor=ibm ;; rm[46]00) - basic_machine=mips-siemens + cpu=mips + vendor=siemens ;; rtpc | rtpc-*) - basic_machine=romp-ibm - ;; - s390 | s390-*) - basic_machine=s390-ibm + cpu=romp + vendor=ibm ;; - s390x | s390x-*) - basic_machine=s390x-ibm - ;; - sa29200) - basic_machine=a29k-amd - os=-udi - ;; - sb1) - basic_machine=mipsisa64sb1-unknown + sde) + cpu=mipsisa32 + vendor=sde + os=${os:-elf} ;; - sb1el) - basic_machine=mipsisa64sb1el-unknown + simso-wrs) + cpu=sparclite + vendor=wrs + os=vxworks ;; - sde) - basic_machine=mipsisa32-sde - os=-elf + tower | tower-32) + cpu=m68k + vendor=ncr ;; - sei) - basic_machine=mips-sei - os=-seiux + vpp*|vx|vx-*) + cpu=f301 + vendor=fujitsu ;; - sequent) - basic_machine=i386-sequent + w65) + cpu=w65 + vendor=wdc ;; - sh) - basic_machine=sh-hitachi - os=-hms + w89k-*) + cpu=hppa1.1 + vendor=winbond + os=proelf ;; - sh5el) - basic_machine=sh5le-unknown + none) + cpu=none + vendor=none ;; - sh64) - basic_machine=sh64-unknown + leon|leon[3-9]) + cpu=sparc + vendor=$basic_machine ;; - sparclite-wrs | simso-wrs) - basic_machine=sparclite-wrs - os=-vxworks + leon-*|leon[3-9]-*) + cpu=sparc + vendor=`echo "$basic_machine" | sed 's/-.*//'` ;; - sps7) - basic_machine=m68k-bull - os=-sysv2 + + *-*) + # shellcheck disable=SC2162 + IFS="-" read cpu vendor <<EOF +$basic_machine +EOF ;; - spur) - basic_machine=spur-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) + cpu=$basic_machine + vendor=pc ;; - st2000) - basic_machine=m68k-tandem + # These rules are duplicated from below for sake of the special case above; + # i.e. things that normalized to x86 arches should also default to "pc" + pc98) + cpu=i386 + vendor=pc ;; - stratus) - basic_machine=i860-stratus - os=-sysv4 + x64 | amd64) + cpu=x86_64 + vendor=pc ;; - strongarm-* | thumb-*) - basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` + # Recognize the basic CPU types without company name. + *) + cpu=$basic_machine + vendor=unknown ;; - sun2) - basic_machine=m68000-sun +esac + +unset -v basic_machine + +# Decode basic machines in the full and proper CPU-Company form. +case $cpu-$vendor in + # Here we handle the default manufacturer of certain CPU types in canonical form. It is in + # some cases the only manufacturer, in others, it is the most popular. + craynv-unknown) + vendor=cray + os=${os:-unicosmp} ;; - sun2os3) - basic_machine=m68000-sun - os=-sunos3 + c90-unknown | c90-cray) + vendor=cray + os=${os:-unicos} ;; - sun2os4) - basic_machine=m68000-sun - os=-sunos4 + fx80-unknown) + vendor=alliant ;; - sun3os3) - basic_machine=m68k-sun - os=-sunos3 + romp-unknown) + vendor=ibm ;; - sun3os4) - basic_machine=m68k-sun - os=-sunos4 + mmix-unknown) + vendor=knuth ;; - sun4os3) - basic_machine=sparc-sun - os=-sunos3 + microblaze-unknown | microblazeel-unknown) + vendor=xilinx ;; - sun4os4) - basic_machine=sparc-sun - os=-sunos4 + rs6000-unknown) + vendor=ibm ;; - sun4sol2) - basic_machine=sparc-sun - os=-solaris2 + vax-unknown) + vendor=dec ;; - sun3 | sun3-*) - basic_machine=m68k-sun + pdp11-unknown) + vendor=dec ;; - sun4) - basic_machine=sparc-sun + we32k-unknown) + vendor=att ;; - sun386 | sun386i | roadrunner) - basic_machine=i386-sun + cydra-unknown) + vendor=cydrome ;; - sv1) - basic_machine=sv1-cray - os=-unicos + i370-ibm*) + vendor=ibm ;; - symmetry) - basic_machine=i386-sequent - os=-dynix + orion-unknown) + vendor=highlevel ;; - t3e) - basic_machine=alphaev5-cray - os=-unicos + xps-unknown | xps100-unknown) + cpu=xps100 + vendor=honeywell ;; - t90) - basic_machine=t90-cray - os=-unicos + + # Here we normalize CPU types with a missing or matching vendor + dpx20-unknown | dpx20-bull) + cpu=rs6000 + vendor=bull + os=${os:-bosx} ;; - tile*) - basic_machine=$basic_machine-unknown - os=-linux-gnu + + # Here we normalize CPU types irrespective of the vendor + amd64-*) + cpu=x86_64 ;; - tx39) - basic_machine=mipstx39-unknown + blackfin-*) + cpu=bfin + os=linux ;; - tx39el) - basic_machine=mipstx39el-unknown + c54x-*) + cpu=tic54x ;; - toad1) - basic_machine=pdp10-xkl - os=-tops20 + c55x-*) + cpu=tic55x ;; - tower | tower-32) - basic_machine=m68k-ncr + c6x-*) + cpu=tic6x ;; - tpf) - basic_machine=s390x-ibm - os=-tpf + e500v[12]-*) + cpu=powerpc + os=$os"spe" ;; - udi29k) - basic_machine=a29k-amd - os=-udi + mips3*-*) + cpu=mips64 ;; - ultra3) - basic_machine=a29k-nyu - os=-sym1 + ms1-*) + cpu=mt ;; - v810 | necv810) - basic_machine=v810-nec - os=-none + m68knommu-*) + cpu=m68k + os=linux ;; - vaxv) - basic_machine=vax-dec - os=-sysv + m9s12z-* | m68hcs12z-* | hcs12z-* | s12z-*) + cpu=s12z ;; - vms) - basic_machine=vax-dec - os=-vms + openrisc-*) + cpu=or32 ;; - vpp*|vx|vx-*) - basic_machine=f301-fujitsu + parisc-*) + cpu=hppa + os=linux ;; - vxworks960) - basic_machine=i960-wrs - os=-vxworks + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + cpu=i586 ;; - vxworks68) - basic_machine=m68k-wrs - os=-vxworks + pentiumpro-* | p6-* | 6x86-* | athlon-* | athalon_*-*) + cpu=i686 ;; - vxworks29k) - basic_machine=a29k-wrs - os=-vxworks + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + cpu=i686 ;; - w65*) - basic_machine=w65-wdc - os=-none + pentium4-*) + cpu=i786 ;; - w89k-*) - basic_machine=hppa1.1-winbond - os=-proelf + pc98-*) + cpu=i386 ;; - xbox) - basic_machine=i686-pc - os=-mingw32 + ppc-* | ppcbe-*) + cpu=powerpc ;; - xps | xps100) - basic_machine=xps100-honeywell + ppcle-* | powerpclittle-*) + cpu=powerpcle ;; - xscale-* | xscalee[bl]-*) - basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` + ppc64-*) + cpu=powerpc64 ;; - ymp) - basic_machine=ymp-cray - os=-unicos + ppc64le-* | powerpc64little-*) + cpu=powerpc64le ;; - z8k-*-coff) - basic_machine=z8k-unknown - os=-sim + sb1-*) + cpu=mipsisa64sb1 ;; - z80-*-coff) - basic_machine=z80-unknown - os=-sim + sb1el-*) + cpu=mipsisa64sb1el ;; - none) - basic_machine=none-none - os=-none + sh5e[lb]-*) + cpu=`echo "$cpu" | sed 's/^\(sh.\)e\(.\)$/\1\2e/'` ;; - -# 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 + spur-*) + cpu=spur ;; - op50n) - basic_machine=hppa1.1-oki + strongarm-* | thumb-*) + cpu=arm ;; - op60c) - basic_machine=hppa1.1-oki + tx39-*) + cpu=mipstx39 ;; - romp) - basic_machine=romp-ibm + tx39el-*) + cpu=mipstx39el ;; - mmix) - basic_machine=mmix-knuth + x64-*) + cpu=x86_64 ;; - rs6000) - basic_machine=rs6000-ibm + xscale-* | xscalee[bl]-*) + cpu=`echo "$cpu" | sed 's/^xscale/arm/'` ;; - vax) - basic_machine=vax-dec + + # Recognize the canonical CPU Types that limit and/or modify the + # company names they are paired with. + cr16-*) + os=${os:-elf} ;; - pdp10) - # there are many clones, so DEC is not a safe bet - basic_machine=pdp10-unknown + crisv32-* | etraxfs*-*) + cpu=crisv32 + vendor=axis ;; - pdp11) - basic_machine=pdp11-dec + cris-* | etrax*-*) + cpu=cris + vendor=axis ;; - we32k) - basic_machine=we32k-att + crx-*) + os=${os:-elf} ;; - sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) - basic_machine=sh-unknown + neo-tandem) + cpu=neo + vendor=tandem ;; - sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) - basic_machine=sparc-sun + nse-tandem) + cpu=nse + vendor=tandem ;; - cydra) - basic_machine=cydra-cydrome + nsr-tandem) + cpu=nsr + vendor=tandem ;; - orion) - basic_machine=orion-highlevel + nsv-tandem) + cpu=nsv + vendor=tandem ;; - orion105) - basic_machine=clipper-highlevel + nsx-tandem) + cpu=nsx + vendor=tandem ;; - mac | mpw | mac-mpw) - basic_machine=m68k-apple + s390-*) + cpu=s390 + vendor=ibm ;; - pmac | pmac-mpw) - basic_machine=powerpc-apple + s390x-*) + cpu=s390x + vendor=ibm ;; - *-unknown) - # Make sure to match an already-canonicalized machine name. + tile*-*) + os=${os:-linux-gnu} ;; + *) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 + # Recognize the canonical CPU types that are allowed with any + # company name. + case $cpu in + 1750a | 580 \ + | a29k \ + | aarch64 | aarch64_be \ + | abacus \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \ + | alphapca5[67] | alpha64pca5[67] \ + | am33_2.0 \ + | amdgcn \ + | arc | arceb \ + | arm | arm[lb]e | arme[lb] | armv* \ + | avr | avr32 \ + | asmjs \ + | ba \ + | be32 | be64 \ + | bfin | bpf | bs2000 \ + | c[123]* | c30 | [cjt]90 | c4x \ + | c8051 | clipper | craynv | csky | cydra \ + | d10v | d30v | dlx | dsp16xx \ + | e2k | elxsi | epiphany \ + | f30[01] | f700 | fido | fr30 | frv | ft32 | fx80 \ + | h8300 | h8500 \ + | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | hexagon \ + | i370 | i*86 | i860 | i960 | ia16 | ia64 \ + | ip2k | iq2000 \ + | k1om \ + | le32 | le64 \ + | lm32 \ + | m32c | m32r | m32rle \ + | m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \ + | m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \ + | m88110 | m88k | maxq | mb | mcore | mep | metag \ + | microblaze | microblazeel \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64eb | 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 \ + | mn10200 | mn10300 \ + | moxie \ + | mt \ + | msp430 \ + | nds32 | nds32le | nds32be \ + | nfp \ + | nios | nios2 | nios2eb | nios2el \ + | none | np1 | ns16k | ns32k | nvptx \ + | open8 \ + | or1k* \ + | or32 \ + | orion \ + | picochip \ + | pdp10 | pdp11 | pj | pjl | pn | power \ + | powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \ + | pru \ + | pyramid \ + | riscv | riscv32 | riscv64 \ + | rl78 | romp | rs6000 | rx \ + | score \ + | sh | shl \ + | sh[1234] | sh[24]a | sh[24]ae[lb] | sh[23]e | she[lb] | sh[lb]e \ + | sh[1234]e[lb] | sh[12345][lb]e | sh[23]ele | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet \ + | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \ + | spu \ + | tahoe \ + | tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \ + | tron \ + | ubicom32 \ + | v70 | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \ + | vax \ + | visium \ + | w65 \ + | wasm32 | wasm64 \ + | we32k \ + | x86 | x86_64 | xc16x | xgate | xps100 \ + | xstormy16 | xtensa* \ + | ymp \ + | z8k | z80) + ;; + + *) + echo Invalid configuration \`"$1"\': machine \`"$cpu-$vendor"\' not recognized 1>&2 + exit 1 + ;; + esac ;; esac # Here we canonicalize certain aliases for manufacturers. -case $basic_machine in - *-digital*) - basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` +case $vendor in + digital*) + vendor=dec ;; - *-commodore*) - basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + commodore*) + vendor=cbm ;; *) ;; @@ -1358,200 +1275,244 @@ esac # Decode manufacturer-specific aliases for certain operating systems. -if [ x"$os" != x"" ] +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 + # 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|'` + bluegene*) + os=cnk ;; - -solaris) - os=-solaris2 + solaris1 | solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; - -svr4*) - os=-sysv4 + solaris) + os=solaris2 ;; - -unixware*) - os=-sysv4.2uw + unixware*) + os=sysv4.2uw ;; - -gnu/linux*) + gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; - # First accept the basic system types. + # es1800 is here to avoid being matched by es* (a different OS) + es1800*) + os=ose + ;; + # Some version numbers need modification + chorusos*) + os=chorusos + ;; + isc) + os=isc2.2 + ;; + sco6) + os=sco5v6 + ;; + sco5) + os=sco3.2v5 + ;; + sco4) + os=sco3.2v4 + ;; + sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + ;; + sco3.2v[4-9]* | sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + ;; + scout) + # Don't match below + ;; + sco*) + os=sco3.2v2 + ;; + psos*) + os=psos + ;; + # Now accept the basic system types. # The portable systems comes first. - # Each alternative MUST END IN A *, to match a version number. - # -sysv* is not here because it comes later, after sysvr4. - -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ - | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ - | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ - | -sym* | -kopensolaris* | -plan9* \ - | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* | -aros* | -cloudabi* | -sortix* \ - | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ - | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ - | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ - | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ - | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ - | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ - | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \ - | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ - | -linux-newlib* | -linux-musl* | -linux-uclibc* \ - | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ - | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ - | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ - | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ - | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ - | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ - | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ - | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox*) + # 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* | esix* | aix* | cnk* | sunos | sunos[34]*\ + | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \ + | sym* | kopensolaris* | plan9* \ + | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \ + | aos* | aros* | cloudabi* | sortix* | twizzler* \ + | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \ + | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \ + | knetbsd* | mirbsd* | netbsd* \ + | bitrig* | openbsd* | solidbsd* | libertybsd* | os108* \ + | ekkobsd* | kfreebsd* | freebsd* | riscix* | lynxos* \ + | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \ + | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \ + | udi* | eabi* | lites* | ieee* | go32* | aux* | hcos* \ + | chorusrdb* | cegcc* | glidix* \ + | cygwin* | msys* | pe* | moss* | proelf* | rtems* \ + | midipix* | mingw32* | mingw64* | linux-gnu* | linux-android* \ + | linux-newlib* | linux-musl* | linux-uclibc* \ + | uxpv* | beos* | mpeix* | udk* | moxiebox* \ + | interix* | uwin* | mks* | rhapsody* | darwin* \ + | openstep* | oskit* | conix* | pw32* | nonstopux* \ + | storm-chaos* | tops10* | tenex* | tops20* | its* \ + | os2* | vos* | palmos* | uclinux* | nucleus* \ + | morphos* | superux* | rtmk* | windiss* \ + | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \ + | skyos* | haiku* | rdos* | toppers* | drops* | es* \ + | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ + | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \ + | nsk* | powerunix) # Remember, each alternative MUST END IN *, to match a version number. ;; - -qnx*) - case $basic_machine in - x86-* | i*86-*) + qnx*) + case $cpu in + x86 | i*86) ;; *) - os=-nto$os + os=nto-$os ;; esac ;; - -nto-qnx*) + hiux*) + os=hiuxwe2 ;; - -nto*) - os=`echo $os | sed -e 's|nto|nto-qnx|'` + nto-qnx*) ;; - -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ - | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ - | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; - -mac*) - os=`echo $os | sed -e 's|mac|macos|'` + sim | xray | os68k* | v88r* \ + | windows* | osx | abug | netware* | os9* \ + | macos* | mpw* | magic* | mmixware* | mon960* | lnews*) ;; - -linux-dietlibc) - os=-linux-dietlibc + linux-dietlibc) + os=linux-dietlibc ;; - -linux*) + linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; - -sunos5*) - os=`echo $os | sed -e 's|sunos5|solaris2|'` + lynx*178) + os=lynxos178 + ;; + lynx*5) + os=lynxos5 ;; - -sunos6*) - os=`echo $os | sed -e 's|sunos6|solaris3|'` + lynx*) + os=lynxos ;; - -opened*) - os=-openedition + mac*) + os=`echo "$os" | sed -e 's|mac|macos|'` ;; - -os400*) - os=-os400 + opened*) + os=openedition ;; - -wince*) - os=-wince + os400*) + os=os400 ;; - -osfrose*) - os=-osfrose + sunos5*) + os=`echo "$os" | sed -e 's|sunos5|solaris2|'` ;; - -osf*) - os=-osf + sunos6*) + os=`echo "$os" | sed -e 's|sunos6|solaris3|'` ;; - -utek*) - os=-bsd + wince*) + os=wince ;; - -dynix*) - os=-bsd + utek*) + os=bsd ;; - -acis*) - os=-aos + dynix*) + os=bsd ;; - -atheos*) - os=-atheos + acis*) + os=aos ;; - -syllable*) - os=-syllable + atheos*) + os=atheos ;; - -386bsd) - os=-bsd + syllable*) + os=syllable ;; - -ctix* | -uts*) - os=-sysv + 386bsd) + os=bsd ;; - -nova*) - os=-rtmk-nova + ctix* | uts*) + os=sysv ;; - -ns2 ) - os=-nextstep2 + nova*) + os=rtmk-nova ;; - -nsk*) - os=-nsk + ns2) + os=nextstep2 ;; # Preserve the version number of sinix5. - -sinix5.*) + sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; - -sinix*) - os=-sysv4 - ;; - -tpf*) - os=-tpf + sinix*) + os=sysv4 ;; - -triton*) - os=-sysv3 + tpf*) + os=tpf ;; - -oss*) - os=-sysv3 + triton*) + os=sysv3 ;; - -svr4) - os=-sysv4 + oss*) + os=sysv3 ;; - -svr3) - os=-sysv3 + svr4*) + os=sysv4 ;; - -sysvr4) - os=-sysv4 + svr3) + os=sysv3 ;; - # This must come after -sysvr4. - -sysv*) + sysvr4) + os=sysv4 ;; - -ose*) - os=-ose + # This must come after sysvr4. + sysv*) ;; - -es1800*) - os=-ose + ose*) + os=ose ;; - -xenix) - os=-xenix + *mint | mint[0-9]* | *MiNT | MiNT[0-9]*) + os=mint ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - os=-mint + zvmoe) + os=zvmoe ;; - -aros*) - os=-aros + dicos*) + os=dicos ;; - -zvmoe) - os=-zvmoe + pikeos*) + # Until real need of OS specific support for + # particular features comes up, bare metal + # configurations are quite functional. + case $cpu in + arm*) + os=eabi + ;; + *) + os=elf + ;; + esac ;; - -dicos*) - os=-dicos + nacl*) ;; - -nacl*) + ios) ;; - -ios) + none) ;; - -none) + *-eabi) ;; *) - # Get rid of the `-' at the beginning of $os. - os=`echo $os | sed 's/[^-]*-//'` - echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2 exit 1 ;; esac @@ -1567,264 +1528,265 @@ else # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. -case $basic_machine in +case $cpu-$vendor in score-*) - os=-elf + os=elf ;; spu-*) - os=-elf + os=elf ;; *-acorn) - os=-riscix1.2 + os=riscix1.2 ;; arm*-rebel) - os=-linux + os=linux ;; arm*-semi) - os=-aout + os=aout ;; c4x-* | tic4x-*) - os=-coff + os=coff ;; c8051-*) - os=-elf + os=elf + ;; + clipper-intergraph) + os=clix ;; hexagon-*) - os=-elf + os=elf ;; tic54x-*) - os=-coff + os=coff ;; tic55x-*) - os=-coff + os=coff ;; tic6x-*) - os=-coff + os=coff ;; # This must come before the *-dec entry. pdp10-*) - os=-tops20 + os=tops20 ;; pdp11-*) - os=-none + os=none ;; *-dec | vax-*) - os=-ultrix4.2 + os=ultrix4.2 ;; m68*-apollo) - os=-domain + os=domain ;; i386-sun) - os=-sunos4.0.2 + os=sunos4.0.2 ;; m68000-sun) - os=-sunos3 + os=sunos3 ;; m68*-cisco) - os=-aout + os=aout ;; mep-*) - os=-elf + os=elf ;; mips*-cisco) - os=-elf + os=elf ;; mips*-*) - os=-elf + os=elf ;; or32-*) - os=-coff + os=coff ;; *-tti) # must be before sparc entry or we get the wrong os. - os=-sysv3 + os=sysv3 ;; sparc-* | *-sun) - os=-sunos4.1.1 + os=sunos4.1.1 ;; pru-*) - os=-elf + os=elf ;; *-be) - os=-beos - ;; - *-haiku) - os=-haiku + os=beos ;; *-ibm) - os=-aix + os=aix ;; *-knuth) - os=-mmixware + os=mmixware ;; *-wec) - os=-proelf + os=proelf ;; *-winbond) - os=-proelf + os=proelf ;; *-oki) - os=-proelf + os=proelf ;; *-hp) - os=-hpux + os=hpux ;; *-hitachi) - os=-hiux + os=hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) - os=-sysv + os=sysv ;; *-cbm) - os=-amigaos + os=amigaos ;; *-dg) - os=-dgux + os=dgux ;; *-dolphin) - os=-sysv3 + os=sysv3 ;; m68k-ccur) - os=-rtu + os=rtu ;; m88k-omron*) - os=-luna + os=luna ;; - *-next ) - os=-nextstep + *-next) + os=nextstep ;; *-sequent) - os=-ptx + os=ptx ;; *-crds) - os=-unos + os=unos ;; *-ns) - os=-genix + os=genix ;; i370-*) - os=-mvs - ;; - *-next) - os=-nextstep3 + os=mvs ;; *-gould) - os=-sysv + os=sysv ;; *-highlevel) - os=-bsd + os=bsd ;; *-encore) - os=-bsd + os=bsd ;; *-sgi) - os=-irix + os=irix ;; *-siemens) - os=-sysv4 + os=sysv4 ;; *-masscomp) - os=-rtu + os=rtu ;; f30[01]-fujitsu | f700-fujitsu) - os=-uxpv + os=uxpv ;; *-rom68k) - os=-coff + os=coff ;; *-*bug) - os=-coff + os=coff ;; *-apple) - os=-macos + os=macos ;; *-atari*) - os=-mint + os=mint + ;; + *-wrs) + os=vxworks ;; *) - os=-none + 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 $vendor in + unknown) case $os in - -riscix*) + riscix*) vendor=acorn ;; - -sunos*) + sunos*) vendor=sun ;; - -cnk*|-aix*) + cnk*|-aix*) vendor=ibm ;; - -beos*) + beos*) vendor=be ;; - -hpux*) + hpux*) vendor=hp ;; - -mpeix*) + mpeix*) vendor=hp ;; - -hiux*) + hiux*) vendor=hitachi ;; - -unos*) + unos*) vendor=crds ;; - -dgux*) + dgux*) vendor=dg ;; - -luna*) + luna*) vendor=omron ;; - -genix*) + genix*) vendor=ns ;; - -mvs* | -opened*) + clix*) + vendor=intergraph + ;; + mvs* | opened*) vendor=ibm ;; - -os400*) + os400*) vendor=ibm ;; - -ptx*) + ptx*) vendor=sequent ;; - -tpf*) + tpf*) vendor=ibm ;; - -vxsim* | -vxworks* | -windiss*) + vxsim* | vxworks* | windiss*) vendor=wrs ;; - -aux*) + aux*) vendor=apple ;; - -hms*) + hms*) vendor=hitachi ;; - -mpw* | -macos*) + mpw* | macos*) vendor=apple ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + *mint | mint[0-9]* | *MiNT | MiNT[0-9]*) vendor=atari ;; - -vos*) + vos*) vendor=stratus ;; esac - basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac -echo $basic_machine$os +echo "$cpu-$vendor-$os" exit # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" diff --git a/config_h.in b/config_h.in index c7d6d910857b..1b0fd6e239f6 100644 --- a/config_h.in +++ b/config_h.in @@ -21,16 +21,52 @@ /* Define if you have the <fcntl.h> header file. */ #undef HAVE_FCNTL_H +/* Define if you have the `getopt' function. */ +#undef HAVE_GETOPT + +/* Define if you have the <getopt.h> header file. */ +#undef HAVE_GETOPT_H + +/* Define to 1 if getopt variables are declared in header */ +#undef HAVE_GETOPT_HEADER + +/* Define if you have the <inttypes.h> header file. */ +#undef HAVE_INTTYPES_H + /* Define if you have the `dbmalloc' library (-ldbmalloc). */ #undef HAVE_LIBDBMALLOC /* Define if you have the `dmalloc' library (-ldmalloc). */ #undef HAVE_LIBDMALLOC +/* Define if you have the <memory.h> header file. */ +#undef HAVE_MEMORY_H + /* Define to 1 if mkstemp() is available and working. */ #undef HAVE_MKSTEMP -/* Define to 1 if vsnprintf() is available and working. */ +/* Define if you have the <stdint.h> header file. */ +#undef HAVE_STDINT_H + +/* Define if you have the <stdlib.h> header file. */ +#undef HAVE_STDLIB_H + +/* Define if you have the <strings.h> header file. */ +#undef HAVE_STRINGS_H + +/* Define if you have the <string.h> header file. */ +#undef HAVE_STRING_H + +/* Define if you have the <sys/stat.h> header file. */ +#undef HAVE_SYS_STAT_H + +/* Define if you have the <sys/types.h> header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define if you have the <unistd.h> header file. */ +#undef HAVE_UNISTD_H + +/* Define if you have the `vsnprintf' function. */ #undef HAVE_VSNPRINTF /* Define to maximum table size (default: 32500) */ @@ -39,9 +75,15 @@ /* Define to 1 if filesystem supports mixed-case filenames. */ #undef MIXEDCASE_FILENAMES +/* Define to 1 if we must include getopt.h */ +#undef NEED_GETOPT_H + /* Define to 1 if you want to perform memory-leak testing. */ #undef NO_LEAKS +/* Define if you have the ANSI C header files. */ +#undef STDC_HEADERS + /* Define to the system name. */ #undef SYSTEM_NAME @@ -59,3 +101,6 @@ /* Define to 1 if you want to perform memory-leak testing. */ #undef YY_NO_LEAKS + +/* Define to `int' if <sys/types.h> does not define. */ +#undef mode_t diff --git a/configure b/configure index a636db7ce9b5..8016645b0f6b 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh -# From configure.in Revision: 1.21 . +# From configure.in Revision: 1.23 . # Guess values for system-dependent variables and create Makefiles. -# Generated by Autoconf 2.52.20150926. +# Generated by Autoconf 2.52.20200111. # # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. @@ -176,6 +176,7 @@ datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' +runstatedir='${localstatedir}/run' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' @@ -318,6 +319,15 @@ do | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir=$ac_optarg ;; + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst \ + | --runs | --run | --ru) + ac_prev=runstatedir ;; + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ + | --runstate=* | --runstat=* | --runsta=* | --runst=* \ + | --runs=* | --run=* | --ru=*) + runstatedir=$ac_optarg ;; + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) @@ -655,6 +665,7 @@ Fine tuning of the installation directories: --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --runstatedir=DIR extra definition of runtime data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] @@ -767,7 +778,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was -generated by GNU Autoconf 2.52.20150926. Invocation command line was +generated by GNU Autoconf 2.52.20200111. Invocation command line was $ $0 $@ @@ -891,7 +902,7 @@ if test -z "$CONFIG_SITE"; then fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then - { echo "$as_me:894: loading site script $ac_site_file" >&5 + { echo "$as_me:905: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} cat "$ac_site_file" >&5 . "$ac_site_file" @@ -902,7 +913,7 @@ if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then - { echo "$as_me:905: loading cache $cache_file" >&5 + { echo "$as_me:916: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; @@ -910,7 +921,7 @@ echo "$as_me: loading cache $cache_file" >&6;} esac fi else - { echo "$as_me:913: creating cache $cache_file" >&5 + { echo "$as_me:924: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi @@ -926,21 +937,21 @@ for ac_var in `(set) 2>&1 | eval ac_new_val="\$ac_env_${ac_var}_value" case $ac_old_set,$ac_new_set in set,) - { echo "$as_me:929: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 + { echo "$as_me:940: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) - { echo "$as_me:933: error: \`$ac_var' was not set in the previous run" >&5 + { echo "$as_me:944: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then - { echo "$as_me:939: error: \`$ac_var' has changed since the previous run:" >&5 + { echo "$as_me:950: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - { echo "$as_me:941: former value: $ac_old_val" >&5 + { echo "$as_me:952: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} - { echo "$as_me:943: current value: $ac_new_val" >&5 + { echo "$as_me:954: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; @@ -959,9 +970,9 @@ echo "$as_me: current value: $ac_new_val" >&2;} fi done if $ac_cache_corrupted; then - { echo "$as_me:962: error: changes in the environment can compromise the build" >&5 + { echo "$as_me:973: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} - { { echo "$as_me:964: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 + { { echo "$as_me:975: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi @@ -982,10 +993,10 @@ esac echo "#! $SHELL" >conftest.sh echo "exit 0" >>conftest.sh chmod +x conftest.sh -if { (echo "$as_me:985: PATH=\".;.\"; conftest.sh") >&5 +if { (echo "$as_me:996: PATH=\".;.\"; conftest.sh") >&5 (PATH=".;."; conftest.sh) 2>&5 ac_status=$? - echo "$as_me:988: \$? = $ac_status" >&5 + echo "$as_me:999: \$? = $ac_status" >&5 (exit $ac_status); }; then ac_path_separator=';' else @@ -1013,7 +1024,7 @@ for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do fi done if test -z "$ac_aux_dir"; then - { { echo "$as_me:1016: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 + { { echo "$as_me:1027: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} { (exit 1); exit 1; }; } fi @@ -1023,11 +1034,11 @@ ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # Make sure we can run config.sub. $ac_config_sub sun4 >/dev/null 2>&1 || - { { echo "$as_me:1026: error: cannot run $ac_config_sub" >&5 + { { echo "$as_me:1037: error: cannot run $ac_config_sub" >&5 echo "$as_me: error: cannot run $ac_config_sub" >&2;} { (exit 1); exit 1; }; } -echo "$as_me:1030: checking build system type" >&5 +echo "$as_me:1041: checking build system type" >&5 echo $ECHO_N "checking build system type... $ECHO_C" >&6 if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -1036,23 +1047,23 @@ else test -z "$ac_cv_build_alias" && ac_cv_build_alias=`$ac_config_guess` test -z "$ac_cv_build_alias" && - { { echo "$as_me:1039: error: cannot guess build type; you must specify one" >&5 + { { echo "$as_me:1050: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || - { { echo "$as_me:1043: error: $ac_config_sub $ac_cv_build_alias failed." >&5 + { { echo "$as_me:1054: error: $ac_config_sub $ac_cv_build_alias failed." >&5 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;} { (exit 1); exit 1; }; } fi -echo "$as_me:1048: result: $ac_cv_build" >&5 +echo "$as_me:1059: result: $ac_cv_build" >&5 echo "${ECHO_T}$ac_cv_build" >&6 build=$ac_cv_build build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -echo "$as_me:1055: checking host system type" >&5 +echo "$as_me:1066: checking host system type" >&5 echo $ECHO_N "checking host system type... $ECHO_C" >&6 if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -1061,12 +1072,12 @@ else test -z "$ac_cv_host_alias" && ac_cv_host_alias=$ac_cv_build_alias ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || - { { echo "$as_me:1064: error: $ac_config_sub $ac_cv_host_alias failed" >&5 + { { echo "$as_me:1075: error: $ac_config_sub $ac_cv_host_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} { (exit 1); exit 1; }; } fi -echo "$as_me:1069: result: $ac_cv_host" >&5 +echo "$as_me:1080: result: $ac_cv_host" >&5 echo "${ECHO_T}$ac_cv_host" >&6 host=$ac_cv_host host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` @@ -1074,7 +1085,7 @@ host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then - echo "$as_me:1077: checking target system type" >&5 + echo "$as_me:1088: checking target system type" >&5 echo $ECHO_N "checking target system type... $ECHO_C" >&6 if test "${ac_cv_target+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -1083,12 +1094,12 @@ else test "x$ac_cv_target_alias" = "x" && ac_cv_target_alias=$ac_cv_host_alias ac_cv_target=`$ac_config_sub $ac_cv_target_alias` || - { { echo "$as_me:1086: error: $ac_config_sub $ac_cv_target_alias failed" >&5 + { { echo "$as_me:1097: error: $ac_config_sub $ac_cv_target_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;} { (exit 1); exit 1; }; } fi -echo "$as_me:1091: result: $ac_cv_target" >&5 +echo "$as_me:1102: result: $ac_cv_target" >&5 echo "${ECHO_T}$ac_cv_target" >&6 target=$ac_cv_target target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` @@ -1120,13 +1131,13 @@ else fi test -z "$system_name" && system_name="$cf_cv_system_name" -test -n "$cf_cv_system_name" && echo "$as_me:1123: result: Configuring for $cf_cv_system_name" >&5 +test -n "$cf_cv_system_name" && echo "$as_me:1134: result: Configuring for $cf_cv_system_name" >&5 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6 if test ".$system_name" != ".$cf_cv_system_name" ; then - echo "$as_me:1127: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5 + echo "$as_me:1138: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6 - { { echo "$as_me:1129: error: \"Please remove config.cache and try again.\"" >&5 + { { echo "$as_me:1140: error: \"Please remove config.cache and try again.\"" >&5 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;} { (exit 1); exit 1; }; } fi @@ -1153,7 +1164,7 @@ ac_main_return=return if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -echo "$as_me:1156: checking for $ac_word" >&5 +echo "$as_me:1167: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -1168,7 +1179,7 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_CC="${ac_tool_prefix}gcc" -echo "$as_me:1171: found $ac_dir/$ac_word" >&5 +echo "$as_me:1182: found $ac_dir/$ac_word" >&5 break done @@ -1176,10 +1187,10 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:1179: result: $CC" >&5 + echo "$as_me:1190: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else - echo "$as_me:1182: result: no" >&5 + echo "$as_me:1193: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -1188,7 +1199,7 @@ if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -echo "$as_me:1191: checking for $ac_word" >&5 +echo "$as_me:1202: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -1203,7 +1214,7 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_ac_ct_CC="gcc" -echo "$as_me:1206: found $ac_dir/$ac_word" >&5 +echo "$as_me:1217: found $ac_dir/$ac_word" >&5 break done @@ -1211,10 +1222,10 @@ fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:1214: result: $ac_ct_CC" >&5 + echo "$as_me:1225: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else - echo "$as_me:1217: result: no" >&5 + echo "$as_me:1228: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -1227,7 +1238,7 @@ if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -echo "$as_me:1230: checking for $ac_word" >&5 +echo "$as_me:1241: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -1242,7 +1253,7 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_CC="${ac_tool_prefix}cc" -echo "$as_me:1245: found $ac_dir/$ac_word" >&5 +echo "$as_me:1256: found $ac_dir/$ac_word" >&5 break done @@ -1250,10 +1261,10 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:1253: result: $CC" >&5 + echo "$as_me:1264: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else - echo "$as_me:1256: result: no" >&5 + echo "$as_me:1267: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -1262,7 +1273,7 @@ if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -echo "$as_me:1265: checking for $ac_word" >&5 +echo "$as_me:1276: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -1277,7 +1288,7 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_ac_ct_CC="cc" -echo "$as_me:1280: found $ac_dir/$ac_word" >&5 +echo "$as_me:1291: found $ac_dir/$ac_word" >&5 break done @@ -1285,10 +1296,10 @@ fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:1288: result: $ac_ct_CC" >&5 + echo "$as_me:1299: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else - echo "$as_me:1291: result: no" >&5 + echo "$as_me:1302: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -1301,7 +1312,7 @@ fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -echo "$as_me:1304: checking for $ac_word" >&5 +echo "$as_me:1315: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -1321,7 +1332,7 @@ if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then continue fi ac_cv_prog_CC="cc" -echo "$as_me:1324: found $ac_dir/$ac_word" >&5 +echo "$as_me:1335: found $ac_dir/$ac_word" >&5 break done @@ -1343,10 +1354,10 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:1346: result: $CC" >&5 + echo "$as_me:1357: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else - echo "$as_me:1349: result: no" >&5 + echo "$as_me:1360: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -1357,7 +1368,7 @@ if test -z "$CC"; then do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -echo "$as_me:1360: checking for $ac_word" >&5 +echo "$as_me:1371: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -1372,7 +1383,7 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_CC="$ac_tool_prefix$ac_prog" -echo "$as_me:1375: found $ac_dir/$ac_word" >&5 +echo "$as_me:1386: found $ac_dir/$ac_word" >&5 break done @@ -1380,10 +1391,10 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:1383: result: $CC" >&5 + echo "$as_me:1394: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else - echo "$as_me:1386: result: no" >&5 + echo "$as_me:1397: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -1396,7 +1407,7 @@ if test -z "$CC"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:1399: checking for $ac_word" >&5 +echo "$as_me:1410: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -1411,7 +1422,7 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_ac_ct_CC="$ac_prog" -echo "$as_me:1414: found $ac_dir/$ac_word" >&5 +echo "$as_me:1425: found $ac_dir/$ac_word" >&5 break done @@ -1419,10 +1430,10 @@ fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:1422: result: $ac_ct_CC" >&5 + echo "$as_me:1433: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else - echo "$as_me:1425: result: no" >&5 + echo "$as_me:1436: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -1434,36 +1445,36 @@ fi fi -test -z "$CC" && { { echo "$as_me:1437: error: no acceptable cc found in \$PATH" >&5 +test -z "$CC" && { { echo "$as_me:1448: error: no acceptable cc found in \$PATH" >&5 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. -echo "$as_me:1442:" \ +echo "$as_me:1453:" \ "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` -{ (eval echo "$as_me:1445: \"$ac_compiler --version </dev/null >&5\"") >&5 +{ (eval echo "$as_me:1456: \"$ac_compiler --version </dev/null >&5\"") >&5 (eval $ac_compiler --version </dev/null >&5) 2>&5 ac_status=$? - echo "$as_me:1448: \$? = $ac_status" >&5 + echo "$as_me:1459: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:1450: \"$ac_compiler -v </dev/null >&5\"") >&5 +{ (eval echo "$as_me:1461: \"$ac_compiler -v </dev/null >&5\"") >&5 (eval $ac_compiler -v </dev/null >&5) 2>&5 ac_status=$? - echo "$as_me:1453: \$? = $ac_status" >&5 + echo "$as_me:1464: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:1455: \"$ac_compiler -V </dev/null >&5\"") >&5 +{ (eval echo "$as_me:1466: \"$ac_compiler -V </dev/null >&5\"") >&5 (eval $ac_compiler -V </dev/null >&5) 2>&5 ac_status=$? - echo "$as_me:1458: \$? = $ac_status" >&5 + echo "$as_me:1469: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF -#line 1462 "configure" +#line 1473 "configure" #include "confdefs.h" int -main () +main (void) { ; @@ -1475,13 +1486,13 @@ ac_clean_files="$ac_clean_files a.out a.exe" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -echo "$as_me:1478: checking for C compiler default output" >&5 +echo "$as_me:1489: checking for C compiler default output" >&5 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -if { (eval echo "$as_me:1481: \"$ac_link_default\"") >&5 +if { (eval echo "$as_me:1492: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 ac_status=$? - echo "$as_me:1484: \$? = $ac_status" >&5 + echo "$as_me:1495: \$? = $ac_status" >&5 (exit $ac_status); }; then # Find the output, starting from the most likely. This scheme is # not robust to junk in `.', hence go to wildcards (a.*) only as a last @@ -1504,34 +1515,34 @@ done else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 -{ { echo "$as_me:1507: error: C compiler cannot create executables" >&5 +{ { echo "$as_me:1518: error: C compiler cannot create executables" >&5 echo "$as_me: error: C compiler cannot create executables" >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext -echo "$as_me:1513: result: $ac_file" >&5 +echo "$as_me:1524: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6 # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -echo "$as_me:1518: checking whether the C compiler works" >&5 +echo "$as_me:1529: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' - { (eval echo "$as_me:1524: \"$ac_try\"") >&5 + { (eval echo "$as_me:1535: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:1527: \$? = $ac_status" >&5 + echo "$as_me:1538: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else - { { echo "$as_me:1534: error: cannot run C compiled programs. + { { echo "$as_me:1545: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'." >&2;} @@ -1539,24 +1550,24 @@ If you meant to cross compile, use \`--host'." >&2;} fi fi fi -echo "$as_me:1542: result: yes" >&5 +echo "$as_me:1553: result: yes" >&5 echo "${ECHO_T}yes" >&6 rm -f a.out a.exe conftest$ac_cv_exeext ac_clean_files=$ac_clean_files_save # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -echo "$as_me:1549: checking whether we are cross compiling" >&5 +echo "$as_me:1560: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 -echo "$as_me:1551: result: $cross_compiling" >&5 +echo "$as_me:1562: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6 -echo "$as_me:1554: checking for executable suffix" >&5 +echo "$as_me:1565: checking for executable suffix" >&5 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6 -if { (eval echo "$as_me:1556: \"$ac_link\"") >&5 +if { (eval echo "$as_me:1567: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:1559: \$? = $ac_status" >&5 + echo "$as_me:1570: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will @@ -1572,29 +1583,29 @@ for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do esac done else - { { echo "$as_me:1575: error: cannot compute EXEEXT: cannot compile and link" >&5 + { { echo "$as_me:1586: error: cannot compute EXEEXT: cannot compile and link" >&5 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext -echo "$as_me:1581: result: $ac_cv_exeext" >&5 +echo "$as_me:1592: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6 rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT -echo "$as_me:1587: checking for object suffix" >&5 +echo "$as_me:1598: checking for object suffix" >&5 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6 if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 1593 "configure" +#line 1604 "configure" #include "confdefs.h" int -main () +main (void) { ; @@ -1602,10 +1613,10 @@ main () } _ACEOF rm -f conftest.o conftest.obj -if { (eval echo "$as_me:1605: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:1616: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:1608: \$? = $ac_status" >&5 + echo "$as_me:1619: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in @@ -1617,28 +1628,28 @@ done else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 -{ { echo "$as_me:1620: error: cannot compute OBJEXT: cannot compile" >&5 +{ { echo "$as_me:1631: error: cannot compute OBJEXT: cannot compile" >&5 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -echo "$as_me:1627: result: $ac_cv_objext" >&5 +echo "$as_me:1638: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6 OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -echo "$as_me:1631: checking whether we are using the GNU C compiler" >&5 +echo "$as_me:1642: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 1637 "configure" +#line 1648 "configure" #include "confdefs.h" int -main () +main (void) { #ifndef __GNUC__ choke me @@ -1649,16 +1660,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:1652: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:1663: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:1655: \$? = $ac_status" >&5 + echo "$as_me:1666: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:1658: \"$ac_try\"") >&5 + { (eval echo "$as_me:1669: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:1661: \$? = $ac_status" >&5 + echo "$as_me:1672: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else @@ -1670,23 +1681,23 @@ rm -f conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -echo "$as_me:1673: result: $ac_cv_c_compiler_gnu" >&5 +echo "$as_me:1684: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS CFLAGS="-g" -echo "$as_me:1679: checking whether $CC accepts -g" >&5 +echo "$as_me:1690: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 1685 "configure" +#line 1696 "configure" #include "confdefs.h" int -main () +main (void) { ; @@ -1694,16 +1705,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:1697: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:1708: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:1700: \$? = $ac_status" >&5 + echo "$as_me:1711: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:1703: \"$ac_try\"") >&5 + { (eval echo "$as_me:1714: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:1706: \$? = $ac_status" >&5 + echo "$as_me:1717: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else @@ -1713,7 +1724,7 @@ ac_cv_prog_cc_g=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:1716: result: $ac_cv_prog_cc_g" >&5 +echo "$as_me:1727: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS @@ -1740,16 +1751,16 @@ cat >conftest.$ac_ext <<_ACEOF #endif _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:1743: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:1754: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:1746: \$? = $ac_status" >&5 + echo "$as_me:1757: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:1749: \"$ac_try\"") >&5 + { (eval echo "$as_me:1760: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:1752: \$? = $ac_status" >&5 + echo "$as_me:1763: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ ''\ @@ -1761,12 +1772,12 @@ if { (eval echo "$as_me:1743: \"$ac_compile\"") >&5 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF -#line 1764 "configure" +#line 1775 "configure" #include "confdefs.h" #include <stdlib.h> $ac_declaration int -main () +main (void) { exit (42); ; @@ -1774,16 +1785,16 @@ exit (42); } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:1777: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:1788: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:1780: \$? = $ac_status" >&5 + echo "$as_me:1791: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:1783: \"$ac_try\"") >&5 + { (eval echo "$as_me:1794: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:1786: \$? = $ac_status" >&5 + echo "$as_me:1797: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else @@ -1793,11 +1804,11 @@ continue fi rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF -#line 1796 "configure" +#line 1807 "configure" #include "confdefs.h" $ac_declaration int -main () +main (void) { exit (42); ; @@ -1805,16 +1816,16 @@ exit (42); } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:1808: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:1819: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:1811: \$? = $ac_status" >&5 + echo "$as_me:1822: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:1814: \"$ac_try\"") >&5 + { (eval echo "$as_me:1825: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:1817: \$? = $ac_status" >&5 + echo "$as_me:1828: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else @@ -1844,15 +1855,117 @@ ac_main_return=return GCC_VERSION=none if test "$GCC" = yes ; then - echo "$as_me:1847: checking version of $CC" >&5 + echo "$as_me:1858: checking version of $CC" >&5 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6 GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC[^)]*) //' -e 's/^.*(Debian[^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`" test -z "$GCC_VERSION" && GCC_VERSION=unknown - echo "$as_me:1851: result: $GCC_VERSION" >&5 + echo "$as_me:1862: result: $GCC_VERSION" >&5 echo "${ECHO_T}$GCC_VERSION" >&6 fi -echo "$as_me:1855: checking for $CC option to accept ANSI C" >&5 +INTEL_COMPILER=no + +if test "$GCC" = yes ; then + case $host_os in + (linux*|gnu*) + echo "$as_me:1871: checking if this is really Intel C compiler" >&5 +echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6 + cf_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -no-gcc" + cat >conftest.$ac_ext <<_ACEOF +#line 1876 "configure" +#include "confdefs.h" + +int +main (void) +{ + +#ifdef __INTEL_COMPILER +#else +make an error +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:1893: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:1896: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:1899: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:1902: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + INTEL_COMPILER=yes +cf_save_CFLAGS="$cf_save_CFLAGS -we147" + +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest.$ac_ext + CFLAGS="$cf_save_CFLAGS" + echo "$as_me:1913: result: $INTEL_COMPILER" >&5 +echo "${ECHO_T}$INTEL_COMPILER" >&6 + ;; + esac +fi + +CLANG_COMPILER=no + +if test "$GCC" = yes ; then + echo "$as_me:1922: checking if this is really Clang C compiler" >&5 +echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6 + cf_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Qunused-arguments" + cat >conftest.$ac_ext <<_ACEOF +#line 1927 "configure" +#include "confdefs.h" + +int +main (void) +{ + +#ifdef __clang__ +#else +make an error +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:1944: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:1947: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:1950: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:1953: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + CLANG_COMPILER=yes +cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments" + +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest.$ac_ext + CFLAGS="$cf_save_CFLAGS" + echo "$as_me:1964: result: $CLANG_COMPILER" >&5 +echo "${ECHO_T}$CLANG_COMPILER" >&6 +fi + +echo "$as_me:1968: checking for $CC option to accept ANSI C" >&5 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 if test "${ac_cv_prog_cc_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -1860,7 +1973,7 @@ else ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF -#line 1863 "configure" +#line 1976 "configure" #include "confdefs.h" #include <stdarg.h> #include <stdio.h> @@ -1891,7 +2004,7 @@ int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, i int argc; char **argv; int -main () +main (void) { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; @@ -1909,16 +2022,16 @@ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIO do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext -if { (eval echo "$as_me:1912: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:2025: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:1915: \$? = $ac_status" >&5 + echo "$as_me:2028: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:1918: \"$ac_try\"") >&5 + { (eval echo "$as_me:2031: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:1921: \$? = $ac_status" >&5 + echo "$as_me:2034: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_stdc=$ac_arg break @@ -1935,10 +2048,10 @@ fi case "x$ac_cv_prog_cc_stdc" in x|xno) - echo "$as_me:1938: result: none needed" >&5 + echo "$as_me:2051: result: none needed" >&5 echo "${ECHO_T}none needed" >&6 ;; *) - echo "$as_me:1941: result: $ac_cv_prog_cc_stdc" >&5 + echo "$as_me:2054: result: $ac_cv_prog_cc_stdc" >&5 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 CC="$CC $ac_cv_prog_cc_stdc" ;; esac @@ -1946,17 +2059,137 @@ esac # This should have been defined by AC_PROG_CC : ${CC:=cc} -echo "$as_me:1949: checking \$CC variable" >&5 +echo "$as_me:2062: checking \$CFLAGS variable" >&5 +echo $ECHO_N "checking \$CFLAGS variable... $ECHO_C" >&6 +case "x$CFLAGS" in +(*-[IUD]*) + echo "$as_me:2066: result: broken" >&5 +echo "${ECHO_T}broken" >&6 + { echo "$as_me:2068: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&5 +echo "$as_me: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&2;} + cf_flags="$CFLAGS" + CFLAGS= + for cf_arg in $cf_flags + do + +cf_fix_cppflags=no +cf_new_cflags= +cf_new_cppflags= +cf_new_extra_cppflags= + +for cf_add_cflags in $cf_arg +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 + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + + continue + elif test "${cf_tst_cflags}" = "\"'" ; then + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + + continue + fi + ;; + esac + case "$CPPFLAGS" in + (*$cf_add_cflags) + ;; + (*) + case $cf_add_cflags in + (-D*) + cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` + +CPPFLAGS=`echo "$CPPFLAGS" | \ + sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \ + -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'` + + ;; + esac + + test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " + cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" + + ;; + esac + ;; + (*) + + test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " + cf_new_cflags="${cf_new_cflags}$cf_add_cflags" + + ;; + esac + ;; +(yes) + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + + test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no + ;; +esac +done + +if test -n "$cf_new_cflags" ; then + + test -n "$CFLAGS" && CFLAGS="$CFLAGS " + CFLAGS="${CFLAGS}$cf_new_cflags" + +fi + +if test -n "$cf_new_cppflags" ; then + + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" + +fi + +if test -n "$cf_new_extra_cppflags" ; then + + test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " + EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" + +fi + + done + ;; +(*) + echo "$as_me:2176: result: ok" >&5 +echo "${ECHO_T}ok" >&6 + ;; +esac + +echo "$as_me:2181: checking \$CC variable" >&5 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6 case "$CC" in (*[\ \ ]-*) - echo "$as_me:1953: result: broken" >&5 + echo "$as_me:2185: result: broken" >&5 echo "${ECHO_T}broken" >&6 - { echo "$as_me:1955: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&5 -echo "$as_me: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;} + { echo "$as_me:2187: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&5 +echo "$as_me: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;} # humor him... - cf_flags=`echo "$CC" | sed -e 's/^.*[ ]\(-[^ ]\)/\1/'` - CC=`echo "$CC " | sed -e 's/[ ]-[^ ].*$//' -e 's/[ ]*$//'` + cf_prog=`echo "$CC" | sed -e 's/ / /g' -e 's/[ ]* / /g' -e 's/[ ]*[ ]-[^ ].*//'` + cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", substr($0,1+length(prog))); }'` + CC="$cf_prog" for cf_arg in $cf_flags do case "x$cf_arg" in @@ -1967,7 +2200,7 @@ cf_new_cflags= cf_new_cppflags= cf_new_extra_cppflags= -for cf_add_cflags in $cf_flags +for cf_add_cflags in $cf_arg do case $cf_fix_cppflags in (no) @@ -1982,10 +2215,16 @@ case $cf_fix_cppflags in && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + 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" + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue fi ;; @@ -2004,17 +2243,25 @@ CPPFLAGS=`echo "$CPPFLAGS" | \ ;; esac - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + + test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " + cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" + ;; esac ;; (*) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" + + test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " + cf_new_cflags="${cf_new_cflags}$cf_add_cflags" + ;; esac ;; (yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` @@ -2027,17 +2274,23 @@ done if test -n "$cf_new_cflags" ; then - CFLAGS="$CFLAGS $cf_new_cflags" + test -n "$CFLAGS" && CFLAGS="$CFLAGS " + CFLAGS="${CFLAGS}$cf_new_cflags" + fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" + fi if test -n "$cf_new_extra_cppflags" ; then - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" + test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " + EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" + fi ;; @@ -2048,24 +2301,24 @@ fi done test -n "$verbose" && echo " resulting CC: '$CC'" 1>&6 -echo "${as_me:-configure}:2051: testing resulting CC: '$CC' ..." 1>&5 +echo "${as_me:-configure}:2304: testing resulting CC: '$CC' ..." 1>&5 test -n "$verbose" && echo " resulting CFLAGS: '$CFLAGS'" 1>&6 -echo "${as_me:-configure}:2055: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5 +echo "${as_me:-configure}:2308: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5 test -n "$verbose" && echo " resulting CPPFLAGS: '$CPPFLAGS'" 1>&6 -echo "${as_me:-configure}:2059: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5 +echo "${as_me:-configure}:2312: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5 ;; (*) - echo "$as_me:2063: result: ok" >&5 + echo "$as_me:2316: result: ok" >&5 echo "${ECHO_T}ok" >&6 ;; esac -echo "$as_me:2068: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "$as_me:2321: checking whether ${MAKE-make} sets \${MAKE}" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then @@ -2085,11 +2338,11 @@ fi rm -f conftest.make fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then - echo "$as_me:2088: result: yes" >&5 + echo "$as_me:2341: result: yes" >&5 echo "${ECHO_T}yes" >&6 SET_MAKE= else - echo "$as_me:2092: result: no" >&5 + echo "$as_me:2345: result: no" >&5 echo "${ECHO_T}no" >&6 SET_MAKE="MAKE=${MAKE-make}" fi @@ -2106,7 +2359,7 @@ fi # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. -echo "$as_me:2109: checking for a BSD compatible install" >&5 +echo "$as_me:2362: checking for a BSD compatible install" >&5 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then @@ -2155,7 +2408,7 @@ fi INSTALL=$ac_install_sh fi fi -echo "$as_me:2158: result: $INSTALL" >&5 +echo "$as_me:2411: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. @@ -2166,7 +2419,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' -echo "$as_me:2169: checking if filesystem supports mixed-case filenames" >&5 +echo "$as_me:2422: checking if filesystem supports mixed-case filenames" >&5 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6 if test "${cf_cv_mixedcase+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -2193,7 +2446,7 @@ else fi fi -echo "$as_me:2196: result: $cf_cv_mixedcase" >&5 +echo "$as_me:2449: result: $cf_cv_mixedcase" >&5 echo "${ECHO_T}$cf_cv_mixedcase" >&6 test "$cf_cv_mixedcase" = yes && cat >>confdefs.h <<\EOF @@ -2204,7 +2457,7 @@ for ac_prog in exctags ctags do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:2207: checking for $ac_word" >&5 +echo "$as_me:2460: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CTAGS+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -2219,7 +2472,7 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_CTAGS="$ac_prog" -echo "$as_me:2222: found $ac_dir/$ac_word" >&5 +echo "$as_me:2475: found $ac_dir/$ac_word" >&5 break done @@ -2227,10 +2480,10 @@ fi fi CTAGS=$ac_cv_prog_CTAGS if test -n "$CTAGS"; then - echo "$as_me:2230: result: $CTAGS" >&5 + echo "$as_me:2483: result: $CTAGS" >&5 echo "${ECHO_T}$CTAGS" >&6 else - echo "$as_me:2233: result: no" >&5 + echo "$as_me:2486: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -2241,7 +2494,7 @@ for ac_prog in exetags etags do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:2244: checking for $ac_word" >&5 +echo "$as_me:2497: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ETAGS+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -2256,7 +2509,7 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_ETAGS="$ac_prog" -echo "$as_me:2259: found $ac_dir/$ac_word" >&5 +echo "$as_me:2512: found $ac_dir/$ac_word" >&5 break done @@ -2264,10 +2517,10 @@ fi fi ETAGS=$ac_cv_prog_ETAGS if test -n "$ETAGS"; then - echo "$as_me:2267: result: $ETAGS" >&5 + echo "$as_me:2520: result: $ETAGS" >&5 echo "${ECHO_T}$ETAGS" >&6 else - echo "$as_me:2270: result: no" >&5 + echo "$as_me:2523: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -2276,7 +2529,7 @@ done # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args. set dummy ${CTAGS:-ctags}; ac_word=$2 -echo "$as_me:2279: checking for $ac_word" >&5 +echo "$as_me:2532: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -2291,7 +2544,7 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_MAKE_LOWER_TAGS="yes" -echo "$as_me:2294: found $ac_dir/$ac_word" >&5 +echo "$as_me:2547: found $ac_dir/$ac_word" >&5 break done @@ -2300,17 +2553,17 @@ fi fi MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS if test -n "$MAKE_LOWER_TAGS"; then - echo "$as_me:2303: result: $MAKE_LOWER_TAGS" >&5 + echo "$as_me:2556: result: $MAKE_LOWER_TAGS" >&5 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6 else - echo "$as_me:2306: result: no" >&5 + echo "$as_me:2559: result: no" >&5 echo "${ECHO_T}no" >&6 fi if test "$cf_cv_mixedcase" = yes ; then # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args. set dummy ${ETAGS:-etags}; ac_word=$2 -echo "$as_me:2313: checking for $ac_word" >&5 +echo "$as_me:2566: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -2325,7 +2578,7 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_MAKE_UPPER_TAGS="yes" -echo "$as_me:2328: found $ac_dir/$ac_word" >&5 +echo "$as_me:2581: found $ac_dir/$ac_word" >&5 break done @@ -2334,10 +2587,10 @@ fi fi MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS if test -n "$MAKE_UPPER_TAGS"; then - echo "$as_me:2337: result: $MAKE_UPPER_TAGS" >&5 + echo "$as_me:2590: result: $MAKE_UPPER_TAGS" >&5 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6 else - echo "$as_me:2340: result: no" >&5 + echo "$as_me:2593: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -2361,7 +2614,7 @@ for ac_prog in mawk gawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:2364: checking for $ac_word" >&5 +echo "$as_me:2617: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AWK+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -2376,7 +2629,7 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_AWK="$ac_prog" -echo "$as_me:2379: found $ac_dir/$ac_word" >&5 +echo "$as_me:2632: found $ac_dir/$ac_word" >&5 break done @@ -2384,17 +2637,17 @@ fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then - echo "$as_me:2387: result: $AWK" >&5 + echo "$as_me:2640: result: $AWK" >&5 echo "${ECHO_T}$AWK" >&6 else - echo "$as_me:2390: result: no" >&5 + echo "$as_me:2643: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$AWK" && break done -test -z "$AWK" && { { echo "$as_me:2397: error: No awk program found" >&5 +test -z "$AWK" && { { echo "$as_me:2650: error: No awk program found" >&5 echo "$as_me: error: No awk program found" >&2;} { (exit 1); exit 1; }; } @@ -2402,7 +2655,7 @@ for ac_prog in lint cppcheck splint do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:2405: checking for $ac_word" >&5 +echo "$as_me:2658: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_LINT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -2417,7 +2670,7 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_LINT="$ac_prog" -echo "$as_me:2420: found $ac_dir/$ac_word" >&5 +echo "$as_me:2673: found $ac_dir/$ac_word" >&5 break done @@ -2425,16 +2678,73 @@ fi fi LINT=$ac_cv_prog_LINT if test -n "$LINT"; then - echo "$as_me:2428: result: $LINT" >&5 + echo "$as_me:2681: result: $LINT" >&5 echo "${ECHO_T}$LINT" >&6 else - echo "$as_me:2431: result: no" >&5 + echo "$as_me:2684: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$LINT" && break done +case "x$LINT" in +(xcppcheck|x*/cppcheck) + test -z "$LINT_OPTS" && LINT_OPTS="--enable=all" + ;; +esac + +echo "$as_me:2697: checking if the POSIX test-macros are already defined" >&5 +echo $ECHO_N "checking if the POSIX test-macros are already defined... $ECHO_C" >&6 +if test "${cf_cv_posix_visible+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +cat >conftest.$ac_ext <<_ACEOF +#line 2704 "configure" +#include "confdefs.h" +#include <stdio.h> +int +main (void) +{ + +#if defined(__POSIX_VISIBLE) && ((__POSIX_VISIBLE - 0L) > 0) \ + && defined(__XSI_VISIBLE) && ((__XSI_VISIBLE - 0L) > 0) \ + && defined(__BSD_VISIBLE) && ((__BSD_VISIBLE - 0L) > 0) \ + && defined(__ISO_C_VISIBLE) && ((__ISO_C_VISIBLE - 0L) > 0) +#error conflicting symbols found +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:2723: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:2726: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:2729: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2732: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_posix_visible=no +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_posix_visible=yes +fi +rm -f conftest.$ac_objext conftest.$ac_ext + +fi +echo "$as_me:2743: result: $cf_cv_posix_visible" >&5 +echo "${ECHO_T}$cf_cv_posix_visible" >&6 + +if test "$cf_cv_posix_visible" = no; then + cf_XOPEN_SOURCE=500 cf_POSIX_C_SOURCE=199506L cf_xopen_source= @@ -2453,7 +2763,7 @@ case $host_os in cf_xopen_source="-D_DARWIN_C_SOURCE" cf_XOPEN_SOURCE= ;; -(freebsd*|dragonfly*) +(freebsd*|dragonfly*|midnightbsd*) # 5.x headers associate # _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L # _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L @@ -2473,71 +2783,436 @@ case $host_os in ;; (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin) -echo "$as_me:2476: checking if we must define _GNU_SOURCE" >&5 +cf_gnu_xopen_source=$cf_XOPEN_SOURCE + +echo "$as_me:2788: checking if this is the GNU C library" >&5 +echo $ECHO_N "checking if this is the GNU C library... $ECHO_C" >&6 +if test "${cf_cv_gnu_library+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +cat >conftest.$ac_ext <<_ACEOF +#line 2795 "configure" +#include "confdefs.h" +#include <sys/types.h> +int +main (void) +{ + + #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0 + return 0; + #elif __NEWLIB__ > 0 && __NEWLIB_MINOR__ >= 0 + return 0; + #else + # error not GNU C library + #endif + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:2814: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:2817: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:2820: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2823: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_gnu_library=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_gnu_library=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext + +fi +echo "$as_me:2834: result: $cf_cv_gnu_library" >&5 +echo "${ECHO_T}$cf_cv_gnu_library" >&6 + +if test x$cf_cv_gnu_library = xyes; then + + # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE + # was changed to help a little. newlib incorporated the change about 4 + # years later. + echo "$as_me:2842: checking if _DEFAULT_SOURCE can be used as a basis" >&5 +echo $ECHO_N "checking if _DEFAULT_SOURCE can be used as a basis... $ECHO_C" >&6 +if test "${cf_cv_gnu_library_219+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + cf_save="$CPPFLAGS" + + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE" + + cat >conftest.$ac_ext <<_ACEOF +#line 2854 "configure" +#include "confdefs.h" +#include <sys/types.h> +int +main (void) +{ + + #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2) + return 0; + #elif (__NEWLIB__ == 2 && __NEWLIB_MINOR__ >= 4) || (__GLIBC__ > 3) + return 0; + #else + # error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old + #endif + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:2873: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:2876: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:2879: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2882: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_gnu_library_219=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_gnu_library_219=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext + CPPFLAGS="$cf_save" + +fi +echo "$as_me:2894: result: $cf_cv_gnu_library_219" >&5 +echo "${ECHO_T}$cf_cv_gnu_library_219" >&6 + + if test "x$cf_cv_gnu_library_219" = xyes; then + cf_save="$CPPFLAGS" + echo "$as_me:2899: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5 +echo $ECHO_N "checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE... $ECHO_C" >&6 +if test "${cf_cv_gnu_dftsrc_219+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +cf_fix_cppflags=no +cf_new_cflags= +cf_new_cppflags= +cf_new_extra_cppflags= + +for cf_add_cflags in -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source +do +case $cf_fix_cppflags in +(no) + case $cf_add_cflags in + (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) + case $cf_add_cflags in + (-D*) + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + + test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes + + if test $cf_fix_cppflags = yes ; then + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + + continue + elif test "${cf_tst_cflags}" = "\"'" ; then + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + + continue + fi + ;; + esac + case "$CPPFLAGS" in + (*$cf_add_cflags) + ;; + (*) + case $cf_add_cflags in + (-D*) + cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` + +CPPFLAGS=`echo "$CPPFLAGS" | \ + sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \ + -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'` + + ;; + esac + + test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " + cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" + + ;; + esac + ;; + (*) + + test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " + cf_new_cflags="${cf_new_cflags}$cf_add_cflags" + + ;; + esac + ;; +(yes) + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + + test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no + ;; +esac +done + +if test -n "$cf_new_cflags" ; then + + test -n "$CFLAGS" && CFLAGS="$CFLAGS " + CFLAGS="${CFLAGS}$cf_new_cflags" + +fi + +if test -n "$cf_new_cppflags" ; then + + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" + +fi + +if test -n "$cf_new_extra_cppflags" ; then + + test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " + EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" + +fi + + cat >conftest.$ac_ext <<_ACEOF +#line 3004 "configure" +#include "confdefs.h" + + #include <limits.h> + #include <sys/types.h> + +int +main (void) +{ + + #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1) + return 0; + #else + # error GNU C library is too old + #endif + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:3024: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:3027: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:3030: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3033: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_gnu_dftsrc_219=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_gnu_dftsrc_219=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext + +fi +echo "$as_me:3044: result: $cf_cv_gnu_dftsrc_219" >&5 +echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6 + test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save" + else + cf_cv_gnu_dftsrc_219=maybe + fi + + if test "x$cf_cv_gnu_dftsrc_219" != xyes; then + + echo "$as_me:3053: checking if we must define _GNU_SOURCE" >&5 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6 if test "${cf_cv_gnu_source+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -cat >conftest.$ac_ext <<_ACEOF -#line 2483 "configure" + cat >conftest.$ac_ext <<_ACEOF +#line 3060 "configure" #include "confdefs.h" #include <sys/types.h> int -main () +main (void) { -#ifndef _XOPEN_SOURCE -make an error -#endif + #ifndef _XOPEN_SOURCE + #error expected _XOPEN_SOURCE to be defined + #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:2498: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:3075: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:2501: \$? = $ac_status" >&5 + echo "$as_me:3078: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:2504: \"$ac_try\"") >&5 + { (eval echo "$as_me:3081: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2507: \$? = $ac_status" >&5 + echo "$as_me:3084: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_gnu_source=no else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_save="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" - cat >conftest.$ac_ext <<_ACEOF -#line 2516 "configure" + +cf_fix_cppflags=no +cf_new_cflags= +cf_new_cppflags= +cf_new_extra_cppflags= + +for cf_add_cflags in -D_GNU_SOURCE +do +case $cf_fix_cppflags in +(no) + case $cf_add_cflags in + (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) + case $cf_add_cflags in + (-D*) + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + + test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes + + if test $cf_fix_cppflags = yes ; then + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + + continue + elif test "${cf_tst_cflags}" = "\"'" ; then + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + + continue + fi + ;; + esac + case "$CPPFLAGS" in + (*$cf_add_cflags) + ;; + (*) + case $cf_add_cflags in + (-D*) + cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` + +CPPFLAGS=`echo "$CPPFLAGS" | \ + sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \ + -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'` + + ;; + esac + + test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " + cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" + + ;; + esac + ;; + (*) + + test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " + cf_new_cflags="${cf_new_cflags}$cf_add_cflags" + + ;; + esac + ;; +(yes) + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + + test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no + ;; +esac +done + +if test -n "$cf_new_cflags" ; then + + test -n "$CFLAGS" && CFLAGS="$CFLAGS " + CFLAGS="${CFLAGS}$cf_new_cflags" + +fi + +if test -n "$cf_new_cppflags" ; then + + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" + +fi + +if test -n "$cf_new_extra_cppflags" ; then + + test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " + EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" + +fi + + cat >conftest.$ac_ext <<_ACEOF +#line 3191 "configure" #include "confdefs.h" #include <sys/types.h> int -main () +main (void) { -#ifdef _XOPEN_SOURCE -make an error -#endif + #ifdef _XOPEN_SOURCE + #error expected _XOPEN_SOURCE to be undefined + #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:2531: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:3206: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:2534: \$? = $ac_status" >&5 + echo "$as_me:3209: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:2537: \"$ac_try\"") >&5 + { (eval echo "$as_me:3212: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2540: \$? = $ac_status" >&5 + echo "$as_me:3215: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_gnu_source=no else @@ -2546,50 +3221,52 @@ cat conftest.$ac_ext >&5 cf_cv_gnu_source=yes fi rm -f conftest.$ac_objext conftest.$ac_ext - CPPFLAGS="$cf_save" + CPPFLAGS="$cf_save" fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:2555: result: $cf_cv_gnu_source" >&5 +echo "$as_me:3230: result: $cf_cv_gnu_source" >&5 echo "${ECHO_T}$cf_cv_gnu_source" >&6 -if test "$cf_cv_gnu_source" = yes -then -echo "$as_me:2560: checking if we should also define _DEFAULT_SOURCE" >&5 + if test "$cf_cv_gnu_source" = yes + then + echo "$as_me:3235: checking if we should also define _DEFAULT_SOURCE" >&5 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6 if test "${cf_cv_default_source+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" - cat >conftest.$ac_ext <<_ACEOF -#line 2568 "configure" + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}-D_GNU_SOURCE" + + cat >conftest.$ac_ext <<_ACEOF +#line 3245 "configure" #include "confdefs.h" #include <sys/types.h> int -main () +main (void) { -#ifdef _DEFAULT_SOURCE -make an error -#endif + #ifdef _DEFAULT_SOURCE + #error expected _DEFAULT_SOURCE to be undefined + #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:2583: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:3260: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:2586: \$? = $ac_status" >&5 + echo "$as_me:3263: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:2589: \"$ac_try\"") >&5 + { (eval echo "$as_me:3266: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2592: \$? = $ac_status" >&5 + echo "$as_me:3269: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_default_source=no else @@ -2600,9 +3277,18 @@ fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:2603: result: $cf_cv_default_source" >&5 +echo "$as_me:3280: result: $cf_cv_default_source" >&5 echo "${ECHO_T}$cf_cv_default_source" >&6 -test "$cf_cv_default_source" = yes && CPPFLAGS="$CPPFLAGS -D_DEFAULT_SOURCE" + if test "$cf_cv_default_source" = yes + then + + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE" + + fi + fi + fi + fi ;; @@ -2613,6 +3299,8 @@ fi # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types cf_XOPEN_SOURCE= +if test "$cf_cv_posix_visible" = no; then + cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE cf_save_CFLAGS="$CFLAGS" @@ -2626,20 +3314,20 @@ cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \ sed -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?$//g'` -echo "$as_me:2629: checking if we should define _POSIX_C_SOURCE" >&5 +echo "$as_me:3317: checking if we should define _POSIX_C_SOURCE" >&5 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6 if test "${cf_cv_posix_c_source+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -echo "${as_me:-configure}:2635: testing if the symbol is already defined go no further ..." 1>&5 +echo "${as_me:-configure}:3323: testing if the symbol is already defined go no further ..." 1>&5 cat >conftest.$ac_ext <<_ACEOF -#line 2638 "configure" +#line 3326 "configure" #include "confdefs.h" #include <sys/types.h> int -main () +main (void) { #ifndef _POSIX_C_SOURCE @@ -2650,16 +3338,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:2653: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:3341: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:2656: \$? = $ac_status" >&5 + echo "$as_me:3344: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:2659: \"$ac_try\"") >&5 + { (eval echo "$as_me:3347: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2662: \$? = $ac_status" >&5 + echo "$as_me:3350: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_posix_c_source=no else @@ -2680,11 +3368,11 @@ cf_want_posix_source=no esac if test "$cf_want_posix_source" = yes ; then cat >conftest.$ac_ext <<_ACEOF -#line 2683 "configure" +#line 3371 "configure" #include "confdefs.h" #include <sys/types.h> int -main () +main (void) { #ifdef _POSIX_SOURCE @@ -2695,16 +3383,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:2698: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:3386: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:2701: \$? = $ac_status" >&5 + echo "$as_me:3389: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:2704: \"$ac_try\"") >&5 + { (eval echo "$as_me:3392: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2707: \$? = $ac_status" >&5 + echo "$as_me:3395: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else @@ -2715,19 +3403,22 @@ fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "${as_me:-configure}:2718: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5 +echo "${as_me:-configure}:3406: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5 CFLAGS="$cf_trim_CFLAGS" - CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source" + CPPFLAGS="$cf_trim_CPPFLAGS" + + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source" -echo "${as_me:-configure}:2723: testing if the second compile does not leave our definition intact error ..." 1>&5 +echo "${as_me:-configure}:3414: testing if the second compile does not leave our definition intact error ..." 1>&5 cat >conftest.$ac_ext <<_ACEOF -#line 2726 "configure" +#line 3417 "configure" #include "confdefs.h" #include <sys/types.h> int -main () +main (void) { #ifndef _POSIX_C_SOURCE @@ -2738,16 +3429,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:2741: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:3432: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:2744: \$? = $ac_status" >&5 + echo "$as_me:3435: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:2747: \"$ac_try\"") >&5 + { (eval echo "$as_me:3438: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2750: \$? = $ac_status" >&5 + echo "$as_me:3441: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else @@ -2763,7 +3454,7 @@ fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:2766: result: $cf_cv_posix_c_source" >&5 +echo "$as_me:3457: result: $cf_cv_posix_c_source" >&5 echo "${ECHO_T}$cf_cv_posix_c_source" >&6 if test "$cf_cv_posix_c_source" != no ; then @@ -2790,10 +3481,16 @@ case $cf_fix_cppflags in && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + 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" + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue fi ;; @@ -2812,17 +3509,25 @@ CPPFLAGS=`echo "$CPPFLAGS" | \ ;; esac - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + + test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " + cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" + ;; esac ;; (*) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" + + test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " + cf_new_cflags="${cf_new_cflags}$cf_add_cflags" + ;; esac ;; (yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` @@ -2835,21 +3540,29 @@ done if test -n "$cf_new_cflags" ; then - CFLAGS="$CFLAGS $cf_new_cflags" + test -n "$CFLAGS" && CFLAGS="$CFLAGS " + CFLAGS="${CFLAGS}$cf_new_cflags" + fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" + fi if test -n "$cf_new_extra_cppflags" ; then - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" + test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " + EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" + fi fi +fi # cf_cv_posix_visible + ;; (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 @@ -2881,14 +3594,14 @@ fi ;; (*) -echo "$as_me:2884: checking if we should define _XOPEN_SOURCE" >&5 +echo "$as_me:3597: checking if we should define _XOPEN_SOURCE" >&5 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6 if test "${cf_cv_xopen_source+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 2891 "configure" +#line 3604 "configure" #include "confdefs.h" #include <stdlib.h> @@ -2896,7 +3609,7 @@ else #include <sys/types.h> int -main () +main (void) { #ifndef _XOPEN_SOURCE @@ -2907,25 +3620,28 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:2910: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:3623: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:2913: \$? = $ac_status" >&5 + echo "$as_me:3626: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:2916: \"$ac_try\"") >&5 + { (eval echo "$as_me:3629: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2919: \$? = $ac_status" >&5 + echo "$as_me:3632: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_xopen_source=no else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_save="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" + + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" + cat >conftest.$ac_ext <<_ACEOF -#line 2928 "configure" +#line 3644 "configure" #include "confdefs.h" #include <stdlib.h> @@ -2933,7 +3649,7 @@ cf_save="$CPPFLAGS" #include <sys/types.h> int -main () +main (void) { #ifdef _XOPEN_SOURCE @@ -2944,16 +3660,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:2947: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:3663: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:2950: \$? = $ac_status" >&5 + echo "$as_me:3666: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:2953: \"$ac_try\"") >&5 + { (eval echo "$as_me:3669: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2956: \$? = $ac_status" >&5 + echo "$as_me:3672: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_xopen_source=no else @@ -2968,7 +3684,7 @@ fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:2971: result: $cf_cv_xopen_source" >&5 +echo "$as_me:3687: result: $cf_cv_xopen_source" >&5 echo "${ECHO_T}$cf_cv_xopen_source" >&6 if test "$cf_cv_xopen_source" != no ; then @@ -3003,10 +3719,16 @@ case $cf_fix_cppflags in && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + 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" + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue fi ;; @@ -3025,17 +3747,25 @@ CPPFLAGS=`echo "$CPPFLAGS" | \ ;; esac - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + + test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " + cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" + ;; esac ;; (*) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" + + test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " + cf_new_cflags="${cf_new_cflags}$cf_add_cflags" + ;; esac ;; (yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` @@ -3048,21 +3778,29 @@ done if test -n "$cf_new_cflags" ; then - CFLAGS="$CFLAGS $cf_new_cflags" + test -n "$CFLAGS" && CFLAGS="$CFLAGS " + CFLAGS="${CFLAGS}$cf_new_cflags" + fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" + fi if test -n "$cf_new_extra_cppflags" ; then - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" + test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " + EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" + fi fi +if test "$cf_cv_posix_visible" = no; then + cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE cf_save_CFLAGS="$CFLAGS" @@ -3076,20 +3814,20 @@ cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \ sed -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?$//g'` -echo "$as_me:3079: checking if we should define _POSIX_C_SOURCE" >&5 +echo "$as_me:3817: checking if we should define _POSIX_C_SOURCE" >&5 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6 if test "${cf_cv_posix_c_source+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -echo "${as_me:-configure}:3085: testing if the symbol is already defined go no further ..." 1>&5 +echo "${as_me:-configure}:3823: testing if the symbol is already defined go no further ..." 1>&5 cat >conftest.$ac_ext <<_ACEOF -#line 3088 "configure" +#line 3826 "configure" #include "confdefs.h" #include <sys/types.h> int -main () +main (void) { #ifndef _POSIX_C_SOURCE @@ -3100,16 +3838,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:3103: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:3841: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:3106: \$? = $ac_status" >&5 + echo "$as_me:3844: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:3109: \"$ac_try\"") >&5 + { (eval echo "$as_me:3847: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3112: \$? = $ac_status" >&5 + echo "$as_me:3850: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_posix_c_source=no else @@ -3130,11 +3868,11 @@ cf_want_posix_source=no esac if test "$cf_want_posix_source" = yes ; then cat >conftest.$ac_ext <<_ACEOF -#line 3133 "configure" +#line 3871 "configure" #include "confdefs.h" #include <sys/types.h> int -main () +main (void) { #ifdef _POSIX_SOURCE @@ -3145,16 +3883,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:3148: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:3886: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:3151: \$? = $ac_status" >&5 + echo "$as_me:3889: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:3154: \"$ac_try\"") >&5 + { (eval echo "$as_me:3892: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3157: \$? = $ac_status" >&5 + echo "$as_me:3895: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else @@ -3165,19 +3903,22 @@ fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "${as_me:-configure}:3168: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5 +echo "${as_me:-configure}:3906: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5 CFLAGS="$cf_trim_CFLAGS" - CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source" + CPPFLAGS="$cf_trim_CPPFLAGS" + + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source" -echo "${as_me:-configure}:3173: testing if the second compile does not leave our definition intact error ..." 1>&5 +echo "${as_me:-configure}:3914: testing if the second compile does not leave our definition intact error ..." 1>&5 cat >conftest.$ac_ext <<_ACEOF -#line 3176 "configure" +#line 3917 "configure" #include "confdefs.h" #include <sys/types.h> int -main () +main (void) { #ifndef _POSIX_C_SOURCE @@ -3188,16 +3929,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:3191: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:3932: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:3194: \$? = $ac_status" >&5 + echo "$as_me:3935: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:3197: \"$ac_try\"") >&5 + { (eval echo "$as_me:3938: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3200: \$? = $ac_status" >&5 + echo "$as_me:3941: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else @@ -3213,7 +3954,7 @@ fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:3216: result: $cf_cv_posix_c_source" >&5 +echo "$as_me:3957: result: $cf_cv_posix_c_source" >&5 echo "${ECHO_T}$cf_cv_posix_c_source" >&6 if test "$cf_cv_posix_c_source" != no ; then @@ -3240,10 +3981,16 @@ case $cf_fix_cppflags in && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + 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" + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue fi ;; @@ -3262,17 +4009,25 @@ CPPFLAGS=`echo "$CPPFLAGS" | \ ;; esac - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + + test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " + cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" + ;; esac ;; (*) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" + + test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " + cf_new_cflags="${cf_new_cflags}$cf_add_cflags" + ;; esac ;; (yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` @@ -3285,21 +4040,29 @@ done if test -n "$cf_new_cflags" ; then - CFLAGS="$CFLAGS $cf_new_cflags" + test -n "$CFLAGS" && CFLAGS="$CFLAGS " + CFLAGS="${CFLAGS}$cf_new_cflags" + fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" + fi if test -n "$cf_new_extra_cppflags" ; then - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" + test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " + EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" + fi fi +fi # cf_cv_posix_visible + ;; esac @@ -3325,10 +4088,16 @@ case $cf_fix_cppflags in && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + 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" + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue fi ;; @@ -3347,17 +4116,25 @@ CPPFLAGS=`echo "$CPPFLAGS" | \ ;; esac - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + + test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " + cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" + ;; esac ;; (*) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" + + test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " + cf_new_cflags="${cf_new_cflags}$cf_add_cflags" + ;; esac ;; (yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` @@ -3371,38 +4148,44 @@ done if test -n "$cf_new_cflags" ; then test -n "$verbose" && echo " add to \$CFLAGS $cf_new_cflags" 1>&6 -echo "${as_me:-configure}:3374: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5 +echo "${as_me:-configure}:4151: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5 + + test -n "$CFLAGS" && CFLAGS="$CFLAGS " + CFLAGS="${CFLAGS}$cf_new_cflags" - CFLAGS="$CFLAGS $cf_new_cflags" fi if test -n "$cf_new_cppflags" ; then test -n "$verbose" && echo " add to \$CPPFLAGS $cf_new_cppflags" 1>&6 -echo "${as_me:-configure}:3382: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5 +echo "${as_me:-configure}:4161: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5 + + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" fi if test -n "$cf_new_extra_cppflags" ; then test -n "$verbose" && echo " add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6 -echo "${as_me:-configure}:3390: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5 +echo "${as_me:-configure}:4171: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5 + + test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " + EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" fi fi if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then - echo "$as_me:3398: checking if _XOPEN_SOURCE really is set" >&5 + echo "$as_me:4181: checking if _XOPEN_SOURCE really is set" >&5 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -#line 3401 "configure" +#line 4184 "configure" #include "confdefs.h" #include <stdlib.h> int -main () +main (void) { #ifndef _XOPEN_SOURCE @@ -3413,16 +4196,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:3416: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:4199: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:3419: \$? = $ac_status" >&5 + echo "$as_me:4202: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:3422: \"$ac_try\"") >&5 + { (eval echo "$as_me:4205: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3425: \$? = $ac_status" >&5 + echo "$as_me:4208: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_XOPEN_SOURCE_set=yes else @@ -3431,16 +4214,16 @@ cat conftest.$ac_ext >&5 cf_XOPEN_SOURCE_set=no fi rm -f conftest.$ac_objext conftest.$ac_ext - echo "$as_me:3434: result: $cf_XOPEN_SOURCE_set" >&5 + echo "$as_me:4217: result: $cf_XOPEN_SOURCE_set" >&5 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6 if test $cf_XOPEN_SOURCE_set = yes then cat >conftest.$ac_ext <<_ACEOF -#line 3439 "configure" +#line 4222 "configure" #include "confdefs.h" #include <stdlib.h> int -main () +main (void) { #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE @@ -3451,16 +4234,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:3454: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:4237: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:3457: \$? = $ac_status" >&5 + echo "$as_me:4240: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:3460: \"$ac_try\"") >&5 + { (eval echo "$as_me:4243: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3463: \$? = $ac_status" >&5 + echo "$as_me:4246: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_XOPEN_SOURCE_set_ok=yes else @@ -3471,19 +4254,19 @@ fi rm -f conftest.$ac_objext conftest.$ac_ext if test $cf_XOPEN_SOURCE_set_ok = no then - { echo "$as_me:3474: WARNING: _XOPEN_SOURCE is lower than requested" >&5 + { echo "$as_me:4257: WARNING: _XOPEN_SOURCE is lower than requested" >&5 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;} fi else -echo "$as_me:3479: checking if we should define _XOPEN_SOURCE" >&5 +echo "$as_me:4262: checking if we should define _XOPEN_SOURCE" >&5 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6 if test "${cf_cv_xopen_source+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 3486 "configure" +#line 4269 "configure" #include "confdefs.h" #include <stdlib.h> @@ -3491,7 +4274,7 @@ else #include <sys/types.h> int -main () +main (void) { #ifndef _XOPEN_SOURCE @@ -3502,25 +4285,28 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:3505: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:4288: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:3508: \$? = $ac_status" >&5 + echo "$as_me:4291: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:3511: \"$ac_try\"") >&5 + { (eval echo "$as_me:4294: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3514: \$? = $ac_status" >&5 + echo "$as_me:4297: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_xopen_source=no else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cf_save="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" + + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" + cat >conftest.$ac_ext <<_ACEOF -#line 3523 "configure" +#line 4309 "configure" #include "confdefs.h" #include <stdlib.h> @@ -3528,7 +4314,7 @@ cf_save="$CPPFLAGS" #include <sys/types.h> int -main () +main (void) { #ifdef _XOPEN_SOURCE @@ -3539,16 +4325,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:3542: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:4328: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:3545: \$? = $ac_status" >&5 + echo "$as_me:4331: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:3548: \"$ac_try\"") >&5 + { (eval echo "$as_me:4334: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3551: \$? = $ac_status" >&5 + echo "$as_me:4337: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_xopen_source=no else @@ -3563,7 +4349,7 @@ fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:3566: result: $cf_cv_xopen_source" >&5 +echo "$as_me:4352: result: $cf_cv_xopen_source" >&5 echo "${ECHO_T}$cf_cv_xopen_source" >&6 if test "$cf_cv_xopen_source" != no ; then @@ -3598,10 +4384,16 @@ case $cf_fix_cppflags in && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + 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" + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue fi ;; @@ -3620,17 +4412,25 @@ CPPFLAGS=`echo "$CPPFLAGS" | \ ;; esac - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + + test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " + cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" + ;; esac ;; (*) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" + + test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " + cf_new_cflags="${cf_new_cflags}$cf_add_cflags" + ;; esac ;; (yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` @@ -3643,23 +4443,30 @@ done if test -n "$cf_new_cflags" ; then - CFLAGS="$CFLAGS $cf_new_cflags" + test -n "$CFLAGS" && CFLAGS="$CFLAGS " + CFLAGS="${CFLAGS}$cf_new_cflags" + fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" + fi if test -n "$cf_new_extra_cppflags" ; then - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" + test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " + EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" + fi fi fi fi +fi # cf_cv_posix_visible ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -3667,7 +4474,7 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_main_return=return -echo "$as_me:3670: checking how to run the C preprocessor" >&5 +echo "$as_me:4477: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then @@ -3688,18 +4495,18 @@ do # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF -#line 3691 "configure" +#line 4498 "configure" #include "confdefs.h" #include <assert.h> Syntax error _ACEOF -if { (eval echo "$as_me:3696: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:4503: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:3702: \$? = $ac_status" >&5 + echo "$as_me:4509: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -3722,17 +4529,17 @@ rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF -#line 3725 "configure" +#line 4532 "configure" #include "confdefs.h" #include <ac_nonexistent.h> _ACEOF -if { (eval echo "$as_me:3729: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:4536: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:3735: \$? = $ac_status" >&5 + echo "$as_me:4542: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -3769,7 +4576,7 @@ fi else ac_cv_prog_CPP=$CPP fi -echo "$as_me:3772: result: $CPP" >&5 +echo "$as_me:4579: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6 ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes @@ -3779,18 +4586,18 @@ do # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF -#line 3782 "configure" +#line 4589 "configure" #include "confdefs.h" #include <assert.h> Syntax error _ACEOF -if { (eval echo "$as_me:3787: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:4594: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:3793: \$? = $ac_status" >&5 + echo "$as_me:4600: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -3813,17 +4620,17 @@ rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF -#line 3816 "configure" +#line 4623 "configure" #include "confdefs.h" #include <ac_nonexistent.h> _ACEOF -if { (eval echo "$as_me:3820: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:4627: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:3826: \$? = $ac_status" >&5 + echo "$as_me:4633: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -3851,7 +4658,7 @@ rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else - { { echo "$as_me:3854: error: C preprocessor \"$CPP\" fails sanity check" >&5 + { { echo "$as_me:4661: error: C preprocessor \"$CPP\" fails sanity check" >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;} { (exit 1); exit 1; }; } fi @@ -3866,23 +4673,23 @@ ac_main_return=return for ac_header in fcntl.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:3869: checking for $ac_header" >&5 +echo "$as_me:4676: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 3875 "configure" +#line 4682 "configure" #include "confdefs.h" #include <$ac_header> _ACEOF -if { (eval echo "$as_me:3879: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:4686: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:3885: \$? = $ac_status" >&5 + echo "$as_me:4692: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -3901,7 +4708,7 @@ else fi rm -f conftest.err conftest.$ac_ext fi -echo "$as_me:3904: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "$as_me:4711: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<EOF @@ -3916,23 +4723,23 @@ unistd.h \ do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:3919: checking for $ac_header" >&5 +echo "$as_me:4726: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 3925 "configure" +#line 4732 "configure" #include "confdefs.h" #include <$ac_header> _ACEOF -if { (eval echo "$as_me:3929: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:4736: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:3935: \$? = $ac_status" >&5 + echo "$as_me:4742: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -3951,7 +4758,7 @@ else fi rm -f conftest.err conftest.$ac_ext fi -echo "$as_me:3954: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "$as_me:4761: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<EOF @@ -3961,7 +4768,7 @@ EOF fi done -echo "$as_me:3964: checking for working mkstemp" >&5 +echo "$as_me:4771: checking for working mkstemp" >&5 echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6 if test "${cf_cv_func_mkstemp+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3972,7 +4779,7 @@ if test "$cross_compiling" = yes; then cf_cv_func_mkstemp=maybe else cat >conftest.$ac_ext <<_ACEOF -#line 3975 "configure" +#line 4782 "configure" #include "confdefs.h" #include <sys/types.h> @@ -4013,15 +4820,15 @@ int main(void) _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:4016: \"$ac_link\"") >&5 +if { (eval echo "$as_me:4823: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:4019: \$? = $ac_status" >&5 + echo "$as_me:4826: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:4021: \"$ac_try\"") >&5 + { (eval echo "$as_me:4828: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4024: \$? = $ac_status" >&5 + echo "$as_me:4831: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_func_mkstemp=yes @@ -4036,56 +4843,56 @@ rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -echo "$as_me:4039: result: $cf_cv_func_mkstemp" >&5 +echo "$as_me:4846: result: $cf_cv_func_mkstemp" >&5 echo "${ECHO_T}$cf_cv_func_mkstemp" >&6 if test "x$cf_cv_func_mkstemp" = xmaybe ; then - echo "$as_me:4042: checking for mkstemp" >&5 + echo "$as_me:4849: checking for mkstemp" >&5 echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6 if test "${ac_cv_func_mkstemp+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 4048 "configure" +#line 4855 "configure" #include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char mkstemp (); below. */ -#include <assert.h> -/* Override any gcc2 internal prototype to avoid an error. */ +#define mkstemp autoconf_temporary +#include <limits.h> /* least-intrusive standard header which defines gcc2 __stub macros */ +#undef mkstemp + #ifdef __cplusplus extern "C" #endif + /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ -char mkstemp (); -char (*f) (); +char mkstemp (void); int -main () +main (void) { -/* The GNU C library defines this for functions which it implements + +/* The GNU C library defines stubs for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_mkstemp) || defined (__stub___mkstemp) -choke me -#else -f = mkstemp; /* workaround for ICC 12.0.3 */ if (f == 0) return 1; +#error found stub for mkstemp #endif + return mkstemp (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:4079: \"$ac_link\"") >&5 +if { (eval echo "$as_me:4886: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:4082: \$? = $ac_status" >&5 + echo "$as_me:4889: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:4085: \"$ac_try\"") >&5 + { (eval echo "$as_me:4892: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4088: \$? = $ac_status" >&5 + echo "$as_me:4895: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_mkstemp=yes else @@ -4095,7 +4902,7 @@ ac_cv_func_mkstemp=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:4098: result: $ac_cv_func_mkstemp" >&5 +echo "$as_me:4905: result: $ac_cv_func_mkstemp" >&5 echo "${ECHO_T}$ac_cv_func_mkstemp" >&6 fi @@ -4107,56 +4914,165 @@ EOF fi -for ac_func in vsnprintf +for ac_header in unistd.h getopt.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:4920: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 4926 "configure" +#include "confdefs.h" +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:4930: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:4936: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + eval "$as_ac_Header=no" +fi +rm -f conftest.err conftest.$ac_ext +fi +echo "$as_me:4955: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<EOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +EOF + +fi +done + +echo "$as_me:4965: checking for header declaring getopt variables" >&5 +echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6 +if test "${cf_cv_getopt_header+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +cf_cv_getopt_header=none +for cf_header in stdio.h stdlib.h unistd.h getopt.h +do +cat >conftest.$ac_ext <<_ACEOF +#line 4975 "configure" +#include "confdefs.h" + +#include <$cf_header> +int +main (void) +{ +int x = optind; char *y = optarg + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:4988: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:4991: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:4994: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4997: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_getopt_header=$cf_header + break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest.$ac_ext +done + +fi +echo "$as_me:5009: result: $cf_cv_getopt_header" >&5 +echo "${ECHO_T}$cf_cv_getopt_header" >&6 +if test $cf_cv_getopt_header != none ; then + +cat >>confdefs.h <<\EOF +#define HAVE_GETOPT_HEADER 1 +EOF + +fi +if test $cf_cv_getopt_header = getopt.h ; then + +cat >>confdefs.h <<\EOF +#define NEED_GETOPT_H 1 +EOF + +fi + +for ac_func in getopt vsnprintf do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:4113: checking for $ac_func" >&5 +echo "$as_me:5029: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 4119 "configure" +#line 5035 "configure" #include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. */ -#include <assert.h> -/* Override any gcc2 internal prototype to avoid an error. */ +#define $ac_func autoconf_temporary +#include <limits.h> /* least-intrusive standard header which defines gcc2 __stub macros */ +#undef $ac_func + #ifdef __cplusplus extern "C" #endif + /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ -char $ac_func (); -char (*f) (); +char $ac_func (void); int -main () +main (void) { -/* The GNU C library defines this for functions which it implements + +/* The GNU C library defines stubs for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1; +#error found stub for $ac_func #endif + return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:4150: \"$ac_link\"") >&5 +if { (eval echo "$as_me:5066: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:4153: \$? = $ac_status" >&5 + echo "$as_me:5069: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:4156: \"$ac_try\"") >&5 + { (eval echo "$as_me:5072: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4159: \$? = $ac_status" >&5 + echo "$as_me:5075: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else @@ -4166,7 +5082,7 @@ eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:4169: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "$as_me:5085: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<EOF @@ -4176,7 +5092,7 @@ EOF fi done -echo "$as_me:4179: checking for maximum table size" >&5 +echo "$as_me:5095: checking for maximum table size" >&5 echo $ECHO_N "checking for maximum table size... $ECHO_C" >&6 # Check whether --with-max-table-size or --without-max-table-size was given. @@ -4186,12 +5102,12 @@ if test "${with_max_table_size+set}" = set; then fi; if test -n "$with_max_table_size" then - echo "$as_me:4189: result: $with_max_table_size" >&5 + echo "$as_me:5105: result: $with_max_table_size" >&5 echo "${ECHO_T}$with_max_table_size" >&6 check=`expr "$with_max_table_size" + 0` if test "x$check" != "x$with_max_table_size" then - { { echo "$as_me:4194: error: invalid value for --with-max-table-size: $with_max_table_size" >&5 + { { echo "$as_me:5110: error: invalid value for --with-max-table-size: $with_max_table_size" >&5 echo "$as_me: error: invalid value for --with-max-table-size: $with_max_table_size" >&2;} { (exit 1); exit 1; }; } fi @@ -4201,11 +5117,11 @@ cat >>confdefs.h <<EOF EOF else - echo "$as_me:4204: result: default" >&5 + echo "$as_me:5120: result: default" >&5 echo "${ECHO_T}default" >&6 fi -echo "$as_me:4208: checking if backtracking extension is wanted" >&5 +echo "$as_me:5124: checking if backtracking extension is wanted" >&5 echo $ECHO_N "checking if backtracking extension is wanted... $ECHO_C" >&6 # Check whether --enable-btyacc or --disable-btyacc was given. @@ -4213,7 +5129,7 @@ if test "${enable_btyacc+set}" = set; then enableval="$enable_btyacc" fi; -echo "$as_me:4216: result: $enable_btyacc" >&5 +echo "$as_me:5132: result: $enable_btyacc" >&5 echo "${ECHO_T}$enable_btyacc" >&6 if test "$enable_btyacc" = "yes"; then @@ -4228,7 +5144,7 @@ fi if ( test "$GCC" = yes || test "$GXX" = yes ) then -echo "$as_me:4231: checking if you want to check for gcc warnings" >&5 +echo "$as_me:5147: checking if you want to check for gcc warnings" >&5 echo $ECHO_N "checking if you want to check for gcc warnings... $ECHO_C" >&6 # Check whether --with-warnings or --without-warnings was given. @@ -4238,7 +5154,7 @@ if test "${with_warnings+set}" = set; then else cf_opt_with_warnings=no fi; -echo "$as_me:4241: result: $cf_opt_with_warnings" >&5 +echo "$as_me:5157: result: $cf_opt_with_warnings" >&5 echo "${ECHO_T}$cf_opt_with_warnings" >&6 if test "$cf_opt_with_warnings" != no ; then @@ -4260,10 +5176,10 @@ cat > conftest.i <<EOF EOF if test "$GCC" = yes then - { echo "$as_me:4263: checking for $CC __attribute__ directives..." >&5 + { echo "$as_me:5179: checking for $CC __attribute__ directives..." >&5 echo "$as_me: checking for $CC __attribute__ directives..." >&6;} cat > conftest.$ac_ext <<EOF -#line 4266 "${as_me:-configure}" +#line 5182 "${as_me:-configure}" #include "confdefs.h" #include "conftest.h" #include "conftest.i" @@ -4280,7 +5196,7 @@ cat > conftest.$ac_ext <<EOF extern void wow(char *,...) GCC_SCANFLIKE(1,2); extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN; extern void foo(void) GCC_NORETURN; -int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; } +int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { (void)argc; (void)argv; return 0; } EOF cf_printf_attribute=no cf_scanf_attribute=no @@ -4312,12 +5228,12 @@ EOF ;; esac - if { (eval echo "$as_me:4315: \"$ac_compile\"") >&5 + if { (eval echo "$as_me:5231: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:4318: \$? = $ac_status" >&5 + echo "$as_me:5234: \$? = $ac_status" >&5 (exit $ac_status); }; then - test -n "$verbose" && echo "$as_me:4320: result: ... $cf_attribute" >&5 + test -n "$verbose" && echo "$as_me:5236: result: ... $cf_attribute" >&5 echo "${ECHO_T}... $cf_attribute" >&6 cat conftest.h >>confdefs.h case $cf_attribute in @@ -4376,113 +5292,11 @@ fi rm -rf conftest* fi -INTEL_COMPILER=no - -if test "$GCC" = yes ; then - case $host_os in - (linux*|gnu*) - echo "$as_me:4384: checking if this is really Intel C compiler" >&5 -echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6 - cf_save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -no-gcc" - cat >conftest.$ac_ext <<_ACEOF -#line 4389 "configure" -#include "confdefs.h" - -int -main () -{ - -#ifdef __INTEL_COMPILER -#else -make an error -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:4406: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:4409: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:4412: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:4415: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - INTEL_COMPILER=yes -cf_save_CFLAGS="$cf_save_CFLAGS -we147" - -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -fi -rm -f conftest.$ac_objext conftest.$ac_ext - CFLAGS="$cf_save_CFLAGS" - echo "$as_me:4426: result: $INTEL_COMPILER" >&5 -echo "${ECHO_T}$INTEL_COMPILER" >&6 - ;; - esac -fi - -CLANG_COMPILER=no - -if test "$GCC" = yes ; then - echo "$as_me:4435: checking if this is really Clang C compiler" >&5 -echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6 - cf_save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -Qunused-arguments" - cat >conftest.$ac_ext <<_ACEOF -#line 4440 "configure" -#include "confdefs.h" - -int -main () -{ - -#ifdef __clang__ -#else -make an error -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:4457: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:4460: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:4463: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:4466: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - CLANG_COMPILER=yes -cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments" - -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -fi -rm -f conftest.$ac_objext conftest.$ac_ext - CFLAGS="$cf_save_CFLAGS" - echo "$as_me:4477: result: $CLANG_COMPILER" >&5 -echo "${ECHO_T}$CLANG_COMPILER" >&6 -fi - +if test "x$have_x" = xyes; then echo "skipping X-const check"; fi cat > conftest.$ac_ext <<EOF -#line 4482 "${as_me:-configure}" +#line 5297 "${as_me:-configure}" int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; } EOF - if test "$INTEL_COMPILER" = yes then # The "-wdXXX" options suppress warnings: @@ -4496,7 +5310,7 @@ then # remark #981: operands are evaluated in unspecified order # warning #279: controlling expression is constant - { echo "$as_me:4499: checking for $CC warning options..." >&5 + { echo "$as_me:5313: checking for $CC warning options..." >&5 echo "$as_me: checking for $CC warning options..." >&6;} cf_save_CFLAGS="$CFLAGS" EXTRA_CFLAGS="-Wall" @@ -4512,21 +5326,20 @@ echo "$as_me: checking for $CC warning options..." >&6;} wd981 do CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt" - if { (eval echo "$as_me:4515: \"$ac_compile\"") >&5 + if { (eval echo "$as_me:5329: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:4518: \$? = $ac_status" >&5 + echo "$as_me:5332: \$? = $ac_status" >&5 (exit $ac_status); }; then - test -n "$verbose" && echo "$as_me:4520: result: ... -$cf_opt" >&5 + test -n "$verbose" && echo "$as_me:5334: result: ... -$cf_opt" >&5 echo "${ECHO_T}... -$cf_opt" >&6 EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt" fi done CFLAGS="$cf_save_CFLAGS" - -elif test "$GCC" = yes +elif test "$GCC" = yes && test "$GCC_VERSION" != "unknown" then - { echo "$as_me:4529: checking for $CC warning options..." >&5 + { echo "$as_me:5342: checking for $CC warning options..." >&5 echo "$as_me: checking for $CC warning options..." >&6;} cf_save_CFLAGS="$CFLAGS" EXTRA_CFLAGS= @@ -4547,26 +5360,23 @@ echo "$as_me: checking for $CC warning options..." >&6;} Wpointer-arith \ Wshadow \ Wstrict-prototypes \ - Wundef $cf_gcc_warnings $cf_warn_CONST Wwrite-strings + Wundef Wno-inline $cf_gcc_warnings $cf_warn_CONST Wwrite-strings do CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt" - if { (eval echo "$as_me:4553: \"$ac_compile\"") >&5 + if { (eval echo "$as_me:5366: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:4556: \$? = $ac_status" >&5 + echo "$as_me:5369: \$? = $ac_status" >&5 (exit $ac_status); }; then - test -n "$verbose" && echo "$as_me:4558: result: ... -$cf_opt" >&5 + test -n "$verbose" && echo "$as_me:5371: result: ... -$cf_opt" >&5 echo "${ECHO_T}... -$cf_opt" >&6 case $cf_opt in - (Wcast-qual) - CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES" - ;; (Winline) case $GCC_VERSION in ([34].*) test -n "$verbose" && echo " feature is broken in gcc $GCC_VERSION" 1>&6 -echo "${as_me:-configure}:4569: testing feature is broken in gcc $GCC_VERSION ..." 1>&5 +echo "${as_me:-configure}:5379: testing feature is broken in gcc $GCC_VERSION ..." 1>&5 continue;; esac @@ -4576,7 +5386,7 @@ echo "${as_me:-configure}:4569: testing feature is broken in gcc $GCC_VERSION .. ([12].*) test -n "$verbose" && echo " feature is broken in gcc $GCC_VERSION" 1>&6 -echo "${as_me:-configure}:4579: testing feature is broken in gcc $GCC_VERSION ..." 1>&5 +echo "${as_me:-configure}:5389: testing feature is broken in gcc $GCC_VERSION ..." 1>&5 continue;; esac @@ -4592,7 +5402,7 @@ rm -rf conftest* fi fi -echo "$as_me:4595: checking if you want to see long compiling messages" >&5 +echo "$as_me:5405: checking if you want to see long compiling messages" >&5 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6 # Check whether --enable-echo or --disable-echo was given. @@ -4626,10 +5436,10 @@ else ECHO_CC='' fi; -echo "$as_me:4629: result: $enableval" >&5 +echo "$as_me:5439: result: $enableval" >&5 echo "${ECHO_T}$enableval" >&6 -echo "$as_me:4632: checking if you want to use dmalloc for testing" >&5 +echo "$as_me:5442: checking if you want to use dmalloc for testing" >&5 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6 # Check whether --with-dmalloc or --without-dmalloc was given. @@ -4646,7 +5456,7 @@ EOF else with_dmalloc= fi; -echo "$as_me:4649: result: ${with_dmalloc:-no}" >&5 +echo "$as_me:5459: result: ${with_dmalloc:-no}" >&5 echo "${ECHO_T}${with_dmalloc:-no}" >&6 case .$with_cflags in @@ -4676,10 +5486,16 @@ case $cf_fix_cppflags in && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + 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" + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue fi ;; @@ -4698,17 +5514,25 @@ CPPFLAGS=`echo "$CPPFLAGS" | \ ;; esac - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + + test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " + cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" + ;; esac ;; (*) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" + + test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " + cf_new_cflags="${cf_new_cflags}$cf_add_cflags" + ;; esac ;; (yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` @@ -4721,17 +5545,23 @@ done if test -n "$cf_new_cflags" ; then - CFLAGS="$CFLAGS $cf_new_cflags" + test -n "$CFLAGS" && CFLAGS="$CFLAGS " + CFLAGS="${CFLAGS}$cf_new_cflags" + fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" + fi if test -n "$cf_new_extra_cppflags" ; then - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" + test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " + EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" + fi ;; @@ -4740,23 +5570,23 @@ fi esac if test "$with_dmalloc" = yes ; then - echo "$as_me:4743: checking for dmalloc.h" >&5 + echo "$as_me:5573: checking for dmalloc.h" >&5 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6 if test "${ac_cv_header_dmalloc_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 4749 "configure" +#line 5579 "configure" #include "confdefs.h" #include <dmalloc.h> _ACEOF -if { (eval echo "$as_me:4753: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:5583: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:4759: \$? = $ac_status" >&5 + echo "$as_me:5589: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -4775,11 +5605,11 @@ else fi rm -f conftest.err conftest.$ac_ext fi -echo "$as_me:4778: result: $ac_cv_header_dmalloc_h" >&5 +echo "$as_me:5608: result: $ac_cv_header_dmalloc_h" >&5 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6 if test $ac_cv_header_dmalloc_h = yes; then -echo "$as_me:4782: checking for dmalloc_debug in -ldmalloc" >&5 +echo "$as_me:5612: checking for dmalloc_debug in -ldmalloc" >&5 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -4787,7 +5617,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-ldmalloc $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 4790 "configure" +#line 5620 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -4798,7 +5628,7 @@ extern "C" builtin and then its argument prototype would still apply. */ char dmalloc_debug (); int -main () +main (void) { dmalloc_debug (); ; @@ -4806,16 +5636,16 @@ dmalloc_debug (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:4809: \"$ac_link\"") >&5 +if { (eval echo "$as_me:5639: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:4812: \$? = $ac_status" >&5 + echo "$as_me:5642: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:4815: \"$ac_try\"") >&5 + { (eval echo "$as_me:5645: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4818: \$? = $ac_status" >&5 + echo "$as_me:5648: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dmalloc_dmalloc_debug=yes else @@ -4826,7 +5656,7 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:4829: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5 +echo "$as_me:5659: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6 if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then cat >>confdefs.h <<EOF @@ -4841,7 +5671,7 @@ fi fi -echo "$as_me:4844: checking if you want to use dbmalloc for testing" >&5 +echo "$as_me:5674: checking if you want to use dbmalloc for testing" >&5 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6 # Check whether --with-dbmalloc or --without-dbmalloc was given. @@ -4858,7 +5688,7 @@ EOF else with_dbmalloc= fi; -echo "$as_me:4861: result: ${with_dbmalloc:-no}" >&5 +echo "$as_me:5691: result: ${with_dbmalloc:-no}" >&5 echo "${ECHO_T}${with_dbmalloc:-no}" >&6 case .$with_cflags in @@ -4888,10 +5718,16 @@ case $cf_fix_cppflags in && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + 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" + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue fi ;; @@ -4910,17 +5746,25 @@ CPPFLAGS=`echo "$CPPFLAGS" | \ ;; esac - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + + test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " + cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" + ;; esac ;; (*) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" + + test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " + cf_new_cflags="${cf_new_cflags}$cf_add_cflags" + ;; esac ;; (yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` @@ -4933,17 +5777,23 @@ done if test -n "$cf_new_cflags" ; then - CFLAGS="$CFLAGS $cf_new_cflags" + test -n "$CFLAGS" && CFLAGS="$CFLAGS " + CFLAGS="${CFLAGS}$cf_new_cflags" + fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" + fi if test -n "$cf_new_extra_cppflags" ; then - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" + test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " + EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" + fi ;; @@ -4952,23 +5802,23 @@ fi esac if test "$with_dbmalloc" = yes ; then - echo "$as_me:4955: checking for dbmalloc.h" >&5 + echo "$as_me:5805: checking for dbmalloc.h" >&5 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6 if test "${ac_cv_header_dbmalloc_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 4961 "configure" +#line 5811 "configure" #include "confdefs.h" #include <dbmalloc.h> _ACEOF -if { (eval echo "$as_me:4965: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:5815: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:4971: \$? = $ac_status" >&5 + echo "$as_me:5821: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -4987,11 +5837,11 @@ else fi rm -f conftest.err conftest.$ac_ext fi -echo "$as_me:4990: result: $ac_cv_header_dbmalloc_h" >&5 +echo "$as_me:5840: result: $ac_cv_header_dbmalloc_h" >&5 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6 if test $ac_cv_header_dbmalloc_h = yes; then -echo "$as_me:4994: checking for debug_malloc in -ldbmalloc" >&5 +echo "$as_me:5844: checking for debug_malloc in -ldbmalloc" >&5 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -4999,7 +5849,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-ldbmalloc $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 5002 "configure" +#line 5852 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -5010,7 +5860,7 @@ extern "C" builtin and then its argument prototype would still apply. */ char debug_malloc (); int -main () +main (void) { debug_malloc (); ; @@ -5018,16 +5868,16 @@ debug_malloc (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:5021: \"$ac_link\"") >&5 +if { (eval echo "$as_me:5871: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:5024: \$? = $ac_status" >&5 + echo "$as_me:5874: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:5027: \"$ac_try\"") >&5 + { (eval echo "$as_me:5877: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:5030: \$? = $ac_status" >&5 + echo "$as_me:5880: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dbmalloc_debug_malloc=yes else @@ -5038,7 +5888,7 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:5041: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5 +echo "$as_me:5891: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6 if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then cat >>confdefs.h <<EOF @@ -5053,7 +5903,7 @@ fi fi -echo "$as_me:5056: checking if you want to use valgrind for testing" >&5 +echo "$as_me:5906: checking if you want to use valgrind for testing" >&5 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6 # Check whether --with-valgrind or --without-valgrind was given. @@ -5070,7 +5920,7 @@ EOF else with_valgrind= fi; -echo "$as_me:5073: result: ${with_valgrind:-no}" >&5 +echo "$as_me:5923: result: ${with_valgrind:-no}" >&5 echo "${ECHO_T}${with_valgrind:-no}" >&6 case .$with_cflags in @@ -5100,10 +5950,16 @@ case $cf_fix_cppflags in && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + 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" + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" + continue fi ;; @@ -5122,17 +5978,25 @@ CPPFLAGS=`echo "$CPPFLAGS" | \ ;; esac - cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + + test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " + cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" + ;; esac ;; (*) - cf_new_cflags="$cf_new_cflags $cf_add_cflags" + + test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " + cf_new_cflags="${cf_new_cflags}$cf_add_cflags" + ;; esac ;; (yes) - cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " + cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` @@ -5145,17 +6009,23 @@ done if test -n "$cf_new_cflags" ; then - CFLAGS="$CFLAGS $cf_new_cflags" + test -n "$CFLAGS" && CFLAGS="$CFLAGS " + CFLAGS="${CFLAGS}$cf_new_cflags" + fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$CPPFLAGS $cf_new_cppflags" + test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " + CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" + fi if test -n "$cf_new_extra_cppflags" ; then - EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" + test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " + EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" + fi ;; @@ -5163,7 +6033,7 @@ fi ;; esac -echo "$as_me:5166: checking if you want to perform memory-leak testing" >&5 +echo "$as_me:6036: checking if you want to perform memory-leak testing" >&5 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6 # Check whether --enable-leaks or --disable-leaks was given. @@ -5173,7 +6043,7 @@ if test "${enable_leaks+set}" = set; then else : ${with_no_leaks:=no} fi; -echo "$as_me:5176: result: $with_no_leaks" >&5 +echo "$as_me:6046: result: $with_no_leaks" >&5 echo "${ECHO_T}$with_no_leaks" >&6 if test "$with_no_leaks" = yes ; then @@ -5190,7 +6060,7 @@ fi # Extract the first word of "groff", so it can be a program name with args. set dummy groff; ac_word=$2 -echo "$as_me:5193: checking for $ac_word" >&5 +echo "$as_me:6063: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_GROFF_PATH+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -5207,7 +6077,7 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if $as_executable_p "$ac_dir/$ac_word"; then ac_cv_path_GROFF_PATH="$ac_dir/$ac_word" - echo "$as_me:5210: found $ac_dir/$ac_word" >&5 + echo "$as_me:6080: found $ac_dir/$ac_word" >&5 break fi done @@ -5219,16 +6089,18 @@ fi GROFF_PATH=$ac_cv_path_GROFF_PATH if test -n "$GROFF_PATH"; then - echo "$as_me:5222: result: $GROFF_PATH" >&5 + echo "$as_me:6092: result: $GROFF_PATH" >&5 echo "${ECHO_T}$GROFF_PATH" >&6 else - echo "$as_me:5225: result: no" >&5 + echo "$as_me:6095: result: no" >&5 echo "${ECHO_T}no" >&6 fi -# Extract the first word of "nroff", so it can be a program name with args. -set dummy nroff; ac_word=$2 -echo "$as_me:5231: checking for $ac_word" >&5 +for ac_prog in nroff mandoc +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:6103: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_NROFF_PATH+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -5245,22 +6117,63 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if $as_executable_p "$ac_dir/$ac_word"; then ac_cv_path_NROFF_PATH="$ac_dir/$ac_word" - echo "$as_me:5248: found $ac_dir/$ac_word" >&5 + echo "$as_me:6120: found $ac_dir/$ac_word" >&5 break fi done - test -z "$ac_cv_path_NROFF_PATH" && ac_cv_path_NROFF_PATH="no" ;; esac fi NROFF_PATH=$ac_cv_path_NROFF_PATH if test -n "$NROFF_PATH"; then - echo "$as_me:5260: result: $NROFF_PATH" >&5 + echo "$as_me:6131: result: $NROFF_PATH" >&5 echo "${ECHO_T}$NROFF_PATH" >&6 else - echo "$as_me:5263: result: no" >&5 + echo "$as_me:6134: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$NROFF_PATH" && break +done +test -n "$NROFF_PATH" || NROFF_PATH="no" + +# Extract the first word of "tbl", so it can be a program name with args. +set dummy tbl; ac_word=$2 +echo "$as_me:6144: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_TBL_PATH+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $TBL_PATH in + [\\/]* | ?:[\\/]*) + ac_cv_path_TBL_PATH="$TBL_PATH" # Let the user override the test with a path. + ;; + *) + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + if $as_executable_p "$ac_dir/$ac_word"; then + ac_cv_path_TBL_PATH="$ac_dir/$ac_word" + echo "$as_me:6161: found $ac_dir/$ac_word" >&5 + break +fi +done + + test -z "$ac_cv_path_TBL_PATH" && ac_cv_path_TBL_PATH="cat" + ;; +esac +fi +TBL_PATH=$ac_cv_path_TBL_PATH + +if test -n "$TBL_PATH"; then + echo "$as_me:6173: result: $TBL_PATH" >&5 +echo "${ECHO_T}$TBL_PATH" >&6 +else + echo "$as_me:6176: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -5273,7 +6186,70 @@ else GROFF_NOTE= fi -echo "$as_me:5276: checking for program to convert manpage to html" >&5 +case "x${with_man2html}" in +(xno) + cf_man2html=no + ;; +(x|xyes) + # Extract the first word of "man2html", so it can be a program name with args. +set dummy man2html; ac_word=$2 +echo "$as_me:6196: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_cf_man2html+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $cf_man2html in + [\\/]* | ?:[\\/]*) + ac_cv_path_cf_man2html="$cf_man2html" # Let the user override the test with a path. + ;; + *) + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + if $as_executable_p "$ac_dir/$ac_word"; then + ac_cv_path_cf_man2html="$ac_dir/$ac_word" + echo "$as_me:6213: found $ac_dir/$ac_word" >&5 + break +fi +done + + test -z "$ac_cv_path_cf_man2html" && ac_cv_path_cf_man2html="no" + ;; +esac +fi +cf_man2html=$ac_cv_path_cf_man2html + +if test -n "$cf_man2html"; then + echo "$as_me:6225: result: $cf_man2html" >&5 +echo "${ECHO_T}$cf_man2html" >&6 +else + echo "$as_me:6228: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + case "x$cf_man2html" in + (x/*) + echo "$as_me:6234: checking for the modified Earl Hood script" >&5 +echo $ECHO_N "checking for the modified Earl Hood script... $ECHO_C" >&6 + if ( $cf_man2html -help 2>&1 | grep 'Make an index of headers at the end' >/dev/null ) + then + cf_man2html_ok=yes + else + cf_man2html=no + cf_man2html_ok=no + fi + echo "$as_me:6243: result: $cf_man2html_ok" >&5 +echo "${ECHO_T}$cf_man2html_ok" >&6 + ;; + (*) + cf_man2html=no + ;; + esac +esac + +echo "$as_me:6252: checking for program to convert manpage to html" >&5 echo $ECHO_N "checking for program to convert manpage to html... $ECHO_C" >&6 # Check whether --with-man2html or --without-man2html was given. @@ -5281,18 +6257,18 @@ if test "${with_man2html+set}" = set; then withval="$with_man2html" cf_man2html=$withval else - cf_man2html=$GROFF_PATH + cf_man2html=$cf_man2html fi; cf_with_groff=no case $cf_man2html in (yes) - echo "$as_me:5291: result: man2html" >&5 + echo "$as_me:6267: result: man2html" >&5 echo "${ECHO_T}man2html" >&6 # Extract the first word of "man2html", so it can be a program name with args. set dummy man2html; ac_word=$2 -echo "$as_me:5295: checking for $ac_word" >&5 +echo "$as_me:6271: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_cf_man2html+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -5309,7 +6285,7 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if $as_executable_p "$ac_dir/$ac_word"; then ac_cv_path_cf_man2html="$ac_dir/$ac_word" - echo "$as_me:5312: found $ac_dir/$ac_word" >&5 + echo "$as_me:6288: found $ac_dir/$ac_word" >&5 break fi done @@ -5321,10 +6297,10 @@ fi cf_man2html=$ac_cv_path_cf_man2html if test -n "$cf_man2html"; then - echo "$as_me:5324: result: $cf_man2html" >&5 + echo "$as_me:6300: result: $cf_man2html" >&5 echo "${ECHO_T}$cf_man2html" >&6 else - echo "$as_me:5327: result: no" >&5 + echo "$as_me:6303: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -5332,11 +6308,11 @@ fi (no|groff|*/groff*) cf_with_groff=yes cf_man2html=$GROFF_PATH - echo "$as_me:5335: result: $cf_man2html" >&5 + echo "$as_me:6311: result: $cf_man2html" >&5 echo "${ECHO_T}$cf_man2html" >&6 ;; (*) - echo "$as_me:5339: result: $cf_man2html" >&5 + echo "$as_me:6315: result: $cf_man2html" >&5 echo "${ECHO_T}$cf_man2html" >&6 ;; esac @@ -5370,7 +6346,7 @@ then MAN2HTML_NOTE="$GROFF_NOTE" MAN2HTML_PATH="$GROFF_PATH" cat >>$MAN2HTML_TEMP <<CF_EOF -$SHELL -c "tbl \${ROOT}.\${TYPE} | $GROFF_PATH -P -o0 -I\${ROOT}_ -Thtml -\${MACS}" +$SHELL -c "$TBL_PATH \${ROOT}.\${TYPE} | $GROFF_PATH -P -o0 -I\${ROOT}_ -Thtml -\${MACS}" CF_EOF else MAN2HTML_NOTE="" @@ -5400,14 +6376,14 @@ case ".$cf_man2html" in cf_man2html=`echo $cf_man2html | sed -e s%NONE%$cf_path_syntax%` ;; (*) - { { echo "$as_me:5403: error: expected a pathname, not \"$cf_man2html\"" >&5 + { { echo "$as_me:6379: error: expected a pathname, not \"$cf_man2html\"" >&5 echo "$as_me: error: expected a pathname, not \"$cf_man2html\"" >&2;} { (exit 1); exit 1; }; } ;; esac MAN2HTML_PATH="$cf_man2html" - echo "$as_me:5410: checking for $cf_man2html top/bottom margins" >&5 + echo "$as_me:6386: checking for $cf_man2html top/bottom margins" >&5 echo $ECHO_N "checking for $cf_man2html top/bottom margins... $ECHO_C" >&6 # for this example, expect 3 lines of content, the remainder is head/foot @@ -5417,7 +6393,7 @@ echo $ECHO_N "checking for $cf_man2html top/bottom margins... $ECHO_C" >&6 MARKER CF_EOF - LC_ALL=C LC_CTYPE=C LANG=C LANGUAGE=C nroff -man conftest.in >conftest.out + LC_ALL=C LC_CTYPE=C LANG=C LANGUAGE=C $NROFF_PATH -man 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` @@ -5425,10 +6401,10 @@ CF_EOF cf_man2html_bot=`expr $cf_man2html_bot - 2 - $cf_man2html_top` cf_man2html_top_bot="-topm=$cf_man2html_top -botm=$cf_man2html_bot" - echo "$as_me:5428: result: $cf_man2html_top_bot" >&5 + echo "$as_me:6404: result: $cf_man2html_top_bot" >&5 echo "${ECHO_T}$cf_man2html_top_bot" >&6 - echo "$as_me:5431: checking for pagesize to use" >&5 + echo "$as_me:6407: checking for pagesize to use" >&5 echo $ECHO_N "checking for pagesize to use... $ECHO_C" >&6 for cf_block in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 do @@ -5447,13 +6423,13 @@ echo $ECHO_N "checking for pagesize to use... $ECHO_C" >&6 CF_EOF done - LC_ALL=C LC_CTYPE=C LANG=C LANGUAGE=C nroff -man conftest.in >conftest.out - cf_man2html_page=`fgrep -n HEAD1 conftest.out |tail -n 1 |sed -e 's/^[^0-9]*://' -e 's/:.*//'` + LC_ALL=C LC_CTYPE=C LANG=C LANGUAGE=C $NROFF_PATH -man conftest.in >conftest.out + cf_man2html_page=`fgrep -n HEAD1 conftest.out |sed -n '$p' |sed -e 's/^[^0-9]*://' -e 's/:.*//'` test -z "$cf_man2html_page" && cf_man2html_page=99999 test "$cf_man2html_page" -gt 100 && cf_man2html_page=99999 rm -rf conftest* - echo "$as_me:5456: result: $cf_man2html_page" >&5 + echo "$as_me:6432: result: $cf_man2html_page" >&5 echo "${ECHO_T}$cf_man2html_page" >&6 cat >>$MAN2HTML_TEMP <<CF_EOF @@ -5461,10 +6437,10 @@ echo "${ECHO_T}$cf_man2html_page" >&6 MAN2HTML_OPTS="\$MAN2HTML_OPTS -index -title="\$ROOT\(\$TYPE\)" -compress -pgsize $cf_man2html_page" case \${TYPE} in (ms) - tbl \${ROOT}.\${TYPE} | nroff -\${MACS} | \$MAN2HTML_PATH -topm=0 -botm=0 \$MAN2HTML_OPTS + $TBL_PATH \${ROOT}.\${TYPE} | $NROFF_PATH -\${MACS} | \$MAN2HTML_PATH -topm=0 -botm=0 \$MAN2HTML_OPTS ;; (*) - tbl \${ROOT}.\${TYPE} | nroff -\${MACS} | \$MAN2HTML_PATH $cf_man2html_top_bot \$MAN2HTML_OPTS + $TBL_PATH \${ROOT}.\${TYPE} | $NROFF_PATH -\${MACS} | \$MAN2HTML_PATH $cf_man2html_top_bot \$MAN2HTML_OPTS ;; esac CF_EOF @@ -5472,13 +6448,13 @@ fi chmod 700 $MAN2HTML_TEMP -echo "$as_me:5475: checking for ANSI C header files" >&5 +echo "$as_me:6451: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 5481 "configure" +#line 6457 "configure" #include "confdefs.h" #include <stdlib.h> #include <stdarg.h> @@ -5486,13 +6462,13 @@ else #include <float.h> _ACEOF -if { (eval echo "$as_me:5489: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:6465: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:5495: \$? = $ac_status" >&5 + echo "$as_me:6471: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -5514,7 +6490,7 @@ rm -f conftest.err conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF -#line 5517 "configure" +#line 6493 "configure" #include "confdefs.h" #include <string.h> @@ -5532,7 +6508,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF -#line 5535 "configure" +#line 6511 "configure" #include "confdefs.h" #include <stdlib.h> @@ -5553,7 +6529,7 @@ if test $ac_cv_header_stdc = yes; then : else cat >conftest.$ac_ext <<_ACEOF -#line 5556 "configure" +#line 6532 "configure" #include "confdefs.h" #include <ctype.h> #if ((' ' & 0x0FF) == 0x020) @@ -5568,7 +6544,7 @@ else #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int -main () +main (void) { int i; for (i = 0; i < 256; i++) @@ -5579,15 +6555,15 @@ main () } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:5582: \"$ac_link\"") >&5 +if { (eval echo "$as_me:6558: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:5585: \$? = $ac_status" >&5 + echo "$as_me:6561: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:5587: \"$ac_try\"") >&5 + { (eval echo "$as_me:6563: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:5590: \$? = $ac_status" >&5 + echo "$as_me:6566: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else @@ -5600,7 +6576,7 @@ rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi -echo "$as_me:5603: result: $ac_cv_header_stdc" >&5 +echo "$as_me:6579: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then @@ -5616,28 +6592,28 @@ for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:5619: checking for $ac_header" >&5 +echo "$as_me:6595: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 5625 "configure" +#line 6601 "configure" #include "confdefs.h" $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:5631: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:6607: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:5634: \$? = $ac_status" >&5 + echo "$as_me:6610: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:5637: \"$ac_try\"") >&5 + { (eval echo "$as_me:6613: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:5640: \$? = $ac_status" >&5 + echo "$as_me:6616: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else @@ -5647,7 +6623,7 @@ eval "$as_ac_Header=no" fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:5650: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "$as_me:6626: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<EOF @@ -5657,17 +6633,17 @@ EOF fi done -echo "$as_me:5660: checking for mode_t" >&5 +echo "$as_me:6636: checking for mode_t" >&5 echo $ECHO_N "checking for mode_t... $ECHO_C" >&6 if test "${ac_cv_type_mode_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 5666 "configure" +#line 6642 "configure" #include "confdefs.h" $ac_includes_default int -main () +main (void) { if ((mode_t *) 0) return 0; @@ -5678,16 +6654,16 @@ if (sizeof (mode_t)) } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:5681: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:6657: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:5684: \$? = $ac_status" >&5 + echo "$as_me:6660: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:5687: \"$ac_try\"") >&5 + { (eval echo "$as_me:6663: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:5690: \$? = $ac_status" >&5 + echo "$as_me:6666: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_mode_t=yes else @@ -5697,7 +6673,7 @@ ac_cv_type_mode_t=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:5700: result: $ac_cv_type_mode_t" >&5 +echo "$as_me:6676: result: $ac_cv_type_mode_t" >&5 echo "${ECHO_T}$ac_cv_type_mode_t" >&6 if test $ac_cv_type_mode_t = yes; then : @@ -5790,7 +6766,7 @@ DEFS=-DHAVE_CONFIG_H : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ echo "$as_me:5793: creating $CONFIG_STATUS" >&5 +{ echo "$as_me:6769: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL @@ -5919,7 +6895,7 @@ EOF cat >>$CONFIG_STATUS <<EOF ac_cs_version="\\ config.status -configured by $0, generated by GNU Autoconf 2.52.20150926, +configured by $0, generated by GNU Autoconf 2.52.20200111, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 @@ -5963,7 +6939,7 @@ cat >>$CONFIG_STATUS <<\EOF echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header - { { echo "$as_me:5966: error: ambiguous option: $1 + { { echo "$as_me:6942: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} @@ -5982,7 +6958,7 @@ Try \`$0 --help' for more information." >&2;} ac_need_defaults=false;; # This is an error. - -*) { { echo "$as_me:5985: error: unrecognized option: $1 + -*) { { echo "$as_me:6961: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} @@ -6001,7 +6977,7 @@ cat >&5 << _ACEOF ## Running config.status. ## ## ----------------------- ## -This file was extended by $as_me 2.52.20150926, executed with +This file was extended by $as_me 2.52.20200111, executed with CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS @@ -6019,7 +6995,7 @@ do # Handling of arguments. "makefile" ) CONFIG_FILES="$CONFIG_FILES makefile" ;; "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h:config_h.in" ;; - *) { { echo "$as_me:6022: error: invalid argument: $ac_config_target" >&5 + *) { { echo "$as_me:6998: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac @@ -6082,6 +7058,7 @@ s,@datadir@,$datadir,;t t s,@sysconfdir@,$sysconfdir,;t t s,@sharedstatedir@,$sharedstatedir,;t t s,@localstatedir@,$localstatedir,;t t +s,@runstatedir@,$runstatedir,;t t s,@libdir@,$libdir,;t t s,@includedir@,$includedir,;t t s,@oldincludedir@,$oldincludedir,;t t @@ -6142,6 +7119,7 @@ s,@SHOW_CC@,$SHOW_CC,;t t s,@ECHO_CC@,$ECHO_CC,;t t s,@GROFF_PATH@,$GROFF_PATH,;t t s,@NROFF_PATH@,$NROFF_PATH,;t t +s,@TBL_PATH@,$TBL_PATH,;t t s,@GROFF_NOTE@,$GROFF_NOTE,;t t s,@NROFF_NOTE@,$NROFF_NOTE,;t t s,@cf_man2html@,$cf_man2html,;t t @@ -6280,7 +7258,7 @@ done; } esac if test x"$ac_file" != x-; then - { echo "$as_me:6283: creating $ac_file" >&5 + { echo "$as_me:7261: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi @@ -6298,7 +7276,7 @@ echo "$as_me: creating $ac_file" >&6;} -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:6301: error: cannot find input file: $f" >&5 + test -f "$f" || { { echo "$as_me:7279: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo $f;; @@ -6311,7 +7289,7 @@ echo "$as_me: error: cannot find input file: $f" >&2;} echo $srcdir/$f else # /dev/null tree - { { echo "$as_me:6314: error: cannot find input file: $f" >&5 + { { echo "$as_me:7292: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; @@ -6327,7 +7305,7 @@ cat >>$CONFIG_STATUS <<\EOF if test -n "$ac_seen"; then ac_used=`grep '@datarootdir@' $ac_item` if test -z "$ac_used"; then - { echo "$as_me:6330: WARNING: datarootdir was used implicitly but not set: + { echo "$as_me:7308: WARNING: datarootdir was used implicitly but not set: $ac_seen" >&5 echo "$as_me: WARNING: datarootdir was used implicitly but not set: $ac_seen" >&2;} @@ -6336,7 +7314,7 @@ $ac_seen" >&2;} fi ac_seen=`grep '${datarootdir}' $ac_item` if test -n "$ac_seen"; then - { echo "$as_me:6339: WARNING: datarootdir was used explicitly but not set: + { echo "$as_me:7317: WARNING: datarootdir was used explicitly but not set: $ac_seen" >&5 echo "$as_me: WARNING: datarootdir was used explicitly but not set: $ac_seen" >&2;} @@ -6373,7 +7351,7 @@ s,@INSTALL@,$ac_INSTALL,;t t ac_init=`egrep '[ ]*'$ac_name'[ ]*=' $ac_file` if test -z "$ac_init"; then ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'` - { echo "$as_me:6376: WARNING: Variable $ac_name is used but was not set: + { echo "$as_me:7354: WARNING: Variable $ac_name is used but was not set: $ac_seen" >&5 echo "$as_me: WARNING: Variable $ac_name is used but was not set: $ac_seen" >&2;} @@ -6384,7 +7362,7 @@ $ac_seen" >&2;} egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out if test -s $tmp/out; then ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out` - { echo "$as_me:6387: WARNING: Some variables may not be substituted: + { echo "$as_me:7365: WARNING: Some variables may not be substituted: $ac_seen" >&5 echo "$as_me: WARNING: Some variables may not be substituted: $ac_seen" >&2;} @@ -6433,7 +7411,7 @@ for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue * ) ac_file_in=$ac_file.in ;; esac - test x"$ac_file" != x- && { echo "$as_me:6436: creating $ac_file" >&5 + test x"$ac_file" != x- && { echo "$as_me:7414: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} # First look for the input files in the build tree, otherwise in the @@ -6444,7 +7422,7 @@ echo "$as_me: creating $ac_file" >&6;} -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:6447: error: cannot find input file: $f" >&5 + test -f "$f" || { { echo "$as_me:7425: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo $f;; @@ -6457,7 +7435,7 @@ echo "$as_me: error: cannot find input file: $f" >&2;} echo $srcdir/$f else # /dev/null tree - { { echo "$as_me:6460: error: cannot find input file: $f" >&5 + { { echo "$as_me:7438: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; @@ -6575,7 +7553,7 @@ cat >>$CONFIG_STATUS <<\EOF rm -f $tmp/in if test x"$ac_file" != x-; then if cmp -s $ac_file $tmp/config.h 2>/dev/null; then - { echo "$as_me:6578: $ac_file is unchanged" >&5 + { echo "$as_me:7556: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ diff --git a/configure.in b/configure.in index 6602180d317c..7a719ca1596c 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ dnl Process this file with 'autoconf' to produce a 'configure' script -dnl $Id: configure.in,v 1.21 2015/07/05 22:07:36 tom Exp $ -AC_PREREQ(2.52.20011201) -AC_REVISION($Revision: 1.21 $) +dnl $Id: configure.in,v 1.23 2020/03/10 22:53:47 tom Exp $ +AC_PREREQ(2.52.20200111) +AC_REVISION($Revision: 1.23 $) AC_INIT(main.c) AC_CONFIG_HEADER(config.h:config_h.in) @@ -15,10 +15,13 @@ CF_MAKE_TAGS CF_PROG_AWK CF_PROG_LINT +CF_WITHOUT_X + CF_XOPEN_SOURCE AC_CHECK_HEADERS(fcntl.h) CF_MKSTEMP -AC_HAVE_FUNCS(vsnprintf) +CF_GETOPT_HEADER +AC_HAVE_FUNCS(getopt vsnprintf) AC_MSG_CHECKING(for maximum table size) AC_ARG_WITH([max-table-size], @@ -1,4 +1,4 @@ -/* $Id: defs.h,v 1.57 2017/04/30 23:29:11 tom Exp $ */ +/* $Id: defs.h,v 1.65 2019/11/19 23:47:49 tom Exp $ */ #ifdef HAVE_CONFIG_H #include <config.h> @@ -101,39 +101,48 @@ /* keyword codes */ -#define TOKEN 0 -#define LEFT 1 -#define RIGHT 2 -#define NONASSOC 3 -#define MARK 4 -#define TEXT 5 -#define TYPE 6 -#define START 7 -#define UNION 8 -#define IDENT 9 -#define EXPECT 10 -#define EXPECT_RR 11 -#define PURE_PARSER 12 -#define PARSE_PARAM 13 -#define LEX_PARAM 14 -#define POSIX_YACC 15 -#define TOKEN_TABLE 16 -#define ERROR_VERBOSE 17 -#define XXXDEBUG 18 +typedef enum +{ + TOKEN = 0 + ,LEFT + ,RIGHT + ,NONASSOC + ,MARK + ,TEXT + ,TYPE + ,START + ,UNION + ,IDENT + ,EXPECT + ,EXPECT_RR + ,PURE_PARSER + ,PARSE_PARAM + ,LEX_PARAM + ,POSIX_YACC + ,TOKEN_TABLE + ,ERROR_VERBOSE + ,XXXDEBUG + ,XCODE #if defined(YYBTYACC) -#define LOCATIONS 19 -#define DESTRUCTOR 20 -#define INITIAL_ACTION 21 + ,LOCATIONS + ,DESTRUCTOR + ,INITIAL_ACTION #endif +} +KEY_CASES; /* symbol classes */ -#define UNKNOWN 0 -#define TERM 1 -#define NONTERM 2 -#define ACTION 3 -#define ARGUMENT 4 +typedef enum +{ + UNKNOWN = 0 + ,TERM + ,NONTERM + ,ACTION + ,ARGUMENT +} +SYM_CASES; /* the undefined value */ @@ -146,9 +155,10 @@ /* character macros */ -#define IS_IDENT(c) (isalnum(c) || (c) == '_' || (c) == '.' || (c) == '$') +#define IS_NAME1(c) (isalpha(UCH(c)) || (c) == '_' || (c) == '$') +#define IS_NAME2(c) (isalnum(UCH(c)) || (c) == '_' || (c) == '$') +#define IS_IDENT(c) (isalnum(UCH(c)) || (c) == '_' || (c) == '.' || (c) == '$') #define IS_OCTAL(c) ((c) >= '0' && (c) <= '7') -#define NUMERIC_VALUE(c) ((c) - '0') /* symbol macros */ @@ -272,6 +282,7 @@ struct param /* global variables */ +extern char dflag2; extern char dflag; extern char gflag; extern char iflag; @@ -411,6 +422,21 @@ extern param *parse_param; #endif #endif +#ifdef __GNUC__ +#define ATTRIBUTE_NORETURN __attribute__((noreturn)) +#elif defined(_MSC_VER) +#define ATTRIBUTE_NORETURN __declspec(noreturn) +#else +#define ATTRIBUTE_NORETURN +#endif + +#if defined(NDEBUG) && defined(_MSC_VER) +#define NODEFAULT __assume(0); +#else +#define NODEFAULT +#endif +#define NOTREACHED NODEFAULT + #ifndef GCC_UNUSED #if defined(__unused) #define GCC_UNUSED __unused @@ -438,20 +464,31 @@ struct ainfo extern void arg_number_disagree_warning(int a_lineno, char *a_name); extern void arg_type_disagree_warning(int a_lineno, int i, char *a_name); +ATTRIBUTE_NORETURN extern void at_error(int a_lineno, char *a_line, char *a_cptr) GCC_NORETURN; extern void at_warning(int a_lineno, int i); +ATTRIBUTE_NORETURN extern void bad_formals(void) GCC_NORETURN; extern void default_action_warning(char *s); extern void destructor_redeclared_warning(const struct ainfo *); +ATTRIBUTE_NORETURN extern void dollar_error(int a_lineno, char *a_line, char *a_cptr) GCC_NORETURN; extern void dollar_warning(int a_lineno, int i); +ATTRIBUTE_NORETURN extern void fatal(const char *msg) GCC_NORETURN; +ATTRIBUTE_NORETURN extern void illegal_character(char *c_cptr) GCC_NORETURN; +ATTRIBUTE_NORETURN extern void illegal_tag(int t_lineno, char *t_line, char *t_cptr) GCC_NORETURN; +ATTRIBUTE_NORETURN extern void missing_brace(void) GCC_NORETURN; +ATTRIBUTE_NORETURN extern void no_grammar(void) GCC_NORETURN; +ATTRIBUTE_NORETURN extern void no_space(void) GCC_NORETURN; +ATTRIBUTE_NORETURN extern void open_error(const char *filename) GCC_NORETURN; +ATTRIBUTE_NORETURN extern void over_unionized(char *u_cptr) GCC_NORETURN; extern void prec_redeclared(void); extern void reprec_warning(char *s); @@ -459,25 +496,43 @@ extern void restarted_warning(void); extern void retyped_warning(char *s); extern void revalued_warning(char *s); extern void start_requires_args(char *a_name); +ATTRIBUTE_NORETURN extern void syntax_error(int st_lineno, char *st_line, char *st_cptr) GCC_NORETURN; +ATTRIBUTE_NORETURN extern void terminal_lhs(int s_lineno) GCC_NORETURN; +ATTRIBUTE_NORETURN extern void terminal_start(char *s) GCC_NORETURN; +ATTRIBUTE_NORETURN extern void tokenized_start(char *s) GCC_NORETURN; +ATTRIBUTE_NORETURN extern void undefined_goal(char *s) GCC_NORETURN; extern void undefined_symbol_warning(char *s); +ATTRIBUTE_NORETURN extern void unexpected_EOF(void) GCC_NORETURN; -extern void unknown_arg_warning(int d_lineno, const char *dlr_opt, const char *d_arg, const char *d_line, const char *d_cptr); +extern void unknown_arg_warning(int d_lineno, const char *dlr_opt, + const char *d_arg, const char *d_line, + const char *d_cptr); +ATTRIBUTE_NORETURN extern void unknown_rhs(int i) GCC_NORETURN; extern void unsupported_flag_warning(const char *flag, const char *details); +ATTRIBUTE_NORETURN extern void unterminated_action(const struct ainfo *) GCC_NORETURN; +ATTRIBUTE_NORETURN extern void unterminated_comment(const struct ainfo *) GCC_NORETURN; +ATTRIBUTE_NORETURN extern void unterminated_string(const struct ainfo *) GCC_NORETURN; +ATTRIBUTE_NORETURN extern void unterminated_text(const struct ainfo *) GCC_NORETURN; +ATTRIBUTE_NORETURN extern void unterminated_union(const struct ainfo *) GCC_NORETURN; extern void untyped_arg_warning(int a_lineno, const char *dlr_opt, const char *a_name); +ATTRIBUTE_NORETURN extern void untyped_lhs(void) GCC_NORETURN; +ATTRIBUTE_NORETURN extern void untyped_rhs(int i, char *s) GCC_NORETURN; +ATTRIBUTE_NORETURN extern void used_reserved(char *s) GCC_NORETURN; +ATTRIBUTE_NORETURN extern void unterminated_arglist(const struct ainfo *) GCC_NORETURN; extern void wrong_number_args_warning(const char *which, const char *a_name); extern void wrong_type_for_arg_warning(int i, char *a_name); @@ -497,6 +552,7 @@ extern void show_shifts(void); /* main.c */ extern void *allocate(size_t n); +ATTRIBUTE_NORETURN extern void done(int k) GCC_NORETURN; /* mkpar.c */ @@ -512,6 +568,7 @@ struct mstring extern void msprintf(struct mstring *, const char *, ...) GCC_PRINTFLIKE(2,3); extern int mputchar(struct mstring *, int); extern struct mstring *msnew(void); +extern struct mstring *msrenew(char *); extern char *msdone(struct mstring *); extern int strnscmp(const char *, const char *); extern unsigned int strnshash(const char *); @@ -526,6 +583,24 @@ extern void output(void); /* reader.c */ extern void reader(void); +typedef enum +{ + CODE_HEADER = 0 + ,CODE_REQUIRES + ,CODE_PROVIDES + ,CODE_TOP + ,CODE_IMPORTS + ,CODE_MAX /* this must be last */ +} +CODE_CASES; +extern struct code_lines +{ + const char *name; + char *lines; + size_t num; +} +code_lines[CODE_MAX]; + /* skeleton.c (generated by skel2c) */ extern void write_section(FILE * fp, const char *const section[]); @@ -1,7 +1,7 @@ -/* $Id: main.c,v 1.60 2017/04/30 20:57:56 Julien.Ramseier Exp $ */ +/* $Id: main.c,v 1.69 2019/11/25 23:24:36 Tom.Shields Exp $ */ #include <signal.h> -#ifndef _WIN32 +#if !defined(_WIN32) || defined(__MINGW32__) #include <unistd.h> /* for _exit() */ #else #include <stdlib.h> /* for _exit() */ @@ -33,6 +33,7 @@ static MY_TMPFILES *my_tmpfiles; #endif /* USE_MKSTEMP */ char dflag; +char dflag2; char gflag; char iflag; char lflag; @@ -150,7 +151,7 @@ done(int k) if (rflag) DO_FREE(code_file_name); - if (dflag) + if (dflag && !dflag2) DO_FREE(defines_file_name); if (iflag) @@ -210,6 +211,7 @@ usage(void) ," -b file_prefix set filename prefix (default \"y.\")" ," -B create a backtracking parser" ," -d write definitions (" DEFINES_SUFFIX ")" + ," -H defines_file write definitions to defines_file" ," -i write interface (y.tab.i)" ," -g write a graphical description" ," -l suppress #line directives" @@ -230,7 +232,7 @@ usage(void) for (n = 0; n < sizeof(msg) / sizeof(msg[0]); ++n) fprintf(stderr, "%s\n", msg[n]); - exit(1); + exit(EXIT_FAILURE); } static void @@ -248,6 +250,7 @@ setflag(int ch) case 'd': dflag = 1; + dflag2 = 0; break; case 'g': @@ -308,6 +311,46 @@ static void getargs(int argc, char *argv[]) { int i; +#ifdef HAVE_GETOPT + int ch; + + if (argc > 0) + myname = argv[0]; + + while ((ch = getopt(argc, argv, "Bb:dgH:ilLo:Pp:rstVvy")) != -1) + { + switch (ch) + { + case 'b': + file_prefix = optarg; + break; + case 'H': + dflag = dflag2 = 1; + defines_file_name = optarg; + break; + case 'o': + output_file_name = optarg; + break; + case 'p': + symbol_prefix = optarg; + break; + default: + setflag(ch); + break; + } + } + if ((i = optind) < argc) + { + /* getopt handles "--" specially, while we handle "-" specially */ + if (!strcmp(argv[i], "-")) + { + if ((i + 1) < argc) + usage(); + input_file = stdin; + return; + } + } +#else char *s; int ch; @@ -340,6 +383,16 @@ getargs(int argc, char *argv[]) usage(); continue; + case 'H': + dflag = dflag2 = 1; + if (*++s) + defines_file_name = s; + else if (++i < argc) + defines_file_name = argv[i]; + else + usage(); + continue; + case 'o': if (*++s) output_file_name = s; @@ -378,7 +431,9 @@ getargs(int argc, char *argv[]) end_of_option:; } - no_more_options:; + no_more_options: + +#endif /* HAVE_GETOPT */ if (i + 1 != argc) usage(); input_file_name_len = strlen(argv[i]); @@ -476,7 +531,7 @@ create_file_names(void) else code_file_name = output_file_name; - if (dflag) + if (dflag && !dflag2) { CREATE_FILE_NAME(defines_file_name, defines_suffix); } @@ -578,7 +633,8 @@ open_tmpfile(const char *label) char *name; const char *mark; - if ((tmpdir = getenv("TMPDIR")) == 0 || access(tmpdir, W_OK) != 0) + if (((tmpdir = getenv("TMPDIR")) == 0 || access(tmpdir, W_OK) != 0) || + ((tmpdir = getenv("TEMP")) == 0 || access(tmpdir, W_OK) != 0)) { #ifdef P_tmpdir tmpdir = P_tmpdir; @@ -605,27 +661,28 @@ open_tmpfile(const char *label) sprintf(name, MY_FMT, tmpdir, (int)(mark - label), label); fd = mkstemp(name); - if (fd >= 0) + if (fd >= 0 + && (result = fdopen(fd, "w+")) != 0) { - result = fdopen(fd, "w+"); - if (result != 0) - { - MY_TMPFILES *item; + MY_TMPFILES *item; - if (my_tmpfiles == 0) - { - atexit(close_tmpfiles); - } + if (my_tmpfiles == 0) + { + atexit(close_tmpfiles); + } - item = NEW(MY_TMPFILES); - NO_SPACE(item); + item = NEW(MY_TMPFILES); + NO_SPACE(item); - item->name = name; - NO_SPACE(item->name); + item->name = name; + NO_SPACE(item->name); - item->next = my_tmpfiles; - my_tmpfiles = item; - } + item->next = my_tmpfiles; + my_tmpfiles = item; + } + else + { + FREE(name); } (void)umask(save_umask); } @@ -678,7 +735,7 @@ open_files(void) fprintf(graph_file, "\t*/\n"); } - if (dflag) + if (dflag || dflag2) { defines_file = fopen(defines_file_name, "w"); if (defines_file == 0) @@ -1,4 +1,4 @@ -/* $Id: mkpar.c,v 1.15 2016/06/07 00:22:12 tom Exp $ */ +/* $Id: mkpar.c,v 1.16 2019/11/04 01:23:02 tom Exp $ */ #include "defs.h" @@ -174,14 +174,16 @@ find_final_state(void) Value_t *to_state2; shifts *p; - p = shift_table[0]; - to_state2 = p->shift; - goal = ritem[1]; - for (i = p->nshifts - 1; i >= 0; --i) + if ((p = shift_table[0]) != 0) { - final_state = to_state2[i]; - if (accessing_symbol[final_state] == goal) - break; + to_state2 = p->shift; + goal = ritem[1]; + for (i = p->nshifts - 1; i >= 0; --i) + { + final_state = to_state2[i]; + if (accessing_symbol[final_state] == goal) + break; + } } } diff --git a/mstring.c b/mstring.c index 3bdb122973a4..1110a7b89f39 100644 --- a/mstring.c +++ b/mstring.c @@ -1,4 +1,4 @@ -/* $Id: mstring.c,v 1.7 2016/12/02 17:57:21 tom Exp $ */ +/* $Id: mstring.c,v 1.9 2019/11/19 23:54:53 tom Exp $ */ #include <stdlib.h> #include <stdio.h> @@ -12,13 +12,11 @@ #define HEAD 24 #define TAIL 8 -#if defined(YYBTYACC) - static char *buf_ptr; static size_t buf_len; void -msprintf(struct mstring *s, const char *fmt,...) +msprintf(struct mstring *s, const char *fmt, ...) { va_list args; size_t len; @@ -91,7 +89,6 @@ msprintf(struct mstring *s, const char *fmt,...) memcpy(s->ptr, buf_ptr, len); s->ptr += len; } -#endif int mputchar(struct mstring *s, int ch) @@ -136,6 +133,20 @@ msnew(void) return n; } +struct mstring * +msrenew(char *value) +{ + struct mstring *r = 0; + if (value != 0) + { + r = msnew(); + r->base = value; + r->end = value + strlen(value); + r->ptr = r->end; + } + return r; +} + char * msdone(struct mstring *s) { @@ -198,10 +209,8 @@ strnshash(const char *s) void mstring_leaks(void) { -#if defined(YYBTYACC) free(buf_ptr); buf_ptr = 0; buf_len = 0; -#endif } #endif @@ -1,4 +1,4 @@ -/* $Id: output.c,v 1.81 2017/04/30 23:23:32 tom Exp $ */ +/* $Id: output.c,v 1.92 2019/11/20 00:55:05 tom Exp $ */ #include "defs.h" @@ -186,6 +186,27 @@ output_prefix(FILE * fp) } static void +output_code_lines(FILE * fp, int cl) +{ + if (code_lines[cl].lines != NULL) + { + if (fp == code_file) + { + outline += (int)code_lines[cl].num; + outline += 3; + fprintf(fp, "\n"); + } + fprintf(fp, "/* %%code \"%s\" block start */\n", code_lines[cl].name); + fputs(code_lines[cl].lines, fp); + fprintf(fp, "/* %%code \"%s\" block end */\n", code_lines[cl].name); + if (fp == code_file) + { + write_code_lineno(fp); + } + } +} + +static void output_newline(void) { if (!rflag) @@ -1162,21 +1183,21 @@ is_C_identifier(char *name) if (c == '"') { c = *++s; - if (!isalpha(c) && c != '_' && c != '$') + if (!IS_NAME1(c)) return (0); while ((c = *++s) != '"') { - if (!isalnum(c) && c != '_' && c != '$') + if (!IS_NAME2(c)) return (0); } return (1); } - if (!isalpha(c) && c != '_' && c != '$') + if (!IS_NAME1(c)) return (0); while ((c = *++s) != 0) { - if (!isalnum(c) && c != '_' && c != '$') + if (!IS_NAME2(c)) return (0); } return (1); @@ -1206,6 +1227,11 @@ output_defines(FILE * fp) int c, i; char *s; + if (fp == defines_file) + { + output_code_lines(fp, CODE_REQUIRES); + } + for (i = 2; i < ntokens; ++i) { s = symbol_name[i]; @@ -1239,6 +1265,11 @@ output_defines(FILE * fp) if (fp != defines_file || iflag) fprintf(fp, "#define YYERRCODE %d\n", symbol_value[1]); + if (fp == defines_file) + { + output_code_lines(fp, CODE_PROVIDES); + } + if (token_table && rflag && fp != externs_file) { if (fp == code_file) @@ -1259,11 +1290,15 @@ output_defines(FILE * fp) while ((c = getc(union_file)) != EOF) putc_code(fp, c); } - fprintf(fp, "extern YYSTYPE %slval;\n", symbol_prefix); + if (!pure_parser) + fprintf(fp, "extern YYSTYPE %slval;\n", symbol_prefix); } #if defined(YYBTYACC) if (locations) + { output_ltype(fp); + fprintf(fp, "extern YYLTYPE %slloc;\n", symbol_prefix); + } #endif } } @@ -1274,9 +1309,9 @@ output_stored_text(FILE * fp) int c; FILE *in; - rewind(text_file); if (text_file == NULL) open_error("text_file"); + rewind(text_file); in = text_file; if ((c = getc(in)) == EOF) return; @@ -1288,6 +1323,15 @@ output_stored_text(FILE * fp) write_code_lineno(fp); } +static int +output_yydebug(FILE * fp) +{ + fprintf(fp, "#ifndef YYDEBUG\n"); + fprintf(fp, "#define YYDEBUG %d\n", tflag); + fprintf(fp, "#endif\n"); + return 3; +} + static void output_debug(void) { @@ -1298,16 +1342,11 @@ output_debug(void) ++outline; fprintf(code_file, "#define YYFINAL %d\n", final_state); - putl_code(code_file, "#ifndef YYDEBUG\n"); - ++outline; - fprintf(code_file, "#define YYDEBUG %d\n", tflag); - putl_code(code_file, "#endif\n"); + outline += output_yydebug(code_file); if (rflag) { - fprintf(output_file, "#ifndef YYDEBUG\n"); - fprintf(output_file, "#define YYDEBUG %d\n", tflag); - fprintf(output_file, "#endif\n"); + output_yydebug(output_file); } maxtok = 0; @@ -1793,6 +1832,23 @@ output_lex_decl(FILE * fp) putl_code(fp, "# define YYLEX yylex()\n"); } putl_code(fp, "#endif\n"); + + /* + * Provide a prototype for yylex for the simplest case. This is done for + * better compatibility with older yacc's, but can be a problem if someone + * uses "static int yylex(void);" + */ + if (!pure_parser +#if defined(YYBTYACC) + && !backtrack +#endif + && !strcmp(symbol_prefix, "yy")) + { + putl_code(fp, "\n"); + putl_code(fp, "#if !(defined(yylex) || defined(YYSTATE))\n"); + putl_code(fp, "int YYLEX_DECL();\n"); + putl_code(fp, "#endif\n"); + } } static void @@ -1980,6 +2036,7 @@ output(void) free_shifts(); free_reductions(); + output_code_lines(code_file, CODE_TOP); #if defined(YYBTYACC) output_backtracking_parser(output_file); if (rflag) @@ -2021,13 +2078,11 @@ output(void) if (iflag) { + fprintf(externs_file, "\n"); + output_yydebug(externs_file); output_externs(externs_file, global_vars); if (!pure_parser) output_externs(externs_file, impure_vars); - } - - if (iflag) - { if (dflag) { ++outline; @@ -2057,22 +2112,30 @@ output(void) output_actions(); free_parser(); output_debug(); + if (rflag) { write_section(code_file, xdecls); output_YYINT_typedef(code_file); write_section(code_file, tables); } + write_section(code_file, global_vars); if (!pure_parser) { write_section(code_file, impure_vars); } + output_code_lines(code_file, CODE_REQUIRES); + write_section(code_file, hdr_defs); if (!pure_parser) { write_section(code_file, hdr_vars); } + + output_code_lines(code_file, CODE_PROVIDES); + output_code_lines(code_file, CODE_HEADER); + output_trailing_text(); #if defined(YYBTYACC) if (destructor) diff --git a/package/byacc.spec b/package/byacc.spec index e8355d81487a..64fea872c68b 100644 --- a/package/byacc.spec +++ b/package/byacc.spec @@ -1,8 +1,9 @@ Summary: byacc - public domain Berkeley LALR Yacc parser generator %define AppProgram byacc -%define AppVersion 20170430 +%define AltProgram btyacc +%define AppVersion 20200330 %define UseProgram yacc -# $XTermId: byacc.spec,v 1.34 2017/04/30 20:55:15 tom Exp $ +# $Id: byacc.spec,v 1.49 2020/03/30 23:31:42 tom Exp $ Name: %{AppProgram} Version: %{AppVersion} Release: 1 @@ -10,7 +11,7 @@ License: Public Domain, MIT Group: Applications/Development URL: ftp://invisible-island.net/%{AppProgram} Source0: %{AppProgram}-%{AppVersion}.tgz -Packager: Thomas Dickey <dickey@invisible-island.net> +Packager: Thomas E. Dickey <dickey@invisible-island.net> %description This package provides a parser generator utility that reads a grammar @@ -19,30 +20,69 @@ 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. +%package -n btyacc +Summary: Curses library with POSIX thread support. + +%description -n btyacc +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. + +This package has the backtracking extension. + %prep +%define debug_package %{nil} + %setup -q -n %{AppProgram}-%{AppVersion} %build +%define my_srcdir .. +%define CFG_OPTS \\\ + --verbose \\\ + --disable-echo \\\ + --target %{_target_platform} \\\ + --prefix=%{_prefix} \\\ + --srcdir=%{my_srcdir} \\\ + --bindir=%{_bindir} \\\ + --libdir=%{_libdir} \\\ + --mandir=%{_mandir} + +%global _configure ../configure -INSTALL_PROGRAM='${INSTALL}' \ - ./configure \ - --program-prefix=b \ - --target %{_target_platform} \ - --prefix=%{_prefix} \ - --bindir=%{_bindir} \ - --libdir=%{_libdir} \ - --mandir=%{_mandir} +mkdir BUILD-byacc +pushd BUILD-byacc +CONFIGURE_TOP=%{my_srcdir} \ +%configure %{CFG_OPTS} \ + --program-prefix=b \ + --program-transform-name='s,\^,b,' +make +popd +mkdir BUILD-btyacc +pushd BUILD-btyacc +CONFIGURE_TOP=%{my_srcdir} \ +%configure %{CFG_OPTS} \ + --enable-btyacc \ + --program-prefix=bt \ + --with-max-table-size=18000 \ + --program-transform-name='s,\^,bt,' make +popd %install [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT -make install DESTDIR=$RPM_BUILD_ROOT -( cd $RPM_BUILD_ROOT%{_bindir} && ln -s %{AppProgram} %{UseProgram} ) +pushd BUILD-byacc +make install DESTDIR=$RPM_BUILD_ROOT +( cd $RPM_BUILD_ROOT%{_bindir} && ln -vs %{AppProgram} %{UseProgram} ) +popd -strip $RPM_BUILD_ROOT%{_bindir}/%{AppProgram} +pushd BUILD-btyacc +make install DESTDIR=$RPM_BUILD_ROOT +popd %clean [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT @@ -53,8 +93,19 @@ strip $RPM_BUILD_ROOT%{_bindir}/%{AppProgram} %{_prefix}/bin/%{UseProgram} %{_mandir}/man1/%{AppProgram}.* +%files -n btyacc +%defattr(-,root,root) +%{_prefix}/bin/%{AltProgram} +%{_mandir}/man1/%{AltProgram}.* + %changelog # each patch should add its ChangeLog entries here +* Fri May 25 2018 Thomas Dickey +- add btyacc package + +* Sun Jul 09 2017 Thomas Dickey +- use predefined "configure" + * Sun Jun 06 2010 Thomas Dickey - initial version diff --git a/package/debian/changelog b/package/debian/changelog index 6ee5c0e90dd7..6342bcfe79f5 100644 --- a/package/debian/changelog +++ b/package/debian/changelog @@ -1,3 +1,75 @@ +byacc (20200330) unstable; urgency=low + + * maintenance updates + + -- Thomas E. Dickey <dickey@invisible-island.net> Mon, 30 Mar 2020 19:31:42 -0400 + +byacc (20191125) unstable; urgency=low + + * maintenance updates + + -- Thomas E. Dickey <dickey@invisible-island.net> Mon, 25 Nov 2019 18:13:14 -0500 + +byacc (20191119) unstable; urgency=low + + * maintenance updates + + -- Thomas E. Dickey <dickey@invisible-island.net> Tue, 19 Nov 2019 20:40:56 -0500 + +byacc (20191103) unstable; urgency=low + + * maintenance updates + + -- Thomas E. Dickey <dickey@invisible-island.net> Sun, 03 Nov 2019 16:42:41 -0500 + +byacc (20190617) unstable; urgency=low + + * maintenance updates + + -- Thomas E. Dickey <dickey@invisible-island.net> Sun, 16 Jun 2019 15:51:03 -0400 + +byacc (20190616) unstable; urgency=low + + * maintenance updates + + -- Thomas E. Dickey <dickey@invisible-island.net> Sun, 16 Jun 2019 08:55:03 -0400 + +byacc (20180609) unstable; urgency=low + + * maintenance updates + + -- Thomas E. Dickey <dickey@invisible-island.net> Sat, 09 Jun 2018 20:42:16 -0400 + +byacc (20180525) unstable; urgency=low + + * maintenance updates + + -- Thomas E. Dickey <dickey@invisible-island.net> Mon, 21 May 2018 18:50:44 -0400 + +byacc (20180510) unstable; urgency=low + + * maintenance updates + + -- Thomas E. Dickey <dickey@invisible-island.net> Thu, 10 May 2018 04:59:09 -0400 + +byacc (20180509) unstable; urgency=low + + * maintenance updates + + -- Thomas E. Dickey <dickey@invisible-island.net> Wed, 09 May 2018 21:13:51 -0400 + +byacc (20180508) unstable; urgency=low + + * maintenance updates + + -- Thomas E. Dickey <dickey@invisible-island.net> Tue, 08 May 2018 16:24:39 -0400 + +byacc (20170709) unstable; urgency=low + + * maintenance updates + + -- Thomas E. Dickey <dickey@invisible-island.net> Sun, 09 Jul 2017 13:49:13 -0400 + byacc (20170430) unstable; urgency=low * maintenance updates diff --git a/package/debian/control b/package/debian/control index 720aadab6fe9..fccd90738fa4 100644 --- a/package/debian/control +++ b/package/debian/control @@ -1,7 +1,7 @@ Source: byacc -Maintainer: Dave Beckett <dajobe@debian.org> +Maintainer: Thomas E. Dickey <dickey@invisible-island.net> Section: devel -Priority: extra +Priority: optional Standards-Version: 3.8.4 Build-Depends: debhelper (>= 5) Homepage: http://invisible-island.net/byacc/ @@ -15,3 +15,15 @@ Description: public domain Berkeley LALR Yacc parser generator 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. + +Package: btyacc +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: public domain Berkeley LALR Yacc parser generator + 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. + . + This package has the backtracking extension. diff --git a/package/debian/copyright b/package/debian/copyright index 91cbe855ef88..d2e49e9efdec 100644 --- a/package/debian/copyright +++ b/package/debian/copyright @@ -36,7 +36,7 @@ skeleton.c with the bug report. Do not expect rapid responses. Files: aclocal.m4 Licence: other-BSD -Copyright: 2004-2016,2017 by Thomas E. Dickey +Copyright: 2004-2019,2020 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 diff --git a/package/debian/rules b/package/debian/rules index f9424ac909fa..3db7e86c6135 100755 --- a/package/debian/rules +++ b/package/debian/rules @@ -1,8 +1,6 @@ #!/usr/bin/make -f -# MAde with the aid of dh_make, by Craig Small -# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess. -# Some lines taken from debmake, by Cristoph Lameter. - +# $Id: rules,v 1.3 2018/05/25 20:03:37 tom Exp $ +# # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 @@ -11,7 +9,11 @@ DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) -CFLAGS = +PACKAGES.arch = byacc btyacc + +CPPFLAGS := $(shell dpkg-buildflags --get CPPFLAGS) +CFLAGS := $(shell dpkg-buildflags --get CFLAGS) +LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS) ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) CFLAGS += -O0 @@ -22,12 +24,19 @@ ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) INSTALL_PROGRAM += -s endif +BYACC_DIR = $(CURDIR)/debian/byacc +BTYACC_DIR = $(CURDIR)/debian/btyacc -configure: configure-stamp -configure-stamp: - dh_testdir +BYACC_TMP = t/byacc +BTYACC_TMP = t/btyacc + +verbose = # -v - CFLAGS="$(CFLAGS)" ./configure \ +configure = \ + CPPFLAGS="$(CPPFLAGS)" \ + CFLAGS="$(CFLAGS)" \ + LDFLAGS="$(LDFLAGS)" \ + ../../configure \ --host=$(DEB_HOST_GNU_TYPE) \ --build=$(DEB_BUILD_GNU_TYPE) \ --prefix=/usr \ @@ -35,59 +44,96 @@ configure-stamp: --sysconfdir=/etc \ --program-transform-name='s,^,b,' - touch configure-stamp +all: build -build: build-stamp -build-stamp: configure-stamp +config: config-arch +build: build-arch +install: install-arch +binary: binary-arch + +config-arch: $(PACKAGES.arch:%=config-%-stamp) +build-arch: $(PACKAGES.arch:%=build-%-stamp) +install-arch: $(PACKAGES.arch:%=install-%-stamp) + +config-byacc-stamp: dh_testdir - $(MAKE) + rm -rf $(BYACC_TMP) + mkdir -p $(BYACC_TMP) + cd $(BYACC_TMP); $(configure) - touch build-stamp + touch $@ -clean: +config-btyacc-stamp: dh_testdir - dh_testroot - [ ! -f Makefile ] || $(MAKE) clean + rm -rf $(BTYACC_TMP) + mkdir -p $(BTYACC_TMP) + cd $(BTYACC_TMP); $(configure) \ + --enable-btyacc \ + --with-max-table-size=18000 \ + --program-transform-name='s,^,bt,' + + touch $@ + +build-byacc-stamp: config-byacc-stamp + dh_testdir - rm -f configure-stamp build-stamp install-stamp \ - config.cache config.h config.status config.log makefile + cd $(BYACC_TMP); $(MAKE) + + touch $@ + +build-btyacc-stamp: config-btyacc-stamp + dh_testdir - rm -f *.o yacc + cd $(BTYACC_TMP); $(MAKE) - dh_clean + touch $@ -install: install-stamp -install-stamp: build-stamp +install-byacc-stamp: build-byacc-stamp dh_testdir dh_testroot - dh_clean -k dh_installdirs - $(MAKE) install DESTDIR=$(CURDIR)/debian/byacc + cd $(BYACC_TMP); $(MAKE) install DESTDIR=$(BYACC_DIR) - touch install-stamp + touch $@ -# Build architecture-independent files here. -binary-indep: build install -# No binary-indep target. +install-btyacc-stamp: build-btyacc-stamp + dh_testdir + dh_testroot + dh_installdirs + + cd $(BTYACC_TMP); $(MAKE) install DESTDIR=$(BTYACC_DIR) + + touch $@ + +clean: + dh_testdir + dh_testroot + + dh_clean $(verbose) + + rm -rf t # Build architecture-dependent files here. binary-arch: build install +ifneq ($(PACKAGES.arch),) + rm -f $(PACKAGES.arch:%=install-%-stamp) dh_testdir dh_testroot - dh_installdocs - dh_installexamples - dh_installchangelogs CHANGES - dh_strip - dh_compress - dh_fixperms - dh_installdeb - dh_shlibdeps - dh_gencontrol - dh_md5sums - dh_builddeb - -binary: binary-indep binary-arch -.PHONY: build clean binary-indep binary-arch binary install install-stamp + dh_lintian $(verbose) $(PACKAGES.arch:%=-p%) + dh_installdocs $(verbose) $(PACKAGES.arch:%=-p%) + dh_installexamples $(verbose) $(PACKAGES.arch:%=-p%) + dh_installchangelogs $(verbose) $(PACKAGES.arch:%=-p%) CHANGES + dh_strip $(verbose) $(PACKAGES.arch:%=-p%) + dh_compress $(verbose) $(PACKAGES.arch:%=-p%) + dh_fixperms $(verbose) $(PACKAGES.arch:%=-p%) + dh_installdeb $(verbose) $(PACKAGES.arch:%=-p%) + dh_shlibdeps $(verbose) $(PACKAGES.arch:%=-p%) + dh_gencontrol $(verbose) $(PACKAGES.arch:%=-p%) + dh_md5sums $(verbose) $(PACKAGES.arch:%=-p%) + dh_builddeb $(verbose) $(PACKAGES.arch:%=-p%) +endif + +.PHONY: build clean config config-arch binary binary-arch install install-arch diff --git a/package/debian/watch b/package/debian/watch index de083b06a198..2cc2e1536cee 100644 --- a/package/debian/watch +++ b/package/debian/watch @@ -1,4 +1,4 @@ version=3 -opts=passive ftp://invisible-island.net/byacc/byacc-(\d+)\.tgz \ +opts=passive ftp://ftp.invisible-island.net/byacc/byacc-(\d+)\.tgz \ debian uupdate diff --git a/package/mingw-byacc.spec b/package/mingw-byacc.spec index 2c6de287d054..ad107d5e488e 100644 --- a/package/mingw-byacc.spec +++ b/package/mingw-byacc.spec @@ -1,8 +1,8 @@ Summary: byacc - public domain Berkeley LALR Yacc parser generator %define AppProgram byacc -%define AppVersion 20170430 +%define AppVersion 20200330 %define UseProgram yacc -# $XTermId: mingw-byacc.spec,v 1.16 2017/04/30 20:55:15 tom Exp $ +# $Id: mingw-byacc.spec,v 1.29 2020/03/30 23:31:42 tom Exp $ Name: %{AppProgram} Version: %{AppVersion} Release: 1 @@ -21,12 +21,12 @@ license which includes the generated C. %prep +%define debug_package %{nil} + %setup -q -n %{AppProgram}-%{AppVersion} %build - -INSTALL_PROGRAM='${INSTALL}' \ - ./configure \ +%configure --verbose \ --program-prefix=b \ --target %{_target_platform} \ --prefix=%{_prefix} \ @@ -56,5 +56,8 @@ strip $RPM_BUILD_ROOT%{_bindir}/%{AppProgram} %changelog # each patch should add its ChangeLog entries here +* Sun Jul 09 2017 Thomas Dickey +- use predefined "configure" + * Wed Sep 25 2013 Thomas Dickey - cloned from byacc.spec diff --git a/package/pkgsrc/Makefile b/package/pkgsrc/Makefile index 2a47c9ce00a2..90936e691398 100644 --- a/package/pkgsrc/Makefile +++ b/package/pkgsrc/Makefile @@ -1,10 +1,10 @@ # $NetBSD: Makefile,v 1.9 2008/07/24 17:13:00 tonnerre Exp $ # -DISTNAME= byacc-20170430 +DISTNAME= byacc-20200330 PKGREVISION= 1 CATEGORIES= devel -MASTER_SITES= ftp://invisible-island.net/byacc/ +MASTER_SITES= ftp://ftp.invisible-island.net/byacc/ EXTRACT_SUFX= .tgz MAINTAINER= pkgsrc-users@NetBSD.org @@ -1,11 +1,11 @@ -/* $Id: reader.c,v 1.68 2017/02/02 01:05:36 tom Exp $ */ +/* $Id: reader.c,v 1.79 2020/03/30 23:54:13 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. */ +/* will be expanded to accommodate it. */ #define LINESIZE 100 @@ -62,6 +62,13 @@ char line_format[] = "#line %d \"%s\"\n"; param *lex_param; param *parse_param; +static const char *code_keys[] = +{ + "", "requires", "provides", "top", "imports", +}; + +struct code_lines code_lines[CODE_MAX]; + #if defined(YYBTYACC) int destructor = 0; /* =1 if at least one %destructor */ @@ -144,7 +151,7 @@ line_directive(void) switch (ld) { case ldSPC1: - if (isspace(ch)) + if (isspace(UCH(ch))) { break; } @@ -153,7 +160,7 @@ line_directive(void) ld = ldSPC2; break; case ldSPC2: - if (isspace(ch)) + if (isspace(UCH(ch))) { break; } @@ -171,26 +178,26 @@ line_directive(void) ld = ldSPC3; break; case ldSPC3: - if (isspace(ch)) + if (isspace(UCH(ch))) { break; } else - UNLESS(!isdigit(ch)); + UNLESS(!isdigit(UCH(ch))); line_1st = n; ld = ldNUM; /* FALLTHRU */ case ldNUM: - if (isdigit(ch)) + if (isdigit(UCH(ch))) { break; } else - UNLESS(!isspace(ch)); + UNLESS(!isspace(UCH(ch))); ld = ldSPC4; break; case ldSPC4: - if (isspace(ch)) + if (isspace(UCH(ch))) { break; } @@ -217,19 +224,33 @@ line_directive(void) if (ld == ldOK) { size_t need = (size_t) (name_end - name_1st); - if (need > input_file_name_len) + if ((long)need > (long)input_file_name_len) { - input_file_name_len = need; - input_file_name = TREALLOC(char, input_file_name, need + 1); + input_file_name_len = ((need + 1) * 3) / 2; + input_file_name = TREALLOC(char, input_file_name, input_file_name_len); NO_SPACE(input_file_name); } - memcpy(input_file_name, line + name_1st + 1, need - 1); - input_file_name[need - 1] = '\0'; + if ((long)need > 0) + { + memcpy(input_file_name, line + name_1st + 1, need - 1); + input_file_name[need - 1] = '\0'; + } + else + { + input_file_name[0] = '\0'; + } } if (ld >= ldNUM && ld < ldERR) { - lineno = (int)strtol(line + line_1st, NULL, 10) - 1; + if (line_1st >= 0) + { + lineno = (int)strtol(line + line_1st, NULL, 10) - 1; + } + else + { + lineno = 0; + } } return (ld == ldOK); @@ -423,11 +444,12 @@ nextc(void) /* *INDENT-OFF* */ static struct keyword { - char name[14]; + char name[16]; int token; } keywords[] = { { "binary", NONASSOC }, + { "code", XCODE }, { "debug", XXXDEBUG }, #if defined(YYBTYACC) { "destructor", DESTRUCTOR }, @@ -435,7 +457,7 @@ keywords[] = { { "error-verbose",ERROR_VERBOSE }, { "expect", EXPECT }, { "expect-rr", EXPECT_RR }, - { "ident", IDENT }, + { "ident", IDENT }, #if defined(YYBTYACC) { "initial-action", INITIAL_ACTION }, #endif @@ -447,11 +469,11 @@ keywords[] = { { "nonassoc", NONASSOC }, { "parse-param", PARSE_PARAM }, { "pure-parser", PURE_PARSER }, - { "right", RIGHT }, + { "right", RIGHT }, { "start", START }, { "term", TOKEN }, { "token", TOKEN }, - { "token-table", TOKEN_TABLE }, + { "token-table", TOKEN_TABLE }, { "type", TYPE }, { "union", UNION }, { "yacc", POSIX_YACC }, @@ -474,18 +496,18 @@ keyword(void) struct keyword *key; c = *++cptr; - if (isalpha(c)) + if (isalpha(UCH(c))) { cinc = 0; for (;;) { - if (isalpha(c)) + if (isalpha(UCH(c))) { - if (isupper(c)) + if (isupper(UCH(c))) c = tolower(c); cachec(c); } - else if (isdigit(c) + else if (isdigit(UCH(c)) || c == '-' || c == '.' || c == '$') @@ -646,6 +668,127 @@ copy_comment(void) return msdone(temp); } +static int +check_key(int pos) +{ + const char *key = code_keys[pos]; + while (*cptr && *key) + if (*key++ != *cptr++) + return 0; + if (*key || (!isspace(UCH(*cptr)) && *cptr != L_CURL)) + return 0; + cptr--; + return 1; +} + +static void +copy_code(void) +{ + int c; + int curl; + int cline; + int on_line = 0; + int pos = CODE_HEADER; + struct mstring *code_mstr; + + /* read %code <keyword> { */ + for (;;) + { + c = *++cptr; + if (c == EOF) + unexpected_EOF(); + if (isspace(UCH(c))) + continue; + + if (c == L_CURL) + break; + + if (pos == CODE_HEADER) + { + switch (UCH(c)) + { + case 'r': + pos = CODE_REQUIRES; + break; + case 'p': + pos = CODE_PROVIDES; + break; + case 't': + pos = CODE_TOP; + break; + case 'i': + pos = CODE_IMPORTS; + break; + default: + break; + } + + if (pos == -1 || !check_key(pos)) + { + syntax_error(lineno, line, cptr); + return; + } + } + } + + cptr++; /* skip initial curl */ + while (*cptr && isspace(UCH(*cptr))) /* skip space */ + cptr++; + curl = 1; /* nesting count */ + + /* gather text */ + code_lines[pos].name = code_keys[pos]; + if ((cline = (int)code_lines[pos].num) != 0) + { + code_mstr = msrenew(code_lines[pos].lines); + } + else + { + code_mstr = msnew(); + } + cline++; + msprintf(code_mstr, line_format, lineno, input_file_name); + for (;;) + { + c = *cptr++; + switch (c) + { + case '\0': + get_line(); + if (line == NULL) + { + unexpected_EOF(); + return; + } + continue; + case '\n': + cline++; + on_line = 0; + break; + case L_CURL: + curl++; + break; + case R_CURL: + if (--curl == 0) + { + if (on_line > 1) + { + mputc(code_mstr, '\n'); + cline++; + } + code_lines[pos].lines = msdone(code_mstr); + code_lines[pos].num = (size_t) cline; + return; + } + break; + default: + break; + } + mputc(code_mstr, c); + on_line++; + } +} + static void copy_text(void) { @@ -1235,7 +1378,7 @@ get_literal(void) cachec('\\'); cachec(c); } - else if (isprint(c)) + else if (isprint(UCH(c))) cachec(c); else { @@ -1329,13 +1472,21 @@ static Value_t get_number(void) { int c; - Value_t n; + long n; + char *base = cptr; n = 0; - for (c = *cptr; isdigit(c); c = *++cptr) - n = (Value_t)(10 * n + (c - '0')); + for (c = *cptr; isdigit(UCH(c)); c = *++cptr) + { + n = (10 * n + (c - '0')); + if (n > MAXYYINT) + { + syntax_error(lineno, line, base); + /*NOTREACHED */ + } + } - return (n); + return (Value_t)(n); } static char * @@ -1382,7 +1533,7 @@ get_tag(void) c = nextc(); if (c == EOF) unexpected_EOF(); - if (!isalpha(c) && c != '_' && c != '$') + if (!IS_NAME1(c)) illegal_tag(t_lineno, t_line, t_cptr); cinc = 0; @@ -1412,7 +1563,7 @@ scan_id(void) { char *b = cptr; - while (isalnum(UCH(*cptr)) || *cptr == '_' || *cptr == '$') + while (IS_NAME2(UCH(*cptr))) cptr++; return cache_tag(b, (size_t) (cptr - b)); } @@ -1442,7 +1593,7 @@ declare_tokens(int assoc) for (;;) { - if (isalpha(c) || c == '_' || c == '.' || c == '$') + if (isalpha(UCH(c)) || c == '_' || c == '.' || c == '$') bp = get_name(); else if (c == '\'' || c == '"') bp = get_literal(); @@ -1472,8 +1623,7 @@ declare_tokens(int assoc) if (c == EOF) unexpected_EOF(); - value = UNDEFINED; - if (isdigit(c)) + if (isdigit(UCH(c))) { value = get_number(); if (bp->value != UNDEFINED && value != bp->value) @@ -1509,7 +1659,7 @@ declare_expect(int assoc) for (;;) { - if (isdigit(c)) + if (isdigit(UCH(c))) { if (assoc == EXPECT) SRexpect = get_number(); @@ -1522,7 +1672,7 @@ declare_expect(int assoc) * Spaces, tabs, and numbers are ok, * words, punc., etc. are syntax errors. */ - else if (c == '\n' || isalpha(c) || !isspace(c)) + else if (c == '\n' || isalpha(UCH(c)) || !isspace(UCH(c))) { syntax_error(lineno, line, cptr); } @@ -1591,7 +1741,7 @@ declare_types(void) c = nextc(); if (c == EOF) unexpected_EOF(); - if (isalpha(c) || c == '_' || c == '.' || c == '$') + if (isalpha(UCH(c)) || c == '_' || c == '.' || c == '$') { bp = get_name(); #if defined(YYBTYACC) @@ -1629,7 +1779,7 @@ declare_start(void) c = nextc(); if (c == EOF) unexpected_EOF(); - if (!isalpha(c) && c != '_' && c != '.' && c != '$') + if (!isalpha(UCH(c)) && c != '_' && c != '.' && c != '$') syntax_error(lineno, line, cptr); bp = get_name(); if (bp->class == TERM) @@ -1664,6 +1814,10 @@ read_declarations(void) copy_ident(); break; + case XCODE: + copy_code(); + break; + case TEXT: copy_text(); break; @@ -1871,7 +2025,7 @@ parse_id(char *p, char **save) if (!isalpha(UCH(*p)) && *p != '_') return NULL; b = p; - while (isalnum(UCH(*p)) || *p == '_' || *p == '$') + while (IS_NAME2(UCH(*p))) p++; if (save) { @@ -2129,7 +2283,10 @@ can_elide_arg(char **theptr, char *yyvaltag) { char *arg; if (!(p = parse_id(p, &arg))) + { + FREE(offsets); return 0; + } for (i = plhs[nrules]->args - 1; i >= 0; i--) if (arg == plhs[nrules]->argnames[i]) break; @@ -2149,7 +2306,7 @@ can_elide_arg(char **theptr, char *yyvaltag) rv = 0; if (maxoffset > 0) FREE(offsets); - if (*p || rv <= 0) + if (p == 0 || *p || rv <= 0) return 0; *theptr = p + 1; return rv; @@ -2228,6 +2385,10 @@ advance_to_start(void) s_cptr = cptr; switch (keyword()) { + case XCODE: + copy_code(); + break; + case MARK: no_grammar(); @@ -2245,7 +2406,7 @@ advance_to_start(void) } c = nextc(); - if (!isalpha(c) && c != '_' && c != '.' && c != '_') + if (!isalpha(UCH(c)) && c != '_' && c != '.' && c != '_') syntax_error(lineno, line, cptr); bp = get_name(); if (goal == 0) @@ -2572,7 +2733,7 @@ copy_action(void) FREE(d_line); goto loop; } - else if (isdigit(c)) + else if (isdigit(UCH(c))) { i = get_number(); if (i == 0) @@ -2596,7 +2757,7 @@ copy_action(void) goto loop; } #if defined(YYBTYACC) - else if (isalpha(c) || c == '_') + else if (isalpha(UCH(c)) || c == '_') { char *arg = scan_id(); for (i = plhs[nrules]->args - 1; i >= 0; i--) @@ -2727,14 +2888,14 @@ copy_action(void) } } #endif - if (isalpha(c) || c == '_' || c == '$') + if (IS_NAME1(c)) { do { putc(c, f); c = *++cptr; } - while (isalnum(c) || c == '_' || c == '$'); + while (IS_NAME2(c)); goto loop; } ++cptr; @@ -2923,14 +3084,14 @@ get_code(struct ainfo *a, const char *loc) cptr += 2; goto loop; } - if (isalpha(c) || c == '_' || c == '$') + if (IS_NAME1(c)) { do { mputc(code_mstr, c); c = *++cptr; } - while (isalnum(c) || c == '_' || c == '$'); + while (IS_NAME2(c)); goto loop; } ++cptr; @@ -3049,7 +3210,7 @@ copy_destructor(void) bp->destructor = process_destructor_XX(code_text, tag); } } - else if (isalpha(c) || c == '_' || c == '.' || c == '$') + else if (isalpha(UCH(c)) || c == '_' || c == '.' || c == '$') { /* "symbol" destructor */ bp = get_name(); if (bp->destructor != NULL) @@ -3090,14 +3251,14 @@ process_destructor_XX(char *code, char *tag) msprintf(new_code, "(*val).%s", tag); goto loop; } - if (isalpha(c) || c == '_' || c == '$') + if (IS_NAME1(c)) { do { mputc(new_code, c); c = *++codeptr; } - while (isalnum(c) || c == '_' || c == '$'); + while (IS_NAME2(c)); goto loop; } ++codeptr; @@ -3180,7 +3341,7 @@ mark_symbol(void) syntax_error(lineno, line, cptr); c = nextc(); - if (isalpha(c) || c == '_' || c == '.' || c == '$') + if (isalpha(UCH(c)) || c == '_' || c == '.' || c == '$') bp = get_name(); else if (c == '\'' || c == '"') bp = get_literal(); @@ -3211,7 +3372,7 @@ read_grammar(void) c = nextc(); if (c == EOF) break; - if (isalpha(c) + if (isalpha(UCH(c)) || c == '_' || c == '.' || c == '$' diff --git a/test/btyacc/big_b.error b/test/btyacc/big_b.error index e69de29bb2d1..67101620d2c1 100644 --- a/test/btyacc/big_b.error +++ b/test/btyacc/big_b.error @@ -0,0 +1,19 @@ +Usage: YACC [options] filename + +Options: + -b file_prefix set filename prefix (default "y.") + -B create a backtracking parser + -d write definitions (.tab.h) + -H defines_file write definitions to defines_file + -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 ".tab.c") + -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 diff --git a/test/btyacc/big_b.output b/test/btyacc/big_b.output index 112b7c7a41c5..e69de29bb2d1 100644 --- a/test/btyacc/big_b.output +++ b/test/btyacc/big_b.output @@ -1,18 +0,0 @@ -Usage: YACC [options] filename - -Options: - -b file_prefix set filename prefix (default "y.") - -B create a backtracking parser - -d write definitions (.tab.h) - -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 ".tab.c") - -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 diff --git a/test/btyacc/big_l.error b/test/btyacc/big_l.error index e69de29bb2d1..67101620d2c1 100644 --- a/test/btyacc/big_l.error +++ b/test/btyacc/big_l.error @@ -0,0 +1,19 @@ +Usage: YACC [options] filename + +Options: + -b file_prefix set filename prefix (default "y.") + -B create a backtracking parser + -d write definitions (.tab.h) + -H defines_file write definitions to defines_file + -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 ".tab.c") + -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 diff --git a/test/btyacc/big_l.output b/test/btyacc/big_l.output index 112b7c7a41c5..e69de29bb2d1 100644 --- a/test/btyacc/big_l.output +++ b/test/btyacc/big_l.output @@ -1,18 +0,0 @@ -Usage: YACC [options] filename - -Options: - -b file_prefix set filename prefix (default "y.") - -B create a backtracking parser - -d write definitions (.tab.h) - -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 ".tab.c") - -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 diff --git a/test/btyacc/btyacc_calc1.tab.c b/test/btyacc/btyacc_calc1.tab.c index 6142a131ca37..39290121ca11 100644 --- a/test/btyacc/btyacc_calc1.tab.c +++ b/test/btyacc/btyacc_calc1.tab.c @@ -389,8 +389,9 @@ static const char *const calc1_rule[] = { }; #endif +#if YYDEBUG int yydebug; -int yynerrs; +#endif #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) #ifndef YYLLOC_DEFAULT @@ -399,17 +400,17 @@ do \ { \ if (n == 0) \ { \ - (loc).first_line = ((rhs)[-1]).last_line; \ - (loc).first_column = ((rhs)[-1]).last_column; \ - (loc).last_line = ((rhs)[-1]).last_line; \ - (loc).last_column = ((rhs)[-1]).last_column; \ + (loc).first_line = YYRHSLOC(rhs, 0).last_line; \ + (loc).first_column = YYRHSLOC(rhs, 0).last_column; \ + (loc).last_line = YYRHSLOC(rhs, 0).last_line; \ + (loc).last_column = YYRHSLOC(rhs, 0).last_column; \ } \ else \ { \ - (loc).first_line = ((rhs)[ 0 ]).first_line; \ - (loc).first_column = ((rhs)[ 0 ]).first_column; \ - (loc).last_line = ((rhs)[n-1]).last_line; \ - (loc).last_column = ((rhs)[n-1]).last_column; \ + (loc).first_line = YYRHSLOC(rhs, 1).first_line; \ + (loc).first_column = YYRHSLOC(rhs, 1).first_column; \ + (loc).last_line = YYRHSLOC(rhs, n).last_line; \ + (loc).last_column = YYRHSLOC(rhs, n).last_column; \ } \ } while (0) #endif /* YYLLOC_DEFAULT */ @@ -615,7 +616,7 @@ vdiv(double a, double b, INTERVAL v) { return (hilo(a / v.hi, a / v.lo, b / v.hi, b / v.lo)); } -#line 619 "btyacc_calc1.tab.c" +#line 620 "btyacc_calc1.tab.c" /* For use in generated program */ #define yydepth (int)(yystack.s_mark - yystack.s_base) @@ -752,6 +753,8 @@ YYPARSE_DECL() int yychar; YYSTYPE yyval; YYSTYPE yylval; + int yynerrs; + #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) YYLTYPE yyloc; /* position returned by actions */ YYLTYPE yylloc; /* position from the lexer */ @@ -804,7 +807,7 @@ YYPARSE_DECL() YYParseState *yyerrctx = NULL; #endif /* YYBTYACC */ #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - YYLTYPE yyerror_loc_range[2]; /* position of error start & end */ + YYLTYPE yyerror_loc_range[3]; /* position of error start/end (0 unused) */ #endif #if YYDEBUG const char *yys; @@ -880,10 +883,10 @@ yyloop: size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; - if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; + if ((yylexemes = (YYINT *)realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; + if ((yylvals = (YYSTYPE *)realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; + if ((yylpsns = (YYLTYPE *)realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; yylvlim = yylvals + s; @@ -994,7 +997,7 @@ yyloop: /* If this is a first conflict in the stack, start saving lexemes */ if (!yylexemes) { - yylexemes = malloc((YYLVQUEUEGROWTH) * sizeof(YYINT)); + yylexemes = (YYINT *) malloc((YYLVQUEUEGROWTH) * sizeof(YYINT)); if (yylexemes == NULL) goto yyenomem; yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE)); if (yylvals == NULL) goto yyenomem; @@ -1204,7 +1207,7 @@ yyerrhandler: YYERROR_CALL("syntax error"); #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - yyerror_loc_range[0] = yylloc; /* lookahead position is error start position */ + yyerror_loc_range[1] = yylloc; /* lookahead position is error start position */ #endif #if !YYBTYACC @@ -1233,7 +1236,7 @@ yyinrecovery: *++yystack.l_mark = yylval; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) /* lookahead position is error end position */ - yyerror_loc_range[1] = yylloc; + yyerror_loc_range[2] = yylloc; YYLLOC_DEFAULT(yyloc, yyerror_loc_range, 2); /* position of error span */ *++yystack.p_mark = yyloc; #endif @@ -1249,7 +1252,7 @@ yyinrecovery: if (yystack.s_mark <= yystack.s_base) goto yyabort; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) /* the current TOS position is the error start position */ - yyerror_loc_range[0] = *yystack.p_mark; + yyerror_loc_range[1] = *yystack.p_mark; #endif #if defined(YYDESTRUCT_CALL) #if YYBTYACC @@ -1335,10 +1338,10 @@ yyreduce: if (!yytrial) #endif /* YYBTYACC */ { - YYLLOC_DEFAULT(yyloc, &yystack.p_mark[1-yym], yym); + YYLLOC_DEFAULT(yyloc, &yystack.p_mark[-yym], yym); /* just in case YYERROR is invoked within the action, save the start of the rhs as the error start position */ - yyerror_loc_range[0] = yystack.p_mark[1-yym]; + yyerror_loc_range[1] = yystack.p_mark[1-yym]; } #endif @@ -1537,7 +1540,7 @@ case 28: yyval.vval = yystack.l_mark[-1].vval; } break; -#line 1541 "btyacc_calc1.tab.c" +#line 1544 "btyacc_calc1.tab.c" default: break; } @@ -1592,12 +1595,12 @@ break; size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) + if ((yylexemes = (YYINT *)realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; - if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) + if ((yylvals = (YYSTYPE *)realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) + if ((yylpsns = (YYLTYPE *)realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; diff --git a/test/btyacc/btyacc_calc1.tab.h b/test/btyacc/btyacc_calc1.tab.h index 1802350b0d2a..9cf4e75ba38a 100644 --- a/test/btyacc/btyacc_calc1.tab.h +++ b/test/btyacc/btyacc_calc1.tab.h @@ -18,6 +18,5 @@ typedef union INTERVAL vval; } YYSTYPE; #endif /* !YYSTYPE_IS_DECLARED */ -extern YYSTYPE calc1_lval; #endif /* _calc1__defines_h_ */ diff --git a/test/btyacc/btyacc_demo.tab.c b/test/btyacc/btyacc_demo.tab.c index eff738cfd5b2..cdffc079ecec 100644 --- a/test/btyacc/btyacc_demo.tab.c +++ b/test/btyacc/btyacc_demo.tab.c @@ -508,13 +508,16 @@ static const char *const demo_rule[] = { }; #endif +#if YYDEBUG int yydebug; -int yynerrs; +#endif int yyerrflag; int yychar; YYSTYPE yyval; YYSTYPE yylval; +int yynerrs; + #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) YYLTYPE yyloc; /* position returned by actions */ YYLTYPE yylloc; /* position from the lexer */ @@ -527,17 +530,17 @@ do \ { \ if (n == 0) \ { \ - (loc).first_line = ((rhs)[-1]).last_line; \ - (loc).first_column = ((rhs)[-1]).last_column; \ - (loc).last_line = ((rhs)[-1]).last_line; \ - (loc).last_column = ((rhs)[-1]).last_column; \ + (loc).first_line = YYRHSLOC(rhs, 0).last_line; \ + (loc).first_column = YYRHSLOC(rhs, 0).last_column; \ + (loc).last_line = YYRHSLOC(rhs, 0).last_line; \ + (loc).last_column = YYRHSLOC(rhs, 0).last_column; \ } \ else \ { \ - (loc).first_line = ((rhs)[ 0 ]).first_line; \ - (loc).first_column = ((rhs)[ 0 ]).first_column; \ - (loc).last_line = ((rhs)[n-1]).last_line; \ - (loc).last_column = ((rhs)[n-1]).last_column; \ + (loc).first_line = YYRHSLOC(rhs, 1).first_line; \ + (loc).first_column = YYRHSLOC(rhs, 1).first_column; \ + (loc).last_line = YYRHSLOC(rhs, n).last_line; \ + (loc).last_column = YYRHSLOC(rhs, n).last_column; \ } \ } while (0) #endif /* YYLLOC_DEFAULT */ @@ -660,7 +663,7 @@ extern Expr * var_expr(Scope *scope, char *id); extern Code * build_expr_code(Expr *expr); extern Code * build_if(Expr *cond_expr, Code *then_stmt, Code *else_stmt); extern Code * code_append(Code *stmt_list, Code *stmt); -#line 664 "btyacc_demo.tab.c" +#line 667 "btyacc_demo.tab.c" /* Release memory associated with symbol. */ #if ! defined YYDESTRUCT_IS_DECLARED @@ -677,7 +680,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); /* in this example, we don't know what to do here */ } break; -#line 681 "btyacc_demo.tab.c" +#line 684 "btyacc_demo.tab.c" case 45: #line 83 "btyacc_demo.y" { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n", @@ -686,7 +689,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); /* in this example, we don't know what to do here */ } break; -#line 690 "btyacc_demo.tab.c" +#line 693 "btyacc_demo.tab.c" case 42: #line 83 "btyacc_demo.y" { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n", @@ -695,7 +698,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); /* in this example, we don't know what to do here */ } break; -#line 699 "btyacc_demo.tab.c" +#line 702 "btyacc_demo.tab.c" case 47: #line 83 "btyacc_demo.y" { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n", @@ -704,7 +707,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); /* in this example, we don't know what to do here */ } break; -#line 708 "btyacc_demo.tab.c" +#line 711 "btyacc_demo.tab.c" case 37: #line 83 "btyacc_demo.y" { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n", @@ -713,7 +716,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); /* in this example, we don't know what to do here */ } break; -#line 717 "btyacc_demo.tab.c" +#line 720 "btyacc_demo.tab.c" case 257: #line 83 "btyacc_demo.y" { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n", @@ -722,7 +725,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); /* in this example, we don't know what to do here */ } break; -#line 726 "btyacc_demo.tab.c" +#line 729 "btyacc_demo.tab.c" case 258: #line 83 "btyacc_demo.y" { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n", @@ -731,7 +734,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); /* in this example, we don't know what to do here */ } break; -#line 735 "btyacc_demo.tab.c" +#line 738 "btyacc_demo.tab.c" case 40: #line 83 "btyacc_demo.y" { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n", @@ -740,7 +743,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); /* in this example, we don't know what to do here */ } break; -#line 744 "btyacc_demo.tab.c" +#line 747 "btyacc_demo.tab.c" case 91: #line 83 "btyacc_demo.y" { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n", @@ -749,7 +752,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); /* in this example, we don't know what to do here */ } break; -#line 753 "btyacc_demo.tab.c" +#line 756 "btyacc_demo.tab.c" case 46: #line 83 "btyacc_demo.y" { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n", @@ -758,7 +761,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); /* in this example, we don't know what to do here */ } break; -#line 762 "btyacc_demo.tab.c" +#line 765 "btyacc_demo.tab.c" case 259: #line 78 "btyacc_demo.y" { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n", @@ -767,7 +770,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); free((*val).id); } break; -#line 771 "btyacc_demo.tab.c" +#line 774 "btyacc_demo.tab.c" case 260: #line 78 "btyacc_demo.y" { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n", @@ -776,7 +779,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); free((*val).expr); } break; -#line 780 "btyacc_demo.tab.c" +#line 783 "btyacc_demo.tab.c" case 261: #line 83 "btyacc_demo.y" { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n", @@ -785,7 +788,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); /* in this example, we don't know what to do here */ } break; -#line 789 "btyacc_demo.tab.c" +#line 792 "btyacc_demo.tab.c" case 262: #line 83 "btyacc_demo.y" { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n", @@ -794,7 +797,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); /* in this example, we don't know what to do here */ } break; -#line 798 "btyacc_demo.tab.c" +#line 801 "btyacc_demo.tab.c" case 263: #line 83 "btyacc_demo.y" { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n", @@ -803,7 +806,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); /* in this example, we don't know what to do here */ } break; -#line 807 "btyacc_demo.tab.c" +#line 810 "btyacc_demo.tab.c" case 264: #line 83 "btyacc_demo.y" { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n", @@ -812,7 +815,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); /* in this example, we don't know what to do here */ } break; -#line 816 "btyacc_demo.tab.c" +#line 819 "btyacc_demo.tab.c" case 265: #line 83 "btyacc_demo.y" { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n", @@ -821,7 +824,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); /* in this example, we don't know what to do here */ } break; -#line 825 "btyacc_demo.tab.c" +#line 828 "btyacc_demo.tab.c" case 266: #line 83 "btyacc_demo.y" { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n", @@ -830,7 +833,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); /* in this example, we don't know what to do here */ } break; -#line 834 "btyacc_demo.tab.c" +#line 837 "btyacc_demo.tab.c" case 267: #line 83 "btyacc_demo.y" { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n", @@ -839,7 +842,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); /* in this example, we don't know what to do here */ } break; -#line 843 "btyacc_demo.tab.c" +#line 846 "btyacc_demo.tab.c" case 268: #line 83 "btyacc_demo.y" { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n", @@ -848,7 +851,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); /* in this example, we don't know what to do here */ } break; -#line 852 "btyacc_demo.tab.c" +#line 855 "btyacc_demo.tab.c" case 269: #line 83 "btyacc_demo.y" { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n", @@ -857,7 +860,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); /* in this example, we don't know what to do here */ } break; -#line 861 "btyacc_demo.tab.c" +#line 864 "btyacc_demo.tab.c" case 59: #line 83 "btyacc_demo.y" { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n", @@ -866,7 +869,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); /* in this example, we don't know what to do here */ } break; -#line 870 "btyacc_demo.tab.c" +#line 873 "btyacc_demo.tab.c" case 44: #line 83 "btyacc_demo.y" { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n", @@ -875,7 +878,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); /* in this example, we don't know what to do here */ } break; -#line 879 "btyacc_demo.tab.c" +#line 882 "btyacc_demo.tab.c" case 41: #line 83 "btyacc_demo.y" { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n", @@ -884,7 +887,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); /* in this example, we don't know what to do here */ } break; -#line 888 "btyacc_demo.tab.c" +#line 891 "btyacc_demo.tab.c" case 93: #line 83 "btyacc_demo.y" { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n", @@ -893,7 +896,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); /* in this example, we don't know what to do here */ } break; -#line 897 "btyacc_demo.tab.c" +#line 900 "btyacc_demo.tab.c" case 123: #line 83 "btyacc_demo.y" { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n", @@ -902,7 +905,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); /* in this example, we don't know what to do here */ } break; -#line 906 "btyacc_demo.tab.c" +#line 909 "btyacc_demo.tab.c" case 125: #line 83 "btyacc_demo.y" { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n", @@ -911,7 +914,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); /* in this example, we don't know what to do here */ } break; -#line 915 "btyacc_demo.tab.c" +#line 918 "btyacc_demo.tab.c" case 270: #line 83 "btyacc_demo.y" { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n", @@ -920,7 +923,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); /* in this example, we don't know what to do here */ } break; -#line 924 "btyacc_demo.tab.c" +#line 927 "btyacc_demo.tab.c" case 271: #line 83 "btyacc_demo.y" { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n", @@ -929,7 +932,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); /* in this example, we don't know what to do here */ } break; -#line 933 "btyacc_demo.tab.c" +#line 936 "btyacc_demo.tab.c" case 272: #line 78 "btyacc_demo.y" { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n", @@ -938,7 +941,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); free((*val).expr); } break; -#line 942 "btyacc_demo.tab.c" +#line 945 "btyacc_demo.tab.c" case 273: #line 67 "btyacc_demo.y" { /* 'msg' is a 'char *' indicating the context of destructor invocation*/ @@ -948,7 +951,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); free((*val).decl->scope); free((*val).decl->type); } break; -#line 952 "btyacc_demo.tab.c" +#line 955 "btyacc_demo.tab.c" case 274: #line 83 "btyacc_demo.y" { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n", @@ -957,7 +960,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); /* in this example, we don't know what to do here */ } break; -#line 961 "btyacc_demo.tab.c" +#line 964 "btyacc_demo.tab.c" case 275: #line 83 "btyacc_demo.y" { printf("%s accessed by symbol with no type @ position[%d,%d..%d,%d]\n", @@ -966,7 +969,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); /* in this example, we don't know what to do here */ } break; -#line 970 "btyacc_demo.tab.c" +#line 973 "btyacc_demo.tab.c" case 276: #line 78 "btyacc_demo.y" { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n", @@ -975,7 +978,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); free((*val).code); } break; -#line 979 "btyacc_demo.tab.c" +#line 982 "btyacc_demo.tab.c" case 277: #line 78 "btyacc_demo.y" { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n", @@ -984,7 +987,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); free((*val).code); } break; -#line 988 "btyacc_demo.tab.c" +#line 991 "btyacc_demo.tab.c" case 278: #line 78 "btyacc_demo.y" { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n", @@ -993,7 +996,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); free((*val).code); } break; -#line 997 "btyacc_demo.tab.c" +#line 1000 "btyacc_demo.tab.c" case 279: #line 73 "btyacc_demo.y" { printf("%s accessed by symbol with type <decl> (case s.b. 279 & 280) @ position[%d,%d..%d,%d]\n", @@ -1002,7 +1005,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); free((*val).decl); } break; -#line 1006 "btyacc_demo.tab.c" +#line 1009 "btyacc_demo.tab.c" case 280: #line 73 "btyacc_demo.y" { printf("%s accessed by symbol with type <decl> (case s.b. 279 & 280) @ position[%d,%d..%d,%d]\n", @@ -1011,7 +1014,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); free((*val).decl); } break; -#line 1015 "btyacc_demo.tab.c" +#line 1018 "btyacc_demo.tab.c" case 281: #line 78 "btyacc_demo.y" { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n", @@ -1020,7 +1023,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); free((*val).type); } break; -#line 1024 "btyacc_demo.tab.c" +#line 1027 "btyacc_demo.tab.c" case 282: #line 78 "btyacc_demo.y" { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n", @@ -1029,7 +1032,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); free((*val).type); } break; -#line 1033 "btyacc_demo.tab.c" +#line 1036 "btyacc_demo.tab.c" case 283: #line 78 "btyacc_demo.y" { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n", @@ -1038,7 +1041,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); free((*val).type); } break; -#line 1042 "btyacc_demo.tab.c" +#line 1045 "btyacc_demo.tab.c" case 284: #line 78 "btyacc_demo.y" { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n", @@ -1047,7 +1050,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); free((*val).type); } break; -#line 1051 "btyacc_demo.tab.c" +#line 1054 "btyacc_demo.tab.c" case 285: #line 78 "btyacc_demo.y" { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n", @@ -1056,7 +1059,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); free((*val).type); } break; -#line 1060 "btyacc_demo.tab.c" +#line 1063 "btyacc_demo.tab.c" case 286: #line 78 "btyacc_demo.y" { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n", @@ -1065,7 +1068,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); free((*val).scope); } break; -#line 1069 "btyacc_demo.tab.c" +#line 1072 "btyacc_demo.tab.c" case 287: #line 78 "btyacc_demo.y" { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n", @@ -1074,7 +1077,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); free((*val).dlist); } break; -#line 1078 "btyacc_demo.tab.c" +#line 1081 "btyacc_demo.tab.c" case 288: #line 78 "btyacc_demo.y" { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n", @@ -1083,7 +1086,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); free((*val).dlist); } break; -#line 1087 "btyacc_demo.tab.c" +#line 1090 "btyacc_demo.tab.c" case 289: #line 78 "btyacc_demo.y" { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n", @@ -1092,7 +1095,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); free((*val).scope); } break; -#line 1096 "btyacc_demo.tab.c" +#line 1099 "btyacc_demo.tab.c" case 290: #line 78 "btyacc_demo.y" { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n", @@ -1101,7 +1104,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); free((*val).scope); } break; -#line 1105 "btyacc_demo.tab.c" +#line 1108 "btyacc_demo.tab.c" case 291: #line 78 "btyacc_demo.y" { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n", @@ -1110,7 +1113,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); free((*val).scope); } break; -#line 1114 "btyacc_demo.tab.c" +#line 1117 "btyacc_demo.tab.c" case 292: #line 78 "btyacc_demo.y" { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n", @@ -1119,7 +1122,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); free((*val).scope); } break; -#line 1123 "btyacc_demo.tab.c" +#line 1126 "btyacc_demo.tab.c" case 293: #line 78 "btyacc_demo.y" { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n", @@ -1128,7 +1131,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); free((*val).type); } break; -#line 1132 "btyacc_demo.tab.c" +#line 1135 "btyacc_demo.tab.c" case 294: #line 78 "btyacc_demo.y" { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n", @@ -1137,7 +1140,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); free((*val).scope); } break; -#line 1141 "btyacc_demo.tab.c" +#line 1144 "btyacc_demo.tab.c" case 295: #line 78 "btyacc_demo.y" { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n", @@ -1146,7 +1149,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); free((*val).type); } break; -#line 1150 "btyacc_demo.tab.c" +#line 1153 "btyacc_demo.tab.c" case 296: #line 78 "btyacc_demo.y" { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n", @@ -1155,7 +1158,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); free((*val).scope); } break; -#line 1159 "btyacc_demo.tab.c" +#line 1162 "btyacc_demo.tab.c" case 297: #line 78 "btyacc_demo.y" { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n", @@ -1164,7 +1167,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); free((*val).scope); } break; -#line 1168 "btyacc_demo.tab.c" +#line 1171 "btyacc_demo.tab.c" case 298: #line 78 "btyacc_demo.y" { printf("%s accessed by symbol of any type other than <decl> @ position[%d,%d..%d,%d]\n", @@ -1173,7 +1176,7 @@ YYDESTRUCT_DECL() (*loc).last_line, (*loc).last_column); free((*val).scope); } break; -#line 1177 "btyacc_demo.tab.c" +#line 1180 "btyacc_demo.tab.c" } } #define YYDESTRUCT_IS_DECLARED 1 @@ -1316,7 +1319,7 @@ YYPARSE_DECL() YYParseState *yyerrctx = NULL; #endif /* YYBTYACC */ #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - YYLTYPE yyerror_loc_range[2]; /* position of error start & end */ + YYLTYPE yyerror_loc_range[3]; /* position of error start/end (0 unused) */ #endif #if YYDEBUG const char *yys; @@ -1383,10 +1386,10 @@ yyloop: size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; - if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; + if ((yylexemes = (YYINT *)realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; + if ((yylvals = (YYSTYPE *)realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; + if ((yylpsns = (YYLTYPE *)realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; yylvlim = yylvals + s; @@ -1497,7 +1500,7 @@ yyloop: /* If this is a first conflict in the stack, start saving lexemes */ if (!yylexemes) { - yylexemes = malloc((YYLVQUEUEGROWTH) * sizeof(YYINT)); + yylexemes = (YYINT *) malloc((YYLVQUEUEGROWTH) * sizeof(YYINT)); if (yylexemes == NULL) goto yyenomem; yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE)); if (yylvals == NULL) goto yyenomem; @@ -1707,7 +1710,7 @@ yyerrhandler: YYERROR_CALL("syntax error"); #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - yyerror_loc_range[0] = yylloc; /* lookahead position is error start position */ + yyerror_loc_range[1] = yylloc; /* lookahead position is error start position */ #endif #if !YYBTYACC @@ -1736,7 +1739,7 @@ yyinrecovery: *++yystack.l_mark = yylval; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) /* lookahead position is error end position */ - yyerror_loc_range[1] = yylloc; + yyerror_loc_range[2] = yylloc; YYLLOC_DEFAULT(yyloc, yyerror_loc_range, 2); /* position of error span */ *++yystack.p_mark = yyloc; #endif @@ -1752,7 +1755,7 @@ yyinrecovery: if (yystack.s_mark <= yystack.s_base) goto yyabort; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) /* the current TOS position is the error start position */ - yyerror_loc_range[0] = *yystack.p_mark; + yyerror_loc_range[1] = *yystack.p_mark; #endif #if defined(YYDESTRUCT_CALL) #if YYBTYACC @@ -1838,10 +1841,10 @@ yyreduce: if (!yytrial) #endif /* YYBTYACC */ { - YYLLOC_DEFAULT(yyloc, &yystack.p_mark[1-yym], yym); + YYLLOC_DEFAULT(yyloc, &yystack.p_mark[-yym], yym); /* just in case YYERROR is invoked within the action, save the start of the rhs as the error start position */ - yyerror_loc_range[0] = yystack.p_mark[1-yym]; + yyerror_loc_range[1] = yystack.p_mark[1-yym]; } #endif @@ -2106,7 +2109,7 @@ case 59: #line 197 "btyacc_demo.y" { yyval.code = yystack.l_mark[-1].code; } break; -#line 2110 "btyacc_demo.tab.c" +#line 2113 "btyacc_demo.tab.c" default: break; } @@ -2161,12 +2164,12 @@ break; size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) + if ((yylexemes = (YYINT *)realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; - if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) + if ((yylvals = (YYSTYPE *)realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) + if ((yylpsns = (YYLTYPE *)realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; diff --git a/test/btyacc/btyacc_demo.tab.h b/test/btyacc/btyacc_demo.tab.h index c219fb1fae97..5c2b96cf3310 100644 --- a/test/btyacc/btyacc_demo.tab.h +++ b/test/btyacc/btyacc_demo.tab.h @@ -46,5 +46,6 @@ typedef struct YYLTYPE #define YYLTYPE_IS_DECLARED 1 #endif #define YYRHSLOC(rhs, k) ((rhs)[k]) +extern YYLTYPE demo_lloc; #endif /* _demo__defines_h_ */ diff --git a/test/btyacc/btyacc_demo2.error b/test/btyacc/btyacc_demo2.error deleted file mode 100644 index 554dd5acb0aa..000000000000 --- a/test/btyacc/btyacc_demo2.error +++ /dev/null @@ -1 +0,0 @@ -YACC: e - line 82 of "./btyacc_demo2.y", $$ is untyped diff --git a/test/btyacc/btyacc_demo2.tab.c b/test/btyacc/btyacc_demo2.tab.c deleted file mode 100644 index 6c35f23329b5..000000000000 --- a/test/btyacc/btyacc_demo2.tab.c +++ /dev/null @@ -1,15 +0,0 @@ -/* original parser id follows */ -/* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ -/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */ - -#define YYBYACC 1 -#define YYMAJOR 1 -#define YYMINOR 9 -#define YYCHECK "yyyymmdd" - -#define YYEMPTY (-1) -#define yyclearin (yychar = YYEMPTY) -#define yyerrok (yyerrflag = 0) -#define YYRECOVERING() (yyerrflag != 0) -#define YYENOMEM (-2) -#define YYEOF 0 diff --git a/test/btyacc/btyacc_destroy1.tab.c b/test/btyacc/btyacc_destroy1.tab.c index 74c32b10326c..d445b88b51d0 100644 --- a/test/btyacc/btyacc_destroy1.tab.c +++ b/test/btyacc/btyacc_destroy1.tab.c @@ -357,13 +357,16 @@ static const char *const destroy1_rule[] = { }; #endif +#if YYDEBUG int yydebug; -int yynerrs; +#endif int yyerrflag; int yychar; YYSTYPE yyval; YYSTYPE yylval; +int yynerrs; + #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) YYLTYPE yyloc; /* position returned by actions */ YYLTYPE yylloc; /* position from the lexer */ @@ -376,17 +379,17 @@ do \ { \ if (n == 0) \ { \ - (loc).first_line = ((rhs)[-1]).last_line; \ - (loc).first_column = ((rhs)[-1]).last_column; \ - (loc).last_line = ((rhs)[-1]).last_line; \ - (loc).last_column = ((rhs)[-1]).last_column; \ + (loc).first_line = YYRHSLOC(rhs, 0).last_line; \ + (loc).first_column = YYRHSLOC(rhs, 0).last_column; \ + (loc).last_line = YYRHSLOC(rhs, 0).last_line; \ + (loc).last_column = YYRHSLOC(rhs, 0).last_column; \ } \ else \ { \ - (loc).first_line = ((rhs)[ 0 ]).first_line; \ - (loc).first_column = ((rhs)[ 0 ]).first_column; \ - (loc).last_line = ((rhs)[n-1]).last_line; \ - (loc).last_column = ((rhs)[n-1]).last_column; \ + (loc).first_line = YYRHSLOC(rhs, 1).first_line; \ + (loc).first_column = YYRHSLOC(rhs, 1).first_column; \ + (loc).last_line = YYRHSLOC(rhs, n).last_line; \ + (loc).last_column = YYRHSLOC(rhs, n).last_column; \ } \ } while (0) #endif /* YYLLOC_DEFAULT */ @@ -485,7 +488,7 @@ static YYINT *yylexemes = 0; extern int YYLEX_DECL(); extern void YYERROR_DECL(); -#line 489 "btyacc_destroy1.tab.c" +#line 492 "btyacc_destroy1.tab.c" /* Release memory associated with symbol. */ #if ! defined YYDESTRUCT_IS_DECLARED @@ -505,7 +508,7 @@ YYDESTRUCT_DECL() } } break; -#line 509 "btyacc_destroy1.tab.c" +#line 512 "btyacc_destroy1.tab.c" } } #define YYDESTRUCT_IS_DECLARED 1 @@ -648,7 +651,7 @@ YYPARSE_DECL() YYParseState *yyerrctx = NULL; #endif /* YYBTYACC */ #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - YYLTYPE yyerror_loc_range[2]; /* position of error start & end */ + YYLTYPE yyerror_loc_range[3]; /* position of error start/end (0 unused) */ #endif #if YYDEBUG const char *yys; @@ -715,10 +718,10 @@ yyloop: size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; - if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; + if ((yylexemes = (YYINT *)realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; + if ((yylvals = (YYSTYPE *)realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; + if ((yylpsns = (YYLTYPE *)realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; yylvlim = yylvals + s; @@ -829,7 +832,7 @@ yyloop: /* If this is a first conflict in the stack, start saving lexemes */ if (!yylexemes) { - yylexemes = malloc((YYLVQUEUEGROWTH) * sizeof(YYINT)); + yylexemes = (YYINT *) malloc((YYLVQUEUEGROWTH) * sizeof(YYINT)); if (yylexemes == NULL) goto yyenomem; yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE)); if (yylvals == NULL) goto yyenomem; @@ -1039,7 +1042,7 @@ yyerrhandler: YYERROR_CALL("syntax error"); #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - yyerror_loc_range[0] = yylloc; /* lookahead position is error start position */ + yyerror_loc_range[1] = yylloc; /* lookahead position is error start position */ #endif #if !YYBTYACC @@ -1068,7 +1071,7 @@ yyinrecovery: *++yystack.l_mark = yylval; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) /* lookahead position is error end position */ - yyerror_loc_range[1] = yylloc; + yyerror_loc_range[2] = yylloc; YYLLOC_DEFAULT(yyloc, yyerror_loc_range, 2); /* position of error span */ *++yystack.p_mark = yyloc; #endif @@ -1084,7 +1087,7 @@ yyinrecovery: if (yystack.s_mark <= yystack.s_base) goto yyabort; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) /* the current TOS position is the error start position */ - yyerror_loc_range[0] = *yystack.p_mark; + yyerror_loc_range[1] = *yystack.p_mark; #endif #if defined(YYDESTRUCT_CALL) #if YYBTYACC @@ -1170,10 +1173,10 @@ yyreduce: if (!yytrial) #endif /* YYBTYACC */ { - YYLLOC_DEFAULT(yyloc, &yystack.p_mark[1-yym], yym); + YYLLOC_DEFAULT(yyloc, &yystack.p_mark[-yym], yym); /* just in case YYERROR is invoked within the action, save the start of the rhs as the error start position */ - yyerror_loc_range[0] = yystack.p_mark[1-yym]; + yyerror_loc_range[1] = yystack.p_mark[1-yym]; } #endif @@ -1228,7 +1231,7 @@ case 9: #line 86 "btyacc_destroy1.y" { yyval.nlist = yystack.l_mark[-5].nlist; } break; -#line 1232 "btyacc_destroy1.tab.c" +#line 1235 "btyacc_destroy1.tab.c" default: break; } @@ -1283,12 +1286,12 @@ break; size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) + if ((yylexemes = (YYINT *)realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; - if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) + if ((yylvals = (YYSTYPE *)realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) + if ((yylpsns = (YYLTYPE *)realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; diff --git a/test/btyacc/btyacc_destroy2.tab.c b/test/btyacc/btyacc_destroy2.tab.c index 55705eecebc3..59a08e9a973c 100644 --- a/test/btyacc/btyacc_destroy2.tab.c +++ b/test/btyacc/btyacc_destroy2.tab.c @@ -357,13 +357,16 @@ static const char *const destroy2_rule[] = { }; #endif +#if YYDEBUG int yydebug; -int yynerrs; +#endif int yyerrflag; int yychar; YYSTYPE yyval; YYSTYPE yylval; +int yynerrs; + #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) YYLTYPE yyloc; /* position returned by actions */ YYLTYPE yylloc; /* position from the lexer */ @@ -376,17 +379,17 @@ do \ { \ if (n == 0) \ { \ - (loc).first_line = ((rhs)[-1]).last_line; \ - (loc).first_column = ((rhs)[-1]).last_column; \ - (loc).last_line = ((rhs)[-1]).last_line; \ - (loc).last_column = ((rhs)[-1]).last_column; \ + (loc).first_line = YYRHSLOC(rhs, 0).last_line; \ + (loc).first_column = YYRHSLOC(rhs, 0).last_column; \ + (loc).last_line = YYRHSLOC(rhs, 0).last_line; \ + (loc).last_column = YYRHSLOC(rhs, 0).last_column; \ } \ else \ { \ - (loc).first_line = ((rhs)[ 0 ]).first_line; \ - (loc).first_column = ((rhs)[ 0 ]).first_column; \ - (loc).last_line = ((rhs)[n-1]).last_line; \ - (loc).last_column = ((rhs)[n-1]).last_column; \ + (loc).first_line = YYRHSLOC(rhs, 1).first_line; \ + (loc).first_column = YYRHSLOC(rhs, 1).first_column; \ + (loc).last_line = YYRHSLOC(rhs, n).last_line; \ + (loc).last_column = YYRHSLOC(rhs, n).last_column; \ } \ } while (0) #endif /* YYLLOC_DEFAULT */ @@ -485,7 +488,7 @@ static YYINT *yylexemes = 0; extern int YYLEX_DECL(); extern void YYERROR_DECL(); -#line 489 "btyacc_destroy2.tab.c" +#line 492 "btyacc_destroy2.tab.c" /* Release memory associated with symbol. */ #if ! defined YYDESTRUCT_IS_DECLARED @@ -505,7 +508,7 @@ YYDESTRUCT_DECL() } } break; -#line 509 "btyacc_destroy2.tab.c" +#line 512 "btyacc_destroy2.tab.c" } } #define YYDESTRUCT_IS_DECLARED 1 @@ -648,7 +651,7 @@ YYPARSE_DECL() YYParseState *yyerrctx = NULL; #endif /* YYBTYACC */ #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - YYLTYPE yyerror_loc_range[2]; /* position of error start & end */ + YYLTYPE yyerror_loc_range[3]; /* position of error start/end (0 unused) */ #endif #if YYDEBUG const char *yys; @@ -715,10 +718,10 @@ yyloop: size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; - if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; + if ((yylexemes = (YYINT *)realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; + if ((yylvals = (YYSTYPE *)realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; + if ((yylpsns = (YYLTYPE *)realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; yylvlim = yylvals + s; @@ -829,7 +832,7 @@ yyloop: /* If this is a first conflict in the stack, start saving lexemes */ if (!yylexemes) { - yylexemes = malloc((YYLVQUEUEGROWTH) * sizeof(YYINT)); + yylexemes = (YYINT *) malloc((YYLVQUEUEGROWTH) * sizeof(YYINT)); if (yylexemes == NULL) goto yyenomem; yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE)); if (yylvals == NULL) goto yyenomem; @@ -1039,7 +1042,7 @@ yyerrhandler: YYERROR_CALL("syntax error"); #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - yyerror_loc_range[0] = yylloc; /* lookahead position is error start position */ + yyerror_loc_range[1] = yylloc; /* lookahead position is error start position */ #endif #if !YYBTYACC @@ -1068,7 +1071,7 @@ yyinrecovery: *++yystack.l_mark = yylval; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) /* lookahead position is error end position */ - yyerror_loc_range[1] = yylloc; + yyerror_loc_range[2] = yylloc; YYLLOC_DEFAULT(yyloc, yyerror_loc_range, 2); /* position of error span */ *++yystack.p_mark = yyloc; #endif @@ -1084,7 +1087,7 @@ yyinrecovery: if (yystack.s_mark <= yystack.s_base) goto yyabort; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) /* the current TOS position is the error start position */ - yyerror_loc_range[0] = *yystack.p_mark; + yyerror_loc_range[1] = *yystack.p_mark; #endif #if defined(YYDESTRUCT_CALL) #if YYBTYACC @@ -1170,10 +1173,10 @@ yyreduce: if (!yytrial) #endif /* YYBTYACC */ { - YYLLOC_DEFAULT(yyloc, &yystack.p_mark[1-yym], yym); + YYLLOC_DEFAULT(yyloc, &yystack.p_mark[-yym], yym); /* just in case YYERROR is invoked within the action, save the start of the rhs as the error start position */ - yyerror_loc_range[0] = yystack.p_mark[1-yym]; + yyerror_loc_range[1] = yystack.p_mark[1-yym]; } #endif @@ -1228,7 +1231,7 @@ case 9: #line 86 "btyacc_destroy2.y" { yyval.nlist = yystack.l_mark[-5].nlist; } break; -#line 1232 "btyacc_destroy2.tab.c" +#line 1235 "btyacc_destroy2.tab.c" default: break; } @@ -1283,12 +1286,12 @@ break; size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) + if ((yylexemes = (YYINT *)realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; - if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) + if ((yylvals = (YYSTYPE *)realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) + if ((yylpsns = (YYLTYPE *)realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; diff --git a/test/btyacc/btyacc_destroy3.tab.c b/test/btyacc/btyacc_destroy3.tab.c index c6b08b8be232..136f2f691a9b 100644 --- a/test/btyacc/btyacc_destroy3.tab.c +++ b/test/btyacc/btyacc_destroy3.tab.c @@ -357,13 +357,16 @@ static const char *const destroy3_rule[] = { }; #endif +#if YYDEBUG int yydebug; -int yynerrs; +#endif int yyerrflag; int yychar; YYSTYPE yyval; YYSTYPE yylval; +int yynerrs; + #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) YYLTYPE yyloc; /* position returned by actions */ YYLTYPE yylloc; /* position from the lexer */ @@ -376,17 +379,17 @@ do \ { \ if (n == 0) \ { \ - (loc).first_line = ((rhs)[-1]).last_line; \ - (loc).first_column = ((rhs)[-1]).last_column; \ - (loc).last_line = ((rhs)[-1]).last_line; \ - (loc).last_column = ((rhs)[-1]).last_column; \ + (loc).first_line = YYRHSLOC(rhs, 0).last_line; \ + (loc).first_column = YYRHSLOC(rhs, 0).last_column; \ + (loc).last_line = YYRHSLOC(rhs, 0).last_line; \ + (loc).last_column = YYRHSLOC(rhs, 0).last_column; \ } \ else \ { \ - (loc).first_line = ((rhs)[ 0 ]).first_line; \ - (loc).first_column = ((rhs)[ 0 ]).first_column; \ - (loc).last_line = ((rhs)[n-1]).last_line; \ - (loc).last_column = ((rhs)[n-1]).last_column; \ + (loc).first_line = YYRHSLOC(rhs, 1).first_line; \ + (loc).first_column = YYRHSLOC(rhs, 1).first_column; \ + (loc).last_line = YYRHSLOC(rhs, n).last_line; \ + (loc).last_column = YYRHSLOC(rhs, n).last_column; \ } \ } while (0) #endif /* YYLLOC_DEFAULT */ @@ -485,7 +488,7 @@ static YYINT *yylexemes = 0; extern int YYLEX_DECL(); extern void YYERROR_DECL(); -#line 489 "btyacc_destroy3.tab.c" +#line 492 "btyacc_destroy3.tab.c" /* Release memory associated with symbol. */ #if ! defined YYDESTRUCT_IS_DECLARED @@ -505,7 +508,7 @@ YYDESTRUCT_DECL() } } break; -#line 509 "btyacc_destroy3.tab.c" +#line 512 "btyacc_destroy3.tab.c" } } #define YYDESTRUCT_IS_DECLARED 1 @@ -648,7 +651,7 @@ YYPARSE_DECL() YYParseState *yyerrctx = NULL; #endif /* YYBTYACC */ #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - YYLTYPE yyerror_loc_range[2]; /* position of error start & end */ + YYLTYPE yyerror_loc_range[3]; /* position of error start/end (0 unused) */ #endif #if YYDEBUG const char *yys; @@ -715,10 +718,10 @@ yyloop: size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; - if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; + if ((yylexemes = (YYINT *)realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; + if ((yylvals = (YYSTYPE *)realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; + if ((yylpsns = (YYLTYPE *)realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; yylvlim = yylvals + s; @@ -829,7 +832,7 @@ yyloop: /* If this is a first conflict in the stack, start saving lexemes */ if (!yylexemes) { - yylexemes = malloc((YYLVQUEUEGROWTH) * sizeof(YYINT)); + yylexemes = (YYINT *) malloc((YYLVQUEUEGROWTH) * sizeof(YYINT)); if (yylexemes == NULL) goto yyenomem; yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE)); if (yylvals == NULL) goto yyenomem; @@ -1039,7 +1042,7 @@ yyerrhandler: YYERROR_CALL("syntax error"); #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - yyerror_loc_range[0] = yylloc; /* lookahead position is error start position */ + yyerror_loc_range[1] = yylloc; /* lookahead position is error start position */ #endif #if !YYBTYACC @@ -1068,7 +1071,7 @@ yyinrecovery: *++yystack.l_mark = yylval; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) /* lookahead position is error end position */ - yyerror_loc_range[1] = yylloc; + yyerror_loc_range[2] = yylloc; YYLLOC_DEFAULT(yyloc, yyerror_loc_range, 2); /* position of error span */ *++yystack.p_mark = yyloc; #endif @@ -1084,7 +1087,7 @@ yyinrecovery: if (yystack.s_mark <= yystack.s_base) goto yyabort; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) /* the current TOS position is the error start position */ - yyerror_loc_range[0] = *yystack.p_mark; + yyerror_loc_range[1] = *yystack.p_mark; #endif #if defined(YYDESTRUCT_CALL) #if YYBTYACC @@ -1170,10 +1173,10 @@ yyreduce: if (!yytrial) #endif /* YYBTYACC */ { - YYLLOC_DEFAULT(yyloc, &yystack.p_mark[1-yym], yym); + YYLLOC_DEFAULT(yyloc, &yystack.p_mark[-yym], yym); /* just in case YYERROR is invoked within the action, save the start of the rhs as the error start position */ - yyerror_loc_range[0] = yystack.p_mark[1-yym]; + yyerror_loc_range[1] = yystack.p_mark[1-yym]; } #endif @@ -1228,7 +1231,7 @@ case 9: #line 89 "btyacc_destroy3.y" { yyval.nlist = yystack.l_mark[-5].nlist; } break; -#line 1232 "btyacc_destroy3.tab.c" +#line 1235 "btyacc_destroy3.tab.c" default: break; } @@ -1283,12 +1286,12 @@ break; size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) + if ((yylexemes = (YYINT *)realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; - if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) + if ((yylvals = (YYSTYPE *)realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) + if ((yylpsns = (YYLTYPE *)realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; diff --git a/test/btyacc/calc.tab.c b/test/btyacc/calc.tab.c index 052c7ade4f17..eed4721a63ad 100644 --- a/test/btyacc/calc.tab.c +++ b/test/btyacc/calc.tab.c @@ -338,13 +338,16 @@ static const char *const calc_rule[] = { }; #endif +#if YYDEBUG int yydebug; -int yynerrs; +#endif int yyerrflag; int yychar; YYSTYPE yyval; YYSTYPE yylval; +int yynerrs; + #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) YYLTYPE yyloc; /* position returned by actions */ YYLTYPE yylloc; /* position from the lexer */ @@ -357,17 +360,17 @@ do \ { \ if (n == 0) \ { \ - (loc).first_line = ((rhs)[-1]).last_line; \ - (loc).first_column = ((rhs)[-1]).last_column; \ - (loc).last_line = ((rhs)[-1]).last_line; \ - (loc).last_column = ((rhs)[-1]).last_column; \ + (loc).first_line = YYRHSLOC(rhs, 0).last_line; \ + (loc).first_column = YYRHSLOC(rhs, 0).last_column; \ + (loc).last_line = YYRHSLOC(rhs, 0).last_line; \ + (loc).last_column = YYRHSLOC(rhs, 0).last_column; \ } \ else \ { \ - (loc).first_line = ((rhs)[ 0 ]).first_line; \ - (loc).first_column = ((rhs)[ 0 ]).first_column; \ - (loc).last_line = ((rhs)[n-1]).last_line; \ - (loc).last_column = ((rhs)[n-1]).last_column; \ + (loc).first_line = YYRHSLOC(rhs, 1).first_line; \ + (loc).first_column = YYRHSLOC(rhs, 1).first_column; \ + (loc).last_line = YYRHSLOC(rhs, n).last_line; \ + (loc).last_column = YYRHSLOC(rhs, n).last_column; \ } \ } while (0) #endif /* YYLLOC_DEFAULT */ @@ -504,7 +507,7 @@ yylex(void) } return( c ); } -#line 508 "calc.tab.c" +#line 511 "calc.tab.c" /* For use in generated program */ #define yydepth (int)(yystack.s_mark - yystack.s_base) @@ -643,7 +646,7 @@ YYPARSE_DECL() YYParseState *yyerrctx = NULL; #endif /* YYBTYACC */ #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - YYLTYPE yyerror_loc_range[2]; /* position of error start & end */ + YYLTYPE yyerror_loc_range[3]; /* position of error start/end (0 unused) */ #endif #if YYDEBUG const char *yys; @@ -710,10 +713,10 @@ yyloop: size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; - if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; + if ((yylexemes = (YYINT *)realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; + if ((yylvals = (YYSTYPE *)realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; + if ((yylpsns = (YYLTYPE *)realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; yylvlim = yylvals + s; @@ -824,7 +827,7 @@ yyloop: /* If this is a first conflict in the stack, start saving lexemes */ if (!yylexemes) { - yylexemes = malloc((YYLVQUEUEGROWTH) * sizeof(YYINT)); + yylexemes = (YYINT *) malloc((YYLVQUEUEGROWTH) * sizeof(YYINT)); if (yylexemes == NULL) goto yyenomem; yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE)); if (yylvals == NULL) goto yyenomem; @@ -1034,7 +1037,7 @@ yyerrhandler: YYERROR_CALL("syntax error"); #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - yyerror_loc_range[0] = yylloc; /* lookahead position is error start position */ + yyerror_loc_range[1] = yylloc; /* lookahead position is error start position */ #endif #if !YYBTYACC @@ -1063,7 +1066,7 @@ yyinrecovery: *++yystack.l_mark = yylval; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) /* lookahead position is error end position */ - yyerror_loc_range[1] = yylloc; + yyerror_loc_range[2] = yylloc; YYLLOC_DEFAULT(yyloc, yyerror_loc_range, 2); /* position of error span */ *++yystack.p_mark = yyloc; #endif @@ -1079,7 +1082,7 @@ yyinrecovery: if (yystack.s_mark <= yystack.s_base) goto yyabort; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) /* the current TOS position is the error start position */ - yyerror_loc_range[0] = *yystack.p_mark; + yyerror_loc_range[1] = *yystack.p_mark; #endif #if defined(YYDESTRUCT_CALL) #if YYBTYACC @@ -1165,10 +1168,10 @@ yyreduce: if (!yytrial) #endif /* YYBTYACC */ { - YYLLOC_DEFAULT(yyloc, &yystack.p_mark[1-yym], yym); + YYLLOC_DEFAULT(yyloc, &yystack.p_mark[-yym], yym); /* just in case YYERROR is invoked within the action, save the start of the rhs as the error start position */ - yyerror_loc_range[0] = yystack.p_mark[1-yym]; + yyerror_loc_range[1] = yystack.p_mark[1-yym]; } #endif @@ -1234,7 +1237,7 @@ case 18: #line 63 "calc.y" { yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; } break; -#line 1238 "calc.tab.c" +#line 1241 "calc.tab.c" default: break; } @@ -1289,12 +1292,12 @@ break; size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) + if ((yylexemes = (YYINT *)realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; - if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) + if ((yylvals = (YYSTYPE *)realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) + if ((yylpsns = (YYLTYPE *)realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; diff --git a/test/btyacc/calc1.tab.c b/test/btyacc/calc1.tab.c index 27731448cb88..b919f8c2d3f0 100644 --- a/test/btyacc/calc1.tab.c +++ b/test/btyacc/calc1.tab.c @@ -393,13 +393,16 @@ static const char *const calc1_rule[] = { }; #endif +#if YYDEBUG int yydebug; -int yynerrs; +#endif int yyerrflag; int yychar; YYSTYPE yyval; YYSTYPE yylval; +int yynerrs; + #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) YYLTYPE yyloc; /* position returned by actions */ YYLTYPE yylloc; /* position from the lexer */ @@ -412,17 +415,17 @@ do \ { \ if (n == 0) \ { \ - (loc).first_line = ((rhs)[-1]).last_line; \ - (loc).first_column = ((rhs)[-1]).last_column; \ - (loc).last_line = ((rhs)[-1]).last_line; \ - (loc).last_column = ((rhs)[-1]).last_column; \ + (loc).first_line = YYRHSLOC(rhs, 0).last_line; \ + (loc).first_column = YYRHSLOC(rhs, 0).last_column; \ + (loc).last_line = YYRHSLOC(rhs, 0).last_line; \ + (loc).last_column = YYRHSLOC(rhs, 0).last_column; \ } \ else \ { \ - (loc).first_line = ((rhs)[ 0 ]).first_line; \ - (loc).first_column = ((rhs)[ 0 ]).first_column; \ - (loc).last_line = ((rhs)[n-1]).last_line; \ - (loc).last_column = ((rhs)[n-1]).last_column; \ + (loc).first_line = YYRHSLOC(rhs, 1).first_line; \ + (loc).first_column = YYRHSLOC(rhs, 1).first_column; \ + (loc).last_line = YYRHSLOC(rhs, n).last_line; \ + (loc).last_column = YYRHSLOC(rhs, n).last_column; \ } \ } while (0) #endif /* YYLLOC_DEFAULT */ @@ -648,7 +651,7 @@ vdiv(double a, double b, INTERVAL v) { return (hilo(a / v.hi, a / v.lo, b / v.hi, b / v.lo)); } -#line 652 "calc1.tab.c" +#line 655 "calc1.tab.c" /* For use in generated program */ #define yydepth (int)(yystack.s_mark - yystack.s_base) @@ -787,7 +790,7 @@ YYPARSE_DECL() YYParseState *yyerrctx = NULL; #endif /* YYBTYACC */ #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - YYLTYPE yyerror_loc_range[2]; /* position of error start & end */ + YYLTYPE yyerror_loc_range[3]; /* position of error start/end (0 unused) */ #endif #if YYDEBUG const char *yys; @@ -854,10 +857,10 @@ yyloop: size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; - if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; + if ((yylexemes = (YYINT *)realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; + if ((yylvals = (YYSTYPE *)realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; + if ((yylpsns = (YYLTYPE *)realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; yylvlim = yylvals + s; @@ -968,7 +971,7 @@ yyloop: /* If this is a first conflict in the stack, start saving lexemes */ if (!yylexemes) { - yylexemes = malloc((YYLVQUEUEGROWTH) * sizeof(YYINT)); + yylexemes = (YYINT *) malloc((YYLVQUEUEGROWTH) * sizeof(YYINT)); if (yylexemes == NULL) goto yyenomem; yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE)); if (yylvals == NULL) goto yyenomem; @@ -1178,7 +1181,7 @@ yyerrhandler: YYERROR_CALL("syntax error"); #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - yyerror_loc_range[0] = yylloc; /* lookahead position is error start position */ + yyerror_loc_range[1] = yylloc; /* lookahead position is error start position */ #endif #if !YYBTYACC @@ -1207,7 +1210,7 @@ yyinrecovery: *++yystack.l_mark = yylval; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) /* lookahead position is error end position */ - yyerror_loc_range[1] = yylloc; + yyerror_loc_range[2] = yylloc; YYLLOC_DEFAULT(yyloc, yyerror_loc_range, 2); /* position of error span */ *++yystack.p_mark = yyloc; #endif @@ -1223,7 +1226,7 @@ yyinrecovery: if (yystack.s_mark <= yystack.s_base) goto yyabort; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) /* the current TOS position is the error start position */ - yyerror_loc_range[0] = *yystack.p_mark; + yyerror_loc_range[1] = *yystack.p_mark; #endif #if defined(YYDESTRUCT_CALL) #if YYBTYACC @@ -1309,10 +1312,10 @@ yyreduce: if (!yytrial) #endif /* YYBTYACC */ { - YYLLOC_DEFAULT(yyloc, &yystack.p_mark[1-yym], yym); + YYLLOC_DEFAULT(yyloc, &yystack.p_mark[-yym], yym); /* just in case YYERROR is invoked within the action, save the start of the rhs as the error start position */ - yyerror_loc_range[0] = yystack.p_mark[1-yym]; + yyerror_loc_range[1] = yystack.p_mark[1-yym]; } #endif @@ -1481,7 +1484,7 @@ case 28: yyval.vval = yystack.l_mark[-1].vval; } break; -#line 1485 "calc1.tab.c" +#line 1488 "calc1.tab.c" default: break; } @@ -1536,12 +1539,12 @@ break; size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) + if ((yylexemes = (YYINT *)realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; - if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) + if ((yylvals = (YYSTYPE *)realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) + if ((yylpsns = (YYLTYPE *)realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; diff --git a/test/btyacc/calc2.tab.c b/test/btyacc/calc2.tab.c index 4b4550d577db..3d83628d2fa9 100644 --- a/test/btyacc/calc2.tab.c +++ b/test/btyacc/calc2.tab.c @@ -340,13 +340,16 @@ static const char *const calc2_rule[] = { }; #endif +#if YYDEBUG int yydebug; -int yynerrs; +#endif int yyerrflag; int yychar; YYSTYPE yyval; YYSTYPE yylval; +int yynerrs; + #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) YYLTYPE yyloc; /* position returned by actions */ YYLTYPE yylloc; /* position from the lexer */ @@ -359,17 +362,17 @@ do \ { \ if (n == 0) \ { \ - (loc).first_line = ((rhs)[-1]).last_line; \ - (loc).first_column = ((rhs)[-1]).last_column; \ - (loc).last_line = ((rhs)[-1]).last_line; \ - (loc).last_column = ((rhs)[-1]).last_column; \ + (loc).first_line = YYRHSLOC(rhs, 0).last_line; \ + (loc).first_column = YYRHSLOC(rhs, 0).last_column; \ + (loc).last_line = YYRHSLOC(rhs, 0).last_line; \ + (loc).last_column = YYRHSLOC(rhs, 0).last_column; \ } \ else \ { \ - (loc).first_line = ((rhs)[ 0 ]).first_line; \ - (loc).first_column = ((rhs)[ 0 ]).first_column; \ - (loc).last_line = ((rhs)[n-1]).last_line; \ - (loc).last_column = ((rhs)[n-1]).last_column; \ + (loc).first_line = YYRHSLOC(rhs, 1).first_line; \ + (loc).first_column = YYRHSLOC(rhs, 1).first_column; \ + (loc).last_line = YYRHSLOC(rhs, n).last_line; \ + (loc).last_column = YYRHSLOC(rhs, n).last_column; \ } \ } while (0) #endif /* YYLLOC_DEFAULT */ @@ -517,7 +520,7 @@ YYLEX_DECL() } return( c ); } -#line 521 "calc2.tab.c" +#line 524 "calc2.tab.c" /* For use in generated program */ #define yydepth (int)(yystack.s_mark - yystack.s_base) @@ -656,7 +659,7 @@ YYPARSE_DECL() YYParseState *yyerrctx = NULL; #endif /* YYBTYACC */ #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - YYLTYPE yyerror_loc_range[2]; /* position of error start & end */ + YYLTYPE yyerror_loc_range[3]; /* position of error start/end (0 unused) */ #endif #if YYDEBUG const char *yys; @@ -723,10 +726,10 @@ yyloop: size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; - if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; + if ((yylexemes = (YYINT *)realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; + if ((yylvals = (YYSTYPE *)realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; + if ((yylpsns = (YYLTYPE *)realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; yylvlim = yylvals + s; @@ -837,7 +840,7 @@ yyloop: /* If this is a first conflict in the stack, start saving lexemes */ if (!yylexemes) { - yylexemes = malloc((YYLVQUEUEGROWTH) * sizeof(YYINT)); + yylexemes = (YYINT *) malloc((YYLVQUEUEGROWTH) * sizeof(YYINT)); if (yylexemes == NULL) goto yyenomem; yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE)); if (yylvals == NULL) goto yyenomem; @@ -1047,7 +1050,7 @@ yyerrhandler: YYERROR_CALL("syntax error"); #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - yyerror_loc_range[0] = yylloc; /* lookahead position is error start position */ + yyerror_loc_range[1] = yylloc; /* lookahead position is error start position */ #endif #if !YYBTYACC @@ -1076,7 +1079,7 @@ yyinrecovery: *++yystack.l_mark = yylval; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) /* lookahead position is error end position */ - yyerror_loc_range[1] = yylloc; + yyerror_loc_range[2] = yylloc; YYLLOC_DEFAULT(yyloc, yyerror_loc_range, 2); /* position of error span */ *++yystack.p_mark = yyloc; #endif @@ -1092,7 +1095,7 @@ yyinrecovery: if (yystack.s_mark <= yystack.s_base) goto yyabort; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) /* the current TOS position is the error start position */ - yyerror_loc_range[0] = *yystack.p_mark; + yyerror_loc_range[1] = *yystack.p_mark; #endif #if defined(YYDESTRUCT_CALL) #if YYBTYACC @@ -1178,10 +1181,10 @@ yyreduce: if (!yytrial) #endif /* YYBTYACC */ { - YYLLOC_DEFAULT(yyloc, &yystack.p_mark[1-yym], yym); + YYLLOC_DEFAULT(yyloc, &yystack.p_mark[-yym], yym); /* just in case YYERROR is invoked within the action, save the start of the rhs as the error start position */ - yyerror_loc_range[0] = yystack.p_mark[1-yym]; + yyerror_loc_range[1] = yystack.p_mark[1-yym]; } #endif @@ -1247,7 +1250,7 @@ case 18: #line 70 "calc2.y" { yyval = (*base) * yystack.l_mark[-1] + yystack.l_mark[0]; } break; -#line 1251 "calc2.tab.c" +#line 1254 "calc2.tab.c" default: break; } @@ -1302,12 +1305,12 @@ break; size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) + if ((yylexemes = (YYINT *)realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; - if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) + if ((yylvals = (YYSTYPE *)realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) + if ((yylpsns = (YYLTYPE *)realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; diff --git a/test/btyacc/calc3.tab.c b/test/btyacc/calc3.tab.c index 199c245361a2..ad4aa5b21546 100644 --- a/test/btyacc/calc3.tab.c +++ b/test/btyacc/calc3.tab.c @@ -345,8 +345,9 @@ static const char *const calc3_rule[] = { }; #endif +#if YYDEBUG int yydebug; -int yynerrs; +#endif #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) #ifndef YYLLOC_DEFAULT @@ -355,17 +356,17 @@ do \ { \ if (n == 0) \ { \ - (loc).first_line = ((rhs)[-1]).last_line; \ - (loc).first_column = ((rhs)[-1]).last_column; \ - (loc).last_line = ((rhs)[-1]).last_line; \ - (loc).last_column = ((rhs)[-1]).last_column; \ + (loc).first_line = YYRHSLOC(rhs, 0).last_line; \ + (loc).first_column = YYRHSLOC(rhs, 0).last_column; \ + (loc).last_line = YYRHSLOC(rhs, 0).last_line; \ + (loc).last_column = YYRHSLOC(rhs, 0).last_column; \ } \ else \ { \ - (loc).first_line = ((rhs)[ 0 ]).first_line; \ - (loc).first_column = ((rhs)[ 0 ]).first_column; \ - (loc).last_line = ((rhs)[n-1]).last_line; \ - (loc).last_column = ((rhs)[n-1]).last_column; \ + (loc).first_line = YYRHSLOC(rhs, 1).first_line; \ + (loc).first_column = YYRHSLOC(rhs, 1).first_column; \ + (loc).last_line = YYRHSLOC(rhs, n).last_line; \ + (loc).last_column = YYRHSLOC(rhs, n).last_column; \ } \ } while (0) #endif /* YYLLOC_DEFAULT */ @@ -472,7 +473,7 @@ YYLEX_DECL() } return( c ); } -#line 476 "calc3.tab.c" +#line 477 "calc3.tab.c" /* For use in generated program */ #define yydepth (int)(yystack.s_mark - yystack.s_base) @@ -609,6 +610,8 @@ YYPARSE_DECL() int yychar; YYSTYPE yyval; YYSTYPE yylval; + int yynerrs; + #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) YYLTYPE yyloc; /* position returned by actions */ YYLTYPE yylloc; /* position from the lexer */ @@ -661,7 +664,7 @@ YYPARSE_DECL() YYParseState *yyerrctx = NULL; #endif /* YYBTYACC */ #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - YYLTYPE yyerror_loc_range[2]; /* position of error start & end */ + YYLTYPE yyerror_loc_range[3]; /* position of error start/end (0 unused) */ #endif #if YYDEBUG const char *yys; @@ -737,10 +740,10 @@ yyloop: size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; - if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; + if ((yylexemes = (YYINT *)realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; + if ((yylvals = (YYSTYPE *)realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; + if ((yylpsns = (YYLTYPE *)realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; yylvlim = yylvals + s; @@ -851,7 +854,7 @@ yyloop: /* If this is a first conflict in the stack, start saving lexemes */ if (!yylexemes) { - yylexemes = malloc((YYLVQUEUEGROWTH) * sizeof(YYINT)); + yylexemes = (YYINT *) malloc((YYLVQUEUEGROWTH) * sizeof(YYINT)); if (yylexemes == NULL) goto yyenomem; yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE)); if (yylvals == NULL) goto yyenomem; @@ -1061,7 +1064,7 @@ yyerrhandler: YYERROR_CALL("syntax error"); #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - yyerror_loc_range[0] = yylloc; /* lookahead position is error start position */ + yyerror_loc_range[1] = yylloc; /* lookahead position is error start position */ #endif #if !YYBTYACC @@ -1090,7 +1093,7 @@ yyinrecovery: *++yystack.l_mark = yylval; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) /* lookahead position is error end position */ - yyerror_loc_range[1] = yylloc; + yyerror_loc_range[2] = yylloc; YYLLOC_DEFAULT(yyloc, yyerror_loc_range, 2); /* position of error span */ *++yystack.p_mark = yyloc; #endif @@ -1106,7 +1109,7 @@ yyinrecovery: if (yystack.s_mark <= yystack.s_base) goto yyabort; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) /* the current TOS position is the error start position */ - yyerror_loc_range[0] = *yystack.p_mark; + yyerror_loc_range[1] = *yystack.p_mark; #endif #if defined(YYDESTRUCT_CALL) #if YYBTYACC @@ -1192,10 +1195,10 @@ yyreduce: if (!yytrial) #endif /* YYBTYACC */ { - YYLLOC_DEFAULT(yyloc, &yystack.p_mark[1-yym], yym); + YYLLOC_DEFAULT(yyloc, &yystack.p_mark[-yym], yym); /* just in case YYERROR is invoked within the action, save the start of the rhs as the error start position */ - yyerror_loc_range[0] = yystack.p_mark[1-yym]; + yyerror_loc_range[1] = yystack.p_mark[1-yym]; } #endif @@ -1261,7 +1264,7 @@ case 18: #line 73 "calc3.y" { yyval = (*base) * yystack.l_mark[-1] + yystack.l_mark[0]; } break; -#line 1265 "calc3.tab.c" +#line 1268 "calc3.tab.c" default: break; } @@ -1316,12 +1319,12 @@ break; size_t s = (size_t) (yylvlim - yylvals); s += YYLVQUEUEGROWTH; - if ((yylexemes = realloc(yylexemes, s * sizeof(YYINT))) == NULL) + if ((yylexemes = (YYINT *)realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; - if ((yylvals = realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) + if ((yylvals = (YYSTYPE *)realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; #if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) - if ((yylpsns = realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) + if ((yylpsns = (YYLTYPE *)realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; #endif yylvp = yylve = yylvals + p; diff --git a/test/btyacc/btyacc_demo2.output b/test/btyacc/calc_code_all.error index e69de29bb2d1..e69de29bb2d1 100644 --- a/test/btyacc/btyacc_demo2.output +++ b/test/btyacc/calc_code_all.error diff --git a/test/btyacc/calc_code_all.output b/test/btyacc/calc_code_all.output new file mode 100644 index 000000000000..c689eec0535a --- /dev/null +++ b/test/btyacc/calc_code_all.output @@ -0,0 +1,485 @@ + 0 $accept : list $end + + 1 list : + 2 | list stat '\n' + 3 | list error '\n' + + 4 stat : expr + 5 | LETTER '=' expr + + 6 expr : '(' expr ')' + 7 | expr '+' expr + 8 | expr '-' expr + 9 | expr '*' expr + 10 | expr '/' expr + 11 | expr '%' expr + 12 | expr '&' expr + 13 | expr '|' expr + 14 | '-' expr + 15 | LETTER + 16 | number + + 17 number : DIGIT + 18 | number DIGIT + +state 0 + $accept : . list $end (0) + list : . (1) + + . reduce 1 + + list goto 1 + + +state 1 + $accept : list . $end (0) + list : list . stat '\n' (2) + list : list . error '\n' (3) + + $end accept + error shift 2 + DIGIT shift 3 + LETTER shift 4 + '-' shift 5 + '(' shift 6 + . error + + stat goto 7 + expr goto 8 + number goto 9 + + +state 2 + list : list error . '\n' (3) + + '\n' shift 10 + . error + + +state 3 + number : DIGIT . (17) + + . reduce 17 + + +state 4 + stat : LETTER . '=' expr (5) + expr : LETTER . (15) + + '=' shift 11 + '|' reduce 15 + '&' reduce 15 + '+' reduce 15 + '-' reduce 15 + '*' reduce 15 + '/' reduce 15 + '%' reduce 15 + '\n' reduce 15 + + +state 5 + expr : '-' . expr (14) + + DIGIT shift 3 + LETTER shift 12 + '-' shift 5 + '(' shift 6 + . error + + expr goto 13 + number goto 9 + + +state 6 + expr : '(' . expr ')' (6) + + DIGIT shift 3 + LETTER shift 12 + '-' shift 5 + '(' shift 6 + . error + + expr goto 14 + number goto 9 + + +state 7 + list : list stat . '\n' (2) + + '\n' shift 15 + . error + + +state 8 + stat : expr . (4) + expr : expr . '+' expr (7) + expr : expr . '-' expr (8) + expr : expr . '*' expr (9) + expr : expr . '/' expr (10) + expr : expr . '%' expr (11) + expr : expr . '&' expr (12) + expr : expr . '|' expr (13) + + '|' shift 16 + '&' shift 17 + '+' shift 18 + '-' shift 19 + '*' shift 20 + '/' shift 21 + '%' shift 22 + '\n' reduce 4 + + +state 9 + expr : number . (16) + number : number . DIGIT (18) + + DIGIT shift 23 + '|' reduce 16 + '&' reduce 16 + '+' reduce 16 + '-' reduce 16 + '*' reduce 16 + '/' reduce 16 + '%' reduce 16 + '\n' reduce 16 + ')' reduce 16 + + +state 10 + list : list error '\n' . (3) + + . reduce 3 + + +state 11 + stat : LETTER '=' . expr (5) + + DIGIT shift 3 + LETTER shift 12 + '-' shift 5 + '(' shift 6 + . error + + expr goto 24 + number goto 9 + + +state 12 + expr : LETTER . (15) + + . reduce 15 + + +state 13 + expr : expr . '+' expr (7) + expr : expr . '-' expr (8) + expr : expr . '*' expr (9) + expr : expr . '/' expr (10) + expr : expr . '%' expr (11) + expr : expr . '&' expr (12) + expr : expr . '|' expr (13) + expr : '-' expr . (14) + + . reduce 14 + + +state 14 + expr : '(' expr . ')' (6) + expr : expr . '+' expr (7) + expr : expr . '-' expr (8) + expr : expr . '*' expr (9) + expr : expr . '/' expr (10) + expr : expr . '%' expr (11) + expr : expr . '&' expr (12) + expr : expr . '|' expr (13) + + '|' shift 16 + '&' shift 17 + '+' shift 18 + '-' shift 19 + '*' shift 20 + '/' shift 21 + '%' shift 22 + ')' shift 25 + . error + + +state 15 + list : list stat '\n' . (2) + + . reduce 2 + + +state 16 + expr : expr '|' . expr (13) + + DIGIT shift 3 + LETTER shift 12 + '-' shift 5 + '(' shift 6 + . error + + expr goto 26 + number goto 9 + + +state 17 + expr : expr '&' . expr (12) + + DIGIT shift 3 + LETTER shift 12 + '-' shift 5 + '(' shift 6 + . error + + expr goto 27 + number goto 9 + + +state 18 + expr : expr '+' . expr (7) + + DIGIT shift 3 + LETTER shift 12 + '-' shift 5 + '(' shift 6 + . error + + expr goto 28 + number goto 9 + + +state 19 + expr : expr '-' . expr (8) + + DIGIT shift 3 + LETTER shift 12 + '-' shift 5 + '(' shift 6 + . error + + expr goto 29 + number goto 9 + + +state 20 + expr : expr '*' . expr (9) + + DIGIT shift 3 + LETTER shift 12 + '-' shift 5 + '(' shift 6 + . error + + expr goto 30 + number goto 9 + + +state 21 + expr : expr '/' . expr (10) + + DIGIT shift 3 + LETTER shift 12 + '-' shift 5 + '(' shift 6 + . error + + expr goto 31 + number goto 9 + + +state 22 + expr : expr '%' . expr (11) + + DIGIT shift 3 + LETTER shift 12 + '-' shift 5 + '(' shift 6 + . error + + expr goto 32 + number goto 9 + + +state 23 + number : number DIGIT . (18) + + . reduce 18 + + +state 24 + stat : LETTER '=' expr . (5) + expr : expr . '+' expr (7) + expr : expr . '-' expr (8) + expr : expr . '*' expr (9) + expr : expr . '/' expr (10) + expr : expr . '%' expr (11) + expr : expr . '&' expr (12) + expr : expr . '|' expr (13) + + '|' shift 16 + '&' shift 17 + '+' shift 18 + '-' shift 19 + '*' shift 20 + '/' shift 21 + '%' shift 22 + '\n' reduce 5 + + +state 25 + expr : '(' expr ')' . (6) + + . reduce 6 + + +state 26 + expr : expr . '+' expr (7) + expr : expr . '-' expr (8) + expr : expr . '*' expr (9) + expr : expr . '/' expr (10) + expr : expr . '%' expr (11) + expr : expr . '&' expr (12) + expr : expr . '|' expr (13) + expr : expr '|' expr . (13) + + '&' shift 17 + '+' shift 18 + '-' shift 19 + '*' shift 20 + '/' shift 21 + '%' shift 22 + '|' reduce 13 + '\n' reduce 13 + ')' reduce 13 + + +state 27 + expr : expr . '+' expr (7) + expr : expr . '-' expr (8) + expr : expr . '*' expr (9) + expr : expr . '/' expr (10) + expr : expr . '%' expr (11) + expr : expr . '&' expr (12) + expr : expr '&' expr . (12) + expr : expr . '|' expr (13) + + '+' shift 18 + '-' shift 19 + '*' shift 20 + '/' shift 21 + '%' shift 22 + '|' reduce 12 + '&' reduce 12 + '\n' reduce 12 + ')' reduce 12 + + +state 28 + expr : expr . '+' expr (7) + expr : expr '+' expr . (7) + expr : expr . '-' expr (8) + expr : expr . '*' expr (9) + expr : expr . '/' expr (10) + expr : expr . '%' expr (11) + expr : expr . '&' expr (12) + expr : expr . '|' expr (13) + + '*' shift 20 + '/' shift 21 + '%' shift 22 + '|' reduce 7 + '&' reduce 7 + '+' reduce 7 + '-' reduce 7 + '\n' reduce 7 + ')' reduce 7 + + +state 29 + expr : expr . '+' expr (7) + expr : expr . '-' expr (8) + expr : expr '-' expr . (8) + expr : expr . '*' expr (9) + expr : expr . '/' expr (10) + expr : expr . '%' expr (11) + expr : expr . '&' expr (12) + expr : expr . '|' expr (13) + + '*' shift 20 + '/' shift 21 + '%' shift 22 + '|' reduce 8 + '&' reduce 8 + '+' reduce 8 + '-' reduce 8 + '\n' reduce 8 + ')' reduce 8 + + +state 30 + expr : expr . '+' expr (7) + expr : expr . '-' expr (8) + expr : expr . '*' expr (9) + expr : expr '*' expr . (9) + expr : expr . '/' expr (10) + expr : expr . '%' expr (11) + expr : expr . '&' expr (12) + expr : expr . '|' expr (13) + + . reduce 9 + + +state 31 + expr : expr . '+' expr (7) + expr : expr . '-' expr (8) + expr : expr . '*' expr (9) + expr : expr . '/' expr (10) + expr : expr '/' expr . (10) + expr : expr . '%' expr (11) + expr : expr . '&' expr (12) + expr : expr . '|' expr (13) + + . reduce 10 + + +state 32 + expr : expr . '+' expr (7) + expr : expr . '-' expr (8) + expr : expr . '*' expr (9) + expr : expr . '/' expr (10) + expr : expr . '%' expr (11) + expr : expr '%' expr . (11) + expr : expr . '&' expr (12) + expr : expr . '|' expr (13) + + . reduce 11 + + +16 terminals, 5 nonterminals +19 grammar rules, 33 states + +grammar parser grammar +symbol# value# symbol + 0 0 $end + 1 256 error + 2 257 DIGIT + 3 258 LETTER + 4 124 '|' + 5 38 '&' + 6 43 '+' + 7 45 '-' + 8 42 '*' + 9 47 '/' + 10 37 '%' + 11 259 UMINUS + 12 10 '\n' + 13 61 '=' + 14 40 '(' + 15 41 ')' + 16 260 $accept + 17 261 list + 18 262 stat + 19 263 expr + 20 264 number diff --git a/test/btyacc/calc_code_all.tab.c b/test/btyacc/calc_code_all.tab.c new file mode 100644 index 000000000000..5f8b705e21e5 --- /dev/null +++ b/test/btyacc/calc_code_all.tab.c @@ -0,0 +1,1502 @@ +/* original parser id follows */ +/* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */ +/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */ + +#define YYBYACC 1 +#define YYMAJOR 1 +#define YYMINOR 9 +#define YYCHECK "yyyymmdd" + +#define YYEMPTY (-1) +#define yyclearin (yychar = YYEMPTY) +#define yyerrok (yyerrflag = 0) +#define YYRECOVERING() (yyerrflag != 0) +#define YYENOMEM (-2) +#define YYEOF 0 + +/* %code "top" block start */ +#line 5 "calc_code_all.y" +/* CODE-TOP */ +/* %code "top" block end */ +#line 22 "calc_code_all.tab.c" +#undef YYBTYACC +#define YYBTYACC 0 +#define YYDEBUGSTR YYPREFIX "debug" + +#ifndef yyparse +#define yyparse calc_code_all_parse +#endif /* yyparse */ + +#ifndef yylex +#define yylex calc_code_all_lex +#endif /* yylex */ + +#ifndef yyerror +#define yyerror calc_code_all_error +#endif /* yyerror */ + +#ifndef yychar +#define yychar calc_code_all_char +#endif /* yychar */ + +#ifndef yyval +#define yyval calc_code_all_val +#endif /* yyval */ + +#ifndef yylval +#define yylval calc_code_all_lval +#endif /* yylval */ + +#ifndef yydebug +#define yydebug calc_code_all_debug +#endif /* yydebug */ + +#ifndef yynerrs +#define yynerrs calc_code_all_nerrs +#endif /* yynerrs */ + +#ifndef yyerrflag +#define yyerrflag calc_code_all_errflag +#endif /* yyerrflag */ + +#ifndef yylhs +#define yylhs calc_code_all_lhs +#endif /* yylhs */ + +#ifndef yylen +#define yylen calc_code_all_len +#endif /* yylen */ + +#ifndef yydefred +#define yydefred calc_code_all_defred +#endif /* yydefred */ + +#ifndef yystos +#define yystos calc_code_all_stos +#endif /* yystos */ + +#ifndef yydgoto +#define yydgoto calc_code_all_dgoto +#endif /* yydgoto */ + +#ifndef yysindex +#define yysindex calc_code_all_sindex +#endif /* yysindex */ + +#ifndef yyrindex +#define yyrindex calc_code_all_rindex +#endif /* yyrindex */ + +#ifndef yygindex +#define yygindex calc_code_all_gindex +#endif /* yygindex */ + +#ifndef yytable +#define yytable calc_code_all_table +#endif /* yytable */ + +#ifndef yycheck +#define yycheck calc_code_all_check +#endif /* yycheck */ + +#ifndef yyname +#define yyname calc_code_all_name +#endif /* yyname */ + +#ifndef yyrule +#define yyrule calc_code_all_rule +#endif /* yyrule */ + +#if YYBTYACC + +#ifndef yycindex +#define yycindex calc_code_all_cindex +#endif /* yycindex */ + +#ifndef yyctable +#define yyctable calc_code_all_ctable +#endif /* yyctable */ + +#endif /* YYBTYACC */ + +#define YYPREFIX "calc_code_all_" + +#define YYPURE 0 + +#line 9 "calc_code_all.y" +# include <stdio.h> +# include <ctype.h> + +int regs[26]; +int base; + +extern int yylex(void); +static void yyerror(const char *s); + +#line 137 "calc_code_all.tab.c" + +#if ! defined(YYSTYPE) && ! defined(YYSTYPE_IS_DECLARED) +/* Default: YYSTYPE is the semantic value type. */ +typedef int YYSTYPE; +# define YYSTYPE_IS_DECLARED 1 +#endif + +/* compatibility with bison */ +#ifdef YYPARSE_PARAM +/* compatibility with FreeBSD */ +# ifdef YYPARSE_PARAM_TYPE +# define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM) +# else +# define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM) +# endif +#else +# define YYPARSE_DECL() yyparse(void) +#endif + +/* Parameters sent to lex. */ +#ifdef YYLEX_PARAM +# define YYLEX_DECL() yylex(void *YYLEX_PARAM) +# define YYLEX yylex(YYLEX_PARAM) +#else +# define YYLEX_DECL() yylex(void) +# define YYLEX yylex() +#endif + +/* Parameters sent to yyerror. */ +#ifndef YYERROR_DECL +#define YYERROR_DECL() yyerror(const char *s) +#endif +#ifndef YYERROR_CALL +#define YYERROR_CALL(msg) yyerror(msg) +#endif + +extern int YYPARSE_DECL(); + +#define DIGIT 257 +#define LETTER 258 +#define UMINUS 259 +#define YYERRCODE 256 +typedef short YYINT; +static const YYINT calc_code_all_lhs[] = { -1, + 0, 0, 0, 1, 1, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 3, 3, +}; +static const YYINT calc_code_all_len[] = { 2, + 0, 3, 3, 1, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 2, 1, 1, 1, 2, +}; +static const YYINT calc_code_all_defred[] = { 1, + 0, 0, 17, 0, 0, 0, 0, 0, 0, 3, + 0, 15, 14, 0, 2, 0, 0, 0, 0, 0, + 0, 0, 18, 0, 6, 0, 0, 0, 0, 9, + 10, 11, +}; +#if defined(YYDESTRUCT_CALL) || defined(YYSTYPE_TOSTRING) +static const YYINT calc_code_all_stos[] = { 0, + 261, 256, 257, 258, 45, 40, 262, 263, 264, 10, + 61, 258, 263, 263, 10, 124, 38, 43, 45, 42, + 47, 37, 257, 263, 41, 263, 263, 263, 263, 263, + 263, 263, +}; +#endif /* YYDESTRUCT_CALL || YYSTYPE_TOSTRING */ +static const YYINT calc_code_all_dgoto[] = { 1, + 7, 8, 9, +}; +static const YYINT calc_code_all_sindex[] = { 0, + -40, -7, 0, -55, -38, -38, 1, -29, -247, 0, + -38, 0, 0, 22, 0, -38, -38, -38, -38, -38, + -38, -38, 0, -29, 0, 51, 60, -20, -20, 0, + 0, 0, +}; +static const YYINT calc_code_all_rindex[] = { 0, + 0, 0, 0, 2, 0, 0, 0, 9, -9, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 10, 0, -6, 14, 5, 13, 0, + 0, 0, +}; +#if YYBTYACC +static const YYINT calc_code_all_cindex[] = { 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, +}; +#endif +static const YYINT calc_code_all_gindex[] = { 0, + 0, 65, 0, +}; +#define YYTABLESIZE 220 +static const YYINT calc_code_all_table[] = { 6, + 16, 6, 10, 13, 5, 11, 5, 22, 17, 23, + 15, 15, 20, 18, 7, 19, 22, 21, 4, 5, + 0, 20, 8, 12, 0, 0, 21, 16, 16, 0, + 0, 16, 16, 16, 13, 16, 0, 16, 15, 15, + 0, 0, 7, 15, 15, 7, 15, 7, 15, 7, + 8, 12, 0, 8, 12, 8, 0, 8, 22, 17, + 0, 0, 25, 20, 18, 0, 19, 0, 21, 13, + 14, 0, 0, 0, 0, 24, 0, 0, 0, 0, + 26, 27, 28, 29, 30, 31, 32, 22, 17, 0, + 0, 0, 20, 18, 16, 19, 22, 21, 0, 0, + 0, 20, 18, 0, 19, 0, 21, 0, 0, 0, + 0, 0, 0, 0, 16, 0, 0, 13, 0, 0, + 0, 0, 0, 0, 0, 15, 0, 0, 7, 0, + 0, 0, 0, 0, 0, 0, 8, 12, 0, 0, + 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 2, 3, 4, 3, 12, +}; +static const YYINT calc_code_all_check[] = { 40, + 10, 40, 10, 10, 45, 61, 45, 37, 38, 257, + 10, 10, 42, 43, 10, 45, 37, 47, 10, 10, + -1, 42, 10, 10, -1, -1, 47, 37, 38, -1, + -1, 41, 42, 43, 41, 45, -1, 47, 37, 38, + -1, -1, 38, 42, 43, 41, 45, 43, 47, 45, + 38, 38, -1, 41, 41, 43, -1, 45, 37, 38, + -1, -1, 41, 42, 43, -1, 45, -1, 47, 5, + 6, -1, -1, -1, -1, 11, -1, -1, -1, -1, + 16, 17, 18, 19, 20, 21, 22, 37, 38, -1, + -1, -1, 42, 43, 124, 45, 37, 47, -1, -1, + -1, 42, 43, -1, 45, -1, 47, -1, -1, -1, + -1, -1, -1, -1, 124, -1, -1, 124, -1, -1, + -1, -1, -1, -1, -1, 124, -1, -1, 124, -1, + -1, -1, -1, -1, -1, -1, 124, 124, -1, -1, + -1, -1, -1, -1, -1, 124, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 256, 257, 258, 257, 258, +}; +#if YYBTYACC +static const YYINT calc_code_all_ctable[] = { -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, +}; +#endif +#define YYFINAL 1 +#ifndef YYDEBUG +#define YYDEBUG 0 +#endif +#define YYMAXTOKEN 259 +#define YYUNDFTOKEN 265 +#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a)) +#if YYDEBUG +static const char *const calc_code_all_name[] = { + +"$end",0,0,0,0,0,0,0,0,0,"'\\n'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,"'%'","'&'",0,"'('","')'","'*'","'+'",0,"'-'",0,"'/'",0,0,0,0,0,0,0,0,0,0, +0,0,0,"'='",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"'|'",0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,"error","DIGIT","LETTER","UMINUS","$accept","list","stat","expr","number", +"illegal-symbol", +}; +static const char *const calc_code_all_rule[] = { +"$accept : list", +"list :", +"list : list stat '\\n'", +"list : list error '\\n'", +"stat : expr", +"stat : LETTER '=' expr", +"expr : '(' expr ')'", +"expr : expr '+' expr", +"expr : expr '-' expr", +"expr : expr '*' expr", +"expr : expr '/' expr", +"expr : expr '%' expr", +"expr : expr '&' expr", +"expr : expr '|' expr", +"expr : '-' expr", +"expr : LETTER", +"expr : number", +"number : DIGIT", +"number : number DIGIT", + +}; +#endif + +#if YYDEBUG +int yydebug; +#endif + +int yyerrflag; +int yychar; +YYSTYPE yyval; +YYSTYPE yylval; +int yynerrs; + +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) +YYLTYPE yyloc; /* position returned by actions */ +YYLTYPE yylloc; /* position from the lexer */ +#endif + +/* %code "requires" block start */ +#line 3 "calc_code_all.y" +/* CODE-REQUIRES */ +/* %code "requires" block end */ +#line 367 "calc_code_all.tab.c" + +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) +#ifndef YYLLOC_DEFAULT +#define YYLLOC_DEFAULT(loc, rhs, n) \ +do \ +{ \ + if (n == 0) \ + { \ + (loc).first_line = YYRHSLOC(rhs, 0).last_line; \ + (loc).first_column = YYRHSLOC(rhs, 0).last_column; \ + (loc).last_line = YYRHSLOC(rhs, 0).last_line; \ + (loc).last_column = YYRHSLOC(rhs, 0).last_column; \ + } \ + else \ + { \ + (loc).first_line = YYRHSLOC(rhs, 1).first_line; \ + (loc).first_column = YYRHSLOC(rhs, 1).first_column; \ + (loc).last_line = YYRHSLOC(rhs, n).last_line; \ + (loc).last_column = YYRHSLOC(rhs, n).last_column; \ + } \ +} while (0) +#endif /* YYLLOC_DEFAULT */ +#endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */ +#if YYBTYACC + +#ifndef YYLVQUEUEGROWTH +#define YYLVQUEUEGROWTH 32 +#endif +#endif /* YYBTYACC */ + +/* define the initial stack-sizes */ +#ifdef YYSTACKSIZE +#undef YYMAXDEPTH +#define YYMAXDEPTH YYSTACKSIZE +#else +#ifdef YYMAXDEPTH +#define YYSTACKSIZE YYMAXDEPTH +#else +#define YYSTACKSIZE 10000 +#define YYMAXDEPTH 10000 +#endif +#endif + +#ifndef YYINITSTACKSIZE +#define YYINITSTACKSIZE 200 +#endif + +typedef struct { + unsigned stacksize; + YYINT *s_base; + YYINT *s_mark; + YYINT *s_last; + YYSTYPE *l_base; + YYSTYPE *l_mark; +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + YYLTYPE *p_base; + YYLTYPE *p_mark; +#endif +} YYSTACKDATA; +#if YYBTYACC + +struct YYParseState_s +{ + struct YYParseState_s *save; /* Previously saved parser state */ + YYSTACKDATA yystack; /* saved parser stack */ + int state; /* saved parser state */ + int errflag; /* saved error recovery status */ + int lexeme; /* saved index of the conflict lexeme in the lexical queue */ + YYINT ctry; /* saved index in yyctable[] for this conflict */ +}; +typedef struct YYParseState_s YYParseState; +#endif /* YYBTYACC */ +/* variables for the parser stack */ +static YYSTACKDATA yystack; +#if YYBTYACC + +/* Current parser state */ +static YYParseState *yyps = 0; + +/* yypath != NULL: do the full parse, starting at *yypath parser state. */ +static YYParseState *yypath = 0; + +/* Base of the lexical value queue */ +static YYSTYPE *yylvals = 0; + +/* Current position at lexical value queue */ +static YYSTYPE *yylvp = 0; + +/* End position of lexical value queue */ +static YYSTYPE *yylve = 0; + +/* The last allocated position at the lexical value queue */ +static YYSTYPE *yylvlim = 0; + +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) +/* Base of the lexical position queue */ +static YYLTYPE *yylpsns = 0; + +/* Current position at lexical position queue */ +static YYLTYPE *yylpp = 0; + +/* End position of lexical position queue */ +static YYLTYPE *yylpe = 0; + +/* The last allocated position at the lexical position queue */ +static YYLTYPE *yylplim = 0; +#endif + +/* Current position at lexical token queue */ +static YYINT *yylexp = 0; + +static YYINT *yylexemes = 0; +#endif /* YYBTYACC */ + +/* %code "provides" block start */ +#line 4 "calc_code_all.y" +/* CODE-PROVIDES */ +#line 6 "calc_code_all.y" +/* CODE-PROVIDES2 */ +/* %code "provides" block end */ +#line 488 "calc_code_all.tab.c" + +/* %code "" block start */ +#line 1 "calc_code_all.y" +/* CODE-DEFAULT2 */ +#line 2 "calc_code_all.y" +/* CODE-DEFAULT */ +/* %code "" block end */ +#line 496 "calc_code_all.tab.c" +#line 73 "calc_code_all.y" + /* start of programs */ + +int +main (void) +{ + while(!feof(stdin)) { + yyparse(); + } + return 0; +} + +static void +yyerror(const char *s) +{ + fprintf(stderr, "%s\n", s); +} + +int +yylex(void) +{ + /* lexical analysis routine */ + /* returns LETTER for a lower case letter, yylval = 0 through 25 */ + /* return DIGIT for a digit, yylval = 0 through 9 */ + /* all other characters are returned immediately */ + + int c; + + while( (c=getchar()) == ' ' ) { /* skip blanks */ } + + /* c is now nonblank */ + + if( islower( c )) { + yylval = c - 'a'; + return ( LETTER ); + } + if( isdigit( c )) { + yylval = c - '0'; + return ( DIGIT ); + } + return( c ); +} +#line 539 "calc_code_all.tab.c" + +/* For use in generated program */ +#define yydepth (int)(yystack.s_mark - yystack.s_base) +#if YYBTYACC +#define yytrial (yyps->save) +#endif /* YYBTYACC */ + +#if YYDEBUG +#include <stdio.h> /* needed for printf */ +#endif + +#include <stdlib.h> /* needed for malloc, etc */ +#include <string.h> /* needed for memset */ + +/* allocate initial stack or double stack size, up to YYMAXDEPTH */ +static int yygrowstack(YYSTACKDATA *data) +{ + int i; + unsigned newsize; + YYINT *newss; + YYSTYPE *newvs; +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + YYLTYPE *newps; +#endif + + if ((newsize = data->stacksize) == 0) + newsize = YYINITSTACKSIZE; + else if (newsize >= YYMAXDEPTH) + return YYENOMEM; + else if ((newsize *= 2) > YYMAXDEPTH) + newsize = YYMAXDEPTH; + + i = (int) (data->s_mark - data->s_base); + newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss)); + if (newss == 0) + return YYENOMEM; + + data->s_base = newss; + data->s_mark = newss + i; + + newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs)); + if (newvs == 0) + return YYENOMEM; + + data->l_base = newvs; + data->l_mark = newvs + i; + +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + newps = (YYLTYPE *)realloc(data->p_base, newsize * sizeof(*newps)); + if (newps == 0) + return YYENOMEM; + + data->p_base = newps; + data->p_mark = newps + i; +#endif + + data->stacksize = newsize; + data->s_last = data->s_base + newsize - 1; + +#if YYDEBUG + if (yydebug) + fprintf(stderr, "%sdebug: stack size increased to %d\n", YYPREFIX, newsize); +#endif + return 0; +} + +#if YYPURE || defined(YY_NO_LEAKS) +static void yyfreestack(YYSTACKDATA *data) +{ + free(data->s_base); + free(data->l_base); +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + free(data->p_base); +#endif + memset(data, 0, sizeof(*data)); +} +#else +#define yyfreestack(data) /* nothing */ +#endif /* YYPURE || defined(YY_NO_LEAKS) */ +#if YYBTYACC + +static YYParseState * +yyNewState(unsigned size) +{ + YYParseState *p = (YYParseState *) malloc(sizeof(YYParseState)); + if (p == NULL) return NULL; + + p->yystack.stacksize = size; + if (size == 0) + { + p->yystack.s_base = NULL; + p->yystack.l_base = NULL; +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + p->yystack.p_base = NULL; +#endif + return p; + } + p->yystack.s_base = (YYINT *) malloc(size * sizeof(YYINT)); + if (p->yystack.s_base == NULL) return NULL; + p->yystack.l_base = (YYSTYPE *) malloc(size * sizeof(YYSTYPE)); + if (p->yystack.l_base == NULL) return NULL; + memset(p->yystack.l_base, 0, size * sizeof(YYSTYPE)); +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + p->yystack.p_base = (YYLTYPE *) malloc(size * sizeof(YYLTYPE)); + if (p->yystack.p_base == NULL) return NULL; + memset(p->yystack.p_base, 0, size * sizeof(YYLTYPE)); +#endif + + return p; +} + +static void +yyFreeState(YYParseState *p) +{ + yyfreestack(&p->yystack); + free(p); +} +#endif /* YYBTYACC */ + +#define YYABORT goto yyabort +#define YYREJECT goto yyabort +#define YYACCEPT goto yyaccept +#define YYERROR goto yyerrlab +#if YYBTYACC +#define YYVALID do { if (yyps->save) goto yyvalid; } while(0) +#define YYVALID_NESTED do { if (yyps->save && \ + yyps->save->save == 0) goto yyvalid; } while(0) +#endif /* YYBTYACC */ + +int +YYPARSE_DECL() +{ + int yym, yyn, yystate, yyresult; +#if YYBTYACC + int yynewerrflag; + YYParseState *yyerrctx = NULL; +#endif /* YYBTYACC */ +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + YYLTYPE yyerror_loc_range[3]; /* position of error start/end (0 unused) */ +#endif +#if YYDEBUG + const char *yys; + + if ((yys = getenv("YYDEBUG")) != 0) + { + yyn = *yys; + if (yyn >= '0' && yyn <= '9') + yydebug = yyn - '0'; + } + if (yydebug) + fprintf(stderr, "%sdebug[<# of symbols on state stack>]\n", YYPREFIX); +#endif +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + memset(yyerror_loc_range, 0, sizeof(yyerror_loc_range)); +#endif + +#if YYBTYACC + yyps = yyNewState(0); if (yyps == 0) goto yyenomem; + yyps->save = 0; +#endif /* YYBTYACC */ + yym = 0; + yyn = 0; + yynerrs = 0; + yyerrflag = 0; + yychar = YYEMPTY; + yystate = 0; + +#if YYPURE + memset(&yystack, 0, sizeof(yystack)); +#endif + + if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow; + yystack.s_mark = yystack.s_base; + yystack.l_mark = yystack.l_base; +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + yystack.p_mark = yystack.p_base; +#endif + yystate = 0; + *yystack.s_mark = 0; + +yyloop: + if ((yyn = yydefred[yystate]) != 0) goto yyreduce; + if (yychar < 0) + { +#if YYBTYACC + do { + if (yylvp < yylve) + { + /* we're currently re-reading tokens */ + yylval = *yylvp++; +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + yylloc = *yylpp++; +#endif + yychar = *yylexp++; + break; + } + if (yyps->save) + { + /* in trial mode; save scanner results for future parse attempts */ + if (yylvp == yylvlim) + { /* Enlarge lexical value queue */ + size_t p = (size_t) (yylvp - yylvals); + size_t s = (size_t) (yylvlim - yylvals); + + s += YYLVQUEUEGROWTH; + if ((yylexemes = (YYINT *)realloc(yylexemes, s * sizeof(YYINT))) == NULL) goto yyenomem; + if ((yylvals = (YYSTYPE *)realloc(yylvals, s * sizeof(YYSTYPE))) == NULL) goto yyenomem; +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + if ((yylpsns = (YYLTYPE *)realloc(yylpsns, s * sizeof(YYLTYPE))) == NULL) goto yyenomem; +#endif + yylvp = yylve = yylvals + p; + yylvlim = yylvals + s; +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + yylpp = yylpe = yylpsns + p; + yylplim = yylpsns + s; +#endif + yylexp = yylexemes + p; + } + *yylexp = (YYINT) YYLEX; + *yylvp++ = yylval; + yylve++; +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + *yylpp++ = yylloc; + yylpe++; +#endif + yychar = *yylexp++; + break; + } + /* normal operation, no conflict encountered */ +#endif /* YYBTYACC */ + yychar = YYLEX; +#if YYBTYACC + } while (0); +#endif /* YYBTYACC */ + if (yychar < 0) yychar = YYEOF; +#if YYDEBUG + if (yydebug) + { + if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN]; + fprintf(stderr, "%s[%d]: state %d, reading token %d (%s)", + YYDEBUGSTR, yydepth, yystate, yychar, yys); +#ifdef YYSTYPE_TOSTRING +#if YYBTYACC + if (!yytrial) +#endif /* YYBTYACC */ + fprintf(stderr, " <%s>", YYSTYPE_TOSTRING(yychar, yylval)); +#endif + fputc('\n', stderr); + } +#endif + } +#if YYBTYACC + + /* Do we have a conflict? */ + if (((yyn = yycindex[yystate]) != 0) && (yyn += yychar) >= 0 && + yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar) + { + YYINT ctry; + + if (yypath) + { + YYParseState *save; +#if YYDEBUG + if (yydebug) + fprintf(stderr, "%s[%d]: CONFLICT in state %d: following successful trial parse\n", + YYDEBUGSTR, yydepth, yystate); +#endif + /* Switch to the next conflict context */ + save = yypath; + yypath = save->save; + save->save = NULL; + ctry = save->ctry; + if (save->state != yystate) YYABORT; + yyFreeState(save); + + } + else + { + + /* Unresolved conflict - start/continue trial parse */ + YYParseState *save; +#if YYDEBUG + if (yydebug) + { + fprintf(stderr, "%s[%d]: CONFLICT in state %d. ", YYDEBUGSTR, yydepth, yystate); + if (yyps->save) + fputs("ALREADY in conflict, continuing trial parse.\n", stderr); + else + fputs("Starting trial parse.\n", stderr); + } +#endif + save = yyNewState((unsigned)(yystack.s_mark - yystack.s_base + 1)); + if (save == NULL) goto yyenomem; + save->save = yyps->save; + save->state = yystate; + save->errflag = yyerrflag; + save->yystack.s_mark = save->yystack.s_base + (yystack.s_mark - yystack.s_base); + memcpy (save->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT)); + save->yystack.l_mark = save->yystack.l_base + (yystack.l_mark - yystack.l_base); + memcpy (save->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE)); +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + save->yystack.p_mark = save->yystack.p_base + (yystack.p_mark - yystack.p_base); + memcpy (save->yystack.p_base, yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE)); +#endif + ctry = yytable[yyn]; + if (yyctable[ctry] == -1) + { +#if YYDEBUG + if (yydebug && yychar >= YYEOF) + fprintf(stderr, "%s[%d]: backtracking 1 token\n", YYDEBUGSTR, yydepth); +#endif + ctry++; + } + save->ctry = ctry; + if (yyps->save == NULL) + { + /* If this is a first conflict in the stack, start saving lexemes */ + if (!yylexemes) + { + yylexemes = (YYINT *) malloc((YYLVQUEUEGROWTH) * sizeof(YYINT)); + if (yylexemes == NULL) goto yyenomem; + yylvals = (YYSTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYSTYPE)); + if (yylvals == NULL) goto yyenomem; + yylvlim = yylvals + YYLVQUEUEGROWTH; +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + yylpsns = (YYLTYPE *) malloc((YYLVQUEUEGROWTH) * sizeof(YYLTYPE)); + if (yylpsns == NULL) goto yyenomem; + yylplim = yylpsns + YYLVQUEUEGROWTH; +#endif + } + if (yylvp == yylve) + { + yylvp = yylve = yylvals; +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + yylpp = yylpe = yylpsns; +#endif + yylexp = yylexemes; + if (yychar >= YYEOF) + { + *yylve++ = yylval; +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + *yylpe++ = yylloc; +#endif + *yylexp = (YYINT) yychar; + yychar = YYEMPTY; + } + } + } + if (yychar >= YYEOF) + { + yylvp--; +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + yylpp--; +#endif + yylexp--; + yychar = YYEMPTY; + } + save->lexeme = (int) (yylvp - yylvals); + yyps->save = save; + } + if (yytable[yyn] == ctry) + { +#if YYDEBUG + if (yydebug) + fprintf(stderr, "%s[%d]: state %d, shifting to state %d\n", + YYDEBUGSTR, yydepth, yystate, yyctable[ctry]); +#endif + if (yychar < 0) + { + yylvp++; +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + yylpp++; +#endif + yylexp++; + } + if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) + goto yyoverflow; + yystate = yyctable[ctry]; + *++yystack.s_mark = (YYINT) yystate; + *++yystack.l_mark = yylval; +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + *++yystack.p_mark = yylloc; +#endif + yychar = YYEMPTY; + if (yyerrflag > 0) --yyerrflag; + goto yyloop; + } + else + { + yyn = yyctable[ctry]; + goto yyreduce; + } + } /* End of code dealing with conflicts */ +#endif /* YYBTYACC */ + if (((yyn = yysindex[yystate]) != 0) && (yyn += yychar) >= 0 && + yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar) + { +#if YYDEBUG + if (yydebug) + fprintf(stderr, "%s[%d]: state %d, shifting to state %d\n", + YYDEBUGSTR, yydepth, yystate, yytable[yyn]); +#endif + if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow; + yystate = yytable[yyn]; + *++yystack.s_mark = yytable[yyn]; + *++yystack.l_mark = yylval; +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + *++yystack.p_mark = yylloc; +#endif + yychar = YYEMPTY; + if (yyerrflag > 0) --yyerrflag; + goto yyloop; + } + if (((yyn = yyrindex[yystate]) != 0) && (yyn += yychar) >= 0 && + yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar) + { + yyn = yytable[yyn]; + goto yyreduce; + } + if (yyerrflag != 0) goto yyinrecovery; +#if YYBTYACC + + yynewerrflag = 1; + goto yyerrhandler; + goto yyerrlab; /* redundant goto avoids 'unused label' warning */ + +yyerrlab: + /* explicit YYERROR from an action -- pop the rhs of the rule reduced + * before looking for error recovery */ + yystack.s_mark -= yym; + yystate = *yystack.s_mark; + yystack.l_mark -= yym; +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + yystack.p_mark -= yym; +#endif + + yynewerrflag = 0; +yyerrhandler: + while (yyps->save) + { + int ctry; + YYParseState *save = yyps->save; +#if YYDEBUG + if (yydebug) + fprintf(stderr, "%s[%d]: ERROR in state %d, CONFLICT BACKTRACKING to state %d, %d tokens\n", + YYDEBUGSTR, yydepth, yystate, yyps->save->state, + (int)(yylvp - yylvals - yyps->save->lexeme)); +#endif + /* Memorize most forward-looking error state in case it's really an error. */ + if (yyerrctx == NULL || yyerrctx->lexeme < yylvp - yylvals) + { + /* Free old saved error context state */ + if (yyerrctx) yyFreeState(yyerrctx); + /* Create and fill out new saved error context state */ + yyerrctx = yyNewState((unsigned)(yystack.s_mark - yystack.s_base + 1)); + if (yyerrctx == NULL) goto yyenomem; + yyerrctx->save = yyps->save; + yyerrctx->state = yystate; + yyerrctx->errflag = yyerrflag; + yyerrctx->yystack.s_mark = yyerrctx->yystack.s_base + (yystack.s_mark - yystack.s_base); + memcpy (yyerrctx->yystack.s_base, yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT)); + yyerrctx->yystack.l_mark = yyerrctx->yystack.l_base + (yystack.l_mark - yystack.l_base); + memcpy (yyerrctx->yystack.l_base, yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE)); +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + yyerrctx->yystack.p_mark = yyerrctx->yystack.p_base + (yystack.p_mark - yystack.p_base); + memcpy (yyerrctx->yystack.p_base, yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE)); +#endif + yyerrctx->lexeme = (int) (yylvp - yylvals); + } + yylvp = yylvals + save->lexeme; +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + yylpp = yylpsns + save->lexeme; +#endif + yylexp = yylexemes + save->lexeme; + yychar = YYEMPTY; + yystack.s_mark = yystack.s_base + (save->yystack.s_mark - save->yystack.s_base); + memcpy (yystack.s_base, save->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT)); + yystack.l_mark = yystack.l_base + (save->yystack.l_mark - save->yystack.l_base); + memcpy (yystack.l_base, save->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE)); +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + yystack.p_mark = yystack.p_base + (save->yystack.p_mark - save->yystack.p_base); + memcpy (yystack.p_base, save->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE)); +#endif + ctry = ++save->ctry; + yystate = save->state; + /* We tried shift, try reduce now */ + if ((yyn = yyctable[ctry]) >= 0) goto yyreduce; + yyps->save = save->save; + save->save = NULL; + yyFreeState(save); + + /* Nothing left on the stack -- error */ + if (!yyps->save) + { +#if YYDEBUG + if (yydebug) + fprintf(stderr, "%sdebug[%d,trial]: trial parse FAILED, entering ERROR mode\n", + YYPREFIX, yydepth); +#endif + /* Restore state as it was in the most forward-advanced error */ + yylvp = yylvals + yyerrctx->lexeme; +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + yylpp = yylpsns + yyerrctx->lexeme; +#endif + yylexp = yylexemes + yyerrctx->lexeme; + yychar = yylexp[-1]; + yylval = yylvp[-1]; +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + yylloc = yylpp[-1]; +#endif + yystack.s_mark = yystack.s_base + (yyerrctx->yystack.s_mark - yyerrctx->yystack.s_base); + memcpy (yystack.s_base, yyerrctx->yystack.s_base, (size_t) (yystack.s_mark - yystack.s_base + 1) * sizeof(YYINT)); + yystack.l_mark = yystack.l_base + (yyerrctx->yystack.l_mark - yyerrctx->yystack.l_base); + memcpy (yystack.l_base, yyerrctx->yystack.l_base, (size_t) (yystack.l_mark - yystack.l_base + 1) * sizeof(YYSTYPE)); +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + yystack.p_mark = yystack.p_base + (yyerrctx->yystack.p_mark - yyerrctx->yystack.p_base); + memcpy (yystack.p_base, yyerrctx->yystack.p_base, (size_t) (yystack.p_mark - yystack.p_base + 1) * sizeof(YYLTYPE)); +#endif + yystate = yyerrctx->state; + yyFreeState(yyerrctx); + yyerrctx = NULL; + } + yynewerrflag = 1; + } + if (yynewerrflag == 0) goto yyinrecovery; +#endif /* YYBTYACC */ + + YYERROR_CALL("syntax error"); +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + yyerror_loc_range[1] = yylloc; /* lookahead position is error start position */ +#endif + +#if !YYBTYACC + goto yyerrlab; /* redundant goto avoids 'unused label' warning */ +yyerrlab: +#endif + ++yynerrs; + +yyinrecovery: + if (yyerrflag < 3) + { + yyerrflag = 3; + for (;;) + { + if (((yyn = yysindex[*yystack.s_mark]) != 0) && (yyn += YYERRCODE) >= 0 && + yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) YYERRCODE) + { +#if YYDEBUG + if (yydebug) + fprintf(stderr, "%s[%d]: state %d, error recovery shifting to state %d\n", + YYDEBUGSTR, yydepth, *yystack.s_mark, yytable[yyn]); +#endif + if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow; + yystate = yytable[yyn]; + *++yystack.s_mark = yytable[yyn]; + *++yystack.l_mark = yylval; +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + /* lookahead position is error end position */ + yyerror_loc_range[2] = yylloc; + YYLLOC_DEFAULT(yyloc, yyerror_loc_range, 2); /* position of error span */ + *++yystack.p_mark = yyloc; +#endif + goto yyloop; + } + else + { +#if YYDEBUG + if (yydebug) + fprintf(stderr, "%s[%d]: error recovery discarding state %d\n", + YYDEBUGSTR, yydepth, *yystack.s_mark); +#endif + if (yystack.s_mark <= yystack.s_base) goto yyabort; +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + /* the current TOS position is the error start position */ + yyerror_loc_range[1] = *yystack.p_mark; +#endif +#if defined(YYDESTRUCT_CALL) +#if YYBTYACC + if (!yytrial) +#endif /* YYBTYACC */ +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + YYDESTRUCT_CALL("error: discarding state", + yystos[*yystack.s_mark], yystack.l_mark, yystack.p_mark); +#else + YYDESTRUCT_CALL("error: discarding state", + yystos[*yystack.s_mark], yystack.l_mark); +#endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */ +#endif /* defined(YYDESTRUCT_CALL) */ + --yystack.s_mark; + --yystack.l_mark; +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + --yystack.p_mark; +#endif + } + } + } + else + { + if (yychar == YYEOF) goto yyabort; +#if YYDEBUG + if (yydebug) + { + if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN]; + fprintf(stderr, "%s[%d]: state %d, error recovery discarding token %d (%s)\n", + YYDEBUGSTR, yydepth, yystate, yychar, yys); + } +#endif +#if defined(YYDESTRUCT_CALL) +#if YYBTYACC + if (!yytrial) +#endif /* YYBTYACC */ +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + YYDESTRUCT_CALL("error: discarding token", yychar, &yylval, &yylloc); +#else + YYDESTRUCT_CALL("error: discarding token", yychar, &yylval); +#endif /* defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) */ +#endif /* defined(YYDESTRUCT_CALL) */ + yychar = YYEMPTY; + goto yyloop; + } + +yyreduce: + yym = yylen[yyn]; +#if YYDEBUG + if (yydebug) + { + fprintf(stderr, "%s[%d]: state %d, reducing by rule %d (%s)", + YYDEBUGSTR, yydepth, yystate, yyn, yyrule[yyn]); +#ifdef YYSTYPE_TOSTRING +#if YYBTYACC + if (!yytrial) +#endif /* YYBTYACC */ + if (yym > 0) + { + int i; + fputc('<', stderr); + for (i = yym; i > 0; i--) + { + if (i != yym) fputs(", ", stderr); + fputs(YYSTYPE_TOSTRING(yystos[yystack.s_mark[1-i]], + yystack.l_mark[1-i]), stderr); + } + fputc('>', stderr); + } +#endif + fputc('\n', stderr); + } +#endif + if (yym > 0) + yyval = yystack.l_mark[1-yym]; + else + memset(&yyval, 0, sizeof yyval); +#if defined(YYLTYPE) || defined(YYLTYPE_IS_DECLARED) + + /* Perform position reduction */ + memset(&yyloc, 0, sizeof(yyloc)); +#if YYBTYACC + if (!yytrial) +#endif /* YYBTYACC */ + { + YYLLOC_DEFAULT(yyloc, &yystack.p_mark[-yym], yym); + /* just in case YYERROR is invoked within the action, save + the start of the rhs as the error start position */ + yyerror_loc_range[1] = yystack.p_mark[1-yym]; + } +#endif + + switch (yyn) + { +case 3: +#line 35 "calc_code_all.y" + { yyerrok ; } +break; +case 4: +#line 39 "calc_code_all.y" + { printf("%d\n",yystack.l_mark[0]);} +break; +case 5: +#line 41 "calc_code_all.y" + { regs[yystack.l_mark[-2]] = yystack.l_mark[0]; } +break; +case 6: +#line 45 "calc_code_all.y" + { yyval = yystack.l_mark[-1]; } +break; +case 7: +#line 47 "calc_code_all.y" + { yyval = yystack.l_mark[-2] + yystack.l_mark[0]; } +break; +case 8: +#line 49 "calc_code_all.y" + { yyval = yystack.l_mark[-2] - yystack.l_mark[0]; } +break; +case 9: +#line 51 "calc_code_all.y" + { yyval = yystack.l_mark[-2] * yystack.l_mark[0]; } +break; +case 10: +#line 53 "calc_code_all.y" + { yyval = yystack.l_mark[-2] / yystack.l_mark[0]; } +break; +case 11: +#line 55 "calc_code_all.y" + { yyval = yystack.l_mark[-2] % yystack.l_mark[0]; } +break; +case 12: +#line 57 "calc_code_all.y" + { yyval = yystack.l_mark[-2] & yystack.l_mark[0]; } +break; +case 13: +#line 59 "calc_code_all.y" + { yyval = yystack.l_mark[-2] | yystack.l_m |