[Pkg-wmaker-commits] [wmbiff] 42/92: Imported Upstream version 0.4.26

Doug Torrance dtorrance-guest at moszumanska.debian.org
Thu Aug 20 02:59:24 UTC 2015


This is an automated email from the git hooks/post-receive script.

dtorrance-guest pushed a commit to branch master
in repository wmbiff.

commit cae277f9341e323c8ae9e2b6c407e1e08d1c9e91
Author: Doug Torrance <dtorrance at monmouthcollege.edu>
Date:   Fri Nov 14 08:19:59 2014 -0600

    Imported Upstream version 0.4.26
---
 AUTHORS                      |   42 +
 COPYING                      |  340 ++
 ChangeLog                    | 1500 ++++++-
 FAQ                          |  125 +
 INSTALL                      |  182 +
 Makefile.am                  |   44 +
 Makefile.in                  |  571 +++
 NEWS                         |  209 +-
 README                       |   55 +-
 TODO                         |  107 +-
 aclocal.m4                   | 1187 ++++++
 autoconf/Makefile.am         |    2 +
 autoconf/Makefile.in         |  265 ++
 autoconf/depcomp             |  423 ++
 autoconf/install-sh          |  276 ++
 autoconf/missing             |  336 ++
 autoconf/mkinstalldirs       |  111 +
 config.h.in                  |  125 +
 configure                    | 9071 ++++++++++++++++++++++++++++++++++++++++++
 configure.ac                 |  183 +
 scripts/Makefile.am          |    2 +
 scripts/Makefile.in          |  288 ++
 scripts/security.debian.rb   |  197 +
 wmbiff/Client.h              |  129 +-
 wmbiff/Imap4Client.c         |  478 ++-
 wmbiff/LicqClient.c          |   60 +-
 wmbiff/Makefile              |  131 -
 wmbiff/Makefile.am           |   70 +
 wmbiff/Makefile.in           |  718 ++++
 wmbiff/MessageList.c         |  232 ++
 wmbiff/MessageList.h         |   13 +
 wmbiff/Pop3Client.c          |  189 +-
 wmbiff/ShellClient.c         |  248 +-
 wmbiff/charutil.c            |   89 +-
 wmbiff/charutil.h            |   22 +-
 wmbiff/gnutls-common.c       |  684 ++++
 wmbiff/gnutls-common.h       |   43 +
 wmbiff/maildirClient.c       |   70 +-
 wmbiff/mboxClient.c          |  170 +-
 wmbiff/passwordMgr.c         |  298 ++
 wmbiff/passwordMgr.h         |    8 +
 wmbiff/regulo.c              |  134 +
 wmbiff/regulo.h              |   17 +
 wmbiff/sample.wmbiffrc       |   69 +-
 wmbiff/socket.c              |  143 +-
 wmbiff/test-wmbiffrc.shell   |   24 -
 wmbiff/test_tlscomm.c        |   99 +
 wmbiff/test_wmbiff.c         |  458 +++
 wmbiff/tlsComm.c             |  548 ++-
 wmbiff/tlsComm.h             |    6 +-
 wmbiff/wmbiff-master-led.xpm |  126 +-
 wmbiff/wmbiff.1              |   49 +-
 wmbiff/wmbiff.c              | 1720 +++++---
 wmbiff/wmbiffrc.5            |  178 +-
 wmbiff/wmbiffrc.5.in         |  306 ++
 wmgeneral/Makefile.am        |   10 +
 wmgeneral/Makefile.in        |  385 ++
 wmgeneral/list.c             |  138 +-
 wmgeneral/list.h             |   20 +-
 wmgeneral/misc.c             |   14 +-
 wmgeneral/misc.h             |    4 +-
 wmgeneral/wmgeneral.c        |  434 +-
 wmgeneral/wmgeneral.h        |   32 +-
 63 files changed, 22590 insertions(+), 1617 deletions(-)

diff --git a/AUTHORS b/AUTHORS
new file mode 100644
index 0000000..da65634
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1,42 @@
+                                  Copyrights
+
+   This program was written by Gennady Belyakov [8]gb at ccat.elect.ru
+   
+   Exterior appearance was heavily derived from wminet, written by
+   Dave Clark (clarkd at skynet.ca),
+   Antoine Nulle (warp at xs4all.nl),
+   Martijn Pieterse (pieterse at xs4all.nl)
+   
+   Some code (around mailbox checking, with some modifications) was taken
+   from xled, written by
+   Jan Schoenepauck (schoenep at uni-wuppertal.de) and
+   Joachim Gassen (joachim at fb4-1112.uni-muenster.de)
+   
+   POP3 checking code was taken from wmpop3 by
+   Scott Holden (scotth at thezone.net)
+
+   Additional code was taken from xlassie, written by
+   Trent Piepho <xyzzy at speakeasy.net>
+   
+   Many thanks for:
+   Angus Mackay (amackay at gusnet.cx)
+   Jordi Mallach P�rez (jordi at sindominio.net)
+   Eugene Bobin (gene at utb.ru)
+   Helmut 'Kolbi' Kolb (office at kolbi.net)
+   Vladimir Popov (pva48 at mail.ru)
+   Jorge Garc�a (Jorge.Garcia at uv.es)
+   Nick Clarey (nclarey at 3glab.com)
+   Dwayne C. Litzenberger (dlitz at dlitz.net)
+   Mark Hurley (debian4tux at telocity.com)
+   Rob Funk (rfunk at funkinet.net)
+   Neil Spring (nspring at cs.washington.edu)
+   NAKAYAMA Takao (hoehoe at wakaba.jp)
+   Jay T Francis (jtf at u880.org)
+   David Smith (davidsmith at acm.org)
+   Beno�t Rouits (brouits at free.fr)
+   Andelko Horvat (comel at srk.fer.hr)
+   Jun-ichiro itojun Hagino (itojun at iijlab.net)
+   Peter McAlpine (pmcalpin at uoguelph.ca)
+   Paolo Gianrossi (paolino at yersinia.org)
+   Sam Izzo (izzo at humbug.net)
+
diff --git a/COPYING b/COPYING
new file mode 100644
index 0000000..d60c31a
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,340 @@
+		    GNU GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+

+		    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+

+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+

+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+

+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+			    NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+

+	    How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year  name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/ChangeLog b/ChangeLog
index f3178c4..e0d37f6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,10 +1,1432 @@
-2002-03-26 Tuesday 16:30 UTC -- Jordi Mallach <jordi at sindominio.net>
+2004-10-01 Friday 21:15 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/tlsComm.c: comment the SHUT_WR
+
+2004-10-01 Friday 21:06 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/tlsComm.c: indent, and return if no certificate came back
+	from the far side
+
+2004-10-01 Friday 21:05 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/socket.c: thwack duplicate error messages about connecting
+	to a remote server
+
+2004-10-01 Friday 21:02 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/wmbiff.c: indent
+
+2004-08-23 Monday 00:37 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/wmbiff.c: disable the secure memory warning (and its use)
+
+2004-07-03 Saturday 23:45 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* FAQ: some faqs
+
+2004-07-03 Saturday 23:43 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* scripts/security.debian.rb: handle the timeout error explicitly,
+	better for disconnected operation
+
+2004-07-03 Saturday 23:43 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/socket.c: strerror preferred to perror
+
+2004-06-28 Monday 18:20 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* scripts/security.debian.rb: fix debian #256505: a small problem
+	with the .wmbiff-sdr directory not being created
+
+2004-06-23 Wednesday 21:51 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* configure.ac: 0.4.25
+
+2004-06-23 Wednesday 21:46 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* configure.ac, wmbiff/tlsComm.c: probably fix the s390 debian
+	build problems
+
+2004-06-20 Sunday 01:03 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/tlsComm.c: oops, should pay attention to the retval of
+	tls_compare_certificates
+
+2004-06-19 Saturday 21:38 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/gnutls-common.c: warning cleanup
+
+2004-06-19 Saturday 20:53 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* configure.ac, wmbiff/Client.h, wmbiff/Imap4Client.c,
+	wmbiff/Pop3Client.c, wmbiff/gnutls-common.c,
+	wmbiff/gnutls-common.h, wmbiff/tlsComm.c, wmbiff/wmbiff.c,
+	wmgeneral/wmgeneral.c: 0.4.24, supporting newer gnutls, I think
+
+2004-06-18 Friday 21:29 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/wmbiff.c: paranoid test to see if /var/mail/nspring is
+	constructed wrong.
+
+2004-04-28 Wednesday 00:19 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/: Client.h, charutil.c, socket.c, test_wmbiff.c, wmbiff.c:
+	indent run
+
+2004-04-28 Wednesday 00:18 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/: socket.c, test_wmbiff.c: handle ip addresses instead of
+	hostnames in sock_connect
+
+2004-04-27 Tuesday 23:35 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* configure.ac: 0.4.23
+
+2004-04-27 Tuesday 23:31 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/test_wmbiff.c: ensure that sock_connect works with IP
+	addresses
+
+2004-04-21 Wednesday 21:53 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/Imap4Client.c: oops, broke the cacheHeaders flag
+
+2004-04-20 Tuesday 04:55 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/: charutil.c, charutil.h, test_wmbiff.c, wmbiff.c: factor
+	out comment stripping for testing, which seems to have passed
+
+2004-04-06 Tuesday 20:58 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/: Imap4Client.c, Pop3Client.c, test_wmbiff.c: fix debian
+	#242458 -- allow IP addresses as server names for IMAP mailboxes,
+	and also for POP3 mailboxes
+
+2004-03-28 Sunday 00:36 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* configure.ac: 0.4.22
+
+2004-03-28 Sunday 00:28 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/: Client.h, Imap4Client.c, Pop3Client.c, ShellClient.c,
+	charutil.c, maildirClient.c, mboxClient.c, passwordMgr.c, regulo.c,
+	test_tlscomm.c, tlsComm.c, tlsComm.h, wmbiff.c: lots of indent
+	changes and a change to let msglst enable header caching for imap
+
+2004-03-12 Friday 21:35 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/wmbiffrc.5.in: mention courier imapd's means of specifying
+	subfolders
+
+2004-02-14 Saturday 18:10 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/Imap4Client.c: bugfix for cyrus imap servers, thanks to
+	Jon Ramsey
+
+2004-01-01 Thursday 23:47 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* configure.ac: really call it 0.4.20
+
+2004-01-01 Thursday 07:47 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* AUTHORS, wmbiff/Client.h, wmbiff/Imap4Client.c,
+	wmbiff/ShellClient.c, wmbiff/maildirClient.c, wmbiff/mboxClient.c,
+	wmbiff/passwordMgr.c, wmbiff/wmbiff.c: Sam Izzo's patch
+
+2003-12-30 Tuesday 19:44 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* Makefile.am, configure.ac: add --disable-crypto
+
+2003-12-22 Monday 00:08 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/Imap4Client.c: print failure message if imap login fails
+
+2003-11-09 Sunday 07:01 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/sample.wmbiffrc: mac os 10.3 mail responds to a different
+	way of identifying the inbox
+
+2003-11-09 Sunday 03:16 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* configure.ac: 0.4.19
+
+2003-11-09 Sunday 03:16 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/test_tlscomm.c: fix bug #219787
+
+2003-11-08 Saturday 23:46 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* Makefile.am: helper rule for sourceforge upload (I know, I know,
+	maintenance cruft making it into the release, whatever)
+
+2003-11-08 Saturday 23:46 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/Client.h: philosophical definition of truth
+
+2003-11-08 Saturday 23:45 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/Imap4Client.c: because having both from and subject
+	headers is no longer a way to tell when the end has happened, must
+	clean up the completed command tag explicitly
+
+2003-11-08 Saturday 23:44 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/passwordMgr.c: avoid compiler warning from inconsistent
+	def of size_t as passed into printf
+
+2003-11-08 Saturday 22:58 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/: ShellClient.c, charutil.c: strcpy is not defined to
+	handle overlapping regions.  valgrind complains, rightly, so
+	reimplement lefttrim to avoid such behavior
+
+2003-11-08 Saturday 22:17 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/wmbiff.c: bump up default_sleep_interval to clean up
+	strace output while bored.
+
+2003-11-08 Saturday 22:13 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/Imap4Client.c: handle messages without subject lines in
+	msglst
+
+2003-11-07 Friday 09:11 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/passwordMgr.c: panther (mac 10.3) does not appear to
+	null-terminate passwords in the keychain for us
+
+2003-10-29 Wednesday 18:15 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/: Imap4Client.c, Imap4Client.c, Pop3Client.c: handle
+	capitalized FROM and SUBJECT headers common typical of spam spam
+	spam
+
+2003-10-28 Tuesday 23:39 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/test_tlscomm.c: indent and add another check
+
+2003-10-28 Tuesday 23:38 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/: Makefile.am, test_wmbiff.c: indent
+
+2003-10-28 Tuesday 07:09 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/: Makefile.am, test_tlscomm.c: fix bug reported by
+	Jingshao Chen <jingshaochen at sbcglobal.net> with buffering trouble,
+	and incorporate a regression test to keep it from accidentally
+	popping up again
+
+2003-10-28 Tuesday 06:56 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/: test_tlscomm.c, tlsComm.c: test for proper handling of
+	buffering small bits of expected data
+
+2003-10-26 Sunday 08:33 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/: Imap4Client.c, passwordMgr.c: sigh, I dislike running
+	make indent
+
+2003-10-26 Sunday 08:31 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* AUTHORS, wmbiff/Pop3Client.c, wmbiff/wmbiffrc.5.in: Paolo
+	Gianrossi's patch to provide msglst support for pop3 mailboxes
+
+2003-10-26 Sunday 07:42 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* check-includes.rb, wmbiff/maildirClient.c, wmbiff/socket.c:
+	include file reordering, based on wisdom from porting some other
+	networky code
+
+2003-10-26 Sunday 07:31 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* scripts/security.debian.rb: fix some ruby1.8 warnings, minor
+	cleanup
+
+2003-10-10 Friday 18:00 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* configure.ac: 0.4.18
+
+2003-10-10 Friday 15:59 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* scripts/security.debian.rb: fix ruby1.8's complaint.
+
+2003-08-31 Sunday 18:05 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* configure.ac: 0.4.17
+
+2003-08-31 Sunday 06:47 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/tlsComm.c: oops, looks like I resolved a conflict poorly
+
+2003-08-31 Sunday 04:39 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/Makefile.am: build the test cases well
+
+2003-08-31 Sunday 03:33 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/: test_wmbiff.c, tlsComm.h: check the newline bugfix
+
+2003-08-31 Sunday 03:32 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/tlsComm.c: bugfix to avoid handing odd newlines badly
+
+2003-07-31 Thursday 23:37 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/Imap4Client.c: fix some potential bugs - an access of
+	freed memory and an uninitialized reference counter
+
+2003-07-20 Sunday 00:52 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/: passwordMgr.c, test_wmbiff.c: fix a five-minute old
+	regression test failure where null was returned instead of an empty
+	string for an empty password.  not sure it matters, but maybe.
+
+2003-07-20 Sunday 00:44 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/passwordMgr.c: oops, I left a use-after-free bug in the
+	askpass code
+
+2003-07-19 Saturday 23:56 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* configure.ac, wmbiff/passwordMgr.c: use the apple keychain to
+	grab passwords! I can very nearly forget about typing them in
+	anymore
+
+2003-07-10 Thursday 17:44 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* Makefile.am: ensure that the current directory is not setgid when
+	making a distribution; this borks some untars
+
+2003-07-07 Monday 09:00 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/Imap4Client.c: warnings cleanup
+
+2003-07-07 Monday 08:57 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* configure.ac, wmbiff/Client.h, wmgeneral/wmgeneral.c: call it
+	0.4.16
+
+2003-07-07 Monday 08:43 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/: Client.h, Imap4Client.c, passwordMgr.c, test_wmbiff.c:
+	fix memfrob * bug (memfrob makes *'s zero, so password length must
+	be tracked separately
+
+2003-07-04 Friday 21:42 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/wmbiff.c: handle comments the way I meant to...
+
+2003-07-03 Thursday 11:10 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/Imap4Client.c: switch the new header cache to use
+	reference counting (better, but possibly buggy) instead of locking
+	(dumb, and certainly buggy)
+
+2003-07-03 Thursday 05:39 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/Imap4Client.c: try to avoid repetitive complaints of
+	failed connections
+
+2003-07-03 Thursday 05:34 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/socket.c: avoid repetitive error messages when hostname
+	lookup fails (such as when disconnected)
+
+2003-07-03 Thursday 05:33 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmgeneral/wmgeneral.c: last fix to geometry handling had a
+	compiler warning
+
+2003-07-03 Thursday 05:12 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmgeneral/wmgeneral.c: try doing geometry the way X intends it to
+	be done, at least as far as I can tell.
+
+2003-07-03 Thursday 01:03 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/wmbiff.c: make #'s comments only if preceded by whitespace
+	or at the beginning of the line
+
+2003-07-03 Thursday 00:53 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/wmbiff.c: looks like I'd broken the button click events
+	recently
+
+2003-07-03 Thursday 00:52 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/sample.wmbiffrc: osascript samples for driving mac mail
+	using applescript
+
+2003-06-30 Monday 23:42 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/: Imap4Client.c, tlsComm.c: warning message beautification
+
+2003-06-08 Sunday 07:01 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/: Client.h, Imap4Client.c, MessageList.c, MessageList.h,
+	ShellClient.c: general rewrite of the msglst headers, so that the
+	list is pre-cached for responsiveness.
+
+2003-06-08 Sunday 06:59 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/wmbiffrc.5.in: document msglst and buttontwo
+
+2003-06-08 Sunday 06:59 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/wmbiff.c: show a watch pointer while working behind the
+	scenes
+
+2003-06-03 Tuesday 04:57 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* autogen.sh: enable dependency tracking
+
+2003-04-17 Thursday 05:04 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* scripts/security.debian.rb: trap socket errors
+
+2003-04-17 Thursday 01:56 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* scripts/security.debian.rb: print the detailed version
+
+2003-04-17 Thursday 01:56 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/: Client.h, ShellClient.c, passwordMgr.c: space for detail
+	in grab command output, use the detail to populate a message list
+	in a getheaders function (eg. can see the list of thought to be
+	updated packages if using hte security.debian script
+
+2003-04-17 Thursday 01:54 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/test-wmbiffrc.shell: test usingthe debian script, allows
+	trying shell get headers
+
+2003-04-17 Thursday 01:54 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/tlsComm.c: try to print a helpful hint message to use
+	gnutls-cli-debug
+
+2003-04-16 Wednesday 23:30 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* configure.ac: downgrade configure.ac use of AM_INIT_AUTOMAKE to
+	support automake-1.5
+
+2003-04-16 Wednesday 08:21 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmgeneral/wmgeneral.c: export GetColor
+
+2003-04-16 Wednesday 08:18 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/: Client.h, Imap4Client.c, MessageList.c, MessageList.h,
+	tlsComm.c, wmbiff.c: indent run
+
+2003-04-16 Wednesday 08:16 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/Imap4Client.c: get headers / message list support
+
+2003-04-16 Wednesday 08:16 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/Makefile.am: messagelist
+
+2003-04-16 Wednesday 08:15 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/tlsComm.c: rename state to tls_state for clarity, small
+	cleanup, fixes for buffering several lines in an expectation
+
+2003-04-16 Wednesday 08:14 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/: wmbiff.c, Client.h: message list, button 2 support
+
+2003-04-16 Wednesday 08:13 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/: MessageList.c, MessageList.h: list new messages,
+	currently only with an imap driver
+
+2003-04-09 Wednesday 04:51 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* autogen.sh: fall back to automake-1.5 if necessary
+
+2003-04-07 Monday 10:10 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/tlsComm.c: invalid is returned when it doesn't match?
+
+2003-04-07 Monday 09:41 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/tlsComm.c: fix some info messages - drop complaints about
+	version 0.2.3 of gnutls, mention certfile.
+
+2003-04-07 Monday 09:33 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/wmbiffrc.5.in: doc certfile
+
+2003-04-07 Monday 09:16 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/tlsComm.c: handle certfile errors properly; positive
+	return values from gnutls_certificate_set_x509_trust_file appear
+	okay.
+
+2003-03-30 Sunday 11:47 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/: passwordMgr.c, test_wmbiff.c: oh, now I get why that
+	foolish null-termination was present.  it's better now
+
+2003-03-30 Sunday 11:23 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* configure.ac: 0.4.15
+
+2003-03-30 Sunday 11:22 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/wmbiffrc.5.in: note the hash caveat
+
+2003-03-30 Sunday 11:05 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/passwordMgr.c: remove (unreleased) foolhardy
+	null-termination
+
+2003-03-30 Sunday 10:57 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/test_wmbiff.c: just so as not to confuse anyone that
+	wmbiff allows #'s in passwords
+
+2003-03-30 Sunday 10:38 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* README, wmbiff/wmbiff.c, wmgeneral/wmgeneral.c,
+	wmgeneral/wmgeneral.h: support setting the background color using
+	-bg
+
+2003-03-28 Friday 08:16 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/test_wmbiff.c: check that passwords with # can be parsed
+
+2003-03-28 Friday 08:16 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/wmbiffrc.5.in: doc password parsing damage
+
+2003-03-11 Tuesday 08:07 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* README: gnupg reorganized their website
+
+2003-03-11 Tuesday 08:03 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* configure.ac: provide a helpful message as to where gnutls and
+	libgcrypt can be found in configure.ac
+
+2003-03-06 Thursday 21:15 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/wmbiff.c: fix debian bug #183529
+
+2003-03-03 Monday 19:06 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/passwordMgr.c: make returned password length consistent
+	with stored password length
+
+2003-03-02 Sunday 02:37 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* configure.ac, wmbiff/Imap4Client.c, wmbiff/passwordMgr.c,
+	wmbiff/passwordMgr.h: in-memory frobnication of imap passwords
+
+2003-03-02 Sunday 02:17 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/: Imap4Client.c, Makefile.am, Pop3Client.c, regulo.c,
+	regulo.h, socket.c, test_wmbiff.c, wmbiff.c: hostname paranoia
+	patch -- use -relax to skip hostname validation check, parse
+	ambiguous config lines
+
+2003-03-02 Sunday 01:04 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/wmbiff.c, wmgeneral/wmgeneral.c: indent run
+
+2003-02-13 Thursday 21:07 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* Makefile.am, configure.ac: 0.4.14
+
+2003-02-08 Saturday 21:04 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/: wmbiff.1, wmbiffrc.5.in: document restart schemes
+
+2003-02-08 Saturday 07:06 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/wmbiff.c: restart wmbiff also on ctrl-shift-left click
+
+2003-02-08 Saturday 03:45 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/wmbiff.c: restart on sig usr1 using exec()
+
+2003-02-08 Saturday 03:43 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* autogen.sh: I think symlink is okay for autoreconf
+
+2003-02-08 Saturday 03:42 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmgeneral/: wmgeneral.c, wmgeneral.h: much prefer if wmgeneral
+	proclaimed that it would not modify argv; I think it's even true
+
+2003-01-28 Tuesday 11:14 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* configure.ac: remove check for gnuregex
+
+2003-01-28 Tuesday 11:13 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/Imap4Client.c: bugfix to avoid problems with the new regex
+	scheme and the default mailbox (aliasing sucks.)
+
+2003-01-28 Tuesday 11:12 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/charutil.h: remove gnuregex.h incl
+
+2003-01-28 Tuesday 11:12 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/wmbiff.c: newline after error message
+
+2003-01-25 Saturday 04:54 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* autogen.sh: remove dangling symlinks config.guess, config.sub
+
+2003-01-25 Saturday 04:33 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmgeneral/list.c: compiler warning appeasement (shadowing index)
+
+2003-01-25 Saturday 04:32 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/Makefile.am: use the non gnu-make form of the
+	indent-a-c-file rule
+
+2003-01-22 Wednesday 01:56 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* autogen.sh: make sure ChangeLog exists locally.
+
+2003-01-21 Tuesday 08:56 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/tlsComm.c: fix some minor damage when select is
+	interrupted (EINTR)
+
+2003-01-21 Tuesday 05:55 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* autogen.sh: warn if autoconf/libgnutls.m4 does not exist
+
+2003-01-20 Monday 19:52 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/Makefile.am: add libgcrypt libraries if used to
+	test_wmbiff
+
+2003-01-20 Monday 19:52 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* configure.ac: remove possibly unneeded check for gdbm
+
+2003-01-19 Sunday 13:13 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/: Client.h, Imap4Client.c, Makefile.am, Pop3Client.c,
+	ShellClient.c, charutil.c, charutil.h, passwordMgr.c,
+	test_wmbiff.c, tlsComm.c, wmbiff.c: general portability fixes, 
+	including HAVE___ATTRIBUTE__
+
+2003-01-19 Sunday 13:12 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/: regulo.c, regulo.h: posix based regular expression
+	handling with a not so lame interface
+
+2003-01-19 Sunday 13:11 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* configure.ac: portability fixes: HAVE___ATTRIBUTE__ (maybe),
+	libnsl (solaris), -no-cpp-precomp (os x)
+
+2003-01-04 Saturday 03:39 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* configure.ac, wmbiff/wmbiff.c: 0.4.12, release to fix bad
+	-geometry handling
+
+2003-01-03 Friday 20:37 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/wmbiff.c: fix geometry argument handling bug (Debian
+	#175220)
+
+2002-12-29 Sunday 07:46 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* scripts/security.debian.rb: I meant to say 6 hours
+
+2002-12-29 Sunday 05:42 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/sample.wmbiffrc: shell recipe for security.debian.rb
+
+2002-12-29 Sunday 05:28 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* scripts/security.debian.rb: didn't mean to commit with a 6 minute
+	refresh interval
+
+2002-12-29 Sunday 04:54 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* Makefile.am, check-includes.rb, configure.ac: add scripts
+	subdirectory to build system
+
+2002-12-29 Sunday 04:54 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* scripts/: Makefile.am, security.debian.rb: new scripts directory
+	to hold debian security checker and install it.
+
+2002-12-29 Sunday 03:25 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/wmbiff.c: general cleanup - use strdup_ordie,
+	malloc_ordie.  reduce using ints and chars interchangeably.  static
+	annotations on module-local variables
+
+2002-12-29 Sunday 03:22 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/tlsComm.c: bad_certificate called as if void, so change
+	the signature
+
+2002-12-29 Sunday 03:22 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* configure.ac: autodetect whether to use poll()
+
+2002-12-29 Sunday 02:47 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmgeneral/: Makefile.am, wmgeneral.c, wmgeneral.h: make
+	AddMouseRegion take an unsigned int for the region index (which is
+	an _index_ which means negative values need not apply)
+
+2002-12-29 Sunday 02:31 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/: charutil.c, charutil.h: change signature of *Trim to
+	reflect that they can't fail (void instead of int); the return
+	values are ignored in wmbiff
+
+2002-12-29 Sunday 01:36 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/wmbiff.c: reorder functions to avoid pre-declaration. 
+	should simplify reading the (now very long) code
+
+2002-12-29 Sunday 01:11 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmgeneral/: misc.c, misc.h: exec command can take a const char *
+
+2002-12-29 Sunday 01:05 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/sample.wmbiffrc: another askpass recipe
+
+2002-12-29 Sunday 00:57 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/wmbiff.c: cleanup unused variables
+
+2002-12-29 Sunday 00:57 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/Makefile.am: surgical indent rule
+
+2002-12-29 Sunday 00:37 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* configure.ac, wmbiff/wmbiff.c: use automake/autoconf defined
+	PACKAGE_VERSION and PACKAGE_BUGREPORT
+
+2002-12-29 Sunday 00:15 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/passwordMgr.c: support arbitrarily long password query
+	commands
+
+2002-12-29 Sunday 00:14 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/wmbiff.c: configuration file parsing cleanup, support
+	longer configuration options, remove some ad-hockery in favor of
+	sscanf
+
+2002-12-13 Friday 05:38 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* configure.ac, wmbiff/tlsComm.c, wmbiff/wmbiff.1, wmbiff/wmbiff.c:
+	0.4.10, -skip-certificate-check option
+
+2002-12-09 Monday 21:45 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* AUTHORS, wmbiff/sample.wmbiffrc, wmbiff/wmbiff.c,
+	wmbiff/wmbiffrc.5.in: Peter McAlpine's globalnotify patch
+
+2002-12-09 Monday 21:45 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/Imap4Client.c: minor change to timeout behavior, just
+	delay a while before next check
+
+2002-12-02 Monday 07:16 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* configure.ac: require gnutls 0.5.9, release 0.4.9
+
+2002-11-30 Saturday 07:58 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/Imap4Client.c: more robust ETIMEDOUT handling -- just
+	chill out for a few minues rather than blacklist as a compromise
+	between the responsiveness of not retrying unresponsive servers and
+	the robustness of prodding on.	the right thing is probably a
+	non-blocking connect, but that's  messy
+
+2002-11-15 Friday 08:06 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/tlsComm.c: should really be able to catch these problems
+	earler - without gnutls, the build would fail
+
+2002-11-15 Friday 08:05 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* autogen.sh: red hat hackery
+
+2002-11-13 Wednesday 06:44 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/wmbiff.1, wmbiff/wmbiff.c, wmgeneral/wmgeneral.c,
+	wmgeneral/wmgeneral.h: a method for not using the withdrawn state
+
+2002-11-12 Tuesday 08:27 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* Makefile.am, configure.ac, wmbiff/wmbiff.c, wmbiff/wmbiffrc.5.in,
+	wmgeneral/wmgeneral.c, wmgeneral/wmgeneral.h: Allow automatic
+	sizing of the wmbiff window, effective for other window managers.
+
+2002-10-26 Saturday 23:17 UTC -- Jordi Mallach <jordi at sindominio.net>
+
+	* FromCVS.sh, autogen.sh: Rename FromCVS.sh to autogen.sh, which is
+	the "common" name for such script.
+
+2002-10-26 Saturday 23:15 UTC -- Jordi Mallach <jordi at sindominio.net>
+
+	* ChangeLog, Makefile.am, maint/changelog-header,
+	maint/prerelease.sh: Stop doing the ChangeLog header hack. Instead,
+	remove ChangeLog entirely from CVS and get it generated correctly
+	on dist. Remove unneeded maint scripts.
+
+2002-10-26 Saturday 23:12 UTC -- Jordi Mallach <jordi at sindominio.net>
+
+	* FromCVS.sh: Add automake-1.7 support.
+
+2002-10-20 Sunday 21:58 UTC -- Jordi Mallach <jordi at sindominio.net>
+
+	* wmbiff/: wmbiff.1, wmbiffrc.5.in: do not specify Debian
+	GNU/Linux... I'm actually more interested in the Hurd right now :)
+
+2002-10-14 Monday 05:52 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/maildirClient.c: use mkstemp instead of mktemp to appease
+	the compiler
+
+2002-10-14 Monday 01:47 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/wmbiffrc.5.in: add the 'this file automatically generated'
+	tag
+
+2002-10-13 Sunday 21:28 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/: Imap4Client.c, tlsComm.c, tlsComm.h: Check certificate
+	hostname, using gnutls's new function
+
+2002-10-13 Sunday 21:27 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/Client.h: a formatting glitch
+
+2002-10-13 Sunday 21:27 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* FromCVS.sh, Makefile.am: use autoreconf instead of the ad-hockery
 
-	* ChangeLog, NEWS, wmbiff/Makefile: Released WMBiff 0.3.8.
+2002-09-25 Wednesday 06:16 UTC -- Neil Spring <nspring at cs.washington.edu>
 
-2002-03-18 Monday 21:13 UTC -- Neil Spring <nspring at cs.washington.edu>
+	* FAQ: why doesn't wmbiff update my mailbox count when I read a
+	message
 
-	* TODO: add failure handling in expect
+2002-09-20 Friday 19:50 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* FromCVS.sh: support redhat autoconf sadness
+
+2002-09-19 Thursday 07:00 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/test_wmbiff.c: allow test to run when nnot linked with
+	gnutls
+
+2002-09-18 Wednesday 23:45 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/maildirClient.c: compiler warning fixes
+
+2002-09-18 Wednesday 23:43 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* ChangeLog, configure.ac, wmbiff/Client.h, wmbiff/Imap4Client.c,
+	wmbiff/Makefile.am, wmbiff/maildirClient.c, wmbiff/test_wmbiff.c,
+	wmbiff/wmbiffrc.5.in: bugfix to allow imap mailbox filenames to
+	contain spaces, test that it works; also, prepare 0.4.8
+
+2002-09-14 Saturday 18:51 UTC -- Dwayne C. Litzenberger <dlitz at dlitz.net>
+
+	* wmbiff/: Client.h, maildirClient.c, wmbiffrc.5.in: *
+	maildirClient: Added support for quick checking of writable
+	network-mounted   maildirs where directory caching normally causes
+	unwanted delays.
+
+2002-08-16 Friday 07:55 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* ChangeLog, configure.ac, autoconf/libgnutls.m4,
+	wmbiff/Imap4Client.c, wmbiff/gnutls-common.c,
+	wmbiff/gnutls-common.h, wmbiff/tlsComm.c: handle new
+	gnutls/gnutls.h convention, release 0.4.7
+
+2002-08-06 Tuesday 08:05 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* FromCVS.sh: seek out and use athe underrated automake 1.6.
+
+2002-07-27 Saturday 17:50 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/: Imap4Client.c, tlsComm.c: trivial formatting fixes
+
+2002-07-19 Friday 18:51 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* ChangeLog, configure.ac: release version 0.4.6
+
+2002-07-18 Thursday 02:55 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/wmbiff.c: ignore sigpipe, possible bugfix for abnormal
+	termination during suspend for imap/gnutls
+
+2002-07-04 Thursday 08:00 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* ChangeLog, configure.ac: last minute changes for 0.4.5
+
+2002-07-04 Thursday 01:07 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/: Imap4Client.c, Makefile.am, Pop3Client.c, charutil.c,
+	tlsComm.c, wmbiff.c: valgrind debugging, and support for -exit. 
+	some bugs were probably fixed, but since nobody has noticed yet, I
+	don't know if they mattered
+
+2002-07-04 Thursday 00:45 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmgeneral/wmgeneral.c: reminder in where valgrind complains
+
+2002-07-04 Thursday 00:45 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* Makefile.am: add a top-level 'indent' rule
+
+2002-07-03 Wednesday 02:28 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/tlsComm.c: doubled the timeout to 40 seconds.
+
+2002-06-26 Wednesday 19:04 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* ChangeLog, Makefile.am, autoconf/Makefile.am: die configure.in!
+	die acconfig.h!
+
+2002-06-26 Wednesday 18:56 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* ChangeLog, FromCVS.sh, Makefile.am, configure.ac, configure.in,
+	autoconf/acconfig.h: migrate to newer autoconf (2.5) to try to
+	debug making-from-scratch problem and get rid of acconfig.h cruft
+
+2002-06-25 Tuesday 23:52 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* Makefile.am: tiny automake 1.6 fix (doesn't appear to use
+	stamp-h.  who knew.)
+
+2002-06-25 Tuesday 23:33 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* autoconf/libgnutls.m4: trivial upstream bugfix
+
+2002-06-25 Tuesday 23:29 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/Makefile.am: never underestimate the complexity of
+	solutions involving automake
+
+2002-06-25 Tuesday 23:24 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* configure.in, wmbiff/Makefile.am: corrections to conditional
+	compilation of gnutls-common for automake 1.5 (and thereby the true
+	automake way)
+
+2002-06-25 Tuesday 23:15 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* configure.in, wmbiff/Makefile.am: only compile gnutls-common.[ch]
+	if gnutls is configured in (duh), and only check for gcrypt.h if
+	libgcrypt is installed and current
+
+2002-06-24 Monday 07:18 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* ChangeLog, FromCVS.sh: roughly finished 0.4.4
+
+2002-06-24 Monday 07:16 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/tlsComm.c: restore certificate checking
+
+2002-06-24 Monday 07:15 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/: gnutls-common.c, gnutls-common.h: indent run
+
+2002-06-24 Monday 01:23 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/Makefile.am, configure.in, wmbiff/Makefile.am: basic
+	gnutls 0.4.3 support (that is, it compiles.)
+
+2002-06-24 Monday 01:18 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/: gnutls-common.c, gnutls-common.h, tlsComm.c: basic
+	gnutls 0.4.3 support (that is, it compiles.)
+
+2002-06-23 Sunday 01:26 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/wmbiff.c: cleanup to periodic mail checking, removal of
+	the first mail check - now all cases are the same
+
+2002-06-21 Friday 04:34 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/wmbiff.c: y_ and x_origin, and num_mailboxes constants,
+	highlight color for fn, restructured mailbox creation routines
+
+2002-06-21 Friday 04:31 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/Pop3Client.c: splint
+
+2002-06-21 Friday 04:31 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/: LicqClient.c, ShellClient.c, charutil.c,
+	maildirClient.c, mboxClient.c, passwordMgr.c, test_wmbiff.c:
+	config.h
+
+2002-06-21 Friday 04:30 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/Imap4Client.c: clarity and splint
+
+2002-06-21 Friday 04:29 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/Client.h: splint support
+
+2002-06-21 Friday 04:29 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/wmbiff.1: highlight color
+
+2002-06-21 Friday 04:28 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/Makefile.am: verify that config.h is included in each .c
+	file
+
+2002-06-15 Saturday 09:05 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* configure.in: likely bugfix for newer autoconf?
+
+2002-06-15 Saturday 09:04 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* Makefile.am: keep automake1.6 happy
+
+2002-06-08 Saturday 22:22 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* ChangeLog, configure.in: release 0.4.3 final updates
+
+2002-06-08 Saturday 22:20 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/wmbiff.c: make the background black when using fonts
+
+2002-06-08 Saturday 22:15 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmgeneral/: wmgeneral.c, wmgeneral.h: font support, ability to
+	erase rectangles
+
+2002-06-08 Saturday 22:14 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/Client.h: slightly changed debug messages; exists() is
+	more a test -f than a test -e
+
+2002-06-08 Saturday 22:13 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/wmbiff.1: documentation of -fg and -font options
+
+2002-06-08 Saturday 22:13 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/: Imap4Client.c, ShellClient.c: cleanup for splint
+	annotations
+
+2002-06-08 Saturday 22:13 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/wmbiff.c: basic font support, color selection, cleanup to
+	default configuration code, bugifx and cleanup to mouse region code
+
+2002-06-08 Saturday 21:40 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/socket.c: need config.h to get IPv6 support
+
+2002-06-01 Saturday 18:10 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* ChangeLog: 0.4.2
+
+2002-06-01 Saturday 17:58 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* configure.in, wmbiff/wmbiff.c: oops, didn't really want to
+	release with the crazy font stuff quite yet
+
+2002-06-01 Saturday 07:03 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* ChangeLog, configure.in, wmbiff/test-wmbiffrc.shell: release
+	0.4.1
+
+2002-06-01 Saturday 07:01 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* AUTHORS: release preparation
+
+2002-06-01 Saturday 06:47 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmgeneral/wmgeneral.h: prototypes for basic font support
+
+2002-06-01 Saturday 06:47 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmgeneral/wmgeneral.c: indent run
+
+2002-06-01 Saturday 06:02 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/: Client.h, ShellClient.c, charutil.c, mboxClient.c:
+	indent run
+
+2002-06-01 Saturday 06:01 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/wmbiff.c: font support, disabled by default
+
+2002-06-01 Saturday 06:00 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/tlsComm.c: a start at certificate checking (a daunting
+	task at the moment)
+
+2002-06-01 Saturday 05:59 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/Client.h: declare exists()
+
+2002-06-01 Saturday 05:51 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmgeneral/wmgeneral.c: some basic font support, renaming some
+	variables for clarity
+
+2002-06-01 Saturday 05:45 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/socket.c: correct date
+
+2002-06-01 Saturday 05:42 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* configure.in, wmbiff/socket.c: IPv6 support using getaddrinfo
+	from Jun-ichiro itojun Hagino <itojun at iijlab.net>
+
+2002-05-03 Friday 05:51 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* ChangeLog, configure.in: Release 0.4.0
+
+2002-05-03 Friday 05:51 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* Makefile.am: don't list TODO changes in ChangeLog, to avoid
+	confusion
+
+2002-05-03 Friday 05:43 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/mboxClient.c: type casting hackery to help architectures I
+	don't have
+
+2002-05-03 Friday 05:42 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/: sample.wmbiffrc, wmbiffrc.5.in: lpq example creep
+
+2002-05-03 Friday 05:42 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/ShellClient.c: bugfix when alternates between numeric and
+	text
+
+2002-04-29 Monday 02:01 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/: Client.h, ShellClient.c, charutil.c, charutil.h: lclint
+	cleanups - strdup_ordie, some null annotations
+
+2002-04-27 Saturday 08:54 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/: Client.h, ShellClient.c, passwordMgr.c: cleanup to use
+	grabCommandOutput in passwordMgr instead of duplicating the
+	popen/fgets/pclose code
+
+2002-04-27 Saturday 08:29 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/: Client.h, Makefile.am, charutil.c, passwordMgr.c,
+	passwordMgr.h, test_wmbiff.c: move passwordMgr testing to
+	test_wmbiff.c; catch a small bug in handling empty passwords
+
+2002-04-27 Saturday 08:29 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* FromCVS.sh: apparently aclocal barfs when macros are defined both
+	in the system directory and in a local copy.  semper fragile.
+
+2002-04-25 Thursday 20:28 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* README: add a note about gnutls version 0.3.5
+
+2002-04-25 Thursday 18:33 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* configure.in: hack attempt at supporting gnutls built locally
+
+2002-04-25 Thursday 17:31 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* ChangeLog, FromCVS.sh, autoconf/libgcrypt.m4,
+	autoconf/libgnutls.m4: add m4 macros for libgcrypt and libgnutls to
+	the repository, so that FromCVS can be run to regenerate
+	configure.in, even on systems without gnutls.
+
+2002-04-20 Saturday 09:55 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/Makefile.am: correct a problem uncovered by sourceforge's
+	compile farm
+
+2002-04-20 Saturday 09:27 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/ShellClient.c: BSD fix (no strndup, no sighandler_t)
+
+2002-04-20 Saturday 09:12 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/: LicqClient.c, mboxClient.c: move msgs=-1 assignment on
+	failure to the common openMailbox()
+
+2002-04-20 Saturday 08:53 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* ChangeLog, configure.in, wmbiff/Client.h: update meta-information
+	for prerelease 5
+
+2002-04-20 Saturday 08:51 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/Makefile.am: correct syntax for making a test program
+
+2002-04-20 Saturday 08:13 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/sample.wmbiffrc: finish deprecating
+
+2002-04-20 Saturday 08:12 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/: sample.wmbiffrc, wmbiffrc.5.in: document back-tick
+	expansion, deprecate mbox style without mbox: prefix
+
+2002-04-20 Saturday 07:54 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/: Client.h, LicqClient.c, ShellClient.c, mboxClient.c:
+	oops (indent)
+
+2002-04-20 Saturday 07:53 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/: LicqClient.c, mboxClient.c: refactor mailbox stat()'ting
+	to reduce duplicated code and supprort backticks.
+
+2002-04-20 Saturday 07:52 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/ShellClient.c: refactor command execution code to support
+	backtick foo expansion
+
+2002-04-20 Saturday 07:50 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/: Makefile.am, test_wmbiff.c: add tests for bbacktick
+	expansion
+
+2002-04-20 Saturday 07:49 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/Client.h: ctime has become useless; new prototypes to
+	handle backtick
+
+2002-04-16 Tuesday 07:37 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* ChangeLog, wmbiff/Client.h, wmbiff/Imap4Client.c,
+	wmbiff/LicqClient.c, wmbiff/Pop3Client.c, wmbiff/mboxClient.c,
+	wmbiff/passwordMgr.c, wmbiff/wmbiff.c: remove vestigial pc->open()
+
+2002-04-16 Tuesday 07:08 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/test-make.sh: unnecessary now that autoconf is involved
+
+2002-04-15 Monday 22:58 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* Makefile.am: dist the FAQ
+
+2002-04-15 Monday 21:19 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmgeneral/: Makefile.am, list.c, list.h, misc.c, misc.h,
+	wmgeneral.c, wmgeneral.h: run make indent; also tolerate standard
+	geometry string (dumping the dimensions provided)
+
+2002-04-15 Monday 21:06 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/wmbiff.c: bugfix to sigchld_handler (argh)
+
+2002-04-15 Monday 08:15 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* ChangeLog, Makefile.am, configure.in, wmbiff/Makefile.am,
+	autoconf/Makefile.am: try to make the distcheck target work
+	correctly.  voodoo.
+
+2002-04-15 Monday 08:14 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* FAQ: a little documentation
+
+2002-04-15 Monday 02:21 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/wmbiff.c: treat  all gicu messages as new (they're unread)
+
+2002-04-15 Monday 02:10 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* configure.in: chmod 0444 wmbiffrc.5 to remind me not to try to
+	edit it.
+
+2002-04-15 Monday 02:09 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/wmbiffrc.5.in: document finger, changes to shell
+
+2002-04-15 Monday 01:58 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/: ShellClient.c, wmbiff.c: waitpid until done
+
+2002-04-15 Monday 01:48 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* configure.in: slightly nicer message
+
+2002-04-15 Monday 01:47 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* ChangeLog, configure.in, wmbiff/wmbiff-master-contrast.xpm:
+	0.4.0pre4 - finger support, text from shell support, minor code
+	reorganization
+
+2002-04-15 Monday 01:38 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* AUTHORS, README: add Andelko Horvat to the list of contributors,
+	remove author list from README
+
+2002-04-15 Monday 01:30 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/test-wmbiffrc.shell: test finger as well
+
+2002-04-15 Monday 01:30 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/Client.h: TextStatus to hold a three-character status
+	message
+
+2002-04-15 Monday 01:30 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/wmbiff.c: support TextString as status; factor
+	blitMsgCounters as displayMsgCounters was starting to get ugly, add
+	finger recipe to use ShellClient instead of a separate module
+
+2002-04-15 Monday 01:26 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/passwordMgr.c: use chomp to remove the newline from
+	ssh-askpass output
+
+2002-04-15 Monday 01:26 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/: charutil.c, charutil.h: duplicate perl's chomp()
+
+2002-04-15 Monday 01:26 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/ShellClient.c: return sigchld to default hander before
+	using popen; handle text input. Much complexity, I hope it's worth
+	it.
+
+2002-04-15 Monday 01:25 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/wmbiff-master-led.xpm: support yellow text
+
+2002-04-15 Monday 01:24 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/Makefile.am: derive wmbiff-master-contrast.xpm from
+	wmbiff-master-led.xpm
+
+2002-04-12 Friday 05:54 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/socket.c: extra debugging messages, to be in-line with our
+	-debug to stdout philosophy
+
+2002-04-11 Thursday 21:39 UTC -- Jordi Mallach <jordi at sindominio.net>
+
+	* autoconf/: install-sh, missing, mkinstalldirs: Shouldn't be in
+	CVS...
+
+2002-04-11 Thursday 18:24 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* configure.in: attempt to fix Jordi's configure bug
+
+2002-04-11 Thursday 07:24 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/Pop3Client.c: APOP bugfix (unreleased bug)
+
+2002-04-09 Tuesday 07:52 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* ChangeLog, configure.in: bump version to 0.4.0pre3 - permissions
+	checking for .wmbiffrc added.
+
+2002-04-09 Tuesday 07:47 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* Makefile.am: try to tell the difference between running make dist
+	with cvs and missing cvs2cl (an error), and running make dist
+	without cvs (which should be ok).
+
+2002-04-09 Tuesday 07:45 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/: LicqClient.c, maildirClient.c, mboxClient.c: some
+	explicit casts to make compiling on non-linux a bit more
+	warning-free
+
+2002-04-09 Tuesday 07:44 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/wmbiff.c: permissions checking for .wmbiffrc (if it
+	exists), some minor cleanup associated with this.
+
+2002-04-09 Tuesday 07:43 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/Makefile.am: _DATA files don't get distributed, add the
+	skins into extra_dist. automake can be confusing
+
+2002-04-08 Monday 09:35 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* configure.in, wmbiff/wmbiffrc.5, wmbiff/wmbiffrc.5.in:
+	automatically generate wmbiffrc.5 based on the results of
+	configure, so that the configure-time chosen defaults are
+	accurately shown
+
+2002-04-07 Sunday 19:30 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* configure.in: don't try to configure gnutls if libz or libgdbm
+	aren't installed
+
+2002-04-07 Sunday 19:30 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* FromCVS.sh: allow for automake 1.5's need for depcomp
+
+2002-04-07 Sunday 05:08 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* COPYING, ChangeLog, FromCVS.sh, INSTALL, Makefile.am,
+	configure.in, autoconf/acconfig.h, autoconf/install-sh,
+	autoconf/missing, autoconf/mkinstalldirs, maint/changelog-header,
+	wmbiff/Client.h, wmbiff/Imap4Client.c, wmbiff/LicqClient.c,
+	wmbiff/Makefile, wmbiff/Makefile.am, wmbiff/Pop3Client.c,
+	wmbiff/charutil.h, wmbiff/maildirClient.c, wmbiff/mboxClient.c,
+	wmbiff/tlsComm.c, wmbiff/wmbiff.c, wmgeneral/Makefile.am,
+	wmgeneral/wmgeneral.c: use automake / autoconf; after checkout run
+	./FromCVS.sh
+
+2002-04-07 Sunday 03:23 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* AUTHORS: automake required file, duplicated from README
+
+2002-04-05 Friday 19:44 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/wmbiff-master-contrast.xpm: a first cut higher-contrast
+	skin
+
+2002-04-05 Friday 19:43 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/: Makefile, sample.wmbiffrc, test-make.sh, wmbiff.c:
+	askpass - invoke ssh-askpass to fill in passwords for IMAP servers;
+	skin - dynamically load an .xpm background
+
+2002-04-05 Friday 19:42 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/wmbiffrc.5: documentation of askpass and skin
+
+2002-04-05 Friday 19:08 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/tlsComm.c: explicit handling of timeouts
+
+2002-04-05 Friday 19:02 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/passwordMgr.c: askpass having a space in it is an INFO,
+	not an ERR.
+
+2002-04-04 Thursday 08:51 UTC -- Neil Spring <nspring at cs.washington.edu>
+
+	* wmbiff/: Client.h, Imap4Client.c, Makefile, Pop3Client.c,
+	passwordMgr.c, passwordMgr.h, sample.wmbiffrc, test-make.sh:
+	interactive password prompting support for imap - leave password in
+	the : format blank to use
+
+2002-03-26 Tuesday 16:30 UTC -- Jordi Mallach <jordi at sindominio.net>
+
+	* ChangeLog, wmbiff/Makefile: Released WMBiff 0.3.8.
 
 2002-03-18 Monday 09:47 UTC -- Neil Spring <nspring at cs.washington.edu>
 
@@ -24,10 +1446,6 @@
 	tlsComm.c: fixed misunderstanding of the use of ## in macros with
 	strings - the compiler does the concatenation, not the preprocessor
 
-2002-03-12 Tuesday 09:15 UTC -- Neil Spring <nspring at cs.washington.edu>
-
-	* TODO: additional todo list items
-
 2002-03-11 Monday 00:11 UTC -- Neil Spring <nspring at cs.washington.edu>
 
 	* wmbiff/tlsComm.c: slightly better message on expect failure
@@ -153,7 +1571,7 @@
 
 2002-02-03 Sunday 22:48 UTC -- Jordi Mallach <jordi at sindominio.net>
 
-	* ChangeLog, NEWS: Released WMBiff 0.3.7.
+	* ChangeLog: Released WMBiff 0.3.7.
 
 2002-02-03 Sunday 22:43 UTC -- Jordi Mallach <jordi at sindominio.net>
 
@@ -161,10 +1579,9 @@
 
 2002-02-02 Saturday 18:04 UTC -- Jordi Mallach <jordi at sindominio.net>
 
-	* NEWS, wmbiff/Client.h, wmbiff/Imap4Client.c, wmbiff/Makefile,
-	wmbiff/Pop3Client.c, wmbiff/charutil.h: Makefile fixes from Simon
-	L. Nielsen, which help building wmbiff in FreeBSD.  Fixed the
-	previous IMAP regex patch.
+	* wmbiff/: Client.h, Imap4Client.c, Makefile, Pop3Client.c,
+	charutil.h: Makefile fixes from Simon L. Nielsen, which help
+	building wmbiff in FreeBSD.  Fixed the previous IMAP regex patch.
 
 2002-01-27 Sunday 20:20 UTC -- Jordi Mallach <jordi at sindominio.net>
 
@@ -173,7 +1590,7 @@
 
 2002-01-27 Sunday 19:59 UTC -- Jordi Mallach <jordi at sindominio.net>
 
-	* ChangeLog, NEWS: Released WMBiff 0.3.6.
+	* ChangeLog: Released WMBiff 0.3.6.
 
 2002-01-27 Sunday 19:56 UTC -- Jordi Mallach <jordi at sindominio.net>
 
@@ -185,14 +1602,14 @@
 
 2002-01-27 Sunday 12:46 UTC -- Jordi Mallach <jordi at sindominio.net>
 
-	* NEWS, README, wmbiff/Imap4Client.c, wmbiff/Makefile,
-	wmbiff/wmbiffrc.5: Alternate regex for imap/imaps which allows "@"
-	in passwords.  Fix to correctly handle the auth list in imap. 
-	Patch from David Smith <davidsmith at acm.org>.
+	* README, wmbiff/Imap4Client.c, wmbiff/Makefile, wmbiff/wmbiffrc.5:
+	Alternate regex for imap/imaps which allows "@" in passwords.  Fix
+	to correctly handle the auth list in imap.  Patch from David Smith
+	<davidsmith at acm.org>.
 
 2002-01-14 Monday 01:51 UTC -- Jordi Mallach <jordi at sindominio.net>
 
-	* ChangeLog, NEWS: Released WMBiff 0.3.5.
+	* ChangeLog: Released WMBiff 0.3.5.
 
 2002-01-14 Monday 01:50 UTC -- Jordi Mallach <jordi at sindominio.net>
 
@@ -222,15 +1639,11 @@
 
 2001-11-23 Friday 15:55 UTC -- Jordi Mallach <jordi at sindominio.net>
 
-	* NEWS, wmbiff/Makefile: Bumped version to 0.3.4, and release.
+	* wmbiff/Makefile: Bumped version to 0.3.4, and release.
 
 2001-11-23 Friday 15:53 UTC -- Jordi Mallach <jordi at sindominio.net>
 
-	* ChangeLog, NEWS, wmbiff/sample.wmbiffrc: Doc updates for 0.3.4.
-
-2001-11-23 Friday 07:20 UTC -- Neil Spring <nspring at cs.washington.edu>
-
-	* TODO: one down
+	* ChangeLog, wmbiff/sample.wmbiffrc: Doc updates for 0.3.4.
 
 2001-11-16 Friday 07:11 UTC -- Neil Spring <nspring at cs.washington.edu>
 
@@ -285,7 +1698,7 @@
 
 2001-10-29 Monday 13:57 UTC -- Jordi Mallach <jordi at sindominio.net>
 
-	* ChangeLog, NEWS: Released WMBiff 0.3.3.
+	* ChangeLog: Released WMBiff 0.3.3.
 
 2001-10-29 Monday 13:54 UTC -- Jordi Mallach <jordi at sindominio.net>
 
@@ -293,7 +1706,7 @@
 
 2001-10-28 Sunday 23:32 UTC -- Jordi Mallach <jordi at sindominio.net>
 
-	* ChangeLog, NEWS, README, wmbiff/Makefile, wmbiff/sample.wmbiffrc:
+	* ChangeLog, README, wmbiff/Makefile, wmbiff/sample.wmbiffrc:
 	Preparation for 0.3.3.	Documentation updates.
 
 2001-10-28 Sunday 22:22 UTC -- Neil Spring <nspring at cs.washington.edu>
@@ -312,7 +1725,7 @@
 
 2001-10-23 Tuesday 18:35 UTC -- Jordi Mallach <jordi at sindominio.net>
 
-	* ChangeLog, NEWS: Released WMBiff 0.3.2.
+	* ChangeLog: Released WMBiff 0.3.2.
 
 2001-10-23 Tuesday 18:33 UTC -- Jordi Mallach <jordi at sindominio.net>
 
@@ -325,7 +1738,7 @@
 
 2001-10-04 Thursday 09:50 UTC -- Jordi Mallach <jordi at sindominio.net>
 
-	* NEWS, README, TODO, wmbiff/Client.h, wmbiff/Imap4Client.c,
+	* README, wmbiff/Client.h, wmbiff/Imap4Client.c,
 	wmbiff/LicqClient.c, wmbiff/Makefile, wmbiff/Pop3Client.c,
 	wmbiff/charutil.c, wmbiff/charutil.h, wmbiff/maildirClient.c,
 	wmbiff/mboxClient.c, wmbiff/socket.c, wmbiff/tlsComm.c,
@@ -380,14 +1793,14 @@
 
 2001-10-04 Thursday 08:54 UTC -- Jordi Mallach <jordi at sindominio.net>
 
-	* ChangeLog, NEWS, README, wmbiff/Client.h, wmbiff/Makefile,
+	* ChangeLog, README, wmbiff/Client.h, wmbiff/Makefile,
 	wmbiff/sample.wmbiffrc, wmbiff/wmbiff.1, wmbiff/wmbiff.c,
 	wmbiff/wmbiffrc.5: Backed out hoehoe's patch, preparing to apply
 	Neil's.
 
 2001-09-24 Monday 11:58 UTC -- Jordi Mallach <jordi at sindominio.net>
 
-	* ChangeLog, NEWS, README, wmbiff/ApopClient.c, wmbiff/Client.h,
+	* ChangeLog, README, wmbiff/ApopClient.c, wmbiff/Client.h,
 	wmbiff/Makefile, wmbiff/sample.wmbiffrc, wmbiff/wmbiff.1,
 	wmbiff/wmbiff.c, wmbiff/wmbiffrc.5: Added APOP support, patch from
 	NAKAYAMA Takao <hoehoe at wakaba.jp>.  Fixed some bits of the manpage
@@ -400,7 +1813,7 @@
 
 2001-06-24 Sunday 18:17 UTC -- Jordi Mallach <jordi at sindominio.net>
 
-	* ChangeLog, NEWS: Released wmbiff 0.3.1.
+	* ChangeLog: Released wmbiff 0.3.1.
 
 2001-06-24 Sunday 18:08 UTC -- Jordi Mallach <jordi at sindominio.net>
 
@@ -413,9 +1826,9 @@
 
 2001-06-23 Saturday 00:07 UTC -- Jordi Mallach <jordi at sindominio.net>
 
-	* ChangeLog, NEWS, maint/changelog.sed, maint/prerelease.sh:
-	Renamed CHANGES to ChangeLog and RELEASE-NOTES to NEWS, modified
-	release scripts accordingly. Added Mark to the sed file.
+	* ChangeLog, maint/changelog.sed, maint/prerelease.sh: Renamed
+	CHANGES to ChangeLog and RELEASE-NOTES to NEWS, modified release
+	scripts accordingly. Added Mark to the sed file.
 
 2001-06-22 Friday 23:55 UTC -- Jordi Mallach <jordi at sindominio.net>
 
@@ -474,8 +1887,8 @@
 
 2001-05-11 Friday 14:49 UTC -- Jordi Mallach <jordi at sindominio.net>
 
-	* wmbiff/: .cvsignore, Makefile: Uncommitted stuff to deal with the
-	removal of the xmp link
+	* wmbiff/Makefile: Uncommitted stuff to deal with the removal of
+	the xmp link
 
 2001-05-04 Friday 11:01 UTC -- Jordi Mallach <jordi at sindominio.net>
 
@@ -489,9 +1902,9 @@
 	wmgeneral/wmgeneral.h, wmbiff/socket.c, wmgeneral/wmgeneral.c,
 	wmbiff/Imap4Client.c, wmbiff/Makefile, wmbiff/mboxClient.c,
 	wmbiff/sample.wmbiffrc, wmbiff/wmbiff.1, wmbiff/wmbiff.c,
-	wmbiff/wmbiff-master-led.xpm, wmbiff/.cvsignore, wmbiff/Client.h,
-	wmbiff/LicqClient.c, wmbiff/Pop3Client.c, wmbiff/maildirClient.c,
-	wmbiff/wmbiffrc.5: Initial revision
+	wmbiff/wmbiff-master-led.xpm, wmbiff/Client.h, wmbiff/LicqClient.c,
+	wmbiff/Pop3Client.c, wmbiff/maildirClient.c, wmbiff/wmbiffrc.5:
+	Initial revision
 
 2001-05-01 Tuesday 16:11 UTC -- Jordi Mallach <jordi at sindominio.net>
 
@@ -500,8 +1913,7 @@
 	wmgeneral/wmgeneral.h, wmbiff/socket.c, wmgeneral/wmgeneral.c,
 	wmbiff/Imap4Client.c, wmbiff/Makefile, wmbiff/mboxClient.c,
 	wmbiff/sample.wmbiffrc, wmbiff/wmbiff.1, wmbiff/wmbiff.c,
-	wmbiff/wmbiff-master-led.xpm, wmbiff/.cvsignore, wmbiff/Client.h,
-	wmbiff/LicqClient.c, wmbiff/Pop3Client.c, wmbiff/maildirClient.c,
-	wmbiff/wmbiffrc.5: Initial import to SourceForge, version
-	0.2q1+Debian
+	wmbiff/wmbiff-master-led.xpm, wmbiff/Client.h, wmbiff/LicqClient.c,
+	wmbiff/Pop3Client.c, wmbiff/maildirClient.c, wmbiff/wmbiffrc.5:
+	Initial import to SourceForge, version 0.2q1+Debian
 
diff --git a/FAQ b/FAQ
new file mode 100644
index 0000000..288cc70
--- /dev/null
+++ b/FAQ
@@ -0,0 +1,125 @@
+* Does WMBiff have a mailing list?
+
+Subscribe to wmbiff-devel at lists.sourceforge.net.
+
+echo "subscribe wmbiff-devel" | mail majordomo at lists.sourceforge.net
+
+* Why doesn't WMBiff update immediately after I read my mail?
+
+WMBiff looks only at the flags associated with mail messages
+to decide if they've been read.  If your mail reader doesn't
+bother to update those flags immediately after you read a
+message, WMBiff has (essentially) no way of knowing that
+you've read the message.
+
+There are some workarounds:  In mutt, you can ask it to sync
+the mailbox using the sync-mailbox command: it will write
+the mailbox file to disk (or back to the IMAP server) so
+that WMBiff can update its counters.  Mutt's sync-mailbox
+command is bound to the $ key by default.  In Mac OS X mail,
+changing to a different mailbox usually flushes changes,
+so I often hit Command-4 to switch to the sent mailbox
+for a few seconds.
+
+No workarounds are known for Kmail, which updates the status
+flags of all mail as if it were read, then adds its own
+status field to note that some are unread.  (sourceforge
+tracker #706995).
+
+* WMBiff doesn't work.  How do I submit a bug?
+
+See the Troubleshooting section of the wmbiffrc man
+page.  
+
+If that doesn't work, run 'wmbiff -debug > wmbiff.log' and
+remove any passwords left in wmbiff.log.  Submit this log
+and your wmbiffrc (sanitized of passwords of course) using
+'reportbug' under Debian, or by sending mail to
+wmbiff-devel.
+
+* WMBiff doesn't do something I want. How do I suggest a feature?
+
+If using Debian, use 'reportbug wmbiff' and submit a
+wishlist bug.  Or, send mail with your suggestion to
+wmbiff-devel at lists.sourceforge.net.  Feature requests on
+sourceforge don't get the same attention.
+
+Some previously requested features can't be done:
+ - Count IMAP deleted messages separately (the protocol
+    doesn't support it without locking the mailbox).
+ - Reset the count of new messages to zero when spawning
+    a mailer (it would just jump back again the next time 
+    wmbiff looked).
+
+Previously suggested features that are really hard:
+ - Support dock sizes other than 64x64
+ - Inverse video on new mail (or do more visually to grab attention)
+
+* I'm about to start writing a patch. How do I make sure it will 
+get incorporated in WMBiff?
+
+Start a conversation on wmbiff-devel, and you'll probably
+get some help. 
+ 
+Tidbits: 
+ Avoid creating new Clients.  
+  - If you want an existing client to do something differently, 
+    find a way to parameterize its behavior. 
+  - If you want to use a shell command to get some
+    information, make a recipe for ShellClient (open wmbiff.c 
+    and search for 'gicu').
+ If you must create a new client, Avoid Duplicating Code.
+ Document your patch.  Add entries as appropriate to:
+  - sample.wmbiffrc
+  - wmbiffrc.5.in
+  - wmbiff.1
+
+* How do I get the very latest WMBiff from SourceForge CVS?
+
+See http://sourceforge.net/cvs/?group_id=26389, or 
+http://sourceforge.net/projects/wmbiff then click on CVS.
+ 
+cvs -d:pserver:anonymous at cvs.sourceforge.net:/cvsroot/wmbiff login 
+cvs -z3 -d:pserver:anonymous at cvs.sourceforge.net:/cvsroot/wmbiff co wmbiff 
+
+* I added a feature to WMBiff. How do I submit a patch?
+** If you've modified code from a .tar.gz
+ If you've modified a version of WMBiff downloaded from the web:
+  (in the wmbiff-x.x.x/wmbiff directory)
+  make indent
+  cd ..
+  make distclean 
+  cd ..
+  mv wmbiff-x.x.x wmbiff-changed
+  tar xvfz wmbiff-x.x.x.tar.gz
+  diff --unified --recursive --new-file wmbiff-x.x.x wmbiff-changed > my-patch
+** If you've modified code from CVS
+  (in the wmbiff/wmbiff directory)
+  make indent
+  cd ..
+  [ optionally 'make distcheck' ]
+  make maintainer-clean 
+  cvs update -d
+  [ resolve any conflicts ]
+  cvs diff -u | less     [ make sure the differences are roughly correct ]
+  cd ..
+  mv wmbiff wmbiff-changed
+  [ now checkout a new copy of wmbiff ] 
+  diff --unified --recursive --new-file --exclude CVS wmbiff wmbiff-changed > my-patch
+    
+** Sending the patch
+Submit my-patch as an attachment to mail sent to
+wmbiff-devel. Don't forget to subscribe to the mailing list
+so that we can discuss your patch.  This is roughly the same
+procedure you'll use to submit patches to any code, although
+others may not have the 'make indent' step.
+ 
+
+* This FAQ is wrong.  
+
+Send mail to wmbiff-devel at lists.sourceforge.net.
+
+;;; Local Variables: ***
+;;; mode: outline ***
+;;; End: ***
+
diff --git a/INSTALL b/INSTALL
new file mode 100644
index 0000000..b42a17a
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,182 @@
+Basic Installation
+==================
+
+   These are generic installation instructions.
+
+   The `configure' shell script attempts to guess correct values for
+various system-dependent variables used during compilation.  It uses
+those values to create a `Makefile' in each directory of the package.
+It may also create one or more `.h' files containing system-dependent
+definitions.  Finally, it creates a shell script `config.status' that
+you can run in the future to recreate the current configuration, a file
+`config.cache' that saves the results of its tests to speed up
+reconfiguring, and a file `config.log' containing compiler output
+(useful mainly for debugging `configure').
+
+   If you need to do unusual things to compile the package, please try
+to figure out how `configure' could check whether to do them, and mail
+diffs or instructions to the address given in the `README' so they can
+be considered for the next release.  If at some point `config.cache'
+contains results you don't want to keep, you may remove or edit it.
+
+   The file `configure.in' is used to create `configure' by a program
+called `autoconf'.  You only need `configure.in' if you want to change
+it or regenerate `configure' using a newer version of `autoconf'.
+
+The simplest way to compile this package is:
+
+  1. `cd' to the directory containing the package's source code and type
+     `./configure' to configure the package for your system.  If you're
+     using `csh' on an old version of System V, you might need to type
+     `sh ./configure' instead to prevent `csh' from trying to execute
+     `configure' itself.
+
+     Running `configure' takes awhile.  While running, it prints some
+     messages telling which features it is checking for.
+
+  2. Type `make' to compile the package.
+
+  3. Optionally, type `make check' to run any self-tests that come with
+     the package.
+
+  4. Type `make install' to install the programs and any data files and
+     documentation.
+
+  5. You can remove the program binaries and object files from the
+     source code directory by typing `make clean'.  To also remove the
+     files that `configure' created (so you can compile the package for
+     a different kind of computer), type `make distclean'.  There is
+     also a `make maintainer-clean' target, but that is intended mainly
+     for the package's developers.  If you use it, you may have to get
+     all sorts of other programs in order to regenerate files that came
+     with the distribution.
+
+Compilers and Options
+=====================
+
+   Some systems require unusual options for compilation or linking that
+the `configure' script does not know about.  You can give `configure'
+initial values for variables by setting them in the environment.  Using
+a Bourne-compatible shell, you can do that on the command line like
+this:
+     CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
+
+Or on systems that have the `env' program, you can do it like this:
+     env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
+
+Compiling For Multiple Architectures
+====================================
+
+   You can compile the package for more than one kind of computer at the
+same time, by placing the object files for each architecture in their
+own directory.  To do this, you must use a version of `make' that
+supports the `VPATH' variable, such as GNU `make'.  `cd' to the
+directory where you want the object files and executables to go and run
+the `configure' script.  `configure' automatically checks for the
+source code in the directory that `configure' is in and in `..'.
+
+   If you have to use a `make' that does not supports the `VPATH'
+variable, you have to compile the package for one architecture at a time
+in the source code directory.  After you have installed the package for
+one architecture, use `make distclean' before reconfiguring for another
+architecture.
+
+Installation Names
+==================
+
+   By default, `make install' will install the package's files in
+`/usr/local/bin', `/usr/local/man', etc.  You can specify an
+installation prefix other than `/usr/local' by giving `configure' the
+option `--prefix=PATH'.
+
+   You can specify separate installation prefixes for
+architecture-specific files and architecture-independent files.  If you
+give `configure' the option `--exec-prefix=PATH', the package will use
+PATH as the prefix for installing programs and libraries.
+Documentation and other data files will still use the regular prefix.
+
+   In addition, if you use an unusual directory layout you can give
+options like `--bindir=PATH' to specify different values for particular
+kinds of files.  Run `configure --help' for a list of the directories
+you can set and what kinds of files go in them.
+
+   If the package supports it, you can cause programs to be installed
+with an extra prefix or suffix on their names by giving `configure' the
+option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
+
+Optional Features
+=================
+
+   Some packages pay attention to `--enable-FEATURE' options to
+`configure', where FEATURE indicates an optional part of the package.
+They may also pay attention to `--with-PACKAGE' options, where PACKAGE
+is something like `gnu-as' or `x' (for the X Window System).  The
+`README' should mention any `--enable-' and `--with-' options that the
+package recognizes.
+
+   For packages that use the X Window System, `configure' can usually
+find the X include and library files automatically, but if it doesn't,
+you can use the `configure' options `--x-includes=DIR' and
+`--x-libraries=DIR' to specify their locations.
+
+Specifying the System Type
+==========================
+
+   There may be some features `configure' can not figure out
+automatically, but needs to determine by the type of host the package
+will run on.  Usually `configure' can figure that out, but if it prints
+a message saying it can not guess the host type, give it the
+`--host=TYPE' option.  TYPE can either be a short name for the system
+type, such as `sun4', or a canonical name with three fields:
+     CPU-COMPANY-SYSTEM
+
+See the file `config.sub' for the possible values of each field.  If
+`config.sub' isn't included in this package, then this package doesn't
+need to know the host type.
+
+   If you are building compiler tools for cross-compiling, you can also
+use the `--target=TYPE' option to select the type of system they will
+produce code for and the `--build=TYPE' option to select the type of
+system on which you are compiling the package.
+
+Sharing Defaults
+================
+
+   If you want to set default values for `configure' scripts to share,
+you can create a site shell script called `config.site' that gives
+default values for variables like `CC', `cache_file', and `prefix'.
+`configure' looks for `PREFIX/share/config.site' if it exists, then
+`PREFIX/etc/config.site' if it exists.  Or, you can set the
+`CONFIG_SITE' environment variable to the location of the site script.
+A warning: not all `configure' scripts look for a site script.
+
+Operation Controls
+==================
+
+   `configure' recognizes the following options to control how it
+operates.
+
+`--cache-file=FILE'
+     Use and save the results of the tests in FILE instead of
+     `./config.cache'.  Set FILE to `/dev/null' to disable caching, for
+     debugging `configure'.
+
+`--help'
+     Print a summary of the options to `configure', and exit.
+
+`--quiet'
+`--silent'
+`-q'
+     Do not print messages saying which checks are being made.  To
+     suppress all normal output, redirect it to `/dev/null' (any error
+     messages will still be shown).
+
+`--srcdir=DIR'
+     Look for the package's source code in directory DIR.  Usually
+     `configure' can determine that directory automatically.
+
+`--version'
+     Print the version of Autoconf used to generate the `configure'
+     script, and exit.
+
+`configure' also accepts some other, not widely useful, options.
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..313f8e4
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,44 @@
+SUBDIRS = wmgeneral wmbiff autoconf scripts
+EXTRA_DIST = ChangeLog FAQ README.licq TODO
+
+ACLOCAL_FLAGS = -I autoconf
+## dummies.
+ACLOCAL = @ACLOCAL@ $(ACLOCAL_FLAGS)
+
+## no longer needed AUTOHEADER = @AUTOHEADER@ -l autoconf
+
+# make maintainer-clean is all about returning to CVS.
+# aclocal.m4 is generated by aclocal
+# config.h.in is generated by autoheader
+# stamp-h.in appears somewhere
+# Makefile.in and configure are obviously generated.
+MAINTAINERCLEANFILES = aclocal.m4 config.h.in stamp-h.in  \
+  Makefile.in configure Changelog.bak stamp-h1
+maintainer-clean-local:
+	rm -f *~
+
+# conf.libgnutlstest seems to outstay its welcome.
+# I don't know why the -stamp s linger.
+DISTCLEANFILES = conf.libgnutlstest build-stamp install-stamp
+
+dist-hook-local: ChangeLog
+	chmod -R g-s .
+
+indent:
+	cd wmbiff && make indent	
+	cd wmgeneral && make indent	
+
+# manually increment version in configure.ac, which should be enough.
+ChangeLog: Makefile configure.ac 
+	@if test "x$(CVS2CL)" != "x" && test -e maint/changelog.sed; then \
+		echo "Running $(CVS2CL)..."; \
+		$(CVS2CL) --stdout --utc --day-of-week -I TODO -I NEWS -I .cvsignore | \
+		sed -f maint/changelog.sed > $@; \
+	else \
+		echo "Unable to build ChangeLog for distribution"; \
+		exit 0; \
+	fi
+
+sourceforgeupload: $(distdir).tar.gz
+	ncftpput upload.sourceforge.net incoming $(distdir).tar.gz
+	md5sum $(distdir).tar.gz
diff --git a/Makefile.in b/Makefile.in
new file mode 100644
index 0000000..9ceea23
--- /dev/null
+++ b/Makefile.in
@@ -0,0 +1,571 @@
+# Makefile.in generated by automake 1.7.9 from Makefile.am.
+# @configure_input@
+
+# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+# Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = .
+
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+ACLOCAL = @ACLOCAL@ $(ACLOCAL_FLAGS)
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CVS2CL = @CVS2CL@
+CYGPATH_W = @CYGPATH_W@
+DEFAULT_ASKPASS = @DEFAULT_ASKPASS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+GCRYPT_MAN_STATUS = @GCRYPT_MAN_STATUS@
+GNUTLS_COMMON_O = @GNUTLS_COMMON_O@
+GNUTLS_MAN_STATUS = @GNUTLS_MAN_STATUS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@
+LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@
+LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@
+LIBGNUTLS_CFLAGS = @LIBGNUTLS_CFLAGS@
+LIBGNUTLS_CONFIG = @LIBGNUTLS_CONFIG@
+LIBGNUTLS_LIBS = @LIBGNUTLS_LIBS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SKINDIR = @SKINDIR@
+STRIP = @STRIP@
+VERSION = @VERSION@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+bindir = @bindir@
+build_alias = @build_alias@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host_alias = @host_alias@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+SUBDIRS = wmgeneral wmbiff autoconf scripts
+EXTRA_DIST = ChangeLog FAQ README.licq TODO
+
+ACLOCAL_FLAGS = -I autoconf
+
+# make maintainer-clean is all about returning to CVS.
+# aclocal.m4 is generated by aclocal
+# config.h.in is generated by autoheader
+# stamp-h.in appears somewhere
+# Makefile.in and configure are obviously generated.
+MAINTAINERCLEANFILES = aclocal.m4 config.h.in stamp-h.in  \
+  Makefile.in configure Changelog.bak stamp-h1
+
+
+# conf.libgnutlstest seems to outstay its welcome.
+# I don't know why the -stamp s linger.
+DISTCLEANFILES = conf.libgnutlstest build-stamp install-stamp
+subdir = .
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+mkinstalldirs = $(SHELL) $(top_srcdir)/autoconf/mkinstalldirs
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES =
+DIST_SOURCES =
+
+RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \
+	ps-recursive install-info-recursive uninstall-info-recursive \
+	all-recursive install-data-recursive install-exec-recursive \
+	installdirs-recursive install-recursive uninstall-recursive \
+	check-recursive installcheck-recursive
+DIST_COMMON = README $(srcdir)/Makefile.in $(srcdir)/configure AUTHORS \
+	COPYING ChangeLog INSTALL Makefile.am NEWS TODO aclocal.m4 \
+	config.h.in configure configure.ac
+DIST_SUBDIRS = $(SUBDIRS)
+all: config.h
+	$(MAKE) $(AM_MAKEFLAGS) all-recursive
+
+.SUFFIXES:
+
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno
+$(srcdir)/Makefile.in:  Makefile.am  $(top_srcdir)/configure.ac $(ACLOCAL_M4)
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu  Makefile
+Makefile:  $(srcdir)/Makefile.in  $(top_builddir)/config.status
+	cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)
+
+$(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	$(SHELL) ./config.status --recheck
+$(srcdir)/configure:  $(srcdir)/configure.ac $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
+	cd $(srcdir) && $(AUTOCONF)
+
+$(ACLOCAL_M4):  configure.ac 
+	cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+
+config.h: stamp-h1
+	@if test ! -f $@; then \
+	  rm -f stamp-h1; \
+	  $(MAKE) stamp-h1; \
+	else :; fi
+
+stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
+	@rm -f stamp-h1
+	cd $(top_builddir) && $(SHELL) ./config.status config.h
+
+$(srcdir)/config.h.in:  $(top_srcdir)/configure.ac $(ACLOCAL_M4) 
+	cd $(top_srcdir) && $(AUTOHEADER)
+	touch $(srcdir)/config.h.in
+
+distclean-hdr:
+	-rm -f config.h stamp-h1
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@set fnord $$MAKEFLAGS; amf=$$2; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	   || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+	@set fnord $$MAKEFLAGS; amf=$$2; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	   || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ETAGS = etags
+ETAGSFLAGS =
+
+CTAGS = ctags
+CTAGSFLAGS =
+
+tags: TAGS
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if (etags --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	else \
+	  include_option=--include; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -f $$subdir/TAGS && \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(ETAGS_ARGS)$$tags$$unique" \
+	  || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	     $$tags $$unique
+
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+
+top_distdir = .
+distdir = $(PACKAGE)-$(VERSION)
+
+am__remove_distdir = \
+  { test ! -d $(distdir) \
+    || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
+         && rm -fr $(distdir); }; }
+
+GZIP_ENV = --best
+distuninstallcheck_listfiles = find . -type f -print
+distcleancheck_listfiles = find . -type f -print
+
+distdir: $(DISTFILES)
+	$(am__remove_distdir)
+	mkdir $(distdir)
+	$(mkinstalldirs) $(distdir)/wmbiff
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkinstalldirs) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d $(distdir)/$$subdir \
+	    || mkdir $(distdir)/$$subdir \
+	    || exit 1; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$(top_distdir)" \
+	        distdir=../$(distdir)/$$subdir \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+	-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
+	  ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+	  ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+	  ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
+	|| chmod -R a+r $(distdir)
+dist-gzip: distdir
+	$(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+	$(am__remove_distdir)
+
+dist dist-all: distdir
+	$(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+	$(am__remove_distdir)
+
+# This target untars the dist file and tries a VPATH configuration.  Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+	$(am__remove_distdir)
+	GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf -
+	chmod -R a-w $(distdir); chmod a+w $(distdir)
+	mkdir $(distdir)/_build
+	mkdir $(distdir)/_inst
+	chmod a-w $(distdir)
+	dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+	  && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+	  && cd $(distdir)/_build \
+	  && ../configure --srcdir=.. --prefix="$$dc_install_base" \
+	    $(DISTCHECK_CONFIGURE_FLAGS) \
+	  && $(MAKE) $(AM_MAKEFLAGS) \
+	  && $(MAKE) $(AM_MAKEFLAGS) dvi \
+	  && $(MAKE) $(AM_MAKEFLAGS) check \
+	  && $(MAKE) $(AM_MAKEFLAGS) install \
+	  && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+	  && $(MAKE) $(AM_MAKEFLAGS) uninstall \
+	  && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
+	        distuninstallcheck \
+	  && chmod -R a-w "$$dc_install_base" \
+	  && ({ \
+	       (cd ../.. && $(mkinstalldirs) "$$dc_destdir") \
+	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
+	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
+	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
+	            distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
+	      } || { rm -rf "$$dc_destdir"; exit 1; }) \
+	  && rm -rf "$$dc_destdir" \
+	  && $(MAKE) $(AM_MAKEFLAGS) dist-gzip \
+	  && rm -f $(distdir).tar.gz \
+	  && $(MAKE) $(AM_MAKEFLAGS) distcleancheck
+	$(am__remove_distdir)
+	@echo "$(distdir).tar.gz is ready for distribution" | \
+	  sed 'h;s/./=/g;p;x;p;x'
+distuninstallcheck:
+	@cd $(distuninstallcheck_dir) \
+	&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
+	   || { echo "ERROR: files left after uninstall:" ; \
+	        if test -n "$(DESTDIR)"; then \
+	          echo "  (check DESTDIR support)"; \
+	        fi ; \
+	        $(distuninstallcheck_listfiles) ; \
+	        exit 1; } >&2
+distcleancheck: distclean
+	@if test '$(srcdir)' = . ; then \
+	  echo "ERROR: distcleancheck can only run from a VPATH build" ; \
+	  exit 1 ; \
+	fi
+	@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
+	  || { echo "ERROR: files left in build directory after distclean:" ; \
+	       $(distcleancheck_listfiles) ; \
+	       exit 1; } >&2
+check-am: all-am
+check: check-recursive
+all-am: Makefile config.h
+installdirs: installdirs-recursive
+installdirs-am:
+
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-rm -f $(CONFIG_CLEAN_FILES)
+	-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+	-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+clean: clean-recursive
+
+clean-am: clean-generic mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-hdr distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
+	-rm -rf $(top_srcdir)/autom4te.cache
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic \
+	maintainer-clean-local
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am clean \
+	clean-generic clean-recursive ctags ctags-recursive dist \
+	dist-all dist-gzip distcheck distclean distclean-generic \
+	distclean-hdr distclean-recursive distclean-tags distcleancheck \
+	distdir distuninstallcheck dvi dvi-am dvi-recursive info \
+	info-am info-recursive install install-am install-data \
+	install-data-am install-data-recursive install-exec \
+	install-exec-am install-exec-recursive install-info \
+	install-info-am install-info-recursive install-man \
+	install-recursive install-strip installcheck installcheck-am \
+	installdirs installdirs-am installdirs-recursive \
+	maintainer-clean maintainer-clean-generic \
+	maintainer-clean-local maintainer-clean-recursive mostlyclean \
+	mostlyclean-generic mostlyclean-recursive pdf pdf-am \
+	pdf-recursive ps ps-am ps-recursive tags tags-recursive \
+	uninstall uninstall-am uninstall-info-am \
+	uninstall-info-recursive uninstall-recursive
+
+maintainer-clean-local:
+	rm -f *~
+
+dist-hook-local: ChangeLog
+	chmod -R g-s .
+
+indent:
+	cd wmbiff && make indent	
+	cd wmgeneral && make indent	
+
+# manually increment version in configure.ac, which should be enough.
+ChangeLog: Makefile configure.ac 
+	@if test "x$(CVS2CL)" != "x" && test -e maint/changelog.sed; then \
+		echo "Running $(CVS2CL)..."; \
+		$(CVS2CL) --stdout --utc --day-of-week -I TODO -I NEWS -I .cvsignore | \
+		sed -f maint/changelog.sed > $@; \
+	else \
+		echo "Unable to build ChangeLog for distribution"; \
+		exit 0; \
+	fi
+
+sourceforgeupload: $(distdir).tar.gz
+	ncftpput upload.sourceforge.net incoming $(distdir).tar.gz
+	md5sum $(distdir).tar.gz
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/NEWS b/NEWS
index bc2ba56..d91a8e4 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,212 @@
 Release Notes
 ~~~~~~~~~~~~~
+Release 0.4.26 - October 10, 2004
+  * Don't crash if no certificate is sent by the remote side
+    and -skip-certificate-check has been given.
+  * Avoid duplicate error messages.
+  * Disable libgcrypt secure memory warning.
+  * security.debian.rb: better when disconnected.
+
+Release 0.4.25 - June 23, 2004
+  * Fix a build error in the new gnutls certificate
+    verification code on s390.
+
+Release 0.4.24 - June 22, 2004
+  * Use GNUTLS 1.0.4 and GCRYPT 1.1.90, current Debian
+    unstable package libgnutls10-dev.
+
+Release 0.4.23 - April 27, 2004
+  * Allow server hostnames in IMAP to be IP addresses 
+    (start with a number).
+
+Release 0.4.22 - March 27, 2004
+  * Skip examine/search unless requested with msglst option.
+  * Exit if ssh-askpass permissions check fails.
+
+Release 0.4.21 - February 21, 2004
+  * Fix a bug where fetch times out to some IMAP servers.
+
+Release 0.4.20 - January 1, 2004
+  * Add --disable-crypto for source-based distributions 
+    while libgcrypt is unstable.
+  * Sam Izzo's patch for changing the mouse click action
+    depending on whether a box has new mail.
+
+Release 0.4.19 - November 8, 2003
+  * Fix test_tlscomm with the right signature for read()
+  * Another bugfix to IMAP msglst when headers are abnormal.
+  * Avoid strcpy for overlapping regions.
+
+Release 0.4.18 - November 8, 2003
+  * Update security.debian.rb for ruby 1.8.
+  * Bugfix to avoid infinite loop when reading from IMAP.
+  * Bugfix to msglst to allow capitalized header names.
+  * Add msglst feature to Pop3 mailboxes. (Paolo Gianrossi)
+  * Bugfix to OS X keychain use for panther.
+
+Release 0.4.17 - August 31, 2003
+  * On Mac, ask the keychain for passwords if 
+    askpass = internal:apple:keychain
+  * Bugfix to an infinite loop found in the 
+    TLS interface.
+    
+Release 0.4.16 - July 7, 2003
+  * Checks TLS certificates.  See wmbiffrc(5) for 
+    details on the certfile option.  Designed to work
+    with mutt.
+  * Show a busy mouse cursor while talking to remote
+    servers, to show that wmbiff won't be responsive 
+    to mouse clicks for a little bit.
+  * New buttontwo (middle click) action to complement 
+    action (left mouse click) and fetchcmd (right mouse).
+  * #'s are now only comments in .wmbiffrc at the 
+    beginning of lines or following whitespace, 
+    allowing #'s in (most) passwords.
+  * AppleScript examples for driving Apple's Mail 
+    application in sample.wmbiffrc
+  * Special mailbox action 'msglst' brings up a 
+    transient window showing message headers from IMAP
+    and program output for shell methods.  This is 
+    intended to be faster than starting up a new 
+    mail program or re-executing a script.
+  * Avoid repetitive error messages when disconnected.
+  * Use conventional -geometry option handling.
+  * Fix bug in 0.4.15 to re-enable *'s in IMAP passwords.
+
+Release 0.4.15 - Mar 30, 2003
+  * Frobnicate internally stored passwords, partially 
+    obfuscating them in memory.  Not actually more 
+    secure, but harder to casually discover a password.
+  * Tighten configuration file lines to more quickly
+    detect misconfiguration.  Add the -relax option if
+    it is too paranoid.
+  * Add support for -bg to round out -hi and -fg color
+    specifiers.
+
+Release 0.4.14 - Jan 24, 2003
+  * Handle building on systems with both posix and gnu
+    regex in different but conflicting files.  
+  * Restart wmbiff on SIGUSR1.  You may need to use 
+    'killall -USR1 wmbiff' if it gets stuck.
+  * Restart wmbiff on ctrl-shift mouse 1.
+
+Release 0.4.13 - Jan 20, 2003
+  * Fix a file descriptor leak when using 
+    both Shell and IMAP clients.
+  * Portability to Mac OS X, Solaris, and probably BSD
+    restored (thanks sourceforge compile farm!) with a
+    partial rewrite of regular expression handling for
+    IMAP and POP mailboxes.
+
+Release 0.4.12 - Jan 3, 2003
+  * Fix a bug introduced in 0.4.9 that interfered with
+    -geometry handling. (Debian #173813)
+
+Release 0.4.11 - Dec 28, 2002
+  * security.debian.rb script to check for updates on 
+    security.debian.org, installed in $prefix/lib/wmbiff/
+    add: path.x=/usr/lib/wmbiff/security.debian.rb to 
+    your .wmbiffrc (and install ruby if you haven't already).
+  * Internal cleanups to allow long askpass commands.
+
+Release 0.4.10 - Dec 12, 2002
+  * Peter McAlpine's globalnotify feature - elect to play a 
+    sound on new mail in *any* mailbox without a chorus of
+    sounds from every mailbox.
+  * -skip-certificate-check option for when your imaps server
+    is misconfigured and you can't do anything about it.
+
+Release 0.4.9 - Dec 1, 2002
+  * GNUTLS v0.5.9 or higher required
+  * Check TLS certificate hostname against the hostname we're
+    connecting to.  This raises the bar, but does not make 
+    wmbiff's TLS implementation secure against man in the 
+    middle attacks.
+  * WMBiff scales to the number of mailboxes you're
+    using. For openbox, this means less wasted space in the
+    slit and the possibility of up to 40 mailboxes.  For
+    WindowMaker, this means more pretty chrome and less dark
+    LED if you have only a couple boxes.  If you prefer the empty
+    cells at the end, place "path.4=<space><space>" in your 
+    .wmbiffrc.
+    
+Release 0.4.8 - Sept 18, 2002
+  * GNUTLS v0.5.1-0.5.6, gcrypt v1.1.8 required.
+  * Allow spaces in IMAP mailbox paths.  The new syntax is:
+    server/"mail box with spaces" where the old is server/mailbox.
+    See wmbiffrc(5) for details.
+  * Avoid filesystem caching for network mounted maildirs.
+    See wmbiffrc(5) for details. (Dwayne C. Litzenberger)
+
+Release 0.4.7 - August 16, 2002
+  * GNUTLS v0.5.1, gcrypt v1.1.8 required. (no other changes)
+
+Release 0.4.6 - July 19, 2002
+  * Ignore sigpipe so that apm suspend works with IMAP/TLS.
+  * Memory handling bugfixes to appease valgrind.
+  * GNUTLS v0.4.3, gcrypt v1.17 expected
+
+Release 0.4.4 - June 27, 2002
+  * GNUTLS version 0.4.3 required.  The API has changed, and 
+    wmbiff is no longer compatible with GNUTLS versions prior
+    to 0.4.3.  Certificate checking may be slightly more strict.
+  * GCRYPT version 1.1.7 is expected as well.
+  * Partial rewrite of mailbox-parsing code, splint annotations.
+  * Bugfix in debug messages of ShellClient.
+  * Internal cleanups; migration to autoconf 2.5
+
+Release 0.4.3 - June 8, 2002
+  * IPv6 support for real. (missed a detail with autoconf)
+  * Preliminary font support, allowing variable colors.  Use
+    wmbiff -fg violet to give it a spin.  Note: if the number of
+    old messages is at least 1000, the old number of messages
+    will not be completely erased when new mail arrives.
+  * Mouse handling fix.
+  * Cleanup of internals: handling of default configuration when
+    .wmbiffrc does not exist, vertical position of rows, variable 
+    names, etc.
+  * GNUTLS version 0.3.5 is expected; earlier and later versions
+    may be incompatible.
+  * This release is by Neil Spring <nspring at cs.washington.edu>.
+
+Release 0.4.2 - June 1, 2002
+  * Bugfix: accidentally released a partial feature.
+
+Release 0.4.1 - June 1, 2002
+
+  * This release is by Neil Spring <nspring at cs.washington.edu>.
+  * GNUTLS version 0.3.5 is expected; earlier and later versions
+    may be incompatible.
+  * IPv6 is now supported, thanks to Jun-ichiro itojun Hagino
+
+Release 0.4.0 - May 3, 2002
+
+  * This release is by Neil Spring <nspring at cs.washington.edu>.
+  * GNUTLS version 0.3.5 is expected; earlier and later versions
+    may be incompatible.
+  * askpass: Passwords can be left empty for IMAP: ssh-askpass
+    will be used to prompt the user.  See sample.wmbiffrc 
+    and wmbiffrc(5).
+  * skinfile: Background pixmaps can be specified in .wmbiffrc.
+    This has the effect of "skins."  See wmbiffrc(5).
+    Add "skinfile=wmbiff-master-contrast.xpm" to .wmbiffrc 
+    for a more readable wmbiff.
+  * finger: Finger client added - finger a user's mailbox to get its
+    status.  Requires perl and finger commands. See wmbiffrc(5).
+    Thanks to Andelko Horvat.
+  * shell: Improvements to ShellClient - now allows three character 
+    text to be printed as status.  If "new" is on the output
+    line, the text will be in yellow. Thanks to Andelko Horvat.
+  * mbox: Paths can be specified including shell expressions 
+    in `'s.  If requested, this feature can be expanded to other 
+    clients.  Nested expressions are not supported.
+  * Permissions on .wmbiffrc are checked to protect security.
+    Only a warning is printed now.  This will degenerate in 
+    later releases for .wmbiffrc's that store passwords.
+  * Migrated to automake / autoconf to detect defaults for
+    ssh-askpass and prepare for future changes.
+  * Bugfix to handle -geometry tags with dimension as generated
+    by fvwmSaveDesk. The size is ignored. (in Debian 0.3.8-3)
 
 Release 0.3.8 - Tue, 26 Mar 2002 17:17:07 +0100
 
@@ -279,4 +486,4 @@ Release 0.1 - Wed, 17 Nov 1999 00:00:00 +0000
   * Initial release by Gennady Belyakov <gb at ccat.elect.ru>.
 
 
-$Id: NEWS,v 1.16 2002/03/26 16:30:32 jordi Exp $
+$Id: NEWS,v 1.60 2004/06/23 21:51:40 bluehal Exp $
diff --git a/README b/README
index c608b3f..07a9d43 100644
--- a/README
+++ b/README
@@ -33,17 +33,19 @@
 Extract the archive:
         tar -xvzf wmbiff-0.x.tar.gz
 
-Enter the wmbiff directory and edit the Makefile:
+Enter the wmbiff directory and follow INSTALL's directions.
         cd wmbiff-0.x/
-        vi Makefile
+        ./configure
 
 For crypto support either:
-*) Install gnutls and libgrcypt packages from your distribution.
-*) Download them from http://www.gnupg.org/mirrors.html.
-Choose a mirror, then download from the alpha/gnutls and
-alpha/libgcrypt directories.
-*) Disable crypt by uncommenting the "WITHOUT_CRYPTO" line
-in the Makefile.
+ *) Install gnutls and libgrcypt packages from your distribution.
+ *) Download them from http://www.gnupg.org/(en)/download/mirrors.html
+   Choose a mirror, then download from the alpha/gnutls and
+   alpha/libgcrypt directories.
+ *) Do nothing; the configure script will note its absence.
+
+NOTE: gnutls-0.3.5 is the version that this release was
+tested with.  Newer versions may have incompatible changes.
 
 Make the binary:
         make
@@ -61,46 +63,15 @@ and specify differrent name of config file.
 position. All other positions will be empty.
      _________________________________________________________________
    
-                                  Copyrights
-                                       
-   This program was written by Gennady Belyakov [8]gb at ccat.elect.ru
-   
-   Exterior appearance was heavily derived from wminet, written by
-   Dave Clark (clarkd at skynet.ca),
-   Antoine Nulle (warp at xs4all.nl),
-   Martijn Pieterse (pieterse at xs4all.nl)
-   
-   Some code (around mailbox checking, with some modifications) was taken
-   from xled, written by
-   Jan Schoenepauck (schoenep at uni-wuppertal.de) and
-   Joachim Gassen (joachim at fb4-1112.uni-muenster.de)
-   
-   POP3 checking code was taken from wmpop3 by
-   Scott Holden (scotth at thezone.net)
-   
-   Many thanks for:
-   Angus Mackay (amackay at gusnet.cx)
-   Jordi Mallach P�rez (jordi at sindominio.net)
-   Eugene Bobin (gene at utb.ru)
-   Helmut 'Kolbi' Kolb (office at kolbi.net)
-   Vladimir Popov (pva48 at mail.ru)
-   Jorge Garc�a (Jorge.Garcia at uv.es)
-   Nick Clarey (nclarey at 3glab.com)
-   Dwayne C. Litzenberger (dlitz at dlitz.net)
-   Mark Hurley (debian4tux at telocity.com)
-   Rob Funk (rfunk at funkinet.net)
-   Neil Spring (nspring at cs.washington.edu)
-   NAKAYAMA Takao (hoehoe at wakaba.jp)
-   Jay T Francis (jtf at u880.org)
-   David Smith (davidsmith at acm.org)
-   Beno�t Rouits (brouits at free.fr)
-
+   See AUTHORS to see who has contributed to WMBiff.
      _________________________________________________________________
    
    Any suggestions/bug reports please send to our mailing list,
  
     wmbiff-devel at lists.sourceforge.net
 
+   Please include the output of 'wmbiff -debug'.
+
      _________________________________________________________________
 
 UPDATE [2001-06-18]:
diff --git a/TODO b/TODO
index db54c8d..a87775d 100644
--- a/TODO
+++ b/TODO
@@ -1,15 +1,92 @@
-- Store and verify server certificates.
-- Prompt for passwords (in progress)
-- Add a FAQ (sighup, app size, deleted messages)
-- Make the shell method support old messages too
-- Add more shell "recipes" besides gicu.
-- Support "skins" or soft-configurable xpms for,
-   for example, 8bpp displays or non 64x64 appsizes.
-- Support on/off status LED's, for, for example,
-   grep eth0 /proc/net/dev | wc -l
-- Add a failure-expect case in tlsComm. For example,
-   an IMAP status query has a good response (* STATUS) 
-   and a bad response (a003 NO STATUS).  As soon as 
-   one of them is received, we're done.
-
-$Id: TODO,v 1.4 2002/03/18 21:13:55 bluehal Exp $
+This is not a prioritized list.  Patches that accomplish
+these todo items are welcome.
+
+* Config file rewrite
+  The current configuration file has the following problems
+** # comments make #'s unsuitable for passwords.
+** : and @ delimiters make such characters unsuitable for
+   passwords.
+** the hierarchical configuration is not exported cleanly, 
+   setting a default and then propagating or overriding it
+   requires an odd syntax.
+** elements with spaces are problematic
+** annotations / customizations (such as the authentication
+   methods) are cumbersome.
+** continuation lines would allow richer shell actions without
+   external shell scripts.
+* GNUTLS 0.5.9 
+** adds gnutls_set_default_priority, which could clean up 
+   a lot of the code to set priorities for ciphers that
+   don't really matter to wmbiff.
+* Font support
+** Erase counts > 1000 successfully (redraw the whole line)
+** Discover height of the font, scale appropriately.
+** Draw relative to symbolic width, height.
+* Finish checking .wmbiffrc permissions.
+  With shell command execution support, it is even more
+  important to protect against other/group writability.
+  With passwords in the .wmbiffrc, .wmbiffrc shouldn't be
+  readable.  It might be best to complain all the time, but
+  only abort when a password is used from a readable file,
+  or a shell command is executed from a writable file.
+* Better timeout handling
+  Sometimes my IMAP server is slow... well, it's my fault
+  that I keep a few thousand messages on it.  The current
+  timeout code will cause it to fail prematurely.
+* Generic constructors for mboxes.  
+  There's some common code across different Clients;
+  this is one piece that could use refactoring.
+* Add more shell "recipes" besides gicu.
+  Just added 'finger'.  I'm hoping to add something to
+  integrate 'remind' just as soon as I can figure it out.
+* Support on/off status LED's, for, for example,
+  grep eth0 /proc/net/dev | wc -l
+  The colored LED's are already in WMBiff's pixmap.
+* Support buttons 4 and 5
+  The mousewheel could be useful for some behaviors, like
+  controlling volume, or selecting different mailboxes.
+* Use a helper program to blink keyboard led's.
+  Requires killing the 'notify' program when new mail no
+  longer exists.  Keyboard blinking is done via a helper
+  program because it requires root.  ledcontrol seems ok,
+  but extra complicated, and has a useless default install
+  that requires root.  xbuffy's led program seems quite
+  good, but depending on another biff program seems odd.
+* Add a failure-expect case in tlsComm. 
+  For example, an IMAP status query has a good response (*
+  STATUS) and a bad response (a003 NO STATUS).  As soon as
+  one of them is received, we're done.
+* Reload .wmbiffrc when it changes
+  This is straightforward, except for IMAP mailboxes that
+  keep a connection to the server open.  A close function
+  will have to be implemented to shut those down gracefully.
+  Do not involve sighup or any other signals.  Use or
+  improve fileHasChanged().
+* Runtime back-tick expansion for non-mbox
+  Because interesting mailboxes can be defined by date,
+  though its not clear any other clients can take advantage.
+* Support GSSAPI or SASL authentication
+  Authentication using krb5 would be sweet.
+
+* Unlikely to get done, unless someone volunteers:
+* KDE/Gnome users: Test with KDE or gnome-panel
+  Does Debian bug #108529 apply to wmbiff?  Can wmbiff
+  be swallowed by gnome-panel?  It seems possible.  It 
+  appears to be swallowed by FVWM correctly.
+* Autoconf / Automake Wizards: fix FromCVS.sh
+  How best to deal with libgnutls's macros?  All 
+  I can do is hack.
+* Paranoid Pop People: Support POP over TLS.
+  tlsComm.c should make it easy to provide TLS support
+  for POP.  Unfortunately, this would only be useful for
+  someone who has such a server that doesn't support IMAPS.
+* MH support
+  Try "path.n=shell:::ls -1 directoryname | wc -l".
+  If it works, tell us.  Optionally the patch at sourceforge
+  could be integrated.
+
+$Id: TODO,v 1.20 2003/07/11 07:05:06 bluehal Exp $
+
+Local Variables:
+mode: outline
+End:
diff --git a/aclocal.m4 b/aclocal.m4
new file mode 100644
index 0000000..55e505b
--- /dev/null
+++ b/aclocal.m4
@@ -0,0 +1,1187 @@
+# generated automatically by aclocal 1.7.9 -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002
+# Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+# Do all the work for Automake.                            -*- Autoconf -*-
+
+# This macro actually does too much some checks are only needed if
+# your package does certain things.  But this isn't really a big deal.
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+# Free Software Foundation, Inc.
+
+# This program 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, 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., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# serial 10
+
+AC_PREREQ([2.54])
+
+# Autoconf 2.50 wants to disallow AM_ names.  We explicitly allow
+# the ones we care about.
+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+
+# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
+# AM_INIT_AUTOMAKE([OPTIONS])
+# -----------------------------------------------
+# The call with PACKAGE and VERSION arguments is the old style
+# call (pre autoconf-2.50), which is being phased out.  PACKAGE
+# and VERSION should now be passed to AC_INIT and removed from
+# the call to AM_INIT_AUTOMAKE.
+# We support both call styles for the transition.  After
+# the next Automake release, Autoconf can make the AC_INIT
+# arguments mandatory, and then we can depend on a new Autoconf
+# release and drop the old call support.
+AC_DEFUN([AM_INIT_AUTOMAKE],
+[AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+ AC_REQUIRE([AC_PROG_INSTALL])dnl
+# test to see if srcdir already configured
+if test "`cd $srcdir && pwd`" != "`pwd`" &&
+   test -f $srcdir/config.status; then
+  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+  if (cygpath --version) >/dev/null 2>/dev/null; then
+    CYGPATH_W='cygpath -w'
+  else
+    CYGPATH_W=echo
+  fi
+fi
+AC_SUBST([CYGPATH_W])
+
+# Define the identity of the package.
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+ AC_SUBST([PACKAGE], [$1])dnl
+ AC_SUBST([VERSION], [$2])],
+[_AM_SET_OPTIONS([$1])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_AM_IF_OPTION([no-define],,
+[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
+
+# Some tools Automake needs.
+AC_REQUIRE([AM_SANITY_CHECK])dnl
+AC_REQUIRE([AC_ARG_PROGRAM])dnl
+AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
+AM_MISSING_PROG(AUTOCONF, autoconf)
+AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
+AM_MISSING_PROG(AUTOHEADER, autoheader)
+AM_MISSING_PROG(MAKEINFO, makeinfo)
+AM_MISSING_PROG(AMTAR, tar)
+AM_PROG_INSTALL_SH
+AM_PROG_INSTALL_STRIP
+# We need awk for the "check" target.  The system "awk" is bad on
+# some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+
+_AM_IF_OPTION([no-dependencies],,
+[AC_PROVIDE_IFELSE([AC_PROG_CC],
+                  [_AM_DEPENDENCIES(CC)],
+                  [define([AC_PROG_CC],
+                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+                  [_AM_DEPENDENCIES(CXX)],
+                  [define([AC_PROG_CXX],
+                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+])
+])
+
+
+# When config.status generates a header, we must update the stamp-h file.
+# This file resides in the same directory as the config header
+# that is generated.  The stamp files are numbered to have different names.
+
+# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
+# loop where config.status creates the headers, so we can generate
+# our stamp files there.
+AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
+[# Compute $1's index in $config_headers.
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $1 | $1:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
+
+# Copyright 2002  Free Software Foundation, Inc.
+
+# This program 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, 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., 59 Temple Place - Suite 330, Boston, MA
+
+# AM_AUTOMAKE_VERSION(VERSION)
+# ----------------------------
+# Automake X.Y traces this macro to ensure aclocal.m4 has been
+# generated from the m4 files accompanying Automake X.Y.
+AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.7"])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION so it can be traced.
+# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+	 [AM_AUTOMAKE_VERSION([1.7.9])])
+
+# Helper functions for option handling.                    -*- Autoconf -*-
+
+# Copyright 2001, 2002  Free Software Foundation, Inc.
+
+# This program 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, 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., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# serial 2
+
+# _AM_MANGLE_OPTION(NAME)
+# -----------------------
+AC_DEFUN([_AM_MANGLE_OPTION],
+[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
+
+# _AM_SET_OPTION(NAME)
+# ------------------------------
+# Set option NAME.  Presently that only means defining a flag for this option.
+AC_DEFUN([_AM_SET_OPTION],
+[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
+
+# _AM_SET_OPTIONS(OPTIONS)
+# ----------------------------------
+# OPTIONS is a space-separated list of Automake options.
+AC_DEFUN([_AM_SET_OPTIONS],
+[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+
+# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
+# -------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+AC_DEFUN([_AM_IF_OPTION],
+[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+
+#
+# Check to make sure that the build environment is sane.
+#
+
+# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
+
+# This program 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, 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., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# serial 3
+
+# AM_SANITY_CHECK
+# ---------------
+AC_DEFUN([AM_SANITY_CHECK],
+[AC_MSG_CHECKING([whether build environment is sane])
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments.  Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+   if test "$[*]" = "X"; then
+      # -L didn't work.
+      set X `ls -t $srcdir/configure conftest.file`
+   fi
+   rm -f conftest.file
+   if test "$[*]" != "X $srcdir/configure conftest.file" \
+      && test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+      # If neither matched, then we have a broken ls.  This can happen
+      # if, for instance, CONFIG_SHELL is bash and it inherits a
+      # broken ls alias from the environment.  This has actually
+      # happened.  Such a system could not be considered "sane".
+      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
+alias in your environment])
+   fi
+
+   test "$[2]" = conftest.file
+   )
+then
+   # Ok.
+   :
+else
+   AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+AC_MSG_RESULT(yes)])
+
+#  -*- Autoconf -*-
+
+
+# Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
+
+# This program 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, 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., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# serial 3
+
+# AM_MISSING_PROG(NAME, PROGRAM)
+# ------------------------------
+AC_DEFUN([AM_MISSING_PROG],
+[AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+
+
+# AM_MISSING_HAS_RUN
+# ------------------
+# Define MISSING if not defined so far and test if it supports --run.
+# If it does, set am_missing_run to use it, otherwise, to nothing.
+AC_DEFUN([AM_MISSING_HAS_RUN],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+  am_missing_run="$MISSING --run "
+else
+  am_missing_run=
+  AC_MSG_WARN([`missing' script is too old or missing])
+fi
+])
+
+# AM_AUX_DIR_EXPAND
+
+# Copyright 2001 Free Software Foundation, Inc.
+
+# This program 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, 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., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
+# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
+# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
+#
+# Of course, Automake must honor this variable whenever it calls a
+# tool from the auxiliary directory.  The problem is that $srcdir (and
+# therefore $ac_aux_dir as well) can be either absolute or relative,
+# depending on how configure is run.  This is pretty annoying, since
+# it makes $ac_aux_dir quite unusable in subdirectories: in the top
+# source directory, any form will work fine, but in subdirectories a
+# relative path needs to be adjusted first.
+#
+# $ac_aux_dir/missing
+#    fails when called from a subdirectory if $ac_aux_dir is relative
+# $top_srcdir/$ac_aux_dir/missing
+#    fails if $ac_aux_dir is absolute,
+#    fails when called from a subdirectory in a VPATH build with
+#          a relative $ac_aux_dir
+#
+# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
+# are both prefixed by $srcdir.  In an in-source build this is usually
+# harmless because $srcdir is `.', but things will broke when you
+# start a VPATH build or use an absolute $srcdir.
+#
+# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
+# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
+#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
+# and then we would define $MISSING as
+#   MISSING="\${SHELL} $am_aux_dir/missing"
+# This will work as long as MISSING is not called from configure, because
+# unfortunately $(top_srcdir) has no meaning in configure.
+# However there are other variables, like CC, which are often used in
+# configure, and could therefore not use this "fixed" $ac_aux_dir.
+#
+# Another solution, used here, is to always expand $ac_aux_dir to an
+# absolute PATH.  The drawback is that using absolute paths prevent a
+# configured tree to be moved without reconfiguration.
+
+# Rely on autoconf to set up CDPATH properly.
+AC_PREREQ([2.50])
+
+AC_DEFUN([AM_AUX_DIR_EXPAND], [
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+])
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+
+# Copyright 2001 Free Software Foundation, Inc.
+
+# This program 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, 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., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+install_sh=${install_sh-"$am_aux_dir/install-sh"}
+AC_SUBST(install_sh)])
+
+# AM_PROG_INSTALL_STRIP
+
+# Copyright 2001 Free Software Foundation, Inc.
+
+# This program 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, 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., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# One issue with vendor `install' (even GNU) is that you can't
+# specify the program used to strip binaries.  This is especially
+# annoying in cross-compiling environments, where the build's strip
+# is unlikely to handle the host's binaries.
+# Fortunately install-sh will honor a STRIPPROG variable, so we
+# always use install-sh in `make install-strip', and initialize
+# STRIPPROG with the value of the STRIP variable (set by the user).
+AC_DEFUN([AM_PROG_INSTALL_STRIP],
+[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'.  However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
+if test "$cross_compiling" != no; then
+  AC_CHECK_TOOL([STRIP], [strip], :)
+fi
+INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+#                                                          -*- Autoconf -*-
+# Copyright (C) 2003  Free Software Foundation, Inc.
+
+# This program 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, 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., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# serial 1
+
+# Check whether the underlying file-system supports filenames
+# with a leading dot.  For instance MS-DOS doesn't.
+AC_DEFUN([AM_SET_LEADING_DOT],
+[rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+  am__leading_dot=.
+else
+  am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+AC_SUBST([am__leading_dot])])
+
+# serial 5						-*- Autoconf -*-
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003  Free Software Foundation, Inc.
+
+# This program 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, 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., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+
+# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
+# written in clear, in which case automake, when reading aclocal.m4,
+# will think it sees a *use*, and therefore will trigger all it's
+# C support machinery.  Also note that it means that autoscan, seeing
+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
+
+
+# _AM_DEPENDENCIES(NAME)
+# ----------------------
+# See how the compiler implements dependency checking.
+# NAME is "CC", "CXX", "GCJ", or "OBJC".
+# We try a few techniques and use that to set a single cache variable.
+#
+# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
+# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
+# dependency, and given that the user is not expected to run this macro,
+# just rely on AC_PROG_CC.
+AC_DEFUN([_AM_DEPENDENCIES],
+[AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
+AC_REQUIRE([AM_MAKE_INCLUDE])dnl
+AC_REQUIRE([AM_DEP_TRACK])dnl
+
+ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
+       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
+       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
+                   [depcc="$$1"   am_compiler_list=])
+
+AC_CACHE_CHECK([dependency style of $depcc],
+               [am_cv_$1_dependencies_compiler_type],
+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_$1_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+  fi
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      : > sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    case $depmode in
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+	continue
+      else
+	break
+      fi
+      ;;
+    none) break ;;
+    esac
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.
+    if depmode=$depmode \
+       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored.
+      if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else
+        am_cv_$1_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_$1_dependencies_compiler_type=none
+fi
+])
+AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
+AM_CONDITIONAL([am__fastdep$1], [
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
+])
+
+
+# AM_SET_DEPDIR
+# -------------
+# Choose a directory name for dependency files.
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES
+AC_DEFUN([AM_SET_DEPDIR],
+[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
+])
+
+
+# AM_DEP_TRACK
+# ------------
+AC_DEFUN([AM_DEP_TRACK],
+[AC_ARG_ENABLE(dependency-tracking,
+[  --disable-dependency-tracking Speeds up one-time builds
+  --enable-dependency-tracking  Do not reject slow dependency extractors])
+if test "x$enable_dependency_tracking" != xno; then
+  am_depcomp="$ac_aux_dir/depcomp"
+  AMDEPBACKSLASH='\'
+fi
+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+AC_SUBST([AMDEPBACKSLASH])
+])
+
+# Generate code to set up dependency tracking.   -*- Autoconf -*-
+
+# Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+
+# This program 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, 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., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+#serial 2
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[for mf in $CONFIG_FILES; do
+  # Strip MF so we end up with the name of the file.
+  mf=`echo "$mf" | sed -e 's/:.*$//'`
+  # Check whether this is an Automake generated Makefile or not.
+  # We used to match only the files named `Makefile.in', but
+  # some people rename them; so instead we look at the file content.
+  # Grep'ing the first line is not enough: some people post-process
+  # each Makefile.in and add a new line on top of each file to say so.
+  # So let's grep whole file.
+  if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
+    dirpart=`AS_DIRNAME("$mf")`
+  else
+    continue
+  fi
+  grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue
+  # Extract the definition of DEP_FILES from the Makefile without
+  # running `make'.
+  DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
+  test -z "$DEPDIR" && continue
+  # When using ansi2knr, U may be empty or an underscore; expand it
+  U=`sed -n -e '/^U = / s///p' < "$mf"`
+  test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
+  # We invoke sed twice because it is the simplest approach to
+  # changing $(DEPDIR) to its actual value in the expansion.
+  for file in `sed -n -e '
+    /^DEP_FILES = .*\\\\$/ {
+      s/^DEP_FILES = //
+      :loop
+	s/\\\\$//
+	p
+	n
+	/\\\\$/ b loop
+      p
+    }
+    /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
+       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+    # Make sure the directory exists.
+    test -f "$dirpart/$file" && continue
+    fdir=`AS_DIRNAME(["$file"])`
+    AS_MKDIR_P([$dirpart/$fdir])
+    # echo "creating $dirpart/$file"
+    echo '# dummy' > "$dirpart/$file"
+  done
+done
+])# _AM_OUTPUT_DEPENDENCY_COMMANDS
+
+
+# AM_OUTPUT_DEPENDENCY_COMMANDS
+# -----------------------------
+# This macro should only be invoked once -- use via AC_REQUIRE.
+#
+# This code is only required when automatic dependency tracking
+# is enabled.  FIXME.  This creates each `.P' file that we will
+# need in order to bootstrap the dependency handling code.
+AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
+[AC_CONFIG_COMMANDS([depfiles],
+     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
+     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
+])
+
+# Check to see how 'make' treats includes.	-*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
+
+# This program 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, 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., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# serial 2
+
+# AM_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+	@echo done
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+AC_MSG_CHECKING([for style of include used by $am_make])
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
+   am__include=include
+   am__quote=
+   _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+      am__include=.include
+      am__quote="\""
+      _am_result=BSD
+   fi
+fi
+AC_SUBST([am__include])
+AC_SUBST([am__quote])
+AC_MSG_RESULT([$_am_result])
+rm -f confinc confmf
+])
+
+# AM_CONDITIONAL                                              -*- Autoconf -*-
+
+# Copyright 1997, 2000, 2001 Free Software Foundation, Inc.
+
+# This program 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, 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., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# serial 5
+
+AC_PREREQ(2.52)
+
+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+AC_DEFUN([AM_CONDITIONAL],
+[ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
+        [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])
+AC_SUBST([$1_FALSE])
+if $2; then
+  $1_TRUE=
+  $1_FALSE='#'
+else
+  $1_TRUE='#'
+  $1_FALSE=
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+  AC_MSG_ERROR([conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.])
+fi])])
+
+# Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*-
+
+# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
+
+# This program 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, 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., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+AC_PREREQ([2.52])
+
+# serial 6
+
+# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
+AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
+
+dnl Autoconf macros for libgnutls
+dnl $id$
+
+# Modified for LIBGNUTLS -- nmav
+# Configure paths for LIBGCRYPT
+# Shamelessly stolen from the one of XDELTA by Owen Taylor
+# Werner Koch   99-12-09
+
+dnl AM_PATH_LIBGNUTLS([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
+dnl Test for libgnutls, and define LIBGNUTLS_CFLAGS and LIBGNUTLS_LIBS
+dnl
+AC_DEFUN(AM_PATH_LIBGNUTLS,
+[dnl
+dnl Get the cflags and libraries from the libgnutls-config script
+dnl
+AC_ARG_WITH(libgnutls-prefix,
+          [  --with-libgnutls-prefix=PFX   Prefix where libgnutls is installed (optional)],
+          libgnutls_config_prefix="$withval", libgnutls_config_prefix="")
+
+  if test x$libgnutls_config_prefix != x ; then
+     libgnutls_config_args="$libgnutls_config_args --prefix=$libgnutls_config_prefix"
+     if test x${LIBGNUTLS_CONFIG+set} != xset ; then
+        LIBGNUTLS_CONFIG=$libgnutls_config_prefix/bin/libgnutls-config
+     fi
+  fi
+
+  AC_PATH_PROG(LIBGNUTLS_CONFIG, libgnutls-config, no)
+  min_libgnutls_version=ifelse([$1], ,0.1.0,$1)
+  AC_MSG_CHECKING(for libgnutls - version >= $min_libgnutls_version)
+  no_libgnutls=""
+  if test "$LIBGNUTLS_CONFIG" = "no" ; then
+    no_libgnutls=yes
+  else
+    LIBGNUTLS_CFLAGS=`$LIBGNUTLS_CONFIG $libgnutls_config_args --cflags`
+    LIBGNUTLS_LIBS=`$LIBGNUTLS_CONFIG $libgnutls_config_args --libs`
+    libgnutls_config_version=`$LIBGNUTLS_CONFIG $libgnutls_config_args --version`
+
+
+      ac_save_CFLAGS="$CFLAGS"
+      ac_save_LIBS="$LIBS"
+      CFLAGS="$CFLAGS $LIBGNUTLS_CFLAGS"
+      LIBS="$LIBS $LIBGNUTLS_LIBS"
+dnl
+dnl Now check if the installed libgnutls is sufficiently new. Also sanity
+dnl checks the results of libgnutls-config to some extent
+dnl
+      rm -f conf.libgnutlstest
+      AC_TRY_RUN([
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <gnutls/gnutls.h>
+
+int
+main ()
+{
+    system ("touch conf.libgnutlstest");
+
+    if( strcmp( gnutls_check_version(NULL), "$libgnutls_config_version" ) )
+    {
+      printf("\n*** 'libgnutls-config --version' returned %s, but LIBGNUTLS (%s)\n",
+             "$libgnutls_config_version", gnutls_check_version(NULL) );
+      printf("*** was found! If libgnutls-config was correct, then it is best\n");
+      printf("*** to remove the old version of LIBGNUTLS. You may also be able to fix the error\n");
+      printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
+      printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
+      printf("*** required on your system.\n");
+      printf("*** If libgnutls-config was wrong, set the environment variable LIBGNUTLS_CONFIG\n");
+      printf("*** to point to the correct copy of libgnutls-config, and remove the file config.cache\n");
+      printf("*** before re-running configure\n");
+    }
+    else if ( strcmp(gnutls_check_version(NULL), LIBGNUTLS_VERSION ) )
+    {
+      printf("\n*** LIBGNUTLS header file (version %s) does not match\n", LIBGNUTLS_VERSION);
+      printf("*** library (version %s)\n", gnutls_check_version(NULL) );
+    }
+    else
+    {
+      if ( gnutls_check_version( "$min_libgnutls_version" ) )
+      {
+        return 0;
+      }
+     else
+      {
+        printf("no\n*** An old version of LIBGNUTLS (%s) was found.\n",
+                gnutls_check_version(NULL) );
+        printf("*** You need a version of LIBGNUTLS newer than %s. The latest version of\n",
+               "$min_libgnutls_version" );
+        printf("*** LIBGNUTLS is always available from ftp://gnutls.hellug.gr/pub/gnutls.\n");
+        printf("*** \n");
+        printf("*** If you have already installed a sufficiently new version, this error\n");
+        printf("*** probably means that the wrong copy of the libgnutls-config shell script is\n");
+        printf("*** being found. The easiest way to fix this is to remove the old version\n");
+        printf("*** of LIBGNUTLS, but you can also set the LIBGNUTLS_CONFIG environment to point to the\n");
+        printf("*** correct copy of libgnutls-config. (In this case, you will have to\n");
+        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
+        printf("*** so that the correct libraries are found at run-time))\n");
+      }
+    }
+  return 1;
+}
+],, no_libgnutls=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
+       CFLAGS="$ac_save_CFLAGS"
+       LIBS="$ac_save_LIBS"
+  fi
+
+  if test "x$no_libgnutls" = x ; then
+     AC_MSG_RESULT(yes)
+     ifelse([$2], , :, [$2])
+  else
+     if test -f conf.libgnutlstest ; then
+        :
+     else
+        AC_MSG_RESULT(no)
+     fi
+     if test "$LIBGNUTLS_CONFIG" = "no" ; then
+       echo "*** The libgnutls-config script installed by LIBGNUTLS could not be found"
+       echo "*** If LIBGNUTLS was installed in PREFIX, make sure PREFIX/bin is in"
+       echo "*** your path, or set the LIBGNUTLS_CONFIG environment variable to the"
+       echo "*** full path to libgnutls-config."
+     else
+       if test -f conf.libgnutlstest ; then
+        :
+       else
+          echo "*** Could not run libgnutls test program, checking why..."
+          CFLAGS="$CFLAGS $LIBGNUTLS_CFLAGS"
+          LIBS="$LIBS $LIBGNUTLS_LIBS"
+          AC_TRY_LINK([
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <gnutls/gnutls.h>
+],      [ return !!gnutls_check_version(NULL); ],
+        [ echo "*** The test program compiled, but did not run. This usually means"
+          echo "*** that the run-time linker is not finding LIBGNUTLS or finding the wrong"
+          echo "*** version of LIBGNUTLS. If it is not finding LIBGNUTLS, you'll need to set your"
+          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
+          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
+          echo "*** is required on your system"
+          echo "***"
+          echo "*** If you have an old version installed, it is best to remove it, although"
+          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
+          echo "***" ],
+        [ echo "*** The test program failed to compile or link. See the file config.log for the"
+          echo "*** exact error that occured. This usually means LIBGNUTLS was incorrectly installed"
+          echo "*** or that you have moved LIBGNUTLS since it was installed. In the latter case, you"
+          echo "*** may want to edit the libgnutls-config script: $LIBGNUTLS_CONFIG" ])
+          CFLAGS="$ac_save_CFLAGS"
+          LIBS="$ac_save_LIBS"
+       fi
+     fi
+     LIBGNUTLS_CFLAGS=""
+     LIBGNUTLS_LIBS=""
+     ifelse([$3], , :, [$3])
+  fi
+  rm -f conf.libgnutlstest
+  AC_SUBST(LIBGNUTLS_CFLAGS)
+  AC_SUBST(LIBGNUTLS_LIBS)
+])
+
+dnl *-*wedit:notab*-*  Please keep this as the last line.
+
+dnl Autoconf macros for libgcrypt
+dnl $id$
+
+# Configure paths for LIBGCRYPT
+# Shamelessly stolen from the one of XDELTA by Owen Taylor
+# Werner Koch   99-12-09
+
+dnl AM_PATH_LIBGCRYPT([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
+dnl Test for libgcrypt, and define GCRYPT_CFLAGS and GCRYPT_LIBS
+dnl
+AC_DEFUN(AM_PATH_LIBGCRYPT,
+[dnl
+dnl Get the cflags and libraries from the libgcrypt-config script
+dnl
+AC_ARG_WITH(libgcrypt-prefix,
+          [  --with-libgcrypt-prefix=PFX   Prefix where libgcrypt is installed (optional)],
+          libgcrypt_config_prefix="$withval", libgcrypt_config_prefix="")
+AC_ARG_ENABLE(libgcrypttest,
+          [  --disable-libgcrypttest    Do not try to compile and run a test libgcrypt program],
+          , enable_libgcrypttest=yes)
+
+  if test x$libgcrypt_config_prefix != x ; then
+     libgcrypt_config_args="$libgcrypt_config_args --prefix=$libgcrypt_config_prefix"
+     if test x${LIBGCRYPT_CONFIG+set} != xset ; then
+        LIBGCRYPT_CONFIG=$libgcrypt_config_prefix/bin/libgcrypt-config
+     fi
+  fi
+
+  AC_PATH_PROG(LIBGCRYPT_CONFIG, libgcrypt-config, no)
+  min_libgcrypt_version=ifelse([$1], ,1.1.0,$1)
+  AC_MSG_CHECKING(for libgcrypt - version >= $min_libgcrypt_version)
+  no_libgcrypt=""
+  if test "$LIBGCRYPT_CONFIG" = "no" ; then
+    no_libgcrypt=yes
+  else
+    LIBGCRYPT_CFLAGS=`$LIBGCRYPT_CONFIG $libgcrypt_config_args --cflags`
+    LIBGCRYPT_LIBS=`$LIBGCRYPT_CONFIG $libgcrypt_config_args --libs`
+    libgcrypt_config_version=`$LIBGCRYPT_CONFIG $libgcrypt_config_args --version`
+    if test "x$enable_libgcrypttest" = "xyes" ; then
+      ac_save_CFLAGS="$CFLAGS"
+      ac_save_LIBS="$LIBS"
+      CFLAGS="$CFLAGS $LIBGCRYPT_CFLAGS"
+      LIBS="$LIBS $LIBGCRYPT_LIBS"
+dnl
+dnl Now check if the installed libgcrypt is sufficiently new. Also sanity
+dnl checks the results of libgcrypt-config to some extent
+dnl
+      rm -f conf.libgcrypttest
+      AC_TRY_RUN([
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <gcrypt.h>
+
+int
+main ()
+{
+    system ("touch conf.libgcrypttest");
+
+    if( strcmp( gcry_check_version(NULL), "$libgcrypt_config_version" ) )
+    {
+      printf("\n*** 'libgcrypt-config --version' returned %s, but LIBGCRYPT (%s)\n",
+             "$libgcrypt_config_version", gcry_check_version(NULL) );
+      printf("*** was found! If libgcrypt-config was correct, then it is best\n");
+      printf("*** to remove the old version of LIBGCRYPT. You may also be able to fix the error\n");
+      printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
+      printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
+      printf("*** required on your system.\n");
+      printf("*** If libgcrypt-config was wrong, set the environment variable LIBGCRYPT_CONFIG\n");
+      printf("*** to point to the correct copy of libgcrypt-config, and remove the file config.cache\n");
+      printf("*** before re-running configure\n");
+    }
+    else if ( strcmp(gcry_check_version(NULL), GCRYPT_VERSION ) )
+    {
+      printf("\n*** LIBGCRYPT header file (version %s) does not match\n", GCRYPT_VERSION);
+      printf("*** library (version %s)\n", gcry_check_version(NULL) );
+    }
+    else
+    {
+      if ( gcry_check_version( "$min_libgcrypt_version" ) )
+      {
+        return 0;
+      }
+     else
+      {
+        printf("no\n*** An old version of LIBGCRYPT (%s) was found.\n",
+                gcry_check_version(NULL) );
+        printf("*** You need a version of LIBGCRYPT newer than %s. The latest version of\n",
+               "$min_libgcrypt_version" );
+        printf("*** LIBGCRYPT is always available from ftp://ftp.gnupg.org/pub/libgcrypt/gnupg.\n");
+        printf("*** (It is distributed along with GnuPG).\n");
+        printf("*** \n");
+        printf("*** If you have already installed a sufficiently new version, this error\n");
+        printf("*** probably means that the wrong copy of the libgcrypt-config shell script is\n");
+        printf("*** being found. The easiest way to fix this is to remove the old version\n");
+        printf("*** of LIBGCRYPT, but you can also set the LIBGCRYPT_CONFIG environment to point to the\n");
+        printf("*** correct copy of libgcrypt-config. (In this case, you will have to\n");
+        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
+        printf("*** so that the correct libraries are found at run-time))\n");
+      }
+    }
+  return 1;
+}
+],, no_libgcrypt=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
+       CFLAGS="$ac_save_CFLAGS"
+       LIBS="$ac_save_LIBS"
+     fi
+  fi
+  if test "x$no_libgcrypt" = x ; then
+     AC_MSG_RESULT(yes)
+     ifelse([$2], , :, [$2])
+  else
+     if test -f conf.libgcrypttest ; then
+        :
+     else
+        AC_MSG_RESULT(no)
+     fi
+     if test "$LIBGCRYPT_CONFIG" = "no" ; then
+       echo "*** The libgcrypt-config script installed by LIBGCRYPT could not be found"
+       echo "*** If LIBGCRYPT was installed in PREFIX, make sure PREFIX/bin is in"
+       echo "*** your path, or set the LIBGCRYPT_CONFIG environment variable to the"
+       echo "*** full path to libgcrypt-config."
+     else
+       if test -f conf.libgcrypttest ; then
+        :
+       else
+          echo "*** Could not run libgcrypt test program, checking why..."
+          CFLAGS="$CFLAGS $LIBGCRYPT_CFLAGS"
+          LIBS="$LIBS $LIBGCRYPT_LIBS"
+          AC_TRY_LINK([
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <gcrypt.h>
+],      [ return !!gcry_check_version(NULL); ],
+        [ echo "*** The test program compiled, but did not run. This usually means"
+          echo "*** that the run-time linker is not finding LIBGCRYPT or finding the wrong"
+          echo "*** version of LIBGCRYPT. If it is not finding LIBGCRYPT, you'll need to set your"
+          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
+          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
+          echo "*** is required on your system"
+          echo "***"
+          echo "*** If you have an old version installed, it is best to remove it, although"
+          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
+          echo "***" ],
+        [ echo "*** The test program failed to compile or link. See the file config.log for the"
+          echo "*** exact error that occured. This usually means LIBGCRYPT was incorrectly installed"
+          echo "*** or that you have moved LIBGCRYPT since it was installed. In the latter case, you"
+          echo "*** may want to edit the libgcrypt-config script: $LIBGCRYPT_CONFIG" ])
+          CFLAGS="$ac_save_CFLAGS"
+          LIBS="$ac_save_LIBS"
+       fi
+     fi
+     LIBGCRYPT_CFLAGS=""
+     LIBGCRYPT_LIBS=""
+     ifelse([$3], , :, [$3])
+  fi
+  AC_SUBST(LIBGCRYPT_CFLAGS)
+  AC_SUBST(LIBGCRYPT_LIBS)
+  rm -f conf.libgcrypttest
+])
+
+dnl *-*wedit:notab*-*  Please keep this as the last line.
+
diff --git a/autoconf/Makefile.am b/autoconf/Makefile.am
new file mode 100644
index 0000000..fba51d9
--- /dev/null
+++ b/autoconf/Makefile.am
@@ -0,0 +1,2 @@
+
+EXTRA_DIST = 
diff --git a/autoconf/Makefile.in b/autoconf/Makefile.in
new file mode 100644
index 0000000..3a8e41d
--- /dev/null
+++ b/autoconf/Makefile.in
@@ -0,0 +1,265 @@
+# Makefile.in generated by automake 1.7.9 from Makefile.am.
+# @configure_input@
+
+# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+# Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CVS2CL = @CVS2CL@
+CYGPATH_W = @CYGPATH_W@
+DEFAULT_ASKPASS = @DEFAULT_ASKPASS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+GCRYPT_MAN_STATUS = @GCRYPT_MAN_STATUS@
+GNUTLS_COMMON_O = @GNUTLS_COMMON_O@
+GNUTLS_MAN_STATUS = @GNUTLS_MAN_STATUS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@
+LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@
+LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@
+LIBGNUTLS_CFLAGS = @LIBGNUTLS_CFLAGS@
+LIBGNUTLS_CONFIG = @LIBGNUTLS_CONFIG@
+LIBGNUTLS_LIBS = @LIBGNUTLS_LIBS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SKINDIR = @SKINDIR@
+STRIP = @STRIP@
+VERSION = @VERSION@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+bindir = @bindir@
+build_alias = @build_alias@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host_alias = @host_alias@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+
+EXTRA_DIST = 
+subdir = autoconf
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+mkinstalldirs = $(SHELL) $(top_srcdir)/autoconf/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+DIST_SOURCES =
+DIST_COMMON = $(srcdir)/Makefile.in Makefile.am depcomp install-sh \
+	missing mkinstalldirs
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  Makefile.am  $(top_srcdir)/configure.ac $(ACLOCAL_M4)
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu  autoconf/Makefile
+Makefile:  $(srcdir)/Makefile.in  $(top_builddir)/config.status
+	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
+uninstall-info-am:
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+
+top_distdir = ..
+distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkinstalldirs) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile
+
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: all all-am check check-am clean clean-generic distclean \
+	distclean-generic distdir dvi dvi-am info info-am install \
+	install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am \
+	uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/autoconf/depcomp b/autoconf/depcomp
new file mode 100755
index 0000000..807b991
--- /dev/null
+++ b/autoconf/depcomp
@@ -0,0 +1,423 @@
+#! /bin/sh
+
+# depcomp - compile a program generating dependencies as side-effects
+# Copyright 1999, 2000 Free Software Foundation, Inc.
+
+# This program 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, 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., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, 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 Alexandre Oliva <oliva at dcc.unicamp.br>.
+
+if test -z "$depmode" || test -z "$source" || test -z "$object"; then
+  echo "depcomp: Variables source, object and depmode must be set" 1>&2
+  exit 1
+fi
+# `libtool' can also be set to `yes' or `no'.
+
+if test -z "$depfile"; then
+   base=`echo "$object" | sed -e 's,^.*/,,' -e 's,\.\([^.]*\)$,.P\1,'`
+   dir=`echo "$object" | sed 's,/.*$,/,'`
+   if test "$dir" = "$object"; then
+      dir=
+   fi
+   # FIXME: should be _deps on DOS.
+   depfile="$dir.deps/$base"
+fi
+
+tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
+
+rm -f "$tmpdepfile"
+
+# Some modes work just like other modes, but use different flags.  We
+# parameterize here, but still list the modes in the big case below,
+# to make depend.m4 easier to write.  Note that we *cannot* use a case
+# here, because this file can only contain one case statement.
+if test "$depmode" = hp; then
+  # HP compiler uses -M and no extra arg.
+  gccflag=-M
+  depmode=gcc
+fi
+
+if test "$depmode" = dashXmstdout; then
+   # This is just like dashmstdout with a different argument.
+   dashmflag=-xM
+   depmode=dashmstdout
+fi
+
+case "$depmode" in
+gcc3)
+## gcc 3 implements dependency tracking that does exactly what
+## we want.  Yay!  Note: for some reason libtool 1.4 doesn't like
+## it if -MD -MP comes after the -MF stuff.  Hmm.
+  "$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  mv "$tmpdepfile" "$depfile"
+  ;;
+
+gcc)
+## There are various ways to get dependency output from gcc.  Here's
+## why we pick this rather obscure method:
+## - Don't want to use -MD because we'd like the dependencies to end
+##   up in a subdir.  Having to rename by hand is ugly.
+##   (We might end up doing this anyway to support other compilers.)
+## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
+##   -MM, not -M (despite what the docs say).
+## - Using -M directly means running the compiler twice (even worse
+##   than renaming).
+  if test -z "$gccflag"; then
+    gccflag=-MD,
+  fi
+  "$@" -Wp,"$gccflag$tmpdepfile"
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
+## The second -e expression handles DOS-style file names with drive letters.
+  sed -e 's/^[^:]*: / /' \
+      -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
+## This next piece of magic avoids the `deleted header file' problem.
+## The problem is that when a header file which appears in a .P file
+## is deleted, the dependency causes make to die (because there is
+## typically no way to rebuild the header).  We avoid this by adding
+## dummy dependencies for each header file.  Too bad gcc doesn't do
+## this for us directly.
+  tr ' ' '
+' < "$tmpdepfile" |
+## Some versions of gcc put a space before the `:'.  On the theory
+## that the space means something, we add a space to the output as
+## well.
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly.  Breaking it into two sed invocations is a workaround.
+    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+hp)
+  # This case exists only to let depend.m4 do its work.  It works by
+  # looking at the text of this script.  This case will never be run,
+  # since it is checked for above.
+  exit 1
+  ;;
+
+sgi)
+  if test "$libtool" = yes; then
+    "$@" "-Wp,-MDupdate,$tmpdepfile"
+  else
+    "$@" -MDupdate "$tmpdepfile"
+  fi
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+
+  if test -f "$tmpdepfile"; then  # yes, the sourcefile depend on other files
+    echo "$object : \\" > "$depfile"
+
+    # Clip off the initial element (the dependent).  Don't try to be
+    # clever and replace this with sed code, as IRIX sed won't handle
+    # lines with more than a fixed number of characters (4096 in
+    # IRIX 6.2 sed, 8192 in IRIX 6.5).  We also remove comment lines;
+    # the IRIX cc adds comments like `#:fec' to the end of the
+    # dependency line.
+    tr ' ' '
+' < "$tmpdepfile" \
+    | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
+    tr '
+' ' ' >> $depfile
+    echo >> $depfile
+
+    # The second pass generates a dummy entry for each header file.
+    tr ' ' '
+' < "$tmpdepfile" \
+   | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
+   >> $depfile
+  else
+    # The sourcefile does not contain any dependencies, so just
+    # store a dummy comment line, to avoid errors with the Makefile
+    # "include basename.Plo" scheme.
+    echo "#dummy" > "$depfile"
+  fi
+  rm -f "$tmpdepfile"
+  ;;
+
+aix)
+  # The C for AIX Compiler uses -M and outputs the dependencies
+  # in a .u file.  This file always lives in the current directory.
+  # Also, the AIX compiler puts `$object:' at the start of each line;
+  # $object doesn't have directory information.
+  stripped=`echo "$object" | sed -e 's,^.*/,,' -e 's/\(.*\)\..*$/\1/'`
+  tmpdepfile="$stripped.u"
+  outname="$stripped.o"
+  if test "$libtool" = yes; then
+    "$@" -Wc,-M
+  else
+    "$@" -M
+  fi
+
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+
+  if test -f "$tmpdepfile"; then
+    # Each line is of the form `foo.o: dependent.h'.
+    # Do two passes, one to just change these to
+    # `$object: dependent.h' and one to simply `dependent.h:'.
+    sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
+    sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
+  else
+    # The sourcefile does not contain any dependencies, so just
+    # store a dummy comment line, to avoid errors with the Makefile
+    # "include basename.Plo" scheme.
+    echo "#dummy" > "$depfile"
+  fi
+  rm -f "$tmpdepfile"
+  ;;
+
+tru64)
+   # The Tru64 compiler uses -MD to generate dependencies as a side
+   # effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
+   # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
+   # dependencies in `foo.d' instead, so we check for that too.
+   # Subdirectories are respected.
+   dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+   test "x$dir" = "x$object" && dir=
+   base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+
+   if test "$libtool" = yes; then
+      tmpdepfile1="$dir.libs/$base.lo.d"
+      tmpdepfile2="$dir.libs/$base.d"
+      "$@" -Wc,-MD
+   else
+      tmpdepfile1="$dir$base.o.d"
+      tmpdepfile2="$dir$base.d"
+      "$@" -MD
+   fi
+
+   stat=$?
+   if test $stat -eq 0; then :
+   else
+      rm -f "$tmpdepfile1" "$tmpdepfile2"
+      exit $stat
+   fi
+
+   if test -f "$tmpdepfile1"; then
+      tmpdepfile="$tmpdepfile1"
+   else
+      tmpdepfile="$tmpdepfile2"
+   fi
+   if test -f "$tmpdepfile"; then
+      sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+      # That's a space and a tab in the [].
+      sed -e 's,^.*\.[a-z]*:[ 	]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+   else
+      echo "#dummy" > "$depfile"
+   fi
+   rm -f "$tmpdepfile"
+   ;;
+
+#nosideeffect)
+  # This comment above is used by automake to tell side-effect
+  # dependency tracking mechanisms from slower ones.
+
+dashmstdout)
+  # Important note: in order to support this mode, a compiler *must*
+  # always write the proprocessed file to stdout, regardless of -o.
+  "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test $1 != '--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
+  # Remove `-o $object'.  We will use -o /dev/null later,
+  # however we can't do the remplacement now because
+  # `-o $object' might simply not be used
+  IFS=" "
+  for arg
+  do
+    case $arg in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
+    *)
+      set fnord "$@" "$arg"
+      shift # fnord
+      shift # $arg
+      ;;
+    esac
+  done
+
+  test -z "$dashmflag" && dashmflag=-M
+  "$@" -o /dev/null $dashmflag | sed 's:^[^:]*\:[ 	]*:'"$object"'\: :' > "$tmpdepfile"
+  rm -f "$depfile"
+  cat < "$tmpdepfile" > "$depfile"
+  tr ' ' '
+' < "$tmpdepfile" | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly.  Breaking it into two sed invocations is a workaround.
+    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+dashXmstdout)
+  # This case only exists to satisfy depend.m4.  It is never actually
+  # run, as this mode is specially recognized in the preamble.
+  exit 1
+  ;;
+
+makedepend)
+  "$@" || exit $?
+  # X makedepend
+  shift
+  cleared=no
+  for arg in "$@"; do
+    case $cleared in
+    no)
+      set ""; shift
+      cleared=yes ;;
+    esac
+    case "$arg" in
+    -D*|-I*)
+      set fnord "$@" "$arg"; shift ;;
+    -*)
+      ;;
+    *)
+      set fnord "$@" "$arg"; shift ;;
+    esac
+  done
+  obj_suffix="`echo $object | sed 's/^.*\././'`"
+  touch "$tmpdepfile"
+  ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
+  rm -f "$depfile"
+  cat < "$tmpdepfile" > "$depfile"
+  sed '1,2d' "$tmpdepfile" | tr ' ' '
+' | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly.  Breaking it into two sed invocations is a workaround.
+    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile" "$tmpdepfile".bak
+  ;;
+
+cpp)
+  # Important note: in order to support this mode, a compiler *must*
+  # always write the proprocessed file to stdout.
+  "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test $1 != '--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
+  # Remove `-o $object'.
+  IFS=" "
+  for arg
+  do
+    case $arg in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
+    *)
+      set fnord "$@" "$arg"
+      shift # fnord
+      shift # $arg
+      ;;
+    esac
+  done
+
+  "$@" -E |
+    sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
+    sed '$ s: \\$::' > "$tmpdepfile"
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  cat < "$tmpdepfile" >> "$depfile"
+  sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+msvisualcpp)
+  # Important note: in order to support this mode, a compiler *must*
+  # always write the proprocessed file to stdout, regardless of -o,
+  # because we must use -o when running libtool.
+  "$@" || exit $?
+  IFS=" "
+  for arg
+  do
+    case "$arg" in
+    "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
+	set fnord "$@"
+	shift
+	shift
+	;;
+    *)
+	set fnord "$@" "$arg"
+	shift
+	shift
+	;;
+    esac
+  done
+  "$@" -E |
+  sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::	\1 \\:p' >> "$depfile"
+  echo "	" >> "$depfile"
+  . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+none)
+  exec "$@"
+  ;;
+
+*)
+  echo "Unknown depmode $depmode" 1>&2
+  exit 1
+  ;;
+esac
+
+exit 0
diff --git a/autoconf/install-sh b/autoconf/install-sh
new file mode 100755
index 0000000..36f96f3
--- /dev/null
+++ b/autoconf/install-sh
@@ -0,0 +1,276 @@
+#!/bin/sh
+#
+# install - install a program, script, or datafile
+# This comes from X11R5 (mit/util/scripts/install.sh).
+#
+# Copyright 1991 by the Massachusetts Institute of Technology
+#
+# Permission to use, copy, modify, distribute, and sell this software and its
+# documentation for any purpose is hereby granted without fee, 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 M.I.T. not be used in advertising or
+# publicity pertaining to distribution of the software without specific,
+# written prior permission.  M.I.T. makes no representations about the
+# suitability of this software for any purpose.  It is provided "as is"
+# without express or implied warranty.
+#
+# 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="${DOITPROG-}"
+
+
+# put in absolute paths if you don't have them in your path; or use env. vars.
+
+mvprog="${MVPROG-mv}"
+cpprog="${CPPROG-cp}"
+chmodprog="${CHMODPROG-chmod}"
+chownprog="${CHOWNPROG-chown}"
+chgrpprog="${CHGRPPROG-chgrp}"
+stripprog="${STRIPPROG-strip}"
+rmprog="${RMPROG-rm}"
+mkdirprog="${MKDIRPROG-mkdir}"
+
+transformbasename=""
+transform_arg=""
+instcmd="$mvprog"
+chmodcmd="$chmodprog 0755"
+chowncmd=""
+chgrpcmd=""
+stripcmd=""
+rmcmd="$rmprog -f"
+mvcmd="$mvprog"
+src=""
+dst=""
+dir_arg=""
+
+while [ x"$1" != x ]; do
+    case $1 in
+	-c) instcmd=$cpprog
+	    shift
+	    continue;;
+
+	-d) dir_arg=true
+	    shift
+	    continue;;
+
+	-m) chmodcmd="$chmodprog $2"
+	    shift
+	    shift
+	    continue;;
+
+	-o) chowncmd="$chownprog $2"
+	    shift
+	    shift
+	    continue;;
+
+	-g) chgrpcmd="$chgrpprog $2"
+	    shift
+	    shift
+	    continue;;
+
+	-s) stripcmd=$stripprog
+	    shift
+	    continue;;
+
+	-t=*) transformarg=`echo $1 | sed 's/-t=//'`
+	    shift
+	    continue;;
+
+	-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
+	    shift
+	    continue;;
+
+	*)  if [ x"$src" = x ]
+	    then
+		src=$1
+	    else
+		# this colon is to work around a 386BSD /bin/sh bug
+		:
+		dst=$1
+	    fi
+	    shift
+	    continue;;
+    esac
+done
+
+if [ x"$src" = x ]
+then
+	echo "$0: no input file specified" >&2
+	exit 1
+else
+	:
+fi
+
+if [ x"$dir_arg" != x ]; then
+	dst=$src
+	src=""
+
+	if [ -d "$dst" ]; then
+		instcmd=:
+		chmodcmd=""
+	else
+		instcmd=$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" = 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=$dst/`basename "$src"`
+	else
+		:
+	fi
+fi
+
+## this sed command emulates the dirname command
+dstdir=`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='
+	'
+IFS="${IFS-$defaultIFS}"
+
+oIFS=$IFS
+# Some sh's can't handle IFS=/ for some reason.
+IFS='%'
+set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
+IFS=$oIFS
+
+pathcomp=''
+
+while [ $# -ne 0 ] ; do
+	pathcomp=$pathcomp$1
+	shift
+
+	if [ ! -d "$pathcomp" ] ;
+        then
+		$mkdirprog "$pathcomp"
+	else
+		:
+	fi
+
+	pathcomp=$pathcomp/
+done
+fi
+
+if [ x"$dir_arg" != x ]
+then
+	$doit $instcmd "$dst" &&
+
+	if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dst"; else : ; fi &&
+	if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dst"; else : ; fi &&
+	if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dst"; else : ; fi &&
+	if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dst"; else : ; fi
+else
+
+# If we're going to rename the final executable, determine the name now.
+
+	if [ x"$transformarg" = x ]
+	then
+		dstfile=`basename "$dst"`
+	else
+		dstfile=`basename "$dst" $transformbasename |
+			sed $transformarg`$transformbasename
+	fi
+
+# don't allow the sed command to completely eliminate the filename
+
+	if [ x"$dstfile" = x ]
+	then
+		dstfile=`basename "$dst"`
+	else
+		:
+	fi
+
+# Make a couple of temp file names in the proper directory.
+
+	dsttmp=$dstdir/#inst.$$#
+	rmtmp=$dstdir/#rm.$$#
+
+# Trap to clean up temp files at exit.
+
+	trap 'status=$?; 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" != x ]; then $doit $chowncmd "$dsttmp"; else :;fi &&
+	if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dsttmp"; else :;fi &&
+	if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dsttmp"; else :;fi &&
+	if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dsttmp"; else :;fi &&
+
+# Now remove or move aside any old file at destination location.  We try this
+# 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 trap.
+
+{
+	(exit 0); exit
+}
diff --git a/autoconf/missing b/autoconf/missing
new file mode 100755
index 0000000..6a37006
--- /dev/null
+++ b/autoconf/missing
@@ -0,0 +1,336 @@
+#! /bin/sh
+# Common stub for a few missing GNU programs while installing.
+# Copyright (C) 1996, 1997, 1999, 2000, 2002 Free Software Foundation, Inc.
+# Originally by Fran,cois Pinard <pinard at iro.umontreal.ca>, 1996.
+
+# This program 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, 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., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, 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.
+
+if test $# -eq 0; then
+  echo 1>&2 "Try \`$0 --help' for more information"
+  exit 1
+fi
+
+run=:
+
+# In the cases where this matters, `missing' is being run in the
+# srcdir already.
+if test -f configure.ac; then
+  configure_ac=configure.ac
+else
+  configure_ac=configure.in
+fi
+
+case "$1" in
+--run)
+  # Try to run requested program, and just exit if it succeeds.
+  run=
+  shift
+  "$@" && exit 0
+  ;;
+esac
+
+# If it does not exist, or fails to run (possibly an outdated version),
+# try to emulate it.
+case "$1" in
+
+  -h|--h|--he|--hel|--help)
+    echo "\
+$0 [OPTION]... PROGRAM [ARGUMENT]...
+
+Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
+error status if there is no known handling for PROGRAM.
+
+Options:
+  -h, --help      display this help and exit
+  -v, --version   output version information and exit
+  --run           try to run the given command, and emulate it if it fails
+
+Supported PROGRAM values:
+  aclocal      touch file \`aclocal.m4'
+  autoconf     touch file \`configure'
+  autoheader   touch file \`config.h.in'
+  automake     touch all \`Makefile.in' files
+  bison        create \`y.tab.[ch]', if possible, from existing .[ch]
+  flex         create \`lex.yy.c', if possible, from existing .c
+  help2man     touch the output file
+  lex          create \`lex.yy.c', if possible, from existing .c
+  makeinfo     touch the output file
+  tar          try tar, gnutar, gtar, then tar without non-portable flags
+  yacc         create \`y.tab.[ch]', if possible, from existing .[ch]"
+    ;;
+
+  -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+    echo "missing 0.4 - GNU automake"
+    ;;
+
+  -*)
+    echo 1>&2 "$0: Unknown \`$1' option"
+    echo 1>&2 "Try \`$0 --help' for more information"
+    exit 1
+    ;;
+
+  aclocal*)
+    if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+       # We have it, but it failed.
+       exit 1
+    fi
+
+    echo 1>&2 "\
+WARNING: \`$1' is missing on your system.  You should only need it if
+         you modified \`acinclude.m4' or \`${configure_ac}'.  You might want
+         to install the \`Automake' and \`Perl' packages.  Grab them from
+         any GNU archive site."
+    touch aclocal.m4
+    ;;
+
+  autoconf)
+    if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+       # We have it, but it failed.
+       exit 1
+    fi
+
+    echo 1>&2 "\
+WARNING: \`$1' is missing on your system.  You should only need it if
+         you modified \`${configure_ac}'.  You might want to install the
+         \`Autoconf' and \`GNU m4' packages.  Grab them from any GNU
+         archive site."
+    touch configure
+    ;;
+
+  autoheader)
+    if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+       # We have it, but it failed.
+       exit 1
+    fi
+
+    echo 1>&2 "\
+WARNING: \`$1' is missing on your system.  You should only need it if
+         you modified \`acconfig.h' or \`${configure_ac}'.  You might want
+         to install the \`Autoconf' and \`GNU m4' packages.  Grab them
+         from any GNU archive site."
+    files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
+    test -z "$files" && files="config.h"
+    touch_files=
+    for f in $files; do
+      case "$f" in
+      *:*) touch_files="$touch_files "`echo "$f" |
+				       sed -e 's/^[^:]*://' -e 's/:.*//'`;;
+      *) touch_files="$touch_files $f.in";;
+      esac
+    done
+    touch $touch_files
+    ;;
+
+  automake*)
+    if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+       # We have it, but it failed.
+       exit 1
+    fi
+
+    echo 1>&2 "\
+WARNING: \`$1' is missing on your system.  You should only need it if
+         you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
+         You might want to install the \`Automake' and \`Perl' packages.
+         Grab them from any GNU archive site."
+    find . -type f -name Makefile.am -print |
+	   sed 's/\.am$/.in/' |
+	   while read f; do touch "$f"; done
+    ;;
+
+  autom4te)
+    if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+       # We have it, but it failed.
+       exit 1
+    fi
+
+    echo 1>&2 "\
+WARNING: \`$1' is needed, and you do not seem to have it handy on your
+         system.  You might have modified some files without having the
+         proper tools for further handling them.
+         You can get \`$1Help2man' as part of \`Autoconf' from any GNU
+         archive site."
+
+    file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
+    test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
+    if test -f "$file"; then
+	touch $file
+    else
+	test -z "$file" || exec >$file
+	echo "#! /bin/sh"
+	echo "# Created by GNU Automake missing as a replacement of"
+	echo "#  $ $@"
+	echo "exit 0"
+	chmod +x $file
+	exit 1
+    fi
+    ;;
+
+  bison|yacc)
+    echo 1>&2 "\
+WARNING: \`$1' is missing on your system.  You should only need it if
+         you modified a \`.y' file.  You may need the \`Bison' package
+         in order for those modifications to take effect.  You can get
+         \`Bison' from any GNU archive site."
+    rm -f y.tab.c y.tab.h
+    if [ $# -ne 1 ]; then
+        eval LASTARG="\${$#}"
+	case "$LASTARG" in
+	*.y)
+	    SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
+	    if [ -f "$SRCFILE" ]; then
+	         cp "$SRCFILE" y.tab.c
+	    fi
+	    SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
+	    if [ -f "$SRCFILE" ]; then
+	         cp "$SRCFILE" y.tab.h
+	    fi
+	  ;;
+	esac
+    fi
+    if [ ! -f y.tab.h ]; then
+	echo >y.tab.h
+    fi
+    if [ ! -f y.tab.c ]; then
+	echo 'main() { return 0; }' >y.tab.c
+    fi
+    ;;
+
+  lex|flex)
+    echo 1>&2 "\
+WARNING: \`$1' is missing on your system.  You should only need it if
+         you modified a \`.l' file.  You may need the \`Flex' package
+         in order for those modifications to take effect.  You can get
+         \`Flex' from any GNU archive site."
+    rm -f lex.yy.c
+    if [ $# -ne 1 ]; then
+        eval LASTARG="\${$#}"
+	case "$LASTARG" in
+	*.l)
+	    SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
+	    if [ -f "$SRCFILE" ]; then
+	         cp "$SRCFILE" lex.yy.c
+	    fi
+	  ;;
+	esac
+    fi
+    if [ ! -f lex.yy.c ]; then
+	echo 'main() { return 0; }' >lex.yy.c
+    fi
+    ;;
+
+  help2man)
+    if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+       # We have it, but it failed.
+       exit 1
+    fi
+
+    echo 1>&2 "\
+WARNING: \`$1' is missing on your system.  You should only need it if
+	 you modified a dependency of a manual page.  You may need the
+	 \`Help2man' package in order for those modifications to take
+	 effect.  You can get \`Help2man' from any GNU archive site."
+
+    file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
+    if test -z "$file"; then
+	file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
+    fi
+    if [ -f "$file" ]; then
+	touch $file
+    else
+	test -z "$file" || exec >$file
+	echo ".ab help2man is required to generate this page"
+	exit 1
+    fi
+    ;;
+
+  makeinfo)
+    if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then
+       # We have makeinfo, but it failed.
+       exit 1
+    fi
+
+    echo 1>&2 "\
+WARNING: \`$1' is missing on your system.  You should only need it if
+         you modified a \`.texi' or \`.texinfo' file, or any other file
+         indirectly affecting the aspect of the manual.  The spurious
+         call might also be the consequence of using a buggy \`make' (AIX,
+         DU, IRIX).  You might want to install the \`Texinfo' package or
+         the \`GNU make' package.  Grab either from any GNU archive site."
+    file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
+    if test -z "$file"; then
+      file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
+      file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
+    fi
+    touch $file
+    ;;
+
+  tar)
+    shift
+    if test -n "$run"; then
+      echo 1>&2 "ERROR: \`tar' requires --run"
+      exit 1
+    fi
+
+    # We have already tried tar in the generic part.
+    # Look for gnutar/gtar before invocation to avoid ugly error
+    # messages.
+    if (gnutar --version > /dev/null 2>&1); then
+       gnutar "$@" && exit 0
+    fi
+    if (gtar --version > /dev/null 2>&1); then
+       gtar "$@" && exit 0
+    fi
+    firstarg="$1"
+    if shift; then
+	case "$firstarg" in
+	*o*)
+	    firstarg=`echo "$firstarg" | sed s/o//`
+	    tar "$firstarg" "$@" && exit 0
+	    ;;
+	esac
+	case "$firstarg" in
+	*h*)
+	    firstarg=`echo "$firstarg" | sed s/h//`
+	    tar "$firstarg" "$@" && exit 0
+	    ;;
+	esac
+    fi
+
+    echo 1>&2 "\
+WARNING: I can't seem to be able to run \`tar' with the given arguments.
+         You may want to install GNU tar or Free paxutils, or check the
+         command line arguments."
+    exit 1
+    ;;
+
+  *)
+    echo 1>&2 "\
+WARNING: \`$1' is needed, and you do not seem to have it handy on your
+         system.  You might have modified some files without having the
+         proper tools for further handling them.  Check the \`README' file,
+         it often tells you about the needed prerequirements for installing
+         this package.  You may also peek at any GNU archive site, in case
+         some other package would contain this missing \`$1' program."
+    exit 1
+    ;;
+esac
+
+exit 0
diff --git a/autoconf/mkinstalldirs b/autoconf/mkinstalldirs
new file mode 100755
index 0000000..d2d5f21
--- /dev/null
+++ b/autoconf/mkinstalldirs
@@ -0,0 +1,111 @@
+#! /bin/sh
+# mkinstalldirs --- make directory hierarchy
+# Author: Noah Friedman <friedman at prep.ai.mit.edu>
+# Created: 1993-05-16
+# Public domain
+
+errstatus=0
+dirmode=""
+
+usage="\
+Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..."
+
+# process command line arguments
+while test $# -gt 0 ; do
+  case $1 in
+    -h | --help | --h*)         # -h for help
+      echo "$usage" 1>&2
+      exit 0
+      ;;
+    -m)                         # -m PERM arg
+      shift
+      test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
+      dirmode=$1
+      shift
+      ;;
+    --)                         # stop option processing
+      shift
+      break
+      ;;
+    -*)                         # unknown option
+      echo "$usage" 1>&2
+      exit 1
+      ;;
+    *)                          # first non-opt arg
+      break
+      ;;
+  esac
+done
+
+for file
+do
+  if test -d "$file"; then
+    shift
+  else
+    break
+  fi
+done
+
+case $# in
+  0) exit 0 ;;
+esac
+
+case $dirmode in
+  '')
+    if mkdir -p -- . 2>/dev/null; then
+      echo "mkdir -p -- $*"
+      exec mkdir -p -- "$@"
+    fi
+    ;;
+  *)
+    if mkdir -m "$dirmode" -p -- . 2>/dev/null; then
+      echo "mkdir -m $dirmode -p -- $*"
+      exec mkdir -m "$dirmode" -p -- "$@"
+    fi
+    ;;
+esac
+
+for file
+do
+  set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
+  shift
+
+  pathcomp=
+  for d
+  do
+    pathcomp="$pathcomp$d"
+    case $pathcomp in
+      -*) pathcomp=./$pathcomp ;;
+    esac
+
+    if test ! -d "$pathcomp"; then
+      echo "mkdir $pathcomp"
+
+      mkdir "$pathcomp" || lasterr=$?
+
+      if test ! -d "$pathcomp"; then
+  	errstatus=$lasterr
+      else
+  	if test ! -z "$dirmode"; then
+	  echo "chmod $dirmode $pathcomp"
+    	  lasterr=""
+  	  chmod "$dirmode" "$pathcomp" || lasterr=$?
+
+  	  if test ! -z "$lasterr"; then
+  	    errstatus=$lasterr
+  	  fi
+  	fi
+      fi
+    fi
+
+    pathcomp="$pathcomp/"
+  done
+done
+
+exit $errstatus
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# End:
+# mkinstalldirs ends here
diff --git a/config.h.in b/config.h.in
new file mode 100644
index 0000000..0061f2a
--- /dev/null
+++ b/config.h.in
@@ -0,0 +1,125 @@
+/* config.h.in.  Generated from configure.ac by autoheader.  */
+
+/* Program to use for querying the user for a password: redefine if not on a
+   debian system */
+#undef DEFAULT_ASKPASS
+
+/* Path to use when finding skins (modified pixmaps) */
+#undef DEFAULT_SKIN_PATH
+
+/* Define to 1 if you have the <CoreServices/CoreServices.h> header file. */
+#undef HAVE_CORESERVICES_CORESERVICES_H
+
+/* Define to 1 if you have the <gcrypt.h> header file. */
+#undef HAVE_GCRYPT_H
+
+/* Define to 1 if you have the `getaddrinfo' function. */
+#undef HAVE_GETADDRINFO
+
+/* Define to 1 if you have the <gnutls/gnutls.h> header file. */
+#undef HAVE_GNUTLS_GNUTLS_H
+
+/* Define to 1 if you have the `inet_ntop' function. */
+#undef HAVE_INET_NTOP
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the `nsl' library (-lnsl). */
+#undef HAVE_LIBNSL
+
+/* Define to 1 if you have the `resolv' library (-lresolv). */
+#undef HAVE_LIBRESOLV
+
+/* Define to 1 if you have the `socket' library (-lsocket). */
+#undef HAVE_LIBSOCKET
+
+/* Define to 1 if you have the `X11' library (-lX11). */
+#undef HAVE_LIBX11
+
+/* Define to 1 if you have the `Xext' library (-lXext). */
+#undef HAVE_LIBXEXT
+
+/* Define to 1 if you have the `Xpm' library (-lXpm). */
+#undef HAVE_LIBXPM
+
+/* Define to 1 if you have the `z' library (-lz). */
+#undef HAVE_LIBZ
+
+/* Define to 1 if you have the `memfrob' function. */
+#undef HAVE_MEMFROB
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the `poll' function. */
+#undef HAVE_POLL
+
+/* Define to 1 if you have the <regex.h> header file. */
+#undef HAVE_REGEX_H
+
+/* Define to 1 if you have the <Security/Security.h> header file. */
+#undef HAVE_SECURITY_SECURITY_H
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdio.h> header file. */
+#undef HAVE_STDIO_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define to 1 if you have the <X11/xpm.h> header file. */
+#undef HAVE_X11_XPM_H
+
+/* Define to 1 if you have the <xpm.h> header file. */
+#undef HAVE_XPM_H
+
+/* Define if '__attribute__' is supported by the compiler */
+#undef HAVE___ATTRIBUTE__
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Define as the return type of signal handlers (`int' or `void'). */
+#undef RETSIGTYPE
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* wmbiff's release version */
+#undef VERSION
+
+/* Define to 1 if the X Window System is missing or not being used. */
+#undef X_DISPLAY_MISSING
diff --git a/configure b/configure
new file mode 100755
index 0000000..2a32664
--- /dev/null
+++ b/configure
@@ -0,0 +1,9071 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.59 for WMBiff 0.4.26.
+#
+# Report bugs to <wmbiff-devel at lists.sourceforge.net>.
+#
+# Copyright (C) 2003 Free Software Foundation, Inc.
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## --------------------- ##
+## M4sh Initialization.  ##
+## --------------------- ##
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+  set -o posix
+fi
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+  LC_TELEPHONE LC_TIME
+do
+  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+    eval $as_var=C; export $as_var
+  else
+    $as_unset $as_var
+  fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)$' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+  	  /^X\/\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\/\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+
+
+# PATH needs CR, and LINENO needs CR and PATH.
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
+fi
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
+  # Find who we are.  Look in the path if we contain no path at all
+  # relative or not.
+  case $0 in
+    *[\\/]* ) as_myself=$0 ;;
+    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+
+       ;;
+  esac
+  # We did not find ourselves, most probably we were run as `sh COMMAND'
+  # in which case we are not to be found in the path.
+  if test "x$as_myself" = x; then
+    as_myself=$0
+  fi
+  if test ! -f "$as_myself"; then
+    { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
+   { (exit 1); exit 1; }; }
+  fi
+  case $CONFIG_SHELL in
+  '')
+    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for as_base in sh bash ksh sh5; do
+	 case $as_dir in
+	 /*)
+	   if ("$as_dir/$as_base" -c '
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
+	     $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+	     $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+	     CONFIG_SHELL=$as_dir/$as_base
+	     export CONFIG_SHELL
+	     exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+	   fi;;
+	 esac
+       done
+done
+;;
+  esac
+
+  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+  # uniformly replaced by the line number.  The first 'sed' inserts a
+  # line-number line before each line; the second 'sed' does the real
+  # work.  The second script uses 'N' to pair each line-number line
+  # with the numbered line, and appends trailing '-' during
+  # substitution so that $LINENO is not a special case at line end.
+  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
+  sed '=' <$as_myself |
+    sed '
+      N
+      s,$,-,
+      : loop
+      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+      t loop
+      s,-$,,
+      s,^['$as_cr_digits']*\n,,
+    ' >$as_me.lineno &&
+  chmod +x $as_me.lineno ||
+    { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+   { (exit 1); exit 1; }; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensible to this).
+  . ./$as_me.lineno
+  # Exit status is that of the last command.
+  exit
+}
+
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+  *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T='	' ;;
+  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+  # We could just check for DJGPP; but this test a) works b) is more generic
+  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+  if test -f conf$$.exe; then
+    # Don't use ln at all; we don't have any links
+    as_ln_s='cp -p'
+  else
+    as_ln_s='ln -s'
+  fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s=ln
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+as_executable_p="test -f"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" 	$as_nl"
+
+# CDPATH.
+$as_unset CDPATH
+
+
+# Name of the host.
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+exec 6>&1
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_config_libobj_dir=.
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Maximum number of lines to put in a shell here document.
+# This variable seems obsolete.  It should probably be removed, and
+# only ac_max_sed_lines should be used.
+: ${ac_max_here_lines=38}
+
+# Identity of this package.
+PACKAGE_NAME='WMBiff'
+PACKAGE_TARNAME='wmbiff'
+PACKAGE_VERSION='0.4.26'
+PACKAGE_STRING='WMBiff 0.4.26'
+PACKAGE_BUGREPORT='wmbiff-devel at lists.sourceforge.net'
+
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#if STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# if HAVE_STDLIB_H
+#  include <stdlib.h>
+# endif
+#endif
+#if HAVE_STRING_H
+# if !STDC_HEADERS && HAVE_MEMORY_H
+#  include <memory.h>
+# endif
+# include <string.h>
+#endif
+#if HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#if HAVE_INTTYPES_H
+# include <inttypes.h>
+#else
+# if HAVE_STDINT_H
+#  include <stdint.h>
+# endif
+#endif
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STR [...]
+ac_subst_files=''
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+ac_prev=
+for ac_option
+do
+  # If the previous option needs an argument, assign it.
+  if test -n "$ac_prev"; then
+    eval "$ac_prev=\$ac_option"
+    ac_prev=
+    continue
+  fi
+
+  ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case $ac_option in
+
+  -bindir | --bindir | --bindi | --bind | --bin | --bi)
+    ac_prev=bindir ;;
+  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+    bindir=$ac_optarg ;;
+
+  -build | --build | --buil | --bui | --bu)
+    ac_prev=build_alias ;;
+  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+    build_alias=$ac_optarg ;;
+
+  -cache-file | --cache-file | --cache-fil | --cache-fi \
+  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+    ac_prev=cache_file ;;
+  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+    cache_file=$ac_optarg ;;
+
+  --config-cache | -C)
+    cache_file=config.cache ;;
+
+  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+  | --da=*)
+    datadir=$ac_optarg ;;
+
+  -disable-* | --disable-*)
+    ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+   { (exit 1); exit 1; }; }
+    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+    eval "enable_$ac_feature=no" ;;
+
+  -enable-* | --enable-*)
+    ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+   { (exit 1); exit 1; }; }
+    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+    case $ac_option in
+      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+      *) ac_optarg=yes ;;
+    esac
+    eval "enable_$ac_feature='$ac_optarg'" ;;
+
+  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+  | --exec | --exe | --ex)
+    ac_prev=exec_prefix ;;
+  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+  | --exec=* | --exe=* | --ex=*)
+    exec_prefix=$ac_optarg ;;
+
+  -gas | --gas | --ga | --g)
+    # Obsolete; use --with-gas.
+    with_gas=yes ;;
+
+  -help | --help | --hel | --he | -h)
+    ac_init_help=long ;;
+  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+    ac_init_help=recursive ;;
+  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+    ac_init_help=short ;;
+
+  -host | --host | --hos | --ho)
+    ac_prev=host_alias ;;
+  -host=* | --host=* | --hos=* | --ho=*)
+    host_alias=$ac_optarg ;;
+
+  -includedir | --includedir | --includedi | --included | --include \
+  | --includ | --inclu | --incl | --inc)
+    ac_prev=includedir ;;
+  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+  | --includ=* | --inclu=* | --incl=* | --inc=*)
+    includedir=$ac_optarg ;;
+
+  -infodir | --infodir | --infodi | --infod | --info | --inf)
+    ac_prev=infodir ;;
+  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+    infodir=$ac_optarg ;;
+
+  -libdir | --libdir | --libdi | --libd)
+    ac_prev=libdir ;;
+  -libdir=* | --libdir=* | --libdi=* | --libd=*)
+    libdir=$ac_optarg ;;
+
+  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+  | --libexe | --libex | --libe)
+    ac_prev=libexecdir ;;
+  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+  | --libexe=* | --libex=* | --libe=*)
+    libexecdir=$ac_optarg ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst \
+  | --locals | --local | --loca | --loc | --lo)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+    localstatedir=$ac_optarg ;;
+
+  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+    ac_prev=mandir ;;
+  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+    mandir=$ac_optarg ;;
+
+  -nfp | --nfp | --nf)
+    # Obsolete; use --without-fp.
+    with_fp=no ;;
+
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c | -n)
+    no_create=yes ;;
+
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+    no_recursion=yes ;;
+
+  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+  | --oldin | --oldi | --old | --ol | --o)
+    ac_prev=oldincludedir ;;
+  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+    oldincludedir=$ac_optarg ;;
+
+  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+    ac_prev=prefix ;;
+  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+    prefix=$ac_optarg ;;
+
+  -program-prefix | --program-prefix | --program-prefi | --program-pref \
+  | --program-pre | --program-pr | --program-p)
+    ac_prev=program_prefix ;;
+  -program-prefix=* | --program-prefix=* | --program-prefi=* \
+  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+    program_prefix=$ac_optarg ;;
+
+  -program-suffix | --program-suffix | --program-suffi | --program-suff \
+  | --program-suf | --program-su | --program-s)
+    ac_prev=program_suffix ;;
+  -program-suffix=* | --program-suffix=* | --program-suffi=* \
+  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+    program_suffix=$ac_optarg ;;
+
+  -program-transform-name | --program-transform-name \
+  | --program-transform-nam | --program-transform-na \
+  | --program-transform-n | --program-transform- \
+  | --program-transform | --program-transfor \
+  | --program-transfo | --program-transf \
+  | --program-trans | --program-tran \
+  | --progr-tra | --program-tr | --program-t)
+    ac_prev=program_transform_name ;;
+  -program-transform-name=* | --program-transform-name=* \
+  | --program-transform-nam=* | --program-transform-na=* \
+  | --program-transform-n=* | --program-transform-=* \
+  | --program-transform=* | --program-transfor=* \
+  | --program-transfo=* | --program-transf=* \
+  | --program-trans=* | --program-tran=* \
+  | --progr-tra=* | --program-tr=* | --program-t=*)
+    program_transform_name=$ac_optarg ;;
+
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil)
+    silent=yes ;;
+
+  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+    ac_prev=sbindir ;;
+  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+  | --sbi=* | --sb=*)
+    sbindir=$ac_optarg ;;
+
+  -sharedstatedir | --sharedstatedir | --sharedstatedi \
+  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+  | --sharedst | --shareds | --shared | --share | --shar \
+  | --sha | --sh)
+    ac_prev=sharedstatedir ;;
+  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+  | --sha=* | --sh=*)
+    sharedstatedir=$ac_optarg ;;
+
+  -site | --site | --sit)
+    ac_prev=site ;;
+  -site=* | --site=* | --sit=*)
+    site=$ac_optarg ;;
+
+  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+    ac_prev=srcdir ;;
+  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+    srcdir=$ac_optarg ;;
+
+  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+  | --syscon | --sysco | --sysc | --sys | --sy)
+    ac_prev=sysconfdir ;;
+  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+    sysconfdir=$ac_optarg ;;
+
+  -target | --target | --targe | --targ | --tar | --ta | --t)
+    ac_prev=target_alias ;;
+  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+    target_alias=$ac_optarg ;;
+
+  -v | -verbose | --verbose | --verbos | --verbo | --verb)
+    verbose=yes ;;
+
+  -version | --version | --versio | --versi | --vers | -V)
+    ac_init_version=: ;;
+
+  -with-* | --with-*)
+    ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid package name: $ac_package" >&2
+   { (exit 1); exit 1; }; }
+    ac_package=`echo $ac_package| sed 's/-/_/g'`
+    case $ac_option in
+      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+      *) ac_optarg=yes ;;
+    esac
+    eval "with_$ac_package='$ac_optarg'" ;;
+
+  -without-* | --without-*)
+    ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid package name: $ac_package" >&2
+   { (exit 1); exit 1; }; }
+    ac_package=`echo $ac_package | sed 's/-/_/g'`
+    eval "with_$ac_package=no" ;;
+
+  --x)
+    # Obsolete; use --with-x.
+    with_x=yes ;;
+
+  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+  | --x-incl | --x-inc | --x-in | --x-i)
+    ac_prev=x_includes ;;
+  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+    x_includes=$ac_optarg ;;
+
+  -x-libraries | --x-libraries | --x-librarie | --x-librari \
+  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+    ac_prev=x_libraries ;;
+  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+    x_libraries=$ac_optarg ;;
+
+  -*) { echo "$as_me: error: unrecognized option: $ac_option
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; }
+    ;;
+
+  *=*)
+    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+   { (exit 1); exit 1; }; }
+    ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
+    eval "$ac_envvar='$ac_optarg'"
+    export $ac_envvar ;;
+
+  *)
+    # FIXME: should be removed in autoconf 3.0.
+    echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+    ;;
+
+  esac
+done
+
+if test -n "$ac_prev"; then
+  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+  { echo "$as_me: error: missing argument to $ac_option" >&2
+   { (exit 1); exit 1; }; }
+fi
+
+# Be sure to have absolute paths.
+for ac_var in exec_prefix prefix
+do
+  eval ac_val=$`echo $ac_var`
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
+    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; };;
+  esac
+done
+
+# Be sure to have absolute paths.
+for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
+	      localstatedir libdir includedir oldincludedir infodir mandir
+do
+  eval ac_val=$`echo $ac_var`
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* ) ;;
+    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; };;
+  esac
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+  if test "x$build_alias" = x; then
+    cross_compiling=maybe
+    echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+    If a cross compiler is detected then cross compile mode will be used." >&2
+  elif test "x$build_alias" != "x$host_alias"; then
+    cross_compiling=yes
+  fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+  ac_srcdir_defaulted=yes
+  # Try the directory containing this script, then its parent.
+  ac_confdir=`(dirname "$0") 2>/dev/null ||
+$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$0" : 'X\(//\)[^/]' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$0" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+  srcdir=$ac_confdir
+  if test ! -r $srcdir/$ac_unique_file; then
+    srcdir=..
+  fi
+else
+  ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+  if test "$ac_srcdir_defaulted" = yes; then
+    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
+   { (exit 1); exit 1; }; }
+  else
+    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+   { (exit 1); exit 1; }; }
+  fi
+fi
+(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
+  { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
+   { (exit 1); exit 1; }; }
+srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
+ac_env_build_alias_set=${build_alias+set}
+ac_env_build_alias_value=$build_alias
+ac_cv_env_build_alias_set=${build_alias+set}
+ac_cv_env_build_alias_value=$build_alias
+ac_env_host_alias_set=${host_alias+set}
+ac_env_host_alias_value=$host_alias
+ac_cv_env_host_alias_set=${host_alias+set}
+ac_cv_env_host_alias_value=$host_alias
+ac_env_target_alias_set=${target_alias+set}
+ac_env_target_alias_value=$target_alias
+ac_cv_env_target_alias_set=${target_alias+set}
+ac_cv_env_target_alias_value=$target_alias
+ac_env_CC_set=${CC+set}
+ac_env_CC_value=$CC
+ac_cv_env_CC_set=${CC+set}
+ac_cv_env_CC_value=$CC
+ac_env_CFLAGS_set=${CFLAGS+set}
+ac_env_CFLAGS_value=$CFLAGS
+ac_cv_env_CFLAGS_set=${CFLAGS+set}
+ac_cv_env_CFLAGS_value=$CFLAGS
+ac_env_LDFLAGS_set=${LDFLAGS+set}
+ac_env_LDFLAGS_value=$LDFLAGS
+ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
+ac_cv_env_LDFLAGS_value=$LDFLAGS
+ac_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_env_CPPFLAGS_value=$CPPFLAGS
+ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_cv_env_CPPFLAGS_value=$CPPFLAGS
+ac_env_CPP_set=${CPP+set}
+ac_env_CPP_value=$CPP
+ac_cv_env_CPP_set=${CPP+set}
+ac_cv_env_CPP_value=$CPP
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+  # Omit some internal or obsolete options to make the list less imposing.
+  # This message is too long to be a string in the A/UX 3.1 sh.
+  cat <<_ACEOF
+\`configure' configures WMBiff 0.4.26 to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE.  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=short        display options specific to this package
+      --help=recursive    display the short help of all the included packages
+  -V, --version           display version information and exit
+  -q, --quiet, --silent   do not print \`checking...' messages
+      --cache-file=FILE   cache test results in FILE [disabled]
+  -C, --config-cache      alias for \`--cache-file=config.cache'
+  -n, --no-create         do not create output files
+      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
+
+_ACEOF
+
+  cat <<_ACEOF
+Installation directories:
+  --prefix=PREFIX         install architecture-independent files in PREFIX
+			  [$ac_default_prefix]
+  --exec-prefix=EPREFIX   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=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+  --bindir=DIR           user executables [EPREFIX/bin]
+  --sbindir=DIR          system admin executables [EPREFIX/sbin]
+  --libexecdir=DIR       program executables [EPREFIX/libexec]
+  --datadir=DIR          read-only architecture-independent data [PREFIX/share]
+  --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
+  --sharedstatedir=DIR   modifiable architecture-independent data [PREFIX/com]
+  --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
+  --libdir=DIR           object code libraries [EPREFIX/lib]
+  --includedir=DIR       C header files [PREFIX/include]
+  --oldincludedir=DIR    C header files for non-gcc [/usr/include]
+  --infodir=DIR          info documentation [PREFIX/info]
+  --mandir=DIR           man documentation [PREFIX/man]
+_ACEOF
+
+  cat <<\_ACEOF
+
+Program names:
+  --program-prefix=PREFIX            prepend PREFIX to installed program names
+  --program-suffix=SUFFIX            append SUFFIX to installed program names
+  --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
+
+X features:
+  --x-includes=DIR    X include files are in DIR
+  --x-libraries=DIR   X library files are in DIR
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+  case $ac_init_help in
+     short | recursive ) echo "Configuration of WMBiff 0.4.26:";;
+   esac
+  cat <<\_ACEOF
+
+Optional Features:
+  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
+  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+  --disable-dependency-tracking Speeds up one-time builds
+  --enable-dependency-tracking  Do not reject slow dependency extractors
+   --disable-crypto       disable gnutls/gcrypt
+  --disable-libgcrypttest    Do not try to compile and run a test libgcrypt program
+
+Optional Packages:
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --with-libgnutls-prefix=PFX   Prefix where libgnutls is installed (optional)
+  --with-libgcrypt-prefix=PFX   Prefix where libgcrypt is installed (optional)
+  --with-x                use the X Window System
+
+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.
+
+Report bugs to <wmbiff-devel at lists.sourceforge.net>.
+_ACEOF
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  ac_popdir=`pwd`
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d $ac_dir || continue
+    ac_builddir=.
+
+if test "$ac_dir" != .; then
+  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  # A "../" for each directory in $ac_dir_suffix.
+  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+  ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+  .)  # No --srcdir option.  We are building in place.
+    ac_srcdir=.
+    if test -z "$ac_top_builddir"; then
+       ac_top_srcdir=.
+    else
+       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+    fi ;;
+  [\\/]* | ?:[\\/]* )  # Absolute path.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir ;;
+  *) # Relative path.
+    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+  case "$ac_dir" in
+  .) ac_abs_builddir=`pwd`;;
+  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+  *) ac_abs_builddir=`pwd`/"$ac_dir";;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+  case ${ac_top_builddir}. in
+  .) ac_abs_top_builddir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+  case $ac_srcdir in
+  .) ac_abs_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+  case $ac_top_srcdir in
+  .) ac_abs_top_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+  esac;;
+esac
+
+    cd $ac_dir
+    # Check for guested configure; otherwise get Cygnus style configure.
+    if test -f $ac_srcdir/configure.gnu; then
+      echo
+      $SHELL $ac_srcdir/configure.gnu  --help=recursive
+    elif test -f $ac_srcdir/configure; then
+      echo
+      $SHELL $ac_srcdir/configure  --help=recursive
+    elif test -f $ac_srcdir/configure.ac ||
+	   test -f $ac_srcdir/configure.in; then
+      echo
+      $ac_configure --help
+    else
+      echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi
+    cd "$ac_popdir"
+  done
+fi
+
+test -n "$ac_init_help" && exit 0
+if $ac_init_version; then
+  cat <<\_ACEOF
+WMBiff configure 0.4.26
+generated by GNU Autoconf 2.59
+
+Copyright (C) 2003 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+  exit 0
+fi
+exec 5>config.log
+cat >&5 <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by WMBiff $as_me 0.4.26, which was
+generated by GNU Autoconf 2.59.  Invocation command line was
+
+  $ $0 $@
+
+_ACEOF
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
+
+/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
+/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
+/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  echo "PATH: $as_dir"
+done
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_sep=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+  for ac_arg
+  do
+    case $ac_arg in
+    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+    | -silent | --silent | --silen | --sile | --sil)
+      continue ;;
+    *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+      ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    case $ac_pass in
+    1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+    2)
+      ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+      if test $ac_must_keep_next = true; then
+	ac_must_keep_next=false # Got value, back to normal.
+      else
+	case $ac_arg in
+	  *=* | --config-cache | -C | -disable-* | --disable-* \
+	  | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+	  | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+	  | -with-* | --with-* | -without-* | --without-* | --x)
+	    case "$ac_configure_args0 " in
+	      "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+	    esac
+	    ;;
+	  -* ) ac_must_keep_next=true ;;
+	esac
+      fi
+      ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
+      # Get rid of the leading space.
+      ac_sep=" "
+      ;;
+    esac
+  done
+done
+$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
+$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
+
+# 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.
+# WARNING: Be sure not to use single quotes in there, as some shells,
+# such as our DU 5.0 friend, will then `close' the trap.
+trap 'exit_status=$?
+  # Save into config.log some information that might help in debugging.
+  {
+    echo
+
+    cat <<\_ASBOX
+## ---------------- ##
+## Cache variables. ##
+## ---------------- ##
+_ASBOX
+    echo
+    # The following way of writing the cache mishandles newlines in values,
+{
+  (set) 2>&1 |
+    case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
+    *ac_space=\ *)
+      sed -n \
+	"s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
+      ;;
+    *)
+      sed -n \
+	"s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+      ;;
+    esac;
+}
+    echo
+
+    cat <<\_ASBOX
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+_ASBOX
+    echo
+    for ac_var in $ac_subst_vars
+    do
+      eval ac_val=$`echo $ac_var`
+      echo "$ac_var='"'"'$ac_val'"'"'"
+    done | sort
+    echo
+
+    if test -n "$ac_subst_files"; then
+      cat <<\_ASBOX
+## ------------- ##
+## Output files. ##
+## ------------- ##
+_ASBOX
+      echo
+      for ac_var in $ac_subst_files
+      do
+	eval ac_val=$`echo $ac_var`
+	echo "$ac_var='"'"'$ac_val'"'"'"
+      done | sort
+      echo
+    fi
+
+    if test -s confdefs.h; then
+      cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+      echo
+      sed "/^$/d" confdefs.h | sort
+      echo
+    fi
+    test "$ac_signal" != 0 &&
+      echo "$as_me: caught signal $ac_signal"
+    echo "$as_me: exit $exit_status"
+  } >&5
+  rm -f core *.core &&
+  rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
+    exit $exit_status
+     ' 0
+for ac_signal in 1 2 13 15; do
+  trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo >confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+  if test "x$prefix" != xNONE; then
+    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+  else
+    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+  fi
+fi
+for ac_site_file in $CONFIG_SITE; do
+  if test -r "$ac_site_file"; then
+    { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+echo "$as_me: loading site script $ac_site_file" >&6;}
+    sed 's/^/| /' "$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:$LINENO: 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:$LINENO: creating cache $cache_file" >&5
+echo "$as_me: creating cache $cache_file" >&6;}
+  >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in `(set) 2>&1 |
+	       sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
+  eval ac_old_set=\$ac_cv_env_${ac_var}_set
+  eval ac_new_set=\$ac_env_${ac_var}_set
+  eval ac_old_val="\$ac_cv_env_${ac_var}_value"
+  eval ac_new_val="\$ac_env_${ac_var}_value"
+  case $ac_old_set,$ac_new_set in
+    set,)
+      { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,set)
+      { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,);;
+    *)
+      if test "x$ac_old_val" != "x$ac_new_val"; then
+	{ echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+	{ echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
+echo "$as_me:   former value:  $ac_old_val" >&2;}
+	{ echo "$as_me:$LINENO:   current value: $ac_new_val" >&5
+echo "$as_me:   current value: $ac_new_val" >&2;}
+	ac_cache_corrupted=:
+      fi;;
+  esac
+  # Pass precious variables to config.status.
+  if test "$ac_new_set" = set; then
+    case $ac_new_val in
+    *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+      ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+    *) ac_arg=$ac_var=$ac_new_val ;;
+    esac
+    case " $ac_configure_args " in
+      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
+      *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+    esac
+  fi
+done
+if $ac_cache_corrupted; then
+  { echo "$as_me:$LINENO: 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:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ac_aux_dir=
+for ac_dir in autoconf $srcdir/autoconf; do
+  if test -f $ac_dir/install-sh; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install-sh -c"
+    break
+  elif test -f $ac_dir/install.sh; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install.sh -c"
+    break
+  elif test -f $ac_dir/shtool; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/shtool install -c"
+    break
+  fi
+done
+if test -z "$ac_aux_dir"; then
+  { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in autoconf $srcdir/autoconf" >&5
+echo "$as_me: error: cannot find install-sh or install.sh in autoconf $srcdir/autoconf" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"
+ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
+
+am__api_version="1.7"
+# 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"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+  ./ | .// | /cC/* | \
+  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+  ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+  /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
+      for ac_exec_ext in '' $ac_executable_extensions; do
+	if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+	  if test $ac_prog = install &&
+	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # AIX install.  It has an incompatible calling convention.
+	    :
+	  elif test $ac_prog = install &&
+	    grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # program-specific install script used by HP pwplus--don't use.
+	    :
+	  else
+	    ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+	    break 3
+	  fi
+	fi
+      done
+    done
+    ;;
+esac
+done
+
+
+fi
+  if test "${ac_cv_path_install+set}" = set; then
+    INSTALL=$ac_cv_path_install
+  else
+    # As a last resort, use the slow shell script.  We don't cache a
+    # path for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the path is relative.
+    INSTALL=$ac_install_sh
+  fi
+fi
+echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+echo "$as_me:$LINENO: checking whether build environment is sane" >&5
+echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments.  Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+   if test "$*" = "X"; then
+      # -L didn't work.
+      set X `ls -t $srcdir/configure conftest.file`
+   fi
+   rm -f conftest.file
+   if test "$*" != "X $srcdir/configure conftest.file" \
+      && test "$*" != "X conftest.file $srcdir/configure"; then
+
+      # If neither matched, then we have a broken ls.  This can happen
+      # if, for instance, CONFIG_SHELL is bash and it inherits a
+      # broken ls alias from the environment.  This has actually
+      # happened.  Such a system could not be considered "sane".
+      { { echo "$as_me:$LINENO: error: ls -t appears to fail.  Make sure there is not a broken
+alias in your environment" >&5
+echo "$as_me: error: ls -t appears to fail.  Make sure there is not a broken
+alias in your environment" >&2;}
+   { (exit 1); exit 1; }; }
+   fi
+
+   test "$2" = conftest.file
+   )
+then
+   # Ok.
+   :
+else
+   { { echo "$as_me:$LINENO: error: newly created file is older than distributed files!
+Check your system clock" >&5
+echo "$as_me: error: newly created file is older than distributed files!
+Check your system clock" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+test "$program_prefix" != NONE &&
+  program_transform_name="s,^,$program_prefix,;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+  program_transform_name="s,\$,$program_suffix,;$program_transform_name"
+# Double any \ or $.  echo might interpret backslashes.
+# By default was `s,x,x', remove it if useless.
+cat <<\_ACEOF >conftest.sed
+s/[\\$]/&&/g;s/;s,x,x,$//
+_ACEOF
+program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
+rm conftest.sed
+
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+  am_missing_run="$MISSING --run "
+else
+  am_missing_run=
+  { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
+echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
+
+for ac_prog in gawk mawk nawk awk
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_AWK+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$AWK"; then
+  ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_AWK="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+  echo "$as_me:$LINENO: result: $AWK" >&5
+echo "${ECHO_T}$AWK" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  test -n "$AWK" && break
+done
+
+echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'`
+if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.make <<\_ACEOF
+all:
+	@echo 'ac_maketemp="$(MAKE)"'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
+if test -n "$ac_maketemp"; then
+  eval ac_cv_prog_make_${ac_make}_set=yes
+else
+  eval ac_cv_prog_make_${ac_make}_set=no
+fi
+rm -f conftest.make
+fi
+if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
+  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+  SET_MAKE=
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+  SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+  am__leading_dot=.
+else
+  am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+
+ # test to see if srcdir already configured
+if test "`cd $srcdir && pwd`" != "`pwd`" &&
+   test -f $srcdir/config.status; then
+  { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
+echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+  if (cygpath --version) >/dev/null 2>/dev/null; then
+    CYGPATH_W='cygpath -w'
+  else
+    CYGPATH_W=echo
+  fi
+fi
+
+
+# Define the identity of the package.
+ PACKAGE=wmbiff
+ VERSION=0.4.26
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE "$PACKAGE"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define VERSION "$VERSION"
+_ACEOF
+
+# Some tools Automake needs.
+
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
+
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+
+
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+
+
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
+
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+
+AMTAR=${AMTAR-"${am_missing_run}tar"}
+
+install_sh=${install_sh-"$am_aux_dir/install-sh"}
+
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'.  However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_STRIP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  echo "$as_me:$LINENO: result: $STRIP" >&5
+echo "${ECHO_T}$STRIP" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+  ac_ct_STRIP=$STRIP
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_STRIP"; then
+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":"
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+echo "${ECHO_T}$ac_ct_STRIP" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  STRIP=$ac_ct_STRIP
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
+
+# We need awk for the "check" target.  The system "awk" is bad on
+# some platforms.
+
+
+           ac_config_headers="$ac_config_headers config.h"
+
+
+
+
+
+# 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"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+  ./ | .// | /cC/* | \
+  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+  ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+  /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
+      for ac_exec_ext in '' $ac_executable_extensions; do
+	if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+	  if test $ac_prog = install &&
+	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # AIX install.  It has an incompatible calling convention.
+	    :
+	  elif test $ac_prog = install &&
+	    grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # program-specific install script used by HP pwplus--don't use.
+	    :
+	  else
+	    ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+	    break 3
+	  fi
+	fi
+      done
+    done
+    ;;
+esac
+done
+
+
+fi
+  if test "${ac_cv_path_install+set}" = set; then
+    INSTALL=$ac_cv_path_install
+  else
+    # As a last resort, use the slow shell script.  We don't cache a
+    # path for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the path is relative.
+    INSTALL=$ac_install_sh
+  fi
+fi
+echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CC="gcc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  CC=$ac_ct_CC
+else
+  CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CC="${ac_tool_prefix}cc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CC="cc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  CC=$ac_ct_CC
+else
+  CC="$ac_cv_prog_CC"
+fi
+
+fi
+if test -z "$CC"; then
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+       ac_prog_rejected=yes
+       continue
+     fi
+    ac_cv_prog_CC="cc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+if test $ac_prog_rejected = yes; then
+  # We found a bogon in the path, so make sure we never use it.
+  set dummy $ac_cv_prog_CC
+  shift
+  if test $# != 0; then
+    # We chose a different compiler from the bogus one.
+    # However, it has the same basename, so the bogon will be chosen
+    # first if we set CC to just the basename; use the full file name.
+    shift
+    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+  fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CC="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  test -n "$ac_ct_CC" && break
+done
+
+  CC=$ac_ct_CC
+fi
+
+fi
+
+
+test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+echo "$as_me: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+
+# Provide some information about the compiler.
+echo "$as_me:$LINENO:" \
+     "checking for C compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
+  (eval $ac_compiler --version </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
+  (eval $ac_compiler -v </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
+  (eval $ac_compiler -V </dev/null >&5) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.exe b.out"
+# 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:$LINENO: checking for C compiler default output file name" >&5
+echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6
+ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
+  (eval $ac_link_default) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $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.
+
+# Be careful to initialize this variable, since it used to be cached.
+# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
+ac_cv_exeext=
+# b.out is created by i960 compilers.
+for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
+do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
+	;;
+    conftest.$ac_ext )
+	# This is the source file.
+	;;
+    [ab].out )
+	# We found the default executable, but exeext='' is most
+	# certainly right.
+	break;;
+    *.* )
+	ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	# FIXME: I believe we export ac_cv_exeext for Libtool,
+	# but it would be cool to find out if it's true.  Does anybody
+	# maintain Libtool? --akim.
+	export ac_cv_exeext
+	break;;
+    * )
+	break;;
+  esac
+done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
+See \`config.log' for more details." >&5
+echo "$as_me: error: C compiler cannot create executables
+See \`config.log' for more details." >&2;}
+   { (exit 77); exit 77; }; }
+fi
+
+ac_exeext=$ac_cv_exeext
+echo "$as_me:$LINENO: 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:$LINENO: checking whether the C compiler works" >&5
+echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
+# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+# If not cross compiling, check that we can run a simple program.
+if test "$cross_compiling" != yes; then
+  if { ac_try='./$ac_file'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+    cross_compiling=no
+  else
+    if test "$cross_compiling" = maybe; then
+	cross_compiling=yes
+    else
+	{ { echo "$as_me:$LINENO: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+  fi
+fi
+echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+rm -f a.out a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+# Check the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
+echo "$as_me:$LINENO: result: $cross_compiling" >&5
+echo "${ECHO_T}$cross_compiling" >&6
+
+echo "$as_me:$LINENO: checking for suffix of executables" >&5
+echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $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 conftest.exe conftest conftest.*; do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	  export ac_cv_exeext
+	  break;;
+    * ) break;;
+  esac
+done
+else
+  { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest$ac_cv_exeext
+echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+echo "${ECHO_T}$ac_cv_exeext" >&6
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+echo "$as_me:$LINENO: checking for suffix of object files" >&5
+echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
+if test "${ac_cv_objext+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $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 | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
+    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+       break;;
+  esac
+done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+echo "${ECHO_T}$ac_cv_objext" >&6
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_compiler_gnu=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_compiler_gnu=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
+GCC=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+CFLAGS="-g"
+echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_g+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_prog_cc_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_prog_cc_g=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-g"
+  fi
+else
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
+fi
+echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
+echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_stdc+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_prog_cc_stdc=no
+ac_save_CC=$CC
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end 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 = g (p, va_arg (v,int));
+  va_end (v);
+  return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
+   function prototypes and stuff, but not '\xHH' hex character constants.
+   These don't provoke an error unfortunately, instead are silently treated
+   as 'x'.  The following induces an error, until -std1 is added to get
+   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
+   array size at least.  It's necessary to write '\x00'==0 to get something
+   that's true only with -std1.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
+  ;
+  return 0;
+}
+_ACEOF
+# Don't try gcc -ansi; that turns off useful extensions and
+# breaks some systems' header files.
+# AIX			-qlanglvl=ansi
+# Ultrix and OSF/1	-std1
+# HP-UX 10.20 and later	-Ae
+# HP-UX older versions	-Aa -D_HPUX_SOURCE
+# SVR4			-Xc -D__EXTENSIONS__
+for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_prog_cc_stdc=$ac_arg
+break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext
+done
+rm -f conftest.$ac_ext conftest.$ac_objext
+CC=$ac_save_CC
+
+fi
+
+case "x$ac_cv_prog_cc_stdc" in
+  x|xno)
+    echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6 ;;
+  *)
+    echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
+    CC="$CC $ac_cv_prog_cc_stdc" ;;
+esac
+
+# 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:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  for ac_declaration in \
+   '' \
+   '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
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_declaration
+#include <stdlib.h>
+int
+main ()
+{
+exit (42);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+continue
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_declaration
+int
+main ()
+{
+exit (42);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+rm -f 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
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+DEPDIR="${am__leading_dot}deps"
+
+          ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+	@echo done
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
+echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
+   am__include=include
+   am__quote=
+   _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+      am__include=.include
+      am__quote="\""
+      _am_result=BSD
+   fi
+fi
+
+
+echo "$as_me:$LINENO: result: $_am_result" >&5
+echo "${ECHO_T}$_am_result" >&6
+rm -f confinc confmf
+
+# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then
+  enableval="$enable_dependency_tracking"
+
+fi;
+if test "x$enable_dependency_tracking" != xno; then
+  am_depcomp="$ac_aux_dir/depcomp"
+  AMDEPBACKSLASH='\'
+fi
+
+
+if test "x$enable_dependency_tracking" != xno; then
+  AMDEP_TRUE=
+  AMDEP_FALSE='#'
+else
+  AMDEP_TRUE='#'
+  AMDEP_FALSE=
+fi
+
+
+
+
+depcc="$CC"   am_compiler_list=
+
+echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6
+if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_CC_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+  fi
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      : > sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    case $depmode in
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+	continue
+      else
+	break
+      fi
+      ;;
+    none) break ;;
+    esac
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.
+    if depmode=$depmode \
+       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored.
+      if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else
+        am_cv_CC_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
+echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+
+
+if
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+  am__fastdepCC_TRUE=
+  am__fastdepCC_FALSE='#'
+else
+  am__fastdepCC_TRUE='#'
+  am__fastdepCC_FALSE=
+fi
+
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_RANLIB+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+  echo "$as_me:$LINENO: result: $RANLIB" >&5
+echo "${ECHO_T}$RANLIB" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+  ac_ct_RANLIB=$RANLIB
+  # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_RANLIB"; then
+  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_RANLIB="ranlib"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":"
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+  echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
+echo "${ECHO_T}$ac_ct_RANLIB" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  RANLIB=$ac_ct_RANLIB
+else
+  RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+
+if test -n "$GCC"; then
+ CFLAGS="$CFLAGS -D_GNU_SOURCE -W -Wall -Wshadow -Wpointer-arith -Wwrite-strings"
+ echo "$as_me:$LINENO: result: adding -Wall and friends to CFLAGS." >&5
+echo "${ECHO_T}adding -Wall and friends to CFLAGS." >&6
+fi
+
+case `(uname -s) 2>/dev/null` in
+    "Darwin")
+       CFLAGS="$CFLAGS -no-cpp-precomp"
+       echo "$as_me:$LINENO: result: adding cpp precompiler workaround for Mac OS X" >&5
+echo "${ECHO_T}adding cpp precompiler workaround for Mac OS X" >&6
+       LDFLAGS="$LDFLAGS -framework Security"
+       echo "$as_me:$LINENO: result: adding -framework Security for Mac OS X" >&5
+echo "${ECHO_T}adding -framework Security for Mac OS X" >&6
+     ;;
+esac
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+  if test "${ac_cv_prog_CPP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+      # Double quotes because CPP needs to be expanded
+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # 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
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' 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
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  # Broken: success on invalid input.
+continue
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  break
+fi
+
+    done
+    ac_cv_prog_CPP=$CPP
+
+fi
+  CPP=$ac_cv_prog_CPP
+else
+  ac_cv_prog_CPP=$CPP
+fi
+echo "$as_me:$LINENO: result: $CPP" >&5
+echo "${ECHO_T}$CPP" >&6
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # 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
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' 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
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  # Broken: success on invalid input.
+continue
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  :
+else
+  { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&5
+echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+echo "$as_me:$LINENO: checking for egrep" >&5
+echo $ECHO_N "checking for egrep... $ECHO_C" >&6
+if test "${ac_cv_prog_egrep+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if echo a | (grep -E '(a|b)') >/dev/null 2>&1
+    then ac_cv_prog_egrep='grep -E'
+    else ac_cv_prog_egrep='egrep'
+    fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
+echo "${ECHO_T}$ac_cv_prog_egrep" >&6
+ EGREP=$ac_cv_prog_egrep
+
+
+echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
+if test "${ac_cv_header_stdc+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_header_stdc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_header_stdc=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "memchr" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "free" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+  if test "$cross_compiling" = yes; then
+  :
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ctype.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+		   (('a' <= (c) && (c) <= 'i') \
+		     || ('j' <= (c) && (c) <= 'r') \
+		     || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+	|| toupper (i) != TOUPPER (i))
+      exit(2);
+  exit (0);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_header_stdc=no
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6
+if test $ac_cv_header_stdc = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STDC_HEADERS 1
+_ACEOF
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+
+
+
+
+
+
+
+
+
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+		  inttypes.h stdint.h unistd.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_Header=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_Header=no"
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+for ac_header in stdio.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------------------- ##
+## Report this to wmbiff-devel at lists.sourceforge.net ##
+## ------------------------------------------------- ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+for ac_func in getaddrinfo
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* 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 ();
+/* 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
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != $ac_func;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+
+for ac_func in memfrob
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* 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 ();
+/* 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
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != $ac_func;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+
+
+for ac_func in poll
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* 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 ();
+/* 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
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != $ac_func;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+
+for ac_func in inet_ntop
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* 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 ();
+/* 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
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != $ac_func;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+echo "$as_me:$LINENO: checking return type of signal handlers" >&5
+echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6
+if test "${ac_cv_type_signal+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/types.h>
+#include <signal.h>
+#ifdef signal
+# undef signal
+#endif
+#ifdef __cplusplus
+extern "C" void (*signal (int, void (*)(int)))(int);
+#else
+void (*signal ()) ();
+#endif
+
+int
+main ()
+{
+int i;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_type_signal=void
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_signal=int
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5
+echo "${ECHO_T}$ac_cv_type_signal" >&6
+
+cat >>confdefs.h <<_ACEOF
+#define RETSIGTYPE $ac_cv_type_signal
+_ACEOF
+
+
+
+
+echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5
+echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
+if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lnsl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end 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 gethostbyname ();
+int
+main ()
+{
+gethostbyname ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_nsl_gethostbyname=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_nsl_gethostbyname=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5
+echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
+if test $ac_cv_lib_nsl_gethostbyname = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBNSL 1
+_ACEOF
+
+  LIBS="-lnsl $LIBS"
+
+fi
+
+
+echo "$as_me:$LINENO: checking for connect in -lsocket" >&5
+echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
+if test "${ac_cv_lib_socket_connect+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsocket  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end 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 connect ();
+int
+main ()
+{
+connect ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_socket_connect=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_socket_connect=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_socket_connect" >&5
+echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
+if test $ac_cv_lib_socket_connect = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBSOCKET 1
+_ACEOF
+
+  LIBS="-lsocket $LIBS"
+
+fi
+
+
+echo "$as_me:$LINENO: checking for herror in -lresolv" >&5
+echo $ECHO_N "checking for herror in -lresolv... $ECHO_C" >&6
+if test "${ac_cv_lib_resolv_herror+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lresolv  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end 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 herror ();
+int
+main ()
+{
+herror ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_resolv_herror=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_resolv_herror=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_resolv_herror" >&5
+echo "${ECHO_T}$ac_cv_lib_resolv_herror" >&6
+if test $ac_cv_lib_resolv_herror = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBRESOLV 1
+_ACEOF
+
+  LIBS="-lresolv $LIBS"
+
+fi
+
+
+gnutls="ok"
+gcrypt="ok"
+
+echo "$as_me:$LINENO: checking for gzopen in -lz" >&5
+echo $ECHO_N "checking for gzopen in -lz... $ECHO_C" >&6
+if test "${ac_cv_lib_z_gzopen+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lz  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end 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 gzopen ();
+int
+main ()
+{
+gzopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_z_gzopen=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_z_gzopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_z_gzopen" >&5
+echo "${ECHO_T}$ac_cv_lib_z_gzopen" >&6
+if test $ac_cv_lib_z_gzopen = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBZ 1
+_ACEOF
+
+  LIBS="-lz $LIBS"
+
+else
+  gnutls="nope"
+fi
+
+
+# Check whether --enable-crypto or --disable-crypto was given.
+if test "${enable_crypto+set}" = set; then
+  enableval="$enable_crypto"
+   if test $enableval != yes; then
+                        gnutls="disabled"
+                        gcrypt="disabled"
+                       fi
+fi;
+
+
+GNUTLS_MAN_STATUS="This copy of WMBiff was not compiled with GNUTLS."
+if test "$gnutls" = "ok"; then
+
+# Check whether --with-libgnutls-prefix or --without-libgnutls-prefix was given.
+if test "${with_libgnutls_prefix+set}" = set; then
+  withval="$with_libgnutls_prefix"
+  libgnutls_config_prefix="$withval"
+else
+  libgnutls_config_prefix=""
+fi;
+
+  if test x$libgnutls_config_prefix != x ; then
+     libgnutls_config_args="$libgnutls_config_args --prefix=$libgnutls_config_prefix"
+     if test x${LIBGNUTLS_CONFIG+set} != xset ; then
+        LIBGNUTLS_CONFIG=$libgnutls_config_prefix/bin/libgnutls-config
+     fi
+  fi
+
+  # Extract the first word of "libgnutls-config", so it can be a program name with args.
+set dummy libgnutls-config; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_LIBGNUTLS_CONFIG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $LIBGNUTLS_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_LIBGNUTLS_CONFIG="$LIBGNUTLS_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_LIBGNUTLS_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_path_LIBGNUTLS_CONFIG" && ac_cv_path_LIBGNUTLS_CONFIG="no"
+  ;;
+esac
+fi
+LIBGNUTLS_CONFIG=$ac_cv_path_LIBGNUTLS_CONFIG
+
+if test -n "$LIBGNUTLS_CONFIG"; then
+  echo "$as_me:$LINENO: result: $LIBGNUTLS_CONFIG" >&5
+echo "${ECHO_T}$LIBGNUTLS_CONFIG" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  min_libgnutls_version=1.0.4
+  echo "$as_me:$LINENO: checking for libgnutls - version >= $min_libgnutls_version" >&5
+echo $ECHO_N "checking for libgnutls - version >= $min_libgnutls_version... $ECHO_C" >&6
+  no_libgnutls=""
+  if test "$LIBGNUTLS_CONFIG" = "no" ; then
+    no_libgnutls=yes
+  else
+    LIBGNUTLS_CFLAGS=`$LIBGNUTLS_CONFIG $libgnutls_config_args --cflags`
+    LIBGNUTLS_LIBS=`$LIBGNUTLS_CONFIG $libgnutls_config_args --libs`
+    libgnutls_config_version=`$LIBGNUTLS_CONFIG $libgnutls_config_args --version`
+
+
+      ac_save_CFLAGS="$CFLAGS"
+      ac_save_LIBS="$LIBS"
+      CFLAGS="$CFLAGS $LIBGNUTLS_CFLAGS"
+      LIBS="$LIBS $LIBGNUTLS_LIBS"
+      rm -f conf.libgnutlstest
+      if test "$cross_compiling" = yes; then
+  echo $ac_n "cross compiling; assumed OK... $ac_c"
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <gnutls/gnutls.h>
+
+int
+main ()
+{
+    system ("touch conf.libgnutlstest");
+
+    if( strcmp( gnutls_check_version(NULL), "$libgnutls_config_version" ) )
+    {
+      printf("\n*** 'libgnutls-config --version' returned %s, but LIBGNUTLS (%s)\n",
+             "$libgnutls_config_version", gnutls_check_version(NULL) );
+      printf("*** was found! If libgnutls-config was correct, then it is best\n");
+      printf("*** to remove the old version of LIBGNUTLS. You may also be able to fix the error\n");
+      printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
+      printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
+      printf("*** required on your system.\n");
+      printf("*** If libgnutls-config was wrong, set the environment variable LIBGNUTLS_CONFIG\n");
+      printf("*** to point to the correct copy of libgnutls-config, and remove the file config.cache\n");
+      printf("*** before re-running configure\n");
+    }
+    else if ( strcmp(gnutls_check_version(NULL), LIBGNUTLS_VERSION ) )
+    {
+      printf("\n*** LIBGNUTLS header file (version %s) does not match\n", LIBGNUTLS_VERSION);
+      printf("*** library (version %s)\n", gnutls_check_version(NULL) );
+    }
+    else
+    {
+      if ( gnutls_check_version( "$min_libgnutls_version" ) )
+      {
+        return 0;
+      }
+     else
+      {
+        printf("no\n*** An old version of LIBGNUTLS (%s) was found.\n",
+                gnutls_check_version(NULL) );
+        printf("*** You need a version of LIBGNUTLS newer than %s. The latest version of\n",
+               "$min_libgnutls_version" );
+        printf("*** LIBGNUTLS is always available from ftp://gnutls.hellug.gr/pub/gnutls.\n");
+        printf("*** \n");
+        printf("*** If you have already installed a sufficiently new version, this error\n");
+        printf("*** probably means that the wrong copy of the libgnutls-config shell script is\n");
+        printf("*** being found. The easiest way to fix this is to remove the old version\n");
+        printf("*** of LIBGNUTLS, but you can also set the LIBGNUTLS_CONFIG environment to point to the\n");
+        printf("*** correct copy of libgnutls-config. (In this case, you will have to\n");
+        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
+        printf("*** so that the correct libraries are found at run-time))\n");
+      }
+    }
+  return 1;
+}
+
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+no_libgnutls=yes
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+       CFLAGS="$ac_save_CFLAGS"
+       LIBS="$ac_save_LIBS"
+  fi
+
+  if test "x$no_libgnutls" = x ; then
+     echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+     LIBS="$LIBS $LIBGNUTLS_LIBS"
+                          CFLAGS="$CFLAGS $LIBGNUTLS_CFLAGS"
+                         CPPFLAGS="$CPPFLAGS $LIBGNUTLS_CFLAGS"
+                         GNUTLS_COMMON_O="gnutls-common.o"
+                         GNUTLS_MAN_STATUS="This copy of WMBiff was compiled with GNUTLS."
+
+for ac_header in gnutls/gnutls.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------------------- ##
+## Report this to wmbiff-devel at lists.sourceforge.net ##
+## ------------------------------------------------- ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+  else
+     if test -f conf.libgnutlstest ; then
+        :
+     else
+        echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+     fi
+     if test "$LIBGNUTLS_CONFIG" = "no" ; then
+       echo "*** The libgnutls-config script installed by LIBGNUTLS could not be found"
+       echo "*** If LIBGNUTLS was installed in PREFIX, make sure PREFIX/bin is in"
+       echo "*** your path, or set the LIBGNUTLS_CONFIG environment variable to the"
+       echo "*** full path to libgnutls-config."
+     else
+       if test -f conf.libgnutlstest ; then
+        :
+       else
+          echo "*** Could not run libgnutls test program, checking why..."
+          CFLAGS="$CFLAGS $LIBGNUTLS_CFLAGS"
+          LIBS="$LIBS $LIBGNUTLS_LIBS"
+          cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <gnutls/gnutls.h>
+
+int
+main ()
+{
+ return !!gnutls_check_version(NULL);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+   echo "*** The test program compiled, but did not run. This usually means"
+          echo "*** that the run-time linker is not finding LIBGNUTLS or finding the wrong"
+          echo "*** version of LIBGNUTLS. If it is not finding LIBGNUTLS, you'll need to set your"
+          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
+          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
+          echo "*** is required on your system"
+          echo "***"
+          echo "*** If you have an old version installed, it is best to remove it, although"
+          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
+          echo "***"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ echo "*** The test program failed to compile or link. See the file config.log for the"
+          echo "*** exact error that occured. This usually means LIBGNUTLS was incorrectly installed"
+          echo "*** or that you have moved LIBGNUTLS since it was installed. In the latter case, you"
+          echo "*** may want to edit the libgnutls-config script: $LIBGNUTLS_CONFIG"
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+          CFLAGS="$ac_save_CFLAGS"
+          LIBS="$ac_save_LIBS"
+       fi
+     fi
+     LIBGNUTLS_CFLAGS=""
+     LIBGNUTLS_LIBS=""
+      echo GNUTLS can be found at ftp://gnutls.hellug.gr/pub/gnutls
+  fi
+  rm -f conf.libgnutlstest
+
+
+
+else
+ echo "$as_me:$LINENO: result: GNUTLS support requires libz.a and libgdbm.a" >&5
+echo "${ECHO_T}GNUTLS support requires libz.a and libgdbm.a" >&6
+fi
+
+GCRYPT_MAN_STATUS="This copy of WMBiff was not compiled with gcrypt."
+if test "$gcrypt" = "ok"; then
+
+# Check whether --with-libgcrypt-prefix or --without-libgcrypt-prefix was given.
+if test "${with_libgcrypt_prefix+set}" = set; then
+  withval="$with_libgcrypt_prefix"
+  libgcrypt_config_prefix="$withval"
+else
+  libgcrypt_config_prefix=""
+fi;
+# Check whether --enable-libgcrypttest or --disable-libgcrypttest was given.
+if test "${enable_libgcrypttest+set}" = set; then
+  enableval="$enable_libgcrypttest"
+
+else
+  enable_libgcrypttest=yes
+fi;
+
+  if test x$libgcrypt_config_prefix != x ; then
+     libgcrypt_config_args="$libgcrypt_config_args --prefix=$libgcrypt_config_prefix"
+     if test x${LIBGCRYPT_CONFIG+set} != xset ; then
+        LIBGCRYPT_CONFIG=$libgcrypt_config_prefix/bin/libgcrypt-config
+     fi
+  fi
+
+  # Extract the first word of "libgcrypt-config", so it can be a program name with args.
+set dummy libgcrypt-config; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_LIBGCRYPT_CONFIG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $LIBGCRYPT_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_LIBGCRYPT_CONFIG="$LIBGCRYPT_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_LIBGCRYPT_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  test -z "$ac_cv_path_LIBGCRYPT_CONFIG" && ac_cv_path_LIBGCRYPT_CONFIG="no"
+  ;;
+esac
+fi
+LIBGCRYPT_CONFIG=$ac_cv_path_LIBGCRYPT_CONFIG
+
+if test -n "$LIBGCRYPT_CONFIG"; then
+  echo "$as_me:$LINENO: result: $LIBGCRYPT_CONFIG" >&5
+echo "${ECHO_T}$LIBGCRYPT_CONFIG" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  min_libgcrypt_version=1.1.90
+  echo "$as_me:$LINENO: checking for libgcrypt - version >= $min_libgcrypt_version" >&5
+echo $ECHO_N "checking for libgcrypt - version >= $min_libgcrypt_version... $ECHO_C" >&6
+  no_libgcrypt=""
+  if test "$LIBGCRYPT_CONFIG" = "no" ; then
+    no_libgcrypt=yes
+  else
+    LIBGCRYPT_CFLAGS=`$LIBGCRYPT_CONFIG $libgcrypt_config_args --cflags`
+    LIBGCRYPT_LIBS=`$LIBGCRYPT_CONFIG $libgcrypt_config_args --libs`
+    libgcrypt_config_version=`$LIBGCRYPT_CONFIG $libgcrypt_config_args --version`
+    if test "x$enable_libgcrypttest" = "xyes" ; then
+      ac_save_CFLAGS="$CFLAGS"
+      ac_save_LIBS="$LIBS"
+      CFLAGS="$CFLAGS $LIBGCRYPT_CFLAGS"
+      LIBS="$LIBS $LIBGCRYPT_LIBS"
+      rm -f conf.libgcrypttest
+      if test "$cross_compiling" = yes; then
+  echo $ac_n "cross compiling; assumed OK... $ac_c"
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <gcrypt.h>
+
+int
+main ()
+{
+    system ("touch conf.libgcrypttest");
+
+    if( strcmp( gcry_check_version(NULL), "$libgcrypt_config_version" ) )
+    {
+      printf("\n*** 'libgcrypt-config --version' returned %s, but LIBGCRYPT (%s)\n",
+             "$libgcrypt_config_version", gcry_check_version(NULL) );
+      printf("*** was found! If libgcrypt-config was correct, then it is best\n");
+      printf("*** to remove the old version of LIBGCRYPT. You may also be able to fix the error\n");
+      printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
+      printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
+      printf("*** required on your system.\n");
+      printf("*** If libgcrypt-config was wrong, set the environment variable LIBGCRYPT_CONFIG\n");
+      printf("*** to point to the correct copy of libgcrypt-config, and remove the file config.cache\n");
+      printf("*** before re-running configure\n");
+    }
+    else if ( strcmp(gcry_check_version(NULL), GCRYPT_VERSION ) )
+    {
+      printf("\n*** LIBGCRYPT header file (version %s) does not match\n", GCRYPT_VERSION);
+      printf("*** library (version %s)\n", gcry_check_version(NULL) );
+    }
+    else
+    {
+      if ( gcry_check_version( "$min_libgcrypt_version" ) )
+      {
+        return 0;
+      }
+     else
+      {
+        printf("no\n*** An old version of LIBGCRYPT (%s) was found.\n",
+                gcry_check_version(NULL) );
+        printf("*** You need a version of LIBGCRYPT newer than %s. The latest version of\n",
+               "$min_libgcrypt_version" );
+        printf("*** LIBGCRYPT is always available from ftp://ftp.gnupg.org/pub/libgcrypt/gnupg.\n");
+        printf("*** (It is distributed along with GnuPG).\n");
+        printf("*** \n");
+        printf("*** If you have already installed a sufficiently new version, this error\n");
+        printf("*** probably means that the wrong copy of the libgcrypt-config shell script is\n");
+        printf("*** being found. The easiest way to fix this is to remove the old version\n");
+        printf("*** of LIBGCRYPT, but you can also set the LIBGCRYPT_CONFIG environment to point to the\n");
+        printf("*** correct copy of libgcrypt-config. (In this case, you will have to\n");
+        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
+        printf("*** so that the correct libraries are found at run-time))\n");
+      }
+    }
+  return 1;
+}
+
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+no_libgcrypt=yes
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+       CFLAGS="$ac_save_CFLAGS"
+       LIBS="$ac_save_LIBS"
+     fi
+  fi
+  if test "x$no_libgcrypt" = x ; then
+     echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+     CFLAGS="$CFLAGS $LIBGCRYPT_CFLAGS"
+                         CPPFLAGS="$CPPFLAGS $LIBGCRYPT_CFLAGS"
+                         GCRYPT_MAN_STATUS="This copy of WMBiff was compiled with gcrypt."
+
+for ac_header in gcrypt.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------------------- ##
+## Report this to wmbiff-devel at lists.sourceforge.net ##
+## ------------------------------------------------- ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+  else
+     if test -f conf.libgcrypttest ; then
+        :
+     else
+        echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+     fi
+     if test "$LIBGCRYPT_CONFIG" = "no" ; then
+       echo "*** The libgcrypt-config script installed by LIBGCRYPT could not be found"
+       echo "*** If LIBGCRYPT was installed in PREFIX, make sure PREFIX/bin is in"
+       echo "*** your path, or set the LIBGCRYPT_CONFIG environment variable to the"
+       echo "*** full path to libgcrypt-config."
+     else
+       if test -f conf.libgcrypttest ; then
+        :
+       else
+          echo "*** Could not run libgcrypt test program, checking why..."
+          CFLAGS="$CFLAGS $LIBGCRYPT_CFLAGS"
+          LIBS="$LIBS $LIBGCRYPT_LIBS"
+          cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <gcrypt.h>
+
+int
+main ()
+{
+ return !!gcry_check_version(NULL);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+   echo "*** The test program compiled, but did not run. This usually means"
+          echo "*** that the run-time linker is not finding LIBGCRYPT or finding the wrong"
+          echo "*** version of LIBGCRYPT. If it is not finding LIBGCRYPT, you'll need to set your"
+          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
+          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
+          echo "*** is required on your system"
+          echo "***"
+          echo "*** If you have an old version installed, it is best to remove it, although"
+          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
+          echo "***"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ echo "*** The test program failed to compile or link. See the file config.log for the"
+          echo "*** exact error that occured. This usually means LIBGCRYPT was incorrectly installed"
+          echo "*** or that you have moved LIBGCRYPT since it was installed. In the latter case, you"
+          echo "*** may want to edit the libgcrypt-config script: $LIBGCRYPT_CONFIG"
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+          CFLAGS="$ac_save_CFLAGS"
+          LIBS="$ac_save_LIBS"
+       fi
+     fi
+     LIBGCRYPT_CFLAGS=""
+     LIBGCRYPT_LIBS=""
+      echo libgcrypt can be found at ftp://ftp.gnupg.org/pub/gcrypt/alpha/libgcrypt/
+  fi
+
+
+  rm -f conf.libgcrypttest
+
+else
+        echo "$as_me:$LINENO: result: GCRYPT disabled." >&5
+echo "${ECHO_T}GCRYPT disabled." >&6
+fi;
+
+
+
+
+
+
+
+
+for ac_header in regex.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------------------- ##
+## Report this to wmbiff-devel at lists.sourceforge.net ##
+## ------------------------------------------------- ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+if test "x$ac_path_x_has_been_run" != xyes; then
+  echo "$as_me:$LINENO: checking for X" >&5
+echo $ECHO_N "checking for X... $ECHO_C" >&6
+
+ac_path_x_has_been_run=yes
+
+# Check whether --with-x or --without-x was given.
+if test "${with_x+set}" = set; then
+  withval="$with_x"
+
+fi;
+# $have_x is `yes', `no', `disabled', or empty when we do not yet know.
+if test "x$with_x" = xno; then
+  # The user explicitly disabled X.
+  have_x=disabled
+else
+  if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
+    # Both variables are already set.
+    have_x=yes
+  else
+    if test "${ac_cv_have_x+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # One or both of the vars are not set, and there is no cached value.
+ac_x_includes=no ac_x_libraries=no
+rm -fr conftest.dir
+if mkdir conftest.dir; then
+  cd conftest.dir
+  # Make sure to not put "make" in the Imakefile rules, since we grep it out.
+  cat >Imakefile <<'_ACEOF'
+acfindx:
+	@echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
+_ACEOF
+  if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
+    # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+    eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
+    # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
+    for ac_extension in a so sl; do
+      if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
+	 test -f $ac_im_libdir/libX11.$ac_extension; then
+	ac_im_usrlibdir=$ac_im_libdir; break
+      fi
+    done
+    # Screen out bogus values from the imake configuration.  They are
+    # bogus both because they are the default anyway, and because
+    # using them would break gcc on systems where it needs fixed includes.
+    case $ac_im_incroot in
+	/usr/include) ;;
+	*) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
+    esac
+    case $ac_im_usrlibdir in
+	/usr/lib | /lib) ;;
+	*) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
+    esac
+  fi
+  cd ..
+  rm -fr conftest.dir
+fi
+
+# Standard set of common directories for X headers.
+# Check X11 before X11Rn because it is often a symlink to the current release.
+ac_x_header_dirs='
+/usr/X11/include
+/usr/X11R6/include
+/usr/X11R5/include
+/usr/X11R4/include
+
+/usr/include/X11
+/usr/include/X11R6
+/usr/include/X11R5
+/usr/include/X11R4
+
+/usr/local/X11/include
+/usr/local/X11R6/include
+/usr/local/X11R5/include
+/usr/local/X11R4/include
+
+/usr/local/include/X11
+/usr/local/include/X11R6
+/usr/local/include/X11R5
+/usr/local/include/X11R4
+
+/usr/X386/include
+/usr/x386/include
+/usr/XFree86/include/X11
+
+/usr/include
+/usr/local/include
+/usr/unsupported/include
+/usr/athena/include
+/usr/local/x11r5/include
+/usr/lpp/Xamples/include
+
+/usr/openwin/include
+/usr/openwin/share/include'
+
+if test "$ac_x_includes" = no; then
+  # Guess where to find include files, by looking for a specified header file.
+  # First, try using that file with no special directory specified.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <X11/Intrinsic.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  # We can compile using X headers with no special include directory.
+ac_x_includes=
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  for ac_dir in $ac_x_header_dirs; do
+  if test -r "$ac_dir/X11/Intrinsic.h"; then
+    ac_x_includes=$ac_dir
+    break
+  fi
+done
+fi
+rm -f conftest.err conftest.$ac_ext
+fi # $ac_x_includes = no
+
+if test "$ac_x_libraries" = no; then
+  # Check for the libraries.
+  # See if we find them without any special options.
+  # Don't add to $LIBS permanently.
+  ac_save_LIBS=$LIBS
+  LIBS="-lXt $LIBS"
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <X11/Intrinsic.h>
+int
+main ()
+{
+XtMalloc (0)
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  LIBS=$ac_save_LIBS
+# We can link X programs with no special library path.
+ac_x_libraries=
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+LIBS=$ac_save_LIBS
+for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
+do
+  # Don't even attempt the hair of trying to link an X program!
+  for ac_extension in a so sl; do
+    if test -r $ac_dir/libXt.$ac_extension; then
+      ac_x_libraries=$ac_dir
+      break 2
+    fi
+  done
+done
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi # $ac_x_libraries = no
+
+if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
+  # Didn't find X anywhere.  Cache the known absence of X.
+  ac_cv_have_x="have_x=no"
+else
+  # Record where we found X for the cache.
+  ac_cv_have_x="have_x=yes \
+		ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
+fi
+fi
+
+  fi
+  eval "$ac_cv_have_x"
+fi # $with_x != no
+
+if test "$have_x" != yes; then
+  echo "$as_me:$LINENO: result: $have_x" >&5
+echo "${ECHO_T}$have_x" >&6
+  no_x=yes
+else
+  # If each of the values was on the command line, it overrides each guess.
+  test "x$x_includes" = xNONE && x_includes=$ac_x_includes
+  test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
+  # Update the cache value to reflect the command line values.
+  ac_cv_have_x="have_x=yes \
+		ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
+  # It might be that x_includes is empty (headers are found in the
+  # standard search path. Then output the corresponding message
+  ac_out_x_includes=$x_includes
+  test "x$x_includes" = x && ac_out_x_includes="in standard search path"
+  echo "$as_me:$LINENO: result: libraries $x_libraries, headers $ac_out_x_includes" >&5
+echo "${ECHO_T}libraries $x_libraries, headers $ac_out_x_includes" >&6
+fi
+
+fi
+if test "$no_x" = yes; then
+  # Not all programs may use this symbol, but it does not hurt to define it.
+
+cat >>confdefs.h <<\_ACEOF
+#define X_DISPLAY_MISSING 1
+_ACEOF
+
+  X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
+else
+  if test -n "$x_includes"; then
+    X_CFLAGS="$X_CFLAGS -I$x_includes"
+  fi
+
+  # It would also be nice to do this for all -L options, not just this one.
+  if test -n "$x_libraries"; then
+    X_LIBS="$X_LIBS -L$x_libraries"
+    # For Solaris; some versions of Sun CC require a space after -R and
+    # others require no space.  Words are not sufficient . . . .
+    case `(uname -sr) 2>/dev/null` in
+    "SunOS 5"*)
+      echo "$as_me:$LINENO: checking whether -R must be followed by a space" >&5
+echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
+      ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_R_nospace=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_R_nospace=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+      if test $ac_R_nospace = yes; then
+	echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+	X_LIBS="$X_LIBS -R$x_libraries"
+      else
+	LIBS="$ac_xsave_LIBS -R $x_libraries"
+	cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_R_space=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_R_space=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+	if test $ac_R_space = yes; then
+	  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+	  X_LIBS="$X_LIBS -R $x_libraries"
+	else
+	  echo "$as_me:$LINENO: result: neither works" >&5
+echo "${ECHO_T}neither works" >&6
+	fi
+      fi
+      LIBS=$ac_xsave_LIBS
+    esac
+  fi
+
+  # Check for system-dependent libraries X programs must link with.
+  # Do this before checking for the system-independent R6 libraries
+  # (-lICE), since we may need -lsocket or whatever for X linking.
+
+  if test "$ISC" = yes; then
+    X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
+  else
+    # Martyn Johnson says this is needed for Ultrix, if the X
+    # libraries were built with DECnet support.  And Karl Berry says
+    # the Alpha needs dnet_stub (dnet does not exist).
+    ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end 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 XOpenDisplay ();
+int
+main ()
+{
+XOpenDisplay ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet" >&5
+echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
+if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldnet  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end 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 dnet_ntoa ();
+int
+main ()
+{
+dnet_ntoa ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_dnet_dnet_ntoa=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dnet_dnet_ntoa=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
+echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
+if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
+fi
+
+    if test $ac_cv_lib_dnet_dnet_ntoa = no; then
+      echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet_stub" >&5
+echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
+if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldnet_stub  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end 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 dnet_ntoa ();
+int
+main ()
+{
+dnet_ntoa ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_dnet_stub_dnet_ntoa=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dnet_stub_dnet_ntoa=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
+echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
+if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
+fi
+
+    fi
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+    LIBS="$ac_xsave_LIBS"
+
+    # msh at cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
+    # to get the SysV transport functions.
+    # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
+    # needs -lnsl.
+    # The nsl library prevents programs from opening the X display
+    # on Irix 5.2, according to T.E. Dickey.
+    # The functions gethostbyname, getservbyname, and inet_addr are
+    # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
+    echo "$as_me:$LINENO: checking for gethostbyname" >&5
+echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
+if test "${ac_cv_func_gethostbyname+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define gethostbyname to an innocuous variant, in case <limits.h> declares gethostbyname.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define gethostbyname innocuous_gethostbyname
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char gethostbyname (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef gethostbyname
+
+/* 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 gethostbyname ();
+/* 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_gethostbyname) || defined (__stub___gethostbyname)
+choke me
+#else
+char (*f) () = gethostbyname;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != gethostbyname;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_gethostbyname=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_gethostbyname=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5
+echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
+
+    if test $ac_cv_func_gethostbyname = no; then
+      echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5
+echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
+if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lnsl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end 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 gethostbyname ();
+int
+main ()
+{
+gethostbyname ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_nsl_gethostbyname=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_nsl_gethostbyname=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5
+echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
+if test $ac_cv_lib_nsl_gethostbyname = yes; then
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
+fi
+
+      if test $ac_cv_lib_nsl_gethostbyname = no; then
+	echo "$as_me:$LINENO: checking for gethostbyname in -lbsd" >&5
+echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
+if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lbsd  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end 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 gethostbyname ();
+int
+main ()
+{
+gethostbyname ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_bsd_gethostbyname=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_bsd_gethostbyname=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_gethostbyname" >&5
+echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
+if test $ac_cv_lib_bsd_gethostbyname = yes; then
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
+fi
+
+      fi
+    fi
+
+    # lieder at skyler.mavd.honeywell.com says without -lsocket,
+    # socket/setsockopt and other routines are undefined under SCO ODT
+    # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
+    # on later versions), says Simon Leinen: it contains gethostby*
+    # variants that don't use the name server (or something).  -lsocket
+    # must be given before -lnsl if both are needed.  We assume that
+    # if connect needs -lnsl, so does gethostbyname.
+    echo "$as_me:$LINENO: checking for connect" >&5
+echo $ECHO_N "checking for connect... $ECHO_C" >&6
+if test "${ac_cv_func_connect+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define connect to an innocuous variant, in case <limits.h> declares connect.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define connect innocuous_connect
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char connect (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef connect
+
+/* 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 connect ();
+/* 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_connect) || defined (__stub___connect)
+choke me
+#else
+char (*f) () = connect;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != connect;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_connect=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_connect=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5
+echo "${ECHO_T}$ac_cv_func_connect" >&6
+
+    if test $ac_cv_func_connect = no; then
+      echo "$as_me:$LINENO: checking for connect in -lsocket" >&5
+echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
+if test "${ac_cv_lib_socket_connect+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end 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 connect ();
+int
+main ()
+{
+connect ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_socket_connect=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_socket_connect=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_socket_connect" >&5
+echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
+if test $ac_cv_lib_socket_connect = yes; then
+  X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
+fi
+
+    fi
+
+    # Guillermo Gomez says -lposix is necessary on A/UX.
+    echo "$as_me:$LINENO: checking for remove" >&5
+echo $ECHO_N "checking for remove... $ECHO_C" >&6
+if test "${ac_cv_func_remove+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define remove to an innocuous variant, in case <limits.h> declares remove.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define remove innocuous_remove
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char remove (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef remove
+
+/* 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 remove ();
+/* 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_remove) || defined (__stub___remove)
+choke me
+#else
+char (*f) () = remove;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != remove;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_remove=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_remove=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_remove" >&5
+echo "${ECHO_T}$ac_cv_func_remove" >&6
+
+    if test $ac_cv_func_remove = no; then
+      echo "$as_me:$LINENO: checking for remove in -lposix" >&5
+echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
+if test "${ac_cv_lib_posix_remove+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lposix  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end 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 remove ();
+int
+main ()
+{
+remove ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_posix_remove=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_posix_remove=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_posix_remove" >&5
+echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
+if test $ac_cv_lib_posix_remove = yes; then
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
+fi
+
+    fi
+
+    # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
+    echo "$as_me:$LINENO: checking for shmat" >&5
+echo $ECHO_N "checking for shmat... $ECHO_C" >&6
+if test "${ac_cv_func_shmat+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define shmat to an innocuous variant, in case <limits.h> declares shmat.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define shmat innocuous_shmat
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char shmat (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef shmat
+
+/* 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 shmat ();
+/* 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_shmat) || defined (__stub___shmat)
+choke me
+#else
+char (*f) () = shmat;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != shmat;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_shmat=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_shmat=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_shmat" >&5
+echo "${ECHO_T}$ac_cv_func_shmat" >&6
+
+    if test $ac_cv_func_shmat = no; then
+      echo "$as_me:$LINENO: checking for shmat in -lipc" >&5
+echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
+if test "${ac_cv_lib_ipc_shmat+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lipc  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end 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 shmat ();
+int
+main ()
+{
+shmat ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_ipc_shmat=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_ipc_shmat=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_ipc_shmat" >&5
+echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
+if test $ac_cv_lib_ipc_shmat = yes; then
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
+fi
+
+    fi
+  fi
+
+  # Check for libraries that X11R6 Xt/Xaw programs need.
+  ac_save_LDFLAGS=$LDFLAGS
+  test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
+  # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
+  # check for ICE first), but we must link in the order -lSM -lICE or
+  # we get undefined symbols.  So assume we have SM if we have ICE.
+  # These have to be linked with before -lX11, unlike the other
+  # libraries we check for below, so use a different variable.
+  # John Interrante, Karl Berry
+  echo "$as_me:$LINENO: checking for IceConnectionNumber in -lICE" >&5
+echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
+if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lICE $X_EXTRA_LIBS $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end 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 IceConnectionNumber ();
+int
+main ()
+{
+IceConnectionNumber ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_ICE_IceConnectionNumber=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_ICE_IceConnectionNumber=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
+echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
+if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
+  X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
+fi
+
+  LDFLAGS=$ac_save_LDFLAGS
+
+fi
+
+LIBS="$X_LIBS $LIBS"
+CPPFLAGS="$X_CFLAGS $CPPFLAGS"
+
+echo "$as_me:$LINENO: checking for XrmParseCommand in -lX11" >&5
+echo $ECHO_N "checking for XrmParseCommand in -lX11... $ECHO_C" >&6
+if test "${ac_cv_lib_X11_XrmParseCommand+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lX11  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end 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 XrmParseCommand ();
+int
+main ()
+{
+XrmParseCommand ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_X11_XrmParseCommand=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_X11_XrmParseCommand=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_X11_XrmParseCommand" >&5
+echo "${ECHO_T}$ac_cv_lib_X11_XrmParseCommand" >&6
+if test $ac_cv_lib_X11_XrmParseCommand = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBX11 1
+_ACEOF
+
+  LIBS="-lX11 $LIBS"
+
+fi
+
+
+echo "$as_me:$LINENO: checking for XextAddDisplay in -lXext" >&5
+echo $ECHO_N "checking for XextAddDisplay in -lXext... $ECHO_C" >&6
+if test "${ac_cv_lib_Xext_XextAddDisplay+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lXext  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end 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 XextAddDisplay ();
+int
+main ()
+{
+XextAddDisplay ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_Xext_XextAddDisplay=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_Xext_XextAddDisplay=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_Xext_XextAddDisplay" >&5
+echo "${ECHO_T}$ac_cv_lib_Xext_XextAddDisplay" >&6
+if test $ac_cv_lib_Xext_XextAddDisplay = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBXEXT 1
+_ACEOF
+
+  LIBS="-lXext $LIBS"
+
+fi
+
+
+echo "$as_me:$LINENO: checking for XpmCreateImageFromXpmImage in -lXpm" >&5
+echo $ECHO_N "checking for XpmCreateImageFromXpmImage in -lXpm... $ECHO_C" >&6
+if test "${ac_cv_lib_Xpm_XpmCreateImageFromXpmImage+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lXpm  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end 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 XpmCreateImageFromXpmImage ();
+int
+main ()
+{
+XpmCreateImageFromXpmImage ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_Xpm_XpmCreateImageFromXpmImage=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_Xpm_XpmCreateImageFromXpmImage=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_Xpm_XpmCreateImageFromXpmImage" >&5
+echo "${ECHO_T}$ac_cv_lib_Xpm_XpmCreateImageFromXpmImage" >&6
+if test $ac_cv_lib_Xpm_XpmCreateImageFromXpmImage = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBXPM 1
+_ACEOF
+
+  LIBS="-lXpm $LIBS"
+
+fi
+
+
+
+for ac_header in X11/xpm.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------------------- ##
+## Report this to wmbiff-devel at lists.sourceforge.net ##
+## ------------------------------------------------- ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+else
+
+for ac_header in xpm.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------------------- ##
+## Report this to wmbiff-devel at lists.sourceforge.net ##
+## ------------------------------------------------- ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+else
+  { { echo "$as_me:$LINENO: error: xpm.h is needed" >&5
+echo "$as_me: error: xpm.h is needed" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+done
+
+fi
+
+done
+
+
+
+
+# WM_C_ATTRIBUTE
+
+echo "$as_me:$LINENO: checking for __attribute__ support" >&5
+echo $ECHO_N "checking for __attribute__ support... $ECHO_C" >&6
+if test "${wm_cv_c_attribute+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  wm_cv_c_attribute=no
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifndef __cplusplus
+typedef int foo_t;
+foo_t foo () __attribute__((unused));
+foo_t foo () {return 0; }
+#endif
+
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  wm_cv_c_attribute=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+echo "$as_me:$LINENO: result: $wm_cv_c_attribute" >&5
+echo "${ECHO_T}$wm_cv_c_attribute" >&6
+case $wm_cv_c_attribute in
+  yes)
+cat >>confdefs.h <<\_ACEOF
+#define HAVE___ATTRIBUTE__
+_ACEOF
+
+  ;;
+esac
+
+
+for ac_prog in ssh-askpass x11-ssh-askpass ssh-askpass-gnome
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_DEFAULT_ASKPASS+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $DEFAULT_ASKPASS in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_DEFAULT_ASKPASS="$DEFAULT_ASKPASS" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_DEFAULT_ASKPASS="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  ;;
+esac
+fi
+DEFAULT_ASKPASS=$ac_cv_path_DEFAULT_ASKPASS
+
+if test -n "$DEFAULT_ASKPASS"; then
+  echo "$as_me:$LINENO: result: $DEFAULT_ASKPASS" >&5
+echo "${ECHO_T}$DEFAULT_ASKPASS" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  test -n "$DEFAULT_ASKPASS" && break
+done
+test -n "$DEFAULT_ASKPASS" || DEFAULT_ASKPASS="/usr/bin/ssh-askpass"
+
+# Extract the first word of "cvs2cl", so it can be a program name with args.
+set dummy cvs2cl; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_CVS2CL+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $CVS2CL in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_CVS2CL="$CVS2CL" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_CVS2CL="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  ;;
+esac
+fi
+CVS2CL=$ac_cv_path_CVS2CL
+
+if test -n "$CVS2CL"; then
+  echo "$as_me:$LINENO: result: $CVS2CL" >&5
+echo "${ECHO_T}$CVS2CL" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+
+cat >>confdefs.h <<_ACEOF
+#define DEFAULT_ASKPASS "$DEFAULT_ASKPASS"
+_ACEOF
+
+
+
+
+for ac_header in CoreServices/CoreServices.h Security/Security.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------------------- ##
+## Report this to wmbiff-devel at lists.sourceforge.net ##
+## ------------------------------------------------- ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+if test "x$prefix" != xNONE; then
+  SKINDIR="$prefix/share/wmbiff/skins"
+else
+  SKINDIR="$ac_default_prefix/share/wmbiff/skins"
+fi
+
+
+cat >>confdefs.h <<_ACEOF
+#define DEFAULT_SKIN_PATH "$SKINDIR:/usr/share/wmbiff/skins:/usr/local/share/wmbiff/skins:."
+_ACEOF
+
+
+                                                            ac_config_files="$ac_config_files Makefile wmbiff/Makefile wmgeneral/Makefile wmbiff/wmbiffrc.5 autoconf/Makefile scripts/Makefile"
+
+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 overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+{
+  (set) 2>&1 |
+    case `(ac_space=' '; set | grep ac_space) 2>&1` in
+    *ac_space=\ *)
+      # `set' does not quote correctly, so add quotes (double-quote
+      # substitution turns \\\\ into \\, and sed turns \\ into \).
+      sed -n \
+	"s/'/'\\\\''/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+      ;;
+    *)
+      # `set' quotes correctly as required by POSIX, so do not add quotes.
+      sed -n \
+	"s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+      ;;
+    esac;
+} |
+  sed '
+     t clear
+     : clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+     : end' >>confcache
+if diff $cache_file confcache >/dev/null 2>&1; then :; else
+  if test -w $cache_file; then
+    test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
+    cat confcache >$cache_file
+  else
+    echo "not updating unwritable cache $cache_file"
+  fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+  ac_vpsub='/^[	 ]*VPATH[	 ]*=/{
+s/:*\$(srcdir):*/:/;
+s/:*\${srcdir}:*/:/;
+s/:*@srcdir@:*/:/;
+s/^\([^=]*=[	 ]*\):*/\1/;
+s/:*$//;
+s/^[^=]*=[	 ]*$//;
+}'
+fi
+
+DEFS=-DHAVE_CONFIG_H
+
+ac_libobjs=
+ac_ltlibobjs=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+  # 1. Remove the extension, and $U if already installed.
+  ac_i=`echo "$ac_i" |
+	 sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
+  # 2. Add them.
+  ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
+  ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+: ${CONFIG_STATUS=./config.status}
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+## --------------------- ##
+## M4sh Initialization.  ##
+## --------------------- ##
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+  set -o posix
+fi
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+  LC_TELEPHONE LC_TIME
+do
+  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+    eval $as_var=C; export $as_var
+  else
+    $as_unset $as_var
+  fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)$' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+  	  /^X\/\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\/\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+
+
+# PATH needs CR, and LINENO needs CR and PATH.
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
+fi
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
+  # Find who we are.  Look in the path if we contain no path at all
+  # relative or not.
+  case $0 in
+    *[\\/]* ) as_myself=$0 ;;
+    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+
+       ;;
+  esac
+  # We did not find ourselves, most probably we were run as `sh COMMAND'
+  # in which case we are not to be found in the path.
+  if test "x$as_myself" = x; then
+    as_myself=$0
+  fi
+  if test ! -f "$as_myself"; then
+    { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
+echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+  case $CONFIG_SHELL in
+  '')
+    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for as_base in sh bash ksh sh5; do
+	 case $as_dir in
+	 /*)
+	   if ("$as_dir/$as_base" -c '
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
+	     $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+	     $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+	     CONFIG_SHELL=$as_dir/$as_base
+	     export CONFIG_SHELL
+	     exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+	   fi;;
+	 esac
+       done
+done
+;;
+  esac
+
+  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+  # uniformly replaced by the line number.  The first 'sed' inserts a
+  # line-number line before each line; the second 'sed' does the real
+  # work.  The second script uses 'N' to pair each line-number line
+  # with the numbered line, and appends trailing '-' during
+  # substitution so that $LINENO is not a special case at line end.
+  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
+  sed '=' <$as_myself |
+    sed '
+      N
+      s,$,-,
+      : loop
+      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+      t loop
+      s,-$,,
+      s,^['$as_cr_digits']*\n,,
+    ' >$as_me.lineno &&
+  chmod +x $as_me.lineno ||
+    { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
+echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
+   { (exit 1); exit 1; }; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensible to this).
+  . ./$as_me.lineno
+  # Exit status is that of the last command.
+  exit
+}
+
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+  *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T='	' ;;
+  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+  # We could just check for DJGPP; but this test a) works b) is more generic
+  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+  if test -f conf$$.exe; then
+    # Don't use ln at all; we don't have any links
+    as_ln_s='cp -p'
+  else
+    as_ln_s='ln -s'
+  fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s=ln
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+as_executable_p="test -f"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" 	$as_nl"
+
+# CDPATH.
+$as_unset CDPATH
+
+exec 6>&1
+
+# Open the log real soon, to keep \$[0] and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.  Logging --version etc. is OK.
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+} >&5
+cat >&5 <<_CSEOF
+
+This file was extended by WMBiff $as_me 0.4.26, which was
+generated by GNU Autoconf 2.59.  Invocation command line was
+
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  $ $0 $@
+
+_CSEOF
+echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
+echo >&5
+_ACEOF
+
+# Files that config.status was made for.
+if test -n "$ac_config_files"; then
+  echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_headers"; then
+  echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_links"; then
+  echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_commands"; then
+  echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+ac_cs_usage="\
+\`$as_me' instantiates files from templates according to the
+current configuration.
+
+Usage: $0 [OPTIONS] [FILE]...
+
+  -h, --help       print this help, then exit
+  -V, --version    print version number, then exit
+  -q, --quiet      do not print progress messages
+  -d, --debug      don't remove temporary files
+      --recheck    update $as_me by reconfiguring in the same conditions
+  --file=FILE[:TEMPLATE]
+		   instantiate the configuration file FILE
+  --header=FILE[:TEMPLATE]
+		   instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to <bug-autoconf at gnu.org>."
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+ac_cs_version="\\
+WMBiff config.status 0.4.26
+configured by $0, generated by GNU Autoconf 2.59,
+  with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright (C) 2003 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=$srcdir
+INSTALL="$INSTALL"
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+# If no file are specified by the user, then we need to provide default
+# value.  By we need to know if files were specified by the user.
+ac_need_defaults=:
+while test $# != 0
+do
+  case $1 in
+  --*=*)
+    ac_option=`expr "x$1" : 'x\([^=]*\)='`
+    ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
+    ac_shift=:
+    ;;
+  -*)
+    ac_option=$1
+    ac_optarg=$2
+    ac_shift=shift
+    ;;
+  *) # This is not an option, so the user has probably given explicit
+     # arguments.
+     ac_option=$1
+     ac_need_defaults=false;;
+  esac
+
+  case $ac_option in
+  # Handling of the options.
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    ac_cs_recheck=: ;;
+  --version | --vers* | -V )
+    echo "$ac_cs_version"; exit 0 ;;
+  --he | --h)
+    # Conflict between --help and --header
+    { { echo "$as_me:$LINENO: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2;}
+   { (exit 1); exit 1; }; };;
+  --help | --hel | -h )
+    echo "$ac_cs_usage"; exit 0 ;;
+  --debug | --d* | -d )
+    debug=: ;;
+  --file | --fil | --fi | --f )
+    $ac_shift
+    CONFIG_FILES="$CONFIG_FILES $ac_optarg"
+    ac_need_defaults=false;;
+  --header | --heade | --head | --hea )
+    $ac_shift
+    CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
+    ac_need_defaults=false;;
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil | --si | --s)
+    ac_cs_silent=: ;;
+
+  # This is an error.
+  -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2;}
+   { (exit 1); exit 1; }; } ;;
+
+  *) ac_config_targets="$ac_config_targets $1" ;;
+
+  esac
+  shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+  exec 6>/dev/null
+  ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+if \$ac_cs_recheck; then
+  echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
+  exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+fi
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+#
+# INIT-COMMANDS section.
+#
+
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+_ACEOF
+
+
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+for ac_config_target in $ac_config_targets
+do
+  case "$ac_config_target" in
+  # Handling of arguments.
+  "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+  "wmbiff/Makefile" ) CONFIG_FILES="$CONFIG_FILES wmbiff/Makefile" ;;
+  "wmgeneral/Makefile" ) CONFIG_FILES="$CONFIG_FILES wmgeneral/Makefile" ;;
+  "wmbiff/wmbiffrc.5" ) CONFIG_FILES="$CONFIG_FILES wmbiff/wmbiffrc.5" ;;
+  "autoconf/Makefile" ) CONFIG_FILES="$CONFIG_FILES autoconf/Makefile" ;;
+  "scripts/Makefile" ) CONFIG_FILES="$CONFIG_FILES scripts/Makefile" ;;
+  "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+  "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+  *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+   { (exit 1); exit 1; }; };;
+  esac
+done
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used.  Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+  test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience.  Make it in the build tree
+# simply because there is no reason to put it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Create a temporary directory, and hook for its removal unless debugging.
+$debug ||
+{
+  trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
+  trap '{ (exit 1); exit 1; }' 1 2 13 15
+}
+
+# Create a (secure) tmp directory for tmp files.
+
+{
+  tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
+  test -n "$tmp" && test -d "$tmp"
+}  ||
+{
+  tmp=./confstat$$-$RANDOM
+  (umask 077 && mkdir $tmp)
+} ||
+{
+   echo "$me: cannot create a temporary directory in ." >&2
+   { (exit 1); exit 1; }
+}
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+
+#
+# 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.status.
+  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 PATH_SEPARATOR@,$PATH_SEPARATOR,;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 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 build_alias@,$build_alias,;t t
+s, at host_alias@,$host_alias,;t t
+s, at target_alias@,$target_alias,;t t
+s, at DEFS@,$DEFS,;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 LIBS@,$LIBS,;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 CYGPATH_W@,$CYGPATH_W,;t t
+s, at PACKAGE@,$PACKAGE,;t t
+s, at VERSION@,$VERSION,;t t
+s, at ACLOCAL@,$ACLOCAL,;t t
+s, at AUTOCONF@,$AUTOCONF,;t t
+s, at AUTOMAKE@,$AUTOMAKE,;t t
+s, at AUTOHEADER@,$AUTOHEADER,;t t
+s, at MAKEINFO@,$MAKEINFO,;t t
+s, at AMTAR@,$AMTAR,;t t
+s, at install_sh@,$install_sh,;t t
+s, at STRIP@,$STRIP,;t t
+s, at ac_ct_STRIP@,$ac_ct_STRIP,;t t
+s, at INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t
+s, at AWK@,$AWK,;t t
+s, at SET_MAKE@,$SET_MAKE,;t t
+s, at am__leading_dot@,$am__leading_dot,;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 DEPDIR@,$DEPDIR,;t t
+s, at am__include@,$am__include,;t t
+s, at am__quote@,$am__quote,;t t
+s, at AMDEP_TRUE@,$AMDEP_TRUE,;t t
+s, at AMDEP_FALSE@,$AMDEP_FALSE,;t t
+s, at AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t
+s, at CCDEPMODE@,$CCDEPMODE,;t t
+s, at am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t
+s, at am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t
+s, at RANLIB@,$RANLIB,;t t
+s, at ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
+s, at CPP@,$CPP,;t t
+s, at EGREP@,$EGREP,;t t
+s, at LIBGNUTLS_CONFIG@,$LIBGNUTLS_CONFIG,;t t
+s, at LIBGNUTLS_CFLAGS@,$LIBGNUTLS_CFLAGS,;t t
+s, at LIBGNUTLS_LIBS@,$LIBGNUTLS_LIBS,;t t
+s, at LIBGCRYPT_CONFIG@,$LIBGCRYPT_CONFIG,;t t
+s, at LIBGCRYPT_CFLAGS@,$LIBGCRYPT_CFLAGS,;t t
+s, at LIBGCRYPT_LIBS@,$LIBGCRYPT_LIBS,;t t
+s, at GNUTLS_MAN_STATUS@,$GNUTLS_MAN_STATUS,;t t
+s, at GCRYPT_MAN_STATUS@,$GCRYPT_MAN_STATUS,;t t
+s, at GNUTLS_COMMON_O@,$GNUTLS_COMMON_O,;t t
+s, at X_CFLAGS@,$X_CFLAGS,;t t
+s, at X_PRE_LIBS@,$X_PRE_LIBS,;t t
+s, at X_LIBS@,$X_LIBS,;t t
+s, at X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
+s, at DEFAULT_ASKPASS@,$DEFAULT_ASKPASS,;t t
+s, at CVS2CL@,$CVS2CL,;t t
+s, at SKINDIR@,$SKINDIR,;t t
+s, at LIBOBJS@,$LIBOBJS,;t t
+s, at LTLIBOBJS@,$LTLIBOBJS,;t t
+CEOF
+
+_ACEOF
+
+  cat >>$CONFIG_STATUS <<\_ACEOF
+  # Split the substitutions into bite-sized pieces for seds with
+  # small command number limits, like on Digital OSF/1 and HP-UX.
+  ac_max_sed_lines=48
+  ac_sed_frag=1 # Number of current file.
+  ac_beg=1 # First line for current file.
+  ac_end=$ac_max_sed_lines # Line after last line for current file.
+  ac_more_lines=:
+  ac_sed_cmds=
+  while $ac_more_lines; do
+    if test $ac_beg -gt 1; then
+      sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+    else
+      sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+    fi
+    if test ! -s $tmp/subs.frag; then
+      ac_more_lines=false
+    else
+      # The purpose of the label and of the branching condition is to
+      # speed up the sed processing (if there are no `@' at all, there
+      # is no need to browse any of the substitutions).
+      # These are the two extra sed commands mentioned above.
+      (echo ':t
+  /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
+      if test -z "$ac_sed_cmds"; then
+	ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
+      else
+	ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
+      fi
+      ac_sed_frag=`expr $ac_sed_frag + 1`
+      ac_beg=$ac_end
+      ac_end=`expr $ac_end + $ac_max_sed_lines`
+    fi
+  done
+  if test -z "$ac_sed_cmds"; then
+    ac_sed_cmds=cat
+  fi
+fi # test -n "$CONFIG_FILES"
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
+  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+  case $ac_file in
+  - | *:- | *:-:* ) # input from stdin
+	cat >$tmp/stdin
+	ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+  * )   ac_file_in=$ac_file.in ;;
+  esac
+
+  # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
+  ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+$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 $as_mkdir_p; then
+    mkdir -p "$ac_dir"
+  else
+    as_dir="$ac_dir"
+    as_dirs=
+    while test ! -d "$as_dir"; do
+      as_dirs="$as_dir $as_dirs"
+      as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+    done
+    test ! -n "$as_dirs" || mkdir $as_dirs
+  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+   { (exit 1); exit 1; }; }; }
+
+  ac_builddir=.
+
+if test "$ac_dir" != .; then
+  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  # A "../" for each directory in $ac_dir_suffix.
+  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+  ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+  .)  # No --srcdir option.  We are building in place.
+    ac_srcdir=.
+    if test -z "$ac_top_builddir"; then
+       ac_top_srcdir=.
+    else
+       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+    fi ;;
+  [\\/]* | ?:[\\/]* )  # Absolute path.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir ;;
+  *) # Relative path.
+    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+  case "$ac_dir" in
+  .) ac_abs_builddir=`pwd`;;
+  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+  *) ac_abs_builddir=`pwd`/"$ac_dir";;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+  case ${ac_top_builddir}. in
+  .) ac_abs_top_builddir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+  case $ac_srcdir in
+  .) ac_abs_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+  case $ac_top_srcdir in
+  .) ac_abs_top_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+  esac;;
+esac
+
+
+  case $INSTALL in
+  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+  *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
+  esac
+
+  # 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 by config.status.  */
+  if test x"$ac_file" = x-; then
+    configure_input=
+  else
+    configure_input="$ac_file.  "
+  fi
+  configure_input=$configure_input"Generated from `echo $ac_file_in |
+				     sed 's,.*/,,'` by configure."
+
+  # First look for the input files in the build tree, otherwise in the
+  # src tree.
+  ac_file_inputs=`IFS=:
+    for f in $ac_file_in; do
+      case $f in
+      -) echo $tmp/stdin ;;
+      [\\/$]*)
+	 # Absolute (can't be DOS-style, as IFS=:)
+	 test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+   { (exit 1); exit 1; }; }
+	 echo "$f";;
+      *) # Relative
+	 if test -f "$f"; then
+	   # Build tree
+	   echo "$f"
+	 elif test -f "$srcdir/$f"; then
+	   # Source tree
+	   echo "$srcdir/$f"
+	 else
+	   # /dev/null tree
+	   { { echo "$as_me:$LINENO: 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; }
+
+  if test x"$ac_file" != x-; then
+    { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+    rm -f "$ac_file"
+  fi
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+  sed "$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+: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 abs_srcdir@,$ac_abs_srcdir,;t t
+s, at top_srcdir@,$ac_top_srcdir,;t t
+s, at abs_top_srcdir@,$ac_abs_top_srcdir,;t t
+s, at builddir@,$ac_builddir,;t t
+s, at abs_builddir@,$ac_abs_builddir,;t t
+s, at top_builddir@,$ac_top_builddir,;t t
+s, at abs_top_builddir@,$ac_abs_top_builddir,;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" != x-; then
+    mv $tmp/out $ac_file
+  else
+    cat $tmp/out
+    rm -f $tmp/out
+  fi
+
+done
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+#
+# CONFIG_HEADER section.
+#
+
+# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
+# NAME is the cpp macro being defined and VALUE is the value it is being given.
+#
+# ac_d sets the value in "#define NAME VALUE" lines.
+ac_dA='s,^\([	 ]*\)#\([	 ]*define[	 ][	 ]*\)'
+ac_dB='[	 ].*$,\1#\2'
+ac_dC=' '
+ac_dD=',;t'
+# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
+ac_uA='s,^\([	 ]*\)#\([	 ]*\)undef\([	 ][	 ]*\)'
+ac_uB='$,\1#\2define\3'
+ac_uC=' '
+ac_uD=',;t'
+
+for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
+  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+  case $ac_file in
+  - | *:- | *:-:* ) # input from stdin
+	cat >$tmp/stdin
+	ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+  * )   ac_file_in=$ac_file.in ;;
+  esac
+
+  test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+
+  # First look for the input files in the build tree, otherwise in the
+  # src tree.
+  ac_file_inputs=`IFS=:
+    for f in $ac_file_in; do
+      case $f in
+      -) echo $tmp/stdin ;;
+      [\\/$]*)
+	 # Absolute (can't be DOS-style, as IFS=:)
+	 test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+   { (exit 1); exit 1; }; }
+	 # Do quote $f, to prevent DOS paths from being IFS'd.
+	 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:$LINENO: 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
+
+_ACEOF
+
+# Transform confdefs.h into two sed scripts, `conftest.defines' and
+# `conftest.undefs', that substitutes the proper values into
+# config.h.in to produce config.h.  The first handles `#define'
+# templates, and the second `#undef' templates.
+# And first: Protect against being on the right side of a sed subst in
+# config.status.  Protect against being in an unquoted here document
+# in config.status.
+rm -f conftest.defines conftest.undefs
+# Using a here document instead of a string reduces the quoting nightmare.
+# Putting comments in sed scripts is not portable.
+#
+# `end' is used to avoid that the second main sed command (meant for
+# 0-ary CPP macros) applies to n-ary macro definitions.
+# See the Autoconf documentation for `clear'.
+cat >confdef2sed.sed <<\_ACEOF
+s/[\\&,]/\\&/g
+s,[\\$`],\\&,g
+t clear
+: clear
+s,^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 (][^	 (]*\)\(([^)]*)\)[	 ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
+t end
+s,^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 ][^	 ]*\)[	 ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
+: end
+_ACEOF
+# If some macros were called several times there might be several times
+# the same #defines, which is useless.  Nevertheless, we may not want to
+# sort them, since we want the *last* AC-DEFINE to be honored.
+uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines
+sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs
+rm -f confdef2sed.sed
+
+# This sed command replaces #undef with comments.  This is necessary, for
+# example, in the case of _POSIX_SOURCE, which is predefined and required
+# on some systems where configure will not decide to define it.
+cat >>conftest.undefs <<\_ACEOF
+s,^[	 ]*#[	 ]*undef[	 ][	 ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
+_ACEOF
+
+# Break up conftest.defines because some shells have a limit on the size
+# of here documents, and old seds have small limits too (100 cmds).
+echo '  # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
+echo '  if grep "^[	 ]*#[	 ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
+echo '  # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
+echo '  :' >>$CONFIG_STATUS
+rm -f conftest.tail
+while grep . conftest.defines >/dev/null
+do
+  # Write a limited-size here document to $tmp/defines.sed.
+  echo '  cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS
+  # Speed up: don't consider the non `#define' lines.
+  echo '/^[	 ]*#[	 ]*define/!b' >>$CONFIG_STATUS
+  # Work around the forget-to-reset-the-flag bug.
+  echo 't clr' >>$CONFIG_STATUS
+  echo ': clr' >>$CONFIG_STATUS
+  sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS
+  echo 'CEOF
+  sed -f $tmp/defines.sed $tmp/in >$tmp/out
+  rm -f $tmp/in
+  mv $tmp/out $tmp/in
+' >>$CONFIG_STATUS
+  sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail
+  rm -f conftest.defines
+  mv conftest.tail conftest.defines
+done
+rm -f conftest.defines
+echo '  fi # grep' >>$CONFIG_STATUS
+echo >>$CONFIG_STATUS
+
+# Break up conftest.undefs because some shells have a limit on the size
+# of here documents, and old seds have small limits too (100 cmds).
+echo '  # Handle all the #undef templates' >>$CONFIG_STATUS
+rm -f conftest.tail
+while grep . conftest.undefs >/dev/null
+do
+  # Write a limited-size here document to $tmp/undefs.sed.
+  echo '  cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS
+  # Speed up: don't consider the non `#undef'
+  echo '/^[	 ]*#[	 ]*undef/!b' >>$CONFIG_STATUS
+  # Work around the forget-to-reset-the-flag bug.
+  echo 't clr' >>$CONFIG_STATUS
+  echo ': clr' >>$CONFIG_STATUS
+  sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS
+  echo 'CEOF
+  sed -f $tmp/undefs.sed $tmp/in >$tmp/out
+  rm -f $tmp/in
+  mv $tmp/out $tmp/in
+' >>$CONFIG_STATUS
+  sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail
+  rm -f conftest.undefs
+  mv conftest.tail conftest.undefs
+done
+rm -f conftest.undefs
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+  # 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 by config.status.  */
+  if test x"$ac_file" = x-; then
+    echo "/* Generated by configure.  */" >$tmp/config.h
+  else
+    echo "/* $ac_file.  Generated by configure.  */" >$tmp/config.h
+  fi
+  cat $tmp/in >>$tmp/config.h
+  rm -f $tmp/in
+  if test x"$ac_file" != x-; then
+    if diff $ac_file $tmp/config.h >/dev/null 2>&1; then
+      { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
+echo "$as_me: $ac_file is unchanged" >&6;}
+    else
+      ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+$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 $as_mkdir_p; then
+    mkdir -p "$ac_dir"
+  else
+    as_dir="$ac_dir"
+    as_dirs=
+    while test ! -d "$as_dir"; do
+      as_dirs="$as_dir $as_dirs"
+      as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+    done
+    test ! -n "$as_dirs" || mkdir $as_dirs
+  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+   { (exit 1); exit 1; }; }; }
+
+      rm -f $ac_file
+      mv $tmp/config.h $ac_file
+    fi
+  else
+    cat $tmp/config.h
+    rm -f $tmp/config.h
+  fi
+# Compute $ac_file's index in $config_headers.
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $ac_file | $ac_file:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null ||
+$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'`/stamp-h$_am_stamp_count
+done
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+#
+# CONFIG_COMMANDS section.
+#
+for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
+  ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
+  ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
+  ac_dir=`(dirname "$ac_dest") 2>/dev/null ||
+$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$ac_dest" : 'X\(//\)[^/]' \| \
+	 X"$ac_dest" : 'X\(//\)$' \| \
+	 X"$ac_dest" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$ac_dest" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+  { if $as_mkdir_p; then
+    mkdir -p "$ac_dir"
+  else
+    as_dir="$ac_dir"
+    as_dirs=
+    while test ! -d "$as_dir"; do
+      as_dirs="$as_dir $as_dirs"
+      as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+    done
+    test ! -n "$as_dirs" || mkdir $as_dirs
+  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+   { (exit 1); exit 1; }; }; }
+
+  ac_builddir=.
+
+if test "$ac_dir" != .; then
+  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  # A "../" for each directory in $ac_dir_suffix.
+  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+  ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+  .)  # No --srcdir option.  We are building in place.
+    ac_srcdir=.
+    if test -z "$ac_top_builddir"; then
+       ac_top_srcdir=.
+    else
+       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+    fi ;;
+  [\\/]* | ?:[\\/]* )  # Absolute path.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir ;;
+  *) # Relative path.
+    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+  case "$ac_dir" in
+  .) ac_abs_builddir=`pwd`;;
+  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+  *) ac_abs_builddir=`pwd`/"$ac_dir";;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+  case ${ac_top_builddir}. in
+  .) ac_abs_top_builddir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+  case $ac_srcdir in
+  .) ac_abs_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+  esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+  case $ac_top_srcdir in
+  .) ac_abs_top_srcdir=$ac_abs_builddir;;
+  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+  esac;;
+esac
+
+
+  { echo "$as_me:$LINENO: executing $ac_dest commands" >&5
+echo "$as_me: executing $ac_dest commands" >&6;}
+  case $ac_dest in
+    depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do
+  # Strip MF so we end up with the name of the file.
+  mf=`echo "$mf" | sed -e 's/:.*$//'`
+  # Check whether this is an Automake generated Makefile or not.
+  # We used to match only the files named `Makefile.in', but
+  # some people rename them; so instead we look at the file content.
+  # Grep'ing the first line is not enough: some people post-process
+  # each Makefile.in and add a new line on top of each file to say so.
+  # So let's grep whole file.
+  if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
+    dirpart=`(dirname "$mf") 2>/dev/null ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$mf" : 'X\(//\)[^/]' \| \
+	 X"$mf" : 'X\(//\)$' \| \
+	 X"$mf" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$mf" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+  else
+    continue
+  fi
+  grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue
+  # Extract the definition of DEP_FILES from the Makefile without
+  # running `make'.
+  DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
+  test -z "$DEPDIR" && continue
+  # When using ansi2knr, U may be empty or an underscore; expand it
+  U=`sed -n -e '/^U = / s///p' < "$mf"`
+  test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
+  # We invoke sed twice because it is the simplest approach to
+  # changing $(DEPDIR) to its actual value in the expansion.
+  for file in `sed -n -e '
+    /^DEP_FILES = .*\\\\$/ {
+      s/^DEP_FILES = //
+      :loop
+	s/\\\\$//
+	p
+	n
+	/\\\\$/ b loop
+      p
+    }
+    /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
+       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+    # Make sure the directory exists.
+    test -f "$dirpart/$file" && continue
+    fdir=`(dirname "$file") 2>/dev/null ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$file" : 'X\(//\)[^/]' \| \
+	 X"$file" : 'X\(//\)$' \| \
+	 X"$file" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+    { if $as_mkdir_p; then
+    mkdir -p $dirpart/$fdir
+  else
+    as_dir=$dirpart/$fdir
+    as_dirs=
+    while test ! -d "$as_dir"; do
+      as_dirs="$as_dir $as_dirs"
+      as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| \
+	 .     : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+  	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+  	  /^X\(\/\/\)$/{ s//\1/; q; }
+  	  /^X\(\/\).*/{ s//\1/; q; }
+  	  s/.*/./; q'`
+    done
+    test ! -n "$as_dirs" || mkdir $as_dirs
+  fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5
+echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;}
+   { (exit 1); exit 1; }; }; }
+
+    # echo "creating $dirpart/$file"
+    echo '# dummy' > "$dirpart/$file"
+  done
+done
+ ;;
+  esac
+done
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+{ (exit 0); exit 0; }
+_ACEOF
+chmod +x $CONFIG_STATUS
+ac_clean_files=$ac_clean_files_save
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded.  So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status.  When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+  ac_cs_success=:
+  ac_config_status_args=
+  test "$silent" = yes &&
+    ac_config_status_args="$ac_config_status_args --quiet"
+  exec 5>/dev/null
+  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+  exec 5>>config.log
+  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+  # would make configure fail if this is the last instruction.
+  $ac_cs_success || { (exit 1); exit 1; }
+fi
+
+chmod 0444 wmbiff/wmbiffrc.5
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..e9f0626
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,183 @@
+dnl Autoconf is here to detect:
+dnl  gnutls, libgcrypt
+dnl  default ssh-askpass
+dnl and the basics X11, Xext, Xpm
+dnl and configure:
+dnl  installation prefix
+dnl  version
+
+AC_INIT(WMBiff, 0.4.26, wmbiff-devel at lists.sourceforge.net, wmbiff)
+AC_CONFIG_AUX_DIR(autoconf)
+AM_INIT_AUTOMAKE(wmbiff, 0.4.26) dnl tarded syntax for automake <= 1.5
+AM_CONFIG_HEADER(config.h)
+dnl make sure autoheader finds version, implicitly defined above.
+AH_TEMPLATE([VERSION], [wmbiff's release version])
+AC_SUBST(VERSION)
+
+AC_PROG_INSTALL
+AC_PROG_CC
+AC_PROG_RANLIB
+
+if test -n "$GCC"; then
+ CFLAGS="$CFLAGS -D_GNU_SOURCE -W -Wall -Wshadow -Wpointer-arith -Wwrite-strings"
+ AC_MSG_RESULT(adding -Wall and friends to CFLAGS.)
+fi
+
+case `(uname -s) 2>/dev/null` in
+    "Darwin")
+       CFLAGS="$CFLAGS -no-cpp-precomp"
+       AC_MSG_RESULT(adding cpp precompiler workaround for Mac OS X)
+       LDFLAGS="$LDFLAGS -framework Security"
+       AC_MSG_RESULT(adding -framework Security for Mac OS X)
+     ;;
+esac
+
+dnl a no-op to force autoconf to seek out the preprocessor now.
+AC_CHECK_HEADERS(stdio.h)
+
+dnl for IPv6 support
+AC_CHECK_FUNCS(getaddrinfo)
+
+dnl see if we can cheaply "encrypt" passwords in memory
+AC_CHECK_FUNCS(memfrob)
+
+dnl AC_CHECK_FUNC(asprintf, , VASPRINTF="vasprintf.c")
+
+dnl replacing the old USE_POLL define
+AC_CHECK_FUNCS(poll)
+
+dnl for gnutls-common.h, which defines this if missing. 
+AC_CHECK_FUNCS(inet_ntop)
+
+dnl declare RETSIGTYPE
+AC_TYPE_SIGNAL
+
+dnl solaris
+AC_CHECK_LIB(nsl, gethostbyname)
+AC_CHECK_LIB(socket, connect)
+AC_CHECK_LIB(resolv, herror)
+
+dnl Pre-gnutls.
+gnutls="ok"
+gcrypt="ok"
+AC_CHECK_LIB(z, gzopen, [], [gnutls="nope"]) dnl GNUTLS seems to need libz; fail here if it's missing.
+dnl perhaps not required anymore:
+dnl AC_CHECK_LIB(gdbm, dbminit, [], [gnutls="nope"]) dnl GNUTLS seems to need libgdbm; fail here if it's missing.
+
+dnl Parameter is minimum version
+dnl TODO: fix so that GCRYPT is tested only if GNUTLS fails; the dependence
+dnl between them makes this turn redundant
+
+AC_ARG_ENABLE(crypto, AC_HELP_STRING([ --disable-crypto ], [ disable gnutls/gcrypt ]), 
+                      [ if test $enableval != yes; then 
+                        gnutls="disabled"
+                        gcrypt="disabled"
+                       fi ])
+                      
+
+GNUTLS_MAN_STATUS="This copy of WMBiff was not compiled with GNUTLS."
+if test "$gnutls" = "ok"; then
+ AM_PATH_LIBGNUTLS(1.0.4, [LIBS="$LIBS $LIBGNUTLS_LIBS"
+                          CFLAGS="$CFLAGS $LIBGNUTLS_CFLAGS"
+                         CPPFLAGS="$CPPFLAGS $LIBGNUTLS_CFLAGS"
+                         GNUTLS_COMMON_O="gnutls-common.o"
+                         GNUTLS_MAN_STATUS="This copy of WMBiff was compiled with GNUTLS."
+                         AC_CHECK_HEADERS(gnutls/gnutls.h) ],
+                         [ echo GNUTLS can be found at ftp://gnutls.hellug.gr/pub/gnutls ])
+else
+ AC_MSG_RESULT(GNUTLS support requires libz.a and libgdbm.a, so will be disabled)
+fi
+
+GCRYPT_MAN_STATUS="This copy of WMBiff was not compiled with gcrypt."
+if test "$gcrypt" = "ok"; then
+ AM_PATH_LIBGCRYPT(1.1.90, [CFLAGS="$CFLAGS $LIBGCRYPT_CFLAGS"
+                         CPPFLAGS="$CPPFLAGS $LIBGCRYPT_CFLAGS"
+                         GCRYPT_MAN_STATUS="This copy of WMBiff was compiled with gcrypt."
+                         AC_CHECK_HEADERS(gcrypt.h) ],
+                         [ echo libgcrypt can be found at ftp://ftp.gnupg.org/pub/gcrypt/alpha/libgcrypt/ ]  )
+else
+        AC_MSG_RESULT(GCRYPT disabled.)                        
+fi;
+
+
+AC_SUBST(LIBGCRYPT_LIBS)
+AC_SUBST(GNUTLS_MAN_STATUS)
+AC_SUBST(GCRYPT_MAN_STATUS)
+AC_SUBST(GNUTLS_COMMON_O)
+
+dnl regex stuff.
+AC_CHECK_HEADERS(regex.h) dnl gnuregex.h 
+dnl no longer needed AC_CHECK_LIB(gnuregex, re_search) dnl BSD.
+
+dnl X11 stuff.
+AC_PATH_XTRA
+LIBS="$X_LIBS $LIBS"
+dnl want to get the -I flags so that later tests for include files work.
+dnl the preprocessor is used for check_headers, which doesn't use cflags.
+CPPFLAGS="$X_CFLAGS $CPPFLAGS"
+AC_CHECK_LIB(X11, XrmParseCommand)
+AC_CHECK_LIB(Xext, XextAddDisplay)
+AC_CHECK_LIB(Xpm, XpmCreateImageFromXpmImage)
+
+AC_CHECK_HEADERS(X11/xpm.h, [], [AC_CHECK_HEADERS(xpm.h, [], AC_MSG_ERROR([xpm.h is needed]))])
+dnl AM_PATH_GTK(1.2.10, , AC_MSG_WARN(Cannot find GTK: Is gtk-config in path?))
+dnl AM_PATH_GDK_PIXBUF(0.15.0, [CFLAGS="$CFLAGS $GDK_PIXBUF_CFLAGS"],
+                           dnl AC_MSG_ERROR(Cannot find gdk-pixbuf))
+dnl GNOME_INIT_HOOK([ ], failure)
+dnl GNOME_ORBIT_HOOK([GNOME_LIBS="$GNOME_LIBS $ORBIT_LIBS"
+dnl                   GNOME_CFLAGS="$GNOME_CFLAGS $ORBIT_CFLAGS"], failure)
+dnl GNOME_GNORBA_HOOK([GNOME_LIBS="$GNOME_LIBS $GNORBA_LIBS"
+dnl                   GNOME_CFLAGS="$GNOME_CFLAGS $GNORBA_CFLAGS"], failure)
+
+dnl AC_SUBST(GNOME_LIBS)
+dnl AC_SUBST(GNOME_CFLAGS)
+
+
+dnl see if __attribute__ is supported.  modified from AC_C_INLINE 
+dnl in the autoconf distribution.
+AC_DEFUN([WM_C_ATTRIBUTE],
+[AC_CACHE_CHECK([for __attribute__ support], wm_cv_c_attribute,
+[wm_cv_c_attribute=no
+AC_COMPILE_IFELSE([AC_LANG_SOURCE(
+[#ifndef __cplusplus
+typedef int foo_t;
+foo_t foo () __attribute__((unused));
+foo_t foo () {return 0; }
+#endif
+])],
+                    [wm_cv_c_attribute=yes])
+])
+case $wm_cv_c_attribute in
+  yes)AC_DEFINE(HAVE___ATTRIBUTE__, ,
+                [Define if '__attribute__' is supported by the compiler]) 
+  ;;
+esac
+])# WM_C_ATTRIBUTE
+
+WM_C_ATTRIBUTE
+
+dnl Password prompting stuff.
+AC_PATH_PROGS(DEFAULT_ASKPASS, ssh-askpass x11-ssh-askpass ssh-askpass-gnome, /usr/bin/ssh-askpass)
+AC_PATH_PROG(CVS2CL, cvs2cl)
+AC_DEFINE_UNQUOTED(DEFAULT_ASKPASS, "$DEFAULT_ASKPASS", [Program to use for querying the user for a password: redefine if not on a debian system])
+
+AC_CHECK_HEADERS(CoreServices/CoreServices.h Security/Security.h)
+
+dnl Skin files; note - this is duplicated in wmbiff/Makefile.am
+dnl haven't thought of a way around it.
+if test "x$prefix" != xNONE; then
+  SKINDIR="$prefix/share/wmbiff/skins"
+else
+  SKINDIR="$ac_default_prefix/share/wmbiff/skins"
+fi
+dnl where to install em
+AC_SUBST(SKINDIR)
+dnl where to find em
+AC_DEFINE_UNQUOTED(DEFAULT_SKIN_PATH,
+                   "$SKINDIR:/usr/share/wmbiff/skins:/usr/local/share/wmbiff/skins:.", [Path to use when finding skins (modified pixmaps)] )
+
+dnl We're done.
+AC_CONFIG_FILES(Makefile wmbiff/Makefile wmgeneral/Makefile wmbiff/wmbiffrc.5 autoconf/Makefile scripts/Makefile)
+AC_OUTPUT
+dnl remind not to write the file.
+chmod 0444 wmbiff/wmbiffrc.5
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
new file mode 100644
index 0000000..2cd7c0a
--- /dev/null
+++ b/scripts/Makefile.am
@@ -0,0 +1,2 @@
+pkglib_SCRIPTS = security.debian.rb
+EXTRA_DIST = security.debian.rb
diff --git a/scripts/Makefile.in b/scripts/Makefile.in
new file mode 100644
index 0000000..0b53f94
--- /dev/null
+++ b/scripts/Makefile.in
@@ -0,0 +1,288 @@
+# Makefile.in generated by automake 1.7.9 from Makefile.am.
+# @configure_input@
+
+# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+# Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CVS2CL = @CVS2CL@
+CYGPATH_W = @CYGPATH_W@
+DEFAULT_ASKPASS = @DEFAULT_ASKPASS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+GCRYPT_MAN_STATUS = @GCRYPT_MAN_STATUS@
+GNUTLS_COMMON_O = @GNUTLS_COMMON_O@
+GNUTLS_MAN_STATUS = @GNUTLS_MAN_STATUS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@
+LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@
+LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@
+LIBGNUTLS_CFLAGS = @LIBGNUTLS_CFLAGS@
+LIBGNUTLS_CONFIG = @LIBGNUTLS_CONFIG@
+LIBGNUTLS_LIBS = @LIBGNUTLS_LIBS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SKINDIR = @SKINDIR@
+STRIP = @STRIP@
+VERSION = @VERSION@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+bindir = @bindir@
+build_alias = @build_alias@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host_alias = @host_alias@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+pkglib_SCRIPTS = security.debian.rb
+EXTRA_DIST = security.debian.rb
+subdir = scripts
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+mkinstalldirs = $(SHELL) $(top_srcdir)/autoconf/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+SCRIPTS = $(pkglib_SCRIPTS)
+
+DIST_SOURCES =
+DIST_COMMON = $(srcdir)/Makefile.in Makefile.am
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  Makefile.am  $(top_srcdir)/configure.ac $(ACLOCAL_M4)
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu  scripts/Makefile
+Makefile:  $(srcdir)/Makefile.in  $(top_builddir)/config.status
+	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
+pkglibSCRIPT_INSTALL = $(INSTALL_SCRIPT)
+install-pkglibSCRIPTS: $(pkglib_SCRIPTS)
+	@$(NORMAL_INSTALL)
+	$(mkinstalldirs) $(DESTDIR)$(pkglibdir)
+	@list='$(pkglib_SCRIPTS)'; for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  if test -f $$d$$p; then \
+	    f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
+	    echo " $(pkglibSCRIPT_INSTALL) $$d$$p $(DESTDIR)$(pkglibdir)/$$f"; \
+	    $(pkglibSCRIPT_INSTALL) $$d$$p $(DESTDIR)$(pkglibdir)/$$f; \
+	  else :; fi; \
+	done
+
+uninstall-pkglibSCRIPTS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(pkglib_SCRIPTS)'; for p in $$list; do \
+	  f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
+	  echo " rm -f $(DESTDIR)$(pkglibdir)/$$f"; \
+	  rm -f $(DESTDIR)$(pkglibdir)/$$f; \
+	done
+uninstall-info-am:
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+
+top_distdir = ..
+distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkinstalldirs) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(SCRIPTS)
+
+installdirs:
+	$(mkinstalldirs) $(DESTDIR)$(pkglibdir)
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-pkglibSCRIPTS
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-pkglibSCRIPTS
+
+.PHONY: all all-am check check-am clean clean-generic distclean \
+	distclean-generic distdir dvi dvi-am info info-am install \
+	install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-pkglibSCRIPTS install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
+	pdf-am ps ps-am uninstall uninstall-am uninstall-info-am \
+	uninstall-pkglibSCRIPTS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/scripts/security.debian.rb b/scripts/security.debian.rb
new file mode 100755
index 0000000..e3ec366
--- /dev/null
+++ b/scripts/security.debian.rb
@@ -0,0 +1,197 @@
+#! /usr/bin/ruby
+
+# Copyright 2002 Neil Spring <nspring at cs.washington.edu> 
+# GPL
+# report bugs to wmbiff-devel at lists.sourceforge.net
+# or (preferred) use the debian BTS via 'reportbug'
+
+# Based on security-update-check.py by Rob Bradford
+
+require 'net/http'
+
+#require 'profile'
+
+# re-fetch interval - only bug the server once every hour.
+# allows wmbiff to ask us often how many packages have been
+# updated so that the number goes back to cyan (old) from
+# yellow (new) quickly on upgrade.
+
+# this still doesn't mean we grab the whole file.  we get
+# if-modified-since.  it just means we don't connect to the
+# server more often than this.
+# 6 hours * 60 min/hour * 60 sec/min
+Refetch_Interval_Sec = 6 * 60 * 60
+
+# as an ordinary user, we store Packages in the home directory.
+Cachedir = ENV['HOME'] + '/.wmbiff-sdr'
+
+# look for updates from this server.  This script is designed around
+# (and simplified greatly by) using just a single server. 
+Server = 'security.debian.org'
+
+# extend the Array class with a max method.
+class Array
+  def inject(n)
+    each { |value| n = yield(n, value) }
+    n
+  end
+  def max
+    inject(0) { |n, value| ((n > value) ? n : value) }
+  end
+end
+
+def debugmsg(str)
+  $stderr.puts str if($VERBOSE)
+end
+
+# to be reimplemented without execing touch.
+def touch(filename)
+  debugmsg "touching #{filename}"
+  Kernel.system('/usr/bin/touch ' + filename)
+end
+
+# to be reimplemented without execing dpkg, though running
+# dpkg excessively doesn't seem to be a bottleneck.
+def version_a_gt_b(a, b)
+  cmd = "/usr/bin/dpkg --compare-versions %s le %s" % [ a, b ]
+  # $stderr.puts cmd
+  return (!Kernel.system(cmd)) 
+end
+
+# figure out which lists to check
+# there can be many implementations of
+# this behavior, this seemed simplest.
+
+
+# we're going to make an array of arrays, for each package
+# file, the url, the system's cache of the file, and a
+# per-user cache of the file.
+packagelists = Dir.glob("/var/lib/apt/lists/#{Server}*Packages").map { |pkgfile|
+  [ pkgfile.gsub(/.*#{Server}/, '').tr('_','/'), # the url path 
+    pkgfile,  # the system cache of the packages file.  probably up-to-date.
+    # and finally, a user's cache of the page, if needed.
+    "%s/%s" % [ Cachedir, pkgfile.gsub(/.*#{Server}_/,'') ] 
+  ]
+}
+
+# we'll open a persistent session, but only if we need it.
+session = nil
+
+# update the user's cache if necessary.
+packagelists.each { |urlpath, sc, uc|
+  sctime = File.stat(sc).mtime
+  cached_time = 
+    if(test(?e, uc)) then
+      uctime = File.stat(uc).mtime 
+      if ( uctime < sctime ) then
+        # we have a user cache, but it is older than the system cache
+        File.unlink(uc)  # delete the obsolete user cache.
+        sctime 
+      else
+        uctime
+      end
+    else 
+      # the user cache doesn't exist, but we might have
+      # talked to the server recently.
+      if(test(?e, uc + '.stamp')) then
+        File.stat(uc + '.stamp').mtime 
+      else
+        sctime
+      end
+    end 
+  if(Time.now > cached_time + Refetch_Interval_Sec) then
+    debugmsg "fetching #{urlpath} %s > %s + %d" % [Time.now, cached_time, Refetch_Interval_Sec] 
+    begin
+      if(session == nil) then
+        session = Net::HTTP.new(Server)
+        # session.set_pipe($stderr); 
+      end
+      begin 
+        # the warning with ruby1.8 on the following line 
+        # has to do with the resp, data bit, which should
+        # eventually be replaced with (copied from the 
+        # docs with the 1.8 net/http.rb)
+        #         response = http.get('/index.html')
+        #         puts response.body
+        resp, data = session.get(urlpath, 
+                                 { 'If-Modified-Since' => 
+                                   cached_time.strftime( "%a, %d %b %Y %H:%M:%S GMT" ) })
+      rescue SocketError => e
+        # if the net is down, we'll get this error; avoid printing a stack trace.
+        puts "XX old"
+        puts e
+        exit 1;
+      rescue Timeout::Error => e
+        # if the net is down, we might get this error instead.
+        # but there is no good reason to print the specific exception. (execution expired)
+        puts "XX old"
+        exit 1;
+      end
+      test(?e, Cachedir) or Dir.mkdir(Cachedir)
+      File.open(uc, 'w') { |o| o.puts data }
+      test(?e, uc + '.stamp') and File.unlink(uc + '.stamp')  # we have a copy, don't need the stamp.
+      debugmsg "urlpath updated"
+    rescue Net::ProtoRetriableError => detail
+      head = detail.data
+      if head.code != "304"
+        raise "unexpected error occurred: " + detail
+      end
+      test(?e, Cachedir) or Dir.mkdir(Cachedir)
+      if(test(?e, uc)) then
+        touch(uc)
+      else
+        # we didn't get an update, but we don't have a cached
+        # copy in the user directory.
+        touch(uc + '.stamp')
+      end
+    end
+  else
+    debugmsg "skipping #{urlpath}"
+  end
+}
+
+available = Hash.new
+package = nil
+packagelists.each { |url, sc, uc|
+  File.open( (test(?e, uc)) ? uc : sc, 'r').each { |ln|
+    if(m = /^Package: (.*)/.match(ln)) then
+      package = m[1]
+    elsif(m = /^Version: (.*)/.match(ln)) then
+      available[package] = m[1]
+    end
+  }
+}
+
+installed = Hash.new
+package = nil
+isinstalled = false
+File.open('/var/lib/dpkg/status').each { |ln|
+  if(m = /^Package: (.*)$/.match(ln)) then
+    package = m[1]
+    isinstalled = false # reset
+  elsif(m = /^Status: install ok installed/.match(ln)) then
+    isinstalled = true
+  elsif(m = /^Version: (.*)$/.match(ln)) then
+    isinstalled && installed[package] = m[1]
+  end
+}
+
+debugmsg "%d installed, %d available" % [ installed.length, available.length ]
+
+updatedcount = 0
+updated = Array.new
+( installed.keys & available.keys ).each { |pkg|
+  if(version_a_gt_b(available[pkg], installed[pkg])) then
+    updatedcount += 1
+    updated.push(pkg + ": #{available[pkg]} > #{installed[pkg]}")
+  end
+}
+
+# we're done.  output a count in the format expected by wmbiff.
+if(updatedcount > 0) then
+  puts "%d new" % [ updatedcount ] 
+else
+  puts "%d old" % [ installed.length ] 
+end
+
+puts updated.join("\n")
diff --git a/wmbiff/Client.h b/wmbiff/Client.h
index 231f7e2..f9162e5 100644
--- a/wmbiff/Client.h
+++ b/wmbiff/Client.h
@@ -1,92 +1,131 @@
-/* $Id: Client.h,v 1.12 2002/03/12 23:53:15 bluehal Exp $ */
+/* $Id: Client.h,v 1.41 2004/06/19 20:53:01 bluehal Exp $ */
 /* Author : Scott Holden ( scotth at thezone.net )
    Modified : Yong-iL Joh ( tolkien at mizi.com )
    Modified : Jorge Garc�a ( Jorge.Garcia at uv.es )
  *
- * Email Checker Pop3/Imap4/Licq/Gicu/mbox/maildir
+ * Email Checker Pop3/Imap4/Licq/Gicu/mbox/maildir/finger
  *
- * Last Updated : Mar 20, 05:32:35 CET 2001     
+ * Last Updated : $Date: 2004/06/19 20:53:01 $
  *
  */
 
 #ifndef CLIENT
 #define CLIENT
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
 
 #include <string.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <sys/time.h>
 
-#ifdef WITH_GCRYPT
+#ifdef HAVE_GCRYPT_H
 #include <gcrypt.h>
 #endif
 
+#ifdef __LCLINT__
+typedef unsigned int off_t;
+#endif
+
+#define BUF_BIG 256
+#define BUF_SMALL 32
+#define BUF_SIZE 1024
+
+struct msglst;
 typedef struct _mbox_t *Pop3;
 typedef struct _mbox_t {
-	char label[32];				/* Printed at left; max 5 chars */
-	char path[256];				/* Path to mailbox */
-	char notify[256];			/* Program to notify mail arrivation */
-	char action[256];			/* Action to execute on mouse click */
-	char fetchcmd[256];			/* Action for mail fetching for pop3/imap */
+	char label[BUF_SMALL];		/* Printed at left; max 5 chars */
+	char path[BUF_BIG];			/* Path to mailbox */
+	char notify[BUF_BIG];		/* Program to notify mail arrivation */
+	char action[BUF_BIG];		/* Action to execute on mouse click, reduces to
+								 *  what happens on button1. this is executed after
+								 *  either actionnew or actionnonew (if they are
+								 *  defined in the config file) */
+	char actionnew[BUF_BIG];	/* Action to execute on mouse click when new mail */
+	char actionnonew[BUF_BIG];	/* Action to execute on mouse click when no new mail */
+	char actiondc[BUF_BIG];		/* Action to execute when icq is disconnected */
+	char button2[BUF_BIG];		/* What to run on button2. (middle) */
+	char fetchcmd[BUF_BIG];		/* Action for mail fetching for pop3/imap, reduces to what happens on button3 */
 	int fetchinterval;
 	int TotalMsgs;				/* Total messages in mailbox */
 	int UnreadMsgs;				/* New (unread) messages in mailbox */
 	int OldMsgs;
 	int OldUnreadMsgs;
+	char TextStatus[10];		/* if set to a string, toupper() and blit 
+								 * that string. instead of a message count */
 	int blink_stat;				/* blink digits flag-counter */
 	int debug;					/* debugging status */
 
+	struct msglst *headerCache;
+
 	union {
 		struct {
-			time_t ctime;
 			time_t mtime;
 			off_t size;
 		} mbox;
 		struct {
-			time_t ctime_new;
+			char *detail;
+		} shell;
+		struct {
 			time_t mtime_new;
 			off_t size_new;
-			time_t ctime_cur;
 			time_t mtime_cur;
 			off_t size_cur;
+			unsigned int dircache_flush:1;	/* hack to flush directory caches */
 		} maildir;
 		struct {
-			char password[32];
-			char userName[32];
-			char serverName[256];
-			int serverPort;
-			int localPort;
-			char authList[100];
-		} pop;
-		struct {
-			char password[32];
-			char userName[32];
-			char serverName[256];
+			char password[BUF_SMALL];
+			char userName[BUF_SMALL];
+			char serverName[BUF_BIG];
 			int serverPort;
 			int localPort;
 			char authList[100];
-			unsigned int dossl:1;
-		} imap;
+			unsigned int dossl:1;	/* use tls. */
+			/* prompt the user if we can't login / password is empty */
+			unsigned int interactive_password:1;
+			/* using the msglst feature, fetch the headers
+			   to have them on hand */
+			unsigned int wantCacheHeaders:1;
+			unsigned char password_len;	/* memfrob may shorten passwords */
+		} pop_imap;
 	} u;
 
-	FILE *(*open) (Pop3);
-	int (*checkMail) (Pop3);
+	int (*checkMail) ( /*@notnull@ */ Pop3);
+
+	/* collect the headers to show in a pop up */
+	struct msglst *(*getHeaders) ( /*@notnull@ */ Pop3);
+	/* allow the client to free the headers, or keep them cached */
+	void (*releaseHeaders) ( /*@notnull@ */ Pop3, struct msglst * ml);
 
 	time_t prevtime;
 	time_t prevfetch_time;
 	int loopinterval;			/* loop interval for this mailbox */
+
+	/* command to execute to get a password, if needed */
+	const char *askpass;
 } mbox_t;
 
-#define BUF_SIZE 1024
+/* creation calls must have this prototype */
+int pop3Create( /*@notnull@ */ Pop3 pc, const char *str);
+int imap4Create( /*@notnull@ */ Pop3 pc, const char *str);
+int licqCreate( /*@notnull@ */ Pop3 pc, const char *str);
+int shellCreate( /*@notnull@ */ Pop3 pc, const char *str);
+int mboxCreate( /*@notnull@ */ Pop3 pc, const char *str);
+int maildirCreate( /*@notnull@ */ Pop3 pc, const char *str);
 
 int sock_connect(const char *hostname, int port);
-int pop3Create(Pop3 pc, const char *str);
-int imap4Create(Pop3 pc, const char *str);
-int licqCreate(Pop3 pc, char *str);
-int shellCreate(Pop3 pc, const char *str);
-int mboxCreate(Pop3 pc, char *str);
-int maildirCreate(Pop3 pc, char *str);
-FILE *openMailbox(Pop3 pc);
+FILE *openMailbox(Pop3 pc, const char *mbox_filename);
+
+/* backtickExpand returns null on failure */
+/*@null@ */
+char *backtickExpand(Pop3 pc, const char *path);
+int fileHasChanged(const char *mbox_filename, time_t * atime,
+				   time_t * mtime, off_t * size);
+int grabCommandOutput(Pop3 pc, const char *command,
+					  /*@out@ */ char **output,
+					  /*@out@ *//*@null@ */ char **details);
+int exists(const char *filename);	/* test -f */
 
 /* _NONE is for silent operation.  _ERROR is for things that should
    be printed assuming that the user might possibly see them. _INFO is
@@ -101,8 +140,9 @@ FILE *openMailbox(Pop3 pc);
 #define DM(mbox, msglevel, X...) \
 do { \
   if (mbox == NULL || (mbox)->debug >= msglevel) { \
-     printf("wmbiff: " X); \
-(void)fflush(NULL); \
+     printf("wmbiff/%s ", (mbox != NULL) ? (mbox)->label : "NULL"); \
+     printf(X); \
+     (void)fflush(NULL); \
   } \
 } while(0)
 
@@ -119,7 +159,22 @@ do { \
    without requiring gcc as the compiler */
 #if !defined(__GNUC__) || __GNUC__ < 2 || \
   (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
+#ifndef __attribute__
 #define __attribute__(__x)
+#endif
 #endif							/* gnuc */
 #endif							/* client.h */
+
+#ifndef FALSE
+#define FALSE (0)
+#define TRUE (!FALSE)
+#endif
+
 /* vim:set ts=4: */
+/*
+ * Local Variables:
+ * tab-width: 4
+ * c-indent-level: 4
+ * c-basic-offset: 4
+ * End:
+ */
diff --git a/wmbiff/Imap4Client.c b/wmbiff/Imap4Client.c
index 4052d00..be5d972 100644
--- a/wmbiff/Imap4Client.c
+++ b/wmbiff/Imap4Client.c
@@ -7,48 +7,65 @@
  * modified by Jay Francis (jtf at u880.org) to support
  * CRAM-MD5 */
 
-/* get asprintf */
-#define _GNU_SOURCE
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
 
 #include "Client.h"
 #include "charutil.h"
 #include "tlsComm.h"
+#include "passwordMgr.h"
+#include "regulo.h"
+#include "MessageList.h"
 
 #include <sys/types.h>
 #include <stdio.h>
 #include <assert.h>
 #include <unistd.h>
 #include <errno.h>
+#include <time.h>
+#include <ctype.h>
+#include <strings.h>
 
 #ifdef USE_DMALLOC
 #include <dmalloc.h>
 #endif
 
-#define	PCU	(pc->u).imap
+#define	PCU	(pc->u).pop_imap
 
-#ifdef __LCLINT__
-void asprintf( /*@out@ */ char **out, char *fmt, ...);
-#endif
+extern int Relax;
 
 #define IMAP_DM(pc, lvl, args...) DM(pc, lvl, "imap4: " args)
 
+#ifdef HAVE_MEMFROB
+#define DEFROB(x) memfrob(x, x ## _len)
+#define ENFROB(x) memfrob(x, x ## _len)
+#else
+#define DEFROB(x)
+#define ENFROB(x)
+#endif
+
 /* this array maps server:port pairs to file descriptors, so
    that when more than one mailbox is queried from a server,
    we only use one socket.  It's limited in size by the
    number of different mailboxes displayed. */
 #define FDMAP_SIZE 5
 static struct fdmap_struct {
-	char *user_password_server_port;	/* tuple, in string form */
+	char *user_server_port;		/* tuple, in string form */
 	/*@owned@ */ struct connection_state *cs;
 } fdmap[FDMAP_SIZE];
 
+static void ask_user_for_password( /*@notnull@ */ Pop3 pc,
+								  int bFlushCache);
 
 /* authentication callbacks */
-#ifdef WITH_GCRYPT
-static int authenticate_md5(Pop3 pc, struct connection_state *scs,
+#ifdef HAVE_GCRYPT_H
+static int authenticate_md5( /*@notnull@ */ Pop3 pc,
+							struct connection_state *scs,
 							const char *capabilities);
 #endif
-static int authenticate_plaintext(Pop3 pc, struct connection_state *scs,
+static int authenticate_plaintext( /*@notnull@ */ Pop3 pc,
+								  struct connection_state *scs,
 								  const char *capabilities);
 
 /* the auth_methods array maps authentication identifiers
@@ -56,11 +73,12 @@ static int authenticate_plaintext(Pop3 pc, struct connection_state *scs,
 static struct imap_authentication_method {
 	const char *name;
 	/* callback returns 1 if successful, 0 if failed */
-	int (*auth_callback) (Pop3 pc, struct connection_state * scs,
+	int (*auth_callback) ( /*@notnull@ */ Pop3 pc,
+						  struct connection_state * scs,
 						  const char *capabilities);
 } auth_methods[] = {
 	{
-#ifdef WITH_GCRYPT
+#ifdef HAVE_GCRYPT_H
 	"cram-md5", authenticate_md5}, {
 #endif
 	"plaintext", authenticate_plaintext}, {
@@ -69,18 +87,20 @@ static struct imap_authentication_method {
 
 
 /* recover a socket from the connection cache */
-/*@null@*//*@dependent@ */
+/*@null@*/
+/*@dependent@*/
 static struct connection_state *state_for_pcu(Pop3 pc)
 {
 	char *connection_id;
 	struct connection_state *retval = NULL;
 	int i;
-	asprintf(&connection_id, "%s|%s|%s|%d", PCU.userName,
-			 PCU.password, PCU.serverName, PCU.serverPort);
+	connection_id =
+		malloc(strlen(PCU.userName) + strlen(PCU.serverName) + 22);
+	sprintf(connection_id, "%s|%s|%d", PCU.userName, PCU.serverName,
+			PCU.serverPort);
 	for (i = 0; i < FDMAP_SIZE; i++)
-		if (fdmap[i].user_password_server_port != NULL &&
-			(strcmp(connection_id,
-					fdmap[i].user_password_server_port) == 0)) {
+		if (fdmap[i].user_server_port != NULL &&
+			(strcmp(connection_id, fdmap[i].user_server_port) == 0)) {
 			retval = fdmap[i].cs;
 		}
 	free(connection_id);
@@ -96,8 +116,10 @@ static void bind_state_to_pcu(Pop3 pc,
 	if (scs == NULL) {
 		abort();
 	}
-	asprintf(&connection_id, "%s|%s|%s|%d", PCU.userName,
-			 PCU.password, PCU.serverName, PCU.serverPort);
+	connection_id =
+		malloc(strlen(PCU.userName) + strlen(PCU.serverName) + 22);
+	sprintf(connection_id, "%s|%s|%d", PCU.userName, PCU.serverName,
+			PCU.serverPort);
 	for (i = 0; i < FDMAP_SIZE && fdmap[i].cs != NULL; i++);
 	if (i == FDMAP_SIZE) {
 		/* should never happen */
@@ -105,15 +127,17 @@ static void bind_state_to_pcu(Pop3 pc,
 				"Tried to open too many IMAP connections. Sorry!\n");
 		exit(EXIT_FAILURE);
 	}
-	fdmap[i].user_password_server_port = connection_id;
+	fdmap[i].user_server_port = connection_id;
 	fdmap[i].cs = scs;
 }
 
 /* remove from the connection cache */
 static
-/*@owned@*//*@null@ */
-struct connection_state *unbind( /*@returned@ */ struct connection_state
-								*scs)
+/*@owned@*/
+/*@null@*/
+struct connection_state *unbind(
+/*@returned@*/ struct connection_state
+								   *scs)
 {
 	int i;
 	struct connection_state *retval = NULL;
@@ -121,7 +145,8 @@ struct connection_state *unbind( /*@returned@ */ struct connection_state
 
 	for (i = 0; i < FDMAP_SIZE && fdmap[i].cs != scs; i++);
 	if (i < FDMAP_SIZE) {
-		free(fdmap[i].user_password_server_port);
+		free(fdmap[i].user_server_port);
+		fdmap[i].user_server_port = NULL;
 		retval = fdmap[i].cs;
 		fdmap[i].cs = NULL;
 	}
@@ -133,6 +158,8 @@ struct connection_state *unbind( /*@returned@ */ struct connection_state
 /*@null@*/
 FILE *imap_open(Pop3 pc)
 {
+	static int complained_already;	/* we have to succeed once before 
+									   complaining again about failure */
 	struct connection_state *scs;
 	struct imap_authentication_method *a;
 	char *connection_name;
@@ -148,36 +175,43 @@ FILE *imap_open(Pop3 pc)
 
 	/* got this far; we're going to create a connection_state 
 	   structure, although it might be a blacklist entry */
-	asprintf(&connection_name, "%s:%d", PCU.serverName, PCU.serverPort);
+	connection_name = malloc(strlen(PCU.serverName) + 20);
+	sprintf(connection_name, "%s:%d", PCU.serverName, PCU.serverPort);
 
 	assert(pc != NULL);
 
 	/* no cached connection */
 	sd = sock_connect((const char *) PCU.serverName, PCU.serverPort);
 	if (sd == -1) {
-		IMAP_DM(pc, DEBUG_ERROR, "Couldn't connect to %s:%d: %s\n",
-				PCU.serverName, PCU.serverPort, strerror(errno));
+		if (complained_already == 0) {
+			IMAP_DM(pc, DEBUG_ERROR, "Couldn't connect to %s:%d: %s\n",
+					PCU.serverName, PCU.serverPort,
+					errno ? strerror(errno) : "");
+			complained_already = 1;
+		}
 		if (errno == ETIMEDOUT) {
-			/* only give up if it was a time-consuming error */
-			/* try again later if it was just a connection refused */
-			IMAP_DM(pc, DEBUG_ERROR,
-					"Will not retry because this attempt to connect timed out.\n"
-					" This is done so that other mailboxes can be updated in a timely manner.\n"
-					" To try again to connect to %s:%d, restart wmbiff.\n",
-					PCU.serverName, PCU.serverPort);
-			bind_state_to_pcu(pc, initialize_blacklist(connection_name));
+			/* temporarily bump the interval, in a crude way:
+			   fast forward time so that the mailbox isn't
+			   checked for a while. */
+			pc->prevtime = time(0) + 60 * 5;	/* now + 60 seconds per min * 5 minutes */
+			/* TCP's retry (how much time has elapsed while
+			   the connect times out) is around 3 minutes;
+			   here we just try to allow checking local
+			   mailboxes more often while remote things are
+			   unavailable or disconnected.  */
 		}
 		return NULL;
 	}
 
 	/* build the connection using STARTTLS */
-	if (PCU.dossl && (PCU.serverPort == 143)) {
+	if (PCU.dossl != 0 && (PCU.serverPort == 143)) {
 		/* setup an unencrypted binding long enough to invoke STARTTLS */
 		scs = initialize_unencrypted(sd, connection_name, pc);
 
 		/* can we? */
 		tlscomm_printf(scs, "a000 CAPABILITY\r\n");
-		if (!tlscomm_expect(scs, "* CAPABILITY", capabilities, BUF_SIZE))
+		if (tlscomm_expect(scs, "* CAPABILITY", capabilities, BUF_SIZE) ==
+			0)
 			goto communication_failure;
 
 		if (!strstr(capabilities, "STARTTLS")) {
@@ -190,10 +224,11 @@ FILE *imap_open(Pop3 pc)
 		IMAP_DM(pc, DEBUG_INFO, "Negotiating TLS within IMAP");
 		tlscomm_printf(scs, "a001 STARTTLS\r\n");
 
-		if (!tlscomm_expect(scs, "a001 ", buf, BUF_SIZE))
+		if (tlscomm_expect(scs, "a001 ", buf, BUF_SIZE) == 0)
 			goto communication_failure;
 
-		if (!strstr(buf, "a001 OK")) {
+		if (strstr(buf, "a001 OK") == 0) {
+			/* we didn't see the success message in the response */
 			IMAP_DM(pc, DEBUG_ERROR, "couldn't negotiate tls. :(\n");
 			goto communication_failure;
 		}
@@ -206,8 +241,8 @@ FILE *imap_open(Pop3 pc)
 
 	/* either we've negotiated ssl from starttls, or
 	   we're starting an encrypted connection now */
-	if (PCU.dossl) {
-		scs = initialize_gnutls(sd, connection_name, pc);
+	if (PCU.dossl != 0) {
+		scs = initialize_gnutls(sd, connection_name, pc, PCU.serverName);
 		if (scs == NULL) {
 			IMAP_DM(pc, DEBUG_ERROR, "Failed to initialize TLS\n");
 			return NULL;
@@ -222,7 +257,7 @@ FILE *imap_open(Pop3 pc)
 	   server will allow plain password login within an 
 	   encrypted session. */
 	tlscomm_printf(scs, "a000 CAPABILITY\r\n");
-	if (!tlscomm_expect(scs, "* CAPABILITY", capabilities, BUF_SIZE)) {
+	if (tlscomm_expect(scs, "* CAPABILITY", capabilities, BUF_SIZE) == 0) {
 		IMAP_DM(pc, DEBUG_ERROR, "unable to query capability string");
 		goto communication_failure;
 	}
@@ -230,11 +265,13 @@ FILE *imap_open(Pop3 pc)
 	/* try each authentication method in turn. */
 	for (a = auth_methods; a->name != NULL; a++) {
 		/* was it specified or did the user leave it up to us? */
-		if (PCU.authList[0] == '\0' || strstr(PCU.authList, a->name))
+		if (PCU.authList[0] == '\0'
+			|| strstr(PCU.authList, a->name) != NULL)
 			/* try the authentication method */
 			if ((a->auth_callback(pc, scs, capabilities)) != 0) {
 				/* store this well setup connection in the cache */
 				bind_state_to_pcu(pc, scs);
+				complained_already = 0;
 				return NULL;
 			}
 	}
@@ -250,32 +287,51 @@ FILE *imap_open(Pop3 pc)
 
 }
 
-int imap_checkmail(Pop3 pc)
+void imap_cacheHeaders( /*@notnull@ */ Pop3 pc);
+
+int imap_checkmail( /*@notnull@ */ Pop3 pc)
 {
 	/* recover connection state from the cache */
 	struct connection_state *scs = state_for_pcu(pc);
 	char buf[BUF_SIZE];
+	static int command_id;
 
 	/* if it's not in the cache, try to open */
 	if (scs == NULL) {
-		(void) pc->open(pc);
+		IMAP_DM(pc, DEBUG_INFO, "Need new connection to %s@%s\n",
+				PCU.userName, PCU.serverName);
+		(void) imap_open(pc);
 		scs = state_for_pcu(pc);
 	}
 	if (scs == NULL) {
 		return -1;
 	}
 
-	if (tlscomm_is_blacklisted(scs)) {
+	if (tlscomm_is_blacklisted(scs) != 0) {
 		/* unresponsive server, don't bother. */
 		return -1;
 	}
 
 	/* if we've got it by now, try the status query */
-	tlscomm_printf(scs, "a003 STATUS %s (MESSAGES UNSEEN)\r\n", pc->path);
-	if (tlscomm_expect(scs, "* STATUS", buf, 127)) {
+	command_id++;
+	tlscomm_printf(scs, "a%03d STATUS %s (MESSAGES UNSEEN)\r\n",
+				   command_id % 1000, pc->path);
+	if (tlscomm_expect(scs, "* STATUS", buf, 127) != 0) {
 		/* a valid response? */
-		(void) sscanf(buf, "* STATUS %*s (MESSAGES %d UNSEEN %d)",
-					  &(pc->TotalMsgs), &(pc->UnreadMsgs));
+		// doesn't support spaces: (void) sscanf(buf, "* STATUS %*s (MESSAGES %d UNSEEN %d)",
+		const char *msg;
+		msg = strstr(buf, "(MESSAGES");
+		if (msg != NULL)
+			(void) sscanf(msg, "(MESSAGES %d UNSEEN %d)",
+						  &(pc->TotalMsgs), &(pc->UnreadMsgs));
+		/* update the cached headers if evidence that change
+		   has occurred; not necessarily complete. */
+		if (pc->UnreadMsgs != pc->OldUnreadMsgs ||
+			pc->TotalMsgs != pc->OldMsgs) {
+			if (PCU.wantCacheHeaders) {
+				imap_cacheHeaders(pc);
+			}
+		}
 	} else {
 		/* something went wrong. bail. */
 		tlscomm_close(unbind(scs));
@@ -284,21 +340,173 @@ int imap_checkmail(Pop3 pc)
 	return 0;
 }
 
+void
+imap_releaseHeaders(Pop3 pc __attribute__ ((unused)), struct msglst *h)
+{
+	assert(h != NULL);
+	/* allow the list to be released next time around */
+	if (h->in_use <= 0) {
+		/* free the old one */
+		while (h != NULL) {
+			struct msglst *n = h->next;
+			free(h);
+			h = n;
+		}
+	} else {
+		h->in_use--;
+	}
+}
+
+void imap_cacheHeaders( /*@notnull@ */ Pop3 pc)
+{
+	struct connection_state *scs = state_for_pcu(pc);
+	char *msgid;
+	char buf[BUF_SIZE];
+
+	if (scs == NULL) {
+		(void) imap_open(pc);
+		scs = state_for_pcu(pc);
+	}
+	if (scs == NULL) {
+		return;
+	}
+	if (tlscomm_is_blacklisted(scs) != 0) {
+		return;
+	}
+
+	if (pc->headerCache != NULL) {
+		/* decrement the reference count, and free our version */
+		imap_releaseHeaders(pc, pc->headerCache);
+		pc->headerCache = NULL;
+	}
+
+	IMAP_DM(pc, DEBUG_INFO, "working headers\n");
+
+	tlscomm_printf(scs, "a004 EXAMINE %s\r\n", pc->path);
+	if (tlscomm_expect(scs, "a004 OK", buf, 127) == 0) {
+		tlscomm_close(unbind(scs));
+		return;
+	}
+	IMAP_DM(pc, DEBUG_INFO, "examine ok\n");
+
+	/* if we've got it by now, try the status query */
+	tlscomm_printf(scs, "a005 SEARCH UNSEEN\r\n");
+	if (tlscomm_expect(scs, "* SEARCH", buf, 127) == 0) {
+		tlscomm_close(unbind(scs));
+		return;
+	}
+	IMAP_DM(pc, DEBUG_INFO, "search: %s", buf);
+	if (strlen(buf) < 9)
+		return;					/* search turned up nothing */
+	msgid = strtok(buf + 9, " \r\n");
+	pc->headerCache = NULL;
+	/* the isdigit cruft is to deal with EOL */
+	if (msgid != NULL && isdigit(msgid[0]))
+		do {
+			struct msglst *m = malloc(sizeof(struct msglst));
+			char hdrbuf[128];
+			int fetch_command_done = FALSE;
+			tlscomm_printf(scs, "a04 FETCH %s (FLAGS "
+						   "BODY[HEADER.FIELDS (FROM SUBJECT)])\r\n",
+						   msgid);
+			if (tlscomm_expect(scs, "* ", hdrbuf, 127)) {
+				m->subj[0] = '\0';
+				m->from[0] = '\0';
+				while (m->subj[0] == '\0' || m->from[0] == '\0') {
+					if (tlscomm_expect(scs, "", hdrbuf, 127)) {
+						if (strncasecmp(hdrbuf, "Subject:", 8) == 0) {
+							strncpy(m->subj, hdrbuf + 9, SUBJ_LEN - 1);
+							m->subj[SUBJ_LEN - 1] = '\0';
+						} else if (strncasecmp(hdrbuf, "From: ", 5) == 0) {
+							strncpy(m->from, hdrbuf + 6, FROM_LEN - 1);
+							m->from[FROM_LEN - 1] = '\0';
+						} else if (strncasecmp
+								   (hdrbuf, "a04 OK FETCH", 5) == 0) {
+							/* server says we're done getting this header, which
+							   may occur if the message has no subject */
+							if (m->from[0] == '\0') {
+								strcpy(m->from, " ");
+							}
+							if (m->subj[0] == '\0') {
+								strcpy(m->subj, "(no subject)");
+							}
+							fetch_command_done = TRUE;
+						}
+					} else {
+						IMAP_DM(pc, DEBUG_ERROR,
+								"timedout looking for headers.: %s",
+								hdrbuf);
+						strcpy(m->from, "wmbiff");
+						strcpy(m->subj, "failure");
+					}
+				}
+				IMAP_DM(pc, DEBUG_INFO, "From: '%s' Subj: '%s'\n",
+						m->from, m->subj);
+				m->next = pc->headerCache;
+				pc->headerCache = m;
+				pc->headerCache->in_use = 0;	/* initialize that it isn't locked */
+			} else {
+				IMAP_DM(pc, DEBUG_ERROR, "error fetching: %s", hdrbuf);
+			}
+			if (!fetch_command_done) {
+				tlscomm_expect(scs, "a04 OK", hdrbuf, 127);
+			}
+		}
+		while ((msgid = strtok(NULL, " \r\n")) != NULL
+			   && isdigit(msgid[0]));
+
+	tlscomm_printf(scs, "a06 CLOSE\r\n");	/* return to polling state */
+	/*  may be unneeded tlscomm_expect(scs, "a06 OK CLOSE\r\n" );  see if it worked? */
+	IMAP_DM(pc, DEBUG_INFO, "worked headers\n");
+}
+
+/* a client is asking for the headers, hand em a reference, increase the
+   one-bit reference counter */
+struct msglst *imap_getHeaders( /*@notnull@ */ Pop3 pc)
+{
+	if (pc->headerCache == NULL)
+		imap_cacheHeaders(pc);
+	if (pc->headerCache != NULL)
+		pc->headerCache->in_use = 1;
+	return pc->headerCache;
+}
+
 /* parse the config line to setup the Pop3 structure */
-int imap4Create(Pop3 pc, const char *const str)
+int imap4Create( /*@notnull@ */ Pop3 pc, const char *const str)
 {
-	struct re_registers regs;
-	int i, matchedchars;
+	int i;
+	int matchedchars;
+	/* special characters aren't allowed in hostnames, rfc 1034 */
 	const char *regexes[] = {
-		".*imaps?:([^: ]{1,32}):([^@]{1,32})@([^/: ]+)(/[^: ]+)?(:[0-9]+)? *",
-		".*imaps?:([^: ]{1,32}) ([^ ]{1,32}) ([^/: ]+)(/[^: ]+)?( [0-9]+)? *",
+		// type : username     :   password @ hostname (/ name)?(:port)?
+		".*imaps?:([^: ]{1,32}):([^@]{0,32})@([A-Za-z1-9][-A-Za-z0-9_.]+)(/(\"[^\"]+\")|([^:@ ]+))?(:[0-9]+)?(  *([CcAaPp][-A-Za-z5 ]*))?$",
+		".*imaps?:([^: ]{1,32}) ([^ ]{1,32}) ([A-Za-z1-9][-A-Za-z0-9_.]+)(/(\"[^\"]+\")|([^: ]+))?( [0-9]+)?(  *([CcAaPp][-A-Za-z5 ]*))?$",
 		NULL
 	};
+	char *unaliased_str;
+
+	struct regulo regulos[] = {
+		{1, PCU.userName, regulo_strcpy},
+		{2, PCU.password, regulo_strcpy},
+		{3, PCU.serverName, regulo_strcpy},
+		{4, pc->path, regulo_strcpy_skip1},
+		{7, &PCU.serverPort, regulo_atoi},
+		{9, PCU.authList, regulo_strcpy_tolower},
+		{0, NULL, NULL}
+	};
+
+	if (Relax) {
+		regexes[0] =
+			".*imaps?:([^: ]{1,32}):([^@]{0,32})@([^/: ]+)(/(\"[^\"]+\")|([^:@ ]+))?(:[0-9]+)?(  *(.*))?$";
+		regexes[1] =
+			".*imaps?:([^: ]{1,32}) ([^ ]{1,32}) ([^/: ]+)(/(\"[^\"]+\")|([^: ]+))?( [0-9]+)?(  *(.*))?$";
+	}
+
 
 	/* IMAP4 format: imap:user:password at server/mailbox[:port] */
 	/* If 'str' line is badly formatted, wmbiff won't display the mailbox. */
 	if (strncmp("sslimap:", str, 8) == 0 || strncmp("imaps:", str, 6) == 0) {
-#ifdef WITH_TLS
+#ifdef HAVE_GNUTLS_GNUTLS_H
 		static int haveBeenWarned;
 		PCU.dossl = 1;
 		if (!haveBeenWarned) {
@@ -315,47 +523,63 @@ int imap4Create(Pop3 pc, const char *const str)
 			   "passwords and privacy.\n");
 		exit(EXIT_FAILURE);
 #endif
-	} else
+	} else {
 		PCU.dossl = 0;
+	}
+
+	/* defaults */
+	PCU.serverPort = (PCU.dossl != 0) ? 993 : 143;
+	PCU.authList[0] = '\0';
+
+	/* argh, str and pc->path are aliases, so we can't just write the default
+	   value into the string we're about to parse. */
+	unaliased_str = strdup(str);
+	strcpy(pc->path, "INBOX");
 
 	for (matchedchars = 0, i = 0;
 		 regexes[i] != NULL && matchedchars <= 0; i++) {
-		matchedchars = compile_and_match_regex(regexes[i], str, &regs);
+		matchedchars = regulo_match(regexes[i], unaliased_str, regulos);
 	}
 
 	/* failed to match either regex */
 	if (matchedchars <= 0) {
 		pc->label[0] = '\0';
-		IMAP_DM(pc, DEBUG_ERROR, "Couldn't parse line %s (%d)\n", str,
-				matchedchars);
+		IMAP_DM(pc, DEBUG_ERROR, "Couldn't parse line %s (%d)\n"
+				"  If this used to work, run wmbiff with the -relax option, and\n"
+				"  send mail to wmbiff-devel at lists.sourceforge.net with the hostname\n"
+				"  of your mail server.\n", unaliased_str, matchedchars);
 		return -1;
 	}
 
-	/* copy matches where they belong */
-	copy_substring(PCU.userName, regs.start[1], regs.end[1], str);
-	copy_substring(PCU.password, regs.start[2], regs.end[2], str);
-	copy_substring(PCU.serverName, regs.start[3], regs.end[3], str);
-	if (regs.start[4] != -1)
-		copy_substring(pc->path, regs.start[4] + 1, regs.end[4], str);
-	else
-		strcpy(pc->path, "INBOX");
-	if (regs.start[5] != -1)
-		PCU.serverPort = atoi(str + regs.start[5] + 1);
-	else
-		PCU.serverPort = (PCU.dossl) ? 993 : 143;
-
-	grab_authList(str + regs.end[0], PCU.authList);
+	PCU.password_len = strlen(PCU.password);
+	if (PCU.password[0] == '\0') {
+		PCU.interactive_password = 1;
+	} else {
+		ENFROB(PCU.password);
+	}
+
+	// grab_authList(unaliased_str + matchedchars, PCU.authList);
+
+	free(unaliased_str);
 
 	IMAP_DM(pc, DEBUG_INFO, "userName= '%s'\n", PCU.userName);
 	IMAP_DM(pc, DEBUG_INFO, "password is %d characters long\n",
-			strlen(PCU.password));
+			(int) PCU.password_len);
 	IMAP_DM(pc, DEBUG_INFO, "serverName= '%s'\n", PCU.serverName);
 	IMAP_DM(pc, DEBUG_INFO, "serverPath= '%s'\n", pc->path);
 	IMAP_DM(pc, DEBUG_INFO, "serverPort= '%d'\n", PCU.serverPort);
 	IMAP_DM(pc, DEBUG_INFO, "authList= '%s'\n", PCU.authList);
 
-	pc->open = imap_open;
+	if (strcmp(pc->action, "msglst") == 0 ||
+		strcmp(pc->fetchcmd, "msglst") == 0 ||
+		strcmp(pc->button2, "msglst") == 0) {
+		PCU.wantCacheHeaders = 1;
+	} else {
+		PCU.wantCacheHeaders = 0;
+	}
 	pc->checkMail = imap_checkmail;
+	pc->getHeaders = imap_getHeaders;
+	pc->releaseHeaders = imap_releaseHeaders;
 	pc->TotalMsgs = 0;
 	pc->UnreadMsgs = 0;
 	pc->OldMsgs = -1;
@@ -363,7 +587,7 @@ int imap4Create(Pop3 pc, const char *const str)
 	return 0;
 }
 
-static int authenticate_plaintext(Pop3 pc,
+static int authenticate_plaintext( /*@notnull@ */ Pop3 pc,
 								  struct connection_state *scs,
 								  const char *capabilities)
 {
@@ -378,33 +602,48 @@ static int authenticate_plaintext(Pop3 pc,
 		goto plaintext_failed;
 	}
 
-	/* login */
-	tlscomm_printf(scs, "a001 LOGIN %s \"%s\"\r\n", PCU.userName,
-				   PCU.password);
-	if (!tlscomm_expect(scs, "a001 ", buf, BUF_SIZE)) {
-		IMAP_DM(pc, DEBUG_ERROR,
-				"Did not get a response to the LOGIN command.\n");
-		goto plaintext_failed;
-	}
+	ask_user_for_password(pc, 0);
+	do {
+		/* login */
+		DEFROB(PCU.password);
+		tlscomm_printf(scs, "a001 LOGIN %s \"%s\"\r\n", PCU.userName,
+					   PCU.password);
+		ENFROB(PCU.password);
+		if (tlscomm_expect(scs, "a001 ", buf, BUF_SIZE) == 0) {
+			IMAP_DM(pc, DEBUG_ERROR,
+					"Did not get a response to the LOGIN command.\n");
+			goto plaintext_failed;
+		}
 
-	if (buf[5] != 'O') {
-		IMAP_DM(pc, DEBUG_ERROR, "IMAP Login failed.\n");
-		goto plaintext_failed;
+		if (buf[5] != 'O') {
+			IMAP_DM(pc, DEBUG_ERROR, "IMAP Login failed: %s\n", buf);
+			/* if we're prompting the user, ask again, else fail */
+			if (PCU.interactive_password) {
+				PCU.password[0] = '\0';
+				ask_user_for_password(pc, 1);	/* 1=overwrite the cache */
+			} else {
+				goto plaintext_failed;
+			}
+		} else {
+			return (1);
+		}
 	}
-	return (1);
+	while (1);
+
   plaintext_failed:
 	return (0);
 }
 
-#ifdef WITH_GCRYPT
-static int authenticate_md5(Pop3 pc,
-							struct connection_state *scs,
-							const char *capabilities)
+#ifdef HAVE_GCRYPT_H
+static int
+authenticate_md5(Pop3 pc,
+				 struct connection_state *scs, const char *capabilities)
 {
 	char buf[BUF_SIZE];
 	char buf2[BUF_SIZE];
 	unsigned char *md5;
-	GCRY_MD_HD gmh;
+	gcry_md_hd_t gmh;
+	gcry_error_t rc;
 
 	if (!strstr(capabilities, "AUTH=CRAM-MD5")) {
 		/* server doesn't support cram-md5. */
@@ -412,7 +651,7 @@ static int authenticate_md5(Pop3 pc,
 	}
 
 	tlscomm_printf(scs, "a007 AUTHENTICATE CRAM-MD5\r\n");
-	if (!tlscomm_expect(scs, "+ ", buf, BUF_SIZE))
+	if (tlscomm_expect(scs, "+ ", buf, BUF_SIZE) == 0)
 		goto expect_failure;
 
 	Decode_Base64(buf + 2, buf2);
@@ -420,8 +659,15 @@ static int authenticate_md5(Pop3 pc,
 
 	strcpy(buf, PCU.userName);
 	strcat(buf, " ");
-	gmh = gcry_md_open(GCRY_MD_MD5, GCRY_MD_FLAG_HMAC);
+	ask_user_for_password(pc, 0);
+	rc = gcry_md_open(&gmh, GCRY_MD_MD5, GCRY_MD_FLAG_HMAC);
+	if (rc != 0) {
+		IMAP_DM(pc, DEBUG_INFO, "unable to initialize gcrypt md5\n");
+		return 0;
+	}
+	DEFROB(PCU.password);
 	gcry_md_setkey(gmh, PCU.password, strlen(PCU.password));
+	ENFROB(PCU.password);
 	gcry_md_write(gmh, (unsigned char *) buf2, strlen(buf2));
 	gcry_md_final(gmh);
 	md5 = gcry_md_read(gmh, 0);
@@ -433,7 +679,7 @@ static int authenticate_md5(Pop3 pc,
 	Encode_Base64(buf, buf2);
 
 	tlscomm_printf(scs, "%s\r\n", buf2);
-	if (!tlscomm_expect(scs, "a007 ", buf, BUF_SIZE))
+	if (tlscomm_expect(scs, "a007 ", buf, BUF_SIZE) == 0)
 		goto expect_failure;
 
 	if (!strncmp(buf, "a007 OK", 7))
@@ -452,3 +698,39 @@ static int authenticate_md5(Pop3 pc,
 	return 0;
 }
 #endif
+
+static void ask_user_for_password( /*@notnull@ */ Pop3 pc, int bFlushCache)
+{
+	/* see if we already have a password, as provided in the config file, or
+	   already requested from the user. */
+	if (PCU.interactive_password) {
+		if (strlen(PCU.password) == 0) {
+			/* we need to grab the password from the user. */
+			char *password;
+			IMAP_DM(pc, DEBUG_INFO, "asking for password %d\n",
+					bFlushCache);
+			password =
+				passwordFor(PCU.userName, PCU.serverName, pc, bFlushCache);
+			if (password != NULL) {
+				if (strlen(password) + 1 > BUF_SMALL) {
+					DMA(DEBUG_ERROR, "Password is too long.\n");
+					memset(PCU.password, 0, BUF_SMALL - 1);
+				} else {
+					strncpy(PCU.password, password, BUF_SMALL - 1);
+					PCU.password_len = strlen(PCU.password);
+				}
+				free(password);
+				ENFROB(PCU.password);
+			}
+		}
+	}
+}
+
+/* vim:set ts=4: */
+/*
+ * Local Variables:
+ * tab-width: 4
+ * c-indent-level: 4
+ * c-basic-offset: 4
+ * End:
+ */
diff --git a/wmbiff/LicqClient.c b/wmbiff/LicqClient.c
index 6aa9c37..2b22af1 100644
--- a/wmbiff/LicqClient.c
+++ b/wmbiff/LicqClient.c
@@ -1,13 +1,17 @@
-/* $Id: LicqClient.c,v 1.4 2002/03/01 08:41:29 bluehal Exp $ */
+/* $Id: LicqClient.c,v 1.11 2002/06/21 04:31:31 bluehal Exp $ */
 /* Author : Yong-iL Joh ( tolkien at mizi.com )
    Modified: Jorge Garc�a ( Jorge.Garcia at uv.es )
  * 
  * LICQ checker.
  *
- * Last Updated : Mar 20, 05:32:35 CET 2001     
+ * Last Updated : $Date: 2002/06/21 04:31:31 $
  *
  */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include "Client.h"
 #include <sys/stat.h>
 #include <utime.h>
@@ -18,58 +22,46 @@
 
 #define PCM     (pc->u).mbox
 
-int licqCheckHistory(Pop3 pc)
+int licqCheckHistory( /*@notnull@ */ Pop3 pc)
 {
-	struct stat st;
 	struct utimbuf ut;
-	FILE *F;
-	int count_status = 0;
-	char buf[1024];
 
 	DM(pc, DEBUG_INFO, ">Mailbox: '%s'\n", pc->path);
 
-	/* licq file */
-	if (stat(pc->path, &st)) {
-		DM(pc, DEBUG_ERROR, "Can't stat mailbox '%s': %s\n",
-		   pc->path, strerror(errno));
-		return -1;				/* Error stating mailbox */
-	}
-
-	if (st.st_mtime != PCM.mtime || st.st_size != PCM.size
+	if (fileHasChanged(pc->path, &ut.actime, &PCM.mtime, &PCM.size) != 0
 		|| pc->OldMsgs < 0) {
-		/* file was changed OR initially read */
-		DM(pc, DEBUG_INFO,
-		   "  was changed,"
-		   " TIME: old %lu, new %lu"
-		   " SIZE: old %lu, new %lu\n",
-		   PCM.mtime, st.st_mtime, (unsigned long) PCM.size, st.st_size);
-		ut.actime = st.st_atime;
-		ut.modtime = st.st_mtime;
-		F = pc->open(pc);
+		FILE *F;
+		char buf[1024];
+		int count_status = 0;
 
+		F = openMailbox(pc, pc->path);
+		if (F == NULL)
+			return -1;
 		/* count message */
 		while (fgets(buf, BUF_SIZE, F)) {
 			if ((buf[0] == '[') || (buf[0] == '-')) {	/* new, or old licq */
 				count_status++;
 			}
 		}
+		(void) fclose(F);
+
 		pc->TotalMsgs = count_status * 2;
 		pc->UnreadMsgs = pc->TotalMsgs - count_status;
 		DM(pc, DEBUG_INFO, "from: %d status: %d\n", pc->TotalMsgs,
 		   pc->UnreadMsgs);
 
-		fclose(F);
-
+		/* Not clear that resetting the mtime is useful, as
+		   mutt is not involved.  Unfortunately, I
+		   (nspring/blueHal) can't tell whether this
+		   cut-and-pasted code is needed */
+		ut.modtime = PCM.mtime;
 		utime(pc->path, &ut);
-		/* Reset atime for MUTT and something others correctly work */
-		PCM.mtime = st.st_mtime;	/* Store new mtime */
-		PCM.size = st.st_size;	/* Store new size */
 	}
 
 	return 0;
 }
 
-int licqCreate(Pop3 pc, char *str)
+int licqCreate( /*@notnull@ */ Pop3 pc, const char *str)
 {
 	/* LICQ format: licq:fullpathname */
 
@@ -77,7 +69,6 @@ int licqCreate(Pop3 pc, char *str)
 	pc->UnreadMsgs = 0;
 	pc->OldMsgs = -1;
 	pc->OldUnreadMsgs = -1;
-	pc->open = openMailbox;
 	pc->checkMail = licqCheckHistory;
 
 	strcpy(pc->path, str + 5);	/* cut off ``licq:'' */
@@ -89,3 +80,10 @@ int licqCreate(Pop3 pc, char *str)
 }
 
 /* vim:set ts=4: */
+/*
+ * Local Variables:
+ * tab-width: 4
+ * c-indent-level: 4
+ * c-basic-offset: 4
+ * End:
+ */
diff --git a/wmbiff/Makefile b/wmbiff/Makefile
deleted file mode 100644
index 4ef3c27..0000000
--- a/wmbiff/Makefile
+++ /dev/null
@@ -1,131 +0,0 @@
-# Makefile for wmbiff
-#
-# $Id: Makefile,v 1.28 2002/03/26 16:30:32 jordi Exp $
-
-# Disable gnutls crypto?
-#WITHOUT_CRYPTO=	1
-
-# Use external GNU regexp lib?
-#EXT_GNU_REGEX_LIB=1
-
-# Use debugging?
-#DEBUG=		1
-
-PREFIX?=	/usr/local
-BINDIR?=	$(PREFIX)/bin
-MANDIR?=	$(PREFIX)/share/man
-
-CC?=		gcc
-LIBDIR?=	-L/usr/X11R6/lib
-LIBS=		-lXpm -lXext -lX11
-CFLAGS?=	-O2 -Wall -Wpointer-arith
-
-###########################################################
-# Nothing below here should need to be changed
-###########################################################
-
-WMBIFF_VERSION=	"0.3.8"
-EXTRAFLAGS=	-DWMBIFF_VERSION='$(WMBIFF_VERSION)' 
-
-# Default linux owners
-INSTALL_USER=	root
-INSTALL_GROUP=	root
-
-# Debugging
-ifdef DEBUG
-CFLAGS=		-g -Wall -Wpointer-arith -Wwrite-strings \
--W -Wtraditional -Wshadow -Wcast-qual
-#-pedantic  -Wmissing-noreturn
-endif
-
-# FreeBSD overrides
-ifeq ($(OSTYPE),FreeBSD)
-INSTALL_GROUP=	wheel
-EXT_GNU_REGEX_LIB=1
-CFLAGS+=	-I/usr/X11R6/include/
-endif
-
-# External GNU RegExp lib... needed on FreeBSD
-ifdef EXT_GNU_REGEX_LIB
-LIBS+=		-lgnuregex
-CFLAGS+=	-DEXT_GNU_REGEX_LIB
-endif
-
-# Crypto support
-ifndef WITHOUT_CRYPTO
-EXTRAFLAGS+=	-DWITH_TLS -DWITH_GCRYPT
-LIBS+=		-lgnutls -lgcrypt
-endif
-
-INSTALL?=	/usr/bin/install
-INSTALL_DIR?=	$(INSTALL) -d -o $(INSTALL_USER) -g $(INSTALL_GROUP) -m 755
-INSTALL_PRG?=	$(INSTALL) -p -o $(INSTALL_USER) -g $(INSTALL_GROUP) -m 755 -s
-INSTALL_FILE?=	$(INSTALL) -p -o $(INSTALL_USER) -g $(INSTALL_GROUP) -m 644
-
-# For malloc debug :
-#CFLAGS	+= -DUSE_DMALLOC
-#LIBS	+= -ldmalloc
-
-
-###########################################################
-# Real make stuff begins :
-###########################################################
-
-OBJS =	wmbiff.o socket.o \
-	Pop3Client.o LicqClient.o mboxClient.o \
-	maildirClient.o Imap4Client.o tlsComm.o \
-	ShellClient.o \
-	../wmgeneral/wmgeneral.o \
-	../wmgeneral/misc.o \
-	../wmgeneral/list.o \
-	charutil.o
-
-all: wmbiff
-
-Imap4Client.o: Imap4Client.c Client.h Makefile
-Pop3Client.o: Pop3Client.c Client.h Makefile
-wmbiff.o: wmbiff-master.xpm wmbiff.c Client.h
-
-.c.o:
-	$(CC) $(CFLAGS) $(EXTRAFLAGS) -c $< -o $*.o
-
-wmbiff-master.xpm:
-	ln -s wmbiff-master-led.xpm wmbiff-master.xpm
-
-wmbiff: $(OBJS)
-	$(CC) $(CFLAGS) $(EXTRAFLAGS) -o wmbiff $^ $(LIBDIR) $(LIBS)
-
-clean:
-	for i in $(OBJS) ; do \
-		rm -f $$i ; \
-	done
-	rm -f wmbiff *~ tags core wmbiff-master.xpm
-
-distclean: clean
-
-install: wmbiff
-	$(INSTALL_DIR) $(BINDIR)
-	$(INSTALL_DIR) $(MANDIR)/man1
-	$(INSTALL_DIR) $(MANDIR)/man5
-	$(INSTALL_PRG) wmbiff $(BINDIR)
-	$(INSTALL_FILE) wmbiff.1 $(MANDIR)/man1
-	$(INSTALL_FILE) wmbiffrc.5 $(MANDIR)/man5
-
-# CODING STYLE AND INDENTATION [2001-Mar-12]:
-#
-# There have been some problems with coding style in the past.  Many people
-# contributed to wmbiff (thank you!), and the code got really messy.  To help
-# resolve this, I used GNU indent with what I believe to be the most
-# widely-accepted coding style options (K&R style) with 4-space TAB indents
-# (because some of the code is highly nested) to clean up the code.  Not
-# everyone may be happy with this, but has been determined to be necessary for
-# consistency and legibility.
-#
-# In other words, make sure you run "make clean" and "make indent", and do not
-# change the options on the indent command, before you submit patches against
-# wmbiff.  This will make everyone's life easier.
-#
-#	-- Dwayne C. Litzenberger <dlitz at dlitz.net>
-indent:
-	indent -npro -kr -i4 -ts4 *.[ch] || true
-
diff --git a/wmbiff/Makefile.am b/wmbiff/Makefile.am
new file mode 100644
index 0000000..5271fe1
--- /dev/null
+++ b/wmbiff/Makefile.am
@@ -0,0 +1,70 @@
+TESTS = test_wmbiff test_tlscomm
+noinst_PROGRAMS = test_wmbiff test_tlscomm
+bin_PROGRAMS = wmbiff
+wmbiff_SOURCES = wmbiff.c socket.c Pop3Client.c LicqClient.c mboxClient.c \
+	maildirClient.c Imap4Client.c tlsComm.c tlsComm.h ShellClient.c  \
+	passwordMgr.c passwordMgr.h charutil.c charutil.h Client.h  \
+	regulo.c regulo.h  MessageList.c MessageList.h
+EXTRA_wmbiff_SOURCES = gnutls-common.c gnutls-common.h	
+wmbiff_LDADD = -L../wmgeneral -lwmgeneral @LIBGCRYPT_LIBS@ @GNUTLS_COMMON_O@
+wmbiff_DEPENDENCIES = ../wmgeneral/libwmgeneral.a Makefile @GNUTLS_COMMON_O@
+test_wmbiff_SOURCES = ShellClient.c charutil.c charutil.h Client.h \
+	test_wmbiff.c passwordMgr.c Imap4Client.c regulo.c Pop3Client.c \
+	tlsComm.c tlsComm.h socket.c 
+test_tlscomm_SOURCES = test_tlscomm.c \
+	tlsComm.c tlsComm.h 
+EXTRA_test_wmbiff_SOURCES = gnutls-common.c gnutls-common.h	
+test_wmbiff_LDADD = @LIBGCRYPT_LIBS@ 
+man_MANS = wmbiff.1 wmbiffrc.5
+skindir = $(datadir)/wmbiff/skins
+skin_DATA = wmbiff-master-led.xpm wmbiff-master-contrast.xpm 
+
+EXTRA_DIST = $(man_MANS) sample.wmbiffrc wmbiff-master-led.xpm 
+
+MAINTAINERCLEANFILES = Makefile.in
+
+# CODING STYLE AND INDENTATION [2001-Mar-12]:
+#
+# There have been some problems with coding style in the past.  Many people
+# contributed to wmbiff (thank you!), and the code got really messy.  To help
+# resolve this, I used GNU indent with what I believe to be the most
+# widely-accepted coding style options (K&R style) with 4-space TAB indents
+# (because some of the code is highly nested) to clean up the code.  Not
+# everyone may be happy with this, but has been determined to be necessary for
+# consistency and legibility.
+#
+# In other words, make sure you run "make clean" and "make indent", and do not
+# change the options on the indent command, before you submit patches against
+# wmbiff.  This will make everyone's life easier.
+#
+#	-- Dwayne C. Litzenberger <dlitz at dlitz.net>
+indent:
+	indent -npro -kr -i4 -ts4 $(wmbiff_SOURCES) test_*.c || true
+
+# to perform surgery on a few changed files.
+.c.indent:
+	indent -npro -kr -i4 -ts4 $< || true
+
+dist-hook-local: indent config-h-check
+
+distclean-local:
+	-rm -f wmbiff-master-contrast.xpm wmbiff-master.xpm
+
+# remove colors, then substitute old colors, then repalletize
+# for some reason $< doesn't always work. 
+wmbiff-master-contrast.xpm:  wmbiff-master-led.xpm Makefile
+	egrep -v '^"[:%][[:space:]]c #' < wmbiff-master-led.xpm | \
+	sed -e 's/:/./g' -e 's/%/$$/g' -e 's/ 15 / 13 /' | \
+	sed -e 's/#\([0-9A-F]\{2\}\)[0-9A-F]\{2\}\([0-9A-F]\{2\}\)[0-9A-F]\{2\}\([0-9A-F]\{2\}\)[0-9A-F]\{2\}/#\1\2\3/'\
+	> $@ || rm $@
+
+# fail if there's a .c file that doesn't include config.h
+config-h-check:
+	ls *.c | sort > cfiles
+	grep -l config.h *.c | sort | diff - cfiles
+	rm cfiles
+
+# just a reminder of how to run valgrind to get decent output.
+valgrind:
+	valgrind --leak-check=yes ./wmbiff -exit
+
diff --git a/wmbiff/Makefile.in b/wmbiff/Makefile.in
new file mode 100644
index 0000000..6b0caf3
--- /dev/null
+++ b/wmbiff/Makefile.in
@@ -0,0 +1,718 @@
+# Makefile.in generated by automake 1.7.9 from Makefile.am.
+# @configure_input@
+
+# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+# Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CVS2CL = @CVS2CL@
+CYGPATH_W = @CYGPATH_W@
+DEFAULT_ASKPASS = @DEFAULT_ASKPASS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+GCRYPT_MAN_STATUS = @GCRYPT_MAN_STATUS@
+GNUTLS_COMMON_O = @GNUTLS_COMMON_O@
+GNUTLS_MAN_STATUS = @GNUTLS_MAN_STATUS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@
+LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@
+LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@
+LIBGNUTLS_CFLAGS = @LIBGNUTLS_CFLAGS@
+LIBGNUTLS_CONFIG = @LIBGNUTLS_CONFIG@
+LIBGNUTLS_LIBS = @LIBGNUTLS_LIBS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SKINDIR = @SKINDIR@
+STRIP = @STRIP@
+VERSION = @VERSION@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+bindir = @bindir@
+build_alias = @build_alias@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host_alias = @host_alias@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+TESTS = test_wmbiff test_tlscomm
+noinst_PROGRAMS = test_wmbiff test_tlscomm
+bin_PROGRAMS = wmbiff
+wmbiff_SOURCES = wmbiff.c socket.c Pop3Client.c LicqClient.c mboxClient.c \
+	maildirClient.c Imap4Client.c tlsComm.c tlsComm.h ShellClient.c  \
+	passwordMgr.c passwordMgr.h charutil.c charutil.h Client.h  \
+	regulo.c regulo.h  MessageList.c MessageList.h
+
+EXTRA_wmbiff_SOURCES = gnutls-common.c gnutls-common.h	
+wmbiff_LDADD = -L../wmgeneral -lwmgeneral @LIBGCRYPT_LIBS@ @GNUTLS_COMMON_O@
+wmbiff_DEPENDENCIES = ../wmgeneral/libwmgeneral.a Makefile @GNUTLS_COMMON_O@
+test_wmbiff_SOURCES = ShellClient.c charutil.c charutil.h Client.h \
+	test_wmbiff.c passwordMgr.c Imap4Client.c regulo.c Pop3Client.c \
+	tlsComm.c tlsComm.h socket.c 
+
+test_tlscomm_SOURCES = test_tlscomm.c \
+	tlsComm.c tlsComm.h 
+
+EXTRA_test_wmbiff_SOURCES = gnutls-common.c gnutls-common.h	
+test_wmbiff_LDADD = @LIBGCRYPT_LIBS@ 
+man_MANS = wmbiff.1 wmbiffrc.5
+skindir = $(datadir)/wmbiff/skins
+skin_DATA = wmbiff-master-led.xpm wmbiff-master-contrast.xpm 
+
+EXTRA_DIST = $(man_MANS) sample.wmbiffrc wmbiff-master-led.xpm 
+
+MAINTAINERCLEANFILES = Makefile.in
+subdir = wmbiff
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+mkinstalldirs = $(SHELL) $(top_srcdir)/autoconf/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES = wmbiffrc.5
+bin_PROGRAMS = wmbiff$(EXEEXT)
+noinst_PROGRAMS = test_wmbiff$(EXEEXT) test_tlscomm$(EXEEXT)
+PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS)
+
+am_test_tlscomm_OBJECTS = test_tlscomm.$(OBJEXT) tlsComm.$(OBJEXT)
+test_tlscomm_OBJECTS = $(am_test_tlscomm_OBJECTS)
+test_tlscomm_LDADD = $(LDADD)
+test_tlscomm_DEPENDENCIES =
+test_tlscomm_LDFLAGS =
+am_test_wmbiff_OBJECTS = ShellClient.$(OBJEXT) charutil.$(OBJEXT) \
+	test_wmbiff.$(OBJEXT) passwordMgr.$(OBJEXT) \
+	Imap4Client.$(OBJEXT) regulo.$(OBJEXT) Pop3Client.$(OBJEXT) \
+	tlsComm.$(OBJEXT) socket.$(OBJEXT)
+test_wmbiff_OBJECTS = $(am_test_wmbiff_OBJECTS)
+test_wmbiff_DEPENDENCIES =
+test_wmbiff_LDFLAGS =
+am_wmbiff_OBJECTS = wmbiff.$(OBJEXT) socket.$(OBJEXT) \
+	Pop3Client.$(OBJEXT) LicqClient.$(OBJEXT) mboxClient.$(OBJEXT) \
+	maildirClient.$(OBJEXT) Imap4Client.$(OBJEXT) tlsComm.$(OBJEXT) \
+	ShellClient.$(OBJEXT) passwordMgr.$(OBJEXT) charutil.$(OBJEXT) \
+	regulo.$(OBJEXT) MessageList.$(OBJEXT)
+wmbiff_OBJECTS = $(am_wmbiff_OBJECTS)
+wmbiff_LDFLAGS =
+
+DEFAULT_INCLUDES =  -I. -I$(srcdir) -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/autoconf/depcomp
+am__depfiles_maybe = depfiles
+ at AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/Imap4Client.Po \
+ at AMDEP_TRUE@	./$(DEPDIR)/LicqClient.Po \
+ at AMDEP_TRUE@	./$(DEPDIR)/MessageList.Po \
+ at AMDEP_TRUE@	./$(DEPDIR)/Pop3Client.Po \
+ at AMDEP_TRUE@	./$(DEPDIR)/ShellClient.Po ./$(DEPDIR)/charutil.Po \
+ at AMDEP_TRUE@	./$(DEPDIR)/gnutls-common.Po \
+ at AMDEP_TRUE@	./$(DEPDIR)/maildirClient.Po \
+ at AMDEP_TRUE@	./$(DEPDIR)/mboxClient.Po \
+ at AMDEP_TRUE@	./$(DEPDIR)/passwordMgr.Po ./$(DEPDIR)/regulo.Po \
+ at AMDEP_TRUE@	./$(DEPDIR)/socket.Po ./$(DEPDIR)/test_tlscomm.Po \
+ at AMDEP_TRUE@	./$(DEPDIR)/test_wmbiff.Po ./$(DEPDIR)/tlsComm.Po \
+ at AMDEP_TRUE@	./$(DEPDIR)/wmbiff.Po
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+DIST_SOURCES = $(test_tlscomm_SOURCES) $(test_wmbiff_SOURCES) \
+	$(EXTRA_test_wmbiff_SOURCES) $(wmbiff_SOURCES) \
+	$(EXTRA_wmbiff_SOURCES)
+
+NROFF = nroff
+MANS = $(man_MANS)
+DATA = $(skin_DATA)
+
+DIST_COMMON = $(srcdir)/Makefile.in Makefile.am wmbiffrc.5.in
+SOURCES = $(test_tlscomm_SOURCES) $(test_wmbiff_SOURCES) $(EXTRA_test_wmbiff_SOURCES) $(wmbiff_SOURCES) $(EXTRA_wmbiff_SOURCES)
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .indent .o .obj
+$(srcdir)/Makefile.in:  Makefile.am  $(top_srcdir)/configure.ac $(ACLOCAL_M4)
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu  wmbiff/Makefile
+Makefile:  $(srcdir)/Makefile.in  $(top_builddir)/config.status
+	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
+wmbiffrc.5: $(top_builddir)/config.status wmbiffrc.5.in
+	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+install-binPROGRAMS: $(bin_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	$(mkinstalldirs) $(DESTDIR)$(bindir)
+	@list='$(bin_PROGRAMS)'; for p in $$list; do \
+	  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  if test -f $$p \
+	  ; then \
+	    f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+	   echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \
+	   $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f || exit 1; \
+	  else :; fi; \
+	done
+
+uninstall-binPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(bin_PROGRAMS)'; for p in $$list; do \
+	  f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+	  echo " rm -f $(DESTDIR)$(bindir)/$$f"; \
+	  rm -f $(DESTDIR)$(bindir)/$$f; \
+	done
+
+clean-binPROGRAMS:
+	-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+
+clean-noinstPROGRAMS:
+	-test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
+test_tlscomm$(EXEEXT): $(test_tlscomm_OBJECTS) $(test_tlscomm_DEPENDENCIES) 
+	@rm -f test_tlscomm$(EXEEXT)
+	$(LINK) $(test_tlscomm_LDFLAGS) $(test_tlscomm_OBJECTS) $(test_tlscomm_LDADD) $(LIBS)
+test_wmbiff$(EXEEXT): $(test_wmbiff_OBJECTS) $(test_wmbiff_DEPENDENCIES) 
+	@rm -f test_wmbiff$(EXEEXT)
+	$(LINK) $(test_wmbiff_LDFLAGS) $(test_wmbiff_OBJECTS) $(test_wmbiff_LDADD) $(LIBS)
+wmbiff$(EXEEXT): $(wmbiff_OBJECTS) $(wmbiff_DEPENDENCIES) 
+	@rm -f wmbiff$(EXEEXT)
+	$(LINK) $(wmbiff_LDFLAGS) $(wmbiff_OBJECTS) $(wmbiff_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT) core *.core
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Imap4Client.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/LicqClient.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/MessageList.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/Pop3Client.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ShellClient.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/charutil.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gnutls-common.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/maildirClient.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mboxClient.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/passwordMgr.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/regulo.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/socket.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test_tlscomm.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test_wmbiff.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/tlsComm.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/wmbiff.Po at am__quote@
+
+.c.o:
+ at am__fastdepCC_TRUE@	if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
+ at am__fastdepCC_TRUE@	  -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
+ at am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
+ at am__fastdepCC_TRUE@	else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
+ at am__fastdepCC_TRUE@	fi
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$<
+
+.c.obj:
+ at am__fastdepCC_TRUE@	if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
+ at am__fastdepCC_TRUE@	  -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \
+ at am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
+ at am__fastdepCC_TRUE@	else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
+ at am__fastdepCC_TRUE@	fi
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`
+uninstall-info-am:
+
+man1dir = $(mandir)/man1
+install-man1: $(man1_MANS) $(man_MANS)
+	@$(NORMAL_INSTALL)
+	$(mkinstalldirs) $(DESTDIR)$(man1dir)
+	@list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
+	l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
+	for i in $$l2; do \
+	  case "$$i" in \
+	    *.1*) list="$$list $$i" ;; \
+	  esac; \
+	done; \
+	for i in $$list; do \
+	  if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
+	  else file=$$i; fi; \
+	  ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+	  case "$$ext" in \
+	    1*) ;; \
+	    *) ext='1' ;; \
+	  esac; \
+	  inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+	  inst=`echo $$inst | sed -e 's/^.*\///'`; \
+	  inst=`echo $$inst | sed '$(transform)'`.$$ext; \
+	  echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \
+	  $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \
+	done
+uninstall-man1:
+	@$(NORMAL_UNINSTALL)
+	@list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
+	l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
+	for i in $$l2; do \
+	  case "$$i" in \
+	    *.1*) list="$$list $$i" ;; \
+	  esac; \
+	done; \
+	for i in $$list; do \
+	  ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+	  case "$$ext" in \
+	    1*) ;; \
+	    *) ext='1' ;; \
+	  esac; \
+	  inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+	  inst=`echo $$inst | sed -e 's/^.*\///'`; \
+	  inst=`echo $$inst | sed '$(transform)'`.$$ext; \
+	  echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \
+	  rm -f $(DESTDIR)$(man1dir)/$$inst; \
+	done
+
+man5dir = $(mandir)/man5
+install-man5: $(man5_MANS) $(man_MANS)
+	@$(NORMAL_INSTALL)
+	$(mkinstalldirs) $(DESTDIR)$(man5dir)
+	@list='$(man5_MANS) $(dist_man5_MANS) $(nodist_man5_MANS)'; \
+	l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
+	for i in $$l2; do \
+	  case "$$i" in \
+	    *.5*) list="$$list $$i" ;; \
+	  esac; \
+	done; \
+	for i in $$list; do \
+	  if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
+	  else file=$$i; fi; \
+	  ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+	  case "$$ext" in \
+	    5*) ;; \
+	    *) ext='5' ;; \
+	  esac; \
+	  inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+	  inst=`echo $$inst | sed -e 's/^.*\///'`; \
+	  inst=`echo $$inst | sed '$(transform)'`.$$ext; \
+	  echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man5dir)/$$inst"; \
+	  $(INSTALL_DATA) $$file $(DESTDIR)$(man5dir)/$$inst; \
+	done
+uninstall-man5:
+	@$(NORMAL_UNINSTALL)
+	@list='$(man5_MANS) $(dist_man5_MANS) $(nodist_man5_MANS)'; \
+	l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
+	for i in $$l2; do \
+	  case "$$i" in \
+	    *.5*) list="$$list $$i" ;; \
+	  esac; \
+	done; \
+	for i in $$list; do \
+	  ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+	  case "$$ext" in \
+	    5*) ;; \
+	    *) ext='5' ;; \
+	  esac; \
+	  inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+	  inst=`echo $$inst | sed -e 's/^.*\///'`; \
+	  inst=`echo $$inst | sed '$(transform)'`.$$ext; \
+	  echo " rm -f $(DESTDIR)$(man5dir)/$$inst"; \
+	  rm -f $(DESTDIR)$(man5dir)/$$inst; \
+	done
+skinDATA_INSTALL = $(INSTALL_DATA)
+install-skinDATA: $(skin_DATA)
+	@$(NORMAL_INSTALL)
+	$(mkinstalldirs) $(DESTDIR)$(skindir)
+	@list='$(skin_DATA)'; for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  f="`echo $$p | sed -e 's|^.*/||'`"; \
+	  echo " $(skinDATA_INSTALL) $$d$$p $(DESTDIR)$(skindir)/$$f"; \
+	  $(skinDATA_INSTALL) $$d$$p $(DESTDIR)$(skindir)/$$f; \
+	done
+
+uninstall-skinDATA:
+	@$(NORMAL_UNINSTALL)
+	@list='$(skin_DATA)'; for p in $$list; do \
+	  f="`echo $$p | sed -e 's|^.*/||'`"; \
+	  echo " rm -f $(DESTDIR)$(skindir)/$$f"; \
+	  rm -f $(DESTDIR)$(skindir)/$$f; \
+	done
+
+ETAGS = etags
+ETAGSFLAGS =
+
+CTAGS = ctags
+CTAGSFLAGS =
+
+tags: TAGS
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(ETAGS_ARGS)$$tags$$unique" \
+	  || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	     $$tags $$unique
+
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+check-TESTS: $(TESTS)
+	@failed=0; all=0; xfail=0; xpass=0; skip=0; \
+	srcdir=$(srcdir); export srcdir; \
+	list='$(TESTS)'; \
+	if test -n "$$list"; then \
+	  for tst in $$list; do \
+	    if test -f ./$$tst; then dir=./; \
+	    elif test -f $$tst; then dir=; \
+	    else dir="$(srcdir)/"; fi; \
+	    if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
+	      all=`expr $$all + 1`; \
+	      case " $(XFAIL_TESTS) " in \
+	      *" $$tst "*) \
+	        xpass=`expr $$xpass + 1`; \
+	        failed=`expr $$failed + 1`; \
+	        echo "XPASS: $$tst"; \
+	      ;; \
+	      *) \
+	        echo "PASS: $$tst"; \
+	      ;; \
+	      esac; \
+	    elif test $$? -ne 77; then \
+	      all=`expr $$all + 1`; \
+	      case " $(XFAIL_TESTS) " in \
+	      *" $$tst "*) \
+	        xfail=`expr $$xfail + 1`; \
+	        echo "XFAIL: $$tst"; \
+	      ;; \
+	      *) \
+	        failed=`expr $$failed + 1`; \
+	        echo "FAIL: $$tst"; \
+	      ;; \
+	      esac; \
+	    else \
+	      skip=`expr $$skip + 1`; \
+	      echo "SKIP: $$tst"; \
+	    fi; \
+	  done; \
+	  if test "$$failed" -eq 0; then \
+	    if test "$$xfail" -eq 0; then \
+	      banner="All $$all tests passed"; \
+	    else \
+	      banner="All $$all tests behaved as expected ($$xfail expected failures)"; \
+	    fi; \
+	  else \
+	    if test "$$xpass" -eq 0; then \
+	      banner="$$failed of $$all tests failed"; \
+	    else \
+	      banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \
+	    fi; \
+	  fi; \
+	  dashes="$$banner"; \
+	  skipped=""; \
+	  if test "$$skip" -ne 0; then \
+	    skipped="($$skip tests were not run)"; \
+	    test `echo "$$skipped" | wc -c` -gt `echo "$$banner" | wc -c` && \
+	      dashes="$$skipped"; \
+	  fi; \
+	  report=""; \
+	  if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
+	    report="Please report to $(PACKAGE_BUGREPORT)"; \
+	    test `echo "$$report" | wc -c` -gt `echo "$$banner" | wc -c` && \
+	      dashes="$$report"; \
+	  fi; \
+	  dashes=`echo "$$dashes" | sed s/./=/g`; \
+	  echo "$$dashes"; \
+	  echo "$$banner"; \
+	  test -n "$$skipped" && echo "$$skipped"; \
+	  test -n "$$report" && echo "$$report"; \
+	  echo "$$dashes"; \
+	  test "$$failed" -eq 0; \
+	else :; fi
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+
+top_distdir = ..
+distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkinstalldirs) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+	$(MAKE) $(AM_MAKEFLAGS) check-TESTS
+check: check-am
+all-am: Makefile $(PROGRAMS) $(MANS) $(DATA)
+
+installdirs:
+	$(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(man1dir) $(DESTDIR)$(man5dir) $(DESTDIR)$(skindir)
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+	-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+clean: clean-am
+
+clean-am: clean-binPROGRAMS clean-generic clean-noinstPROGRAMS \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-local distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-man install-skinDATA
+
+install-exec-am: install-binPROGRAMS
+
+install-info: install-info-am
+
+install-man: install-man1 install-man5
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS uninstall-info-am uninstall-man \
+	uninstall-skinDATA
+
+uninstall-man: uninstall-man1 uninstall-man5
+
+.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \
+	clean-binPROGRAMS clean-generic clean-noinstPROGRAMS ctags \
+	distclean distclean-compile distclean-generic distclean-local \
+	distclean-tags distdir dvi dvi-am info info-am install \
+	install-am install-binPROGRAMS install-data install-data-am \
+	install-exec install-exec-am install-info install-info-am \
+	install-man install-man1 install-man5 install-skinDATA \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-binPROGRAMS \
+	uninstall-info-am uninstall-man uninstall-man1 uninstall-man5 \
+	uninstall-skinDATA
+
+
+# CODING STYLE AND INDENTATION [2001-Mar-12]:
+#
+# There have been some problems with coding style in the past.  Many people
+# contributed to wmbiff (thank you!), and the code got really messy.  To help
+# resolve this, I used GNU indent with what I believe to be the most
+# widely-accepted coding style options (K&R style) with 4-space TAB indents
+# (because some of the code is highly nested) to clean up the code.  Not
+# everyone may be happy with this, but has been determined to be necessary for
+# consistency and legibility.
+#
+# In other words, make sure you run "make clean" and "make indent", and do not
+# change the options on the indent command, before you submit patches against
+# wmbiff.  This will make everyone's life easier.
+#
+#	-- Dwayne C. Litzenberger <dlitz at dlitz.net>
+indent:
+	indent -npro -kr -i4 -ts4 $(wmbiff_SOURCES) test_*.c || true
+
+# to perform surgery on a few changed files.
+.c.indent:
+	indent -npro -kr -i4 -ts4 $< || true
+
+dist-hook-local: indent config-h-check
+
+distclean-local:
+	-rm -f wmbiff-master-contrast.xpm wmbiff-master.xpm
+
+# remove colors, then substitute old colors, then repalletize
+# for some reason $< doesn't always work. 
+wmbiff-master-contrast.xpm:  wmbiff-master-led.xpm Makefile
+	egrep -v '^"[:%][[:space:]]c #' < wmbiff-master-led.xpm | \
+	sed -e 's/:/./g' -e 's/%/$$/g' -e 's/ 15 / 13 /' | \
+	sed -e 's/#\([0-9A-F]\{2\}\)[0-9A-F]\{2\}\([0-9A-F]\{2\}\)[0-9A-F]\{2\}\([0-9A-F]\{2\}\)[0-9A-F]\{2\}/#\1\2\3/'\
+	> $@ || rm $@
+
+# fail if there's a .c file that doesn't include config.h
+config-h-check:
+	ls *.c | sort > cfiles
+	grep -l config.h *.c | sort | diff - cfiles
+	rm cfiles
+
+# just a reminder of how to run valgrind to get decent output.
+valgrind:
+	valgrind --leak-check=yes ./wmbiff -exit
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/wmbiff/MessageList.c b/wmbiff/MessageList.c
new file mode 100644
index 0000000..76d47b0
--- /dev/null
+++ b/wmbiff/MessageList.c
@@ -0,0 +1,232 @@
+#include "Client.h"
+#include "MessageList.h"
+#include <X11/Xlib.h>
+#ifdef HAVE_X11_XPM_H
+#include <X11/xpm.h>
+#endif
+#ifdef HAVE_XPM_H
+#include <xpm.h>
+#endif
+#include <X11/Xutil.h>			/* needed for Region on solaris? */
+#include <assert.h>
+
+#define min(a,b) ((a)<(b) ? (a) : (b))
+#define max(a,b) ((a)>(b) ? (a) : (b))
+#define LEFT_MAR 6
+#define RIGHT_MAR 6
+#define COL_SEP 4
+
+extern Display *display;
+extern Window Root;
+extern int screen;
+extern int x_fd;
+extern int d_depth;
+extern Window win;
+
+static XSizeHints mysizehints;
+extern Pixel back_pix, fore_pix;
+static Window newwin;
+static GC localGC;
+extern Pixel GetColor(const char *name);
+
+static XFontStruct *fn;
+static int fontHeight;
+extern const char *foreground;
+extern const char *background;
+
+Pop3 Active_pc;
+
+static int loadFont(const char *fontname)
+{
+	if (display != NULL) {
+		fn = XLoadQueryFont(display, fontname);
+		if (fn) {
+			XSetFont(display, localGC, fn->fid);
+			fontHeight =
+				fn->max_bounds.ascent + fn->max_bounds.descent + 2;
+			return 0;
+		} else {
+			printf("couldn't set font! (%s)\n", fontname);
+		}
+	}
+
+	return -1;
+}
+
+static int flush_expose(Window w)
+{
+	XEvent dummy;
+	int i = 0;
+
+	while (XCheckTypedWindowEvent(display, w, Expose, &dummy))
+		i++;
+
+	return i;
+}
+
+struct msglst *Headers;
+void msglst_show(Pop3 pc, int x, int y)
+{
+	int maxfrm = 0;
+	int maxsubj = 0;
+	int limit = 10;
+	XGCValues gcv;
+	unsigned long gcm;
+
+	Active_pc = pc;				/* hold so we can release later. */
+
+	/* local gc */
+	gcm = GCForeground | GCBackground | GCGraphicsExposures;
+	gcv.foreground = GetColor(foreground);
+	gcv.background = GetColor(background);
+	gcv.graphics_exposures = 0;
+	localGC = XCreateGC(display, Root, gcm, &gcv);
+
+	if (fn == NULL) {
+		/* loadFont? or use a proportional instead?  mmm. */
+		if (loadFont("-*-fixed-*-r-*-*-10-*-*-*-*-*-*-*") < 0) {
+			return;
+		}
+	}
+	if (pc->getHeaders == NULL) {
+		DM(pc, DEBUG_INFO, "no getHeaders callback\n");
+		return;
+	}
+	Headers = pc->getHeaders(pc);
+	if (Headers == NULL) {
+#define NO_MSG "no new messages"
+		mysizehints.height = 5 + fontHeight;
+		mysizehints.width = XTextWidth(fn, NO_MSG, strlen(NO_MSG));
+		DM(pc, DEBUG_INFO, "no new messages\n");
+	} else {
+		struct msglst *h;
+		mysizehints.height = 5;
+		for (h = Headers; h != NULL && limit > 0; h = h->next, limit--) {
+			int frmlen;
+			char *c;
+			int subjlen;
+
+			if ((c = index(h->from, '\r')) != NULL) {
+				*c = '\0';		/* chomp newlines */
+			}
+			if ((c = index(h->subj, '\r')) != NULL) {
+				*c = '\0';		/* chomp newlines */
+			}
+
+			if ((c = index(h->from, '<')) != NULL) {
+				*c = '\0';		/* chomp <foo at bar */
+			}
+			if (h->from[0] == '"') {	/* remove "'s */
+				for (c = &h->from[1]; *c && *c != '"'; c++) {
+					*(c - 1) = *c;
+				}
+				*(c - 1) = '\0';
+			}
+
+
+			subjlen = XTextWidth(fn, h->subj, strlen(h->subj));
+			frmlen = XTextWidth(fn, h->from, strlen(h->from));
+			if (frmlen > maxfrm) {
+				maxfrm = frmlen;
+			}
+			if (subjlen > maxsubj) {
+				maxsubj = subjlen;
+			}
+			mysizehints.height += fontHeight;
+		}
+		mysizehints.width =
+			maxfrm + maxsubj + LEFT_MAR + RIGHT_MAR + COL_SEP;
+	}
+
+	/* Create a window to hold the stuff */
+	mysizehints.flags = USSize | USPosition;
+	mysizehints.x = max(x - mysizehints.width, 0);
+	mysizehints.y = max(y - mysizehints.height, 0);
+
+	newwin =
+		XCreateSimpleWindow(display, Root, mysizehints.x, mysizehints.y,
+							mysizehints.width, mysizehints.height, 2,
+							gcv.foreground, gcv.background);
+	XSetWMNormalHints(display, newwin, &mysizehints);
+	XStoreName(display, newwin, pc->label);
+	XSelectInput(display, newwin, ExposureMask);
+
+	{							/* I confess I don't know what this does or whether it matters */
+		XSetWindowAttributes xswa;
+		xswa.backing_store = Always;
+		xswa.bit_gravity = CenterGravity;
+		XChangeWindowAttributes(display, newwin,
+								CWBackingStore | CWBitGravity, &xswa);
+	}
+
+	XMapWindow(display, newwin);
+}
+
+/* may be called without the window open */
+void msglst_hide(void)
+{
+	if (newwin) {
+		flush_expose(newwin);	/* swallow the messages */
+		XDestroyWindow(display, newwin);
+		//   } else {
+		// no window fprintf(stderr, "unexpected error destroying msglist window\n");
+		if (Active_pc->releaseHeaders != NULL && Headers != NULL) {
+			Active_pc->releaseHeaders(Active_pc, Headers);
+		}
+		newwin = 0;
+	}
+}
+
+void msglst_redraw(void)
+{
+	XEvent dummy;
+	unsigned int width, height;
+	unsigned int bw, d;
+	int x, y;
+	Window r;
+
+	if (newwin == 0) {
+		return;
+	}
+
+	while (XCheckTypedWindowEvent(display, newwin, Expose, &dummy));
+	XGetGeometry(display, newwin, &r, &x, &y, &width, &height, &bw, &d);
+
+	XSetForeground(display, localGC, GetColor(background));
+	XFillRectangle(display, newwin, localGC, 0, 0, width, height);
+
+	XSetForeground(display, localGC, GetColor(foreground));
+	XSetBackground(display, localGC, GetColor(background));
+
+	if (Headers == NULL) {
+		XDrawString(display, newwin, localGC, 0, fontHeight,
+					NO_MSG, strlen(NO_MSG));
+		flush_expose(newwin);
+	} else {
+		int linenum;
+		struct msglst *h;
+		int limit = 10;
+		int maxfrm = 0;
+
+		/* draw the from lines */
+		for (h = Headers, linenum = 0; h != NULL && linenum < limit;
+			 h = h->next, linenum++) {
+			int frm = XTextWidth(fn, h->from, strlen(h->from));
+			if (frm > maxfrm) {
+				maxfrm = frm;
+			}
+			XDrawString(display, newwin, localGC, LEFT_MAR,
+						(linenum + 1) * fontHeight, h->from,
+						strlen(h->from));
+		}
+
+		/* draw the subject lines */
+		for (h = Headers, linenum = 0; h != NULL && linenum < limit;
+			 h = h->next, linenum++) {
+			XDrawString(display, newwin, localGC,
+						LEFT_MAR + maxfrm + COL_SEP,
+						(linenum + 1) * fontHeight, h->subj,
+						strlen(h->subj));
+		}
+	}
+}
diff --git a/wmbiff/MessageList.h b/wmbiff/MessageList.h
new file mode 100644
index 0000000..1889615
--- /dev/null
+++ b/wmbiff/MessageList.h
@@ -0,0 +1,13 @@
+
+#define SUBJ_LEN 50
+#define FROM_LEN 22
+struct msglst {
+	struct msglst *next;
+	char subj[SUBJ_LEN];
+	char from[FROM_LEN];
+	unsigned int in_use:1;
+};
+
+void msglst_show(Pop3 pc, int x, int y);
+void msglst_hide(void);
+void msglst_redraw(void);
diff --git a/wmbiff/Pop3Client.c b/wmbiff/Pop3Client.c
index 0508c82..dd138db 100644
--- a/wmbiff/Pop3Client.c
+++ b/wmbiff/Pop3Client.c
@@ -1,4 +1,4 @@
-/* $Id: Pop3Client.c,v 1.9 2002/03/12 23:53:15 bluehal Exp $ */
+/* $Id: Pop3Client.c,v 1.22 2004/06/19 20:53:01 bluehal Exp $ */
 /* Author : Scott Holden ( scotth at thezone.net )
    Modified : Yong-iL Joh ( tolkien at mizi.com )
    Modified : Jorge Garc�a ( Jorge.Garcia at uv.es )
@@ -10,22 +10,41 @@
  * Last Updated : Tue Nov 13 13:45:23 PST 2001
  *
  */
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
 
 #include "Client.h"
 #include "charutil.h"
+#include "regulo.h"
+#include "MessageList.h"
+#include <strings.h>
 
 #ifdef USE_DMALLOC
 #include <dmalloc.h>
 #endif
 
-#define	PCU	(pc->u).pop
+extern int Relax;
+
+#define	PCU	(pc->u).pop_imap
 #define POP_DM(pc, lvl, args...) DM(pc, lvl, "pop3: " args)
 
-#ifdef WITH_GCRYPT
-static FILE *authenticate_md5(Pop3 pc, FILE * fp, char *unused);
-static FILE *authenticate_apop(Pop3 pc, FILE * fp, char *apop_str);
+#ifdef HAVE_GCRYPT_H
+static FILE *authenticate_md5( /*@notnull@ */ Pop3 pc, FILE * fp,
+							  char *unused);
+static FILE *authenticate_apop( /*@notnull@ */ Pop3 pc, FILE * fp,
+							   char *apop_str);
 #endif
-static FILE *authenticate_plaintext(Pop3 pc, FILE * fp, char *unused);
+static FILE *authenticate_plaintext( /*@notnull@ */ Pop3 pc, FILE * fp,
+									char *unused);
+
+void pop3_cacheHeaders( /*@notnull@ */ Pop3 pc);
+
+extern void imap_releaseHeaders(Pop3 pc
+								__attribute__ ((unused)),
+								struct msglst *h);
+
+extern struct connection_state *state_for_pcu(Pop3 pc);
 
 static struct authentication_method {
 	const char *name;
@@ -34,7 +53,7 @@ static struct authentication_method {
 	FILE *(*auth_callback) (Pop3 pc, FILE * fp, char *apop_str);
 } auth_methods[] = {
 	{
-#ifdef WITH_GCRYPT
+#ifdef HAVE_GCRYPT_H
 	"cram-md5", authenticate_md5}, {
 	"apop", authenticate_apop}, {
 #endif
@@ -42,6 +61,7 @@ static struct authentication_method {
 	NULL, NULL}
 };
 
+/*@null@*/
 FILE *pop3Login(Pop3 pc)
 {
 	int fd;
@@ -77,6 +97,7 @@ FILE *pop3Login(Pop3 pc)
 		}
 	}
 
+
 	/* try each authentication method in turn. */
 	for (a = auth_methods; a->name != NULL; a++) {
 		/* was it specified or did the user leave it up to us? */
@@ -95,13 +116,13 @@ FILE *pop3Login(Pop3 pc)
 	return NULL;
 }
 
-int pop3CheckMail(Pop3 pc)
+int pop3CheckMail( /*@notnull@ */ Pop3 pc)
 {
 	FILE *f;
 	int read;
 	char buf[BUF_SIZE];
 
-	f = pc->open(pc);
+	f = pop3Login(pc);
 	if (f == NULL)
 		return -1;
 
@@ -144,6 +165,18 @@ int pop3CheckMail(Pop3 pc)
 	return 0;
 }
 
+
+struct msglst *pop_getHeaders( /*@notnull@ */ Pop3 pc)
+{
+	if (pc->headerCache == NULL)
+		pop3_cacheHeaders(pc);
+	if (pc->headerCache != NULL)
+		pc->headerCache->in_use = 1;
+	return pc->headerCache;
+}
+
+
+
 int pop3Create(Pop3 pc, const char *str)
 {
 	/* POP3 format: pop3:user:password at server[:port] */
@@ -151,7 +184,6 @@ int pop3Create(Pop3 pc, const char *str)
 	/* If 'str' line is badly formatted, wmbiff won't display the mailbox. */
 	int i;
 	int matchedchars;
-	struct re_registers regs;
 	/* ([^: ]+) user
 	   ([^@]+) or ([^ ]+) password 
 	   ([^: ]+) server 
@@ -161,63 +193,75 @@ int pop3Create(Pop3 pc, const char *str)
 	   use of '@' in passwords
 	 */
 	const char *regexes[] = {
-		"pop3:([^: ]{1,32}) ([^ ]{1,32}) ([^: ]+)( [0-9]+)? *",
-		"pop3:([^: ]{1,32}):([^@]{1,32})@([^: ]+)(:[0-9]+)? *",
+		"pop3:([^: ]{1,32}):([^@]{0,32})@([A-Za-z1-9][-A-Za-z0-9_.]+)(:[0-9]+)?(  *([CcAaPp][-A-Za-z5 ]*))?$",
+		"pop3:([^: ]{1,32}) ([^ ]{1,32}) ([A-Za-z1-9][-A-Za-z0-9_.]+)( [0-9]+)?(  *([CcAaPp][-A-Za-z5 ]*))?$",
+		//      "pop3:([^: ]{1,32}) ([^ ]{1,32}) ([^: ]+)( [0-9]+)? *",
+		// "pop3:([^: ]{1,32}):([^@]{0,32})@([^: ]+)(:[0-9]+)? *",
 		NULL
 	};
+	struct regulo regulos[] = {
+		{1, PCU.userName, regulo_strcpy},
+		{2, PCU.password, regulo_strcpy},
+		{3, PCU.serverName, regulo_strcpy},
+		{4, &PCU.serverPort, regulo_atoi},
+		{6, PCU.authList, regulo_strcpy_tolower},
+		{0, NULL, NULL}
+	};
+
+	if (Relax) {
+		regexes[0] =
+			"pop3:([^: ]{1,32}):([^@]{0,32})@([^/: ]+)(:[0-9]+)?(  *(.*))?$";
+		regexes[1] =
+			"pop3:([^: ]{1,32}) ([^ ]{1,32}) ([^/: ]+)( [0-9]+)?(  *(.*))?$";
+	}
+
+	/* defaults */
+	PCU.serverPort = 110;
+	PCU.authList[0] = '\0';
 
 	for (matchedchars = 0, i = 0;
 		 regexes[i] != NULL && matchedchars <= 0; i++) {
-		matchedchars = compile_and_match_regex(regexes[i], str, &regs);
+		matchedchars = regulo_match(regexes[i], str, regulos);
 	}
 
 	/* failed to match either regex */
 	if (matchedchars <= 0) {
 		pc->label[0] = '\0';
-		POP_DM(pc, DEBUG_ERROR, "Couldn't parse line %s (%d)\n", str,
-			   matchedchars);
+		POP_DM(pc, DEBUG_ERROR, "Couldn't parse line %s (%d)\n"
+			   "  If this used to work, run wmbiff with the -relax option, and\n "
+			   "  send mail to wmbiff-devel at lists.sourceforge.net with the hostname\n"
+			   "  of your mail server.\n", str, matchedchars);
 		return -1;
 	}
-
-	/* copy matches where they belong */
-	copy_substring(PCU.userName, regs.start[1], regs.end[1], str);
-	copy_substring(PCU.password, regs.start[2], regs.end[2], str);
-	copy_substring(PCU.serverName, regs.start[3], regs.end[3], str);
-	if (regs.start[4] != -1)
-		PCU.serverPort = atoi(str + regs.start[4] + 1);
-	else
-		PCU.serverPort = 110;
-
-	grab_authList(str + regs.end[0], PCU.authList);
+	// grab_authList(str + matchedchars, PCU.authList);
 
 	POP_DM(pc, DEBUG_INFO, "userName= '%s'\n", PCU.userName);
-	POP_DM(pc, DEBUG_INFO, "password= is %d characters long\n",
-		   strlen(PCU.password));
 	POP_DM(pc, DEBUG_INFO, "password is %d chars long\n",
 		   strlen(PCU.password));
 	POP_DM(pc, DEBUG_INFO, "serverName= '%s'\n", PCU.serverName);
 	POP_DM(pc, DEBUG_INFO, "serverPort= '%d'\n", PCU.serverPort);
 	POP_DM(pc, DEBUG_INFO, "authList= '%s'\n", PCU.authList);
 
-	pc->open = pop3Login;
 	pc->checkMail = pop3CheckMail;
+	pc->getHeaders = pop_getHeaders;
 	pc->TotalMsgs = 0;
 	pc->UnreadMsgs = 0;
 	pc->OldMsgs = -1;
 	pc->OldUnreadMsgs = -1;
+
 	return 0;
 }
 
 
-#ifdef WITH_GCRYPT
-static FILE *authenticate_md5(Pop3 pc,
-							  FILE * fp,
-							  char *apop_str __attribute__ ((unused)))
+#ifdef HAVE_GCRYPT_H
+static FILE *authenticate_md5(Pop3 pc, FILE * fp, char *apop_str
+							  __attribute__ ((unused)))
 {
 	char buf[BUF_SIZE];
 	char buf2[BUF_SIZE];
 	unsigned char *md5;
-	GCRY_MD_HD gmh;
+	gcry_md_hd_t gmh;
+	gcry_error_t rc;
 
 	/* See if MD5 is supported */
 	fprintf(fp, "AUTH CRAM-MD5\r\n");
@@ -237,7 +281,11 @@ static FILE *authenticate_md5(Pop3 pc,
 	strcat(buf, " ");
 
 
-	gmh = gcry_md_open(GCRY_MD_MD5, GCRY_MD_FLAG_HMAC);
+	rc = gcry_md_open(&gmh, GCRY_MD_MD5, GCRY_MD_FLAG_HMAC);
+	if (rc != 0) {
+		POP_DM(pc, DEBUG_ERROR, "unable to initialize gcrypt md5.\n");
+		return NULL;
+	}
 	gcry_md_setkey(gmh, PCU.password, strlen(PCU.password));
 	gcry_md_write(gmh, (unsigned char *) buf2, strlen(buf2));
 	gcry_md_final(gmh);
@@ -268,10 +316,12 @@ static FILE *authenticate_md5(Pop3 pc,
 
 static FILE *authenticate_apop(Pop3 pc, FILE * fp, char *apop_str)
 {
-	GCRY_MD_HD gmh;
+	gcry_md_hd_t gmh;
+	gcry_error_t rc;
 	char buf[BUF_SIZE];
 	unsigned char *md5;
 
+
 	if (apop_str[0] == '\0') {
 		/* server doesn't support apop. */
 		return (NULL);
@@ -279,7 +329,11 @@ static FILE *authenticate_apop(Pop3 pc, FILE * fp, char *apop_str)
 	POP_DM(pc, DEBUG_INFO, "APOP challenge: %s\n", apop_str);
 	strcat(apop_str, PCU.password);
 
-	gmh = gcry_md_open(GCRY_MD_MD5, 0);
+	rc = gcry_md_open(&gmh, GCRY_MD_MD5, 0);
+	if (rc != 0) {
+		POP_DM(pc, DEBUG_ERROR, "unable to initialize gcrypt md5.\n");
+		return NULL;
+	}
 	gcry_md_write(gmh, (unsigned char *) apop_str, strlen(apop_str));
 	gcry_md_final(gmh);
 	md5 = gcry_md_read(gmh, 0);
@@ -301,9 +355,11 @@ static FILE *authenticate_apop(Pop3 pc, FILE * fp, char *apop_str)
 		return NULL;
 	}
 }
-#endif							/* WITH_GCRYPT */
+#endif							/* HAVE_GCRYPT_H */
 
-static FILE *authenticate_plaintext(Pop3 pc, FILE * fp, char *apop_str
+/*@null@*/
+static FILE *authenticate_plaintext( /*@notnull@ */ Pop3 pc,
+									FILE * fp, char *apop_str
 									__attribute__ ((unused)))
 {
 	char buf[BUF_SIZE];
@@ -346,4 +402,59 @@ static FILE *authenticate_plaintext(Pop3 pc, FILE * fp, char *apop_str
 	return fp;
 }
 
+void pop3_cacheHeaders( /*@notnull@ */ Pop3 pc)
+{
+	char buf[BUF_SIZE];
+	FILE *f;
+	int i;
+
+	if (pc->headerCache != NULL) {
+		/* decrement the reference count, and free our version */
+		imap_releaseHeaders(pc, pc->headerCache);
+		pc->headerCache = NULL;
+	}
+
+	POP_DM(pc, DEBUG_INFO, "working headers\n");
+	/* login the server */
+	f = pop3Login(pc);
+	if (!f)
+		return;
+	/* pc->UnreadMsgs = pc->TotalMsgs - read; */
+	pc->headerCache = NULL;
+	for (i = pc->TotalMsgs - pc->UnreadMsgs + 1; i <= pc->TotalMsgs; ++i) {
+		struct msglst *m;
+		m = malloc(sizeof(struct msglst));
+
+		m->subj[0] = '\0';
+		m->from[0] = '\0';
+		POP_DM(pc, DEBUG_INFO, "search: %s", buf);
+
+		fprintf(f, "TOP %i 0\r\n", i);
+		fflush(f);
+		while (fgets(buf, 256, f) && buf[0] != '.') {
+			if (!strncasecmp(buf, "From: ", 6)) {
+				/* manage the from in heads */
+				strncpy(m->from, buf + 6, FROM_LEN - 1);
+				m->from[FROM_LEN - 1] = '\0';
+			} else if (!strncasecmp(buf, "Subject: ", 9)) {
+				/* manage subject */
+				strncpy(m->subj, buf + 9, SUBJ_LEN - 1);
+				m->subj[SUBJ_LEN - 1] = '\0';
+			}
+			if (!m->subj[0]) {
+				strncpy(m->subj, "[NO SUBJECT]", 14);
+			}
+			if (!m->from[0]) {
+				strncpy(m->from, "[ANONYMOUS]", 14);
+			}
+		}
+		m->next = pc->headerCache;
+		pc->headerCache = m;
+		pc->headerCache->in_use = 0;
+	}
+	fprintf(f, "QUIT\r\n");
+	fflush(f);
+	fclose(f);
+}
+
 /* vim:set ts=4: */
diff --git a/wmbiff/ShellClient.c b/wmbiff/ShellClient.c
index e1cf744..5543832 100644
--- a/wmbiff/ShellClient.c
+++ b/wmbiff/ShellClient.c
@@ -8,77 +8,255 @@
  *
  */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include "Client.h"
 #include <errno.h>
 #include <string.h>
 #include <stdio.h>
+#include <ctype.h>
+#include <signal.h>
+#include <assert.h>
+#include <strings.h>
+#include "charutil.h"
+#include "MessageList.h"
 #ifdef USE_DMALLOC
 #include <dmalloc.h>
 #endif
 
 #define SH_DM(pc, lvl, args...) DM(pc, lvl, "shell: " args)
 
+/* kind_popen bumps off the sigchld handler - we care whether
+   a checking program fails. */
+
+#ifdef __LCLINT__
+void (*old_signal_handler) (int);
+#else
+RETSIGTYPE(*old_signal_handler) (int);
+#endif
+
+/*@null@*/
+FILE *kind_popen(const char *command, const char *type)
+{
+	FILE *ret;
+	assert(strcmp(type, "r") == 0);
+	assert(old_signal_handler == NULL);
+	old_signal_handler = signal(SIGCHLD, SIG_DFL);
+	ret = popen(command, type);
+	if (ret == NULL) {
+		DMA(DEBUG_ERROR, "popen: error while reading '%s': %s\n",
+			command, strerror(errno));
+		(void) signal(SIGCHLD, old_signal_handler);
+		old_signal_handler = NULL;
+	}
+	return (ret);
+}
+
 /* kind_pclose checks the return value from pclose and prints
    some nice error messages about it.  ordinarily, this would be 
    a good idea, but wmbiff has a sigchld handler that reaps 
    children immediately (needed when spawning other child processes),
    so no error checking can be done here until that's disabled */
 
-/* TODO: block or unbind sigchld before popen, and reenable on pclose */
-static void kind_pclose(FILE * F, const char *command, Pop3 pc)
+/* returns as a mailcheck function does: -1 on fail, 0 on success */
+static int kind_pclose( /*@only@ */ FILE * F,
+					   const char *command,
+					   /*@null@ */ Pop3 pc)
 {
 	int exit_status = pclose(F);
+
+	if (old_signal_handler != NULL) {
+		(void) signal(SIGCHLD, old_signal_handler);
+		old_signal_handler = NULL;
+	}
+
 	if (exit_status != 0) {
 		if (exit_status == -1) {
 			/* wmbiff has a sigchld handler already, so wait is likely 
 			   to fail */
-			if (errno != ECHILD) {
-				SH_DM(pc, DEBUG_ERROR, "pclose '%s' failed: %s\n",
-					  command, strerror(errno));
-			}
+			SH_DM(pc, DEBUG_ERROR, "pclose '%s' failed: %s\n",
+				  command, strerror(errno));
 		} else {
 			SH_DM(pc, DEBUG_ERROR,
 				  "'%s' exited with non-zero status %d\n", command,
 				  exit_status);
 		}
 	}
+	return (exit_status);
 }
 
-int shellCmdCheck(Pop3 pc)
+int grabCommandOutput(Pop3 pc, const char *command,	/*@out@ */
+					  char **output, /*@out@ *//*@null@ */ char **details)
 {
 	FILE *F;
+	char linebuf[512];
+	SH_DM(pc, DEBUG_INFO, "Executing '%s'\n", command);
+	*output = NULL;
+	if ((F = kind_popen(command, "r")) == NULL) {
+		return -1;
+	}
+	if (fgets(linebuf, 512, F) == NULL) {
+		SH_DM(pc, DEBUG_ERROR,
+			  "fgets: unable to read the output of '%s': %s\n", command,
+			  strerror(errno));
+	} else {
+		chomp(linebuf);			/* remove trailing newline */
+		*output = strdup_ordie(linebuf);
+	}
+	if (details) {
+		static char allbuf[4096];
+		allbuf[0] = '\0';
+		if (fread(allbuf, 1, 4095, F) == 0 && !feof(F)) {
+			SH_DM(pc, DEBUG_ERROR,
+				  "fread: unable to read the detailed output of '%s': %s\n",
+				  command, strerror(errno));
+		}
+		allbuf[4095] = '\0';
+		*details = strdup_ordie(allbuf);
+	}
+	return (kind_pclose(F, command, pc));
+}
+
+/* returns null on failure */
+/*@null@*/
+char *backtickExpand(Pop3 pc, const char *path)
+{
+	char bigbuffer[1024];
+	const char *tickstart;
+	const char *tickend;
+	bigbuffer[0] = '\0';
+	while ((tickstart = strchr(path, '`')) != NULL) {
+		char *command;
+		char *commandoutput;
+		tickend = strchr(tickstart + 1, '`');
+		if (tickend == NULL) {
+			SH_DM(pc, DEBUG_ERROR, "unbalanced \' in %s\n", path);
+			return NULL;
+		}
+		strncat(bigbuffer, path, tickstart - path);
+		command = strdup_ordie(tickstart + 1);
+		command[tickend - tickstart - 1] = '\0';
+		(void) grabCommandOutput(pc, command, &commandoutput, NULL);
+		free(command);
+		if (commandoutput != NULL) {
+			strcat(bigbuffer, commandoutput);
+			free(commandoutput);
+		}
+		path = tickend + 1;
+	}
+	/* grab the rest */
+	strcat(bigbuffer, path);
+	SH_DM(pc, DEBUG_INFO, "expanded to %s\n", bigbuffer);
+	return (strdup_ordie(bigbuffer));
+}
+
+int shellCmdCheck(Pop3 pc)
+{
 	int count_status = 0;
+	char *commandOutput;
 
 	if (pc == NULL)
 		return -1;
 	SH_DM(pc, DEBUG_INFO, ">Mailbox: '%s'\n", pc->path);
 
-	if ((F = popen(pc->path, "r")) == NULL) {
-		SH_DM(pc, DEBUG_ERROR, "popen: error while reading '%s': %s\n",
-			  pc->path, strerror(errno));
+	/* fetch the first line of input */
+	pc->TextStatus[0] = '\0';
+	if (pc->u.shell.detail != NULL) {
+		free(pc->u.shell.detail);
+		pc->u.shell.detail = NULL;
+	}
+	(void) grabCommandOutput(pc, pc->path, &commandOutput,
+							 &pc->u.shell.detail);
+	if (commandOutput == NULL) {
 		return -1;
 	}
+	SH_DM(pc, DEBUG_INFO, "'%s' returned '%s'\n", pc->path, commandOutput);
 
-	/* doesn't really need to be handled separately, but it
-	   seems worth an error message */
-	if (fscanf(F, "%d\n", &(count_status)) != 1) {
+	/* see if it's numeric; the numeric check is somewhat 
+	   useful, as wmbiff renders 4-digit numbers, but not
+	   4-character strings. */
+	if (sscanf(commandOutput, "%d", &(count_status)) == 1) {
+		if (strstr(commandOutput, "new")) {
+			pc->UnreadMsgs = count_status;
+			pc->TotalMsgs = 0;
+		} else if (strstr(commandOutput, "old")) {
+			pc->UnreadMsgs = 0;
+			pc->TotalMsgs = count_status;
+		} else {
+			/* this default should be configurable. */
+			pc->UnreadMsgs = 0;
+			pc->TotalMsgs = count_status;
+		}
+	} else if (strcasestr(commandOutput, "unable")) {
+		return -1;
+	} else if (sscanf(commandOutput, "%9s\n", pc->TextStatus) == 1) {
+		/* validate the string input */
+		int i;
+		for (i = 0; pc->TextStatus[i] != '\0' && isalnum(pc->TextStatus[i])
+			 && i < 10; i++);
+		if (pc->TextStatus[i] != '\0') {
+			SH_DM(pc, DEBUG_ERROR,
+				  "wmbiff only supports alphanumeric (isalnum) strings:\n"
+				  " '%s' is not ok\n", pc->TextStatus);
+			/* null terminate it at the first bad char: */
+			pc->TextStatus[i] = '\0';
+		}
+		/* see if we should print as new or not */
+		pc->UnreadMsgs = (strstr(commandOutput, "new")) ? 1 : 0;
+		pc->TotalMsgs = -1;		/* we might alternat numeric /string */
+	} else {
 		SH_DM(pc, DEBUG_ERROR,
-			  "'%s' returned something other than an integer message count.\n",
-			  pc->path);
-		kind_pclose(F, pc->path, pc);
+			  "'%s' returned something other than an integer message count"
+			  " or short string.\n", pc->path);
+		free(commandOutput);
 		return -1;
 	}
 
-	pc->TotalMsgs = pc->UnreadMsgs + count_status;
-	pc->UnreadMsgs = count_status;
-	SH_DM(pc, DEBUG_INFO, "from: %d status: %d\n", pc->TotalMsgs,
-		  pc->UnreadMsgs);
+	SH_DM(pc, DEBUG_INFO, "from: %s status: %s %d %d\n",
+		  pc->path, pc->TextStatus, pc->TotalMsgs, pc->UnreadMsgs);
+	free(commandOutput);
+	return (0);
+}
 
-	kind_pclose(F, pc->path, pc);
-	return 0;
+struct msglst *shell_getHeaders( /*@notnull@ */ Pop3 pc)
+{
+	struct msglst *message_list = NULL;
+
+	char *ln = pc->u.shell.detail;
+	int i, j;
+	if (ln == NULL)
+		return NULL;
+
+	for (j = 0; ln[j] != '\0';) {
+		struct msglst *m = malloc(sizeof(struct msglst));
+		m->next = message_list;
+		m->subj[0] = '\0';
+		m->from[0] = '\0';
+
+		for (i = 0; i < SUBJ_LEN - 1 && ln[j + i] != '\n'; i++) {
+			m->subj[i] = ln[j + i];
+		}
+		m->subj[i] = '\0';
+		j += i + 1;
+
+		message_list = m;
+	}
+	return message_list;
 }
 
-int shellCreate(Pop3 pc, const char *str)
+void
+shell_releaseHeaders(Pop3 pc __attribute__ ((unused)), struct msglst *h)
+{
+	for (; h != NULL;) {
+		struct msglst *n = h->next;
+		free(h);
+		h = n;
+	}
+}
+
+int shellCreate( /*@notnull@ */ Pop3 pc, const char *str)
 {
 	/* SHELL format: shell:::/path/to/script */
 	const char *reserved1, *reserved2, *commandline;
@@ -88,8 +266,11 @@ int shellCreate(Pop3 pc, const char *str)
 	pc->OldMsgs = -1;
 	pc->OldUnreadMsgs = -1;
 	pc->checkMail = shellCmdCheck;
+	pc->getHeaders = shell_getHeaders;
 	reserved1 = str + 6;		/* shell:>:: */
 
+	assert(strncasecmp("shell:", str, 6) == 0);
+
 	reserved2 = index(reserved1, ':');
 	if (reserved2 == NULL) {
 		SH_DM(pc, DEBUG_ERROR, "unable to parse '%s', expecting ':'", str);
@@ -105,10 +286,27 @@ int shellCreate(Pop3 pc, const char *str)
 	}
 	commandline++;				/* shell:::> */
 
-	/* good thing strcpy handles overlapping regions */
-	strcpy(pc->path, commandline);
+	/* strcpy is not specified to handle overlapping regions */
 	SH_DM(pc, DEBUG_INFO, "path= '%s'\n", commandline);
+	{
+		char *tmp = strdup(commandline);
+		if (strlen(tmp) + 1 > BUF_BIG) {
+			SH_DM(pc, DEBUG_ERROR, "commandline '%s' is too long.\n",
+				  commandline);
+			memset(pc->path, 0, BUF_BIG);
+		} else {
+			strcpy(pc->path, tmp);
+		}
+		free(tmp);
+	}
 	return 0;
 }
 
 /* vim:set ts=4: */
+/*
+ * Local Variables:
+ * tab-width: 4
+ * c-indent-level: 4
+ * c-basic-offset: 4
+ * End:
+ */
diff --git a/wmbiff/charutil.c b/wmbiff/charutil.c
index be4c031..9b8108b 100644
--- a/wmbiff/charutil.c
+++ b/wmbiff/charutil.c
@@ -1,29 +1,38 @@
-/* $Id: charutil.c,v 1.7 2002/01/12 05:30:09 bluehal Exp $ */
+/* $Id: charutil.c,v 1.19 2004/04/28 00:19:03 bluehal Exp $ */
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
 #include <ctype.h>
+#include <sys/types.h>
+#include <regex.h>
 #ifdef USE_DMALLOC
 #include <dmalloc.h>
 #endif
 #include "charutil.h"
 
-static __inline__ int LeftTrim(char *psValue)
+static __inline__ void LeftTrim(char *psValue)
 {
-
 	char *psTmp = psValue;
 
 	while (*psTmp == ' ' || *psTmp == '\t')
 		psTmp++;
 
-	strcpy(psValue, psTmp);
-
-	return EXIT_SUCCESS;
+	/* can't use strcpy here, as the strings must not
+	   overlap, at least according to spec. */
+	if (psTmp > psValue) {
+		while (*psTmp != '\0') {
+			*(psValue++) = *(psTmp++);
+		}
+		*(psValue) = '\0';
+	}
 }
 
-static __inline__ int RightTrim(char *psValue)
+static __inline__ void RightTrim(char *psValue)
 {
-
 	long lLength = strlen(psValue) - 1;
 
 	while ((psValue[lLength] == ' ' || psValue[lLength] == '\t')
@@ -32,17 +41,12 @@ static __inline__ int RightTrim(char *psValue)
 	}
 
 	psValue[++lLength] = '\000';
-	return EXIT_SUCCESS;
 }
 
-int FullTrim(char *psValue)
+void FullTrim(char *psValue)
 {
-
-	if (LeftTrim(psValue) != 0)
-		return EXIT_FAILURE;
-	if (RightTrim(psValue) != 0)
-		return EXIT_FAILURE;
-	return EXIT_SUCCESS;
+	RightTrim(psValue);
+	LeftTrim(psValue);
 }
 
 void Bin2Hex(unsigned char *src, int length, char *dst)
@@ -153,8 +157,9 @@ void Decode_Base64(char *src, char *dst)
 }
 
 /* helper function for the configuration line parser */
-void copy_substring(char *destination,
-					int startidx, int endidx, const char *source)
+void
+copy_substring(char *destination,
+			   int startidx, int endidx, const char *source)
 {
 	if (startidx > -1) {
 		strncpy(destination, source + startidx, endidx - startidx);
@@ -180,7 +185,7 @@ void grab_authList(const char *source, char *destination)
 	}
 }
 
-
+#ifdef USE_GNU_REGEX
 int compile_and_match_regex(const char *regex, const char *str,	/*@out@ */
 							struct re_registers *regs)
 {
@@ -191,7 +196,6 @@ int compile_and_match_regex(const char *regex, const char *str,	/*@out@ */
 
 	/* compile the regex pattern */
 	memset(&rpbuf, 0, sizeof(struct re_pattern_buffer));
-
 	/* posix egrep interprets intervals (eg. {1,32}) nicely */
 	re_syntax_options = RE_SYNTAX_POSIX_EGREP;
 	errstr = re_compile_pattern(regex, strlen(regex), &rpbuf);
@@ -217,5 +221,50 @@ int compile_and_match_regex(const char *regex, const char *str,	/*@out@ */
 	}
 #endif
 
+	regfree(&rpbuf);			// added 3 jul 02, appeasing valgrind
 	return matchedchars;
 }
+#endif
+
+/* like perl chomp(); useful for dealing with input from popen */
+void chomp(char *s)
+{
+	int l = strlen(s) - 1;
+	if (l >= 0 && s[l] == '\n')
+		s[l] = '\0';
+}
+
+char *strdup_ordie(const char *c)
+{
+	char *ret = strdup(c);
+	if (ret == NULL) {
+		fprintf(stderr, "ran out of memory\n");
+		exit(EXIT_FAILURE);
+	}
+	return (ret);
+}
+
+void StripComment(char *buf)
+{
+	char *p;
+
+	/* Strip comments at beginning of line, or after whitespace.  
+	   a kludgy way of avoiding problems with #'s in passwords. */
+	if (buf[0] == '#')
+		buf[0] = '\0';
+	for (p = (char *) buf + 1; *p && !(*p == '#' && isspace(*(p - 1)));
+		 p++);
+	if (*p) {
+		*p = '\0';
+	}
+}
+
+
+/* vim:set ts=4: */
+/*
+ * Local Variables:
+ * tab-width: 4
+ * c-indent-level: 4
+ * c-basic-offset: 4
+ * End:
+ */
diff --git a/wmbiff/charutil.h b/wmbiff/charutil.h
index 6e5ac62..cbd687e 100644
--- a/wmbiff/charutil.h
+++ b/wmbiff/charutil.h
@@ -1,4 +1,4 @@
-/* $Id: charutil.h,v 1.5 2002/02/02 18:04:19 jordi Exp $ */
+/* $Id: charutil.h,v 1.12 2004/04/20 04:55:55 bluehal Exp $ */
 /* Author: Mark Hurley  (debian4tux at telocity.com)
  *
  * Character / string manipulation utilities. 
@@ -8,13 +8,15 @@
 #ifndef CHARUTIL
 #define CHARUTIL
 
-#ifdef EXT_GNU_REGEX_LIB
-#include <gnuregex.h>
-#else
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#ifdef HAVE_REGEX_H
 #include <regex.h>
 #endif
 
-int FullTrim(char *psValue);
+void FullTrim(char *psValue);
 
 void Bin2Hex(unsigned char *src, int length, char *dst);
 
@@ -28,7 +30,17 @@ void copy_substring(char *destination,
 /* common to Pop3 and Imap4 authentication list grabber. */
 void grab_authList(const char *source, char *destination);
 
+#ifdef USE_GNU_REGEX
 /* handles main regex work */
 int compile_and_match_regex(const char *regex, const char *str,
 							/*@out@ */ struct re_registers *regs);
 #endif
+
+/* acts like perl's function of the same name */
+void chomp(char *s);
+
+/* same as xstrdup, just better named ;) */
+char *strdup_ordie(const char *c);
+
+void StripComment(char *buf);
+#endif
diff --git a/wmbiff/gnutls-common.c b/wmbiff/gnutls-common.c
new file mode 100644
index 0000000..ac84c87
--- /dev/null
+++ b/wmbiff/gnutls-common.c
@@ -0,0 +1,684 @@
+#include <config.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <gnutls/gnutls.h>
+#include <gnutls/extra.h>
+#include <gnutls/x509.h>
+#include <gnutls/openpgp.h>
+#include <time.h>
+#include <gnutls-common.h>
+
+#define TEST_STRING
+
+int xml = 0;
+int print_cert;
+
+static char buffer[5*1024];
+
+#define PRINTX(x,y) if (y[0]!=0) printf(" #   %s %s\n", x, y)
+#define PRINT_PGP_NAME(X) PRINTX( "NAME:", name)
+
+const char str_unknown[] = "(unknown)";
+
+static const char *my_ctime(const time_t * tv)
+{
+	static char buf[256];
+	struct tm *tp;
+
+	if ( ( (tp = localtime(tv)) == NULL ) ||
+	     (!strftime(buf, sizeof buf, "%a %b %e %H:%M:%S %Z %Y\n", tp)) )
+		strcpy(buf, str_unknown);/* make sure buf text isn't garbage */
+
+	return buf;
+
+}
+
+void print_x509_info(gnutls_session session, const char* hostname)
+{
+	gnutls_x509_crt crt;
+	const gnutls_datum *cert_list;
+	int cert_list_size = 0, ret;
+	char digest[20];
+	char serial[40];
+	char dn[256];
+	size_t dn_size;
+	size_t digest_size = sizeof(digest);
+	unsigned int i, j;
+	size_t serial_size = sizeof(serial);
+	char printable[256];
+	char *print;
+	unsigned int bits, algo;
+	time_t expiret, activet;
+
+	cert_list = gnutls_certificate_get_peers(session, &cert_list_size);
+
+
+	if (cert_list_size == 0) {
+		fprintf(stderr, "No certificates found!\n");
+		return;
+	}
+
+	printf(" - Got a certificate list of %d certificates.\n\n",
+	       cert_list_size);
+
+	for (j = 0; j < (unsigned int)cert_list_size; j++) {
+
+		gnutls_x509_crt_init(&crt);
+		ret =
+		    gnutls_x509_crt_import(crt, &cert_list[j],
+					   GNUTLS_X509_FMT_DER);
+		if (ret < 0) {
+			const char* str = gnutls_strerror(ret);
+			if (str == NULL) str = str_unknown;
+			fprintf(stderr, "Decoding error: %s\n", str);
+			return;
+		}
+
+		printf(" - Certificate[%d] info:\n", j);
+
+		if (print_cert) {
+			size_t size;
+			
+			size = sizeof(buffer);
+			
+			ret = gnutls_x509_crt_export( crt, GNUTLS_X509_FMT_PEM, buffer, &size);
+			if (ret < 0) {
+				fprintf(stderr, "Encoding error: %s\n", gnutls_strerror(ret));
+				return;
+			}
+			fputs( "\n", stdout);
+			fputs( buffer, stdout);
+			fputs( "\n", stdout);
+		}
+		
+		if (j==0 && hostname != NULL) { /* Check the hostname of the first certificate
+		             * if it matches the name of the host we
+		             * connected to.
+		             */
+		             if (gnutls_x509_crt_check_hostname( crt, hostname)==0) {
+		             	printf(" # The hostname in the certificate does NOT match '%s'.\n", hostname);
+		             } else {
+		             	printf(" # The hostname in the certificate matches '%s'.\n", hostname);
+		             }
+		}
+
+
+		if (xml) {
+#ifdef ENABLE_PKI
+			gnutls_datum xml_data;
+
+			ret = gnutls_x509_crt_to_xml( crt, &xml_data, 0);
+			if (ret < 0) {
+				const char* str = gnutls_strerror(ret);
+				if (str == NULL) str = str_unknown;
+				fprintf(stderr, "XML encoding error: %s\n",
+					str);
+				return;
+			}
+			
+			printf("%s", xml_data.data);
+			gnutls_free( xml_data.data);
+#endif
+		} else {
+
+			expiret = gnutls_x509_crt_get_expiration_time(crt);
+			activet = gnutls_x509_crt_get_activation_time(crt);
+
+			printf(" # valid since: %s", my_ctime(&activet));
+			printf(" # expires at: %s", my_ctime(&expiret));
+
+
+			/* Print the serial number of the certificate.
+			 */
+			if (gnutls_x509_crt_get_serial(crt, serial, &serial_size)
+			    >= 0) {
+				print = printable;
+				for (i = 0; i < serial_size; i++) {
+					sprintf(print, "%.2x ",
+						(unsigned char) serial[i]);
+					print += 3;
+				}
+				printf(" # serial number: %s\n", printable);
+			}
+
+			/* Print the fingerprint of the certificate
+			 */
+			digest_size = sizeof(digest);
+			if ((ret=gnutls_x509_crt_get_fingerprint(crt, GNUTLS_DIG_MD5, digest, &digest_size))
+			    < 0) {
+				const char* str = gnutls_strerror(ret);
+				if (str == NULL) str = str_unknown;
+			    	fprintf(stderr, "Error in fingerprint calculation: %s\n", str);
+			} else {
+				print = printable;
+				for (i = 0; i < digest_size; i++) {
+					sprintf(print, "%.2x ",
+						(unsigned char) digest[i]);
+					print += 3;
+				}
+				printf(" # fingerprint: %s\n", printable);
+			}
+
+			/* Print the version of the X.509 
+			 * certificate.
+			 */
+			printf(" # version: #%d\n",
+			       gnutls_x509_crt_get_version(crt));
+
+			algo = gnutls_x509_crt_get_pk_algorithm(crt, &bits);
+			printf(" # public key algorithm: ");
+			if (algo == GNUTLS_PK_RSA) {
+				printf("RSA\n");
+				printf(" #   Modulus: %d bits\n", bits);
+			} else if (algo == GNUTLS_PK_DSA) {
+				printf("DSA\n");
+				printf(" #   Exponent: %d bits\n", bits);
+			} else {
+				printf("UNKNOWN\n");
+			}
+
+			dn_size = sizeof(dn);
+			ret = gnutls_x509_crt_get_dn(crt, dn, &dn_size);
+			if (ret >= 0)
+				printf(" # Subject's DN: %s\n", dn);
+	
+			dn_size = sizeof(dn);
+			ret = gnutls_x509_crt_get_issuer_dn(crt, dn, &dn_size);
+			if (ret >= 0)
+				printf(" # Issuer's DN: %s\n", dn);
+		}
+
+		gnutls_x509_crt_deinit(crt);
+		
+		printf("\n");
+
+	}
+
+}
+
+#ifdef HAVE_LIBOPENCDK
+
+void print_openpgp_info(gnutls_session session, const char* hostname)
+{
+
+	char digest[20];
+	size_t digest_size = sizeof(digest);
+	unsigned int i;
+	int ret;
+	char printable[120];
+	char *print;
+	char name[256];
+	size_t name_len = sizeof(name);
+	gnutls_openpgp_key crt;
+	const gnutls_datum *cert_list;
+	int cert_list_size = 0;
+	time_t expiret;
+	time_t activet;
+	
+	cert_list = gnutls_certificate_get_peers(session, &cert_list_size);
+
+	if (cert_list_size > 0) {
+		unsigned int algo, bits;
+
+		gnutls_openpgp_key_init(&crt);
+		ret =
+		    gnutls_openpgp_key_import(crt, &cert_list[0], GNUTLS_OPENPGP_FMT_RAW);
+		if (ret < 0) {
+			const char* str = gnutls_strerror(ret);
+			if (str == NULL) str = str_unknown;
+			fprintf(stderr, "Decoding error: %s\n", str);
+			return;
+		}
+
+		if (print_cert) {
+			size_t size;
+			
+			size = sizeof(buffer);
+
+			ret = gnutls_openpgp_key_export( crt, GNUTLS_OPENPGP_FMT_BASE64, buffer, &size);
+			if (ret < 0) {
+				fprintf(stderr, "Encoding error: %s\n", gnutls_strerror(ret));
+				return;
+			}
+			fputs( "\n", stdout);
+			fputs( buffer, stdout);
+			fputs( "\n", stdout);
+		}
+
+		if (hostname != NULL) { /* Check the hostname of the first certificate
+		             * if it matches the name of the host we
+		             * connected to.
+		             */
+		             if (gnutls_openpgp_key_check_hostname( crt, hostname)==0) {
+		             	printf(" # The hostname in the key does NOT match '%s'.\n", hostname);
+		             } else {
+		             	printf(" # The hostname in the key matches '%s'.\n", hostname);
+		             }
+		}
+
+		if (xml) {
+			gnutls_datum xml_data;
+
+			ret = gnutls_openpgp_key_to_xml( crt, &xml_data, 0);
+			if (ret < 0) {
+				const char* str = gnutls_strerror(ret);
+				if (str == NULL) str = str_unknown;
+				fprintf(stderr, "XML encoding error: %s\n",
+					str);
+				return;
+			}
+			
+			printf("%s", xml_data.data);
+			gnutls_free( xml_data.data);
+
+			return;
+		}
+
+		activet = gnutls_openpgp_key_get_creation_time( crt);
+		expiret = gnutls_openpgp_key_get_expiration_time( crt);
+
+		printf(" # Key was created at: %s", my_ctime(&activet));
+		printf(" # Key expires: ");
+		if (expiret != 0)
+			printf("%s", my_ctime(&expiret));
+		else
+			printf("Never\n");
+
+		if (gnutls_openpgp_key_get_fingerprint(crt, digest, &digest_size) >= 0) 
+		{
+			print = printable;
+			for (i = 0; i < digest_size; i++) {
+				sprintf(print, "%.2x ",
+					(unsigned char) digest[i]);
+				print += 3;
+			}
+
+			printf(" # PGP Key version: %d\n",
+			       gnutls_openpgp_key_get_version(crt));
+
+			algo =
+			    gnutls_openpgp_key_get_pk_algorithm(crt, &bits);
+
+			printf(" # PGP Key public key algorithm: ");
+
+			if (algo == GNUTLS_PK_RSA) {
+				printf("RSA\n");
+				printf(" #   Modulus: %d bits\n", bits);
+			} else if (algo == GNUTLS_PK_DSA) {
+				printf("DSA\n");
+				printf(" #   Exponent: %d bits\n", bits);
+			} else {
+				printf("UNKNOWN\n");
+			}
+
+			printf(" # PGP Key fingerprint: %s\n", printable);
+
+			name_len = sizeof(name);
+			if (gnutls_openpgp_key_get_name(crt, 0, name, &name_len) < 0) {
+				fprintf(stderr,
+					"Could not extract name\n");
+			} else {
+				PRINT_PGP_NAME(name);
+			}
+
+		}
+		
+		gnutls_openpgp_key_deinit( crt);
+
+	}
+}
+
+#endif
+
+void print_cert_vrfy(gnutls_session session)
+{
+
+	int status;
+	status = gnutls_certificate_verify_peers(session);
+	printf("\n");
+
+	if (status == GNUTLS_E_NO_CERTIFICATE_FOUND) {
+		printf("- Peer did not send any certificate.\n");
+		return;
+	}
+	if (status < 0) {
+		printf("- Could not verify certificate (err: %s)\n",
+		       gnutls_strerror(status));
+		return;
+	}
+
+	if (gnutls_certificate_type_get(session)==GNUTLS_CRT_X509) {
+		if (status & GNUTLS_CERT_SIGNER_NOT_FOUND)
+			printf("- Peer's certificate issuer is unknown\n");
+		if (status & GNUTLS_CERT_INVALID)
+			printf("- Peer's certificate is NOT trusted\n");
+		else
+			printf("- Peer's certificate is trusted\n");
+	} else {
+		if (status & GNUTLS_CERT_INVALID)
+			printf("- Peer's key is invalid\n");
+		else
+			printf("- Peer's key is valid\n");
+		if (status & GNUTLS_CERT_SIGNER_NOT_FOUND)
+			printf("- Could not find a signer of the peer's key\n");
+	}
+}
+
+int print_info(gnutls_session session, const char* hostname)
+{
+	const char *tmp;
+	gnutls_credentials_type cred;
+	gnutls_kx_algorithm kx;
+
+
+	/* print the key exchange's algorithm name
+	 */
+	kx = gnutls_kx_get(session);
+
+	cred = gnutls_auth_get_type(session);
+	switch (cred) {
+#ifdef ENABLE_ANON
+	case GNUTLS_CRD_ANON:
+		printf("- Anonymous DH using prime of %d bits, secret key "
+		       "of %d bits, and peer's public key is %d bits.\n",
+		       gnutls_dh_get_prime_bits(session),
+		       gnutls_dh_get_secret_bits(session),
+		       gnutls_dh_get_peers_public_bits(session));
+		break;
+#endif
+#ifdef ENABLE_SRP
+	case GNUTLS_CRD_SRP:
+		/* This should be only called in server
+		 * side.
+		 */
+		if (gnutls_srp_server_get_username(session) != NULL)
+			printf("- SRP authentication. Connected as '%s'\n",
+			       gnutls_srp_server_get_username(session));
+		break;
+#endif
+	case GNUTLS_CRD_CERTIFICATE:
+		{
+			char dns[256];
+			size_t dns_size = sizeof(dns);
+			unsigned int type;
+
+			/* This fails in client side */
+			if (gnutls_server_name_get
+			    (session, dns, &dns_size, &type, 0) == 0) {
+				printf("- Given server name[%d]: %s\n",
+				       type, dns);
+			}
+		}
+
+		print_cert_info(session, hostname);
+
+		print_cert_vrfy(session);
+ 
+		/* Check if we have been using ephemeral Diffie Hellman.
+		 */
+		if (kx == GNUTLS_KX_DHE_RSA || kx == GNUTLS_KX_DHE_DSS) {
+			printf
+			    ("- Ephemeral DH using prime of %d bits, secret key "
+			     "of %d bits, and peer's public key is %d bits.\n",
+			     gnutls_dh_get_prime_bits(session),
+			     gnutls_dh_get_secret_bits(session),
+			     gnutls_dh_get_peers_public_bits(session));
+		}
+    default:
+      break;
+	}
+
+	tmp =
+	    gnutls_protocol_get_name(gnutls_protocol_get_version(session));
+	if (tmp != NULL) printf("- Version: %s\n", tmp);
+
+	tmp = gnutls_kx_get_name(kx);
+	if (tmp != NULL) printf("- Key Exchange: %s\n", tmp);
+
+	tmp = gnutls_cipher_get_name(gnutls_cipher_get(session));
+	if (tmp != NULL) printf("- Cipher: %s\n", tmp);
+
+	tmp = gnutls_mac_get_name(gnutls_mac_get(session));
+	if (tmp != NULL) printf("- MAC: %s\n", tmp);
+
+	tmp = gnutls_compression_get_name(gnutls_compression_get(session));
+	if (tmp != NULL) printf("- Compression: %s\n", tmp);
+
+	fflush (stdout);
+
+	return 0;
+}
+
+void print_cert_info(gnutls_session session, const char* hostname)
+{
+
+	printf("- Certificate type: ");
+	switch (gnutls_certificate_type_get(session)) {
+	case GNUTLS_CRT_X509:
+		printf("X.509\n");
+		print_x509_info(session, hostname);
+		break;
+#ifdef HAVE_LIBOPENCDK
+	case GNUTLS_CRT_OPENPGP:
+		printf("OpenPGP\n");
+		print_openpgp_info(session, hostname);
+		break;
+#endif
+    default:
+      break;
+	}
+
+}
+
+void print_list(void)
+{
+	/* FIXME: This is hard coded. Make it print all the supported
+	 * algorithms.
+	 */
+	printf("\n");
+	printf("Certificate types:");
+	printf(" X.509");
+	printf(", OPENPGP\n");
+
+	printf("Protocols:");
+	printf(" TLS1.0");
+	printf(", SSL3.0\n");
+
+	printf("Ciphers:");
+	printf(" AES-128-CBC");
+	printf(", 3DES-CBC");
+	printf(", ARCFOUR");
+	printf(", ARCFOUR-40\n");
+
+	printf("MACs:");
+	printf(" MD5");
+	printf(", RMD160");
+	printf(", SHA1\n");
+
+	printf("Key exchange algorithms:");
+	printf(" RSA");
+	printf(", RSA-EXPORT");
+	printf(", DHE-DSS");
+	printf(", DHE-RSA");
+	printf(", SRP");
+	printf(", SRP-RSA");
+	printf(", SRP-DSS");
+	printf(", ANON-DH\n");
+
+	printf("Compression methods:");
+	printf(" ZLIB");
+	printf(", LZO");
+	printf(", NULL\n");
+}
+
+void print_license(void)
+{
+	fprintf(stdout,
+		"\nCopyright (C) 2001-2003 Nikos Mavroyanopoulos\n"
+		"This program is free software; you can redistribute it and/or modify \n"
+		"it under the terms of the GNU General Public License as published by \n"
+		"the Free Software Foundation; either version 2 of the License, or \n"
+		"(at your option) any later version. \n" "\n"
+		"This program is distributed in the hope that it will be useful, \n"
+		"but WITHOUT ANY WARRANTY; without even the implied warranty of \n"
+		"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the \n"
+		"GNU General Public License for more details. \n" "\n"
+		"You should have received a copy of the GNU General Public License \n"
+		"along with this program; if not, write to the Free Software \n"
+		"Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\n\n");
+}
+
+void parse_protocols(char **protocols, int protocols_size,
+		     int *protocol_priority)
+{
+	int i, j;
+
+	if (protocols != NULL && protocols_size > 0) {
+		for (j = i = 0; i < protocols_size; i++) {
+			if (strncasecmp(protocols[i], "SSL", 3) == 0)
+				protocol_priority[j++] = GNUTLS_SSL3;
+			if (strncasecmp(protocols[i], "TLS", 3) == 0)
+				protocol_priority[j++] = GNUTLS_TLS1;
+		}
+		protocol_priority[j] = 0;
+	}
+}
+
+void parse_ciphers(char **ciphers, int nciphers, int *cipher_priority)
+{
+	int j, i;
+
+	if (ciphers != NULL && nciphers > 0) {
+		for (j = i = 0; i < nciphers; i++) {
+			if (strncasecmp(ciphers[i], "AES", 3) == 0)
+				cipher_priority[j++] =
+				    GNUTLS_CIPHER_AES_128_CBC;
+			if (strncasecmp(ciphers[i], "3DE", 3) == 0)
+				cipher_priority[j++] =
+				    GNUTLS_CIPHER_3DES_CBC;
+			if (strcasecmp(ciphers[i], "ARCFOUR-40") == 0)
+				cipher_priority[j++] =
+				    GNUTLS_CIPHER_ARCFOUR_40;
+			if (strcasecmp(ciphers[i], "ARCFOUR") == 0)
+				cipher_priority[j++] =
+				    GNUTLS_CIPHER_ARCFOUR_128;
+			if (strncasecmp(ciphers[i], "NUL", 3) == 0)
+				cipher_priority[j++] = GNUTLS_CIPHER_NULL;
+		}
+		cipher_priority[j] = 0;
+	}
+}
+
+void parse_macs(char **macs, int nmacs, int *mac_priority)
+{
+	int i, j;
+	if (macs != NULL && nmacs > 0) {
+		for (j = i = 0; i < nmacs; i++) {
+			if (strncasecmp(macs[i], "MD5", 3) == 0)
+				mac_priority[j++] = GNUTLS_MAC_MD5;
+			if (strncasecmp(macs[i], "RMD", 3) == 0)
+				mac_priority[j++] = GNUTLS_MAC_RMD160;
+			if (strncasecmp(macs[i], "SHA", 3) == 0)
+				mac_priority[j++] = GNUTLS_MAC_SHA;
+		}
+		mac_priority[j] = 0;
+	}
+}
+
+void parse_ctypes(char **ctype, int nctype, int *cert_type_priority)
+{
+	int i, j;
+	if (ctype != NULL && nctype > 0) {
+		for (j = i = 0; i < nctype; i++) {
+			if (strncasecmp(ctype[i], "OPE", 3) == 0)
+				cert_type_priority[j++] =
+				    GNUTLS_CRT_OPENPGP;
+			if (strncasecmp(ctype[i], "X", 1) == 0)
+				cert_type_priority[j++] = GNUTLS_CRT_X509;
+		}
+		cert_type_priority[j] = 0;
+	}
+}
+
+void parse_kx(char **kx, int nkx, int *kx_priority)
+{
+	int i, j;
+	if (kx != NULL && nkx > 0) {
+		for (j = i = 0; i < nkx; i++) {
+			if (strcasecmp(kx[i], "SRP") == 0)
+				kx_priority[j++] = GNUTLS_KX_SRP;
+			if (strcasecmp(kx[i], "SRP-RSA") == 0)
+				kx_priority[j++] = GNUTLS_KX_SRP_RSA;
+			if (strcasecmp(kx[i], "SRP-DSS") == 0)
+				kx_priority[j++] = GNUTLS_KX_SRP_DSS;
+			if (strcasecmp(kx[i], "RSA") == 0)
+				kx_priority[j++] = GNUTLS_KX_RSA;
+			if (strcasecmp(kx[i], "RSA-EXPORT") == 0)
+				kx_priority[j++] = GNUTLS_KX_RSA_EXPORT;
+			if (strncasecmp(kx[i], "DHE-RSA", 7) == 0)
+				kx_priority[j++] = GNUTLS_KX_DHE_RSA;
+			if (strncasecmp(kx[i], "DHE-DSS", 7) == 0)
+				kx_priority[j++] = GNUTLS_KX_DHE_DSS;
+			if (strncasecmp(kx[i], "ANON", 4) == 0)
+				kx_priority[j++] = GNUTLS_KX_ANON_DH;
+		}
+		kx_priority[j] = 0;
+	}
+}
+
+void parse_comp(char **comp, int ncomp, int *comp_priority)
+{
+	int i, j;
+	if (comp != NULL && ncomp > 0) {
+		for (j = i = 0; i < ncomp; i++) {
+			if (strncasecmp(comp[i], "NUL", 3) == 0)
+				comp_priority[j++] = GNUTLS_COMP_NULL;
+			if (strncasecmp(comp[i], "ZLI", 3) == 0)
+				comp_priority[j++] = GNUTLS_COMP_ZLIB;
+			if (strncasecmp(comp[i], "LZO", 3) == 0)
+				comp_priority[j++] = GNUTLS_COMP_LZO;
+		}
+		comp_priority[j] = 0;
+	}
+
+}
+
+#ifndef HAVE_INET_NTOP
+
+#ifdef _WIN32
+# include <winsock.h>
+#else
+# include <sys/socket.h>
+# include <netinet/in.h>
+# include <arpa/inet.h>
+#endif
+
+const char *inet_ntop(int af __attribute__((unused)), const void *src,
+                             char *dst, size_t cnt) 
+{
+char* ret;
+
+	ret = inet_ntoa( *((struct in_addr*)src));
+	
+	if (strlen(ret) > cnt) {
+		return NULL;
+	}
+	strcpy( dst, ret);
+	
+	return dst;
+}
+#endif
+
+void sockets_init( void)
+{
+#ifdef _WIN32
+	WORD wVersionRequested;
+	WSADATA wsaData;
+
+        wVersionRequested = MAKEWORD(1, 1);
+        if (WSAStartup(wVersionRequested, &wsaData) != 0) {
+              perror("WSA_STARTUP_ERROR");
+        }
+#endif
+}
diff --git a/wmbiff/gnutls-common.h b/wmbiff/gnutls-common.h
new file mode 100644
index 0000000..6c82088
--- /dev/null
+++ b/wmbiff/gnutls-common.h
@@ -0,0 +1,43 @@
+#define PORT 5556
+#define SERVER "127.0.0.1"
+
+#include <config.h>
+#include <gnutls/gnutls.h>
+
+#ifdef _WIN32
+# include <winsock.h>
+# include <io.h>
+# include <winbase.h>
+# define socklen_t int
+# define close closesocket
+#else
+# include <sys/socket.h>
+# include <netinet/in.h>
+# include <arpa/inet.h>
+# include <unistd.h>
+# include <netdb.h>
+# include <signal.h>
+#endif
+
+/* the number of elements in the priority structures.
+ */
+#define PRI_MAX 16
+
+extern const char str_unknown[];
+
+int print_info( gnutls_session state, const char* hostname);
+void print_cert_info( gnutls_session state, const char* hostname);
+void print_list(void);
+
+void parse_comp( char** comp, int ncomp, int* comp_priority);
+void parse_kx( char** kx, int nkx, int* kx_priority);
+void parse_ctypes( char** ctype, int nctype, int * cert_type_priority);
+void parse_macs( char** macs, int nmacs, int *mac_priority);
+void parse_ciphers( char** ciphers, int nciphers, int* cipher_priority);
+void parse_protocols( char** protocols, int protocols_size, int* protocol_priority);
+
+void sockets_init( void);
+#ifndef HAVE_INET_NTOP
+const char *inet_ntop(int af, const void *src,
+                             char *dst, size_t cnt);
+#endif
diff --git a/wmbiff/maildirClient.c b/wmbiff/maildirClient.c
index 5b834f5..f2e5349 100644
--- a/wmbiff/maildirClient.c
+++ b/wmbiff/maildirClient.c
@@ -1,19 +1,25 @@
-/* $Id: maildirClient.c,v 1.5 2002/03/05 05:02:44 dwonis Exp $ */
+/* $Id: maildirClient.c,v 1.15 2004/03/28 00:28:58 bluehal Exp $ */
 /* Author : Yong-iL Joh ( tolkien at mizi.com )
    Modified : Jorge Garc�a ( Jorge.Garcia at uv.es )
    Modified : Dwayne C. Litzenberger ( dlitz at dlitz.net )
  * 
  * Maildir checker.
  *
- * Last Updated : $Date: 2002/03/05 05:02:44 $
+ * Last Updated : $Date: 2004/03/28 00:28:58 $
  *
  */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include "Client.h"
 #include <sys/stat.h>
+#include <sys/types.h>
 #include <dirent.h>
 #include <errno.h>
 #include <utime.h>
+#include <unistd.h>
 #ifdef USE_DMALLOC
 #include <dmalloc.h>
 #endif
@@ -49,7 +55,7 @@ int maildirCheckHistory(Pop3 pc)
 	struct stat st_new;
 	struct stat st_cur;
 	struct utimbuf ut;
-	char path_new[256], path_cur[256];
+	char path_new[BUF_BIG * 2], path_cur[BUF_BIG * 2];
 
 	int count_new = 0, count_cur = 0;
 
@@ -60,6 +66,22 @@ int maildirCheckHistory(Pop3 pc)
 	strcpy(path_cur, pc->path);
 	strcat(path_cur, "/cur/");
 
+	if (pc->u.maildir.dircache_flush) {
+		/* hack to clear directory cache for network-mounted maildirs */
+		int fd;
+		char path_newtmp[BUF_BIG * 2 + 32];
+		strcpy(path_newtmp, path_new);
+		strcat(path_newtmp, ".wmbiff.dircache_flush.XXXXXX");
+		if ((fd = mkstemp(path_newtmp)) >= 0) {
+			close(fd);
+			unlink(path_newtmp);
+		} else {
+			DM(pc, DEBUG_ERROR,
+			   "Can't create dircache flush file '%s': %s\n",
+			   path_newtmp, strerror(errno));
+		}
+	}
+
 	/* maildir */
 	if (stat(path_new, &st_new)) {
 		DM(pc, DEBUG_ERROR, "Can't stat mailbox '%s': %s\n",
@@ -83,10 +105,10 @@ int maildirCheckHistory(Pop3 pc)
 		   " SIZE(new): old %lu, new %lu\n"
 		   " TIME(cur): old %lu, new %lu"
 		   " SIZE(cur): old %lu, new %lu\n",
-		   PCM.mtime_new, st_new.st_mtime,
-		   (unsigned long) PCM.size_new, st_new.st_size,
-		   PCM.mtime_cur, st_cur.st_mtime,
-		   (unsigned long) PCM.size_cur, st_cur.st_size);
+		   PCM.mtime_new, (unsigned long) st_new.st_mtime,
+		   (unsigned long) PCM.size_new, (unsigned long) st_new.st_size,
+		   PCM.mtime_cur, (unsigned long) st_cur.st_mtime,
+		   (unsigned long) PCM.size_cur, (unsigned long) st_cur.st_size);
 
 		count_new = count_msgs(path_new);
 		count_cur = count_msgs(path_cur);
@@ -115,8 +137,10 @@ int maildirCheckHistory(Pop3 pc)
 	return 0;
 }
 
-int maildirCreate(Pop3 pc, char *str)
+int maildirCreate(Pop3 pc, const char *str)
 {
+	int i;
+	char c;
 	/* Maildir format: maildir:fullpathname */
 
 	pc->TotalMsgs = 0;
@@ -124,7 +148,28 @@ int maildirCreate(Pop3 pc, char *str)
 	pc->OldMsgs = -1;
 	pc->OldUnreadMsgs = -1;
 	pc->checkMail = maildirCheckHistory;
-	strcpy(pc->path, str + 8);	/* cut off ``maildir:'' */
+	pc->u.maildir.dircache_flush = 0;
+
+	/* special flags */
+	if (*(str + 8) == ':') {	/* path is of the format maildir::flags:path */
+		c = ' ';
+		for (i = 1; c != ':' && c != '\0'; i++) {
+			c = *(str + 8 + i);
+			switch (c) {
+			case 'F':
+				pc->u.maildir.dircache_flush = 1;
+				DM(pc, DEBUG_INFO, "maildir: dircache_flush enabled\n");
+			}
+		}
+	} else {
+		i = 0;
+	}
+	if (strlen(str + 8 + i) + 1 > BUF_BIG) {
+		DM(pc, DEBUG_ERROR, "maildir '%s' is too long.\n", str + 8 + i);
+		memset(pc->path, 0, BUF_BIG);
+	} else {
+		strncpy(pc->path, str + 8 + i, BUF_BIG - 1);	/* cut off ``maildir:'' */
+	}
 
 	DM(pc, DEBUG_INFO, "maildir: str = '%s'\n", str);
 	DM(pc, DEBUG_INFO, "maildir: path= '%s'\n", pc->path);
@@ -133,3 +178,10 @@ int maildirCreate(Pop3 pc, char *str)
 }
 
 /* vim:set ts=4: */
+/*
+ * Local Variables:
+ * tab-width: 4
+ * c-indent-level: 4
+ * c-basic-offset: 4
+ * End:
+ */
diff --git a/wmbiff/mboxClient.c b/wmbiff/mboxClient.c
index 2fbee5a..febff7f 100644
--- a/wmbiff/mboxClient.c
+++ b/wmbiff/mboxClient.c
@@ -1,14 +1,19 @@
-/* $Id: mboxClient.c,v 1.6 2002/03/06 07:15:08 bluehal Exp $ */
+/* $Id: mboxClient.c,v 1.17 2004/03/28 00:28:58 bluehal Exp $ */
 /* Author:		Yong-iL Joh <tolkien at mizi.com>
    Modified:	Jorge Garc�a <Jorge.Garcia at uv.es>
    			 	Rob Funk <rfunk at funknet.net>
+   			 	Neil Spring <nspring at cs.washington.edu>
  * 
  * MBOX checker.
  *
- * Last Updated : Thu Apr 26 03:09:40 CEST 2001
+ * Last Updated : $Date: 2004/03/28 00:28:58 $
  *
  */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include "Client.h"
 #include <sys/stat.h>
 #include <errno.h>
@@ -21,95 +26,114 @@
 #define FROM_STR   "From "
 #define STATUS_STR "Status: "
 
-FILE *openMailbox(Pop3 pc)
+FILE *openMailbox(Pop3 pc, const char *mbox_filename)
 {
 	FILE *mailbox;
 
-	if ((mailbox = fopen(pc->path, "r")) == NULL) {
+	if ((mailbox = fopen(mbox_filename, "r")) == NULL) {
 		DM(pc, DEBUG_ERROR, "Error opening mailbox '%s': %s\n",
-		   pc->path, strerror(errno));
+		   mbox_filename, strerror(errno));
+		pc->TotalMsgs = -1;
+		pc->UnreadMsgs = -1;
 	}
 	return (mailbox);
 }
 
-int mboxCheckHistory(Pop3 pc)
+/* count the messages in a mailbox */
+static void countMessages(Pop3 pc, const char *mbox_filename)
 {
-	struct stat st;
-	struct utimbuf ut;
 	FILE *F;
 	char buf[BUF_SIZE];
-
-
 	int is_header = 0;
 	int next_from_is_start_of_header = 1;
 	int count_from = 0, count_status = 0;
 	int len_from = strlen(FROM_STR), len_status = strlen(STATUS_STR);
 
-	DM(pc, DEBUG_INFO, ">Mailbox: '%s'\n", pc->path);
+	F = openMailbox(pc, mbox_filename);
+	if (F == NULL)
+		return;
+
+	/* count message */
+	while (fgets(buf, BUF_SIZE, F)) {
+		if (buf[0] == '\n') {
+			/* a newline by itself terminates the header */
+			if (is_header)
+				is_header = 0;
+			else
+				next_from_is_start_of_header = 1;
+		} else if (!strncmp(buf, FROM_STR, len_from)) {
+			/* A line starting with "From" is the beginning of a new header.
+			   "From" in the text of the mail should get escaped by the MDA.
+			   If your MDA doesn't do that, it is broken.
+			 */
+			if (next_from_is_start_of_header)
+				is_header = 1;
+			if (is_header)
+				count_from++;
+		} else {
+			next_from_is_start_of_header = 0;
+			if (is_header && !strncmp(buf, STATUS_STR, len_status)
+				&& strrchr(buf, 'R')) {
+				count_status++;
+			}
+		}
+	}
+
+	DM(pc, DEBUG_INFO, "from: %d status: %d\n", count_from, count_status);
+	pc->TotalMsgs = count_from;
+	pc->UnreadMsgs = count_from - count_status;
+	fclose(F);
+}
+
+/* check file status; hold on to file information used 
+   to restore access time */
+int
+fileHasChanged(const char *mbox_filename, time_t * atime,
+			   time_t * mtime, off_t * size)
+{
+	struct stat st;
 
 	/* mbox file */
-	if (stat(pc->path, &st)) {
-		DM(pc, DEBUG_ERROR, "Can't stat mailbox '%s': %s\n",
-		   pc->path, strerror(errno));
-		return -1;				/* Error stating mailbox */
+	if (stat(mbox_filename, &st)) {
+		DMA(DEBUG_ERROR, "Can't stat '%s': %s\n",
+			mbox_filename, strerror(errno));
+	} else if (st.st_mtime != *mtime || st.st_size != *size) {
+		/* file was changed OR initially read */
+		DMA(DEBUG_INFO, " %s was changed,"
+			" mTIME: %lu -> %lu; SIZE: %lu -> %lu\n",
+			mbox_filename, *mtime, st.st_mtime,
+			(unsigned long) *size, (unsigned long) st.st_size);
+
+		*atime = st.st_atime;
+		*mtime = st.st_mtime;
+		*size = st.st_size;
+		return 1;
 	}
+	return 0;
+}
+
+int mboxCheckHistory(Pop3 pc)
+{
+	char *mbox_filename = backtickExpand(pc, pc->path);
+	struct utimbuf ut;
+
+	DM(pc, DEBUG_INFO, ">Mailbox: '%s'\n", mbox_filename);
 
-	if (st.st_mtime != PCM.mtime || st.st_size != PCM.size
+	if (fileHasChanged(mbox_filename, &ut.actime, &PCM.mtime, &PCM.size)
 		|| pc->OldMsgs < 0) {
-		/* file was changed OR initially read */
-		DM(pc, DEBUG_INFO,
-		   "  was changed,"
-		   " TIME: old %lu, new %lu"
-		   " SIZE: old %lu, new %lu\n",
-		   PCM.mtime, st.st_mtime, (unsigned long) PCM.size, st.st_size);
-		ut.actime = st.st_atime;
-		ut.modtime = st.st_mtime;
-		F = pc->open(pc);
-
-		/* count message */
-		while (fgets(buf, BUF_SIZE, F)) {
-			if (buf[0] == '\n') {
-				/* a newline by itself terminates the header */
-				if (is_header)
-					is_header = 0;
-				else
-					next_from_is_start_of_header = 1;
-			} else if (!strncmp(buf, FROM_STR, len_from)) {
-				/* A line starting with "From" is the beginning of a new header.
-				   "From" in the text of the mail should get escaped by the MDA.
-				   If your MDA doesn't do that, it is broken.
-				 */
-				if (next_from_is_start_of_header)
-					is_header = 1;
-				if (is_header)
-					count_from++;
-			} else {
-				next_from_is_start_of_header = 0;
-				if (!strncmp(buf, STATUS_STR, len_status)) {
-					if (strrchr(buf, 'R')) {
-						if (is_header)
-							count_status++;
-					}
-				}
-			}
-		}
 
-		DM(pc, DEBUG_INFO, "from: %d status: %d\n", count_from,
-		   count_status);
-		pc->TotalMsgs = count_from;
-		pc->UnreadMsgs = count_from - count_status;
-		fclose(F);
+		countMessages(pc, mbox_filename);
 
-		utime(pc->path, &ut);
-		/* Reset atime for MUTT and something others correctly work */
-		PCM.mtime = st.st_mtime;	/* Store new mtime */
-		PCM.size = st.st_size;	/* Store new size */
+		/* Reset atime for (at least) MUTT to work */
+		/* ut.actime is set above */
+		ut.modtime = PCM.mtime;
+		utime(mbox_filename, &ut);
 	}
-
+	free(mbox_filename);
 	return 0;
 }
 
-int mboxCreate(Pop3 pc, char *str)
+int mboxCreate(Pop3 pc, const char *str)
 {
 	/* MBOX format: mbox:fullpathname */
 
@@ -117,12 +141,17 @@ int mboxCreate(Pop3 pc, char *str)
 	pc->UnreadMsgs = 0;
 	pc->OldMsgs = -1;
 	pc->OldUnreadMsgs = -1;
-	pc->open = openMailbox;
 	pc->checkMail = mboxCheckHistory;
 
 	/* default boxes are mbox... cut mbox: if it exists */
-	if (!strncasecmp(pc->path, "mbox:", 5))
-		strcpy(pc->path, str + 5);	/* cut off ``mbox:'' */
+	if (!strncasecmp(pc->path, "mbox:", 5)) {
+		if (strlen(str + 5) + 1 > BUF_BIG) {
+			DM(pc, DEBUG_ERROR, "mbox '%s' is too long.\n", str + 5);
+			memset(pc->path, 0, BUF_BIG);
+		} else {
+			strncpy(pc->path, str + 5, BUF_BIG - 1);	/* cut off ``mbox:'' */
+		}
+	}
 
 	DM(pc, DEBUG_INFO, "mbox: str = '%s'\n", str);
 	DM(pc, DEBUG_INFO, "mbox: path= '%s'\n", pc->path);
@@ -131,3 +160,10 @@ int mboxCreate(Pop3 pc, char *str)
 }
 
 /* vim:set ts=4: */
+/*
+ * Local Variables:
+ * tab-width: 4
+ * c-indent-level: 4
+ * c-basic-offset: 4
+ * End:
+ */
diff --git a/wmbiff/passwordMgr.c b/wmbiff/passwordMgr.c
new file mode 100644
index 0000000..120df4c
--- /dev/null
+++ b/wmbiff/passwordMgr.c
@@ -0,0 +1,298 @@
+/* passwordMgr.c 
+ * Author: Neil Spring 
+ */
+/* this module implements a password cache: the goal is to
+   allow multiple wmbiff mailboxes that are otherwise
+   independent get all their passwords while only asking the
+   user for an account's password once. */
+/* NOTE: it will fail if a user has different passwords for
+   pop vs. imap on the same server; this seems too far
+   fetched to be worth complexity */
+
+/* NOTE: it verifies that the askpass program, which, if
+   given with a full path, must be owned either by the user
+   or by root.  There may be decent reasons not to do
+   this. */
+
+/* Intended properties: 1) exit()s if the user presses
+   cancel from askpass - this is detected by no output from
+   askpass.  2) allows the caller to remove a cached entry
+   if it turns out to be wrong, and prompt the user
+   again. This might be poor if the askpass program is
+   replaced with something non-interactive. */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+
+#include "passwordMgr.h"
+#include "Client.h"
+#include "charutil.h"			/* chomp */
+#include <unistd.h>
+#include <sys/types.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <string.h>
+#include <strings.h>			/* index */
+#include <sys/stat.h>
+#include "assert.h"
+
+#ifdef HAVE_MEMFROB
+#define DEFROB(x) memfrob(x, x ## _len)
+#define ENFROB(x) memfrob(x, x ## _len)
+#else
+#define DEFROB(x)
+#define ENFROB(x)
+#endif
+
+typedef struct password_binding_struct {
+	struct password_binding_struct *next;
+	char user[BUF_SMALL];
+	char server[BUF_BIG];
+	char password[BUF_SMALL];	/* may be frobnicated */
+	unsigned char password_len;	/* frobnicated *'s are nulls */
+} *password_binding;
+
+static password_binding pass_list = NULL;
+
+/* verifies that askpass_fname, if it has no spaces, exists as 
+   a file, is owned by the user or by root, and is not world 
+   writeable.   This is just a sanity check, and is not intended 
+   to ensure the integrity of the password-asking program. */
+/* would be static, but used in test_wmbiff */
+int permissions_ok(Pop3 pc, const char *askpass_fname)
+{
+	struct stat st;
+	if (index(askpass_fname, ' ')) {
+		DM(pc, DEBUG_INFO,
+		   "askpass has a space in it; not verifying ownership/permissions on '%s'\n",
+		   askpass_fname);
+		return (1);
+	}
+	if (stat(askpass_fname, &st)) {
+		DM(pc, DEBUG_ERROR, "Can't stat askpass program: '%s'\n",
+		   askpass_fname);
+		if (askpass_fname[0] != '/') {
+			DM(pc, DEBUG_ERROR,
+			   "For your own good, use a full pathname.\n");
+		}
+		return (0);
+	}
+	if (st.st_uid != 0 && st.st_uid != getuid()) {
+		DM(pc, DEBUG_ERROR,
+		   "askpass program isn't owned by you or root: '%s'\n",
+		   askpass_fname);
+		return (0);
+	}
+	if (st.st_mode & S_IWOTH) {
+		DM(pc, DEBUG_ERROR,
+		   "askpass program is world writable: '%s'\n", askpass_fname);
+		return (0);
+	}
+	return (1);
+}
+
+#ifdef HAVE_CORESERVICES_CORESERVICES_H
+#ifdef HAVE_SECURITY_SECURITY_H
+#define HAVE_APPLE_KEYCHAIN
+#endif
+#endif
+
+
+#ifdef HAVE_APPLE_KEYCHAIN
+/* routines to use apple's keychain to get a password
+   without a user having to type.  this avoids some damage
+   where although ssh-askpass can grab focus within X, it
+   may not have a particularly secure keyboard. */
+
+#include<CoreServices/CoreServices.h>
+#include<Security/Security.h>
+
+static void
+get_password_from_keychain(Pop3 pc, const char *username,
+						   const char *servername,
+						   /*@out@ */ char *password,
+						   /*@out@ */
+						   unsigned char *password_len)
+{
+	SecKeychainRef kc;
+	OSStatus rc;
+	char *secpwd;
+	UInt32 pwdlen;
+	rc = SecKeychainCopyDefault(&kc);
+	if (rc != noErr) {
+		DM(pc, DEBUG_ERROR, "passmgr: unable to open keychain, exiting\n");
+		exit(EXIT_FAILURE);
+	}
+	rc = SecKeychainFindInternetPassword(kc, strlen(servername),
+										 servername, 0, NULL,
+										 strlen(username), username, 0,
+										 NULL, 0, NULL,
+										 kSecAuthenticationTypeDefault,
+										 &pwdlen, (void **) &secpwd, NULL);
+	if (rc != noErr) {
+		DM(pc, DEBUG_ERROR,
+		   "passmgr: keychain password grab failed, exiting\n");
+		DM(pc, DEBUG_ERROR, "passmgr: (perhaps you pressed 'deny')\n");
+		/* this seems like the sanest thing to do, for now */
+		exit(EXIT_FAILURE);
+	}
+
+	if (pwdlen < *password_len) {
+		strncpy(password, secpwd, pwdlen);
+		password[pwdlen] = '\0';
+		*password_len = pwdlen;
+	} else {
+		DM(pc, DEBUG_ERROR,
+		   "passmgr: warning: your password appears longer (%lu) than expected (%d)\n",
+		   strlen(secpwd), *password_len - 1);
+	}
+	rc = SecKeychainItemFreeContent(NULL, secpwd);
+	return;
+}
+#endif							/* apple keychain */
+
+
+static void
+get_password_from_command(Pop3 pc, const char *username,
+						  const char *servername,
+						  /*@out@ */ char *password,
+						  /*@out@ */
+						  unsigned char *password_len)
+{
+	password[*password_len - 1] = '\0';
+	password[0] = '\0';
+	/* check that the executed file is a good one. */
+	if (permissions_ok(pc, pc->askpass)) {
+		char *command;
+		char *password_ptr;
+		int len =
+			strlen(pc->askpass) + strlen(username) +
+			strlen(servername) + 40;
+		command = malloc(len);
+		snprintf(command, len, "%s 'password for wmbiff: %s@%s'",
+				 pc->askpass, username, servername);
+
+		(void) grabCommandOutput(pc, command, &password_ptr, NULL);
+		/* it's not clear what to do with the exit
+		   status, though we can get it from
+		   grabCommandOutput if needed to deal with some
+		   programs that will print a message but exit
+		   non-zero on error */
+		free(command);
+
+		if (password_ptr == NULL) {
+			/* this likely means that the user cancelled, and doesn't
+			   want us to keep asking about the password. */
+			DM(pc, DEBUG_ERROR,
+			   "passmgr: fgets password failed, exiting\n");
+			DM(pc, DEBUG_ERROR,
+			   "passmgr: (it looks like you pressed 'cancel')\n");
+			/* this seems like the sanest thing to do, for now */
+			exit(EXIT_FAILURE);
+		}
+		strncpy(password, password_ptr, *password_len);
+		if (password[*password_len - 1] != '\0') {
+			DM(pc, DEBUG_ERROR,
+			   "passmgr: warning: your password appears longer (%lu) than expected (%d)\n",
+			   (unsigned long) strlen(password_ptr), *password_len - 1);
+		}
+		free(password_ptr);
+		password[*password_len - 1] = '\0';
+		*password_len = strlen(password);
+	} else {
+		/* consider this error to be particularly troublesome */
+		DM(pc, DEBUG_ERROR,
+		   "passmgr: permissions check of '%s' failed.", pc->askpass);
+		exit(EXIT_FAILURE);
+	}
+}
+
+char *passwordFor(const char *username,
+				  const char *servername, Pop3 pc, int bFlushCache)
+{
+
+	password_binding p;
+
+	assert(username != NULL);
+	assert(username[0] != '\0');
+
+	/* find the binding */
+	for (p = pass_list;
+		 p != NULL
+		 && (strcmp(username, p->user) != 0 ||
+			 strcmp(servername, p->server) != 0); p = p->next);
+
+	/* if so, return the password */
+	if (p != NULL) {
+		if (p->password[0] != '\0') {
+			if (bFlushCache == 0) {
+				char *ret = strdup(p->password);
+#ifdef HAVE_MEMFROB
+				unsigned short ret_len = p->password_len;
+				DEFROB(ret);
+#endif
+				return (ret);
+			}
+			/* else fall through, overwrite */
+		} else if (pc) {
+			/* if we've asked, but received nothing, disable this box */
+			pc->checkMail = NULL;
+			return (NULL);
+		}
+	} else {
+		p = (password_binding)
+			malloc(sizeof(struct password_binding_struct));
+	}
+
+	/* else, try to get it. */
+	if (pc->askpass != NULL) {
+		char *retval;
+
+		p->password_len = 32;
+#ifdef HAVE_APPLE_KEYCHAIN
+		if (strcmp(pc->askpass, "internal:apple:keychain") == 0) {
+			get_password_from_keychain(pc, username, servername,
+									   p->password, &p->password_len);
+		} else {
+			DM(pc, DEBUG_ERROR,
+			   "you could change your askpass line to:\n"
+			   "    askpass = internal:apple:keychain\n"
+			   "to use the OS X keychain instead of running a command\n");
+#endif
+			get_password_from_command(pc, username, servername,
+									  p->password, &p->password_len);
+#ifdef HAVE_APPLE_KEYCHAIN
+		}
+#endif
+		retval = strdup(p->password);
+		if (strlen(username) + 1 > BUF_SMALL) {
+			DM(pc, DEBUG_ERROR, "username is too long.\n");
+			memset(p->user, 0, BUF_SMALL);
+		} else {
+			strncpy(p->user, username, BUF_SMALL - 1);
+		}
+		if (strlen(servername) + 1 > BUF_BIG) {
+			DM(pc, DEBUG_ERROR, "servername is too long.\n");
+			memset(p->server, 0, BUF_BIG);
+		} else {
+			strncpy(p->server, servername, BUF_BIG - 1);
+		}
+		ENFROB(p->password);
+		p->next = pass_list;
+		pass_list = p;
+		return (retval);
+	}
+
+	return (NULL);
+}
+
+/* vim:set ts=4: */
+/*
+ * Local Variables:
+ * tab-width: 4
+ * c-indent-level: 4
+ * c-basic-offset: 4
+ * End:
+ */
diff --git a/wmbiff/passwordMgr.h b/wmbiff/passwordMgr.h
new file mode 100644
index 0000000..3b91fc3
--- /dev/null
+++ b/wmbiff/passwordMgr.h
@@ -0,0 +1,8 @@
+#include "Client.h"
+
+/*@mustfree@*/ char *passwordFor(const char *username,
+								 const char *servername, Pop3 pc,
+								 int bFlushCache);
+
+/* tested by test_wmbiff; don't use this for anything. */
+int permissions_ok(Pop3 pc, const char *askpass_fname);
diff --git a/wmbiff/regulo.c b/wmbiff/regulo.c
new file mode 100644
index 0000000..507cd19
--- /dev/null
+++ b/wmbiff/regulo.c
@@ -0,0 +1,134 @@
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <ctype.h>
+#include <sys/types.h>
+#include <regex.h>
+#include <ctype.h>
+
+#include "regulo.h"
+#include "charutil.h"
+
+#define min(a,b) ((a)<(b) ? (a) : (b))
+
+/* callbacks specified by the calling function to extract
+   substrings to values. */
+void regulo_atoi(void *dest_int, const char *source)
+{
+	/* skip any leading non-digit */
+	while (*source != '\0' && !isdigit(*source))
+		source++;
+
+	*(int *) dest_int = atoi(source);
+}
+
+void regulo_strcpy(void *dest, const char *source)
+{
+	strcpy((char *) dest, source);
+}
+
+void regulo_strcpy_tolower(void *dest, const char *source)
+{
+	unsigned int i;
+	for (i = 0; i < strlen(source); i++) {
+		((char *) dest)[i] = tolower(source[i]);
+	}
+	((char *) dest)[i] = '\0';
+}
+
+void regulo_strcpy_skip1(void *dest, const char *source)
+{
+	strcpy((char *) dest, source + 1);
+}
+
+#ifdef USE_GNU_REGEX
+/* deprecated as unportable */
+
+int
+regulo_match(const char *regex,
+			 const char *string, const struct regulo *instructions)
+{
+	struct re_registers regs;
+	int ret;
+	int matchedchars;
+	int i;
+	memset(&regs, 0, sizeof(struct re_registers));
+	matchedchars = compile_and_match_regex(regex, string, &regs);
+	if (matchedchars <= 0)
+		return 0;
+	if (instructions == NULL)
+		return 1;
+	for (i = 0; instructions[i].match_handler != NULL; i++) {
+		char buf[255];
+		int j = instructions[i].match_index;
+		int len = min(254, regs.end[j] - regs.start[j]);
+		if (regs.start[j] >= 0) {
+			strncpy(buf, string + regs.start[j], len);
+			buf[len] = '\0';
+			instructions[i].match_handler(instructions[i].destination,
+										  buf);
+		}
+	}
+	ret = regs.end[0];
+	free(regs.end);				// added 3 jul 02, appeasing valgrind
+	free(regs.start);			// added 3 jul 02, appeasing valgrind
+	return ret;
+}
+
+#else
+/* favored */
+
+int compile_and_match_regex_posix(const char *regex, const char *str,	/*@out@ */
+								  regmatch_t * regs, size_t regs_len)
+{
+	regex_t reg;
+	int errcode;
+	if ((errcode = regcomp(&reg, regex, REG_EXTENDED)) != 0) {
+		char errbuf[256];
+		regerror(errcode, &reg, errbuf, 256);
+		fprintf(stderr, "error in compiling regular expression: %s\n",
+				errbuf);
+		return -1;
+	}
+
+	errcode = regexec(&reg, str, regs_len, regs, 0);
+	regfree(&reg);
+	if (errcode == 0)
+		return 1;
+	else
+		return 0;
+}
+
+
+int
+regulo_match(const char *regex,
+			 const char *string, const struct regulo *instructions)
+{
+	regmatch_t regs[20];
+	int ret;
+	int matchedchars;
+	int i;
+	matchedchars = compile_and_match_regex_posix(regex, string, regs, 20);
+	if (matchedchars <= 0)
+		return 0;
+	if (instructions == NULL)
+		return 1;
+	for (i = 0; instructions[i].match_handler != NULL; i++) {
+		char buf[255];
+		int j = instructions[i].match_index;
+		int len = min(254, regs[j].rm_eo - regs[j].rm_so);
+		if (regs[j].rm_so >= 0) {
+			strncpy(buf, string + regs[j].rm_so, len);
+			buf[len] = '\0';
+			instructions[i].match_handler(instructions[i].destination,
+										  buf);
+		}
+	}
+	ret = regs[0].rm_eo;
+	return ret;
+}
+
+#endif
diff --git a/wmbiff/regulo.h b/wmbiff/regulo.h
new file mode 100644
index 0000000..4bce791
--- /dev/null
+++ b/wmbiff/regulo.h
@@ -0,0 +1,17 @@
+/* $Id: regulo.h,v 1.2 2003/03/02 02:17:14 bluehal Exp $ */
+/* regulo, (pronounced as if the name of a super-hero) added
+   by Neil Spring to provide a portable interface to regular
+   expressions that doesn't suck. */
+
+void regulo_atoi(void *dest_int, const char *source);
+void regulo_strcpy(void *dest, const char *source);
+void regulo_strcpy_tolower(void *dest, const char *source);
+void regulo_strcpy_skip1(void *dest, const char *source);
+struct regulo {
+	int match_index;
+	void *destination;
+	void (*match_handler) (void *dest, const char *source);
+};
+
+int regulo_match(const char *regex,
+				 const char *string, const struct regulo *instructions);
diff --git a/wmbiff/sample.wmbiffrc b/wmbiff/sample.wmbiffrc
index 660456b..5b447f1 100644
--- a/wmbiff/sample.wmbiffrc
+++ b/wmbiff/sample.wmbiffrc
@@ -1,10 +1,47 @@
-# $Id: sample.wmbiffrc,v 1.8 2002/03/06 07:15:08 bluehal Exp $
+# $Id: sample.wmbiffrc,v 1.18 2003/11/09 07:01:15 bluehal Exp $
 #
 # See wmbiffrc(5) for more info.
 #
 # Global interval -- seconds between check mailboxes
 interval=60
 
+# Global askpass -- choose a password acting program
+# that behaves like ssh-askpass.  The default is 
+# askpass = /usr/bin/ssh-askpass.
+# askpass is invoked on IMAP entries that have no password
+# below.
+# the commented version below is likely to work on RedHat 
+# systems; wmbiff's default is likely to work on Debian
+# systems with ssh-askpass installed.
+#askpass = /usr/libexec/openssh/x11-ssh-askpass
+
+# If you'd like it to be visually distinct so that
+# you aren't confused with your normal passphrase:
+#askpass = /usr/bin/ssh-askpass -fg cyan -bg black -xrm '*Dialog.font: -b&h-lucida-medium-r-normal-*-*-100-*-*-*-*-iso8859-1' -xrm '*Dialog.title: WMBiff Password Entry'
+
+# If you're writing a better program for password prompting,
+# or that stores passwords cleverly, and don't like that
+# wmbiff adds 'password for wmbiff: user at site' to the command
+# line, you can use something like this:
+#askpass = /bin/echo mypassword ; true
+
+# If you's like to chain the password to another program,
+# such as kinit for Kerberos authentication, use (with the
+# ruby interpreter installed):
+askpass = /usr/bin/ssh-askpass -fg cyan -bg black -xrm '*Dialog.title: WMBiff Password Entry' | /usr/bin/ruby -e 'm = gets; IO.popen("/usr/bin/kinit > /dev/null", "w").puts(m); puts(m)' && true
+
+# Skin.  A different source pixmap can be loaded dynamically.
+# If not a full path, wmbiff will search /usr/share/wmbiff:/usr/local/share/wmbiff:.
+# which is intended to keep the .wmbiffrc simple and portable to
+# different systems with wmbiff installed differently.
+#
+# default
+#skinfile=wmbiff-master-led.xpm
+# higher contrast for lower-color displays
+#skinfile=wmbiff-master-contrast.xpm
+# make your own derivative and submit it 
+# to us at wmbiff-devel at lists.sourceforge.net
+
 ### First string ###
 
 # Label, that will be displayed
@@ -13,11 +50,17 @@ label.0=Spool
 # Path to mailbox for UNIX-style mailboxes,
 # or pop3:user:password at mailserver[:port] for POP3 accounts
 # port are optional, default - 110
-path.0=/var/mail/gb
+path.0=mbox:/var/mail/gb
+
+# Command, which will be executed for new mail in any watched mailbox
+globalnotify=my_play /home/gb/sounds/new_mail_has_arrived.wav
 
 # Command, which executed on new mail arrival, or special keyword 'beep'
 #notify.0=beep
-notify.0=my_play /home/gb/sounds/new_mail_has_arrived.wav
+#notify.0=my_play /home/gb/sounds/new_mail_has_arrived.wav
+
+# Don't want any global notification for this mailbox
+notify.0=true
 
 # Command, which executed on left mouse click on label 
 action.0=rxvt -name mutt -e mutt
@@ -39,7 +82,7 @@ action.0=rxvt -name mutt -e mutt
 label.1 = MBOX
 # MBOX format: mbox:fullpathname
 path.1=mbox:/home/gb/mail/10_ksi-linux-list
-notify.1=my_play /home/gb/sounds/new_mail_has_arrived.wav
+#notify.1=my_play /home/gb/sounds/new_mail_has_arrived.wav
 action.1=rxvt -name mutt -e mutt -f /home/gb/mail/10_ksi-linux-list
 
 # label.1 = MDIR
@@ -63,7 +106,7 @@ action.2=licq&
 label.3=POP3
 # pop3 format: pop3:user:password at server[:port] [auth]
 path.3=pop3:user:password at server apop
-notify.3=my_play /home/gb/sounds/new_mail_has_arrived.wav
+#notify.3=my_play /home/gb/sounds/new_mail_has_arrived.wav
 action.3=rxvt -name mutt -e mutt -f /home/gb/mail/30_nftp-list
 interval.3=300		# 5 minutes
 fetchinterval.3=-1
@@ -72,6 +115,7 @@ fetchcmd.3=fetchmail
 label.4=IMAP4
 # IMAP4 format: imap:user:password at server[/mailbox][:port] [auth]
 # mailbox is optional, default - INBOX
+# password is optional, default - ask using the askpass config
 # port is optional, default - 143
 path.4=imap:user:password at server
 interval.4=300		# 5 minutes
@@ -79,6 +123,21 @@ interval.4=300		# 5 minutes
 # label.4=IMAPS
 # Secure IMAP format: imaps:user:password at server[/mailbox][:port] [auth]
 # mailbox is optional, default - INBOX
+# password is optional, default - ask using the askpass config
 # port is optional, default - 993
 # path.4=imaps:user:password at server cram-md5
 # interval.4=300          # 5 minutes
+
+# Shell expansion.  (can't be nested.)
+# path.4=mbox:/home/me/Mail/`ls -t1 /home/me/Mail/list-archive-* | head -1`
+# label.4=tick
+
+# Shell method
+# path.4=shell:::lpq | grep Queue | awk '{print $2}'
+
+# To check for security updates in debian
+path.4=shell:::/usr/lib/wmbiff/security.debian.rb
+
+# Ways wmbiff can drive MAC OS X Mail using AppleScript.
+# action.0 = osascript -e 'tell application "Mail"' -e 'set selected mailboxes of first message viewer to {mailbox "in-grads" of imap account "me at myaccount.org"}' -e 'activate' -e 'end tell'
+# action.1 = osascript -e 'tell application "Mail"' -e 'set selected mailboxes of first message viewer to {inbox}' -e 'activate' -e 'end tell'
diff --git a/wmbiff/socket.c b/wmbiff/socket.c
index 4e353ba..b83bb1b 100644
--- a/wmbiff/socket.c
+++ b/wmbiff/socket.c
@@ -1,4 +1,4 @@
-/* $Id: socket.c,v 1.3 2001/10/04 09:50:59 jordi Exp $ */
+/* $Id: socket.c,v 1.14 2004/10/01 21:05:36 bluehal Exp $ */
 /* Copyright (C) 1998 Trent Piepho  <xyzzy at u.washington.edu>
  *           (C) 1999 Trent Piepho  <xyzzy at speakeasy.org>
  *
@@ -14,48 +14,167 @@
  * 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., 675
  * Mass Ave, Cambridge, MA 02139, USA.  */
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+#include <stdio.h>
 #include <unistd.h>
-#include <fcntl.h>
 #include <sys/types.h>
+#include <fcntl.h>
 #include <time.h>
 #include <sys/stat.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
+#include <arpa/inet.h>
+#include <errno.h>
+#include <string.h>
 #include <netdb.h>
 #include <stdio.h>
+#include "regulo.h"
 
 #ifdef USE_DMALLOC
 #include <dmalloc.h>
 #endif
 
-int sock_connect(const char *hostname, int port)
+/* be paranoid about leaking passwords as hostnames, enough
+   that we'll avoid attempting lookups on things that aren't
+   host names */
+extern int Relax;
+static int sanity_check_hostname(const char *hostname)
+{
+	struct in_addr dummy;
+	return (Relax
+			|| regulo_match("^[A-Za-z][-_A-Za-z0-9.]+$", hostname, NULL)
+			|| inet_aton(hostname, &dummy));
+}
+
+static int ipv4_sock_connect(struct in_addr *address, short port)
 {
-	struct hostent *host;
 	struct sockaddr_in addr;
 	int fd, i;
-
-	host = gethostbyname(hostname);
-	if (host == NULL) {
-		herror("gethostbyname");
-		return (-1);
-	};
-
 	fd = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
 	if (fd == -1) {
 		perror("Error opening socket");
+		printf("socket() failed.\n");
 		return (-1);
 	};
 
 	addr.sin_family = AF_INET;
-	addr.sin_addr.s_addr = *(u_long *) host->h_addr_list[0];
+	addr.sin_addr.s_addr = *(u_long *) address;
 	addr.sin_port = htons(port);
 	i = connect(fd, (struct sockaddr *) &addr, sizeof(struct sockaddr));
 	if (i == -1) {
+		int saved_errno = errno;
 		perror("Error connecting");
+		printf("connect(%s:%d) failed: %s\n", inet_ntoa(addr.sin_addr),
+			   port, strerror(saved_errno));
 		close(fd);
 		return (-1);
 	};
 	return (fd);
 }
 
+/* nspring/blueHal, 10 Apr 2002; added some extra error
+   printing, in line with the debug-messages-to-stdout
+   philosophy of the rest of the wmbiff code */
+/* 1 June 2002; incorporated IPv6 support by 
+   Jun-ichiro itojun Hagino <itojun at iijlab.net>, thanks! */
+
+int sock_connect(const char *hostname, int port)
+{
+#ifdef HAVE_GETADDRINFO
+	struct addrinfo hints, *res, *res0;
+	struct sockaddr_in addr;
+	int fd;
+	char pbuf[NI_MAXSERV];
+	int error;
+
+	if (!sanity_check_hostname(hostname)) {
+		printf
+			("socket/connect to '%s' aborted: it does not appear to be a valid hostname\n",
+			 hostname);
+		printf("if you really want this, use wmbiff's -relax option.\n");
+		return -1;
+	}
+
+	/* we were given an IP address, no need to try getaddrinfo on it */
+	if (inet_aton(hostname, &addr.sin_addr)) {
+		return ipv4_sock_connect(&addr.sin_addr, port);
+	}
+
+	memset(&hints, 0, sizeof(hints));
+	hints.ai_socktype = SOCK_STREAM;
+	snprintf(pbuf, sizeof(pbuf), "%d", port);
+	error = getaddrinfo(hostname, pbuf, &hints, &res0);
+	if (error) {
+		static int last_error;
+		if (last_error != error) {
+			/* only report a problem if it's new.  this is an 
+			   approximation that minimizes kept state. */
+			printf("%s: %s\n", hostname, gai_strerror(error));
+			last_error = error;
+		}
+		return -1;
+	}
+
+	fd = -1;
+	for (res = res0; res; res = res->ai_next) {
+		fd = socket(res->ai_family, res->ai_socktype, res->ai_protocol);
+		if (fd < 0)
+			continue;
+		if (connect(fd, res->ai_addr, res->ai_addrlen) < 0) {
+			close(fd);
+			fd = -1;
+			continue;
+		}
+		break;
+	}
+	freeaddrinfo(res0);
+	if (fd < 0) {
+		static int last_connecterr;
+		if (errno != last_connecterr) {
+			/* only report a problem if it's new.
+			   EHOSTUNREACH is common when the net is down,
+			   for example; again, this is an approximation 
+			   to minimize kept state. */
+			last_connecterr = errno;
+			fprintf(stderr, "Error connecting to %s:%d: %s\n",
+					hostname, port, strerror(errno));
+			printf("socket/connect to %s failed: %s (%d)\n", hostname,
+				   strerror(errno), errno);
+		}
+		return -1;
+	}
+	return fd;
+#else
+#warning "This build will not support IPv6"
+	struct hostent *host;
+
+	if (!sanity_check_hostname(hostname)) {
+		printf
+			("socket/connect to '%s' aborted: it does not appear to be a valid hostname\n",
+			 hostname);
+		printf("if you really want this, use wmbiff's -relax option.\n");
+		return -1;
+	}
+
+	host = gethostbyname(hostname);
+	if (host == NULL) {
+		herror("gethostbyname");
+		printf("gethostbyname(%s) failed.\n", hostname);
+		return (-1);
+	};
+
+	return ipv4_sock_connect(host->h_addr_list[0], port);
+
+#endif
+}
+
 /* vim:set ts=4: */
+/*
+ * Local Variables:
+ * tab-width: 4
+ * c-indent-level: 4
+ * c-basic-offset: 4
+ * End:
+ */
diff --git a/wmbiff/test-wmbiffrc.shell b/wmbiff/test-wmbiffrc.shell
deleted file mode 100644
index a84c552..0000000
--- a/wmbiff/test-wmbiffrc.shell
+++ /dev/null
@@ -1,24 +0,0 @@
-# $Id: test-wmbiffrc.shell,v 1.1 2002/03/06 07:15:08 bluehal Exp $
-#
-# test wmbiffrc for the shell command and gicu method.
-# see sample.wmbiffrc and wmbiffrc.5 as documentation for the format.
-#
-interval=10
-
-label.0=one
-path.0=shell:::echo 1
-
-label.1=two
-path.1=shell:::echo 2
-
-label.2=uptm
-path.2=shell:::uptime | awk '{print $3}'
-
-label.3=mem
-path.3=shell:::grep Mem: < /proc/meminfo | awk '{ print $3 " * 100 / " $2}' | bc
-
-label.3=gicu
-path.3=gicu:38673016
-
-label.4=nouin
-path.4=gicu:
diff --git a/wmbiff/test_tlscomm.c b/wmbiff/test_tlscomm.c
new file mode 100644
index 0000000..e0a6fa2
--- /dev/null
+++ b/wmbiff/test_tlscomm.c
@@ -0,0 +1,99 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/time.h>
+#include <unistd.h>
+
+int debug_default = 2;
+int SkipCertificateCheck = 0;
+const char *certificate_filename = NULL;
+int exists(const char *filename __attribute__ ((unused)))
+{
+	return (0);
+}
+
+int print_info(void *state __attribute__ ((unused)))
+{
+	return (0);
+}
+
+int Relax = 1;
+
+
+int indices[12];
+const char *sequence[][4] = {
+	{NULL, NULL, NULL, NULL},
+	{"prefix", " hello", NULL},
+	{"pre", "fix", " hello", NULL},
+	{"\r\n", ")\r\n", "prefix", NULL},
+	{NULL, NULL, NULL, NULL},
+};
+
+/* trick tlscomm into believing it can read. */
+ssize_t read(int s, void *buf, size_t buflen)
+{
+	int val = indices[s]++;
+
+	if (sequence[s][val] == NULL) {
+		indices[s]--;			/* make it stay */
+		return 0;
+	} else {
+		strncpy(buf, sequence[s][val], buflen);
+		printf("read: %s\n", sequence[s][val]);
+		return (strlen(sequence[s][val]));
+	}
+}
+
+int
+select(int nfds, fd_set * r,
+	   fd_set * w __attribute__ ((unused)),
+	   fd_set * x __attribute__ ((unused)),
+	   struct timeval *tv __attribute__ ((unused)))
+{
+	int i;
+	int ready = 0;
+	for (i = 0; i < nfds; i++) {
+		if (FD_ISSET(i, r) && sequence[i][indices[i]] != NULL) {
+			ready++;
+		} else {
+			FD_CLR(i, r);
+		}
+	}
+	if (ready == 0) {
+		printf("botched.\n");
+	}
+	return ready;
+}
+
+#define BUF_SIZE 1024
+
+struct connection_state {
+	int sd;
+	char *name;
+	/*@null@ */ void *tls_state;
+	/*@null@ */ void *xcred;
+	char unprocessed[BUF_SIZE];
+	void *pc;					/* mailbox handle for debugging messages */
+};
+
+int
+main(int argc __attribute__ ((unused)), char **argv
+	 __attribute__ ((unused)))
+{
+	char buf[255];
+	struct connection_state scs;
+	scs.name = strdup("test");
+	scs.unprocessed[0] = '\0';
+	scs.pc = NULL;
+	scs.tls_state = NULL;
+	scs.xcred = NULL;
+	alarm(10);
+
+	for (scs.sd = 1; sequence[scs.sd][0] != NULL; scs.sd++) {
+		memset(scs.unprocessed, 0, BUF_SIZE);
+		printf("%d\n", tlscomm_expect(&scs, "prefix", buf, 255));
+	}
+	return 0;
+
+}
diff --git a/wmbiff/test_wmbiff.c b/wmbiff/test_wmbiff.c
new file mode 100644
index 0000000..2e23f57
--- /dev/null
+++ b/wmbiff/test_wmbiff.c
@@ -0,0 +1,458 @@
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#ifdef HAVE___ATTRIBUTE__
+#define UNUSED(x) /*@unused@*/  x __attribute__((unused))
+#else
+#define UNUSED(x) x
+#endif
+
+#ifdef HAVE_MEMFROB
+#define DEFROB(x) memfrob(x, x ## _len)
+#define ENFROB(x) memfrob(x, x ## _len)
+#else
+#define DEFROB(x)
+#define ENFROB(x)
+#endif
+
+#include <unistd.h>
+
+#include "Client.h"
+#include "passwordMgr.h"
+#include "tlsComm.h"
+#include "charutil.h"
+
+int debug_default = DEBUG_INFO;
+int Relax = 1;
+
+/* return 1 if fail, 0 if success */
+int test_backtickExpand(void)
+{
+	const char *tests[] = { "prefix`echo 1`suffix",
+		"prefix`echo 1`",
+		"`echo 1`",
+		"`echo a b` c",
+		"`false`",
+		NULL
+	};
+	const char *solns[] = { "prefix1suffix",
+		"prefix1",
+		"1",
+		"a b c",
+		"",
+		NULL
+	};
+	int i;
+	int retval = 0;
+	for (i = 0; tests[i] != NULL; i++) {
+		char *x = backtickExpand(NULL, tests[i]);
+		if (strcmp(x, solns[i]) != 0) {
+			printf("test failed: [%s] != [%s]\n", tests[i], solns[i]);
+			retval = 1;
+		}
+		free(x);
+	}
+	printf("backtick tests complete\n");
+	return (retval);
+}
+
+#define CKSTRING(x,shouldbe) if(strcmp(x,shouldbe)) { \
+printf("FAILED: expected '" #shouldbe "' but got '%s'\n", x); \
+ return 1; } else { printf("good: '" shouldbe "' == '%s'\n", x); }
+
+/* return 1 if fail, 0 if success */
+int test_passwordMgr(void)
+{
+	const char *b;
+	mbox_t m;
+	strcpy(m.label, "x");
+
+	/* sh is almost certainly conforming; owned by root, etc. */
+	if (!permissions_ok(NULL, "/bin/sh")) {
+		printf("FAILURE: permission checker failed on /bin/sh.");
+		return (1);
+	}
+	/* tmp is definitely bad; and better be og+w */
+	if (permissions_ok(NULL, "/tmp")) {
+		printf("FAILURE: permission checker failed on /tmp.");
+		return (1);
+	}
+	/* TODO: also find some user-owned binary that shouldn't be g+w */
+	printf("SUCCESS: permission checker sanity check went well.\n");
+
+	/* *** */
+	m.askpass = "echo xlnt; #";
+
+	b = passwordFor("bill", "ted", &m, 0);
+	if (strcmp(b, "xlnt") != 0) {
+		printf("FAILURE: expected 'xlnt' got '%s'\n", b);
+		return (1);
+	}
+	printf("SUCCESS: expected 'xlnt' got '%s'\n", b);
+
+	/* *** */
+	m.askpass = "should be cached";
+	b = passwordFor("bill", "ted", &m, 0);
+	if (strcmp(b, "xlnt") != 0) {
+		printf("FAILURE: expected 'xlnt' got '%s'\n", b);
+		return (1);
+	}
+
+	printf("SUCCESS: cached 'xlnt' correctly\n");
+
+	/* *** */
+	m.askpass = "echo abcdefghi1abcdefghi2abcdefghi3a; #";
+
+	b = passwordFor("abbot", "costello", &m, 0);
+	if (strcmp(b, "abcdefghi1abcdefghi2abcdefghi3a") != 0) {
+		printf
+			("FAILURE: expected 'abcdefghi1abcdefghi2abcdefghi3a' got '%s'\n",
+			 b);
+		return (1);
+	}
+	printf
+		("SUCCESS: expected 'abcdefghi1abcdefghi2abcdefghi3a' got '%s'\n",
+		 b);
+
+	/* try overflowing the buffer */
+	m.askpass = "echo abcdefghi1abcdefghi2abcdefghi3ab; #";
+	b = passwordFor("laverne", "shirley", &m, 0);
+	/* should come back truncated to fill the buffer */
+	if (strcmp(b, "abcdefghi1abcdefghi2abcdefghi3a") != 0) {
+		printf
+			("FAILURE: expected 'abcdefghi1abcdefghi2abcdefghi3a' got '%s'\n",
+			 b);
+		return (1);
+	}
+	printf
+		("SUCCESS: expected 'abcdefghi1abcdefghi2abcdefghi3a' got '%s'\n",
+		 b);
+
+	/* make sure we still have the old one */
+	b = passwordFor("bill", "ted", &m, 0);
+	if (strcmp(b, "xlnt") != 0) {
+		printf("FAILURE: expected 'xlnt' got '%s'\n", b);
+		return (1);
+	}
+	printf("SUCCESS: expected 'xlnt' got '%s'\n", b);
+
+	/* what it's like if ssh-askpass is cancelled - should drop the mailbox */
+#if 0
+	/* will exit on our behalf; not so good for continued testing. */
+	m.askpass = "echo -n ; #";
+	b = passwordFor("abort", "me", &m, 0);
+	if (strcmp(b, "") != 0) {
+		printf("FAILURE: expected '' got '%s'\n", b);
+		return (1);
+	}
+	printf("SUCCESS: expected '' got '%s'\n", b);
+#endif
+
+	/* what it's like if ssh-askpass is ok'd with an empty password. */
+	m.askpass = "echo ; #";
+	b = passwordFor("try", "again", &m, 0);
+	if (b == NULL || strcmp(b, "") != 0) {
+		printf("FAILURE: expected '' got '%s'\n", b ? b : "(null)");
+		return (1);
+	}
+	printf("SUCCESS: expected '' got '%s'\n", b);
+
+	m.askpass = "echo \"rt*m\"; #";
+	b = passwordFor("faq", "faq", &m, 0);
+	if (strcmp(b, "rt*m") != 0) {
+		printf("FAILURE: expected '' got '%s'\n", b);
+		return (1);
+	}
+	printf("SUCCESS: expected 'rt*m' got '%s'\n", b);
+	return (0);
+}
+
+#define CKINT(x,shouldbe) if(x != shouldbe) { \
+printf("Failed: expected '" #shouldbe "' but got '%d'\n", x); \
+ return 1; }
+int test_imap4creator(void)
+{
+	mbox_t m;
+
+	if (imap4Create(&m, "imap:foo:@bar/mybox")) {
+		return 1;
+	}
+	CKSTRING(m.path, "mybox");
+	CKSTRING(m.u.pop_imap.serverName, "bar");
+	CKINT(m.u.pop_imap.serverPort, 143);
+
+	if (imap4Create(&m, "imap:foo:@bar/\"mybox\"")) {
+		return 1;
+	}
+	CKSTRING(m.path, "\"mybox\"");
+	CKSTRING(m.u.pop_imap.serverName, "bar");
+	CKINT(m.u.pop_imap.serverPort, 143);
+
+	if (imap4Create(&m, "imap:foo:@192.168.1.1/\"mybox\"")) {
+		printf
+			("FAILED: to create IMAP box with IP address for servername\n");
+		return 1;
+	}
+	CKSTRING(m.path, "\"mybox\"");
+	CKSTRING(m.u.pop_imap.serverName, "192.168.1.1");
+	CKINT(m.u.pop_imap.serverPort, 143);
+
+	if (imap4Create(&m, "imap:foo:@bar/\"space box\"")) {
+		return 1;
+	}
+	CKSTRING(m.path, "\"space box\"");
+	CKSTRING(m.u.pop_imap.serverName, "bar");
+	CKINT(m.u.pop_imap.serverPort, 143);
+
+	if (imap4Create(&m, "imap:user pass bar/\"space box\"")) {
+		return 1;
+	}
+	CKSTRING(m.path, "\"space box\"");
+	CKSTRING(m.u.pop_imap.serverName, "bar");
+	CKINT(m.u.pop_imap.serverPort, 143);
+
+	if (imap4Create(&m, "imap:star *as* star/\"space box\"")) {
+		return 1;
+	}
+	printf("mmm %s", (m.u.pop_imap.password));
+	DEFROB(m.u.pop_imap.password);
+	CKSTRING(m.u.pop_imap.password, "*as*");
+	CKINT(m.u.pop_imap.serverPort, 143);
+	if (imap4Create(&m, "imap:user:*as*@bar/blah")) {
+		return 1;
+	}
+
+	DEFROB(m.u.pop_imap.password);
+	CKSTRING(m.u.pop_imap.password, "*as*");
+	CKINT(m.u.pop_imap.serverPort, 143);
+
+	if (imap4Create(&m, "imap:user pass bar/\"space box\" 12")) {
+		return 1;
+	}
+	CKSTRING(m.path, "\"space box\"");
+	CKSTRING(m.u.pop_imap.serverName, "bar");
+	CKINT(m.u.pop_imap.serverPort, 12);
+
+	if (imap4Create(&m, "imap:foo:@bar/\"mybox\":12")) {
+		return 1;
+	}
+	CKSTRING(m.path, "\"mybox\"");
+	CKSTRING(m.u.pop_imap.serverName, "bar");
+	CKINT(m.u.pop_imap.serverPort, 12);
+
+	if (imap4Create(&m, "imap:foo:@bar/\"mybox\":12 auth")) {
+		return 1;
+	}
+	CKSTRING(m.path, "\"mybox\"");
+	CKSTRING(m.u.pop_imap.serverName, "bar");
+	CKINT(m.u.pop_imap.serverPort, 12);
+	CKSTRING(m.u.pop_imap.authList, "auth");
+
+	if (imap4Create(&m, "imap:foo:@bar/\"mybox\":12 cram-md5 plaintext")) {
+		return 1;
+	}
+	CKSTRING(m.u.pop_imap.authList, "cram-md5 plaintext");
+
+	if (imap4Create(&m, "imap:foo:@bar/\"mybox\":12 CRAm-md5 plainTEXt")) {
+		return 1;
+	}
+	CKSTRING(m.u.pop_imap.authList, "cram-md5 plaintext");
+
+	/* doesn't really matter, as the # is gobbled by the parser as a comment. */
+	if (imap4Create
+		(&m, "imap:harry:has#pass at bar/\"mybox\":12 CRAm-md5 plainTEXt")) {
+		return 1;
+	}
+	CKSTRING(m.u.pop_imap.userName, "harry");
+	DEFROB(m.u.pop_imap.password);
+	CKSTRING(m.u.pop_imap.password, "has#pass");
+
+
+	if (pop3Create(&m, "pop3:foo:@bar:12 cram-md5 plaintext")) {
+		return 1;
+	}
+	CKSTRING(m.u.pop_imap.authList, "cram-md5 plaintext");
+
+	/* should not parse this; it is ambiguous. */
+	if (!imap4Create(&m, "imap:foo:mi at ta@bar/mybox") && !Relax) {
+		return 1;
+	}
+
+	/* should not parse this; it is ambiguous. */
+	if (!imap4Create(&m, "imap:user pa ss bar/\"space box\" 12") && !Relax) {
+		return 1;
+	}
+
+	/* should not parse this; it is ambiguous. */
+	if (!pop3Create(&m, "pop3:user pa ss bar 12") && !Relax) {
+		return 1;
+	}
+
+	return 0;
+}
+
+
+int test_getline_from_buffer(void)
+{
+#define LINE_BUF_LEN 256
+	char linebuf[LINE_BUF_LEN];
+	char scratchbuf[LINE_BUF_LEN];
+
+	/* try to ensure that even an endless loop terminates */
+	alarm(100);
+	strcpy(scratchbuf, "\r\n");
+	getline_from_buffer(scratchbuf, linebuf, LINE_BUF_LEN);
+	if (strlen(scratchbuf) != 0) {
+		printf("FAILURE: scratchbuf not snarfed\n");
+		return (1);
+	}
+	if (strlen(linebuf) != 2) {
+		printf("FAILURE: linebuf not populated\n");
+		return (1);
+	}
+	strcpy(scratchbuf, "\n");
+	getline_from_buffer(scratchbuf, linebuf, LINE_BUF_LEN);
+	if (strlen(scratchbuf) != 0) {
+		printf("FAILURE: scratchbuf not snarfed\n");
+		return (1);
+	}
+	if (strlen(linebuf) != 1) {
+		printf("FAILURE: linebuf not populated\n");
+		return (1);
+	}
+
+	alarm(0);
+	return (0);
+}
+
+int test_charutil(void)
+{
+
+	char *v = strdup("abc#def");
+
+	StripComment(v);
+	if (strcmp(v, "abc#def") != 0) {
+		printf("FAILURE: comment stripper stripped when it shouldn't\n");
+		return 1;
+	}
+
+	v = strdup("abc #def");
+
+	StripComment(v);
+	if (strcmp(v, "abc ") != 0) {
+		printf("FAILURE: comment stripper should've stripped\n");
+		return 1;
+	}
+
+
+	return 0;
+}
+
+#include <netinet/in.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+int test_sock_connect(void)
+{
+	struct sockaddr_in addr;
+	int s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
+	int addrlen = sizeof(struct sockaddr_in);
+	if (s < 0) {
+		perror("socket");
+		return 1;
+	}
+	addr.sin_family = AF_INET;
+	addr.sin_addr.s_addr = 0;
+	addr.sin_port = 0;
+	if (bind(s, &addr, sizeof(struct sockaddr_in)) < 0) {
+		perror("bind");
+		return 1;
+	}
+	getsockname(s, &addr, &addrlen);
+	if (listen(s, 5) < 0) {
+		perror("listen");
+		return 1;
+	}
+	if (sock_connect("127.0.0.1", htons(addr.sin_port)) < 0) {
+		return 1;
+	}
+	if (sock_connect("localhost", htons(addr.sin_port)) < 0) {
+		return 1;
+	}
+	return 0;
+}
+
+
+int print_info(UNUSED(void *state))
+{
+	return (0);
+}
+const char *certificate_filename = NULL;
+int SkipCertificateCheck = 0;
+int exists(UNUSED(const char *filename))
+{
+	return (0);
+}
+
+
+// void initialize_blacklist(void) { } 
+// void tlscomm_printf(UNUSED(int x), UNUSED(const char *f), ...) { }
+// void tlscomm_expect(void) {  } 
+// void tlscomm_close() {  } 
+// int tlscomm_is_blacklisted(UNUSED(const char *x)) {  return 1; } 
+// void initialize_gnutls(void) {  } 
+// int sock_connect(UNUSED(const char *n), UNUSED(int p)) { return 1; } /* stdout */
+// void initialize_unencrypted(void) {  } 
+
+int main(UNUSED(int argc), UNUSED(char *argv[]))
+{
+
+	if (test_backtickExpand() || test_passwordMgr()) {
+		printf("SOME TESTS FAILED!\n");
+		exit(EXIT_FAILURE);
+	}
+
+	Relax = 0;
+	if (test_imap4creator()) {
+		printf("SOME TESTS FAILED!\n");
+		exit(EXIT_FAILURE);
+	}
+
+	if (test_sock_connect()) {
+		printf("SOME TESTS FAILED!\n");
+		exit(EXIT_FAILURE);
+	}
+
+	Relax = 1;
+	if (test_imap4creator()) {
+		printf("SOME TESTS FAILED!\n");
+		exit(EXIT_FAILURE);
+	}
+
+	if (test_getline_from_buffer()) {
+		printf("SOME TESTS FAILED!\n");
+		exit(EXIT_FAILURE);
+	}
+
+	if (test_charutil()) {
+		printf("SOME TESTS FAILED!\n");
+		exit(EXIT_FAILURE);
+	}
+
+	if (test_sock_connect()) {
+		printf("SOME TESTS FAILED!\n");
+		exit(EXIT_FAILURE);
+	}
+
+	printf("Success! on all tests.\n");
+	exit(EXIT_SUCCESS);
+}
+
+/* vim:set ts=4: */
+/*
+ * Local Variables:
+ * tab-width: 4
+ * c-indent-level: 4
+ * c-basic-offset: 4
+ * End:
+ */
diff --git a/wmbiff/tlsComm.c b/wmbiff/tlsComm.c
index a49e5ac..f1f70e7 100644
--- a/wmbiff/tlsComm.c
+++ b/wmbiff/tlsComm.c
@@ -6,6 +6,9 @@
    Neil Spring (nspring at cs.washington.edu) */
 
 /* TODO: handle "* BYE" internally? */
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
 
 #include <stdarg.h>
 #include <sys/time.h>
@@ -16,21 +19,40 @@
 #include <string.h>
 #include <stdlib.h>
 #include <assert.h>
-#ifdef WITH_TLS
-#include <gnutls.h>
+#ifdef HAVE_GNUTLS_GNUTLS_H
+#define USE_GNUTLS
+#include <gnutls/gnutls.h>
+#include <gnutls/x509.h>
+#include <sys/stat.h>
 #endif
 #ifdef USE_DMALLOC
 #include <dmalloc.h>
 #endif
 
+#ifdef HAVE___ATTRIBUTE__
+#define UNUSED(x) /*@unused@*/  x __attribute__((unused))
+#else
+#define UNUSED(x) x
+#endif
+
 #include "tlsComm.h"
 
 #include "Client.h"				/* debugging messages */
 
+/* if non-null, set to a file for certificate verification */
+extern const char *certificate_filename;
+/* if set, don't fail when dealing with a bad certificate.
+   (continue to whine, though, as bad certs should be fixed) */
+extern int SkipCertificateCheck;
+
 /* WARNING: implcitly uses scs to gain access to the mailbox
    that holds the per-mailbox debug flag. */
 #define TDM(lvl, args...) DM(scs->pc, lvl, "comm: " args)
 
+/* how long to wait for the server to do its thing
+   when we issue it a command (in seconds) */
+#define EXPECT_TIMEOUT 40
+
 /* this is the per-connection state that is maintained for
    each connection; BIG variables are for ssl (null if not
    used). */
@@ -38,11 +60,11 @@
 struct connection_state {
 	int sd;
 	char *name;
-#ifdef WITH_TLS
-	GNUTLS_STATE state;
-	X509PKI_CLIENT_CREDENTIALS xcred;
+#ifdef USE_GNUTLS
+	gnutls_session tls_state;
+	gnutls_certificate_credentials xcred;
 #else
-	/*@null@ */ void *state;
+	/*@null@ */ void *tls_state;
 	/*@null@ */ void *xcred;
 #endif
 	char unprocessed[BUF_SIZE];
@@ -50,8 +72,8 @@ struct connection_state {
 };
 
 /* gotta do our own line buffering, sigh */
-static int
-getline_from_buffer(char *readbuffer, char *linebuffer, int linebuflen);
+int getline_from_buffer(char *readbuffer, char *linebuffer,
+						int linebuflen);
 void handle_gnutls_read_error(int readbytes, struct connection_state *scs);
 
 void tlscomm_close(struct connection_state *scs)
@@ -60,18 +82,22 @@ void tlscomm_close(struct connection_state *scs)
 		(scs->name != NULL) ? scs->name : "null");
 
 	/* not ok to call this more than once */
-	if (scs->state) {
-#ifdef WITH_TLS
-		gnutls_bye(scs->state, GNUTLS_SHUT_RDWR);
-		gnutls_x509pki_free_sc(scs->xcred);
-		gnutls_deinit(scs->state);
+	if (scs->tls_state) {
+#ifdef USE_GNUTLS
+		/* this next line seems capable of hanging... */
+		/* gnutls_bye(scs->tls_state, GNUTLS_SHUT_RDWR); */
+		/* so we'll try just _bye'ing the WR direction, which
+		   should send the alert but not wait for a response. */
+		gnutls_bye(scs->tls_state, GNUTLS_SHUT_WR);
+		gnutls_certificate_free_credentials(scs->xcred);
+		gnutls_deinit(scs->tls_state);
 		scs->xcred = NULL;
 #endif
 	} else {
 		(void) close(scs->sd);
 	}
 	scs->sd = -1;
-	scs->state = NULL;
+	scs->tls_state = NULL;
 	scs->xcred = NULL;
 	free(scs->name);
 	scs->name = NULL;
@@ -83,20 +109,30 @@ static int wait_for_it(int sd, int timeoutseconds)
 {
 	fd_set readfds;
 	struct timeval tv;
+	int ready_descriptors;
 	tv.tv_sec = timeoutseconds;
 	tv.tv_usec = 0;
 	FD_ZERO(&readfds);
 	FD_SET(sd, &readfds);
-	if (select(sd + 1, &readfds, NULL, NULL, &tv) == 0) {
+	do {
+		ready_descriptors = select(sd + 1, &readfds, NULL, NULL, &tv);
+	}
+	while (ready_descriptors == -1 && errno == EINTR);
+	if (ready_descriptors == 0) {
 		DMA(DEBUG_INFO,
 			"select timed out after %d seconds on socket: %d\n",
 			timeoutseconds, sd);
 		return (0);
+	} else if (ready_descriptors == -1) {
+		DMA(DEBUG_ERROR,
+			"select failed on socket %d: %s\n", sd, strerror(errno));
+		return (0);
 	}
 	return (FD_ISSET(sd, &readfds));
 }
 
-static int
+/* exported for testing */
+extern int
 getline_from_buffer(char *readbuffer, char *linebuffer, int linebuflen)
 {
 	char *p, *q;
@@ -105,9 +141,20 @@ getline_from_buffer(char *readbuffer, char *linebuffer, int linebuflen)
 	for (p = readbuffer, i = 0;
 		 *p != '\n' && *p != '\0' && i < linebuflen - 1; p++, i++);
 
-	if (i != 0) {
-		/* grab the end of line too! */
+	/* gobble \n if it starts the line. */
+	if (*p == '\n') {
+		/* grab the end of line too! and then advance past
+		   the newline */
 		i++;
+		p++;
+	} else {
+		/* TODO -- perhaps we should return no line at all
+		   here, as it might be incomplete.  don't want to
+		   break anything though. */
+		DMA(DEBUG_INFO, "expected line doesn't end on its own.\n");
+	}
+
+	if (i != 0) {
 		/* copy a line into the linebuffer */
 		strncpy(linebuffer, readbuffer, (size_t) i);
 		/* sigh, null terminate */
@@ -116,15 +163,18 @@ getline_from_buffer(char *readbuffer, char *linebuffer, int linebuflen)
 		   instead with strcpy... I think. */
 		q = readbuffer;
 		if (*p != '\0') {
-			p++;
-			do {
+			while (*p != '\0') {
 				*(q++) = *(p++);
-			} while (*p != '\0');
+			}
 		}
 		/* null terminate */
 		*(q++) = *(p++);
 		/* return the length of the line */
 	}
+	if (i < 0 || i > linebuflen) {
+		DM((Pop3) NULL, DEBUG_ERROR, "bork bork bork!: %d %d\n", i,
+		   linebuflen);
+	}
 	return i;
 }
 
@@ -133,55 +183,80 @@ getline_from_buffer(char *readbuffer, char *linebuffer, int linebuflen)
 /* the correct response to a return value of 0 is almost
    certainly tlscomm_close(scs): don't _expect() anything
    unless anything else would represent failure */
-int tlscomm_expect(struct connection_state *scs,
-				   const char *prefix, char *buf, int buflen)
+int
+tlscomm_expect(struct connection_state *scs,
+			   const char *prefix, char *linebuf, int buflen)
 {
 	int prefixlen = (int) strlen(prefix);
-	memset(buf, 0, buflen);
+	int buffered_bytes = 0;
+	memset(linebuf, 0, buflen);
 	TDM(DEBUG_INFO, "%s: expecting: %s\n", scs->name, prefix);
-	while (wait_for_it(scs->sd, 10)) {
-		int readbytes;
-#ifdef WITH_TLS
-		if (scs->state) {
-			readbytes =
-				gnutls_read(scs->state, scs->unprocessed, BUF_SIZE);
-			if (readbytes < 0) {
-				handle_gnutls_read_error(readbytes, scs);
-				return 0;
-			}
-		} else
+	/*     if(scs->unprocessed[0]) {
+	   TDM(DEBUG_INFO, "%s: buffered: %s\n", scs->name, scs->unprocessed);
+	   } */
+	while (scs->unprocessed[0] != '\0'
+		   || wait_for_it(scs->sd, EXPECT_TIMEOUT)) {
+		if (scs->unprocessed[buffered_bytes] == '\0') {
+			int thisreadbytes;
+#ifdef USE_GNUTLS
+			if (scs->tls_state) {
+				/* BUF_SIZE - 1 leaves room for trailing \0 */
+				thisreadbytes =
+					gnutls_read(scs->tls_state,
+								&scs->unprocessed[buffered_bytes],
+								BUF_SIZE - 1 - buffered_bytes);
+				if (thisreadbytes < 0) {
+					handle_gnutls_read_error(thisreadbytes, scs);
+					return 0;
+				}
+			} else
 #endif
-		{
-			readbytes = read(scs->sd, scs->unprocessed, BUF_SIZE);
-			if (readbytes < 0) {
-				TDM(DEBUG_ERROR, "%s: error reading: %s\n", scs->name,
-					strerror(errno));
-				return 0;
+			{
+				thisreadbytes =
+					read(scs->sd, &scs->unprocessed[buffered_bytes],
+						 BUF_SIZE - 1 - buffered_bytes);
+				if (thisreadbytes < 0) {
+					TDM(DEBUG_ERROR, "%s: error reading: %s\n",
+						scs->name, strerror(errno));
+					return 0;
+				}
+			}
+			buffered_bytes += thisreadbytes;
+			/* force null termination */
+			scs->unprocessed[buffered_bytes] = '\0';
+			if (buffered_bytes == 0) {
+				return 0;		/* bummer */
 			}
+		} else {
+			buffered_bytes = strlen(scs->unprocessed);
 		}
-		if (readbytes == 0) {
-			return 0;			/* bummer */
-		} else
-			while (readbytes >= prefixlen) {
-				int linebytes;
-				linebytes =
-					getline_from_buffer(scs->unprocessed, buf, buflen);
-				if (linebytes == 0) {
-					readbytes = 0;
-				} else {
-					readbytes -= linebytes;
-					if (strncmp(buf, prefix, prefixlen) == 0) {
-						TDM(DEBUG_INFO, "%s: got: %*s", scs->name,
-							readbytes, buf);
-						return 1;	/* got it! */
-					}
-					TDM(DEBUG_INFO, "%s: dumped(%d/%d): %.*s", scs->name,
-						linebytes, readbytes, linebytes, buf);
+		while (buffered_bytes >= prefixlen) {
+			int linebytes;
+			linebytes =
+				getline_from_buffer(scs->unprocessed, linebuf, buflen);
+			if (linebytes == 0) {
+				buffered_bytes = 0;
+			} else {
+				buffered_bytes -= linebytes;
+				if (strncmp(linebuf, prefix, prefixlen) == 0) {
+					TDM(DEBUG_INFO, "%s: got: %*s", scs->name,
+						linebytes, linebuf);
+					return 1;	/* got it! */
 				}
+				TDM(DEBUG_INFO, "%s: dumped(%d/%d): %.*s", scs->name,
+					linebytes, buffered_bytes, linebytes, linebuf);
 			}
+		}
+	}
+	if (buffered_bytes == -1) {
+		TDM(DEBUG_INFO, "%s: timed out while expecting '%s'\n",
+			scs->name, prefix);
+	} else {
+		TDM(DEBUG_ERROR, "%s: expecting: '%s', saw (%d): %s%s",
+			scs->name, prefix, buffered_bytes, linebuf,
+			/* only print the newline if the linebuf lacks it */
+			(linebuf[strlen(linebuf) - 1] == '\n') ? "\n" : "");
 	}
-	TDM(DEBUG_ERROR, "%s: expecting: '%s', saw: '%s'\n", scs->name, prefix,
-		buf);
 	return 0;					/* wait_for_it failed */
 }
 
@@ -205,9 +280,9 @@ void tlscomm_printf(struct connection_state *scs, const char *format, ...)
 	va_end(args);
 
 	if (scs->sd != -1) {
-#ifdef WITH_TLS
-		if (scs->state) {
-			int written = gnutls_write(scs->state, buf, bytes);
+#ifdef USE_GNUTLS
+		if (scs->tls_state) {
+			int written = gnutls_write(scs->tls_state, buf, bytes);
 			if (written < bytes) {
 				TDM(DEBUG_ERROR,
 					"Error %s prevented writing: %*s\n",
@@ -226,101 +301,189 @@ void tlscomm_printf(struct connection_state *scs, const char *format, ...)
 }
 
 /* most of this file only makes sense if using TLS. */
-#ifdef WITH_TLS
-
-/* taken from the GNUTLS documentation, version 0.3.0 and
-   0.2.10; this may need to be updated from gnutls's cli.c
-   (now common.h) if the gnutls interface changes, but that
-   is only necessary if you want debug_comm. */
-#define PRINTX(x,y) if (y[0]!=0) printf(" -   %s %s\n", x, y)
-#define PRINT_DN(X) PRINTX( "CN:", X.common_name); \
-	PRINTX( "OU:", X.organizational_unit_name); \
-	PRINTX( "O:", X.organization); \
-	PRINTX( "L:", X.locality_name); \
-	PRINTX( "S:", X.state_or_province_name); \
-	PRINTX( "C:", X.country); \
-	PRINTX( "E:", X.email)
-static int print_info(GNUTLS_STATE state)
+#ifdef USE_GNUTLS
+#include "gnutls-common.h"
+
+static void
+bad_certificate(const struct connection_state *scs, const char *msg)
 {
-	const char *tmp;
-	CredType cred;
-	gnutls_DN dn;
+	TDM(DEBUG_ERROR, "%s", msg);
+	if (!SkipCertificateCheck) {
+		TDM(DEBUG_ERROR, "to ignore this error, run wmbiff "
+			"with the -skip-certificate-check option\n");
+		exit(1);
+	}
+}
+
+/* a start of a hack at verifying certificates.  does not
+   provide any security at all.  I'm waiting for either
+   gnutls to make this as easy as it should be, or someone
+   to port Andrew McDonald's gnutls-for-mutt patch.
+*/
+
+#define CERT_SEP "-----BEGIN"
+
+/* this bit is based on read_ca_file() in gnutls */
+static int tls_compare_certificates(const gnutls_datum * peercert)
+{
+	gnutls_datum cert;
+	unsigned char *ptr;
+	FILE *fd1;
+	int ret;
+	gnutls_datum b64_data;
+	unsigned char *b64_data_data;
+	struct stat filestat;
+
+	if (stat(certificate_filename, &filestat) == -1)
+		return 0;
+
+	b64_data.size = filestat.st_size + 1;
+	b64_data_data = (unsigned char *) malloc(b64_data.size);
+	b64_data_data[b64_data.size - 1] = '\0';
+	b64_data.data = b64_data_data;
+
+	fd1 = fopen(certificate_filename, "r");
+	if (fd1 == NULL) {
+		return 0;
+	}
+
+	b64_data.size = fread(b64_data.data, 1, b64_data.size, fd1);
+	fclose(fd1);
+
+	do {
+		ret = gnutls_pem_base64_decode_alloc(NULL, &b64_data, &cert);
+		if (ret != 0) {
+			free(b64_data_data);
+			return 0;
+		}
+
+		ptr = (unsigned char *) strstr(b64_data.data, CERT_SEP) + 1;
+		ptr = (unsigned char *) strstr(ptr, CERT_SEP);
+
+		b64_data.size = b64_data.size - (ptr - b64_data.data);
+		b64_data.data = ptr;
+
+		if (cert.size == peercert->size) {
+			if (memcmp(cert.data, peercert->data, cert.size) == 0) {
+				/* match found */
+				gnutls_free(cert.data);
+				free(b64_data_data);
+				return 1;
+			}
+		}
+
+		gnutls_free(cert.data);
+	} while (ptr != NULL);
+
+	/* no match found */
+	free(b64_data_data);
+	return 0;
+}
+
+
+int
+tls_check_certificate(struct connection_state *scs,
+					  const char *remote_hostname)
+{
+	int certstat;
 	const gnutls_datum *cert_list;
-	CertificateStatus status;
 	int cert_list_size = 0;
+	gnutls_x509_crt cert;
 
-	tmp = gnutls_kx_get_name(gnutls_kx_get_algo(state));
-	printf("- Key Exchange: %s\n", tmp);
-
-	cred = gnutls_auth_get_type(state);
-	switch (cred) {
-	case GNUTLS_ANON:
-		printf("- Anonymous DH using prime of %d bits\n",
-			   gnutls_anon_client_get_dh_bits(state));
-		break;
-	case GNUTLS_X509PKI:
-		cert_list =
-			gnutls_x509pki_client_get_peer_certificate_list(state,
-															&cert_list_size);
-		status = gnutls_x509pki_client_get_peer_certificate_status(state);
-
-		switch (status) {
-		case GNUTLS_CERT_NOT_TRUSTED:
-			printf("- Peer's X509 Certificate was NOT verified\n");
-			break;
-		case GNUTLS_CERT_EXPIRED:
-			printf
-				("- Peer's X509 Certificate was verified but is expired\n");
-			break;
-		case GNUTLS_CERT_TRUSTED:
-			printf("- Peer's X509 Certificate was verified\n");
-			break;
-		case GNUTLS_CERT_NONE:
-			printf("- Peer did not send any X509 Certificate.\n");
-			break;
-		case GNUTLS_CERT_INVALID:
-			printf("- Peer's X509 Certificate was invalid\n");
-			break;
+	if (gnutls_auth_get_type(scs->tls_state) != GNUTLS_CRD_CERTIFICATE) {
+		bad_certificate(scs, "Unable to get certificate from peer.\n");
+		return;					/* bad_cert will exit if -skip-certificate-check was not given */
+	}
+	certstat = gnutls_certificate_verify_peers(scs->tls_state);
+	if (certstat == GNUTLS_E_NO_CERTIFICATE_FOUND) {
+		bad_certificate(scs, "server presented no certificate.\n");
+#ifdef GNUTLS_CERT_CORRUPTED
+	} else if (certstat & GNUTLS_CERT_CORRUPTED) {
+		bad_certificate(scs, "server's certificate is corrupt.\n");
+#endif
+	} else if (certstat & GNUTLS_CERT_REVOKED) {
+		bad_certificate(scs, "server's certificate has been revoked.\n");
+	} else if (certstat & GNUTLS_CERT_INVALID) {
+		if (gnutls_certificate_type_get(scs->tls_state) == GNUTLS_CRT_X509) {
+			/* bad_certificate(scs, "server's certificate is not trusted.\n"
+			   "there may be a problem with the certificate stored in your certfile\n"); */
+		} else {
+			bad_certificate(scs,
+							"server's certificate is invalid or not X.509.\n"
+							"there may be a problem with the certificate stored in your certfile\n");
 		}
+	} else if (certstat & GNUTLS_CERT_NOT_TRUSTED) {
+		TDM(DEBUG_INFO, "server's certificate is not trusted.\n");
+		TDM(DEBUG_INFO,
+			"to verify that a certificate is trusted, use the certfile option.\n");
+	}
 
-		if (cert_list_size > 0) {
-			printf(" - Certificate info:\n");
-			printf(" - Certificate version: #%d\n",
-				   gnutls_x509pki_extract_certificate_version(&cert_list
-															  [0]));
+	if (gnutls_x509_crt_init(&cert) < 0) {
+		bad_certificate(scs,
+						"Unable to initialize certificate data structure");
+	}
 
-			gnutls_x509pki_extract_certificate_dn(&cert_list[0], &dn);
-			PRINT_DN(dn);
 
-			gnutls_x509pki_extract_certificate_issuer_dn(&cert_list[0],
-														 &dn);
-			printf(" - Certificate Issuer's info:\n");
-			PRINT_DN(dn);
-		}
-	default:
-		printf(" - Other.\n");
+	/* not checking for not-yet-valid certs... this would make sense
+	   if we weren't just comparing to stored ones */
+	cert_list =
+		gnutls_certificate_get_peers(scs->tls_state, &cert_list_size);
+
+	if (gnutls_x509_crt_import(cert, &cert_list[0], GNUTLS_X509_FMT_DER) <
+		0) {
+		bad_certificate(scs, "Error processing certificate data");
 	}
 
-	tmp = gnutls_protocol_get_name(gnutls_protocol_get_version(state));
-	printf("- Version: %s\n", tmp);
+	if (gnutls_x509_crt_get_expiration_time(cert) < time(NULL)) {
+		bad_certificate(scs, "server's certificate has expired.\n");
+	} else if (gnutls_x509_crt_get_activation_time(cert)
+			   > time(NULL)) {
+		bad_certificate(scs, "server's certificate is not yet valid.\n");
+	} else {
+		TDM(DEBUG_INFO, "certificate passed time check.\n");
+	}
 
-	tmp = gnutls_compression_get_name(gnutls_compression_get_algo(state));
-	printf("- Compression: %s\n", tmp);
+	if (gnutls_x509_crt_check_hostname(cert, remote_hostname) == 0) {
+		char certificate_hostname[256];
+		size_t buflen = 255;
+		gnutls_x509_crt_get_dn(cert, certificate_hostname, &buflen);
+		/* gnutls_x509_extract_certificate_dn(&cert_list[0], &dn); */
+		TDM(DEBUG_INFO,
+			"server's certificate (%s) does not match its hostname (%s).\n",
+			certificate_hostname, remote_hostname);
+		bad_certificate(scs,
+						"server's certificate does not match its hostname.\n");
+	} else {
+		if ((scs->pc)->debug >= DEBUG_INFO) {
+			char certificate_hostname[256];
+			size_t buflen = 255;
+			gnutls_x509_crt_get_dn(cert, certificate_hostname, &buflen);
+			/* gnutls_x509_extract_certificate_dn(&cert_list[0], &dn); */
+			TDM(DEBUG_INFO,
+				"server's certificate (%s) matched its hostname (%s).\n",
+				certificate_hostname, remote_hostname);
+		}
+	}
 
-	tmp = gnutls_cipher_get_name(gnutls_cipher_get_algo(state));
-	printf("- Cipher: %s\n", tmp);
+	if (certificate_filename != NULL &&
+		tls_compare_certificates(&cert_list[0]) == 0) {
+		bad_certificate(scs,
+						"server's certificate was not found in the certificate file.\n");
+	}
 
-	tmp = gnutls_mac_get_name(gnutls_mac_get_algo(state));
-	printf("- MAC: %s\n", tmp);
+	gnutls_x509_crt_deinit(cert);
 
-	return 0;
+	TDM(DEBUG_INFO, "certificate check ok.\n");
+	return (0);
 }
 
-struct connection_state *initialize_gnutls(int sd, char *name, Pop3 pc)
+struct connection_state *initialize_gnutls(int sd, char *name, Pop3 pc,
+										   const char *remote_hostname)
 {
 	static int gnutls_initialized;
 	int zok;
 	struct connection_state *scs = malloc(sizeof(struct connection_state));
+	memset(scs, 0, sizeof(struct connection_state));	/* clears the unprocessed buffer */
 
 	scs->pc = pc;
 
@@ -331,29 +494,64 @@ struct connection_state *initialize_gnutls(int sd, char *name, Pop3 pc)
 		gnutls_initialized = 1;
 	}
 
-	assert(gnutls_init(&scs->state, GNUTLS_CLIENT) == 0);
+	assert(gnutls_init(&scs->tls_state, GNUTLS_CLIENT) == 0);
 	{
 		const int protocols[] = { GNUTLS_TLS1, GNUTLS_SSL3, 0 };
 		const int ciphers[] =
-			{ GNUTLS_CIPHER_3DES_CBC, GNUTLS_CIPHER_ARCFOUR, 0 };
+			{ GNUTLS_CIPHER_RIJNDAEL_128_CBC, GNUTLS_CIPHER_3DES_CBC,
+			GNUTLS_CIPHER_RIJNDAEL_256_CBC,
+			GNUTLS_CIPHER_ARCFOUR, 0
+		};
 		const int compress[] = { GNUTLS_COMP_ZLIB, GNUTLS_COMP_NULL, 0 };
-		const int key_exch[] = { GNUTLS_KX_X509PKI_RSA, 0 };
+		const int key_exch[] = { GNUTLS_KX_RSA, GNUTLS_KX_DHE_DSS,
+			GNUTLS_KX_DHE_RSA, 0
+		};
+		/* mutt with gnutls doesn't use kx_srp or kx_anon_dh */
 		const int mac[] = { GNUTLS_MAC_SHA, GNUTLS_MAC_MD5, 0 };
-		assert(gnutls_protocol_set_priority(scs->state, protocols) == 0);
-		assert(gnutls_cipher_set_priority(scs->state, ciphers) == 0);
-		assert(gnutls_compression_set_priority(scs->state, compress) == 0);
-		assert(gnutls_kx_set_priority(scs->state, key_exch) == 0);
-		assert(gnutls_mac_set_priority(scs->state, mac) == 0);
+		assert(gnutls_protocol_set_priority(scs->tls_state, protocols) ==
+			   0);
+		assert(gnutls_cipher_set_priority(scs->tls_state, ciphers) == 0);
+		assert(gnutls_compression_set_priority(scs->tls_state, compress) ==
+			   0);
+		assert(gnutls_kx_set_priority(scs->tls_state, key_exch) == 0);
+		assert(gnutls_mac_set_priority(scs->tls_state, mac) == 0);
 		/* no client private key */
-		if (gnutls_x509pki_allocate_sc(&scs->xcred, 0) < 0) {
+		if (gnutls_certificate_allocate_credentials(&scs->xcred) < 0) {
 			DMA(DEBUG_ERROR, "gnutls memory error\n");
 			exit(1);
 		}
-		gnutls_cred_set(scs->state, GNUTLS_X509PKI, scs->xcred);
-		gnutls_transport_set_ptr(scs->state, sd);
+
+		/* certfile seems to work. */
+		if (certificate_filename != NULL) {
+			if (!exists(certificate_filename)) {
+				DMA(DEBUG_ERROR,
+					"Certificate file (certfile=) %s not found.\n",
+					certificate_filename);
+				exit(1);
+			}
+			zok = gnutls_certificate_set_x509_trust_file(scs->xcred,
+														 (char *)
+														 certificate_filename,
+														 GNUTLS_X509_FMT_PEM);
+			if (zok < 0) {
+				DMA(DEBUG_ERROR,
+					"GNUTLS did not like your certificate file %s (%d).\n",
+					certificate_filename, zok);
+				gnutls_perror(zok);
+				exit(1);
+			}
+		}
+
+		gnutls_cred_set(scs->tls_state, GNUTLS_CRD_CERTIFICATE,
+						scs->xcred);
+		gnutls_transport_set_ptr(scs->tls_state,
+								 (gnutls_transport_ptr) sd);
 		do {
-			zok = gnutls_handshake(scs->state);
-		} while (zok == GNUTLS_E_INTERRUPTED || zok == GNUTLS_E_AGAIN);
+			zok = gnutls_handshake(scs->tls_state);
+		}
+		while (zok == GNUTLS_E_INTERRUPTED || zok == GNUTLS_E_AGAIN);
+
+		tls_check_certificate(scs, remote_hostname);
 	}
 
 	if (zok < 0) {
@@ -361,18 +559,22 @@ struct connection_state *initialize_gnutls(int sd, char *name, Pop3 pc)
 		TDM(DEBUG_ERROR, "%s: This may be a problem in gnutls, "
 			"which is under development\n", name);
 		TDM(DEBUG_ERROR,
-			"%s: Specifically, problems have been found where the extnValue \n"
-			"  buffer in _gnutls_get_ext_type() in lib/x509_extensions.c is too small in\n"
-			"  gnutls versions up to 0.2.3.  This copy of wmbiff was compiled with \n"
+			"%s: This copy of wmbiff was compiled with \n"
 			"  gnutls version %s.\n", name, LIBGNUTLS_VERSION);
 		gnutls_perror(zok);
-		gnutls_deinit(scs->state);
+		if (scs->pc->u.pop_imap.serverPort != 143 /* starttls */ ) {
+			TDM(DEBUG_ERROR,
+				"%s: Please run 'gnutls-cli-debug -p %d %s' to test ssl directly.\n"
+				"  That tool provides a lower-level test of gnutls with your server.\n",
+				name, scs->pc->u.pop_imap.serverPort, remote_hostname);
+		}
+		gnutls_deinit(scs->tls_state);
 		free(scs);
 		return (NULL);
 	} else {
 		TDM(DEBUG_INFO, "%s: Handshake was completed\n", name);
 		if (scs->pc->debug >= DEBUG_INFO)
-			print_info(scs->state);
+			print_info(scs->tls_state, remote_hostname);
 		scs->sd = sd;
 		scs->name = name;
 	}
@@ -383,7 +585,7 @@ struct connection_state *initialize_gnutls(int sd, char *name, Pop3 pc)
    verbose error crap */
 void handle_gnutls_read_error(int readbytes, struct connection_state *scs)
 {
-	if (gnutls_is_fatal_error(readbytes) == 1) {
+	if (gnutls_error_is_fatal(readbytes) == 1) {
 		TDM(DEBUG_ERROR,
 			"%s: Received corrupted data(%d) - server has terminated the connection abnormally\n",
 			scs->name, readbytes);
@@ -391,22 +593,22 @@ void handle_gnutls_read_error(int readbytes, struct connection_state *scs)
 		if (readbytes == GNUTLS_E_WARNING_ALERT_RECEIVED
 			|| readbytes == GNUTLS_E_FATAL_ALERT_RECEIVED)
 			TDM(DEBUG_ERROR, "* Received alert [%d]\n",
-				gnutls_alert_get_last(scs->state));
+				gnutls_alert_get(scs->tls_state));
 		if (readbytes == GNUTLS_E_REHANDSHAKE)
 			TDM(DEBUG_ERROR, "* Received HelloRequest message\n");
 	}
 	TDM(DEBUG_ERROR,
-		"%s: error reading: %s\n", scs->name, gnutls_strerror(readbytes));
+		"%s: gnutls error reading: %s\n",
+		scs->name, gnutls_strerror(readbytes));
 }
 
 #else
 /* declare stubs when tls isn't compiled in */
-struct connection_state *initialize_gnutls( /*@unused@ */ int sd
-										   __attribute__ ((unused)),
-										   /*@unused@ */ char *name
-										   __attribute__ ((unused)),
-										   /*@unused@ */ Pop3 pc
-										   __attribute__ ((unused)))
+struct connection_state *initialize_gnutls(UNUSED(int sd),
+										   UNUSED(char *name),
+										   UNUSED(Pop3 pc),
+										   UNUSED(const char
+												  *remote_hostname))
 {
 	DM(pc, DEBUG_ERROR,
 	   "FATAL: tried to initialize ssl when ssl wasn't compiled in.\n");
@@ -422,9 +624,10 @@ struct connection_state *initialize_unencrypted(int sd,
 	struct connection_state *ret = malloc(sizeof(struct connection_state));
 	assert(sd >= 0);
 	assert(ret != NULL);
+	memset(ret, 0, sizeof(struct connection_state));	/* clears the unprocessed buffer */
 	ret->sd = sd;
 	ret->name = name;
-	ret->state = NULL;
+	ret->tls_state = NULL;
 	ret->xcred = NULL;
 	ret->pc = pc;
 	return (ret);
@@ -438,7 +641,7 @@ struct connection_state *initialize_blacklist( /*@only@ */ char *name)
 	assert(ret != NULL);
 	ret->sd = -1;
 	ret->name = name;
-	ret->state = NULL;
+	ret->tls_state = NULL;
 	ret->xcred = NULL;
 	ret->pc = NULL;
 	return (ret);
@@ -449,3 +652,12 @@ int tlscomm_is_blacklisted(const struct connection_state *scs)
 {
 	return (scs != NULL && scs->sd == -1);
 }
+
+/* vim:set ts=4: */
+/*
+ * Local Variables:
+ * tab-width: 4
+ * c-indent-level: 4
+ * c-basic-offset: 4
+ * End:
+ */
diff --git a/wmbiff/tlsComm.h b/wmbiff/tlsComm.h
index 4968e6c..eb24f7c 100644
--- a/wmbiff/tlsComm.h
+++ b/wmbiff/tlsComm.h
@@ -20,7 +20,7 @@ struct connection_state;
    over it */
 /*@only@*/
 struct connection_state *initialize_gnutls(int sd, /*@only@ */ char *name,
-										   Pop3 pc);
+										   Pop3 pc, const char *hostname);
 
 /* take a socket descriptor and bundle it into a connection
    state structure for later communication */
@@ -53,3 +53,7 @@ int tlscomm_expect(struct connection_state *scs, const char *prefix,
 /* terminates the TLS association or just closes the socket,
    and frees the connection state */
 void tlscomm_close( /*@only@ */ struct connection_state *scs);
+
+/* internal function exported for testing */
+int getline_from_buffer(char *readbuffer, char *linebuffer,
+						int linebuflen);
diff --git a/wmbiff/wmbiff-master-led.xpm b/wmbiff/wmbiff-master-led.xpm
index 0f6293d..fbd62b9 100644
--- a/wmbiff/wmbiff-master-led.xpm
+++ b/wmbiff/wmbiff-master-led.xpm
@@ -1,6 +1,6 @@
 /* XPM */
 static const char * wmbiff_master_xpm[] = {
-"160 100 15 1",
+"160 109 15 1",
 " 	c #00000000FFFF",
 ".	c #208120812081",
 "X	c #FFFFFFFF0000",
@@ -8,7 +8,7 @@ static const char * wmbiff_master_xpm[] = {
 "O	c #79E779E70820",
 "+	c #000000000000",
 "@	c #C71BC30BC71B",
-"#	c #000049244103",
+":	c #000049244103",
 "$	c #2081B2CAAEBA",
 "%	c #00007DF771C6",
 "&	c #B6DA04101861",
@@ -22,57 +22,57 @@ static const char * wmbiff_master_xpm[] = {
 "                                                                ..X...X.o...X.o...X.o...X.X...X.X...o.X...o.o...X.X...X.X...X..X....X....X......                ",
 "    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++    ..OoooO..oooO.OXXXO..XXXO.OXXXO.OXXXO.OXXXO..oooO.oXXXo.OXXXO..O....O...X.......                ",
 "    +......................................................@    ..X...X.o...X.X...o.o...X.o...X.o...X.X...X.o...X.X...X.o...X...........X.......                ",
-"    +..###...###...###...###...###.......###...###...###...@    ..X...X.o...X.X...o.o...X.o...X.o...X.X...X.o...X.X...X.o...X..X....X..X........                ",
-"    +.#...#.#...#.#...#.#...#.#...#.....#...#.#...#.#...#..@    ...XXX...oooX.OXXXO.OXXXO..oooO.OXXXO.OXXXO..oooO.OXXXO.OXXXO..O....O..X........                ",
-"    +.#...#.#...#.#...#.#...#.#...#..#..#...#.#...#.#...#..@    ................................................................................                ",
-"    +..###...###...###...###...###...#...###...###...###...@    .                                                                                               ",
-"    +.#...#.#...#.#...#.#...#.#...#.....#...#.#...#.#...#..@    .                                                                                               ",
-"    +.#...#.#...#.#...#.#...#.#...#..#..#...#.#...#.#...#..@    .                                                                                               ",
-"    +..###...###...###...###...###...#...###...###...###...@    .                                                                                               ",
+"    +..:::...:::...:::...:::...:::.......:::...:::...:::...@    ..X...X.o...X.X...o.o...X.o...X.o...X.X...X.o...X.X...X.o...X..X....X..X........                ",
+"    +.:...:.:...:.:...:.:...:.:...:.....:...:.:...:.:...:..@    ...XXX...oooX.OXXXO.OXXXO..oooO.OXXXO.OXXXO..oooO.OXXXO.OXXXO..O....O..X........                ",
+"    +.:...:.:...:.:...:.:...:.:...:..:..:...:.:...:.:...:..@    ................................................................................                ",
+"    +..:::...:::...:::...:::...:::...:...:::...:::...:::...@    .                                                                                               ",
+"    +.:...:.:...:.:...:.:...:.:...:.....:...:.:...:.:...:..@    .                                                                                               ",
+"    +.:...:.:...:.:...:.:...:.:...:..:..:...:.:...:.:...:..@    .                                                                                               ",
+"    +..:::...:::...:::...:::...:::...:...:::...:::...:::...@    .                                                                                               ",
 "    +......................................................@    .                                                                                               ",
 "    +......................................................@    .                                                                                               ",
 "    +......................................................@    .                                                                                               ",
 "    +......................................................@    .                                                                                               ",
-"    +..###...###...###...###...###.......###...###...###...@    .                                                                                               ",
-"    +.#...#.#...#.#...#.#...#.#...#.....#...#.#...#.#...#..@    .                                                                                               ",
-"    +.#...#.#...#.#...#.#...#.#...#..#..#...#.#...#.#...#..@    .                                                                                               ",
-"    +..###...###...###...###...###...#...###...###...###...@    .                                                                                               ",
-"    +.#...#.#...#.#...#.#...#.#...#.....#...#.#...#.#...#..@    .                                                                                               ",
-"    +.#...#.#...#.#...#.#...#.#...#..#..#...#.#...#.#...#..@    .                                                                                               ",
-"    +..###...###...###...###...###...#...###...###...###...@    .                                                                                               ",
+"    +..:::...:::...:::...:::...:::.......:::...:::...:::...@    .                                                                                               ",
+"    +.:...:.:...:.:...:.:...:.:...:.....:...:.:...:.:...:..@    .                                                                                               ",
+"    +.:...:.:...:.:...:.:...:.:...:..:..:...:.:...:.:...:..@    .                                                                                               ",
+"    +..:::...:::...:::...:::...:::...:...:::...:::...:::...@    .                                                                                               ",
+"    +.:...:.:...:.:...:.:...:.:...:.....:...:.:...:.:...:..@    .                                                                                               ",
+"    +.:...:.:...:.:...:.:...:.:...:..:..:...:.:...:.:...:..@    .                                                                                               ",
+"    +..:::...:::...:::...:::...:::...:...:::...:::...:::...@    .                                                                                               ",
 "    +......................................................@    .                                                                                               ",
 "    +......................................................@    .                                                                                               ",
 "    +......................................................@    .                                                                                               ",
 "    +......................................................@    .                                                                                               ",
-"    +..###...###...###...###...###.......###...###...###...@    .                                                                                               ",
-"    +.#...#.#...#.#...#.#...#.#...#.....#...#.#...#.#...#..@    .                                                                                               ",
-"    +.#...#.#...#.#...#.#...#.#...#..#..#...#.#...#.#...#..@    .                                                                                               ",
-"    +..###...###...###...###...###...#...###...###...###...@    .                                                                                               ",
-"    +.#...#.#...#.#...#.#...#.#...#.....#...#.#...#.#...#..@    .                                                                                               ",
-"    +.#...#.#...#.#...#.#...#.#...#..#..#...#.#...#.#...#..@    .                                                                                               ",
-"    +..###...###...###...###...###...#...###...###...###...@    .                                                                                               ",
+"    +..:::...:::...:::...:::...:::.......:::...:::...:::...@    .                                                                                               ",
+"    +.:...:.:...:.:...:.:...:.:...:.....:...:.:...:.:...:..@    .                                                                                               ",
+"    +.:...:.:...:.:...:.:...:.:...:..:..:...:.:...:.:...:..@    .                                                                                               ",
+"    +..:::...:::...:::...:::...:::...:...:::...:::...:::...@    .                                                                                               ",
+"    +.:...:.:...:.:...:.:...:.:...:.....:...:.:...:.:...:..@    .                                                                                               ",
+"    +.:...:.:...:.:...:.:...:.:...:..:..:...:.:...:.:...:..@    .                                                                                               ",
+"    +..:::...:::...:::...:::...:::...:...:::...:::...:::...@    .                                                                                               ",
 "    +......................................................@    .                                                                                               ",
 "    +......................................................@    .                                                                                               ",
 "    +......................................................@    .                                                                                               ",
 "    +......................................................@    .                                                                                               ",
-"    +..###...###...###...###...###.......###...###...###...@    .                                                                                               ",
-"    +.#...#.#...#.#...#.#...#.#...#.....#...#.#...#.#...#..@    .                                                                                               ",
-"    +.#...#.#...#.#...#.#...#.#...#..#..#...#.#...#.#...#..@    .                                                                                               ",
-"    +..###...###...###...###...###...#...###...###...###...@    .                                                                                               ",
-"    +.#...#.#...#.#...#.#...#.#...#.....#...#.#...#.#...#..@    .                                                                                               ",
-"    +.#...#.#...#.#...#.#...#.#...#..#..#...#.#...#.#...#..@    .                                                                                               ",
-"    +..###...###...###...###...###...#...###...###...###...@    .                                                                                               ",
+"    +..:::...:::...:::...:::...:::.......:::...:::...:::...@    .                                                                                               ",
+"    +.:...:.:...:.:...:.:...:.:...:.....:...:.:...:.:...:..@    .                                                                                               ",
+"    +.:...:.:...:.:...:.:...:.:...:..:..:...:.:...:.:...:..@    .                                                                                               ",
+"    +..:::...:::...:::...:::...:::...:...:::...:::...:::...@    .                                                                                               ",
+"    +.:...:.:...:.:...:.:...:.:...:.....:...:.:...:.:...:..@    .                                                                                               ",
+"    +.:...:.:...:.:...:.:...:.:...:..:..:...:.:...:.:...:..@    .                                                                                               ",
+"    +..:::...:::...:::...:::...:::...:...:::...:::...:::...@    .                                                                                               ",
 "    +......................................................@    .                                                                                               ",
 "    +......................................................@    .                                                                                               ",
 "    +......................................................@    .                                                                                               ",
 "    +......................................................@    .                                                                                               ",
-"    +..###...###...###...###...###.......###...###...###...@    .                                                                                               ",
-"    +.#...#.#...#.#...#.#...#.#...#.....#...#.#...#.#...#..@    .                                                                                               ",
-"    +.#...#.#...#.#...#.#...#.#...#..#..#...#.#...#.#...#..@    .                                                                                               ",
-"    +..###...###...###...###...###...#...###...###...###...@    .                                                                                               ",
-"    +.#...#.#...#.#...#.#...#.#...#.....#...#.#...#.#...#..@    .                                                                                               ",
-"    +.#...#.#...#.#...#.#...#.#...#..#..#...#.#...#.#...#..@    .                                                                                               ",
-"    +..###...###...###...###...###...#...###...###...###...@    .                                                                                               ",
+"    +..:::...:::...:::...:::...:::.......:::...:::...:::...@    .                                                                                               ",
+"    +.:...:.:...:.:...:.:...:.:...:.....:...:.:...:.:...:..@    .                                                                                               ",
+"    +.:...:.:...:.:...:.:...:.:...:..:..:...:.:...:.:...:..@    .                                                                                               ",
+"    +..:::...:::...:::...:::...:::...:...:::...:::...:::...@    .                                                                                               ",
+"    +.:...:.:...:.:...:.:...:.:...:.....:...:.:...:.:...:..@    .                                                                                               ",
+"    +.:...:.:...:.:...:.:...:.:...:..:..:...:.:...:.:...:..@    .                                                                                               ",
+"    +..:::...:::...:::...:::...:::...:...:::...:::...:::...@    .                                                                                               ",
 "    +......................................................@    .                                                                                               ",
 "    +......................................................@    .                                                                                               ",
 "    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@    .                                                                                               ",
@@ -81,36 +81,46 @@ static const char * wmbiff_master_xpm[] = {
 "                                                                .                                                                                               ",
 "                                                                .                                                                                               ",
 "...............................................................................                                                                                 ",
-"..$$$...###%.%$$$%.%$$$%.%###%.%$$$%.%$$$%.%$$$%.%$$$%.%$$$%...................                                                                                 ",
-".$...$.#...$.#...$.#...$.$...$.$...#.$...#.#...$.$...$.$...$............$......  .&&.  .**.  .==.                                                               ",
-".$...$.#...$.#...$.#...$.$...$.$...#.$...#.#...$.$...$.$...$..$....$....$......  &-&&  *-**  ====                                                               ",
-".%###%..###%.%$$$%..$$$%.%$$$%.%$$$%.%$$$%..###%.#$$$#.%$$$%..%....%...$.......  &&&&  ****  ====   .$#;                                                        ",
-".$...$.#...$.$...#.#...$.#...$.#...$.$...$.#...$.$...$.#...$...........$.......  .&&.  .**.  .==.                                                               ",
-".$...$.#...$.$...#.#...$.#...$.#...$.$...$.#...$.$...$.#...$..$....$..$........                                                                                 ",
-"..$$$...###$.%$$$%.%$$$%..###%.%$$$%.%$$$%..###%.%$$$%.%$$$%..%....%..$........                                                                                 ",
+"..$$$...:::%.%$$$%.%$$$%.%:::%.%$$$%.%$$$%.%$$$%.:$$$%.%$$$%...................                                                                                 ",
+".$...$.:...$.:...$.:...$.$...$.$...:.$...:.:...$.$...$.$...$............$......  .&&.  .**.  .==.                                                               ",
+".$...$.:...$.:...$.:...$.$...$.$...:.$...:.:...$.$...$.$...$..$....$....$......  &-&&  *-**  ====                                                               ",
+".%:::%..:::%.%$$$%..$$$%.%$$$%.%$$$%.%$$$%..:::%.:$$$:.%$$$%..%....%...$.......  &&&&  ****  ====   .$:;                                                        ",
+".$...$.:...$.$...:.:...$.:...$.:...$.$...$.:...$.$...$.:...$...........$.......  .&&.  .**.  .==.                                                               ",
+".$...$.:...$.$...:.:...$.:...$.:...$.$...$.:...$.$...$.:...$..$....$..$........                                                                                 ",
+"..$$$...:::$.%$$$%.%$$$%..:::%.%$$$%.%$$$%..:::%.%$$$:.%$$$%..%....%..$........                                                                                 ",
 "...............................................................................                                                                                 ",
 "                                                                                                                                                                ",
 "................................................................................................................................................................",
-".#$$$#.%$$$..%$$$%.%$$$..%$$$%.%$$$%.%$$$%.%###%..###%..###%.%###%.%###..$###$.%$$$..%$$$%.%$$$%.%$$$%.%$$$%.%$$$%.%$$$%.%###%.%###%.%###%.%###%.%###%.%$$$%....",
-".$...$.$...$.$...#.$...$.$...#.$...#.$...#.$...$.#...$.#...$.$...$.$...#.$$.$$.$...$.$...$.$...$.$...$.$...$.$...#.#.$.#.$...$.$...$.$...$.$...$.$...$.#...$....",
-".$...$.$...$.$...#.$...$.$...#.$...#.$...#.$...$.#...$.#...$.$..$#.$...#.$.$.$.$...$.$...$.$...$.$...$.$...$.$...#.#.$.#.$...$.$...$.$...$.#$.$#.$...$.#..$#....",
-".%$$$%.%$$$..%###..%###%.%$$$..%$$$..%#$$%.%$$$%..###%..###%.%$$#..%###..%###%.%###%.%###%.%$$$%.%$##%.%$$$..%$$$%..#%#..%###%.%###%.%###%..#$#..%$$$%..#$#.....",
-".$...$.$...$.$...#.$...$.$...#.$...#.$...$.$...$.#...$.#...$.$..$#.$...#.$...$.$...$.$...$.$...#.$.$.$.$...$.#...$.#.$.#.$...$.$...$.$.$.$.#$.$#.#...$.#$..#....",
-".$...$.$...$.$...#.$...$.$...#.$...#.$...$.$...$.#...$.#...$.$...$.$...#.$...$.$...$.$...$.$...#.$..$$.$...$.#...$.#.$.#.$...$.$...$.$$.$$.$...$.#...$.$...#....",
-".%###%.%$$$..%$$$%.$$$$..%$$$%.$###..%$$$%.%###%..###$.%$$$%.%###%.%$$$#.%###%.$###$.%$$$%.%###..%$$$%.%###%.%$$$%..#%#..#$$$$..$$$..$###$.%###$%%$$$%.%$$$%....",
+".:$$$:.%$$$..%$$$%.%$$$..%$$$%.%$$$%.%$$$%.%:::%..:::%..:::%.%:::%.%:::..$:::$.%$$$..%$$$%.%$$$%.%$$$%.%$$$%.%$$$%.%$$$%.%:::%.%:::%.%:::%.%:::%.%:::%.%$$$%....",
+".$...$.$...$.$...:.$...$.$...:.$...:.$...:.$...$.:...$.:...$.$...$.$...:.$$.$$.$...$.$...$.$...$.$...$.$...$.$...:.:.$.:.$...$.$...$.$...$.$...$.$...$.:...$....",
+".$...$.$...$.$...:.$...$.$...:.$...:.$...:.$...$.:...$.:...$.$..$:.$...:.$.$.$.$...$.$...$.$...$.$...$.$...$.$...:.:.$.:.$...$.$...$.$...$.:$.$:.$...$.:..$:....",
+".%$$$%.%$$$..%:::..%:::%.%$$$..%$$$..%:$$%.%$$$%..:::%..:::%.%$$:..%:::..%:::%.%:::%.%:::%.%$$$%.%$::%.%$$$..%$$$%..:%:..%:::%.%:::%.%:::%..:$:..%$$$%..:$:.....",
+".$...$.$...$.$...:.$...$.$...:.$...:.$...$.$...$.:...$.:...$.$..$:.$...:.$...$.$...$.$...$.$...:.$.$.$.$...$.:...$.:.$.:.$...$.$...$.$.$.$.:$.$:.:...$.:$..:....",
+".$...$.$...$.$...:.$...$.$...:.$...:.$...$.$...$.:...$.:...$.$...$.$...:.$...$.$...$.$...$.$...:.$..$$.$...$.:...$.:.$.:.$...$.$...$.$$.$$.$...$.:...$.$...:....",
+".%:::%.%$$$..%$$$%.$$$$..%$$$%.$:::..%$$$%.%:::%..:::$.:$$$%.%:::%.%$$$:.%:::%.$:::$.%$$$%.%:::..%$$$%.%:::%.%$$$%..:%:..:$$$$..$$$..$:::$.%:::$.:$$$%.%$$$%....",
 "................................................................................................................................................................",
 "                                                                                                                                                                ",
 "    +......................................................@    .                                                                                               ",
-"     ..###...###...###...###...###.......###...###...###...                                                                                                     ",
-"     .#...#.#...#.#...#.#...#.#...#.....#...#.#...#.#...#..                                                                                                     ",
-"     .#...#.#...#.#...#.#...#.#...#..#..#...#.#...#.#...#..                                                                                                     ",
-"     ..###...###...###...###...###...#...###...###...###...                                                                                                     ",
-"     .#...#.#...#.#...#.#...#.#...#.....#...#.#...#.#...#..                                                                                                     ",
-"     .#...#.#...#.#...#.#...#.#...#..#..#...#.#...#.#...#..                                                                                                     ",
-"     ..###...###...###...###...###...#...###...###...###...                                                                                                     ",
+"     ..:::...:::...:::...:::...:::.......:::...:::...:::...                                                                                                     ",
+"     .:...:.:...:.:...:.:...:.:...:.....:...:.:...:.:...:..                                                                                                     ",
+"     .:...:.:...:.:...:.:...:.:...:..:..:...:.:...:.:...:..                                                                                                     ",
+"     ..:::...:::...:::...:::...:::...:...:::...:::...:::...                                                                                                     ",
+"     .:...:.:...:.:...:.:...:.:...:.....:...:.:...:.:...:..                                                                                                     ",
+"     .:...:.:...:.:...:.:...:.:...:..:..:...:.:...:.:...:..                                                                                                     ",
+"     ..:::...:::...:::...:::...:::...:...:::...:::...:::...                                                                                                     ",
 "     ......................................................                                                                                                     ",
 "     ......................................................                                                                                                     ",
 "                                                                                                                                                                ",
+"................................................................................................................................................................",
+".oXXXo.OXXX..OXXXO.OXXX..OXXXO.OXXXO.OXXXO.OoooO..oooO..oooO.OoooO.Oooo..XoooX.OXXX..OXXXO.OXXXO.OXXXO.OXXXO.OXXXO.OXXXO.OoooO.OoooO.OoooO.OoooO.OoooO.OXXXO....",
+".X...X.X...X.X...o.X...X.X...o.X...o.X...o.X...X.o...X.o...X.X...X.X...o.XX.XX.X...X.X...X.X...X.X...X.X...X.X...o.o.X.o.X...X.X...X.X...X.X...X.X...X.o...X....",
+".X...X.X...X.X...o.X...X.X...o.X...o.X...o.X...X.o...X.o...X.X..Xo.X...o.X.X.X.X...X.X...X.X...X.X...X.X...X.X...o.o.X.o.X...X.X...X.X...X.oX.Xo.X...X.o..Xo....",
+".OXXXO.OXXX..Oooo..OoooO.OXXX..OXXX..OoXXO.OXXXO..oooO..oooO.OXXo..Oooo..OoooO.OoooO.OoooO.OXXXO.OXooO.OXXX..OXXXO..oOo..OoooO.OoooO.OoooO..oXo..OXXXO..oXo.....",
+".X...X.X...X.X...o.X...X.X...o.X...o.X...X.X...X.o...X.o...X.X..Xo.X...o.X...X.X...X.X...X.X...o.X.X.X.X...X.o...X.o.X.o.X...X.X...X.X.X.X.oX.Xo.o...X.oX..o....",
+".X...X.X...X.X...o.X...X.X...o.X...o.X...X.X...X.o...X.o...X.X...X.X...o.X...X.X...X.X...X.X...o.X..XX.X...X.o...X.o.X.o.X...X.X...X.XX.XX.X...X.o...X.X...o....",
+".OoooO.OXXX..OXXXO.XXXX..OXXXO.Xooo..OXXXO.OoooO..oooX.OXXXO.OoooO.OXXXo.OoooO.XoooX.OXXXO.Oooo..OXXXO.OoooO.OXXXO..oOo..oXXXX..XXX..XoooX.OoooX.oXXXO.OXXXO....",
+"................................................................................................................................................................",
+"                                                                                                                                                                ",
 "                                                                                                                                                                ",
 "                                                                                                                                                                ",
 "                                                                                                                                                                ",
diff --git a/wmbiff/wmbiff.1 b/wmbiff/wmbiff.1
index 258f362..0952d8c 100644
--- a/wmbiff/wmbiff.1
+++ b/wmbiff/wmbiff.1
@@ -1,5 +1,5 @@
 .\" Hey, Emacs!  This is an -*- nroff -*- source file.
-.\" $Id: wmbiff.1,v 1.7 2002/03/06 07:15:08 bluehal Exp $
+.\" $Id: wmbiff.1,v 1.13 2003/02/08 21:04:48 bluehal Exp $
 .\"
 .\" wmbiff.1 and wmbiffrc.5 are copyright 1999-2001 by
 .\" Jordi Mallach <jordi at debian.org>
@@ -13,12 +13,13 @@ WMBiff \- A dockable Mailbox Monitor
 
 .SH SYNOPSIS
 .B wmbiff
-[-display <display name>] [-geometry +XPOS+YPOS] [-c <filename>] [-h] [-v] [-debug]
+[-display <display name>] [-geometry +XPOS+YPOS] [-c <filename>] [-h] [-v] [-debug] [-fg <foreground-color>] [-font <X11 font>|default] [-hi <highlight-color>] [+w]
 .br
 
 .SH DESCRIPTION
-WMbiff displays the status of up to five mailboxes. It gives information
-about new mail, if any, or total number of messages. It also has mail
+WMbiff displays the status of up to five mailboxes. It shows the number
+of new mail messages, if any, or the total number of messages.
+It also has mail
 retrieval capabilies, and can be configured to do this automatically. At the
 moment, UNIX-style, maildir, POP3, APOP and IMAP4 mailboxes are supported.
 WMbiff also supports Licq history files and gnomeicu, displaying the number of new
@@ -33,7 +34,10 @@ and also optionally, a command can be executed on mail arrival (for example,
 opening your mail reader or playing a sound file).
 
 Pressing mouse button 1 will execute a command, defined in the user's config
-file. Mouse button 3 will execute a command to fetch mail, if defined.
+file. Mouse button 3 will execute a command to fetch mail, if defined.  
+To restart wmbiff, press mouse button 1 while holding control and shift keys,
+or send it SIGUSR1.
+
 .PP
 
 .SH OPTIONS
@@ -51,10 +55,41 @@ Use an alternate X Display.
 Initial window position.
 .TP
 .B \-c <filename>
-Use specified config file.
+Use specified configuration file instead of ~/.wmbiffrc.
 .TP
 .B \-debug 
 Print verbose log of progress.
+.TP
+.B \-fg <color>
+Use specified X11 color.  Implies -font default, unless 
+overridden.
+.TP
+.B \-font <font>
+Use specified X11 font instead of the LED pixmap.  This may
+be more readable or suitable for some non-US characters.
+The special font "default" tells wmbiff to use a compile
+time default.
+.TP
+.B \-hi <color>
+Use specified X11 color for new mail counters.  Implies -font
+default, unless overridden.
+.TP
+.B \-skip-certificate-check
+When using TLS (IMAPS), keep going, even if the server's
+certificate is invalid.  Invalid certificates have expired,
+have a different hostname than you connected to, are
+corrupt, or have been revoked.  Do not use this option
+unless wmbiff fails and suggests it to you, and even then,
+be careful and consider alerting your mail system
+administrator first.  The need to use this option is a sign
+of server misconfiguration.
+.TP
+.B \+w 
+Do not use the "withdrawn" state: the wmbiff window will not
+be captured as an icon and placed in the dock, but will
+instead have its own window.  This option starts with a '+'
+for consistency with other software programs: many use '-w'
+to mean the opposite.
 
 .SH BUGS
 Send bug reports or suggestions to the WMBiff Development
@@ -72,7 +107,7 @@ peruser wmbiff configuration file.
 
 .SH AUTHOR
 This manual page was written by Jordi Mallach <jordi at sindominio.net>,
-originally for the Debian GNU/Linux system (but may be used by others).
+originally for the Debian system (but may be used by others).
 .br
 WMBiff was first maintained by Gennady Belyakov. Since January 2001 it is
 maintained group of people that have added lots of new features to the
diff --git a/wmbiff/wmbiff.c b/wmbiff/wmbiff.c
index f836fc0..51e7f3c 100644
--- a/wmbiff/wmbiff.c
+++ b/wmbiff/wmbiff.c
@@ -1,11 +1,15 @@
-/* $Id: wmbiff.c,v 1.17 2002/03/06 07:59:24 bluehal Exp $ */
+/* $Id: wmbiff.c,v 1.67 2004/10/01 21:02:50 bluehal Exp $ */
 
-#define	USE_POLL
+// typedef int gcry_error_t;
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
 
 #include <time.h>
 #include <ctype.h>
 
-#ifdef USE_POLL
+#ifdef HAVE_POLL
 #include <poll.h>
 #else
 #include <sys/time.h>
@@ -13,438 +17,155 @@
 
 #include <sys/wait.h>
 #include <sys/types.h>
+#include <sys/stat.h>
 #include <signal.h>
 
 #include <X11/Xlib.h>
 #include <X11/xpm.h>
+#include <X11/cursorfont.h>
 
 #include <errno.h>
+#include <string.h>
 
 #include "../wmgeneral/wmgeneral.h"
 #include "../wmgeneral/misc.h"
 
 #include "Client.h"
 #include "charutil.h"
+#include "MessageList.h"
 
 #ifdef USE_DMALLOC
 #include <dmalloc.h>
 #endif
 
-#include "wmbiff-master.xpm"
-char wmbiff_mask_bits[64 * 64];
-const int wmbiff_mask_width = 64;
-const int wmbiff_mask_height = 64;
+#include "wmbiff-master-led.xpm"
+static char wmbiff_mask_bits[64 * 64];
+static const int wmbiff_mask_width = 64;
+// const int wmbiff_mask_height = 64;
 
 #define CHAR_WIDTH  5
 #define CHAR_HEIGHT 7
 
 #define BLINK_TIMES 8
-#define DEFAULT_SLEEP_INTERVAL 1000
+#define DEFAULT_SLEEP_INTERVAL 5000
 #define BLINK_SLEEP_INTERVAL    200
 #define DEFAULT_LOOP 5
 
-mbox_t mbox[5];
-
-int ReadLine(FILE *, char *, char *, int *);
-int Read_Config_File(char *, int *);
-int count_mail(int);
-void parse_cmd(int, char **, char *);
-void init_biff(char *);
-void displayMsgCounters(int, int, int *, int *);
-
-void usage(void);
-void printversion(void);
-void do_biff(int argc, char **argv) __attribute__ ((noreturn));
-void parse_mbox_path(int item);
-static void BlitString(const char *name, int x, int y, int new);
-void BlitNum(int num, int x, int y, int new);
-void ClearDigits(int i);
-void XSleep(int millisec);
-void sigchld_handler(int sig);
+#define MAX_NUM_MAILBOXES 40
+static mbox_t mbox[MAX_NUM_MAILBOXES];
+
+/* this is the normal pixmap. */
+static const char *skin_filename = "wmbiff-master-led.xpm";
+/* global notify action taken (if globalnotify option is set) */
+/*@null@*/
+static const char *globalnotify = NULL;
+/* path to search for pixmaps */
+/* /usr/share/wmbiff should have the default pixmap. */
+/* /usr/local/share/wmbiff if compiled locally. */
+/* / is there in case a user wants to specify a complete path */
+/* . is there for development. */
+static const char *skin_search_path = DEFAULT_SKIN_PATH;
+/* for gnutls */
+/*@null@*/
+const char *certificate_filename = NULL;
+
+/* it could be argued that a better default exists. */
+#define DEFAULT_FONT  "-*-fixed-*-r-*-*-10-*-*-*-*-*-*-*"
+/*@null@*/
+static const char *font = NULL;
 
 int debug_default = DEBUG_ERROR;
 
-void init_biff(char *uconfig_file)
-{
-	int i, j, loopinterval = DEFAULT_LOOP;
-	char config_file[256];
-	char *m;
-
-	for (i = 0; i < 5; i++) {
-		mbox[i].label[0] = 0;
-		mbox[i].path[0] = 0;
-		mbox[i].notify[0] = 0;
-		mbox[i].action[0] = 0;
-		mbox[i].fetchcmd[0] = 0;
-		mbox[i].loopinterval = 0;
-		mbox[i].debug = debug_default;
-	}
-
-	/* Some defaults, if config file is unavailable */
-	strcpy(mbox[0].label, "Spool");
-	if ((m = getenv("MAIL")) != NULL) {
-		strcpy(mbox[0].path, m);
-	} else if ((m = getenv("USER")) != NULL) {
-		strcpy(mbox[0].path, "/var/mail/");
-		strcat(mbox[0].path, m);
-	}
-#ifdef WITH_GCRYPT
-	/* gcrypt is a little strange, in that it doesn't 
-	 * seem to initialize its memory pool by itself. 
-	 * I believe we *expect* "Warning: using insecure memory!"
-	 */
-	if ((i = gcry_control(GCRYCTL_INIT_SECMEM, 16384, 0)) != 0) {
-		DMA(DEBUG_ERROR,
-			"Error: gcry_control() to initialize secure memory returned non-zero: %d\n"
-			" Message: %s\n"
-			" libgcrypt version: %s\n"
-			" recovering: will fail later if using CRAM-MD5 or APOP authentication.\n",
-			i, gcry_strerror(gcry_errno()), gcry_check_version(NULL));
-	};
-#endif
-
-	/* Read config file */
-	if (uconfig_file[0] != 0) {
-		/* user-specified config file */
-		DMA(DEBUG_INFO, "Using user-specified config file '%s'.\n",
-			uconfig_file);
-		strcpy(config_file, uconfig_file);
-	} else
-		sprintf(config_file, "%s/.wmbiffrc", getenv("HOME"));
+/* color from wmbiff's xpm, down to 24 bits. */
+const char *foreground = "#21B3AF";	/* foreground cyan */
+const char *background = "#202020";	/* background gray */
+static const char *highlight = "yellow";
+int SkipCertificateCheck = 0;
+int Relax = 0;					/* be not paranoid */
+static int notWithdrawn = 0;
 
-	DMA(DEBUG_INFO, "config_file = %s.\n", config_file);
+static unsigned int num_mailboxes = 1;
+static const int x_origin = 5;
+static const int y_origin = 5;
+static int forever = 1;			/* keep running. */
 
-	if (!Read_Config_File(config_file, &loopinterval)) {
-		if (m == NULL) {
-			DMA(DEBUG_ERROR, "Cannot open '%s' nor use the "
-				"MAIL environment var.\n", uconfig_file);
-			exit(1);
-		}
-		/* we are using MAIL environment var. type mbox */
-		DMA(DEBUG_INFO, "Using MAIL environment var '%s'.\n", m);
-		mboxCreate((&mbox[0]), mbox[0].path);
-	}
+extern Window win;
+extern Window iconwin;
 
-	/* Make labels look right */
-	for (i = 0; i < 5; i++) {
-		if (mbox[i].label[0] != 0) {
-			j = strlen(mbox[i].label);
-			if (j < 5) {
-				memset(mbox[i].label + j, ' ', 5 - j);
-			}
-			mbox[i].label[5] = ':';
-			mbox[i].label[6] = 0;
-			/* set global loopinterval to boxes with 0 loop */
-			if (!mbox[i].loopinterval) {
-				mbox[i].loopinterval = loopinterval;
-			}
-		}
-	}
-}
+Cursor busy_cursor, ready_cursor;
 
-void do_biff(int argc, char **argv)
+static __inline /*@out@ */ void *
+malloc_ordie(size_t len)
 {
-	int i;
-	XEvent Event;
-	int but_stat = -1;
-	time_t curtime;
-	int NeedRedraw = 0;
-	int Sleep_Interval = DEFAULT_SLEEP_INTERVAL;	/* Default sleep time (in msec) */
-	int Blink_Mode = 0;			/* Bit mask, digits are in blinking mode or not.
-								   Each bit for separate mailbox */
-
-
-	createXBMfromXPM(wmbiff_mask_bits, wmbiff_master_xpm,
-					 wmbiff_mask_width, wmbiff_mask_height);
-
-	openXwindow(argc, argv, wmbiff_master_xpm, wmbiff_mask_bits,
-				wmbiff_mask_width, wmbiff_mask_height);
-
-	AddMouseRegion(0, 5, 6, 58, 16);
-	AddMouseRegion(1, 5, 16, 58, 26);
-	AddMouseRegion(2, 5, 26, 58, 36);
-	AddMouseRegion(3, 5, 36, 58, 46);
-	AddMouseRegion(4, 5, 46, 58, 56);
-
-#if 0
-	copyXPMArea(39, 84, (3 * CHAR_WIDTH), 8, 39, 5);
-	copyXPMArea(39, 84, (3 * CHAR_WIDTH), 8, 39, 16);
-	copyXPMArea(39, 84, (3 * CHAR_WIDTH), 8, 39, 27);
-	copyXPMArea(39, 84, (3 * CHAR_WIDTH), 8, 39, 38);
-	copyXPMArea(39, 84, (3 * CHAR_WIDTH), 8, 39, 49);
-
-	BlitString("XX", 45, 5, 0);
-	BlitString("XX", 45, 16, 0);
-	BlitString("XX", 45, 27, 0);
-	BlitString("XX", 45, 38, 0);
-	BlitString("XX", 45, 49, 0);
-#endif
-
-	/* Initially read mail counters and resets,
-	   and initially draw labels and counters */
-	curtime = time(0);
-	for (i = 0; i < 5; i++) {
-		if (mbox[i].label[0] != 0) {
-			mbox[i].prevtime = mbox[i].prevfetch_time = curtime;
-			BlitString(mbox[i].label, 5, (11 * i) + 5, 0);
-			DM(&mbox[i], DEBUG_INFO,
-			   "working on [%d].label=>%s< [%d].path=>%s<\n", i,
-			   mbox[i].label, i, mbox[i].path);
-			displayMsgCounters(i, count_mail(i), &Sleep_Interval,
-							   &Blink_Mode);
-		}
-	}
-
-	RedrawWindow();
-
-	NeedRedraw = 0;
-	while (1) {
-		/* waitpid(0, NULL, WNOHANG); */
-
-		for (i = 0; i < 5; i++) {
-			if (mbox[i].label[0] != 0) {
-				curtime = time(0);
-				if (curtime >= mbox[i].prevtime + mbox[i].loopinterval) {
-					NeedRedraw = 1;
-					DM(&mbox[i], DEBUG_INFO,
-					   "working on [%d].label=>%s< [%d].path=>%s<\n", i,
-					   mbox[i].label, i, mbox[i].path);
-					DM(&mbox[i], DEBUG_INFO,
-					   "curtime=%d, prevtime=%d, interval=%d\n",
-					   (int) curtime, (int) mbox[i].prevtime,
-					   mbox[i].loopinterval);
-					mbox[i].prevtime = curtime;
-					displayMsgCounters(i, count_mail(i), &Sleep_Interval,
-									   &Blink_Mode);
-				}
-			}
-			if (mbox[i].blink_stat > 0) {
-				if (--mbox[i].blink_stat <= 0) {
-					Blink_Mode &= ~(1 << i);
-					mbox[i].blink_stat = 0;
-				}
-				displayMsgCounters(i, 1, &Sleep_Interval, &Blink_Mode);
-				NeedRedraw = 1;
-			}
-			if (Blink_Mode == 0) {
-				mbox[i].blink_stat = 0;
-				Sleep_Interval = DEFAULT_SLEEP_INTERVAL;
-			}
-			if (mbox[i].fetchinterval > 0 && mbox[i].fetchcmd[0] != 0
-				&& curtime >=
-				mbox[i].prevfetch_time + mbox[i].fetchinterval) {
-				execCommand(mbox[i].fetchcmd);
-				mbox[i].prevfetch_time = curtime;
-			}
-		}
-		if (NeedRedraw) {
-			NeedRedraw = 0;
-			RedrawWindow();
-		}
-
-		/* X Events */
-		while (XPending(display)) {
-			XNextEvent(display, &Event);
-			switch (Event.type) {
-			case Expose:
-				RedrawWindow();
-				break;
-			case DestroyNotify:
-				XCloseDisplay(display);
-				exit(0);
-				break;
-			case ButtonPress:
-				i = CheckMouseRegion(Event.xbutton.x, Event.xbutton.y);
-				but_stat = i;
-				break;
-			case ButtonRelease:
-				i = CheckMouseRegion(Event.xbutton.x, Event.xbutton.y);
-				if (but_stat == i && but_stat >= 0) {
-					switch (Event.xbutton.button) {
-					case 1:	/* Left mouse-click */
-						if (mbox[but_stat].action[0] != 0) {
-							execCommand(mbox[but_stat].action);
-						}
-						break;
-					case 3:	/* Right mouse-click */
-						if (mbox[but_stat].fetchcmd[0] != 0) {
-							execCommand(mbox[but_stat].fetchcmd);
-						}
-						break;
-					}
-				}
-				but_stat = -1;
-				/* RedrawWindow(); */
-				break;
-			}
-		}
-		XSleep(Sleep_Interval);
+	void *ret = malloc(len);
+	if (ret == NULL) {
+		fprintf(stderr, "unable to allocate %d bytes\n", (int) len);
+		abort();
 	}
+	return (ret);
 }
 
-void displayMsgCounters(int i, int mail_stat, int *Sleep_Interval,
-						int *Blink_Mode)
+/* where vertically the mailbox sits for blitting characters. */
+static int mbox_y(unsigned int mboxnum)
 {
-	switch (mail_stat) {
-	case 2:					/* New mail has arrived */
-		/* Enter blink-mode for digits */
-		mbox[i].blink_stat = BLINK_TIMES * 2;
-		*Sleep_Interval = BLINK_SLEEP_INTERVAL;
-		*Blink_Mode |= (1 << i);	/* Global blink flag set for this mailbox */
-		ClearDigits(i);			/* Clear digits */
-		if ((mbox[i].blink_stat & 0x01) == 0) {
-			BlitNum(mbox[i].UnreadMsgs, 45, (11 * i) + 5, 1);	/* Yellow digits */
-		}
-		if (mbox[i].notify[0] != 0) {	/* need to call notify() ? */
-			if (!strcasecmp(mbox[i].notify, "beep")) {	/* Internal keyword ? */
-				XBell(display, 100);	/* Yes, bell */
-			} else {
-				execCommand(mbox[i].notify);	/* Else call external notifyer */
-			}
-		}
-
-		/* Autofetch on new mail arrival? */
-		if (mbox[i].fetchinterval == -1 && mbox[i].fetchcmd[0] != 0) {
-			execCommand(mbox[i].fetchcmd);	/* yes */
-		}
-		break;
-	case 1:					/* mailbox has been rescanned/changed */
-		ClearDigits(i);			/* Clear digits */
-		if ((mbox[i].blink_stat & 0x01) == 0) {
-			if (mbox[i].UnreadMsgs > 0) {	/* New mail arrived */
-				BlitNum(mbox[i].UnreadMsgs, 45, (11 * i) + 5, 1);	/* Yellow digits */
-			} else {
-				BlitNum(mbox[i].TotalMsgs, 45, (11 * i) + 5, 0);	/* Cyan digits */
-			}
-		}
-		break;
-	case 0:
-		break;
-	case -1:					/* Error was detected */
-		ClearDigits(i);			/* Clear digits */
-		BlitString("XX", 45, (11 * i) + 5, 0);
-		break;
-	}
+	return ((11 * mboxnum) + y_origin);
 }
 
-/** counts mail in spool-file
-   Returned value:
-   -1 : Error was encountered
-   0  : mailbox status wasn't changed
-   1  : mailbox was changed (NO new mail)
-   2  : mailbox was changed AND new mail has arrived
-**/
-int count_mail(int item)
+/* special shortcuts for longer shell client commands */
+static int gicuCreate( /*@notnull@ */ Pop3 pc, const char *path)
 {
-	int rc = 0;
-
-	if (!mbox[item].checkMail) {
-		return -1;
-	}
-
-	if (mbox[item].checkMail(&(mbox[item])) < 0) {
-		/* we failed to obtain any numbers
-		 * therefore set them to -1's
-		 * ensuring the next pass (even if zero)
-		 * will be captured correctly
-		 */
-		mbox[item].TotalMsgs = -1;
-		mbox[item].UnreadMsgs = -1;
-		mbox[item].OldMsgs = -1;
-		mbox[item].OldUnreadMsgs = -1;
-		return -1;
-	}
-
-	if (mbox[item].UnreadMsgs > mbox[item].OldUnreadMsgs &&
-		mbox[item].UnreadMsgs > 0) {
-		rc = 2;					/* New mail detected */
-	} else if (mbox[item].UnreadMsgs < mbox[item].OldUnreadMsgs ||
-			   mbox[item].TotalMsgs != mbox[item].OldMsgs) {
-		rc = 1;					/* mailbox was changed - NO new mail */
+	char buf[255];
+	if (isdigit(path[5])) {
+		sprintf(buf,
+				"shell:::echo `gnomeicu-client -u%s msgcount` new",
+				path + 5);
 	} else {
-		rc = 0;					/* mailbox wasn't changed */
-	}
-	mbox[item].OldMsgs = mbox[item].TotalMsgs;
-	mbox[item].OldUnreadMsgs = mbox[item].UnreadMsgs;
-	return rc;
-}
-
-/* Blits a string at given co-ordinates
-   If a ``new'' parameter is given, all digits will be yellow
-*/
-static void BlitString(const char *name, int x, int y, int new)
-{
-	int i, c, k = x;
-
-	for (i = 0; name[i]; i++) {
-		c = toupper(name[i]);
-		if (c >= 'A' && c <= 'Z') {	/* it's a letter */
-			c -= 'A';
-			copyXPMArea(c * (CHAR_WIDTH + 1), 74,
-						(CHAR_WIDTH + 1), (CHAR_HEIGHT + 1), k, y);
-			k += (CHAR_WIDTH + 1);
-		} else {				/* it's a number or symbol */
-			c -= '0';
-			if (new) {
-				copyXPMArea((c * (CHAR_WIDTH + 1)) + 65, 0,
-							(CHAR_WIDTH + 1), (CHAR_HEIGHT + 1), k, y);
-			} else {
-				copyXPMArea((c * (CHAR_WIDTH + 1)), 64,
-							(CHAR_WIDTH + 1), (CHAR_HEIGHT + 1), k, y);
-			}
-			k += (CHAR_WIDTH + 1);
-		}
+		sprintf(buf, "shell:::echo `gnomeicu-client msgcount` new");
 	}
+	return (shellCreate(pc, buf));
 }
 
-/* Blits number to give coordinates.. two 0's, right justified */
-void BlitNum(int num, int x, int y, int new)
-{
-	char buf[32];
-	int newx = x;
-
-	if (num > 99)
-		newx -= (CHAR_WIDTH + 1);
-	if (num > 999)
-		newx -= (CHAR_WIDTH + 1);
-
-	sprintf(buf, "%02i", num);
-
-	BlitString(buf, newx, y, new);
-}
-
-void ClearDigits(int i)
+static int fingerCreate( /*@notnull@ */ Pop3 pc, const char *path)
 {
-	copyXPMArea((10 * (CHAR_WIDTH + 1)), 64, (CHAR_WIDTH + 1),
-				(CHAR_HEIGHT + 1), 35, (11 * i) + 5);
-	copyXPMArea(39, 84, (3 * (CHAR_WIDTH + 1)), (CHAR_HEIGHT + 1), 39, (11 * i) + 5);	/* Clear digits */
+	char buf[255];
+	sprintf(buf, "shell:::finger -lm %s | "
+			"perl -ne '(/^new mail/i && print \"new\");' "
+			"-e '(/^mail last read/i && print \"old\");' "
+			"-e '(/^no( unread)? mail/i && print \"no\");'", path + 7);
+	return (shellCreate(pc, buf));
 }
 
-/* 	Read a line from a file to obtain a pair setting=value 
+/* 	Read a line from a file to obtain a pair setting=value
 	skips # and leading spaces
 	NOTE: if setting finish with 0, 1, 2, 3 or 4 last char are deleted and
-	index takes its value... if not index will get -1 
+	index takes its value... if not index will get -1
 	Returns -1 if no setting=value
 */
-int ReadLine(FILE * fp, char *setting, char *value, int *mbox_index)
+static int ReadLine(FILE * fp, /*@out@ */ char *setting,
+					/*@out@ */ char *value, /*@out@ */ int *mbox_index)
 {
 	char buf[BUF_SIZE];
 	char *p, *q;
-	int len, aux;
+	int len;
 
-	*setting = 0;
-	*value = 0;
+	*setting = '\0';
+	*value = '\0';
+	*mbox_index = -1;
 
-	if (!fp || feof(fp) || !fgets(buf, BUF_SIZE - 1, fp))
+	if (!fp || feof(fp))
+		return -1;
+
+	if (!fgets(buf, BUF_SIZE - 1, fp))
 		return -1;
 
 	len = strlen(buf);
 
 	if (buf[len - 1] == '\n') {
-		buf[len - 1] = 0;		/* strip linefeed */
+		buf[len - 1] = '\0';	/* strip linefeed */
 	}
-	for (p = (char *) buf; *p != '#' && *p; p++);
-	*p = 0;						/* Strip comments */
+
+	StripComment(buf);
+
 	if (!(p = strtok(buf, "=")))
 		return -1;
 	if (!(q = strtok(NULL, "\n")))
@@ -459,55 +180,76 @@ int ReadLine(FILE * fp, char *setting, char *value, int *mbox_index)
 	FullTrim(p);
 	FullTrim(q);
 
-	strcpy(setting, p);
+	/* strcpy(setting, p); nspring replaced with sscanf dec 2002 */
 	strcpy(value, q);
 
-	len = strlen(setting) - 1;
-	if (len > 0) {
-		aux = setting[len] - 48;
-		if (aux > -1 && aux < 5) {
-			setting[len] = 0;
-			*mbox_index = aux;
+	if (sscanf(p, "%[_a-z.]%d", setting, mbox_index) == 2) {
+		/* mailbox-specific configuration, ends in a digit */
+		if (*mbox_index < 0 || *mbox_index >= MAX_NUM_MAILBOXES) {
+			DMA(DEBUG_ERROR, "invalid mailbox number %d\n", *mbox_index);
+			exit(EXIT_FAILURE);
 		}
-	} else
+	} else if (sscanf(p, "%[a-z]", setting) == 1) {
+		/* global configuration, all text. */
 		*mbox_index = -1;
+	} else {
+		/* we found an uncommented line that has an equals,
+		   but is non-alphabetic. */
+		DMA(DEBUG_INFO, "unparsed setting %s\n", p);
+		return -1;
+	}
 
 	DMA(DEBUG_INFO, "@%s.%d=%s@\n", setting, *mbox_index, value);
 	return 1;
 }
 
-void parse_mbox_path(int item)
+struct path_demultiplexer {
+	const char *id;				/* followed by a colon */
+	int (*creator) ( /*@notnull@ */ Pop3 pc, const char *path);
+};
+
+static struct path_demultiplexer paths[] = {
+	{"pop3:", pop3Create},
+	{"shell:", shellCreate},
+	{"gicu:", gicuCreate},
+	{"licq:", licqCreate},
+	{"finger:", fingerCreate},
+	{"imap:", imap4Create},
+	{"imaps:", imap4Create},
+	{"sslimap:", imap4Create},
+	{"pop3:", pop3Create},
+	{"maildir:", maildirCreate},
+	{"mbox:", mboxCreate},
+	{NULL, NULL}
+};
+
+
+static void parse_mbox_path(unsigned int item)
 {
-	if (!strncasecmp(mbox[item].path, "pop3:", 5)) {	/* pop3 account */
-		pop3Create((&mbox[item]), mbox[item].path);
-	} else if (!strncasecmp(mbox[item].path, "shell:", 6)) {	/* generic cmd */
-		shellCreate((&mbox[item]), mbox[item].path);
-	} else if (!strncasecmp(mbox[item].path, "gicu:", 5)) {	/* gnomeicu check */
-		char buf[255];
-		if (isdigit(mbox[item].path[5])) {
-			sprintf(buf, "shell:::gnomeicu-client -u%s msgcount",
-					mbox[item].path + 5);
-		} else {
-			sprintf(buf, "shell:::gnomeicu-client msgcount");
+	int i;
+	/* find the creator */
+	for (i = 0;
+		 paths[i].id != NULL
+		 && strncasecmp(mbox[item].path, paths[i].id, strlen(paths[i].id));
+		 i++);
+	/* if found, execute */
+	if (paths[i].id != NULL) {
+		if (paths[i].creator((&mbox[item]), mbox[item].path) != 0) {
+			DMA(DEBUG_ERROR, "creator for mailbox %u returned failure\n",
+				item);
 		}
-		shellCreate((&mbox[item]), buf);
-	} else if (!strncasecmp(mbox[item].path, "licq:", 5)) {	/* licq history file */
-		licqCreate((&mbox[item]), mbox[item].path);
-	} else if (!strncasecmp(mbox[item].path, "imap:", 5) ||	/* imap4 account */
-			   !strncasecmp(mbox[item].path, "sslimap:", 8) ||	/* sslimap4 account */
-			   !strncasecmp(mbox[item].path, "imaps:", 6)) {	/* sslimap4 account */
-		imap4Create((&mbox[item]), mbox[item].path);
-	} else if (!strncasecmp(mbox[item].path, "maildir:", 8)) {	/* maildir */
-		maildirCreate((&mbox[item]), mbox[item].path);
-	} else
-		mboxCreate((&mbox[item]), mbox[item].path);	/* default are mbox */
+	} else {
+		/* default are mbox */
+		mboxCreate((&mbox[item]), mbox[item].path);
+	}
 }
 
-int Read_Config_File(char *filename, int *loopinterval)
+static int Read_Config_File(char *filename, int *loopinterval)
 {
 	FILE *fp;
-	char setting[17], value[250];
+	char setting[BUF_SMALL], value[BUF_SIZE];
 	int mbox_index;
+	unsigned int i;
 
 	if (!(fp = fopen(filename, "r"))) {
 		DMA(DEBUG_ERROR, "Unable to open %s, no settings read: %s\n",
@@ -517,22 +259,129 @@ int Read_Config_File(char *filename, int *loopinterval)
 	while (!feof(fp)) {
 		if (ReadLine(fp, setting, value, &mbox_index) == -1)
 			continue;
+
+		/* settings that can be global go here. */
 		if (!strcmp(setting, "interval")) {
 			*loopinterval = atoi(value);
-		} else if (mbox_index == -1)
+			continue;
+		} else if (!strcmp(setting, "askpass")) {
+			const char *askpass = strdup_ordie(value);
+			if (mbox_index == -1) {
+				DMA(DEBUG_INFO, "setting all to askpass %s\n", askpass);
+				for (i = 0; i < MAX_NUM_MAILBOXES; i++)
+					mbox[i].askpass = askpass;
+			} else {
+				mbox[mbox_index].askpass = askpass;
+			}
+			continue;
+		} else if (!strcmp(setting, "skinfile")) {
+			skin_filename = strdup_ordie(value);
+			continue;
+		} else if (!strcmp(setting, "certfile")) {	/* not yet supported */
+			certificate_filename = strdup_ordie(value);
+			continue;
+		} else if (!strcmp(setting, "globalnotify")) {
+			globalnotify = strdup_ordie(value);
+			continue;
+		} else if (mbox_index == -1) {
+			DMA(DEBUG_INFO, "Unknown global setting '%s'\n", setting);
 			continue;			/* Didn't read any setting.[0-5] value */
+		}
+
+		if (mbox_index >= MAX_NUM_MAILBOXES) {
+			DMA(DEBUG_ERROR, "Don't have %d mailboxes.\n", mbox_index);
+			continue;
+		}
+
+		if (1U + mbox_index > num_mailboxes
+			&& mbox_index + 1 <= MAX_NUM_MAILBOXES) {
+			num_mailboxes = 1U + mbox_index;
+		}
+
+		/* now only local settings */
 		if (!strcmp(setting, "label.")) {
-			strcpy(mbox[mbox_index].label, value);
+			if (strlen(value) + 1 > BUF_SMALL) {
+				DMA(DEBUG_ERROR,
+					"Mailbox %i label string '%s' is too long.\n",
+					mbox_index, value);
+				continue;
+			} else {
+				strncpy(mbox[mbox_index].label, value, BUF_SMALL - 1);
+			}
 		} else if (!strcmp(setting, "path.")) {
-			strcpy(mbox[mbox_index].path, value);
+			if (strlen(value) + 1 > BUF_BIG) {
+				DMA(DEBUG_ERROR,
+					"Mailbox %i path string '%s' is too long.\n",
+					mbox_index, value);
+				continue;
+			} else {
+				strncpy(mbox[mbox_index].path, value, BUF_BIG - 1);
+			}
 		} else if (!strcmp(setting, "notify.")) {
-			strcpy(mbox[mbox_index].notify, value);
+			if (strlen(value) + 1 > BUF_BIG) {
+				DMA(DEBUG_ERROR,
+					"Mailbox %i notify string '%s' is too long.\n",
+					mbox_index, value);
+				continue;
+			} else {
+				strncpy(mbox[mbox_index].notify, value, BUF_BIG - 1);
+			}
 		} else if (!strcmp(setting, "action.")) {
-			strcpy(mbox[mbox_index].action, value);
+			if (strlen(value) + 1 > BUF_BIG) {
+				DMA(DEBUG_ERROR,
+					"Mailbox %i action string '%s' is too long.\n",
+					mbox_index, value);
+				continue;
+			} else {
+				strncpy(mbox[mbox_index].action, value, BUF_BIG - 1);
+			}
+		} else if (!strcmp(setting, "action_disconnected.")) {
+			if (strlen(value) + 1 > BUF_BIG) {
+				DMA(DEBUG_ERROR,
+					"Mailbox %i action_disconnected string '%s' is too long.\n",
+					mbox_index, value);
+				continue;
+			} else {
+				strncpy(mbox[mbox_index].actiondc, value, BUF_BIG - 1);
+			}
+		} else if (!strcmp(setting, "action_new_mail.")) {
+			if (strlen(value) + 1 > BUF_BIG) {
+				DMA(DEBUG_ERROR,
+					"Mailbox %i action_new_mail string '%s' is too long.\n",
+					mbox_index, value);
+				continue;
+			} else {
+				strncpy(mbox[mbox_index].actionnew, value, BUF_BIG - 1);
+			}
+		} else if (!strcmp(setting, "action_no_new_mail.")) {
+			if (strlen(value) + 1 > BUF_BIG) {
+				DMA(DEBUG_ERROR,
+					"Mailbox %i action_no_new_mail string '%s' is too long.\n",
+					mbox_index, value);
+				continue;
+			} else {
+				strncpy(mbox[mbox_index].actionnonew, value, BUF_BIG - 1);
+			}
 		} else if (!strcmp(setting, "interval.")) {
 			mbox[mbox_index].loopinterval = atoi(value);
+		} else if (!strcmp(setting, "buttontwo.")) {
+			if (strlen(value) + 1 > BUF_BIG) {
+				DMA(DEBUG_ERROR,
+					"Mailbox %i buttontwo string '%s' is too long.\n",
+					mbox_index, value);
+				continue;
+			} else {
+				strncpy(mbox[mbox_index].button2, value, BUF_BIG - 1);
+			}
 		} else if (!strcmp(setting, "fetchcmd.")) {
-			strcpy(mbox[mbox_index].fetchcmd, value);
+			if (strlen(value) + 1 > BUF_BIG) {
+				DMA(DEBUG_ERROR,
+					"Mailbox %i fetchcmd string '%s' is too long.\n",
+					mbox_index, value);
+				continue;
+			} else {
+				strncpy(mbox[mbox_index].fetchcmd, value, BUF_BIG - 1);
+			}
 		} else if (!strcmp(setting, "fetchinterval.")) {
 			mbox[mbox_index].fetchinterval = atoi(value);
 		} else if (!strcmp(setting, "debug.")) {
@@ -544,103 +393,985 @@ int Read_Config_File(char *filename, int *loopinterval)
 			   line argument to provide all information
 			   possible. */
 			mbox[mbox_index].debug = debug_value;
+		} else {
+			DMA(DEBUG_INFO, "Unknown setting '%s'\n", setting);
 		}
 	}
-	fclose(fp);
-	for (mbox_index = 0; mbox_index < 5; mbox_index++)
-		if (mbox[mbox_index].label[0] != 0)
-			parse_mbox_path(mbox_index);
+	(void) fclose(fp);
+	for (i = 0; i < num_mailboxes; i++)
+		if (mbox[i].label[0] != '\0')
+			parse_mbox_path(i);
 	return 1;
 }
 
-/*
- * NOTE: this function assumes that the ConnectionNumber() macro
- *       will return the file descriptor of the Display struct
- *       (it does under XFree86 and solaris' openwin X)
- */
-void XSleep(int millisec)
-{
-#ifdef USE_POLL
-	struct pollfd timeout;
 
-	timeout.fd = ConnectionNumber(display);
-	timeout.events = POLLIN;
+static void init_biff(char *config_file)
+{
+#ifdef HAVE_GCRYPT_H
+	gcry_error_t rc;
+#endif
+	int loopinterval = DEFAULT_LOOP;
+	unsigned int i;
+
+	for (i = 0; i < MAX_NUM_MAILBOXES; i++) {
+		memset(mbox[i].label, 0, BUF_SMALL);
+		memset(mbox[i].path, 0, BUF_BIG);
+		memset(mbox[i].notify, 0, BUF_BIG);
+		memset(mbox[i].action, 0, BUF_BIG);
+		memset(mbox[i].actiondc, 0, BUF_BIG);
+		memset(mbox[i].actionnew, 0, BUF_BIG);
+		memset(mbox[i].actionnonew, 0, BUF_BIG);
+		memset(mbox[i].button2, 0, BUF_BIG);
+		memset(mbox[i].fetchcmd, 0, BUF_BIG);
+		mbox[i].loopinterval = 0;
+		mbox[i].getHeaders = NULL;
+		mbox[i].releaseHeaders = NULL;
+		mbox[i].debug = debug_default;
+		mbox[i].askpass = DEFAULT_ASKPASS;
+	}
 
-	poll(&timeout, 1, millisec);
-#else
-	struct timeval to;
-	struct timeval *timeout = NULL;
-	fd_set readfds;
-	int max_fd;
+#ifdef HAVE_GCRYPT_H
+	/* gcrypt is a little strange, in that it doesn't
+	 * seem to initialize its memory pool by itself.
+	 * I believe we *expect* "Warning: using insecure memory!"
+	 */
+	/* gcryctl_disable_secmem gets called before check_version -- in a message on
+	   gcrypt-devel august 17 2004. */
+	if ((rc = gcry_control(GCRYCTL_DISABLE_SECMEM, 0)) != 0) {
+		DMA(DEBUG_ERROR,
+			"Error: tried to disable gcrypt warning and failed: %d\n"
+			" Message: %s\n" " libgcrypt version: %s\n", rc,
+			gcry_strerror(rc), gcry_check_version(NULL));
+	}
 
-	if (millisec >= 0) {
-		timeout = &to;
-		to.tv_sec = millisec / 1000;
-		to.tv_usec = (millisec % 1000) * 1000;
+	/* recently made a requirement, section 2.4 of gcrypt manual */
+	if (gcry_check_version("1.1.42") == NULL) {
+		DMA(DEBUG_ERROR, "Error: incompatible gcrypt version.\n");
 	}
-	FD_ZERO(&readfds);
-	FD_SET(ConnectionNumber(display), &readfds);
-	max_fd = ConnectionNumber(display);
 
-	select(max_fd + 1, &readfds, NULL, NULL, timeout);
+	/* 
+	   if ((rc = gcry_control(GCRYCTL_INIT_SECMEM, 16384, 0)) != 0) {
+	   DMA(DEBUG_ERROR,
+	   "Error: gcry_control() to initialize secure memory returned non-zero: %d\n"
+	   " Message: %s\n"
+	   " libgcrypt version: %s\n"
+	   " recovering: will fail later if using CRAM-MD5 or APOP authentication.\n",
+	   rc, gcry_strerror(rc), gcry_check_version(NULL));
+	   };
+	 */
 #endif
-}
-
-void sigchld_handler(int sig __attribute__ ((unused)))
-{
-	waitpid(0, NULL, WNOHANG);
-	signal(SIGCHLD, sigchld_handler);
-}
-
-int main(int argc, char *argv[])
-{
-	char uconfig_file[256];
 
-	parse_cmd(argc, argv, uconfig_file);
-	init_biff(uconfig_file);
+	DMA(DEBUG_INFO, "config_file = %s.\n", config_file);
+	if (!Read_Config_File(config_file, &loopinterval)) {
+		char *m;
+		/* setup defaults if there's no config */
+		if ((m = getenv("MAIL")) != NULL) {
+			/* we are using MAIL environment var. type mbox */
+			if (strlen(m) + 1 > BUF_BIG) {
+				DMA(DEBUG_ERROR,
+					"MAIL environment var '%s' is too long.\n", m);
+			} else {
+				DMA(DEBUG_INFO, "Using MAIL environment var '%s'.\n", m);
+				strncpy(mbox[0].path, m, BUF_BIG - 1);
+			}
+		} else if ((m = getenv("USER")) != NULL) {
+			/* we will use the USER env var to find an mbox name */
+			if (strlen(m) + 10 + 1 > BUF_BIG) {
+				DMA(DEBUG_ERROR,
+					"USER environment var '%s' is too long.\n", m);
+			} else {
+				DMA(DEBUG_INFO, "Using /var/mail/%s.\n", m);
+				strcpy(mbox[0].path, "/var/mail/");
+				strncat(mbox[0].path, m, BUF_BIG - 1 - 10);
+				if (mbox[0].path[9] != '/') {
+					DMA(DEBUG_ERROR,
+						"Unexpected failure to construct /var/mail/username, please "
+						"report this with your operating system info and the version of wmbiff.");
+				}
+			}
+		} else {
+			DMA(DEBUG_ERROR, "Cannot open config file '%s' nor use the "
+				"MAIL environment var.\n", config_file);
+			exit(EXIT_FAILURE);
+		}
+		if (!exists(mbox[0].path)) {
+			DMA(DEBUG_ERROR, "Cannot open config file '%s', and the "
+				"default %s doesn't exist.\n", config_file, mbox[0].path);
+			exit(EXIT_FAILURE);
+		}
+		strcpy(mbox[0].label, "Spool");
+		mboxCreate((&mbox[0]), mbox[0].path);
+	}
+
+	/* Make labels look right */
+	for (i = 0; i < num_mailboxes; i++) {
+		if (mbox[i].label[0] != '\0') {
+			/* append a colon, but skip if we're using fonts. */
+			if (font == NULL) {
+				int j = strlen(mbox[i].label);
+				if (j < 5) {
+					memset(mbox[i].label + j, ' ', 5 - j);
+				}
+				mbox[i].label[5] = ':';
+			}
+			/* but always end after 5 characters */
+			mbox[i].label[6] = '\0';
+			/* set global loopinterval to boxes with 0 loop */
+			if (!mbox[i].loopinterval) {
+				mbox[i].loopinterval = loopinterval;
+			}
+		}
+	}
+}
+
+static char **LoadXPM(const char *pixmap_filename)
+{
+	char **xpm;
+	int success;
+	success = XpmReadFileToData((char *) pixmap_filename, &xpm);
+	switch (success) {
+	case XpmOpenFailed:
+		DMA(DEBUG_ERROR, "Unable to open %s\n", pixmap_filename);
+		break;
+	case XpmFileInvalid:
+		DMA(DEBUG_ERROR, "%s is not a valid pixmap\n", pixmap_filename);
+		break;
+	case XpmNoMemory:
+		DMA(DEBUG_ERROR, "Insufficient memory to read %s\n",
+			pixmap_filename);
+		break;
+	default:
+		break;
+	}
+	return (xpm);
+}
+
+/* tests as "test -f" would */
+int exists(const char *filename)
+{
+	struct stat st_buf;
+	DMA(DEBUG_INFO, "looking for %s\n", filename);
+	if (stat(filename, &st_buf) == 0 && S_ISREG(st_buf.st_mode)) {
+		DMA(DEBUG_INFO, "found %s\n", filename);
+		return (1);
+	}
+	return (0);
+}
+
+/* acts like execvp, with code inspired by it */
+/* mustfree */
+static char *search_path(const char *path,	/*@notnull@ */
+						 const char *find_me)
+{
+	char *buf;
+	const char *p;
+	int len, pathlen;
+	if (strchr(find_me, '/') != NULL) {
+		return (strdup_ordie(find_me));
+	}
+	pathlen = strlen(path);
+	len = strlen(find_me) + 1;
+	buf = malloc_ordie(pathlen + len + 1);
+	memcpy(buf + pathlen + 1, find_me, len);
+	buf[pathlen] = '/';
+
+	for (p = path; p != NULL; path = p, path++) {
+		char *startp;
+		p = strchr(path, ':');
+		if (p == NULL) {
+			/* not found; p should point to the null char at the end */
+			startp =
+				memcpy(buf + pathlen - strlen(path), path, strlen(path));
+		} else if (p == path) {
+			/* double colon in a path apparently means try here */
+			startp = &buf[pathlen + 1];
+		} else {
+			/* copy the part between the colons to the buffer */
+			startp = memcpy(buf + pathlen - (p - path), path, p - path);
+		}
+		if (exists(startp) != 0) {
+			char *ret = strdup_ordie(startp);
+			free(buf);
+			return (ret);
+		}
+	}
+	free(buf);
+	return (NULL);
+}
+
+/* verifies that .wmbiffrc, is a file, is owned by the user,
+   is not world writeable, and is not world readable.  This
+   is just to help keep passwords secure */
+static int wmbiffrc_permissions_check(const char *wmbiffrc_fname)
+{
+	struct stat st;
+	if (stat(wmbiffrc_fname, &st) != 0) {
+		DMA(DEBUG_ERROR, "Can't stat wmbiffrc: '%s'\n", wmbiffrc_fname);
+		return (1);				/* well, it's not a bad permission
+								   problem: if you can't find it,
+								   neither can the bad guys.. */
+	}
+	if (st.st_uid != getuid()) {
+		char *user = getenv("USER");
+		DMA(DEBUG_ERROR,
+			".wmbiffrc '%s' isn't owned by you.\n"
+			"Verify its contents, then 'chown %s %s'\n",
+			wmbiffrc_fname, ((user != NULL) ? user : "(your username)"),
+			wmbiffrc_fname);
+		return (0);
+	}
+	if ((st.st_mode & S_IWOTH) != 0) {
+		DMA(DEBUG_ERROR, ".wmbiffrc '%s' is world writable.\n"
+			"Verify its contents, then 'chmod 0600 %s'\n",
+			wmbiffrc_fname, wmbiffrc_fname);
+		return (0);
+	}
+	if ((st.st_mode & S_IROTH) != 0) {
+		DMA(DEBUG_ERROR, ".wmbiffrc '%s' is world readable.\n"
+			"Please run 'chmod 0600 %s' and consider changing your passwords.\n",
+			wmbiffrc_fname, wmbiffrc_fname);
+		return (0);
+	}
+	return (1);
+}
+
+static void ClearDigits(unsigned int i)
+{
+	if (font) {
+		eraseRect(39, mbox_y(i), 58, mbox_y(i + 1) - 1, background);
+	} else {
+		/* overwrite the colon */
+		copyXPMArea((10 * (CHAR_WIDTH + 1)), 64, (CHAR_WIDTH + 1),
+					(CHAR_HEIGHT + 1), 35, mbox_y(i));
+		/* blank out the number fields. */
+		copyXPMArea(39, 84, (3 * (CHAR_WIDTH + 1)), (CHAR_HEIGHT + 1), 39,
+					mbox_y(i));
+	}
+}
+
+/* Blits a string at given co-ordinates. If a ``new''
+   parameter is nonzero, all digits will be yellow */
+static void BlitString(const char *name, int x, int y, int new)
+{
+	if (font != NULL) {
+		/* an alternate behavior - draw the string using a font
+		   instead of the pixmap.  should allow pretty colors */
+		drawString(x, y + CHAR_HEIGHT + 1, name,
+				   new ? highlight : foreground, background, 0);
+	} else {
+		/* normal, LED-like behavior. */
+		int i, c, k = x;
+		for (i = 0; name[i] != '\0'; i++) {
+			c = toupper(name[i]);
+			if (c >= 'A' && c <= 'Z') {	/* it's a letter */
+				c -= 'A';
+				copyXPMArea(c * (CHAR_WIDTH + 1), (new ? 95 : 74),
+							(CHAR_WIDTH + 1), (CHAR_HEIGHT + 1), k, y);
+				k += (CHAR_WIDTH + 1);
+			} else {			/* it's a number or symbol */
+				c -= '0';
+				if (new) {
+					copyXPMArea((c * (CHAR_WIDTH + 1)) + 65, 0,
+								(CHAR_WIDTH + 1), (CHAR_HEIGHT + 1), k, y);
+				} else {
+					copyXPMArea((c * (CHAR_WIDTH + 1)), 64,
+								(CHAR_WIDTH + 1), (CHAR_HEIGHT + 1), k, y);
+				}
+				k += (CHAR_WIDTH + 1);
+			}
+		}
+	}
+}
+
+
+/* Blits number to give coordinates.. two 0's, right justified */
+static void BlitNum(int num, int x, int y, int new)
+{
+	char buf[32];
+
+	sprintf(buf, "%02i", num);
+
+	if (font != NULL) {
+		const char *color = (new) ? highlight : foreground;
+		drawString(x + (CHAR_WIDTH * 2 + 4), y + CHAR_HEIGHT + 1, buf,
+				   color, background, 1);
+	} else {
+		int newx = x;
+
+		if (num > 99)
+			newx -= (CHAR_WIDTH + 1);
+		if (num > 999)
+			newx -= (CHAR_WIDTH + 1);
+
+		BlitString(buf, newx, y, new);
+	}
+}
+
+/* helper function for displayMsgCounters, which has outgrown its name */
+static void blitMsgCounters(unsigned int i)
+{
+	int y_row = mbox_y(i);		/* constant for each mailbox */
+	ClearDigits(i);				/* Clear digits */
+	if ((mbox[i].blink_stat & 0x01) == 0) {
+		int newmail = (mbox[i].UnreadMsgs > 0) ? 1 : 0;
+		if (mbox[i].TextStatus[0] != '\0') {
+			BlitString(mbox[i].TextStatus, 39, y_row, newmail);
+		} else {
+			int mailcount =
+				(newmail) ? mbox[i].UnreadMsgs : mbox[i].TotalMsgs;
+			BlitNum(mailcount, 45, y_row, newmail);
+		}
+	}
+}
+
+/*
+ * void execnotify(1) : runs notify command, if given (not null)
+ */
+static void execnotify( /*@null@ */ const char *notifycmd)
+{
+	if (notifycmd != NULL) {	/* need to call notify() ? */
+		if (!strcasecmp(notifycmd, "beep")) {	/* Internal keyword ? */
+			/* Yes, bell */
+			XBell(display, 100);
+		} else if (!strcasecmp(notifycmd, "true")) {
+			/* Yes, nothing */
+		} else {
+			/* Else call external notifyer, ignoring the pid */
+			(void) execCommand(notifycmd);
+		}
+	}
+}
+
+
+static void
+displayMsgCounters(unsigned int i, int mail_stat, int *Blink_Mode)
+{
+	switch (mail_stat) {
+	case 2:					/* New mail has arrived */
+		/* Enter blink-mode for digits */
+		mbox[i].blink_stat = BLINK_TIMES * 2;
+		*Blink_Mode |= (1 << i);	/* Global blink flag set for this mailbox */
+		blitMsgCounters(i);
+		execnotify(mbox[i].notify);
+
+		/* Autofetch on new mail arrival? */
+		if (mbox[i].fetchinterval == -1 && mbox[i].fetchcmd[0] != '\0') {
+			(void) execCommand(mbox[i].fetchcmd);	/* yes */
+		}
+		break;
+	case 1:					/* mailbox has been rescanned/changed */
+		blitMsgCounters(i);
+		break;
+	case 0:
+		break;
+	case -1:					/* Error was detected */
+		ClearDigits(i);			/* Clear digits */
+		BlitString("XX", 45, mbox_y(i), 0);
+		break;
+	}
+}
+
+/** counts mail in spool-file
+   Returned value:
+   -1 : Error was encountered
+   0  : mailbox status wasn't changed
+   1  : mailbox was changed (NO new mail)
+   2  : mailbox was changed AND new mail has arrived
+**/
+static int count_mail(unsigned int item)
+{
+	int rc = 0;
+
+	if (!mbox[item].checkMail) {
+		return -1;
+	}
+
+	if (mbox[item].checkMail(&(mbox[item])) < 0) {
+		/* we failed to obtain any numbers therefore set
+		 * them to -1's ensuring the next pass (even if
+		 * zero) will be captured correctly
+		 */
+		mbox[item].TotalMsgs = -1;
+		mbox[item].UnreadMsgs = -1;
+		mbox[item].OldMsgs = -1;
+		mbox[item].OldUnreadMsgs = -1;
+		return -1;
+	}
+
+	if (mbox[item].UnreadMsgs > mbox[item].OldUnreadMsgs &&
+		mbox[item].UnreadMsgs > 0) {
+		rc = 2;					/* New mail detected */
+	} else if (mbox[item].UnreadMsgs < mbox[item].OldUnreadMsgs ||
+			   mbox[item].TotalMsgs != mbox[item].OldMsgs) {
+		rc = 1;					/* mailbox was changed - NO new mail */
+	} else {
+		rc = 0;					/* mailbox wasn't changed */
+	}
+	mbox[item].OldMsgs = mbox[item].TotalMsgs;
+	mbox[item].OldUnreadMsgs = mbox[item].UnreadMsgs;
+	return rc;
+}
+
+static int periodic_mail_check(void)
+{
+	int NeedRedraw = 0;
+	static int Blink_Mode = 0;	/* Bit mask, digits are in blinking
+								   mode or not. Each bit for separate
+								   mailbox */
+	int Sleep_Interval;			/* either DEFAULT_SLEEP_INTERVAL or
+								   BLINK_SLEEP_INTERVAL */
+	int NewMail = 0;			/* flag for global notify */
+	unsigned int i;
+	time_t curtime = time(0);
+	for (i = 0; i < num_mailboxes; i++) {
+		if (mbox[i].label[0] != '\0') {
+			if (curtime >= mbox[i].prevtime + mbox[i].loopinterval) {
+				int mailstat = 0;
+				NeedRedraw = 1;
+				DM(&mbox[i], DEBUG_INFO,
+				   "working on [%u].label=>%s< [%u].path=>%s<\n", i,
+				   mbox[i].label, i, mbox[i].path);
+				DM(&mbox[i], DEBUG_INFO,
+				   "curtime=%d, prevtime=%d, interval=%d\n",
+				   (int) curtime, (int) mbox[i].prevtime,
+				   mbox[i].loopinterval);
+				mbox[i].prevtime = curtime;
+
+				XDefineCursor(display, iconwin, busy_cursor);
+				RedrawWindow();
+
+				mailstat = count_mail(i);
+
+				XUndefineCursor(display, iconwin);
+
+				if ((mailstat == 2) && (mbox[i].notify[0] == '\0')) {
+					/* for global notify */
+					NewMail = 1;
+				}
+				displayMsgCounters(i, mailstat, &Blink_Mode);
+				/* update our idea of current time, as it
+				   may have changed as we check. */
+				curtime = time(0);
+			}
+			if (mbox[i].blink_stat > 0) {
+				if (--mbox[i].blink_stat <= 0) {
+					Blink_Mode &= ~(1 << i);
+					mbox[i].blink_stat = 0;
+				}
+				displayMsgCounters(i, 1, &Blink_Mode);
+				NeedRedraw = 1;
+			}
+			if (mbox[i].fetchinterval > 0 && mbox[i].fetchcmd[0] != '\0'
+				&& curtime >=
+				mbox[i].prevfetch_time + mbox[i].fetchinterval) {
+
+				XDefineCursor(display, iconwin, busy_cursor);
+				RedrawWindow();
+
+				(void) execCommand(mbox[i].fetchcmd);
+
+				XUndefineCursor(display, iconwin);
+
+				mbox[i].prevfetch_time = curtime;
+			}
+		}
+	}
+
+	/* exec globalnotify if there was any new mail */
+	if (NewMail == 1) {
+		execnotify(globalnotify);
+	}
+
+	if (Blink_Mode == 0) {
+		for (i = 0; i < num_mailboxes; i++) {
+			mbox[i].blink_stat = 0;
+		}
+		Sleep_Interval = DEFAULT_SLEEP_INTERVAL;
+	} else {
+		Sleep_Interval = BLINK_SLEEP_INTERVAL;
+	}
+
+	if (NeedRedraw) {
+		NeedRedraw = 0;
+		RedrawWindow();
+	}
+
+	return Sleep_Interval;
+}
+
+static int findTopOfMasterXPM(const char **skin_xpm)
+{
+	int i;
+	for (i = 0; skin_xpm[i] != NULL; i++) {
+		if (strstr(skin_xpm[i], "++++++++") != NULL)
+			return i;
+	}
+	DMA(DEBUG_ERROR,
+		"couldn't find the top of the xpm file using the simple method\n");
+	exit(EXIT_FAILURE);
+}
+
+static char **CreateBackingXPM(int width, int height,
+							   const char **skin_xpm)
+{
+	char **ret = malloc_ordie(sizeof(char *) * (height + 6)
+							  + sizeof(void *) /* trailing null space */ );
+	const int colors = 5;
+	const int base = colors + 1;
+	const int margin = 4;
+	int i;
+	int top = findTopOfMasterXPM(skin_xpm);
+	ret[0] = malloc_ordie(30);
+	sprintf(ret[0], "%d %d %d %d", width, height, colors, 1);
+	ret[1] = (char *) " \tc #0000FF";	/* no color */
+	ret[2] = (char *) ".\tc #202020";	/* background gray */
+	ret[2] = malloc_ordie(30);
+	sprintf(ret[2], ".\tc %s", background);
+	ret[3] = (char *) "+\tc #000000";	/* shadowed */
+	ret[4] = (char *) "@\tc #C7C3C7";	/* highlight */
+	ret[5] = (char *) ":\tc #004941";	/* led off */
+	for (i = base; i < base + height; i++) {
+		ret[i] = malloc_ordie(width);
+	}
+	for (i = base; i < base + margin; i++) {
+		memset(ret[i], ' ', width);
+	}
+	for (i = base + margin; i < height + base - margin; i++) {
+		memset(ret[i], ' ', margin);
+
+		if (i == base + margin) {
+			memset(ret[i] + margin, '+', width - margin - margin);
+		} else if (i == base + height - margin - 1) {
+			memset(ret[i] + margin, '@', width - margin - margin);
+		} else {
+			// "    +..:::...:::...:::...:::...:::.......:::...:::...:::...@    "
+			// "    +.:...:.:...:.:...:.:...:.:...:..:..:...:.:...:.:...:..@    "                                                                                               ",
+			ret[i][margin] = '+';
+			memset(ret[i] + margin + 1, '.', width - margin - margin - 1);
+			ret[i][width - margin - 1] = '@';
+			memcpy(ret[i],
+				   skin_xpm[((i - (base + margin) - 1) % 11) + top + 1],
+				   width);
+		}
+
+		memset(ret[i] + width - margin, ' ', margin);
+	}
+	for (i = base + height - margin; i < height + base; i++) {
+		memset(ret[i], ' ', width);
+	}
+	ret[height + base] = NULL;	/* not sure if this is necessary, it just
+								   seemed like a good idea  */
+	return (ret);
+}
+
+/*
+ * NOTE: this function assumes that the ConnectionNumber() macro
+ *       will return the file descriptor of the Display struct
+ *       (it does under XFree86 and solaris' openwin X)
+ */
+static void XSleep(int millisec)
+{
+#ifdef HAVE_POLL
+	struct pollfd timeout;
+
+	timeout.fd = ConnectionNumber(display);
+	timeout.events = POLLIN;
+
+	poll(&timeout, 1, millisec);
+#else
+	struct timeval to;
+	struct timeval *timeout = NULL;
+	fd_set readfds;
+	int max_fd;
+
+	if (millisec >= 0) {
+		timeout = &to;
+		to.tv_sec = millisec / 1000;
+		to.tv_usec = (millisec % 1000) * 1000;
+	}
+	FD_ZERO(&readfds);
+	FD_SET(ConnectionNumber(display), &readfds);
+	max_fd = ConnectionNumber(display);
+
+	select(max_fd + 1, &readfds, NULL, NULL, timeout);
+#endif
+}
+
+const char **restart_args;
+
+static void restart_wmbiff(int sig
+#ifdef HAVE___ATTRIBUTE__
+						   __attribute__ ((unused))
+#endif
+	)
+{
+	DMA(DEBUG_ERROR, "exec()'ing %s\n", restart_args[0]);
+	sleep(1);
+	execvp(restart_args[0], (char *const *) restart_args);
+	DMA(DEBUG_ERROR, "exec of %s failed: %s\n",
+		restart_args[0], strerror(errno));
+	exit(EXIT_FAILURE);
+}
+
+static void do_biff(int argc, const char **argv)
+{
+	unsigned int i;
+	static int but_pressed_region = -1;	/* static so click can be determined */
+	int but_released_region = -1;
+	time_t curtime;
+	int Sleep_Interval;
+	const char **skin_xpm = NULL;
+	const char **bkg_xpm = NULL;
+	char *skin_file_path = search_path(skin_search_path, skin_filename);
+	int wmbiff_mask_height = mbox_y(num_mailboxes) + 4;
+
+	DMA(DEBUG_INFO, "running %u mailboxes w %d h %d\n", num_mailboxes,
+		wmbiff_mask_width, wmbiff_mask_height);
+
+	if (skin_file_path != NULL) {
+		skin_xpm = (const char **) LoadXPM(skin_file_path);
+		free(skin_file_path);
+	}
+	if (skin_xpm == NULL) {
+		DMA(DEBUG_ERROR, "using built-in xpm; %s wasn't found in %s\n",
+			skin_filename, skin_search_path);
+		skin_xpm = wmbiff_master_xpm;
+	}
+
+	bkg_xpm = (const char **) CreateBackingXPM(wmbiff_mask_width,
+											   wmbiff_mask_height,
+											   skin_xpm);
+
+	createXBMfromXPM(wmbiff_mask_bits, bkg_xpm,
+					 wmbiff_mask_width, wmbiff_mask_height);
+
+	openXwindow(argc, argv, bkg_xpm, skin_xpm, wmbiff_mask_bits,
+				wmbiff_mask_width, wmbiff_mask_height, notWithdrawn);
+
+	/* now that display is set, we can create the cursors
+	   (mouse pointer shapes) */
+	busy_cursor = XCreateFontCursor(display, XC_watch);
+	ready_cursor = XCreateFontCursor(display, XC_left_ptr);
+
+	if (font != NULL) {
+		if (loadFont(font) < 0) {
+			DMA(DEBUG_ERROR, "unable to load font. exiting.\n");
+			exit(EXIT_FAILURE);
+		}
+		/* make the whole background black */
+		// removed; seems unnecessary with CreateBackingXPM 
+		//      eraseRect(x_origin, y_origin,
+		//    wmbiff_mask_width - 6, wmbiff_mask_height - 6, 
+		//          background);
+	}
+
+	/* First time setup of button regions and labels */
+	curtime = time(0);
+	for (i = 0; i < num_mailboxes; i++) {
+		/* make it easy to recover the mbox index from a mouse click */
+		AddMouseRegion(i, x_origin, mbox_y(i), 58, mbox_y(i + 1) - 1);
+		if (mbox[i].label[0] != '\0') {
+			mbox[i].prevtime = mbox[i].prevfetch_time = 0;
+			BlitString(mbox[i].label, x_origin, mbox_y(i), 0);
+		}
+	}
+
+	do {
+		/* waitpid(0, NULL, WNOHANG); */
+
+		Sleep_Interval = periodic_mail_check();
+
+		/* X Events */
+		while (XPending(display)) {
+			XEvent Event;
+			const char *press_action;
+
+			XNextEvent(display, &Event);
+
+			switch (Event.type) {
+			case Expose:
+				if (Event.xany.window != win &&
+					Event.xany.window != iconwin) {
+					msglst_redraw();
+				} else {
+					RedrawWindow();
+				}
+				break;
+			case DestroyNotify:
+				XCloseDisplay(display);
+				exit(EXIT_SUCCESS);
+				break;
+			case ButtonPress:
+				but_pressed_region =
+					CheckMouseRegion(Event.xbutton.x, Event.xbutton.y);
+				switch (Event.xbutton.button) {
+				case 1:
+					press_action = mbox[but_pressed_region].action;
+					break;
+				case 2:
+					press_action = mbox[but_pressed_region].button2;
+					break;
+				case 3:
+					press_action = mbox[but_pressed_region].fetchcmd;
+					break;
+				default:
+					press_action = NULL;
+					break;
+
+				}
+				if (press_action && strcmp(press_action, "msglst") == 0) {
+					msglst_show(&mbox[but_pressed_region],
+								Event.xbutton.x_root,
+								Event.xbutton.y_root);
+				}
+				break;
+			case ButtonRelease:
+				but_released_region =
+					CheckMouseRegion(Event.xbutton.x, Event.xbutton.y);
+				if (but_released_region == but_pressed_region
+					&& but_released_region >= 0) {
+					const char *click_action, *extra_click_action = NULL;
+
+					switch (Event.xbutton.button) {
+					case 1:	/* Left mouse-click */
+						/* C-S-left will restart wmbiff. */
+						if ((Event.xbutton.state & ControlMask) &&
+							(Event.xbutton.state & ShiftMask)) {
+							restart_wmbiff(0);
+						}
+						/* do we need to run an extra action? */
+						if (mbox[but_released_region].UnreadMsgs == -1) {
+							extra_click_action =
+								mbox[but_released_region].actiondc;
+						} else if (mbox[but_released_region].
+								   UnreadMsgs > 0) {
+							extra_click_action =
+								mbox[but_released_region].actionnew;
+						} else {
+							extra_click_action =
+								mbox[but_released_region].actionnonew;
+						}
+						click_action = mbox[but_released_region].action;
+						break;
+					case 2:	/* Middle mouse-click */
+						click_action = mbox[but_released_region].button2;
+						break;
+					case 3:	/* Right mouse-click */
+						click_action = mbox[but_released_region].fetchcmd;
+						break;
+					default:
+						click_action = NULL;
+						break;
+					}
+					if (extra_click_action != NULL
+						&& extra_click_action[0] != 0
+						&& strcmp(extra_click_action, "msglst")) {
+						DM(&mbox[but_released_region], DEBUG_INFO,
+						   "runing: %s", extra_click_action);
+						(void) execCommand(extra_click_action);
+					}
+					if (click_action != NULL
+						&& click_action[0] != '\0'
+						&& strcmp(click_action, "msglst")) {
+						DM(&mbox[but_released_region], DEBUG_INFO,
+						   "running: %s", click_action);
+						(void) execCommand(click_action);
+					}
+				}
+
+				/* a button was released, hide the message list if open */
+				msglst_hide();
+
+				but_pressed_region = -1;
+				/* RedrawWindow(); */
+				break;
+			}
+		}
+		XSleep(Sleep_Interval);
+	}
+	while (forever);			/* forever is usually true,
+								   but not when debugging with -exit */
+	if (skin_xpm != NULL && skin_xpm != wmbiff_master_xpm) {
+		free(skin_xpm);			// added 3 jul 02, appeasing valgrind
+	}
+	if (bkg_xpm != NULL) {
+		free(bkg_xpm);
+	}
+}
+
+static void sigchld_handler(int sig
+#ifdef HAVE___ATTRIBUTE__
+							__attribute__ ((unused))
+#endif
+	)
+{
+	while (waitpid(0, NULL, WNOHANG) > 0);
 	signal(SIGCHLD, sigchld_handler);
-	do_biff(argc, argv);
-	return 0;
 }
 
-void parse_cmd(int argc, char **argv, char *config_file)
+static void usage(void)
+{
+	printf("\nwmBiff v%s"
+		   " - incoming mail checker\n"
+		   "Gennady Belyakov and others (see the README file)\n"
+		   "Please report bugs to %s\n"
+		   "\n"
+		   "usage:\n"
+		   "    -bg <color>               background color\n"
+		   "    -c <filename>             use specified config file\n"
+		   "    -debug                    enable debugging\n"
+		   "    -display <display name>   use specified X display\n"
+		   "    -fg <color>               foreground color\n"
+		   "    -font <font>              font instead of LED\n"
+		   "    -geometry +XPOS+YPOS      initial window position\n"
+		   "    -h                        this help screen\n"
+		   "    -hi <color>               highlight color for new mail\n"
+#ifdef USE_GNUTLS
+		   "    -skip-certificate-check   using TLS, don't validate the\n"
+		   "                              server's certificate\n"
+#endif
+		   "    -relax                    assume the configuration is \n"
+		   "                              correct, parse it without paranoia, \n"
+		   "                              and assume hostnames are okay.\n"
+		   "    -v                        print the version number\n"
+		   "    +w                        not withdrawn: run as a window\n"
+		   "\n", PACKAGE_VERSION, PACKAGE_BUGREPORT);
+}
+
+static void printversion(void)
+{
+	printf("wmbiff v%s\n", PACKAGE_VERSION);
+}
+
+
+static void parse_cmd(int argc, const char **argv,	/*@out@ */
+					  char *config_file)
 {
 	int i;
 
-	char uconfig_file[256];
+	config_file[0] = '\0';
 
-	uconfig_file[0] = 0;
 	/* Parse Command Line */
 
 	for (i = 1; i < argc; i++) {
-		char *arg = argv[i];
+		const char *arg = argv[i];
 
 		if (*arg == '-') {
 			switch (arg[1]) {
+			case 'b':
+				if (strcmp(arg + 1, "bg") == 0) {
+					if (argc > (i + 1)) {
+						background = strdup_ordie(argv[i + 1]);
+						DMA(DEBUG_INFO, "new background: %s", foreground);
+						i++;
+						if (font == NULL)
+							font = DEFAULT_FONT;
+					}
+				}
+				break;
 			case 'd':
 				if (strcmp(arg + 1, "debug") == 0) {
 					debug_default = DEBUG_ALL;
-				} else if (strcmp(arg + 1, "display")) {
+				} else if (strcmp(arg + 1, "display") == 0) {
+					/* passed to X's command line parser */
+				} else {
+					usage();
+					exit(EXIT_FAILURE);
+				}
+				break;
+			case 'f':
+				if (strcmp(arg + 1, "fg") == 0) {
+					if (argc > (i + 1)) {
+						foreground = strdup_ordie(argv[i + 1]);
+						DMA(DEBUG_INFO, "new foreground: %s", foreground);
+						i++;
+						if (font == NULL)
+							font = DEFAULT_FONT;
+					}
+				} else if (strcmp(arg + 1, "font") == 0) {
+					if (argc > (i + 1)) {
+						if (strcmp(argv[i + 1], "default") == 0) {
+							font = DEFAULT_FONT;
+						} else {
+							font = strdup_ordie(argv[i + 1]);
+						}
+						DMA(DEBUG_INFO, "new font: %s", font);
+						i++;
+					}
+				} else {
 					usage();
 					exit(EXIT_FAILURE);
 				}
 				break;
 			case 'g':
-				if (strcmp(arg + 1, "geometry")) {
+				if (strcmp(arg + 1, "geometry") != 0) {
 					usage();
 					exit(EXIT_FAILURE);
+				} else {
+					i++;		/* gobble the argument */
+					if (i >= argc) {	/* fail if there's nothing to gobble */
+						usage();
+						exit(EXIT_FAILURE);
+					}
+				}
+				break;
+			case 'h':
+				if (strcmp(arg + 1, "hi") == 0) {
+					if (argc > (i + 1)) {
+						highlight = strdup_ordie(argv[i + 1]);
+						DMA(DEBUG_INFO, "new highlight: %s", highlight);
+						i++;
+						if (font == NULL)
+							font = DEFAULT_FONT;
+					}
+				} else if (strcmp(arg + 1, "h") == 0) {
+					usage();
+					exit(EXIT_SUCCESS);
 				}
 				break;
 			case 'v':
 				printversion();
 				exit(EXIT_SUCCESS);
 				break;
+			case 's':
+				if (strcmp(arg + 1, "skip-certificate-check") == 0) {
+					SkipCertificateCheck = 1;
+				} else {
+					usage();
+					exit(EXIT_SUCCESS);
+				}
+
+				break;
+			case 'r':
+				if (strcmp(arg + 1, "relax") == 0) {
+					Relax = 1;
+				} else {
+					usage();
+					exit(EXIT_SUCCESS);
+				}
+
+				break;
 			case 'c':
 				if (argc > (i + 1)) {
-					strcpy(uconfig_file, argv[i + 1]);
+					strncpy(config_file, argv[i + 1], 255);
 					i++;
 				}
 				break;
+			case 'e':			/* undocumented for debugging */
+				if (strcmp(arg + 1, "exit") == 0) {
+					forever = 0;
+				}
+				break;
+			default:
+				usage();
+				exit(EXIT_SUCCESS);
+				break;
+			}
+		} else if (*arg == '+') {
+			switch (arg[1]) {
+			case 'w':
+				notWithdrawn = 1;
+				break;
 			default:
 				usage();
 				exit(EXIT_SUCCESS);
@@ -648,29 +1379,54 @@ void parse_cmd(int argc, char **argv, char *config_file)
 			}
 		}
 	}
-	strcpy(config_file, uconfig_file);
 }
 
-void usage(void)
+int main(int argc, const char *argv[])
 {
-	printf("\nwmBiff v" WMBIFF_VERSION
-		   " - incoming mail checker\n"
-		   "Gennady Belyakov and others (see the README file)\n"
-		   "Please report bugs to wmbiff-devel at lists.sourceforge.net\n"
-		   "\n"
-		   "usage:\n"
-		   "    -debug                    enable debugging\n"
-		   "    -display <display name>   use specified X display\n"
-		   "    -geometry +XPOS+YPOS      initial window position\n"
-		   "    -c <filename>             use specified config file\n"
-		   "    -h                        this help screen\n"
-		   "    -v                        print the version number\n"
-		   "\n");
-}
+	char uconfig_file[256];
 
-void printversion(void)
-{
-	printf("wmbiff v%s\n", WMBIFF_VERSION);
+	/* hold on to the arguments we were started with; we
+	   will need them if we have to restart on sigusr1 */
+	restart_args =
+		(const char **) malloc((argc + 1) * sizeof(const char *));
+	memcpy(restart_args, argv, (argc) * sizeof(const char *));
+	restart_args[argc] = NULL;
+
+	parse_cmd(argc, argv, uconfig_file);
+
+	/* decide what the config file is */
+	if (uconfig_file[0] != '\0') {	/* user-specified config file */
+		DMA(DEBUG_INFO, "Using user-specified config file '%s'.\n",
+			uconfig_file);
+	} else {
+		const char *home = getenv("HOME");
+		if (home == NULL) {
+			DMA(DEBUG_ERROR,
+				"$HOME undefined. Use the -c option to specify a wmbiffrc\n");
+			exit(EXIT_FAILURE);
+		}
+		sprintf(uconfig_file, "%s/.wmbiffrc", home);
+	}
+
+	if (wmbiffrc_permissions_check(uconfig_file) == 0) {
+		DMA(DEBUG_ERROR,
+			"WARNING: In future versions of WMBiff, .wmbiffrc MUST be\n"
+			"owned by the user, and not readable or writable by others.\n\n");
+	}
+	init_biff(uconfig_file);
+	signal(SIGCHLD, sigchld_handler);
+	signal(SIGUSR1, restart_wmbiff);
+	signal(SIGPIPE, SIG_IGN);	/* write() may fail */
+
+	do_biff(argc, argv);
+	return 0;
 }
 
 /* vim:set ts=4: */
+/*
+ * Local Variables:
+ * tab-width: 4
+ * c-indent-level: 4
+ * c-basic-offset: 4
+ * End:
+ */
diff --git a/wmbiff/wmbiffrc.5 b/wmbiff/wmbiffrc.5
index a823074..633e6e7 100644
--- a/wmbiff/wmbiffrc.5
+++ b/wmbiff/wmbiffrc.5
@@ -1,12 +1,14 @@
 .\" Hey, Emacs!  This is an -*- nroff -*- source file.
-.\" $Id: wmbiffrc.5,v 1.10 2002/03/06 07:15:08 bluehal Exp $
+.\" $Id: wmbiffrc.5.in,v 1.17 2004/03/12 21:35:25 bluehal Exp $
+.\"
+.\" wmbiff/wmbiffrc.5.  Generated from wmbiffrc.5.in by configure.
 .\"
 .\" wmbiff.1 and wmbiffrc.5 are copyright 1999-2002 by 
 .\" Jordi Mallach <jordi at debian.org>
 .\"
 .\" This is free documentation, see the latest version of the GNU
 .\" General Public License for copying conditions. There is NO warranty.
-.TH WMBIFFRC 5 "January 27, 2002" "wmbiff"
+.TH WMBIFFRC 5 "November 11, 2002" "wmbiff"
 
 .SH NAME
 wmbiffrc \- configuration file for
@@ -14,21 +16,50 @@ wmbiffrc \- configuration file for
 
 .SH DESCRIPTION
 \fBWMbiff\fP is a mail notification tool for the WindowMaker and AfterStep
-window managers. It can handle up to 5 mailboxes, and you can define actions
+window managers. It can handle up to 5 mailboxes, more when run using other
+window managers. You can define actions
 on mouse clicks for the different mailboxes. This manpage explains the
 different options which can be specified in a user's wmbiffrc.
 
 .SH OPTIONS
 Each option takes the form
 .IR option[.mbox] " = " value .
-Comment must be preceeded by pound signs (#).
+Comments must be preceeded by pound signs (#).
 
 The supported configuration options are:
 
-.TP 4
+.TP 3
+\fBcertfile\fP
+File that holds TLS (SSL) certificates.  If specified,
+wmbiff will check certificates and exit on a failure, so
+your password is secure.  If not present, wmbiff will trust
+all certificates and may be vulnerable to a
+man-in-the-middle attack.  WMbiff's will not prompt if you
+want to accept new certificates.  Instead, wmbiff expects
+your mail client to keep certificates in a file.  For
+example, if mutt is your mailreader, you may add:
+
+.RS
+certfile=/home/<me>/.muttsslcerts
+.RE
+.TP
 \fBinterval\fP
 Global interval between mailbox checking. Value is the number of seconds, 5
 is the default.
+.TP 
+\fBaskpass\fP
+Program run to ask for IMAP passwords, if left empty in the configuration file.
+The default is /usr/bin/ssh-askpass.  Can be specified on a per-mailbox basis.
+.TP 
+\fBskinfile\fP
+XPM pixmap file to load for the background.  If not a full
+path, wmbiff will search /usr/local/share/wmbiff/skins, /usr/share/wmbiff,
+/usr/local/share/wmbiff, and the current directory for the
+pixmap file.
+.TP
+\fBglobalnotify\fP
+Command to be executed when new mail is recieved in any mailbox. Set
+notify.n to override this option for mailbox n.
 .TP
 \fBlabel.n\fP
 Specifies the displayed label for a mailbox. It can be up to five characters
@@ -42,28 +73,39 @@ are supported:
 .TP
 .I mbox
 This is a local mbox mailbox. After the prefix, you only need to put the
-path to the mailbox wmbiff needs to read.  This is also the default.
+path to the mailbox wmbiff needs to read.  
+Local mboxes may be specified using shell commands enclosed
+in back-ticks. (`s.)
+.\"This is also the default.
 .RS
 mbox:/path/to/mail/debian-devel
-.RS
-- or -
-.RE
-/path/to/mail/debian-devel
 .RE
+.\"  let's stop making this available.
+.\" .RS
+.\" - or -
+.\" .RE
+.\" /path/to/mail/debian-devel
+.\" .RS
 .TP
 .I maildir
-\fBMaildir mailboxes are now supported!\fP
-This works just like \fImbox\fP above.  After the prefix, you need to put
-the path to the maildir wmbiff will read.
+This works just like \fImbox\fP above.  
 .RS
-maildir:/path/to/mail/bugtraq/
+maildir:[:\fIflags\fP:]/path/to/mail/bugtraq/
+.TP
+\fIflags\fP can one or more of:
+.TP
+.I F
+Flush directory caches by creating (then deleting) a temporary file
+in each maildir prior to checking.  This hack speeds up checking 
+network-mounted maildirs in cases where directory caching can cause 
+unwanted delays (eg. SFS-mounted maildirs).
 .RE
 .TP
 .I pop3
-Using this type, wmbiff will fetch mail from a pop3 server, using the
+Using this type, WMBiff will check for mail on a pop3 server using the
 specified username, password, host and an optional port number (defaulting
-to 110). If your password contained special character, eg. '@' or ':',
-use another path format.  See Authentication below for a description of 
+to 110).  If your password contains a special character, eg. '@' or ':',
+use the second path format.  See Authentication below for a description of 
 the auth field. 
 .RS
 pop3:user:passwd at server[:port] [auth]
@@ -73,29 +115,47 @@ pop3:user passwd server[ port] [auth]
 .RE
 .TP
 .I imap
-These are IMAP4 boxes. As with pop3, wmbiff will read a imap4 mbox using
-the given values and will display info about the remote mail. This type
-accepts user, password, host and optional path to mailbox and port number.
-See Authentication below for a description of the auth field.
+These are IMAP4 boxes. As with pop3, WMBiff will report the
+status of an IMAP4 mbox using the given values. This type
+accepts user, optional password, host and optional path to
+mailbox and port number.  See Authentication below for a
+description of the auth field.  The password may be left
+empty: see askpass above for information on password
+prompting.  If your password includes a @, use the 
+space delimited form.  If it contains a space or #, use the
+askpass option instead.  The mailbox field may be quoted, 
+e.g., server/"Mail/Eggs and Spam".  Mailboxes in subfolders 
+may be described as /INBOX.subfolder by some servers and 
+/Mail/subfolder by others.
 .RS
 imap:user:passwd at server[/mailbox][:port] [auth]
 .RE
 .RS
+imap:user:@server[/mailbox][:port] [auth]
+.RE
+.RS
 imap:user passwd server[/mailbox][ port] [auth]
 .RE
+.RS
+imap:user:passwd at server[/"mail box"][:port] [auth]
+.RE
 .TP
 .I imaps
-These are IMAP4 boxes wrapped in a TLS (SSL) connection, only available if 
-wmbiff was compiled with TLS support.  Parameters are the same as those for 
-ordinary IMAP4 boxes.  Port defaults to 993. If 143 is specified, 
-wmbiff will attempt to connect unencrypted but negotiate TLS using
-IMAP's STARTTLS command.  TLS support uses gnutls, which is under development
-and may be insecure.  TLS support is only for encryption: since certificates
-are not yet checked, it is vulnerable to man-in-the-middle attack.
+These are IMAP4 boxes wrapped in a TLS (SSL)
+connection. This copy of WMBiff was not compiled with GNUTLS. Parameters are the same as
+those for ordinary IMAP4 boxes.  Port defaults to 993. If
+143 is specified, WMBiff will attempt to connect unencrypted
+but negotiate TLS using IMAP's STARTTLS command.  TLS
+support uses GNUTLS, which is under development and may be
+insecure.  See the imap format above
+for additional detail about specifying your password.
 .RS
 imaps:user:passwd at server[/mailbox][:port] [auth]
 .RE
 .RS
+imaps:user:@server[/mailbox][:port] [auth]
+.RE
+.RS
 imaps:user passwd server[/mailbox][ port] [auth]
 .RE
 .TP
@@ -115,14 +175,25 @@ The user's icq UIN is optional.
 gicu:[UIN]
 .RE
 .TP
+.I finger
+With this box type, wmbiff will finger an account to see if
+there is unread mail.  Both finger and perl must be in your
+path, and your server must run a finger daemon.
+.RS
+finger:user at host
+.RE
+.TP
 .I shell
-With this EXPERIMENTAL keyword, wmbiff will launch the
+With this keyword, wmbiff will launch the
 specified shell command and read its output (STDOUT)
-expecting an integer number to be displayed as a count
-of new messages.   The behavior of this experimental
-keyword is likely to change in future revisions.
+expecting an integer message count or a three-character
+string.  If "new" is in the first line, the string or number
+will be displayed in yellow. The behavior of this
+experimental keyword is likely to change in future
+revisions.
 .RS
 shell:::/path/to/command
+shell:::lpq | grep Queue | awk '{print $2}'
 .RE
 .RE
 .TP
@@ -131,7 +202,16 @@ Command to be executed on new mail arrival in the given mailbox. Accepts
 the special keyword "beep" to use the pc speaker.
 .TP
 \fBaction.n\fP
-Command to be executed on left mouse click on a mailbox label.
+Command to be executed on left mouse click on a mailbox label.  
+Accepts
+the special keyword "msglst" to pop up a window of recent message headers 
+from IMAP or POP3 mailboxes when the left mouse button is held.
+.TP
+\fBbuttontwo.n\fP
+Command to be executed on middle mouse click on a mailbox level.
+Accepts
+the special keyword "msglst" to pop up a window of 
+recent message headers from IMAP or POP3 mailboxes when the middle mouse button is held.
 .TP
 \fBinterval.n\fP
 Per mailbox check interval. Value is the amount of seconds between
@@ -145,6 +225,10 @@ in seconds.
 \fBfetchcmd.n\fP
 Command to be executed to fetch mail. If not specified, fetching through
 wmbiff is disabled completely.
+Accepts
+the special keyword "msglst" to pop up a window of recent message headers 
+from IMAP and POP3 mailboxes when the right mouse button is held down,
+though not when fetchinterval is nonzero.
 .TP
 \fBdebug.n\fP 
 Show debugging messages from this mailbox.  Currently
@@ -152,11 +236,30 @@ supported values are "all" and "none".  The \-debug option
 to wmbiff overrides this setting.  Since IMAP uses a single
 connection per server, per-mailbox debugging may not
 
+.SH SIZING
+
+WMBiff will automatically size its window to the number of
+configured mailboxes.  While WindowMaker's Dock and
+AfterStep's Wharf expect square, 64x64 applets, other window
+managers, such as Blackbox or Openbox do not have this
+limitation.  This uncharacteristic "dockapp" behavior is
+intended to help those users who don't have exactly five
+mailboxes to watch.
+
+To preserve the old-style five-mailbox window even when you
+have only two, add
+.IR path.4=<space><space>
+to configure a blank 5th mailbox.
+
+To use the new-style sizing, just configure as many
+mailboxes as you want.
+
 .SH AUTHENTICATION
 
 Authentication methods include "cram-md5", "apop" (for
 Pop3), and "plaintext".  "cram-md5" and "apop" are only
 available when wmbiff is compiled with libgcrypt.
+This copy of WMBiff was not compiled with gcrypt.
 Authentication methods are tried in the following order:
 cram-md5, apop, plaintext.
 
@@ -175,11 +278,16 @@ For problems authenticating to servers, try specifying the
 authentication method explicitly as described above:
 sometimes a failed attempt to authenticate can cause later
 failures.  Some servers claim to support cram-md5 but fail:
-telling wmbiff not totry can help.
+telling wmbiff not to try can help.
 
 For other problems, run wmbiff with the -debug option.  See
 wmbiff(1) for details.
 
+While editing .wmbiffrc, you may find it useful to restart
+wmbiff using either control-shift mouse button 1, or killall
+-USR1 wmbiff.
+
+
 .SH FILES
 .TP
 .I ~/.wmbiffrc
@@ -187,7 +295,7 @@ per-user wmbiff configuration file.
 
 .SH AUTHOR
 This manual page was written by Jordi Mallach <jordi at debian.org>,
-originally for the Debian GNU/Linux system (but may be used by others).
+originally for the Debian system (but may be used by others).
 
 .SH SEE ALSO
 .PD 0
diff --git a/wmbiff/wmbiffrc.5.in b/wmbiff/wmbiffrc.5.in
new file mode 100644
index 0000000..beba231
--- /dev/null
+++ b/wmbiff/wmbiffrc.5.in
@@ -0,0 +1,306 @@
+.\" Hey, Emacs!  This is an -*- nroff -*- source file.
+.\" $Id: wmbiffrc.5.in,v 1.17 2004/03/12 21:35:25 bluehal Exp $
+.\"
+.\" @configure_input@
+.\"
+.\" wmbiff.1 and wmbiffrc.5 are copyright 1999-2002 by 
+.\" Jordi Mallach <jordi at debian.org>
+.\"
+.\" This is free documentation, see the latest version of the GNU
+.\" General Public License for copying conditions. There is NO warranty.
+.TH WMBIFFRC 5 "November 11, 2002" "wmbiff"
+
+.SH NAME
+wmbiffrc \- configuration file for
+.BR wmbiff (1)
+
+.SH DESCRIPTION
+\fBWMbiff\fP is a mail notification tool for the WindowMaker and AfterStep
+window managers. It can handle up to 5 mailboxes, more when run using other
+window managers. You can define actions
+on mouse clicks for the different mailboxes. This manpage explains the
+different options which can be specified in a user's wmbiffrc.
+
+.SH OPTIONS
+Each option takes the form
+.IR option[.mbox] " = " value .
+Comments must be preceeded by pound signs (#).
+
+The supported configuration options are:
+
+.TP 3
+\fBcertfile\fP
+File that holds TLS (SSL) certificates.  If specified,
+wmbiff will check certificates and exit on a failure, so
+your password is secure.  If not present, wmbiff will trust
+all certificates and may be vulnerable to a
+man-in-the-middle attack.  WMbiff's will not prompt if you
+want to accept new certificates.  Instead, wmbiff expects
+your mail client to keep certificates in a file.  For
+example, if mutt is your mailreader, you may add:
+
+.RS
+certfile=/home/<me>/.muttsslcerts
+.RE
+.TP
+\fBinterval\fP
+Global interval between mailbox checking. Value is the number of seconds, 5
+is the default.
+.TP 
+\fBaskpass\fP
+Program run to ask for IMAP passwords, if left empty in the configuration file.
+The default is @DEFAULT_ASKPASS at .  Can be specified on a per-mailbox basis.
+.TP 
+\fBskinfile\fP
+XPM pixmap file to load for the background.  If not a full
+path, wmbiff will search @SKINDIR@, /usr/share/wmbiff,
+/usr/local/share/wmbiff, and the current directory for the
+pixmap file.
+.TP
+\fBglobalnotify\fP
+Command to be executed when new mail is recieved in any mailbox. Set
+notify.n to override this option for mailbox n.
+.TP
+\fBlabel.n\fP
+Specifies the displayed label for a mailbox. It can be up to five characters
+long.
+.TP
+\fBpath.n\fP
+Path to the mailbox, local or remote one. Path lines start with a prefix,
+which specifies the type of wmbiff box you're setting up. The following types
+are supported:
+.RS
+.TP
+.I mbox
+This is a local mbox mailbox. After the prefix, you only need to put the
+path to the mailbox wmbiff needs to read.  
+Local mboxes may be specified using shell commands enclosed
+in back-ticks. (`s.)
+.\"This is also the default.
+.RS
+mbox:/path/to/mail/debian-devel
+.RE
+.\"  let's stop making this available.
+.\" .RS
+.\" - or -
+.\" .RE
+.\" /path/to/mail/debian-devel
+.\" .RS
+.TP
+.I maildir
+This works just like \fImbox\fP above.  
+.RS
+maildir:[:\fIflags\fP:]/path/to/mail/bugtraq/
+.TP
+\fIflags\fP can one or more of:
+.TP
+.I F
+Flush directory caches by creating (then deleting) a temporary file
+in each maildir prior to checking.  This hack speeds up checking 
+network-mounted maildirs in cases where directory caching can cause 
+unwanted delays (eg. SFS-mounted maildirs).
+.RE
+.TP
+.I pop3
+Using this type, WMBiff will check for mail on a pop3 server using the
+specified username, password, host and an optional port number (defaulting
+to 110).  If your password contains a special character, eg. '@' or ':',
+use the second path format.  See Authentication below for a description of 
+the auth field. 
+.RS
+pop3:user:passwd at server[:port] [auth]
+.RE
+.RS
+pop3:user passwd server[ port] [auth] 
+.RE
+.TP
+.I imap
+These are IMAP4 boxes. As with pop3, WMBiff will report the
+status of an IMAP4 mbox using the given values. This type
+accepts user, optional password, host and optional path to
+mailbox and port number.  See Authentication below for a
+description of the auth field.  The password may be left
+empty: see askpass above for information on password
+prompting.  If your password includes a @, use the 
+space delimited form.  If it contains a space or #, use the
+askpass option instead.  The mailbox field may be quoted, 
+e.g., server/"Mail/Eggs and Spam".  Mailboxes in subfolders 
+may be described as /INBOX.subfolder by some servers and 
+/Mail/subfolder by others.
+.RS
+imap:user:passwd at server[/mailbox][:port] [auth]
+.RE
+.RS
+imap:user:@server[/mailbox][:port] [auth]
+.RE
+.RS
+imap:user passwd server[/mailbox][ port] [auth]
+.RE
+.RS
+imap:user:passwd at server[/"mail box"][:port] [auth]
+.RE
+.TP
+.I imaps
+These are IMAP4 boxes wrapped in a TLS (SSL)
+connection. @GNUTLS_MAN_STATUS@ Parameters are the same as
+those for ordinary IMAP4 boxes.  Port defaults to 993. If
+143 is specified, WMBiff will attempt to connect unencrypted
+but negotiate TLS using IMAP's STARTTLS command.  TLS
+support uses GNUTLS, which is under development and may be
+insecure.  See the imap format above
+for additional detail about specifying your password.
+.RS
+imaps:user:passwd at server[/mailbox][:port] [auth]
+.RE
+.RS
+imaps:user:@server[/mailbox][:port] [auth]
+.RE
+.RS
+imaps:user passwd server[/mailbox][ port] [auth]
+.RE
+.TP
+.I licq
+With this box type, wmbiff will read the given history file and track the
+number of messages in it. It just needs a path to a given licq history file.
+.RS
+licq:/path/to/.licq/history/file.history
+.RE
+.TP
+.I gicu
+With this box type, wmbiff will ask gnomeicu for the number
+of pending messages.  If gnomeicu is not running, nothing
+will be displayed.  gnomeicu-client must be in your path.
+The user's icq UIN is optional.
+.RS
+gicu:[UIN]
+.RE
+.TP
+.I finger
+With this box type, wmbiff will finger an account to see if
+there is unread mail.  Both finger and perl must be in your
+path, and your server must run a finger daemon.
+.RS
+finger:user at host
+.RE
+.TP
+.I shell
+With this keyword, wmbiff will launch the
+specified shell command and read its output (STDOUT)
+expecting an integer message count or a three-character
+string.  If "new" is in the first line, the string or number
+will be displayed in yellow. The behavior of this
+experimental keyword is likely to change in future
+revisions.
+.RS
+shell:::/path/to/command
+shell:::lpq | grep Queue | awk '{print $2}'
+.RE
+.RE
+.TP
+\fBnotify.n\fP
+Command to be executed on new mail arrival in the given mailbox. Accepts
+the special keyword "beep" to use the pc speaker.
+.TP
+\fBaction.n\fP
+Command to be executed on left mouse click on a mailbox label.  
+Accepts
+the special keyword "msglst" to pop up a window of recent message headers 
+from IMAP or POP3 mailboxes when the left mouse button is held.
+.TP
+\fBbuttontwo.n\fP
+Command to be executed on middle mouse click on a mailbox level.
+Accepts
+the special keyword "msglst" to pop up a window of 
+recent message headers from IMAP or POP3 mailboxes when the middle mouse button is held.
+.TP
+\fBinterval.n\fP
+Per mailbox check interval. Value is the amount of seconds between
+checkings, default is the global interval.
+.TP
+\fBfetchinterval.n\fP
+Interval between mail auto-fetching. Values accept 0 to disable, -1 for
+autofetching on new mail arrival, and positive values for a given interval
+in seconds.
+.TP
+\fBfetchcmd.n\fP
+Command to be executed to fetch mail. If not specified, fetching through
+wmbiff is disabled completely.
+Accepts
+the special keyword "msglst" to pop up a window of recent message headers 
+from IMAP and POP3 mailboxes when the right mouse button is held down,
+though not when fetchinterval is nonzero.
+.TP
+\fBdebug.n\fP 
+Show debugging messages from this mailbox.  Currently
+supported values are "all" and "none".  The \-debug option
+to wmbiff overrides this setting.  Since IMAP uses a single
+connection per server, per-mailbox debugging may not
+
+.SH SIZING
+
+WMBiff will automatically size its window to the number of
+configured mailboxes.  While WindowMaker's Dock and
+AfterStep's Wharf expect square, 64x64 applets, other window
+managers, such as Blackbox or Openbox do not have this
+limitation.  This uncharacteristic "dockapp" behavior is
+intended to help those users who don't have exactly five
+mailboxes to watch.
+
+To preserve the old-style five-mailbox window even when you
+have only two, add
+.IR path.4=<space><space>
+to configure a blank 5th mailbox.
+
+To use the new-style sizing, just configure as many
+mailboxes as you want.
+
+.SH AUTHENTICATION
+
+Authentication methods include "cram-md5", "apop" (for
+Pop3), and "plaintext".  "cram-md5" and "apop" are only
+available when wmbiff is compiled with libgcrypt.
+ at GCRYPT_MAN_STATUS@
+Authentication methods are tried in the following order:
+cram-md5, apop, plaintext.
+
+Each authentication method will be tried unless a list is
+included in the [auth] field.  For example, append "cram-md5
+apop" if you don't want your password to be sent in
+cleartext over the network.  Conversely, append "plaintext"
+if you don't want wmbiff to bother with other authentication
+methods.  Leaving authentication methods unspecified should
+be reasonably safe.  The order of entries in the [auth] list
+is not currently considered.
+
+.SH TROUBLESHOOTING
+
+For problems authenticating to servers, try specifying the
+authentication method explicitly as described above:
+sometimes a failed attempt to authenticate can cause later
+failures.  Some servers claim to support cram-md5 but fail:
+telling wmbiff not to try can help.
+
+For other problems, run wmbiff with the -debug option.  See
+wmbiff(1) for details.
+
+While editing .wmbiffrc, you may find it useful to restart
+wmbiff using either control-shift mouse button 1, or killall
+-USR1 wmbiff.
+
+
+.SH FILES
+.TP
+.I ~/.wmbiffrc
+per-user wmbiff configuration file.
+
+.SH AUTHOR
+This manual page was written by Jordi Mallach <jordi at debian.org>,
+originally for the Debian system (but may be used by others).
+
+.SH SEE ALSO
+.PD 0
+.TP
+\fBwmbiff\fP(1)
+.PP
+\fI/usr/share/doc/wmbiff/examples/sample.wmbiffrc\fP
+(or equivalent on your system)
diff --git a/wmgeneral/Makefile.am b/wmgeneral/Makefile.am
new file mode 100644
index 0000000..3e15428
--- /dev/null
+++ b/wmgeneral/Makefile.am
@@ -0,0 +1,10 @@
+noinst_LIBRARIES = libwmgeneral.a
+libwmgeneral_a_SOURCES = list.c list.h misc.c misc.h wmgeneral.c wmgeneral.h
+
+MAINTAINERCLEANFILES = Makefile.in 
+
+
+indent:
+	indent -npro -kr -i4 -ts4 $(libwmgeneral_a_SOURCES) || true
+
+dist-hook-local: indent
diff --git a/wmgeneral/Makefile.in b/wmgeneral/Makefile.in
new file mode 100644
index 0000000..ead0c97
--- /dev/null
+++ b/wmgeneral/Makefile.in
@@ -0,0 +1,385 @@
+# Makefile.in generated by automake 1.7.9 from Makefile.am.
+# @configure_input@
+
+# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+# Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CVS2CL = @CVS2CL@
+CYGPATH_W = @CYGPATH_W@
+DEFAULT_ASKPASS = @DEFAULT_ASKPASS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+GCRYPT_MAN_STATUS = @GCRYPT_MAN_STATUS@
+GNUTLS_COMMON_O = @GNUTLS_COMMON_O@
+GNUTLS_MAN_STATUS = @GNUTLS_MAN_STATUS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@
+LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@
+LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@
+LIBGNUTLS_CFLAGS = @LIBGNUTLS_CFLAGS@
+LIBGNUTLS_CONFIG = @LIBGNUTLS_CONFIG@
+LIBGNUTLS_LIBS = @LIBGNUTLS_LIBS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SKINDIR = @SKINDIR@
+STRIP = @STRIP@
+VERSION = @VERSION@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+bindir = @bindir@
+build_alias = @build_alias@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host_alias = @host_alias@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+noinst_LIBRARIES = libwmgeneral.a
+libwmgeneral_a_SOURCES = list.c list.h misc.c misc.h wmgeneral.c wmgeneral.h
+
+MAINTAINERCLEANFILES = Makefile.in 
+subdir = wmgeneral
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+mkinstalldirs = $(SHELL) $(top_srcdir)/autoconf/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+LIBRARIES = $(noinst_LIBRARIES)
+
+libwmgeneral_a_AR = $(AR) cru
+libwmgeneral_a_LIBADD =
+am_libwmgeneral_a_OBJECTS = list.$(OBJEXT) misc.$(OBJEXT) \
+	wmgeneral.$(OBJEXT)
+libwmgeneral_a_OBJECTS = $(am_libwmgeneral_a_OBJECTS)
+
+DEFAULT_INCLUDES =  -I. -I$(srcdir) -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/autoconf/depcomp
+am__depfiles_maybe = depfiles
+ at AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/list.Po ./$(DEPDIR)/misc.Po \
+ at AMDEP_TRUE@	./$(DEPDIR)/wmgeneral.Po
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+DIST_SOURCES = $(libwmgeneral_a_SOURCES)
+DIST_COMMON = $(srcdir)/Makefile.in Makefile.am
+SOURCES = $(libwmgeneral_a_SOURCES)
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .o .obj
+$(srcdir)/Makefile.in:  Makefile.am  $(top_srcdir)/configure.ac $(ACLOCAL_M4)
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu  wmgeneral/Makefile
+Makefile:  $(srcdir)/Makefile.in  $(top_builddir)/config.status
+	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
+
+AR = ar
+
+clean-noinstLIBRARIES:
+	-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
+libwmgeneral.a: $(libwmgeneral_a_OBJECTS) $(libwmgeneral_a_DEPENDENCIES) 
+	-rm -f libwmgeneral.a
+	$(libwmgeneral_a_AR) libwmgeneral.a $(libwmgeneral_a_OBJECTS) $(libwmgeneral_a_LIBADD)
+	$(RANLIB) libwmgeneral.a
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT) core *.core
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/list.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/misc.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/wmgeneral.Po at am__quote@
+
+.c.o:
+ at am__fastdepCC_TRUE@	if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
+ at am__fastdepCC_TRUE@	  -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
+ at am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
+ at am__fastdepCC_TRUE@	else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
+ at am__fastdepCC_TRUE@	fi
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$<
+
+.c.obj:
+ at am__fastdepCC_TRUE@	if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
+ at am__fastdepCC_TRUE@	  -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \
+ at am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
+ at am__fastdepCC_TRUE@	else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
+ at am__fastdepCC_TRUE@	fi
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`
+uninstall-info-am:
+
+ETAGS = etags
+ETAGSFLAGS =
+
+CTAGS = ctags
+CTAGSFLAGS =
+
+tags: TAGS
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(ETAGS_ARGS)$$tags$$unique" \
+	  || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	     $$tags $$unique
+
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+
+top_distdir = ..
+distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	    $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkinstalldirs) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LIBRARIES)
+
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+	-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+clean: clean-am
+
+clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-noinstLIBRARIES ctags distclean distclean-compile \
+	distclean-generic distclean-tags distdir dvi dvi-am info \
+	info-am install install-am install-data install-data-am \
+	install-exec install-exec-am install-info install-info-am \
+	install-man install-strip installcheck installcheck-am \
+	installdirs maintainer-clean maintainer-clean-generic \
+	mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \
+	ps ps-am tags uninstall uninstall-am uninstall-info-am
+
+
+indent:
+	indent -npro -kr -i4 -ts4 $(libwmgeneral_a_SOURCES) || true
+
+dist-hook-local: indent
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/wmgeneral/list.c b/wmgeneral/list.c
index f804b2c..2366b0d 100644
--- a/wmgeneral/list.c
+++ b/wmgeneral/list.c
@@ -38,64 +38,57 @@ Boston, MA 02111-1307, USA.  */
 
 /* Return a cons cell produced from (head . tail) */
 
-INLINE LinkedList* 
-list_cons(void* head, LinkedList* tail)
+INLINE LinkedList *list_cons(void *head, LinkedList * tail)
 {
-  LinkedList* cell;
+	LinkedList *cell;
 
-  cell = (LinkedList*)malloc(sizeof(LinkedList));
-  cell->head = head;
-  cell->tail = tail;
-  return cell;
+	cell = (LinkedList *) malloc(sizeof(LinkedList));
+	cell->head = head;
+	cell->tail = tail;
+	return cell;
 }
 
 /* Return the length of a list, list_length(NULL) returns zero */
 
-INLINE int
-list_length(LinkedList* list)
+INLINE int list_length(LinkedList * list)
 {
-  int i = 0;
-  while(list)
-    {
-      i += 1;
-      list = list->tail;
-    }
-  return i;
+	int i = 0;
+	while (list) {
+		i += 1;
+		list = list->tail;
+	}
+	return i;
 }
 
 /* Return the Nth element of LIST, where N count from zero.  If N 
    larger than the list length, NULL is returned  */
 
-INLINE void*
-list_nth(int index, LinkedList* list)
+INLINE void *list_nth(int idx, LinkedList * list)
 {
-  while(index-- != 0)
-    {
-      if(list->tail)
-	list = list->tail;
-      else
-	return 0;
-    }
-  return list->head;
+	while (idx-- != 0) {
+		if (list->tail)
+			list = list->tail;
+		else
+			return 0;
+	}
+	return list->head;
 }
 
 /* Remove the element at the head by replacing it by its successor */
 
-INLINE void
-list_remove_head(LinkedList** list)
+INLINE void list_remove_head(LinkedList ** list)
 {
-  if (!*list) return;  
-  if ((*list)->tail)
-    {
-      LinkedList* tail = (*list)->tail; /* fetch next */
-      *(*list) = *tail;		/* copy next to list head */
-      free(tail);			/* free next */
-    }
-  else				/* only one element in list */
-    {
-      free(*list);
-      (*list) = 0;
-    }
+	if (!*list)
+		return;
+	if ((*list)->tail) {
+		LinkedList *tail = (*list)->tail;	/* fetch next */
+		*(*list) = *tail;		/* copy next to list head */
+		free(tail);				/* free next */
+	} else {					/* only one element in list */
+
+		free(*list);
+		(*list) = 0;
+	}
 }
 
 
@@ -112,58 +105,51 @@ list_remove_elem(LinkedList** list, void* elem)
     }
 }*/
 
-INLINE LinkedList *
-list_remove_elem(LinkedList* list, void* elem)
+INLINE LinkedList *list_remove_elem(LinkedList * list, void *elem)
 {
-    LinkedList *tmp;
-    
-    if (list) {
-	if (list->head == elem) {
-	    tmp = list->tail;
-	    free(list);
-	    return tmp;
+	LinkedList *tmp;
+
+	if (list) {
+		if (list->head == elem) {
+			tmp = list->tail;
+			free(list);
+			return tmp;
+		}
+		list->tail = list_remove_elem(list->tail, elem);
+		return list;
 	}
-	list->tail = list_remove_elem(list->tail, elem);
-	return list;
-    }
-    return NULL;
+	return NULL;
 }
 
 
 /* Return element that has ELEM as car */
 
-INLINE LinkedList*
-list_find(LinkedList* list, void* elem)
+INLINE LinkedList *list_find(LinkedList * list, void *elem)
 {
-  while(list)
-    {
-    if (list->head == elem)
-      return list;
-    list = list->tail;
-    }
-  return NULL;
+	while (list) {
+		if (list->head == elem)
+			return list;
+		list = list->tail;
+	}
+	return NULL;
 }
 
 /* Free list (backwards recursive) */
 
-INLINE void
-list_free(LinkedList* list)
+INLINE void list_free(LinkedList * list)
 {
-  if(list)
-    {
-      list_free(list->tail);
-      free(list);
-    }
+	if (list) {
+		list_free(list->tail);
+		free(list);
+	}
 }
 
 /* Map FUNCTION over all elements in LIST */
 
-INLINE void
-list_mapcar(LinkedList* list, void(*function)(void*))
+INLINE void list_mapcar(LinkedList * list, void (*function) (void *))
 {
-  while(list)
-    {
-      (*function)(list->head);
-      list = list->tail;
-    }
+	while (list) {
+		(*function) (list->head);
+		list = list->tail;
+	}
 }
diff --git a/wmgeneral/list.h b/wmgeneral/list.h
index 5ea8ee2..b32e65d 100644
--- a/wmgeneral/list.h
+++ b/wmgeneral/list.h
@@ -36,24 +36,24 @@ Boston, MA 02111-1307, USA.  */
 #endif
 
 typedef struct LinkedList {
-  void *head;
-  struct LinkedList *tail;
+	void *head;
+	struct LinkedList *tail;
 } LinkedList;
 
-INLINE LinkedList* list_cons(void* head, LinkedList* tail);
+INLINE LinkedList *list_cons(void *head, LinkedList * tail);
 
-INLINE int list_length(LinkedList* list);
+INLINE int list_length(LinkedList * list);
 
-INLINE void* list_nth(int n, LinkedList* list);
+INLINE void *list_nth(int n, LinkedList * list);
 
-INLINE void list_remove_head(LinkedList** list);
+INLINE void list_remove_head(LinkedList ** list);
 
-INLINE LinkedList *list_remove_elem(LinkedList* list, void* elem);
+INLINE LinkedList *list_remove_elem(LinkedList * list, void *elem);
 
-INLINE void list_mapcar(LinkedList* list, void(*function)(void*));
+INLINE void list_mapcar(LinkedList * list, void (*function) (void *));
 
-INLINE LinkedList*list_find(LinkedList* list, void* elem);
+INLINE LinkedList *list_find(LinkedList * list, void *elem);
 
-INLINE void list_free(LinkedList* list);
+INLINE void list_free(LinkedList * list);
 
 #endif
diff --git a/wmgeneral/misc.c b/wmgeneral/misc.c
index 489c350..bf03449 100644
--- a/wmgeneral/misc.c
+++ b/wmgeneral/misc.c
@@ -24,14 +24,12 @@
 #include "list.h"
 #include "misc.h"
 
-extern pid_t
-execCommand(char *command)
+extern pid_t execCommand(const char *command)
 {
-    pid_t pid;
+	pid_t pid;
 
-    if ((pid=fork())==0)
-    {
-        execl("/bin/sh", "sh", "-c", command, (char *)0);
-    }
-    return pid;
+	if ((pid = fork()) == 0) {
+		execl("/bin/sh", "sh", "-c", command, (char *) 0);
+	}
+	return pid;
 }
diff --git a/wmgeneral/misc.h b/wmgeneral/misc.h
index 602e1b7..2546bcb 100644
--- a/wmgeneral/misc.h
+++ b/wmgeneral/misc.h
@@ -5,5 +5,5 @@
 
 extern void parse_command(char *, char ***, int *);
 
-extern pid_t execCommand(char *);
-#endif /* __MISC_H */
+extern pid_t execCommand(const char *);
+#endif							/* __MISC_H */
diff --git a/wmgeneral/wmgeneral.c b/wmgeneral/wmgeneral.c
index acda07e..37720dd 100644
--- a/wmgeneral/wmgeneral.c
+++ b/wmgeneral/wmgeneral.c
@@ -38,15 +38,25 @@
 
 */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
 #include <unistd.h>
 #include <ctype.h>
 #include <stdarg.h>
+#include <assert.h>
 
 #include <X11/Xlib.h>
+#ifdef HAVE_X11_XPM_H
 #include <X11/xpm.h>
+#endif
+#ifdef HAVE_XPM_H
+#include <xpm.h>
+#endif
+#include <X11/Xutil.h>			/* needed for Region on solaris? */
 #include <X11/extensions/shape.h>
 
 #include "wmgeneral.h"
@@ -55,54 +65,55 @@
  /* X11 Variables */
 /*****************/
 
-Window		Root;
-int			screen;
-int			x_fd;
-int			d_depth;
-XSizeHints	mysizehints;
-XWMHints	mywmhints;
-Pixel		back_pix, fore_pix;
-const char		*Geometry = "";
-Window		iconwin, win;
-GC			NormalGC;
-XpmIcon		wmgen;
-Pixmap		pixmask;
+Window Root;
+int screen;
+int x_fd;
+int d_depth;
+XSizeHints mysizehints;
+XWMHints mywmhints;
+Pixel back_pix, fore_pix;
+// static const char *Geometry = "";
+Window iconwin, win;
+GC NormalGC;
+XpmIcon wmgen_bkg;
+XpmIcon wmgen_src;
+Pixmap pixmask;
 
   /*****************/
  /* Mouse Regions */
 /*****************/
 
 typedef struct {
-	int		enable;
-	int		top;
-	int		bottom;
-	int		left;
-	int		right;
+	int enable;
+	int top;
+	int bottom;
+	int left;
+	int right;
 } MOUSE_REGION;
 
-MOUSE_REGION	mouse_region[MAX_MOUSE_REGION];
+MOUSE_REGION mouse_region[MAX_MOUSE_REGION];
 
   /***********************/
  /* Function Prototypes */
 /***********************/
 
 static void GetXPM(XpmIcon *, const char **);
-static Pixel GetColor(const char *);
+Pixel GetColor(const char *);
 void RedrawWindow(void);
-void AddMouseRegion(int, int, int, int, int);
 int CheckMouseRegion(int, int);
 
 /*******************************************************************************\
 |* parse_rcfile																   *|
 \*******************************************************************************/
 
-void parse_rcfile(const char *filename, rckeys *keys) {
+void parse_rcfile(const char *filename, rckeys * keys)
+{
 
-	char	*p,*q;
-	char	temp[128];
-	const char	*tokens = " :\t\n";
-	FILE	*fp;
-	int		i,key;
+	char *p, *q;
+	char temp[128];
+	const char *tokens = " :\t\n";
+	FILE *fp;
+	int i, key;
 
 	fp = fopen(filename, "r");
 	if (fp) {
@@ -115,11 +126,13 @@ void parse_rcfile(const char *filename, rckeys *keys) {
 					p = strstr(temp, keys[key].label);
 					p += strlen(keys[key].label);
 					p += strspn(p, tokens);
-					if ((i = strcspn(p, "#\n"))) p[i] = 0;
+					if ((i = strcspn(p, "#\n")))
+						p[i] = 0;
 					free(*keys[key].var);
 					*keys[key].var = strdup(p);
 					key = -1;
-				} else key++;
+				} else
+					key++;
 			}
 			free(q);
 		}
@@ -131,14 +144,15 @@ void parse_rcfile(const char *filename, rckeys *keys) {
 |* parse_rcfile2															   *|
 \*******************************************************************************/
 
-void parse_rcfile2(const char *filename, rckeys2 *keys) {
+void parse_rcfile2(const char *filename, rckeys2 * keys)
+{
 
-	char	*p;
-	char	temp[128];
-	const char	*tokens = " :\t\n";
-	FILE	*fp;
-	int		i,key;
-	char	*family = NULL;
+	char *p;
+	char temp[128];
+	const char *tokens = " :\t\n";
+	FILE *fp;
+	int i, key;
+	char *family = NULL;
 
 	fp = fopen(filename, "r");
 	if (fp) {
@@ -148,11 +162,13 @@ void parse_rcfile2(const char *filename, rckeys2 *keys) {
 				if ((p = strstr(temp, keys[key].label))) {
 					p += strlen(keys[key].label);
 					p += strspn(p, tokens);
-					if ((i = strcspn(p, "#\n"))) p[i] = 0;
+					if ((i = strcspn(p, "#\n")))
+						p[i] = 0;
 					free(*keys[key].var);
 					*keys[key].var = strdup(p);
 					key = -1;
-				} else key++;
+				} else
+					key++;
 			}
 		}
 		fclose(fp);
@@ -165,23 +181,29 @@ void parse_rcfile2(const char *filename, rckeys2 *keys) {
 |* GetXPM																	   *|
 \*******************************************************************************/
 
-static void GetXPM(XpmIcon *wmgen_local, const char *pixmap_bytes[]) {
+static void GetXPM(XpmIcon * wmgen_local, const char *pixmap_bytes[])
+{
 
-	XWindowAttributes	attributes;
-	int					err;
+	XWindowAttributes attributes;
+	int err;
 
 	/* For the colormap */
 	XGetWindowAttributes(display, Root, &attributes);
+	/* despite the comment, I still don't understand... 
+	   attributes is subsequently unused in this function -ns 11/2002 */
 
-	wmgen_local->attributes.valuemask |= (XpmReturnPixels | XpmReturnExtensions);
+	wmgen_local->attributes.valuemask |=
+		(XpmReturnPixels | XpmReturnExtensions);
+
+	err = XpmCreatePixmapFromData(display, Root, (char **) pixmap_bytes,
+								  &(wmgen_local->pixmap),
+								  &(wmgen_local->mask),
+								  &(wmgen_local->attributes));
 
-	err = XpmCreatePixmapFromData(display, Root, (char **)pixmap_bytes, 
-                                  &(wmgen_local->pixmap),
-                                  &(wmgen_local->mask), 
-                                  &(wmgen_local->attributes));
-	
 	if (err != XpmSuccess) {
-		fprintf(stderr, "Not enough free colorcells.\n");
+		fprintf(stderr,
+				"Not enough free colorcells to create pixmap from data (err=%d).\n",
+				err);
 		exit(1);
 	}
 }
@@ -190,18 +212,19 @@ static void GetXPM(XpmIcon *wmgen_local, const char *pixmap_bytes[]) {
 |* GetColor																	   *|
 \*******************************************************************************/
 
-static Pixel GetColor(const char *name) {
+Pixel GetColor(const char *name)
+{
 
-	XColor				color;
-	XWindowAttributes	attributes;
+	XColor color;
+	XWindowAttributes attributes;
 
 	XGetWindowAttributes(display, Root, &attributes);
 
 	color.pixel = 0;
 	if (!XParseColor(display, attributes.colormap, name, &color)) {
-		fprintf(stderr, "wm.app: can't parse %s.\n", name);
+		fprintf(stderr, "wm.app: GetColor() can't parse %s.\n", name);
 	} else if (!XAllocColor(display, attributes.colormap, &color)) {
-		fprintf(stderr, "wm.app: can't allocate %s.\n", name);
+		fprintf(stderr, "wm.app: GetColor() can't allocate %s.\n", name);
 	}
 	return color.pixel;
 }
@@ -210,10 +233,11 @@ static Pixel GetColor(const char *name) {
 |* flush_expose																   *|
 \*******************************************************************************/
 
-static int flush_expose(Window w) {
+static int flush_expose(Window w)
+{
 
-	XEvent 		dummy;
-	int			i=0;
+	XEvent dummy;
+	int i = 0;
 
 	while (XCheckTypedWindowEvent(display, w, Expose, &dummy))
 		i++;
@@ -225,35 +249,43 @@ static int flush_expose(Window w) {
 |* RedrawWindow																   *|
 \*******************************************************************************/
 
-void RedrawWindow(void) {
-	
+void RedrawWindow(void)
+{
+
 	flush_expose(iconwin);
-	XCopyArea(display, wmgen.pixmap, iconwin, NormalGC, 
-				0,0, wmgen.attributes.width, wmgen.attributes.height, 0,0);
+	XCopyArea(display, wmgen_bkg.pixmap, iconwin, NormalGC,
+			  0, 0, wmgen_bkg.attributes.width,
+			  wmgen_bkg.attributes.height, 0, 0);
 	flush_expose(win);
-	XCopyArea(display, wmgen.pixmap, win, NormalGC,
-				0,0, wmgen.attributes.width, wmgen.attributes.height, 0,0);
+	XCopyArea(display, wmgen_bkg.pixmap, win, NormalGC,
+			  0, 0, wmgen_bkg.attributes.width,
+			  wmgen_bkg.attributes.height, 0, 0);
 }
 
 /*******************************************************************************\
 |* RedrawWindowXY															   *|
 \*******************************************************************************/
 
-void RedrawWindowXY(int x, int y) {
-	
+void RedrawWindowXY(int x, int y)
+{
+
 	flush_expose(iconwin);
-	XCopyArea(display, wmgen.pixmap, iconwin, NormalGC, 
-				x,y, wmgen.attributes.width, wmgen.attributes.height, 0,0);
+	XCopyArea(display, wmgen_bkg.pixmap, iconwin, NormalGC,
+			  x, y, wmgen_bkg.attributes.width,
+			  wmgen_bkg.attributes.height, 0, 0);
 	flush_expose(win);
-	XCopyArea(display, wmgen.pixmap, win, NormalGC,
-				x,y, wmgen.attributes.width, wmgen.attributes.height, 0,0);
+	XCopyArea(display, wmgen_bkg.pixmap, win, NormalGC,
+			  x, y, wmgen_bkg.attributes.width,
+			  wmgen_bkg.attributes.height, 0, 0);
 }
 
 /*******************************************************************************\
 |* AddMouseRegion															   *|
 \*******************************************************************************/
 
-void AddMouseRegion(int region_idx, int left, int top, int right, int bottom) {
+void AddMouseRegion(unsigned int region_idx, int left, int top, int right,
+					int bottom)
+{
 
 	if (region_idx < MAX_MOUSE_REGION) {
 		mouse_region[region_idx].enable = 1;
@@ -268,60 +300,60 @@ void AddMouseRegion(int region_idx, int left, int top, int right, int bottom) {
 |* CheckMouseRegion															   *|
 \*******************************************************************************/
 
-int CheckMouseRegion(int x, int y) {
+int CheckMouseRegion(int x, int y)
+{
 
-	int		i;
-	int		found;
+	int i;
+	int found;
 
 	found = 0;
 
-	for (i=0; i<MAX_MOUSE_REGION && !found; i++) {
+	for (i = 0; i < MAX_MOUSE_REGION && !found; i++) {
 		if (mouse_region[i].enable &&
 			x <= mouse_region[i].right &&
 			x >= mouse_region[i].left &&
-			y <= mouse_region[i].bottom &&
-			y >= mouse_region[i].top)
+			y <= mouse_region[i].bottom && y >= mouse_region[i].top)
 			found = 1;
 	}
-	if (!found) return -1;
-	return (i-1);
+	if (!found)
+		return -1;
+	return (i - 1);
 }
 
 /*******************************************************************************\
 |* createXBMfromXPM															   *|
 \*******************************************************************************/
-void createXBMfromXPM(char *xbm, const char **xpm, int sx, int sy) {
-
-	int		i,j,k;
-	int		width, height, numcol, depth;
-    int 	zero=0;
-	unsigned char	bwrite;
-    int		bcount;
-    int     curpixel;
-	
+void createXBMfromXPM(char *xbm, const char **xpm, int sx, int sy)
+{
+
+	int i, j, k;
+	int width, height, numcol, depth;
+	int zero = 0;
+	unsigned char bwrite;
+	int bcount;
+	int curpixel;
+
 	sscanf(*xpm, "%d %d %d %d", &width, &height, &numcol, &depth);
 
 
-    for (k=0; k!=depth; k++)
-    {
-        zero <<=8;
-        zero |= xpm[1][k];
-    }
-        
-	for (i=numcol+1; i < numcol+sy+1; i++) {
+	for (k = 0; k != depth; k++) {
+		zero <<= 8;
+		zero |= xpm[1][k];
+	}
+
+	for (i = numcol + 1; i < numcol + sy + 1; i++) {
 		bcount = 0;
 		bwrite = 0;
-		for (j=0; j<sx*depth; j+=depth) {
-            bwrite >>= 1;
-
-            curpixel=0;
-            for (k=0; k!=depth; k++)
-            {
-                curpixel <<=8;
-                curpixel |= xpm[i][j+k];
-            }
-                
-            if ( curpixel != zero ) {
+		for (j = 0; j < sx * depth; j += depth) {
+			bwrite >>= 1;
+
+			curpixel = 0;
+			for (k = 0; k != depth; k++) {
+				curpixel <<= 8;
+				curpixel |= xpm[i][j + k];
+			}
+
+			if (curpixel != zero) {
 				bwrite += 128;
 			}
 			bcount++;
@@ -339,9 +371,12 @@ void createXBMfromXPM(char *xbm, const char **xpm, int sx, int sy) {
 |* copyXPMArea																   *|
 \*******************************************************************************/
 
-void copyXPMArea(int x, int y, int sx, int sy, int dx, int dy) {
+void copyXPMArea(int src_x, int src_y, int width, int height, int dest_x,
+				 int dest_y)
+{
 
-	XCopyArea(display, wmgen.pixmap, wmgen.pixmap, NormalGC, x, y, sx, sy, dx, dy);
+	XCopyArea(display, wmgen_src.pixmap, wmgen_bkg.pixmap, NormalGC, src_x,
+			  src_y, width, height, dest_x, dest_y);
 
 }
 
@@ -349,84 +384,141 @@ void copyXPMArea(int x, int y, int sx, int sy, int dx, int dy) {
 |* copyXBMArea																   *|
 \*******************************************************************************/
 
-void copyXBMArea(int x, int y, int sx, int sy, int dx, int dy) {
+void copyXBMArea(int src_x, int src_y, int width, int height, int dest_x,
+				 int dest_y)
+{
+
+	XCopyArea(display, wmgen_src.mask, wmgen_bkg.pixmap, NormalGC, src_x,
+			  src_y, width, height, dest_x, dest_y);
+}
+
+
+/* added for wmbiff */
+XFontStruct *f;
+int loadFont(const char *fontname)
+{
+	if (display != NULL) {
+		f = XLoadQueryFont(display, fontname);
+		if (f) {
+			XSetFont(display, NormalGC, f->fid);
+			return 0;
+		} else {
+			printf("couldn't set font!\n");
+		}
+	}
+	return -1;
+}
+
+void drawString(int dest_x, int dest_y, const char *string,
+				const char *colorname, const char *bgcolorname,
+				int right_justify)
+{
+	int len = strlen(string);
+	assert(colorname != NULL);
+	XSetForeground(display, NormalGC, GetColor(colorname));
+	XSetBackground(display, NormalGC, GetColor(bgcolorname));
+	if (right_justify)
+		dest_x -= XTextWidth(f, string, len);
+	XDrawImageString(display, wmgen_bkg.pixmap, NormalGC, dest_x, dest_y,
+					 string, len);
+}
 
-	XCopyArea(display, wmgen.mask, wmgen.pixmap, NormalGC, x, y, sx, sy, dx, dy);
+void eraseRect(int x, int y, int x2, int y2, const char *bgcolorname)
+{
+	XSetForeground(display, NormalGC, GetColor(bgcolorname));
+	XFillRectangle(display, wmgen_bkg.pixmap, NormalGC, x, y, x2 - x,
+				   y2 - y);
 }
 
+/* end wmbiff additions */
 
 /*******************************************************************************\
 |* setMaskXY																   *|
 \*******************************************************************************/
 
-void setMaskXY(int x, int y) {
+void setMaskXY(int x, int y)
+{
 
-	 XShapeCombineMask(display, win, ShapeBounding, x, y, pixmask, ShapeSet);
-	 XShapeCombineMask(display, iconwin, ShapeBounding, x, y, pixmask, ShapeSet);
+	XShapeCombineMask(display, win, ShapeBounding, x, y, pixmask,
+					  ShapeSet);
+	XShapeCombineMask(display, iconwin, ShapeBounding, x, y, pixmask,
+					  ShapeSet);
 }
 
 /*******************************************************************************\
 |* openXwindow																   *|
 \*******************************************************************************/
-void openXwindow(int argc, char *argv[], const char *pixmap_bytes[], char *pixmask_bits, int pixmask_width, int pixmask_height) {
+void openXwindow(int argc, const char *argv[],
+				 const char *pixmap_bytes_bkg[],
+				 const char *pixmap_bytes_src[], char *pixmask_bits,
+				 int pixmask_width, int pixmask_height, int notWithdrawn)
+{
 
-	unsigned int	borderwidth = 1;
-	XClassHint		classHint;
-	char			*display_name = NULL;
-	char			*wname = argv[0];
-	XTextProperty	name;
+	unsigned int borderwidth = 1;
+	XClassHint classHint;
+	const char *display_name = NULL;
+	char *wname = strdup(argv[0]);
+	XTextProperty name;
 
-	XGCValues		gcv;
-	unsigned long	gcm;
+	XGCValues gcv;
+	unsigned long gcm;
 
-	char			*geometry = NULL;
+	const char *geometry = NULL;
+	char default_geometry[128];
 
-	int				dummy=0;
-	int				i, wx, wy;
+	int dummy = 0;
+	int i;
 
-	for (i=1; argv[i]; i++) {
+	for (i = 1; argv[i]; i++) {
 		if (!strcmp(argv[i], "-display")) {
-			display_name = argv[i+1];
+			display_name = argv[i + 1];
 			i++;
 		}
 		if (!strcmp(argv[i], "-geometry")) {
-			geometry = argv[i+1];
+			geometry = argv[i + 1];
 			i++;
 		}
 	}
 
+	sprintf(default_geometry, "%dx%d+0+0", pixmask_width, pixmask_height);
+
 	if (!(display = XOpenDisplay(display_name))) {
-		fprintf(stderr, "%s: can't open display %s\n", 
-						wname, XDisplayName(display_name));
+		fprintf(stderr, "%s: can't open display %s\n",
+				wname, XDisplayName(display_name));
 		exit(1);
 	}
-	screen  = DefaultScreen(display);
-	Root    = RootWindow(display, screen);
+	screen = DefaultScreen(display);
+	Root = RootWindow(display, screen);
 	d_depth = DefaultDepth(display, screen);
-	x_fd    = XConnectionNumber(display);
+	x_fd = XConnectionNumber(display);
 
 	/* Convert XPM to XImage */
-	GetXPM(&wmgen, pixmap_bytes);
+	GetXPM(&wmgen_bkg, pixmap_bytes_bkg);
+	GetXPM(&wmgen_src, pixmap_bytes_src);
 
 	/* Create a window to hold the stuff */
 	mysizehints.flags = USSize | USPosition;
 	mysizehints.x = 0;
 	mysizehints.y = 0;
 
-	back_pix = GetColor("white");
-	fore_pix = GetColor("black");
+	back_pix = GetColor("black");
+	fore_pix = GetColor("cyan");
+
+	XWMGeometry(display, screen, geometry, default_geometry, borderwidth,
+				&mysizehints, &mysizehints.x, &mysizehints.y,
+				&mysizehints.width, &mysizehints.height, &dummy);
 
-	XWMGeometry(display, screen, Geometry, NULL, borderwidth, &mysizehints,
-				&mysizehints.x, &mysizehints.y,&mysizehints.width,&mysizehints.height, &dummy);
+	mysizehints.width = pixmask_width;	/* changed 11/2002 for wmbiff non 64x64-ness */
+	mysizehints.height = pixmask_height;	/* was statically 64. */
 
-	mysizehints.width = 64;
-	mysizehints.height = 64;
-		
 	win = XCreateSimpleWindow(display, Root, mysizehints.x, mysizehints.y,
-				mysizehints.width, mysizehints.height, borderwidth, fore_pix, back_pix);
-	
-	iconwin = XCreateSimpleWindow(display, win, mysizehints.x, mysizehints.y,
-				mysizehints.width, mysizehints.height, borderwidth, fore_pix, back_pix);
+							  mysizehints.width, mysizehints.height,
+							  borderwidth, fore_pix, back_pix);
+
+	iconwin =
+		XCreateSimpleWindow(display, win, mysizehints.x, mysizehints.y,
+							mysizehints.width, mysizehints.height,
+							borderwidth, fore_pix, back_pix);
 
 	/* Activate hints */
 	XSetWMNormalHints(display, win, &mysizehints);
@@ -434,9 +526,14 @@ void openXwindow(int argc, char *argv[], const char *pixmap_bytes[], char *pixma
 	classHint.res_class = wname;
 	XSetClassHint(display, win, &classHint);
 
-	XSelectInput(display, win, ButtonPressMask | ExposureMask | ButtonReleaseMask | PointerMotionMask | StructureNotifyMask);
-	XSelectInput(display, iconwin, ButtonPressMask | ExposureMask | ButtonReleaseMask | PointerMotionMask | StructureNotifyMask);
+	XSelectInput(display, win,
+				 ButtonPressMask | ExposureMask | ButtonReleaseMask |
+				 PointerMotionMask | StructureNotifyMask);
+	XSelectInput(display, iconwin,
+				 ButtonPressMask | ExposureMask | ButtonReleaseMask |
+				 PointerMotionMask | StructureNotifyMask);
 
+	/* wname is argv[0] */
 	if (XStringListToTextProperty(&wname, 1, &name) == 0) {
 		fprintf(stderr, "%s: can't allocate window name\n", wname);
 		exit(1);
@@ -445,7 +542,7 @@ void openXwindow(int argc, char *argv[], const char *pixmap_bytes[], char *pixma
 	XSetWMName(display, win, &name);
 
 	/* Create GC for drawing */
-	
+
 	gcm = GCForeground | GCBackground | GCGraphicsExposures;
 	gcv.foreground = fore_pix;
 	gcv.background = back_pix;
@@ -454,10 +551,14 @@ void openXwindow(int argc, char *argv[], const char *pixmap_bytes[], char *pixma
 
 	/* ONLYSHAPE ON */
 
-	pixmask = XCreateBitmapFromData(display, win, pixmask_bits, pixmask_width, pixmask_height);
+	pixmask =
+		XCreateBitmapFromData(display, win, pixmask_bits, pixmask_width,
+							  pixmask_height);
 
-	XShapeCombineMask(display, win, ShapeBounding, 0, 0, pixmask, ShapeSet);
-	XShapeCombineMask(display, iconwin, ShapeBounding, 0, 0, pixmask, ShapeSet);
+	XShapeCombineMask(display, win, ShapeBounding, 0, 0, pixmask,
+					  ShapeSet);
+	XShapeCombineMask(display, iconwin, ShapeBounding, 0, 0, pixmask,
+					  ShapeSet);
 
 	/* ONLYSHAPE OFF */
 
@@ -466,18 +567,43 @@ void openXwindow(int argc, char *argv[], const char *pixmap_bytes[], char *pixma
 	mywmhints.icon_x = mysizehints.x;
 	mywmhints.icon_y = mysizehints.y;
 	mywmhints.window_group = win;
-	mywmhints.flags = StateHint | IconWindowHint | IconPositionHint | WindowGroupHint;
+	mywmhints.flags =
+		(notWithdrawn ? 0 : StateHint) | IconWindowHint |
+		IconPositionHint | WindowGroupHint;
 
 	XSetWMHints(display, win, &mywmhints);
 
-	XSetCommand(display, win, argv, argc);
+	XSetCommand(display, win, (char **) argv, argc);
 	XMapWindow(display, win);
 
 	if (geometry) {
-		if (sscanf(geometry, "+%d+%d", &wx, &wy) != 2) {
-			fprintf(stderr, "Bad geometry string.\n");
-			exit(1);
-		}
-		XMoveWindow(display, win, wx, wy);
+		/* we'll silently drop width and height as well as negative positions */
+		/* mostly because I don't know how to deal with them */
+		/*
+		   int wx, wy, x, y;
+		   int specified = XParseGeometry(geometry, &x, &y, &wx, &wy);
+		   printf("%d %d %d %d\n", x, y, wx, wy);
+		   if( specified & XNegative ) {
+		   x = DisplayWidth(display, DefaultScreen(display)) - x - pixmask_width;
+		   }
+		   if( specified & YNegative ) {
+		   y = DisplayHeight(display, DefaultScreen(display)) - y - pixmask_height;
+		   }
+		   if( specified & XValue || specified & YValue ) { 
+		   XMoveWindow(display, win, x, y);
+		   } */
+
+		/*
+		   if (sscanf(geometry, "+%d+%d", &wx, &wy) == 2) {
+		   XMoveWindow(display, win, wx, wy);
+		   } else if (sscanf(geometry, "%dx%d+%d+%d", &x, &y, &wx, &wy) == 4) {
+		   XMoveWindow(display, win, wx, wy);
+		   } else if (sscanf(geometry, "+%d-%d", &wx, &wy) == 2) {
+		   XMoveWindow(display, win, wx, 0 - wy);
+		   }  else {
+		   fprintf(stderr, "Unsupported geometry string '%s'\n",
+		   geometry);
+		   exit(1);
+		   } */
 	}
 }
diff --git a/wmgeneral/wmgeneral.h b/wmgeneral/wmgeneral.h
index a167774..f2f3595 100644
--- a/wmgeneral/wmgeneral.h
+++ b/wmgeneral/wmgeneral.h
@@ -14,38 +14,40 @@
 typedef struct _rckeys rckeys;
 
 struct _rckeys {
-	const char	*label;
-	char		**var;
+	const char *label;
+	char **var;
 };
 
 typedef struct _rckeys2 rckeys2;
 
 struct _rckeys2 {
-	const char	*family;
-	const char	*label;
-	char		**var;
+	const char *family;
+	const char *label;
+	char **var;
 };
 
 typedef struct {
-	Pixmap			pixmap;
-	Pixmap			mask;
-	XpmAttributes	attributes;
+	Pixmap pixmap;
+	Pixmap mask;
+	XpmAttributes attributes;
 } XpmIcon;
 
   /*******************/
  /* Global variable */
 /*******************/
 
-Display		*display;
+Display *display;
 
   /***********************/
  /* Function Prototypes */
 /***********************/
 
-void AddMouseRegion(int rgn_index, int left, int top, int right, int bottom);
+void AddMouseRegion(unsigned int rgn_index, int left, int top, int right,
+					int bottom);
 int CheckMouseRegion(int x, int y);
 
-void openXwindow(int argc, char *argv[], const char **, char *, int, int);
+void openXwindow(int argc, const char *argv[], const char **,
+				 const char **, char *, int, int, int);
 void RedrawWindow(void);
 void RedrawWindowXY(int x, int y);
 
@@ -56,4 +58,12 @@ void setMaskXY(int, int);
 
 void parse_rcfile(const char *, rckeys *);
 
+/* for wmbiff */
+int loadFont(const char *fontname);	/* -1 on fail, 0 success. */
+void drawString(int dest_x, int dest_y, const char *string,
+				const char *colorname, const char *bgcolorname,
+				int right_justify);
+void eraseRect(int x, int y, int x2, int y2, const char *bgcolorname);
+/* end wmbiff */
+
 #endif

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/wmbiff.git



More information about the Pkg-wmaker-commits mailing list