[Zrouter-src-freebsd] ZRouter.org: push to FreeBSD HEAD tree

zrouter-src-freebsd at zrouter.org zrouter-src-freebsd at zrouter.org
Wed Jul 25 14:36:02 UTC 2012


details:   http://zrouter.org/hg/FreeBSD/head//rev/d46effa10a19
changeset: 487:d46effa10a19
user:      Aleksandr Rybalko <ray at ddteam.net>
date:      Wed Jul 25 16:21:35 2012 +0300
description:
Lazy update

diffstat:

 head/contrib/bind9/CHANGES                                                =
                      |     73 +-
 head/contrib/bind9/README                                                 =
                      |      4 +
 head/contrib/bind9/bin/named/builtin.c                                    =
                      |    220 +-
 head/contrib/bind9/bin/named/query.c                                      =
                      |      5 +
 head/contrib/bind9/bin/named/server.c                                     =
                      |      2 +-
 head/contrib/bind9/bin/named/unix/dlz_dlopen_driver.c                     =
                      |      2 +-
 head/contrib/bind9/lib/bind9/api                                          =
                      |      2 +-
 head/contrib/bind9/lib/bind9/check.c                                      =
                      |      2 +-
 head/contrib/bind9/lib/dns/api                                            =
                      |      2 +-
 head/contrib/bind9/lib/dns/dnssec.c                                       =
                      |      2 +-
 head/contrib/bind9/lib/dns/include/dns/ecdb.h                             =
                      |      4 +-
 head/contrib/bind9/lib/dns/include/dns/rpz.h                              =
                      |      2 +
 head/contrib/bind9/lib/dns/include/dns/sdb.h                              =
                      |      5 +
 head/contrib/bind9/lib/dns/include/dns/stats.h                            =
                      |      2 +
 head/contrib/bind9/lib/dns/include/dns/tsec.h                             =
                      |      4 +-
 head/contrib/bind9/lib/dns/include/dns/view.h                             =
                      |      2 +
 head/contrib/bind9/lib/dns/rbtdb.c                                        =
                      |      2 +-
 head/contrib/bind9/lib/dns/rdata.c                                        =
                      |      8 +-
 head/contrib/bind9/lib/dns/rdata/generic/tlsa_52.c                        =
                      |    290 +
 head/contrib/bind9/lib/dns/rdata/generic/tlsa_52.h                        =
                      |     35 +
 head/contrib/bind9/lib/dns/rdataslab.c                                    =
                      |     11 +-
 head/contrib/bind9/lib/dns/resolver.c                                     =
                      |    233 +-
 head/contrib/bind9/lib/dns/sdb.c                                          =
                      |     91 +-
 head/contrib/bind9/lib/dns/tkey.c                                         =
                      |      4 +-
 head/contrib/bind9/lib/dns/zone.c                                         =
                      |    146 +-
 head/contrib/bind9/lib/isc/pthreads/mutex.c                               =
                      |     16 +-
 head/contrib/bind9/lib/isccfg/api                                         =
                      |      2 +-
 head/contrib/bind9/lib/isccfg/parser.c                                    =
                      |     24 +-
 head/contrib/bind9/version                                                =
                      |      6 +-
 head/contrib/binutils/gas/config/tc-i386.c                                =
                      |     20 +-
 head/contrib/binutils/ld/emultempl/ppc32elf.em                            =
                      |     33 +
 head/contrib/binutils/opcodes/i386-dis.c                                  =
                      |     81 +-
 head/contrib/binutils/opcodes/i386-opc.h                                  =
                      |      3 +-
 head/contrib/binutils/opcodes/i386-opc.tbl                                =
                      |     11 +
 head/contrib/binutils/opcodes/i386-tbl.h                                  =
                      |     31 +
 head/contrib/bsnmp/lib/bsnmpclient.3                                      =
                      |      2 +-
 head/contrib/bsnmp/lib/bsnmplib.3                                         =
                      |      7 +-
 head/contrib/bsnmp/snmp_mibII/mibII_tcp.c                                 =
                      |      6 +-
 head/contrib/bsnmp/snmp_target/snmp_target.3                              =
                      |      4 +-
 head/contrib/bsnmp/snmp_usm/snmp_usm.3                                    =
                      |     12 +-
 head/contrib/bsnmp/snmp_vacm/snmp_vacm.3                                  =
                      |      6 +-
 head/contrib/byacc/ACKNOWLEDGEMENTS                                       =
                      |     25 +
 head/contrib/byacc/AUTHORS                                                =
                      |      7 +
 head/contrib/byacc/CHANGES                                                =
                      |   1156 +
 head/contrib/byacc/Makefile.old                                           =
                      |     84 +
 head/contrib/byacc/NEW_FEATURES                                           =
                      |     46 +
 head/contrib/byacc/NOTES                                                  =
                      |      9 +
 head/contrib/byacc/NO_WARRANTY                                            =
                      |      3 +
 head/contrib/byacc/README                                                 =
                      |     29 +
 head/contrib/byacc/VERSION                                                =
                      |      1 +
 head/contrib/byacc/aclocal.m4                                             =
                      |   1144 +
 head/contrib/byacc/closure.c                                              =
                      |    251 +
 head/contrib/byacc/config.guess                                           =
                      |   1511 +
 head/contrib/byacc/config.sub                                             =
                      |   1760 +
 head/contrib/byacc/config_h.in                                            =
                      |      3 +
 head/contrib/byacc/configure                                              =
                      |   5973 ++
 head/contrib/byacc/configure.in                                           =
                      |     30 +
 head/contrib/byacc/defs.h                                                 =
                      |    438 +
 head/contrib/byacc/descrip.mms                                            =
                      |     37 +
 head/contrib/byacc/error.c                                                =
                      |    288 +
 head/contrib/byacc/graph.c                                                =
                      |    112 +
 head/contrib/byacc/install-sh                                             =
                      |    294 +
 head/contrib/byacc/lalr.c                                                 =
                      |    655 +
 head/contrib/byacc/lr0.c                                                  =
                      |    599 +
 head/contrib/byacc/main.c                                                 =
                      |    664 +
 head/contrib/byacc/makefile.in                                            =
                      |    182 +
 head/contrib/byacc/mkpar.c                                                =
                      |    392 +
 head/contrib/byacc/output.c                                               =
                      |   1507 +
 head/contrib/byacc/package/byacc.spec                                     =
                      |     60 +
 head/contrib/byacc/package/debian/changelog                               =
                      |    223 +
 head/contrib/byacc/package/debian/compat                                  =
                      |      1 +
 head/contrib/byacc/package/debian/control                                 =
                      |     17 +
 head/contrib/byacc/package/debian/copyright                               =
                      |    120 +
 head/contrib/byacc/package/debian/docs                                    =
                      |      4 +
 head/contrib/byacc/package/debian/postinst                                =
                      |     15 +
 head/contrib/byacc/package/debian/prerm                                   =
                      |     12 +
 head/contrib/byacc/package/debian/rules                                   =
                      |     93 +
 head/contrib/byacc/package/debian/source/format                           =
                      |      1 +
 head/contrib/byacc/package/debian/watch                                   =
                      |      4 +
 head/contrib/byacc/package/pkgsrc/DESCR                                   =
                      |      6 +
 head/contrib/byacc/package/pkgsrc/Makefile                                =
                      |     19 +
 head/contrib/byacc/package/pkgsrc/PLIST                                   =
                      |      3 +
 head/contrib/byacc/package/pkgsrc/distinfo                                =
                      |      6 +
 head/contrib/byacc/reader.c                                               =
                      |   2254 +
 head/contrib/byacc/skeleton.c                                             =
                      |    439 +
 head/contrib/byacc/symtab.c                                               =
                      |    117 +
 head/contrib/byacc/test/README                                            =
                      |      4 +
 head/contrib/byacc/test/calc.output                                       =
                      |    461 +
 head/contrib/byacc/test/calc.tab.c                                        =
                      |    673 +
 head/contrib/byacc/test/calc.tab.h                                        =
                      |      3 +
 head/contrib/byacc/test/calc.y                                            =
                      |    106 +
 head/contrib/byacc/test/calc1.output                                      =
                      |    877 +
 head/contrib/byacc/test/calc1.tab.c                                       =
                      |    915 +
 head/contrib/byacc/test/calc1.tab.h                                       =
                      |     18 +
 head/contrib/byacc/test/calc1.y                                           =
                      |    305 +
 head/contrib/byacc/test/calc2.output                                      =
                      |    461 +
 head/contrib/byacc/test/calc2.tab.c                                       =
                      |    682 +
 head/contrib/byacc/test/calc2.tab.h                                       =
                      |      3 +
 head/contrib/byacc/test/calc2.y                                           =
                      |    120 +
 head/contrib/byacc/test/calc3.output                                      =
                      |    461 +
 head/contrib/byacc/test/calc3.tab.c                                       =
                      |    687 +
 head/contrib/byacc/test/calc3.tab.h                                       =
                      |      3 +
 head/contrib/byacc/test/calc3.y                                           =
                      |    123 +
 head/contrib/byacc/test/code_calc.code.c                                  =
                      |    580 +
 head/contrib/byacc/test/code_calc.output                                  =
                      |    461 +
 head/contrib/byacc/test/code_calc.tab.c                                   =
                      |    199 +
 head/contrib/byacc/test/code_calc.tab.h                                   =
                      |      3 +
 head/contrib/byacc/test/code_calc.y                                       =
                      |    112 +
 head/contrib/byacc/test/code_error.code.c                                 =
                      |    491 +
 head/contrib/byacc/test/code_error.output                                 =
                      |     27 +
 head/contrib/byacc/test/code_error.tab.c                                  =
                      |    118 +
 head/contrib/byacc/test/code_error.y                                      =
                      |     36 +
 head/contrib/byacc/test/error.output                                      =
                      |     27 +
 head/contrib/byacc/test/error.tab.c                                       =
                      |    501 +
 head/contrib/byacc/test/error.y                                           =
                      |     28 +
 head/contrib/byacc/test/ftp.output                                        =
                      |   1625 +
 head/contrib/byacc/test/ftp.tab.c                                         =
                      |   1995 +
 head/contrib/byacc/test/ftp.tab.h                                         =
                      |     63 +
 head/contrib/byacc/test/ftp.y                                             =
                      |   1228 +
 head/contrib/byacc/test/grammar.output                                    =
                      |   2214 +
 head/contrib/byacc/test/grammar.tab.c                                     =
                      |   2025 +
 head/contrib/byacc/test/grammar.tab.h                                     =
                      |     35 +
 head/contrib/byacc/test/grammar.y                                         =
                      |   1183 +
 head/contrib/byacc/test/pure_calc.output                                  =
                      |    461 +
 head/contrib/byacc/test/pure_calc.tab.c                                   =
                      |    687 +
 head/contrib/byacc/test/pure_calc.tab.h                                   =
                      |      3 +
 head/contrib/byacc/test/pure_calc.y                                       =
                      |    116 +
 head/contrib/byacc/test/pure_error.output                                 =
                      |     27 +
 head/contrib/byacc/test/pure_error.tab.c                                  =
                      |    517 +
 head/contrib/byacc/test/pure_error.y                                      =
                      |     41 +
 head/contrib/byacc/test/quote_calc-s.output                               =
                      |    557 +
 head/contrib/byacc/test/quote_calc-s.tab.c                                =
                      |    687 +
 head/contrib/byacc/test/quote_calc-s.tab.h                                =
                      |      9 +
 head/contrib/byacc/test/quote_calc.output                                 =
                      |    557 +
 head/contrib/byacc/test/quote_calc.tab.c                                  =
                      |    693 +
 head/contrib/byacc/test/quote_calc.tab.h                                  =
                      |     15 +
 head/contrib/byacc/test/quote_calc.y                                      =
                      |    112 +
 head/contrib/byacc/test/quote_calc2-s.output                              =
                      |    557 +
 head/contrib/byacc/test/quote_calc2-s.tab.c                               =
                      |    687 +
 head/contrib/byacc/test/quote_calc2-s.tab.h                               =
                      |      9 +
 head/contrib/byacc/test/quote_calc2.output                                =
                      |    557 +
 head/contrib/byacc/test/quote_calc2.tab.c                                 =
                      |    693 +
 head/contrib/byacc/test/quote_calc2.tab.h                                 =
                      |     15 +
 head/contrib/byacc/test/quote_calc2.y                                     =
                      |    112 +
 head/contrib/byacc/test/quote_calc3-s.output                              =
                      |    557 +
 head/contrib/byacc/test/quote_calc3-s.tab.c                               =
                      |    688 +
 head/contrib/byacc/test/quote_calc3-s.tab.h                               =
                      |      9 +
 head/contrib/byacc/test/quote_calc3.output                                =
                      |    557 +
 head/contrib/byacc/test/quote_calc3.tab.c                                 =
                      |    688 +
 head/contrib/byacc/test/quote_calc3.tab.h                                 =
                      |      9 +
 head/contrib/byacc/test/quote_calc3.y                                     =
                      |    112 +
 head/contrib/byacc/test/quote_calc4-s.output                              =
                      |    557 +
 head/contrib/byacc/test/quote_calc4-s.tab.c                               =
                      |    688 +
 head/contrib/byacc/test/quote_calc4-s.tab.h                               =
                      |      9 +
 head/contrib/byacc/test/quote_calc4.output                                =
                      |    557 +
 head/contrib/byacc/test/quote_calc4.tab.c                                 =
                      |    688 +
 head/contrib/byacc/test/quote_calc4.tab.h                                 =
                      |      9 +
 head/contrib/byacc/test/quote_calc4.y                                     =
                      |    112 +
 head/contrib/byacc/test/run_lint.sh                                       =
                      |     20 +
 head/contrib/byacc/test/run_make.sh                                       =
                      |    139 +
 head/contrib/byacc/test/run_test.sh                                       =
                      |     82 +
 head/contrib/byacc/verbose.c                                              =
                      |    334 +
 head/contrib/byacc/vmsbuild.com                                           =
                      |    210 +
 head/contrib/byacc/warshall.c                                             =
                      |     82 +
 head/contrib/byacc/yacc.1                                                 =
                      |    242 +
 head/contrib/com_err/com_err.3                                            =
                      |      2 +-
 head/contrib/compiler-rt/lib/sparc64/divmod.m4                            =
                      |     38 +-
 head/contrib/compiler-rt/lib/sparc64/divsi3.S                             =
                      |     27 +-
 head/contrib/compiler-rt/lib/sparc64/modsi3.S                             =
                      |     27 +-
 head/contrib/dtc/Documentation/dts-format.txt                             =
                      |     34 +-
 head/contrib/dtc/Documentation/manual.txt                                 =
                      |     13 +-
 head/contrib/dtc/Makefile                                                 =
                      |     44 +-
 head/contrib/dtc/Makefile.convert-dtsv0                                   =
                      |     13 -
 head/contrib/dtc/Makefile.ftdump                                          =
                      |     12 -
 head/contrib/dtc/checks.c                                                 =
                      |    248 +-
 head/contrib/dtc/convert-dtsv0-lexer.l                                    =
                      |    238 -
 head/contrib/dtc/data.c                                                   =
                      |    120 +-
 head/contrib/dtc/dtc-lexer.l                                              =
                      |    123 +-
 head/contrib/dtc/dtc-parser.y                                             =
                      |    328 +-
 head/contrib/dtc/dtc.c                                                    =
                      |     75 +-
 head/contrib/dtc/dtc.h                                                    =
                      |     37 +-
 head/contrib/dtc/dtdiff                                                   =
                      |     38 +
 head/contrib/dtc/fdtdump.c                                                =
                      |    162 +
 head/contrib/dtc/fdtget.c                                                 =
                      |    366 +
 head/contrib/dtc/fdtput.c                                                 =
                      |    362 +
 head/contrib/dtc/flattree.c                                               =
                      |     83 +-
 head/contrib/dtc/fstree.c                                                 =
                      |     11 +-
 head/contrib/dtc/ftdump.c                                                 =
                      |    208 -
 head/contrib/dtc/libfdt/Makefile.libfdt                                   =
                      |      3 +-
 head/contrib/dtc/libfdt/fdt.c                                             =
                      |      9 +
 head/contrib/dtc/libfdt/fdt_empty_tree.c                                  =
                      |     84 +
 head/contrib/dtc/libfdt/fdt_ro.c                                          =
                      |    125 +-
 head/contrib/dtc/libfdt/fdt_rw.c                                          =
                      |     27 +
 head/contrib/dtc/libfdt/libfdt.h                                          =
                      |    378 +-
 head/contrib/dtc/libfdt/libfdt_env.h                                      =
                      |     16 +-
 head/contrib/dtc/libfdt/libfdt_internal.h                                 =
                      |      1 +
 head/contrib/dtc/livetree.c                                               =
                      |    329 +-
 head/contrib/dtc/srcpos.c                                                 =
                      |    368 +-
 head/contrib/dtc/srcpos.h                                                 =
                      |    128 +-
 head/contrib/dtc/treesource.c                                             =
                      |     21 +-
 head/contrib/dtc/util.c                                                   =
                      |    303 +-
 head/contrib/dtc/util.h                                                   =
                      |     98 +
 head/contrib/gcc/ChangeLog.gcc43                                          =
                      |     22 +-
 head/contrib/gcc/config/arm/freebsd.h                                     =
                      |      1 +
 head/contrib/gcc/config/i386/freebsd.h                                    =
                      |      3 +-
 head/contrib/gcc/config/i386/freebsd64.h                                  =
                      |      3 +-
 head/contrib/gcc/config/ia64/freebsd.h                                    =
                      |      1 +
 head/contrib/gcc/config/mips/freebsd.h                                    =
                      |      3 +-
 head/contrib/gcc/config/rs6000/freebsd.h                                  =
                      |      1 +
 head/contrib/gcc/config/rs6000/rs6000.md                                  =
                      |      1 +
 head/contrib/gcc/config/sparc/freebsd.h                                   =
                      |      8 +-
 head/contrib/gcc/config/sparc/sparc.md                                    =
                      |    128 +-
 head/contrib/gcc/cse.c                                                    =
                      |     30 +-
 head/contrib/gcc/expr.c                                                   =
                      |      9 +-
 head/contrib/gcc/fold-const.c                                             =
                      |     48 +-
 head/contrib/gcc/gimplify.c                                               =
                      |      4 +-
 head/contrib/gcc/ipa-pure-const.c                                         =
                      |     30 +
 head/contrib/gcc/ipa-utils.c                                              =
                      |      2 +-
 head/contrib/gcc/rtl.h                                                    =
                      |      4 +-
 head/contrib/gcc/tree-ssa-ccp.c                                           =
                      |      4 +-
 head/contrib/gcc/tree-ssa-pre.c                                           =
                      |     17 +
 head/contrib/gcc/var-tracking.c                                           =
                      |     50 +-
 head/contrib/gcc/varasm.c                                                 =
                      |      5 +-
 head/contrib/groff/tmac/doc-common                                        =
                      |      3 +
 head/contrib/jemalloc/ChangeLog                                           =
                      |     33 +-
 head/contrib/jemalloc/FREEBSD-Xlist                                       =
                      |      1 +
 head/contrib/jemalloc/FREEBSD-diffs                                       =
                      |     87 +-
 head/contrib/jemalloc/FREEBSD-upgrade                                     =
                      |      3 +-
 head/contrib/jemalloc/VERSION                                             =
                      |      2 +-
 head/contrib/jemalloc/doc/jemalloc.3                                      =
                      |     61 +-
 head/contrib/jemalloc/include/jemalloc/internal/arena.h                   =
                      |    410 +-
 head/contrib/jemalloc/include/jemalloc/internal/atomic.h                  =
                      |     28 +
 head/contrib/jemalloc/include/jemalloc/internal/chunk.h                   =
                      |      3 +-
 head/contrib/jemalloc/include/jemalloc/internal/chunk_mmap.h              =
                      |      6 +-
 head/contrib/jemalloc/include/jemalloc/internal/ctl.h                     =
                      |     31 +-
 head/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal.h       =
                      |    100 +-
 head/contrib/jemalloc/include/jemalloc/internal/mutex.h                   =
                      |     20 +-
 head/contrib/jemalloc/include/jemalloc/internal/private_namespace.h       =
                      |     80 +-
 head/contrib/jemalloc/include/jemalloc/internal/prof.h                    =
                      |     63 +-
 head/contrib/jemalloc/include/jemalloc/internal/tcache.h                  =
                      |     84 +-
 head/contrib/jemalloc/include/jemalloc/internal/tsd.h                     =
                      |    132 +-
 head/contrib/jemalloc/include/jemalloc/internal/util.h                    =
                      |     32 +-
 head/contrib/jemalloc/include/jemalloc/jemalloc.h                         =
                      |     66 +-
 head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h                 =
                      |      4 +
 head/contrib/jemalloc/include/jemalloc/jemalloc_defs.h                    =
                      |     50 +-
 head/contrib/jemalloc/src/arena.c                                         =
                      |    617 +-
 head/contrib/jemalloc/src/chunk.c                                         =
                      |    138 +-
 head/contrib/jemalloc/src/chunk_dss.c                                     =
                      |      5 +-
 head/contrib/jemalloc/src/chunk_mmap.c                                    =
                      |    217 +-
 head/contrib/jemalloc/src/ctl.c                                           =
                      |    255 +-
 head/contrib/jemalloc/src/huge.c                                          =
                      |     14 +-
 head/contrib/jemalloc/src/jemalloc.c                                      =
                      |    200 +-
 head/contrib/jemalloc/src/mutex.c                                         =
                      |     21 +-
 head/contrib/jemalloc/src/prof.c                                          =
                      |    220 +-
 head/contrib/jemalloc/src/quarantine.c                                    =
                      |    105 +-
 head/contrib/jemalloc/src/stats.c                                         =
                      |     31 +-
 head/contrib/jemalloc/src/tcache.c                                        =
                      |     65 +-
 head/contrib/jemalloc/src/tsd.c                                           =
                      |     49 +-
 head/contrib/jemalloc/src/util.c                                          =
                      |     71 +-
 head/contrib/less/LICENSE                                                 =
                      |      2 +-
 head/contrib/less/Makefile.aut                                            =
                      |      5 +-
 head/contrib/less/NEWS                                                    =
                      |     30 +-
 head/contrib/less/README                                                  =
                      |     13 +-
 head/contrib/less/brac.c                                                  =
                      |      5 +-
 head/contrib/less/ch.c                                                    =
                      |     18 +-
 head/contrib/less/charset.c                                               =
                      |      5 +-
 head/contrib/less/charset.h                                               =
                      |      5 +-
 head/contrib/less/cmd.h                                                   =
                      |     10 +-
 head/contrib/less/cmdbuf.c                                                =
                      |     75 +-
 head/contrib/less/command.c                                               =
                      |     77 +-
 head/contrib/less/configure                                               =
                      |    419 +-
 head/contrib/less/configure.ac                                            =
                      |     25 +-
 head/contrib/less/cvt.c                                                   =
                      |     30 +-
 head/contrib/less/decode.c                                                =
                      |      6 +-
 head/contrib/less/defines.ds                                              =
                      |      8 +-
 head/contrib/less/defines.h.in                                            =
                      |     12 +-
 head/contrib/less/defines.o2                                              =
                      |      5 +-
 head/contrib/less/defines.o9                                              =
                      |      5 +-
 head/contrib/less/defines.wn                                              =
                      |      5 +-
 head/contrib/less/edit.c                                                  =
                      |      9 +-
 head/contrib/less/filename.c                                              =
                      |     53 +-
 head/contrib/less/forwback.c                                              =
                      |      7 +-
 head/contrib/less/funcs.h                                                 =
                      |      1 +
 head/contrib/less/help.c                                                  =
                      |     25 +-
 head/contrib/less/ifile.c                                                 =
                      |      5 +-
 head/contrib/less/input.c                                                 =
                      |      7 +-
 head/contrib/less/jump.c                                                  =
                      |      5 +-
 head/contrib/less/less.h                                                  =
                      |     10 +-
 head/contrib/less/less.hlp                                                =
                      |     25 +-
 head/contrib/less/less.man                                                =
                      |    382 +-
 head/contrib/less/less.nro                                                =
                      |     50 +-
 head/contrib/less/lessecho.c                                              =
                      |      7 +-
 head/contrib/less/lessecho.man                                            =
                      |     25 +-
 head/contrib/less/lessecho.nro                                            =
                      |     19 +-
 head/contrib/less/lesskey.c                                               =
                      |      8 +-
 head/contrib/less/lesskey.h                                               =
                      |      5 +-
 head/contrib/less/lesskey.man                                             =
                      |     11 +-
 head/contrib/less/lesskey.nro                                             =
                      |     10 +-
 head/contrib/less/lglob.h                                                 =
                      |      5 +-
 head/contrib/less/line.c                                                  =
                      |     13 +-
 head/contrib/less/linenum.c                                               =
                      |      5 +-
 head/contrib/less/lsystem.c                                               =
                      |      5 +-
 head/contrib/less/main.c                                                  =
                      |      8 +-
 head/contrib/less/mark.c                                                  =
                      |      5 +-
 head/contrib/less/mkhelp.c                                                =
                      |      5 +-
 head/contrib/less/optfunc.c                                               =
                      |     30 +-
 head/contrib/less/option.c                                                =
                      |      5 +-
 head/contrib/less/option.h                                                =
                      |      5 +-
 head/contrib/less/opttbl.c                                                =
                      |      5 +-
 head/contrib/less/os.c                                                    =
                      |      5 +-
 head/contrib/less/output.c                                                =
                      |     26 +-
 head/contrib/less/pattern.c                                               =
                      |    176 +-
 head/contrib/less/pattern.h                                               =
                      |     16 +-
 head/contrib/less/pckeys.h                                                =
                      |      5 +-
 head/contrib/less/position.c                                              =
                      |      5 +-
 head/contrib/less/position.h                                              =
                      |      5 +-
 head/contrib/less/prompt.c                                                =
                      |     17 +-
 head/contrib/less/screen.c                                                =
                      |      7 +-
 head/contrib/less/scrsize.c                                               =
                      |      5 +-
 head/contrib/less/search.c                                                =
                      |     83 +-
 head/contrib/less/signal.c                                                =
                      |      7 +-
 head/contrib/less/tags.c                                                  =
                      |      5 +-
 head/contrib/less/ttyin.c                                                 =
                      |      5 +-
 head/contrib/less/version.c                                               =
                      |     20 +-
 head/contrib/libc++/include/__bit_reference                               =
                      |      4 +
 head/contrib/libc++/include/__config                                      =
                      |      4 +-
 head/contrib/libc++/include/__tuple                                       =
                      |     29 +-
 head/contrib/libc++/include/algorithm                                     =
                      |     17 +-
 head/contrib/libc++/include/atomic                                        =
                      |    718 +-
 head/contrib/libc++/include/cmath                                         =
                      |     13 +-
 head/contrib/libc++/include/limits                                        =
                      |    720 +-
 head/contrib/libc++/include/memory                                        =
                      |     60 +-
 head/contrib/libc++/include/random                                        =
                      |    223 +-
 head/contrib/libc++/include/system_error                                  =
                      |      2 +-
 head/contrib/libc++/include/tuple                                         =
                      |     58 +-
 head/contrib/libc++/include/type_traits                                   =
                      |    122 +-
 head/contrib/libc++/include/utility                                       =
                      |      7 +-
 head/contrib/libc++/src/iostream.cpp                                      =
                      |     61 +-
 head/contrib/libc++/src/stdexcept.cpp                                     =
                      |      4 +
 head/contrib/libc++/src/utility.cpp                                       =
                      |      1 +
 head/contrib/libpcap/CHANGES                                              =
                      |     74 +
 head/contrib/libpcap/CREDITS                                              =
                      |    279 +-
 head/contrib/libpcap/Makefile.in                                          =
                      |    115 +-
 head/contrib/libpcap/README                                               =
                      |     13 +-
 head/contrib/libpcap/VERSION                                              =
                      |      2 +-
 head/contrib/libpcap/bpf/net/bpf_filter.c                                 =
                      |      2 +-
 head/contrib/libpcap/config.h.in                                          =
                      |     30 +
 head/contrib/libpcap/configure                                            =
                      |   5241 +-
 head/contrib/libpcap/configure.in                                         =
                      |    399 +-
 head/contrib/libpcap/ethertype.h                                          =
                      |      3 +
 head/contrib/libpcap/fad-getad.c                                          =
                      |     12 +-
 head/contrib/libpcap/filtertest.c                                         =
                      |    266 -
 head/contrib/libpcap/findalldevstest.c                                    =
                      |    131 -
 head/contrib/libpcap/gencode.c                                            =
                      |    533 +-
 head/contrib/libpcap/gencode.h                                            =
                      |      4 +
 head/contrib/libpcap/grammar.y                                            =
                      |      9 +-
 head/contrib/libpcap/inet.c                                               =
                      |     14 +-
 head/contrib/libpcap/opentest.c                                           =
                      |    216 -
 head/contrib/libpcap/packaging/pcap.spec.in                               =
                      |     83 +-
 head/contrib/libpcap/pcap-bpf.c                                           =
                      |    290 +-
 head/contrib/libpcap/pcap-bt-linux.c                                      =
                      |     76 +-
 head/contrib/libpcap/pcap-common.c                                        =
                      |    595 +-
 head/contrib/libpcap/pcap-config.in                                       =
                      |     31 +-
 head/contrib/libpcap/pcap-dag.c                                           =
                      |     11 +-
 head/contrib/libpcap/pcap-dlpi.c                                          =
                      |    103 +-
 head/contrib/libpcap/pcap-filter.manmisc                                  =
                      |     17 +-
 head/contrib/libpcap/pcap-filter.manmisc.in                               =
                      |     15 +-
 head/contrib/libpcap/pcap-int.h                                           =
                      |      3 +
 head/contrib/libpcap/pcap-libdlpi.c                                       =
                      |     72 +-
 head/contrib/libpcap/pcap-linktype.manmisc                                =
                      |    238 +-
 head/contrib/libpcap/pcap-linktype.manmisc.in                             =
                      |    238 +-
 head/contrib/libpcap/pcap-linux.c                                         =
                      |   1358 +-
 head/contrib/libpcap/pcap-netfilter-linux.c                               =
                      |    468 +
 head/contrib/libpcap/pcap-netfilter-linux.h                               =
                      |     35 +
 head/contrib/libpcap/pcap-savefile.manfile                                =
                      |      2 +-
 head/contrib/libpcap/pcap-stdinc.h                                        =
                      |      7 -
 head/contrib/libpcap/pcap-tstamp.manmisc                                  =
                      |    132 +
 head/contrib/libpcap/pcap-tstamp.manmisc.in                               =
                      |    132 +
 head/contrib/libpcap/pcap-usb-linux.c                                     =
                      |     51 +-
 head/contrib/libpcap/pcap-win32.c                                         =
                      |      7 +-
 head/contrib/libpcap/pcap.3pcap                                           =
                      |    571 +-
 head/contrib/libpcap/pcap.3pcap.in                                        =
                      |    569 +-
 head/contrib/libpcap/pcap.c                                               =
                      |    440 +-
 head/contrib/libpcap/pcap/bpf.h                                           =
                      |    189 +-
 head/contrib/libpcap/pcap/pcap.h                                          =
                      |     66 +-
 head/contrib/libpcap/pcap_activate.3pcap                                  =
                      |      8 +
 head/contrib/libpcap/pcap_can_set_rfmon.3pcap                             =
                      |     10 +-
 head/contrib/libpcap/pcap_compile.3pcap                                   =
                      |      8 +-
 head/contrib/libpcap/pcap_compile.3pcap.in                                =
                      |      2 +-
 head/contrib/libpcap/pcap_datalink.3pcap                                  =
                      |      6 +-
 head/contrib/libpcap/pcap_datalink.3pcap.in                               =
                      |      4 +-
 head/contrib/libpcap/pcap_datalink_name_to_val.3pcap                      =
                      |      8 +-
 head/contrib/libpcap/pcap_datalink_val_to_name.3pcap                      =
                      |     10 +-
 head/contrib/libpcap/pcap_dump_open.3pcap                                 =
                      |      2 +-
 head/contrib/libpcap/pcap_fileno.3pcap                                    =
                      |      2 +-
 head/contrib/libpcap/pcap_findalldevs.3pcap                               =
                      |     62 +-
 head/contrib/libpcap/pcap_free_datalinks.3pcap                            =
                      |     41 -
 head/contrib/libpcap/pcap_freealldevs.3pcap                               =
                      |     40 -
 head/contrib/libpcap/pcap_get_selectable_fd.3pcap                         =
                      |     18 +-
 head/contrib/libpcap/pcap_list_datalinks.3pcap                            =
                      |     28 +-
 head/contrib/libpcap/pcap_list_datalinks.3pcap.in                         =
                      |     26 +-
 head/contrib/libpcap/pcap_list_tstamp_types.3pcap                         =
                      |     70 +
 head/contrib/libpcap/pcap_list_tstamp_types.3pcap.in                      =
                      |     70 +
 head/contrib/libpcap/pcap_loop.3pcap                                      =
                      |      7 +-
 head/contrib/libpcap/pcap_major_version.3pcap                             =
                      |     10 +-
 head/contrib/libpcap/pcap_next_ex.3pcap                                   =
                      |     25 +-
 head/contrib/libpcap/pcap_open_dead.3pcap                                 =
                      |      2 +-
 head/contrib/libpcap/pcap_open_live.3pcap                                 =
                      |      2 +-
 head/contrib/libpcap/pcap_open_offline.3pcap                              =
                      |     12 +-
 head/contrib/libpcap/pcap_set_datalink.3pcap                              =
                      |      7 +-
 head/contrib/libpcap/pcap_set_tstamp_type.3pcap                           =
                      |     65 +
 head/contrib/libpcap/pcap_set_tstamp_type.3pcap.in                        =
                      |     65 +
 head/contrib/libpcap/pcap_tstamp_type_name_to_val.3pcap                   =
                      |     45 +
 head/contrib/libpcap/pcap_tstamp_type_val_to_name.3pcap                   =
                      |     45 +
 head/contrib/libpcap/savefile.c                                           =
                      |     15 +-
 head/contrib/libpcap/scanner.l                                            =
                      |      8 +-
 head/contrib/libpcap/selpolltest.c                                        =
                      |    350 -
 head/contrib/libpcap/sf-pcap-ng.c                                         =
                      |      8 +-
 head/contrib/libpcap/sf-pcap.c                                            =
                      |      8 +-
 head/contrib/libpcap/test/filtertest.c                                    =
                      |    266 +
 head/contrib/libpcap/test/findalldevstest.c                               =
                      |    131 +
 head/contrib/libpcap/test/nonblocktest.c                                  =
                      |    226 +
 head/contrib/libpcap/test/opentest.c                                      =
                      |    216 +
 head/contrib/libpcap/test/reactivatetest.c                                =
                      |     84 +
 head/contrib/libpcap/test/selpolltest.c                                   =
                      |    350 +
 head/contrib/libstdc++/include/bits/locale_facets.tcc                     =
                      |     12 +-
 head/contrib/libstdc++/include/bits/stl_bvector.h                         =
                      |     18 +-
 head/contrib/libstdc++/include/bits/stl_deque.h                           =
                      |     14 +-
 head/contrib/libstdc++/include/bits/stl_list.h                            =
                      |     13 +-
 head/contrib/libstdc++/include/bits/stl_map.h                             =
                      |      4 +-
 head/contrib/libstdc++/include/bits/stl_multimap.h                        =
                      |      6 +-
 head/contrib/libstdc++/include/bits/stl_multiset.h                        =
                      |     12 +-
 head/contrib/libstdc++/include/bits/stl_set.h                             =
                      |     12 +-
 head/contrib/libstdc++/include/bits/stl_tree.h                            =
                      |     49 +-
 head/contrib/libstdc++/include/bits/stl_vector.h                          =
                      |     13 +-
 head/contrib/llvm/include/llvm-c/lto.h                                    =
                      |      6 -
 head/contrib/llvm/include/llvm/ADT/SmallPtrSet.h                          =
                      |      3 -
 head/contrib/llvm/include/llvm/ADT/StringMap.h                            =
                      |      2 +-
 head/contrib/llvm/include/llvm/CodeGen/DFAPacketizer.h                    =
                      |     44 +-
 head/contrib/llvm/include/llvm/CodeGen/Passes.h                           =
                      |      2 +-
 head/contrib/llvm/include/llvm/CodeGen/ScheduleDAGInstrs.h                =
                      |      7 +
 head/contrib/llvm/include/llvm/CodeGen/SlotIndexes.h                      =
                      |    211 +-
 head/contrib/llvm/include/llvm/IntrinsicsX86.td                           =
                      |     20 -
 head/contrib/llvm/include/llvm/LLVMContext.h                              =
                      |      2 +-
 head/contrib/llvm/include/llvm/MC/MCParser/AsmLexer.h                     =
                      |      3 -
 head/contrib/llvm/include/llvm/MC/MCParser/MCAsmLexer.h                   =
                      |      3 +-
 head/contrib/llvm/include/llvm/Object/ELF.h                               =
                      |      9 +
 head/contrib/llvm/include/llvm/Operator.h                                 =
                      |     31 +-
 head/contrib/llvm/include/llvm/Support/FileSystem.h                       =
                      |      4 +-
 head/contrib/llvm/include/llvm/Support/IRBuilder.h                        =
                      |     87 +-
 head/contrib/llvm/include/llvm/Support/JSONParser.h                       =
                      |    448 -
 head/contrib/llvm/include/llvm/Support/Locale.h                           =
                      |     17 +
 head/contrib/llvm/include/llvm/Support/MDBuilder.h                        =
                      |    118 +
 head/contrib/llvm/include/llvm/Support/Process.h                          =
                      |      4 +
 head/contrib/llvm/include/llvm/Support/SourceMgr.h                        =
                      |      7 +-
 head/contrib/llvm/include/llvm/Support/YAMLParser.h                       =
                      |      5 +-
 head/contrib/llvm/include/llvm/Support/raw_ostream.h                      =
                      |      5 +
 head/contrib/llvm/include/llvm/TableGen/Error.h                           =
                      |      5 +
 head/contrib/llvm/include/llvm/TableGen/Record.h                          =
                      |      4 +-
 head/contrib/llvm/include/llvm/Target/TargetLibraryInfo.h                 =
                      |     10 +-
 head/contrib/llvm/include/llvm/Target/TargetRegisterInfo.h                =
                      |      2 +-
 head/contrib/llvm/include/llvm/Transforms/Utils/BasicBlockUtils.h         =
                      |      3 +-
 head/contrib/llvm/include/llvm/Transforms/Vectorize.h                     =
                      |      9 +
 head/contrib/llvm/lib/Analysis/ConstantFolding.cpp                        =
                      |     14 +-
 head/contrib/llvm/lib/Analysis/ScalarEvolution.cpp                        =
                      |      2 +-
 head/contrib/llvm/lib/Analysis/ValueTracking.cpp                          =
                      |      2 +-
 head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfAccelTable.cpp              =
                      |     53 +-
 head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfAccelTable.h                =
                      |     37 +-
 head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp             =
                      |      7 +-
 head/contrib/llvm/lib/CodeGen/DFAPacketizer.cpp                           =
                      |     87 +-
 head/contrib/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp                    =
                      |     12 +-
 head/contrib/llvm/lib/CodeGen/MachineBasicBlock.cpp                       =
                      |     36 +-
 head/contrib/llvm/lib/CodeGen/MachineBlockPlacement.cpp                   =
                      |    249 +-
 head/contrib/llvm/lib/CodeGen/Passes.cpp                                  =
                      |     55 +-
 head/contrib/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp                       =
                      |      6 +-
 head/contrib/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp                =
                      |      1 +
 head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp          =
                      |      3 +-
 head/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp         =
                      |     84 +-
 head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp        =
                      |      2 +-
 head/contrib/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp             =
                      |      5 +-
 head/contrib/llvm/lib/CodeGen/SlotIndexes.cpp                             =
                      |     52 +-
 head/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/GDBRegistrar.cpp        =
                      |    214 +
 head/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/JITRegistrar.h          =
                      |     43 +
 head/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/ObjectImage.h           =
                      |     59 +
 head/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp         =
                      |     37 +-
 head/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp      =
                      |    173 +-
 head/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h        =
                      |     12 +-
 head/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h       =
                      |     21 +-
 head/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp    =
                      |      4 +-
 head/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.h      =
                      |      4 +-
 head/contrib/llvm/lib/MC/MCParser/AsmParser.cpp                           =
                      |     10 +-
 head/contrib/llvm/lib/Object/ELFObjectFile.cpp                            =
                      |     10 -
 head/contrib/llvm/lib/Support/JSONParser.cpp                              =
                      |    302 -
 head/contrib/llvm/lib/Support/Locale.cpp                                  =
                      |     10 +
 head/contrib/llvm/lib/Support/LocaleGeneric.inc                           =
                      |     17 +
 head/contrib/llvm/lib/Support/LocaleWindows.inc                           =
                      |     15 +
 head/contrib/llvm/lib/Support/LocaleXlocale.inc                           =
                      |     61 +
 head/contrib/llvm/lib/Support/Memory.cpp                                  =
                      |      6 +-
 head/contrib/llvm/lib/Support/SmallPtrSet.cpp                             =
                      |      3 +-
 head/contrib/llvm/lib/Support/SourceMgr.cpp                               =
                      |     48 +-
 head/contrib/llvm/lib/Support/Unix/PathV2.inc                             =
                      |      7 +-
 head/contrib/llvm/lib/Support/Unix/Process.inc                            =
                      |      4 +
 head/contrib/llvm/lib/Support/Windows/PathV2.inc                          =
                      |      6 +-
 head/contrib/llvm/lib/Support/Windows/Process.inc                         =
                      |     32 +
 head/contrib/llvm/lib/Support/YAMLParser.cpp                              =
                      |      6 +-
 head/contrib/llvm/lib/Support/raw_ostream.cpp                             =
                      |     13 +
 head/contrib/llvm/lib/TableGen/Error.cpp                                  =
                      |     16 +
 head/contrib/llvm/lib/Target/ARM/ARMCallingConv.td                        =
                      |      4 -
 head/contrib/llvm/lib/Target/ARM/ARMInstrFormats.td                       =
                      |      1 +
 head/contrib/llvm/lib/Target/ARM/ARMInstrInfo.td                          =
                      |     68 +-
 head/contrib/llvm/lib/Target/ARM/ARMInstrNEON.td                          =
                      |    183 +-
 head/contrib/llvm/lib/Target/ARM/ARMTargetMachine.cpp                     =
                      |     20 +-
 head/contrib/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp               =
                      |     45 +-
 head/contrib/llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp         =
                      |     42 +-
 head/contrib/llvm/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp           =
                      |      4 +-
 head/contrib/llvm/lib/Target/CellSPU/SPUCallingConv.td                    =
                      |      4 -
 head/contrib/llvm/lib/Target/CellSPU/SPUTargetMachine.cpp                 =
                      |      6 +-
 head/contrib/llvm/lib/Target/Hexagon/Hexagon.h                            =
                      |      1 -
 head/contrib/llvm/lib/Target/Hexagon/HexagonAsmPrinter.cpp                =
                      |     53 +-
 head/contrib/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp              =
                      |      4 +-
 head/contrib/llvm/lib/Target/Hexagon/HexagonInstrFormats.td               =
                      |     96 +-
 head/contrib/llvm/lib/Target/Hexagon/HexagonInstrFormatsV4.td             =
                      |     27 +-
 head/contrib/llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp                 =
                      |   1009 +-
 head/contrib/llvm/lib/Target/Hexagon/HexagonInstrInfo.h                   =
                      |     10 -
 head/contrib/llvm/lib/Target/Hexagon/HexagonInstrInfo.td                  =
                      |      4 -
 head/contrib/llvm/lib/Target/Hexagon/HexagonInstrInfoV3.td                =
                      |     51 +-
 head/contrib/llvm/lib/Target/Hexagon/HexagonInstrInfoV4.td                =
                      |   2917 +-
 head/contrib/llvm/lib/Target/Hexagon/HexagonMCInst.h                      =
                      |     41 -
 head/contrib/llvm/lib/Target/Hexagon/HexagonMCInstLower.cpp               =
                      |      2 +-
 head/contrib/llvm/lib/Target/Hexagon/HexagonSchedule.td                   =
                      |     31 +-
 head/contrib/llvm/lib/Target/Hexagon/HexagonScheduleV4.td                 =
                      |     35 +-
 head/contrib/llvm/lib/Target/Hexagon/HexagonTargetMachine.cpp             =
                      |     19 +-
 head/contrib/llvm/lib/Target/Hexagon/HexagonVLIWPacketizer.cpp            =
                      |   3642 -
 head/contrib/llvm/lib/Target/Hexagon/InstPrinter/HexagonInstPrinter.cpp   =
                      |     65 +-
 head/contrib/llvm/lib/Target/Hexagon/InstPrinter/HexagonInstPrinter.h     =
                      |      2 -
 head/contrib/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonBaseInfo.h       =
                      |     31 +-
 head/contrib/llvm/lib/Target/MBlaze/MBlazeCallingConv.td                  =
                      |      4 -
 head/contrib/llvm/lib/Target/MBlaze/MBlazeTargetMachine.cpp               =
                      |      4 +-
 head/contrib/llvm/lib/Target/MSP430/MSP430TargetMachine.cpp               =
                      |      4 +-
 head/contrib/llvm/lib/Target/Mips/Disassembler/MipsDisassembler.cpp       =
                      |    552 +
 head/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsAsmBackend.cpp         =
                      |      6 +-
 head/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsMCCodeEmitter.cpp      =
                      |      2 +-
 head/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsMCTargetDesc.cpp       =
                      |     41 +-
 head/contrib/llvm/lib/Target/Mips/Mips64InstrInfo.td                      =
                      |     55 +-
 head/contrib/llvm/lib/Target/Mips/MipsCondMov.td                          =
                      |     48 +-
 head/contrib/llvm/lib/Target/Mips/MipsISelLowering.cpp                    =
                      |      2 +
 head/contrib/llvm/lib/Target/Mips/MipsInstrFPU.td                         =
                      |     68 +-
 head/contrib/llvm/lib/Target/Mips/MipsInstrFormats.td                     =
                      |      6 +
 head/contrib/llvm/lib/Target/Mips/MipsInstrInfo.td                        =
                      |    121 +-
 head/contrib/llvm/lib/Target/Mips/MipsTargetMachine.cpp                   =
                      |     14 +-
 head/contrib/llvm/lib/Target/PTX/PTXTargetMachine.cpp                     =
                      |      8 +-
 head/contrib/llvm/lib/Target/PowerPC/PPCCallingConv.td                    =
                      |      4 -
 head/contrib/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp                 =
                      |      4 +-
 head/contrib/llvm/lib/Target/Sparc/SparcTargetMachine.cpp                 =
                      |      6 +-
 head/contrib/llvm/lib/Target/TargetLibraryInfo.cpp                        =
                      |     80 +-
 head/contrib/llvm/lib/Target/X86/Utils/X86ShuffleDecode.cpp               =
                      |      3 +
 head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp                      =
                      |    108 +-
 head/contrib/llvm/lib/Target/X86/X86ISelLowering.h                        =
                      |      6 +-
 head/contrib/llvm/lib/Target/X86/X86InstrFragmentsSIMD.td                 =
                      |      2 +
 head/contrib/llvm/lib/Target/X86/X86InstrInfo.cpp                         =
                      |      4 +-
 head/contrib/llvm/lib/Target/X86/X86InstrSSE.td                           =
                      |     54 +-
 head/contrib/llvm/lib/Target/X86/X86Subtarget.cpp                         =
                      |      4 +-
 head/contrib/llvm/lib/Target/X86/X86TargetMachine.cpp                     =
                      |     12 +-
 head/contrib/llvm/lib/Target/XCore/XCoreTargetMachine.cpp                 =
                      |      2 +-
 head/contrib/llvm/lib/Transforms/IPO/Internalize.cpp                      =
                      |      2 +
 head/contrib/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp               =
                      |     11 +-
 head/contrib/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp            =
                      |     19 +-
 head/contrib/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp                  =
                      |      7 +-
 head/contrib/llvm/lib/Transforms/Scalar/ObjCARC.cpp                       =
                      |     69 +-
 head/contrib/llvm/lib/Transforms/Scalar/Reassociate.cpp                   =
                      |      5 +-
 head/contrib/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp              =
                      |     25 +-
 head/contrib/llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp             =
                      |     43 +-
 head/contrib/llvm/lib/Transforms/Vectorize/BBVectorize.cpp                =
                      |     65 +-
 head/contrib/llvm/lib/VMCore/AutoUpgrade.cpp                              =
                      |     43 +-
 head/contrib/llvm/lib/VMCore/Instructions.cpp                             =
                      |     17 +
 head/contrib/llvm/lib/VMCore/LLVMContext.cpp                              =
                      |      6 +-
 head/contrib/llvm/lib/VMCore/Module.cpp                                   =
                      |      2 +-
 head/contrib/llvm/lib/VMCore/Verifier.cpp                                 =
                      |     20 +-
 head/contrib/llvm/tools/bugpoint/ToolRunner.cpp                           =
                      |      2 +-
 head/contrib/llvm/tools/clang/include/clang/AST/Decl.h                    =
                      |      4 -
 head/contrib/llvm/tools/clang/include/clang/AST/DeclBase.h                =
                      |      1 -
 head/contrib/llvm/tools/clang/include/clang/AST/DeclLookups.h             =
                      |      4 +
 head/contrib/llvm/tools/clang/include/clang/AST/Expr.h                    =
                      |     14 +-
 head/contrib/llvm/tools/clang/include/clang/AST/ExternalASTSource.h       =
                      |      6 +
 head/contrib/llvm/tools/clang/include/clang/AST/RecursiveASTVisitor.h     =
                      |      1 +
 head/contrib/llvm/tools/clang/include/clang/AST/Stmt.h                    =
                      |     42 +
 head/contrib/llvm/tools/clang/include/clang/AST/Type.h                    =
                      |     34 +-
 head/contrib/llvm/tools/clang/include/clang/AST/VTableBuilder.h           =
                      |     12 +-
 head/contrib/llvm/tools/clang/include/clang/Analysis/ProgramPoint.h       =
                      |      2 +-
 head/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsX86.def         =
                      |      6 +-
 head/contrib/llvm/tools/clang/include/clang/Basic/ConvertUTF.h            =
                      |      2 +-
 head/contrib/llvm/tools/clang/include/clang/Basic/DelayedCleanupPool.h    =
                      |    110 -
 head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticSemaKinds.td  =
                      |     23 +-
 head/contrib/llvm/tools/clang/include/clang/Basic/ExceptionSpecificationTy=
pe.h                  |     18 +-
 head/contrib/llvm/tools/clang/include/clang/Basic/OnDiskHashTable.h       =
                      |     33 +-
 head/contrib/llvm/tools/clang/include/clang/Basic/StmtNodes.td            =
                      |      1 +
 head/contrib/llvm/tools/clang/include/clang/Basic/TargetInfo.h            =
                      |     15 +
 head/contrib/llvm/tools/clang/include/clang/Driver/CC1Options.td          =
                      |      3 -
 head/contrib/llvm/tools/clang/include/clang/Driver/Compilation.h          =
                      |      3 +
 head/contrib/llvm/tools/clang/include/clang/Frontend/ASTUnit.h            =
                      |     10 -
 head/contrib/llvm/tools/clang/include/clang/Frontend/FrontendActions.h    =
                      |      9 -
 head/contrib/llvm/tools/clang/include/clang/Frontend/FrontendOptions.h    =
                      |      1 -
 head/contrib/llvm/tools/clang/include/clang/Frontend/TextDiagnostic.h     =
                      |     11 +-
 head/contrib/llvm/tools/clang/include/clang/Index/ASTLocation.h           =
                      |    173 -
 head/contrib/llvm/tools/clang/include/clang/Index/Analyzer.h              =
                      |     56 -
 head/contrib/llvm/tools/clang/include/clang/Index/DeclReferenceMap.h      =
                      |     50 -
 head/contrib/llvm/tools/clang/include/clang/Index/Entity.h                =
                      |    149 -
 head/contrib/llvm/tools/clang/include/clang/Index/GlobalCallGraph.h       =
                      |    149 -
 head/contrib/llvm/tools/clang/include/clang/Index/GlobalSelector.h        =
                      |    100 -
 head/contrib/llvm/tools/clang/include/clang/Index/Handlers.h              =
                      |     82 -
 head/contrib/llvm/tools/clang/include/clang/Index/IndexProvider.h         =
                      |     38 -
 head/contrib/llvm/tools/clang/include/clang/Index/Indexer.h               =
                      |     71 -
 head/contrib/llvm/tools/clang/include/clang/Index/Program.h               =
                      |     45 -
 head/contrib/llvm/tools/clang/include/clang/Index/STLExtras.h             =
                      |     63 -
 head/contrib/llvm/tools/clang/include/clang/Index/SelectorMap.h           =
                      |     57 -
 head/contrib/llvm/tools/clang/include/clang/Index/TranslationUnit.h       =
                      |     41 -
 head/contrib/llvm/tools/clang/include/clang/Parse/Parser.h                =
                      |     87 +-
 head/contrib/llvm/tools/clang/include/clang/Sema/Initialization.h         =
                      |      4 +-
 head/contrib/llvm/tools/clang/include/clang/Sema/ParsedTemplate.h         =
                      |      8 +-
 head/contrib/llvm/tools/clang/include/clang/Sema/Scope.h                  =
                      |      7 +-
 head/contrib/llvm/tools/clang/include/clang/Sema/Sema.h                   =
                      |    147 +-
 head/contrib/llvm/tools/clang/include/clang/Serialization/ASTBitCodes.h   =
                      |      2 +
 head/contrib/llvm/tools/clang/include/clang/Serialization/ASTReader.h     =
                      |      9 +-
 head/contrib/llvm/tools/clang/include/clang/Serialization/ASTWriter.h     =
                      |      1 +
 head/contrib/llvm/tools/clang/include/clang/Serialization/Module.h        =
                      |     10 +-
 head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensit=
ive/AnalysisManager.h |     17 -
 head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensit=
ive/SVals.h           |      2 +
 head/contrib/llvm/tools/clang/include/clang/Tooling/CompilationDatabase.h =
                      |     76 +-
 head/contrib/llvm/tools/clang/lib/AST/ASTContext.cpp                      =
                      |      5 +-
 head/contrib/llvm/tools/clang/lib/AST/Decl.cpp                            =
                      |    119 +-
 head/contrib/llvm/tools/clang/lib/AST/Expr.cpp                            =
                      |    335 +-
 head/contrib/llvm/tools/clang/lib/AST/ExprConstant.cpp                    =
                      |     56 +-
 head/contrib/llvm/tools/clang/lib/AST/ExternalASTSource.cpp               =
                      |      5 +-
 head/contrib/llvm/tools/clang/lib/AST/ItaniumMangle.cpp                   =
                      |     23 +-
 head/contrib/llvm/tools/clang/lib/AST/Stmt.cpp                            =
                      |      6 +-
 head/contrib/llvm/tools/clang/lib/AST/StmtPrinter.cpp                     =
                      |     17 +
 head/contrib/llvm/tools/clang/lib/AST/StmtProfile.cpp                     =
                      |      6 +
 head/contrib/llvm/tools/clang/lib/AST/Type.cpp                            =
                      |     10 +
 head/contrib/llvm/tools/clang/lib/AST/VTableBuilder.cpp                   =
                      |      9 +-
 head/contrib/llvm/tools/clang/lib/Analysis/CFG.cpp                        =
                      |      9 +-
 head/contrib/llvm/tools/clang/lib/Analysis/UninitializedValues.cpp        =
                      |      3 +-
 head/contrib/llvm/tools/clang/lib/Basic/TargetInfo.cpp                    =
                      |      1 +
 head/contrib/llvm/tools/clang/lib/Basic/Targets.cpp                       =
                      |      7 +-
 head/contrib/llvm/tools/clang/lib/Basic/Version.cpp                       =
                      |      2 +-
 head/contrib/llvm/tools/clang/lib/CodeGen/CGBlocks.cpp                    =
                      |      2 +
 head/contrib/llvm/tools/clang/lib/CodeGen/CGCall.cpp                      =
                      |    130 +-
 head/contrib/llvm/tools/clang/lib/CodeGen/CGClass.cpp                     =
                      |     13 +-
 head/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp                 =
                      |     48 +-
 head/contrib/llvm/tools/clang/lib/CodeGen/CGDecl.cpp                      =
                      |      4 +
 head/contrib/llvm/tools/clang/lib/CodeGen/CGExpr.cpp                      =
                      |    117 +-
 head/contrib/llvm/tools/clang/lib/CodeGen/CGExprAgg.cpp                   =
                      |     34 +-
 head/contrib/llvm/tools/clang/lib/CodeGen/CGExprCXX.cpp                   =
                      |      5 +-
 head/contrib/llvm/tools/clang/lib/CodeGen/CGExprConstant.cpp              =
                      |      8 +-
 head/contrib/llvm/tools/clang/lib/CodeGen/CGStmt.cpp                      =
                      |      7 +
 head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenFunction.cpp             =
                      |     11 +-
 head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenFunction.h               =
                      |     11 +-
 head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp               =
                      |      2 +-
 head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenTBAA.cpp                 =
                      |     36 +-
 head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenTBAA.h                   =
                      |      8 +-
 head/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp                  =
                      |     24 +-
 head/contrib/llvm/tools/clang/lib/Driver/Compilation.cpp                  =
                      |      4 +
 head/contrib/llvm/tools/clang/lib/Driver/Driver.cpp                       =
                      |     52 +-
 head/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp                   =
                      |     21 +-
 head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp                        =
                      |     13 +-
 head/contrib/llvm/tools/clang/lib/Frontend/ASTUnit.cpp                    =
                      |      6 +-
 head/contrib/llvm/tools/clang/lib/Frontend/CompilerInstance.cpp           =
                      |      7 +-
 head/contrib/llvm/tools/clang/lib/Frontend/CompilerInvocation.cpp         =
                      |      3 -
 head/contrib/llvm/tools/clang/lib/Frontend/FrontendActions.cpp            =
                      |     72 -
 head/contrib/llvm/tools/clang/lib/Frontend/InitHeaderSearch.cpp           =
                      |     12 +-
 head/contrib/llvm/tools/clang/lib/Frontend/TextDiagnostic.cpp             =
                      |    605 +-
 head/contrib/llvm/tools/clang/lib/FrontendTool/ExecuteCompilerInvocation.c=
pp                    |      1 -
 head/contrib/llvm/tools/clang/lib/Headers/avx2intrin.h                    =
                      |     14 +-
 head/contrib/llvm/tools/clang/lib/Headers/avxintrin.h                     =
                      |     26 +-
 head/contrib/llvm/tools/clang/lib/Index/ASTLocation.cpp                   =
                      |    114 -
 head/contrib/llvm/tools/clang/lib/Index/ASTVisitor.h                      =
                      |    143 -
 head/contrib/llvm/tools/clang/lib/Index/Analyzer.cpp                      =
                      |    470 -
 head/contrib/llvm/tools/clang/lib/Index/DeclReferenceMap.cpp              =
                      |     90 -
 head/contrib/llvm/tools/clang/lib/Index/Entity.cpp                        =
                      |    270 -
 head/contrib/llvm/tools/clang/lib/Index/EntityImpl.h                      =
                      |     71 -
 head/contrib/llvm/tools/clang/lib/Index/GlobalCallGraph.cpp               =
                      |    152 -
 head/contrib/llvm/tools/clang/lib/Index/GlobalSelector.cpp                =
                      |     71 -
 head/contrib/llvm/tools/clang/lib/Index/Handlers.cpp                      =
                      |     22 -
 head/contrib/llvm/tools/clang/lib/Index/IndexProvider.cpp                 =
                      |     20 -
 head/contrib/llvm/tools/clang/lib/Index/Indexer.cpp                       =
                      |    121 -
 head/contrib/llvm/tools/clang/lib/Index/Program.cpp                       =
                      |     50 -
 head/contrib/llvm/tools/clang/lib/Index/ProgramImpl.h                     =
                      |     56 -
 head/contrib/llvm/tools/clang/lib/Index/SelectorMap.cpp                   =
                      |     84 -
 head/contrib/llvm/tools/clang/lib/Parse/ParseCXXInlineMethods.cpp         =
                      |     24 +-
 head/contrib/llvm/tools/clang/lib/Parse/ParseDecl.cpp                     =
                      |     46 +-
 head/contrib/llvm/tools/clang/lib/Parse/ParseDeclCXX.cpp                  =
                      |     33 +-
 head/contrib/llvm/tools/clang/lib/Parse/ParseExpr.cpp                     =
                      |      4 +-
 head/contrib/llvm/tools/clang/lib/Parse/ParseExprCXX.cpp                  =
                      |     12 +-
 head/contrib/llvm/tools/clang/lib/Parse/ParseStmt.cpp                     =
                      |    181 +-
 head/contrib/llvm/tools/clang/lib/Parse/ParseTemplate.cpp                 =
                      |      3 +-
 head/contrib/llvm/tools/clang/lib/Parse/Parser.cpp                        =
                      |     28 +-
 head/contrib/llvm/tools/clang/lib/Rewrite/RewriteModernObjC.cpp           =
                      |    160 +-
 head/contrib/llvm/tools/clang/lib/Rewrite/RewriteRope.cpp                 =
                      |      5 +
 head/contrib/llvm/tools/clang/lib/Sema/Sema.cpp                           =
                      |      1 +
 head/contrib/llvm/tools/clang/lib/Sema/SemaAccess.cpp                     =
                      |      7 +
 head/contrib/llvm/tools/clang/lib/Sema/SemaDecl.cpp                       =
                      |     39 +-
 head/contrib/llvm/tools/clang/lib/Sema/SemaDeclCXX.cpp                    =
                      |    372 +-
 head/contrib/llvm/tools/clang/lib/Sema/SemaExceptionSpec.cpp              =
                      |    359 +-
 head/contrib/llvm/tools/clang/lib/Sema/SemaExpr.cpp                       =
                      |     35 +-
 head/contrib/llvm/tools/clang/lib/Sema/SemaExprCXX.cpp                    =
                      |     73 +-
 head/contrib/llvm/tools/clang/lib/Sema/SemaExprMember.cpp                 =
                      |     17 +-
 head/contrib/llvm/tools/clang/lib/Sema/SemaLookup.cpp                     =
                      |     94 +-
 head/contrib/llvm/tools/clang/lib/Sema/SemaOverload.cpp                   =
                      |      2 +
 head/contrib/llvm/tools/clang/lib/Sema/SemaPseudoObject.cpp               =
                      |     28 +-
 head/contrib/llvm/tools/clang/lib/Sema/SemaStmt.cpp                       =
                      |     11 +-
 head/contrib/llvm/tools/clang/lib/Sema/SemaStmtAttr.cpp                   =
                      |     48 +
 head/contrib/llvm/tools/clang/lib/Sema/SemaTemplate.cpp                   =
                      |      4 +
 head/contrib/llvm/tools/clang/lib/Sema/SemaTemplateDeduction.cpp          =
                      |     49 +-
 head/contrib/llvm/tools/clang/lib/Sema/SemaTemplateInstantiate.cpp        =
                      |     99 +-
 head/contrib/llvm/tools/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp    =
                      |    365 +-
 head/contrib/llvm/tools/clang/lib/Sema/SemaType.cpp                       =
                      |     52 +-
 head/contrib/llvm/tools/clang/lib/Sema/TreeTransform.h                    =
                      |     66 +-
 head/contrib/llvm/tools/clang/lib/Serialization/ASTReader.cpp             =
                      |    153 +-
 head/contrib/llvm/tools/clang/lib/Serialization/ASTReaderDecl.cpp         =
                      |      9 +-
 head/contrib/llvm/tools/clang/lib/Serialization/ASTReaderInternals.h      =
                      |     10 +-
 head/contrib/llvm/tools/clang/lib/Serialization/ASTReaderStmt.cpp         =
                      |     15 +-
 head/contrib/llvm/tools/clang/lib/Serialization/ASTWriter.cpp             =
                      |      4 +
 head/contrib/llvm/tools/clang/lib/Serialization/ASTWriterDecl.cpp         =
                      |      3 +
 head/contrib/llvm/tools/clang/lib/Serialization/ASTWriterStmt.cpp         =
                      |      8 +
 head/contrib/llvm/tools/clang/lib/Serialization/Module.cpp                =
                      |      3 +-
 head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/ObjCSelfInitChec=
ker.cpp               |     25 +-
 head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/AnalysisManager.cpp =
                      |     24 +-
 head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/CoreEngine.cpp      =
                      |      1 -
 head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp      =
                      |      1 +
 head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/ExprEngineCallAndRet=
urn.cpp               |      5 +
 head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer=
.cpp                  |      1 -
 head/contrib/llvm/tools/clang/lib/Tooling/CompilationDatabase.cpp         =
                      |    110 +-
 head/contrib/llvm/tools/llc/llc.cpp                                       =
                      |     26 -
 head/contrib/llvm/tools/lli/lli.cpp                                       =
                      |     28 +
 head/contrib/llvm/tools/llvm-mc/Disassembler.cpp                          =
                      |     67 +-
 head/contrib/llvm/tools/llvm-mc/Disassembler.h                            =
                      |     15 +-
 head/contrib/llvm/tools/llvm-mc/llvm-mc.cpp                               =
                      |    175 +-
 head/contrib/llvm/tools/llvm-stress/llvm-stress.cpp                       =
                      |     21 +-
 head/contrib/llvm/tools/opt/opt.cpp                                       =
                      |      7 +
 head/contrib/llvm/utils/TableGen/AsmMatcherEmitter.cpp                    =
                      |     19 +-
 head/contrib/llvm/utils/TableGen/AsmWriterEmitter.cpp                     =
                      |      7 +-
 head/contrib/llvm/utils/TableGen/CodeGenDAGPatterns.cpp                   =
                      |     25 +-
 head/contrib/llvm/utils/TableGen/CodeGenRegisters.cpp                     =
                      |     10 +-
 head/contrib/llvm/utils/TableGen/EDEmitter.cpp                            =
                      |      1 +
 head/contrib/llvm/utils/TableGen/RegisterInfoEmitter.cpp                  =
                      |     13 +-
 head/contrib/ncurses/man/curs_threads.3x                                  =
                      |      4 +-
 head/contrib/netcat/FREEBSD-vendor                                        =
                      |      4 +-
 head/contrib/netcat/nc.1                                                  =
                      |     50 +-
 head/contrib/netcat/netcat.c                                              =
                      |    122 +-
 head/contrib/openpam/CREDITS                                              =
                      |     11 +-
 head/contrib/openpam/HISTORY                                              =
                      |     58 +-
 head/contrib/openpam/LICENSE                                              =
                      |      4 +-
 head/contrib/openpam/Makefile.am                                          =
                      |      4 +-
 head/contrib/openpam/Makefile.in                                          =
                      |     14 +-
 head/contrib/openpam/RELNOTES                                             =
                      |      9 +-
 head/contrib/openpam/TODO                                                 =
                      |     13 +
 head/contrib/openpam/aclocal.m4                                           =
                      |    272 +-
 head/contrib/openpam/bin/Makefile.am                                      =
                      |      4 +-
 head/contrib/openpam/bin/Makefile.in                                      =
                      |      6 +-
 head/contrib/openpam/bin/openpam_dump_policy/Makefile.am                  =
                      |      7 +
 head/contrib/openpam/bin/openpam_dump_policy/Makefile.in                  =
                      |    474 +
 head/contrib/openpam/bin/openpam_dump_policy/openpam_dump_policy.c        =
                      |    202 +
 head/contrib/openpam/bin/pamtest/pamtest.1                                =
                      |     20 +-
 head/contrib/openpam/bin/pamtest/pamtest.c                                =
                      |     19 +-
 head/contrib/openpam/bin/su/su.1                                          =
                      |     11 +-
 head/contrib/openpam/config.h.in                                          =
                      |      6 +
 head/contrib/openpam/configure                                            =
                      |    197 +-
 head/contrib/openpam/configure.ac                                         =
                      |     19 +-
 head/contrib/openpam/doc/man/Makefile.am                                  =
                      |     15 +-
 head/contrib/openpam/doc/man/Makefile.in                                  =
                      |     15 +-
 head/contrib/openpam/doc/man/openpam.3                                    =
                      |     25 +-
 head/contrib/openpam/doc/man/openpam_borrow_cred.3                        =
                      |     16 +-
 head/contrib/openpam/doc/man/openpam_free_data.3                          =
                      |     14 +-
 head/contrib/openpam/doc/man/openpam_free_envlist.3                       =
                      |     15 +-
 head/contrib/openpam/doc/man/openpam_get_feature.3                        =
                      |    105 +
 head/contrib/openpam/doc/man/openpam_get_option.3                         =
                      |     16 +-
 head/contrib/openpam/doc/man/openpam_log.3                                =
                      |     17 +-
 head/contrib/openpam/doc/man/openpam_nullconv.3                           =
                      |     16 +-
 head/contrib/openpam/doc/man/openpam_readline.3                           =
                      |     36 +-
 head/contrib/openpam/doc/man/openpam_readlinev.3                          =
                      |    159 +
 head/contrib/openpam/doc/man/openpam_readword.3                           =
                      |    152 +
 head/contrib/openpam/doc/man/openpam_restore_cred.3                       =
                      |     16 +-
 head/contrib/openpam/doc/man/openpam_set_feature.3                        =
                      |     87 +
 head/contrib/openpam/doc/man/openpam_set_option.3                         =
                      |     16 +-
 head/contrib/openpam/doc/man/openpam_straddch.3                           =
                      |    122 +
 head/contrib/openpam/doc/man/openpam_subst.3                              =
                      |     22 +-
 head/contrib/openpam/doc/man/openpam_ttyconv.3                            =
                      |     18 +-
 head/contrib/openpam/doc/man/pam.3                                        =
                      |      5 +-
 head/contrib/openpam/doc/man/pam.conf.5                                   =
                      |     10 +-
 head/contrib/openpam/doc/man/pam_acct_mgmt.3                              =
                      |     16 +-
 head/contrib/openpam/doc/man/pam_authenticate.3                           =
                      |     18 +-
 head/contrib/openpam/doc/man/pam_chauthtok.3                              =
                      |     16 +-
 head/contrib/openpam/doc/man/pam_close_session.3                          =
                      |     16 +-
 head/contrib/openpam/doc/man/pam_conv.3                                   =
                      |      7 +-
 head/contrib/openpam/doc/man/pam_end.3                                    =
                      |     17 +-
 head/contrib/openpam/doc/man/pam_error.3                                  =
                      |     16 +-
 head/contrib/openpam/doc/man/pam_get_authtok.3                            =
                      |     22 +-
 head/contrib/openpam/doc/man/pam_get_data.3                               =
                      |     16 +-
 head/contrib/openpam/doc/man/pam_get_item.3                               =
                      |     16 +-
 head/contrib/openpam/doc/man/pam_get_user.3                               =
                      |     18 +-
 head/contrib/openpam/doc/man/pam_getenv.3                                 =
                      |     14 +-
 head/contrib/openpam/doc/man/pam_getenvlist.3                             =
                      |     14 +-
 head/contrib/openpam/doc/man/pam_info.3                                   =
                      |     16 +-
 head/contrib/openpam/doc/man/pam_open_session.3                           =
                      |     16 +-
 head/contrib/openpam/doc/man/pam_prompt.3                                 =
                      |     16 +-
 head/contrib/openpam/doc/man/pam_putenv.3                                 =
                      |     16 +-
 head/contrib/openpam/doc/man/pam_set_data.3                               =
                      |     14 +-
 head/contrib/openpam/doc/man/pam_set_item.3                               =
                      |     14 +-
 head/contrib/openpam/doc/man/pam_setcred.3                                =
                      |     16 +-
 head/contrib/openpam/doc/man/pam_setenv.3                                 =
                      |     18 +-
 head/contrib/openpam/doc/man/pam_sm_acct_mgmt.3                           =
                      |     14 +-
 head/contrib/openpam/doc/man/pam_sm_authenticate.3                        =
                      |     14 +-
 head/contrib/openpam/doc/man/pam_sm_chauthtok.3                           =
                      |     14 +-
 head/contrib/openpam/doc/man/pam_sm_close_session.3                       =
                      |     14 +-
 head/contrib/openpam/doc/man/pam_sm_open_session.3                        =
                      |     14 +-
 head/contrib/openpam/doc/man/pam_sm_setcred.3                             =
                      |     14 +-
 head/contrib/openpam/doc/man/pam_start.3                                  =
                      |     14 +-
 head/contrib/openpam/doc/man/pam_strerror.3                               =
                      |     14 +-
 head/contrib/openpam/doc/man/pam_verror.3                                 =
                      |     16 +-
 head/contrib/openpam/doc/man/pam_vinfo.3                                  =
                      |     16 +-
 head/contrib/openpam/doc/man/pam_vprompt.3                                =
                      |     16 +-
 head/contrib/openpam/include/security/openpam.h                           =
                      |     43 +-
 head/contrib/openpam/include/security/openpam_version.h                   =
                      |      6 +-
 head/contrib/openpam/lib/Makefile.am                                      =
                      |     11 +-
 head/contrib/openpam/lib/Makefile.in                                      =
                      |     29 +-
 head/contrib/openpam/lib/openpam_check_owner_perms.c                      =
                      |     23 +-
 head/contrib/openpam/lib/openpam_configure.c                              =
                      |    599 +-
 head/contrib/openpam/lib/openpam_constants.h                              =
                      |      9 +-
 head/contrib/openpam/lib/openpam_ctype.h                                  =
                      |     68 +
 head/contrib/openpam/lib/openpam_debug.h                                  =
                      |     45 +-
 head/contrib/openpam/lib/openpam_dynamic.c                                =
                      |     81 +-
 head/contrib/openpam/lib/openpam_features.c                               =
                      |     69 +
 head/contrib/openpam/lib/openpam_features.h                               =
                      |     48 +
 head/contrib/openpam/lib/openpam_get_feature.c                            =
                      |     99 +
 head/contrib/openpam/lib/openpam_get_option.c                             =
                      |      3 +-
 head/contrib/openpam/lib/openpam_impl.h                                   =
                      |     18 +-
 head/contrib/openpam/lib/openpam_load.c                                   =
                      |      6 +-
 head/contrib/openpam/lib/openpam_log.c                                    =
                      |     14 +-
 head/contrib/openpam/lib/openpam_readline.c                               =
                      |     52 +-
 head/contrib/openpam/lib/openpam_readlinev.c                              =
                      |    156 +
 head/contrib/openpam/lib/openpam_readword.c                               =
                      |    207 +
 head/contrib/openpam/lib/openpam_set_feature.c                            =
                      |     75 +
 head/contrib/openpam/lib/openpam_set_option.c                             =
                      |      3 +-
 head/contrib/openpam/lib/openpam_straddch.c                               =
                      |    111 +
 head/contrib/openpam/lib/openpam_strlcat.h                                =
                      |     54 +
 head/contrib/openpam/lib/openpam_strlcmp.h                                =
                      |      5 +-
 head/contrib/openpam/lib/openpam_strlcpy.h                                =
                      |      7 +-
 head/contrib/openpam/lib/openpam_subst.c                                  =
                      |      5 +-
 head/contrib/openpam/lib/openpam_ttyconv.c                                =
                      |     12 +-
 head/contrib/openpam/lib/pam_get_authtok.c                                =
                      |     12 +-
 head/contrib/openpam/lib/pam_putenv.c                                     =
                      |      4 +-
 head/contrib/openpam/lib/pam_setenv.c                                     =
                      |      4 +-
 head/contrib/openpam/ltmain.sh                                            =
                      |     95 +-
 head/contrib/openpam/misc/gendoc.pl                                       =
                      |    121 +-
 head/contrib/openpam/pamgdb.in                                            =
                      |     41 +
 head/contrib/openpam/t/Makefile.am                                        =
                      |     16 +
 head/contrib/openpam/t/Makefile.in                                        =
                      |    605 +
 head/contrib/openpam/t/t.h                                                =
                      |     60 +
 head/contrib/openpam/t/t_main.c                                           =
                      |    119 +
 head/contrib/openpam/t/t_openpam_readlinev.c                              =
                      |    342 +
 head/contrib/openpam/t/t_openpam_readword.c                               =
                      |    829 +
 head/contrib/tcpdump/CHANGES                                              =
                      |     61 +
 head/contrib/tcpdump/CREDITS                                              =
                      |    372 +-
 head/contrib/tcpdump/Makefile.in                                          =
                      |    105 +-
 head/contrib/tcpdump/VERSION                                              =
                      |      2 +-
 head/contrib/tcpdump/acconfig.h                                           =
                      |     18 -
 head/contrib/tcpdump/addrtoname.c                                         =
                      |     30 +-
 head/contrib/tcpdump/addrtoname.h                                         =
                      |      1 +
 head/contrib/tcpdump/bootp.h                                              =
                      |      4 +-
 head/contrib/tcpdump/config.h.in                                          =
                      |     48 +-
 head/contrib/tcpdump/configure                                            =
                      |   4198 +-
 head/contrib/tcpdump/configure.in                                         =
                      |    112 +-
 head/contrib/tcpdump/cpack.c                                              =
                      |      4 +-
 head/contrib/tcpdump/cpack.h                                              =
                      |      3 +
 head/contrib/tcpdump/ethertype.h                                          =
                      |     16 +-
 head/contrib/tcpdump/forces.h                                             =
                      |      2 +-
 head/contrib/tcpdump/ieee802_11_radio.h                                   =
                      |     64 +-
 head/contrib/tcpdump/in_cksum.c                                           =
                      |    200 +
 head/contrib/tcpdump/interface.h                                          =
                      |     24 +-
 head/contrib/tcpdump/ip.h                                                 =
                      |      6 +-
 head/contrib/tcpdump/ip6.h                                                =
                      |     37 +-
 head/contrib/tcpdump/ipproto.c                                            =
                      |      1 +
 head/contrib/tcpdump/ipproto.h                                            =
                      |      5 +-
 head/contrib/tcpdump/missing/addrsize.h                                   =
                      |     36 -
 head/contrib/tcpdump/missing/bittypes.h                                   =
                      |    117 -
 head/contrib/tcpdump/missing/resolv6.h                                    =
                      |     36 -
 head/contrib/tcpdump/missing/resolv_ext.h                                 =
                      |     49 -
 head/contrib/tcpdump/netdissect.h                                         =
                      |     53 +-
 head/contrib/tcpdump/ospf.h                                               =
                      |      4 +-
 head/contrib/tcpdump/oui.c                                                =
                      |      1 +
 head/contrib/tcpdump/oui.h                                                =
                      |      1 +
 head/contrib/tcpdump/ppi.h                                                =
                      |      9 +
 head/contrib/tcpdump/print-802_11.c                                       =
                      |    634 +-
 head/contrib/tcpdump/print-802_15_4.c                                     =
                      |    183 +
 head/contrib/tcpdump/print-ap1394.c                                       =
                      |      2 +-
 head/contrib/tcpdump/print-arcnet.c                                       =
                      |      4 +-
 head/contrib/tcpdump/print-arp.c                                          =
                      |      3 +-
 head/contrib/tcpdump/print-atalk.c                                        =
                      |     65 +-
 head/contrib/tcpdump/print-atm.c                                          =
                      |     12 +-
 head/contrib/tcpdump/print-babel.c                                        =
                      |    414 +
 head/contrib/tcpdump/print-bgp.c                                          =
                      |    134 +-
 head/contrib/tcpdump/print-carp.c                                         =
                      |     88 +
 head/contrib/tcpdump/print-cdp.c                                          =
                      |      2 +-
 head/contrib/tcpdump/print-chdlc.c                                        =
                      |      2 +-
 head/contrib/tcpdump/print-dccp.c                                         =
                      |     56 +-
 head/contrib/tcpdump/print-dhcp6.c                                        =
                      |      6 +-
 head/contrib/tcpdump/print-enc.c                                          =
                      |      2 +-
 head/contrib/tcpdump/print-ether.c                                        =
                      |    193 +-
 head/contrib/tcpdump/print-forces.c                                       =
                      |     22 +-
 head/contrib/tcpdump/print-fr.c                                           =
                      |      6 +-
 head/contrib/tcpdump/print-gre.c                                          =
                      |      4 +-
 head/contrib/tcpdump/print-icmp.c                                         =
                      |     23 +-
 head/contrib/tcpdump/print-icmp6.c                                        =
                      |     86 +-
 head/contrib/tcpdump/print-igmp.c                                         =
                      |      6 +-
 head/contrib/tcpdump/print-ip.c                                           =
                      |    162 +-
 head/contrib/tcpdump/print-ip6.c                                          =
                      |     90 +-
 head/contrib/tcpdump/print-ipnet.c                                        =
                      |      2 +-
 head/contrib/tcpdump/print-ipx.c                                          =
                      |      6 +-
 head/contrib/tcpdump/print-isoclns.c                                      =
                      |     36 +-
 head/contrib/tcpdump/print-juniper.c                                      =
                      |     16 +-
 head/contrib/tcpdump/print-lane.c                                         =
                      |      6 +-
 head/contrib/tcpdump/print-llc.c                                          =
                      |      8 +-
 head/contrib/tcpdump/print-lldp.c                                         =
                      |    524 +-
 head/contrib/tcpdump/print-mobile.c                                       =
                      |      5 +-
 head/contrib/tcpdump/print-mpls.c                                         =
                      |    202 +-
 head/contrib/tcpdump/print-null.c                                         =
                      |      4 +-
 head/contrib/tcpdump/print-ospf.c                                         =
                      |      6 +-
 head/contrib/tcpdump/print-pflog.c                                        =
                      |      2 +-
 head/contrib/tcpdump/print-pgm.c                                          =
                      |     88 +
 head/contrib/tcpdump/print-pim.c                                          =
                      |     30 +-
 head/contrib/tcpdump/print-ppi.c                                          =
                      |    104 +
 head/contrib/tcpdump/print-ppp.c                                          =
                      |     22 +-
 head/contrib/tcpdump/print-rpki-rtr.c                                     =
                      |    368 +
 head/contrib/tcpdump/print-rrcp.c                                         =
                      |      4 +-
 head/contrib/tcpdump/print-sctp.c                                         =
                      |      6 +-
 head/contrib/tcpdump/print-sflow.c                                        =
                      |    803 +-
 head/contrib/tcpdump/print-sl.c                                           =
                      |      4 +-
 head/contrib/tcpdump/print-sll.c                                          =
                      |      2 +-
 head/contrib/tcpdump/print-sunrpc.c                                       =
                      |     12 +-
 head/contrib/tcpdump/print-symantec.c                                     =
                      |      2 +-
 head/contrib/tcpdump/print-tcp.c                                          =
                      |    103 +-
 head/contrib/tcpdump/print-tftp.c                                         =
                      |      8 -
 head/contrib/tcpdump/print-udp.c                                          =
                      |    136 +-
 head/contrib/tcpdump/print-vrrp.c                                         =
                      |     12 +-
 head/contrib/tcpdump/tcp.h                                                =
                      |      1 +
 head/contrib/tcpdump/tcpdump-stdinc.h                                     =
                      |     39 +-
 head/contrib/tcpdump/tcpdump.1.in                                         =
                      |     51 +-
 head/contrib/tcpdump/tcpdump.c                                            =
                      |    214 +-
 head/contrib/tcpdump/tests/02-sunrise-sunset-esp.puu                      =
                      |     34 -
 head/contrib/tcpdump/tests/08-sunrise-sunset-aes.puu                      =
                      |     36 -
 head/contrib/tcpdump/tests/08-sunrise-sunset-esp2.puu                     =
                      |     43 -
 head/contrib/tcpdump/tests/TESTLIST                                       =
                      |     51 -
 head/contrib/tcpdump/tests/TESTonce                                       =
                      |     46 -
 head/contrib/tcpdump/tests/TESTrun.sh                                     =
                      |     63 -
 head/contrib/tcpdump/tests/bgp-infinite-loop.pcap                         =
                      |    Bin=20
 head/contrib/tcpdump/tests/bgp_vpn_attrset.out                            =
                      |     19 -
 head/contrib/tcpdump/tests/bgp_vpn_attrset.pcap                           =
                      |    Bin=20
 head/contrib/tcpdump/tests/chdlc-slarp-short.pcap                         =
                      |    Bin=20
 head/contrib/tcpdump/tests/chdlc-slarp.pcap                               =
                      |    Bin=20
 head/contrib/tcpdump/tests/dio.out                                        =
                      |      1 -
 head/contrib/tcpdump/tests/dio.pcap                                       =
                      |    Bin=20
 head/contrib/tcpdump/tests/e1000g.out                                     =
                      |     20 -
 head/contrib/tcpdump/tests/e1000g.pcap                                    =
                      |    Bin=20
 head/contrib/tcpdump/tests/eapon1.gdbinit                                 =
                      |      1 -
 head/contrib/tcpdump/tests/eapon1.out                                     =
                      |    114 -
 head/contrib/tcpdump/tests/eapon1.puu                                     =
                      |    368 -
 head/contrib/tcpdump/tests/eapon2.puu                                     =
                      |     66 -
 head/contrib/tcpdump/tests/esp-secrets.txt                                =
                      |      5 -
 head/contrib/tcpdump/tests/esp0.out                                       =
                      |      8 -
 head/contrib/tcpdump/tests/esp1.gdbinit                                   =
                      |      1 -
 head/contrib/tcpdump/tests/esp1.out                                       =
                      |      8 -
 head/contrib/tcpdump/tests/esp2.gdbinit                                   =
                      |      1 -
 head/contrib/tcpdump/tests/esp2.out                                       =
                      |      8 -
 head/contrib/tcpdump/tests/esp3.gdbinit                                   =
                      |      1 -
 head/contrib/tcpdump/tests/esp4.gdbinit                                   =
                      |      2 -
 head/contrib/tcpdump/tests/esp5.gdbinit                                   =
                      |      3 -
 head/contrib/tcpdump/tests/esp5.out                                       =
                      |      8 -
 head/contrib/tcpdump/tests/espudp1.out                                    =
                      |      8 -
 head/contrib/tcpdump/tests/espudp1.puu                                    =
                      |     35 -
 head/contrib/tcpdump/tests/forces1.out                                    =
                      |      8 -
 head/contrib/tcpdump/tests/forces1.pcap                                   =
                      |    Bin=20
 head/contrib/tcpdump/tests/forces1vvv.out                                 =
                      |     52 -
 head/contrib/tcpdump/tests/forces1vvvv.out                                =
                      |     67 -
 head/contrib/tcpdump/tests/forces2.out                                    =
                      |    491 -
 head/contrib/tcpdump/tests/forces2.pcap                                   =
                      |    Bin=20
 head/contrib/tcpdump/tests/forces2v.out                                   =
                      |    982 -
 head/contrib/tcpdump/tests/forces2vv.out                                  =
                      |   1966 -
 head/contrib/tcpdump/tests/ikev2.puu                                      =
                      |  22231 ----------
 head/contrib/tcpdump/tests/ikev2four.out                                  =
                      |    107 -
 head/contrib/tcpdump/tests/ikev2four.puu                                  =
                      |    134 -
 head/contrib/tcpdump/tests/ikev2fourv.out                                 =
                      |    107 -
 head/contrib/tcpdump/tests/ikev2fourv4.out                                =
                      |    107 -
 head/contrib/tcpdump/tests/ikev2pI2-secrets.txt                           =
                      |      2 -
 head/contrib/tcpdump/tests/ikev2pI2.out                                   =
                      |     41 -
 head/contrib/tcpdump/tests/ikev2pI2.puu                                   =
                      |     24 -
 head/contrib/tcpdump/tests/isakmp-delete-segfault.puu                     =
                      |     20 -
 head/contrib/tcpdump/tests/isakmp-identification-segfault.puu             =
                      |     11 -
 head/contrib/tcpdump/tests/isakmp-pointer-loop.puu                        =
                      |      6 -
 head/contrib/tcpdump/tests/isakmp1.out                                    =
                      |      1 -
 head/contrib/tcpdump/tests/isakmp2.out                                    =
                      |      1 -
 head/contrib/tcpdump/tests/isakmp3.out                                    =
                      |      3 -
 head/contrib/tcpdump/tests/isakmp4.out                                    =
                      |     35 -
 head/contrib/tcpdump/tests/isakmp4500.puu                                 =
                      |    155 -
 head/contrib/tcpdump/tests/isis-infinite-loop.pcap                        =
                      |    Bin=20
 head/contrib/tcpdump/tests/ldp-infinite-loop.pcap                         =
                      |    Bin=20
 head/contrib/tcpdump/tests/lmp.out                                        =
                      |     36 -
 head/contrib/tcpdump/tests/lmp.puu                                        =
                      |     42 -
 head/contrib/tcpdump/tests/lmp.sh                                         =
                      |     14 -
 head/contrib/tcpdump/tests/lspping-fec-ldp.pcap                           =
                      |    Bin=20
 head/contrib/tcpdump/tests/lspping-fec-rsvp.pcap                          =
                      |    Bin=20
 head/contrib/tcpdump/tests/mpls-ldp-hello.out                             =
                      |     10 -
 head/contrib/tcpdump/tests/mpls-ldp-hello.puu                             =
                      |      6 -
 head/contrib/tcpdump/tests/mpls-traceroute.pcap                           =
                      |    Bin=20
 head/contrib/tcpdump/tests/ospf-gmpls.out                                 =
                      |     86 -
 head/contrib/tcpdump/tests/ospf-gmpls.puu                                 =
                      |     18 -
 head/contrib/tcpdump/tests/print-A.out                                    =
                      |    193 -
 head/contrib/tcpdump/tests/print-AA.out                                   =
                      |    193 -
 head/contrib/tcpdump/tests/print-capX.out                                 =
                      |    409 -
 head/contrib/tcpdump/tests/print-capXX.out                                =
                      |    419 -
 head/contrib/tcpdump/tests/print-flags.puu                                =
                      |    151 -
 head/contrib/tcpdump/tests/print-flags.sh                                 =
                      |     12 -
 head/contrib/tcpdump/tests/print-x.out                                    =
                      |    409 -
 head/contrib/tcpdump/tests/print-xx.out                                   =
                      |    419 -
 head/contrib/tcpdump/tests/rsvp-infinite-loop.pcap                        =
                      |    Bin=20
 head/contrib/tcpdump/udp.h                                                =
                      |      2 +
 head/contrib/telnet/telnet/telnet.1                                       =
                      |      4 +-
 head/contrib/top/display.c                                                =
                      |     47 +-
 head/contrib/top/layout.h                                                 =
                      |      4 +-
 head/contrib/top/machine.h                                                =
                      |      4 +-
 head/contrib/top/top.c                                                    =
                      |      8 +-
 head/contrib/traceroute/traceroute.8                                      =
                      |    386 +-
 head/contrib/traceroute/traceroute.c                                      =
                      |      9 +-
 1031 files changed, 90674 insertions(+), 60827 deletions(-)

diffs (185644 lines):

diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/bind9/CHANGES
--- a/head/contrib/bind9/CHANGES	Wed Jul 25 16:20:13 2012 +0300
+++ b/head/contrib/bind9/CHANGES	Wed Jul 25 16:21:35 2012 +0300
@@ -1,3 +1,70 @@
+	--- 9.8.3-P2 released ---
+
+3346.	[security]	Bad-cache data could be used before it was
+			initialized, causing an assert. [RT #30025]
+
+3342.	[bug]		Change #3314 broke saving of stub zones to disk
+			resulting in excessive cpu usage in some cases.
+			[RT #29952]
+
+	--- 9.8.3-P1 released ---
+
+3331.	[security]	dns_rdataslab_fromrdataset could produce bad
+			rdataslabs. [RT #29644]
+		=09
+	--- 9.8.3 released ---
+
+3318.	[tuning]	Reduce the amount of work performed while holding a
+			bucket lock when finshed with a fetch context.
+			[RT #29239]
+
+3314.	[bug]		The masters list could be updated while refesh_callback
+			and stub_callback were using it. [RT #26732]
+
+3313.	[protocol]	Add TLSA record type. [RT #28989]
+
+3312.	[bug]		named-checkconf didn't detect a bad dns64 clients acl.
+			[RT #27631]
+
+3311.	[bug]		Abort the zone dump if zone->db is NULL in
+			zone.c:zone_gotwritehandle. [RT #29028]
+
+3310.	[test]		Increase table size for mutex profiling. [RT #28809]
+
+3309.	[bug]		resolver.c:fctx_finddone() was not threadsafe.
+			[RT #27995]
+
+3307.	[bug]		Add missing ISC_LANG_BEGINDECLS and ISC_LANG_ENDDECLS.
+			[RT #28956]
+
+3306.	[bug]		Improve DNS64 reverse zone performance. [RT #28563]
+
+3305.	[func]		Add wire format lookup method to sdb. [RT #28563]
+
+3304.	[bug]		Use hmctx, not mctx when freeing rbtdb->heaps.
+			[RT #28571]
+
+3302.	[bug]		dns_dnssec_findmatchingkeys could fail to find
+			keys if the zone name contained character that
+			required special mappings. [RT #28600]
+
+3301.	[contrib]	Update queryperf to build on darwin.  Add -R flag
+			for non-recursive queries. [RT #28565]
+
+3300.	[bug]		Named could die if gssapi was enabled in named.conf
+			but was not compiled in. [RT #28338]
+
+3299.	[bug]		Make SDB handle errors from database drivers better.
+			[RT #28534]
+
+3232.	[bug]		Zero zone->curmaster before return in
+			dns_zone_setmasterswithkeys(). [RT #26732]
+
+3183.	[bug]		Added RTLD_GLOBAL flag to dlopen call. [RT #26301]
+
+3197.	[bug]		Don't try to log the filename and line number when
+			the config parser can't open a file. [RT #22263]
+
 	--- 9.8.2 released ---
=20
 3298.	[bug]		Named could dereference a NULL pointer in
@@ -58,9 +125,9 @@
 3274.	[bug]		Log when a zone is not reusable.  Only set loadtime
 			on successful loads.  [RT #27650]
=20
-3273.   [bug]           AAAA responses could be returned in the additional
-                        section even when filter-aaaa-on-v4 was in use.
-                        [RT #27292]
+3273.	[bug]		AAAA responses could be returned in the additional
+			section even when filter-aaaa-on-v4 was in use.
+			[RT #27292]
=20
 3271.	[port]		darwin: mksymtbl is not always stable, loop several
 			times before giving up.  mksymtbl was using non
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/bind9/README
--- a/head/contrib/bind9/README	Wed Jul 25 16:20:13 2012 +0300
+++ b/head/contrib/bind9/README	Wed Jul 25 16:21:35 2012 +0300
@@ -51,6 +51,10 @@
         For up-to-date release notes and errata, see
         http://www.isc.org/software/bind9/releasenotes
=20
+BIND 9.8.3
+
+	BIND 9.8.3 is a maintenance release.
+
 BIND 9.8.2
=20
 	BIND 9.8.2 includes a number of bug fixes and prevents a security
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/bind9/bin/named/builtin.c
--- a/head/contrib/bind9/bin/named/builtin.c	Wed Jul 25 16:20:13 2012 +0300
+++ b/head/contrib/bind9/bin/named/builtin.c	Wed Jul 25 16:21:35 2012 +0300
@@ -69,35 +69,79 @@
 static builtin_t dns64_builtin =3D { do_dns64_lookup, NULL, NULL };
=20
 static dns_sdbimplementation_t *builtin_impl;
+static dns_sdbimplementation_t *dns64_impl;
=20
-static const char hex[] =3D "0123456789abcdef";
-static const char HEX[] =3D "0123456789ABCDEF";
+/*
+ * Pre computed HEX * 16 or 1 table.
+ */
+static const unsigned char hex16[256] =3D {
+	 1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1, /*00*/
+	 1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,	/*10*/
+	 1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1, /*20*/
+	 0, 16, 32, 48, 64, 80, 96,112,128,144,  1,  1,  1,  1,  1,  1,	/*30*/
+	 1,160,176,192,208,224,240,  1,  1,  1,  1,  1,  1,  1,  1,  1, /*40*/
+	 1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1, /*50*/
+	 1,160,176,192,208,224,240,  1,  1,  1,  1,  1,  1,  1,  1,  1, /*60*/
+	 1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1, /*70*/
+	 1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1, /*80*/
+	 1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1, /*90*/
+	 1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1, /*A0*/
+	 1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1, /*B0*/
+	 1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1, /*C0*/
+	 1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1, /*D0*/
+	 1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1, /*E0*/
+	 1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1  /*F0*/
+};
+
+const unsigned char decimal[] =3D "0123456789";
+
+static size_t
+dns64_rdata(unsigned char *v, size_t start, unsigned char *rdata) {
+	size_t i, j =3D 0;
+
+	for (i =3D 0; i < 4; i++) {
+		unsigned char c =3D v[start++];
+		if (start =3D=3D 7)
+			start++;
+		if (c > 99) {
+			rdata[j++] =3D 3;
+			rdata[j++] =3D decimal[c/100]; c =3D c % 100;
+			rdata[j++] =3D decimal[c/10]; c =3D c % 10;
+			rdata[j++] =3D decimal[c];
+		} else if (c > 9) {
+			rdata[j++] =3D 2;
+			rdata[j++] =3D decimal[c/10]; c =3D c % 10;
+			rdata[j++] =3D decimal[c];
+		} else {
+			rdata[j++] =3D 1;
+			rdata[j++] =3D decimal[c];
+		}
+	}
+	memcpy(&rdata[j], "\07in-addr\04arpa", 14);
+	return (j + 14);
+}
=20
 static isc_result_t
-dns64_cname(const char *zone, const char *name, dns_sdblookup_t *lookup) {
-	size_t zlen, nlen, j;
-	const char *s;
-	unsigned char v[16];
+dns64_cname(const dns_name_t *zone, const dns_name_t *name,
+	    dns_sdblookup_t *lookup)
+{
+	size_t zlen, nlen, j, len;
+	unsigned char v[16], n;
 	unsigned int i;
-	char reverse[sizeof("123.123.123.123.in-addr.arpa.")];
+	unsigned char rdata[sizeof("123.123.123.123.in-addr.arpa.")];
+	unsigned char *ndata;
=20
 	/*
-	 * The sum the length of the relative name and the length of the zone
-	 * name for a IPv6 reverse lookup comes to 71.
+	 * The combined length of the zone and name is 74.
 	 *
-	 * The reverse of 2001::10.0.0.1 (dns64 2001::/96) has a zone of
-	 * "0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.1.0.0.2.ip6.arpa"
-	 * and a name of "1.0.0.0.0.0.a.0".  The sum of the lengths of these
-	 * two strings is 71.
+	 * The minimum zone length is 10 ((3)ip6(4)arpa(0)).
 	 *
-	 * The minimum length for a ip6.arpa zone name is 8.
-	 *
-	 * The length of name should always be odd as we are expecting
+	 * The length of name should always be even as we are expecting
 	 * a series of nibbles.
 	 */
-	zlen =3D strlen(zone);
-	nlen =3D strlen(name);
-	if ((zlen + nlen) > 71U || zlen < 8U || (nlen % 2) !=3D 1U)
+	zlen =3D zone->length;
+	nlen =3D name->length;
+	if ((zlen + nlen) > 74U || zlen < 10U || (nlen % 2) !=3D 0U)
 		return (ISC_R_NOTFOUND);
=20
 	/*
@@ -116,25 +160,20 @@
 	 * are byte aligned and we correctly return ISC_R_NOTFOUND or
 	 * ISC_R_SUCCESS.  We will not generate a CNAME in this case.
 	 */
-	i =3D (nlen % 4) =3D=3D 1U ? 1 : 0;
+	ndata =3D name->ndata;
+	i =3D (nlen % 4) =3D=3D 2U ? 1 : 0;
 	j =3D nlen;
 	memset(v, 0, sizeof(v));
-	while (j >=3D 1U) {
+	while (j !=3D 0) {
 		INSIST((i/2) < sizeof(v));
-		if (j > 1U && name[1] !=3D '.')
+		if (ndata[0] !=3D 1)
 			return (ISC_R_NOTFOUND);
-		v[i/2] >>=3D 4;
-		if ((s =3D strchr(hex, name[0])) !=3D NULL)
-			v[i/2] |=3D (s - hex) << 4;
-		else if ((s =3D strchr(HEX, name[0])) !=3D NULL)
-			v[i/2] |=3D (s - HEX) << 4;
-		else
+		n =3D hex16[ndata[1]&0xff];
+		if (n =3D=3D 1)
 			return (ISC_R_NOTFOUND);
-		if (j > 1U)
-			j -=3D 2;
-		else
-			j -=3D 1;
-		name +=3D 2;
+		v[i/2] =3D n | (v[i/2]>>4);
+		j -=3D 2;
+		ndata +=3D 2;
 		i++;
 	}
=20
@@ -144,90 +183,91 @@
 	 * it corresponds to a empty node in the zone or there should be
 	 * a CNAME.
 	 */
+#define ZLEN(x) (10 + (x)/2)
 	switch (zlen) {
-	case 24:	/* prefix len 32 */
-		/*
-		 * If the total length is not 71 then this is a empty node
-		 * so return success.
-		 */
-		if (nlen + zlen !=3D 71U)
-			return (ISC_R_SUCCESS);
-		snprintf(reverse, sizeof(reverse), "%u.%u.%u.%u.in-addr.arpa.",
-			 v[8], v[9], v[10], v[11]);
-		break;
-	case 28:	/* prefix len 40 */
+	case ZLEN(32):	/* prefix len 32 */
 		/*
 		 * The nibbles that map to this byte must be zero for 'name'
 		 * to exist in the zone.
 		 */
-		if (nlen > 11U && v[nlen/4 - 3] !=3D 0)
+		if (nlen > 16U && v[(nlen-1)/4 - 4] !=3D 0)
 			return (ISC_R_NOTFOUND);
 		/*
-		 * If the total length is not 71 then this is a empty node
+		 * If the total length is not 74 then this is a empty node
 		 * so return success.
 		 */
-		if (nlen + zlen !=3D 71U)
+		if (nlen + zlen !=3D 74U)
 			return (ISC_R_SUCCESS);
-		snprintf(reverse, sizeof(reverse), "%u.%u.%u.%u.in-addr.arpa.",
-			 v[6], v[8], v[9], v[10]);
+		len =3D dns64_rdata(v, 8, rdata);
 		break;
-	case 32:	/* prefix len 48 */
+	case ZLEN(40):	/* prefix len 40 */
 		/*
 		 * The nibbles that map to this byte must be zero for 'name'
 		 * to exist in the zone.
 		 */
-		if (nlen > 7U && v[nlen/4 - 2] !=3D 0)
+		if (nlen > 12U && v[(nlen-1)/4 - 3] !=3D 0)
 			return (ISC_R_NOTFOUND);
 		/*
-		 * If the total length is not 71 then this is a empty node
+		 * If the total length is not 74 then this is a empty node
 		 * so return success.
 		 */
-		if (nlen + zlen !=3D 71U)
+		if (nlen + zlen !=3D 74U)
 			return (ISC_R_SUCCESS);
-		snprintf(reverse, sizeof(reverse), "%u.%u.%u.%u.in-addr.arpa.",
-			 v[5], v[6], v[8], v[9]);
+		len =3D dns64_rdata(v, 6, rdata);
 		break;
-	case 36:	/* prefix len 56 */
+	case ZLEN(48):	/* prefix len 48 */
 		/*
 		 * The nibbles that map to this byte must be zero for 'name'
 		 * to exist in the zone.
 		 */
-		if (nlen > 3U && v[nlen/4 - 1] !=3D 0)
+		if (nlen > 8U && v[(nlen-1)/4 - 2] !=3D 0)
 			return (ISC_R_NOTFOUND);
 		/*
-		 * If the total length is not 71 then this is a empty node
+		 * If the total length is not 74 then this is a empty node
 		 * so return success.
 		 */
-		if (nlen + zlen !=3D 71U)
+		if (nlen + zlen !=3D 74U)
 			return (ISC_R_SUCCESS);
-		snprintf(reverse, sizeof(reverse), "%u.%u.%u.%u.in-addr.arpa.",
-			 v[4], v[5], v[6], v[8]);
+		len =3D dns64_rdata(v, 5, rdata);
 		break;
-	case 40:	/* prefix len 64 */
+	case ZLEN(56):	/* prefix len 56 */
 		/*
 		 * The nibbles that map to this byte must be zero for 'name'
 		 * to exist in the zone.
 		 */
-		if (v[nlen/4] !=3D 0)
+		if (nlen > 4U && v[(nlen-1)/4 - 1] !=3D 0)
 			return (ISC_R_NOTFOUND);
 		/*
-		 * If the total length is not 71 then this is a empty node
+		 * If the total length is not 74 then this is a empty node
 		 * so return success.
 		 */
-		if (nlen + zlen !=3D 71U)
+		if (nlen + zlen !=3D 74U)
 			return (ISC_R_SUCCESS);
-		snprintf(reverse, sizeof(reverse), "%u.%u.%u.%u.in-addr.arpa.",
-			 v[3], v[4], v[5], v[6]);
+		len =3D dns64_rdata(v, 4, rdata);
 		break;
-	case 56:	/* prefix len 96 */
+	case ZLEN(64):	/* prefix len 64 */
 		/*
-		 * If the total length is not 71 then this is a empty node
+		 * The nibbles that map to this byte must be zero for 'name'
+		 * to exist in the zone.
+		 */
+		if (v[(nlen-1)/4] !=3D 0)
+			return (ISC_R_NOTFOUND);
+		/*
+		 * If the total length is not 74 then this is a empty node
 		 * so return success.
 		 */
-		if (nlen + zlen !=3D 71U)
+		if (nlen + zlen !=3D 74U)
 			return (ISC_R_SUCCESS);
-		snprintf(reverse, sizeof(reverse), "%u.%u.%u.%u.in-addr.arpa.",
-			 v[0], v[1], v[2], v[3]);
+		len =3D dns64_rdata(v, 3, rdata);
+		break;
+	case ZLEN(96):	/* prefix len 96 */
+		/*
+		 * If the total length is not 74 then this is a empty node
+		 * so return success.
+		 */
+		if (nlen + zlen !=3D 74U)
+			return (ISC_R_SUCCESS);
+		len =3D dns64_rdata(v, 0, rdata);
 		break;
 	default:
 		/*
@@ -236,7 +276,7 @@
 		 */
 		return (ISC_R_NOTFOUND);
 	}
-	return (dns_sdb_putrr(lookup, "CNAME", 600, reverse));
+	return (dns_sdb_putrdata(lookup, dns_rdatatype_cname, 600, rdata, len));
 }
=20
 static isc_result_t
@@ -249,13 +289,23 @@
=20
 	if (strcmp(name, "@") =3D=3D 0)
 		return (b->do_lookup(lookup));
-	else if (b->do_lookup =3D=3D do_dns64_lookup)
-		return (dns64_cname(zone, name, lookup));
 	else
 		return (ISC_R_NOTFOUND);
 }
=20
 static isc_result_t
+dns64_lookup(const dns_name_t *zone, const dns_name_t *name, void *dbdata,
+	     dns_sdblookup_t *lookup)
+{
+	builtin_t *b =3D (builtin_t *) dbdata;
+
+	if (name->labels =3D=3D 0 && name->length =3D=3D 0)
+		return (b->do_lookup(lookup));
+	else
+		return (dns64_cname(zone, name, lookup));
+}
+
+static isc_result_t
 put_txt(dns_sdblookup_t *lookup, const char *text) {
 	unsigned char buf[256];
 	unsigned int len =3D strlen(text);
@@ -481,7 +531,17 @@
 	builtin_authority,
 	NULL,		/* allnodes */
 	builtin_create,
-	builtin_destroy
+	builtin_destroy,
+	NULL
+};
+
+static dns_sdbmethods_t dns64_methods =3D {
+	NULL,
+	builtin_authority,
+	NULL,		/* allnodes */
+	builtin_create,
+	builtin_destroy,
+	dns64_lookup,
 };
=20
 isc_result_t
@@ -491,11 +551,17 @@
 				       DNS_SDBFLAG_RELATIVERDATA,
 				       ns_g_mctx, &builtin_impl)
 		      =3D=3D ISC_R_SUCCESS);
+	RUNTIME_CHECK(dns_sdb_register("_dns64", &dns64_methods, NULL,
+				       DNS_SDBFLAG_RELATIVEOWNER |
+				       DNS_SDBFLAG_RELATIVERDATA |
+				       DNS_SDBFLAG_DNS64,
+				       ns_g_mctx, &dns64_impl)
+		      =3D=3D ISC_R_SUCCESS);
 	return (ISC_R_SUCCESS);
 }
=20
 void
 ns_builtin_deinit(void) {
 	dns_sdb_unregister(&builtin_impl);
+	dns_sdb_unregister(&dns64_impl);
 }
-
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/bind9/bin/named/query.c
--- a/head/contrib/bind9/bin/named/query.c	Wed Jul 25 16:20:13 2012 +0300
+++ b/head/contrib/bind9/bin/named/query.c	Wed Jul 25 16:21:35 2012 +0300
@@ -3354,6 +3354,11 @@
 		dns_name_copy(name, cname, NULL);
 		while (result =3D=3D DNS_R_NXDOMAIN) {
 			labels =3D dns_name_countlabels(cname) - 1;
+			/*
+			 * Sanity check.
+			 */
+			if (labels =3D=3D 0U)
+				goto cleanup;
 			dns_name_split(cname, labels, NULL, cname);
 			result =3D dns_db_find(db, cname, version,
 					     dns_rdatatype_nsec,
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/bind9/bin/named/server.c
--- a/head/contrib/bind9/bin/named/server.c	Wed Jul 25 16:20:13 2012 +0300
+++ b/head/contrib/bind9/bin/named/server.c	Wed Jul 25 16:21:35 2012 +0300
@@ -1358,7 +1358,7 @@
 {
 	char *cp;
 	char reverse[48+sizeof("ip6.arpa.")];
-	const char *dns64_dbtype[4] =3D { "_builtin", "dns64", ".", "." };
+	const char *dns64_dbtype[4] =3D { "_dns64", "dns64", ".", "." };
 	const char *sep =3D ": view ";
 	const char *viewname =3D view->name;
 	const unsigned char *s6;
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/bind9/bin/named/unix/dlz_=
dlopen_driver.c
--- a/head/contrib/bind9/bin/named/unix/dlz_dlopen_driver.c	Wed Jul 25 16:2=
0:13 2012 +0300
+++ b/head/contrib/bind9/bin/named/unix/dlz_dlopen_driver.c	Wed Jul 25 16:2=
1:35 2012 +0300
@@ -250,7 +250,7 @@
 	isc_mutex_init(&cd->lock);
=20
 	/* Open the library */
-	dlopen_flags =3D RTLD_NOW;
+	dlopen_flags =3D RTLD_NOW|RTLD_GLOBAL;
=20
 #ifdef RTLD_DEEPBIND
 	/*
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/bind9/lib/bind9/api
--- a/head/contrib/bind9/lib/bind9/api	Wed Jul 25 16:20:13 2012 +0300
+++ b/head/contrib/bind9/lib/bind9/api	Wed Jul 25 16:21:35 2012 +0300
@@ -4,5 +4,5 @@
 # 9.8: 80-89
 # 9.9: 90-109
 LIBINTERFACE =3D 80
-LIBREVISION =3D 4
+LIBREVISION =3D 5
 LIBAGE =3D 0
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/bind9/lib/bind9/check.c
--- a/head/contrib/bind9/lib/bind9/check.c	Wed Jul 25 16:20:13 2012 +0300
+++ b/head/contrib/bind9/lib/bind9/check.c	Wed Jul 25 16:21:35 2012 +0300
@@ -434,7 +434,7 @@
 	int nbytes;
 	int i;
=20
-	static const char *acls[] =3D { "client", "exclude", "mapped", NULL};
+	static const char *acls[] =3D { "clients", "exclude", "mapped", NULL};
=20
 	if (voptions !=3D NULL)
 		cfg_map_get(voptions, "dns64", &dns64);
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/bind9/lib/dns/api
--- a/head/contrib/bind9/lib/dns/api	Wed Jul 25 16:20:13 2012 +0300
+++ b/head/contrib/bind9/lib/dns/api	Wed Jul 25 16:21:35 2012 +0300
@@ -4,5 +4,5 @@
 # 9.8: 80-89
 # 9.9: 90-109
 LIBINTERFACE =3D 87
-LIBREVISION =3D 0
+LIBREVISION =3D 1
 LIBAGE =3D 6
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/bind9/lib/dns/dnssec.c
--- a/head/contrib/bind9/lib/dns/dnssec.c	Wed Jul 25 16:20:13 2012 +0300
+++ b/head/contrib/bind9/lib/dns/dnssec.c	Wed Jul 25 16:21:35 2012 +0300
@@ -1246,7 +1246,7 @@
 	isc_dir_init(&dir);
=20
 	isc_buffer_init(&b, namebuf, sizeof(namebuf) - 1);
-	RETERR(dns_name_totext(origin, ISC_FALSE, &b));
+	RETERR(dns_name_tofilenametext(origin, ISC_FALSE, &b));
 	len =3D isc_buffer_usedlength(&b);
 	namebuf[len] =3D '\0';
=20
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/bind9/lib/dns/include/dns=
/ecdb.h
--- a/head/contrib/bind9/lib/dns/include/dns/ecdb.h	Wed Jul 25 16:20:13 201=
2 +0300
+++ b/head/contrib/bind9/lib/dns/include/dns/ecdb.h	Wed Jul 25 16:21:35 201=
2 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2009  Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2009, 2012  Internet Systems Consortium, Inc. ("ISC")
  *
  * Permission to use, copy, modify, and/or distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
@@ -39,6 +39,8 @@
  *** Functions
  ***/
=20
+ISC_LANG_BEGINDECLS
+
 /* TBD: describe those */
=20
 isc_result_t
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/bind9/lib/dns/include/dns=
/rpz.h
--- a/head/contrib/bind9/lib/dns/include/dns/rpz.h	Wed Jul 25 16:20:13 2012=
 +0300
+++ b/head/contrib/bind9/lib/dns/include/dns/rpz.h	Wed Jul 25 16:21:35 2012=
 +0300
@@ -194,5 +194,7 @@
 dns_rpz_policy_t
 dns_rpz_decode_cname(dns_rdataset_t *, dns_name_t *selfname);
=20
+ISC_LANG_ENDDECLS
+
 #endif /* DNS_RPZ_H */
=20
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/bind9/lib/dns/include/dns=
/sdb.h
--- a/head/contrib/bind9/lib/dns/include/dns/sdb.h	Wed Jul 25 16:20:13 2012=
 +0300
+++ b/head/contrib/bind9/lib/dns/include/dns/sdb.h	Wed Jul 25 16:21:35 2012=
 +0300
@@ -59,6 +59,9 @@
 typedef isc_result_t
 (*dns_sdblookupfunc_t)(const char *zone, const char *name, void *dbdata,
 		       dns_sdblookup_t *);
+typedef isc_result_t
+(*dns_sdblookup2func_t)(const dns_name_t *zone, const dns_name_t *name,
+			void *dbdata, dns_sdblookup_t *lookup);
=20
 typedef isc_result_t
 (*dns_sdbauthorityfunc_t)(const char *zone, void *dbdata, dns_sdblookup_t =
*);
@@ -81,6 +84,7 @@
 	dns_sdballnodesfunc_t	allnodes;
 	dns_sdbcreatefunc_t	create;
 	dns_sdbdestroyfunc_t	destroy;
+	dns_sdblookup2func_t	lookup2;
 } dns_sdbmethods_t;
=20
 /***
@@ -92,6 +96,7 @@
 #define DNS_SDBFLAG_RELATIVEOWNER 0x00000001U
 #define DNS_SDBFLAG_RELATIVERDATA 0x00000002U
 #define DNS_SDBFLAG_THREADSAFE 0x00000004U
+#define DNS_SDBFLAG_DNS64 0x00000008U
=20
 isc_result_t
 dns_sdb_register(const char *drivername, const dns_sdbmethods_t *methods,
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/bind9/lib/dns/include/dns=
/stats.h
--- a/head/contrib/bind9/lib/dns/include/dns/stats.h	Wed Jul 25 16:20:13 20=
12 +0300
+++ b/head/contrib/bind9/lib/dns/include/dns/stats.h	Wed Jul 25 16:21:35 20=
12 +0300
@@ -147,6 +147,8 @@
 					    void *);
 typedef void (*dns_opcodestats_dumper_t)(dns_opcode_t, isc_uint64_t, void =
*);
=20
+ISC_LANG_BEGINDECLS
+
 isc_result_t
 dns_generalstats_create(isc_mem_t *mctx, dns_stats_t **statsp, int ncounte=
rs);
 /*%<
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/bind9/lib/dns/include/dns=
/tsec.h
--- a/head/contrib/bind9/lib/dns/include/dns/tsec.h	Wed Jul 25 16:20:13 201=
2 +0300
+++ b/head/contrib/bind9/lib/dns/include/dns/tsec.h	Wed Jul 25 16:21:35 201=
2 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2009, 2010  Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2009, 2010, 2012  Internet Systems Consortium, Inc. ("ISC=
")
  *
  * Permission to use, copy, modify, and/or distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
@@ -132,4 +132,6 @@
  *\li	*tsecp points to a valid key structure depending on the TSEC type.
  */
=20
+ISC_LANG_ENDDECLS
+
 #endif /* DNS_TSEC_H */
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/bind9/lib/dns/include/dns=
/view.h
--- a/head/contrib/bind9/lib/dns/include/dns/view.h	Wed Jul 25 16:20:13 201=
2 +0300
+++ b/head/contrib/bind9/lib/dns/include/dns/view.h	Wed Jul 25 16:21:35 201=
2 +0300
@@ -1075,4 +1075,6 @@
 void
 dns_view_restorekeyring(dns_view_t *view);
=20
+ISC_LANG_ENDDECLS
+
 #endif /* DNS_VIEW_H */
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/bind9/lib/dns/rbtdb.c
--- a/head/contrib/bind9/lib/dns/rbtdb.c	Wed Jul 25 16:20:13 2012 +0300
+++ b/head/contrib/bind9/lib/dns/rbtdb.c	Wed Jul 25 16:21:35 2012 +0300
@@ -7814,7 +7814,7 @@
 		for (i =3D 0 ; i < (int)rbtdb->node_lock_count ; i++)
 			if (rbtdb->heaps[i] !=3D NULL)
 				isc_heap_destroy(&rbtdb->heaps[i]);
-		isc_mem_put(mctx, rbtdb->heaps,
+		isc_mem_put(hmctx, rbtdb->heaps,
 			    rbtdb->node_lock_count * sizeof(isc_heap_t *));
 	}
=20
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/bind9/lib/dns/rdata.c
--- a/head/contrib/bind9/lib/dns/rdata.c	Wed Jul 25 16:20:13 2012 +0300
+++ b/head/contrib/bind9/lib/dns/rdata.c	Wed Jul 25 16:21:35 2012 +0300
@@ -329,8 +329,8 @@
=20
 	REQUIRE(rdata1 !=3D NULL);
 	REQUIRE(rdata2 !=3D NULL);
-	REQUIRE(rdata1->data !=3D NULL);
-	REQUIRE(rdata2->data !=3D NULL);
+	REQUIRE(rdata1->length =3D=3D 0 || rdata1->data !=3D NULL);
+	REQUIRE(rdata2->length =3D=3D 0 || rdata2->data !=3D NULL);
 	REQUIRE(DNS_RDATA_VALIDFLAGS(rdata1));
 	REQUIRE(DNS_RDATA_VALIDFLAGS(rdata2));
=20
@@ -360,8 +360,8 @@
=20
 	REQUIRE(rdata1 !=3D NULL);
 	REQUIRE(rdata2 !=3D NULL);
-	REQUIRE(rdata1->data !=3D NULL);
-	REQUIRE(rdata2->data !=3D NULL);
+	REQUIRE(rdata1->length =3D=3D 0 || rdata1->data !=3D NULL);
+	REQUIRE(rdata2->length =3D=3D 0 || rdata2->data !=3D NULL);
 	REQUIRE(DNS_RDATA_VALIDFLAGS(rdata1));
 	REQUIRE(DNS_RDATA_VALIDFLAGS(rdata2));
=20
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/bind9/lib/dns/rdata/gener=
ic/tlsa_52.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/bind9/lib/dns/rdata/generic/tlsa_52.c	Wed Jul 25 16:21:3=
5 2012 +0300
@@ -0,0 +1,290 @@
+/*
+ * Copyright (C) 2012  Internet Systems Consortium, Inc. ("ISC")
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABI=
LITY
+ * AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING =
FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGE=
NCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE =
OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id$ */
+
+/* draft-ietf-dane-protocol-19.txt */
+
+#ifndef RDATA_GENERIC_TLSA_52_C
+#define RDATA_GENERIC_TLSA_52_C
+
+#define RRTYPE_TLSA_ATTRIBUTES 0
+
+static inline isc_result_t
+fromtext_tlsa(ARGS_FROMTEXT) {
+	isc_token_t token;
+
+	REQUIRE(type =3D=3D 52);
+
+	UNUSED(type);
+	UNUSED(rdclass);
+	UNUSED(origin);
+	UNUSED(options);
+	UNUSED(callbacks);
+
+	/*
+	 * Certificate Usage.
+	 */
+	RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number,
+				      ISC_FALSE));
+	if (token.value.as_ulong > 0xffU)
+		RETTOK(ISC_R_RANGE);
+	RETERR(uint8_tobuffer(token.value.as_ulong, target));
+
+	/*
+	 * Selector.
+	 */
+	RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number,
+				      ISC_FALSE));
+	if (token.value.as_ulong > 0xffU)
+		RETTOK(ISC_R_RANGE);
+	RETERR(uint8_tobuffer(token.value.as_ulong, target));
+
+	/*
+	 * Matching type.
+	 */
+	RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number,
+				      ISC_FALSE));
+	if (token.value.as_ulong > 0xffU)
+		RETTOK(ISC_R_RANGE);
+	RETERR(uint8_tobuffer(token.value.as_ulong, target));
+
+	/*
+	 * Certificate Association Data.
+	 */
+	return (isc_hex_tobuffer(lexer, target, -1));
+}
+
+static inline isc_result_t
+totext_tlsa(ARGS_TOTEXT) {
+	isc_region_t sr;
+	char buf[sizeof("64000 ")];
+	unsigned int n;
+
+	REQUIRE(rdata->type =3D=3D 52);
+	REQUIRE(rdata->length !=3D 0);
+
+	UNUSED(tctx);
+
+	dns_rdata_toregion(rdata, &sr);
+
+	/*
+	 * Certificate Usage.
+	 */
+	n =3D uint8_fromregion(&sr);
+	isc_region_consume(&sr, 1);
+	sprintf(buf, "%u ", n);
+	RETERR(str_totext(buf, target));
+
+	/*
+	 * Selector.
+	 */
+	n =3D uint8_fromregion(&sr);
+	isc_region_consume(&sr, 1);
+	sprintf(buf, "%u ", n);
+	RETERR(str_totext(buf, target));
+
+	/*
+	 * Matching type.
+	 */
+	n =3D uint8_fromregion(&sr);
+	isc_region_consume(&sr, 1);
+	sprintf(buf, "%u", n);
+	RETERR(str_totext(buf, target));
+
+	/*
+	 * Certificate Association Data.
+	 */
+	if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) !=3D 0)
+		RETERR(str_totext(" (", target));
+	RETERR(str_totext(tctx->linebreak, target));
+	if (tctx->width =3D=3D 0) /* No splitting */
+		RETERR(isc_hex_totext(&sr, 0, "", target));
+	else
+		RETERR(isc_hex_totext(&sr, tctx->width - 2,
+				      tctx->linebreak, target));
+	if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) !=3D 0)
+		RETERR(str_totext(" )", target));
+	return (ISC_R_SUCCESS);
+}
+
+static inline isc_result_t
+fromwire_tlsa(ARGS_FROMWIRE) {
+	isc_region_t sr;
+
+	REQUIRE(type =3D=3D 52);
+
+	UNUSED(type);
+	UNUSED(rdclass);
+	UNUSED(dctx);
+	UNUSED(options);
+
+	isc_buffer_activeregion(source, &sr);
+
+	if (sr.length < 3)
+		return (ISC_R_UNEXPECTEDEND);
+
+	isc_buffer_forward(source, sr.length);
+	return (mem_tobuffer(target, sr.base, sr.length));
+}
+
+static inline isc_result_t
+towire_tlsa(ARGS_TOWIRE) {
+	isc_region_t sr;
+
+	REQUIRE(rdata->type =3D=3D 52);
+	REQUIRE(rdata->length !=3D 0);
+
+	UNUSED(cctx);
+
+	dns_rdata_toregion(rdata, &sr);
+	return (mem_tobuffer(target, sr.base, sr.length));
+}
+
+static inline int
+compare_tlsa(ARGS_COMPARE) {
+	isc_region_t r1;
+	isc_region_t r2;
+
+	REQUIRE(rdata1->type =3D=3D rdata2->type);
+	REQUIRE(rdata1->rdclass =3D=3D rdata2->rdclass);
+	REQUIRE(rdata1->type =3D=3D 52);
+	REQUIRE(rdata1->length !=3D 0);
+	REQUIRE(rdata2->length !=3D 0);
+
+	dns_rdata_toregion(rdata1, &r1);
+	dns_rdata_toregion(rdata2, &r2);
+	return (isc_region_compare(&r1, &r2));
+}
+
+static inline isc_result_t
+fromstruct_tlsa(ARGS_FROMSTRUCT) {
+	dns_rdata_tlsa_t *tlsa =3D source;
+
+	REQUIRE(type =3D=3D 52);
+	REQUIRE(source !=3D NULL);
+	REQUIRE(tlsa->common.rdtype =3D=3D type);
+	REQUIRE(tlsa->common.rdclass =3D=3D rdclass);
+
+	UNUSED(type);
+	UNUSED(rdclass);
+
+	RETERR(uint8_tobuffer(tlsa->usage, target));
+	RETERR(uint8_tobuffer(tlsa->selector, target));
+	RETERR(uint8_tobuffer(tlsa->match, target));
+
+	return (mem_tobuffer(target, tlsa->data, tlsa->length));
+}
+
+static inline isc_result_t
+tostruct_tlsa(ARGS_TOSTRUCT) {
+	dns_rdata_tlsa_t *tlsa =3D target;
+	isc_region_t region;
+
+	REQUIRE(rdata->type =3D=3D 52);
+	REQUIRE(target !=3D NULL);
+	REQUIRE(rdata->length !=3D 0);
+
+	tlsa->common.rdclass =3D rdata->rdclass;
+	tlsa->common.rdtype =3D rdata->type;
+	ISC_LINK_INIT(&tlsa->common, link);
+
+	dns_rdata_toregion(rdata, &region);
+
+	tlsa->usage =3D uint8_fromregion(&region);
+	isc_region_consume(&region, 1);
+	tlsa->selector =3D uint8_fromregion(&region);
+	isc_region_consume(&region, 1);
+	tlsa->match =3D uint8_fromregion(&region);
+	isc_region_consume(&region, 1);
+	tlsa->length =3D region.length;
+
+	tlsa->data =3D mem_maybedup(mctx, region.base, region.length);
+	if (tlsa->data =3D=3D NULL)
+		return (ISC_R_NOMEMORY);
+
+	tlsa->mctx =3D mctx;
+	return (ISC_R_SUCCESS);
+}
+
+static inline void
+freestruct_tlsa(ARGS_FREESTRUCT) {
+	dns_rdata_tlsa_t *tlsa =3D source;
+
+	REQUIRE(tlsa !=3D NULL);
+	REQUIRE(tlsa->common.rdtype =3D=3D 52);
+
+	if (tlsa->mctx =3D=3D NULL)
+		return;
+
+	if (tlsa->data !=3D NULL)
+		isc_mem_free(tlsa->mctx, tlsa->data);
+	tlsa->mctx =3D NULL;
+}
+
+static inline isc_result_t
+additionaldata_tlsa(ARGS_ADDLDATA) {
+	REQUIRE(rdata->type =3D=3D 52);
+
+	UNUSED(rdata);
+	UNUSED(add);
+	UNUSED(arg);
+
+	return (ISC_R_SUCCESS);
+}
+
+static inline isc_result_t
+digest_tlsa(ARGS_DIGEST) {
+	isc_region_t r;
+
+	REQUIRE(rdata->type =3D=3D 52);
+
+	dns_rdata_toregion(rdata, &r);
+
+	return ((digest)(arg, &r));
+}
+
+static inline isc_boolean_t
+checkowner_tlsa(ARGS_CHECKOWNER) {
+
+	REQUIRE(type =3D=3D 52);
+
+	UNUSED(name);
+	UNUSED(type);
+	UNUSED(rdclass);
+	UNUSED(wildcard);
+
+	return (ISC_TRUE);
+}
+
+static inline isc_boolean_t
+checknames_tlsa(ARGS_CHECKNAMES) {
+
+	REQUIRE(rdata->type =3D=3D 52);
+
+	UNUSED(rdata);
+	UNUSED(owner);
+	UNUSED(bad);
+
+	return (ISC_TRUE);
+}
+
+static inline int
+casecompare_tlsa(ARGS_COMPARE) {
+	return (compare_tlsa(rdata1, rdata2));
+}
+
+#endif	/* RDATA_GENERIC_TLSA_52_C */
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/bind9/lib/dns/rdata/gener=
ic/tlsa_52.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/bind9/lib/dns/rdata/generic/tlsa_52.h	Wed Jul 25 16:21:3=
5 2012 +0300
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2012  Internet Systems Consortium, Inc. ("ISC")
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABI=
LITY
+ * AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING =
FROM
+ * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGE=
NCE
+ * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE =
OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* $Id$ */
+
+#ifndef GENERIC_TLSA_52_H
+#define GENERIC_TLSA_52_H 1
+
+/*!
+ *  \brief per draft-ietf-dane-protocol-19.txt
+ */
+typedef struct dns_rdata_tlsa {
+	dns_rdatacommon_t	common;
+	isc_mem_t		*mctx;
+	isc_uint8_t		usage;
+	isc_uint8_t		selector;
+	isc_uint8_t		match;
+	isc_uint16_t		length;
+	unsigned char		*data;
+} dns_rdata_tlsa_t;
+
+#endif /* GENERIC_TLSA_52_H */
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/bind9/lib/dns/rdataslab.c
--- a/head/contrib/bind9/lib/dns/rdataslab.c	Wed Jul 25 16:20:13 2012 +0300
+++ b/head/contrib/bind9/lib/dns/rdataslab.c	Wed Jul 25 16:21:35 2012 +0300
@@ -126,6 +126,11 @@
 dns_rdataslab_fromrdataset(dns_rdataset_t *rdataset, isc_mem_t *mctx,
 			   isc_region_t *region, unsigned int reservelen)
 {
+	/*
+	 * Use &removed as a sentinal pointer for duplicate
+	 * rdata as rdata.data =3D=3D NULL is valid.
+	 */
+	static unsigned char removed;
 	struct xrdata  *x;
 	unsigned char  *rawbuf;
 #if DNS_RDATASET_FIXED
@@ -169,6 +174,7 @@
 		INSIST(result =3D=3D ISC_R_SUCCESS);
 		dns_rdata_init(&x[i].rdata);
 		dns_rdataset_current(rdataset, &x[i].rdata);
+		INSIST(x[i].rdata.data !=3D &removed);
 #if DNS_RDATASET_FIXED
 		x[i].order =3D i;
 #endif
@@ -201,8 +207,7 @@
 	 */
 	for (i =3D 1; i < nalloc; i++) {
 		if (compare_rdata(&x[i-1].rdata, &x[i].rdata) =3D=3D 0) {
-			x[i-1].rdata.data =3D NULL;
-			x[i-1].rdata.length =3D 0;
+			x[i-1].rdata.data =3D &removed;
 #if DNS_RDATASET_FIXED
 			/*
 			 * Preserve the least order so A, B, A -> A, B
@@ -292,7 +297,7 @@
 #endif
=20
 	for (i =3D 0; i < nalloc; i++) {
-		if (x[i].rdata.data =3D=3D NULL)
+		if (x[i].rdata.data =3D=3D &removed)
 			continue;
 #if DNS_RDATASET_FIXED
 		offsettable[x[i].order] =3D rawbuf - offsetbase;
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/bind9/lib/dns/resolver.c
--- a/head/contrib/bind9/lib/dns/resolver.c	Wed Jul 25 16:20:13 2012 +0300
+++ b/head/contrib/bind9/lib/dns/resolver.c	Wed Jul 25 16:21:35 2012 +0300
@@ -180,7 +180,9 @@
 	dns_rdatatype_t			type;
 	unsigned int			options;
 	unsigned int			bucketnum;
-	char *			info;
+	char *				info;
+	isc_mem_t *			mctx;
+
 	/*% Locked by appropriate bucket lock. */
 	fetchstate			state;
 	isc_boolean_t			want_shutdown;
@@ -446,7 +448,8 @@
 static void resquery_connected(isc_task_t *task, isc_event_t *event);
 static void fctx_try(fetchctx_t *fctx, isc_boolean_t retrying,
 		     isc_boolean_t badcache);
-static isc_boolean_t fctx_destroy(fetchctx_t *fctx);
+static void fctx_destroy(fetchctx_t *fctx);
+static isc_boolean_t fctx_unlink(fetchctx_t *fctx);
 static isc_result_t ncache_adderesult(dns_message_t *message,
 				      dns_db_t *cache, dns_dbnode_t *node,
 				      dns_rdatatype_t covers,
@@ -478,8 +481,7 @@
 	dns_valarg_t *valarg;
 	isc_result_t result;
=20
-	valarg =3D isc_mem_get(fctx->res->buckets[fctx->bucketnum].mctx,
-			     sizeof(*valarg));
+	valarg =3D isc_mem_get(fctx->mctx, sizeof(*valarg));
 	if (valarg =3D=3D NULL)
 		return (ISC_R_NOMEMORY);
=20
@@ -501,8 +503,7 @@
 		}
 		ISC_LIST_APPEND(fctx->validators, validator, link);
 	} else
-		isc_mem_put(fctx->res->buckets[fctx->bucketnum].mctx,
-			    valarg, sizeof(*valarg));
+		isc_mem_put(fctx->mctx, valarg, sizeof(*valarg));
 	return (result);
 }
=20
@@ -1386,13 +1387,12 @@
=20
 	dns_message_reset(fctx->rmessage, DNS_MESSAGE_INTENTPARSE);
=20
-	query =3D isc_mem_get(res->buckets[fctx->bucketnum].mctx,
-			    sizeof(*query));
+	query =3D isc_mem_get(fctx->mctx, sizeof(*query));
 	if (query =3D=3D NULL) {
 		result =3D ISC_R_NOMEMORY;
 		goto stop_idle_timer;
 	}
-	query->mctx =3D res->buckets[fctx->bucketnum].mctx;
+	query->mctx =3D fctx->mctx;
 	query->options =3D options;
 	query->attributes =3D 0;
 	query->sends =3D 0;
@@ -1569,8 +1569,7 @@
  cleanup_query:
 	if (query->connects =3D=3D 0) {
 		query->magic =3D 0;
-		isc_mem_put(res->buckets[fctx->bucketnum].mctx,
-			    query, sizeof(*query));
+		isc_mem_put(fctx->mctx, query, sizeof(*query));
 	}
=20
  stop_idle_timer:
@@ -1600,8 +1599,7 @@
 	if (bad_edns(fctx, address))
 		return;
=20
-	sa =3D isc_mem_get(fctx->res->buckets[fctx->bucketnum].mctx,
-			 sizeof(*sa));
+	sa =3D isc_mem_get(fctx->mctx, sizeof(*sa));
 	if (sa =3D=3D NULL)
 		return;
=20
@@ -1630,8 +1628,7 @@
 	if (triededns(fctx, address))
 		return;
=20
-	sa =3D isc_mem_get(fctx->res->buckets[fctx->bucketnum].mctx,
-			 sizeof(*sa));
+	sa =3D isc_mem_get(fctx->mctx, sizeof(*sa));
 	if (sa =3D=3D NULL)
 		return;
=20
@@ -1660,8 +1657,7 @@
 	if (triededns512(fctx, address))
 		return;
=20
-	sa =3D isc_mem_get(fctx->res->buckets[fctx->bucketnum].mctx,
-			 sizeof(*sa));
+	sa =3D isc_mem_get(fctx->mctx, sizeof(*sa));
 	if (sa =3D=3D NULL)
 		return;
=20
@@ -2166,8 +2162,8 @@
 	isc_boolean_t want_try =3D ISC_FALSE;
 	isc_boolean_t want_done =3D ISC_FALSE;
 	isc_boolean_t bucket_empty =3D ISC_FALSE;
+	unsigned int bucketnum;
 	isc_boolean_t destroy =3D ISC_FALSE;
-	unsigned int bucketnum;
=20
 	find =3D event->ev_sender;
 	fctx =3D event->ev_arg;
@@ -2205,17 +2201,14 @@
 		}
 	} else if (SHUTTINGDOWN(fctx) && fctx->pending =3D=3D 0 &&
 		   fctx->nqueries =3D=3D 0 && ISC_LIST_EMPTY(fctx->validators)) {
-		/*
-		 * Note that we had to wait until we had the lock before
-		 * looking at fctx->references.
-		 */
-		if (fctx->references =3D=3D 0)
+
+		if (fctx->references =3D=3D 0) {
+			bucket_empty =3D fctx_unlink(fctx);
 			destroy =3D ISC_TRUE;
+		}
 	}
 	UNLOCK(&res->buckets[bucketnum].lock);
=20
-	if (destroy)
-		bucket_empty =3D fctx_destroy(fctx);
 	isc_event_free(&event);
 	dns_adb_destroyfind(&find);
=20
@@ -2223,8 +2216,11 @@
 		fctx_try(fctx, ISC_TRUE, ISC_FALSE);
 	else if (want_done)
 		fctx_done(fctx, ISC_R_FAILURE, __LINE__);
-	else if (bucket_empty)
-		empty_bucket(res);
+	else if (destroy) {
+			fctx_destroy(fctx);
+		if (bucket_empty)
+			empty_bucket(res);
+	}
 }
=20
=20
@@ -2347,8 +2343,7 @@
=20
 	FCTXTRACE("add_bad");
=20
-	sa =3D isc_mem_get(fctx->res->buckets[fctx->bucketnum].mctx,
-			 sizeof(*sa));
+	sa =3D isc_mem_get(fctx->mctx, sizeof(*sa));
 	if (sa =3D=3D NULL)
 		return;
 	*sa =3D *address;
@@ -2631,12 +2626,9 @@
 			fctx->fwdpolicy =3D forwarders->fwdpolicy;
 			if (fctx->fwdpolicy =3D=3D dns_fwdpolicy_only &&
 			    isstrictsubdomain(domain, &fctx->domain)) {
-				isc_mem_t *mctx;
-
-				mctx =3D res->buckets[fctx->bucketnum].mctx;
-				dns_name_free(&fctx->domain, mctx);
+				dns_name_free(&fctx->domain, fctx->mctx);
 				dns_name_init(&fctx->domain, NULL);
-				result =3D dns_name_dup(domain, mctx,
+				result =3D dns_name_dup(domain, fctx->mctx,
 						      &fctx->domain);
 				if (result !=3D ISC_R_SUCCESS)
 					return (result);
@@ -3075,10 +3067,9 @@
 }
=20
 static isc_boolean_t
-fctx_destroy(fetchctx_t *fctx) {
+fctx_unlink(fetchctx_t *fctx) {
 	dns_resolver_t *res;
 	unsigned int bucketnum;
-	isc_sockaddr_t *sa, *next_sa;
=20
 	/*
 	 * Caller must be holding the bucket lock.
@@ -3095,13 +3086,42 @@
 	REQUIRE(fctx->references =3D=3D 0);
 	REQUIRE(ISC_LIST_EMPTY(fctx->validators));
=20
-	FCTXTRACE("destroy");
+	FCTXTRACE("unlink");
=20
 	res =3D fctx->res;
 	bucketnum =3D fctx->bucketnum;
=20
 	ISC_LIST_UNLINK(res->buckets[bucketnum].fctxs, fctx, link);
=20
+	LOCK(&res->nlock);
+	res->nfctx--;
+	UNLOCK(&res->nlock);
+
+	if (res->buckets[bucketnum].exiting &&
+	    ISC_LIST_EMPTY(res->buckets[bucketnum].fctxs))
+		return (ISC_TRUE);
+
+	return (ISC_FALSE);
+}
+
+static void
+fctx_destroy(fetchctx_t *fctx) {
+	isc_sockaddr_t *sa, *next_sa;
+
+	REQUIRE(VALID_FCTX(fctx));
+	REQUIRE(fctx->state =3D=3D fetchstate_done ||
+		fctx->state =3D=3D fetchstate_init);
+	REQUIRE(ISC_LIST_EMPTY(fctx->events));
+	REQUIRE(ISC_LIST_EMPTY(fctx->queries));
+	REQUIRE(ISC_LIST_EMPTY(fctx->finds));
+	REQUIRE(ISC_LIST_EMPTY(fctx->altfinds));
+	REQUIRE(fctx->pending =3D=3D 0);
+	REQUIRE(fctx->references =3D=3D 0);
+	REQUIRE(ISC_LIST_EMPTY(fctx->validators));
+	REQUIRE(!ISC_LINK_LINKED(fctx, link));
+
+	FCTXTRACE("destroy");
+
 	/*
 	 * Free bad.
 	 */
@@ -3110,7 +3130,7 @@
 	     sa =3D next_sa) {
 		next_sa =3D ISC_LIST_NEXT(sa, link);
 		ISC_LIST_UNLINK(fctx->bad, sa, link);
-		isc_mem_put(res->buckets[bucketnum].mctx, sa, sizeof(*sa));
+		isc_mem_put(fctx->mctx, sa, sizeof(*sa));
 	}
=20
 	for (sa =3D ISC_LIST_HEAD(fctx->edns);
@@ -3118,7 +3138,7 @@
 	     sa =3D next_sa) {
 		next_sa =3D ISC_LIST_NEXT(sa, link);
 		ISC_LIST_UNLINK(fctx->edns, sa, link);
-		isc_mem_put(res->buckets[bucketnum].mctx, sa, sizeof(*sa));
+		isc_mem_put(fctx->mctx, sa, sizeof(*sa));
 	}
=20
 	for (sa =3D ISC_LIST_HEAD(fctx->edns512);
@@ -3126,7 +3146,7 @@
 	     sa =3D next_sa) {
 		next_sa =3D ISC_LIST_NEXT(sa, link);
 		ISC_LIST_UNLINK(fctx->edns512, sa, link);
-		isc_mem_put(res->buckets[bucketnum].mctx, sa, sizeof(*sa));
+		isc_mem_put(fctx->mctx, sa, sizeof(*sa));
 	}
=20
 	for (sa =3D ISC_LIST_HEAD(fctx->bad_edns);
@@ -3134,31 +3154,21 @@
 	     sa =3D next_sa) {
 		next_sa =3D ISC_LIST_NEXT(sa, link);
 		ISC_LIST_UNLINK(fctx->bad_edns, sa, link);
-		isc_mem_put(res->buckets[bucketnum].mctx, sa, sizeof(*sa));
+		isc_mem_put(fctx->mctx, sa, sizeof(*sa));
 	}
=20
 	isc_timer_detach(&fctx->timer);
 	dns_message_destroy(&fctx->rmessage);
 	dns_message_destroy(&fctx->qmessage);
 	if (dns_name_countlabels(&fctx->domain) > 0)
-		dns_name_free(&fctx->domain, res->buckets[bucketnum].mctx);
+		dns_name_free(&fctx->domain, fctx->mctx);
 	if (dns_rdataset_isassociated(&fctx->nameservers))
 		dns_rdataset_disassociate(&fctx->nameservers);
-	dns_name_free(&fctx->name, res->buckets[bucketnum].mctx);
+	dns_name_free(&fctx->name, fctx->mctx);
 	dns_db_detach(&fctx->cache);
 	dns_adb_detach(&fctx->adb);
-	isc_mem_free(res->buckets[bucketnum].mctx, fctx->info);
-	isc_mem_put(res->buckets[bucketnum].mctx, fctx, sizeof(*fctx));
-
-	LOCK(&res->nlock);
-	res->nfctx--;
-	UNLOCK(&res->nlock);
-
-	if (res->buckets[bucketnum].exiting &&
-	    ISC_LIST_EMPTY(res->buckets[bucketnum].fctxs))
-		return (ISC_TRUE);
-
-	return (ISC_FALSE);
+	isc_mem_free(fctx->mctx, fctx->info);
+	isc_mem_putanddetach(&fctx->mctx, fctx, sizeof(*fctx));
 }
=20
 /*
@@ -3258,6 +3268,7 @@
 	dns_resolver_t *res;
 	unsigned int bucketnum;
 	dns_validator_t *validator;
+	isc_boolean_t destroy =3D ISC_FALSE;
=20
 	REQUIRE(VALID_FCTX(fctx));
=20
@@ -3307,13 +3318,18 @@
 	}
=20
 	if (fctx->references =3D=3D 0 && fctx->pending =3D=3D 0 &&
-	    fctx->nqueries =3D=3D 0 && ISC_LIST_EMPTY(fctx->validators))
-		bucket_empty =3D fctx_destroy(fctx);
+	    fctx->nqueries =3D=3D 0 && ISC_LIST_EMPTY(fctx->validators)) {
+		bucket_empty =3D fctx_unlink(fctx);
+		destroy =3D ISC_TRUE;
+	}
=20
 	UNLOCK(&res->buckets[bucketnum].lock);
=20
-	if (bucket_empty)
-		empty_bucket(res);
+	if (destroy) {
+		fctx_destroy(fctx);
+		if (bucket_empty)
+			empty_bucket(res);
+	}
 }
=20
 static void
@@ -3322,6 +3338,7 @@
 	isc_boolean_t done =3D ISC_FALSE, bucket_empty =3D ISC_FALSE;
 	dns_resolver_t *res;
 	unsigned int bucketnum;
+	isc_boolean_t destroy =3D ISC_FALSE;
=20
 	REQUIRE(VALID_FCTX(fctx));
=20
@@ -3354,7 +3371,8 @@
 			/*
 			 * It's now safe to destroy this fctx.
 			 */
-			bucket_empty =3D fctx_destroy(fctx);
+			bucket_empty =3D fctx_unlink(fctx);
+			destroy =3D ISC_TRUE;
 		}
 		done =3D ISC_TRUE;
 	} else {
@@ -3376,6 +3394,8 @@
 	if (!done) {
 		isc_result_t result;
=20
+		INSIST(!destroy);
+
 		/*
 		 * All is well.  Start working on the fetch.
 		 */
@@ -3384,8 +3404,11 @@
 			fctx_done(fctx, result, __LINE__);
 		else
 			fctx_try(fctx, ISC_FALSE, ISC_FALSE);
-	} else if (bucket_empty)
-		empty_bucket(res);
+	} else if (destroy) {
+			fctx_destroy(fctx);
+		if (bucket_empty)
+			empty_bucket(res);
+	}
 }
=20
 /*
@@ -3473,27 +3496,29 @@
 	char buf[DNS_NAME_FORMATSIZE + DNS_RDATATYPE_FORMATSIZE];
 	char typebuf[DNS_RDATATYPE_FORMATSIZE];
 	dns_name_t suffix;
+	isc_mem_t *mctx;
=20
 	/*
 	 * Caller must be holding the lock for bucket number 'bucketnum'.
 	 */
 	REQUIRE(fctxp !=3D NULL && *fctxp =3D=3D NULL);
=20
-	fctx =3D isc_mem_get(res->buckets[bucketnum].mctx, sizeof(*fctx));
+	mctx =3D res->buckets[bucketnum].mctx;
+	fctx =3D isc_mem_get(mctx, sizeof(*fctx));
 	if (fctx =3D=3D NULL)
 		return (ISC_R_NOMEMORY);
 	dns_name_format(name, buf, sizeof(buf));
 	dns_rdatatype_format(type, typebuf, sizeof(typebuf));
 	strcat(buf, "/");       /* checked */
 	strcat(buf, typebuf);   /* checked */
-	fctx->info =3D isc_mem_strdup(res->buckets[bucketnum].mctx, buf);
+	fctx->info =3D isc_mem_strdup(mctx, buf);
 	if (fctx->info =3D=3D NULL) {
 		result =3D ISC_R_NOMEMORY;
 		goto cleanup_fetch;
 	}
 	FCTXTRACE("create");
 	dns_name_init(&fctx->name, NULL);
-	result =3D dns_name_dup(name, res->buckets[bucketnum].mctx, &fctx->name);
+	result =3D dns_name_dup(name, mctx, &fctx->name);
 	if (result !=3D ISC_R_SUCCESS)
 		goto cleanup_info;
 	dns_name_init(&fctx->domain, NULL);
@@ -3596,9 +3621,7 @@
 						      NULL);
 			if (result !=3D ISC_R_SUCCESS)
 				goto cleanup_name;
-			result =3D dns_name_dup(domain,
-					      res->buckets[bucketnum].mctx,
-					      &fctx->domain);
+			result =3D dns_name_dup(domain, mctx, &fctx->domain);
 			if (result !=3D ISC_R_SUCCESS) {
 				dns_rdataset_disassociate(&fctx->nameservers);
 				goto cleanup_name;
@@ -3609,16 +3632,12 @@
 			/*
 			 * We're in forward-only mode.  Set the query domain.
 			 */
-			result =3D dns_name_dup(domain,
-					      res->buckets[bucketnum].mctx,
-					      &fctx->domain);
+			result =3D dns_name_dup(domain, mctx, &fctx->domain);
 			if (result !=3D ISC_R_SUCCESS)
 				goto cleanup_name;
 		}
 	} else {
-		result =3D dns_name_dup(domain,
-				      res->buckets[bucketnum].mctx,
-				      &fctx->domain);
+		result =3D dns_name_dup(domain, mctx, &fctx->domain);
 		if (result !=3D ISC_R_SUCCESS)
 			goto cleanup_name;
 		dns_rdataset_clone(nameservers, &fctx->nameservers);
@@ -3631,16 +3650,14 @@
 	INSIST(dns_name_issubdomain(&fctx->name, &fctx->domain));
=20
 	fctx->qmessage =3D NULL;
-	result =3D dns_message_create(res->buckets[bucketnum].mctx,
-				    DNS_MESSAGE_INTENTRENDER,
+	result =3D dns_message_create(mctx, DNS_MESSAGE_INTENTRENDER,
 				    &fctx->qmessage);
=20
 	if (result !=3D ISC_R_SUCCESS)
 		goto cleanup_domain;
=20
 	fctx->rmessage =3D NULL;
-	result =3D dns_message_create(res->buckets[bucketnum].mctx,
-				    DNS_MESSAGE_INTENTPARSE,
+	result =3D dns_message_create(mctx, DNS_MESSAGE_INTENTPARSE,
 				    &fctx->rmessage);
=20
 	if (result !=3D ISC_R_SUCCESS)
@@ -3690,6 +3707,8 @@
 	dns_db_attach(res->view->cachedb, &fctx->cache);
 	fctx->adb =3D NULL;
 	dns_adb_attach(res->view->adb, &fctx->adb);
+	fctx->mctx =3D NULL;
+	isc_mem_attach(mctx, &fctx->mctx);
=20
 	ISC_LIST_INIT(fctx->events);
 	ISC_LINK_INIT(fctx, link);
@@ -3713,18 +3732,18 @@
=20
  cleanup_domain:
 	if (dns_name_countlabels(&fctx->domain) > 0)
-		dns_name_free(&fctx->domain, res->buckets[bucketnum].mctx);
+		dns_name_free(&fctx->domain, mctx);
 	if (dns_rdataset_isassociated(&fctx->nameservers))
 		dns_rdataset_disassociate(&fctx->nameservers);
=20
  cleanup_name:
-	dns_name_free(&fctx->name, res->buckets[bucketnum].mctx);
+	dns_name_free(&fctx->name, mctx);
=20
  cleanup_info:
-	isc_mem_free(res->buckets[bucketnum].mctx, fctx->info);
+	isc_mem_free(mctx, fctx->info);
=20
  cleanup_fetch:
-	isc_mem_put(res->buckets[bucketnum].mctx, fctx, sizeof(*fctx));
+	isc_mem_put(mctx, fctx, sizeof(*fctx));
=20
 	return (result);
 }
@@ -3934,6 +3953,7 @@
 	isc_boolean_t bucket_empty =3D ISC_FALSE;
 	dns_resolver_t *res =3D fctx->res;
 	dns_validator_t *validator, *next_validator;
+	isc_boolean_t destroy =3D ISC_FALSE;
=20
 	REQUIRE(SHUTTINGDOWN(fctx));
=20
@@ -3949,11 +3969,15 @@
 		dns_validator_cancel(validator);
 	}
=20
-	if (fctx->references =3D=3D 0 && ISC_LIST_EMPTY(fctx->validators))
-		bucket_empty =3D fctx_destroy(fctx);
+	if (fctx->references =3D=3D 0 && ISC_LIST_EMPTY(fctx->validators)) {
+		bucket_empty =3D fctx_unlink(fctx);
+		destroy =3D ISC_TRUE;
+	}
  unlock:
 	if (!locked)
 		UNLOCK(&res->buckets[bucketnum].lock);
+	if (destroy)
+		fctx_destroy(fctx);
 	return (bucket_empty);
 }
=20
@@ -4008,8 +4032,7 @@
 	 * destroy the fctx if necessary.
 	 */
 	dns_validator_destroy(&vevent->validator);
-	isc_mem_put(res->buckets[fctx->bucketnum].mctx,
-		    valarg, sizeof(*valarg));
+	isc_mem_put(fctx->mctx, valarg, sizeof(*valarg));
=20
 	negative =3D ISC_TF(vevent->rdataset =3D=3D NULL);
=20
@@ -5723,14 +5746,11 @@
 		 *		if so we should bail out.
 		 */
 		INSIST(dns_name_countlabels(&fctx->domain) > 0);
-		dns_name_free(&fctx->domain,
-			      fctx->res->buckets[fctx->bucketnum].mctx);
+		dns_name_free(&fctx->domain, fctx->mctx);
 		if (dns_rdataset_isassociated(&fctx->nameservers))
 			dns_rdataset_disassociate(&fctx->nameservers);
 		dns_name_init(&fctx->domain, NULL);
-		result =3D dns_name_dup(ns_name,
-				      fctx->res->buckets[fctx->bucketnum].mctx,
-				      &fctx->domain);
+		result =3D dns_name_dup(ns_name, fctx->mctx, &fctx->domain);
 		if (result !=3D ISC_R_SUCCESS)
 			return (result);
 		fctx->attributes |=3D FCTX_ATTR_WANTCACHE;
@@ -6232,7 +6252,8 @@
 			 * This fctx is already shutdown; we were just
 			 * waiting for the last reference to go away.
 			 */
-			bucket_empty =3D fctx_destroy(fctx);
+			bucket_empty =3D fctx_unlink(fctx);
+			fctx_destroy(fctx);
 		} else {
 			/*
 			 * Initiate shutdown.
@@ -6287,12 +6308,9 @@
 		fctx->ns_ttl =3D fctx->nameservers.ttl;
 		fctx->ns_ttl_ok =3D ISC_TRUE;
 		log_ns_ttl(fctx, "resume_dslookup");
-		dns_name_free(&fctx->domain,
-			      fctx->res->buckets[bucketnum].mctx);
+		dns_name_free(&fctx->domain, fctx->mctx);
 		dns_name_init(&fctx->domain, NULL);
-		result =3D dns_name_dup(&fctx->nsname,
-				      fctx->res->buckets[bucketnum].mctx,
-				      &fctx->domain);
+		result =3D dns_name_dup(&fctx->nsname, fctx->mctx, &fctx->domain);
 		if (result !=3D ISC_R_SUCCESS) {
 			fctx_done(fctx, DNS_R_SERVFAIL, __LINE__);
 			goto cleanup;
@@ -7210,12 +7228,9 @@
 				fctx_done(fctx, DNS_R_SERVFAIL, __LINE__);
 				return;
 			}
-			dns_name_free(&fctx->domain,
-				      fctx->res->buckets[fctx->bucketnum].mctx);
+			dns_name_free(&fctx->domain, fctx->mctx);
 			dns_name_init(&fctx->domain, NULL);
-			result =3D dns_name_dup(fname,
-					      fctx->res->buckets[fctx->bucketnum].mctx,
-					      &fctx->domain);
+			result =3D dns_name_dup(fname, fctx->mctx, &fctx->domain);
 			if (result !=3D ISC_R_SUCCESS) {
 				fctx_done(fctx, DNS_R_SERVFAIL, __LINE__);
 				return;
@@ -7955,6 +7970,7 @@
 	unsigned int count =3D 0;
 	unsigned int spillat;
 	unsigned int spillatmin;
+	isc_boolean_t destroy =3D ISC_FALSE;
=20
 	UNUSED(forwarders);
=20
@@ -8052,16 +8068,20 @@
 			isc_task_send(res->buckets[bucketnum].task, &event);
 		} else {
 			/*
-			 * We don't care about the result of fctx_destroy()
+			 * We don't care about the result of fctx_unlink()
 			 * since we know we're not exiting.
 			 */
-			(void)fctx_destroy(fctx);
+			(void)fctx_unlink(fctx);
+			destroy =3D ISC_TRUE;
 		}
 	}
=20
  unlock:
 	UNLOCK(&res->buckets[bucketnum].lock);
=20
+	if (destroy)
+		fctx_destroy(fctx);
+
 	if (result =3D=3D ISC_R_SUCCESS) {
 		FTRACE("created");
 		*fetchp =3D fetch;
@@ -8428,6 +8448,7 @@
 			goto cleanup;
 		bad->type =3D type;
 		bad->hashval =3D hashval;
+		bad->expire =3D *expire;
 		isc_buffer_init(&buffer, bad + 1, name->length);
 		dns_name_init(&bad->name, NULL);
 		dns_name_copy(name, &bad->name, &buffer);
@@ -8439,8 +8460,8 @@
 		if (resolver->badcount < resolver->badhash * 2 &&
 		    resolver->badhash > DNS_BADCACHE_SIZE)
 			resizehash(resolver, &now, ISC_FALSE);
-	}
-	bad->expire =3D *expire;
+	} else
+		bad->expire =3D *expire;
  cleanup:
 	UNLOCK(&resolver->lock);
 }
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/bind9/lib/dns/sdb.c
--- a/head/contrib/bind9/lib/dns/sdb.c	Wed Jul 25 16:20:13 2012 +0300
+++ b/head/contrib/bind9/lib/dns/sdb.c	Wed Jul 25 16:21:35 2012 +0300
@@ -216,12 +216,13 @@
=20
 	REQUIRE(drivername !=3D NULL);
 	REQUIRE(methods !=3D NULL);
-	REQUIRE(methods->lookup !=3D NULL);
+	REQUIRE(methods->lookup !=3D NULL || methods->lookup2 !=3D NULL);
 	REQUIRE(mctx !=3D NULL);
 	REQUIRE(sdbimp !=3D NULL && *sdbimp =3D=3D NULL);
 	REQUIRE((flags & ~(DNS_SDBFLAG_RELATIVEOWNER |
 			   DNS_SDBFLAG_RELATIVERDATA |
-			   DNS_SDBFLAG_THREADSAFE)) =3D=3D 0);
+			   DNS_SDBFLAG_THREADSAFE|
+			   DNS_SDBFLAG_DNS64)) =3D=3D 0);
=20
 	imp =3D isc_mem_get(mctx, sizeof(dns_sdbimplementation_t));
 	if (imp =3D=3D NULL)
@@ -280,8 +281,9 @@
 }
=20
 isc_result_t
-dns_sdb_putrdata(dns_sdblookup_t *lookup, dns_rdatatype_t typeval, dns_ttl=
_t ttl,
-		 const unsigned char *rdatap, unsigned int rdlen)
+dns_sdb_putrdata(dns_sdblookup_t *lookup, dns_rdatatype_t typeval,
+		 dns_ttl_t ttl, const unsigned char *rdatap,
+		 unsigned int rdlen)
 {
 	dns_rdatalist_t *rdatalist;
 	dns_rdata_t *rdata;
@@ -338,7 +340,6 @@
 	return (result);
 }
=20
-
 isc_result_t
 dns_sdb_putrr(dns_sdblookup_t *lookup, const char *type, dns_ttl_t ttl,
 	      const char *data)
@@ -737,6 +738,8 @@
 	char namestr[DNS_NAME_MAXTEXT + 1];
 	isc_boolean_t isorigin;
 	dns_sdbimplementation_t *imp;
+	dns_name_t relname;
+	unsigned int labels;
=20
 	REQUIRE(VALID_SDB(sdb));
 	REQUIRE(create =3D=3D ISC_FALSE);
@@ -747,33 +750,46 @@
=20
 	imp =3D sdb->implementation;
=20
-	isc_buffer_init(&b, namestr, sizeof(namestr));
-	if ((imp->flags & DNS_SDBFLAG_RELATIVEOWNER) !=3D 0) {
-		dns_name_t relname;
-		unsigned int labels;
+	isorigin =3D dns_name_equal(name, &sdb->common.origin);
=20
-		labels =3D dns_name_countlabels(name) -
-			 dns_name_countlabels(&db->origin);
-		dns_name_init(&relname, NULL);
-		dns_name_getlabelsequence(name, 0, labels, &relname);
-		result =3D dns_name_totext(&relname, ISC_TRUE, &b);
-		if (result !=3D ISC_R_SUCCESS)
-			return (result);
+	if (imp->methods->lookup2 !=3D NULL) {
+		if ((imp->flags & DNS_SDBFLAG_RELATIVEOWNER) !=3D 0) {
+			labels =3D dns_name_countlabels(name) -
+				 dns_name_countlabels(&db->origin);
+			dns_name_init(&relname, NULL);
+			dns_name_getlabelsequence(name, 0, labels, &relname);
+			name =3D &relname;
+		}
 	} else {
-		result =3D dns_name_totext(name, ISC_TRUE, &b);
-		if (result !=3D ISC_R_SUCCESS)
-			return (result);
+		isc_buffer_init(&b, namestr, sizeof(namestr));
+		if ((imp->flags & DNS_SDBFLAG_RELATIVEOWNER) !=3D 0) {
+
+			labels =3D dns_name_countlabels(name) -
+				 dns_name_countlabels(&db->origin);
+			dns_name_init(&relname, NULL);
+			dns_name_getlabelsequence(name, 0, labels, &relname);
+			result =3D dns_name_totext(&relname, ISC_TRUE, &b);
+			if (result !=3D ISC_R_SUCCESS)
+				return (result);
+		} else {
+			result =3D dns_name_totext(name, ISC_TRUE, &b);
+			if (result !=3D ISC_R_SUCCESS)
+				return (result);
+		}
+		isc_buffer_putuint8(&b, 0);
 	}
-	isc_buffer_putuint8(&b, 0);
=20
 	result =3D createnode(sdb, &node);
 	if (result !=3D ISC_R_SUCCESS)
 		return (result);
=20
-	isorigin =3D dns_name_equal(name, &sdb->common.origin);
-
 	MAYBE_LOCK(sdb);
-	result =3D imp->methods->lookup(sdb->zone, namestr, sdb->dbdata, node);
+	if (imp->methods->lookup2 !=3D NULL)
+		result =3D imp->methods->lookup2(&sdb->common.origin, name,
+					       sdb->dbdata, node);
+	else
+		result =3D imp->methods->lookup(sdb->zone, namestr, sdb->dbdata,
+					      node);
 	MAYBE_UNLOCK(sdb);
 	if (result !=3D ISC_R_SUCCESS &&
 	    !(result =3D=3D ISC_R_NOTFOUND &&
@@ -811,13 +827,13 @@
 	unsigned int nlabels, olabels;
 	isc_result_t result;
 	unsigned int i;
+	unsigned int flags;
=20
 	REQUIRE(VALID_SDB(sdb));
 	REQUIRE(nodep =3D=3D NULL || *nodep =3D=3D NULL);
 	REQUIRE(version =3D=3D NULL || version =3D=3D (void *) &dummy);
=20
 	UNUSED(options);
-	UNUSED(sdb);
=20
 	if (!dns_name_issubdomain(name, &db->origin))
 		return (DNS_R_NXDOMAIN);
@@ -834,17 +850,37 @@
 	}
=20
 	result =3D DNS_R_NXDOMAIN;
-
-	for (i =3D olabels; i <=3D nlabels; i++) {
+	flags =3D sdb->implementation->flags;
+	i =3D (flags & DNS_SDBFLAG_DNS64) !=3D 0 ? nlabels : olabels;
+	for (; i <=3D nlabels; i++) {
 		/*
 		 * Look up the next label.
 		 */
 		dns_name_getlabelsequence(name, nlabels - i, i, xname);
 		result =3D findnode(db, xname, ISC_FALSE, &node);
-		if (result !=3D ISC_R_SUCCESS) {
+		if (result =3D=3D ISC_R_NOTFOUND) {
+			/*
+			 * No data at zone apex?
+			 */
+			if (i =3D=3D olabels)
+				return (DNS_R_BADDB);
 			result =3D DNS_R_NXDOMAIN;
 			continue;
 		}
+		if (result !=3D ISC_R_SUCCESS)
+			return (result);
+
+		/*
+		 * DNS64 zone's don't have DNAME or NS records.
+		 */
+		if ((flags & DNS_SDBFLAG_DNS64) !=3D 0)
+			goto skip;
+
+		/*
+		 * DNS64 zone's don't have DNAME or NS records.
+		 */
+		if ((flags & DNS_SDBFLAG_DNS64) !=3D 0)
+			goto skip;
=20
 		/*
 		 * Look for a DNAME at the current label, unless this is
@@ -895,6 +931,7 @@
 			continue;
 		}
=20
+ skip:
 		/*
 		 * If we're looking for ANY, we're done.
 		 */
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/bind9/lib/dns/tkey.c
--- a/head/contrib/bind9/lib/dns/tkey.c	Wed Jul 25 16:20:13 2012 +0300
+++ b/head/contrib/bind9/lib/dns/tkey.c	Wed Jul 25 16:21:35 2012 +0300
@@ -485,9 +485,9 @@
 		tkeyout->error =3D dns_tsigerror_badkey;
 		tkey_log("process_gsstkey(): dns_tsigerror_badkey");    /* XXXSRA */
 		return (ISC_R_SUCCESS);
-	} else if (result =3D=3D ISC_R_FAILURE)
+	}
+	if (result !=3D DNS_R_CONTINUE && result !=3D ISC_R_SUCCESS)
 		goto failure;
-	ENSURE(result =3D=3D DNS_R_CONTINUE || result =3D=3D ISC_R_SUCCESS);
 	/*
 	 * XXXDCL Section 4.1.3: Limit GSS_S_CONTINUE_NEEDED to 10 times.
 	 */
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/bind9/lib/dns/zone.c
--- a/head/contrib/bind9/lib/dns/zone.c	Wed Jul 25 16:20:13 2012 +0300
+++ b/head/contrib/bind9/lib/dns/zone.c	Wed Jul 25 16:21:35 2012 +0300
@@ -429,6 +429,7 @@
 	isc_ratelimiter_t *	rl;
 	isc_rwlock_t		rwlock;
 	isc_mutex_t		iolock;
+	isc_rwlock_t		urlock;
=20
 	/* Locked by rwlock. */
 	dns_zonelist_t		zones;
@@ -446,7 +447,7 @@
 	dns_iolist_t		high;
 	dns_iolist_t		low;
=20
-	/* Locked by rwlock. */
+	/* Locked by urlock. */
 	/* LRU cache */
 	struct dns_unreachable	unreachable[UNREACH_CHACHE_SIZE];
 };
@@ -1676,12 +1677,16 @@
=20
 	LOCK_ZONE(zone);
 	ZONEDB_LOCK(&zone->dblock, isc_rwlocktype_read);
-	dns_db_currentversion(zone->db, &version);
-	result =3D dns_master_dumpinc2(zone->mctx, zone->db, version,
-				     &dns_master_style_default,
-				     zone->masterfile, zone->task, dump_done,
-				     zone, &zone->dctx, zone->masterformat);
-	dns_db_closeversion(zone->db, &version, ISC_FALSE);
+	if (zone->db !=3D NULL) {
+		dns_db_currentversion(zone->db, &version);
+		result =3D dns_master_dumpinc2(zone->mctx, zone->db, version,
+					     &dns_master_style_default,
+					     zone->masterfile, zone->task,
+					     dump_done, zone, &zone->dctx,
+					     zone->masterformat);
+		dns_db_closeversion(zone->db, &version, ISC_FALSE);
+	} else
+		result =3D ISC_R_CANCELED;
 	ZONEDB_UNLOCK(&zone->dblock, isc_rwlocktype_read);
 	UNLOCK_ZONE(zone);
 	if (result !=3D DNS_R_CONTINUE)
@@ -2695,7 +2700,8 @@
  */
 static void
 set_refreshkeytimer(dns_zone_t *zone, dns_rdata_keydata_t *key,
-		    isc_stdtime_t now) {
+		    isc_stdtime_t now)
+{
 	const char me[] =3D "set_refreshkeytimer";
 	isc_stdtime_t then;
 	isc_time_t timenow, timethen;
@@ -4443,6 +4449,7 @@
 	/*
 	 * Everything is ok so attach to the zone.
 	 */
+	zone->curmaster =3D 0;
 	zone->masters =3D new;
 	zone->mastersok =3D newok;
 	zone->masterkeynames =3D newname;
@@ -8020,13 +8027,14 @@
 	case dns_zone_master:
 	case dns_zone_slave:
 	case dns_zone_key:
+	case dns_zone_stub:
 		LOCK_ZONE(zone);
 		if (zone->masterfile !=3D NULL &&
 		    isc_time_compare(&now, &zone->dumptime) >=3D 0 &&
 		    DNS_ZONE_FLAG(zone, DNS_ZONEFLG_LOADED) &&
 		    DNS_ZONE_FLAG(zone, DNS_ZONEFLG_NEEDDUMP)) {
 			dumping =3D was_dumping(zone);
-		} else
+		} else=20
 			dumping =3D ISC_TRUE;
 		UNLOCK_ZONE(zone);
 		if (!dumping) {
@@ -8379,7 +8387,7 @@
 		goto fail;
 	}
=20
-	if (compact) {
+	if (compact && zone->type !=3D dns_zone_stub) {
 		dns_zone_t *dummy =3D NULL;
 		LOCK_ZONE(zone);
 		zone_iattach(zone, &dummy);
@@ -8531,6 +8539,14 @@
=20
 	REQUIRE(LOCKED_ZONE(zone));
=20
+	if (!DNS_ZONE_FLAG(zone, DNS_ZONEFLG_FLUSH) ||
+	    !DNS_ZONE_FLAG(zone, DNS_ZONEFLG_DUMPING)) {
+		if (zone->writeio !=3D NULL)
+			zonemgr_cancelio(zone->writeio);
+
+		if (zone->dctx !=3D NULL)
+			dns_dumpctx_cancel(zone->dctx);
+	}
 	ZONEDB_LOCK(&zone->dblock, isc_rwlocktype_write);
 	zone_detachdb(zone);
 	ZONEDB_UNLOCK(&zone->dblock, isc_rwlocktype_write);
@@ -9227,7 +9243,7 @@
 	dns_zone_t *zone =3D NULL;
 	char master[ISC_SOCKADDR_FORMATSIZE];
 	char source[ISC_SOCKADDR_FORMATSIZE];
-	isc_uint32_t nscnt, cnamecnt;
+	isc_uint32_t nscnt, cnamecnt, refresh, retry, expire;
 	isc_result_t result;
 	isc_time_t now;
 	isc_boolean_t exiting =3D ISC_FALSE;
@@ -9245,6 +9261,8 @@
=20
 	TIME_NOW(&now);
=20
+	LOCK_ZONE(zone);
+
 	if (DNS_ZONE_FLAG(zone, DNS_ZONEFLG_EXITING)) {
 		zone_debuglog(zone, me, 1, "exiting");
 		exiting =3D ISC_TRUE;
@@ -9257,9 +9275,7 @@
 	if (revent->result !=3D ISC_R_SUCCESS) {
 		if (revent->result =3D=3D ISC_R_TIMEDOUT &&
 		    !DNS_ZONE_FLAG(zone, DNS_ZONEFLG_NOEDNS)) {
-			LOCK_ZONE(zone);
 			DNS_ZONE_SETFLAG(zone, DNS_ZONEFLG_NOEDNS);
-			UNLOCK_ZONE(zone);
 			dns_zone_log(zone, ISC_LOG_DEBUG(1),
 				     "refreshing stub: timeout retrying "
 				     " without EDNS master %s (source %s)",
@@ -9301,9 +9317,7 @@
 				     "refreshing stub: rcode (%.*s) retrying "
 				     "without EDNS master %s (source %s)",
 				     (int)rb.used, rcode, master, source);
-			LOCK_ZONE(zone);
 			DNS_ZONE_SETFLAG(zone, DNS_ZONEFLG_NOEDNS);
-			UNLOCK_ZONE(zone);
 			goto same_master;
 		}
=20
@@ -9325,9 +9339,7 @@
 				     master, source);
 			goto next_master;
 		}
-		LOCK_ZONE(zone);
 		DNS_ZONE_SETFLAG(zone, DNS_ZONEFLG_USEVC);
-		UNLOCK_ZONE(zone);
 		goto same_master;
 	}
=20
@@ -9379,24 +9391,33 @@
 	ZONEDB_LOCK(&zone->dblock, isc_rwlocktype_write);
 	if (zone->db =3D=3D NULL)
 		zone_attachdb(zone, stub->db);
+	result =3D zone_get_from_db(zone, zone->db, NULL, NULL, NULL, &refresh,
+				  &retry, &expire, NULL, NULL);
+	if (result =3D=3D ISC_R_SUCCESS) {
+		zone->refresh =3D RANGE(refresh, zone->minrefresh,
+				      zone->maxrefresh);
+		zone->retry =3D RANGE(retry, zone->minretry, zone->maxretry);
+		zone->expire =3D RANGE(expire, zone->refresh + zone->retry,
+				     DNS_MAX_EXPIRE);
+		DNS_ZONE_SETFLAG(zone, DNS_ZONEFLG_HAVETIMERS);
+	}
 	ZONEDB_UNLOCK(&zone->dblock, isc_rwlocktype_write);
 	dns_db_detach(&stub->db);
=20
-	if (zone->masterfile !=3D NULL) {
-		dns_zone_dump(zone);
-		TIME_NOW(&zone->loadtime);
-	}
-
 	dns_message_destroy(&msg);
 	isc_event_free(&event);
-	LOCK_ZONE(zone);
 	dns_request_destroy(&zone->request);
+
 	DNS_ZONE_CLRFLAG(zone, DNS_ZONEFLG_REFRESH);
+	DNS_ZONE_SETFLAG(zone, DNS_ZONEFLG_LOADED);
 	DNS_ZONE_JITTER_ADD(&now, zone->refresh, &zone->refreshtime);
 	isc_interval_set(&i, zone->expire, 0);
 	DNS_ZONE_TIME_ADD(&now, zone->expire, &zone->expiretime);
+
+	if (zone->masterfile !=3D NULL)
+		zone_needdump(zone, 0);
+
 	zone_settimer(zone, &now);
-	UNLOCK_ZONE(zone);
 	goto free_stub;
=20
  next_master:
@@ -9407,7 +9428,6 @@
 	if (msg !=3D NULL)
 		dns_message_destroy(&msg);
 	isc_event_free(&event);
-	LOCK_ZONE(zone);
 	dns_request_destroy(&zone->request);
 	/*
 	 * Skip to next failed / untried master.
@@ -9445,25 +9465,23 @@
 			DNS_ZONE_CLRFLAG(zone, DNS_ZONEFLG_REFRESH);
=20
 			zone_settimer(zone, &now);
-			UNLOCK_ZONE(zone);
 			goto free_stub;
 		}
 	}
 	queue_soa_query(zone);
-	UNLOCK_ZONE(zone);
 	goto free_stub;
=20
  same_master:
 	if (msg !=3D NULL)
 		dns_message_destroy(&msg);
 	isc_event_free(&event);
-	LOCK_ZONE(zone);
 	dns_request_destroy(&zone->request);
-	UNLOCK_ZONE(zone);
 	ns_query(zone, NULL, stub);
+	UNLOCK_ZONE(zone);
 	goto done;
=20
  free_stub:
+	UNLOCK_ZONE(zone);
 	stub->magic =3D 0;
 	dns_zone_idetach(&stub->zone);
 	INSIST(stub->db =3D=3D NULL);
@@ -9494,6 +9512,7 @@
 	isc_result_t result;
 	isc_uint32_t serial, oldserial =3D 0;
 	unsigned int j;
+	isc_boolean_t do_queue_xfrin =3D ISC_FALSE;
=20
 	zone =3D revent->ev_arg;
 	INSIST(DNS_ZONE_VALID(zone));
@@ -9502,6 +9521,10 @@
=20
 	ENTER;
=20
+	TIME_NOW(&now);
+
+	LOCK_ZONE(zone);
+
 	/*
 	 * if timeout log and next master;
 	 */
@@ -9509,14 +9532,10 @@
 	isc_sockaddr_format(&zone->masteraddr, master, sizeof(master));
 	isc_sockaddr_format(&zone->sourceaddr, source, sizeof(source));
=20
-	TIME_NOW(&now);
-
 	if (revent->result !=3D ISC_R_SUCCESS) {
 		if (revent->result =3D=3D ISC_R_TIMEDOUT &&
 		    !DNS_ZONE_FLAG(zone, DNS_ZONEFLG_NOEDNS)) {
-			LOCK_ZONE(zone);
 			DNS_ZONE_SETFLAG(zone, DNS_ZONEFLG_NOEDNS);
-			UNLOCK_ZONE(zone);
 			dns_zone_log(zone, ISC_LOG_DEBUG(1),
 				     "refresh: timeout retrying without EDNS "
 				     "master %s (source %s)", master, source);
@@ -9536,10 +9555,8 @@
 							     &zone->sourceaddr,
 							     &now))
 				{
-					LOCK_ZONE(zone);
 					DNS_ZONE_SETFLAG(zone,
 						     DNS_ZONEFLG_SOABEFOREAXFR);
-					UNLOCK_ZONE(zone);
 					goto tcp_transfer;
 				}
 				dns_zone_log(zone, ISC_LOG_DEBUG(1),
@@ -9586,9 +9603,7 @@
 				     "refresh: rcode (%.*s) retrying without "
 				     "EDNS master %s (source %s)",
 				     (int)rb.used, rcode, master, source);
-			LOCK_ZONE(zone);
 			DNS_ZONE_SETFLAG(zone, DNS_ZONEFLG_NOEDNS);
-			UNLOCK_ZONE(zone);
 			goto same_master;
 		}
 		dns_zone_log(zone, ISC_LOG_INFO,
@@ -9614,9 +9629,7 @@
 				     "initiating TCP zone xfer "
 				     "for master %s (source %s)",
 				     master, source);
-			LOCK_ZONE(zone);
 			DNS_ZONE_SETFLAG(zone, DNS_ZONEFLG_SOABEFOREAXFR);
-			UNLOCK_ZONE(zone);
 			goto tcp_transfer;
 		} else {
 			INSIST(zone->type =3D=3D dns_zone_stub);
@@ -9627,9 +9640,7 @@
 					     master, source);
 				goto next_master;
 			}
-			LOCK_ZONE(zone);
 			DNS_ZONE_SETFLAG(zone, DNS_ZONEFLG_USEVC);
-			UNLOCK_ZONE(zone);
 			goto same_master;
 		}
 	}
@@ -9690,6 +9701,7 @@
 			     soacnt, master, source);
 		goto next_master;
 	}
+
 	/*
 	 * Extract serial
 	 */
@@ -9717,7 +9729,9 @@
=20
 	serial =3D soa.serial;
 	if (DNS_ZONE_FLAG(zone, DNS_ZONEFLG_LOADED)) {
-		result =3D dns_zone_getserial2(zone, &oldserial);
+		result =3D zone_get_from_db(zone, zone->db, NULL, NULL,
+					  &oldserial, NULL, NULL, NULL, NULL,
+					  NULL);
 		RUNTIME_CHECK(result =3D=3D ISC_R_SUCCESS);
 		zone_debuglog(zone, me, 1, "serial: new %u, old %u",
 			      serial, oldserial);
@@ -9741,11 +9755,9 @@
 		}
  tcp_transfer:
 		isc_event_free(&event);
-		LOCK_ZONE(zone);
 		dns_request_destroy(&zone->request);
-		UNLOCK_ZONE(zone);
 		if (zone->type =3D=3D dns_zone_slave) {
-			queue_xfrin(zone);
+			do_queue_xfrin =3D ISC_TRUE;
 		} else {
 			INSIST(zone->type =3D=3D dns_zone_stub);
 			ns_query(zone, rdataset, NULL);
@@ -9767,9 +9779,7 @@
 							  &now);
 			/* Someone removed the file from underneath us! */
 			if (result =3D=3D ISC_R_FILENOTFOUND) {
-				LOCK_ZONE(zone);
 				zone_needdump(zone, DNS_DUMP_DELAY);
-				UNLOCK_ZONE(zone);
 			} else if (result !=3D ISC_R_SUCCESS)
 				dns_zone_log(zone, ISC_LOG_ERROR,
 					     "refresh: could not set file "
@@ -9799,7 +9809,6 @@
 	if (msg !=3D NULL)
 		dns_message_destroy(&msg);
 	isc_event_free(&event);
-	LOCK_ZONE(zone);
 	dns_request_destroy(&zone->request);
 	/*
 	 * Skip to next failed / untried master.
@@ -9841,25 +9850,24 @@
 		}
 		DNS_ZONE_CLRFLAG(zone, DNS_ZONEFLG_USEALTXFRSRC);
 		zone_settimer(zone, &now);
-		UNLOCK_ZONE(zone);
 		goto detach;
 	}
=20
  requeue:
 	queue_soa_query(zone);
-	UNLOCK_ZONE(zone);
 	goto detach;
=20
  same_master:
 	if (msg !=3D NULL)
 		dns_message_destroy(&msg);
 	isc_event_free(&event);
-	LOCK_ZONE(zone);
 	dns_request_destroy(&zone->request);
 	queue_soa_query(zone);
-	UNLOCK_ZONE(zone);
=20
  detach:
+	UNLOCK_ZONE(zone);
+	if (do_queue_xfrin)
+		queue_xfrin(zone);
 	dns_zone_idetach(&zone);
 	return;
 }
@@ -10217,13 +10225,13 @@
 	isc_uint16_t udpsize =3D SEND_BUFFER_SIZE;
=20
 	REQUIRE(DNS_ZONE_VALID(zone));
+	REQUIRE(LOCKED_ZONE(zone));
 	REQUIRE((soardataset !=3D NULL && stub =3D=3D NULL) ||
 		(soardataset =3D=3D NULL && stub !=3D NULL));
 	REQUIRE(stub =3D=3D NULL || DNS_STUB_VALID(stub));
=20
 	ENTER;
=20
-	LOCK_ZONE(zone);
 	if (stub =3D=3D NULL) {
 		stub =3D isc_mem_get(zone->mctx, sizeof(*stub));
 		if (stub =3D=3D NULL)
@@ -10414,10 +10422,9 @@
 	}
 	if (message !=3D NULL)
 		dns_message_destroy(&message);
-  unlock:
+ unlock:
 	if (key !=3D NULL)
 		dns_tsigkey_detach(&key);
-	UNLOCK_ZONE(zone);
 	return;
 }
=20
@@ -12597,15 +12604,22 @@
 	zmgr->transfersin =3D 10;
 	zmgr->transfersperns =3D 2;
=20
+	/* Unreachable lock. */
+	result =3D isc_rwlock_init(&zmgr->urlock, 0, 0);
+	if (result !=3D ISC_R_SUCCESS)
+		goto free_rwlock;
+
 	/* Create a single task for queueing of SOA queries. */
 	result =3D isc_task_create(taskmgr, 1, &zmgr->task);
 	if (result !=3D ISC_R_SUCCESS)
-		goto free_rwlock;
+		goto free_urlock;
+
 	isc_task_setname(zmgr->task, "zmgr", zmgr);
 	result =3D isc_ratelimiter_create(mctx, timermgr, zmgr->task,
 					&zmgr->rl);
 	if (result !=3D ISC_R_SUCCESS)
 		goto free_task;
+
 	/* default to 20 refresh queries / notifies per second. */
 	isc_interval_set(&interval, 0, 1000000000/2);
 	result =3D isc_ratelimiter_setinterval(zmgr->rl, &interval);
@@ -12634,6 +12648,8 @@
 	isc_ratelimiter_detach(&zmgr->rl);
  free_task:
 	isc_task_detach(&zmgr->task);
+ free_urlock:
+	isc_rwlock_destroy(&zmgr->urlock);
  free_rwlock:
 	isc_rwlock_destroy(&zmgr->rwlock);
  free_mem:
@@ -12814,7 +12830,6 @@
 		UNLOCK_ZONE(zone);
 	}
 	RWUNLOCK(&zmgr->rwlock, isc_rwlocktype_read);
-
 }
=20
 isc_result_t
@@ -12858,6 +12873,7 @@
 	DESTROYLOCK(&zmgr->iolock);
 	isc_ratelimiter_detach(&zmgr->rl);
=20
+	isc_rwlock_destroy(&zmgr->urlock);
 	isc_rwlock_destroy(&zmgr->rwlock);
 	mctx =3D zmgr->mctx;
 	isc_mem_put(zmgr->mctx, zmgr, sizeof(*zmgr));
@@ -13270,12 +13286,12 @@
 	REQUIRE(DNS_ZONEMGR_VALID(zmgr));
=20
 	locktype =3D isc_rwlocktype_read;
-	RWLOCK(&zmgr->rwlock, locktype);
+	RWLOCK(&zmgr->urlock, locktype);
 	for (i =3D 0; i < UNREACH_CHACHE_SIZE; i++) {
 		if (zmgr->unreachable[i].expire >=3D seconds &&
 		    isc_sockaddr_equal(&zmgr->unreachable[i].remote, remote) &&
 		    isc_sockaddr_equal(&zmgr->unreachable[i].local, local)) {
-			result =3D isc_rwlock_tryupgrade(&zmgr->rwlock);
+			result =3D isc_rwlock_tryupgrade(&zmgr->urlock);
 			if (result =3D=3D ISC_R_SUCCESS) {
 				locktype =3D isc_rwlocktype_write;
 				zmgr->unreachable[i].last =3D seconds;
@@ -13283,7 +13299,7 @@
 			break;
 		}
 	}
-	RWUNLOCK(&zmgr->rwlock, locktype);
+	RWUNLOCK(&zmgr->urlock, locktype);
 	return (ISC_TF(i < UNREACH_CHACHE_SIZE));
 }
=20
@@ -13304,11 +13320,11 @@
 	REQUIRE(DNS_ZONEMGR_VALID(zmgr));
=20
 	locktype =3D isc_rwlocktype_read;
-	RWLOCK(&zmgr->rwlock, locktype);
+	RWLOCK(&zmgr->urlock, locktype);
 	for (i =3D 0; i < UNREACH_CHACHE_SIZE; i++) {
 		if (isc_sockaddr_equal(&zmgr->unreachable[i].remote, remote) &&
 		    isc_sockaddr_equal(&zmgr->unreachable[i].local, local)) {
-			result =3D isc_rwlock_tryupgrade(&zmgr->rwlock);
+			result =3D isc_rwlock_tryupgrade(&zmgr->urlock);
 			if (result =3D=3D ISC_R_SUCCESS) {
 				locktype =3D isc_rwlocktype_write;
 				zmgr->unreachable[i].expire =3D 0;
@@ -13321,7 +13337,7 @@
 			break;
 		}
 	}
-	RWUNLOCK(&zmgr->rwlock, locktype);
+	RWUNLOCK(&zmgr->urlock, locktype);
 }
=20
 void
@@ -13334,7 +13350,7 @@
=20
 	REQUIRE(DNS_ZONEMGR_VALID(zmgr));
=20
-	RWLOCK(&zmgr->rwlock, isc_rwlocktype_write);
+	RWLOCK(&zmgr->urlock, isc_rwlocktype_write);
 	for (i =3D 0; i < UNREACH_CHACHE_SIZE; i++) {
 		/* Existing entry? */
 		if (isc_sockaddr_equal(&zmgr->unreachable[i].remote, remote) &&
@@ -13373,7 +13389,7 @@
 		zmgr->unreachable[oldest].remote =3D *remote;
 		zmgr->unreachable[oldest].local =3D *local;
 	}
-	RWUNLOCK(&zmgr->rwlock, isc_rwlocktype_write);
+	RWUNLOCK(&zmgr->urlock, isc_rwlocktype_write);
 }
=20
 void
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/bind9/lib/isc/pthreads/mu=
tex.c
--- a/head/contrib/bind9/lib/isc/pthreads/mutex.c	Wed Jul 25 16:20:13 2012 =
+0300
+++ b/head/contrib/bind9/lib/isc/pthreads/mutex.c	Wed Jul 25 16:21:35 2012 =
+0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2004, 2005, 2007, 2008, 2011  Internet Systems Consortium=
, Inc. ("ISC")
+ * Copyright (C) 2004, 2005, 2007, 2008, 2011, 2012  Internet Systems Cons=
ortium, Inc. ("ISC")
  * Copyright (C) 2000-2002  Internet Software Consortium.
  *
  * Permission to use, copy, modify, and/or distribute this software for any
@@ -78,7 +78,7 @@
 };
=20
 #ifndef ISC_MUTEX_PROFTABLESIZE
-#define ISC_MUTEX_PROFTABLESIZE (16 * 1024)
+#define ISC_MUTEX_PROFTABLESIZE (1024 * 1024)
 #endif
 static isc_mutexstats_t stats[ISC_MUTEX_PROFTABLESIZE];
 static int stats_next =3D 0;
@@ -200,24 +200,24 @@
=20
 	fprintf(fp, "Mutex stats (in us)\n");
 	for (i =3D 0; i < stats_next; i++) {
-		fprintf(fp, "%-12s %4d: %10u  %lu.%06lu %lu.%06lu\n",
+		fprintf(fp, "%-12s %4d: %10u  %lu.%06lu %lu.%06lu %5d\n",
 			stats[i].file, stats[i].line, stats[i].count,
 			stats[i].locked_total.tv_sec,
 			stats[i].locked_total.tv_usec,
 			stats[i].wait_total.tv_sec,
-			stats[i].wait_total.tv_usec
-			);
+			stats[i].wait_total.tv_usec,
+			i);
 		for (j =3D 0; j < ISC_MUTEX_MAX_LOCKERS; j++) {
 			locker =3D &stats[i].lockers[j];
 			if (locker->file =3D=3D NULL)
 				continue;
-			fprintf(fp, " %-11s %4d: %10u  %lu.%06lu %lu.%06lu\n",
+			fprintf(fp, " %-11s %4d: %10u  %lu.%06lu %lu.%06lu %5d\n",
 				locker->file, locker->line, locker->count,
 				locker->locked_total.tv_sec,
 				locker->locked_total.tv_usec,
 				locker->wait_total.tv_sec,
-				locker->wait_total.tv_usec
-				);
+				locker->wait_total.tv_usec,
+				i);
 		}
 	}
 }
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/bind9/lib/isccfg/api
--- a/head/contrib/bind9/lib/isccfg/api	Wed Jul 25 16:20:13 2012 +0300
+++ b/head/contrib/bind9/lib/isccfg/api	Wed Jul 25 16:21:35 2012 +0300
@@ -4,5 +4,5 @@
 # 9.8: 80-89
 # 9.9: 90-109
 LIBINTERFACE =3D 82
-LIBREVISION =3D 1
+LIBREVISION =3D 2
 LIBAGE =3D 0
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/bind9/lib/isccfg/parser.c
--- a/head/contrib/bind9/lib/isccfg/parser.c	Wed Jul 25 16:20:13 2012 +0300
+++ b/head/contrib/bind9/lib/isccfg/parser.c	Wed Jul 25 16:21:35 2012 +0300
@@ -2232,16 +2232,30 @@
=20
 #define MAX_LOG_TOKEN 30 /* How much of a token to quote in log messages. =
*/
=20
+static isc_boolean_t
+have_current_file(cfg_parser_t *pctx) {
+	cfg_listelt_t *elt;
+	if (pctx->open_files =3D=3D NULL)
+		return (ISC_FALSE);
+
+	elt =3D ISC_LIST_TAIL(pctx->open_files->value.list);
+	if (elt =3D=3D NULL)
+	      return (ISC_FALSE);
+
+	return (ISC_TRUE);
+}
+
 static char *
 current_file(cfg_parser_t *pctx) {
 	static char none[] =3D "none";
 	cfg_listelt_t *elt;
 	cfg_obj_t *fileobj;
=20
-	if (pctx->open_files =3D=3D NULL)
+	if (!have_current_file(pctx))
 		return (none);
+
 	elt =3D ISC_LIST_TAIL(pctx->open_files->value.list);
-	if (elt =3D=3D NULL)
+	if (elt =3D=3D NULL)	/* shouldn't be possible, but... */
 	      return (none);
=20
 	fileobj =3D elt->obj;
@@ -2264,8 +2278,10 @@
 	if (is_warning)
 		level =3D ISC_LOG_WARNING;
=20
-	snprintf(where, sizeof(where), "%s:%u: ",
-		 current_file(pctx), pctx->line);
+	where[0] =3D '\0';
+	if (have_current_file(pctx))
+		snprintf(where, sizeof(where), "%s:%u: ",
+			 current_file(pctx), pctx->line);
=20
 	len =3D vsnprintf(message, sizeof(message), format, args);
 	if (len >=3D sizeof(message))
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/bind9/version
--- a/head/contrib/bind9/version	Wed Jul 25 16:20:13 2012 +0300
+++ b/head/contrib/bind9/version	Wed Jul 25 16:21:35 2012 +0300
@@ -5,6 +5,6 @@
 #
 MAJORVER=3D9
 MINORVER=3D8
-PATCHVER=3D2
-RELEASETYPE=3D
-RELEASEVER=3D
+PATCHVER=3D3
+RELEASETYPE=3D-P
+RELEASEVER=3D2
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/binutils/gas/config/tc-i3=
86.c
--- a/head/contrib/binutils/gas/config/tc-i386.c	Wed Jul 25 16:20:13 2012 +=
0300
+++ b/head/contrib/binutils/gas/config/tc-i386.c	Wed Jul 25 16:21:35 2012 +=
0300
@@ -517,7 +517,9 @@
   {".sse4a", PROCESSOR_UNKNOWN,
    CpuMMX|CpuMMX2|CpuSSE|CpuSSE2|CpuSSE3|CpuSSE4a},
   {".abm", PROCESSOR_UNKNOWN,
-   CpuABM}
+   CpuABM},
+  {".xsave", PROCESSOR_UNKNOWN,
+   CpuXSAVE}
 };
=20
 const pseudo_typeS md_pseudo_table[] =3D
@@ -3988,6 +3990,16 @@
 	      goto check_prefix;
 	    }
 	}
+      else if (i.tm.base_opcode =3D=3D 0x660f3880 || i.tm.base_opcode =3D=
=3D 0x660f3881)
+	{
+	  /* invept and invvpid are 3 byte instructions with a
+	     mandatory prefix. */
+	  if (i.tm.base_opcode & 0xff000000)
+	    {
+	      prefix =3D (i.tm.base_opcode >> 24) & 0xff;
+	      add_prefix (prefix);
+	    }
+	}
       else if ((i.tm.base_opcode & 0xff0000) !=3D 0)
 	{
 	  prefix =3D (i.tm.base_opcode >> 16) & 0xff;
@@ -4027,6 +4039,12 @@
 	      p =3D frag_more (3);
 	      *p++ =3D (i.tm.base_opcode >> 16) & 0xff;
 	    }
+	  else if (i.tm.base_opcode =3D=3D 0x660f3880 ||
+		   i.tm.base_opcode =3D=3D 0x660f3881)
+	    {
+	      p =3D frag_more (3);
+	      *p++ =3D (i.tm.base_opcode >> 16) & 0xff;
+	    }
 	  else
 	    p =3D frag_more (2);
=20
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/binutils/ld/emultempl/ppc=
32elf.em
--- a/head/contrib/binutils/ld/emultempl/ppc32elf.em	Wed Jul 25 16:20:13 20=
12 +0300
+++ b/head/contrib/binutils/ld/emultempl/ppc32elf.em	Wed Jul 25 16:21:35 20=
12 +0300
@@ -119,7 +119,40 @@
 	    }
 	}
     }
+
   gld${EMULATION_NAME}_before_allocation ();
+
+  /* Turn on relaxation if executable sections have addresses that
+     might make branches overflow.  */
+  if (!command_line.relax)
+    {
+      bfd_vma low =3D (bfd_vma) -1;
+      bfd_vma high =3D 0;
+      asection *o;
+
+      /* Run lang_size_sections (if not already done).  */
+      if (expld.phase !=3D lang_mark_phase_enum)
+	{
+	  expld.phase =3D lang_mark_phase_enum;
+	  expld.dataseg.phase =3D exp_dataseg_none;
+	  one_lang_size_sections_pass (NULL, FALSE);
+	  lang_reset_memory_regions ();
+	}
+
+      for (o =3D output_bfd->sections; o !=3D NULL; o =3D o->next)
+	{
+	  if ((o->flags & (SEC_ALLOC | SEC_CODE)) !=3D (SEC_ALLOC | SEC_CODE))
+	    continue;
+	  if (o->rawsize =3D=3D 0)
+	    continue;
+	  if (low > o->vma)
+	    low =3D o->vma;
+	  if (high < o->vma + o->rawsize - 1)
+	    high =3D o->vma + o->rawsize - 1;
+	}
+      if (high > low && high - low > (1 << 25) - 1)
+	command_line.relax =3D TRUE;
+    }
 }
=20
 EOF
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/binutils/opcodes/i386-dis=
.c
--- a/head/contrib/binutils/opcodes/i386-dis.c	Wed Jul 25 16:20:13 2012 +03=
00
+++ b/head/contrib/binutils/opcodes/i386-dis.c	Wed Jul 25 16:21:35 2012 +03=
00
@@ -93,6 +93,7 @@
 static void OP_SIMD_Suffix (int, int);
 static void SIMD_Fixup (int, int);
 static void PNI_Fixup (int, int);
+static void XCR_Fixup (int, int);
 static void SVME_Fixup (int, int);
 static void INVLPG_Fixup (int, int);
 static void BadOp (void);
@@ -212,6 +213,7 @@
 #define Ew { OP_E, w_mode }
 #define M { OP_M, 0 }		/* lea, lgdt, etc. */
 #define Ma { OP_M, v_mode }
+#define Mo { OP_M, o_mode }
 #define Mp { OP_M, f_mode }		/* 32 or 48 bit memory operand for LDS, LES e=
tc */
 #define Mq { OP_M, q_mode }
 #define Gb { OP_G, b_mode }
@@ -539,6 +541,8 @@
 #define PREGRP95  NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 95 } }
 #define PREGRP96  NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 96 } }
 #define PREGRP97  NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 97 } }
+#define PREGRP98  NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 98 } }
+#define PREGRP99  NULL, { { NULL, USE_PREFIX_USER_TABLE }, { NULL, 99 } }
=20
=20
 #define X86_64_0  NULL, { { NULL, X86_64_SPECIAL }, { NULL, 0 } }
@@ -1693,7 +1697,7 @@
   {
     { "sgdt{Q|IQ||}", { { VMX_Fixup, 0 } } },
     { "sidt{Q|IQ||}", { { PNI_Fixup, 0 } } },
-    { "lgdt{Q|Q||}",	 { M } },
+    { "lgdt{Q|Q||}",	 { { XCR_Fixup, 0 }  } },
     { "lidt{Q|Q||}",	 { { SVME_Fixup, 0 } } },
     { "smswD",	{ Sv } },
     { "(bad)",	{ XX } },
@@ -1783,9 +1787,9 @@
     { "fxrstor",	{ Ev } },
     { "ldmxcsr",	{ Ev } },
     { "stmxcsr",	{ Ev } },
-    { "(bad)",		{ XX } },
-    { "lfence",		{ { OP_0fae, 0 } } },
-    { "mfence",		{ { OP_0fae, 0 } } },
+    { "xsave",		{ Ev } },
+    { "xrstor",		{ { OP_0fae, v_mode } } },
+    { "xsaveopt",	{ { OP_0fae, v_mode } } },
     { "clflush",	{ { OP_0fae, 0 } } },
   },
   /* GRP16 */
@@ -2585,6 +2589,22 @@
     { "punpckldq",{ MX, EMq } },
     { "(bad)",	{ XX } },
   },
+
+  /* PREGRP98 */
+  {
+    { "(bad)",	{ XX } },
+    { "(bad)",	{ XX } },
+    { "invept",	{ Gm, Mo } },
+    { "(bad)",	{ XX } },
+  },
+
+  /* PREGRP99 */
+  {
+    { "(bad)",	{ XX } },
+    { "(bad)",	{ XX } },
+    { "invvpid",{ Gm, Mo } },
+    { "(bad)",	{ XX } },
+  },
 };
=20
 static const struct dis386 x86_64_table[][2] =3D {
@@ -2754,8 +2774,8 @@
     { "(bad)", { XX } },
     { "(bad)", { XX } },
     /* 80 */
-    { "(bad)", { XX } },
-    { "(bad)", { XX } },
+    { PREGRP98 },
+    { PREGRP99 },
     { "(bad)", { XX } },
     { "(bad)", { XX } },
     { "(bad)", { XX } },
@@ -5883,7 +5903,7 @@
 OP_M (int bytemode, int sizeflag)
 {
   if (modrm.mod =3D=3D 3)
-    /* bad bound,lea,lds,les,lfs,lgs,lss,cmpxchg8b,vmptrst modrm */
+    /* bad bound,lea,lds,les,lfs,lgs,lss,cmpxchg8b,vmptrst,invept,invvpid =
modrm */
     BadOp ();
   else
     OP_E (bytemode, sizeflag);
@@ -5905,17 +5925,17 @@
     {
       if (modrm.reg =3D=3D 7)
 	strcpy (obuf + strlen (obuf) - sizeof ("clflush") + 1, "sfence");
+      else if (modrm.reg =3D=3D 6)
+	strcpy (obuf + strlen (obuf) - sizeof ("xsaveopt") + 1, "mfence");
+      else if (modrm.reg =3D=3D 5)
+	strcpy (obuf + strlen (obuf) - sizeof ("xrstor") + 1, "lfence");
=20
       if (modrm.reg < 5 || modrm.rm !=3D 0)
 	{
 	  BadOp ();	/* bad sfence, mfence, or lfence */
 	  return;
 	}
-    }
-  else if (modrm.reg !=3D 7)
-    {
-      BadOp ();		/* bad clflush */
-      return;
+      bytemode =3D 0;
     }
=20
   OP_E (bytemode, sizeflag);
@@ -6170,6 +6190,43 @@
 }
=20
 static void
+XCR_Fixup (int extrachar ATTRIBUTE_UNUSED, int sizeflag)
+{
+  if (modrm.mod =3D=3D 3 && modrm.reg =3D=3D 2 && modrm.rm <=3D 1)
+    {
+      /* Override "lgdt".  */
+      size_t olen =3D strlen (obuf);
+      char *p =3D obuf + olen - 4;
+
+      /* We might have a suffix when disassembling with -Msuffix.  */
+      if (*p =3D=3D 'i')
+	--p;
+
+      /* Remove "addr16/addr32" if we aren't in Intel mode.  */
+      if (!intel_syntax
+	  && (prefixes & PREFIX_ADDR)
+	  && olen >=3D (4 + 7)
+	  && *(p - 1) =3D=3D ' '
+	  && CONST_STRNEQ (p - 7, "addr")
+	  && (CONST_STRNEQ (p - 3, "16")
+	      || CONST_STRNEQ (p - 3, "32")))
+	p -=3D 7;
+
+      if (modrm.rm)
+	{
+	  strcpy (p, "xsetbv");
+	}
+      else
+	{
+	  strcpy (p, "xgetbv");
+	}
+
+      codep++;
+    }
+  else
+    OP_M (0, sizeflag);
+}
+static void
 SVME_Fixup (int bytemode, int sizeflag)
 {
   const char *alt;
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/binutils/opcodes/i386-opc=
.h
--- a/head/contrib/binutils/opcodes/i386-opc.h	Wed Jul 25 16:20:13 2012 +03=
00
+++ b/head/contrib/binutils/opcodes/i386-opc.h	Wed Jul 25 16:21:35 2012 +03=
00
@@ -71,6 +71,7 @@
 #define CpuABM       0x200000   /* ABM New Instructions required */
 #define CpuSSE4_1    0x400000	/* SSE4.1 Instructions required */
 #define CpuSSE4_2    0x800000	/* SSE4.2 Instructions required */
+#define CpuXSAVE    0x1000000	/* XSAVE Instructions required */
=20
 /* SSE4.1/4.2 Instructions required */
 #define CpuSSE4	     (CpuSSE4_1|CpuSSE4_2)
@@ -83,7 +84,7 @@
 #define CpuUnknownFlags (Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686 \
 	|CpuP4|CpuSledgehammer|CpuMMX|CpuMMX2|CpuSSE|CpuSSE2|CpuSSE3|CpuVMX \
 	|Cpu3dnow|Cpu3dnowA|CpuK6|CpuPadLock|CpuSVME|CpuSSSE3|CpuSSE4_1 \
-	|CpuSSE4_2|CpuABM|CpuSSE4a)
+	|CpuSSE4_2|CpuABM|CpuSSE4a|CpuXSAVE)
=20
   /* the bits in opcode_modifier are used to generate the final opcode from
      the base_opcode.  These bits also are used to detect alternate forms =
of
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/binutils/opcodes/i386-opc=
.tbl
--- a/head/contrib/binutils/opcodes/i386-opc.tbl	Wed Jul 25 16:20:13 2012 +=
0300
+++ b/head/contrib/binutils/opcodes/i386-opc.tbl	Wed Jul 25 16:21:35 2012 +=
0300
@@ -1289,6 +1289,10 @@
 mwait, 2, 0xf01, 0xc9, CpuSSE3|Cpu64, No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_q=
Suf|No_xSuf|ImmExt|NoRex64, { Reg64, Reg64 }
=20
 // VMX instructions.
+invept, 2, 0x660f3880, None, CpuVMX|CpuNo64, Modrm|IgnoreSize|No_bSuf|No_w=
Suf|No_sSuf|No_qSuf|No_xSuf|NoRex64, { BaseIndex|Disp8|Disp16|Disp32|Disp32=
S, Reg32 }
+invept, 2, 0x660f3880, None, CpuVMX|Cpu64, Modrm|IgnoreSize|No_bSuf|No_wSu=
f|No_sSuf|No_qSuf|No_xSuf|NoRex64, { BaseIndex|Disp8|Disp16|Disp32|Disp32S,=
 Reg64 }
+invvpid, 2, 0x660f3881, None, CpuVMX|CpuNo64, Modrm|IgnoreSize|No_bSuf|No_=
wSuf|No_sSuf|No_qSuf|No_xSuf|NoRex64, { BaseIndex|Disp8|Disp16|Disp32|Disp3=
2S, Reg32 }
+invvpid, 2, 0x660f3881, None, CpuVMX|Cpu64, Modrm|IgnoreSize|No_bSuf|No_wS=
uf|No_sSuf|No_qSuf|No_xSuf|NoRex64, { BaseIndex|Disp8|Disp16|Disp32|Disp32S=
, Reg64 }
 vmcall, 0, 0xf01, 0xc1, CpuVMX, No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No=
_xSuf|ImmExt, { 0 }
 vmclear, 1, 0x660fc7, 0x6, CpuVMX, Modrm|IgnoreSize|No_bSuf|No_wSuf|No_lSu=
f|No_sSuf|No_qSuf|No_xSuf|NoRex64, { BaseIndex|Disp8|Disp16|Disp32|Disp32S }
 vmlaunch, 0, 0xf01, 0xc2, CpuVMX, No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|=
No_xSuf|ImmExt, { 0 }
@@ -1487,3 +1491,10 @@
 xcryptofb, 0, 0xf30fa7, 0xe8, Cpu686|CpuPadLock, No_bSuf|No_wSuf|No_lSuf|N=
o_sSuf|No_qSuf|No_xSuf|IsString|ImmExt, { 0 }
 // Alias for xstore-rng.
 xstore, 0, 0xfa7, 0xc0, Cpu686|CpuPadLock, No_bSuf|No_wSuf|No_lSuf|No_sSuf=
|No_qSuf|No_xSuf|IsString|ImmExt, { 0 }
+
+// XSAVE/XRSTOR related instructions
+xgetbv, 0, 0xf01, 0xd0, CpuXSAVE, No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|=
No_xSuf|ImmExt, { 0 }
+xsetbv, 0, 0xf01, 0xd1, CpuXSAVE, No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|=
No_xSuf|ImmExt, { 0 }
+xsave, 1, 0xfae, 0x4, CpuXSAVE, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_x=
Suf, { BaseIndex|Disp8|Disp16|Disp32|Disp32S }
+xsaveopt, 1, 0xfae, 0x6, CpuXSAVE, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|N=
o_xSuf, { BaseIndex|Disp8|Disp16|Disp32|Disp32S }
+xrstor, 1, 0xfae, 0x5, CpuXSAVE, Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_=
xSuf, { BaseIndex|Disp8|Disp16|Disp32|Disp32S }
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/binutils/opcodes/i386-tbl=
.h
--- a/head/contrib/binutils/opcodes/i386-tbl.h	Wed Jul 25 16:20:13 2012 +03=
00
+++ b/head/contrib/binutils/opcodes/i386-tbl.h	Wed Jul 25 16:21:35 2012 +03=
00
@@ -3625,6 +3625,22 @@
     No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf|ImmExt|NoRex64,
     { Reg64,
       Reg64 } },
+  { "invept", 2, 0x660f3880, None, CpuVMX|CpuNo64,
+    Modrm|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|No_qSuf|No_xSuf|NoRex64,
+    { BaseIndex|Disp8|Disp16|Disp32|Disp32S,
+      Reg32 } },
+  { "invept", 2, 0x660f3880, None, CpuVMX|Cpu64,
+    Modrm|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|No_qSuf|No_xSuf|NoRex64,
+    { BaseIndex|Disp8|Disp16|Disp32|Disp32S,
+      Reg64 } },
+  { "invvpid", 2, 0x660f3881, None, CpuVMX|CpuNo64,
+    Modrm|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|No_qSuf|No_xSuf|NoRex64,
+    { BaseIndex|Disp8|Disp16|Disp32|Disp32S,
+      Reg32 } },
+  { "invvpid", 2, 0x660f3881, None, CpuVMX|Cpu64,
+    Modrm|IgnoreSize|No_bSuf|No_wSuf|No_sSuf|No_qSuf|No_xSuf|NoRex64,
+    { BaseIndex|Disp8|Disp16|Disp32|Disp32S,
+      Reg64 } },
   { "vmcall", 0, 0xf01, 0xc1, CpuVMX,
     No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf|ImmExt,
     { 0 } },
@@ -4288,6 +4304,21 @@
   { "xstore", 0, 0xfa7, 0xc0, Cpu686|CpuPadLock,
     No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf|IsString|ImmExt,
     { 0 } },
+  { "xgetbv", 0, 0xf01, 0xd0, CpuXSAVE,
+    No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf|ImmExt,
+    { 0 } },
+  { "xsetbv", 0, 0xf01, 0xd1, CpuXSAVE,
+    No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_xSuf|ImmExt,
+    { 0 } },
+  { "xsave", 1, 0xfae, 0x4, CpuXSAVE,
+    Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_xSuf,
+    { BaseIndex|Disp8|Disp16|Disp32|Disp32S } },
+  { "xsaveopt", 1, 0xfae, 0x6, CpuXSAVE,
+    Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_xSuf,
+    { BaseIndex|Disp8|Disp16|Disp32|Disp32S } },
+  { "xrstor", 1, 0xfae, 0x5, CpuXSAVE,
+    Modrm|No_bSuf|No_wSuf|No_lSuf|No_sSuf|No_xSuf,
+    { BaseIndex|Disp8|Disp16|Disp32|Disp32S } },
   { NULL, 0, 0, 0, 0, 0, { 0 } }
 };
=20
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/bsnmp/lib/bsnmpclient.3
--- a/head/contrib/bsnmp/lib/bsnmpclient.3	Wed Jul 25 16:20:13 2012 +0300
+++ b/head/contrib/bsnmp/lib/bsnmpclient.3	Wed Jul 25 16:21:35 2012 +0300
@@ -368,7 +368,7 @@
 and appends the length of the string (as computed by
 .Xr strlen 3 )
 and each of the characters in the string to the OID.
-.It Li ( Va N Ns Li )
+.It ( Va N Ns )
 This format expects no argument.
 .Va N
 must be a decimal number and is stored into an internal variable
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/bsnmp/lib/bsnmplib.3
--- a/head/contrib/bsnmp/lib/bsnmplib.3	Wed Jul 25 16:20:13 2012 +0300
+++ b/head/contrib/bsnmp/lib/bsnmplib.3	Wed Jul 25 16:21:35 2012 +0300
@@ -161,7 +161,6 @@
 .Fa v.octetstring.octets
 points to a string allocated by
 .Xr malloc 3 .
-.Pp
 .Bd -literal -offset indent
 #define	SNMP_ENGINE_ID_SIZ		32
=20
@@ -176,7 +175,6 @@
 .Pp
 This structure represents an SNMP engine as specified by the SNMP Manageme=
nt
 Architecture described in RFC 3411.
-.Pp
 .Bd -literal -offset indent
 #define	SNMP_ADM_STR32_SIZ		(32 + 1)
 #define	SNMP_AUTH_KEY_SIZ		40
@@ -225,7 +223,6 @@
 and
 .Fa priv_key
 contain the authentication and privacy keys for the user.
-.Pp
 .Bd -literal -offset indent
 #define SNMP_COMMUNITY_MAXLEN		128
 #define SNMP_MAX_BINDINGS		100
@@ -389,7 +386,7 @@
 The function
 .Fn snmp_pdu_init_secparams
 calculates the initialization vector for the privacy protocol in use before
-the PDU pointed to by=20
+the PDU pointed to by
 .Fa pdu
 may be encrypted or decrypted.
 .Pp
@@ -504,7 +501,7 @@
 The library may optionally be built without references to the
 .Xr crypto 3
 library. In such case only plain text SNMPv3 PDUs without message digests
-may be proccessed correctly.=20
+may be proccessed correctly.
 .Sh STANDARDS
 This implementation conforms to the applicable IETF RFCs and ITU-T
 recommendations.
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/bsnmp/snmp_mibII/mibII_tc=
p.c
--- a/head/contrib/bsnmp/snmp_mibII/mibII_tcp.c	Wed Jul 25 16:20:13 2012 +0=
300
+++ b/head/contrib/bsnmp/snmp_mibII/mibII_tcp.c	Wed Jul 25 16:21:35 2012 +0=
300
@@ -109,10 +109,12 @@
              ptr =3D (struct xinpgen *)(void *)((char *)ptr + ptr->xig_len=
)) {
 		tp =3D (struct xtcpcb *)ptr;
 		if (tp->xt_inp.inp_gencnt > xinpgen->xig_gen ||
-		    (tp->xt_inp.inp_vflag & INP_IPV4) =3D=3D 0)
+		    (tp->xt_inp.inp_vflag & (INP_IPV4|INP_IPV6)) =3D=3D 0)
 			continue;
=20
-		tcp_total++;
+		if (tp->xt_inp.inp_vflag & INP_IPV4)
+			tcp_total++;
+
 		if (tp->xt_tp.t_state =3D=3D TCPS_ESTABLISHED ||
 		    tp->xt_tp.t_state =3D=3D TCPS_CLOSE_WAIT)
 			tcp_count++;
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/bsnmp/snmp_target/snmp_ta=
rget.3
--- a/head/contrib/bsnmp/snmp_target/snmp_target.3	Wed Jul 25 16:20:13 2012=
 +0300
+++ b/head/contrib/bsnmp/snmp_target/snmp_target.3	Wed Jul 25 16:21:35 2012=
 +0300
@@ -26,14 +26,14 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.\" $FreeBSD$
+.\" $FreeBSD: head/contrib/bsnmp/snmp_target/snmp_target.3 237193 2012-06-=
17 11:33:55Z joel $
 .\"
 .Dd December 16, 2010
 .Dt SNMP_TARGET 3
 .Os
 .Sh NAME
 .Nm snmp_target
-.Nd "Target addresses and notifications module for
+.Nd "Target addresses and notifications module for"
 .Xr bsnmpd 1
 .Sh LIBRARY
 .Pq begemotSnmpdModulePath."target" =3D "/usr/lib/snmp_target.so"
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/bsnmp/snmp_usm/snmp_usm.3
--- a/head/contrib/bsnmp/snmp_usm/snmp_usm.3	Wed Jul 25 16:20:13 2012 +0300
+++ b/head/contrib/bsnmp/snmp_usm/snmp_usm.3	Wed Jul 25 16:21:35 2012 +0300
@@ -26,14 +26,14 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.\" $FreeBSD: head/contrib/bsnmp/snmp_usm/snmp_usm.3 224584 2011-08-01 22:=
21:18Z uqs $
+.\" $FreeBSD: head/contrib/bsnmp/snmp_usm/snmp_usm.3 237194 2012-06-17 11:=
36:28Z joel $
 .\"
 .Dd September 9, 2010
 .Dt SNMP_USM 3
 .Os
 .Sh NAME
 .Nm snmp_usm
-.Nd "user-based security module for
+.Nd "user-based security module for"
 .Xr bsnmpd 1
 .Sh LIBRARY
 .Pq begemotSnmpdModulePath."usm" =3D "/usr/lib/snmp_usm.so"
@@ -57,7 +57,7 @@
 altering the SNMP USM users.
 .It Va usmUserTable
 The table contains all SNMP USM users configured in
-.Nm bsnmpd.
+.Nm bsnmpd .
 The table contains the following objects
 .Bl -tag -width ".It Va usmUserEngineID"
 .It Va usmUserEngineID
@@ -79,7 +79,7 @@
 .It Va usmUserAuthProtocol
 The value of this column contains the OID corresponding to the authenticat=
ion
 protocol used by the USM user. The following protocols and their OIDs are =
known to
-.Nm=20
+.Nm
 module
 .Bl -tag -width ".It Va NoAuthProtocol"
 .It NoAuthProtocol 1.3.6.1.6.3.10.1.1.1
@@ -91,7 +91,7 @@
 .It Va usmUserPrivProtocol
 The value of this column contains the OID corresponding to the privacy
 protocol used by the USM user. The following protocols and their OIDs are =
known to
-.Nm=20
+.Nm
 module
 .Bl -tag -width ".It Va NoPrivProtocol"
 .It NoPrivProtocol 1.3.6.1.6.3.10.1.2.1
@@ -102,7 +102,7 @@
 These columns may be used to change the user's privacy key.
 .It Va usmUserPublic
 An arbitrary octet string that may be modified to confirm a SET operation =
on any
-of the columns was successfull.
+of the columns was successful.
 .It Va usmUserStorageType
 This column always has either of two values. Entries created via
 .Nm bsnmpd's
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/bsnmp/snmp_vacm/snmp_vacm=
.3
--- a/head/contrib/bsnmp/snmp_vacm/snmp_vacm.3	Wed Jul 25 16:20:13 2012 +03=
00
+++ b/head/contrib/bsnmp/snmp_vacm/snmp_vacm.3	Wed Jul 25 16:21:35 2012 +03=
00
@@ -26,14 +26,14 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.\" $FreeBSD$
+.\" $FreeBSD: head/contrib/bsnmp/snmp_vacm/snmp_vacm.3 237193 2012-06-17 1=
1:33:55Z joel $
 .\"
 .Dd October 7, 2010
 .Dt SNMP_VACM 3
 .Os
 .Sh NAME
 .Nm snmp_vacm
-.Nd "View-based Access Control module for
+.Nd "View-based Access Control module for"
 .Xr bsnmpd 1
 .Sh LIBRARY
 .Pq begemotSnmpdModulePath."vacm" =3D "/usr/lib/snmp_vacm.so"
@@ -76,7 +76,7 @@
 .It Va vacmViewTreeFamilyTable
 The table contains a list of SNMP views, i.e. entries specifying the OID o=
f a
 MIB subtree and whether access to the objects under this subtree is to be
-allowed or forbiden.
+allowed or forbidden.
 .El
 .Sh FILES
 .Bl -tag -width "XXXXXXXXX"
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/ACKNOWLEDGEMENTS
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/ACKNOWLEDGEMENTS	Wed Jul 25 16:21:35 2012 +0300
@@ -0,0 +1,25 @@
+     Berkeley Yacc owes much to the unflagging efforts of Keith Bostic.
+His badgering kept me working on it long after I was ready to quit.
+
+     Berkeley Yacc is based on the excellent algorithm for computing LALR(=
1)
+lookaheads developed by Tom Pennello and Frank DeRemer.  The algorithm is
+described in their almost impenetrable article in TOPLAS 4,4.
+
+     Finally, much of the credit for the latest version must go to those
+who pointed out deficiencies of my earlier releases.  Among the most
+prolific contributors were
+
+	  Benson I. Margulies
+	  Dave Gentzel
+	  Antoine Verheijen
+	  Peter S. Housel
+	  Dale Smith
+	  Ozan Yigit
+	  John Campbell
+	  Bill Sommerfeld
+	  Paul Hilfinger
+	  Gary Bridgewater
+	  Dave Bakken
+	  Dan Lanciani
+	  Richard Sargent
+	  Parag Patel
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/AUTHORS
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/AUTHORS	Wed Jul 25 16:21:35 2012 +0300
@@ -0,0 +1,7 @@
+-- $Id: AUTHORS,v 1.1 2010/06/06 20:31:51 tom Exp $
+-- vile:txtmode
+-- This file is used by a script that collects contributor information and
+-- resolves nicknames vs fullnames.
+dickey	Thomas Dickey
+schmitz	Sylvain Schmitz
+unknown	Robert Corbett
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/CHANGES
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/CHANGES	Wed Jul 25 16:21:35 2012 +0300
@@ -0,0 +1,1156 @@
+2012-01-15  Thomas E. Dickey  <tom at invisible-island.net>
+
+	* package/debian/copyright: bump
+
+	* test/run_make.sh: workaround for breakage due to GNU make 3.82
+
+	* test/run_make.sh:
+	tested with Solaris 10 (bison 1.875) and added scripting to exercise
+	the /usr/ccs/bin/yacc executable
+
+	* test/grammar.tab.c: regen
+
+	* test/grammar.y: modify to also build with Solaris yacc
+
+	* VERSION, package/debian/changelog, package/byacc.spec: bump
+
+	* test/calc1.output, test/calc1.tab.c: regen
+
+	* test/calc1.y:
+	undo the change made to appease bison, since it was only a warning.
+
+	* test/pure_calc.tab.c, test/pure_error.tab.c: regen
+
+	* test/run_make.sh: another fix for running from top-level directory
+
+	* makefile.in:
+	ensure that check_make rule depends on having byacc built.
+
+	* test/run_make.sh: fixes for building from parent directory
+
+	* test/pure_error.y, test/pure_calc.y: bison-fixes
+
+	* test/calc2.tab.c, test/calc3.tab.c, test/code_error.code.c, test/ftp.ta=
b.c, test/pure_calc.tab.c, test/pure_error.tab.c:
+	regen
+
+	* test/calc2.y, test/calc3.y, test/code_error.y, test/ftp.y:
+	byacc already declares yyerror
+
+	* test/pure_error.y, test/pure_calc.y:
+	modified to help make the files build with bison
+
+	* test/run_make.sh:
+	supply a "%pure-parser" directive when bison needs it.
+
+	* test/code_calc.code.c: regen
+
+	* test/code_calc.y: modified to help make the files build with bison
+
+	* yacc.1:
+	in testing, found that %expect did not work as documented for bison.
+	do not recommend it for portable code.
+
+	* test/run_make.sh: workaround breakage in bison's %expect directive
+
+	* test/grammar.y: modified to help make the files build with bison
+
+	* test/calc1.output, test/calc1.tab.c, test/grammar.tab.c: regen
+
+	* test/calc1.y: quiet a spurious warning from bison 2.3
+
+	* test/calc1.tab.c: regen
+
+	* test/calc1.y: modified to help make the files build with bison
+
+	* yacc.1: comment on "-y" and "-P" options.
+
+	* yacc.1: comment on portability
+
+	* test/ftp.tab.c, test/quote_calc-s.tab.c, test/quote_calc.tab.c, test/qu=
ote_calc2-s.tab.c, test/quote_calc3-s.tab.c:
+	regen
+
+	* test/ftp.y: modified to help make the files build with bison
+	(bison's "-y" option is of no use in providing "yacc" compatibility)
+
+	* test/quote_calc2.tab.c, test/quote_calc3.tab.c, test/quote_calc4-s.tab.=
c, test/quote_calc4.tab.c:
+	regen
+
+	* test/code_calc.y, test/quote_calc2.y, test/quote_calc.y, test/quote_cal=
c4.y, test/quote_calc3.y:
+	modified to help make the files build with bison
+
+	* test/calc.tab.c: regen
+
+	* test/calc.y: modified to help make the files build with bison
+
+	* test/error.tab.c: regen
+
+	* test/error.y: modified to help make the files build with bison
+
+	* test/calc2.tab.c, test/calc3.tab.c, test/code_error.code.c: regen
+
+	* test/run_make.sh:
+	check for older bisons which (2.3 for instance) do not support pure parse=
rs
+
+	* test/code_error.y, test/calc3.y, test/calc2.y:
+	modified to help make the files build with bison
+
+	* test/run_test.sh: use $opt2 in filenames of the generated files
+
+	* test/quote_calc2-s.tab.c, test/quote_calc3-s.tab.c, test/quote_calc4-s.=
tab.c, test/quote_calc-s.tab.c, test/quote_calc.tab.c, test/quote_calc2.tab=
.c, test/quote_calc3.tab.c, test/quote_calc4.tab.c:
+	regen
+
+2012-01-14  Thomas E. Dickey  <tom at invisible-island.net>
+
+	* test/calc2.tab.c, test/code_calc.code.c, test/code_error.code.c, test/e=
rror.tab.c, test/ftp.tab.c, test/grammar.tab.c, test/calc.tab.c, test/calc1=
.tab.c:
+	regen
+
+	* output.c: Several changes:
+		a) add YYLEX_PARAM_TYPE, like YYPARSE_PARAM_TYPE, but for yylex.
+		b) modify definitions for YYLEX_DECL to be more like YYPARSE_DECL,
+		   using YYLEX_PARAM_TYPE and YYLEX_PARAM.
+		c) add ifdef's around #define's for YYERROR_DECL and YYERROR_CALL,
+		   to help with redefinitions.
+
+	* test/pure_calc.tab.c:
+	modified to help make the files build with bison
+
+	* test/run_make.sh:
+	start work on followup, to check if the generated files build with bison.
+
+	* test/pure_calc.y, test/pure_error.tab.c:
+	modified to help make the files build with bison
+
+	* test/calc3.tab.c: regen
+
+	* test/quote_calc-s.output, test/quote_calc-s.tab.c, test/quote_calc-s.ta=
b.h, test/quote_calc2-s.output, test/quote_calc2-s.tab.c, test/quote_calc2-=
s.tab.h, test/quote_calc3-s.output, test/quote_calc3-s.tab.c, test/quote_ca=
lc3-s.tab.h, test/quote_calc4-s.output, test/quote_calc4-s.tab.c, test/quot=
e_calc4-s.tab.h:
+	RCS_BASE
+
+	* test/run_test.sh: generate/test with "-s" option applied.
+
+2012-01-13  Thomas E. Dickey  <tom at invisible-island.net>
+
+	* package/debian/changelog, package/byacc.spec, VERSION: bump
+
+	* yacc.1: improve documentation of -s option
+
+	* yacc.1: note that yacc ignores -y
+
+	* main.c: add -s option to usage message.
+
+	* test/quote_calc3.output, test/quote_calc3.tab.c, test/quote_calc4.outpu=
t, test/quote_calc4.tab.c, test/quote_calc4.tab.h, test/quote_calc3.y, test=
/quote_calc.tab.h, test/quote_calc.output, test/quote_calc.tab.c, test/quot=
e_calc2.output, test/quote_calc2.tab.c, test/quote_calc2.tab.h, test/quote_=
calc3.tab.h, test/quote_calc4.y, test/quote_calc.y, test/quote_calc2.y:
+	RCS_BASE
+
+	* configure: regen
+
+	* aclocal.m4: resync with my-autoconf, i.e., fixes for CF_XOPEN_SOURCE
+
+2011-12-19  Thomas E. Dickey  <tom at invisible-island.net>
+
+	* package/debian/changelog, package/byacc.spec, VERSION: bump
+
+	* yacc.1, output.c, main.c, defs.h:
+	add "-s" option to suppress generating #define's based on string contents
+	in a %token statement.  For instance
+		%token EQLS "Equals"
+	would generate
+		#define EQLS 256
+		#define Equals 257
+	Simply suppressing the second #define makes the behavior closer to yacc.
+	(report by Paulo Andrade).
+
+2011-09-08  Thomas E. Dickey  <tom at 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 at 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/c=
alc1.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 at 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 at 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 at invisible-island.net>
+
+	* config.sub: 2011-04-01
+
+2011-02-02  Thomas E. Dickey  <tom at invisible-island.net>
+
+	* config.guess: 2011-01-01
+
+2010-12-29  Thomas E. Dickey  <tom at invisible-island.net>
+
+	* defs.h, skeleton.c:
+	add const qualifier to skeleton data, per NetBSD changes (report by Chris=
tos Zoulas)
+
+	* defs.h:
+	mark all of the error-functions as non-returning (report by Christos Zoul=
as)
+
+	* test/grammar.tab.c, test/pure_calc.tab.c, test/pure_error.tab.c, test/c=
alc.tab.c, test/calc1.tab.c, test/calc2.tab.c, test/calc3.tab.c, test/code_=
calc.code.c, test/code_error.code.c, test/error.tab.c, test/ftp.tab.c:
+	regen
+
+	* skeleton.c:
+	use only realloc() rather than realloc+malloc, agree that systems needing=
 this
+	are very rare (prompted by NetBSD change).
+
+	* test/ftp.tab.c: regen
+
+2010-12-29  Christos.Zoulas
+
+	* test/ftp.y:
+	improve example, which was stuck in 19XX and assumed file sizes were long=
s.
+
+2010-12-29  Thomas E. Dickey  <tom at invisible-island.net>
+
+	* test/ftp.tab.c, test/grammar.tab.c, test/pure_calc.tab.c, test/pure_err=
or.tab.c, test/calc.tab.c, test/calc1.tab.c, test/calc2.tab.c, test/calc3.t=
ab.c, test/code_calc.code.c, test/code_error.code.c, test/error.tab.c:
+	regen
+
+	* test/pure_error.y, test/pure_calc.y, test/ftp.y, test/error.y, test/cod=
e_error.y, test/code_calc.y, test/calc.y, test/calc3.y, test/calc2.y, test/=
calc1.y:
+	use byacc's YYLEX_DECL/YYERROR_DECL symbols to prototype yylex/yyerror
+
+	* skeleton.c:
+	remove explicit prototype for yylex() via YYLEX_DECL() macro, since that
+	would prevent declaring yylex() static (request by Christos Zoulas).
+
+	* test/calc2.tab.c, test/calc3.tab.c: regen
+
+2010-12-29  Christos.Zoulas
+
+	* output.c: correct definition for YYERROR_DECL()
+
+2010-12-29  Thomas E. Dickey  <tom at invisible-island.net>
+
+	* package/debian/changelog, package/byacc.spec, VERSION: bump
+
+2010-12-26  Thomas E. Dickey  <tom at invisible-island.net>
+
+	* defs.h, main.c:
+	change return-type of allocate() to avoid warnings of alignment problems
+
+	* main.c: Solaris declares chmod() in <sys/stat.h>
+
+	* configure: regen
+
+	* main.c: ifdef'd use of fcntl.h
+
+	* configure.in: add configure checks for fcntl.h, atexit and mkstemp
+
+	* main.c: for cases where mkstemp() is not available, use tempnam/open
+
+	* aclocal.m4: add CF_MKSTEMP
+
+	* aclocal.m4:
+	improve quoting, deprecate ${name-value} in favor of standard ${name:-val=
ue}
+
+2010-12-25  Thomas E. Dickey  <tom at invisible-island.net>
+
+	* main.c:
+	start revising use of tmpfile(), to make this work with MinGW.  Start by
+	implementing a mkstemp() alternative - noting that mkstemp() also is brok=
en
+	for MinGW.
+
+	* package/debian/changelog, package/byacc.spec, VERSION: bump
+
+2010-11-27  Thomas E. Dickey  <tom at invisible-island.net>
+
+	* package/byacc.spec, package/debian/changelog, VERSION: bump
+
+	* test/calc2.tab.c, test/calc3.tab.c: regen
+
+	* output.c:
+	corrected use of %parse-param value in yyerror(); it doesn't use &yylval
+	(report by Clifford Yapp)
+
+2010-11-26  Thomas E. Dickey  <tom at invisible-island.net>
+
+	* skeleton.c: typo
+
+	* output.c:
+	correct line-numbering when "-r" option is used; the 'outline' variable
+	should only be incremented when writing to the code-file.
+
+	* test/code_calc.code.c, test/code_error.code.c: regen
+
+	* yacc.1: bump date
+
+	* yacc.1: comment on -b option vs -r
+
+	* test/calc2.tab.c, test/calc2.y, test/calc3.tab.c, test/calc3.y, test/ft=
p.tab.c, test/grammar.tab.c, test/pure_calc.tab.c, test/pure_error.tab.c, t=
est/calc.tab.c, test/calc1.tab.c, test/code_calc.code.c, test/code_error.co=
de.c, test/error.tab.c:
+	regen
+
+	* output.c:
+	improve on YYERROR_DECL(), adding dummy params which can be used for the
+	actual function declaration.  Also add YYERROR_CALL().  The two macros
+	simplify maintaining sets of grammars which may/may not be pure.
+
+	* test/calc1.y, test/ftp.tab.c, test/grammar.tab.c, test/pure_calc.tab.c,=
 test/pure_error.tab.c, test/calc.tab.c, test/calc1.tab.c, test/calc2.tab.c=
, test/calc3.tab.c, test/code_calc.code.c, test/code_error.code.c, test/err=
or.tab.c:
+	regen
+
+	* output.c: generate yyerror() calls in output.c
+	This is for compatibility with bison, which passes the yylval to yyerror
+	when the %parse-param feature is used.
+
+	* skeleton.c, defs.h: generate yyerror() calls in output.c
+
+	* output.c: simplified a little, using putc_code() and putl_code()
+
+	* test/calc1.tab.h: regen
+
+	* reader.c:
+	improve ifdef for YYSTYPE union declaration (report by Clifford Yapp)
+
+	* reader.c:
+	accept underscore as a replacement for dash in command names, e.g.,
+	"%pure_parser" vs "%pure-parser".
+
+	* test/calc1.tab.c: regen
+
+	* output.c, reader.c:
+	also ifdef YYSTYPE declaration in the generated code (report by Clifford =
Yapp)
+
+	* package/debian/changelog, package/byacc.spec, VERSION: bump
+
+2010-11-24  Thomas E. Dickey  <tom at invisible-island.net>
+
+	* main.c, defs.h, symtab.c, error.c: reduce global variables
+
+	* package/debian/changelog, package/byacc.spec, VERSION: bump
+
+	* reader.c:
+	amend fix for Redhat #112617 to still call default_action_warning() for
+	empty rules (report by Bruce Cran).
+
+2010-11-22  Thomas E. Dickey  <tom at invisible-island.net>
+
+	* output.c:
+	add ifdef to guard against redefinition of YYSTYPE union (request by Clif=
ford Yapp).
+
+	* test/calc1.tab.c: regen
+
+	* test/calc1.y: cleanup compiler warnings
+
+	* test/grammar.y: add "%expect"
+
+	* test/calc1.tab.h: regen
+
+	* test/calc1.output, test/calc1.tab.c, test/calc1.tab.h: RCS_BASE
+
+	* test/calc2.tab.c, test/calc3.tab.c: regen
+
+	* test/calc1.y:
+	advanced example from Steve Johnson's paper, uses unions
+
+	* test/calc3.y, test/calc2.y: init 'base', so examples can run
+
+	* test/ftp.tab.c, test/ftp.y: tweaks to compile with g++
+
+	* output.c: compensate for fix in reader.c
+
+	* reader.c:
+	add/use putc_both() and puts_both(), incidentally fixing a place where
+	a union copied to the union_file may be missing the end of the last line.
+
+	* package/debian/changelog, package/byacc.spec, VERSION: bump
+
+2010-09-28  Thomas E. Dickey  <tom at invisible-island.net>
+
+	* config.guess: 2010-09-24
+
+2010-09-10  Thomas E. Dickey  <tom at invisible-island.net>
+
+	* config.sub: 2010-09-11
+
+2010-06-10  Thomas E. Dickey  <tom at invisible-island.net>
+
+	* yacc.1, package/debian/changelog, package/byacc.spec, VERSION:
+	bump to 2010/06/10
+
+2010-06-09  Thomas E. Dickey  <tom at invisible-island.net>
+
+	* reader.c: free declarations in leak-testing code.
+
+	* main.c: close code_file if -r option used, for leak-testing
+
+	* defs.h, reader.c:
+	improve %lex-param / %parse-param implementation by allowing for arrays to
+	be passed as parameters, e.g., "int regs[26]".
+
+	* test/calc3.tab.c, test/calc3.y, test/calc3.output, test/calc3.tab.h, te=
st/calc2.tab.c, test/calc2.y, test/calc2.tab.h, test/calc2.output:
+	RCS_BASE
+
+	* output.c:
+	improve %lex-param / %parse-param implementation by allowing for arrays to
+	be passed as parameters, e.g., "int regs[26]".
+
+	* test/calc.tab.c, test/calc.y:
+	test-cases and reference files for %lex-param / %parse-param
+
+	* makefile.in: add docs-rule, for html/pdf/txt form of manpage
+
+	* configure: regen
+
+	* aclocal.m4: add CF_XOPEN_SOURCE, etc.
+
+	* configure.in:
+	use CF_XOPEN_SOURCE check to ensure that strdup is in scope, e.g., for c89
+
+	* test/ftp.tab.c, test/ftp.y, reader.c, symtab.c, verbose.c, lr0.c, main.=
c, mkpar.c, output.c, defs.h, closure.c:
+	fix warnings from clang --analyze
+
+2010-06-08  Thomas E. Dickey  <tom at invisible-island.net>
+
+	* output.c: fix to build with c89, etc.
+
+	* reader.c: gcc warning
+
+	* test/ftp.tab.c, test/ftp.y, test/calc.tab.c, test/code_calc.code.c, tes=
t/code_error.code.c, test/code_error.y, test/code_calc.y, test/calc.y, test=
/pure_error.tab.c, test/error.tab.c, test/error.y, test/pure_error.y, test/=
pure_calc.tab.c, test/pure_calc.y:
+	modified test-cases to allow them to compile, to validate pure-parser cha=
nges.
+	updated reference files to match.
+
+	* output.c:
+	move call for output_stype() earlier since it is used in pure-parser decl=
arations
+
+	* test/grammar.tab.c, test/grammar.y:
+	modified test-cases to allow them to compile, to validate pure-parser cha=
nges.
+	updated reference files to match.
+
+	* test/calc.tab.c, test/error.tab.c, test/ftp.tab.c, test/grammar.tab.c:
+	regen
+
+	* yacc.1: document %lex-param and %parse-param
+
+	* test/run_lint.sh, test/run_make.sh: RCS_BASE
+
+	* test/run_test.sh:
+	further modify to allow build-directory to be in a different location by
+	passing this directory's location as a parameter to the script.
+
+	* makefile.in:
+	add check_make and check_lint rules to help validate the generated files
+	in the test-directory
+
+2010-06-07  Thomas E. Dickey  <tom at invisible-island.net>
+
+	* test/pure_calc.tab.c, test/pure_error.tab.c: RCS_BASE
+
+	* test/run_test.sh:
+	provide for testing -r and -P options by checking if the ".y" filename
+	begins with "code_" or "pure_", respectively.
+
+	* test/code_error.code.c, test/code_error.tab.c, test/code_error.tab.h, t=
est/code_calc.code.c, test/code_calc.tab.c, test/code_calc.tab.h, test/pure=
_calc.output, test/pure_calc.tab.h, test/pure_error.output, test/pure_error=
.tab.h, test/code_calc.output, test/code_error.output:
+	RCS_BASE
+
+	* test/error.tab.c, test/ftp.tab.c, test/grammar.tab.c: regen
+
+	* test/run_test.sh:
+	changes to support running "make check" in a separate build-tree
+
+	* main.c: add "-P" to usage message
+
+	* reader.c: use UCH() macro to hide casts.
+
+2010-06-07  Andres.Mejia
+
+	* main.c, output.c, reader.c, defs.h, skeleton.c:
+	Fix the output order of the generated parse code file.  This allows for
+	the use of YYPARSE_PARAM, by having the output that checks for
+	YYPARSE_PARAM to be defined come after the C code block in the
+	definitions section of a yacc file.
+
+	Implement support for YYLEX_PARAM, similar to bison.  This is useful for
+	support for building reentrant lexers with flex.
+
+	Fix a compatibility issue with bison's pure-parser option.  Bison
+	defines yylex as sending at least one parameter, &yylval, as the first
+	parameter and doesn't seem to have an easy way to remove that parameter.
+	This on the other hand is rather convenient to support saving to yylval
+	from flex when building reentrant lexers and parsers.
+
+	Add support for the %parse-param and %lex-param directives used in
+	bison.  This change bears some similarity to NetBSD's changes to byacc
+	at http://www.mail-archive.com/[email protected]/msg08143.ht=
ml
+
+	Bison allows for POSIX yacc emulation via a yacc directive in the yacc
+	file, and also via a command line switch.  Implement this feature as a
+	no-op for byacc, since byacc is designed to be POSIX yacc compatible
+	anyway.  This allows for better compatibility with yacc sources written
+	for bison.
+
+2010-06-07  Thomas E. Dickey  <tom at invisible-island.net>
+
+	* VERSION: bump to 2010/06/07
+
+2010-06-06  Thomas E. Dickey  <tom at invisible-island.net>
+
+	* test/calc.tab.c, configure: regen
+
+	* skeleton.c:
+	move #include's down into the generated code, to allow user-defined code
+	to override feature definitions, particularly with stdlib.h (request by
+	Marcus Kool).
+
+	* lr0.c, error.c, reader.c, defs.h:
+	strict gcc 3.4.6 warnings on 64-bit platform
+
+	* aclocal.m4, configure.in: add check for lint
+
+	* makefile.in: add lint rule
+
+	* defs.h, closure.c, lr0.c, warshall.c, main.c:
+	fix gcc warnings, mostly for 64-bit platform
+
+	* aclocal.m4:
+	add macros for checking ctags/etags, e.g., to work with NetBSD pkgsrc
+
+	* makefile.in: add etags/TAGS if available
+
+	* configure.in: add configure check for actual ctags and etags programs
+
+	* package/debian/copyright: add copyright notices for non-PD files
+
+	* package/debian/changelog:
+	incorporated scripts in upstream to use for test-builds
+
+	* makefile.in: drop mkdirs.sh, just use "mkdir -p"
+
+	* AUTHORS: nicknames for some contributors (see CHANGES for details)
+
+	* package/byacc.spec: RPM file for byacc
+
+	* VERSION: bump to 2010/06/06
+
+	* aclocal.m4: add copyright notice, from "my-autoconf" macros
+		http://invisible-island.net/autoconf/autoconf.html
+
+	* package/RCS, package/debian/RCS, package/debian/source/RCS, package/pkg=
src/RCS:
+	PERMIT FILE
+
+	* aclocal.m4: resync with my-autoconf.  summary of changes:
+		a) CF_ADD_CFLAGS, etc., improve quoting of ifelse() parameter
+		b) CF_DISABLE_ECHO, change indent-convention for substituted makefile
+		c) CF_GCC_VERSION, ignore stderr
+		d) CF_GCC_WARNINGS, adjust options to work with c89 wrapper of gcc
+
+2010-04-20  Thomas E. Dickey  <tom at invisible-island.net>
+
+	* package/debian/changelog, package/debian/compat, package/debian/control=
, package/debian/copyright, package/debian/docs, package/debian/postinst, p=
ackage/debian/prerm, package/debian/rules, package/debian/watch:
+	scripts from Debian package
+
+2010-02-16  Thomas E. Dickey  <tom at invisible-island.net>
+
+	* yacc.1: document -P and bison-extensions
+
+	* test/ftp.tab.c, test/grammar.tab.c, test/calc.tab.c, test/error.tab.c:
+	regen
+
+	* output.c: implement %pure-parser
+
+	* skeleton.c:
+	implement %pure-parser, like bison.  To help with this, changed the stack
+	variables, putting them into a struct.
+
+	* reader.c: implement %pure-parser
+
+	* defs.h: modified skeleton to support %pure-parser feature
+
+	* main.c: add -P option to set %pure-parser
+
+	* output.c:
+	make -r and -p options work together.  The -r option splits the generated
+	parser into code/table files; for this case we cannot use static data.
+	Also, we have to repeat the #define's used for prefix (-p) as well as the
+	redeclaration of yyparse().  Finally, allow any of the prefixed names to
+	be overridden, e.g., by passing a -D option to the compiler.  Make that
+	a little more readable by putting a blank line before each chunk.
+
+	* defs.h: add definitions for %pure-parser
+
+	* skeleton.c:
+	put blank line before/after the redeclaration of yyparse()
+
+	* output.c: allow for other program redefining yylex()
+
+	* skeleton.c:
+	split-off xdecls[] array, to move declaration of yyparse() after #define's
+
+	* defs.h: split-out xdecls[]
+
+	* VERSION: bump
+
+	* configure: regen
+
+	* aclocal.m4: add CF_REMOVE_DEFINE, needed by CF_ADD_CFLAGS
+
+	* aclocal.m4:
+	resync with my-autoconf CF_ADD_CFLAGS and CF_DISABLE_ECHO changes.
+
+2010-02-16  Ostap.Cherkashi
+
+	* skeleton.c: fix a memory leak in the generated skeleton
+
+2010-01-01  Thomas E. Dickey  <tom at invisible-island.net>
+
+	* package/debian/source/format: scripts from Debian package
+
+2009-12-31  Thomas E. Dickey  <tom at invisible-island.net>
+
+	* config.guess: 2009-12-30
+
+	* config.sub: 2009-12-31
+
+2009-10-27  Thomas E. Dickey  <tom at 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 E. Dickey  <tom at invisible-island.net>
+
+	* test/ftp.tab.c, test/grammar.tab.c, test/calc.tab.c, test/error.tab.c:
+	resync
+
+	* main.c, defs.h: introduce some typedefs for portability, etc.
+
+	* makefile.in:
+	don't remove "*.log" in mostlyclean rule since it interferes with regress=
ion
+	script.
+
+	* configure: regen
+
+	* aclocal.m4: resync with my-autoconf
+
+2009-08-25  Thomas E. Dickey  <tom at invisible-island.net>
+
+	* config.guess, config.sub: 2009-08-19
+
+2009-02-21  Thomas E. Dickey  <tom at invisible-island.net>
+
+	* VERSION: bump
+
+	* output.c: restore "yylval" symbol, omitted in cleanup on 2008/8/25
+
+2008-12-26  Thomas E. Dickey  <tom at invisible-island.net>
+
+	* configure: regen with autoconf-2.52 (patched)
+
+2008-12-25  Thomas E. Dickey  <tom at invisible-island.net>
+
+	* test/error.tab.c, test/ftp.tab.c, test/grammar.tab.c, test/calc.tab.c:
+	regenerated
+
+2008-12-24  Thomas E. Dickey  <tom at invisible-island.net>
+
+	* VERSION: bump
+
+	* skeleton.c:
+	remove ifdef-lint from goto yyerrlab, to quiet gcc warning
+
+2008-11-26  Thomas E. Dickey  <tom at 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 E. Dickey  <tom at invisible-island.net>
+
+	* closure.c, defs.h, error.c, graph.c, lalr.c, lr0.c, main.c, mkpar.c, ou=
tput.c, reader.c, skeleton.c, symtab.c, verbose.c, warshall.c:
+	change indent-style (request by Perry E. Metzger)
+
+2008-08-27  Thomas E. Dickey  <tom at 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
+
+	* VERSION: bump
+
+	* skeleton.c:
+	better implementation of YYPARSE_PARAM, using YYPARSE_DECL() macro
+
+	* test/calc.tab.c, test/error.tab.c, test/ftp.tab.c, test/grammar.tab.c, =
skeleton.c:
+	change YYRECOVERING to YYRECOVERING(), for compatibility with other yacc'=
s.
+
+	* configure: regen'd
+
+	* configure.in: add -Wwrite-strings to warnings
+
+	* test/ftp.tab.c, test/grammar.tab.c, test/calc.tab.c, test/error.tab.c:
+	add YYPARSE_PARAM and YYPARSE_PARAM_TYPE
+
+	* skeleton.c:
+	add YYPARSE_PARAM (bison) and YYPARSE_PARAM_TYPE (FreeBSD) features.
+
+	* main.c, defs.h, output.c, skeleton.c, symtab.c, error.c, reader.c:
+	fixes for gcc -Wwrite-strings
+
+	* test/calc.tab.c, test/error.tab.c, test/ftp.tab.c, test/grammar.tab.c:
+	generate the tables as static-const (this is an interface change)
+
+	* output.c: realign columns in start_table()
+
+	* output.c:
+	generate the tables as static-const (this is an interface change)
+
+	* output.c: reorder functions to eliminate forward-references
+
+	* test/calc.tab.c, test/error.tab.c, test/ftp.tab.c, test/grammar.tab.c:
+	remove 'register' keywords
+
+2008-08-26  Thomas E. Dickey  <tom at 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 E. Dickey  <tom at invisible-island.net>
+
+	* test/ftp.tab.c: regen'd
+
+	* reader.c:
+	improve the left-curly fix by testing after blanks, to avoid having a
+	" {" at the beginning of a line.
+
+	* test/error.tab.c, test/grammar.tab.c: regen'd
+
+	* output.c:
+	move the remaining newline-counting into write_XXX functions.
+
+	* test/calc.tab.c: regen'd
+
+	* output.c:
+	simplify part of the output_file formatting using new functions, e.g.,
+	start_int_table(), output_newline().
+
+	* reader.c:
+	modify copy_action() to indent the first character, it if is is left-curly
+	brace.  That makes the output look more like the original, as well as mak=
es
+	it simpler to edit (not confuse editors which look for a left-curly in the
+	first column as if it were the beginning of a function).
+
+	* skeleton.c: minor fixes to avoid gcc -Wconversion warnings
+
+	* output.c: align the #define's produced for "-p" option
+
+	* test/run_test.sh: use the "-p" option for better coverage.
+
+	* output.c: simplify output_prefix() with new define_prefixed()
+
+	* skeleton.c: include string.h, for memset()
+	change stack size to unsigned to fix gcc -Wconversion warnings.
+
+	* VERSION: bump to 2008/8/25
+
+	* makefile.in: add dependency on VERSION file.
+
+2008-08-24  Thomas E. Dickey  <tom at invisible-island.net>
+
+	* VERSION: bump
+
+	* lalr.c: improved memory-leak checking by freeing data in includes[]
+
+	* test/error.tab.c, test/ftp.tab.c, test/grammar.tab.c, test/calc.tab.c:
+	update to match skeleton-change
+
+	* configure: regen'd
+
+	* skeleton.c: Add fix for stack discussed
+		http://undeadly.org/cgi?action=3Darticle&sid=3D20080708155228
+	and applied
+		http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/yacc/skeleton.c.diff?r=
1=3D1.28&r2=3D1.29
+
+	* aclocal.m4: resync with my-autoconf (no major changes)
+
+2008-07-24  Thomas E. Dickey  <tom at invisible-island.net>
+
+	* package/pkgsrc/Makefile, package/pkgsrc/distinfo:
+	scripts from NetBSD pkgsrc, for test-builds
+
+2008-03-14  Thomas E. Dickey  <tom at invisible-island.net>
+
+	* config.sub: update to 2008-03-08
+
+	* config.guess: update to 2008-03-12
+
+2007-05-09  Thomas E. Dickey  <tom at invisible-island.net>
+
+	* main.c: close graph, verbose files if opened, on exit.
+
+	* main.c:
+	audit memory leaks - valgrind reported some memory still in use on exit.
+
+	* lalr.c, output.c, reader.c, mkpar.c, lr0.c:
+	add hook for auditing memory leaks
+
+	* defs.h: add hooks for auditing memory leaks
+
+	* configure: regen'd
+
+	* configure.in:
+	use CF_DISABLE_LEAKS, which combines --disable-leaks, --with-valgrind,
+	--with-dbmalloc and --with-dmalloc
+
+	* aclocal.m4: add CF_DISABLE_LEAKS and CF_WITH_VALGRIND
+
+	* aclocal.m4: improve version-checking in CF_GCC_VERSION
+	rework dbmalloc/dmalloc options using CF_NO_LEAKS_OPTION macro
+
+	* VERSION: 2007/5/9
+
+	* main.c: file_prefix did not always have a trailing null.
+
+2007-03-25  Thomas E. Dickey  <tom at invisible-island.net>
+
+	* mkdirs.sh: improved version for "make -j"
+
+2006-12-22  Thomas E. Dickey  <tom at invisible-island.net>
+
+	* config.guess: 2006/12/22
+
+2006-12-08  Thomas E. Dickey  <tom at invisible-island.net>
+
+	* config.sub: 2006/12/08
+
+2005-08-13  Thomas E. Dickey  <tom at invisible-island.net>
+
+	* main.c: add -V to usage message
+
+	* makefile.in: remove -t option from ctags
+
+	* VERSION: 2005/8/13
+
+2005-08-13  schmitz
+
+	* main.c: Sylvain Schmitz:
+	modify the '-o' option to work like bison's, which sets the file-prefix.
+
+2005-08-13  Matt.Kraai
+
+	* output.c:
+	Debian #322858 (don't close union_file, which contained data).
+	This feature is used in groff.
+
+2005-08-13  Thomas E. Dickey  <tom at invisible-island.net>
+
+	* configure: regenerated
+
+	* aclocal.m4: improve checks for Intel compiler warnings
+
+2005-06-25  Thomas E. Dickey  <tom at invisible-island.net>
+
+	* config.sub: 2005/6/2
+
+	* config.guess: 2005/5/27
+
+2005-05-05  Thomas E. Dickey  <tom at invisible-island.net>
+
+	* defs.h: add a fallback for GCC_UNUSED
+
+2005-05-04  Thomas E. Dickey  <tom at invisible-island.net>
+
+	* makefile.in: add "." to include-path to pickup config.h
+
+	* reader.c:
+	apply fix suggested by Steve Dum for end_rule() in Redhat Bugzilla #11261=
7.
+
+	* output.c:
+	correct a limit check in pack_vector() - report/analysis by William Evans
+
+	* main.c:
+	exit after printing version.  Otherwise "yacc -V" will exit with an erro
+	after printing the usage message.
+
+	* test/calc.tab.c, test/error.tab.c, test/ftp.tab.c, test/grammar.tab.c:
+	regenerated after skeleton-changes
+
+	* skeleton.c: replace a few -1's with YYEMPTY
+
+	* skeleton.c:
+	delete yynewerror (no one uses it any more, and it just makes compiler wa=
rnings)
+
+	* skeleton.c: adapt yygrowstack() and related definitions from FreeBSD
+
+	* test/run_test.sh:
+	filter out lines with YYPATCH, since that will change with each update
+
+	* yacc.1: add -V option
+
+	* main.c: add -V option to print the version.
+	simplify option-parsing by moving the duplicate logic for setting flags i=
nto
+	new function setflag().
+
+	* skeleton.c:
+	move the actual definition of YYMAJOR and YYMINOR to defs.h (as numbers).
+	add YYPATCH here so it can be tested by applications.
+
+	* defs.h:
+	add macros to define VERSION in terms of the (numeric) YYMAJOR, YYMINOR a=
nd
+	YYPATCH symbols.
+
+	* lalr.c, lr0.c, mkpar.c, defs.h, closure.c, warshall.c, output.c, verbos=
e.c, graph.c, reader.c, main.c, symtab.c:
+	reduce externs by making static the procedures that are not referenced ou=
tside
+	the module in which they are defined.
+
+	* makefile.in:
+	the VERSION file holds the patch-date.  Define YYPATCH, so this will be
+	compiled into the skeleton.
+
+	* VERSION: patch-level for byacc
+
+	* main.c:
+	add "-o" to usage message.  It is too long for a single line; rewrite usa=
ge()
+	to show one option per line.
+
+2005-05-03  Thomas E. Dickey  <tom at invisible-island.net>
+
+	* main.c: add -o option, to work with scripts that assume bison.
+	simplify create_file_names() with a macro.
+	simplify done() with a macro.
+	adapt fix from FreeBSD for signal race, e.g., if done() is interrupted by
+	onintr(), do not flush output via exit(), but use _exit() instead.
+
+	* defs.h: remove unnecessary externs for main.c
+
+	* yacc.1: add -o option
+
+	* graph.c: remove unused parameter
+
+	* mkpar.c, defs.h, reader.c:
+	add support for "%expect", a bison feature from FreeBSD sources
+
+	* lr0.c, reader.c, main.c, skeleton.c, graph.c, symtab.c, closure.c, mkpa=
r.c, lalr.c, error.c, warshall.c, verbose.c, output.c:
+	indent'd
+
+	* configure: regenerated for 2005/5/5
+
+	* aclocal.m4: miscellaneous updates (adds CF_INTEL_COMPILER)
+
+2005-04-27  schmitz
+
+	* defs.h, graph.c, lr0.c, main.c, makefile.in, reader.c, yacc.1:
+	Sylvain Schmitz <schmitz at i3s.unice.fr>:
+	add graphical output of the LALR(1) automaton for graphviz,
+	associated with command-line option `-g'
+
+2005-04-16  Thomas E. Dickey  <tom at invisible-island.net>
+
+	* config.sub: 2005/2/10
+
+	* config.guess: 2005/3/24
+
+2005-04-13  Thomas E. Dickey  <tom at invisible-island.net>
+
+	* package/pkgsrc/PLIST: scripts from NetBSD pkgsrc, for test-builds
+
+2005-03-21  Thomas E. Dickey  <tom at invisible-island.net>
+
+	* package/pkgsrc/DESCR: scripts from NetBSD pkgsrc, for test-builds
+
+2004-03-28  Thomas E. Dickey  <tom at 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
+
+	* configure: RCS_BASE
+
+	* configure.in:
+	add AC_ARG_PROGRAM to make --program-prefix, etc., work.
+
+	* makefile.in: first cut of script to support --program-prefix
+
+	* configure.in:
+	reorder AC_INIT/AC_CONFIG_HEADER to make this "work" with autoconf 2.52
+
+	* makefile.in: modify so DESTDIR works
+
+	* makefile.in: use EXEEXT and OBJEXT
+
+	* configure.in: use CF_PROG_EXT
+	generate a config.h
+
+	* defs.h: make this use the generated config.h
+
+	* skeleton.c: add a forward-reference for yyparse()
+
+	* aclocal.m4: add CF_CHECK_CACHE, needed for CF_PROG_EXT
+
+	* yacc.1: remove the discussion of TMPDIR since it is obsolete
+
+	* skeleton.c: fix a couple of minor compiler-warnings in the skeleton
+
+	* defs.h: remove action_file_name, etc., since we use tmpfile() now.
+
+	* main.c:
+	use tmpfile() for opening the working files.  This quiets a warning
+	advising the use of mkstemp().
+
+	* output.c:
+	Do not close temporary-files here, since they are opened with tmpfile().
+	Just rewind them, and they're ready to read back the data stored in them.
+
+	* test/grammar.output, test/grammar.tab.c, test/grammar.tab.h: RCS_BASE
+
+	* makefile.in: turn on "make check" rule
+
+	* test/calc.output, test/run_test.sh, test/calc.tab.h: RCS_BASE
+
+	* test/ftp.tab.c: yyparse() is now yyparse(void)
+
+	* test/calc.tab.c: RCS_BASE
+
+	* test/error.tab.c: yyparse() is now yyparse(void)
+
+	* test/README: RCS_BASE
+
+	* yacc.1: various typography fixes prompted by Debian #100947
+
+	* aclocal.m4, makefile.in, configure.in: RCS_BASE
+
+	* README: updated to note that this is not the original
+
+2004-03-24  Thomas E. Dickey  <tom at invisible-island.net>
+
+	* test/grammar.y: RCS_BASE
+
+2004-02-23  Thomas E. Dickey  <tom at invisible-island.net>
+
+	* config.sub: RCS_BASE
+
+2004-02-17  Thomas E. Dickey  <tom at invisible-island.net>
+
+	* config.guess: RCS_BASE
+
+2003-11-29  Thomas E. Dickey  <tom at invisible-island.net>
+
+	* install-sh: improved quoting
+
+2002-06-29  Thomas E. Dickey  <tom at invisible-island.net>
+
+	* mkdirs.sh:
+	don't use character range, since some locales don't work as expected
+
+2001-06-22  Thomas E. Dickey  <tom at invisible-island.net>
+
+	* install-sh: RCS_BASE
+
+2000-11-20  Thomas E. Dickey  <tom at invisible-island.net>
+
+	* test/calc.y: RCS_BASE
+
+	* test/code_calc.y, test/pure_calc.y: copy of calc.y
+
+	* vmsbuild.com: original version
+
+2000-02-23  Thomas E. Dickey  <dickey at invisible-island.net>
+
+	* test/RCS, RCS: PERMIT FILE
+
+2000-02-14  Thomas E. Dickey  <tom at invisible-island.net>
+
+	* main.c: fix for VMS port - making pathname for temp-file
+
+	* descrip.mms: original version
+
+2000-02-13  Thomas E. Dickey  <tom at 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 E. Dickey  <tom at invisible-island.net>
+
+	* mkdirs.sh: RCS_BASE
+
+1995-01-01  Thomas E. Dickey  <tom at invisible-island.net>
+
+	* config_h.in: RCS_BASE
+
+1993-12-23  unknown
+
+	* README.DOS, main.c: MSDOS-port
+
+1993-12-22  unknown
+
+	* reader.c, defs.h: MSDOS-port
+
+1993-03-02  unknown
+
+	* README: original version
+
+1993-02-22  unknown
+
+	* test/ftp.output, test/ftp.tab.c, test/ftp.tab.h, test/error.output, tes=
t/error.tab.c, test/error.tab.h:
+	RCS_BASE
+
+	* skeleton.c, warshall.c, main.c, output.c, reader.c, closure.c, NOTES:
+	original version
+
+1992-10-12  unknown
+
+	* yacc.1: original version
+
+1992-10-11  unknown
+
+	* defs.h: original version
+
+1991-01-20  unknown
+
+	* mkpar.c, verbose.c: original version
+
+1991-01-14  unknown
+
+	* lr0.c, Makefile, Makefile.old: original version
+
+1990-07-16  unknown
+
+	* NEW_FEATURES: original version
+
+1990-06-03  unknown
+
+	* ACKNOWLEDGEMENTS: original version
+
+1990-02-05  unknown
+
+	* symtab.c, lalr.c, error.c: original version
+
+1990-01-16  Thomas E. Dickey  <tom at invisible-island.net>
+
+	* test/code_error.y, test/pure_error.y: RCS_BASE
+
+1990-01-16  unknown
+
+	* test/error.y: RCS_BASE
+
+1989-11-22  unknown
+
+	* NO_WARRANTY: original version
+
+1989-09-23  unknown
+
+	* test/ftp.y: RCS_BASE
+
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/Makefile.old
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/Makefile.old	Wed Jul 25 16:21:35 2012 +0300
@@ -0,0 +1,84 @@
+DEST	      =3D .
+
+HDRS	      =3D defs.h
+
+CFLAGS	      =3D -O -DNDEBUG
+
+LDFLAGS	      =3D
+
+LIBS	      =3D
+
+LINKER	      =3D cc
+
+MAKEFILE      =3D Makefile
+
+OBJS	      =3D closure.o \
+		error.o \
+		lalr.o \
+		lr0.o \
+		main.o \
+		mkpar.o \
+		output.o \
+		reader.o \
+		skeleton.o \
+		symtab.o \
+		verbose.o \
+		warshall.o
+
+PRINT	      =3D pr -f -l88
+
+PROGRAM	      =3D yacc
+
+SRCS	      =3D closure.c \
+		error.c \
+		lalr.c \
+		lr0.c \
+		main.c \
+		mkpar.c \
+		output.c \
+		reader.c \
+		skeleton.c \
+		symtab.c \
+		verbose.c \
+		warshall.c
+
+all:		$(PROGRAM)
+
+$(PROGRAM):     $(OBJS) $(LIBS)
+		@echo -n "Loading $(PROGRAM) ... "
+		@$(LINKER) $(LDFLAGS) -o $(PROGRAM) $(OBJS) $(LIBS)
+		@echo "done"
+
+clean:;		@rm -f $(OBJS)
+
+clobber:;	@rm -f $(OBJS) $(PROGRAM)
+
+depend:;	@mkmf -f $(MAKEFILE) PROGRAM=3D$(PROGRAM) DEST=3D$(DEST)
+
+index:;		@ctags -wx $(HDRS) $(SRCS)
+
+install:	$(PROGRAM)
+		@echo Installing $(PROGRAM) in $(DEST)
+		@install -s $(PROGRAM) $(DEST)
+
+listing:;	@$(PRINT) Makefile $(HDRS) $(SRCS) | lpr
+
+lint:;		@lint $(SRCS)
+
+program:        $(PROGRAM)
+
+tags:           $(HDRS) $(SRCS); @ctags $(HDRS) $(SRCS)
+
+###
+closure.o: defs.h
+error.o: defs.h
+lalr.o: defs.h
+lr0.o: defs.h
+main.o: defs.h
+mkpar.o: defs.h
+output.o: defs.h
+reader.o: defs.h
+skeleton.o: defs.h
+symtab.o: defs.h
+verbose.o: defs.h
+warshall.o: defs.h
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/NEW_FEATURES
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/NEW_FEATURES	Wed Jul 25 16:21:35 2012 +0300
@@ -0,0 +1,46 @@
+     The -r option has been implemented.  The -r option tells Yacc to
+put the read-only tables in y.tab.c and the code and variables in
+y.code.c.  Keith Bostic asked for this option so that :yyfix could be
+eliminated.
+
+     The -l and -t options have been implemented.  The -l option tells
+Yacc not to include #line directives in the code it produces.  The -t
+option causes debugging code to be included in the compiled parser.
+
+     The code for error recovery has been changed to implement the same
+algorithm as AT&T Yacc.  There will still be differences in the way
+error recovery works because AT&T Yacc uses more default reductions
+than Berkeley Yacc.
+
+     The environment variable TMPDIR determines the directory where
+temporary files will be created.  If TMPDIR is defined, temporary files
+will be created in the directory whose pathname is the value of TMPDIR.
+By default, temporary files are created in /tmp.
+
+     The keywords are now case-insensitive.  For example, %nonassoc,
+%NONASSOC, %NonAssoc, and %nOnAsSoC are all equivalent.
+
+     Commas and semicolons that are not part of C code are treated as
+commentary.
+
+     Line-end comments, as in BCPL, are permitted.  Line-end comments
+begin with // and end at the next end-of-line.  Line-end comments are
+permitted in C code; they are converted to C comments on output.
+
+     The form of y.output files has been changed to look more like
+those produced by AT&T Yacc.
+
+     A new kind of declaration has been added.  The form of the declaration
+is
+
+	  %ident string
+
+where string is a sequence of characters begining with a double quote
+and ending with either a double quote or the next end-of-line, whichever
+comes first.  The declaration will cause a #ident directive to be written
+near the start of the output file.
+
+     If a parser has been compiled with debugging code, that code can be
+enabled by setting an environment variable.  If the environment variable
+YYDEBUG is set to 0, debugging output is suppressed.  If it is set to 1,
+debugging output is written to standard output.
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/NOTES
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/NOTES	Wed Jul 25 16:21:35 2012 +0300
@@ -0,0 +1,9 @@
+Berkeley Yacc reflects its origins.  The reason so many routines
+use exactly six register variables is that Berkeley Yacc was
+developed on a VAX using PCC.  PCC placed at most six variables
+in registers.  I went to considerable effort to find which six
+variables most belonged in registers.  Changes in machines and
+compilers make that effort worthless, perhaps even harmful.
+
+The code contains many instances where address calculations are
+performed in particular ways to optimize the code for the VAX.
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/NO_WARRANTY
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/NO_WARRANTY	Wed Jul 25 16:21:35 2012 +0300
@@ -0,0 +1,3 @@
+     Berkeley Yacc is distributed with no warranty whatever.  The author
+and any other contributors take no responsibility for the consequences of
+its use.
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/README
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/README	Wed Jul 25 16:21:35 2012 +0300
@@ -0,0 +1,29 @@
+-- $Id: README,v 1.2 2004/03/28 17:24:53 tom Exp $
+
+The original README is below.  I've updated this version of Berkeley Yacc
+to make it ANSI C compliant - Thomas Dickey
+
+--------------------------------------------------------------------------=
-----
+    Berkeley Yacc is an LALR(1) parser generator.  Berkeley Yacc has been =
made
+as compatible as possible with AT&T Yacc.  Berkeley Yacc can accept any in=
put
+specification that conforms to the AT&T Yacc documentation.  Specifications
+that take advantage of undocumented features of AT&T Yacc will probably be
+rejected.
+
+    Berkeley Yacc is distributed with no warranty whatever.  The code is c=
ertain
+to contain errors.  Neither the author nor any contributor takes responsib=
ility
+for any consequences of its use.
+
+    Berkeley Yacc is in the public domain.  The data structures and algori=
thms
+used in Berkeley Yacc are all either taken from documents available to the
+general public or are inventions of the author.  Anyone may freely distrib=
ute
+source or binary forms of Berkeley Yacc whether unchanged or modified.
+Distributers may charge whatever fees they can obtain for Berkeley Yacc.
+Programs generated by Berkeley Yacc may be distributed freely.
+
+    Please report bugs to
+
+			robert.corbett at eng.Sun.COM
+
+Include a small example if possible.  Please include the banner string from
+skeleton.c with the bug report.  Do not expect rapid responses.
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/VERSION
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/VERSION	Wed Jul 25 16:21:35 2012 +0300
@@ -0,0 +1,1 @@
+20120115
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/aclocal.m4
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/aclocal.m4	Wed Jul 25 16:21:35 2012 +0300
@@ -0,0 +1,1144 @@
+dnl $Id: aclocal.m4,v 1.19 2012/01/13 14:10:56 tom Exp $
+dnl Macros for byacc configure script (Thomas E. Dickey)
+dnl ----------------------------------------------------------------------=
-----
+dnl Copyright 2004-2011,2012 Thomas E. Dickey
+dnl=20
+dnl Permission is hereby granted, free of charge, to any person obtaining a
+dnl copy of this software and associated documentation files (the
+dnl "Software"), to deal in the Software without restriction, including
+dnl without limitation the rights to use, copy, modify, merge, publish,
+dnl distribute, distribute with modifications, sublicense, and/or sell
+dnl copies of the Software, and to permit persons to whom the Software is
+dnl furnished to do so, subject to the following conditions:
+dnl=20
+dnl The above copyright notice and this permission notice shall be included
+dnl in all copies or portions of the Software.
+dnl=20
+dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+dnl IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+dnl DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+dnl OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
+dnl THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+dnl=20
+dnl Except as contained in this notice, the name(s) of the above copyright
+dnl holders shall not be used in advertising or otherwise to promote the
+dnl sale, use or other dealings in this Software without prior written
+dnl authorization.
+dnl ----------------------------------------------------------------------=
-----
+dnl ----------------------------------------------------------------------=
-----
+dnl CF_ADD_CFLAGS version: 10 updated: 2010/05/26 05:38:42
+dnl -------------
+dnl Copy non-preprocessor flags to $CFLAGS, preprocessor flags to $CPPFLAGS
+dnl The second parameter if given makes this macro verbose.
+dnl
+dnl Put any preprocessor definitions that use quoted strings in $EXTRA_CPP=
FLAGS,
+dnl to simplify use of $CPPFLAGS in compiler checks, etc., that are easily
+dnl confused by the quotes (which require backslashes to keep them usable).
+AC_DEFUN([CF_ADD_CFLAGS],
+[
+cf_fix_cppflags=3Dno
+cf_new_cflags=3D
+cf_new_cppflags=3D
+cf_new_extra_cppflags=3D
+
+for cf_add_cflags in $1
+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=3D`echo ${cf_add_cflags} |sed -e 's/^-D[[^=3D]]*=3D'\''\"=
[[^"]]*//'`
+
+			test "${cf_add_cflags}" !=3D "${cf_tst_cflags}" \
+				&& test -z "${cf_tst_cflags}" \
+				&& cf_fix_cppflags=3Dyes
+
+			if test $cf_fix_cppflags =3D yes ; then
+				cf_new_extra_cppflags=3D"$cf_new_extra_cppflags $cf_add_cflags"
+				continue
+			elif test "${cf_tst_cflags}" =3D "\"'" ; then
+				cf_new_extra_cppflags=3D"$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=3D`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=
=3D.*//'`
+				CF_REMOVE_DEFINE(CPPFLAGS,$CPPFLAGS,$cf_tst_cppflags)
+				;;
+			esac
+			cf_new_cppflags=3D"$cf_new_cppflags $cf_add_cflags"
+			;;
+		esac
+		;;
+	*)
+		cf_new_cflags=3D"$cf_new_cflags $cf_add_cflags"
+		;;
+	esac
+	;;
+yes)
+	cf_new_extra_cppflags=3D"$cf_new_extra_cppflags $cf_add_cflags"
+
+	cf_tst_cflags=3D`echo ${cf_add_cflags} |sed -e 's/^[[^"]]*"'\''//'`
+
+	test "${cf_add_cflags}" !=3D "${cf_tst_cflags}" \
+		&& test -z "${cf_tst_cflags}" \
+		&& cf_fix_cppflags=3Dno
+	;;
+esac
+done
+
+if test -n "$cf_new_cflags" ; then
+	ifelse([$2],,,[CF_VERBOSE(add to \$CFLAGS $cf_new_cflags)])
+	CFLAGS=3D"$CFLAGS $cf_new_cflags"
+fi
+
+if test -n "$cf_new_cppflags" ; then
+	ifelse([$2],,,[CF_VERBOSE(add to \$CPPFLAGS $cf_new_cppflags)])
+	CPPFLAGS=3D"$CPPFLAGS $cf_new_cppflags"
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+	ifelse([$2],,,[CF_VERBOSE(add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags)=
])
+	EXTRA_CPPFLAGS=3D"$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+fi
+
+AC_SUBST(EXTRA_CPPFLAGS)
+
+])dnl
+dnl ----------------------------------------------------------------------=
-----
+dnl CF_ANSI_CC_CHECK version: 11 updated: 2011/07/01 19:47:45
+dnl ----------------
+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:=3Dcc}
+
+# 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/CPPFL=
AGS options)
+	# humor him...
+	cf_flags=3D`echo "$CC" | sed -e 's/^[[^ 	]]*[[ 	]]//'`
+	CC=3D`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=3Dno
+cf_save_CFLAGS=3D"$CFLAGS"
+cf_save_CPPFLAGS=3D"$CPPFLAGS"
+# Don't try gcc -ansi; that turns off useful extensions and
+# breaks some systems' header files.
+# AIX			-qlanglvl=3Dansi
+# Ultrix and OSF/1	-std1
+# HP-UX			-Aa -D_HPUX_SOURCE
+# SVR4			-Xc
+# UnixWare 1.2		(cannot use -Xc, since ANSI/POSIX clashes)
+for cf_arg in "-DCC_HAS_PROTOS" \
+	"" \
+	-qlanglvl=3Dansi \
+	-std1 \
+	-Ae \
+	"-Aa -D_HPUX_SOURCE" \
+	-Xc
+do
+	CF_ADD_CFLAGS($cf_arg)
+	AC_TRY_COMPILE(
+[
+#ifndef CC_HAS_PROTOS
+#if !defined(__STDC__) || (__STDC__ !=3D 1)
+choke me
+#endif
+#endif
+],[
+	int test (int i, double x);
+	struct s1 {int (*f) (int a);};
+	struct s2 {int (*f) (double a);};],
+	[cf_cv_ansi_cc=3D"$cf_arg"; break])
+done
+CFLAGS=3D"$cf_save_CFLAGS"
+CPPFLAGS=3D"$cf_save_CPPFLAGS"
+])
+
+if test "$cf_cv_ansi_cc" !=3D "no"; then
+if test ".$cf_cv_ansi_cc" !=3D ".-DCC_HAS_PROTOS"; then
+	CF_ADD_CFLAGS($cf_cv_ansi_cc)
+else
+	AC_DEFINE(CC_HAS_PROTOS)
+fi
+fi
+])dnl
+dnl ----------------------------------------------------------------------=
-----
+dnl CF_ANSI_CC_REQD version: 4 updated: 2008/03/23 14:48:54
+dnl ---------------
+dnl For programs that must use an ANSI compiler, obtain compiler options t=
hat
+dnl will make it recognize prototypes.  We'll do preprocessor checks in ot=
her
+dnl macros, since tools such as unproto can fake prototypes, but only part=
 of
+dnl the preprocessor.
+AC_DEFUN([CF_ANSI_CC_REQD],
+[AC_REQUIRE([CF_ANSI_CC_CHECK])
+if test "$cf_cv_ansi_cc" =3D "no"; then
+	AC_MSG_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
+	c. use a wrapper such as unproto])
+fi
+])dnl
+dnl ----------------------------------------------------------------------=
-----
+dnl CF_ARG_DISABLE version: 3 updated: 1999/03/30 17:24:31
+dnl --------------
+dnl Allow user to disable a normally-on option.
+AC_DEFUN([CF_ARG_DISABLE],
+[CF_ARG_OPTION($1,[$2],[$3],[$4],yes)])dnl
+dnl ----------------------------------------------------------------------=
-----
+dnl CF_ARG_OPTION version: 4 updated: 2010/05/26 05:38:42
+dnl -------------
+dnl Restricted form of AC_ARG_ENABLE that ensures user doesn't give bogus
+dnl values.
+dnl
+dnl Parameters:
+dnl $1 =3D option name
+dnl $2 =3D help-string
+dnl $3 =3D action to perform if option is not default
+dnl $4 =3D action if perform if option is default
+dnl $5 =3D default option value (either 'yes' or 'no')
+AC_DEFUN([CF_ARG_OPTION],
+[AC_ARG_ENABLE([$1],[$2],[test "$enableval" !=3D ifelse([$5],no,yes,no) &&=
 enableval=3Difelse([$5],no,no,yes)
+  if test "$enableval" !=3D "$5" ; then
+ifelse([$3],,[    :]dnl
+,[    $3]) ifelse([$4],,,[
+  else
+    $4])
+  fi],[enableval=3D$5 ifelse([$4],,,[
+  $4
+])dnl
+  ])])dnl
+dnl ----------------------------------------------------------------------=
-----
+dnl CF_CHECK_CACHE version: 11 updated: 2008/03/23 14:45:59
+dnl --------------
+dnl Check if we're accidentally using a cache from a different machine.
+dnl Derive the system name, as a check for reusing the autoconf cache.
+dnl
+dnl If we've packaged config.guess and config.sub, run that (since it does=
 a
+dnl better job than uname).  Normally we'll use AC_CANONICAL_HOST, but all=
ow
+dnl an extra parameter that we may override, e.g., for AC_CANONICAL_SYSTEM
+dnl which is useful in cross-compiles.
+dnl
+dnl Note: we would use $ac_config_sub, but that is one of the places where
+dnl autoconf 2.5x broke compatibility with autoconf 2.13
+AC_DEFUN([CF_CHECK_CACHE],
+[
+if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
+	ifelse([$1],,[AC_CANONICAL_HOST],[$1])
+	system_name=3D"$host_os"
+else
+	system_name=3D"`(uname -s -r) 2>/dev/null`"
+	if test -z "$system_name" ; then
+		system_name=3D"`(hostname) 2>/dev/null`"
+	fi
+fi
+test -n "$system_name" && AC_DEFINE_UNQUOTED(SYSTEM_NAME,"$system_name")
+AC_CACHE_VAL(cf_cv_system_name,[cf_cv_system_name=3D"$system_name"])
+
+test -z "$system_name" && system_name=3D"$cf_cv_system_name"
+test -n "$cf_cv_system_name" && AC_MSG_RESULT(Configuring for $cf_cv_syste=
m_name)
+
+if test ".$system_name" !=3D ".$cf_cv_system_name" ; then
+	AC_MSG_RESULT(Cached system name ($system_name) does not agree with actua=
l ($cf_cv_system_name))
+	AC_MSG_ERROR("Please remove config.cache and try again.")
+fi
+])dnl
+dnl ----------------------------------------------------------------------=
-----
+dnl CF_DISABLE_ECHO version: 11 updated: 2009/12/13 13:16:57
+dnl ---------------
+dnl You can always use "make -n" to see the actual options, but it's hard =
to
+dnl pick out/analyze warning messages when the compile-line is long.
+dnl
+dnl Sets:
+dnl	ECHO_LT - symbol to control if libtool is verbose
+dnl	ECHO_LD - symbol to prefix "cc -o" lines
+dnl	RULE_CC - symbol to put before implicit "cc -c" lines (e.g., .c.o)
+dnl	SHOW_CC - symbol to put before explicit "cc -c" lines
+dnl	ECHO_CC - symbol to put before any "cc" line
+dnl
+AC_DEFUN([CF_DISABLE_ECHO],[
+AC_MSG_CHECKING(if you want to see long compiling messages)
+CF_ARG_DISABLE(echo,
+	[  --disable-echo          display "compiling" commands],
+	[
+    ECHO_LT=3D'--silent'
+    ECHO_LD=3D'@echo linking [$]@;'
+    RULE_CC=3D'@echo compiling [$]<'
+    SHOW_CC=3D'@echo compiling [$]@'
+    ECHO_CC=3D'@'
+],[
+    ECHO_LT=3D''
+    ECHO_LD=3D''
+    RULE_CC=3D''
+    SHOW_CC=3D''
+    ECHO_CC=3D''
+])
+AC_MSG_RESULT($enableval)
+AC_SUBST(ECHO_LT)
+AC_SUBST(ECHO_LD)
+AC_SUBST(RULE_CC)
+AC_SUBST(SHOW_CC)
+AC_SUBST(ECHO_CC)
+])dnl
+dnl ----------------------------------------------------------------------=
-----
+dnl CF_DISABLE_LEAKS version: 6 updated: 2010/07/23 04:14:32
+dnl ----------------
+dnl Combine no-leak checks with the libraries or tools that are used for t=
he
+dnl checks.
+AC_DEFUN([CF_DISABLE_LEAKS],[
+
+AC_REQUIRE([CF_WITH_DMALLOC])
+AC_REQUIRE([CF_WITH_DBMALLOC])
+AC_REQUIRE([CF_WITH_VALGRIND])
+
+AC_MSG_CHECKING(if you want to perform memory-leak testing)
+AC_ARG_ENABLE(leaks,
+	[  --disable-leaks         test: free permanent memory, analyze leaks],
+	[if test "x$enableval" =3D xno; then with_no_leaks=3Dyes; else with_no_le=
aks=3Dno; fi],
+	: ${with_no_leaks:=3Dno})
+AC_MSG_RESULT($with_no_leaks)
+
+if test "$with_no_leaks" =3D yes ; then
+	AC_DEFINE(NO_LEAKS)
+	AC_DEFINE(YY_NO_LEAKS)
+fi
+])dnl
+dnl ----------------------------------------------------------------------=
-----
+dnl CF_GCC_ATTRIBUTES version: 14 updated: 2010/10/23 15:52:32
+dnl -----------------
+dnl Test for availability of useful gcc __attribute__ directives to quiet
+dnl compiler warnings.  Though useful, not all are supported -- and contra=
ry
+dnl to documentation, unrecognized directives cause older compilers to bar=
f.
+AC_DEFUN([CF_GCC_ATTRIBUTES],
+[
+if test "$GCC" =3D yes
+then
+cat > conftest.i <<EOF
+#ifndef GCC_PRINTF
+#define GCC_PRINTF 0
+#endif
+#ifndef GCC_SCANF
+#define GCC_SCANF 0
+#endif
+#ifndef GCC_NORETURN
+#define GCC_NORETURN /* nothing */
+#endif
+#ifndef GCC_UNUSED
+#define GCC_UNUSED /* nothing */
+#endif
+EOF
+if test "$GCC" =3D yes
+then
+	AC_CHECKING([for $CC __attribute__ directives])
+cat > conftest.$ac_ext <<EOF
+#line __oline__ "${as_me:-configure}"
+#include "confdefs.h"
+#include "conftest.h"
+#include "conftest.i"
+#if	GCC_PRINTF
+#define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
+#else
+#define GCC_PRINTFLIKE(fmt,var) /*nothing*/
+#endif
+#if	GCC_SCANF
+#define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
+#else
+#define GCC_SCANFLIKE(fmt,var)  /*nothing*/
+#endif
+extern void wow(char *,...) GCC_SCANFLIKE(1,2);
+extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
+extern void foo(void) GCC_NORETURN;
+int main(int argc GCC_UNUSED, char *argv[[]] GCC_UNUSED) { return 0; }
+EOF
+	cf_printf_attribute=3Dno
+	cf_scanf_attribute=3Dno
+	for cf_attribute in scanf printf unused noreturn
+	do
+		CF_UPPER(cf_ATTRIBUTE,$cf_attribute)
+		cf_directive=3D"__attribute__(($cf_attribute))"
+		echo "checking for $CC $cf_directive" 1>&AC_FD_CC
+
+		case $cf_attribute in #(vi
+		printf) #(vi
+			cf_printf_attribute=3Dyes
+			cat >conftest.h <<EOF
+#define GCC_$cf_ATTRIBUTE 1
+EOF
+			;;
+		scanf) #(vi
+			cf_scanf_attribute=3Dyes
+			cat >conftest.h <<EOF
+#define GCC_$cf_ATTRIBUTE 1
+EOF
+			;;
+		*) #(vi
+			cat >conftest.h <<EOF
+#define GCC_$cf_ATTRIBUTE $cf_directive
+EOF
+			;;
+		esac
+
+		if AC_TRY_EVAL(ac_compile); then
+			test -n "$verbose" && AC_MSG_RESULT(... $cf_attribute)
+			cat conftest.h >>confdefs.h
+			case $cf_attribute in #(vi
+			printf) #(vi
+				if test "$cf_printf_attribute" =3D no ; then
+					cat >>confdefs.h <<EOF
+#define GCC_PRINTFLIKE(fmt,var) /* nothing */
+EOF
+				else
+					cat >>confdefs.h <<EOF
+#define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
+EOF
+				fi
+				;;
+			scanf) #(vi
+				if test "$cf_scanf_attribute" =3D no ; then
+					cat >>confdefs.h <<EOF
+#define GCC_SCANFLIKE(fmt,var) /* nothing */
+EOF
+				else
+					cat >>confdefs.h <<EOF
+#define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
+EOF
+				fi
+				;;
+			esac
+		fi
+	done
+else
+	fgrep define conftest.i >>confdefs.h
+fi
+rm -rf conftest*
+fi
+])dnl
+dnl ----------------------------------------------------------------------=
-----
+dnl CF_GCC_VERSION version: 5 updated: 2010/04/24 11:02:31
+dnl --------------
+dnl Find version of gcc
+AC_DEFUN([CF_GCC_VERSION],[
+AC_REQUIRE([AC_PROG_CC])
+GCC_VERSION=3Dnone
+if test "$GCC" =3D yes ; then
+	AC_MSG_CHECKING(version of $CC)
+	GCC_VERSION=3D"`${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=3Dunknown
+	AC_MSG_RESULT($GCC_VERSION)
+fi
+])dnl
+dnl ----------------------------------------------------------------------=
-----
+dnl CF_GCC_WARNINGS version: 27 updated: 2010/10/23 15:52:32
+dnl ---------------
+dnl Check if the compiler supports useful warning options.  There's a few =
that
+dnl we don't use, simply because they're too noisy:
+dnl
+dnl	-Wconversion (useful in older versions of gcc, but not in gcc 2.7.x)
+dnl	-Wredundant-decls (system headers make this too noisy)
+dnl	-Wtraditional (combines too many unrelated messages, only a few useful)
+dnl	-Wwrite-strings (too noisy, but should review occasionally).  This
+dnl		is enabled for ncurses using "--enable-const".
+dnl	-pedantic
+dnl
+dnl Parameter:
+dnl	$1 is an optional list of gcc warning flags that a particular
+dnl		application might want to use, e.g., "no-unused" for
+dnl		-Wno-unused
+dnl Special:
+dnl	If $with_ext_const is "yes", add a check for -Wwrite-strings
+dnl
+AC_DEFUN([CF_GCC_WARNINGS],
+[
+AC_REQUIRE([CF_GCC_VERSION])
+CF_INTEL_COMPILER(GCC,INTEL_COMPILER,CFLAGS)
+
+cat > conftest.$ac_ext <<EOF
+#line __oline__ "${as_me:-configure}"
+int main(int argc, char *argv[[]]) { return (argv[[argc-1]] =3D=3D 0) ; }
+EOF
+
+if test "$INTEL_COMPILER" =3D yes
+then
+# The "-wdXXX" options suppress warnings:
+# remark #1419: external declaration in primary source file
+# remark #1683: explicit conversion of a 64-bit integral type to a smaller=
 integral type (potential portability problem)
+# remark #1684: conversion from pointer to same-sized integral type (poten=
tial portability problem)
+# remark #193: zero used for undefined preprocessing identifier
+# remark #593: variable "curs_sb_left_arrow" was set but never used
+# remark #810: conversion from "int" to "Dimension=3D{unsigned short}" may=
 lose significant bits
+# remark #869: parameter "tw" was never referenced
+# remark #981: operands are evaluated in unspecified order
+# warning #279: controlling expression is constant
+
+	AC_CHECKING([for $CC warning options])
+	cf_save_CFLAGS=3D"$CFLAGS"
+	EXTRA_CFLAGS=3D"-Wall"
+	for cf_opt in \
+		wd1419 \
+		wd1683 \
+		wd1684 \
+		wd193 \
+		wd593 \
+		wd279 \
+		wd810 \
+		wd869 \
+		wd981
+	do
+		CFLAGS=3D"$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
+		if AC_TRY_EVAL(ac_compile); then
+			test -n "$verbose" && AC_MSG_RESULT(... -$cf_opt)
+			EXTRA_CFLAGS=3D"$EXTRA_CFLAGS -$cf_opt"
+		fi
+	done
+	CFLAGS=3D"$cf_save_CFLAGS"
+
+elif test "$GCC" =3D yes
+then
+	AC_CHECKING([for $CC warning options])
+	cf_save_CFLAGS=3D"$CFLAGS"
+	EXTRA_CFLAGS=3D
+	cf_warn_CONST=3D""
+	test "$with_ext_const" =3D yes && cf_warn_CONST=3D"Wwrite-strings"
+	for cf_opt in W Wall \
+		Wbad-function-cast \
+		Wcast-align \
+		Wcast-qual \
+		Winline \
+		Wmissing-declarations \
+		Wmissing-prototypes \
+		Wnested-externs \
+		Wpointer-arith \
+		Wshadow \
+		Wstrict-prototypes \
+		Wundef $cf_warn_CONST $1
+	do
+		CFLAGS=3D"$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
+		if AC_TRY_EVAL(ac_compile); then
+			test -n "$verbose" && AC_MSG_RESULT(... -$cf_opt)
+			case $cf_opt in #(vi
+			Wcast-qual) #(vi
+				CPPFLAGS=3D"$CPPFLAGS -DXTSTRINGDEFINES"
+				;;
+			Winline) #(vi
+				case $GCC_VERSION in
+				[[34]].*)
+					CF_VERBOSE(feature is broken in gcc $GCC_VERSION)
+					continue;;
+				esac
+				;;
+			esac
+			EXTRA_CFLAGS=3D"$EXTRA_CFLAGS -$cf_opt"
+		fi
+	done
+	CFLAGS=3D"$cf_save_CFLAGS"
+fi
+rm -rf conftest*
+
+AC_SUBST(EXTRA_CFLAGS)
+])dnl
+dnl ----------------------------------------------------------------------=
-----
+dnl CF_GNU_SOURCE version: 6 updated: 2005/07/09 13:23:07
+dnl -------------
+dnl Check if we must define _GNU_SOURCE to get a reasonable value for
+dnl _XOPEN_SOURCE, upon which many POSIX definitions depend.  This is a de=
fect
+dnl (or misfeature) of glibc2, which breaks portability of many applicatio=
ns,
+dnl since it is interwoven with GNU extensions.
+dnl
+dnl Well, yes we could work around it...
+AC_DEFUN([CF_GNU_SOURCE],
+[
+AC_CACHE_CHECK(if we must define _GNU_SOURCE,cf_cv_gnu_source,[
+AC_TRY_COMPILE([#include <sys/types.h>],[
+#ifndef _XOPEN_SOURCE
+make an error
+#endif],
+	[cf_cv_gnu_source=3Dno],
+	[cf_save=3D"$CPPFLAGS"
+	 CPPFLAGS=3D"$CPPFLAGS -D_GNU_SOURCE"
+	 AC_TRY_COMPILE([#include <sys/types.h>],[
+#ifdef _XOPEN_SOURCE
+make an error
+#endif],
+	[cf_cv_gnu_source=3Dno],
+	[cf_cv_gnu_source=3Dyes])
+	CPPFLAGS=3D"$cf_save"
+	])
+])
+test "$cf_cv_gnu_source" =3D yes && CPPFLAGS=3D"$CPPFLAGS -D_GNU_SOURCE"
+])dnl
+dnl ----------------------------------------------------------------------=
-----
+dnl CF_INTEL_COMPILER version: 4 updated: 2010/05/26 05:38:42
+dnl -----------------
+dnl Check if the given compiler is really the Intel compiler for Linux.  It
+dnl tries to imitate gcc, but does not return an error when it finds a mis=
match
+dnl between prototypes, e.g., as exercised by CF_MISSING_CHECK.
+dnl
+dnl This macro should be run "soon" after AC_PROG_CC or AC_PROG_CPLUSPLUS,=
 to
+dnl ensure that it is not mistaken for gcc/g++.  It is normally invoked fr=
om
+dnl the wrappers for gcc and g++ warnings.
+dnl
+dnl $1 =3D GCC (default) or GXX
+dnl $2 =3D INTEL_COMPILER (default) or INTEL_CPLUSPLUS
+dnl $3 =3D CFLAGS (default) or CXXFLAGS
+AC_DEFUN([CF_INTEL_COMPILER],[
+ifelse([$2],,INTEL_COMPILER,[$2])=3Dno
+
+if test "$ifelse([$1],,[$1],GCC)" =3D yes ; then
+	case $host_os in
+	linux*|gnu*)
+		AC_MSG_CHECKING(if this is really Intel ifelse([$1],GXX,C++,C) compiler)
+		cf_save_CFLAGS=3D"$ifelse([$3],,CFLAGS,[$3])"
+		ifelse([$3],,CFLAGS,[$3])=3D"$ifelse([$3],,CFLAGS,[$3]) -no-gcc"
+		AC_TRY_COMPILE([],[
+#ifdef __INTEL_COMPILER
+#else
+make an error
+#endif
+],[ifelse([$2],,INTEL_COMPILER,[$2])=3Dyes
+cf_save_CFLAGS=3D"$cf_save_CFLAGS -we147 -no-gcc"
+],[])
+		ifelse([$3],,CFLAGS,[$3])=3D"$cf_save_CFLAGS"
+		AC_MSG_RESULT($ifelse([$2],,INTEL_COMPILER,[$2]))
+		;;
+	esac
+fi
+])dnl
+dnl ----------------------------------------------------------------------=
-----
+dnl CF_MAKE_TAGS version: 6 updated: 2010/10/23 15:52:32
+dnl ------------
+dnl Generate tags/TAGS targets for makefiles.  Do not generate TAGS if we =
have
+dnl a monocase filesystem.
+AC_DEFUN([CF_MAKE_TAGS],[
+AC_REQUIRE([CF_MIXEDCASE_FILENAMES])
+
+AC_CHECK_PROGS(CTAGS, exctags ctags)
+AC_CHECK_PROGS(ETAGS, exetags etags)
+
+AC_CHECK_PROG(MAKE_LOWER_TAGS, ${CTAGS:-ctags}, yes, no)
+
+if test "$cf_cv_mixedcase" =3D yes ; then
+	AC_CHECK_PROG(MAKE_UPPER_TAGS, ${ETAGS:-etags}, yes, no)
+else
+	MAKE_UPPER_TAGS=3Dno
+fi
+
+if test "$MAKE_UPPER_TAGS" =3D yes ; then
+	MAKE_UPPER_TAGS=3D
+else
+	MAKE_UPPER_TAGS=3D"#"
+fi
+
+if test "$MAKE_LOWER_TAGS" =3D yes ; then
+	MAKE_LOWER_TAGS=3D
+else
+	MAKE_LOWER_TAGS=3D"#"
+fi
+
+AC_SUBST(CTAGS)
+AC_SUBST(ETAGS)
+
+AC_SUBST(MAKE_UPPER_TAGS)
+AC_SUBST(MAKE_LOWER_TAGS)
+])dnl
+dnl ----------------------------------------------------------------------=
-----
+dnl CF_MIXEDCASE_FILENAMES version: 3 updated: 2003/09/20 17:07:55
+dnl ----------------------
+dnl Check if the file-system supports mixed-case filenames.  If we're able=
 to
+dnl create a lowercase name and see it as uppercase, it doesn't support th=
at.
+AC_DEFUN([CF_MIXEDCASE_FILENAMES],
+[
+AC_CACHE_CHECK(if filesystem supports mixed-case filenames,cf_cv_mixedcase=
,[
+if test "$cross_compiling" =3D yes ; then
+	case $target_alias in #(vi
+	*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-mingw32*|*-uwin*) #(vi
+		cf_cv_mixedcase=3Dno
+		;;
+	*)
+		cf_cv_mixedcase=3Dyes
+		;;
+	esac
+else
+	rm -f conftest CONFTEST
+	echo test >conftest
+	if test -f CONFTEST ; then
+		cf_cv_mixedcase=3Dno
+	else
+		cf_cv_mixedcase=3Dyes
+	fi
+	rm -f conftest CONFTEST
+fi
+])
+test "$cf_cv_mixedcase" =3D yes && AC_DEFINE(MIXEDCASE_FILENAMES)
+])dnl
+dnl ----------------------------------------------------------------------=
-----
+dnl CF_MKSTEMP version: 7 updated: 2010/08/14 18:25:37
+dnl ----------
+dnl Check for a working mkstemp.  This creates two files, checks that they=
 are
+dnl successfully created and distinct (AmigaOS apparently fails on the las=
t).
+AC_DEFUN([CF_MKSTEMP],[
+AC_CACHE_CHECK(for working mkstemp, cf_cv_func_mkstemp,[
+rm -rf conftest*
+AC_TRY_RUN([
+#include <sys/types.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <sys/stat.h>
+int main()
+{
+	char *tmpl =3D "conftestXXXXXX";
+	char name[2][80];
+	int n;
+	int result =3D 0;
+	int fd;
+	struct stat sb;
+
+	umask(077);
+	for (n =3D 0; n < 2; ++n) {
+		strcpy(name[n], tmpl);
+		if ((fd =3D mkstemp(name[n])) >=3D 0) {
+			if (!strcmp(name[n], tmpl)
+			 || stat(name[n], &sb) !=3D 0
+			 || (sb.st_mode & S_IFMT) !=3D S_IFREG
+			 || (sb.st_mode & 077) !=3D 0) {
+				result =3D 1;
+			}
+			close(fd);
+		}
+	}
+	if (result =3D=3D 0
+	 && !strcmp(name[0], name[1]))
+		result =3D 1;
+	${cf_cv_main_return:-return}(result);
+}
+],[cf_cv_func_mkstemp=3Dyes
+],[cf_cv_func_mkstemp=3Dno
+],[AC_CHECK_FUNC(mkstemp)
+])
+])
+if test "x$cf_cv_func_mkstemp" =3D xyes || test "x$ac_cv_func_mkstemp" =3D=
 xyes ; then
+	AC_DEFINE(HAVE_MKSTEMP)
+fi
+])dnl
+dnl ----------------------------------------------------------------------=
-----
+dnl CF_MSG_LOG version: 5 updated: 2010/10/23 15:52:32
+dnl ----------
+dnl Write a debug message to config.log, along with the line number in the
+dnl configure script.
+AC_DEFUN([CF_MSG_LOG],[
+echo "${as_me:-configure}:__oline__: testing $* ..." 1>&AC_FD_CC
+])dnl
+dnl ----------------------------------------------------------------------=
-----
+dnl CF_NO_LEAKS_OPTION version: 4 updated: 2006/12/16 14:24:05
+dnl ------------------
+dnl see CF_WITH_NO_LEAKS
+AC_DEFUN([CF_NO_LEAKS_OPTION],[
+AC_MSG_CHECKING(if you want to use $1 for testing)
+AC_ARG_WITH($1,
+	[$2],
+	[AC_DEFINE($3)ifelse([$4],,[
+	 $4
+])
+	: ${with_cflags:=3D-g}
+	: ${with_no_leaks:=3Dyes}
+	 with_$1=3Dyes],
+	[with_$1=3D])
+AC_MSG_RESULT(${with_$1:-no})
+
+case .$with_cflags in #(vi
+.*-g*)
+	case .$CFLAGS in #(vi
+	.*-g*) #(vi
+		;;
+	*)
+		CF_ADD_CFLAGS([-g])
+		;;
+	esac
+	;;
+esac
+])dnl
+dnl ----------------------------------------------------------------------=
-----
+dnl CF_POSIX_C_SOURCE version: 8 updated: 2010/05/26 05:38:42
+dnl -----------------
+dnl Define _POSIX_C_SOURCE to the given level, and _POSIX_SOURCE if needed.
+dnl
+dnl	POSIX.1-1990				_POSIX_SOURCE
+dnl	POSIX.1-1990 and			_POSIX_SOURCE and
+dnl		POSIX.2-1992 C-Language			_POSIX_C_SOURCE=3D2
+dnl		Bindings Option
+dnl	POSIX.1b-1993				_POSIX_C_SOURCE=3D199309L
+dnl	POSIX.1c-1996				_POSIX_C_SOURCE=3D199506L
+dnl	X/Open 2000				_POSIX_C_SOURCE=3D200112L
+dnl
+dnl Parameters:
+dnl	$1 is the nominal value for _POSIX_C_SOURCE
+AC_DEFUN([CF_POSIX_C_SOURCE],
+[
+cf_POSIX_C_SOURCE=3Difelse([$1],,199506L,[$1])
+
+cf_save_CFLAGS=3D"$CFLAGS"
+cf_save_CPPFLAGS=3D"$CPPFLAGS"
+
+CF_REMOVE_DEFINE(cf_trim_CFLAGS,$cf_save_CFLAGS,_POSIX_C_SOURCE)
+CF_REMOVE_DEFINE(cf_trim_CPPFLAGS,$cf_save_CPPFLAGS,_POSIX_C_SOURCE)
+
+AC_CACHE_CHECK(if we should define _POSIX_C_SOURCE,cf_cv_posix_c_source,[
+	CF_MSG_LOG(if the symbol is already defined go no further)
+	AC_TRY_COMPILE([#include <sys/types.h>],[
+#ifndef _POSIX_C_SOURCE
+make an error
+#endif],
+	[cf_cv_posix_c_source=3Dno],
+	[cf_want_posix_source=3Dno
+	 case .$cf_POSIX_C_SOURCE in #(vi
+	 .[[12]]??*) #(vi
+		cf_cv_posix_c_source=3D"-D_POSIX_C_SOURCE=3D$cf_POSIX_C_SOURCE"
+		;;
+	 .2) #(vi
+		cf_cv_posix_c_source=3D"-D_POSIX_C_SOURCE=3D$cf_POSIX_C_SOURCE"
+		cf_want_posix_source=3Dyes
+		;;
+	 .*)
+		cf_want_posix_source=3Dyes
+		;;
+	 esac
+	 if test "$cf_want_posix_source" =3D yes ; then
+		AC_TRY_COMPILE([#include <sys/types.h>],[
+#ifdef _POSIX_SOURCE
+make an error
+#endif],[],
+		cf_cv_posix_c_source=3D"$cf_cv_posix_c_source -D_POSIX_SOURCE")
+	 fi
+	 CF_MSG_LOG(ifdef from value $cf_POSIX_C_SOURCE)
+	 CFLAGS=3D"$cf_trim_CFLAGS"
+	 CPPFLAGS=3D"$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
+	 CF_MSG_LOG(if the second compile does not leave our definition intact er=
ror)
+	 AC_TRY_COMPILE([#include <sys/types.h>],[
+#ifndef _POSIX_C_SOURCE
+make an error
+#endif],,
+	 [cf_cv_posix_c_source=3Dno])
+	 CFLAGS=3D"$cf_save_CFLAGS"
+	 CPPFLAGS=3D"$cf_save_CPPFLAGS"
+	])
+])
+
+if test "$cf_cv_posix_c_source" !=3D no ; then
+	CFLAGS=3D"$cf_trim_CFLAGS"
+	CPPFLAGS=3D"$cf_trim_CPPFLAGS"
+	CF_ADD_CFLAGS($cf_cv_posix_c_source)
+fi
+
+])dnl
+dnl ----------------------------------------------------------------------=
-----
+dnl CF_PROG_EXT version: 10 updated: 2004/01/03 19:28:18
+dnl -----------
+dnl Compute $PROG_EXT, used for non-Unix ports, such as OS/2 EMX.
+AC_DEFUN([CF_PROG_EXT],
+[
+AC_REQUIRE([CF_CHECK_CACHE])
+case $cf_cv_system_name in
+os2*)
+    CFLAGS=3D"$CFLAGS -Zmt"
+    CPPFLAGS=3D"$CPPFLAGS -D__ST_MT_ERRNO__"
+    CXXFLAGS=3D"$CXXFLAGS -Zmt"
+    # autoconf's macro sets -Zexe and suffix both, which conflict:w
+    LDFLAGS=3D"$LDFLAGS -Zmt -Zcrtdll"
+    ac_cv_exeext=3D.exe
+    ;;
+esac
+
+AC_EXEEXT
+AC_OBJEXT
+
+PROG_EXT=3D"$EXEEXT"
+AC_SUBST(PROG_EXT)
+test -n "$PROG_EXT" && AC_DEFINE_UNQUOTED(PROG_EXT,"$PROG_EXT")
+])dnl
+dnl ----------------------------------------------------------------------=
-----
+dnl CF_PROG_LINT version: 2 updated: 2009/08/12 04:43:14
+dnl ------------
+AC_DEFUN([CF_PROG_LINT],
+[
+AC_CHECK_PROGS(LINT, tdlint lint alint splint lclint)
+AC_SUBST(LINT_OPTS)
+])dnl
+dnl ----------------------------------------------------------------------=
-----
+dnl CF_REMOVE_DEFINE version: 3 updated: 2010/01/09 11:05:50
+dnl ----------------
+dnl Remove all -U and -D options that refer to the given symbol from a list
+dnl of C compiler options.  This works around the problem that not all
+dnl compilers process -U and -D options from left-to-right, so a -U option
+dnl cannot be used to cancel the effect of a preceding -D option.
+dnl
+dnl $1 =3D target (which could be the same as the source variable)
+dnl $2 =3D source (including '$')
+dnl $3 =3D symbol to remove
+define([CF_REMOVE_DEFINE],
+[
+$1=3D`echo "$2" | \
+	sed	-e 's/-[[UD]]'"$3"'\(=3D[[^ 	]]*\)\?[[ 	]]/ /g' \
+		-e 's/-[[UD]]'"$3"'\(=3D[[^ 	]]*\)\?[$]//g'`
+])dnl
+dnl ----------------------------------------------------------------------=
-----
+dnl CF_TRY_XOPEN_SOURCE version: 1 updated: 2011/10/30 17:09:50
+dnl -------------------
+dnl If _XOPEN_SOURCE is not defined in the compile environment, check if we
+dnl can define it successfully.
+AC_DEFUN([CF_TRY_XOPEN_SOURCE],[
+AC_CACHE_CHECK(if we should define _XOPEN_SOURCE,cf_cv_xopen_source,[
+	AC_TRY_COMPILE([
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+],[
+#ifndef _XOPEN_SOURCE
+make an error
+#endif],
+	[cf_cv_xopen_source=3Dno],
+	[cf_save=3D"$CPPFLAGS"
+	 CPPFLAGS=3D"$CPPFLAGS -D_XOPEN_SOURCE=3D$cf_XOPEN_SOURCE"
+	 AC_TRY_COMPILE([
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+],[
+#ifdef _XOPEN_SOURCE
+make an error
+#endif],
+	[cf_cv_xopen_source=3Dno],
+	[cf_cv_xopen_source=3D$cf_XOPEN_SOURCE])
+	CPPFLAGS=3D"$cf_save"
+	])
+])
+
+if test "$cf_cv_xopen_source" !=3D no ; then
+	CF_REMOVE_DEFINE(CFLAGS,$CFLAGS,_XOPEN_SOURCE)
+	CF_REMOVE_DEFINE(CPPFLAGS,$CPPFLAGS,_XOPEN_SOURCE)
+	cf_temp_xopen_source=3D"-D_XOPEN_SOURCE=3D$cf_cv_xopen_source"
+	CF_ADD_CFLAGS($cf_temp_xopen_source)
+fi
+])
+dnl ----------------------------------------------------------------------=
-----
+dnl CF_UPPER version: 5 updated: 2001/01/29 23:40:59
+dnl --------
+dnl Make an uppercase version of a variable
+dnl $1=3Duppercase($2)
+AC_DEFUN([CF_UPPER],
+[
+$1=3D`echo "$2" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRST=
UVWXYZ___%`
+])dnl
+dnl ----------------------------------------------------------------------=
-----
+dnl CF_VERBOSE version: 3 updated: 2007/07/29 09:55:12
+dnl ----------
+dnl Use AC_VERBOSE w/o the warnings
+AC_DEFUN([CF_VERBOSE],
+[test -n "$verbose" && echo "	$1" 1>&AC_FD_MSG
+CF_MSG_LOG([$1])
+])dnl
+dnl ----------------------------------------------------------------------=
-----
+dnl CF_WITH_DBMALLOC version: 7 updated: 2010/06/21 17:26:47
+dnl ----------------
+dnl Configure-option for dbmalloc.  The optional parameter is used to over=
ride
+dnl the updating of $LIBS, e.g., to avoid conflict with subsequent tests.
+AC_DEFUN([CF_WITH_DBMALLOC],[
+CF_NO_LEAKS_OPTION(dbmalloc,
+	[  --with-dbmalloc         test: use Conor Cahill's dbmalloc library],
+	[USE_DBMALLOC])
+
+if test "$with_dbmalloc" =3D yes ; then
+	AC_CHECK_HEADER(dbmalloc.h,
+		[AC_CHECK_LIB(dbmalloc,[debug_malloc]ifelse([$1],,[],[,$1]))])
+fi
+])dnl
+dnl ----------------------------------------------------------------------=
-----
+dnl CF_WITH_DMALLOC version: 7 updated: 2010/06/21 17:26:47
+dnl ---------------
+dnl Configure-option for dmalloc.  The optional parameter is used to overr=
ide
+dnl the updating of $LIBS, e.g., to avoid conflict with subsequent tests.
+AC_DEFUN([CF_WITH_DMALLOC],[
+CF_NO_LEAKS_OPTION(dmalloc,
+	[  --with-dmalloc          test: use Gray Watson's dmalloc library],
+	[USE_DMALLOC])
+
+if test "$with_dmalloc" =3D yes ; then
+	AC_CHECK_HEADER(dmalloc.h,
+		[AC_CHECK_LIB(dmalloc,[dmalloc_debug]ifelse([$1],,[],[,$1]))])
+fi
+])dnl
+dnl ----------------------------------------------------------------------=
-----
+dnl CF_WITH_VALGRIND version: 1 updated: 2006/12/14 18:00:21
+dnl ----------------
+AC_DEFUN([CF_WITH_VALGRIND],[
+CF_NO_LEAKS_OPTION(valgrind,
+	[  --with-valgrind         test: use valgrind],
+	[USE_VALGRIND])
+])dnl
+dnl ----------------------------------------------------------------------=
-----
+dnl CF_WITH_WARNINGS version: 5 updated: 2004/07/23 14:40:34
+dnl ----------------
+dnl Combine the checks for gcc features into a configure-script option
+dnl
+dnl Parameters:
+dnl	$1 - see CF_GCC_WARNINGS
+AC_DEFUN([CF_WITH_WARNINGS],
+[
+if ( test "$GCC" =3D yes || test "$GXX" =3D yes )
+then
+AC_MSG_CHECKING(if you want to check for gcc warnings)
+AC_ARG_WITH(warnings,
+	[  --with-warnings         test: turn on gcc warnings],
+	[cf_opt_with_warnings=3D$withval],
+	[cf_opt_with_warnings=3Dno])
+AC_MSG_RESULT($cf_opt_with_warnings)
+if test "$cf_opt_with_warnings" !=3D no ; then
+	CF_GCC_ATTRIBUTES
+	CF_GCC_WARNINGS([$1])
+fi
+fi
+])dnl
+dnl ----------------------------------------------------------------------=
-----
+dnl CF_XOPEN_SOURCE version: 42 updated: 2012/01/07 08:26:49
+dnl ---------------
+dnl Try to get _XOPEN_SOURCE defined properly that we can use POSIX functi=
ons,
+dnl or adapt to the vendor's definitions to get equivalent functionality,
+dnl without losing the common non-POSIX features.
+dnl
+dnl Parameters:
+dnl	$1 is the nominal value for _XOPEN_SOURCE
+dnl	$2 is the nominal value for _POSIX_C_SOURCE
+AC_DEFUN([CF_XOPEN_SOURCE],[
+
+cf_XOPEN_SOURCE=3Difelse([$1],,500,[$1])
+cf_POSIX_C_SOURCE=3Difelse([$2],,199506L,[$2])
+cf_xopen_source=3D
+
+case $host_os in #(vi
+aix[[4-7]]*) #(vi
+	cf_xopen_source=3D"-D_ALL_SOURCE"
+	;;
+cygwin) #(vi
+	cf_XOPEN_SOURCE=3D600
+	;;
+darwin[[0-8]].*) #(vi
+	cf_xopen_source=3D"-D_APPLE_C_SOURCE"
+	;;
+darwin*) #(vi
+	cf_xopen_source=3D"-D_DARWIN_C_SOURCE"
+	cf_XOPEN_SOURCE=3D
+	;;
+freebsd*|dragonfly*) #(vi
+	# 5.x headers associate
+	#	_XOPEN_SOURCE=3D600 with _POSIX_C_SOURCE=3D200112L
+	#	_XOPEN_SOURCE=3D500 with _POSIX_C_SOURCE=3D199506L
+	cf_POSIX_C_SOURCE=3D200112L
+	cf_XOPEN_SOURCE=3D600
+	cf_xopen_source=3D"-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=3D$cf_P=
OSIX_C_SOURCE -D_XOPEN_SOURCE=3D$cf_XOPEN_SOURCE"
+	;;
+hpux11*) #(vi
+	cf_xopen_source=3D"-D_HPUX_SOURCE -D_XOPEN_SOURCE=3D500"
+	;;
+hpux*) #(vi
+	cf_xopen_source=3D"-D_HPUX_SOURCE"
+	;;
+irix[[56]].*) #(vi
+	cf_xopen_source=3D"-D_SGI_SOURCE"
+	cf_XOPEN_SOURCE=3D
+	;;
+linux*|gnu*|mint*|k*bsd*-gnu) #(vi
+	CF_GNU_SOURCE
+	;;
+mirbsd*) #(vi
+	# setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other =
headers which use u_int / u_short types
+	cf_XOPEN_SOURCE=3D
+	CF_POSIX_C_SOURCE($cf_POSIX_C_SOURCE)
+	;;
+netbsd*) #(vi
+	cf_xopen_source=3D"-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 =
for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
+	;;
+openbsd[[4-9]]*) #(vi
+	# setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, n=
eeded for ncursesw
+	cf_xopen_source=3D"-D_BSD_SOURCE"
+	cf_XOPEN_SOURCE=3D600
+	;;
+openbsd*) #(vi
+	# setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for nc=
ursesw
+	;;
+osf[[45]]*) #(vi
+	cf_xopen_source=3D"-D_OSF_SOURCE"
+	;;
+nto-qnx*) #(vi
+	cf_xopen_source=3D"-D_QNX_SOURCE"
+	;;
+sco*) #(vi
+	# setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
+	;;
+solaris2.*) #(vi
+	cf_xopen_source=3D"-D__EXTENSIONS__"
+	;;
+*)
+	CF_TRY_XOPEN_SOURCE
+	CF_POSIX_C_SOURCE($cf_POSIX_C_SOURCE)
+	;;
+esac
+
+if test -n "$cf_xopen_source" ; then
+	CF_ADD_CFLAGS($cf_xopen_source)
+fi
+
+dnl In anything but the default case, we may have system-specific setting
+dnl which is still not guaranteed to provide all of the entrypoints that
+dnl _XOPEN_SOURCE would yield.
+if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
+	AC_MSG_CHECKING(if _XOPEN_SOURCE really is set)
+	AC_TRY_COMPILE([#include <stdlib.h>],[
+#ifndef _XOPEN_SOURCE
+make an error
+#endif],
+	[cf_XOPEN_SOURCE_set=3Dyes],
+	[cf_XOPEN_SOURCE_set=3Dno])
+	AC_MSG_RESULT($cf_XOPEN_SOURCE_set)
+	if test $cf_XOPEN_SOURCE_set =3D yes
+	then
+		AC_TRY_COMPILE([#include <stdlib.h>],[
+#if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
+make an error
+#endif],
+		[cf_XOPEN_SOURCE_set_ok=3Dyes],
+		[cf_XOPEN_SOURCE_set_ok=3Dno])
+		if test $cf_XOPEN_SOURCE_set_ok =3D no
+		then
+			AC_MSG_WARN(_XOPEN_SOURCE is lower than requested)
+		fi
+	else
+		CF_TRY_XOPEN_SOURCE
+	fi
+fi
+])
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/closure.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/closure.c	Wed Jul 25 16:21:35 2012 +0300
@@ -0,0 +1,251 @@
+/* $Id: closure.c,v 1.9 2010/06/09 08:21:47 tom Exp $ */
+
+#include "defs.h"
+
+Value_t *itemset;
+Value_t *itemsetend;
+unsigned *ruleset;
+
+static unsigned *first_derives;
+static unsigned *EFF;
+
+static void
+set_EFF(void)
+{
+    unsigned *row;
+    int symbol;
+    short *sp;
+    int rowsize;
+    int i;
+    int rule;
+
+    rowsize =3D WORDSIZE(nvars);
+    EFF =3D NEW2(nvars * rowsize, unsigned);
+
+    row =3D EFF;
+    for (i =3D start_symbol; i < nsyms; i++)
+    {
+	sp =3D derives[i];
+	for (rule =3D *sp; rule > 0; rule =3D *++sp)
+	{
+	    symbol =3D ritem[rrhs[rule]];
+	    if (ISVAR(symbol))
+	    {
+		symbol -=3D start_symbol;
+		SETBIT(row, symbol);
+	    }
+	}
+	row +=3D rowsize;
+    }
+
+    reflexive_transitive_closure(EFF, nvars);
+
+#ifdef	DEBUG
+    print_EFF();
+#endif
+}
+
+void
+set_first_derives(void)
+{
+    unsigned *rrow;
+    unsigned *vrow;
+    int j;
+    unsigned k;
+    unsigned cword =3D 0;
+    short *rp;
+
+    int rule;
+    int i;
+    int rulesetsize;
+    int varsetsize;
+
+    rulesetsize =3D WORDSIZE(nrules);
+    varsetsize =3D WORDSIZE(nvars);
+    first_derives =3D NEW2(nvars * rulesetsize, unsigned) - ntokens * rule=
setsize;
+
+    set_EFF();
+
+    rrow =3D first_derives + ntokens * rulesetsize;
+    for (i =3D start_symbol; i < nsyms; i++)
+    {
+	vrow =3D EFF + ((i - ntokens) * varsetsize);
+	k =3D BITS_PER_WORD;
+	for (j =3D start_symbol; j < nsyms; k++, j++)
+	{
+	    if (k >=3D BITS_PER_WORD)
+	    {
+		cword =3D *vrow++;
+		k =3D 0;
+	    }
+
+	    if (cword & (unsigned)(1 << k))
+	    {
+		rp =3D derives[j];
+		while ((rule =3D *rp++) >=3D 0)
+		{
+		    SETBIT(rrow, rule);
+		}
+	    }
+	}
+
+	rrow +=3D rulesetsize;
+    }
+
+#ifdef	DEBUG
+    print_first_derives();
+#endif
+
+    FREE(EFF);
+}
+
+void
+closure(short *nucleus, int n)
+{
+    unsigned ruleno;
+    unsigned word;
+    unsigned i;
+    Value_t *csp;
+    unsigned *dsp;
+    unsigned *rsp;
+    int rulesetsize;
+
+    Value_t *csend;
+    unsigned *rsend;
+    int symbol;
+    Value_t itemno;
+
+    rulesetsize =3D WORDSIZE(nrules);
+    rsend =3D ruleset + rulesetsize;
+    for (rsp =3D ruleset; rsp < rsend; rsp++)
+	*rsp =3D 0;
+
+    csend =3D nucleus + n;
+    for (csp =3D nucleus; csp < csend; ++csp)
+    {
+	symbol =3D ritem[*csp];
+	if (ISVAR(symbol))
+	{
+	    dsp =3D first_derives + symbol * rulesetsize;
+	    rsp =3D ruleset;
+	    while (rsp < rsend)
+		*rsp++ |=3D *dsp++;
+	}
+    }
+
+    ruleno =3D 0;
+    itemsetend =3D itemset;
+    csp =3D nucleus;
+    for (rsp =3D ruleset; rsp < rsend; ++rsp)
+    {
+	word =3D *rsp;
+	if (word)
+	{
+	    for (i =3D 0; i < BITS_PER_WORD; ++i)
+	    {
+		if (word & (unsigned)(1 << i))
+		{
+		    itemno =3D rrhs[ruleno + i];
+		    while (csp < csend && *csp < itemno)
+			*itemsetend++ =3D *csp++;
+		    *itemsetend++ =3D itemno;
+		    while (csp < csend && *csp =3D=3D itemno)
+			++csp;
+		}
+	    }
+	}
+	ruleno +=3D BITS_PER_WORD;
+    }
+
+    while (csp < csend)
+	*itemsetend++ =3D *csp++;
+
+#ifdef	DEBUG
+    print_closure(n);
+#endif
+}
+
+void
+finalize_closure(void)
+{
+    FREE(itemset);
+    FREE(ruleset);
+    FREE(first_derives + ntokens * WORDSIZE(nrules));
+}
+
+#ifdef	DEBUG
+
+void
+print_closure(int n)
+{
+    short *isp;
+
+    printf("\n\nn =3D %d\n\n", n);
+    for (isp =3D itemset; isp < itemsetend; isp++)
+	printf("   %d\n", *isp);
+}
+
+void
+print_EFF(void)
+{
+    int i, j;
+    unsigned *rowp;
+    unsigned word;
+    unsigned k;
+
+    printf("\n\nEpsilon Free Firsts\n");
+
+    for (i =3D start_symbol; i < nsyms; i++)
+    {
+	printf("\n%s", symbol_name[i]);
+	rowp =3D EFF + ((i - start_symbol) * WORDSIZE(nvars));
+	word =3D *rowp++;
+
+	k =3D BITS_PER_WORD;
+	for (j =3D 0; j < nvars; k++, j++)
+	{
+	    if (k >=3D BITS_PER_WORD)
+	    {
+		word =3D *rowp++;
+		k =3D 0;
+	    }
+
+	    if (word & (1 << k))
+		printf("  %s", symbol_name[start_symbol + j]);
+	}
+    }
+}
+
+void
+print_first_derives(void)
+{
+    int i;
+    int j;
+    unsigned *rp;
+    unsigned cword =3D 0;
+    unsigned k;
+
+    printf("\n\n\nFirst Derives\n");
+
+    for (i =3D start_symbol; i < nsyms; i++)
+    {
+	printf("\n%s derives\n", symbol_name[i]);
+	rp =3D first_derives + i * WORDSIZE(nrules);
+	k =3D BITS_PER_WORD;
+	for (j =3D 0; j <=3D nrules; k++, j++)
+	{
+	    if (k >=3D BITS_PER_WORD)
+	    {
+		cword =3D *rp++;
+		k =3D 0;
+	    }
+
+	    if (cword & (1 << k))
+		printf("   %d\n", j);
+	}
+    }
+
+    fflush(stdout);
+}
+
+#endif
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/config.guess
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/config.guess	Wed Jul 25 16:21:35 2012 +0300
@@ -0,0 +1,1511 @@
+#! /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,
+#   2911 Free Software Foundation, Inc.
+
+timestamp=3D'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
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+
+# Originally written by Per Bothner.  Please send patches (context
+# diff format) to <config-patches at gnu.org> and include a ChangeLog
+# entry.
+#
+# This script attempts to guess a canonical system name similar to
+# config.sub.  If it succeeds, it prints the system name on stdout, and
+# exits with 0.  Otherwise, it exits with 1.
+#
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=3Dconfig.git;a=3Dblob_plain;f=3Dco=
nfig.guess;hb=3DHEAD
+
+me=3D`echo "$0" | sed -e 's,.*/,,'`
+
+usage=3D"\
+Usage: $0 [OPTION]
+
+Output the configuration name of the system \`$me' is run on.
+
+Operation modes:
+  -h, --help         print this help, then exit
+  -t, --time-stamp   print date of last modification, then exit
+  -v, --version      print version number, then exit
+
+Report bugs and patches to <config-patches at gnu.org>."
+
+version=3D"\
+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, 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=
."
+
+help=3D"
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+  case $1 in
+    --time-stamp | --time* | -t )
+       echo "$timestamp" ; exit ;;
+    --version | -v )
+       echo "$version" ; exit ;;
+    --help | --h* | -h )
+       echo "$usage"; exit ;;
+    -- )     # Stop option processing
+       shift; break ;;
+    - )	# Use stdin as input.
+       break ;;
+    -* )
+       echo "$me: invalid option $1$help" >&2
+       exit 1 ;;
+    * )
+       break ;;
+  esac
+done
+
+if test $# !=3D 0; then
+  echo "$me: too many arguments$help" >&2
+  exit 1
+fi
+
+trap 'exit 1' 1 2 15
+
+# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
+# compiler to aid in system detection is discouraged as it requires
+# temporary files to be created and, as you can see below, it is a
+# headache to deal with in a portable fashion.
+
+# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
+# use `HOST_CC' if defined, but it is deprecated.
+
+# Portable tmp directory creation inspired by the Autoconf team.
+
+set_cc_for_build=3D'
+trap "exitcode=3D\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/nu=
ll) && exit \$exitcode" 0 ;
+trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 1=
3 15 ;
+: ${TMPDIR=3D/tmp} ;
+ { tmp=3D`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test=
 -n "$tmp" && test -d "$tmp" ; } ||
+ { test -n "$RANDOM" && tmp=3D$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir =
$tmp) ; } ||
+ { tmp=3D$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: crea=
ting insecure temp directory" >&2 ; } ||
+ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1=
 ; } ;
+dummy=3D$tmp/dummy ;
+tmpfiles=3D"$dummy.c $dummy.o $dummy.rel $dummy" ;
+case $CC_FOR_BUILD,$HOST_CC,$CC in
+ ,,)    echo "int x;" > $dummy.c ;
+	for c in cc gcc c89 c99 ; do
+	  if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
+	     CC_FOR_BUILD=3D"$c"; break ;
+	  fi ;
+	done ;
+	if test x"$CC_FOR_BUILD" =3D x ; then
+	  CC_FOR_BUILD=3Dno_compiler_found ;
+	fi
+	;;
+ ,,*)   CC_FOR_BUILD=3D$CC ;;
+ ,*,*)  CC_FOR_BUILD=3D$HOST_CC ;;
+esac ; set_cc_for_build=3D ;'
+
+# This is needed to find uname on a Pyramid OSx when run in the BSD univer=
se.
+# (ghazi at noc.rutgers.edu 1994-08-24)
+if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+	PATH=3D$PATH:/.attbin ; export PATH
+fi
+
+UNAME_MACHINE=3D`(uname -m) 2>/dev/null` || UNAME_MACHINE=3Dunknown
+UNAME_RELEASE=3D`(uname -r) 2>/dev/null` || UNAME_RELEASE=3Dunknown
+UNAME_SYSTEM=3D`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=3Dunknown
+UNAME_VERSION=3D`(uname -v) 2>/dev/null` || UNAME_VERSION=3Dunknown
+
+# Note: order is significant - the case branches are not exclusive.
+
+case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" =
in
+    *:NetBSD:*:*)
+	# NetBSD (nbsd) targets should (where applicable) match one or
+	# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
+	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
+	# switched to ELF, *-*-netbsd* would select the old
+	# object file format.  This provides both forward
+	# compatibility and a consistent mechanism for selecting the
+	# object file format.
+	#
+	# Note: NetBSD doesn't particularly care about the vendor
+	# portion of the name.  We always set it to "unknown".
+	sysctl=3D"sysctl -n hw.machine_arch"
+	UNAME_MACHINE_ARCH=3D`(/sbin/$sysctl 2>/dev/null || \
+	    /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
+	case "${UNAME_MACHINE_ARCH}" in
+	    armeb) machine=3Darmeb-unknown ;;
+	    arm*) machine=3Darm-unknown ;;
+	    sh3el) machine=3Dshl-unknown ;;
+	    sh3eb) machine=3Dsh-unknown ;;
+	    sh5el) machine=3Dsh5le-unknown ;;
+	    *) machine=3D${UNAME_MACHINE_ARCH}-unknown ;;
+	esac
+	# The Operating System including object format, if it has switched
+	# to ELF recently, or will in the future.
+	case "${UNAME_MACHINE_ARCH}" in
+	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
+		eval $set_cc_for_build
+		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
+			| grep -q __ELF__
+		then
+		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout=
).
+		    # Return netbsd for either.  FIX?
+		    os=3Dnetbsd
+		else
+		    os=3Dnetbsdelf
+		fi
+		;;
+	    *)
+		os=3Dnetbsd
+		;;
+	esac
+	# The OS release
+	# Debian GNU/NetBSD machines have a different userland, and
+	# thus, need a distinct triplet. However, they do not need
+	# kernel version information, so it can be replaced with a
+	# suitable tag, in the style of linux-gnu.
+	case "${UNAME_VERSION}" in
+	    Debian*)
+		release=3D'-gnu'
+		;;
+	    *)
+		release=3D`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+		;;
+	esac
+	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
+	# contains redundant information, the shorter form:
+	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
+	echo "${machine}-${os}${release}"
+	exit ;;
+    *:OpenBSD:*:*)
+	UNAME_MACHINE_ARCH=3D`arch | sed 's/OpenBSD.//'`
+	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+	exit ;;
+    *:ekkoBSD:*:*)
+	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
+	exit ;;
+    *:SolidBSD:*:*)
+	echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+	exit ;;
+    macppc:MirBSD:*:*)
+	echo powerpc-unknown-mirbsd${UNAME_RELEASE}
+	exit ;;
+    *:MirBSD:*:*)
+	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
+	exit ;;
+    alpha:OSF1:*:*)
+	case $UNAME_RELEASE in
+	    *4.0)
+		UNAME_RELEASE=3D`/usr/sbin/sizer -v | awk '{print $3}'`
+		;;
+	    *5.*)
+		UNAME_RELEASE=3D`/usr/sbin/sizer -v | awk '{print $4}'`
+		;;
+	esac
+	# According to Compaq, /usr/sbin/psrinfo has been available on
+	# OSF/1 and Tru64 systems produced since 1995.  I hope that
+	# covers most systems running today.  This code pipes the CPU
+	# types through head -n 1, so we only detect the type of CPU 0.
+	ALPHA_CPU_TYPE=3D`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\)=
 processor.*$/\1/p' | head -n 1`
+	case "$ALPHA_CPU_TYPE" in
+	    "EV4 (21064)")
+		UNAME_MACHINE=3D"alpha" ;;
+	    "EV4.5 (21064)")
+		UNAME_MACHINE=3D"alpha" ;;
+	    "LCA4 (21066/21068)")
+		UNAME_MACHINE=3D"alpha" ;;
+	    "EV5 (21164)")
+		UNAME_MACHINE=3D"alphaev5" ;;
+	    "EV5.6 (21164A)")
+		UNAME_MACHINE=3D"alphaev56" ;;
+	    "EV5.6 (21164PC)")
+		UNAME_MACHINE=3D"alphapca56" ;;
+	    "EV5.7 (21164PC)")
+		UNAME_MACHINE=3D"alphapca57" ;;
+	    "EV6 (21264)")
+		UNAME_MACHINE=3D"alphaev6" ;;
+	    "EV6.7 (21264A)")
+		UNAME_MACHINE=3D"alphaev67" ;;
+	    "EV6.8CB (21264C)")
+		UNAME_MACHINE=3D"alphaev68" ;;
+	    "EV6.8AL (21264B)")
+		UNAME_MACHINE=3D"alphaev68" ;;
+	    "EV6.8CX (21264D)")
+		UNAME_MACHINE=3D"alphaev68" ;;
+	    "EV6.9A (21264/EV69A)")
+		UNAME_MACHINE=3D"alphaev69" ;;
+	    "EV7 (21364)")
+		UNAME_MACHINE=3D"alphaev7" ;;
+	    "EV7.9 (21364A)")
+		UNAME_MACHINE=3D"alphaev79" ;;
+	esac
+	# A Pn.n version is a patched version.
+	# A Vn.n version is a released version.
+	# A Tn.n version is a released field test version.
+	# A Xn.n version is an unreleased experimental baselevel.
+	# 1.2 uses "1.2" for uname -r.
+	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//=
' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+	# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
+	exitcode=3D$?
+	trap '' 0
+	exit $exitcode ;;
+    Alpha\ *:Windows_NT*:*)
+	# How do we know it's Interix rather than the generic POSIX subsystem?
+	# Should we change UNAME_MACHINE based on the output of uname instead
+	# of the specific Alpha model?
+	echo alpha-pc-interix
+	exit ;;
+    21064:Windows_NT:50:3)
+	echo alpha-dec-winnt3.5
+	exit ;;
+    Amiga*:UNIX_System_V:4.0:*)
+	echo m68k-unknown-sysv4
+	exit ;;
+    *:[Aa]miga[Oo][Ss]:*:*)
+	echo ${UNAME_MACHINE}-unknown-amigaos
+	exit ;;
+    *:[Mm]orph[Oo][Ss]:*:*)
+	echo ${UNAME_MACHINE}-unknown-morphos
+	exit ;;
+    *:OS/390:*:*)
+	echo i370-ibm-openedition
+	exit ;;
+    *:z/VM:*:*)
+	echo s390-ibm-zvmoe
+	exit ;;
+    *:OS400:*:*)
+	echo powerpc-ibm-os400
+	exit ;;
+    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
+	echo arm-acorn-riscix${UNAME_RELEASE}
+	exit ;;
+    arm:riscos:*:*|arm:RISCOS:*:*)
+	echo arm-unknown-riscos
+	exit ;;
+    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
+	echo hppa1.1-hitachi-hiuxmpp
+	exit ;;
+    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
+	# akee at wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
+	if test "`(/bin/universe) 2>/dev/null`" =3D att ; then
+		echo pyramid-pyramid-sysv3
+	else
+		echo pyramid-pyramid-bsd
+	fi
+	exit ;;
+    NILE*:*:*:dcosx)
+	echo pyramid-pyramid-svr4
+	exit ;;
+    DRS?6000:unix:4.0:6*)
+	echo sparc-icl-nx6
+	exit ;;
+    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
+	case `/usr/bin/uname -p` in
+	    sparc) echo sparc-icl-nx7; exit ;;
+	esac ;;
+    s390x:SunOS:*:*)
+	echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*/=
/'`
+	exit ;;
+    sun4H:SunOS:5.*:*)
+	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit ;;
+    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
+	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit ;;
+    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
+	echo i386-pc-auroraux${UNAME_RELEASE}
+	exit ;;
+    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
+	eval $set_cc_for_build
+	SUN_ARCH=3D"i386"
+	# If there is a compiler, see if it is configured for 64-bit objects.
+	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
+	# This test works for both compilers.
+	if [ "$CC_FOR_BUILD" !=3D 'no_compiler_found' ]; then
+	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
+		(CCOPTS=3D $CC_FOR_BUILD -E - 2>/dev/null) | \
+		grep IS_64BIT_ARCH >/dev/null
+	    then
+		SUN_ARCH=3D"x86_64"
+	    fi
+	fi
+	echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit ;;
+    sun4*:SunOS:6*:*)
+	# According to config.sub, this is the proper way to canonicalize
+	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
+	# it's likely to be more like Solaris than SunOS4.
+	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit ;;
+    sun4*:SunOS:*:*)
+	case "`/usr/bin/arch -k`" in
+	    Series*|S4*)
+		UNAME_RELEASE=3D`uname -v`
+		;;
+	esac
+	# Japanese Language versions have a version number like `4.1.3-JL'.
+	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+	exit ;;
+    sun3*:SunOS:*:*)
+	echo m68k-sun-sunos${UNAME_RELEASE}
+	exit ;;
+    sun*:*:4.2BSD:*)
+	UNAME_RELEASE=3D`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev=
/null`
+	test "x${UNAME_RELEASE}" =3D "x" && UNAME_RELEASE=3D3
+	case "`/bin/arch`" in
+	    sun3)
+		echo m68k-sun-sunos${UNAME_RELEASE}
+		;;
+	    sun4)
+		echo sparc-sun-sunos${UNAME_RELEASE}
+		;;
+	esac
+	exit ;;
+    aushp:SunOS:*:*)
+	echo sparc-auspex-sunos${UNAME_RELEASE}
+	exit ;;
+    # The situation for MiNT is a little confusing.  The machine name
+    # can be virtually everything (everything which is not
+    # "atarist" or "atariste" at least should have a processor
+    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
+    # to the lowercase version "mint" (or "freemint").  Finally
+    # the system name "TOS" denotes a system which is actually not
+    # MiNT.  But MiNT is downward compatible to TOS, so this should
+    # be no problem.
+    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
+	echo m68k-atari-mint${UNAME_RELEASE}
+	exit ;;
+    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
+	echo m68k-atari-mint${UNAME_RELEASE}
+	exit ;;
+    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
+	echo m68k-atari-mint${UNAME_RELEASE}
+	exit ;;
+    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
+	echo m68k-milan-mint${UNAME_RELEASE}
+	exit ;;
+    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
+	echo m68k-hades-mint${UNAME_RELEASE}
+	exit ;;
+    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
+	echo m68k-unknown-mint${UNAME_RELEASE}
+	exit ;;
+    m68k:machten:*:*)
+	echo m68k-apple-machten${UNAME_RELEASE}
+	exit ;;
+    powerpc:machten:*:*)
+	echo powerpc-apple-machten${UNAME_RELEASE}
+	exit ;;
+    RISC*:Mach:*:*)
+	echo mips-dec-mach_bsd4.3
+	exit ;;
+    RISC*:ULTRIX:*:*)
+	echo mips-dec-ultrix${UNAME_RELEASE}
+	exit ;;
+    VAX*:ULTRIX*:*:*)
+	echo vax-dec-ultrix${UNAME_RELEASE}
+	exit ;;
+    2020:CLIX:*:* | 2430:CLIX:*:*)
+	echo clipper-intergraph-clix${UNAME_RELEASE}
+	exit ;;
+    mips:*:*:UMIPS | mips:*:*:RISCos)
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+#ifdef __cplusplus
+#include <stdio.h>  /* for printf() prototype */
+	int main (int argc, char *argv[]) {
+#else
+	int main (argc, argv) int argc; char *argv[]; {
+#endif
+	#if defined (host_mips) && defined (MIPSEB)
+	#if defined (SYSTYPE_SYSV)
+	  printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+	#endif
+	#if defined (SYSTYPE_SVR4)
+	  printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
+	#endif
+	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
+	  printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
+	#endif
+	#endif
+	  exit (-1);
+	}
+EOF
+	$CC_FOR_BUILD -o $dummy $dummy.c &&
+	  dummyarg=3D`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
+	  SYSTEM_NAME=3D`$dummy $dummyarg` &&
+	    { echo "$SYSTEM_NAME"; exit; }
+	echo mips-mips-riscos${UNAME_RELEASE}
+	exit ;;
+    Motorola:PowerMAX_OS:*:*)
+	echo powerpc-motorola-powermax
+	exit ;;
+    Motorola:*:4.3:PL8-*)
+	echo powerpc-harris-powermax
+	exit ;;
+    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
+	echo powerpc-harris-powermax
+	exit ;;
+    Night_Hawk:Power_UNIX:*:*)
+	echo powerpc-harris-powerunix
+	exit ;;
+    m88k:CX/UX:7*:*)
+	echo m88k-harris-cxux7
+	exit ;;
+    m88k:*:4*:R4*)
+	echo m88k-motorola-sysv4
+	exit ;;
+    m88k:*:3*:R3*)
+	echo m88k-motorola-sysv3
+	exit ;;
+    AViiON:dgux:*:*)
+	# DG/UX returns AViiON for all architectures
+	UNAME_PROCESSOR=3D`/usr/bin/uname -p`
+	if [ $UNAME_PROCESSOR =3D mc88100 ] || [ $UNAME_PROCESSOR =3D mc88110 ]
+	then
+	    if [ ${TARGET_BINARY_INTERFACE}x =3D m88kdguxelfx ] || \
+	       [ ${TARGET_BINARY_INTERFACE}x =3D x ]
+	    then
+		echo m88k-dg-dgux${UNAME_RELEASE}
+	    else
+		echo m88k-dg-dguxbcs${UNAME_RELEASE}
+	    fi
+	else
+	    echo i586-dg-dgux${UNAME_RELEASE}
+	fi
+	exit ;;
+    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
+	echo m88k-dolphin-sysv3
+	exit ;;
+    M88*:*:R3*:*)
+	# Delta 88k system running SVR3
+	echo m88k-motorola-sysv3
+	exit ;;
+    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
+	echo m88k-tektronix-sysv3
+	exit ;;
+    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
+	echo m68k-tektronix-bsd
+	exit ;;
+    *:IRIX*:*:*)
+	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+	exit ;;
+    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
+	echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
+	exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
+    i*86:AIX:*:*)
+	echo i386-ibm-aix
+	exit ;;
+    ia64:AIX:*:*)
+	if [ -x /usr/bin/oslevel ] ; then
+		IBM_REV=3D`/usr/bin/oslevel`
+	else
+		IBM_REV=3D${UNAME_VERSION}.${UNAME_RELEASE}
+	fi
+	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
+	exit ;;
+    *:AIX:2:3)
+	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
+		eval $set_cc_for_build
+		sed 's/^		//' << EOF >$dummy.c
+		#include <sys/systemcfg.h>
+
+		main()
+			{
+			if (!__power_pc())
+				exit(1);
+			puts("powerpc-ibm-aix3.2.5");
+			exit(0);
+			}
+EOF
+		if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=3D`$dummy`
+		then
+			echo "$SYSTEM_NAME"
+		else
+			echo rs6000-ibm-aix3.2.5
+		fi
+	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
+		echo rs6000-ibm-aix3.2.4
+	else
+		echo rs6000-ibm-aix3.2
+	fi
+	exit ;;
+    *:AIX:*:[4567])
+	IBM_CPU_ID=3D`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk=
 '{ print $1 }'`
+	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; th=
en
+		IBM_ARCH=3Drs6000
+	else
+		IBM_ARCH=3Dpowerpc
+	fi
+	if [ -x /usr/bin/oslevel ] ; then
+		IBM_REV=3D`/usr/bin/oslevel`
+	else
+		IBM_REV=3D${UNAME_VERSION}.${UNAME_RELEASE}
+	fi
+	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+	exit ;;
+    *:AIX:*:*)
+	echo rs6000-ibm-aix
+	exit ;;
+    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+	echo romp-ibm-bsd4.4
+	exit ;;
+    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
+	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
+	exit ;;                             # report: romp-ibm BSD 4.3
+    *:BOSX:*:*)
+	echo rs6000-bull-bosx
+	exit ;;
+    DPX/2?00:B.O.S.:*:*)
+	echo m68k-bull-sysv3
+	exit ;;
+    9000/[34]??:4.3bsd:1.*:*)
+	echo m68k-hp-bsd
+	exit ;;
+    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
+	echo m68k-hp-bsd4.4
+	exit ;;
+    9000/[34678]??:HP-UX:*:*)
+	HPUX_REV=3D`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+	case "${UNAME_MACHINE}" in
+	    9000/31? )            HP_ARCH=3Dm68000 ;;
+	    9000/[34]?? )         HP_ARCH=3Dm68k ;;
+	    9000/[678][0-9][0-9])
+		if [ -x /usr/bin/getconf ]; then
+		    sc_cpu_version=3D`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
+		    sc_kernel_bits=3D`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+		    case "${sc_cpu_version}" in
+                      523) HP_ARCH=3D"hppa1.0" ;; # CPU_PA_RISC1_0
+                      528) HP_ARCH=3D"hppa1.1" ;; # CPU_PA_RISC1_1
+                      532)                      # CPU_PA_RISC2_0
+                        case "${sc_kernel_bits}" in
+                          32) HP_ARCH=3D"hppa2.0n" ;;
+                          64) HP_ARCH=3D"hppa2.0w" ;;
+			  '') HP_ARCH=3D"hppa2.0" ;;   # HP-UX 10.20
+                        esac ;;
+                    esac
+		fi
+		if [ "${HP_ARCH}" =3D "" ]; then
+		    eval $set_cc_for_build
+		    sed 's/^              //' << EOF >$dummy.c
+
+              #define _HPUX_SOURCE
+              #include <stdlib.h>
+              #include <unistd.h>
+
+              int main ()
+              {
+              #if defined(_SC_KERNEL_BITS)
+                  long bits =3D sysconf(_SC_KERNEL_BITS);
+              #endif
+                  long cpu  =3D sysconf (_SC_CPU_VERSION);
+
+                  switch (cpu)
+              	{
+              	case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+              	case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+              	case CPU_PA_RISC2_0:
+              #if defined(_SC_KERNEL_BITS)
+              	    switch (bits)
+              		{
+              		case 64: puts ("hppa2.0w"); break;
+              		case 32: puts ("hppa2.0n"); break;
+              		default: puts ("hppa2.0"); break;
+              		} break;
+              #else  /* !defined(_SC_KERNEL_BITS) */
+              	    puts ("hppa2.0"); break;
+              #endif
+              	default: puts ("hppa1.0"); break;
+              	}
+                  exit (0);
+              }
+EOF
+		    (CCOPTS=3D $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=
=3D`$dummy`
+		    test -z "$HP_ARCH" && HP_ARCH=3Dhppa
+		fi ;;
+	esac
+	if [ ${HP_ARCH} =3D "hppa2.0w" ]
+	then
+	    eval $set_cc_for_build
+
+	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
+	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
+	    # generating 64-bit code.  GNU and HP use different nomenclature:
+	    #
+	    # $ CC_FOR_BUILD=3Dcc ./config.guess
+	    # =3D> hppa2.0w-hp-hpux11.23
+	    # $ CC_FOR_BUILD=3D"cc +DA2.0w" ./config.guess
+	    # =3D> hppa64-hp-hpux11.23
+
+	    if echo __LP64__ | (CCOPTS=3D $CC_FOR_BUILD -E - 2>/dev/null) |
+		grep -q __LP64__
+	    then
+		HP_ARCH=3D"hppa2.0w"
+	    else
+		HP_ARCH=3D"hppa64"
+	    fi
+	fi
+	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+	exit ;;
+    ia64:HP-UX:*:*)
+	HPUX_REV=3D`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+	echo ia64-hp-hpux${HPUX_REV}
+	exit ;;
+    3050*:HI-UX:*:*)
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+	#include <unistd.h>
+	int
+	main ()
+	{
+	  long cpu =3D sysconf (_SC_CPU_VERSION);
+	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
+	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
+	     results, however.  */
+	  if (CPU_IS_PA_RISC (cpu))
+	    {
+	      switch (cpu)
+		{
+		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
+		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
+		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
+		  default: puts ("hppa-hitachi-hiuxwe2"); break;
+		}
+	    }
+	  else if (CPU_IS_HP_MC68K (cpu))
+	    puts ("m68k-hitachi-hiuxwe2");
+	  else puts ("unknown-hitachi-hiuxwe2");
+	  exit (0);
+	}
+EOF
+	$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=3D`$dummy` &&
+		{ echo "$SYSTEM_NAME"; exit; }
+	echo unknown-hitachi-hiuxwe2
+	exit ;;
+    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+	echo hppa1.1-hp-bsd
+	exit ;;
+    9000/8??:4.3bsd:*:*)
+	echo hppa1.0-hp-bsd
+	exit ;;
+    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
+	echo hppa1.0-hp-mpeix
+	exit ;;
+    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+	echo hppa1.1-hp-osf
+	exit ;;
+    hp8??:OSF1:*:*)
+	echo hppa1.0-hp-osf
+	exit ;;
+    i*86:OSF1:*:*)
+	if [ -x /usr/sbin/sysversion ] ; then
+	    echo ${UNAME_MACHINE}-unknown-osf1mk
+	else
+	    echo ${UNAME_MACHINE}-unknown-osf1
+	fi
+	exit ;;
+    parisc*:Lites*:*:*)
+	echo hppa1.1-hp-lites
+	exit ;;
+    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
+	echo c1-convex-bsd
+	exit ;;
+    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
+	if getsysinfo -f scalar_acc
+	then echo c32-convex-bsd
+	else echo c2-convex-bsd
+	fi
+	exit ;;
+    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
+	echo c34-convex-bsd
+	exit ;;
+    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
+	echo c38-convex-bsd
+	exit ;;
+    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
+	echo c4-convex-bsd
+	exit ;;
+    CRAY*Y-MP:*:*:*)
+	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit ;;
+    CRAY*[A-Z]90:*:*:*)
+	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
+	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
+	      -e 's/\.[^.]*$/.X/'
+	exit ;;
+    CRAY*TS:*:*:*)
+	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit ;;
+    CRAY*T3E:*:*:*)
+	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit ;;
+    CRAY*SV1:*:*:*)
+	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit ;;
+    *:UNICOS/mp:*:*)
+	echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit ;;
+    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
+	FUJITSU_PROC=3D`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklm=
nopqrstuvwxyz'`
+	FUJITSU_SYS=3D`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmn=
opqrstuvwxyz' | sed -e 's/\///'`
+	FUJITSU_REL=3D`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+	echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+	exit ;;
+    5000:UNIX_System_V:4.*:*)
+	FUJITSU_SYS=3D`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmn=
opqrstuvwxyz' | sed -e 's/\///'`
+	FUJITSU_REL=3D`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'a=
bcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
+	echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+	exit ;;
+    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
+	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+	exit ;;
+    sparc*:BSD/OS:*:*)
+	echo sparc-unknown-bsdi${UNAME_RELEASE}
+	exit ;;
+    *:BSD/OS:*:*)
+	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+	exit ;;
+    *:FreeBSD:*:*)
+	case ${UNAME_MACHINE} in
+	    pc98)
+		echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+	    amd64)
+		echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+	    *)
+		echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-=
(].*//'` ;;
+	esac
+	exit ;;
+    i*:CYGWIN*:*)
+	echo ${UNAME_MACHINE}-pc-cygwin
+	exit ;;
+    *:MINGW*:*)
+	echo ${UNAME_MACHINE}-pc-mingw32
+	exit ;;
+    i*:windows32*:*)
+	# uname -m includes "-pc" on this system.
+	echo ${UNAME_MACHINE}-mingw32
+	exit ;;
+    i*:PW*:*)
+	echo ${UNAME_MACHINE}-pc-pw32
+	exit ;;
+    *:Interix*:*)
+	case ${UNAME_MACHINE} in
+	    x86)
+		echo i586-pc-interix${UNAME_RELEASE}
+		exit ;;
+	    authenticamd | genuineintel | EM64T)
+		echo x86_64-unknown-interix${UNAME_RELEASE}
+		exit ;;
+	    IA64)
+		echo ia64-unknown-interix${UNAME_RELEASE}
+		exit ;;
+	esac ;;
+    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+	echo i${UNAME_MACHINE}-pc-mks
+	exit ;;
+    8664:Windows_NT:*)
+	echo x86_64-pc-mks
+	exit ;;
+    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
+	# How do we know it's Interix rather than the generic POSIX subsystem?
+	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
+	# UNAME_MACHINE based on the output of uname instead of i386?
+	echo i586-pc-interix
+	exit ;;
+    i*:UWIN*:*)
+	echo ${UNAME_MACHINE}-pc-uwin
+	exit ;;
+    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
+	echo x86_64-unknown-cygwin
+	exit ;;
+    p*:CYGWIN*:*)
+	echo powerpcle-unknown-cygwin
+	exit ;;
+    prep*:SunOS:5.*:*)
+	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit ;;
+    *:GNU:*:*)
+	# the GNU system
+	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAM=
E_RELEASE}|sed -e 's,/.*$,,'`
+	exit ;;
+    *:GNU/*:*:*)
+	# other systems with GNU libc and userland
+	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' |=
 tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
+	exit ;;
+    i*86:Minix:*:*)
+	echo ${UNAME_MACHINE}-pc-minix
+	exit ;;
+    alpha:Linux:*:*)
+	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+	    EV5)   UNAME_MACHINE=3Dalphaev5 ;;
+	    EV56)  UNAME_MACHINE=3Dalphaev56 ;;
+	    PCA56) UNAME_MACHINE=3Dalphapca56 ;;
+	    PCA57) UNAME_MACHINE=3Dalphapca56 ;;
+	    EV6)   UNAME_MACHINE=3Dalphaev6 ;;
+	    EV67)  UNAME_MACHINE=3Dalphaev67 ;;
+	    EV68*) UNAME_MACHINE=3Dalphaev68 ;;
+	esac
+	objdump --private-headers /bin/sh | grep -q ld.so.1
+	if test "$?" =3D 0 ; then LIBC=3D"libc1" ; else LIBC=3D"" ; fi
+	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+	exit ;;
+    arm*:Linux:*:*)
+	eval $set_cc_for_build
+	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null | \
+	    grep -q __ARM_EABI__
+	then
+	    echo ${UNAME_MACHINE}-unknown-linux-gnu
+	else
+	    echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+	fi
+	exit ;;
+    avr32*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    cris:Linux:*:*)
+	echo cris-axis-linux-gnu
+	exit ;;
+    crisv32:Linux:*:*)
+	echo crisv32-axis-linux-gnu
+	exit ;;
+    frv:Linux:*:*)
+	echo frv-unknown-linux-gnu
+	exit ;;
+    i*86:Linux:*:*)
+	LIBC=3Dgnu
+	eval $set_cc_for_build
+	sed 's/^        //' << EOF >$dummy.c
+	#ifdef __dietlibc__
+	LIBC=3Ddietlibc
+	#endif
+EOF
+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
+	echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+	exit ;;
+    ia64:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    m32r*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    m68*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    mips:Linux:*:* | mips64:Linux:*:*)
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+	#undef CPU
+	#undef ${UNAME_MACHINE}
+	#undef ${UNAME_MACHINE}el
+	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defin=
ed(MIPSEL)
+	CPU=3D${UNAME_MACHINE}el
+	#else
+	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defin=
ed(MIPSEB)
+	CPU=3D${UNAME_MACHINE}
+	#else
+	CPU=3D
+	#endif
+	#endif
+EOF
+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
+	test x"${CPU}" !=3D x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+	;;
+    or32:Linux:*:*)
+	echo or32-unknown-linux-gnu
+	exit ;;
+    padre:Linux:*:*)
+	echo sparc-unknown-linux-gnu
+	exit ;;
+    parisc64:Linux:*:* | hppa64:Linux:*:*)
+	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
+	  PA7*) echo hppa1.1-unknown-linux-gnu ;;
+	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
+	  *)    echo hppa-unknown-linux-gnu ;;
+	esac
+	exit ;;
+    ppc64:Linux:*:*)
+	echo powerpc64-unknown-linux-gnu
+	exit ;;
+    ppc:Linux:*:*)
+	echo powerpc-unknown-linux-gnu
+	exit ;;
+    s390:Linux:*:* | s390x:Linux:*:*)
+	echo ${UNAME_MACHINE}-ibm-linux
+	exit ;;
+    sh64*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    sh*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    sparc:Linux:*:* | sparc64:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    tile*:Linux:*:*)
+	echo ${UNAME_MACHINE}-tilera-linux-gnu
+	exit ;;
+    vax:Linux:*:*)
+	echo ${UNAME_MACHINE}-dec-linux-gnu
+	exit ;;
+    x86_64:Linux:*:*)
+	echo x86_64-unknown-linux-gnu
+	exit ;;
+    xtensa*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    i*86:DYNIX/ptx:4*:*)
+	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
+	# earlier versions are messed up and put the nodename in both
+	# sysname and nodename.
+	echo i386-sequent-sysv4
+	exit ;;
+    i*86:UNIX_SV:4.2MP:2.*)
+	# Unixware is an offshoot of SVR4, but it has its own version
+	# number series starting with 2...
+	# I am not positive that other SVR4 systems won't match this,
+	# I just have to hope.  -- rms.
+	# Use sysv4.2uw... so that sysv4* matches it.
+	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+	exit ;;
+    i*86:OS/2:*:*)
+	# If we were able to find `uname', then EMX Unix compatibility
+	# is probably installed.
+	echo ${UNAME_MACHINE}-pc-os2-emx
+	exit ;;
+    i*86:XTS-300:*:STOP)
+	echo ${UNAME_MACHINE}-unknown-stop
+	exit ;;
+    i*86:atheos:*:*)
+	echo ${UNAME_MACHINE}-unknown-atheos
+	exit ;;
+    i*86:syllable:*:*)
+	echo ${UNAME_MACHINE}-pc-syllable
+	exit ;;
+    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
+	echo i386-unknown-lynxos${UNAME_RELEASE}
+	exit ;;
+    i*86:*DOS:*:*)
+	echo ${UNAME_MACHINE}-pc-msdosdjgpp
+	exit ;;
+    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
+	UNAME_REL=3D`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
+	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
+		echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
+	else
+		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+	fi
+	exit ;;
+    i*86:*:5:[678]*)
+	# UnixWare 7.x, OpenUNIX and OpenServer 6.
+	case `/bin/uname -X | grep "^Machine"` in
+	    *486*)	     UNAME_MACHINE=3Di486 ;;
+	    *Pentium)	     UNAME_MACHINE=3Di586 ;;
+	    *Pent*|*Celeron) UNAME_MACHINE=3Di686 ;;
+	esac
+	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_=
VERSION}
+	exit ;;
+    i*86:*:3.2:*)
+	if test -f /usr/options/cb.name; then
+		UNAME_REL=3D`sed -n 's/.*Version //p' </usr/options/cb.name`
+		echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+	elif /bin/uname -X 2>/dev/null >/dev/null ; then
+		UNAME_REL=3D`(/bin/uname -X|grep Release|sed -e 's/.*=3D //')`
+		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=3Di486
+		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
+			&& UNAME_MACHINE=3Di586
+		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
+			&& UNAME_MACHINE=3Di686
+		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
+			&& UNAME_MACHINE=3Di686
+		echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+	else
+		echo ${UNAME_MACHINE}-pc-sysv32
+	fi
+	exit ;;
+    pc:*:*:*)
+	# Left here for compatibility:
+	# uname -m prints for DJGPP always 'pc', but it prints nothing about
+	# the processor, so we play safe by assuming i586.
+	# Note: whatever this is, it MUST be the same as what config.sub
+	# prints for the "djgpp" host, or else GDB configury will decide that
+	# this is a cross-build.
+	echo i586-pc-msdosdjgpp
+	exit ;;
+    Intel:Mach:3*:*)
+	echo i386-pc-mach3
+	exit ;;
+    paragon:*:*:*)
+	echo i860-intel-osf1
+	exit ;;
+    i860:*:4.*:*) # i860-SVR4
+	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
+	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+	else # Add other i860-SVR4 vendors below as they are discovered.
+	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
+	fi
+	exit ;;
+    mini*:CTIX:SYS*5:*)
+	# "miniframe"
+	echo m68010-convergent-sysv
+	exit ;;
+    mc68k:UNIX:SYSTEM5:3.51m)
+	echo m68k-convergent-sysv
+	exit ;;
+    M680?0:D-NIX:5.3:*)
+	echo m68k-diab-dnix
+	exit ;;
+    M68*:*:R3V[5678]*:*)
+	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
+    3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]?=
?/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:=
4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
+	OS_REL=3D''
+	test -r /etc/.relid \
+	&& OS_REL=3D.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+	  && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
+	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+	   && { echo i486-ncr-sysv4; exit; } ;;
+    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
+	OS_REL=3D'.3'
+	test -r /etc/.relid \
+	    && OS_REL=3D.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.re=
lid`
+	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+	    && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
+	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
+	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
+	echo m68k-unknown-lynxos${UNAME_RELEASE}
+	exit ;;
+    mc68030:UNIX_System_V:4.*:*)
+	echo m68k-atari-sysv4
+	exit ;;
+    TSUNAMI:LynxOS:2.*:*)
+	echo sparc-unknown-lynxos${UNAME_RELEASE}
+	exit ;;
+    rs6000:LynxOS:2.*:*)
+	echo rs6000-unknown-lynxos${UNAME_RELEASE}
+	exit ;;
+    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02=
]*:*)
+	echo powerpc-unknown-lynxos${UNAME_RELEASE}
+	exit ;;
+    SM[BE]S:UNIX_SV:*:*)
+	echo mips-dde-sysv${UNAME_RELEASE}
+	exit ;;
+    RM*:ReliantUNIX-*:*:*)
+	echo mips-sni-sysv4
+	exit ;;
+    RM*:SINIX-*:*:*)
+	echo mips-sni-sysv4
+	exit ;;
+    *:SINIX-*:*:*)
+	if uname -p 2>/dev/null >/dev/null ; then
+		UNAME_MACHINE=3D`(uname -p) 2>/dev/null`
+		echo ${UNAME_MACHINE}-sni-sysv4
+	else
+		echo ns32k-sni-sysv
+	fi
+	exit ;;
+    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+	              # says <Richard.M.Bartel at ccMail.Census.GOV>
+	echo i586-unisys-sysv4
+	exit ;;
+    *:UNIX_System_V:4*:FTX*)
+	# From Gerald Hewes <hewes at openmarket.com>.
+	# How about differentiating between stratus architectures? -djm
+	echo hppa1.1-stratus-sysv4
+	exit ;;
+    *:*:*:FTX*)
+	# From seanf at swdc.stratus.com.
+	echo i860-stratus-sysv4
+	exit ;;
+    i*86:VOS:*:*)
+	# From Paul.Green at stratus.com.
+	echo ${UNAME_MACHINE}-stratus-vos
+	exit ;;
+    *:VOS:*:*)
+	# From Paul.Green at stratus.com.
+	echo hppa1.1-stratus-vos
+	exit ;;
+    mc68*:A/UX:*:*)
+	echo m68k-apple-aux${UNAME_RELEASE}
+	exit ;;
+    news*:NEWS-OS:6*:*)
+	echo mips-sony-newsos6
+	exit ;;
+    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
+	if [ -d /usr/nec ]; then
+	        echo mips-nec-sysv${UNAME_RELEASE}
+	else
+	        echo mips-unknown-sysv${UNAME_RELEASE}
+	fi
+	exit ;;
+    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
+	echo powerpc-be-beos
+	exit ;;
+    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
+	echo powerpc-apple-beos
+	exit ;;
+    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
+	echo i586-pc-beos
+	exit ;;
+    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
+	echo i586-pc-haiku
+	exit ;;
+    SX-4:SUPER-UX:*:*)
+	echo sx4-nec-superux${UNAME_RELEASE}
+	exit ;;
+    SX-5:SUPER-UX:*:*)
+	echo sx5-nec-superux${UNAME_RELEASE}
+	exit ;;
+    SX-6:SUPER-UX:*:*)
+	echo sx6-nec-superux${UNAME_RELEASE}
+	exit ;;
+    SX-7:SUPER-UX:*:*)
+	echo sx7-nec-superux${UNAME_RELEASE}
+	exit ;;
+    SX-8:SUPER-UX:*:*)
+	echo sx8-nec-superux${UNAME_RELEASE}
+	exit ;;
+    SX-8R:SUPER-UX:*:*)
+	echo sx8r-nec-superux${UNAME_RELEASE}
+	exit ;;
+    Power*:Rhapsody:*:*)
+	echo powerpc-apple-rhapsody${UNAME_RELEASE}
+	exit ;;
+    *:Rhapsody:*:*)
+	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+	exit ;;
+    *:Darwin:*:*)
+	UNAME_PROCESSOR=3D`uname -p` || UNAME_PROCESSOR=3Dunknown
+	case $UNAME_PROCESSOR in
+	    i386)
+		eval $set_cc_for_build
+		if [ "$CC_FOR_BUILD" !=3D 'no_compiler_found' ]; then
+		    if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+			(CCOPTS=3D $CC_FOR_BUILD -E - 2>/dev/null) | \
+			grep IS_64BIT_ARCH >/dev/null
+		    then
+			UNAME_PROCESSOR=3D"x86_64"
+		    fi
+		fi ;;
+	    unknown) UNAME_PROCESSOR=3Dpowerpc ;;
+	esac
+	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
+	exit ;;
+    *:procnto*:*:* | *:QNX:[0123456789]*:*)
+	UNAME_PROCESSOR=3D`uname -p`
+	if test "$UNAME_PROCESSOR" =3D "x86"; then
+	    UNAME_PROCESSOR=3Di386
+	    UNAME_MACHINE=3Dpc
+	fi
+	echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
+	exit ;;
+    *:QNX:*:4*)
+	echo i386-pc-qnx
+	exit ;;
+    NEO-?:NONSTOP_KERNEL:*:*)
+	echo neo-tandem-nsk${UNAME_RELEASE}
+	exit ;;
+    NSE-?:NONSTOP_KERNEL:*:*)
+	echo nse-tandem-nsk${UNAME_RELEASE}
+	exit ;;
+    NSR-?:NONSTOP_KERNEL:*:*)
+	echo nsr-tandem-nsk${UNAME_RELEASE}
+	exit ;;
+    *:NonStop-UX:*:*)
+	echo mips-compaq-nonstopux
+	exit ;;
+    BS2000:POSIX*:*:*)
+	echo bs2000-siemens-sysv
+	exit ;;
+    DS/*:UNIX_System_V:*:*)
+	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+	exit ;;
+    *:Plan9:*:*)
+	# "uname -m" is not consistent, so use $cputype instead. 386
+	# is converted to i386 for consistency with other x86
+	# operating systems.
+	if test "$cputype" =3D "386"; then
+	    UNAME_MACHINE=3Di386
+	else
+	    UNAME_MACHINE=3D"$cputype"
+	fi
+	echo ${UNAME_MACHINE}-unknown-plan9
+	exit ;;
+    *:TOPS-10:*:*)
+	echo pdp10-unknown-tops10
+	exit ;;
+    *:TENEX:*:*)
+	echo pdp10-unknown-tenex
+	exit ;;
+    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
+	echo pdp10-dec-tops20
+	exit ;;
+    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
+	echo pdp10-xkl-tops20
+	exit ;;
+    *:TOPS-20:*:*)
+	echo pdp10-unknown-tops20
+	exit ;;
+    *:ITS:*:*)
+	echo pdp10-unknown-its
+	exit ;;
+    SEI:*:*:SEIUX)
+	echo mips-sei-seiux${UNAME_RELEASE}
+	exit ;;
+    *:DragonFly:*:*)
+	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[=
-(].*//'`
+	exit ;;
+    *:*VMS:*:*)
+	UNAME_MACHINE=3D`(uname -p) 2>/dev/null`
+	case "${UNAME_MACHINE}" in
+	    A*) echo alpha-dec-vms ; exit ;;
+	    I*) echo ia64-dec-vms ; exit ;;
+	    V*) echo vax-dec-vms ; exit ;;
+	esac ;;
+    *:XENIX:*:SysV)
+	echo i386-pc-xenix
+	exit ;;
+    i*86:skyos:*:*)
+	echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
+	exit ;;
+    i*86:rdos:*:*)
+	echo ${UNAME_MACHINE}-pc-rdos
+	exit ;;
+    i*86:AROS:*:*)
+	echo ${UNAME_MACHINE}-pc-aros
+	exit ;;
+esac
+
+#echo '(No uname command or uname output not recognized.)' 1>&2
+#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}"=
 1>&2
+
+eval $set_cc_for_build
+cat >$dummy.c <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#endif
+main ()
+{
+#if defined (sony)
+#if defined (MIPSEB)
+  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
+     I don't know....  */
+  printf ("mips-sony-bsd\n"); exit (0);
+#else
+#include <sys/param.h>
+  printf ("m68k-sony-newsos%s\n",
+#ifdef NEWSOS4
+          "4"
+#else
+	  ""
+#endif
+         ); exit (0);
+#endif
+#endif
+
+#if defined (__arm) && defined (__acorn) && defined (__unix)
+  printf ("arm-acorn-riscix\n"); exit (0);
+#endif
+
+#if defined (hp300) && !defined (hpux)
+  printf ("m68k-hp-bsd\n"); exit (0);
+#endif
+
+#if defined (NeXT)
+#if !defined (__ARCHITECTURE__)
+#define __ARCHITECTURE__ "m68k"
+#endif
+  int version;
+  version=3D`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/=
null`;
+  if (version < 4)
+    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+  else
+    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
+  exit (0);
+#endif
+
+#if defined (MULTIMAX) || defined (n16)
+#if defined (UMAXV)
+  printf ("ns32k-encore-sysv\n"); exit (0);
+#else
+#if defined (CMU)
+  printf ("ns32k-encore-mach\n"); exit (0);
+#else
+  printf ("ns32k-encore-bsd\n"); exit (0);
+#endif
+#endif
+#endif
+
+#if defined (__386BSD__)
+  printf ("i386-pc-bsd\n"); exit (0);
+#endif
+
+#if defined (sequent)
+#if defined (i386)
+  printf ("i386-sequent-dynix\n"); exit (0);
+#endif
+#if defined (ns32000)
+  printf ("ns32k-sequent-dynix\n"); exit (0);
+#endif
+#endif
+
+#if defined (_SEQUENT_)
+    struct utsname un;
+
+    uname(&un);
+
+    if (strncmp(un.version, "V2", 2) =3D=3D 0) {
+	printf ("i386-sequent-ptx2\n"); exit (0);
+    }
+    if (strncmp(un.version, "V1", 2) =3D=3D 0) { /* XXX is V1 correct? */
+	printf ("i386-sequent-ptx1\n"); exit (0);
+    }
+    printf ("i386-sequent-ptx\n"); exit (0);
+
+#endif
+
+#if defined (vax)
+# if !defined (ultrix)
+#  include <sys/param.h>
+#  if defined (BSD)
+#   if BSD =3D=3D 43
+      printf ("vax-dec-bsd4.3\n"); exit (0);
+#   else
+#    if BSD =3D=3D 199006
+      printf ("vax-dec-bsd4.3reno\n"); exit (0);
+#    else
+      printf ("vax-dec-bsd\n"); exit (0);
+#    endif
+#   endif
+#  else
+    printf ("vax-dec-bsd\n"); exit (0);
+#  endif
+# else
+    printf ("vax-dec-ultrix\n"); exit (0);
+# endif
+#endif
+
+#if defined (alliant) && defined (i860)
+  printf ("i860-alliant-bsd\n"); exit (0);
+#endif
+
+  exit (1);
+}
+EOF
+
+$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=3D`$dummy` &&
+	{ echo "$SYSTEM_NAME"; exit; }
+
+# Apollos put the system type in the environment.
+
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
+
+# Convex versions that predate uname can use getsysinfo(1)
+
+if [ -x /usr/convex/getsysinfo ]
+then
+    case `getsysinfo -f cpu_type` in
+    c1*)
+	echo c1-convex-bsd
+	exit ;;
+    c2*)
+	if getsysinfo -f scalar_acc
+	then echo c32-convex-bsd
+	else echo c2-convex-bsd
+	fi
+	exit ;;
+    c34*)
+	echo c34-convex-bsd
+	exit ;;
+    c38*)
+	echo c38-convex-bsd
+	exit ;;
+    c4*)
+	echo c4-convex-bsd
+	exit ;;
+    esac
+fi
+
+cat >&2 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+  http://git.savannah.gnu.org/gitweb/?p=3Dconfig.git;a=3Dblob_plain;f=3Dco=
nfig.guess;hb=3DHEAD
+and
+  http://git.savannah.gnu.org/gitweb/?p=3Dconfig.git;a=3Dblob_plain;f=3Dco=
nfig.sub;hb=3DHEAD
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches at gnu.org> in order to provide the needed
+information to handle your system.
+
+config.guess timestamp =3D $timestamp
+
+uname -m =3D `(uname -m) 2>/dev/null || echo unknown`
+uname -r =3D `(uname -r) 2>/dev/null || echo unknown`
+uname -s =3D `(uname -s) 2>/dev/null || echo unknown`
+uname -v =3D `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p =3D `(/usr/bin/uname -p) 2>/dev/null`
+/bin/uname -X     =3D `(/bin/uname -X) 2>/dev/null`
+
+hostinfo               =3D `(hostinfo) 2>/dev/null`
+/bin/universe          =3D `(/bin/universe) 2>/dev/null`
+/usr/bin/arch -k       =3D `(/usr/bin/arch -k) 2>/dev/null`
+/bin/arch              =3D `(/bin/arch) 2>/dev/null`
+/usr/bin/oslevel       =3D `(/usr/bin/oslevel) 2>/dev/null`
+/usr/convex/getsysinfo =3D `(/usr/convex/getsysinfo) 2>/dev/null`
+
+UNAME_MACHINE =3D ${UNAME_MACHINE}
+UNAME_RELEASE =3D ${UNAME_RELEASE}
+UNAME_SYSTEM  =3D ${UNAME_SYSTEM}
+UNAME_VERSION =3D ${UNAME_VERSION}
+EOF
+
+exit 1
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp=3D'"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/config.sub
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/config.sub	Wed Jul 25 16:21:35 2012 +0300
@@ -0,0 +1,1760 @@
+#! /bin/sh
+# 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
+#   2011 Free Software Foundation, Inc.
+
+timestamp=3D'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
+# can handle that machine.  It does not imply ALL GNU software can.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+
+# Please send patches to <config-patches at gnu.org>.  Submit a context
+# diff and a properly formatted GNU ChangeLog entry.
+#
+# Configuration subroutine to validate and canonicalize a configuration ty=
pe.
+# Supply the specified configuration type as an argument.
+# If it is invalid, we print an error message on stderr and exit with code=
 1.
+# Otherwise, we print the canonical config type on stdout and succeed.
+
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=3Dconfig.git;a=3Dblob_plain;f=3Dco=
nfig.sub;hb=3DHEAD
+
+# This file is supposed to be the same for all GNU packages
+# and recognize all the CPU types, system types and aliases
+# that are meaningful with *any* GNU software.
+# Each package is responsible for reporting which valid configurations
+# it does not support.  The user should be able to distinguish
+# a failure to support a valid configuration from a meaningless
+# configuration.
+
+# The goal of this file is to map all the various variations of a given
+# machine specification into a single specification in the form:
+#	CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or in some cases, the newer four-part form:
+#	CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# It is wrong to echo any other type of specification.
+
+me=3D`echo "$0" | sed -e 's,.*/,,'`
+
+usage=3D"\
+Usage: $0 [OPTION] CPU-MFR-OPSYS
+       $0 [OPTION] ALIAS
+
+Canonicalize a configuration name.
+
+Operation modes:
+  -h, --help         print this help, then exit
+  -t, --time-stamp   print date of last modification, then exit
+  -v, --version      print version number, then exit
+
+Report bugs and patches to <config-patches at gnu.org>."
+
+version=3D"\
+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, 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=
."
+
+help=3D"
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+  case $1 in
+    --time-stamp | --time* | -t )
+       echo "$timestamp" ; exit ;;
+    --version | -v )
+       echo "$version" ; exit ;;
+    --help | --h* | -h )
+       echo "$usage"; exit ;;
+    -- )     # Stop option processing
+       shift; break ;;
+    - )	# Use stdin as input.
+       break ;;
+    -* )
+       echo "$me: invalid option $1$help"
+       exit 1 ;;
+
+    *local*)
+       # First pass through any local machine types.
+       echo $1
+       exit ;;
+
+    * )
+       break ;;
+  esac
+done
+
+case $# in
+ 0) echo "$me: missing argument$help" >&2
+    exit 1;;
+ 1) ;;
+ *) echo "$me: too many arguments$help" >&2
+    exit 1;;
+esac
+
+# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any=
).
+# Here we must recognize all the valid KERNEL-OS combinations.
+maybe_os=3D`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+case $maybe_os in
+  nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* =
| \
+  linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
+  knetbsd*-gnu* | netbsd*-gnu* | \
+  kopensolaris*-gnu* | \
+  storm-chaos* | os2-emx* | rtmk-nova*)
+    os=3D-$maybe_os
+    basic_machine=3D`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+    ;;
+  *)
+    basic_machine=3D`echo $1 | sed 's/-[^-]*$//'`
+    if [ $basic_machine !=3D $1 ]
+    then os=3D`echo $1 | sed 's/.*-/-/'`
+    else os=3D; fi
+    ;;
+esac
+
+### Let's recognize common machines as not being operating systems so
+### that things like config.sub decstation-3100 work.  We also
+### recognize some manufacturers as not being operating systems, so we
+### can provide default operating systems below.
+case $os in
+	-sun*os*)
+		# Prevent following clause from handling this invalid input.
+		;;
+	-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
+	-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
+	-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
+	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
+	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
+	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
+	-apple | -axis | -knuth | -cray | -microblaze)
+		os=3D
+		basic_machine=3D$1
+		;;
+	-bluegene*)
+		os=3D-cnk
+		;;
+	-sim | -cisco | -oki | -wec | -winbond)
+		os=3D
+		basic_machine=3D$1
+		;;
+	-scout)
+		;;
+	-wrs)
+		os=3D-vxworks
+		basic_machine=3D$1
+		;;
+	-chorusos*)
+		os=3D-chorusos
+		basic_machine=3D$1
+		;;
+	-chorusrdb)
+		os=3D-chorusrdb
+		basic_machine=3D$1
+		;;
+	-hiux*)
+		os=3D-hiuxwe2
+		;;
+	-sco6)
+		os=3D-sco5v6
+		basic_machine=3D`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco5)
+		os=3D-sco3.2v5
+		basic_machine=3D`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco4)
+		os=3D-sco3.2v4
+		basic_machine=3D`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco3.2.[4-9]*)
+		os=3D`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+		basic_machine=3D`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco3.2v[4-9]*)
+		# Don't forget version if it is 3.2v4 or newer.
+		basic_machine=3D`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco5v6*)
+		# Don't forget version if it is 3.2v4 or newer.
+		basic_machine=3D`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco*)
+		os=3D-sco3.2v2
+		basic_machine=3D`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-udk*)
+		basic_machine=3D`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-isc)
+		os=3D-isc2.2
+		basic_machine=3D`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-clix*)
+		basic_machine=3Dclipper-intergraph
+		;;
+	-isc*)
+		basic_machine=3D`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-lynx*)
+		os=3D-lynxos
+		;;
+	-ptx*)
+		basic_machine=3D`echo $1 | sed -e 's/86-.*/86-sequent/'`
+		;;
+	-windowsnt*)
+		os=3D`echo $os | sed -e 's/windowsnt/winnt/'`
+		;;
+	-psos*)
+		os=3D-psos
+		;;
+	-mint | -mint[0-9]*)
+		basic_machine=3Dm68k-atari
+		os=3D-mint
+		;;
+esac
+
+# Decode aliases for certain CPU-COMPANY combinations.
+case $basic_machine in
+	# Recognize the basic CPU types without company name.
+	# Some are omitted here because they have special meanings below.
+	1750a | 580 \
+	| a29k \
+	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[6=
7] \
+	| am33_2.0 \
+	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | av=
r32 \
+	| bfin \
+	| c4x | clipper \
+	| d10v | d30v | dlx | dsp16xx \
+	| fido | fr30 | frv \
+	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+	| i370 | i860 | i960 | ia64 \
+	| ip2k | iq2000 \
+	| lm32 \
+	| m32c | m32r | m32rle | m68000 | m68k | m88k \
+	| maxq | mb | microblaze | mcore | mep | metag \
+	| mips | mipsbe | mipseb | mipsel | mipsle \
+	| mips16 \
+	| mips64 | mips64el \
+	| mips64octeon | mips64octeonel \
+	| mips64orion | mips64orionel \
+	| mips64r5900 | mips64r5900el \
+	| mips64vr | mips64vrel \
+	| mips64vr4100 | mips64vr4100el \
+	| mips64vr4300 | mips64vr4300el \
+	| mips64vr5000 | mips64vr5000el \
+	| mips64vr5900 | mips64vr5900el \
+	| mipsisa32 | mipsisa32el \
+	| mipsisa32r2 | mipsisa32r2el \
+	| mipsisa64 | mipsisa64el \
+	| mipsisa64r2 | mipsisa64r2el \
+	| mipsisa64sb1 | mipsisa64sb1el \
+	| mipsisa64sr71k | mipsisa64sr71kel \
+	| mipstx39 | mipstx39el \
+	| mn10200 | mn10300 \
+	| moxie \
+	| mt \
+	| msp430 \
+	| nds32 | nds32le | nds32be \
+	| nios | nios2 \
+	| ns16k | ns32k \
+	| open8 \
+	| or32 \
+	| pdp10 | pdp11 | pj | pjl \
+	| powerpc | powerpc64 | powerpc64le | powerpcle \
+	| pyramid \
+	| rx \
+	| score \
+	| 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 \
+	| spu \
+	| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
+	| ubicom32 \
+	| v850 | v850e \
+	| we32k \
+	| x86 | xc16x | xstormy16 | xtensa \
+	| z8k | z80)
+		basic_machine=3D$basic_machine-unknown
+		;;
+	c54x)
+		basic_machine=3Dtic54x-unknown
+		;;
+	c55x)
+		basic_machine=3Dtic55x-unknown
+		;;
+	c6x)
+		basic_machine=3Dtic6x-unknown
+		;;
+	m6811 | m68hc11 | m6812 | m68hc12 | picochip)
+		# Motorola 68HC11/12.
+		basic_machine=3D$basic_machine-unknown
+		os=3D-none
+		;;
+	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+		;;
+	ms1)
+		basic_machine=3Dmt-unknown
+		;;
+	strongarm | thumb | xscale)
+		basic_machine=3Darm-unknown
+		;;
+	xscaleeb)
+		basic_machine=3Darmeb-unknown
+		;;
+	xscaleel)
+		basic_machine=3Darmel-unknown
+		;;
+	# We use `pc' rather than `unknown'
+	# because (1) that's what they normally are, and
+	# (2) the word "unknown" tends to confuse beginning users.
+	i*86 | x86_64)
+		basic_machine=3D$basic_machine-pc
+		;;
+	# Object if more than one company name word.
+	*-*-*)
+		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recogn=
ized 1>&2
+		exit 1
+		;;
+	# Recognize the basic CPU types with company name.
+	580-* \
+	| a29k-* \
+	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
+	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
+	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
+	| avr-* | avr32-* \
+	| bfin-* | bs2000-* \
+	| c[123]* | c30-* | [cjt]90-* | c4x-* \
+	| clipper-* | craynv-* | cydra-* \
+	| d10v-* | d30v-* | dlx-* \
+	| elxsi-* \
+	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
+	| h8300-* | h8500-* \
+	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+	| i*86-* | i860-* | i960-* | ia64-* \
+	| ip2k-* | iq2000-* \
+	| lm32-* \
+	| m32c-* | m32r-* | m32rle-* \
+	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
+	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+	| mips16-* \
+	| mips64-* | mips64el-* \
+	| mips64octeon-* | mips64octeonel-* \
+	| mips64orion-* | mips64orionel-* \
+	| mips64r5900-* | mips64r5900el-* \
+	| mips64vr-* | mips64vrel-* \
+	| mips64vr4100-* | mips64vr4100el-* \
+	| mips64vr4300-* | mips64vr4300el-* \
+	| mips64vr5000-* | mips64vr5000el-* \
+	| mips64vr5900-* | mips64vr5900el-* \
+	| mipsisa32-* | mipsisa32el-* \
+	| mipsisa32r2-* | mipsisa32r2el-* \
+	| mipsisa64-* | mipsisa64el-* \
+	| mipsisa64r2-* | mipsisa64r2el-* \
+	| mipsisa64sb1-* | mipsisa64sb1el-* \
+	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
+	| mipstx39-* | mipstx39el-* \
+	| mmix-* \
+	| mt-* \
+	| msp430-* \
+	| nds32-* | nds32le-* | nds32be-* \
+	| nios-* | nios2-* \
+	| none-* | np1-* | ns16k-* | ns32k-* \
+	| open8-* \
+	| orion-* \
+	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+	| 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-* | sv1-* | sx?-* \
+	| tahoe-* \
+	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+	| tile-* | tilegx-* \
+	| tron-* \
+	| ubicom32-* \
+	| v850-* | v850e-* | vax-* \
+	| we32k-* \
+	| x86-* | x86_64-* | xc16x-* | xps100-* \
+	| xstormy16-* | xtensa*-* \
+	| ymp-* \
+	| z8k-* | z80-*)
+		;;
+	# Recognize the basic CPU types without company name, with glob match.
+	xtensa*)
+		basic_machine=3D$basic_machine-unknown
+		;;
+	# Recognize the various machine names and aliases which stand
+	# for a CPU type and a company and sometimes even an OS.
+	386bsd)
+		basic_machine=3Di386-unknown
+		os=3D-bsd
+		;;
+	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
+		basic_machine=3Dm68000-att
+		;;
+	3b*)
+		basic_machine=3Dwe32k-att
+		;;
+	a29khif)
+		basic_machine=3Da29k-amd
+		os=3D-udi
+		;;
+	abacus)
+		basic_machine=3Dabacus-unknown
+		;;
+	adobe68k)
+		basic_machine=3Dm68010-adobe
+		os=3D-scout
+		;;
+	alliant | fx80)
+		basic_machine=3Dfx80-alliant
+		;;
+	altos | altos3068)
+		basic_machine=3Dm68k-altos
+		;;
+	am29k)
+		basic_machine=3Da29k-none
+		os=3D-bsd
+		;;
+	amd64)
+		basic_machine=3Dx86_64-pc
+		;;
+	amd64-*)
+		basic_machine=3Dx86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	amdahl)
+		basic_machine=3D580-amdahl
+		os=3D-sysv
+		;;
+	amiga | amiga-*)
+		basic_machine=3Dm68k-unknown
+		;;
+	amigaos | amigados)
+		basic_machine=3Dm68k-unknown
+		os=3D-amigaos
+		;;
+	amigaunix | amix)
+		basic_machine=3Dm68k-unknown
+		os=3D-sysv4
+		;;
+	apollo68)
+		basic_machine=3Dm68k-apollo
+		os=3D-sysv
+		;;
+	apollo68bsd)
+		basic_machine=3Dm68k-apollo
+		os=3D-bsd
+		;;
+	aros)
+		basic_machine=3Di386-pc
+		os=3D-aros
+		;;
+	aux)
+		basic_machine=3Dm68k-apple
+		os=3D-aux
+		;;
+	balance)
+		basic_machine=3Dns32k-sequent
+		os=3D-dynix
+		;;
+	blackfin)
+		basic_machine=3Dbfin-unknown
+		os=3D-linux
+		;;
+	blackfin-*)
+		basic_machine=3Dbfin-`echo $basic_machine | sed 's/^[^-]*-//'`
+		os=3D-linux
+		;;
+	bluegene*)
+		basic_machine=3Dpowerpc-ibm
+		os=3D-cnk
+		;;
+	c54x-*)
+		basic_machine=3Dtic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	c55x-*)
+		basic_machine=3Dtic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	c6x-*)
+		basic_machine=3Dtic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	c90)
+		basic_machine=3Dc90-cray
+		os=3D-unicos
+		;;
+	cegcc)
+		basic_machine=3Darm-unknown
+		os=3D-cegcc
+		;;
+	convex-c1)
+		basic_machine=3Dc1-convex
+		os=3D-bsd
+		;;
+	convex-c2)
+		basic_machine=3Dc2-convex
+		os=3D-bsd
+		;;
+	convex-c32)
+		basic_machine=3Dc32-convex
+		os=3D-bsd
+		;;
+	convex-c34)
+		basic_machine=3Dc34-convex
+		os=3D-bsd
+		;;
+	convex-c38)
+		basic_machine=3Dc38-convex
+		os=3D-bsd
+		;;
+	cray | j90)
+		basic_machine=3Dj90-cray
+		os=3D-unicos
+		;;
+	craynv)
+		basic_machine=3Dcraynv-cray
+		os=3D-unicosmp
+		;;
+	cr16 | cr16-*)
+		basic_machine=3Dcr16-unknown
+		os=3D-elf
+		;;
+	crds | unos)
+		basic_machine=3Dm68k-crds
+		;;
+	crisv32 | crisv32-* | etraxfs*)
+		basic_machine=3Dcrisv32-axis
+		;;
+	cris | cris-* | etrax*)
+		basic_machine=3Dcris-axis
+		;;
+	crx)
+		basic_machine=3Dcrx-unknown
+		os=3D-elf
+		;;
+	da30 | da30-*)
+		basic_machine=3Dm68k-da30
+		;;
+	decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
+		basic_machine=3Dmips-dec
+		;;
+	decsystem10* | dec10*)
+		basic_machine=3Dpdp10-dec
+		os=3D-tops10
+		;;
+	decsystem20* | dec20*)
+		basic_machine=3Dpdp10-dec
+		os=3D-tops20
+		;;
+	delta | 3300 | motorola-3300 | motorola-delta \
+	      | 3300-motorola | delta-motorola)
+		basic_machine=3Dm68k-motorola
+		;;
+	delta88)
+		basic_machine=3Dm88k-motorola
+		os=3D-sysv3
+		;;
+	dicos)
+		basic_machine=3Di686-pc
+		os=3D-dicos
+		;;
+	djgpp)
+		basic_machine=3Di586-pc
+		os=3D-msdosdjgpp
+		;;
+	dpx20 | dpx20-*)
+		basic_machine=3Drs6000-bull
+		os=3D-bosx
+		;;
+	dpx2* | dpx2*-bull)
+		basic_machine=3Dm68k-bull
+		os=3D-sysv3
+		;;
+	ebmon29k)
+		basic_machine=3Da29k-amd
+		os=3D-ebmon
+		;;
+	elxsi)
+		basic_machine=3Delxsi-elxsi
+		os=3D-bsd
+		;;
+	encore | umax | mmax)
+		basic_machine=3Dns32k-encore
+		;;
+	es1800 | OSE68k | ose68k | ose | OSE)
+		basic_machine=3Dm68k-ericsson
+		os=3D-ose
+		;;
+	fx2800)
+		basic_machine=3Di860-alliant
+		;;
+	genix)
+		basic_machine=3Dns32k-ns
+		;;
+	gmicro)
+		basic_machine=3Dtron-gmicro
+		os=3D-sysv
+		;;
+	go32)
+		basic_machine=3Di386-pc
+		os=3D-go32
+		;;
+	h3050r* | hiux*)
+		basic_machine=3Dhppa1.1-hitachi
+		os=3D-hiuxwe2
+		;;
+	h8300hms)
+		basic_machine=3Dh8300-hitachi
+		os=3D-hms
+		;;
+	h8300xray)
+		basic_machine=3Dh8300-hitachi
+		os=3D-xray
+		;;
+	h8500hms)
+		basic_machine=3Dh8500-hitachi
+		os=3D-hms
+		;;
+	harris)
+		basic_machine=3Dm88k-harris
+		os=3D-sysv3
+		;;
+	hp300-*)
+		basic_machine=3Dm68k-hp
+		;;
+	hp300bsd)
+		basic_machine=3Dm68k-hp
+		os=3D-bsd
+		;;
+	hp300hpux)
+		basic_machine=3Dm68k-hp
+		os=3D-hpux
+		;;
+	hp3k9[0-9][0-9] | hp9[0-9][0-9])
+		basic_machine=3Dhppa1.0-hp
+		;;
+	hp9k2[0-9][0-9] | hp9k31[0-9])
+		basic_machine=3Dm68000-hp
+		;;
+	hp9k3[2-9][0-9])
+		basic_machine=3Dm68k-hp
+		;;
+	hp9k6[0-9][0-9] | hp6[0-9][0-9])
+		basic_machine=3Dhppa1.0-hp
+		;;
+	hp9k7[0-79][0-9] | hp7[0-79][0-9])
+		basic_machine=3Dhppa1.1-hp
+		;;
+	hp9k78[0-9] | hp78[0-9])
+		# FIXME: really hppa2.0-hp
+		basic_machine=3Dhppa1.1-hp
+		;;
+	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | h=
p9k893 | hp893)
+		# FIXME: really hppa2.0-hp
+		basic_machine=3Dhppa1.1-hp
+		;;
+	hp9k8[0-9][13679] | hp8[0-9][13679])
+		basic_machine=3Dhppa1.1-hp
+		;;
+	hp9k8[0-9][0-9] | hp8[0-9][0-9])
+		basic_machine=3Dhppa1.0-hp
+		;;
+	hppa-next)
+		os=3D-nextstep3
+		;;
+	hppaosf)
+		basic_machine=3Dhppa1.1-hp
+		os=3D-osf
+		;;
+	hppro)
+		basic_machine=3Dhppa1.1-hp
+		os=3D-proelf
+		;;
+	i370-ibm* | ibm*)
+		basic_machine=3Di370-ibm
+		;;
+# I'm not sure what "Sysv32" means.  Should this be sysv3.2?
+	i*86v32)
+		basic_machine=3D`echo $1 | sed -e 's/86.*/86-pc/'`
+		os=3D-sysv32
+		;;
+	i*86v4*)
+		basic_machine=3D`echo $1 | sed -e 's/86.*/86-pc/'`
+		os=3D-sysv4
+		;;
+	i*86v)
+		basic_machine=3D`echo $1 | sed -e 's/86.*/86-pc/'`
+		os=3D-sysv
+		;;
+	i*86sol2)
+		basic_machine=3D`echo $1 | sed -e 's/86.*/86-pc/'`
+		os=3D-solaris2
+		;;
+	i386mach)
+		basic_machine=3Di386-mach
+		os=3D-mach
+		;;
+	i386-vsta | vsta)
+		basic_machine=3Di386-unknown
+		os=3D-vsta
+		;;
+	iris | iris4d)
+		basic_machine=3Dmips-sgi
+		case $os in
+		    -irix*)
+			;;
+		    *)
+			os=3D-irix4
+			;;
+		esac
+		;;
+	isi68 | isi)
+		basic_machine=3Dm68k-isi
+		os=3D-sysv
+		;;
+	m68knommu)
+		basic_machine=3Dm68k-unknown
+		os=3D-linux
+		;;
+	m68knommu-*)
+		basic_machine=3Dm68k-`echo $basic_machine | sed 's/^[^-]*-//'`
+		os=3D-linux
+		;;
+	m88k-omron*)
+		basic_machine=3Dm88k-omron
+		;;
+	magnum | m3230)
+		basic_machine=3Dmips-mips
+		os=3D-sysv
+		;;
+	merlin)
+		basic_machine=3Dns32k-utek
+		os=3D-sysv
+		;;
+	microblaze)
+		basic_machine=3Dmicroblaze-xilinx
+		;;
+	mingw32)
+		basic_machine=3Di386-pc
+		os=3D-mingw32
+		;;
+	mingw32ce)
+		basic_machine=3Darm-unknown
+		os=3D-mingw32ce
+		;;
+	miniframe)
+		basic_machine=3Dm68000-convergent
+		;;
+	*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
+		basic_machine=3Dm68k-atari
+		os=3D-mint
+		;;
+	mips3*-*)
+		basic_machine=3D`echo $basic_machine | sed -e 's/mips3/mips64/'`
+		;;
+	mips3*)
+		basic_machine=3D`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
+		;;
+	monitor)
+		basic_machine=3Dm68k-rom68k
+		os=3D-coff
+		;;
+	morphos)
+		basic_machine=3Dpowerpc-unknown
+		os=3D-morphos
+		;;
+	msdos)
+		basic_machine=3Di386-pc
+		os=3D-msdos
+		;;
+	ms1-*)
+		basic_machine=3D`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+		;;
+	mvs)
+		basic_machine=3Di370-ibm
+		os=3D-mvs
+		;;
+	ncr3000)
+		basic_machine=3Di486-ncr
+		os=3D-sysv4
+		;;
+	netbsd386)
+		basic_machine=3Di386-unknown
+		os=3D-netbsd
+		;;
+	netwinder)
+		basic_machine=3Darmv4l-rebel
+		os=3D-linux
+		;;
+	news | news700 | news800 | news900)
+		basic_machine=3Dm68k-sony
+		os=3D-newsos
+		;;
+	news1000)
+		basic_machine=3Dm68030-sony
+		os=3D-newsos
+		;;
+	news-3600 | risc-news)
+		basic_machine=3Dmips-sony
+		os=3D-newsos
+		;;
+	necv70)
+		basic_machine=3Dv70-nec
+		os=3D-sysv
+		;;
+	next | m*-next)
+		basic_machine=3Dm68k-next
+		case $os in
+		    -nextstep*)
+			;;
+		    -ns2*)
+		      os=3D-nextstep2
+			;;
+		    *)
+		      os=3D-nextstep3
+			;;
+		esac
+		;;
+	nh3000)
+		basic_machine=3Dm68k-harris
+		os=3D-cxux
+		;;
+	nh[45]000)
+		basic_machine=3Dm88k-harris
+		os=3D-cxux
+		;;
+	nindy960)
+		basic_machine=3Di960-intel
+		os=3D-nindy
+		;;
+	mon960)
+		basic_machine=3Di960-intel
+		os=3D-mon960
+		;;
+	nonstopux)
+		basic_machine=3Dmips-compaq
+		os=3D-nonstopux
+		;;
+	np1)
+		basic_machine=3Dnp1-gould
+		;;
+	neo-tandem)
+		basic_machine=3Dneo-tandem
+		;;
+	nse-tandem)
+		basic_machine=3Dnse-tandem
+		;;
+	nsr-tandem)
+		basic_machine=3Dnsr-tandem
+		;;
+	op50n-* | op60c-*)
+		basic_machine=3Dhppa1.1-oki
+		os=3D-proelf
+		;;
+	openrisc | openrisc-*)
+		basic_machine=3Dor32-unknown
+		;;
+	os400)
+		basic_machine=3Dpowerpc-ibm
+		os=3D-os400
+		;;
+	OSE68000 | ose68000)
+		basic_machine=3Dm68000-ericsson
+		os=3D-ose
+		;;
+	os68k)
+		basic_machine=3Dm68k-none
+		os=3D-os68k
+		;;
+	pa-hitachi)
+		basic_machine=3Dhppa1.1-hitachi
+		os=3D-hiuxwe2
+		;;
+	paragon)
+		basic_machine=3Di860-intel
+		os=3D-osf
+		;;
+	parisc)
+		basic_machine=3Dhppa-unknown
+		os=3D-linux
+		;;
+	parisc-*)
+		basic_machine=3Dhppa-`echo $basic_machine | sed 's/^[^-]*-//'`
+		os=3D-linux
+		;;
+	pbd)
+		basic_machine=3Dsparc-tti
+		;;
+	pbb)
+		basic_machine=3Dm68k-tti
+		;;
+	pc532 | pc532-*)
+		basic_machine=3Dns32k-pc532
+		;;
+	pc98)
+		basic_machine=3Di386-pc
+		;;
+	pc98-*)
+		basic_machine=3Di386-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	pentium | p5 | k5 | k6 | nexgen | viac3)
+		basic_machine=3Di586-pc
+		;;
+	pentiumpro | p6 | 6x86 | athlon | athlon_*)
+		basic_machine=3Di686-pc
+		;;
+	pentiumii | pentium2 | pentiumiii | pentium3)
+		basic_machine=3Di686-pc
+		;;
+	pentium4)
+		basic_machine=3Di786-pc
+		;;
+	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+		basic_machine=3Di586-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	pentiumpro-* | p6-* | 6x86-* | athlon-*)
+		basic_machine=3Di686-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+		basic_machine=3Di686-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	pentium4-*)
+		basic_machine=3Di786-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	pn)
+		basic_machine=3Dpn-gould
+		;;
+	power)
+		basic_machine=3Dpower-ibm
+		;;
+	ppc | ppcbe)
+		basic_machine=3Dpowerpc-unknown
+		;;
+	ppc-* | ppcbe-*)
+		basic_machine=3Dpowerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	ppcle | powerpclittle | ppc-le | powerpc-little)
+		basic_machine=3Dpowerpcle-unknown
+		;;
+	ppcle-* | powerpclittle-*)
+		basic_machine=3Dpowerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	ppc64)
+		basic_machine=3Dpowerpc64-unknown
+		;;
+	ppc64-*)
+		basic_machine=3Dpowerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+		basic_machine=3Dpowerpc64le-unknown
+		;;
+	ppc64le-* | powerpc64little-*)
+		basic_machine=3Dpowerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	ps2)
+		basic_machine=3Di386-ibm
+		;;
+	pw32)
+		basic_machine=3Di586-unknown
+		os=3D-pw32
+		;;
+	rdos)
+		basic_machine=3Di386-pc
+		os=3D-rdos
+		;;
+	rom68k)
+		basic_machine=3Dm68k-rom68k
+		os=3D-coff
+		;;
+	rm[46]00)
+		basic_machine=3Dmips-siemens
+		;;
+	rtpc | rtpc-*)
+		basic_machine=3Dromp-ibm
+		;;
+	s390 | s390-*)
+		basic_machine=3Ds390-ibm
+		;;
+	s390x | s390x-*)
+		basic_machine=3Ds390x-ibm
+		;;
+	sa29200)
+		basic_machine=3Da29k-amd
+		os=3D-udi
+		;;
+	sb1)
+		basic_machine=3Dmipsisa64sb1-unknown
+		;;
+	sb1el)
+		basic_machine=3Dmipsisa64sb1el-unknown
+		;;
+	sde)
+		basic_machine=3Dmipsisa32-sde
+		os=3D-elf
+		;;
+	sei)
+		basic_machine=3Dmips-sei
+		os=3D-seiux
+		;;
+	sequent)
+		basic_machine=3Di386-sequent
+		;;
+	sh)
+		basic_machine=3Dsh-hitachi
+		os=3D-hms
+		;;
+	sh5el)
+		basic_machine=3Dsh5le-unknown
+		;;
+	sh64)
+		basic_machine=3Dsh64-unknown
+		;;
+	sparclite-wrs | simso-wrs)
+		basic_machine=3Dsparclite-wrs
+		os=3D-vxworks
+		;;
+	sps7)
+		basic_machine=3Dm68k-bull
+		os=3D-sysv2
+		;;
+	spur)
+		basic_machine=3Dspur-unknown
+		;;
+	st2000)
+		basic_machine=3Dm68k-tandem
+		;;
+	stratus)
+		basic_machine=3Di860-stratus
+		os=3D-sysv4
+		;;
+	strongarm-* | thumb-*)
+		basic_machine=3Darm-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	sun2)
+		basic_machine=3Dm68000-sun
+		;;
+	sun2os3)
+		basic_machine=3Dm68000-sun
+		os=3D-sunos3
+		;;
+	sun2os4)
+		basic_machine=3Dm68000-sun
+		os=3D-sunos4
+		;;
+	sun3os3)
+		basic_machine=3Dm68k-sun
+		os=3D-sunos3
+		;;
+	sun3os4)
+		basic_machine=3Dm68k-sun
+		os=3D-sunos4
+		;;
+	sun4os3)
+		basic_machine=3Dsparc-sun
+		os=3D-sunos3
+		;;
+	sun4os4)
+		basic_machine=3Dsparc-sun
+		os=3D-sunos4
+		;;
+	sun4sol2)
+		basic_machine=3Dsparc-sun
+		os=3D-solaris2
+		;;
+	sun3 | sun3-*)
+		basic_machine=3Dm68k-sun
+		;;
+	sun4)
+		basic_machine=3Dsparc-sun
+		;;
+	sun386 | sun386i | roadrunner)
+		basic_machine=3Di386-sun
+		;;
+	sv1)
+		basic_machine=3Dsv1-cray
+		os=3D-unicos
+		;;
+	symmetry)
+		basic_machine=3Di386-sequent
+		os=3D-dynix
+		;;
+	t3e)
+		basic_machine=3Dalphaev5-cray
+		os=3D-unicos
+		;;
+	t90)
+		basic_machine=3Dt90-cray
+		os=3D-unicos
+		;;
+	# This must be matched before tile*.
+	tilegx*)
+		basic_machine=3Dtilegx-unknown
+		os=3D-linux-gnu
+		;;
+	tile*)
+		basic_machine=3Dtile-unknown
+		os=3D-linux-gnu
+		;;
+	tx39)
+		basic_machine=3Dmipstx39-unknown
+		;;
+	tx39el)
+		basic_machine=3Dmipstx39el-unknown
+		;;
+	toad1)
+		basic_machine=3Dpdp10-xkl
+		os=3D-tops20
+		;;
+	tower | tower-32)
+		basic_machine=3Dm68k-ncr
+		;;
+	tpf)
+		basic_machine=3Ds390x-ibm
+		os=3D-tpf
+		;;
+	udi29k)
+		basic_machine=3Da29k-amd
+		os=3D-udi
+		;;
+	ultra3)
+		basic_machine=3Da29k-nyu
+		os=3D-sym1
+		;;
+	v810 | necv810)
+		basic_machine=3Dv810-nec
+		os=3D-none
+		;;
+	vaxv)
+		basic_machine=3Dvax-dec
+		os=3D-sysv
+		;;
+	vms)
+		basic_machine=3Dvax-dec
+		os=3D-vms
+		;;
+	vpp*|vx|vx-*)
+		basic_machine=3Df301-fujitsu
+		;;
+	vxworks960)
+		basic_machine=3Di960-wrs
+		os=3D-vxworks
+		;;
+	vxworks68)
+		basic_machine=3Dm68k-wrs
+		os=3D-vxworks
+		;;
+	vxworks29k)
+		basic_machine=3Da29k-wrs
+		os=3D-vxworks
+		;;
+	w65*)
+		basic_machine=3Dw65-wdc
+		os=3D-none
+		;;
+	w89k-*)
+		basic_machine=3Dhppa1.1-winbond
+		os=3D-proelf
+		;;
+	xbox)
+		basic_machine=3Di686-pc
+		os=3D-mingw32
+		;;
+	xps | xps100)
+		basic_machine=3Dxps100-honeywell
+		;;
+	xscale-* | xscalee[bl]-*)
+		basic_machine=3D`echo $basic_machine | sed 's/^xscale/arm/'`
+		;;
+	ymp)
+		basic_machine=3Dymp-cray
+		os=3D-unicos
+		;;
+	z8k-*-coff)
+		basic_machine=3Dz8k-unknown
+		os=3D-sim
+		;;
+	z80-*-coff)
+		basic_machine=3Dz80-unknown
+		os=3D-sim
+		;;
+	none)
+		basic_machine=3Dnone-none
+		os=3D-none
+		;;
+
+# Here we handle the default manufacturer of certain CPU types.  It is in
+# some cases the only manufacturer, in others, it is the most popular.
+	w89k)
+		basic_machine=3Dhppa1.1-winbond
+		;;
+	op50n)
+		basic_machine=3Dhppa1.1-oki
+		;;
+	op60c)
+		basic_machine=3Dhppa1.1-oki
+		;;
+	romp)
+		basic_machine=3Dromp-ibm
+		;;
+	mmix)
+		basic_machine=3Dmmix-knuth
+		;;
+	rs6000)
+		basic_machine=3Drs6000-ibm
+		;;
+	vax)
+		basic_machine=3Dvax-dec
+		;;
+	pdp10)
+		# there are many clones, so DEC is not a safe bet
+		basic_machine=3Dpdp10-unknown
+		;;
+	pdp11)
+		basic_machine=3Dpdp11-dec
+		;;
+	we32k)
+		basic_machine=3Dwe32k-att
+		;;
+	sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
+		basic_machine=3Dsh-unknown
+		;;
+	sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
+		basic_machine=3Dsparc-sun
+		;;
+	cydra)
+		basic_machine=3Dcydra-cydrome
+		;;
+	orion)
+		basic_machine=3Dorion-highlevel
+		;;
+	orion105)
+		basic_machine=3Dclipper-highlevel
+		;;
+	mac | mpw | mac-mpw)
+		basic_machine=3Dm68k-apple
+		;;
+	pmac | pmac-mpw)
+		basic_machine=3Dpowerpc-apple
+		;;
+	*-unknown)
+		# Make sure to match an already-canonicalized machine name.
+		;;
+	*)
+		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recogn=
ized 1>&2
+		exit 1
+		;;
+esac
+
+# Here we canonicalize certain aliases for manufacturers.
+case $basic_machine in
+	*-digital*)
+		basic_machine=3D`echo $basic_machine | sed 's/digital.*/dec/'`
+		;;
+	*-commodore*)
+		basic_machine=3D`echo $basic_machine | sed 's/commodore.*/cbm/'`
+		;;
+	*)
+		;;
+esac
+
+# Decode manufacturer-specific aliases for certain operating systems.
+
+if [ x"$os" !=3D x"" ]
+then
+case $os in
+	# First match some system type aliases
+	# that might get confused with valid system types.
+	# -solaris* is a basic system type, with this one exception.
+	-auroraux)
+		os=3D-auroraux
+		;;
+	-solaris1 | -solaris1.*)
+		os=3D`echo $os | sed -e 's|solaris1|sunos4|'`
+		;;
+	-solaris)
+		os=3D-solaris2
+		;;
+	-svr4*)
+		os=3D-sysv4
+		;;
+	-unixware*)
+		os=3D-sysv4.2uw
+		;;
+	-gnu/linux*)
+		os=3D`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
+		;;
+	# First accept the basic system types.
+	# The portable systems comes first.
+	# Each alternative MUST END IN A *, to match a version number.
+	# -sysv* is not here because it comes later, after sysvr4.
+	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos=
[34]*\
+	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris=
* \
+	      | -sym* | -kopensolaris* \
+	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+	      | -aos* | -aros* \
+	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+	      | -openbsd* | -solidbsd* \
+	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
+	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+	      | -chorusos* | -chorusrdb* | -cegcc* \
+	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+	      | -mingw32* | -linux-gnu* | -linux-android* \
+	      | -linux-newlib* | -linux-uclibc* \
+	      | -uxpv* | -beos* | -mpeix* | -udk* \
+	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
+	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
+	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
+	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
+	# Remember, each alternative MUST END IN *, to match a version number.
+		;;
+	-qnx*)
+		case $basic_machine in
+		    x86-* | i*86-*)
+			;;
+		    *)
+			os=3D-nto$os
+			;;
+		esac
+		;;
+	-nto-qnx*)
+		;;
+	-nto*)
+		os=3D`echo $os | sed -e 's|nto|nto-qnx|'`
+		;;
+	-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
+	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
+	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
+		;;
+	-mac*)
+		os=3D`echo $os | sed -e 's|mac|macos|'`
+		;;
+	-linux-dietlibc)
+		os=3D-linux-dietlibc
+		;;
+	-linux*)
+		os=3D`echo $os | sed -e 's|linux|linux-gnu|'`
+		;;
+	-sunos5*)
+		os=3D`echo $os | sed -e 's|sunos5|solaris2|'`
+		;;
+	-sunos6*)
+		os=3D`echo $os | sed -e 's|sunos6|solaris3|'`
+		;;
+	-opened*)
+		os=3D-openedition
+		;;
+	-os400*)
+		os=3D-os400
+		;;
+	-wince*)
+		os=3D-wince
+		;;
+	-osfrose*)
+		os=3D-osfrose
+		;;
+	-osf*)
+		os=3D-osf
+		;;
+	-utek*)
+		os=3D-bsd
+		;;
+	-dynix*)
+		os=3D-bsd
+		;;
+	-acis*)
+		os=3D-aos
+		;;
+	-atheos*)
+		os=3D-atheos
+		;;
+	-syllable*)
+		os=3D-syllable
+		;;
+	-386bsd)
+		os=3D-bsd
+		;;
+	-ctix* | -uts*)
+		os=3D-sysv
+		;;
+	-nova*)
+		os=3D-rtmk-nova
+		;;
+	-ns2)
+		os=3D-nextstep2
+		;;
+	-nsk*)
+		os=3D-nsk
+		;;
+	# Preserve the version number of sinix5.
+	-sinix5.*)
+		os=3D`echo $os | sed -e 's|sinix|sysv|'`
+		;;
+	-sinix*)
+		os=3D-sysv4
+		;;
+	-tpf*)
+		os=3D-tpf
+		;;
+	-triton*)
+		os=3D-sysv3
+		;;
+	-oss*)
+		os=3D-sysv3
+		;;
+	-svr4)
+		os=3D-sysv4
+		;;
+	-svr3)
+		os=3D-sysv3
+		;;
+	-sysvr4)
+		os=3D-sysv4
+		;;
+	# This must come after -sysvr4.
+	-sysv*)
+		;;
+	-ose*)
+		os=3D-ose
+		;;
+	-es1800*)
+		os=3D-ose
+		;;
+	-xenix)
+		os=3D-xenix
+		;;
+	-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+		os=3D-mint
+		;;
+	-aros*)
+		os=3D-aros
+		;;
+	-kaos*)
+		os=3D-kaos
+		;;
+	-zvmoe)
+		os=3D-zvmoe
+		;;
+	-dicos*)
+		os=3D-dicos
+		;;
+	-nacl*)
+		;;
+	-none)
+		;;
+	*)
+		# Get rid of the `-' at the beginning of $os.
+		os=3D`echo $os | sed 's/[^-]*-//'`
+		echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+		exit 1
+		;;
+esac
+else
+
+# Here we handle the default operating systems that come with various mach=
ines.
+# The value should be what the vendor currently ships out the door with th=
eir
+# machine or put another way, the most popular os provided with the machin=
e.
+
+# Note that if you're going to try to match "-MANUFACTURER" here (say,
+# "-sun"), then you have to tell the case statement up towards the top
+# that MANUFACTURER isn't an operating system.  Otherwise, code above
+# will signal an error saying that MANUFACTURER isn't an operating
+# system, and we'll never get to this point.
+
+case $basic_machine in
+	score-*)
+		os=3D-elf
+		;;
+	spu-*)
+		os=3D-elf
+		;;
+	*-acorn)
+		os=3D-riscix1.2
+		;;
+	arm*-rebel)
+		os=3D-linux
+		;;
+	arm*-semi)
+		os=3D-aout
+		;;
+	c4x-* | tic4x-*)
+		os=3D-coff
+		;;
+	tic54x-*)
+		os=3D-coff
+		;;
+	tic55x-*)
+		os=3D-coff
+		;;
+	tic6x-*)
+		os=3D-coff
+		;;
+	# This must come before the *-dec entry.
+	pdp10-*)
+		os=3D-tops20
+		;;
+	pdp11-*)
+		os=3D-none
+		;;
+	*-dec | vax-*)
+		os=3D-ultrix4.2
+		;;
+	m68*-apollo)
+		os=3D-domain
+		;;
+	i386-sun)
+		os=3D-sunos4.0.2
+		;;
+	m68000-sun)
+		os=3D-sunos3
+		# This also exists in the configure program, but was not the
+		# default.
+		# os=3D-sunos4
+		;;
+	m68*-cisco)
+		os=3D-aout
+		;;
+	mep-*)
+		os=3D-elf
+		;;
+	mips*-cisco)
+		os=3D-elf
+		;;
+	mips*-*)
+		os=3D-elf
+		;;
+	or32-*)
+		os=3D-coff
+		;;
+	*-tti)	# must be before sparc entry or we get the wrong os.
+		os=3D-sysv3
+		;;
+	sparc-* | *-sun)
+		os=3D-sunos4.1.1
+		;;
+	*-be)
+		os=3D-beos
+		;;
+	*-haiku)
+		os=3D-haiku
+		;;
+	*-ibm)
+		os=3D-aix
+		;;
+	*-knuth)
+		os=3D-mmixware
+		;;
+	*-wec)
+		os=3D-proelf
+		;;
+	*-winbond)
+		os=3D-proelf
+		;;
+	*-oki)
+		os=3D-proelf
+		;;
+	*-hp)
+		os=3D-hpux
+		;;
+	*-hitachi)
+		os=3D-hiux
+		;;
+	i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
+		os=3D-sysv
+		;;
+	*-cbm)
+		os=3D-amigaos
+		;;
+	*-dg)
+		os=3D-dgux
+		;;
+	*-dolphin)
+		os=3D-sysv3
+		;;
+	m68k-ccur)
+		os=3D-rtu
+		;;
+	m88k-omron*)
+		os=3D-luna
+		;;
+	*-next)
+		os=3D-nextstep
+		;;
+	*-sequent)
+		os=3D-ptx
+		;;
+	*-crds)
+		os=3D-unos
+		;;
+	*-ns)
+		os=3D-genix
+		;;
+	i370-*)
+		os=3D-mvs
+		;;
+	*-next)
+		os=3D-nextstep3
+		;;
+	*-gould)
+		os=3D-sysv
+		;;
+	*-highlevel)
+		os=3D-bsd
+		;;
+	*-encore)
+		os=3D-bsd
+		;;
+	*-sgi)
+		os=3D-irix
+		;;
+	*-siemens)
+		os=3D-sysv4
+		;;
+	*-masscomp)
+		os=3D-rtu
+		;;
+	f30[01]-fujitsu | f700-fujitsu)
+		os=3D-uxpv
+		;;
+	*-rom68k)
+		os=3D-coff
+		;;
+	*-*bug)
+		os=3D-coff
+		;;
+	*-apple)
+		os=3D-macos
+		;;
+	*-atari*)
+		os=3D-mint
+		;;
+	*)
+		os=3D-none
+		;;
+esac
+fi
+
+# Here we handle the case where we know the os, and the CPU type, but not =
the
+# manufacturer.  We pick the logical manufacturer.
+vendor=3Dunknown
+case $basic_machine in
+	*-unknown)
+		case $os in
+			-riscix*)
+				vendor=3Dacorn
+				;;
+			-sunos*)
+				vendor=3Dsun
+				;;
+			-cnk*|-aix*)
+				vendor=3Dibm
+				;;
+			-beos*)
+				vendor=3Dbe
+				;;
+			-hpux*)
+				vendor=3Dhp
+				;;
+			-mpeix*)
+				vendor=3Dhp
+				;;
+			-hiux*)
+				vendor=3Dhitachi
+				;;
+			-unos*)
+				vendor=3Dcrds
+				;;
+			-dgux*)
+				vendor=3Ddg
+				;;
+			-luna*)
+				vendor=3Domron
+				;;
+			-genix*)
+				vendor=3Dns
+				;;
+			-mvs* | -opened*)
+				vendor=3Dibm
+				;;
+			-os400*)
+				vendor=3Dibm
+				;;
+			-ptx*)
+				vendor=3Dsequent
+				;;
+			-tpf*)
+				vendor=3Dibm
+				;;
+			-vxsim* | -vxworks* | -windiss*)
+				vendor=3Dwrs
+				;;
+			-aux*)
+				vendor=3Dapple
+				;;
+			-hms*)
+				vendor=3Dhitachi
+				;;
+			-mpw* | -macos*)
+				vendor=3Dapple
+				;;
+			-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+				vendor=3Datari
+				;;
+			-vos*)
+				vendor=3Dstratus
+				;;
+		esac
+		basic_machine=3D`echo $basic_machine | sed "s/unknown/$vendor/"`
+		;;
+esac
+
+echo $basic_machine$os
+exit
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp=3D'"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/config_h.in
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/config_h.in	Wed Jul 25 16:21:35 2012 +0300
@@ -0,0 +1,3 @@
+/* @[email protected] */
+/* $Id: config_h.in,v 1.1 1995/01/01 19:34:59 tom Exp $ */
+ at DEFS@
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/configure
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/configure	Wed Jul 25 16:21:35 2012 +0300
@@ -0,0 +1,5973 @@
+#! /bin/sh
+# From configure.in Revision: 1.10 .
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by Autoconf 2.52.20101002.
+#
+# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
+# Free Software Foundation, Inc.
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+
+# Avoid depending upon Character Ranges.
+as_cr_letters=3D'abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS=3D'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=3D$as_cr_letters$as_cr_LETTERS
+as_cr_digits=3D'0123456789'
+as_cr_alnum=3D$as_cr_Letters$as_cr_digits
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh=3D"sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp=3D"sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=3D:
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+  set -o posix
+fi
+
+# Name of the executable.
+as_me=3D`echo "$0" |sed 's,.*[\\/],,'`
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=3Dexpr
+else
+  as_expr=3Dfalse
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+  # We could just check for DJGPP; but this test a) works b) is more gener=
ic
+  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+  if test -f conf$$.exe; then
+    # Don't use ln at all; we don't have any links
+    as_ln_s=3D'cp -p'
+  else
+    as_ln_s=3D'ln -s'
+  fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s=3Dln
+else
+  as_ln_s=3D'cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+as_executable_p=3D"test -f"
+
+# Support unset when possible.
+if (FOO=3DFOO; unset FOO) >/dev/null 2>&1; then
+  as_unset=3Dunset
+else
+  as_unset=3Dfalse
+fi
+
+# NLS nuisances.
+$as_unset LANG || test "${LANG+set}" !=3D set || { LANG=3DC; export LANG; }
+$as_unset LC_ALL || test "${LC_ALL+set}" !=3D set || { LC_ALL=3DC; export =
LC_ALL; }
+$as_unset LC_TIME || test "${LC_TIME+set}" !=3D set || { LC_TIME=3DC; expo=
rt LC_TIME; }
+$as_unset LC_CTYPE || test "${LC_CTYPE+set}" !=3D set || { LC_CTYPE=3DC; e=
xport LC_CTYPE; }
+$as_unset LANGUAGE || test "${LANGUAGE+set}" !=3D set || { LANGUAGE=3DC; e=
xport LANGUAGE; }
+$as_unset LC_COLLATE || test "${LC_COLLATE+set}" !=3D set || { LC_COLLATE=
=3DC; export LC_COLLATE; }
+$as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" !=3D set || { LC_NUMERIC=
=3DC; export LC_NUMERIC; }
+$as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" !=3D set || { LC_MESSAG=
ES=3DC; export LC_MESSAGES; }
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl=3D'
+'
+IFS=3D" 	$as_nl"
+
+# CDPATH.
+$as_unset CDPATH || test "${CDPATH+set}" !=3D set || { CDPATH=3D:; export =
CDPATH; }
+
+# Name of the host.
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=3D`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+exec 6>&1
+
+#
+# Initializations.
+#
+ac_default_prefix=3D/usr/local
+cross_compiling=3Dno
+subdirs=3D
+MFLAGS=3D MAKEFLAGS=3D
+SHELL=3D${CONFIG_SHELL-/bin/sh}
+
+# Maximum number of lines to put in a shell here document.
+# This variable seems obsolete.  It should probably be removed, and
+# only ac_max_sed_lines should be used.
+: ${ac_max_here_lines=3D38}
+
+ac_unique_file=3D"main.c"
+
+# Initialize some variables set by options.
+ac_init_help=3D
+ac_init_version=3Dfalse
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=3D/dev/null
+exec_prefix=3DNONE
+no_create=3D
+no_recursion=3D
+prefix=3DNONE
+program_prefix=3DNONE
+program_suffix=3DNONE
+program_transform_name=3Ds,x,x,
+silent=3D
+site=3D
+srcdir=3D
+verbose=3D
+x_includes=3DNONE
+x_libraries=3DNONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=3D/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+bindir=3D'${exec_prefix}/bin'
+sbindir=3D'${exec_prefix}/sbin'
+libexecdir=3D'${exec_prefix}/libexec'
+datadir=3D'${prefix}/share'
+sysconfdir=3D'${prefix}/etc'
+sharedstatedir=3D'${prefix}/com'
+localstatedir=3D'${prefix}/var'
+libdir=3D'${exec_prefix}/lib'
+includedir=3D'${prefix}/include'
+oldincludedir=3D'/usr/include'
+infodir=3D'${prefix}/info'
+mandir=3D'${prefix}/man'
+
+# Identity of this package.
+PACKAGE_NAME=3D
+PACKAGE_TARNAME=3D
+PACKAGE_VERSION=3D
+PACKAGE_STRING=3D
+PACKAGE_BUGREPORT=3D
+
+ac_prev=3D
+for ac_option
+do
+  # If the previous option needs an argument, assign it.
+  if test -n "$ac_prev"; then
+    eval "$ac_prev=3D\$ac_option"
+    ac_prev=3D
+    continue
+  fi
+
+  ac_optarg=3D`expr "x$ac_option" : 'x[^=3D]*=3D\(.*\)'`
+
+  # Accept the important Cygnus configure options, so we can diagnose typo=
s.
+
+  case $ac_option in
+
+  -bindir | --bindir | --bindi | --bind | --bin | --bi)
+    ac_prev=3Dbindir ;;
+  -bindir=3D* | --bindir=3D* | --bindi=3D* | --bind=3D* | --bin=3D* | --bi=
=3D*)
+    bindir=3D$ac_optarg ;;
+
+  -build | --build | --buil | --bui | --bu)
+    ac_prev=3Dbuild_alias ;;
+  -build=3D* | --build=3D* | --buil=3D* | --bui=3D* | --bu=3D*)
+    build_alias=3D$ac_optarg ;;
+
+  -cache-file | --cache-file | --cache-fil | --cache-fi \
+  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+    ac_prev=3Dcache_file ;;
+  -cache-file=3D* | --cache-file=3D* | --cache-fil=3D* | --cache-fi=3D* \
+  | --cache-f=3D* | --cache-=3D* | --cache=3D* | --cach=3D* | --cac=3D* | =
--ca=3D* | --c=3D*)
+    cache_file=3D$ac_optarg ;;
+
+  --config-cache | -C)
+    cache_file=3Dconfig.cache ;;
+
+  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+    ac_prev=3Ddatadir ;;
+  -datadir=3D* | --datadir=3D* | --datadi=3D* | --datad=3D* | --data=3D* |=
 --dat=3D* \
+  | --da=3D*)
+    datadir=3D$ac_optarg ;;
+
+  -disable-* | --disable-*)
+    ac_feature=3D`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+   { (exit 1); exit 1; }; }
+    ac_feature=3D`echo $ac_feature | sed 's/-/_/g'`
+    eval "enable_$ac_feature=3Dno" ;;
+
+  -enable-* | --enable-*)
+    ac_feature=3D`expr "x$ac_option" : 'x-*enable-\([^=3D]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+   { (exit 1); exit 1; }; }
+    ac_feature=3D`echo $ac_feature | sed 's/-/_/g'`
+    case $ac_option in
+      *=3D*) ac_optarg=3D`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+      *) ac_optarg=3Dyes ;;
+    esac
+    eval "enable_$ac_feature=3D'$ac_optarg'" ;;
+
+  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+  | --exec | --exe | --ex)
+    ac_prev=3Dexec_prefix ;;
+  -exec-prefix=3D* | --exec_prefix=3D* | --exec-prefix=3D* | --exec-prefi=
=3D* \
+  | --exec-pref=3D* | --exec-pre=3D* | --exec-pr=3D* | --exec-p=3D* | --ex=
ec-=3D* \
+  | --exec=3D* | --exe=3D* | --ex=3D*)
+    exec_prefix=3D$ac_optarg ;;
+
+  -gas | --gas | --ga | --g)
+    # Obsolete; use --with-gas.
+    with_gas=3Dyes ;;
+
+  -help | --help | --hel | --he | -h)
+    ac_init_help=3Dlong ;;
+  -help=3Dr* | --help=3Dr* | --hel=3Dr* | --he=3Dr* | -hr*)
+    ac_init_help=3Drecursive ;;
+  -help=3Ds* | --help=3Ds* | --hel=3Ds* | --he=3Ds* | -hs*)
+    ac_init_help=3Dshort ;;
+
+  -host | --host | --hos | --ho)
+    ac_prev=3Dhost_alias ;;
+  -host=3D* | --host=3D* | --hos=3D* | --ho=3D*)
+    host_alias=3D$ac_optarg ;;
+
+  -includedir | --includedir | --includedi | --included | --include \
+  | --includ | --inclu | --incl | --inc)
+    ac_prev=3Dincludedir ;;
+  -includedir=3D* | --includedir=3D* | --includedi=3D* | --included=3D* | =
--include=3D* \
+  | --includ=3D* | --inclu=3D* | --incl=3D* | --inc=3D*)
+    includedir=3D$ac_optarg ;;
+
+  -infodir | --infodir | --infodi | --infod | --info | --inf)
+    ac_prev=3Dinfodir ;;
+  -infodir=3D* | --infodir=3D* | --infodi=3D* | --infod=3D* | --info=3D* |=
 --inf=3D*)
+    infodir=3D$ac_optarg ;;
+
+  -libdir | --libdir | --libdi | --libd)
+    ac_prev=3Dlibdir ;;
+  -libdir=3D* | --libdir=3D* | --libdi=3D* | --libd=3D*)
+    libdir=3D$ac_optarg ;;
+
+  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+  | --libexe | --libex | --libe)
+    ac_prev=3Dlibexecdir ;;
+  -libexecdir=3D* | --libexecdir=3D* | --libexecdi=3D* | --libexecd=3D* | =
--libexec=3D* \
+  | --libexe=3D* | --libex=3D* | --libe=3D*)
+    libexecdir=3D$ac_optarg ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst \
+  | --locals | --local | --loca | --loc | --lo)
+    ac_prev=3Dlocalstatedir ;;
+  -localstatedir=3D* | --localstatedir=3D* | --localstatedi=3D* | --locals=
tated=3D* \
+  | --localstate=3D* | --localstat=3D* | --localsta=3D* | --localst=3D* \
+  | --locals=3D* | --local=3D* | --loca=3D* | --loc=3D* | --lo=3D*)
+    localstatedir=3D$ac_optarg ;;
+
+  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+    ac_prev=3Dmandir ;;
+  -mandir=3D* | --mandir=3D* | --mandi=3D* | --mand=3D* | --man=3D* | --ma=
=3D* | --m=3D*)
+    mandir=3D$ac_optarg ;;
+
+  -nfp | --nfp | --nf)
+    # Obsolete; use --without-fp.
+    with_fp=3Dno ;;
+
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c)
+    no_create=3Dyes ;;
+
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+    no_recursion=3Dyes ;;
+
+  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+  | --oldin | --oldi | --old | --ol | --o)
+    ac_prev=3Doldincludedir ;;
+  -oldincludedir=3D* | --oldincludedir=3D* | --oldincludedi=3D* | --oldinc=
luded=3D* \
+  | --oldinclude=3D* | --oldinclud=3D* | --oldinclu=3D* | --oldincl=3D* | =
--oldinc=3D* \
+  | --oldin=3D* | --oldi=3D* | --old=3D* | --ol=3D* | --o=3D*)
+    oldincludedir=3D$ac_optarg ;;
+
+  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+    ac_prev=3Dprefix ;;
+  -prefix=3D* | --prefix=3D* | --prefi=3D* | --pref=3D* | --pre=3D* | --pr=
=3D* | --p=3D*)
+    prefix=3D$ac_optarg ;;
+
+  -program-prefix | --program-prefix | --program-prefi | --program-pref \
+  | --program-pre | --program-pr | --program-p)
+    ac_prev=3Dprogram_prefix ;;
+  -program-prefix=3D* | --program-prefix=3D* | --program-prefi=3D* \
+  | --program-pref=3D* | --program-pre=3D* | --program-pr=3D* | --program-=
p=3D*)
+    program_prefix=3D$ac_optarg ;;
+
+  -program-suffix | --program-suffix | --program-suffi | --program-suff \
+  | --program-suf | --program-su | --program-s)
+    ac_prev=3Dprogram_suffix ;;
+  -program-suffix=3D* | --program-suffix=3D* | --program-suffi=3D* \
+  | --program-suff=3D* | --program-suf=3D* | --program-su=3D* | --program-=
s=3D*)
+    program_suffix=3D$ac_optarg ;;
+
+  -program-transform-name | --program-transform-name \
+  | --program-transform-nam | --program-transform-na \
+  | --program-transform-n | --program-transform- \
+  | --program-transform | --program-transfor \
+  | --program-transfo | --program-transf \
+  | --program-trans | --program-tran \
+  | --progr-tra | --program-tr | --program-t)
+    ac_prev=3Dprogram_transform_name ;;
+  -program-transform-name=3D* | --program-transform-name=3D* \
+  | --program-transform-nam=3D* | --program-transform-na=3D* \
+  | --program-transform-n=3D* | --program-transform-=3D* \
+  | --program-transform=3D* | --program-transfor=3D* \
+  | --program-transfo=3D* | --program-transf=3D* \
+  | --program-trans=3D* | --program-tran=3D* \
+  | --progr-tra=3D* | --program-tr=3D* | --program-t=3D*)
+    program_transform_name=3D$ac_optarg ;;
+
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil)
+    silent=3Dyes ;;
+
+  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+    ac_prev=3Dsbindir ;;
+  -sbindir=3D* | --sbindir=3D* | --sbindi=3D* | --sbind=3D* | --sbin=3D* \
+  | --sbi=3D* | --sb=3D*)
+    sbindir=3D$ac_optarg ;;
+
+  -sharedstatedir | --sharedstatedir | --sharedstatedi \
+  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+  | --sharedst | --shareds | --shared | --share | --shar \
+  | --sha | --sh)
+    ac_prev=3Dsharedstatedir ;;
+  -sharedstatedir=3D* | --sharedstatedir=3D* | --sharedstatedi=3D* \
+  | --sharedstated=3D* | --sharedstate=3D* | --sharedstat=3D* | --sharedst=
a=3D* \
+  | --sharedst=3D* | --shareds=3D* | --shared=3D* | --share=3D* | --shar=
=3D* \
+  | --sha=3D* | --sh=3D*)
+    sharedstatedir=3D$ac_optarg ;;
+
+  -site | --site | --sit)
+    ac_prev=3Dsite ;;
+  -site=3D* | --site=3D* | --sit=3D*)
+    site=3D$ac_optarg ;;
+
+  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+    ac_prev=3Dsrcdir ;;
+  -srcdir=3D* | --srcdir=3D* | --srcdi=3D* | --srcd=3D* | --src=3D* | --sr=
=3D*)
+    srcdir=3D$ac_optarg ;;
+
+  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+  | --syscon | --sysco | --sysc | --sys | --sy)
+    ac_prev=3Dsysconfdir ;;
+  -sysconfdir=3D* | --sysconfdir=3D* | --sysconfdi=3D* | --sysconfd=3D* | =
--sysconf=3D* \
+  | --syscon=3D* | --sysco=3D* | --sysc=3D* | --sys=3D* | --sy=3D*)
+    sysconfdir=3D$ac_optarg ;;
+
+  -target | --target | --targe | --targ | --tar | --ta | --t)
+    ac_prev=3Dtarget_alias ;;
+  -target=3D* | --target=3D* | --targe=3D* | --targ=3D* | --tar=3D* | --ta=
=3D* | --t=3D*)
+    target_alias=3D$ac_optarg ;;
+
+  -v | -verbose | --verbose | --verbos | --verbo | --verb)
+    verbose=3Dyes ;;
+
+  -version | --version | --versio | --versi | --vers | -V)
+    ac_init_version=3D: ;;
+
+  -with-* | --with-*)
+    ac_package=3D`expr "x$ac_option" : 'x-*with-\([^=3D]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid package name: $ac_package" >&2
+   { (exit 1); exit 1; }; }
+    ac_package=3D`echo $ac_package| sed 's/-/_/g'`
+    case $ac_option in
+      *=3D*) ac_optarg=3D`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+      *) ac_optarg=3Dyes ;;
+    esac
+    eval "with_$ac_package=3D'$ac_optarg'" ;;
+
+  -without-* | --without-*)
+    ac_package=3D`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid package name: $ac_package" >&2
+   { (exit 1); exit 1; }; }
+    ac_package=3D`echo $ac_package | sed 's/-/_/g'`
+    eval "with_$ac_package=3Dno" ;;
+
+  --x)
+    # Obsolete; use --with-x.
+    with_x=3Dyes ;;
+
+  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+  | --x-incl | --x-inc | --x-in | --x-i)
+    ac_prev=3Dx_includes ;;
+  -x-includes=3D* | --x-includes=3D* | --x-include=3D* | --x-includ=3D* | =
--x-inclu=3D* \
+  | --x-incl=3D* | --x-inc=3D* | --x-in=3D* | --x-i=3D*)
+    x_includes=3D$ac_optarg ;;
+
+  -x-libraries | --x-libraries | --x-librarie | --x-librari \
+  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+    ac_prev=3Dx_libraries ;;
+  -x-libraries=3D* | --x-libraries=3D* | --x-librarie=3D* | --x-librari=3D=
* \
+  | --x-librar=3D* | --x-libra=3D* | --x-libr=3D* | --x-lib=3D* | --x-li=
=3D* | --x-l=3D*)
+    x_libraries=3D$ac_optarg ;;
+
+  -*) { echo "$as_me: error: unrecognized option: $ac_option
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; }
+    ;;
+
+  *=3D*)
+    ac_envvar=3D`expr "x$ac_option" : 'x\([^=3D]*\)=3D'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+   { (exit 1); exit 1; }; }
+    ac_optarg=3D`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
+    eval "$ac_envvar=3D'$ac_optarg'"
+    export $ac_envvar ;;
+
+  *)
+    # FIXME: should be removed in autoconf 3.0.
+    echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+    : ${build_alias=3D$ac_option} ${host_alias=3D$ac_option} ${target_alia=
s=3D$ac_option}
+    ;;
+
+  esac
+done
+
+if test -n "$ac_prev"; then
+  ac_option=3D--`echo $ac_prev | sed 's/_/-/g'`
+  { echo "$as_me: error: missing argument to $ac_option" >&2
+   { (exit 1); exit 1; }; }
+fi
+
+# Be sure to have absolute paths.
+for ac_var in exec_prefix prefix
+do
+  eval ac_val=3D$`echo $ac_var`
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
+    *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $a=
c_val" >&2
+   { (exit 1); exit 1; }; };;
+  esac
+done
+
+# Be sure to have absolute paths.
+for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
+              localstatedir libdir includedir oldincludedir infodir mandir
+do
+  eval ac_val=3D$`echo $ac_var`
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* ) ;;
+    *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $a=
c_val" >&2
+   { (exit 1); exit 1; }; };;
+  esac
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+build=3D$build_alias
+host=3D$host_alias
+target=3D$target_alias
+
+# FIXME: should be removed in autoconf 3.0.
+if test "x$host_alias" !=3D x; then
+  if test "x$build_alias" =3D x; then
+    cross_compiling=3Dmaybe
+    echo "$as_me: WARNING: If you wanted to set the --build type, don't us=
e --host.
+    If a cross compiler is detected then cross compile mode will be used."=
 >&2
+  elif test "x$build_alias" !=3D "x$host_alias"; then
+    cross_compiling=3Dyes
+  fi
+fi
+
+ac_tool_prefix=3D
+test -n "$host_alias" && ac_tool_prefix=3D$host_alias-
+
+test "$silent" =3D yes && exec 6>/dev/null
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+  ac_srcdir_defaulted=3Dyes
+  # Try the directory containing this script, then its parent.
+  ac_prog=3D$0
+  ac_confdir=3D`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'`
+  test "x$ac_confdir" =3D "x$ac_prog" && ac_confdir=3D.
+  srcdir=3D$ac_confdir
+  if test ! -r $srcdir/$ac_unique_file; then
+    srcdir=3D..
+  fi
+else
+  ac_srcdir_defaulted=3Dno
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+  if test "$ac_srcdir_defaulted" =3D yes; then
+    { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2
+   { (exit 1); exit 1; }; }
+  else
+    { echo "$as_me: error: cannot find sources in $srcdir" >&2
+   { (exit 1); exit 1; }; }
+  fi
+fi
+srcdir=3D`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
+ac_env_build_alias_set=3D${build_alias+set}
+ac_env_build_alias_value=3D$build_alias
+ac_cv_env_build_alias_set=3D${build_alias+set}
+ac_cv_env_build_alias_value=3D$build_alias
+ac_env_host_alias_set=3D${host_alias+set}
+ac_env_host_alias_value=3D$host_alias
+ac_cv_env_host_alias_set=3D${host_alias+set}
+ac_cv_env_host_alias_value=3D$host_alias
+ac_env_target_alias_set=3D${target_alias+set}
+ac_env_target_alias_value=3D$target_alias
+ac_cv_env_target_alias_set=3D${target_alias+set}
+ac_cv_env_target_alias_value=3D$target_alias
+ac_env_CC_set=3D${CC+set}
+ac_env_CC_value=3D$CC
+ac_cv_env_CC_set=3D${CC+set}
+ac_cv_env_CC_value=3D$CC
+ac_env_CFLAGS_set=3D${CFLAGS+set}
+ac_env_CFLAGS_value=3D$CFLAGS
+ac_cv_env_CFLAGS_set=3D${CFLAGS+set}
+ac_cv_env_CFLAGS_value=3D$CFLAGS
+ac_env_LDFLAGS_set=3D${LDFLAGS+set}
+ac_env_LDFLAGS_value=3D$LDFLAGS
+ac_cv_env_LDFLAGS_set=3D${LDFLAGS+set}
+ac_cv_env_LDFLAGS_value=3D$LDFLAGS
+ac_env_CPPFLAGS_set=3D${CPPFLAGS+set}
+ac_env_CPPFLAGS_value=3D$CPPFLAGS
+ac_cv_env_CPPFLAGS_set=3D${CPPFLAGS+set}
+ac_cv_env_CPPFLAGS_value=3D$CPPFLAGS
+ac_env_CPP_set=3D${CPP+set}
+ac_env_CPP_value=3D$CPP
+ac_cv_env_CPP_set=3D${CPP+set}
+ac_cv_env_CPP_value=3D$CPP
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" =3D "long"; then
+  # Omit some internal or obsolete options to make the list less imposing.
+  # This message is too long to be a string in the A/UX 3.1 sh.
+  cat <<EOF
+\`configure' configures this package to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=3DVALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=3DVALUE.  See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+  -h, --help              display this help and exit
+      --help=3Dshort        display options specific to this package
+      --help=3Drecursive    display the short help of all the included pac=
kages
+  -V, --version           display version information and exit
+  -q, --quiet, --silent   do not print \`checking...' messages
+      --cache-file=3DFILE   cache test results in FILE [disabled]
+  -C, --config-cache      alias for \`--cache-file=3Dconfig.cache'
+  -n, --no-create         do not create output files
+      --srcdir=3DDIR        find the sources in DIR [configure dir or \`..=
']
+
+EOF
+
+  cat <<EOF
+Installation directories:
+  --prefix=3DPREFIX         install architecture-independent files in PREF=
IX
+                          [$ac_default_prefix]
+  --exec-prefix=3DEPREFIX   install architecture-dependent files in EPREFIX
+                          [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=3D\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+  --bindir=3DDIR            user executables [EPREFIX/bin]
+  --sbindir=3DDIR           system admin executables [EPREFIX/sbin]
+  --libexecdir=3DDIR        program executables [EPREFIX/libexec]
+  --datadir=3DDIR           read-only architecture-independent data [PREFI=
X/share]
+  --sysconfdir=3DDIR        read-only single-machine data [PREFIX/etc]
+  --sharedstatedir=3DDIR    modifiable architecture-independent data [PREF=
IX/com]
+  --localstatedir=3DDIR     modifiable single-machine data [PREFIX/var]
+  --libdir=3DDIR            object code libraries [EPREFIX/lib]
+  --includedir=3DDIR        C header files [PREFIX/include]
+  --oldincludedir=3DDIR     C header files for non-gcc [/usr/include]
+  --infodir=3DDIR           info documentation [PREFIX/info]
+  --mandir=3DDIR            man documentation [PREFIX/man]
+EOF
+
+  cat <<\EOF
+
+Program names:
+  --program-prefix=3DPREFIX            prepend PREFIX to installed program=
 names
+  --program-suffix=3DSUFFIX            append SUFFIX to installed program =
names
+  --program-transform-name=3DPROGRAM   run sed PROGRAM on installed progra=
m names
+
+System types:
+  --build=3DBUILD           configure for building on BUILD [guessed]
+  --host=3DHOST       build programs to run on HOST [BUILD]
+  --target=3DTARGET   configure for building compilers for TARGET [HOST]
+EOF
+fi
+
+if test -n "$ac_init_help"; then
+
+  cat <<\EOF
+
+Optional Packages:
+  --with-PACKAGE[=3DARG]    use PACKAGE [ARG=3Dyes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=3Dno)
+
+Optional Features:
+  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=
=3Dno)
+  --enable-FEATURE[=3DARG]  include FEATURE [ARG=3Dyes]
+
+  --with-warnings         test: turn on gcc warnings
+  --disable-echo          display "compiling" commands
+  --with-dmalloc          test: use Gray Watson's dmalloc library
+  --with-dbmalloc         test: use Conor Cahill's dbmalloc library
+  --with-valgrind         test: use valgrind
+  --disable-leaks         test: free permanent memory, analyze leaks
+
+Some influential environment variables:
+  CC          C compiler command
+  CFLAGS      C compiler flags
+  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+              nonstandard directory <lib dir>
+  CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
+              headers in a nonstandard directory <include dir>
+  CPP         C preprocessor
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+EOF
+fi
+
+if test "$ac_init_help" =3D "recursive"; then
+  # If there are subdirs, report their specific --help.
+  ac_popdir=3D`pwd`
+  for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" =3D x: && cont=
inue
+    cd $ac_subdir
+    # A "../" for each directory in /$ac_subdir.
+    ac_dots=3D`echo $ac_subdir |
+             sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
+
+    case $srcdir in
+    .) # No --srcdir option.  We are building in place.
+      ac_sub_srcdir=3D$srcdir ;;
+    [\\/]* | ?:[\\/]* ) # Absolute path.
+      ac_sub_srcdir=3D$srcdir/$ac_subdir ;;
+    *) # Relative path.
+      ac_sub_srcdir=3D$ac_dots$srcdir/$ac_subdir ;;
+    esac
+
+    # Check for guested configure; otherwise get Cygnus style configure.
+    if test -f $ac_sub_srcdir/configure.gnu; then
+      echo
+      $SHELL $ac_sub_srcdir/configure.gnu  --help=3Drecursive
+    elif test -f $ac_sub_srcdir/configure; then
+      echo
+      $SHELL $ac_sub_srcdir/configure  --help=3Drecursive
+    elif test -f $ac_sub_srcdir/configure.ac ||
+           test -f $ac_sub_srcdir/configure.in; then
+      echo
+      $ac_configure --help
+    else
+      echo "$as_me: WARNING: no configuration information is in $ac_subdir=
" >&2
+    fi
+    cd $ac_popdir
+  done
+fi
+
+test -n "$ac_init_help" && exit 0
+if $ac_init_version; then
+  cat <<\EOF
+
+Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
+Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+EOF
+  exit 0
+fi
+exec 5>config.log
+cat >&5 <<EOF
+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.20101002.  Invocation command line was
+
+  $ $0 [email protected]
+
+EOF
+{
+cat <<_ASUNAME
+## ---------- ##
+## Platform.  ##
+## ---------- ##
+
+hostname =3D `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m =3D `(uname -m) 2>/dev/null || echo unknown`
+uname -r =3D `(uname -r) 2>/dev/null || echo unknown`
+uname -s =3D `(uname -s) 2>/dev/null || echo unknown`
+uname -v =3D `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p =3D `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X     =3D `(/bin/uname -X) 2>/dev/null     || echo unknown`
+
+/bin/arch              =3D `(/bin/arch) 2>/dev/null              || echo u=
nknown`
+/usr/bin/arch -k       =3D `(/usr/bin/arch -k) 2>/dev/null       || echo u=
nknown`
+/usr/convex/getsysinfo =3D `(/usr/convex/getsysinfo) 2>/dev/null || echo u=
nknown`
+hostinfo               =3D `(hostinfo) 2>/dev/null               || echo u=
nknown`
+/bin/machine           =3D `(/bin/machine) 2>/dev/null           || echo u=
nknown`
+/usr/bin/oslevel       =3D `(/usr/bin/oslevel) 2>/dev/null       || echo u=
nknown`
+/bin/universe          =3D `(/bin/universe) 2>/dev/null          || echo u=
nknown`
+
+PATH =3D $PATH
+
+_ASUNAME
+} >&5
+
+cat >&5 <<EOF
+## ------------ ##
+## Core tests.  ##
+## ------------ ##
+
+EOF
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Also quote any args containing shell meta-characters.
+ac_configure_args=3D
+ac_sep=3D
+for ac_arg
+do
+  case $ac_arg in
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c) ;;
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
+  *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+    ac_arg=3D`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
+    ac_configure_args=3D"$ac_configure_args$ac_sep'$ac_arg'"
+    ac_sep=3D" " ;;
+  *) ac_configure_args=3D"$ac_configure_args$ac_sep$ac_arg"
+     ac_sep=3D" " ;;
+  esac
+  # Get rid of the leading space.
+done
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log.  We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+trap 'exit_status=3D$?
+  # Save into config.log some information that might help in debugging.
+  echo >&5
+  echo "## ----------------- ##" >&5
+  echo "## Cache variables.  ##" >&5
+  echo "## ----------------- ##" >&5
+  echo >&5
+  # The following way of writing the cache mishandles newlines in values,
+{
+  (set) 2>&1 |
+    case `(ac_space=3D'"'"' '"'"'; set | grep ac_space) 2>&1` in
+    *ac_space=3D\ *)
+      sed -n \
+        "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
+    	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=3D\\(.*\\)/\\1=3D'"'"=
'\\2'"'"'/p"
+      ;;
+    *)
+      sed -n \
+        "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=3D\\(.*\\)/\\1=3D\\=
2/p"
+      ;;
+    esac;
+} >&5
+  sed "/^$/d" confdefs.h >conftest.log
+  if test -s conftest.log; then
+    echo >&5
+    echo "## ------------ ##" >&5
+    echo "## confdefs.h.  ##" >&5
+    echo "## ------------ ##" >&5
+    echo >&5
+    cat conftest.log >&5
+  fi
+  (echo; echo) >&5
+  test "$ac_signal" !=3D 0 &&
+    echo "$as_me: caught signal $ac_signal" >&5
+  echo "$as_me: exit $exit_status" >&5
+  rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
+    exit $exit_status
+     ' 0
+for ac_signal in 1 2 13 15; do
+  trap 'ac_signal=3D'$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+done
+ac_signal=3D0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newl=
ine.
+echo >confdefs.h
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+  if test "x$prefix" !=3D xNONE; then
+    CONFIG_SITE=3D"$prefix/share/config.site $prefix/etc/config.site"
+  else
+    CONFIG_SITE=3D"$ac_default_prefix/share/config.site $ac_default_prefix=
/etc/config.site"
+  fi
+fi
+for ac_site_file in $CONFIG_SITE; do
+  if test -r "$ac_site_file"; then
+    { echo "$as_me:845: loading site script $ac_site_file" >&5
+echo "$as_me: loading site script $ac_site_file" >&6;}
+    cat "$ac_site_file" >&5
+    . "$ac_site_file"
+  fi
+done
+
+if test -r "$cache_file"; then
+  # Some versions of bash will fail to source /dev/null (special
+  # files actually), so we avoid doing that.
+  if test -f "$cache_file"; then
+    { echo "$as_me:856: loading cache $cache_file" >&5
+echo "$as_me: loading cache $cache_file" >&6;}
+    case $cache_file in
+      [\\/]* | ?:[\\/]* ) . $cache_file;;
+      *)                      . ./$cache_file;;
+    esac
+  fi
+else
+  { echo "$as_me:864: creating cache $cache_file" >&5
+echo "$as_me: creating cache $cache_file" >&6;}
+  >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=3Dfalse
+for ac_var in `(set) 2>&1 |
+               sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=3D.*/\1/p'`; do
+  eval ac_old_set=3D\$ac_cv_env_${ac_var}_set
+  eval ac_new_set=3D\$ac_env_${ac_var}_set
+  eval ac_old_val=3D"\$ac_cv_env_${ac_var}_value"
+  eval ac_new_val=3D"\$ac_env_${ac_var}_value"
+  case $ac_old_set,$ac_new_set in
+    set,)
+      { echo "$as_me:880: error: \`$ac_var' was set to \`$ac_old_val' in t=
he previous run" >&5
+echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous =
run" >&2;}
+      ac_cache_corrupted=3D: ;;
+    ,set)
+      { echo "$as_me:884: error: \`$ac_var' was not set in the previous ru=
n" >&5
+echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+      ac_cache_corrupted=3D: ;;
+    ,);;
+    *)
+      if test "x$ac_old_val" !=3D "x$ac_new_val"; then
+        { echo "$as_me:890: error: \`$ac_var' has changed since the previo=
us run:" >&5
+echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+        { echo "$as_me:892:   former value:  $ac_old_val" >&5
+echo "$as_me:   former value:  $ac_old_val" >&2;}
+        { echo "$as_me:894:   current value: $ac_new_val" >&5
+echo "$as_me:   current value: $ac_new_val" >&2;}
+        ac_cache_corrupted=3D:
+      fi;;
+  esac
+  # Pass precious variables to config.status.  It doesn't matter if
+  # we pass some twice (in addition to the command line arguments).
+  if test "$ac_new_set" =3D set; then
+    case $ac_new_val in
+    *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+      ac_arg=3D$ac_var=3D`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
+      ac_configure_args=3D"$ac_configure_args '$ac_arg'"
+      ;;
+    *) ac_configure_args=3D"$ac_configure_args $ac_var=3D$ac_new_val"
+       ;;
+    esac
+  fi
+done
+if $ac_cache_corrupted; then
+  { echo "$as_me:913: error: changes in the environment can compromise the=
 build" >&5
+echo "$as_me: error: changes in the environment can compromise the build" =
>&2;}
+  { { echo "$as_me:915: error: run \`make distclean' and/or \`rm $cache_fi=
le' and start over" >&5
+echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and st=
art over" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+ac_ext=3Dc
+ac_cpp=3D'$CPP $CPPFLAGS'
+ac_compile=3D'$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link=3D'$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$=
ac_ext $LIBS >&5'
+ac_compiler_gnu=3D$ac_cv_c_compiler_gnu
+ac_main_return=3Dreturn
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+  *c*,-n*) ECHO_N=3D ECHO_C=3D'
+' ECHO_T=3D'	' ;;
+  *c*,*  ) ECHO_N=3D-n ECHO_C=3D ECHO_T=3D ;;
+  *)      ECHO_N=3D ECHO_C=3D'\c' ECHO_T=3D ;;
+esac
+echo "#! $SHELL" >conftest.sh
+echo  "exit 0"   >>conftest.sh
+chmod +x conftest.sh
+if { (echo "$as_me:936: PATH=3D\".;.\"; conftest.sh") >&5
+  (PATH=3D".;."; conftest.sh) 2>&5
+  ac_status=3D$?
+  echo "$as_me:939: \$? =3D $ac_status" >&5
+  (exit $ac_status); }; then
+  ac_path_separator=3D';'
+else
+  ac_path_separator=3D:
+fi
+PATH_SEPARATOR=3D"$ac_path_separator"
+rm -f conftest.sh
+
+ac_config_headers=3D"$ac_config_headers config.h:config_h.in"
+
+ac_aux_dir=3D
+for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
+  if test -f $ac_dir/install-sh; then
+    ac_aux_dir=3D$ac_dir
+    ac_install_sh=3D"$ac_aux_dir/install-sh -c"
+    break
+  elif test -f $ac_dir/install.sh; then
+    ac_aux_dir=3D$ac_dir
+    ac_install_sh=3D"$ac_aux_dir/install.sh -c"
+    break
+  elif test -f $ac_dir/shtool; then
+    ac_aux_dir=3D$ac_dir
+    ac_install_sh=3D"$ac_aux_dir/shtool install -c"
+    break
+  fi
+done
+if test -z "$ac_aux_dir"; then
+  { { echo "$as_me:967: error: cannot find install-sh or install.sh in $sr=
cdir $srcdir/.. $srcdir/../.." >&5
+echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcd=
ir/.. $srcdir/../.." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+ac_config_guess=3D"$SHELL $ac_aux_dir/config.guess"
+ac_config_sub=3D"$SHELL $ac_aux_dir/config.sub"
+ac_configure=3D"$SHELL $ac_aux_dir/configure" # This should be Cygnus conf=
igure.
+
+# Make sure we can run config.sub.
+$ac_config_sub sun4 >/dev/null 2>&1 ||
+  { { echo "$as_me:977: error: cannot run $ac_config_sub" >&5
+echo "$as_me: error: cannot run $ac_config_sub" >&2;}
+   { (exit 1); exit 1; }; }
+
+echo "$as_me:981: checking build system type" >&5
+echo $ECHO_N "checking build system type... $ECHO_C" >&6
+if test "${ac_cv_build+set}" =3D set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_build_alias=3D$build_alias
+test -z "$ac_cv_build_alias" &&
+  ac_cv_build_alias=3D`$ac_config_guess`
+test -z "$ac_cv_build_alias" &&
+  { { echo "$as_me:990: error: cannot guess build type; you must specify o=
ne" >&5
+echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
+   { (exit 1); exit 1; }; }
+ac_cv_build=3D`$ac_config_sub $ac_cv_build_alias` ||
+  { { echo "$as_me:994: error: $ac_config_sub $ac_cv_build_alias failed." =
>&5
+echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
+   { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:999: result: $ac_cv_build" >&5
+echo "${ECHO_T}$ac_cv_build" >&6
+build=3D$ac_cv_build
+build_cpu=3D`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+build_vendor=3D`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2=
/'`
+build_os=3D`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+echo "$as_me:1006: checking host system type" >&5
+echo $ECHO_N "checking host system type... $ECHO_C" >&6
+if test "${ac_cv_host+set}" =3D set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_host_alias=3D$host_alias
+test -z "$ac_cv_host_alias" &&
+  ac_cv_host_alias=3D$ac_cv_build_alias
+ac_cv_host=3D`$ac_config_sub $ac_cv_host_alias` ||
+  { { echo "$as_me:1015: error: $ac_config_sub $ac_cv_host_alias failed" >=
&5
+echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:1020: result: $ac_cv_host" >&5
+echo "${ECHO_T}$ac_cv_host" >&6
+host=3D$ac_cv_host
+host_cpu=3D`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=3D`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=3D`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
+	echo "$as_me:1028: checking target system type" >&5
+echo $ECHO_N "checking target system type... $ECHO_C" >&6
+if test "${ac_cv_target+set}" =3D set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_target_alias=3D$target_alias
+test "x$ac_cv_target_alias" =3D "x" &&
+  ac_cv_target_alias=3D$ac_cv_host_alias
+ac_cv_target=3D`$ac_config_sub $ac_cv_target_alias` ||
+  { { echo "$as_me:1037: error: $ac_config_sub $ac_cv_target_alias failed"=
 >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:1042: result: $ac_cv_target" >&5
+echo "${ECHO_T}$ac_cv_target" >&6
+target=3D$ac_cv_target
+target_cpu=3D`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/=
'`
+target_vendor=3D`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/=
\2/'`
+target_os=3D`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+# The aliases save the names the user supplied, while $host etc.
+# will get canonicalized.
+test -n "$target_alias" &&
+  test "$program_prefix$program_suffix$program_transform_name" =3D \
+    NONENONEs,x,x, &&
+  program_prefix=3D${target_alias}-
+	system_name=3D"$host_os"
+else
+	system_name=3D"`(uname -s -r) 2>/dev/null`"
+	if test -z "$system_name" ; then
+		system_name=3D"`(hostname) 2>/dev/null`"
+	fi
+fi
+test -n "$system_name" && cat >>confdefs.h <<EOF
+#define SYSTEM_NAME "$system_name"
+EOF
+
+if test "${cf_cv_system_name+set}" =3D set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cf_cv_system_name=3D"$system_name"
+fi
+
+test -z "$system_name" && system_name=3D"$cf_cv_system_name"
+test -n "$cf_cv_system_name" && echo "$as_me:1073: result: Configuring for=
 $cf_cv_system_name" >&5
+echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
+
+if test ".$system_name" !=3D ".$cf_cv_system_name" ; then
+	echo "$as_me:1077: result: Cached system name ($system_name) does not agr=
ee with actual ($cf_cv_system_name)" >&5
+echo "${ECHO_T}Cached system name ($system_name) does not agree with actua=
l ($cf_cv_system_name)" >&6
+	{ { echo "$as_me:1079: error: \"Please remove config.cache and try again.=
\"" >&5
+echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+test "$program_prefix" !=3D NONE &&
+  program_transform_name=3D"s,^,$program_prefix,;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" !=3D NONE &&
+  program_transform_name=3D"s,\$,$program_suffix,;$program_transform_name"
+# Double any \ or $.  echo might interpret backslashes.
+# By default was `s,x,x', remove it if useless.
+cat <<\_ACEOF >conftest.sed
+s/[\\$]/&&/g;s/;s,x,x,$//
+_ACEOF
+program_transform_name=3D`echo $program_transform_name | sed -f conftest.s=
ed`
+rm conftest.sed
+
+ac_ext=3Dc
+ac_cpp=3D'$CPP $CPPFLAGS'
+ac_compile=3D'$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link=3D'$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$=
ac_ext $LIBS >&5'
+ac_compiler_gnu=3D$ac_cv_c_compiler_gnu
+ac_main_return=3Dreturn
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a progr=
am name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=3D$2
+echo "$as_me:1106: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" =3D set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC=3D"$CC" # Let the user override the test.
+else
+  ac_save_IFS=3D$IFS; IFS=3D$ac_path_separator
+ac_dummy=3D"$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=3D$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=3D.
+  $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_CC=3D"${ac_tool_prefix}gcc"
+echo "$as_me:1121: found $ac_dir/$ac_word" >&5
+break
+done
+
+fi
+fi
+CC=3D$ac_cv_prog_CC
+if test -n "$CC"; then
+  echo "$as_me:1129: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+  echo "$as_me:1132: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=3D$CC
+  # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=3D$2
+echo "$as_me:1141: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" =3D set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC=3D"$ac_ct_CC" # Let the user override the test.
+else
+  ac_save_IFS=3D$IFS; IFS=3D$ac_path_separator
+ac_dummy=3D"$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=3D$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=3D.
+  $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_ac_ct_CC=3D"gcc"
+echo "$as_me:1156: found $ac_dir/$ac_word" >&5
+break
+done
+
+fi
+fi
+ac_ct_CC=3D$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  echo "$as_me:1164: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+  echo "$as_me:1167: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  CC=3D$ac_ct_CC
+else
+  CC=3D"$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}cc", so it can be a progra=
m name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=3D$2
+echo "$as_me:1180: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" =3D set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC=3D"$CC" # Let the user override the test.
+else
+  ac_save_IFS=3D$IFS; IFS=3D$ac_path_separator
+ac_dummy=3D"$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=3D$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=3D.
+  $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_CC=3D"${ac_tool_prefix}cc"
+echo "$as_me:1195: found $ac_dir/$ac_word" >&5
+break
+done
+
+fi
+fi
+CC=3D$ac_cv_prog_CC
+if test -n "$CC"; then
+  echo "$as_me:1203: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+  echo "$as_me:1206: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=3D$CC
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=3D$2
+echo "$as_me:1215: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" =3D set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC=3D"$ac_ct_CC" # Let the user override the test.
+else
+  ac_save_IFS=3D$IFS; IFS=3D$ac_path_separator
+ac_dummy=3D"$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=3D$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=3D.
+  $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_ac_ct_CC=3D"cc"
+echo "$as_me:1230: found $ac_dir/$ac_word" >&5
+break
+done
+
+fi
+fi
+ac_ct_CC=3D$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  echo "$as_me:1238: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+  echo "$as_me:1241: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  CC=3D$ac_ct_CC
+else
+  CC=3D"$ac_cv_prog_CC"
+fi
+
+fi
+if test -z "$CC"; then
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=3D$2
+echo "$as_me:1254: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" =3D set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC=3D"$CC" # Let the user override the test.
+else
+  ac_prog_rejected=3Dno
+  ac_save_IFS=3D$IFS; IFS=3D$ac_path_separator
+ac_dummy=3D"$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=3D$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=3D.
+  $as_executable_p "$ac_dir/$ac_word" || continue
+if test "$ac_dir/$ac_word" =3D "/usr/ucb/cc"; then
+  ac_prog_rejected=3Dyes
+  continue
+fi
+ac_cv_prog_CC=3D"cc"
+echo "$as_me:1274: found $ac_dir/$ac_word" >&5
+break
+done
+
+if test $ac_prog_rejected =3D yes; then
+  # We found a bogon in the path, so make sure we never use it.
+  set dummy $ac_cv_prog_CC
+  shift
+  if test $# !=3D 0; then
+    # We chose a different compiler from the bogus one.
+    # However, it has the same basename, so the bogon will be chosen
+    # first if we set CC to just the basename; use the full file name.
+    shift
+    set dummy "$ac_dir/$ac_word" ${1+"[email protected]"}
+    shift
+    ac_cv_prog_CC=3D"[email protected]"
+  fi
+fi
+fi
+fi
+CC=3D$ac_cv_prog_CC
+if test -n "$CC"; then
+  echo "$as_me:1296: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+  echo "$as_me:1299: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a =
program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=3D$2
+echo "$as_me:1310: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" =3D set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC=3D"$CC" # Let the user override the test.
+else
+  ac_save_IFS=3D$IFS; IFS=3D$ac_path_separator
+ac_dummy=3D"$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=3D$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=3D.
+  $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_CC=3D"$ac_tool_prefix$ac_prog"
+echo "$as_me:1325: found $ac_dir/$ac_word" >&5
+break
+done
+
+fi
+fi
+CC=3D$ac_cv_prog_CC
+if test -n "$CC"; then
+  echo "$as_me:1333: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+  echo "$as_me:1336: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=3D$CC
+  for ac_prog in cl
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with=
 args.
+set dummy $ac_prog; ac_word=3D$2
+echo "$as_me:1349: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" =3D set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC=3D"$ac_ct_CC" # Let the user override the test.
+else
+  ac_save_IFS=3D$IFS; IFS=3D$ac_path_separator
+ac_dummy=3D"$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=3D$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=3D.
+  $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_ac_ct_CC=3D"$ac_prog"
+echo "$as_me:1364: found $ac_dir/$ac_word" >&5
+break
+done
+
+fi
+fi
+ac_ct_CC=3D$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  echo "$as_me:1372: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+  echo "$as_me:1375: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  test -n "$ac_ct_CC" && break
+done
+
+  CC=3D$ac_ct_CC
+fi
+
+fi
+
+test -z "$CC" && { { echo "$as_me:1387: error: no acceptable cc found in \=
$PATH" >&5
+echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
+   { (exit 1); exit 1; }; }
+
+# Provide some information about the compiler.
+echo "$as_me:1392:" \
+     "checking for C compiler version" >&5
+ac_compiler=3D`set X $ac_compile; echo $2`
+{ (eval echo "$as_me:1395: \"$ac_compiler --version </dev/null >&5\"") >&5
+  (eval $ac_compiler --version </dev/null >&5) 2>&5
+  ac_status=3D$?
+  echo "$as_me:1398: \$? =3D $ac_status" >&5
+  (exit $ac_status); }
+{ (eval echo "$as_me:1400: \"$ac_compiler -v </dev/null >&5\"") >&5
+  (eval $ac_compiler -v </dev/null >&5) 2>&5
+  ac_status=3D$?
+  echo "$as_me:1403: \$? =3D $ac_status" >&5
+  (exit $ac_status); }
+{ (eval echo "$as_me:1405: \"$ac_compiler -V </dev/null >&5\"") >&5
+  (eval $ac_compiler -V </dev/null >&5) 2>&5
+  ac_status=3D$?
+  echo "$as_me:1408: \$? =3D $ac_status" >&5
+  (exit $ac_status); }
+
+cat >conftest.$ac_ext <<_ACEOF
+#line 1412 "configure"
+#include "confdefs.h"
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files_save=3D$ac_clean_files
+ac_clean_files=3D"$ac_clean_files a.out a.exe"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+echo "$as_me:1428: checking for C compiler default output" >&5
+echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
+ac_link_default=3D`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+if { (eval echo "$as_me:1431: \"$ac_link_default\"") >&5
+  (eval $ac_link_default) 2>&5
+  ac_status=3D$?
+  echo "$as_me:1434: \$? =3D $ac_status" >&5
+  (exit $ac_status); }; then
+  # Find the output, starting from the most likely.  This scheme is
+# not robust to junk in `.', hence go to wildcards (a.*) only as a last
+# resort.
+for ac_file in `ls a.exe conftest.exe 2>/dev/null;
+                ls a.out conftest 2>/dev/null;
+                ls a.* conftest.* 2>/dev/null`; do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.=
bbg | *.map | *.inf | *.o | *.obj ) ;;
+    a.out ) # We found the default executable, but exeext=3D'' is most
+            # certainly right.
+            break;;
+    *.* ) ac_cv_exeext=3D`expr "$ac_file" : '[^.]*\(\..*\)'`
+          # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
+          export ac_cv_exeext
+          break;;
+    * ) break;;
+  esac
+done
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+{ { echo "$as_me:1457: error: C compiler cannot create executables" >&5
+echo "$as_me: error: C compiler cannot create executables" >&2;}
+   { (exit 77); exit 77; }; }
+fi
+
+ac_exeext=3D$ac_cv_exeext
+echo "$as_me:1463: result: $ac_file" >&5
+echo "${ECHO_T}$ac_file" >&6
+
+# Check the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:1468: checking whether the C compiler works" >&5
+echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
+# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+# If not cross compiling, check that we can run a simple program.
+if test "$cross_compiling" !=3D yes; then
+  if { ac_try=3D'./$ac_file'
+  { (eval echo "$as_me:1474: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=3D$?
+  echo "$as_me:1477: \$? =3D $ac_status" >&5
+  (exit $ac_status); }; }; then
+    cross_compiling=3Dno
+  else
+    if test "$cross_compiling" =3D maybe; then
+	cross_compiling=3Dyes
+    else
+	{ { echo "$as_me:1484: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'." >&5
+echo "$as_me: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'." >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+  fi
+fi
+echo "$as_me:1492: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+rm -f a.out a.exe conftest$ac_cv_exeext
+ac_clean_files=3D$ac_clean_files_save
+# Check the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:1499: checking whether we are cross compiling" >&5
+echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
+echo "$as_me:1501: result: $cross_compiling" >&5
+echo "${ECHO_T}$cross_compiling" >&6
+
+echo "$as_me:1504: checking for executable suffix" >&5
+echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
+if { (eval echo "$as_me:1506: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=3D$?
+  echo "$as_me:1509: \$? =3D $ac_status" >&5
+  (exit $ac_status); }; then
+  # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`=
; do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.=
bbg | *.map | *.inf | *.o | *.obj ) ;;
+    *.* ) ac_cv_exeext=3D`expr "$ac_file" : '[^.]*\(\..*\)'`
+          export ac_cv_exeext
+          break;;
+    * ) break;;
+  esac
+done
+else
+  { { echo "$as_me:1525: error: cannot compute EXEEXT: cannot compile and =
link" >&5
+echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest$ac_cv_exeext
+echo "$as_me:1531: result: $ac_cv_exeext" >&5
+echo "${ECHO_T}$ac_cv_exeext" >&6
+
+rm -f conftest.$ac_ext
+EXEEXT=3D$ac_cv_exeext
+ac_exeext=3D$EXEEXT
+echo "$as_me:1537: checking for object suffix" >&5
+echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
+if test "${ac_cv_objext+set}" =3D set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 1543 "configure"
+#include "confdefs.h"
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { (eval echo "$as_me:1555: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=3D$?
+  echo "$as_me:1558: \$? =3D $ac_status" >&5
+  (exit $ac_status); }; then
+  for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`=
; do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *=
.inf ) ;;
+    *) ac_cv_objext=3D`expr "$ac_file" : '.*\.\(.*\)'`
+       break;;
+  esac
+done
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+{ { echo "$as_me:1570: error: cannot compute OBJEXT: cannot compile" >&5
+echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+echo "$as_me:1577: result: $ac_cv_objext" >&5
+echo "${ECHO_T}$ac_cv_objext" >&6
+OBJEXT=3D$ac_cv_objext
+ac_objext=3D$OBJEXT
+echo "$as_me:1581: checking whether we are using the GNU C compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C"=
 >&6
+if test "${ac_cv_c_compiler_gnu+set}" =3D set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 1587 "configure"
+#include "confdefs.h"
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:1602: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=3D$?
+  echo "$as_me:1605: \$? =3D $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try=3D'test -s conftest.$ac_objext'
+  { (eval echo "$as_me:1608: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=3D$?
+  echo "$as_me:1611: \$? =3D $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_compiler_gnu=3Dyes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_compiler_gnu=3Dno
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=3D$ac_compiler_gnu
+
+fi
+echo "$as_me:1623: result: $ac_cv_c_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
+GCC=3D`test $ac_compiler_gnu =3D yes && echo yes`
+ac_test_CFLAGS=3D${CFLAGS+set}
+ac_save_CFLAGS=3D$CFLAGS
+CFLAGS=3D"-g"
+echo "$as_me:1629: checking whether $CC accepts -g" >&5
+echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_g+set}" =3D set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 1635 "configure"
+#include "confdefs.h"
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:1647: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=3D$?
+  echo "$as_me:1650: \$? =3D $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try=3D'test -s conftest.$ac_objext'
+  { (eval echo "$as_me:1653: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=3D$?
+  echo "$as_me:1656: \$? =3D $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_prog_cc_g=3Dyes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_prog_cc_g=3Dno
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:1666: result: $ac_cv_prog_cc_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
+if test "$ac_test_CFLAGS" =3D set; then
+  CFLAGS=3D$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g =3D yes; then
+  if test "$GCC" =3D yes; then
+    CFLAGS=3D"-g -O2"
+  else
+    CFLAGS=3D"-g"
+  fi
+else
+  if test "$GCC" =3D yes; then
+    CFLAGS=3D"-O2"
+  else
+    CFLAGS=3D
+  fi
+fi
+# Some people use a C++ compiler to compile C.  Since we use `exit',
+# in C++ we need to declare it.  In case someone uses the same compiler
+# for both compiling C and C++ we need to have the C++ compiler decide
+# the declaration of exit, since it's the most demanding environment.
+cat >conftest.$ac_ext <<_ACEOF
+#ifndef __cplusplus
+  choke me
+#endif
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:1693: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=3D$?
+  echo "$as_me:1696: \$? =3D $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try=3D'test -s conftest.$ac_objext'
+  { (eval echo "$as_me:1699: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=3D$?
+  echo "$as_me:1702: \$? =3D $ac_status" >&5
+  (exit $ac_status); }; }; then
+  for ac_declaration in \
+   ''\
+   '#include <stdlib.h>' \
+   'extern "C" void std::exit (int) throw (); using std::exit;' \
+   'extern "C" void std::exit (int); using std::exit;' \
+   'extern "C" void exit (int) throw ();' \
+   'extern "C" void exit (int);' \
+   'void exit (int);'
+do
+  cat >conftest.$ac_ext <<_ACEOF
+#line 1714 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+$ac_declaration
+int
+main ()
+{
+exit (42);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:1727: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=3D$?
+  echo "$as_me:1730: \$? =3D $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try=3D'test -s conftest.$ac_objext'
+  { (eval echo "$as_me:1733: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=3D$?
+  echo "$as_me:1736: \$? =3D $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+continue
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+  cat >conftest.$ac_ext <<_ACEOF
+#line 1746 "configure"
+#include "confdefs.h"
+$ac_declaration
+int
+main ()
+{
+exit (42);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:1758: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=3D$?
+  echo "$as_me:1761: \$? =3D $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try=3D'test -s conftest.$ac_objext'
+  { (eval echo "$as_me:1764: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=3D$?
+  echo "$as_me:1767: \$? =3D $ac_status" >&5
+  (exit $ac_status); }; }; then
+  break
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+done
+rm -rf conftest*
+if test -n "$ac_declaration"; then
+  echo '#ifdef __cplusplus' >>confdefs.h
+  echo $ac_declaration      >>confdefs.h
+  echo '#endif'             >>confdefs.h
+fi
+
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ac_ext=3Dc
+ac_cpp=3D'$CPP $CPPFLAGS'
+ac_compile=3D'$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link=3D'$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$=
ac_ext $LIBS >&5'
+ac_compiler_gnu=3D$ac_cv_c_compiler_gnu
+ac_main_return=3Dreturn
+
+echo "$as_me:1795: checking for $CC option to accept ANSI C" >&5
+echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_stdc+set}" =3D set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_prog_cc_stdc=3Dno
+ac_save_CC=3D$CC
+cat >conftest.$ac_ext <<_ACEOF
+#line 1803 "configure"
+#include "confdefs.h"
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+     char **p;
+     int i;
+{
+  return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+  char *s;
+  va_list v;
+  va_start (v,p);
+  s =3D g (p, va_arg (v,int));
+  va_end (v);
+  return s;
+}
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), =
int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) !=3D argv[0]  ||  f (e, argv, 1) !=3D argv[1];
+  ;
+  return 0;
+}
+_ACEOF
+# Don't try gcc -ansi; that turns off useful extensions and
+# breaks some systems' header files.
+# AIX			-qlanglvl=3Dansi
+# Ultrix and OSF/1	-std1
+# HP-UX 10.20 and later	-Ae
+# HP-UX older versions	-Aa -D_HPUX_SOURCE
+# SVR4			-Xc -D__EXTENSIONS__
+for ac_arg in "" -qlanglvl=3Dansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__=
EXTENSIONS__"
+do
+  CC=3D"$ac_save_CC $ac_arg"
+  rm -f conftest.$ac_objext
+if { (eval echo "$as_me:1852: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=3D$?
+  echo "$as_me:1855: \$? =3D $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try=3D'test -s conftest.$ac_objext'
+  { (eval echo "$as_me:1858: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=3D$?
+  echo "$as_me:1861: \$? =3D $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_prog_cc_stdc=3D$ac_arg
+break
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext
+done
+rm -f conftest.$ac_ext conftest.$ac_objext
+CC=3D$ac_save_CC
+
+fi
+
+case "x$ac_cv_prog_cc_stdc" in
+  x|xno)
+    echo "$as_me:1878: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6 ;;
+  *)
+    echo "$as_me:1881: result: $ac_cv_prog_cc_stdc" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
+    CC=3D"$CC $ac_cv_prog_cc_stdc" ;;
+esac
+
+echo "$as_me:1886: checking for an ANSI C-conforming const" >&5
+echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
+if test "${ac_cv_c_const+set}" =3D set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 1892 "configure"
+#include "confdefs.h"
+
+int
+main ()
+{
+/* FIXME: Include the comments suggested by Paul. */
+#ifndef __cplusplus
+  /* Ultrix mips cc rejects this.  */
+  typedef int charset[2];
+  const charset x;
+  /* SunOS 4.1.1 cc rejects this.  */
+  char const *const *ccp;
+  char **p;
+  /* NEC SVR4.0.2 mips cc rejects this.  */
+  struct point {int x, y;};
+  static struct point const zero =3D {0,0};
+  /* AIX XL C 1.02.0.0 rejects this.
+     It does not let you subtract one const X* pointer from another in
+     an arm of an if-expression whose if-part is not a constant
+     expression */
+  const char *g =3D "string";
+  ccp =3D &g + (g ? g-g : 0);
+  /* HPUX 7.0 cc rejects these. */
+  ++ccp;
+  p =3D (char**) ccp;
+  ccp =3D (char const *const *) p;
+  { /* SCO 3.2v4 cc rejects this.  */
+    char *t;
+    char const *s =3D 0 ? (char *) 0 : (char const *) 0;
+
+    *t++ =3D 0;
+  }
+  { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  =
*/
+    int x[] =3D {25, 17};
+    const int *foo =3D &x[0];
+    ++foo;
+  }
+  { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
+    typedef const int *iptr;
+    iptr p =3D 0;
+    ++p;
+  }
+  { /* AIX XL C 1.02.0.0 rejects this saying
+       "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue.=
 */
+    struct s { int j; const int *ap[3]; };
+    struct s *b; b->j =3D 5;
+  }
+  { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
+    const int foo =3D 10;
+  }
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:1950: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=3D$?
+  echo "$as_me:1953: \$? =3D $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try=3D'test -s conftest.$ac_objext'
+  { (eval echo "$as_me:1956: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=3D$?
+  echo "$as_me:1959: \$? =3D $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_c_const=3Dyes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_c_const=3Dno
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:1969: result: $ac_cv_c_const" >&5
+echo "${ECHO_T}$ac_cv_c_const" >&6
+if test $ac_cv_c_const =3D no; then
+
+cat >>confdefs.h <<\EOF
+#define const
+EOF
+
+fi
+
+echo "$as_me:1979: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
+set dummy ${MAKE-make}; ac_make=3D`echo "$2" | sed 'y,./+-,__p_,'`
+if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" =3D set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.make <<\EOF
+all:
+	@echo 'ac_maketemp=3D"${MAKE}"'
+EOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=3D`
+if test -n "$ac_maketemp"; then
+  eval ac_cv_prog_make_${ac_make}_set=3Dyes
+else
+  eval ac_cv_prog_make_${ac_make}_set=3Dno
+fi
+rm -f conftest.make
+fi
+if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" =3D yes"; then
+  echo "$as_me:1999: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+  SET_MAKE=3D
+else
+  echo "$as_me:2003: result: no" >&5
+echo "${ECHO_T}no" >&6
+  SET_MAKE=3D"MAKE=3D${MAKE-make}"
+fi
+
+# Find a good install program.  We prefer a C program (faster),
+# so one script is as good as another.  But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# ./install, which can be erroneously created by make from ./install.sh.
+echo "$as_me:2020: checking for a BSD compatible install" >&5
+echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" =3D set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+    ac_save_IFS=3D$IFS; IFS=3D$ac_path_separator
+  for ac_dir in $PATH; do
+    IFS=3D$ac_save_IFS
+    # Account for people who put trailing slashes in PATH elements.
+    case $ac_dir/ in
+    / | ./ | .// | /cC/* \
+    | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
+    | /usr/ucb/* ) ;;
+    *)
+      # OSF1 and SCO ODT 3.0 have their own names for install.
+      # Don't use installbsd from OSF since it installs stuff as root
+      # by default.
+      for ac_prog in ginstall scoinst install; do
+        if $as_executable_p "$ac_dir/$ac_prog"; then
+	  if test $ac_prog =3D install &&
+            grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
+	    # AIX install.  It has an incompatible calling convention.
+	    :
+	  elif test $ac_prog =3D install &&
+	    grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
+	    # program-specific install script used by HP pwplus--don't use.
+	    :
+	  else
+	    ac_cv_path_install=3D"$ac_dir/$ac_prog -c"
+	    break 2
+	  fi
+	fi
+      done
+      ;;
+    esac
+  done
+
+fi
+  if test "${ac_cv_path_install+set}" =3D set; then
+    INSTALL=3D$ac_cv_path_install
+  else
+    # As a last resort, use the slow shell script.  We don't cache a
+    # path for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the path is relative.
+    INSTALL=3D$ac_install_sh
+  fi
+fi
+echo "$as_me:2069: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM=3D'${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT=3D'${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA=3D'${INSTALL} -m 644'
+
+echo "$as_me:2080: checking if filesystem supports mixed-case filenames" >=
&5
+echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECH=
O_C" >&6
+if test "${cf_cv_mixedcase+set}" =3D set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+if test "$cross_compiling" =3D yes ; then
+	case $target_alias in #(vi
+	*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-mingw32*|*-uwin*) #(vi
+		cf_cv_mixedcase=3Dno
+		;;
+	*)
+		cf_cv_mixedcase=3Dyes
+		;;
+	esac
+else
+	rm -f conftest CONFTEST
+	echo test >conftest
+	if test -f CONFTEST ; then
+		cf_cv_mixedcase=3Dno
+	else
+		cf_cv_mixedcase=3Dyes
+	fi
+	rm -f conftest CONFTEST
+fi
+
+fi
+echo "$as_me:2107: result: $cf_cv_mixedcase" >&5
+echo "${ECHO_T}$cf_cv_mixedcase" >&6
+test "$cf_cv_mixedcase" =3D yes && cat >>confdefs.h <<\EOF
+#define MIXEDCASE_FILENAMES 1
+EOF
+
+for ac_prog in exctags ctags
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with=
 args.
+set dummy $ac_prog; ac_word=3D$2
+echo "$as_me:2117: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CTAGS+set}" =3D set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CTAGS"; then
+  ac_cv_prog_CTAGS=3D"$CTAGS" # Let the user override the test.
+else
+  ac_save_IFS=3D$IFS; IFS=3D$ac_path_separator
+ac_dummy=3D"$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=3D$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=3D.
+  $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_CTAGS=3D"$ac_prog"
+echo "$as_me:2132: found $ac_dir/$ac_word" >&5
+break
+done
+
+fi
+fi
+CTAGS=3D$ac_cv_prog_CTAGS
+if test -n "$CTAGS"; then
+  echo "$as_me:2140: result: $CTAGS" >&5
+echo "${ECHO_T}$CTAGS" >&6
+else
+  echo "$as_me:2143: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  test -n "$CTAGS" && break
+done
+
+for ac_prog in exetags etags
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with=
 args.
+set dummy $ac_prog; ac_word=3D$2
+echo "$as_me:2154: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ETAGS+set}" =3D set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ETAGS"; then
+  ac_cv_prog_ETAGS=3D"$ETAGS" # Let the user override the test.
+else
+  ac_save_IFS=3D$IFS; IFS=3D$ac_path_separator
+ac_dummy=3D"$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=3D$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=3D.
+  $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_ETAGS=3D"$ac_prog"
+echo "$as_me:2169: found $ac_dir/$ac_word" >&5
+break
+done
+
+fi
+fi
+ETAGS=3D$ac_cv_prog_ETAGS
+if test -n "$ETAGS"; then
+  echo "$as_me:2177: result: $ETAGS" >&5
+echo "${ECHO_T}$ETAGS" >&6
+else
+  echo "$as_me:2180: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  test -n "$ETAGS" && break
+done
+
+# Extract the first word of "${CTAGS:-ctags}", so it can be a program name=
 with args.
+set dummy ${CTAGS:-ctags}; ac_word=3D$2
+echo "$as_me:2189: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" =3D set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$MAKE_LOWER_TAGS"; then
+  ac_cv_prog_MAKE_LOWER_TAGS=3D"$MAKE_LOWER_TAGS" # Let the user override =
the test.
+else
+  ac_save_IFS=3D$IFS; IFS=3D$ac_path_separator
+ac_dummy=3D"$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=3D$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=3D.
+  $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_MAKE_LOWER_TAGS=3D"yes"
+echo "$as_me:2204: found $ac_dir/$ac_word" >&5
+break
+done
+
+  test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS=3D"n=
o"
+fi
+fi
+MAKE_LOWER_TAGS=3D$ac_cv_prog_MAKE_LOWER_TAGS
+if test -n "$MAKE_LOWER_TAGS"; then
+  echo "$as_me:2213: result: $MAKE_LOWER_TAGS" >&5
+echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
+else
+  echo "$as_me:2216: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+if test "$cf_cv_mixedcase" =3D yes ; then
+	# Extract the first word of "${ETAGS:-etags}", so it can be a program nam=
e with args.
+set dummy ${ETAGS:-etags}; ac_word=3D$2
+echo "$as_me:2223: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" =3D set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$MAKE_UPPER_TAGS"; then
+  ac_cv_prog_MAKE_UPPER_TAGS=3D"$MAKE_UPPER_TAGS" # Let the user override =
the test.
+else
+  ac_save_IFS=3D$IFS; IFS=3D$ac_path_separator
+ac_dummy=3D"$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=3D$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=3D.
+  $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_MAKE_UPPER_TAGS=3D"yes"
+echo "$as_me:2238: found $ac_dir/$ac_word" >&5
+break
+done
+
+  test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS=3D"n=
o"
+fi
+fi
+MAKE_UPPER_TAGS=3D$ac_cv_prog_MAKE_UPPER_TAGS
+if test -n "$MAKE_UPPER_TAGS"; then
+  echo "$as_me:2247: result: $MAKE_UPPER_TAGS" >&5
+echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
+else
+  echo "$as_me:2250: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+else
+	MAKE_UPPER_TAGS=3Dno
+fi
+
+if test "$MAKE_UPPER_TAGS" =3D yes ; then
+	MAKE_UPPER_TAGS=3D
+else
+	MAKE_UPPER_TAGS=3D"#"
+fi
+
+if test "$MAKE_LOWER_TAGS" =3D yes ; then
+	MAKE_LOWER_TAGS=3D
+else
+	MAKE_LOWER_TAGS=3D"#"
+fi
+
+for ac_prog in tdlint lint alint splint lclint
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with=
 args.
+set dummy $ac_prog; ac_word=3D$2
+echo "$as_me:2274: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_LINT+set}" =3D set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$LINT"; then
+  ac_cv_prog_LINT=3D"$LINT" # Let the user override the test.
+else
+  ac_save_IFS=3D$IFS; IFS=3D$ac_path_separator
+ac_dummy=3D"$PATH"
+for ac_dir in $ac_dummy; do
+  IFS=3D$ac_save_IFS
+  test -z "$ac_dir" && ac_dir=3D.
+  $as_executable_p "$ac_dir/$ac_word" || continue
+ac_cv_prog_LINT=3D"$ac_prog"
+echo "$as_me:2289: found $ac_dir/$ac_word" >&5
+break
+done
+
+fi
+fi
+LINT=3D$ac_cv_prog_LINT
+if test -n "$LINT"; then
+  echo "$as_me:2297: result: $LINT" >&5
+echo "${ECHO_T}$LINT" >&6
+else
+  echo "$as_me:2300: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  test -n "$LINT" && break
+done
+
+# This should have been defined by AC_PROG_CC
+: ${CC:=3Dcc}
+
+# 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 CF=
LAGS/CPPFLAGS options" >&2;}
+	# humor him...
+	cf_flags=3D`echo "$CC" | sed -e 's/^[^ 	]*[ 	]//'`
+	CC=3D`echo "$CC" | sed -e 's/[ 	].*//'`
+
+cf_fix_cppflags=3Dno
+cf_new_cflags=3D
+cf_new_cppflags=3D
+cf_new_extra_cppflags=3D
+
+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=3D`echo ${cf_add_cflags} |sed -e 's/^-D[^=3D]*=3D'\''\"[^=
"]*//'`
+
+			test "${cf_add_cflags}" !=3D "${cf_tst_cflags}" \
+				&& test -z "${cf_tst_cflags}" \
+				&& cf_fix_cppflags=3Dyes
+
+			if test $cf_fix_cppflags =3D yes ; then
+				cf_new_extra_cppflags=3D"$cf_new_extra_cppflags $cf_add_cflags"
+				continue
+			elif test "${cf_tst_cflags}" =3D "\"'" ; then
+				cf_new_extra_cppflags=3D"$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=3D`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=
=3D.*//'`
+
+CPPFLAGS=3D`echo "$CPPFLAGS" | \
+	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=3D[^ 	]*\)\?[ 	]/ /g' \
+		-e 's/-[UD]'"$cf_tst_cppflags"'\(=3D[^ 	]*\)\?$//g'`
+
+				;;
+			esac
+			cf_new_cppflags=3D"$cf_new_cppflags $cf_add_cflags"
+			;;
+		esac
+		;;
+	*)
+		cf_new_cflags=3D"$cf_new_cflags $cf_add_cflags"
+		;;
+	esac
+	;;
+yes)
+	cf_new_extra_cppflags=3D"$cf_new_extra_cppflags $cf_add_cflags"
+
+	cf_tst_cflags=3D`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+
+	test "${cf_add_cflags}" !=3D "${cf_tst_cflags}" \
+		&& test -z "${cf_tst_cflags}" \
+		&& cf_fix_cppflags=3Dno
+	;;
+esac
+done
+
+if test -n "$cf_new_cflags" ; then
+
+	CFLAGS=3D"$CFLAGS $cf_new_cflags"
+fi
+
+if test -n "$cf_new_cppflags" ; then
+
+	CPPFLAGS=3D"$CPPFLAGS $cf_new_cppflags"
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+	EXTRA_CPPFLAGS=3D"$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}" =3D set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+cf_cv_ansi_cc=3Dno
+cf_save_CFLAGS=3D"$CFLAGS"
+cf_save_CPPFLAGS=3D"$CPPFLAGS"
+# Don't try gcc -ansi; that turns off useful extensions and
+# breaks some systems' header files.
+# AIX			-qlanglvl=3Dansi
+# Ultrix and OSF/1	-std1
+# HP-UX			-Aa -D_HPUX_SOURCE
+# SVR4			-Xc
+# UnixWare 1.2		(cannot use -Xc, since ANSI/POSIX clashes)
+for cf_arg in "-DCC_HAS_PROTOS" \
+	"" \
+	-qlanglvl=3Dansi \
+	-std1 \
+	-Ae \
+	"-Aa -D_HPUX_SOURCE" \
+	-Xc
+do
+
+cf_fix_cppflags=3Dno
+cf_new_cflags=3D
+cf_new_cppflags=3D
+cf_new_extra_cppflags=3D
+
+for cf_add_cflags in $cf_arg
+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=3D`echo ${cf_add_cflags} |sed -e 's/^-D[^=3D]*=3D'\''\"[^=
"]*//'`
+
+			test "${cf_add_cflags}" !=3D "${cf_tst_cflags}" \
+				&& test -z "${cf_tst_cflags}" \
+				&& cf_fix_cppflags=3Dyes
+
+			if test $cf_fix_cppflags =3D yes ; then
+				cf_new_extra_cppflags=3D"$cf_new_extra_cppflags $cf_add_cflags"
+				continue
+			elif test "${cf_tst_cflags}" =3D "\"'" ; then
+				cf_new_extra_cppflags=3D"$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=3D`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=
=3D.*//'`
+
+CPPFLAGS=3D`echo "$CPPFLAGS" | \
+	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=3D[^ 	]*\)\?[ 	]/ /g' \
+		-e 's/-[UD]'"$cf_tst_cppflags"'\(=3D[^ 	]*\)\?$//g'`
+
+				;;
+			esac
+			cf_new_cppflags=3D"$cf_new_cppflags $cf_add_cflags"
+			;;
+		esac
+		;;
+	*)
+		cf_new_cflags=3D"$cf_new_cflags $cf_add_cflags"
+		;;
+	esac
+	;;
+yes)
+	cf_new_extra_cppflags=3D"$cf_new_extra_cppflags $cf_add_cflags"
+
+	cf_tst_cflags=3D`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+
+	test "${cf_add_cflags}" !=3D "${cf_tst_cflags}" \
+		&& test -z "${cf_tst_cflags}" \
+		&& cf_fix_cppflags=3Dno
+	;;
+esac
+done
+
+if test -n "$cf_new_cflags" ; then
+
+	CFLAGS=3D"$CFLAGS $cf_new_cflags"
+fi
+
+if test -n "$cf_new_cppflags" ; then
+
+	CPPFLAGS=3D"$CPPFLAGS $cf_new_cppflags"
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+	EXTRA_CPPFLAGS=3D"$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+fi
+
+	cat >conftest.$ac_ext <<_ACEOF
+#line 2514 "configure"
+#include "confdefs.h"
+
+#ifndef CC_HAS_PROTOS
+#if !defined(__STDC__) || (__STDC__ !=3D 1)
+choke me
+#endif
+#endif
+
+int
+main ()
+{
+
+	int test (int i, double x);
+	struct s1 {int (*f) (int a);};
+	struct s2 {int (*f) (double a);};
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:2535: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=3D$?
+  echo "$as_me:2538: \$? =3D $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try=3D'test -s conftest.$ac_objext'
+  { (eval echo "$as_me:2541: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=3D$?
+  echo "$as_me:2544: \$? =3D $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_ansi_cc=3D"$cf_arg"; break
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+done
+CFLAGS=3D"$cf_save_CFLAGS"
+CPPFLAGS=3D"$cf_save_CPPFLAGS"
+
+fi
+echo "$as_me:2557: result: $cf_cv_ansi_cc" >&5
+echo "${ECHO_T}$cf_cv_ansi_cc" >&6
+
+if test "$cf_cv_ansi_cc" !=3D "no"; then
+if test ".$cf_cv_ansi_cc" !=3D ".-DCC_HAS_PROTOS"; then
+
+cf_fix_cppflags=3Dno
+cf_new_cflags=3D
+cf_new_cppflags=3D
+cf_new_extra_cppflags=3D
+
+for cf_add_cflags in $cf_cv_ansi_cc
+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=3D`echo ${cf_add_cflags} |sed -e 's/^-D[^=3D]*=3D'\''\"[^=
"]*//'`
+
+			test "${cf_add_cflags}" !=3D "${cf_tst_cflags}" \
+				&& test -z "${cf_tst_cflags}" \
+				&& cf_fix_cppflags=3Dyes
+
+			if test $cf_fix_cppflags =3D yes ; then
+				cf_new_extra_cppflags=3D"$cf_new_extra_cppflags $cf_add_cflags"
+				continue
+			elif test "${cf_tst_cflags}" =3D "\"'" ; then
+				cf_new_extra_cppflags=3D"$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=3D`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=
=3D.*//'`
+
+CPPFLAGS=3D`echo "$CPPFLAGS" | \
+	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=3D[^ 	]*\)\?[ 	]/ /g' \
+		-e 's/-[UD]'"$cf_tst_cppflags"'\(=3D[^ 	]*\)\?$//g'`
+
+				;;
+			esac
+			cf_new_cppflags=3D"$cf_new_cppflags $cf_add_cflags"
+			;;
+		esac
+		;;
+	*)
+		cf_new_cflags=3D"$cf_new_cflags $cf_add_cflags"
+		;;
+	esac
+	;;
+yes)
+	cf_new_extra_cppflags=3D"$cf_new_extra_cppflags $cf_add_cflags"
+
+	cf_tst_cflags=3D`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+
+	test "${cf_add_cflags}" !=3D "${cf_tst_cflags}" \
+		&& test -z "${cf_tst_cflags}" \
+		&& cf_fix_cppflags=3Dno
+	;;
+esac
+done
+
+if test -n "$cf_new_cflags" ; then
+
+	CFLAGS=3D"$CFLAGS $cf_new_cflags"
+fi
+
+if test -n "$cf_new_cppflags" ; then
+
+	CPPFLAGS=3D"$CPPFLAGS $cf_new_cppflags"
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+	EXTRA_CPPFLAGS=3D"$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+fi
+
+else
+	cat >>confdefs.h <<\EOF
+#define CC_HAS_PROTOS 1
+EOF
+
+fi
+fi
+
+if test "$cf_cv_ansi_cc" =3D "no"; then
+	{ { 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
+	c. use a wrapper such as unproto" >&5
+echo "$as_me: 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
+	c. use a wrapper such as unproto" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+cf_XOPEN_SOURCE=3D500
+cf_POSIX_C_SOURCE=3D199506L
+cf_xopen_source=3D
+
+case $host_os in #(vi
+aix[4-7]*) #(vi
+	cf_xopen_source=3D"-D_ALL_SOURCE"
+	;;
+cygwin) #(vi
+	cf_XOPEN_SOURCE=3D600
+	;;
+darwin[0-8].*) #(vi
+	cf_xopen_source=3D"-D_APPLE_C_SOURCE"
+	;;
+darwin*) #(vi
+	cf_xopen_source=3D"-D_DARWIN_C_SOURCE"
+	cf_XOPEN_SOURCE=3D
+	;;
+freebsd*|dragonfly*) #(vi
+	# 5.x headers associate
+	#	_XOPEN_SOURCE=3D600 with _POSIX_C_SOURCE=3D200112L
+	#	_XOPEN_SOURCE=3D500 with _POSIX_C_SOURCE=3D199506L
+	cf_POSIX_C_SOURCE=3D200112L
+	cf_XOPEN_SOURCE=3D600
+	cf_xopen_source=3D"-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=3D$cf_P=
OSIX_C_SOURCE -D_XOPEN_SOURCE=3D$cf_XOPEN_SOURCE"
+	;;
+hpux11*) #(vi
+	cf_xopen_source=3D"-D_HPUX_SOURCE -D_XOPEN_SOURCE=3D500"
+	;;
+hpux*) #(vi
+	cf_xopen_source=3D"-D_HPUX_SOURCE"
+	;;
+irix[56].*) #(vi
+	cf_xopen_source=3D"-D_SGI_SOURCE"
+	cf_XOPEN_SOURCE=3D
+	;;
+linux*|gnu*|mint*|k*bsd*-gnu) #(vi
+
+echo "$as_me:2701: 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}" =3D set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+cat >conftest.$ac_ext <<_ACEOF
+#line 2708 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+int
+main ()
+{
+
+#ifndef _XOPEN_SOURCE
+make an error
+#endif
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:2723: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=3D$?
+  echo "$as_me:2726: \$? =3D $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try=3D'test -s conftest.$ac_objext'
+  { (eval echo "$as_me:2729: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=3D$?
+  echo "$as_me:2732: \$? =3D $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_gnu_source=3Dno
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_save=3D"$CPPFLAGS"
+	 CPPFLAGS=3D"$CPPFLAGS -D_GNU_SOURCE"
+	 cat >conftest.$ac_ext <<_ACEOF
+#line 2741 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+int
+main ()
+{
+
+#ifdef _XOPEN_SOURCE
+make an error
+#endif
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:2756: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=3D$?
+  echo "$as_me:2759: \$? =3D $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try=3D'test -s conftest.$ac_objext'
+  { (eval echo "$as_me:2762: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=3D$?
+  echo "$as_me:2765: \$? =3D $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_gnu_source=3Dno
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_gnu_source=3Dyes
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+	CPPFLAGS=3D"$cf_save"
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+fi
+echo "$as_me:2780: result: $cf_cv_gnu_source" >&5
+echo "${ECHO_T}$cf_cv_gnu_source" >&6
+test "$cf_cv_gnu_source" =3D yes && CPPFLAGS=3D"$CPPFLAGS -D_GNU_SOURCE"
+
+	;;
+mirbsd*) #(vi
+	# setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other =
headers which use u_int / u_short types
+	cf_XOPEN_SOURCE=3D
+
+cf_POSIX_C_SOURCE=3D$cf_POSIX_C_SOURCE
+
+cf_save_CFLAGS=3D"$CFLAGS"
+cf_save_CPPFLAGS=3D"$CPPFLAGS"
+
+cf_trim_CFLAGS=3D`echo "$cf_save_CFLAGS" | \
+	sed	-e 's/-[UD]'"_POSIX_C_SOURCE"'\(=3D[^ 	]*\)\?[ 	]/ /g' \
+		-e 's/-[UD]'"_POSIX_C_SOURCE"'\(=3D[^ 	]*\)\?$//g'`
+
+cf_trim_CPPFLAGS=3D`echo "$cf_save_CPPFLAGS" | \
+	sed	-e 's/-[UD]'"_POSIX_C_SOURCE"'\(=3D[^ 	]*\)\?[ 	]/ /g' \
+		-e 's/-[UD]'"_POSIX_C_SOURCE"'\(=3D[^ 	]*\)\?$//g'`
+
+echo "$as_me:2802: 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}" =3D set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+echo "${as_me:-configure}:2808: testing if the symbol is already defined g=
o no further ..." 1>&5
+
+	cat >conftest.$ac_ext <<_ACEOF
+#line 2811 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+int
+main ()
+{
+
+#ifndef _POSIX_C_SOURCE
+make an error
+#endif
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:2826: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=3D$?
+  echo "$as_me:2829: \$? =3D $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try=3D'test -s conftest.$ac_objext'
+  { (eval echo "$as_me:2832: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=3D$?
+  echo "$as_me:2835: \$? =3D $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_posix_c_source=3Dno
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_want_posix_source=3Dno
+	 case .$cf_POSIX_C_SOURCE in #(vi
+	 .[12]??*) #(vi
+		cf_cv_posix_c_source=3D"-D_POSIX_C_SOURCE=3D$cf_POSIX_C_SOURCE"
+		;;
+	 .2) #(vi
+		cf_cv_posix_c_source=3D"-D_POSIX_C_SOURCE=3D$cf_POSIX_C_SOURCE"
+		cf_want_posix_source=3Dyes
+		;;
+	 .*)
+		cf_want_posix_source=3Dyes
+		;;
+	 esac
+	 if test "$cf_want_posix_source" =3D yes ; then
+		cat >conftest.$ac_ext <<_ACEOF
+#line 2856 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+int
+main ()
+{
+
+#ifdef _POSIX_SOURCE
+make an error
+#endif
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:2871: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=3D$?
+  echo "$as_me:2874: \$? =3D $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try=3D'test -s conftest.$ac_objext'
+  { (eval echo "$as_me:2877: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=3D$?
+  echo "$as_me:2880: \$? =3D $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_posix_c_source=3D"$cf_cv_posix_c_source -D_POSIX_SOURCE"
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+	 fi
+
+echo "${as_me:-configure}:2891: testing ifdef from value $cf_POSIX_C_SOURC=
E ..." 1>&5
+
+	 CFLAGS=3D"$cf_trim_CFLAGS"
+	 CPPFLAGS=3D"$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
+
+echo "${as_me:-configure}:2896: testing if the second compile does not lea=
ve our definition intact error ..." 1>&5
+
+	 cat >conftest.$ac_ext <<_ACEOF
+#line 2899 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+int
+main ()
+{
+
+#ifndef _POSIX_C_SOURCE
+make an error
+#endif
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:2914: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=3D$?
+  echo "$as_me:2917: \$? =3D $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try=3D'test -s conftest.$ac_objext'
+  { (eval echo "$as_me:2920: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=3D$?
+  echo "$as_me:2923: \$? =3D $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_posix_c_source=3Dno
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+	 CFLAGS=3D"$cf_save_CFLAGS"
+	 CPPFLAGS=3D"$cf_save_CPPFLAGS"
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+fi
+echo "$as_me:2939: result: $cf_cv_posix_c_source" >&5
+echo "${ECHO_T}$cf_cv_posix_c_source" >&6
+
+if test "$cf_cv_posix_c_source" !=3D no ; then
+	CFLAGS=3D"$cf_trim_CFLAGS"
+	CPPFLAGS=3D"$cf_trim_CPPFLAGS"
+
+cf_fix_cppflags=3Dno
+cf_new_cflags=3D
+cf_new_cppflags=3D
+cf_new_extra_cppflags=3D
+
+for cf_add_cflags in $cf_cv_posix_c_source
+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=3D`echo ${cf_add_cflags} |sed -e 's/^-D[^=3D]*=3D'\''\"[^=
"]*//'`
+
+			test "${cf_add_cflags}" !=3D "${cf_tst_cflags}" \
+				&& test -z "${cf_tst_cflags}" \
+				&& cf_fix_cppflags=3Dyes
+
+			if test $cf_fix_cppflags =3D yes ; then
+				cf_new_extra_cppflags=3D"$cf_new_extra_cppflags $cf_add_cflags"
+				continue
+			elif test "${cf_tst_cflags}" =3D "\"'" ; then
+				cf_new_extra_cppflags=3D"$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=3D`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=
=3D.*//'`
+
+CPPFLAGS=3D`echo "$CPPFLAGS" | \
+	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=3D[^ 	]*\)\?[ 	]/ /g' \
+		-e 's/-[UD]'"$cf_tst_cppflags"'\(=3D[^ 	]*\)\?$//g'`
+
+				;;
+			esac
+			cf_new_cppflags=3D"$cf_new_cppflags $cf_add_cflags"
+			;;
+		esac
+		;;
+	*)
+		cf_new_cflags=3D"$cf_new_cflags $cf_add_cflags"
+		;;
+	esac
+	;;
+yes)
+	cf_new_extra_cppflags=3D"$cf_new_extra_cppflags $cf_add_cflags"
+
+	cf_tst_cflags=3D`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+
+	test "${cf_add_cflags}" !=3D "${cf_tst_cflags}" \
+		&& test -z "${cf_tst_cflags}" \
+		&& cf_fix_cppflags=3Dno
+	;;
+esac
+done
+
+if test -n "$cf_new_cflags" ; then
+
+	CFLAGS=3D"$CFLAGS $cf_new_cflags"
+fi
+
+if test -n "$cf_new_cppflags" ; then
+
+	CPPFLAGS=3D"$CPPFLAGS $cf_new_cppflags"
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+	EXTRA_CPPFLAGS=3D"$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+fi
+
+fi
+
+	;;
+netbsd*) #(vi
+	cf_xopen_source=3D"-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 =
for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
+	;;
+openbsd[4-9]*) #(vi
+	# setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, n=
eeded for ncursesw
+	cf_xopen_source=3D"-D_BSD_SOURCE"
+	cf_XOPEN_SOURCE=3D600
+	;;
+openbsd*) #(vi
+	# setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for nc=
ursesw
+	;;
+osf[45]*) #(vi
+	cf_xopen_source=3D"-D_OSF_SOURCE"
+	;;
+nto-qnx*) #(vi
+	cf_xopen_source=3D"-D_QNX_SOURCE"
+	;;
+sco*) #(vi
+	# setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
+	;;
+solaris2.*) #(vi
+	cf_xopen_source=3D"-D__EXTENSIONS__"
+	;;
+*)
+
+echo "$as_me:3052: 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}" =3D set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+	cat >conftest.$ac_ext <<_ACEOF
+#line 3059 "configure"
+#include "confdefs.h"
+
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+
+int
+main ()
+{
+
+#ifndef _XOPEN_SOURCE
+make an error
+#endif
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:3078: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=3D$?
+  echo "$as_me:3081: \$? =3D $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try=3D'test -s conftest.$ac_objext'
+  { (eval echo "$as_me:3084: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=3D$?
+  echo "$as_me:3087: \$? =3D $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_xopen_source=3Dno
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_save=3D"$CPPFLAGS"
+	 CPPFLAGS=3D"$CPPFLAGS -D_XOPEN_SOURCE=3D$cf_XOPEN_SOURCE"
+	 cat >conftest.$ac_ext <<_ACEOF
+#line 3096 "configure"
+#include "confdefs.h"
+
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+
+int
+main ()
+{
+
+#ifdef _XOPEN_SOURCE
+make an error
+#endif
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:3115: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=3D$?
+  echo "$as_me:3118: \$? =3D $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try=3D'test -s conftest.$ac_objext'
+  { (eval echo "$as_me:3121: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=3D$?
+  echo "$as_me:3124: \$? =3D $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_xopen_source=3Dno
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_xopen_source=3D$cf_XOPEN_SOURCE
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+	CPPFLAGS=3D"$cf_save"
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+fi
+echo "$as_me:3139: result: $cf_cv_xopen_source" >&5
+echo "${ECHO_T}$cf_cv_xopen_source" >&6
+
+if test "$cf_cv_xopen_source" !=3D no ; then
+
+CFLAGS=3D`echo "$CFLAGS" | \
+	sed	-e 's/-[UD]'"_XOPEN_SOURCE"'\(=3D[^ 	]*\)\?[ 	]/ /g' \
+		-e 's/-[UD]'"_XOPEN_SOURCE"'\(=3D[^ 	]*\)\?$//g'`
+
+CPPFLAGS=3D`echo "$CPPFLAGS" | \
+	sed	-e 's/-[UD]'"_XOPEN_SOURCE"'\(=3D[^ 	]*\)\?[ 	]/ /g' \
+		-e 's/-[UD]'"_XOPEN_SOURCE"'\(=3D[^ 	]*\)\?$//g'`
+
+	cf_temp_xopen_source=3D"-D_XOPEN_SOURCE=3D$cf_cv_xopen_source"
+
+cf_fix_cppflags=3Dno
+cf_new_cflags=3D
+cf_new_cppflags=3D
+cf_new_extra_cppflags=3D
+
+for cf_add_cflags in $cf_temp_xopen_source
+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=3D`echo ${cf_add_cflags} |sed -e 's/^-D[^=3D]*=3D'\''\"[^=
"]*//'`
+
+			test "${cf_add_cflags}" !=3D "${cf_tst_cflags}" \
+				&& test -z "${cf_tst_cflags}" \
+				&& cf_fix_cppflags=3Dyes
+
+			if test $cf_fix_cppflags =3D yes ; then
+				cf_new_extra_cppflags=3D"$cf_new_extra_cppflags $cf_add_cflags"
+				continue
+			elif test "${cf_tst_cflags}" =3D "\"'" ; then
+				cf_new_extra_cppflags=3D"$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=3D`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=
=3D.*//'`
+
+CPPFLAGS=3D`echo "$CPPFLAGS" | \
+	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=3D[^ 	]*\)\?[ 	]/ /g' \
+		-e 's/-[UD]'"$cf_tst_cppflags"'\(=3D[^ 	]*\)\?$//g'`
+
+				;;
+			esac
+			cf_new_cppflags=3D"$cf_new_cppflags $cf_add_cflags"
+			;;
+		esac
+		;;
+	*)
+		cf_new_cflags=3D"$cf_new_cflags $cf_add_cflags"
+		;;
+	esac
+	;;
+yes)
+	cf_new_extra_cppflags=3D"$cf_new_extra_cppflags $cf_add_cflags"
+
+	cf_tst_cflags=3D`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+
+	test "${cf_add_cflags}" !=3D "${cf_tst_cflags}" \
+		&& test -z "${cf_tst_cflags}" \
+		&& cf_fix_cppflags=3Dno
+	;;
+esac
+done
+
+if test -n "$cf_new_cflags" ; then
+
+	CFLAGS=3D"$CFLAGS $cf_new_cflags"
+fi
+
+if test -n "$cf_new_cppflags" ; then
+
+	CPPFLAGS=3D"$CPPFLAGS $cf_new_cppflags"
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+	EXTRA_CPPFLAGS=3D"$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+fi
+
+fi
+
+cf_POSIX_C_SOURCE=3D$cf_POSIX_C_SOURCE
+
+cf_save_CFLAGS=3D"$CFLAGS"
+cf_save_CPPFLAGS=3D"$CPPFLAGS"
+
+cf_trim_CFLAGS=3D`echo "$cf_save_CFLAGS" | \
+	sed	-e 's/-[UD]'"_POSIX_C_SOURCE"'\(=3D[^ 	]*\)\?[ 	]/ /g' \
+		-e 's/-[UD]'"_POSIX_C_SOURCE"'\(=3D[^ 	]*\)\?$//g'`
+
+cf_trim_CPPFLAGS=3D`echo "$cf_save_CPPFLAGS" | \
+	sed	-e 's/-[UD]'"_POSIX_C_SOURCE"'\(=3D[^ 	]*\)\?[ 	]/ /g' \
+		-e 's/-[UD]'"_POSIX_C_SOURCE"'\(=3D[^ 	]*\)\?$//g'`
+
+echo "$as_me:3247: 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}" =3D set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+echo "${as_me:-configure}:3253: testing if the symbol is already defined g=
o no further ..." 1>&5
+
+	cat >conftest.$ac_ext <<_ACEOF
+#line 3256 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+int
+main ()
+{
+
+#ifndef _POSIX_C_SOURCE
+make an error
+#endif
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:3271: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=3D$?
+  echo "$as_me:3274: \$? =3D $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try=3D'test -s conftest.$ac_objext'
+  { (eval echo "$as_me:3277: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=3D$?
+  echo "$as_me:3280: \$? =3D $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_posix_c_source=3Dno
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_want_posix_source=3Dno
+	 case .$cf_POSIX_C_SOURCE in #(vi
+	 .[12]??*) #(vi
+		cf_cv_posix_c_source=3D"-D_POSIX_C_SOURCE=3D$cf_POSIX_C_SOURCE"
+		;;
+	 .2) #(vi
+		cf_cv_posix_c_source=3D"-D_POSIX_C_SOURCE=3D$cf_POSIX_C_SOURCE"
+		cf_want_posix_source=3Dyes
+		;;
+	 .*)
+		cf_want_posix_source=3Dyes
+		;;
+	 esac
+	 if test "$cf_want_posix_source" =3D yes ; then
+		cat >conftest.$ac_ext <<_ACEOF
+#line 3301 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+int
+main ()
+{
+
+#ifdef _POSIX_SOURCE
+make an error
+#endif
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:3316: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=3D$?
+  echo "$as_me:3319: \$? =3D $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try=3D'test -s conftest.$ac_objext'
+  { (eval echo "$as_me:3322: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=3D$?
+  echo "$as_me:3325: \$? =3D $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_posix_c_source=3D"$cf_cv_posix_c_source -D_POSIX_SOURCE"
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+	 fi
+
+echo "${as_me:-configure}:3336: testing ifdef from value $cf_POSIX_C_SOURC=
E ..." 1>&5
+
+	 CFLAGS=3D"$cf_trim_CFLAGS"
+	 CPPFLAGS=3D"$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
+
+echo "${as_me:-configure}:3341: testing if the second compile does not lea=
ve our definition intact error ..." 1>&5
+
+	 cat >conftest.$ac_ext <<_ACEOF
+#line 3344 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+int
+main ()
+{
+
+#ifndef _POSIX_C_SOURCE
+make an error
+#endif
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:3359: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=3D$?
+  echo "$as_me:3362: \$? =3D $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try=3D'test -s conftest.$ac_objext'
+  { (eval echo "$as_me:3365: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=3D$?
+  echo "$as_me:3368: \$? =3D $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_posix_c_source=3Dno
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+	 CFLAGS=3D"$cf_save_CFLAGS"
+	 CPPFLAGS=3D"$cf_save_CPPFLAGS"
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+fi
+echo "$as_me:3384: result: $cf_cv_posix_c_source" >&5
+echo "${ECHO_T}$cf_cv_posix_c_source" >&6
+
+if test "$cf_cv_posix_c_source" !=3D no ; then
+	CFLAGS=3D"$cf_trim_CFLAGS"
+	CPPFLAGS=3D"$cf_trim_CPPFLAGS"
+
+cf_fix_cppflags=3Dno
+cf_new_cflags=3D
+cf_new_cppflags=3D
+cf_new_extra_cppflags=3D
+
+for cf_add_cflags in $cf_cv_posix_c_source
+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=3D`echo ${cf_add_cflags} |sed -e 's/^-D[^=3D]*=3D'\''\"[^=
"]*//'`
+
+			test "${cf_add_cflags}" !=3D "${cf_tst_cflags}" \
+				&& test -z "${cf_tst_cflags}" \
+				&& cf_fix_cppflags=3Dyes
+
+			if test $cf_fix_cppflags =3D yes ; then
+				cf_new_extra_cppflags=3D"$cf_new_extra_cppflags $cf_add_cflags"
+				continue
+			elif test "${cf_tst_cflags}" =3D "\"'" ; then
+				cf_new_extra_cppflags=3D"$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=3D`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=
=3D.*//'`
+
+CPPFLAGS=3D`echo "$CPPFLAGS" | \
+	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=3D[^ 	]*\)\?[ 	]/ /g' \
+		-e 's/-[UD]'"$cf_tst_cppflags"'\(=3D[^ 	]*\)\?$//g'`
+
+				;;
+			esac
+			cf_new_cppflags=3D"$cf_new_cppflags $cf_add_cflags"
+			;;
+		esac
+		;;
+	*)
+		cf_new_cflags=3D"$cf_new_cflags $cf_add_cflags"
+		;;
+	esac
+	;;
+yes)
+	cf_new_extra_cppflags=3D"$cf_new_extra_cppflags $cf_add_cflags"
+
+	cf_tst_cflags=3D`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+
+	test "${cf_add_cflags}" !=3D "${cf_tst_cflags}" \
+		&& test -z "${cf_tst_cflags}" \
+		&& cf_fix_cppflags=3Dno
+	;;
+esac
+done
+
+if test -n "$cf_new_cflags" ; then
+
+	CFLAGS=3D"$CFLAGS $cf_new_cflags"
+fi
+
+if test -n "$cf_new_cppflags" ; then
+
+	CPPFLAGS=3D"$CPPFLAGS $cf_new_cppflags"
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+	EXTRA_CPPFLAGS=3D"$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+fi
+
+fi
+
+	;;
+esac
+
+if test -n "$cf_xopen_source" ; then
+
+cf_fix_cppflags=3Dno
+cf_new_cflags=3D
+cf_new_cppflags=3D
+cf_new_extra_cppflags=3D
+
+for cf_add_cflags in $cf_xopen_source
+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=3D`echo ${cf_add_cflags} |sed -e 's/^-D[^=3D]*=3D'\''\"[^=
"]*//'`
+
+			test "${cf_add_cflags}" !=3D "${cf_tst_cflags}" \
+				&& test -z "${cf_tst_cflags}" \
+				&& cf_fix_cppflags=3Dyes
+
+			if test $cf_fix_cppflags =3D yes ; then
+				cf_new_extra_cppflags=3D"$cf_new_extra_cppflags $cf_add_cflags"
+				continue
+			elif test "${cf_tst_cflags}" =3D "\"'" ; then
+				cf_new_extra_cppflags=3D"$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=3D`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=
=3D.*//'`
+
+CPPFLAGS=3D`echo "$CPPFLAGS" | \
+	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=3D[^ 	]*\)\?[ 	]/ /g' \
+		-e 's/-[UD]'"$cf_tst_cppflags"'\(=3D[^ 	]*\)\?$//g'`
+
+				;;
+			esac
+			cf_new_cppflags=3D"$cf_new_cppflags $cf_add_cflags"
+			;;
+		esac
+		;;
+	*)
+		cf_new_cflags=3D"$cf_new_cflags $cf_add_cflags"
+		;;
+	esac
+	;;
+yes)
+	cf_new_extra_cppflags=3D"$cf_new_extra_cppflags $cf_add_cflags"
+
+	cf_tst_cflags=3D`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+
+	test "${cf_add_cflags}" !=3D "${cf_tst_cflags}" \
+		&& test -z "${cf_tst_cflags}" \
+		&& cf_fix_cppflags=3Dno
+	;;
+esac
+done
+
+if test -n "$cf_new_cflags" ; then
+
+	CFLAGS=3D"$CFLAGS $cf_new_cflags"
+fi
+
+if test -n "$cf_new_cppflags" ; then
+
+	CPPFLAGS=3D"$CPPFLAGS $cf_new_cppflags"
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+	EXTRA_CPPFLAGS=3D"$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+fi
+
+fi
+
+if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
+	echo "$as_me:3557: checking if _XOPEN_SOURCE really is set" >&5
+echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
+	cat >conftest.$ac_ext <<_ACEOF
+#line 3560 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+int
+main ()
+{
+
+#ifndef _XOPEN_SOURCE
+make an error
+#endif
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:3575: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=3D$?
+  echo "$as_me:3578: \$? =3D $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try=3D'test -s conftest.$ac_objext'
+  { (eval echo "$as_me:3581: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=3D$?
+  echo "$as_me:3584: \$? =3D $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_XOPEN_SOURCE_set=3Dyes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_XOPEN_SOURCE_set=3Dno
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+	echo "$as_me:3593: result: $cf_XOPEN_SOURCE_set" >&5
+echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
+	if test $cf_XOPEN_SOURCE_set =3D yes
+	then
+		cat >conftest.$ac_ext <<_ACEOF
+#line 3598 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+int
+main ()
+{
+
+#if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
+make an error
+#endif
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:3613: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=3D$?
+  echo "$as_me:3616: \$? =3D $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try=3D'test -s conftest.$ac_objext'
+  { (eval echo "$as_me:3619: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=3D$?
+  echo "$as_me:3622: \$? =3D $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_XOPEN_SOURCE_set_ok=3Dyes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_XOPEN_SOURCE_set_ok=3Dno
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+		if test $cf_XOPEN_SOURCE_set_ok =3D no
+		then
+			{ echo "$as_me:3633: WARNING: _XOPEN_SOURCE is lower than requested" >&5
+echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
+		fi
+	else
+
+echo "$as_me:3638: 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}" =3D set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+	cat >conftest.$ac_ext <<_ACEOF
+#line 3645 "configure"
+#include "confdefs.h"
+
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+
+int
+main ()
+{
+
+#ifndef _XOPEN_SOURCE
+make an error
+#endif
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:3664: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=3D$?
+  echo "$as_me:3667: \$? =3D $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try=3D'test -s conftest.$ac_objext'
+  { (eval echo "$as_me:3670: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=3D$?
+  echo "$as_me:3673: \$? =3D $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_xopen_source=3Dno
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_save=3D"$CPPFLAGS"
+	 CPPFLAGS=3D"$CPPFLAGS -D_XOPEN_SOURCE=3D$cf_XOPEN_SOURCE"
+	 cat >conftest.$ac_ext <<_ACEOF
+#line 3682 "configure"
+#include "confdefs.h"
+
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+
+int
+main ()
+{
+
+#ifdef _XOPEN_SOURCE
+make an error
+#endif
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:3701: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=3D$?
+  echo "$as_me:3704: \$? =3D $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try=3D'test -s conftest.$ac_objext'
+  { (eval echo "$as_me:3707: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=3D$?
+  echo "$as_me:3710: \$? =3D $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_xopen_source=3Dno
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_xopen_source=3D$cf_XOPEN_SOURCE
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+	CPPFLAGS=3D"$cf_save"
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+fi
+echo "$as_me:3725: result: $cf_cv_xopen_source" >&5
+echo "${ECHO_T}$cf_cv_xopen_source" >&6
+
+if test "$cf_cv_xopen_source" !=3D no ; then
+
+CFLAGS=3D`echo "$CFLAGS" | \
+	sed	-e 's/-[UD]'"_XOPEN_SOURCE"'\(=3D[^ 	]*\)\?[ 	]/ /g' \
+		-e 's/-[UD]'"_XOPEN_SOURCE"'\(=3D[^ 	]*\)\?$//g'`
+
+CPPFLAGS=3D`echo "$CPPFLAGS" | \
+	sed	-e 's/-[UD]'"_XOPEN_SOURCE"'\(=3D[^ 	]*\)\?[ 	]/ /g' \
+		-e 's/-[UD]'"_XOPEN_SOURCE"'\(=3D[^ 	]*\)\?$//g'`
+
+	cf_temp_xopen_source=3D"-D_XOPEN_SOURCE=3D$cf_cv_xopen_source"
+
+cf_fix_cppflags=3Dno
+cf_new_cflags=3D
+cf_new_cppflags=3D
+cf_new_extra_cppflags=3D
+
+for cf_add_cflags in $cf_temp_xopen_source
+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=3D`echo ${cf_add_cflags} |sed -e 's/^-D[^=3D]*=3D'\''\"[^=
"]*//'`
+
+			test "${cf_add_cflags}" !=3D "${cf_tst_cflags}" \
+				&& test -z "${cf_tst_cflags}" \
+				&& cf_fix_cppflags=3Dyes
+
+			if test $cf_fix_cppflags =3D yes ; then
+				cf_new_extra_cppflags=3D"$cf_new_extra_cppflags $cf_add_cflags"
+				continue
+			elif test "${cf_tst_cflags}" =3D "\"'" ; then
+				cf_new_extra_cppflags=3D"$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=3D`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=
=3D.*//'`
+
+CPPFLAGS=3D`echo "$CPPFLAGS" | \
+	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=3D[^ 	]*\)\?[ 	]/ /g' \
+		-e 's/-[UD]'"$cf_tst_cppflags"'\(=3D[^ 	]*\)\?$//g'`
+
+				;;
+			esac
+			cf_new_cppflags=3D"$cf_new_cppflags $cf_add_cflags"
+			;;
+		esac
+		;;
+	*)
+		cf_new_cflags=3D"$cf_new_cflags $cf_add_cflags"
+		;;
+	esac
+	;;
+yes)
+	cf_new_extra_cppflags=3D"$cf_new_extra_cppflags $cf_add_cflags"
+
+	cf_tst_cflags=3D`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+
+	test "${cf_add_cflags}" !=3D "${cf_tst_cflags}" \
+		&& test -z "${cf_tst_cflags}" \
+		&& cf_fix_cppflags=3Dno
+	;;
+esac
+done
+
+if test -n "$cf_new_cflags" ; then
+
+	CFLAGS=3D"$CFLAGS $cf_new_cflags"
+fi
+
+if test -n "$cf_new_cppflags" ; then
+
+	CPPFLAGS=3D"$CPPFLAGS $cf_new_cppflags"
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+	EXTRA_CPPFLAGS=3D"$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+fi
+
+fi
+
+	fi
+fi
+
+ac_ext=3Dc
+ac_cpp=3D'$CPP $CPPFLAGS'
+ac_compile=3D'$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link=3D'$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$=
ac_ext $LIBS >&5'
+ac_compiler_gnu=3D$ac_cv_c_compiler_gnu
+ac_main_return=3Dreturn
+echo "$as_me:3829: checking how to run the C preprocessor" >&5
+echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=3D
+fi
+if test -z "$CPP"; then
+  if test "${ac_cv_prog_CPP+set}" =3D set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+      # Double quotes because CPP needs to be expanded
+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+    do
+      ac_preproc_ok=3Dfalse
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+#line 3850 "configure"
+#include "confdefs.h"
+#include <assert.h>
+                     Syntax error
+_ACEOF
+if { (eval echo "$as_me:3855: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=3D$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:3861: \$? =3D $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=3D$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=3D
+  fi
+else
+  ac_cpp_err=3Dyes
+fi
+if test -z "$ac_cpp_err"; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether non-existent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+#line 3884 "configure"
+#include "confdefs.h"
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:3888: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=3D$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:3894: \$? =3D $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=3D$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=3D
+  fi
+else
+  ac_cpp_err=3Dyes
+fi
+if test -z "$ac_cpp_err"; then
+  # Broken: success on invalid input.
+continue
+else
+  echo "$as_me: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  # Passes both tests.
+ac_preproc_ok=3D:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  break
+fi
+
+    done
+    ac_cv_prog_CPP=3D$CPP
+
+fi
+  CPP=3D$ac_cv_prog_CPP
+else
+  ac_cv_prog_CPP=3D$CPP
+fi
+echo "$as_me:3931: result: $CPP" >&5
+echo "${ECHO_T}$CPP" >&6
+ac_preproc_ok=3Dfalse
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+#line 3941 "configure"
+#include "confdefs.h"
+#include <assert.h>
+                     Syntax error
+_ACEOF
+if { (eval echo "$as_me:3946: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=3D$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:3952: \$? =3D $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=3D$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=3D
+  fi
+else
+  ac_cpp_err=3Dyes
+fi
+if test -z "$ac_cpp_err"; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether non-existent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+#line 3975 "configure"
+#include "confdefs.h"
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:3979: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=3D$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:3985: \$? =3D $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=3D$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=3D
+  fi
+else
+  ac_cpp_err=3Dyes
+fi
+if test -z "$ac_cpp_err"; then
+  # Broken: success on invalid input.
+continue
+else
+  echo "$as_me: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  # Passes both tests.
+ac_preproc_ok=3D:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  :
+else
+  { { echo "$as_me:4013: error: C preprocessor \"$CPP\" fails sanity check=
" >&5
+echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+ac_ext=3Dc
+ac_cpp=3D'$CPP $CPPFLAGS'
+ac_compile=3D'$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link=3D'$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$=
ac_ext $LIBS >&5'
+ac_compiler_gnu=3D$ac_cv_c_compiler_gnu
+ac_main_return=3Dreturn
+
+for ac_header in fcntl.h
+do
+as_ac_Header=3D`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+echo "$as_me:4028: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" =3D set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 4034 "configure"
+#include "confdefs.h"
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:4038: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=3D$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:4044: \$? =3D $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=3D$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=3D
+  fi
+else
+  ac_cpp_err=3Dyes
+fi
+if test -z "$ac_cpp_err"; then
+  eval "$as_ac_Header=3Dyes"
+else
+  echo "$as_me: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  eval "$as_ac_Header=3Dno"
+fi
+rm -f conftest.err conftest.$ac_ext
+fi
+echo "$as_me:4063: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` =3D yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+EOF
+
+fi
+done
+
+for ac_func in atexit
+do
+as_ac_var=3D`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:4076: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" =3D set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 4082 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char $ac_func ();
+char (*f) ();
+
+int
+main ()
+{
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+f =3D $ac_func;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:4113: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=3D$?
+  echo "$as_me:4116: \$? =3D $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try=3D'test -s conftest$ac_exeext'
+  { (eval echo "$as_me:4119: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=3D$?
+  echo "$as_me:4122: \$? =3D $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_var=3Dyes"
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+eval "$as_ac_var=3Dno"
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:4132: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` =3D yes; then
+  cat >>confdefs.h <<EOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+EOF
+
+fi
+done
+
+echo "$as_me:4142: checking for working mkstemp" >&5
+echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6
+if test "${cf_cv_func_mkstemp+set}" =3D set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+rm -rf conftest*
+if test "$cross_compiling" =3D yes; then
+  echo "$as_me:4150: checking for mkstemp" >&5
+echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6
+if test "${ac_cv_func_mkstemp+set}" =3D set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 4156 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char mkstemp (); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char mkstemp ();
+char (*f) ();
+
+int
+main ()
+{
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_mkstemp) || defined (__stub___mkstemp)
+choke me
+#else
+f =3D mkstemp;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:4187: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=3D$?
+  echo "$as_me:4190: \$? =3D $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try=3D'test -s conftest$ac_exeext'
+  { (eval echo "$as_me:4193: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=3D$?
+  echo "$as_me:4196: \$? =3D $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_mkstemp=3Dyes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_func_mkstemp=3Dno
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:4206: result: $ac_cv_func_mkstemp" >&5
+echo "${ECHO_T}$ac_cv_func_mkstemp" >&6
+
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 4211 "configure"
+#include "confdefs.h"
+
+#include <sys/types.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <sys/stat.h>
+int main()
+{
+	char *tmpl =3D "conftestXXXXXX";
+	char name[2][80];
+	int n;
+	int result =3D 0;
+	int fd;
+	struct stat sb;
+
+	umask(077);
+	for (n =3D 0; n < 2; ++n) {
+		strcpy(name[n], tmpl);
+		if ((fd =3D mkstemp(name[n])) >=3D 0) {
+			if (!strcmp(name[n], tmpl)
+			 || stat(name[n], &sb) !=3D 0
+			 || (sb.st_mode & S_IFMT) !=3D S_IFREG
+			 || (sb.st_mode & 077) !=3D 0) {
+				result =3D 1;
+			}
+			close(fd);
+		}
+	}
+	if (result =3D=3D 0
+	 && !strcmp(name[0], name[1]))
+		result =3D 1;
+	${cf_cv_main_return:-return}(result);
+}
+
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:4249: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=3D$?
+  echo "$as_me:4252: \$? =3D $ac_status" >&5
+  (exit $ac_status); } && { ac_try=3D'./conftest$ac_exeext'
+  { (eval echo "$as_me:4254: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=3D$?
+  echo "$as_me:4257: \$? =3D $ac_status" >&5
+  (exit $ac_status); }; }; then
+  cf_cv_func_mkstemp=3Dyes
+
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+cf_cv_func_mkstemp=3Dno
+
+fi
+rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$=
ac_ext
+fi
+
+fi
+echo "$as_me:4272: result: $cf_cv_func_mkstemp" >&5
+echo "${ECHO_T}$cf_cv_func_mkstemp" >&6
+if test "x$cf_cv_func_mkstemp" =3D xyes || test "x$ac_cv_func_mkstemp" =3D=
 xyes ; then
+	cat >>confdefs.h <<\EOF
+#define HAVE_MKSTEMP 1
+EOF
+
+fi
+
+GCC_VERSION=3Dnone
+if test "$GCC" =3D yes ; then
+	echo "$as_me:4283: checking version of $CC" >&5
+echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
+	GCC_VERSION=3D"`${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=3Dunknown
+	echo "$as_me:4287: result: $GCC_VERSION" >&5
+echo "${ECHO_T}$GCC_VERSION" >&6
+fi
+
+if ( test "$GCC" =3D yes || test "$GXX" =3D yes )
+then
+echo "$as_me:4293: checking if you want to check for gcc warnings" >&5
+echo $ECHO_N "checking if you want to check for gcc warnings... $ECHO_C" >=
&6
+
+# Check whether --with-warnings or --without-warnings was given.
+if test "${with_warnings+set}" =3D set; then
+  withval=3D"$with_warnings"
+  cf_opt_with_warnings=3D$withval
+else
+  cf_opt_with_warnings=3Dno
+fi;
+echo "$as_me:4303: result: $cf_opt_with_warnings" >&5
+echo "${ECHO_T}$cf_opt_with_warnings" >&6
+if test "$cf_opt_with_warnings" !=3D no ; then
+
+if test "$GCC" =3D yes
+then
+cat > conftest.i <<EOF
+#ifndef GCC_PRINTF
+#define GCC_PRINTF 0
+#endif
+#ifndef GCC_SCANF
+#define GCC_SCANF 0
+#endif
+#ifndef GCC_NORETURN
+#define GCC_NORETURN /* nothing */
+#endif
+#ifndef GCC_UNUSED
+#define GCC_UNUSED /* nothing */
+#endif
+EOF
+if test "$GCC" =3D yes
+then
+	{ echo "$as_me:4325: checking for $CC __attribute__ directives..." >&5
+echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
+cat > conftest.$ac_ext <<EOF
+#line 4328 "${as_me:-configure}"
+#include "confdefs.h"
+#include "conftest.h"
+#include "conftest.i"
+#if	GCC_PRINTF
+#define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
+#else
+#define GCC_PRINTFLIKE(fmt,var) /*nothing*/
+#endif
+#if	GCC_SCANF
+#define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
+#else
+#define GCC_SCANFLIKE(fmt,var)  /*nothing*/
+#endif
+extern void wow(char *,...) GCC_SCANFLIKE(1,2);
+extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
+extern void foo(void) GCC_NORETURN;
+int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
+EOF
+	cf_printf_attribute=3Dno
+	cf_scanf_attribute=3Dno
+	for cf_attribute in scanf printf unused noreturn
+	do
+
+cf_ATTRIBUTE=3D`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-=
%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
+
+		cf_directive=3D"__attribute__(($cf_attribute))"
+		echo "checking for $CC $cf_directive" 1>&5
+
+		case $cf_attribute in #(vi
+		printf) #(vi
+			cf_printf_attribute=3Dyes
+			cat >conftest.h <<EOF
+#define GCC_$cf_ATTRIBUTE 1
+EOF
+			;;
+		scanf) #(vi
+			cf_scanf_attribute=3Dyes
+			cat >conftest.h <<EOF
+#define GCC_$cf_ATTRIBUTE 1
+EOF
+			;;
+		*) #(vi
+			cat >conftest.h <<EOF
+#define GCC_$cf_ATTRIBUTE $cf_directive
+EOF
+			;;
+		esac
+
+		if { (eval echo "$as_me:4377: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=3D$?
+  echo "$as_me:4380: \$? =3D $ac_status" >&5
+  (exit $ac_status); }; then
+			test -n "$verbose" && echo "$as_me:4382: result: ... $cf_attribute" >&5
+echo "${ECHO_T}... $cf_attribute" >&6
+			cat conftest.h >>confdefs.h
+			case $cf_attribute in #(vi
+			printf) #(vi
+				if test "$cf_printf_attribute" =3D no ; then
+					cat >>confdefs.h <<EOF
+#define GCC_PRINTFLIKE(fmt,var) /* nothing */
+EOF
+				else
+					cat >>confdefs.h <<EOF
+#define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
+EOF
+				fi
+				;;
+			scanf) #(vi
+				if test "$cf_scanf_attribute" =3D no ; then
+					cat >>confdefs.h <<EOF
+#define GCC_SCANFLIKE(fmt,var) /* nothing */
+EOF
+				else
+					cat >>confdefs.h <<EOF
+#define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
+EOF
+				fi
+				;;
+			esac
+		fi
+	done
+else
+	fgrep define conftest.i >>confdefs.h
+fi
+rm -rf conftest*
+fi
+
+INTEL_COMPILER=3Dno
+
+if test "$GCC" =3D yes ; then
+	case $host_os in
+	linux*|gnu*)
+		echo "$as_me:4422: 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=3D"$CFLAGS"
+		CFLAGS=3D"$CFLAGS -no-gcc"
+		cat >conftest.$ac_ext <<_ACEOF
+#line 4427 "configure"
+#include "confdefs.h"
+
+int
+main ()
+{
+
+#ifdef __INTEL_COMPILER
+#else
+make an error
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:4444: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=3D$?
+  echo "$as_me:4447: \$? =3D $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try=3D'test -s conftest.$ac_objext'
+  { (eval echo "$as_me:4450: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=3D$?
+  echo "$as_me:4453: \$? =3D $ac_status" >&5
+  (exit $ac_status); }; }; then
+  INTEL_COMPILER=3Dyes
+cf_save_CFLAGS=3D"$cf_save_CFLAGS -we147 -no-gcc"
+
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+		CFLAGS=3D"$cf_save_CFLAGS"
+		echo "$as_me:4464: result: $INTEL_COMPILER" >&5
+echo "${ECHO_T}$INTEL_COMPILER" >&6
+		;;
+	esac
+fi
+
+cat > conftest.$ac_ext <<EOF
+#line 4471 "${as_me:-configure}"
+int main(int argc, char *argv[]) { return (argv[argc-1] =3D=3D 0) ; }
+EOF
+
+if test "$INTEL_COMPILER" =3D yes
+then
+# The "-wdXXX" options suppress warnings:
+# remark #1419: external declaration in primary source file
+# remark #1683: explicit conversion of a 64-bit integral type to a smaller=
 integral type (potential portability problem)
+# remark #1684: conversion from pointer to same-sized integral type (poten=
tial portability problem)
+# remark #193: zero used for undefined preprocessing identifier
+# remark #593: variable "curs_sb_left_arrow" was set but never used
+# remark #810: conversion from "int" to "Dimension=3D{unsigned short}" may=
 lose significant bits
+# remark #869: parameter "tw" was never referenced
+# remark #981: operands are evaluated in unspecified order
+# warning #279: controlling expression is constant
+
+	{ echo "$as_me:4488: checking for $CC warning options..." >&5
+echo "$as_me: checking for $CC warning options..." >&6;}
+	cf_save_CFLAGS=3D"$CFLAGS"
+	EXTRA_CFLAGS=3D"-Wall"
+	for cf_opt in \
+		wd1419 \
+		wd1683 \
+		wd1684 \
+		wd193 \
+		wd593 \
+		wd279 \
+		wd810 \
+		wd869 \
+		wd981
+	do
+		CFLAGS=3D"$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
+		if { (eval echo "$as_me:4504: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=3D$?
+  echo "$as_me:4507: \$? =3D $ac_status" >&5
+  (exit $ac_status); }; then
+			test -n "$verbose" && echo "$as_me:4509: result: ... -$cf_opt" >&5
+echo "${ECHO_T}... -$cf_opt" >&6
+			EXTRA_CFLAGS=3D"$EXTRA_CFLAGS -$cf_opt"
+		fi
+	done
+	CFLAGS=3D"$cf_save_CFLAGS"
+
+elif test "$GCC" =3D yes
+then
+	{ echo "$as_me:4518: checking for $CC warning options..." >&5
+echo "$as_me: checking for $CC warning options..." >&6;}
+	cf_save_CFLAGS=3D"$CFLAGS"
+	EXTRA_CFLAGS=3D
+	cf_warn_CONST=3D""
+	test "$with_ext_const" =3D yes && cf_warn_CONST=3D"Wwrite-strings"
+	for cf_opt in W Wall \
+		Wbad-function-cast \
+		Wcast-align \
+		Wcast-qual \
+		Winline \
+		Wmissing-declarations \
+		Wmissing-prototypes \
+		Wnested-externs \
+		Wpointer-arith \
+		Wshadow \
+		Wstrict-prototypes \
+		Wundef $cf_warn_CONST Wwrite-strings
+	do
+		CFLAGS=3D"$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
+		if { (eval echo "$as_me:4538: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=3D$?
+  echo "$as_me:4541: \$? =3D $ac_status" >&5
+  (exit $ac_status); }; then
+			test -n "$verbose" && echo "$as_me:4543: result: ... -$cf_opt" >&5
+echo "${ECHO_T}... -$cf_opt" >&6
+			case $cf_opt in #(vi
+			Wcast-qual) #(vi
+				CPPFLAGS=3D"$CPPFLAGS -DXTSTRINGDEFINES"
+				;;
+			Winline) #(vi
+				case $GCC_VERSION in
+				[34].*)
+					test -n "$verbose" && echo "	feature is broken in gcc $GCC_VERSION" 1=
>&6
+
+echo "${as_me:-configure}:4554: testing feature is broken in gcc $GCC_VERS=
ION ..." 1>&5
+
+					continue;;
+				esac
+				;;
+			esac
+			EXTRA_CFLAGS=3D"$EXTRA_CFLAGS -$cf_opt"
+		fi
+	done
+	CFLAGS=3D"$cf_save_CFLAGS"
+fi
+rm -rf conftest*
+
+fi
+fi
+
+echo "$as_me:4570: checking if you want to see long compiling messages" >&5
+echo $ECHO_N "checking if you want to see long compiling messages... $ECHO=
_C" >&6
+
+# Check whether --enable-echo or --disable-echo was given.
+if test "${enable_echo+set}" =3D set; then
+  enableval=3D"$enable_echo"
+  test "$enableval" !=3D no && enableval=3Dyes
+  if test "$enableval" !=3D "yes" ; then
+
+    ECHO_LT=3D'--silent'
+    ECHO_LD=3D'@echo linking [email protected];'
+    RULE_CC=3D'@echo compiling $<'
+    SHOW_CC=3D'@echo compiling [email protected]'
+    ECHO_CC=3D'@'
+
+  else
+
+    ECHO_LT=3D''
+    ECHO_LD=3D''
+    RULE_CC=3D''
+    SHOW_CC=3D''
+    ECHO_CC=3D''
+
+  fi
+else
+  enableval=3Dyes
+
+    ECHO_LT=3D''
+    ECHO_LD=3D''
+    RULE_CC=3D''
+    SHOW_CC=3D''
+    ECHO_CC=3D''
+
+fi;
+echo "$as_me:4604: result: $enableval" >&5
+echo "${ECHO_T}$enableval" >&6
+
+case $cf_cv_system_name in
+os2*)
+    CFLAGS=3D"$CFLAGS -Zmt"
+    CPPFLAGS=3D"$CPPFLAGS -D__ST_MT_ERRNO__"
+    CXXFLAGS=3D"$CXXFLAGS -Zmt"
+    # autoconf's macro sets -Zexe and suffix both, which conflict:w
+    LDFLAGS=3D"$LDFLAGS -Zmt -Zcrtdll"
+    ac_cv_exeext=3D.exe
+    ;;
+esac
+
+PROG_EXT=3D"$EXEEXT"
+
+test -n "$PROG_EXT" && cat >>confdefs.h <<EOF
+#define PROG_EXT "$PROG_EXT"
+EOF
+
+echo "$as_me:4624: checking if you want to use dmalloc for testing" >&5
+echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" =
>&6
+
+# Check whether --with-dmalloc or --without-dmalloc was given.
+if test "${with_dmalloc+set}" =3D set; then
+  withval=3D"$with_dmalloc"
+  cat >>confdefs.h <<\EOF
+#define USE_DMALLOC 1
+EOF
+
+	: ${with_cflags:=3D-g}
+	: ${with_no_leaks:=3Dyes}
+	 with_dmalloc=3Dyes
+else
+  with_dmalloc=3D
+fi;
+echo "$as_me:4640: result: ${with_dmalloc:-no}" >&5
+echo "${ECHO_T}${with_dmalloc:-no}" >&6
+
+case .$with_cflags in #(vi
+.*-g*)
+	case .$CFLAGS in #(vi
+	.*-g*) #(vi
+		;;
+	*)
+
+cf_fix_cppflags=3Dno
+cf_new_cflags=3D
+cf_new_cppflags=3D
+cf_new_extra_cppflags=3D
+
+for cf_add_cflags in -g
+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=3D`echo ${cf_add_cflags} |sed -e 's/^-D[^=3D]*=3D'\''\"[^=
"]*//'`
+
+			test "${cf_add_cflags}" !=3D "${cf_tst_cflags}" \
+				&& test -z "${cf_tst_cflags}" \
+				&& cf_fix_cppflags=3Dyes
+
+			if test $cf_fix_cppflags =3D yes ; then
+				cf_new_extra_cppflags=3D"$cf_new_extra_cppflags $cf_add_cflags"
+				continue
+			elif test "${cf_tst_cflags}" =3D "\"'" ; then
+				cf_new_extra_cppflags=3D"$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=3D`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=
=3D.*//'`
+
+CPPFLAGS=3D`echo "$CPPFLAGS" | \
+	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=3D[^ 	]*\)\?[ 	]/ /g' \
+		-e 's/-[UD]'"$cf_tst_cppflags"'\(=3D[^ 	]*\)\?$//g'`
+
+				;;
+			esac
+			cf_new_cppflags=3D"$cf_new_cppflags $cf_add_cflags"
+			;;
+		esac
+		;;
+	*)
+		cf_new_cflags=3D"$cf_new_cflags $cf_add_cflags"
+		;;
+	esac
+	;;
+yes)
+	cf_new_extra_cppflags=3D"$cf_new_extra_cppflags $cf_add_cflags"
+
+	cf_tst_cflags=3D`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+
+	test "${cf_add_cflags}" !=3D "${cf_tst_cflags}" \
+		&& test -z "${cf_tst_cflags}" \
+		&& cf_fix_cppflags=3Dno
+	;;
+esac
+done
+
+if test -n "$cf_new_cflags" ; then
+
+	CFLAGS=3D"$CFLAGS $cf_new_cflags"
+fi
+
+if test -n "$cf_new_cppflags" ; then
+
+	CPPFLAGS=3D"$CPPFLAGS $cf_new_cppflags"
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+	EXTRA_CPPFLAGS=3D"$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+fi
+
+		;;
+	esac
+	;;
+esac
+
+if test "$with_dmalloc" =3D yes ; then
+	echo "$as_me:4734: checking for dmalloc.h" >&5
+echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
+if test "${ac_cv_header_dmalloc_h+set}" =3D set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 4740 "configure"
+#include "confdefs.h"
+#include <dmalloc.h>
+_ACEOF
+if { (eval echo "$as_me:4744: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=3D$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:4750: \$? =3D $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=3D$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=3D
+  fi
+else
+  ac_cpp_err=3Dyes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_cv_header_dmalloc_h=3Dyes
+else
+  echo "$as_me: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  ac_cv_header_dmalloc_h=3Dno
+fi
+rm -f conftest.err conftest.$ac_ext
+fi
+echo "$as_me:4769: result: $ac_cv_header_dmalloc_h" >&5
+echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
+if test $ac_cv_header_dmalloc_h =3D yes; then
+
+echo "$as_me:4773: 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}" =3D set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=3D$LIBS
+LIBS=3D"-ldmalloc  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line 4781 "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char dmalloc_debug ();
+int
+main ()
+{
+dmalloc_debug ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:4800: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=3D$?
+  echo "$as_me:4803: \$? =3D $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try=3D'test -s conftest$ac_exeext'
+  { (eval echo "$as_me:4806: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=3D$?
+  echo "$as_me:4809: \$? =3D $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_dmalloc_dmalloc_debug=3Dyes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_dmalloc_dmalloc_debug=3Dno
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=3D$ac_check_lib_save_LIBS
+fi
+echo "$as_me:4820: 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 =3D yes; then
+  cat >>confdefs.h <<EOF
+#define HAVE_LIBDMALLOC 1
+EOF
+
+  LIBS=3D"-ldmalloc $LIBS"
+
+fi
+
+fi
+
+fi
+
+echo "$as_me:4835: checking if you want to use dbmalloc for testing" >&5
+echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C"=
 >&6
+
+# Check whether --with-dbmalloc or --without-dbmalloc was given.
+if test "${with_dbmalloc+set}" =3D set; then
+  withval=3D"$with_dbmalloc"
+  cat >>confdefs.h <<\EOF
+#define USE_DBMALLOC 1
+EOF
+
+	: ${with_cflags:=3D-g}
+	: ${with_no_leaks:=3Dyes}
+	 with_dbmalloc=3Dyes
+else
+  with_dbmalloc=3D
+fi;
+echo "$as_me:4851: result: ${with_dbmalloc:-no}" >&5
+echo "${ECHO_T}${with_dbmalloc:-no}" >&6
+
+case .$with_cflags in #(vi
+.*-g*)
+	case .$CFLAGS in #(vi
+	.*-g*) #(vi
+		;;
+	*)
+
+cf_fix_cppflags=3Dno
+cf_new_cflags=3D
+cf_new_cppflags=3D
+cf_new_extra_cppflags=3D
+
+for cf_add_cflags in -g
+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=3D`echo ${cf_add_cflags} |sed -e 's/^-D[^=3D]*=3D'\''\"[^=
"]*//'`
+
+			test "${cf_add_cflags}" !=3D "${cf_tst_cflags}" \
+				&& test -z "${cf_tst_cflags}" \
+				&& cf_fix_cppflags=3Dyes
+
+			if test $cf_fix_cppflags =3D yes ; then
+				cf_new_extra_cppflags=3D"$cf_new_extra_cppflags $cf_add_cflags"
+				continue
+			elif test "${cf_tst_cflags}" =3D "\"'" ; then
+				cf_new_extra_cppflags=3D"$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=3D`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=
=3D.*//'`
+
+CPPFLAGS=3D`echo "$CPPFLAGS" | \
+	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=3D[^ 	]*\)\?[ 	]/ /g' \
+		-e 's/-[UD]'"$cf_tst_cppflags"'\(=3D[^ 	]*\)\?$//g'`
+
+				;;
+			esac
+			cf_new_cppflags=3D"$cf_new_cppflags $cf_add_cflags"
+			;;
+		esac
+		;;
+	*)
+		cf_new_cflags=3D"$cf_new_cflags $cf_add_cflags"
+		;;
+	esac
+	;;
+yes)
+	cf_new_extra_cppflags=3D"$cf_new_extra_cppflags $cf_add_cflags"
+
+	cf_tst_cflags=3D`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+
+	test "${cf_add_cflags}" !=3D "${cf_tst_cflags}" \
+		&& test -z "${cf_tst_cflags}" \
+		&& cf_fix_cppflags=3Dno
+	;;
+esac
+done
+
+if test -n "$cf_new_cflags" ; then
+
+	CFLAGS=3D"$CFLAGS $cf_new_cflags"
+fi
+
+if test -n "$cf_new_cppflags" ; then
+
+	CPPFLAGS=3D"$CPPFLAGS $cf_new_cppflags"
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+	EXTRA_CPPFLAGS=3D"$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+fi
+
+		;;
+	esac
+	;;
+esac
+
+if test "$with_dbmalloc" =3D yes ; then
+	echo "$as_me:4945: checking for dbmalloc.h" >&5
+echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
+if test "${ac_cv_header_dbmalloc_h+set}" =3D set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line 4951 "configure"
+#include "confdefs.h"
+#include <dbmalloc.h>
+_ACEOF
+if { (eval echo "$as_me:4955: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=3D$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:4961: \$? =3D $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=3D$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=3D
+  fi
+else
+  ac_cpp_err=3Dyes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_cv_header_dbmalloc_h=3Dyes
+else
+  echo "$as_me: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  ac_cv_header_dbmalloc_h=3Dno
+fi
+rm -f conftest.err conftest.$ac_ext
+fi
+echo "$as_me:4980: result: $ac_cv_header_dbmalloc_h" >&5
+echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
+if test $ac_cv_header_dbmalloc_h =3D yes; then
+
+echo "$as_me:4984: 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}" =3D set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=3D$LIBS
+LIBS=3D"-ldbmalloc  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line 4992 "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char debug_malloc ();
+int
+main ()
+{
+debug_malloc ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:5011: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=3D$?
+  echo "$as_me:5014: \$? =3D $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try=3D'test -s conftest$ac_exeext'
+  { (eval echo "$as_me:5017: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=3D$?
+  echo "$as_me:5020: \$? =3D $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_dbmalloc_debug_malloc=3Dyes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_dbmalloc_debug_malloc=3Dno
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=3D$ac_check_lib_save_LIBS
+fi
+echo "$as_me:5031: 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 =3D yes; then
+  cat >>confdefs.h <<EOF
+#define HAVE_LIBDBMALLOC 1
+EOF
+
+  LIBS=3D"-ldbmalloc $LIBS"
+
+fi
+
+fi
+
+fi
+
+echo "$as_me:5046: checking if you want to use valgrind for testing" >&5
+echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C"=
 >&6
+
+# Check whether --with-valgrind or --without-valgrind was given.
+if test "${with_valgrind+set}" =3D set; then
+  withval=3D"$with_valgrind"
+  cat >>confdefs.h <<\EOF
+#define USE_VALGRIND 1
+EOF
+
+	: ${with_cflags:=3D-g}
+	: ${with_no_leaks:=3Dyes}
+	 with_valgrind=3Dyes
+else
+  with_valgrind=3D
+fi;
+echo "$as_me:5062: result: ${with_valgrind:-no}" >&5
+echo "${ECHO_T}${with_valgrind:-no}" >&6
+
+case .$with_cflags in #(vi
+.*-g*)
+	case .$CFLAGS in #(vi
+	.*-g*) #(vi
+		;;
+	*)
+
+cf_fix_cppflags=3Dno
+cf_new_cflags=3D
+cf_new_cppflags=3D
+cf_new_extra_cppflags=3D
+
+for cf_add_cflags in -g
+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=3D`echo ${cf_add_cflags} |sed -e 's/^-D[^=3D]*=3D'\''\"[^=
"]*//'`
+
+			test "${cf_add_cflags}" !=3D "${cf_tst_cflags}" \
+				&& test -z "${cf_tst_cflags}" \
+				&& cf_fix_cppflags=3Dyes
+
+			if test $cf_fix_cppflags =3D yes ; then
+				cf_new_extra_cppflags=3D"$cf_new_extra_cppflags $cf_add_cflags"
+				continue
+			elif test "${cf_tst_cflags}" =3D "\"'" ; then
+				cf_new_extra_cppflags=3D"$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=3D`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=
=3D.*//'`
+
+CPPFLAGS=3D`echo "$CPPFLAGS" | \
+	sed	-e 's/-[UD]'"$cf_tst_cppflags"'\(=3D[^ 	]*\)\?[ 	]/ /g' \
+		-e 's/-[UD]'"$cf_tst_cppflags"'\(=3D[^ 	]*\)\?$//g'`
+
+				;;
+			esac
+			cf_new_cppflags=3D"$cf_new_cppflags $cf_add_cflags"
+			;;
+		esac
+		;;
+	*)
+		cf_new_cflags=3D"$cf_new_cflags $cf_add_cflags"
+		;;
+	esac
+	;;
+yes)
+	cf_new_extra_cppflags=3D"$cf_new_extra_cppflags $cf_add_cflags"
+
+	cf_tst_cflags=3D`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+
+	test "${cf_add_cflags}" !=3D "${cf_tst_cflags}" \
+		&& test -z "${cf_tst_cflags}" \
+		&& cf_fix_cppflags=3Dno
+	;;
+esac
+done
+
+if test -n "$cf_new_cflags" ; then
+
+	CFLAGS=3D"$CFLAGS $cf_new_cflags"
+fi
+
+if test -n "$cf_new_cppflags" ; then
+
+	CPPFLAGS=3D"$CPPFLAGS $cf_new_cppflags"
+fi
+
+if test -n "$cf_new_extra_cppflags" ; then
+
+	EXTRA_CPPFLAGS=3D"$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+fi
+
+		;;
+	esac
+	;;
+esac
+
+echo "$as_me:5155: checking if you want to perform memory-leak testing" >&5
+echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO=
_C" >&6
+
+# Check whether --enable-leaks or --disable-leaks was given.
+if test "${enable_leaks+set}" =3D set; then
+  enableval=3D"$enable_leaks"
+  if test "x$enableval" =3D xno; then with_no_leaks=3Dyes; else with_no_le=
aks=3Dno; fi
+else
+  : ${with_no_leaks:=3Dno}
+fi;
+echo "$as_me:5165: result: $with_no_leaks" >&5
+echo "${ECHO_T}$with_no_leaks" >&6
+
+if test "$with_no_leaks" =3D yes ; then
+	cat >>confdefs.h <<\EOF
+#define NO_LEAKS 1
+EOF
+
+	cat >>confdefs.h <<\EOF
+#define YY_NO_LEAKS 1
+EOF
+
+fi
+
+###	output makefile
+ac_config_files=3D"$ac_config_files makefile"
+ac_config_commands=3D"$ac_config_commands default"
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems.  If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overriden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+{
+  (set) 2>&1 |
+    case `(ac_space=3D' '; set | grep ac_space) 2>&1` in
+    *ac_space=3D\ *)
+      # `set' does not quote correctly, so add quotes (double-quote
+      # substitution turns \\\\ into \\, and sed turns \\ into \).
+      sed -n \
+        "s/'/'\\\\''/g;
+    	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=3D\\(.*\\)/\\1=3D'\\2=
'/p"
+      ;;
+    *)
+      # `set' quotes correctly as required by POSIX, so do not add quotes.
+      sed -n \
+        "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=3D\\(.*\\)/\\1=3D\\=
2/p"
+      ;;
+    esac;
+} |
+  sed '
+     t clear
+     : clear
+     s/^\([^=3D]*\)=3D\(.*[{}].*\)$/test "${\1+set}" =3D set || &/
+     t end
+     /^ac_cv_env/!s/^\([^=3D]*\)=3D\(.*\)$/\1=3D${\1=3D\2}/
+     : end' >>confcache
+if cmp -s $cache_file confcache; then :; else
+  if test -w $cache_file; then
+    test "x$cache_file" !=3D "x/dev/null" && echo "updating cache $cache_f=
ile"
+    cat confcache >$cache_file
+  else
+    echo "not updating unwritable cache $cache_file"
+  fi
+fi
+rm -f confcache
+
+test "x$prefix" =3D xNONE && prefix=3D$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" =3D xNONE && exec_prefix=3D'${prefix}'
+
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @[email protected] from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" =3D x.; then
+  ac_vpsub=3D'/^[ 	]*VPATH[ 	]*=3D/{
+s/:*\$(srcdir):*/:/;
+s/:*\${srcdir}:*/:/;
+s/:*@[email protected]:*/:/;
+s/^\([^=3D]*=3D[ 	]*\):*/\1/;
+s/:*$//;
+s/^[^=3D]*=3D[ 	]*$//;
+}'
+fi
+
+DEFS=3D-DHAVE_CONFIG_H
+
+: ${CONFIG_STATUS=3D./config.status}
+ac_clean_files_save=3D$ac_clean_files
+ac_clean_files=3D"$ac_clean_files $CONFIG_STATUS"
+{ echo "$as_me:5261: creating $CONFIG_STATUS" >&5
+echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF
+#! $SHELL
+# Generated automatically by configure.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=3Dfalse
+SHELL=3D\${CONFIG_SHELL-$SHELL}
+ac_cs_invocation=3D"\$0 \[email protected]"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=3D:
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+  set -o posix
+fi
+
+# Name of the executable.
+as_me=3D`echo "$0" |sed 's,.*[\\/],,'`
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=3Dexpr
+else
+  as_expr=3Dfalse
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+  # We could just check for DJGPP; but this test a) works b) is more gener=
ic
+  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+  if test -f conf$$.exe; then
+    # Don't use ln at all; we don't have any links
+    as_ln_s=3D'cp -p'
+  else
+    as_ln_s=3D'ln -s'
+  fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s=3Dln
+else
+  as_ln_s=3D'cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+as_executable_p=3D"test -f"
+
+# Support unset when possible.
+if (FOO=3DFOO; unset FOO) >/dev/null 2>&1; then
+  as_unset=3Dunset
+else
+  as_unset=3Dfalse
+fi
+
+# NLS nuisances.
+$as_unset LANG || test "${LANG+set}" !=3D set || { LANG=3DC; export LANG; }
+$as_unset LC_ALL || test "${LC_ALL+set}" !=3D set || { LC_ALL=3DC; export =
LC_ALL; }
+$as_unset LC_TIME || test "${LC_TIME+set}" !=3D set || { LC_TIME=3DC; expo=
rt LC_TIME; }
+$as_unset LC_CTYPE || test "${LC_CTYPE+set}" !=3D set || { LC_CTYPE=3DC; e=
xport LC_CTYPE; }
+$as_unset LANGUAGE || test "${LANGUAGE+set}" !=3D set || { LANGUAGE=3DC; e=
xport LANGUAGE; }
+$as_unset LC_COLLATE || test "${LC_COLLATE+set}" !=3D set || { LC_COLLATE=
=3DC; export LC_COLLATE; }
+$as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" !=3D set || { LC_NUMERIC=
=3DC; export LC_NUMERIC; }
+$as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" !=3D set || { LC_MESSAG=
ES=3DC; export LC_MESSAGES; }
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl=3D'
+'
+IFS=3D" 	$as_nl"
+
+# CDPATH.
+$as_unset CDPATH || test "${CDPATH+set}" !=3D set || { CDPATH=3D:; export =
CDPATH; }
+
+exec 6>&1
+
+_ACEOF
+
+# Files that config.status was made for.
+if test -n "$ac_config_files"; then
+  echo "config_files=3D\"$ac_config_files\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_headers"; then
+  echo "config_headers=3D\"$ac_config_headers\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_links"; then
+  echo "config_links=3D\"$ac_config_links\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_commands"; then
+  echo "config_commands=3D\"$ac_config_commands\"" >>$CONFIG_STATUS
+fi
+
+cat >>$CONFIG_STATUS <<\EOF
+
+ac_cs_usage=3D"\
+\`$as_me' instantiates files from templates according to the
+current configuration.
+
+Usage: $0 [OPTIONS] [FILE]...
+
+  -h, --help       print this help, then exit
+  -V, --version    print version number, then exit
+  -d, --debug      don't remove temporary files
+      --recheck    update $as_me by reconfiguring in the same conditions
+  --file=3DFILE[:TEMPLATE]
+                   instantiate the configuration file FILE
+  --header=3DFILE[:TEMPLATE]
+                   instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to <dickey at invisible-island.net>."
+EOF
+
+cat >>$CONFIG_STATUS <<EOF
+ac_cs_version=3D"\\
+config.status
+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
+Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+srcdir=3D$srcdir
+INSTALL=3D"$INSTALL"
+EOF
+
+cat >>$CONFIG_STATUS <<\EOF
+# If no file are specified by the user, then we need to provide default
+# value.  By we need to know if files were specified by the user.
+ac_need_defaults=3D:
+while test $# !=3D 0
+do
+  case $1 in
+  --*=3D*)
+    ac_option=3D`expr "x$1" : 'x\([^=3D]*\)=3D'`
+    ac_optarg=3D`expr "x$1" : 'x[^=3D]*=3D\(.*\)'`
+    shift
+    set dummy "$ac_option" "$ac_optarg" ${1+"[email protected]"}
+    shift
+    ;;
+  -*);;
+  *) # This is not an option, so the user has probably given explicit
+     # arguments.
+     ac_need_defaults=3Dfalse;;
+  esac
+
+  case $1 in
+  # Handling of the options.
+EOF
+cat >>$CONFIG_STATUS <<EOF
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recurs=
ion"
+    exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
+EOF
+cat >>$CONFIG_STATUS <<\EOF
+  --version | --vers* | -V )
+    echo "$ac_cs_version"; exit 0 ;;
+  --he | --h)
+    # Conflict between --help and --header
+    { { echo "$as_me:5437: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2;}
+   { (exit 1); exit 1; }; };;
+  --help | --hel | -h )
+    echo "$ac_cs_usage"; exit 0 ;;
+  --debug | --d* | -d )
+    debug=3D: ;;
+  --file | --fil | --fi | --f )
+    shift
+    CONFIG_FILES=3D"$CONFIG_FILES $1"
+    ac_need_defaults=3Dfalse;;
+  --header | --heade | --head | --hea )
+    shift
+    CONFIG_HEADERS=3D"$CONFIG_HEADERS $1"
+    ac_need_defaults=3Dfalse;;
+
+  # This is an error.
+  -*) { { echo "$as_me:5456: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2;}
+   { (exit 1); exit 1; }; } ;;
+
+  *) ac_config_targets=3D"$ac_config_targets $1" ;;
+
+  esac
+  shift
+done
+
+exec 5>>config.log
+cat >&5 << _ACEOF
+
+## ----------------------- ##
+## Running config.status.  ##
+## ----------------------- ##
+
+This file was extended by $as_me 2.52.20101002, executed with
+  CONFIG_FILES    =3D $CONFIG_FILES
+  CONFIG_HEADERS  =3D $CONFIG_HEADERS
+  CONFIG_LINKS    =3D $CONFIG_LINKS
+  CONFIG_COMMANDS =3D $CONFIG_COMMANDS
+  > $ac_cs_invocation
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+
+_ACEOF
+EOF
+
+cat >>$CONFIG_STATUS <<\EOF
+for ac_config_target in $ac_config_targets
+do
+  case "$ac_config_target" in
+  # Handling of arguments.
+  "makefile" ) CONFIG_FILES=3D"$CONFIG_FILES makefile" ;;
+  "default" ) CONFIG_COMMANDS=3D"$CONFIG_COMMANDS default" ;;
+  "config.h" ) CONFIG_HEADERS=3D"$CONFIG_HEADERS config.h:config_h.in" ;;
+  *) { { echo "$as_me:5494: error: invalid argument: $ac_config_target" >&5
+echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+   { (exit 1); exit 1; }; };;
+  esac
+done
+
+# If the user did not use the arguments to specify the items to instantiat=
e,
+# then the envvar interface is used.  Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+  test "${CONFIG_FILES+set}" =3D set || CONFIG_FILES=3D$config_files
+  test "${CONFIG_HEADERS+set}" =3D set || CONFIG_HEADERS=3D$config_headers
+  test "${CONFIG_COMMANDS+set}" =3D set || CONFIG_COMMANDS=3D$config_comma=
nds
+fi
+
+# Create a temporary directory, and hook for its removal unless debugging.
+$debug ||
+{
+  trap 'exit_status=3D$?; rm -rf $tmp && exit $exit_status' 0
+  trap '{ (exit 1); exit 1; }' 1 2 13 15
+}
+
+# Create a (secure) tmp directory for tmp files.
+: ${TMPDIR=3D/tmp}
+{
+  tmp=3D`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
+  test -n "$tmp" && test -d "$tmp"
+}  ||
+{
+  tmp=3D$TMPDIR/cs$$-$RANDOM
+  (umask 077 && mkdir $tmp)
+} ||
+{
+   echo "$me: cannot create a temporary directory in $TMPDIR" >&2
+   { (exit 1); exit 1; }
+}
+
+EOF
+
+cat >>$CONFIG_STATUS <<EOF
+
+#
+# CONFIG_FILES section.
+#
+
+# No need to generate the scripts if there are no CONFIG_FILES.
+# This happens for instance when ./config.status config.h
+if test -n "\$CONFIG_FILES"; then
+  # Protect against being on the right side of a sed subst in config.statu=
s.
+  sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
+   s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
+s, at SHELL@,$SHELL,;t t
+s, at exec_prefix@,$exec_prefix,;t t
+s, at prefix@,$prefix,;t t
+s, at program_transform_name@,$program_transform_name,;t t
+s, at bindir@,$bindir,;t t
+s, at sbindir@,$sbindir,;t t
+s, at libexecdir@,$libexecdir,;t t
+s, at datadir@,$datadir,;t t
+s, at sysconfdir@,$sysconfdir,;t t
+s, at sharedstatedir@,$sharedstatedir,;t t
+s, at localstatedir@,$localstatedir,;t t
+s, at libdir@,$libdir,;t t
+s, at includedir@,$includedir,;t t
+s, at oldincludedir@,$oldincludedir,;t t
+s, at infodir@,$infodir,;t t
+s, at mandir@,$mandir,;t t
+s, at PACKAGE_NAME@,$PACKAGE_NAME,;t t
+s, at PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
+s, at PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
+s, at PACKAGE_STRING@,$PACKAGE_STRING,;t t
+s, at PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
+s, at build_alias@,$build_alias,;t t
+s, at host_alias@,$host_alias,;t t
+s, at target_alias@,$target_alias,;t t
+s, at ECHO_C@,$ECHO_C,;t t
+s, at ECHO_N@,$ECHO_N,;t t
+s, at ECHO_T@,$ECHO_T,;t t
+s, at PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
+s, at DEFS@,$DEFS,;t t
+s, at LIBS@,$LIBS,;t t
+s, at build@,$build,;t t
+s, at build_cpu@,$build_cpu,;t t
+s, at build_vendor@,$build_vendor,;t t
+s, at build_os@,$build_os,;t t
+s, at host@,$host,;t t
+s, at host_cpu@,$host_cpu,;t t
+s, at host_vendor@,$host_vendor,;t t
+s, at host_os@,$host_os,;t t
+s, at target@,$target,;t t
+s, at target_cpu@,$target_cpu,;t t
+s, at target_vendor@,$target_vendor,;t t
+s, at target_os@,$target_os,;t t
+s, at CC@,$CC,;t t
+s, at CFLAGS@,$CFLAGS,;t t
+s, at LDFLAGS@,$LDFLAGS,;t t
+s, at CPPFLAGS@,$CPPFLAGS,;t t
+s, at ac_ct_CC@,$ac_ct_CC,;t t
+s, at EXEEXT@,$EXEEXT,;t t
+s, at OBJEXT@,$OBJEXT,;t t
+s, at SET_MAKE@,$SET_MAKE,;t t
+s, at INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
+s, at INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
+s, at INSTALL_DATA@,$INSTALL_DATA,;t t
+s, at CTAGS@,$CTAGS,;t t
+s, at ETAGS@,$ETAGS,;t t
+s, at MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
+s, at MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
+s, at LINT@,$LINT,;t t
+s, at LINT_OPTS@,$LINT_OPTS,;t t
+s, at EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
+s, at CPP@,$CPP,;t t
+s, at EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
+s, at ECHO_LT@,$ECHO_LT,;t t
+s, at ECHO_LD@,$ECHO_LD,;t t
+s, at RULE_CC@,$RULE_CC,;t t
+s, at SHOW_CC@,$SHOW_CC,;t t
+s, at ECHO_CC@,$ECHO_CC,;t t
+s, at PROG_EXT@,$PROG_EXT,;t t
+CEOF
+
+EOF
+
+  cat >>$CONFIG_STATUS <<\EOF
+  # Split the substitutions into bite-sized pieces for seds with
+  # small command number limits, like on Digital OSF/1 and HP-UX.
+  ac_max_sed_lines=3D48
+  ac_sed_frag=3D1 # Number of current file.
+  ac_beg=3D1 # First line for current file.
+  ac_end=3D$ac_max_sed_lines # Line after last line for current file.
+  ac_more_lines=3D:
+  ac_sed_cmds=3D
+  while $ac_more_lines; do
+    if test $ac_beg -gt 1; then
+      sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+    else
+      sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+    fi
+    if test ! -s $tmp/subs.frag; then
+      ac_more_lines=3Dfalse
+    else
+      # The purpose of the label and of the branching condition is to
+      # speed up the sed processing (if there are no `@' at all, there
+      # is no need to browse any of the substitutions).
+      # These are the two extra sed commands mentioned above.
+      (echo ':t
+  /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_=
frag.sed
+      if test -z "$ac_sed_cmds"; then
+  	ac_sed_cmds=3D"sed -f $tmp/subs-$ac_sed_frag.sed"
+      else
+  	ac_sed_cmds=3D"$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
+      fi
+      ac_sed_frag=3D`expr $ac_sed_frag + 1`
+      ac_beg=3D$ac_end
+      ac_end=3D`expr $ac_end + $ac_max_sed_lines`
+    fi
+  done
+  if test -z "$ac_sed_cmds"; then
+    ac_sed_cmds=3Dcat
+  fi
+fi # test -n "$CONFIG_FILES"
+
+EOF
+cat >>$CONFIG_STATUS <<\EOF
+for ac_file in : $CONFIG_FILES; do test "x$ac_file" =3D x: && continue
+  # Support "outfile[:infile[:infile...]]", defaulting infile=3D"outfile.i=
n".
+  case $ac_file in
+  - | *:- | *:-:* ) # input from stdin
+        cat >$tmp/stdin
+        ac_file_in=3D`echo "$ac_file" | sed 's,[^:]*:,,'`
+        ac_file=3D`echo "$ac_file" | sed 's,:.*,,'` ;;
+  *:* ) ac_file_in=3D`echo "$ac_file" | sed 's,[^:]*:,,'`
+        ac_file=3D`echo "$ac_file" | sed 's,:.*,,'` ;;
+  * )   ac_file_in=3D$ac_file.in ;;
+  esac
+
+  # Compute @[email protected], @[email protected], and @[email protected] for subdirectories.
+  ac_dir=3D`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+         X"$ac_file" : 'X\(//\)[^/]' \| \
+         X"$ac_file" : 'X\(//\)$' \| \
+         X"$ac_file" : 'X\(/\)' \| \
+         .     : '\(.\)' 2>/dev/null ||
+echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+  if test "$ac_dir" !=3D "$ac_file" && test "$ac_dir" !=3D .; then
+    { case "$ac_dir" in
+  [\\/]* | ?:[\\/]* ) as_incr_dir=3D;;
+  *)                      as_incr_dir=3D.;;
+esac
+as_dummy=3D"$ac_dir"
+for as_mkdir_dir in `IFS=3D'/\\'; set X $as_dummy; shift; echo "[email protected]"`; do
+  case $as_mkdir_dir in
+    # Skip DOS drivespec
+    ?:) as_incr_dir=3D$as_mkdir_dir ;;
+    *)
+      as_incr_dir=3D$as_incr_dir/$as_mkdir_dir
+      test -d "$as_incr_dir" || mkdir "$as_incr_dir"
+    ;;
+  esac
+done; }
+
+    ac_dir_suffix=3D"/`echo $ac_dir|sed 's,^\./,,'`"
+    # A "../" for each directory in $ac_dir_suffix.
+    ac_dots=3D`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
+  else
+    ac_dir_suffix=3D ac_dots=3D
+  fi
+
+  case $srcdir in
+  .)  ac_srcdir=3D.
+      if test -z "$ac_dots"; then
+         ac_top_srcdir=3D.
+      else
+         ac_top_srcdir=3D`echo $ac_dots | sed 's,/$,,'`
+      fi ;;
+  [\\/]* | ?:[\\/]* )
+      ac_srcdir=3D$srcdir$ac_dir_suffix;
+      ac_top_srcdir=3D$srcdir ;;
+  *) # Relative path.
+    ac_srcdir=3D$ac_dots$srcdir$ac_dir_suffix
+    ac_top_srcdir=3D$ac_dots$srcdir ;;
+  esac
+
+  case $INSTALL in
+  [\\/$]* | ?:[\\/]* ) ac_INSTALL=3D$INSTALL ;;
+  *) ac_INSTALL=3D$ac_dots$INSTALL ;;
+  esac
+
+  if test x"$ac_file" !=3D x-; then
+    { echo "$as_me:5728: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+    rm -f "$ac_file"
+  fi
+  # Let's still pretend it is `configure' which instantiates (i.e., don't
+  # use $as_me), people would be surprised to read:
+  #    /* config.h.  Generated automatically by config.status.  */
+  configure_input=3D"Generated automatically from `echo $ac_file_in |
+                                                 sed 's,.*/,,'` by configu=
re."
+
+  # First look for the input files in the build tree, otherwise in the
+  # src tree.
+  ac_file_inputs=3D`IFS=3D:
+    for f in $ac_file_in; do
+      case $f in
+      -) echo $tmp/stdin ;;
+      [\\/$]*)
+         # Absolute (can't be DOS-style, as IFS=3D:)
+         test -f "$f" || { { echo "$as_me:5746: error: cannot find input f=
ile: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+   { (exit 1); exit 1; }; }
+         echo $f;;
+      *) # Relative
+         if test -f "$f"; then
+           # Build tree
+           echo $f
+         elif test -f "$srcdir/$f"; then
+           # Source tree
+           echo $srcdir/$f
+         else
+           # /dev/null tree
+           { { echo "$as_me:5759: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+   { (exit 1); exit 1; }; }
+         fi;;
+      esac
+    done` || { (exit 1); exit 1; }
+EOF
+cat >>$CONFIG_STATUS <<EOF
+  sed "$ac_vpsub
+$extrasub
+EOF
+cat >>$CONFIG_STATUS <<\EOF
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s, at configure_input@,$configure_input,;t t
+s, at srcdir@,$ac_srcdir,;t t
+s, at top_srcdir@,$ac_top_srcdir,;t t
+s, at INSTALL@,$ac_INSTALL,;t t
+" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
+  rm -f $tmp/stdin
+  if test x"$ac_file" !=3D x-; then
+    mv $tmp/out $ac_file
+  else
+    cat $tmp/out
+    rm -f $tmp/out
+  fi
+
+done
+EOF
+cat >>$CONFIG_STATUS <<\EOF
+
+#
+# CONFIG_HEADER section.
+#
+
+# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
+# NAME is the cpp macro being defined and VALUE is the value it is being g=
iven.
+#
+# ac_d sets the value in "#define NAME VALUE" lines.
+ac_dA=3D's,^\([ 	]*\)#\([ 	]*define[ 	][ 	]*\)'
+ac_dB=3D'[ 	].*$,\1#\2'
+ac_dC=3D' '
+ac_dD=3D',;t'
+# ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
+ac_iA=3D's,^\([ 	]*\)#\([ 	]*\)undef\([ 	][ 	]*\)'
+ac_iB=3D'\([ 	]\),\1#\2define\3'
+ac_iC=3D' '
+ac_iD=3D'\4,;t'
+# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALU=
E".
+ac_uA=3D's,^\([ 	]*\)#\([ 	]*\)undef\([ 	][ 	]*\)'
+ac_uB=3D'$,\1#\2define\3'
+ac_uC=3D' '
+ac_uD=3D',;t'
+
+for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" =3D x: && continue
+  # Support "outfile[:infile[:infile...]]", defaulting infile=3D"outfile.i=
n".
+  case $ac_file in
+  - | *:- | *:-:* ) # input from stdin
+        cat >$tmp/stdin
+        ac_file_in=3D`echo "$ac_file" | sed 's,[^:]*:,,'`
+        ac_file=3D`echo "$ac_file" | sed 's,:.*,,'` ;;
+  *:* ) ac_file_in=3D`echo "$ac_file" | sed 's,[^:]*:,,'`
+        ac_file=3D`echo "$ac_file" | sed 's,:.*,,'` ;;
+  * )   ac_file_in=3D$ac_file.in ;;
+  esac
+
+  test x"$ac_file" !=3D x- && { echo "$as_me:5825: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+
+  # First look for the input files in the build tree, otherwise in the
+  # src tree.
+  ac_file_inputs=3D`IFS=3D:
+    for f in $ac_file_in; do
+      case $f in
+      -) echo $tmp/stdin ;;
+      [\\/$]*)
+         # Absolute (can't be DOS-style, as IFS=3D:)
+         test -f "$f" || { { echo "$as_me:5836: error: cannot find input f=
ile: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+   { (exit 1); exit 1; }; }
+         echo $f;;
+      *) # Relative
+         if test -f "$f"; then
+           # Build tree
+           echo $f
+         elif test -f "$srcdir/$f"; then
+           # Source tree
+           echo $srcdir/$f
+         else
+           # /dev/null tree
+           { { echo "$as_me:5849: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+   { (exit 1); exit 1; }; }
+         fi;;
+      esac
+    done` || { (exit 1); exit 1; }
+  # Remove the trailing spaces.
+  sed 's/[ 	]*$//' $ac_file_inputs >$tmp/in
+
+EOF
+
+# Transform confdefs.h into a list of #define's.  We won't use it as a sed
+# script, but as data to insert where we see @DEFS at .  We expect AC_SAVE_DE=
FS to
+# be either 'cat' or 'sort'.
+cat confdefs.h | uniq >conftest.vals
+
+# Break up conftest.vals because some shells have a limit on
+# the size of here documents, and old seds have small limits too.
+
+rm -f conftest.tail
+echo '  rm -f conftest.frag' >> $CONFIG_STATUS
+while grep . conftest.vals >/dev/null
+do
+  # Write chunks of a limited-size here document to conftest.frag.
+  echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
+  sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> =
$CONFIG_STATUS
+  echo 'CEOF' >> $CONFIG_STATUS
+  sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
+  rm -f conftest.vals
+  mv conftest.tail conftest.vals
+done
+rm -f conftest.vals
+
+# Run sed to substitute the contents of conftest.frag into $tmp/in at the
+# marker @DEFS at .
+echo '  cat >> conftest.edit <<CEOF
+/@[email protected]/r conftest.frag
+/@[email protected]/d
+CEOF
+sed -f conftest.edit $tmp/in > $tmp/out
+rm -f $tmp/in
+mv $tmp/out $tmp/in
+rm -f conftest.edit conftest.frag
+' >> $CONFIG_STATUS
+
+cat >>$CONFIG_STATUS <<\EOF
+  # Let's still pretend it is `configure' which instantiates (i.e., don't
+  # use $as_me), people would be surprised to read:
+  #    /* config.h.  Generated automatically by config.status.  */
+  if test x"$ac_file" =3D x-; then
+    echo "/* Generated automatically by configure.  */" >$tmp/config.h
+  else
+    echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/c=
onfig.h
+  fi
+  cat $tmp/in >>$tmp/config.h
+  rm -f $tmp/in
+  if test x"$ac_file" !=3D x-; then
+    if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
+      { echo "$as_me:5907: $ac_file is unchanged" >&5
+echo "$as_me: $ac_file is unchanged" >&6;}
+    else
+      ac_dir=3D`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+         X"$ac_file" : 'X\(//\)[^/]' \| \
+         X"$ac_file" : 'X\(//\)$' \| \
+         X"$ac_file" : 'X\(/\)' \| \
+         .     : '\(.\)' 2>/dev/null ||
+echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+      if test "$ac_dir" !=3D "$ac_file" && test "$ac_dir" !=3D .; then
+        { case "$ac_dir" in
+  [\\/]* | ?:[\\/]* ) as_incr_dir=3D;;
+  *)                      as_incr_dir=3D.;;
+esac
+as_dummy=3D"$ac_dir"
+for as_mkdir_dir in `IFS=3D'/\\'; set X $as_dummy; shift; echo "[email protected]"`; do
+  case $as_mkdir_dir in
+    # Skip DOS drivespec
+    ?:) as_incr_dir=3D$as_mkdir_dir ;;
+    *)
+      as_incr_dir=3D$as_incr_dir/$as_mkdir_dir
+      test -d "$as_incr_dir" || mkdir "$as_incr_dir"
+    ;;
+  esac
+done; }
+
+      fi
+      rm -f $ac_file
+      mv $tmp/config.h $ac_file
+    fi
+  else
+    cat $tmp/config.h
+    rm -f $tmp/config.h
+  fi
+done
+EOF
+
+cat >>$CONFIG_STATUS <<\EOF
+
+{ (exit 0); exit 0; }
+EOF
+chmod +x $CONFIG_STATUS
+ac_clean_files=3D$ac_clean_files_save
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded.  So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status.  When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" !=3D yes; then
+  ac_cs_success=3D:
+  exec 5>/dev/null
+  $SHELL $CONFIG_STATUS || ac_cs_success=3Dfalse
+  exec 5>>config.log
+  # Use ||, not &&, to avoid exiting from the if with $? =3D 1, which
+  # would make configure fail if this is the last instruction.
+  $ac_cs_success || { (exit 1); exit 1; }
+fi
+
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/configure.in
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/configure.in	Wed Jul 25 16:21:35 2012 +0300
@@ -0,0 +1,30 @@
+dnl Process this file with 'autoconf' to produce a 'configure' script
+dnl $Id: configure.in,v 1.10 2010/12/26 19:10:21 tom Exp $
+AC_PREREQ(2.13.20020210)
+AC_REVISION($Revision: 1.10 $)
+AC_INIT(main.c)
+AC_CONFIG_HEADER(config.h:config_h.in)
+
+CF_CHECK_CACHE([AC_CANONICAL_SYSTEM])
+
+AC_ARG_PROGRAM
+AC_PROG_CC
+AC_CONST
+AC_PROG_MAKE_SET
+AC_PROG_INSTALL
+CF_MAKE_TAGS
+CF_PROG_LINT
+
+CF_ANSI_CC_REQD
+CF_XOPEN_SOURCE
+AC_CHECK_HEADERS(fcntl.h)
+AC_CHECK_FUNCS(atexit)
+CF_MKSTEMP
+
+CF_WITH_WARNINGS(Wwrite-strings)
+CF_DISABLE_ECHO
+CF_PROG_EXT
+CF_DISABLE_LEAKS
+
+###	output makefile
+AC_OUTPUT(makefile,,,cat)
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/defs.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/defs.h	Wed Jul 25 16:21:35 2012 +0300
@@ -0,0 +1,438 @@
+/* $Id: defs.h,v 1.36 2011/12/20 01:31:16 tom Exp $ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <assert.h>
+#include <ctype.h>
+#include <stdio.h>
+
+#define YYMAJOR 1
+#define YYMINOR 9
+
+#define CONCAT(first,second)    first #second
+#define CONCAT1(string,number)  CONCAT(string, number)
+#define CONCAT2(first,second)   #first "." #second
+
+#ifdef YYPATCH
+#define VSTRING(a,b) CONCAT2(a,b) CONCAT1(" ",YYPATCH)
+#else
+#define VSTRING(a,b) CONCAT2(a,b)
+#endif
+
+#define VERSION VSTRING(YYMAJOR, YYMINOR)
+
+/*  machine-dependent definitions			*/
+/*  the following definitions are for the Tahoe		*/
+/*  they might have to be changed for other machines	*/
+
+/*  MAXCHAR is the largest unsigned character value	*/
+/*  MAXSHORT is the largest value of a C short		*/
+/*  MINSHORT is the most negative value of a C short	*/
+/*  MAXTABLE is the maximum table size			*/
+/*  BITS_PER_WORD is the number of bits in a C unsigned	*/
+/*  WORDSIZE computes the number of words needed to	*/
+/*	store n bits					*/
+/*  BIT returns the value of the n-th bit starting	*/
+/*	from r (0-indexed)				*/
+/*  SETBIT sets the n-th bit starting from r		*/
+
+#define	MAXCHAR		255
+#define	MAXSHORT	32767
+#define MINSHORT	-32768
+#define MAXTABLE	32500
+#define BITS_PER_WORD	32
+#define	WORDSIZE(n)	(((n)+(BITS_PER_WORD-1))/BITS_PER_WORD)
+#define	BIT(r, n)	((((r)[(n)>>5])>>((n)&31))&1)
+#define	SETBIT(r, n)	((r)[(n)>>5]|=3D((unsigned)1<<((n)&31)))
+
+/*  character names  */
+
+#define	NUL		'\0'	/*  the null character  */
+#define	NEWLINE		'\n'	/*  line feed  */
+#define	SP		' '	/*  space  */
+#define	BS		'\b'	/*  backspace  */
+#define	HT		'\t'	/*  horizontal tab  */
+#define	VT		'\013'	/*  vertical tab  */
+#define	CR		'\r'	/*  carriage return  */
+#define	FF		'\f'	/*  form feed  */
+#define	QUOTE		'\''	/*  single quote  */
+#define	DOUBLE_QUOTE	'\"'	/*  double quote  */
+#define	BACKSLASH	'\\'	/*  backslash  */
+
+#define UCH(c)          (unsigned char)(c)
+
+/* defines for constructing filenames */
+
+#if defined(VMS)
+#define CODE_SUFFIX	"_code.c"
+#define	DEFINES_SUFFIX	"_tab.h"
+#define	EXTERNS_SUFFIX	"_tab.i"
+#define	OUTPUT_SUFFIX	"_tab.c"
+#else
+#define CODE_SUFFIX	".code.c"
+#define	DEFINES_SUFFIX	".tab.h"
+#define	EXTERNS_SUFFIX	".tab.i"
+#define	OUTPUT_SUFFIX	".tab.c"
+#endif
+#define	VERBOSE_SUFFIX	".output"
+#define GRAPH_SUFFIX    ".dot"
+
+/* keyword codes */
+
+#define TOKEN 0
+#define LEFT 1
+#define RIGHT 2
+#define NONASSOC 3
+#define MARK 4
+#define TEXT 5
+#define TYPE 6
+#define START 7
+#define UNION 8
+#define IDENT 9
+#define EXPECT 10
+#define EXPECT_RR 11
+#define PURE_PARSER 12
+#define PARSE_PARAM 13
+#define LEX_PARAM 14
+#define POSIX_YACC 15
+
+/*  symbol classes  */
+
+#define UNKNOWN 0
+#define TERM 1
+#define NONTERM 2
+
+/*  the undefined value  */
+
+#define UNDEFINED (-1)
+
+/*  action codes  */
+
+#define SHIFT 1
+#define REDUCE 2
+
+/*  character macros  */
+
+#define IS_IDENT(c)	(isalnum(c) || (c) =3D=3D '_' || (c) =3D=3D '.' || (c)=
 =3D=3D '$')
+#define	IS_OCTAL(c)	((c) >=3D '0' && (c) <=3D '7')
+#define	NUMERIC_VALUE(c)	((c) - '0')
+
+/*  symbol macros  */
+
+#define ISTOKEN(s)	((s) < start_symbol)
+#define ISVAR(s)	((s) >=3D start_symbol)
+
+/*  storage allocation macros  */
+
+#define CALLOC(k,n)	(calloc((size_t)(k),(size_t)(n)))
+#define	FREE(x)		(free((char*)(x)))
+#define MALLOC(n)	(malloc((size_t)(n)))
+#define	NEW(t)		((t*)allocate(sizeof(t)))
+#define	NEW2(n,t)	((t*)allocate(((size_t)(n)*sizeof(t))))
+#define REALLOC(p,n)	(realloc((char*)(p),(size_t)(n)))
+
+#define DO_FREE(x)	if (x) { FREE(x); x =3D 0; }
+
+#define NO_SPACE(p)	if (p =3D=3D 0) no_space(); assert(p !=3D 0)
+
+/* messages */
+#define PLURAL(n) ((n) > 1 ? "s" : "")
+
+typedef char Assoc_t;
+typedef char Class_t;
+typedef short Index_t;
+typedef short Value_t;
+
+/*  the structure of a symbol table entry  */
+
+typedef struct bucket bucket;
+struct bucket
+{
+    struct bucket *link;
+    struct bucket *next;
+    char *name;
+    char *tag;
+    Value_t value;
+    Index_t index;
+    Value_t prec;
+    Class_t class;
+    Assoc_t assoc;
+};
+
+/*  the structure of the LR(0) state machine  */
+
+typedef struct core core;
+struct core
+{
+    struct core *next;
+    struct core *link;
+    Value_t number;
+    Value_t accessing_symbol;
+    Value_t nitems;
+    Value_t items[1];
+};
+
+/*  the structure used to record shifts  */
+
+typedef struct shifts shifts;
+struct shifts
+{
+    struct shifts *next;
+    Value_t number;
+    Value_t nshifts;
+    Value_t shift[1];
+};
+
+/*  the structure used to store reductions  */
+
+typedef struct reductions reductions;
+struct reductions
+{
+    struct reductions *next;
+    Value_t number;
+    Value_t nreds;
+    Value_t rules[1];
+};
+
+/*  the structure used to represent parser actions  */
+
+typedef struct action action;
+struct action
+{
+    struct action *next;
+    Value_t symbol;
+    Value_t number;
+    Value_t prec;
+    char action_code;
+    Assoc_t assoc;
+    char suppressed;
+};
+
+/*  the structure used to store parse/lex parameters  */
+typedef struct param param;
+struct param
+{
+    struct param *next;
+    char *name;		/* parameter name */
+    char *type;		/* everything before parameter name */
+    char *type2;	/* everything after parameter name */
+};
+
+/* global variables */
+
+extern char dflag;
+extern char gflag;
+extern char iflag;
+extern char lflag;
+extern char rflag;
+extern char sflag;
+extern char tflag;
+extern char vflag;
+extern const char *symbol_prefix;
+
+extern const char *myname;
+extern char *cptr;
+extern char *line;
+extern int lineno;
+extern int outline;
+extern int exit_code;
+
+extern const char *const banner[];
+extern const char *const xdecls[];
+extern const char *const tables[];
+extern const char *const global_vars[];
+extern const char *const impure_vars[];
+extern const char *const hdr_defs[];
+extern const char *const hdr_vars[];
+extern const char *const body_1[];
+extern const char *const body_vars[];
+extern const char *const body_2[];
+extern const char *const body_3[];
+extern const char *const trailer[];
+extern 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;
+extern FILE *union_file;
+extern FILE *verbose_file;
+extern FILE *graph_file;
+
+extern int nitems;
+extern int nrules;
+extern int nsyms;
+extern int ntokens;
+extern int nvars;
+extern int ntags;
+
+extern char unionized;
+extern char line_format[];
+
+extern Value_t start_symbol;
+extern char **symbol_name;
+extern char **symbol_pname;
+extern Value_t *symbol_value;
+extern Value_t *symbol_prec;
+extern char *symbol_assoc;
+
+extern Value_t *ritem;
+extern Value_t *rlhs;
+extern Value_t *rrhs;
+extern Value_t *rprec;
+extern Assoc_t *rassoc;
+
+extern Value_t **derives;
+extern char *nullable;
+
+extern bucket *first_symbol;
+extern bucket *last_symbol;
+
+extern int pure_parser;
+extern int nstates;
+extern core *first_state;
+extern shifts *first_shift;
+extern reductions *first_reduction;
+extern Value_t *accessing_symbol;
+extern core **state_table;
+extern shifts **shift_table;
+extern reductions **reduction_table;
+extern unsigned *LA;
+extern Value_t *LAruleno;
+extern Value_t *lookaheads;
+extern Value_t *goto_map;
+extern Value_t *from_state;
+extern Value_t *to_state;
+
+extern action **parser;
+extern int SRexpect;
+extern int RRexpect;
+extern int SRtotal;
+extern int RRtotal;
+extern Value_t *SRconflicts;
+extern Value_t *RRconflicts;
+extern Value_t *defred;
+extern Value_t *rules_used;
+extern Value_t nunused;
+extern Value_t final_state;
+
+extern Value_t *itemset;
+extern Value_t *itemsetend;
+extern unsigned *ruleset;
+
+extern param *lex_param;
+extern param *parse_param;
+
+/* global functions */
+
+extern bucket *lookup(const char *);
+extern bucket *make_bucket(const char *);
+
+#ifndef GCC_NORETURN
+#define GCC_NORETURN		/* nothing */
+#endif
+
+#ifndef GCC_UNUSED
+#define GCC_UNUSED		/* nothing */
+#endif
+
+/* closure.c */
+extern void closure(Value_t * nucleus, int n);
+extern void finalize_closure(void);
+extern void set_first_derives(void);
+
+/* error.c */
+extern void default_action_warning(void);
+extern void dollar_error(int a_lineno, char *a_line, char *a_cptr) GCC_NOR=
ETURN;
+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_NORE=
TURN;
+extern void missing_brace(void) GCC_NORETURN;
+extern void no_grammar(void) GCC_NORETURN;
+extern void no_space(void) GCC_NORETURN;
+extern void open_error(const char *filename) GCC_NORETURN;
+extern void over_unionized(char *u_cptr) GCC_NORETURN;
+extern void prec_redeclared(void);
+extern void reprec_warning(char *s);
+extern void restarted_warning(void);
+extern void retyped_warning(char *s);
+extern void revalued_warning(char *s);
+extern void syntax_error(int st_lineno, char *st_line, char *st_cptr) GCC_=
NORETURN;
+extern void terminal_lhs(int s_lineno) GCC_NORETURN;
+extern void terminal_start(char *s) GCC_NORETURN;
+extern void tokenized_start(char *s) GCC_NORETURN;
+extern void undefined_goal(char *s) GCC_NORETURN;
+extern void undefined_symbol_warning(char *s);
+extern void unexpected_EOF(void) GCC_NORETURN;
+extern void unknown_rhs(int i) GCC_NORETURN;
+extern void unterminated_action(int a_lineno, char *a_line, char *a_cptr) =
GCC_NORETURN;
+extern void unterminated_comment(int c_lineno, char *c_line, char *c_cptr)=
 GCC_NORETURN;
+extern void unterminated_string(int s_lineno, char *s_line, char *s_cptr) =
GCC_NORETURN;
+extern void unterminated_text(int t_lineno, char *t_line, char *t_cptr) GC=
C_NORETURN;
+extern void unterminated_union(int u_lineno, char *u_line, char *u_cptr) G=
CC_NORETURN;
+extern void untyped_lhs(void) GCC_NORETURN;
+extern void untyped_rhs(int i, char *s) GCC_NORETURN;
+extern void used_reserved(char *s) GCC_NORETURN;
+
+/* graph.c */
+extern void graph(void);
+
+/* lalr.c */
+extern void create_symbol_table(void);
+extern void free_symbol_table(void);
+extern void free_symbols(void);
+
+/* lalr.c */
+extern void lalr(void);
+
+/* lr0.c */
+extern void lr0(void);
+extern void show_cores(void);
+extern void show_ritems(void);
+extern void show_rrhs(void);
+extern void show_shifts(void);
+
+/* main.c */
+extern void *allocate(size_t n);
+extern void done(int k) GCC_NORETURN;
+
+/* mkpar.c */
+extern void free_parser(void);
+extern void make_parser(void);
+
+/* output.c */
+extern void output(void);
+
+/* reader.c */
+extern void reader(void);
+
+/* skeleton.c */
+extern void write_section(FILE *fp, const char *const section[]);
+
+/* verbose.c */
+extern void verbose(void);
+
+/* warshall.c */
+extern void reflexive_transitive_closure(unsigned *R, int n);
+
+#ifdef NO_LEAKS
+extern void lr0_leaks(void);
+extern void lalr_leaks(void);
+extern void mkpar_leaks(void);
+extern void output_leaks(void);
+extern void reader_leaks(void);
+#endif
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/descrip.mms
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/descrip.mms	Wed Jul 25 16:21:35 2012 +0300
@@ -0,0 +1,37 @@
+CFLAGS =3D /decc $(CC_OPTIONS)/Diagnostics /Define=3D(NDEBUG) /[email protected]=
 /Include=3D([])
+
+LINKFLAGS	=3D /map=3D$(MMS$TARGET_NAME)/cross_reference/exec=3D$(MMS$TARGE=
T_NAME).exe
+
+LINKER	      =3D cc
+
+OBJS	      =3D closure.obj, \
+		error.obj, \
+		lalr.obj, \
+		lr0.obj, \
+		main.obj, \
+		mkpar.obj, \
+		output.obj, \
+		reader.obj, \
+		skeleton.obj, \
+		symtab.obj, \
+		verbose.obj, \
+		warshall.obj
+
+PROGRAM	      =3D yacc.exe
+
+all :		$(PROGRAM)
+
+$(PROGRAM) :     $(OBJS)
+	@ write sys$output "Loading $(PROGRAM) ... "
+	@ $(LINK) $(LINKFLAGS) $(OBJS)
+	@ write sys$output "done"
+
+clean :
+	@- if f$search("*.obj") .nes. "" then delete *.obj;*
+	@- if f$search("*.lis") .nes. "" then delete *.lis;*
+	@- if f$search("*.log") .nes. "" then delete *.log;*
+
+clobber :	clean
+	@- if f$search("*.exe") .nes. "" then delete *.exe;*
+
+$(OBJS) : defs.h
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/error.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/error.c	Wed Jul 25 16:21:35 2012 +0300
@@ -0,0 +1,288 @@
+/* $Id: error.c,v 1.9 2011/09/05 23:27:43 tom Exp $ */
+
+/* routines for printing error messages  */
+
+#include "defs.h"
+
+void
+fatal(const char *msg)
+{
+    fprintf(stderr, "%s: f - %s\n", myname, msg);
+    done(2);
+}
+
+void
+no_space(void)
+{
+    fprintf(stderr, "%s: f - out of space\n", myname);
+    done(2);
+}
+
+void
+open_error(const char *filename)
+{
+    fprintf(stderr, "%s: f - cannot open \"%s\"\n", myname, filename);
+    done(2);
+}
+
+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",
+	    myname, lineno, input_file_name);
+    done(1);
+}
+
+static void
+print_pos(char *st_line, char *st_cptr)
+{
+    char *s;
+
+    if (st_line =3D=3D 0)
+	return;
+    for (s =3D st_line; *s !=3D '\n'; ++s)
+    {
+	if (isprint(UCH(*s)) || *s =3D=3D '\t')
+	    putc(*s, stderr);
+	else
+	    putc('?', stderr);
+    }
+    putc('\n', stderr);
+    for (s =3D st_line; s < st_cptr; ++s)
+    {
+	if (*s =3D=3D '\t')
+	    putc('\t', stderr);
+	else
+	    putc(' ', stderr);
+    }
+    putc('^', stderr);
+    putc('\n', stderr);
+}
+
+void
+syntax_error(int st_lineno, char *st_line, char *st_cptr)
+{
+    fprintf(stderr, "%s: e - line %d of \"%s\", syntax error\n",
+	    myname, st_lineno, input_file_name);
+    print_pos(st_line, st_cptr);
+    done(1);
+}
+
+void
+unterminated_comment(int c_lineno, char *c_line, char *c_cptr)
+{
+    fprintf(stderr, "%s: e - line %d of \"%s\", unmatched /*\n",
+	    myname, c_lineno, input_file_name);
+    print_pos(c_line, c_cptr);
+    done(1);
+}
+
+void
+unterminated_string(int s_lineno, char *s_line, char *s_cptr)
+{
+    fprintf(stderr, "%s: e - line %d of \"%s\", unterminated string\n",
+	    myname, s_lineno, input_file_name);
+    print_pos(s_line, s_cptr);
+    done(1);
+}
+
+void
+unterminated_text(int t_lineno, char *t_line, char *t_cptr)
+{
+    fprintf(stderr, "%s: e - line %d of \"%s\", unmatched %%{\n",
+	    myname, t_lineno, input_file_name);
+    print_pos(t_line, t_cptr);
+    done(1);
+}
+
+void
+unterminated_union(int u_lineno, char *u_line, char *u_cptr)
+{
+    fprintf(stderr, "%s: e - line %d of \"%s\", unterminated %%union \
+declaration\n", myname, u_lineno, input_file_name);
+    print_pos(u_line, u_cptr);
+    done(1);
+}
+
+void
+over_unionized(char *u_cptr)
+{
+    fprintf(stderr, "%s: e - line %d of \"%s\", too many %%union \
+declarations\n", myname, lineno, input_file_name);
+    print_pos(line, u_cptr);
+    done(1);
+}
+
+void
+illegal_tag(int t_lineno, char *t_line, char *t_cptr)
+{
+    fprintf(stderr, "%s: e - line %d of \"%s\", illegal tag\n",
+	    myname, t_lineno, input_file_name);
+    print_pos(t_line, t_cptr);
+    done(1);
+}
+
+void
+illegal_character(char *c_cptr)
+{
+    fprintf(stderr, "%s: e - line %d of \"%s\", illegal character\n",
+	    myname, lineno, input_file_name);
+    print_pos(line, c_cptr);
+    done(1);
+}
+
+void
+used_reserved(char *s)
+{
+    fprintf(stderr,
+	    "%s: e - line %d of \"%s\", illegal use of reserved symbol \
+%s\n", myname, lineno, input_file_name, s);
+    done(1);
+}
+
+void
+tokenized_start(char *s)
+{
+    fprintf(stderr,
+	    "%s: e - line %d of \"%s\", the start symbol %s cannot be \
+declared to be a token\n", myname, lineno, input_file_name, s);
+    done(1);
+}
+
+void
+retyped_warning(char *s)
+{
+    fprintf(stderr, "%s: w - line %d of \"%s\", the type of %s has been \
+redeclared\n", myname, lineno, input_file_name, s);
+}
+
+void
+reprec_warning(char *s)
+{
+    fprintf(stderr,
+	    "%s: w - line %d of \"%s\", the precedence of %s has been \
+redeclared\n", myname, lineno, input_file_name, s);
+}
+
+void
+revalued_warning(char *s)
+{
+    fprintf(stderr, "%s: w - line %d of \"%s\", the value of %s has been \
+redeclared\n", myname, lineno, input_file_name, s);
+}
+
+void
+terminal_start(char *s)
+{
+    fprintf(stderr, "%s: e - line %d of \"%s\", the start symbol %s is a \
+token\n", myname, lineno, input_file_name, s);
+    done(1);
+}
+
+void
+restarted_warning(void)
+{
+    fprintf(stderr, "%s: w - line %d of \"%s\", the start symbol has been \
+redeclared\n", myname, lineno, input_file_name);
+}
+
+void
+no_grammar(void)
+{
+    fprintf(stderr, "%s: e - line %d of \"%s\", no grammar has been \
+specified\n", myname, lineno, input_file_name);
+    done(1);
+}
+
+void
+terminal_lhs(int s_lineno)
+{
+    fprintf(stderr, "%s: e - line %d of \"%s\", a token appears on the lhs=
 \
+of a production\n", myname, s_lineno, input_file_name);
+    done(1);
+}
+
+void
+prec_redeclared(void)
+{
+    fprintf(stderr, "%s: w - line %d of  \"%s\", conflicting %%prec \
+specifiers\n", myname, lineno, input_file_name);
+}
+
+void
+unterminated_action(int a_lineno, char *a_line, char *a_cptr)
+{
+    fprintf(stderr, "%s: e - line %d of \"%s\", unterminated action\n",
+	    myname, a_lineno, input_file_name);
+    print_pos(a_line, a_cptr);
+    done(1);
+}
+
+void
+dollar_warning(int a_lineno, int i)
+{
+    fprintf(stderr, "%s: w - line %d of \"%s\", $%d references beyond the \
+end of the current rule\n", myname, a_lineno, input_file_name, i);
+}
+
+void
+dollar_error(int a_lineno, char *a_line, char *a_cptr)
+{
+    fprintf(stderr, "%s: e - line %d of \"%s\", illegal $-name\n",
+	    myname, a_lineno, input_file_name);
+    print_pos(a_line, a_cptr);
+    done(1);
+}
+
+void
+untyped_lhs(void)
+{
+    fprintf(stderr, "%s: e - line %d of \"%s\", $$ is untyped\n",
+	    myname, lineno, input_file_name);
+    done(1);
+}
+
+void
+untyped_rhs(int i, char *s)
+{
+    fprintf(stderr, "%s: e - line %d of \"%s\", $%d (%s) is untyped\n",
+	    myname, lineno, input_file_name, i, s);
+    done(1);
+}
+
+void
+unknown_rhs(int i)
+{
+    fprintf(stderr, "%s: e - line %d of \"%s\", $%d is untyped\n",
+	    myname, lineno, input_file_name, i);
+    done(1);
+}
+
+void
+default_action_warning(void)
+{
+    fprintf(stderr,
+	    "%s: w - line %d of \"%s\", the default action assigns an \
+undefined value to $$\n", myname, lineno, input_file_name);
+}
+
+void
+undefined_goal(char *s)
+{
+    fprintf(stderr, "%s: e - the start symbol %s is undefined\n", myname, =
s);
+    done(1);
+}
+
+void
+undefined_symbol_warning(char *s)
+{
+    fprintf(stderr, "%s: w - the symbol %s is undefined\n", myname, s);
+}
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/graph.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/graph.c	Wed Jul 25 16:21:35 2012 +0300
@@ -0,0 +1,112 @@
+/* $Id: graph.c,v 1.7 2009/10/27 09:25:20 tom Exp $ */
+
+#include "defs.h"
+
+static void graph_state(int stateno);
+static void graph_LA(int ruleno);
+
+static unsigned int larno;
+
+void
+graph(void)
+{
+    int i;
+    int j;
+    shifts *sp;
+    int sn;
+    int as;
+
+    if (!gflag)
+	return;
+
+    for (i =3D 0; i < nstates; ++i)
+    {
+	closure(state_table[i]->items, state_table[i]->nitems);
+	graph_state(i);
+    }
+
+    fprintf(graph_file, "\n\n");
+    for (i =3D 0; i < nstates; ++i)
+    {
+
+	sp =3D shift_table[i];
+	if (sp)
+	    for (j =3D 0; j < sp->nshifts; ++j)
+	    {
+		sn =3D sp->shift[j];
+		as =3D accessing_symbol[sn];
+		fprintf(graph_file,
+			"\tq%d -> q%d [label=3D\"%s\"];\n",
+			i, sn, symbol_pname[as]);
+	    }
+    }
+
+    fprintf(graph_file, "}\n");
+
+    for (i =3D 0; i < nsyms; ++i)
+	FREE(symbol_pname[i]);
+    FREE(symbol_pname);
+}
+
+static void
+graph_state(int stateno)
+{
+    short *isp;
+    int rule;
+    short *sp;
+    short *sp1;
+
+    larno =3D (unsigned)lookaheads[stateno];
+    fprintf(graph_file, "\n\tq%d [label=3D\"%d:\\l", stateno, stateno);
+
+    for (isp =3D itemset; isp < itemsetend; isp++)
+    {
+	sp1 =3D sp =3D ritem + *isp;
+
+	while (*sp >=3D 0)
+	    ++sp;
+	rule =3D -(*sp);
+	fprintf(graph_file, "  %s -> ", symbol_pname[rlhs[rule]]);
+
+	for (sp =3D ritem + rrhs[rule]; sp < sp1; sp++)
+	    fprintf(graph_file, "%s ", symbol_pname[*sp]);
+
+	putc('.', graph_file);
+
+	while (*sp >=3D 0)
+	{
+	    fprintf(graph_file, " %s", symbol_pname[*sp]);
+	    sp++;
+	}
+
+	if (*sp1 < 0)
+	    graph_LA(-*sp1);
+
+	fprintf(graph_file, "\\l");
+    }
+    fprintf(graph_file, "\"];");
+}
+
+static void
+graph_LA(int ruleno)
+{
+    int i;
+    unsigned tokensetsize;
+    unsigned *rowp;
+
+    tokensetsize =3D (unsigned)WORDSIZE(ntokens);
+
+    if (ruleno =3D=3D LAruleno[larno])
+    {
+	rowp =3D LA + larno * tokensetsize;
+
+	fprintf(graph_file, " { ");
+	for (i =3D ntokens - 1; i >=3D 0; i--)
+	{
+	    if (BIT(rowp, i))
+		fprintf(graph_file, "%s ", symbol_pname[i]);
+	}
+	fprintf(graph_file, "}");
+	++larno;
+    }
+}
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/install-sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/install-sh	Wed Jul 25 16:21:35 2012 +0300
@@ -0,0 +1,294 @@
+#! /bin/sh
+#
+# install - install a program, script, or datafile
+#
+# This originates from X11R5 (mit/util/scripts/install.sh), which was
+# later released in X11R6 (xc/config/util/install.sh) with the
+# following copyright and license.
+#
+# Copyright (C) 1994 X Consortium
+#
+# Permission is hereby granted, free of charge, to any person obtaining a =
copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation t=
he
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and=
/or
+# sell copies of the Software, and to permit persons to whom the Software =
is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included =
in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS =
OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL=
 THE
+# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHE=
R IN
+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CON=
NEC-
+# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# Except as contained in this notice, the name of the X Consortium shall n=
ot
+# be used in advertising or otherwise to promote the sale, use or other de=
al-
+# ings in this Software without prior written authorization from the X Con=
sor-
+# tium.
+#
+#
+# FSF changes to this file are in the public domain.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch.  It can only install one file at a time, a restriction
+# shared with many OS's install programs.
+
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit=3D"${DOITPROG-}"
+
+
+# put in absolute paths if you don't have them in your path; or use env. v=
ars.
+
+mvprog=3D"${MVPROG-mv}"
+cpprog=3D"${CPPROG-cp}"
+chmodprog=3D"${CHMODPROG-chmod}"
+chownprog=3D"${CHOWNPROG-chown}"
+chgrpprog=3D"${CHGRPPROG-chgrp}"
+stripprog=3D"${STRIPPROG-strip}"
+rmprog=3D"${RMPROG-rm}"
+mkdirprog=3D"${MKDIRPROG-mkdir}"
+
+transformbasename=3D""
+transform_arg=3D""
+instcmd=3D"$mvprog"
+chmodcmd=3D"$chmodprog 0755"
+chowncmd=3D""
+chgrpcmd=3D""
+stripcmd=3D""
+rmcmd=3D"$rmprog -f"
+mvcmd=3D"$mvprog"
+src=3D""
+dst=3D""
+dir_arg=3D""
+
+while [ x"$1" !=3D x ]; do
+    case $1 in
+	-c) instcmd=3D$cpprog
+	    shift
+	    continue;;
+
+	-d) dir_arg=3Dtrue
+	    shift
+	    continue;;
+
+	-m) chmodcmd=3D"$chmodprog $2"
+	    shift
+	    shift
+	    continue;;
+
+	-o) chowncmd=3D"$chownprog $2"
+	    shift
+	    shift
+	    continue;;
+
+	-g) chgrpcmd=3D"$chgrpprog $2"
+	    shift
+	    shift
+	    continue;;
+
+	-s) stripcmd=3D$stripprog
+	    shift
+	    continue;;
+
+	-t=3D*) transformarg=3D`echo $1 | sed 's/-t=3D//'`
+	    shift
+	    continue;;
+
+	-b=3D*) transformbasename=3D`echo $1 | sed 's/-b=3D//'`
+	    shift
+	    continue;;
+
+	*)  if [ x"$src" =3D x ]
+	    then
+		src=3D$1
+	    else
+		# this colon is to work around a 386BSD /bin/sh bug
+		:
+		dst=3D$1
+	    fi
+	    shift
+	    continue;;
+    esac
+done
+
+if [ x"$src" =3D x ]
+then
+	echo "$0: no input file specified" >&2
+	exit 1
+else
+	:
+fi
+
+if [ x"$dir_arg" !=3D x ]; then
+	dst=3D$src
+	src=3D""
+
+	if [ -d "$dst" ]; then
+		instcmd=3D:
+		chmodcmd=3D""
+	else
+		instcmd=3D$mkdirprog
+	fi
+else
+
+# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
+# might cause directories to be created, which would be especially bad
+# if $src (and thus $dsttmp) contains '*'.
+
+	if [ -f "$src" ] || [ -d "$src" ]
+	then
+		:
+	else
+		echo "$0: $src does not exist" >&2
+		exit 1
+	fi
+
+	if [ x"$dst" =3D x ]
+	then
+		echo "$0: no destination specified" >&2
+		exit 1
+	else
+		:
+	fi
+
+# If destination is a directory, append the input filename; if your system
+# does not like double slashes in filenames, you may need to add some logic
+
+	if [ -d "$dst" ]
+	then
+		dst=3D$dst/`basename "$src"`
+	else
+		:
+	fi
+fi
+
+## this sed command emulates the dirname command
+dstdir=3D`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
+
+# Make sure that the destination directory exists.
+#  this part is taken from Noah Friedman's mkinstalldirs script
+
+# Skip lots of stat calls in the usual case.
+if [ ! -d "$dstdir" ]; then
+defaultIFS=3D'
+	'
+IFS=3D"${IFS-$defaultIFS}"
+
+oIFS=3D$IFS
+# Some sh's can't handle IFS=3D/ for some reason.
+IFS=3D'%'
+set - `echo "$dstdir" | sed -e '[email protected]/@%@g' -e '[email protected]^%@/@'`
+IFS=3D$oIFS
+
+pathcomp=3D''
+
+while [ $# -ne 0 ] ; do
+	pathcomp=3D$pathcomp$1
+	shift
+
+	if [ ! -d "$pathcomp" ] ;
+        then
+		$mkdirprog "$pathcomp"
+	else
+		:
+	fi
+
+	pathcomp=3D$pathcomp/
+done
+fi
+
+if [ x"$dir_arg" !=3D x ]
+then
+	$doit $instcmd "$dst" &&
+
+	if [ x"$chowncmd" !=3D x ]; then $doit $chowncmd "$dst"; else : ; fi &&
+	if [ x"$chgrpcmd" !=3D x ]; then $doit $chgrpcmd "$dst"; else : ; fi &&
+	if [ x"$stripcmd" !=3D x ]; then $doit $stripcmd "$dst"; else : ; fi &&
+	if [ x"$chmodcmd" !=3D x ]; then $doit $chmodcmd "$dst"; else : ; fi
+else
+
+# If we're going to rename the final executable, determine the name now.
+
+	if [ x"$transformarg" =3D x ]
+	then
+		dstfile=3D`basename "$dst"`
+	else
+		dstfile=3D`basename "$dst" $transformbasename |
+			sed $transformarg`$transformbasename
+	fi
+
+# don't allow the sed command to completely eliminate the filename
+
+	if [ x"$dstfile" =3D x ]
+	then
+		dstfile=3D`basename "$dst"`
+	else
+		:
+	fi
+
+# Make a couple of temp file names in the proper directory.
+
+	dsttmp=3D$dstdir/#inst.$$#
+	rmtmp=3D$dstdir/#rm.$$#
+
+# Trap to clean up temp files at exit.
+
+	trap 'status=3D$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0
+	trap '(exit $?); exit' 1 2 13 15
+
+# Move or copy the file name to the temp name
+
+	$doit $instcmd "$src" "$dsttmp" &&
+
+# and set any options; do chmod last to preserve setuid bits
+
+# If any of these fail, we abort the whole thing.  If we want to
+# ignore errors from any of these, just make sure not to ignore
+# errors from the above "$doit $instcmd $src $dsttmp" command.
+
+	if [ x"$chowncmd" !=3D x ]; then $doit $chowncmd "$dsttmp"; else :;fi &&
+	if [ x"$chgrpcmd" !=3D x ]; then $doit $chgrpcmd "$dsttmp"; else :;fi &&
+	if [ x"$stripcmd" !=3D x ]; then $doit $stripcmd "$dsttmp"; else :;fi &&
+	if [ x"$chmodcmd" !=3D x ]; then $doit $chmodcmd "$dsttmp"; else :;fi &&
+
+# Now remove or move aside any old file at destination location.  We try t=
his
+# two ways since rm can't unlink itself on some systems and the destination
+# file might be busy for other reasons.  In this case, the final cleanup
+# might fail but the new file should still install successfully.
+
+{
+	if [ -f "$dstdir/$dstfile" ]
+	then
+		$doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null ||
+		$doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null ||
+		{
+		  echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
+		  (exit 1); exit
+		}
+	else
+		:
+	fi
+} &&
+
+# Now rename the file to the real destination.
+
+	$doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
+
+fi &&
+
+# The final little trick to "correctly" pass the exit status to the exit t=
rap.
+
+{
+	(exit 0); exit
+}
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/lalr.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/lalr.c	Wed Jul 25 16:21:35 2012 +0300
@@ -0,0 +1,655 @@
+/* $Id: lalr.c,v 1.9 2009/10/27 09:49:27 tom Exp $ */
+
+#include "defs.h"
+
+typedef struct shorts
+{
+    struct shorts *next;
+    Value_t value;
+}
+shorts;
+
+static Value_t map_goto(int state, int symbol);
+static Value_t **transpose(Value_t ** R, int n);
+static void add_lookback_edge(int stateno, int ruleno, int gotono);
+static void build_relations(void);
+static void compute_FOLLOWS(void);
+static void compute_lookaheads(void);
+static void digraph(Value_t ** relation);
+static void initialize_F(void);
+static void initialize_LA(void);
+static void set_accessing_symbol(void);
+static void set_goto_map(void);
+static void set_maxrhs(void);
+static void set_reduction_table(void);
+static void set_shift_table(void);
+static void set_state_table(void);
+static void traverse(int i);
+
+static int tokensetsize;
+Value_t *lookaheads;
+Value_t *LAruleno;
+unsigned *LA;
+Value_t *accessing_symbol;
+core **state_table;
+shifts **shift_table;
+reductions **reduction_table;
+Value_t *goto_map;
+Value_t *from_state;
+Value_t *to_state;
+
+static Value_t infinity;
+static int maxrhs;
+static int ngotos;
+static unsigned *F;
+static Value_t **includes;
+static shorts **lookback;
+static Value_t **R;
+static Value_t *INDEX;
+static Value_t *VERTICES;
+static Value_t top;
+
+void
+lalr(void)
+{
+    tokensetsize =3D WORDSIZE(ntokens);
+
+    set_state_table();
+    set_accessing_symbol();
+    set_shift_table();
+    set_reduction_table();
+    set_maxrhs();
+    initialize_LA();
+    set_goto_map();
+    initialize_F();
+    build_relations();
+    compute_FOLLOWS();
+    compute_lookaheads();
+}
+
+static void
+set_state_table(void)
+{
+    core *sp;
+
+    state_table =3D NEW2(nstates, core *);
+    for (sp =3D first_state; sp; sp =3D sp->next)
+	state_table[sp->number] =3D sp;
+}
+
+static void
+set_accessing_symbol(void)
+{
+    core *sp;
+
+    accessing_symbol =3D NEW2(nstates, Value_t);
+    for (sp =3D first_state; sp; sp =3D sp->next)
+	accessing_symbol[sp->number] =3D sp->accessing_symbol;
+}
+
+static void
+set_shift_table(void)
+{
+    shifts *sp;
+
+    shift_table =3D NEW2(nstates, shifts *);
+    for (sp =3D first_shift; sp; sp =3D sp->next)
+	shift_table[sp->number] =3D sp;
+}
+
+static void
+set_reduction_table(void)
+{
+    reductions *rp;
+
+    reduction_table =3D NEW2(nstates, reductions *);
+    for (rp =3D first_reduction; rp; rp =3D rp->next)
+	reduction_table[rp->number] =3D rp;
+}
+
+static void
+set_maxrhs(void)
+{
+    Value_t *itemp;
+    Value_t *item_end;
+    int length;
+    int max;
+
+    length =3D 0;
+    max =3D 0;
+    item_end =3D ritem + nitems;
+    for (itemp =3D ritem; itemp < item_end; itemp++)
+    {
+	if (*itemp >=3D 0)
+	{
+	    length++;
+	}
+	else
+	{
+	    if (length > max)
+		max =3D length;
+	    length =3D 0;
+	}
+    }
+
+    maxrhs =3D max;
+}
+
+static void
+initialize_LA(void)
+{
+    int i, j, k;
+    reductions *rp;
+
+    lookaheads =3D NEW2(nstates + 1, Value_t);
+
+    k =3D 0;
+    for (i =3D 0; i < nstates; i++)
+    {
+	lookaheads[i] =3D (Value_t) k;
+	rp =3D reduction_table[i];
+	if (rp)
+	    k +=3D rp->nreds;
+    }
+    lookaheads[nstates] =3D (Value_t) k;
+
+    LA =3D NEW2(k * tokensetsize, unsigned);
+    LAruleno =3D NEW2(k, Value_t);
+    lookback =3D NEW2(k, shorts *);
+
+    k =3D 0;
+    for (i =3D 0; i < nstates; i++)
+    {
+	rp =3D reduction_table[i];
+	if (rp)
+	{
+	    for (j =3D 0; j < rp->nreds; j++)
+	    {
+		LAruleno[k] =3D rp->rules[j];
+		k++;
+	    }
+	}
+    }
+}
+
+static void
+set_goto_map(void)
+{
+    shifts *sp;
+    int i;
+    int symbol;
+    int k;
+    Value_t *temp_map;
+    Value_t state2;
+    Value_t state1;
+
+    goto_map =3D NEW2(nvars + 1, Value_t) - ntokens;
+    temp_map =3D NEW2(nvars + 1, Value_t) - ntokens;
+
+    ngotos =3D 0;
+    for (sp =3D first_shift; sp; sp =3D sp->next)
+    {
+	for (i =3D sp->nshifts - 1; i >=3D 0; i--)
+	{
+	    symbol =3D accessing_symbol[sp->shift[i]];
+
+	    if (ISTOKEN(symbol))
+		break;
+
+	    if (ngotos =3D=3D MAXSHORT)
+		fatal("too many gotos");
+
+	    ngotos++;
+	    goto_map[symbol]++;
+	}
+    }
+
+    k =3D 0;
+    for (i =3D ntokens; i < nsyms; i++)
+    {
+	temp_map[i] =3D (Value_t) k;
+	k +=3D goto_map[i];
+    }
+
+    for (i =3D ntokens; i < nsyms; i++)
+	goto_map[i] =3D temp_map[i];
+
+    goto_map[nsyms] =3D (Value_t) ngotos;
+    temp_map[nsyms] =3D (Value_t) ngotos;
+
+    from_state =3D NEW2(ngotos, Value_t);
+    to_state =3D NEW2(ngotos, Value_t);
+
+    for (sp =3D first_shift; sp; sp =3D sp->next)
+    {
+	state1 =3D sp->number;
+	for (i =3D sp->nshifts - 1; i >=3D 0; i--)
+	{
+	    state2 =3D sp->shift[i];
+	    symbol =3D accessing_symbol[state2];
+
+	    if (ISTOKEN(symbol))
+		break;
+
+	    k =3D temp_map[symbol]++;
+	    from_state[k] =3D state1;
+	    to_state[k] =3D state2;
+	}
+    }
+
+    FREE(temp_map + ntokens);
+}
+
+/*  Map_goto maps a state/symbol pair into its numeric representation.	*/
+
+static Value_t
+map_goto(int state, int symbol)
+{
+    int high;
+    int low;
+    int middle;
+    int s;
+
+    low =3D goto_map[symbol];
+    high =3D goto_map[symbol + 1];
+
+    for (;;)
+    {
+	assert(low <=3D high);
+	middle =3D (low + high) >> 1;
+	s =3D from_state[middle];
+	if (s =3D=3D state)
+	    return (Value_t) (middle);
+	else if (s < state)
+	    low =3D middle + 1;
+	else
+	    high =3D middle - 1;
+    }
+}
+
+static void
+initialize_F(void)
+{
+    int i;
+    int j;
+    int k;
+    shifts *sp;
+    Value_t *edge;
+    unsigned *rowp;
+    Value_t *rp;
+    Value_t **reads;
+    int nedges;
+    int stateno;
+    int symbol;
+    int nwords;
+
+    nwords =3D ngotos * tokensetsize;
+    F =3D NEW2(nwords, unsigned);
+
+    reads =3D NEW2(ngotos, Value_t *);
+    edge =3D NEW2(ngotos + 1, Value_t);
+    nedges =3D 0;
+
+    rowp =3D F;
+    for (i =3D 0; i < ngotos; i++)
+    {
+	stateno =3D to_state[i];
+	sp =3D shift_table[stateno];
+
+	if (sp)
+	{
+	    k =3D sp->nshifts;
+
+	    for (j =3D 0; j < k; j++)
+	    {
+		symbol =3D accessing_symbol[sp->shift[j]];
+		if (ISVAR(symbol))
+		    break;
+		SETBIT(rowp, symbol);
+	    }
+
+	    for (; j < k; j++)
+	    {
+		symbol =3D accessing_symbol[sp->shift[j]];
+		if (nullable[symbol])
+		    edge[nedges++] =3D map_goto(stateno, symbol);
+	    }
+
+	    if (nedges)
+	    {
+		reads[i] =3D rp =3D NEW2(nedges + 1, Value_t);
+
+		for (j =3D 0; j < nedges; j++)
+		    rp[j] =3D edge[j];
+
+		rp[nedges] =3D -1;
+		nedges =3D 0;
+	    }
+	}
+
+	rowp +=3D tokensetsize;
+    }
+
+    SETBIT(F, 0);
+    digraph(reads);
+
+    for (i =3D 0; i < ngotos; i++)
+    {
+	if (reads[i])
+	    FREE(reads[i]);
+    }
+
+    FREE(reads);
+    FREE(edge);
+}
+
+static void
+build_relations(void)
+{
+    int i;
+    int j;
+    int k;
+    Value_t *rulep;
+    Value_t *rp;
+    shifts *sp;
+    int length;
+    int nedges;
+    int done_flag;
+    Value_t state1;
+    Value_t stateno;
+    int symbol1;
+    int symbol2;
+    Value_t *shortp;
+    Value_t *edge;
+    Value_t *states;
+    Value_t **new_includes;
+
+    includes =3D NEW2(ngotos, Value_t *);
+    edge =3D NEW2(ngotos + 1, Value_t);
+    states =3D NEW2(maxrhs + 1, Value_t);
+
+    for (i =3D 0; i < ngotos; i++)
+    {
+	nedges =3D 0;
+	state1 =3D from_state[i];
+	symbol1 =3D accessing_symbol[to_state[i]];
+
+	for (rulep =3D derives[symbol1]; *rulep >=3D 0; rulep++)
+	{
+	    length =3D 1;
+	    states[0] =3D state1;
+	    stateno =3D state1;
+
+	    for (rp =3D ritem + rrhs[*rulep]; *rp >=3D 0; rp++)
+	    {
+		symbol2 =3D *rp;
+		sp =3D shift_table[stateno];
+		k =3D sp->nshifts;
+
+		for (j =3D 0; j < k; j++)
+		{
+		    stateno =3D sp->shift[j];
+		    if (accessing_symbol[stateno] =3D=3D symbol2)
+			break;
+		}
+
+		states[length++] =3D stateno;
+	    }
+
+	    add_lookback_edge(stateno, *rulep, i);
+
+	    length--;
+	    done_flag =3D 0;
+	    while (!done_flag)
+	    {
+		done_flag =3D 1;
+		rp--;
+		if (ISVAR(*rp))
+		{
+		    stateno =3D states[--length];
+		    edge[nedges++] =3D map_goto(stateno, *rp);
+		    if (nullable[*rp] && length > 0)
+			done_flag =3D 0;
+		}
+	    }
+	}
+
+	if (nedges)
+	{
+	    includes[i] =3D shortp =3D NEW2(nedges + 1, Value_t);
+	    for (j =3D 0; j < nedges; j++)
+		shortp[j] =3D edge[j];
+	    shortp[nedges] =3D -1;
+	}
+    }
+
+    new_includes =3D transpose(includes, ngotos);
+
+    for (i =3D 0; i < ngotos; i++)
+	if (includes[i])
+	    FREE(includes[i]);
+
+    FREE(includes);
+
+    includes =3D new_includes;
+
+    FREE(edge);
+    FREE(states);
+}
+
+static void
+add_lookback_edge(int stateno, int ruleno, int gotono)
+{
+    int i, k;
+    int found;
+    shorts *sp;
+
+    i =3D lookaheads[stateno];
+    k =3D lookaheads[stateno + 1];
+    found =3D 0;
+    while (!found && i < k)
+    {
+	if (LAruleno[i] =3D=3D ruleno)
+	    found =3D 1;
+	else
+	    ++i;
+    }
+    assert(found);
+
+    sp =3D NEW(shorts);
+    sp->next =3D lookback[i];
+    sp->value =3D (Value_t) gotono;
+    lookback[i] =3D sp;
+}
+
+static Value_t **
+transpose(Value_t ** R2, int n)
+{
+    Value_t **new_R;
+    Value_t **temp_R;
+    Value_t *nedges;
+    Value_t *sp;
+    int i;
+    int k;
+
+    nedges =3D NEW2(n, Value_t);
+
+    for (i =3D 0; i < n; i++)
+    {
+	sp =3D R2[i];
+	if (sp)
+	{
+	    while (*sp >=3D 0)
+		nedges[*sp++]++;
+	}
+    }
+
+    new_R =3D NEW2(n, Value_t *);
+    temp_R =3D NEW2(n, Value_t *);
+
+    for (i =3D 0; i < n; i++)
+    {
+	k =3D nedges[i];
+	if (k > 0)
+	{
+	    sp =3D NEW2(k + 1, Value_t);
+	    new_R[i] =3D sp;
+	    temp_R[i] =3D sp;
+	    sp[k] =3D -1;
+	}
+    }
+
+    FREE(nedges);
+
+    for (i =3D 0; i < n; i++)
+    {
+	sp =3D R2[i];
+	if (sp)
+	{
+	    while (*sp >=3D 0)
+		*temp_R[*sp++]++ =3D (Value_t) i;
+	}
+    }
+
+    FREE(temp_R);
+
+    return (new_R);
+}
+
+static void
+compute_FOLLOWS(void)
+{
+    digraph(includes);
+}
+
+static void
+compute_lookaheads(void)
+{
+    int i, n;
+    unsigned *fp1, *fp2, *fp3;
+    shorts *sp, *next;
+    unsigned *rowp;
+
+    rowp =3D LA;
+    n =3D lookaheads[nstates];
+    for (i =3D 0; i < n; i++)
+    {
+	fp3 =3D rowp + tokensetsize;
+	for (sp =3D lookback[i]; sp; sp =3D sp->next)
+	{
+	    fp1 =3D rowp;
+	    fp2 =3D F + tokensetsize * sp->value;
+	    while (fp1 < fp3)
+		*fp1++ |=3D *fp2++;
+	}
+	rowp =3D fp3;
+    }
+
+    for (i =3D 0; i < n; i++)
+	for (sp =3D lookback[i]; sp; sp =3D next)
+	{
+	    next =3D sp->next;
+	    FREE(sp);
+	}
+
+    FREE(lookback);
+    FREE(F);
+}
+
+static void
+digraph(Value_t ** relation)
+{
+    int i;
+
+    infinity =3D (Value_t) (ngotos + 2);
+    INDEX =3D NEW2(ngotos + 1, Value_t);
+    VERTICES =3D NEW2(ngotos + 1, Value_t);
+    top =3D 0;
+
+    R =3D relation;
+
+    for (i =3D 0; i < ngotos; i++)
+	INDEX[i] =3D 0;
+
+    for (i =3D 0; i < ngotos; i++)
+    {
+	if (INDEX[i] =3D=3D 0 && R[i])
+	    traverse(i);
+    }
+
+    FREE(INDEX);
+    FREE(VERTICES);
+}
+
+static void
+traverse(int i)
+{
+    unsigned *fp1;
+    unsigned *fp2;
+    unsigned *fp3;
+    int j;
+    Value_t *rp;
+
+    Value_t height;
+    unsigned *base;
+
+    VERTICES[++top] =3D (Value_t) i;
+    INDEX[i] =3D height =3D top;
+
+    base =3D F + i * tokensetsize;
+    fp3 =3D base + tokensetsize;
+
+    rp =3D R[i];
+    if (rp)
+    {
+	while ((j =3D *rp++) >=3D 0)
+	{
+	    if (INDEX[j] =3D=3D 0)
+		traverse(j);
+
+	    if (INDEX[i] > INDEX[j])
+		INDEX[i] =3D INDEX[j];
+
+	    fp1 =3D base;
+	    fp2 =3D F + j * tokensetsize;
+
+	    while (fp1 < fp3)
+		*fp1++ |=3D *fp2++;
+	}
+    }
+
+    if (INDEX[i] =3D=3D height)
+    {
+	for (;;)
+	{
+	    j =3D VERTICES[top--];
+	    INDEX[j] =3D infinity;
+
+	    if (i =3D=3D j)
+		break;
+
+	    fp1 =3D base;
+	    fp2 =3D F + j * tokensetsize;
+
+	    while (fp1 < fp3)
+		*fp2++ =3D *fp1++;
+	}
+    }
+}
+
+#ifdef NO_LEAKS
+void
+lalr_leaks(void)
+{
+    int i;
+
+    if (includes !=3D 0)
+    {
+	for (i =3D 0; i < ngotos; i++)
+	{
+	    free(includes[i]);
+	}
+	DO_FREE(includes);
+    }
+}
+#endif
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/lr0.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/lr0.c	Wed Jul 25 16:21:35 2012 +0300
@@ -0,0 +1,599 @@
+/* $Id: lr0.c,v 1.12 2010/06/09 08:53:17 tom Exp $ */
+
+#include "defs.h"
+
+static core *new_state(int symbol);
+static Value_t get_state(int symbol);
+static void allocate_itemsets(void);
+static void allocate_storage(void);
+static void append_states(void);
+static void free_storage(void);
+static void generate_states(void);
+static void initialize_states(void);
+static void new_itemsets(void);
+static void save_reductions(void);
+static void save_shifts(void);
+static void set_derives(void);
+static void set_nullable(void);
+
+int nstates;
+core *first_state;
+shifts *first_shift;
+reductions *first_reduction;
+
+static core **state_set;
+static core *this_state;
+static core *last_state;
+static shifts *last_shift;
+static reductions *last_reduction;
+
+static int nshifts;
+static short *shift_symbol;
+
+static Value_t *redset;
+static Value_t *shiftset;
+
+static Value_t **kernel_base;
+static Value_t **kernel_end;
+static Value_t *kernel_items;
+
+static void
+allocate_itemsets(void)
+{
+    short *itemp;
+    short *item_end;
+    int symbol;
+    int i;
+    int count;
+    int max;
+    short *symbol_count;
+
+    count =3D 0;
+    symbol_count =3D NEW2(nsyms, short);
+
+    item_end =3D ritem + nitems;
+    for (itemp =3D ritem; itemp < item_end; itemp++)
+    {
+	symbol =3D *itemp;
+	if (symbol >=3D 0)
+	{
+	    count++;
+	    symbol_count[symbol]++;
+	}
+    }
+
+    kernel_base =3D NEW2(nsyms, short *);
+    kernel_items =3D NEW2(count, short);
+
+    count =3D 0;
+    max =3D 0;
+    for (i =3D 0; i < nsyms; i++)
+    {
+	kernel_base[i] =3D kernel_items + count;
+	count +=3D symbol_count[i];
+	if (max < symbol_count[i])
+	    max =3D symbol_count[i];
+    }
+
+    shift_symbol =3D symbol_count;
+    kernel_end =3D NEW2(nsyms, short *);
+}
+
+static void
+allocate_storage(void)
+{
+    allocate_itemsets();
+    shiftset =3D NEW2(nsyms, short);
+    redset =3D NEW2(nrules + 1, short);
+    state_set =3D NEW2(nitems, core *);
+}
+
+static void
+append_states(void)
+{
+    int i;
+    int j;
+    Value_t symbol;
+
+#ifdef	TRACE
+    fprintf(stderr, "Entering append_states()\n");
+#endif
+    for (i =3D 1; i < nshifts; i++)
+    {
+	symbol =3D shift_symbol[i];
+	j =3D i;
+	while (j > 0 && shift_symbol[j - 1] > symbol)
+	{
+	    shift_symbol[j] =3D shift_symbol[j - 1];
+	    j--;
+	}
+	shift_symbol[j] =3D symbol;
+    }
+
+    for (i =3D 0; i < nshifts; i++)
+    {
+	symbol =3D shift_symbol[i];
+	shiftset[i] =3D get_state(symbol);
+    }
+}
+
+static void
+free_storage(void)
+{
+    FREE(shift_symbol);
+    FREE(redset);
+    FREE(shiftset);
+    FREE(kernel_base);
+    FREE(kernel_end);
+    FREE(kernel_items);
+    FREE(state_set);
+}
+
+static void
+generate_states(void)
+{
+    allocate_storage();
+    itemset =3D NEW2(nitems, short);
+    ruleset =3D NEW2(WORDSIZE(nrules), unsigned);
+    set_first_derives();
+    initialize_states();
+
+    while (this_state)
+    {
+	closure(this_state->items, this_state->nitems);
+	save_reductions();
+	new_itemsets();
+	append_states();
+
+	if (nshifts > 0)
+	    save_shifts();
+
+	this_state =3D this_state->next;
+    }
+
+    free_storage();
+}
+
+static Value_t
+get_state(int symbol)
+{
+    int key;
+    short *isp1;
+    short *isp2;
+    short *iend;
+    core *sp;
+    int found;
+    int n;
+
+#ifdef	TRACE
+    fprintf(stderr, "Entering get_state(%d)\n", symbol);
+#endif
+
+    isp1 =3D kernel_base[symbol];
+    iend =3D kernel_end[symbol];
+    n =3D (int)(iend - isp1);
+
+    key =3D *isp1;
+    assert(0 <=3D key && key < nitems);
+    sp =3D state_set[key];
+    if (sp)
+    {
+	found =3D 0;
+	while (!found)
+	{
+	    if (sp->nitems =3D=3D n)
+	    {
+		found =3D 1;
+		isp1 =3D kernel_base[symbol];
+		isp2 =3D sp->items;
+
+		while (found && isp1 < iend)
+		{
+		    if (*isp1++ !=3D *isp2++)
+			found =3D 0;
+		}
+	    }
+
+	    if (!found)
+	    {
+		if (sp->link)
+		{
+		    sp =3D sp->link;
+		}
+		else
+		{
+		    sp =3D sp->link =3D new_state(symbol);
+		    found =3D 1;
+		}
+	    }
+	}
+    }
+    else
+    {
+	state_set[key] =3D sp =3D new_state(symbol);
+    }
+
+    return (sp->number);
+}
+
+static void
+initialize_states(void)
+{
+    unsigned i;
+    short *start_derives;
+    core *p;
+
+    start_derives =3D derives[start_symbol];
+    for (i =3D 0; start_derives[i] >=3D 0; ++i)
+	continue;
+
+    p =3D (core *)MALLOC(sizeof(core) + i * sizeof(short));
+    NO_SPACE(p);
+
+    p->next =3D 0;
+    p->link =3D 0;
+    p->number =3D 0;
+    p->accessing_symbol =3D 0;
+    p->nitems =3D (Value_t) i;
+
+    for (i =3D 0; start_derives[i] >=3D 0; ++i)
+	p->items[i] =3D rrhs[start_derives[i]];
+
+    first_state =3D last_state =3D this_state =3D p;
+    nstates =3D 1;
+}
+
+static void
+new_itemsets(void)
+{
+    Value_t i;
+    int shiftcount;
+    short *isp;
+    short *ksp;
+    Value_t symbol;
+
+    for (i =3D 0; i < nsyms; i++)
+	kernel_end[i] =3D 0;
+
+    shiftcount =3D 0;
+    isp =3D itemset;
+    while (isp < itemsetend)
+    {
+	i =3D *isp++;
+	symbol =3D ritem[i];
+	if (symbol > 0)
+	{
+	    ksp =3D kernel_end[symbol];
+	    if (!ksp)
+	    {
+		shift_symbol[shiftcount++] =3D symbol;
+		ksp =3D kernel_base[symbol];
+	    }
+
+	    *ksp++ =3D (Value_t) (i + 1);
+	    kernel_end[symbol] =3D ksp;
+	}
+    }
+
+    nshifts =3D shiftcount;
+}
+
+static core *
+new_state(int symbol)
+{
+    unsigned n;
+    core *p;
+    short *isp1;
+    short *isp2;
+    short *iend;
+
+#ifdef	TRACE
+    fprintf(stderr, "Entering new_state(%d)\n", symbol);
+#endif
+
+    if (nstates >=3D MAXSHORT)
+	fatal("too many states");
+
+    isp1 =3D kernel_base[symbol];
+    iend =3D kernel_end[symbol];
+    n =3D (unsigned)(iend - isp1);
+
+    p =3D (core *)allocate((sizeof(core) + (n - 1) * sizeof(short)));
+    p->accessing_symbol =3D (Value_t) symbol;
+    p->number =3D (Value_t) nstates;
+    p->nitems =3D (Value_t) n;
+
+    isp2 =3D p->items;
+    while (isp1 < iend)
+	*isp2++ =3D *isp1++;
+
+    last_state->next =3D p;
+    last_state =3D p;
+
+    nstates++;
+
+    return (p);
+}
+
+/* show_cores is used for debugging */
+
+void
+show_cores(void)
+{
+    core *p;
+    int i, j, k, n;
+    int itemno;
+
+    k =3D 0;
+    for (p =3D first_state; p; ++k, p =3D p->next)
+    {
+	if (k)
+	    printf("\n");
+	printf("state %d, number =3D %d, accessing symbol =3D %s\n",
+	       k, p->number, symbol_name[p->accessing_symbol]);
+	n =3D p->nitems;
+	for (i =3D 0; i < n; ++i)
+	{
+	    itemno =3D p->items[i];
+	    printf("%4d  ", itemno);
+	    j =3D itemno;
+	    while (ritem[j] >=3D 0)
+		++j;
+	    printf("%s :", symbol_name[rlhs[-ritem[j]]]);
+	    j =3D rrhs[-ritem[j]];
+	    while (j < itemno)
+		printf(" %s", symbol_name[ritem[j++]]);
+	    printf(" .");
+	    while (ritem[j] >=3D 0)
+		printf(" %s", symbol_name[ritem[j++]]);
+	    printf("\n");
+	    fflush(stdout);
+	}
+    }
+}
+
+/* show_ritems is used for debugging */
+
+void
+show_ritems(void)
+{
+    int i;
+
+    for (i =3D 0; i < nitems; ++i)
+	printf("ritem[%d] =3D %d\n", i, ritem[i]);
+}
+
+/* show_rrhs is used for debugging */
+void
+show_rrhs(void)
+{
+    int i;
+
+    for (i =3D 0; i < nrules; ++i)
+	printf("rrhs[%d] =3D %d\n", i, rrhs[i]);
+}
+
+/* show_shifts is used for debugging */
+
+void
+show_shifts(void)
+{
+    shifts *p;
+    int i, j, k;
+
+    k =3D 0;
+    for (p =3D first_shift; p; ++k, p =3D p->next)
+    {
+	if (k)
+	    printf("\n");
+	printf("shift %d, number =3D %d, nshifts =3D %d\n", k, p->number,
+	       p->nshifts);
+	j =3D p->nshifts;
+	for (i =3D 0; i < j; ++i)
+	    printf("\t%d\n", p->shift[i]);
+    }
+}
+
+static void
+save_shifts(void)
+{
+    shifts *p;
+    short *sp1;
+    short *sp2;
+    short *send;
+
+    p =3D (shifts *)allocate((sizeof(shifts) +
+			      (unsigned)(nshifts - 1) * sizeof(short)));
+
+    p->number =3D this_state->number;
+    p->nshifts =3D (Value_t) nshifts;
+
+    sp1 =3D shiftset;
+    sp2 =3D p->shift;
+    send =3D shiftset + nshifts;
+
+    while (sp1 < send)
+	*sp2++ =3D *sp1++;
+
+    if (last_shift)
+    {
+	last_shift->next =3D p;
+	last_shift =3D p;
+    }
+    else
+    {
+	first_shift =3D p;
+	last_shift =3D p;
+    }
+}
+
+static void
+save_reductions(void)
+{
+    short *isp;
+    short *rp1;
+    short *rp2;
+    int item;
+    Value_t count;
+    reductions *p;
+    short *rend;
+
+    count =3D 0;
+    for (isp =3D itemset; isp < itemsetend; isp++)
+    {
+	item =3D ritem[*isp];
+	if (item < 0)
+	{
+	    redset[count++] =3D (Value_t) - item;
+	}
+    }
+
+    if (count)
+    {
+	p =3D (reductions *)allocate((sizeof(reductions) +
+				      (unsigned)(count - 1) *
+				    sizeof(short)));
+
+	p->number =3D this_state->number;
+	p->nreds =3D count;
+
+	rp1 =3D redset;
+	rp2 =3D p->rules;
+	rend =3D rp1 + count;
+
+	while (rp1 < rend)
+	    *rp2++ =3D *rp1++;
+
+	if (last_reduction)
+	{
+	    last_reduction->next =3D p;
+	    last_reduction =3D p;
+	}
+	else
+	{
+	    first_reduction =3D p;
+	    last_reduction =3D p;
+	}
+    }
+}
+
+static void
+set_derives(void)
+{
+    Value_t i, k;
+    int lhs;
+    short *rules;
+
+    derives =3D NEW2(nsyms, short *);
+    rules =3D NEW2(nvars + nrules, short);
+
+    k =3D 0;
+    for (lhs =3D start_symbol; lhs < nsyms; lhs++)
+    {
+	derives[lhs] =3D rules + k;
+	for (i =3D 0; i < nrules; i++)
+	{
+	    if (rlhs[i] =3D=3D lhs)
+	    {
+		rules[k] =3D i;
+		k++;
+	    }
+	}
+	rules[k] =3D -1;
+	k++;
+    }
+
+#ifdef	DEBUG
+    print_derives();
+#endif
+}
+
+#ifdef	DEBUG
+void
+print_derives(void)
+{
+    int i;
+    short *sp;
+
+    printf("\nDERIVES\n\n");
+
+    for (i =3D start_symbol; i < nsyms; i++)
+    {
+	printf("%s derives ", symbol_name[i]);
+	for (sp =3D derives[i]; *sp >=3D 0; sp++)
+	{
+	    printf("  %d", *sp);
+	}
+	putchar('\n');
+    }
+
+    putchar('\n');
+}
+#endif
+
+static void
+set_nullable(void)
+{
+    int i, j;
+    int empty;
+    int done_flag;
+
+    nullable =3D MALLOC(nsyms);
+    NO_SPACE(nullable);
+
+    for (i =3D 0; i < nsyms; ++i)
+	nullable[i] =3D 0;
+
+    done_flag =3D 0;
+    while (!done_flag)
+    {
+	done_flag =3D 1;
+	for (i =3D 1; i < nitems; i++)
+	{
+	    empty =3D 1;
+	    while ((j =3D ritem[i]) >=3D 0)
+	    {
+		if (!nullable[j])
+		    empty =3D 0;
+		++i;
+	    }
+	    if (empty)
+	    {
+		j =3D rlhs[-j];
+		if (!nullable[j])
+		{
+		    nullable[j] =3D 1;
+		    done_flag =3D 0;
+		}
+	    }
+	}
+    }
+
+#ifdef DEBUG
+    for (i =3D 0; i < nsyms; i++)
+    {
+	if (nullable[i])
+	    printf("%s is nullable\n", symbol_name[i]);
+	else
+	    printf("%s is not nullable\n", symbol_name[i]);
+    }
+#endif
+}
+
+void
+lr0(void)
+{
+    set_derives();
+    set_nullable();
+    generate_states();
+}
+
+#ifdef NO_LEAKS
+void
+lr0_leaks(void)
+{
+    DO_FREE(derives[start_symbol]);
+    DO_FREE(derives);
+    DO_FREE(nullable);
+}
+#endif
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/main.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/main.c	Wed Jul 25 16:21:35 2012 +0300
@@ -0,0 +1,664 @@
+/* $Id: main.c,v 1.38 2012/01/14 01:01:15 tom Exp $ */
+
+#include <signal.h>
+#include <unistd.h>		/* for _exit() */
+
+#include "defs.h"
+
+#if defined(HAVE_ATEXIT)
+# ifdef HAVE_MKSTEMP
+#  define USE_MKSTEMP 1
+# elif defined(HAVE_FCNTL_H)
+#  define USE_MKSTEMP 1
+#  include <fcntl.h>		/* for open(), O_EXCL, etc. */
+# else
+#  define USE_MKSTEMP 0
+# endif
+#else
+# define USE_MKSTEMP 0
+#endif
+
+#if USE_MKSTEMP
+#include <sys/types.h>
+#include <sys/stat.h>
+
+typedef struct _my_tmpfiles
+{
+    struct _my_tmpfiles *next;
+    char *name;
+}
+MY_TMPFILES;
+
+static MY_TMPFILES *my_tmpfiles;
+#endif /* USE_MKSTEMP */
+
+char dflag;
+char gflag;
+char iflag;
+char lflag;
+static char oflag;
+char rflag;
+char sflag;
+char tflag;
+char vflag;
+
+const char *symbol_prefix;
+const char *myname =3D "yacc";
+
+int lineno;
+int outline;
+
+static char empty_string[] =3D "";
+static char default_file_prefix[] =3D "y";
+
+static char *file_prefix =3D default_file_prefix;
+
+char *code_file_name;
+char *input_file_name =3D empty_string;
+char *defines_file_name;
+char *externs_file_name;
+
+static char *graph_file_name;
+static char *output_file_name;
+static char *verbose_file_name;
+
+FILE *action_file;	/*  a temp file, used to save actions associated    */
+			/*  with rules until the parser is written          */
+FILE *code_file;	/*  y.code.c (used when the -r option is specified) */
+FILE *defines_file;	/*  y.tab.h                                         */
+FILE *externs_file;	/*  y.tab.i                                         */
+FILE *input_file;	/*  the input file                                  */
+FILE *output_file;	/*  y.tab.c                                         */
+FILE *text_file;	/*  a temp file, used to save text until all        */
+			/*  symbols have been defined                       */
+FILE *union_file;	/*  a temp file, used to save the union             */
+			/*  definition until all symbol have been           */
+			/*  defined                                         */
+FILE *verbose_file;	/*  y.output                                        */
+FILE *graph_file;	/*  y.dot                                           */
+
+int nitems;
+int nrules;
+int nsyms;
+int ntokens;
+int nvars;
+
+Value_t start_symbol;
+char **symbol_name;
+char **symbol_pname;
+Value_t *symbol_value;
+short *symbol_prec;
+char *symbol_assoc;
+
+int pure_parser;
+int exit_code;
+
+Value_t *ritem;
+Value_t *rlhs;
+Value_t *rrhs;
+Value_t *rprec;
+Assoc_t *rassoc;
+Value_t **derives;
+char *nullable;
+
+/*
+ * Since fclose() is called via the signal handler, it might die.  Don't l=
oop
+ * if there is a problem closing a file.
+ */
+#define DO_CLOSE(fp) \
+	if (fp !=3D 0) { \
+	    FILE *use =3D fp; \
+	    fp =3D 0; \
+	    fclose(use); \
+	}
+
+static int got_intr =3D 0;
+
+void
+done(int k)
+{
+    DO_CLOSE(input_file);
+    DO_CLOSE(output_file);
+
+    DO_CLOSE(action_file);
+    DO_CLOSE(defines_file);
+    DO_CLOSE(graph_file);
+    DO_CLOSE(text_file);
+    DO_CLOSE(union_file);
+    DO_CLOSE(verbose_file);
+
+    if (got_intr)
+	_exit(EXIT_FAILURE);
+
+#ifdef NO_LEAKS
+    if (rflag)
+	DO_FREE(code_file_name);
+
+    if (dflag)
+	DO_FREE(defines_file_name);
+
+    if (iflag)
+	DO_FREE(externs_file_name);
+
+    if (oflag)
+	DO_FREE(output_file_name);
+
+    if (vflag)
+	DO_FREE(verbose_file_name);
+
+    if (gflag)
+	DO_FREE(graph_file_name);
+
+    lr0_leaks();
+    lalr_leaks();
+    mkpar_leaks();
+    output_leaks();
+    reader_leaks();
+#endif
+
+    if (rflag)
+	DO_CLOSE(code_file);
+
+    exit(k);
+}
+
+static void
+onintr(__unused int sig)
+{
+    got_intr =3D 1;
+    done(EXIT_FAILURE);
+}
+
+static void
+set_signals(void)
+{
+#ifdef SIGINT
+    if (signal(SIGINT, SIG_IGN) !=3D SIG_IGN)
+	signal(SIGINT, onintr);
+#endif
+#ifdef SIGTERM
+    if (signal(SIGTERM, SIG_IGN) !=3D SIG_IGN)
+	signal(SIGTERM, onintr);
+#endif
+#ifdef SIGHUP
+    if (signal(SIGHUP, SIG_IGN) !=3D SIG_IGN)
+	signal(SIGHUP, onintr);
+#endif
+}
+
+static void
+usage(void)
+{
+    static const char *msg[] =3D
+    {
+	""
+	,"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\")"
+	,"  -p symbol_prefix      set symbol prefix (default \"yy\")"
+	,"  -P                    create a reentrant parser, e.g., \"%pure-parser=
\""
+	,"  -r                    produce separate code and table files (y.code.c=
)"
+	,"  -s                    suppress #define's for quoted names in %token l=
ines"
+	,"  -t                    add debugging support"
+	,"  -v                    write description (y.output)"
+	,"  -V                    show version information and exit"
+    };
+    unsigned n;
+
+    fflush(stdout);
+    fprintf(stderr, "Usage: %s [options] filename\n", myname);
+    for (n =3D 0; n < sizeof(msg) / sizeof(msg[0]); ++n)
+	fprintf(stderr, "%s\n", msg[n]);
+
+    exit(1);
+}
+
+static void
+setflag(int ch)
+{
+    switch (ch)
+    {
+    case 'd':
+	dflag =3D 1;
+	break;
+
+    case 'g':
+	gflag =3D 1;
+	break;
+
+    case 'i':
+	iflag =3D 1;
+	break;
+
+    case 'l':
+	lflag =3D 1;
+	break;
+
+    case 'P':
+	pure_parser =3D 1;
+	break;
+
+    case 'r':
+	rflag =3D 1;
+	break;
+
+    case 's':
+	sflag =3D 1;
+	break;
+
+    case 't':
+	tflag =3D 1;
+	break;
+
+    case 'v':
+	vflag =3D 1;
+	break;
+
+    case 'V':
+	printf("%s - %s\n", myname, VERSION);
+	exit(EXIT_SUCCESS);
+
+    case 'y':
+	/* noop for bison compatibility. byacc is already designed to be posix
+	 * yacc compatible. */
+	break;
+
+    default:
+	usage();
+    }
+}
+
+static void
+getargs(int argc, char *argv[])
+{
+    int i;
+    char *s;
+    int ch;
+
+    if (argc > 0)
+	myname =3D argv[0];
+
+    for (i =3D 1; i < argc; ++i)
+    {
+	s =3D argv[i];
+	if (*s !=3D '-')
+	    break;
+	switch (ch =3D *++s)
+	{
+	case '\0':
+	    input_file =3D stdin;
+	    if (i + 1 < argc)
+		usage();
+	    return;
+
+	case '-':
+	    ++i;
+	    goto no_more_options;
+
+	case 'b':
+	    if (*++s)
+		file_prefix =3D s;
+	    else if (++i < argc)
+		file_prefix =3D argv[i];
+	    else
+		usage();
+	    continue;
+
+	case 'o':
+	    if (*++s)
+		output_file_name =3D s;
+	    else if (++i < argc)
+		output_file_name =3D argv[i];
+	    else
+		usage();
+	    continue;
+
+	case 'p':
+	    if (*++s)
+		symbol_prefix =3D s;
+	    else if (++i < argc)
+		symbol_prefix =3D argv[i];
+	    else
+		usage();
+	    continue;
+
+	default:
+	    setflag(ch);
+	    break;
+	}
+
+	for (;;)
+	{
+	    switch (ch =3D *++s)
+	    {
+	    case '\0':
+		goto end_of_option;
+
+	    default:
+		setflag(ch);
+		break;
+	    }
+	}
+      end_of_option:;
+    }
+
+  no_more_options:;
+    if (i + 1 !=3D argc)
+	usage();
+    input_file_name =3D argv[i];
+}
+
+void *
+allocate(size_t n)
+{
+    void *p;
+
+    p =3D NULL;
+    if (n)
+    {
+	p =3D CALLOC(1, n);
+	NO_SPACE(p);
+    }
+    return (p);
+}
+
+#define CREATE_FILE_NAME(dest, suffix) \
+	dest =3D MALLOC(len + strlen(suffix) + 1); \
+	NO_SPACE(dest); \
+	strcpy(dest, file_prefix); \
+	strcpy(dest + len, suffix)
+
+static void
+create_file_names(void)
+{
+    size_t len;
+    const char *defines_suffix;
+    const char *externs_suffix;
+    char *prefix;
+
+    prefix =3D NULL;
+    defines_suffix =3D DEFINES_SUFFIX;
+    externs_suffix =3D EXTERNS_SUFFIX;
+
+    /* compute the file_prefix from the user provided output_file_name */
+    if (output_file_name !=3D 0)
+    {
+	if (!(prefix =3D strstr(output_file_name, ".tab.c"))
+	    && (prefix =3D strstr(output_file_name, ".c")))
+	{
+	    defines_suffix =3D ".h";
+	    externs_suffix =3D ".i";
+	}
+    }
+
+    if (prefix !=3D NULL)
+    {
+	len =3D (size_t) (prefix - output_file_name);
+	file_prefix =3D (char *)MALLOC(len + 1);
+	NO_SPACE(file_prefix);
+	strncpy(file_prefix, output_file_name, len)[len] =3D 0;
+    }
+    else
+	len =3D strlen(file_prefix);
+
+    /* if "-o filename" was not given */
+    if (output_file_name =3D=3D 0)
+    {
+	oflag =3D 1;
+	CREATE_FILE_NAME(output_file_name, OUTPUT_SUFFIX);
+    }
+
+    if (rflag)
+    {
+	CREATE_FILE_NAME(code_file_name, CODE_SUFFIX);
+    }
+    else
+	code_file_name =3D output_file_name;
+
+    if (dflag)
+    {
+	CREATE_FILE_NAME(defines_file_name, defines_suffix);
+    }
+
+    if (iflag)
+    {
+	CREATE_FILE_NAME(externs_file_name, externs_suffix);
+    }
+
+    if (vflag)
+    {
+	CREATE_FILE_NAME(verbose_file_name, VERBOSE_SUFFIX);
+    }
+
+    if (gflag)
+    {
+	CREATE_FILE_NAME(graph_file_name, GRAPH_SUFFIX);
+    }
+
+    if (prefix !=3D NULL)
+    {
+	FREE(file_prefix);
+    }
+}
+
+#if USE_MKSTEMP
+static void
+close_tmpfiles(void)
+{
+    while (my_tmpfiles !=3D 0)
+    {
+	MY_TMPFILES *next =3D my_tmpfiles->next;
+
+	chmod(my_tmpfiles->name, 0644);
+	unlink(my_tmpfiles->name);
+
+	free(my_tmpfiles->name);
+	free(my_tmpfiles);
+
+	my_tmpfiles =3D next;
+    }
+}
+
+#ifndef HAVE_MKSTEMP
+static int
+my_mkstemp(char *temp)
+{
+    int fd;
+    char *dname;
+    char *fname;
+    char *name;
+
+    /*
+     * Split-up to use tempnam, rather than tmpnam; the latter (like
+     * mkstemp) is unusable on Windows.
+     */
+    if ((fname =3D strrchr(temp, '/')) !=3D 0)
+    {
+	dname =3D strdup(temp);
+	dname[++fname - temp] =3D '\0';
+    }
+    else
+    {
+	dname =3D 0;
+	fname =3D temp;
+    }
+    if ((name =3D tempnam(dname, fname)) !=3D 0)
+    {
+	fd =3D open(name, O_CREAT | O_EXCL | O_RDWR);
+	strcpy(temp, name);
+    }
+    else
+    {
+	fd =3D -1;
+    }
+
+    if (dname !=3D 0)
+	free(dname);
+
+    return fd;
+}
+#define mkstemp(s) my_mkstemp(s)
+#endif
+
+#endif
+
+/*
+ * tmpfile() should be adequate, except that it may require special privil=
eges
+ * to use, e.g., MinGW and Windows 7 where it tries to use the root direct=
ory.
+ */
+static FILE *
+open_tmpfile(const char *label)
+{
+    FILE *result;
+#if USE_MKSTEMP
+    int fd;
+    const char *tmpdir;
+    char *name;
+    const char *mark;
+
+    if ((tmpdir =3D getenv("TMPDIR")) =3D=3D 0 || access(tmpdir, W_OK) !=
=3D 0)
+    {
+#ifdef P_tmpdir
+	tmpdir =3D P_tmpdir;
+#else
+	tmpdir =3D "/tmp";
+#endif
+	if (access(tmpdir, W_OK) !=3D 0)
+	    tmpdir =3D ".";
+    }
+
+    name =3D malloc(strlen(tmpdir) + 10 + strlen(label));
+
+    result =3D 0;
+    if (name !=3D 0)
+    {
+	if ((mark =3D strrchr(label, '_')) =3D=3D 0)
+	    mark =3D label + strlen(label);
+
+	sprintf(name, "%s/%.*sXXXXXX", tmpdir, (int)(mark - label), label);
+	fd =3D mkstemp(name);
+	if (fd >=3D 0)
+	{
+	    result =3D fdopen(fd, "w+");
+	    if (result !=3D 0)
+	    {
+		MY_TMPFILES *item;
+
+		if (my_tmpfiles =3D=3D 0)
+		{
+		    atexit(close_tmpfiles);
+		}
+
+		item =3D NEW(MY_TMPFILES);
+		NO_SPACE(item);
+
+		item->name =3D name;
+		NO_SPACE(item->name);
+
+		item->next =3D my_tmpfiles;
+		my_tmpfiles =3D item;
+	    }
+	}
+    }
+#else
+    result =3D tmpfile();
+#endif
+
+    if (result =3D=3D 0)
+	open_error(label);
+    return result;
+}
+
+static void
+open_files(void)
+{
+    create_file_names();
+
+    if (input_file =3D=3D 0)
+    {
+	input_file =3D fopen(input_file_name, "r");
+	if (input_file =3D=3D 0)
+	    open_error(input_file_name);
+    }
+
+    action_file =3D open_tmpfile("action_file");
+    text_file =3D open_tmpfile("text_file");
+
+    if (vflag)
+    {
+	verbose_file =3D fopen(verbose_file_name, "w");
+	if (verbose_file =3D=3D 0)
+	    open_error(verbose_file_name);
+    }
+
+    if (gflag)
+    {
+	graph_file =3D fopen(graph_file_name, "w");
+	if (graph_file =3D=3D 0)
+	    open_error(graph_file_name);
+	fprintf(graph_file, "digraph %s {\n", file_prefix);
+	fprintf(graph_file, "\tedge [fontsize=3D10];\n");
+	fprintf(graph_file, "\tnode [shape=3Dbox,fontsize=3D10];\n");
+	fprintf(graph_file, "\torientation=3Dlandscape;\n");
+	fprintf(graph_file, "\trankdir=3DLR;\n");
+	fprintf(graph_file, "\t/*\n");
+	fprintf(graph_file, "\tmargin=3D0.2;\n");
+	fprintf(graph_file, "\tpage=3D\"8.27,11.69\"; // for A4 printing\n");
+	fprintf(graph_file, "\tratio=3Dauto;\n");
+	fprintf(graph_file, "\t*/\n");
+    }
+
+    if (dflag)
+    {
+	defines_file =3D fopen(defines_file_name, "w");
+	if (defines_file =3D=3D 0)
+	    open_error(defines_file_name);
+	union_file =3D open_tmpfile("union_file");
+    }
+
+    if (iflag)
+    {
+	externs_file =3D fopen(externs_file_name, "w");
+	if (externs_file =3D=3D 0)
+	    open_error(externs_file_name);
+    }
+
+    output_file =3D fopen(output_file_name, "w");
+    if (output_file =3D=3D 0)
+	open_error(output_file_name);
+
+    if (rflag)
+    {
+	code_file =3D fopen(code_file_name, "w");
+	if (code_file =3D=3D 0)
+	    open_error(code_file_name);
+    }
+    else
+	code_file =3D output_file;
+}
+
+int
+main(int argc, char *argv[])
+{
+    SRexpect =3D -1;
+    RRexpect =3D -1;
+    exit_code =3D EXIT_SUCCESS;
+
+    set_signals();
+    getargs(argc, argv);
+    open_files();
+    reader();
+    lr0();
+    lalr();
+    make_parser();
+    graph();
+    finalize_closure();
+    verbose();
+    output();
+    done(exit_code);
+    /*NOTREACHED */
+}
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/makefile.in
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/makefile.in	Wed Jul 25 16:21:35 2012 +0300
@@ -0,0 +1,182 @@
+# $Id: makefile.in,v 1.17 2012/01/15 19:11:21 tom Exp $
+#
+# UNIX template-makefile for Berkeley Yacc
+
+THIS		=3D yacc
+
+#### Start of system configuration section. ####
+
+srcdir 		=3D @[email protected]
+VPATH  		=3D @[email protected]
+
+CC		=3D @[email protected]
+
+INSTALL		=3D @[email protected]
+INSTALL_PROGRAM	=3D @[email protected]
+INSTALL_DATA	=3D @[email protected]
+transform	=3D @[email protected]
+
+DEFINES		=3D
+EXTRA_CFLAGS	=3D @[email protected]
+CPPFLAGS	=3D -I. -I$(srcdir) $(DEFINES) -DHAVE_CONFIG_H -DYYPATCH=3D`cat $=
(srcdir)/VERSION` @[email protected]
+CFLAGS		=3D @[email protected] $(CPPFLAGS) $(EXTRA_CFLAGS)
+
+LDFLAGS		=3D @[email protected]
+LIBS		=3D @[email protected]
+
+CTAGS		=3D @[email protected]
+ETAGS		=3D @[email protected]
+LINT		=3D @[email protected]
+
+prefix		=3D @[email protected]
+exec_prefix	=3D @[email protected]
+
+bindir		=3D $(DESTDIR)@[email protected]
+mandir		=3D $(DESTDIR)@[email protected]/man1
+manext		=3D 1
+
+testdir		=3D $(srcdir)/test
+
+x		=3D @[email protected]
+o		=3D . at OBJEXT@
+
+#### End of system configuration section. ####
+
+SHELL		=3D /bin/sh
+ at SET_MAKE@
+
+H_FILES =3D \
+	defs.h
+
+C_FILES =3D \
+	closure.c \
+	error.c \
+	graph.c \
+	lalr.c \
+	lr0.c \
+	main.c \
+	mkpar.c \
+	output.c \
+	reader.c \
+	skeleton.c \
+	symtab.c \
+	verbose.c \
+	warshall.c
+
+OBJS	=3D \
+	closure$o \
+	error$o \
+	graph$o \
+	lalr$o \
+	lr0$o \
+	main$o \
+	mkpar$o \
+	output$o \
+	reader$o \
+	skeleton$o \
+	symtab$o \
+	verbose$o \
+	warshall$o
+
+TRANSFORM_BIN =3D sed 's/$x$$//'       |sed '$(transform)'|sed 's/$$/$x/'
+TRANSFORM_MAN =3D sed 's/$(manext)$$//'|sed '$(transform)'|sed 's/$$/$(man=
ext)/'
+
+actual_bin =3D `echo $(THIS)$x        | $(TRANSFORM_BIN)`
+actual_man =3D `echo $(THIS).$(manext)| $(TRANSFORM_MAN)`
+
+all : $(THIS)$x
+
+install: all installdirs
+	$(INSTALL_PROGRAM) $(THIS)$x $(bindir)/$(actual_bin)
+	- $(INSTALL_DATA) $(srcdir)/$(THIS).1 $(mandir)/$(actual_man)
+
+installdirs:
+	mkdir -p $(bindir)
+	- mkdir -p $(mandir)
+
+uninstall:
+	- rm -f $(bindir)/$(actual_bin)
+	- rm -f $(mandir)/$(actual_man)
+
+##########################################################################=
######
+.SUFFIXES : $o .i .html .$(manext) .cat .ps .pdf .txt
+
+.c$o:
+	@[email protected]
+	@[email protected]$(CC) -c $(CFLAGS) $<
+
+.c.i :
+	@[email protected]
+	@[email protected]$(CPP) -C $(CPPFLAGS) $*.c >[email protected]
+
+.$(manext).cat :
+	- nroff -man $(srcdir)/$(THIS).$(manext) >[email protected]
+
+.$(manext).html :
+	GROFF_NO_SGR=3Dstupid $(SHELL) -c "tbl $*.$(manext) | groff -Thtml -man" =
>[email protected]
+
+.$(manext).ps :
+	$(SHELL) -c "tbl $*.$(manext) | groff -man" >[email protected]
+
+.$(manext).txt :
+	GROFF_NO_SGR=3Dstupid $(SHELL) -c "tbl $*.$(manext) | nroff -Tascii -man =
| col -bx" >[email protected]
+
+.ps.pdf :
+	ps2pdf $*.ps
+
+##########################################################################=
######
+
+$(THIS)$x : $(OBJS)
+	@[email protected]$(CC) $(LDFLAGS) $(CFLAGS) -o [email protected] $(OBJS) $(LIBS)
+
+mostlyclean :
+	- rm -f core .nfs* *$o *.bak *.BAK *.out
+
+clean : mostlyclean
+	- rm -f $(THIS)$x
+
+distclean : clean
+	- rm -f config.log config.cache config.status config.h makefile
+	- rm -f *.html *.cat *.pdf *.ps *.txt
+	- cd test && rm -f test-*
+
+realclean: distclean
+	- rm -f tags TAGS
+
+##########################################################################=
######
+docs :: $(THIS).html \
+	$(THIS).pdf \
+	$(THIS).ps \
+	$(THIS).txt
+$(THIS).html : $(THIS).$(manext)
+$(THIS).pdf : $(THIS).ps
+$(THIS).ps : $(THIS).$(manext)
+$(THIS).txt : $(THIS).$(manext)
+##########################################################################=
######
+check:	$(THIS)$x
+	$(SHELL) $(testdir)/run_test.sh $(testdir)
+
+check_make: $(THIS)$x
+	$(SHELL) $(testdir)/run_make.sh $(testdir)
+
+check_lint:
+	$(SHELL) $(testdir)/run_lint.sh $(testdir)
+##########################################################################=
######
+tags: $(H_FILES) $(C_FILES)=20
+	$(CTAGS) $(C_FILES) $(H_FILES)
+
+lint: $(C_FILES)=20
+	$(LINT) $(CPPFLAGS) $(C_FILES)
+
+ at MAKE_UPPER_TAGS@TAGS: $(H_FILES) $(C_FILES)=20
+ at MAKE_UPPER_TAGS@	$(ETAGS) $(C_FILES) $(H_FILES)
+
+depend:
+	makedepend -- $(CPPFLAGS) -- $(C_FILES)
+
+$(OBJS) : defs.h
+
+main$o \
+skeleton$o : makefile VERSION
+
+# DO NOT DELETE THIS LINE -- make depend depends on it.
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/mkpar.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/mkpar.c	Wed Jul 25 16:21:35 2012 +0300
@@ -0,0 +1,392 @@
+/* $Id: mkpar.c,v 1.11 2010/06/09 08:53:17 tom Exp $ */
+
+#include "defs.h"
+
+static action *add_reduce(action *actions, int ruleno, int symbol);
+static action *add_reductions(int stateno, action *actions);
+static action *get_shifts(int stateno);
+static action *parse_actions(int stateno);
+static int sole_reduction(int stateno);
+static void defreds(void);
+static void find_final_state(void);
+static void free_action_row(action *p);
+static void remove_conflicts(void);
+static void total_conflicts(void);
+static void unused_rules(void);
+
+action **parser;
+
+int SRexpect;
+int RRexpect;
+
+int SRtotal;
+int RRtotal;
+
+Value_t *SRconflicts;
+Value_t *RRconflicts;
+Value_t *defred;
+Value_t *rules_used;
+Value_t nunused;
+Value_t final_state;
+
+static Value_t SRcount;
+static Value_t RRcount;
+
+void
+make_parser(void)
+{
+    int i;
+
+    parser =3D NEW2(nstates, action *);
+    for (i =3D 0; i < nstates; i++)
+	parser[i] =3D parse_actions(i);
+
+    find_final_state();
+    remove_conflicts();
+    unused_rules();
+    if (SRtotal + RRtotal > 0)
+	total_conflicts();
+    defreds();
+}
+
+static action *
+parse_actions(int stateno)
+{
+    action *actions;
+
+    actions =3D get_shifts(stateno);
+    actions =3D add_reductions(stateno, actions);
+    return (actions);
+}
+
+static action *
+get_shifts(int stateno)
+{
+    action *actions, *temp;
+    shifts *sp;
+    Value_t *to_state2;
+    Value_t i, k;
+    Value_t symbol;
+
+    actions =3D 0;
+    sp =3D shift_table[stateno];
+    if (sp)
+    {
+	to_state2 =3D sp->shift;
+	for (i =3D (Value_t) (sp->nshifts - 1); i >=3D 0; i--)
+	{
+	    k =3D to_state2[i];
+	    symbol =3D accessing_symbol[k];
+	    if (ISTOKEN(symbol))
+	    {
+		temp =3D NEW(action);
+		temp->next =3D actions;
+		temp->symbol =3D symbol;
+		temp->number =3D k;
+		temp->prec =3D symbol_prec[symbol];
+		temp->action_code =3D SHIFT;
+		temp->assoc =3D symbol_assoc[symbol];
+		actions =3D temp;
+	    }
+	}
+    }
+    return (actions);
+}
+
+static action *
+add_reductions(int stateno, action *actions)
+{
+    int i, j, m, n;
+    int ruleno, tokensetsize;
+    unsigned *rowp;
+
+    tokensetsize =3D WORDSIZE(ntokens);
+    m =3D lookaheads[stateno];
+    n =3D lookaheads[stateno + 1];
+    for (i =3D m; i < n; i++)
+    {
+	ruleno =3D LAruleno[i];
+	rowp =3D LA + i * tokensetsize;
+	for (j =3D ntokens - 1; j >=3D 0; j--)
+	{
+	    if (BIT(rowp, j))
+		actions =3D add_reduce(actions, ruleno, j);
+	}
+    }
+    return (actions);
+}
+
+static action *
+add_reduce(action *actions,
+	   int ruleno,
+	   int symbol)
+{
+    action *temp, *prev, *next;
+
+    prev =3D 0;
+    for (next =3D actions; next && next->symbol < symbol; next =3D next->n=
ext)
+	prev =3D next;
+
+    while (next && next->symbol =3D=3D symbol && next->action_code =3D=3D =
SHIFT)
+    {
+	prev =3D next;
+	next =3D next->next;
+    }
+
+    while (next && next->symbol =3D=3D symbol &&
+	   next->action_code =3D=3D REDUCE && next->number < ruleno)
+    {
+	prev =3D next;
+	next =3D next->next;
+    }
+
+    temp =3D NEW(action);
+    temp->next =3D next;
+    temp->symbol =3D (Value_t) symbol;
+    temp->number =3D (Value_t) ruleno;
+    temp->prec =3D rprec[ruleno];
+    temp->action_code =3D REDUCE;
+    temp->assoc =3D rassoc[ruleno];
+
+    if (prev)
+	prev->next =3D temp;
+    else
+	actions =3D temp;
+
+    return (actions);
+}
+
+static void
+find_final_state(void)
+{
+    int goal, i;
+    Value_t *to_state2;
+    shifts *p;
+
+    p =3D shift_table[0];
+    to_state2 =3D p->shift;
+    goal =3D ritem[1];
+    for (i =3D p->nshifts - 1; i >=3D 0; --i)
+    {
+	final_state =3D to_state2[i];
+	if (accessing_symbol[final_state] =3D=3D goal)
+	    break;
+    }
+}
+
+static void
+unused_rules(void)
+{
+    int i;
+    action *p;
+
+    rules_used =3D (Value_t *) MALLOC((unsigned)nrules * sizeof(Value_t));
+    NO_SPACE(rules_used);
+
+    for (i =3D 0; i < nrules; ++i)
+	rules_used[i] =3D 0;
+
+    for (i =3D 0; i < nstates; ++i)
+    {
+	for (p =3D parser[i]; p; p =3D p->next)
+	{
+	    if (p->action_code =3D=3D REDUCE && p->suppressed =3D=3D 0)
+		rules_used[p->number] =3D 1;
+	}
+    }
+
+    nunused =3D 0;
+    for (i =3D 3; i < nrules; ++i)
+	if (!rules_used[i])
+	    ++nunused;
+
+    if (nunused)
+    {
+	if (nunused =3D=3D 1)
+	    fprintf(stderr, "%s: 1 rule never reduced\n", myname);
+	else
+	    fprintf(stderr, "%s: %d rules never reduced\n", myname, nunused);
+    }
+}
+
+static void
+remove_conflicts(void)
+{
+    int i;
+    int symbol;
+    action *p, *pref =3D 0;
+
+    SRtotal =3D 0;
+    RRtotal =3D 0;
+    SRconflicts =3D NEW2(nstates, Value_t);
+    RRconflicts =3D NEW2(nstates, Value_t);
+    for (i =3D 0; i < nstates; i++)
+    {
+	SRcount =3D 0;
+	RRcount =3D 0;
+	symbol =3D -1;
+	for (p =3D parser[i]; p; p =3D p->next)
+	{
+	    if (p->symbol !=3D symbol)
+	    {
+		pref =3D p;
+		symbol =3D p->symbol;
+	    }
+	    else if (i =3D=3D final_state && symbol =3D=3D 0)
+	    {
+		SRcount++;
+		p->suppressed =3D 1;
+	    }
+	    else if (pref !=3D 0 && pref->action_code =3D=3D SHIFT)
+	    {
+		if (pref->prec > 0 && p->prec > 0)
+		{
+		    if (pref->prec < p->prec)
+		    {
+			pref->suppressed =3D 2;
+			pref =3D p;
+		    }
+		    else if (pref->prec > p->prec)
+		    {
+			p->suppressed =3D 2;
+		    }
+		    else if (pref->assoc =3D=3D LEFT)
+		    {
+			pref->suppressed =3D 2;
+			pref =3D p;
+		    }
+		    else if (pref->assoc =3D=3D RIGHT)
+		    {
+			p->suppressed =3D 2;
+		    }
+		    else
+		    {
+			pref->suppressed =3D 2;
+			p->suppressed =3D 2;
+		    }
+		}
+		else
+		{
+		    SRcount++;
+		    p->suppressed =3D 1;
+		}
+	    }
+	    else
+	    {
+		RRcount++;
+		p->suppressed =3D 1;
+	    }
+	}
+	SRtotal +=3D SRcount;
+	RRtotal +=3D RRcount;
+	SRconflicts[i] =3D SRcount;
+	RRconflicts[i] =3D RRcount;
+    }
+}
+
+static void
+total_conflicts(void)
+{
+    fprintf(stderr, "%s: ", myname);
+    if (SRtotal =3D=3D 1)
+	fprintf(stderr, "1 shift/reduce conflict");
+    else if (SRtotal > 1)
+	fprintf(stderr, "%d shift/reduce conflicts", SRtotal);
+
+    if (SRtotal && RRtotal)
+	fprintf(stderr, ", ");
+
+    if (RRtotal =3D=3D 1)
+	fprintf(stderr, "1 reduce/reduce conflict");
+    else if (RRtotal > 1)
+	fprintf(stderr, "%d reduce/reduce conflicts", RRtotal);
+
+    fprintf(stderr, ".\n");
+
+    if (SRexpect >=3D 0 && SRtotal !=3D SRexpect)
+    {
+	fprintf(stderr, "%s: ", myname);
+	fprintf(stderr, "expected %d shift/reduce conflict%s.\n",
+		SRexpect, PLURAL(SRexpect));
+	exit_code =3D EXIT_FAILURE;
+    }
+    if (RRexpect >=3D 0 && RRtotal !=3D RRexpect)
+    {
+	fprintf(stderr, "%s: ", myname);
+	fprintf(stderr, "expected %d reduce/reduce conflict%s.\n",
+		RRexpect, PLURAL(RRexpect));
+	exit_code =3D EXIT_FAILURE;
+    }
+}
+
+static int
+sole_reduction(int stateno)
+{
+    int count, ruleno;
+    action *p;
+
+    count =3D 0;
+    ruleno =3D 0;
+    for (p =3D parser[stateno]; p; p =3D p->next)
+    {
+	if (p->action_code =3D=3D SHIFT && p->suppressed =3D=3D 0)
+	    return (0);
+	else if (p->action_code =3D=3D REDUCE && p->suppressed =3D=3D 0)
+	{
+	    if (ruleno > 0 && p->number !=3D ruleno)
+		return (0);
+	    if (p->symbol !=3D 1)
+		++count;
+	    ruleno =3D p->number;
+	}
+    }
+
+    if (count =3D=3D 0)
+	return (0);
+    return (ruleno);
+}
+
+static void
+defreds(void)
+{
+    int i;
+
+    defred =3D NEW2(nstates, Value_t);
+    for (i =3D 0; i < nstates; i++)
+	defred[i] =3D (Value_t) sole_reduction(i);
+}
+
+static void
+free_action_row(action *p)
+{
+    action *q;
+
+    while (p)
+    {
+	q =3D p->next;
+	FREE(p);
+	p =3D q;
+    }
+}
+
+void
+free_parser(void)
+{
+    int i;
+
+    for (i =3D 0; i < nstates; i++)
+	free_action_row(parser[i]);
+
+    FREE(parser);
+}
+
+#ifdef NO_LEAKS
+void
+mkpar_leaks(void)
+{
+    DO_FREE(defred);
+    DO_FREE(rules_used);
+    DO_FREE(SRconflicts);
+    DO_FREE(RRconflicts);
+}
+#endif
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/output.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/output.c	Wed Jul 25 16:21:35 2012 +0300
@@ -0,0 +1,1507 @@
+/* $Id: output.c,v 1.43 2012/01/14 17:03:52 tom Exp $ */
+
+#include "defs.h"
+
+#define StaticOrR	(rflag ? "" : "static ")
+#define CountLine(fp)   (!rflag || ((fp) =3D=3D code_file))
+
+static int nvectors;
+static int nentries;
+static Value_t **froms;
+static Value_t **tos;
+static Value_t *tally;
+static Value_t *width;
+static Value_t *state_count;
+static Value_t *order;
+static Value_t *base;
+static Value_t *pos;
+static int maxtable;
+static Value_t *table;
+static Value_t *check;
+static int lowzero;
+static int high;
+
+static void
+putc_code(FILE * fp, int c)
+{
+    if ((c =3D=3D '\n') && (fp =3D=3D code_file))
+	++outline;
+    putc(c, fp);
+}
+
+static void
+putl_code(FILE * fp, const char *s)
+{
+    if (fp =3D=3D code_file)
+	++outline;
+    fputs(s, fp);
+}
+
+static void
+puts_code(FILE * fp, const char *s)
+{
+    fputs(s, fp);
+}
+
+static void
+write_code_lineno(FILE * fp)
+{
+    if (!lflag && (fp =3D=3D code_file))
+    {
+	++outline;
+	fprintf(fp, line_format, outline, code_file_name);
+    }
+}
+
+static void
+write_input_lineno(void)
+{
+    if (!lflag)
+    {
+	++outline;
+	fprintf(code_file, line_format, lineno, input_file_name);
+    }
+}
+
+static void
+define_prefixed(FILE * fp, const char *name)
+{
+    int bump_line =3D CountLine(fp);
+    if (bump_line)
+	++outline;
+    fprintf(fp, "\n");
+
+    if (bump_line)
+	++outline;
+    fprintf(fp, "#ifndef %s\n", name);
+
+    if (bump_line)
+	++outline;
+    fprintf(fp, "#define %-10s %s%s\n", name, symbol_prefix, name + 2);
+
+    if (bump_line)
+	++outline;
+    fprintf(fp, "#endif /* %s */\n", name);
+}
+
+static void
+output_prefix(FILE * fp)
+{
+    if (symbol_prefix =3D=3D NULL)
+    {
+	symbol_prefix =3D "yy";
+    }
+    else
+    {
+	define_prefixed(fp, "yyparse");
+	define_prefixed(fp, "yylex");
+	define_prefixed(fp, "yyerror");
+	define_prefixed(fp, "yychar");
+	define_prefixed(fp, "yyval");
+	define_prefixed(fp, "yylval");
+	define_prefixed(fp, "yydebug");
+	define_prefixed(fp, "yynerrs");
+	define_prefixed(fp, "yyerrflag");
+	define_prefixed(fp, "yylhs");
+	define_prefixed(fp, "yylen");
+	define_prefixed(fp, "yydefred");
+	define_prefixed(fp, "yydgoto");
+	define_prefixed(fp, "yysindex");
+	define_prefixed(fp, "yyrindex");
+	define_prefixed(fp, "yygindex");
+	define_prefixed(fp, "yytable");
+	define_prefixed(fp, "yycheck");
+	define_prefixed(fp, "yyname");
+	define_prefixed(fp, "yyrule");
+    }
+    if (CountLine(fp))
+	++outline;
+    fprintf(fp, "#define YYPREFIX \"%s\"\n", symbol_prefix);
+}
+
+static void
+output_newline(void)
+{
+    if (!rflag)
+	++outline;
+    putc('\n', output_file);
+}
+
+static void
+output_line(const char *value)
+{
+    fputs(value, output_file);
+    output_newline();
+}
+
+static void
+output_int(int value)
+{
+    fprintf(output_file, "%5d,", value);
+}
+
+static void
+start_int_table(const char *name, int value)
+{
+    int need =3D 34 - (int)(strlen(symbol_prefix) + strlen(name));
+
+    if (need < 6)
+	need =3D 6;
+    fprintf(output_file,
+	    "%sconst short %s%s[] =3D {%*d,",
+	    StaticOrR, symbol_prefix, name, need, value);
+}
+
+static void
+start_str_table(const char *name)
+{
+    fprintf(output_file,
+	    "%sconst char *%s%s[] =3D {",
+	    StaticOrR, "yy", name);
+    output_newline();
+}
+
+static void
+end_table(void)
+{
+    output_newline();
+    output_line("};");
+}
+
+static void
+output_rule_data(void)
+{
+    int i;
+    int j;
+
+    start_int_table("lhs", symbol_value[start_symbol]);
+
+    j =3D 10;
+    for (i =3D 3; i < nrules; i++)
+    {
+	if (j >=3D 10)
+	{
+	    output_newline();
+	    j =3D 1;
+	}
+	else
+	    ++j;
+
+	output_int(symbol_value[rlhs[i]]);
+    }
+    end_table();
+
+    start_int_table("len", 2);
+
+    j =3D 10;
+    for (i =3D 3; i < nrules; i++)
+    {
+	if (j >=3D 10)
+	{
+	    output_newline();
+	    j =3D 1;
+	}
+	else
+	    j++;
+
+	output_int(rrhs[i + 1] - rrhs[i] - 1);
+    }
+    end_table();
+}
+
+static void
+output_yydefred(void)
+{
+    int i, j;
+
+    start_int_table("defred", (defred[0] ? defred[0] - 2 : 0));
+
+    j =3D 10;
+    for (i =3D 1; i < nstates; i++)
+    {
+	if (j < 10)
+	    ++j;
+	else
+	{
+	    output_newline();
+	    j =3D 1;
+	}
+
+	output_int((defred[i] ? defred[i] - 2 : 0));
+    }
+
+    end_table();
+}
+
+static void
+token_actions(void)
+{
+    int i, j;
+    Value_t shiftcount, reducecount;
+    int max, min;
+    Value_t *actionrow, *r, *s;
+    action *p;
+
+    actionrow =3D NEW2(2 * ntokens, Value_t);
+    for (i =3D 0; i < nstates; ++i)
+    {
+	if (parser[i])
+	{
+	    for (j =3D 0; j < 2 * ntokens; ++j)
+		actionrow[j] =3D 0;
+
+	    shiftcount =3D 0;
+	    reducecount =3D 0;
+	    for (p =3D parser[i]; p; p =3D p->next)
+	    {
+		if (p->suppressed =3D=3D 0)
+		{
+		    if (p->action_code =3D=3D SHIFT)
+		    {
+			++shiftcount;
+			actionrow[p->symbol] =3D p->number;
+		    }
+		    else if (p->action_code =3D=3D REDUCE && p->number !=3D defred[i])
+		    {
+			++reducecount;
+			actionrow[p->symbol + ntokens] =3D p->number;
+		    }
+		}
+	    }
+
+	    tally[i] =3D shiftcount;
+	    tally[nstates + i] =3D reducecount;
+	    width[i] =3D 0;
+	    width[nstates + i] =3D 0;
+	    if (shiftcount > 0)
+	    {
+		froms[i] =3D r =3D NEW2(shiftcount, Value_t);
+		tos[i] =3D s =3D NEW2(shiftcount, Value_t);
+		min =3D MAXSHORT;
+		max =3D 0;
+		for (j =3D 0; j < ntokens; ++j)
+		{
+		    if (actionrow[j])
+		    {
+			if (min > symbol_value[j])
+			    min =3D symbol_value[j];
+			if (max < symbol_value[j])
+			    max =3D symbol_value[j];
+			*r++ =3D symbol_value[j];
+			*s++ =3D actionrow[j];
+		    }
+		}
+		width[i] =3D (Value_t) (max - min + 1);
+	    }
+	    if (reducecount > 0)
+	    {
+		froms[nstates + i] =3D r =3D NEW2(reducecount, Value_t);
+		tos[nstates + i] =3D s =3D NEW2(reducecount, Value_t);
+		min =3D MAXSHORT;
+		max =3D 0;
+		for (j =3D 0; j < ntokens; ++j)
+		{
+		    if (actionrow[ntokens + j])
+		    {
+			if (min > symbol_value[j])
+			    min =3D symbol_value[j];
+			if (max < symbol_value[j])
+			    max =3D symbol_value[j];
+			*r++ =3D symbol_value[j];
+			*s++ =3D (Value_t) (actionrow[ntokens + j] - 2);
+		    }
+		}
+		width[nstates + i] =3D (Value_t) (max - min + 1);
+	    }
+	}
+    }
+    FREE(actionrow);
+}
+
+static int
+default_goto(int symbol)
+{
+    int i;
+    int m;
+    int n;
+    int default_state;
+    int max;
+
+    m =3D goto_map[symbol];
+    n =3D goto_map[symbol + 1];
+
+    if (m =3D=3D n)
+	return (0);
+
+    for (i =3D 0; i < nstates; i++)
+	state_count[i] =3D 0;
+
+    for (i =3D m; i < n; i++)
+	state_count[to_state[i]]++;
+
+    max =3D 0;
+    default_state =3D 0;
+    for (i =3D 0; i < nstates; i++)
+    {
+	if (state_count[i] > max)
+	{
+	    max =3D state_count[i];
+	    default_state =3D i;
+	}
+    }
+
+    return (default_state);
+}
+
+static void
+save_column(int symbol, int default_state)
+{
+    int i;
+    int m;
+    int n;
+    Value_t *sp;
+    Value_t *sp1;
+    Value_t *sp2;
+    Value_t count;
+    int symno;
+
+    m =3D goto_map[symbol];
+    n =3D goto_map[symbol + 1];
+
+    count =3D 0;
+    for (i =3D m; i < n; i++)
+    {
+	if (to_state[i] !=3D default_state)
+	    ++count;
+    }
+    if (count =3D=3D 0)
+	return;
+
+    symno =3D symbol_value[symbol] + 2 * nstates;
+
+    froms[symno] =3D sp1 =3D sp =3D NEW2(count, Value_t);
+    tos[symno] =3D sp2 =3D NEW2(count, Value_t);
+
+    for (i =3D m; i < n; i++)
+    {
+	if (to_state[i] !=3D default_state)
+	{
+	    *sp1++ =3D from_state[i];
+	    *sp2++ =3D to_state[i];
+	}
+    }
+
+    tally[symno] =3D count;
+    width[symno] =3D (Value_t) (sp1[-1] - sp[0] + 1);
+}
+
+static void
+goto_actions(void)
+{
+    int i, j, k;
+
+    state_count =3D NEW2(nstates, Value_t);
+
+    k =3D default_goto(start_symbol + 1);
+    start_int_table("dgoto", k);
+    save_column(start_symbol + 1, k);
+
+    j =3D 10;
+    for (i =3D start_symbol + 2; i < nsyms; i++)
+    {
+	if (j >=3D 10)
+	{
+	    output_newline();
+	    j =3D 1;
+	}
+	else
+	    ++j;
+
+	k =3D default_goto(i);
+	output_int(k);
+	save_column(i, k);
+    }
+
+    end_table();
+    FREE(state_count);
+}
+
+static void
+sort_actions(void)
+{
+    Value_t i;
+    int j;
+    int k;
+    int t;
+    int w;
+
+    order =3D NEW2(nvectors, Value_t);
+    nentries =3D 0;
+
+    for (i =3D 0; i < nvectors; i++)
+    {
+	if (tally[i] > 0)
+	{
+	    t =3D tally[i];
+	    w =3D width[i];
+	    j =3D nentries - 1;
+
+	    while (j >=3D 0 && (width[order[j]] < w))
+		j--;
+
+	    while (j >=3D 0 && (width[order[j]] =3D=3D w) && (tally[order[j]] < t=
))
+		j--;
+
+	    for (k =3D nentries - 1; k > j; k--)
+		order[k + 1] =3D order[k];
+
+	    order[j + 1] =3D i;
+	    nentries++;
+	}
+    }
+}
+
+/*  The function matching_vector determines if the vector specified by	*/
+/*  the input parameter matches a previously considered	vector.  The	*/
+/*  test at the start of the function checks if the vector represents	*/
+/*  a row of shifts over terminal symbols or a row of reductions, or a	*/
+/*  column of shifts over a nonterminal symbol.  Berkeley Yacc does not	*/
+/*  check if a column of shifts over a nonterminal symbols matches a	*/
+/*  previously considered vector.  Because of the nature of LR parsing	*/
+/*  tables, no two columns can match.  Therefore, the only possible	*/
+/*  match would be between a row and a column.  Such matches are	*/
+/*  unlikely.  Therefore, to save time, no attempt is made to see if a	*/
+/*  column matches a previously considered vector.			*/
+/*									*/
+/*  Matching_vector is poorly designed.  The test could easily be made	*/
+/*  faster.  Also, it depends on the vectors being in a specific	*/
+/*  order.								*/
+
+static int
+matching_vector(int vector)
+{
+    int i;
+    int j;
+    int k;
+    int t;
+    int w;
+    int match;
+    int prev;
+
+    i =3D order[vector];
+    if (i >=3D 2 * nstates)
+	return (-1);
+
+    t =3D tally[i];
+    w =3D width[i];
+
+    for (prev =3D vector - 1; prev >=3D 0; prev--)
+    {
+	j =3D order[prev];
+	if (width[j] !=3D w || tally[j] !=3D t)
+	    return (-1);
+
+	match =3D 1;
+	for (k =3D 0; match && k < t; k++)
+	{
+	    if (tos[j][k] !=3D tos[i][k] || froms[j][k] !=3D froms[i][k])
+		match =3D 0;
+	}
+
+	if (match)
+	    return (j);
+    }
+
+    return (-1);
+}
+
+static int
+pack_vector(int vector)
+{
+    int i, j, k, l;
+    int t;
+    int loc;
+    int ok;
+    Value_t *from;
+    Value_t *to;
+    int newmax;
+
+    i =3D order[vector];
+    t =3D tally[i];
+    assert(t);
+
+    from =3D froms[i];
+    to =3D tos[i];
+
+    j =3D lowzero - from[0];
+    for (k =3D 1; k < t; ++k)
+	if (lowzero - from[k] > j)
+	    j =3D lowzero - from[k];
+    for (;; ++j)
+    {
+	if (j =3D=3D 0)
+	    continue;
+	ok =3D 1;
+	for (k =3D 0; ok && k < t; k++)
+	{
+	    loc =3D j + from[k];
+	    if (loc >=3D maxtable - 1)
+	    {
+		if (loc >=3D MAXTABLE - 1)
+		    fatal("maximum table size exceeded");
+
+		newmax =3D maxtable;
+		do
+		{
+		    newmax +=3D 200;
+		}
+		while (newmax <=3D loc);
+
+		table =3D (Value_t *) REALLOC(table, (unsigned)newmax * sizeof(Value_t));
+		NO_SPACE(table);
+
+		check =3D (Value_t *) REALLOC(check, (unsigned)newmax * sizeof(Value_t));
+		NO_SPACE(check);
+
+		for (l =3D maxtable; l < newmax; ++l)
+		{
+		    table[l] =3D 0;
+		    check[l] =3D -1;
+		}
+		maxtable =3D newmax;
+	    }
+
+	    if (check[loc] !=3D -1)
+		ok =3D 0;
+	}
+	for (k =3D 0; ok && k < vector; k++)
+	{
+	    if (pos[k] =3D=3D j)
+		ok =3D 0;
+	}
+	if (ok)
+	{
+	    for (k =3D 0; k < t; k++)
+	    {
+		loc =3D j + from[k];
+		table[loc] =3D to[k];
+		check[loc] =3D from[k];
+		if (loc > high)
+		    high =3D loc;
+	    }
+
+	    while (check[lowzero] !=3D -1)
+		++lowzero;
+
+	    return (j);
+	}
+    }
+}
+
+static void
+pack_table(void)
+{
+    int i;
+    Value_t place;
+    int state;
+
+    base =3D NEW2(nvectors, Value_t);
+    pos =3D NEW2(nentries, Value_t);
+
+    maxtable =3D 1000;
+    table =3D NEW2(maxtable, Value_t);
+    check =3D NEW2(maxtable, Value_t);
+
+    lowzero =3D 0;
+    high =3D 0;
+
+    for (i =3D 0; i < maxtable; i++)
+	check[i] =3D -1;
+
+    for (i =3D 0; i < nentries; i++)
+    {
+	state =3D matching_vector(i);
+
+	if (state < 0)
+	    place =3D (Value_t) pack_vector(i);
+	else
+	    place =3D base[state];
+
+	pos[i] =3D place;
+	base[order[i]] =3D place;
+    }
+
+    for (i =3D 0; i < nvectors; i++)
+    {
+	if (froms[i])
+	    FREE(froms[i]);
+	if (tos[i])
+	    FREE(tos[i]);
+    }
+
+    FREE(froms);
+    FREE(tos);
+    FREE(pos);
+}
+
+static void
+output_base(void)
+{
+    int i, j;
+
+    start_int_table("sindex", base[0]);
+
+    j =3D 10;
+    for (i =3D 1; i < nstates; i++)
+    {
+	if (j >=3D 10)
+	{
+	    output_newline();
+	    j =3D 1;
+	}
+	else
+	    ++j;
+
+	output_int(base[i]);
+    }
+
+    end_table();
+
+    start_int_table("rindex", base[nstates]);
+
+    j =3D 10;
+    for (i =3D nstates + 1; i < 2 * nstates; i++)
+    {
+	if (j >=3D 10)
+	{
+	    output_newline();
+	    j =3D 1;
+	}
+	else
+	    ++j;
+
+	output_int(base[i]);
+    }
+
+    end_table();
+
+    start_int_table("gindex", base[2 * nstates]);
+
+    j =3D 10;
+    for (i =3D 2 * nstates + 1; i < nvectors - 1; i++)
+    {
+	if (j >=3D 10)
+	{
+	    output_newline();
+	    j =3D 1;
+	}
+	else
+	    ++j;
+
+	output_int(base[i]);
+    }
+
+    end_table();
+    FREE(base);
+}
+
+static void
+output_table(void)
+{
+    int i;
+    int j;
+
+    ++outline;
+    fprintf(code_file, "#define YYTABLESIZE %d\n", high);
+    start_int_table("table", table[0]);
+
+    j =3D 10;
+    for (i =3D 1; i <=3D high; i++)
+    {
+	if (j >=3D 10)
+	{
+	    output_newline();
+	    j =3D 1;
+	}
+	else
+	    ++j;
+
+	output_int(table[i]);
+    }
+
+    end_table();
+    FREE(table);
+}
+
+static void
+output_check(void)
+{
+    int i;
+    int j;
+
+    start_int_table("check", check[0]);
+
+    j =3D 10;
+    for (i =3D 1; i <=3D high; i++)
+    {
+	if (j >=3D 10)
+	{
+	    output_newline();
+	    j =3D 1;
+	}
+	else
+	    ++j;
+
+	output_int(check[i]);
+    }
+
+    end_table();
+    FREE(check);
+}
+
+static void
+output_actions(void)
+{
+    nvectors =3D 2 * nstates + nvars;
+
+    froms =3D NEW2(nvectors, Value_t *);
+    tos =3D NEW2(nvectors, Value_t *);
+    tally =3D NEW2(nvectors, Value_t);
+    width =3D NEW2(nvectors, Value_t);
+
+    token_actions();
+    FREE(lookaheads);
+    FREE(LA);
+    FREE(LAruleno);
+    FREE(accessing_symbol);
+
+    goto_actions();
+    FREE(goto_map + ntokens);
+    FREE(from_state);
+    FREE(to_state);
+
+    sort_actions();
+    pack_table();
+    output_base();
+    output_table();
+    output_check();
+}
+
+static int
+is_C_identifier(char *name)
+{
+    char *s;
+    int c;
+
+    s =3D name;
+    c =3D *s;
+    if (c =3D=3D '"')
+    {
+	c =3D *++s;
+	if (!isalpha(c) && c !=3D '_' && c !=3D '$')
+	    return (0);
+	while ((c =3D *++s) !=3D '"')
+	{
+	    if (!isalnum(c) && c !=3D '_' && c !=3D '$')
+		return (0);
+	}
+	return (1);
+    }
+
+    if (!isalpha(c) && c !=3D '_' && c !=3D '$')
+	return (0);
+    while ((c =3D *++s) !=3D 0)
+    {
+	if (!isalnum(c) && c !=3D '_' && c !=3D '$')
+	    return (0);
+    }
+    return (1);
+}
+
+static void
+output_defines(FILE * fp)
+{
+    int c, i;
+    char *s;
+
+    for (i =3D 2; i < ntokens; ++i)
+    {
+	s =3D symbol_name[i];
+	if (is_C_identifier(s) && (!sflag || *s !=3D '"'))
+	{
+	    fprintf(fp, "#define ");
+	    c =3D *s;
+	    if (c =3D=3D '"')
+	    {
+		while ((c =3D *++s) !=3D '"')
+		{
+		    putc(c, fp);
+		}
+	    }
+	    else
+	    {
+		do
+		{
+		    putc(c, fp);
+		}
+		while ((c =3D *++s) !=3D 0);
+	    }
+	    if (fp =3D=3D code_file)
+		++outline;
+	    fprintf(fp, " %d\n", symbol_value[i]);
+	}
+    }
+
+    if (fp =3D=3D code_file)
+	++outline;
+    if (fp !=3D defines_file || iflag)
+	fprintf(fp, "#define YYERRCODE %d\n", symbol_value[1]);
+
+    if (fp =3D=3D defines_file || (iflag && !dflag))
+    {
+	if (unionized)
+	{
+	    rewind(union_file);
+	    while ((c =3D getc(union_file)) !=3D EOF)
+		putc(c, fp);
+	    fprintf(fp, "extern YYSTYPE %slval;\n", symbol_prefix);
+	}
+    }
+}
+
+static void
+output_stored_text(FILE * fp)
+{
+    int c;
+    FILE *in;
+
+    rewind(text_file);
+    if (text_file =3D=3D NULL)
+	open_error("text_file");
+    in =3D text_file;
+    if ((c =3D getc(in)) =3D=3D EOF)
+	return;
+    putc_code(fp, c);
+    while ((c =3D getc(in)) !=3D EOF)
+    {
+	putc_code(fp, c);
+    }
+    write_code_lineno(fp);
+}
+
+static void
+output_debug(void)
+{
+    int i, j, k, max;
+    const char **symnam;
+    const char *s;
+
+    ++outline;
+    fprintf(code_file, "#define YYFINAL %d\n", final_state);
+
+    putl_code(code_file, "#ifndef YYDEBUG\n");
+    ++outline;
+    fprintf(code_file, "#define YYDEBUG %d\n", tflag);
+    putl_code(code_file, "#endif\n");
+
+    if (rflag)
+    {
+	fprintf(output_file, "#ifndef YYDEBUG\n");
+	fprintf(output_file, "#define YYDEBUG %d\n", tflag);
+	fprintf(output_file, "#endif\n");
+    }
+
+    max =3D 0;
+    for (i =3D 2; i < ntokens; ++i)
+	if (symbol_value[i] > max)
+	    max =3D symbol_value[i];
+
+    ++outline;
+    fprintf(code_file, "#define YYMAXTOKEN %d\n", max);
+
+    symnam =3D (const char **)MALLOC((unsigned)(max + 1) * sizeof(char *));
+    NO_SPACE(symnam);
+
+    /* Note that it is  not necessary to initialize the element         */
+    /* symnam[max].                                                     */
+    for (i =3D 0; i < max; ++i)
+	symnam[i] =3D 0;
+    for (i =3D ntokens - 1; i >=3D 2; --i)
+	symnam[symbol_value[i]] =3D symbol_name[i];
+    symnam[0] =3D "end-of-file";
+
+    output_line("#if YYDEBUG");
+
+    start_str_table("name");
+    j =3D 80;
+    for (i =3D 0; i <=3D max; ++i)
+    {
+	if ((s =3D symnam[i]) !=3D 0)
+	{
+	    if (s[0] =3D=3D '"')
+	    {
+		k =3D 7;
+		while (*++s !=3D '"')
+		{
+		    ++k;
+		    if (*s =3D=3D '\\')
+		    {
+			k +=3D 2;
+			if (*++s =3D=3D '\\')
+			    ++k;
+		    }
+		}
+		j +=3D k;
+		if (j > 80)
+		{
+		    output_newline();
+		    j =3D k;
+		}
+		fprintf(output_file, "\"\\\"");
+		s =3D symnam[i];
+		while (*++s !=3D '"')
+		{
+		    if (*s =3D=3D '\\')
+		    {
+			fprintf(output_file, "\\\\");
+			if (*++s =3D=3D '\\')
+			    fprintf(output_file, "\\\\");
+			else
+			    putc(*s, output_file);
+		    }
+		    else
+			putc(*s, output_file);
+		}
+		fprintf(output_file, "\\\"\",");
+	    }
+	    else if (s[0] =3D=3D '\'')
+	    {
+		if (s[1] =3D=3D '"')
+		{
+		    j +=3D 7;
+		    if (j > 80)
+		    {
+			output_newline();
+			j =3D 7;
+		    }
+		    fprintf(output_file, "\"'\\\"'\",");
+		}
+		else
+		{
+		    k =3D 5;
+		    while (*++s !=3D '\'')
+		    {
+			++k;
+			if (*s =3D=3D '\\')
+			{
+			    k +=3D 2;
+			    if (*++s =3D=3D '\\')
+				++k;
+			}
+		    }
+		    j +=3D k;
+		    if (j > 80)
+		    {
+			output_newline();
+			j =3D k;
+		    }
+		    fprintf(output_file, "\"'");
+		    s =3D symnam[i];
+		    while (*++s !=3D '\'')
+		    {
+			if (*s =3D=3D '\\')
+			{
+			    fprintf(output_file, "\\\\");
+			    if (*++s =3D=3D '\\')
+				fprintf(output_file, "\\\\");
+			    else
+				putc(*s, output_file);
+			}
+			else
+			    putc(*s, output_file);
+		    }
+		    fprintf(output_file, "'\",");
+		}
+	    }
+	    else
+	    {
+		k =3D (int)strlen(s) + 3;
+		j +=3D k;
+		if (j > 80)
+		{
+		    output_newline();
+		    j =3D k;
+		}
+		putc('"', output_file);
+		do
+		{
+		    putc(*s, output_file);
+		}
+		while (*++s);
+		fprintf(output_file, "\",");
+	    }
+	}
+	else
+	{
+	    j +=3D 2;
+	    if (j > 80)
+	    {
+		output_newline();
+		j =3D 2;
+	    }
+	    fprintf(output_file, "0,");
+	}
+    }
+    end_table();
+    FREE(symnam);
+
+    start_str_table("rule");
+    for (i =3D 2; i < nrules; ++i)
+    {
+	fprintf(output_file, "\"%s :", symbol_name[rlhs[i]]);
+	for (j =3D rrhs[i]; ritem[j] > 0; ++j)
+	{
+	    s =3D symbol_name[ritem[j]];
+	    if (s[0] =3D=3D '"')
+	    {
+		fprintf(output_file, " \\\"");
+		while (*++s !=3D '"')
+		{
+		    if (*s =3D=3D '\\')
+		    {
+			if (s[1] =3D=3D '\\')
+			    fprintf(output_file, "\\\\\\\\");
+			else
+			    fprintf(output_file, "\\\\%c", s[1]);
+			++s;
+		    }
+		    else
+			putc(*s, output_file);
+		}
+		fprintf(output_file, "\\\"");
+	    }
+	    else if (s[0] =3D=3D '\'')
+	    {
+		if (s[1] =3D=3D '"')
+		    fprintf(output_file, " '\\\"'");
+		else if (s[1] =3D=3D '\\')
+		{
+		    if (s[2] =3D=3D '\\')
+			fprintf(output_file, " '\\\\\\\\");
+		    else
+			fprintf(output_file, " '\\\\%c", s[2]);
+		    s +=3D 2;
+		    while (*++s !=3D '\'')
+			putc(*s, output_file);
+		    putc('\'', output_file);
+		}
+		else
+		    fprintf(output_file, " '%c'", s[1]);
+	    }
+	    else
+		fprintf(output_file, " %s", s);
+	}
+	fprintf(output_file, "\",");
+	output_newline();
+    }
+
+    end_table();
+    output_line("#endif");
+}
+
+static void
+output_pure_parser(FILE * fp)
+{
+    putc_code(fp, '\n');
+
+    if (fp =3D=3D code_file)
+	outline +=3D 1;
+    fprintf(fp, "#define YYPURE %d\n", pure_parser);
+    putc_code(fp, '\n');
+}
+
+static void
+output_stype(FILE * fp)
+{
+    if (!unionized && ntags =3D=3D 0)
+    {
+	putc_code(fp, '\n');
+	putl_code(fp, "#ifndef YYSTYPE\n");
+	putl_code(fp, "typedef int YYSTYPE;\n");
+	putl_code(fp, "#endif\n");
+    }
+}
+
+static void
+output_trailing_text(void)
+{
+    int c, last;
+    FILE *in;
+
+    if (line =3D=3D 0)
+	return;
+
+    in =3D input_file;
+    c =3D *cptr;
+    if (c =3D=3D '\n')
+    {
+	++lineno;
+	if ((c =3D getc(in)) =3D=3D EOF)
+	    return;
+	write_input_lineno();
+	putc_code(code_file, c);
+	last =3D c;
+    }
+    else
+    {
+	write_input_lineno();
+	do
+	{
+	    putc_code(code_file, c);
+	}
+	while ((c =3D *++cptr) !=3D '\n');
+	putc_code(code_file, c);
+	last =3D '\n';
+    }
+
+    while ((c =3D getc(in)) !=3D EOF)
+    {
+	putc_code(code_file, c);
+	last =3D c;
+    }
+
+    if (last !=3D '\n')
+    {
+	putc_code(code_file, '\n');
+    }
+    write_code_lineno(code_file);
+}
+
+static void
+output_semantic_actions(void)
+{
+    int c, last;
+
+    rewind(action_file);
+    if ((c =3D getc(action_file)) =3D=3D EOF)
+	return;
+
+    last =3D c;
+    putc_code(code_file, c);
+    while ((c =3D getc(action_file)) !=3D EOF)
+    {
+	putc_code(code_file, c);
+	last =3D c;
+    }
+
+    if (last !=3D '\n')
+    {
+	putc_code(code_file, '\n');
+    }
+
+    write_code_lineno(code_file);
+}
+
+static void
+output_parse_decl(FILE * fp)
+{
+    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(fp, "void");
+    else
+    {
+	param *p;
+	for (p =3D parse_param; p; p =3D p->next)
+	    fprintf(fp, "%s %s%s%s", p->type, p->name, p->type2,
+		    p->next ? ", " : "");
+    }
+    putl_code(fp, ")\n");
+
+    putl_code(fp, "#endif\n");
+}
+
+static void
+output_lex_decl(FILE * fp)
+{
+    putl_code(fp, "\n");
+    putl_code(fp, "/* Parameters sent to lex. */\n");
+    putl_code(fp, "#ifdef YYLEX_PARAM\n");
+    if (pure_parser)
+    {
+	putl_code(fp, "# ifdef YYLEX_PARAM_TYPE\n");
+	putl_code(fp, "#  define YYLEX_DECL() yylex(YYSTYPE *yylval,"
+		  " YYLEX_PARAM_TYPE YYLEX_PARAM)\n");
+	putl_code(fp, "# else\n");
+	putl_code(fp, "#  define YYLEX_DECL() yylex(YYSTYPE *yylval,"
+		  " void * YYLEX_PARAM)\n");
+	putl_code(fp, "# endif\n");
+	putl_code(fp, "# define YYLEX yylex(&yylval, YYLEX_PARAM)\n");
+    }
+    else
+    {
+	putl_code(fp, "# define YYLEX_DECL() yylex(void *YYLEX_PARAM)\n");
+	putl_code(fp, "# define YYLEX yylex(YYLEX_PARAM)\n");
+    }
+    putl_code(fp, "#else\n");
+    if (pure_parser && lex_param)
+    {
+	param *p;
+	puts_code(fp, "# define YYLEX_DECL() yylex(YYSTYPE *yylval, ");
+	for (p =3D lex_param; p; p =3D p->next)
+	    fprintf(fp, "%s %s%s%s", p->type, p->name, p->type2,
+		    p->next ? ", " : "");
+	putl_code(fp, ")\n");
+
+	puts_code(fp, "# define YYLEX yylex(&yylval, ");
+	for (p =3D lex_param; p; p =3D p->next)
+	    fprintf(fp, "%s%s", p->name, p->next ? ", " : "");
+	putl_code(fp, ")\n");
+    }
+    else if (pure_parser)
+    {
+	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(fp, "# define YYLEX_DECL() yylex(");
+	for (p =3D lex_param; p; p =3D p->next)
+	    fprintf(fp, "%s %s%s%s", p->type, p->name, p->type2,
+		    p->next ? ", " : "");
+	putl_code(fp, ")\n");
+
+	puts_code(fp, "# define YYLEX yylex(");
+	for (p =3D lex_param; p; p =3D p->next)
+	    fprintf(fp, "%s%s", p->name, p->next ? ", " : "");
+	putl_code(fp, ")\n");
+    }
+    else
+    {
+	putl_code(fp, "# define YYLEX_DECL() yylex(void)\n");
+	putl_code(fp, "# define YYLEX yylex()\n");
+    }
+    putl_code(fp, "#endif\n");
+}
+
+static void
+output_error_decl(FILE * fp)
+{
+    putl_code(fp, "\n");
+    putl_code(fp, "/* Parameters sent to yyerror. */\n");
+    if (parse_param)
+    {
+	param *p;
+
+	putl_code(fp, "#ifndef YYERROR_DECL\n");
+	fprintf(fp, "#define YYERROR_DECL() yyerror(");
+	for (p =3D parse_param; p; p =3D p->next)
+	    fprintf(fp, "%s %s%s, ", p->type, p->name, p->type2);
+	putl_code(fp, "const char *s)\n");
+	putl_code(fp, "#endif\n");
+
+	putl_code(fp, "#ifndef YYERROR_CALL\n");
+	puts_code(fp, "#define YYERROR_CALL(msg) yyerror(");
+
+	for (p =3D parse_param; p; p =3D p->next)
+	    fprintf(fp, "%s, ", p->name);
+
+	putl_code(fp, "msg)\n");
+	putl_code(fp, "#endif\n");
+    }
+    else
+    {
+	putl_code(fp, "#ifndef YYERROR_DECL\n");
+	putl_code(fp, "#define YYERROR_DECL() yyerror(const char *s)\n");
+	putl_code(fp, "#endif\n");
+	putl_code(fp, "#ifndef YYERROR_CALL\n");
+	putl_code(fp, "#define YYERROR_CALL(msg) yyerror(msg)\n");
+	putl_code(fp, "#endif\n");
+    }
+}
+
+static void
+free_itemsets(void)
+{
+    core *cp, *next;
+
+    FREE(state_table);
+    for (cp =3D first_state; cp; cp =3D next)
+    {
+	next =3D cp->next;
+	FREE(cp);
+    }
+}
+
+static void
+free_shifts(void)
+{
+    shifts *sp, *next;
+
+    FREE(shift_table);
+    for (sp =3D first_shift; sp; sp =3D next)
+    {
+	next =3D sp->next;
+	FREE(sp);
+    }
+}
+
+static void
+free_reductions(void)
+{
+    reductions *rp, *next;
+
+    FREE(reduction_table);
+    for (rp =3D first_reduction; rp; rp =3D next)
+    {
+	next =3D rp->next;
+	FREE(rp);
+    }
+}
+
+static void
+output_yyerror_call(const char *msg)
+{
+    FILE *fp =3D code_file;
+
+    puts_code(fp, "    yyerror(");
+    if (parse_param)
+    {
+	param *p;
+	for (p =3D parse_param; p; p =3D p->next)
+	    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 =3D 0; (s =3D section[i]) !=3D 0; ++i)
+    {
+	if (*s && *s !=3D '#')
+	    fputs("extern\t", fp);
+	while ((c =3D *s) !=3D 0)
+	{
+	    putc(c, fp);
+	    ++s;
+	}
+	if (fp =3D=3D code_file)
+	    ++outline;
+	putc('\n', fp);
+    }
+}
+
+void
+output(void)
+{
+    FILE *fp;
+
+    free_itemsets();
+    free_shifts();
+    free_reductions();
+
+    if (iflag)
+    {
+	++outline;
+	fprintf(code_file, "#include \"%s\"\n", externs_file_name);
+	fp =3D externs_file;
+    }
+    else
+	fp =3D 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();
+    free_parser();
+    output_debug();
+    if (rflag)
+    {
+	output_prefix(code_file);
+	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(code_file, hdr_defs);
+    if (!pure_parser)
+    {
+	write_section(code_file, hdr_vars);
+    }
+    output_trailing_text();
+    write_section(code_file, body_1);
+    if (pure_parser)
+    {
+	write_section(code_file, body_vars);
+    }
+    write_section(code_file, body_2);
+    output_yyerror_call("syntax error");
+    write_section(code_file, body_3);
+    output_semantic_actions();
+    write_section(code_file, trailer);
+    output_yyerror_call("yacc stack overflow");
+    write_section(code_file, trailer_2);
+}
+
+#ifdef NO_LEAKS
+void
+output_leaks(void)
+{
+    DO_FREE(tally);
+    DO_FREE(width);
+    DO_FREE(order);
+}
+#endif
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/package/byacc.spec
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/package/byacc.spec	Wed Jul 25 16:21:35 2012 +0300
@@ -0,0 +1,60 @@
+Summary: byacc - public domain Berkeley LALR Yacc parser generator
+%define AppProgram byacc
+%define AppVersion 20120115
+%define UseProgram yacc
+# $XTermId: byacc.spec,v 1.13 2012/01/15 19:30:29 tom Exp $
+Name: %{AppProgram}
+Version: %{AppVersion}
+Release: 1
+License: Public Domain, MIT
+Group: Applications/Development
+URL: ftp://invisible-island.net/%{AppProgram}
+Source0: %{AppProgram}-%{AppVersion}.tgz
+Packager: Thomas Dickey <dickey at invisible-island.net>
+
+%description
+This package provides a parser generator utility that reads a grammar
+specification from a file and generates an LR(1) parser for it.  The
+parsers consist of a set of LALR(1) parsing tables and a driver
+routine written in the C programming language.  It has a public domain
+license which includes the generated C.
+
+%prep
+
+%setup -q -n %{AppProgram}-%{AppVersion}
+
+%build
+
+INSTALL_PROGRAM=3D'${INSTALL}' \
+	./configure \
+		--program-prefix=3Db \
+		--target %{_target_platform} \
+		--prefix=3D%{_prefix} \
+		--bindir=3D%{_bindir} \
+		--libdir=3D%{_libdir} \
+		--mandir=3D%{_mandir}
+
+make
+
+%install
+[ "$RPM_BUILD_ROOT" !=3D "/" ] && rm -rf $RPM_BUILD_ROOT
+
+make install                    DESTDIR=3D$RPM_BUILD_ROOT
+( cd $RPM_BUILD_ROOT%{_bindir} && ln -s %{AppProgram} %{UseProgram} )
+
+strip $RPM_BUILD_ROOT%{_bindir}/%{AppProgram}
+
+%clean
+[ "$RPM_BUILD_ROOT" !=3D "/" ] && rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(-,root,root)
+%{_prefix}/bin/%{AppProgram}
+%{_prefix}/bin/%{UseProgram}
+%{_mandir}/man1/%{AppProgram}.*
+
+%changelog
+# each patch should add its ChangeLog entries here
+
+* Sun Jun 06 2010 Thomas Dickey
+- initial version
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/package/debian/chan=
gelog
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/package/debian/changelog	Wed Jul 25 16:21:35 2012 =
+0300
@@ -0,0 +1,223 @@
+byacc (20120115) unstable; urgency=3Dlow
+
+  * add testcases, improve documentation for "-s" option.
+
+ -- Thomas E. Dickey <dickey at invisible-island.net>  Fri, 13 Jan 2012 20:44=
:34 -0500
+
+byacc (20111219) unstable; urgency=3Dlow
+
+  * add "-s" option.
+
+ -- Thomas E. Dickey <dickey at invisible-island.net>  Mon, 19 Dec 2011 20:54=
:09 -0500
+
+byacc (20110908) unstable; urgency=3Dlow
+
+  * add "-i" option.
+  * add error-check in reader.c
+
+ -- Thomas E. Dickey <dickey at invisible-island.net>  Mon, 05 Sep 2011 20:05=
:51 -0400
+
+byacc (20101229) unstable; urgency=3Dlow
+
+  * fixes from Christos Zoulos
+
+ -- Thomas E. Dickey <dickey at invisible-island.net>  Wed, 29 Dec 2010 13:03=
:50 -0500
+
+byacc (20101226) unstable; urgency=3Dlow
+
+  * portability fix for MinGW
+
+ -- Thomas E. Dickey <dickey at invisible-island.net>  Sat, 25 Dec 2010 19:37=
:54 -0500
+
+byacc (20101127) unstable; urgency=3Dlow
+
+  * corrected yyerror use of %parse-param data
+
+ -- Thomas E. Dickey <dickey at invisible-island.net>  Sat, 27 Nov 2010 12:32=
:00 -0500
+
+byacc (20101126) unstable; urgency=3Dlow
+
+  * additional fix to generated code to avoid symbol conflict
+
+ -- Thomas E. Dickey <dickey at invisible-island.net>  Fri, 26 Nov 2010 04:23=
:08 -0500
+
+byacc (20101124) unstable; urgency=3Dlow
+
+  * amend fix for Red Hat #112617 to restore warning message.
+
+ -- Thomas E. Dickey <dickey at invisible-island.net>  Mon, 22 Nov 2010 08:21=
:23 -0500
+
+byacc (20101122) unstable; urgency=3Dlow
+
+  * fix for generated header to avoid symbol conflict
+
+ -- Thomas E. Dickey <dickey at invisible-island.net>  Mon, 22 Nov 2010 08:21=
:23 -0500
+
+byacc (20100610) unstable; urgency=3Dlow
+
+  * Add package scripts to upstream source, for test-builds.
+
+ -- Thomas E. Dickey <dickey at invisible-island.net>  Thu, 10 Jun 2010 08:59=
:11 -0400
+
+byacc (20100216-1) unstable; urgency=3Dlow
+
+  * New upstream release
+  * debian/source/format: Added using format "3.0 (quilt)"
+
+ -- Dave Beckett <dajobe at debian.org>  Tue, 20 Apr 2010 12:56:11 -0700
+
+byacc (20091027-1) unstable; urgency=3Dlow
+
+  * New upstream release
+  * debian/control:
+    - Updated to policy 3.8.4
+    - Add ${misc:Depends}
+
+ -- Dave Beckett <dajobe at debian.org>  Tue, 02 Feb 2010 21:36:34 -0800
+
+byacc (20090221-1) unstable; urgency=3Dlow
+
+  * New upstream release
+
+ -- Dave Beckett <dajobe at debian.org>  Thu, 26 Feb 2009 21:06:20 -0800
+
+byacc (20080826-1) unstable; urgency=3Dhigh
+
+  * New upstream release
+  * debian/patches/02-skeleton.patch: Removed - merged upstream
+  * debian/control: Updated to policy 3.8.0
+  * debian/preinst, debian/postrm: removed - empty (lintian)
+  * debian/watch: version 3 and make FTP passive
+  * Acknowledge NMU - thanks.
+
+ -- Dave Beckett <dajobe at debian.org>  Wed, 11 Sep 2008 23:58:00 -0700
+
+byacc (20070509-1.1) unstable; urgency=3Dhigh
+
+  * Non-maintainer upload.
+  * Fix stack overflow in skeleton.c with upstream patch.
+    Closes: #491182 aka CVE-2008-3196
+
+ -- Thomas Viehmann <tv at beamnet.de>  Sun, 24 Aug 2008 23:13:07 +0200
+
+byacc (20070509-1) unstable; urgency=3Dlow
+
+  * New upstream release
+  * debian/watch: Fix to use passive FTP
+  * debian/compat: added instead of use of DH_COMPAT in debian/rules
+
+ -- Dave Beckett <dajobe at debian.org>  Tue, 26 Jun 2007 22:39:45 -0700
+
+byacc (20050813-1) unstable; urgency=3Dlow
+
+  * New upstream release:
+    - Do not close union_file for -d option (Closes: #322858)
+
+ -- Dave Beckett <dajobe at debian.org>  Sun, 14 Aug 2005 10:14:12 +0100
+
+byacc (20050505-1) unstable; urgency=3Dlow
+
+  * New maintainer (Closes: #321377)
+  * Switch to new upstream and new source (Closes: #240662)
+  * debian/copyright: Update to new upstream and add source information
+    (Closes: #166300)
+  * Acknowledge fix in NMUs (Closes: #283174)
+  * New manual page does not have the formatting problem (Closes: #100947)
+  * Added debian/watch file.
+
+ -- Dave Beckett <dajobe at debian.org>  Fri,  5 Aug 2005 22:50:20 +0100
+
+byacc (1.9.1-1.1) unstable; urgency=3Dlow
+
+  * Remove alternative in prerm.  Closes: #283174
+
+ -- LaMont Jones <lamont at debian.org>  Fri, 26 Nov 2004 18:49:09 -0700
+
+byacc (1.9.1-1) unstable; urgency=3Dlow
+
+  * Maintainer upload.
+  * Fixed alternatives entry, closes: Bug#146195;
+  * Changed priority to "extra" at behest of Daniel Bungert,
+    closes: Bug#142271.
+  * Fixed awful packaging error which meant the test/ directory was exclud=
ed
+    from the orig.tar.gz.
+
+ -- Jason Henry Parker <henry at debian.org>  Fri, 27 Sep 2002 16:25:27 -0400
+
+byacc (1.9-13.1) unstable; urgency=3Dlow
+
+  * Non-maintainer upload
+  * Removed erraneous escapes in manpage - some data wasn't visable,
+    closes: Bug#100947
+  * Alternatives entry added, closes: Bug#113168
+  * Standards-version: 3.5.6
+  * Maintainer script cleaning
+
+ -- Daniel Bungert <drb at debian.org>  Fri, 29 Mar 2002 16:58:30 -0500
+
+byacc (1.9-13) unstable; urgency=3Dlow
+
+  * Applied patch from "Randolph Chung" <tausq at debian.org> to fix build pr=
oblems
+    on ia64, closes: Bug#91966
+
+ -- Jason Henry Parker <henry at debian.org>  Thu, 29 Mar 2001 21:41:19 +1000
+
+byacc (1.9-12) unstable; urgency=3Dlow
+
+  * Updated to latest version of debhelper, and Standards-Version: 3.2.1.0=
, closes: Bug#81444
+  * Added Build-Depends: debhelper, closes: Bug#70207
+  * Removed mktemp() calls in main.c
+ =20
+ -- Jason Henry Parker <henry at debian.org>  Mon, 18 Dec 2000 08:02:54 +1000
+
+byacc (1.9-11.7) unstable; urgency=3Dlow
+
+  * New maintainer.
+  * Updated to dh_make and standards version 2.4.0.0, no lintian errors
+    or warnings.
+  * Added several more files from the upstream distribution to
+    /usr/doc/byacc.
+
+ -- Jason Henry Parker <henry at debian.org>  Sat,  2 Jan 1999 03:04:17 +1000
+
+byacc (1.9-11.6) unstable; urgency=3Dlow
+
+  * Patch by <mdorman at law.miami.edu> to remove some
+    superfluous files that can interfere with the build process on other
+    architectures. (Bug #21607).
+
+ -- Vincent Renardias <vincent at waw.com>  Fri, 24 Apr 1998 19:56:58 +0200
+
+byacc (1.9-11.5) unstable; urgency=3Dlow
+
+  * Added 'binary-arch' target in debian/rules (Bug #12742).
+
+ -- Vincent Renardias <vincent at waw.com>  Sun, 9 Nov 1997 23:37:31 +0100
+
+byacc (1.9-11.4) unstable; urgency=3Dlow
+
+  * Cosmetic change (Fix bug #9623).
+
+ -- Vincent Renardias <vincent at waw.com>  Fri, 9 May 1997 16:30:24 +0200
+
+byacc (1.9-11.3) unstable; urgency=3Dlow
+
+  * Rebuilt with libc6.
+
+ -- Debian QA Group <debian-qa at lists.debian.org>  Thu, 1 May 1997 22:02:04=
 +0200
+
+byacc (1.9-11.2) unstable; urgency=3Dlow
+
+  * Orphaned the package at his maintainer's request (dgregor at coil.com).
+
+ -- Debian QA Group <debian-qa at lists.debian.org>  Sun, 20 Apr 1997 20:03:0=
3 +0200
+
+byacc (1.9-11.1) unstable; urgency=3Dlow
+
+  * Converted to new source format (Fixes #8085).
+  * Compressed manpage.
+  * Fixed to allow compilation on non-i386 (Fixes #3361).
+  * Added extended description (Fixes #3567).
+  * Added diversion to avoid conflict with bison (Fixes #8086).=20
+
+ -- Vincent Renardias <vincent at waw.com>  Sun, 20 Apr 1997 15:59:28 +0200
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/package/debian/comp=
at
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/package/debian/compat	Wed Jul 25 16:21:35 2012 +03=
00
@@ -0,0 +1,1 @@
+5
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/package/debian/cont=
rol
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/package/debian/control	Wed Jul 25 16:21:35 2012 +0=
300
@@ -0,0 +1,17 @@
+Source: byacc
+Maintainer: Dave Beckett <dajobe at debian.org>
+Section: devel
+Priority: extra
+Standards-Version: 3.8.4
+Build-Depends: debhelper (>=3D 5)
+Homepage: http://invisible-island.net/byacc/
+
+Package: byacc
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: public domain Berkeley LALR Yacc parser generator
+ This package provides a parser generator utility that reads a grammar
+ specification from a file and generates an LR(1) parser for it.  The
+ parsers consist of a set of LALR(1) parsing tables and a driver
+ routine written in the C programming language.  It has a public domain
+ license which includes the generated C.
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/package/debian/copy=
right
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/package/debian/copyright	Wed Jul 25 16:21:35 2012 =
+0300
@@ -0,0 +1,120 @@
+Upstream source http://dickey.his.com/byacc/byacc.html
+
+Berkeley Yacc is in the public domain; changes made to it by the current
+maintainer are likewise unrestricted.  That applies to most of the files.
+A few files (currently those related to autoconf scripting) have other
+licenses as noted here.
+
+Current byacc upstream maintainer: Thomas Dickey <dickey at invisible-island.=
net>
+
+Public domain notice and no warranty:
+--------------------------------------------------------------------------=
-----
+    Berkeley Yacc is an LALR(1) parser generator.  Berkeley Yacc has been =
made
+as compatible as possible with AT&T Yacc.  Berkeley Yacc can accept any in=
put
+specification that conforms to the AT&T Yacc documentation.  Specifications
+that take advantage of undocumented features of AT&T Yacc will probably be
+rejected.
+
+    Berkeley Yacc is distributed with no warranty whatever.  The code
+is certain to contain errors.  Neither the author nor any contributor
+takes responsibility for any consequences of its use.
+
+    Berkeley Yacc is in the public domain.  The data structures and algori=
thms
+used in Berkeley Yacc are all either taken from documents available to the
+general public or are inventions of the author.  Anyone may freely distrib=
ute
+source or binary forms of Berkeley Yacc whether unchanged or modified.
+Distributers may charge whatever fees they can obtain for Berkeley Yacc.
+Programs generated by Berkeley Yacc may be distributed freely.
+
+    Please report bugs to
+
+			robert.corbett at eng.Sun.COM
+
+Include a small example if possible.  Please include the banner string from
+skeleton.c with the bug report.  Do not expect rapid responses.
+--------------------------------------------------------------------------=
-----
+
+Files: aclocal.m4
+Licence: other-BSD
+Copyright:  2004-2011,2012 by Thomas E. Dickey
+    Permission is hereby granted, free of charge, to any person obtaining a
+    copy of this software and associated documentation files (the
+    "Software"), to deal in the Software without restriction, including
+    without limitation the rights to use, copy, modify, merge, publish,
+    distribute, distribute with modifications, sublicense, and/or sell
+    copies of the Software, and to permit persons to whom the Software is
+    furnished to do so, subject to the following conditions:
+   =20
+    The above copyright notice and this permission notice shall be included
+    in all copies or portions of the Software.
+   =20
+    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+    OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+    IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+    DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+    OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
+    THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+   =20
+    Except as contained in this notice, the name(s) of the above copyright
+    holders shall not be used in advertising or otherwise to promote the
+    sale, use or other dealings in this Software without prior written
+    authorization.
+
+Files: install-sh
+Copyright:  1994 X Consortium
+Licence: other-BSD
+    Permission is hereby granted, free of charge, to any person obtaining =
a copy
+    of this software and associated documentation files (the "Software"), =
to
+    deal in the Software without restriction, including without limitation=
 the
+    rights to use, copy, modify, merge, publish, distribute, sublicense, a=
nd/or
+    sell copies of the Software, and to permit persons to whom the Softwar=
e is
+    furnished to do so, subject to the following conditions:
+
+    The above copyright notice and this permission notice shall be include=
d in
+    all copies or substantial portions of the Software.
+
+    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRES=
S OR
+    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILIT=
Y,
+    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHA=
LL THE
+    X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHET=
HER IN
+    AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN C=
ONNEC-
+    TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+    Except as contained in this notice, the name of the X Consortium shall=
 not
+    be used in advertising or otherwise to promote the sale, use or other =
deal-
+    ings in this Software without prior written authorization from the X C=
onsor-
+    tium.
+
+    FSF changes to this file are in the public domain.
+
+    Calling this script install-sh is preferred over install.sh, to prevent
+    `make' implicit rules from creating a file called install from it
+    when there is no Makefile.
+
+    This script is compatible with the BSD install script, but was written
+    from scratch.  It can only install one file at a time, a restriction
+    shared with many OS's install programs.
+
+Files: debian/*
+Copyright:  2012 Thomas E. Dickey
+Licence: other-BSD
+    Permission to use, copy, modify, and distribute this software and its
+    documentation for any purpose and without fee is hereby granted,
+    provided that the above copyright notice appear in all copies and that
+    both that copyright notice and this permission notice appear in
+    supporting documentation, and that the name of the above listed
+    copyright holder(s) not be used in advertising or publicity pertaining
+    to distribution of the software without specific, written prior
+    permission.
+
+    THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGA=
RD
+    TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+    AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
+    LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAG=
ES
+    WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+    ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+    OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+On Debian systems, the complete text of the GNU General
+Public License can be found in '/usr/share/common-licenses/GPL-2'
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/package/debian/docs
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/package/debian/docs	Wed Jul 25 16:21:35 2012 +0300
@@ -0,0 +1,4 @@
+README
+ACKNOWLEDGEMENTS
+NEW_FEATURES
+NOTES
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/package/debian/post=
inst
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/package/debian/postinst	Wed Jul 25 16:21:35 2012 +=
0300
@@ -0,0 +1,15 @@
+#! /bin/sh
+# postinst script for byacc
+
+set -e
+
+if [ $1 !=3D "upgrade" ] ; then
+	update-alternatives \
+		--install /usr/bin/yacc yacc /usr/bin/byacc 80 \
+		--slave /usr/share/man/man1/yacc.1.gz yaccman \
+			/usr/share/man/man1/byacc.1.gz
+fi
+
+#DEBHELPER#
+
+exit 0
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/package/debian/prerm
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/package/debian/prerm	Wed Jul 25 16:21:35 2012 +0300
@@ -0,0 +1,12 @@
+#! /bin/sh
+# prerm script for byacc
+
+set -e
+
+if [ $1 !=3D "upgrade" ]; then
+	update-alternatives --remove yacc /usr/bin/byacc
+fi
+
+#DEBHELPER#
+
+exit 0
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/package/debian/rules
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/package/debian/rules	Wed Jul 25 16:21:35 2012 +0300
@@ -0,0 +1,93 @@
+#!/usr/bin/make -f
+# MAde with the aid of dh_make, by Craig Small
+# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
+# Some lines taken from debmake, by Cristoph Lameter.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=3D1
+
+# These are used for cross-compiling and for saving the configure script
+# from having to guess our platform (since we know it already)
+DEB_HOST_GNU_TYPE   ?=3D $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+DEB_BUILD_GNU_TYPE  ?=3D $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+
+CFLAGS =3D
+
+ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+        CFLAGS +=3D -O0
+else
+        CFLAGS +=3D -O2
+endif
+ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
+        INSTALL_PROGRAM +=3D -s
+endif
+
+
+configure: configure-stamp
+configure-stamp:
+	dh_testdir
+
+	CFLAGS=3D"$(CFLAGS)" ./configure \
+		--host=3D$(DEB_HOST_GNU_TYPE) \
+		--build=3D$(DEB_BUILD_GNU_TYPE) \
+		--prefix=3D/usr \
+		--mandir=3D\$${prefix}/share/man \
+		--sysconfdir=3D/etc \
+		--program-transform-name=3D's,^,b,'
+
+	touch configure-stamp
+
+build: build-stamp
+build-stamp: configure-stamp
+	dh_testdir
+
+	$(MAKE)
+
+	touch build-stamp
+
+clean:
+	dh_testdir
+	dh_testroot
+
+	[ ! -f Makefile ] || $(MAKE) clean
+
+	rm -f configure-stamp build-stamp install-stamp \
+		config.cache config.h config.status config.log makefile
+
+	rm -f *.o yacc
+
+	dh_clean
+
+install: install-stamp
+install-stamp: build-stamp
+	dh_testdir
+	dh_testroot
+	dh_clean -k
+	dh_installdirs
+
+	$(MAKE) install DESTDIR=3D$(CURDIR)/debian/byacc
+
+	touch install-stamp
+
+# Build architecture-independent files here.
+binary-indep: build install
+# No binary-indep target.
+
+# Build architecture-dependent files here.
+binary-arch: build install
+	dh_testdir
+	dh_testroot
+	dh_installdocs
+	dh_installexamples
+	dh_installchangelogs CHANGES
+	dh_strip
+	dh_compress
+	dh_fixperms
+	dh_installdeb
+	dh_shlibdeps
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install install-stamp
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/package/debian/sour=
ce/format
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/package/debian/source/format	Wed Jul 25 16:21:35 2=
012 +0300
@@ -0,0 +1,1 @@
+3.0 (quilt)
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/package/debian/watch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/package/debian/watch	Wed Jul 25 16:21:35 2012 +0300
@@ -0,0 +1,4 @@
+version=3D3
+
+opts=3Dpassive ftp://invisible-island.net/byacc/byacc-(\d+)\.tgz \
+ debian  uupdate
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/package/pkgsrc/DESCR
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/package/pkgsrc/DESCR	Wed Jul 25 16:21:35 2012 +0300
@@ -0,0 +1,6 @@
+Berkeley Yacc (byacc) is a LALR(1) parser generator.  Berkeley Yacc
+has been made as compatible as possible with AT&T Yacc.  Berkeley
+Yacc can accept any input specification that conforms to the AT&T
+Yacc documentation.
+
+Some programs depend on a byacc (instead of bison).
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/package/pkgsrc/Make=
file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/package/pkgsrc/Makefile	Wed Jul 25 16:21:35 2012 +=
0300
@@ -0,0 +1,19 @@
+# $NetBSD: Makefile,v 1.9 2008/07/24 17:13:00 tonnerre Exp $
+#
+
+DISTNAME=3D	byacc-20050813
+PKGREVISION=3D	1
+CATEGORIES=3D	devel
+MASTER_SITES=3D	ftp://invisible-island.net/byacc/
+EXTRACT_SUFX=3D	.tgz
+
+MAINTAINER=3D	pkgsrc-users at NetBSD.org
+HOMEPAGE=3D	http://dickey.his.com/byacc/byacc.html
+COMMENT=3D	Berkeley Yacc
+
+PKG_DESTDIR_SUPPORT=3D	user-destdir
+
+GNU_CONFIGURE=3D	YES
+MAKE_FILE=3D	makefile
+
+.include "../../mk/bsd.pkg.mk"
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/package/pkgsrc/PLIST
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/package/pkgsrc/PLIST	Wed Jul 25 16:21:35 2012 +0300
@@ -0,0 +1,3 @@
+ at comment $NetBSD: PLIST,v 1.2 2005/04/13 14:11:54 wiz Exp $
+bin/yacc
+man/man1/yacc.1
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/package/pkgsrc/dist=
info
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/package/pkgsrc/distinfo	Wed Jul 25 16:21:35 2012 +=
0300
@@ -0,0 +1,6 @@
+$NetBSD: distinfo,v 1.4 2008/07/24 17:13:00 tonnerre Exp $
+
+SHA1 (byacc-20050813.tgz) =3D 3258494f3422eb3150944c1823af1c9c2c386062
+RMD160 (byacc-20050813.tgz) =3D 3ee159857a79025a83e2b0807577925fe460f816
+Size (byacc-20050813.tgz) =3D 138684 bytes
+SHA1 (patch-aa) =3D decae78775a5e0f1e1f7aaaa258da53903aa1f7a
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/reader.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/reader.c	Wed Jul 25 16:21:35 2012 +0300
@@ -0,0 +1,2254 @@
+/* $Id: reader.c,v 1.33 2011/09/06 22:56:53 tom Exp $ */
+
+#include "defs.h"
+
+/*  The line size must be a positive integer.  One hundred was chosen	*/
+/*  because few lines in Yacc input grammars exceed 100 characters.	*/
+/*  Note that if a line exceeds LINESIZE characters, the line buffer	*/
+/*  will be expanded to accomodate it.					*/
+
+#define LINESIZE 100
+
+#define L_CURL '{'
+#define R_CURL '}'
+
+static void start_rule(bucket *bp, int s_lineno);
+
+static char *cache;
+static int cinc, cache_size;
+
+int ntags;
+static int tagmax;
+static char **tag_table;
+
+static char saw_eof;
+char unionized;
+char *cptr, *line;
+static int linesize;
+
+static bucket *goal;
+static Value_t prec;
+static int gensym;
+static char last_was_action;
+
+static int maxitems;
+static bucket **pitem;
+
+static int maxrules;
+static bucket **plhs;
+
+static size_t name_pool_size;
+static char *name_pool;
+
+char line_format[] =3D "#line %d \"%s\"\n";
+
+param *lex_param;
+param *parse_param;
+
+static void
+cachec(int c)
+{
+    assert(cinc >=3D 0);
+    if (cinc >=3D cache_size)
+    {
+	cache_size +=3D 256;
+	cache =3D REALLOC(cache, cache_size);
+	NO_SPACE(cache);
+    }
+    cache[cinc] =3D (char)c;
+    ++cinc;
+}
+
+static void
+get_line(void)
+{
+    FILE *f =3D input_file;
+    int c;
+    int i;
+
+    if (saw_eof || (c =3D getc(f)) =3D=3D EOF)
+    {
+	if (line)
+	{
+	    FREE(line);
+	    line =3D 0;
+	}
+	cptr =3D 0;
+	saw_eof =3D 1;
+	return;
+    }
+
+    if (line =3D=3D 0 || linesize !=3D (LINESIZE + 1))
+    {
+	if (line)
+	    FREE(line);
+	linesize =3D LINESIZE + 1;
+	line =3D MALLOC(linesize);
+	NO_SPACE(line);
+    }
+
+    i =3D 0;
+    ++lineno;
+    for (;;)
+    {
+	line[i] =3D (char)c;
+	if (c =3D=3D '\n')
+	{
+	    cptr =3D line;
+	    return;
+	}
+	if (++i >=3D linesize)
+	{
+	    linesize +=3D LINESIZE;
+	    line =3D REALLOC(line, linesize);
+	    NO_SPACE(line);
+	}
+	c =3D getc(f);
+	if (c =3D=3D EOF)
+	{
+	    line[i] =3D '\n';
+	    saw_eof =3D 1;
+	    cptr =3D line;
+	    return;
+	}
+    }
+}
+
+static char *
+dup_line(void)
+{
+    char *p, *s, *t;
+
+    if (line =3D=3D 0)
+	return (0);
+    s =3D line;
+    while (*s !=3D '\n')
+	++s;
+    p =3D MALLOC(s - line + 1);
+    NO_SPACE(p);
+
+    s =3D line;
+    t =3D p;
+    while ((*t++ =3D *s++) !=3D '\n')
+	continue;
+    return (p);
+}
+
+static void
+skip_comment(void)
+{
+    char *s;
+
+    int st_lineno =3D lineno;
+    char *st_line =3D dup_line();
+    char *st_cptr =3D st_line + (cptr - line);
+
+    s =3D cptr + 2;
+    for (;;)
+    {
+	if (*s =3D=3D '*' && s[1] =3D=3D '/')
+	{
+	    cptr =3D s + 2;
+	    FREE(st_line);
+	    return;
+	}
+	if (*s =3D=3D '\n')
+	{
+	    get_line();
+	    if (line =3D=3D 0)
+		unterminated_comment(st_lineno, st_line, st_cptr);
+	    s =3D cptr;
+	}
+	else
+	    ++s;
+    }
+}
+
+static int
+nextc(void)
+{
+    char *s;
+
+    if (line =3D=3D 0)
+    {
+	get_line();
+	if (line =3D=3D 0)
+	    return (EOF);
+    }
+
+    s =3D cptr;
+    for (;;)
+    {
+	switch (*s)
+	{
+	case '\n':
+	    get_line();
+	    if (line =3D=3D 0)
+		return (EOF);
+	    s =3D cptr;
+	    break;
+
+	case ' ':
+	case '\t':
+	case '\f':
+	case '\r':
+	case '\v':
+	case ',':
+	case ';':
+	    ++s;
+	    break;
+
+	case '\\':
+	    cptr =3D s;
+	    return ('%');
+
+	case '/':
+	    if (s[1] =3D=3D '*')
+	    {
+		cptr =3D s;
+		skip_comment();
+		s =3D cptr;
+		break;
+	    }
+	    else if (s[1] =3D=3D '/')
+	    {
+		get_line();
+		if (line =3D=3D 0)
+		    return (EOF);
+		s =3D cptr;
+		break;
+	    }
+	    /* FALLTHRU */
+
+	default:
+	    cptr =3D s;
+	    return (*s);
+	}
+    }
+}
+
+/*
+ * Compare keyword to cached token, treating '_' and '-' the same.  Some
+ * grammars rely upon this misfeature.
+ */
+static int
+matchec(const char *name)
+{
+    const char *p =3D cache;
+    const char *q =3D name;
+    int code =3D 0;	/* assume mismatch */
+
+    while (*p !=3D '\0' && *q !=3D '\0')
+    {
+	char a =3D *p++;
+	char b =3D *q++;
+	if (a =3D=3D '_')
+	    a =3D '-';
+	if (b =3D=3D '_')
+	    b =3D '-';
+	if (a !=3D b)
+	    break;
+	if (*p =3D=3D '\0' && *q =3D=3D '\0')
+	{
+	    code =3D 1;
+	    break;
+	}
+    }
+    return code;
+}
+
+static int
+keyword(void)
+{
+    int c;
+    char *t_cptr =3D cptr;
+
+    c =3D *++cptr;
+    if (isalpha(c))
+    {
+	cinc =3D 0;
+	for (;;)
+	{
+	    if (isalpha(c))
+	    {
+		if (isupper(c))
+		    c =3D tolower(c);
+		cachec(c);
+	    }
+	    else if (isdigit(c)
+		     || c =3D=3D '-'
+		     || c =3D=3D '_'
+		     || c =3D=3D '.'
+		     || c =3D=3D '$')
+	    {
+		cachec(c);
+	    }
+	    else
+	    {
+		break;
+	    }
+	    c =3D *++cptr;
+	}
+	cachec(NUL);
+
+	if (matchec("token") || matchec("term"))
+	    return (TOKEN);
+	if (matchec("type"))
+	    return (TYPE);
+	if (matchec("left"))
+	    return (LEFT);
+	if (matchec("right"))
+	    return (RIGHT);
+	if (matchec("nonassoc") || matchec("binary"))
+	    return (NONASSOC);
+	if (matchec("start"))
+	    return (START);
+	if (matchec("union"))
+	    return (UNION);
+	if (matchec("ident"))
+	    return (IDENT);
+	if (matchec("expect"))
+	    return (EXPECT);
+	if (matchec("expect-rr"))
+	    return (EXPECT_RR);
+	if (matchec("pure-parser"))
+	    return (PURE_PARSER);
+	if (matchec("parse-param"))
+	    return (PARSE_PARAM);
+	if (matchec("lex-param"))
+	    return (LEX_PARAM);
+	if (matchec("yacc"))
+	    return (POSIX_YACC);
+    }
+    else
+    {
+	++cptr;
+	if (c =3D=3D L_CURL)
+	    return (TEXT);
+	if (c =3D=3D '%' || c =3D=3D '\\')
+	    return (MARK);
+	if (c =3D=3D '<')
+	    return (LEFT);
+	if (c =3D=3D '>')
+	    return (RIGHT);
+	if (c =3D=3D '0')
+	    return (TOKEN);
+	if (c =3D=3D '2')
+	    return (NONASSOC);
+    }
+    syntax_error(lineno, line, t_cptr);
+    /*NOTREACHED */
+    return (-1);
+}
+
+static void
+copy_ident(void)
+{
+    int c;
+    FILE *f =3D output_file;
+
+    c =3D nextc();
+    if (c =3D=3D EOF)
+	unexpected_EOF();
+    if (c !=3D '"')
+	syntax_error(lineno, line, cptr);
+    ++outline;
+    fprintf(f, "#ident \"");
+    for (;;)
+    {
+	c =3D *++cptr;
+	if (c =3D=3D '\n')
+	{
+	    fprintf(f, "\"\n");
+	    return;
+	}
+	putc(c, f);
+	if (c =3D=3D '"')
+	{
+	    putc('\n', f);
+	    ++cptr;
+	    return;
+	}
+    }
+}
+
+static void
+copy_text(void)
+{
+    int c;
+    int quote;
+    FILE *f =3D text_file;
+    int need_newline =3D 0;
+    int t_lineno =3D lineno;
+    char *t_line =3D dup_line();
+    char *t_cptr =3D t_line + (cptr - line - 2);
+
+    if (*cptr =3D=3D '\n')
+    {
+	get_line();
+	if (line =3D=3D 0)
+	    unterminated_text(t_lineno, t_line, t_cptr);
+    }
+    if (!lflag)
+	fprintf(f, line_format, lineno, input_file_name);
+
+  loop:
+    c =3D *cptr++;
+    switch (c)
+    {
+    case '\n':
+      next_line:
+	putc('\n', f);
+	need_newline =3D 0;
+	get_line();
+	if (line)
+	    goto loop;
+	unterminated_text(t_lineno, t_line, t_cptr);
+
+    case '\'':
+    case '"':
+	{
+	    int s_lineno =3D lineno;
+	    char *s_line =3D dup_line();
+	    char *s_cptr =3D s_line + (cptr - line - 1);
+
+	    quote =3D c;
+	    putc(c, f);
+	    for (;;)
+	    {
+		c =3D *cptr++;
+		putc(c, f);
+		if (c =3D=3D quote)
+		{
+		    need_newline =3D 1;
+		    FREE(s_line);
+		    goto loop;
+		}
+		if (c =3D=3D '\n')
+		    unterminated_string(s_lineno, s_line, s_cptr);
+		if (c =3D=3D '\\')
+		{
+		    c =3D *cptr++;
+		    putc(c, f);
+		    if (c =3D=3D '\n')
+		    {
+			get_line();
+			if (line =3D=3D 0)
+			    unterminated_string(s_lineno, s_line, s_cptr);
+		    }
+		}
+	    }
+	}
+
+    case '/':
+	putc(c, f);
+	need_newline =3D 1;
+	c =3D *cptr;
+	if (c =3D=3D '/')
+	{
+	    putc('*', f);
+	    while ((c =3D *++cptr) !=3D '\n')
+	    {
+		if (c =3D=3D '*' && cptr[1] =3D=3D '/')
+		    fprintf(f, "* ");
+		else
+		    putc(c, f);
+	    }
+	    fprintf(f, "*/");
+	    goto next_line;
+	}
+	if (c =3D=3D '*')
+	{
+	    int c_lineno =3D lineno;
+	    char *c_line =3D dup_line();
+	    char *c_cptr =3D c_line + (cptr - line - 1);
+
+	    putc('*', f);
+	    ++cptr;
+	    for (;;)
+	    {
+		c =3D *cptr++;
+		putc(c, f);
+		if (c =3D=3D '*' && *cptr =3D=3D '/')
+		{
+		    putc('/', f);
+		    ++cptr;
+		    FREE(c_line);
+		    goto loop;
+		}
+		if (c =3D=3D '\n')
+		{
+		    get_line();
+		    if (line =3D=3D 0)
+			unterminated_comment(c_lineno, c_line, c_cptr);
+		}
+	    }
+	}
+	need_newline =3D 1;
+	goto loop;
+
+    case '%':
+    case '\\':
+	if (*cptr =3D=3D R_CURL)
+	{
+	    if (need_newline)
+		putc('\n', f);
+	    ++cptr;
+	    FREE(t_line);
+	    return;
+	}
+	/* FALLTHRU */
+
+    default:
+	putc(c, f);
+	need_newline =3D 1;
+	goto loop;
+    }
+}
+
+static void
+puts_both(const char *s)
+{
+    fputs(s, text_file);
+    if (dflag)
+	fputs(s, union_file);
+}
+
+static void
+putc_both(int c)
+{
+    putc(c, text_file);
+    if (dflag)
+	putc(c, union_file);
+}
+
+static void
+copy_union(void)
+{
+    int c;
+    int quote;
+    int depth;
+    int u_lineno =3D lineno;
+    char *u_line =3D dup_line();
+    char *u_cptr =3D u_line + (cptr - line - 6);
+
+    if (unionized)
+	over_unionized(cptr - 6);
+    unionized =3D 1;
+
+    if (!lflag)
+	fprintf(text_file, line_format, lineno, input_file_name);
+
+    puts_both("#ifdef YYSTYPE\n");
+    puts_both("#undef  YYSTYPE_IS_DECLARED\n");
+    puts_both("#define YYSTYPE_IS_DECLARED 1\n");
+    puts_both("#endif\n");
+    puts_both("#ifndef YYSTYPE_IS_DECLARED\n");
+    puts_both("#define YYSTYPE_IS_DECLARED 1\n");
+    puts_both("typedef union");
+
+    depth =3D 0;
+  loop:
+    c =3D *cptr++;
+    putc_both(c);
+    switch (c)
+    {
+    case '\n':
+      next_line:
+	get_line();
+	if (line =3D=3D 0)
+	    unterminated_union(u_lineno, u_line, u_cptr);
+	goto loop;
+
+    case L_CURL:
+	++depth;
+	goto loop;
+
+    case R_CURL:
+	if (--depth =3D=3D 0)
+	{
+	    puts_both(" YYSTYPE;\n");
+	    puts_both("#endif /* !YYSTYPE_IS_DECLARED */\n");
+	    FREE(u_line);
+	    return;
+	}
+	goto loop;
+
+    case '\'':
+    case '"':
+	{
+	    int s_lineno =3D lineno;
+	    char *s_line =3D dup_line();
+	    char *s_cptr =3D s_line + (cptr - line - 1);
+
+	    quote =3D c;
+	    for (;;)
+	    {
+		c =3D *cptr++;
+		putc_both(c);
+		if (c =3D=3D quote)
+		{
+		    FREE(s_line);
+		    goto loop;
+		}
+		if (c =3D=3D '\n')
+		    unterminated_string(s_lineno, s_line, s_cptr);
+		if (c =3D=3D '\\')
+		{
+		    c =3D *cptr++;
+		    putc_both(c);
+		    if (c =3D=3D '\n')
+		    {
+			get_line();
+			if (line =3D=3D 0)
+			    unterminated_string(s_lineno, s_line, s_cptr);
+		    }
+		}
+	    }
+	}
+
+    case '/':
+	c =3D *cptr;
+	if (c =3D=3D '/')
+	{
+	    putc_both('*');
+	    while ((c =3D *++cptr) !=3D '\n')
+	    {
+		if (c =3D=3D '*' && cptr[1] =3D=3D '/')
+		{
+		    puts_both("* ");
+		}
+		else
+		{
+		    putc_both(c);
+		}
+	    }
+	    puts_both("*/\n");
+	    goto next_line;
+	}
+	if (c =3D=3D '*')
+	{
+	    int c_lineno =3D lineno;
+	    char *c_line =3D dup_line();
+	    char *c_cptr =3D c_line + (cptr - line - 1);
+
+	    putc_both('*');
+	    ++cptr;
+	    for (;;)
+	    {
+		c =3D *cptr++;
+		putc_both(c);
+		if (c =3D=3D '*' && *cptr =3D=3D '/')
+		{
+		    putc_both('/');
+		    ++cptr;
+		    FREE(c_line);
+		    goto loop;
+		}
+		if (c =3D=3D '\n')
+		{
+		    get_line();
+		    if (line =3D=3D 0)
+			unterminated_comment(c_lineno, c_line, c_cptr);
+		}
+	    }
+	}
+	goto loop;
+
+    default:
+	goto loop;
+    }
+}
+
+/*
+ * Keep a linked list of parameters
+ */
+static void
+copy_param(int k)
+{
+    char *buf;
+    int c;
+    param *head, *p;
+    int i;
+    int name, type2;
+
+    c =3D nextc();
+    if (c =3D=3D EOF)
+	unexpected_EOF();
+    if (c !=3D '{')
+	goto out;
+    cptr++;
+
+    c =3D nextc();
+    if (c =3D=3D EOF)
+	unexpected_EOF();
+    if (c =3D=3D '}')
+	goto out;
+
+    buf =3D MALLOC(linesize);
+    NO_SPACE(buf);
+
+    for (i =3D 0; (c =3D *cptr++) !=3D '}'; i++)
+    {
+	if (c =3D=3D '\0')
+	    missing_brace();
+	if (c =3D=3D EOF)
+	    unexpected_EOF();
+	buf[i] =3D (char)c;
+    }
+
+    if (i =3D=3D 0)
+	goto out;
+
+    buf[i--] =3D '\0';
+    while (i >=3D 0 && isspace(UCH(buf[i])))
+	buf[i--] =3D '\0';
+
+    if (buf[i] =3D=3D ']')
+    {
+	int level =3D 1;
+	while (i >=3D 0 && level > 0 && buf[i] !=3D '[')
+	{
+	    if (buf[i] =3D=3D ']')
+		++level;
+	    else if (buf[i] =3D=3D '[')
+		--level;
+	    i--;
+	}
+	if (i <=3D 0)
+	    unexpected_EOF();
+	type2 =3D i--;
+    }
+    else
+    {
+	type2 =3D i + 1;
+    }
+
+    while (i >=3D 0 && (isalnum(UCH(buf[i])) ||
+		      UCH(buf[i]) =3D=3D '_'))
+	i--;
+
+    if (!isspace(UCH(buf[i])) && buf[i] !=3D '*')
+	goto out;
+
+    name =3D i + 1;
+
+    p =3D MALLOC(sizeof(*p));
+    NO_SPACE(p);
+
+    p->type2 =3D strdup(buf + type2);
+    NO_SPACE(p->type2);
+
+    buf[type2] =3D '\0';
+
+    p->name =3D strdup(buf + name);
+    NO_SPACE(p->name);
+
+    buf[name] =3D '\0';
+    p->type =3D buf;
+
+    if (k =3D=3D LEX_PARAM)
+	head =3D lex_param;
+    else
+	head =3D parse_param;
+
+    if (head !=3D NULL)
+    {
+	while (head->next)
+	    head =3D head->next;
+	head->next =3D p;
+    }
+    else
+    {
+	if (k =3D=3D LEX_PARAM)
+	    lex_param =3D p;
+	else
+	    parse_param =3D p;
+    }
+    p->next =3D NULL;
+    return;
+
+  out:
+    syntax_error(lineno, line, cptr);
+}
+
+static int
+hexval(int c)
+{
+    if (c >=3D '0' && c <=3D '9')
+	return (c - '0');
+    if (c >=3D 'A' && c <=3D 'F')
+	return (c - 'A' + 10);
+    if (c >=3D 'a' && c <=3D 'f')
+	return (c - 'a' + 10);
+    return (-1);
+}
+
+static bucket *
+get_literal(void)
+{
+    int c, quote;
+    int i;
+    int n;
+    char *s;
+    bucket *bp;
+    int s_lineno =3D lineno;
+    char *s_line =3D dup_line();
+    char *s_cptr =3D s_line + (cptr - line);
+
+    quote =3D *cptr++;
+    cinc =3D 0;
+    for (;;)
+    {
+	c =3D *cptr++;
+	if (c =3D=3D quote)
+	    break;
+	if (c =3D=3D '\n')
+	    unterminated_string(s_lineno, s_line, s_cptr);
+	if (c =3D=3D '\\')
+	{
+	    char *c_cptr =3D cptr - 1;
+
+	    c =3D *cptr++;
+	    switch (c)
+	    {
+	    case '\n':
+		get_line();
+		if (line =3D=3D 0)
+		    unterminated_string(s_lineno, s_line, s_cptr);
+		continue;
+
+	    case '0':
+	    case '1':
+	    case '2':
+	    case '3':
+	    case '4':
+	    case '5':
+	    case '6':
+	    case '7':
+		n =3D c - '0';
+		c =3D *cptr;
+		if (IS_OCTAL(c))
+		{
+		    n =3D (n << 3) + (c - '0');
+		    c =3D *++cptr;
+		    if (IS_OCTAL(c))
+		    {
+			n =3D (n << 3) + (c - '0');
+			++cptr;
+		    }
+		}
+		if (n > MAXCHAR)
+		    illegal_character(c_cptr);
+		c =3D n;
+		break;
+
+	    case 'x':
+		c =3D *cptr++;
+		n =3D hexval(c);
+		if (n < 0 || n >=3D 16)
+		    illegal_character(c_cptr);
+		for (;;)
+		{
+		    c =3D *cptr;
+		    i =3D hexval(c);
+		    if (i < 0 || i >=3D 16)
+			break;
+		    ++cptr;
+		    n =3D (n << 4) + i;
+		    if (n > MAXCHAR)
+			illegal_character(c_cptr);
+		}
+		c =3D n;
+		break;
+
+	    case 'a':
+		c =3D 7;
+		break;
+	    case 'b':
+		c =3D '\b';
+		break;
+	    case 'f':
+		c =3D '\f';
+		break;
+	    case 'n':
+		c =3D '\n';
+		break;
+	    case 'r':
+		c =3D '\r';
+		break;
+	    case 't':
+		c =3D '\t';
+		break;
+	    case 'v':
+		c =3D '\v';
+		break;
+	    }
+	}
+	cachec(c);
+    }
+    FREE(s_line);
+
+    n =3D cinc;
+    s =3D MALLOC(n);
+    NO_SPACE(s);
+
+    for (i =3D 0; i < n; ++i)
+	s[i] =3D cache[i];
+
+    cinc =3D 0;
+    if (n =3D=3D 1)
+	cachec('\'');
+    else
+	cachec('"');
+
+    for (i =3D 0; i < n; ++i)
+    {
+	c =3D UCH(s[i]);
+	if (c =3D=3D '\\' || c =3D=3D cache[0])
+	{
+	    cachec('\\');
+	    cachec(c);
+	}
+	else if (isprint(c))
+	    cachec(c);
+	else
+	{
+	    cachec('\\');
+	    switch (c)
+	    {
+	    case 7:
+		cachec('a');
+		break;
+	    case '\b':
+		cachec('b');
+		break;
+	    case '\f':
+		cachec('f');
+		break;
+	    case '\n':
+		cachec('n');
+		break;
+	    case '\r':
+		cachec('r');
+		break;
+	    case '\t':
+		cachec('t');
+		break;
+	    case '\v':
+		cachec('v');
+		break;
+	    default:
+		cachec(((c >> 6) & 7) + '0');
+		cachec(((c >> 3) & 7) + '0');
+		cachec((c & 7) + '0');
+		break;
+	    }
+	}
+    }
+
+    if (n =3D=3D 1)
+	cachec('\'');
+    else
+	cachec('"');
+
+    cachec(NUL);
+    bp =3D lookup(cache);
+    bp->class =3D TERM;
+    if (n =3D=3D 1 && bp->value =3D=3D UNDEFINED)
+	bp->value =3D UCH(*s);
+    FREE(s);
+
+    return (bp);
+}
+
+static int
+is_reserved(char *name)
+{
+    char *s;
+
+    if (strcmp(name, ".") =3D=3D 0 ||
+	strcmp(name, "$accept") =3D=3D 0 ||
+	strcmp(name, "$end") =3D=3D 0)
+	return (1);
+
+    if (name[0] =3D=3D '$' && name[1] =3D=3D '$' && isdigit(UCH(name[2])))
+    {
+	s =3D name + 3;
+	while (isdigit(UCH(*s)))
+	    ++s;
+	if (*s =3D=3D NUL)
+	    return (1);
+    }
+
+    return (0);
+}
+
+static bucket *
+get_name(void)
+{
+    int c;
+
+    cinc =3D 0;
+    for (c =3D *cptr; IS_IDENT(c); c =3D *++cptr)
+	cachec(c);
+    cachec(NUL);
+
+    if (is_reserved(cache))
+	used_reserved(cache);
+
+    return (lookup(cache));
+}
+
+static Value_t
+get_number(void)
+{
+    int c;
+    Value_t n;
+
+    n =3D 0;
+    for (c =3D *cptr; isdigit(c); c =3D *++cptr)
+	n =3D (Value_t) (10 * n + (c - '0'));
+
+    return (n);
+}
+
+static char *
+get_tag(void)
+{
+    int c;
+    int i;
+    char *s;
+    int t_lineno =3D lineno;
+    char *t_line =3D dup_line();
+    char *t_cptr =3D t_line + (cptr - line);
+
+    ++cptr;
+    c =3D nextc();
+    if (c =3D=3D EOF)
+	unexpected_EOF();
+    if (!isalpha(c) && c !=3D '_' && c !=3D '$')
+	illegal_tag(t_lineno, t_line, t_cptr);
+
+    cinc =3D 0;
+    do
+    {
+	cachec(c);
+	c =3D *++cptr;
+    }
+    while (IS_IDENT(c));
+    cachec(NUL);
+
+    c =3D nextc();
+    if (c =3D=3D EOF)
+	unexpected_EOF();
+    if (c !=3D '>')
+	illegal_tag(t_lineno, t_line, t_cptr);
+    ++cptr;
+
+    for (i =3D 0; i < ntags; ++i)
+    {
+	if (strcmp(cache, tag_table[i]) =3D=3D 0)
+	{
+	    FREE(t_line);
+	    return (tag_table[i]);
+	}
+    }
+
+    if (ntags >=3D tagmax)
+    {
+	tagmax +=3D 16;
+	tag_table =3D (char **)
+	    (tag_table
+	     ? REALLOC(tag_table, (unsigned)tagmax * sizeof(char *))
+	     : MALLOC((unsigned)tagmax * sizeof(char *)));
+	NO_SPACE(tag_table);
+    }
+
+    s =3D MALLOC(cinc);
+    NO_SPACE(s);
+
+    strcpy(s, cache);
+    tag_table[ntags] =3D s;
+    ++ntags;
+    FREE(t_line);
+    return (s);
+}
+
+static void
+declare_tokens(int assoc)
+{
+    int c;
+    bucket *bp;
+    Value_t value;
+    char *tag =3D 0;
+
+    if (assoc !=3D TOKEN)
+	++prec;
+
+    c =3D nextc();
+    if (c =3D=3D EOF)
+	unexpected_EOF();
+    if (c =3D=3D '<')
+    {
+	tag =3D get_tag();
+	c =3D nextc();
+	if (c =3D=3D EOF)
+	    unexpected_EOF();
+    }
+
+    for (;;)
+    {
+	if (isalpha(c) || c =3D=3D '_' || c =3D=3D '.' || c =3D=3D '$')
+	    bp =3D get_name();
+	else if (c =3D=3D '\'' || c =3D=3D '"')
+	    bp =3D get_literal();
+	else
+	    return;
+
+	if (bp =3D=3D goal)
+	    tokenized_start(bp->name);
+	bp->class =3D TERM;
+
+	if (tag)
+	{
+	    if (bp->tag && tag !=3D bp->tag)
+		retyped_warning(bp->name);
+	    bp->tag =3D tag;
+	}
+
+	if (assoc !=3D TOKEN)
+	{
+	    if (bp->prec && prec !=3D bp->prec)
+		reprec_warning(bp->name);
+	    bp->assoc =3D (Assoc_t) assoc;
+	    bp->prec =3D prec;
+	}
+
+	c =3D nextc();
+	if (c =3D=3D EOF)
+	    unexpected_EOF();
+
+	if (isdigit(c))
+	{
+	    value =3D get_number();
+	    if (bp->value !=3D UNDEFINED && value !=3D bp->value)
+		revalued_warning(bp->name);
+	    bp->value =3D value;
+	    c =3D nextc();
+	    if (c =3D=3D EOF)
+		unexpected_EOF();
+	}
+    }
+}
+
+/*
+ * %expect requires special handling
+ * as it really isn't part of the yacc
+ * grammar only a flag for yacc proper.
+ */
+static void
+declare_expect(int assoc)
+{
+    int c;
+
+    if (assoc !=3D EXPECT && assoc !=3D EXPECT_RR)
+	++prec;
+
+    /*
+     * Stay away from nextc - doesn't
+     * detect EOL and will read to EOF.
+     */
+    c =3D *++cptr;
+    if (c =3D=3D EOF)
+	unexpected_EOF();
+
+    for (;;)
+    {
+	if (isdigit(c))
+	{
+	    if (assoc =3D=3D EXPECT)
+		SRexpect =3D get_number();
+	    else
+		RRexpect =3D get_number();
+	    break;
+	}
+	/*
+	 * Looking for number before EOL.
+	 * Spaces, tabs, and numbers are ok,
+	 * words, punc., etc. are syntax errors.
+	 */
+	else if (c =3D=3D '\n' || isalpha(c) || !isspace(c))
+	{
+	    syntax_error(lineno, line, cptr);
+	}
+	else
+	{
+	    c =3D *++cptr;
+	    if (c =3D=3D EOF)
+		unexpected_EOF();
+	}
+    }
+}
+
+static void
+declare_types(void)
+{
+    int c;
+    bucket *bp;
+    char *tag;
+
+    c =3D nextc();
+    if (c =3D=3D EOF)
+	unexpected_EOF();
+    if (c !=3D '<')
+	syntax_error(lineno, line, cptr);
+    tag =3D get_tag();
+
+    for (;;)
+    {
+	c =3D nextc();
+	if (isalpha(c) || c =3D=3D '_' || c =3D=3D '.' || c =3D=3D '$')
+	    bp =3D get_name();
+	else if (c =3D=3D '\'' || c =3D=3D '"')
+	    bp =3D get_literal();
+	else
+	    return;
+
+	if (bp->tag && tag !=3D bp->tag)
+	    retyped_warning(bp->name);
+	bp->tag =3D tag;
+    }
+}
+
+static void
+declare_start(void)
+{
+    int c;
+    bucket *bp;
+
+    c =3D nextc();
+    if (c =3D=3D EOF)
+	unexpected_EOF();
+    if (!isalpha(c) && c !=3D '_' && c !=3D '.' && c !=3D '$')
+	syntax_error(lineno, line, cptr);
+    bp =3D get_name();
+    if (bp->class =3D=3D TERM)
+	terminal_start(bp->name);
+    if (goal && goal !=3D bp)
+	restarted_warning();
+    goal =3D bp;
+}
+
+static void
+read_declarations(void)
+{
+    int c, k;
+
+    cache_size =3D 256;
+    cache =3D MALLOC(cache_size);
+    NO_SPACE(cache);
+
+    for (;;)
+    {
+	c =3D nextc();
+	if (c =3D=3D EOF)
+	    unexpected_EOF();
+	if (c !=3D '%')
+	    syntax_error(lineno, line, cptr);
+	switch (k =3D keyword())
+	{
+	case MARK:
+	    return;
+
+	case IDENT:
+	    copy_ident();
+	    break;
+
+	case TEXT:
+	    copy_text();
+	    break;
+
+	case UNION:
+	    copy_union();
+	    break;
+
+	case TOKEN:
+	case LEFT:
+	case RIGHT:
+	case NONASSOC:
+	    declare_tokens(k);
+	    break;
+
+	case EXPECT:
+	case EXPECT_RR:
+	    declare_expect(k);
+	    break;
+
+	case TYPE:
+	    declare_types();
+	    break;
+
+	case START:
+	    declare_start();
+	    break;
+
+	case PURE_PARSER:
+	    pure_parser =3D 1;
+	    break;
+
+	case PARSE_PARAM:
+	case LEX_PARAM:
+	    copy_param(k);
+	    break;
+
+	case POSIX_YACC:
+	    /* noop for bison compatibility. byacc is already designed to be posix
+	     * yacc compatible. */
+	    break;
+	}
+    }
+}
+
+static void
+initialize_grammar(void)
+{
+    nitems =3D 4;
+    maxitems =3D 300;
+
+    pitem =3D (bucket **)MALLOC((unsigned)maxitems * sizeof(bucket *));
+    NO_SPACE(pitem);
+
+    pitem[0] =3D 0;
+    pitem[1] =3D 0;
+    pitem[2] =3D 0;
+    pitem[3] =3D 0;
+
+    nrules =3D 3;
+    maxrules =3D 100;
+
+    plhs =3D (bucket **)MALLOC((unsigned)maxrules * sizeof(bucket *));
+    NO_SPACE(plhs);
+
+    plhs[0] =3D 0;
+    plhs[1] =3D 0;
+    plhs[2] =3D 0;
+
+    rprec =3D (short *)MALLOC((unsigned)maxrules * sizeof(short));
+    NO_SPACE(rprec);
+
+    rprec[0] =3D 0;
+    rprec[1] =3D 0;
+    rprec[2] =3D 0;
+
+    rassoc =3D (char *)MALLOC((unsigned)maxrules * sizeof(char));
+    NO_SPACE(rassoc);
+
+    rassoc[0] =3D TOKEN;
+    rassoc[1] =3D TOKEN;
+    rassoc[2] =3D TOKEN;
+}
+
+static void
+expand_items(void)
+{
+    maxitems +=3D 300;
+    pitem =3D (bucket **)REALLOC(pitem, (unsigned)maxitems * sizeof(bucket=
 *));
+    NO_SPACE(pitem);
+}
+
+static void
+expand_rules(void)
+{
+    maxrules +=3D 100;
+
+    plhs =3D (bucket **)REALLOC(plhs, (unsigned)maxrules * sizeof(bucket *=
));
+    NO_SPACE(plhs);
+
+    rprec =3D (short *)REALLOC(rprec, (unsigned)maxrules * sizeof(short));
+    NO_SPACE(rprec);
+
+    rassoc =3D (char *)REALLOC(rassoc, (unsigned)maxrules * sizeof(char));
+    NO_SPACE(rassoc);
+}
+
+static void
+advance_to_start(void)
+{
+    int c;
+    bucket *bp;
+    char *s_cptr;
+    int s_lineno;
+
+    for (;;)
+    {
+	c =3D nextc();
+	if (c !=3D '%')
+	    break;
+	s_cptr =3D cptr;
+	switch (keyword())
+	{
+	case MARK:
+	    no_grammar();
+
+	case TEXT:
+	    copy_text();
+	    break;
+
+	case START:
+	    declare_start();
+	    break;
+
+	default:
+	    syntax_error(lineno, line, s_cptr);
+	}
+    }
+
+    c =3D nextc();
+    if (!isalpha(c) && c !=3D '_' && c !=3D '.' && c !=3D '_')
+	syntax_error(lineno, line, cptr);
+    bp =3D get_name();
+    if (goal =3D=3D 0)
+    {
+	if (bp->class =3D=3D TERM)
+	    terminal_start(bp->name);
+	goal =3D bp;
+    }
+
+    s_lineno =3D lineno;
+    c =3D nextc();
+    if (c =3D=3D EOF)
+	unexpected_EOF();
+    if (c !=3D ':')
+	syntax_error(lineno, line, cptr);
+    start_rule(bp, s_lineno);
+    ++cptr;
+}
+
+static void
+start_rule(bucket *bp, int s_lineno)
+{
+    if (bp->class =3D=3D TERM)
+	terminal_lhs(s_lineno);
+    bp->class =3D NONTERM;
+    if (nrules >=3D maxrules)
+	expand_rules();
+    plhs[nrules] =3D bp;
+    rprec[nrules] =3D UNDEFINED;
+    rassoc[nrules] =3D TOKEN;
+}
+
+static void
+end_rule(void)
+{
+    int i;
+
+    if (!last_was_action && plhs[nrules]->tag)
+    {
+	if (pitem[nitems - 1])
+	{
+	    for (i =3D nitems - 1; (i > 0) && pitem[i]; --i)
+		continue;
+	    if (pitem[i + 1] =3D=3D 0 || pitem[i + 1]->tag !=3D plhs[nrules]->tag)
+		default_action_warning();
+	}
+	else
+	{
+	    default_action_warning();
+	}
+    }
+
+    last_was_action =3D 0;
+    if (nitems >=3D maxitems)
+	expand_items();
+    pitem[nitems] =3D 0;
+    ++nitems;
+    ++nrules;
+}
+
+static void
+insert_empty_rule(void)
+{
+    bucket *bp, **bpp;
+
+    assert(cache);
+    sprintf(cache, "$$%d", ++gensym);
+    bp =3D make_bucket(cache);
+    last_symbol->next =3D bp;
+    last_symbol =3D bp;
+    bp->tag =3D plhs[nrules]->tag;
+    bp->class =3D NONTERM;
+
+    if ((nitems +=3D 2) > maxitems)
+	expand_items();
+    bpp =3D pitem + nitems - 1;
+    *bpp-- =3D bp;
+    while ((bpp[0] =3D bpp[-1]) !=3D 0)
+	--bpp;
+
+    if (++nrules >=3D maxrules)
+	expand_rules();
+    plhs[nrules] =3D plhs[nrules - 1];
+    plhs[nrules - 1] =3D bp;
+    rprec[nrules] =3D rprec[nrules - 1];
+    rprec[nrules - 1] =3D 0;
+    rassoc[nrules] =3D rassoc[nrules - 1];
+    rassoc[nrules - 1] =3D TOKEN;
+}
+
+static void
+add_symbol(void)
+{
+    int c;
+    bucket *bp;
+    int s_lineno =3D lineno;
+
+    c =3D *cptr;
+    if (c =3D=3D '\'' || c =3D=3D '"')
+	bp =3D get_literal();
+    else
+	bp =3D get_name();
+
+    c =3D nextc();
+    if (c =3D=3D ':')
+    {
+	end_rule();
+	start_rule(bp, s_lineno);
+	++cptr;
+	return;
+    }
+
+    if (last_was_action)
+	insert_empty_rule();
+    last_was_action =3D 0;
+
+    if (++nitems > maxitems)
+	expand_items();
+    pitem[nitems - 1] =3D bp;
+}
+
+static char *
+after_blanks(char *s)
+{
+    while (*s !=3D '\0' && isspace(UCH(*s)))
+	++s;
+    return s;
+}
+
+static void
+copy_action(void)
+{
+    int c;
+    int i, n;
+    int depth;
+    int quote;
+    char *tag;
+    FILE *f =3D action_file;
+    int a_lineno =3D lineno;
+    char *a_line =3D dup_line();
+    char *a_cptr =3D a_line + (cptr - line);
+
+    if (last_was_action)
+	insert_empty_rule();
+    last_was_action =3D 1;
+
+    fprintf(f, "case %d:\n", nrules - 2);
+    if (!lflag)
+	fprintf(f, line_format, lineno, input_file_name);
+    if (*cptr =3D=3D '=3D')
+	++cptr;
+
+    /* avoid putting curly-braces in first column, to ease editing */
+    if (*after_blanks(cptr) =3D=3D L_CURL)
+    {
+	putc('\t', f);
+	cptr =3D after_blanks(cptr);
+    }
+
+    n =3D 0;
+    for (i =3D nitems - 1; pitem[i]; --i)
+	++n;
+
+    depth =3D 0;
+  loop:
+    c =3D *cptr;
+    if (c =3D=3D '$')
+    {
+	if (cptr[1] =3D=3D '<')
+	{
+	    int d_lineno =3D lineno;
+	    char *d_line =3D dup_line();
+	    char *d_cptr =3D d_line + (cptr - line);
+
+	    ++cptr;
+	    tag =3D get_tag();
+	    c =3D *cptr;
+	    if (c =3D=3D '$')
+	    {
+		fprintf(f, "yyval.%s", tag);
+		++cptr;
+		FREE(d_line);
+		goto loop;
+	    }
+	    else if (isdigit(c))
+	    {
+		i =3D get_number();
+		if (i > n)
+		    dollar_warning(d_lineno, i);
+		fprintf(f, "yystack.l_mark[%d].%s", i - n, tag);
+		FREE(d_line);
+		goto loop;
+	    }
+	    else if (c =3D=3D '-' && isdigit(UCH(cptr[1])))
+	    {
+		++cptr;
+		i =3D -get_number() - n;
+		fprintf(f, "yystack.l_mark[%d].%s", i, tag);
+		FREE(d_line);
+		goto loop;
+	    }
+	    else
+		dollar_error(d_lineno, d_line, d_cptr);
+	}
+	else if (cptr[1] =3D=3D '$')
+	{
+	    if (ntags)
+	    {
+		tag =3D plhs[nrules]->tag;
+		if (tag =3D=3D 0)
+		    untyped_lhs();
+		fprintf(f, "yyval.%s", tag);
+	    }
+	    else
+		fprintf(f, "yyval");
+	    cptr +=3D 2;
+	    goto loop;
+	}
+	else if (isdigit(UCH(cptr[1])))
+	{
+	    ++cptr;
+	    i =3D get_number();
+	    if (ntags)
+	    {
+		if (i <=3D 0 || i > n)
+		    unknown_rhs(i);
+		tag =3D pitem[nitems + i - n - 1]->tag;
+		if (tag =3D=3D 0)
+		    untyped_rhs(i, pitem[nitems + i - n - 1]->name);
+		fprintf(f, "yystack.l_mark[%d].%s", i - n, tag);
+	    }
+	    else
+	    {
+		if (i > n)
+		    dollar_warning(lineno, i);
+		fprintf(f, "yystack.l_mark[%d]", i - n);
+	    }
+	    goto loop;
+	}
+	else if (cptr[1] =3D=3D '-')
+	{
+	    cptr +=3D 2;
+	    i =3D get_number();
+	    if (ntags)
+		unknown_rhs(-i);
+	    fprintf(f, "yystack.l_mark[%d]", -i - n);
+	    goto loop;
+	}
+    }
+    if (isalpha(c) || c =3D=3D '_' || c =3D=3D '$')
+    {
+	do
+	{
+	    putc(c, f);
+	    c =3D *++cptr;
+	}
+	while (isalnum(c) || c =3D=3D '_' || c =3D=3D '$');
+	goto loop;
+    }
+    putc(c, f);
+    ++cptr;
+    switch (c)
+    {
+    case '\n':
+      next_line:
+	get_line();
+	if (line)
+	    goto loop;
+	unterminated_action(a_lineno, a_line, a_cptr);
+
+    case ';':
+	if (depth > 0)
+	    goto loop;
+	fprintf(f, "\nbreak;\n");
+	free(a_line);
+	return;
+
+    case L_CURL:
+	++depth;
+	goto loop;
+
+    case R_CURL:
+	if (--depth > 0)
+	    goto loop;
+	fprintf(f, "\nbreak;\n");
+	free(a_line);
+	return;
+
+    case '\'':
+    case '"':
+	{
+	    int s_lineno =3D lineno;
+	    char *s_line =3D dup_line();
+	    char *s_cptr =3D s_line + (cptr - line - 1);
+
+	    quote =3D c;
+	    for (;;)
+	    {
+		c =3D *cptr++;
+		putc(c, f);
+		if (c =3D=3D quote)
+		{
+		    FREE(s_line);
+		    goto loop;
+		}
+		if (c =3D=3D '\n')
+		    unterminated_string(s_lineno, s_line, s_cptr);
+		if (c =3D=3D '\\')
+		{
+		    c =3D *cptr++;
+		    putc(c, f);
+		    if (c =3D=3D '\n')
+		    {
+			get_line();
+			if (line =3D=3D 0)
+			    unterminated_string(s_lineno, s_line, s_cptr);
+		    }
+		}
+	    }
+	}
+
+    case '/':
+	c =3D *cptr;
+	if (c =3D=3D '/')
+	{
+	    putc('*', f);
+	    while ((c =3D *++cptr) !=3D '\n')
+	    {
+		if (c =3D=3D '*' && cptr[1] =3D=3D '/')
+		    fprintf(f, "* ");
+		else
+		    putc(c, f);
+	    }
+	    fprintf(f, "*/\n");
+	    goto next_line;
+	}
+	if (c =3D=3D '*')
+	{
+	    int c_lineno =3D lineno;
+	    char *c_line =3D dup_line();
+	    char *c_cptr =3D c_line + (cptr - line - 1);
+
+	    putc('*', f);
+	    ++cptr;
+	    for (;;)
+	    {
+		c =3D *cptr++;
+		putc(c, f);
+		if (c =3D=3D '*' && *cptr =3D=3D '/')
+		{
+		    putc('/', f);
+		    ++cptr;
+		    FREE(c_line);
+		    goto loop;
+		}
+		if (c =3D=3D '\n')
+		{
+		    get_line();
+		    if (line =3D=3D 0)
+			unterminated_comment(c_lineno, c_line, c_cptr);
+		}
+	    }
+	}
+	goto loop;
+
+    default:
+	goto loop;
+    }
+}
+
+static int
+mark_symbol(void)
+{
+    int c;
+    bucket *bp;
+
+    bp =3D NULL;
+
+    c =3D cptr[1];
+    if (c =3D=3D '%' || c =3D=3D '\\')
+    {
+	cptr +=3D 2;
+	return (1);
+    }
+
+    if (c =3D=3D '=3D')
+	cptr +=3D 2;
+    else if ((c =3D=3D 'p' || c =3D=3D 'P') &&
+	     ((c =3D cptr[2]) =3D=3D 'r' || c =3D=3D 'R') &&
+	     ((c =3D cptr[3]) =3D=3D 'e' || c =3D=3D 'E') &&
+	     ((c =3D cptr[4]) =3D=3D 'c' || c =3D=3D 'C') &&
+	     ((c =3D cptr[5], !IS_IDENT(c))))
+	cptr +=3D 5;
+    else
+	syntax_error(lineno, line, cptr);
+
+    c =3D nextc();
+    if (isalpha(c) || c =3D=3D '_' || c =3D=3D '.' || c =3D=3D '$')
+	bp =3D get_name();
+    else if (c =3D=3D '\'' || c =3D=3D '"')
+	bp =3D get_literal();
+    else
+    {
+	syntax_error(lineno, line, cptr);
+	/*NOTREACHED */
+    }
+
+    if (rprec[nrules] !=3D UNDEFINED && bp->prec !=3D rprec[nrules])
+	prec_redeclared();
+
+    rprec[nrules] =3D bp->prec;
+    rassoc[nrules] =3D bp->assoc;
+    return (0);
+}
+
+static void
+read_grammar(void)
+{
+    int c;
+
+    initialize_grammar();
+    advance_to_start();
+
+    for (;;)
+    {
+	c =3D nextc();
+	if (c =3D=3D EOF)
+	    break;
+	if (isalpha(c)
+	    || c =3D=3D '_'
+	    || c =3D=3D '.'
+	    || c =3D=3D '$'
+	    || c =3D=3D '\''
+	    || c =3D=3D '"')
+	    add_symbol();
+	else if (c =3D=3D L_CURL || c =3D=3D '=3D')
+	    copy_action();
+	else if (c =3D=3D '|')
+	{
+	    end_rule();
+	    start_rule(plhs[nrules - 1], 0);
+	    ++cptr;
+	}
+	else if (c =3D=3D '%')
+	{
+	    if (mark_symbol())
+		break;
+	}
+	else
+	    syntax_error(lineno, line, cptr);
+    }
+    end_rule();
+}
+
+static void
+free_tags(void)
+{
+    int i;
+
+    if (tag_table =3D=3D 0)
+	return;
+
+    for (i =3D 0; i < ntags; ++i)
+    {
+	assert(tag_table[i]);
+	FREE(tag_table[i]);
+    }
+    FREE(tag_table);
+}
+
+static void
+pack_names(void)
+{
+    bucket *bp;
+    char *p, *s, *t;
+
+    name_pool_size =3D 13;	/* 13 =3D=3D sizeof("$end") + sizeof("$accept")=
 */
+    for (bp =3D first_symbol; bp; bp =3D bp->next)
+	name_pool_size +=3D strlen(bp->name) + 1;
+
+    name_pool =3D MALLOC(name_pool_size);
+    NO_SPACE(name_pool);
+
+    strcpy(name_pool, "$accept");
+    strcpy(name_pool + 8, "$end");
+    t =3D name_pool + 13;
+    for (bp =3D first_symbol; bp; bp =3D bp->next)
+    {
+	p =3D t;
+	s =3D bp->name;
+	while ((*t++ =3D *s++) !=3D 0)
+	    continue;
+	FREE(bp->name);
+	bp->name =3D p;
+    }
+}
+
+static void
+check_symbols(void)
+{
+    bucket *bp;
+
+    if (goal->class =3D=3D UNKNOWN)
+	undefined_goal(goal->name);
+
+    for (bp =3D first_symbol; bp; bp =3D bp->next)
+    {
+	if (bp->class =3D=3D UNKNOWN)
+	{
+	    undefined_symbol_warning(bp->name);
+	    bp->class =3D TERM;
+	}
+    }
+}
+
+static void
+protect_string(char *src, char **des)
+{
+    unsigned len;
+    char *s;
+    char *d;
+
+    *des =3D src;
+    if (src)
+    {
+	len =3D 1;
+	s =3D src;
+	while (*s)
+	{
+	    if ('\\' =3D=3D *s || '"' =3D=3D *s)
+		len++;
+	    s++;
+	    len++;
+	}
+
+	*des =3D d =3D (char *)MALLOC(len);
+	NO_SPACE(d);
+
+	s =3D src;
+	while (*s)
+	{
+	    if ('\\' =3D=3D *s || '"' =3D=3D *s)
+		*d++ =3D '\\';
+	    *d++ =3D *s++;
+	}
+	*d =3D '\0';
+    }
+}
+
+static void
+pack_symbols(void)
+{
+    bucket *bp;
+    bucket **v;
+    Value_t i, j, k, n;
+
+    nsyms =3D 2;
+    ntokens =3D 1;
+    for (bp =3D first_symbol; bp; bp =3D bp->next)
+    {
+	++nsyms;
+	if (bp->class =3D=3D TERM)
+	    ++ntokens;
+    }
+    start_symbol =3D (Value_t) ntokens;
+    nvars =3D nsyms - ntokens;
+
+    symbol_name =3D (char **)MALLOC((unsigned)nsyms * sizeof(char *));
+    NO_SPACE(symbol_name);
+
+    symbol_value =3D (short *)MALLOC((unsigned)nsyms * sizeof(short));
+    NO_SPACE(symbol_value);
+
+    symbol_prec =3D (short *)MALLOC((unsigned)nsyms * sizeof(short));
+    NO_SPACE(symbol_prec);
+
+    symbol_assoc =3D MALLOC(nsyms);
+    NO_SPACE(symbol_assoc);
+
+    v =3D (bucket **)MALLOC((unsigned)nsyms * sizeof(bucket *));
+    NO_SPACE(v);
+
+    v[0] =3D 0;
+    v[start_symbol] =3D 0;
+
+    i =3D 1;
+    j =3D (Value_t) (start_symbol + 1);
+    for (bp =3D first_symbol; bp; bp =3D bp->next)
+    {
+	if (bp->class =3D=3D TERM)
+	    v[i++] =3D bp;
+	else
+	    v[j++] =3D bp;
+    }
+    assert(i =3D=3D ntokens && j =3D=3D nsyms);
+
+    for (i =3D 1; i < ntokens; ++i)
+	v[i]->index =3D i;
+
+    goal->index =3D (Index_t) (start_symbol + 1);
+    k =3D (Value_t) (start_symbol + 2);
+    while (++i < nsyms)
+	if (v[i] !=3D goal)
+	{
+	    v[i]->index =3D k;
+	    ++k;
+	}
+
+    goal->value =3D 0;
+    k =3D 1;
+    for (i =3D (Value_t) (start_symbol + 1); i < nsyms; ++i)
+    {
+	if (v[i] !=3D goal)
+	{
+	    v[i]->value =3D k;
+	    ++k;
+	}
+    }
+
+    k =3D 0;
+    for (i =3D 1; i < ntokens; ++i)
+    {
+	n =3D v[i]->value;
+	if (n > 256)
+	{
+	    for (j =3D k++; j > 0 && symbol_value[j - 1] > n; --j)
+		symbol_value[j] =3D symbol_value[j - 1];
+	    symbol_value[j] =3D n;
+	}
+    }
+
+    assert(v[1] !=3D 0);
+
+    if (v[1]->value =3D=3D UNDEFINED)
+	v[1]->value =3D 256;
+
+    j =3D 0;
+    n =3D 257;
+    for (i =3D 2; i < ntokens; ++i)
+    {
+	if (v[i]->value =3D=3D UNDEFINED)
+	{
+	    while (j < k && n =3D=3D symbol_value[j])
+	    {
+		while (++j < k && n =3D=3D symbol_value[j])
+		    continue;
+		++n;
+	    }
+	    v[i]->value =3D n;
+	    ++n;
+	}
+    }
+
+    symbol_name[0] =3D name_pool + 8;
+    symbol_value[0] =3D 0;
+    symbol_prec[0] =3D 0;
+    symbol_assoc[0] =3D TOKEN;
+    for (i =3D 1; i < ntokens; ++i)
+    {
+	symbol_name[i] =3D v[i]->name;
+	symbol_value[i] =3D v[i]->value;
+	symbol_prec[i] =3D v[i]->prec;
+	symbol_assoc[i] =3D v[i]->assoc;
+    }
+    symbol_name[start_symbol] =3D name_pool;
+    symbol_value[start_symbol] =3D -1;
+    symbol_prec[start_symbol] =3D 0;
+    symbol_assoc[start_symbol] =3D TOKEN;
+    for (++i; i < nsyms; ++i)
+    {
+	k =3D v[i]->index;
+	symbol_name[k] =3D v[i]->name;
+	symbol_value[k] =3D v[i]->value;
+	symbol_prec[k] =3D v[i]->prec;
+	symbol_assoc[k] =3D v[i]->assoc;
+    }
+
+    if (gflag)
+    {
+	symbol_pname =3D (char **)MALLOC((unsigned)nsyms * sizeof(char *));
+	NO_SPACE(symbol_pname);
+
+	for (i =3D 0; i < nsyms; ++i)
+	    protect_string(symbol_name[i], &(symbol_pname[i]));
+    }
+
+    FREE(v);
+}
+
+static void
+pack_grammar(void)
+{
+    int i;
+    Value_t j;
+    Assoc_t assoc;
+    Value_t prec2;
+
+    ritem =3D (short *)MALLOC((unsigned)nitems * sizeof(short));
+    NO_SPACE(ritem);
+
+    rlhs =3D (short *)MALLOC((unsigned)nrules * sizeof(short));
+    NO_SPACE(rlhs);
+
+    rrhs =3D (short *)MALLOC((unsigned)(nrules + 1) * sizeof(short));
+    NO_SPACE(rrhs);
+
+    rprec =3D (short *)REALLOC(rprec, (unsigned)nrules * sizeof(short));
+    NO_SPACE(rprec);
+
+    rassoc =3D REALLOC(rassoc, nrules);
+    NO_SPACE(rassoc);
+
+    ritem[0] =3D -1;
+    ritem[1] =3D goal->index;
+    ritem[2] =3D 0;
+    ritem[3] =3D -2;
+    rlhs[0] =3D 0;
+    rlhs[1] =3D 0;
+    rlhs[2] =3D start_symbol;
+    rrhs[0] =3D 0;
+    rrhs[1] =3D 0;
+    rrhs[2] =3D 1;
+
+    j =3D 4;
+    for (i =3D 3; i < nrules; ++i)
+    {
+	rlhs[i] =3D plhs[i]->index;
+	rrhs[i] =3D j;
+	assoc =3D TOKEN;
+	prec2 =3D 0;
+	while (pitem[j])
+	{
+	    ritem[j] =3D pitem[j]->index;
+	    if (pitem[j]->class =3D=3D TERM)
+	    {
+		prec2 =3D pitem[j]->prec;
+		assoc =3D pitem[j]->assoc;
+	    }
+	    ++j;
+	}
+	ritem[j] =3D (Value_t) - i;
+	++j;
+	if (rprec[i] =3D=3D UNDEFINED)
+	{
+	    rprec[i] =3D prec2;
+	    rassoc[i] =3D assoc;
+	}
+    }
+    rrhs[i] =3D j;
+
+    FREE(plhs);
+    FREE(pitem);
+}
+
+static void
+print_grammar(void)
+{
+    int i, k;
+    size_t j, spacing =3D 0;
+    FILE *f =3D verbose_file;
+
+    if (!vflag)
+	return;
+
+    k =3D 1;
+    for (i =3D 2; i < nrules; ++i)
+    {
+	if (rlhs[i] !=3D rlhs[i - 1])
+	{
+	    if (i !=3D 2)
+		fprintf(f, "\n");
+	    fprintf(f, "%4d  %s :", i - 2, symbol_name[rlhs[i]]);
+	    spacing =3D strlen(symbol_name[rlhs[i]]) + 1;
+	}
+	else
+	{
+	    fprintf(f, "%4d  ", i - 2);
+	    j =3D spacing;
+	    while (j-- !=3D 0)
+		putc(' ', f);
+	    putc('|', f);
+	}
+
+	while (ritem[k] >=3D 0)
+	{
+	    fprintf(f, " %s", symbol_name[ritem[k]]);
+	    ++k;
+	}
+	++k;
+	putc('\n', f);
+    }
+}
+
+void
+reader(void)
+{
+    write_section(code_file, banner);
+    create_symbol_table();
+    read_declarations();
+    read_grammar();
+    free_symbol_table();
+    free_tags();
+    pack_names();
+    check_symbols();
+    pack_symbols();
+    pack_grammar();
+    free_symbols();
+    print_grammar();
+}
+
+#ifdef NO_LEAKS
+static param *
+free_declarations(param * list)
+{
+    while (list !=3D 0)
+    {
+	param *next =3D list->next;
+	free(list->type);
+	free(list->name);
+	free(list->type2);
+	free(list);
+	list =3D next;
+    }
+    return list;
+}
+
+void
+reader_leaks(void)
+{
+    lex_param =3D free_declarations(lex_param);
+    parse_param =3D free_declarations(parse_param);
+
+    DO_FREE(line);
+    DO_FREE(rrhs);
+    DO_FREE(rlhs);
+    DO_FREE(rprec);
+    DO_FREE(ritem);
+    DO_FREE(rassoc);
+    DO_FREE(cache);
+    DO_FREE(name_pool);
+    DO_FREE(symbol_name);
+    DO_FREE(symbol_prec);
+    DO_FREE(symbol_assoc);
+    DO_FREE(symbol_value);
+}
+#endif
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/skeleton.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/skeleton.c	Wed Jul 25 16:21:35 2012 +0300
@@ -0,0 +1,439 @@
+/* $Id: skeleton.c,v 1.31 2011/09/07 09:37:59 tom Exp $ */
+
+#include "defs.h"
+
+/*  The definition of yysccsid in the banner should be replaced with	*/
+/*  a #pragma ident directive if the target C compiler supports		*/
+/*  #pragma ident directives.						*/
+/*									*/
+/*  If the skeleton is changed, the banner should be changed so that	*/
+/*  the altered version can be easily distinguished from the original.	*/
+/*									*/
+/*  The #defines included with the banner are there because they are	*/
+/*  useful in subsequent code.  The macros #defined in the header or	*/
+/*  the body either are not useful outside of semantic actions or	*/
+/*  are conditional.							*/
+
+const char *const banner[] =3D
+{
+    "#ifndef lint",
+    "static const char yysccsid[] =3D \"@(#)yaccpar	1.9 (Berkeley) 02/21/9=
3\";",
+    "#endif",
+    "",
+    "#define YYBYACC 1",
+    CONCAT1("#define YYMAJOR ", YYMAJOR),
+    CONCAT1("#define YYMINOR ", YYMINOR),
+#ifdef YYPATCH
+    CONCAT1("#define YYPATCH ", YYPATCH),
+#endif
+    "",
+    "#define YYEMPTY        (-1)",
+    "#define yyclearin      (yychar =3D YYEMPTY)",
+    "#define yyerrok        (yyerrflag =3D 0)",
+    "#define YYRECOVERING() (yyerrflag !=3D 0)",
+    "",
+    0
+};
+
+const char *const xdecls[] =3D
+{
+    "",
+    "extern int YYPARSE_DECL();",
+    0
+};
+
+const char *const tables[] =3D
+{
+    "extern short yylhs[];",
+    "extern short yylen[];",
+    "extern short yydefred[];",
+    "extern short yydgoto[];",
+    "extern short yysindex[];",
+    "extern short yyrindex[];",
+    "extern short yygindex[];",
+    "extern short yytable[];",
+    "extern short yycheck[];",
+    "",
+    "#if YYDEBUG",
+    "extern char *yyname[];",
+    "extern char *yyrule[];",
+    "#endif",
+    0
+};
+
+const char *const global_vars[] =3D
+{
+    "",
+    "int      yydebug;",
+    "int      yynerrs;",
+    0
+};
+
+const char *const impure_vars[] =3D
+{
+    "",
+    "int      yyerrflag;",
+    "int      yychar;",
+    "YYSTYPE  yyval;",
+    "YYSTYPE  yylval;",
+    0
+};
+
+const char *const hdr_defs[] =3D
+{
+    "",
+    "/* define the initial stack-sizes */",
+    "#ifdef YYSTACKSIZE",
+    "#undef YYMAXDEPTH",
+    "#define YYMAXDEPTH  YYSTACKSIZE",
+    "#else",
+    "#ifdef YYMAXDEPTH",
+    "#define YYSTACKSIZE YYMAXDEPTH",
+    "#else",
+    "#define YYSTACKSIZE 500",
+    "#define YYMAXDEPTH  500",
+    "#endif",
+    "#endif",
+    "",
+    "#define YYINITSTACKSIZE 500",
+    "",
+    "typedef struct {",
+    "    unsigned stacksize;",
+    "    short    *s_base;",
+    "    short    *s_mark;",
+    "    short    *s_last;",
+    "    YYSTYPE  *l_base;",
+    "    YYSTYPE  *l_mark;",
+    "} YYSTACKDATA;",
+    0
+};
+
+const char *const hdr_vars[] =3D
+{
+    "/* variables for the parser stack */",
+    "static YYSTACKDATA yystack;",
+    0
+};
+
+const char *const body_vars[] =3D
+{
+    "    int      yyerrflag;",
+    "    int      yychar;",
+    "    YYSTYPE  yyval;",
+    "    YYSTYPE  yylval;",
+    "",
+    "    /* variables for the parser stack */",
+    "    YYSTACKDATA yystack;",
+    0
+};
+
+const char *const body_1[] =3D
+{
+    "",
+    "#if YYDEBUG",
+    "#include <stdio.h>		/* needed for printf */",
+    "#endif",
+    "",
+    "#include <stdlib.h>	/* needed for malloc, etc */",
+    "#include <string.h>	/* needed for memset */",
+    "",
+    "/* allocate initial stack or double stack size, up to YYMAXDEPTH */",
+    "static int yygrowstack(YYSTACKDATA *data)",
+    "{",
+    "    int i;",
+    "    unsigned newsize;",
+    "    short *newss;",
+    "    YYSTYPE *newvs;",
+    "",
+    "    if ((newsize =3D data->stacksize) =3D=3D 0)",
+    "        newsize =3D YYINITSTACKSIZE;",
+    "    else if (newsize >=3D YYMAXDEPTH)",
+    "        return -1;",
+    "    else if ((newsize *=3D 2) > YYMAXDEPTH)",
+    "        newsize =3D YYMAXDEPTH;",
+    "",
+    "    i =3D data->s_mark - data->s_base;",
+    "    newss =3D (short *)realloc(data->s_base, newsize * sizeof(*newss)=
);",
+    "    if (newss =3D=3D 0)",
+    "        return -1;",
+    "",
+    "    data->s_base =3D newss;",
+    "    data->s_mark =3D newss + i;",
+    "",
+    "    newvs =3D (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newv=
s));",
+    "    if (newvs =3D=3D 0)",
+    "        return -1;",
+    "",
+    "    data->l_base =3D newvs;",
+    "    data->l_mark =3D newvs + i;",
+    "",
+    "    data->stacksize =3D newsize;",
+    "    data->s_last =3D data->s_base + newsize - 1;",
+    "    return 0;",
+    "}",
+    "",
+    "#if YYPURE || defined(YY_NO_LEAKS)",
+    "static void yyfreestack(YYSTACKDATA *data)",
+    "{",
+    "    free(data->s_base);",
+    "    free(data->l_base);",
+    "    memset(data, 0, sizeof(*data));",
+    "}",
+    "#else",
+    "#define yyfreestack(data) /* nothing */",
+    "#endif",
+    "",
+    "#define YYABORT  goto yyabort",
+    "#define YYREJECT goto yyabort",
+    "#define YYACCEPT goto yyaccept",
+    "#define YYERROR  goto yyerrlab",
+    "",
+    "int",
+    "YYPARSE_DECL()",
+    "{",
+    0
+};
+
+const char *const body_2[] =3D
+{
+    "    int yym, yyn, yystate;",
+    "#if YYDEBUG",
+    "    const char *yys;",
+    "",
+    "    if ((yys =3D getenv(\"YYDEBUG\")) !=3D 0)",
+    "    {",
+    "        yyn =3D *yys;",
+    "        if (yyn >=3D '0' && yyn <=3D '9')",
+    "            yydebug =3D yyn - '0';",
+    "    }",
+    "#endif",
+    "",
+    "    yynerrs =3D 0;",
+    "    yyerrflag =3D 0;",
+    "    yychar =3D YYEMPTY;",
+    "    yystate =3D 0;",
+    "",
+    "#if YYPURE",
+    "    memset(&yystack, 0, sizeof(yystack));",
+    "#endif",
+    "",
+    "    if (yystack.s_base =3D=3D NULL && yygrowstack(&yystack)) goto yyo=
verflow;",
+    "    yystack.s_mark =3D yystack.s_base;",
+    "    yystack.l_mark =3D yystack.l_base;",
+    "    yystate =3D 0;",
+    "    *yystack.s_mark =3D 0;",
+    "",
+    "yyloop:",
+    "    if ((yyn =3D yydefred[yystate]) !=3D 0) goto yyreduce;",
+    "    if (yychar < 0)",
+    "    {",
+    "        if ((yychar =3D YYLEX) < 0) yychar =3D 0;",
+    "#if YYDEBUG",
+    "        if (yydebug)",
+    "        {",
+    "            yys =3D 0;",
+    "            if (yychar <=3D YYMAXTOKEN) yys =3D yyname[yychar];",
+    "            if (!yys) yys =3D \"illegal-symbol\";",
+    "            printf(\"%sdebug: state %d, reading %d (%s)\\n\",",
+    "                    YYPREFIX, yystate, yychar, yys);",
+    "        }",
+    "#endif",
+    "    }",
+    "    if ((yyn =3D yysindex[yystate]) && (yyn +=3D yychar) >=3D 0 &&",
+    "            yyn <=3D YYTABLESIZE && yycheck[yyn] =3D=3D yychar)",
+    "    {",
+    "#if YYDEBUG",
+    "        if (yydebug)",
+    "            printf(\"%sdebug: state %d, shifting to state %d\\n\",",
+    "                    YYPREFIX, yystate, yytable[yyn]);",
+    "#endif",
+    "        if (yystack.s_mark >=3D yystack.s_last && yygrowstack(&yystac=
k))",
+    "        {",
+    "            goto yyoverflow;",
+    "        }",
+    "        yystate =3D yytable[yyn];",
+    "        *++yystack.s_mark =3D yytable[yyn];",
+    "        *++yystack.l_mark =3D yylval;",
+    "        yychar =3D YYEMPTY;",
+    "        if (yyerrflag > 0)  --yyerrflag;",
+    "        goto yyloop;",
+    "    }",
+    "    if ((yyn =3D yyrindex[yystate]) && (yyn +=3D yychar) >=3D 0 &&",
+    "            yyn <=3D YYTABLESIZE && yycheck[yyn] =3D=3D yychar)",
+    "    {",
+    "        yyn =3D yytable[yyn];",
+    "        goto yyreduce;",
+    "    }",
+    "    if (yyerrflag) goto yyinrecovery;",
+    "",
+    0
+};
+
+const char *const body_3[] =3D
+{
+    "",
+    "    goto yyerrlab;",
+    "",
+    "yyerrlab:",
+    "    ++yynerrs;",
+    "",
+    "yyinrecovery:",
+    "    if (yyerrflag < 3)",
+    "    {",
+    "        yyerrflag =3D 3;",
+    "        for (;;)",
+    "        {",
+    "            if ((yyn =3D yysindex[*yystack.s_mark]) && (yyn +=3D YYER=
RCODE) >=3D 0 &&",
+    "                    yyn <=3D YYTABLESIZE && yycheck[yyn] =3D=3D YYERR=
CODE)",
+    "            {",
+    "#if YYDEBUG",
+    "                if (yydebug)",
+    "                    printf(\"%sdebug: state %d, error recovery shifti=
ng\\",
+    " to state %d\\n\", YYPREFIX, *yystack.s_mark, yytable[yyn]);",
+    "#endif",
+    "                if (yystack.s_mark >=3D yystack.s_last && yygrowstack=
(&yystack))",
+    "                {",
+    "                    goto yyoverflow;",
+    "                }",
+    "                yystate =3D yytable[yyn];",
+    "                *++yystack.s_mark =3D yytable[yyn];",
+    "                *++yystack.l_mark =3D yylval;",
+    "                goto yyloop;",
+    "            }",
+    "            else",
+    "            {",
+    "#if YYDEBUG",
+    "                if (yydebug)",
+    "                    printf(\"%sdebug: error recovery discarding state=
 %d\
+\\n\",",
+    "                            YYPREFIX, *yystack.s_mark);",
+    "#endif",
+    "                if (yystack.s_mark <=3D yystack.s_base) goto yyabort;=
",
+    "                --yystack.s_mark;",
+    "                --yystack.l_mark;",
+    "            }",
+    "        }",
+    "    }",
+    "    else",
+    "    {",
+    "        if (yychar =3D=3D 0) goto yyabort;",
+    "#if YYDEBUG",
+    "        if (yydebug)",
+    "        {",
+    "            yys =3D 0;",
+    "            if (yychar <=3D YYMAXTOKEN) yys =3D yyname[yychar];",
+    "            if (!yys) yys =3D \"illegal-symbol\";",
+    "            printf(\"%sdebug: state %d, error recovery discards token=
 %d\
+ (%s)\\n\",",
+    "                    YYPREFIX, yystate, yychar, yys);",
+    "        }",
+    "#endif",
+    "        yychar =3D YYEMPTY;",
+    "        goto yyloop;",
+    "    }",
+    "",
+    "yyreduce:",
+    "#if YYDEBUG",
+    "    if (yydebug)",
+    "        printf(\"%sdebug: state %d, reducing by rule %d (%s)\\n\",",
+    "                YYPREFIX, yystate, yyn, yyrule[yyn]);",
+    "#endif",
+    "    yym =3D yylen[yyn];",
+    "    if (yym)",
+    "        yyval =3D yystack.l_mark[1-yym];",
+    "    else",
+    "        memset(&yyval, 0, sizeof yyval);",
+    "    switch (yyn)",
+    "    {",
+    0
+};
+
+const char *const trailer[] =3D
+{
+    "    }",
+    "    yystack.s_mark -=3D yym;",
+    "    yystate =3D *yystack.s_mark;",
+    "    yystack.l_mark -=3D yym;",
+    "    yym =3D yylhs[yyn];",
+    "    if (yystate =3D=3D 0 && yym =3D=3D 0)",
+    "    {",
+    "#if YYDEBUG",
+    "        if (yydebug)",
+    "            printf(\"%sdebug: after reduction, shifting from state 0 =
to\\",
+    " state %d\\n\", YYPREFIX, YYFINAL);",
+    "#endif",
+    "        yystate =3D YYFINAL;",
+    "        *++yystack.s_mark =3D YYFINAL;",
+    "        *++yystack.l_mark =3D yyval;",
+    "        if (yychar < 0)",
+    "        {",
+    "            if ((yychar =3D YYLEX) < 0) yychar =3D 0;",
+    "#if YYDEBUG",
+    "            if (yydebug)",
+    "            {",
+    "                yys =3D 0;",
+    "                if (yychar <=3D YYMAXTOKEN) yys =3D yyname[yychar];",
+    "                if (!yys) yys =3D \"illegal-symbol\";",
+    "                printf(\"%sdebug: state %d, reading %d (%s)\\n\",",
+    "                        YYPREFIX, YYFINAL, yychar, yys);",
+    "            }",
+    "#endif",
+    "        }",
+    "        if (yychar =3D=3D 0) goto yyaccept;",
+    "        goto yyloop;",
+    "    }",
+    "    if ((yyn =3D yygindex[yym]) && (yyn +=3D yystate) >=3D 0 &&",
+    "            yyn <=3D YYTABLESIZE && yycheck[yyn] =3D=3D yystate)",
+    "        yystate =3D yytable[yyn];",
+    "    else",
+    "        yystate =3D yydgoto[yym];",
+    "#if YYDEBUG",
+    "    if (yydebug)",
+    "        printf(\"%sdebug: after reduction, shifting from state %d \\",
+    "to state %d\\n\", YYPREFIX, *yystack.s_mark, yystate);",
+    "#endif",
+    "    if (yystack.s_mark >=3D yystack.s_last && yygrowstack(&yystack))",
+    "    {",
+    "        goto yyoverflow;",
+    "    }",
+    "    *++yystack.s_mark =3D (short) yystate;",
+    "    *++yystack.l_mark =3D yyval;",
+    "    goto yyloop;",
+    "",
+    "yyoverflow:",
+    0
+};
+
+const char *const trailer_2[] =3D
+{
+    "",
+    "yyabort:",
+    "    yyfreestack(&yystack);",
+    "    return (1);",
+    "",
+    "yyaccept:",
+    "    yyfreestack(&yystack);",
+    "    return (0);",
+    "}",
+    0
+};
+
+void
+write_section(FILE * fp, const char *const section[])
+{
+    int c;
+    int i;
+    const char *s;
+
+    for (i =3D 0; (s =3D section[i]) !=3D 0; ++i)
+    {
+	while ((c =3D *s) !=3D 0)
+	{
+	    putc(c, fp);
+	    ++s;
+	}
+	if (fp =3D=3D code_file)
+	    ++outline;
+	putc('\n', fp);
+    }
+}
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/symtab.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/symtab.c	Wed Jul 25 16:21:35 2012 +0300
@@ -0,0 +1,117 @@
+/* $Id: symtab.c,v 1.9 2010/11/24 15:12:29 tom Exp $ */
+
+#include "defs.h"
+
+/* TABLE_SIZE is the number of entries in the symbol table. */
+/* TABLE_SIZE must be a power of two.			    */
+
+#define	TABLE_SIZE 1024
+
+static bucket **symbol_table =3D 0;
+bucket *first_symbol;
+bucket *last_symbol;
+
+static int
+hash(const char *name)
+{
+    const char *s;
+    int c, k;
+
+    assert(name && *name);
+    s =3D name;
+    k =3D *s;
+    while ((c =3D *++s) !=3D 0)
+	k =3D (31 * k + c) & (TABLE_SIZE - 1);
+
+    return (k);
+}
+
+bucket *
+make_bucket(const char *name)
+{
+    bucket *bp;
+
+    assert(name !=3D 0);
+
+    bp =3D (bucket *)MALLOC(sizeof(bucket));
+    NO_SPACE(bp);
+
+    bp->link =3D 0;
+    bp->next =3D 0;
+
+    bp->name =3D MALLOC(strlen(name) + 1);
+    NO_SPACE(bp->name);
+
+    bp->tag =3D 0;
+    bp->value =3D UNDEFINED;
+    bp->index =3D 0;
+    bp->prec =3D 0;
+    bp->class =3D UNKNOWN;
+    bp->assoc =3D TOKEN;
+    strcpy(bp->name, name);
+
+    return (bp);
+}
+
+bucket *
+lookup(const char *name)
+{
+    bucket *bp, **bpp;
+
+    bpp =3D symbol_table + hash(name);
+    bp =3D *bpp;
+
+    while (bp)
+    {
+	if (strcmp(name, bp->name) =3D=3D 0)
+	    return (bp);
+	bpp =3D &bp->link;
+	bp =3D *bpp;
+    }
+
+    *bpp =3D bp =3D make_bucket(name);
+    last_symbol->next =3D bp;
+    last_symbol =3D bp;
+
+    return (bp);
+}
+
+void
+create_symbol_table(void)
+{
+    int i;
+    bucket *bp;
+
+    symbol_table =3D (bucket **)MALLOC(TABLE_SIZE * sizeof(bucket *));
+    NO_SPACE(symbol_table);
+
+    for (i =3D 0; i < TABLE_SIZE; i++)
+	symbol_table[i] =3D 0;
+
+    bp =3D make_bucket("error");
+    bp->index =3D 1;
+    bp->class =3D TERM;
+
+    first_symbol =3D bp;
+    last_symbol =3D bp;
+    symbol_table[hash("error")] =3D bp;
+}
+
+void
+free_symbol_table(void)
+{
+    FREE(symbol_table);
+    symbol_table =3D 0;
+}
+
+void
+free_symbols(void)
+{
+    bucket *p, *q;
+
+    for (p =3D first_symbol; p; p =3D q)
+    {
+	q =3D p->next;
+	FREE(p);
+    }
+}
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/test/README
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/test/README	Wed Jul 25 16:21:35 2012 +0300
@@ -0,0 +1,4 @@
+-- $Id: README,v 1.1 2004/03/28 19:10:48 tom Exp $
+
+The files in this directory are input (.y) and output (.output, .tab.c, .t=
ab.h)
+examples.
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/test/calc.output
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/test/calc.output	Wed Jul 25 16:21:35 2012 +0300
@@ -0,0 +1,461 @@
+   0  $accept : list $end
+
+   1  list :
+   2       | list stat '\n'
+   3       | list error '\n'
+
+   4  stat : expr
+   5       | LETTER '=3D' expr
+
+   6  expr : '(' expr ')'
+   7       | expr '+' expr
+   8       | expr '-' expr
+   9       | expr '*' expr
+  10       | expr '/' expr
+  11       | expr '%' expr
+  12       | expr '&' expr
+  13       | expr '|' expr
+  14       | '-' expr
+  15       | LETTER
+  16       | number
+
+  17  number : DIGIT
+  18         | number DIGIT
+=0C
+state 0
+	$accept : . list $end  (0)
+	list : .  (1)
+
+	.  reduce 1
+
+	list  goto 1
+
+
+state 1
+	$accept : list . $end  (0)
+	list : list . stat '\n'  (2)
+	list : list . error '\n'  (3)
+
+	$end  accept
+	error  shift 2
+	DIGIT  shift 3
+	LETTER  shift 4
+	'-'  shift 5
+	'('  shift 6
+	.  error
+
+	stat  goto 7
+	expr  goto 8
+	number  goto 9
+
+
+state 2
+	list : list error . '\n'  (3)
+
+	'\n'  shift 10
+	.  error
+
+
+state 3
+	number : DIGIT .  (17)
+
+	.  reduce 17
+
+
+state 4
+	stat : LETTER . '=3D' expr  (5)
+	expr : LETTER .  (15)
+
+	'=3D'  shift 11
+	'|'  reduce 15
+	'&'  reduce 15
+	'+'  reduce 15
+	'-'  reduce 15
+	'*'  reduce 15
+	'/'  reduce 15
+	'%'  reduce 15
+	'\n'  reduce 15
+
+
+state 5
+	expr : '-' . expr  (14)
+
+	DIGIT  shift 3
+	LETTER  shift 12
+	'-'  shift 5
+	'('  shift 6
+	.  error
+
+	expr  goto 13
+	number  goto 9
+
+
+state 6
+	expr : '(' . expr ')'  (6)
+
+	DIGIT  shift 3
+	LETTER  shift 12
+	'-'  shift 5
+	'('  shift 6
+	.  error
+
+	expr  goto 14
+	number  goto 9
+
+
+state 7
+	list : list stat . '\n'  (2)
+
+	'\n'  shift 15
+	.  error
+
+
+state 8
+	stat : expr .  (4)
+	expr : expr . '+' expr  (7)
+	expr : expr . '-' expr  (8)
+	expr : expr . '*' expr  (9)
+	expr : expr . '/' expr  (10)
+	expr : expr . '%' expr  (11)
+	expr : expr . '&' expr  (12)
+	expr : expr . '|' expr  (13)
+
+	'|'  shift 16
+	'&'  shift 17
+	'+'  shift 18
+	'-'  shift 19
+	'*'  shift 20
+	'/'  shift 21
+	'%'  shift 22
+	'\n'  reduce 4
+
+
+state 9
+	expr : number .  (16)
+	number : number . DIGIT  (18)
+
+	DIGIT  shift 23
+	'|'  reduce 16
+	'&'  reduce 16
+	'+'  reduce 16
+	'-'  reduce 16
+	'*'  reduce 16
+	'/'  reduce 16
+	'%'  reduce 16
+	'\n'  reduce 16
+	')'  reduce 16
+
+
+state 10
+	list : list error '\n' .  (3)
+
+	.  reduce 3
+
+
+state 11
+	stat : LETTER '=3D' . expr  (5)
+
+	DIGIT  shift 3
+	LETTER  shift 12
+	'-'  shift 5
+	'('  shift 6
+	.  error
+
+	expr  goto 24
+	number  goto 9
+
+
+state 12
+	expr : LETTER .  (15)
+
+	.  reduce 15
+
+
+state 13
+	expr : expr . '+' expr  (7)
+	expr : expr . '-' expr  (8)
+	expr : expr . '*' expr  (9)
+	expr : expr . '/' expr  (10)
+	expr : expr . '%' expr  (11)
+	expr : expr . '&' expr  (12)
+	expr : expr . '|' expr  (13)
+	expr : '-' expr .  (14)
+
+	.  reduce 14
+
+
+state 14
+	expr : '(' expr . ')'  (6)
+	expr : expr . '+' expr  (7)
+	expr : expr . '-' expr  (8)
+	expr : expr . '*' expr  (9)
+	expr : expr . '/' expr  (10)
+	expr : expr . '%' expr  (11)
+	expr : expr . '&' expr  (12)
+	expr : expr . '|' expr  (13)
+
+	'|'  shift 16
+	'&'  shift 17
+	'+'  shift 18
+	'-'  shift 19
+	'*'  shift 20
+	'/'  shift 21
+	'%'  shift 22
+	')'  shift 25
+	.  error
+
+
+state 15
+	list : list stat '\n' .  (2)
+
+	.  reduce 2
+
+
+state 16
+	expr : expr '|' . expr  (13)
+
+	DIGIT  shift 3
+	LETTER  shift 12
+	'-'  shift 5
+	'('  shift 6
+	.  error
+
+	expr  goto 26
+	number  goto 9
+
+
+state 17
+	expr : expr '&' . expr  (12)
+
+	DIGIT  shift 3
+	LETTER  shift 12
+	'-'  shift 5
+	'('  shift 6
+	.  error
+
+	expr  goto 27
+	number  goto 9
+
+
+state 18
+	expr : expr '+' . expr  (7)
+
+	DIGIT  shift 3
+	LETTER  shift 12
+	'-'  shift 5
+	'('  shift 6
+	.  error
+
+	expr  goto 28
+	number  goto 9
+
+
+state 19
+	expr : expr '-' . expr  (8)
+
+	DIGIT  shift 3
+	LETTER  shift 12
+	'-'  shift 5
+	'('  shift 6
+	.  error
+
+	expr  goto 29
+	number  goto 9
+
+
+state 20
+	expr : expr '*' . expr  (9)
+
+	DIGIT  shift 3
+	LETTER  shift 12
+	'-'  shift 5
+	'('  shift 6
+	.  error
+
+	expr  goto 30
+	number  goto 9
+
+
+state 21
+	expr : expr '/' . expr  (10)
+
+	DIGIT  shift 3
+	LETTER  shift 12
+	'-'  shift 5
+	'('  shift 6
+	.  error
+
+	expr  goto 31
+	number  goto 9
+
+
+state 22
+	expr : expr '%' . expr  (11)
+
+	DIGIT  shift 3
+	LETTER  shift 12
+	'-'  shift 5
+	'('  shift 6
+	.  error
+
+	expr  goto 32
+	number  goto 9
+
+
+state 23
+	number : number DIGIT .  (18)
+
+	.  reduce 18
+
+
+state 24
+	stat : LETTER '=3D' expr .  (5)
+	expr : expr . '+' expr  (7)
+	expr : expr . '-' expr  (8)
+	expr : expr . '*' expr  (9)
+	expr : expr . '/' expr  (10)
+	expr : expr . '%' expr  (11)
+	expr : expr . '&' expr  (12)
+	expr : expr . '|' expr  (13)
+
+	'|'  shift 16
+	'&'  shift 17
+	'+'  shift 18
+	'-'  shift 19
+	'*'  shift 20
+	'/'  shift 21
+	'%'  shift 22
+	'\n'  reduce 5
+
+
+state 25
+	expr : '(' expr ')' .  (6)
+
+	.  reduce 6
+
+
+state 26
+	expr : expr . '+' expr  (7)
+	expr : expr . '-' expr  (8)
+	expr : expr . '*' expr  (9)
+	expr : expr . '/' expr  (10)
+	expr : expr . '%' expr  (11)
+	expr : expr . '&' expr  (12)
+	expr : expr . '|' expr  (13)
+	expr : expr '|' expr .  (13)
+
+	'&'  shift 17
+	'+'  shift 18
+	'-'  shift 19
+	'*'  shift 20
+	'/'  shift 21
+	'%'  shift 22
+	'|'  reduce 13
+	'\n'  reduce 13
+	')'  reduce 13
+
+
+state 27
+	expr : expr . '+' expr  (7)
+	expr : expr . '-' expr  (8)
+	expr : expr . '*' expr  (9)
+	expr : expr . '/' expr  (10)
+	expr : expr . '%' expr  (11)
+	expr : expr . '&' expr  (12)
+	expr : expr '&' expr .  (12)
+	expr : expr . '|' expr  (13)
+
+	'+'  shift 18
+	'-'  shift 19
+	'*'  shift 20
+	'/'  shift 21
+	'%'  shift 22
+	'|'  reduce 12
+	'&'  reduce 12
+	'\n'  reduce 12
+	')'  reduce 12
+
+
+state 28
+	expr : expr . '+' expr  (7)
+	expr : expr '+' expr .  (7)
+	expr : expr . '-' expr  (8)
+	expr : expr . '*' expr  (9)
+	expr : expr . '/' expr  (10)
+	expr : expr . '%' expr  (11)
+	expr : expr . '&' expr  (12)
+	expr : expr . '|' expr  (13)
+
+	'*'  shift 20
+	'/'  shift 21
+	'%'  shift 22
+	'|'  reduce 7
+	'&'  reduce 7
+	'+'  reduce 7
+	'-'  reduce 7
+	'\n'  reduce 7
+	')'  reduce 7
+
+
+state 29
+	expr : expr . '+' expr  (7)
+	expr : expr . '-' expr  (8)
+	expr : expr '-' expr .  (8)
+	expr : expr . '*' expr  (9)
+	expr : expr . '/' expr  (10)
+	expr : expr . '%' expr  (11)
+	expr : expr . '&' expr  (12)
+	expr : expr . '|' expr  (13)
+
+	'*'  shift 20
+	'/'  shift 21
+	'%'  shift 22
+	'|'  reduce 8
+	'&'  reduce 8
+	'+'  reduce 8
+	'-'  reduce 8
+	'\n'  reduce 8
+	')'  reduce 8
+
+
+state 30
+	expr : expr . '+' expr  (7)
+	expr : expr . '-' expr  (8)
+	expr : expr . '*' expr  (9)
+	expr : expr '*' expr .  (9)
+	expr : expr . '/' expr  (10)
+	expr : expr . '%' expr  (11)
+	expr : expr . '&' expr  (12)
+	expr : expr . '|' expr  (13)
+
+	.  reduce 9
+
+
+state 31
+	expr : expr . '+' expr  (7)
+	expr : expr . '-' expr  (8)
+	expr : expr . '*' expr  (9)
+	expr : expr . '/' expr  (10)
+	expr : expr '/' expr .  (10)
+	expr : expr . '%' expr  (11)
+	expr : expr . '&' expr  (12)
+	expr : expr . '|' expr  (13)
+
+	.  reduce 10
+
+
+state 32
+	expr : expr . '+' expr  (7)
+	expr : expr . '-' expr  (8)
+	expr : expr . '*' expr  (9)
+	expr : expr . '/' expr  (10)
+	expr : expr . '%' expr  (11)
+	expr : expr '%' expr .  (11)
+	expr : expr . '&' expr  (12)
+	expr : expr . '|' expr  (13)
+
+	.  reduce 11
+
+
+16 terminals, 5 nonterminals
+19 grammar rules, 33 states
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/test/calc.tab.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/test/calc.tab.c	Wed Jul 25 16:21:35 2012 +0300
@@ -0,0 +1,673 @@
+#ifndef lint
+static const char yysccsid[] =3D "@(#)yaccpar	1.9 (Berkeley) 02/21/93";
+#endif
+
+#define YYBYACC 1
+#define YYMAJOR 1
+#define YYMINOR 9
+
+#define YYEMPTY        (-1)
+#define yyclearin      (yychar =3D YYEMPTY)
+#define yyerrok        (yyerrflag =3D 0)
+#define YYRECOVERING() (yyerrflag !=3D 0)
+
+
+#ifndef yyparse
+#define yyparse    calc_parse
+#endif /* yyparse */
+
+#ifndef yylex
+#define yylex      calc_lex
+#endif /* yylex */
+
+#ifndef yyerror
+#define yyerror    calc_error
+#endif /* yyerror */
+
+#ifndef yychar
+#define yychar     calc_char
+#endif /* yychar */
+
+#ifndef yyval
+#define yyval      calc_val
+#endif /* yyval */
+
+#ifndef yylval
+#define yylval     calc_lval
+#endif /* yylval */
+
+#ifndef yydebug
+#define yydebug    calc_debug
+#endif /* yydebug */
+
+#ifndef yynerrs
+#define yynerrs    calc_nerrs
+#endif /* yynerrs */
+
+#ifndef yyerrflag
+#define yyerrflag  calc_errflag
+#endif /* yyerrflag */
+
+#ifndef yylhs
+#define yylhs      calc_lhs
+#endif /* yylhs */
+
+#ifndef yylen
+#define yylen      calc_len
+#endif /* yylen */
+
+#ifndef yydefred
+#define yydefred   calc_defred
+#endif /* yydefred */
+
+#ifndef yydgoto
+#define yydgoto    calc_dgoto
+#endif /* yydgoto */
+
+#ifndef yysindex
+#define yysindex   calc_sindex
+#endif /* yysindex */
+
+#ifndef yyrindex
+#define yyrindex   calc_rindex
+#endif /* yyrindex */
+
+#ifndef yygindex
+#define yygindex   calc_gindex
+#endif /* yygindex */
+
+#ifndef yytable
+#define yytable    calc_table
+#endif /* yytable */
+
+#ifndef yycheck
+#define yycheck    calc_check
+#endif /* yycheck */
+
+#ifndef yyname
+#define yyname     calc_name
+#endif /* yyname */
+
+#ifndef yyrule
+#define yyrule     calc_rule
+#endif /* yyrule */
+#define YYPREFIX "calc_"
+
+#define YYPURE 0
+
+#line 2 "calc.y"
+# include <stdio.h>
+# include <ctype.h>
+
+int regs[26];
+int base;
+
+extern int yylex(void);
+static void yyerror(const char *s);
+
+#line 109 "calc.tab.c"
+
+#ifndef YYSTYPE
+typedef int YYSTYPE;
+#endif
+
+/* compatibility with bison */
+#ifdef YYPARSE_PARAM
+/* compatibility with FreeBSD */
+# ifdef YYPARSE_PARAM_TYPE
+#  define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM)
+# else
+#  define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM)
+# endif
+#else
+# define YYPARSE_DECL() yyparse(void)
+#endif
+
+/* Parameters sent to lex. */
+#ifdef YYLEX_PARAM
+# define YYLEX_DECL() yylex(void *YYLEX_PARAM)
+# define YYLEX yylex(YYLEX_PARAM)
+#else
+# define YYLEX_DECL() yylex(void)
+# define YYLEX yylex()
+#endif
+
+/* Parameters sent to yyerror. */
+#ifndef YYERROR_DECL
+#define YYERROR_DECL() yyerror(const char *s)
+#endif
+#ifndef YYERROR_CALL
+#define YYERROR_CALL(msg) yyerror(msg)
+#endif
+
+extern int YYPARSE_DECL();
+
+#define DIGIT 257
+#define LETTER 258
+#define UMINUS 259
+#define YYERRCODE 256
+static const short calc_lhs[] =3D {                        -1,
+    0,    0,    0,    1,    1,    2,    2,    2,    2,    2,
+    2,    2,    2,    2,    2,    2,    3,    3,
+};
+static const short calc_len[] =3D {                         2,
+    0,    3,    3,    1,    3,    3,    3,    3,    3,    3,
+    3,    3,    3,    2,    1,    1,    1,    2,
+};
+static const short calc_defred[] =3D {                      1,
+    0,    0,   17,    0,    0,    0,    0,    0,    0,    3,
+    0,   15,   14,    0,    2,    0,    0,    0,    0,    0,
+    0,    0,   18,    0,    6,    0,    0,    0,    0,    9,
+   10,   11,
+};
+static const short calc_dgoto[] =3D {                       1,
+    7,    8,    9,
+};
+static const short calc_sindex[] =3D {                      0,
+  -40,   -7,    0,  -55,  -38,  -38,    1,  -29, -247,    0,
+  -38,    0,    0,   22,    0,  -38,  -38,  -38,  -38,  -38,
+  -38,  -38,    0,  -29,    0,   51,   60,  -20,  -20,    0,
+    0,    0,
+};
+static const short calc_rindex[] =3D {                      0,
+    0,    0,    0,    2,    0,    0,    0,    9,   -9,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,   10,    0,   -6,   14,    5,   13,    0,
+    0,    0,
+};
+static const short calc_gindex[] =3D {                      0,
+    0,   65,    0,
+};
+#define YYTABLESIZE 220
+static const short calc_table[] =3D {                       6,
+   16,    6,   10,   13,    5,   11,    5,   22,   17,   23,
+   15,   15,   20,   18,    7,   19,   22,   21,    4,    5,
+    0,   20,    8,   12,    0,    0,   21,   16,   16,    0,
+    0,   16,   16,   16,   13,   16,    0,   16,   15,   15,
+    0,    0,    7,   15,   15,    7,   15,    7,   15,    7,
+    8,   12,    0,    8,   12,    8,    0,    8,   22,   17,
+    0,    0,   25,   20,   18,    0,   19,    0,   21,   13,
+   14,    0,    0,    0,    0,   24,    0,    0,    0,    0,
+   26,   27,   28,   29,   30,   31,   32,   22,   17,    0,
+    0,    0,   20,   18,   16,   19,   22,   21,    0,    0,
+    0,   20,   18,    0,   19,    0,   21,    0,    0,    0,
+    0,    0,    0,    0,   16,    0,    0,   13,    0,    0,
+    0,    0,    0,    0,    0,   15,    0,    0,    7,    0,
+    0,    0,    0,    0,    0,    0,    8,   12,    0,    0,
+    0,    0,    0,    0,    0,   16,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    2,    3,    4,    3,   12,
+};
+static const short calc_check[] =3D {                      40,
+   10,   40,   10,   10,   45,   61,   45,   37,   38,  257,
+   10,   10,   42,   43,   10,   45,   37,   47,   10,   10,
+   -1,   42,   10,   10,   -1,   -1,   47,   37,   38,   -1,
+   -1,   41,   42,   43,   41,   45,   -1,   47,   37,   38,
+   -1,   -1,   38,   42,   43,   41,   45,   43,   47,   45,
+   38,   38,   -1,   41,   41,   43,   -1,   45,   37,   38,
+   -1,   -1,   41,   42,   43,   -1,   45,   -1,   47,    5,
+    6,   -1,   -1,   -1,   -1,   11,   -1,   -1,   -1,   -1,
+   16,   17,   18,   19,   20,   21,   22,   37,   38,   -1,
+   -1,   -1,   42,   43,  124,   45,   37,   47,   -1,   -1,
+   -1,   42,   43,   -1,   45,   -1,   47,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,  124,   -1,   -1,  124,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,  124,   -1,   -1,  124,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,  124,  124,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,  124,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,  256,  257,  258,  257,  258,
+};
+#define YYFINAL 1
+#ifndef YYDEBUG
+#define YYDEBUG 0
+#endif
+#define YYMAXTOKEN 259
+#if YYDEBUG
+static const char *yyname[] =3D {
+
+"end-of-file",0,0,0,0,0,0,0,0,0,"'\\n'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,=
0,0,0,
+0,0,0,0,0,0,"'%'","'&'",0,"'('","')'","'*'","'+'",0,"'-'",0,"'/'",0,0,0,0,=
0,0,0,
+0,0,0,0,0,0,"'=3D'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,=
0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"'|'",0,0,0,=
0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,=
0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,=
0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,=
0,0,0,
+0,0,0,0,0,0,"DIGIT","LETTER","UMINUS",
+};
+static const char *yyrule[] =3D {
+"$accept : list",
+"list :",
+"list : list stat '\\n'",
+"list : list error '\\n'",
+"stat : expr",
+"stat : LETTER '=3D' expr",
+"expr : '(' expr ')'",
+"expr : expr '+' expr",
+"expr : expr '-' expr",
+"expr : expr '*' expr",
+"expr : expr '/' expr",
+"expr : expr '%' expr",
+"expr : expr '&' expr",
+"expr : expr '|' expr",
+"expr : '-' expr",
+"expr : LETTER",
+"expr : number",
+"number : DIGIT",
+"number : number DIGIT",
+
+};
+#endif
+
+int      yydebug;
+int      yynerrs;
+
+int      yyerrflag;
+int      yychar;
+YYSTYPE  yyval;
+YYSTYPE  yylval;
+
+/* define the initial stack-sizes */
+#ifdef YYSTACKSIZE
+#undef YYMAXDEPTH
+#define YYMAXDEPTH  YYSTACKSIZE
+#else
+#ifdef YYMAXDEPTH
+#define YYSTACKSIZE YYMAXDEPTH
+#else
+#define YYSTACKSIZE 500
+#define YYMAXDEPTH  500
+#endif
+#endif
+
+#define YYINITSTACKSIZE 500
+
+typedef struct {
+    unsigned stacksize;
+    short    *s_base;
+    short    *s_mark;
+    short    *s_last;
+    YYSTYPE  *l_base;
+    YYSTYPE  *l_mark;
+} YYSTACKDATA;
+/* variables for the parser stack */
+static YYSTACKDATA yystack;
+#line 66 "calc.y"
+ /* start of programs */
+
+int
+main (void)
+{
+    while(!feof(stdin)) {
+	yyparse();
+    }
+    return 0;
+}
+
+static void
+yyerror(const char *s)
+{
+    fprintf(stderr, "%s\n", s);
+}
+
+int
+yylex(void)
+{
+	/* lexical analysis routine */
+	/* returns LETTER for a lower case letter, yylval =3D 0 through 25 */
+	/* return DIGIT for a digit, yylval =3D 0 through 9 */
+	/* all other characters are returned immediately */
+
+    int c;
+
+    while( (c=3Dgetchar()) =3D=3D ' ' )   { /* skip blanks */ }
+
+    /* c is now nonblank */
+
+    if( islower( c )) {
+	yylval =3D c - 'a';
+	return ( LETTER );
+    }
+    if( isdigit( c )) {
+	yylval =3D c - '0';
+	return ( DIGIT );
+    }
+    return( c );
+}
+#line 347 "calc.tab.c"
+
+#if YYDEBUG
+#include <stdio.h>		/* needed for printf */
+#endif
+
+#include <stdlib.h>	/* needed for malloc, etc */
+#include <string.h>	/* needed for memset */
+
+/* allocate initial stack or double stack size, up to YYMAXDEPTH */
+static int yygrowstack(YYSTACKDATA *data)
+{
+    int i;
+    unsigned newsize;
+    short *newss;
+    YYSTYPE *newvs;
+
+    if ((newsize =3D data->stacksize) =3D=3D 0)
+        newsize =3D YYINITSTACKSIZE;
+    else if (newsize >=3D YYMAXDEPTH)
+        return -1;
+    else if ((newsize *=3D 2) > YYMAXDEPTH)
+        newsize =3D YYMAXDEPTH;
+
+    i =3D data->s_mark - data->s_base;
+    newss =3D (short *)realloc(data->s_base, newsize * sizeof(*newss));
+    if (newss =3D=3D 0)
+        return -1;
+
+    data->s_base =3D newss;
+    data->s_mark =3D newss + i;
+
+    newvs =3D (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));
+    if (newvs =3D=3D 0)
+        return -1;
+
+    data->l_base =3D newvs;
+    data->l_mark =3D newvs + i;
+
+    data->stacksize =3D newsize;
+    data->s_last =3D data->s_base + newsize - 1;
+    return 0;
+}
+
+#if YYPURE || defined(YY_NO_LEAKS)
+static void yyfreestack(YYSTACKDATA *data)
+{
+    free(data->s_base);
+    free(data->l_base);
+    memset(data, 0, sizeof(*data));
+}
+#else
+#define yyfreestack(data) /* nothing */
+#endif
+
+#define YYABORT  goto yyabort
+#define YYREJECT goto yyabort
+#define YYACCEPT goto yyaccept
+#define YYERROR  goto yyerrlab
+
+int
+YYPARSE_DECL()
+{
+    int yym, yyn, yystate;
+#if YYDEBUG
+    const char *yys;
+
+    if ((yys =3D getenv("YYDEBUG")) !=3D 0)
+    {
+        yyn =3D *yys;
+        if (yyn >=3D '0' && yyn <=3D '9')
+            yydebug =3D yyn - '0';
+    }
+#endif
+
+    yynerrs =3D 0;
+    yyerrflag =3D 0;
+    yychar =3D YYEMPTY;
+    yystate =3D 0;
+
+#if YYPURE
+    memset(&yystack, 0, sizeof(yystack));
+#endif
+
+    if (yystack.s_base =3D=3D NULL && yygrowstack(&yystack)) goto yyoverfl=
ow;
+    yystack.s_mark =3D yystack.s_base;
+    yystack.l_mark =3D yystack.l_base;
+    yystate =3D 0;
+    *yystack.s_mark =3D 0;
+
+yyloop:
+    if ((yyn =3D yydefred[yystate]) !=3D 0) goto yyreduce;
+    if (yychar < 0)
+    {
+        if ((yychar =3D YYLEX) < 0) yychar =3D 0;
+#if YYDEBUG
+        if (yydebug)
+        {
+            yys =3D 0;
+            if (yychar <=3D YYMAXTOKEN) yys =3D yyname[yychar];
+            if (!yys) yys =3D "illegal-symbol";
+            printf("%sdebug: state %d, reading %d (%s)\n",
+                    YYPREFIX, yystate, yychar, yys);
+        }
+#endif
+    }
+    if ((yyn =3D yysindex[yystate]) && (yyn +=3D yychar) >=3D 0 &&
+            yyn <=3D YYTABLESIZE && yycheck[yyn] =3D=3D yychar)
+    {
+#if YYDEBUG
+        if (yydebug)
+            printf("%sdebug: state %d, shifting to state %d\n",
+                    YYPREFIX, yystate, yytable[yyn]);
+#endif
+        if (yystack.s_mark >=3D yystack.s_last && yygrowstack(&yystack))
+        {
+            goto yyoverflow;
+        }
+        yystate =3D yytable[yyn];
+        *++yystack.s_mark =3D yytable[yyn];
+        *++yystack.l_mark =3D yylval;
+        yychar =3D YYEMPTY;
+        if (yyerrflag > 0)  --yyerrflag;
+        goto yyloop;
+    }
+    if ((yyn =3D yyrindex[yystate]) && (yyn +=3D yychar) >=3D 0 &&
+            yyn <=3D YYTABLESIZE && yycheck[yyn] =3D=3D yychar)
+    {
+        yyn =3D yytable[yyn];
+        goto yyreduce;
+    }
+    if (yyerrflag) goto yyinrecovery;
+
+    yyerror("syntax error");
+
+    goto yyerrlab;
+
+yyerrlab:
+    ++yynerrs;
+
+yyinrecovery:
+    if (yyerrflag < 3)
+    {
+        yyerrflag =3D 3;
+        for (;;)
+        {
+            if ((yyn =3D yysindex[*yystack.s_mark]) && (yyn +=3D YYERRCODE=
) >=3D 0 &&
+                    yyn <=3D YYTABLESIZE && yycheck[yyn] =3D=3D YYERRCODE)
+            {
+#if YYDEBUG
+                if (yydebug)
+                    printf("%sdebug: state %d, error recovery shifting\
+ to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]);
+#endif
+                if (yystack.s_mark >=3D yystack.s_last && yygrowstack(&yys=
tack))
+                {
+                    goto yyoverflow;
+                }
+                yystate =3D yytable[yyn];
+                *++yystack.s_mark =3D yytable[yyn];
+                *++yystack.l_mark =3D yylval;
+                goto yyloop;
+            }
+            else
+            {
+#if YYDEBUG
+                if (yydebug)
+                    printf("%sdebug: error recovery discarding state %d\n",
+                            YYPREFIX, *yystack.s_mark);
+#endif
+                if (yystack.s_mark <=3D yystack.s_base) goto yyabort;
+                --yystack.s_mark;
+                --yystack.l_mark;
+            }
+        }
+    }
+    else
+    {
+        if (yychar =3D=3D 0) goto yyabort;
+#if YYDEBUG
+        if (yydebug)
+        {
+            yys =3D 0;
+            if (yychar <=3D YYMAXTOKEN) yys =3D yyname[yychar];
+            if (!yys) yys =3D "illegal-symbol";
+            printf("%sdebug: state %d, error recovery discards token %d (%=
s)\n",
+                    YYPREFIX, yystate, yychar, yys);
+        }
+#endif
+        yychar =3D YYEMPTY;
+        goto yyloop;
+    }
+
+yyreduce:
+#if YYDEBUG
+    if (yydebug)
+        printf("%sdebug: state %d, reducing by rule %d (%s)\n",
+                YYPREFIX, yystate, yyn, yyrule[yyn]);
+#endif
+    yym =3D yylen[yyn];
+    if (yym)
+        yyval =3D yystack.l_mark[1-yym];
+    else
+        memset(&yyval, 0, sizeof yyval);
+    switch (yyn)
+    {
+case 3:
+#line 28 "calc.y"
+	{  yyerrok ; }
+break;
+case 4:
+#line 32 "calc.y"
+	{  printf("%d\n",yystack.l_mark[0]);}
+break;
+case 5:
+#line 34 "calc.y"
+	{  regs[yystack.l_mark[-2]] =3D yystack.l_mark[0]; }
+break;
+case 6:
+#line 38 "calc.y"
+	{  yyval =3D yystack.l_mark[-1]; }
+break;
+case 7:
+#line 40 "calc.y"
+	{  yyval =3D yystack.l_mark[-2] + yystack.l_mark[0]; }
+break;
+case 8:
+#line 42 "calc.y"
+	{  yyval =3D yystack.l_mark[-2] - yystack.l_mark[0]; }
+break;
+case 9:
+#line 44 "calc.y"
+	{  yyval =3D yystack.l_mark[-2] * yystack.l_mark[0]; }
+break;
+case 10:
+#line 46 "calc.y"
+	{  yyval =3D yystack.l_mark[-2] / yystack.l_mark[0]; }
+break;
+case 11:
+#line 48 "calc.y"
+	{  yyval =3D yystack.l_mark[-2] % yystack.l_mark[0]; }
+break;
+case 12:
+#line 50 "calc.y"
+	{  yyval =3D yystack.l_mark[-2] & yystack.l_mark[0]; }
+break;
+case 13:
+#line 52 "calc.y"
+	{  yyval =3D yystack.l_mark[-2] | yystack.l_mark[0]; }
+break;
+case 14:
+#line 54 "calc.y"
+	{  yyval =3D - yystack.l_mark[0]; }
+break;
+case 15:
+#line 56 "calc.y"
+	{  yyval =3D regs[yystack.l_mark[0]]; }
+break;
+case 17:
+#line 61 "calc.y"
+	{  yyval =3D yystack.l_mark[0]; base =3D (yystack.l_mark[0]=3D=3D0) ? 8 :=
 10; }
+break;
+case 18:
+#line 63 "calc.y"
+	{  yyval =3D base * yystack.l_mark[-1] + yystack.l_mark[0]; }
+break;
+#line 613 "calc.tab.c"
+    }
+    yystack.s_mark -=3D yym;
+    yystate =3D *yystack.s_mark;
+    yystack.l_mark -=3D yym;
+    yym =3D yylhs[yyn];
+    if (yystate =3D=3D 0 && yym =3D=3D 0)
+    {
+#if YYDEBUG
+        if (yydebug)
+            printf("%sdebug: after reduction, shifting from state 0 to\
+ state %d\n", YYPREFIX, YYFINAL);
+#endif
+        yystate =3D YYFINAL;
+        *++yystack.s_mark =3D YYFINAL;
+        *++yystack.l_mark =3D yyval;
+        if (yychar < 0)
+        {
+            if ((yychar =3D YYLEX) < 0) yychar =3D 0;
+#if YYDEBUG
+            if (yydebug)
+            {
+                yys =3D 0;
+                if (yychar <=3D YYMAXTOKEN) yys =3D yyname[yychar];
+                if (!yys) yys =3D "illegal-symbol";
+                printf("%sdebug: state %d, reading %d (%s)\n",
+                        YYPREFIX, YYFINAL, yychar, yys);
+            }
+#endif
+        }
+        if (yychar =3D=3D 0) goto yyaccept;
+        goto yyloop;
+    }
+    if ((yyn =3D yygindex[yym]) && (yyn +=3D yystate) >=3D 0 &&
+            yyn <=3D YYTABLESIZE && yycheck[yyn] =3D=3D yystate)
+        yystate =3D yytable[yyn];
+    else
+        yystate =3D yydgoto[yym];
+#if YYDEBUG
+    if (yydebug)
+        printf("%sdebug: after reduction, shifting from state %d \
+to state %d\n", YYPREFIX, *yystack.s_mark, yystate);
+#endif
+    if (yystack.s_mark >=3D yystack.s_last && yygrowstack(&yystack))
+    {
+        goto yyoverflow;
+    }
+    *++yystack.s_mark =3D (short) yystate;
+    *++yystack.l_mark =3D yyval;
+    goto yyloop;
+
+yyoverflow:
+    yyerror("yacc stack overflow");
+
+yyabort:
+    yyfreestack(&yystack);
+    return (1);
+
+yyaccept:
+    yyfreestack(&yystack);
+    return (0);
+}
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/test/calc.tab.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/test/calc.tab.h	Wed Jul 25 16:21:35 2012 +0300
@@ -0,0 +1,3 @@
+#define DIGIT 257
+#define LETTER 258
+#define UMINUS 259
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/test/calc.y
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/test/calc.y	Wed Jul 25 16:21:35 2012 +0300
@@ -0,0 +1,106 @@
+%{
+# include <stdio.h>
+# include <ctype.h>
+
+int regs[26];
+int base;
+
+extern int yylex(void);
+static void yyerror(const char *s);
+
+%}
+
+%start list
+
+%token DIGIT LETTER
+
+%left '|'
+%left '&'
+%left '+' '-'
+%left '*' '/' '%'
+%left UMINUS   /* supplies precedence for unary minus */
+
+%% /* beginning of rules section */
+
+list  :  /* empty */
+      |  list stat '\n'
+      |  list error '\n'
+            {  yyerrok ; }
+      ;
+
+stat  :  expr
+            {  printf("%d\n",$1);}
+      |  LETTER '=3D' expr
+            {  regs[$1] =3D $3; }
+      ;
+
+expr  :  '(' expr ')'
+            {  $$ =3D $2; }
+      |  expr '+' expr
+            {  $$ =3D $1 + $3; }
+      |  expr '-' expr
+            {  $$ =3D $1 - $3; }
+      |  expr '*' expr
+            {  $$ =3D $1 * $3; }
+      |  expr '/' expr
+            {  $$ =3D $1 / $3; }
+      |  expr '%' expr
+            {  $$ =3D $1 % $3; }
+      |  expr '&' expr
+            {  $$ =3D $1 & $3; }
+      |  expr '|' expr
+            {  $$ =3D $1 | $3; }
+      |  '-' expr %prec UMINUS
+            {  $$ =3D - $2; }
+      |  LETTER
+            {  $$ =3D regs[$1]; }
+      |  number
+      ;
+
+number:  DIGIT
+         {  $$ =3D $1; base =3D ($1=3D=3D0) ? 8 : 10; }
+      |  number DIGIT
+         {  $$ =3D base * $1 + $2; }
+      ;
+
+%% /* start of programs */
+
+int
+main (void)
+{
+    while(!feof(stdin)) {
+	yyparse();
+    }
+    return 0;
+}
+
+static void
+yyerror(const char *s)
+{
+    fprintf(stderr, "%s\n", s);
+}
+
+int
+yylex(void)
+{
+	/* lexical analysis routine */
+	/* returns LETTER for a lower case letter, yylval =3D 0 through 25 */
+	/* return DIGIT for a digit, yylval =3D 0 through 9 */
+	/* all other characters are returned immediately */
+
+    int c;
+
+    while( (c=3Dgetchar()) =3D=3D ' ' )   { /* skip blanks */ }
+
+    /* c is now nonblank */
+
+    if( islower( c )) {
+	yylval =3D c - 'a';
+	return ( LETTER );
+    }
+    if( isdigit( c )) {
+	yylval =3D c - '0';
+	return ( DIGIT );
+    }
+    return( c );
+}
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/test/calc1.output
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/test/calc1.output	Wed Jul 25 16:21:35 2012 +0300
@@ -0,0 +1,877 @@
+   0  $accept : line $end
+
+   1  lines :
+   2        | lines line
+
+   3  line : dexp '\n'
+   4       | vexp '\n'
+   5       | DREG '=3D' dexp '\n'
+   6       | VREG '=3D' vexp '\n'
+   7       | error '\n'
+
+   8  dexp : CONST
+   9       | DREG
+  10       | dexp '+' dexp
+  11       | dexp '-' dexp
+  12       | dexp '*' dexp
+  13       | dexp '/' dexp
+  14       | '-' dexp
+  15       | '(' dexp ')'
+
+  16  vexp : dexp
+  17       | '(' dexp ',' dexp ')'
+  18       | VREG
+  19       | vexp '+' vexp
+  20       | dexp '+' vexp
+  21       | vexp '-' vexp
+  22       | dexp '-' vexp
+  23       | vexp '*' vexp
+  24       | dexp '*' vexp
+  25       | vexp '/' vexp
+  26       | dexp '/' vexp
+  27       | '-' vexp
+  28       | '(' vexp ')'
+=0C
+state 0
+	$accept : . line $end  (0)
+
+	error  shift 1
+	DREG  shift 2
+	VREG  shift 3
+	CONST  shift 4
+	'-'  shift 5
+	'('  shift 6
+	.  error
+
+	line  goto 7
+	dexp  goto 8
+	vexp  goto 9
+
+
+state 1
+	line : error . '\n'  (7)
+
+	'\n'  shift 10
+	.  error
+
+
+state 2
+	line : DREG . '=3D' dexp '\n'  (5)
+	dexp : DREG .  (9)
+
+	'=3D'  shift 11
+	'+'  reduce 9
+	'-'  reduce 9
+	'*'  reduce 9
+	'/'  reduce 9
+	'\n'  reduce 9
+
+
+state 3
+	line : VREG . '=3D' vexp '\n'  (6)
+	vexp : VREG .  (18)
+
+	'=3D'  shift 12
+	'+'  reduce 18
+	'-'  reduce 18
+	'*'  reduce 18
+	'/'  reduce 18
+	'\n'  reduce 18
+
+
+state 4
+	dexp : CONST .  (8)
+
+	.  reduce 8
+
+
+state 5
+	dexp : '-' . dexp  (14)
+	vexp : '-' . vexp  (27)
+
+	DREG  shift 13
+	VREG  shift 14
+	CONST  shift 4
+	'-'  shift 5
+	'('  shift 6
+	.  error
+
+	dexp  goto 15
+	vexp  goto 16
+
+
+state 6
+	dexp : '(' . dexp ')'  (15)
+	vexp : '(' . dexp ',' dexp ')'  (17)
+	vexp : '(' . vexp ')'  (28)
+
+	DREG  shift 13
+	VREG  shift 14
+	CONST  shift 4
+	'-'  shift 5
+	'('  shift 6
+	.  error
+
+	dexp  goto 17
+	vexp  goto 18
+
+
+state 7
+	$accept : line . $end  (0)
+
+	$end  accept
+
+
+8: shift/reduce conflict (shift 19, reduce 16) on '+'
+8: shift/reduce conflict (shift 20, reduce 16) on '-'
+8: shift/reduce conflict (shift 21, reduce 16) on '*'
+8: shift/reduce conflict (shift 22, reduce 16) on '/'
+8: shift/reduce conflict (shift 23, reduce 16) on '\n'
+state 8
+	line : dexp . '\n'  (3)
+	dexp : dexp . '+' dexp  (10)
+	dexp : dexp . '-' dexp  (11)
+	dexp : dexp . '*' dexp  (12)
+	dexp : dexp . '/' dexp  (13)
+	vexp : dexp .  (16)
+	vexp : dexp . '+' vexp  (20)
+	vexp : dexp . '-' vexp  (22)
+	vexp : dexp . '*' vexp  (24)
+	vexp : dexp . '/' vexp  (26)
+
+	'+'  shift 19
+	'-'  shift 20
+	'*'  shift 21
+	'/'  shift 22
+	'\n'  shift 23
+
+
+state 9
+	line : vexp . '\n'  (4)
+	vexp : vexp . '+' vexp  (19)
+	vexp : vexp . '-' vexp  (21)
+	vexp : vexp . '*' vexp  (23)
+	vexp : vexp . '/' vexp  (25)
+
+	'+'  shift 24
+	'-'  shift 25
+	'*'  shift 26
+	'/'  shift 27
+	'\n'  shift 28
+	.  error
+
+
+state 10
+	line : error '\n' .  (7)
+
+	.  reduce 7
+
+
+state 11
+	line : DREG '=3D' . dexp '\n'  (5)
+
+	DREG  shift 13
+	CONST  shift 4
+	'-'  shift 29
+	'('  shift 30
+	.  error
+
+	dexp  goto 31
+
+
+state 12
+	line : VREG '=3D' . vexp '\n'  (6)
+
+	DREG  shift 13
+	VREG  shift 14
+	CONST  shift 4
+	'-'  shift 5
+	'('  shift 6
+	.  error
+
+	dexp  goto 32
+	vexp  goto 33
+
+
+state 13
+	dexp : DREG .  (9)
+
+	.  reduce 9
+
+
+state 14
+	vexp : VREG .  (18)
+
+	.  reduce 18
+
+
+15: reduce/reduce conflict (reduce 14, reduce 16) on '+'
+15: reduce/reduce conflict (reduce 14, reduce 16) on '-'
+15: reduce/reduce conflict (reduce 14, reduce 16) on '*'
+15: reduce/reduce conflict (reduce 14, reduce 16) on '/'
+15: reduce/reduce conflict (reduce 14, reduce 16) on '\n'
+15: reduce/reduce conflict (reduce 14, reduce 16) on ')'
+state 15
+	dexp : dexp . '+' dexp  (10)
+	dexp : dexp . '-' dexp  (11)
+	dexp : dexp . '*' dexp  (12)
+	dexp : dexp . '/' dexp  (13)
+	dexp : '-' dexp .  (14)
+	vexp : dexp .  (16)
+	vexp : dexp . '+' vexp  (20)
+	vexp : dexp . '-' vexp  (22)
+	vexp : dexp . '*' vexp  (24)
+	vexp : dexp . '/' vexp  (26)
+
+	.  reduce 14
+
+
+state 16
+	vexp : vexp . '+' vexp  (19)
+	vexp : vexp . '-' vexp  (21)
+	vexp : vexp . '*' vexp  (23)
+	vexp : vexp . '/' vexp  (25)
+	vexp : '-' vexp .  (27)
+
+	.  reduce 27
+
+
+17: shift/reduce conflict (shift 19, reduce 16) on '+'
+17: shift/reduce conflict (shift 20, reduce 16) on '-'
+17: shift/reduce conflict (shift 21, reduce 16) on '*'
+17: shift/reduce conflict (shift 22, reduce 16) on '/'
+17: shift/reduce conflict (shift 34, reduce 16) on ')'
+state 17
+	dexp : dexp . '+' dexp  (10)
+	dexp : dexp . '-' dexp  (11)
+	dexp : dexp . '*' dexp  (12)
+	dexp : dexp . '/' dexp  (13)
+	dexp : '(' dexp . ')'  (15)
+	vexp : dexp .  (16)
+	vexp : '(' dexp . ',' dexp ')'  (17)
+	vexp : dexp . '+' vexp  (20)
+	vexp : dexp . '-' vexp  (22)
+	vexp : dexp . '*' vexp  (24)
+	vexp : dexp . '/' vexp  (26)
+
+	'+'  shift 19
+	'-'  shift 20
+	'*'  shift 21
+	'/'  shift 22
+	')'  shift 34
+	','  shift 35
+
+
+state 18
+	vexp : vexp . '+' vexp  (19)
+	vexp : vexp . '-' vexp  (21)
+	vexp : vexp . '*' vexp  (23)
+	vexp : vexp . '/' vexp  (25)
+	vexp : '(' vexp . ')'  (28)
+
+	'+'  shift 24
+	'-'  shift 25
+	'*'  shift 26
+	'/'  shift 27
+	')'  shift 36
+	.  error
+
+
+state 19
+	dexp : dexp '+' . dexp  (10)
+	vexp : dexp '+' . vexp  (20)
+
+	DREG  shift 13
+	VREG  shift 14
+	CONST  shift 4
+	'-'  shift 5
+	'('  shift 6
+	.  error
+
+	dexp  goto 37
+	vexp  goto 38
+
+
+state 20
+	dexp : dexp '-' . dexp  (11)
+	vexp : dexp '-' . vexp  (22)
+
+	DREG  shift 13
+	VREG  shift 14
+	CONST  shift 4
+	'-'  shift 5
+	'('  shift 6
+	.  error
+
+	dexp  goto 39
+	vexp  goto 40
+
+
+state 21
+	dexp : dexp '*' . dexp  (12)
+	vexp : dexp '*' . vexp  (24)
+
+	DREG  shift 13
+	VREG  shift 14
+	CONST  shift 4
+	'-'  shift 5
+	'('  shift 6
+	.  error
+
+	dexp  goto 41
+	vexp  goto 42
+
+
+state 22
+	dexp : dexp '/' . dexp  (13)
+	vexp : dexp '/' . vexp  (26)
+
+	DREG  shift 13
+	VREG  shift 14
+	CONST  shift 4
+	'-'  shift 5
+	'('  shift 6
+	.  error
+
+	dexp  goto 43
+	vexp  goto 44
+
+
+state 23
+	line : dexp '\n' .  (3)
+
+	.  reduce 3
+
+
+state 24
+	vexp : vexp '+' . vexp  (19)
+
+	DREG  shift 13
+	VREG  shift 14
+	CONST  shift 4
+	'-'  shift 5
+	'('  shift 6
+	.  error
+
+	dexp  goto 32
+	vexp  goto 45
+
+
+state 25
+	vexp : vexp '-' . vexp  (21)
+
+	DREG  shift 13
+	VREG  shift 14
+	CONST  shift 4
+	'-'  shift 5
+	'('  shift 6
+	.  error
+
+	dexp  goto 32
+	vexp  goto 46
+
+
+state 26
+	vexp : vexp '*' . vexp  (23)
+
+	DREG  shift 13
+	VREG  shift 14
+	CONST  shift 4
+	'-'  shift 5
+	'('  shift 6
+	.  error
+
+	dexp  goto 32
+	vexp  goto 47
+
+
+state 27
+	vexp : vexp '/' . vexp  (25)
+
+	DREG  shift 13
+	VREG  shift 14
+	CONST  shift 4
+	'-'  shift 5
+	'('  shift 6
+	.  error
+
+	dexp  goto 32
+	vexp  goto 48
+
+
+state 28
+	line : vexp '\n' .  (4)
+
+	.  reduce 4
+
+
+state 29
+	dexp : '-' . dexp  (14)
+
+	DREG  shift 13
+	CONST  shift 4
+	'-'  shift 29
+	'('  shift 30
+	.  error
+
+	dexp  goto 49
+
+
+state 30
+	dexp : '(' . dexp ')'  (15)
+
+	DREG  shift 13
+	CONST  shift 4
+	'-'  shift 29
+	'('  shift 30
+	.  error
+
+	dexp  goto 50
+
+
+state 31
+	line : DREG '=3D' dexp . '\n'  (5)
+	dexp : dexp . '+' dexp  (10)
+	dexp : dexp . '-' dexp  (11)
+	dexp : dexp . '*' dexp  (12)
+	dexp : dexp . '/' dexp  (13)
+
+	'+'  shift 51
+	'-'  shift 52
+	'*'  shift 53
+	'/'  shift 54
+	'\n'  shift 55
+	.  error
+
+
+32: shift/reduce conflict (shift 19, reduce 16) on '+'
+32: shift/reduce conflict (shift 20, reduce 16) on '-'
+32: shift/reduce conflict (shift 21, reduce 16) on '*'
+32: shift/reduce conflict (shift 22, reduce 16) on '/'
+state 32
+	dexp : dexp . '+' dexp  (10)
+	dexp : dexp . '-' dexp  (11)
+	dexp : dexp . '*' dexp  (12)
+	dexp : dexp . '/' dexp  (13)
+	vexp : dexp .  (16)
+	vexp : dexp . '+' vexp  (20)
+	vexp : dexp . '-' vexp  (22)
+	vexp : dexp . '*' vexp  (24)
+	vexp : dexp . '/' vexp  (26)
+
+	'+'  shift 19
+	'-'  shift 20
+	'*'  shift 21
+	'/'  shift 22
+	'\n'  reduce 16
+	')'  reduce 16
+
+
+state 33
+	line : VREG '=3D' vexp . '\n'  (6)
+	vexp : vexp . '+' vexp  (19)
+	vexp : vexp . '-' vexp  (21)
+	vexp : vexp . '*' vexp  (23)
+	vexp : vexp . '/' vexp  (25)
+
+	'+'  shift 24
+	'-'  shift 25
+	'*'  shift 26
+	'/'  shift 27
+	'\n'  shift 56
+	.  error
+
+
+state 34
+	dexp : '(' dexp ')' .  (15)
+
+	.  reduce 15
+
+
+state 35
+	vexp : '(' dexp ',' . dexp ')'  (17)
+
+	DREG  shift 13
+	CONST  shift 4
+	'-'  shift 29
+	'('  shift 30
+	.  error
+
+	dexp  goto 57
+
+
+state 36
+	vexp : '(' vexp ')' .  (28)
+
+	.  reduce 28
+
+
+37: reduce/reduce conflict (reduce 10, reduce 16) on '+'
+37: reduce/reduce conflict (reduce 10, reduce 16) on '-'
+37: shift/reduce conflict (shift 21, reduce 16) on '*'
+37: shift/reduce conflict (shift 22, reduce 16) on '/'
+37: reduce/reduce conflict (reduce 10, reduce 16) on '\n'
+37: reduce/reduce conflict (reduce 10, reduce 16) on ')'
+state 37
+	dexp : dexp . '+' dexp  (10)
+	dexp : dexp '+' dexp .  (10)
+	dexp : dexp . '-' dexp  (11)
+	dexp : dexp . '*' dexp  (12)
+	dexp : dexp . '/' dexp  (13)
+	vexp : dexp .  (16)
+	vexp : dexp . '+' vexp  (20)
+	vexp : dexp . '-' vexp  (22)
+	vexp : dexp . '*' vexp  (24)
+	vexp : dexp . '/' vexp  (26)
+
+	'*'  shift 21
+	'/'  shift 22
+	'+'  reduce 10
+	'-'  reduce 10
+	'\n'  reduce 10
+	')'  reduce 10
+	','  reduce 10
+
+
+state 38
+	vexp : vexp . '+' vexp  (19)
+	vexp : dexp '+' vexp .  (20)
+	vexp : vexp . '-' vexp  (21)
+	vexp : vexp . '*' vexp  (23)
+	vexp : vexp . '/' vexp  (25)
+
+	'*'  shift 26
+	'/'  shift 27
+	'+'  reduce 20
+	'-'  reduce 20
+	'\n'  reduce 20
+	')'  reduce 20
+
+
+39: reduce/reduce conflict (reduce 11, reduce 16) on '+'
+39: reduce/reduce conflict (reduce 11, reduce 16) on '-'
+39: shift/reduce conflict (shift 21, reduce 16) on '*'
+39: shift/reduce conflict (shift 22, reduce 16) on '/'
+39: reduce/reduce conflict (reduce 11, reduce 16) on '\n'
+39: reduce/reduce conflict (reduce 11, reduce 16) on ')'
+state 39
+	dexp : dexp . '+' dexp  (10)
+	dexp : dexp . '-' dexp  (11)
+	dexp : dexp '-' dexp .  (11)
+	dexp : dexp . '*' dexp  (12)
+	dexp : dexp . '/' dexp  (13)
+	vexp : dexp .  (16)
+	vexp : dexp . '+' vexp  (20)
+	vexp : dexp . '-' vexp  (22)
+	vexp : dexp . '*' vexp  (24)
+	vexp : dexp . '/' vexp  (26)
+
+	'*'  shift 21
+	'/'  shift 22
+	'+'  reduce 11
+	'-'  reduce 11
+	'\n'  reduce 11
+	')'  reduce 11
+	','  reduce 11
+
+
+state 40
+	vexp : vexp . '+' vexp  (19)
+	vexp : vexp . '-' vexp  (21)
+	vexp : dexp '-' vexp .  (22)
+	vexp : vexp . '*' vexp  (23)
+	vexp : vexp . '/' vexp  (25)
+
+	'*'  shift 26
+	'/'  shift 27
+	'+'  reduce 22
+	'-'  reduce 22
+	'\n'  reduce 22
+	')'  reduce 22
+
+
+41: reduce/reduce conflict (reduce 12, reduce 16) on '+'
+41: reduce/reduce conflict (reduce 12, reduce 16) on '-'
+41: reduce/reduce conflict (reduce 12, reduce 16) on '*'
+41: reduce/reduce conflict (reduce 12, reduce 16) on '/'
+41: reduce/reduce conflict (reduce 12, reduce 16) on '\n'
+41: reduce/reduce conflict (reduce 12, reduce 16) on ')'
+state 41
+	dexp : dexp . '+' dexp  (10)
+	dexp : dexp . '-' dexp  (11)
+	dexp : dexp . '*' dexp  (12)
+	dexp : dexp '*' dexp .  (12)
+	dexp : dexp . '/' dexp  (13)
+	vexp : dexp .  (16)
+	vexp : dexp . '+' vexp  (20)
+	vexp : dexp . '-' vexp  (22)
+	vexp : dexp . '*' vexp  (24)
+	vexp : dexp . '/' vexp  (26)
+
+	.  reduce 12
+
+
+state 42
+	vexp : vexp . '+' vexp  (19)
+	vexp : vexp . '-' vexp  (21)
+	vexp : vexp . '*' vexp  (23)
+	vexp : dexp '*' vexp .  (24)
+	vexp : vexp . '/' vexp  (25)
+
+	.  reduce 24
+
+
+43: reduce/reduce conflict (reduce 13, reduce 16) on '+'
+43: reduce/reduce conflict (reduce 13, reduce 16) on '-'
+43: reduce/reduce conflict (reduce 13, reduce 16) on '*'
+43: reduce/reduce conflict (reduce 13, reduce 16) on '/'
+43: reduce/reduce conflict (reduce 13, reduce 16) on '\n'
+43: reduce/reduce conflict (reduce 13, reduce 16) on ')'
+state 43
+	dexp : dexp . '+' dexp  (10)
+	dexp : dexp . '-' dexp  (11)
+	dexp : dexp . '*' dexp  (12)
+	dexp : dexp . '/' dexp  (13)
+	dexp : dexp '/' dexp .  (13)
+	vexp : dexp .  (16)
+	vexp : dexp . '+' vexp  (20)
+	vexp : dexp . '-' vexp  (22)
+	vexp : dexp . '*' vexp  (24)
+	vexp : dexp . '/' vexp  (26)
+
+	.  reduce 13
+
+
+state 44
+	vexp : vexp . '+' vexp  (19)
+	vexp : vexp . '-' vexp  (21)
+	vexp : vexp . '*' vexp  (23)
+	vexp : vexp . '/' vexp  (25)
+	vexp : dexp '/' vexp .  (26)
+
+	.  reduce 26
+
+
+state 45
+	vexp : vexp . '+' vexp  (19)
+	vexp : vexp '+' vexp .  (19)
+	vexp : vexp . '-' vexp  (21)
+	vexp : vexp . '*' vexp  (23)
+	vexp : vexp . '/' vexp  (25)
+
+	'*'  shift 26
+	'/'  shift 27
+	'+'  reduce 19
+	'-'  reduce 19
+	'\n'  reduce 19
+	')'  reduce 19
+
+
+state 46
+	vexp : vexp . '+' vexp  (19)
+	vexp : vexp . '-' vexp  (21)
+	vexp : vexp '-' vexp .  (21)
+	vexp : vexp . '*' vexp  (23)
+	vexp : vexp . '/' vexp  (25)
+
+	'*'  shift 26
+	'/'  shift 27
+	'+'  reduce 21
+	'-'  reduce 21
+	'\n'  reduce 21
+	')'  reduce 21
+
+
+state 47
+	vexp : vexp . '+' vexp  (19)
+	vexp : vexp . '-' vexp  (21)
+	vexp : vexp . '*' vexp  (23)
+	vexp : vexp '*' vexp .  (23)
+	vexp : vexp . '/' vexp  (25)
+
+	.  reduce 23
+
+
+state 48
+	vexp : vexp . '+' vexp  (19)
+	vexp : vexp . '-' vexp  (21)
+	vexp : vexp . '*' vexp  (23)
+	vexp : vexp . '/' vexp  (25)
+	vexp : vexp '/' vexp .  (25)
+
+	.  reduce 25
+
+
+state 49
+	dexp : dexp . '+' dexp  (10)
+	dexp : dexp . '-' dexp  (11)
+	dexp : dexp . '*' dexp  (12)
+	dexp : dexp . '/' dexp  (13)
+	dexp : '-' dexp .  (14)
+
+	.  reduce 14
+
+
+state 50
+	dexp : dexp . '+' dexp  (10)
+	dexp : dexp . '-' dexp  (11)
+	dexp : dexp . '*' dexp  (12)
+	dexp : dexp . '/' dexp  (13)
+	dexp : '(' dexp . ')'  (15)
+
+	'+'  shift 51
+	'-'  shift 52
+	'*'  shift 53
+	'/'  shift 54
+	')'  shift 34
+	.  error
+
+
+state 51
+	dexp : dexp '+' . dexp  (10)
+
+	DREG  shift 13
+	CONST  shift 4
+	'-'  shift 29
+	'('  shift 30
+	.  error
+
+	dexp  goto 58
+
+
+state 52
+	dexp : dexp '-' . dexp  (11)
+
+	DREG  shift 13
+	CONST  shift 4
+	'-'  shift 29
+	'('  shift 30
+	.  error
+
+	dexp  goto 59
+
+
+state 53
+	dexp : dexp '*' . dexp  (12)
+
+	DREG  shift 13
+	CONST  shift 4
+	'-'  shift 29
+	'('  shift 30
+	.  error
+
+	dexp  goto 60
+
+
+state 54
+	dexp : dexp '/' . dexp  (13)
+
+	DREG  shift 13
+	CONST  shift 4
+	'-'  shift 29
+	'('  shift 30
+	.  error
+
+	dexp  goto 61
+
+
+state 55
+	line : DREG '=3D' dexp '\n' .  (5)
+
+	.  reduce 5
+
+
+state 56
+	line : VREG '=3D' vexp '\n' .  (6)
+
+	.  reduce 6
+
+
+state 57
+	dexp : dexp . '+' dexp  (10)
+	dexp : dexp . '-' dexp  (11)
+	dexp : dexp . '*' dexp  (12)
+	dexp : dexp . '/' dexp  (13)
+	vexp : '(' dexp ',' dexp . ')'  (17)
+
+	'+'  shift 51
+	'-'  shift 52
+	'*'  shift 53
+	'/'  shift 54
+	')'  shift 62
+	.  error
+
+
+state 58
+	dexp : dexp . '+' dexp  (10)
+	dexp : dexp '+' dexp .  (10)
+	dexp : dexp . '-' dexp  (11)
+	dexp : dexp . '*' dexp  (12)
+	dexp : dexp . '/' dexp  (13)
+
+	'*'  shift 53
+	'/'  shift 54
+	'+'  reduce 10
+	'-'  reduce 10
+	'\n'  reduce 10
+	')'  reduce 10
+
+
+state 59
+	dexp : dexp . '+' dexp  (10)
+	dexp : dexp . '-' dexp  (11)
+	dexp : dexp '-' dexp .  (11)
+	dexp : dexp . '*' dexp  (12)
+	dexp : dexp . '/' dexp  (13)
+
+	'*'  shift 53
+	'/'  shift 54
+	'+'  reduce 11
+	'-'  reduce 11
+	'\n'  reduce 11
+	')'  reduce 11
+
+
+state 60
+	dexp : dexp . '+' dexp  (10)
+	dexp : dexp . '-' dexp  (11)
+	dexp : dexp . '*' dexp  (12)
+	dexp : dexp '*' dexp .  (12)
+	dexp : dexp . '/' dexp  (13)
+
+	.  reduce 12
+
+
+state 61
+	dexp : dexp . '+' dexp  (10)
+	dexp : dexp . '-' dexp  (11)
+	dexp : dexp . '*' dexp  (12)
+	dexp : dexp . '/' dexp  (13)
+	dexp : dexp '/' dexp .  (13)
+
+	.  reduce 13
+
+
+state 62
+	vexp : '(' dexp ',' dexp ')' .  (17)
+
+	.  reduce 17
+
+
+Rules never reduced:
+	lines :  (1)
+	lines : lines line  (2)
+
+
+State 8 contains 5 shift/reduce conflicts.
+State 15 contains 6 reduce/reduce conflicts.
+State 17 contains 5 shift/reduce conflicts.
+State 32 contains 4 shift/reduce conflicts.
+State 37 contains 2 shift/reduce conflicts, 4 reduce/reduce conflicts.
+State 39 contains 2 shift/reduce conflicts, 4 reduce/reduce conflicts.
+State 41 contains 6 reduce/reduce conflicts.
+State 43 contains 6 reduce/reduce conflicts.
+
+
+15 terminals, 5 nonterminals
+29 grammar rules, 63 states
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/test/calc1.tab.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/test/calc1.tab.c	Wed Jul 25 16:21:35 2012 +0300
@@ -0,0 +1,915 @@
+#ifndef lint
+static const char yysccsid[] =3D "@(#)yaccpar	1.9 (Berkeley) 02/21/93";
+#endif
+
+#define YYBYACC 1
+#define YYMAJOR 1
+#define YYMINOR 9
+
+#define YYEMPTY        (-1)
+#define yyclearin      (yychar =3D YYEMPTY)
+#define yyerrok        (yyerrflag =3D 0)
+#define YYRECOVERING() (yyerrflag !=3D 0)
+
+
+#ifndef yyparse
+#define yyparse    calc1_parse
+#endif /* yyparse */
+
+#ifndef yylex
+#define yylex      calc1_lex
+#endif /* yylex */
+
+#ifndef yyerror
+#define yyerror    calc1_error
+#endif /* yyerror */
+
+#ifndef yychar
+#define yychar     calc1_char
+#endif /* yychar */
+
+#ifndef yyval
+#define yyval      calc1_val
+#endif /* yyval */
+
+#ifndef yylval
+#define yylval     calc1_lval
+#endif /* yylval */
+
+#ifndef yydebug
+#define yydebug    calc1_debug
+#endif /* yydebug */
+
+#ifndef yynerrs
+#define yynerrs    calc1_nerrs
+#endif /* yynerrs */
+
+#ifndef yyerrflag
+#define yyerrflag  calc1_errflag
+#endif /* yyerrflag */
+
+#ifndef yylhs
+#define yylhs      calc1_lhs
+#endif /* yylhs */
+
+#ifndef yylen
+#define yylen      calc1_len
+#endif /* yylen */
+
+#ifndef yydefred
+#define yydefred   calc1_defred
+#endif /* yydefred */
+
+#ifndef yydgoto
+#define yydgoto    calc1_dgoto
+#endif /* yydgoto */
+
+#ifndef yysindex
+#define yysindex   calc1_sindex
+#endif /* yysindex */
+
+#ifndef yyrindex
+#define yyrindex   calc1_rindex
+#endif /* yyrindex */
+
+#ifndef yygindex
+#define yygindex   calc1_gindex
+#endif /* yygindex */
+
+#ifndef yytable
+#define yytable    calc1_table
+#endif /* yytable */
+
+#ifndef yycheck
+#define yycheck    calc1_check
+#endif /* yycheck */
+
+#ifndef yyname
+#define yyname     calc1_name
+#endif /* yyname */
+
+#ifndef yyrule
+#define yyrule     calc1_rule
+#endif /* yyrule */
+#define YYPREFIX "calc1_"
+
+#define YYPURE 0
+
+#line 2 "calc1.y"
+
+/* http://dinosaur.compilertools.net/yacc/index.html */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <ctype.h>
+#include <math.h>
+
+typedef struct interval
+{
+    double lo, hi;
+}
+INTERVAL;
+
+INTERVAL vmul(double, double, INTERVAL);
+INTERVAL vdiv(double, double, INTERVAL);
+
+extern int yylex(void);
+static void yyerror(const char *s);
+
+int dcheck(INTERVAL);
+
+double dreg[26];
+INTERVAL vreg[26];
+
+#line 31 "calc1.y"
+#ifdef YYSTYPE
+#undef  YYSTYPE_IS_DECLARED
+#define YYSTYPE_IS_DECLARED 1
+#endif
+#ifndef YYSTYPE_IS_DECLARED
+#define YYSTYPE_IS_DECLARED 1
+typedef union
+{
+	int ival;
+	double dval;
+	INTERVAL vval;
+} YYSTYPE;
+#endif /* !YYSTYPE_IS_DECLARED */
+#line 139 "calc1.tab.c"
+
+/* compatibility with bison */
+#ifdef YYPARSE_PARAM
+/* compatibility with FreeBSD */
+# ifdef YYPARSE_PARAM_TYPE
+#  define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM)
+# else
+#  define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM)
+# endif
+#else
+# define YYPARSE_DECL() yyparse(void)
+#endif
+
+/* Parameters sent to lex. */
+#ifdef YYLEX_PARAM
+# define YYLEX_DECL() yylex(void *YYLEX_PARAM)
+# define YYLEX yylex(YYLEX_PARAM)
+#else
+# define YYLEX_DECL() yylex(void)
+# define YYLEX yylex()
+#endif
+
+/* Parameters sent to yyerror. */
+#ifndef YYERROR_DECL
+#define YYERROR_DECL() yyerror(const char *s)
+#endif
+#ifndef YYERROR_CALL
+#define YYERROR_CALL(msg) yyerror(msg)
+#endif
+
+extern int YYPARSE_DECL();
+
+#define DREG 257
+#define VREG 258
+#define CONST 259
+#define UMINUS 260
+#define YYERRCODE 256
+static const short calc1_lhs[] =3D {                       -1,
+    3,    3,    0,    0,    0,    0,    0,    1,    1,    1,
+    1,    1,    1,    1,    1,    2,    2,    2,    2,    2,
+    2,    2,    2,    2,    2,    2,    2,    2,
+};
+static const short calc1_len[] =3D {                        2,
+    0,    2,    2,    2,    4,    4,    2,    1,    1,    3,
+    3,    3,    3,    2,    3,    1,    5,    1,    3,    3,
+    3,    3,    3,    3,    3,    3,    2,    3,
+};
+static const short calc1_defred[] =3D {                     0,
+    0,    0,    0,    8,    0,    0,    0,    0,    0,    7,
+    0,    0,    9,   18,   14,   27,    0,    0,    0,    0,
+    0,    0,    3,    0,    0,    0,    0,    4,    0,    0,
+    0,    0,    0,   15,    0,   28,    0,    0,    0,    0,
+   12,   24,   13,   26,    0,    0,   23,   25,   14,    0,
+    0,    0,    0,    0,    5,    6,    0,    0,    0,   12,
+   13,   17,
+};
+static const short calc1_dgoto[] =3D {                      7,
+   32,    9,    0,
+};
+static const short calc1_sindex[] =3D {                   -40,
+   -8,  -48,  -47,    0,  -37,  -37,    0,    2,   17,    0,
+  -34,  -37,    0,    0,    0,    0,  -25,   90,  -37,  -37,
+  -37,  -37,    0,  -37,  -37,  -37,  -37,    0,  -34,  -34,
+   25,  125,   31,    0,  -34,    0,  -11,   37,  -11,   37,
+    0,    0,    0,    0,   37,   37,    0,    0,    0,  111,
+  -34,  -34,  -34,  -34,    0,    0,  118,   69,   69,    0,
+    0,    0,
+};
+static const short calc1_rindex[] =3D {                     0,
+    0,   38,   44,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,   -9,    0,    0,    0,    0,   51,   -3,   56,   61,
+    0,    0,    0,    0,   67,   72,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,   78,   83,    0,
+    0,    0,
+};
+static const short calc1_gindex[] =3D {                     0,
+    4,  124,    0,
+};
+#define YYTABLESIZE 225
+static const short calc1_table[] =3D {                      6,
+   16,   10,    6,    8,    5,   30,   20,    5,   15,   17,
+   29,   23,   11,   12,   31,   34,   21,   19,   35,   20,
+    0,   22,   37,   39,   41,   43,   28,    0,    0,    0,
+   21,   16,   49,   50,   55,   22,    0,   20,   57,   20,
+   56,   20,    0,   21,   19,    0,   20,    9,   22,    0,
+    0,    0,    0,   18,   58,   59,   60,   61,   26,   24,
+   10,   25,    0,   27,    0,   11,   53,   51,    0,   52,
+   22,   54,   26,   24,    0,   25,   19,   27,   26,    9,
+    9,   21,    9,   27,    9,   18,   18,   10,   18,    0,
+   18,   10,   11,   10,   10,   10,   11,    0,   11,   11,
+   11,   22,    0,   22,    0,   22,    0,   19,    0,   19,
+   53,   19,   21,    0,   21,   54,   21,    0,   10,    0,
+   10,    0,   10,   11,    0,   11,    0,   11,   16,   18,
+   36,   26,   24,    0,   25,   33,   27,    0,    0,    0,
+    0,    0,   38,   40,   42,   44,    0,   45,   46,   47,
+   48,   34,   53,   51,    0,   52,    0,   54,   62,   53,
+   51,    0,   52,    0,   54,    0,   21,   19,    0,   20,
+    0,   22,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    1,    2,    3,    4,   13,
+   14,    4,   13,    0,    4,
+};
+static const short calc1_check[] =3D {                     40,
+   10,   10,   40,    0,   45,   40,   10,   45,    5,    6,
+   45,   10,   61,   61,   11,   41,   42,   43,   44,   45,
+   -1,   47,   19,   20,   21,   22,   10,   -1,   -1,   -1,
+   42,   41,   29,   30,   10,   47,   -1,   41,   35,   43,
+   10,   45,   -1,   42,   43,   -1,   45,   10,   47,   -1,
+   -1,   -1,   -1,   10,   51,   52,   53,   54,   42,   43,
+   10,   45,   -1,   47,   -1,   10,   42,   43,   -1,   45,
+   10,   47,   42,   43,   -1,   45,   10,   47,   42,   42,
+   43,   10,   45,   47,   47,   42,   43,   10,   45,   -1,
+   47,   41,   10,   43,   44,   45,   41,   -1,   43,   44,
+   45,   41,   -1,   43,   -1,   45,   -1,   41,   -1,   43,
+   42,   45,   41,   -1,   43,   47,   45,   -1,   41,   -1,
+   43,   -1,   45,   41,   -1,   43,   -1,   45,    5,    6,
+   41,   42,   43,   -1,   45,   12,   47,   -1,   -1,   -1,
+   -1,   -1,   19,   20,   21,   22,   -1,   24,   25,   26,
+   27,   41,   42,   43,   -1,   45,   -1,   47,   41,   42,
+   43,   -1,   45,   -1,   47,   -1,   42,   43,   -1,   45,
+   -1,   47,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,  256,  257,  258,  259,  257,
+  258,  259,  257,   -1,  259,
+};
+#define YYFINAL 7
+#ifndef YYDEBUG
+#define YYDEBUG 0
+#endif
+#define YYMAXTOKEN 260
+#if YYDEBUG
+static const char *yyname[] =3D {
+
+"end-of-file",0,0,0,0,0,0,0,0,0,"'\\n'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,=
0,0,0,
+0,0,0,0,0,0,0,0,0,"'('","')'","'*'","'+'","','","'-'",0,"'/'",0,0,0,0,0,0,=
0,0,0,
+0,0,0,0,"'=3D'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,=
0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,=
0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,=
0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,=
0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,=
0,0,0,
+0,0,"DREG","VREG","CONST","UMINUS",
+};
+static const char *yyrule[] =3D {
+"$accept : line",
+"lines :",
+"lines : lines line",
+"line : dexp '\\n'",
+"line : vexp '\\n'",
+"line : DREG '=3D' dexp '\\n'",
+"line : VREG '=3D' vexp '\\n'",
+"line : error '\\n'",
+"dexp : CONST",
+"dexp : DREG",
+"dexp : dexp '+' dexp",
+"dexp : dexp '-' dexp",
+"dexp : dexp '*' dexp",
+"dexp : dexp '/' dexp",
+"dexp : '-' dexp",
+"dexp : '(' dexp ')'",
+"vexp : dexp",
+"vexp : '(' dexp ',' dexp ')'",
+"vexp : VREG",
+"vexp : vexp '+' vexp",
+"vexp : dexp '+' vexp",
+"vexp : vexp '-' vexp",
+"vexp : dexp '-' vexp",
+"vexp : vexp '*' vexp",
+"vexp : dexp '*' vexp",
+"vexp : vexp '/' vexp",
+"vexp : dexp '/' vexp",
+"vexp : '-' vexp",
+"vexp : '(' vexp ')'",
+
+};
+#endif
+
+int      yydebug;
+int      yynerrs;
+
+int      yyerrflag;
+int      yychar;
+YYSTYPE  yyval;
+YYSTYPE  yylval;
+
+/* define the initial stack-sizes */
+#ifdef YYSTACKSIZE
+#undef YYMAXDEPTH
+#define YYMAXDEPTH  YYSTACKSIZE
+#else
+#ifdef YYMAXDEPTH
+#define YYSTACKSIZE YYMAXDEPTH
+#else
+#define YYSTACKSIZE 500
+#define YYMAXDEPTH  500
+#endif
+#endif
+
+#define YYINITSTACKSIZE 500
+
+typedef struct {
+    unsigned stacksize;
+    short    *s_base;
+    short    *s_mark;
+    short    *s_last;
+    YYSTYPE  *l_base;
+    YYSTYPE  *l_mark;
+} YYSTACKDATA;
+/* variables for the parser stack */
+static YYSTACKDATA yystack;
+#line 176 "calc1.y"
+	/* beginning of subroutines section */
+
+#define BSZ 50			/* buffer size for floating point numbers */
+
+	/* lexical analysis */
+
+static void
+yyerror(const char *s)
+{
+    fprintf(stderr, "%s\n", s);
+}
+
+int
+yylex(void)
+{
+    int c;
+
+    while ((c =3D getchar()) =3D=3D ' ')
+    {				/* skip over blanks */
+    }
+
+    if (isupper(c))
+    {
+	yylval.ival =3D c - 'A';
+	return (VREG);
+    }
+    if (islower(c))
+    {
+	yylval.ival =3D c - 'a';
+	return (DREG);
+    }
+
+    if (isdigit(c) || c =3D=3D '.')
+    {
+	/* gobble up digits, points, exponents */
+	char buf[BSZ + 1], *cp =3D buf;
+	int dot =3D 0, expr =3D 0;
+
+	for (; (cp - buf) < BSZ; ++cp, c =3D getchar())
+	{
+
+	    *cp =3D c;
+	    if (isdigit(c))
+		continue;
+	    if (c =3D=3D '.')
+	    {
+		if (dot++ || expr)
+		    return ('.');	/* will cause syntax error */
+		continue;
+	    }
+
+	    if (c =3D=3D 'e')
+	    {
+		if (expr++)
+		    return ('e');	/*  will  cause  syntax  error  */
+		continue;
+	    }
+
+	    /*  end  of  number  */
+	    break;
+	}
+	*cp =3D '\0';
+
+	if ((cp - buf) >=3D BSZ)
+	    printf("constant  too  long:  truncated\n");
+	else
+	    ungetc(c, stdin);	/*  push  back  last  char  read  */
+	yylval.dval =3D atof(buf);
+	return (CONST);
+    }
+    return (c);
+}
+
+static INTERVAL
+hilo(double a, double b, double c, double d)
+{
+    /*  returns  the  smallest  interval  containing  a,  b,  c,  and  d  =
*/
+    /*  used  by  *,  /  routines  */
+    INTERVAL v;
+
+    if (a > b)
+    {
+	v.hi =3D a;
+	v.lo =3D b;
+    }
+    else
+    {
+	v.hi =3D b;
+	v.lo =3D a;
+    }
+
+    if (c > d)
+    {
+	if (c > v.hi)
+	    v.hi =3D c;
+	if (d < v.lo)
+	    v.lo =3D d;
+    }
+    else
+    {
+	if (d > v.hi)
+	    v.hi =3D d;
+	if (c < v.lo)
+	    v.lo =3D c;
+    }
+    return (v);
+}
+
+INTERVAL
+vmul(double a, double b, INTERVAL v)
+{
+    return (hilo(a * v.hi, a * v.lo, b * v.hi, b * v.lo));
+}
+
+int
+dcheck(INTERVAL v)
+{
+    if (v.hi >=3D 0. && v.lo <=3D 0.)
+    {
+	printf("divisor  interval  contains  0.\n");
+	return (1);
+    }
+    return (0);
+}
+
+INTERVAL
+vdiv(double a, double b, INTERVAL v)
+{
+    return (hilo(a / v.hi, a / v.lo, b / v.hi, b / v.lo));
+}
+#line 486 "calc1.tab.c"
+
+#if YYDEBUG
+#include <stdio.h>		/* needed for printf */
+#endif
+
+#include <stdlib.h>	/* needed for malloc, etc */
+#include <string.h>	/* needed for memset */
+
+/* allocate initial stack or double stack size, up to YYMAXDEPTH */
+static int yygrowstack(YYSTACKDATA *data)
+{
+    int i;
+    unsigned newsize;
+    short *newss;
+    YYSTYPE *newvs;
+
+    if ((newsize =3D data->stacksize) =3D=3D 0)
+        newsize =3D YYINITSTACKSIZE;
+    else if (newsize >=3D YYMAXDEPTH)
+        return -1;
+    else if ((newsize *=3D 2) > YYMAXDEPTH)
+        newsize =3D YYMAXDEPTH;
+
+    i =3D data->s_mark - data->s_base;
+    newss =3D (short *)realloc(data->s_base, newsize * sizeof(*newss));
+    if (newss =3D=3D 0)
+        return -1;
+
+    data->s_base =3D newss;
+    data->s_mark =3D newss + i;
+
+    newvs =3D (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));
+    if (newvs =3D=3D 0)
+        return -1;
+
+    data->l_base =3D newvs;
+    data->l_mark =3D newvs + i;
+
+    data->stacksize =3D newsize;
+    data->s_last =3D data->s_base + newsize - 1;
+    return 0;
+}
+
+#if YYPURE || defined(YY_NO_LEAKS)
+static void yyfreestack(YYSTACKDATA *data)
+{
+    free(data->s_base);
+    free(data->l_base);
+    memset(data, 0, sizeof(*data));
+}
+#else
+#define yyfreestack(data) /* nothing */
+#endif
+
+#define YYABORT  goto yyabort
+#define YYREJECT goto yyabort
+#define YYACCEPT goto yyaccept
+#define YYERROR  goto yyerrlab
+
+int
+YYPARSE_DECL()
+{
+    int yym, yyn, yystate;
+#if YYDEBUG
+    const char *yys;
+
+    if ((yys =3D getenv("YYDEBUG")) !=3D 0)
+    {
+        yyn =3D *yys;
+        if (yyn >=3D '0' && yyn <=3D '9')
+            yydebug =3D yyn - '0';
+    }
+#endif
+
+    yynerrs =3D 0;
+    yyerrflag =3D 0;
+    yychar =3D YYEMPTY;
+    yystate =3D 0;
+
+#if YYPURE
+    memset(&yystack, 0, sizeof(yystack));
+#endif
+
+    if (yystack.s_base =3D=3D NULL && yygrowstack(&yystack)) goto yyoverfl=
ow;
+    yystack.s_mark =3D yystack.s_base;
+    yystack.l_mark =3D yystack.l_base;
+    yystate =3D 0;
+    *yystack.s_mark =3D 0;
+
+yyloop:
+    if ((yyn =3D yydefred[yystate]) !=3D 0) goto yyreduce;
+    if (yychar < 0)
+    {
+        if ((yychar =3D YYLEX) < 0) yychar =3D 0;
+#if YYDEBUG
+        if (yydebug)
+        {
+            yys =3D 0;
+            if (yychar <=3D YYMAXTOKEN) yys =3D yyname[yychar];
+            if (!yys) yys =3D "illegal-symbol";
+            printf("%sdebug: state %d, reading %d (%s)\n",
+                    YYPREFIX, yystate, yychar, yys);
+        }
+#endif
+    }
+    if ((yyn =3D yysindex[yystate]) && (yyn +=3D yychar) >=3D 0 &&
+            yyn <=3D YYTABLESIZE && yycheck[yyn] =3D=3D yychar)
+    {
+#if YYDEBUG
+        if (yydebug)
+            printf("%sdebug: state %d, shifting to state %d\n",
+                    YYPREFIX, yystate, yytable[yyn]);
+#endif
+        if (yystack.s_mark >=3D yystack.s_last && yygrowstack(&yystack))
+        {
+            goto yyoverflow;
+        }
+        yystate =3D yytable[yyn];
+        *++yystack.s_mark =3D yytable[yyn];
+        *++yystack.l_mark =3D yylval;
+        yychar =3D YYEMPTY;
+        if (yyerrflag > 0)  --yyerrflag;
+        goto yyloop;
+    }
+    if ((yyn =3D yyrindex[yystate]) && (yyn +=3D yychar) >=3D 0 &&
+            yyn <=3D YYTABLESIZE && yycheck[yyn] =3D=3D yychar)
+    {
+        yyn =3D yytable[yyn];
+        goto yyreduce;
+    }
+    if (yyerrflag) goto yyinrecovery;
+
+    yyerror("syntax error");
+
+    goto yyerrlab;
+
+yyerrlab:
+    ++yynerrs;
+
+yyinrecovery:
+    if (yyerrflag < 3)
+    {
+        yyerrflag =3D 3;
+        for (;;)
+        {
+            if ((yyn =3D yysindex[*yystack.s_mark]) && (yyn +=3D YYERRCODE=
) >=3D 0 &&
+                    yyn <=3D YYTABLESIZE && yycheck[yyn] =3D=3D YYERRCODE)
+            {
+#if YYDEBUG
+                if (yydebug)
+                    printf("%sdebug: state %d, error recovery shifting\
+ to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]);
+#endif
+                if (yystack.s_mark >=3D yystack.s_last && yygrowstack(&yys=
tack))
+                {
+                    goto yyoverflow;
+                }
+                yystate =3D yytable[yyn];
+                *++yystack.s_mark =3D yytable[yyn];
+                *++yystack.l_mark =3D yylval;
+                goto yyloop;
+            }
+            else
+            {
+#if YYDEBUG
+                if (yydebug)
+                    printf("%sdebug: error recovery discarding state %d\n",
+                            YYPREFIX, *yystack.s_mark);
+#endif
+                if (yystack.s_mark <=3D yystack.s_base) goto yyabort;
+                --yystack.s_mark;
+                --yystack.l_mark;
+            }
+        }
+    }
+    else
+    {
+        if (yychar =3D=3D 0) goto yyabort;
+#if YYDEBUG
+        if (yydebug)
+        {
+            yys =3D 0;
+            if (yychar <=3D YYMAXTOKEN) yys =3D yyname[yychar];
+            if (!yys) yys =3D "illegal-symbol";
+            printf("%sdebug: state %d, error recovery discards token %d (%=
s)\n",
+                    YYPREFIX, yystate, yychar, yys);
+        }
+#endif
+        yychar =3D YYEMPTY;
+        goto yyloop;
+    }
+
+yyreduce:
+#if YYDEBUG
+    if (yydebug)
+        printf("%sdebug: state %d, reducing by rule %d (%s)\n",
+                YYPREFIX, yystate, yyn, yyrule[yyn]);
+#endif
+    yym =3D yylen[yyn];
+    if (yym)
+        yyval =3D yystack.l_mark[1-yym];
+    else
+        memset(&yyval, 0, sizeof yyval);
+    switch (yyn)
+    {
+case 3:
+#line 57 "calc1.y"
+	{
+		(void) printf("%15.8f\n", yystack.l_mark[-1].dval);
+	}
+break;
+case 4:
+#line 61 "calc1.y"
+	{
+		(void) printf("(%15.8f, %15.8f)\n", yystack.l_mark[-1].vval.lo, yystack.=
l_mark[-1].vval.hi);
+	}
+break;
+case 5:
+#line 65 "calc1.y"
+	{
+		dreg[yystack.l_mark[-3].ival] =3D yystack.l_mark[-1].dval;
+	}
+break;
+case 6:
+#line 69 "calc1.y"
+	{
+		vreg[yystack.l_mark[-3].ival] =3D yystack.l_mark[-1].vval;
+	}
+break;
+case 7:
+#line 73 "calc1.y"
+	{
+		yyerrok;
+	}
+break;
+case 9:
+#line 80 "calc1.y"
+	{
+		yyval.dval =3D dreg[yystack.l_mark[0].ival];
+	}
+break;
+case 10:
+#line 84 "calc1.y"
+	{
+		yyval.dval =3D yystack.l_mark[-2].dval + yystack.l_mark[0].dval;
+	}
+break;
+case 11:
+#line 88 "calc1.y"
+	{
+		yyval.dval =3D yystack.l_mark[-2].dval - yystack.l_mark[0].dval;
+	}
+break;
+case 12:
+#line 92 "calc1.y"
+	{
+		yyval.dval =3D yystack.l_mark[-2].dval * yystack.l_mark[0].dval;
+	}
+break;
+case 13:
+#line 96 "calc1.y"
+	{
+		yyval.dval =3D yystack.l_mark[-2].dval / yystack.l_mark[0].dval;
+	}
+break;
+case 14:
+#line 100 "calc1.y"
+	{
+		yyval.dval =3D -yystack.l_mark[0].dval;
+	}
+break;
+case 15:
+#line 104 "calc1.y"
+	{
+		yyval.dval =3D yystack.l_mark[-1].dval;
+	}
+break;
+case 16:
+#line 110 "calc1.y"
+	{
+		yyval.vval.hi =3D yyval.vval.lo =3D yystack.l_mark[0].dval;
+	}
+break;
+case 17:
+#line 114 "calc1.y"
+	{
+		yyval.vval.lo =3D yystack.l_mark[-3].dval;
+		yyval.vval.hi =3D yystack.l_mark[-1].dval;
+		if ( yyval.vval.lo > yyval.vval.hi )=20
+		{
+			(void) printf("interval out of order\n");
+			YYERROR;
+		}
+	}
+break;
+case 18:
+#line 124 "calc1.y"
+	{
+		yyval.vval =3D vreg[yystack.l_mark[0].ival];
+	}
+break;
+case 19:
+#line 128 "calc1.y"
+	{
+		yyval.vval.hi =3D yystack.l_mark[-2].vval.hi + yystack.l_mark[0].vval.hi;
+		yyval.vval.lo =3D yystack.l_mark[-2].vval.lo + yystack.l_mark[0].vval.lo;
+	}
+break;
+case 20:
+#line 133 "calc1.y"
+	{
+		yyval.vval.hi =3D yystack.l_mark[-2].dval + yystack.l_mark[0].vval.hi;
+		yyval.vval.lo =3D yystack.l_mark[-2].dval + yystack.l_mark[0].vval.lo;
+	}
+break;
+case 21:
+#line 138 "calc1.y"
+	{
+		yyval.vval.hi =3D yystack.l_mark[-2].vval.hi - yystack.l_mark[0].vval.lo;
+		yyval.vval.lo =3D yystack.l_mark[-2].vval.lo - yystack.l_mark[0].vval.hi;
+	}
+break;
+case 22:
+#line 143 "calc1.y"
+	{
+		yyval.vval.hi =3D yystack.l_mark[-2].dval - yystack.l_mark[0].vval.lo;
+		yyval.vval.lo =3D yystack.l_mark[-2].dval - yystack.l_mark[0].vval.hi;
+	}
+break;
+case 23:
+#line 148 "calc1.y"
+	{
+		yyval.vval =3D vmul( yystack.l_mark[-2].vval.lo, yystack.l_mark[-2].vval=
.hi, yystack.l_mark[0].vval );
+	}
+break;
+case 24:
+#line 152 "calc1.y"
+	{
+		yyval.vval =3D vmul (yystack.l_mark[-2].dval, yystack.l_mark[-2].dval, y=
ystack.l_mark[0].vval );
+	}
+break;
+case 25:
+#line 156 "calc1.y"
+	{
+		if (dcheck(yystack.l_mark[0].vval)) YYERROR;
+		yyval.vval =3D vdiv ( yystack.l_mark[-2].vval.lo, yystack.l_mark[-2].vva=
l.hi, yystack.l_mark[0].vval );
+	}
+break;
+case 26:
+#line 161 "calc1.y"
+	{
+		if (dcheck ( yystack.l_mark[0].vval )) YYERROR;
+		yyval.vval =3D vdiv (yystack.l_mark[-2].dval, yystack.l_mark[-2].dval, y=
ystack.l_mark[0].vval );
+	}
+break;
+case 27:
+#line 166 "calc1.y"
+	{
+		yyval.vval.hi =3D -yystack.l_mark[0].vval.lo;
+		yyval.vval.lo =3D -yystack.l_mark[0].vval.hi;
+	}
+break;
+case 28:
+#line 171 "calc1.y"
+	{
+		yyval.vval =3D yystack.l_mark[-1].vval;
+	}
+break;
+#line 855 "calc1.tab.c"
+    }
+    yystack.s_mark -=3D yym;
+    yystate =3D *yystack.s_mark;
+    yystack.l_mark -=3D yym;
+    yym =3D yylhs[yyn];
+    if (yystate =3D=3D 0 && yym =3D=3D 0)
+    {
+#if YYDEBUG
+        if (yydebug)
+            printf("%sdebug: after reduction, shifting from state 0 to\
+ state %d\n", YYPREFIX, YYFINAL);
+#endif
+        yystate =3D YYFINAL;
+        *++yystack.s_mark =3D YYFINAL;
+        *++yystack.l_mark =3D yyval;
+        if (yychar < 0)
+        {
+            if ((yychar =3D YYLEX) < 0) yychar =3D 0;
+#if YYDEBUG
+            if (yydebug)
+            {
+                yys =3D 0;
+                if (yychar <=3D YYMAXTOKEN) yys =3D yyname[yychar];
+                if (!yys) yys =3D "illegal-symbol";
+                printf("%sdebug: state %d, reading %d (%s)\n",
+                        YYPREFIX, YYFINAL, yychar, yys);
+            }
+#endif
+        }
+        if (yychar =3D=3D 0) goto yyaccept;
+        goto yyloop;
+    }
+    if ((yyn =3D yygindex[yym]) && (yyn +=3D yystate) >=3D 0 &&
+            yyn <=3D YYTABLESIZE && yycheck[yyn] =3D=3D yystate)
+        yystate =3D yytable[yyn];
+    else
+        yystate =3D yydgoto[yym];
+#if YYDEBUG
+    if (yydebug)
+        printf("%sdebug: after reduction, shifting from state %d \
+to state %d\n", YYPREFIX, *yystack.s_mark, yystate);
+#endif
+    if (yystack.s_mark >=3D yystack.s_last && yygrowstack(&yystack))
+    {
+        goto yyoverflow;
+    }
+    *++yystack.s_mark =3D (short) yystate;
+    *++yystack.l_mark =3D yyval;
+    goto yyloop;
+
+yyoverflow:
+    yyerror("yacc stack overflow");
+
+yyabort:
+    yyfreestack(&yystack);
+    return (1);
+
+yyaccept:
+    yyfreestack(&yystack);
+    return (0);
+}
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/test/calc1.tab.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/test/calc1.tab.h	Wed Jul 25 16:21:35 2012 +0300
@@ -0,0 +1,18 @@
+#define DREG 257
+#define VREG 258
+#define CONST 259
+#define UMINUS 260
+#ifdef YYSTYPE
+#undef  YYSTYPE_IS_DECLARED
+#define YYSTYPE_IS_DECLARED 1
+#endif
+#ifndef YYSTYPE_IS_DECLARED
+#define YYSTYPE_IS_DECLARED 1
+typedef union
+{
+	int ival;
+	double dval;
+	INTERVAL vval;
+} YYSTYPE;
+#endif /* !YYSTYPE_IS_DECLARED */
+extern YYSTYPE calc1_lval;
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/test/calc1.y
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/test/calc1.y	Wed Jul 25 16:21:35 2012 +0300
@@ -0,0 +1,305 @@
+%{
+
+/* http://dinosaur.compilertools.net/yacc/index.html */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <ctype.h>
+#include <math.h>
+
+typedef struct interval
+{
+    double lo, hi;
+}
+INTERVAL;
+
+INTERVAL vmul(double, double, INTERVAL);
+INTERVAL vdiv(double, double, INTERVAL);
+
+extern int yylex(void);
+static void yyerror(const char *s);
+
+int dcheck(INTERVAL);
+
+double dreg[26];
+INTERVAL vreg[26];
+
+%}
+%expect 18
+
+%start line
+%union
+{
+	int ival;
+	double dval;
+	INTERVAL vval;
+}
+
+%token <ival> DREG VREG		/* indices into dreg, vreg arrays */
+%token <dval> CONST		/* floating point constant */
+
+%type <dval> dexp		/* expression */
+%type <vval> vexp		/* interval expression */
+
+	/* precedence information about the operators */
+
+%left '+' '-'
+%left '*' '/'
+%left UMINUS			/* precedence for unary minus */
+
+%%	/* beginning of rules section */
+
+lines   : /* empty */
+	| lines line
+	;
+
+line	: dexp '\n'
+	{
+		(void) printf("%15.8f\n", $1);
+	}
+	| vexp '\n'
+	{
+		(void) printf("(%15.8f, %15.8f)\n", $1.lo, $1.hi);
+	}
+	| DREG '=3D' dexp '\n'
+	{
+		dreg[$1] =3D $3;
+	}
+	| VREG '=3D' vexp '\n'
+	{
+		vreg[$1] =3D $3;
+	}
+	| error '\n'
+	{
+		yyerrok;
+	}
+	;
+
+dexp	: CONST
+	| DREG
+	{
+		$$ =3D dreg[$1];
+	}
+	| dexp '+' dexp
+	{
+		$$ =3D $1 + $3;
+	}
+	| dexp '-' dexp
+	{
+		$$ =3D $1 - $3;
+	}
+	| dexp '*' dexp
+	{
+		$$ =3D $1 * $3;
+	}
+	| dexp '/' dexp
+	{
+		$$ =3D $1 / $3;
+	}
+	| '-' dexp %prec UMINUS
+	{
+		$$ =3D -$2;
+	}
+	| '(' dexp ')'
+	{
+		$$ =3D $2;
+	}
+	;
+
+vexp	: dexp
+	{
+		$$.hi =3D $$.lo =3D $1;
+	}
+	| '(' dexp ',' dexp ')'
+	{
+		$$.lo =3D $2;
+		$$.hi =3D $4;
+		if ( $$.lo > $$.hi )=20
+		{
+			(void) printf("interval out of order\n");
+			YYERROR;
+		}
+	}
+	| VREG
+	{
+		$$ =3D vreg[$1];
+	}
+	| vexp '+' vexp
+	{
+		$$.hi =3D $1.hi + $3.hi;
+		$$.lo =3D $1.lo + $3.lo;
+	}
+	| dexp '+' vexp
+	{
+		$$.hi =3D $1 + $3.hi;
+		$$.lo =3D $1 + $3.lo;
+	}
+	| vexp '-' vexp
+	{
+		$$.hi =3D $1.hi - $3.lo;
+		$$.lo =3D $1.lo - $3.hi;
+	}
+	| dexp '-' vexp
+	{
+		$$.hi =3D $1 - $3.lo;
+		$$.lo =3D $1 - $3.hi;
+	}
+	| vexp '*' vexp
+	{
+		$$ =3D vmul( $1.lo, $1.hi, $3 );
+	}
+	| dexp '*' vexp
+	{
+		$$ =3D vmul ($1, $1, $3 );
+	}
+	| vexp '/' vexp
+	{
+		if (dcheck($3)) YYERROR;
+		$$ =3D vdiv ( $1.lo, $1.hi, $3 );
+	}
+	| dexp '/' vexp
+	{
+		if (dcheck ( $3 )) YYERROR;
+		$$ =3D vdiv ($1, $1, $3 );
+	}
+	| '-' vexp %prec UMINUS
+	{
+		$$.hi =3D -$2.lo;
+		$$.lo =3D -$2.hi;
+	}
+	| '(' vexp ')'
+	{
+		$$ =3D $2;
+	}
+	;
+
+%%	/* beginning of subroutines section */
+
+#define BSZ 50			/* buffer size for floating point numbers */
+
+	/* lexical analysis */
+
+static void
+yyerror(const char *s)
+{
+    fprintf(stderr, "%s\n", s);
+}
+
+int
+yylex(void)
+{
+    int c;
+
+    while ((c =3D getchar()) =3D=3D ' ')
+    {				/* skip over blanks */
+    }
+
+    if (isupper(c))
+    {
+	yylval.ival =3D c - 'A';
+	return (VREG);
+    }
+    if (islower(c))
+    {
+	yylval.ival =3D c - 'a';
+	return (DREG);
+    }
+
+    if (isdigit(c) || c =3D=3D '.')
+    {
+	/* gobble up digits, points, exponents */
+	char buf[BSZ + 1], *cp =3D buf;
+	int dot =3D 0, expr =3D 0;
+
+	for (; (cp - buf) < BSZ; ++cp, c =3D getchar())
+	{
+
+	    *cp =3D c;
+	    if (isdigit(c))
+		continue;
+	    if (c =3D=3D '.')
+	    {
+		if (dot++ || expr)
+		    return ('.');	/* will cause syntax error */
+		continue;
+	    }
+
+	    if (c =3D=3D 'e')
+	    {
+		if (expr++)
+		    return ('e');	/*  will  cause  syntax  error  */
+		continue;
+	    }
+
+	    /*  end  of  number  */
+	    break;
+	}
+	*cp =3D '\0';
+
+	if ((cp - buf) >=3D BSZ)
+	    printf("constant  too  long:  truncated\n");
+	else
+	    ungetc(c, stdin);	/*  push  back  last  char  read  */
+	yylval.dval =3D atof(buf);
+	return (CONST);
+    }
+    return (c);
+}
+
+static INTERVAL
+hilo(double a, double b, double c, double d)
+{
+    /*  returns  the  smallest  interval  containing  a,  b,  c,  and  d  =
*/
+    /*  used  by  *,  /  routines  */
+    INTERVAL v;
+
+    if (a > b)
+    {
+	v.hi =3D a;
+	v.lo =3D b;
+    }
+    else
+    {
+	v.hi =3D b;
+	v.lo =3D a;
+    }
+
+    if (c > d)
+    {
+	if (c > v.hi)
+	    v.hi =3D c;
+	if (d < v.lo)
+	    v.lo =3D d;
+    }
+    else
+    {
+	if (d > v.hi)
+	    v.hi =3D d;
+	if (c < v.lo)
+	    v.lo =3D c;
+    }
+    return (v);
+}
+
+INTERVAL
+vmul(double a, double b, INTERVAL v)
+{
+    return (hilo(a * v.hi, a * v.lo, b * v.hi, b * v.lo));
+}
+
+int
+dcheck(INTERVAL v)
+{
+    if (v.hi >=3D 0. && v.lo <=3D 0.)
+    {
+	printf("divisor  interval  contains  0.\n");
+	return (1);
+    }
+    return (0);
+}
+
+INTERVAL
+vdiv(double a, double b, INTERVAL v)
+{
+    return (hilo(a / v.hi, a / v.lo, b / v.hi, b / v.lo));
+}
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/test/calc2.output
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/test/calc2.output	Wed Jul 25 16:21:35 2012 +0300
@@ -0,0 +1,461 @@
+   0  $accept : list $end
+
+   1  list :
+   2       | list stat '\n'
+   3       | list error '\n'
+
+   4  stat : expr
+   5       | LETTER '=3D' expr
+
+   6  expr : '(' expr ')'
+   7       | expr '+' expr
+   8       | expr '-' expr
+   9       | expr '*' expr
+  10       | expr '/' expr
+  11       | expr '%' expr
+  12       | expr '&' expr
+  13       | expr '|' expr
+  14       | '-' expr
+  15       | LETTER
+  16       | number
+
+  17  number : DIGIT
+  18         | number DIGIT
+=0C
+state 0
+	$accept : . list $end  (0)
+	list : .  (1)
+
+	.  reduce 1
+
+	list  goto 1
+
+
+state 1
+	$accept : list . $end  (0)
+	list : list . stat '\n'  (2)
+	list : list . error '\n'  (3)
+
+	$end  accept
+	error  shift 2
+	DIGIT  shift 3
+	LETTER  shift 4
+	'-'  shift 5
+	'('  shift 6
+	.  error
+
+	stat  goto 7
+	expr  goto 8
+	number  goto 9
+
+
+state 2
+	list : list error . '\n'  (3)
+
+	'\n'  shift 10
+	.  error
+
+
+state 3
+	number : DIGIT .  (17)
+
+	.  reduce 17
+
+
+state 4
+	stat : LETTER . '=3D' expr  (5)
+	expr : LETTER .  (15)
+
+	'=3D'  shift 11
+	'|'  reduce 15
+	'&'  reduce 15
+	'+'  reduce 15
+	'-'  reduce 15
+	'*'  reduce 15
+	'/'  reduce 15
+	'%'  reduce 15
+	'\n'  reduce 15
+
+
+state 5
+	expr : '-' . expr  (14)
+
+	DIGIT  shift 3
+	LETTER  shift 12
+	'-'  shift 5
+	'('  shift 6
+	.  error
+
+	expr  goto 13
+	number  goto 9
+
+
+state 6
+	expr : '(' . expr ')'  (6)
+
+	DIGIT  shift 3
+	LETTER  shift 12
+	'-'  shift 5
+	'('  shift 6
+	.  error
+
+	expr  goto 14
+	number  goto 9
+
+
+state 7
+	list : list stat . '\n'  (2)
+
+	'\n'  shift 15
+	.  error
+
+
+state 8
+	stat : expr .  (4)
+	expr : expr . '+' expr  (7)
+	expr : expr . '-' expr  (8)
+	expr : expr . '*' expr  (9)
+	expr : expr . '/' expr  (10)
+	expr : expr . '%' expr  (11)
+	expr : expr . '&' expr  (12)
+	expr : expr . '|' expr  (13)
+
+	'|'  shift 16
+	'&'  shift 17
+	'+'  shift 18
+	'-'  shift 19
+	'*'  shift 20
+	'/'  shift 21
+	'%'  shift 22
+	'\n'  reduce 4
+
+
+state 9
+	expr : number .  (16)
+	number : number . DIGIT  (18)
+
+	DIGIT  shift 23
+	'|'  reduce 16
+	'&'  reduce 16
+	'+'  reduce 16
+	'-'  reduce 16
+	'*'  reduce 16
+	'/'  reduce 16
+	'%'  reduce 16
+	'\n'  reduce 16
+	')'  reduce 16
+
+
+state 10
+	list : list error '\n' .  (3)
+
+	.  reduce 3
+
+
+state 11
+	stat : LETTER '=3D' . expr  (5)
+
+	DIGIT  shift 3
+	LETTER  shift 12
+	'-'  shift 5
+	'('  shift 6
+	.  error
+
+	expr  goto 24
+	number  goto 9
+
+
+state 12
+	expr : LETTER .  (15)
+
+	.  reduce 15
+
+
+state 13
+	expr : expr . '+' expr  (7)
+	expr : expr . '-' expr  (8)
+	expr : expr . '*' expr  (9)
+	expr : expr . '/' expr  (10)
+	expr : expr . '%' expr  (11)
+	expr : expr . '&' expr  (12)
+	expr : expr . '|' expr  (13)
+	expr : '-' expr .  (14)
+
+	.  reduce 14
+
+
+state 14
+	expr : '(' expr . ')'  (6)
+	expr : expr . '+' expr  (7)
+	expr : expr . '-' expr  (8)
+	expr : expr . '*' expr  (9)
+	expr : expr . '/' expr  (10)
+	expr : expr . '%' expr  (11)
+	expr : expr . '&' expr  (12)
+	expr : expr . '|' expr  (13)
+
+	'|'  shift 16
+	'&'  shift 17
+	'+'  shift 18
+	'-'  shift 19
+	'*'  shift 20
+	'/'  shift 21
+	'%'  shift 22
+	')'  shift 25
+	.  error
+
+
+state 15
+	list : list stat '\n' .  (2)
+
+	.  reduce 2
+
+
+state 16
+	expr : expr '|' . expr  (13)
+
+	DIGIT  shift 3
+	LETTER  shift 12
+	'-'  shift 5
+	'('  shift 6
+	.  error
+
+	expr  goto 26
+	number  goto 9
+
+
+state 17
+	expr : expr '&' . expr  (12)
+
+	DIGIT  shift 3
+	LETTER  shift 12
+	'-'  shift 5
+	'('  shift 6
+	.  error
+
+	expr  goto 27
+	number  goto 9
+
+
+state 18
+	expr : expr '+' . expr  (7)
+
+	DIGIT  shift 3
+	LETTER  shift 12
+	'-'  shift 5
+	'('  shift 6
+	.  error
+
+	expr  goto 28
+	number  goto 9
+
+
+state 19
+	expr : expr '-' . expr  (8)
+
+	DIGIT  shift 3
+	LETTER  shift 12
+	'-'  shift 5
+	'('  shift 6
+	.  error
+
+	expr  goto 29
+	number  goto 9
+
+
+state 20
+	expr : expr '*' . expr  (9)
+
+	DIGIT  shift 3
+	LETTER  shift 12
+	'-'  shift 5
+	'('  shift 6
+	.  error
+
+	expr  goto 30
+	number  goto 9
+
+
+state 21
+	expr : expr '/' . expr  (10)
+
+	DIGIT  shift 3
+	LETTER  shift 12
+	'-'  shift 5
+	'('  shift 6
+	.  error
+
+	expr  goto 31
+	number  goto 9
+
+
+state 22
+	expr : expr '%' . expr  (11)
+
+	DIGIT  shift 3
+	LETTER  shift 12
+	'-'  shift 5
+	'('  shift 6
+	.  error
+
+	expr  goto 32
+	number  goto 9
+
+
+state 23
+	number : number DIGIT .  (18)
+
+	.  reduce 18
+
+
+state 24
+	stat : LETTER '=3D' expr .  (5)
+	expr : expr . '+' expr  (7)
+	expr : expr . '-' expr  (8)
+	expr : expr . '*' expr  (9)
+	expr : expr . '/' expr  (10)
+	expr : expr . '%' expr  (11)
+	expr : expr . '&' expr  (12)
+	expr : expr . '|' expr  (13)
+
+	'|'  shift 16
+	'&'  shift 17
+	'+'  shift 18
+	'-'  shift 19
+	'*'  shift 20
+	'/'  shift 21
+	'%'  shift 22
+	'\n'  reduce 5
+
+
+state 25
+	expr : '(' expr ')' .  (6)
+
+	.  reduce 6
+
+
+state 26
+	expr : expr . '+' expr  (7)
+	expr : expr . '-' expr  (8)
+	expr : expr . '*' expr  (9)
+	expr : expr . '/' expr  (10)
+	expr : expr . '%' expr  (11)
+	expr : expr . '&' expr  (12)
+	expr : expr . '|' expr  (13)
+	expr : expr '|' expr .  (13)
+
+	'&'  shift 17
+	'+'  shift 18
+	'-'  shift 19
+	'*'  shift 20
+	'/'  shift 21
+	'%'  shift 22
+	'|'  reduce 13
+	'\n'  reduce 13
+	')'  reduce 13
+
+
+state 27
+	expr : expr . '+' expr  (7)
+	expr : expr . '-' expr  (8)
+	expr : expr . '*' expr  (9)
+	expr : expr . '/' expr  (10)
+	expr : expr . '%' expr  (11)
+	expr : expr . '&' expr  (12)
+	expr : expr '&' expr .  (12)
+	expr : expr . '|' expr  (13)
+
+	'+'  shift 18
+	'-'  shift 19
+	'*'  shift 20
+	'/'  shift 21
+	'%'  shift 22
+	'|'  reduce 12
+	'&'  reduce 12
+	'\n'  reduce 12
+	')'  reduce 12
+
+
+state 28
+	expr : expr . '+' expr  (7)
+	expr : expr '+' expr .  (7)
+	expr : expr . '-' expr  (8)
+	expr : expr . '*' expr  (9)
+	expr : expr . '/' expr  (10)
+	expr : expr . '%' expr  (11)
+	expr : expr . '&' expr  (12)
+	expr : expr . '|' expr  (13)
+
+	'*'  shift 20
+	'/'  shift 21
+	'%'  shift 22
+	'|'  reduce 7
+	'&'  reduce 7
+	'+'  reduce 7
+	'-'  reduce 7
+	'\n'  reduce 7
+	')'  reduce 7
+
+
+state 29
+	expr : expr . '+' expr  (7)
+	expr : expr . '-' expr  (8)
+	expr : expr '-' expr .  (8)
+	expr : expr . '*' expr  (9)
+	expr : expr . '/' expr  (10)
+	expr : expr . '%' expr  (11)
+	expr : expr . '&' expr  (12)
+	expr : expr . '|' expr  (13)
+
+	'*'  shift 20
+	'/'  shift 21
+	'%'  shift 22
+	'|'  reduce 8
+	'&'  reduce 8
+	'+'  reduce 8
+	'-'  reduce 8
+	'\n'  reduce 8
+	')'  reduce 8
+
+
+state 30
+	expr : expr . '+' expr  (7)
+	expr : expr . '-' expr  (8)
+	expr : expr . '*' expr  (9)
+	expr : expr '*' expr .  (9)
+	expr : expr . '/' expr  (10)
+	expr : expr . '%' expr  (11)
+	expr : expr . '&' expr  (12)
+	expr : expr . '|' expr  (13)
+
+	.  reduce 9
+
+
+state 31
+	expr : expr . '+' expr  (7)
+	expr : expr . '-' expr  (8)
+	expr : expr . '*' expr  (9)
+	expr : expr . '/' expr  (10)
+	expr : expr '/' expr .  (10)
+	expr : expr . '%' expr  (11)
+	expr : expr . '&' expr  (12)
+	expr : expr . '|' expr  (13)
+
+	.  reduce 10
+
+
+state 32
+	expr : expr . '+' expr  (7)
+	expr : expr . '-' expr  (8)
+	expr : expr . '*' expr  (9)
+	expr : expr . '/' expr  (10)
+	expr : expr . '%' expr  (11)
+	expr : expr '%' expr .  (11)
+	expr : expr . '&' expr  (12)
+	expr : expr . '|' expr  (13)
+
+	.  reduce 11
+
+
+16 terminals, 5 nonterminals
+19 grammar rules, 33 states
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/test/calc2.tab.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/test/calc2.tab.c	Wed Jul 25 16:21:35 2012 +0300
@@ -0,0 +1,682 @@
+#ifndef lint
+static const char yysccsid[] =3D "@(#)yaccpar	1.9 (Berkeley) 02/21/93";
+#endif
+
+#define YYBYACC 1
+#define YYMAJOR 1
+#define YYMINOR 9
+
+#define YYEMPTY        (-1)
+#define yyclearin      (yychar =3D YYEMPTY)
+#define yyerrok        (yyerrflag =3D 0)
+#define YYRECOVERING() (yyerrflag !=3D 0)
+
+
+#ifndef yyparse
+#define yyparse    calc2_parse
+#endif /* yyparse */
+
+#ifndef yylex
+#define yylex      calc2_lex
+#endif /* yylex */
+
+#ifndef yyerror
+#define yyerror    calc2_error
+#endif /* yyerror */
+
+#ifndef yychar
+#define yychar     calc2_char
+#endif /* yychar */
+
+#ifndef yyval
+#define yyval      calc2_val
+#endif /* yyval */
+
+#ifndef yylval
+#define yylval     calc2_lval
+#endif /* yylval */
+
+#ifndef yydebug
+#define yydebug    calc2_debug
+#endif /* yydebug */
+
+#ifndef yynerrs
+#define yynerrs    calc2_nerrs
+#endif /* yynerrs */
+
+#ifndef yyerrflag
+#define yyerrflag  calc2_errflag
+#endif /* yyerrflag */
+
+#ifndef yylhs
+#define yylhs      calc2_lhs
+#endif /* yylhs */
+
+#ifndef yylen
+#define yylen      calc2_len
+#endif /* yylen */
+
+#ifndef yydefred
+#define yydefred   calc2_defred
+#endif /* yydefred */
+
+#ifndef yydgoto
+#define yydgoto    calc2_dgoto
+#endif /* yydgoto */
+
+#ifndef yysindex
+#define yysindex   calc2_sindex
+#endif /* yysindex */
+
+#ifndef yyrindex
+#define yyrindex   calc2_rindex
+#endif /* yyrindex */
+
+#ifndef yygindex
+#define yygindex   calc2_gindex
+#endif /* yygindex */
+
+#ifndef yytable
+#define yytable    calc2_table
+#endif /* yytable */
+
+#ifndef yycheck
+#define yycheck    calc2_check
+#endif /* yycheck */
+
+#ifndef yyname
+#define yyname     calc2_name
+#endif /* yyname */
+
+#ifndef yyrule
+#define yyrule     calc2_rule
+#endif /* yyrule */
+#define YYPREFIX "calc2_"
+
+#define YYPURE 0
+
+#line 7 "calc2.y"
+# include <stdio.h>
+# include <ctype.h>
+
+#ifdef YYBISON
+#define YYLEX_PARAM base
+#define YYLEX_DECL() yylex(int *YYLEX_PARAM)
+#define YYERROR_DECL() yyerror(int regs[26], int *base, const char *s)
+int YYLEX_DECL();
+static void YYERROR_DECL();
+#endif
+
+#line 111 "calc2.tab.c"
+
+#ifndef YYSTYPE
+typedef int YYSTYPE;
+#endif
+
+/* compatibility with bison */
+#ifdef YYPARSE_PARAM
+/* compatibility with FreeBSD */
+# ifdef YYPARSE_PARAM_TYPE
+#  define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM)
+# else
+#  define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM)
+# endif
+#else
+# define YYPARSE_DECL() yyparse(int  regs[26], int * base)
+#endif
+
+/* Parameters sent to lex. */
+#ifdef YYLEX_PARAM
+# define YYLEX_DECL() yylex(void *YYLEX_PARAM)
+# define YYLEX yylex(YYLEX_PARAM)
+#else
+# define YYLEX_DECL() yylex(int * base)
+# define YYLEX yylex(base)
+#endif
+
+/* Parameters sent to yyerror. */
+#ifndef YYERROR_DECL
+#define YYERROR_DECL() yyerror(int  regs[26], int * base, const char *s)
+#endif
+#ifndef YYERROR_CALL
+#define YYERROR_CALL(msg) yyerror(regs, base, msg)
+#endif
+
+extern int YYPARSE_DECL();
+
+#define DIGIT 257
+#define LETTER 258
+#define UMINUS 259
+#define YYERRCODE 256
+static const short calc2_lhs[] =3D {                       -1,
+    0,    0,    0,    1,    1,    2,    2,    2,    2,    2,
+    2,    2,    2,    2,    2,    2,    3,    3,
+};
+static const short calc2_len[] =3D {                        2,
+    0,    3,    3,    1,    3,    3,    3,    3,    3,    3,
+    3,    3,    3,    2,    1,    1,    1,    2,
+};
+static const short calc2_defred[] =3D {                     1,
+    0,    0,   17,    0,    0,    0,    0,    0,    0,    3,
+    0,   15,   14,    0,    2,    0,    0,    0,    0,    0,
+    0,    0,   18,    0,    6,    0,    0,    0,    0,    9,
+   10,   11,
+};
+static const short calc2_dgoto[] =3D {                      1,
+    7,    8,    9,
+};
+static const short calc2_sindex[] =3D {                     0,
+  -40,   -7,    0,  -55,  -38,  -38,    1,  -29, -247,    0,
+  -38,    0,    0,   22,    0,  -38,  -38,  -38,  -38,  -38,
+  -38,  -38,    0,  -29,    0,   51,   60,  -20,  -20,    0,
+    0,    0,
+};
+static const short calc2_rindex[] =3D {                     0,
+    0,    0,    0,    2,    0,    0,    0,    9,   -9,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,   10,    0,   -6,   14,    5,   13,    0,
+    0,    0,
+};
+static const short calc2_gindex[] =3D {                     0,
+    0,   65,    0,
+};
+#define YYTABLESIZE 220
+static const short calc2_table[] =3D {                      6,
+   16,    6,   10,   13,    5,   11,    5,   22,   17,   23,
+   15,   15,   20,   18,    7,   19,   22,   21,    4,    5,
+    0,   20,    8,   12,    0,    0,   21,   16,   16,    0,
+    0,   16,   16,   16,   13,   16,    0,   16,   15,   15,
+    0,    0,    7,   15,   15,    7,   15,    7,   15,    7,
+    8,   12,    0,    8,   12,    8,    0,    8,   22,   17,
+    0,    0,   25,   20,   18,    0,   19,    0,   21,   13,
+   14,    0,    0,    0,    0,   24,    0,    0,    0,    0,
+   26,   27,   28,   29,   30,   31,   32,   22,   17,    0,
+    0,    0,   20,   18,   16,   19,   22,   21,    0,    0,
+    0,   20,   18,    0,   19,    0,   21,    0,    0,    0,
+    0,    0,    0,    0,   16,    0,    0,   13,    0,    0,
+    0,    0,    0,    0,    0,   15,    0,    0,    7,    0,
+    0,    0,    0,    0,    0,    0,    8,   12,    0,    0,
+    0,    0,    0,    0,    0,   16,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    2,    3,    4,    3,   12,
+};
+static const short calc2_check[] =3D {                     40,
+   10,   40,   10,   10,   45,   61,   45,   37,   38,  257,
+   10,   10,   42,   43,   10,   45,   37,   47,   10,   10,
+   -1,   42,   10,   10,   -1,   -1,   47,   37,   38,   -1,
+   -1,   41,   42,   43,   41,   45,   -1,   47,   37,   38,
+   -1,   -1,   38,   42,   43,   41,   45,   43,   47,   45,
+   38,   38,   -1,   41,   41,   43,   -1,   45,   37,   38,
+   -1,   -1,   41,   42,   43,   -1,   45,   -1,   47,    5,
+    6,   -1,   -1,   -1,   -1,   11,   -1,   -1,   -1,   -1,
+   16,   17,   18,   19,   20,   21,   22,   37,   38,   -1,
+   -1,   -1,   42,   43,  124,   45,   37,   47,   -1,   -1,
+   -1,   42,   43,   -1,   45,   -1,   47,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,  124,   -1,   -1,  124,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,  124,   -1,   -1,  124,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,  124,  124,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,  124,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,  256,  257,  258,  257,  258,
+};
+#define YYFINAL 1
+#ifndef YYDEBUG
+#define YYDEBUG 0
+#endif
+#define YYMAXTOKEN 259
+#if YYDEBUG
+static const char *yyname[] =3D {
+
+"end-of-file",0,0,0,0,0,0,0,0,0,"'\\n'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,=
0,0,0,
+0,0,0,0,0,0,"'%'","'&'",0,"'('","')'","'*'","'+'",0,"'-'",0,"'/'",0,0,0,0,=
0,0,0,
+0,0,0,0,0,0,"'=3D'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,=
0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"'|'",0,0,0,=
0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,=
0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,=
0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,=
0,0,0,
+0,0,0,0,0,0,"DIGIT","LETTER","UMINUS",
+};
+static const char *yyrule[] =3D {
+"$accept : list",
+"list :",
+"list : list stat '\\n'",
+"list : list error '\\n'",
+"stat : expr",
+"stat : LETTER '=3D' expr",
+"expr : '(' expr ')'",
+"expr : expr '+' expr",
+"expr : expr '-' expr",
+"expr : expr '*' expr",
+"expr : expr '/' expr",
+"expr : expr '%' expr",
+"expr : expr '&' expr",
+"expr : expr '|' expr",
+"expr : '-' expr",
+"expr : LETTER",
+"expr : number",
+"number : DIGIT",
+"number : number DIGIT",
+
+};
+#endif
+
+int      yydebug;
+int      yynerrs;
+
+int      yyerrflag;
+int      yychar;
+YYSTYPE  yyval;
+YYSTYPE  yylval;
+
+/* define the initial stack-sizes */
+#ifdef YYSTACKSIZE
+#undef YYMAXDEPTH
+#define YYMAXDEPTH  YYSTACKSIZE
+#else
+#ifdef YYMAXDEPTH
+#define YYSTACKSIZE YYMAXDEPTH
+#else
+#define YYSTACKSIZE 500
+#define YYMAXDEPTH  500
+#endif
+#endif
+
+#define YYINITSTACKSIZE 500
+
+typedef struct {
+    unsigned stacksize;
+    short    *s_base;
+    short    *s_mark;
+    short    *s_last;
+    YYSTYPE  *l_base;
+    YYSTYPE  *l_mark;
+} YYSTACKDATA;
+/* variables for the parser stack */
+static YYSTACKDATA yystack;
+#line 73 "calc2.y"
+ /* start of programs */
+
+#ifdef YYBYACC
+extern int YYLEX_DECL();
+#endif
+
+int
+main (void)
+{
+    int regs[26];
+    int base =3D 10;
+
+    while(!feof(stdin)) {
+	yyparse(regs, &base);
+    }
+    return 0;
+}
+
+static void
+YYERROR_DECL()
+{
+    fprintf(stderr, "%s\n", s);
+}
+
+int
+YYLEX_DECL()
+{
+	/* lexical analysis routine */
+	/* returns LETTER for a lower case letter, yylval =3D 0 through 25 */
+	/* return DIGIT for a digit, yylval =3D 0 through 9 */
+	/* all other characters are returned immediately */
+
+    int c;
+
+    while( (c=3Dgetchar()) =3D=3D ' ' )   { /* skip blanks */ }
+
+    /* c is now nonblank */
+
+    if( islower( c )) {
+	yylval =3D c - 'a';
+	return ( LETTER );
+    }
+    if( isdigit( c )) {
+	yylval =3D (c - '0') % (*base);
+	return ( DIGIT );
+    }
+    return( c );
+}
+#line 356 "calc2.tab.c"
+
+#if YYDEBUG
+#include <stdio.h>		/* needed for printf */
+#endif
+
+#include <stdlib.h>	/* needed for malloc, etc */
+#include <string.h>	/* needed for memset */
+
+/* allocate initial stack or double stack size, up to YYMAXDEPTH */
+static int yygrowstack(YYSTACKDATA *data)
+{
+    int i;
+    unsigned newsize;
+    short *newss;
+    YYSTYPE *newvs;
+
+    if ((newsize =3D data->stacksize) =3D=3D 0)
+        newsize =3D YYINITSTACKSIZE;
+    else if (newsize >=3D YYMAXDEPTH)
+        return -1;
+    else if ((newsize *=3D 2) > YYMAXDEPTH)
+        newsize =3D YYMAXDEPTH;
+
+    i =3D data->s_mark - data->s_base;
+    newss =3D (short *)realloc(data->s_base, newsize * sizeof(*newss));
+    if (newss =3D=3D 0)
+        return -1;
+
+    data->s_base =3D newss;
+    data->s_mark =3D newss + i;
+
+    newvs =3D (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));
+    if (newvs =3D=3D 0)
+        return -1;
+
+    data->l_base =3D newvs;
+    data->l_mark =3D newvs + i;
+
+    data->stacksize =3D newsize;
+    data->s_last =3D data->s_base + newsize - 1;
+    return 0;
+}
+
+#if YYPURE || defined(YY_NO_LEAKS)
+static void yyfreestack(YYSTACKDATA *data)
+{
+    free(data->s_base);
+    free(data->l_base);
+    memset(data, 0, sizeof(*data));
+}
+#else
+#define yyfreestack(data) /* nothing */
+#endif
+
+#define YYABORT  goto yyabort
+#define YYREJECT goto yyabort
+#define YYACCEPT goto yyaccept
+#define YYERROR  goto yyerrlab
+
+int
+YYPARSE_DECL()
+{
+    int yym, yyn, yystate;
+#if YYDEBUG
+    const char *yys;
+
+    if ((yys =3D getenv("YYDEBUG")) !=3D 0)
+    {
+        yyn =3D *yys;
+        if (yyn >=3D '0' && yyn <=3D '9')
+            yydebug =3D yyn - '0';
+    }
+#endif
+
+    yynerrs =3D 0;
+    yyerrflag =3D 0;
+    yychar =3D YYEMPTY;
+    yystate =3D 0;
+
+#if YYPURE
+    memset(&yystack, 0, sizeof(yystack));
+#endif
+
+    if (yystack.s_base =3D=3D NULL && yygrowstack(&yystack)) goto yyoverfl=
ow;
+    yystack.s_mark =3D yystack.s_base;
+    yystack.l_mark =3D yystack.l_base;
+    yystate =3D 0;
+    *yystack.s_mark =3D 0;
+
+yyloop:
+    if ((yyn =3D yydefred[yystate]) !=3D 0) goto yyreduce;
+    if (yychar < 0)
+    {
+        if ((yychar =3D YYLEX) < 0) yychar =3D 0;
+#if YYDEBUG
+        if (yydebug)
+        {
+            yys =3D 0;
+            if (yychar <=3D YYMAXTOKEN) yys =3D yyname[yychar];
+            if (!yys) yys =3D "illegal-symbol";
+            printf("%sdebug: state %d, reading %d (%s)\n",
+                    YYPREFIX, yystate, yychar, yys);
+        }
+#endif
+    }
+    if ((yyn =3D yysindex[yystate]) && (yyn +=3D yychar) >=3D 0 &&
+            yyn <=3D YYTABLESIZE && yycheck[yyn] =3D=3D yychar)
+    {
+#if YYDEBUG
+        if (yydebug)
+            printf("%sdebug: state %d, shifting to state %d\n",
+                    YYPREFIX, yystate, yytable[yyn]);
+#endif
+        if (yystack.s_mark >=3D yystack.s_last && yygrowstack(&yystack))
+        {
+            goto yyoverflow;
+        }
+        yystate =3D yytable[yyn];
+        *++yystack.s_mark =3D yytable[yyn];
+        *++yystack.l_mark =3D yylval;
+        yychar =3D YYEMPTY;
+        if (yyerrflag > 0)  --yyerrflag;
+        goto yyloop;
+    }
+    if ((yyn =3D yyrindex[yystate]) && (yyn +=3D yychar) >=3D 0 &&
+            yyn <=3D YYTABLESIZE && yycheck[yyn] =3D=3D yychar)
+    {
+        yyn =3D yytable[yyn];
+        goto yyreduce;
+    }
+    if (yyerrflag) goto yyinrecovery;
+
+    yyerror(regs, base, "syntax error");
+
+    goto yyerrlab;
+
+yyerrlab:
+    ++yynerrs;
+
+yyinrecovery:
+    if (yyerrflag < 3)
+    {
+        yyerrflag =3D 3;
+        for (;;)
+        {
+            if ((yyn =3D yysindex[*yystack.s_mark]) && (yyn +=3D YYERRCODE=
) >=3D 0 &&
+                    yyn <=3D YYTABLESIZE && yycheck[yyn] =3D=3D YYERRCODE)
+            {
+#if YYDEBUG
+                if (yydebug)
+                    printf("%sdebug: state %d, error recovery shifting\
+ to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]);
+#endif
+                if (yystack.s_mark >=3D yystack.s_last && yygrowstack(&yys=
tack))
+                {
+                    goto yyoverflow;
+                }
+                yystate =3D yytable[yyn];
+                *++yystack.s_mark =3D yytable[yyn];
+                *++yystack.l_mark =3D yylval;
+                goto yyloop;
+            }
+            else
+            {
+#if YYDEBUG
+                if (yydebug)
+                    printf("%sdebug: error recovery discarding state %d\n",
+                            YYPREFIX, *yystack.s_mark);
+#endif
+                if (yystack.s_mark <=3D yystack.s_base) goto yyabort;
+                --yystack.s_mark;
+                --yystack.l_mark;
+            }
+        }
+    }
+    else
+    {
+        if (yychar =3D=3D 0) goto yyabort;
+#if YYDEBUG
+        if (yydebug)
+        {
+            yys =3D 0;
+            if (yychar <=3D YYMAXTOKEN) yys =3D yyname[yychar];
+            if (!yys) yys =3D "illegal-symbol";
+            printf("%sdebug: state %d, error recovery discards token %d (%=
s)\n",
+                    YYPREFIX, yystate, yychar, yys);
+        }
+#endif
+        yychar =3D YYEMPTY;
+        goto yyloop;
+    }
+
+yyreduce:
+#if YYDEBUG
+    if (yydebug)
+        printf("%sdebug: state %d, reducing by rule %d (%s)\n",
+                YYPREFIX, yystate, yyn, yyrule[yyn]);
+#endif
+    yym =3D yylen[yyn];
+    if (yym)
+        yyval =3D yystack.l_mark[1-yym];
+    else
+        memset(&yyval, 0, sizeof yyval);
+    switch (yyn)
+    {
+case 3:
+#line 35 "calc2.y"
+	{  yyerrok ; }
+break;
+case 4:
+#line 39 "calc2.y"
+	{  printf("%d\n",yystack.l_mark[0]);}
+break;
+case 5:
+#line 41 "calc2.y"
+	{  regs[yystack.l_mark[-2]] =3D yystack.l_mark[0]; }
+break;
+case 6:
+#line 45 "calc2.y"
+	{  yyval =3D yystack.l_mark[-1]; }
+break;
+case 7:
+#line 47 "calc2.y"
+	{  yyval =3D yystack.l_mark[-2] + yystack.l_mark[0]; }
+break;
+case 8:
+#line 49 "calc2.y"
+	{  yyval =3D yystack.l_mark[-2] - yystack.l_mark[0]; }
+break;
+case 9:
+#line 51 "calc2.y"
+	{  yyval =3D yystack.l_mark[-2] * yystack.l_mark[0]; }
+break;
+case 10:
+#line 53 "calc2.y"
+	{  yyval =3D yystack.l_mark[-2] / yystack.l_mark[0]; }
+break;
+case 11:
+#line 55 "calc2.y"
+	{  yyval =3D yystack.l_mark[-2] % yystack.l_mark[0]; }
+break;
+case 12:
+#line 57 "calc2.y"
+	{  yyval =3D yystack.l_mark[-2] & yystack.l_mark[0]; }
+break;
+case 13:
+#line 59 "calc2.y"
+	{  yyval =3D yystack.l_mark[-2] | yystack.l_mark[0]; }
+break;
+case 14:
+#line 61 "calc2.y"
+	{  yyval =3D - yystack.l_mark[0]; }
+break;
+case 15:
+#line 63 "calc2.y"
+	{  yyval =3D regs[yystack.l_mark[0]]; }
+break;
+case 17:
+#line 68 "calc2.y"
+	{  yyval =3D yystack.l_mark[0]; (*base) =3D (yystack.l_mark[0]=3D=3D0) ? =
8 : 10; }
+break;
+case 18:
+#line 70 "calc2.y"
+	{  yyval =3D (*base) * yystack.l_mark[-1] + yystack.l_mark[0]; }
+break;
+#line 622 "calc2.tab.c"
+    }
+    yystack.s_mark -=3D yym;
+    yystate =3D *yystack.s_mark;
+    yystack.l_mark -=3D yym;
+    yym =3D yylhs[yyn];
+    if (yystate =3D=3D 0 && yym =3D=3D 0)
+    {
+#if YYDEBUG
+        if (yydebug)
+            printf("%sdebug: after reduction, shifting from state 0 to\
+ state %d\n", YYPREFIX, YYFINAL);
+#endif
+        yystate =3D YYFINAL;
+        *++yystack.s_mark =3D YYFINAL;
+        *++yystack.l_mark =3D yyval;
+        if (yychar < 0)
+        {
+            if ((yychar =3D YYLEX) < 0) yychar =3D 0;
+#if YYDEBUG
+            if (yydebug)
+            {
+                yys =3D 0;
+                if (yychar <=3D YYMAXTOKEN) yys =3D yyname[yychar];
+                if (!yys) yys =3D "illegal-symbol";
+                printf("%sdebug: state %d, reading %d (%s)\n",
+                        YYPREFIX, YYFINAL, yychar, yys);
+            }
+#endif
+        }
+        if (yychar =3D=3D 0) goto yyaccept;
+        goto yyloop;
+    }
+    if ((yyn =3D yygindex[yym]) && (yyn +=3D yystate) >=3D 0 &&
+            yyn <=3D YYTABLESIZE && yycheck[yyn] =3D=3D yystate)
+        yystate =3D yytable[yyn];
+    else
+        yystate =3D yydgoto[yym];
+#if YYDEBUG
+    if (yydebug)
+        printf("%sdebug: after reduction, shifting from state %d \
+to state %d\n", YYPREFIX, *yystack.s_mark, yystate);
+#endif
+    if (yystack.s_mark >=3D yystack.s_last && yygrowstack(&yystack))
+    {
+        goto yyoverflow;
+    }
+    *++yystack.s_mark =3D (short) yystate;
+    *++yystack.l_mark =3D yyval;
+    goto yyloop;
+
+yyoverflow:
+    yyerror(regs, base, "yacc stack overflow");
+
+yyabort:
+    yyfreestack(&yystack);
+    return (1);
+
+yyaccept:
+    yyfreestack(&yystack);
+    return (0);
+}
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/test/calc2.tab.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/test/calc2.tab.h	Wed Jul 25 16:21:35 2012 +0300
@@ -0,0 +1,3 @@
+#define DIGIT 257
+#define LETTER 258
+#define UMINUS 259
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/test/calc2.y
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/test/calc2.y	Wed Jul 25 16:21:35 2012 +0300
@@ -0,0 +1,120 @@
+%parse-param { int regs[26] }
+%parse-param { int *base }
+
+%lex-param { int *base }
+
+%{
+# include <stdio.h>
+# include <ctype.h>
+
+#ifdef YYBISON
+#define YYLEX_PARAM base
+#define YYLEX_DECL() yylex(int *YYLEX_PARAM)
+#define YYERROR_DECL() yyerror(int regs[26], int *base, const char *s)
+int YYLEX_DECL();
+static void YYERROR_DECL();
+#endif
+
+%}
+
+%start list
+
+%token DIGIT LETTER
+
+%left '|'
+%left '&'
+%left '+' '-'
+%left '*' '/' '%'
+%left UMINUS   /* supplies precedence for unary minus */
+
+%% /* beginning of rules section */
+
+list  :  /* empty */
+      |  list stat '\n'
+      |  list error '\n'
+            {  yyerrok ; }
+      ;
+
+stat  :  expr
+            {  printf("%d\n",$1);}
+      |  LETTER '=3D' expr
+            {  regs[$1] =3D $3; }
+      ;
+
+expr  :  '(' expr ')'
+            {  $$ =3D $2; }
+      |  expr '+' expr
+            {  $$ =3D $1 + $3; }
+      |  expr '-' expr
+            {  $$ =3D $1 - $3; }
+      |  expr '*' expr
+            {  $$ =3D $1 * $3; }
+      |  expr '/' expr
+            {  $$ =3D $1 / $3; }
+      |  expr '%' expr
+            {  $$ =3D $1 % $3; }
+      |  expr '&' expr
+            {  $$ =3D $1 & $3; }
+      |  expr '|' expr
+            {  $$ =3D $1 | $3; }
+      |  '-' expr %prec UMINUS
+            {  $$ =3D - $2; }
+      |  LETTER
+            {  $$ =3D regs[$1]; }
+      |  number
+      ;
+
+number:  DIGIT
+         {  $$ =3D $1; (*base) =3D ($1=3D=3D0) ? 8 : 10; }
+      |  number DIGIT
+         {  $$ =3D (*base) * $1 + $2; }
+      ;
+
+%% /* start of programs */
+
+#ifdef YYBYACC
+extern int YYLEX_DECL();
+#endif
+
+int
+main (void)
+{
+    int regs[26];
+    int base =3D 10;
+
+    while(!feof(stdin)) {
+	yyparse(regs, &base);
+    }
+    return 0;
+}
+
+static void
+YYERROR_DECL()
+{
+    fprintf(stderr, "%s\n", s);
+}
+
+int
+YYLEX_DECL()
+{
+	/* lexical analysis routine */
+	/* returns LETTER for a lower case letter, yylval =3D 0 through 25 */
+	/* return DIGIT for a digit, yylval =3D 0 through 9 */
+	/* all other characters are returned immediately */
+
+    int c;
+
+    while( (c=3Dgetchar()) =3D=3D ' ' )   { /* skip blanks */ }
+
+    /* c is now nonblank */
+
+    if( islower( c )) {
+	yylval =3D c - 'a';
+	return ( LETTER );
+    }
+    if( isdigit( c )) {
+	yylval =3D (c - '0') % (*base);
+	return ( DIGIT );
+    }
+    return( c );
+}
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/test/calc3.output
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/test/calc3.output	Wed Jul 25 16:21:35 2012 +0300
@@ -0,0 +1,461 @@
+   0  $accept : list $end
+
+   1  list :
+   2       | list stat '\n'
+   3       | list error '\n'
+
+   4  stat : expr
+   5       | LETTER '=3D' expr
+
+   6  expr : '(' expr ')'
+   7       | expr '+' expr
+   8       | expr '-' expr
+   9       | expr '*' expr
+  10       | expr '/' expr
+  11       | expr '%' expr
+  12       | expr '&' expr
+  13       | expr '|' expr
+  14       | '-' expr
+  15       | LETTER
+  16       | number
+
+  17  number : DIGIT
+  18         | number DIGIT
+=0C
+state 0
+	$accept : . list $end  (0)
+	list : .  (1)
+
+	.  reduce 1
+
+	list  goto 1
+
+
+state 1
+	$accept : list . $end  (0)
+	list : list . stat '\n'  (2)
+	list : list . error '\n'  (3)
+
+	$end  accept
+	error  shift 2
+	DIGIT  shift 3
+	LETTER  shift 4
+	'-'  shift 5
+	'('  shift 6
+	.  error
+
+	stat  goto 7
+	expr  goto 8
+	number  goto 9
+
+
+state 2
+	list : list error . '\n'  (3)
+
+	'\n'  shift 10
+	.  error
+
+
+state 3
+	number : DIGIT .  (17)
+
+	.  reduce 17
+
+
+state 4
+	stat : LETTER . '=3D' expr  (5)
+	expr : LETTER .  (15)
+
+	'=3D'  shift 11
+	'|'  reduce 15
+	'&'  reduce 15
+	'+'  reduce 15
+	'-'  reduce 15
+	'*'  reduce 15
+	'/'  reduce 15
+	'%'  reduce 15
+	'\n'  reduce 15
+
+
+state 5
+	expr : '-' . expr  (14)
+
+	DIGIT  shift 3
+	LETTER  shift 12
+	'-'  shift 5
+	'('  shift 6
+	.  error
+
+	expr  goto 13
+	number  goto 9
+
+
+state 6
+	expr : '(' . expr ')'  (6)
+
+	DIGIT  shift 3
+	LETTER  shift 12
+	'-'  shift 5
+	'('  shift 6
+	.  error
+
+	expr  goto 14
+	number  goto 9
+
+
+state 7
+	list : list stat . '\n'  (2)
+
+	'\n'  shift 15
+	.  error
+
+
+state 8
+	stat : expr .  (4)
+	expr : expr . '+' expr  (7)
+	expr : expr . '-' expr  (8)
+	expr : expr . '*' expr  (9)
+	expr : expr . '/' expr  (10)
+	expr : expr . '%' expr  (11)
+	expr : expr . '&' expr  (12)
+	expr : expr . '|' expr  (13)
+
+	'|'  shift 16
+	'&'  shift 17
+	'+'  shift 18
+	'-'  shift 19
+	'*'  shift 20
+	'/'  shift 21
+	'%'  shift 22
+	'\n'  reduce 4
+
+
+state 9
+	expr : number .  (16)
+	number : number . DIGIT  (18)
+
+	DIGIT  shift 23
+	'|'  reduce 16
+	'&'  reduce 16
+	'+'  reduce 16
+	'-'  reduce 16
+	'*'  reduce 16
+	'/'  reduce 16
+	'%'  reduce 16
+	'\n'  reduce 16
+	')'  reduce 16
+
+
+state 10
+	list : list error '\n' .  (3)
+
+	.  reduce 3
+
+
+state 11
+	stat : LETTER '=3D' . expr  (5)
+
+	DIGIT  shift 3
+	LETTER  shift 12
+	'-'  shift 5
+	'('  shift 6
+	.  error
+
+	expr  goto 24
+	number  goto 9
+
+
+state 12
+	expr : LETTER .  (15)
+
+	.  reduce 15
+
+
+state 13
+	expr : expr . '+' expr  (7)
+	expr : expr . '-' expr  (8)
+	expr : expr . '*' expr  (9)
+	expr : expr . '/' expr  (10)
+	expr : expr . '%' expr  (11)
+	expr : expr . '&' expr  (12)
+	expr : expr . '|' expr  (13)
+	expr : '-' expr .  (14)
+
+	.  reduce 14
+
+
+state 14
+	expr : '(' expr . ')'  (6)
+	expr : expr . '+' expr  (7)
+	expr : expr . '-' expr  (8)
+	expr : expr . '*' expr  (9)
+	expr : expr . '/' expr  (10)
+	expr : expr . '%' expr  (11)
+	expr : expr . '&' expr  (12)
+	expr : expr . '|' expr  (13)
+
+	'|'  shift 16
+	'&'  shift 17
+	'+'  shift 18
+	'-'  shift 19
+	'*'  shift 20
+	'/'  shift 21
+	'%'  shift 22
+	')'  shift 25
+	.  error
+
+
+state 15
+	list : list stat '\n' .  (2)
+
+	.  reduce 2
+
+
+state 16
+	expr : expr '|' . expr  (13)
+
+	DIGIT  shift 3
+	LETTER  shift 12
+	'-'  shift 5
+	'('  shift 6
+	.  error
+
+	expr  goto 26
+	number  goto 9
+
+
+state 17
+	expr : expr '&' . expr  (12)
+
+	DIGIT  shift 3
+	LETTER  shift 12
+	'-'  shift 5
+	'('  shift 6
+	.  error
+
+	expr  goto 27
+	number  goto 9
+
+
+state 18
+	expr : expr '+' . expr  (7)
+
+	DIGIT  shift 3
+	LETTER  shift 12
+	'-'  shift 5
+	'('  shift 6
+	.  error
+
+	expr  goto 28
+	number  goto 9
+
+
+state 19
+	expr : expr '-' . expr  (8)
+
+	DIGIT  shift 3
+	LETTER  shift 12
+	'-'  shift 5
+	'('  shift 6
+	.  error
+
+	expr  goto 29
+	number  goto 9
+
+
+state 20
+	expr : expr '*' . expr  (9)
+
+	DIGIT  shift 3
+	LETTER  shift 12
+	'-'  shift 5
+	'('  shift 6
+	.  error
+
+	expr  goto 30
+	number  goto 9
+
+
+state 21
+	expr : expr '/' . expr  (10)
+
+	DIGIT  shift 3
+	LETTER  shift 12
+	'-'  shift 5
+	'('  shift 6
+	.  error
+
+	expr  goto 31
+	number  goto 9
+
+
+state 22
+	expr : expr '%' . expr  (11)
+
+	DIGIT  shift 3
+	LETTER  shift 12
+	'-'  shift 5
+	'('  shift 6
+	.  error
+
+	expr  goto 32
+	number  goto 9
+
+
+state 23
+	number : number DIGIT .  (18)
+
+	.  reduce 18
+
+
+state 24
+	stat : LETTER '=3D' expr .  (5)
+	expr : expr . '+' expr  (7)
+	expr : expr . '-' expr  (8)
+	expr : expr . '*' expr  (9)
+	expr : expr . '/' expr  (10)
+	expr : expr . '%' expr  (11)
+	expr : expr . '&' expr  (12)
+	expr : expr . '|' expr  (13)
+
+	'|'  shift 16
+	'&'  shift 17
+	'+'  shift 18
+	'-'  shift 19
+	'*'  shift 20
+	'/'  shift 21
+	'%'  shift 22
+	'\n'  reduce 5
+
+
+state 25
+	expr : '(' expr ')' .  (6)
+
+	.  reduce 6
+
+
+state 26
+	expr : expr . '+' expr  (7)
+	expr : expr . '-' expr  (8)
+	expr : expr . '*' expr  (9)
+	expr : expr . '/' expr  (10)
+	expr : expr . '%' expr  (11)
+	expr : expr . '&' expr  (12)
+	expr : expr . '|' expr  (13)
+	expr : expr '|' expr .  (13)
+
+	'&'  shift 17
+	'+'  shift 18
+	'-'  shift 19
+	'*'  shift 20
+	'/'  shift 21
+	'%'  shift 22
+	'|'  reduce 13
+	'\n'  reduce 13
+	')'  reduce 13
+
+
+state 27
+	expr : expr . '+' expr  (7)
+	expr : expr . '-' expr  (8)
+	expr : expr . '*' expr  (9)
+	expr : expr . '/' expr  (10)
+	expr : expr . '%' expr  (11)
+	expr : expr . '&' expr  (12)
+	expr : expr '&' expr .  (12)
+	expr : expr . '|' expr  (13)
+
+	'+'  shift 18
+	'-'  shift 19
+	'*'  shift 20
+	'/'  shift 21
+	'%'  shift 22
+	'|'  reduce 12
+	'&'  reduce 12
+	'\n'  reduce 12
+	')'  reduce 12
+
+
+state 28
+	expr : expr . '+' expr  (7)
+	expr : expr '+' expr .  (7)
+	expr : expr . '-' expr  (8)
+	expr : expr . '*' expr  (9)
+	expr : expr . '/' expr  (10)
+	expr : expr . '%' expr  (11)
+	expr : expr . '&' expr  (12)
+	expr : expr . '|' expr  (13)
+
+	'*'  shift 20
+	'/'  shift 21
+	'%'  shift 22
+	'|'  reduce 7
+	'&'  reduce 7
+	'+'  reduce 7
+	'-'  reduce 7
+	'\n'  reduce 7
+	')'  reduce 7
+
+
+state 29
+	expr : expr . '+' expr  (7)
+	expr : expr . '-' expr  (8)
+	expr : expr '-' expr .  (8)
+	expr : expr . '*' expr  (9)
+	expr : expr . '/' expr  (10)
+	expr : expr . '%' expr  (11)
+	expr : expr . '&' expr  (12)
+	expr : expr . '|' expr  (13)
+
+	'*'  shift 20
+	'/'  shift 21
+	'%'  shift 22
+	'|'  reduce 8
+	'&'  reduce 8
+	'+'  reduce 8
+	'-'  reduce 8
+	'\n'  reduce 8
+	')'  reduce 8
+
+
+state 30
+	expr : expr . '+' expr  (7)
+	expr : expr . '-' expr  (8)
+	expr : expr . '*' expr  (9)
+	expr : expr '*' expr .  (9)
+	expr : expr . '/' expr  (10)
+	expr : expr . '%' expr  (11)
+	expr : expr . '&' expr  (12)
+	expr : expr . '|' expr  (13)
+
+	.  reduce 9
+
+
+state 31
+	expr : expr . '+' expr  (7)
+	expr : expr . '-' expr  (8)
+	expr : expr . '*' expr  (9)
+	expr : expr . '/' expr  (10)
+	expr : expr '/' expr .  (10)
+	expr : expr . '%' expr  (11)
+	expr : expr . '&' expr  (12)
+	expr : expr . '|' expr  (13)
+
+	.  reduce 10
+
+
+state 32
+	expr : expr . '+' expr  (7)
+	expr : expr . '-' expr  (8)
+	expr : expr . '*' expr  (9)
+	expr : expr . '/' expr  (10)
+	expr : expr . '%' expr  (11)
+	expr : expr '%' expr .  (11)
+	expr : expr . '&' expr  (12)
+	expr : expr . '|' expr  (13)
+
+	.  reduce 11
+
+
+16 terminals, 5 nonterminals
+19 grammar rules, 33 states
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/test/calc3.tab.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/test/calc3.tab.c	Wed Jul 25 16:21:35 2012 +0300
@@ -0,0 +1,687 @@
+#ifndef lint
+static const char yysccsid[] =3D "@(#)yaccpar	1.9 (Berkeley) 02/21/93";
+#endif
+
+#define YYBYACC 1
+#define YYMAJOR 1
+#define YYMINOR 9
+
+#define YYEMPTY        (-1)
+#define yyclearin      (yychar =3D YYEMPTY)
+#define yyerrok        (yyerrflag =3D 0)
+#define YYRECOVERING() (yyerrflag !=3D 0)
+
+
+#ifndef yyparse
+#define yyparse    calc3_parse
+#endif /* yyparse */
+
+#ifndef yylex
+#define yylex      calc3_lex
+#endif /* yylex */
+
+#ifndef yyerror
+#define yyerror    calc3_error
+#endif /* yyerror */
+
+#ifndef yychar
+#define yychar     calc3_char
+#endif /* yychar */
+
+#ifndef yyval
+#define yyval      calc3_val
+#endif /* yyval */
+
+#ifndef yylval
+#define yylval     calc3_lval
+#endif /* yylval */
+
+#ifndef yydebug
+#define yydebug    calc3_debug
+#endif /* yydebug */
+
+#ifndef yynerrs
+#define yynerrs    calc3_nerrs
+#endif /* yynerrs */
+
+#ifndef yyerrflag
+#define yyerrflag  calc3_errflag
+#endif /* yyerrflag */
+
+#ifndef yylhs
+#define yylhs      calc3_lhs
+#endif /* yylhs */
+
+#ifndef yylen
+#define yylen      calc3_len
+#endif /* yylen */
+
+#ifndef yydefred
+#define yydefred   calc3_defred
+#endif /* yydefred */
+
+#ifndef yydgoto
+#define yydgoto    calc3_dgoto
+#endif /* yydgoto */
+
+#ifndef yysindex
+#define yysindex   calc3_sindex
+#endif /* yysindex */
+
+#ifndef yyrindex
+#define yyrindex   calc3_rindex
+#endif /* yyrindex */
+
+#ifndef yygindex
+#define yygindex   calc3_gindex
+#endif /* yygindex */
+
+#ifndef yytable
+#define yytable    calc3_table
+#endif /* yytable */
+
+#ifndef yycheck
+#define yycheck    calc3_check
+#endif /* yycheck */
+
+#ifndef yyname
+#define yyname     calc3_name
+#endif /* yyname */
+
+#ifndef yyrule
+#define yyrule     calc3_rule
+#endif /* yyrule */
+#define YYPREFIX "calc3_"
+
+#define YYPURE 1
+
+#line 9 "calc3.y"
+# include <stdio.h>
+# include <ctype.h>
+
+#ifdef YYBISON
+#define YYSTYPE int
+#define YYLEX_PARAM base
+#define YYLEX_DECL() yylex(YYSTYPE *yylval, int *YYLEX_PARAM)
+#define YYERROR_DECL() yyerror(int regs[26], int *base, const char *s)
+int YYLEX_DECL();
+static void YYERROR_DECL();
+#endif
+
+#line 112 "calc3.tab.c"
+
+#ifndef YYSTYPE
+typedef int YYSTYPE;
+#endif
+
+/* compatibility with bison */
+#ifdef YYPARSE_PARAM
+/* compatibility with FreeBSD */
+# ifdef YYPARSE_PARAM_TYPE
+#  define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM)
+# else
+#  define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM)
+# endif
+#else
+# define YYPARSE_DECL() yyparse(int  regs[26], int * base)
+#endif
+
+/* Parameters sent to lex. */
+#ifdef YYLEX_PARAM
+# ifdef YYLEX_PARAM_TYPE
+#  define YYLEX_DECL() yylex(YYSTYPE *yylval, YYLEX_PARAM_TYPE YYLEX_PARAM)
+# else
+#  define YYLEX_DECL() yylex(YYSTYPE *yylval, void * YYLEX_PARAM)
+# endif
+# define YYLEX yylex(&yylval, YYLEX_PARAM)
+#else
+# define YYLEX_DECL() yylex(YYSTYPE *yylval, int * base)
+# define YYLEX yylex(&yylval, base)
+#endif
+
+/* Parameters sent to yyerror. */
+#ifndef YYERROR_DECL
+#define YYERROR_DECL() yyerror(int  regs[26], int * base, const char *s)
+#endif
+#ifndef YYERROR_CALL
+#define YYERROR_CALL(msg) yyerror(regs, base, msg)
+#endif
+
+extern int YYPARSE_DECL();
+
+#define DIGIT 257
+#define LETTER 258
+#define UMINUS 259
+#define YYERRCODE 256
+static const short calc3_lhs[] =3D {                       -1,
+    0,    0,    0,    1,    1,    2,    2,    2,    2,    2,
+    2,    2,    2,    2,    2,    2,    3,    3,
+};
+static const short calc3_len[] =3D {                        2,
+    0,    3,    3,    1,    3,    3,    3,    3,    3,    3,
+    3,    3,    3,    2,    1,    1,    1,    2,
+};
+static const short calc3_defred[] =3D {                     1,
+    0,    0,   17,    0,    0,    0,    0,    0,    0,    3,
+    0,   15,   14,    0,    2,    0,    0,    0,    0,    0,
+    0,    0,   18,    0,    6,    0,    0,    0,    0,    9,
+   10,   11,
+};
+static const short calc3_dgoto[] =3D {                      1,
+    7,    8,    9,
+};
+static const short calc3_sindex[] =3D {                     0,
+  -40,   -7,    0,  -55,  -38,  -38,    1,  -29, -247,    0,
+  -38,    0,    0,   22,    0,  -38,  -38,  -38,  -38,  -38,
+  -38,  -38,    0,  -29,    0,   51,   60,  -20,  -20,    0,
+    0,    0,
+};
+static const short calc3_rindex[] =3D {                     0,
+    0,    0,    0,    2,    0,    0,    0,    9,   -9,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,   10,    0,   -6,   14,    5,   13,    0,
+    0,    0,
+};
+static const short calc3_gindex[] =3D {                     0,
+    0,   65,    0,
+};
+#define YYTABLESIZE 220
+static const short calc3_table[] =3D {                      6,
+   16,    6,   10,   13,    5,   11,    5,   22,   17,   23,
+   15,   15,   20,   18,    7,   19,   22,   21,    4,    5,
+    0,   20,    8,   12,    0,    0,   21,   16,   16,    0,
+    0,   16,   16,   16,   13,   16,    0,   16,   15,   15,
+    0,    0,    7,   15,   15,    7,   15,    7,   15,    7,
+    8,   12,    0,    8,   12,    8,    0,    8,   22,   17,
+    0,    0,   25,   20,   18,    0,   19,    0,   21,   13,
+   14,    0,    0,    0,    0,   24,    0,    0,    0,    0,
+   26,   27,   28,   29,   30,   31,   32,   22,   17,    0,
+    0,    0,   20,   18,   16,   19,   22,   21,    0,    0,
+    0,   20,   18,    0,   19,    0,   21,    0,    0,    0,
+    0,    0,    0,    0,   16,    0,    0,   13,    0,    0,
+    0,    0,    0,    0,    0,   15,    0,    0,    7,    0,
+    0,    0,    0,    0,    0,    0,    8,   12,    0,    0,
+    0,    0,    0,    0,    0,   16,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    2,    3,    4,    3,   12,
+};
+static const short calc3_check[] =3D {                     40,
+   10,   40,   10,   10,   45,   61,   45,   37,   38,  257,
+   10,   10,   42,   43,   10,   45,   37,   47,   10,   10,
+   -1,   42,   10,   10,   -1,   -1,   47,   37,   38,   -1,
+   -1,   41,   42,   43,   41,   45,   -1,   47,   37,   38,
+   -1,   -1,   38,   42,   43,   41,   45,   43,   47,   45,
+   38,   38,   -1,   41,   41,   43,   -1,   45,   37,   38,
+   -1,   -1,   41,   42,   43,   -1,   45,   -1,   47,    5,
+    6,   -1,   -1,   -1,   -1,   11,   -1,   -1,   -1,   -1,
+   16,   17,   18,   19,   20,   21,   22,   37,   38,   -1,
+   -1,   -1,   42,   43,  124,   45,   37,   47,   -1,   -1,
+   -1,   42,   43,   -1,   45,   -1,   47,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,  124,   -1,   -1,  124,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,  124,   -1,   -1,  124,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,  124,  124,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,  124,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,  256,  257,  258,  257,  258,
+};
+#define YYFINAL 1
+#ifndef YYDEBUG
+#define YYDEBUG 0
+#endif
+#define YYMAXTOKEN 259
+#if YYDEBUG
+static const char *yyname[] =3D {
+
+"end-of-file",0,0,0,0,0,0,0,0,0,"'\\n'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,=
0,0,0,
+0,0,0,0,0,0,"'%'","'&'",0,"'('","')'","'*'","'+'",0,"'-'",0,"'/'",0,0,0,0,=
0,0,0,
+0,0,0,0,0,0,"'=3D'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,=
0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"'|'",0,0,0,=
0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,=
0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,=
0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,=
0,0,0,
+0,0,0,0,0,0,"DIGIT","LETTER","UMINUS",
+};
+static const char *yyrule[] =3D {
+"$accept : list",
+"list :",
+"list : list stat '\\n'",
+"list : list error '\\n'",
+"stat : expr",
+"stat : LETTER '=3D' expr",
+"expr : '(' expr ')'",
+"expr : expr '+' expr",
+"expr : expr '-' expr",
+"expr : expr '*' expr",
+"expr : expr '/' expr",
+"expr : expr '%' expr",
+"expr : expr '&' expr",
+"expr : expr '|' expr",
+"expr : '-' expr",
+"expr : LETTER",
+"expr : number",
+"number : DIGIT",
+"number : number DIGIT",
+
+};
+#endif
+
+int      yydebug;
+int      yynerrs;
+
+/* define the initial stack-sizes */
+#ifdef YYSTACKSIZE
+#undef YYMAXDEPTH
+#define YYMAXDEPTH  YYSTACKSIZE
+#else
+#ifdef YYMAXDEPTH
+#define YYSTACKSIZE YYMAXDEPTH
+#else
+#define YYSTACKSIZE 500
+#define YYMAXDEPTH  500
+#endif
+#endif
+
+#define YYINITSTACKSIZE 500
+
+typedef struct {
+    unsigned stacksize;
+    short    *s_base;
+    short    *s_mark;
+    short    *s_last;
+    YYSTYPE  *l_base;
+    YYSTYPE  *l_mark;
+} YYSTACKDATA;
+#line 76 "calc3.y"
+ /* start of programs */
+
+#ifdef YYBYACC
+extern int YYLEX_DECL();
+#endif
+
+int
+main (void)
+{
+    int regs[26];
+    int base =3D 10;
+
+    while(!feof(stdin)) {
+	yyparse(regs, &base);
+    }
+    return 0;
+}
+
+static void
+YYERROR_DECL()
+{
+    fprintf(stderr, "%s\n", s);
+}
+
+int
+YYLEX_DECL()
+{
+	/* lexical analysis routine */
+	/* returns LETTER for a lower case letter, yylval =3D 0 through 25 */
+	/* return DIGIT for a digit, yylval =3D 0 through 9 */
+	/* all other characters are returned immediately */
+
+    int c;
+
+    while( (c=3Dgetchar()) =3D=3D ' ' )   { /* skip blanks */ }
+
+    /* c is now nonblank */
+
+    if( islower( c )) {
+	*yylval =3D (c - 'a');
+	return ( LETTER );
+    }
+    if( isdigit( c )) {
+	*yylval =3D (c - '0') % (*base);
+	return ( DIGIT );
+    }
+    return( c );
+}
+#line 354 "calc3.tab.c"
+
+#if YYDEBUG
+#include <stdio.h>		/* needed for printf */
+#endif
+
+#include <stdlib.h>	/* needed for malloc, etc */
+#include <string.h>	/* needed for memset */
+
+/* allocate initial stack or double stack size, up to YYMAXDEPTH */
+static int yygrowstack(YYSTACKDATA *data)
+{
+    int i;
+    unsigned newsize;
+    short *newss;
+    YYSTYPE *newvs;
+
+    if ((newsize =3D data->stacksize) =3D=3D 0)
+        newsize =3D YYINITSTACKSIZE;
+    else if (newsize >=3D YYMAXDEPTH)
+        return -1;
+    else if ((newsize *=3D 2) > YYMAXDEPTH)
+        newsize =3D YYMAXDEPTH;
+
+    i =3D data->s_mark - data->s_base;
+    newss =3D (short *)realloc(data->s_base, newsize * sizeof(*newss));
+    if (newss =3D=3D 0)
+        return -1;
+
+    data->s_base =3D newss;
+    data->s_mark =3D newss + i;
+
+    newvs =3D (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));
+    if (newvs =3D=3D 0)
+        return -1;
+
+    data->l_base =3D newvs;
+    data->l_mark =3D newvs + i;
+
+    data->stacksize =3D newsize;
+    data->s_last =3D data->s_base + newsize - 1;
+    return 0;
+}
+
+#if YYPURE || defined(YY_NO_LEAKS)
+static void yyfreestack(YYSTACKDATA *data)
+{
+    free(data->s_base);
+    free(data->l_base);
+    memset(data, 0, sizeof(*data));
+}
+#else
+#define yyfreestack(data) /* nothing */
+#endif
+
+#define YYABORT  goto yyabort
+#define YYREJECT goto yyabort
+#define YYACCEPT goto yyaccept
+#define YYERROR  goto yyerrlab
+
+int
+YYPARSE_DECL()
+{
+    int      yyerrflag;
+    int      yychar;
+    YYSTYPE  yyval;
+    YYSTYPE  yylval;
+
+    /* variables for the parser stack */
+    YYSTACKDATA yystack;
+    int yym, yyn, yystate;
+#if YYDEBUG
+    const char *yys;
+
+    if ((yys =3D getenv("YYDEBUG")) !=3D 0)
+    {
+        yyn =3D *yys;
+        if (yyn >=3D '0' && yyn <=3D '9')
+            yydebug =3D yyn - '0';
+    }
+#endif
+
+    yynerrs =3D 0;
+    yyerrflag =3D 0;
+    yychar =3D YYEMPTY;
+    yystate =3D 0;
+
+#if YYPURE
+    memset(&yystack, 0, sizeof(yystack));
+#endif
+
+    if (yystack.s_base =3D=3D NULL && yygrowstack(&yystack)) goto yyoverfl=
ow;
+    yystack.s_mark =3D yystack.s_base;
+    yystack.l_mark =3D yystack.l_base;
+    yystate =3D 0;
+    *yystack.s_mark =3D 0;
+
+yyloop:
+    if ((yyn =3D yydefred[yystate]) !=3D 0) goto yyreduce;
+    if (yychar < 0)
+    {
+        if ((yychar =3D YYLEX) < 0) yychar =3D 0;
+#if YYDEBUG
+        if (yydebug)
+        {
+            yys =3D 0;
+            if (yychar <=3D YYMAXTOKEN) yys =3D yyname[yychar];
+            if (!yys) yys =3D "illegal-symbol";
+            printf("%sdebug: state %d, reading %d (%s)\n",
+                    YYPREFIX, yystate, yychar, yys);
+        }
+#endif
+    }
+    if ((yyn =3D yysindex[yystate]) && (yyn +=3D yychar) >=3D 0 &&
+            yyn <=3D YYTABLESIZE && yycheck[yyn] =3D=3D yychar)
+    {
+#if YYDEBUG
+        if (yydebug)
+            printf("%sdebug: state %d, shifting to state %d\n",
+                    YYPREFIX, yystate, yytable[yyn]);
+#endif
+        if (yystack.s_mark >=3D yystack.s_last && yygrowstack(&yystack))
+        {
+            goto yyoverflow;
+        }
+        yystate =3D yytable[yyn];
+        *++yystack.s_mark =3D yytable[yyn];
+        *++yystack.l_mark =3D yylval;
+        yychar =3D YYEMPTY;
+        if (yyerrflag > 0)  --yyerrflag;
+        goto yyloop;
+    }
+    if ((yyn =3D yyrindex[yystate]) && (yyn +=3D yychar) >=3D 0 &&
+            yyn <=3D YYTABLESIZE && yycheck[yyn] =3D=3D yychar)
+    {
+        yyn =3D yytable[yyn];
+        goto yyreduce;
+    }
+    if (yyerrflag) goto yyinrecovery;
+
+    yyerror(regs, base, "syntax error");
+
+    goto yyerrlab;
+
+yyerrlab:
+    ++yynerrs;
+
+yyinrecovery:
+    if (yyerrflag < 3)
+    {
+        yyerrflag =3D 3;
+        for (;;)
+        {
+            if ((yyn =3D yysindex[*yystack.s_mark]) && (yyn +=3D YYERRCODE=
) >=3D 0 &&
+                    yyn <=3D YYTABLESIZE && yycheck[yyn] =3D=3D YYERRCODE)
+            {
+#if YYDEBUG
+                if (yydebug)
+                    printf("%sdebug: state %d, error recovery shifting\
+ to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]);
+#endif
+                if (yystack.s_mark >=3D yystack.s_last && yygrowstack(&yys=
tack))
+                {
+                    goto yyoverflow;
+                }
+                yystate =3D yytable[yyn];
+                *++yystack.s_mark =3D yytable[yyn];
+                *++yystack.l_mark =3D yylval;
+                goto yyloop;
+            }
+            else
+            {
+#if YYDEBUG
+                if (yydebug)
+                    printf("%sdebug: error recovery discarding state %d\n",
+                            YYPREFIX, *yystack.s_mark);
+#endif
+                if (yystack.s_mark <=3D yystack.s_base) goto yyabort;
+                --yystack.s_mark;
+                --yystack.l_mark;
+            }
+        }
+    }
+    else
+    {
+        if (yychar =3D=3D 0) goto yyabort;
+#if YYDEBUG
+        if (yydebug)
+        {
+            yys =3D 0;
+            if (yychar <=3D YYMAXTOKEN) yys =3D yyname[yychar];
+            if (!yys) yys =3D "illegal-symbol";
+            printf("%sdebug: state %d, error recovery discards token %d (%=
s)\n",
+                    YYPREFIX, yystate, yychar, yys);
+        }
+#endif
+        yychar =3D YYEMPTY;
+        goto yyloop;
+    }
+
+yyreduce:
+#if YYDEBUG
+    if (yydebug)
+        printf("%sdebug: state %d, reducing by rule %d (%s)\n",
+                YYPREFIX, yystate, yyn, yyrule[yyn]);
+#endif
+    yym =3D yylen[yyn];
+    if (yym)
+        yyval =3D yystack.l_mark[1-yym];
+    else
+        memset(&yyval, 0, sizeof yyval);
+    switch (yyn)
+    {
+case 3:
+#line 38 "calc3.y"
+	{  yyerrok ; }
+break;
+case 4:
+#line 42 "calc3.y"
+	{  printf("%d\n",yystack.l_mark[0]);}
+break;
+case 5:
+#line 44 "calc3.y"
+	{  regs[yystack.l_mark[-2]] =3D yystack.l_mark[0]; }
+break;
+case 6:
+#line 48 "calc3.y"
+	{  yyval =3D yystack.l_mark[-1]; }
+break;
+case 7:
+#line 50 "calc3.y"
+	{  yyval =3D yystack.l_mark[-2] + yystack.l_mark[0]; }
+break;
+case 8:
+#line 52 "calc3.y"
+	{  yyval =3D yystack.l_mark[-2] - yystack.l_mark[0]; }
+break;
+case 9:
+#line 54 "calc3.y"
+	{  yyval =3D yystack.l_mark[-2] * yystack.l_mark[0]; }
+break;
+case 10:
+#line 56 "calc3.y"
+	{  yyval =3D yystack.l_mark[-2] / yystack.l_mark[0]; }
+break;
+case 11:
+#line 58 "calc3.y"
+	{  yyval =3D yystack.l_mark[-2] % yystack.l_mark[0]; }
+break;
+case 12:
+#line 60 "calc3.y"
+	{  yyval =3D yystack.l_mark[-2] & yystack.l_mark[0]; }
+break;
+case 13:
+#line 62 "calc3.y"
+	{  yyval =3D yystack.l_mark[-2] | yystack.l_mark[0]; }
+break;
+case 14:
+#line 64 "calc3.y"
+	{  yyval =3D - yystack.l_mark[0]; }
+break;
+case 15:
+#line 66 "calc3.y"
+	{  yyval =3D regs[yystack.l_mark[0]]; }
+break;
+case 17:
+#line 71 "calc3.y"
+	{  yyval =3D yystack.l_mark[0]; (*base) =3D (yystack.l_mark[0]=3D=3D0) ? =
8 : 10; }
+break;
+case 18:
+#line 73 "calc3.y"
+	{  yyval =3D (*base) * yystack.l_mark[-1] + yystack.l_mark[0]; }
+break;
+#line 627 "calc3.tab.c"
+    }
+    yystack.s_mark -=3D yym;
+    yystate =3D *yystack.s_mark;
+    yystack.l_mark -=3D yym;
+    yym =3D yylhs[yyn];
+    if (yystate =3D=3D 0 && yym =3D=3D 0)
+    {
+#if YYDEBUG
+        if (yydebug)
+            printf("%sdebug: after reduction, shifting from state 0 to\
+ state %d\n", YYPREFIX, YYFINAL);
+#endif
+        yystate =3D YYFINAL;
+        *++yystack.s_mark =3D YYFINAL;
+        *++yystack.l_mark =3D yyval;
+        if (yychar < 0)
+        {
+            if ((yychar =3D YYLEX) < 0) yychar =3D 0;
+#if YYDEBUG
+            if (yydebug)
+            {
+                yys =3D 0;
+                if (yychar <=3D YYMAXTOKEN) yys =3D yyname[yychar];
+                if (!yys) yys =3D "illegal-symbol";
+                printf("%sdebug: state %d, reading %d (%s)\n",
+                        YYPREFIX, YYFINAL, yychar, yys);
+            }
+#endif
+        }
+        if (yychar =3D=3D 0) goto yyaccept;
+        goto yyloop;
+    }
+    if ((yyn =3D yygindex[yym]) && (yyn +=3D yystate) >=3D 0 &&
+            yyn <=3D YYTABLESIZE && yycheck[yyn] =3D=3D yystate)
+        yystate =3D yytable[yyn];
+    else
+        yystate =3D yydgoto[yym];
+#if YYDEBUG
+    if (yydebug)
+        printf("%sdebug: after reduction, shifting from state %d \
+to state %d\n", YYPREFIX, *yystack.s_mark, yystate);
+#endif
+    if (yystack.s_mark >=3D yystack.s_last && yygrowstack(&yystack))
+    {
+        goto yyoverflow;
+    }
+    *++yystack.s_mark =3D (short) yystate;
+    *++yystack.l_mark =3D yyval;
+    goto yyloop;
+
+yyoverflow:
+    yyerror(regs, base, "yacc stack overflow");
+
+yyabort:
+    yyfreestack(&yystack);
+    return (1);
+
+yyaccept:
+    yyfreestack(&yystack);
+    return (0);
+}
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/test/calc3.tab.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/test/calc3.tab.h	Wed Jul 25 16:21:35 2012 +0300
@@ -0,0 +1,3 @@
+#define DIGIT 257
+#define LETTER 258
+#define UMINUS 259
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/test/calc3.y
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/test/calc3.y	Wed Jul 25 16:21:35 2012 +0300
@@ -0,0 +1,123 @@
+%pure-parser
+
+%parse-param { int regs[26] }
+%parse-param { int *base }
+
+%lex-param { int *base }
+
+%{
+# include <stdio.h>
+# include <ctype.h>
+
+#ifdef YYBISON
+#define YYSTYPE int
+#define YYLEX_PARAM base
+#define YYLEX_DECL() yylex(YYSTYPE *yylval, int *YYLEX_PARAM)
+#define YYERROR_DECL() yyerror(int regs[26], int *base, const char *s)
+int YYLEX_DECL();
+static void YYERROR_DECL();
+#endif
+
+%}
+
+%start list
+
+%token DIGIT LETTER
+
+%left '|'
+%left '&'
+%left '+' '-'
+%left '*' '/' '%'
+%left UMINUS   /* supplies precedence for unary minus */
+
+%% /* beginning of rules section */
+
+list  :  /* empty */
+      |  list stat '\n'
+      |  list error '\n'
+            {  yyerrok ; }
+      ;
+
+stat  :  expr
+            {  printf("%d\n",$1);}
+      |  LETTER '=3D' expr
+            {  regs[$1] =3D $3; }
+      ;
+
+expr  :  '(' expr ')'
+            {  $$ =3D $2; }
+      |  expr '+' expr
+            {  $$ =3D $1 + $3; }
+      |  expr '-' expr
+            {  $$ =3D $1 - $3; }
+      |  expr '*' expr
+            {  $$ =3D $1 * $3; }
+      |  expr '/' expr
+            {  $$ =3D $1 / $3; }
+      |  expr '%' expr
+            {  $$ =3D $1 % $3; }
+      |  expr '&' expr
+            {  $$ =3D $1 & $3; }
+      |  expr '|' expr
+            {  $$ =3D $1 | $3; }
+      |  '-' expr %prec UMINUS
+            {  $$ =3D - $2; }
+      |  LETTER
+            {  $$ =3D regs[$1]; }
+      |  number
+      ;
+
+number:  DIGIT
+         {  $$ =3D $1; (*base) =3D ($1=3D=3D0) ? 8 : 10; }
+      |  number DIGIT
+         {  $$ =3D (*base) * $1 + $2; }
+      ;
+
+%% /* start of programs */
+
+#ifdef YYBYACC
+extern int YYLEX_DECL();
+#endif
+
+int
+main (void)
+{
+    int regs[26];
+    int base =3D 10;
+
+    while(!feof(stdin)) {
+	yyparse(regs, &base);
+    }
+    return 0;
+}
+
+static void
+YYERROR_DECL()
+{
+    fprintf(stderr, "%s\n", s);
+}
+
+int
+YYLEX_DECL()
+{
+	/* lexical analysis routine */
+	/* returns LETTER for a lower case letter, yylval =3D 0 through 25 */
+	/* return DIGIT for a digit, yylval =3D 0 through 9 */
+	/* all other characters are returned immediately */
+
+    int c;
+
+    while( (c=3Dgetchar()) =3D=3D ' ' )   { /* skip blanks */ }
+
+    /* c is now nonblank */
+
+    if( islower( c )) {
+	*yylval =3D (c - 'a');
+	return ( LETTER );
+    }
+    if( isdigit( c )) {
+	*yylval =3D (c - '0') % (*base);
+	return ( DIGIT );
+    }
+    return( c );
+}
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/test/code_calc.code=
.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/test/code_calc.code.c	Wed Jul 25 16:21:35 2012 +03=
00
@@ -0,0 +1,580 @@
+#ifndef lint
+static const char yysccsid[] =3D "@(#)yaccpar	1.9 (Berkeley) 02/21/93";
+#endif
+
+#define YYBYACC 1
+#define YYMAJOR 1
+#define YYMINOR 9
+
+#define YYEMPTY        (-1)
+#define yyclearin      (yychar =3D YYEMPTY)
+#define yyerrok        (yyerrflag =3D 0)
+#define YYRECOVERING() (yyerrflag !=3D 0)
+
+
+#define YYPURE 0
+
+#line 2 "code_calc.y"
+# include <stdio.h>
+# include <ctype.h>
+
+int regs[26];
+int base;
+
+#ifdef YYBISON
+int yylex(void);
+static void yyerror(const char *s);
+#endif
+
+#line 30 "code_calc.code.c"
+
+#ifndef YYSTYPE
+typedef int YYSTYPE;
+#endif
+
+/* compatibility with bison */
+#ifdef YYPARSE_PARAM
+/* compatibility with FreeBSD */
+# ifdef YYPARSE_PARAM_TYPE
+#  define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM)
+# else
+#  define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM)
+# endif
+#else
+# define YYPARSE_DECL() yyparse(void)
+#endif
+
+/* Parameters sent to lex. */
+#ifdef YYLEX_PARAM
+# define YYLEX_DECL() yylex(void *YYLEX_PARAM)
+# define YYLEX yylex(YYLEX_PARAM)
+#else
+# define YYLEX_DECL() yylex(void)
+# define YYLEX yylex()
+#endif
+
+/* Parameters sent to yyerror. */
+#ifndef YYERROR_DECL
+#define YYERROR_DECL() yyerror(const char *s)
+#endif
+#ifndef YYERROR_CALL
+#define YYERROR_CALL(msg) yyerror(msg)
+#endif
+
+extern int YYPARSE_DECL();
+
+#define DIGIT 257
+#define LETTER 258
+#define UMINUS 259
+#define YYERRCODE 256
+#define YYTABLESIZE 220
+#define YYFINAL 1
+#ifndef YYDEBUG
+#define YYDEBUG 0
+#endif
+#define YYMAXTOKEN 259
+
+#ifndef yyparse
+#define yyparse    calc_parse
+#endif /* yyparse */
+
+#ifndef yylex
+#define yylex      calc_lex
+#endif /* yylex */
+
+#ifndef yyerror
+#define yyerror    calc_error
+#endif /* yyerror */
+
+#ifndef yychar
+#define yychar     calc_char
+#endif /* yychar */
+
+#ifndef yyval
+#define yyval      calc_val
+#endif /* yyval */
+
+#ifndef yylval
+#define yylval     calc_lval
+#endif /* yylval */
+
+#ifndef yydebug
+#define yydebug    calc_debug
+#endif /* yydebug */
+
+#ifndef yynerrs
+#define yynerrs    calc_nerrs
+#endif /* yynerrs */
+
+#ifndef yyerrflag
+#define yyerrflag  calc_errflag
+#endif /* yyerrflag */
+
+#ifndef yylhs
+#define yylhs      calc_lhs
+#endif /* yylhs */
+
+#ifndef yylen
+#define yylen      calc_len
+#endif /* yylen */
+
+#ifndef yydefred
+#define yydefred   calc_defred
+#endif /* yydefred */
+
+#ifndef yydgoto
+#define yydgoto    calc_dgoto
+#endif /* yydgoto */
+
+#ifndef yysindex
+#define yysindex   calc_sindex
+#endif /* yysindex */
+
+#ifndef yyrindex
+#define yyrindex   calc_rindex
+#endif /* yyrindex */
+
+#ifndef yygindex
+#define yygindex   calc_gindex
+#endif /* yygindex */
+
+#ifndef yytable
+#define yytable    calc_table
+#endif /* yytable */
+
+#ifndef yycheck
+#define yycheck    calc_check
+#endif /* yycheck */
+
+#ifndef yyname
+#define yyname     calc_name
+#endif /* yyname */
+
+#ifndef yyrule
+#define yyrule     calc_rule
+#endif /* yyrule */
+#define YYPREFIX "calc_"
+
+extern int YYPARSE_DECL();
+extern short yylhs[];
+extern short yylen[];
+extern short yydefred[];
+extern short yydgoto[];
+extern short yysindex[];
+extern short yyrindex[];
+extern short yygindex[];
+extern short yytable[];
+extern short yycheck[];
+
+#if YYDEBUG
+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
+#define YYMAXDEPTH  YYSTACKSIZE
+#else
+#ifdef YYMAXDEPTH
+#define YYSTACKSIZE YYMAXDEPTH
+#else
+#define YYSTACKSIZE 500
+#define YYMAXDEPTH  500
+#endif
+#endif
+
+#define YYINITSTACKSIZE 500
+
+typedef struct {
+    unsigned stacksize;
+    short    *s_base;
+    short    *s_mark;
+    short    *s_last;
+    YYSTYPE  *l_base;
+    YYSTYPE  *l_mark;
+} YYSTACKDATA;
+/* variables for the parser stack */
+static YYSTACKDATA yystack;
+#line 68 "code_calc.y"
+ /* start of programs */
+
+#ifdef YYBYACC
+extern int YYLEX_DECL();
+#endif
+
+int
+main (void)
+{
+    while(!feof(stdin)) {
+	yyparse();
+    }
+    return 0;
+}
+
+static void
+yyerror(const char *s)
+{
+    fprintf(stderr, "%s\n", s);
+}
+
+int
+yylex(void)
+{
+	/* lexical analysis routine */
+	/* returns LETTER for a lower case letter, yylval =3D 0 through 25 */
+	/* return DIGIT for a digit, yylval =3D 0 through 9 */
+	/* all other characters are returned immediately */
+
+    int c;
+
+    while( (c=3Dgetchar()) =3D=3D ' ' )   { /* skip blanks */ }
+
+    /* c is now nonblank */
+
+    if( islower( c )) {
+	yylval =3D c - 'a';
+	return ( LETTER );
+    }
+    if( isdigit( c )) {
+	yylval =3D c - '0';
+	return ( DIGIT );
+    }
+    return( c );
+}
+#line 254 "code_calc.code.c"
+
+#if YYDEBUG
+#include <stdio.h>		/* needed for printf */
+#endif
+
+#include <stdlib.h>	/* needed for malloc, etc */
+#include <string.h>	/* needed for memset */
+
+/* allocate initial stack or double stack size, up to YYMAXDEPTH */
+static int yygrowstack(YYSTACKDATA *data)
+{
+    int i;
+    unsigned newsize;
+    short *newss;
+    YYSTYPE *newvs;
+
+    if ((newsize =3D data->stacksize) =3D=3D 0)
+        newsize =3D YYINITSTACKSIZE;
+    else if (newsize >=3D YYMAXDEPTH)
+        return -1;
+    else if ((newsize *=3D 2) > YYMAXDEPTH)
+        newsize =3D YYMAXDEPTH;
+
+    i =3D data->s_mark - data->s_base;
+    newss =3D (short *)realloc(data->s_base, newsize * sizeof(*newss));
+    if (newss =3D=3D 0)
+        return -1;
+
+    data->s_base =3D newss;
+    data->s_mark =3D newss + i;
+
+    newvs =3D (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));
+    if (newvs =3D=3D 0)
+        return -1;
+
+    data->l_base =3D newvs;
+    data->l_mark =3D newvs + i;
+
+    data->stacksize =3D newsize;
+    data->s_last =3D data->s_base + newsize - 1;
+    return 0;
+}
+
+#if YYPURE || defined(YY_NO_LEAKS)
+static void yyfreestack(YYSTACKDATA *data)
+{
+    free(data->s_base);
+    free(data->l_base);
+    memset(data, 0, sizeof(*data));
+}
+#else
+#define yyfreestack(data) /* nothing */
+#endif
+
+#define YYABORT  goto yyabort
+#define YYREJECT goto yyabort
+#define YYACCEPT goto yyaccept
+#define YYERROR  goto yyerrlab
+
+int
+YYPARSE_DECL()
+{
+    int yym, yyn, yystate;
+#if YYDEBUG
+    const char *yys;
+
+    if ((yys =3D getenv("YYDEBUG")) !=3D 0)
+    {
+        yyn =3D *yys;
+        if (yyn >=3D '0' && yyn <=3D '9')
+            yydebug =3D yyn - '0';
+    }
+#endif
+
+    yynerrs =3D 0;
+    yyerrflag =3D 0;
+    yychar =3D YYEMPTY;
+    yystate =3D 0;
+
+#if YYPURE
+    memset(&yystack, 0, sizeof(yystack));
+#endif
+
+    if (yystack.s_base =3D=3D NULL && yygrowstack(&yystack)) goto yyoverfl=
ow;
+    yystack.s_mark =3D yystack.s_base;
+    yystack.l_mark =3D yystack.l_base;
+    yystate =3D 0;
+    *yystack.s_mark =3D 0;
+
+yyloop:
+    if ((yyn =3D yydefred[yystate]) !=3D 0) goto yyreduce;
+    if (yychar < 0)
+    {
+        if ((yychar =3D YYLEX) < 0) yychar =3D 0;
+#if YYDEBUG
+        if (yydebug)
+        {
+            yys =3D 0;
+            if (yychar <=3D YYMAXTOKEN) yys =3D yyname[yychar];
+            if (!yys) yys =3D "illegal-symbol";
+            printf("%sdebug: state %d, reading %d (%s)\n",
+                    YYPREFIX, yystate, yychar, yys);
+        }
+#endif
+    }
+    if ((yyn =3D yysindex[yystate]) && (yyn +=3D yychar) >=3D 0 &&
+            yyn <=3D YYTABLESIZE && yycheck[yyn] =3D=3D yychar)
+    {
+#if YYDEBUG
+        if (yydebug)
+            printf("%sdebug: state %d, shifting to state %d\n",
+                    YYPREFIX, yystate, yytable[yyn]);
+#endif
+        if (yystack.s_mark >=3D yystack.s_last && yygrowstack(&yystack))
+        {
+            goto yyoverflow;
+        }
+        yystate =3D yytable[yyn];
+        *++yystack.s_mark =3D yytable[yyn];
+        *++yystack.l_mark =3D yylval;
+        yychar =3D YYEMPTY;
+        if (yyerrflag > 0)  --yyerrflag;
+        goto yyloop;
+    }
+    if ((yyn =3D yyrindex[yystate]) && (yyn +=3D yychar) >=3D 0 &&
+            yyn <=3D YYTABLESIZE && yycheck[yyn] =3D=3D yychar)
+    {
+        yyn =3D yytable[yyn];
+        goto yyreduce;
+    }
+    if (yyerrflag) goto yyinrecovery;
+
+    yyerror("syntax error");
+
+    goto yyerrlab;
+
+yyerrlab:
+    ++yynerrs;
+
+yyinrecovery:
+    if (yyerrflag < 3)
+    {
+        yyerrflag =3D 3;
+        for (;;)
+        {
+            if ((yyn =3D yysindex[*yystack.s_mark]) && (yyn +=3D YYERRCODE=
) >=3D 0 &&
+                    yyn <=3D YYTABLESIZE && yycheck[yyn] =3D=3D YYERRCODE)
+            {
+#if YYDEBUG
+                if (yydebug)
+                    printf("%sdebug: state %d, error recovery shifting\
+ to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]);
+#endif
+                if (yystack.s_mark >=3D yystack.s_last && yygrowstack(&yys=
tack))
+                {
+                    goto yyoverflow;
+                }
+                yystate =3D yytable[yyn];
+                *++yystack.s_mark =3D yytable[yyn];
+                *++yystack.l_mark =3D yylval;
+                goto yyloop;
+            }
+            else
+            {
+#if YYDEBUG
+                if (yydebug)
+                    printf("%sdebug: error recovery discarding state %d\n",
+                            YYPREFIX, *yystack.s_mark);
+#endif
+                if (yystack.s_mark <=3D yystack.s_base) goto yyabort;
+                --yystack.s_mark;
+                --yystack.l_mark;
+            }
+        }
+    }
+    else
+    {
+        if (yychar =3D=3D 0) goto yyabort;
+#if YYDEBUG
+        if (yydebug)
+        {
+            yys =3D 0;
+            if (yychar <=3D YYMAXTOKEN) yys =3D yyname[yychar];
+            if (!yys) yys =3D "illegal-symbol";
+            printf("%sdebug: state %d, error recovery discards token %d (%=
s)\n",
+                    YYPREFIX, yystate, yychar, yys);
+        }
+#endif
+        yychar =3D YYEMPTY;
+        goto yyloop;
+    }
+
+yyreduce:
+#if YYDEBUG
+    if (yydebug)
+        printf("%sdebug: state %d, reducing by rule %d (%s)\n",
+                YYPREFIX, yystate, yyn, yyrule[yyn]);
+#endif
+    yym =3D yylen[yyn];
+    if (yym)
+        yyval =3D yystack.l_mark[1-yym];
+    else
+        memset(&yyval, 0, sizeof yyval);
+    switch (yyn)
+    {
+case 3:
+#line 30 "code_calc.y"
+	{  yyerrok ; }
+break;
+case 4:
+#line 34 "code_calc.y"
+	{  printf("%d\n",yystack.l_mark[0]);}
+break;
+case 5:
+#line 36 "code_calc.y"
+	{  regs[yystack.l_mark[-2]] =3D yystack.l_mark[0]; }
+break;
+case 6:
+#line 40 "code_calc.y"
+	{  yyval =3D yystack.l_mark[-1]; }
+break;
+case 7:
+#line 42 "code_calc.y"
+	{  yyval =3D yystack.l_mark[-2] + yystack.l_mark[0]; }
+break;
+case 8:
+#line 44 "code_calc.y"
+	{  yyval =3D yystack.l_mark[-2] - yystack.l_mark[0]; }
+break;
+case 9:
+#line 46 "code_calc.y"
+	{  yyval =3D yystack.l_mark[-2] * yystack.l_mark[0]; }
+break;
+case 10:
+#line 48 "code_calc.y"
+	{  yyval =3D yystack.l_mark[-2] / yystack.l_mark[0]; }
+break;
+case 11:
+#line 50 "code_calc.y"
+	{  yyval =3D yystack.l_mark[-2] % yystack.l_mark[0]; }
+break;
+case 12:
+#line 52 "code_calc.y"
+	{  yyval =3D yystack.l_mark[-2] & yystack.l_mark[0]; }
+break;
+case 13:
+#line 54 "code_calc.y"
+	{  yyval =3D yystack.l_mark[-2] | yystack.l_mark[0]; }
+break;
+case 14:
+#line 56 "code_calc.y"
+	{  yyval =3D - yystack.l_mark[0]; }
+break;
+case 15:
+#line 58 "code_calc.y"
+	{  yyval =3D regs[yystack.l_mark[0]]; }
+break;
+case 17:
+#line 63 "code_calc.y"
+	{  yyval =3D yystack.l_mark[0]; base =3D (yystack.l_mark[0]=3D=3D0) ? 8 :=
 10; }
+break;
+case 18:
+#line 65 "code_calc.y"
+	{  yyval =3D base * yystack.l_mark[-1] + yystack.l_mark[0]; }
+break;
+#line 520 "code_calc.code.c"
+    }
+    yystack.s_mark -=3D yym;
+    yystate =3D *yystack.s_mark;
+    yystack.l_mark -=3D yym;
+    yym =3D yylhs[yyn];
+    if (yystate =3D=3D 0 && yym =3D=3D 0)
+    {
+#if YYDEBUG
+        if (yydebug)
+            printf("%sdebug: after reduction, shifting from state 0 to\
+ state %d\n", YYPREFIX, YYFINAL);
+#endif
+        yystate =3D YYFINAL;
+        *++yystack.s_mark =3D YYFINAL;
+        *++yystack.l_mark =3D yyval;
+        if (yychar < 0)
+        {
+            if ((yychar =3D YYLEX) < 0) yychar =3D 0;
+#if YYDEBUG
+            if (yydebug)
+            {
+                yys =3D 0;
+                if (yychar <=3D YYMAXTOKEN) yys =3D yyname[yychar];
+                if (!yys) yys =3D "illegal-symbol";
+                printf("%sdebug: state %d, reading %d (%s)\n",
+                        YYPREFIX, YYFINAL, yychar, yys);
+            }
+#endif
+        }
+        if (yychar =3D=3D 0) goto yyaccept;
+        goto yyloop;
+    }
+    if ((yyn =3D yygindex[yym]) && (yyn +=3D yystate) >=3D 0 &&
+            yyn <=3D YYTABLESIZE && yycheck[yyn] =3D=3D yystate)
+        yystate =3D yytable[yyn];
+    else
+        yystate =3D yydgoto[yym];
+#if YYDEBUG
+    if (yydebug)
+        printf("%sdebug: after reduction, shifting from state %d \
+to state %d\n", YYPREFIX, *yystack.s_mark, yystate);
+#endif
+    if (yystack.s_mark >=3D yystack.s_last && yygrowstack(&yystack))
+    {
+        goto yyoverflow;
+    }
+    *++yystack.s_mark =3D (short) yystate;
+    *++yystack.l_mark =3D yyval;
+    goto yyloop;
+
+yyoverflow:
+    yyerror("yacc stack overflow");
+
+yyabort:
+    yyfreestack(&yystack);
+    return (1);
+
+yyaccept:
+    yyfreestack(&yystack);
+    return (0);
+}
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/test/code_calc.outp=
ut
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/test/code_calc.output	Wed Jul 25 16:21:35 2012 +03=
00
@@ -0,0 +1,461 @@
+   0  $accept : list $end
+
+   1  list :
+   2       | list stat '\n'
+   3       | list error '\n'
+
+   4  stat : expr
+   5       | LETTER '=3D' expr
+
+   6  expr : '(' expr ')'
+   7       | expr '+' expr
+   8       | expr '-' expr
+   9       | expr '*' expr
+  10       | expr '/' expr
+  11       | expr '%' expr
+  12       | expr '&' expr
+  13       | expr '|' expr
+  14       | '-' expr
+  15       | LETTER
+  16       | number
+
+  17  number : DIGIT
+  18         | number DIGIT
+=0C
+state 0
+	$accept : . list $end  (0)
+	list : .  (1)
+
+	.  reduce 1
+
+	list  goto 1
+
+
+state 1
+	$accept : list . $end  (0)
+	list : list . stat '\n'  (2)
+	list : list . error '\n'  (3)
+
+	$end  accept
+	error  shift 2
+	DIGIT  shift 3
+	LETTER  shift 4
+	'-'  shift 5
+	'('  shift 6
+	.  error
+
+	stat  goto 7
+	expr  goto 8
+	number  goto 9
+
+
+state 2
+	list : list error . '\n'  (3)
+
+	'\n'  shift 10
+	.  error
+
+
+state 3
+	number : DIGIT .  (17)
+
+	.  reduce 17
+
+
+state 4
+	stat : LETTER . '=3D' expr  (5)
+	expr : LETTER .  (15)
+
+	'=3D'  shift 11
+	'|'  reduce 15
+	'&'  reduce 15
+	'+'  reduce 15
+	'-'  reduce 15
+	'*'  reduce 15
+	'/'  reduce 15
+	'%'  reduce 15
+	'\n'  reduce 15
+
+
+state 5
+	expr : '-' . expr  (14)
+
+	DIGIT  shift 3
+	LETTER  shift 12
+	'-'  shift 5
+	'('  shift 6
+	.  error
+
+	expr  goto 13
+	number  goto 9
+
+
+state 6
+	expr : '(' . expr ')'  (6)
+
+	DIGIT  shift 3
+	LETTER  shift 12
+	'-'  shift 5
+	'('  shift 6
+	.  error
+
+	expr  goto 14
+	number  goto 9
+
+
+state 7
+	list : list stat . '\n'  (2)
+
+	'\n'  shift 15
+	.  error
+
+
+state 8
+	stat : expr .  (4)
+	expr : expr . '+' expr  (7)
+	expr : expr . '-' expr  (8)
+	expr : expr . '*' expr  (9)
+	expr : expr . '/' expr  (10)
+	expr : expr . '%' expr  (11)
+	expr : expr . '&' expr  (12)
+	expr : expr . '|' expr  (13)
+
+	'|'  shift 16
+	'&'  shift 17
+	'+'  shift 18
+	'-'  shift 19
+	'*'  shift 20
+	'/'  shift 21
+	'%'  shift 22
+	'\n'  reduce 4
+
+
+state 9
+	expr : number .  (16)
+	number : number . DIGIT  (18)
+
+	DIGIT  shift 23
+	'|'  reduce 16
+	'&'  reduce 16
+	'+'  reduce 16
+	'-'  reduce 16
+	'*'  reduce 16
+	'/'  reduce 16
+	'%'  reduce 16
+	'\n'  reduce 16
+	')'  reduce 16
+
+
+state 10
+	list : list error '\n' .  (3)
+
+	.  reduce 3
+
+
+state 11
+	stat : LETTER '=3D' . expr  (5)
+
+	DIGIT  shift 3
+	LETTER  shift 12
+	'-'  shift 5
+	'('  shift 6
+	.  error
+
+	expr  goto 24
+	number  goto 9
+
+
+state 12
+	expr : LETTER .  (15)
+
+	.  reduce 15
+
+
+state 13
+	expr : expr . '+' expr  (7)
+	expr : expr . '-' expr  (8)
+	expr : expr . '*' expr  (9)
+	expr : expr . '/' expr  (10)
+	expr : expr . '%' expr  (11)
+	expr : expr . '&' expr  (12)
+	expr : expr . '|' expr  (13)
+	expr : '-' expr .  (14)
+
+	.  reduce 14
+
+
+state 14
+	expr : '(' expr . ')'  (6)
+	expr : expr . '+' expr  (7)
+	expr : expr . '-' expr  (8)
+	expr : expr . '*' expr  (9)
+	expr : expr . '/' expr  (10)
+	expr : expr . '%' expr  (11)
+	expr : expr . '&' expr  (12)
+	expr : expr . '|' expr  (13)
+
+	'|'  shift 16
+	'&'  shift 17
+	'+'  shift 18
+	'-'  shift 19
+	'*'  shift 20
+	'/'  shift 21
+	'%'  shift 22
+	')'  shift 25
+	.  error
+
+
+state 15
+	list : list stat '\n' .  (2)
+
+	.  reduce 2
+
+
+state 16
+	expr : expr '|' . expr  (13)
+
+	DIGIT  shift 3
+	LETTER  shift 12
+	'-'  shift 5
+	'('  shift 6
+	.  error
+
+	expr  goto 26
+	number  goto 9
+
+
+state 17
+	expr : expr '&' . expr  (12)
+
+	DIGIT  shift 3
+	LETTER  shift 12
+	'-'  shift 5
+	'('  shift 6
+	.  error
+
+	expr  goto 27
+	number  goto 9
+
+
+state 18
+	expr : expr '+' . expr  (7)
+
+	DIGIT  shift 3
+	LETTER  shift 12
+	'-'  shift 5
+	'('  shift 6
+	.  error
+
+	expr  goto 28
+	number  goto 9
+
+
+state 19
+	expr : expr '-' . expr  (8)
+
+	DIGIT  shift 3
+	LETTER  shift 12
+	'-'  shift 5
+	'('  shift 6
+	.  error
+
+	expr  goto 29
+	number  goto 9
+
+
+state 20
+	expr : expr '*' . expr  (9)
+
+	DIGIT  shift 3
+	LETTER  shift 12
+	'-'  shift 5
+	'('  shift 6
+	.  error
+
+	expr  goto 30
+	number  goto 9
+
+
+state 21
+	expr : expr '/' . expr  (10)
+
+	DIGIT  shift 3
+	LETTER  shift 12
+	'-'  shift 5
+	'('  shift 6
+	.  error
+
+	expr  goto 31
+	number  goto 9
+
+
+state 22
+	expr : expr '%' . expr  (11)
+
+	DIGIT  shift 3
+	LETTER  shift 12
+	'-'  shift 5
+	'('  shift 6
+	.  error
+
+	expr  goto 32
+	number  goto 9
+
+
+state 23
+	number : number DIGIT .  (18)
+
+	.  reduce 18
+
+
+state 24
+	stat : LETTER '=3D' expr .  (5)
+	expr : expr . '+' expr  (7)
+	expr : expr . '-' expr  (8)
+	expr : expr . '*' expr  (9)
+	expr : expr . '/' expr  (10)
+	expr : expr . '%' expr  (11)
+	expr : expr . '&' expr  (12)
+	expr : expr . '|' expr  (13)
+
+	'|'  shift 16
+	'&'  shift 17
+	'+'  shift 18
+	'-'  shift 19
+	'*'  shift 20
+	'/'  shift 21
+	'%'  shift 22
+	'\n'  reduce 5
+
+
+state 25
+	expr : '(' expr ')' .  (6)
+
+	.  reduce 6
+
+
+state 26
+	expr : expr . '+' expr  (7)
+	expr : expr . '-' expr  (8)
+	expr : expr . '*' expr  (9)
+	expr : expr . '/' expr  (10)
+	expr : expr . '%' expr  (11)
+	expr : expr . '&' expr  (12)
+	expr : expr . '|' expr  (13)
+	expr : expr '|' expr .  (13)
+
+	'&'  shift 17
+	'+'  shift 18
+	'-'  shift 19
+	'*'  shift 20
+	'/'  shift 21
+	'%'  shift 22
+	'|'  reduce 13
+	'\n'  reduce 13
+	')'  reduce 13
+
+
+state 27
+	expr : expr . '+' expr  (7)
+	expr : expr . '-' expr  (8)
+	expr : expr . '*' expr  (9)
+	expr : expr . '/' expr  (10)
+	expr : expr . '%' expr  (11)
+	expr : expr . '&' expr  (12)
+	expr : expr '&' expr .  (12)
+	expr : expr . '|' expr  (13)
+
+	'+'  shift 18
+	'-'  shift 19
+	'*'  shift 20
+	'/'  shift 21
+	'%'  shift 22
+	'|'  reduce 12
+	'&'  reduce 12
+	'\n'  reduce 12
+	')'  reduce 12
+
+
+state 28
+	expr : expr . '+' expr  (7)
+	expr : expr '+' expr .  (7)
+	expr : expr . '-' expr  (8)
+	expr : expr . '*' expr  (9)
+	expr : expr . '/' expr  (10)
+	expr : expr . '%' expr  (11)
+	expr : expr . '&' expr  (12)
+	expr : expr . '|' expr  (13)
+
+	'*'  shift 20
+	'/'  shift 21
+	'%'  shift 22
+	'|'  reduce 7
+	'&'  reduce 7
+	'+'  reduce 7
+	'-'  reduce 7
+	'\n'  reduce 7
+	')'  reduce 7
+
+
+state 29
+	expr : expr . '+' expr  (7)
+	expr : expr . '-' expr  (8)
+	expr : expr '-' expr .  (8)
+	expr : expr . '*' expr  (9)
+	expr : expr . '/' expr  (10)
+	expr : expr . '%' expr  (11)
+	expr : expr . '&' expr  (12)
+	expr : expr . '|' expr  (13)
+
+	'*'  shift 20
+	'/'  shift 21
+	'%'  shift 22
+	'|'  reduce 8
+	'&'  reduce 8
+	'+'  reduce 8
+	'-'  reduce 8
+	'\n'  reduce 8
+	')'  reduce 8
+
+
+state 30
+	expr : expr . '+' expr  (7)
+	expr : expr . '-' expr  (8)
+	expr : expr . '*' expr  (9)
+	expr : expr '*' expr .  (9)
+	expr : expr . '/' expr  (10)
+	expr : expr . '%' expr  (11)
+	expr : expr . '&' expr  (12)
+	expr : expr . '|' expr  (13)
+
+	.  reduce 9
+
+
+state 31
+	expr : expr . '+' expr  (7)
+	expr : expr . '-' expr  (8)
+	expr : expr . '*' expr  (9)
+	expr : expr . '/' expr  (10)
+	expr : expr '/' expr .  (10)
+	expr : expr . '%' expr  (11)
+	expr : expr . '&' expr  (12)
+	expr : expr . '|' expr  (13)
+
+	.  reduce 10
+
+
+state 32
+	expr : expr . '+' expr  (7)
+	expr : expr . '-' expr  (8)
+	expr : expr . '*' expr  (9)
+	expr : expr . '/' expr  (10)
+	expr : expr . '%' expr  (11)
+	expr : expr '%' expr .  (11)
+	expr : expr . '&' expr  (12)
+	expr : expr . '|' expr  (13)
+
+	.  reduce 11
+
+
+16 terminals, 5 nonterminals
+19 grammar rules, 33 states
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/test/code_calc.tab.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/test/code_calc.tab.c	Wed Jul 25 16:21:35 2012 +0300
@@ -0,0 +1,199 @@
+
+#ifndef yyparse
+#define yyparse    calc_parse
+#endif /* yyparse */
+
+#ifndef yylex
+#define yylex      calc_lex
+#endif /* yylex */
+
+#ifndef yyerror
+#define yyerror    calc_error
+#endif /* yyerror */
+
+#ifndef yychar
+#define yychar     calc_char
+#endif /* yychar */
+
+#ifndef yyval
+#define yyval      calc_val
+#endif /* yyval */
+
+#ifndef yylval
+#define yylval     calc_lval
+#endif /* yylval */
+
+#ifndef yydebug
+#define yydebug    calc_debug
+#endif /* yydebug */
+
+#ifndef yynerrs
+#define yynerrs    calc_nerrs
+#endif /* yynerrs */
+
+#ifndef yyerrflag
+#define yyerrflag  calc_errflag
+#endif /* yyerrflag */
+
+#ifndef yylhs
+#define yylhs      calc_lhs
+#endif /* yylhs */
+
+#ifndef yylen
+#define yylen      calc_len
+#endif /* yylen */
+
+#ifndef yydefred
+#define yydefred   calc_defred
+#endif /* yydefred */
+
+#ifndef yydgoto
+#define yydgoto    calc_dgoto
+#endif /* yydgoto */
+
+#ifndef yysindex
+#define yysindex   calc_sindex
+#endif /* yysindex */
+
+#ifndef yyrindex
+#define yyrindex   calc_rindex
+#endif /* yyrindex */
+
+#ifndef yygindex
+#define yygindex   calc_gindex
+#endif /* yygindex */
+
+#ifndef yytable
+#define yytable    calc_table
+#endif /* yytable */
+
+#ifndef yycheck
+#define yycheck    calc_check
+#endif /* yycheck */
+
+#ifndef yyname
+#define yyname     calc_name
+#endif /* yyname */
+
+#ifndef yyrule
+#define yyrule     calc_rule
+#endif /* yyrule */
+#define YYPREFIX "calc_"
+const short calc_lhs[] =3D {                        -1,
+    0,    0,    0,    1,    1,    2,    2,    2,    2,    2,
+    2,    2,    2,    2,    2,    2,    3,    3,
+};
+const short calc_len[] =3D {                         2,
+    0,    3,    3,    1,    3,    3,    3,    3,    3,    3,
+    3,    3,    3,    2,    1,    1,    1,    2,
+};
+const short calc_defred[] =3D {                      1,
+    0,    0,   17,    0,    0,    0,    0,    0,    0,    3,
+    0,   15,   14,    0,    2,    0,    0,    0,    0,    0,
+    0,    0,   18,    0,    6,    0,    0,    0,    0,    9,
+   10,   11,
+};
+const short calc_dgoto[] =3D {                       1,
+    7,    8,    9,
+};
+const short calc_sindex[] =3D {                      0,
+  -40,   -7,    0,  -55,  -38,  -38,    1,  -29, -247,    0,
+  -38,    0,    0,   22,    0,  -38,  -38,  -38,  -38,  -38,
+  -38,  -38,    0,  -29,    0,   51,   60,  -20,  -20,    0,
+    0,    0,
+};
+const short calc_rindex[] =3D {                      0,
+    0,    0,    0,    2,    0,    0,    0,    9,   -9,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,   10,    0,   -6,   14,    5,   13,    0,
+    0,    0,
+};
+const short calc_gindex[] =3D {                      0,
+    0,   65,    0,
+};
+const short calc_table[] =3D {                       6,
+   16,    6,   10,   13,    5,   11,    5,   22,   17,   23,
+   15,   15,   20,   18,    7,   19,   22,   21,    4,    5,
+    0,   20,    8,   12,    0,    0,   21,   16,   16,    0,
+    0,   16,   16,   16,   13,   16,    0,   16,   15,   15,
+    0,    0,    7,   15,   15,    7,   15,    7,   15,    7,
+    8,   12,    0,    8,   12,    8,    0,    8,   22,   17,
+    0,    0,   25,   20,   18,    0,   19,    0,   21,   13,
+   14,    0,    0,    0,    0,   24,    0,    0,    0,    0,
+   26,   27,   28,   29,   30,   31,   32,   22,   17,    0,
+    0,    0,   20,   18,   16,   19,   22,   21,    0,    0,
+    0,   20,   18,    0,   19,    0,   21,    0,    0,    0,
+    0,    0,    0,    0,   16,    0,    0,   13,    0,    0,
+    0,    0,    0,    0,    0,   15,    0,    0,    7,    0,
+    0,    0,    0,    0,    0,    0,    8,   12,    0,    0,
+    0,    0,    0,    0,    0,   16,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+    0,    0,    0,    0,    0,    2,    3,    4,    3,   12,
+};
+const short calc_check[] =3D {                      40,
+   10,   40,   10,   10,   45,   61,   45,   37,   38,  257,
+   10,   10,   42,   43,   10,   45,   37,   47,   10,   10,
+   -1,   42,   10,   10,   -1,   -1,   47,   37,   38,   -1,
+   -1,   41,   42,   43,   41,   45,   -1,   47,   37,   38,
+   -1,   -1,   38,   42,   43,   41,   45,   43,   47,   45,
+   38,   38,   -1,   41,   41,   43,   -1,   45,   37,   38,
+   -1,   -1,   41,   42,   43,   -1,   45,   -1,   47,    5,
+    6,   -1,   -1,   -1,   -1,   11,   -1,   -1,   -1,   -1,
+   16,   17,   18,   19,   20,   21,   22,   37,   38,   -1,
+   -1,   -1,   42,   43,  124,   45,   37,   47,   -1,   -1,
+   -1,   42,   43,   -1,   45,   -1,   47,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,  124,   -1,   -1,  124,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,  124,   -1,   -1,  124,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,  124,  124,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,  124,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+   -1,   -1,   -1,   -1,   -1,  256,  257,  258,  257,  258,
+};
+#ifndef YYDEBUG
+#define YYDEBUG 0
+#endif
+#if YYDEBUG
+const char *yyname[] =3D {
+
+"end-of-file",0,0,0,0,0,0,0,0,0,"'\\n'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,=
0,0,0,
+0,0,0,0,0,0,"'%'","'&'",0,"'('","')'","'*'","'+'",0,"'-'",0,"'/'",0,0,0,0,=
0,0,0,
+0,0,0,0,0,0,"'=3D'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,=
0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"'|'",0,0,0,=
0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,=
0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,=
0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,=
0,0,0,
+0,0,0,0,0,0,"DIGIT","LETTER","UMINUS",
+};
+const char *yyrule[] =3D {
+"$accept : list",
+"list :",
+"list : list stat '\\n'",
+"list : list error '\\n'",
+"stat : expr",
+"stat : LETTER '=3D' expr",
+"expr : '(' expr ')'",
+"expr : expr '+' expr",
+"expr : expr '-' expr",
+"expr : expr '*' expr",
+"expr : expr '/' expr",
+"expr : expr '%' expr",
+"expr : expr '&' expr",
+"expr : expr '|' expr",
+"expr : '-' expr",
+"expr : LETTER",
+"expr : number",
+"number : DIGIT",
+"number : number DIGIT",
+
+};
+#endif
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/test/code_calc.tab.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/test/code_calc.tab.h	Wed Jul 25 16:21:35 2012 +0300
@@ -0,0 +1,3 @@
+#define DIGIT 257
+#define LETTER 258
+#define UMINUS 259
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/test/code_calc.y
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/test/code_calc.y	Wed Jul 25 16:21:35 2012 +0300
@@ -0,0 +1,112 @@
+%{
+# include <stdio.h>
+# include <ctype.h>
+
+int regs[26];
+int base;
+
+#ifdef YYBISON
+int yylex(void);
+static void yyerror(const char *s);
+#endif
+
+%}
+
+%start list
+
+%token DIGIT LETTER
+
+%left '|'
+%left '&'
+%left '+' '-'
+%left '*' '/' '%'
+%left UMINUS   /* supplies precedence for unary minus */
+
+%% /* beginning of rules section */
+
+list  :  /* empty */
+      |  list stat '\n'
+      |  list error '\n'
+            {  yyerrok ; }
+      ;
+
+stat  :  expr
+            {  printf("%d\n",$1);}
+      |  LETTER '=3D' expr
+            {  regs[$1] =3D $3; }
+      ;
+
+expr  :  '(' expr ')'
+            {  $$ =3D $2; }
+      |  expr '+' expr
+            {  $$ =3D $1 + $3; }
+      |  expr '-' expr
+            {  $$ =3D $1 - $3; }
+      |  expr '*' expr
+            {  $$ =3D $1 * $3; }
+      |  expr '/' expr
+            {  $$ =3D $1 / $3; }
+      |  expr '%' expr
+            {  $$ =3D $1 % $3; }
+      |  expr '&' expr
+            {  $$ =3D $1 & $3; }
+      |  expr '|' expr
+            {  $$ =3D $1 | $3; }
+      |  '-' expr %prec UMINUS
+            {  $$ =3D - $2; }
+      |  LETTER
+            {  $$ =3D regs[$1]; }
+      |  number
+      ;
+
+number:  DIGIT
+         {  $$ =3D $1; base =3D ($1=3D=3D0) ? 8 : 10; }
+      |  number DIGIT
+         {  $$ =3D base * $1 + $2; }
+      ;
+
+%% /* start of programs */
+
+#ifdef YYBYACC
+extern int YYLEX_DECL();
+#endif
+
+int
+main (void)
+{
+    while(!feof(stdin)) {
+	yyparse();
+    }
+    return 0;
+}
+
+static void
+yyerror(const char *s)
+{
+    fprintf(stderr, "%s\n", s);
+}
+
+int
+yylex(void)
+{
+	/* lexical analysis routine */
+	/* returns LETTER for a lower case letter, yylval =3D 0 through 25 */
+	/* return DIGIT for a digit, yylval =3D 0 through 9 */
+	/* all other characters are returned immediately */
+
+    int c;
+
+    while( (c=3Dgetchar()) =3D=3D ' ' )   { /* skip blanks */ }
+
+    /* c is now nonblank */
+
+    if( islower( c )) {
+	yylval =3D c - 'a';
+	return ( LETTER );
+    }
+    if( isdigit( c )) {
+	yylval =3D c - '0';
+	return ( DIGIT );
+    }
+    return( c );
+}
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/test/code_error.cod=
e.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/test/code_error.code.c	Wed Jul 25 16:21:35 2012 +0=
300
@@ -0,0 +1,491 @@
+#ifndef lint
+static const char yysccsid[] =3D "@(#)yaccpar	1.9 (Berkeley) 02/21/93";
+#endif
+
+#define YYBYACC 1
+#define YYMAJOR 1
+#define YYMINOR 9
+
+#define YYEMPTY        (-1)
+#define yyclearin      (yychar =3D YYEMPTY)
+#define yyerrok        (yyerrflag =3D 0)
+#define YYRECOVERING() (yyerrflag !=3D 0)
+
+
+#define YYPURE 0
+
+#line 2 "code_error.y"
+
+#ifdef YYBISON
+int yylex(void);
+static void yyerror(const char *);
+#endif
+
+#line 25 "code_error.code.c"
+
+#ifndef YYSTYPE
+typedef int YYSTYPE;
+#endif
+
+/* compatibility with bison */
+#ifdef YYPARSE_PARAM
+/* compatibility with FreeBSD */
+# ifdef YYPARSE_PARAM_TYPE
+#  define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM)
+# else
+#  define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM)
+# endif
+#else
+# define YYPARSE_DECL() yyparse(void)
+#endif
+
+/* Parameters sent to lex. */
+#ifdef YYLEX_PARAM
+# define YYLEX_DECL() yylex(void *YYLEX_PARAM)
+# define YYLEX yylex(YYLEX_PARAM)
+#else
+# define YYLEX_DECL() yylex(void)
+# define YYLEX yylex()
+#endif
+
+/* Parameters sent to yyerror. */
+#ifndef YYERROR_DECL
+#define YYERROR_DECL() yyerror(const char *s)
+#endif
+#ifndef YYERROR_CALL
+#define YYERROR_CALL(msg) yyerror(msg)
+#endif
+
+extern int YYPARSE_DECL();
+
+#define YYERRCODE 256
+#define YYTABLESIZE 0
+#define YYFINAL 2
+#ifndef YYDEBUG
+#define YYDEBUG 0
+#endif
+#define YYMAXTOKEN 0
+
+#ifndef yyparse
+#define yyparse    error_parse
+#endif /* yyparse */
+
+#ifndef yylex
+#define yylex      error_lex
+#endif /* yylex */
+
+#ifndef yyerror
+#define yyerror    error_error
+#endif /* yyerror */
+
+#ifndef yychar
+#define yychar     error_char
+#endif /* yychar */
+
+#ifndef yyval
+#define yyval      error_val
+#endif /* yyval */
+
+#ifndef yylval
+#define yylval     error_lval
+#endif /* yylval */
+
+#ifndef yydebug
+#define yydebug    error_debug
+#endif /* yydebug */
+
+#ifndef yynerrs
+#define yynerrs    error_nerrs
+#endif /* yynerrs */
+
+#ifndef yyerrflag
+#define yyerrflag  error_errflag
+#endif /* yyerrflag */
+
+#ifndef yylhs
+#define yylhs      error_lhs
+#endif /* yylhs */
+
+#ifndef yylen
+#define yylen      error_len
+#endif /* yylen */
+
+#ifndef yydefred
+#define yydefred   error_defred
+#endif /* yydefred */
+
+#ifndef yydgoto
+#define yydgoto    error_dgoto
+#endif /* yydgoto */
+
+#ifndef yysindex
+#define yysindex   error_sindex
+#endif /* yysindex */
+
+#ifndef yyrindex
+#define yyrindex   error_rindex
+#endif /* yyrindex */
+
+#ifndef yygindex
+#define yygindex   error_gindex
+#endif /* yygindex */
+
+#ifndef yytable
+#define yytable    error_table
+#endif /* yytable */
+
+#ifndef yycheck
+#define yycheck    error_check
+#endif /* yycheck */
+
+#ifndef yyname
+#define yyname     error_name
+#endif /* yyname */
+
+#ifndef yyrule
+#define yyrule     error_rule
+#endif /* yyrule */
+#define YYPREFIX "error_"
+
+extern int YYPARSE_DECL();
+extern short yylhs[];
+extern short yylen[];
+extern short yydefred[];
+extern short yydgoto[];
+extern short yysindex[];
+extern short yyrindex[];
+extern short yygindex[];
+extern short yytable[];
+extern short yycheck[];
+
+#if YYDEBUG
+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
+#define YYMAXDEPTH  YYSTACKSIZE
+#else
+#ifdef YYMAXDEPTH
+#define YYSTACKSIZE YYMAXDEPTH
+#else
+#define YYSTACKSIZE 500
+#define YYMAXDEPTH  500
+#endif
+#endif
+
+#define YYINITSTACKSIZE 500
+
+typedef struct {
+    unsigned stacksize;
+    short    *s_base;
+    short    *s_mark;
+    short    *s_last;
+    YYSTYPE  *l_base;
+    YYSTYPE  *l_mark;
+} YYSTACKDATA;
+/* variables for the parser stack */
+static YYSTACKDATA yystack;
+#line 12 "code_error.y"
+
+#include <stdio.h>
+
+#ifdef YYBYACC
+extern int YYLEX_DECL();
+#endif
+
+int
+main(void)
+{
+    printf("yyparse() =3D %d\n", yyparse());
+    return 0;
+}
+
+int
+yylex(void)
+{
+    return -1;
+}
+
+static void
+yyerror(const char* s)
+{
+    printf("%s\n", s);
+}
+#line 226 "code_error.code.c"
+
+#if YYDEBUG
+#include <stdio.h>		/* needed for printf */
+#endif
+
+#include <stdlib.h>	/* needed for malloc, etc */
+#include <string.h>	/* needed for memset */
+
+/* allocate initial stack or double stack size, up to YYMAXDEPTH */
+static int yygrowstack(YYSTACKDATA *data)
+{
+    int i;
+    unsigned newsize;
+    short *newss;
+    YYSTYPE *newvs;
+
+    if ((newsize =3D data->stacksize) =3D=3D 0)
+        newsize =3D YYINITSTACKSIZE;
+    else if (newsize >=3D YYMAXDEPTH)
+        return -1;
+    else if ((newsize *=3D 2) > YYMAXDEPTH)
+        newsize =3D YYMAXDEPTH;
+
+    i =3D data->s_mark - data->s_base;
+    newss =3D (short *)realloc(data->s_base, newsize * sizeof(*newss));
+    if (newss =3D=3D 0)
+        return -1;
+
+    data->s_base =3D newss;
+    data->s_mark =3D newss + i;
+
+    newvs =3D (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));
+    if (newvs =3D=3D 0)
+        return -1;
+
+    data->l_base =3D newvs;
+    data->l_mark =3D newvs + i;
+
+    data->stacksize =3D newsize;
+    data->s_last =3D data->s_base + newsize - 1;
+    return 0;
+}
+
+#if YYPURE || defined(YY_NO_LEAKS)
+static void yyfreestack(YYSTACKDATA *data)
+{
+    free(data->s_base);
+    free(data->l_base);
+    memset(data, 0, sizeof(*data));
+}
+#else
+#define yyfreestack(data) /* nothing */
+#endif
+
+#define YYABORT  goto yyabort
+#define YYREJECT goto yyabort
+#define YYACCEPT goto yyaccept
+#define YYERROR  goto yyerrlab
+
+int
+YYPARSE_DECL()
+{
+    int yym, yyn, yystate;
+#if YYDEBUG
+    const char *yys;
+
+    if ((yys =3D getenv("YYDEBUG")) !=3D 0)
+    {
+        yyn =3D *yys;
+        if (yyn >=3D '0' && yyn <=3D '9')
+            yydebug =3D yyn - '0';
+    }
+#endif
+
+    yynerrs =3D 0;
+    yyerrflag =3D 0;
+    yychar =3D YYEMPTY;
+    yystate =3D 0;
+
+#if YYPURE
+    memset(&yystack, 0, sizeof(yystack));
+#endif
+
+    if (yystack.s_base =3D=3D NULL && yygrowstack(&yystack)) goto yyoverfl=
ow;
+    yystack.s_mark =3D yystack.s_base;
+    yystack.l_mark =3D yystack.l_base;
+    yystate =3D 0;
+    *yystack.s_mark =3D 0;
+
+yyloop:
+    if ((yyn =3D yydefred[yystate]) !=3D 0) goto yyreduce;
+    if (yychar < 0)
+    {
+        if ((yychar =3D YYLEX) < 0) yychar =3D 0;
+#if YYDEBUG
+        if (yydebug)
+        {
+            yys =3D 0;
+            if (yychar <=3D YYMAXTOKEN) yys =3D yyname[yychar];
+            if (!yys) yys =3D "illegal-symbol";
+            printf("%sdebug: state %d, reading %d (%s)\n",
+                    YYPREFIX, yystate, yychar, yys);
+        }
+#endif
+    }
+    if ((yyn =3D yysindex[yystate]) && (yyn +=3D yychar) >=3D 0 &&
+            yyn <=3D YYTABLESIZE && yycheck[yyn] =3D=3D yychar)
+    {
+#if YYDEBUG
+        if (yydebug)
+            printf("%sdebug: state %d, shifting to state %d\n",
+                    YYPREFIX, yystate, yytable[yyn]);
+#endif
+        if (yystack.s_mark >=3D yystack.s_last && yygrowstack(&yystack))
+        {
+            goto yyoverflow;
+        }
+        yystate =3D yytable[yyn];
+        *++yystack.s_mark =3D yytable[yyn];
+        *++yystack.l_mark =3D yylval;
+        yychar =3D YYEMPTY;
+        if (yyerrflag > 0)  --yyerrflag;
+        goto yyloop;
+    }
+    if ((yyn =3D yyrindex[yystate]) && (yyn +=3D yychar) >=3D 0 &&
+            yyn <=3D YYTABLESIZE && yycheck[yyn] =3D=3D yychar)
+    {
+        yyn =3D yytable[yyn];
+        goto yyreduce;
+    }
+    if (yyerrflag) goto yyinrecovery;
+
+    yyerror("syntax error");
+
+    goto yyerrlab;
+
+yyerrlab:
+    ++yynerrs;
+
+yyinrecovery:
+    if (yyerrflag < 3)
+    {
+        yyerrflag =3D 3;
+        for (;;)
+        {
+            if ((yyn =3D yysindex[*yystack.s_mark]) && (yyn +=3D YYERRCODE=
) >=3D 0 &&
+                    yyn <=3D YYTABLESIZE && yycheck[yyn] =3D=3D YYERRCODE)
+            {
+#if YYDEBUG
+                if (yydebug)
+                    printf("%sdebug: state %d, error recovery shifting\
+ to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]);
+#endif
+                if (yystack.s_mark >=3D yystack.s_last && yygrowstack(&yys=
tack))
+                {
+                    goto yyoverflow;
+                }
+                yystate =3D yytable[yyn];
+                *++yystack.s_mark =3D yytable[yyn];
+                *++yystack.l_mark =3D yylval;
+                goto yyloop;
+            }
+            else
+            {
+#if YYDEBUG
+                if (yydebug)
+                    printf("%sdebug: error recovery discarding state %d\n",
+                            YYPREFIX, *yystack.s_mark);
+#endif
+                if (yystack.s_mark <=3D yystack.s_base) goto yyabort;
+                --yystack.s_mark;
+                --yystack.l_mark;
+            }
+        }
+    }
+    else
+    {
+        if (yychar =3D=3D 0) goto yyabort;
+#if YYDEBUG
+        if (yydebug)
+        {
+            yys =3D 0;
+            if (yychar <=3D YYMAXTOKEN) yys =3D yyname[yychar];
+            if (!yys) yys =3D "illegal-symbol";
+            printf("%sdebug: state %d, error recovery discards token %d (%=
s)\n",
+                    YYPREFIX, yystate, yychar, yys);
+        }
+#endif
+        yychar =3D YYEMPTY;
+        goto yyloop;
+    }
+
+yyreduce:
+#if YYDEBUG
+    if (yydebug)
+        printf("%sdebug: state %d, reducing by rule %d (%s)\n",
+                YYPREFIX, yystate, yyn, yyrule[yyn]);
+#endif
+    yym =3D yylen[yyn];
+    if (yym)
+        yyval =3D yystack.l_mark[1-yym];
+    else
+        memset(&yyval, 0, sizeof yyval);
+    switch (yyn)
+    {
+    }
+    yystack.s_mark -=3D yym;
+    yystate =3D *yystack.s_mark;
+    yystack.l_mark -=3D yym;
+    yym =3D yylhs[yyn];
+    if (yystate =3D=3D 0 && yym =3D=3D 0)
+    {
+#if YYDEBUG
+        if (yydebug)
+            printf("%sdebug: after reduction, shifting from state 0 to\
+ state %d\n", YYPREFIX, YYFINAL);
+#endif
+        yystate =3D YYFINAL;
+        *++yystack.s_mark =3D YYFINAL;
+        *++yystack.l_mark =3D yyval;
+        if (yychar < 0)
+        {
+            if ((yychar =3D YYLEX) < 0) yychar =3D 0;
+#if YYDEBUG
+            if (yydebug)
+            {
+                yys =3D 0;
+                if (yychar <=3D YYMAXTOKEN) yys =3D yyname[yychar];
+                if (!yys) yys =3D "illegal-symbol";
+                printf("%sdebug: state %d, reading %d (%s)\n",
+                        YYPREFIX, YYFINAL, yychar, yys);
+            }
+#endif
+        }
+        if (yychar =3D=3D 0) goto yyaccept;
+        goto yyloop;
+    }
+    if ((yyn =3D yygindex[yym]) && (yyn +=3D yystate) >=3D 0 &&
+            yyn <=3D YYTABLESIZE && yycheck[yyn] =3D=3D yystate)
+        yystate =3D yytable[yyn];
+    else
+        yystate =3D yydgoto[yym];
+#if YYDEBUG
+    if (yydebug)
+        printf("%sdebug: after reduction, shifting from state %d \
+to state %d\n", YYPREFIX, *yystack.s_mark, yystate);
+#endif
+    if (yystack.s_mark >=3D yystack.s_last && yygrowstack(&yystack))
+    {
+        goto yyoverflow;
+    }
+    *++yystack.s_mark =3D (short) yystate;
+    *++yystack.l_mark =3D yyval;
+    goto yyloop;
+
+yyoverflow:
+    yyerror("yacc stack overflow");
+
+yyabort:
+    yyfreestack(&yystack);
+    return (1);
+
+yyaccept:
+    yyfreestack(&yystack);
+    return (0);
+}
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/test/code_error.out=
put
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/test/code_error.output	Wed Jul 25 16:21:35 2012 +0=
300
@@ -0,0 +1,27 @@
+   0  $accept : S $end
+
+   1  S : error
+=0C
+state 0
+	$accept : . S $end  (0)
+
+	error  shift 1
+	.  error
+
+	S  goto 2
+
+
+state 1
+	S : error .  (1)
+
+	.  reduce 1
+
+
+state 2
+	$accept : S . $end  (0)
+
+	$end  accept
+
+
+2 terminals, 2 nonterminals
+2 grammar rules, 3 states
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/test/code_error.tab=
.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/test/code_error.tab.c	Wed Jul 25 16:21:35 2012 +03=
00
@@ -0,0 +1,118 @@
+
+#ifndef yyparse
+#define yyparse    error_parse
+#endif /* yyparse */
+
+#ifndef yylex
+#define yylex      error_lex
+#endif /* yylex */
+
+#ifndef yyerror
+#define yyerror    error_error
+#endif /* yyerror */
+
+#ifndef yychar
+#define yychar     error_char
+#endif /* yychar */
+
+#ifndef yyval
+#define yyval      error_val
+#endif /* yyval */
+
+#ifndef yylval
+#define yylval     error_lval
+#endif /* yylval */
+
+#ifndef yydebug
+#define yydebug    error_debug
+#endif /* yydebug */
+
+#ifndef yynerrs
+#define yynerrs    error_nerrs
+#endif /* yynerrs */
+
+#ifndef yyerrflag
+#define yyerrflag  error_errflag
+#endif /* yyerrflag */
+
+#ifndef yylhs
+#define yylhs      error_lhs
+#endif /* yylhs */
+
+#ifndef yylen
+#define yylen      error_len
+#endif /* yylen */
+
+#ifndef yydefred
+#define yydefred   error_defred
+#endif /* yydefred */
+
+#ifndef yydgoto
+#define yydgoto    error_dgoto
+#endif /* yydgoto */
+
+#ifndef yysindex
+#define yysindex   error_sindex
+#endif /* yysindex */
+
+#ifndef yyrindex
+#define yyrindex   error_rindex
+#endif /* yyrindex */
+
+#ifndef yygindex
+#define yygindex   error_gindex
+#endif /* yygindex */
+
+#ifndef yytable
+#define yytable    error_table
+#endif /* yytable */
+
+#ifndef yycheck
+#define yycheck    error_check
+#endif /* yycheck */
+
+#ifndef yyname
+#define yyname     error_name
+#endif /* yyname */
+
+#ifndef yyrule
+#define yyrule     error_rule
+#endif /* yyrule */
+#define YYPREFIX "error_"
+const short error_lhs[] =3D {                       -1,
+    0,
+};
+const short error_len[] =3D {                        2,
+    1,
+};
+const short error_defred[] =3D {                     0,
+    1,    0,
+};
+const short error_dgoto[] =3D {                      2,
+};
+const short error_sindex[] =3D {                  -256,
+    0,    0,
+};
+const short error_rindex[] =3D {                     0,
+    0,    0,
+};
+const short error_gindex[] =3D {                     0,
+};
+const short error_table[] =3D {                      1,
+};
+const short error_check[] =3D {                    256,
+};
+#ifndef YYDEBUG
+#define YYDEBUG 0
+#endif
+#if YYDEBUG
+const char *yyname[] =3D {
+
+"end-of-file",
+};
+const char *yyrule[] =3D {
+"$accept : S",
+"S : error",
+
+};
+#endif
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/test/code_error.y
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/test/code_error.y	Wed Jul 25 16:21:35 2012 +0300
@@ -0,0 +1,36 @@
+%{
+
+#ifdef YYBISON
+int yylex(void);
+static void yyerror(const char *);
+#endif
+
+%}
+%%
+S: error
+%%
+
+#include <stdio.h>
+
+#ifdef YYBYACC
+extern int YYLEX_DECL();
+#endif
+
+int
+main(void)
+{
+    printf("yyparse() =3D %d\n", yyparse());
+    return 0;
+}
+
+int
+yylex(void)
+{
+    return -1;
+}
+
+static void
+yyerror(const char* s)
+{
+    printf("%s\n", s);
+}
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/test/error.output
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/test/error.output	Wed Jul 25 16:21:35 2012 +0300
@@ -0,0 +1,27 @@
+   0  $accept : S $end
+
+   1  S : error
+=0C
+state 0
+	$accept : . S $end  (0)
+
+	error  shift 1
+	.  error
+
+	S  goto 2
+
+
+state 1
+	S : error .  (1)
+
+	.  reduce 1
+
+
+state 2
+	$accept : S . $end  (0)
+
+	$end  accept
+
+
+2 terminals, 2 nonterminals
+2 grammar rules, 3 states
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/test/error.tab.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/test/error.tab.c	Wed Jul 25 16:21:35 2012 +0300
@@ -0,0 +1,501 @@
+#ifndef lint
+static const char yysccsid[] =3D "@(#)yaccpar	1.9 (Berkeley) 02/21/93";
+#endif
+
+#define YYBYACC 1
+#define YYMAJOR 1
+#define YYMINOR 9
+
+#define YYEMPTY        (-1)
+#define yyclearin      (yychar =3D YYEMPTY)
+#define yyerrok        (yyerrflag =3D 0)
+#define YYRECOVERING() (yyerrflag !=3D 0)
+
+
+#ifndef yyparse
+#define yyparse    error_parse
+#endif /* yyparse */
+
+#ifndef yylex
+#define yylex      error_lex
+#endif /* yylex */
+
+#ifndef yyerror
+#define yyerror    error_error
+#endif /* yyerror */
+
+#ifndef yychar
+#define yychar     error_char
+#endif /* yychar */
+
+#ifndef yyval
+#define yyval      error_val
+#endif /* yyval */
+
+#ifndef yylval
+#define yylval     error_lval
+#endif /* yylval */
+
+#ifndef yydebug
+#define yydebug    error_debug
+#endif /* yydebug */
+
+#ifndef yynerrs
+#define yynerrs    error_nerrs
+#endif /* yynerrs */
+
+#ifndef yyerrflag
+#define yyerrflag  error_errflag
+#endif /* yyerrflag */
+
+#ifndef yylhs
+#define yylhs      error_lhs
+#endif /* yylhs */
+
+#ifndef yylen
+#define yylen      error_len
+#endif /* yylen */
+
+#ifndef yydefred
+#define yydefred   error_defred
+#endif /* yydefred */
+
+#ifndef yydgoto
+#define yydgoto    error_dgoto
+#endif /* yydgoto */
+
+#ifndef yysindex
+#define yysindex   error_sindex
+#endif /* yysindex */
+
+#ifndef yyrindex
+#define yyrindex   error_rindex
+#endif /* yyrindex */
+
+#ifndef yygindex
+#define yygindex   error_gindex
+#endif /* yygindex */
+
+#ifndef yytable
+#define yytable    error_table
+#endif /* yytable */
+
+#ifndef yycheck
+#define yycheck    error_check
+#endif /* yycheck */
+
+#ifndef yyname
+#define yyname     error_name
+#endif /* yyname */
+
+#ifndef yyrule
+#define yyrule     error_rule
+#endif /* yyrule */
+#define YYPREFIX "error_"
+
+#define YYPURE 0
+
+#line 2 "error.y"
+int yylex(void);
+static void yyerror(const char *);
+#line 102 "error.tab.c"
+
+#ifndef YYSTYPE
+typedef int YYSTYPE;
+#endif
+
+/* compatibility with bison */
+#ifdef YYPARSE_PARAM
+/* compatibility with FreeBSD */
+# ifdef YYPARSE_PARAM_TYPE
+#  define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM)
+# else
+#  define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM)
+# endif
+#else
+# define YYPARSE_DECL() yyparse(void)
+#endif
+
+/* Parameters sent to lex. */
+#ifdef YYLEX_PARAM
+# define YYLEX_DECL() yylex(void *YYLEX_PARAM)
+# define YYLEX yylex(YYLEX_PARAM)
+#else
+# define YYLEX_DECL() yylex(void)
+# define YYLEX yylex()
+#endif
+
+/* Parameters sent to yyerror. */
+#ifndef YYERROR_DECL
+#define YYERROR_DECL() yyerror(const char *s)
+#endif
+#ifndef YYERROR_CALL
+#define YYERROR_CALL(msg) yyerror(msg)
+#endif
+
+extern int YYPARSE_DECL();
+
+#define YYERRCODE 256
+static const short error_lhs[] =3D {                       -1,
+    0,
+};
+static const short error_len[] =3D {                        2,
+    1,
+};
+static const short error_defred[] =3D {                     0,
+    1,    0,
+};
+static const short error_dgoto[] =3D {                      2,
+};
+static const short error_sindex[] =3D {                  -256,
+    0,    0,
+};
+static const short error_rindex[] =3D {                     0,
+    0,    0,
+};
+static const short error_gindex[] =3D {                     0,
+};
+#define YYTABLESIZE 0
+static const short error_table[] =3D {                      1,
+};
+static const short error_check[] =3D {                    256,
+};
+#define YYFINAL 2
+#ifndef YYDEBUG
+#define YYDEBUG 0
+#endif
+#define YYMAXTOKEN 0
+#if YYDEBUG
+static const char *yyname[] =3D {
+
+"end-of-file",
+};
+static const char *yyrule[] =3D {
+"$accept : S",
+"S : error",
+
+};
+#endif
+
+int      yydebug;
+int      yynerrs;
+
+int      yyerrflag;
+int      yychar;
+YYSTYPE  yyval;
+YYSTYPE  yylval;
+
+/* define the initial stack-sizes */
+#ifdef YYSTACKSIZE
+#undef YYMAXDEPTH
+#define YYMAXDEPTH  YYSTACKSIZE
+#else
+#ifdef YYMAXDEPTH
+#define YYSTACKSIZE YYMAXDEPTH
+#else
+#define YYSTACKSIZE 500
+#define YYMAXDEPTH  500
+#endif
+#endif
+
+#define YYINITSTACKSIZE 500
+
+typedef struct {
+    unsigned stacksize;
+    short    *s_base;
+    short    *s_mark;
+    short    *s_last;
+    YYSTYPE  *l_base;
+    YYSTYPE  *l_mark;
+} YYSTACKDATA;
+/* variables for the parser stack */
+static YYSTACKDATA yystack;
+#line 8 "error.y"
+
+#include <stdio.h>
+
+int
+main(void)
+{
+    printf("yyparse() =3D %d\n", yyparse());
+    return 0;
+}
+
+int
+yylex(void)
+{
+    return -1;
+}
+
+static void
+yyerror(const char* s)
+{
+    printf("%s\n", s);
+}
+#line 236 "error.tab.c"
+
+#if YYDEBUG
+#include <stdio.h>		/* needed for printf */
+#endif
+
+#include <stdlib.h>	/* needed for malloc, etc */
+#include <string.h>	/* needed for memset */
+
+/* allocate initial stack or double stack size, up to YYMAXDEPTH */
+static int yygrowstack(YYSTACKDATA *data)
+{
+    int i;
+    unsigned newsize;
+    short *newss;
+    YYSTYPE *newvs;
+
+    if ((newsize =3D data->stacksize) =3D=3D 0)
+        newsize =3D YYINITSTACKSIZE;
+    else if (newsize >=3D YYMAXDEPTH)
+        return -1;
+    else if ((newsize *=3D 2) > YYMAXDEPTH)
+        newsize =3D YYMAXDEPTH;
+
+    i =3D data->s_mark - data->s_base;
+    newss =3D (short *)realloc(data->s_base, newsize * sizeof(*newss));
+    if (newss =3D=3D 0)
+        return -1;
+
+    data->s_base =3D newss;
+    data->s_mark =3D newss + i;
+
+    newvs =3D (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));
+    if (newvs =3D=3D 0)
+        return -1;
+
+    data->l_base =3D newvs;
+    data->l_mark =3D newvs + i;
+
+    data->stacksize =3D newsize;
+    data->s_last =3D data->s_base + newsize - 1;
+    return 0;
+}
+
+#if YYPURE || defined(YY_NO_LEAKS)
+static void yyfreestack(YYSTACKDATA *data)
+{
+    free(data->s_base);
+    free(data->l_base);
+    memset(data, 0, sizeof(*data));
+}
+#else
+#define yyfreestack(data) /* nothing */
+#endif
+
+#define YYABORT  goto yyabort
+#define YYREJECT goto yyabort
+#define YYACCEPT goto yyaccept
+#define YYERROR  goto yyerrlab
+
+int
+YYPARSE_DECL()
+{
+    int yym, yyn, yystate;
+#if YYDEBUG
+    const char *yys;
+
+    if ((yys =3D getenv("YYDEBUG")) !=3D 0)
+    {
+        yyn =3D *yys;
+        if (yyn >=3D '0' && yyn <=3D '9')
+            yydebug =3D yyn - '0';
+    }
+#endif
+
+    yynerrs =3D 0;
+    yyerrflag =3D 0;
+    yychar =3D YYEMPTY;
+    yystate =3D 0;
+
+#if YYPURE
+    memset(&yystack, 0, sizeof(yystack));
+#endif
+
+    if (yystack.s_base =3D=3D NULL && yygrowstack(&yystack)) goto yyoverfl=
ow;
+    yystack.s_mark =3D yystack.s_base;
+    yystack.l_mark =3D yystack.l_base;
+    yystate =3D 0;
+    *yystack.s_mark =3D 0;
+
+yyloop:
+    if ((yyn =3D yydefred[yystate]) !=3D 0) goto yyreduce;
+    if (yychar < 0)
+    {
+        if ((yychar =3D YYLEX) < 0) yychar =3D 0;
+#if YYDEBUG
+        if (yydebug)
+        {
+            yys =3D 0;
+            if (yychar <=3D YYMAXTOKEN) yys =3D yyname[yychar];
+            if (!yys) yys =3D "illegal-symbol";
+            printf("%sdebug: state %d, reading %d (%s)\n",
+                    YYPREFIX, yystate, yychar, yys);
+        }
+#endif
+    }
+    if ((yyn =3D yysindex[yystate]) && (yyn +=3D yychar) >=3D 0 &&
+            yyn <=3D YYTABLESIZE && yycheck[yyn] =3D=3D yychar)
+    {
+#if YYDEBUG
+        if (yydebug)
+            printf("%sdebug: state %d, shifting to state %d\n",
+                    YYPREFIX, yystate, yytable[yyn]);
+#endif
+        if (yystack.s_mark >=3D yystack.s_last && yygrowstack(&yystack))
+        {
+            goto yyoverflow;
+        }
+        yystate =3D yytable[yyn];
+        *++yystack.s_mark =3D yytable[yyn];
+        *++yystack.l_mark =3D yylval;
+        yychar =3D YYEMPTY;
+        if (yyerrflag > 0)  --yyerrflag;
+        goto yyloop;
+    }
+    if ((yyn =3D yyrindex[yystate]) && (yyn +=3D yychar) >=3D 0 &&
+            yyn <=3D YYTABLESIZE && yycheck[yyn] =3D=3D yychar)
+    {
+        yyn =3D yytable[yyn];
+        goto yyreduce;
+    }
+    if (yyerrflag) goto yyinrecovery;
+
+    yyerror("syntax error");
+
+    goto yyerrlab;
+
+yyerrlab:
+    ++yynerrs;
+
+yyinrecovery:
+    if (yyerrflag < 3)
+    {
+        yyerrflag =3D 3;
+        for (;;)
+        {
+            if ((yyn =3D yysindex[*yystack.s_mark]) && (yyn +=3D YYERRCODE=
) >=3D 0 &&
+                    yyn <=3D YYTABLESIZE && yycheck[yyn] =3D=3D YYERRCODE)
+            {
+#if YYDEBUG
+                if (yydebug)
+                    printf("%sdebug: state %d, error recovery shifting\
+ to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]);
+#endif
+                if (yystack.s_mark >=3D yystack.s_last && yygrowstack(&yys=
tack))
+                {
+                    goto yyoverflow;
+                }
+                yystate =3D yytable[yyn];
+                *++yystack.s_mark =3D yytable[yyn];
+                *++yystack.l_mark =3D yylval;
+                goto yyloop;
+            }
+            else
+            {
+#if YYDEBUG
+                if (yydebug)
+                    printf("%sdebug: error recovery discarding state %d\n",
+                            YYPREFIX, *yystack.s_mark);
+#endif
+                if (yystack.s_mark <=3D yystack.s_base) goto yyabort;
+                --yystack.s_mark;
+                --yystack.l_mark;
+            }
+        }
+    }
+    else
+    {
+        if (yychar =3D=3D 0) goto yyabort;
+#if YYDEBUG
+        if (yydebug)
+        {
+            yys =3D 0;
+            if (yychar <=3D YYMAXTOKEN) yys =3D yyname[yychar];
+            if (!yys) yys =3D "illegal-symbol";
+            printf("%sdebug: state %d, error recovery discards token %d (%=
s)\n",
+                    YYPREFIX, yystate, yychar, yys);
+        }
+#endif
+        yychar =3D YYEMPTY;
+        goto yyloop;
+    }
+
+yyreduce:
+#if YYDEBUG
+    if (yydebug)
+        printf("%sdebug: state %d, reducing by rule %d (%s)\n",
+                YYPREFIX, yystate, yyn, yyrule[yyn]);
+#endif
+    yym =3D yylen[yyn];
+    if (yym)
+        yyval =3D yystack.l_mark[1-yym];
+    else
+        memset(&yyval, 0, sizeof yyval);
+    switch (yyn)
+    {
+    }
+    yystack.s_mark -=3D yym;
+    yystate =3D *yystack.s_mark;
+    yystack.l_mark -=3D yym;
+    yym =3D yylhs[yyn];
+    if (yystate =3D=3D 0 && yym =3D=3D 0)
+    {
+#if YYDEBUG
+        if (yydebug)
+            printf("%sdebug: after reduction, shifting from state 0 to\
+ state %d\n", YYPREFIX, YYFINAL);
+#endif
+        yystate =3D YYFINAL;
+        *++yystack.s_mark =3D YYFINAL;
+        *++yystack.l_mark =3D yyval;
+        if (yychar < 0)
+        {
+            if ((yychar =3D YYLEX) < 0) yychar =3D 0;
+#if YYDEBUG
+            if (yydebug)
+            {
+                yys =3D 0;
+                if (yychar <=3D YYMAXTOKEN) yys =3D yyname[yychar];
+                if (!yys) yys =3D "illegal-symbol";
+                printf("%sdebug: state %d, reading %d (%s)\n",
+                        YYPREFIX, YYFINAL, yychar, yys);
+            }
+#endif
+        }
+        if (yychar =3D=3D 0) goto yyaccept;
+        goto yyloop;
+    }
+    if ((yyn =3D yygindex[yym]) && (yyn +=3D yystate) >=3D 0 &&
+            yyn <=3D YYTABLESIZE && yycheck[yyn] =3D=3D yystate)
+        yystate =3D yytable[yyn];
+    else
+        yystate =3D yydgoto[yym];
+#if YYDEBUG
+    if (yydebug)
+        printf("%sdebug: after reduction, shifting from state %d \
+to state %d\n", YYPREFIX, *yystack.s_mark, yystate);
+#endif
+    if (yystack.s_mark >=3D yystack.s_last && yygrowstack(&yystack))
+    {
+        goto yyoverflow;
+    }
+    *++yystack.s_mark =3D (short) yystate;
+    *++yystack.l_mark =3D yyval;
+    goto yyloop;
+
+yyoverflow:
+    yyerror("yacc stack overflow");
+
+yyabort:
+    yyfreestack(&yystack);
+    return (1);
+
+yyaccept:
+    yyfreestack(&yystack);
+    return (0);
+}
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/test/error.y
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/test/error.y	Wed Jul 25 16:21:35 2012 +0300
@@ -0,0 +1,28 @@
+%{
+int yylex(void);
+static void yyerror(const char *);
+%}
+%%
+S: error
+%%
+
+#include <stdio.h>
+
+int
+main(void)
+{
+    printf("yyparse() =3D %d\n", yyparse());
+    return 0;
+}
+
+int
+yylex(void)
+{
+    return -1;
+}
+
+static void
+yyerror(const char* s)
+{
+    printf("%s\n", s);
+}
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/test/ftp.output
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/test/ftp.output	Wed Jul 25 16:21:35 2012 +0300
@@ -0,0 +1,1625 @@
+   0  $accept : cmd_list $end
+
+   1  cmd_list :
+   2           | cmd_list cmd
+   3           | cmd_list rcmd
+
+   4  cmd : USER SP username CRLF
+   5      | PASS SP password CRLF
+   6      | PORT SP host_port CRLF
+   7      | PASV CRLF
+   8      | TYPE SP type_code CRLF
+   9      | STRU SP struct_code CRLF
+  10      | MODE SP mode_code CRLF
+  11      | ALLO SP NUMBER CRLF
+  12      | ALLO SP NUMBER SP R SP NUMBER CRLF
+  13      | RETR check_login SP pathname CRLF
+  14      | STOR check_login SP pathname CRLF
+  15      | APPE check_login SP pathname CRLF
+  16      | NLST check_login CRLF
+  17      | NLST check_login SP STRING CRLF
+  18      | LIST check_login CRLF
+  19      | LIST check_login SP pathname CRLF
+  20      | STAT check_login SP pathname CRLF
+  21      | STAT CRLF
+  22      | DELE check_login SP pathname CRLF
+  23      | RNTO SP pathname CRLF
+  24      | ABOR CRLF
+  25      | CWD check_login CRLF
+  26      | CWD check_login SP pathname CRLF
+  27      | HELP CRLF
+  28      | HELP SP STRING CRLF
+  29      | NOOP CRLF
+  30      | MKD check_login SP pathname CRLF
+  31      | RMD check_login SP pathname CRLF
+  32      | PWD check_login CRLF
+  33      | CDUP check_login CRLF
+  34      | SITE SP HELP CRLF
+  35      | SITE SP HELP SP STRING CRLF
+  36      | SITE SP UMASK check_login CRLF
+  37      | SITE SP UMASK check_login SP octal_number CRLF
+  38      | SITE SP CHMOD check_login SP octal_number SP pathname CRLF
+  39      | SITE SP IDLE CRLF
+  40      | SITE SP IDLE SP NUMBER CRLF
+  41      | STOU check_login SP pathname CRLF
+  42      | SYST CRLF
+  43      | SIZE check_login SP pathname CRLF
+  44      | MDTM check_login SP pathname CRLF
+  45      | QUIT CRLF
+  46      | error CRLF
+
+  47  rcmd : RNFR check_login SP pathname CRLF
+
+  48  username : STRING
+
+  49  password :
+  50           | STRING
+
+  51  byte_size : NUMBER
+
+  52  host_port : NUMBER COMMA NUMBER COMMA NUMBER COMMA NUMBER COMMA NUMB=
ER COMMA NUMBER
+
+  53  form_code : N
+  54            | T
+  55            | C
+
+  56  type_code : A
+  57            | A SP form_code
+  58            | E
+  59            | E SP form_code
+  60            | I
+  61            | L
+  62            | L SP byte_size
+  63            | L byte_size
+
+  64  struct_code : F
+  65              | R
+  66              | P
+
+  67  mode_code : S
+  68            | B
+  69            | C
+
+  70  pathname : pathstring
+
+  71  pathstring : STRING
+
+  72  octal_number : NUMBER
+
+  73  check_login :
+=0C
+state 0
+	$accept : . cmd_list $end  (0)
+	cmd_list : .  (1)
+
+	.  reduce 1
+
+	cmd_list  goto 1
+
+
+state 1
+	$accept : cmd_list . $end  (0)
+	cmd_list : cmd_list . cmd  (2)
+	cmd_list : cmd_list . rcmd  (3)
+
+	$end  accept
+	error  shift 2
+	USER  shift 3
+	PASS  shift 4
+	QUIT  shift 5
+	PORT  shift 6
+	PASV  shift 7
+	TYPE  shift 8
+	STRU  shift 9
+	MODE  shift 10
+	RETR  shift 11
+	STOR  shift 12
+	APPE  shift 13
+	ALLO  shift 14
+	RNFR  shift 15
+	RNTO  shift 16
+	ABOR  shift 17
+	DELE  shift 18
+	CWD  shift 19
+	LIST  shift 20
+	NLST  shift 21
+	SITE  shift 22
+	STAT  shift 23
+	HELP  shift 24
+	NOOP  shift 25
+	MKD  shift 26
+	RMD  shift 27
+	PWD  shift 28
+	CDUP  shift 29
+	STOU  shift 30
+	SYST  shift 31
+	SIZE  shift 32
+	MDTM  shift 33
+	.  error
+
+	cmd  goto 34
+	rcmd  goto 35
+
+
+state 2
+	cmd : error . CRLF  (46)
+
+	CRLF  shift 36
+	.  error
+
+
+state 3
+	cmd : USER . SP username CRLF  (4)
+
+	SP  shift 37
+	.  error
+
+
+state 4
+	cmd : PASS . SP password CRLF  (5)
+
+	SP  shift 38
+	.  error
+
+
+state 5
+	cmd : QUIT . CRLF  (45)
+
+	CRLF  shift 39
+	.  error
+
+
+state 6
+	cmd : PORT . SP host_port CRLF  (6)
+
+	SP  shift 40
+	.  error
+
+
+state 7
+	cmd : PASV . CRLF  (7)
+
+	CRLF  shift 41
+	.  error
+
+
+state 8
+	cmd : TYPE . SP type_code CRLF  (8)
+
+	SP  shift 42
+	.  error
+
+
+state 9
+	cmd : STRU . SP struct_code CRLF  (9)
+
+	SP  shift 43
+	.  error
+
+
+state 10
+	cmd : MODE . SP mode_code CRLF  (10)
+
+	SP  shift 44
+	.  error
+
+
+state 11
+	cmd : RETR . check_login SP pathname CRLF  (13)
+	check_login : .  (73)
+
+	.  reduce 73
+
+	check_login  goto 45
+
+
+state 12
+	cmd : STOR . check_login SP pathname CRLF  (14)
+	check_login : .  (73)
+
+	.  reduce 73
+
+	check_login  goto 46
+
+
+state 13
+	cmd : APPE . check_login SP pathname CRLF  (15)
+	check_login : .  (73)
+
+	.  reduce 73
+
+	check_login  goto 47
+
+
+state 14
+	cmd : ALLO . SP NUMBER CRLF  (11)
+	cmd : ALLO . SP NUMBER SP R SP NUMBER CRLF  (12)
+
+	SP  shift 48
+	.  error
+
+
+state 15
+	rcmd : RNFR . check_login SP pathname CRLF  (47)
+	check_login : .  (73)
+
+	.  reduce 73
+
+	check_login  goto 49
+
+
+state 16
+	cmd : RNTO . SP pathname CRLF  (23)
+
+	SP  shift 50
+	.  error
+
+
+state 17
+	cmd : ABOR . CRLF  (24)
+
+	CRLF  shift 51
+	.  error
+
+
+state 18
+	cmd : DELE . check_login SP pathname CRLF  (22)
+	check_login : .  (73)
+
+	.  reduce 73
+
+	check_login  goto 52
+
+
+state 19
+	cmd : CWD . check_login CRLF  (25)
+	cmd : CWD . check_login SP pathname CRLF  (26)
+	check_login : .  (73)
+
+	.  reduce 73
+
+	check_login  goto 53
+
+
+state 20
+	cmd : LIST . check_login CRLF  (18)
+	cmd : LIST . check_login SP pathname CRLF  (19)
+	check_login : .  (73)
+
+	.  reduce 73
+
+	check_login  goto 54
+
+
+state 21
+	cmd : NLST . check_login CRLF  (16)
+	cmd : NLST . check_login SP STRING CRLF  (17)
+	check_login : .  (73)
+
+	.  reduce 73
+
+	check_login  goto 55
+
+
+state 22
+	cmd : SITE . SP HELP CRLF  (34)
+	cmd : SITE . SP HELP SP STRING CRLF  (35)
+	cmd : SITE . SP UMASK check_login CRLF  (36)
+	cmd : SITE . SP UMASK check_login SP octal_number CRLF  (37)
+	cmd : SITE . SP CHMOD check_login SP octal_number SP pathname CRLF  (38)
+	cmd : SITE . SP IDLE CRLF  (39)
+	cmd : SITE . SP IDLE SP NUMBER CRLF  (40)
+
+	SP  shift 56
+	.  error
+
+
+state 23
+	cmd : STAT . check_login SP pathname CRLF  (20)
+	cmd : STAT . CRLF  (21)
+	check_login : .  (73)
+
+	CRLF  shift 57
+	SP  reduce 73
+
+	check_login  goto 58
+
+
+state 24
+	cmd : HELP . CRLF  (27)
+	cmd : HELP . SP STRING CRLF  (28)
+
+	SP  shift 59
+	CRLF  shift 60
+	.  error
+
+
+state 25
+	cmd : NOOP . CRLF  (29)
+
+	CRLF  shift 61
+	.  error
+
+
+state 26
+	cmd : MKD . check_login SP pathname CRLF  (30)
+	check_login : .  (73)
+
+	.  reduce 73
+
+	check_login  goto 62
+
+
+state 27
+	cmd : RMD . check_login SP pathname CRLF  (31)
+	check_login : .  (73)
+
+	.  reduce 73
+
+	check_login  goto 63
+
+
+state 28
+	cmd : PWD . check_login CRLF  (32)
+	check_login : .  (73)
+
+	.  reduce 73
+
+	check_login  goto 64
+
+
+state 29
+	cmd : CDUP . check_login CRLF  (33)
+	check_login : .  (73)
+
+	.  reduce 73
+
+	check_login  goto 65
+
+
+state 30
+	cmd : STOU . check_login SP pathname CRLF  (41)
+	check_login : .  (73)
+
+	.  reduce 73
+
+	check_login  goto 66
+
+
+state 31
+	cmd : SYST . CRLF  (42)
+
+	CRLF  shift 67
+	.  error
+
+
+state 32
+	cmd : SIZE . check_login SP pathname CRLF  (43)
+	check_login : .  (73)
+
+	.  reduce 73
+
+	check_login  goto 68
+
+
+state 33
+	cmd : MDTM . check_login SP pathname CRLF  (44)
+	check_login : .  (73)
+
+	.  reduce 73
+
+	check_login  goto 69
+
+
+state 34
+	cmd_list : cmd_list cmd .  (2)
+
+	.  reduce 2
+
+
+state 35
+	cmd_list : cmd_list rcmd .  (3)
+
+	.  reduce 3
+
+
+state 36
+	cmd : error CRLF .  (46)
+
+	.  reduce 46
+
+
+state 37
+	cmd : USER SP . username CRLF  (4)
+
+	STRING  shift 70
+	.  error
+
+	username  goto 71
+
+
+state 38
+	cmd : PASS SP . password CRLF  (5)
+	password : .  (49)
+
+	STRING  shift 72
+	CRLF  reduce 49
+
+	password  goto 73
+
+
+state 39
+	cmd : QUIT CRLF .  (45)
+
+	.  reduce 45
+
+
+state 40
+	cmd : PORT SP . host_port CRLF  (6)
+
+	NUMBER  shift 74
+	.  error
+
+	host_port  goto 75
+
+
+state 41
+	cmd : PASV CRLF .  (7)
+
+	.  reduce 7
+
+
+state 42
+	cmd : TYPE SP . type_code CRLF  (8)
+
+	A  shift 76
+	E  shift 77
+	I  shift 78
+	L  shift 79
+	.  error
+
+	type_code  goto 80
+
+
+state 43
+	cmd : STRU SP . struct_code CRLF  (9)
+
+	F  shift 81
+	P  shift 82
+	R  shift 83
+	.  error
+
+	struct_code  goto 84
+
+
+state 44
+	cmd : MODE SP . mode_code CRLF  (10)
+
+	B  shift 85
+	C  shift 86
+	S  shift 87
+	.  error
+
+	mode_code  goto 88
+
+
+state 45
+	cmd : RETR check_login . SP pathname CRLF  (13)
+
+	SP  shift 89
+	.  error
+
+
+state 46
+	cmd : STOR check_login . SP pathname CRLF  (14)
+
+	SP  shift 90
+	.  error
+
+
+state 47
+	cmd : APPE check_login . SP pathname CRLF  (15)
+
+	SP  shift 91
+	.  error
+
+
+state 48
+	cmd : ALLO SP . NUMBER CRLF  (11)
+	cmd : ALLO SP . NUMBER SP R SP NUMBER CRLF  (12)
+
+	NUMBER  shift 92
+	.  error
+
+
+state 49
+	rcmd : RNFR check_login . SP pathname CRLF  (47)
+
+	SP  shift 93
+	.  error
+
+
+state 50
+	cmd : RNTO SP . pathname CRLF  (23)
+
+	STRING  shift 94
+	.  error
+
+	pathname  goto 95
+	pathstring  goto 96
+
+
+state 51
+	cmd : ABOR CRLF .  (24)
+
+	.  reduce 24
+
+
+state 52
+	cmd : DELE check_login . SP pathname CRLF  (22)
+
+	SP  shift 97
+	.  error
+
+
+state 53
+	cmd : CWD check_login . CRLF  (25)
+	cmd : CWD check_login . SP pathname CRLF  (26)
+
+	SP  shift 98
+	CRLF  shift 99
+	.  error
+
+
+state 54
+	cmd : LIST check_login . CRLF  (18)
+	cmd : LIST check_login . SP pathname CRLF  (19)
+
+	SP  shift 100
+	CRLF  shift 101
+	.  error
+
+
+state 55
+	cmd : NLST check_login . CRLF  (16)
+	cmd : NLST check_login . SP STRING CRLF  (17)
+
+	SP  shift 102
+	CRLF  shift 103
+	.  error
+
+
+state 56
+	cmd : SITE SP . HELP CRLF  (34)
+	cmd : SITE SP . HELP SP STRING CRLF  (35)
+	cmd : SITE SP . UMASK check_login CRLF  (36)
+	cmd : SITE SP . UMASK check_login SP octal_number CRLF  (37)
+	cmd : SITE SP . CHMOD check_login SP octal_number SP pathname CRLF  (38)
+	cmd : SITE SP . IDLE CRLF  (39)
+	cmd : SITE SP . IDLE SP NUMBER CRLF  (40)
+
+	HELP  shift 104
+	UMASK  shift 105
+	IDLE  shift 106
+	CHMOD  shift 107
+	.  error
+
+
+state 57
+	cmd : STAT CRLF .  (21)
+
+	.  reduce 21
+
+
+state 58
+	cmd : STAT check_login . SP pathname CRLF  (20)
+
+	SP  shift 108
+	.  error
+
+
+state 59
+	cmd : HELP SP . STRING CRLF  (28)
+
+	STRING  shift 109
+	.  error
+
+
+state 60
+	cmd : HELP CRLF .  (27)
+
+	.  reduce 27
+
+
+state 61
+	cmd : NOOP CRLF .  (29)
+
+	.  reduce 29
+
+
+state 62
+	cmd : MKD check_login . SP pathname CRLF  (30)
+
+	SP  shift 110
+	.  error
+
+
+state 63
+	cmd : RMD check_login . SP pathname CRLF  (31)
+
+	SP  shift 111
+	.  error
+
+
+state 64
+	cmd : PWD check_login . CRLF  (32)
+
+	CRLF  shift 112
+	.  error
+
+
+state 65
+	cmd : CDUP check_login . CRLF  (33)
+
+	CRLF  shift 113
+	.  error
+
+
+state 66
+	cmd : STOU check_login . SP pathname CRLF  (41)
+
+	SP  shift 114
+	.  error
+
+
+state 67
+	cmd : SYST CRLF .  (42)
+
+	.  reduce 42
+
+
+state 68
+	cmd : SIZE check_login . SP pathname CRLF  (43)
+
+	SP  shift 115
+	.  error
+
+
+state 69
+	cmd : MDTM check_login . SP pathname CRLF  (44)
+
+	SP  shift 116
+	.  error
+
+
+state 70
+	username : STRING .  (48)
+
+	.  reduce 48
+
+
+state 71
+	cmd : USER SP username . CRLF  (4)
+
+	CRLF  shift 117
+	.  error
+
+
+state 72
+	password : STRING .  (50)
+
+	.  reduce 50
+
+
+state 73
+	cmd : PASS SP password . CRLF  (5)
+
+	CRLF  shift 118
+	.  error
+
+
+state 74
+	host_port : NUMBER . COMMA NUMBER COMMA NUMBER COMMA NUMBER COMMA NUMBER =
COMMA NUMBER  (52)
+
+	COMMA  shift 119
+	.  error
+
+
+state 75
+	cmd : PORT SP host_port . CRLF  (6)
+
+	CRLF  shift 120
+	.  error
+
+
+state 76
+	type_code : A .  (56)
+	type_code : A . SP form_code  (57)
+
+	SP  shift 121
+	CRLF  reduce 56
+
+
+state 77
+	type_code : E .  (58)
+	type_code : E . SP form_code  (59)
+
+	SP  shift 122
+	CRLF  reduce 58
+
+
+state 78
+	type_code : I .  (60)
+
+	.  reduce 60
+
+
+state 79
+	type_code : L .  (61)
+	type_code : L . SP byte_size  (62)
+	type_code : L . byte_size  (63)
+
+	SP  shift 123
+	NUMBER  shift 124
+	CRLF  reduce 61
+
+	byte_size  goto 125
+
+
+state 80
+	cmd : TYPE SP type_code . CRLF  (8)
+
+	CRLF  shift 126
+	.  error
+
+
+state 81
+	struct_code : F .  (64)
+
+	.  reduce 64
+
+
+state 82
+	struct_code : P .  (66)
+
+	.  reduce 66
+
+
+state 83
+	struct_code : R .  (65)
+
+	.  reduce 65
+
+
+state 84
+	cmd : STRU SP struct_code . CRLF  (9)
+
+	CRLF  shift 127
+	.  error
+
+
+state 85
+	mode_code : B .  (68)
+
+	.  reduce 68
+
+
+state 86
+	mode_code : C .  (69)
+
+	.  reduce 69
+
+
+state 87
+	mode_code : S .  (67)
+
+	.  reduce 67
+
+
+state 88
+	cmd : MODE SP mode_code . CRLF  (10)
+
+	CRLF  shift 128
+	.  error
+
+
+state 89
+	cmd : RETR check_login SP . pathname CRLF  (13)
+
+	STRING  shift 94
+	.  error
+
+	pathname  goto 129
+	pathstring  goto 96
+
+
+state 90
+	cmd : STOR check_login SP . pathname CRLF  (14)
+
+	STRING  shift 94
+	.  error
+
+	pathname  goto 130
+	pathstring  goto 96
+
+
+state 91
+	cmd : APPE check_login SP . pathname CRLF  (15)
+
+	STRING  shift 94
+	.  error
+
+	pathname  goto 131
+	pathstring  goto 96
+
+
+state 92
+	cmd : ALLO SP NUMBER . CRLF  (11)
+	cmd : ALLO SP NUMBER . SP R SP NUMBER CRLF  (12)
+
+	SP  shift 132
+	CRLF  shift 133
+	.  error
+
+
+state 93
+	rcmd : RNFR check_login SP . pathname CRLF  (47)
+
+	STRING  shift 94
+	.  error
+
+	pathname  goto 134
+	pathstring  goto 96
+
+
+state 94
+	pathstring : STRING .  (71)
+
+	.  reduce 71
+
+
+state 95
+	cmd : RNTO SP pathname . CRLF  (23)
+
+	CRLF  shift 135
+	.  error
+
+
+state 96
+	pathname : pathstring .  (70)
+
+	.  reduce 70
+
+
+state 97
+	cmd : DELE check_login SP . pathname CRLF  (22)
+
+	STRING  shift 94
+	.  error
+
+	pathname  goto 136
+	pathstring  goto 96
+
+
+state 98
+	cmd : CWD check_login SP . pathname CRLF  (26)
+
+	STRING  shift 94
+	.  error
+
+	pathname  goto 137
+	pathstring  goto 96
+
+
+state 99
+	cmd : CWD check_login CRLF .  (25)
+
+	.  reduce 25
+
+
+state 100
+	cmd : LIST check_login SP . pathname CRLF  (19)
+
+	STRING  shift 94
+	.  error
+
+	pathname  goto 138
+	pathstring  goto 96
+
+
+state 101
+	cmd : LIST check_login CRLF .  (18)
+
+	.  reduce 18
+
+
+state 102
+	cmd : NLST check_login SP . STRING CRLF  (17)
+
+	STRING  shift 139
+	.  error
+
+
+state 103
+	cmd : NLST check_login CRLF .  (16)
+
+	.  reduce 16
+
+
+state 104
+	cmd : SITE SP HELP . CRLF  (34)
+	cmd : SITE SP HELP . SP STRING CRLF  (35)
+
+	SP  shift 140
+	CRLF  shift 141
+	.  error
+
+
+state 105
+	cmd : SITE SP UMASK . check_login CRLF  (36)
+	cmd : SITE SP UMASK . check_login SP octal_number CRLF  (37)
+	check_login : .  (73)
+
+	.  reduce 73
+
+	check_login  goto 142
+
+
+state 106
+	cmd : SITE SP IDLE . CRLF  (39)
+	cmd : SITE SP IDLE . SP NUMBER CRLF  (40)
+
+	SP  shift 143
+	CRLF  shift 144
+	.  error
+
+
+state 107
+	cmd : SITE SP CHMOD . check_login SP octal_number SP pathname CRLF  (38)
+	check_login : .  (73)
+
+	.  reduce 73
+
+	check_login  goto 145
+
+
+state 108
+	cmd : STAT check_login SP . pathname CRLF  (20)
+
+	STRING  shift 94
+	.  error
+
+	pathname  goto 146
+	pathstring  goto 96
+
+
+state 109
+	cmd : HELP SP STRING . CRLF  (28)
+
+	CRLF  shift 147
+	.  error
+
+
+state 110
+	cmd : MKD check_login SP . pathname CRLF  (30)
+
+	STRING  shift 94
+	.  error
+
+	pathname  goto 148
+	pathstring  goto 96
+
+
+state 111
+	cmd : RMD check_login SP . pathname CRLF  (31)
+
+	STRING  shift 94
+	.  error
+
+	pathname  goto 149
+	pathstring  goto 96
+
+
+state 112
+	cmd : PWD check_login CRLF .  (32)
+
+	.  reduce 32
+
+
+state 113
+	cmd : CDUP check_login CRLF .  (33)
+
+	.  reduce 33
+
+
+state 114
+	cmd : STOU check_login SP . pathname CRLF  (41)
+
+	STRING  shift 94
+	.  error
+
+	pathname  goto 150
+	pathstring  goto 96
+
+
+state 115
+	cmd : SIZE check_login SP . pathname CRLF  (43)
+
+	STRING  shift 94
+	.  error
+
+	pathname  goto 151
+	pathstring  goto 96
+
+
+state 116
+	cmd : MDTM check_login SP . pathname CRLF  (44)
+
+	STRING  shift 94
+	.  error
+
+	pathname  goto 152
+	pathstring  goto 96
+
+
+state 117
+	cmd : USER SP username CRLF .  (4)
+
+	.  reduce 4
+
+
+state 118
+	cmd : PASS SP password CRLF .  (5)
+
+	.  reduce 5
+
+
+state 119
+	host_port : NUMBER COMMA . NUMBER COMMA NUMBER COMMA NUMBER COMMA NUMBER =
COMMA NUMBER  (52)
+
+	NUMBER  shift 153
+	.  error
+
+
+state 120
+	cmd : PORT SP host_port CRLF .  (6)
+
+	.  reduce 6
+
+
+state 121
+	type_code : A SP . form_code  (57)
+
+	C  shift 154
+	N  shift 155
+	T  shift 156
+	.  error
+
+	form_code  goto 157
+
+
+state 122
+	type_code : E SP . form_code  (59)
+
+	C  shift 154
+	N  shift 155
+	T  shift 156
+	.  error
+
+	form_code  goto 158
+
+
+state 123
+	type_code : L SP . byte_size  (62)
+
+	NUMBER  shift 124
+	.  error
+
+	byte_size  goto 159
+
+
+state 124
+	byte_size : NUMBER .  (51)
+
+	.  reduce 51
+
+
+state 125
+	type_code : L byte_size .  (63)
+
+	.  reduce 63
+
+
+state 126
+	cmd : TYPE SP type_code CRLF .  (8)
+
+	.  reduce 8
+
+
+state 127
+	cmd : STRU SP struct_code CRLF .  (9)
+
+	.  reduce 9
+
+
+state 128
+	cmd : MODE SP mode_code CRLF .  (10)
+
+	.  reduce 10
+
+
+state 129
+	cmd : RETR check_login SP pathname . CRLF  (13)
+
+	CRLF  shift 160
+	.  error
+
+
+state 130
+	cmd : STOR check_login SP pathname . CRLF  (14)
+
+	CRLF  shift 161
+	.  error
+
+
+state 131
+	cmd : APPE check_login SP pathname . CRLF  (15)
+
+	CRLF  shift 162
+	.  error
+
+
+state 132
+	cmd : ALLO SP NUMBER SP . R SP NUMBER CRLF  (12)
+
+	R  shift 163
+	.  error
+
+
+state 133
+	cmd : ALLO SP NUMBER CRLF .  (11)
+
+	.  reduce 11
+
+
+state 134
+	rcmd : RNFR check_login SP pathname . CRLF  (47)
+
+	CRLF  shift 164
+	.  error
+
+
+state 135
+	cmd : RNTO SP pathname CRLF .  (23)
+
+	.  reduce 23
+
+
+state 136
+	cmd : DELE check_login SP pathname . CRLF  (22)
+
+	CRLF  shift 165
+	.  error
+
+
+state 137
+	cmd : CWD check_login SP pathname . CRLF  (26)
+
+	CRLF  shift 166
+	.  error
+
+
+state 138
+	cmd : LIST check_login SP pathname . CRLF  (19)
+
+	CRLF  shift 167
+	.  error
+
+
+state 139
+	cmd : NLST check_login SP STRING . CRLF  (17)
+
+	CRLF  shift 168
+	.  error
+
+
+state 140
+	cmd : SITE SP HELP SP . STRING CRLF  (35)
+
+	STRING  shift 169
+	.  error
+
+
+state 141
+	cmd : SITE SP HELP CRLF .  (34)
+
+	.  reduce 34
+
+
+state 142
+	cmd : SITE SP UMASK check_login . CRLF  (36)
+	cmd : SITE SP UMASK check_login . SP octal_number CRLF  (37)
+
+	SP  shift 170
+	CRLF  shift 171
+	.  error
+
+
+state 143
+	cmd : SITE SP IDLE SP . NUMBER CRLF  (40)
+
+	NUMBER  shift 172
+	.  error
+
+
+state 144
+	cmd : SITE SP IDLE CRLF .  (39)
+
+	.  reduce 39
+
+
+state 145
+	cmd : SITE SP CHMOD check_login . SP octal_number SP pathname CRLF  (38)
+
+	SP  shift 173
+	.  error
+
+
+state 146
+	cmd : STAT check_login SP pathname . CRLF  (20)
+
+	CRLF  shift 174
+	.  error
+
+
+state 147
+	cmd : HELP SP STRING CRLF .  (28)
+
+	.  reduce 28
+
+
+state 148
+	cmd : MKD check_login SP pathname . CRLF  (30)
+
+	CRLF  shift 175
+	.  error
+
+
+state 149
+	cmd : RMD check_login SP pathname . CRLF  (31)
+
+	CRLF  shift 176
+	.  error
+
+
+state 150
+	cmd : STOU check_login SP pathname . CRLF  (41)
+
+	CRLF  shift 177
+	.  error
+
+
+state 151
+	cmd : SIZE check_login SP pathname . CRLF  (43)
+
+	CRLF  shift 178
+	.  error
+
+
+state 152
+	cmd : MDTM check_login SP pathname . CRLF  (44)
+
+	CRLF  shift 179
+	.  error
+
+
+state 153
+	host_port : NUMBER COMMA NUMBER . COMMA NUMBER COMMA NUMBER COMMA NUMBER =
COMMA NUMBER  (52)
+
+	COMMA  shift 180
+	.  error
+
+
+state 154
+	form_code : C .  (55)
+
+	.  reduce 55
+
+
+state 155
+	form_code : N .  (53)
+
+	.  reduce 53
+
+
+state 156
+	form_code : T .  (54)
+
+	.  reduce 54
+
+
+state 157
+	type_code : A SP form_code .  (57)
+
+	.  reduce 57
+
+
+state 158
+	type_code : E SP form_code .  (59)
+
+	.  reduce 59
+
+
+state 159
+	type_code : L SP byte_size .  (62)
+
+	.  reduce 62
+
+
+state 160
+	cmd : RETR check_login SP pathname CRLF .  (13)
+
+	.  reduce 13
+
+
+state 161
+	cmd : STOR check_login SP pathname CRLF .  (14)
+
+	.  reduce 14
+
+
+state 162
+	cmd : APPE check_login SP pathname CRLF .  (15)
+
+	.  reduce 15
+
+
+state 163
+	cmd : ALLO SP NUMBER SP R . SP NUMBER CRLF  (12)
+
+	SP  shift 181
+	.  error
+
+
+state 164
+	rcmd : RNFR check_login SP pathname CRLF .  (47)
+
+	.  reduce 47
+
+
+state 165
+	cmd : DELE check_login SP pathname CRLF .  (22)
+
+	.  reduce 22
+
+
+state 166
+	cmd : CWD check_login SP pathname CRLF .  (26)
+
+	.  reduce 26
+
+
+state 167
+	cmd : LIST check_login SP pathname CRLF .  (19)
+
+	.  reduce 19
+
+
+state 168
+	cmd : NLST check_login SP STRING CRLF .  (17)
+
+	.  reduce 17
+
+
+state 169
+	cmd : SITE SP HELP SP STRING . CRLF  (35)
+
+	CRLF  shift 182
+	.  error
+
+
+state 170
+	cmd : SITE SP UMASK check_login SP . octal_number CRLF  (37)
+
+	NUMBER  shift 183
+	.  error
+
+	octal_number  goto 184
+
+
+state 171
+	cmd : SITE SP UMASK check_login CRLF .  (36)
+
+	.  reduce 36
+
+
+state 172
+	cmd : SITE SP IDLE SP NUMBER . CRLF  (40)
+
+	CRLF  shift 185
+	.  error
+
+
+state 173
+	cmd : SITE SP CHMOD check_login SP . octal_number SP pathname CRLF  (38)
+
+	NUMBER  shift 183
+	.  error
+
+	octal_number  goto 186
+
+
+state 174
+	cmd : STAT check_login SP pathname CRLF .  (20)
+
+	.  reduce 20
+
+
+state 175
+	cmd : MKD check_login SP pathname CRLF .  (30)
+
+	.  reduce 30
+
+
+state 176
+	cmd : RMD check_login SP pathname CRLF .  (31)
+
+	.  reduce 31
+
+
+state 177
+	cmd : STOU check_login SP pathname CRLF .  (41)
+
+	.  reduce 41
+
+
+state 178
+	cmd : SIZE check_login SP pathname CRLF .  (43)
+
+	.  reduce 43
+
+
+state 179
+	cmd : MDTM check_login SP pathname CRLF .  (44)
+
+	.  reduce 44
+
+
+state 180
+	host_port : NUMBER COMMA NUMBER COMMA . NUMBER COMMA NUMBER COMMA NUMBER =
COMMA NUMBER  (52)
+
+	NUMBER  shift 187
+	.  error
+
+
+state 181
+	cmd : ALLO SP NUMBER SP R SP . NUMBER CRLF  (12)
+
+	NUMBER  shift 188
+	.  error
+
+
+state 182
+	cmd : SITE SP HELP SP STRING CRLF .  (35)
+
+	.  reduce 35
+
+
+state 183
+	octal_number : NUMBER .  (72)
+
+	.  reduce 72
+
+
+state 184
+	cmd : SITE SP UMASK check_login SP octal_number . CRLF  (37)
+
+	CRLF  shift 189
+	.  error
+
+
+state 185
+	cmd : SITE SP IDLE SP NUMBER CRLF .  (40)
+
+	.  reduce 40
+
+
+state 186
+	cmd : SITE SP CHMOD check_login SP octal_number . SP pathname CRLF  (38)
+
+	SP  shift 190
+	.  error
+
+
+state 187
+	host_port : NUMBER COMMA NUMBER COMMA NUMBER . COMMA NUMBER COMMA NUMBER =
COMMA NUMBER  (52)
+
+	COMMA  shift 191
+	.  error
+
+
+state 188
+	cmd : ALLO SP NUMBER SP R SP NUMBER . CRLF  (12)
+
+	CRLF  shift 192
+	.  error
+
+
+state 189
+	cmd : SITE SP UMASK check_login SP octal_number CRLF .  (37)
+
+	.  reduce 37
+
+
+state 190
+	cmd : SITE SP CHMOD check_login SP octal_number SP . pathname CRLF  (38)
+
+	STRING  shift 94
+	.  error
+
+	pathname  goto 193
+	pathstring  goto 96
+
+
+state 191
+	host_port : NUMBER COMMA NUMBER COMMA NUMBER COMMA . NUMBER COMMA NUMBER =
COMMA NUMBER  (52)
+
+	NUMBER  shift 194
+	.  error
+
+
+state 192
+	cmd : ALLO SP NUMBER SP R SP NUMBER CRLF .  (12)
+
+	.  reduce 12
+
+
+state 193
+	cmd : SITE SP CHMOD check_login SP octal_number SP pathname . CRLF  (38)
+
+	CRLF  shift 195
+	.  error
+
+
+state 194
+	host_port : NUMBER COMMA NUMBER COMMA NUMBER COMMA NUMBER . COMMA NUMBER =
COMMA NUMBER  (52)
+
+	COMMA  shift 196
+	.  error
+
+
+state 195
+	cmd : SITE SP CHMOD check_login SP octal_number SP pathname CRLF .  (38)
+
+	.  reduce 38
+
+
+state 196
+	host_port : NUMBER COMMA NUMBER COMMA NUMBER COMMA NUMBER COMMA . NUMBER =
COMMA NUMBER  (52)
+
+	NUMBER  shift 197
+	.  error
+
+
+state 197
+	host_port : NUMBER COMMA NUMBER COMMA NUMBER COMMA NUMBER COMMA NUMBER . =
COMMA NUMBER  (52)
+
+	COMMA  shift 198
+	.  error
+
+
+state 198
+	host_port : NUMBER COMMA NUMBER COMMA NUMBER COMMA NUMBER COMMA NUMBER CO=
MMA . NUMBER  (52)
+
+	NUMBER  shift 199
+	.  error
+
+
+state 199
+	host_port : NUMBER COMMA NUMBER COMMA NUMBER COMMA NUMBER COMMA NUMBER CO=
MMA NUMBER .  (52)
+
+	.  reduce 52
+
+
+65 terminals, 16 nonterminals
+74 grammar rules, 200 states
diff -r 03e1a37e8949 -r d46effa10a19 head/contrib/byacc/test/ftp.tab.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/head/contrib/byacc/test/ftp.tab.c	Wed Jul 25 16:21:35 2012 +0300
@@ -0,0 +1,1995 @@
+#ifndef lint
+static const char yysccsid[] =3D "@(#)yaccpar	1.9 (Berkeley) 02/21/93";
+#endif
+
+#define YYBYACC 1
+#define YYMAJOR 1
+#define YYMINOR 9
+
+#define YYEMPTY        (-1)
+#define yyclearin      (yychar =3D YYEMPTY)
+#define yyerrok        (yyerrflag =3D 0)
+#define YYRECOVERING() (yyerrflag !=3D 0)
+
+
+#ifndef yyparse
+#define yyparse    ftp_parse
+#endif /* yyparse */
+
+#ifndef yylex
+#define yylex      ftp_lex
+#endif /* yylex */
+
+#ifndef yyerror
+#define yyerror    ftp_error
+#endif /* yyerror */
+
+#ifndef yychar
+#define yychar     ftp_char
+#endif /* yychar */
+
+#ifndef yyval
+#define yyval      ftp_val
+#endif /* yyval */
+
+#ifndef yylval
+#define yylval     ftp_lval
+#endif /* yylval */
+
+#ifndef yydebug
+#define yydebug    ftp_debug
+#endif /* yydebug */
+
+#ifndef yynerrs
+#define yynerrs    ftp_nerrs
+#endif /* yynerrs */
+
+#ifndef yyerrflag
+#define yyerrflag  ftp_errflag
+#endif /* yyerrflag */
+
+#ifndef yylhs
+#define yylhs      ftp_lhs
+#endif /* yylhs */
+
+#ifndef yylen
+#define yylen      ftp_len
+#endif /* yylen */
+
+#ifndef yydefred
+#define yydefred   ftp_defred
+#endif /* yydefred */
+
+#ifndef yydgoto
+#define yydgoto    ftp_dgoto
+#endif /* yydgoto */
+
+#ifndef yysindex
+#define yysindex   ftp_sindex
+#endif /* yysindex */
+
+#ifndef yyrindex
+#define yyrindex   ftp_rindex
+#endif /* yyrindex */
+
+#ifndef yygindex
+#define yygindex   ftp_gindex
+#endif /* yygindex */
+
+#ifndef yytable
+#define yytable    ftp_table
+#endif /* yytable */
+
+#ifndef yycheck
+#define yycheck    ftp_check
+#endif /* yycheck */
+
+#ifndef yyname
+#define yyname     ftp_name
+#endif /* yyname */
+
+#ifndef yyrule
+#define yyrule     ftp_rule
+#endif /* yyrule */
+#define YYPREFIX "ftp_"
+
+#define YYPURE 0
+
+#line 26 "ftp.y"
+
+/* sccsid[] =3D "@(#)ftpcmd.y	5.20.1.1 (Berkeley) 3/2/89"; */
+
+#include <sys/param.h>
+#include <sys/socket.h>
+
+#include <netinet/in.h>
+
+#include <arpa/ftp.h>
+
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <signal.h>
+#include <ctype.h>
+#include <pwd.h>
+#include <setjmp.h>
+#include <syslog.h>
+#include <sys/stat.h>
+#include <string.h>
+#include <time.h>
+#include <assert.h>
+
+#ifdef YYBISON
+int yylex(void);
+static void yyerror(const char *);
+#endif
+
+extern	struct sockaddr_in data_dest;
+extern	int logged_in;
+extern	struct passwd *pw;
+extern	int guest;
+extern	int logging;
+extern	int type;
+extern	int form;
+extern	int debug;
+extern	int timeout;
+extern	int maxtimeout;
+extern  int pdata;
+extern	char hostname[], remotehost[];
+extern	char proctitle[];
+extern	char *globerr;
+extern	int usedefault;
+extern  int transflag;
+extern  char tmpline[];
+
+extern char **glob(char *);
+extern char *renamefrom(char *);
+extern void cwd(const char *);
+
+extern void dologout(int);
+extern void fatal(const char *);
+extern void makedir(const char *);
+extern void nack(const char *);
+extern void pass(const char *);
+extern void passive(void);
+extern void pwd(void);
+extern void removedir(char *);
+extern void renamecmd(char *, char *);
+extern void retrieve(const char *, const char *);
+extern void send_file_list(const char *);
+extern void statcmd(void);
+extern void statfilecmd(const char *);
+extern void store