Index: /trunk/gsdl3/packages/javagdbm/CHANGES
===================================================================
--- /trunk/gsdl3/packages/javagdbm/CHANGES	(revision 10737)
+++ /trunk/gsdl3/packages/javagdbm/CHANGES	(revision 10737)
@@ -0,0 +1,26 @@
+Release 0006 1998-03-06
+ - Added FAQ.html
+
+Release 0005 1997-10-30
+ - Deserializing objects from databases is implemented properly
+ - Added the Closeable interface
+ - Fixed link to home page in documentation
+
+Release 0004 1997-10-24
+ - Fixed bug in autoconfig script
+
+Release 0003 1997-10-24
+ - Release-management and CVS restructurings
+
+Release 0002 1997-10-23
+ - Much more developer documentation in javadoc format
+ - Support for Serialization and QuotedVector packing
+ - Packing objects now have consistent names
+ - New distribution page, separate from mbp's home page
+ - Moved all the code into packages which use the standard Java naming
+   conventions: au.com.pharos.gdbm
+
+Release 0001 1997-10-03
+ - Functional JNI-based interface
+ - Scanty documentation
+ - GPL release disclaimer from jdg
Index: /trunk/gsdl3/packages/javagdbm/FAQ.html
===================================================================
--- /trunk/gsdl3/packages/javagdbm/FAQ.html	(revision 10737)
+++ /trunk/gsdl3/packages/javagdbm/FAQ.html	(revision 10737)
@@ -0,0 +1,173 @@
+<head><title>FAQ for JavaGDBM</title>
+</head>
+
+<h1>FAQ for JavaGDBM</h1>
+<p><pre>$Id$</pre>
+<p><a href="http://www.pharos.com.au/gdbm/"><b>Home page</b></a> |
+<a href="mailto:mbp@pharos.com.au"><b>mbp@pharos.com.au</b></a>
+
+<p><b>This is not an official publication of Pharos.  There is no
+warranty of any kind on this software or document.</b>
+
+<h3>Is this a JDBC driver?</h3>
+
+<p>(Alain Magloire)
+
+<p>No. JDBC seems mainly intended for interfaces to relational
+databases, and GDBM is not a relational database. 
+
+<p>However, JDBC does permit use of a subset to interface to
+non-relational databases.  Implementing this might be interesting: let
+me know if it's useful to you.
+
+<h3>Does JavaGDBM understand SQL?</h3>
+
+<p>(Alain Magloire)
+
+<p>No, JavaGDBM is intended to store on-disk hash tables.  They solve
+a different class of problem to that appropriate for SQL and
+relational databases.
+
+<h3>What type of database should I use?</h3>
+
+<p>Broadly, options for data storage in Java include
+
+<ul>
+<li>A hash file through JavaGDBM.
+<li>A relational database through JDBC
+<li>An object-oriented database
+<li>Serialization to a file
+</ul>
+
+<p>Make sure you choose the right tools: there is no single `best' answer.
+
+<h3>Are you maintaining GDBM?</h3>
+
+<p>No.  I understand that GDBM is still maintained by the FSF.
+
+<h3>Does it work on NT?</h3>
+
+<p>It should, but I haven't tried it.  You'll need a C compiler to
+build the native library.  Let me know if you try.
+
+<h3>Why does the test harness report exceptions</h3>
+
+<p>The test harness may report messages such as
+
+<pre>
+caught: au.com.pharos.gdbm.GdbmException: File open error: No such file or
+directory? (gdbmjava.c:101)
+</pre>
+
+<p>These are expected exceptions: the test harness is making sure that
+exceptions are thrown when they should be.
+
+<h3>I was trying to compile the Java GDBM distribution and it says gdbm.h not found</h3>
+
+<p>(Sandeep Kumar)
+
+<ol>
+<li>Make sure you have the GDBM library installed on your system.  
+If the library is not installed, you should be able to find it at 
+<a href="http://www.gnu.org/">www.gnu.org</a>
+
+<li>Make sure your compiler is configured to find the libraries and
+include files.
+
+</ol>
+
+<h3><tt>GdbmFile.h</tt> is missing</h3>
+
+<p>(Paul Matthews)
+
+<p><tt>GdbmFile.h</tt> is build by <tt>javah</tt> when the library is
+built.
+
+<h3>What is the best source to learn Java?</h3>
+
+<p>(Celil Germeyan)
+
+<p>Personally, I recommend the excellent Java series of books from
+<a href="http://www.ora.com/info/java/bibliography.html/">O'Reilly and
+Associates</a> and the
+<a href="http://java.sun.com/docs/books/index.html">Javasoft/Addison
+Wesley</a> books.
+
+<h3>I get a `not ok 40' message running the test</h3>
+
+<p>(Steve Waldman)
+
+<p>If you find a bug, either have a look at the code yourself, or
+send e-mail to 
+<a href="mailto:mbp@pharos.com.au"><tt>mbp@pharos.com.au</tt></a>.  
+There's no warranty on JavaGDBM, but I will try to respond to your
+mail and problem.
+
+<h3>I get linker errors on Solaris</h3>
+
+<p>(Alex Soto)
+
+<pre>
+Hi,
+
+    I'm hoping to use your JavaGDBM api for my application, but I'm
+having some problems compiling the libgdbmjava.so.  Here is a partial
+listing of the errors:
+
+gcc -o libgdbmjava.so -shared gdbmjava.o -lgdbm
+Text relocation remains                       referenced
+    against symbol                  offset      in file
+free                                0x258
+/usr/local/lib/libgdbm.a(gdbmreorg.o)
+free                                0xd0
+/usr/local/lib/libgdbm.a(gdbmclose.o)
+free                                0xb8
+/usr/local/lib/libgdbm.a(gdbmclose.o)
+free                                0x218
+[snipped]
+
+I have used the libgdbm.a lib before, and don't believe there is a
+problem with it.  I'm compiling to Solaris 2.6, using JDK 1.1.4.
+</pre>
+
+<p>The solution turned out to be that the gdbm native library
+must be compiled with the <tt>-fpic</tt> flag to cause the compiler to
+generate position-independant code.  
+
+<h3>What happens if a reader tries to open the database while a writer is doing something?</h3>
+
+<p>(Rich Neill)
+
+<p>Access will be denied until the writer releases its lock.  
+
+<p>JavaGDBM uses a shared-read/exclusive-write protocol at the OS
+level.  However, multiple Java threads can access a file concurrently.
+
+<h3>What platforms does JavaGDBM run on?</H3>
+
+<p>It should run on any platform that supports JDK1.1 or higher, JNI
+(Java Native Interface), and GDBM.  JavaGDBM is known to run on 
+
+<ul>
+<li>Linux/i386
+<li>Solaris/SPARC and Solaris/i86
+<li>AIX 4
+</ul>
+
+<p>If you have any information on other platforms, please let me know.
+
+<h3>You don't anticipate going Pure Java soon, do you?</h3>
+
+<p>(Brian Thorstad)
+
+<p>It's on the `long-term' TODO list.  I'd like to do it, but don't have
+any date in mind.
+
+<h3>Acknowledgements</h3>
+
+<p>Everybody who's sent in questions or comments.
+
+<p>Redhat and Javasoft, and the authors of GDBM, Linux, gcc, autoconf,
+and other software used in building JavaGDBM.
+
+</html>
Index: /trunk/gsdl3/packages/javagdbm/LICENSE
===================================================================
--- /trunk/gsdl3/packages/javagdbm/LICENSE	(revision 10737)
+++ /trunk/gsdl3/packages/javagdbm/LICENSE	(revision 10737)
@@ -0,0 +1,344 @@
+		    GNU GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+                          675 Mass Ave, Cambridge, MA 02139, 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) 19yy  <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., 675 Mass Ave, Cambridge, MA 02139, 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) 19yy 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.
Index: /trunk/gsdl3/packages/javagdbm/Makefile.in
===================================================================
--- /trunk/gsdl3/packages/javagdbm/Makefile.in	(revision 10737)
+++ /trunk/gsdl3/packages/javagdbm/Makefile.in	(revision 10737)
@@ -0,0 +1,19 @@
+# Main Makefile for Java GDBM
+# Katherine Don
+
+SUBDIRS = java jni
+MDEFINES = 
+
+all install clean:
+	for subdir in $(SUBDIRS); do \
+	echo making $@ in $$subdir; \
+	(cd $$subdir && $(MAKE) $(MDEFINES) $@) || exit 1; \
+	done
+
+distclean: 
+	rm -f Makefile config.cache config.log config.status ;\
+	for subdir in $(SUBDIRS); do \
+	echo making $@ in $$subdir; \
+	(cd $$subdir && $(MAKE) $(MDEFINES) $@) || exit 1; \
+	done	
+
Index: /trunk/gsdl3/packages/javagdbm/README.txt
===================================================================
--- /trunk/gsdl3/packages/javagdbm/README.txt	(revision 10737)
+++ /trunk/gsdl3/packages/javagdbm/README.txt	(revision 10737)
@@ -0,0 +1,31 @@
+A Java Interface to GDBM
+
+*****
+This is a most of the Java gdbm download. I have left out some unnecessary bits for the greenstone version. The original home page for this is no longer available, but http://aurora.regenstrief.org/~schadow/dbm-java/ has links to the original tar file.
+I have also updated the Makefiles so that it works on Windows and MacOSX.
+[kjdon, 2005]
+*****
+
+Martin Pool <m.pool@pharos.com.au>  1998-03-12
+
+ This is a Java interface to the GDBM database library written by Philip A Nelson. Like GDBM itself, this interface is free software, and comes with no warranty of any kind.
+
+GDBM is a library of database functions for implementing a hash on disk. JavaGDBM is an API for the Java programmer, not an applet or database package for end users.
+
+In Java terms, a GdbmFile is very similar to a java.util.Dictionary object, except that objects are reliably written to and retrieved from disk. An adaptor class, GdbmDictionary, presents that interface to maintain compatibility with existing code.
+
+GDBM enforces file and object locking to allow databases to be safely shared between multiple threads or processes. A database may be open read-write by one process, or read-only by any number of processes. Within each process, any number of threads may share the database. Within the limits of the operating system and hardware, GDBM will ensure that changes are atomically committed to disk, making the database safe even if the program terminates abnormally.
+
+JavaGDBM stores key/data pairs in a GdbmFile object, which represents a single disk file. Each key must be unique, and is paired with a single data item. The keys are not ordered: if you want to retrieve the objects in sorted order you can build an external index. The basic operations on
+
+As for a Dictionary, the basic operations that may be performed on a GdbmFile are to fetch, test for existence, store and delete records.
+
+Since Java objects are dynamically typed and GDBM data are typeless, JavaGDBM uses Strategy objects to allow objects to be encoded and decoded in various ways. Classes derived from the abstract Packing class may pack ojbects for storage as byte arrays, Unicode or ASCII strings, as serialized Java objects, or in a user-defined fashion. The packing strategy is defined at runtime for both the key and value of the records.
+
+Some example code is available in the test harness GdbmTest.java.
+
+The current implementation of JavaGDBM uses native glue code to link to the GDBM library via JNI, the Java Native Interface. This means that you must have a C compiler, the GDBM library, and related tools to compile the native portions JavaGDBM also requires a JDK1.1-compatible Java compiler, libraries, and runtime.
+
+If the GDBM libraries didn't come with your system, then you can download the GDBM source and install it.
+
+GDBM is known to work on Linux, NetBSD, Solaris, and AIX. 
Index: /trunk/gsdl3/packages/javagdbm/TODO
===================================================================
--- /trunk/gsdl3/packages/javagdbm/TODO	(revision 10737)
+++ /trunk/gsdl3/packages/javagdbm/TODO	(revision 10737)
@@ -0,0 +1,21 @@
+TODO for JavaGDBM
+$Id$
+
+Short-term
+
+ - Fix reported bugs
+
+Medium-term
+
+ - Modify the Makefile and configuration code to make sure JavaGDBM
+   builds on more different systems.
+
+ - Add support for non-default block sizes and other options.
+
+ - Offer more developer documentation.
+
+Long-term
+
+ - Rewrite the native code in Java to make the system 100% Pure.
+ - Offer precompiled binaries(?)
+
Index: /trunk/gsdl3/packages/javagdbm/configure
===================================================================
--- /trunk/gsdl3/packages/javagdbm/configure	(revision 10737)
+++ /trunk/gsdl3/packages/javagdbm/configure	(revision 10737)
@@ -0,0 +1,5222 @@
+#! /bin/sh
+# From configure.in Revision: 1.5 .
+# Guess values for system-dependent variables and create Makefiles.
+# 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.
+## --------------------- ##
+## 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=
+PACKAGE_TARNAME=
+PACKAGE_VERSION=
+PACKAGE_STRING=
+PACKAGE_BUGREPORT=
+
+ac_unique_file="jni/gdbmjava.c"
+# 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 CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S CPP EGREP JAVA_HOME javagdbm_cv_path_javah javagdbm_cv_path_java PKG JNIINC JNISUFFIX JNIFLAGS LIBOBJS LTLIBOBJS'
+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 this package 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
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+
+  cat <<\_ACEOF
+
+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.
+
+_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
+
+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 $as_me, 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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# TODO: allow the user to specify whether they want a debugging
+# library or not?
+
+# check for compilers and other tools
+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
+
+ac_aux_dir=
+for ac_dir in $srcdir $srcdir/.. $srcdir/../..; 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 $srcdir $srcdir/.. $srcdir/../.." >&5
+echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+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.
+
+# 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 ln -s works" >&5
+echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
+LN_S=$as_ln_s
+if test "$LN_S" = "ln -s"; then
+  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+  echo "$as_me:$LINENO: result: no, using $LN_S" >&5
+echo "${ECHO_T}no, using $LN_S" >&6
+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 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
+
+
+echo "$as_me:$LINENO: checking for void *" >&5
+echo $ECHO_N "checking for void *... $ECHO_C" >&6
+if test "${ac_cv_type_void_p+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
+int
+main ()
+{
+if ((void * *) 0)
+  return 0;
+if (sizeof (void *))
+  return 0;
+  ;
+  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_void_p=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_void_p=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_void_p" >&5
+echo "${ECHO_T}$ac_cv_type_void_p" >&6
+
+echo "$as_me:$LINENO: checking size of void *" >&5
+echo $ECHO_N "checking size of void *... $ECHO_C" >&6
+if test "${ac_cv_sizeof_void_p+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test "$ac_cv_type_void_p" = yes; then
+  # The cast to unsigned long works around a bug in the HP C Compiler
+  # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+  # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+  # This bug is HP SR number 8606223364.
+  if test "$cross_compiling" = yes; then
+  # Depending upon the size, compute the lo and hi bounds.
+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
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (void *))) >= 0)];
+test_array [0] = 0
+
+  ;
+  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_lo=0 ac_mid=0
+  while :; do
+    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
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (void *))) <= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  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_hi=$ac_mid; break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_lo=`expr $ac_mid + 1`
+		    if test $ac_lo -le $ac_mid; then
+		      ac_lo= ac_hi=
+		      break
+		    fi
+		    ac_mid=`expr 2 '*' $ac_mid + 1`
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+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
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (void *))) < 0)];
+test_array [0] = 0
+
+  ;
+  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_hi=-1 ac_mid=-1
+  while :; do
+    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
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (void *))) >= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  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_lo=$ac_mid; break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_hi=`expr '(' $ac_mid ')' - 1`
+		       if test $ac_mid -le $ac_hi; then
+			 ac_lo= ac_hi=
+			 break
+		       fi
+		       ac_mid=`expr 2 '*' $ac_mid`
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_lo= ac_hi=
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
+  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
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (void *))) <= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  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_hi=$ac_mid
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_lo=`expr '(' $ac_mid ')' + 1`
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in
+?*) ac_cv_sizeof_void_p=$ac_lo;;
+'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *), 77
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (void *), 77
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; } ;;
+esac
+else
+  if test "$cross_compiling" = yes; then
+  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+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
+long longval () { return (long) (sizeof (void *)); }
+unsigned long ulongval () { return (long) (sizeof (void *)); }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main ()
+{
+
+  FILE *f = fopen ("conftest.val", "w");
+  if (! f)
+    exit (1);
+  if (((long) (sizeof (void *))) < 0)
+    {
+      long i = longval ();
+      if (i != ((long) (sizeof (void *))))
+	exit (1);
+      fprintf (f, "%ld\n", i);
+    }
+  else
+    {
+      unsigned long i = ulongval ();
+      if (i != ((long) (sizeof (void *))))
+	exit (1);
+      fprintf (f, "%lu\n", i);
+    }
+  exit (ferror (f) || fclose (f) != 0);
+
+  ;
+  return 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
+  ac_cv_sizeof_void_p=`cat conftest.val`
+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 )
+{ { echo "$as_me:$LINENO: error: cannot compute sizeof (void *), 77
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (void *), 77
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+rm -f conftest.val
+else
+  ac_cv_sizeof_void_p=0
+fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_sizeof_void_p" >&5
+echo "${ECHO_T}$ac_cv_sizeof_void_p" >&6
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_VOID_P $ac_cv_sizeof_void_p
+_ACEOF
+
+
+echo "$as_me:$LINENO: checking for int" >&5
+echo $ECHO_N "checking for int... $ECHO_C" >&6
+if test "${ac_cv_type_int+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
+int
+main ()
+{
+if ((int *) 0)
+  return 0;
+if (sizeof (int))
+  return 0;
+  ;
+  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_int=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_int=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5
+echo "${ECHO_T}$ac_cv_type_int" >&6
+
+echo "$as_me:$LINENO: checking size of int" >&5
+echo $ECHO_N "checking size of int... $ECHO_C" >&6
+if test "${ac_cv_sizeof_int+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test "$ac_cv_type_int" = yes; then
+  # The cast to unsigned long works around a bug in the HP C Compiler
+  # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+  # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+  # This bug is HP SR number 8606223364.
+  if test "$cross_compiling" = yes; then
+  # Depending upon the size, compute the lo and hi bounds.
+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
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (int))) >= 0)];
+test_array [0] = 0
+
+  ;
+  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_lo=0 ac_mid=0
+  while :; do
+    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
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (int))) <= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  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_hi=$ac_mid; break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_lo=`expr $ac_mid + 1`
+		    if test $ac_lo -le $ac_mid; then
+		      ac_lo= ac_hi=
+		      break
+		    fi
+		    ac_mid=`expr 2 '*' $ac_mid + 1`
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+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
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (int))) < 0)];
+test_array [0] = 0
+
+  ;
+  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_hi=-1 ac_mid=-1
+  while :; do
+    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
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (int))) >= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  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_lo=$ac_mid; break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_hi=`expr '(' $ac_mid ')' - 1`
+		       if test $ac_mid -le $ac_hi; then
+			 ac_lo= ac_hi=
+			 break
+		       fi
+		       ac_mid=`expr 2 '*' $ac_mid`
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_lo= ac_hi=
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
+  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
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (int))) <= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  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_hi=$ac_mid
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_lo=`expr '(' $ac_mid ')' + 1`
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in
+?*) ac_cv_sizeof_int=$ac_lo;;
+'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (int), 77
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; } ;;
+esac
+else
+  if test "$cross_compiling" = yes; then
+  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+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
+long longval () { return (long) (sizeof (int)); }
+unsigned long ulongval () { return (long) (sizeof (int)); }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main ()
+{
+
+  FILE *f = fopen ("conftest.val", "w");
+  if (! f)
+    exit (1);
+  if (((long) (sizeof (int))) < 0)
+    {
+      long i = longval ();
+      if (i != ((long) (sizeof (int))))
+	exit (1);
+      fprintf (f, "%ld\n", i);
+    }
+  else
+    {
+      unsigned long i = ulongval ();
+      if (i != ((long) (sizeof (int))))
+	exit (1);
+      fprintf (f, "%lu\n", i);
+    }
+  exit (ferror (f) || fclose (f) != 0);
+
+  ;
+  return 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
+  ac_cv_sizeof_int=`cat conftest.val`
+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 )
+{ { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (int), 77
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+rm -f conftest.val
+else
+  ac_cv_sizeof_int=0
+fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5
+echo "${ECHO_T}$ac_cv_sizeof_int" >&6
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_INT $ac_cv_sizeof_int
+_ACEOF
+
+
+echo "$as_me:$LINENO: checking for long" >&5
+echo $ECHO_N "checking for long... $ECHO_C" >&6
+if test "${ac_cv_type_long+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
+int
+main ()
+{
+if ((long *) 0)
+  return 0;
+if (sizeof (long))
+  return 0;
+  ;
+  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_long=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_long=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5
+echo "${ECHO_T}$ac_cv_type_long" >&6
+
+echo "$as_me:$LINENO: checking size of long" >&5
+echo $ECHO_N "checking size of long... $ECHO_C" >&6
+if test "${ac_cv_sizeof_long+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test "$ac_cv_type_long" = yes; then
+  # The cast to unsigned long works around a bug in the HP C Compiler
+  # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+  # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+  # This bug is HP SR number 8606223364.
+  if test "$cross_compiling" = yes; then
+  # Depending upon the size, compute the lo and hi bounds.
+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
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (long))) >= 0)];
+test_array [0] = 0
+
+  ;
+  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_lo=0 ac_mid=0
+  while :; do
+    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
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  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_hi=$ac_mid; break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_lo=`expr $ac_mid + 1`
+		    if test $ac_lo -le $ac_mid; then
+		      ac_lo= ac_hi=
+		      break
+		    fi
+		    ac_mid=`expr 2 '*' $ac_mid + 1`
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+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
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (long))) < 0)];
+test_array [0] = 0
+
+  ;
+  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_hi=-1 ac_mid=-1
+  while :; do
+    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
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (long))) >= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  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_lo=$ac_mid; break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_hi=`expr '(' $ac_mid ')' - 1`
+		       if test $ac_mid -le $ac_hi; then
+			 ac_lo= ac_hi=
+			 break
+		       fi
+		       ac_mid=`expr 2 '*' $ac_mid`
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_lo= ac_hi=
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
+  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
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  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_hi=$ac_mid
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_lo=`expr '(' $ac_mid ')' + 1`
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in
+?*) ac_cv_sizeof_long=$ac_lo;;
+'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (long), 77
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; } ;;
+esac
+else
+  if test "$cross_compiling" = yes; then
+  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+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
+long longval () { return (long) (sizeof (long)); }
+unsigned long ulongval () { return (long) (sizeof (long)); }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main ()
+{
+
+  FILE *f = fopen ("conftest.val", "w");
+  if (! f)
+    exit (1);
+  if (((long) (sizeof (long))) < 0)
+    {
+      long i = longval ();
+      if (i != ((long) (sizeof (long))))
+	exit (1);
+      fprintf (f, "%ld\n", i);
+    }
+  else
+    {
+      unsigned long i = ulongval ();
+      if (i != ((long) (sizeof (long))))
+	exit (1);
+      fprintf (f, "%lu\n", i);
+    }
+  exit (ferror (f) || fclose (f) != 0);
+
+  ;
+  return 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
+  ac_cv_sizeof_long=`cat conftest.val`
+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 )
+{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (long), 77
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+rm -f conftest.val
+else
+  ac_cv_sizeof_long=0
+fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5
+echo "${ECHO_T}$ac_cv_sizeof_long" >&6
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_LONG $ac_cv_sizeof_long
+_ACEOF
+
+
+
+######## check for the JDK and tools within the JDK
+######## look in the JAVA_HOME environment variable at configure-time
+echo "$as_me:$LINENO: checking for the JDK" >&5
+echo $ECHO_N "checking for the JDK... $ECHO_C" >&6
+if test "z$JAVA_HOME" != z &&
+   test -d $JAVA_HOME &&
+   test -d $JAVA_HOME/include
+then
+
+	echo "$as_me:$LINENO: result: found in $JAVA_HOME" >&5
+echo "${ECHO_T}found in $JAVA_HOME" >&6
+else
+	{ { echo "$as_me:$LINENO: error: not found in \$JAVA_HOME" >&5
+echo "$as_me: error: not found in \$JAVA_HOME" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+# TODO: Check for specific header files in the JDK, or
+# functions/definitions within those headers?
+
+# TODO: guess which include directory to use under the JDK
+
+# Extract the first word of "javah", so it can be a program name with args.
+set dummy javah; 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_javagdbm_cv_path_javah+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $javagdbm_cv_path_javah in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_javagdbm_cv_path_javah="$javagdbm_cv_path_javah" # 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_javagdbm_cv_path_javah="$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_javagdbm_cv_path_javah" && ac_cv_path_javagdbm_cv_path_javah="missing_javah"
+  ;;
+esac
+fi
+javagdbm_cv_path_javah=$ac_cv_path_javagdbm_cv_path_javah
+
+if test -n "$javagdbm_cv_path_javah"; then
+  echo "$as_me:$LINENO: result: $javagdbm_cv_path_javah" >&5
+echo "${ECHO_T}$javagdbm_cv_path_javah" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+if test "$javagdbm_cv_path_javah" = missing_javah; then
+	{ { echo "$as_me:$LINENO: error: javah not found." >&5
+echo "$as_me: error: javah not found." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+# Extract the first word of "java", so it can be a program name with args.
+set dummy java; 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_javagdbm_cv_path_java+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $javagdbm_cv_path_java in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_javagdbm_cv_path_java="$javagdbm_cv_path_java" # 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_javagdbm_cv_path_java="$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_javagdbm_cv_path_java" && ac_cv_path_javagdbm_cv_path_java="missing"
+  ;;
+esac
+fi
+javagdbm_cv_path_java=$ac_cv_path_javagdbm_cv_path_java
+
+if test -n "$javagdbm_cv_path_java"; then
+  echo "$as_me:$LINENO: result: $javagdbm_cv_path_java" >&5
+echo "${ECHO_T}$javagdbm_cv_path_java" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+if test "$javagdbm_cv_path_java" = missing; then
+	{ { echo "$as_me:$LINENO: error: java not found." >&5
+echo "$as_me: error: java not found." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+# check for gdbm library
+echo "$as_me:$LINENO: checking for gdbm_open in -lgdbm" >&5
+echo $ECHO_N "checking for gdbm_open in -lgdbm... $ECHO_C" >&6
+if test "${ac_cv_lib_gdbm_gdbm_open+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lgdbm  $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 gdbm_open ();
+int
+main ()
+{
+gdbm_open ();
+  ;
+  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_gdbm_gdbm_open=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_gdbm_gdbm_open=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_gdbm_gdbm_open" >&5
+echo "${ECHO_T}$ac_cv_lib_gdbm_gdbm_open" >&6
+if test $ac_cv_lib_gdbm_gdbm_open = yes; then
+  javagdbm_cv_lib_gdbm="-lgdbm"
+else
+  javagdbm_cv_lib_gdbm=no
+fi
+
+if test "$javagdbm_cv_lib_gdbm" = "no"; then
+	{ { echo "$as_me:$LINENO: error: no native gdbm library found." >&5
+echo "$as_me: error: no native gdbm library found." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+LIBS="$javagdbm_cv_lib_gdbm"
+
+########## set compiler options
+# TODO: is there a more appropriate way to guess which switches to use
+# with which systems/compilers?
+CFLAGS="-Wall -O2 -fpic"
+PKG="au.com.pharos.gdbm"
+
+
+
+
+# we need to set an extended JNI path for Mac OS/Darwin, as jni.h is on
+# a non-standard Path
+echo "$as_me:$LINENO: checking for Apple MacOS X/Darwin" >&5
+echo $ECHO_N "checking for Apple MacOS X/Darwin... $ECHO_C" >&6
+if test "`(uname -s) 2> /dev/null`" = 'Darwin'; then
+  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+  JNIINC="-I/System/Library/Frameworks/JavaVM.framework/Headers/ "
+  JNISUFFIX="jnilib"
+  JNIFLAGS="-dynamiclib -fno-common"
+  LDFLAGS="-framework JavaVM"
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+  JNIINC=""
+  JNISUFFIX="so"
+  JNIFLAGS="-shared"
+fi
+
+
+
+
+# write the output
+                              ac_config_files="$ac_config_files Makefile jni/Makefile java/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
+
+# Transform confdefs.h into DEFS.
+# Protect against shell expansion while executing Makefile rules.
+# Protect against Makefile macro expansion.
+#
+# If the first sed substitution is executed (which looks for macros that
+# take arguments), then we branch to the quote section.  Otherwise,
+# look for a macro that doesn't take arguments.
+cat >confdef2opt.sed <<\_ACEOF
+t clear
+: clear
+s,^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 (][^	 (]*([^)]*)\)[	 ]*\(.*\),-D\1=\2,g
+t quote
+s,^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 ][^	 ]*\)[	 ]*\(.*\),-D\1=\2,g
+t quote
+d
+: quote
+s,[	 `~#$^&*(){}\\|;'"<>?],\\&,g
+s,\[,\\&,g
+s,\],\\&,g
+s,\$,$$,g
+p
+_ACEOF
+# We use echo to avoid assuming a particular line-breaking character.
+# The extra dot is to prevent the shell from consuming trailing
+# line-breaks from the sub-command output.  A line-break within
+# single-quotes doesn't work because, if this script is created in a
+# platform that uses two characters for line-breaks (e.g., DOS), tr
+# would break.
+ac_LF_and_DOT=`echo; echo .`
+DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'`
+rm -f confdef2opt.sed
+
+
+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
+
+
+
+: ${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 $as_me, 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
+
+Configuration files:
+$config_files
+
+Report bugs to <bug-autoconf@gnu.org>."
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+ac_cs_version="\\
+config.status
+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
+for ac_config_target in $ac_config_targets
+do
+  case "$ac_config_target" in
+  # Handling of arguments.
+  "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+  "jni/Makefile" ) CONFIG_FILES="$CONFIG_FILES jni/Makefile" ;;
+  "java/Makefile" ) CONFIG_FILES="$CONFIG_FILES java/Makefile" ;;
+  *) { { 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
+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,@SHELL@,$SHELL,;t t
+s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
+s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
+s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
+s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
+s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
+s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
+s,@exec_prefix@,$exec_prefix,;t t
+s,@prefix@,$prefix,;t t
+s,@program_transform_name@,$program_transform_name,;t t
+s,@bindir@,$bindir,;t t
+s,@sbindir@,$sbindir,;t t
+s,@libexecdir@,$libexecdir,;t t
+s,@datadir@,$datadir,;t t
+s,@sysconfdir@,$sysconfdir,;t t
+s,@sharedstatedir@,$sharedstatedir,;t t
+s,@localstatedir@,$localstatedir,;t t
+s,@libdir@,$libdir,;t t
+s,@includedir@,$includedir,;t t
+s,@oldincludedir@,$oldincludedir,;t t
+s,@infodir@,$infodir,;t t
+s,@mandir@,$mandir,;t t
+s,@build_alias@,$build_alias,;t t
+s,@host_alias@,$host_alias,;t t
+s,@target_alias@,$target_alias,;t t
+s,@DEFS@,$DEFS,;t t
+s,@ECHO_C@,$ECHO_C,;t t
+s,@ECHO_N@,$ECHO_N,;t t
+s,@ECHO_T@,$ECHO_T,;t t
+s,@LIBS@,$LIBS,;t t
+s,@CC@,$CC,;t t
+s,@CFLAGS@,$CFLAGS,;t t
+s,@LDFLAGS@,$LDFLAGS,;t t
+s,@CPPFLAGS@,$CPPFLAGS,;t t
+s,@ac_ct_CC@,$ac_ct_CC,;t t
+s,@EXEEXT@,$EXEEXT,;t t
+s,@OBJEXT@,$OBJEXT,;t t
+s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
+s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
+s,@INSTALL_DATA@,$INSTALL_DATA,;t t
+s,@LN_S@,$LN_S,;t t
+s,@CPP@,$CPP,;t t
+s,@EGREP@,$EGREP,;t t
+s,@JAVA_HOME@,$JAVA_HOME,;t t
+s,@javagdbm_cv_path_javah@,$javagdbm_cv_path_javah,;t t
+s,@javagdbm_cv_path_java@,$javagdbm_cv_path_java,;t t
+s,@PKG@,$PKG,;t t
+s,@JNIINC@,$JNIINC,;t t
+s,@JNISUFFIX@,$JNISUFFIX,;t t
+s,@JNIFLAGS@,$JNIFLAGS,;t t
+s,@LIBOBJS@,$LIBOBJS,;t t
+s,@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
+
+  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
+  # 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; }
+_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,@configure_input@,$configure_input,;t t
+s,@srcdir@,$ac_srcdir,;t t
+s,@abs_srcdir@,$ac_abs_srcdir,;t t
+s,@top_srcdir@,$ac_top_srcdir,;t t
+s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t
+s,@builddir@,$ac_builddir,;t t
+s,@abs_builddir@,$ac_abs_builddir,;t t
+s,@top_builddir@,$ac_top_builddir,;t t
+s,@abs_top_builddir@,$ac_abs_top_builddir,;t t
+s,@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
+
+{ (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
+
Index: /trunk/gsdl3/packages/javagdbm/configure.in
===================================================================
--- /trunk/gsdl3/packages/javagdbm/configure.in	(revision 10737)
+++ /trunk/gsdl3/packages/javagdbm/configure.in	(revision 10737)
@@ -0,0 +1,104 @@
+dnl Process this file with autoconf to produce a configure script.
+
+dnl autoconf configuration script for the JNI part of the 
+dnl au.com.pharos.gdbm Java package
+dnl $Id$
+
+AC_REVISION($Revision$)
+
+# Copyright (C) 1997 by Pharos IP Pty Ltd
+#
+# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+AC_INIT(jni/gdbmjava.c)
+
+# TODO: allow the user to specify whether they want a debugging
+# library or not?
+
+# check for compilers and other tools
+AC_PROG_CC
+AC_PROG_INSTALL
+AC_PROG_LN_S
+
+AC_CHECK_SIZEOF(void *)
+AC_CHECK_SIZEOF(int)
+AC_CHECK_SIZEOF(long)
+
+######## check for the JDK and tools within the JDK
+######## look in the JAVA_HOME environment variable at configure-time
+AC_MSG_CHECKING([for the JDK])
+if test "z$JAVA_HOME" != z &&
+   test -d $JAVA_HOME && 
+   test -d $JAVA_HOME/include
+then
+	AC_SUBST(JAVA_HOME)
+	AC_MSG_RESULT([found in $JAVA_HOME])
+else
+	AC_MSG_ERROR([not found in \$JAVA_HOME])
+fi
+
+# TODO: Check for specific header files in the JDK, or
+# functions/definitions within those headers?
+
+# TODO: guess which include directory to use under the JDK
+
+AC_PATH_PROG(javagdbm_cv_path_javah, javah, missing_javah)
+if test "$javagdbm_cv_path_javah" = missing_javah; then
+	AC_MSG_ERROR([javah not found.])
+fi
+
+AC_PATH_PROG(javagdbm_cv_path_java, java, missing)
+if test "$javagdbm_cv_path_java" = missing; then
+	AC_MSG_ERROR([java not found.])
+fi
+
+# check for gdbm library
+AC_CHECK_LIB(gdbm, gdbm_open, [javagdbm_cv_lib_gdbm="-lgdbm"],
+	[javagdbm_cv_lib_gdbm=no])
+if test "$javagdbm_cv_lib_gdbm" = "no"; then
+	AC_MSG_ERROR([no native gdbm library found.])
+fi
+LIBS="$javagdbm_cv_lib_gdbm"
+
+########## set compiler options
+# TODO: is there a more appropriate way to guess which switches to use
+# with which systems/compilers?
+CFLAGS="-Wall -O2 -fpic"
+PKG="au.com.pharos.gdbm"
+AC_SUBST(CFLAGS)
+AC_SUBST(PKG)
+AC_SUBST(LIBS)
+
+# we need to set an extended JNI path for Mac OS/Darwin, as jni.h is on
+# a non-standard Path
+AC_MSG_CHECKING(for Apple MacOS X/Darwin)
+if test "`(uname -s) 2> /dev/null`" = 'Darwin'; then
+  AC_MSG_RESULT(yes)
+  JNIINC="-I/System/Library/Frameworks/JavaVM.framework/Headers/ "
+  JNISUFFIX="jnilib"
+  JNIFLAGS="-dynamiclib -fno-common"
+  LDFLAGS="-framework JavaVM"
+else
+  AC_MSG_RESULT(no)
+  JNIINC=""
+  JNISUFFIX="so"
+  JNIFLAGS="-shared"
+fi
+AC_SUBST(JNIINC)
+AC_SUBST(JNISUFFIX)
+AC_SUBST(JNIFLAGS)
+
+# write the output
+AC_OUTPUT([Makefile jni/Makefile java/Makefile])
Index: /trunk/gsdl3/packages/javagdbm/java/Makefile.in
===================================================================
--- /trunk/gsdl3/packages/javagdbm/java/Makefile.in	(revision 10737)
+++ /trunk/gsdl3/packages/javagdbm/java/Makefile.in	(revision 10737)
@@ -0,0 +1,31 @@
+# Makefile for Java part of JavaGDBM
+# Katherine Don, 2005
+
+JAVAC = $(JAVA_HOME)/bin/javac
+JAVAH = $(JAVA_HOME)/bin/javah
+JAR = $(JAVA_HOME)/bin/jar
+
+JAVAGDBMHOME=../
+JAVACLASSDIR=./classes
+JAVASRCDIR=.
+JAVACOPTIONS= -deprecation -g -O
+JAVACLASSPATH=$(JAVACLASSDIR):
+
+all: setup compile
+
+setup:
+	mkdir -p $(JAVACLASSDIR)
+
+compile: setup
+	$(JAVAC) -d $(JAVACLASSDIR) -sourcepath $(JAVASRCDIR) $(JAVACOPTIONS) au/com/pharos/*/*.java
+	$(JAVAH) -o $(JAVAGDBMHOME)/jni/GdbmFile.h -classpath $(JAVACLASSPATH) au.com.pharos.gdbm.GdbmFile
+	$(JAR) cf $(JAVAGDBMHOME)/javagdbm.jar -C $(JAVACLASSDIR) au
+
+clean:
+	rm -rf $(JAVACLASSDIR) $(JAVAGDBMHOME)/javagdbm.jar $(JAVAGDBMHOME)/jni/GdbmFile.h 
+
+install:
+
+distclean: clean
+	rm -f Makefile
+
Index: /trunk/gsdl3/packages/javagdbm/java/au/com/pharos/dbinterface/vf/VFDbInterface.java
===================================================================
--- /trunk/gsdl3/packages/javagdbm/java/au/com/pharos/dbinterface/vf/VFDbInterface.java	(revision 10737)
+++ /trunk/gsdl3/packages/javagdbm/java/au/com/pharos/dbinterface/vf/VFDbInterface.java	(revision 10737)
@@ -0,0 +1,37 @@
+/*
+ * (C) Pharos IP Pty Ltd 1997
+ */
+
+package au.com.pharos.dbinterface.vf;
+
+import java.util.Date;
+
+import au.com.pharos.gdbm.GdbmFile;
+
+import au.com.pharos.packing;
+
+import au.com.pharos.dbinterface.vf;
+
+public class VFDbInterface {
+
+  /* The Order database */
+  private String orderDB = "/fn/data/Orders.gdbm";
+
+  /* The Stock database */
+  private String stockDB = "/fn/data/Stock.gdbm";
+
+  /* Initialisation.  Nothing needs to happen yet. */
+  public VFDbInterface()
+  {
+    ;
+  }
+
+  /* Submit an order to the database */
+  public void submitOrder(VFOrder order)
+  {
+    GdbmFile db = new GdbmFile(orderDB);
+    db.setKeyPacking(new StringPacking());
+    db.setValuePacking(new QuotedVectorPacking());
+
+    Vector details = order.toVectorString();
+    
Index: /trunk/gsdl3/packages/javagdbm/java/au/com/pharos/dbinterface/vf/VFItem.java
===================================================================
--- /trunk/gsdl3/packages/javagdbm/java/au/com/pharos/dbinterface/vf/VFItem.java	(revision 10737)
+++ /trunk/gsdl3/packages/javagdbm/java/au/com/pharos/dbinterface/vf/VFItem.java	(revision 10737)
@@ -0,0 +1,106 @@
+/*
+ * (C) Pharos IP Pty Ltd 1997
+ */
+package au.com.pharos.dbinterface.vf;
+
+import java.util.Date;
+
+public class VFItem {
+
+  /* The title of the item */
+  public String title;
+
+  /* The name fo the item's distributor */
+  public String distributor;
+
+  /* The category of the item */
+  // TODO: Create a more appropriate type for this?
+  public String category;
+
+  /* The rating of the item */
+  //TODO: Again, a more appropriate type?
+  public String rating;
+
+  /* The list price */
+  public float listPrice;
+
+  /* The supplier's price */
+  public float ourPrice;
+
+  /* The release date for the item */
+  public Date releaseDate;
+
+  /* The date upon which the video is accessible to PayTV */
+  public Date payTVWindow;
+
+  /* The date upon which the video is accessible to free-to-air TV */
+  public Date tvWindow;
+
+  /* The sell-through beginning date */
+  public Date sellThruWindow;
+
+  /* Whether or not the item has an internal magazine advertisement */
+  public boolean magAdvert;
+
+  /* The recommended number of items for Budget 1 stores */
+  public short budget1;
+
+  /* For budget 2 stores */
+  public short budget2;
+
+  /* Budget 3 stores */
+  public short budget3;
+
+  /* Budget 4 stores */
+  public short budget4;
+
+  /* Will the item be advertised by the VideoIndustry Professional Association */
+  boolean vipa;
+
+  /* Initialise all the attributes */
+  public VFItem(String newTitle,
+		String newDistrib,
+		String newCat,
+		String newRating,
+		float newList,
+		float newPrice,
+		Date newRelease,
+		Date newPaytv,
+		Date newTv,
+		boolean isMagAdvert,
+		short newBudget1,
+		short newBudget2,
+		short newBudget3,
+		short newBudget4
+		boolean newvipa)
+  {
+    title = newTitle;
+    distributor = newDistrib;
+    category = newCat;
+    rating = newRating;
+    listPrice = newList;
+    ourPrice = newPrice;
+    releaseDate = newRelease;
+    payTVWindow = newPaytv;
+    tvWindow = newTv;
+    magAdvert = isMagAdvert;
+    budget1 = newBudget1;
+    budget2 = newBudget2;
+    budget3 = newBudget3;
+    budget4 = newBudget4;
+    vipa = newvipa;
+  }
+
+  public boolean equals (Object o)
+  {
+    if (!(o instanceof VFItem)) {
+      return false;
+    }
+    VFItem other = (VFItem) o;
+    if (title.equals(other.title) && distributor.equals(other.distributor) && category.equals(other.category)) {
+      return true;
+    }
+    return false;
+  }
+
+}
Index: /trunk/gsdl3/packages/javagdbm/java/au/com/pharos/dbinterface/vf/VFOrder.java
===================================================================
--- /trunk/gsdl3/packages/javagdbm/java/au/com/pharos/dbinterface/vf/VFOrder.java	(revision 10737)
+++ /trunk/gsdl3/packages/javagdbm/java/au/com/pharos/dbinterface/vf/VFOrder.java	(revision 10737)
@@ -0,0 +1,116 @@
+/*
+ * (C) Pharos IP PTy Ltd 1997
+ */
+
+package au.com.pharos.dbinterface.vf;
+
+import java.util.Date;
+import java.util.Vector;
+import java.util.Hashtable;
+import java.util.Enumeration;
+
+import java.text.SimpleDateFormat;
+import java.text.ParsePosition;
+
+import java.text.SimpleDateFormat;
+
+public class VFOrder {
+
+  /* The final date for submission */
+  public Date finalSubmit;
+
+  /* The date the order was created */
+  public Date orderDate;
+
+  /* A hash mapping titles requested to numbers of each title*/
+  public Hashtable orderNumbers;
+  
+  /* The name of the ordering store */
+  public String name;
+
+  public VFOrder(Date newFinal,
+		 String newName,
+		 Hashtable newOrder)
+  {
+    finalSubmit = newFinal;
+    orderNumbers = newOrder;
+    name = newName;
+    orderDate = new Date(System.currentTimeMillis());
+    if (orderDate.after(finalSubmit)) {
+      throw new IllegalArgumentException("Final submission date is earlier than present date.");
+    }
+  }
+
+  public VFOrder(Date newFinal,
+		 Date newDate,
+		 String newName,
+		 Hashtable newOrder)
+  {
+    finalSubmit = newFinal;
+    orderDate = newDate;
+    orderNumbers = newOrder;
+    name = newName;
+    orderDate = new Date(System.currentTimeMillis());
+    if (orderDate.after(finalSubmit)) {
+      throw new IllegalArgumentException("Final submission date is earlier than present date.");
+    }
+  }
+
+  public Vector toVectorString()
+  {
+    Vector result = new Vector();
+    result.addElement(new Long(finalSubmit.getTime()));
+    result.addElement(new Long(orderDate.getTime()));
+    result.addElement(orderNumbers.toString());
+    result.addElement(name);
+    return result;
+  }
+
+  public VFOrder fromVectorString(Vector input)
+       throws java.text.ParseException
+  {
+    Hashtable data = new Hashtable();
+    SimpleDateFormat form = new SimpleDateFormat();
+    for (Enumeration e = input.elements(); e.hasMoreElements(); ) {
+      System.out.println(e.nextElement());
+    }
+    try {
+      finalSubmit = new Date(((Long) input.elementAt(0)).longValue());
+    } catch (NullPointerException e) {
+      System.err.println("Waaaah!");
+      finalSubmit = new Date();
+    }
+    System.err.println("No 2:" + input.elementAt(1).toString());
+    orderDate = new Date(((Long) input.elementAt(1)).longValue());
+    name = (String) input.elementAt(3);
+    String hashString = (String) input.elementAt(2);
+    StringBuffer key = new StringBuffer();;
+    StringBuffer value = new StringBuffer();
+    String type = new String("key");
+    for (int count = 0; count < hashString.length(); count++) {
+      char i = hashString.charAt(count);
+      if (i == '{' || i == ' ') { ; }
+      else if (i == '}') { data.put(key, value); }
+      else if (i == ',') {data.put(key, value); }
+      else if (i == '=') {
+	if (type.equals("key")) {
+	  type = "value";
+	} else {
+	  type = "key";
+	}
+      } else {
+	if (type.equals("key")) {
+	  key.append(i);
+	} else {
+	  value.append(i);
+	}
+      }
+    }
+    return new VFOrder(finalSubmit, orderDate, name, data);
+  }
+	
+      
+
+
+}
+  
Index: /trunk/gsdl3/packages/javagdbm/java/au/com/pharos/gdbm/Closeable.java
===================================================================
--- /trunk/gsdl3/packages/javagdbm/java/au/com/pharos/gdbm/Closeable.java	(revision 10737)
+++ /trunk/gsdl3/packages/javagdbm/java/au/com/pharos/gdbm/Closeable.java	(revision 10737)
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 1997 Pharos IP Pty Ltd
+ * Confidential.  All rights reserved.
+ * $Id$
+ */
+
+package au.com.pharos.gdbm;
+
+import java.io.IOException;
+
+/** A Closeable object is one having a connection to an underlying
+ * data store that may be flushed or closed.
+ *
+ * <P>This interface is intended to complement the Dictionary and
+ * Collection interfaces by reflecting the fact that many such objects
+ * may be closed.
+ *
+ * @author Martin Pool
+ * @version $Revision$
+ **/
+public interface Closeable {
+    /** Write outstanding changes to the underlying database, and
+     * break the connection, freeing any associated resources or
+     * locks.  This generally does not imply that the data will be
+     * lost, merely that it will be released.  If this is not
+     * meaningful for a particular Closeable object, then it should be
+     * a no-op.
+     *
+     * @exception java.io.IOException passed up from the underlying
+     * database.
+     **/
+    public void close() throws IOException;
+
+    /** Write outstanding changes to the underlying database, but
+     * leave the database open.  If this is not meaningful for a
+     * particular Closeable object, then it should be a no-op.
+     *
+     * @exception java.io.IOException passed up from the underlying
+     * database.
+     **/
+    public void sync() throws IOException;
+}
Index: /trunk/gsdl3/packages/javagdbm/java/au/com/pharos/gdbm/GdbmDictionary.java
===================================================================
--- /trunk/gsdl3/packages/javagdbm/java/au/com/pharos/gdbm/GdbmDictionary.java	(revision 10737)
+++ /trunk/gsdl3/packages/javagdbm/java/au/com/pharos/gdbm/GdbmDictionary.java	(revision 10737)
@@ -0,0 +1,157 @@
+/*
+ * module: pip/java/gdbm -- A Java interface to the GDBM library
+ * class:  GdbmDictionary -- Wrap up a GDBM File for use as a Dictionary
+ *
+ * Copyright (C) 1997 Pharos IP Pty Ltd
+ * $Id$
+ *
+ *  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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package au.com.pharos.gdbm;
+
+import java.util.Dictionary;
+import java.util.Enumeration;
+
+/** A GDBM database, presented as a Java dictionary.
+ *
+ * <P>This is a separate class which defers most operations to
+ * GdbmFile because GdbmFile can throw IO exceptions, and because the
+ * interface assumptions for Dictionary are not the same as those of
+ * the IO library.  Perhaps they should be the same.
+ *
+ * <P>The Dictionary class will be partially replaced by the much
+ * more elegant 
+ * <A HREF="http://www.javasoft.com/products/jdk/preview/docs/guide/collections/overview.html">Collections API</A>
+ * in JDK1.2, at which time a GDBM Collections interface will probably
+ * be available.
+ *
+ * @see java.util.Dictionary
+ * @see GdbmFile
+ *
+ * @author Martin Pool
+ * @version $Revision$
+ **/
+// TODO: I wonder if this should be an inner class of GdbmFile?  It
+// would bloat that source file a bit, but would (arguably) more
+// accurately capture the intended design. -- mbp
+public class GdbmDictionary extends Dictionary implements Closeable
+{
+    // XXX: This should probably become a private field, but on the other
+    // hand it's probably useful to be able to apply GDBM-specific methods to
+    // the underlying DB.  -- mbp
+    GdbmFile db;
+
+    public GdbmDictionary(GdbmFile db) {
+	this.db = db;
+    }
+
+    private Exception caughtException;
+    
+    public Exception checkError() {
+	return caughtException;
+    }	
+
+    public int size() {
+	try {
+	    return db.size();
+	} catch (Exception e) {
+	    caughtException = e;
+	    return 0;
+	}
+    }
+
+    public boolean isEmpty() {
+	try {
+	    return db.isEmpty();
+	} catch (Exception e) {
+	    caughtException = e;
+	    return false;
+	}
+    }
+
+    public Enumeration keys() {
+	try {
+	    return db.keys();
+	} catch (Exception e) {
+	    caughtException = e;
+	    return null;
+	}
+    }
+
+    public Enumeration elements() {
+	// TODO: write an iterator class to do this
+	throw new NoSuchMethodError();
+    }
+
+    public Object get(Object key) {
+	try {
+	    return db.fetch(key);
+	} catch (Exception e) {
+	    caughtException = e;
+	    return null;
+	}
+    }
+
+    public Object put(Object key, Object value)  {
+	try {
+	    Object oldValue = db.fetch(key);
+	    db.store(key, value);
+	    return oldValue;
+	} catch (Exception e) {
+	    caughtException = e;
+	    return null;
+	}
+    }
+
+    public Object remove(Object key) {
+	try {
+	    Object oldValue = db.fetch(key);
+	    db.delete(key);
+	    return oldValue;
+	} catch (Exception e) {
+	    caughtException = e;
+	    return null;
+	}
+    }
+
+    /** Write outstanding changes to the underlying database, and
+     * close the database.
+     *
+     * @see au.com.pharos.gdbm.Closeable
+     **/
+    public void close() {
+	try {
+	    if (db != null && db.isOpen())
+		db.close();
+	    db = null;
+	} catch (GdbmException e) {
+	    ;
+	}
+    }
+
+    /** Write outstanding changes to the underlying database, but
+     * leave the database open.
+     *
+     * @see au.com.pharos.gdbm.Closeable
+     **/
+    public void sync() {
+	try {
+	    db.sync();
+	} catch (GdbmException e) {
+	    ;
+	}
+    }
+}
Index: /trunk/gsdl3/packages/javagdbm/java/au/com/pharos/gdbm/GdbmException.java
===================================================================
--- /trunk/gsdl3/packages/javagdbm/java/au/com/pharos/gdbm/GdbmException.java	(revision 10737)
+++ /trunk/gsdl3/packages/javagdbm/java/au/com/pharos/gdbm/GdbmException.java	(revision 10737)
@@ -0,0 +1,45 @@
+/*
+ * module: pip/java/gdbm -- A Java interface to the GDBM library
+ * class:  GdbmException -- An exception originating in the GDBM library
+ * Copyright (C) 1997 Pharos IP Pty Ltd
+ * $Id$
+ *
+ *  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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package au.com.pharos.gdbm;
+
+import java.io.IOException;
+
+/** An exception originating in the GDBM library.
+ *
+ * @author Martin Pool
+ * @version $Revision$ 
+ * @see au.com.pharos.gdbm.GdbmFile
+ */
+
+public class GdbmException extends IOException
+{
+    // TODO: Perhaps provide more information about which particular
+    // exception caused the problem?
+    /** Constructs a GdbmException with the specified reason.
+    **/
+    public GdbmException(String reason)
+    {
+	super(reason);
+    }
+}
+
+
Index: /trunk/gsdl3/packages/javagdbm/java/au/com/pharos/gdbm/GdbmFile.java
===================================================================
--- /trunk/gsdl3/packages/javagdbm/java/au/com/pharos/gdbm/GdbmFile.java	(revision 10737)
+++ /trunk/gsdl3/packages/javagdbm/java/au/com/pharos/gdbm/GdbmFile.java	(revision 10737)
@@ -0,0 +1,563 @@
+/*
+ * Copyright (C) 1997 Pharos IP Pty Ltd
+ * $Id$
+ *
+ *  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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package au.com.pharos.gdbm;
+
+import java.util.Enumeration;
+import java.util.NoSuchElementException;
+
+import au.com.pharos.packing.Packing;
+import au.com.pharos.packing.RawPacking;
+
+/** Java interface to a GDBM database table.
+ *
+ * <P>This database is a simple on-disk hash table.
+ *
+ * <P>Both the hash keys and values
+ * are binary strings of any length.  They are converted to and
+ * from Java objects using customizable packing strategies.
+ *
+ * <P>The implementation of this class consists of two levels: a
+ * Java-level interface, and a set of private native functions
+ * implemented in C.  As much functionality as possible is implemented
+ * in Java: the C functions generally just marshal the information for
+ * presentation to the native GDBM library.
+ *
+ * <P>The native library <CODE>gdbmjava</CODE> must be available
+ * for dynamic loading in a system-dependant manner.
+ *
+ * <p>See the GDBM documentation file, and the
+ * <A HREF="http://www.pharos.com.au/gdbm/">JavaGDBM home page</A>
+ * for more information.
+ *
+ * @see au.com.pharos.packing.Packing
+ * @see au.com.pharos.gdbm.GdbmTest
+ * @see au.com.pharos.gdbm.GdbmDictionary
+ *
+ * @author Martin Pool
+ * @version $Revision$
+ **/
+
+public class GdbmFile implements Closeable {
+    /** The GDBM handle for the database file, or 0 if the database has
+     * been closed.  Java doesn't understand it, but it stores it and
+     * passes it to the C routines. */
+    private transient volatile long dbf;
+
+    // Remember the parameters used to open the database
+    private int openFlags;
+    private String dbFilename;
+
+    // -----------------------------------------------------------------
+    // Constructors
+
+    // Values must match those from gdbm.h !
+    /** Indicates that the caller will just read the database.  Many
+     * readers may share a database. */
+    public final static int READER = 0;
+
+    /** The caller wants read/write access to an existing database and
+     * requires exclusive access. */
+    public final static int WRITER = 1;
+
+    /** The caller wants exclusive read/write access, and the database
+     * should be created if it does not already exist. */
+    public final static int WRCREAT = 2;
+
+    /** The caller wants exclusive read/write access, and the database
+     * should be replaced if it already exists. */
+    public final static int NEWDB = 3;
+
+    /** Flag indicating GDBM should write to the database without disc
+     * synchronization.  This allows faster writes, but may produce an
+     * inconsistent database in the event of abnormal termination of
+     * the writer. */
+    public final static int FAST = 16;
+
+    // TODO: Allow FAST mode to be toggled
+
+    /** Creates a new GdbmFile object representing an disk database.  The
+     * database is opened or created on disk.
+     *
+     * <P>Both key and value strategies default to
+     * RawPacking, meaning that the database will use raw byte arrays
+     * for both key and value.
+     *
+     * <P>TODO: Allow the caller to specify the block size and/or
+     * cache size.
+     *
+     * @param fileName the disk filename in which the data will be stored.
+     *
+     * @param flags any of READER, WRITER, WRCREAT, and NEWDB, optionally
+     * ORed with FAST
+     *
+     * @exception GdbmException if the database cannot be opened or
+     * created.
+     *
+     * @see GdbmFile#READER
+     * @see GdbmFile#WRITER
+     * @see GdbmFile#WRCREAT
+     * @see GdbmFile#NEWDB
+     * @see GdbmFile#FAST
+     */
+    public GdbmFile(String fileName, int flags)
+	 throws GdbmException
+    {
+	openFlags = flags;
+	dbFilename = fileName;
+	keyPacking = new RawPacking();
+	valuePacking = new RawPacking();
+	dbf = gdbm_open(fileName, flags);
+    }
+
+    /** Close the database file if it is still open.
+     *
+     * <P><B>Note</B> that the disk file is locked against access from
+     * other processes while it is open.  To prevent contention, it
+     * may be useful to explicitly close the file rather than waiting
+     * for the garbage-collector.
+     *
+     * @see GdbmFile#isOpen()
+     **/
+    public synchronized void close() throws GdbmException
+    {
+	if (dbf != 0)
+	    gdbm_close(dbf);
+	dbf = 0;		// No longer connected
+    }
+
+    /** Close the database when the GdbmFile is garbage-collected.
+     *
+     * @see GdbmFile#close()
+     */
+    public void finalize() throws GdbmException
+    {
+	close();
+    }
+
+    /* The Gdbm file is unlocked when the process terminates, but
+     * nevertheless it would be good to close it in finalization, in
+     * case the OS process continues after the JVM terminates.
+     *
+     * XXX: Unfortunately, anybody else can turn this off again: it
+     * would be nice if there was a way to avoid this. */
+    static {
+	System.runFinalizersOnExit(true);
+    }
+
+
+
+    // -----------------------------------------------------------------
+    // Packing strategies
+    private Packing keyPacking, valuePacking;
+
+    /** Set the object to be used as the packing strategy for
+     * converting key objects to and from the byte arrays stored in
+     * the database.
+     *
+     * <P>Depending on the class of Java object used as the key of your
+     * database, it may be appropriate to use a packing strategy from
+     * the
+     * <A HREF="Package-au.com.pharos.packing.html"><CODE>au.com.pharos.packing</CODE></A>
+     * package, or to define a new subclass of one of those strategies.
+     *
+     * @see au.com.pharos.packing.Packing
+     * @see GdbmFile#setValuePacking(au.com.pharos.packing.Packing)
+     **/
+    public void setKeyPacking(Packing newPacking) {
+	keyPacking = newPacking;
+    }
+
+    /** Set the object to be used as the packing strategy for
+     * converting value objects to and from the byte arrays stored
+     *  in the database.
+     *
+     * <P>Depending on the class of Java object used as the key of your
+     * database, it may be appropriate to use a packing strategy from
+     * the
+     * <A HREF="Package-au.com.pharos.packing.html"><CODE>au.com.pharos.packing</CODE></A>
+     * package, or to define a new subclass of one of those strategies.
+     *
+     * @see au.com.pharos.packing.Packing
+     * @see GdbmFile#setKeyPacking(au.com.pharos.packing.Packing )
+     **/
+    public void setValuePacking(Packing newPacking) {
+	valuePacking = newPacking;
+    }
+
+    // -----------------------------------------------------------------
+
+    /** Returns a string indicating the version of the underlying GDBM
+     * library.
+     *
+     * @return the version of the native GDBM library.
+     **/
+    public static String getLibraryVersion()
+    {
+	return gdbm_getversion();
+    }
+
+    /** Return a string indicating the version of the JavaGDBM library
+     * wrapper.
+     *
+     * <P>The most current release is available from the
+     * <A HREF="http://www.pharos.com.au/javagdbm/">JavaGDBM home page</A>.
+     *
+     * @return the release number of the JavaGDBM library
+     **/
+    public static String getWrapperVersion()
+    {
+	return gdbm_wrapperVersion();
+    }
+
+    /** Indicate whether the database is writable.
+     *
+     * <P>Databases are opened in either read-write or read-only mode,
+     * and remain in that mode until they are closed.
+     *
+     * @return true if the database may be written; otherwise false.
+     *
+     * @see GdbmFile#GdbmFile(java.lang.String, int)
+     **/
+    public boolean isWritable()
+    {
+	return (openFlags & 0x03) != READER;
+    }
+
+    /** Indicate whether the database is open or not.
+     *
+     * <P>A database is open from the point of creation until close()
+     * is called, if ever, after which it is closed.
+     *
+     * @return false if the database has been closed; otherwise true.
+     *
+     * @see GdbmFile#close()
+     **/
+    public boolean isOpen()
+    {
+	return dbf != 0;
+    }
+
+
+    /** Compact the database file.
+     *
+     * <P>If you have had a lot of deletions and would like to shrink the
+     * space used by the GDBM file, this function will reorganize the
+     * database.  GDBM will not shorten the length of a GDBM file
+     * (deleted file space will be reused) except by using this
+     * reorganization, though it will reuse the vacant space.
+     *
+     * <P>The database must be writable.
+     */
+    public void reorganize()
+	 throws GdbmException
+    {
+	gdbm_reorganize(dbf);
+    }
+    
+
+    /** Flush changes to disk.
+     *
+     * <P>This function is only required when the database is
+     * opened with the FAST flag set.  By default, changes are
+     * flushed to disk after every update.
+     *
+     * <P>The database must be writable.
+     *
+     * @see GdbmFile#FAST
+     **/
+    public void sync()
+	 throws GdbmException
+    {
+	gdbm_sync(dbf);
+    }
+
+
+
+    /** Retrieve the value corresponding to a particular key.
+     *
+     * @param key the key of the record to be retrieved
+     *
+     * @return the value of the record with the specified key; or
+     * null if the key is not present in the database.
+     */
+    public Object fetch(Object key) throws GdbmException
+    {
+	byte[] keyBytes = keyPacking.toBytes(key);
+	return valuePacking.fromBytes(gdbm_fetch(dbf, keyBytes));
+    }
+
+
+    /** Indicate whether the specified key is in the database,
+     * without returning the value.
+     *
+     * @param key the key of the record to be retrieved
+     *
+     * @return true if a record with the specified key is present;
+     * otherwise false.
+     */
+    public boolean exists(Object key) throws GdbmException
+    {
+	byte[] keyBytes = keyPacking.toBytes(key);
+	return gdbm_exists(dbf, keyBytes);
+    }
+
+
+
+    /** Store a value in the database, replacing any existing value
+     * with the same key.
+     *
+     * @param key key under which to store the value
+     *
+     * @param value value to be stored
+     *
+     * @exception GdbmException if the object is a reader; or
+     * if an IO error occurs
+     **/
+    public void store(Object key, Object value)
+	 throws GdbmException
+    {
+	byte[] keyBytes = keyPacking.toBytes(key);
+	byte[] valueBytes = valuePacking.toBytes(value);
+	gdbm_store(dbf, keyBytes, valueBytes, true);
+    }
+
+
+    
+    /** Store a value in the database, unless a record with the same
+     * key already exists.
+     *
+     * @param key key under which to store the value.
+     *
+     * @param value value to be stored.
+     *
+     * @exception GdbmException if a record with the specified key
+     * already exists; or if the object is a reader; or
+     * if an IO error occurs
+     */
+    public void storeNoReplace(Object key, Object value)
+	 throws GdbmException
+    {
+	byte[] keyBytes = keyPacking.toBytes(key);
+	byte[] valueBytes = valuePacking.toBytes(value);
+ 	gdbm_store(dbf, keyBytes, valueBytes, false);
+    }
+
+
+    
+    /** Remove a record from the database.
+     *
+     * @param key key of the record to be removed
+     *
+     * @exception GdbmException if there is no record with the
+     * specified key; or if the object is a reader; or if an IO error
+     * occurs.
+     **/
+    public void delete(Object key)
+	 throws GdbmException
+    {
+	byte[] keyBytes = keyPacking.toBytes(key);
+	gdbm_delete(dbf, keyBytes);
+    }
+
+
+
+
+
+    // -----------------------------------------------------------------
+    // Iterator support
+
+    // TODO: Use a flag/timestamp approach to throw an exception if
+    // somebody modifies the database while they're trying to iterate
+    // over it?  Approach suggested by Doug Lea's Collections API. --
+    // mbp
+
+    /** Return an enumeration which will return all of the keys for the
+     * database of the file in (apparently) random order.
+     *
+     * <P><B>Caution:</B> If the database is modified while
+     * an enumeration is in progress,
+     * then changes in the hash table may cause the enumeration to
+     * miss some records.
+     *
+     * @see java.util.Enumeration
+     **/
+    public Enumeration keys() throws GdbmException
+    {
+	// Return an inner class which will do the iteration in the
+	// context of this GdbmFile object.
+	return new KeyEnumeration();
+    }
+
+    // Synchronization is performed in the GdbmFile's methods
+    class KeyEnumeration implements Enumeration {
+	private byte[] currKey, nextKey;
+
+	KeyEnumeration() throws GdbmException {
+	    currKey = null;
+	    nextKey = getFirstKeyRaw();
+	}
+
+	public boolean hasMoreElements() {
+	    return nextKey != null;
+	}
+
+	public Object nextElement() throws NoSuchElementException {
+	    try {
+		currKey = nextKey;
+		if (currKey == null)
+		    throw new NoSuchElementException();
+		else
+		    nextKey = getNextKeyRaw(currKey);
+		return keyPacking.fromBytes(currKey);
+	    } catch ( GdbmException e ) {
+		// Can't propagate this through java.util.Enumeration, dammit
+		throw new NoSuchElementException();
+	    }
+	}
+    }
+
+    /** Start a visit to all keys in the hashtable, using raw data values.
+     *
+     * @return the first key in the hash table as a byte array; or null if
+     * the database is empty. */
+    byte[] getFirstKeyRaw() throws GdbmException
+    {
+	return gdbm_firstkey(dbf);
+    }
+
+    /** Return the first record in the hashtable.
+     *
+     * <P>Note that the database
+     * is not ordered, so the key returned is simply the first in the
+     * hashtable and effectively randomly selected.
+     *
+     * @return the first key in the hash table; or null if
+     * the database is empty.
+     *
+     * @see GdbmFile#getNextKey(java.lang.Object)
+     * @see GdbmFile#keys()
+     **/
+    Object getFirstKey() throws GdbmException
+    {
+	return keyPacking.fromBytes(getFirstKeyRaw());
+    }
+
+
+    /** Find and read the next key in the hashtable.
+     *
+     * @return the next key; or null if <EM>keyBytes</EM> is the last key
+     * in the hashtable.
+     **/
+    byte[] getNextKeyRaw(byte[] keyBytes) throws GdbmException
+    {
+	return gdbm_nextkey(dbf, keyBytes);
+    }
+
+
+    /** Check whether the database is empty.
+     *
+     * @return true if the database contains no records; otherwise
+     * false.
+     **/
+    public boolean isEmpty() throws GdbmException
+    {
+	return getFirstKeyRaw() == null;
+    }
+
+
+    /** Count the records in the database.
+     *
+     * <P>This is implemented by iterating over the database, and so is
+     * a fairly expensive operation.
+     *
+     * <P>This method locks the database to make sure the count is
+     * accurate.
+     *
+     * @return the number of records in the database
+     * @see GdbmFile#isEmpty()
+     **/
+    public synchronized int size() throws GdbmException
+    {
+	int s = 0;
+	byte[] key = getFirstKeyRaw();
+	while (key != null) {
+	    s++;
+	    key = getNextKeyRaw(key);
+	}
+	return s;
+    }
+
+
+    static {
+	String libraryFile = System.getProperty
+	    ("au.com.pharos.gdbm.libraryFile");
+
+	if (libraryFile != null) {
+	    System.load(libraryFile);
+	} else {
+	    System.loadLibrary("gdbmjava");
+	}
+    }
+
+    private synchronized native long
+    gdbm_open(String fileName, int flags)
+	 throws GdbmException;
+
+    private synchronized native void
+    gdbm_close(long dbf);
+
+    private synchronized native void
+    gdbm_store(long dbf,
+	       byte[] key,
+	       byte[] content,
+	       boolean replace);
+
+    private synchronized native byte[]
+    gdbm_fetch(long dbf,
+	       byte[] key);
+
+    private synchronized native boolean
+    gdbm_exists(long dbf,
+		byte[] key);
+
+    private synchronized native void
+    gdbm_delete(long dbf,
+		byte[] key);
+
+    private synchronized native byte[]
+    gdbm_firstkey(long dbf)
+	 throws GdbmException;
+
+    private synchronized native byte[]
+    gdbm_nextkey(long dbf, byte[] key)
+	 throws GdbmException;
+
+    private synchronized static native String
+    gdbm_getversion();
+
+    private synchronized static native String
+    gdbm_wrapperVersion();
+
+    private synchronized native void
+    gdbm_reorganize(long dbf);
+
+    private synchronized native void
+    gdbm_sync(long dbf);
+}
Index: /trunk/gsdl3/packages/javagdbm/java/au/com/pharos/gdbm/GdbmTest.java
===================================================================
--- /trunk/gsdl3/packages/javagdbm/java/au/com/pharos/gdbm/GdbmTest.java	(revision 10737)
+++ /trunk/gsdl3/packages/javagdbm/java/au/com/pharos/gdbm/GdbmTest.java	(revision 10737)
@@ -0,0 +1,296 @@
+/*
+ * module: pip/java/gdbm -- A Java interface to the GDBM library
+ * class:  GdbmTest -- Test suite for this package
+ * Copyright (C) 1997 Pharos IP Pty Ltd
+ * $Id$
+ *
+ *  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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package au.com.pharos.gdbm;
+
+import java.io.PrintStream;
+
+import java.util.Enumeration;
+
+import au.com.pharos.test.Test;
+import au.com.pharos.packing.Packing;
+import au.com.pharos.packing.StringPacking;
+import au.com.pharos.packing.RawPacking;
+
+/** Test harness for the Gdbm library.
+ *
+ * <P>The source of this class forms a useful demonstration of the
+ * JavaGDBM library and is commended to the intending programmer.
+ *
+ * <P>More test cases would be very welcome.
+ *
+ * @see au.com.pharos.gdbm.GdbmFile
+ * @see au.com.pharos.packing.Packing
+ * @author Martin Pool
+ * @version $Revision$
+ */
+public class GdbmTest {
+    // Don't instantiate
+    private GdbmTest() { ; }
+    
+    private static void testLongData(GdbmFile db)
+	 throws Exception
+    {
+	StringBuffer lgBuffer = new StringBuffer();
+	for (int i = 0; i < 100; i++)
+	    lgBuffer.append("ABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890" +
+			    "ABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890" +
+			    "ABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890");
+
+	String lgString = lgBuffer.toString();
+	lgBuffer = null;
+	String smallKey = "largeDatum";
+
+	db.store(smallKey, lgString);
+	String retr = (String) db.fetch(smallKey);
+
+	Test.ok(9, retr.hashCode() == lgString.hashCode());
+	Test.ok(10, retr.equals(lgString));
+
+	db.delete(smallKey);
+	Test.ok(11, true);
+
+	db.reorganize();
+	Test.ok(12, true);
+    }
+
+
+    static final int MANY_RECORDS = 200;
+    
+    private static void testBigFile(GdbmFile db)
+	 throws Exception
+    {
+	String key;
+
+	// Test a lot of data
+	byte[] bigData = new byte[10000];
+	for (int i = 0; i < bigData.length; i++)
+	    bigData[i] = (byte)((i & 63) + 32);
+	db.setValuePacking(new RawPacking());
+	Test.ok(150, true);
+
+	// Store a series of records in the file
+	for (int i = 0; i < MANY_RECORDS; i++) {
+	    if ((i % 100) == 0)
+		System.out.print(Integer.toString(i)+ " ");
+	    db.store(Integer.toString(i, 16), bigData);
+	}
+	System.out.println();
+	Test.ok(151, true);
+
+	// Enumerate keys and values out of the file
+	int count = 0;
+	Enumeration keys = db.keys();
+	while ( keys.hasMoreElements() ) {
+	    key = (String) keys.nextElement();
+	    count++;
+	    if ((count % 100) == 0)
+		System.out.print(Integer.toString(count)+ " ");
+	}
+	System.out.println();
+	Test.ok(152, count==MANY_RECORDS);
+
+	// Delete all the records from the file
+	count = 0;
+	while ( (key = (String) db.getFirstKey()) != null ) {
+	    db.delete(key);
+	    count++;
+	    if ((count % 100) == 0)
+		System.out.print(Integer.toString(count)+ " ");
+	}
+	System.out.println();
+	Test.ok(153, count==MANY_RECORDS);
+
+	db.reorganize();
+	Test.ok(154, true);
+    }
+
+    public static void main(String[] argv) {
+	try {
+	    final String dbFile = "/tmp/java.gdbm";
+	    String key, value;
+	    boolean found;
+
+	    // Test cases, inspired by db-hash.t in the Perl5.003_93
+	    // distribution
+	    System.out.print("GDBM Database tests:\n\t" +
+			     GdbmFile.getLibraryVersion() + "\n\t" +
+			     GdbmFile.getWrapperVersion() + "\n");
+
+	    // Create a simple database
+	    GdbmFile db = new GdbmFile(dbFile, GdbmFile.NEWDB);
+	    Test.ok(1, db != null);
+
+	    // Set the packing strategy
+	    db.setKeyPacking(new StringPacking());
+	    db.setValuePacking(new StringPacking());
+
+	    // Store some data in the file
+	    db.store("mountain", "Kosciusko");
+	    Test.ok(2, true);
+
+	    // Store and read back data
+	    db.storeNoReplace("abc", "ABC");
+	    Test.ok(3, ((String) db.fetch("abc")).equals("ABC"));
+
+	    // Check whether keys exist or not
+	    Test.ok(4, db.exists("abc"));
+	    Test.ok(5, !db.exists("jimmy"));
+	    Test.ok(6, !db.exists("abc\0"));
+
+	    // Delete those records
+	    db.delete("abc");
+	    db.delete("mountain");
+
+	    Test.ok(10, !db.exists("abc"));
+	    Test.ok(11, !db.exists("mountain"));
+
+	    // Store a series of records in the file
+	    for (int i = 100; i < 200; i++)
+		db.storeNoReplace(Integer.toString(i, Character.MAX_RADIX),
+				  Integer.toString(i, Character.MIN_RADIX));
+
+	    // Enumerate keys and values out of the file
+	    int count = 0;
+	    Enumeration keys = db.keys();
+	    while ( keys.hasMoreElements() ) {
+		key = (String) keys.nextElement();
+		// System.out.print(key + "=");
+		// value = (String) db.fetch(key);
+		// System.out.println(value);
+		count++;
+	    }
+	    Test.ok(20, count==100);
+
+	    // Delete all the records from the file
+	    count = 0;
+	    while ( (key = (String) db.getFirstKey()) != null ) {
+		db.delete(key);
+		count++;
+	    }
+	    Test.ok(30, count==100);
+
+	    // Try to fetch a non-existent key
+	    boolean caught = false;
+	    try {
+		db.fetch("larry!");
+	    } catch ( GdbmException e ) {
+		// TODO: Check the exception was the one we expected?
+		caught = true;
+	    }
+	    Test.ok(40, caught);
+
+	    // Store some very large data
+	    testLongData(db);
+
+	    // Store strings containing non-ASCII characters
+	    final String euroString = "Some funny characters: «¡ æ ø â ß !»";
+	    db.store("high ASCII", euroString);
+	    Test.ok(50, db.fetch("high ASCII").equals(euroString));
+
+	    // Close the database
+	    db.close();
+	    Test.ok(60, true);
+
+	    // Try to read from a database that is closed
+	    caught = false;
+	    try {
+		db.fetch("larry!");
+	    } catch ( Exception e ) {
+		System.out.println("caught: " + e.toString());
+		caught = true;
+	    }
+	    Test.ok(70, caught);
+
+	    // Try to open a non-existent database
+	    caught = false;
+	    try {
+		db = new GdbmFile("/tmp/somenonexistentdatabase.gdbm",
+				  GdbmFile.READER);
+	    } catch ( GdbmException e ) {
+		System.out.println("caught: " + e.toString());
+		caught = true;
+	    }
+	    Test.ok(80, caught);
+
+	    // Open a database read-only
+	    db = new GdbmFile(dbFile, GdbmFile.READER);
+	    db.setKeyPacking(new StringPacking());
+	    db.setValuePacking(new StringPacking());
+	    Test.ok(90);
+
+	    // Try to insert
+	    caught = false;
+	    try {
+		db.store("apple", "crumble");
+	    } catch ( GdbmException e ) {
+		System.out.println("caught: " + e.toString());
+		caught = true;
+	    }
+	    Test.ok(91, caught);
+
+	    // Replace an existing database
+	    db.close();
+	    db = new GdbmFile(dbFile, GdbmFile.NEWDB);
+	    db.setKeyPacking(new StringPacking());
+	    db.setValuePacking(new StringPacking());
+	    Test.ok(100, !db.exists("camel"));
+
+	    // Sync to disk
+	    db.sync();
+	    Test.ok(105, true);
+
+	    // Juggle three databases at once
+	    final String dbFile2 = "/tmp/java2.gdbm";
+	    GdbmFile db2 = new GdbmFile(dbFile2, GdbmFile.NEWDB);
+	    final String dbFile3 = "/tmp/java3.gdbm";
+	    GdbmFile db3 = new GdbmFile(dbFile3, GdbmFile.NEWDB);
+	    Test.ok(110, true);
+
+	    keys = db.keys();
+	    while (keys.hasMoreElements()) {
+		key = (String) keys.nextElement();
+		value = (String) db.fetch(key);
+		db2.store(key.getBytes(), value.getBytes());
+		db3.store(key.getBytes(), value.getBytes());
+	    }
+	    Test.ok(120, true);
+
+	    keys = db2.keys();
+	    found = true;
+	    while (keys.hasMoreElements())
+		found &= db3.exists(keys.nextElement());
+	    Test.ok(130, found);
+
+	    db2.close();
+	    db3.close();
+
+	    Test.ok(140, true);
+
+	    testBigFile(db);
+
+	    db.close();
+	    Test.ok(160, true);
+	} catch (Exception e) {
+	    e.printStackTrace();
+	}
+    }
+}
Index: /trunk/gsdl3/packages/javagdbm/java/au/com/pharos/io/IOUtils.java
===================================================================
--- /trunk/gsdl3/packages/javagdbm/java/au/com/pharos/io/IOUtils.java	(revision 10737)
+++ /trunk/gsdl3/packages/javagdbm/java/au/com/pharos/io/IOUtils.java	(revision 10737)
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 1997 by Pharos IP Pty Ltd
+ * All rights reserved.
+ * $Id$
+ */
+
+package au.com.pharos.io;
+
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.IOException;
+
+/**
+ * Plumbing utilities for manipulating Java IO classes.
+ *
+ * <P>These utilities really ought to be part of the
+ * <CODE>java.io</CODE> package, but they're not.  Since they're
+ * pretty useful, here they are.
+ *
+ * @version $Revision$
+ * @author Martin Pool
+ **/
+public class IOUtils {
+    /** Size of blocks to read during IO. **/
+    static public final int BLOCK_SIZE = 4<<10;
+
+    static public void pumpStream(InputStream inStream,
+				  OutputStream outStream,
+				  int contentLength)
+	 throws IOException
+    {
+	int readBytes = 0;
+	byte[] block = new byte[BLOCK_SIZE];
+	int blockBytes;
+	while (readBytes < contentLength
+	       && (blockBytes = inStream.read(block)) > 0) {
+	    readBytes += blockBytes;
+	    outStream.write(block, 0, blockBytes);
+	}
+    }
+
+    static public int pumpStream(InputStream inStream,
+				 OutputStream outStream)
+	 throws IOException
+    {
+	byte[] block = new byte[BLOCK_SIZE];
+	int blockBytes, readBytes = 0;
+	while ( (blockBytes = inStream.read(block)) > 0 ) {
+	    outStream.write(block, 0, blockBytes);
+	    readBytes += blockBytes;
+	}
+	return readBytes;
+    }
+
+    /** Reads the entire contents of the stream into a
+     * newly-constructed byte array.
+     **/
+    static public byte[] readAll(InputStream inStream)
+	 throws IOException
+    {
+	ByteArrayOutputStream byteStream = new ByteArrayOutputStream();
+	pumpStream(inStream, byteStream);
+	byte[] buf = byteStream.toByteArray();
+	byteStream.close();
+	return buf;
+    }
+}
Index: /trunk/gsdl3/packages/javagdbm/java/au/com/pharos/meta/SerializationDumper.java
===================================================================
--- /trunk/gsdl3/packages/javagdbm/java/au/com/pharos/meta/SerializationDumper.java	(revision 10737)
+++ /trunk/gsdl3/packages/javagdbm/java/au/com/pharos/meta/SerializationDumper.java	(revision 10737)
@@ -0,0 +1,171 @@
+/*
+ * Copyright (C) 1997 Pharos IP Pty Ltd
+ * $Id$
+ * Confidential. All rights reserved.
+ */
+
+package au.com.pharos.meta;
+
+import java.lang.reflect.Field;
+
+import java.io.EOFException;
+import java.io.IOException;
+import java.io.InvalidClassException;
+import java.io.InvalidObjectException;
+import java.io.ObjectInput;
+import java.io.ObjectInputStream;
+import java.io.ObjectStreamException;
+import java.io.OptionalDataException;
+import java.io.PrintWriter;
+
+/*
+ * TODO: Allow people to specify an input file?
+ * TODO: Allow people to customize the display format?
+ *
+ * FIXME: We should use a custom classloader to load the untrusted
+ * classes under examination and to allow for flexible handling or
+ * tracing as classes are loaded.
+ */
+
+
+/** Java utility to display in a debugging format the contents of a
+ * serialized object stream.
+ *
+ * <P>Usage:
+ * <PRE>
+ *   java au.com.pharos.meta.SerializationDumper <SERFILE
+ * </PRE>
+ *
+ * where SERFILE is the name of the serialization file.
+ *
+ * <P><B>Limitations:</B>
+ *
+ * <OL>
+ *   <P><LI>Values are displayed only for public fields, due to Java
+ *    security restrictions.
+ *   <P><LI>Only top-level objects are dumped.
+ * </OL>
+ *
+ * <P>These are fairly serious restrictions, but SerializationDumper
+ * at least checks that the stream is well-formed, and gives some
+ * indication of what it contains.
+ *
+ * @author Martin Pool
+ * @version $Revision$
+ **/
+public class SerializationDumper {
+    public static void main(String argv[])
+    {
+	try {
+	    ObjectInput in = new ObjectInputStream(System.in);
+	    PrintWriter writer = new PrintWriter(System.out);
+	    SerializationDumper dumper = new SerializationDumper();
+	    dumper.dump(in, writer);
+	    writer.flush();
+	} catch (IOException e) {
+	    e.printStackTrace();
+	}
+    }
+
+
+    /** Dump all objects read from <EM>in</EM> to <EM>out</EM>
+     * in a human-readable debugging form.
+     **/
+    public void dump(ObjectInput in, PrintWriter out)
+	 throws IOException
+    {
+	while (true) {		// exception on eof
+	    Object obj = null;
+	    try {
+		obj = in.readObject();
+		displayObject(obj, out);
+	    }
+	    catch (ClassNotFoundException e) {
+		warning(e, out);
+	    }
+	    catch (OptionalDataException e) {
+		error(e, out);
+		return;
+	    }
+	    catch (ObjectStreamException e) {
+		warning(e, out);
+	    }
+	    catch (EOFException e) {
+		return;
+	    }
+	}
+    }
+
+
+    /** Display an object in human-readable form. **/
+    private void displayObject(Object obj, PrintWriter out)
+	 throws IOException
+    {
+	if (obj == null) {
+	    out.println("(null)");
+	    return;
+	}
+
+	Class cls = obj.getClass();
+
+	// Print the header: the name, hashcode, and string
+	// representation
+	out.println(cls.getName() + "@0x" +
+		    Integer.toHexString(obj.hashCode()) + "{");
+	out.println("\t\"" + obj.toString() + "\"");
+
+	// TODO: Recursive descent of the graph, allowing for circular
+	// structures.
+
+	// Print each field of the object
+	Field[] fields = cls.getDeclaredFields();
+	for (int i = 0; i < fields.length; i++)
+	    displayField(obj, fields[i], out);
+
+	out.println("}");
+    }
+
+
+    /** Display a particular field from an object in human-readable
+      * form.  Fields which are not accessible for security reasons
+      * are noted as such, and the name and type of the field is
+      * still printed. **/
+    private void displayField(Object obj, Field fld, PrintWriter out)
+	 throws IOException
+    {
+	int flags = fld.getModifiers();
+	out.print("\t");
+	out.print(fld.toString() + ": ");
+	try {
+	    Object value = fld.get(obj);
+	    if (value == null) {
+		out.println("(null)");
+	    }
+	    else {
+		out.println(value.getClass().getName() + "@0x" +
+			    Integer.toHexString(value.hashCode()) + ":");
+		out.println("\t\t\"" + value.toString() + "\"");
+	    }
+	} catch (IllegalAccessException e) {
+	    out.println("(not accessible)");
+	}
+    }
+
+
+    /** Display a warning that an exception occurred while dumping
+     * information. **/
+    private void warning(Exception e, PrintWriter out)
+	 throws IOException
+    {
+	out.println("warning: " + e);
+    }
+
+    /** Display an exception that occurred while dumping
+     * information. **/
+    private void error(Exception e, PrintWriter out)
+	 throws IOException
+    {
+	out.println("error: " + e.toString());
+    }
+}
+
Index: /trunk/gsdl3/packages/javagdbm/java/au/com/pharos/meta/ShowClass.java
===================================================================
--- /trunk/gsdl3/packages/javagdbm/java/au/com/pharos/meta/ShowClass.java	(revision 10737)
+++ /trunk/gsdl3/packages/javagdbm/java/au/com/pharos/meta/ShowClass.java	(revision 10737)
@@ -0,0 +1,118 @@
+// This example is from the book "Java in a Nutshell, Second Edition".
+// Written by David Flanagan.  Copyright (c) 1997 O'Reilly & Associates.
+// You may distribute this source code for non-commercial purposes only.
+// You may study, modify, and use this example for any purpose, as long as
+// this notice is retained.  Note that this example is provided "as is",
+// WITHOUT WARRANTY of any kind either expressed or implied.
+
+import java.lang.reflect.*;
+
+/** A program that displays a class synopsis for the named class */
+public class ShowClass {
+  /** The main method.  Print info about the named class */
+  public static void main(String[] args) throws ClassNotFoundException {
+    Class c = Class.forName(args[0]);
+    print_class(c);
+  }
+
+  /** Display the modifiers, name, superclass and interfaces of a class
+   *  or interface. Then go and list all constructors, fields, and methods. */
+  public static void print_class(Class c)
+  {
+    // Print modifiers, type (class or interface), name and superclass.
+    if (c.isInterface()) {
+      // The modifiers will include the "interface" keyword here...
+      System.out.print(Modifier.toString(c.getModifiers()) +  c.getName());
+    }
+    else
+      System.out.print(Modifier.toString(c.getModifiers()) + " class " +
+                       c.getName() +
+                       " extends " + c.getSuperclass().getName());
+
+    // Print interfaces or super-interfaces of the class or interface.
+    Class[] interfaces = c.getInterfaces();
+    if ((interfaces != null) && (interfaces.length > 0)) {
+      if (c.isInterface()) System.out.println(" extends ");
+      else System.out.print(" implements ");
+      for(int i = 0; i < interfaces.length; i++) {
+        if (i > 0) System.out.print(", ");
+        System.out.print(interfaces[i].getName());
+      }
+    }
+
+    System.out.println(" {");            // Begin class member listing.
+
+    // Now look up and display the members of the class.
+    System.out.println(" // Constructors");
+    Constructor[] constructors = c.getDeclaredConstructors();
+    for(int i = 0; i < constructors.length; i++)      // Display constructors.
+      print_method_or_constructor(constructors[i]);
+
+    System.out.println(" // Fields");
+    Field[] fields = c.getDeclaredFields();           // Look up fields.
+    for(int i = 0; i < fields.length; i++)            // Display them.
+      print_field(fields[i]);
+
+    System.out.println(" // Methods");
+    Method[] methods = c.getDeclaredMethods();        // Look up methods.
+    for(int i = 0; i < methods.length; i++)           // Display them.
+      print_method_or_constructor(methods[i]);
+
+    System.out.println("}");             // End class member listing.
+  }
+
+  /** Return the name of an interface or primitive type, handling arrays. */
+  public static String typename(Class t) {
+    String brackets = "";
+    while(t.isArray()) {
+      brackets += "[]";
+      t = t.getComponentType();
+    }
+    return t.getName() + brackets;
+  }
+
+  /** Return a string version of modifiers, handling spaces nicely. */
+  public static String modifiers(int m) {
+    if (m == 0) return "";
+    else return Modifier.toString(m) + " ";
+  }
+
+  /** Print the modifiers, type, and name of a field */
+  public static void print_field(Field f) {
+    System.out.println("  " +
+                       modifiers(f.getModifiers()) +
+                       typename(f.getType()) + " " + f.getName() + ";");
+  }
+
+  /** Print the modifiers, return type, name, parameter types and exception
+   *  type of a method or constructor.  Note the use of the Member interface
+   *  to allow this method to work with both Method and Constructor objects */
+  public static void print_method_or_constructor(Member member) {
+    Class returntype=null, parameters[], exceptions[];
+    if (member instanceof Method) {
+      Method m = (Method) member;
+      returntype = m.getReturnType();
+      parameters = m.getParameterTypes();
+      exceptions = m.getExceptionTypes();
+    } else {
+      Constructor c = (Constructor) member;
+      parameters = c.getParameterTypes();
+      exceptions = c.getExceptionTypes();
+    }
+
+    System.out.print("  " + modifiers(member.getModifiers()) +
+                     ((returntype!=null)? typename(returntype)+" " : "") +
+                     member.getName() + "(");
+    for(int i = 0; i < parameters.length; i++) {
+      if (i > 0) System.out.print(", ");
+      System.out.print(typename(parameters[i]));
+    }
+    System.out.print(")");
+    if (exceptions.length > 0) System.out.print(" throws ");
+    for(int i = 0; i < exceptions.length; i++) {
+      if (i > 0) System.out.print(", ");
+      System.out.print(typename(exceptions[i]));
+    }
+    System.out.println(";");
+  }
+}
Index: /trunk/gsdl3/packages/javagdbm/java/au/com/pharos/packing/NativeStringPacking.java
===================================================================
--- /trunk/gsdl3/packages/javagdbm/java/au/com/pharos/packing/NativeStringPacking.java	(revision 10737)
+++ /trunk/gsdl3/packages/javagdbm/java/au/com/pharos/packing/NativeStringPacking.java	(revision 10737)
@@ -0,0 +1,82 @@
+/*
+ * module: pip/java/packing -- Strategy objects for converting
+ * Java objects to and from stored data.
+ *
+ * Copyright (C) 1997 Pharos IP Pty Ltd
+ * $Id$
+ *
+ *  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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package au.com.pharos.packing;
+
+/** Convert an array of bytes in a Java string without using String
+ * encodings, just using expanding 8-bit bytes to 16-bit chars.
+ *
+ * <P>This will only work for ASCII characters, of course, but for
+ * moving bulk data around it is considerably faster than using
+ * UTF-8 encoding strategies.  Naively compressing Unicode into
+ * 8-bit characters in this manner is deprecated in JDK1.1 to
+ * help ensure that programs are Unicode-safe.
+ *
+ * @author Martin Pool
+ * @version $Revision$
+ *
+ * @see au.com.pharos.packing.Packing
+ * @see au.com.pharos.packing.StringPacking
+ */
+public class NativeStringPacking extends Packing
+{
+    /** Convert an object to an ASCII String representation.
+     *
+     * @return null if obj is null; obj is obj is already a
+     * byte[]; otherwise an native 8-bite encoded version of
+     * obj.toString().
+     **/
+    public byte[] toBytes(final Object obj)
+    {
+	String str;
+	if (obj == null)
+	    return null;
+	else if (obj instanceof byte[])
+	    return (byte[]) obj;
+	else if (obj instanceof String)
+	    str = (String) obj;
+	else
+	    str = obj.toString();
+
+	int len = str.length();
+	byte[] rawArray = new byte[len];
+	str.getBytes(0, len, rawArray, 0);
+	return rawArray;		     
+    }
+
+    /** Convert an array of bytes into a String
+     *
+     * @param raw the raw data to be decoded.
+     *
+     * @return null if <em>raw</em> is null; otherwise a string with the low
+     * 8 bits of each character taken from the corresponding byte in
+     * <em>raw</em>.
+     **/
+    public Object fromBytes(final byte[] raw)
+    {
+	if (raw == null)
+	    return null;
+	else
+	    return new String(raw, 0);
+    }
+}
+    
Index: /trunk/gsdl3/packages/javagdbm/java/au/com/pharos/packing/Packing.java
===================================================================
--- /trunk/gsdl3/packages/javagdbm/java/au/com/pharos/packing/Packing.java	(revision 10737)
+++ /trunk/gsdl3/packages/javagdbm/java/au/com/pharos/packing/Packing.java	(revision 10737)
@@ -0,0 +1,77 @@
+/*
+ * module: pip/java/packing -- Packing strategy objects for converting
+ *           Java objects to and from stored data.
+ * class: Packing -- Abstract strategy class for packing/unpacking data
+ *
+ * $Id$
+ * Copyright (C) 1997 Pharos IP Pty Ltd
+ *
+ *  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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package au.com.pharos.packing;
+
+/** A packing Packing defines a method of converting an object to
+ * and from an array of bytes for storage in a database.
+ *
+ * <P>Generally, each packing Packing should be reflexive: that is,
+ * converting any object to and from an array of bytes should yield
+ * the same object, or an object appropriately equivalent.
+ *
+ * <P>Some Packing subclasses may not be able to pack all
+ * objects, or may not be able to unpack an object from some byte
+ * arrays.  For example, only Strings can safely be stored as string
+ * representations, and not all arrays are valid Java serialization
+ * forms.  In this case, the Packing object should throw an
+ * <code>IllegalArgumentException</code> from <code>toBytes()</code>
+ * or <code>toBytes()</code>.
+ *
+ * <P>In both cases, null references should be passed through
+ * unchanged.
+ *
+ * <P>Example:
+ * <PRE>
+ *    Packing strategy = new StringPacking();
+ *    byte[] raw = strategy.toBytes("Hello world");
+ *    ... store and retrieve raw[]
+ *    String result = (String) strategy.fromBytes(raw)
+ * </PRE>
+ *
+ *
+ * @see au.com.pharos.packing.StringPacking
+ * @see au.com.pharos.packing.NativeStringPacking
+ * @see au.com.pharos.packing.RawPacking
+ * @see au.com.pharos.packing.SerializationPacking
+ *
+ * @version $Revision$
+ * @author Martin Pool
+ **/
+public abstract class Packing {
+    /** Convert an object to an array of bytes. **/
+    public abstract byte[] toBytes(Object obj) throws IllegalArgumentException;
+
+    /** Reconstitute an array of bytes into an object. **/
+    public abstract Object fromBytes(byte[] raw) throws IllegalArgumentException;
+
+    /** Helper function that generates an IllegalArgumentException */
+    protected IllegalArgumentException cantConvert(Object obj) {
+	return new IllegalArgumentException
+	    ("Can't pack object \"" + obj.toString() +
+	     "\" (" + obj.getClass().toString() + ")" + 
+	     "\n\tusing strategy " + this.toString());
+    }
+}
+
+    
Index: /trunk/gsdl3/packages/javagdbm/java/au/com/pharos/packing/QuotedVectorPacking.java
===================================================================
--- /trunk/gsdl3/packages/javagdbm/java/au/com/pharos/packing/QuotedVectorPacking.java	(revision 10737)
+++ /trunk/gsdl3/packages/javagdbm/java/au/com/pharos/packing/QuotedVectorPacking.java	(revision 10737)
@@ -0,0 +1,187 @@
+/*
+ * module: pip/java/packing -- Strategy objects for converting
+ *         Java objects to and from stored data.
+ * class:  QuotedVectorPacking -- Vectors of Strings packed in a Perl-
+ *         style format
+ *
+ * Copyright (C) 1997 Pharos IP Pty Ltd
+ * $Id$
+ *
+ *  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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package au.com.pharos.packing;
+
+import java.util.Vector;
+
+// FIXME: Escape bad characters! -- mbp
+// TODO: Write a more formal definition of the encoding system
+// TODO: More documentation
+
+// XXX: Perhaps the strategy for encoding characters should be in a
+// separate class used by this class?  They would have to
+// interact to make sure that separator chatacters were decoded
+// properly.  Probably not worth worrying about, as this class
+// is only a compatibility measure in any case.
+
+/** Stores Vectors of strings, packed into a single string, as used by
+ * some Perl code.  The encoding format is similar to that used in
+ * Unix databases like
+ * <A HREF="file:/etc/passwd/"><CODE>/etc/passwd</CODE></A>, except that
+ * it uses escape sequences to represent characters that would
+ * normally not be allowed.
+ *
+ * <P>The strings within the vector are separated by separator characters,
+ * which default to colons.
+ *
+ * <P>The resulting packed string is UTF encoded after escaping
+ * control-characters, so non-ASCII characters should be passed through
+ * unchanged.
+ *
+ * <P>Certain characters are escaped as quoted-printable strings.
+ * These characters include colon, equals, and escape characters.  The
+ * encoding accepts and interprets any hex escape when reading data.
+ *
+ * <P>If any elements of the vector are null, they are stored as empty
+ * strings.  On unpacking, empty strings are returned as such.
+ *
+ * <P>An example of a vector encoded in this manner is:
+ * <BLOCKQUOTE>
+ * <PRE>oC7okz059wGnQ:vf:Peter Barnes%2c Pharos Business Solutions</PRE>
+ * </BLOCKQUOTE>
+ *
+ * @author Martin Pool
+ * @version $Revision$ $Date$
+ *
+ * @see java.util.Vector
+ **/
+public class QuotedVectorPacking extends Packing
+implements java.io.Serializable
+{
+    private char hexEscape;
+    private char separator;
+    
+    /** Constructs a QuotedVectorPacking using the default separator
+     * character ':' and escape character '%'.
+     **/
+    public QuotedVectorPacking() {
+	this('%', ':');
+    }
+
+
+    /** Constructs a QuotedVectorPacking with specified separator and
+     * hex-escape characters.
+     *
+     * @param hexEscape the character used to begin a three-character
+     * hex escape
+     *
+     * @param separator the character used to separate elements in the
+     * vector.
+     **/
+    public QuotedVectorPacking(char hexEscape, char separator) {
+	if (hexEscape == separator)
+	    throw new IllegalArgumentException
+		("hexEscape and separator characters are the same");
+	this.hexEscape = hexEscape;
+	this.separator = separator;
+    }
+    
+    
+    /** Convert a Vector of Strings to a QuotedVector represented as an
+     * array of bytes.
+     *
+     * @param obj the Vector to encode; or null.
+     * 
+     * @returns an array of bytes containing a packed representation of
+     * <EM>obj</EM>; or null if <EM>obj</EM> is null.
+     *
+     * @exception java.lang.ClassCastException if obj is not a Vector
+     * or null; or if any element of <EM>obj</EM> is not a String or
+     * null.
+     **/
+    public byte[] toBytes(Object obj)
+    {
+	if (obj == null)
+	    return null;
+	Vector vec = (Vector) obj;
+	StringBuffer sb = new StringBuffer();
+	Object elem;
+	for (int i = 0; i < vec.size(); i++) {
+	    if (i > 0)
+		sb.append(separator);
+	    elem = vec.elementAt(i);
+	    sb.append((elem == null) ? "" : encodeString((String) elem));
+	}
+	return sb.toString().getBytes();
+    }
+
+
+
+    /** Perform hex-escapes on a string.
+     * @returns <EM>from</EM> encoded as a quoted-printable string
+     **/
+    private String encodeString(String from) {
+	StringBuffer buf = new StringBuffer(from.length());
+	char[] chars = from.toCharArray();
+	for (int i = 0; i < chars.length; i++) {
+	    char ch = chars[i];
+	    if (ch == separator
+		|| ch == hexEscape
+		|| Character.isISOControl(ch)
+		|| (ch != ' ' && ch != '\t' && Character.isWhitespace(ch)))
+		{
+		    buf.append(hexEscape);
+		    // XXX: This will truncate high Unicode characters, but I
+		    // don't know what else we can do with them. -- mbp
+		    buf.append(Character.forDigit((ch>>4) & 0xf, 16));
+		    buf.append(Character.forDigit(ch      & 0xf, 16));
+		} else {
+		    buf.append(ch);
+		}
+	}
+	return buf.toString();
+    }
+    
+    
+
+    /** Interprets <em>raw</em> as a packed quoted Vector, and
+     * returns the unpacked Vector of strings. */
+    public Object fromBytes(byte[] raw)
+    {
+	if (raw == null)
+	    return null;
+	
+	Vector result = new Vector();
+	StringBuffer sb = new StringBuffer();
+	for (int i = 0; i < raw.length; i++) {
+	    char ch = (char) raw[i];
+	    if (ch == separator) {
+		result.addElement(sb.toString());
+		sb.setLength(0);
+	    } else if (ch == hexEscape && i < (raw.length - 2)) {
+		byte[] hexBytes = new byte[2];
+		hexBytes[0] = raw[++i];
+		hexBytes[1] = raw[++i];
+		String hex = new String(hexBytes);
+		ch = (char)Integer.parseInt(hex, 16);
+		sb.append(ch);
+	    } else {
+		sb.append(ch);
+	    }
+	}
+	result.addElement(sb.toString());
+	return result;
+    }
+}
Index: /trunk/gsdl3/packages/javagdbm/java/au/com/pharos/packing/RawPacking.java
===================================================================
--- /trunk/gsdl3/packages/javagdbm/java/au/com/pharos/packing/RawPacking.java	(revision 10737)
+++ /trunk/gsdl3/packages/javagdbm/java/au/com/pharos/packing/RawPacking.java	(revision 10737)
@@ -0,0 +1,60 @@
+/*
+ * module: pip/java/packing -- Strategy objects for converting
+ * Java objects to and from stored data.
+ *
+ * Copyright (C) 1997 Pharos IP Pty Ltd
+ * $Id$
+ *
+ *  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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package au.com.pharos.packing;
+
+/** A packing strategy which stores only raw arrays of bytes.  Other
+ * objects cannot be stored using this strategy.
+ *
+ * @author Martin Pool
+ * @version $Revision$
+ **/
+public class RawPacking extends Packing implements java.io.Serializable
+{
+    /** Perform the trivial packing case, casting an array of bytes
+     * into the same.
+     *
+     * @throw IllegalArgumentException if <em>obj</em> is neith null nor
+     * an array of bytes.
+     */
+    public byte[] toBytes(Object obj) throws IllegalArgumentException
+    {
+	if (obj == null)
+	    return null;
+	else if (obj instanceof byte[])
+	    return (byte[]) obj;
+	else
+	    throw cantConvert(obj);
+    }
+
+    /** Performs the trivial unpacking case of returning <em>raw</em>
+     * untouched.
+     *
+     * @return either null or <em>raw</em>; always assignable to
+     * <code>byte[]</code>
+     **/
+    public Object fromBytes(byte[] raw)
+    {
+	return raw;
+    }
+}
+    
Index: /trunk/gsdl3/packages/javagdbm/java/au/com/pharos/packing/SerializationPacking.java
===================================================================
--- /trunk/gsdl3/packages/javagdbm/java/au/com/pharos/packing/SerializationPacking.java	(revision 10737)
+++ /trunk/gsdl3/packages/javagdbm/java/au/com/pharos/packing/SerializationPacking.java	(revision 10737)
@@ -0,0 +1,100 @@
+/*
+ * class: SerializationPacking -- Store an object as serialized data
+ *
+ * Copyright (C) 1997 Pharos IP Pty Ltd
+ * $Id$
+ *
+ *  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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package au.com.pharos.packing;
+
+import java.io.ByteArrayOutputStream;
+import java.io.ObjectOutputStream;
+import java.io.ByteArrayInputStream;
+import java.io.ObjectInputStream;
+import java.io.IOException;
+
+/** A packing strategy which stores and retrieves objects using
+ * <a href="http://www.javasoft.com/products/jdk/1.1/docs/guide/serialization/index.html">Java serialization</a>.
+ *
+ * @version $Revision$
+ * @author Martin Pool
+ * @see au.com.pharos.packing.Packing
+ **/
+public class SerializationPacking extends Packing
+implements java.io.Serializable
+{
+    /** Convert an object to a Java serialization format.
+     *
+     * @returns a buffer containing a a serialized representation of <em>obj</em>;
+     * or null if <em>obj</em> if null
+     * @exception IllegalArgumentException if <em>obj</em> (or any object
+     * referred to by <em>obj</em>) cannot be serialized
+     **/
+    public byte[] toBytes(Object obj) throws IllegalArgumentException
+    {
+	if (obj == null)
+	    return null;
+
+	// Serialize via a stream into a buffer
+	ByteArrayOutputStream byteStream = new ByteArrayOutputStream();
+	try {
+	    ObjectOutputStream objStream = new ObjectOutputStream(byteStream);
+	    objStream.writeObject(obj);
+	    // Don't close the stream, or you will lose the byte array
+	    objStream.flush();
+	} catch (IOException e) {
+	    throw new IllegalArgumentException("IOException during serialization: " +
+					       e.toString());
+	}
+
+	return byteStream.toByteArray();
+    }
+
+    /** Interprets <em>raw</em> as a Java serialization stream, and
+     * returns <B>the first</B> object read from that stream.
+     *
+     * <P><B>Note:</B>There is currently no means by which any later
+     * objects in the can be retrieved: it is assumed that the object
+     * written to the buffer contains references to all the
+     * information required.  This is consistent with the fact that
+     * toBytes() stores only a single object, so this packing strategy
+     * is completely reversable.
+     **/
+    // FIXME: Is the correct word 'reversable', 'reflexive', or
+    // something else?  -- mbp@pharos.com.au
+    public Object fromBytes(byte[] raw)
+    {
+	if (raw == null)
+	    return null;
+
+	Object obj;
+	try {
+	    ByteArrayInputStream byteStream = new ByteArrayInputStream(raw);
+	    ObjectInputStream objStream = new ObjectInputStream(byteStream);
+	    obj = objStream.readObject();
+	    objStream.close();
+	} catch (IOException e) {
+	    throw new IllegalArgumentException("Exception during deserialization: " +
+					       e.toString());
+	} catch (ClassNotFoundException e) {
+	    throw new IllegalArgumentException("Exception during deserialization: " +
+					       e.toString());
+	}	    
+	return obj;
+    }
+}
+    
Index: /trunk/gsdl3/packages/javagdbm/java/au/com/pharos/packing/StringPacking.java
===================================================================
--- /trunk/gsdl3/packages/javagdbm/java/au/com/pharos/packing/StringPacking.java	(revision 10737)
+++ /trunk/gsdl3/packages/javagdbm/java/au/com/pharos/packing/StringPacking.java	(revision 10737)
@@ -0,0 +1,85 @@
+/*
+ * module: pip/java/packing -- Strategy objects for converting
+ * Java objects to and from stored data.
+ *
+ * Copyright (C) 1997 Pharos IP Pty Ltd
+ * $Id$
+ *
+ *  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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package au.com.pharos.packing;
+
+/** StringPacking converts Java Strings to and from byte arrays
+ * using the default UTF-8 encoding.
+ *
+ * <P>For strings containing only ASCII-7 characters, this is
+ * equivalent to <code>NativeStringPacking</code> but probably
+ * somewhat slower.  However, it will safely handle non-ASCII
+ * characters, or unusual locales.
+ *
+ * @see au.com.pharos.packing.Packing
+ * @see au.com.pharos.packing.NativeStringPacking
+ **/
+public class StringPacking extends Packing
+implements java.io.Serializable
+{
+    /** Convert a String to an array of bytes using Java's default
+     * encoding.
+     *
+     * <P>If <em>obj</em> is not a String, array of bytes, or null
+     * then it's <code>toString()</code> method is called first to
+     * convert it to an array of bytes.  This will lose information in
+     * many cases.
+     *
+     * @param obj The object to convert.
+     *
+     * @return <em>obj</em> converted to an array of bytes; or null if
+     * <em>obj</em> is null.
+     **/
+    public byte[] toBytes(Object obj)
+    {
+	if (obj == null)
+	    return null;
+	else if (obj instanceof byte[])
+	    return (byte[]) obj;
+	else if (obj instanceof String)
+	    return ((String) obj).getBytes();
+	else
+	    return obj.toString().getBytes();
+    }
+
+    /** Decode an array of bytes using the default String encoding.
+     *
+     * @param raw An array of bytes to decode.
+     *
+     * @return A String representation of <em>raw</em>; or null if
+     * <em>raw</em> is null.
+     **/     
+    public Object fromBytes(byte[] raw)
+    {
+	if (raw == null)
+	    return null;
+	else {
+	    try{
+	    return new String(raw, "UTF-8");
+	    } catch (Exception e) {
+		System.err.println("String Packing:encoding not supported");
+		return new String(raw);
+	    }
+	}
+    }
+}
+    
Index: /trunk/gsdl3/packages/javagdbm/java/au/com/pharos/packing/TestQuotedVectorPacking.java
===================================================================
--- /trunk/gsdl3/packages/javagdbm/java/au/com/pharos/packing/TestQuotedVectorPacking.java	(revision 10737)
+++ /trunk/gsdl3/packages/javagdbm/java/au/com/pharos/packing/TestQuotedVectorPacking.java	(revision 10737)
@@ -0,0 +1,84 @@
+/*
+ * module: pip/java/packing -- Strategy objects for converting
+ *         Java objects to and from stored data.
+ * class:  TestQuotedVectorPacking -- Test harness for QuotedVectorPacking
+ *
+ * Copyright (C) 1997 Pharos IP Pty Ltd
+ * $Id$
+ *
+ *  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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package au.com.pharos.packing;
+
+import java.util.Vector;
+
+// TODO: Perhaps make this into a more general-purpose test harness
+// for testing any Packing strategy? -- mbp 19971021
+
+/** Test harness for the QuotedVectorPacking strategy class.
+ *
+ * <P><B>Usage:</B>
+ * <UL><P><CODE>java TestQuotedVectorPacking -[de] ARGS</CODE><UL>
+ *
+ * <P><B>Options</B>
+ * <DL>
+ *   <P><DT><CODE>-d</CODE><DD>Print the results of decoding
+ *      the each of the command-
+ *      line arguments as QuotedVectorPacking encoding strings
+ *
+ *   <P><DT><CODE>-e</CODE><DD>Print the results of encoding
+ *      a vector containing
+ *      all of the command-line arguments 
+ * </DL>
+ *
+ * @author Martin Pool
+ * @version $Revision$ $Date$
+ **/
+public class TestQuotedVectorPacking {
+    private TestQuotedVectorPacking() {}
+    
+    public static void main(String[] argv) {
+	Packing strat = new QuotedVectorPacking();
+	final String usage = "usage: TestQuotedVectorPacking -[ed] ARGS";
+
+	if (argv.length == 0) {
+	    System.err.println(usage);
+	    return;
+	}
+	
+	if (argv[0].equals("-e")) {
+	    Vector encode = new Vector(argv.length - 1);
+	    for (int i = 1; i < argv.length; i++) {
+		System.out.println(argv[i]);
+		encode.addElement(argv[i]);
+	    }
+	    byte[] packed = strat.toBytes(encode);
+	    System.out.print("\t");
+	    System.out.println(new String(packed));
+	} else if (argv[0].equals("-d")) {
+	    for (int i = 1; i < argv.length; i++) {
+		Vector decode = (Vector) strat.fromBytes(argv[i].getBytes());
+		System.out.println(argv[i]);
+		for (int j = 0; j < decode.size(); j++) {
+		    System.out.print("\t");
+		    System.out.println(decode.elementAt(j));
+		}
+	    }
+	} else {
+	    System.err.println(usage);
+	}
+    }
+}
Index: /trunk/gsdl3/packages/javagdbm/java/au/com/pharos/test/Test.java
===================================================================
--- /trunk/gsdl3/packages/javagdbm/java/au/com/pharos/test/Test.java	(revision 10737)
+++ /trunk/gsdl3/packages/javagdbm/java/au/com/pharos/test/Test.java	(revision 10737)
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 1997 Pharos IP Pty Ltd
+ * $Id$
+ * $Source$
+ *
+ *  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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package au.com.pharos.test;
+
+/** Utilities for automated testing.  This class contains only static
+ * functions and should not be instantiated.
+ *
+ * @author Martin Pool
+ * @version $Revision$ $Date$
+ **/
+// TODO: Somehow automatically generate sequence numbers, or perhaps use
+// strings to report progress
+public class Test {
+    // Don't instantiate
+    private Test() {}
+
+    static int nPassed, nFailed;
+
+    /** Register that a particular test executed successfully, and
+     * output a success or failure message.
+     *
+     * @param number test sequence number
+     **/
+    static public void ok(int no) {
+	ok(no, true);
+    }
+
+    /** Register the result of a test, and output a success or failure
+     * message.
+     *
+     * @param number test sequence number
+     * @param result whether the test was successful or not
+     */
+    static public void ok(int number, boolean passed) {
+	if (passed) {
+	    nPassed++;
+	}
+	else {
+	    System.out.print("not ");
+	    nFailed++;
+	}
+	System.out.print("ok " + number + "\n");
+    }
+
+    /**
+     * Print a summary of test results.
+     **/
+    static public void summary() {
+	System.out.print("test summary: " + nPassed + " passed, " +
+			 nFailed + " failed");
+    }
+}
+    
Index: /trunk/gsdl3/packages/javagdbm/java/au/com/pharos/util/StringOps.java
===================================================================
--- /trunk/gsdl3/packages/javagdbm/java/au/com/pharos/util/StringOps.java	(revision 10737)
+++ /trunk/gsdl3/packages/javagdbm/java/au/com/pharos/util/StringOps.java	(revision 10737)
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 1997 by Pharos IP Pty Ltd
+ * Confidential.  All rights reserved.
+ * $Id$
+ * $Source$
+ *
+ * ``No strings attached.''
+ */
+
+package au.com.pharos.util;
+
+/**
+ * Mixed bag of string manipulation functions.  It would be nice if
+ * some of these were in <CODE>java.lang.String</CODE>, but since
+ * they're not, they're implemented as static functions within this
+ * class.
+ *
+ * Typical use:
+ * <PRE>
+ * String foo = "some string"
+ * int cnt = StringOps.countOccurrences(foo, 's');
+ * // --> cnt == 2
+ * </PRE>
+ *
+ * @author Martin Pool
+ * @version $Revision$, $Date$
+ **/
+public class StringOps
+{
+    /** This class contains only static public functions. **/
+    private StringOps() { ; }
+
+    /** Count the number of occurences of a character in a
+     * string.
+     *
+     * @param needle the character to search
+     * @param haystack string to be searched
+     *
+     * @return 0 if <EM>needle</EM> does not occur in <EM>haystack</EM>;
+     * or a positive number indicating the number of occurrences
+     **/
+    static public int countOccurrences(String haystack, char needle)
+    {
+	byte[] hay = haystack.getBytes();
+	int count = 0;
+	for (int i = 0; i < hay.length; i++)
+	    if (hay[i] == needle)
+		count++;
+	return count;
+    }
+}
Index: /trunk/gsdl3/packages/javagdbm/java/au/com/pharos/util/test/StringOpsTest.java
===================================================================
--- /trunk/gsdl3/packages/javagdbm/java/au/com/pharos/util/test/StringOpsTest.java	(revision 10737)
+++ /trunk/gsdl3/packages/javagdbm/java/au/com/pharos/util/test/StringOpsTest.java	(revision 10737)
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 1997 by Pharos IP Pty Ltd
+ * Confidential.  All rights reserved.
+ * $Id$
+ * $Source$
+ */
+
+package au.com.pharos.util.test;
+
+import au.com.pharos.test.Test;
+
+import au.com.pharos.util.StringOps;
+
+/**
+ * Test harness for <CODE>au.com.pharos.util.StringOps</CODE>
+ *
+ * @author Martin Pool
+ * @version $Revision$ $Date$
+ **/
+public class StringOpsTest
+{
+    static public void main(String[] args)
+    {
+	new StringOpsTest().run();
+    }
+
+    public void run()
+    {
+	try {
+	    testCountOccurrences();
+	}
+	finally {
+	    Test.summary();
+	}
+    }
+
+    public void testCountOccurrences()
+    {
+	// Simple tests of countOccurences(String, char)
+	Test.ok(100, ( StringOps.countOccurrences("hello world", 'z') == 0) );
+	Test.ok(110, ( StringOps.countOccurrences("zhello world", 'z') == 1) );
+	Test.ok(120, ( StringOps.countOccurrences("hello worldz", 'z') == 1) );
+	Test.ok(130, ( StringOps.countOccurrences("z", 'z') == 1) );
+	Test.ok(140, ( StringOps.countOccurrences("zzz", 'z') == 3) );
+	Test.ok(150, ( StringOps.countOccurrences("0z0z0z", 'z') == 3) );
+	Test.ok(160, ( StringOps.countOccurrences("\0z\0z\0z", '\0') == 3) );
+    }
+}
Index: /trunk/gsdl3/packages/javagdbm/java/winMake.bat
===================================================================
--- /trunk/gsdl3/packages/javagdbm/java/winMake.bat	(revision 10737)
+++ /trunk/gsdl3/packages/javagdbm/java/winMake.bat	(revision 10737)
@@ -0,0 +1,45 @@
+@echo off
+
+set GDBMJAVAHOME=..
+
+rem ---- Where to put class files ----
+set JAVACLASSDIR=classes
+
+rem ---- Name and location of java programs ----
+set JAVAC="%JAVA_HOME%\bin\javac"
+set JAVAH="%JAVA_HOME%\bin\javah"
+set JAVA="%JAVA_HOME%\bin\java"
+set JAVADOC="%JAVA_HOME%\bin\javadoc"
+set JAR="%JAVA_HOME%\bin\jar"
+
+set JAVACOPTIONS= -deprecation -g -O
+
+
+if ""%1"" == """" goto compile
+if ""%1"" == ""compile"" goto compile
+if ""%1"" == ""install"" goto install
+if ""%1"" == ""clean"" goto clean
+
+:unknown
+	echo Error: Unrecognized argument %1.
+	goto done
+
+:compile
+	if not exist %JAVACLASSDIR% mkdir %JAVACLASSDIR%
+	echo Compiling...
+        %JAVAC% -d %JAVACLASSDIR% %JAVACOPTIONS% au\com\pharos\*\*.java
+        %JAVAH% -classpath %JAVACLASSDIR% -c %GDBMJAVAHOME%\jni\GdbmFile.h au.com.pharos.gdbm.GdbmFile
+        %JAR% cf %JAVAGDBMHOME%\javagdbm.jar -C %JAVACLASSDIR% au
+	goto done
+
+:install
+	goto done
+
+:clean
+	echo Cleaning up...
+	if exist %JAVACLASSDIR% rmdir /S /Q %JAVACLASSDIR%
+        if exist %JAVAGDBMHOME%\javagdbm.jar del %JAVAGDBMHOME%\javagdbm.jar 
+        if exist %GDBMJAVAHOME%\jni\GdbmFile.h del %GDBMJAVAHOME%\jni\GdbmFile.h 
+	goto done
+
+:done
Index: /trunk/gsdl3/packages/javagdbm/jni/GdbmFile.h
===================================================================
--- /trunk/gsdl3/packages/javagdbm/jni/GdbmFile.h	(revision 10737)
+++ /trunk/gsdl3/packages/javagdbm/jni/GdbmFile.h	(revision 10737)
@@ -0,0 +1,119 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class au_com_pharos_gdbm_GdbmFile */
+
+#ifndef _Included_au_com_pharos_gdbm_GdbmFile
+#define _Included_au_com_pharos_gdbm_GdbmFile
+#ifdef __cplusplus
+extern "C" {
+#endif
+#undef au_com_pharos_gdbm_GdbmFile_READER
+#define au_com_pharos_gdbm_GdbmFile_READER 0L
+#undef au_com_pharos_gdbm_GdbmFile_WRITER
+#define au_com_pharos_gdbm_GdbmFile_WRITER 1L
+#undef au_com_pharos_gdbm_GdbmFile_WRCREAT
+#define au_com_pharos_gdbm_GdbmFile_WRCREAT 2L
+#undef au_com_pharos_gdbm_GdbmFile_NEWDB
+#define au_com_pharos_gdbm_GdbmFile_NEWDB 3L
+#undef au_com_pharos_gdbm_GdbmFile_FAST
+#define au_com_pharos_gdbm_GdbmFile_FAST 16L
+/*
+ * Class:     au_com_pharos_gdbm_GdbmFile
+ * Method:    gdbm_open
+ * Signature: (Ljava/lang/String;I)J
+ */
+JNIEXPORT jlong JNICALL Java_au_com_pharos_gdbm_GdbmFile_gdbm_1open
+  (JNIEnv *, jobject, jstring, jint);
+
+/*
+ * Class:     au_com_pharos_gdbm_GdbmFile
+ * Method:    gdbm_close
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_au_com_pharos_gdbm_GdbmFile_gdbm_1close
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     au_com_pharos_gdbm_GdbmFile
+ * Method:    gdbm_store
+ * Signature: (J[B[BZ)V
+ */
+JNIEXPORT void JNICALL Java_au_com_pharos_gdbm_GdbmFile_gdbm_1store
+  (JNIEnv *, jobject, jlong, jbyteArray, jbyteArray, jboolean);
+
+/*
+ * Class:     au_com_pharos_gdbm_GdbmFile
+ * Method:    gdbm_fetch
+ * Signature: (J[B)[B
+ */
+JNIEXPORT jbyteArray JNICALL Java_au_com_pharos_gdbm_GdbmFile_gdbm_1fetch
+  (JNIEnv *, jobject, jlong, jbyteArray);
+
+/*
+ * Class:     au_com_pharos_gdbm_GdbmFile
+ * Method:    gdbm_exists
+ * Signature: (J[B)Z
+ */
+JNIEXPORT jboolean JNICALL Java_au_com_pharos_gdbm_GdbmFile_gdbm_1exists
+  (JNIEnv *, jobject, jlong, jbyteArray);
+
+/*
+ * Class:     au_com_pharos_gdbm_GdbmFile
+ * Method:    gdbm_delete
+ * Signature: (J[B)V
+ */
+JNIEXPORT void JNICALL Java_au_com_pharos_gdbm_GdbmFile_gdbm_1delete
+  (JNIEnv *, jobject, jlong, jbyteArray);
+
+/*
+ * Class:     au_com_pharos_gdbm_GdbmFile
+ * Method:    gdbm_firstkey
+ * Signature: (J)[B
+ */
+JNIEXPORT jbyteArray JNICALL Java_au_com_pharos_gdbm_GdbmFile_gdbm_1firstkey
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     au_com_pharos_gdbm_GdbmFile
+ * Method:    gdbm_nextkey
+ * Signature: (J[B)[B
+ */
+JNIEXPORT jbyteArray JNICALL Java_au_com_pharos_gdbm_GdbmFile_gdbm_1nextkey
+  (JNIEnv *, jobject, jlong, jbyteArray);
+
+/*
+ * Class:     au_com_pharos_gdbm_GdbmFile
+ * Method:    gdbm_getversion
+ * Signature: ()Ljava/lang/String;
+ */
+JNIEXPORT jstring JNICALL Java_au_com_pharos_gdbm_GdbmFile_gdbm_1getversion
+  (JNIEnv *, jclass);
+
+/*
+ * Class:     au_com_pharos_gdbm_GdbmFile
+ * Method:    gdbm_wrapperVersion
+ * Signature: ()Ljava/lang/String;
+ */
+JNIEXPORT jstring JNICALL Java_au_com_pharos_gdbm_GdbmFile_gdbm_1wrapperVersion
+  (JNIEnv *, jclass);
+
+/*
+ * Class:     au_com_pharos_gdbm_GdbmFile
+ * Method:    gdbm_reorganize
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_au_com_pharos_gdbm_GdbmFile_gdbm_1reorganize
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     au_com_pharos_gdbm_GdbmFile
+ * Method:    gdbm_sync
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_au_com_pharos_gdbm_GdbmFile_gdbm_1sync
+  (JNIEnv *, jobject, jlong);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
Index: /trunk/gsdl3/packages/javagdbm/jni/Makefile.in
===================================================================
--- /trunk/gsdl3/packages/javagdbm/jni/Makefile.in	(revision 10737)
+++ /trunk/gsdl3/packages/javagdbm/jni/Makefile.in	(revision 10737)
@@ -0,0 +1,62 @@
+# Makefile for the native parts of the au.com.pharos.gdbm
+# Java package.
+# Modified by kjdon 2005
+
+# Copyright (C) 1997 by Pharos IP Pty Ltd
+#
+# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+#srcdir=@srcdir@
+libdir=@libdir@
+
+CC=@CC@
+JDK=@JAVA_HOME@
+INC=-I. -I$(JDK)/include -I$(JDK)/include/linux  
+CFLAGS=-c @CFLAGS@ $(INC) -DWRAPPER_VERSION=\"$(WRAPPER_VERSION)\" 
+#PKG=@PKG@
+LIBS=@LIBS@
+LDFLAGS = @LDFLAGS@
+JNIFLAGS=@JNIFLAGS@
+JNISUFFIX=@JNISUFFIX@
+JNIINC=@JNIINC@
+
+# TODO: Build versioned shared libraries?
+
+# TODO: Build shared libraries in a way that will work on different
+# platforms -- mbp
+
+WRAPPER_VERSION=0005
+NATIVE_LIB=libgdbmjava.$(JNISUFFIX)
+
+all: $(NATIVE_LIB)
+
+$(NATIVE_LIB): GdbmFile.h gdbmjava.o Makefile
+	$(CC) $(LDFLAGS) $(JNIFLAGS) -o $(NATIVE_LIB) gdbmjava.o $(LIBS)
+
+gdbmjava.o: gdbmjava.c	
+	$(CC) $(INC) $(CFLAGS) $?
+
+# no easy way to tell if a class file has changed or not
+#GdbmFile.h: 
+#	$(javah) -o GdbmFile.h -jni $(PKG).GdbmFile 
+
+clean:	
+	rm -f  *.o $(NATIVE_LIB) 
+
+distclean: clean
+	rm -f config.log config.cache config.status Makefile
+
+install: 
+	cp $(NATIVE_LIB) $(libdir)/
Index: /trunk/gsdl3/packages/javagdbm/jni/gdbmjava.c
===================================================================
--- /trunk/gsdl3/packages/javagdbm/jni/gdbmjava.c	(revision 10737)
+++ /trunk/gsdl3/packages/javagdbm/jni/gdbmjava.c	(revision 10737)
@@ -0,0 +1,465 @@
+/*
+ * module: pip/jni/gdbm -- A Java interface to the GDBM library
+ * file:   gdbmjava.c -- Native parts of the au.com.pharos.gdbm.GdbmFile
+ *             Java class
+ *
+ * Copyright (C) 1997 Pharos IP Pty Ltd
+ *
+ * $Id$ 
+ *
+ *  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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+/* NOTE ON MEMORY MANAGEMENT: GDBM always mallocs memory and expects
+ * the caller to free it.  Java requires native functions to interact
+ * with it to lock and unlock buffers. */
+
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <gdbm.h>
+
+#include <jni.h>
+
+#include <GdbmFile.h>
+
+#ifdef DEBUG
+#define ASSERT(x) if (!(x)) { \
+  fprintf(stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+  abort(); }
+#else /* !DEBUG */
+#define ASSERT(x) 
+#endif /* !DEBUG */
+
+/* The Java class within which the native methods are declared */
+#define JAVA_CLASS "au.com.pharos.gdbm.GdbmFile"
+
+#define NULL_PTR_EXCEPTION(env) nullPtrException(env, __FILE__, __LINE__)
+#define GDBM_EXCEPTION(env) gdbmException(env, __FILE__, __LINE__)
+
+#define CHECK_NOT_NULL(ptr, env) if (!ptr) { NULL_PTR_EXCEPTION(env); return 0; }
+#define CHECK_NOT_NULL_VOID(ptr, env) if (!ptr) { NULL_PTR_EXCEPTION(env); return; }
+
+void gdbmException(JNIEnv *env, const char *file, int line);
+void nullPtrException(JNIEnv *env, const char *file, int line);
+
+void releaseArray(JNIEnv *env, jbyteArray array, datum *fromDatum);
+void releaseArrayAbort(JNIEnv *env, jbyteArray array, datum *fromDatum);
+int arrayToDatum(JNIEnv *env, jbyteArray fromArray, datum *toDatum);
+jbyteArray datumToArray(JNIEnv *env, datum *fromDatum);
+
+/* Convert between a jlong and a void ptr using a well-defined cast.
+ * (Casting between a pointer and an integer of different sizes spooks
+ * both gcc and mbp. */
+#if (SIZEOF_VOID_P == SIZEOF_LONG)
+#  define DBF_TO_JLONG(x) ((jlong)((long) x))
+#  define JLONG_TO_DBF(x) ((GDBM_FILE)((long) x))
+#elif (SIZEOF_VOID_P == SIZEOF_INT)
+#  define DBF_TO_JLONG(x) ((jlong)((int) (x)))
+#  define JLONG_TO_DBF(x) ((GDBM_FILE)((int) (x)))
+#else
+#  define DBF_TO_JLONG(x) ((jlong)(x))
+#  define JLONG_TO_DBF(x) ((GDBM_FILE)(x))
+#endif
+
+
+JNIEXPORT jlong JNICALL 
+Java_au_com_pharos_gdbm_GdbmFile_gdbm_1open
+    (JNIEnv *env, jobject obj, jstring fileName, jint flags)
+{
+    GDBM_FILE dbf;
+    const char *utfFileName;
+
+    utfFileName = (*env)->GetStringUTFChars(env, fileName, 0);
+    if (!utfFileName) 
+	return 0;
+    
+    setbuf(stderr, 0);
+
+    /* XXX: Should we let the caller specify the file mode?  I think
+     * not -- Java is above the level of octal file modes. [mbp] */
+    dbf = gdbm_open((char *) utfFileName, 0, flags, 0660, NULL);
+
+    if (utfFileName)
+	(*env)->ReleaseStringUTFChars(env, fileName, utfFileName);
+
+    if (!dbf) {
+	GDBM_EXCEPTION(env);
+	return 0;
+    }	
+
+    return DBF_TO_JLONG(dbf);
+}
+
+
+
+
+
+JNIEXPORT jbyteArray JNICALL 
+Java_au_com_pharos_gdbm_GdbmFile_gdbm_1firstkey
+(JNIEnv *env, jobject obj, jlong dbf)
+{
+    datum	keyDatum;
+    jbyteArray 	keyArray;
+
+    CHECK_NOT_NULL(dbf, env);
+
+    keyDatum = gdbm_firstkey(JLONG_TO_DBF(dbf));
+    if ( gdbm_errno != GDBM_NO_ERROR ) {
+	GDBM_EXCEPTION(env);
+	return 0;
+    }
+    if ( !keyDatum.dptr )
+	return 0;
+
+    keyArray = datumToArray(env, &keyDatum);
+    free(keyDatum.dptr); 
+
+    return keyArray;
+}
+
+
+
+
+
+JNIEXPORT jbyteArray JNICALL 
+Java_au_com_pharos_gdbm_GdbmFile_gdbm_1nextkey
+(JNIEnv *env, jobject this, jlong dbf, jbyteArray keyArray)
+{
+    datum	keyDatum;
+    datum	nextDatum;
+    jbyteArray	nextArray;
+
+    CHECK_NOT_NULL(dbf, env);
+
+    if (!arrayToDatum(env, keyArray, &keyDatum)) {
+	NULL_PTR_EXCEPTION(env);
+	return 0;
+    }
+    
+    nextDatum = gdbm_nextkey(JLONG_TO_DBF(dbf), keyDatum);
+    releaseArrayAbort(env, keyArray, &keyDatum);
+
+    if ( gdbm_errno != GDBM_NO_ERROR ) {
+	GDBM_EXCEPTION(env);
+	return 0;
+    }
+    if ( !nextDatum.dptr )
+	return 0;
+
+    nextArray = datumToArray(env, &nextDatum);
+    free(nextDatum.dptr);
+    
+    return nextArray;
+}
+
+
+
+
+
+
+JNIEXPORT jbyteArray JNICALL 
+Java_au_com_pharos_gdbm_GdbmFile_gdbm_1fetch
+  (JNIEnv *env, jobject this, jlong dbf, jbyteArray keyArray)
+{
+    datum 	keyDatum;
+    datum 	valueDatum;
+    jbyteArray	valueArray;
+
+    CHECK_NOT_NULL(dbf, env);
+
+    if (!arrayToDatum(env, keyArray, &keyDatum)) {
+	NULL_PTR_EXCEPTION(env);
+	return 0;
+    }
+
+    valueDatum = gdbm_fetch(JLONG_TO_DBF(dbf), keyDatum);
+    releaseArrayAbort(env, keyArray, &keyDatum);
+
+    if ( !valueDatum.dptr )
+	return 0;
+    if ( gdbm_errno != GDBM_NO_ERROR ) {
+	GDBM_EXCEPTION(env);
+	return 0;
+    }
+
+    valueArray = datumToArray(env, &valueDatum);
+    free(valueDatum.dptr);
+
+    return valueArray;
+}
+
+
+
+JNIEXPORT jboolean JNICALL 
+Java_au_com_pharos_gdbm_GdbmFile_gdbm_1exists
+  (JNIEnv *env, jobject obj, jlong dbf, jbyteArray keyArray)
+{
+    datum 	keyDatum;
+    int		result;
+
+    CHECK_NOT_NULL(dbf, env);
+    if (!arrayToDatum(env, keyArray, &keyDatum)) {
+	NULL_PTR_EXCEPTION(env);
+	return JNI_FALSE;
+    }
+    result = gdbm_exists(JLONG_TO_DBF(dbf), keyDatum);
+    if ( gdbm_errno != GDBM_NO_ERROR ) {
+	GDBM_EXCEPTION(env);
+	return 0;
+    }
+    releaseArrayAbort(env, keyArray, &keyDatum);
+    return result ? JNI_TRUE : JNI_FALSE;
+}
+
+
+
+
+
+JNIEXPORT void JNICALL 
+Java_au_com_pharos_gdbm_GdbmFile_gdbm_1store
+  (JNIEnv *env, jobject obj, jlong dbf, 
+   jbyteArray keyArray, jbyteArray valueArray, jboolean replace)
+{
+    datum	keyDatum;
+    datum	valueDatum;
+    
+    CHECK_NOT_NULL_VOID(dbf, env);
+    
+    if ( !arrayToDatum(env, keyArray, &keyDatum)
+	 || !arrayToDatum(env, valueArray, &valueDatum) ) {
+	NULL_PTR_EXCEPTION(env);
+	return;
+    }
+
+    gdbm_store(JLONG_TO_DBF(dbf), keyDatum, valueDatum, 
+	       replace ? GDBM_REPLACE : 0);
+
+    releaseArrayAbort(env, keyArray, &keyDatum);
+    releaseArrayAbort(env, valueArray, &valueDatum);
+
+    if ( gdbm_errno != GDBM_NO_ERROR )
+	GDBM_EXCEPTION(env);
+}
+
+
+
+JNIEXPORT void JNICALL 
+Java_au_com_pharos_gdbm_GdbmFile_gdbm_1delete
+   (JNIEnv *env, jobject obj, jlong dbf, jbyteArray keyArray)
+{
+    datum 	keyDatum;
+
+    CHECK_NOT_NULL_VOID(dbf, env);
+
+    if (!arrayToDatum(env, keyArray, &keyDatum)) {
+	NULL_PTR_EXCEPTION(env);
+	return;
+    }
+
+    gdbm_delete(JLONG_TO_DBF(dbf), keyDatum);
+
+    releaseArrayAbort(env, keyArray, &keyDatum);
+    
+    if ( gdbm_errno != GDBM_NO_ERROR )
+	GDBM_EXCEPTION(env);
+}
+
+
+
+JNIEXPORT jstring JNICALL 
+Java_au_com_pharos_gdbm_GdbmFile_gdbm_1getversion
+  (JNIEnv *env, jclass cls)
+{
+    return (*env)->NewStringUTF(env, gdbm_version);
+}
+
+
+JNIEXPORT jstring JNICALL 
+Java_au_com_pharos_gdbm_GdbmFile_gdbm_1wrapperVersion
+  (JNIEnv *env, jclass cls)
+{
+    return (*env)->NewStringUTF(env, "JavaGDBM release " WRAPPER_VERSION 
+				" built " __DATE__);
+}
+				
+
+
+
+JNIEXPORT void JNICALL 
+Java_au_com_pharos_gdbm_GdbmFile_gdbm_1reorganize
+  (JNIEnv *env, jobject obj, jlong dbf)
+{
+    CHECK_NOT_NULL_VOID(dbf, env);
+
+    gdbm_reorganize(JLONG_TO_DBF(dbf));
+
+    if ( gdbm_errno != GDBM_NO_ERROR )
+	GDBM_EXCEPTION(env);
+}
+
+
+
+JNIEXPORT void JNICALL 
+Java_au_com_pharos_gdbm_GdbmFile_gdbm_1close
+  (JNIEnv *env, jobject obj, jlong dbf)
+{
+    CHECK_NOT_NULL_VOID(dbf, env);
+
+    gdbm_close(JLONG_TO_DBF(dbf));
+
+    if ( gdbm_errno != GDBM_NO_ERROR )
+	GDBM_EXCEPTION(env);
+}
+
+
+
+JNIEXPORT void JNICALL 
+Java_au_com_pharos_gdbm_GdbmFile_gdbm_1sync
+  (JNIEnv *env, jobject obj, jlong dbf)
+{
+    CHECK_NOT_NULL_VOID(dbf, env);
+
+    gdbm_sync(JLONG_TO_DBF(dbf));
+
+    if ( gdbm_errno != GDBM_NO_ERROR )
+	GDBM_EXCEPTION(env);
+}
+
+
+
+
+/**********************************************************************
+ *
+ * Following are support functions which aid in interfacing C to 
+ * Java. */
+
+/** Create a new Java byte array from a GDBM datum, and return a
+ * pointer thereto.  */
+
+jbyteArray datumToArray(JNIEnv *env, datum *fromDatum) 
+{
+    jbyteArray toArray;
+
+    if (!fromDatum || !fromDatum->dptr)
+	return 0;
+
+    toArray = (*env)->NewByteArray(env, fromDatum->dsize);
+    ASSERT(toArray);
+    (*env)->SetByteArrayRegion(env, toArray, 
+			       0, fromDatum->dsize, fromDatum->dptr);
+    
+    return toArray;
+}
+
+/** Convert a Java byte array to a GDBM datum.
+ *
+ * The Java array is pinned or copied for use in the datum, and must
+ * be released after use by releaseBytes. 
+ *
+ * Returns true if the array is non-null and could be pinned.  Otherwise,
+ * returns false. 
+ */
+int arrayToDatum(JNIEnv *env, jbyteArray fromArray, datum *toDatum)
+{
+    if (fromArray) {
+	toDatum->dptr = (*env)->GetByteArrayElements(env, fromArray, 0);
+	toDatum->dsize = (*env)->GetArrayLength(env, fromArray);
+	return (int) toDatum->dptr;
+    }
+    else 
+	return 0;
+}
+
+/** Release a byte array pinned or copied for use in a datum. */
+void releaseArray(JNIEnv *env, jbyteArray array, datum *fromDatum) 
+{
+    ASSERT(fromDatum->dptr);
+    (*env)->ReleaseByteArrayElements(env, array, fromDatum->dptr, 0);
+    fromDatum->dptr = 0;	/* no longer valid */
+}
+
+/** Release a byte array pinned or copied for use in a datum, aborting 
+ * any changes.  This potentially saves the runtime from having to 
+ * copy back an unchanged array. */
+void releaseArrayAbort(JNIEnv *env, jbyteArray array, datum *fromDatum) 
+{
+    ASSERT(fromDatum->dptr);
+    (*env)->ReleaseByteArrayElements(env, array, fromDatum->dptr, 
+				     JNI_ABORT);
+    fromDatum->dptr = 0;	/* no longer valid */
+}
+
+
+/** Throw a null pointer exception. */
+void nullPtrException(JNIEnv *env, const char *file, int line) 
+{
+    jclass exClass;
+    char reason[1024];
+    sprintf(reason, "Null pointer exception in GDBM wrapper (%s:%d)",
+	    file, line);
+    
+    exClass = (*env)->FindClass(env, "java/lang/NullPointerException");
+    ASSERT(exClass);
+
+    (*env)->ThrowNew(env, exClass, reason);
+}
+
+/** Translate the GDBM error into throw a Java exception, and throw
+ * same. 
+ *
+ * TODO: Throw different classes of exceptions depending on what the 
+ * underlying error is. 
+ */
+void gdbmException(JNIEnv *env, const char *file, int line) {
+    jclass exClass;
+    static char reason[1500];
+    static char srcLocation[500];
+
+    exClass = (*env)->FindClass(env, "au/com/pharos/gdbm/GdbmException");
+    ASSERT(exClass);
+
+    strncpy(reason, gdbm_strerror(gdbm_errno), 500);
+    sprintf(srcLocation, " (%s:%d)", file, line);
+
+    /* If the error code suggests that an OS or stdio error may have occurred,
+     * include supplementary information from errno. */
+    switch (gdbm_errno) {
+    case GDBM_FILE_OPEN_ERROR:
+    case GDBM_FILE_WRITE_ERROR:
+    case GDBM_FILE_SEEK_ERROR:
+    case GDBM_FILE_READ_ERROR:
+    case GDBM_MALLOC_ERROR:
+    case GDBM_REORGANIZE_FAILED:
+	strcat(reason, ": ");
+	strncat(reason, strerror(errno), 490);
+	strcat(reason, "?");
+    default:
+	/* errno is probably not useful */
+	;
+    }
+    
+    strncat(reason, srcLocation, 495);
+    gdbm_errno = GDBM_NO_ERROR;	/* this one has been handled */
+    (*env)->ThrowNew(env, exClass, reason);    
+}
+
+/* 
+ * Local variables:
+ * c-basic-offset: 4
+ * End:
+ */
Index: /trunk/gsdl3/packages/javagdbm/jni/win32.mak
===================================================================
--- /trunk/gsdl3/packages/javagdbm/jni/win32.mak	(revision 10737)
+++ /trunk/gsdl3/packages/javagdbm/jni/win32.mak	(revision 10737)
@@ -0,0 +1,76 @@
+###########################################################################
+#
+# win32 makefile -- javagdbm\jni
+# A component of the Greenstone digital library software
+# from the New Zealand Digital Library Project at the
+# University of Waikato, New Zealand.
+#
+# Copyright (C) 1999  The New Zealand Digital Library Project
+#
+#
+# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+###########################################################################
+
+JAVAGDBMHOME = ..
+ 
+GSDL3HOME = ..\..\..
+GSDLHOME= $(GSDL3HOME)\gs2build
+GDBMHOME = $(GSDLHOME)\packages\windows\gdbm\gdbm
+
+# set javahome here
+#JAVA_HOME =
+
+AR = lib
+CC = cl
+CPPFLAGS = 
+
+DEFS = -D__WIN32__ -DHAVE_STRING_H
+
+INCLUDES = -I"$(GDBMHOME)" \
+           -I"$(JAVA_HOME)\include" -I"$(JAVA_HOME)\include\win32"           
+
+COMPILE = $(CC) -c $(CPPFLAGS) $(DEFS) $(INCLUDES)
+
+.SUFFIXES:
+.SUFFIXES: .c .obj
+.c.obj:
+	$(COMPILE) $<
+
+ANSI2KNR = 
+o = .obj
+ 
+HEADERS = \
+    GdbmFile.h
+
+SOURCES = \
+    gdbmjava.c
+
+OBJECTS = \
+    gdbmjava$o   $(GDBMHOME)\gdbm.lib
+ 
+all : compile link
+
+compile:
+        $(COMPILE) gdbmjava.c
+
+link:
+        $(CC) -MD -LD $(OBJECTS) -Fejavagdbm.dll
+
+install: 
+        copy javagdbm.dll $(GSDL3HOME)\lib
+
+clean:
+	del *$o 
Index: /trunk/gsdl3/packages/javagdbm/winMake.bat
===================================================================
--- /trunk/gsdl3/packages/javagdbm/winMake.bat	(revision 10737)
+++ /trunk/gsdl3/packages/javagdbm/winMake.bat	(revision 10737)
@@ -0,0 +1,29 @@
+@echo off
+
+set MAKE=nmake
+set MAKE_OPTIONS=/f
+
+if ""%1"" == """" goto all
+if ""%1"" == ""compile"" goto go
+if ""%1"" == ""install"" goto go
+if ""%1"" == ""clean"" goto go
+
+:unknown
+	echo Error: Unrecognized argument %1.
+	goto done
+
+:go
+	if ""%2"" == ""javaonly"" goto java
+
+:all
+	cd jni
+	%MAKE% %MAKE_OPTIONS% win32.mak %1
+	cd ..
+
+:java
+	cd java
+	call winMake.bat %1
+	cd ..
+	goto done
+
+:done
Index: /trunk/gsdl3/src/packages/javagdbm/CHANGES
===================================================================
--- /trunk/gsdl3/src/packages/javagdbm/CHANGES	(revision 10737)
+++ /trunk/gsdl3/src/packages/javagdbm/CHANGES	(revision 10737)
@@ -0,0 +1,26 @@
+Release 0006 1998-03-06
+ - Added FAQ.html
+
+Release 0005 1997-10-30
+ - Deserializing objects from databases is implemented properly
+ - Added the Closeable interface
+ - Fixed link to home page in documentation
+
+Release 0004 1997-10-24
+ - Fixed bug in autoconfig script
+
+Release 0003 1997-10-24
+ - Release-management and CVS restructurings
+
+Release 0002 1997-10-23
+ - Much more developer documentation in javadoc format
+ - Support for Serialization and QuotedVector packing
+ - Packing objects now have consistent names
+ - New distribution page, separate from mbp's home page
+ - Moved all the code into packages which use the standard Java naming
+   conventions: au.com.pharos.gdbm
+
+Release 0001 1997-10-03
+ - Functional JNI-based interface
+ - Scanty documentation
+ - GPL release disclaimer from jdg
Index: /trunk/gsdl3/src/packages/javagdbm/FAQ.html
===================================================================
--- /trunk/gsdl3/src/packages/javagdbm/FAQ.html	(revision 10737)
+++ /trunk/gsdl3/src/packages/javagdbm/FAQ.html	(revision 10737)
@@ -0,0 +1,173 @@
+<head><title>FAQ for JavaGDBM</title>
+</head>
+
+<h1>FAQ for JavaGDBM</h1>
+<p><pre>$Id$</pre>
+<p><a href="http://www.pharos.com.au/gdbm/"><b>Home page</b></a> |
+<a href="mailto:mbp@pharos.com.au"><b>mbp@pharos.com.au</b></a>
+
+<p><b>This is not an official publication of Pharos.  There is no
+warranty of any kind on this software or document.</b>
+
+<h3>Is this a JDBC driver?</h3>
+
+<p>(Alain Magloire)
+
+<p>No. JDBC seems mainly intended for interfaces to relational
+databases, and GDBM is not a relational database. 
+
+<p>However, JDBC does permit use of a subset to interface to
+non-relational databases.  Implementing this might be interesting: let
+me know if it's useful to you.
+
+<h3>Does JavaGDBM understand SQL?</h3>
+
+<p>(Alain Magloire)
+
+<p>No, JavaGDBM is intended to store on-disk hash tables.  They solve
+a different class of problem to that appropriate for SQL and
+relational databases.
+
+<h3>What type of database should I use?</h3>
+
+<p>Broadly, options for data storage in Java include
+
+<ul>
+<li>A hash file through JavaGDBM.
+<li>A relational database through JDBC
+<li>An object-oriented database
+<li>Serialization to a file
+</ul>
+
+<p>Make sure you choose the right tools: there is no single `best' answer.
+
+<h3>Are you maintaining GDBM?</h3>
+
+<p>No.  I understand that GDBM is still maintained by the FSF.
+
+<h3>Does it work on NT?</h3>
+
+<p>It should, but I haven't tried it.  You'll need a C compiler to
+build the native library.  Let me know if you try.
+
+<h3>Why does the test harness report exceptions</h3>
+
+<p>The test harness may report messages such as
+
+<pre>
+caught: au.com.pharos.gdbm.GdbmException: File open error: No such file or
+directory? (gdbmjava.c:101)
+</pre>
+
+<p>These are expected exceptions: the test harness is making sure that
+exceptions are thrown when they should be.
+
+<h3>I was trying to compile the Java GDBM distribution and it says gdbm.h not found</h3>
+
+<p>(Sandeep Kumar)
+
+<ol>
+<li>Make sure you have the GDBM library installed on your system.  
+If the library is not installed, you should be able to find it at 
+<a href="http://www.gnu.org/">www.gnu.org</a>
+
+<li>Make sure your compiler is configured to find the libraries and
+include files.
+
+</ol>
+
+<h3><tt>GdbmFile.h</tt> is missing</h3>
+
+<p>(Paul Matthews)
+
+<p><tt>GdbmFile.h</tt> is build by <tt>javah</tt> when the library is
+built.
+
+<h3>What is the best source to learn Java?</h3>
+
+<p>(Celil Germeyan)
+
+<p>Personally, I recommend the excellent Java series of books from
+<a href="http://www.ora.com/info/java/bibliography.html/">O'Reilly and
+Associates</a> and the
+<a href="http://java.sun.com/docs/books/index.html">Javasoft/Addison
+Wesley</a> books.
+
+<h3>I get a `not ok 40' message running the test</h3>
+
+<p>(Steve Waldman)
+
+<p>If you find a bug, either have a look at the code yourself, or
+send e-mail to 
+<a href="mailto:mbp@pharos.com.au"><tt>mbp@pharos.com.au</tt></a>.  
+There's no warranty on JavaGDBM, but I will try to respond to your
+mail and problem.
+
+<h3>I get linker errors on Solaris</h3>
+
+<p>(Alex Soto)
+
+<pre>
+Hi,
+
+    I'm hoping to use your JavaGDBM api for my application, but I'm
+having some problems compiling the libgdbmjava.so.  Here is a partial
+listing of the errors:
+
+gcc -o libgdbmjava.so -shared gdbmjava.o -lgdbm
+Text relocation remains                       referenced
+    against symbol                  offset      in file
+free                                0x258
+/usr/local/lib/libgdbm.a(gdbmreorg.o)
+free                                0xd0
+/usr/local/lib/libgdbm.a(gdbmclose.o)
+free                                0xb8
+/usr/local/lib/libgdbm.a(gdbmclose.o)
+free                                0x218
+[snipped]
+
+I have used the libgdbm.a lib before, and don't believe there is a
+problem with it.  I'm compiling to Solaris 2.6, using JDK 1.1.4.
+</pre>
+
+<p>The solution turned out to be that the gdbm native library
+must be compiled with the <tt>-fpic</tt> flag to cause the compiler to
+generate position-independant code.  
+
+<h3>What happens if a reader tries to open the database while a writer is doing something?</h3>
+
+<p>(Rich Neill)
+
+<p>Access will be denied until the writer releases its lock.  
+
+<p>JavaGDBM uses a shared-read/exclusive-write protocol at the OS
+level.  However, multiple Java threads can access a file concurrently.
+
+<h3>What platforms does JavaGDBM run on?</H3>
+
+<p>It should run on any platform that supports JDK1.1 or higher, JNI
+(Java Native Interface), and GDBM.  JavaGDBM is known to run on 
+
+<ul>
+<li>Linux/i386
+<li>Solaris/SPARC and Solaris/i86
+<li>AIX 4
+</ul>
+
+<p>If you have any information on other platforms, please let me know.
+
+<h3>You don't anticipate going Pure Java soon, do you?</h3>
+
+<p>(Brian Thorstad)
+
+<p>It's on the `long-term' TODO list.  I'd like to do it, but don't have
+any date in mind.
+
+<h3>Acknowledgements</h3>
+
+<p>Everybody who's sent in questions or comments.
+
+<p>Redhat and Javasoft, and the authors of GDBM, Linux, gcc, autoconf,
+and other software used in building JavaGDBM.
+
+</html>
Index: /trunk/gsdl3/src/packages/javagdbm/LICENSE
===================================================================
--- /trunk/gsdl3/src/packages/javagdbm/LICENSE	(revision 10737)
+++ /trunk/gsdl3/src/packages/javagdbm/LICENSE	(revision 10737)
@@ -0,0 +1,344 @@
+		    GNU GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+                          675 Mass Ave, Cambridge, MA 02139, 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) 19yy  <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., 675 Mass Ave, Cambridge, MA 02139, 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) 19yy 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.
Index: /trunk/gsdl3/src/packages/javagdbm/Makefile.in
===================================================================
--- /trunk/gsdl3/src/packages/javagdbm/Makefile.in	(revision 10737)
+++ /trunk/gsdl3/src/packages/javagdbm/Makefile.in	(revision 10737)
@@ -0,0 +1,19 @@
+# Main Makefile for Java GDBM
+# Katherine Don
+
+SUBDIRS = java jni
+MDEFINES = 
+
+all install clean:
+	for subdir in $(SUBDIRS); do \
+	echo making $@ in $$subdir; \
+	(cd $$subdir && $(MAKE) $(MDEFINES) $@) || exit 1; \
+	done
+
+distclean: 
+	rm -f Makefile config.cache config.log config.status ;\
+	for subdir in $(SUBDIRS); do \
+	echo making $@ in $$subdir; \
+	(cd $$subdir && $(MAKE) $(MDEFINES) $@) || exit 1; \
+	done	
+
Index: /trunk/gsdl3/src/packages/javagdbm/README.txt
===================================================================
--- /trunk/gsdl3/src/packages/javagdbm/README.txt	(revision 10737)
+++ /trunk/gsdl3/src/packages/javagdbm/README.txt	(revision 10737)
@@ -0,0 +1,31 @@
+A Java Interface to GDBM
+
+*****
+This is a most of the Java gdbm download. I have left out some unnecessary bits for the greenstone version. The original home page for this is no longer available, but http://aurora.regenstrief.org/~schadow/dbm-java/ has links to the original tar file.
+I have also updated the Makefiles so that it works on Windows and MacOSX.
+[kjdon, 2005]
+*****
+
+Martin Pool <m.pool@pharos.com.au>  1998-03-12
+
+ This is a Java interface to the GDBM database library written by Philip A Nelson. Like GDBM itself, this interface is free software, and comes with no warranty of any kind.
+
+GDBM is a library of database functions for implementing a hash on disk. JavaGDBM is an API for the Java programmer, not an applet or database package for end users.
+
+In Java terms, a GdbmFile is very similar to a java.util.Dictionary object, except that objects are reliably written to and retrieved from disk. An adaptor class, GdbmDictionary, presents that interface to maintain compatibility with existing code.
+
+GDBM enforces file and object locking to allow databases to be safely shared between multiple threads or processes. A database may be open read-write by one process, or read-only by any number of processes. Within each process, any number of threads may share the database. Within the limits of the operating system and hardware, GDBM will ensure that changes are atomically committed to disk, making the database safe even if the program terminates abnormally.
+
+JavaGDBM stores key/data pairs in a GdbmFile object, which represents a single disk file. Each key must be unique, and is paired with a single data item. The keys are not ordered: if you want to retrieve the objects in sorted order you can build an external index. The basic operations on
+
+As for a Dictionary, the basic operations that may be performed on a GdbmFile are to fetch, test for existence, store and delete records.
+
+Since Java objects are dynamically typed and GDBM data are typeless, JavaGDBM uses Strategy objects to allow objects to be encoded and decoded in various ways. Classes derived from the abstract Packing class may pack ojbects for storage as byte arrays, Unicode or ASCII strings, as serialized Java objects, or in a user-defined fashion. The packing strategy is defined at runtime for both the key and value of the records.
+
+Some example code is available in the test harness GdbmTest.java.
+
+The current implementation of JavaGDBM uses native glue code to link to the GDBM library via JNI, the Java Native Interface. This means that you must have a C compiler, the GDBM library, and related tools to compile the native portions JavaGDBM also requires a JDK1.1-compatible Java compiler, libraries, and runtime.
+
+If the GDBM libraries didn't come with your system, then you can download the GDBM source and install it.
+
+GDBM is known to work on Linux, NetBSD, Solaris, and AIX. 
Index: /trunk/gsdl3/src/packages/javagdbm/TODO
===================================================================
--- /trunk/gsdl3/src/packages/javagdbm/TODO	(revision 10737)
+++ /trunk/gsdl3/src/packages/javagdbm/TODO	(revision 10737)
@@ -0,0 +1,21 @@
+TODO for JavaGDBM
+$Id$
+
+Short-term
+
+ - Fix reported bugs
+
+Medium-term
+
+ - Modify the Makefile and configuration code to make sure JavaGDBM
+   builds on more different systems.
+
+ - Add support for non-default block sizes and other options.
+
+ - Offer more developer documentation.
+
+Long-term
+
+ - Rewrite the native code in Java to make the system 100% Pure.
+ - Offer precompiled binaries(?)
+
Index: /trunk/gsdl3/src/packages/javagdbm/configure
===================================================================
--- /trunk/gsdl3/src/packages/javagdbm/configure	(revision 10737)
+++ /trunk/gsdl3/src/packages/javagdbm/configure	(revision 10737)
@@ -0,0 +1,5222 @@
+#! /bin/sh
+# From configure.in Revision: 1.5 .
+# Guess values for system-dependent variables and create Makefiles.
+# 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.
+## --------------------- ##
+## 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=
+PACKAGE_TARNAME=
+PACKAGE_VERSION=
+PACKAGE_STRING=
+PACKAGE_BUGREPORT=
+
+ac_unique_file="jni/gdbmjava.c"
+# 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 CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S CPP EGREP JAVA_HOME javagdbm_cv_path_javah javagdbm_cv_path_java PKG JNIINC JNISUFFIX JNIFLAGS LIBOBJS LTLIBOBJS'
+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 this package 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
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+
+  cat <<\_ACEOF
+
+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.
+
+_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
+
+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 $as_me, 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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# TODO: allow the user to specify whether they want a debugging
+# library or not?
+
+# check for compilers and other tools
+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
+
+ac_aux_dir=
+for ac_dir in $srcdir $srcdir/.. $srcdir/../..; 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 $srcdir $srcdir/.. $srcdir/../.." >&5
+echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+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.
+
+# 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 ln -s works" >&5
+echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
+LN_S=$as_ln_s
+if test "$LN_S" = "ln -s"; then
+  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+  echo "$as_me:$LINENO: result: no, using $LN_S" >&5
+echo "${ECHO_T}no, using $LN_S" >&6
+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 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
+
+
+echo "$as_me:$LINENO: checking for void *" >&5
+echo $ECHO_N "checking for void *... $ECHO_C" >&6
+if test "${ac_cv_type_void_p+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
+int
+main ()
+{
+if ((void * *) 0)
+  return 0;
+if (sizeof (void *))
+  return 0;
+  ;
+  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_void_p=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_void_p=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_void_p" >&5
+echo "${ECHO_T}$ac_cv_type_void_p" >&6
+
+echo "$as_me:$LINENO: checking size of void *" >&5
+echo $ECHO_N "checking size of void *... $ECHO_C" >&6
+if test "${ac_cv_sizeof_void_p+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test "$ac_cv_type_void_p" = yes; then
+  # The cast to unsigned long works around a bug in the HP C Compiler
+  # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+  # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+  # This bug is HP SR number 8606223364.
+  if test "$cross_compiling" = yes; then
+  # Depending upon the size, compute the lo and hi bounds.
+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
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (void *))) >= 0)];
+test_array [0] = 0
+
+  ;
+  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_lo=0 ac_mid=0
+  while :; do
+    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
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (void *))) <= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  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_hi=$ac_mid; break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_lo=`expr $ac_mid + 1`
+		    if test $ac_lo -le $ac_mid; then
+		      ac_lo= ac_hi=
+		      break
+		    fi
+		    ac_mid=`expr 2 '*' $ac_mid + 1`
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+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
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (void *))) < 0)];
+test_array [0] = 0
+
+  ;
+  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_hi=-1 ac_mid=-1
+  while :; do
+    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
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (void *))) >= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  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_lo=$ac_mid; break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_hi=`expr '(' $ac_mid ')' - 1`
+		       if test $ac_mid -le $ac_hi; then
+			 ac_lo= ac_hi=
+			 break
+		       fi
+		       ac_mid=`expr 2 '*' $ac_mid`
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_lo= ac_hi=
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
+  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
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (void *))) <= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  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_hi=$ac_mid
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_lo=`expr '(' $ac_mid ')' + 1`
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in
+?*) ac_cv_sizeof_void_p=$ac_lo;;
+'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *), 77
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (void *), 77
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; } ;;
+esac
+else
+  if test "$cross_compiling" = yes; then
+  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+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
+long longval () { return (long) (sizeof (void *)); }
+unsigned long ulongval () { return (long) (sizeof (void *)); }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main ()
+{
+
+  FILE *f = fopen ("conftest.val", "w");
+  if (! f)
+    exit (1);
+  if (((long) (sizeof (void *))) < 0)
+    {
+      long i = longval ();
+      if (i != ((long) (sizeof (void *))))
+	exit (1);
+      fprintf (f, "%ld\n", i);
+    }
+  else
+    {
+      unsigned long i = ulongval ();
+      if (i != ((long) (sizeof (void *))))
+	exit (1);
+      fprintf (f, "%lu\n", i);
+    }
+  exit (ferror (f) || fclose (f) != 0);
+
+  ;
+  return 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
+  ac_cv_sizeof_void_p=`cat conftest.val`
+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 )
+{ { echo "$as_me:$LINENO: error: cannot compute sizeof (void *), 77
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (void *), 77
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+rm -f conftest.val
+else
+  ac_cv_sizeof_void_p=0
+fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_sizeof_void_p" >&5
+echo "${ECHO_T}$ac_cv_sizeof_void_p" >&6
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_VOID_P $ac_cv_sizeof_void_p
+_ACEOF
+
+
+echo "$as_me:$LINENO: checking for int" >&5
+echo $ECHO_N "checking for int... $ECHO_C" >&6
+if test "${ac_cv_type_int+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
+int
+main ()
+{
+if ((int *) 0)
+  return 0;
+if (sizeof (int))
+  return 0;
+  ;
+  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_int=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_int=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5
+echo "${ECHO_T}$ac_cv_type_int" >&6
+
+echo "$as_me:$LINENO: checking size of int" >&5
+echo $ECHO_N "checking size of int... $ECHO_C" >&6
+if test "${ac_cv_sizeof_int+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test "$ac_cv_type_int" = yes; then
+  # The cast to unsigned long works around a bug in the HP C Compiler
+  # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+  # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+  # This bug is HP SR number 8606223364.
+  if test "$cross_compiling" = yes; then
+  # Depending upon the size, compute the lo and hi bounds.
+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
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (int))) >= 0)];
+test_array [0] = 0
+
+  ;
+  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_lo=0 ac_mid=0
+  while :; do
+    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
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (int))) <= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  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_hi=$ac_mid; break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_lo=`expr $ac_mid + 1`
+		    if test $ac_lo -le $ac_mid; then
+		      ac_lo= ac_hi=
+		      break
+		    fi
+		    ac_mid=`expr 2 '*' $ac_mid + 1`
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+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
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (int))) < 0)];
+test_array [0] = 0
+
+  ;
+  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_hi=-1 ac_mid=-1
+  while :; do
+    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
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (int))) >= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  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_lo=$ac_mid; break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_hi=`expr '(' $ac_mid ')' - 1`
+		       if test $ac_mid -le $ac_hi; then
+			 ac_lo= ac_hi=
+			 break
+		       fi
+		       ac_mid=`expr 2 '*' $ac_mid`
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_lo= ac_hi=
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
+  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
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (int))) <= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  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_hi=$ac_mid
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_lo=`expr '(' $ac_mid ')' + 1`
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in
+?*) ac_cv_sizeof_int=$ac_lo;;
+'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (int), 77
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; } ;;
+esac
+else
+  if test "$cross_compiling" = yes; then
+  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+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
+long longval () { return (long) (sizeof (int)); }
+unsigned long ulongval () { return (long) (sizeof (int)); }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main ()
+{
+
+  FILE *f = fopen ("conftest.val", "w");
+  if (! f)
+    exit (1);
+  if (((long) (sizeof (int))) < 0)
+    {
+      long i = longval ();
+      if (i != ((long) (sizeof (int))))
+	exit (1);
+      fprintf (f, "%ld\n", i);
+    }
+  else
+    {
+      unsigned long i = ulongval ();
+      if (i != ((long) (sizeof (int))))
+	exit (1);
+      fprintf (f, "%lu\n", i);
+    }
+  exit (ferror (f) || fclose (f) != 0);
+
+  ;
+  return 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
+  ac_cv_sizeof_int=`cat conftest.val`
+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 )
+{ { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (int), 77
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+rm -f conftest.val
+else
+  ac_cv_sizeof_int=0
+fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5
+echo "${ECHO_T}$ac_cv_sizeof_int" >&6
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_INT $ac_cv_sizeof_int
+_ACEOF
+
+
+echo "$as_me:$LINENO: checking for long" >&5
+echo $ECHO_N "checking for long... $ECHO_C" >&6
+if test "${ac_cv_type_long+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
+int
+main ()
+{
+if ((long *) 0)
+  return 0;
+if (sizeof (long))
+  return 0;
+  ;
+  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_long=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_long=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5
+echo "${ECHO_T}$ac_cv_type_long" >&6
+
+echo "$as_me:$LINENO: checking size of long" >&5
+echo $ECHO_N "checking size of long... $ECHO_C" >&6
+if test "${ac_cv_sizeof_long+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test "$ac_cv_type_long" = yes; then
+  # The cast to unsigned long works around a bug in the HP C Compiler
+  # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+  # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+  # This bug is HP SR number 8606223364.
+  if test "$cross_compiling" = yes; then
+  # Depending upon the size, compute the lo and hi bounds.
+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
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (long))) >= 0)];
+test_array [0] = 0
+
+  ;
+  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_lo=0 ac_mid=0
+  while :; do
+    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
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  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_hi=$ac_mid; break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_lo=`expr $ac_mid + 1`
+		    if test $ac_lo -le $ac_mid; then
+		      ac_lo= ac_hi=
+		      break
+		    fi
+		    ac_mid=`expr 2 '*' $ac_mid + 1`
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+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
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (long))) < 0)];
+test_array [0] = 0
+
+  ;
+  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_hi=-1 ac_mid=-1
+  while :; do
+    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
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (long))) >= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  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_lo=$ac_mid; break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_hi=`expr '(' $ac_mid ')' - 1`
+		       if test $ac_mid -le $ac_hi; then
+			 ac_lo= ac_hi=
+			 break
+		       fi
+		       ac_mid=`expr 2 '*' $ac_mid`
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_lo= ac_hi=
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
+  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
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  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_hi=$ac_mid
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_lo=`expr '(' $ac_mid ')' + 1`
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in
+?*) ac_cv_sizeof_long=$ac_lo;;
+'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (long), 77
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; } ;;
+esac
+else
+  if test "$cross_compiling" = yes; then
+  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+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
+long longval () { return (long) (sizeof (long)); }
+unsigned long ulongval () { return (long) (sizeof (long)); }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main ()
+{
+
+  FILE *f = fopen ("conftest.val", "w");
+  if (! f)
+    exit (1);
+  if (((long) (sizeof (long))) < 0)
+    {
+      long i = longval ();
+      if (i != ((long) (sizeof (long))))
+	exit (1);
+      fprintf (f, "%ld\n", i);
+    }
+  else
+    {
+      unsigned long i = ulongval ();
+      if (i != ((long) (sizeof (long))))
+	exit (1);
+      fprintf (f, "%lu\n", i);
+    }
+  exit (ferror (f) || fclose (f) != 0);
+
+  ;
+  return 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
+  ac_cv_sizeof_long=`cat conftest.val`
+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 )
+{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute sizeof (long), 77
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+rm -f conftest.val
+else
+  ac_cv_sizeof_long=0
+fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5
+echo "${ECHO_T}$ac_cv_sizeof_long" >&6
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_LONG $ac_cv_sizeof_long
+_ACEOF
+
+
+
+######## check for the JDK and tools within the JDK
+######## look in the JAVA_HOME environment variable at configure-time
+echo "$as_me:$LINENO: checking for the JDK" >&5
+echo $ECHO_N "checking for the JDK... $ECHO_C" >&6
+if test "z$JAVA_HOME" != z &&
+   test -d $JAVA_HOME &&
+   test -d $JAVA_HOME/include
+then
+
+	echo "$as_me:$LINENO: result: found in $JAVA_HOME" >&5
+echo "${ECHO_T}found in $JAVA_HOME" >&6
+else
+	{ { echo "$as_me:$LINENO: error: not found in \$JAVA_HOME" >&5
+echo "$as_me: error: not found in \$JAVA_HOME" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+# TODO: Check for specific header files in the JDK, or
+# functions/definitions within those headers?
+
+# TODO: guess which include directory to use under the JDK
+
+# Extract the first word of "javah", so it can be a program name with args.
+set dummy javah; 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_javagdbm_cv_path_javah+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $javagdbm_cv_path_javah in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_javagdbm_cv_path_javah="$javagdbm_cv_path_javah" # 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_javagdbm_cv_path_javah="$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_javagdbm_cv_path_javah" && ac_cv_path_javagdbm_cv_path_javah="missing_javah"
+  ;;
+esac
+fi
+javagdbm_cv_path_javah=$ac_cv_path_javagdbm_cv_path_javah
+
+if test -n "$javagdbm_cv_path_javah"; then
+  echo "$as_me:$LINENO: result: $javagdbm_cv_path_javah" >&5
+echo "${ECHO_T}$javagdbm_cv_path_javah" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+if test "$javagdbm_cv_path_javah" = missing_javah; then
+	{ { echo "$as_me:$LINENO: error: javah not found." >&5
+echo "$as_me: error: javah not found." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+# Extract the first word of "java", so it can be a program name with args.
+set dummy java; 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_javagdbm_cv_path_java+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $javagdbm_cv_path_java in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_javagdbm_cv_path_java="$javagdbm_cv_path_java" # 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_javagdbm_cv_path_java="$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_javagdbm_cv_path_java" && ac_cv_path_javagdbm_cv_path_java="missing"
+  ;;
+esac
+fi
+javagdbm_cv_path_java=$ac_cv_path_javagdbm_cv_path_java
+
+if test -n "$javagdbm_cv_path_java"; then
+  echo "$as_me:$LINENO: result: $javagdbm_cv_path_java" >&5
+echo "${ECHO_T}$javagdbm_cv_path_java" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+if test "$javagdbm_cv_path_java" = missing; then
+	{ { echo "$as_me:$LINENO: error: java not found." >&5
+echo "$as_me: error: java not found." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+# check for gdbm library
+echo "$as_me:$LINENO: checking for gdbm_open in -lgdbm" >&5
+echo $ECHO_N "checking for gdbm_open in -lgdbm... $ECHO_C" >&6
+if test "${ac_cv_lib_gdbm_gdbm_open+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lgdbm  $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 gdbm_open ();
+int
+main ()
+{
+gdbm_open ();
+  ;
+  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_gdbm_gdbm_open=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_gdbm_gdbm_open=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_gdbm_gdbm_open" >&5
+echo "${ECHO_T}$ac_cv_lib_gdbm_gdbm_open" >&6
+if test $ac_cv_lib_gdbm_gdbm_open = yes; then
+  javagdbm_cv_lib_gdbm="-lgdbm"
+else
+  javagdbm_cv_lib_gdbm=no
+fi
+
+if test "$javagdbm_cv_lib_gdbm" = "no"; then
+	{ { echo "$as_me:$LINENO: error: no native gdbm library found." >&5
+echo "$as_me: error: no native gdbm library found." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+LIBS="$javagdbm_cv_lib_gdbm"
+
+########## set compiler options
+# TODO: is there a more appropriate way to guess which switches to use
+# with which systems/compilers?
+CFLAGS="-Wall -O2 -fpic"
+PKG="au.com.pharos.gdbm"
+
+
+
+
+# we need to set an extended JNI path for Mac OS/Darwin, as jni.h is on
+# a non-standard Path
+echo "$as_me:$LINENO: checking for Apple MacOS X/Darwin" >&5
+echo $ECHO_N "checking for Apple MacOS X/Darwin... $ECHO_C" >&6
+if test "`(uname -s) 2> /dev/null`" = 'Darwin'; then
+  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+  JNIINC="-I/System/Library/Frameworks/JavaVM.framework/Headers/ "
+  JNISUFFIX="jnilib"
+  JNIFLAGS="-dynamiclib -fno-common"
+  LDFLAGS="-framework JavaVM"
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+  JNIINC=""
+  JNISUFFIX="so"
+  JNIFLAGS="-shared"
+fi
+
+
+
+
+# write the output
+                              ac_config_files="$ac_config_files Makefile jni/Makefile java/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
+
+# Transform confdefs.h into DEFS.
+# Protect against shell expansion while executing Makefile rules.
+# Protect against Makefile macro expansion.
+#
+# If the first sed substitution is executed (which looks for macros that
+# take arguments), then we branch to the quote section.  Otherwise,
+# look for a macro that doesn't take arguments.
+cat >confdef2opt.sed <<\_ACEOF
+t clear
+: clear
+s,^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 (][^	 (]*([^)]*)\)[	 ]*\(.*\),-D\1=\2,g
+t quote
+s,^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 ][^	 ]*\)[	 ]*\(.*\),-D\1=\2,g
+t quote
+d
+: quote
+s,[	 `~#$^&*(){}\\|;'"<>?],\\&,g
+s,\[,\\&,g
+s,\],\\&,g
+s,\$,$$,g
+p
+_ACEOF
+# We use echo to avoid assuming a particular line-breaking character.
+# The extra dot is to prevent the shell from consuming trailing
+# line-breaks from the sub-command output.  A line-break within
+# single-quotes doesn't work because, if this script is created in a
+# platform that uses two characters for line-breaks (e.g., DOS), tr
+# would break.
+ac_LF_and_DOT=`echo; echo .`
+DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'`
+rm -f confdef2opt.sed
+
+
+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
+
+
+
+: ${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 $as_me, 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
+
+Configuration files:
+$config_files
+
+Report bugs to <bug-autoconf@gnu.org>."
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+ac_cs_version="\\
+config.status
+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
+for ac_config_target in $ac_config_targets
+do
+  case "$ac_config_target" in
+  # Handling of arguments.
+  "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+  "jni/Makefile" ) CONFIG_FILES="$CONFIG_FILES jni/Makefile" ;;
+  "java/Makefile" ) CONFIG_FILES="$CONFIG_FILES java/Makefile" ;;
+  *) { { 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
+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,@SHELL@,$SHELL,;t t
+s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
+s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
+s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
+s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
+s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
+s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
+s,@exec_prefix@,$exec_prefix,;t t
+s,@prefix@,$prefix,;t t
+s,@program_transform_name@,$program_transform_name,;t t
+s,@bindir@,$bindir,;t t
+s,@sbindir@,$sbindir,;t t
+s,@libexecdir@,$libexecdir,;t t
+s,@datadir@,$datadir,;t t
+s,@sysconfdir@,$sysconfdir,;t t
+s,@sharedstatedir@,$sharedstatedir,;t t
+s,@localstatedir@,$localstatedir,;t t
+s,@libdir@,$libdir,;t t
+s,@includedir@,$includedir,;t t
+s,@oldincludedir@,$oldincludedir,;t t
+s,@infodir@,$infodir,;t t
+s,@mandir@,$mandir,;t t
+s,@build_alias@,$build_alias,;t t
+s,@host_alias@,$host_alias,;t t
+s,@target_alias@,$target_alias,;t t
+s,@DEFS@,$DEFS,;t t
+s,@ECHO_C@,$ECHO_C,;t t
+s,@ECHO_N@,$ECHO_N,;t t
+s,@ECHO_T@,$ECHO_T,;t t
+s,@LIBS@,$LIBS,;t t
+s,@CC@,$CC,;t t
+s,@CFLAGS@,$CFLAGS,;t t
+s,@LDFLAGS@,$LDFLAGS,;t t
+s,@CPPFLAGS@,$CPPFLAGS,;t t
+s,@ac_ct_CC@,$ac_ct_CC,;t t
+s,@EXEEXT@,$EXEEXT,;t t
+s,@OBJEXT@,$OBJEXT,;t t
+s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
+s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
+s,@INSTALL_DATA@,$INSTALL_DATA,;t t
+s,@LN_S@,$LN_S,;t t
+s,@CPP@,$CPP,;t t
+s,@EGREP@,$EGREP,;t t
+s,@JAVA_HOME@,$JAVA_HOME,;t t
+s,@javagdbm_cv_path_javah@,$javagdbm_cv_path_javah,;t t
+s,@javagdbm_cv_path_java@,$javagdbm_cv_path_java,;t t
+s,@PKG@,$PKG,;t t
+s,@JNIINC@,$JNIINC,;t t
+s,@JNISUFFIX@,$JNISUFFIX,;t t
+s,@JNIFLAGS@,$JNIFLAGS,;t t
+s,@LIBOBJS@,$LIBOBJS,;t t
+s,@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
+
+  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
+  # 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; }
+_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,@configure_input@,$configure_input,;t t
+s,@srcdir@,$ac_srcdir,;t t
+s,@abs_srcdir@,$ac_abs_srcdir,;t t
+s,@top_srcdir@,$ac_top_srcdir,;t t
+s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t
+s,@builddir@,$ac_builddir,;t t
+s,@abs_builddir@,$ac_abs_builddir,;t t
+s,@top_builddir@,$ac_top_builddir,;t t
+s,@abs_top_builddir@,$ac_abs_top_builddir,;t t
+s,@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
+
+{ (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
+
Index: /trunk/gsdl3/src/packages/javagdbm/configure.in
===================================================================
--- /trunk/gsdl3/src/packages/javagdbm/configure.in	(revision 10737)
+++ /trunk/gsdl3/src/packages/javagdbm/configure.in	(revision 10737)
@@ -0,0 +1,104 @@
+dnl Process this file with autoconf to produce a configure script.
+
+dnl autoconf configuration script for the JNI part of the 
+dnl au.com.pharos.gdbm Java package
+dnl $Id$
+
+AC_REVISION($Revision$)
+
+# Copyright (C) 1997 by Pharos IP Pty Ltd
+#
+# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+AC_INIT(jni/gdbmjava.c)
+
+# TODO: allow the user to specify whether they want a debugging
+# library or not?
+
+# check for compilers and other tools
+AC_PROG_CC
+AC_PROG_INSTALL
+AC_PROG_LN_S
+
+AC_CHECK_SIZEOF(void *)
+AC_CHECK_SIZEOF(int)
+AC_CHECK_SIZEOF(long)
+
+######## check for the JDK and tools within the JDK
+######## look in the JAVA_HOME environment variable at configure-time
+AC_MSG_CHECKING([for the JDK])
+if test "z$JAVA_HOME" != z &&
+   test -d $JAVA_HOME && 
+   test -d $JAVA_HOME/include
+then
+	AC_SUBST(JAVA_HOME)
+	AC_MSG_RESULT([found in $JAVA_HOME])
+else
+	AC_MSG_ERROR([not found in \$JAVA_HOME])
+fi
+
+# TODO: Check for specific header files in the JDK, or
+# functions/definitions within those headers?
+
+# TODO: guess which include directory to use under the JDK
+
+AC_PATH_PROG(javagdbm_cv_path_javah, javah, missing_javah)
+if test "$javagdbm_cv_path_javah" = missing_javah; then
+	AC_MSG_ERROR([javah not found.])
+fi
+
+AC_PATH_PROG(javagdbm_cv_path_java, java, missing)
+if test "$javagdbm_cv_path_java" = missing; then
+	AC_MSG_ERROR([java not found.])
+fi
+
+# check for gdbm library
+AC_CHECK_LIB(gdbm, gdbm_open, [javagdbm_cv_lib_gdbm="-lgdbm"],
+	[javagdbm_cv_lib_gdbm=no])
+if test "$javagdbm_cv_lib_gdbm" = "no"; then
+	AC_MSG_ERROR([no native gdbm library found.])
+fi
+LIBS="$javagdbm_cv_lib_gdbm"
+
+########## set compiler options
+# TODO: is there a more appropriate way to guess which switches to use
+# with which systems/compilers?
+CFLAGS="-Wall -O2 -fpic"
+PKG="au.com.pharos.gdbm"
+AC_SUBST(CFLAGS)
+AC_SUBST(PKG)
+AC_SUBST(LIBS)
+
+# we need to set an extended JNI path for Mac OS/Darwin, as jni.h is on
+# a non-standard Path
+AC_MSG_CHECKING(for Apple MacOS X/Darwin)
+if test "`(uname -s) 2> /dev/null`" = 'Darwin'; then
+  AC_MSG_RESULT(yes)
+  JNIINC="-I/System/Library/Frameworks/JavaVM.framework/Headers/ "
+  JNISUFFIX="jnilib"
+  JNIFLAGS="-dynamiclib -fno-common"
+  LDFLAGS="-framework JavaVM"
+else
+  AC_MSG_RESULT(no)
+  JNIINC=""
+  JNISUFFIX="so"
+  JNIFLAGS="-shared"
+fi
+AC_SUBST(JNIINC)
+AC_SUBST(JNISUFFIX)
+AC_SUBST(JNIFLAGS)
+
+# write the output
+AC_OUTPUT([Makefile jni/Makefile java/Makefile])
Index: /trunk/gsdl3/src/packages/javagdbm/java/Makefile.in
===================================================================
--- /trunk/gsdl3/src/packages/javagdbm/java/Makefile.in	(revision 10737)
+++ /trunk/gsdl3/src/packages/javagdbm/java/Makefile.in	(revision 10737)
@@ -0,0 +1,31 @@
+# Makefile for Java part of JavaGDBM
+# Katherine Don, 2005
+
+JAVAC = $(JAVA_HOME)/bin/javac
+JAVAH = $(JAVA_HOME)/bin/javah
+JAR = $(JAVA_HOME)/bin/jar
+
+JAVAGDBMHOME=../
+JAVACLASSDIR=./classes
+JAVASRCDIR=.
+JAVACOPTIONS= -deprecation -g -O
+JAVACLASSPATH=$(JAVACLASSDIR):
+
+all: setup compile
+
+setup:
+	mkdir -p $(JAVACLASSDIR)
+
+compile: setup
+	$(JAVAC) -d $(JAVACLASSDIR) -sourcepath $(JAVASRCDIR) $(JAVACOPTIONS) au/com/pharos/*/*.java
+	$(JAVAH) -o $(JAVAGDBMHOME)/jni/GdbmFile.h -classpath $(JAVACLASSPATH) au.com.pharos.gdbm.GdbmFile
+	$(JAR) cf $(JAVAGDBMHOME)/javagdbm.jar -C $(JAVACLASSDIR) au
+
+clean:
+	rm -rf $(JAVACLASSDIR) $(JAVAGDBMHOME)/javagdbm.jar $(JAVAGDBMHOME)/jni/GdbmFile.h 
+
+install:
+
+distclean: clean
+	rm -f Makefile
+
Index: /trunk/gsdl3/src/packages/javagdbm/java/au/com/pharos/dbinterface/vf/VFDbInterface.java
===================================================================
--- /trunk/gsdl3/src/packages/javagdbm/java/au/com/pharos/dbinterface/vf/VFDbInterface.java	(revision 10737)
+++ /trunk/gsdl3/src/packages/javagdbm/java/au/com/pharos/dbinterface/vf/VFDbInterface.java	(revision 10737)
@@ -0,0 +1,37 @@
+/*
+ * (C) Pharos IP Pty Ltd 1997
+ */
+
+package au.com.pharos.dbinterface.vf;
+
+import java.util.Date;
+
+import au.com.pharos.gdbm.GdbmFile;
+
+import au.com.pharos.packing;
+
+import au.com.pharos.dbinterface.vf;
+
+public class VFDbInterface {
+
+  /* The Order database */
+  private String orderDB = "/fn/data/Orders.gdbm";
+
+  /* The Stock database */
+  private String stockDB = "/fn/data/Stock.gdbm";
+
+  /* Initialisation.  Nothing needs to happen yet. */
+  public VFDbInterface()
+  {
+    ;
+  }
+
+  /* Submit an order to the database */
+  public void submitOrder(VFOrder order)
+  {
+    GdbmFile db = new GdbmFile(orderDB);
+    db.setKeyPacking(new StringPacking());
+    db.setValuePacking(new QuotedVectorPacking());
+
+    Vector details = order.toVectorString();
+    
Index: /trunk/gsdl3/src/packages/javagdbm/java/au/com/pharos/dbinterface/vf/VFItem.java
===================================================================
--- /trunk/gsdl3/src/packages/javagdbm/java/au/com/pharos/dbinterface/vf/VFItem.java	(revision 10737)
+++ /trunk/gsdl3/src/packages/javagdbm/java/au/com/pharos/dbinterface/vf/VFItem.java	(revision 10737)
@@ -0,0 +1,106 @@
+/*
+ * (C) Pharos IP Pty Ltd 1997
+ */
+package au.com.pharos.dbinterface.vf;
+
+import java.util.Date;
+
+public class VFItem {
+
+  /* The title of the item */
+  public String title;
+
+  /* The name fo the item's distributor */
+  public String distributor;
+
+  /* The category of the item */
+  // TODO: Create a more appropriate type for this?
+  public String category;
+
+  /* The rating of the item */
+  //TODO: Again, a more appropriate type?
+  public String rating;
+
+  /* The list price */
+  public float listPrice;
+
+  /* The supplier's price */
+  public float ourPrice;
+
+  /* The release date for the item */
+  public Date releaseDate;
+
+  /* The date upon which the video is accessible to PayTV */
+  public Date payTVWindow;
+
+  /* The date upon which the video is accessible to free-to-air TV */
+  public Date tvWindow;
+
+  /* The sell-through beginning date */
+  public Date sellThruWindow;
+
+  /* Whether or not the item has an internal magazine advertisement */
+  public boolean magAdvert;
+
+  /* The recommended number of items for Budget 1 stores */
+  public short budget1;
+
+  /* For budget 2 stores */
+  public short budget2;
+
+  /* Budget 3 stores */
+  public short budget3;
+
+  /* Budget 4 stores */
+  public short budget4;
+
+  /* Will the item be advertised by the VideoIndustry Professional Association */
+  boolean vipa;
+
+  /* Initialise all the attributes */
+  public VFItem(String newTitle,
+		String newDistrib,
+		String newCat,
+		String newRating,
+		float newList,
+		float newPrice,
+		Date newRelease,
+		Date newPaytv,
+		Date newTv,
+		boolean isMagAdvert,
+		short newBudget1,
+		short newBudget2,
+		short newBudget3,
+		short newBudget4
+		boolean newvipa)
+  {
+    title = newTitle;
+    distributor = newDistrib;
+    category = newCat;
+    rating = newRating;
+    listPrice = newList;
+    ourPrice = newPrice;
+    releaseDate = newRelease;
+    payTVWindow = newPaytv;
+    tvWindow = newTv;
+    magAdvert = isMagAdvert;
+    budget1 = newBudget1;
+    budget2 = newBudget2;
+    budget3 = newBudget3;
+    budget4 = newBudget4;
+    vipa = newvipa;
+  }
+
+  public boolean equals (Object o)
+  {
+    if (!(o instanceof VFItem)) {
+      return false;
+    }
+    VFItem other = (VFItem) o;
+    if (title.equals(other.title) && distributor.equals(other.distributor) && category.equals(other.category)) {
+      return true;
+    }
+    return false;
+  }
+
+}
Index: /trunk/gsdl3/src/packages/javagdbm/java/au/com/pharos/dbinterface/vf/VFOrder.java
===================================================================
--- /trunk/gsdl3/src/packages/javagdbm/java/au/com/pharos/dbinterface/vf/VFOrder.java	(revision 10737)
+++ /trunk/gsdl3/src/packages/javagdbm/java/au/com/pharos/dbinterface/vf/VFOrder.java	(revision 10737)
@@ -0,0 +1,116 @@
+/*
+ * (C) Pharos IP PTy Ltd 1997
+ */
+
+package au.com.pharos.dbinterface.vf;
+
+import java.util.Date;
+import java.util.Vector;
+import java.util.Hashtable;
+import java.util.Enumeration;
+
+import java.text.SimpleDateFormat;
+import java.text.ParsePosition;
+
+import java.text.SimpleDateFormat;
+
+public class VFOrder {
+
+  /* The final date for submission */
+  public Date finalSubmit;
+
+  /* The date the order was created */
+  public Date orderDate;
+
+  /* A hash mapping titles requested to numbers of each title*/
+  public Hashtable orderNumbers;
+  
+  /* The name of the ordering store */
+  public String name;
+
+  public VFOrder(Date newFinal,
+		 String newName,
+		 Hashtable newOrder)
+  {
+    finalSubmit = newFinal;
+    orderNumbers = newOrder;
+    name = newName;
+    orderDate = new Date(System.currentTimeMillis());
+    if (orderDate.after(finalSubmit)) {
+      throw new IllegalArgumentException("Final submission date is earlier than present date.");
+    }
+  }
+
+  public VFOrder(Date newFinal,
+		 Date newDate,
+		 String newName,
+		 Hashtable newOrder)
+  {
+    finalSubmit = newFinal;
+    orderDate = newDate;
+    orderNumbers = newOrder;
+    name = newName;
+    orderDate = new Date(System.currentTimeMillis());
+    if (orderDate.after(finalSubmit)) {
+      throw new IllegalArgumentException("Final submission date is earlier than present date.");
+    }
+  }
+
+  public Vector toVectorString()
+  {
+    Vector result = new Vector();
+    result.addElement(new Long(finalSubmit.getTime()));
+    result.addElement(new Long(orderDate.getTime()));
+    result.addElement(orderNumbers.toString());
+    result.addElement(name);
+    return result;
+  }
+
+  public VFOrder fromVectorString(Vector input)
+       throws java.text.ParseException
+  {
+    Hashtable data = new Hashtable();
+    SimpleDateFormat form = new SimpleDateFormat();
+    for (Enumeration e = input.elements(); e.hasMoreElements(); ) {
+      System.out.println(e.nextElement());
+    }
+    try {
+      finalSubmit = new Date(((Long) input.elementAt(0)).longValue());
+    } catch (NullPointerException e) {
+      System.err.println("Waaaah!");
+      finalSubmit = new Date();
+    }
+    System.err.println("No 2:" + input.elementAt(1).toString());
+    orderDate = new Date(((Long) input.elementAt(1)).longValue());
+    name = (String) input.elementAt(3);
+    String hashString = (String) input.elementAt(2);
+    StringBuffer key = new StringBuffer();;
+    StringBuffer value = new StringBuffer();
+    String type = new String("key");
+    for (int count = 0; count < hashString.length(); count++) {
+      char i = hashString.charAt(count);
+      if (i == '{' || i == ' ') { ; }
+      else if (i == '}') { data.put(key, value); }
+      else if (i == ',') {data.put(key, value); }
+      else if (i == '=') {
+	if (type.equals("key")) {
+	  type = "value";
+	} else {
+	  type = "key";
+	}
+      } else {
+	if (type.equals("key")) {
+	  key.append(i);
+	} else {
+	  value.append(i);
+	}
+      }
+    }
+    return new VFOrder(finalSubmit, orderDate, name, data);
+  }
+	
+      
+
+
+}
+  
Index: /trunk/gsdl3/src/packages/javagdbm/java/au/com/pharos/gdbm/Closeable.java
===================================================================
--- /trunk/gsdl3/src/packages/javagdbm/java/au/com/pharos/gdbm/Closeable.java	(revision 10737)
+++ /trunk/gsdl3/src/packages/javagdbm/java/au/com/pharos/gdbm/Closeable.java	(revision 10737)
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 1997 Pharos IP Pty Ltd
+ * Confidential.  All rights reserved.
+ * $Id$
+ */
+
+package au.com.pharos.gdbm;
+
+import java.io.IOException;
+
+/** A Closeable object is one having a connection to an underlying
+ * data store that may be flushed or closed.
+ *
+ * <P>This interface is intended to complement the Dictionary and
+ * Collection interfaces by reflecting the fact that many such objects
+ * may be closed.
+ *
+ * @author Martin Pool
+ * @version $Revision$
+ **/
+public interface Closeable {
+    /** Write outstanding changes to the underlying database, and
+     * break the connection, freeing any associated resources or
+     * locks.  This generally does not imply that the data will be
+     * lost, merely that it will be released.  If this is not
+     * meaningful for a particular Closeable object, then it should be
+     * a no-op.
+     *
+     * @exception java.io.IOException passed up from the underlying
+     * database.
+     **/
+    public void close() throws IOException;
+
+    /** Write outstanding changes to the underlying database, but
+     * leave the database open.  If this is not meaningful for a
+     * particular Closeable object, then it should be a no-op.
+     *
+     * @exception java.io.IOException passed up from the underlying
+     * database.
+     **/
+    public void sync() throws IOException;
+}
Index: /trunk/gsdl3/src/packages/javagdbm/java/au/com/pharos/gdbm/GdbmDictionary.java
===================================================================
--- /trunk/gsdl3/src/packages/javagdbm/java/au/com/pharos/gdbm/GdbmDictionary.java	(revision 10737)
+++ /trunk/gsdl3/src/packages/javagdbm/java/au/com/pharos/gdbm/GdbmDictionary.java	(revision 10737)
@@ -0,0 +1,157 @@
+/*
+ * module: pip/java/gdbm -- A Java interface to the GDBM library
+ * class:  GdbmDictionary -- Wrap up a GDBM File for use as a Dictionary
+ *
+ * Copyright (C) 1997 Pharos IP Pty Ltd
+ * $Id$
+ *
+ *  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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package au.com.pharos.gdbm;
+
+import java.util.Dictionary;
+import java.util.Enumeration;
+
+/** A GDBM database, presented as a Java dictionary.
+ *
+ * <P>This is a separate class which defers most operations to
+ * GdbmFile because GdbmFile can throw IO exceptions, and because the
+ * interface assumptions for Dictionary are not the same as those of
+ * the IO library.  Perhaps they should be the same.
+ *
+ * <P>The Dictionary class will be partially replaced by the much
+ * more elegant 
+ * <A HREF="http://www.javasoft.com/products/jdk/preview/docs/guide/collections/overview.html">Collections API</A>
+ * in JDK1.2, at which time a GDBM Collections interface will probably
+ * be available.
+ *
+ * @see java.util.Dictionary
+ * @see GdbmFile
+ *
+ * @author Martin Pool
+ * @version $Revision$
+ **/
+// TODO: I wonder if this should be an inner class of GdbmFile?  It
+// would bloat that source file a bit, but would (arguably) more
+// accurately capture the intended design. -- mbp
+public class GdbmDictionary extends Dictionary implements Closeable
+{
+    // XXX: This should probably become a private field, but on the other
+    // hand it's probably useful to be able to apply GDBM-specific methods to
+    // the underlying DB.  -- mbp
+    GdbmFile db;
+
+    public GdbmDictionary(GdbmFile db) {
+	this.db = db;
+    }
+
+    private Exception caughtException;
+    
+    public Exception checkError() {
+	return caughtException;
+    }	
+
+    public int size() {
+	try {
+	    return db.size();
+	} catch (Exception e) {
+	    caughtException = e;
+	    return 0;
+	}
+    }
+
+    public boolean isEmpty() {
+	try {
+	    return db.isEmpty();
+	} catch (Exception e) {
+	    caughtException = e;
+	    return false;
+	}
+    }
+
+    public Enumeration keys() {
+	try {
+	    return db.keys();
+	} catch (Exception e) {
+	    caughtException = e;
+	    return null;
+	}
+    }
+
+    public Enumeration elements() {
+	// TODO: write an iterator class to do this
+	throw new NoSuchMethodError();
+    }
+
+    public Object get(Object key) {
+	try {
+	    return db.fetch(key);
+	} catch (Exception e) {
+	    caughtException = e;
+	    return null;
+	}
+    }
+
+    public Object put(Object key, Object value)  {
+	try {
+	    Object oldValue = db.fetch(key);
+	    db.store(key, value);
+	    return oldValue;
+	} catch (Exception e) {
+	    caughtException = e;
+	    return null;
+	}
+    }
+
+    public Object remove(Object key) {
+	try {
+	    Object oldValue = db.fetch(key);
+	    db.delete(key);
+	    return oldValue;
+	} catch (Exception e) {
+	    caughtException = e;
+	    return null;
+	}
+    }
+
+    /** Write outstanding changes to the underlying database, and
+     * close the database.
+     *
+     * @see au.com.pharos.gdbm.Closeable
+     **/
+    public void close() {
+	try {
+	    if (db != null && db.isOpen())
+		db.close();
+	    db = null;
+	} catch (GdbmException e) {
+	    ;
+	}
+    }
+
+    /** Write outstanding changes to the underlying database, but
+     * leave the database open.
+     *
+     * @see au.com.pharos.gdbm.Closeable
+     **/
+    public void sync() {
+	try {
+	    db.sync();
+	} catch (GdbmException e) {
+	    ;
+	}
+    }
+}
Index: /trunk/gsdl3/src/packages/javagdbm/java/au/com/pharos/gdbm/GdbmException.java
===================================================================
--- /trunk/gsdl3/src/packages/javagdbm/java/au/com/pharos/gdbm/GdbmException.java	(revision 10737)
+++ /trunk/gsdl3/src/packages/javagdbm/java/au/com/pharos/gdbm/GdbmException.java	(revision 10737)
@@ -0,0 +1,45 @@
+/*
+ * module: pip/java/gdbm -- A Java interface to the GDBM library
+ * class:  GdbmException -- An exception originating in the GDBM library
+ * Copyright (C) 1997 Pharos IP Pty Ltd
+ * $Id$
+ *
+ *  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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package au.com.pharos.gdbm;
+
+import java.io.IOException;
+
+/** An exception originating in the GDBM library.
+ *
+ * @author Martin Pool
+ * @version $Revision$ 
+ * @see au.com.pharos.gdbm.GdbmFile
+ */
+
+public class GdbmException extends IOException
+{
+    // TODO: Perhaps provide more information about which particular
+    // exception caused the problem?
+    /** Constructs a GdbmException with the specified reason.
+    **/
+    public GdbmException(String reason)
+    {
+	super(reason);
+    }
+}
+
+
Index: /trunk/gsdl3/src/packages/javagdbm/java/au/com/pharos/gdbm/GdbmFile.java
===================================================================
--- /trunk/gsdl3/src/packages/javagdbm/java/au/com/pharos/gdbm/GdbmFile.java	(revision 10737)
+++ /trunk/gsdl3/src/packages/javagdbm/java/au/com/pharos/gdbm/GdbmFile.java	(revision 10737)
@@ -0,0 +1,563 @@
+/*
+ * Copyright (C) 1997 Pharos IP Pty Ltd
+ * $Id$
+ *
+ *  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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package au.com.pharos.gdbm;
+
+import java.util.Enumeration;
+import java.util.NoSuchElementException;
+
+import au.com.pharos.packing.Packing;
+import au.com.pharos.packing.RawPacking;
+
+/** Java interface to a GDBM database table.
+ *
+ * <P>This database is a simple on-disk hash table.
+ *
+ * <P>Both the hash keys and values
+ * are binary strings of any length.  They are converted to and
+ * from Java objects using customizable packing strategies.
+ *
+ * <P>The implementation of this class consists of two levels: a
+ * Java-level interface, and a set of private native functions
+ * implemented in C.  As much functionality as possible is implemented
+ * in Java: the C functions generally just marshal the information for
+ * presentation to the native GDBM library.
+ *
+ * <P>The native library <CODE>gdbmjava</CODE> must be available
+ * for dynamic loading in a system-dependant manner.
+ *
+ * <p>See the GDBM documentation file, and the
+ * <A HREF="http://www.pharos.com.au/gdbm/">JavaGDBM home page</A>
+ * for more information.
+ *
+ * @see au.com.pharos.packing.Packing
+ * @see au.com.pharos.gdbm.GdbmTest
+ * @see au.com.pharos.gdbm.GdbmDictionary
+ *
+ * @author Martin Pool
+ * @version $Revision$
+ **/
+
+public class GdbmFile implements Closeable {
+    /** The GDBM handle for the database file, or 0 if the database has
+     * been closed.  Java doesn't understand it, but it stores it and
+     * passes it to the C routines. */
+    private transient volatile long dbf;
+
+    // Remember the parameters used to open the database
+    private int openFlags;
+    private String dbFilename;
+
+    // -----------------------------------------------------------------
+    // Constructors
+
+    // Values must match those from gdbm.h !
+    /** Indicates that the caller will just read the database.  Many
+     * readers may share a database. */
+    public final static int READER = 0;
+
+    /** The caller wants read/write access to an existing database and
+     * requires exclusive access. */
+    public final static int WRITER = 1;
+
+    /** The caller wants exclusive read/write access, and the database
+     * should be created if it does not already exist. */
+    public final static int WRCREAT = 2;
+
+    /** The caller wants exclusive read/write access, and the database
+     * should be replaced if it already exists. */
+    public final static int NEWDB = 3;
+
+    /** Flag indicating GDBM should write to the database without disc
+     * synchronization.  This allows faster writes, but may produce an
+     * inconsistent database in the event of abnormal termination of
+     * the writer. */
+    public final static int FAST = 16;
+
+    // TODO: Allow FAST mode to be toggled
+
+    /** Creates a new GdbmFile object representing an disk database.  The
+     * database is opened or created on disk.
+     *
+     * <P>Both key and value strategies default to
+     * RawPacking, meaning that the database will use raw byte arrays
+     * for both key and value.
+     *
+     * <P>TODO: Allow the caller to specify the block size and/or
+     * cache size.
+     *
+     * @param fileName the disk filename in which the data will be stored.
+     *
+     * @param flags any of READER, WRITER, WRCREAT, and NEWDB, optionally
+     * ORed with FAST
+     *
+     * @exception GdbmException if the database cannot be opened or
+     * created.
+     *
+     * @see GdbmFile#READER
+     * @see GdbmFile#WRITER
+     * @see GdbmFile#WRCREAT
+     * @see GdbmFile#NEWDB
+     * @see GdbmFile#FAST
+     */
+    public GdbmFile(String fileName, int flags)
+	 throws GdbmException
+    {
+	openFlags = flags;
+	dbFilename = fileName;
+	keyPacking = new RawPacking();
+	valuePacking = new RawPacking();
+	dbf = gdbm_open(fileName, flags);
+    }
+
+    /** Close the database file if it is still open.
+     *
+     * <P><B>Note</B> that the disk file is locked against access from
+     * other processes while it is open.  To prevent contention, it
+     * may be useful to explicitly close the file rather than waiting
+     * for the garbage-collector.
+     *
+     * @see GdbmFile#isOpen()
+     **/
+    public synchronized void close() throws GdbmException
+    {
+	if (dbf != 0)
+	    gdbm_close(dbf);
+	dbf = 0;		// No longer connected
+    }
+
+    /** Close the database when the GdbmFile is garbage-collected.
+     *
+     * @see GdbmFile#close()
+     */
+    public void finalize() throws GdbmException
+    {
+	close();
+    }
+
+    /* The Gdbm file is unlocked when the process terminates, but
+     * nevertheless it would be good to close it in finalization, in
+     * case the OS process continues after the JVM terminates.
+     *
+     * XXX: Unfortunately, anybody else can turn this off again: it
+     * would be nice if there was a way to avoid this. */
+    static {
+	System.runFinalizersOnExit(true);
+    }
+
+
+
+    // -----------------------------------------------------------------
+    // Packing strategies
+    private Packing keyPacking, valuePacking;
+
+    /** Set the object to be used as the packing strategy for
+     * converting key objects to and from the byte arrays stored in
+     * the database.
+     *
+     * <P>Depending on the class of Java object used as the key of your
+     * database, it may be appropriate to use a packing strategy from
+     * the
+     * <A HREF="Package-au.com.pharos.packing.html"><CODE>au.com.pharos.packing</CODE></A>
+     * package, or to define a new subclass of one of those strategies.
+     *
+     * @see au.com.pharos.packing.Packing
+     * @see GdbmFile#setValuePacking(au.com.pharos.packing.Packing)
+     **/
+    public void setKeyPacking(Packing newPacking) {
+	keyPacking = newPacking;
+    }
+
+    /** Set the object to be used as the packing strategy for
+     * converting value objects to and from the byte arrays stored
+     *  in the database.
+     *
+     * <P>Depending on the class of Java object used as the key of your
+     * database, it may be appropriate to use a packing strategy from
+     * the
+     * <A HREF="Package-au.com.pharos.packing.html"><CODE>au.com.pharos.packing</CODE></A>
+     * package, or to define a new subclass of one of those strategies.
+     *
+     * @see au.com.pharos.packing.Packing
+     * @see GdbmFile#setKeyPacking(au.com.pharos.packing.Packing )
+     **/
+    public void setValuePacking(Packing newPacking) {
+	valuePacking = newPacking;
+    }
+
+    // -----------------------------------------------------------------
+
+    /** Returns a string indicating the version of the underlying GDBM
+     * library.
+     *
+     * @return the version of the native GDBM library.
+     **/
+    public static String getLibraryVersion()
+    {
+	return gdbm_getversion();
+    }
+
+    /** Return a string indicating the version of the JavaGDBM library
+     * wrapper.
+     *
+     * <P>The most current release is available from the
+     * <A HREF="http://www.pharos.com.au/javagdbm/">JavaGDBM home page</A>.
+     *
+     * @return the release number of the JavaGDBM library
+     **/
+    public static String getWrapperVersion()
+    {
+	return gdbm_wrapperVersion();
+    }
+
+    /** Indicate whether the database is writable.
+     *
+     * <P>Databases are opened in either read-write or read-only mode,
+     * and remain in that mode until they are closed.
+     *
+     * @return true if the database may be written; otherwise false.
+     *
+     * @see GdbmFile#GdbmFile(java.lang.String, int)
+     **/
+    public boolean isWritable()
+    {
+	return (openFlags & 0x03) != READER;
+    }
+
+    /** Indicate whether the database is open or not.
+     *
+     * <P>A database is open from the point of creation until close()
+     * is called, if ever, after which it is closed.
+     *
+     * @return false if the database has been closed; otherwise true.
+     *
+     * @see GdbmFile#close()
+     **/
+    public boolean isOpen()
+    {
+	return dbf != 0;
+    }
+
+
+    /** Compact the database file.
+     *
+     * <P>If you have had a lot of deletions and would like to shrink the
+     * space used by the GDBM file, this function will reorganize the
+     * database.  GDBM will not shorten the length of a GDBM file
+     * (deleted file space will be reused) except by using this
+     * reorganization, though it will reuse the vacant space.
+     *
+     * <P>The database must be writable.
+     */
+    public void reorganize()
+	 throws GdbmException
+    {
+	gdbm_reorganize(dbf);
+    }
+    
+
+    /** Flush changes to disk.
+     *
+     * <P>This function is only required when the database is
+     * opened with the FAST flag set.  By default, changes are
+     * flushed to disk after every update.
+     *
+     * <P>The database must be writable.
+     *
+     * @see GdbmFile#FAST
+     **/
+    public void sync()
+	 throws GdbmException
+    {
+	gdbm_sync(dbf);
+    }
+
+
+
+    /** Retrieve the value corresponding to a particular key.
+     *
+     * @param key the key of the record to be retrieved
+     *
+     * @return the value of the record with the specified key; or
+     * null if the key is not present in the database.
+     */
+    public Object fetch(Object key) throws GdbmException
+    {
+	byte[] keyBytes = keyPacking.toBytes(key);
+	return valuePacking.fromBytes(gdbm_fetch(dbf, keyBytes));
+    }
+
+
+    /** Indicate whether the specified key is in the database,
+     * without returning the value.
+     *
+     * @param key the key of the record to be retrieved
+     *
+     * @return true if a record with the specified key is present;
+     * otherwise false.
+     */
+    public boolean exists(Object key) throws GdbmException
+    {
+	byte[] keyBytes = keyPacking.toBytes(key);
+	return gdbm_exists(dbf, keyBytes);
+    }
+
+
+
+    /** Store a value in the database, replacing any existing value
+     * with the same key.
+     *
+     * @param key key under which to store the value
+     *
+     * @param value value to be stored
+     *
+     * @exception GdbmException if the object is a reader; or
+     * if an IO error occurs
+     **/
+    public void store(Object key, Object value)
+	 throws GdbmException
+    {
+	byte[] keyBytes = keyPacking.toBytes(key);
+	byte[] valueBytes = valuePacking.toBytes(value);
+	gdbm_store(dbf, keyBytes, valueBytes, true);
+    }
+
+
+    
+    /** Store a value in the database, unless a record with the same
+     * key already exists.
+     *
+     * @param key key under which to store the value.
+     *
+     * @param value value to be stored.
+     *
+     * @exception GdbmException if a record with the specified key
+     * already exists; or if the object is a reader; or
+     * if an IO error occurs
+     */
+    public void storeNoReplace(Object key, Object value)
+	 throws GdbmException
+    {
+	byte[] keyBytes = keyPacking.toBytes(key);
+	byte[] valueBytes = valuePacking.toBytes(value);
+ 	gdbm_store(dbf, keyBytes, valueBytes, false);
+    }
+
+
+    
+    /** Remove a record from the database.
+     *
+     * @param key key of the record to be removed
+     *
+     * @exception GdbmException if there is no record with the
+     * specified key; or if the object is a reader; or if an IO error
+     * occurs.
+     **/
+    public void delete(Object key)
+	 throws GdbmException
+    {
+	byte[] keyBytes = keyPacking.toBytes(key);
+	gdbm_delete(dbf, keyBytes);
+    }
+
+
+
+
+
+    // -----------------------------------------------------------------
+    // Iterator support
+
+    // TODO: Use a flag/timestamp approach to throw an exception if
+    // somebody modifies the database while they're trying to iterate
+    // over it?  Approach suggested by Doug Lea's Collections API. --
+    // mbp
+
+    /** Return an enumeration which will return all of the keys for the
+     * database of the file in (apparently) random order.
+     *
+     * <P><B>Caution:</B> If the database is modified while
+     * an enumeration is in progress,
+     * then changes in the hash table may cause the enumeration to
+     * miss some records.
+     *
+     * @see java.util.Enumeration
+     **/
+    public Enumeration keys() throws GdbmException
+    {
+	// Return an inner class which will do the iteration in the
+	// context of this GdbmFile object.
+	return new KeyEnumeration();
+    }
+
+    // Synchronization is performed in the GdbmFile's methods
+    class KeyEnumeration implements Enumeration {
+	private byte[] currKey, nextKey;
+
+	KeyEnumeration() throws GdbmException {
+	    currKey = null;
+	    nextKey = getFirstKeyRaw();
+	}
+
+	public boolean hasMoreElements() {
+	    return nextKey != null;
+	}
+
+	public Object nextElement() throws NoSuchElementException {
+	    try {
+		currKey = nextKey;
+		if (currKey == null)
+		    throw new NoSuchElementException();
+		else
+		    nextKey = getNextKeyRaw(currKey);
+		return keyPacking.fromBytes(currKey);
+	    } catch ( GdbmException e ) {
+		// Can't propagate this through java.util.Enumeration, dammit
+		throw new NoSuchElementException();
+	    }
+	}
+    }
+
+    /** Start a visit to all keys in the hashtable, using raw data values.
+     *
+     * @return the first key in the hash table as a byte array; or null if
+     * the database is empty. */
+    byte[] getFirstKeyRaw() throws GdbmException
+    {
+	return gdbm_firstkey(dbf);
+    }
+
+    /** Return the first record in the hashtable.
+     *
+     * <P>Note that the database
+     * is not ordered, so the key returned is simply the first in the
+     * hashtable and effectively randomly selected.
+     *
+     * @return the first key in the hash table; or null if
+     * the database is empty.
+     *
+     * @see GdbmFile#getNextKey(java.lang.Object)
+     * @see GdbmFile#keys()
+     **/
+    Object getFirstKey() throws GdbmException
+    {
+	return keyPacking.fromBytes(getFirstKeyRaw());
+    }
+
+
+    /** Find and read the next key in the hashtable.
+     *
+     * @return the next key; or null if <EM>keyBytes</EM> is the last key
+     * in the hashtable.
+     **/
+    byte[] getNextKeyRaw(byte[] keyBytes) throws GdbmException
+    {
+	return gdbm_nextkey(dbf, keyBytes);
+    }
+
+
+    /** Check whether the database is empty.
+     *
+     * @return true if the database contains no records; otherwise
+     * false.
+     **/
+    public boolean isEmpty() throws GdbmException
+    {
+	return getFirstKeyRaw() == null;
+    }
+
+
+    /** Count the records in the database.
+     *
+     * <P>This is implemented by iterating over the database, and so is
+     * a fairly expensive operation.
+     *
+     * <P>This method locks the database to make sure the count is
+     * accurate.
+     *
+     * @return the number of records in the database
+     * @see GdbmFile#isEmpty()
+     **/
+    public synchronized int size() throws GdbmException
+    {
+	int s = 0;
+	byte[] key = getFirstKeyRaw();
+	while (key != null) {
+	    s++;
+	    key = getNextKeyRaw(key);
+	}
+	return s;
+    }
+
+
+    static {
+	String libraryFile = System.getProperty
+	    ("au.com.pharos.gdbm.libraryFile");
+
+	if (libraryFile != null) {
+	    System.load(libraryFile);
+	} else {
+	    System.loadLibrary("gdbmjava");
+	}
+    }
+
+    private synchronized native long
+    gdbm_open(String fileName, int flags)
+	 throws GdbmException;
+
+    private synchronized native void
+    gdbm_close(long dbf);
+
+    private synchronized native void
+    gdbm_store(long dbf,
+	       byte[] key,
+	       byte[] content,
+	       boolean replace);
+
+    private synchronized native byte[]
+    gdbm_fetch(long dbf,
+	       byte[] key);
+
+    private synchronized native boolean
+    gdbm_exists(long dbf,
+		byte[] key);
+
+    private synchronized native void
+    gdbm_delete(long dbf,
+		byte[] key);
+
+    private synchronized native byte[]
+    gdbm_firstkey(long dbf)
+	 throws GdbmException;
+
+    private synchronized native byte[]
+    gdbm_nextkey(long dbf, byte[] key)
+	 throws GdbmException;
+
+    private synchronized static native String
+    gdbm_getversion();
+
+    private synchronized static native String
+    gdbm_wrapperVersion();
+
+    private synchronized native void
+    gdbm_reorganize(long dbf);
+
+    private synchronized native void
+    gdbm_sync(long dbf);
+}
Index: /trunk/gsdl3/src/packages/javagdbm/java/au/com/pharos/gdbm/GdbmTest.java
===================================================================
--- /trunk/gsdl3/src/packages/javagdbm/java/au/com/pharos/gdbm/GdbmTest.java	(revision 10737)
+++ /trunk/gsdl3/src/packages/javagdbm/java/au/com/pharos/gdbm/GdbmTest.java	(revision 10737)
@@ -0,0 +1,296 @@
+/*
+ * module: pip/java/gdbm -- A Java interface to the GDBM library
+ * class:  GdbmTest -- Test suite for this package
+ * Copyright (C) 1997 Pharos IP Pty Ltd
+ * $Id$
+ *
+ *  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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package au.com.pharos.gdbm;
+
+import java.io.PrintStream;
+
+import java.util.Enumeration;
+
+import au.com.pharos.test.Test;
+import au.com.pharos.packing.Packing;
+import au.com.pharos.packing.StringPacking;
+import au.com.pharos.packing.RawPacking;
+
+/** Test harness for the Gdbm library.
+ *
+ * <P>The source of this class forms a useful demonstration of the
+ * JavaGDBM library and is commended to the intending programmer.
+ *
+ * <P>More test cases would be very welcome.
+ *
+ * @see au.com.pharos.gdbm.GdbmFile
+ * @see au.com.pharos.packing.Packing
+ * @author Martin Pool
+ * @version $Revision$
+ */
+public class GdbmTest {
+    // Don't instantiate
+    private GdbmTest() { ; }
+    
+    private static void testLongData(GdbmFile db)
+	 throws Exception
+    {
+	StringBuffer lgBuffer = new StringBuffer();
+	for (int i = 0; i < 100; i++)
+	    lgBuffer.append("ABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890" +
+			    "ABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890" +
+			    "ABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890");
+
+	String lgString = lgBuffer.toString();
+	lgBuffer = null;
+	String smallKey = "largeDatum";
+
+	db.store(smallKey, lgString);
+	String retr = (String) db.fetch(smallKey);
+
+	Test.ok(9, retr.hashCode() == lgString.hashCode());
+	Test.ok(10, retr.equals(lgString));
+
+	db.delete(smallKey);
+	Test.ok(11, true);
+
+	db.reorganize();
+	Test.ok(12, true);
+    }
+
+
+    static final int MANY_RECORDS = 200;
+    
+    private static void testBigFile(GdbmFile db)
+	 throws Exception
+    {
+	String key;
+
+	// Test a lot of data
+	byte[] bigData = new byte[10000];
+	for (int i = 0; i < bigData.length; i++)
+	    bigData[i] = (byte)((i & 63) + 32);
+	db.setValuePacking(new RawPacking());
+	Test.ok(150, true);
+
+	// Store a series of records in the file
+	for (int i = 0; i < MANY_RECORDS; i++) {
+	    if ((i % 100) == 0)
+		System.out.print(Integer.toString(i)+ " ");
+	    db.store(Integer.toString(i, 16), bigData);
+	}
+	System.out.println();
+	Test.ok(151, true);
+
+	// Enumerate keys and values out of the file
+	int count = 0;
+	Enumeration keys = db.keys();
+	while ( keys.hasMoreElements() ) {
+	    key = (String) keys.nextElement();
+	    count++;
+	    if ((count % 100) == 0)
+		System.out.print(Integer.toString(count)+ " ");
+	}
+	System.out.println();
+	Test.ok(152, count==MANY_RECORDS);
+
+	// Delete all the records from the file
+	count = 0;
+	while ( (key = (String) db.getFirstKey()) != null ) {
+	    db.delete(key);
+	    count++;
+	    if ((count % 100) == 0)
+		System.out.print(Integer.toString(count)+ " ");
+	}
+	System.out.println();
+	Test.ok(153, count==MANY_RECORDS);
+
+	db.reorganize();
+	Test.ok(154, true);
+    }
+
+    public static void main(String[] argv) {
+	try {
+	    final String dbFile = "/tmp/java.gdbm";
+	    String key, value;
+	    boolean found;
+
+	    // Test cases, inspired by db-hash.t in the Perl5.003_93
+	    // distribution
+	    System.out.print("GDBM Database tests:\n\t" +
+			     GdbmFile.getLibraryVersion() + "\n\t" +
+			     GdbmFile.getWrapperVersion() + "\n");
+
+	    // Create a simple database
+	    GdbmFile db = new GdbmFile(dbFile, GdbmFile.NEWDB);
+	    Test.ok(1, db != null);
+
+	    // Set the packing strategy
+	    db.setKeyPacking(new StringPacking());
+	    db.setValuePacking(new StringPacking());
+
+	    // Store some data in the file
+	    db.store("mountain", "Kosciusko");
+	    Test.ok(2, true);
+
+	    // Store and read back data
+	    db.storeNoReplace("abc", "ABC");
+	    Test.ok(3, ((String) db.fetch("abc")).equals("ABC"));
+
+	    // Check whether keys exist or not
+	    Test.ok(4, db.exists("abc"));
+	    Test.ok(5, !db.exists("jimmy"));
+	    Test.ok(6, !db.exists("abc\0"));
+
+	    // Delete those records
+	    db.delete("abc");
+	    db.delete("mountain");
+
+	    Test.ok(10, !db.exists("abc"));
+	    Test.ok(11, !db.exists("mountain"));
+
+	    // Store a series of records in the file
+	    for (int i = 100; i < 200; i++)
+		db.storeNoReplace(Integer.toString(i, Character.MAX_RADIX),
+				  Integer.toString(i, Character.MIN_RADIX));
+
+	    // Enumerate keys and values out of the file
+	    int count = 0;
+	    Enumeration keys = db.keys();
+	    while ( keys.hasMoreElements() ) {
+		key = (String) keys.nextElement();
+		// System.out.print(key + "=");
+		// value = (String) db.fetch(key);
+		// System.out.println(value);
+		count++;
+	    }
+	    Test.ok(20, count==100);
+
+	    // Delete all the records from the file
+	    count = 0;
+	    while ( (key = (String) db.getFirstKey()) != null ) {
+		db.delete(key);
+		count++;
+	    }
+	    Test.ok(30, count==100);
+
+	    // Try to fetch a non-existent key
+	    boolean caught = false;
+	    try {
+		db.fetch("larry!");
+	    } catch ( GdbmException e ) {
+		// TODO: Check the exception was the one we expected?
+		caught = true;
+	    }
+	    Test.ok(40, caught);
+
+	    // Store some very large data
+	    testLongData(db);
+
+	    // Store strings containing non-ASCII characters
+	    final String euroString = "Some funny characters: «¡ æ ø â ß !»";
+	    db.store("high ASCII", euroString);
+	    Test.ok(50, db.fetch("high ASCII").equals(euroString));
+
+	    // Close the database
+	    db.close();
+	    Test.ok(60, true);
+
+	    // Try to read from a database that is closed
+	    caught = false;
+	    try {
+		db.fetch("larry!");
+	    } catch ( Exception e ) {
+		System.out.println("caught: " + e.toString());
+		caught = true;
+	    }
+	    Test.ok(70, caught);
+
+	    // Try to open a non-existent database
+	    caught = false;
+	    try {
+		db = new GdbmFile("/tmp/somenonexistentdatabase.gdbm",
+				  GdbmFile.READER);
+	    } catch ( GdbmException e ) {
+		System.out.println("caught: " + e.toString());
+		caught = true;
+	    }
+	    Test.ok(80, caught);
+
+	    // Open a database read-only
+	    db = new GdbmFile(dbFile, GdbmFile.READER);
+	    db.setKeyPacking(new StringPacking());
+	    db.setValuePacking(new StringPacking());
+	    Test.ok(90);
+
+	    // Try to insert
+	    caught = false;
+	    try {
+		db.store("apple", "crumble");
+	    } catch ( GdbmException e ) {
+		System.out.println("caught: " + e.toString());
+		caught = true;
+	    }
+	    Test.ok(91, caught);
+
+	    // Replace an existing database
+	    db.close();
+	    db = new GdbmFile(dbFile, GdbmFile.NEWDB);
+	    db.setKeyPacking(new StringPacking());
+	    db.setValuePacking(new StringPacking());
+	    Test.ok(100, !db.exists("camel"));
+
+	    // Sync to disk
+	    db.sync();
+	    Test.ok(105, true);
+
+	    // Juggle three databases at once
+	    final String dbFile2 = "/tmp/java2.gdbm";
+	    GdbmFile db2 = new GdbmFile(dbFile2, GdbmFile.NEWDB);
+	    final String dbFile3 = "/tmp/java3.gdbm";
+	    GdbmFile db3 = new GdbmFile(dbFile3, GdbmFile.NEWDB);
+	    Test.ok(110, true);
+
+	    keys = db.keys();
+	    while (keys.hasMoreElements()) {
+		key = (String) keys.nextElement();
+		value = (String) db.fetch(key);
+		db2.store(key.getBytes(), value.getBytes());
+		db3.store(key.getBytes(), value.getBytes());
+	    }
+	    Test.ok(120, true);
+
+	    keys = db2.keys();
+	    found = true;
+	    while (keys.hasMoreElements())
+		found &= db3.exists(keys.nextElement());
+	    Test.ok(130, found);
+
+	    db2.close();
+	    db3.close();
+
+	    Test.ok(140, true);
+
+	    testBigFile(db);
+
+	    db.close();
+	    Test.ok(160, true);
+	} catch (Exception e) {
+	    e.printStackTrace();
+	}
+    }
+}
Index: /trunk/gsdl3/src/packages/javagdbm/java/au/com/pharos/io/IOUtils.java
===================================================================
--- /trunk/gsdl3/src/packages/javagdbm/java/au/com/pharos/io/IOUtils.java	(revision 10737)
+++ /trunk/gsdl3/src/packages/javagdbm/java/au/com/pharos/io/IOUtils.java	(revision 10737)
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 1997 by Pharos IP Pty Ltd
+ * All rights reserved.
+ * $Id$
+ */
+
+package au.com.pharos.io;
+
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.IOException;
+
+/**
+ * Plumbing utilities for manipulating Java IO classes.
+ *
+ * <P>These utilities really ought to be part of the
+ * <CODE>java.io</CODE> package, but they're not.  Since they're
+ * pretty useful, here they are.
+ *
+ * @version $Revision$
+ * @author Martin Pool
+ **/
+public class IOUtils {
+    /** Size of blocks to read during IO. **/
+    static public final int BLOCK_SIZE = 4<<10;
+
+    static public void pumpStream(InputStream inStream,
+				  OutputStream outStream,
+				  int contentLength)
+	 throws IOException
+    {
+	int readBytes = 0;
+	byte[] block = new byte[BLOCK_SIZE];
+	int blockBytes;
+	while (readBytes < contentLength
+	       && (blockBytes = inStream.read(block)) > 0) {
+	    readBytes += blockBytes;
+	    outStream.write(block, 0, blockBytes);
+	}
+    }
+
+    static public int pumpStream(InputStream inStream,
+				 OutputStream outStream)
+	 throws IOException
+    {
+	byte[] block = new byte[BLOCK_SIZE];
+	int blockBytes, readBytes = 0;
+	while ( (blockBytes = inStream.read(block)) > 0 ) {
+	    outStream.write(block, 0, blockBytes);
+	    readBytes += blockBytes;
+	}
+	return readBytes;
+    }
+
+    /** Reads the entire contents of the stream into a
+     * newly-constructed byte array.
+     **/
+    static public byte[] readAll(InputStream inStream)
+	 throws IOException
+    {
+	ByteArrayOutputStream byteStream = new ByteArrayOutputStream();
+	pumpStream(inStream, byteStream);
+	byte[] buf = byteStream.toByteArray();
+	byteStream.close();
+	return buf;
+    }
+}
Index: /trunk/gsdl3/src/packages/javagdbm/java/au/com/pharos/meta/SerializationDumper.java
===================================================================
--- /trunk/gsdl3/src/packages/javagdbm/java/au/com/pharos/meta/SerializationDumper.java	(revision 10737)
+++ /trunk/gsdl3/src/packages/javagdbm/java/au/com/pharos/meta/SerializationDumper.java	(revision 10737)
@@ -0,0 +1,171 @@
+/*
+ * Copyright (C) 1997 Pharos IP Pty Ltd
+ * $Id$
+ * Confidential. All rights reserved.
+ */
+
+package au.com.pharos.meta;
+
+import java.lang.reflect.Field;
+
+import java.io.EOFException;
+import java.io.IOException;
+import java.io.InvalidClassException;
+import java.io.InvalidObjectException;
+import java.io.ObjectInput;
+import java.io.ObjectInputStream;
+import java.io.ObjectStreamException;
+import java.io.OptionalDataException;
+import java.io.PrintWriter;
+
+/*
+ * TODO: Allow people to specify an input file?
+ * TODO: Allow people to customize the display format?
+ *
+ * FIXME: We should use a custom classloader to load the untrusted
+ * classes under examination and to allow for flexible handling or
+ * tracing as classes are loaded.
+ */
+
+
+/** Java utility to display in a debugging format the contents of a
+ * serialized object stream.
+ *
+ * <P>Usage:
+ * <PRE>
+ *   java au.com.pharos.meta.SerializationDumper <SERFILE
+ * </PRE>
+ *
+ * where SERFILE is the name of the serialization file.
+ *
+ * <P><B>Limitations:</B>
+ *
+ * <OL>
+ *   <P><LI>Values are displayed only for public fields, due to Java
+ *    security restrictions.
+ *   <P><LI>Only top-level objects are dumped.
+ * </OL>
+ *
+ * <P>These are fairly serious restrictions, but SerializationDumper
+ * at least checks that the stream is well-formed, and gives some
+ * indication of what it contains.
+ *
+ * @author Martin Pool
+ * @version $Revision$
+ **/
+public class SerializationDumper {
+    public static void main(String argv[])
+    {
+	try {
+	    ObjectInput in = new ObjectInputStream(System.in);
+	    PrintWriter writer = new PrintWriter(System.out);
+	    SerializationDumper dumper = new SerializationDumper();
+	    dumper.dump(in, writer);
+	    writer.flush();
+	} catch (IOException e) {
+	    e.printStackTrace();
+	}
+    }
+
+
+    /** Dump all objects read from <EM>in</EM> to <EM>out</EM>
+     * in a human-readable debugging form.
+     **/
+    public void dump(ObjectInput in, PrintWriter out)
+	 throws IOException
+    {
+	while (true) {		// exception on eof
+	    Object obj = null;
+	    try {
+		obj = in.readObject();
+		displayObject(obj, out);
+	    }
+	    catch (ClassNotFoundException e) {
+		warning(e, out);
+	    }
+	    catch (OptionalDataException e) {
+		error(e, out);
+		return;
+	    }
+	    catch (ObjectStreamException e) {
+		warning(e, out);
+	    }
+	    catch (EOFException e) {
+		return;
+	    }
+	}
+    }
+
+
+    /** Display an object in human-readable form. **/
+    private void displayObject(Object obj, PrintWriter out)
+	 throws IOException
+    {
+	if (obj == null) {
+	    out.println("(null)");
+	    return;
+	}
+
+	Class cls = obj.getClass();
+
+	// Print the header: the name, hashcode, and string
+	// representation
+	out.println(cls.getName() + "@0x" +
+		    Integer.toHexString(obj.hashCode()) + "{");
+	out.println("\t\"" + obj.toString() + "\"");
+
+	// TODO: Recursive descent of the graph, allowing for circular
+	// structures.
+
+	// Print each field of the object
+	Field[] fields = cls.getDeclaredFields();
+	for (int i = 0; i < fields.length; i++)
+	    displayField(obj, fields[i], out);
+
+	out.println("}");
+    }
+
+
+    /** Display a particular field from an object in human-readable
+      * form.  Fields which are not accessible for security reasons
+      * are noted as such, and the name and type of the field is
+      * still printed. **/
+    private void displayField(Object obj, Field fld, PrintWriter out)
+	 throws IOException
+    {
+	int flags = fld.getModifiers();
+	out.print("\t");
+	out.print(fld.toString() + ": ");
+	try {
+	    Object value = fld.get(obj);
+	    if (value == null) {
+		out.println("(null)");
+	    }
+	    else {
+		out.println(value.getClass().getName() + "@0x" +
+			    Integer.toHexString(value.hashCode()) + ":");
+		out.println("\t\t\"" + value.toString() + "\"");
+	    }
+	} catch (IllegalAccessException e) {
+	    out.println("(not accessible)");
+	}
+    }
+
+
+    /** Display a warning that an exception occurred while dumping
+     * information. **/
+    private void warning(Exception e, PrintWriter out)
+	 throws IOException
+    {
+	out.println("warning: " + e);
+    }
+
+    /** Display an exception that occurred while dumping
+     * information. **/
+    private void error(Exception e, PrintWriter out)
+	 throws IOException
+    {
+	out.println("error: " + e.toString());
+    }
+}
+
Index: /trunk/gsdl3/src/packages/javagdbm/java/au/com/pharos/meta/ShowClass.java
===================================================================
--- /trunk/gsdl3/src/packages/javagdbm/java/au/com/pharos/meta/ShowClass.java	(revision 10737)
+++ /trunk/gsdl3/src/packages/javagdbm/java/au/com/pharos/meta/ShowClass.java	(revision 10737)
@@ -0,0 +1,118 @@
+// This example is from the book "Java in a Nutshell, Second Edition".
+// Written by David Flanagan.  Copyright (c) 1997 O'Reilly & Associates.
+// You may distribute this source code for non-commercial purposes only.
+// You may study, modify, and use this example for any purpose, as long as
+// this notice is retained.  Note that this example is provided "as is",
+// WITHOUT WARRANTY of any kind either expressed or implied.
+
+import java.lang.reflect.*;
+
+/** A program that displays a class synopsis for the named class */
+public class ShowClass {
+  /** The main method.  Print info about the named class */
+  public static void main(String[] args) throws ClassNotFoundException {
+    Class c = Class.forName(args[0]);
+    print_class(c);
+  }
+
+  /** Display the modifiers, name, superclass and interfaces of a class
+   *  or interface. Then go and list all constructors, fields, and methods. */
+  public static void print_class(Class c)
+  {
+    // Print modifiers, type (class or interface), name and superclass.
+    if (c.isInterface()) {
+      // The modifiers will include the "interface" keyword here...
+      System.out.print(Modifier.toString(c.getModifiers()) +  c.getName());
+    }
+    else
+      System.out.print(Modifier.toString(c.getModifiers()) + " class " +
+                       c.getName() +
+                       " extends " + c.getSuperclass().getName());
+
+    // Print interfaces or super-interfaces of the class or interface.
+    Class[] interfaces = c.getInterfaces();
+    if ((interfaces != null) && (interfaces.length > 0)) {
+      if (c.isInterface()) System.out.println(" extends ");
+      else System.out.print(" implements ");
+      for(int i = 0; i < interfaces.length; i++) {
+        if (i > 0) System.out.print(", ");
+        System.out.print(interfaces[i].getName());
+      }
+    }
+
+    System.out.println(" {");            // Begin class member listing.
+
+    // Now look up and display the members of the class.
+    System.out.println(" // Constructors");
+    Constructor[] constructors = c.getDeclaredConstructors();
+    for(int i = 0; i < constructors.length; i++)      // Display constructors.
+      print_method_or_constructor(constructors[i]);
+
+    System.out.println(" // Fields");
+    Field[] fields = c.getDeclaredFields();           // Look up fields.
+    for(int i = 0; i < fields.length; i++)            // Display them.
+      print_field(fields[i]);
+
+    System.out.println(" // Methods");
+    Method[] methods = c.getDeclaredMethods();        // Look up methods.
+    for(int i = 0; i < methods.length; i++)           // Display them.
+      print_method_or_constructor(methods[i]);
+
+    System.out.println("}");             // End class member listing.
+  }
+
+  /** Return the name of an interface or primitive type, handling arrays. */
+  public static String typename(Class t) {
+    String brackets = "";
+    while(t.isArray()) {
+      brackets += "[]";
+      t = t.getComponentType();
+    }
+    return t.getName() + brackets;
+  }
+
+  /** Return a string version of modifiers, handling spaces nicely. */
+  public static String modifiers(int m) {
+    if (m == 0) return "";
+    else return Modifier.toString(m) + " ";
+  }
+
+  /** Print the modifiers, type, and name of a field */
+  public static void print_field(Field f) {
+    System.out.println("  " +
+                       modifiers(f.getModifiers()) +
+                       typename(f.getType()) + " " + f.getName() + ";");
+  }
+
+  /** Print the modifiers, return type, name, parameter types and exception
+   *  type of a method or constructor.  Note the use of the Member interface
+   *  to allow this method to work with both Method and Constructor objects */
+  public static void print_method_or_constructor(Member member) {
+    Class returntype=null, parameters[], exceptions[];
+    if (member instanceof Method) {
+      Method m = (Method) member;
+      returntype = m.getReturnType();
+      parameters = m.getParameterTypes();
+      exceptions = m.getExceptionTypes();
+    } else {
+      Constructor c = (Constructor) member;
+      parameters = c.getParameterTypes();
+      exceptions = c.getExceptionTypes();
+    }
+
+    System.out.print("  " + modifiers(member.getModifiers()) +
+                     ((returntype!=null)? typename(returntype)+" " : "") +
+                     member.getName() + "(");
+    for(int i = 0; i < parameters.length; i++) {
+      if (i > 0) System.out.print(", ");
+      System.out.print(typename(parameters[i]));
+    }
+    System.out.print(")");
+    if (exceptions.length > 0) System.out.print(" throws ");
+    for(int i = 0; i < exceptions.length; i++) {
+      if (i > 0) System.out.print(", ");
+      System.out.print(typename(exceptions[i]));
+    }
+    System.out.println(";");
+  }
+}
Index: /trunk/gsdl3/src/packages/javagdbm/java/au/com/pharos/packing/NativeStringPacking.java
===================================================================
--- /trunk/gsdl3/src/packages/javagdbm/java/au/com/pharos/packing/NativeStringPacking.java	(revision 10737)
+++ /trunk/gsdl3/src/packages/javagdbm/java/au/com/pharos/packing/NativeStringPacking.java	(revision 10737)
@@ -0,0 +1,82 @@
+/*
+ * module: pip/java/packing -- Strategy objects for converting
+ * Java objects to and from stored data.
+ *
+ * Copyright (C) 1997 Pharos IP Pty Ltd
+ * $Id$
+ *
+ *  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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package au.com.pharos.packing;
+
+/** Convert an array of bytes in a Java string without using String
+ * encodings, just using expanding 8-bit bytes to 16-bit chars.
+ *
+ * <P>This will only work for ASCII characters, of course, but for
+ * moving bulk data around it is considerably faster than using
+ * UTF-8 encoding strategies.  Naively compressing Unicode into
+ * 8-bit characters in this manner is deprecated in JDK1.1 to
+ * help ensure that programs are Unicode-safe.
+ *
+ * @author Martin Pool
+ * @version $Revision$
+ *
+ * @see au.com.pharos.packing.Packing
+ * @see au.com.pharos.packing.StringPacking
+ */
+public class NativeStringPacking extends Packing
+{
+    /** Convert an object to an ASCII String representation.
+     *
+     * @return null if obj is null; obj is obj is already a
+     * byte[]; otherwise an native 8-bite encoded version of
+     * obj.toString().
+     **/
+    public byte[] toBytes(final Object obj)
+    {
+	String str;
+	if (obj == null)
+	    return null;
+	else if (obj instanceof byte[])
+	    return (byte[]) obj;
+	else if (obj instanceof String)
+	    str = (String) obj;
+	else
+	    str = obj.toString();
+
+	int len = str.length();
+	byte[] rawArray = new byte[len];
+	str.getBytes(0, len, rawArray, 0);
+	return rawArray;		     
+    }
+
+    /** Convert an array of bytes into a String
+     *
+     * @param raw the raw data to be decoded.
+     *
+     * @return null if <em>raw</em> is null; otherwise a string with the low
+     * 8 bits of each character taken from the corresponding byte in
+     * <em>raw</em>.
+     **/
+    public Object fromBytes(final byte[] raw)
+    {
+	if (raw == null)
+	    return null;
+	else
+	    return new String(raw, 0);
+    }
+}
+    
Index: /trunk/gsdl3/src/packages/javagdbm/java/au/com/pharos/packing/Packing.java
===================================================================
--- /trunk/gsdl3/src/packages/javagdbm/java/au/com/pharos/packing/Packing.java	(revision 10737)
+++ /trunk/gsdl3/src/packages/javagdbm/java/au/com/pharos/packing/Packing.java	(revision 10737)
@@ -0,0 +1,77 @@
+/*
+ * module: pip/java/packing -- Packing strategy objects for converting
+ *           Java objects to and from stored data.
+ * class: Packing -- Abstract strategy class for packing/unpacking data
+ *
+ * $Id$
+ * Copyright (C) 1997 Pharos IP Pty Ltd
+ *
+ *  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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package au.com.pharos.packing;
+
+/** A packing Packing defines a method of converting an object to
+ * and from an array of bytes for storage in a database.
+ *
+ * <P>Generally, each packing Packing should be reflexive: that is,
+ * converting any object to and from an array of bytes should yield
+ * the same object, or an object appropriately equivalent.
+ *
+ * <P>Some Packing subclasses may not be able to pack all
+ * objects, or may not be able to unpack an object from some byte
+ * arrays.  For example, only Strings can safely be stored as string
+ * representations, and not all arrays are valid Java serialization
+ * forms.  In this case, the Packing object should throw an
+ * <code>IllegalArgumentException</code> from <code>toBytes()</code>
+ * or <code>toBytes()</code>.
+ *
+ * <P>In both cases, null references should be passed through
+ * unchanged.
+ *
+ * <P>Example:
+ * <PRE>
+ *    Packing strategy = new StringPacking();
+ *    byte[] raw = strategy.toBytes("Hello world");
+ *    ... store and retrieve raw[]
+ *    String result = (String) strategy.fromBytes(raw)
+ * </PRE>
+ *
+ *
+ * @see au.com.pharos.packing.StringPacking
+ * @see au.com.pharos.packing.NativeStringPacking
+ * @see au.com.pharos.packing.RawPacking
+ * @see au.com.pharos.packing.SerializationPacking
+ *
+ * @version $Revision$
+ * @author Martin Pool
+ **/
+public abstract class Packing {
+    /** Convert an object to an array of bytes. **/
+    public abstract byte[] toBytes(Object obj) throws IllegalArgumentException;
+
+    /** Reconstitute an array of bytes into an object. **/
+    public abstract Object fromBytes(byte[] raw) throws IllegalArgumentException;
+
+    /** Helper function that generates an IllegalArgumentException */
+    protected IllegalArgumentException cantConvert(Object obj) {
+	return new IllegalArgumentException
+	    ("Can't pack object \"" + obj.toString() +
+	     "\" (" + obj.getClass().toString() + ")" + 
+	     "\n\tusing strategy " + this.toString());
+    }
+}
+
+    
Index: /trunk/gsdl3/src/packages/javagdbm/java/au/com/pharos/packing/QuotedVectorPacking.java
===================================================================
--- /trunk/gsdl3/src/packages/javagdbm/java/au/com/pharos/packing/QuotedVectorPacking.java	(revision 10737)
+++ /trunk/gsdl3/src/packages/javagdbm/java/au/com/pharos/packing/QuotedVectorPacking.java	(revision 10737)
@@ -0,0 +1,187 @@
+/*
+ * module: pip/java/packing -- Strategy objects for converting
+ *         Java objects to and from stored data.
+ * class:  QuotedVectorPacking -- Vectors of Strings packed in a Perl-
+ *         style format
+ *
+ * Copyright (C) 1997 Pharos IP Pty Ltd
+ * $Id$
+ *
+ *  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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package au.com.pharos.packing;
+
+import java.util.Vector;
+
+// FIXME: Escape bad characters! -- mbp
+// TODO: Write a more formal definition of the encoding system
+// TODO: More documentation
+
+// XXX: Perhaps the strategy for encoding characters should be in a
+// separate class used by this class?  They would have to
+// interact to make sure that separator chatacters were decoded
+// properly.  Probably not worth worrying about, as this class
+// is only a compatibility measure in any case.
+
+/** Stores Vectors of strings, packed into a single string, as used by
+ * some Perl code.  The encoding format is similar to that used in
+ * Unix databases like
+ * <A HREF="file:/etc/passwd/"><CODE>/etc/passwd</CODE></A>, except that
+ * it uses escape sequences to represent characters that would
+ * normally not be allowed.
+ *
+ * <P>The strings within the vector are separated by separator characters,
+ * which default to colons.
+ *
+ * <P>The resulting packed string is UTF encoded after escaping
+ * control-characters, so non-ASCII characters should be passed through
+ * unchanged.
+ *
+ * <P>Certain characters are escaped as quoted-printable strings.
+ * These characters include colon, equals, and escape characters.  The
+ * encoding accepts and interprets any hex escape when reading data.
+ *
+ * <P>If any elements of the vector are null, they are stored as empty
+ * strings.  On unpacking, empty strings are returned as such.
+ *
+ * <P>An example of a vector encoded in this manner is:
+ * <BLOCKQUOTE>
+ * <PRE>oC7okz059wGnQ:vf:Peter Barnes%2c Pharos Business Solutions</PRE>
+ * </BLOCKQUOTE>
+ *
+ * @author Martin Pool
+ * @version $Revision$ $Date$
+ *
+ * @see java.util.Vector
+ **/
+public class QuotedVectorPacking extends Packing
+implements java.io.Serializable
+{
+    private char hexEscape;
+    private char separator;
+    
+    /** Constructs a QuotedVectorPacking using the default separator
+     * character ':' and escape character '%'.
+     **/
+    public QuotedVectorPacking() {
+	this('%', ':');
+    }
+
+
+    /** Constructs a QuotedVectorPacking with specified separator and
+     * hex-escape characters.
+     *
+     * @param hexEscape the character used to begin a three-character
+     * hex escape
+     *
+     * @param separator the character used to separate elements in the
+     * vector.
+     **/
+    public QuotedVectorPacking(char hexEscape, char separator) {
+	if (hexEscape == separator)
+	    throw new IllegalArgumentException
+		("hexEscape and separator characters are the same");
+	this.hexEscape = hexEscape;
+	this.separator = separator;
+    }
+    
+    
+    /** Convert a Vector of Strings to a QuotedVector represented as an
+     * array of bytes.
+     *
+     * @param obj the Vector to encode; or null.
+     * 
+     * @returns an array of bytes containing a packed representation of
+     * <EM>obj</EM>; or null if <EM>obj</EM> is null.
+     *
+     * @exception java.lang.ClassCastException if obj is not a Vector
+     * or null; or if any element of <EM>obj</EM> is not a String or
+     * null.
+     **/
+    public byte[] toBytes(Object obj)
+    {
+	if (obj == null)
+	    return null;
+	Vector vec = (Vector) obj;
+	StringBuffer sb = new StringBuffer();
+	Object elem;
+	for (int i = 0; i < vec.size(); i++) {
+	    if (i > 0)
+		sb.append(separator);
+	    elem = vec.elementAt(i);
+	    sb.append((elem == null) ? "" : encodeString((String) elem));
+	}
+	return sb.toString().getBytes();
+    }
+
+
+
+    /** Perform hex-escapes on a string.
+     * @returns <EM>from</EM> encoded as a quoted-printable string
+     **/
+    private String encodeString(String from) {
+	StringBuffer buf = new StringBuffer(from.length());
+	char[] chars = from.toCharArray();
+	for (int i = 0; i < chars.length; i++) {
+	    char ch = chars[i];
+	    if (ch == separator
+		|| ch == hexEscape
+		|| Character.isISOControl(ch)
+		|| (ch != ' ' && ch != '\t' && Character.isWhitespace(ch)))
+		{
+		    buf.append(hexEscape);
+		    // XXX: This will truncate high Unicode characters, but I
+		    // don't know what else we can do with them. -- mbp
+		    buf.append(Character.forDigit((ch>>4) & 0xf, 16));
+		    buf.append(Character.forDigit(ch      & 0xf, 16));
+		} else {
+		    buf.append(ch);
+		}
+	}
+	return buf.toString();
+    }
+    
+    
+
+    /** Interprets <em>raw</em> as a packed quoted Vector, and
+     * returns the unpacked Vector of strings. */
+    public Object fromBytes(byte[] raw)
+    {
+	if (raw == null)
+	    return null;
+	
+	Vector result = new Vector();
+	StringBuffer sb = new StringBuffer();
+	for (int i = 0; i < raw.length; i++) {
+	    char ch = (char) raw[i];
+	    if (ch == separator) {
+		result.addElement(sb.toString());
+		sb.setLength(0);
+	    } else if (ch == hexEscape && i < (raw.length - 2)) {
+		byte[] hexBytes = new byte[2];
+		hexBytes[0] = raw[++i];
+		hexBytes[1] = raw[++i];
+		String hex = new String(hexBytes);
+		ch = (char)Integer.parseInt(hex, 16);
+		sb.append(ch);
+	    } else {
+		sb.append(ch);
+	    }
+	}
+	result.addElement(sb.toString());
+	return result;
+    }
+}
Index: /trunk/gsdl3/src/packages/javagdbm/java/au/com/pharos/packing/RawPacking.java
===================================================================
--- /trunk/gsdl3/src/packages/javagdbm/java/au/com/pharos/packing/RawPacking.java	(revision 10737)
+++ /trunk/gsdl3/src/packages/javagdbm/java/au/com/pharos/packing/RawPacking.java	(revision 10737)
@@ -0,0 +1,60 @@
+/*
+ * module: pip/java/packing -- Strategy objects for converting
+ * Java objects to and from stored data.
+ *
+ * Copyright (C) 1997 Pharos IP Pty Ltd
+ * $Id$
+ *
+ *  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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package au.com.pharos.packing;
+
+/** A packing strategy which stores only raw arrays of bytes.  Other
+ * objects cannot be stored using this strategy.
+ *
+ * @author Martin Pool
+ * @version $Revision$
+ **/
+public class RawPacking extends Packing implements java.io.Serializable
+{
+    /** Perform the trivial packing case, casting an array of bytes
+     * into the same.
+     *
+     * @throw IllegalArgumentException if <em>obj</em> is neith null nor
+     * an array of bytes.
+     */
+    public byte[] toBytes(Object obj) throws IllegalArgumentException
+    {
+	if (obj == null)
+	    return null;
+	else if (obj instanceof byte[])
+	    return (byte[]) obj;
+	else
+	    throw cantConvert(obj);
+    }
+
+    /** Performs the trivial unpacking case of returning <em>raw</em>
+     * untouched.
+     *
+     * @return either null or <em>raw</em>; always assignable to
+     * <code>byte[]</code>
+     **/
+    public Object fromBytes(byte[] raw)
+    {
+	return raw;
+    }
+}
+    
Index: /trunk/gsdl3/src/packages/javagdbm/java/au/com/pharos/packing/SerializationPacking.java
===================================================================
--- /trunk/gsdl3/src/packages/javagdbm/java/au/com/pharos/packing/SerializationPacking.java	(revision 10737)
+++ /trunk/gsdl3/src/packages/javagdbm/java/au/com/pharos/packing/SerializationPacking.java	(revision 10737)
@@ -0,0 +1,100 @@
+/*
+ * class: SerializationPacking -- Store an object as serialized data
+ *
+ * Copyright (C) 1997 Pharos IP Pty Ltd
+ * $Id$
+ *
+ *  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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package au.com.pharos.packing;
+
+import java.io.ByteArrayOutputStream;
+import java.io.ObjectOutputStream;
+import java.io.ByteArrayInputStream;
+import java.io.ObjectInputStream;
+import java.io.IOException;
+
+/** A packing strategy which stores and retrieves objects using
+ * <a href="http://www.javasoft.com/products/jdk/1.1/docs/guide/serialization/index.html">Java serialization</a>.
+ *
+ * @version $Revision$
+ * @author Martin Pool
+ * @see au.com.pharos.packing.Packing
+ **/
+public class SerializationPacking extends Packing
+implements java.io.Serializable
+{
+    /** Convert an object to a Java serialization format.
+     *
+     * @returns a buffer containing a a serialized representation of <em>obj</em>;
+     * or null if <em>obj</em> if null
+     * @exception IllegalArgumentException if <em>obj</em> (or any object
+     * referred to by <em>obj</em>) cannot be serialized
+     **/
+    public byte[] toBytes(Object obj) throws IllegalArgumentException
+    {
+	if (obj == null)
+	    return null;
+
+	// Serialize via a stream into a buffer
+	ByteArrayOutputStream byteStream = new ByteArrayOutputStream();
+	try {
+	    ObjectOutputStream objStream = new ObjectOutputStream(byteStream);
+	    objStream.writeObject(obj);
+	    // Don't close the stream, or you will lose the byte array
+	    objStream.flush();
+	} catch (IOException e) {
+	    throw new IllegalArgumentException("IOException during serialization: " +
+					       e.toString());
+	}
+
+	return byteStream.toByteArray();
+    }
+
+    /** Interprets <em>raw</em> as a Java serialization stream, and
+     * returns <B>the first</B> object read from that stream.
+     *
+     * <P><B>Note:</B>There is currently no means by which any later
+     * objects in the can be retrieved: it is assumed that the object
+     * written to the buffer contains references to all the
+     * information required.  This is consistent with the fact that
+     * toBytes() stores only a single object, so this packing strategy
+     * is completely reversable.
+     **/
+    // FIXME: Is the correct word 'reversable', 'reflexive', or
+    // something else?  -- mbp@pharos.com.au
+    public Object fromBytes(byte[] raw)
+    {
+	if (raw == null)
+	    return null;
+
+	Object obj;
+	try {
+	    ByteArrayInputStream byteStream = new ByteArrayInputStream(raw);
+	    ObjectInputStream objStream = new ObjectInputStream(byteStream);
+	    obj = objStream.readObject();
+	    objStream.close();
+	} catch (IOException e) {
+	    throw new IllegalArgumentException("Exception during deserialization: " +
+					       e.toString());
+	} catch (ClassNotFoundException e) {
+	    throw new IllegalArgumentException("Exception during deserialization: " +
+					       e.toString());
+	}	    
+	return obj;
+    }
+}
+    
Index: /trunk/gsdl3/src/packages/javagdbm/java/au/com/pharos/packing/StringPacking.java
===================================================================
--- /trunk/gsdl3/src/packages/javagdbm/java/au/com/pharos/packing/StringPacking.java	(revision 10737)
+++ /trunk/gsdl3/src/packages/javagdbm/java/au/com/pharos/packing/StringPacking.java	(revision 10737)
@@ -0,0 +1,85 @@
+/*
+ * module: pip/java/packing -- Strategy objects for converting
+ * Java objects to and from stored data.
+ *
+ * Copyright (C) 1997 Pharos IP Pty Ltd
+ * $Id$
+ *
+ *  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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package au.com.pharos.packing;
+
+/** StringPacking converts Java Strings to and from byte arrays
+ * using the default UTF-8 encoding.
+ *
+ * <P>For strings containing only ASCII-7 characters, this is
+ * equivalent to <code>NativeStringPacking</code> but probably
+ * somewhat slower.  However, it will safely handle non-ASCII
+ * characters, or unusual locales.
+ *
+ * @see au.com.pharos.packing.Packing
+ * @see au.com.pharos.packing.NativeStringPacking
+ **/
+public class StringPacking extends Packing
+implements java.io.Serializable
+{
+    /** Convert a String to an array of bytes using Java's default
+     * encoding.
+     *
+     * <P>If <em>obj</em> is not a String, array of bytes, or null
+     * then it's <code>toString()</code> method is called first to
+     * convert it to an array of bytes.  This will lose information in
+     * many cases.
+     *
+     * @param obj The object to convert.
+     *
+     * @return <em>obj</em> converted to an array of bytes; or null if
+     * <em>obj</em> is null.
+     **/
+    public byte[] toBytes(Object obj)
+    {
+	if (obj == null)
+	    return null;
+	else if (obj instanceof byte[])
+	    return (byte[]) obj;
+	else if (obj instanceof String)
+	    return ((String) obj).getBytes();
+	else
+	    return obj.toString().getBytes();
+    }
+
+    /** Decode an array of bytes using the default String encoding.
+     *
+     * @param raw An array of bytes to decode.
+     *
+     * @return A String representation of <em>raw</em>; or null if
+     * <em>raw</em> is null.
+     **/     
+    public Object fromBytes(byte[] raw)
+    {
+	if (raw == null)
+	    return null;
+	else {
+	    try{
+	    return new String(raw, "UTF-8");
+	    } catch (Exception e) {
+		System.err.println("String Packing:encoding not supported");
+		return new String(raw);
+	    }
+	}
+    }
+}
+    
Index: /trunk/gsdl3/src/packages/javagdbm/java/au/com/pharos/packing/TestQuotedVectorPacking.java
===================================================================
--- /trunk/gsdl3/src/packages/javagdbm/java/au/com/pharos/packing/TestQuotedVectorPacking.java	(revision 10737)
+++ /trunk/gsdl3/src/packages/javagdbm/java/au/com/pharos/packing/TestQuotedVectorPacking.java	(revision 10737)
@@ -0,0 +1,84 @@
+/*
+ * module: pip/java/packing -- Strategy objects for converting
+ *         Java objects to and from stored data.
+ * class:  TestQuotedVectorPacking -- Test harness for QuotedVectorPacking
+ *
+ * Copyright (C) 1997 Pharos IP Pty Ltd
+ * $Id$
+ *
+ *  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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package au.com.pharos.packing;
+
+import java.util.Vector;
+
+// TODO: Perhaps make this into a more general-purpose test harness
+// for testing any Packing strategy? -- mbp 19971021
+
+/** Test harness for the QuotedVectorPacking strategy class.
+ *
+ * <P><B>Usage:</B>
+ * <UL><P><CODE>java TestQuotedVectorPacking -[de] ARGS</CODE><UL>
+ *
+ * <P><B>Options</B>
+ * <DL>
+ *   <P><DT><CODE>-d</CODE><DD>Print the results of decoding
+ *      the each of the command-
+ *      line arguments as QuotedVectorPacking encoding strings
+ *
+ *   <P><DT><CODE>-e</CODE><DD>Print the results of encoding
+ *      a vector containing
+ *      all of the command-line arguments 
+ * </DL>
+ *
+ * @author Martin Pool
+ * @version $Revision$ $Date$
+ **/
+public class TestQuotedVectorPacking {
+    private TestQuotedVectorPacking() {}
+    
+    public static void main(String[] argv) {
+	Packing strat = new QuotedVectorPacking();
+	final String usage = "usage: TestQuotedVectorPacking -[ed] ARGS";
+
+	if (argv.length == 0) {
+	    System.err.println(usage);
+	    return;
+	}
+	
+	if (argv[0].equals("-e")) {
+	    Vector encode = new Vector(argv.length - 1);
+	    for (int i = 1; i < argv.length; i++) {
+		System.out.println(argv[i]);
+		encode.addElement(argv[i]);
+	    }
+	    byte[] packed = strat.toBytes(encode);
+	    System.out.print("\t");
+	    System.out.println(new String(packed));
+	} else if (argv[0].equals("-d")) {
+	    for (int i = 1; i < argv.length; i++) {
+		Vector decode = (Vector) strat.fromBytes(argv[i].getBytes());
+		System.out.println(argv[i]);
+		for (int j = 0; j < decode.size(); j++) {
+		    System.out.print("\t");
+		    System.out.println(decode.elementAt(j));
+		}
+	    }
+	} else {
+	    System.err.println(usage);
+	}
+    }
+}
Index: /trunk/gsdl3/src/packages/javagdbm/java/au/com/pharos/test/Test.java
===================================================================
--- /trunk/gsdl3/src/packages/javagdbm/java/au/com/pharos/test/Test.java	(revision 10737)
+++ /trunk/gsdl3/src/packages/javagdbm/java/au/com/pharos/test/Test.java	(revision 10737)
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 1997 Pharos IP Pty Ltd
+ * $Id$
+ * $Source$
+ *
+ *  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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package au.com.pharos.test;
+
+/** Utilities for automated testing.  This class contains only static
+ * functions and should not be instantiated.
+ *
+ * @author Martin Pool
+ * @version $Revision$ $Date$
+ **/
+// TODO: Somehow automatically generate sequence numbers, or perhaps use
+// strings to report progress
+public class Test {
+    // Don't instantiate
+    private Test() {}
+
+    static int nPassed, nFailed;
+
+    /** Register that a particular test executed successfully, and
+     * output a success or failure message.
+     *
+     * @param number test sequence number
+     **/
+    static public void ok(int no) {
+	ok(no, true);
+    }
+
+    /** Register the result of a test, and output a success or failure
+     * message.
+     *
+     * @param number test sequence number
+     * @param result whether the test was successful or not
+     */
+    static public void ok(int number, boolean passed) {
+	if (passed) {
+	    nPassed++;
+	}
+	else {
+	    System.out.print("not ");
+	    nFailed++;
+	}
+	System.out.print("ok " + number + "\n");
+    }
+
+    /**
+     * Print a summary of test results.
+     **/
+    static public void summary() {
+	System.out.print("test summary: " + nPassed + " passed, " +
+			 nFailed + " failed");
+    }
+}
+    
Index: /trunk/gsdl3/src/packages/javagdbm/java/au/com/pharos/util/StringOps.java
===================================================================
--- /trunk/gsdl3/src/packages/javagdbm/java/au/com/pharos/util/StringOps.java	(revision 10737)
+++ /trunk/gsdl3/src/packages/javagdbm/java/au/com/pharos/util/StringOps.java	(revision 10737)
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 1997 by Pharos IP Pty Ltd
+ * Confidential.  All rights reserved.
+ * $Id$
+ * $Source$
+ *
+ * ``No strings attached.''
+ */
+
+package au.com.pharos.util;
+
+/**
+ * Mixed bag of string manipulation functions.  It would be nice if
+ * some of these were in <CODE>java.lang.String</CODE>, but since
+ * they're not, they're implemented as static functions within this
+ * class.
+ *
+ * Typical use:
+ * <PRE>
+ * String foo = "some string"
+ * int cnt = StringOps.countOccurrences(foo, 's');
+ * // --> cnt == 2
+ * </PRE>
+ *
+ * @author Martin Pool
+ * @version $Revision$, $Date$
+ **/
+public class StringOps
+{
+    /** This class contains only static public functions. **/
+    private StringOps() { ; }
+
+    /** Count the number of occurences of a character in a
+     * string.
+     *
+     * @param needle the character to search
+     * @param haystack string to be searched
+     *
+     * @return 0 if <EM>needle</EM> does not occur in <EM>haystack</EM>;
+     * or a positive number indicating the number of occurrences
+     **/
+    static public int countOccurrences(String haystack, char needle)
+    {
+	byte[] hay = haystack.getBytes();
+	int count = 0;
+	for (int i = 0; i < hay.length; i++)
+	    if (hay[i] == needle)
+		count++;
+	return count;
+    }
+}
Index: /trunk/gsdl3/src/packages/javagdbm/java/au/com/pharos/util/test/StringOpsTest.java
===================================================================
--- /trunk/gsdl3/src/packages/javagdbm/java/au/com/pharos/util/test/StringOpsTest.java	(revision 10737)
+++ /trunk/gsdl3/src/packages/javagdbm/java/au/com/pharos/util/test/StringOpsTest.java	(revision 10737)
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 1997 by Pharos IP Pty Ltd
+ * Confidential.  All rights reserved.
+ * $Id$
+ * $Source$
+ */
+
+package au.com.pharos.util.test;
+
+import au.com.pharos.test.Test;
+
+import au.com.pharos.util.StringOps;
+
+/**
+ * Test harness for <CODE>au.com.pharos.util.StringOps</CODE>
+ *
+ * @author Martin Pool
+ * @version $Revision$ $Date$
+ **/
+public class StringOpsTest
+{
+    static public void main(String[] args)
+    {
+	new StringOpsTest().run();
+    }
+
+    public void run()
+    {
+	try {
+	    testCountOccurrences();
+	}
+	finally {
+	    Test.summary();
+	}
+    }
+
+    public void testCountOccurrences()
+    {
+	// Simple tests of countOccurences(String, char)
+	Test.ok(100, ( StringOps.countOccurrences("hello world", 'z') == 0) );
+	Test.ok(110, ( StringOps.countOccurrences("zhello world", 'z') == 1) );
+	Test.ok(120, ( StringOps.countOccurrences("hello worldz", 'z') == 1) );
+	Test.ok(130, ( StringOps.countOccurrences("z", 'z') == 1) );
+	Test.ok(140, ( StringOps.countOccurrences("zzz", 'z') == 3) );
+	Test.ok(150, ( StringOps.countOccurrences("0z0z0z", 'z') == 3) );
+	Test.ok(160, ( StringOps.countOccurrences("\0z\0z\0z", '\0') == 3) );
+    }
+}
Index: /trunk/gsdl3/src/packages/javagdbm/java/winMake.bat
===================================================================
--- /trunk/gsdl3/src/packages/javagdbm/java/winMake.bat	(revision 10737)
+++ /trunk/gsdl3/src/packages/javagdbm/java/winMake.bat	(revision 10737)
@@ -0,0 +1,45 @@
+@echo off
+
+set GDBMJAVAHOME=..
+
+rem ---- Where to put class files ----
+set JAVACLASSDIR=classes
+
+rem ---- Name and location of java programs ----
+set JAVAC="%JAVA_HOME%\bin\javac"
+set JAVAH="%JAVA_HOME%\bin\javah"
+set JAVA="%JAVA_HOME%\bin\java"
+set JAVADOC="%JAVA_HOME%\bin\javadoc"
+set JAR="%JAVA_HOME%\bin\jar"
+
+set JAVACOPTIONS= -deprecation -g -O
+
+
+if ""%1"" == """" goto compile
+if ""%1"" == ""compile"" goto compile
+if ""%1"" == ""install"" goto install
+if ""%1"" == ""clean"" goto clean
+
+:unknown
+	echo Error: Unrecognized argument %1.
+	goto done
+
+:compile
+	if not exist %JAVACLASSDIR% mkdir %JAVACLASSDIR%
+	echo Compiling...
+        %JAVAC% -d %JAVACLASSDIR% %JAVACOPTIONS% au\com\pharos\*\*.java
+        %JAVAH% -classpath %JAVACLASSDIR% -c %GDBMJAVAHOME%\jni\GdbmFile.h au.com.pharos.gdbm.GdbmFile
+        %JAR% cf %JAVAGDBMHOME%\javagdbm.jar -C %JAVACLASSDIR% au
+	goto done
+
+:install
+	goto done
+
+:clean
+	echo Cleaning up...
+	if exist %JAVACLASSDIR% rmdir /S /Q %JAVACLASSDIR%
+        if exist %JAVAGDBMHOME%\javagdbm.jar del %JAVAGDBMHOME%\javagdbm.jar 
+        if exist %GDBMJAVAHOME%\jni\GdbmFile.h del %GDBMJAVAHOME%\jni\GdbmFile.h 
+	goto done
+
+:done
Index: /trunk/gsdl3/src/packages/javagdbm/jni/GdbmFile.h
===================================================================
--- /trunk/gsdl3/src/packages/javagdbm/jni/GdbmFile.h	(revision 10737)
+++ /trunk/gsdl3/src/packages/javagdbm/jni/GdbmFile.h	(revision 10737)
@@ -0,0 +1,119 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class au_com_pharos_gdbm_GdbmFile */
+
+#ifndef _Included_au_com_pharos_gdbm_GdbmFile
+#define _Included_au_com_pharos_gdbm_GdbmFile
+#ifdef __cplusplus
+extern "C" {
+#endif
+#undef au_com_pharos_gdbm_GdbmFile_READER
+#define au_com_pharos_gdbm_GdbmFile_READER 0L
+#undef au_com_pharos_gdbm_GdbmFile_WRITER
+#define au_com_pharos_gdbm_GdbmFile_WRITER 1L
+#undef au_com_pharos_gdbm_GdbmFile_WRCREAT
+#define au_com_pharos_gdbm_GdbmFile_WRCREAT 2L
+#undef au_com_pharos_gdbm_GdbmFile_NEWDB
+#define au_com_pharos_gdbm_GdbmFile_NEWDB 3L
+#undef au_com_pharos_gdbm_GdbmFile_FAST
+#define au_com_pharos_gdbm_GdbmFile_FAST 16L
+/*
+ * Class:     au_com_pharos_gdbm_GdbmFile
+ * Method:    gdbm_open
+ * Signature: (Ljava/lang/String;I)J
+ */
+JNIEXPORT jlong JNICALL Java_au_com_pharos_gdbm_GdbmFile_gdbm_1open
+  (JNIEnv *, jobject, jstring, jint);
+
+/*
+ * Class:     au_com_pharos_gdbm_GdbmFile
+ * Method:    gdbm_close
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_au_com_pharos_gdbm_GdbmFile_gdbm_1close
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     au_com_pharos_gdbm_GdbmFile
+ * Method:    gdbm_store
+ * Signature: (J[B[BZ)V
+ */
+JNIEXPORT void JNICALL Java_au_com_pharos_gdbm_GdbmFile_gdbm_1store
+  (JNIEnv *, jobject, jlong, jbyteArray, jbyteArray, jboolean);
+
+/*
+ * Class:     au_com_pharos_gdbm_GdbmFile
+ * Method:    gdbm_fetch
+ * Signature: (J[B)[B
+ */
+JNIEXPORT jbyteArray JNICALL Java_au_com_pharos_gdbm_GdbmFile_gdbm_1fetch
+  (JNIEnv *, jobject, jlong, jbyteArray);
+
+/*
+ * Class:     au_com_pharos_gdbm_GdbmFile
+ * Method:    gdbm_exists
+ * Signature: (J[B)Z
+ */
+JNIEXPORT jboolean JNICALL Java_au_com_pharos_gdbm_GdbmFile_gdbm_1exists
+  (JNIEnv *, jobject, jlong, jbyteArray);
+
+/*
+ * Class:     au_com_pharos_gdbm_GdbmFile
+ * Method:    gdbm_delete
+ * Signature: (J[B)V
+ */
+JNIEXPORT void JNICALL Java_au_com_pharos_gdbm_GdbmFile_gdbm_1delete
+  (JNIEnv *, jobject, jlong, jbyteArray);
+
+/*
+ * Class:     au_com_pharos_gdbm_GdbmFile
+ * Method:    gdbm_firstkey
+ * Signature: (J)[B
+ */
+JNIEXPORT jbyteArray JNICALL Java_au_com_pharos_gdbm_GdbmFile_gdbm_1firstkey
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     au_com_pharos_gdbm_GdbmFile
+ * Method:    gdbm_nextkey
+ * Signature: (J[B)[B
+ */
+JNIEXPORT jbyteArray JNICALL Java_au_com_pharos_gdbm_GdbmFile_gdbm_1nextkey
+  (JNIEnv *, jobject, jlong, jbyteArray);
+
+/*
+ * Class:     au_com_pharos_gdbm_GdbmFile
+ * Method:    gdbm_getversion
+ * Signature: ()Ljava/lang/String;
+ */
+JNIEXPORT jstring JNICALL Java_au_com_pharos_gdbm_GdbmFile_gdbm_1getversion
+  (JNIEnv *, jclass);
+
+/*
+ * Class:     au_com_pharos_gdbm_GdbmFile
+ * Method:    gdbm_wrapperVersion
+ * Signature: ()Ljava/lang/String;
+ */
+JNIEXPORT jstring JNICALL Java_au_com_pharos_gdbm_GdbmFile_gdbm_1wrapperVersion
+  (JNIEnv *, jclass);
+
+/*
+ * Class:     au_com_pharos_gdbm_GdbmFile
+ * Method:    gdbm_reorganize
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_au_com_pharos_gdbm_GdbmFile_gdbm_1reorganize
+  (JNIEnv *, jobject, jlong);
+
+/*
+ * Class:     au_com_pharos_gdbm_GdbmFile
+ * Method:    gdbm_sync
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_au_com_pharos_gdbm_GdbmFile_gdbm_1sync
+  (JNIEnv *, jobject, jlong);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
Index: /trunk/gsdl3/src/packages/javagdbm/jni/Makefile.in
===================================================================
--- /trunk/gsdl3/src/packages/javagdbm/jni/Makefile.in	(revision 10737)
+++ /trunk/gsdl3/src/packages/javagdbm/jni/Makefile.in	(revision 10737)
@@ -0,0 +1,62 @@
+# Makefile for the native parts of the au.com.pharos.gdbm
+# Java package.
+# Modified by kjdon 2005
+
+# Copyright (C) 1997 by Pharos IP Pty Ltd
+#
+# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+#srcdir=@srcdir@
+libdir=@libdir@
+
+CC=@CC@
+JDK=@JAVA_HOME@
+INC=-I. -I$(JDK)/include -I$(JDK)/include/linux  
+CFLAGS=-c @CFLAGS@ $(INC) -DWRAPPER_VERSION=\"$(WRAPPER_VERSION)\" 
+#PKG=@PKG@
+LIBS=@LIBS@
+LDFLAGS = @LDFLAGS@
+JNIFLAGS=@JNIFLAGS@
+JNISUFFIX=@JNISUFFIX@
+JNIINC=@JNIINC@
+
+# TODO: Build versioned shared libraries?
+
+# TODO: Build shared libraries in a way that will work on different
+# platforms -- mbp
+
+WRAPPER_VERSION=0005
+NATIVE_LIB=libgdbmjava.$(JNISUFFIX)
+
+all: $(NATIVE_LIB)
+
+$(NATIVE_LIB): GdbmFile.h gdbmjava.o Makefile
+	$(CC) $(LDFLAGS) $(JNIFLAGS) -o $(NATIVE_LIB) gdbmjava.o $(LIBS)
+
+gdbmjava.o: gdbmjava.c	
+	$(CC) $(INC) $(CFLAGS) $?
+
+# no easy way to tell if a class file has changed or not
+#GdbmFile.h: 
+#	$(javah) -o GdbmFile.h -jni $(PKG).GdbmFile 
+
+clean:	
+	rm -f  *.o $(NATIVE_LIB) 
+
+distclean: clean
+	rm -f config.log config.cache config.status Makefile
+
+install: 
+	cp $(NATIVE_LIB) $(libdir)/
Index: /trunk/gsdl3/src/packages/javagdbm/jni/gdbmjava.c
===================================================================
--- /trunk/gsdl3/src/packages/javagdbm/jni/gdbmjava.c	(revision 10737)
+++ /trunk/gsdl3/src/packages/javagdbm/jni/gdbmjava.c	(revision 10737)
@@ -0,0 +1,465 @@
+/*
+ * module: pip/jni/gdbm -- A Java interface to the GDBM library
+ * file:   gdbmjava.c -- Native parts of the au.com.pharos.gdbm.GdbmFile
+ *             Java class
+ *
+ * Copyright (C) 1997 Pharos IP Pty Ltd
+ *
+ * $Id$ 
+ *
+ *  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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+/* NOTE ON MEMORY MANAGEMENT: GDBM always mallocs memory and expects
+ * the caller to free it.  Java requires native functions to interact
+ * with it to lock and unlock buffers. */
+
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <gdbm.h>
+
+#include <jni.h>
+
+#include <GdbmFile.h>
+
+#ifdef DEBUG
+#define ASSERT(x) if (!(x)) { \
+  fprintf(stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+  abort(); }
+#else /* !DEBUG */
+#define ASSERT(x) 
+#endif /* !DEBUG */
+
+/* The Java class within which the native methods are declared */
+#define JAVA_CLASS "au.com.pharos.gdbm.GdbmFile"
+
+#define NULL_PTR_EXCEPTION(env) nullPtrException(env, __FILE__, __LINE__)
+#define GDBM_EXCEPTION(env) gdbmException(env, __FILE__, __LINE__)
+
+#define CHECK_NOT_NULL(ptr, env) if (!ptr) { NULL_PTR_EXCEPTION(env); return 0; }
+#define CHECK_NOT_NULL_VOID(ptr, env) if (!ptr) { NULL_PTR_EXCEPTION(env); return; }
+
+void gdbmException(JNIEnv *env, const char *file, int line);
+void nullPtrException(JNIEnv *env, const char *file, int line);
+
+void releaseArray(JNIEnv *env, jbyteArray array, datum *fromDatum);
+void releaseArrayAbort(JNIEnv *env, jbyteArray array, datum *fromDatum);
+int arrayToDatum(JNIEnv *env, jbyteArray fromArray, datum *toDatum);
+jbyteArray datumToArray(JNIEnv *env, datum *fromDatum);
+
+/* Convert between a jlong and a void ptr using a well-defined cast.
+ * (Casting between a pointer and an integer of different sizes spooks
+ * both gcc and mbp. */
+#if (SIZEOF_VOID_P == SIZEOF_LONG)
+#  define DBF_TO_JLONG(x) ((jlong)((long) x))
+#  define JLONG_TO_DBF(x) ((GDBM_FILE)((long) x))
+#elif (SIZEOF_VOID_P == SIZEOF_INT)
+#  define DBF_TO_JLONG(x) ((jlong)((int) (x)))
+#  define JLONG_TO_DBF(x) ((GDBM_FILE)((int) (x)))
+#else
+#  define DBF_TO_JLONG(x) ((jlong)(x))
+#  define JLONG_TO_DBF(x) ((GDBM_FILE)(x))
+#endif
+
+
+JNIEXPORT jlong JNICALL 
+Java_au_com_pharos_gdbm_GdbmFile_gdbm_1open
+    (JNIEnv *env, jobject obj, jstring fileName, jint flags)
+{
+    GDBM_FILE dbf;
+    const char *utfFileName;
+
+    utfFileName = (*env)->GetStringUTFChars(env, fileName, 0);
+    if (!utfFileName) 
+	return 0;
+    
+    setbuf(stderr, 0);
+
+    /* XXX: Should we let the caller specify the file mode?  I think
+     * not -- Java is above the level of octal file modes. [mbp] */
+    dbf = gdbm_open((char *) utfFileName, 0, flags, 0660, NULL);
+
+    if (utfFileName)
+	(*env)->ReleaseStringUTFChars(env, fileName, utfFileName);
+
+    if (!dbf) {
+	GDBM_EXCEPTION(env);
+	return 0;
+    }	
+
+    return DBF_TO_JLONG(dbf);
+}
+
+
+
+
+
+JNIEXPORT jbyteArray JNICALL 
+Java_au_com_pharos_gdbm_GdbmFile_gdbm_1firstkey
+(JNIEnv *env, jobject obj, jlong dbf)
+{
+    datum	keyDatum;
+    jbyteArray 	keyArray;
+
+    CHECK_NOT_NULL(dbf, env);
+
+    keyDatum = gdbm_firstkey(JLONG_TO_DBF(dbf));
+    if ( gdbm_errno != GDBM_NO_ERROR ) {
+	GDBM_EXCEPTION(env);
+	return 0;
+    }
+    if ( !keyDatum.dptr )
+	return 0;
+
+    keyArray = datumToArray(env, &keyDatum);
+    free(keyDatum.dptr); 
+
+    return keyArray;
+}
+
+
+
+
+
+JNIEXPORT jbyteArray JNICALL 
+Java_au_com_pharos_gdbm_GdbmFile_gdbm_1nextkey
+(JNIEnv *env, jobject this, jlong dbf, jbyteArray keyArray)
+{
+    datum	keyDatum;
+    datum	nextDatum;
+    jbyteArray	nextArray;
+
+    CHECK_NOT_NULL(dbf, env);
+
+    if (!arrayToDatum(env, keyArray, &keyDatum)) {
+	NULL_PTR_EXCEPTION(env);
+	return 0;
+    }
+    
+    nextDatum = gdbm_nextkey(JLONG_TO_DBF(dbf), keyDatum);
+    releaseArrayAbort(env, keyArray, &keyDatum);
+
+    if ( gdbm_errno != GDBM_NO_ERROR ) {
+	GDBM_EXCEPTION(env);
+	return 0;
+    }
+    if ( !nextDatum.dptr )
+	return 0;
+
+    nextArray = datumToArray(env, &nextDatum);
+    free(nextDatum.dptr);
+    
+    return nextArray;
+}
+
+
+
+
+
+
+JNIEXPORT jbyteArray JNICALL 
+Java_au_com_pharos_gdbm_GdbmFile_gdbm_1fetch
+  (JNIEnv *env, jobject this, jlong dbf, jbyteArray keyArray)
+{
+    datum 	keyDatum;
+    datum 	valueDatum;
+    jbyteArray	valueArray;
+
+    CHECK_NOT_NULL(dbf, env);
+
+    if (!arrayToDatum(env, keyArray, &keyDatum)) {
+	NULL_PTR_EXCEPTION(env);
+	return 0;
+    }
+
+    valueDatum = gdbm_fetch(JLONG_TO_DBF(dbf), keyDatum);
+    releaseArrayAbort(env, keyArray, &keyDatum);
+
+    if ( !valueDatum.dptr )
+	return 0;
+    if ( gdbm_errno != GDBM_NO_ERROR ) {
+	GDBM_EXCEPTION(env);
+	return 0;
+    }
+
+    valueArray = datumToArray(env, &valueDatum);
+    free(valueDatum.dptr);
+
+    return valueArray;
+}
+
+
+
+JNIEXPORT jboolean JNICALL 
+Java_au_com_pharos_gdbm_GdbmFile_gdbm_1exists
+  (JNIEnv *env, jobject obj, jlong dbf, jbyteArray keyArray)
+{
+    datum 	keyDatum;
+    int		result;
+
+    CHECK_NOT_NULL(dbf, env);
+    if (!arrayToDatum(env, keyArray, &keyDatum)) {
+	NULL_PTR_EXCEPTION(env);
+	return JNI_FALSE;
+    }
+    result = gdbm_exists(JLONG_TO_DBF(dbf), keyDatum);
+    if ( gdbm_errno != GDBM_NO_ERROR ) {
+	GDBM_EXCEPTION(env);
+	return 0;
+    }
+    releaseArrayAbort(env, keyArray, &keyDatum);
+    return result ? JNI_TRUE : JNI_FALSE;
+}
+
+
+
+
+
+JNIEXPORT void JNICALL 
+Java_au_com_pharos_gdbm_GdbmFile_gdbm_1store
+  (JNIEnv *env, jobject obj, jlong dbf, 
+   jbyteArray keyArray, jbyteArray valueArray, jboolean replace)
+{
+    datum	keyDatum;
+    datum	valueDatum;
+    
+    CHECK_NOT_NULL_VOID(dbf, env);
+    
+    if ( !arrayToDatum(env, keyArray, &keyDatum)
+	 || !arrayToDatum(env, valueArray, &valueDatum) ) {
+	NULL_PTR_EXCEPTION(env);
+	return;
+    }
+
+    gdbm_store(JLONG_TO_DBF(dbf), keyDatum, valueDatum, 
+	       replace ? GDBM_REPLACE : 0);
+
+    releaseArrayAbort(env, keyArray, &keyDatum);
+    releaseArrayAbort(env, valueArray, &valueDatum);
+
+    if ( gdbm_errno != GDBM_NO_ERROR )
+	GDBM_EXCEPTION(env);
+}
+
+
+
+JNIEXPORT void JNICALL 
+Java_au_com_pharos_gdbm_GdbmFile_gdbm_1delete
+   (JNIEnv *env, jobject obj, jlong dbf, jbyteArray keyArray)
+{
+    datum 	keyDatum;
+
+    CHECK_NOT_NULL_VOID(dbf, env);
+
+    if (!arrayToDatum(env, keyArray, &keyDatum)) {
+	NULL_PTR_EXCEPTION(env);
+	return;
+    }
+
+    gdbm_delete(JLONG_TO_DBF(dbf), keyDatum);
+
+    releaseArrayAbort(env, keyArray, &keyDatum);
+    
+    if ( gdbm_errno != GDBM_NO_ERROR )
+	GDBM_EXCEPTION(env);
+}
+
+
+
+JNIEXPORT jstring JNICALL 
+Java_au_com_pharos_gdbm_GdbmFile_gdbm_1getversion
+  (JNIEnv *env, jclass cls)
+{
+    return (*env)->NewStringUTF(env, gdbm_version);
+}
+
+
+JNIEXPORT jstring JNICALL 
+Java_au_com_pharos_gdbm_GdbmFile_gdbm_1wrapperVersion
+  (JNIEnv *env, jclass cls)
+{
+    return (*env)->NewStringUTF(env, "JavaGDBM release " WRAPPER_VERSION 
+				" built " __DATE__);
+}
+				
+
+
+
+JNIEXPORT void JNICALL 
+Java_au_com_pharos_gdbm_GdbmFile_gdbm_1reorganize
+  (JNIEnv *env, jobject obj, jlong dbf)
+{
+    CHECK_NOT_NULL_VOID(dbf, env);
+
+    gdbm_reorganize(JLONG_TO_DBF(dbf));
+
+    if ( gdbm_errno != GDBM_NO_ERROR )
+	GDBM_EXCEPTION(env);
+}
+
+
+
+JNIEXPORT void JNICALL 
+Java_au_com_pharos_gdbm_GdbmFile_gdbm_1close
+  (JNIEnv *env, jobject obj, jlong dbf)
+{
+    CHECK_NOT_NULL_VOID(dbf, env);
+
+    gdbm_close(JLONG_TO_DBF(dbf));
+
+    if ( gdbm_errno != GDBM_NO_ERROR )
+	GDBM_EXCEPTION(env);
+}
+
+
+
+JNIEXPORT void JNICALL 
+Java_au_com_pharos_gdbm_GdbmFile_gdbm_1sync
+  (JNIEnv *env, jobject obj, jlong dbf)
+{
+    CHECK_NOT_NULL_VOID(dbf, env);
+
+    gdbm_sync(JLONG_TO_DBF(dbf));
+
+    if ( gdbm_errno != GDBM_NO_ERROR )
+	GDBM_EXCEPTION(env);
+}
+
+
+
+
+/**********************************************************************
+ *
+ * Following are support functions which aid in interfacing C to 
+ * Java. */
+
+/** Create a new Java byte array from a GDBM datum, and return a
+ * pointer thereto.  */
+
+jbyteArray datumToArray(JNIEnv *env, datum *fromDatum) 
+{
+    jbyteArray toArray;
+
+    if (!fromDatum || !fromDatum->dptr)
+	return 0;
+
+    toArray = (*env)->NewByteArray(env, fromDatum->dsize);
+    ASSERT(toArray);
+    (*env)->SetByteArrayRegion(env, toArray, 
+			       0, fromDatum->dsize, fromDatum->dptr);
+    
+    return toArray;
+}
+
+/** Convert a Java byte array to a GDBM datum.
+ *
+ * The Java array is pinned or copied for use in the datum, and must
+ * be released after use by releaseBytes. 
+ *
+ * Returns true if the array is non-null and could be pinned.  Otherwise,
+ * returns false. 
+ */
+int arrayToDatum(JNIEnv *env, jbyteArray fromArray, datum *toDatum)
+{
+    if (fromArray) {
+	toDatum->dptr = (*env)->GetByteArrayElements(env, fromArray, 0);
+	toDatum->dsize = (*env)->GetArrayLength(env, fromArray);
+	return (int) toDatum->dptr;
+    }
+    else 
+	return 0;
+}
+
+/** Release a byte array pinned or copied for use in a datum. */
+void releaseArray(JNIEnv *env, jbyteArray array, datum *fromDatum) 
+{
+    ASSERT(fromDatum->dptr);
+    (*env)->ReleaseByteArrayElements(env, array, fromDatum->dptr, 0);
+    fromDatum->dptr = 0;	/* no longer valid */
+}
+
+/** Release a byte array pinned or copied for use in a datum, aborting 
+ * any changes.  This potentially saves the runtime from having to 
+ * copy back an unchanged array. */
+void releaseArrayAbort(JNIEnv *env, jbyteArray array, datum *fromDatum) 
+{
+    ASSERT(fromDatum->dptr);
+    (*env)->ReleaseByteArrayElements(env, array, fromDatum->dptr, 
+				     JNI_ABORT);
+    fromDatum->dptr = 0;	/* no longer valid */
+}
+
+
+/** Throw a null pointer exception. */
+void nullPtrException(JNIEnv *env, const char *file, int line) 
+{
+    jclass exClass;
+    char reason[1024];
+    sprintf(reason, "Null pointer exception in GDBM wrapper (%s:%d)",
+	    file, line);
+    
+    exClass = (*env)->FindClass(env, "java/lang/NullPointerException");
+    ASSERT(exClass);
+
+    (*env)->ThrowNew(env, exClass, reason);
+}
+
+/** Translate the GDBM error into throw a Java exception, and throw
+ * same. 
+ *
+ * TODO: Throw different classes of exceptions depending on what the 
+ * underlying error is. 
+ */
+void gdbmException(JNIEnv *env, const char *file, int line) {
+    jclass exClass;
+    static char reason[1500];
+    static char srcLocation[500];
+
+    exClass = (*env)->FindClass(env, "au/com/pharos/gdbm/GdbmException");
+    ASSERT(exClass);
+
+    strncpy(reason, gdbm_strerror(gdbm_errno), 500);
+    sprintf(srcLocation, " (%s:%d)", file, line);
+
+    /* If the error code suggests that an OS or stdio error may have occurred,
+     * include supplementary information from errno. */
+    switch (gdbm_errno) {
+    case GDBM_FILE_OPEN_ERROR:
+    case GDBM_FILE_WRITE_ERROR:
+    case GDBM_FILE_SEEK_ERROR:
+    case GDBM_FILE_READ_ERROR:
+    case GDBM_MALLOC_ERROR:
+    case GDBM_REORGANIZE_FAILED:
+	strcat(reason, ": ");
+	strncat(reason, strerror(errno), 490);
+	strcat(reason, "?");
+    default:
+	/* errno is probably not useful */
+	;
+    }
+    
+    strncat(reason, srcLocation, 495);
+    gdbm_errno = GDBM_NO_ERROR;	/* this one has been handled */
+    (*env)->ThrowNew(env, exClass, reason);    
+}
+
+/* 
+ * Local variables:
+ * c-basic-offset: 4
+ * End:
+ */
Index: /trunk/gsdl3/src/packages/javagdbm/jni/win32.mak
===================================================================
--- /trunk/gsdl3/src/packages/javagdbm/jni/win32.mak	(revision 10737)
+++ /trunk/gsdl3/src/packages/javagdbm/jni/win32.mak	(revision 10737)
@@ -0,0 +1,76 @@
+###########################################################################
+#
+# win32 makefile -- javagdbm\jni
+# A component of the Greenstone digital library software
+# from the New Zealand Digital Library Project at the
+# University of Waikato, New Zealand.
+#
+# Copyright (C) 1999  The New Zealand Digital Library Project
+#
+#
+# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+###########################################################################
+
+JAVAGDBMHOME = ..
+ 
+GSDL3HOME = ..\..\..
+GSDLHOME= $(GSDL3HOME)\gs2build
+GDBMHOME = $(GSDLHOME)\packages\windows\gdbm\gdbm
+
+# set javahome here
+#JAVA_HOME =
+
+AR = lib
+CC = cl
+CPPFLAGS = 
+
+DEFS = -D__WIN32__ -DHAVE_STRING_H
+
+INCLUDES = -I"$(GDBMHOME)" \
+           -I"$(JAVA_HOME)\include" -I"$(JAVA_HOME)\include\win32"           
+
+COMPILE = $(CC) -c $(CPPFLAGS) $(DEFS) $(INCLUDES)
+
+.SUFFIXES:
+.SUFFIXES: .c .obj
+.c.obj:
+	$(COMPILE) $<
+
+ANSI2KNR = 
+o = .obj
+ 
+HEADERS = \
+    GdbmFile.h
+
+SOURCES = \
+    gdbmjava.c
+
+OBJECTS = \
+    gdbmjava$o   $(GDBMHOME)\gdbm.lib
+ 
+all : compile link
+
+compile:
+        $(COMPILE) gdbmjava.c
+
+link:
+        $(CC) -MD -LD $(OBJECTS) -Fejavagdbm.dll
+
+install: 
+        copy javagdbm.dll $(GSDL3HOME)\lib
+
+clean:
+	del *$o 
Index: /trunk/gsdl3/src/packages/javagdbm/winMake.bat
===================================================================
--- /trunk/gsdl3/src/packages/javagdbm/winMake.bat	(revision 10737)
+++ /trunk/gsdl3/src/packages/javagdbm/winMake.bat	(revision 10737)
@@ -0,0 +1,29 @@
+@echo off
+
+set MAKE=nmake
+set MAKE_OPTIONS=/f
+
+if ""%1"" == """" goto all
+if ""%1"" == ""compile"" goto go
+if ""%1"" == ""install"" goto go
+if ""%1"" == ""clean"" goto go
+
+:unknown
+	echo Error: Unrecognized argument %1.
+	goto done
+
+:go
+	if ""%2"" == ""javaonly"" goto java
+
+:all
+	cd jni
+	%MAKE% %MAKE_OPTIONS% win32.mak %1
+	cd ..
+
+:java
+	cd java
+	call winMake.bat %1
+	cd ..
+	goto done
+
+:done
