diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2021-10-01 14:46:39 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2021-10-01 14:46:39 +0900 |
commit | f39f46f090221e313e240a086e8a43ed973bb03e (patch) | |
tree | 5f2076f668b604a83f0efa788dc591ee396911ff | |
parent | d3613397480d95ca222512ea4be3814fc6726b5f (diff) | |
download | byacc-f39f46f090221e313e240a086e8a43ed973bb03e.tar.gz byacc-f39f46f090221e313e240a086e8a43ed973bb03e.tar.bz2 byacc-f39f46f090221e313e240a086e8a43ed973bb03e.zip |
Imported Upstream version 20110908upstream/20110908
-rw-r--r-- | CHANGES | 174 | ||||
-rw-r--r-- | VERSION | 2 | ||||
-rw-r--r-- | aclocal.m4 | 38 | ||||
-rwxr-xr-x | config.guess | 37 | ||||
-rwxr-xr-x | config.sub | 75 | ||||
-rwxr-xr-x | configure | 446 | ||||
-rw-r--r-- | defs.h | 13 | ||||
-rw-r--r-- | error.c | 10 | ||||
-rw-r--r-- | main.c | 33 | ||||
-rw-r--r-- | output.c | 342 | ||||
-rw-r--r-- | package/byacc.spec | 4 | ||||
-rw-r--r-- | package/debian/changelog | 7 | ||||
-rw-r--r-- | reader.c | 6 | ||||
-rw-r--r-- | skeleton.c | 42 | ||||
-rw-r--r-- | test/calc.tab.c | 21 | ||||
-rw-r--r-- | test/calc1.tab.c | 22 | ||||
-rw-r--r-- | test/calc2.tab.c | 21 | ||||
-rw-r--r-- | test/calc3.tab.c | 11 | ||||
-rw-r--r-- | test/code_calc.code.c | 23 | ||||
-rw-r--r-- | test/code_error.code.c | 21 | ||||
-rw-r--r-- | test/error.tab.c | 19 | ||||
-rw-r--r-- | test/ftp.tab.c | 21 | ||||
-rw-r--r-- | test/grammar.tab.c | 22 | ||||
-rw-r--r-- | test/pure_calc.tab.c | 11 | ||||
-rw-r--r-- | test/pure_error.tab.c | 9 | ||||
-rw-r--r-- | yacc.1 | 27 |
26 files changed, 907 insertions, 550 deletions
@@ -1,4 +1,52 @@ -2010-12-29 Thomas Dickey <tom@crayon> +2011-09-08 Thomas E. Dickey <tom@invisible-island.net> + + * package/debian/changelog, package/byacc.spec, VERSION: bump + + * output.c: + fix some more interaction between -i and -d flags to ensure YYERRCODE + and YYSTYPE are declared, tested with cproto. + +2011-09-07 Thomas E. Dickey <tom@invisible-island.net> + + * yacc.1: document "-i" option. + + * package/debian/changelog, package/byacc.spec, VERSION: bump + + * output.c: fix an interaction between -i and -d + + * test/code_error.code.c, test/error.tab.c, test/ftp.tab.c, test/grammar.tab.c, test/pure_calc.tab.c, test/pure_error.tab.c, test/calc.tab.c, test/calc1.tab.c, test/calc2.tab.c, test/calc3.tab.c, test/code_calc.code.c: + regen - changes for "-i" option move the global/impure variables near the + macros that may add a prefix, etc. + + * skeleton.c, output.c, defs.h: changes to support "-i" option. + +2011-09-06 Thomas E. Dickey <tom@invisible-island.net> + + * reader.c: pass explicit file-pointer to write_section() + + * main.c: + add "-i" option, to generate interface-file (suggested by Denis M. Wilson) + +2011-09-05 Thomas E. Dickey <tom@invisible-island.net> + + * configure: regen + + * aclocal.m4: + resync with my-autoconf: CF_ANSI_CC_CHECK (check for $CFLAGS in $CC) + and CF_XOPEN_SOURCE (update aix, cygwin and netbsd checks) + + * defs.h, error.c, reader.c: + add check for missing "}" on %parse-param and %lex-param lines (report by Denis M Wilson) + +2011-04-01 Thomas E. Dickey <tom@invisible-island.net> + + * config.sub: 2011-04-01 + +2011-02-02 Thomas E. Dickey <tom@invisible-island.net> + + * config.guess: 2011-01-01 + +2010-12-29 Thomas E. Dickey <tom@invisible-island.net> * defs.h, skeleton.c: add const qualifier to skeleton data, per NetBSD changes (report by Christos Zoulas) @@ -20,7 +68,7 @@ * test/ftp.y: improve example, which was stuck in 19XX and assumed file sizes were longs. -2010-12-29 Thomas Dickey <tom@crayon> +2010-12-29 Thomas E. Dickey <tom@invisible-island.net> * test/ftp.tab.c, test/grammar.tab.c, test/pure_calc.tab.c, test/pure_error.tab.c, test/calc.tab.c, test/calc1.tab.c, test/calc2.tab.c, test/calc3.tab.c, test/code_calc.code.c, test/code_error.code.c, test/error.tab.c: regen @@ -38,11 +86,11 @@ * output.c: correct definition for YYERROR_DECL() -2010-12-29 Thomas Dickey <tom@crayon> +2010-12-29 Thomas E. Dickey <tom@invisible-island.net> * package/debian/changelog, package/byacc.spec, VERSION: bump -2010-12-26 Thomas Dickey <tom@crayon> +2010-12-26 Thomas E. Dickey <tom@invisible-island.net> * defs.h, main.c: change return-type of allocate() to avoid warnings of alignment problems @@ -62,7 +110,7 @@ * aclocal.m4: improve quoting, deprecate ${name-value} in favor of standard ${name:-value} -2010-12-25 Thomas Dickey <tom@crayon> +2010-12-25 Thomas E. Dickey <tom@invisible-island.net> * main.c: start revising use of tmpfile(), to make this work with MinGW. Start by @@ -71,7 +119,7 @@ * package/debian/changelog, package/byacc.spec, VERSION: bump -2010-11-27 Thomas Dickey <tom@crayon> +2010-11-27 Thomas E. Dickey <tom@invisible-island.net> * package/byacc.spec, package/debian/changelog, VERSION: bump @@ -81,7 +129,7 @@ corrected use of %parse-param value in yyerror(); it doesn't use &yylval (report by Clifford Yapp) -2010-11-26 Thomas Dickey <tom@crayon> +2010-11-26 Thomas E. Dickey <tom@invisible-island.net> * skeleton.c: typo @@ -130,7 +178,7 @@ * package/debian/changelog, package/byacc.spec, VERSION: bump -2010-11-24 Thomas Dickey <tom@crayon> +2010-11-24 Thomas E. Dickey <tom@invisible-island.net> * main.c, defs.h, symtab.c, error.c: reduce global variables @@ -140,7 +188,7 @@ amend fix for Redhat #112617 to still call default_action_warning() for empty rules (report by Bruce Cran). -2010-11-22 Thomas Dickey <tom@crayon> +2010-11-22 Thomas E. Dickey <tom@invisible-island.net> * output.c: add ifdef to guard against redefinition of YYSTYPE union (request by Clifford Yapp). @@ -172,20 +220,20 @@ * package/debian/changelog, package/byacc.spec, VERSION: bump -2010-09-28 Thomas Dickey <tom@crayon> +2010-09-28 Thomas E. Dickey <tom@invisible-island.net> * config.guess: 2010-09-24 -2010-09-10 Thomas Dickey <tom@crayon> +2010-09-10 Thomas E. Dickey <tom@invisible-island.net> * config.sub: 2010-09-11 -2010-06-10 Thomas Dickey <tom@crayon> +2010-06-10 Thomas E. Dickey <tom@invisible-island.net> * yacc.1, package/debian/changelog, package/byacc.spec, VERSION: bump to 2010/06/10 -2010-06-09 Thomas Dickey <tom@crayon> +2010-06-09 Thomas E. Dickey <tom@invisible-island.net> * reader.c: free declarations in leak-testing code. @@ -217,7 +265,7 @@ * test/ftp.tab.c, test/ftp.y, reader.c, symtab.c, verbose.c, lr0.c, main.c, mkpar.c, output.c, defs.h, closure.c: fix warnings from clang --analyze -2010-06-08 Thomas Dickey <tom@crayon> +2010-06-08 Thomas E. Dickey <tom@invisible-island.net> * output.c: fix to build with c89, etc. @@ -249,7 +297,7 @@ add check_make and check_lint rules to help validate the generated files in the test-directory -2010-06-07 Thomas Dickey <tom@crayon> +2010-06-07 Thomas E. Dickey <tom@invisible-island.net> * test/pure_calc.tab.c, test/pure_error.tab.c: RCS_BASE @@ -296,11 +344,11 @@ anyway. This allows for better compatibility with yacc sources written for bison. -2010-06-07 Thomas Dickey <tom@crayon> +2010-06-07 Thomas E. Dickey <tom@invisible-island.net> * VERSION: bump to 2010/06/07 -2010-06-06 Thomas Dickey <tom@crayon> +2010-06-06 Thomas E. Dickey <tom@invisible-island.net> * test/calc.tab.c, configure: regen @@ -351,12 +399,12 @@ c) CF_GCC_VERSION, ignore stderr d) CF_GCC_WARNINGS, adjust options to work with c89 wrapper of gcc -2010-04-20 Thomas Dickey <tom@crayon> +2010-04-20 Thomas E. Dickey <tom@invisible-island.net> * package/debian/changelog, package/debian/compat, package/debian/control, package/debian/copyright, package/debian/docs, package/debian/postinst, package/debian/prerm, package/debian/rules, package/debian/watch: scripts from Debian package -2010-02-16 Thomas Dickey <tom@crayon> +2010-02-16 Thomas E. Dickey <tom@invisible-island.net> * yacc.1: document -P and bison-extensions @@ -408,24 +456,24 @@ * skeleton.c: fix a memory leak in the generated skeleton -2010-01-01 Thomas Dickey <tom@crayon> +2010-01-01 Thomas E. Dickey <tom@invisible-island.net> * package/debian/source/format: scripts from Debian package -2009-12-31 Thomas Dickey <tom@crayon> +2009-12-31 Thomas E. Dickey <tom@invisible-island.net> * config.guess: 2009-12-30 * config.sub: 2009-12-31 -2009-10-27 Thomas Dickey <tom@crayon> +2009-10-27 Thomas E. Dickey <tom@invisible-island.net> * VERSION: 20091027 * output.c, mkpar.c, defs.h, lalr.c, closure.c, graph.c, lr0.c, verbose.c, main.c, reader.c: strict compiler warnings -2009-10-26 Thomas Dickey <tom@crayon> +2009-10-26 Thomas E. Dickey <tom@invisible-island.net> * test/ftp.tab.c, test/grammar.tab.c, test/calc.tab.c, test/error.tab.c: resync @@ -440,44 +488,44 @@ * aclocal.m4: resync with my-autoconf -2009-08-25 Thomas Dickey <tom@crayon> +2009-08-25 Thomas E. Dickey <tom@invisible-island.net> * config.guess, config.sub: 2009-08-19 -2009-02-21 Thomas Dickey <tom@crayon> +2009-02-21 Thomas E. Dickey <tom@invisible-island.net> * VERSION: bump * output.c: restore "yylval" symbol, omitted in cleanup on 2008/8/25 -2008-12-26 Thomas Dickey <tom@crayon> +2008-12-26 Thomas E. Dickey <tom@invisible-island.net> * configure: regen with autoconf-2.52 (patched) -2008-12-25 Thomas Dickey <tom@crayon> +2008-12-25 Thomas E. Dickey <tom@invisible-island.net> * test/error.tab.c, test/ftp.tab.c, test/grammar.tab.c, test/calc.tab.c: regenerated -2008-12-24 Thomas Dickey <tom@crayon> +2008-12-24 Thomas E. Dickey <tom@invisible-island.net> * VERSION: bump * skeleton.c: remove ifdef-lint from goto yyerrlab, to quiet gcc warning -2008-11-26 Thomas Dickey <tom@crayon> +2008-11-26 Thomas E. Dickey <tom@invisible-island.net> * verbose.c, main.c, defs.h, mkpar.c, reader.c: completed implementation of "%expect" (report by Perry E. Metzger). add "%expect-rr", which is (unlike bison) allowable in LALR parsers. -2008-11-24 Thomas Dickey <tom@crayon> +2008-11-24 Thomas E. Dickey <tom@invisible-island.net> * closure.c, defs.h, error.c, graph.c, lalr.c, lr0.c, main.c, mkpar.c, output.c, reader.c, skeleton.c, symtab.c, verbose.c, warshall.c: change indent-style (request by Perry E. Metzger) -2008-08-27 Thomas Dickey <tom@crayon> +2008-08-27 Thomas E. Dickey <tom@invisible-island.net> * test/calc.tab.c, test/error.tab.c, test/ftp.tab.c, test/grammar.tab.c: better implementation of YYPARSE_PARAM, using YYPARSE_DECL() macro @@ -516,12 +564,12 @@ * test/calc.tab.c, test/error.tab.c, test/ftp.tab.c, test/grammar.tab.c: remove 'register' keywords -2008-08-26 Thomas Dickey <tom@crayon> +2008-08-26 Thomas E. Dickey <tom@invisible-island.net> * warshall.c, verbose.c, symtab.c, skeleton.c, reader.c, output.c, mkpar.c, main.c, lr0.c, lalr.c, graph.c, error.c, closure.c: remove 'register' keywords -2008-08-25 Thomas Dickey <tom@crayon> +2008-08-25 Thomas E. Dickey <tom@invisible-island.net> * test/ftp.tab.c: regen'd @@ -561,7 +609,7 @@ * makefile.in: add dependency on VERSION file. -2008-08-24 Thomas Dickey <tom@crayon> +2008-08-24 Thomas E. Dickey <tom@invisible-island.net> * VERSION: bump @@ -579,18 +627,18 @@ * aclocal.m4: resync with my-autoconf (no major changes) -2008-07-24 Thomas Dickey <tom@crayon> +2008-07-24 Thomas E. Dickey <tom@invisible-island.net> * package/pkgsrc/Makefile, package/pkgsrc/distinfo: scripts from NetBSD pkgsrc, for test-builds -2008-03-14 Thomas Dickey <tom@crayon> +2008-03-14 Thomas E. Dickey <tom@invisible-island.net> * config.sub: update to 2008-03-08 * config.guess: update to 2008-03-12 -2007-05-09 Thomas Dickey <tom@crayon> +2007-05-09 Thomas E. Dickey <tom@invisible-island.net> * main.c: close graph, verbose files if opened, on exit. @@ -617,19 +665,19 @@ * main.c: file_prefix did not always have a trailing null. -2007-03-25 Thomas Dickey <tom@crayon> +2007-03-25 Thomas E. Dickey <tom@invisible-island.net> * mkdirs.sh: improved version for "make -j" -2006-12-22 Thomas Dickey <tom@crayon> +2006-12-22 Thomas E. Dickey <tom@invisible-island.net> * config.guess: 2006/12/22 -2006-12-08 Thomas Dickey <tom@crayon> +2006-12-08 Thomas E. Dickey <tom@invisible-island.net> * config.sub: 2006/12/08 -2005-08-13 Thomas Dickey <tom@crayon> +2005-08-13 Thomas E. Dickey <tom@invisible-island.net> * main.c: add -V to usage message @@ -648,23 +696,23 @@ Debian #322858 (don't close union_file, which contained data). This feature is used in groff. -2005-08-13 Thomas Dickey <tom@crayon> +2005-08-13 Thomas E. Dickey <tom@invisible-island.net> * configure: regenerated * aclocal.m4: improve checks for Intel compiler warnings -2005-06-25 Thomas Dickey <tom@crayon> +2005-06-25 Thomas E. Dickey <tom@invisible-island.net> * config.sub: 2005/6/2 * config.guess: 2005/5/27 -2005-05-05 Thomas Dickey <tom@crayon> +2005-05-05 Thomas E. Dickey <tom@invisible-island.net> * defs.h: add a fallback for GCC_UNUSED -2005-05-04 Thomas Dickey <tom@crayon> +2005-05-04 Thomas E. Dickey <tom@invisible-island.net> * makefile.in: add "." to include-path to pickup config.h @@ -719,7 +767,7 @@ add "-o" to usage message. It is too long for a single line; rewrite usage() to show one option per line. -2005-05-03 Thomas Dickey <tom@crayon> +2005-05-03 Thomas E. Dickey <tom@invisible-island.net> * main.c: add -o option, to work with scripts that assume bison. simplify create_file_names() with a macro. @@ -750,21 +798,21 @@ add graphical output of the LALR(1) automaton for graphviz, associated with command-line option `-g' -2005-04-16 Thomas Dickey <tom@crayon> +2005-04-16 Thomas E. Dickey <tom@invisible-island.net> * config.sub: 2005/2/10 * config.guess: 2005/3/24 -2005-04-13 Thomas Dickey <tom@crayon> +2005-04-13 Thomas E. Dickey <tom@invisible-island.net> * package/pkgsrc/PLIST: scripts from NetBSD pkgsrc, for test-builds -2005-03-21 Thomas Dickey <tom@crayon> +2005-03-21 Thomas E. Dickey <tom@invisible-island.net> * package/pkgsrc/DESCR: scripts from NetBSD pkgsrc, for test-builds -2004-03-28 Thomas Dickey <tom@crayon> +2004-03-28 Thomas E. Dickey <tom@invisible-island.net> * test/calc.tab.c, test/error.tab.c, test/ftp.tab.c, test/grammar.tab.c: updates due to adding yyparse() prototype @@ -826,32 +874,32 @@ * README: updated to note that this is not the original -2004-03-24 Thomas Dickey <tom@crayon> +2004-03-24 Thomas E. Dickey <tom@invisible-island.net> * test/grammar.y: RCS_BASE -2004-02-23 Thomas Dickey <tom@crayon> +2004-02-23 Thomas E. Dickey <tom@invisible-island.net> * config.sub: RCS_BASE -2004-02-17 Thomas Dickey <tom@crayon> +2004-02-17 Thomas E. Dickey <tom@invisible-island.net> * config.guess: RCS_BASE -2003-11-29 Thomas Dickey <tom@crayon> +2003-11-29 Thomas E. Dickey <tom@invisible-island.net> * install-sh: improved quoting -2002-06-29 Thomas Dickey <tom@crayon> +2002-06-29 Thomas E. Dickey <tom@invisible-island.net> * mkdirs.sh: don't use character range, since some locales don't work as expected -2001-06-22 Thomas Dickey <tom@crayon> +2001-06-22 Thomas E. Dickey <tom@invisible-island.net> * install-sh: RCS_BASE -2000-11-20 Thomas Dickey <tom@crayon> +2000-11-20 Thomas E. Dickey <tom@invisible-island.net> * test/calc.y: RCS_BASE @@ -859,26 +907,26 @@ * vmsbuild.com: original version -2000-02-23 dickey +2000-02-23 Thomas E. Dickey <dickey@invisible-island.net> * test/RCS, RCS: PERMIT FILE -2000-02-14 Thomas Dickey <tom@crayon> +2000-02-14 Thomas E. Dickey <tom@invisible-island.net> * main.c: fix for VMS port - making pathname for temp-file * descrip.mms: original version -2000-02-13 Thomas Dickey <tom@crayon> +2000-02-13 Thomas E. Dickey <tom@invisible-island.net> * defs.h, verbose.c, reader.c, main.c, skeleton.c, warshall.c, symtab.c, closure.c, mkpar.c, lalr.c, lr0.c, output.c, error.c: ansify -1999-11-30 Thomas Dickey <tom@crayon> +1999-11-30 Thomas E. Dickey <tom@invisible-island.net> * mkdirs.sh: RCS_BASE -1995-01-01 Thomas Dickey <tom@crayon> +1995-01-01 Thomas E. Dickey <tom@invisible-island.net> * config_h.in: RCS_BASE @@ -930,7 +978,7 @@ * symtab.c, lalr.c, error.c: original version -1990-01-16 Thomas Dickey <tom@crayon> +1990-01-16 Thomas E. Dickey <tom@invisible-island.net> * test/code_error.y, test/pure_error.y: RCS_BASE @@ -1 +1 @@ -20101229 +20110908 @@ -1,4 +1,4 @@ -dnl $Id: aclocal.m4,v 1.17 2010/12/26 11:58:30 tom Exp $ +dnl $Id: aclocal.m4,v 1.18 2011/09/05 23:45:06 tom Exp $ dnl Macros for byacc configure script (Thomas E. Dickey) dnl --------------------------------------------------------------------------- dnl Copyright 2004-2009,2010 Thomas E. Dickey @@ -116,12 +116,33 @@ AC_SUBST(EXTRA_CPPFLAGS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_ANSI_CC_CHECK version: 10 updated: 2010/10/23 15:52:32 +dnl CF_ANSI_CC_CHECK version: 11 updated: 2011/07/01 19:47:45 dnl ---------------- -dnl This is adapted from the macros 'fp_PROG_CC_STDC' and 'fp_C_PROTOTYPES' -dnl in the sharutils 4.2 distribution. +dnl This was originally adapted from the macros 'fp_PROG_CC_STDC' and +dnl 'fp_C_PROTOTYPES' in the sharutils 4.2 distribution. AC_DEFUN([CF_ANSI_CC_CHECK], [ +# This should have been defined by AC_PROG_CC +: ${CC:=cc} + +# Check for user's environment-breakage by stuffing CFLAGS/CPPFLAGS content +# into CC. This will not help with broken scripts that wrap the compiler with +# options, but eliminates a more common category of user confusion. +AC_MSG_CHECKING(\$CC variable) +case "$CC" in #(vi +*[[\ \ ]]-[[IUD]]*) + AC_MSG_RESULT(broken) + AC_MSG_WARN(your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options) + # humor him... + cf_flags=`echo "$CC" | sed -e 's/^[[^ ]]*[[ ]]//'` + CC=`echo "$CC" | sed -e 's/[[ ]].*//'` + CF_ADD_CFLAGS($cf_flags) + ;; +*) + AC_MSG_RESULT(ok) + ;; +esac + AC_CACHE_CHECK(for ${CC:-cc} option to accept ANSI C, cf_cv_ansi_cc,[ cf_cv_ansi_cc=no cf_save_CFLAGS="$CFLAGS" @@ -965,7 +986,7 @@ fi fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_XOPEN_SOURCE version: 34 updated: 2010/05/26 05:38:42 +dnl CF_XOPEN_SOURCE version: 37 updated: 2011/08/06 20:32:05 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, @@ -981,9 +1002,12 @@ cf_POSIX_C_SOURCE=ifelse([$2],,199506L,[$2]) cf_xopen_source= case $host_os in #(vi -aix[[456]]*) #(vi +aix[[4-7]]*) #(vi cf_xopen_source="-D_ALL_SOURCE" ;; +cygwin) #(vi + cf_XOPEN_SOURCE=600 + ;; darwin[[0-8]].*) #(vi cf_xopen_source="-D_APPLE_C_SOURCE" ;; @@ -1014,7 +1038,7 @@ mirbsd*) #(vi # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <arpa/inet.h> ;; netbsd*) #(vi - # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw + cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw ;; openbsd*) #(vi # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw diff --git a/config.guess b/config.guess index bec935b..e4b6966 100755 --- a/config.guess +++ b/config.guess @@ -1,10 +1,10 @@ #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 -# Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +# 2911 Free Software Foundation, Inc. -timestamp='2010-09-24' +timestamp='2011-01-01' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -57,8 +57,8 @@ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free -Software Foundation, Inc. +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 +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." @@ -92,7 +92,7 @@ if test $# != 0; then exit 1 fi -trap 'exit 1' HUP INT TERM +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 @@ -106,7 +106,7 @@ trap 'exit 1' HUP INT TERM 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" HUP INT PIPE TERM ; +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) ; } || @@ -270,7 +270,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # 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'` - exit ;; + # 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 @@ -326,8 +329,8 @@ 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/[^.]*//'` - exit ;; + echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; @@ -495,7 +498,7 @@ EOF else echo i586-dg-dgux${UNAME_RELEASE} fi - exit ;; + exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; @@ -820,8 +823,8 @@ EOF echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) - echo ia64-unknown-interix${UNAME_RELEASE} - exit ;; + 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 @@ -934,14 +937,14 @@ EOF test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) - echo or32-unknown-linux-gnu - exit ;; + echo or32-unknown-linux-gnu + exit ;; padre:Linux:*:*) echo sparc-unknown-linux-gnu exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-gnu - exit ;; + echo hppa64-unknown-linux-gnu + exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in @@ -2,9 +2,9 @@ # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 -# Free Software Foundation, Inc. +# 2011 Free Software Foundation, Inc. -timestamp='2010-09-11' +timestamp='2011-04-01' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -76,8 +76,8 @@ version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free -Software Foundation, Inc. +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 +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." @@ -175,10 +175,10 @@ case $os in os=-chorusos basic_machine=$1 ;; - -chorusrdb) - os=-chorusrdb + -chorusrdb) + os=-chorusrdb basic_machine=$1 - ;; + ;; -hiux*) os=-hiuxwe2 ;; @@ -283,12 +283,13 @@ case $basic_machine in | moxie \ | mt \ | msp430 \ - | nds32 | nds32le | nds32be\ + | nds32 | nds32le | nds32be \ | nios | nios2 \ | ns16k | ns32k \ + | open8 \ | or32 \ | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | rx \ | score \ @@ -296,12 +297,12 @@ case $basic_machine in | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ - | spu | strongarm \ - | tahoe | thumb | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ + | spu \ + | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e \ | we32k \ - | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ + | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; @@ -324,7 +325,15 @@ case $basic_machine in ms1) basic_machine=mt-unknown ;; - + strongarm | thumb | xscale) + basic_machine=arm-unknown + ;; + xscaleeb) + basic_machine=armeb-unknown + ;; + xscaleel) + basic_machine=armel-unknown + ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. @@ -382,24 +391,25 @@ case $basic_machine in | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ + | open8-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ | 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-* | strongarm-* | sv1-* | sx?-* \ - | tahoe-* | thumb-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ + | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile-* | tilegx-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ - | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) @@ -539,7 +549,7 @@ case $basic_machine in basic_machine=craynv-cray os=-unicosmp ;; - cr16) + cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; @@ -826,10 +836,10 @@ case $basic_machine in basic_machine=v70-nec os=-sysv ;; - next | m*-next ) + next | m*-next) basic_machine=m68k-next case $os in - -nextstep* ) + -nextstep*) ;; -ns2*) os=-nextstep2 @@ -948,11 +958,14 @@ case $basic_machine in pn) basic_machine=pn-gould ;; - power) basic_machine=power-ibm + power) + basic_machine=power-ibm ;; - ppc) basic_machine=powerpc-unknown + ppc | ppcbe) + basic_machine=powerpc-unknown ;; - ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ppc-* | ppcbe-*) + basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown @@ -960,9 +973,11 @@ case $basic_machine in ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; - ppc64) basic_machine=powerpc64-unknown + ppc64) + basic_machine=powerpc64-unknown ;; - ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ppc64-*) + basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown @@ -1046,6 +1061,9 @@ case $basic_machine in basic_machine=i860-stratus os=-sysv4 ;; + strongarm-* | thumb-*) + basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; sun2) basic_machine=m68000-sun ;; @@ -1178,6 +1196,9 @@ case $basic_machine in xps | xps100) basic_machine=xps100-honeywell ;; + xscale-* | xscalee[bl]-*) + basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` + ;; ymp) basic_machine=ymp-cray os=-unicos @@ -1400,7 +1421,7 @@ case $os in -nova*) os=-rtmk-nova ;; - -ns2 ) + -ns2) os=-nextstep2 ;; -nsk*) @@ -1597,7 +1618,7 @@ case $basic_machine in m88k-omron*) os=-luna ;; - *-next ) + *-next) os=-nextstep ;; *-sequent) @@ -1,7 +1,7 @@ #! /bin/sh # From configure.in Revision: 1.10 . # Guess values for system-dependent variables and create Makefiles. -# Generated by Autoconf 2.52.20101001. +# Generated by Autoconf 2.52.20101002. # # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. @@ -718,7 +718,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.20101001. Invocation command line was +generated by GNU Autoconf 2.52.20101002. Invocation command line was $ $0 $@ @@ -2304,7 +2304,110 @@ fi test -n "$LINT" && break done -echo "$as_me:2307: checking for ${CC:-cc} option to accept ANSI C" >&5 +# This should have been defined by AC_PROG_CC +: ${CC:=cc} + +# Check for user's environment-breakage by stuffing CFLAGS/CPPFLAGS content +# into CC. This will not help with broken scripts that wrap the compiler with +# options, but eliminates a more common category of user confusion. +echo "$as_me:2313: checking \$CC variable" >&5 +echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6 +case "$CC" in #(vi +*[\ \ ]-[IUD]*) + echo "$as_me:2317: result: broken" >&5 +echo "${ECHO_T}broken" >&6 + { echo "$as_me:2319: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&5 +echo "$as_me: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;} + # humor him... + cf_flags=`echo "$CC" | sed -e 's/^[^ ]*[ ]//'` + CC=`echo "$CC" | sed -e 's/[ ].*//'` + +cf_fix_cppflags=no +cf_new_cflags= +cf_new_cppflags= +cf_new_extra_cppflags= + +for cf_add_cflags in $cf_flags +do +case $cf_fix_cppflags in +no) + case $cf_add_cflags in #(vi + -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi + case $cf_add_cflags in + -D*) + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes + + if test $cf_fix_cppflags = yes ; then + cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + continue + elif test "${cf_tst_cflags}" = "\"'" ; then + cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + continue + fi + ;; + esac + case "$CPPFLAGS" in + *$cf_add_cflags) #(vi + ;; + *) #(vi + case $cf_add_cflags in #(vi + -D*) + cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` + +CPPFLAGS=`echo "$CPPFLAGS" | \ + sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \ + -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'` + + ;; + esac + cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + ;; + esac + ;; + *) + cf_new_cflags="$cf_new_cflags $cf_add_cflags" + ;; + esac + ;; +yes) + cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no + ;; +esac +done + +if test -n "$cf_new_cflags" ; then + + CFLAGS="$CFLAGS $cf_new_cflags" +fi + +if test -n "$cf_new_cppflags" ; then + + CPPFLAGS="$CPPFLAGS $cf_new_cppflags" +fi + +if test -n "$cf_new_extra_cppflags" ; then + + EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" +fi + + ;; +*) + echo "$as_me:2405: result: ok" >&5 +echo "${ECHO_T}ok" >&6 + ;; +esac + +echo "$as_me:2410: checking for ${CC:-cc} option to accept ANSI C" >&5 echo $ECHO_N "checking for ${CC:-cc} option to accept ANSI C... $ECHO_C" >&6 if test "${cf_cv_ansi_cc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -2408,7 +2511,7 @@ if test -n "$cf_new_extra_cppflags" ; then fi cat >conftest.$ac_ext <<_ACEOF -#line 2411 "configure" +#line 2514 "configure" #include "confdefs.h" #ifndef CC_HAS_PROTOS @@ -2429,16 +2532,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:2432: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:2535: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:2435: \$? = $ac_status" >&5 + echo "$as_me:2538: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:2438: \"$ac_try\"") >&5 + { (eval echo "$as_me:2541: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2441: \$? = $ac_status" >&5 + echo "$as_me:2544: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_ansi_cc="$cf_arg"; break else @@ -2451,7 +2554,7 @@ CFLAGS="$cf_save_CFLAGS" CPPFLAGS="$cf_save_CPPFLAGS" fi -echo "$as_me:2454: result: $cf_cv_ansi_cc" >&5 +echo "$as_me:2557: result: $cf_cv_ansi_cc" >&5 echo "${ECHO_T}$cf_cv_ansi_cc" >&6 if test "$cf_cv_ansi_cc" != "no"; then @@ -2544,7 +2647,7 @@ fi fi if test "$cf_cv_ansi_cc" = "no"; then - { { echo "$as_me:2547: error: Your compiler does not appear to recognize prototypes. + { { echo "$as_me:2650: error: Your compiler does not appear to recognize prototypes. You have the following choices: a. adjust your compiler options b. get an up-to-date compiler @@ -2562,9 +2665,12 @@ cf_POSIX_C_SOURCE=199506L cf_xopen_source= case $host_os in #(vi -aix[456]*) #(vi +aix[4-7]*) #(vi cf_xopen_source="-D_ALL_SOURCE" ;; +cygwin) #(vi + cf_XOPEN_SOURCE=600 + ;; darwin[0-8].*) #(vi cf_xopen_source="-D_APPLE_C_SOURCE" ;; @@ -2590,14 +2696,14 @@ irix[56].*) #(vi ;; linux*|gnu*|mint*|k*bsd*-gnu) #(vi -echo "$as_me:2593: checking if we must define _GNU_SOURCE" >&5 +echo "$as_me:2699: 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 2600 "configure" +#line 2706 "configure" #include "confdefs.h" #include <sys/types.h> int @@ -2612,16 +2718,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:2615: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:2721: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:2618: \$? = $ac_status" >&5 + echo "$as_me:2724: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:2621: \"$ac_try\"") >&5 + { (eval echo "$as_me:2727: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2624: \$? = $ac_status" >&5 + echo "$as_me:2730: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_gnu_source=no else @@ -2630,7 +2736,7 @@ cat conftest.$ac_ext >&5 cf_save="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" cat >conftest.$ac_ext <<_ACEOF -#line 2633 "configure" +#line 2739 "configure" #include "confdefs.h" #include <sys/types.h> int @@ -2645,16 +2751,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:2648: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:2754: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:2651: \$? = $ac_status" >&5 + echo "$as_me:2757: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:2654: \"$ac_try\"") >&5 + { (eval echo "$as_me:2760: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2657: \$? = $ac_status" >&5 + echo "$as_me:2763: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_gnu_source=no else @@ -2669,7 +2775,7 @@ fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:2672: result: $cf_cv_gnu_source" >&5 +echo "$as_me:2778: result: $cf_cv_gnu_source" >&5 echo "${ECHO_T}$cf_cv_gnu_source" >&6 test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" @@ -2678,7 +2784,7 @@ mirbsd*) #(vi # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <arpa/inet.h> ;; netbsd*) #(vi - # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw + cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw ;; openbsd*) #(vi # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw @@ -2699,14 +2805,14 @@ solaris2.[1-9]) #(vi cf_xopen_source="-D__EXTENSIONS__" ;; *) - echo "$as_me:2702: checking if we should define _XOPEN_SOURCE" >&5 + echo "$as_me:2808: 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 2709 "configure" +#line 2815 "configure" #include "confdefs.h" #include <sys/types.h> int @@ -2721,16 +2827,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:2724: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:2830: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:2727: \$? = $ac_status" >&5 + echo "$as_me:2833: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:2730: \"$ac_try\"") >&5 + { (eval echo "$as_me:2836: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2733: \$? = $ac_status" >&5 + echo "$as_me:2839: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_xopen_source=no else @@ -2739,7 +2845,7 @@ cat conftest.$ac_ext >&5 cf_save="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" cat >conftest.$ac_ext <<_ACEOF -#line 2742 "configure" +#line 2848 "configure" #include "confdefs.h" #include <sys/types.h> int @@ -2754,16 +2860,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:2757: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:2863: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:2760: \$? = $ac_status" >&5 + echo "$as_me:2866: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:2763: \"$ac_try\"") >&5 + { (eval echo "$as_me:2869: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2766: \$? = $ac_status" >&5 + echo "$as_me:2872: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_xopen_source=no else @@ -2778,7 +2884,7 @@ fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:2781: result: $cf_cv_xopen_source" >&5 +echo "$as_me:2887: result: $cf_cv_xopen_source" >&5 echo "${ECHO_T}$cf_cv_xopen_source" >&6 if test "$cf_cv_xopen_source" != no ; then @@ -2885,16 +2991,16 @@ 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:2888: checking if we should define _POSIX_C_SOURCE" >&5 +echo "$as_me:2994: 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}:2894: testing if the symbol is already defined go no further ..." 1>&5 +echo "${as_me:-configure}:3000: testing if the symbol is already defined go no further ..." 1>&5 cat >conftest.$ac_ext <<_ACEOF -#line 2897 "configure" +#line 3003 "configure" #include "confdefs.h" #include <sys/types.h> int @@ -2909,16 +3015,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:2912: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:3018: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:2915: \$? = $ac_status" >&5 + echo "$as_me:3021: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:2918: \"$ac_try\"") >&5 + { (eval echo "$as_me:3024: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2921: \$? = $ac_status" >&5 + echo "$as_me:3027: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_posix_c_source=no else @@ -2939,7 +3045,7 @@ cf_want_posix_source=no esac if test "$cf_want_posix_source" = yes ; then cat >conftest.$ac_ext <<_ACEOF -#line 2942 "configure" +#line 3048 "configure" #include "confdefs.h" #include <sys/types.h> int @@ -2954,16 +3060,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:2957: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:3063: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:2960: \$? = $ac_status" >&5 + echo "$as_me:3066: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:2963: \"$ac_try\"") >&5 + { (eval echo "$as_me:3069: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2966: \$? = $ac_status" >&5 + echo "$as_me:3072: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else @@ -2974,15 +3080,15 @@ fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "${as_me:-configure}:2977: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5 +echo "${as_me:-configure}:3083: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5 CFLAGS="$cf_trim_CFLAGS" CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source" -echo "${as_me:-configure}:2982: testing if the second compile does not leave our definition intact error ..." 1>&5 +echo "${as_me:-configure}:3088: testing if the second compile does not leave our definition intact error ..." 1>&5 cat >conftest.$ac_ext <<_ACEOF -#line 2985 "configure" +#line 3091 "configure" #include "confdefs.h" #include <sys/types.h> int @@ -2997,16 +3103,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:3000: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:3106: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:3003: \$? = $ac_status" >&5 + echo "$as_me:3109: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:3006: \"$ac_try\"") >&5 + { (eval echo "$as_me:3112: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3009: \$? = $ac_status" >&5 + echo "$as_me:3115: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else @@ -3022,7 +3128,7 @@ fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:3025: result: $cf_cv_posix_c_source" >&5 +echo "$as_me:3131: 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 @@ -3200,7 +3306,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:3203: checking how to run the C preprocessor" >&5 +echo "$as_me:3309: 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 @@ -3221,18 +3327,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 3224 "configure" +#line 3330 "configure" #include "confdefs.h" #include <assert.h> Syntax error _ACEOF -if { (eval echo "$as_me:3229: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:3335: \"$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:3235: \$? = $ac_status" >&5 + echo "$as_me:3341: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -3255,17 +3361,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 3258 "configure" +#line 3364 "configure" #include "confdefs.h" #include <ac_nonexistent.h> _ACEOF -if { (eval echo "$as_me:3262: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:3368: \"$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:3268: \$? = $ac_status" >&5 + echo "$as_me:3374: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -3302,7 +3408,7 @@ fi else ac_cv_prog_CPP=$CPP fi -echo "$as_me:3305: result: $CPP" >&5 +echo "$as_me:3411: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6 ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes @@ -3312,18 +3418,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 3315 "configure" +#line 3421 "configure" #include "confdefs.h" #include <assert.h> Syntax error _ACEOF -if { (eval echo "$as_me:3320: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:3426: \"$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:3326: \$? = $ac_status" >&5 + echo "$as_me:3432: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -3346,17 +3452,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 3349 "configure" +#line 3455 "configure" #include "confdefs.h" #include <ac_nonexistent.h> _ACEOF -if { (eval echo "$as_me:3353: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:3459: \"$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:3359: \$? = $ac_status" >&5 + echo "$as_me:3465: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -3384,7 +3490,7 @@ rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else - { { echo "$as_me:3387: error: C preprocessor \"$CPP\" fails sanity check" >&5 + { { echo "$as_me:3493: error: C preprocessor \"$CPP\" fails sanity check" >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;} { (exit 1); exit 1; }; } fi @@ -3399,23 +3505,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:3402: checking for $ac_header" >&5 +echo "$as_me:3508: 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 3408 "configure" +#line 3514 "configure" #include "confdefs.h" #include <$ac_header> _ACEOF -if { (eval echo "$as_me:3412: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:3518: \"$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:3418: \$? = $ac_status" >&5 + echo "$as_me:3524: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -3434,7 +3540,7 @@ else fi rm -f conftest.err conftest.$ac_ext fi -echo "$as_me:3437: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "$as_me:3543: 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 @@ -3447,13 +3553,13 @@ done for ac_func in atexit do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:3450: checking for $ac_func" >&5 +echo "$as_me:3556: 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 3456 "configure" +#line 3562 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. */ @@ -3484,16 +3590,16 @@ f = $ac_func; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:3487: \"$ac_link\"") >&5 +if { (eval echo "$as_me:3593: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:3490: \$? = $ac_status" >&5 + echo "$as_me:3596: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:3493: \"$ac_try\"") >&5 + { (eval echo "$as_me:3599: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3496: \$? = $ac_status" >&5 + echo "$as_me:3602: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else @@ -3503,7 +3609,7 @@ eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:3506: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "$as_me:3612: 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 @@ -3513,7 +3619,7 @@ EOF fi done -echo "$as_me:3516: checking for working mkstemp" >&5 +echo "$as_me:3622: 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 @@ -3521,13 +3627,13 @@ else rm -rf conftest* if test "$cross_compiling" = yes; then - echo "$as_me:3524: checking for mkstemp" >&5 + echo "$as_me:3630: 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 3530 "configure" +#line 3636 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char mkstemp (); below. */ @@ -3558,16 +3664,16 @@ f = mkstemp; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:3561: \"$ac_link\"") >&5 +if { (eval echo "$as_me:3667: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:3564: \$? = $ac_status" >&5 + echo "$as_me:3670: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:3567: \"$ac_try\"") >&5 + { (eval echo "$as_me:3673: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3570: \$? = $ac_status" >&5 + echo "$as_me:3676: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_mkstemp=yes else @@ -3577,12 +3683,12 @@ ac_cv_func_mkstemp=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:3580: result: $ac_cv_func_mkstemp" >&5 +echo "$as_me:3686: result: $ac_cv_func_mkstemp" >&5 echo "${ECHO_T}$ac_cv_func_mkstemp" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 3585 "configure" +#line 3691 "configure" #include "confdefs.h" #include <sys/types.h> @@ -3620,15 +3726,15 @@ int main() _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:3623: \"$ac_link\"") >&5 +if { (eval echo "$as_me:3729: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:3626: \$? = $ac_status" >&5 + echo "$as_me:3732: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:3628: \"$ac_try\"") >&5 + { (eval echo "$as_me:3734: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3631: \$? = $ac_status" >&5 + echo "$as_me:3737: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_func_mkstemp=yes @@ -3643,7 +3749,7 @@ rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -echo "$as_me:3646: result: $cf_cv_func_mkstemp" >&5 +echo "$as_me:3752: result: $cf_cv_func_mkstemp" >&5 echo "${ECHO_T}$cf_cv_func_mkstemp" >&6 if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then cat >>confdefs.h <<\EOF @@ -3654,17 +3760,17 @@ fi GCC_VERSION=none if test "$GCC" = yes ; then - echo "$as_me:3657: checking version of $CC" >&5 + echo "$as_me:3763: 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/^[^0-9.]*//' -e 's/[^0-9.].*//'`" test -z "$GCC_VERSION" && GCC_VERSION=unknown - echo "$as_me:3661: result: $GCC_VERSION" >&5 + echo "$as_me:3767: result: $GCC_VERSION" >&5 echo "${ECHO_T}$GCC_VERSION" >&6 fi if ( test "$GCC" = yes || test "$GXX" = yes ) then -echo "$as_me:3667: checking if you want to check for gcc warnings" >&5 +echo "$as_me:3773: 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. @@ -3674,7 +3780,7 @@ if test "${with_warnings+set}" = set; then else cf_opt_with_warnings=no fi; -echo "$as_me:3677: result: $cf_opt_with_warnings" >&5 +echo "$as_me:3783: result: $cf_opt_with_warnings" >&5 echo "${ECHO_T}$cf_opt_with_warnings" >&6 if test "$cf_opt_with_warnings" != no ; then @@ -3696,10 +3802,10 @@ cat > conftest.i <<EOF EOF if test "$GCC" = yes then - { echo "$as_me:3699: checking for $CC __attribute__ directives..." >&5 + { echo "$as_me:3805: checking for $CC __attribute__ directives..." >&5 echo "$as_me: checking for $CC __attribute__ directives..." >&6;} cat > conftest.$ac_ext <<EOF -#line 3702 "${as_me:-configure}" +#line 3808 "${as_me:-configure}" #include "confdefs.h" #include "conftest.h" #include "conftest.i" @@ -3748,12 +3854,12 @@ EOF ;; esac - if { (eval echo "$as_me:3751: \"$ac_compile\"") >&5 + if { (eval echo "$as_me:3857: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:3754: \$? = $ac_status" >&5 + echo "$as_me:3860: \$? = $ac_status" >&5 (exit $ac_status); }; then - test -n "$verbose" && echo "$as_me:3756: result: ... $cf_attribute" >&5 + test -n "$verbose" && echo "$as_me:3862: result: ... $cf_attribute" >&5 echo "${ECHO_T}... $cf_attribute" >&6 cat conftest.h >>confdefs.h case $cf_attribute in #(vi @@ -3793,12 +3899,12 @@ INTEL_COMPILER=no if test "$GCC" = yes ; then case $host_os in linux*|gnu*) - echo "$as_me:3796: checking if this is really Intel C compiler" >&5 + echo "$as_me:3902: 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 3801 "configure" +#line 3907 "configure" #include "confdefs.h" int @@ -3815,16 +3921,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:3818: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:3924: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:3821: \$? = $ac_status" >&5 + echo "$as_me:3927: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:3824: \"$ac_try\"") >&5 + { (eval echo "$as_me:3930: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3827: \$? = $ac_status" >&5 + echo "$as_me:3933: \$? = $ac_status" >&5 (exit $ac_status); }; }; then INTEL_COMPILER=yes cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc" @@ -3835,14 +3941,14 @@ cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext CFLAGS="$cf_save_CFLAGS" - echo "$as_me:3838: result: $INTEL_COMPILER" >&5 + echo "$as_me:3944: result: $INTEL_COMPILER" >&5 echo "${ECHO_T}$INTEL_COMPILER" >&6 ;; esac fi cat > conftest.$ac_ext <<EOF -#line 3845 "${as_me:-configure}" +#line 3951 "${as_me:-configure}" int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; } EOF @@ -3859,7 +3965,7 @@ then # remark #981: operands are evaluated in unspecified order # warning #279: controlling expression is constant - { echo "$as_me:3862: checking for $CC warning options..." >&5 + { echo "$as_me:3968: checking for $CC warning options..." >&5 echo "$as_me: checking for $CC warning options..." >&6;} cf_save_CFLAGS="$CFLAGS" EXTRA_CFLAGS="-Wall" @@ -3875,12 +3981,12 @@ echo "$as_me: checking for $CC warning options..." >&6;} wd981 do CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt" - if { (eval echo "$as_me:3878: \"$ac_compile\"") >&5 + if { (eval echo "$as_me:3984: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:3881: \$? = $ac_status" >&5 + echo "$as_me:3987: \$? = $ac_status" >&5 (exit $ac_status); }; then - test -n "$verbose" && echo "$as_me:3883: result: ... -$cf_opt" >&5 + test -n "$verbose" && echo "$as_me:3989: result: ... -$cf_opt" >&5 echo "${ECHO_T}... -$cf_opt" >&6 EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt" fi @@ -3889,7 +3995,7 @@ echo "${ECHO_T}... -$cf_opt" >&6 elif test "$GCC" = yes then - { echo "$as_me:3892: checking for $CC warning options..." >&5 + { echo "$as_me:3998: checking for $CC warning options..." >&5 echo "$as_me: checking for $CC warning options..." >&6;} cf_save_CFLAGS="$CFLAGS" EXTRA_CFLAGS= @@ -3909,12 +4015,12 @@ echo "$as_me: checking for $CC warning options..." >&6;} Wundef $cf_warn_CONST Wwrite-strings do CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt" - if { (eval echo "$as_me:3912: \"$ac_compile\"") >&5 + if { (eval echo "$as_me:4018: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:3915: \$? = $ac_status" >&5 + echo "$as_me:4021: \$? = $ac_status" >&5 (exit $ac_status); }; then - test -n "$verbose" && echo "$as_me:3917: result: ... -$cf_opt" >&5 + test -n "$verbose" && echo "$as_me:4023: result: ... -$cf_opt" >&5 echo "${ECHO_T}... -$cf_opt" >&6 case $cf_opt in #(vi Wcast-qual) #(vi @@ -3925,7 +4031,7 @@ echo "${ECHO_T}... -$cf_opt" >&6 [34].*) test -n "$verbose" && echo " feature is broken in gcc $GCC_VERSION" 1>&6 -echo "${as_me:-configure}:3928: testing feature is broken in gcc $GCC_VERSION ..." 1>&5 +echo "${as_me:-configure}:4034: testing feature is broken in gcc $GCC_VERSION ..." 1>&5 continue;; esac @@ -3941,7 +4047,7 @@ rm -rf conftest* fi fi -echo "$as_me:3944: checking if you want to see long compiling messages" >&5 +echo "$as_me:4050: 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. @@ -3975,7 +4081,7 @@ else ECHO_CC='' fi; -echo "$as_me:3978: result: $enableval" >&5 +echo "$as_me:4084: result: $enableval" >&5 echo "${ECHO_T}$enableval" >&6 case $cf_cv_system_name in @@ -3995,7 +4101,7 @@ test -n "$PROG_EXT" && cat >>confdefs.h <<EOF #define PROG_EXT "$PROG_EXT" EOF -echo "$as_me:3998: checking if you want to use dmalloc for testing" >&5 +echo "$as_me:4104: 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. @@ -4011,7 +4117,7 @@ EOF else with_dmalloc= fi; -echo "$as_me:4014: result: ${with_dmalloc:-no}" >&5 +echo "$as_me:4120: result: ${with_dmalloc:-no}" >&5 echo "${ECHO_T}${with_dmalloc:-no}" >&6 case .$with_cflags in #(vi @@ -4105,23 +4211,23 @@ fi esac if test "$with_dmalloc" = yes ; then - echo "$as_me:4108: checking for dmalloc.h" >&5 + echo "$as_me:4214: 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 4114 "configure" +#line 4220 "configure" #include "confdefs.h" #include <dmalloc.h> _ACEOF -if { (eval echo "$as_me:4118: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:4224: \"$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:4124: \$? = $ac_status" >&5 + echo "$as_me:4230: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -4140,11 +4246,11 @@ else fi rm -f conftest.err conftest.$ac_ext fi -echo "$as_me:4143: result: $ac_cv_header_dmalloc_h" >&5 +echo "$as_me:4249: 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:4147: checking for dmalloc_debug in -ldmalloc" >&5 +echo "$as_me:4253: 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 @@ -4152,7 +4258,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-ldmalloc $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 4155 "configure" +#line 4261 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -4171,16 +4277,16 @@ dmalloc_debug (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:4174: \"$ac_link\"") >&5 +if { (eval echo "$as_me:4280: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:4177: \$? = $ac_status" >&5 + echo "$as_me:4283: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:4180: \"$ac_try\"") >&5 + { (eval echo "$as_me:4286: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4183: \$? = $ac_status" >&5 + echo "$as_me:4289: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dmalloc_dmalloc_debug=yes else @@ -4191,7 +4297,7 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:4194: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5 +echo "$as_me:4300: 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 @@ -4206,7 +4312,7 @@ fi fi -echo "$as_me:4209: checking if you want to use dbmalloc for testing" >&5 +echo "$as_me:4315: 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. @@ -4222,7 +4328,7 @@ EOF else with_dbmalloc= fi; -echo "$as_me:4225: result: ${with_dbmalloc:-no}" >&5 +echo "$as_me:4331: result: ${with_dbmalloc:-no}" >&5 echo "${ECHO_T}${with_dbmalloc:-no}" >&6 case .$with_cflags in #(vi @@ -4316,23 +4422,23 @@ fi esac if test "$with_dbmalloc" = yes ; then - echo "$as_me:4319: checking for dbmalloc.h" >&5 + echo "$as_me:4425: 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 4325 "configure" +#line 4431 "configure" #include "confdefs.h" #include <dbmalloc.h> _ACEOF -if { (eval echo "$as_me:4329: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:4435: \"$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:4335: \$? = $ac_status" >&5 + echo "$as_me:4441: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -4351,11 +4457,11 @@ else fi rm -f conftest.err conftest.$ac_ext fi -echo "$as_me:4354: result: $ac_cv_header_dbmalloc_h" >&5 +echo "$as_me:4460: 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:4358: checking for debug_malloc in -ldbmalloc" >&5 +echo "$as_me:4464: 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 @@ -4363,7 +4469,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-ldbmalloc $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 4366 "configure" +#line 4472 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -4382,16 +4488,16 @@ debug_malloc (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:4385: \"$ac_link\"") >&5 +if { (eval echo "$as_me:4491: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:4388: \$? = $ac_status" >&5 + echo "$as_me:4494: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:4391: \"$ac_try\"") >&5 + { (eval echo "$as_me:4497: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4394: \$? = $ac_status" >&5 + echo "$as_me:4500: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dbmalloc_debug_malloc=yes else @@ -4402,7 +4508,7 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:4405: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5 +echo "$as_me:4511: 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 @@ -4417,7 +4523,7 @@ fi fi -echo "$as_me:4420: checking if you want to use valgrind for testing" >&5 +echo "$as_me:4526: 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. @@ -4433,7 +4539,7 @@ EOF else with_valgrind= fi; -echo "$as_me:4436: result: ${with_valgrind:-no}" >&5 +echo "$as_me:4542: result: ${with_valgrind:-no}" >&5 echo "${ECHO_T}${with_valgrind:-no}" >&6 case .$with_cflags in #(vi @@ -4526,7 +4632,7 @@ fi ;; esac -echo "$as_me:4529: checking if you want to perform memory-leak testing" >&5 +echo "$as_me:4635: 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. @@ -4536,7 +4642,7 @@ if test "${enable_leaks+set}" = set; then else : ${with_no_leaks:=no} fi; -echo "$as_me:4539: result: $with_no_leaks" >&5 +echo "$as_me:4645: result: $with_no_leaks" >&5 echo "${ECHO_T}$with_no_leaks" >&6 if test "$with_no_leaks" = yes ; then @@ -4632,7 +4738,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:4635: creating $CONFIG_STATUS" >&5 +{ echo "$as_me:4741: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL @@ -4764,7 +4870,7 @@ EOF cat >>$CONFIG_STATUS <<EOF ac_cs_version="\\ config.status -configured by $0, generated by GNU Autoconf 2.52.20101001, +configured by $0, generated by GNU Autoconf 2.52.20101002, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 @@ -4808,7 +4914,7 @@ cat >>$CONFIG_STATUS <<\EOF echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header - { { echo "$as_me:4811: error: ambiguous option: $1 + { { echo "$as_me:4917: 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;} @@ -4827,7 +4933,7 @@ Try \`$0 --help' for more information." >&2;} ac_need_defaults=false;; # This is an error. - -*) { { echo "$as_me:4830: error: unrecognized option: $1 + -*) { { echo "$as_me:4936: 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;} @@ -4846,7 +4952,7 @@ cat >&5 << _ACEOF ## Running config.status. ## ## ----------------------- ## -This file was extended by $as_me 2.52.20101001, executed with +This file was extended by $as_me 2.52.20101002, executed with CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS @@ -4865,7 +4971,7 @@ do "makefile" ) CONFIG_FILES="$CONFIG_FILES makefile" ;; "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h:config_h.in" ;; - *) { { echo "$as_me:4868: error: invalid argument: $ac_config_target" >&5 + *) { { echo "$as_me:4974: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac @@ -5099,7 +5205,7 @@ done; } esac if test x"$ac_file" != x-; then - { echo "$as_me:5102: creating $ac_file" >&5 + { echo "$as_me:5208: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi @@ -5117,7 +5223,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:5120: error: cannot find input file: $f" >&5 + test -f "$f" || { { echo "$as_me:5226: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo $f;; @@ -5130,7 +5236,7 @@ echo "$as_me: error: cannot find input file: $f" >&2;} echo $srcdir/$f else # /dev/null tree - { { echo "$as_me:5133: error: cannot find input file: $f" >&5 + { { echo "$as_me:5239: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; @@ -5196,7 +5302,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:5199: creating $ac_file" >&5 + test x"$ac_file" != x- && { echo "$as_me:5305: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} # First look for the input files in the build tree, otherwise in the @@ -5207,7 +5313,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:5210: error: cannot find input file: $f" >&5 + test -f "$f" || { { echo "$as_me:5316: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo $f;; @@ -5220,7 +5326,7 @@ echo "$as_me: error: cannot find input file: $f" >&2;} echo $srcdir/$f else # /dev/null tree - { { echo "$as_me:5223: error: cannot find input file: $f" >&5 + { { echo "$as_me:5329: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; @@ -5278,7 +5384,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:5281: $ac_file is unchanged" >&5 + { echo "$as_me:5387: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ @@ -1,4 +1,4 @@ -/* $Id: defs.h,v 1.33 2010/12/29 20:57:30 tom Exp $ */ +/* $Id: defs.h,v 1.35 2011/09/07 08:55:03 tom Exp $ */ #ifdef HAVE_CONFIG_H #include <config.h> @@ -71,10 +71,12 @@ #if defined(VMS) #define CODE_SUFFIX "_code.c" #define DEFINES_SUFFIX "_tab.h" +#define EXTERNS_SUFFIX "_tab.i" #define OUTPUT_SUFFIX "_tab.c" #else #define CODE_SUFFIX ".code.c" #define DEFINES_SUFFIX ".tab.h" +#define EXTERNS_SUFFIX ".tab.i" #define OUTPUT_SUFFIX ".tab.c" #endif #define VERBOSE_SUFFIX ".output" @@ -225,6 +227,7 @@ struct param extern char dflag; extern char gflag; +extern char iflag; extern char lflag; extern char rflag; extern char tflag; @@ -242,6 +245,8 @@ extern int pure_parser; extern const char *const banner[]; extern const char *const xdecls[]; extern const char *const tables[]; +extern const char *const global_vars[]; +extern const char *const impure_vars[]; extern const char *const hdr_defs[]; extern const char *const hdr_vars[]; extern const char *const body_1[]; @@ -253,10 +258,13 @@ extern const char *const trailer_2[]; extern char *code_file_name; extern char *input_file_name; +extern char *defines_file_name; +extern char *externs_file_name; extern FILE *action_file; extern FILE *code_file; extern FILE *defines_file; +extern FILE *externs_file; extern FILE *input_file; extern FILE *output_file; extern FILE *text_file; @@ -353,6 +361,7 @@ extern void dollar_warning(int a_lineno, int i); extern void fatal(const char *msg) GCC_NORETURN; extern void illegal_character(char *c_cptr) GCC_NORETURN; extern void illegal_tag(int t_lineno, char *t_line, char *t_cptr) GCC_NORETURN; +extern void missing_brace(void) GCC_NORETURN; extern void no_grammar(void) GCC_NORETURN; extern void no_space(void) GCC_NORETURN; extern void open_error(const char *filename) GCC_NORETURN; @@ -412,7 +421,7 @@ extern void output(void); extern void reader(void); /* skeleton.c */ -extern void write_section(const char *const section[]); +extern void write_section(FILE *fp, const char *const section[]); /* verbose.c */ extern void verbose(void); @@ -1,4 +1,4 @@ -/* $Id: error.c,v 1.8 2010/11/24 15:10:20 tom Exp $ */ +/* $Id: error.c,v 1.9 2011/09/05 23:27:43 tom Exp $ */ /* routines for printing error messages */ @@ -26,6 +26,14 @@ open_error(const char *filename) } void +missing_brace(void) +{ + fprintf(stderr, "%s: e - line %d of \"%s\", missing '}'\n", + myname, lineno, input_file_name); + done(1); +} + +void unexpected_EOF(void) { fprintf(stderr, "%s: e - line %d of \"%s\", unexpected end-of-file\n", @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.35 2010/12/27 01:21:59 tom Exp $ */ +/* $Id: main.c,v 1.36 2011/09/06 22:44:45 tom Exp $ */ #include <signal.h> #include <unistd.h> /* for _exit() */ @@ -34,6 +34,7 @@ static MY_TMPFILES *my_tmpfiles; char dflag; char gflag; +char iflag; char lflag; static char oflag; char rflag; @@ -53,7 +54,9 @@ static char *file_prefix = default_file_prefix; char *code_file_name; char *input_file_name = empty_string; -static char *defines_file_name; +char *defines_file_name; +char *externs_file_name; + static char *graph_file_name; static char *output_file_name; static char *verbose_file_name; @@ -62,6 +65,7 @@ FILE *action_file; /* a temp file, used to save actions associated */ /* with rules until the parser is written */ FILE *code_file; /* y.code.c (used when the -r option is specified) */ FILE *defines_file; /* y.tab.h */ +FILE *externs_file; /* y.tab.i */ FILE *input_file; /* the input file */ FILE *output_file; /* y.tab.c */ FILE *text_file; /* a temp file, used to save text until all */ @@ -132,6 +136,9 @@ done(int k) if (dflag) DO_FREE(defines_file_name); + if (iflag) + DO_FREE(externs_file_name); + if (oflag) DO_FREE(output_file_name); @@ -187,6 +194,7 @@ usage(void) ,"Options:" ," -b file_prefix set filename prefix (default \"y.\")" ," -d write definitions (y.tab.h)" + ," -i write interface (y.tab.i)" ," -g write a graphical description" ," -l suppress #line directives" ," -o output_file (default \"y.tab.c\")" @@ -220,6 +228,10 @@ setflag(int ch) gflag = 1; break; + case 'i': + iflag = 1; + break; + case 'l': lflag = 1; break; @@ -359,17 +371,22 @@ create_file_names(void) { size_t len; const char *defines_suffix; + const char *externs_suffix; char *prefix; prefix = NULL; defines_suffix = DEFINES_SUFFIX; + externs_suffix = EXTERNS_SUFFIX; /* compute the file_prefix from the user provided output_file_name */ if (output_file_name != 0) { if (!(prefix = strstr(output_file_name, ".tab.c")) && (prefix = strstr(output_file_name, ".c"))) + { defines_suffix = ".h"; + externs_suffix = ".i"; + } } if (prefix != NULL) @@ -401,6 +418,11 @@ create_file_names(void) CREATE_FILE_NAME(defines_file_name, defines_suffix); } + if (iflag) + { + CREATE_FILE_NAME(externs_file_name, externs_suffix); + } + if (vflag) { CREATE_FILE_NAME(verbose_file_name, VERBOSE_SUFFIX); @@ -592,6 +614,13 @@ open_files(void) union_file = open_tmpfile("union_file"); } + if (iflag) + { + externs_file = fopen(externs_file_name, "w"); + if (externs_file == 0) + open_error(externs_file_name); + } + output_file = fopen(output_file_name, "w"); if (output_file == 0) open_error(output_file_name); @@ -1,4 +1,4 @@ -/* $Id: output.c,v 1.38 2010/12/29 18:35:38 Christos.Zoulas Exp $ */ +/* $Id: output.c,v 1.41 2011/09/08 09:25:40 tom Exp $ */ #include "defs.h" @@ -22,33 +22,34 @@ static int lowzero; static int high; static void -putc_code(int c) +putc_code(FILE * fp, int c) { - if (c == '\n') + if ((c == '\n') && (fp == code_file)) ++outline; - putc(c, code_file); + putc(c, fp); } static void -putl_code(const char *s) +putl_code(FILE * fp, const char *s) { - ++outline; - fputs(s, code_file); + if (fp == code_file) + ++outline; + fputs(s, fp); } static void -puts_code(const char *s) +puts_code(FILE * fp, const char *s) { - fputs(s, code_file); + fputs(s, fp); } static void -write_code_lineno(void) +write_code_lineno(FILE * fp) { - if (!lflag) + if (!lflag && (fp == code_file)) { ++outline; - fprintf(code_file, line_format, outline, code_file_name); + fprintf(fp, line_format, outline, code_file_name); } } @@ -818,7 +819,7 @@ is_C_identifier(char *name) } static void -output_defines(void) +output_defines(FILE * fp) { int c, i; char *s; @@ -828,51 +829,48 @@ output_defines(void) s = symbol_name[i]; if (is_C_identifier(s)) { - puts_code("#define "); - if (dflag) - fprintf(defines_file, "#define "); + fprintf(fp, "#define "); c = *s; if (c == '"') { while ((c = *++s) != '"') { - putc(c, code_file); - if (dflag) - putc(c, defines_file); + putc(c, fp); } } else { do { - putc(c, code_file); - if (dflag) - putc(c, defines_file); + putc(c, fp); } while ((c = *++s) != 0); } - ++outline; - fprintf(code_file, " %d\n", symbol_value[i]); - if (dflag) - fprintf(defines_file, " %d\n", symbol_value[i]); + if (fp == code_file) + ++outline; + fprintf(fp, " %d\n", symbol_value[i]); } } - ++outline; - fprintf(code_file, "#define YYERRCODE %d\n", symbol_value[1]); + if (fp == code_file) + ++outline; + if (fp != defines_file || iflag) + fprintf(fp, "#define YYERRCODE %d\n", symbol_value[1]); - if (dflag && unionized) + if (fp == defines_file || (iflag && !dflag)) { - rewind(union_file); - while ((c = getc(union_file)) != EOF) - putc(c, defines_file); - fprintf(defines_file, "extern YYSTYPE %slval;\n", - symbol_prefix); + if (unionized) + { + rewind(union_file); + while ((c = getc(union_file)) != EOF) + putc(c, fp); + fprintf(fp, "extern YYSTYPE %slval;\n", symbol_prefix); + } } } static void -output_stored_text(void) +output_stored_text(FILE * fp) { int c; FILE *in; @@ -883,12 +881,12 @@ output_stored_text(void) in = text_file; if ((c = getc(in)) == EOF) return; - putc_code(c); + putc_code(fp, c); while ((c = getc(in)) != EOF) { - putc_code(c); + putc_code(fp, c); } - write_code_lineno(); + write_code_lineno(fp); } static void @@ -901,10 +899,10 @@ output_debug(void) ++outline; fprintf(code_file, "#define YYFINAL %d\n", final_state); - putl_code("#ifndef YYDEBUG\n"); + putl_code(code_file, "#ifndef YYDEBUG\n"); ++outline; fprintf(code_file, "#define YYDEBUG %d\n", tflag); - putl_code("#endif\n"); + putl_code(code_file, "#endif\n"); if (rflag) { @@ -1112,26 +1110,25 @@ output_debug(void) } static void -output_pure_parser(void) +output_pure_parser(FILE * fp) { - putc_code('\n'); + putc_code(fp, '\n'); - outline += 1; - fprintf(code_file, "#define YYPURE %d\n", pure_parser); - - putc_code('\n'); + if (fp == code_file) + outline += 1; + fprintf(fp, "#define YYPURE %d\n", pure_parser); + putc_code(fp, '\n'); } static void -output_stype(void) +output_stype(FILE * fp) { if (!unionized && ntags == 0) { - putc_code('\n'); - putl_code("#ifndef YYSTYPE\n"); - putl_code("typedef int YYSTYPE;\n"); - putl_code("#endif\n"); - putc_code('\n'); + putc_code(fp, '\n'); + putl_code(fp, "#ifndef YYSTYPE\n"); + putl_code(fp, "typedef int YYSTYPE;\n"); + putl_code(fp, "#endif\n"); } } @@ -1152,7 +1149,7 @@ output_trailing_text(void) if ((c = getc(in)) == EOF) return; write_input_lineno(); - putc_code(c); + putc_code(code_file, c); last = c; } else @@ -1160,24 +1157,24 @@ output_trailing_text(void) write_input_lineno(); do { - putc_code(c); + putc_code(code_file, c); } while ((c = *++cptr) != '\n'); - putc_code(c); + putc_code(code_file, c); last = '\n'; } while ((c = getc(in)) != EOF) { - putc_code(c); + putc_code(code_file, c); last = c; } if (last != '\n') { - putc_code('\n'); + putc_code(code_file, '\n'); } - write_code_lineno(); + write_code_lineno(code_file); } static void @@ -1190,135 +1187,136 @@ output_semantic_actions(void) return; last = c; - putc_code(c); + putc_code(code_file, c); while ((c = getc(action_file)) != EOF) { - putc_code(c); + putc_code(code_file, c); last = c; } if (last != '\n') { - putc_code('\n'); + putc_code(code_file, '\n'); } - write_code_lineno(); + write_code_lineno(code_file); } static void -output_parse_decl(void) +output_parse_decl(FILE * fp) { - putl_code("/* compatibility with bison */\n"); - putl_code("#ifdef YYPARSE_PARAM\n"); - putl_code("/* compatibility with FreeBSD */\n"); - putl_code("# ifdef YYPARSE_PARAM_TYPE\n"); - putl_code("# define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM)\n"); - putl_code("# else\n"); - putl_code("# define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM)\n"); - putl_code("# endif\n"); - putl_code("#else\n"); - - puts_code("# define YYPARSE_DECL() yyparse("); + putl_code(fp, "\n"); + putl_code(fp, "/* compatibility with bison */\n"); + putl_code(fp, "#ifdef YYPARSE_PARAM\n"); + putl_code(fp, "/* compatibility with FreeBSD */\n"); + putl_code(fp, "# ifdef YYPARSE_PARAM_TYPE\n"); + putl_code(fp, + "# define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM)\n"); + putl_code(fp, "# else\n"); + putl_code(fp, "# define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM)\n"); + putl_code(fp, "# endif\n"); + putl_code(fp, "#else\n"); + + puts_code(fp, "# define YYPARSE_DECL() yyparse("); if (!parse_param) - puts_code("void"); + puts_code(fp, "void"); else { param *p; for (p = parse_param; p; p = p->next) - fprintf(code_file, "%s %s%s%s", p->type, p->name, p->type2, + fprintf(fp, "%s %s%s%s", p->type, p->name, p->type2, p->next ? ", " : ""); } - putl_code(")\n"); + putl_code(fp, ")\n"); - putl_code("#endif\n"); - putl_code("\n"); + putl_code(fp, "#endif\n"); } static void -output_lex_decl(void) +output_lex_decl(FILE * fp) { - putl_code("/* Parameters sent to lex. */\n"); - putl_code("#ifdef YYLEX_PARAM\n"); + putl_code(fp, "\n"); + putl_code(fp, "/* Parameters sent to lex. */\n"); + putl_code(fp, "#ifdef YYLEX_PARAM\n"); if (pure_parser) { - putl_code("# define YYLEX_DECL() yylex(YYSTYPE *yylval, " + putl_code(fp, "# define YYLEX_DECL() yylex(YYSTYPE *yylval, " "void *YYLEX_PARAM)\n"); - putl_code("# define YYLEX yylex(&yylval, YYLEX_PARAM)\n"); + putl_code(fp, "# define YYLEX yylex(&yylval, YYLEX_PARAM)\n"); } else { - putl_code("# define YYLEX_DECL() yylex(void *YYLEX_PARAM)\n"); - putl_code("# define YYLEX yylex(YYLEX_PARAM)\n"); + putl_code(fp, "# define YYLEX_DECL() yylex(void *YYLEX_PARAM)\n"); + putl_code(fp, "# define YYLEX yylex(YYLEX_PARAM)\n"); } - putl_code("#else\n"); + putl_code(fp, "#else\n"); if (pure_parser && lex_param) { param *p; - puts_code("# define YYLEX_DECL() yylex(YYSTYPE *yylval, "); + puts_code(fp, "# define YYLEX_DECL() yylex(YYSTYPE *yylval, "); for (p = lex_param; p; p = p->next) - fprintf(code_file, "%s %s%s%s", p->type, p->name, p->type2, + fprintf(fp, "%s %s%s%s", p->type, p->name, p->type2, p->next ? ", " : ""); - putl_code(")\n"); + putl_code(fp, ")\n"); - puts_code("# define YYLEX yylex(&yylval, "); + puts_code(fp, "# define YYLEX yylex(&yylval, "); for (p = lex_param; p; p = p->next) - fprintf(code_file, "%s%s", p->name, p->next ? ", " : ""); - putl_code(")\n"); + fprintf(fp, "%s%s", p->name, p->next ? ", " : ""); + putl_code(fp, ")\n"); } else if (pure_parser) { - putl_code("# define YYLEX_DECL() yylex(YYSTYPE *yylval)\n"); - putl_code("# define YYLEX yylex(&yylval)\n"); + putl_code(fp, "# define YYLEX_DECL() yylex(YYSTYPE *yylval)\n"); + putl_code(fp, "# define YYLEX yylex(&yylval)\n"); } else if (lex_param) { param *p; - puts_code("# define YYLEX_DECL() yylex("); + puts_code(fp, "# define YYLEX_DECL() yylex("); for (p = lex_param; p; p = p->next) - fprintf(code_file, "%s %s%s%s", p->type, p->name, p->type2, + fprintf(fp, "%s %s%s%s", p->type, p->name, p->type2, p->next ? ", " : ""); - putl_code(")\n"); + putl_code(fp, ")\n"); - puts_code("# define YYLEX yylex("); + puts_code(fp, "# define YYLEX yylex("); for (p = lex_param; p; p = p->next) - fprintf(code_file, "%s%s", p->name, p->next ? ", " : ""); - putl_code(")\n"); + fprintf(fp, "%s%s", p->name, p->next ? ", " : ""); + putl_code(fp, ")\n"); } else { - putl_code("# define YYLEX_DECL() yylex(void)\n"); - putl_code("# define YYLEX yylex()\n"); + putl_code(fp, "# define YYLEX_DECL() yylex(void)\n"); + putl_code(fp, "# define YYLEX yylex()\n"); } - putl_code("#endif\n"); - putl_code("\n"); + putl_code(fp, "#endif\n"); } static void -output_error_decl(void) +output_error_decl(FILE * fp) { - putl_code("/* Parameters sent to yyerror. */\n"); + putl_code(fp, "\n"); + putl_code(fp, "/* Parameters sent to yyerror. */\n"); if (parse_param) { param *p; - fprintf(code_file, "#define YYERROR_DECL() yyerror("); + fprintf(fp, "#define YYERROR_DECL() yyerror("); for (p = parse_param; p; p = p->next) - fprintf(code_file, "%s %s%s, ", p->type, p->name, p->type2); - putl_code("const char *s)\n"); + fprintf(fp, "%s %s%s, ", p->type, p->name, p->type2); + putl_code(fp, "const char *s)\n"); - puts_code("#define YYERROR_CALL(msg) yyerror("); + puts_code(fp, "#define YYERROR_CALL(msg) yyerror("); for (p = parse_param; p; p = p->next) - fprintf(code_file, "%s, ", p->name); + fprintf(fp, "%s, ", p->name); - putl_code("msg)\n"); + putl_code(fp, "msg)\n"); } else { - putl_code("#define YYERROR_DECL() yyerror(const char *s)\n"); - putl_code("#define YYERROR_CALL(msg) yyerror(msg)\n"); + putl_code(fp, "#define YYERROR_DECL() yyerror(const char *s)\n"); + putl_code(fp, "#define YYERROR_CALL(msg) yyerror(msg)\n"); } - putl_code("\n"); } static void @@ -1363,33 +1361,92 @@ free_reductions(void) static void output_yyerror_call(const char *msg) { - puts_code(" yyerror("); + FILE *fp = code_file; + + puts_code(fp, " yyerror("); if (parse_param) { param *p; for (p = parse_param; p; p = p->next) - fprintf(code_file, "%s, ", p->name); + fprintf(fp, "%s, ", p->name); + } + puts_code(fp, "\""); + puts_code(fp, msg); + putl_code(fp, "\");\n"); +} + +static void +output_externs(FILE * fp, const char *const section[]) +{ + int c; + int i; + const char *s; + + for (i = 0; (s = section[i]) != 0; ++i) + { + if (*s && *s != '#') + fputs("extern\t", fp); + while ((c = *s) != 0) + { + putc(c, fp); + ++s; + } + if (fp == code_file) + ++outline; + putc('\n', fp); } - puts_code("\""); - puts_code(msg); - putl_code("\");\n"); } void output(void) { + FILE *fp; + free_itemsets(); free_shifts(); free_reductions(); - output_prefix(output_file); - output_pure_parser(); - output_stored_text(); - output_stype(); - output_parse_decl(); - output_lex_decl(); - output_error_decl(); - write_section(xdecls); - output_defines(); + + if (iflag) + { + ++outline; + fprintf(code_file, "#include \"%s\"\n", externs_file_name); + fp = externs_file; + } + else + fp = code_file; + + output_prefix(iflag ? externs_file : output_file); + output_pure_parser(fp); + output_stored_text(fp); + output_stype(fp); + output_parse_decl(fp); + output_lex_decl(fp); + output_error_decl(fp); + write_section(fp, xdecls); + + if (iflag) + { + output_externs(externs_file, global_vars); + if (!pure_parser) + output_externs(externs_file, impure_vars); + } + + if (iflag) + { + ++outline; + fprintf(code_file, "#include \"%s\"\n", defines_file_name); + if (!dflag) + output_defines(externs_file); + } + else + { + putc_code(code_file, '\n'); + output_defines(code_file); + } + + if (dflag) + output_defines(defines_file); + output_rule_data(); output_yydefred(); output_actions(); @@ -1398,27 +1455,32 @@ output(void) if (rflag) { output_prefix(code_file); - write_section(xdecls); - write_section(tables); + write_section(code_file, xdecls); + write_section(code_file, tables); + } + write_section(code_file, global_vars); + if (!pure_parser) + { + write_section(code_file, impure_vars); } - write_section(hdr_defs); + write_section(code_file, hdr_defs); if (!pure_parser) { - write_section(hdr_vars); + write_section(code_file, hdr_vars); } output_trailing_text(); - write_section(body_1); + write_section(code_file, body_1); if (pure_parser) { - write_section(body_vars); + write_section(code_file, body_vars); } - write_section(body_2); + write_section(code_file, body_2); output_yyerror_call("syntax error"); - write_section(body_3); + write_section(code_file, body_3); output_semantic_actions(); - write_section(trailer); + write_section(code_file, trailer); output_yyerror_call("yacc stack overflow"); - write_section(trailer_2); + write_section(code_file, trailer_2); } #ifdef NO_LEAKS diff --git a/package/byacc.spec b/package/byacc.spec index 4e6a38b..7d13982 100644 --- a/package/byacc.spec +++ b/package/byacc.spec @@ -1,8 +1,8 @@ Summary: byacc - public domain Berkeley LALR Yacc parser generator %define AppProgram byacc -%define AppVersion 20101229 +%define AppVersion 20110908 %define UseProgram yacc -# $XTermId: byacc.spec,v 1.8 2010/12/29 18:03:14 tom Exp $ +# $XTermId: byacc.spec,v 1.10 2011/09/08 09:45:02 tom Exp $ Name: %{AppProgram} Version: %{AppVersion} Release: 1 diff --git a/package/debian/changelog b/package/debian/changelog index a36598b..fc40d90 100644 --- a/package/debian/changelog +++ b/package/debian/changelog @@ -1,3 +1,10 @@ +byacc (20110908) unstable; urgency=low + + * add "-i" option. + * add error-check in reader.c + + -- Thomas E. Dickey <dickey@invisible-island.net> Mon, 05 Sep 2011 20:05:51 -0400 + byacc (20101229) unstable; urgency=low * fixes from Christos Zoulos @@ -1,4 +1,4 @@ -/* $Id: reader.c,v 1.31 2010/11/26 12:30:40 tom Exp $ */ +/* $Id: reader.c,v 1.33 2011/09/06 22:56:53 tom Exp $ */ #include "defs.h" @@ -689,6 +689,8 @@ copy_param(int k) for (i = 0; (c = *cptr++) != '}'; i++) { + if (c == '\0') + missing_brace(); if (c == EOF) unexpected_EOF(); buf[i] = (char)c; @@ -2197,7 +2199,7 @@ print_grammar(void) void reader(void) { - write_section(banner); + write_section(code_file, banner); create_symbol_table(); read_declarations(); read_grammar(); @@ -1,4 +1,4 @@ -/* $Id: skeleton.c,v 1.30 2010/12/29 20:57:21 tom Exp $ */ +/* $Id: skeleton.c,v 1.31 2011/09/07 09:37:59 tom Exp $ */ #include "defs.h" @@ -37,8 +37,8 @@ const char *const banner[] = const char *const xdecls[] = { - "extern int YYPARSE_DECL();", "", + "extern int YYPARSE_DECL();", 0 }; @@ -61,8 +61,27 @@ const char *const tables[] = 0 }; +const char *const global_vars[] = +{ + "", + "int yydebug;", + "int yynerrs;", + 0 +}; + +const char *const impure_vars[] = +{ + "", + "int yyerrflag;", + "int yychar;", + "YYSTYPE yyval;", + "YYSTYPE yylval;", + 0 +}; + const char *const hdr_defs[] = { + "", "/* define the initial stack-sizes */", "#ifdef YYSTACKSIZE", "#undef YYMAXDEPTH", @@ -78,9 +97,6 @@ const char *const hdr_defs[] = "", "#define YYINITSTACKSIZE 500", "", - "int yydebug;", - "int yynerrs;", - "", "typedef struct {", " unsigned stacksize;", " short *s_base;", @@ -94,11 +110,6 @@ const char *const hdr_defs[] = const char *const hdr_vars[] = { - "int yyerrflag;", - "int yychar;", - "YYSTYPE yyval;", - "YYSTYPE yylval;", - "", "/* variables for the parser stack */", "static YYSTACKDATA yystack;", 0 @@ -408,22 +419,21 @@ const char *const trailer_2[] = }; void -write_section(const char *const section[]) +write_section(FILE * fp, const char *const section[]) { int c; int i; const char *s; - FILE *f; - f = code_file; for (i = 0; (s = section[i]) != 0; ++i) { - ++outline; while ((c = *s) != 0) { - putc(c, f); + putc(c, fp); ++s; } - putc('\n', f); + if (fp == code_file) + ++outline; + putc('\n', fp); } } diff --git a/test/calc.tab.c b/test/calc.tab.c index 9554d8f..d13ebb9 100644 --- a/test/calc.tab.c +++ b/test/calc.tab.c @@ -260,6 +260,15 @@ static const char *yyrule[] = { }; #endif + +int yydebug; +int yynerrs; + +int yyerrflag; +int yychar; +YYSTYPE yyval; +YYSTYPE yylval; + /* define the initial stack-sizes */ #ifdef YYSTACKSIZE #undef YYMAXDEPTH @@ -275,9 +284,6 @@ static const char *yyrule[] = { #define YYINITSTACKSIZE 500 -int yydebug; -int yynerrs; - typedef struct { unsigned stacksize; short *s_base; @@ -286,11 +292,6 @@ typedef struct { YYSTYPE *l_base; YYSTYPE *l_mark; } YYSTACKDATA; -int yyerrflag; -int yychar; -YYSTYPE yyval; -YYSTYPE yylval; - /* variables for the parser stack */ static YYSTACKDATA yystack; #line 63 "calc.y" @@ -340,7 +341,7 @@ yylex(void) } return( c ); } -#line 344 "calc.tab.c" +#line 345 "calc.tab.c" #if YYDEBUG #include <stdio.h> /* needed for printf */ @@ -606,7 +607,7 @@ case 18: #line 60 "calc.y" { yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; } break; -#line 610 "calc.tab.c" +#line 611 "calc.tab.c" } yystack.s_mark -= yym; yystate = *yystack.s_mark; diff --git a/test/calc1.tab.c b/test/calc1.tab.c index e55e64a..415b7f6 100644 --- a/test/calc1.tab.c +++ b/test/calc1.tab.c @@ -133,6 +133,7 @@ typedef union } YYSTYPE; #endif /* !YYSTYPE_IS_DECLARED */ #line 136 "calc1.tab.c" + /* compatibility with bison */ #ifdef YYPARSE_PARAM /* compatibility with FreeBSD */ @@ -309,6 +310,15 @@ static const char *yyrule[] = { }; #endif + +int yydebug; +int yynerrs; + +int yyerrflag; +int yychar; +YYSTYPE yyval; +YYSTYPE yylval; + /* define the initial stack-sizes */ #ifdef YYSTACKSIZE #undef YYMAXDEPTH @@ -324,9 +334,6 @@ static const char *yyrule[] = { #define YYINITSTACKSIZE 500 -int yydebug; -int yynerrs; - typedef struct { unsigned stacksize; short *s_base; @@ -335,11 +342,6 @@ typedef struct { YYSTYPE *l_base; YYSTYPE *l_mark; } YYSTACKDATA; -int yyerrflag; -int yychar; -YYSTYPE yyval; -YYSTYPE yylval; - /* variables for the parser stack */ static YYSTACKDATA yystack; #line 173 "calc1.y" @@ -478,7 +480,7 @@ vdiv(double a, double b, INTERVAL v) { return (hilo(a / v.hi, a / v.lo, b / v.hi, b / v.lo)); } -#line 482 "calc1.tab.c" +#line 484 "calc1.tab.c" #if YYDEBUG #include <stdio.h> /* needed for printf */ @@ -847,7 +849,7 @@ case 28: yyval.vval = yystack.l_mark[-1].vval; } break; -#line 851 "calc1.tab.c" +#line 853 "calc1.tab.c" } yystack.s_mark -= yym; yystate = *yystack.s_mark; diff --git a/test/calc2.tab.c b/test/calc2.tab.c index 15d51e8..69ec2ba 100644 --- a/test/calc2.tab.c +++ b/test/calc2.tab.c @@ -257,6 +257,15 @@ static const char *yyrule[] = { }; #endif + +int yydebug; +int yynerrs; + +int yyerrflag; +int yychar; +YYSTYPE yyval; +YYSTYPE yylval; + /* define the initial stack-sizes */ #ifdef YYSTACKSIZE #undef YYMAXDEPTH @@ -272,9 +281,6 @@ static const char *yyrule[] = { #define YYINITSTACKSIZE 500 -int yydebug; -int yynerrs; - typedef struct { unsigned stacksize; short *s_base; @@ -283,11 +289,6 @@ typedef struct { YYSTYPE *l_base; YYSTYPE *l_mark; } YYSTACKDATA; -int yyerrflag; -int yychar; -YYSTYPE yyval; -YYSTYPE yylval; - /* variables for the parser stack */ static YYSTACKDATA yystack; #line 65 "calc2.y" @@ -340,7 +341,7 @@ yylex(int *base) } return( c ); } -#line 344 "calc2.tab.c" +#line 345 "calc2.tab.c" #if YYDEBUG #include <stdio.h> /* needed for printf */ @@ -606,7 +607,7 @@ case 18: #line 62 "calc2.y" { yyval = (*base) * yystack.l_mark[-1] + yystack.l_mark[0]; } break; -#line 610 "calc2.tab.c" +#line 611 "calc2.tab.c" } yystack.s_mark -= yym; yystate = *yystack.s_mark; diff --git a/test/calc3.tab.c b/test/calc3.tab.c index c37df50..7d69117 100644 --- a/test/calc3.tab.c +++ b/test/calc3.tab.c @@ -257,6 +257,10 @@ static const char *yyrule[] = { }; #endif + +int yydebug; +int yynerrs; + /* define the initial stack-sizes */ #ifdef YYSTACKSIZE #undef YYMAXDEPTH @@ -272,9 +276,6 @@ static const char *yyrule[] = { #define YYINITSTACKSIZE 500 -int yydebug; -int yynerrs; - typedef struct { unsigned stacksize; short *s_base; @@ -333,7 +334,7 @@ YYLEX_DECL() } return( c ); } -#line 337 "calc3.tab.c" +#line 338 "calc3.tab.c" #if YYDEBUG #include <stdio.h> /* needed for printf */ @@ -606,7 +607,7 @@ case 18: #line 64 "calc3.y" { yyval = (*base) * yystack.l_mark[-1] + yystack.l_mark[0]; } break; -#line 610 "calc3.tab.c" +#line 611 "calc3.tab.c" } yystack.s_mark -= yym; yystate = *yystack.s_mark; diff --git a/test/code_calc.code.c b/test/code_calc.code.c index 9a663ef..7521939 100644 --- a/test/code_calc.code.c +++ b/test/code_calc.code.c @@ -145,8 +145,8 @@ extern int YYPARSE_DECL(); #define yyrule calc_rule #endif /* yyrule */ #define YYPREFIX "calc_" -extern int YYPARSE_DECL(); +extern int YYPARSE_DECL(); extern short yylhs[]; extern short yylen[]; extern short yydefred[]; @@ -161,6 +161,15 @@ extern short yycheck[]; extern char *yyname[]; extern char *yyrule[]; #endif + +int yydebug; +int yynerrs; + +int yyerrflag; +int yychar; +YYSTYPE yyval; +YYSTYPE yylval; + /* define the initial stack-sizes */ #ifdef YYSTACKSIZE #undef YYMAXDEPTH @@ -176,9 +185,6 @@ extern char *yyrule[]; #define YYINITSTACKSIZE 500 -int yydebug; -int yynerrs; - typedef struct { unsigned stacksize; short *s_base; @@ -187,11 +193,6 @@ typedef struct { YYSTYPE *l_base; YYSTYPE *l_mark; } YYSTACKDATA; -int yyerrflag; -int yychar; -YYSTYPE yyval; -YYSTYPE yylval; - /* variables for the parser stack */ static YYSTACKDATA yystack; #line 63 "code_calc.y" @@ -240,7 +241,7 @@ yylex(void) { } return( c ); } -#line 244 "code_calc.code.c" +#line 245 "code_calc.code.c" #if YYDEBUG #include <stdio.h> /* needed for printf */ @@ -506,7 +507,7 @@ case 18: #line 60 "code_calc.y" { yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; } break; -#line 510 "code_calc.code.c" +#line 511 "code_calc.code.c" } yystack.s_mark -= yym; yystate = *yystack.s_mark; diff --git a/test/code_error.code.c b/test/code_error.code.c index dd3d96b..f845db3 100644 --- a/test/code_error.code.c +++ b/test/code_error.code.c @@ -134,8 +134,8 @@ extern int YYPARSE_DECL(); #define yyrule error_rule #endif /* yyrule */ #define YYPREFIX "error_" -extern int YYPARSE_DECL(); +extern int YYPARSE_DECL(); extern short yylhs[]; extern short yylen[]; extern short yydefred[]; @@ -150,6 +150,15 @@ extern short yycheck[]; extern char *yyname[]; extern char *yyrule[]; #endif + +int yydebug; +int yynerrs; + +int yyerrflag; +int yychar; +YYSTYPE yyval; +YYSTYPE yylval; + /* define the initial stack-sizes */ #ifdef YYSTACKSIZE #undef YYMAXDEPTH @@ -165,9 +174,6 @@ extern char *yyrule[]; #define YYINITSTACKSIZE 500 -int yydebug; -int yynerrs; - typedef struct { unsigned stacksize; short *s_base; @@ -176,11 +182,6 @@ typedef struct { YYSTYPE *l_base; YYSTYPE *l_mark; } YYSTACKDATA; -int yyerrflag; -int yychar; -YYSTYPE yyval; -YYSTYPE yylval; - /* variables for the parser stack */ static YYSTACKDATA yystack; #line 4 "code_error.y" @@ -210,7 +211,7 @@ yyerror(const char* s) { printf("%s\n", s); } -#line 214 "code_error.code.c" +#line 215 "code_error.code.c" #if YYDEBUG #include <stdio.h> /* needed for printf */ diff --git a/test/error.tab.c b/test/error.tab.c index bcf64dc..088f9d5 100644 --- a/test/error.tab.c +++ b/test/error.tab.c @@ -168,6 +168,15 @@ static const char *yyrule[] = { }; #endif + +int yydebug; +int yynerrs; + +int yyerrflag; +int yychar; +YYSTYPE yyval; +YYSTYPE yylval; + /* define the initial stack-sizes */ #ifdef YYSTACKSIZE #undef YYMAXDEPTH @@ -183,9 +192,6 @@ static const char *yyrule[] = { #define YYINITSTACKSIZE 500 -int yydebug; -int yynerrs; - typedef struct { unsigned stacksize; short *s_base; @@ -194,11 +200,6 @@ typedef struct { YYSTYPE *l_base; YYSTYPE *l_mark; } YYSTACKDATA; -int yyerrflag; -int yychar; -YYSTYPE yyval; -YYSTYPE yylval; - /* variables for the parser stack */ static YYSTACKDATA yystack; #line 4 "error.y" @@ -228,7 +229,7 @@ yyerror(const char* s) { printf("%s\n", s); } -#line 232 "error.tab.c" +#line 233 "error.tab.c" #if YYDEBUG #include <stdio.h> /* needed for printf */ diff --git a/test/ftp.tab.c b/test/ftp.tab.c index 23b15d9..2df84f7 100644 --- a/test/ftp.tab.c +++ b/test/ftp.tab.c @@ -509,6 +509,15 @@ static const char *yyrule[] = { }; #endif + +int yydebug; +int yynerrs; + +int yyerrflag; +int yychar; +YYSTYPE yyval; +YYSTYPE yylval; + /* define the initial stack-sizes */ #ifdef YYSTACKSIZE #undef YYMAXDEPTH @@ -524,9 +533,6 @@ static const char *yyrule[] = { #define YYINITSTACKSIZE 500 -int yydebug; -int yynerrs; - typedef struct { unsigned stacksize; short *s_base; @@ -535,11 +541,6 @@ typedef struct { YYSTYPE *l_base; YYSTYPE *l_mark; } YYSTACKDATA; -int yyerrflag; -int yychar; -YYSTYPE yyval; -YYSTYPE yylval; - /* variables for the parser stack */ static YYSTACKDATA yystack; #line 689 "ftp.y" @@ -1074,7 +1075,7 @@ sizecmd(char *filename) reply(504, "SIZE not implemented for Type %c.", "?AEIL"[type]); } } -#line 1078 "ftp.tab.c" +#line 1079 "ftp.tab.c" #if YYDEBUG #include <stdio.h> /* needed for printf */ @@ -1917,7 +1918,7 @@ case 73: } } break; -#line 1921 "ftp.tab.c" +#line 1922 "ftp.tab.c" } yystack.s_mark -= yym; yystate = *yystack.s_mark; diff --git a/test/grammar.tab.c b/test/grammar.tab.c index 5231895..f2ff21f 100644 --- a/test/grammar.tab.c +++ b/test/grammar.tab.c @@ -375,6 +375,7 @@ haveAnsiParam (void) return FALSE; } #line 378 "grammar.tab.c" + /* compatibility with bison */ #ifdef YYPARSE_PARAM /* compatibility with FreeBSD */ @@ -863,6 +864,15 @@ static const char *yyrule[] = { }; #endif + +int yydebug; +int yynerrs; + +int yyerrflag; +int yychar; +YYSTYPE yyval; +YYSTYPE yylval; + /* define the initial stack-sizes */ #ifdef YYSTACKSIZE #undef YYMAXDEPTH @@ -878,9 +888,6 @@ static const char *yyrule[] = { #define YYINITSTACKSIZE 500 -int yydebug; -int yynerrs; - typedef struct { unsigned stacksize; short *s_base; @@ -889,11 +896,6 @@ typedef struct { YYSTYPE *l_base; YYSTYPE *l_mark; } YYSTACKDATA; -int yyerrflag; -int yychar; -YYSTYPE yyval; -YYSTYPE yylval; - /* variables for the parser stack */ static YYSTACKDATA yystack; #line 1004 "grammar.y" @@ -1067,7 +1069,7 @@ free_parser(void) #endif } #endif -#line 1071 "grammar.tab.c" +#line 1073 "grammar.tab.c" #if YYDEBUG #include <stdio.h> /* needed for printf */ @@ -1947,7 +1949,7 @@ case 114: yyval.declarator->func_def = FUNC_ANSI; } break; -#line 1951 "grammar.tab.c" +#line 1953 "grammar.tab.c" } yystack.s_mark -= yym; yystate = *yystack.s_mark; diff --git a/test/pure_calc.tab.c b/test/pure_calc.tab.c index 4608901..db353b5 100644 --- a/test/pure_calc.tab.c +++ b/test/pure_calc.tab.c @@ -260,6 +260,10 @@ static const char *yyrule[] = { }; #endif + +int yydebug; +int yynerrs; + /* define the initial stack-sizes */ #ifdef YYSTACKSIZE #undef YYMAXDEPTH @@ -275,9 +279,6 @@ static const char *yyrule[] = { #define YYINITSTACKSIZE 500 -int yydebug; -int yynerrs; - typedef struct { unsigned stacksize; short *s_base; @@ -333,7 +334,7 @@ yylex(YYSTYPE *value) } return( c ); } -#line 337 "pure_calc.tab.c" +#line 338 "pure_calc.tab.c" #if YYDEBUG #include <stdio.h> /* needed for printf */ @@ -606,7 +607,7 @@ case 18: #line 60 "pure_calc.y" { yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; } break; -#line 610 "pure_calc.tab.c" +#line 611 "pure_calc.tab.c" } yystack.s_mark -= yym; yystate = *yystack.s_mark; diff --git a/test/pure_error.tab.c b/test/pure_error.tab.c index 4c252bc..1ba1dc4 100644 --- a/test/pure_error.tab.c +++ b/test/pure_error.tab.c @@ -168,6 +168,10 @@ static const char *yyrule[] = { }; #endif + +int yydebug; +int yynerrs; + /* define the initial stack-sizes */ #ifdef YYSTACKSIZE #undef YYMAXDEPTH @@ -183,9 +187,6 @@ static const char *yyrule[] = { #define YYINITSTACKSIZE 500 -int yydebug; -int yynerrs; - typedef struct { unsigned stacksize; short *s_base; @@ -221,7 +222,7 @@ yyerror(const char* s) { printf("%s\n", s); } -#line 225 "pure_error.tab.c" +#line 226 "pure_error.tab.c" #if YYDEBUG #include <stdio.h> /* needed for printf */ @@ -1,12 +1,12 @@ -.\" $Id: yacc.1,v 1.11 2010/11/26 16:27:11 tom Exp $ +.\" $Id: yacc.1,v 1.12 2011/09/08 00:40:44 tom Exp $ .\" .\" .TH YACC 1 "July\ 15,\ 1990" .\" .UC 6 -.TH YACC 1 "November 26, 2010" "Berkeley Yacc" "User Commands" +.TH YACC 1 "September 7, 2011" "Berkeley Yacc" "User Commands" .SH NAME Yacc \- an LALR(1) parser generator .SH SYNOPSIS -.B yacc [ -dglrtv ] [ \-b +.B yacc [ -dgilrtv ] [ \-b .I file_prefix .B ] [ \-p .I symbol_prefix @@ -36,17 +36,32 @@ The default prefix is the character .TP .B \-d The \fB-d\fR option causes the header file -.IR y.tab.h +.BR y.tab.h to be written. +It contains #define's for the token identifiers. .TP .B \-g The .B \-g option causes a graphical description of the generated LALR(1) parser to be written to the file -.IR y.dot +.BR y.dot in graphviz format, ready to be processed by dot(1). .TP +.B \-i +The \fB-i\fR option causes a supplementary header file +.BR y.tab.i +to be written. +It contains extern declarations +and supplementary #define's as needed to map the conventional \fIyacc\fP +\fByy\fP-prefixed names to whatever the \fB-p\fP option may specify. +The code file, e.g., \fBy.tab.c\fP is modified to #include this file +as well as the \fBy.tab.h\fP file, enforcing consistent usage of the +symbols defined in those files. +.IP +The supplementary header file makes it simpler to separate compilation +of lex- and yacc-files. +.TP .B \-l If the .B \-l @@ -73,7 +88,7 @@ option changes the prefix prepended to yacc-generated symbols to the string denoted by .IR symbol_prefix. The default prefix is the string -.IR yy. +.BR yy. .TP .B \-P create a reentrant parser, e.g., "%pure-parser". |