[med-svn] [sap] 06/10: New upstream version 1.1.3

Andreas Tille tille at debian.org
Sun Dec 24 12:43:08 UTC 2017


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

tille pushed a commit to branch master
in repository sap.

commit 93e6c4adcb7837c77d3a979b73a8171b929703be
Author: Andreas Tille <tille at debian.org>
Date:   Sun Dec 24 13:40:47 2017 +0100

    New upstream version 1.1.3
---
 AUTHORS                  |    2 +
 COPYING                  |  674 +++++
 ChangeLog                |   36 +
 INSTALL                  |  291 +++
 Makefile.am              |    8 +
 Makefile.in              |  585 +++++
 NEWS                     |    0
 README                   |   65 +
 aclocal.m4               |  868 +++++++
 configure                | 6439 ++++++++++++++++++++++++++++++++++++++++++++++
 configure.ac             |   36 +
 debian/changelog         |    6 -
 debian/compat            |    1 -
 debian/control           |   35 -
 debian/copyright         |   10 -
 debian/rules             |   10 -
 debian/source/format     |    1 -
 debian/upstream/metadata |   20 -
 debian/watch             |    3 -
 depcomp                  |  589 +++++
 install-sh               |  519 ++++
 missing                  |  367 +++
 src/Makefile.am          |   21 +
 src/Makefile.in          |  458 ++++
 src/bestrot.c            |  176 ++
 src/bestrot.h            |   26 +
 src/cones.c              |  377 +++
 src/cones.h              |   17 +
 src/config.h.in          |   81 +
 src/doxygen.cfg          | 1294 ++++++++++
 src/galloc.h             |   24 +
 src/geom.c               |  580 +++++
 src/geom.h               |   55 +
 src/matrix.c             |  390 +++
 src/matrix.h             |   41 +
 src/pdbprot.c            | 1117 ++++++++
 src/pdbprot.h            |  116 +
 src/ql.c                 |  303 +++
 src/ql.h                 |   29 +
 src/sap.c                | 1505 +++++++++++
 src/sap.h                |   67 +
 src/siva.c               |  261 ++
 src/siva.h               |   38 +
 src/sort.c               |  137 +
 src/sort.h               |   17 +
 src/student.h            |   52 +
 src/stutest.c            |  336 +++
 src/util.c               |   93 +
 src/util.h               |   58 +
 tests/1bom_atm.pdb       |  365 +++
 tests/1igl_atm.pdb       |  526 ++++
 tests/Makefile.am        |   17 +
 tests/Makefile.in        |  388 +++
 tests/sapout.pdb         |  123 +
 tests/test1.sh           |    4 +
 tests/test2.sh           |    3 +
 56 files changed, 19574 insertions(+), 86 deletions(-)

diff --git a/AUTHORS b/AUTHORS
new file mode 100644
index 0000000..ac130fb
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1,2 @@
+W.R. Taylor
+
diff --git a/COPYING b/COPYING
new file mode 100644
index 0000000..94a9ed0
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,674 @@
+                    GNU GENERAL PUBLIC LICENSE
+                       Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+                            Preamble
+
+  The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+  The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works.  By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users.  We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors.  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
+them 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 prevent others from denying you
+these rights or asking you to surrender the rights.  Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received.  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.
+
+  Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+  For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software.  For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+  Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so.  This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software.  The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable.  Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products.  If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+  Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary.  To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+                       TERMS AND CONDITIONS
+
+  0. Definitions.
+
+  "This License" refers to version 3 of the GNU General Public License.
+
+  "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+  "The Program" refers to any copyrightable work licensed under this
+License.  Each licensee is addressed as "you".  "Licensees" and
+"recipients" may be individuals or organizations.
+
+  To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy.  The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+  A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+  To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy.  Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+  To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies.  Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+  An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License.  If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+  1. Source Code.
+
+  The "source code" for a work means the preferred form of the work
+for making modifications to it.  "Object code" means any non-source
+form of a work.
+
+  A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+  The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form.  A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+  The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities.  However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work.  For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+  The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+  The Corresponding Source for a work in source code form is that
+same work.
+
+  2. Basic Permissions.
+
+  All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met.  This License explicitly affirms your unlimited
+permission to run the unmodified Program.  The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work.  This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+  You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force.  You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright.  Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+  Conveying under any other circumstances is permitted solely under
+the conditions stated below.  Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+  No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+  When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+  4. Conveying Verbatim Copies.
+
+  You may convey 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;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+  You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+  5. Conveying Modified Source Versions.
+
+  You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+    a) The work must carry prominent notices stating that you modified
+    it, and giving a relevant date.
+
+    b) The work must carry prominent notices stating that it is
+    released under this License and any conditions added under section
+    7.  This requirement modifies the requirement in section 4 to
+    "keep intact all notices".
+
+    c) You must license the entire work, as a whole, under this
+    License to anyone who comes into possession of a copy.  This
+    License will therefore apply, along with any applicable section 7
+    additional terms, to the whole of the work, and all its parts,
+    regardless of how they are packaged.  This License gives no
+    permission to license the work in any other way, but it does not
+    invalidate such permission if you have separately received it.
+
+    d) If the work has interactive user interfaces, each must display
+    Appropriate Legal Notices; however, if the Program has interactive
+    interfaces that do not display Appropriate Legal Notices, your
+    work need not make them do so.
+
+  A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit.  Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+  6. Conveying Non-Source Forms.
+
+  You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+    a) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by the
+    Corresponding Source fixed on a durable physical medium
+    customarily used for software interchange.
+
+    b) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by a
+    written offer, valid for at least three years and valid for as
+    long as you offer spare parts or customer support for that product
+    model, to give anyone who possesses the object code either (1) a
+    copy of the Corresponding Source for all the software in the
+    product that is covered by this License, on a durable physical
+    medium customarily used for software interchange, for a price no
+    more than your reasonable cost of physically performing this
+    conveying of source, or (2) access to copy the
+    Corresponding Source from a network server at no charge.
+
+    c) Convey individual copies of the object code with a copy of the
+    written offer to provide the Corresponding Source.  This
+    alternative is allowed only occasionally and noncommercially, and
+    only if you received the object code with such an offer, in accord
+    with subsection 6b.
+
+    d) Convey the object code by offering access from a designated
+    place (gratis or for a charge), and offer equivalent access to the
+    Corresponding Source in the same way through the same place at no
+    further charge.  You need not require recipients to copy the
+    Corresponding Source along with the object code.  If the place to
+    copy the object code is a network server, the Corresponding Source
+    may be on a different server (operated by you or a third party)
+    that supports equivalent copying facilities, provided you maintain
+    clear directions next to the object code saying where to find the
+    Corresponding Source.  Regardless of what server hosts the
+    Corresponding Source, you remain obligated to ensure that it is
+    available for as long as needed to satisfy these requirements.
+
+    e) Convey the object code using peer-to-peer transmission, provided
+    you inform other peers where the object code and Corresponding
+    Source of the work are being offered to the general public at no
+    charge under subsection 6d.
+
+  A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+  A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling.  In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage.  For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product.  A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+  "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source.  The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+  If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information.  But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+  The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed.  Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+  Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+  7. Additional Terms.
+
+  "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law.  If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+  When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it.  (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.)  You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+  Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+    a) Disclaiming warranty or limiting liability differently from the
+    terms of sections 15 and 16 of this License; or
+
+    b) Requiring preservation of specified reasonable legal notices or
+    author attributions in that material or in the Appropriate Legal
+    Notices displayed by works containing it; or
+
+    c) Prohibiting misrepresentation of the origin of that material, or
+    requiring that modified versions of such material be marked in
+    reasonable ways as different from the original version; or
+
+    d) Limiting the use for publicity purposes of names of licensors or
+    authors of the material; or
+
+    e) Declining to grant rights under trademark law for use of some
+    trade names, trademarks, or service marks; or
+
+    f) Requiring indemnification of licensors and authors of that
+    material by anyone who conveys the material (or modified versions of
+    it) with contractual assumptions of liability to the recipient, for
+    any liability that these contractual assumptions directly impose on
+    those licensors and authors.
+
+  All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10.  If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term.  If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+  If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+  Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+  8. Termination.
+
+  You may not propagate or modify a covered work except as expressly
+provided under this License.  Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+  However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+  Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+  Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License.  If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+  9. Acceptance Not Required for Having Copies.
+
+  You are not required to accept this License in order to receive or
+run a copy of the Program.  Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance.  However,
+nothing other than this License grants you permission to propagate or
+modify any covered work.  These actions infringe copyright if you do
+not accept this License.  Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+  10. Automatic Licensing of Downstream Recipients.
+
+  Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License.  You are not responsible
+for enforcing compliance by third parties with this License.
+
+  An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations.  If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+  You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License.  For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+  11. Patents.
+
+  A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based.  The
+work thus licensed is called the contributor's "contributor version".
+
+  A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version.  For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+  Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+  In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement).  To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+  If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients.  "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+  If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+  A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License.  You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+  Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+  12. No Surrender of Others' Freedom.
+
+  If 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 convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all.  For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+  13. Use with the GNU Affero General Public License.
+
+  Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work.  The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+  14. Revised Versions of this License.
+
+  The Free Software Foundation may publish revised and/or new versions of
+the GNU 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 that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation.  If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+  If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+  Later license versions may give you additional or different
+permissions.  However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+  15. Disclaimer of Warranty.
+
+  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.
+
+  16. Limitation of Liability.
+
+  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+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.
+
+  17. Interpretation of Sections 15 and 16.
+
+  If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+                     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
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 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, see <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+  If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+    <program>  Copyright (C) <year>  <name of author>
+    This program 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, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+  You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+  The GNU 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 Lesser General
+Public License instead of this License.  But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
diff --git a/ChangeLog b/ChangeLog
new file mode 100644
index 0000000..7f01df8
--- /dev/null
+++ b/ChangeLog
@@ -0,0 +1,36 @@
+================================================================================
+ChangeLog of program SAP
+(C) 2008-2012 Jens Kleinjung
+================================================================================
+
+- 1.1.3
+Tue Sep  4 16:08:49 BST 2012
+	Replaced 'alloca' with 'malloc'.
+
+- 1.1.2
+Mon Jun 18 18:17:44 BST 2012
+	Removed obsolete 'malloc.h' include. Using 'stdlib.h' instead.
+
+- 1.1.1
+Thu Feb  4 13:52:13 GMT 2010
+	Commented out misplaced secondary structure output line ('ss = ')
+
+- 1.1.0
+Wed Jul 15 16:45:05 BST 2009
+	Compilation with GNU build tools.
+
+- 1.0.2
+Thu Nov 27 13:53:35 GMT 2008
+	Correction of prototype definitions in header files.
+
+Thu Nov 27 12:25:51 GMT 2008 : Siv Hollup :
+	Clean-up of code to make it ANSI C compliant.
+
+- 1.0.1
+Fri Nov  7 17:59:47 GMT 2008
+	Matrix initialisation to fix bug occurring with protein structures
+	2A4MC.pdb and 2J5BB.pdb .
+
+- 1.0.0
+06.2008 : release of SAP (http://mathbio.nimr.mrc.ac.uk/wiki/Software)
+
diff --git a/INSTALL b/INSTALL
new file mode 100644
index 0000000..8b82ade
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,291 @@
+Installation Instructions
+*************************
+
+Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
+2006, 2007, 2008 Free Software Foundation, Inc.
+
+   This file is free documentation; the Free Software Foundation gives
+unlimited permission to copy, distribute and modify it.
+
+Basic Installation
+==================
+
+   Briefly, the shell commands `./configure; make; make install' should
+configure, build, and install this package.  The following
+more-detailed instructions are generic; see the `README' file for
+instructions specific to this package.
+
+   The `configure' shell script attempts to guess correct values for
+various system-dependent variables used during compilation.  It uses
+those values to create a `Makefile' in each directory of the package.
+It may also create one or more `.h' files containing system-dependent
+definitions.  Finally, it creates a shell script `config.status' that
+you can run in the future to recreate the current configuration, and a
+file `config.log' containing compiler output (useful mainly for
+debugging `configure').
+
+   It can also use an optional file (typically called `config.cache'
+and enabled with `--cache-file=config.cache' or simply `-C') that saves
+the results of its tests to speed up reconfiguring.  Caching is
+disabled by default to prevent problems with accidental use of stale
+cache files.
+
+   If you need to do unusual things to compile the package, please try
+to figure out how `configure' could check whether to do them, and mail
+diffs or instructions to the address given in the `README' so they can
+be considered for the next release.  If you are using the cache, and at
+some point `config.cache' contains results you don't want to keep, you
+may remove or edit it.
+
+   The file `configure.ac' (or `configure.in') is used to create
+`configure' by a program called `autoconf'.  You need `configure.ac' if
+you want to change it or regenerate `configure' using a newer version
+of `autoconf'.
+
+The simplest way to compile this package is:
+
+  1. `cd' to the directory containing the package's source code and type
+     `./configure' to configure the package for your system.
+
+     Running `configure' might take a while.  While running, it prints
+     some messages telling which features it is checking for.
+
+  2. Type `make' to compile the package.
+
+  3. Optionally, type `make check' to run any self-tests that come with
+     the package.
+
+  4. Type `make install' to install the programs and any data files and
+     documentation.
+
+  5. You can remove the program binaries and object files from the
+     source code directory by typing `make clean'.  To also remove the
+     files that `configure' created (so you can compile the package for
+     a different kind of computer), type `make distclean'.  There is
+     also a `make maintainer-clean' target, but that is intended mainly
+     for the package's developers.  If you use it, you may have to get
+     all sorts of other programs in order to regenerate files that came
+     with the distribution.
+
+  6. Often, you can also type `make uninstall' to remove the installed
+     files again.
+
+Compilers and Options
+=====================
+
+   Some systems require unusual options for compilation or linking that
+the `configure' script does not know about.  Run `./configure --help'
+for details on some of the pertinent environment variables.
+
+   You can give `configure' initial values for configuration parameters
+by setting variables in the command line or in the environment.  Here
+is an example:
+
+     ./configure CC=c99 CFLAGS=-g LIBS=-lposix
+
+   *Note Defining Variables::, for more details.
+
+Compiling For Multiple Architectures
+====================================
+
+   You can compile the package for more than one kind of computer at the
+same time, by placing the object files for each architecture in their
+own directory.  To do this, you can use GNU `make'.  `cd' to the
+directory where you want the object files and executables to go and run
+the `configure' script.  `configure' automatically checks for the
+source code in the directory that `configure' is in and in `..'.
+
+   With a non-GNU `make', it is safer to compile the package for one
+architecture at a time in the source code directory.  After you have
+installed the package for one architecture, use `make distclean' before
+reconfiguring for another architecture.
+
+   On MacOS X 10.5 and later systems, you can create libraries and
+executables that work on multiple system types--known as "fat" or
+"universal" binaries--by specifying multiple `-arch' options to the
+compiler but only a single `-arch' option to the preprocessor.  Like
+this:
+
+     ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+                 CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+                 CPP="gcc -E" CXXCPP="g++ -E"
+
+   This is not guaranteed to produce working output in all cases, you
+may have to build one architecture at a time and combine the results
+using the `lipo' tool if you have problems.
+
+Installation Names
+==================
+
+   By default, `make install' installs the package's commands under
+`/usr/local/bin', include files under `/usr/local/include', etc.  You
+can specify an installation prefix other than `/usr/local' by giving
+`configure' the option `--prefix=PREFIX'.
+
+   You can specify separate installation prefixes for
+architecture-specific files and architecture-independent files.  If you
+pass the option `--exec-prefix=PREFIX' to `configure', the package uses
+PREFIX as the prefix for installing programs and libraries.
+Documentation and other data files still use the regular prefix.
+
+   In addition, if you use an unusual directory layout you can give
+options like `--bindir=DIR' to specify different values for particular
+kinds of files.  Run `configure --help' for a list of the directories
+you can set and what kinds of files go in them.
+
+   If the package supports it, you can cause programs to be installed
+with an extra prefix or suffix on their names by giving `configure' the
+option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
+
+Optional Features
+=================
+
+   Some packages pay attention to `--enable-FEATURE' options to
+`configure', where FEATURE indicates an optional part of the package.
+They may also pay attention to `--with-PACKAGE' options, where PACKAGE
+is something like `gnu-as' or `x' (for the X Window System).  The
+`README' should mention any `--enable-' and `--with-' options that the
+package recognizes.
+
+   For packages that use the X Window System, `configure' can usually
+find the X include and library files automatically, but if it doesn't,
+you can use the `configure' options `--x-includes=DIR' and
+`--x-libraries=DIR' to specify their locations.
+
+Particular systems
+==================
+
+   On HP-UX, the default C compiler is not ANSI C compatible.  If GNU
+CC is not installed, it is recommended to use the following options in
+order to use an ANSI C compiler:
+
+     ./configure CC="cc -Ae"
+
+and if that doesn't work, install pre-built binaries of GCC for HP-UX.
+
+   On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
+parse its `<wchar.h>' header file.  The option `-nodtk' can be used as
+a workaround.  If GNU CC is not installed, it is therefore recommended
+to try
+
+     ./configure CC="cc"
+
+and if that doesn't work, try
+
+     ./configure CC="cc -nodtk"
+
+Specifying the System Type
+==========================
+
+   There may be some features `configure' cannot figure out
+automatically, but needs to determine by the type of machine the package
+will run on.  Usually, assuming the package is built to be run on the
+_same_ architectures, `configure' can figure that out, but if it prints
+a message saying it cannot guess the machine type, give it the
+`--build=TYPE' option.  TYPE can either be a short name for the system
+type, such as `sun4', or a canonical name which has the form:
+
+     CPU-COMPANY-SYSTEM
+
+where SYSTEM can have one of these forms:
+
+     OS KERNEL-OS
+
+   See the file `config.sub' for the possible values of each field.  If
+`config.sub' isn't included in this package, then this package doesn't
+need to know the machine type.
+
+   If you are _building_ compiler tools for cross-compiling, you should
+use the option `--target=TYPE' to select the type of system they will
+produce code for.
+
+   If you want to _use_ a cross compiler, that generates code for a
+platform different from the build platform, you should specify the
+"host" platform (i.e., that on which the generated programs will
+eventually be run) with `--host=TYPE'.
+
+Sharing Defaults
+================
+
+   If you want to set default values for `configure' scripts to share,
+you can create a site shell script called `config.site' that gives
+default values for variables like `CC', `cache_file', and `prefix'.
+`configure' looks for `PREFIX/share/config.site' if it exists, then
+`PREFIX/etc/config.site' if it exists.  Or, you can set the
+`CONFIG_SITE' environment variable to the location of the site script.
+A warning: not all `configure' scripts look for a site script.
+
+Defining Variables
+==================
+
+   Variables not defined in a site shell script can be set in the
+environment passed to `configure'.  However, some packages may run
+configure again during the build, and the customized values of these
+variables may be lost.  In order to avoid this problem, you should set
+them in the `configure' command line, using `VAR=value'.  For example:
+
+     ./configure CC=/usr/local2/bin/gcc
+
+causes the specified `gcc' to be used as the C compiler (unless it is
+overridden in the site shell script).
+
+Unfortunately, this technique does not work for `CONFIG_SHELL' due to
+an Autoconf bug.  Until the bug is fixed you can use this workaround:
+
+     CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
+
+`configure' Invocation
+======================
+
+   `configure' recognizes the following options to control how it
+operates.
+
+`--help'
+`-h'
+     Print a summary of all of the options to `configure', and exit.
+
+`--help=short'
+`--help=recursive'
+     Print a summary of the options unique to this package's
+     `configure', and exit.  The `short' variant lists options used
+     only in the top level, while the `recursive' variant lists options
+     also present in any nested packages.
+
+`--version'
+`-V'
+     Print the version of Autoconf used to generate the `configure'
+     script, and exit.
+
+`--cache-file=FILE'
+     Enable the cache: use and save the results of the tests in FILE,
+     traditionally `config.cache'.  FILE defaults to `/dev/null' to
+     disable caching.
+
+`--config-cache'
+`-C'
+     Alias for `--cache-file=config.cache'.
+
+`--quiet'
+`--silent'
+`-q'
+     Do not print messages saying which checks are being made.  To
+     suppress all normal output, redirect it to `/dev/null' (any error
+     messages will still be shown).
+
+`--srcdir=DIR'
+     Look for the package's source code in directory DIR.  Usually
+     `configure' can determine that directory automatically.
+
+`--prefix=DIR'
+     Use DIR as the installation prefix.  *Note Installation Names::
+     for more details, including other options available for fine-tuning
+     the installation locations.
+
+`--no-create'
+`-n'
+     Run the configure checks, but stop before creating any output
+     files.
+
+`configure' also accepts some other, not widely useful, options.  Run
+`configure --help' for more details.
+
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..7d94c88
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,8 @@
+#===============================================================================
+# Makefile.am : for automake
+#===============================================================================
+
+SUBDIRS = src tests
+
+EXTRA_DIST = doc 
+
diff --git a/Makefile.in b/Makefile.in
new file mode 100644
index 0000000..62b6e97
--- /dev/null
+++ b/Makefile.in
@@ -0,0 +1,585 @@
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+#===============================================================================
+# Makefile.am : for automake
+#===============================================================================
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+subdir = .
+DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in $(top_srcdir)/configure AUTHORS COPYING \
+	ChangeLog INSTALL NEWS depcomp install-sh missing
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno config.status.lineno
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/src/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-dvi-recursive install-exec-recursive \
+	install-html-recursive install-info-recursive \
+	install-pdf-recursive install-ps-recursive install-recursive \
+	installcheck-recursive installdirs-recursive pdf-recursive \
+	ps-recursive uninstall-recursive
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
+  distclean-recursive maintainer-clean-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+am__remove_distdir = \
+  { test ! -d $(distdir) \
+    || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
+         && rm -fr $(distdir); }; }
+DIST_ARCHIVES = $(distdir).tar.gz
+GZIP_ENV = --best
+distuninstallcheck_listfiles = find . -type f -print
+distcleancheck_listfiles = find . -type f -print
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTI_CFLAGS = @INTI_CFLAGS@
+INTI_LIBS = @INTI_LIBS@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build_alias = @build_alias@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host_alias = @host_alias@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+SUBDIRS = src tests
+EXTRA_DIST = doc 
+all: all-recursive
+
+.SUFFIXES:
+am--refresh:
+	@:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \
+	      cd $(srcdir) && $(AUTOMAKE) --gnu  \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu  Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    echo ' $(SHELL) ./config.status'; \
+	    $(SHELL) ./config.status;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	$(SHELL) ./config.status --recheck
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+$(RECURSIVE_CLEAN_TARGETS):
+	@failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	$(am__remove_distdir)
+	test -d $(distdir) || mkdir $(distdir)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d "$(distdir)/$$subdir" \
+	    || $(MKDIR_P) "$(distdir)/$$subdir" \
+	    || exit 1; \
+	    distdir=`$(am__cd) $(distdir) && pwd`; \
+	    top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$top_distdir" \
+	        distdir="$$distdir/$$subdir" \
+		am__remove_distdir=: \
+		am__skip_length_check=: \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+	-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
+	  ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+	  ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+	  ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
+	|| chmod -R a+r $(distdir)
+dist-gzip: distdir
+	tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+	$(am__remove_distdir)
+
+dist-bzip2: distdir
+	tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
+	$(am__remove_distdir)
+
+dist-lzma: distdir
+	tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
+	$(am__remove_distdir)
+
+dist-tarZ: distdir
+	tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
+	$(am__remove_distdir)
+
+dist-shar: distdir
+	shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+	$(am__remove_distdir)
+
+dist-zip: distdir
+	-rm -f $(distdir).zip
+	zip -rq $(distdir).zip $(distdir)
+	$(am__remove_distdir)
+
+dist dist-all: distdir
+	tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+	$(am__remove_distdir)
+
+# This target untars the dist file and tries a VPATH configuration.  Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+	case '$(DIST_ARCHIVES)' in \
+	*.tar.gz*) \
+	  GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
+	*.tar.bz2*) \
+	  bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
+	*.tar.lzma*) \
+	  unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\
+	*.tar.Z*) \
+	  uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
+	*.shar.gz*) \
+	  GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
+	*.zip*) \
+	  unzip $(distdir).zip ;;\
+	esac
+	chmod -R a-w $(distdir); chmod a+w $(distdir)
+	mkdir $(distdir)/_build
+	mkdir $(distdir)/_inst
+	chmod a-w $(distdir)
+	dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+	  && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+	  && cd $(distdir)/_build \
+	  && ../configure --srcdir=.. --prefix="$$dc_install_base" \
+	    $(DISTCHECK_CONFIGURE_FLAGS) \
+	  && $(MAKE) $(AM_MAKEFLAGS) \
+	  && $(MAKE) $(AM_MAKEFLAGS) dvi \
+	  && $(MAKE) $(AM_MAKEFLAGS) check \
+	  && $(MAKE) $(AM_MAKEFLAGS) install \
+	  && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+	  && $(MAKE) $(AM_MAKEFLAGS) uninstall \
+	  && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
+	        distuninstallcheck \
+	  && chmod -R a-w "$$dc_install_base" \
+	  && ({ \
+	       (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
+	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
+	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
+	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
+	            distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
+	      } || { rm -rf "$$dc_destdir"; exit 1; }) \
+	  && rm -rf "$$dc_destdir" \
+	  && $(MAKE) $(AM_MAKEFLAGS) dist \
+	  && rm -rf $(DIST_ARCHIVES) \
+	  && $(MAKE) $(AM_MAKEFLAGS) distcleancheck
+	$(am__remove_distdir)
+	@(echo "$(distdir) archives ready for distribution: "; \
+	  list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+	  sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
+distuninstallcheck:
+	@cd $(distuninstallcheck_dir) \
+	&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
+	   || { echo "ERROR: files left after uninstall:" ; \
+	        if test -n "$(DESTDIR)"; then \
+	          echo "  (check DESTDIR support)"; \
+	        fi ; \
+	        $(distuninstallcheck_listfiles) ; \
+	        exit 1; } >&2
+distcleancheck: distclean
+	@if test '$(srcdir)' = . ; then \
+	  echo "ERROR: distcleancheck can only run from a VPATH build" ; \
+	  exit 1 ; \
+	fi
+	@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
+	  || { echo "ERROR: files left in build directory after distclean:" ; \
+	       $(distcleancheck_listfiles) ; \
+	       exit 1; } >&2
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-recursive
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-info: install-info-recursive
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-ps: install-ps-recursive
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
+	-rm -rf $(top_srcdir)/autom4te.cache
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
+	install-strip
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+	all all-am am--refresh check check-am clean clean-generic \
+	ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \
+	dist-lzma dist-shar dist-tarZ dist-zip distcheck distclean \
+	distclean-generic distclean-tags distcleancheck distdir \
+	distuninstallcheck dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	installdirs-am maintainer-clean maintainer-clean-generic \
+	mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags \
+	tags-recursive uninstall uninstall-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/NEWS b/NEWS
new file mode 100644
index 0000000..e69de29
diff --git a/README b/README
new file mode 100644
index 0000000..f51d366
--- /dev/null
+++ b/README
@@ -0,0 +1,65 @@
+
+SAP : Pairwise structure alignment via double dynamic programming
+-----------------------------------------------------------------
+
+References
+----------
+Users publishing results obtained with the program and its applications
+should acknowledge its use by the following citation:
+
+- Taylor W.R., Protein structure comparison using iterated double 
+	dynamic programming. Protein Sci. 8 (1999) 654-665.
+
+- Taylor W.R., Protein structure comparison using SAP. 
+	Methods Mol. Biol. 143 (2000) 19-32.
+
+
+Install / Uninstall
+-------------------
+Please read the general 'INSTALL' instructions.
+For documentation execute 'doxygen doxygen.cfg' in the 'src' directory.
+Documentation files are created in 'doc/html' and 'doc/latex'.
+The latex documentation is completed by executing 'make pdf' in the
+'doc/latex' directory, which creates 'refman.ps' and 'refman.pdf'.
+
+
+Usage
+-----
+	sap <PDB_1> <PDB_2>
+
+	sap <PDB_1> <PDB_2> <one2one>
+<one2one> is an optional integer value added to the diagonal;
+any negative value selects the default value of 1000.
+
+
+Server
+-------
+SAP: http://mathbio.nimr.mrc.ac.uk/wiki/SAP
+
+
+-------------------------------------------------------------------------------
+(C) 1999 W.R. Taylor (program author)
+(C) 2007 Alessandro Pandini : SAP web server
+(C) 2007 Jens Kleinjung : code release
+(C) 2008 Siv Hollup : code update to ANSI C standard
+
+Availability
+------------
+The program is made available under the GNU Public License for academic
+scientific purposes, under the condition that proper acknowledgement
+is made to the authors of the program in publications resulting from the use
+of the program.
+
+License
+-------
+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 3 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, see <http://www.gnu.org/licenses/>.
+
diff --git a/aclocal.m4 b/aclocal.m4
new file mode 100644
index 0000000..132e431
--- /dev/null
+++ b/aclocal.m4
@@ -0,0 +1,868 @@
+# generated automatically by aclocal 1.10.1 -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+m4_if(AC_AUTOCONF_VERSION, [2.63],,
+[m4_warning([this file was generated for autoconf 2.63.
+You have another version of autoconf.  It may work, but is not guaranteed to.
+If you have problems, you may need to regenerate the build system entirely.
+To do so, use the procedure documented by the package, typically `autoreconf'.])])
+
+# Copyright (C) 2002, 2003, 2005, 2006, 2007  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_AUTOMAKE_VERSION(VERSION)
+# ----------------------------
+# Automake X.Y traces this macro to ensure aclocal.m4 has been
+# generated from the m4 files accompanying Automake X.Y.
+# (This private macro should not be called outside this file.)
+AC_DEFUN([AM_AUTOMAKE_VERSION],
+[am__api_version='1.10'
+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
+dnl require some minimum version.  Point them to the right macro.
+m4_if([$1], [1.10.1], [],
+      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
+])
+
+# _AM_AUTOCONF_VERSION(VERSION)
+# -----------------------------
+# aclocal traces this macro to find the Autoconf version.
+# This is a private macro too.  Using m4_define simplifies
+# the logic in aclocal, which can simply ignore this definition.
+m4_define([_AM_AUTOCONF_VERSION], [])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
+# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+[AM_AUTOMAKE_VERSION([1.10.1])dnl
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+_AM_AUTOCONF_VERSION(AC_AUTOCONF_VERSION)])
+
+# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
+
+# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
+# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
+# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
+#
+# Of course, Automake must honor this variable whenever it calls a
+# tool from the auxiliary directory.  The problem is that $srcdir (and
+# therefore $ac_aux_dir as well) can be either absolute or relative,
+# depending on how configure is run.  This is pretty annoying, since
+# it makes $ac_aux_dir quite unusable in subdirectories: in the top
+# source directory, any form will work fine, but in subdirectories a
+# relative path needs to be adjusted first.
+#
+# $ac_aux_dir/missing
+#    fails when called from a subdirectory if $ac_aux_dir is relative
+# $top_srcdir/$ac_aux_dir/missing
+#    fails if $ac_aux_dir is absolute,
+#    fails when called from a subdirectory in a VPATH build with
+#          a relative $ac_aux_dir
+#
+# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
+# are both prefixed by $srcdir.  In an in-source build this is usually
+# harmless because $srcdir is `.', but things will broke when you
+# start a VPATH build or use an absolute $srcdir.
+#
+# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
+# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
+#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
+# and then we would define $MISSING as
+#   MISSING="\${SHELL} $am_aux_dir/missing"
+# This will work as long as MISSING is not called from configure, because
+# unfortunately $(top_srcdir) has no meaning in configure.
+# However there are other variables, like CC, which are often used in
+# configure, and could therefore not use this "fixed" $ac_aux_dir.
+#
+# Another solution, used here, is to always expand $ac_aux_dir to an
+# absolute PATH.  The drawback is that using absolute paths prevent a
+# configured tree to be moved without reconfiguration.
+
+AC_DEFUN([AM_AUX_DIR_EXPAND],
+[dnl Rely on autoconf to set up CDPATH properly.
+AC_PREREQ([2.50])dnl
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+])
+
+# AM_CONDITIONAL                                            -*- Autoconf -*-
+
+# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 8
+
+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+AC_DEFUN([AM_CONDITIONAL],
+[AC_PREREQ(2.52)dnl
+ ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
+	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+if $2; then
+  $1_TRUE=
+  $1_FALSE='#'
+else
+  $1_TRUE='#'
+  $1_FALSE=
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+  AC_MSG_ERROR([[conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.]])
+fi])])
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 9
+
+# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
+# written in clear, in which case automake, when reading aclocal.m4,
+# will think it sees a *use*, and therefore will trigger all it's
+# C support machinery.  Also note that it means that autoscan, seeing
+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
+
+# _AM_DEPENDENCIES(NAME)
+# ----------------------
+# See how the compiler implements dependency checking.
+# NAME is "CC", "CXX", "GCJ", or "OBJC".
+# We try a few techniques and use that to set a single cache variable.
+#
+# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
+# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
+# dependency, and given that the user is not expected to run this macro,
+# just rely on AC_PROG_CC.
+AC_DEFUN([_AM_DEPENDENCIES],
+[AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
+AC_REQUIRE([AM_MAKE_INCLUDE])dnl
+AC_REQUIRE([AM_DEP_TRACK])dnl
+
+ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
+       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
+       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
+       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
+                   [depcc="$$1"   am_compiler_list=])
+
+AC_CACHE_CHECK([dependency style of $depcc],
+               [am_cv_$1_dependencies_compiler_type],
+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_$1_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+  fi
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    case $depmode in
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+	continue
+      else
+	break
+      fi
+      ;;
+    none) break ;;
+    esac
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.
+    if depmode=$depmode \
+       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_$1_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_$1_dependencies_compiler_type=none
+fi
+])
+AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
+AM_CONDITIONAL([am__fastdep$1], [
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
+])
+
+
+# AM_SET_DEPDIR
+# -------------
+# Choose a directory name for dependency files.
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES
+AC_DEFUN([AM_SET_DEPDIR],
+[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
+])
+
+
+# AM_DEP_TRACK
+# ------------
+AC_DEFUN([AM_DEP_TRACK],
+[AC_ARG_ENABLE(dependency-tracking,
+[  --disable-dependency-tracking  speeds up one-time build
+  --enable-dependency-tracking   do not reject slow dependency extractors])
+if test "x$enable_dependency_tracking" != xno; then
+  am_depcomp="$ac_aux_dir/depcomp"
+  AMDEPBACKSLASH='\'
+fi
+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+AC_SUBST([AMDEPBACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+])
+
+# Generate code to set up dependency tracking.              -*- Autoconf -*-
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+#serial 3
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[for mf in $CONFIG_FILES; do
+  # Strip MF so we end up with the name of the file.
+  mf=`echo "$mf" | sed -e 's/:.*$//'`
+  # Check whether this is an Automake generated Makefile or not.
+  # We used to match only the files named `Makefile.in', but
+  # some people rename them; so instead we look at the file content.
+  # Grep'ing the first line is not enough: some people post-process
+  # each Makefile.in and add a new line on top of each file to say so.
+  # Grep'ing the whole file is not good either: AIX grep has a line
+  # limit of 2048, but all sed's we know have understand at least 4000.
+  if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+    dirpart=`AS_DIRNAME("$mf")`
+  else
+    continue
+  fi
+  # Extract the definition of DEPDIR, am__include, and am__quote
+  # from the Makefile without running `make'.
+  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+  test -z "$DEPDIR" && continue
+  am__include=`sed -n 's/^am__include = //p' < "$mf"`
+  test -z "am__include" && continue
+  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+  # When using ansi2knr, U may be empty or an underscore; expand it
+  U=`sed -n 's/^U = //p' < "$mf"`
+  # Find all dependency output files, they are included files with
+  # $(DEPDIR) in their names.  We invoke sed twice because it is the
+  # simplest approach to changing $(DEPDIR) to its actual value in the
+  # expansion.
+  for file in `sed -n "
+    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+    # Make sure the directory exists.
+    test -f "$dirpart/$file" && continue
+    fdir=`AS_DIRNAME(["$file"])`
+    AS_MKDIR_P([$dirpart/$fdir])
+    # echo "creating $dirpart/$file"
+    echo '# dummy' > "$dirpart/$file"
+  done
+done
+])# _AM_OUTPUT_DEPENDENCY_COMMANDS
+
+
+# AM_OUTPUT_DEPENDENCY_COMMANDS
+# -----------------------------
+# This macro should only be invoked once -- use via AC_REQUIRE.
+#
+# This code is only required when automatic dependency tracking
+# is enabled.  FIXME.  This creates each `.P' file that we will
+# need in order to bootstrap the dependency handling code.
+AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
+[AC_CONFIG_COMMANDS([depfiles],
+     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
+     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
+])
+
+# Do all the work for Automake.                             -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2008 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 13
+
+# This macro actually does too much.  Some checks are only needed if
+# your package does certain things.  But this isn't really a big deal.
+
+# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
+# AM_INIT_AUTOMAKE([OPTIONS])
+# -----------------------------------------------
+# The call with PACKAGE and VERSION arguments is the old style
+# call (pre autoconf-2.50), which is being phased out.  PACKAGE
+# and VERSION should now be passed to AC_INIT and removed from
+# the call to AM_INIT_AUTOMAKE.
+# We support both call styles for the transition.  After
+# the next Automake release, Autoconf can make the AC_INIT
+# arguments mandatory, and then we can depend on a new Autoconf
+# release and drop the old call support.
+AC_DEFUN([AM_INIT_AUTOMAKE],
+[AC_PREREQ([2.60])dnl
+dnl Autoconf wants to disallow AM_ names.  We explicitly allow
+dnl the ones we care about.
+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])dnl
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+  fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+  if (cygpath --version) >/dev/null 2>/dev/null; then
+    CYGPATH_W='cygpath -w'
+  else
+    CYGPATH_W=echo
+  fi
+fi
+AC_SUBST([CYGPATH_W])
+
+# Define the identity of the package.
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+ AC_SUBST([PACKAGE], [$1])dnl
+ AC_SUBST([VERSION], [$2])],
+[_AM_SET_OPTIONS([$1])dnl
+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
+m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
+  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_AM_IF_OPTION([no-define],,
+[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
+
+# Some tools Automake needs.
+AC_REQUIRE([AM_SANITY_CHECK])dnl
+AC_REQUIRE([AC_ARG_PROGRAM])dnl
+AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
+AM_MISSING_PROG(AUTOCONF, autoconf)
+AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
+AM_MISSING_PROG(AUTOHEADER, autoheader)
+AM_MISSING_PROG(MAKEINFO, makeinfo)
+AM_PROG_INSTALL_SH
+AM_PROG_INSTALL_STRIP
+AC_REQUIRE([AM_PROG_MKDIR_P])dnl
+# We need awk for the "check" target.  The system "awk" is bad on
+# some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
+              [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+	      		     [_AM_PROG_TAR([v7])])])
+_AM_IF_OPTION([no-dependencies],,
+[AC_PROVIDE_IFELSE([AC_PROG_CC],
+                  [_AM_DEPENDENCIES(CC)],
+                  [define([AC_PROG_CC],
+                          defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+                  [_AM_DEPENDENCIES(CXX)],
+                  [define([AC_PROG_CXX],
+                          defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+                  [_AM_DEPENDENCIES(OBJC)],
+                  [define([AC_PROG_OBJC],
+                          defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
+])
+])
+
+
+# When config.status generates a header, we must update the stamp-h file.
+# This file resides in the same directory as the config header
+# that is generated.  The stamp files are numbered to have different names.
+
+# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
+# loop where config.status creates the headers, so we can generate
+# our stamp files there.
+AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
+[# Compute $1's index in $config_headers.
+_am_arg=$1
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $_am_arg | $_am_arg:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
+
+# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
+AC_SUBST(install_sh)])
+
+# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# Check whether the underlying file-system supports filenames
+# with a leading dot.  For instance MS-DOS doesn't.
+AC_DEFUN([AM_SET_LEADING_DOT],
+[rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+  am__leading_dot=.
+else
+  am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+AC_SUBST([am__leading_dot])])
+
+# Check to see how 'make' treats includes.	            -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 3
+
+# AM_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+	@echo done
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+AC_MSG_CHECKING([for style of include used by $am_make])
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
+   am__include=include
+   am__quote=
+   _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+      am__include=.include
+      am__quote="\""
+      _am_result=BSD
+   fi
+fi
+AC_SUBST([am__include])
+AC_SUBST([am__quote])
+AC_MSG_RESULT([$_am_result])
+rm -f confinc confmf
+])
+
+# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
+
+# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 5
+
+# AM_MISSING_PROG(NAME, PROGRAM)
+# ------------------------------
+AC_DEFUN([AM_MISSING_PROG],
+[AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+
+
+# AM_MISSING_HAS_RUN
+# ------------------
+# Define MISSING if not defined so far and test if it supports --run.
+# If it does, set am_missing_run to use it, otherwise, to nothing.
+AC_DEFUN([AM_MISSING_HAS_RUN],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([missing])dnl
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+  am_missing_run="$MISSING --run "
+else
+  am_missing_run=
+  AC_MSG_WARN([`missing' script is too old or missing])
+fi
+])
+
+# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_MKDIR_P
+# ---------------
+# Check for `mkdir -p'.
+AC_DEFUN([AM_PROG_MKDIR_P],
+[AC_PREREQ([2.60])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+dnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
+dnl while keeping a definition of mkdir_p for backward compatibility.
+dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
+dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
+dnl Makefile.ins that do not define MKDIR_P, so we do our own
+dnl adjustment using top_builddir (which is defined more often than
+dnl MKDIR_P).
+AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
+case $mkdir_p in
+  [[\\/$]]* | ?:[[\\/]]*) ;;
+  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+])
+
+# Helper functions for option handling.                     -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 3
+
+# _AM_MANGLE_OPTION(NAME)
+# -----------------------
+AC_DEFUN([_AM_MANGLE_OPTION],
+[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
+
+# _AM_SET_OPTION(NAME)
+# ------------------------------
+# Set option NAME.  Presently that only means defining a flag for this option.
+AC_DEFUN([_AM_SET_OPTION],
+[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
+
+# _AM_SET_OPTIONS(OPTIONS)
+# ----------------------------------
+# OPTIONS is a space-separated list of Automake options.
+AC_DEFUN([_AM_SET_OPTIONS],
+[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+
+# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
+# -------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+AC_DEFUN([_AM_IF_OPTION],
+[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+
+# Check to make sure that the build environment is sane.    -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# AM_SANITY_CHECK
+# ---------------
+AC_DEFUN([AM_SANITY_CHECK],
+[AC_MSG_CHECKING([whether build environment is sane])
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments.  Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+   if test "$[*]" = "X"; then
+      # -L didn't work.
+      set X `ls -t $srcdir/configure conftest.file`
+   fi
+   rm -f conftest.file
+   if test "$[*]" != "X $srcdir/configure conftest.file" \
+      && test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+      # If neither matched, then we have a broken ls.  This can happen
+      # if, for instance, CONFIG_SHELL is bash and it inherits a
+      # broken ls alias from the environment.  This has actually
+      # happened.  Such a system could not be considered "sane".
+      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
+alias in your environment])
+   fi
+
+   test "$[2]" = conftest.file
+   )
+then
+   # Ok.
+   :
+else
+   AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+AC_MSG_RESULT(yes)])
+
+# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_STRIP
+# ---------------------
+# One issue with vendor `install' (even GNU) is that you can't
+# specify the program used to strip binaries.  This is especially
+# annoying in cross-compiling environments, where the build's strip
+# is unlikely to handle the host's binaries.
+# Fortunately install-sh will honor a STRIPPROG variable, so we
+# always use install-sh in `make install-strip', and initialize
+# STRIPPROG with the value of the STRIP variable (set by the user).
+AC_DEFUN([AM_PROG_INSTALL_STRIP],
+[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'.  However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
+if test "$cross_compiling" != no; then
+  AC_CHECK_TOOL([STRIP], [strip], :)
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# Copyright (C) 2006  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
+# This macro is traced by Automake.
+AC_DEFUN([_AM_SUBST_NOTMAKE])
+
+# Check how to create a tarball.                            -*- Autoconf -*-
+
+# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# _AM_PROG_TAR(FORMAT)
+# --------------------
+# Check how to create a tarball in format FORMAT.
+# FORMAT should be one of `v7', `ustar', or `pax'.
+#
+# Substitute a variable $(am__tar) that is a command
+# writing to stdout a FORMAT-tarball containing the directory
+# $tardir.
+#     tardir=directory && $(am__tar) > result.tar
+#
+# Substitute a variable $(am__untar) that extract such
+# a tarball read from stdin.
+#     $(am__untar) < result.tar
+AC_DEFUN([_AM_PROG_TAR],
+[# Always define AMTAR for backward compatibility.
+AM_MISSING_PROG([AMTAR], [tar])
+m4_if([$1], [v7],
+     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
+     [m4_case([$1], [ustar],, [pax],,
+              [m4_fatal([Unknown tar format])])
+AC_MSG_CHECKING([how to create a $1 tar archive])
+# Loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
+_am_tools=${am_cv_prog_tar_$1-$_am_tools}
+# Do not fold the above two line into one, because Tru64 sh and
+# Solaris sh will not grok spaces in the rhs of `-'.
+for _am_tool in $_am_tools
+do
+  case $_am_tool in
+  gnutar)
+    for _am_tar in tar gnutar gtar;
+    do
+      AM_RUN_LOG([$_am_tar --version]) && break
+    done
+    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+    am__untar="$_am_tar -xf -"
+    ;;
+  plaintar)
+    # Must skip GNU tar: if it does not support --format= it doesn't create
+    # ustar tarball either.
+    (tar --version) >/dev/null 2>&1 && continue
+    am__tar='tar chf - "$$tardir"'
+    am__tar_='tar chf - "$tardir"'
+    am__untar='tar xf -'
+    ;;
+  pax)
+    am__tar='pax -L -x $1 -w "$$tardir"'
+    am__tar_='pax -L -x $1 -w "$tardir"'
+    am__untar='pax -r'
+    ;;
+  cpio)
+    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+    am__untar='cpio -i -H $1 -d'
+    ;;
+  none)
+    am__tar=false
+    am__tar_=false
+    am__untar=false
+    ;;
+  esac
+
+  # If the value was cached, stop now.  We just wanted to have am__tar
+  # and am__untar set.
+  test -n "${am_cv_prog_tar_$1}" && break
+
+  # tar/untar a dummy directory, and stop if the command works
+  rm -rf conftest.dir
+  mkdir conftest.dir
+  echo GrepMe > conftest.dir/file
+  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+  rm -rf conftest.dir
+  if test -s conftest.tar; then
+    AM_RUN_LOG([$am__untar <conftest.tar])
+    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+  fi
+done
+rm -rf conftest.dir
+
+AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+AC_SUBST([am__tar])
+AC_SUBST([am__untar])
+]) # _AM_PROG_TAR
+
diff --git a/configure b/configure
new file mode 100755
index 0000000..1129238
--- /dev/null
+++ b/configure
@@ -0,0 +1,6439 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.63 for sap 1.1.3.
+#
+# Report bugs to <jkleinj at gmail.com>.
+#
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008 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 more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+
+
+# PATH needs CR
+# 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
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in
+      *"$as_nl"*)
+	expr "X$arg" : "X\\(.*\\)$as_nl";
+	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""	$as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+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
+IFS=$as_save_IFS
+
+     ;;
+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
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; 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 ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+if test "x$CONFIG_SHELL" = x; then
+  if (eval ":") 2>/dev/null; then
+  as_have_required=yes
+else
+  as_have_required=no
+fi
+
+  if test $as_have_required = yes &&	 (eval ":
+(as_func_return () {
+  (exit \$1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0) || { (exit 1); exit 1; }
+
+(
+  as_lineno_1=\$LINENO
+  as_lineno_2=\$LINENO
+  test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
+  test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
+") 2> /dev/null; then
+  :
+else
+  as_candidate_shells=
+    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=.
+  case $as_dir in
+	 /*)
+	   for as_base in sh bash ksh sh5; do
+	     as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
+	   done;;
+       esac
+done
+IFS=$as_save_IFS
+
+
+      for as_shell in $as_candidate_shells $SHELL; do
+	 # Try only shells that exist, to save several forks.
+	 if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+		{ ("$as_shell") 2> /dev/null <<\_ASEOF
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+:
+_ASEOF
+}; then
+  CONFIG_SHELL=$as_shell
+	       as_have_required=yes
+	       if { "$as_shell" 2> /dev/null <<\_ASEOF
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+:
+(as_func_return () {
+  (exit $1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = "$1" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test $exitcode = 0) || { (exit 1); exit 1; }
+
+(
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
+
+_ASEOF
+}; then
+  break
+fi
+
+fi
+
+      done
+
+      if test "x$CONFIG_SHELL" != x; then
+  for as_var in BASH_ENV ENV
+	do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+	done
+	export CONFIG_SHELL
+	exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+fi
+
+
+    if test $as_have_required = no; then
+  echo This script requires a shell more modern than all the
+      echo shells that I found on your system.  Please install a
+      echo modern shell, or manually run the script under such a
+      echo shell if you do have one.
+      { (exit 1); exit 1; }
+fi
+
+
+fi
+
+fi
+
+
+
+(eval "as_func_return () {
+  (exit \$1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0") || {
+  echo No shell found that supports shell functions.
+  echo Please tell bug-autoconf at gnu.org about your system,
+  echo including any error possibly output before this message.
+  echo This can help us improve future autoconf versions.
+  echo Configuration will now proceed without shell functions.
+}
+
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+  # 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 after each line using $LINENO; the second 'sed'
+  # does the real work.  The second script uses 'N' to pair each
+  # line-number line with the line containing $LINENO, 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
+  # scripts with optimization help from Paolo Bonzini.  Blame Lee
+  # E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { $as_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 sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+  case `echo 'x\c'` in
+  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
+  *)   ECHO_C='\c';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -p'
+  fi
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+	test -d "$1/.";
+      else
+	case $1 in
+	-*)set "./$1";;
+	esac;
+	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+	???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# 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'"
+
+
+
+exec 7<&0 </dev/null 6>&1
+
+# 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`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Identity of this package.
+PACKAGE_NAME='sap'
+PACKAGE_TARNAME='sap'
+PACKAGE_VERSION='1.1.3'
+PACKAGE_STRING='sap 1.1.3'
+PACKAGE_BUGREPORT='jkleinj at gmail.com'
+
+ac_unique_file="src/sap.c"
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+#  include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+#  include <memory.h>
+# endif
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_subst_vars='LTLIBOBJS
+LIBOBJS
+EGREP
+GREP
+CPP
+LN_S
+am__fastdepCC_FALSE
+am__fastdepCC_TRUE
+CCDEPMODE
+AMDEPBACKSLASH
+AMDEP_FALSE
+AMDEP_TRUE
+am__quote
+am__include
+DEPDIR
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+INTI_LIBS
+INTI_CFLAGS
+am__untar
+am__tar
+AMTAR
+am__leading_dot
+SET_MAKE
+AWK
+mkdir_p
+MKDIR_P
+INSTALL_STRIP_PROGRAM
+STRIP
+install_sh
+MAKEINFO
+AUTOHEADER
+AUTOMAKE
+AUTOCONF
+ACLOCAL
+VERSION
+PACKAGE
+CYGPATH_W
+am__isrc
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
+ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+enable_dependency_tracking
+'
+      ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CPP'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# 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.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+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
+
+  case $ac_option in
+  *=*)	ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *)	ac_optarg=yes ;;
+  esac
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case $ac_dashdash$ac_option in
+  --)
+    ac_dashdash=yes ;;
+
+  -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)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=*)
+    datadir=$ac_optarg ;;
+
+  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+  | --dataroo | --dataro | --datar)
+    ac_prev=datarootdir ;;
+  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+    datarootdir=$ac_optarg ;;
+
+  -disable-* | --disable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
+   { (exit 1); exit 1; }; }
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=no ;;
+
+  -docdir | --docdir | --docdi | --doc | --do)
+    ac_prev=docdir ;;
+  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+    docdir=$ac_optarg ;;
+
+  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+    ac_prev=dvidir ;;
+  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+    dvidir=$ac_optarg ;;
+
+  -enable-* | --enable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
+   { (exit 1); exit 1; }; }
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=\$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 ;;
+
+  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+    ac_prev=htmldir ;;
+  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+  | --ht=*)
+    htmldir=$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 ;;
+
+  -localedir | --localedir | --localedi | --localed | --locale)
+    ac_prev=localedir ;;
+  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+    localedir=$ac_optarg ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst | --locals)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+    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 ;;
+
+  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+    ac_prev=pdfdir ;;
+  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+    pdfdir=$ac_optarg ;;
+
+  -psdir | --psdir | --psdi | --psd | --ps)
+    ac_prev=psdir ;;
+  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+    psdir=$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_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
+   { (exit 1); exit 1; }; }
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=\$ac_optarg ;;
+
+  -without-* | --without-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
+   { (exit 1); exit 1; }; }
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=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 ;;
+
+  -*) { $as_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 &&
+      { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+   { (exit 1); exit 1; }; }
+    eval $ac_envvar=\$ac_optarg
+    export $ac_envvar ;;
+
+  *)
+    # FIXME: should be removed in autoconf 3.0.
+    $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      $as_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'`
+  { $as_echo "$as_me: error: missing argument to $ac_option" >&2
+   { (exit 1); exit 1; }; }
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+  case $enable_option_checking in
+    no) ;;
+    fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2
+   { (exit 1); exit 1; }; } ;;
+    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+  esac
+fi
+
+# Check all directory arguments for consistency.
+for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
+		datadir sysconfdir sharedstatedir localstatedir includedir \
+		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+		libdir localedir mandir
+do
+  eval ac_val=\$$ac_var
+  # Remove trailing slashes.
+  case $ac_val in
+    */ )
+      ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+      eval $ac_var=\$ac_val;;
+  esac
+  # Be sure to have absolute directory names.
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* )  continue;;
+    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+  esac
+  { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; }
+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
+    $as_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
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+  { $as_echo "$as_me: error: working directory cannot be determined" >&2
+   { (exit 1); exit 1; }; }
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+  { $as_echo "$as_me: error: pwd does not report name of working directory" >&2
+   { (exit 1); exit 1; }; }
+
+
+# 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 the parent directory.
+  ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_myself" : 'X\(//\)[^/]' \| \
+	 X"$as_myself" : 'X\(//\)$' \| \
+	 X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+    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
+  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+  { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+   { (exit 1); exit 1; }; }
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+	cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2
+   { (exit 1); exit 1; }; }
+	pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+  srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+  eval ac_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_env_${ac_var}_value=\$${ac_var}
+  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# 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 sap 1.1.3 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 \`..']
+
+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]
+  --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]
+  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
+  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
+  --infodir=DIR           info documentation [DATAROOTDIR/info]
+  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
+  --mandir=DIR            man documentation [DATAROOTDIR/man]
+  --docdir=DIR            documentation root [DATAROOTDIR/doc/sap]
+  --htmldir=DIR           html documentation [DOCDIR]
+  --dvidir=DIR            dvi documentation [DOCDIR]
+  --pdfdir=DIR            pdf documentation [DOCDIR]
+  --psdir=DIR             ps documentation [DOCDIR]
+_ACEOF
+
+  cat <<\_ACEOF
+
+Program names:
+  --program-prefix=PREFIX            prepend PREFIX to installed program names
+  --program-suffix=SUFFIX            append SUFFIX to installed program names
+  --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+  case $ac_init_help in
+     short | recursive ) echo "Configuration of sap 1.1.3:";;
+   esac
+  cat <<\_ACEOF
+
+Optional Features:
+  --disable-option-checking  ignore unrecognized --enable/--with options
+  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
+  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+  --disable-dependency-tracking  speeds up one-time build
+  --enable-dependency-tracking   do not reject slow dependency extractors
+
+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>
+  LIBS        libraries to pass to the linker, e.g. -l<library>
+  CPPFLAGS    C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
+              you have headers in a nonstandard directory <include dir>
+  CPP         C preprocessor
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+Report bugs to <jkleinj at gmail.com>.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d "$ac_dir" ||
+      { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+      continue
+    ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+    cd "$ac_dir" || { ac_status=$?; continue; }
+    # Check for guested 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
+    else
+      $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi || ac_status=$?
+    cd "$ac_pwd" || { ac_status=$?; break; }
+  done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+  cat <<\_ACEOF
+sap configure 1.1.3
+generated by GNU Autoconf 2.63
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 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
+fi
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by sap $as_me 1.1.3, which was
+generated by GNU Autoconf 2.63.  Invocation command line was
+
+  $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+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`
+/usr/bin/hostinfo      = `(/usr/bin/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=.
+  $as_echo "PATH: $as_dir"
+done
+IFS=$as_save_IFS
+
+} >&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_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=`$as_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_arg'"
+      ;;
+    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: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+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,
+(
+  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) $as_unset $ac_var ;;
+      esac ;;
+    esac
+  done
+  (set) 2>&1 |
+    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      sed -n \
+	"s/'\''/'\''\\\\'\'''\''/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+      ;; #(
+    *)
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+)
+    echo
+
+    cat <<\_ASBOX
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+_ASBOX
+    echo
+    for ac_var in $ac_subst_vars
+    do
+      eval ac_val=\$$ac_var
+      case $ac_val in
+      *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+      esac
+      $as_echo "$ac_var='\''$ac_val'\''"
+    done | sort
+    echo
+
+    if test -n "$ac_subst_files"; then
+      cat <<\_ASBOX
+## ------------------- ##
+## File substitutions. ##
+## ------------------- ##
+_ASBOX
+      echo
+      for ac_var in $ac_subst_files
+      do
+	eval ac_val=\$$ac_var
+	case $ac_val in
+	*\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+	esac
+	$as_echo "$ac_var='\''$ac_val'\''"
+      done | sort
+      echo
+    fi
+
+    if test -s confdefs.h; then
+      cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+      echo
+      cat confdefs.h
+      echo
+    fi
+    test "$ac_signal" != 0 &&
+      $as_echo "$as_me: caught signal $ac_signal"
+    $as_echo "$as_me: exit $exit_status"
+  } >&5
+  rm -f core *.core core.conftest.* &&
+    rm -f -r 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 -f -r conftest* 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 an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+  ac_site_file1=$CONFIG_SITE
+elif test "x$prefix" != xNONE; then
+  ac_site_file1=$prefix/share/config.site
+  ac_site_file2=$prefix/etc/config.site
+else
+  ac_site_file1=$ac_default_prefix/share/config.site
+  ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+  test "x$ac_site_file" = xNONE && continue
+  if test -r "$ac_site_file"; then
+    { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+$as_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
+    { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+    case $cache_file in
+      [\\/]* | ?:[\\/]* ) . "$cache_file";;
+      *)                      . "./$cache_file";;
+    esac
+  fi
+else
+  { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5
+$as_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 $ac_precious_vars; 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,)
+      { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,set)
+      { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+$as_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
+	# differences in whitespace do not lead to failure.
+	ac_old_val_w=`echo x $ac_old_val`
+	ac_new_val_w=`echo x $ac_new_val`
+	if test "$ac_old_val_w" != "$ac_new_val_w"; then
+	  { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+	  ac_cache_corrupted=:
+	else
+	  { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+	  eval $ac_var=\$ac_old_val
+	fi
+	{ $as_echo "$as_me:$LINENO:   former value:  \`$ac_old_val'" >&5
+$as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
+	{ $as_echo "$as_me:$LINENO:   current value: \`$ac_new_val'" >&5
+$as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
+      fi;;
+  esac
+  # Pass precious variables to config.status.
+  if test "$ac_new_set" = set; then
+    case $ac_new_val in
+    *\'*) ac_arg=$ac_var=`$as_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
+  { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+  { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+  { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+$as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+
+ac_config_headers="$ac_config_headers src/config.h"
+
+
+am__api_version='1.10'
+
+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
+  { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5
+$as_echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
+
+
+# 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.
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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
+	    rm -rf conftest.one conftest.two conftest.dir
+	    echo one > conftest.one
+	    echo two > conftest.two
+	    mkdir conftest.dir
+	    if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+	      test -s conftest.one && test -s conftest.two &&
+	      test -s conftest.dir/conftest.one &&
+	      test -s conftest.dir/conftest.two
+	    then
+	      ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+	      break 3
+	    fi
+	  fi
+	fi
+      done
+    done
+    ;;
+esac
+
+done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
+
+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.  Don't cache a
+    # value for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    INSTALL=$ac_install_sh
+  fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5
+$as_echo "$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'
+
+{ $as_echo "$as_me:$LINENO: checking whether build environment is sane" >&5
+$as_echo_n "checking whether build environment is sane... " >&6; }
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments.  Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+   if test "$*" = "X"; then
+      # -L didn't work.
+      set X `ls -t $srcdir/configure conftest.file`
+   fi
+   rm -f conftest.file
+   if test "$*" != "X $srcdir/configure conftest.file" \
+      && test "$*" != "X conftest.file $srcdir/configure"; then
+
+      # If neither matched, then we have a broken ls.  This can happen
+      # if, for instance, CONFIG_SHELL is bash and it inherits a
+      # broken ls alias from the environment.  This has actually
+      # happened.  Such a system could not be considered "sane".
+      { { $as_echo "$as_me:$LINENO: error: ls -t appears to fail.  Make sure there is not a broken
+alias in your environment" >&5
+$as_echo "$as_me: error: ls -t appears to fail.  Make sure there is not a broken
+alias in your environment" >&2;}
+   { (exit 1); exit 1; }; }
+   fi
+
+   test "$2" = conftest.file
+   )
+then
+   # Ok.
+   :
+else
+   { { $as_echo "$as_me:$LINENO: error: newly created file is older than distributed files!
+Check your system clock" >&5
+$as_echo "$as_me: error: newly created file is older than distributed files!
+Check your system clock" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+test "$program_prefix" != NONE &&
+  program_transform_name="s&^&$program_prefix&;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+  program_transform_name="s&\$&$program_suffix&;$program_transform_name"
+# Double any \ or $.
+# By default was `s,x,x', remove it if useless.
+ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
+program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+  am_missing_run="$MISSING --run "
+else
+  am_missing_run=
+  { $as_echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
+
+{ $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+if test -z "$MKDIR_P"; then
+  if test "${ac_cv_path_mkdir+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in mkdir gmkdir; do
+	 for ac_exec_ext in '' $ac_executable_extensions; do
+	   { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
+	   case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
+	     'mkdir (GNU coreutils) '* | \
+	     'mkdir (coreutils) '* | \
+	     'mkdir (fileutils) '4.1*)
+	       ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+	       break 3;;
+	   esac
+	 done
+       done
+done
+IFS=$as_save_IFS
+
+fi
+
+  if test "${ac_cv_path_mkdir+set}" = set; then
+    MKDIR_P="$ac_cv_path_mkdir -p"
+  else
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for MKDIR_P within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    test -d ./--version && rmdir ./--version
+    MKDIR_P="$ac_install_sh -d"
+  fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $MKDIR_P" >&5
+$as_echo "$MKDIR_P" >&6; }
+
+mkdir_p="$MKDIR_P"
+case $mkdir_p in
+  [\\/$]* | ?:[\\/]*) ;;
+  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+
+for ac_prog in gawk mawk nawk awk
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_AWK+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$AWK"; then
+  ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_AWK="$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+  { $as_echo "$as_me:$LINENO: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$AWK" && break
+done
+
+{ $as_echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+	@echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+  *@@@%%%=?*=@@@%%%*)
+    eval ac_cv_prog_make_${ac_make}_set=yes;;
+  *)
+    eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+  SET_MAKE=
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+  SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+  am__leading_dot=.
+else
+  am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  am__isrc=' -I$(srcdir)'
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    { { $as_echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
+$as_echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+  if (cygpath --version) >/dev/null 2>/dev/null; then
+    CYGPATH_W='cygpath -w'
+  else
+    CYGPATH_W=echo
+  fi
+fi
+
+
+# Define the identity of the package.
+ PACKAGE='sap'
+ VERSION='1.1.3'
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE "$PACKAGE"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define VERSION "$VERSION"
+_ACEOF
+
+# Some tools Automake needs.
+
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
+
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+
+
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+
+
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
+
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
+
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'.  However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_STRIP+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  { $as_echo "$as_me:$LINENO: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+  ac_ct_STRIP=$STRIP
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_STRIP"; then
+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+
+# We need awk for the "check" target.  The system "awk" is bad on
+# some platforms.
+# Always define AMTAR for backward compatibility.
+
+AMTAR=${AMTAR-"${am_missing_run}tar"}
+
+am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
+
+
+
+
+
+
+
+
+
+# Checks for programs.
+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
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "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
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="gcc"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+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
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}cc"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  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
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+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
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl.exe
+  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
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl.exe
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+  $as_echo_n "(cached) " >&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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CC" && break
+done
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+$as_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.
+$as_echo "$as_me:$LINENO: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler --version >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler -v >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler -V >&5") 2>&5
+  ac_status=$?
+  $as_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.out.dSYM 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.
+{ $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+  esac
+done
+rm -f $ac_rmfiles
+
+if { (ac_try="$ac_link_default"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link_default") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile.  We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+	;;
+    [ab].out )
+	# We found the default executable, but exeext='' is most
+	# certainly right.
+	break;;
+    *.* )
+        if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+	then :; else
+	   ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	fi
+	# We set ac_cv_exeext here because the later test for it is not
+	# safe: cross compilers may not add the suffix if given an `-o'
+	# argument, so we may need to know it at that point already.
+	# Even if this section looks crufty: it has the advantage of
+	# actually working.
+	break;;
+    * )
+	break;;
+  esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+  ac_file=''
+fi
+
+{ $as_echo "$as_me:$LINENO: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+if test -z "$ac_file"; then
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables
+See \`config.log' for more details." >&5
+$as_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
+
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&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'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_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
+	{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_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
+$as_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
+{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+{ $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+{ $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_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 | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	  break;;
+    * ) break;;
+  esac
+done
+else
+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&5
+$as_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
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+{ $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if test "${ac_cv_objext+set}" = set; then
+  $as_echo_n "(cached) " >&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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  for ac_file in conftest.o conftest.obj conftest.*; do
+  test -f "$ac_file" || continue;
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+       break;;
+  esac
+done
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&5
+$as_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
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+  $as_echo_n "(cached) " >&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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_compiler_gnu=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_compiler_gnu=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GCC=yes
+else
+  GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if test "${ac_cv_prog_cc_g+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_g=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	CFLAGS=""
+      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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_c_werror_flag=$ac_save_c_werror_flag
+	 CFLAGS="-g"
+	 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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_g=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$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
+{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if test "${ac_cv_prog_cc_c89+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c89=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 -std 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 -std.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 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
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+	-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_c89=$ac_arg
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { $as_echo "$as_me:$LINENO: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:$LINENO: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c89"
+    { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+DEPDIR="${am__leading_dot}deps"
+
+ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+	@echo done
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+{ $as_echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
+$as_echo_n "checking for style of include used by $am_make... " >&6; }
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
+   am__include=include
+   am__quote=
+   _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+      am__include=.include
+      am__quote="\""
+      _am_result=BSD
+   fi
+fi
+
+
+{ $as_echo "$as_me:$LINENO: result: $_am_result" >&5
+$as_echo "$_am_result" >&6; }
+rm -f confinc confmf
+
+# Check whether --enable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then
+  enableval=$enable_dependency_tracking;
+fi
+
+if test "x$enable_dependency_tracking" != xno; then
+  am_depcomp="$ac_aux_dir/depcomp"
+  AMDEPBACKSLASH='\'
+fi
+ if test "x$enable_dependency_tracking" != xno; then
+  AMDEP_TRUE=
+  AMDEP_FALSE='#'
+else
+  AMDEP_TRUE='#'
+  AMDEP_FALSE=
+fi
+
+
+
+depcc="$CC"   am_compiler_list=
+
+{ $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_CC_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+  fi
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    case $depmode in
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+	continue
+      else
+	break
+      fi
+      ;;
+    none) break ;;
+    esac
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.
+    if depmode=$depmode \
+       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_CC_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+ if
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+  am__fastdepCC_TRUE=
+  am__fastdepCC_FALSE='#'
+else
+  am__fastdepCC_TRUE='#'
+  am__fastdepCC_FALSE=
+fi
+
+
+{ $as_echo "$as_me:$LINENO: checking whether ln -s works" >&5
+$as_echo_n "checking whether ln -s works... " >&6; }
+LN_S=$as_ln_s
+if test "$LN_S" = "ln -s"; then
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no, using $LN_S" >&5
+$as_echo "no, using $LN_S" >&6; }
+fi
+
+
+# Checks for libraries.
+
+
+{ $as_echo "$as_me:$LINENO: checking for cos in -lm" >&5
+$as_echo_n "checking for cos in -lm... " >&6; }
+if test "${ac_cv_lib_m_cos+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $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 GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char cos ();
+int
+main ()
+{
+return cos ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_m_cos=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_m_cos=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_m_cos" >&5
+$as_echo "$ac_cv_lib_m_cos" >&6; }
+if test "x$ac_cv_lib_m_cos" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBM 1
+_ACEOF
+
+  LIBS="-lm $LIBS"
+
+fi
+
+
+# Checks for header files.
+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
+{ $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&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
+  $as_echo_n "(cached) " >&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 { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&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
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  :
+else
+  $as_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 nonexistent 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 { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&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
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  # Broken: success on invalid input.
+continue
+else
+  $as_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
+{ $as_echo "$as_me:$LINENO: result: $CPP" >&5
+$as_echo "$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 { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&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
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  :
+else
+  $as_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 nonexistent 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 { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&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
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  # Broken: success on invalid input.
+continue
+else
+  $as_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
+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&5
+$as_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
+
+
+{ $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if test "${ac_cv_path_GREP+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$GREP"; then
+  ac_path_GREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in grep ggrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+  # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'GREP' >> "conftest.nl"
+    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    ac_count=`expr $ac_count + 1`
+    if test $ac_count -gt ${ac_path_GREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_GREP="$ac_path_GREP"
+      ac_path_GREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_GREP_found && break 3
+    done
+  done
+done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_GREP"; then
+    { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+$as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+else
+  ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ $as_echo "$as_me:$LINENO: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if test "${ac_cv_path_EGREP+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+   then ac_cv_path_EGREP="$GREP -E"
+   else
+     if test -z "$EGREP"; then
+  ac_path_EGREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in egrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+  # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'EGREP' >> "conftest.nl"
+    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    ac_count=`expr $ac_count + 1`
+    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_EGREP="$ac_path_EGREP"
+      ac_path_EGREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_EGREP_found && break 3
+    done
+  done
+done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_EGREP"; then
+    { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+$as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+else
+  ac_cv_path_EGREP=$EGREP
+fi
+
+   fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if test "${ac_cv_header_stdc+set}" = set; then
+  $as_echo_n "(cached) " >&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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_header_stdc=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_header_stdc=no
+fi
+
+rm -f core 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>
+#include <stdlib.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))
+      return 2;
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_header_stdc=no
+fi
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+$as_echo "$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=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&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 { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  eval "$as_ac_Header=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	eval "$as_ac_Header=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+
+
+for ac_header in float.h stdlib.h string.h
+do
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&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
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    ( cat <<\_ASBOX
+## -------------------------------- ##
+## Report this to jkleinj at gmail.com ##
+## -------------------------------- ##
+_ASBOX
+     ) | sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+
+fi
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+# Checks for typedefs, structures, and compiler characteristics.
+{ $as_echo "$as_me:$LINENO: checking for size_t" >&5
+$as_echo_n "checking for size_t... " >&6; }
+if test "${ac_cv_type_size_t+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_type_size_t=no
+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 (sizeof (size_t))
+       return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  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 (sizeof ((size_t)))
+	  return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_type_size_t=yes
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
+$as_echo "$ac_cv_type_size_t" >&6; }
+if test "x$ac_cv_type_size_t" = x""yes; then
+  :
+else
+
+cat >>confdefs.h <<_ACEOF
+#define size_t unsigned int
+_ACEOF
+
+fi
+
+
+# Checks for library functions.
+
+for ac_header in stdlib.h
+do
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&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
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    ( cat <<\_ASBOX
+## -------------------------------- ##
+## Report this to jkleinj at gmail.com ##
+## -------------------------------- ##
+_ASBOX
+     ) | sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+
+fi
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+{ $as_echo "$as_me:$LINENO: checking for GNU libc compatible malloc" >&5
+$as_echo_n "checking for GNU libc compatible malloc... " >&6; }
+if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test "$cross_compiling" = yes; then
+  ac_cv_func_malloc_0_nonnull=no
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#if defined STDC_HEADERS || defined HAVE_STDLIB_H
+# include <stdlib.h>
+#else
+char *malloc ();
+#endif
+
+int
+main ()
+{
+return ! malloc (0);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_malloc_0_nonnull=yes
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_func_malloc_0_nonnull=no
+fi
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_malloc_0_nonnull" >&5
+$as_echo "$ac_cv_func_malloc_0_nonnull" >&6; }
+if test $ac_cv_func_malloc_0_nonnull = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_MALLOC 1
+_ACEOF
+
+else
+  cat >>confdefs.h <<\_ACEOF
+#define HAVE_MALLOC 0
+_ACEOF
+
+   case " $LIBOBJS " in
+  *" malloc.$ac_objext "* ) ;;
+  *) LIBOBJS="$LIBOBJS malloc.$ac_objext"
+ ;;
+esac
+
+
+cat >>confdefs.h <<\_ACEOF
+#define malloc rpl_malloc
+_ACEOF
+
+fi
+
+
+
+
+for ac_header in stdlib.h
+do
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&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
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    ( cat <<\_ASBOX
+## -------------------------------- ##
+## Report this to jkleinj at gmail.com ##
+## -------------------------------- ##
+_ASBOX
+     ) | sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+
+fi
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+{ $as_echo "$as_me:$LINENO: checking for GNU libc compatible realloc" >&5
+$as_echo_n "checking for GNU libc compatible realloc... " >&6; }
+if test "${ac_cv_func_realloc_0_nonnull+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test "$cross_compiling" = yes; then
+  ac_cv_func_realloc_0_nonnull=no
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#if defined STDC_HEADERS || defined HAVE_STDLIB_H
+# include <stdlib.h>
+#else
+char *realloc ();
+#endif
+
+int
+main ()
+{
+return ! realloc (0, 0);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_realloc_0_nonnull=yes
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_func_realloc_0_nonnull=no
+fi
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_realloc_0_nonnull" >&5
+$as_echo "$ac_cv_func_realloc_0_nonnull" >&6; }
+if test $ac_cv_func_realloc_0_nonnull = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_REALLOC 1
+_ACEOF
+
+else
+  cat >>confdefs.h <<\_ACEOF
+#define HAVE_REALLOC 0
+_ACEOF
+
+   case " $LIBOBJS " in
+  *" realloc.$ac_objext "* ) ;;
+  *) LIBOBJS="$LIBOBJS realloc.$ac_objext"
+ ;;
+esac
+
+
+cat >>confdefs.h <<\_ACEOF
+#define realloc rpl_realloc
+_ACEOF
+
+fi
+
+
+
+
+
+for ac_func in pow sqrt
+do
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  eval "$as_ac_var=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	eval "$as_ac_var=no"
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+ac_config_files="$ac_config_files Makefile src/Makefile tests/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, we kill variables containing newlines.
+# 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.
+(
+  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) $as_unset $ac_var ;;
+      esac ;;
+    esac
+  done
+
+  (set) 2>&1 |
+    case $as_nl`(ac_space=' '; set) 2>&1` in #(
+    *${as_nl}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 "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+) |
+  sed '
+     /^ac_cv_env_/b end
+     t clear
+     :clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     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" &&
+      { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+    cat confcache >$cache_file
+  else
+    { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+  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}'
+
+DEFS=-DHAVE_CONFIG_H
+
+ac_libobjs=
+ac_ltlibobjs=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+  # 1. Remove the extension, and $U if already installed.
+  ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+  ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
+  #    will be set to the directory where LIBOBJS objects are built.
+  ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+  ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+  { { $as_echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+  { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+: ${CONFIG_STATUS=./config.status}
+ac_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#! $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 || ac_write_fail=1
+## --------------------- ##
+## M4sh Initialization.  ##
+## --------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+
+
+# PATH needs CR
+# 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
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in
+      *"$as_nl"*)
+	expr "X$arg" : "X\\(.*\\)$as_nl";
+	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""	$as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+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
+IFS=$as_save_IFS
+
+     ;;
+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
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; 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 ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+  # 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 after each line using $LINENO; the second 'sed'
+  # does the real work.  The second script uses 'N' to pair each
+  # line-number line with the line containing $LINENO, 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
+  # scripts with optimization help from Paolo Bonzini.  Blame Lee
+  # E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { $as_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 sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+  case `echo 'x\c'` in
+  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
+  *)   ECHO_C='\c';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -p'
+  fi
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+	test -d "$1/.";
+      else
+	case $1 in
+	-*)set "./$1";;
+	esac;
+	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+	???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# 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'"
+
+
+exec 6>&1
+
+# Save the log message, to keep $[0] and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by sap $as_me 1.1.3, which was
+generated by GNU Autoconf 2.63.  Invocation command line was
+
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+case $ac_config_headers in *"
+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
+esac
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files from templates according to the
+current configuration.
+
+Usage: $0 [OPTION]... [FILE]...
+
+  -h, --help       print this help, then exit
+  -V, --version    print version number and configuration settings, then exit
+  -q, --quiet, --silent
+                   do not print progress messages
+  -d, --debug      don't remove temporary files
+      --recheck    update $as_me by reconfiguring in the same conditions
+      --file=FILE[:TEMPLATE]
+                   instantiate the configuration file FILE
+      --header=FILE[:TEMPLATE]
+                   instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to <bug-autoconf at gnu.org>."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_version="\\
+sap config.status 1.1.3
+configured by $0, generated by GNU Autoconf 2.63,
+  with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright (C) 2008 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
+AWK='$AWK'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+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
+    ;;
+  esac
+
+  case $ac_option in
+  # Handling of the options.
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    ac_cs_recheck=: ;;
+  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+    $as_echo "$ac_cs_version"; exit ;;
+  --debug | --debu | --deb | --de | --d | -d )
+    debug=: ;;
+  --file | --fil | --fi | --f )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    CONFIG_FILES="$CONFIG_FILES '$ac_optarg'"
+    ac_need_defaults=false;;
+  --header | --heade | --head | --hea )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    CONFIG_HEADERS="$CONFIG_HEADERS '$ac_optarg'"
+    ac_need_defaults=false;;
+  --he | --h)
+    # Conflict between --help and --header
+    { $as_echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; };;
+  --help | --hel | -h )
+    $as_echo "$ac_cs_usage"; exit ;;
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil | --si | --s)
+    ac_cs_silent=: ;;
+
+  # This is an error.
+  -*) { $as_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"
+     ac_need_defaults=false ;;
+
+  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 || ac_write_fail=1
+if \$ac_cs_recheck; then
+  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  shift
+  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+  CONFIG_SHELL='$SHELL'
+  export CONFIG_SHELL
+  exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+  $as_echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#
+# INIT-COMMANDS
+#
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+  case $ac_config_target in
+    "src/config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/config.h" ;;
+    "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+    "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
+    "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;;
+
+  *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+$as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+   { (exit 1); exit 1; }; };;
+  esac
+done
+
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used.  Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+  test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience.  Make it in the build tree
+# simply because there is no reason against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+  tmp=
+  trap 'exit_status=$?
+  { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$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 "./confXXXXXX") 2>/dev/null` &&
+  test -n "$tmp" && test -d "$tmp"
+}  ||
+{
+  tmp=./conf$$-$RANDOM
+  (umask 077 && mkdir "$tmp")
+} ||
+{
+   $as_echo "$as_me: cannot create a temporary directory in ." >&2
+   { (exit 1); exit 1; }
+}
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr='
'
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+  ac_cs_awk_cr='\\r'
+else
+  ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$tmp/subs1.awk" &&
+_ACEOF
+
+
+{
+  echo "cat >conf$$subs.awk <<_ACEOF" &&
+  echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+  echo "_ACEOF"
+} >conf$$subs.sh ||
+  { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  . ./conf$$subs.sh ||
+    { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+
+  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+  if test $ac_delim_n = $ac_delim_num; then
+    break
+  elif $ac_last_try; then
+    { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\).*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\).*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+  N
+  s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$tmp/subs1.awk" <<_ACAWK &&
+  for (key in S) S_is_set[key] = 1
+  FS = ""
+
+}
+{
+  line = $ 0
+  nfields = split(line, field, "@")
+  substed = 0
+  len = length(field[1])
+  for (i = 2; i < nfields; i++) {
+    key = field[i]
+    keylen = length(key)
+    if (S_is_set[key]) {
+      value = S[key]
+      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+      len += length(value) + length(field[++i])
+      substed = 1
+    } else
+      len += 1 + keylen
+  }
+
+  print line
+}
+
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+  cat
+fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
+  || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5
+$as_echo "$as_me: error: could not setup config files machinery" >&2;}
+   { (exit 1); exit 1; }; }
+_ACEOF
+
+# 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
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+# Set up the scripts for CONFIG_HEADERS section.
+# No need to generate them if there are no CONFIG_HEADERS.
+# This happens for instance with `./config.status Makefile'.
+if test -n "$CONFIG_HEADERS"; then
+cat >"$tmp/defines.awk" <<\_ACAWK ||
+BEGIN {
+_ACEOF
+
+# Transform confdefs.h into an awk script `defines.awk', embedded as
+# here-document in config.status, that substitutes the proper values into
+# config.h.in to produce config.h.
+
+# Create a delimiter string that does not exist in confdefs.h, to ease
+# handling of long lines.
+ac_delim='%!_!# '
+for ac_last_try in false false :; do
+  ac_t=`sed -n "/$ac_delim/p" confdefs.h`
+  if test -z "$ac_t"; then
+    break
+  elif $ac_last_try; then
+    { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_HEADERS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_HEADERS" >&2;}
+   { (exit 1); exit 1; }; }
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+
+# For the awk script, D is an array of macro values keyed by name,
+# likewise P contains macro parameters if any.  Preserve backslash
+# newline sequences.
+
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+sed -n '
+s/.\{148\}/&'"$ac_delim"'/g
+t rset
+:rset
+s/^[	 ]*#[	 ]*define[	 ][	 ]*/ /
+t def
+d
+:def
+s/\\$//
+t bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3"/p
+s/^ \('"$ac_word_re"'\)[	 ]*\(.*\)/D["\1"]=" \2"/p
+d
+:bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3\\\\\\n"\\/p
+t cont
+s/^ \('"$ac_word_re"'\)[	 ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
+t cont
+d
+:cont
+n
+s/.\{148\}/&'"$ac_delim"'/g
+t clear
+:clear
+s/\\$//
+t bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/"/p
+d
+:bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
+b cont
+' <confdefs.h | sed '
+s/'"$ac_delim"'/"\\\
+"/g' >>$CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  for (key in D) D_is_set[key] = 1
+  FS = ""
+}
+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
+  line = \$ 0
+  split(line, arg, " ")
+  if (arg[1] == "#") {
+    defundef = arg[2]
+    mac1 = arg[3]
+  } else {
+    defundef = substr(arg[1], 2)
+    mac1 = arg[2]
+  }
+  split(mac1, mac2, "(") #)
+  macro = mac2[1]
+  prefix = substr(line, 1, index(line, defundef) - 1)
+  if (D_is_set[macro]) {
+    # Preserve the white space surrounding the "#".
+    print prefix "define", macro P[macro] D[macro]
+    next
+  } else {
+    # Replace #undef with comments.  This is necessary, for example,
+    # in the case of _POSIX_SOURCE, which is predefined and required
+    # on some systems where configure will not decide to define it.
+    if (defundef == "undef") {
+      print "/*", prefix defundef, macro, "*/"
+      next
+    }
+  }
+}
+{ print }
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+  { { $as_echo "$as_me:$LINENO: error: could not setup config headers machinery" >&5
+$as_echo "$as_me: error: could not setup config headers machinery" >&2;}
+   { (exit 1); exit 1; }; }
+fi # test -n "$CONFIG_HEADERS"
+
+
+eval set X "  :F $CONFIG_FILES  :H $CONFIG_HEADERS    :C $CONFIG_COMMANDS"
+shift
+for ac_tag
+do
+  case $ac_tag in
+  :[FHLC]) ac_mode=$ac_tag; continue;;
+  esac
+  case $ac_mode$ac_tag in
+  :[FHL]*:*);;
+  :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5
+$as_echo "$as_me: error: invalid tag $ac_tag" >&2;}
+   { (exit 1); exit 1; }; };;
+  :[FH]-) ac_tag=-:-;;
+  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+  esac
+  ac_save_IFS=$IFS
+  IFS=:
+  set x $ac_tag
+  IFS=$ac_save_IFS
+  shift
+  ac_file=$1
+  shift
+
+  case $ac_mode in
+  :L) ac_source=$1;;
+  :[FH])
+    ac_file_inputs=
+    for ac_f
+    do
+      case $ac_f in
+      -) ac_f="$tmp/stdin";;
+      *) # Look for the file first in the build tree, then in the source tree
+	 # (if the path is not absolute).  The absolute path cannot be DOS-style,
+	 # because $ac_f cannot contain `:'.
+	 test -f "$ac_f" ||
+	   case $ac_f in
+	   [\\/$]*) false;;
+	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+	   esac ||
+	   { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
+$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;}
+   { (exit 1); exit 1; }; };;
+      esac
+      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+      ac_file_inputs="$ac_file_inputs '$ac_f'"
+    done
+
+    # 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.  */
+    configure_input='Generated from '`
+	  $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+	`' by configure.'
+    if test x"$ac_file" != x-; then
+      configure_input="$ac_file.  $configure_input"
+      { $as_echo "$as_me:$LINENO: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+    fi
+    # Neutralize special characters interpreted by sed in replacement strings.
+    case $configure_input in #(
+    *\&* | *\|* | *\\* )
+       ac_sed_conf_input=`$as_echo "$configure_input" |
+       sed 's/[\\\\&|]/\\\\&/g'`;; #(
+    *) ac_sed_conf_input=$configure_input;;
+    esac
+
+    case $ac_tag in
+    *:-:* | *:-) cat >"$tmp/stdin" \
+      || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; } ;;
+    esac
+    ;;
+  esac
+
+  ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$ac_file" : 'X\(//\)[^/]' \| \
+	 X"$ac_file" : 'X\(//\)$' \| \
+	 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+  { as_dir="$ac_dir"
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+$as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
+   { (exit 1); exit 1; }; }; }
+  ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+  case $ac_mode in
+  :F)
+  #
+  # CONFIG_FILE
+  #
+
+  case $INSTALL in
+  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+  esac
+  ac_MKDIR_P=$MKDIR_P
+  case $MKDIR_P in
+  [\\/$]* | ?:[\\/]* ) ;;
+  */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
+  esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+
+ac_sed_dataroot='
+/datarootdir/ {
+  p
+  q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p
+'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+  { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  ac_datarootdir_hack='
+  s&@datadir@&$datadir&g
+  s&@docdir@&$docdir&g
+  s&@infodir@&$infodir&g
+  s&@localedir@&$localedir&g
+  s&@mandir@&$mandir&g
+    s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;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&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
+  || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; }
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+  { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&2;}
+
+  rm -f "$tmp/stdin"
+  case $ac_file in
+  -) cat "$tmp/out" && rm -f "$tmp/out";;
+  *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
+  esac \
+  || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; }
+ ;;
+  :H)
+  #
+  # CONFIG_HEADER
+  #
+  if test x"$ac_file" != x-; then
+    {
+      $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
+    } >"$tmp/config.h" \
+      || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; }
+    if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
+      { $as_echo "$as_me:$LINENO: $ac_file is unchanged" >&5
+$as_echo "$as_me: $ac_file is unchanged" >&6;}
+    else
+      rm -f "$ac_file"
+      mv "$tmp/config.h" "$ac_file" \
+	|| { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+  else
+    $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
+      || { { $as_echo "$as_me:$LINENO: error: could not create -" >&5
+$as_echo "$as_me: error: could not create -" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+# Compute "$ac_file"'s index in $config_headers.
+_am_arg="$ac_file"
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $_am_arg | $_am_arg:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
+$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$_am_arg" : 'X\(//\)[^/]' \| \
+	 X"$_am_arg" : 'X\(//\)$' \| \
+	 X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$_am_arg" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
+
+  :C)  { $as_echo "$as_me:$LINENO: executing $ac_file commands" >&5
+$as_echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+  esac
+
+
+  case $ac_file$ac_mode in
+    "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do
+  # Strip MF so we end up with the name of the file.
+  mf=`echo "$mf" | sed -e 's/:.*$//'`
+  # Check whether this is an Automake generated Makefile or not.
+  # We used to match only the files named `Makefile.in', but
+  # some people rename them; so instead we look at the file content.
+  # Grep'ing the first line is not enough: some people post-process
+  # each Makefile.in and add a new line on top of each file to say so.
+  # Grep'ing the whole file is not good either: AIX grep has a line
+  # limit of 2048, but all sed's we know have understand at least 4000.
+  if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+    dirpart=`$as_dirname -- "$mf" ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$mf" : 'X\(//\)[^/]' \| \
+	 X"$mf" : 'X\(//\)$' \| \
+	 X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$mf" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+  else
+    continue
+  fi
+  # Extract the definition of DEPDIR, am__include, and am__quote
+  # from the Makefile without running `make'.
+  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+  test -z "$DEPDIR" && continue
+  am__include=`sed -n 's/^am__include = //p' < "$mf"`
+  test -z "am__include" && continue
+  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+  # When using ansi2knr, U may be empty or an underscore; expand it
+  U=`sed -n 's/^U = //p' < "$mf"`
+  # Find all dependency output files, they are included files with
+  # $(DEPDIR) in their names.  We invoke sed twice because it is the
+  # simplest approach to changing $(DEPDIR) to its actual value in the
+  # expansion.
+  for file in `sed -n "
+    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+    # Make sure the directory exists.
+    test -f "$dirpart/$file" && continue
+    fdir=`$as_dirname -- "$file" ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$file" : 'X\(//\)[^/]' \| \
+	 X"$file" : 'X\(//\)$' \| \
+	 X"$file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+    { as_dir=$dirpart/$fdir
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+$as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
+   { (exit 1); exit 1; }; }; }
+    # echo "creating $dirpart/$file"
+    echo '# dummy' > "$dirpart/$file"
+  done
+done
+ ;;
+
+  esac
+done # for ac_tag
+
+
+{ (exit 0); exit 0; }
+_ACEOF
+chmod +x $CONFIG_STATUS
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+  { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+
+
+# 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
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+  { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..aea26e7
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,36 @@
+#                                               -*- Autoconf -*-
+# Process this file with autoconf to produce a configure script.
+AC_INIT(sap, 1.1.3, jkleinj at gmail.com)
+
+AC_PREREQ([2.63])
+AC_CONFIG_SRCDIR([src/sap.c])
+AC_CONFIG_HEADERS([src/config.h])
+
+AM_INIT_AUTOMAKE
+
+AC_SUBST(INTI_CFLAGS)
+AC_SUBST(INTI_LIBS)
+
+# Checks for programs.
+AC_PROG_CC
+AC_PROG_LN_S
+
+# Checks for libraries.
+AC_CHECK_LIB([m], [cos])
+
+# Checks for header files.
+AC_CHECK_HEADERS([float.h stdlib.h string.h])
+
+# Checks for typedefs, structures, and compiler characteristics.
+AC_TYPE_SIZE_T
+
+# Checks for library functions.
+AC_FUNC_MALLOC
+AC_FUNC_REALLOC
+AC_CHECK_FUNCS([pow sqrt])
+
+AC_CONFIG_FILES([Makefile
+                 src/Makefile
+                 tests/Makefile])
+
+AC_OUTPUT
diff --git a/debian/changelog b/debian/changelog
deleted file mode 100644
index b17cee3..0000000
--- a/debian/changelog
+++ /dev/null
@@ -1,6 +0,0 @@
-sap (1.1.3-1) UNRELEASED; urgency=low
-
-  * Initial release
-  TODO: Move packaging to Git since upstream source vanished
-
- -- Andreas Tille <tille at debian.org>  Mon, 28 May 2012 17:14:53 +0200
diff --git a/debian/compat b/debian/compat
deleted file mode 100644
index f599e28..0000000
--- a/debian/compat
+++ /dev/null
@@ -1 +0,0 @@
-10
diff --git a/debian/control b/debian/control
deleted file mode 100644
index f6e9781..0000000
--- a/debian/control
+++ /dev/null
@@ -1,35 +0,0 @@
-Source: sap
-Maintainer: Debian Med Packaging Team <debian-med-packaging at lists.alioth.debian.org>
-Uploaders: Andreas Tille <tille at debian.org>
-Section: science
-Priority: optional
-Build-Depends: debhelper (>= 10)
-Standards-Version: 3.9.8
-Vcs-Browser: https://anonscm.debian.org/viewvc/debian-med/trunk/packages/sap/trunk/
-Vcs-Svn: svn://anonscm.debian.org/debian-med/trunk/packages/sap/trunk/
-Homepage: https://web.archive.org/web/20160305092412/http://mathbio.nimr.mrc.ac.uk/wiki/Software#SAP
-
-Package: sap
-Architecture: any
-Depends: ${shlibs:Depends},
-         ${misc:Depends}
-Enhances: t-coffee
-Description: Pairwise protein structure alignment via double dynamic programming
- In contrast to DNA, proteins exhibit an apparently unlimited variety of
- structure. This is a necessary requirement of the vast array of
- differing functions that they perform in the maintainance of life,
- again, in contrast to the relatively static archival function of DNA.
- Not only do we observe a bewildering variety of form but even within a
- common structure, there is variation in the lengths and orientation
- substructures. Such variation is both a reflection on the very long time
- periods over which some structures have diverged and also a consequence
- of the fact that proteins cannot be completely rigid bodies but must
- have flexibility to accommodate the structural changes that are almost
- always necessary for them to perform their functions. These aspects make
- comparing structure and finding structural similarity over long
- divergence times very difficult. Indeed, computationally, the problem of
- recognizing similarity is one of three-dimensional pattern recognition,
- which is a notoriously difficult problem for computers to perform. In
- this chapter, guidance is provided on the use of a flexible structure
- comparison method that overcomes many of the problems of comparing
- protein structures that may exhibit only weak similarity.
diff --git a/debian/copyright b/debian/copyright
deleted file mode 100644
index 83d9ee2..0000000
--- a/debian/copyright
+++ /dev/null
@@ -1,10 +0,0 @@
-Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
-Source: http://mathbio.nimr.mrc.ac.uk/download/SAP/sap-1.1.1.tar.gz
-
-Files: *
-Copyright: © 2008-2010 Willie Taylor <wtaylor at nimr.mrc.ac.uk>
-License: GPL-v3
-
-Files: debian/*
-Copyright: © 2012 Andreas Tille <tille at debian.org>
-License: GPL-v3
diff --git a/debian/rules b/debian/rules
deleted file mode 100755
index 951fd41..0000000
--- a/debian/rules
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/usr/bin/make -f
-
-# DH_VERBOSE := 1
-
-%:
-	dh $@
-
-get-orig-source:
-	mkdir -p ../tarballs
-	uscan --verbose --force-download --destdir=../tarballs 
diff --git a/debian/source/format b/debian/source/format
deleted file mode 100644
index 163aaf8..0000000
--- a/debian/source/format
+++ /dev/null
@@ -1 +0,0 @@
-3.0 (quilt)
diff --git a/debian/upstream/metadata b/debian/upstream/metadata
deleted file mode 100644
index 98a61ea..0000000
--- a/debian/upstream/metadata
+++ /dev/null
@@ -1,20 +0,0 @@
-Reference:
- - Author: William R. Taylor
-   Title: Protein Structure Comparison Using SAP
-   Booktitle: "Protein Structure Prediction: Methods and Protocols"
-   Year: 2000
-   Volume: 143
-   Pages: 19-32
-   DOI: 10.1385/1-59259-368-2:19
-   URL: http://www.springerprotocols.com/Abstract/doi/10.1385/1-59259-368-2:19
- - Author: William R. Taylor
-   Title: Protein structure comparison using iterated double dynamic programming
-   Journal: Protein Science
-   Year: 1999
-   Volume: 8
-   Number: 3
-   Pages: 654-65
-   DOI: 10.1110/ps.8.3.654
-   PMID: 10091668
-   URL: http://onlinelibrary.wiley.com/doi/10.1110/ps.8.3.654/abstract
-   eprint: http://onlinelibrary.wiley.com/doi/10.1110/ps.8.3.654/pdf
diff --git a/debian/watch b/debian/watch
deleted file mode 100644
index b0da660..0000000
--- a/debian/watch
+++ /dev/null
@@ -1,3 +0,0 @@
-version=3
-
-http://mathbio.nimr.mrc.ac.uk/wiki/Software http://mathbio.nimr.mrc.ac.uk/download/SAP/sap-(.*)\.tgz
diff --git a/depcomp b/depcomp
new file mode 100755
index 0000000..e5f9736
--- /dev/null
+++ b/depcomp
@@ -0,0 +1,589 @@
+#! /bin/sh
+# depcomp - compile a program generating dependencies as side-effects
+
+scriptversion=2007-03-29.01
+
+# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007 Free Software
+# Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Originally written by Alexandre Oliva <oliva at dcc.unicamp.br>.
+
+case $1 in
+  '')
+     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
+     exit 1;
+     ;;
+  -h | --h*)
+    cat <<\EOF
+Usage: depcomp [--help] [--version] PROGRAM [ARGS]
+
+Run PROGRAMS ARGS to compile a file, generating dependencies
+as side-effects.
+
+Environment variables:
+  depmode     Dependency tracking mode.
+  source      Source file read by `PROGRAMS ARGS'.
+  object      Object file output by `PROGRAMS ARGS'.
+  DEPDIR      directory where to store dependencies.
+  depfile     Dependency file to output.
+  tmpdepfile  Temporary file to use when outputing dependencies.
+  libtool     Whether libtool is used (yes/no).
+
+Report bugs to <bug-automake at gnu.org>.
+EOF
+    exit $?
+    ;;
+  -v | --v*)
+    echo "depcomp $scriptversion"
+    exit $?
+    ;;
+esac
+
+if test -z "$depmode" || test -z "$source" || test -z "$object"; then
+  echo "depcomp: Variables source, object and depmode must be set" 1>&2
+  exit 1
+fi
+
+# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
+depfile=${depfile-`echo "$object" |
+  sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
+tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
+
+rm -f "$tmpdepfile"
+
+# Some modes work just like other modes, but use different flags.  We
+# parameterize here, but still list the modes in the big case below,
+# to make depend.m4 easier to write.  Note that we *cannot* use a case
+# here, because this file can only contain one case statement.
+if test "$depmode" = hp; then
+  # HP compiler uses -M and no extra arg.
+  gccflag=-M
+  depmode=gcc
+fi
+
+if test "$depmode" = dashXmstdout; then
+   # This is just like dashmstdout with a different argument.
+   dashmflag=-xM
+   depmode=dashmstdout
+fi
+
+case "$depmode" in
+gcc3)
+## gcc 3 implements dependency tracking that does exactly what
+## we want.  Yay!  Note: for some reason libtool 1.4 doesn't like
+## it if -MD -MP comes after the -MF stuff.  Hmm.
+## Unfortunately, FreeBSD c89 acceptance of flags depends upon
+## the command line argument order; so add the flags where they
+## appear in depend2.am.  Note that the slowdown incurred here
+## affects only configure: in makefiles, %FASTDEP% shortcuts this.
+  for arg
+  do
+    case $arg in
+    -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
+    *)  set fnord "$@" "$arg" ;;
+    esac
+    shift # fnord
+    shift # $arg
+  done
+  "$@"
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  mv "$tmpdepfile" "$depfile"
+  ;;
+
+gcc)
+## There are various ways to get dependency output from gcc.  Here's
+## why we pick this rather obscure method:
+## - Don't want to use -MD because we'd like the dependencies to end
+##   up in a subdir.  Having to rename by hand is ugly.
+##   (We might end up doing this anyway to support other compilers.)
+## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
+##   -MM, not -M (despite what the docs say).
+## - Using -M directly means running the compiler twice (even worse
+##   than renaming).
+  if test -z "$gccflag"; then
+    gccflag=-MD,
+  fi
+  "$@" -Wp,"$gccflag$tmpdepfile"
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
+## The second -e expression handles DOS-style file names with drive letters.
+  sed -e 's/^[^:]*: / /' \
+      -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
+## This next piece of magic avoids the `deleted header file' problem.
+## The problem is that when a header file which appears in a .P file
+## is deleted, the dependency causes make to die (because there is
+## typically no way to rebuild the header).  We avoid this by adding
+## dummy dependencies for each header file.  Too bad gcc doesn't do
+## this for us directly.
+  tr ' ' '
+' < "$tmpdepfile" |
+## Some versions of gcc put a space before the `:'.  On the theory
+## that the space means something, we add a space to the output as
+## well.
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly.  Breaking it into two sed invocations is a workaround.
+    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+hp)
+  # This case exists only to let depend.m4 do its work.  It works by
+  # looking at the text of this script.  This case will never be run,
+  # since it is checked for above.
+  exit 1
+  ;;
+
+sgi)
+  if test "$libtool" = yes; then
+    "$@" "-Wp,-MDupdate,$tmpdepfile"
+  else
+    "$@" -MDupdate "$tmpdepfile"
+  fi
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+
+  if test -f "$tmpdepfile"; then  # yes, the sourcefile depend on other files
+    echo "$object : \\" > "$depfile"
+
+    # Clip off the initial element (the dependent).  Don't try to be
+    # clever and replace this with sed code, as IRIX sed won't handle
+    # lines with more than a fixed number of characters (4096 in
+    # IRIX 6.2 sed, 8192 in IRIX 6.5).  We also remove comment lines;
+    # the IRIX cc adds comments like `#:fec' to the end of the
+    # dependency line.
+    tr ' ' '
+' < "$tmpdepfile" \
+    | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
+    tr '
+' ' ' >> $depfile
+    echo >> $depfile
+
+    # The second pass generates a dummy entry for each header file.
+    tr ' ' '
+' < "$tmpdepfile" \
+   | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
+   >> $depfile
+  else
+    # The sourcefile does not contain any dependencies, so just
+    # store a dummy comment line, to avoid errors with the Makefile
+    # "include basename.Plo" scheme.
+    echo "#dummy" > "$depfile"
+  fi
+  rm -f "$tmpdepfile"
+  ;;
+
+aix)
+  # The C for AIX Compiler uses -M and outputs the dependencies
+  # in a .u file.  In older versions, this file always lives in the
+  # current directory.  Also, the AIX compiler puts `$object:' at the
+  # start of each line; $object doesn't have directory information.
+  # Version 6 uses the directory in both cases.
+  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+  test "x$dir" = "x$object" && dir=
+  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+  if test "$libtool" = yes; then
+    tmpdepfile1=$dir$base.u
+    tmpdepfile2=$base.u
+    tmpdepfile3=$dir.libs/$base.u
+    "$@" -Wc,-M
+  else
+    tmpdepfile1=$dir$base.u
+    tmpdepfile2=$dir$base.u
+    tmpdepfile3=$dir$base.u
+    "$@" -M
+  fi
+  stat=$?
+
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+    exit $stat
+  fi
+
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+  do
+    test -f "$tmpdepfile" && break
+  done
+  if test -f "$tmpdepfile"; then
+    # Each line is of the form `foo.o: dependent.h'.
+    # Do two passes, one to just change these to
+    # `$object: dependent.h' and one to simply `dependent.h:'.
+    sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+    # That's a tab and a space in the [].
+    sed -e 's,^.*\.[a-z]*:[	 ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+  else
+    # The sourcefile does not contain any dependencies, so just
+    # store a dummy comment line, to avoid errors with the Makefile
+    # "include basename.Plo" scheme.
+    echo "#dummy" > "$depfile"
+  fi
+  rm -f "$tmpdepfile"
+  ;;
+
+icc)
+  # Intel's C compiler understands `-MD -MF file'.  However on
+  #    icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
+  # ICC 7.0 will fill foo.d with something like
+  #    foo.o: sub/foo.c
+  #    foo.o: sub/foo.h
+  # which is wrong.  We want:
+  #    sub/foo.o: sub/foo.c
+  #    sub/foo.o: sub/foo.h
+  #    sub/foo.c:
+  #    sub/foo.h:
+  # ICC 7.1 will output
+  #    foo.o: sub/foo.c sub/foo.h
+  # and will wrap long lines using \ :
+  #    foo.o: sub/foo.c ... \
+  #     sub/foo.h ... \
+  #     ...
+
+  "$@" -MD -MF "$tmpdepfile"
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+  # Each line is of the form `foo.o: dependent.h',
+  # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
+  # Do two passes, one to just change these to
+  # `$object: dependent.h' and one to simply `dependent.h:'.
+  sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
+  # Some versions of the HPUX 10.20 sed can't process this invocation
+  # correctly.  Breaking it into two sed invocations is a workaround.
+  sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
+    sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+hp2)
+  # The "hp" stanza above does not work with aCC (C++) and HP's ia64
+  # compilers, which have integrated preprocessors.  The correct option
+  # to use with these is +Maked; it writes dependencies to a file named
+  # 'foo.d', which lands next to the object file, wherever that
+  # happens to be.
+  # Much of this is similar to the tru64 case; see comments there.
+  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+  test "x$dir" = "x$object" && dir=
+  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+  if test "$libtool" = yes; then
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir.libs/$base.d
+    "$@" -Wc,+Maked
+  else
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir$base.d
+    "$@" +Maked
+  fi
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+     rm -f "$tmpdepfile1" "$tmpdepfile2"
+     exit $stat
+  fi
+
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
+  do
+    test -f "$tmpdepfile" && break
+  done
+  if test -f "$tmpdepfile"; then
+    sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
+    # Add `dependent.h:' lines.
+    sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile"
+  else
+    echo "#dummy" > "$depfile"
+  fi
+  rm -f "$tmpdepfile" "$tmpdepfile2"
+  ;;
+
+tru64)
+   # The Tru64 compiler uses -MD to generate dependencies as a side
+   # effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
+   # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
+   # dependencies in `foo.d' instead, so we check for that too.
+   # Subdirectories are respected.
+   dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+   test "x$dir" = "x$object" && dir=
+   base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+
+   if test "$libtool" = yes; then
+      # With Tru64 cc, shared objects can also be used to make a
+      # static library.  This mechanism is used in libtool 1.4 series to
+      # handle both shared and static libraries in a single compilation.
+      # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
+      #
+      # With libtool 1.5 this exception was removed, and libtool now
+      # generates 2 separate objects for the 2 libraries.  These two
+      # compilations output dependencies in $dir.libs/$base.o.d and
+      # in $dir$base.o.d.  We have to check for both files, because
+      # one of the two compilations can be disabled.  We should prefer
+      # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
+      # automatically cleaned when .libs/ is deleted, while ignoring
+      # the former would cause a distcleancheck panic.
+      tmpdepfile1=$dir.libs/$base.lo.d   # libtool 1.4
+      tmpdepfile2=$dir$base.o.d          # libtool 1.5
+      tmpdepfile3=$dir.libs/$base.o.d    # libtool 1.5
+      tmpdepfile4=$dir.libs/$base.d      # Compaq CCC V6.2-504
+      "$@" -Wc,-MD
+   else
+      tmpdepfile1=$dir$base.o.d
+      tmpdepfile2=$dir$base.d
+      tmpdepfile3=$dir$base.d
+      tmpdepfile4=$dir$base.d
+      "$@" -MD
+   fi
+
+   stat=$?
+   if test $stat -eq 0; then :
+   else
+      rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
+      exit $stat
+   fi
+
+   for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
+   do
+     test -f "$tmpdepfile" && break
+   done
+   if test -f "$tmpdepfile"; then
+      sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+      # That's a tab and a space in the [].
+      sed -e 's,^.*\.[a-z]*:[	 ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+   else
+      echo "#dummy" > "$depfile"
+   fi
+   rm -f "$tmpdepfile"
+   ;;
+
+#nosideeffect)
+  # This comment above is used by automake to tell side-effect
+  # dependency tracking mechanisms from slower ones.
+
+dashmstdout)
+  # Important note: in order to support this mode, a compiler *must*
+  # always write the preprocessed file to stdout, regardless of -o.
+  "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test $1 != '--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
+  # Remove `-o $object'.
+  IFS=" "
+  for arg
+  do
+    case $arg in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
+    *)
+      set fnord "$@" "$arg"
+      shift # fnord
+      shift # $arg
+      ;;
+    esac
+  done
+
+  test -z "$dashmflag" && dashmflag=-M
+  # Require at least two characters before searching for `:'
+  # in the target name.  This is to cope with DOS-style filenames:
+  # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
+  "$@" $dashmflag |
+    sed 's:^[  ]*[^: ][^:][^:]*\:[    ]*:'"$object"'\: :' > "$tmpdepfile"
+  rm -f "$depfile"
+  cat < "$tmpdepfile" > "$depfile"
+  tr ' ' '
+' < "$tmpdepfile" | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly.  Breaking it into two sed invocations is a workaround.
+    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+dashXmstdout)
+  # This case only exists to satisfy depend.m4.  It is never actually
+  # run, as this mode is specially recognized in the preamble.
+  exit 1
+  ;;
+
+makedepend)
+  "$@" || exit $?
+  # Remove any Libtool call
+  if test "$libtool" = yes; then
+    while test $1 != '--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+  # X makedepend
+  shift
+  cleared=no
+  for arg in "$@"; do
+    case $cleared in
+    no)
+      set ""; shift
+      cleared=yes ;;
+    esac
+    case "$arg" in
+    -D*|-I*)
+      set fnord "$@" "$arg"; shift ;;
+    # Strip any option that makedepend may not understand.  Remove
+    # the object too, otherwise makedepend will parse it as a source file.
+    -*|$object)
+      ;;
+    *)
+      set fnord "$@" "$arg"; shift ;;
+    esac
+  done
+  obj_suffix="`echo $object | sed 's/^.*\././'`"
+  touch "$tmpdepfile"
+  ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
+  rm -f "$depfile"
+  cat < "$tmpdepfile" > "$depfile"
+  sed '1,2d' "$tmpdepfile" | tr ' ' '
+' | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly.  Breaking it into two sed invocations is a workaround.
+    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile" "$tmpdepfile".bak
+  ;;
+
+cpp)
+  # Important note: in order to support this mode, a compiler *must*
+  # always write the preprocessed file to stdout.
+  "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test $1 != '--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
+  # Remove `-o $object'.
+  IFS=" "
+  for arg
+  do
+    case $arg in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
+    *)
+      set fnord "$@" "$arg"
+      shift # fnord
+      shift # $arg
+      ;;
+    esac
+  done
+
+  "$@" -E |
+    sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+       -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
+    sed '$ s: \\$::' > "$tmpdepfile"
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  cat < "$tmpdepfile" >> "$depfile"
+  sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+msvisualcpp)
+  # Important note: in order to support this mode, a compiler *must*
+  # always write the preprocessed file to stdout, regardless of -o,
+  # because we must use -o when running libtool.
+  "$@" || exit $?
+  IFS=" "
+  for arg
+  do
+    case "$arg" in
+    "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
+	set fnord "$@"
+	shift
+	shift
+	;;
+    *)
+	set fnord "$@" "$arg"
+	shift
+	shift
+	;;
+    esac
+  done
+  "$@" -E |
+  sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::	\1 \\:p' >> "$depfile"
+  echo "	" >> "$depfile"
+  . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+none)
+  exec "$@"
+  ;;
+
+*)
+  echo "Unknown depmode $depmode" 1>&2
+  exit 1
+  ;;
+esac
+
+exit 0
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/install-sh b/install-sh
new file mode 100755
index 0000000..a5897de
--- /dev/null
+++ b/install-sh
@@ -0,0 +1,519 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2006-12-25.00
+
+# This originates from X11R5 (mit/util/scripts/install.sh), which was
+# later released in X11R6 (xc/config/util/install.sh) with the
+# following copyright and license.
+#
+# Copyright (C) 1994 X Consortium
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
+# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# Except as contained in this notice, the name of the X Consortium shall not
+# be used in advertising or otherwise to promote the sale, use or other deal-
+# ings in this Software without prior written authorization from the X Consor-
+# tium.
+#
+#
+# FSF changes to this file are in the public domain.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch.
+
+nl='
+'
+IFS=" ""	$nl"
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit=${DOITPROG-}
+if test -z "$doit"; then
+  doit_exec=exec
+else
+  doit_exec=$doit
+fi
+
+# Put in absolute file names if you don't have them in your path;
+# or use environment vars.
+
+chgrpprog=${CHGRPPROG-chgrp}
+chmodprog=${CHMODPROG-chmod}
+chownprog=${CHOWNPROG-chown}
+cmpprog=${CMPPROG-cmp}
+cpprog=${CPPROG-cp}
+mkdirprog=${MKDIRPROG-mkdir}
+mvprog=${MVPROG-mv}
+rmprog=${RMPROG-rm}
+stripprog=${STRIPPROG-strip}
+
+posix_glob='?'
+initialize_posix_glob='
+  test "$posix_glob" != "?" || {
+    if (set -f) 2>/dev/null; then
+      posix_glob=
+    else
+      posix_glob=:
+    fi
+  }
+'
+
+posix_mkdir=
+
+# Desired mode of installed file.
+mode=0755
+
+chgrpcmd=
+chmodcmd=$chmodprog
+chowncmd=
+mvcmd=$mvprog
+rmcmd="$rmprog -f"
+stripcmd=
+
+src=
+dst=
+dir_arg=
+dst_arg=
+
+copy_on_change=false
+no_target_directory=
+
+usage="\
+Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+   or: $0 [OPTION]... SRCFILES... DIRECTORY
+   or: $0 [OPTION]... -t DIRECTORY SRCFILES...
+   or: $0 [OPTION]... -d DIRECTORIES...
+
+In the 1st form, copy SRCFILE to DSTFILE.
+In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
+In the 4th, create DIRECTORIES.
+
+Options:
+     --help     display this help and exit.
+     --version  display version info and exit.
+
+  -c            (ignored)
+  -C            install only if different (preserve the last data modification time)
+  -d            create directories instead of installing files.
+  -g GROUP      $chgrpprog installed files to GROUP.
+  -m MODE       $chmodprog installed files to MODE.
+  -o USER       $chownprog installed files to USER.
+  -s            $stripprog installed files.
+  -t DIRECTORY  install into DIRECTORY.
+  -T            report an error if DSTFILE is a directory.
+
+Environment variables override the default commands:
+  CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
+  RMPROG STRIPPROG
+"
+
+while test $# -ne 0; do
+  case $1 in
+    -c) ;;
+
+    -C) copy_on_change=true;;
+
+    -d) dir_arg=true;;
+
+    -g) chgrpcmd="$chgrpprog $2"
+	shift;;
+
+    --help) echo "$usage"; exit $?;;
+
+    -m) mode=$2
+	case $mode in
+	  *' '* | *'	'* | *'
+'*	  | *'*'* | *'?'* | *'['*)
+	    echo "$0: invalid mode: $mode" >&2
+	    exit 1;;
+	esac
+	shift;;
+
+    -o) chowncmd="$chownprog $2"
+	shift;;
+
+    -s) stripcmd=$stripprog;;
+
+    -t) dst_arg=$2
+	shift;;
+
+    -T) no_target_directory=true;;
+
+    --version) echo "$0 $scriptversion"; exit $?;;
+
+    --)	shift
+	break;;
+
+    -*)	echo "$0: invalid option: $1" >&2
+	exit 1;;
+
+    *)  break;;
+  esac
+  shift
+done
+
+if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
+  # When -d is used, all remaining arguments are directories to create.
+  # When -t is used, the destination is already specified.
+  # Otherwise, the last argument is the destination.  Remove it from $@.
+  for arg
+  do
+    if test -n "$dst_arg"; then
+      # $@ is not empty: it contains at least $arg.
+      set fnord "$@" "$dst_arg"
+      shift # fnord
+    fi
+    shift # arg
+    dst_arg=$arg
+  done
+fi
+
+if test $# -eq 0; then
+  if test -z "$dir_arg"; then
+    echo "$0: no input file specified." >&2
+    exit 1
+  fi
+  # It's OK to call `install-sh -d' without argument.
+  # This can happen when creating conditional directories.
+  exit 0
+fi
+
+if test -z "$dir_arg"; then
+  trap '(exit $?); exit' 1 2 13 15
+
+  # Set umask so as not to create temps with too-generous modes.
+  # However, 'strip' requires both read and write access to temps.
+  case $mode in
+    # Optimize common cases.
+    *644) cp_umask=133;;
+    *755) cp_umask=22;;
+
+    *[0-7])
+      if test -z "$stripcmd"; then
+	u_plus_rw=
+      else
+	u_plus_rw='% 200'
+      fi
+      cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
+    *)
+      if test -z "$stripcmd"; then
+	u_plus_rw=
+      else
+	u_plus_rw=,u+rw
+      fi
+      cp_umask=$mode$u_plus_rw;;
+  esac
+fi
+
+for src
+do
+  # Protect names starting with `-'.
+  case $src in
+    -*) src=./$src;;
+  esac
+
+  if test -n "$dir_arg"; then
+    dst=$src
+    dstdir=$dst
+    test -d "$dstdir"
+    dstdir_status=$?
+  else
+
+    # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+    # might cause directories to be created, which would be especially bad
+    # if $src (and thus $dsttmp) contains '*'.
+    if test ! -f "$src" && test ! -d "$src"; then
+      echo "$0: $src does not exist." >&2
+      exit 1
+    fi
+
+    if test -z "$dst_arg"; then
+      echo "$0: no destination specified." >&2
+      exit 1
+    fi
+
+    dst=$dst_arg
+    # Protect names starting with `-'.
+    case $dst in
+      -*) dst=./$dst;;
+    esac
+
+    # If destination is a directory, append the input filename; won't work
+    # if double slashes aren't ignored.
+    if test -d "$dst"; then
+      if test -n "$no_target_directory"; then
+	echo "$0: $dst_arg: Is a directory" >&2
+	exit 1
+      fi
+      dstdir=$dst
+      dst=$dstdir/`basename "$src"`
+      dstdir_status=0
+    else
+      # Prefer dirname, but fall back on a substitute if dirname fails.
+      dstdir=`
+	(dirname "$dst") 2>/dev/null ||
+	expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	     X"$dst" : 'X\(//\)[^/]' \| \
+	     X"$dst" : 'X\(//\)$' \| \
+	     X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
+	echo X"$dst" |
+	    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+		   s//\1/
+		   q
+		 }
+		 /^X\(\/\/\)[^/].*/{
+		   s//\1/
+		   q
+		 }
+		 /^X\(\/\/\)$/{
+		   s//\1/
+		   q
+		 }
+		 /^X\(\/\).*/{
+		   s//\1/
+		   q
+		 }
+		 s/.*/./; q'
+      `
+
+      test -d "$dstdir"
+      dstdir_status=$?
+    fi
+  fi
+
+  obsolete_mkdir_used=false
+
+  if test $dstdir_status != 0; then
+    case $posix_mkdir in
+      '')
+	# Create intermediate dirs using mode 755 as modified by the umask.
+	# This is like FreeBSD 'install' as of 1997-10-28.
+	umask=`umask`
+	case $stripcmd.$umask in
+	  # Optimize common cases.
+	  *[2367][2367]) mkdir_umask=$umask;;
+	  .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+	  *[0-7])
+	    mkdir_umask=`expr $umask + 22 \
+	      - $umask % 100 % 40 + $umask % 20 \
+	      - $umask % 10 % 4 + $umask % 2
+	    `;;
+	  *) mkdir_umask=$umask,go-w;;
+	esac
+
+	# With -d, create the new directory with the user-specified mode.
+	# Otherwise, rely on $mkdir_umask.
+	if test -n "$dir_arg"; then
+	  mkdir_mode=-m$mode
+	else
+	  mkdir_mode=
+	fi
+
+	posix_mkdir=false
+	case $umask in
+	  *[123567][0-7][0-7])
+	    # POSIX mkdir -p sets u+wx bits regardless of umask, which
+	    # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+	    ;;
+	  *)
+	    tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+	    trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+	    if (umask $mkdir_umask &&
+		exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+	    then
+	      if test -z "$dir_arg" || {
+		   # Check for POSIX incompatibilities with -m.
+		   # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+		   # other-writeable bit of parent directory when it shouldn't.
+		   # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+		   ls_ld_tmpdir=`ls -ld "$tmpdir"`
+		   case $ls_ld_tmpdir in
+		     d????-?r-*) different_mode=700;;
+		     d????-?--*) different_mode=755;;
+		     *) false;;
+		   esac &&
+		   $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+		     ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+		     test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+		   }
+		 }
+	      then posix_mkdir=:
+	      fi
+	      rmdir "$tmpdir/d" "$tmpdir"
+	    else
+	      # Remove any dirs left behind by ancient mkdir implementations.
+	      rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+	    fi
+	    trap '' 0;;
+	esac;;
+    esac
+
+    if
+      $posix_mkdir && (
+	umask $mkdir_umask &&
+	$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+      )
+    then :
+    else
+
+      # The umask is ridiculous, or mkdir does not conform to POSIX,
+      # or it failed possibly due to a race condition.  Create the
+      # directory the slow way, step by step, checking for races as we go.
+
+      case $dstdir in
+	/*) prefix='/';;
+	-*) prefix='./';;
+	*)  prefix='';;
+      esac
+
+      eval "$initialize_posix_glob"
+
+      oIFS=$IFS
+      IFS=/
+      $posix_glob set -f
+      set fnord $dstdir
+      shift
+      $posix_glob set +f
+      IFS=$oIFS
+
+      prefixes=
+
+      for d
+      do
+	test -z "$d" && continue
+
+	prefix=$prefix$d
+	if test -d "$prefix"; then
+	  prefixes=
+	else
+	  if $posix_mkdir; then
+	    (umask=$mkdir_umask &&
+	     $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+	    # Don't fail if two instances are running concurrently.
+	    test -d "$prefix" || exit 1
+	  else
+	    case $prefix in
+	      *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+	      *) qprefix=$prefix;;
+	    esac
+	    prefixes="$prefixes '$qprefix'"
+	  fi
+	fi
+	prefix=$prefix/
+      done
+
+      if test -n "$prefixes"; then
+	# Don't fail if two instances are running concurrently.
+	(umask $mkdir_umask &&
+	 eval "\$doit_exec \$mkdirprog $prefixes") ||
+	  test -d "$dstdir" || exit 1
+	obsolete_mkdir_used=true
+      fi
+    fi
+  fi
+
+  if test -n "$dir_arg"; then
+    { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
+    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
+    { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
+      test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
+  else
+
+    # Make a couple of temp file names in the proper directory.
+    dsttmp=$dstdir/_inst.$$_
+    rmtmp=$dstdir/_rm.$$_
+
+    # Trap to clean up those temp files at exit.
+    trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
+
+    # Copy the file name to the temp name.
+    (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
+
+    # and set any options; do chmod last to preserve setuid bits.
+    #
+    # If any of these fail, we abort the whole thing.  If we want to
+    # ignore errors from any of these, just make sure not to ignore
+    # errors from the above "$doit $cpprog $src $dsttmp" command.
+    #
+    { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
+    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
+    { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
+    { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
+
+    # If -C, don't bother to copy if it wouldn't change the file.
+    if $copy_on_change &&
+       old=`LC_ALL=C ls -dlL "$dst"	2>/dev/null` &&
+       new=`LC_ALL=C ls -dlL "$dsttmp"	2>/dev/null` &&
+
+       eval "$initialize_posix_glob" &&
+       $posix_glob set -f &&
+       set X $old && old=:$2:$4:$5:$6 &&
+       set X $new && new=:$2:$4:$5:$6 &&
+       $posix_glob set +f &&
+
+       test "$old" = "$new" &&
+       $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
+    then
+      rm -f "$dsttmp"
+    else
+      # Rename the file to the real destination.
+      $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
+
+      # The rename failed, perhaps because mv can't rename something else
+      # to itself, or perhaps because mv is so ancient that it does not
+      # support -f.
+      {
+	# Now remove or move aside any old file at destination location.
+	# We try this two ways since rm can't unlink itself on some
+	# systems and the destination file might be busy for other
+	# reasons.  In this case, the final cleanup might fail but the new
+	# file should still install successfully.
+	{
+	  test ! -f "$dst" ||
+	  $doit $rmcmd -f "$dst" 2>/dev/null ||
+	  { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+	    { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+	  } ||
+	  { echo "$0: cannot unlink or rename $dst" >&2
+	    (exit 1); exit 1
+	  }
+	} &&
+
+	# Now rename the file to the real destination.
+	$doit $mvcmd "$dsttmp" "$dst"
+      }
+    fi || exit 1
+
+    trap '' 0
+  fi
+done
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/missing b/missing
new file mode 100755
index 0000000..1c8ff70
--- /dev/null
+++ b/missing
@@ -0,0 +1,367 @@
+#! /bin/sh
+# Common stub for a few missing GNU programs while installing.
+
+scriptversion=2006-05-10.23
+
+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006
+#   Free Software Foundation, Inc.
+# Originally by Fran,cois Pinard <pinard at iro.umontreal.ca>, 1996.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+if test $# -eq 0; then
+  echo 1>&2 "Try \`$0 --help' for more information"
+  exit 1
+fi
+
+run=:
+sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
+sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
+
+# In the cases where this matters, `missing' is being run in the
+# srcdir already.
+if test -f configure.ac; then
+  configure_ac=configure.ac
+else
+  configure_ac=configure.in
+fi
+
+msg="missing on your system"
+
+case $1 in
+--run)
+  # Try to run requested program, and just exit if it succeeds.
+  run=
+  shift
+  "$@" && exit 0
+  # Exit code 63 means version mismatch.  This often happens
+  # when the user try to use an ancient version of a tool on
+  # a file that requires a minimum version.  In this case we
+  # we should proceed has if the program had been absent, or
+  # if --run hadn't been passed.
+  if test $? = 63; then
+    run=:
+    msg="probably too old"
+  fi
+  ;;
+
+  -h|--h|--he|--hel|--help)
+    echo "\
+$0 [OPTION]... PROGRAM [ARGUMENT]...
+
+Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
+error status if there is no known handling for PROGRAM.
+
+Options:
+  -h, --help      display this help and exit
+  -v, --version   output version information and exit
+  --run           try to run the given command, and emulate it if it fails
+
+Supported PROGRAM values:
+  aclocal      touch file \`aclocal.m4'
+  autoconf     touch file \`configure'
+  autoheader   touch file \`config.h.in'
+  autom4te     touch the output file, or create a stub one
+  automake     touch all \`Makefile.in' files
+  bison        create \`y.tab.[ch]', if possible, from existing .[ch]
+  flex         create \`lex.yy.c', if possible, from existing .c
+  help2man     touch the output file
+  lex          create \`lex.yy.c', if possible, from existing .c
+  makeinfo     touch the output file
+  tar          try tar, gnutar, gtar, then tar without non-portable flags
+  yacc         create \`y.tab.[ch]', if possible, from existing .[ch]
+
+Send bug reports to <bug-automake at gnu.org>."
+    exit $?
+    ;;
+
+  -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+    echo "missing $scriptversion (GNU Automake)"
+    exit $?
+    ;;
+
+  -*)
+    echo 1>&2 "$0: Unknown \`$1' option"
+    echo 1>&2 "Try \`$0 --help' for more information"
+    exit 1
+    ;;
+
+esac
+
+# Now exit if we have it, but it failed.  Also exit now if we
+# don't have it and --version was passed (most likely to detect
+# the program).
+case $1 in
+  lex|yacc)
+    # Not GNU programs, they don't have --version.
+    ;;
+
+  tar)
+    if test -n "$run"; then
+       echo 1>&2 "ERROR: \`tar' requires --run"
+       exit 1
+    elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+       exit 1
+    fi
+    ;;
+
+  *)
+    if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+       # We have it, but it failed.
+       exit 1
+    elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+       # Could not run --version or --help.  This is probably someone
+       # running `$TOOL --version' or `$TOOL --help' to check whether
+       # $TOOL exists and not knowing $TOOL uses missing.
+       exit 1
+    fi
+    ;;
+esac
+
+# If it does not exist, or fails to run (possibly an outdated version),
+# try to emulate it.
+case $1 in
+  aclocal*)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified \`acinclude.m4' or \`${configure_ac}'.  You might want
+         to install the \`Automake' and \`Perl' packages.  Grab them from
+         any GNU archive site."
+    touch aclocal.m4
+    ;;
+
+  autoconf)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified \`${configure_ac}'.  You might want to install the
+         \`Autoconf' and \`GNU m4' packages.  Grab them from any GNU
+         archive site."
+    touch configure
+    ;;
+
+  autoheader)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified \`acconfig.h' or \`${configure_ac}'.  You might want
+         to install the \`Autoconf' and \`GNU m4' packages.  Grab them
+         from any GNU archive site."
+    files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
+    test -z "$files" && files="config.h"
+    touch_files=
+    for f in $files; do
+      case $f in
+      *:*) touch_files="$touch_files "`echo "$f" |
+				       sed -e 's/^[^:]*://' -e 's/:.*//'`;;
+      *) touch_files="$touch_files $f.in";;
+      esac
+    done
+    touch $touch_files
+    ;;
+
+  automake*)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
+         You might want to install the \`Automake' and \`Perl' packages.
+         Grab them from any GNU archive site."
+    find . -type f -name Makefile.am -print |
+	   sed 's/\.am$/.in/' |
+	   while read f; do touch "$f"; done
+    ;;
+
+  autom4te)
+    echo 1>&2 "\
+WARNING: \`$1' is needed, but is $msg.
+         You might have modified some files without having the
+         proper tools for further handling them.
+         You can get \`$1' as part of \`Autoconf' from any GNU
+         archive site."
+
+    file=`echo "$*" | sed -n "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    if test -f "$file"; then
+	touch $file
+    else
+	test -z "$file" || exec >$file
+	echo "#! /bin/sh"
+	echo "# Created by GNU Automake missing as a replacement of"
+	echo "#  $ $@"
+	echo "exit 0"
+	chmod +x $file
+	exit 1
+    fi
+    ;;
+
+  bison|yacc)
+    echo 1>&2 "\
+WARNING: \`$1' $msg.  You should only need it if
+         you modified a \`.y' file.  You may need the \`Bison' package
+         in order for those modifications to take effect.  You can get
+         \`Bison' from any GNU archive site."
+    rm -f y.tab.c y.tab.h
+    if test $# -ne 1; then
+        eval LASTARG="\${$#}"
+	case $LASTARG in
+	*.y)
+	    SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
+	    if test -f "$SRCFILE"; then
+	         cp "$SRCFILE" y.tab.c
+	    fi
+	    SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
+	    if test -f "$SRCFILE"; then
+	         cp "$SRCFILE" y.tab.h
+	    fi
+	  ;;
+	esac
+    fi
+    if test ! -f y.tab.h; then
+	echo >y.tab.h
+    fi
+    if test ! -f y.tab.c; then
+	echo 'main() { return 0; }' >y.tab.c
+    fi
+    ;;
+
+  lex|flex)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified a \`.l' file.  You may need the \`Flex' package
+         in order for those modifications to take effect.  You can get
+         \`Flex' from any GNU archive site."
+    rm -f lex.yy.c
+    if test $# -ne 1; then
+        eval LASTARG="\${$#}"
+	case $LASTARG in
+	*.l)
+	    SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
+	    if test -f "$SRCFILE"; then
+	         cp "$SRCFILE" lex.yy.c
+	    fi
+	  ;;
+	esac
+    fi
+    if test ! -f lex.yy.c; then
+	echo 'main() { return 0; }' >lex.yy.c
+    fi
+    ;;
+
+  help2man)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+	 you modified a dependency of a manual page.  You may need the
+	 \`Help2man' package in order for those modifications to take
+	 effect.  You can get \`Help2man' from any GNU archive site."
+
+    file=`echo "$*" | sed -n "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    if test -f "$file"; then
+	touch $file
+    else
+	test -z "$file" || exec >$file
+	echo ".ab help2man is required to generate this page"
+	exit 1
+    fi
+    ;;
+
+  makeinfo)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified a \`.texi' or \`.texinfo' file, or any other file
+         indirectly affecting the aspect of the manual.  The spurious
+         call might also be the consequence of using a buggy \`make' (AIX,
+         DU, IRIX).  You might want to install the \`Texinfo' package or
+         the \`GNU make' package.  Grab either from any GNU archive site."
+    # The file to touch is that specified with -o ...
+    file=`echo "$*" | sed -n "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    if test -z "$file"; then
+      # ... or it is the one specified with @setfilename ...
+      infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
+      file=`sed -n '
+	/^@setfilename/{
+	  s/.* \([^ ]*\) *$/\1/
+	  p
+	  q
+	}' $infile`
+      # ... or it is derived from the source name (dir/f.texi becomes f.info)
+      test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
+    fi
+    # If the file does not exist, the user really needs makeinfo;
+    # let's fail without touching anything.
+    test -f $file || exit 1
+    touch $file
+    ;;
+
+  tar)
+    shift
+
+    # We have already tried tar in the generic part.
+    # Look for gnutar/gtar before invocation to avoid ugly error
+    # messages.
+    if (gnutar --version > /dev/null 2>&1); then
+       gnutar "$@" && exit 0
+    fi
+    if (gtar --version > /dev/null 2>&1); then
+       gtar "$@" && exit 0
+    fi
+    firstarg="$1"
+    if shift; then
+	case $firstarg in
+	*o*)
+	    firstarg=`echo "$firstarg" | sed s/o//`
+	    tar "$firstarg" "$@" && exit 0
+	    ;;
+	esac
+	case $firstarg in
+	*h*)
+	    firstarg=`echo "$firstarg" | sed s/h//`
+	    tar "$firstarg" "$@" && exit 0
+	    ;;
+	esac
+    fi
+
+    echo 1>&2 "\
+WARNING: I can't seem to be able to run \`tar' with the given arguments.
+         You may want to install GNU tar or Free paxutils, or check the
+         command line arguments."
+    exit 1
+    ;;
+
+  *)
+    echo 1>&2 "\
+WARNING: \`$1' is needed, and is $msg.
+         You might have modified some files without having the
+         proper tools for further handling them.  Check the \`README' file,
+         it often tells you about the needed prerequisites for installing
+         this package.  You may also peek at any GNU archive site, in case
+         some other package would contain this missing \`$1' program."
+    exit 1
+    ;;
+esac
+
+exit 0
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/src/Makefile.am b/src/Makefile.am
new file mode 100644
index 0000000..07b9326
--- /dev/null
+++ b/src/Makefile.am
@@ -0,0 +1,21 @@
+#===============================================================================
+# Makefile.am : for automake
+#===============================================================================
+
+bin_PROGRAMS = sap
+
+AM_CPPFLAGS = $(INTI_CFLAGS)
+AM_CFLAGS = -Wall
+
+sap_SOURCES = \
+bestrot.c bestrot.h cones.c cones.h galloc.h geom.c geom.h \
+matrix.c matrix.h pdbprot.c pdbprot.h ql.c ql.h sap.c sap.h \
+siva.c siva.h sort.c sort.h student.h stutest.c util.c util.h
+
+sap_LDADD = $(INTI_LIBS)
+
+EXTRA_DIST = doxygen.cfg
+
+CLEANFILES = $(TARGET) *.o 
+DISTCLEANFILES = libtool config.cache config.log
+
diff --git a/src/Makefile.in b/src/Makefile.in
new file mode 100644
index 0000000..3a427e6
--- /dev/null
+++ b/src/Makefile.in
@@ -0,0 +1,458 @@
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+#===============================================================================
+# Makefile.am : for automake
+#===============================================================================
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+bin_PROGRAMS = sap$(EXEEXT)
+subdir = src
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(srcdir)/config.h.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)"
+binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(bin_PROGRAMS)
+am_sap_OBJECTS = bestrot.$(OBJEXT) cones.$(OBJEXT) geom.$(OBJEXT) \
+	matrix.$(OBJEXT) pdbprot.$(OBJEXT) ql.$(OBJEXT) sap.$(OBJEXT) \
+	siva.$(OBJEXT) sort.$(OBJEXT) stutest.$(OBJEXT) util.$(OBJEXT)
+sap_OBJECTS = $(am_sap_OBJECTS)
+am__DEPENDENCIES_1 =
+sap_DEPENDENCIES = $(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I. at am__isrc@
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(sap_SOURCES)
+DIST_SOURCES = $(sap_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTI_CFLAGS = @INTI_CFLAGS@
+INTI_LIBS = @INTI_LIBS@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build_alias = @build_alias@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host_alias = @host_alias@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+AM_CPPFLAGS = $(INTI_CFLAGS)
+AM_CFLAGS = -Wall
+sap_SOURCES = \
+bestrot.c bestrot.h cones.c cones.h galloc.h geom.c geom.h \
+matrix.c matrix.h pdbprot.c pdbprot.h ql.c ql.h sap.c sap.h \
+siva.c siva.h sort.c sort.h student.h stutest.c util.c util.h
+
+sap_LDADD = $(INTI_LIBS)
+EXTRA_DIST = doxygen.cfg
+CLEANFILES = $(TARGET) *.o 
+DISTCLEANFILES = libtool config.cache config.log
+all: config.h
+	$(MAKE) $(AM_MAKEFLAGS) all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  src/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu  src/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+config.h: stamp-h1
+	@if test ! -f $@; then \
+	  rm -f stamp-h1; \
+	  $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \
+	else :; fi
+
+stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
+	@rm -f stamp-h1
+	cd $(top_builddir) && $(SHELL) ./config.status src/config.h
+$(srcdir)/config.h.in:  $(am__configure_deps) 
+	cd $(top_srcdir) && $(AUTOHEADER)
+	rm -f stamp-h1
+	touch $@
+
+distclean-hdr:
+	-rm -f config.h stamp-h1
+install-binPROGRAMS: $(bin_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
+	@list='$(bin_PROGRAMS)'; for p in $$list; do \
+	  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  if test -f $$p \
+	  ; then \
+	    f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+	   echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
+	   $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
+	  else :; fi; \
+	done
+
+uninstall-binPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(bin_PROGRAMS)'; for p in $$list; do \
+	  f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+	  echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
+	  rm -f "$(DESTDIR)$(bindir)/$$f"; \
+	done
+
+clean-binPROGRAMS:
+	-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+sap$(EXEEXT): $(sap_OBJECTS) $(sap_DEPENDENCIES) 
+	@rm -f sap$(EXEEXT)
+	$(LINK) $(sap_OBJECTS) $(sap_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/bestrot.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cones.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/geom.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/matrix.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pdbprot.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ql.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/sap.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/siva.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/sort.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/stutest.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/util.Po at am__quote@
+
+.c.o:
+ at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(COMPILE) -c $<
+
+.c.obj:
+ at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	    $$tags $$unique; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS) config.h
+installdirs:
+	for dir in "$(DESTDIR)$(bindir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-hdr distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
+	clean-generic ctags distclean distclean-compile \
+	distclean-generic distclean-hdr distclean-tags distdir dvi \
+	dvi-am html html-am info info-am install install-am \
+	install-binPROGRAMS install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-binPROGRAMS
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/bestrot.c b/src/bestrot.c
new file mode 100644
index 0000000..7751e70
--- /dev/null
+++ b/src/bestrot.c
@@ -0,0 +1,176 @@
+/* ==== FUNCTIONS bestrot.c ==== */
+
+/* An implementation of the 3D point set alignment algorithm by
+ * A. D. McLachlan. Reference:
+ * McLachlan, A. D. (1979): J. Mol. Biol. 128: 49-79.
+ * Replaces the buggy Kabsch rotation algorithm.
+ */
+
+/* ANSI C, IRIX 5.2, 5. Aug. 1994. Andris Aszodi */
+
+/* ---- HEADER ---- */
+/* ---- STANDARD HEADERS ---- */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <math.h>
+#include <assert.h>
+
+/* ---- INCLUDE FILES ---- */
+
+#include "bestrot.h"
+#include "siva.h"		/* singular value decomposition */
+
+/* ---- DEFINITIONS ---- */
+
+#define DIM 3
+
+double supermac(const double *W, double **X, double **Y, int n,
+		double *CtrX, double *CtrY, Sqmat_ rot)
+{
+    center_vectors(X, CtrX, W, n);
+    center_vectors(Y, CtrY, W, n);
+    return best_rot(X, Y, W, n, rot);
+}
+
+/* ==== FUNCTIONS ==== */
+
+/* center_vectors: calculates the centroid of the 
+ * set of 3-dimensional vectors X (Vno x 3) and
+ * subtracts it from each of them,  thus centring the
+ * set on the centroid. If Ctr==NULL, then a 3-long
+ * array is allocated to store the centroid coordinates;
+ * if Ctr!=NULL, then it is assumed to be large enough to
+ * hold the coordinates.
+ * Return value: Ctr, or NULL if Vno==0.
+ */
+double *center_vectors(double **X, double *Ctr, const double *W, unsigned int Vno)
+{
+    register unsigned int i, j;
+    double Wsum;
+
+    if (Vno < 0) {
+    	fprintf(stderr,"center_vectors: Vno %d < 0. Fatal.\n", Vno);
+    	exit (1);
+    }
+    /* allocate centroid vector if absent */
+    if (Ctr == NULL) {
+    	Ctr = (double *) calloc(DIM, sizeof(double));
+    }
+    assert(Ctr);
+
+    /* get the (weighted) centroid */
+    Wsum = 0.0;
+    for (i = 0; i < Vno; i++) {
+    	Wsum += W[i];
+    }
+    for (j = 0; j < DIM; j++) {
+    	Ctr[j] = 0.0;
+    	for (i = 0; i < Vno; i++) {
+    		Ctr[j] += X[i][j] * W[i];
+    	}
+    	Ctr[j] /= Wsum;
+    }
+
+    /* subtract Ctr from all vectors in X */
+    for (i = 0; i < Vno; i++) {
+    	for (j = 0; j < DIM; j++) {
+    		X[i][j] -= Ctr[j];
+    	}
+    }
+
+    return (Ctr);
+}
+
+/* END of center_vectors */
+
+/* best_rot: finds the best rotation matrix that brings a set of
+ * vectors X into another set Y. X, Y have Vno vectors (in rows), 
+ * and both live in 3 dimensions (Vno x 3). W is a Vno-long
+ * weight vector that can emphasise vector pairs. Transform is
+ * a 3x3 square matrix (allocated before call) that on
+ * return contains the X->Y transformation. It is assumed that
+ * X and Y were centered before the call.
+ * NOTE: this routine cannot handle the degenerate cases when
+ * the point sets are Dim<3-dimensional. (Might be implemented
+ * later.) When this happens, a warning is printed to stderr
+ * and -1.0 (a meaningless RMS value) is returned.
+ * Return value: a weighted least-squares error function.
+ */
+double best_rot(double **X, double **Y, const double *W,
+		unsigned int Vno, Sqmat_ Transform)
+{
+    register unsigned int i, j, k, n;
+    int Psign, Rank;
+    double **H = NULL, *D = NULL, **K = NULL;
+    Sqmat_ U = NULL;
+    register double Err = 0.0, Temp1, Temp2, Wsum = 0.0;
+    double Detu;
+
+    /* set up the matrix to be SVD-d */
+    U = alloc_sqmat(DIM);
+    assert(U);
+    for (i = 0; i < DIM; i++) {
+    	for (j = 0; j < DIM; j++) {
+    		Temp1 = 0.0;
+    		for (k = 0; k < Vno; k++) {
+    			Temp1 += W[k] * X[k][i] * Y[k][j];
+    		}
+    		U[i][j] = Temp1;
+    	}
+    }
+
+    /* set up and perform SVD */
+    siva_setup(DIM, DIM, &H, &D, &K);
+    siva_decomp((const double **) U, DIM, DIM, H, D, K);
+
+    /* check rank: do nothing if rank was lost */
+    if ((Rank = rank_cond(D, DIM, SIVA_EPSILON, NULL)) < 3) {
+    	fprintf(stderr, "? best_rot(): Rank %d<%d\n", Rank, DIM);
+    	free_siva(DIM, DIM, H, D, K);
+    	free_matrix(U, DIM);
+    	return (-1.0);
+    }
+
+    /* get the determinant of U and store its sign in Psign */
+    Psign = lu_decomp(U, DIM, NULL);
+    Detu = lu_det(U, Psign, DIM);
+    Psign = (Detu > 0) ? 1 : -1;
+
+    /* generate the transform matrix: here we explicitly
+     * use DIM==3 because McLachlan does not say what to do
+     * if Psign==-1 and DIM>3 and I don't know :-)
+     */
+    for (i = 0; i < DIM; i++)  {
+    	for (j = 0; j < DIM; j++) {
+    		Transform[i][j] =	K[i][0] * H[j][0] + K[i][1] * H[j][1] + Psign * K[i][2] * H[j][2];
+    	}
+    }
+
+    /* evaluate the error function */
+    for (n = 0; n < Vno; n++) {
+    	Temp2 = 0.0;
+    	for (i = 0; i < DIM; i++) {
+    		Temp1 = 0.0;
+    		for (j = 0; j < DIM; j++) {
+    			Temp1 += Transform[i][j] * X[n][j];
+    		}
+    		Temp1 -= Y[n][i];
+    		Temp2 += Temp1 * Temp1;
+    	}
+    	Err += W[n] * Temp2;
+		Wsum += W[n];
+    }
+    Err /= Wsum;
+
+    /* cleanup */
+    free_siva(DIM, DIM, H, D, K);
+    free_matrix(U, DIM);
+    return (sqrt(Err));
+}
+
+/* END of best_rot */
+
+#undef DIM
+
+/* ==== END OF FUNCTIONS bestrot.c ==== */
diff --git a/src/bestrot.h b/src/bestrot.h
new file mode 100644
index 0000000..42dd312
--- /dev/null
+++ b/src/bestrot.h
@@ -0,0 +1,26 @@
+#ifndef __BESTROT_H__
+#define __BESTROT_H__
+
+#include "matrix.h"
+
+/* ==== HEADER bestrot.h ==== */
+
+/* An implementation of the point set alignment algorithm by
+ * A. D. McLachlan. Reference:
+ * McLachlan, A. D. (1979): J. Mol. Biol. 128: 49-79.
+ * Replaces the buggy Kabsch rotation algorithm.
+ */
+
+/* ANSI C, IRIX 5.2, 5. Aug. 1994. Andris Aszodi */
+
+
+/* ---- PROTOTYPES ---- */
+
+double supermac (const double *, double **, double **, int , double *, double *, Sqmat_);
+double *center_vectors(double **X, double *Ctr, const double *W, unsigned int Vno);
+double best_rot(double **X, double **Y, const double *W,
+		unsigned int Vno, Sqmat_ Transform);
+
+/* ==== END OF HEADER bestrot.h ==== */
+
+#endif
diff --git a/src/cones.c b/src/cones.c
new file mode 100644
index 0000000..30e1b0c
--- /dev/null
+++ b/src/cones.c
@@ -0,0 +1,377 @@
+/*
+ * Conic accessibilities (beta=sidechain centroid) on the PDB.
+ * Monomeric proteins only,  output in xmgr format.
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <math.h>
+#include <string.h>
+#include <assert.h>
+
+/* ---- INCLUDE FILES ---- */
+
+#include "matrix.h"
+#include "galloc.h"
+#include "cones.h"
+
+/* ANSI C, IRIX 4.0.5, 23. May 1994. Andris */
+
+/* ---- STANDARD HEADERS ---- */
+
+/*static int get_names(const char *Names, char Dsspnm[], char Pdbnm[]);*/
+
+static int get_cacentr(const Chain_ * Chain, Atom_ ** Calpha,
+		       Atom_ ** Centr);
+static void make_distmats(const Atom_ Calpha[], const Atom_ Centr[],
+			  int Rno, Trimat_ Dista, Sqmat_ Distab,
+			  Trimat_ Distb);
+static void betacone_shield(const Trimat_ Dista, const Sqmat_ Distab,
+			    const Trimat_ Distb, float Relshb[], int Rno);
+
+
+
+void cones(Pdbentry_ * Entry)
+{
+    float *Relsh = NULL;
+    Trimat_ Dista, Distb;
+    Sqmat_ Distab;
+    Atom_ *Calpha = NULL, *Centr = NULL;
+    int i, Len;
+
+    get_cacentr(Entry->Chains, &Calpha, &Centr);
+    Len = Entry->Chains->Aano;
+    Dista = alloc_trimat(Len);
+    assert(Dista);
+    Distb = alloc_trimat(Len);
+    assert(Distb);
+    Distab = alloc_sqmat(Len);
+    assert(Distab);
+    make_distmats(Calpha, Centr, Len, Dista, Distab, Distb);
+    free(Calpha);
+    free(Centr);
+    Calpha = Centr = NULL;
+    Relsh = (float *) calloc(Len, sizeof(float));
+    assert(Relsh);
+    betacone_shield(Dista, Distab, Distb, Relsh, Len);
+    free_matrix(Dista, Len);
+    free_matrix(Distb, Len);
+    free_matrix(Distab, Len);
+    for (i = 0; i < Len; i++)
+	Entry->Chains->Atoms[i].Bfact = Relsh[i];
+    /* cleanup */
+    free(Relsh);
+    Relsh = NULL;
+}
+
+/* ==== FUNCTIONS ==== */
+
+/* get_names: constructs the full DSSP and PDB pathnames out of a file
+ * (Names) that contains 4-char PDB names (like 4INS) a <newline>
+ * and nothing else in every line. When get_names() is called
+ * for the first time, then Names is opened and the first code is read
+ * and two filenames, decorated with appropriate pathnames and extensions for
+ * the DSSP and PDB databases are copied into Dsspnm[] and Pdbnm[]
+ * (which should be long enough to hold these) and 1 is
+ * returned. The following names are returned on subsequent calls.
+ * When Names is exhausted, it is closed and 0 is returned.
+ * 0 is also returned in case of an I/O error.
+ */
+#define NAMELEN 4
+/*static int get_names(const char *Names, char Dsspnm[], char Pdbnm[])
+{
+    static FILE *Nf = NULL;
+    char Name[NAMELEN + 1];
+    static const char *Dsspath = "/nonhom/dssp/", *Pdbpath = "/nonhom/",
+	*Ext = ".dssp";
+
+    if (Nf == NULL)
+	Nf = fopen(Names, "r");
+    if (Nf == NULL)
+	return (0);
+    if (1 == fscanf(Nf, "%4s\n", Name)) {
+	Name[NAMELEN] = '\0';
+	strcpy(Dsspnm, Dsspath);
+	strcpy(Pdbnm, Pdbpath);
+	strcat(Dsspnm, Name);
+	strcat(Pdbnm, Name);
+	strcat(Dsspnm, Ext)
+	return (1);
+    } else {
+	fclose(Nf);
+	Nf = NULL;
+	return (0);
+    }
+}
+*/
+#undef NAMELEN
+/* END of get_names */
+
+/* ---- AB CONIC SHIELDEDNESS ---- */
+
+/* get_cacentr: extracts the C-alpha coordinates from a PDB chain
+ * pointed to by Chain and copies them into an array allocated
+ * within and pointed to by Calpha. Also calculates the centroids
+ * of the side chains and puts them into an array (also alloc-d within)
+ * pointed to by Centr. If no side chain is found (e.g. Gly) then
+ * the corresponding C-alpha coordinate is used as side chain centroid.
+ * Both arrays are Chain->Aano long (this value is returned).
+ * Returns 0 if Chain is not a protein (in this case the arrays
+ * will be NULL). Revised 23-May-94 to take care of Alt-s.
+ */
+static int get_cacentr(const Chain_ * Chain, Atom_ ** Calpha,
+		       Atom_ ** Centr)
+{
+    Atom_ *Cur, *Ca, *Sctr;
+    int i, j, Scno = 0, Resno = -9999;
+    char Rid = '\0';
+
+    *Calpha = *Centr = NULL;
+    if (Chain->Aano <= 0 || Chain->Type == 'X')
+	return (0);
+
+    Ca = (Atom_ *) calloc(Chain->Aano, sizeof(Atom_));
+    assert(Ca);
+    Sctr = (Atom_ *) calloc(Chain->Aano, sizeof(Atom_));
+    assert(Sctr);
+
+    /* trundle along the chain: the C-alpha always comes
+     * before the corresponding side chain (we hope)
+     * Check for Alt conformations: a new CA is accepted
+     * only if its Resno or Rid field _changes_ compared
+     * to those of the previous one. The alternative sidechain
+     * conformations are lumped into one avg chain.
+     */
+    for (Cur = Chain->Atoms, i = j = 0; i < Chain->Atomno; i++, Cur++) {
+	/* skip main-chain atoms (except C-alphas), terminal
+	 * carboxyl-O-s and everybody else not C, N, O, S
+	 */
+	if (!strcmp(Cur->Id, "N") || !strcmp(Cur->Id, "C") ||
+	    !strcmp(Cur->Id, "O") || !strcmp(Cur->Id, "OXT") ||
+	    NULL == strchr("CNOS", Cur->Id[0]))
+	    continue;
+
+	/* finish up prev sidechain if any, copy the new C-alpha, 
+	 * reset the centroid coords, store the AA type char
+	 */
+	if (!strcmp(Cur->Id, "CA")) {
+	    if (Cur->Resno != Resno || Cur->Rid != Rid) {
+		Resno = Cur->Resno;
+		Rid = Cur->Rid;
+		Ca[j] = *Cur;
+		Sctr[j].X = Sctr[j].Y = Sctr[j].Z = 0.0;
+		if (Scno) {
+		    Sctr[j - 1].X /= Scno;
+		    Sctr[j - 1].Y /= Scno;
+		    Sctr[j - 1].Z /= Scno;
+		    Scno = 0;
+		} else if (j)
+		    Sctr[j - 1] = Ca[j - 1];	/* copy C-alpha */
+		j++;
+	    }
+	    continue;
+	}
+
+	/* side chain atoms: average in the centroid */
+	Sctr[j - 1].X += Cur->X;
+	Sctr[j - 1].Y += Cur->Y;
+	Sctr[j - 1].Z += Cur->Z;
+	Scno++;
+    }				/* for Cur */
+
+    /* finish up last */
+    if (Scno) {
+	Sctr[j - 1].X /= Scno;
+	Sctr[j - 1].Y /= Scno;
+	Sctr[j - 1].Z /= Scno;
+    } else
+	Sctr[j - 1] = Ca[j - 1];	/* copy C-alpha */
+
+    *Calpha = Ca;
+    *Centr = Sctr;
+    return (Chain->Aano);
+}
+
+/* END of get_cacentr */
+
+/* make_distmats: calculates the (squared) C-alpha:C-alpha,
+ * C-alpha:sidechain-centroid and sidechain-centroid:sidechain-centroid
+ * distances and puts them into Dista, Distab and Distb, 
+ * respectively. The coordinates are in Calpha[] and Centr[], 
+ * both arrays are Rno long. The matrices are assumed to be
+ * allocated accordingly.
+ */
+static void make_distmats(const Atom_ Calpha[], const Atom_ Centr[],
+			  int Rno, Trimat_ Dista, Sqmat_ Distab,
+			  Trimat_ Distb)
+{
+    register int i, j;
+    double D;
+
+    for (i = 0; i < Rno; i++) {
+	/* Ca-Ca and Centr-Centr distances */
+	for (j = 0; j < i; j++) {
+	    D = atom_dist(Calpha + i, Calpha + j);
+	    Dista[i][j] = D * D;
+	    D = atom_dist(Centr + i, Centr + j);
+	    Distb[i][j] = D * D;
+	}
+
+	/* Ca[i]:Centr[j] distances */
+	for (j = 0; j < Rno; j++) {
+	    D = atom_dist(Calpha + i, Centr + j);
+	    Distab[i][j] = D * D;
+	}
+    }
+}
+
+/* END of make_distmats */
+
+/* betacone_shield: calculates the local shieldedness values for 
+ * each sidechain centroid and puts them into Relshb[]. 
+ * This is the "traditional" algorithm. For the k-th
+ * point, all points which are closer than NBRADIUS are
+ * selected, their distances from their common local centroid
+ * is calculated and the angle of the smallest cone that encompasses the
+ * whole set and centred on 'k' with an axis going through
+ * the centroid is determined.
+ */
+#define NBRADIUS (8.0)
+#define NBRADIUS2 NBRADIUS*NBRADIUS
+static void betacone_shield(const Trimat_ Dista, const Sqmat_ Distab,
+			    const Trimat_ Distb, float Relshb[], int Rno)
+{
+    register int i, j, k, ci, cj, Closeno;
+    double *Di0, *Dik;
+    int *Close;
+    register double Ang, Largang, D, Trisum, Isum, Rsh;
+
+    /* init storage for distances and indices of "close" points,
+     * The "canonical ordering"
+     * here is that 0..Rno-1 contains the BETAs, and Rno..2*Rno-1
+     * the ALPHAs. This way the three dist matrices can be joined
+     * into one big overall distmat without any clumsy indexing
+     * tricks. Re-allocated every time (->static in DRAGON)
+     */
+    Di0 = (double *) calloc(2 * Rno, sizeof(double));	/* centroid dist sq */
+    assert(Di0);
+    Dik = (double *) calloc(2 * Rno, sizeof(double));	/* i-k dist sq */
+    assert(Dik);
+    Close = (int *) calloc(2 * Rno, sizeof(int));	/* index lookup */
+    assert(Close);
+
+    /* scan all sidechain ("beta") points */
+    for (k = 0; k < Rno; k++) {
+	/* select close points: an index < Rno means the index-th beta,
+	 * index>=Rno means the (index-Rno)-th alpha
+	 */
+	Trisum = 0.0;
+	for (Closeno = 0, i = 0; i < 2 * Rno; i++) {
+	    if (i < Rno)	/* beta-beta */
+		D = (i > k) ? Distb[i][k] : Distb[k][i];
+	    else		/* beta-alpha */
+		D = Distab[i - Rno][k];
+	    if (D > NBRADIUS2)
+		continue;	/* too far away from k */
+	    Close[Closeno] = i;	/* store index */
+	    Dik[Closeno++] = D;	/* store D(i,k)^2 */
+	    Trisum += D;	/* start summing for local centroid */
+	}
+
+	if (Closeno <= 1) {	/* too few points, make it very exposed */
+	    Relshb[k] = -1.0;
+	    continue;
+	}
+
+	/* calc the distances from the local centroid using
+	 * Lagrange's Theorem. The first step is to sum all
+	 * interpoint distances: the i-k distances were done
+	 * in the previous cycle. Note that if i<j then
+	 * Close[i]<Close[j]
+	 */
+	for (i = 0; i < Closeno; i++)
+	    for (j = 0; j < i; j++) {
+		ci = Close[i];
+		cj = Close[j];
+		if (ci < Rno && cj < Rno)	/* beta-beta */
+		    D = (ci > cj) ? Distb[ci][cj] : Distb[cj][ci];
+		else if (ci < Rno && cj >= Rno)
+		    D = Distab[cj - Rno][ci];
+		else if (ci >= Rno && cj < Rno)
+		    D = Distab[ci - Rno][cj];
+		else {		/* alpha-alpha */
+
+		    ci -= Rno;
+		    cj -= Rno;
+		    D = (ci > cj) ? Dista[ci][cj] : Dista[cj][ci];
+		}
+		Trisum += D;
+	    }
+	Trisum /= (Closeno + 1) * (Closeno + 1);
+
+	/* now get squared distances for the i-th point
+	 * from the centroid. If the local dist set is
+	 * non-metric enough then this dist may be negative;
+	 * cheat by taking the abs value
+	 */
+	for (i = 0; i < Closeno; i++) {
+	    Isum = Dik[i];
+	    ci = Close[i];
+	    for (j = 0; j < Closeno; j++) {
+		cj = Close[j];
+		if (ci < Rno && cj < Rno)	/* beta-beta */
+		    D = (ci > cj) ? Distb[ci][cj] : Distb[cj][ci];
+		else if (ci < Rno && cj >= Rno)
+		    D = Distab[cj - Rno][ci];
+		else if (ci >= Rno && cj < Rno)
+		    D = Distab[ci - Rno][cj];
+		else {		/* alpha-alpha */
+
+		    ci -= Rno;
+		    cj -= Rno;
+		    D = (ci > cj) ? Dista[ci][cj] : Dista[cj][ci];
+		    ci += Rno;	/* restore */
+		}
+		Isum += D;
+	    }
+	    Di0[i] = fabs(Isum / (Closeno + 1) - Trisum);
+	}
+
+	/* get the dist of the k-th point from the centroid
+	 * in the same way and put into D
+	 */
+	D = 0.0;
+	for (i = 0; i < Closeno; i++)
+	    D += Dik[i];
+	D = fabs(D / (Closeno + 1) - Trisum);
+
+	/* calc angle using the Cosine Rule for each entry in
+	 * Close[] and determine the maximum
+	 */
+	Largang = -1000.0;
+	for (i = 0; i < Closeno; i++) {	/* scan all angles */
+	    Ang = acos((Dik[i] + D - Di0[i]) / (2.0 * sqrt(D * Dik[i])));
+	    if (Ang > Largang)
+		Largang = Ang;
+	}
+
+	/* save the rel. shield of largest angle for the k-th point */
+	Rsh = (Largang - M_PI_2) / M_PI_2;
+	if (fabs(Rsh) > 1.0) {
+	    fprintf(stderr, "? betacone_shield(): Relsh=%.2e\n", Rsh);
+	    Rsh = 0.0;		/* cheat again */
+	}
+	Relshb[k] = Rsh;
+    }				/* for k */
+
+    /* cleanup */
+    free(Di0);
+    free(Dik);
+    free(Close);
+}
+
+#undef NBRADIUS2
+#undef NBRADIUS
+/* END of betacone_shield */
+
+/* ==== END OF PROGRAM dsspabcones.c ==== */
diff --git a/src/cones.h b/src/cones.h
new file mode 100644
index 0000000..5871810
--- /dev/null
+++ b/src/cones.h
@@ -0,0 +1,17 @@
+#ifndef CONES_H_
+#define CONES_H_
+
+#include "pdbprot.h"
+/* ---- DEFINITIONS ---- */
+
+#ifndef M_PI_2
+#define M_PI_2		1.57079632679489661923
+#endif
+#define PATHLEN 256
+
+/* ---- PROTOTYPES ---- */
+
+void cones (Pdbentry_ *Entry);
+
+
+#endif /*CONES_H_*/
diff --git a/src/config.h.in b/src/config.h.in
new file mode 100644
index 0000000..c65cd5b
--- /dev/null
+++ b/src/config.h.in
@@ -0,0 +1,81 @@
+/* src/config.h.in.  Generated from configure.ac by autoheader.  */
+
+/* Define to 1 if you have the <float.h> header file. */
+#undef HAVE_FLOAT_H
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the `m' library (-lm). */
+#undef HAVE_LIBM
+
+/* Define to 1 if your system has a GNU libc compatible `malloc' function, and
+   to 0 otherwise. */
+#undef HAVE_MALLOC
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the `pow' function. */
+#undef HAVE_POW
+
+/* Define to 1 if your system has a GNU libc compatible `realloc' function,
+   and to 0 otherwise. */
+#undef HAVE_REALLOC
+
+/* Define to 1 if you have the `sqrt' function. */
+#undef HAVE_SQRT
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Version number of package */
+#undef VERSION
+
+/* Define to rpl_malloc if the replacement function should be used. */
+#undef malloc
+
+/* Define to rpl_realloc if the replacement function should be used. */
+#undef realloc
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+#undef size_t
diff --git a/src/doxygen.cfg b/src/doxygen.cfg
new file mode 100644
index 0000000..f8a1e97
--- /dev/null
+++ b/src/doxygen.cfg
@@ -0,0 +1,1294 @@
+# Doxyfile 1.5.3
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+#       TAG = value [value, ...]
+# For lists items can also be appended using:
+#       TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file that 
+# follow. The default is UTF-8 which is also the encoding used for all text before 
+# the first occurrence of this tag. Doxygen uses libiconv (or the iconv built into 
+# libc) for the transcoding. See http://www.gnu.org/software/libiconv for the list of 
+# possible encodings.
+
+DOXYFILE_ENCODING      = UTF-8
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded 
+# by quotes) that should identify the project.
+
+PROJECT_NAME           = 
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number. 
+# This could be handy for archiving the generated documentation or 
+# if some version control system is used.
+
+PROJECT_NUMBER         = 
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) 
+# base path where the generated documentation will be put. 
+# If a relative path is entered, it will be relative to the location 
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY       = 
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 
+# 4096 sub-directories (in 2 levels) under the output directory of each output 
+# format and will distribute the generated files over these directories. 
+# Enabling this option can be useful when feeding doxygen a huge amount of 
+# source files, where putting all generated files in the same directory would 
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS         = NO
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all 
+# documentation generated by doxygen is written. Doxygen will use this 
+# information to generate all constant output in the proper language. 
+# The default language is English, other supported languages are: 
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, 
+# Croatian, Czech, Danish, Dutch, Finnish, French, German, Greek, Hungarian, 
+# Italian, Japanese, Japanese-en (Japanese with English messages), Korean, 
+# Korean-en, Lithuanian, Norwegian, Polish, Portuguese, Romanian, Russian, 
+# Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian.
+
+OUTPUT_LANGUAGE        = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will 
+# include brief member descriptions after the members that are listed in 
+# the file and class documentation (similar to JavaDoc). 
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC      = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend 
+# the brief description of a member or function before the detailed description. 
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the 
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF           = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator 
+# that is used to form the text in various listings. Each string 
+# in this list, if found as the leading text of the brief description, will be 
+# stripped from the text and the result after processing the whole list, is 
+# used as the annotated text. Otherwise, the brief description is used as-is. 
+# If left blank, the following values are used ("$name" is automatically 
+# replaced with the name of the entity): "The $name class" "The $name widget" 
+# "The $name file" "is" "provides" "specifies" "contains" 
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF       = 
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then 
+# Doxygen will generate a detailed section even if there is only a brief 
+# description.
+
+ALWAYS_DETAILED_SEC    = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all 
+# inherited members of a class in the documentation of that class as if those 
+# members were ordinary class members. Constructors, destructors and assignment 
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB  = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full 
+# path before files name in the file list and in the header files. If set 
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES        = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag 
+# can be used to strip a user-defined part of the path. Stripping is 
+# only done if one of the specified strings matches the left-hand part of 
+# the path. The tag can be used to show relative paths in the file list. 
+# If left blank the directory from which doxygen is run is used as the 
+# path to strip.
+
+STRIP_FROM_PATH        = 
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of 
+# the path mentioned in the documentation of a class, which tells 
+# the reader which header file to include in order to use a class. 
+# If left blank only the name of the header file containing the class 
+# definition is used. Otherwise one should specify the include paths that 
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH    = 
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter 
+# (but less readable) file names. This can be useful is your file systems 
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES            = NO
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen 
+# will interpret the first line (until the first dot) of a JavaDoc-style 
+# comment as the brief description. If set to NO, the JavaDoc 
+# comments will behave just like regular Qt-style comments 
+# (thus requiring an explicit @brief command for a brief description.)
+
+JAVADOC_AUTOBRIEF      = NO
+
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will 
+# interpret the first line (until the first dot) of a Qt-style 
+# comment as the brief description. If set to NO, the comments 
+# will behave just like regular Qt-style comments (thus requiring 
+# an explicit \brief command for a brief description.)
+
+QT_AUTOBRIEF           = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen 
+# treat a multi-line C++ special comment block (i.e. a block of //! or /// 
+# comments) as a brief description. This used to be the default behaviour. 
+# The new default is to treat a multi-line C++ comment block as a detailed 
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the DETAILS_AT_TOP tag is set to YES then Doxygen 
+# will output the detailed description near the top, like JavaDoc.
+# If set to NO, the detailed description appears after the member 
+# documentation.
+
+DETAILS_AT_TOP         = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented 
+# member inherits the documentation from any documented member that it 
+# re-implements.
+
+INHERIT_DOCS           = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce 
+# a new page for each member. If set to NO, the documentation of a member will 
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES  = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab. 
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE               = 8
+
+# This tag can be used to specify a number of aliases that acts 
+# as commands in the documentation. An alias has the form "name=value". 
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to 
+# put the command \sideeffect (or @sideeffect) in the documentation, which 
+# will result in a user-defined paragraph with heading "Side Effects:". 
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES                = 
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C 
+# sources only. Doxygen will then generate output that is more tailored for C. 
+# For instance, some of the names that are used will be different. The list 
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C  = YES
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java 
+# sources only. Doxygen will then generate output that is more tailored for Java. 
+# For instance, namespaces will be presented as packages, qualified scopes 
+# will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA   = NO
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want to 
+# include (a tag file for) the STL sources as input, then you should 
+# set this tag to YES in order to let doxygen match functions declarations and 
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. 
+# func(std::string) {}). This also make the inheritance and collaboration 
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT    = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+
+CPP_CLI_SUPPORT        = NO
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC 
+# tag is set to YES, then doxygen will reuse the documentation of the first 
+# member in the group (if any) for the other members of the group. By default 
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC   = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of 
+# the same type (for instance a group of public functions) to be put as a 
+# subgroup of that type (e.g. under the Public Functions section). Set it to 
+# NO to prevent subgrouping. Alternatively, this can be done per class using 
+# the \nosubgrouping command.
+
+SUBGROUPING            = YES
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in 
+# documentation are documented, even if no documentation was available. 
+# Private class members and static file members will be hidden unless 
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL            = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class 
+# will be included in the documentation.
+
+EXTRACT_PRIVATE        = NO
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file 
+# will be included in the documentation.
+
+EXTRACT_STATIC         = NO
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) 
+# defined locally in source files will be included in the documentation. 
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES  = YES
+
+# This flag is only useful for Objective-C code. When set to YES local 
+# methods, which are defined in the implementation section but not in 
+# the interface are included in the documentation. 
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS  = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be extracted 
+# and appear in the documentation as a namespace called 'anonymous_namespace{file}', 
+# where file will be replaced with the base name of the file that contains the anonymous 
+# namespace. By default anonymous namespace are hidden.
+
+EXTRACT_ANON_NSPACES   = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all 
+# undocumented members of documented classes, files or namespaces. 
+# If set to NO (the default) these members will be included in the 
+# various overviews, but no documentation section is generated. 
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS     = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all 
+# undocumented classes that are normally visible in the class hierarchy. 
+# If set to NO (the default) these classes will be included in the various 
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES     = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all 
+# friend (class|struct|union) declarations. 
+# If set to NO (the default) these declarations will be included in the 
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS  = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any 
+# documentation blocks found inside the body of a function. 
+# If set to NO (the default) these blocks will be appended to the 
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS      = NO
+
+# The INTERNAL_DOCS tag determines if documentation 
+# that is typed after a \internal command is included. If the tag is set 
+# to NO (the default) then the documentation will be excluded. 
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS          = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate 
+# file names in lower-case letters. If set to YES upper-case letters are also 
+# allowed. This is useful if you have classes or files whose names only differ 
+# in case and if your file system supports case sensitive file names. Windows 
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES       = YES
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen 
+# will show members with their full class and namespace scopes in the 
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES       = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen 
+# will put a list of the files that are included by a file in the documentation 
+# of that file.
+
+SHOW_INCLUDE_FILES     = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] 
+# is inserted in the documentation for inline members.
+
+INLINE_INFO            = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen 
+# will sort the (detailed) documentation of file and class members 
+# alphabetically by member name. If set to NO the members will appear in 
+# declaration order.
+
+SORT_MEMBER_DOCS       = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the 
+# brief documentation of file, namespace and class members alphabetically 
+# by member name. If set to NO (the default) the members will appear in 
+# declaration order.
+
+SORT_BRIEF_DOCS        = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be 
+# sorted by fully-qualified names, including namespaces. If set to 
+# NO (the default), the class list will be sorted only by class name, 
+# not including the namespace part. 
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the 
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME     = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or 
+# disable (NO) the todo list. This list is created by putting \todo 
+# commands in the documentation.
+
+GENERATE_TODOLIST      = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or 
+# disable (NO) the test list. This list is created by putting \test 
+# commands in the documentation.
+
+GENERATE_TESTLIST      = YES
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or 
+# disable (NO) the bug list. This list is created by putting \bug 
+# commands in the documentation.
+
+GENERATE_BUGLIST       = YES
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or 
+# disable (NO) the deprecated list. This list is created by putting 
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional 
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS       = 
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines 
+# the initial value of a variable or define consists of for it to appear in 
+# the documentation. If the initializer consists of more lines than specified 
+# here it will be hidden. Use a value of 0 to hide initializers completely. 
+# The appearance of the initializer of individual variables and defines in the 
+# documentation can be controlled using \showinitializer or \hideinitializer 
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES  = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated 
+# at the bottom of the documentation of classes and structs. If set to YES the 
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES        = YES
+
+# If the sources in your project are distributed over multiple directories 
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy 
+# in the documentation. The default is NO.
+
+SHOW_DIRECTORIES       = NO
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that 
+# doxygen should invoke to get the current version for each file (typically from the 
+# version control system). Doxygen will invoke the program by executing (via 
+# popen()) the command <command> <input-file>, where <command> is the value of 
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file 
+# provided by doxygen. Whatever the program writes to standard output 
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER    = 
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated 
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET                  = NO
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are 
+# generated by doxygen. Possible values are YES and NO. If left blank 
+# NO is used.
+
+WARNINGS               = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings 
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will 
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED   = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for 
+# potential errors in the documentation, such as not documenting some 
+# parameters in a documented function, or documenting parameters that 
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR      = YES
+
+# This WARN_NO_PARAMDOC option can be abled to get warnings for 
+# functions that are documented, but have no documentation for their parameters 
+# or return value. If set to NO (the default) doxygen will only warn about 
+# wrong or incomplete parameter documentation, but not about the absence of 
+# documentation.
+
+WARN_NO_PARAMDOC       = NO
+
+# The WARN_FORMAT tag determines the format of the warning messages that 
+# doxygen can produce. The string should contain the $file, $line, and $text 
+# tags, which will be replaced by the file and line number from which the 
+# warning originated and the warning text. Optionally the format may contain 
+# $version, which will be replaced by the version of the file (if it could 
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT            = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning 
+# and error messages should be written. If left blank the output is written 
+# to stderr.
+
+WARN_LOGFILE           = 
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain 
+# documented source files. You may enter file names like "myfile.cpp" or 
+# directories like "/usr/src/myproject". Separate the files or directories 
+# with spaces.
+
+INPUT                  = .
+
+# This tag can be used to specify the character encoding of the source files that 
+# doxygen parses. Internally doxygen uses the UTF-8 encoding, which is also the default 
+# input encoding. Doxygen uses libiconv (or the iconv built into libc) for the transcoding. 
+# See http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+INPUT_ENCODING         = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the 
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
+# and *.h) to filter out the source-files in the directories. If left 
+# blank the following patterns are tested: 
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx 
+# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py
+
+FILE_PATTERNS          = *.c *.h README
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories 
+# should be searched for input files as well. Possible values are YES and NO. 
+# If left blank NO is used.
+
+RECURSIVE              = NO
+
+# The EXCLUDE tag can be used to specify files and/or directories that should 
+# excluded from the INPUT source files. This way you can easily exclude a 
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE                = 
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or 
+# directories that are symbolic links (a Unix filesystem feature) are excluded 
+# from the input.
+
+EXCLUDE_SYMLINKS       = NO
+
+# If the value of the INPUT tag contains directories, you can use the 
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude 
+# certain files from those directories. Note that the wildcards are matched 
+# against the file with absolute path, so to exclude all test directories 
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS       = 
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names 
+# (namespaces, classes, functions, etc.) that should be excluded from the output. 
+# The symbol name can be a fully qualified name, a word, or if the wildcard * is used, 
+# a substring. Examples: ANamespace, AClass, AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS        = 
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or 
+# directories that contain example code fragments that are included (see 
+# the \include command).
+
+EXAMPLE_PATH           = 
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the 
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
+# and *.h) to filter out the source-files in the directories. If left 
+# blank all files are included.
+
+EXAMPLE_PATTERNS       = 
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be 
+# searched for input files to be used with the \include or \dontinclude 
+# commands irrespective of the value of the RECURSIVE tag. 
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE      = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or 
+# directories that contain image that are included in the documentation (see 
+# the \image command).
+
+IMAGE_PATH             = 
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should 
+# invoke to filter for each input file. Doxygen will invoke the filter program 
+# by executing (via popen()) the command <filter> <input-file>, where <filter> 
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an 
+# input file. Doxygen will then use the output that the filter program writes 
+# to standard output.  If FILTER_PATTERNS is specified, this tag will be 
+# ignored.
+
+INPUT_FILTER           = 
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern 
+# basis.  Doxygen will compare the file name with each pattern and apply the 
+# filter if there is a match.  The filters are a list of the form: 
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further 
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER 
+# is applied to all files.
+
+FILTER_PATTERNS        = 
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using 
+# INPUT_FILTER) will be used to filter the input files when producing source 
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES    = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will 
+# be generated. Documented entities will be cross-referenced with these sources. 
+# Note: To get rid of all source code in the generated output, make sure also 
+# VERBATIM_HEADERS is set to NO. If you have enabled CALL_GRAPH or CALLER_GRAPH 
+# then you must also enable this option. If you don't then doxygen will produce 
+# a warning and turn it on anyway
+
+SOURCE_BROWSER         = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body 
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES         = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct 
+# doxygen to hide any special comment blocks from generated source code 
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS    = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES (the default) 
+# then for each documented function all documented 
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = YES
+
+# If the REFERENCES_RELATION tag is set to YES (the default) 
+# then for each documented function all documented entities 
+# called/used by that function will be listed.
+
+REFERENCES_RELATION    = YES
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code.  Otherwise they will link to the documentstion.
+
+REFERENCES_LINK_SOURCE = YES
+
+# If the USE_HTAGS tag is set to YES then the references to source code 
+# will point to the HTML generated by the htags(1) tool instead of doxygen 
+# built-in source browser. The htags tool is part of GNU's global source 
+# tagging system (see http://www.gnu.org/software/global/global.html). You 
+# will need version 4.8.6 or higher.
+
+USE_HTAGS              = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen 
+# will generate a verbatim copy of the header file for each class for 
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS       = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index 
+# of all compounds will be generated. Enable this if the project 
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX     = NO
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then 
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns 
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX    = 5
+
+# In case all classes in a project start with a common prefix, all 
+# classes will be put under the same header in the alphabetical index. 
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that 
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX          = 
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will 
+# generate HTML output.
+
+GENERATE_HTML          = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT            = ../doc/html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for 
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank 
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION    = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for 
+# each generated HTML page. If it is left blank doxygen will generate a 
+# standard header.
+
+HTML_HEADER            = 
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for 
+# each generated HTML page. If it is left blank doxygen will generate a 
+# standard footer.
+
+HTML_FOOTER            = 
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading 
+# style sheet that is used by each HTML page. It can be used to 
+# fine-tune the look of the HTML output. If the tag is left blank doxygen 
+# will generate a default style sheet. Note that doxygen will try to copy 
+# the style sheet file to the HTML output directory, so don't put your own 
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET        = 
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, 
+# files or namespaces will be aligned in HTML using tables. If set to 
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS     = YES
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files 
+# will be generated that can be used as input for tools like the 
+# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) 
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP      = NO
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML 
+# documentation will contain sections that can be hidden and shown after the 
+# page has loaded. For this to work a browser that supports 
+# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox 
+# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
+
+HTML_DYNAMIC_SECTIONS  = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can 
+# be used to specify the file name of the resulting .chm file. You 
+# can add a path in front of the file if the result should not be 
+# written to the html output directory.
+
+CHM_FILE               = 
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can 
+# be used to specify the location (absolute path including file name) of 
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run 
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION           = 
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag 
+# controls if a separate .chi index file is generated (YES) or that 
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI           = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag 
+# controls whether a binary table of contents is generated (YES) or a 
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC             = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members 
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND             = NO
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at 
+# top of each HTML page. The value NO (the default) enables the index and 
+# the value YES disables it.
+
+DISABLE_INDEX          = NO
+
+# This tag can be used to set the number of enum values (range [1..20]) 
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE   = 4
+
+# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be
+# generated containing a tree-like index structure (just like the one that 
+# is generated for HTML Help). For this to work a browser that supports 
+# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, 
+# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are 
+# probably better off using the HTML help feature.
+
+GENERATE_TREEVIEW      = NO
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be 
+# used to set the initial width (in pixels) of the frame in which the tree 
+# is shown.
+
+TREEVIEW_WIDTH         = 250
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will 
+# generate Latex output.
+
+GENERATE_LATEX         = YES
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT           = ../doc/latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be 
+# invoked. If left blank `latex' will be used as the default command name.
+
+LATEX_CMD_NAME         = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to 
+# generate index for LaTeX. If left blank `makeindex' will be used as the 
+# default command name.
+
+MAKEINDEX_CMD_NAME     = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact 
+# LaTeX documents. This may be useful for small projects and may help to 
+# save some trees in general.
+
+COMPACT_LATEX          = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used 
+# by the printer. Possible values are: a4, a4wide, letter, legal and 
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE             = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX 
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES         = 
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for 
+# the generated latex document. The header should contain everything until 
+# the first chapter. If it is left blank doxygen will generate a 
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER           = 
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated 
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will 
+# contain links (just like the HTML output) instead of page references 
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS         = NO
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of 
+# plain latex in the generated Makefile. Set this option to YES to get a 
+# higher quality PDF documentation.
+
+USE_PDFLATEX           = NO
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. 
+# command to the generated LaTeX files. This will instruct LaTeX to keep 
+# running if errors occur, instead of asking the user for help. 
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE        = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not 
+# include the index chapters (such as File Index, Compound Index, etc.) 
+# in the output.
+
+LATEX_HIDE_INDICES     = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output 
+# The RTF output is optimized for Word 97 and may not look very pretty with 
+# other RTF readers or editors.
+
+GENERATE_RTF           = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT             = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact 
+# RTF documents. This may be useful for small projects and may help to 
+# save some trees in general.
+
+COMPACT_RTF            = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated 
+# will contain hyperlink fields. The RTF file will 
+# contain links (just like the HTML output) instead of page references. 
+# This makes the output suitable for online browsing using WORD or other 
+# programs which support those fields. 
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS         = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's 
+# config file, i.e. a series of assignments. You only have to provide 
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE    = 
+
+# Set optional variables used in the generation of an rtf document. 
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE    = 
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will 
+# generate man pages
+
+GENERATE_MAN           = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT             = man
+
+# The MAN_EXTENSION tag determines the extension that is added to 
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION          = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output, 
+# then it will generate one additional man file for each entity 
+# documented in the real man page(s). These additional files 
+# only source the real man page, but without them the man command 
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS              = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will 
+# generate an XML file that captures the structure of 
+# the code including all documentation.
+
+GENERATE_XML           = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT             = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema, 
+# which can be used by a validating XML parser to check the 
+# syntax of the XML files.
+
+XML_SCHEMA             = 
+
+# The XML_DTD tag can be used to specify an XML DTD, 
+# which can be used by a validating XML parser to check the 
+# syntax of the XML files.
+
+XML_DTD                = 
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will 
+# dump the program listings (including syntax highlighting 
+# and cross-referencing information) to the XML output. Note that 
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING     = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will 
+# generate an AutoGen Definitions (see autogen.sf.net) file 
+# that captures the structure of the code including all 
+# documentation. Note that this feature is still experimental 
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF   = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will 
+# generate a Perl module file that captures the structure of 
+# the code including all documentation. Note that this 
+# feature is still experimental and incomplete at the 
+# moment.
+
+GENERATE_PERLMOD       = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate 
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able 
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX          = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be 
+# nicely formatted so it can be parsed by a human reader.  This is useful 
+# if you want to understand what is going on.  On the other hand, if this 
+# tag is set to NO the size of the Perl module output will be much smaller 
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY         = YES
+
+# The names of the make variables in the generated doxyrules.make file 
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. 
+# This is useful so different doxyrules.make files included by the same 
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX = 
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor   
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will 
+# evaluate all C-preprocessor directives found in the sources and include 
+# files.
+
+ENABLE_PREPROCESSING   = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro 
+# names in the source code. If set to NO (the default) only conditional 
+# compilation will be performed. Macro expansion can be done in a controlled 
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION        = NO
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES 
+# then the macro expansion is limited to the macros specified with the 
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF     = NO
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files 
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES        = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that 
+# contain include files that are not input files but should be processed by 
+# the preprocessor.
+
+INCLUDE_PATH           = 
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard 
+# patterns (like *.h and *.hpp) to filter out the header-files in the 
+# directories. If left blank, the patterns specified with FILE_PATTERNS will 
+# be used.
+
+INCLUDE_FILE_PATTERNS  = 
+
+# The PREDEFINED tag can be used to specify one or more macro names that 
+# are defined before the preprocessor is started (similar to the -D option of 
+# gcc). The argument of the tag is a list of macros of the form: name 
+# or name=definition (no spaces). If the definition and the = are 
+# omitted =1 is assumed. To prevent a macro definition from being 
+# undefined via #undef or recursively expanded use the := operator 
+# instead of the = operator.
+
+PREDEFINED             = 
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then 
+# this tag can be used to specify a list of macro names that should be expanded. 
+# The macro definition that is found in the sources will be used. 
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED      = 
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then 
+# doxygen's preprocessor will remove all function-like macros that are alone 
+# on a line, have an all uppercase name, and do not end with a semicolon. Such 
+# function macros are typically used for boiler-plate code, and will confuse 
+# the parser if not removed.
+
+SKIP_FUNCTION_MACROS   = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references   
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles. 
+# Optionally an initial location of the external documentation 
+# can be added for each tagfile. The format of a tag file without 
+# this location is as follows: 
+#   TAGFILES = file1 file2 ... 
+# Adding location for the tag files is done as follows: 
+#   TAGFILES = file1=loc1 "file2 = loc2" ... 
+# where "loc1" and "loc2" can be relative or absolute paths or 
+# URLs. If a location is present for each tag, the installdox tool 
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen 
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES               = 
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create 
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE       = 
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed 
+# in the class index. If set to NO only the inherited external classes 
+# will be listed.
+
+ALLEXTERNALS           = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed 
+# in the modules index. If set to NO, only the current project's groups will 
+# be listed.
+
+EXTERNAL_GROUPS        = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script 
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH              = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool   
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will 
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base 
+# or super classes. Setting the tag to NO turns the diagrams off. Note that 
+# this option is superseded by the HAVE_DOT option below. This is only a 
+# fallback. It is recommended to install and use dot, since it yields more 
+# powerful graphs.
+
+CLASS_DIAGRAMS         = YES
+
+# You can define message sequence charts within doxygen comments using the \msc 
+# command. Doxygen will then run the mscgen tool (see http://www.mcternan.me.uk/mscgen/) to 
+# produce the chart and insert it in the documentation. The MSCGEN_PATH tag allows you to 
+# specify the directory where the mscgen tool resides. If left empty the tool is assumed to 
+# be found in the default search path.
+
+MSCGEN_PATH            = 
+
+# If set to YES, the inheritance and collaboration graphs will hide 
+# inheritance and usage relations if the target is undocumented 
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS   = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is 
+# available from the path. This tool is part of Graphviz, a graph visualization 
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section 
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT               = NO
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen 
+# will generate a graph for each documented class showing the direct and 
+# indirect inheritance relations. Setting this tag to YES will force the 
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH            = YES
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen 
+# will generate a graph for each documented class showing the direct and 
+# indirect implementation dependencies (inheritance, containment, and 
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH    = YES
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen 
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS           = YES
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and 
+# collaboration diagrams in a style similar to the OMG's Unified Modeling 
+# Language.
+
+UML_LOOK               = NO
+
+# If set to YES, the inheritance and collaboration graphs will show the 
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS     = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT 
+# tags are set to YES then doxygen will generate a graph for each documented 
+# file showing the direct and indirect include dependencies of the file with 
+# other documented files.
+
+INCLUDE_GRAPH          = YES
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and 
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each 
+# documented header file showing the documented files that directly or 
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH      = YES
+
+# If the CALL_GRAPH, SOURCE_BROWSER and HAVE_DOT tags are set to YES then doxygen will 
+# generate a call dependency graph for every global function or class method. 
+# Note that enabling this option will significantly increase the time of a run. 
+# So in most cases it will be better to enable call graphs for selected 
+# functions only using the \callgraph command.
+
+CALL_GRAPH             = NO
+
+# If the CALLER_GRAPH, SOURCE_BROWSER and HAVE_DOT tags are set to YES then doxygen will 
+# generate a caller dependency graph for every global function or class method. 
+# Note that enabling this option will significantly increase the time of a run. 
+# So in most cases it will be better to enable caller graphs for selected 
+# functions only using the \callergraph command.
+
+CALLER_GRAPH           = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen 
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY    = YES
+
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES 
+# then doxygen will show the dependencies a directory has on other directories 
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH        = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images 
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT       = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be 
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH               = 
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that 
+# contain dot files that are included in the documentation (see the 
+# \dotfile command).
+
+DOTFILE_DIRS           = 
+
+# The MAX_DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of 
+# nodes that will be shown in the graph. If the number of nodes in a graph 
+# becomes larger than this value, doxygen will truncate the graph, which is 
+# visualized by representing a node as a red box. Note that doxygen if the number 
+# of direct children of the root node in a graph is already larger than 
+# MAX_DOT_GRAPH_NOTES then the graph will not be shown at all. Also note 
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+
+DOT_GRAPH_MAX_NODES    = 50
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the 
+# graphs generated by dot. A depth value of 3 means that only nodes reachable 
+# from the root by following a path via at most 3 edges will be shown. Nodes 
+# that lay further from the root node will be omitted. Note that setting this 
+# option to 1 or 2 may greatly reduce the computation time needed for large 
+# code bases. Also note that the size of a graph can be further restricted by 
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+
+MAX_DOT_GRAPH_DEPTH    = 0
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent 
+# background. This is disabled by default, which results in a white background. 
+# Warning: Depending on the platform used, enabling this option may lead to 
+# badly anti-aliased labels on the edges of a graph (i.e. they become hard to 
+# read).
+
+DOT_TRANSPARENT        = NO
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output 
+# files in one run (i.e. multiple -o and -T options on the command line). This 
+# makes dot run faster, but since only newer versions of dot (>1.8.10) 
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS      = NO
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will 
+# generate a legend page explaining the meaning of the various boxes and 
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND        = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will 
+# remove the intermediate dot files that are used to generate 
+# the various graphs.
+
+DOT_CLEANUP            = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine   
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be 
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE           = NO
diff --git a/src/galloc.h b/src/galloc.h
new file mode 100644
index 0000000..108ab0f
--- /dev/null
+++ b/src/galloc.h
@@ -0,0 +1,24 @@
+#ifndef __GALLOC_H__
+#define __GALLOC_H__
+
+/* ==== HEADER galloc.h ==== */
+
+/* General memory allocation macros that make life easier. */
+
+/* ANSI C, IRIX 4.0.5, 28. Jan. 1994. Andris */
+
+/* ---- STANDARD HEADERS ---- */
+
+#include <stdlib.h>
+
+/* ---- MACROS ---- */
+
+#define G_MALLOC(PTR, TYPE) (PTR)=(TYPE*) malloc(sizeof(TYPE))
+#define G_CALLOC(PTR, TYPE, SIZE) (PTR)=(TYPE*) calloc((SIZE), sizeof(TYPE))
+#define G_REALLOC(PTR, TYPE, SIZE) \
+    (PTR)=(TYPE*) realloc((PTR), (SIZE)*sizeof(TYPE))
+
+#define GFREE(PTR) if ((PTR)!=NULL) { free(PTR); (PTR)=NULL; }
+
+/* ==== END OF HEADER galloc.h ==== */
+#endif
diff --git a/src/geom.c b/src/geom.c
new file mode 100644
index 0000000..d8b0637
--- /dev/null
+++ b/src/geom.c
@@ -0,0 +1,580 @@
+#include "util.h"
+#include "geom.h"
+#include "sort.h"
+
+
+void vinit(Vec * c)
+{
+    c->x = 0.0;
+    c->y = 0.0;
+    c->z = 0.0;
+}
+
+void vcopy(Vec b, Vec * c)
+{
+    c->x = b.x;
+    c->y = b.y;
+    c->z = b.z;
+}
+
+void vunit(Vec b, Vec * c)
+{
+    float d = DIST3v((b));
+    c->x = b.x / d;
+    c->y = b.y / d;
+    c->z = b.z / d;
+}
+
+void vnorm(Vec * c)
+{
+    float d = DIST3v((*c));
+    c->x = c->x / d;
+    c->y = c->y / d;
+    c->z = c->z / d;
+}
+
+void vave(Vec a, Vec b, Vec * c)
+{
+    c->x = 0.5 * (a.x + b.x);
+    c->y = 0.5 * (a.y + b.y);
+    c->z = 0.5 * (a.z + b.z);
+}
+
+void vsum(Vec a, Vec * c)
+{
+    c->x += a.x;
+    c->y += a.y;
+    c->z += a.z;
+}
+
+void vadd(Vec a, Vec b, Vec * c)
+{
+    c->x = a.x + b.x;
+    c->y = a.y + b.y;
+    c->z = a.z + b.z;
+}
+
+void vsub(Vec a, Vec b, Vec * c)
+{
+    c->x = a.x - b.x;
+    c->y = a.y - b.y;
+    c->z = a.z - b.z;
+}
+
+void vmul(Vec * c, float s)
+{
+    c->x = (c->x) * s;
+    c->y = (c->y) * s;
+    c->z = (c->z) * s;
+}
+
+void vdiv(Vec * c, float s)
+{
+    c->x = (c->x) / s;
+    c->y = (c->y) / s;
+    c->z = (c->z) / s;
+}
+
+float vdif(Vec a, Vec b)
+{
+    Vec c;
+    c.x = a.x - b.x;
+    c.y = a.y - b.y;
+    c.z = a.z - b.z;
+    return sqrt(c.x * c.x + c.y * c.y + c.z * c.z);
+}
+
+float vddif(Vec a, Vec b)
+{
+    Vec c;
+    c.x = a.x - b.x;
+    c.y = a.y - b.y;
+    c.z = a.z - b.z;
+    return (c.x * c.x + c.y * c.y + c.z * c.z);
+}
+
+float vdad(Vec a, Vec b)
+{
+    Vec c;
+    c.x = a.x + b.x;
+    c.y = a.y + b.y;
+    c.z = a.z + b.z;
+    return sqrt(c.x * c.x + c.y * c.y + c.z * c.z);
+}
+
+float vddad(Vec a, Vec b)
+{
+    Vec c;
+    c.x = a.x + b.x;
+    c.y = a.y + b.y;
+    c.z = a.z + b.z;
+    return (c.x * c.x + c.y * c.y + c.z * c.z);
+}
+
+float vsqr(Vec a)
+{
+    return (a.x * a.x + a.y * a.y + a.z * a.z);
+}
+
+float vmod(Vec a)
+{
+    return sqrt(a.x * a.x + a.y * a.y + a.z * a.z);
+}
+
+float vdot(Vec a, Vec b)
+{
+    return (a.x * b.x + a.y * b.y + a.z * b.z);
+}
+
+void vprod(Vec a, Vec b, Vec * c)
+{
+    c->x = a.y * b.z - b.y * a.z;
+    c->y = a.z * b.x - b.z * a.x;
+    c->z = a.x * b.y - b.x * a.y;
+}
+
+float vtri(Vec a, Vec b, Vec c)
+{
+    Vec d;
+    vprod(a, b, &d);
+    return vdot(c, d);
+}
+
+float pdotp(Vec a, Vec b, Vec c, Vec d)
+{
+    Vec x, y;
+    vsub(b, a, &x);
+    vsub(d, c, &y);
+    return vdot(x, y);
+}
+
+float pvol(Vec a, Vec b, Vec c, Vec d)
+{
+    Vec x, y, z;
+    vsub(b, a, &x);
+    vsub(d, c, &y);
+    vsub(c, b, &z);
+    return vtri(x, y, z);
+}
+
+float phand(Vec a, Vec b, Vec c, Vec d)
+{
+    Vec x, y, z;
+    vsub(b, a, &x);
+    vsub(d, c, &y);
+    vsub(c, b, &z);
+    vnorm(&z);
+    return vtri(x, y, z);
+}
+
+void VtoM(Vec a, Vec b, Vec c, Mat * M)
+{
+    M->A.x = a.x;
+    M->A.y = a.y;
+    M->A.z = a.z;
+    M->B.x = b.x;
+    M->B.y = b.y;
+    M->B.z = b.z;
+    M->C.x = c.x;
+    M->C.y = c.y;
+    M->C.z = c.z;
+}
+
+void Mprint(Mat * m)
+{
+    Mat M = *m;
+    printf("\n");
+    printf("%9.4f %9.4f %9.4f\n", M.A.x, M.A.y, M.A.z);
+    printf("%9.4f %9.4f %9.4f\n", M.B.x, M.B.y, M.B.z);
+    printf("%9.4f %9.4f %9.4f\n", M.C.x, M.C.y, M.C.z);
+    printf("\n");
+}
+
+void MmulM(Mat * p, Mat * q, Mat * R)
+{
+    Mat P = *p, Q = *q;
+    Vec a = P.A, b = P.B, c = P.C;
+    Vec A = Q.A, B = Q.B, C = Q.C;
+
+    R->A.x = a.x * A.x + b.x * A.y + c.x * A.z;
+    R->B.x = a.x * B.x + b.x * B.y + c.x * B.z;
+    R->C.x = a.x * C.x + b.x * C.y + c.x * C.z;
+
+    R->A.y = a.y * A.x + b.y * A.y + c.y * A.z;
+    R->B.y = a.y * B.x + b.y * B.y + c.y * B.z;
+    R->C.y = a.y * C.x + b.y * C.y + c.y * C.z;
+
+    R->A.z = a.z * A.x + b.z * A.y + c.z * A.z;
+    R->B.z = a.z * B.x + b.z * B.y + c.z * B.z;
+    R->C.z = a.z * C.x + b.z * C.y + c.z * C.z;
+}
+
+void Minv(Mat * m, Mat * W, float d)
+{
+    Mat M = *m;
+    Vec a = M.A, b = M.B, c = M.C;
+
+    W->A.x = (b.y * c.z - b.z * c.y) / d;
+    W->A.y = -(a.y * c.z - a.z * c.y) / d;
+    W->A.z = (a.y * b.z - a.z * b.y) / d;
+
+    W->B.x = -(b.x * c.z - b.z * c.x) / d;
+    W->B.y = (a.x * c.z - a.z * c.x) / d;
+    W->B.z = -(a.x * b.z - a.z * b.x) / d;
+
+    W->C.x = (b.x * c.y - b.y * c.x) / d;
+    W->C.y = -(a.x * c.y - a.y * c.x) / d;
+    W->C.z = (a.x * b.y - a.y * b.x) / d;
+}
+
+float Mdet(Mat * m)
+{
+    Mat M = *m;
+    Vec a = M.A, b = M.B, c = M.C;
+    return a.x * (b.y * c.z - b.z * c.y)
+	- b.x * (a.y * c.z - a.z * c.y)
+	+ c.x * (a.y * b.z - a.z * b.y);
+}
+
+void MmulV(Mat * m, Vec d, Vec * e)
+{
+    Mat M = *m;
+    Vec a = M.A, b = M.B, c = M.C;
+    e->x = d.x * a.x + d.y * b.x + d.z * c.x;
+    e->y = d.x * a.y + d.y * b.y + d.z * c.y;
+    e->z = d.x * a.z + d.y * b.z + d.z * c.z;
+}
+
+void VmulM(Mat * m, Vec d, Vec * e)
+{
+    Mat M = *m;
+    Vec a = M.A, b = M.B, c = M.C;
+    e->x = d.x * a.x + d.y * a.y + d.z * a.z;
+    e->y = d.x * b.x + d.y * b.y + d.z * b.z;
+    e->z = d.x * c.x + d.y * c.y + d.z * c.z;
+}
+
+int line2tri(Vec a, Vec b, Vec c, Vec d, Vec e)
+{
+/* TRUE if line segment d-e cuts triangle a-b-c */
+    Vec x, y, z;
+    Mat M[1], W[1];
+    float det;
+    vsub(b, a, &x);
+    vsub(c, a, &y);
+    vsub(d, e, &z);
+    VtoM(x, y, z, M);
+    det = Mdet(M);
+    if (fabs(det) < 0.000001)
+	return 0;
+    Minv(M, W, det);
+    vsub(d, a, &d);
+    MmulV(W, d, &e);
+    if (e.x < 0.0)
+	return 0;
+    if (e.y < 0.0)
+	return 0;
+    if (e.z < 0.0)
+	return 0;
+    if (e.z > 1.0)
+	return 0;
+    if (e.x + e.y > 1.0)
+	return 0;
+    return 1;
+}
+
+int line2line(Vec a, Vec b, Vec c, Vec d, float s)
+{
+/* true if line segments a-b and d-e are closer than s */
+    Vec x, y, z;
+    Mat M[1], W[1];
+    float det;
+    Vec e;
+    vsub(b, a, &x);
+    vsub(d, c, &y);
+    vprod(x, y, &z);
+    vnorm(&z);
+    VtoM(x, y, z, M);
+    det = Mdet(M);
+    Minv(M, W, det);
+    vsub(d, a, &d);
+    MmulV(W, d, &e);
+    if (e.x < 0.0)
+	return 0;
+    if (e.y < 0.0)
+	return 0;
+    if (e.x > 1.0)
+	return 0;
+    if (e.y > 1.0)
+	return 0;
+    if (e.z > s)
+	return 0;
+    if (e.z < -s)
+	return 0;
+    return 1;
+}
+
+float lineOline(Vec a, Vec b, Vec c, Vec d, Vec * box)
+{
+/* return overlap length for line segments a-b and c-d */
+    Vec x, y, z;
+    Mat M[1], W[1];
+    float lap, det, aa, ga, gb, hc, hd, r, s, t[4];
+    Vec e, f, g, h, pox[4];
+    int i, key[4], ley[4];
+    vcopy(a, box + 0);
+    vcopy(b, box + 1);
+    vcopy(c, box + 2);
+    vcopy(d, box + 3);
+    vsub(b, a, &x);
+    vnorm(&x);
+    vsub(d, c, &y);
+    vnorm(&y);
+    vprod(x, y, &z);
+    vnorm(&z);
+    if (vdot(x, y) < 0.0001) {
+	vcopy(x, &e);
+	vmul(&e, 0.0001);
+	vsub(c, e, &c);
+	vadd(d, e, &d);
+	vsub(d, c, &y);
+	vnorm(&y);
+    }
+    VtoM(x, y, z, M);
+    det = Mdet(M);
+    Minv(M, W, det);
+    vsub(d, a, &e);
+    MmulV(W, e, &f);
+    vmul(&x, f.x);
+    vadd(a, x, &g);		/* g = top of mut.perp. line */
+    vmul(&y, f.y);
+    vsub(d, y, &h);		/* h = bot of mut.perp. line */
+    ga = vdif(g, a);
+    gb = vdif(g, b);
+    hc = vdif(h, c);
+    hd = vdif(h, d);
+    vsub(a, g, &a);
+    vsub(b, g, &b);
+    vsub(c, h, &c);
+    vsub(d, h, &d);
+    aa = vsqr(a);
+    r = vdot(a, c) / aa;
+    s = vdot(a, d) / aa;
+    if (vdot(a, b) < 0.0)
+	gb = -gb;
+    if (r < 0.0)
+	hc = -hc;
+    if (s < 0.0)
+	hd = -hd;
+    t[0] = ga;
+    t[1] = gb;
+    t[2] = hc;
+    t[3] = hd;
+    sort(0, t, 0, key, 4, 1);
+    for (i = 0; i < 4; i++)
+	if (key[i] < 2)
+	    ley[i] = 0;
+	else
+	    ley[i] = 1;
+    if (ley[0] == ley[1])
+	return 0.0;
+    lap = fabs(t[key[1]] - t[key[2]]);
+    if (box) {
+	int ke1 = key[1], ke2 = key[2], le1 = ley[1], le2 = ley[2];
+	Vec tmp1, tmp2, tmp;
+	if (ga > gb)
+	    vsub(box[0], box[1], &x);
+	else
+	    vsub(box[1], box[0], &x);
+	if (hc > hd)
+	    vsub(box[2], box[3], &y);
+	else
+	    vsub(box[3], box[2], &y);
+	vnorm(&x);
+	vnorm(&y);
+	vcopy(box[ke1], &tmp1);
+	vcopy(box[ke2], &tmp2);
+	vcopy(tmp1, box + 0);
+	if (le1 == le2) {	/* contained */
+	    vcopy(tmp2, box + 1);
+	    if (le2 == 0) {
+		vcopy(y, &tmp);
+		vmul(&tmp, t[ke2]);
+		vadd(h, tmp, box + 3);
+	    } else {
+		vcopy(x, &tmp);
+		vmul(&tmp, t[ke2]);
+		vadd(g, tmp, box + 3);
+	    }
+	} else {		/* staggered */
+	    vcopy(tmp2, box + 3);
+	    if (le2 == 0) {
+		vcopy(y, &tmp);
+		vmul(&tmp, t[ke2]);
+		vadd(h, tmp, box + 1);
+	    } else {
+		vcopy(x, &tmp);
+		vmul(&tmp, t[ke2]);
+		vadd(g, tmp, box + 1);
+	    }
+	}
+	if (le1 == 0) {
+	    vcopy(y, &tmp);
+	    vmul(&tmp, t[ke1]);
+	    vadd(h, tmp, box + 2);
+	} else {
+	    vcopy(x, &tmp);
+	    vmul(&tmp, t[ke1]);
+	    vadd(g, tmp, box + 2);
+	}
+    }
+    /* restore ab cd line order in box (but box lines run parallel */
+    if (ley[1]) {
+	pox[0] = box[2];
+	pox[1] = box[3];
+	pox[2] = box[0];
+	pox[3] = box[1];
+	for (i = 0; i < 4; i++)
+	    box[i] = pox[i];
+    }
+    return lap;
+}
+
+int line2dot(Vec a, Vec b, Vec c, float s)
+{
+/* TRUE if c lies over line segment a-b closer than s */
+    Vec p, q;
+    float d;
+    vsub(b, a, &p);
+    vsub(c, a, &q);
+    d = vdot(p, q) / vsqr(p);
+    if (d < 0.0 || d > 1.0)
+	return 0;
+    vmul(&p, d);
+    vsub(q, p, &q);
+    d = vsqr(q);
+    if (d > s * s)
+	return 0;
+    return 1;
+}
+
+float dotOline(Vec a, Vec b, Vec c, Vec * e)
+{
+/* returns distance of c to an extended line a-b and image of c on a-b in e */
+    Vec p, q;
+    float d;
+    vsub(b, a, &p);
+    vsub(c, a, &q);
+    d = vdot(p, q) / vsqr(p);
+    vmul(&p, d);
+    vsub(q, p, &q);
+    d = vsqr(q);
+    vadd(a, p, &p);
+    if (e) {
+	e->x = p.x;
+	e->y = p.y;
+	e->z = p.z;
+    }
+    return sqrt(d);
+}
+
+float torsion(Vec a, Vec b, Vec c, Vec d)
+{
+/* returns the torsion angle down b-c */
+    Vec x, y, z, p, q, r;
+    float vol, cos, sin, tor;
+    vsub(a, b, &x);
+    vsub(b, c, &y);
+    vsub(c, d, &z);
+    vprod(x, y, &p);
+    vnorm(&p);
+    vprod(y, z, &q);
+    vnorm(&q);
+    cos = vdot(p, q);
+    vprod(p, q, &r);
+    vol = vtri(p, q, y);
+    sin = vmod(r);
+    if (vol < 0.0)
+	sin = -sin;
+    tor = angle1pi(sin, cos);
+    return tor;
+}
+
+float angle1pi(float s, float c)
+{
+    if (s >= 0.0 && c >= 0.0) {
+	if (s < 0.5)
+	    return asin(s);
+	else
+	    return acos(c);
+    }
+    if (s >= 0.0 && c <= 0.0) {
+	if (s < 0.5)
+	    return PI - asin(s);
+	else
+	    return PI - acos(-c);
+    }
+    if (s <= 0.0 && c <= 0.0) {
+	if (s > -.5)
+	    return asin(-s) - PI;
+	else
+	    return acos(-c) - PI;
+    }
+    if (s <= 0.0 && c >= 0.0) {
+	if (s > -.5)
+	    return -asin(-s);
+	else
+	    return -acos(c);
+    }
+    printf("angle1pi(s,c) out of range: s = %f, c = %f\n", s, c);
+    exit(1);
+}
+
+float angle2pi(float s, float c)
+{
+    if (s >= 0.0 && c >= 0.0) {
+	if (s < 0.5)
+	    return asin(s);
+	else
+	    return acos(c);
+    }
+    if (s >= 0.0 && c <= 0.0) {
+	if (s < 0.5)
+	    return PI - asin(s);
+	else
+	    return PI - acos(-c);
+    }
+    if (s <= 0.0 && c <= 0.0) {
+	if (s > -.5)
+	    return PI + asin(-s);
+	else
+	    return PI + acos(-c);
+    }
+    if (s <= 0.0 && c >= 0.0) {
+	if (s > -.5)
+	    return twoPI - asin(-s);
+	else
+	    return twoPI - acos(c);
+    }
+    printf("angle2pi(s,c) out of range: s = %f, c = %f\n", s, c);
+    exit(1);
+}
+
+float angdif(float a, float b)
+{
+    if (a < 0.0 && b > 0.0) {
+	float d = b - a;
+	if (d < PI)
+	    return d;
+	else
+	    return twoPI - d;
+    }
+    if (a > 0.0 && b < 0.0) {
+	float d = a - b;
+	if (d < PI)
+	    return d;
+	else
+	    return twoPI - d;
+    }
+    return fabs(a - b);
+}
diff --git a/src/geom.h b/src/geom.h
new file mode 100644
index 0000000..652ac0e
--- /dev/null
+++ b/src/geom.h
@@ -0,0 +1,55 @@
+#ifndef __WT_GEOM_H__
+#define __WT_GEOM_H__
+
+#define PI 3.14159265358979323846
+#define twoPI PI+PI
+
+/*      STRUCTURES FOR 3D GEOMETRY      */
+
+typedef struct { float x, y, z; } Vec;
+typedef struct { Vec A, B, C; } Mat;
+
+
+
+
+void vinit (Vec *c);
+void vcopy (Vec b, Vec *c);
+void vunit (Vec b, Vec *c);
+void vnorm (Vec *c);
+void vave (Vec a, Vec b, Vec *c);
+void vsum (Vec a, Vec *c);
+void vadd (Vec a, Vec b, Vec *c);
+void vsub (Vec a, Vec b, Vec *c);
+void vmul (Vec *c, float s);
+void vdiv (Vec *c, float s);
+float	vdif (Vec a, Vec b);
+float	vddif (Vec a, Vec b);
+float	vdad (Vec a, Vec b);
+float	vddad (Vec a, Vec b);
+float	vsqr (Vec a);
+float	vmod (Vec a);
+float	vdot (Vec a, Vec b);
+void vprod (Vec a, Vec b, Vec *c);
+float	vtri (Vec a, Vec b, Vec c);
+float	pdotp (Vec a, Vec b, Vec c, Vec d);
+float	pvol (Vec a, Vec b, Vec c, Vec d);
+float	phand (Vec a, Vec b, Vec c, Vec d);
+void VtoM (Vec a, Vec b,Vec c,Mat *M);
+void Mprint (Mat *m);
+void MmulM (Mat *p,Mat *q,Mat *R);
+void Minv (Mat *m, Mat *W, float d);
+float Mdet (Mat *m);
+void MmulV (Mat *m, Vec d,Vec *e);
+void VmulM (Mat *m, Vec d, Vec *e); 
+int line2tri (Vec a, Vec b, Vec c, Vec d, Vec e); 
+int line2line (Vec a, Vec b, Vec c, Vec d,float s);
+float lineOline (Vec a, Vec b, Vec c,Vec d, Vec *box);
+int line2dot (Vec a, Vec b,Vec c, float s); 
+float dotOline (Vec a, Vec b, Vec c, Vec *e);
+float torsion (Vec a, Vec b, Vec c, Vec d);
+float	angle1pi (float s,float c);
+float	angle2pi (float s, float c);
+float angdif (float a, float b);
+
+#endif
+
diff --git a/src/matrix.c b/src/matrix.c
new file mode 100644
index 0000000..24254a9
--- /dev/null
+++ b/src/matrix.c
@@ -0,0 +1,390 @@
+/* ==== FUNCTIONS matrix.c ==== */
+
+/* Routine collection for square and lower triangle matrices: the latter
+ are stored economically. */
+
+/* ANSI C, IRIX 5.2, 5. Aug 1994. Andris Aszodi */
+
+/* ---- HEADER ---- */
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <limits.h>		/* for precision stuff */
+#include <float.h>
+#include <math.h>
+#include <assert.h>
+#include "matrix.h"
+
+/* ---- DEFINITIONS ---- */
+
+#ifdef FLT_MIN
+#define LU_EPSILON (10.0*FLT_MIN)
+#else
+#define LU_EPSILON (1.0e-30)
+#endif
+
+/* ==== FUNCTIONS ==== */
+
+/* ---- LOWER TRIANGLE MATRICES ---- */
+
+/* alloc_trimat: allocates space for a triangular matrix with Size rows.
+ The triangle contains the main diagonal as well. 
+ Returns the pointer to the matrix or NULL if alloc failed. */
+
+extern Trimat_ alloc_trimat(int Size)
+{
+    Trimat_ Mat;
+    int i;
+
+    Mat = (double **) calloc(Size, sizeof(double *));
+    if (Mat != NULL)
+	for (i = 0; i < Size; i++) {
+	    Mat[i] = (double *) calloc(i + 1, sizeof(double));
+	    if (Mat[i] == NULL) {	/* clean up already allocated rows */
+		free_matrix(Mat, i);
+		return (NULL);
+	    }
+	}
+    return (Mat);
+}
+
+/* END of alloc_trimat */
+
+/* free_matrix: frees up space occupied by Mat. The same routine for
+ triangular and square matrices. */
+
+extern void free_matrix(double **Mat, int Size)
+{
+    int i;
+
+    for (i = Size - 1; i >= 0; i--)	/* dealloc in reverse order */
+	free(Mat[i]);
+    free(Mat);
+}
+
+/* END of free_matrix */
+
+/* list_trimat: lists Mat to stdout with entries occupying Width chars,
+ Prec digits precision. If a row takes up more than Linewidth chars,
+ then the matrix is cut up nicely. */
+
+extern void list_trimat(Trimat_ Mat, int Size, int Linewidth,
+			int Width, int Prec)
+{
+    char Entrys[10], Cols[8], Rows[8];	/* format strings and len determ */
+    int i, j, k, Sizew, Chunk, Jbeg, Items, Ulinelen;
+
+    sprintf(Cols, "%d", Size);	/* get printed width of Size */
+    Sizew = strlen(Cols);
+    if (Sizew > Width)
+	Width = Sizew;
+    sprintf(Entrys, "%%-%d.%df ", Width, Prec);	/* make format strs */
+    sprintf(Cols, "%%-%dd ", Width);
+    sprintf(Rows, "%%%dd | ", Sizew);
+    Items = (Linewidth - Sizew - 3) / (Width + 1);	/* columns per chunk */
+
+    /* main cycle: print chunks of the matrix */
+    for (Jbeg = 0, Chunk = (Size - 1) / Items + 1; Chunk > 0;
+	 Jbeg += Items, Chunk--) {
+	/* underline length */
+	Ulinelen = (Chunk > 1) ? Items * (Width + 1) + Sizew + 3 :
+	    (Size - Jbeg) * (Width + 1) + Sizew + 3;
+	/* print head line */
+	for (k = 0; k < Sizew + 3; k++)
+	    putchar(' ');
+	for (j = Jbeg; j < Size && j < Jbeg + Items; j++)
+	    printf(Cols, j);	/* col numbers */
+	putchar('\n');
+	for (k = 0; k < Ulinelen; k++)
+	    putchar('-');
+	putchar('\n');
+
+	/* print chunks for all rows */
+	for (i = 0; i < Size; i++) {
+	    printf(Rows, i);	/* row idx */
+	    for (j = Jbeg; j <= i && j < Jbeg + Items; j++)
+		printf(Entrys, Mat[i][j]);
+	    putchar('\n');
+	}
+
+	/* chunk separator */
+	putchar('\n');
+	for (k = 0; k < Ulinelen; k++)
+	    putchar('=');
+	puts("\n");
+    }
+}
+
+/* END of list_trimat */
+
+/* list_matptr: lists the address of the matrix (i.e. the pointer Mat
+ * itself) and the row pointers (the row array addresses) to 'stderr'.
+ * Provided for debugging purposes.
+ */
+extern void list_matptr(double **Mat, int Rno)
+{
+    int i;
+	void *p;
+
+	p = Mat;
+
+    fprintf(stderr, "Matrix address=%p\n", p);
+    fflush(stderr);
+    for (i = 0; i < Rno; i++) {
+	p = Mat[i];
+	fprintf(stderr, "[%d]=%p\n", i, p);
+	fflush(stderr);
+    }
+}
+
+/* END of list_matptr */
+
+/* ---- SQUARE MATRICES ---- */
+
+/* alloc_sqmat: allocates space for a square matrix (Size*Size).
+ Returns the pointer to the matrix or NULL if alloc failed. */
+
+extern Sqmat_ alloc_sqmat(int Size)
+{
+    Sqmat_ Mat;
+    int i;
+
+    Mat = (double **) calloc(Size, sizeof(double *));
+    if (Mat != NULL)
+	for (i = 0; i < Size; i++) {
+	    Mat[i] = (double *) calloc(Size, sizeof(double));
+	    if (Mat[i] == NULL) {	/* clean up already allocated rows */
+		printf("strange\n");
+		exit(1);
+		free_matrix(Mat, i);
+		return (NULL);
+	    }
+	}
+    return (Mat);
+}
+
+/* END of alloc_sqmat */
+
+/* list_sqmat: lists Mat to stdout with entries occupying Width chars,
+ Prec digits precision. If a row takes up more than Linewidth chars,
+ then the matrix is cut up nicely. */
+
+extern void list_sqmat(Sqmat_ Mat, int Size, int Linewidth,
+		       int Width, int Prec)
+{
+    char Entrys[10], Cols[8], Rows[8];	/* format strings and len determ */
+    int i, j, k, Sizew, Chunk, Jbeg, Items, Ulinelen;
+
+    sprintf(Cols, "%d", Size);	/* get printed width of Size */
+    Sizew = strlen(Cols);
+    if (Sizew > Width)
+	Width = Sizew;
+    sprintf(Entrys, "%%-%d.%df ", Width, Prec);	/* make format strs */
+    sprintf(Cols, "%%-%dd ", Width);
+    sprintf(Rows, "%%%dd | ", Sizew);
+    Items = (Linewidth - Sizew - 3) / (Width + 1);	/* columns per chunk */
+
+    /* main cycle: print chunks of the matrix */
+    for (Jbeg = 0, Chunk = (Size - 1) / Items + 1; Chunk > 0;
+	 Jbeg += Items, Chunk--) {
+	/* underline length */
+	Ulinelen = (Chunk > 1) ? Items * (Width + 1) + Sizew + 3 :
+	    (Size - Jbeg) * (Width + 1) + Sizew + 3;
+	/* print head line */
+	for (k = 0; k < Sizew + 3; k++)
+	    putchar(' ');
+	for (j = Jbeg; j < Size && j < Jbeg + Items; j++)
+	    printf(Cols, j);	/* col numbers */
+	putchar('\n');
+	for (k = 0; k < Ulinelen; k++)
+	    putchar('-');
+	putchar('\n');
+
+	/* print chunks for all rows */
+	for (i = 0; i < Size; i++) {
+	    printf(Rows, i);	/* row idx */
+	    for (j = Jbeg; j < Size && j < Jbeg + Items; j++)
+		printf(Entrys, Mat[i][j]);
+	    putchar('\n');
+	}
+
+	/* chunk separator */
+	putchar('\n');
+	for (k = 0; k < Ulinelen; k++)
+	    putchar('=');
+	puts("\n");
+    }
+}
+
+/* END of list_sqmat */
+
+/* ---- LU-DECOMPOSITION ---- */
+
+/* lu_decomp: performs an LU-decomposition in place on the n*n matrix
+ * A. Based on partial pivoting: the row permutations are done in Perm[]
+ * (allocated within!) and will be used by lu_solve().
+ * If **Perm==NULL, then the permutation vector will be used
+ * internally and will be freed before return. This option is
+ * used when only the determinant is calculated from the LU-decomposition.
+ * Return value: the sign of the determinant of the permutation
+ * matrix (+/-1) or 0 if A is singular or n<=0.
+ */
+int lu_decomp(Sqmat_ A, int n, int **Perm)
+{
+    register int i, j, k, imax = 0;
+    register int Psign = 1;
+    int *Idx = NULL;
+    register double Large, Pivot, Tmp, Tmp2;
+    double *Scal = NULL;
+
+    /* check and array initialisation */
+    if (n <= 0) {
+	fprintf(stderr, "? lu_decomp(): invalid matrix size %d\n", n);
+	if (Perm != NULL)
+	    *Perm = NULL;
+	return (0);
+    }
+    Idx = (int *) calloc(n, sizeof(int));	/* permutation vector */
+    assert(Idx);
+    Scal = (double *) calloc(n, sizeof(double));	/* implicit scaling array */
+    assert(Scal);
+
+    /* get implicit scaling: if a row contains 0-s only,
+     * then the matrix is singular which will be indicated
+     * by setting Psign=0. Precision is controlled by
+     * the constant LU_EPSILON (see Definitions above).
+     */
+    for (i = 0; Psign && i < n; i++) {
+	Large = 0.0;
+	for (j = 0; j < n; j++)
+	    if ((Tmp = fabs(A[i][j])) > Large)
+		Large = Tmp;
+	if (Large < LU_EPSILON) {	/* (almost) singular */
+	    Psign = 0;
+	    break;
+	}
+	Scal[i] = 1.0 / Large;
+    }
+
+    /* loop over columns */
+    for (j = 0; Psign && j < n; j++) {
+	for (i = 0; i < j; i++) {
+	    Tmp = A[i][j];
+	    for (k = 0; k < i; k++)
+		Tmp -= A[i][k] * A[k][j];
+	    A[i][j] = Tmp;
+	}
+
+	/* find largest pivot */
+	Large = 0.0;
+	for (i = j; i < n; i++) {
+	    Tmp = A[i][j];
+	    for (k = 0; k < j; k++)
+		Tmp -= A[i][k] * A[k][j];
+	    A[i][j] = Tmp;
+
+	    if ((Tmp2 = Scal[i] * fabs(Tmp)) >= Large) {	/* best so far */
+		Large = Tmp2;
+		imax = i;
+	    }
+	}
+
+	/* interchange rows? */
+	if (j != imax) {
+	    for (k = 0; k < n; k++) {	/* not too efficient copy */
+		Tmp = A[imax][k];
+		A[imax][k] = A[j][k];
+		A[j][k] = Tmp;
+	    }
+	    Psign *= (-1);	/* parity change */
+	    Scal[imax] = Scal[j];
+	}
+	Idx[j] = imax;
+
+	/* get the pivot */
+	Pivot = A[j][j];
+	if (fabs(Pivot) < LU_EPSILON) {	/* singularity */
+	    Psign = 0;
+	    break;
+	}
+
+	/* divide by the pivot */
+	if (j < n - 1)
+	    for (i = j + 1; i < n; i++)
+		A[i][j] /= Pivot;
+    }				/* for j */
+
+    free(Scal);
+    if (Perm != NULL)
+	*Perm = Idx;
+    else
+	free(Idx);
+    return (Psign);
+}
+
+/* END of lu_decomp */
+
+/* lu_det: calculates the determinant of the n x n LU-decomposed
+ * square matrix Lu. Psign is the permutation sign returned by
+ * lu_decomp().
+ */
+double lu_det(const Sqmat_ Lu, int Psign, int n)
+{
+    register int i;
+    register double Det, Aii;
+
+    if (!Psign)
+	return (0.0);		/* matrix is singular */
+
+    Det = 0.0;
+    for (i = 0; i < n; i++) {
+	if ((Aii = Lu[i][i]) < 0.0)
+	    Psign *= (-1);	/* save sign */
+	Det += log(fabs(Aii));	/* sum logarithms to avoid overflow */
+    }
+    Det = Psign * exp(Det);
+    return (Det);
+}
+
+/* END of lu_det */
+
+/* lu_solve: solves the linear equation A*x=b (A is n*n, x,b are n long).
+ * A is supposed to have been LU-decomposed by lu_decomp() above and
+ * the row permutation is stored in Perm[]. b[] is the "right-hand-side"
+ * vector which contains the solution on return.
+ */
+void lu_solve(const Sqmat_ A, const int Perm[], double b[], int n)
+{
+    register int i, j, ip;
+    register double Tmp;
+
+    /* permute forward */
+    for (i = 0; i < n - 1; i++)
+	if ((ip = Perm[i]) != i) {
+	    Tmp = b[ip];
+	    b[ip] = b[i];
+	    b[i] = Tmp;
+	}
+
+    /* forward substitution */
+    for (i = 0; i < n; i++) {
+	Tmp = b[i];
+	for (j = 0; j < i; j++)
+	    Tmp -= A[i][j] * b[j];
+	b[i] = Tmp;
+    }
+
+    /* back substitution */
+    for (i = n - 1; i >= 0; i--) {
+	Tmp = b[i];
+	for (j = i + 1; j < n; j++)
+	    Tmp -= A[i][j] * b[j];
+	b[i] = Tmp / A[i][i];
+    }
+}
+
+/* END of lu_solve */
+
+#undef LU_EPSILON
+
+/* ==== END OF FUNCTIONS matrix.c ==== */
diff --git a/src/matrix.h b/src/matrix.h
new file mode 100644
index 0000000..053f213
--- /dev/null
+++ b/src/matrix.h
@@ -0,0 +1,41 @@
+#ifndef __MATRIX_H__
+#define __MATRIX_H__
+
+/* ==== HEADER matrix.h ==== */
+
+/* Header for square and lower triangle matrices: the latter
+ are stored economically. */
+
+/* ANSI C, IRIX 5.2, 5. Aug. 1994. Andris Aszodi */
+
+/* ---- HEADERS ---- */
+
+
+/* ---- GLOBAL TYPES ---- */
+
+/* WARNING: The routines do not check whether the matrix is triangular
+ or square. The typedef's below might help during compilation. */
+
+typedef double **Matrix_ ;	/* general type */
+typedef double **Trimat_ ;	/* triangular */
+typedef double **Sqmat_ ;	/* square */
+
+/* ---- PROTOTYPES ---- */
+
+Trimat_ alloc_trimat(int Size);
+void free_matrix(double **Mat, int Size);
+void list_trimat(Trimat_ Mat, int Size, int Linewidth,
+	int Width, int Prec);
+void list_matptr(double **Mat, int Rno);
+
+Sqmat_ alloc_sqmat(int Size);
+void list_sqmat(Sqmat_ Mat, int Size, int Linewidth,
+	int Width, int Prec);
+
+int lu_decomp(Sqmat_ A, int n, int **Perm);
+double lu_det(const Sqmat_ Lu, int Psign, int n);
+void lu_solve(const Sqmat_ A, const int Perm[], double b[], int n);
+
+/* ==== END OF HEADER matrix.h ==== */
+
+#endif		/* __MATRIX_H__ */
diff --git a/src/pdbprot.c b/src/pdbprot.c
new file mode 100644
index 0000000..7007857
--- /dev/null
+++ b/src/pdbprot.c
@@ -0,0 +1,1117 @@
+/* ==== FUNCTIONS pdbprot.c ==== */
+
+/* Protein Data Bank I/O routines. Replaces "pdb.h" */
+
+/* ANSI C, IRIX 5.3, 21. June 1996. Andris Aszodi */
+
+/* ---- STANDARD HEADERS ---- */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
+#include <assert.h>
+#include <unistd.h>		/* SEEK_SET on Suns */
+
+/* ---- INCLUDE FILES ---- */
+
+#include "pdbprot.h"	/* own header */
+
+/* ---- DEFINITIONS ---- */
+
+#define LINELEN 81		/* line buffer length */
+
+/* ---- ALLOCATION MACROS ---- */
+
+/* The following "general alloc" macros are just shorthand for the
+ * tedious C memory allocation syntax.
+ */
+#define G_MALLOC(PTR, TYPE) (PTR)=(TYPE*) malloc(sizeof(TYPE))
+#define G_CALLOC(PTR, TYPE, SIZE) (PTR)=(TYPE*) calloc((SIZE), sizeof(TYPE))
+#define G_REALLOC(PTR, TYPE, SIZE) \
+    (PTR)=(TYPE*) realloc((PTR), (SIZE)*sizeof(TYPE))
+#define GFREE(PTR) if ((PTR)!=NULL) { free(PTR); (PTR)=NULL; }
+
+/* ---- FILE-SCOPE GLOBALS ---- */
+
+static long Lastpos = 0L;	/* filepos where last good line was found */
+
+/* ---- PROTOTYPES ---- */
+
+static char *atom_seq(const Atom_ Atoms[], int Atomno, int Aano);
+static int ascend_res(const void *Sec1, const void *Sec2);
+static int get_record(FILE * Pdb, char *Line, const char *Label);
+static void print_card(FILE * Pdb, char *Card, const char *Code,
+		       int Linecnt);
+static int secstr_outorder(const void *Ssb1, const void *Ssb2);
+static int ssbond_outorder(const void *Ssb1, const void *Ssb2);
+
+/* ==== FUNCTIONS ==== */
+
+/* aa_code31: converts 3-letter all-uppercase amino acid abbreviations
+ * into 1-char codes. Returns 'X' if it cannot translate Aa3.
+ * In addition to the 20 standard AA-s, the following translations
+ * are accepted:
+ * ALB -> 'A' (beta-alanine)
+ * CYH, CSH, CSS, CYX -> 'C' (cysteine and cystine)
+ * HYP, PR0, PRZ -> 'P' (hydroxyproline and various Pro synonyms)
+ * ILU -> 'I' (isoleucine)
+ * TRY-> 'W' (tryptophan)
+ * UNK -> 'U' (unknown)
+ * any other code is translated to X.
+ */
+char aa_code31(const char *Aa3)
+{
+    static char *Names3 =
+	"ALAALBARGASNASPASXCYSCYHCSHCSSCYXGLNGLUGLXGLYHISILEILULEULYSMETPHEPROPR0PRZHYPSERTHRTRPTRYTYRVALUNKXXX";
+    static char *Letters1 = "AARNDBCCCCCQEZGHIILKMFPPPPSTWWYVUX";
+    char *Code;
+
+    if (strlen(Aa3) < 3)
+	return ('X');		/* 1,2-letter codes not accepted */
+    Code = strstr(Names3, Aa3);
+    if (Code == NULL)
+	return ('X');		/* not found */
+    else
+	return (Letters1[(Code - Names3) / 3]);
+}
+
+/* END of aa_code31 */
+
+/* aa_code13: converts the 1-letter codes to 3-letter standards.
+ * Almost the inverse of aa_code31(). Non-standard translations:
+ * J->JJJ, O->OOO, U->UNK, X->XXX
+ */
+char *aa_code13(char Aa1)
+{
+    static char *Aacode[26] = { "ALA", "ASX", "CYS", "ASP", "GLU", "PHE",
+	"GLY", "HIS", "ILE", "JJJ", "LYS", "LEU",
+	"MET", "ASN", "OOO", "PRO", "GLN", "ARG",
+	"SER", "THR", "UNK", "VAL", "TRP", "XXX",
+	"TYR", "GLX"
+    };
+
+    if (Aa1 < 'A' || Aa1 > 'Z')
+	return (Aacode[23]);	/* 'X' for out-of-range */
+    else
+	return (Aacode[Aa1 - 'A']);
+}
+
+/* END of aa_code13 */
+
+/* ---- PDB INPUT ---- */
+
+/* get_pdb: reads a PDB file called Pdbfn and puts the result
+ * in a Pdbentry_ which is created inside and returned.
+ * If something went wrong then NULL is returned.
+***
+ * If Ca=1 then only the C-alpha atoms are read in without alternate positions;
+ * If Ca=2 then only the C-alpha atoms are read in including alternate positions;
+***
+ * if Strict!=0 then only the 20 standard amino acids are read.
+ */
+#define CHUNK 256
+Pdbentry_ *get_pdb(const char *Pdbfn, int Ca, int Strict)
+{
+    Pdbentry_ *Entry = NULL;	/* the complete PDB entry */
+    FILE *Pdb;
+    Secstr_ *Secs = NULL;	/* temp array for sec. structure elements */
+    Ssbond_ *Ssbs = NULL;	/* temp array for S-S bonds */
+    Chain_ *Chains = NULL;	/* temp array for chains */
+    Atom_ *Atoms = NULL;	/* temp array for atom records */
+    Hbond_ *Hbonds = NULL;	/* non-redundant D->A storage for H-bonds */
+    char Line[LINELEN], Endmdline[LINELEN];	/* read buffers */
+    char *Cptr = NULL;		/* aux. char pointer */
+    char Aa3[4];		/* 3-letter AA code */
+    /* alternative pos, res ID char like in "27A", prev chain ID */
+    char Oldres = ' ';
+    char Oldrid = ' ';
+    char Oldchain, Creatchn = ' ';
+    char Endf, Protein = ' ';
+    char Calpha = ' ';
+    char Thisca, Model, Ter;
+    int i, j, Sno, Atno, Hbno, Ssbno, Partner, Chainno, Lastatno =
+	0, Lowlim, Uplim, At, Don, Acc;
+    int Oldaano = 0;
+    int Aano = 0;
+
+    long Oldlastpos = 0L, Modelpos = 0L, Terpos = 0L;
+
+    /* open PDB file */
+    if (NULL == (Pdb = fopen(Pdbfn, "r"))) {
+	fprintf(stderr, "? get_pdb(): Cannot open %s\n", Pdbfn);
+	return (NULL);
+    }
+
+    /* go to the beginning of file */
+    rewind(Pdb);
+    Lastpos = 0L;
+
+    /* allocate the entry record */
+    G_MALLOC(Entry, Pdbentry_);
+    if (Entry == NULL) {
+	fputs("? get_pdb(): Out of memory\n", stderr);
+	return (NULL);
+    }
+
+    /* do some zeroing */
+    Entry->Chains = NULL;
+    Entry->Hbonds = NULL;
+    Entry->Ssbs = NULL;
+    Entry->Chainno = Entry->Hbno = Entry->Ssbno = 0;
+
+    /* get the HEADER card */
+    if (get_record(Pdb, Line, "HEADER")) {
+	strncpy(Entry->Header, Line + 10, 40);
+	Entry->Header[40] = '\0';
+	strncpy(Entry->Date, Line + 50, 9);
+	Entry->Date[9] = '\0';
+	strncpy(Entry->Pdbcode, Line + 62, 4);
+	Entry->Pdbcode[4] = '\0';
+    } else
+	Entry->Header[0] = Entry->Date[0] = Entry->Pdbcode[0] = '\0';	/* missing HEADER */
+
+    /* get the COMPND cards */
+    Entry->Compound = NULL;
+    for (i = 0; get_record(Pdb, Line, "COMPND"); i++) {
+	G_REALLOC(Entry->Compound, char, 60 * (i + 1) + 1);
+	assert(Entry->Compound);
+	sscanf(Line + 10, "%60c", Entry->Compound + 60 * i);
+	Entry->Compound[60 * (i + 1)] = '\0';	/* not appended when "%nc" is scanned... */
+    }
+    if (Entry->Compound == NULL)	/* no COMPND cards */
+	G_CALLOC(Entry->Compound, char, 1);	/* empty string */
+    assert(Entry->Compound);
+
+    /* get the SOURCE cards */
+    Entry->Source = NULL;
+    for (i = 0; get_record(Pdb, Line, "SOURCE"); i++) {
+	G_REALLOC(Entry->Source, char, 60 * (i + 1) + 1);
+	assert(Entry->Source);
+	sscanf(Line + 10, "%60c", Entry->Source + 60 * i);
+	Entry->Source[60 * (i + 1)] = '\0';
+    }
+    if (Entry->Source == NULL)	/* no SOURCE cards */
+	G_CALLOC(Entry->Source, char, 1);	/* empty string */
+    assert(Entry->Source);
+
+    /* get the experimental technique */
+    Entry->Expdta[0] = '\0';
+    if (!get_record(Pdb, Line, "EXPDTA"))
+	strcpy(Entry->Expdta, "X-RAY DIFFRACTION");	/* default technique */
+    else
+	sscanf(Line + 10, "%60c", Entry->Expdta);
+
+    /* get resolution from REMARK 2, store -1.0 for "NOT APPLICABLE" */
+    Entry->Resol = -1.0;
+    while (get_record(Pdb, Line, "REMARK")) {
+	if (strncmp(Line, "REMARK   2", 10))
+	    continue;		/* not second remark */
+	Cptr = strstr(Line, "RESOLUTION.");
+	if (Cptr == NULL)
+	    continue;
+	if (NULL != strstr(Line, "NOT APPLICABLE")) {
+	    Entry->Resol = -1.0;
+	    break;
+	}
+	if (sscanf(Cptr + 11, "%f", &(Entry->Resol)))	/* found resolution */
+	    break;
+    }
+
+    /* get secondary structure records en masse */
+    Sno = 0;
+    while (get_record(Pdb, Line, "HELIX")) {	/* read HELIX entries */
+	G_REALLOC(Secs, Secstr_, Sno + 1);
+	assert(Secs);
+	Secs[Sno].Sectype = HELIX;
+	sscanf(Line + 7, "%d %s", &(Secs[Sno].No), Secs[Sno].Id);
+	Secs[Sno].Chid = Line[19];
+	sscanf(Line + 15, "%3s", Aa3);
+	Secs[Sno].Begaa = aa_code31(Aa3);
+	sscanf(Line + 21, "%d%c", &(Secs[Sno].Beg), &(Secs[Sno].Begrid));
+	sscanf(Line + 27, "%3s", Aa3);
+	Secs[Sno].Endaa = aa_code31(Aa3);
+	sscanf(Line + 33, "%d%c", &(Secs[Sno].End), &(Secs[Sno].Endrid));
+	sscanf(Line + 38, "%d", &(Secs[Sno].Type));
+	Sno++;
+    }
+    while (get_record(Pdb, Line, "SHEET")) {	/* read SHEET entries */
+	G_REALLOC(Secs, Secstr_, Sno + 1);
+	assert(Secs);
+	Secs[Sno].Sectype = SHEET;
+	sscanf(Line + 7, "%d %s%d", &(Secs[Sno].No), Secs[Sno].Id,
+	       &(Secs[Sno].Strandno));
+	Secs[Sno].Chid = Line[21];
+	sscanf(Line + 17, "%3s", Aa3);
+	Secs[Sno].Begaa = aa_code31(Aa3);
+	sscanf(Line + 22, "%d%c", &(Secs[Sno].Beg), &(Secs[Sno].Begrid));
+	sscanf(Line + 28, "%3s", Aa3);
+	Secs[Sno].Endaa = aa_code31(Aa3);
+	sscanf(Line + 33, "%d%c", &(Secs[Sno].End), &(Secs[Sno].Endrid));
+	sscanf(Line + 38, "%d", &(Secs[Sno].Type));
+
+	/* read registration if this is not the first strand */
+	if (Secs[Sno].Type) {
+	    /* quite a number of PDB entries (e.g. 1ACX) contain no
+	     * information for the beta-strand registrations. .Other
+	     * will be set to 0 to indicate this sad condition and
+	     * a warning printed to stderr
+	     */
+	    Secs[Sno].Other = 0;
+
+	    /* atom name, residue name, pos and insert ID for the
+	     * registration point on THIS strand. For atom names, 
+	     * see the hack comment at the ATOM record read below
+	     */
+	    if (Line[41] == ' ')
+		sscanf(Line + 42, "%3s", Secs[Sno].Thisat);
+	    else
+		sscanf(Line + 41, "%4s", Secs[Sno].Thisat);
+	    sscanf(Line + 45, "%3s", Aa3);
+	    Secs[Sno].Thisaa = aa_code31(Aa3);
+	    sscanf(Line + 50, "%d%c", &(Secs[Sno].This),
+		   &(Secs[Sno].Thisrid));
+
+	    /* same + chain ID for the OTHER strand */
+	    if (Line[56] == ' ')
+		sscanf(Line + 57, "%3s", Secs[Sno].Otherat);
+	    else
+		sscanf(Line + 56, "%4s", Secs[Sno].Otherat);
+	    sscanf(Line + 60, "%3s", Aa3);
+	    Secs[Sno].Otheraa = aa_code31(Aa3);
+	    sscanf(Line + 64, "%c%d%c", &(Secs[Sno].Otherchid),
+		   &(Secs[Sno].Other), &(Secs[Sno].Otherid));
+	} else {		/* first strand, zero the This/Other fields */
+
+	    Secs[Sno].Thisaa = Secs[Sno].Thisrid = Secs[Sno].Thisat[0] =
+		'\0';
+	    Secs[Sno].Otheraa = Secs[Sno].Otherid = Secs[Sno].Otherat[0] =
+		'\0';
+	    Secs[Sno].This = Secs[Sno].Other = 0;
+	    Secs[Sno].Otherchid = '\0';
+	}
+	Sno++;
+    }
+    while (get_record(Pdb, Line, "TURN")) {	/* read TURN entries */
+	G_REALLOC(Secs, Secstr_, Sno + 1);
+	assert(Secs);
+	Secs[Sno].Sectype = TURN;
+	sscanf(Line + 7, "%d %s", &(Secs[Sno].No), Secs[Sno].Id);
+	sscanf(Line + 15, "%3s", Aa3);
+	Secs[Sno].Chid = Line[19];
+	Secs[Sno].Begaa = aa_code31(Aa3);
+	sscanf(Line + 20, "%4d%c", &(Secs[Sno].Beg), &(Secs[Sno].Begrid));
+	sscanf(Line + 26, "%3s", Aa3);
+	Secs[Sno].Endaa = aa_code31(Aa3);
+	sscanf(Line + 31, "%4d%c", &(Secs[Sno].End), &(Secs[Sno].Endrid));
+	Secs[Sno].Type = 0;
+	Sno++;
+    }
+
+    /* sort secondary structure records in ascending residue order */
+    if (Sno)
+	qsort(Secs, Sno, sizeof(Secstr_), ascend_res);
+
+    /* read S-S bond records in bulk */
+    for (Ssbno = 0; get_record(Pdb, Line, "SSBOND"); Ssbno++) {
+	G_REALLOC(Ssbs, Ssbond_, Ssbno + 1);
+	assert(Ssbs);
+	sscanf(Line + 7, "%3d", &(Ssbs[Ssbno].No));
+	sscanf(Line + 15, "%c%4d%c",
+	       &(Ssbs[Ssbno].Ch1), &(Ssbs[Ssbno].Pos1),
+	       &(Ssbs[Ssbno].Rid1));
+	sscanf(Line + 29, "%c%4d%c", &(Ssbs[Ssbno].Ch2),
+	       &(Ssbs[Ssbno].Pos2), &(Ssbs[Ssbno].Rid2));
+    }
+
+    /* read chains and atom coordinates: since TER is sometimes missing,
+     * the chain boundaries are also detected when the chain ID char
+     * changes between two subsequent records. Chain boundaries
+     * may also be indicated by ENDMDL cards (NMR structures).
+     */
+    Chainno = 0;
+    i = 0;
+    Model = get_record(Pdb, Line, "MODEL");
+    Oldchain = '\0';
+
+    Oldlastpos = Lastpos;	/* find next TER if any */
+    Ter = get_record(Pdb, Line, "TER"); /* assign 0/1 to Ter */
+	if (Ter) {
+	Terpos = Lastpos;
+	Lastpos = Oldlastpos;
+    }
+
+    if (Model) {		/* find next ENDMDL */
+	Oldlastpos = Lastpos;
+	if (get_record(Pdb, Line, "ENDMDL")) {
+	    Modelpos = Lastpos;
+	    Lastpos = Oldlastpos;
+	}
+    }
+
+    do {			/* read ATOM records */
+	/* find first line beginning with "ATOM" */
+	Endf = !get_record(Pdb, Line, "ATOM");
+
+	/* start new chain if the chain indicator has changed
+	 * or a TER or ENDMDL card was passed
+	 */
+	if (!Endf) {
+	    Creatchn = (Oldchain != Line[21]);
+	    if (Ter && Lastpos > Terpos) {	/* TER has been passed */
+		/* get next TER if any */
+		Oldlastpos = Lastpos;
+		Lastpos = Terpos;
+		if (get_record(Pdb, Endmdline, "TER"))
+		    Terpos = Lastpos;
+		else
+		    Ter = 0;	/* don't check any more */
+		Lastpos = Oldlastpos;
+		Creatchn = 1;
+	    }
+
+	    if (Model && Lastpos > Modelpos) {	/* find next ENDMDL */
+		Oldlastpos = Lastpos;
+		Lastpos = Modelpos;
+		if (get_record(Pdb, Endmdline, "ENDMDL"))
+		    Modelpos = Lastpos;
+		else
+		    Model = 0;	/* no more checks */
+		Lastpos = Oldlastpos;
+		Creatchn = 1;
+	    }
+	}
+
+	/* save prev chain before exiting or starting a new one */
+	if (Oldchain && (Endf || Creatchn)) {
+	    Chains[Chainno].Atomno = i;	/* save no. of atoms */
+	    Chains[Chainno].Aano = Aano;	/* no. of residues */
+	    Chains[Chainno].Chid = Oldchain;	/* chain ID */
+	    if (!Protein)
+		Chains[Chainno].Type = 'X';	/* not protein */
+	    else if (Calpha)
+		Chains[Chainno].Type = 'A';	/* C-alpha only */
+	    else
+		Chains[Chainno].Type = 'P';	/* proper protein */
+
+	    Chains[Chainno].Atoms =	/* data pointer */
+		(Atom_ *) realloc(Atoms, i * sizeof(Atom_));
+	    assert(Atoms);
+	    Chains[Chainno].Seq = atom_seq(Chains[Chainno].Atoms, i, Aano);
+
+	    /* H-bond and secstr info will come later */
+	    Chains[Chainno].Hbonds = NULL;
+	    Chains[Chainno].Secs = NULL;
+	    Chains[Chainno].Ssbs = NULL;
+	    Chains[Chainno].Hbno = Chains[Chainno].Secsno =
+		Chains[Chainno].Ssbno = 0;
+	    Chainno++;
+	}
+
+	if (Endf)
+	    break;		/* exit */
+
+	if (Creatchn) {		/* start new chain */
+	    G_REALLOC(Chains, Chain_, Chainno + 1);
+	    assert(Chains);
+	    G_CALLOC(Atoms, Atom_, CHUNK);
+	    assert(Atoms);
+	    i = Aano = 0;
+	    Oldres = Oldrid = ' ';
+	    Oldchain = Line[21];
+	    Oldaano = -9999;
+	    Protein = 0;
+	    Calpha = 1;
+	}
+
+	/* make room for Atoms[] for further growth */
+	if (i && !(i % CHUNK)) {
+	    G_REALLOC(Atoms, Atom_, (i / CHUNK + 1) * CHUNK);
+	    assert(Atoms);
+	}
+
+	/* start processing line */
+	sscanf(Line, "ATOM%d", &(Atoms[i].Atno));
+
+	/* an ugly hack: in the PDB format, atom names are built of
+	 * 4 chars: 
+	 * 1-2=chem.symbol,  RIGHT justified;
+	 * 3=remoteness (alpha, optional)
+	 * 4=branch designator (numeric, optional)
+	 * When the 1st pos (Line[12]) is blank, we read in a 3-char
+	 * string only in order not to pick up the (optional) Alt character. 
+	 * Otherwise a 4-char string is read. My .Id strings are
+	 * always left-justified internally
+	 */
+	if (Line[12] == ' ')
+	    sscanf(Line + 13, "%3s", Atoms[i].Id);
+	else
+	    sscanf(Line + 12, "%4s", Atoms[i].Id);
+
+	Atoms[i].Alt = Line[16];
+
+	/* skip non-C-alphas when the Ca parameter is set */
+	Thisca = (!strcmp(Atoms[i].Id, "CA"));	/* this is C-alpha */
+	if ((Ca > 0) && !Thisca)
+	    continue;
+	if ((Atoms[i].Alt != ' ') && (Atoms[i].Alt != 'A')) {
+	    if (Ca == 1 || Ca == 0)
+		continue;
+	}
+	sscanf(Line + 17, "%3s", Aa3);	/* get AA name */
+	Atoms[i].Aa = aa_code31(Aa3);	/* convert to 1-letter code */
+	/* accepted as protein if at least one AA is not 'X' */
+	/* else skip non-standard AA atoms if Strict is on */
+	if (Atoms[i].Aa != 'X')
+	    Protein = 1;
+	else if (Strict)
+	    continue;
+
+	/* not C-alpha if at least one atom is not "CA" */
+	if (!Thisca)
+	    Calpha = 0;
+
+	/* read residue number */
+	sscanf(Line + 22, "%4d", &(Atoms[i].Resno));
+
+	/* read coordinates, occupancy and B-factor */
+	sscanf(Line + 27, "%f%f%f%f%f",
+	       &(Atoms[i].X), &(Atoms[i].Y), &(Atoms[i].Z),
+	       &(Atoms[i].Occu), &(Atoms[i].Bfact));
+
+	/* some residues are not numbered consecutively, like in
+	   1TIM (1,2,4,5,...) or there are more residues with the
+	   same number but a different residue ID like 27,27A,27B...
+	   The following if() is intended to take care of these
+	   anomalies. Note that in 1ABB, the A-chain has the
+	   following "order": Met-679, Lys-910, Phe-681....
+	   This is a nightmare. */
+	Atoms[i].Rid = Line[26];
+	if (Atoms[i].Resno != Oldaano || Oldrid != Atoms[i].Rid
+	    || Oldres != Atoms[i].Aa) {
+	    Oldaano = Atoms[i].Resno;
+	    Oldrid = Atoms[i].Rid;
+	    Oldres = Atoms[i].Aa;
+	    Aano++;
+	}
+	Lastatno = Atoms[i].Atno;	/* last "good" atom seen so far */
+	i++;			/* next atom: not inc'd if Strict skips */
+    }
+    while (1);			/* end of do..while : break if Endf */
+
+    /* read CONECT records for H-bonds */
+    Hbno = 0;
+    while (get_record(Pdb, Line, "CONECT")) {
+	/* the atom no. at positions 6..10 (Atno) can have acceptors
+	 * at positions 31..35 and 36..40, and donors at positions
+	 * 46..50, 51..55. The rest of the CONECT record is ignored.
+	 * H-bonds that connect
+	 * atoms outside the 1..Lastatno range will be ignored.
+	 */
+	sscanf(Line + 6, "%d", &Atno);
+	if (Atno > Lastatno)
+	    continue;		/* outside chain atom range */
+
+	At = Atno;
+	Line[41] = Line[56] = '\0';
+
+	/* read 1 acceptor and 1 donor only */
+	if (1 == sscanf(Line + 31, "%d", &Partner) && Partner <= Lastatno)
+	    Acc = Partner;
+	else
+	    Acc = 0;
+	if (1 == sscanf(Line + 46, "%d", &Partner) && Partner <= Lastatno)
+	    Don = Partner;
+	else
+	    Don = 0;
+	/* store the corresponding pairs */
+	if (Don > 0) {
+	    for (j = 0; j < Hbno; j++)
+		if (Don == Hbonds[j].Don && At == Hbonds[j].Acc)
+		    break;
+	    if (!Hbno || j >= Hbno) {
+		G_REALLOC(Hbonds, Hbond_, Hbno + 1);
+		assert(Hbonds);
+		Hbonds[Hbno].Don = Don;
+		Hbonds[Hbno].Acc = At;
+		Hbno++;
+	    }
+	}
+	if (Acc > 0) {
+	    for (j = 0; j < Hbno; j++)
+		if (At == Hbonds[j].Don && Acc == Hbonds[j].Acc)
+		    break;
+	    if (!Hbno || j >= Hbno) {
+		G_REALLOC(Hbonds, Hbond_, Hbno + 1);
+		assert(Hbonds);
+		Hbonds[Hbno].Don = At;
+		Hbonds[Hbno].Acc = Acc;
+		Hbno++;
+	    }
+	}
+    }
+    fclose(Pdb);
+
+    /* separate secondary structure records by chains */
+    for (i = 0; i < Sno; i++) {
+	/* locate the chain where the i-th secstr record belongs:
+	 * a given secstr may belong to separate chains as in
+	 * NMR structural models e.g. 3CI2
+	 */
+	for (j = 0; j < Chainno; j++)
+	    if (Chains[j].Chid == Secs[i].Chid) {	/* found, make room,store */
+		G_REALLOC(Chains[j].Secs, Secstr_, Chains[j].Secsno + 1);
+		assert(Chains[j].Secs);
+		Chains[j].Secs[Chains[j].Secsno++] = Secs[i];
+	    }
+    }
+    GFREE(Secs);
+
+    /* separate S-S bonds by chains and build interchain S-S bonds */
+    for (i = 0; i < Ssbno; i++) {
+	if (Ssbs[i].Ch1 != Ssbs[i].Ch2) {	/* interchain */
+	    G_REALLOC(Entry->Ssbs, Ssbond_, Entry->Ssbno + 1);
+	    assert(Entry->Ssbs);
+	    Entry->Ssbs[Entry->Ssbno++] = Ssbs[i];
+	} else {		/* intrachain */
+
+	    /* locate the chain(s) with the same ID */
+	    for (j = 0; j < Chainno; j++)
+		if (Chains[j].Chid == Ssbs[i].Ch1) {
+		    G_REALLOC(Chains[j].Ssbs, Ssbond_,
+			      Chains[j].Ssbno + 1);
+		    assert(Chains[j].Ssbs);
+		    Chains[j].Ssbs[Chains[j].Ssbno++] = Ssbs[i];
+		}
+	}
+    }
+    GFREE(Ssbs);
+
+    /* separate H-bonds by chains and build interchain H-bonds */
+    for (i = 0; i < Hbno; i++) {
+	/* locate chain: check if the H-donors (or acceptors)
+	 * fall within the range of Atno indices in the j-th
+	 * chain. If not, then the bond is interchain
+	 */
+	Don = Hbonds[i].Don;
+	Acc = Hbonds[i].Acc;
+	for (j = 0; j < Chainno; j++) {
+	    Lowlim = Chains[j].Atoms[0].Atno;
+	    Uplim = Chains[j].Atoms[Chains[j].Atomno - 1].Atno;
+	    if (Don >= Lowlim && Don <= Uplim &&
+		Acc >= Lowlim && Acc <= Uplim)
+		break;
+	}
+	if (j < Chainno) {	/* intra-chain */
+	    /* make room */
+	    G_REALLOC(Chains[j].Hbonds, Hbond_, Chains[j].Hbno + 1);
+	    assert(Chains[j].Hbonds);
+	    Chains[j].Hbonds[Chains[j].Hbno++] = Hbonds[i];
+	} else {		/* inter-chain */
+
+	    /* make room */
+	    G_REALLOC(Entry->Hbonds, Hbond_, Entry->Hbno + 1);
+	    assert(Entry->Hbonds);
+	    Entry->Hbonds[Entry->Hbno++] = Hbonds[i];
+	}
+    }
+    GFREE(Hbonds);
+
+    /* cleanup and final data transfer */
+    Entry->Chains = Chains;
+    Entry->Chainno = Chainno;
+    return (Entry);
+}
+
+/* END of get_pdb */
+
+/* get_record: returns the first record (in Line) from Pdb which
+ * begins with the string Label. Line is assumed to be longer than
+ * LINELEN. Stores the file position where the last matching
+ * line was found in Lastpos (global).
+ * Return value: 1 if a matching record was found, 0 if no more
+ * records were found. In this latter case, Line=="".
+ */
+static int get_record(FILE * Pdb, char *Line, const char *Label)
+{
+    int Lablen = strlen(Label);
+
+    if (ftell(Pdb) != Lastpos)
+	fseek(Pdb, Lastpos, SEEK_SET);	/* go where last was found */
+    Line[0] = '\0';		/* zero line */
+    while (NULL != fgets(Line, LINELEN, Pdb))
+	if (!strncmp(Line, Label, Lablen)) {
+	    int i, l = strlen(Line);
+	    if (l < 72)
+		for (i = l - 1; i < 72; i++)
+		    Line[i] = ' ';
+	    Lastpos = ftell(Pdb);	/* found */
+	    Line[72] = '\0';	/* chop off chars 73-80 "0XXX1234" */
+	    return (1);
+	}
+    return (0);			/* not found */
+}
+
+/* END of get_record */
+
+/* ascend_res: for sorting Secstr_ records in increasing order.
+ * Alphabetical ordering for chain identifiers, and increasing
+ * residue number (beginning) order within the same chain.
+ */
+static int ascend_res(const void *Sec1, const void *Sec2)
+{
+    register Secstr_ *S1 = (Secstr_ *) Sec1, *S2 = (Secstr_ *) Sec2;
+
+    if (S1->Chid < S2->Chid)
+	return (-1);
+    else if (S1->Chid == S2->Chid) {
+	if (S1->Beg < S2->Beg)
+	    return (-1);
+	else if (S1->Beg > S2->Beg)
+	    return (1);
+	else
+	    return (0);
+    } else
+	return (0);
+}
+
+/* END of ascend_res */
+
+/* atom_seq: given a PDB chain atom array together with its
+ * length Atomno and the number of amino acids Aano, the 
+ * sequence (in 1-letter code) is returned in a \0-terminated string.
+ */
+static char *atom_seq(const Atom_ Atoms[], int Atomno, int Aano)
+{
+    register int i, j, Resno;
+    char *Seq;
+    char Rid;
+
+    Seq = (char *) calloc(Aano + 1, sizeof(char));
+    assert(Seq);
+
+    for (j = 0, i = 0; i < Atomno; j++) {
+	Seq[j] = Atoms[i].Aa;
+	Rid = Atoms[i].Rid;
+	Resno = Atoms[i++].Resno;
+	while (i < Atomno && Resno == Atoms[i].Resno
+	       && Rid == Atoms[i].Rid)
+	    i++;
+    }
+    return (Seq);
+}
+
+/* END of atom_seq */
+
+/* free_pdb: frees up memory allocated to Entry and its arrays.
+ * Does not set Entry to NULL. (Destructor in C++)
+ */
+void free_pdb(Pdbentry_ * Entry)
+{
+    register int i;
+
+    if (Entry == NULL)
+	return;
+
+    for (i = 0; i < Entry->Chainno; i++) {
+	if (Entry->Chains[i].Aano)
+	    free(Entry->Chains[i].Seq);
+	if (Entry->Chains[i].Atomno)
+	    free(Entry->Chains[i].Atoms);
+	if (Entry->Chains[i].Secsno)
+	    free(Entry->Chains[i].Secs);
+	if (Entry->Chains[i].Hbno)
+	    free(Entry->Chains[i].Hbonds);
+	if (Entry->Chains[i].Ssbno)
+	    free(Entry->Chains[i].Ssbs);
+    }
+    if (Entry->Chainno)
+	free(Entry->Chains);
+    if (Entry->Ssbno)
+	free(Entry->Ssbs);
+    if (Entry->Hbno)
+	free(Entry->Hbonds);
+    free(Entry->Compound);
+    free(Entry->Source);
+    free(Entry);
+}
+
+/* END of free_pdb */
+
+/* atom_dist: returns the distance between two Atom_ entries. */
+float atom_dist(const Atom_ * At1, const Atom_ * At2)
+{
+    float Dx, D;
+
+    D = 0.0;
+    Dx = At1->X - At2->X;
+    D += Dx * Dx;
+    Dx = At1->Y - At2->Y;
+    D += Dx * Dx;
+    Dx = At1->Z - At2->Z;
+    D += Dx * Dx;
+    return (sqrt(D));
+}
+
+/* END of atom_dist */
+
+/* ---- OUTPUT ---- */
+
+/* put_pdb: writes the atomic coordinate information in Entry
+ * to the file Pdbfn in PDB format. Currently supported records are
+ * HEADER, COMPND, SOURCE, REMARK, SEQRES, HELIX, SHEET, TURN, 
+ * SSBOND, ATOM, CONECT. Remno remarks are supplied in a char array.
+ */
+void put_pdb(const char *Pdbfn, Pdbentry_ * Entry,
+	     char *Remarks[], int Remno)
+{
+    /* 3-atom H-bond record type for CONECT output */
+    typedef struct {
+	int Don, At, Acc;	/* Don or Acc may be -1 */
+    } Hb3_;
+
+    /* index for the counters in the MASTER record */
+    typedef enum { REM, FTN, HET, HLX, SHT, TRN,
+	SIT, TRS, ATM, TER, CON, SQR
+    } Masteridx_;
+
+    FILE *Pdb;			/* output file */
+    char Card[LINELEN];		/* output line str buffer */
+    Chain_ *Chains;		/* temp ptrs to Entry's (sub)fields */
+    Atom_ *Atoms;
+    Hbond_ *Hbonds = NULL;	/* merged list of Don->Acc H-bonds */
+    Hb3_ *Hb3s = NULL;		/* list of Don->At->Acc output H-bonds */
+    Secstr_ *Secs = NULL;	/* merged list of secondary structures */
+    Ssbond_ *Ssbs = NULL;	/* merged list of S-S bonds */
+    register int i, j, k, se, ss, hb;
+    int Chno, Atomno, Aano, Hbno, Hb3no, Ssbno, Secsno, Don, Acc, Linecnt,
+	Atomcnt;
+    char *Seq, *Code, *Cmp, Chid, Dside, Aside;
+    int Mc[12] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };	/* record counter */
+    Masteridx_ Mx;
+
+    /* check data quickly and open file */
+    if (Entry == NULL || !Entry->Chainno)
+	return;			/* possibly empty */
+    if (NULL == (Pdb = fopen(Pdbfn, "w"))) {
+	fprintf(stderr, "? put_pdb: Cannot open %s\n", Pdbfn);
+	return;
+    }
+
+    Linecnt = 1;
+    /* compose header */
+    sprintf(Card, "HEADER    %-40s%9s   %4s",
+	    Entry->Header, Entry->Date, Code = Entry->Pdbcode);
+    print_card(Pdb, Card, Code, Linecnt++);
+
+    /* compound description (may span several lines) */
+    for (i = 1, Cmp = Entry->Compound, k = strlen(Cmp); k > 0;
+	 i++, Cmp += 60, k -= 60) {
+	if (i == 1)
+	    sprintf(Card, "COMPND    %-60.60s", Cmp);
+	else
+	    sprintf(Card, "COMPND  %2d%-60.60s", i, Cmp);
+	print_card(Pdb, Card, Code, Linecnt++);
+    }
+
+    /* source description (may span several lines) */
+    for (i = 1, Cmp = Entry->Source, k = strlen(Cmp); k > 0;
+	 i++, Cmp += 60, k -= 60) {
+	if (i == 1)
+	    sprintf(Card, "SOURCE    %-60.60s", Cmp);
+	else
+	    sprintf(Card, "SOURCE  %2d%-60.60s", i, Cmp);
+	print_card(Pdb, Card, Code, Linecnt++);
+    }
+
+    /* experimental technique */
+    sprintf(Card, "EXPDTA    %-60.60s", Entry->Expdta);
+    print_card(Pdb, Card, Code, Linecnt++);
+
+    /* insert a warning and print resolution */
+    sprintf(Card, "REMARK   1 NOT A GENUINE PDB ENTRY!");
+    print_card(Pdb, Card, Code, Linecnt++);
+    if (Entry->Resol < 0)
+	strcpy(Card, "REMARK   2 RESOLUTION. NOT APPLICABLE.");
+    else
+	sprintf(Card, "REMARK   2 RESOLUTION. %.2f ANGSTROMS.",
+		Entry->Resol);
+    print_card(Pdb, Card, Code, Linecnt++);
+    Mc[REM] = 2;
+
+    /* add user-supplied remarks starting at 4 because 3 is reserved for refinement */
+    for (j = 0; j < Remno; j++, Mc[REM]++) {
+	if (strlen(Remarks[j]) >= 62)
+	    continue;		/* skip longs */
+	sprintf(Card, "REMARK   4 %s", Remarks[j]);
+	print_card(Pdb, Card, Code, Linecnt++);
+    }
+
+    /* list sequence info */
+    Chains = Entry->Chains;
+    for (Chno = 0; Chno < Entry->Chainno; Chno++) {
+	Seq = Chains[Chno].Seq;
+	Aano = Chains[Chno].Aano;
+	Chid = Chains[Chno].Chid;
+	for (i = 0; 13 * i < Aano; Linecnt++, i++, Mc[SQR]++) {
+	    sprintf(Card, "SEQRES%4d %c %4d ", i + 1, Chid, Aano);
+	    for (j = 0; j < 13 && 13 * i + j < Aano; j++)
+		sprintf(Card + 18 + 4 * j, "%4s",
+			aa_code13(Seq[13 * i + j]));
+	    print_card(Pdb, Card, Code, Linecnt);
+	}
+    }
+
+    /* the secstr, S-S bond and H-bond records are distributed
+     * among the chains and have to be pooled for output. The
+     * records are counted here, temp space is allocated, and
+     * after copying the records are sorted
+     */
+    Secsno = 0;
+    Ssbno = Entry->Ssbno;
+    Hbno = Entry->Hbno;
+    for (Chno = 0; Chno < Entry->Chainno; Chno++) {
+	Secsno += Chains[Chno].Secsno;
+	Ssbno += Chains[Chno].Ssbno;
+	Hbno += Chains[Chno].Hbno;
+    }
+    G_CALLOC(Secs, Secstr_, Secsno);
+    assert(Secs);
+    G_CALLOC(Ssbs, Ssbond_, Ssbno);
+    assert(Ssbs);
+    G_CALLOC(Hbonds, Hbond_, Hbno);
+    assert(Hbonds);
+    for (se = ss = hb = 0, Chno = 0; Chno < Entry->Chainno; Chno++) {
+	memcpy(Secs + se, Chains[Chno].Secs,
+	       sizeof(Secstr_) * Chains[Chno].Secsno);
+	se += Chains[Chno].Secsno;
+	memcpy(Ssbs + ss, Chains[Chno].Ssbs,
+	       sizeof(Ssbond_) * Chains[Chno].Ssbno);
+	ss += Chains[Chno].Ssbno;
+	memcpy(Hbonds + hb, Chains[Chno].Hbonds,
+	       sizeof(Hbond_) * Chains[Chno].Hbno);
+	hb += Chains[Chno].Hbno;
+    }
+    memcpy(Ssbs + ss, Entry->Ssbs, sizeof(Ssbond_) * Entry->Ssbno);
+    memcpy(Hbonds + hb, Entry->Hbonds, sizeof(Hbond_) * Entry->Hbno);
+    qsort(Secs, Secsno, sizeof(Secstr_), secstr_outorder);
+    qsort(Ssbs, Ssbno, sizeof(Ssbond_), ssbond_outorder);
+
+    /* list sec. struct. info */
+    for (i = 0; i < Secsno; i++)
+	if (Secs[i].Sectype == HELIX) {	/* helices */
+	    sprintf(Card, "HELIX  %3d %3s %3s %c %4d%c %3s %c %4d%c%2d",
+		    Secs[i].No, Secs[i].Id, aa_code13(Secs[i].Begaa),
+		    Secs[i].Chid, Secs[i].Beg, Secs[i].Begrid,
+		    aa_code13(Secs[i].Endaa), Secs[i].Chid, Secs[i].End,
+		    Secs[i].Endrid, Secs[i].Type);
+	    print_card(Pdb, Card, Code, Linecnt++);
+	    Mc[HLX]++;
+	} else if (Secs[i].Sectype == SHEET) {	/* sheets */
+	    sprintf(Card, "SHEET  %3d %3s%2d %3s %c%4d%c %3s %c%4d%c%2d ",
+		    Secs[i].No, Secs[i].Id, Secs[i].Strandno,
+		    aa_code13(Secs[i].Begaa), Secs[i].Chid,
+		    Secs[i].Beg, Secs[i].Begrid,
+		    aa_code13(Secs[i].Endaa), Secs[i].Chid, Secs[i].End,
+		    Secs[i].Endrid, Secs[i].Type);
+
+	    /* print registration if present */
+	    if (Secs[i].Type && Secs[i].Other) {
+		sprintf(Card + 41,
+			(strlen(Secs[i].Thisat) == 4) ? "%4s" : " %-3.3s",
+			Secs[i].Thisat);
+		sprintf(Card + 45, "%3s %c%4d%c ",
+			aa_code13(Secs[i].Thisaa), Secs[i].Chid,
+			Secs[i].This, Secs[i].Thisrid);
+		sprintf(Card + 56,
+			(strlen(Secs[i].Otherat) ==
+			 4) ? "%4s" : " %-3.3s", Secs[i].Otherat);
+		sprintf(Card + 60, "%3s %c%4d%c",
+			aa_code13(Secs[i].Otheraa), Secs[i].Otherchid,
+			Secs[i].Other, Secs[i].Otherid);
+	    }
+	    print_card(Pdb, Card, Code, Linecnt++);
+	    Mc[SHT]++;
+	} else {		/* turns */
+
+	    sprintf(Card, "TURN   %3d %3s %3s %c%4d%c %3s %c%4d%c",
+		    Secs[i].No, Secs[i].Id, aa_code13(Secs[i].Begaa),
+		    Secs[i].Chid, Secs[i].Beg, Secs[i].Begrid,
+		    aa_code13(Secs[i].Endaa), Secs[i].Chid, Secs[i].End,
+		    Secs[i].Endrid);
+	    print_card(Pdb, Card, Code, Linecnt++);
+	    Mc[TRN]++;
+	}
+    GFREE(Secs);
+
+    /* list disulfide bridges */
+    for (i = 0; i < Ssbno; i++) {
+	sprintf(Card, "SSBOND %3d CYS %c %4d%c   CYS %c %4d%c",
+		Ssbs[i].No,
+		Ssbs[i].Ch1, Ssbs[i].Pos1, Ssbs[i].Rid1,
+		Ssbs[i].Ch2, Ssbs[i].Pos2, Ssbs[i].Rid2);
+	print_card(Pdb, Card, Code, Linecnt++);
+    }
+    GFREE(Ssbs);
+
+    /* list atomic coordinates for each chain (ATOM, TER) */
+    Atomcnt = 1;
+    for (Chno = 0; Chno < Entry->Chainno; Chno++) {
+	Aano = Chains[Chno].Aano;
+	Chid = Chains[Chno].Chid;
+	Atoms = Chains[Chno].Atoms;
+	Atomno = Chains[Chno].Atomno;
+	for (i = 0; i < Atomno; Atomcnt++, i++) {
+	    sprintf(Card, "ATOM  %5d ", Atoms[i].Atno);
+	    sprintf(Card + 12,
+		    (strlen(Atoms[i].Id) == 4) ? "%4s" : " %-3.3s",
+		    Atoms[i].Id);
+	    sprintf(Card + 16, "%c%3s %c%4d%c   %8.3f%8.3f%8.3f%6.2f%6.2f",
+		    Atoms[i].Alt, aa_code13(Atoms[i].Aa), Chid,
+		    Atoms[i].Resno, Atoms[i].Rid, Atoms[i].X, Atoms[i].Y,
+		    Atoms[i].Z, Atoms[i].Occu, Atoms[i].Bfact);
+	    print_card(Pdb, Card, Code, Linecnt++);
+	    Mc[ATM]++;
+	}
+	sprintf(Card, "TER   %5d      %3s %c%4d",
+		Atomcnt++, aa_code13(Atoms[Atomno - 1].Aa),
+		Chid, Atoms[Atomno - 1].Resno);
+	Mc[TER]++;
+	print_card(Pdb, Card, Code, Linecnt++);
+    }
+
+    /* construct the 3-member Don->At->Acc Hb3_ records from the general
+     * Don->Acc Hbond_ records. This is to comply with the
+     * rather awkward CONECT format which lists atoms rather
+     * than bonds and is redundant
+     */
+    for (Hb3no = i = 0; i < Hbno; i++) {
+	Dside = Aside = 1;
+	Don = Hbonds[i].Don;
+	Acc = Hbonds[i].Acc;
+	for (j = 0; j < Hb3no && (Dside || Aside); j++) {
+	    if (Dside && Acc == Hb3s[j].At && !Hb3s[j].Don) {	/* join to j-th on the donor side */
+		Hb3s[j].Don = Don;
+		Dside = 0;
+	    } else
+		Dside = Dside && !(Don == Hb3s[j].Don
+				   && Acc == Hb3s[j].At);
+	    if (Aside && Don == Hb3s[j].At && !Hb3s[j].Acc) {	/* join to j-th on the acceptor side */
+		Hb3s[j].Acc = Acc;
+		Aside = 0;
+	    } else
+		Aside = Aside && !(Don == Hb3s[j].At
+				   && Acc == Hb3s[j].Acc);
+	}
+
+	/* store if unpaired still */
+	if (Dside) {
+	    G_REALLOC(Hb3s, Hb3_, Hb3no + 1);
+	    assert(Hb3s);
+	    Hb3s[Hb3no].Don = Don;
+	    Hb3s[Hb3no].At = Acc;
+	    Hb3s[Hb3no++].Acc = 0;
+	}
+	if (Aside) {
+	    G_REALLOC(Hb3s, Hb3_, Hb3no + 1);
+	    assert(Hb3s);
+	    Hb3s[Hb3no].Don = 0;
+	    Hb3s[Hb3no].At = Don;
+	    Hb3s[Hb3no++].Acc = Acc;
+	}
+    }
+    GFREE(Hbonds);
+
+    /* list H-bonds from Hb3s[] */
+    for (i = 0; i < Hb3no; i++) {
+	memset(Card, 0, LINELEN);
+	/* atom no and blank covalent bonds (not std but...) */
+	sprintf(Card, "CONECT %4d", Hb3s[i].At + 1);
+	memset(Card + 11, ' ', 20);
+	if (!Hb3s[i].Acc)
+	    memset(Card + 31, ' ', 15);
+	else
+	    sprintf(Card + 31, "%5d          ", Hb3s[i].Acc);
+	if (!Hb3s[i].Don)
+	    memset(Card + 46, ' ', 15);
+	else
+	    sprintf(Card + 46, "%5d", Hb3s[i].Don);
+	print_card(Pdb, Card, Code, Linecnt++);
+	Mc[CON]++;
+    }
+    GFREE(Hb3s);
+
+    /* finish listing with MASTER and END */
+    strcpy(Card, "MASTER    ");
+    for (Mx = REM; Mx <= SQR; Mx++)
+	sprintf(Card + 10 + 5 * Mx, "%5d", Mc[Mx]);
+    print_card(Pdb, Card, Code, Linecnt++);
+    strcpy(Card, "END");
+    print_card(Pdb, Card, Code, Linecnt);
+    fclose(Pdb);
+}
+
+/* END of put_pdb */
+
+/* print_card: completes a PDB output line ("card" in FORTRAN terminology).
+ * The incomplete line is in Card, to which padding spaces, the Code
+ * and the line count Linecnt are appended to make it LINELEN(==80)
+ * chars long. Then Card is then printed to Pdb followed by a newline.
+ */
+static void print_card(FILE * Pdb, char *Card, const char *Code,
+		       int Linecnt)
+{
+    register int i;
+
+    i = strlen(Card);
+    memset(Card + i, ' ', 72 - i);	/* pad with spaces */
+    sprintf(Card + 72, "%4s%4d", Code, Linecnt);
+    fprintf(Pdb, "%s\n", Card);
+}
+
+/* END of print_card */
+
+/* ---- ENTRY SORTING FOR OUTPUT ---- */
+
+/* secstr_outorder: sorts the secstruct elements into PDB output order:
+ * helix-sheet-turn, and same types are sorted
+ * separately according to the order number (No).
+ */
+static int secstr_outorder(const void *Sec1, const void *Sec2)
+{
+    register Secstr_ *S1 = (Secstr_ *) Sec1, *S2 = (Secstr_ *) Sec2;
+    register int Ord;
+
+    Ord = (int) (S1->Sectype) - (int) (S2->Sectype);
+    if (Ord)
+	return (Ord);		/* helix-sheet-turn */
+    else if (S1->Sectype == SHEET) {	/* both are sheets */
+	Ord = strcmp(S1->Id, S2->Id);	/* sort by alphabetical ID order */
+	if (Ord)
+	    return (Ord);
+	else
+	    return (S1->No - S2->No);	/* same sheet, different strands */
+    } else
+	return (S1->No - S2->No);	/* both helices or turns */
+}
+
+/* END of secstr_outorder */
+
+/* ssbond_outorder: for sorting the S-S bond records according
+ * their No field.
+ */
+static int ssbond_outorder(const void *Ssb1, const void *Ssb2)
+{
+    register Ssbond_ *S1 = (Ssbond_ *) Ssb1, *S2 = (Ssbond_ *) Ssb2;
+    return (S1->No - S2->No);
+}
+
+/* END of ssbond_outorder */
+
+#undef LINELEN
+#undef G_MALLOC
+#undef G_CALLOC
+#undef G_REALLOC
+#undef GFREE
+
+/* ==== END OF FUNCTIONS pdbprot.c ==== */
diff --git a/src/pdbprot.h b/src/pdbprot.h
new file mode 100644
index 0000000..13bc9f3
--- /dev/null
+++ b/src/pdbprot.h
@@ -0,0 +1,116 @@
+#ifndef PDBPROT_H
+#define PDBPROT_H
+
+/* ==== HEADER pdbprot.h ==== */
+
+/* Protein Data Bank I/O routines. Replaces "pdb.h" */
+
+/* ANSI C, IRIX 4.0.5, 9. Nov. 1995. Andris Aszodi */
+
+/* ---- GLOBAL DEFINITIONS ---- */
+
+#define ALLATOMS 0     /* read all atoms */
+#define CALPHA 1       /* read C-alpha backbone only */
+#define RELAXED 0      /* read non-standard AA-s ('X') */
+#define STRICT 1       /* read the 20 standard AA-s + B,Z only */
+
+/* ---- GLOBAL PDB TYPES ---- */
+
+typedef char Str4_[5];  /* 4-letter words... */
+
+typedef struct    /* entry for an atom */
+{
+  int Atno;	/* atom serial number as in the PDB entry */
+  Str4_ Id;  /* atom type like CA or OD2: 4 chars max. + \0 */
+  char Alt;	/* alternate location indicator */
+  char Aa;     /* 1-letter AA code or ' ' for OXT */
+  int Resno;  /* residue no. within a chain */
+  char Rid;   /* insertion code like in "27A" */
+  float X,Y,Z; /* the coordinates */
+  float Occu, Bfact; /* occupancy and temperature factor */
+} Atom_ ;
+
+typedef struct	    /* entry for a H-bond */
+{
+    int Don, Acc;   /* atom nos of donor and acceptor */
+} Hbond_ ;
+
+typedef enum {HELIX, SHEET, TURN} Sectype_ ;
+typedef struct	    /* entry for a secondary structure element */
+{
+    Sectype_  Sectype;	/* HELIX, SHEET, TURN */
+    int No;	    /* serial number of structure */
+    Str4_ Id;	    /* identifier string */
+    int Beg, End;   /* residue nos (1..N) */
+    char Chid;	    /* chain ID, for begin only */
+    char Begaa, Endaa;	/* amino acid 1-letter codes */
+    char Begrid, Endrid;    /* insertion codes */
+    int Type;	    /* 1..7 for helices, -1..1 for sheets */
+	    /* these entries are for sheets only */
+    int Strandno;	/* number of strands in this sheet */ 
+    Str4_ Thisat, Otherat;  /* atom names for beta registration */
+    char Thisaa, Otheraa;   /* amino acid codes for beta regs */
+    int This, Other;	/* registration AA positions */
+    char Thisrid, Otherid, Otherchid;	/* ins codes and chain ID for the OTHER */
+} Secstr_ ;
+
+typedef struct	    /* entry for a disulfide bridge */
+{
+    int No;
+    int Pos1, Pos2; /* CYS seq. positions */
+    char Ch1, Ch2, Rid1, Rid2;	/* chain ID-s and insertion codes */
+} Ssbond_ ;
+
+typedef struct   /* entry for a chain */
+{
+  Atom_ *Atoms; /* array of atoms in this chain */
+  int Atomno;   /* no. of atoms in chain */
+  Secstr_ *Secs;    /* secondary structure info */
+  int Secsno;	/* length of Secs[] */
+  Hbond_ *Hbonds;   /* array of H-bonds */
+  int Hbno;	/* length of Hbonds[] */
+  Ssbond_ *Ssbs;    /* array of S-S bonds */
+  int Ssbno;	/* length of Ssbs[] */
+  int Aano;     /* no. of amino acids in chain */
+  char Chid;    /* chain ID (for multichains) */
+  char Type;    /* chain type: 'P'-rotein, 'A'-lpha or 'X' */
+  char *Seq;	/* chain sequence in 1-letter code, \0-termin. */
+} Chain_ ;
+
+typedef struct	/* entry for a PDB record */
+{
+    char Header[41];	/* header info: function description */
+    char Date[10];	/* date of deposition: "20-AUG-64" format */
+    Str4_ Pdbcode;	/* standard PDB code "0XXX" */
+    char *Compound;	/* compound descriptor string */
+    char *Source;	/* species, organ, tissue, mutant */
+    char Expdta[61];	/* experimental technique: default "X-RAY DIFFRACTION" */
+    float Resol;	/* resolution; <0 means "NOT APPLICABLE" */
+    Chain_ *Chains;	/* array of chain records */
+    int Chainno;	/* no. of chains */
+    Hbond_ *Hbonds;	/* array of interchain H-bonds */
+    int Hbno;		/* no. of interchain H-bonds */
+    Ssbond_ *Ssbs;	/* array of interchain S-S bonds */
+    int Ssbno;	/* no, of interchain S-S bonds */
+} Pdbentry_ ;
+
+/* ---- PROTOTYPES ---- */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+char aa_code31(const char *Aa3);
+char *aa_code13(char Aa1);
+Pdbentry_ *get_pdb(const char *Pdbfn, int Ca,int Strict);
+float atom_dist(const Atom_ *At1, const Atom_ *At2);
+void put_pdb(const char *Pdbfn, Pdbentry_ *Entry, 
+	char *Remarks[], int Remno);
+void free_pdb(Pdbentry_ *Entry);
+
+#ifdef __cplusplus
+}
+#endif
+
+/* ==== END OF HEADER pdbprot.h ==== */
+#endif	/* PDBPROT_H */
diff --git a/src/ql.c b/src/ql.c
new file mode 100644
index 0000000..0d6fcf0
--- /dev/null
+++ b/src/ql.c
@@ -0,0 +1,303 @@
+/* ==== FUNCTIONS ql.c ==== */
+
+/* Eigenvalues and eigenvectors of real symmetric matrices by
+ Housholder tridiagonalisation and QL-transformation.
+ Adapted from Numerical Recipes. The "core" routines use 
+ the 1..N indexing convention but the "shell" is ordinary 
+ 0..N-1 C-style. Standalone version is eigenql.c */
+
+/* ANSI C, Iris Indigo IRIX 4.0.5, 20. Nov. 1992. Andris Aszodi */
+
+/* ---- HEADER FILES ---- */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <math.h>
+#include <assert.h>
+#include "matrix.h"
+#include "ql.h"
+
+/* ---- TYPES ---- */
+
+/* type of function returning int: demanded by qsort() */
+typedef int (*Compfnc_) (const void *, const void *);
+
+/* type for eigenvalue sorting */
+typedef struct {
+    double Eig;			/* an eigenvalue along with its */
+    int Idx;			/* original position */
+} Eigidx_;
+
+/* ---- PROTOTYPES ---- */
+
+/* eigen_ql(): prototype in "ql.h" */
+
+static int eig_cmp(const Eigidx_ * E1, const Eigidx_ * E2);
+static void tred2(double **a, int n, double *d, double *e);
+static int tqli(double *d, double *e, int n, double **z, int Itno);
+
+/* ---- FUNCTIONS ---- */
+
+/* ---- SHELL ---- */
+
+/* eigen_ql: a 'shell' function driving the Housholder and QL routines.
+ Takes a lower triangular matrix Mat as input (with size Size), and
+ produces the eigenvalues in Eval and the eigenvectors in Evec.
+ Eval and Evec are assumed to be allocated outside with the
+ correct sizes! Index shifts are performed
+ to hack around the [1..N] convention of Numerical Recipes.
+ Return value: 0 if OK, 1 if iteration limit was exceeded in tqli(). */
+
+extern int eigen_ql(Trimat_ Mat, int Size, double *Eval, Matrix_ Evec)
+{
+    const int ITERNO = 30;
+
+    int i, j, k, Err;
+    Sqmat_ Qmat;
+    double *Diag2;
+    Eigidx_ *Evs;
+
+    /* allocate full square matrix: input and raw eigenvectors */
+    Qmat = alloc_sqmat(Size);
+    assert(Qmat);
+
+    /* copy values from lower triangle Mat */
+    for (i = 0; i < Size; i++) {
+	Qmat[i][i] = Mat[i][i];
+	for (j = 0; j < i; j++)
+	    Qmat[i][j] = Qmat[j][i] = Mat[i][j];
+    }
+
+    /* shift addresses so that [1..N] indexing be valid */
+    for (i = 0; i < Size; i++)
+	Qmat[i]--;
+    Qmat--;
+
+    /* create array for 2nd diagonal of tridiagonal matrix */
+    Diag2 = (double *) calloc(Size, sizeof(double));
+    assert(Diag2);
+
+    /* shift their address as well for [1..N] indexing */
+    Eval--;
+    Diag2--;
+
+    /* perform Housholder tridiagonalisation */
+    tred2(Qmat, Size, Eval, Diag2);
+
+    /* apply shifted QL-transforms: get eigenvalues in Diag,
+       eigenvectors in Qmat */
+    Err = tqli(Eval, Diag2, Size, Qmat, ITERNO);
+    if (Err)
+	fprintf(stderr, "Iteration limit (%d) is exceeded\n", ITERNO);
+
+    /* shift back addresses for C-style indexing */
+    Eval++;
+    Diag2++;
+    free(Diag2);		/* not even needed */
+    for (i = 1; i <= Size; i++)
+	Qmat[i]++;
+    Qmat++;			/* raw eigenvectors in columns */
+
+    /* sort eigenvalues in decreasing order */
+    Evs = (Eigidx_ *) calloc(Size, sizeof(Eigidx_));
+    assert(Evs);
+    for (i = 0; i < Size; i++) {
+	/* copy eigenvalues (rounded to 0.0 if necessary) and index */
+	Evs[i].Eig = RND0(Eval[i]);
+	Evs[i].Idx = i;
+    }
+    /* Quicksort from stdlib */
+    qsort(Evs, Size, sizeof(Eigidx_), (Compfnc_) eig_cmp);
+    /* permute eigenvectors according to their eigenvalues:
+       and list them as rows */
+    for (i = 0; i < Size; i++) {
+	Eval[i] = Evs[i].Eig;	/* copy back eigenvalues */
+	k = Evs[i].Idx;
+	for (j = 0; j < Size; j++)
+	    Evec[i][j] = Qmat[j][k];	/* copy eigenvectors */
+    }
+
+    /* output and cleanup */
+    free(Evs);
+    free_matrix(Qmat, Size);
+    return (Err);
+}
+
+/* END of eigen_ql */
+
+/* ---- AUXILIARY ROUTINES TO SHELL ---- */
+
+/* eig_cmp: compares two Eigidx structs for qsort(). */
+
+static int eig_cmp(const Eigidx_ * E1, const Eigidx_ * E2)
+{
+    return ((E2->Eig > E1->Eig) ? 1 : (E2->Eig < E1->Eig) ? -1 : 0);
+}
+
+/* END of eig_cmp */
+
+/* ---- EIGENROUTINE CORE ---- */
+
+/* tred2: Housholder tridiagonalisation. a is a real, symmetric matrix
+ (size n*n). The main diagonal of the tridiag. output is returned in d,
+ the second diagonal in e with e[1]==0.0. On return, a contains the
+ transformation matrix "Q". [1..N] indexing convention is used 
+ throughout!
+ Algorithm and implementation from Numerical Recipes. A.A. has after-
+ edited the function head to look like ANSI, and inserted 'register'
+ local vars. */
+
+static void tred2(double **a, int n, double *d, double *e)
+{
+    register int l, k, j, i;
+    register double scale, hh, h, g, f;
+
+    for (i = n; i >= 2; i--) {
+	l = i - 1;
+	h = scale = 0.0;
+	if (l > 1) {
+	    for (k = 1; k <= l; k++)
+		scale += fabs(a[i][k]);
+	    if (scale < EPSILON)
+		e[i] = a[i][l];
+	    else {
+		for (k = 1; k <= l; k++) {
+		    a[i][k] /= scale;
+		    h += a[i][k] * a[i][k];
+		}
+		f = a[i][l];
+		g = (RND0(f) > 0.0) ? -sqrt(h) : sqrt(h);
+		e[i] = scale * g;
+		h -= f * g;
+		a[i][l] = f - g;
+		f = 0.0;
+		for (j = 1; j <= l; j++) {
+		    /* Next statement can be omitted if eigenvectors not wanted */
+		    a[j][i] = a[i][j] / h;
+		    g = 0.0;
+		    for (k = 1; k <= j; k++)
+			g += a[j][k] * a[i][k];
+		    for (k = j + 1; k <= l; k++)
+			g += a[k][j] * a[i][k];
+		    e[j] = g / h;
+		    f += e[j] * a[i][j];
+		}
+		hh = f / (h + h);
+		for (j = 1; j <= l; j++) {
+		    f = a[i][j];
+		    e[j] = g = e[j] - hh * f;
+		    for (k = 1; k <= j; k++)
+			a[j][k] -= (f * e[k] + g * a[i][k]);
+		}
+	    }
+	} else
+	    e[i] = a[i][l];
+	d[i] = h;
+    }
+    /* Next statement can be omitted if eigenvectors not wanted */
+    d[1] = 0.0;
+    e[1] = 0.0;
+    /* Contents of this loop can be omitted if eigenvectors not
+       wanted except for statement d[i]=a[i][i]; */
+    for (i = 1; i <= n; i++) {
+	l = i - 1;
+	if (RND0(d[i]) != 0.0) {	/* !=0.0 added */
+	    for (j = 1; j <= l; j++) {
+		g = 0.0;
+		for (k = 1; k <= l; k++)
+		    g += a[i][k] * a[k][j];
+		for (k = 1; k <= l; k++)
+		    a[k][j] -= g * a[k][i];
+	    }
+	}
+	d[i] = (fabs(a[i][i]) < EPSILON) ? 0.0 : a[i][i];
+	a[i][i] = 1.0;
+	for (j = 1; j <= l; j++)
+	    a[j][i] = a[i][j] = 0.0;
+    }
+}
+
+/* END of tred2 */
+
+/* tqli: QL algorithm with implicit shifts on tridiagonal matrices.
+ The main diagonal is in d, the second diagonal is in e, with e[1]
+ ignored. Size is n. If d and e were obtained from a general symmetric
+ real matrix by Housholder transformation by tred2(), then z should
+ contain the transformation matrix "Q" on input; otherwise it should
+ be the unit matrix. On output, d contains the eigenvalues and z the
+ eigenvectors, with the k-th column corresponding to the k-th eigenvalue.
+ Itno supplies the maximum allowable no. of iterations (an addition
+ by A.A.). Return value: 0 if OK, 1 if iteration limit has been
+ exceeded (added by A.A. to replace the nrerror() error message function
+ originally used in Numerical Recipes routines).
+ [1..N] indexing convention is used throughout!
+ Algorithm and implementation from Numerical Recipes. A.A. has after-
+ edited the function head to look like ANSI, and inserted 'register'
+ local vars. */
+
+#define SIGN(a,b) ()
+
+static int tqli(double *d, double *e, int n, double **z, int Itno)
+{
+    register int m, l, iter, i, k;
+    register double s, r, ra, p, g, f, c, b;
+    register float dd;
+
+    for (i = 2; i <= n; i++)
+	e[i - 1] = e[i];
+    e[n] = 0.0;
+    for (l = 1; l <= n; l++) {
+	iter = 0;
+	do {
+	    for (m = l; m <= n - 1; m++) {
+		dd = (float) (fabs(d[m]) + fabs(d[m + 1]));
+		if ((float) fabs(e[m]) + dd == dd)
+		    break;
+	    }
+	    if (m != l) {
+		if (iter++ >= Itno)	/* too many iters */
+		    return (1);
+		g = (d[l + 1] - d[l]) / (2.0 * e[l]);
+		r = sqrt((g * g) + 1.0);
+		ra = (RND0(g) < 0.0) ? -fabs(r) : fabs(r);
+		g = d[m] - d[l] + e[l] / (g + ra);
+		s = c = 1.0;
+		p = 0.0;
+		for (i = m - 1; i >= l; i--) {
+		    f = s * e[i];
+		    b = c * e[i];
+		    if (fabs(f) >= fabs(g)) {
+			c = g / f;
+			r = sqrt((c * c) + 1.0);
+			e[i + 1] = f * r;
+			c *= (s = 1.0 / r);
+		    } else {
+			s = f / g;
+			r = sqrt((s * s) + 1.0);
+			e[i + 1] = g * r;
+			s *= (c = 1.0 / r);
+		    }
+		    g = d[i + 1] - p;
+		    r = (d[i] - g) * s + 2.0 * c * b;
+		    p = s * r;
+		    d[i + 1] = g + p;
+		    g = c * r - b;
+		    /* Next loop can be omitted if eigenvectors not wanted */
+		    for (k = 1; k <= n; k++) {
+			f = z[k][i + 1];
+			z[k][i + 1] = s * z[k][i] + c * f;
+			z[k][i] = c * z[k][i] - s * f;
+		    }
+		}
+		d[l] = d[l] - p;
+		e[l] = g;
+		e[m] = 0.0;
+	    }
+	} while (m != l);
+    }
+    return (0);
+}
+
+/* END of tqli */
+
+/* ==== END OF FUNCTIONS ql.c ==== */
diff --git a/src/ql.h b/src/ql.h
new file mode 100644
index 0000000..cacdc4e
--- /dev/null
+++ b/src/ql.h
@@ -0,0 +1,29 @@
+#ifndef __QL_H__
+#define __QL_H__
+
+/* ==== HEADER ql.h ==== */
+
+/* Eigenvalues and eigenvectors of real symmetric matrices by
+ Housholder tridiagonalisation and QL-transformation.
+ Adapted from Numerical Recipes. The "core" routines use 
+ the 1..N indexing convention but the "shell" is ordinary 
+ 0..N-1 C-style. Standalone version is eigenql.c */
+
+/* ANSI C, Iris Indigo IRIX 4.0.5, 20. Nov. 1992. Andris Aszodi */
+
+/* ---- INCLUDE FILES ---- */
+#include "matrix.h"
+
+
+/* ---- ROUNDOFF ERROR CHECK ---- */
+
+#define EPSILON 1.0e-10
+#define RND0(x) (x=(fabs(x)<EPSILON)? 0.0: (x))
+
+/* ---- PROTOTYPES ---- */
+
+extern int eigen_ql(Trimat_ Mat, int Size, double *Eval, Matrix_ Evec);
+
+/* ==== END OF HEADER ql.h ==== */
+
+#endif	/* __QL_H__ */
diff --git a/src/sap.c b/src/sap.c
new file mode 100644
index 0000000..e05dcd5
--- /dev/null
+++ b/src/sap.c
@@ -0,0 +1,1505 @@
+/*=============================================================================
+$Id: sap.c 12 2008-11-28 11:56:04Z jkleinj $
+SAP : Pairwise protein structure alignment via double dynamic programming
+(C) 1999 W.R. Taylor
+=============================================================================*/
+
+#include <assert.h>
+#include <string.h>
+
+#include "cones.h"	/* cones() also defined in bones, identical */
+#include "bestrot.h"
+#include "matrix.h"
+#include "pdbprot.h"
+#include "student.h"
+#include "geom.h"
+#include "sort.h"
+#include "util.h"
+
+#include "sap.h"
+
+#define CYCLES 5
+#define BIAS_WT 0.05
+#define BIAS_DAMP 0.5
+#define PATHSUM_WT 0.0
+#define PATH_WT 1.0
+#define N 2
+
+int self, one2one;
+int seqmat[NACID][NACID];
+
+char pdbcode[55];
+
+int main(argc, argv)
+int argc;
+char *argv[];
+{
+    Tri **a[N];
+    Cel **cel[N];
+    Seq seq[N];
+    /*char id[N * 4 + 1];*/
+	char file1[255], file2[255];
+    /*float **scores;
+    int i, j;*/
+	int cycles;
+    /*char *c;*/
+    float rms;
+	/*z = 1.0;*/
+    Pdbentry_ *prot1, *prot2;
+    long rseed = 234;
+    srand48(rseed);
+    if (argc < 3) {
+	printf("usage:  sap file1.pdb file2.pdb <one2one>\n");
+	printf("\t<one2one> is an integer value added to the diagonal\n");
+	printf("\tany negative value selects the default value of 1000\n");
+	exit(1);
+    } else {
+	strcpy(file1, argv[1]);
+	strcpy(file2, argv[2]);
+    }
+    strcpy(pdbcode, argv[2]);
+    Ps(file1) NL prot1 = get_pdb(file1, 1, 1);
+    Ps(prot1->Compound) NL cones(prot1);
+    Ps(file2) NL prot2 = get_pdb(file2, 1, 1);
+    Ps(prot2->Compound) NL cones(prot2);
+    matin();
+    protin(prot1, seq + 0, a + 0, cel + 0, 1.0, 0);
+    protin(prot2, seq + 1, a + 1, cel + 1, 1.0, 0);
+    self = 0;
+    cycles = CYCLES;
+    one2one = 0;
+    if (argc == 4) {
+	sscanf(argv[3], "%d", &one2one);
+	if (one2one < 0)
+	    one2one = 1000;
+	printf("\nBiasing 1:1 match with weight %d\n", one2one);
+	if (seq[0].len != seq[1].len) {
+	    printf
+		("*NB* proteins must have the same length for a 1:1 comparison\n");
+	    printf("(not %d and %d)\n", seq[0].len, seq[1].len);
+	    exit(1);
+	}
+    } else {
+	if (!strcmp(file1, file2)) {
+	    printf("Comparing structure to itself\n");
+	    printf("*NB* this looks for internal duplication\n\n");
+	    self = 1;
+	}
+    }
+    rms = compare(cycles, a[1], a[0], cel[1], cel[0], seq + 1, seq + 0, 1);
+    return 0;
+}
+
+void stats(int half, float **data, int n)
+{
+    /*float **data; int half, n; {
+	}*/
+
+    double fn1, fn2, ave1, ave2, var1, var2;
+    float sig1, sig2, dmax, dmin, smax, clear, score, noise;
+    int i, j, k, n1, n2;
+    n1 = n2 = 0;
+    ave1 = ave2 = 0.0;
+    smax = dmax = 0.0;
+    for (i = 0; i < n; i++) {
+	for (j = 0; j < n; j++) {
+	    if (half && i < j)
+		continue;
+	    k = i + j + 1;
+	    if (k - (2 * (k / 2)))
+		continue;
+	    k = i + j - 1;
+	    if ((i - j) * (i - j) == 1 && !(k - (4 * (k / 4)))) {
+		if (dmax < data[i][j])
+		    dmax = data[i][j];
+		ave1 += data[i][j];
+		n1++;
+	    } else {
+		if (smax < data[i][j])
+		    smax = data[i][j];
+		ave2 += data[i][j];
+		n2++;
+	    }
+	}
+    }
+    fn1 = (double) n1;
+    fn2 = (double) n2;
+    ave1 /= fn1;
+    ave2 /= fn2;
+    var1 = var2 = 0.0;
+    dmin = dmax;
+    noise = 0.0;
+    for (i = 0; i < n; i++) {
+	float d;
+	for (j = 0; j < n; j++) {
+	    if (half && i < j)
+		continue;
+	    k = i + j + 1;
+	    if (k - (2 * (k / 2)))
+		continue;
+	    k = i + j - 1;
+	    if ((i - j) * (i - j) == 1 && !(k - (4 * (k / 4)))) {
+		if (dmin > data[i][j])
+		    dmin = data[i][j];
+		d = data[i][j] - ave1;
+		var1 += d * d;
+	    } else {
+		d = data[i][j] - ave2;
+		var2 += d * d;
+	    }
+	    if (half || i < j)
+		continue;
+	    d = data[i][j] - data[j][i];
+	    noise += d * d;
+	}
+    }
+    var1 /= fn1;
+    var2 /= fn2;
+    stutest(ave1, ave2, var1, var2, n1, n2);
+    sig1 = sqrt(var1);
+    sig2 = sqrt(var2);
+    noise = sqrt(2.0 * noise / (fn1 + fn2));
+    score = (data[1][0] - ave2) / sig2;
+    clear = (dmin - smax) / sig2;
+    dmax = (dmax - ave2) / sig2;
+    dmin = (dmin - ave2) / sig2;
+    NLL printf("Alignment score = %5.3f StD(2) above mean controls\n",
+	       score);
+    printf("Worst score = %5.3f StD(2) above best control\n", clear);
+    printf("Max score = %5.3f, Min score = %5.3f\n", dmax, dmin);
+    printf("StD(1) = %5.3f, StD(2) = %5.3f\n", sig1, sig2);
+    if (half)
+	return;
+    printf("RMS alignment order noise = %5.3f\n\n", noise);
+    return;
+}
+
+int selsort(const void *ac, const void *bc)
+{
+/*const void *ac, *bc;*/
+    Pairs *a = (Pairs *) ac, *b = (Pairs *) bc;
+    if (a->c < b->c)
+	return 1;
+    if (a->c > b->c)
+	return -1;
+    return 0;
+}
+
+float compare(int cycles, Tri ** a, Tri ** b, Cel ** c, Cel ** d,
+	      Seq * seqa, Seq * seqb, int print)
+{
+/*Tri	**a, **b; 
+Cel	**c, **d; 
+Seq	*seqa, *seqb;
+int	cycles, print;
+{*/
+    float **bias, **sim, **sec;	/*, score;*/
+    int i, j, cycle, nsel;
+    int lena, lenb;
+    Pairs *sel;
+    lena = seqa->len;
+    lenb = seqb->len;
+    sel = (Pairs *) malloc(sizeof(Pairs) * lena * lenb);
+    assert(sel);
+    sec = (float **) malloc(sizeof(float *) * (lenb + 2));
+    assert(sec);
+    sim = (float **) malloc(sizeof(float *) * (lenb + 2));
+    assert(sim);
+    bias = (float **) malloc(sizeof(float *) * (lenb + 2));
+    assert(bias);
+    for (i = 0; i < lenb + 2; i++) {
+	sim[i] = (float *) malloc(sizeof(float) * (lena + 2));
+	assert(sim[i]);
+	sec[i] = (float *) malloc(sizeof(float) * (lena + 2));
+	assert(sec[i]);
+	bias[i] = (float *) malloc(sizeof(float) * (lena + 2));
+	assert(bias[i]);
+	for (j = 0; j < lena + 2; j++)
+	    bias[i][j] = 0.0;
+    }
+    for (i = 3; i < lenb - 1; i++) {
+	for (j = 3; j < lena - 1; j++) {
+	    float acc, rms, seq, aa, ab;	/*, dab;*/
+	    int ra, rb;
+	    aa = seqa->acc[j];
+	    ab = seqb->acc[i];
+	    acc = aa - ab;
+	    acc = exp(-acc * acc);
+	    rms = local_rms(j, i, lena, lenb, a, b);
+	    rms = exp(-rms * rms);
+	    sec[i][j] = rms;
+	    ra = seqa->res[j] - 'A';
+	    rb = seqb->res[i] - 'A';
+	    seq = log(1.0 + (float) seqmat[ra][rb]);
+	    bias[i][j] = acc + rms;
+	    if (print > 1) {
+		float d;
+		d = vdif(seqa->ca[j], seqb->ca[i]);
+		d = exp(-d * d * 0.01) * (float) print;
+		bias[i][j] += d;
+	    }
+	    bias[i][j] *=
+		(float) cellhits(c[j], d[i], a, b, j, i, lena, lenb);
+	    if (self) {
+		float off;
+		if (i >= j) {
+		    bias[i][j] = 0.0;
+		} else {
+		    off = 4.0 * (float) (j - i) / (float) lena - 2.0;
+		    bias[i][j] *= exp(-off * off);
+		}
+	    } else {
+		if (one2one && (i == j))
+		    bias[i][j] += (float) one2one;
+	    }
+	    sim[i][j] = bias[i][j];
+	}
+    }
+    nsel = 0;
+    recycle(0, seqa, seqb, bias, sel, sec, sim, a, b, &nsel, 0);
+    for (cycle = 1; cycle < cycles; cycle++) {
+	if (print)
+	    printf("Cycle %d, %d residues selected\n", cycle, nsel);
+	recycle(cycle, seqa, seqb, bias, sel, sec, sim, a, b, &nsel, 0);
+    }
+    cycle = cycles;
+    if (print)
+	printf("Cycle %d, %d residues selected\n", cycle, nsel);
+    return recycle(cycle, seqa, seqb, bias, sel, sec, sim, a, b, &nsel,
+		   print);
+}
+
+float local_rms(int m, int n, int lena, int lenb, Tri ** a, Tri ** b)
+{
+/*int     m,n, lena,lenb;
+Tri     **a, **b;
+{*/
+    float sum, d;
+    int i, j, k = 3;
+    sum = 0.0;
+    for (i = -k; i <= k; i++) {
+	if (m + i <= 0 || n + i <= 0)
+	    continue;
+	if (m + i >= lena || n + i >= lenb)
+	    continue;
+	for (j = -k; j <= k; j++) {
+	    if (m + j <= 0 || n + j <= 0)
+		continue;
+	    if (m + j >= lena || n + j >= lenb)
+		continue;
+	    d = a[m + i][m + j].d - b[n + i][n + j].d;
+	    sum += d * d;
+	}
+    }
+    k = 2 * k + 1;
+    k = k * k;
+    return sum / (float) k;
+}
+
+float recycle(int cycle, Seq * seqa, Seq * seqb, float **bias, Pairs * sel,
+	      float **sec, float **sim, Tri ** a, Tri ** b, int *nsel,
+	      int print)
+{
+/* int	cycle;
+Seq	*seqa, *seqb;
+float	**bias, **sec, **sim;
+Tri	**a, **b; 
+Pairs	*sel;
+int	*nsel, print;
+{ */
+    int **aln, len, i, j, n;
+    int lena, lenb, onaln;
+    float score, cyc_no = (float) cycle;
+    lena = seqa->len;
+    lenb = seqb->len;
+    if (*nsel)
+	score_pair(cyc_no, bias, sel, sim, a, b, lena, lenb, *nsel);
+    aln = (int **) malloc(sizeof(int *) * 2);
+    TEST(aln)
+	assert(aln);
+    for (i = 0; i < 2; i++) {
+	aln[i] = (int *) malloc(sizeof(int) * (lena + lenb));
+	TEST(aln[i])
+	    assert(aln[i]);
+    }
+    for (i = 1; i <= lenb; i++) {
+	for (j = 1; j <= lena; j++) {
+	    if (i == j)
+		bias[i][j] += (float) one2one;
+	    sim[i][j] += 0.1 * bias[i][j];
+	}
+    }
+    score = get_path(aln, sim, lena, lenb, &len);
+    if (print) {
+	NL Pr(score) NLL onaln = check_sel(aln, sel, *nsel, len);
+	printf("Percent sel on aln = %7.2f\n",
+	       100.0 * (float) onaln / (float) *nsel);
+	printf("Percent aln in sel = %7.2f\n",
+	       100.0 * (float) onaln / (float) len);
+	return super(a, b, seqa, seqb, sim, aln, len);
+    }
+    for (i = 1; i <= lenb; i++) {
+	for (j = 1; j <= lena; j++) {
+	    bias[i][j] *= BIAS_DAMP;
+	}
+    }
+    for (i = len; i > 0; i--) {
+	int p = aln[0][i], q = aln[1][i];
+	bias[q][p] += log(1.0 + sim[q][p]) * BIAS_WT;
+    }
+    normn(3.0, bias, lena, lenb);
+    if (!cycle) {
+	float sab, sa, sb;
+	sa = (float) (aln[0][1] - aln[0][len]);
+	sb = (float) (aln[1][1] - aln[1][len]);
+	if (sa > sb)
+	    sab = sb / sa;
+	else
+	    sab = sa / sb;
+	sab *= 3.0;
+	for (i = len; i > 0; i--) {
+	    int p = aln[0][i], q = aln[1][i];
+	    bias[q][p] *= sab;
+	}
+    }
+    n = 0;
+    for (i = 3; i <= lenb - 1; i++) {
+	for (j = 3; j <= lena - 1; j++) {
+	    sel[n].a = j;
+	    sel[n].b = i;
+	    sel[n].c = bias[i][j];
+	    n++;
+	}
+    }
+    if (n == 0) {
+	printf("*NB* No pairs selected\n");
+	exit(1);
+    }
+    qsort(sel, n - 1, sizeof(Pairs), selsort);
+    *nsel =
+	10 + (int) (0.05 * sqrt((float) (lena * lenb)) * (1.0 + cyc_no));
+    if (self)
+	*nsel /= 2;
+    if (*nsel > 100)
+	*nsel = 100;
+    return score;
+}
+
+int cellhits(Cel * lista, Cel * listb, Tri ** a, Tri ** b, int m, int n,
+	     int lena, int lenb)
+{
+/*Cel	*lista, *listb;
+Tri	**a, **b;
+int	m, n, lena, lenb;
+{*/
+    int hits, ka, kb;
+    ka = kb = hits = 1;
+    while (lista[ka].c > 0 && listb[kb].c > 0) {
+	int ja, jb;
+	if (lista[ka].c > listb[kb].c) {
+	    ka++;
+	    continue;
+	}
+	if (listb[kb].c > lista[ka].c) {
+	    kb++;
+	    continue;
+	}
+	/* same cell values */
+	if (lista[ka].r == m) {
+	    ka++;
+	    continue;
+	}
+	if (listb[kb].r == n) {
+	    kb++;
+	    continue;
+	}
+	/* neither is the central res */
+	for (ja = ka; lista[ja].c > 0 && lista[ja].c == lista[ka].c; ja++) {
+	    for (jb = kb; listb[jb].c > 0 && listb[jb].c == listb[kb].c;
+		 jb++) {
+		if (lista[ja].r > m && listb[jb].r < n)
+		    continue;
+		if (lista[ja].r < m && listb[jb].r > n)
+		    continue;
+		hits++;
+	    }
+	}
+	ka = ja;
+    }
+    return hits;
+}
+
+int check_sel(int **aln, Pairs * sel, int nsel, int naln)
+{
+    int i, j, n = 0;
+    for (i = 0; i < nsel; i++) {
+	int sela = sel[i].a, selb = sel[i].b;
+	for (j = 1; j <= naln; j++) {
+	    int alna = aln[0][j], alnb = aln[1][j];
+	    if (sela == alna && selb == alnb) {
+		n++;
+		break;
+	    }
+	}
+    }
+    return n;
+}
+
+void trace_mat(int **mat, int lena, int lenb)
+{
+/*int **mat, lena, lenb; {*/
+    int i, j;
+    NL Pi(lena) Pi(lenb) NL for (i = 1; i <= lenb; i++) {
+	for (j = 1; j <= lena; j++)
+	    printf("%3d", mat[i][j]);
+    NL}
+NL}
+
+void print_mat(float scale, float **mat, int lena, int lenb)
+{
+    /*float scale, **mat; int lena, lenb; {
+	}*/
+    int i, j;
+    NL Pi(lena) Pi(lenb) NL for (i = 1; i <= lenb; i++) {
+	for (j = 1; j <= lena; j++) {
+	    char c;
+	    float sij = mat[i][j] * scale;
+	    if (sij < 10.0)
+		c = '0' + (int) sij;
+	    else
+		c = 'A' + (int) (sij * 0.1) - 1;
+	    if (sij > 260.0)
+		c = '*';
+	    if (c == '0')
+		c = '.';
+	    printf("%c", c);
+	}
+    NL}
+NL}
+
+void score_pair(float dif_wt, float **bias, Pairs * sel, float **sim,
+		Tri ** a, Tri ** b, int la, int lb, int nsel)
+{
+/* float	dif_wt;
+float	**bias, **sim;
+Tri	**a, **b; 
+Pairs	*sel;
+int	la, lb, nsel;
+{*/
+    int i, j;			/*, k, l;*/
+    for (i = 0; i < lb + 2; i++) {
+	for (j = 0; j < la + 2; j++)
+	    sim[i][j] = 0.0;
+    }
+    for (i = 0; i < nsel; i++) {
+	score(dif_wt, bias, sim, a, b, sel[i].a, sel[i].b, la, lb);
+    }
+}
+
+#define SEQW 0.001
+#define CYCW 0.1
+#define DISW 0.001
+#define COSW 1.0
+#define VECW 0.1
+
+void score(float wt, float **bias, float **sim, Tri ** a, Tri ** b, int m,
+	   int n, int la, int lb)
+{
+/*float	wt;
+float	**bias, **sim;
+Tri	**a, **b; 
+int	m, n, la, lb;
+{*/
+    int i, j;			/*, k, na, nb, minlen;*/
+    float **smn, path_score;
+    smn = (float **) malloc(sizeof(float *) * (lb + 2));
+    assert(smn);
+    for (i = 0; i < lb + 2; i++) {
+	smn[i] = (float *) malloc(sizeof(float) * (la + 2));
+	assert(smn[i]);
+	for (j = 0; j < la + 2; j++)
+	    smn[i][j] = 0.0;
+    }
+    for (i = 1; i <= lb; i++) {
+	for (j = 1; j <= la; j++) {
+	    float cxd, cyd, czd, dif, gwt, swt, cdd, dwt, d;
+	    if (i <= n && j >= m)
+		continue;
+	    if (i >= n && j <= m)
+		continue;
+	    d = (float) (abs(n - i) + abs(m - j));
+	    swt = 1.0 - exp(-d * d * SEQW);
+	    cxd = a[m][j].cos.x - b[n][i].cos.x;
+	    cxd = exp(-cxd * cxd * COSW);
+	    cyd = a[m][j].cos.y - b[n][i].cos.y;
+	    cyd = exp(-cyd * cyd * COSW);
+	    czd = a[m][j].cos.z - b[n][i].cos.z;
+	    czd = exp(-czd * czd * COSW);
+	    cdd = cxd * cyd * czd;
+	    dif = vddif(a[m][j].v, b[n][i].v);
+	    dif = exp(-dif * VECW);
+	    gwt = exp(-wt * wt * CYCW);
+	    d = a[m][j].d + b[n][i].d;
+	    dwt = exp(-d * d * DISW);
+	    smn[i][j] = 10.0 * dwt * swt * dif * cdd + gwt * bias[i][j];
+	    if (self && i >= j)
+		smn[i][j] = 0.0;
+	}
+    }
+    path_score = add_path(sim, smn, la, lb, m, n);
+}
+
+float rescore(Tri ** a, Tri ** b, int m, int n, int **aln, int len)
+{
+/*Tri     **a, **b;
+int     m, n, **aln, len;
+{*/
+    int i, j, k;
+    float sum = 0.0;
+    for (k = len; k > 0; k--) {
+	float cxd, cyd, czd, dif, swt, cdd, dwt, d;
+	i = aln[1][k];
+	j = aln[0][k];
+	d = (float) (abs(n - i) + abs(m - j));
+	swt = 1.0 - exp(-d * d * SEQW);
+/*
+                        add = (float)(n-i);
+                        bdd = (float)(m-j);
+			d = add*add + bdd*bdd;
+                        swt = 1.0-exp(-d*SEQW);
+*/
+	cxd = a[m][j].cos.x - b[n][i].cos.x;
+	cxd = exp(-cxd * cxd * COSW);
+	cyd = a[m][j].cos.y - b[n][i].cos.y;
+	cyd = exp(-cyd * cyd * COSW);
+	czd = a[m][j].cos.z - b[n][i].cos.z;
+	czd = exp(-czd * czd * COSW);
+	cdd = cxd * cyd * czd;
+	dif = vddif(a[m][j].v, b[n][i].v);
+	dif = exp(-dif * VECW);
+	d = a[m][j].d + b[n][i].d;
+	dwt = exp(-d * d * DISW);
+/*
+                        add = a[m][j].d;
+			bdd = b[n][i].d;
+			d = add*add + bdd*bdd;
+                        dwt = exp(-d*DISW);
+*/
+	sum += 10.0 * dwt * swt * dif * cdd;
+    }
+    return sum;
+}
+
+float add_path(float **sim, float **smn, int na, int nb, int m, int n)
+{
+/*float	**sim, **smn;
+int	na, nb, m, n;
+{*/
+    int **aln, len, i;
+    float **s, score = 0.0;
+    aln = (int **) malloc(sizeof(int *) * 2);
+    TEST(aln)
+	for (i = 0; i < 2; i++) {
+	aln[i] = (int *) malloc(sizeof(int) * (na + nb));
+	TEST(aln[i])
+    }
+    if (m > 1 && n > 1) {
+	score = get_path(aln, smn, m - 1, n - 1, &len);
+	for (i = len; i > 0; i--) {
+	    int a = aln[0][i], b = aln[1][i];
+	    sim[b][a] += smn[b][a] * PATH_WT;
+	}
+    }
+    if (m < nb && n < na) {
+	s = (float **) malloc(sizeof(float *) * (nb + 2));
+	TEST(s)
+	    for (i = n; i < nb + 2; i++)
+	    s[i - n] = smn[i] + m;
+	score = get_path(aln, s, na - m, nb - n, &len);
+	for (i = len; i > 0; i--) {
+	    int a = aln[0][i], b = aln[1][i];
+	    sim[b + n][a + m] += s[b][a] * PATH_WT;
+	}
+    }
+    return score;
+}
+
+float get_path(int **aln, float **sim, int na, int nb, int *length)
+{
+/*int	**aln;
+float	**sim;
+int	na, nb, *length;
+{*/
+    float **mat;
+    int **ptr, i, j;		/*, k;*/
+    float score, *colmax, rowmax, gap = 10.0;	/* was 1 */
+    int *maxcol;		/*, len;*/
+    int maxrow = 0;
+    int maxi = 0;
+    int maxj = 0;
+    int naa = na + 2, nbb = nb + 2, now;
+    mat = (float **) malloc(sizeof(float *) * 2);
+    TEST(mat)
+	for (i = 0; i < 2; i++) {
+	mat[i] = (float *) malloc(sizeof(float) * naa);
+	TEST(mat[i])
+    }
+	/* JK debug Fri Nov  7 17:59:47 GMT 2008 : initialise matrix */
+    for (i = 0; i < 2; ++ i)
+		for (j = 0; j < naa; ++ j)
+			mat[i][j] = 0.;
+
+    ptr = (int **) malloc(sizeof(int *) * nbb);
+    TEST(ptr)
+	for (i = 0; i < nbb; i++) {
+	ptr[i] = (int *) malloc(sizeof(int) * naa);
+	TEST(ptr[i])
+    }
+	/* JK debug Fri Nov  7 17:59:47 GMT 2008 : initialise matrix */
+    for (i = 0; i < nbb; ++ i)
+		for (j = 0; j < naa; ++ j)
+			ptr[i][j] = 0;
+
+    colmax = (float *) malloc(sizeof(float) * (naa));
+    TEST(colmax)
+	maxcol = (int *) malloc(sizeof(int) * (naa));
+    TEST(maxcol)
+	for (i = 0; i < naa; i++) {
+	maxcol[i] = 0;
+	colmax[i] = mat[0][i] = mat[1][i] = -1.0;
+    }
+    score = 0.0;
+    now = 1;
+    for (i = 1; i < nbb; i++) {
+	rowmax = -1.0;
+	for (j = 1; j < naa; j++) {
+	    float dig, col, row, max;
+	    int cop, rop, top;
+	    rop = cop = top = 0;
+	    if (j > na || i > nb)
+		mat[now][j] = 0.0;
+	    else
+		mat[now][j] = sim[i][j];
+	    dig = mat[!now][j - 1];
+	    col = colmax[j - 1] - gap;
+	    row = rowmax - gap;
+	    if (col > dig) {
+		cop = i - maxcol[j - 1] - 1;
+	    } else {
+		colmax[j - 1] = dig;
+		maxcol[j - 1] = i - 1;
+	    }
+	    if (row > dig) {
+		rop = -(j - maxrow - 1);
+	    } else {
+		rowmax = dig;
+		maxrow = j - 1;
+	    }
+	    max = dig;
+	    if (row > max) {
+		max = row;
+		top = rop;
+	    }
+	    if (col > max) {
+		max = col;
+		top = cop;
+	    }
+	    mat[now][j] += max;
+	    ptr[i][j] = top;
+	    if (mat[now][j] > score) {
+		score = mat[now][j];
+		maxi = i;
+		maxj = j;
+	    }
+	}
+	now = !now;
+    }
+    *length = 0;
+    if (score > 0.1)
+	*length = trace(sim, ptr, aln, 0, maxi, maxj);
+    return score;
+}
+
+int trace(float **s, int **p, int **a, int n, int i, int j)
+{
+    /*float **s; int **p, **a, n, i, j;
+	{*/
+    if (s[i][j] < 0.0)
+	return n;
+    n++;
+    a[0][n] = j;
+    a[1][n] = i;
+    if (i <= 1 || j <= 1)
+	return n;
+    if (p[i][j] > 0)
+	i -= p[i][j];
+    if (p[i][j] < 0)
+	j += p[i][j];
+    return trace(s, p, a, n, --i, --j);
+}
+
+int protin(Pdbentry_ * prot, Seq * seq, Tri *** m, Cel *** c, float z,
+	   int flip)
+{
+/*Pdbentry_ *prot;
+Seq *seq; Tri ***m; Cel ***c; float z; int flip;
+{*/
+    int i, len;
+    Tri **mat;
+    Cel **cel;
+    len = copyca(prot->Chains, seq, flip, z);
+    mat = (Tri **) malloc(sizeof(Tri *) * (len + 2));
+    assert(mat);
+    cel = (Cel **) malloc(sizeof(Cel *) * (len + 2));
+    assert(cel);
+    for (i = 0; i <= len + 1; i++) {
+	mat[i] = (Tri *) malloc(sizeof(Tri) * (len + 2));
+	assert(mat[i]);
+	cel[i] = (Cel *) malloc(sizeof(Cel) * (len + 2));
+	assert(cel[i]);
+    }
+    add_cb(seq);
+    set_vect(seq->ca, seq->cb, mat, cel, len);
+    set_cbcb(seq->ca, seq->cb, mat, len);
+    *m = mat;
+    *c = cel;
+    return len;
+}
+
+void add_cb(Seq * seq)
+{
+    int i;
+    for (i = 1; i <= seq->len; i++) {
+	Vec n, c, b;
+	float bond = 3.0;
+	vsub(seq->ca[i], seq->ca[i - 1], &n);
+	vnorm(&n);
+	vsub(seq->ca[i], seq->ca[i + 1], &c);
+	vnorm(&c);
+	vadd(n, c, &b);
+	vnorm(&b);
+	vmul(&b, bond);
+	vadd(seq->ca[i], b, &seq->cb[i]);
+    }
+}
+
+int celsort(const void *ac, const void *bc)
+{
+    Cel *a = (Cel *) ac, *b = (Cel *) bc;
+    if (a->c < b->c)
+	return 1;
+    if (a->c > b->c)
+	return -1;
+    return 0;
+}
+
+void set_vect(Vec * a, Vec * b, Tri ** m, Cel ** c, int l)
+{
+    int i, j;
+    Mat frame;
+    float size = 0.3, cut = 20.0;
+    for (i = 1; i <= l; i++) {
+	setframe(a[i - 1], a[i], a[i + 1], &frame);
+	for (j = 1; j <= l; j++) {
+	    Vec s;
+	    m[i][j].d = vdif(a[i], a[j]);
+	    vinit(&(m[i][j].v));
+	    if (i == j)
+		continue;
+	    vsub(a[j], a[i], &s);
+	    VmulM(&frame, s, &(m[i][j].v));
+	    c[i][j].c = -1;
+	    if (fabs(m[i][j].v.x) > cut)
+		continue;
+	    if (fabs(m[i][j].v.y) > cut)
+		continue;
+	    if (fabs(m[i][j].v.z) > cut)
+		continue;
+	    c[i][j].c = 1000000 * (int) (100.0 + m[i][j].v.x * size)
+		+ 1000 * (int) (100.0 + m[i][j].v.y * size)
+		+ (int) (100.0 + m[i][j].v.z * size);
+	    c[i][j].r = j;
+	}
+	c[i][0].c = c[i][j].c = -1;
+	qsort(c[i], l, sizeof(Cel), celsort);
+    }
+}
+
+void set_cbcb(Vec * a, Vec * b, Tri ** m, int l)
+{
+/*      Vec *a, *b; Tri **m; int l; {*/
+    int i, j;
+    for (i = 1; i <= l; i++) {
+	Vec ai, bi, ci;
+	vsub(a[i + 1], a[i - 1], &ai);
+	vnorm(&ai);
+	vsub(b[i], a[i], &bi);
+	vnorm(&bi);
+	vprod(ai, bi, &ci);
+	for (j = 1; j <= l; j++) {
+	    Vec aj, bj, cj;
+	    vsub(a[j + 1], a[j - 1], &aj);
+	    vnorm(&aj);
+	    vsub(b[j], a[j], &bj);
+	    vnorm(&bj);
+	    vprod(aj, bj, &cj);
+	    m[i][j].cos.x = vdot(ai, aj);
+	    m[i][j].cos.y = vdot(bi, bj);
+	    m[i][j].cos.z = vdot(ci, cj);
+	}
+    }
+}
+
+void extend(Vec * res, int i, int j, int k, int new)
+{
+/*Vec	*res;
+int	i, j, k, new;
+{*/
+    Vec m, v;
+    vave(res[j], res[k], &m);
+    vsub(m, res[i], &v);
+    vadd(m, v, &res[new]);
+}
+
+int copyca(Chain_ * pdb, Seq * s, int flip, float z)
+{
+/*Chain_  *pdb;
+Seq	*s;
+int	flip;
+float	z;
+{*/
+    int i, n;
+    char *seq;
+    Vec *ca, *cb;
+    float *acc;
+    n = pdb->Aano;
+    seq = (char *) malloc(sizeof(char) * (n + 3));
+    assert(seq);
+    acc = (float *) malloc(sizeof(float) * (n + 3));
+    assert(acc);
+    ca = (Vec *) malloc(sizeof(Vec) * (n + 3));
+    assert(ca);
+    cb = (Vec *) malloc(sizeof(Vec) * (n + 3));
+    assert(cb);
+    for (i = 0; i < n; i++) {
+	ca[i + 1].x = pdb->Atoms[i].X;
+	ca[i + 1].y = pdb->Atoms[i].Y;
+	ca[i + 1].z = pdb->Atoms[i].Z;
+	acc[i + 1] = pdb->Atoms[i].Bfact;
+	seq[i + 1] = pdb->Atoms[i].Aa;
+	if (seq[i + 1] < 'A' || seq[i + 1] > 'Z') {
+	    printf("*NB* funny aa = %c\n", seq[i + 1]);
+	    seq[i + 1] = 'X';
+	}
+    }
+    seq[0] = 'n';
+    extend(ca, 3, 2, 1, 0);
+    extend(ca, n - 2, n - 1, n, n + 1);
+    seq[n + 1] = 'c';
+    seq[n + 2] = 0;
+    for (i = 0; i <= n + 1; i++)
+	ca[i].z *= z;
+    if (flip)
+	flipseq(ca, seq, acc, n);
+    s->res = seq;
+    s->acc = acc;
+    s->ca = ca;
+    s->cb = cb;
+    s->len = n;
+    return n;
+}
+
+void flipseq(Vec * ca, char *seq, float *acc, int n)
+{
+/*	Vec *ca; char *seq; float *acc; int n;
+{*/
+    int i;
+    for (i = 0; i <= n / 2; i++) {
+	Vec r;
+	char c;
+	float a;
+	int j = n + 1 - i;
+	r = ca[i];
+	ca[i] = ca[j];
+	ca[j] = r;
+	c = seq[i];
+	seq[i] = seq[j];
+	seq[j] = c;
+	a = acc[i];
+	acc[i] = acc[j];
+	acc[j] = a;
+    }
+}
+
+int getca(Vec * res, FILE * pdb)
+{
+/*Vec    *res;
+FILE	*pdb;
+{*/
+    int i = 1;
+    char line[225], junk[30];
+    while (!feof(pdb)) {
+	read_line(pdb, line);
+	if (!strncmp(line, "TER", 3))
+	    break;
+	if (strncmp(line, "ATOM", 4))
+	    continue;
+	if (strncmp(line + 13, "CA ", 3))
+	    continue;
+	sscanf(line, "%30c %f%f%f", junk, &res[i].x, &res[i].y, &res[i].z);
+	i++;
+    }
+    i--;
+    extend(res, 3, 2, 1, 0);
+    extend(res, i - 2, i - 1, i, i + 1);
+    return i;
+}
+
+void putpdb(Seq * seq, FILE * out, char id)
+{
+/*Seq	*seq;
+FILE    *out;
+char	id;
+{ */
+    int i = 0;			/*, n = 0;*/
+    int len = seq->len;
+    for (i = 1; i <= len; i++) {
+	fprintf(out,
+		"ATOM%7d  CA  GLY%c%5d     %7.3f %7.3f %7.3f  0.00  0.00\n",
+		i, id, i, seq->ca[i].x, seq->ca[i].y, seq->ca[i].z);
+    }
+    fprintf(out, "TER\n");
+}
+
+void setframe(Vec a, Vec b, Vec c, Mat * frame)
+{
+    /*Vec a, b, c;
+       Mat *frame;
+       { */
+    Vec x, y, z;
+    vsub(c, a, &x);
+    vave(c, a, &c);
+    vsub(c, b, &y);
+    vprod(y, x, &z);
+    vprod(z, x, &y);
+    vnorm(&x);
+    vnorm(&y);
+    vnorm(&z);
+    VtoM(x, y, z, frame);
+}
+
+int norm(float sigcut, float *data, int n)
+{
+    /*float sigcut, *data; int n; {*/
+    float fn, ave, var, sig;
+    int i, mods;
+    fn = (float) n;
+    ave = 0.0;
+    for (i = 0; i < n; i++)
+	ave += data[i];
+    ave /= fn;
+    var = 0.0;
+    for (i = 0; i < n; i++) {
+	var += data[i] * data[i];
+    }
+    var /= fn;
+    sig = sqrt(var);
+    mods = 0;
+    for (i = 0; i < n; i++) {
+	data[i] /= sig;
+	if (data[i] > sigcut) {
+	    data[i] = sigcut + 0.5 * (data[i] - sigcut);
+	    mods++;
+	}
+    }
+    return mods;
+}
+
+int normn(float sigcut, float **data, int m, int n)
+{
+/*float sigcut, **data; int m, n; {*/
+    float fn, dmax, ave, var, sig;
+    int i, j, mods;
+    fn = (float) (m * n);
+    ave = 0.0;
+    for (i = 1; i <= n; i++)
+	for (j = 1; j <= m; j++)
+	    ave += data[i][j];
+    ave /= fn;
+    var = 0.0;
+    for (i = 1; i <= n; i++)
+	for (j = 1; j <= m; j++)
+	    var += data[i][j] * data[i][j];
+    var /= fn;
+    sig = sqrt(var);
+    mods = 0;
+    dmax = 1.0;
+    for (i = 1; i <= n; i++)
+	for (j = 1; j <= m; j++) {
+	    data[i][j] /= sig;
+	    if (data[i][j] > sigcut) {
+		data[i][j] = sigcut + 0.5 * (data[i][j] - sigcut);
+		mods++;
+	    }
+	    if (data[i][j] > dmax)
+		dmax = data[i][j];
+	}
+    for (i = 1; i <= n; i++)
+	for (j = 1; j <= m; j++)
+	    data[i][j] /= dmax;
+    return mods;
+}
+
+void matin()
+{
+/*
+Mutation Data Matrix (120 PAMs) + 8
+*/
+    int mat[529] = {
+	3, -3, -1, 0, -3, -1, 0, 1, -3, -1, -3, -2, -2, -4, 1, 1, 1, -7,
+	-4, 0, 0, -1, -1,
+	-3, 6, -1, -3, -4, 1, -3, -4, 1, -2, -4, 2, -1, -5, -1, -1, -2, 1,
+	-5, -3, -2, -1, -2,
+	-1, -1, 4, 2, -5, 0, 1, 0, 2, -2, -4, 1, -3, -4, -2, 1, 0, -4, -2,
+	-3, 3, 0, -1,
+	0, -3, 2, 5, -7, 1, 3, 0, 0, -3, -5, -1, -4, -7, -3, 0, -1, -8, -5,
+	-3, 4, 3, -2,
+	-3, -4, -5, -7, 9, -7, -7, -4, -4, -3, -7, -7, -6, -6, -4, 0, -3,
+	-8, -1, -3, -6, -7, -4,
+	-1, 1, 0, 1, -7, 6, 2, -3, 3, -3, -2, 0, -1, -6, 0, -2, -2, -6, -5,
+	-3, 0, 4, -1,
+	0, -3, 1, 3, -7, 2, 5, -1, -1, -3, -4, -1, -3, -7, -2, -1, -2, -8,
+	-5, -3, 3, 4, -1,
+	1, -4, 0, 0, -4, -3, -1, 5, -4, -4, -5, -3, -4, -5, -2, 1, -1, -8,
+	-6, -2, 0, -2, -2,
+	-3, 1, 2, 0, -4, 3, -1, -4, 7, -4, -3, -2, -4, -3, -1, -2, -3, -3,
+	-1, -3, 1, 1, -2,
+	-1, -2, -2, -3, -3, -3, -3, -4, -4, 6, 1, -3, 1, 0, -3, -2, 0, -6,
+	-2, 3, -3, -3, -1,
+	-3, -4, -4, -5, -7, -2, -4, -5, -3, 1, 5, -4, 3, 0, -3, -4, -3, -3,
+	-2, 1, -4, -3, -2,
+	-2, 2, 1, -1, -7, 0, -1, -3, -2, -3, -4, 5, 0, -7, -2, -1, -1, -5,
+	-5, -4, 0, -1, -2,
+	-2, -1, -3, -4, -6, -1, -3, -4, -4, 1, 3, 0, 8, -1, -3, -2, -1, -6,
+	-4, 1, -4, -2, -2,
+	-4, -5, -4, -7, -6, -6, -7, -5, -3, 0, 0, -7, -1, 8, -5, -3, -4,
+	-1, 4, -3, -5, -6, -3,
+	1, -1, -2, -3, -4, 0, -2, -2, -1, -3, -3, -2, -3, -5, 6, 1, -1, -7,
+	-6, -2, -2, -1, -2,
+	1, -1, 1, 0, 0, -2, -1, 1, -2, -2, -4, -1, -2, -3, 1, 3, 2, -2, -3,
+	-2, 0, -1, -1,
+	1, -2, 0, -1, -3, -2, -2, -1, -3, 0, -3, -1, -1, -4, -1, 2, 4, -6,
+	-3, 0, 0, -2, -1,
+	-7, 1, -4, -8, -8, -6, -8, -8, -3, -6, -3, -5, -6, -1, -7, -2, -6,
+	12, -2, -8, -6, -7, -5,
+	-4, -5, -2, -5, -1, -5, -5, -6, -1, -2, -2, -5, -4, 4, -6, -3, -3,
+	-2, 8, -3, -3, -5, -3,
+	0, -3, -3, -3, -3, -3, -3, -2, -3, 3, 1, -4, 1, -3, -2, -2, 0, -8,
+	-3, 5, -3, -3, -1,
+	0, -2, 3, 4, -6, 0, 3, 0, 1, -3, -4, 0, -4, -5, -2, 0, 0, -6, -3,
+	-3, 4, 2, -1,
+	-1, -1, 0, 3, -7, 4, 4, -2, 1, -3, -3, -1, -2, -6, -1, -1, -2, -7,
+	-5, -3, 2, 4, -1,
+	-1, -2, -1, -2, -4, -1, -1, -2, -2, -1, -2, -2, -2, -3, -2, -1, -1,
+	-5, -3, -1, -1, -1, -2
+    };
+    int n, i, j, m = 8;
+    char acid[24];
+    strcpy(acid, "ARNDCQEGHILKMFPSTWYVBZX");
+    printf("%s\n", acid);
+    printf("matrix constant = %d\n", m);
+    for (i = 0; i < NACID; i++)
+	for (j = 0; j < NACID; j++)
+	    seqmat[i][j] = m;
+    n = 0;
+    for (i = 0; acid[i]; i++) {
+	int ai = acid[i] - 'A';
+	for (j = 0; acid[j]; j++) {
+	    int aj = acid[j] - 'A';
+	    seqmat[ai][aj] = mat[n] + m;
+	    n++;
+	}
+    }
+}
+
+void oldmatin(char *file, int mat[NACID][NACID])
+{
+    /*char    *file;
+       int     mat[NACID][NACID];
+       { */
+    int i, j, mat_const;
+    char acid[NACID], c;
+    FILE *mat_file;
+
+    mat_file = fopen(file, "r");
+    while (c = getc(mat_file), c != '\n')
+	putchar(c);
+    NL fscanf(mat_file, "%s\n", acid);
+    printf("%s\n", acid);
+    fscanf(mat_file, "%d\n", &mat_const);
+    printf("matrix constant = %d\n", mat_const);
+    for (i = 0; acid[i]; i++) {
+	int ai = acid[i] - 'A';
+	for (j = 0; acid[j]; j++) {
+	    int aj = acid[j] - 'A';
+	    fscanf(mat_file, "%d", &mat[ai][aj]);
+	    mat[ai][aj] += mat_const;
+	}
+    }
+}
+
+void moment(float **mom, Vec * struc, float *weight, int natom)
+{
+/*float   **mom, *weight;
+Vec    *struc;
+int     natom;
+{*/
+    Vec cog;
+    float sum = 0.0;
+    int i, j;
+    vinit(&cog);
+    for (i = 1; i <= natom; i++) {
+	Vec a;
+	vcopy(struc[i], &a);
+	vmul(&a, weight[i]);
+	vsum(a, &cog);
+	sum += weight[i];
+    }
+    vdiv(&cog, sum);
+    mom[0][0] = sum;
+    mom[0][1] = cog.x;
+    mom[0][2] = cog.y;
+    mom[0][3] = cog.z;
+    for (i = 1; i < 4; i++)
+	for (j = 1; j < 4; j++)
+	    mom[i][j] = 0.0;
+    for (i = 1; i <= natom; i++) {
+	Vec b;
+	vsub(struc[i], cog, &b);
+	vmul(&b, weight[i]);
+	mom[1][1] += b.x * b.x;
+	mom[2][2] += b.y * b.y;
+	mom[3][3] += b.z * b.z;
+	mom[1][2] = mom[2][1] += b.x * b.y;
+	mom[1][3] = mom[3][1] += b.x * b.z;
+	mom[2][3] = mom[3][2] += b.y * b.z;
+    }
+}
+
+float super(Tri ** stra, Tri ** strb, Seq * seqa, Seq * seqb, float **sim,
+	    int **aln, int len)
+{
+/*Tri	**stra, **strb;
+Seq	*seqa, *seqb;
+float	**sim;
+int	**aln, len;
+{*/
+    FILE *out;
+    Sqmat_ rot;
+    Mat mat;
+    Vec acnt, bcnt, *axis;
+    int *mm;
+    float *w, *sa, *sb;
+    double *ww, *ac, *bc;
+    double **va, **vb;
+    int na = seqa->len;
+    int nb = seqb->len;
+    float cut, rms, pct, suw, sud, sum = 0.0;
+    float sumrms = 0.0;
+    int i, j, n, id;
+    sa = (float *) malloc(sizeof(float) * (na + 2));
+    assert(sa);
+    for (i = 1; i <= na; i++)
+	sa[i] = 0.0;
+    sb = (float *) malloc(sizeof(float) * (nb + 2));
+    assert(sb);
+    for (i = 1; i <= nb; i++)
+	sb[i] = 0.0;
+    mm = (int *) malloc(sizeof(int) * len);
+    assert(mm);
+    w = (float *) malloc(sizeof(float) * len);
+    assert(w);
+    ww = (double *) malloc(sizeof(double) * len);
+    assert(ww);
+    va = (double **) malloc(sizeof(double *) * len);
+    assert(va);
+    vb = (double **) malloc(sizeof(double *) * len);
+    assert(vb);
+    axis = (Vec *) malloc(sizeof(Vec) * (len + 1));
+    assert(axis);
+    id = 0;
+    for (i = len; i > 0; i--) {
+	int a = aln[0][i], b = aln[1][i], h = i - 1;
+	char ra = seqa->res[a], rb = seqb->res[b], aa1, aa2, ab1, ab2;
+	float s;
+	if (ra == rb)
+	    id++;
+	aa1 = aa2 = ab1 = ab2 = ' ';
+	if (seqa->acc[a] > 0.0)
+	    aa1 = '*';
+	if (seqb->acc[b] > 0.0)
+	    ab1 = '*';
+	if (seqa->acc[a] > 0.5)
+	    aa2 = '*';
+	if (seqb->acc[b] > 0.5)
+	    ab2 = '*';
+	s = rescore(stra, strb, a, b, aln, len);
+	sum += s;
+	printf("%c%c%c %4d %5.1f%4d %c%c%c\n",
+	       aa2, aa1, ra, a, s, b, rb, ab1, ab2);
+	va[h] = (double *) malloc(sizeof(double) * 3);
+	assert(va[h]);
+	va[h][0] = seqa->ca[a].x;
+	va[h][1] = seqa->ca[a].y;
+	va[h][2] = seqa->ca[a].z;
+	vb[h] = (double *) malloc(sizeof(double) * 3);
+	assert(vb[h]);
+	vb[h][0] = seqb->ca[b].x;
+	vb[h][1] = seqb->ca[b].y;
+	vb[h][2] = seqb->ca[b].z;
+	sa[a] = sb[b] = sqrt(s);
+	w[i] = s;
+    }
+    pct = 100.0 * (float) id / (float) len;
+    for (i = 0; i < 10; i++)
+	norm(3.0, w + 1, len);
+    suw = 0.0;
+    for (i = 0; i < len; i++) {
+	w[i] = ww[i] = (double) w[i + 1];
+	suw += w[i];
+    }
+    rot = alloc_sqmat(3);
+    assert(rot);
+    ac = (double *) malloc(sizeof(double) * 3);
+    assert(ac);
+    bc = (double *) malloc(sizeof(double) * 3);
+    assert(bc);
+    rms = supermac(ww, va, vb, len, ac, bc, rot);
+    acnt.x = ac[0];
+    acnt.y = ac[1];
+    acnt.z = ac[2];
+    bcnt.x = bc[0];
+    bcnt.y = bc[1];
+    bcnt.z = bc[2];
+    mat.A.x = rot[0][0];
+    mat.A.y = rot[0][1];
+    mat.A.z = rot[0][2];
+    mat.B.x = rot[1][0];
+    mat.B.y = rot[1][1];
+    mat.B.z = rot[1][2];
+    mat.C.x = rot[2][0];
+    mat.C.y = rot[2][1];
+    mat.C.z = rot[2][2];
+    for (i = 0; i <= na + 1; i++)
+	vsub(seqa->ca[i], acnt, seqa->ca + i);
+    for (i = 0; i <= nb + 1; i++) {
+	vsub(seqb->ca[i], bcnt, seqb->ca + i);
+	MmulV(&mat, seqb->ca[i], seqb->ca + i);
+    }
+    sud = 0.0;
+    for (i = len; i > 0; i--) {
+	int a = aln[0][i], b = aln[1][i];
+	float d = vddif(seqa->ca[a], seqb->ca[b]);
+	sud += exp(-d * 0.1);
+    }
+    sud = 100 * sud / (float) len;
+    printf("%s Weighted RMSd = %7.3f over %d atoms %f %f %5.1f %f\n",
+	   pdbcode, rms, len, suw, sum, pct, sud);
+/*
+	if (self)
+	{ float wmax, **mom, **vec, val[4], x, y, z;
+	  Vec	cog;
+	  FILE  *axs;
+		axs = fopen("axis.pdb","w");
+		n = 0;
+		for (i=len; i>0; i--) 
+		{ int	a = aln[0][i], b = aln[1][i];
+			n++;
+			vave(seqa->ca[a],seqa->ca[b],axis+i);
+             		fprintf(axs,"ATOM%7d  CA  GLY C%4d     %7.3f %7.3f %7.3f  0.00 %5.2f\n",
+                        	n, n, axis[i].x, axis[i].y, axis[i].z, w[i]);
+		}
+                fprintf(axs,"TER\n");
+                mom = (float**)malloc(sizeof(float*)*4);
+                vec = (float**)malloc(sizeof(float*)*4);
+        	for (i=0; i<4; i++) {
+                	mom[i] = (float*)malloc(sizeof(float)*4);
+                	vec[i] = (float*)malloc(sizeof(float)*4);
+		}
+		moment(mom,axis,w,len);
+		eigen(mom,3,val,vec);
+		x = mom[0][1]-vec[1][1]*10.0;
+		y = mom[0][2]-vec[2][1]*10.0;
+		z = mom[0][3]-vec[3][1]*10.0;
+		n = 1;
+                fprintf(axs,"ATOM%7d  CA  GLY D%4d     %7.3f %7.3f %7.3f  0.00  0.00\n", n, n, x, y, z);
+		cog.x = x = mom[0][1];
+		cog.y = y = mom[0][2];
+		cog.z = z = mom[0][3];
+		n = 2;
+                fprintf(axs,"ATOM%7d  CA  GLY D%4d     %7.3f %7.3f %7.3f  0.00  0.00\n", n, n, x, y, z);
+		x = mom[0][1]+vec[1][1]*10.0;
+		y = mom[0][2]+vec[2][1]*10.0;
+		z = mom[0][3]+vec[3][1]*10.0;
+		n = 3;
+                fprintf(axs,"ATOM%7d  CA  GLY D%4d     %7.3f %7.3f %7.3f  0.00  0.00\n", n, n, x, y, z);
+                fprintf(axs,"TER\n");
+		fclose(axs);
+	}
+*/
+    superout(seqa, seqb, sa, sb, aln, len);
+    cut = 0.5;
+    for (j = 15; j; j--) {
+	n = 0;
+	for (i = 0; i < len; i++) {
+	    if (w[i + 1] > cut) {
+		n++;
+		ww[i] = 1.0;
+	    } else
+		ww[i] = 0.0;
+	}
+	rms = supermac(ww, va, vb, len, ac, bc, rot);
+	printf
+	    ("%s Un-weighted RMSd = %7.3f over best %d atoms ( %f  %5.1f )\n",
+	     pdbcode, rms, n, sum, pct);
+	cut *= 0.5;
+    }
+    out = fopen("plot.rms", "w");
+    sort(0, w, 0, mm, len, 1);
+    sumrms = 0.0;
+    for (i = 5; i < len; i++) {
+	for (j = 0; j < len; j++)
+	    ww[j] = 0.0;
+	for (j = 0; j <= i; j++)
+	    ww[mm[j]] = 1.0;
+	rms = supermac(ww, va, vb, len, ac, bc, rot);
+	sumrms += rms;
+	fprintf(out, "%d %7.3f %7.3f\n", j, rms, sumrms);
+    }
+    n = 0;
+    for (i = 0; i < len; i++) {
+	n++;
+	ww[i] = 1.0;
+    }
+    rms = supermac(ww, va, vb, len, ac, bc, rot);
+    printf
+	("%s Un-weighted RMSd = %7.3f over all %d matched atoms %f %f  %5.1f %f\n",
+	 pdbcode, rms, n, suw, sum, pct, sud);
+    return rms;
+}
+
+void superout(Seq * seqa, Seq * seqb, float *sa, float *sb, int **aln,
+	      int len)
+{
+/*Seq	*seqa, *seqb;
+float	*sa, *sb;
+int	**aln, len;
+{*/
+    FILE *out;
+    int i, nb, n = 1;
+    int lena, lenb;
+    char aa3[80], aaa[4];
+    strcpy(aa3,
+	   "ALAASXCYSASPGLUPHEGLYHISILEACELYSLEUMETASNPCAPROGLNARGSERTHRUNKVALTRPXXXTYRGLX");
+    out = fopen("super.pdb", "w");
+    lena = seqa->len;
+    for (i = 1; i <= lena; i++) {
+	strncpy(aaa, aa3 + 3 * (seqa->res[i] - 'A'), 3);
+	aaa[3] = 0;
+	fprintf(out,
+		"ATOM%7d  CA  %s A%4d     %7.3f %7.3f %7.3f %5.2f %5.2f\n",
+		n, aaa, i, seqa->ca[i].x, seqa->ca[i].y, seqa->ca[i].z,
+		0.5 * seqa->acc[i] + 0.5, sa[i]);
+	n++;
+    }
+    fprintf(out, "TER\n");
+    nb = n;
+    lenb = seqb->len;
+    for (i = 1; i <= lenb; i++) {
+	strncpy(aaa, aa3 + 3 * (seqb->res[i] - 'A'), 3);
+	aaa[3] = 0;
+	fprintf(out,
+		"ATOM%7d  CA  %s B%4d     %7.3f %7.3f %7.3f %5.2f %5.2f\n",
+		n, aaa, i, seqb->ca[i].x, seqb->ca[i].y, seqb->ca[i].z,
+		0.5 * seqb->acc[i] + 0.5, sb[i]);
+	n++;
+    }
+    fprintf(out, "TER\n");
+    for (i = len; i > 0; i--) {
+	int a = aln[0][i], b = aln[1][i] + nb - 1;
+	fprintf(out, "CONECT  %3d    0    0    0    0  %3d", a, b);
+	fprintf(out, "                                           :\n");
+    }
+    fprintf(out, "END\n");
+    {
+	float ss = 0.0;
+	for (i = 1; i <= len; i++) {
+	    ss += vddif(seqa->ca[i], seqb->ca[i]);
+/*Pi(i) Pv(seqa->ca[i]) Pv(seqb->ca[i])  Pr(ss) NL*/
+	}
+	ss = sqrt(ss / (float) len);
+    /*Pr(ss) NL */ /* JK 040210: commented out print statement */
+	}
+    fclose(out);
+}
+
+/*
+matplot("bias.ps",bias,lenb,lena,0);
+exit(1);
+*/
+void matplot(char *file, float **mat, int lena, int lenb, int logs)
+{
+/*char	*file;
+float	**mat;
+int	lena,lenb, logs;
+{*/
+    float hi, lo, span;
+    int i, j, size = 3;
+    FILE *out;
+    hi = -99999.9;
+    lo = 99999.9;
+    for (i = 0; i < lena; i++) {
+	for (j = 0; j < lenb; j++) {
+	    float x = mat[i][j];
+	    if (x > hi)
+		hi = x;
+	    if (x < lo)
+		lo = x;
+	}
+    }
+    span = hi - lo;
+    out = fopen(file, "w");
+    fprintf(out, "/Times-Roman findfont\n12 scalefont\nsetfont\n");
+    fprintf(out, "newpath\n");
+    for (i = 0; i < lena; i++) {
+	for (j = 0; j < lenb; j++) {
+	    float r, g, b, x;
+	    x = (mat[i][j] - lo) / span;
+	    if (logs)
+		x = 3.0 * log(x + 1.0) / log(2) - 1.0;
+	    else
+		x = 3.0 * x - 1.0;
+	    if (x > 0) {
+		if (x > 1.0) {
+		    r = x - 1.0;
+		    g = 2.0 - x;
+		    b = 0.0;
+		} else {
+		    b = 1.0 - x;
+		    g = x;
+		    r = 0.0;
+		}
+	    } else {
+		r = 0.0;
+		g = 0.0;
+		b = 1.0 + x;
+	    }
+	    fprintf(out, "%d %d moveto\n", i * size, j * size);
+	    fprintf(out,
+		    "0 10 rlineto\n10 0 rlineto\n0 -10 rlineto\nclosepath\n");
+	    fprintf(out, "%6.3f %6.3f %6.3f setrgbcolor\nfill\n", r, g, b);
+	}
+    }
+    fprintf(out, "showpage\n");
+    fclose(out);
+}
diff --git a/src/sap.h b/src/sap.h
new file mode 100644
index 0000000..35a8451
--- /dev/null
+++ b/src/sap.h
@@ -0,0 +1,67 @@
+#ifndef SAPIT_H_
+#define SAPIT_H_
+
+
+#define NALLOC 1000
+#define NACID 30
+
+typedef struct {
+	Vec	v;
+	float	d;
+	Vec	cos;
+} Tri;
+
+typedef struct {
+	int	c, r;
+} Cel;
+
+/*typedef struct {
+	int	a, b;
+	float	c;
+} Pairs;*/
+
+typedef struct {
+	char	*res;
+	float	*acc;
+	Vec	*ca, *cb;
+	int	len;
+} Seq;
+
+void stats (int half, float **data, int n);
+int selsort (const void *ac, const void *bc);
+float compare (int cycles, Tri **a, Tri **b, Cel **c, Cel **d, Seq *seqa, Seq *seqb, int print);
+float local_rms(int m, int n, int lena, int lenb, Tri **a, Tri **b);
+float recycle (int cycle, Seq *seqa, Seq *seqb, float **bias, Pairs *sel, float **sec, float **sim, Tri **a, Tri **b, int *nsel, int print);
+int cellhits (Cel *lista, Cel *listb, Tri **a, Tri **b, int m, int n, int lena, int lenb);
+int check_sel (int **aln, Pairs *sel, int nsel, int naln);
+void trace_mat (int **mat, int lena, int lenb);
+void print_mat (float scale, float **mat, int lena, int lenb);
+void score_pair (float dif_wt, float **bias, Pairs *sel, float **sim, Tri **a, Tri **b, int la, int lb, int nsel);
+void score_pair (float dif_wt, float **bias, Pairs *sel, float **sim, Tri **a, Tri **b, int la, int lb, int nsel);
+void score (float wt, float **bias, float **sim, Tri **a, Tri **b, int m, int n, int la, int lb);
+float rescore (Tri **a, Tri **b, int m, int n, int **aln, int len);
+float add_path (float **sim, float **smn, int na, int nb, int m, int n);
+float get_path (int **aln, float **sim, int na, int nb, int *length);
+int trace (float **s, int **p, int **a, int n, int i, int j);
+int protin (Pdbentry_ *prot, Seq *seq, Tri ***m, Cel ***c, float z, int flip);
+void add_cb (Seq *seq);
+int celsort (const void *ac, const void *bc);
+void set_vect (Vec *a, Vec *b, Tri **m, Cel **c, int l);
+void set_cbcb (Vec *a, Vec *b, Tri **m, int l);
+void extend (Vec *res, int i, int j, int k, int new);
+int copyca (Chain_ *pdb, Seq *s, int flip, float z);
+void flipseq (Vec *ca, char *seq, float *acc, int n);
+int getca (Vec *res, FILE *pdb);
+void putpdb (Seq *seq, FILE *out, char id);
+void setframe (Vec a, Vec b, Vec c, Mat *frame);
+int norm (float sigcut, float *data, int n);
+int normn (float sigcut, float **data, int m, int n);
+void matin();
+void oldmatin(char *file, int mat[NACID][NACID]);
+void moment (float **mom, Vec *struc, float *weight, int natom);
+float super (Tri **stra, Tri **strb, Seq *seqa, Seq *seqb, float **sim, int **aln, int len);
+void superout (Seq *seqa, Seq *seqb, float *sa, float *sb, int **aln, int len);
+void matplot (char *file, float **mat, int lena, int lenb, int logs);
+
+
+#endif /*SAPIT_H_*/
diff --git a/src/siva.c b/src/siva.c
new file mode 100644
index 0000000..4cfe800
--- /dev/null
+++ b/src/siva.c
@@ -0,0 +1,261 @@
+/* ==== FUNCTIONS siva.c ==== */
+
+/* Singular value decomposition: homebrew version */
+
+/* ANSI C, IRIX 4.0.5, 21. July 1994. Andris Aszodi */
+
+/* ----	HEADER AND INCLUDE FILES ---- */
+/* ---- STANDARD HEADERS ---- */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <float.h>
+#include <math.h>
+#include <assert.h>
+
+#include "matrix.h"
+#include "ql.h"
+#include "siva.h"
+
+/* ==== FUNCTIONS ==== */
+
+/* ---- SINGULAR VALUE DECOMPOSITION AND BACK-SUBSTITUTION ---- */
+
+/* siva_setup: allocates the matrices etc. for storing the
+ * decomposed form. The matrix to be decomposed is (Row x Col), 
+ * where Row>=Col. If Row<Col, then the rows in U will be padded
+ * to get a Col x Col matrix. The actual Row is returned.
+ * U is (Row x Col), W is Col long, V is (Col x Col).
+ */
+int siva_setup(int Row, int Col, double ***U, double **W, double ***V)
+{
+    double **u, *w, **v;	/* local matrices and vectors */
+    int i;
+
+    if (Row <= 0 || Col <= 0) {	/* para */
+	fprintf(stderr, "? siva_setup(): Bad dimensions (%d x %d)\n",
+		Row, Col);
+	return (Row);
+    }
+
+    /* If Row<Col, then u is padded with Col-Row zeroed rows 
+     * to make it a Col x Col matrix 
+     * and a warning is printed. 
+     */
+    if (Row < Col) {
+	fprintf(stderr, "? siva_setup(): %d x %d matrix, rows padded\n",
+		Row, Col);
+	Row = Col;
+    }
+    u = (double **) calloc(Row, sizeof(double *));
+    assert(u);
+    for (i = 0; i < Row; i++) {
+	u[i] = (double *) calloc(Col, sizeof(double));
+	assert(u[i]);
+    }
+
+    w = (double *) calloc(Col, sizeof(double));
+    assert(w);
+    v = (double **) calloc(Col, sizeof(double *));
+    assert(v);
+    for (i = 0; i < Col; i++) {
+	v[i] = (double *) calloc(Col, sizeof(double));
+	assert(v[i]);
+    }
+
+    /* return */
+    *U = u;
+    *W = w;
+    *V = v;
+    return (Row);		/* actual no. of rows, may be padded */
+}
+
+/* END of siva_setup */
+
+/* siva_decomp: singular value decomposition routine 
+ * based on a Hungarian linear algebra book by Pa'l Ro'zsa.
+ * It is assumed that
+ * siva_setup() has been called prior to siva_decomp(). The "padding"
+ * is taken care of automatically so Row<Col entries are accepted.
+ * (DO NOT use the Row value returned by siva_setup()! )
+ * SVD is carried out on A (which will be preserved).
+ * The result of the SVD A=UWV' 
+ * is returned in the arrays allocated by siva_setup():
+ * arrays: U is a Row x Col (or Col x Col) matrix, W contains the
+ * singular values in a vector and V is a Col x Col matrix.
+ * Return value: 1 if the built-in iteration limit in eigen_ql()
+ * is exceeded, 0 if OK.
+ */
+int siva_decomp(const double **A, int Row, int Col,
+		double **U, double *W, double **V)
+{
+    Trimat_ Ata = NULL;
+    register double Temp;
+    register int i, j, k;
+    int Err = 0;
+
+    /* construct the A'A matrix lower triangle in Ata */
+    Ata = alloc_trimat(Col);
+    assert(Ata);
+    for (i = 0; i < Col; i++)
+	for (j = 0; j <= i; j++) {
+	    Temp = 0.0;
+	    for (k = 0; k < Row; k++)
+		Temp += A[k][i] * A[k][j];
+	    Ata[i][j] = Temp;
+	}
+
+    /* get the eigenvalues and eigenvectors of Ata:
+     * W holds the eigenvalues sorted in decreasing
+     * order, V holds the corresponding eigenvectors
+     * as ROWS (also sorted)
+     */
+    Err = eigen_ql(Ata, Col, W, V);
+    free_matrix(Ata, Col);
+    if (Err)
+	return (1);
+
+    /* transpose V in place and sqrt the singular value vector W */
+    for (i = 0; i < Col; i++) {
+	Temp = W[i];
+	W[i] = (Temp < SIVA_MINVAL) ? 0.0 : sqrt(Temp);
+	for (j = 0; j < i; j++) {
+	    Temp = V[i][j];
+	    V[i][j] = V[j][i];
+	    V[j][i] = Temp;
+	}
+    }
+
+    /* get the matrix U: Ro'zsa says that A*v(j)=W[j]*u(j),
+     * where u(j) and v(j) are the j-th columns of U and V, 
+     * respectively. If W[j] is too small, then the corresponding
+     * u(j) will be set to 0 (cf. sqrt(W) above)
+     */
+    for (j = 0; j < Col; j++) {
+	if (W[j] == 0.0) {	/* set U[][j] to zero */
+	    for (i = 0; i < Row; i++)
+		U[i][j] = 0.0;
+	    continue;
+	}
+
+	for (i = 0; i < Row; i++) {
+	    Temp = 0.0;
+	    for (k = 0; k < Col; k++)
+		Temp += A[i][k] * V[k][j];
+	    U[i][j] = Temp / W[j];
+	}
+
+	/* If Row<Col, the rest of the U rows should be zero.
+	 * siva_setup() does this but as a precaution we
+	 * zero these rows here anyway
+	 */
+	if (Row < Col)
+	    for (i = Row; i < Col; i++)
+		memset(U[i], 0, Col * sizeof(double));
+
+    }
+    return (0);
+}
+
+/* END of siva_decomp */
+
+/* rank_cond: checks the N singular values W[] of a matrix 
+ * after SVD. If Cond!=NULL, then the condition number 
+ * (ratio of the largest and smallest singular value) is
+ * calculated. The singular values which are smaller than
+ * Eps times the largest are set to 0.0.
+ * Return value: the rank of the matrix.
+ */
+int rank_cond(double W[], int N, double Eps, double *Cond)
+{
+    double Wmax = -HUGE_VAL, Wmin = HUGE_VAL;
+    int i, Rank;
+
+    /* get the largest and smallest singular value */
+    for (i = 0; i < N; i++) {
+	if (W[i] > Wmax)
+	    Wmax = W[i];
+	if (W[i] < Wmin)
+	    Wmin = W[i];
+    }
+
+    /* calc the condition number: set to HUGE_VAL if Wmin==0.0 */
+    if (Cond != NULL)
+	*Cond = (Wmin == 0.0) ? HUGE_VAL : Wmax / Wmin;
+
+    /* set all singular values which are smaller than Eps*Wmax
+     * to zero: this is the conditioning. Calc the rank
+     */
+    Wmax *= fabs(Eps);
+    Rank = N;
+    for (i = 0; i < N; i++)
+	if (W[i] < Wmax) {
+	    W[i] = 0.0;
+	    Rank--;
+	}
+    return (Rank);
+}
+
+/* END of rank_cond */
+
+/* siva_solve: back-substitution routine for solving linear equations
+ * AX=B. A should be SV-decomposed into U, W and V' by siva_comp()
+ * and the weight vector should be "conditioned" (small entries
+ * zeroed) by rank_cond() prior to the call to this routine.
+ * U, W and V' are the decomposed and conditioned bits, Row and Col
+ * are the row and column numbers of A (Row may have been "padded"
+ * by siva_comp()!), B[] is the Row long right-hand-side vector.
+ * (Padding may be necessary here, too!)
+ * The result is returned in X[] (Col long).
+ */
+void siva_solve(const double **U, const double W[], const double **V,
+		int Row, int Col, const double B[], double X[])
+{
+    register double *Tmp = NULL;
+    register double Sum;
+    register int i, j;
+
+    /* get WU'*B first */
+    Tmp = (double *) calloc(Col, sizeof(double));	/* calloc() zeroing is essential here */
+    assert(Tmp);
+    for (j = 0; j < Col; j++)
+	if (W[j] != 0.0) {	/* skip zeroed */
+	    Sum = 0.0;
+	    for (i = 0; i < Row; i++)
+		Sum += U[i][j] * B[i];
+	    Tmp[j] = Sum / W[j];
+	}
+
+    /* multiply Tmp by V to get solution vector */
+    for (i = 0; i < Col; i++) {
+	Sum = 0.0;
+	for (j = 0; j < Col; j++)
+	    Sum += V[i][j] * Tmp[j];
+	X[i] = Sum;
+    }
+    free(Tmp);
+}
+
+/* END of siva_solve */
+
+/* free_siva: cleans up the space allocated to the 3 SVD arrays. */
+void free_siva(int Row, int Col, double **U, double *W, double **V)
+{
+    int i;
+
+    /* free up U: if Row<Col, then it is Col x Col */
+    if (Row < Col)
+	Row = Col;
+    for (i = 0; i < Row; i++)
+	free(U[i]);
+    free(U);
+    for (i = 0; i < Col; i++)
+	free(V[i]);
+    free(V);
+    free(W);
+}
+
+/* END of free_siva */
+
+/* ==== END OF FUNCTIONS siva.c ==== */
diff --git a/src/siva.h b/src/siva.h
new file mode 100644
index 0000000..8ed2a0a
--- /dev/null
+++ b/src/siva.h
@@ -0,0 +1,38 @@
+#ifndef __SIVA_H__
+#define __SIVA_H__
+
+/* ==== HEADER siva.h ==== */
+
+/* Singular value decomposition: homebrew version */
+
+/* ANSI C, IRIX 4.0.5, 21. July 1994. Andris Aszodi */
+
+
+
+/* ---- DEFINITIONS ---- */
+
+#ifdef DBL_EPSILON	/* precision */
+#define SIVA_EPSILON (10.0*DBL_EPSILON)
+#else
+#define SIVA_EPSILON (1.0e-10)
+#endif
+
+#ifdef FLT_MIN	    /* smallest acceptable eigenvalue */
+#define SIVA_MINVAL (100.0*FLT_MIN)
+#else
+#define SIVA_MINVAL (1.0e-37)	/* required by ANSI */
+#endif
+
+/* ---- PROTOTYPES ---- */
+
+int siva_setup(int Row, int Col, double ***U, double **W, double ***V);
+int siva_decomp(const double **A, int Row, int Col, 
+	double **U, double *W, double **V);
+int rank_cond(double W[], int N, double Eps, double *Cond);
+void siva_solve(const double **U, const double W[], const double **V, 
+	int Row, int Col, const double B[], double X[]);
+void free_siva(int Row, int Col, double **U, double *W, double **V);
+
+/* ==== END OF HEADER siva.h ==== */
+
+#endif
diff --git a/src/sort.c b/src/sort.c
new file mode 100644
index 0000000..c6a9cef
--- /dev/null
+++ b/src/sort.c
@@ -0,0 +1,137 @@
+#include <stdio.h>
+#include <math.h>
+#include "sort.h"
+
+/* SHELL SORT */
+
+void sorts(short *a, int n)
+{
+    register int i, j, m;
+
+    if (n <= 1)
+	return;			/* DEAL WITH TRIVIAL CASES */
+    m = n;
+    while (1) {			/* LOOP OF DECREASING SWOP SPAN */
+	m = m / 2;
+	if (m == 0)
+	    return;
+	for (i = 0; i < n - m; i++) {	/* LOOP OVER SWOPS */
+	    j = i;		/* LOOP TO BUBBLE UP */
+	    while (1) {
+		register int b;
+		if (a[j + m] >= a[j])
+		    break;
+		b = a[j];
+		a[j] = a[j + m];	/* EXCHANGE VALUES */
+		a[j + m] = b;
+		j = j - m;	/* RETURN TO TOP OF LIST */
+		if (j < 0)
+		    break;	/* ONLY IF ROOM */
+	    }
+	}
+    }
+}
+
+void sorti(int *a, int n)
+{
+    register int i, j, m;
+
+    if (n <= 1)
+	return;			/* DEAL WITH TRIVIAL CASES */
+    m = n;
+    while (1) {			/* LOOP OF DECREASING SWOP SPAN */
+	m = m / 2;
+	if (m == 0)
+	    return;
+	for (i = 0; i < n - m; i++) {	/* LOOP OVER SWOPS */
+	    j = i;		/* LOOP TO BUBBLE UP */
+	    while (1) {
+		register int b;
+		if (a[j + m] >= a[j])
+		    break;
+		b = a[j];
+		a[j] = a[j + m];	/* EXCHANGE VALUES */
+		a[j + m] = b;
+		j = j - m;	/* RETURN TO TOP OF LIST */
+		if (j < 0)
+		    break;	/* ONLY IF ROOM */
+	    }
+	}
+    }
+}
+
+void sortf(float *a, int n)
+{
+    register int i, j, m;
+
+    if (n <= 1)
+	return;			/* DEAL WITH TRIVIAL CASES */
+    m = n;
+    while (1) {			/* LOOP OF DECREASING SWOP SPAN */
+	m = m / 2;
+	if (m == 0)
+	    return;
+	for (i = 0; i < n - m; i++) {	/* LOOP OVER SWOPS */
+	    j = i;		/* LOOP TO BUBBLE UP */
+	    while (1) {
+		register int b;
+		if (a[j + m] >= a[j])
+		    break;
+		b = a[j];
+		a[j] = a[j + m];	/* EXCHANGE VALUES */
+		a[j + m] = b;
+		j = j - m;	/* RETURN TO TOP OF LIST */
+		if (j < 0)
+		    break;	/* ONLY IF ROOM */
+	    }
+	}
+    }
+}
+
+/* BINARY SORTS ON (p/f/i)a WITH POINTERS p (a IS UNCHANGED), BIGGEST TO TOP */
+
+void sort(Pairs * pa, float *fa, int *ia, int *p, int n, int init_pointers)
+{
+    register int i, j, m;
+    int pair = 0, floating = 0, integer = 0;
+
+    if (n <= 0)
+	return;			/* DEAL WITH TRIVIAL CASES */
+    if (n == 1) {
+	p[0] = 0;
+	return;
+    }
+    if (ia)
+	integer = 1;		/* SET NUMBER MODE */
+    if (fa)
+	floating = 1;
+    if (pa)
+	pair = 1;
+    if (init_pointers)
+	for (i = 0; i < n; i++)
+	    p[i] = i;		/* INITIALISE THE POINTERS */
+    m = n;
+    while (1) {			/* LOOP OF DECREASING SWOP SPAN */
+	m = m / 2;
+	if (m == 0)
+	    return;
+	for (i = 0; i < n - m; i++) {	/* LOOP OVER SWOPS */
+	    j = i;		/* LOOP TO BUBBLE UP */
+	    while (1) {
+		register int jp;
+		if (pair && pa[p[j + m]].s <= pa[p[j]].s)
+		    break;
+		if (floating && fa[p[j + m]] <= fa[p[j]])
+		    break;
+		if (integer && ia[p[j + m]] <= ia[p[j]])
+		    break;
+		jp = p[j];
+		p[j] = p[j + m];	/* EXCHANGE POINTERS */
+		p[j + m] = jp;
+		j = j - m;	/* RETURN TO TOP OF LIST */
+		if (j < 0)
+		    break;	/* ONLY IF ROOM */
+	    }
+	}
+    }
+}
diff --git a/src/sort.h b/src/sort.h
new file mode 100644
index 0000000..4f98371
--- /dev/null
+++ b/src/sort.h
@@ -0,0 +1,17 @@
+#ifndef __WT_SORT_H__
+#define __WT_SORT_H__
+
+/*typedef struct {  int a,b; float s; char c; } Pairs;*/
+
+typedef struct {
+	int	a, b;
+	float   s;
+	float	c;
+} Pairs;
+
+void sorts (short *a, int n );
+void sorti (int* a, int n );
+void sortf ( float* a, int n );
+void sort ( Pairs *pa, float *fa, int *ia, int *p, int n, int init_pointers );
+
+#endif
diff --git a/src/student.h b/src/student.h
new file mode 100644
index 0000000..dfda7f9
--- /dev/null
+++ b/src/student.h
@@ -0,0 +1,52 @@
+#ifndef __STUDENT_H__
+#define __STUDENT_H__
+
+/* ==== HEADER student.h ==== */
+
+/* t-test and F-test: originally from Numerical Recipes
+ * Converted into ANSI C from a Turbo Pascal 5.0 unit
+ * originally written in Hungary, 7-Nov-91
+ */
+
+/* ANSI C, IRIX 5.2, 5. Oct. 1994. Andris */
+
+/* ---- STANDARD HEADERS ---- */
+
+
+/* ---- PROTOTYPES ---- */
+
+void stutest (double Avg1, double Avg2, double Var1, double Var2, int n1, int n2);
+
+/* t_test: Student's t-test for two distributions that have the same
+ * "true" variance. Ave1, 2 are the averages, Var1, 2 are the variances.
+ * (These should pass an F-test for the Var1==Var2 hypothesis.)
+ * n1, n2 are the number of data points. 
+ * Return values: returns the probability (significance) level 
+ * and also returns the t-stat value in *T if T!=NULL. Returns -1.0 if
+ * something was fishy plus prints a warning on stderr.
+ */
+double t_test(double Ave1, double Ave2, double Var1, double Var2, 
+	int n1, int n2, double *T);
+
+/* tu_test: Student's t-test for two distributions with different
+ * variances. Ave1, 2 are the averages, Var1, 2 are the variances.
+ * (These should pass an F-test for the Var1!=Var2 hypothesis.)
+ * n1, n2 are the number of data points. 
+ * Return values: returns the probability (significance) level 
+ * and also returns the t-stat value in *T if T!=NULL. Returns -1.0 if
+ * something was fishy plus prints a warning on stderr.
+ */
+double tu_test(double Ave1, double Ave2, double Var1, double Var2, 
+	int n1, int n2, double *T);
+
+/* f_test: Fischer's F-test to decide whether Var1, 2 are different
+ * variances. n1, n2 are the no. of data points.
+ * Return values: returns the F-statistics probability (significance) 
+ * level. Also returns the F-value in *Fval if Fval!=NULL.
+ * Returns -1.0 if something silly happens.
+ */
+double f_test(double Var1, double Var2, int n1, int n2, double *Fval);
+
+/* ==== END OF HEADER student.h ==== */
+
+#endif
diff --git a/src/stutest.c b/src/stutest.c
new file mode 100644
index 0000000..76720f2
--- /dev/null
+++ b/src/stutest.c
@@ -0,0 +1,336 @@
+/* ==== PROGRAM stutest.c ==== */
+
+/* Tests whether the means of two distributions are different. */
+
+/* ANSI C, IRIX 5.2, 14. Oct. 1994. Andris */
+
+/* ---- STANDARD HEADERS ---- */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <math.h>
+
+/* ---- INCLUDE FILES ---- */
+
+#include "student.h"
+
+/* ---- DEFINITIONS ---- */
+
+#define SIGNIF (0.05)
+#define VERY_SIGNIF (0.01)
+
+/* ---- PROTOTYPES ---- */
+
+/*static int get_avgsd(double *Avg1, double *Avg2, double *Sd1, double *Sd2,
+		     int *n1, int *n2);*/
+static void list_results(double Avg1, double Avg2, double Sd1,
+			 double Sd2, double Fprob, double tprob);
+
+/* ==== MAIN ==== */
+
+/* The program reads its input from stdin which should
+ * consist of six numbers separated by whitespace and
+ * end in a newline:-
+ *	Avg1 Sd1 n1 Avg2 Sd2 n2 \n
+ * Avg1, 2 are averages, Sd1, 2 are S.D-s, n1, n2 are the
+ * no. of data points for distributions 1 and 2,  respectively.
+ * Output is listed to stdout and contains the significance
+ * limits for the averages and SDs as supplied by the t- and
+ * F-tests. An asterisk is printed for significances P<SIGNIF, 
+ * two asterisks for P<VERY_SIGNIF.
+ */
+
+void stutest(double Avg1, double Avg2, double Var1, double Var2, int n1,
+	     int n2)
+{
+    /*    double Sd1, Sd2, F, t, Fprob, tprob;*/
+    double F, t, Fprob, tprob;
+
+    /* test variance equality */
+    Fprob = f_test(Var1, Var2, n1, n2, &F);
+    if (Fprob < 0.0)
+	printf("Cannot perform F-test\n");
+
+    /* perform equal-variance or unequal-variance t-test
+     * depending on the result of the variance F-test 
+     */
+    if (Fprob < SIGNIF)
+	tprob = tu_test(Avg1, Avg2, Var1, Var2, n1, n2, &t);	/* unequal */
+    else
+	tprob = t_test(Avg1, Avg2, Var1, Var2, n1, n2, &t);	/* equal */
+
+    if (tprob < 0.0)
+	printf("Cannot perform t-test\n");
+    /* output to stdout */
+    list_results(Avg1, Avg2, Var1, Var2, Fprob, tprob);
+}
+
+/* ==== FUNCTIONS ==== */
+
+/* get_avgsd: reads the averages and SDs from stdin, in the order
+ * Avg1 Sd1 n1 Avg2 Sd2 n2, separated by whitespaces,  terminated
+ * by newline. Returns these values in the corresponding parameters.
+ * Return value: 0 at EOF, -1 if the line could not be parsed correctly,
+ * -2 for comment lines (ignored silently), 
+ * 1 if OK.
+ */
+/*static int get_avgsd(double *Avg1, double *Avg2, double *Sd1, double *Sd2,
+		     int *n1, int *n2)
+{
+    char Line[132];
+
+    if (NULL == fgets(Line, 130, stdin))
+	return (0);
+    if (Line[0] == '#')
+	return (-2);
+    if (6 > sscanf(Line, "%lf %lf %d %lf %lf %d",
+		   Avg1, Sd1, n1, Avg2, Sd2, n2))
+	return (-1);
+    else
+	return (1);
+}
+*/
+/* END of get_avgsd */
+
+/* list_results: list to stdout neatly. */
+static void list_results(double Avg1, double Avg2, double Var1,
+			 double Var2, double Fprob, double tprob)
+{
+    double Sd1, Sd2;
+    /* averages */
+    printf("Avg: %.2e %s %.2e Tprob=%.2e ",
+	   Avg1, (tprob < SIGNIF) ? ((Avg1 < Avg2) ? "<" : ">") : "=",
+	   Avg2, tprob);
+    if (tprob < SIGNIF)
+	putchar('*');
+    if (tprob < VERY_SIGNIF)
+	putchar('*');		/* second asterisk */
+    putchar('\n');
+
+    /* SDs */
+    Sd1 = sqrt(Var1);
+    Sd2 = sqrt(Var2);
+    printf("StD: %.2e %s %.2e Fprob=%.2e ",
+	   Sd1, (Fprob < SIGNIF) ? ((Sd1 < Sd2) ? "<" : ">") : "=", Sd2,
+	   Fprob);
+    if (Fprob < SIGNIF)
+	putchar('*');
+    if (Fprob < VERY_SIGNIF)
+	putchar('*');		/* second asterisk */
+    putchar('\n');
+
+}
+
+/* END of list_results */
+
+/* ==== END OF PROGRAM stutest.c ==== */
+
+/* ==== FUNCTIONS student.c ==== */
+
+/* t-test and F-test: originally from Numerical Recipes
+ * Converted into ANSI C from a Turbo Pascal 5.0 unit
+ * originally written in Hungary, 7-Nov-91
+ */
+
+/* ANSI C, IRIX 5.2, 5. Oct. 1994. Andris */
+
+/* ---- PROTOTYPES ---- */
+
+static double incompl_beta(double a, double b, double x);
+static double ln_gamma(double xx);
+static double beta_cf(double a, double b, double x);
+
+/* ==== FUNCTIONS ==== */
+
+/* t_test: Student's t-test for two distributions that have the same
+ * "true" variance. Ave1, 2 are the averages, Var1, 2 are the variances.
+ * (These should pass an F-test for the Var1==Var2 hypothesis.)
+ * n1, n2 are the number of data points. 
+ * Return values: returns the probability (significance) level 
+ * and also returns the t-stat value in *T if T!=NULL. Returns -1.0 if
+ * something was fishy plus prints a warning on stderr.
+ */
+double t_test(double Ave1, double Ave2, double Var1, double Var2,
+	      int n1, int n2, double *T)
+{
+    int Df;
+    double Svar, Tval, Prob;
+
+    Df = n1 + n2 - 2;		/* degrees of freedom */
+    if (Df <= 0) {
+	fprintf(stderr, "? t_test(): Invalid (%d) degrees of freedom\n",
+		Df);
+	return (-1.0);
+    }
+    Svar = ((n1 - 1) * Var1 + (n2 - 1) * Var2) / Df;	/* pooled variance */
+    Tval = fabs(Ave1 - Ave2) / sqrt(fabs(Svar * (1.0 / n1 + 1.0 / n2)));
+    Prob = incompl_beta(0.5 * Df, 0.5, (double) Df / (Df + Tval * Tval));
+    if (T != NULL)
+	*T = Tval;
+    return (Prob);
+}
+
+/* END of t_test */
+
+/* tu_test: Student's t-test for two distributions with different
+ * variances. Ave1, 2 are the averages, Var1, 2 are the variances.
+ * (These should pass an F-test for the Var1!=Var2 hypothesis.)
+ * n1, n2 are the number of data points. 
+ * Return values: returns the probability (significance) level 
+ * and also returns the t-stat value in *T if T!=NULL. Returns -1.0 if
+ * something was fishy plus prints a warning on stderr.
+ */
+double tu_test(double Ave1, double Ave2, double Var1, double Var2,
+	       int n1, int n2, double *T)
+{
+    double Tval, Df, Prob;
+
+    if (n1 <= 1 || n2 <= 1) {
+	fprintf(stderr, "? tu_test(): Invalid no. of data (%d, %d)\n", n1,
+		n2);
+	return (0.0);
+    }
+    Var1 /= n1;
+    Var2 /= n2;
+    Tval = fabs(Ave1 - Ave2) / sqrt(fabs(Var1 + Var2));	/* t-value */
+    /* degrees of freedom */
+
+    Df = (Var1 + Var2) * (Var1 + Var2) /
+	(Var1 * Var1 / (n1 - 1) + Var2 * Var2 / (n2 - 1));
+    Prob = incompl_beta(0.5 * Df, 0.5, Df / (Df + Tval * Tval));
+    if (T != NULL)
+	*T = Tval;
+    return (Prob);
+}
+
+/* END of tu_test */
+
+/* f_test: Fischer's F-test to decide whether Var1, 2 are different
+ * variances. n1, n2 are the no. of data points.
+ * Return values: returns the F-statistics probability (significance) 
+ * level. Also returns the F-value in *Fval if Fval!=NULL.
+ * Returns -1.0 if something silly happens.
+ */
+double f_test(double Var1, double Var2, int n1, int n2, double *Fval)
+{
+    int Df1, Df2;
+    double F, Prob;
+
+    /* check */
+    if (n1 <= 1 || n2 <= 1) {
+	fprintf(stderr, "? f_test(): Invalid no. of data (%d, %d)\n", n1,
+		n2);
+	return (0.0);
+    }
+
+    /* swap if Var2<Var1 */
+    if (Var1 > Var2) {
+	F = Var1 / Var2;
+	Df1 = n1 - 1;
+	Df2 = n2 - 1;
+    } else {
+	F = Var2 / Var1;
+	Df1 = n2 - 1;
+	Df2 = n1 - 1;
+    }
+    Prob = incompl_beta(0.5 * Df2, 0.5 * Df1, Df2 / (Df2 + Df1 * F));
+    if (Prob > 1.0)
+	Prob = 2.0 - Prob;
+    if (Fval != NULL)
+	*Fval = F;
+    return (Prob);
+}
+
+/* END of f_test */
+
+/* ---- AUXILIARIES ---- */
+
+/* incompl_beta: the incomplete beta function approximated
+ * by a continued fraction a la Numerical Recipes.
+ * If x is outside the range [0..1] then -1.0 is returned.
+ */
+static double incompl_beta(double a, double b, double x)
+{
+    double bt, Ibeta;
+
+    if (x < 0.0 || x > 1.0) {
+	fprintf(stderr, "? incompl_beta(): x=%.2e is out of range\n", x);
+	return (-1.0);
+    }
+    if (x == 0.0 || x == 1.0)
+	return (x);
+
+    bt = ln_gamma(a + b) - ln_gamma(a) - ln_gamma(b) + a * log(x) +
+	b * log(1.0 - x);
+    bt = exp(bt);
+    Ibeta = (x < ((a + 1.0) / (a + b + 2.0))) ?
+	bt * beta_cf(a, b, x) / a : 1.0 - bt * beta_cf(b, a, 1.0 - x) / b;
+    return (Ibeta);
+}
+
+/* END of incompl_beta */
+
+/* ln_gamma: returns the value of the logarithm of the Gamma function. */
+static double ln_gamma(double xx)
+{
+    static const double STP = 2.5066282746310005;
+    static const double Coeff[6] =
+	{ 76.18009172947146, -86.50532032941677, 24.01409824083091,
+	-1.231739572450155, 1.208650973866179e-3, -5.395239384953e-6
+    };
+    double x, Tmp, Ser;
+    int j;
+
+    x = xx - 1.0;
+    Tmp = x + 5.5;
+    Tmp -= (x + 0.5) * log(Tmp);
+    Ser = 1.0;
+    for (j = 0; j <= 5; j++) {
+	x += 1.0;
+	Ser += Coeff[j] / x;
+    }
+    return (log(STP * Ser) - Tmp);
+}
+
+/* END of ln_gamma */
+
+/* beta_cf: continued fraction approximation of the beta function. */
+static double beta_cf(double a, double b, double x)
+{
+    static const int ITMAX = 100;
+    static const double EPS = 1.0e-15;
+
+    double tem, qap, qam, qab, em, d;
+    double bz, bpp, bp, bm, az, app, am, aold, ap;
+    int m;
+
+    am = bm = az = 1.0;
+    qab = a + b;
+    qap = a + 1.0;
+    qam = a - 1.0;
+    bz = 1.0 - qab * x / qap;
+
+    for (m = 1; m <= ITMAX; m++) {
+	em = m;
+	tem = 2 * em;
+	d = em * (b - m) * x / ((qam + tem) * (a + tem));
+	ap = az + d * am;
+	bp = bz + d * bm;
+	d = -(a + em) * (qab + em) * x / ((a + tem) * (qap + tem));
+	app = ap + d * az;
+	bpp = bp + d * bz;
+	aold = az;
+	am = ap / bpp;
+	bm = bp / bpp;
+	az = app / bpp;
+	bz = 1.0;
+	if ((fabs(az - aold)) < (EPS * abs(az)))
+	    return (az);
+    }
+    fprintf(stderr, "? beta_cf(): Cannot converge in %d steps\n", ITMAX);
+    return (az);
+}
+
+/* END of beta_cf */
+
+/* ==== END OF FUNCTIONS student.c ==== */
diff --git a/src/util.c b/src/util.c
new file mode 100644
index 0000000..cd1b983
--- /dev/null
+++ b/src/util.c
@@ -0,0 +1,93 @@
+#include <stdio.h>
+#include <math.h>
+#include "util.h"
+
+unsigned int pack(int i, int j, int n)
+/*	references top half (+diag) of a 2D array (N*N) as a vector	*/
+{
+    unsigned int ip, jp;
+    if (n <= 0) {
+	printf("Bad dimension in IPACK\n");
+	return -1;
+    }
+    if (i <= 0) {
+	printf("Bad I in IPACK: i=%d\n", i);
+	return -2;
+    }
+    if (j <= 0) {
+	printf("Bad J in IPACK: j=%d\n", j);
+	return -3;
+    }
+    ip = max(i, j);
+    jp = min(i, j) - 1;
+    return (unsigned int) (ip - jp + n * jp - (jp * jp - jp) / 2);
+}
+
+void unpack(int *ip, int *jp, int n, unsigned int id)
+/*	references top half (+diag) of a 2D array (N*N) from a vector	*/
+{
+    unsigned int i, j;
+    double b = n + 0.5, a = b * b - 2 * id;
+    if (n > 65535)
+	printf("Error in UNPACK: n=%d is too big\n", n);
+    if (a <= 0.0)
+	printf("Error in UNPACK: n=%d, id=%d\n", n, id);
+    j = (unsigned int) (b - sqrt(a) - 0.00001);
+    i = j + id - n * j + (j * j - j) / 2;
+    j++;
+    if (j <= 0 || j > n)
+	printf("Bad J in UNPACK: j=%d (n=%d id=%d)\n", j, n, id);
+    if (i <= 0 || i > n)
+	printf("Bad I in UNPACK: i=%d (n=%d id=%d)\n", i, n, id);
+    *ip = min(i, j);
+    *jp = max(i, j);
+}
+
+int read_line(FILE * file, char *string)
+{
+    char c;
+    int i = 0;
+    *string = 0;
+    while ((c = getc(file))) {
+	/* printf("%d >%c<\n", c,c); */
+	if (feof(file))
+	    return -i - 1;
+	if (c == '\n')
+	    return i;
+	string[i] = c;
+	string[++i] = 0;
+    }
+    printf("Error in file reading!\n");
+    return (-1);
+}
+
+int next_line(FILE * file)
+{
+    char c;
+    while ((c = getc(file))) {
+	if (feof(file))
+	    return 0;
+	if (c == '\n')
+	    return 1;
+    }
+    printf("Error in file reading!\n");
+    return (0);
+}
+
+int min(int i, int j)
+{
+    if (i < j)
+	return i;
+    else
+	return j;
+}
+
+int max(int i, int j)
+{
+    if (i > j)
+	return i;
+    else
+	return j;
+}
+
+/* float fmax(float i,float j) { if(i>j) return i; else return j; } */
diff --git a/src/util.h b/src/util.h
new file mode 100644
index 0000000..53f90ec
--- /dev/null
+++ b/src/util.h
@@ -0,0 +1,58 @@
+#ifndef __WT_UTIL_H__
+#define __WT_UTIL_H__
+
+#include <stdio.h>
+#include <math.h>
+#include <ctype.h>
+#include <stdlib.h>
+
+
+#define LOWER(c)	((c)<'a'?((c)-'A'+'a'):(c))
+#define UPPER(c)	((c)<'a'?(c):((c)-'a'+'A'))
+#define DIST3v(v)	sqrt( (v).x*(v).x + (v).y*(v).y + (v).z*(v).z )
+#define DDIST3v(v)	(v).x*(v).x + (v).y*(v).y + (v).z*(v).z
+#define DIST3(x,y,z)	sqrt((x)*(x)+(y)*(y)+(z)*(z))
+#define PRINTi(i)     printf(" i = %d",i);
+#define Pi(i) printf(" " #i " = %d",i);
+#define PRINTr(r)     printf(" r = %f",r);
+#define Pr(r) printf(" " #r " = %f",r);
+#define PRINTc(x)     printf(" x = %c",x);
+#define Pc(x) printf(" " #x " = %c",x);
+#define PRINTs(x)     printf(" x = %s",x);
+#define Ps(x) printf(" " #x " = %s",x);
+#define	PRINTv(v)	printf(" v = %f %f %f", v.x, v.y, v.z);
+#define	Pv(v)	printf(" " #v " = %f %f %f", v.x, v.y, v.z);
+#define	PRINTe(v)	printf(" v = %f %f %f  %f", v.x, v.y, v.z, v.e);
+#define DO(i,n)		for ( i = 1; i <= n; i++)
+#define SP		printf(" ");
+#define SPP		printf("  ");
+#define SPPP		printf("   ");
+#define NL		printf("\n");
+#define NLL		printf("\n\n");
+#define NLLL		printf("\n\n\n");
+#define TEST(obj) 	if (obj == NULL) { printf("malloc fail for " #obj "\n"); exit(1); }
+#define REST(obj) 	if (obj == NULL) { printf("realloc fail for " #obj "\n"); exit(1); }
+
+# define YES 1
+# define NO  0
+# define SET   1
+# define UNSET 0
+# define LIVE 1
+# define DEAD 0
+# define TRUE  1
+# define FALSE 0
+# define LEFT -1
+# define RIGHT 1
+# define MAX 2147483647
+# define MIN -MAX
+# define BIG 1000000000
+# define WEE -BIG
+# define BYTE 255
+
+void unpack(int *ip, int *jp, int n,unsigned int id);
+int read_line(FILE* file, char *string);
+int next_line(FILE *file);
+int min(int i, int j);
+int max(int i, int j);
+
+#endif
diff --git a/tests/1bom_atm.pdb b/tests/1bom_atm.pdb
new file mode 100644
index 0000000..a9df04f
--- /dev/null
+++ b/tests/1bom_atm.pdb
@@ -0,0 +1,365 @@
+REMARK produced by stripper - version 1.0
+REMARK processed from 1BOM
+HEADER    INSULIN-LIKE BRAIN-SECRETORY PEPTIDE    21-JUL-94   1BOM      
+ATOM    310  N   GLN B  -1       3.122  -3.847  11.925  1.00  6.83      
+ATOM    311  CA  GLN B  -1       4.369  -3.822  11.092  1.00  6.13      
+ATOM    312  C   GLN B  -1       4.824  -5.217  10.648  1.00  5.60      
+ATOM    313  O   GLN B  -1       5.831  -5.719  11.106  1.00  6.19      
+ATOM    314  CB  GLN B  -1       5.495  -3.177  11.920  1.00  7.01      
+ATOM    315  CG  GLN B  -1       5.790  -4.013  13.172  1.00  7.84      
+ATOM    316  CD  GLN B  -1       5.516  -3.165  14.414  1.00  8.62      
+ATOM    317  OE1 GLN B  -1       4.747  -3.537  15.278  1.00  8.93      
+ATOM    318  NE2 GLN B  -1       6.124  -2.020  14.541  1.00  9.24      
+ATOM    327  N   PRO B   0       4.071  -5.814   9.756  1.00  4.72      
+ATOM    328  CA  PRO B   0       4.395  -7.150   9.250  1.00  4.51      
+ATOM    329  C   PRO B   0       5.679  -7.102   8.411  1.00  4.01      
+ATOM    330  O   PRO B   0       6.564  -6.313   8.679  1.00  4.14      
+ATOM    331  CB  PRO B   0       3.170  -7.541   8.386  1.00  4.30      
+ATOM    332  CG  PRO B   0       2.200  -6.339   8.379  1.00  4.05      
+ATOM    333  CD  PRO B   0       2.861  -5.210   9.175  1.00  4.26      
+ATOM    341  N   GLN B   1       5.757  -7.935   7.418  1.00  4.07      
+ATOM    342  CA  GLN B   1       6.972  -7.943   6.563  1.00  4.26      
+ATOM    343  C   GLN B   1       6.949  -6.774   5.581  1.00  3.48      
+ATOM    344  O   GLN B   1       7.982  -6.253   5.214  1.00  3.96      
+ATOM    345  CB  GLN B   1       7.010  -9.256   5.770  1.00  5.22      
+ATOM    346  CG  GLN B   1       5.583  -9.774   5.571  1.00  5.54      
+ATOM    347  CD  GLN B   1       5.153 -10.566   6.808  1.00  6.64      
+ATOM    348  OE1 GLN B   1       5.937 -11.273   7.410  1.00  7.30      
+ATOM    349  NE2 GLN B   1       3.918 -10.479   7.218  1.00  7.45      
+ATOM    358  N   ALA B   2       5.767  -6.384   5.178  1.00  2.97      
+ATOM    359  CA  ALA B   2       5.647  -5.259   4.228  1.00  3.02      
+ATOM    360  C   ALA B   2       4.255  -5.217   3.617  1.00  2.54      
+ATOM    361  O   ALA B   2       3.785  -6.182   3.050  1.00  3.37      
+ATOM    362  CB  ALA B   2       6.661  -5.440   3.105  1.00  4.38      
+ATOM    368  N   VAL B   3       3.630  -4.093   3.755  1.00  2.03      
+ATOM    369  CA  VAL B   3       2.259  -3.931   3.198  1.00  2.16      
+ATOM    370  C   VAL B   3       1.828  -2.474   3.214  1.00  2.07      
+ATOM    371  O   VAL B   3       1.061  -2.026   2.386  1.00  2.69      
+ATOM    372  CB  VAL B   3       1.298  -4.723   4.087  1.00  2.35      
+ATOM    373  CG1 VAL B   3       1.084  -3.957   5.396  1.00  2.99      
+ATOM    374  CG2 VAL B   3      -0.042  -4.886   3.369  1.00  2.98      
+ATOM    384  N   HIS B   4       2.336  -1.779   4.173  1.00  1.67      
+ATOM    385  CA  HIS B   4       1.998  -0.335   4.316  1.00  1.94      
+ATOM    386  C   HIS B   4       1.956   0.370   2.971  1.00  1.93      
+ATOM    387  O   HIS B   4       1.084   1.175   2.714  1.00  3.30      
+ATOM    388  CB  HIS B   4       3.075   0.330   5.177  1.00  2.18      
+ATOM    389  CG  HIS B   4       4.222  -0.654   5.376  1.00  2.27      
+ATOM    390  ND1 HIS B   4       4.565  -1.169   6.480  1.00  2.56      
+ATOM    391  CD2 HIS B   4       5.099  -1.175   4.449  1.00  2.85      
+ATOM    392  CE1 HIS B   4       5.564  -1.951   6.318  1.00  3.01      
+ATOM    393  NE2 HIS B   4       5.959  -2.002   5.057  1.00  3.39      
+ATOM    401  N   THR B   5       2.886   0.026   2.139  1.00  1.58      
+ATOM    402  CA  THR B   5       2.959   0.638   0.801  1.00  1.54      
+ATOM    403  C   THR B   5       2.740   2.151   0.856  1.00  1.56      
+ATOM    404  O   THR B   5       2.600   2.725   1.918  1.00  2.04      
+ATOM    405  CB  THR B   5       1.881   0.005  -0.066  1.00  1.82      
+ATOM    406  OG1 THR B   5       0.656   0.243   0.601  1.00  2.10      
+ATOM    407  CG2 THR B   5       2.018  -1.523  -0.102  1.00  1.79      
+ATOM    415  N   TYR B   6       2.748   2.766  -0.297  1.00  1.27      
+ATOM    416  CA  TYR B   6       2.546   4.232  -0.364  1.00  1.34      
+ATOM    417  C   TYR B   6       1.469   4.569  -1.394  1.00  1.30      
+ATOM    418  O   TYR B   6       0.771   3.692  -1.861  1.00  1.64      
+ATOM    419  CB  TYR B   6       3.881   4.801  -0.807  1.00  1.33      
+ATOM    420  CG  TYR B   6       4.888   3.700  -0.543  1.00  1.36      
+ATOM    421  CD1 TYR B   6       5.291   3.440   0.744  1.00  1.61      
+ATOM    422  CD2 TYR B   6       5.277   2.848  -1.553  1.00  1.22      
+ATOM    423  CE1 TYR B   6       6.058   2.340   1.026  1.00  1.71      
+ATOM    424  CE2 TYR B   6       6.046   1.745  -1.278  1.00  1.33      
+ATOM    425  CZ  TYR B   6       6.448   1.479   0.018  1.00  1.58      
+ATOM    426  OH  TYR B   6       7.225   0.374   0.299  1.00  1.74      
+ATOM    436  N   CYS B   7       1.342   5.822  -1.734  1.00  1.24      
+ATOM    437  CA  CYS B   7       0.304   6.193  -2.735  1.00  1.22      
+ATOM    438  C   CYS B   7       0.596   7.565  -3.345  1.00  1.18      
+ATOM    439  O   CYS B   7       0.498   8.576  -2.679  1.00  1.45      
+ATOM    440  CB  CYS B   7      -1.060   6.233  -2.026  1.00  1.51      
+ATOM    441  SG  CYS B   7      -1.327   5.062  -0.665  1.00  1.69      
+ATOM    446  N   GLY B   8       0.953   7.569  -4.606  1.00  0.99      
+ATOM    447  CA  GLY B   8       1.258   8.864  -5.284  1.00  1.05      
+ATOM    448  C   GLY B   8       2.646   9.360  -4.874  1.00  1.06      
+ATOM    449  O   GLY B   8       3.028   9.215  -3.735  1.00  1.10      
+ATOM    453  N   ARG B   9       3.364   9.929  -5.819  1.00  1.11      
+ATOM    454  CA  ARG B   9       4.737  10.447  -5.517  1.00  1.12      
+ATOM    455  C   ARG B   9       5.645   9.347  -4.993  1.00  1.02      
+ATOM    456  O   ARG B   9       6.563   8.925  -5.662  1.00  0.94      
+ATOM    457  CB  ARG B   9       4.633  11.526  -4.450  1.00  1.25      
+ATOM    458  CG  ARG B   9       5.995  12.214  -4.290  1.00  1.29      
+ATOM    459  CD  ARG B   9       6.174  12.622  -2.833  1.00  1.46      
+ATOM    460  NE  ARG B   9       5.090  13.574  -2.465  1.00  2.09      
+ATOM    461  CZ  ARG B   9       5.339  14.533  -1.614  1.00  2.51      
+ATOM    462  NH1 ARG B   9       5.999  15.583  -2.021  1.00  2.77      
+ATOM    463  NH2 ARG B   9       4.920  14.411  -0.384  1.00  2.94      
+ATOM    477  N   HIS B  10       5.403   8.933  -3.789  1.00  1.08      
+ATOM    478  CA  HIS B  10       6.245   7.868  -3.220  1.00  1.09      
+ATOM    479  C   HIS B  10       6.420   6.737  -4.219  1.00  0.99      
+ATOM    480  O   HIS B  10       7.283   5.899  -4.060  1.00  1.07      
+ATOM    481  CB  HIS B  10       5.578   7.389  -1.942  1.00  1.21      
+ATOM    482  CG  HIS B  10       5.717   8.546  -0.961  1.00  1.32      
+ATOM    483  ND1 HIS B  10       6.722   9.315  -0.899  1.00  1.69      
+ATOM    484  CD2 HIS B  10       4.810   9.073  -0.082  1.00  1.45      
+ATOM    485  CE1 HIS B  10       6.513  10.264  -0.075  1.00  1.82      
+ATOM    486  NE2 HIS B  10       5.319  10.177   0.490  1.00  1.56      
+ATOM    494  N   LEU B  11       5.593   6.739  -5.237  1.00  0.88      
+ATOM    495  CA  LEU B  11       5.702   5.674  -6.258  1.00  0.81      
+ATOM    496  C   LEU B  11       6.556   6.182  -7.407  1.00  0.80      
+ATOM    497  O   LEU B  11       7.190   5.407  -8.097  1.00  0.85      
+ATOM    498  CB  LEU B  11       4.303   5.307  -6.796  1.00  0.76      
+ATOM    499  CG  LEU B  11       3.628   4.286  -5.864  1.00  0.82      
+ATOM    500  CD1 LEU B  11       4.451   2.989  -5.792  1.00  1.33      
+ATOM    501  CD2 LEU B  11       3.502   4.888  -4.466  1.00  1.54      
+ATOM    513  N   ALA B  12       6.563   7.479  -7.606  1.00  0.83      
+ATOM    514  CA  ALA B  12       7.392   8.006  -8.718  1.00  0.88      
+ATOM    515  C   ALA B  12       8.848   7.998  -8.282  1.00  0.84      
+ATOM    516  O   ALA B  12       9.751   8.184  -9.074  1.00  1.18      
+ATOM    517  CB  ALA B  12       6.959   9.445  -9.031  1.00  1.05      
+ATOM    523  N   ARG B  13       9.032   7.783  -7.012  1.00  0.77      
+ATOM    524  CA  ARG B  13      10.400   7.744  -6.450  1.00  0.90      
+ATOM    525  C   ARG B  13      10.839   6.288  -6.355  1.00  0.87      
+ATOM    526  O   ARG B  13      12.012   5.973  -6.353  1.00  0.94      
+ATOM    527  CB  ARG B  13      10.344   8.358  -5.040  1.00  1.07      
+ATOM    528  CG  ARG B  13      11.688   8.171  -4.333  1.00  1.22      
+ATOM    529  CD  ARG B  13      12.799   8.779  -5.193  1.00  1.37      
+ATOM    530  NE  ARG B  13      13.912   9.222  -4.307  1.00  2.13      
+ATOM    531  CZ  ARG B  13      14.645  10.241  -4.662  1.00  2.48      
+ATOM    532  NH1 ARG B  13      14.226  11.447  -4.387  1.00  2.90      
+ATOM    533  NH2 ARG B  13      15.773  10.022  -5.281  1.00  3.25      
+ATOM    547  N   THR B  14       9.861   5.433  -6.269  1.00  0.92      
+ATOM    548  CA  THR B  14      10.138   3.978  -6.171  1.00  1.02      
+ATOM    549  C   THR B  14      10.786   3.449  -7.450  1.00  0.88      
+ATOM    550  O   THR B  14      11.848   2.860  -7.407  1.00  0.94      
+ATOM    551  CB  THR B  14       8.796   3.262  -5.969  1.00  1.24      
+ATOM    552  OG1 THR B  14       8.200   3.892  -4.852  1.00  1.57      
+ATOM    553  CG2 THR B  14       8.989   1.806  -5.522  1.00  1.30      
+ATOM    561  N   LEU B  15      10.146   3.676  -8.571  1.00  0.86      
+ATOM    562  CA  LEU B  15      10.733   3.179  -9.848  1.00  1.01      
+ATOM    563  C   LEU B  15      11.927   4.004 -10.252  1.00  1.13      
+ATOM    564  O   LEU B  15      12.426   3.888 -11.349  1.00  1.42      
+ATOM    565  CB  LEU B  15       9.670   3.245 -10.948  1.00  1.14      
+ATOM    566  CG  LEU B  15       8.421   2.494 -10.484  1.00  0.61      
+ATOM    567  CD1 LEU B  15       7.442   2.391 -11.654  1.00  1.35      
+ATOM    568  CD2 LEU B  15       8.828   1.085 -10.027  1.00  1.23      
+ATOM    580  N   ALA B  16      12.331   4.839  -9.359  1.00  1.01      
+ATOM    581  CA  ALA B  16      13.500   5.704  -9.633  1.00  1.24      
+ATOM    582  C   ALA B  16      14.650   5.192  -8.807  1.00  1.32      
+ATOM    583  O   ALA B  16      15.790   5.556  -9.009  1.00  1.56      
+ATOM    584  CB  ALA B  16      13.185   7.140  -9.222  1.00  1.23      
+ATOM    590  N   ASP B  17      14.293   4.371  -7.861  1.00  1.18      
+ATOM    591  CA  ASP B  17      15.301   3.778  -6.967  1.00  1.33      
+ATOM    592  C   ASP B  17      15.477   2.325  -7.360  1.00  1.37      
+ATOM    593  O   ASP B  17      16.505   1.726  -7.115  1.00  1.61      
+ATOM    594  CB  ASP B  17      14.798   3.856  -5.521  1.00  1.40      
+ATOM    595  CG  ASP B  17      15.829   4.598  -4.668  1.00  1.88      
+ATOM    596  OD1 ASP B  17      16.158   5.706  -5.058  1.00  2.06      
+ATOM    597  OD2 ASP B  17      16.229   4.014  -3.674  1.00  2.49      
+ATOM    602  N   LEU B  18      14.452   1.781  -7.970  1.00  1.18      
+ATOM    603  CA  LEU B  18      14.545   0.367  -8.390  1.00  1.23      
+ATOM    604  C   LEU B  18      15.233   0.297  -9.735  1.00  1.33      
+ATOM    605  O   LEU B  18      16.171  -0.449  -9.909  1.00  1.50      
+ATOM    606  CB  LEU B  18      13.147  -0.212  -8.517  1.00  1.14      
+ATOM    607  CG  LEU B  18      12.568  -0.398  -7.121  1.00  1.06      
+ATOM    608  CD1 LEU B  18      11.051  -0.266  -7.199  1.00  1.71      
+ATOM    609  CD2 LEU B  18      12.942  -1.791  -6.611  1.00  1.82      
+ATOM    621  N   CYS B  19      14.756   1.072 -10.677  1.00  1.31      
+ATOM    622  CA  CYS B  19      15.413   1.034 -12.005  1.00  1.54      
+ATOM    623  C   CYS B  19      16.864   1.412 -11.781  1.00  1.75      
+ATOM    624  O   CYS B  19      17.719   1.237 -12.626  1.00  2.01      
+ATOM    625  CB  CYS B  19      14.751   2.072 -12.916  1.00  1.60      
+ATOM    626  SG  CYS B  19      13.714   1.452 -14.263  1.00  1.69      
+ATOM    631  N   TRP B  20      17.080   1.932 -10.606  1.00  1.68      
+ATOM    632  CA  TRP B  20      18.426   2.363 -10.194  1.00  1.92      
+ATOM    633  C   TRP B  20      19.181   1.183  -9.593  1.00  2.00      
+ATOM    634  O   TRP B  20      20.363   1.028  -9.810  1.00  2.21      
+ATOM    635  CB  TRP B  20      18.236   3.433  -9.118  1.00  1.87      
+ATOM    636  CG  TRP B  20      19.153   4.627  -9.394  1.00  2.14      
+ATOM    637  CD1 TRP B  20      18.896   5.587 -10.298  1.00  2.17      
+ATOM    638  CD2 TRP B  20      20.314   4.876  -8.778  1.00  2.42      
+ATOM    639  NE1 TRP B  20      19.944   6.404 -10.197  1.00  2.45      
+ATOM    640  CE2 TRP B  20      20.872   6.040  -9.278  1.00  2.62      
+ATOM    641  CE3 TRP B  20      20.974   4.179  -7.780  1.00  2.58      
+ATOM    642  CZ2 TRP B  20      22.076   6.502  -8.787  1.00  2.93      
+ATOM    643  CZ3 TRP B  20      22.178   4.644  -7.290  1.00  2.92      
+ATOM    644  CH2 TRP B  20      22.729   5.804  -7.793  1.00  3.08      
+ATOM    655  N   GLU B  21      18.482   0.358  -8.852  1.00  1.87      
+ATOM    656  CA  GLU B  21      19.175  -0.806  -8.246  1.00  2.05      
+ATOM    657  C   GLU B  21      19.162  -1.976  -9.217  1.00  2.07      
+ATOM    658  O   GLU B  21      19.895  -2.932  -9.061  1.00  2.31      
+ATOM    659  CB  GLU B  21      18.439  -1.207  -6.961  1.00  2.08      
+ATOM    660  CG  GLU B  21      18.596  -0.093  -5.924  1.00  2.29      
+ATOM    661  CD  GLU B  21      19.378  -0.627  -4.722  1.00  2.59      
+ATOM    662  OE1 GLU B  21      20.582  -0.748  -4.871  1.00  2.90      
+ATOM    663  OE2 GLU B  21      18.726  -0.884  -3.723  1.00  3.17      
+ATOM    670  N   ALA B  22      18.321  -1.870 -10.205  1.00  1.95      
+ATOM    671  CA  ALA B  22      18.230  -2.953 -11.209  1.00  2.10      
+ATOM    672  C   ALA B  22      19.413  -2.839 -12.158  1.00  2.46      
+ATOM    673  O   ALA B  22      19.695  -3.731 -12.932  1.00  2.81      
+ATOM    674  CB  ALA B  22      16.928  -2.765 -12.001  1.00  1.94      
+ATOM    680  N   GLY B  23      20.081  -1.721 -12.065  1.00  2.50      
+ATOM    681  CA  GLY B  23      21.260  -1.484 -12.936  1.00  2.93      
+ATOM    682  C   GLY B  23      21.368   0.004 -13.275  1.00  3.18      
+ATOM    683  O   GLY B  23      20.944   0.429 -14.331  1.00  3.64      
+ATOM    687  N   VAL B  24      21.918   0.771 -12.364  1.00  3.05      
+ATOM    688  CA  VAL B  24      22.057   2.234 -12.629  1.00  3.42      
+ATOM    689  C   VAL B  24      22.540   2.494 -14.051  1.00  4.18      
+ATOM    690  O   VAL B  24      22.419   3.588 -14.567  1.00  4.67      
+ATOM    691  CB  VAL B  24      23.089   2.825 -11.656  1.00  3.35      
+ATOM    692  CG1 VAL B  24      23.161   4.340 -11.865  1.00  3.54      
+ATOM    693  CG2 VAL B  24      22.663   2.537 -10.216  1.00  3.39      
+ATOM    703  N   ASP B  25      23.075   1.479 -14.651  1.00  4.40      
+ATOM    704  CA  ASP B  25      23.580   1.621 -16.040  1.00  5.25      
+ATOM    705  C   ASP B  25      22.473   2.105 -16.973  1.00  5.53      
+ATOM    706  O   ASP B  25      22.832   2.592 -18.032  1.00  6.15      
+ATOM    707  CB  ASP B  25      24.063   0.246 -16.517  1.00  5.61      
+ATOM    708  CG  ASP B  25      25.117  -0.284 -15.544  1.00  6.29      
+ATOM    709  OD1 ASP B  25      26.128   0.388 -15.424  1.00  6.73      
+ATOM    710  OD2 ASP B  25      24.851  -1.330 -14.976  1.00  6.58      
+ATOM    711  OXT ASP B  25      21.328   1.960 -16.576  1.00  5.80      
+TER     716      ASP B  25                                              
+ATOM      1  N   GLY A   1      -1.134   3.369 -13.616  1.00  2.58      
+ATOM      2  CA  GLY A   1      -1.361   3.734 -12.190  1.00  1.42      
+ATOM      3  C   GLY A   1      -0.691   2.705 -11.276  1.00  1.11      
+ATOM      4  O   GLY A   1      -1.210   1.626 -11.068  1.00  1.16      
+ATOM     10  N   ILE A   2       0.449   3.061 -10.749  1.00  0.94      
+ATOM     11  CA  ILE A   2       1.167   2.142  -9.859  1.00  0.70      
+ATOM     12  C   ILE A   2       0.728   2.387  -8.409  1.00  0.68      
+ATOM     13  O   ILE A   2       0.969   1.584  -7.530  1.00  0.80      
+ATOM     14  CB  ILE A   2       2.650   2.471 -10.048  1.00  0.72      
+ATOM     15  CG1 ILE A   2       3.437   2.053  -8.831  1.00  0.91      
+ATOM     16  CG2 ILE A   2       2.776   3.990 -10.236  1.00  1.20      
+ATOM     17  CD1 ILE A   2       4.896   1.793  -9.221  1.00  1.40      
+ATOM     29  N   VAL A   3       0.056   3.487  -8.201  1.00  0.69      
+ATOM     30  CA  VAL A   3      -0.417   3.818  -6.827  1.00  0.70      
+ATOM     31  C   VAL A   3      -1.568   2.910  -6.399  1.00  0.82      
+ATOM     32  O   VAL A   3      -1.562   2.381  -5.305  1.00  0.89      
+ATOM     33  CB  VAL A   3      -0.895   5.277  -6.826  1.00  0.75      
+ATOM     34  CG1 VAL A   3      -1.539   5.595  -8.177  1.00  0.87      
+ATOM     35  CG2 VAL A   3      -1.927   5.487  -5.713  1.00  0.83      
+ATOM     45  N   ASP A   4      -2.534   2.739  -7.258  1.00  0.91      
+ATOM     46  CA  ASP A   4      -3.673   1.867  -6.889  1.00  1.06      
+ATOM     47  C   ASP A   4      -3.252   0.422  -6.943  1.00  1.07      
+ATOM     48  O   ASP A   4      -4.073  -0.470  -6.917  1.00  1.21      
+ATOM     49  CB  ASP A   4      -4.820   2.103  -7.878  1.00  1.19      
+ATOM     50  CG  ASP A   4      -4.241   2.359  -9.272  1.00  1.43      
+ATOM     51  OD1 ASP A   4      -3.793   1.387  -9.858  1.00  2.10      
+ATOM     52  OD2 ASP A   4      -4.280   3.512  -9.671  1.00  2.08      
+ATOM     57  N   GLU A   5      -1.973   0.226  -7.040  1.00  0.96      
+ATOM     58  CA  GLU A   5      -1.460  -1.154  -7.093  1.00  0.99      
+ATOM     59  C   GLU A   5      -0.714  -1.456  -5.801  1.00  0.95      
+ATOM     60  O   GLU A   5      -0.820  -2.538  -5.272  1.00  1.06      
+ATOM     61  CB  GLU A   5      -0.500  -1.293  -8.280  1.00  0.93      
+ATOM     62  CG  GLU A   5      -0.307  -2.778  -8.593  1.00  1.27      
+ATOM     63  CD  GLU A   5      -1.433  -3.250  -9.514  1.00  1.58      
+ATOM     64  OE1 GLU A   5      -1.292  -3.019 -10.703  1.00  2.84      
+ATOM     65  OE2 GLU A   5      -2.369  -3.818  -8.975  1.00  2.49      
+ATOM     72  N   CYS A   6       0.034  -0.487  -5.324  1.00  0.86      
+ATOM     73  CA  CYS A   6       0.793  -0.707  -4.057  1.00  0.91      
+ATOM     74  C   CYS A   6      -0.006  -0.187  -2.868  1.00  1.06      
+ATOM     75  O   CYS A   6       0.025  -0.758  -1.796  1.00  1.22      
+ATOM     76  CB  CYS A   6       2.142   0.030  -4.120  1.00  0.80      
+ATOM     77  SG  CYS A   6       3.316  -0.515  -5.376  1.00  0.99      
+ATOM     82  N   CYS A   7      -0.725   0.878  -3.088  1.00  1.04      
+ATOM     83  CA  CYS A   7      -1.536   1.451  -1.986  1.00  1.20      
+ATOM     84  C   CYS A   7      -2.657   0.482  -1.651  1.00  1.31      
+ATOM     85  O   CYS A   7      -2.881   0.128  -0.510  1.00  1.52      
+ATOM     86  CB  CYS A   7      -2.152   2.769  -2.490  1.00  1.24      
+ATOM     87  SG  CYS A   7      -2.869   3.897  -1.265  1.00  1.44      
+ATOM     92  N   LEU A   8      -3.331   0.081  -2.683  1.00  1.27      
+ATOM     93  CA  LEU A   8      -4.454  -0.861  -2.553  1.00  1.37      
+ATOM     94  C   LEU A   8      -4.013  -2.301  -2.215  1.00  1.41      
+ATOM     95  O   LEU A   8      -4.479  -2.867  -1.246  1.00  1.53      
+ATOM     96  CB  LEU A   8      -5.097  -0.831  -3.936  1.00  1.34      
+ATOM     97  CG  LEU A   8      -6.419  -0.073  -3.919  1.00  1.64      
+ATOM     98  CD1 LEU A   8      -6.547   0.651  -5.245  1.00  1.96      
+ATOM     99  CD2 LEU A   8      -7.565  -1.069  -3.768  1.00  2.55      
+ATOM    111  N   ARG A   9      -3.132  -2.866  -3.013  1.00  1.36      
+ATOM    112  CA  ARG A   9      -2.666  -4.270  -2.740  1.00  1.43      
+ATOM    113  C   ARG A   9      -1.138  -4.395  -2.792  1.00  1.33      
+ATOM    114  O   ARG A   9      -0.459  -3.502  -3.242  1.00  1.19      
+ATOM    115  CB  ARG A   9      -3.251  -5.186  -3.836  1.00  1.46      
+ATOM    116  CG  ARG A   9      -3.769  -4.369  -5.018  1.00  1.56      
+ATOM    117  CD  ARG A   9      -3.934  -5.299  -6.220  1.00  1.62      
+ATOM    118  NE  ARG A   9      -4.822  -6.431  -5.831  1.00  1.96      
+ATOM    119  CZ  ARG A   9      -5.152  -7.325  -6.722  1.00  2.22      
+ATOM    120  NH1 ARG A   9      -5.714  -6.934  -7.833  1.00  2.48      
+ATOM    121  NH2 ARG A   9      -4.912  -8.584  -6.470  1.00  2.36      
+ATOM    135  N   PRO A  10      -0.611  -5.502  -2.294  1.00  1.41      
+ATOM    136  CA  PRO A  10       0.842  -5.724  -2.301  1.00  1.35      
+ATOM    137  C   PRO A  10       1.450  -5.363  -3.647  1.00  1.19      
+ATOM    138  O   PRO A  10       0.756  -5.167  -4.625  1.00  1.17      
+ATOM    139  CB  PRO A  10       0.995  -7.226  -2.015  1.00  1.45      
+ATOM    140  CG  PRO A  10      -0.366  -7.730  -1.469  1.00  1.61      
+ATOM    141  CD  PRO A  10      -1.387  -6.594  -1.654  1.00  1.60      
+ATOM    149  N   CYS A  11       2.744  -5.301  -3.654  1.00  1.14      
+ATOM    150  CA  CYS A  11       3.490  -4.963  -4.863  1.00  1.03      
+ATOM    151  C   CYS A  11       4.956  -5.033  -4.486  1.00  1.08      
+ATOM    152  O   CYS A  11       5.808  -4.479  -5.144  1.00  1.01      
+ATOM    153  CB  CYS A  11       3.161  -3.535  -5.319  1.00  0.99      
+ATOM    154  SG  CYS A  11       4.118  -2.189  -4.580  1.00  1.38      
+ATOM    159  N   SER A  12       5.201  -5.684  -3.383  1.00  1.30      
+ATOM    160  CA  SER A  12       6.605  -5.825  -2.910  1.00  1.51      
+ATOM    161  C   SER A  12       7.567  -6.023  -4.083  1.00  1.41      
+ATOM    162  O   SER A  12       7.252  -6.714  -5.029  1.00  1.32      
+ATOM    163  CB  SER A  12       6.682  -7.056  -2.000  1.00  1.81      
+ATOM    164  OG  SER A  12       7.680  -6.722  -1.047  1.00  2.06      
+ATOM    170  N   VAL A  13       8.706  -5.379  -3.980  1.00  1.48      
+ATOM    171  CA  VAL A  13       9.766  -5.453  -5.022  1.00  1.43      
+ATOM    172  C   VAL A  13       9.558  -6.531  -6.063  1.00  1.38      
+ATOM    173  O   VAL A  13       9.574  -6.238  -7.230  1.00  1.23      
+ATOM    174  CB  VAL A  13      11.087  -5.670  -4.251  1.00  1.71      
+ATOM    175  CG1 VAL A  13      11.481  -7.152  -4.189  1.00  1.89      
+ATOM    176  CG2 VAL A  13      12.196  -4.899  -4.928  1.00  1.68      
+ATOM    186  N   ASP A  14       9.320  -7.731  -5.660  1.00  1.55      
+ATOM    187  CA  ASP A  14       9.124  -8.778  -6.692  1.00  1.59      
+ATOM    188  C   ASP A  14       7.923  -8.479  -7.591  1.00  1.42      
+ATOM    189  O   ASP A  14       7.491  -9.324  -8.350  1.00  1.55      
+ATOM    190  CB  ASP A  14       8.915 -10.129  -5.998  1.00  1.86      
+ATOM    191  CG  ASP A  14      10.192 -10.962  -6.115  1.00  2.21      
+ATOM    192  OD1 ASP A  14      11.011 -10.828  -5.220  1.00  2.49      
+ATOM    193  OD2 ASP A  14      10.278 -11.687  -7.093  1.00  2.32      
+ATOM    198  N   VAL A  15       7.413  -7.283  -7.488  1.00  1.20      
+ATOM    199  CA  VAL A  15       6.243  -6.892  -8.323  1.00  1.10      
+ATOM    200  C   VAL A  15       6.498  -5.522  -8.945  1.00  0.91      
+ATOM    201  O   VAL A  15       5.981  -5.203  -9.998  1.00  0.90      
+ATOM    202  CB  VAL A  15       4.994  -6.764  -7.445  1.00  1.11      
+ATOM    203  CG1 VAL A  15       3.811  -6.393  -8.340  1.00  1.14      
+ATOM    204  CG2 VAL A  15       4.687  -8.072  -6.711  1.00  1.28      
+ATOM    214  N   LEU A  16       7.299  -4.737  -8.272  1.00  0.83      
+ATOM    215  CA  LEU A  16       7.613  -3.384  -8.790  1.00  0.71      
+ATOM    216  C   LEU A  16       8.779  -3.513  -9.728  1.00  0.77      
+ATOM    217  O   LEU A  16       8.945  -2.751 -10.658  1.00  0.73      
+ATOM    218  CB  LEU A  16       8.046  -2.491  -7.624  1.00  0.79      
+ATOM    219  CG  LEU A  16       6.826  -2.106  -6.801  1.00  0.79      
+ATOM    220  CD1 LEU A  16       7.266  -1.790  -5.368  1.00  1.01      
+ATOM    221  CD2 LEU A  16       6.175  -0.867  -7.420  1.00  0.76      
+ATOM    233  N   LEU A  17       9.579  -4.489  -9.439  1.00  0.91      
+ATOM    234  CA  LEU A  17      10.756  -4.730 -10.273  1.00  1.03      
+ATOM    235  C   LEU A  17      10.306  -5.000 -11.693  1.00  0.97      
+ATOM    236  O   LEU A  17      11.080  -4.955 -12.629  1.00  1.09      
+ATOM    237  CB  LEU A  17      11.411  -5.966  -9.682  1.00  1.25      
+ATOM    238  CG  LEU A  17      12.523  -5.527  -8.756  1.00  1.78      
+ATOM    239  CD1 LEU A  17      13.044  -6.743  -7.989  1.00  2.26      
+ATOM    240  CD2 LEU A  17      13.670  -4.911  -9.564  1.00  2.36      
+ATOM    252  N   SER A  18       9.043  -5.278 -11.808  1.00  0.88      
+ATOM    253  CA  SER A  18       8.468  -5.561 -13.144  1.00  0.95      
+ATOM    254  C   SER A  18       7.879  -4.297 -13.770  1.00  0.89      
+ATOM    255  O   SER A  18       7.609  -4.266 -14.955  1.00  1.04      
+ATOM    256  CB  SER A  18       7.348  -6.591 -12.978  1.00  1.07      
+ATOM    257  OG  SER A  18       7.760  -7.687 -13.782  1.00  2.01      
+ATOM    263  N   TYR A  19       7.685  -3.273 -12.974  1.00  0.77      
+ATOM    264  CA  TYR A  19       7.115  -2.028 -13.542  1.00  0.84      
+ATOM    265  C   TYR A  19       8.150  -1.312 -14.396  1.00  1.00      
+ATOM    266  O   TYR A  19       7.813  -0.524 -15.257  1.00  1.20      
+ATOM    267  CB  TYR A  19       6.709  -1.105 -12.391  1.00  0.73      
+ATOM    268  CG  TYR A  19       5.251  -1.372 -12.036  1.00  0.69      
+ATOM    269  CD1 TYR A  19       4.852  -2.637 -11.665  1.00  0.76      
+ATOM    270  CD2 TYR A  19       4.305  -0.369 -12.125  1.00  0.84      
+ATOM    271  CE1 TYR A  19       3.532  -2.901 -11.393  1.00  0.84      
+ATOM    272  CE2 TYR A  19       2.981  -0.635 -11.856  1.00  0.88      
+ATOM    273  CZ  TYR A  19       2.582  -1.904 -11.486  1.00  0.83      
+ATOM    274  OH  TYR A  19       1.256  -2.173 -11.218  1.00  1.01      
+ATOM    284  N   CYS A  20       9.396  -1.601 -14.139  1.00  1.00      
+ATOM    285  CA  CYS A  20      10.468  -0.944 -14.929  1.00  1.24      
+ATOM    286  C   CYS A  20      10.828  -1.777 -16.157  1.00  1.46      
+ATOM    287  O   CYS A  20      11.740  -1.356 -16.848  1.00  2.04      
+ATOM    288  CB  CYS A  20      11.707  -0.805 -14.040  1.00  1.49      
+ATOM    289  SG  CYS A  20      12.034   0.827 -13.330  1.00  1.72      
+ATOM    290  OXT CYS A  20      10.170  -2.789 -16.335  1.00  1.94      
+TER     295      CYS A  20                                              
diff --git a/tests/1igl_atm.pdb b/tests/1igl_atm.pdb
new file mode 100644
index 0000000..cb218e7
--- /dev/null
+++ b/tests/1igl_atm.pdb
@@ -0,0 +1,526 @@
+REMARK produced by stripper - version 1.0
+REMARK processed from 1IGL
+HEADER    GROWTH FACTOR                           29-DEC-94   1IGL      1IGL   2
+REMARK   2 RESOLUTION. NOT APPLICABLE.  SEE REMARK 4.                   1IGL  39
+ATOM      1  N   ALA     1       1.683 -14.487  10.760  1.00  0.00      1IGL 377
+ATOM      2  CA  ALA     1       2.897 -15.135  10.179  1.00  0.00      1IGL 378
+ATOM      3  C   ALA     1       3.490 -14.085   9.243  1.00  0.00      1IGL 379
+ATOM      4  O   ALA     1       4.221 -13.246   9.723  1.00  0.00      1IGL 380
+ATOM      5  CB  ALA     1       2.495 -16.429   9.404  1.00  0.00      1IGL 381
+ATOM     13  N   TYR     2       3.154 -14.152   7.977  1.00  0.00      1IGL 389
+ATOM     14  CA  TYR     2       3.661 -13.177   6.956  1.00  0.00      1IGL 390
+ATOM     15  C   TYR     2       5.175 -13.376   6.760  1.00  0.00      1IGL 391
+ATOM     16  O   TYR     2       5.665 -14.465   6.987  1.00  0.00      1IGL 392
+ATOM     17  CB  TYR     2       3.305 -11.725   7.458  1.00  0.00      1IGL 393
+ATOM     18  CG  TYR     2       1.909 -11.758   8.124  1.00  0.00      1IGL 394
+ATOM     19  CD1 TYR     2       0.795 -12.208   7.435  1.00  0.00      1IGL 395
+ATOM     20  CD2 TYR     2       1.756 -11.356   9.438  1.00  0.00      1IGL 396
+ATOM     21  CE1 TYR     2      -0.441 -12.259   8.048  1.00  0.00      1IGL 397
+ATOM     22  CE2 TYR     2       0.519 -11.408  10.048  1.00  0.00      1IGL 398
+ATOM     23  CZ  TYR     2      -0.584 -11.860   9.358  1.00  0.00      1IGL 399
+ATOM     24  OH  TYR     2      -1.811 -11.920   9.983  1.00  0.00      1IGL 400
+ATOM     34  N   ARG     3       5.866 -12.350   6.350  1.00  0.00      1IGL 410
+ATOM     35  CA  ARG     3       7.344 -12.425   6.123  1.00  0.00      1IGL 411
+ATOM     36  C   ARG     3       7.950 -11.205   6.834  1.00  0.00      1IGL 412
+ATOM     37  O   ARG     3       7.195 -10.358   7.277  1.00  0.00      1IGL 413
+ATOM     38  CB  ARG     3       7.652 -12.368   4.586  1.00  0.00      1IGL 414
+ATOM     39  CG  ARG     3       7.370 -13.729   3.868  1.00  0.00      1IGL 415
+ATOM     40  CD  ARG     3       5.917 -13.851   3.350  1.00  0.00      1IGL 416
+ATOM     41  NE  ARG     3       5.687 -12.783   2.323  1.00  0.00      1IGL 417
+ATOM     42  CZ  ARG     3       5.893 -13.002   1.054  1.00  0.00      1IGL 418
+ATOM     43  NH1 ARG     3       7.000 -12.540   0.552  1.00  0.00      1IGL 419
+ATOM     44  NH2 ARG     3       4.988 -13.658   0.384  1.00  0.00      1IGL 420
+ATOM     58  N   PRO     4       9.256 -11.114   6.945  1.00  0.00      1IGL 434
+ATOM     59  CA  PRO     4       9.897  -9.842   7.319  1.00  0.00      1IGL 435
+ATOM     60  C   PRO     4       9.742  -8.887   6.136  1.00  0.00      1IGL 436
+ATOM     61  O   PRO     4       8.918  -9.072   5.263  1.00  0.00      1IGL 437
+ATOM     62  CB  PRO     4      11.347 -10.244   7.653  1.00  0.00      1IGL 438
+ATOM     63  CG  PRO     4      11.592 -11.385   6.656  1.00  0.00      1IGL 439
+ATOM     64  CD  PRO     4      10.273 -12.176   6.736  1.00  0.00      1IGL 440
+ATOM     72  N   SER     5      10.571  -7.903   6.173  1.00  0.00      1IGL 448
+ATOM     73  CA  SER     5      10.595  -6.842   5.127  1.00  0.00      1IGL 449
+ATOM     74  C   SER     5      11.189  -7.340   3.802  1.00  0.00      1IGL 450
+ATOM     75  O   SER     5      12.135  -8.107   3.798  1.00  0.00      1IGL 451
+ATOM     76  CB  SER     5      11.409  -5.690   5.688  1.00  0.00      1IGL 452
+ATOM     77  OG  SER     5      10.917  -5.585   7.023  1.00  0.00      1IGL 453
+ATOM     83  N   GLU     6      10.609  -6.872   2.733  1.00  0.00      1IGL 459
+ATOM     84  CA  GLU     6      11.029  -7.233   1.347  1.00  0.00      1IGL 460
+ATOM     85  C   GLU     6      10.738  -6.046   0.403  1.00  0.00      1IGL 461
+ATOM     86  O   GLU     6      10.413  -4.964   0.852  1.00  0.00      1IGL 462
+ATOM     87  CB  GLU     6      10.234  -8.524   0.895  1.00  0.00      1IGL 463
+ATOM     88  CG  GLU     6       8.998  -8.818   1.813  1.00  0.00      1IGL 464
+ATOM     89  CD  GLU     6       8.147  -7.550   2.013  1.00  0.00      1IGL 465
+ATOM     90  OE1 GLU     6       7.686  -7.003   1.032  1.00  0.00      1IGL 466
+ATOM     91  OE2 GLU     6       8.016  -7.189   3.169  1.00  0.00      1IGL 467
+ATOM     98  N   THR     7      10.882  -6.305  -0.868  1.00  0.00      1IGL 474
+ATOM     99  CA  THR     7      10.651  -5.311  -1.959  1.00  0.00      1IGL 475
+ATOM    100  C   THR     7      10.062  -6.168  -3.073  1.00  0.00      1IGL 476
+ATOM    101  O   THR     7      10.660  -7.191  -3.356  1.00  0.00      1IGL 477
+ATOM    102  CB  THR     7      12.000  -4.684  -2.413  1.00  0.00      1IGL 478
+ATOM    103  OG1 THR     7      12.888  -5.756  -2.730  1.00  0.00      1IGL 479
+ATOM    104  CG2 THR     7      12.696  -3.991  -1.255  1.00  0.00      1IGL 480
+ATOM    112  N   LEU     8       8.971  -5.768  -3.660  1.00  0.00      1IGL 488
+ATOM    113  CA  LEU     8       8.352  -6.579  -4.760  1.00  0.00      1IGL 489
+ATOM    114  C   LEU     8       7.944  -5.549  -5.792  1.00  0.00      1IGL 490
+ATOM    115  O   LEU     8       7.679  -4.426  -5.413  1.00  0.00      1IGL 491
+ATOM    116  CB  LEU     8       7.060  -7.311  -4.348  1.00  0.00      1IGL 492
+ATOM    117  CG  LEU     8       7.217  -8.163  -3.078  1.00  0.00      1IGL 493
+ATOM    118  CD1 LEU     8       6.999  -7.266  -1.878  1.00  0.00      1IGL 494
+ATOM    119  CD2 LEU     8       6.164  -9.280  -3.025  1.00  0.00      1IGL 495
+ATOM    131  N   CYS     9       7.874  -5.910  -7.046  1.00  0.00      1IGL 507
+ATOM    132  CA  CYS     9       7.476  -4.873  -8.054  1.00  0.00      1IGL 508
+ATOM    133  C   CYS     9       6.247  -5.178  -8.916  1.00  0.00      1IGL 509
+ATOM    134  O   CYS     9       5.800  -6.299  -9.031  1.00  0.00      1IGL 510
+ATOM    135  CB  CYS     9       8.657  -4.616  -8.987  1.00  0.00      1IGL 511
+ATOM    136  SG  CYS     9       8.400  -3.268 -10.165  1.00  0.00      1IGL 512
+ATOM    141  N   GLY    10       5.730  -4.102  -9.459  1.00  0.00      1IGL 517
+ATOM    142  CA  GLY    10       4.531  -4.067 -10.369  1.00  0.00      1IGL 518
+ATOM    143  C   GLY    10       3.936  -5.429 -10.697  1.00  0.00      1IGL 519
+ATOM    144  O   GLY    10       4.528  -6.192 -11.433  1.00  0.00      1IGL 520
+ATOM    148  N   GLY    11       2.784  -5.712 -10.155  1.00  0.00      1IGL 524
+ATOM    149  CA  GLY    11       2.142  -7.030 -10.430  1.00  0.00      1IGL 525
+ATOM    150  C   GLY    11       2.549  -7.914  -9.271  1.00  0.00      1IGL 526
+ATOM    151  O   GLY    11       1.710  -8.405  -8.543  1.00  0.00      1IGL 527
+ATOM    155  N   GLU    12       3.833  -8.084  -9.108  1.00  0.00      1IGL 531
+ATOM    156  CA  GLU    12       4.312  -8.937  -7.988  1.00  0.00      1IGL 532
+ATOM    157  C   GLU    12       3.864  -8.292  -6.678  1.00  0.00      1IGL 533
+ATOM    158  O   GLU    12       3.193  -8.932  -5.893  1.00  0.00      1IGL 534
+ATOM    159  CB  GLU    12       5.841  -9.030  -8.022  1.00  0.00      1IGL 535
+ATOM    160  CG  GLU    12       6.349  -9.934  -6.873  1.00  0.00      1IGL 536
+ATOM    161  CD  GLU    12       7.874  -9.837  -6.756  1.00  0.00      1IGL 537
+ATOM    162  OE1 GLU    12       8.378  -8.732  -6.903  1.00  0.00      1IGL 538
+ATOM    163  OE2 GLU    12       8.439 -10.887  -6.520  1.00  0.00      1IGL 539
+ATOM    170  N   LEU    13       4.210  -7.047  -6.443  1.00  0.00      1IGL 546
+ATOM    171  CA  LEU    13       3.761  -6.438  -5.145  1.00  0.00      1IGL 547
+ATOM    172  C   LEU    13       2.240  -6.449  -5.004  1.00  0.00      1IGL 548
+ATOM    173  O   LEU    13       1.755  -6.156  -3.932  1.00  0.00      1IGL 549
+ATOM    174  CB  LEU    13       4.262  -4.948  -4.981  1.00  0.00      1IGL 550
+ATOM    175  CG  LEU    13       3.549  -3.919  -5.878  1.00  0.00      1IGL 551
+ATOM    176  CD1 LEU    13       4.164  -2.541  -5.696  1.00  0.00      1IGL 552
+ATOM    177  CD2 LEU    13       3.736  -4.295  -7.287  1.00  0.00      1IGL 553
+ATOM    189  N   VAL    14       1.500  -6.780  -6.035  1.00  0.00      1IGL 565
+ATOM    190  CA  VAL    14       0.015  -6.787  -5.851  1.00  0.00      1IGL 566
+ATOM    191  C   VAL    14      -0.220  -7.837  -4.745  1.00  0.00      1IGL 567
+ATOM    192  O   VAL    14      -1.159  -7.747  -3.977  1.00  0.00      1IGL 568
+ATOM    193  CB  VAL    14      -0.673  -7.198  -7.186  1.00  0.00      1IGL 569
+ATOM    194  CG1 VAL    14      -2.201  -7.318  -7.001  1.00  0.00      1IGL 570
+ATOM    195  CG2 VAL    14      -0.405  -6.103  -8.250  1.00  0.00      1IGL 571
+ATOM    205  N   ASP    15       0.662  -8.802  -4.693  1.00  0.00      1IGL 581
+ATOM    206  CA  ASP    15       0.534  -9.870  -3.663  1.00  0.00      1IGL 582
+ATOM    207  C   ASP    15       0.635  -9.302  -2.243  1.00  0.00      1IGL 583
+ATOM    208  O   ASP    15       0.019  -9.828  -1.337  1.00  0.00      1IGL 584
+ATOM    209  CB  ASP    15       1.646 -10.930  -3.837  1.00  0.00      1IGL 585
+ATOM    210  CG  ASP    15       1.397 -12.083  -2.845  1.00  0.00      1IGL 586
+ATOM    211  OD1 ASP    15       0.273 -12.563  -2.841  1.00  0.00      1IGL 587
+ATOM    212  OD2 ASP    15       2.333 -12.427  -2.142  1.00  0.00      1IGL 588
+ATOM    217  N   THR    16       1.383  -8.240  -2.066  1.00  0.00      1IGL 593
+ATOM    218  CA  THR    16       1.505  -7.677  -0.688  1.00  0.00      1IGL 594
+ATOM    219  C   THR    16       0.127  -7.261  -0.198  1.00  0.00      1IGL 595
+ATOM    220  O   THR    16      -0.401  -7.758   0.777  1.00  0.00      1IGL 596
+ATOM    221  CB  THR    16       2.450  -6.472  -0.702  1.00  0.00      1IGL 597
+ATOM    222  OG1 THR    16       1.871  -5.499  -1.559  1.00  0.00      1IGL 598
+ATOM    223  CG2 THR    16       3.768  -6.798  -1.353  1.00  0.00      1IGL 599
+ATOM    231  N   LEU    17      -0.427  -6.334  -0.918  1.00  0.00      1IGL 607
+ATOM    232  CA  LEU    17      -1.770  -5.808  -0.600  1.00  0.00      1IGL 608
+ATOM    233  C   LEU    17      -2.711  -7.006  -0.587  1.00  0.00      1IGL 609
+ATOM    234  O   LEU    17      -3.559  -7.118   0.272  1.00  0.00      1IGL 610
+ATOM    235  CB  LEU    17      -2.239  -4.916  -1.657  1.00  0.00      1IGL 611
+ATOM    236  CG  LEU    17      -1.230  -3.837  -2.077  1.00  0.00      1IGL 612
+ATOM    237  CD1 LEU    17      -1.805  -3.123  -3.241  1.00  0.00      1IGL 613
+ATOM    238  CD2 LEU    17      -1.161  -2.769  -1.055  1.00  0.00      1IGL 614
+ATOM    250  N   GLN    18      -2.530  -7.871  -1.555  1.00  0.00      1IGL 626
+ATOM    251  CA  GLN    18      -3.407  -9.067  -1.619  1.00  0.00      1IGL 627
+ATOM    252  C   GLN    18      -3.363  -9.775  -0.268  1.00  0.00      1IGL 628
+ATOM    253  O   GLN    18      -4.368 -10.322   0.141  1.00  0.00      1IGL 629
+ATOM    254  CB  GLN    18      -2.904 -10.011  -2.764  1.00  0.00      1IGL 630
+ATOM    255  CG  GLN    18      -3.876 -11.193  -3.023  1.00  0.00      1IGL 631
+ATOM    256  CD  GLN    18      -3.382 -12.052  -4.206  1.00  0.00      1IGL 632
+ATOM    257  OE1 GLN    18      -4.094 -12.269  -5.165  1.00  0.00      1IGL 633
+ATOM    258  NE2 GLN    18      -2.187 -12.565  -4.196  1.00  0.00      1IGL 634
+ATOM    267  N   PHE    19      -2.237  -9.764   0.400  1.00  0.00      1IGL 643
+ATOM    268  CA  PHE    19      -2.240 -10.457   1.715  1.00  0.00      1IGL 644
+ATOM    269  C   PHE    19      -2.607  -9.467   2.829  1.00  0.00      1IGL 645
+ATOM    270  O   PHE    19      -3.317  -9.880   3.729  1.00  0.00      1IGL 646
+ATOM    271  CB  PHE    19      -0.831 -11.114   1.995  1.00  0.00      1IGL 647
+ATOM    272  CG  PHE    19       0.285 -10.162   2.480  1.00  0.00      1IGL 648
+ATOM    273  CD1 PHE    19       0.183  -9.492   3.691  1.00  0.00      1IGL 649
+ATOM    274  CD2 PHE    19       1.416  -9.964   1.713  1.00  0.00      1IGL 650
+ATOM    275  CE1 PHE    19       1.174  -8.646   4.127  1.00  0.00      1IGL 651
+ATOM    276  CE2 PHE    19       2.411  -9.113   2.156  1.00  0.00      1IGL 652
+ATOM    277  CZ  PHE    19       2.293  -8.461   3.352  1.00  0.00      1IGL 653
+ATOM    287  N   VAL    20      -2.152  -8.223   2.809  1.00  0.00      1IGL 663
+ATOM    288  CA  VAL    20      -2.556  -7.349   3.916  1.00  0.00      1IGL 664
+ATOM    289  C   VAL    20      -3.887  -6.640   3.672  1.00  0.00      1IGL 665
+ATOM    290  O   VAL    20      -4.683  -6.612   4.593  1.00  0.00      1IGL 666
+ATOM    291  CB  VAL    20      -1.381  -6.409   4.110  1.00  0.00      1IGL 667
+ATOM    292  CG1 VAL    20      -1.437  -5.137   3.272  1.00  0.00      1IGL 668
+ATOM    293  CG2 VAL    20      -1.227  -6.164   5.561  1.00  0.00      1IGL 669
+ATOM    303  N   CYS    21      -4.142  -6.075   2.503  1.00  0.00      1IGL 679
+ATOM    304  CA  CYS    21      -5.468  -5.410   2.334  1.00  0.00      1IGL 680
+ATOM    305  C   CYS    21      -6.573  -6.420   2.720  1.00  0.00      1IGL 681
+ATOM    306  O   CYS    21      -7.315  -6.257   3.674  1.00  0.00      1IGL 682
+ATOM    307  CB  CYS    21      -5.626  -4.979   0.901  1.00  0.00      1IGL 683
+ATOM    308  SG  CYS    21      -7.290  -4.416   0.473  1.00  0.00      1IGL 684
+ATOM    313  N   GLY    22      -6.656  -7.461   1.937  1.00  0.00      1IGL 689
+ATOM    314  CA  GLY    22      -7.661  -8.527   2.196  1.00  0.00      1IGL 690
+ATOM    315  C   GLY    22      -8.993  -8.374   1.475  1.00  0.00      1IGL 691
+ATOM    316  O   GLY    22      -9.137  -7.683   0.482  1.00  0.00      1IGL 692
+ATOM    320  N   ASP    23      -9.944  -9.062   2.051  1.00  0.00      1IGL 696
+ATOM    321  CA  ASP    23     -11.343  -9.100   1.551  1.00  0.00      1IGL 697
+ATOM    322  C   ASP    23     -12.050  -7.731   1.418  1.00  0.00      1IGL 698
+ATOM    323  O   ASP    23     -12.860  -7.320   2.240  1.00  0.00      1IGL 699
+ATOM    324  CB  ASP    23     -12.111 -10.047   2.504  1.00  0.00      1IGL 700
+ATOM    325  CG  ASP    23     -13.509 -10.402   1.971  1.00  0.00      1IGL 701
+ATOM    326  OD1 ASP    23     -13.904  -9.880   0.940  1.00  0.00      1IGL 702
+ATOM    327  OD2 ASP    23     -14.101 -11.207   2.672  1.00  0.00      1IGL 703
+ATOM    332  N   ARG    24     -11.655  -7.059   0.365  1.00  0.00      1IGL 708
+ATOM    333  CA  ARG    24     -12.192  -5.723  -0.006  1.00  0.00      1IGL 709
+ATOM    334  C   ARG    24     -11.465  -5.201  -1.243  1.00  0.00      1IGL 710
+ATOM    335  O   ARG    24     -12.036  -4.519  -2.072  1.00  0.00      1IGL 711
+ATOM    336  CB  ARG    24     -11.982  -4.746   1.125  1.00  0.00      1IGL 712
+ATOM    337  CG  ARG    24     -10.494  -4.784   1.581  1.00  0.00      1IGL 713
+ATOM    338  CD  ARG    24     -10.358  -5.349   2.986  1.00  0.00      1IGL 714
+ATOM    339  NE  ARG    24     -11.421  -4.687   3.784  1.00  0.00      1IGL 715
+ATOM    340  CZ  ARG    24     -11.842  -5.290   4.850  1.00  0.00      1IGL 716
+ATOM    341  NH1 ARG    24     -12.838  -6.120   4.709  1.00  0.00      1IGL 717
+ATOM    342  NH2 ARG    24     -11.223  -5.012   5.960  1.00  0.00      1IGL 718
+ATOM    356  N   GLY    25     -10.205  -5.542  -1.331  1.00  0.00      1IGL 732
+ATOM    357  CA  GLY    25      -9.395  -5.084  -2.490  1.00  0.00      1IGL 733
+ATOM    358  C   GLY    25      -8.761  -3.724  -2.144  1.00  0.00      1IGL 734
+ATOM    359  O   GLY    25      -9.268  -2.979  -1.329  1.00  0.00      1IGL 735
+ATOM    363  N   PHE    26      -7.653  -3.438  -2.772  1.00  0.00      1IGL 739
+ATOM    364  CA  PHE    26      -6.898  -2.153  -2.550  1.00  0.00      1IGL 740
+ATOM    365  C   PHE    26      -7.109  -1.267  -3.755  1.00  0.00      1IGL 741
+ATOM    366  O   PHE    26      -7.621  -1.731  -4.757  1.00  0.00      1IGL 742
+ATOM    367  CB  PHE    26      -5.399  -2.445  -2.380  1.00  0.00      1IGL 743
+ATOM    368  CG  PHE    26      -5.093  -3.759  -3.067  1.00  0.00      1IGL 744
+ATOM    369  CD1 PHE    26      -5.387  -4.917  -2.396  1.00  0.00      1IGL 745
+ATOM    370  CD2 PHE    26      -4.546  -3.819  -4.316  1.00  0.00      1IGL 746
+ATOM    371  CE1 PHE    26      -5.142  -6.137  -2.946  1.00  0.00      1IGL 747
+ATOM    372  CE2 PHE    26      -4.298  -5.038  -4.882  1.00  0.00      1IGL 748
+ATOM    373  CZ  PHE    26      -4.590  -6.208  -4.206  1.00  0.00      1IGL 749
+ATOM    383  N   TYR    27      -6.711  -0.030  -3.648  1.00  0.00      1IGL 759
+ATOM    384  CA  TYR    27      -6.917   0.869  -4.832  1.00  0.00      1IGL 760
+ATOM    385  C   TYR    27      -5.665   1.256  -5.605  1.00  0.00      1IGL 761
+ATOM    386  O   TYR    27      -5.817   1.623  -6.752  1.00  0.00      1IGL 762
+ATOM    387  CB  TYR    27      -7.668   2.157  -4.358  1.00  0.00      1IGL 763
+ATOM    388  CG  TYR    27      -9.203   1.957  -4.195  1.00  0.00      1IGL 764
+ATOM    389  CD1 TYR    27      -9.867   0.757  -4.445  1.00  0.00      1IGL 765
+ATOM    390  CD2 TYR    27      -9.962   3.042  -3.788  1.00  0.00      1IGL 766
+ATOM    391  CE1 TYR    27     -11.239   0.661  -4.290  1.00  0.00      1IGL 767
+ATOM    392  CE2 TYR    27     -11.330   2.939  -3.636  1.00  0.00      1IGL 768
+ATOM    393  CZ  TYR    27     -11.973   1.750  -3.886  1.00  0.00      1IGL 769
+ATOM    394  OH  TYR    27     -13.338   1.647  -3.744  1.00  0.00      1IGL 770
+ATOM    404  N   PHE    28      -4.501   1.181  -5.008  1.00  0.00      1IGL 780
+ATOM    405  CA  PHE    28      -3.203   1.537  -5.687  1.00  0.00      1IGL 781
+ATOM    406  C   PHE    28      -3.070   3.042  -5.802  1.00  0.00      1IGL 782
+ATOM    407  O   PHE    28      -2.112   3.633  -5.337  1.00  0.00      1IGL 783
+ATOM    408  CB  PHE    28      -3.138   0.875  -7.135  1.00  0.00      1IGL 784
+ATOM    409  CG  PHE    28      -1.856   1.218  -7.928  1.00  0.00      1IGL 785
+ATOM    410  CD1 PHE    28      -1.547   2.517  -8.304  1.00  0.00      1IGL 786
+ATOM    411  CD2 PHE    28      -0.988   0.206  -8.291  1.00  0.00      1IGL 787
+ATOM    412  CE1 PHE    28      -0.403   2.791  -9.022  1.00  0.00      1IGL 788
+ATOM    413  CE2 PHE    28       0.157   0.481  -9.010  1.00  0.00      1IGL 789
+ATOM    414  CZ  PHE    28       0.452   1.776  -9.377  1.00  0.00      1IGL 790
+ATOM    424  N   SER    29      -4.049   3.625  -6.416  1.00  0.00      1IGL 800
+ATOM    425  CA  SER    29      -4.048   5.095  -6.607  1.00  0.00      1IGL 801
+ATOM    426  C   SER    29      -4.683   5.864  -5.450  1.00  0.00      1IGL 802
+ATOM    427  O   SER    29      -5.846   6.224  -5.497  1.00  0.00      1IGL 803
+ATOM    428  CB  SER    29      -4.781   5.395  -7.917  1.00  0.00      1IGL 804
+ATOM    429  OG  SER    29      -3.987   4.703  -8.878  1.00  0.00      1IGL 805
+ATOM    435  N   ARG    30      -3.887   6.067  -4.427  1.00  0.00      1IGL 811
+ATOM    436  CA  ARG    30      -4.384   6.830  -3.233  1.00  0.00      1IGL 812
+ATOM    437  C   ARG    30      -4.645   8.249  -3.797  1.00  0.00      1IGL 813
+ATOM    438  O   ARG    30      -3.898   8.712  -4.641  1.00  0.00      1IGL 814
+ATOM    439  CB  ARG    30      -3.310   6.981  -2.109  1.00  0.00      1IGL 815
+ATOM    440  CG  ARG    30      -2.888   5.648  -1.456  1.00  0.00      1IGL 816
+ATOM    441  CD  ARG    30      -1.624   5.868  -0.545  1.00  0.00      1IGL 817
+ATOM    442  NE  ARG    30      -1.975   6.407   0.824  1.00  0.00      1IGL 818
+ATOM    443  CZ  ARG    30      -2.297   7.656   1.015  1.00  0.00      1IGL 819
+ATOM    444  NH1 ARG    30      -3.467   7.941   1.507  1.00  0.00      1IGL 820
+ATOM    445  NH2 ARG    30      -1.432   8.571   0.710  1.00  0.00      1IGL 821
+ATOM    459  N   PRO    31      -5.672   8.919  -3.348  1.00  0.00      1IGL 835
+ATOM    460  CA  PRO    31      -5.891  10.330  -3.733  1.00  0.00      1IGL 836
+ATOM    461  C   PRO    31      -4.927  11.197  -2.909  1.00  0.00      1IGL 837
+ATOM    462  O   PRO    31      -3.831  10.797  -2.552  1.00  0.00      1IGL 838
+ATOM    463  CB  PRO    31      -7.387  10.516  -3.438  1.00  0.00      1IGL 839
+ATOM    464  CG  PRO    31      -7.549   9.692  -2.136  1.00  0.00      1IGL 840
+ATOM    465  CD  PRO    31      -6.737   8.414  -2.440  1.00  0.00      1IGL 841
+ATOM    473  N   ALA    32      -5.378  12.385  -2.623  1.00  0.00      1IGL 849
+ATOM    474  CA  ALA    32      -4.542  13.326  -1.822  1.00  0.00      1IGL 850
+ATOM    475  C   ALA    32      -4.479  12.753  -0.396  1.00  0.00      1IGL 851
+ATOM    476  O   ALA    32      -5.015  11.698  -0.111  1.00  0.00      1IGL 852
+ATOM    477  CB  ALA    32      -5.210  14.718  -1.825  1.00  0.00      1IGL 853
+ATOM    483  N   SER    33      -3.820  13.431   0.493  1.00  0.00      1IGL 859
+ATOM    484  CA  SER    33      -3.733  12.927   1.895  1.00  0.00      1IGL 860
+ATOM    485  C   SER    33      -3.806  14.153   2.799  1.00  0.00      1IGL 861
+ATOM    486  O   SER    33      -4.538  15.063   2.473  1.00  0.00      1IGL 862
+ATOM    487  CB  SER    33      -2.408  12.109   2.052  1.00  0.00      1IGL 863
+ATOM    488  OG  SER    33      -2.548  10.996   1.157  1.00  0.00      1IGL 864
+ATOM    494  N   ARG    34      -3.082  14.206   3.880  1.00  0.00      1IGL 870
+ATOM    495  CA  ARG    34      -3.183  15.424   4.776  1.00  0.00      1IGL 871
+ATOM    496  C   ARG    34      -1.944  16.307   4.796  1.00  0.00      1IGL 872
+ATOM    497  O   ARG    34      -1.755  17.149   5.653  1.00  0.00      1IGL 873
+ATOM    498  CB  ARG    34      -3.535  14.919   6.216  1.00  0.00      1IGL 874
+ATOM    499  CG  ARG    34      -2.543  13.862   6.814  1.00  0.00      1IGL 875
+ATOM    500  CD  ARG    34      -1.142  14.457   7.109  1.00  0.00      1IGL 876
+ATOM    501  NE  ARG    34      -1.319  15.759   7.828  1.00  0.00      1IGL 877
+ATOM    502  CZ  ARG    34      -1.230  15.834   9.116  1.00  0.00      1IGL 878
+ATOM    503  NH1 ARG    34      -2.300  15.611   9.812  1.00  0.00      1IGL 879
+ATOM    504  NH2 ARG    34      -0.075  16.128   9.629  1.00  0.00      1IGL 880
+ATOM    518  N   VAL    35      -1.140  16.059   3.811  1.00  0.00      1IGL 894
+ATOM    519  CA  VAL    35       0.136  16.761   3.590  1.00  0.00      1IGL 895
+ATOM    520  C   VAL    35       0.018  17.864   2.509  1.00  0.00      1IGL 896
+ATOM    521  O   VAL    35       0.976  18.198   1.845  1.00  0.00      1IGL 897
+ATOM    522  CB  VAL    35       1.147  15.634   3.220  1.00  0.00      1IGL 898
+ATOM    523  CG1 VAL    35       2.166  15.472   4.356  1.00  0.00      1IGL 899
+ATOM    524  CG2 VAL    35       0.509  14.232   2.954  1.00  0.00      1IGL 900
+ATOM    534  N   SER    36      -1.165  18.396   2.365  1.00  0.00      1IGL 910
+ATOM    535  CA  SER    36      -1.496  19.483   1.374  1.00  0.00      1IGL 911
+ATOM    536  C   SER    36      -1.092  19.338  -0.100  1.00  0.00      1IGL 912
+ATOM    537  O   SER    36      -1.340  20.185  -0.937  1.00  0.00      1IGL 913
+ATOM    538  CB  SER    36      -0.918  20.750   1.927  1.00  0.00      1IGL 914
+ATOM    539  OG  SER    36      -1.655  20.895   3.138  1.00  0.00      1IGL 915
+ATOM    545  N   ARG    37      -0.467  18.243  -0.362  1.00  0.00      1IGL 921
+ATOM    546  CA  ARG    37      -0.001  17.916  -1.745  1.00  0.00      1IGL 922
+ATOM    547  C   ARG    37      -0.501  16.480  -1.978  1.00  0.00      1IGL 923
+ATOM    548  O   ARG    37      -1.543  16.087  -1.488  1.00  0.00      1IGL 924
+ATOM    549  CB  ARG    37       1.576  17.977  -1.845  1.00  0.00      1IGL 925
+ATOM    550  CG  ARG    37       1.961  18.104  -3.371  1.00  0.00      1IGL 926
+ATOM    551  CD  ARG    37       3.258  17.333  -3.744  1.00  0.00      1IGL 927
+ATOM    552  NE  ARG    37       4.484  18.101  -3.347  1.00  0.00      1IGL 928
+ATOM    553  CZ  ARG    37       5.621  17.473  -3.273  1.00  0.00      1IGL 929
+ATOM    554  NH1 ARG    37       6.147  17.051  -4.386  1.00  0.00      1IGL 930
+ATOM    555  NH2 ARG    37       6.149  17.304  -2.099  1.00  0.00      1IGL 931
+ATOM    569  N   ARG    38       0.247  15.723  -2.726  1.00  0.00      1IGL 945
+ATOM    570  CA  ARG    38      -0.154  14.319  -3.006  1.00  0.00      1IGL 946
+ATOM    571  C   ARG    38       0.403  13.420  -1.882  1.00  0.00      1IGL 947
+ATOM    572  O   ARG    38       0.472  13.808  -0.731  1.00  0.00      1IGL 948
+ATOM    573  CB  ARG    38       0.418  13.983  -4.398  1.00  0.00      1IGL 949
+ATOM    574  CG  ARG    38      -0.101  15.036  -5.416  1.00  0.00      1IGL 950
+ATOM    575  CD  ARG    38       0.750  14.932  -6.672  1.00  0.00      1IGL 951
+ATOM    576  NE  ARG    38       0.235  15.901  -7.694  1.00  0.00      1IGL 952
+ATOM    577  CZ  ARG    38       0.476  15.685  -8.954  1.00  0.00      1IGL 953
+ATOM    578  NH1 ARG    38       1.721  15.633  -9.316  1.00  0.00      1IGL 954
+ATOM    579  NH2 ARG    38      -0.523  15.533  -9.765  1.00  0.00      1IGL 955
+ATOM    593  N   SER    39       0.790  12.236  -2.260  1.00  0.00      1IGL 969
+ATOM    594  CA  SER    39       1.354  11.234  -1.311  1.00  0.00      1IGL 970
+ATOM    595  C   SER    39       1.967  10.163  -2.206  1.00  0.00      1IGL 971
+ATOM    596  O   SER    39       2.000  10.318  -3.413  1.00  0.00      1IGL 972
+ATOM    597  CB  SER    39       0.219  10.632  -0.442  1.00  0.00      1IGL 973
+ATOM    598  OG  SER    39       0.833   9.615   0.360  1.00  0.00      1IGL 974
+ATOM    604  N   ARG    40       2.426   9.120  -1.580  1.00  0.00      1IGL 980
+ATOM    605  CA  ARG    40       3.052   7.985  -2.279  1.00  0.00      1IGL 981
+ATOM    606  C   ARG    40       1.912   7.139  -2.862  1.00  0.00      1IGL 982
+ATOM    607  O   ARG    40       0.760   7.283  -2.486  1.00  0.00      1IGL 983
+ATOM    608  CB  ARG    40       3.880   7.226  -1.225  1.00  0.00      1IGL 984
+ATOM    609  CG  ARG    40       5.384   7.286  -1.565  1.00  0.00      1IGL 985
+ATOM    610  CD  ARG    40       6.235   6.763  -0.381  1.00  0.00      1IGL 986
+ATOM    611  NE  ARG    40       5.928   5.315  -0.142  1.00  0.00      1IGL 987
+ATOM    612  CZ  ARG    40       6.546   4.654   0.797  1.00  0.00      1IGL 988
+ATOM    613  NH1 ARG    40       6.123   4.808   2.008  1.00  0.00      1IGL 989
+ATOM    614  NH2 ARG    40       7.540   3.874   0.513  1.00  0.00      1IGL 990
+ATOM    628  N   GLY    41       2.297   6.287  -3.763  1.00  0.00      1IGL1004
+ATOM    629  CA  GLY    41       1.350   5.363  -4.462  1.00  0.00      1IGL1005
+ATOM    630  C   GLY    41       2.119   4.047  -4.575  1.00  0.00      1IGL1006
+ATOM    631  O   GLY    41       3.306   4.057  -4.314  1.00  0.00      1IGL1007
+ATOM    635  N   ILE    42       1.468   2.970  -4.945  1.00  0.00      1IGL1011
+ATOM    636  CA  ILE    42       2.125   1.638  -5.086  1.00  0.00      1IGL1012
+ATOM    637  C   ILE    42       3.376   1.701  -6.008  1.00  0.00      1IGL1013
+ATOM    638  O   ILE    42       3.736   2.752  -6.492  1.00  0.00      1IGL1014
+ATOM    639  CB  ILE    42       0.969   0.740  -5.600  1.00  0.00      1IGL1015
+ATOM    640  CG1 ILE    42      -0.062   0.482  -4.484  1.00  0.00      1IGL1016
+ATOM    641  CG2 ILE    42       1.403  -0.573  -6.177  1.00  0.00      1IGL1017
+ATOM    642  CD1 ILE    42       0.586  -0.217  -3.269  1.00  0.00      1IGL1018
+ATOM    654  N   VAL    43       3.984   0.562  -6.223  1.00  0.00      1IGL1030
+ATOM    655  CA  VAL    43       5.213   0.384  -7.069  1.00  0.00      1IGL1031
+ATOM    656  C   VAL    43       6.323   1.399  -6.816  1.00  0.00      1IGL1032
+ATOM    657  O   VAL    43       7.382   0.956  -6.420  1.00  0.00      1IGL1033
+ATOM    658  CB  VAL    43       4.865   0.406  -8.598  1.00  0.00      1IGL1034
+ATOM    659  CG1 VAL    43       4.314  -0.966  -9.024  1.00  0.00      1IGL1035
+ATOM    660  CG2 VAL    43       3.847   1.473  -8.982  1.00  0.00      1IGL1036
+ATOM    670  N   GLU    44       6.174   2.686  -7.006  1.00  0.00      1IGL1046
+ATOM    671  CA  GLU    44       7.324   3.581  -6.719  1.00  0.00      1IGL1047
+ATOM    672  C   GLU    44       7.893   3.245  -5.339  1.00  0.00      1IGL1048
+ATOM    673  O   GLU    44       9.058   3.424  -5.058  1.00  0.00      1IGL1049
+ATOM    674  CB  GLU    44       6.861   5.049  -6.751  1.00  0.00      1IGL1050
+ATOM    675  CG  GLU    44       7.718   5.676  -7.825  1.00  0.00      1IGL1051
+ATOM    676  CD  GLU    44       7.595   7.205  -7.853  1.00  0.00      1IGL1052
+ATOM    677  OE1 GLU    44       8.324   7.775  -7.056  1.00  0.00      1IGL1053
+ATOM    678  OE2 GLU    44       6.813   7.711  -8.636  1.00  0.00      1IGL1054
+ATOM    685  N   GLU    45       7.028   2.753  -4.510  1.00  0.00      1IGL1061
+ATOM    686  CA  GLU    45       7.442   2.379  -3.144  1.00  0.00      1IGL1062
+ATOM    687  C   GLU    45       7.838   0.914  -2.958  1.00  0.00      1IGL1063
+ATOM    688  O   GLU    45       8.922   0.708  -2.472  1.00  0.00      1IGL1064
+ATOM    689  CB  GLU    45       6.306   2.758  -2.223  1.00  0.00      1IGL1065
+ATOM    690  CG  GLU    45       5.049   2.095  -2.688  1.00  0.00      1IGL1066
+ATOM    691  CD  GLU    45       3.859   2.603  -1.881  1.00  0.00      1IGL1067
+ATOM    692  OE1 GLU    45       3.887   3.738  -1.405  1.00  0.00      1IGL1068
+ATOM    693  OE2 GLU    45       2.954   1.802  -1.791  1.00  0.00      1IGL1069
+ATOM    700  N   CYS    46       7.056  -0.076  -3.316  1.00  0.00      1IGL1076
+ATOM    701  CA  CYS    46       7.568  -1.475  -3.061  1.00  0.00      1IGL1077
+ATOM    702  C   CYS    46       8.534  -1.908  -4.178  1.00  0.00      1IGL1078
+ATOM    703  O   CYS    46       9.370  -2.775  -3.983  1.00  0.00      1IGL1079
+ATOM    704  CB  CYS    46       6.373  -2.432  -2.980  1.00  0.00      1IGL1080
+ATOM    705  SG  CYS    46       6.652  -4.088  -2.302  1.00  0.00      1IGL1081
+ATOM    710  N   CYS    47       8.361  -1.255  -5.306  1.00  0.00      1IGL1086
+ATOM    711  CA  CYS    47       9.208  -1.534  -6.504  1.00  0.00      1IGL1087
+ATOM    712  C   CYS    47      10.408  -0.589  -6.429  1.00  0.00      1IGL1088
+ATOM    713  O   CYS    47      11.520  -1.074  -6.461  1.00  0.00      1IGL1089
+ATOM    714  CB  CYS    47       8.502  -1.241  -7.865  1.00  0.00      1IGL1090
+ATOM    715  SG  CYS    47       9.426  -1.740  -9.342  1.00  0.00      1IGL1091
+ATOM    720  N   PHE    48      10.209   0.715  -6.333  1.00  0.00      1IGL1096
+ATOM    721  CA  PHE    48      11.373   1.606  -6.264  1.00  0.00      1IGL1097
+ATOM    722  C   PHE    48      11.800   1.878  -4.797  1.00  0.00      1IGL1098
+ATOM    723  O   PHE    48      12.990   1.861  -4.548  1.00  0.00      1IGL1099
+ATOM    724  CB  PHE    48      10.926   2.834  -7.034  1.00  0.00      1IGL1100
+ATOM    725  CG  PHE    48      11.017   2.757  -8.568  1.00  0.00      1IGL1101
+ATOM    726  CD1 PHE    48      11.025   1.551  -9.248  1.00  0.00      1IGL1102
+ATOM    727  CD2 PHE    48      11.063   3.930  -9.296  1.00  0.00      1IGL1103
+ATOM    728  CE1 PHE    48      11.074   1.522 -10.624  1.00  0.00      1IGL1104
+ATOM    729  CE2 PHE    48      11.113   3.903 -10.673  1.00  0.00      1IGL1105
+ATOM    730  CZ  PHE    48      11.118   2.698 -11.341  1.00  0.00      1IGL1106
+ATOM    740  N   ARG    49      10.905   2.135  -3.860  1.00  0.00      1IGL1116
+ATOM    741  CA  ARG    49      11.422   2.377  -2.467  1.00  0.00      1IGL1117
+ATOM    742  C   ARG    49      11.417   0.989  -1.771  1.00  0.00      1IGL1118
+ATOM    743  O   ARG    49      11.919   0.011  -2.292  1.00  0.00      1IGL1119
+ATOM    744  CB  ARG    49      10.498   3.441  -1.714  1.00  0.00      1IGL1120
+ATOM    745  CG  ARG    49      10.141   4.751  -2.545  1.00  0.00      1IGL1121
+ATOM    746  CD  ARG    49      11.312   5.353  -3.374  1.00  0.00      1IGL1122
+ATOM    747  NE  ARG    49      10.779   6.570  -4.096  1.00  0.00      1IGL1123
+ATOM    748  CZ  ARG    49      11.386   7.056  -5.146  1.00  0.00      1IGL1124
+ATOM    749  NH1 ARG    49      12.614   7.462  -5.005  1.00  0.00      1IGL1125
+ATOM    750  NH2 ARG    49      10.713   7.099  -6.258  1.00  0.00      1IGL1126
+ATOM    764  N   SER    50      10.856   0.945  -0.601  1.00  0.00      1IGL1140
+ATOM    765  CA  SER    50      10.775  -0.329   0.167  1.00  0.00      1IGL1141
+ATOM    766  C   SER    50       9.301  -0.629   0.445  1.00  0.00      1IGL1142
+ATOM    767  O   SER    50       8.449   0.228   0.283  1.00  0.00      1IGL1143
+ATOM    768  CB  SER    50      11.499  -0.197   1.487  1.00  0.00      1IGL1144
+ATOM    769  OG  SER    50      11.535  -1.552   1.910  1.00  0.00      1IGL1145
+ATOM    775  N   CYS    51       9.067  -1.840   0.869  1.00  0.00      1IGL1151
+ATOM    776  CA  CYS    51       7.684  -2.283   1.179  1.00  0.00      1IGL1152
+ATOM    777  C   CYS    51       7.560  -2.205   2.711  1.00  0.00      1IGL1153
+ATOM    778  O   CYS    51       7.675  -3.168   3.436  1.00  0.00      1IGL1154
+ATOM    779  CB  CYS    51       7.491  -3.734   0.635  1.00  0.00      1IGL1155
+ATOM    780  SG  CYS    51       6.023  -4.042  -0.381  1.00  0.00      1IGL1156
+ATOM    785  N   ASP    52       7.329  -0.996   3.138  1.00  0.00      1IGL1161
+ATOM    786  CA  ASP    52       7.156  -0.614   4.577  1.00  0.00      1IGL1162
+ATOM    787  C   ASP    52       6.005  -1.397   5.290  1.00  0.00      1IGL1163
+ATOM    788  O   ASP    52       5.768  -1.243   6.477  1.00  0.00      1IGL1164
+ATOM    789  CB  ASP    52       6.894   0.936   4.593  1.00  0.00      1IGL1165
+ATOM    790  CG  ASP    52       7.859   1.736   3.672  1.00  0.00      1IGL1166
+ATOM    791  OD1 ASP    52       8.962   1.279   3.438  1.00  0.00      1IGL1167
+ATOM    792  OD2 ASP    52       7.443   2.794   3.221  1.00  0.00      1IGL1168
+ATOM    797  N   LEU    53       5.320  -2.207   4.520  1.00  0.00      1IGL1173
+ATOM    798  CA  LEU    53       4.166  -3.068   4.965  1.00  0.00      1IGL1174
+ATOM    799  C   LEU    53       2.978  -2.178   5.342  1.00  0.00      1IGL1175
+ATOM    800  O   LEU    53       1.985  -2.167   4.636  1.00  0.00      1IGL1176
+ATOM    801  CB  LEU    53       4.565  -3.946   6.188  1.00  0.00      1IGL1177
+ATOM    802  CG  LEU    53       3.567  -5.144   6.422  1.00  0.00      1IGL1178
+ATOM    803  CD1 LEU    53       2.073  -4.768   6.419  1.00  0.00      1IGL1179
+ATOM    804  CD2 LEU    53       3.714  -6.214   5.332  1.00  0.00      1IGL1180
+ATOM    816  N   ALA    54       3.102  -1.453   6.428  1.00  0.00      1IGL1192
+ATOM    817  CA  ALA    54       2.010  -0.532   6.919  1.00  0.00      1IGL1193
+ATOM    818  C   ALA    54       1.320   0.174   5.739  1.00  0.00      1IGL1194
+ATOM    819  O   ALA    54       0.145   0.486   5.763  1.00  0.00      1IGL1195
+ATOM    820  CB  ALA    54       2.624   0.509   7.877  1.00  0.00      1IGL1196
+ATOM    826  N   LEU    55       2.117   0.405   4.729  1.00  0.00      1IGL1202
+ATOM    827  CA  LEU    55       1.728   1.052   3.471  1.00  0.00      1IGL1203
+ATOM    828  C   LEU    55       0.573   0.245   2.853  1.00  0.00      1IGL1204
+ATOM    829  O   LEU    55      -0.562   0.657   2.695  1.00  0.00      1IGL1205
+ATOM    830  CB  LEU    55       2.950   0.995   2.600  1.00  0.00      1IGL1206
+ATOM    831  CG  LEU    55       3.893   2.183   2.617  1.00  0.00      1IGL1207
+ATOM    832  CD1 LEU    55       5.016   1.737   1.646  1.00  0.00      1IGL1208
+ATOM    833  CD2 LEU    55       3.201   3.436   2.035  1.00  0.00      1IGL1209
+ATOM    845  N   LEU    56       0.982  -0.945   2.522  1.00  0.00      1IGL1221
+ATOM    846  CA  LEU    56       0.084  -1.938   1.895  1.00  0.00      1IGL1222
+ATOM    847  C   LEU    56      -1.118  -2.082   2.799  1.00  0.00      1IGL1223
+ATOM    848  O   LEU    56      -2.222  -2.213   2.300  1.00  0.00      1IGL1224
+ATOM    849  CB  LEU    56       0.862  -3.265   1.738  1.00  0.00      1IGL1225
+ATOM    850  CG  LEU    56       2.176  -3.156   0.855  1.00  0.00      1IGL1226
+ATOM    851  CD1 LEU    56       2.190  -2.033  -0.207  1.00  0.00      1IGL1227
+ATOM    852  CD2 LEU    56       3.449  -3.121   1.704  1.00  0.00      1IGL1228
+ATOM    864  N   GLU    57      -0.868  -2.046   4.087  1.00  0.00      1IGL1240
+ATOM    865  CA  GLU    57      -2.020  -2.179   5.028  1.00  0.00      1IGL1241
+ATOM    866  C   GLU    57      -3.007  -1.043   4.685  1.00  0.00      1IGL1242
+ATOM    867  O   GLU    57      -4.193  -1.254   4.520  1.00  0.00      1IGL1243
+ATOM    868  CB  GLU    57      -1.608  -1.997   6.510  1.00  0.00      1IGL1244
+ATOM    869  CG  GLU    57      -0.484  -2.966   6.847  1.00  0.00      1IGL1245
+ATOM    870  CD  GLU    57      -0.275  -3.122   8.364  1.00  0.00      1IGL1246
+ATOM    871  OE1 GLU    57      -0.259  -2.113   9.047  1.00  0.00      1IGL1247
+ATOM    872  OE2 GLU    57      -0.138  -4.268   8.763  1.00  0.00      1IGL1248
+ATOM    879  N   THR    58      -2.474   0.152   4.582  1.00  0.00      1IGL1255
+ATOM    880  CA  THR    58      -3.346   1.322   4.253  1.00  0.00      1IGL1256
+ATOM    881  C   THR    58      -3.726   1.414   2.751  1.00  0.00      1IGL1257
+ATOM    882  O   THR    58      -4.560   2.244   2.440  1.00  0.00      1IGL1258
+ATOM    883  CB  THR    58      -2.603   2.649   4.774  1.00  0.00      1IGL1259
+ATOM    884  OG1 THR    58      -3.340   3.801   4.375  1.00  0.00      1IGL1260
+ATOM    885  CG2 THR    58      -1.233   2.907   4.173  1.00  0.00      1IGL1261
+ATOM    893  N   TYR    59      -3.152   0.622   1.867  1.00  0.00      1IGL1269
+ATOM    894  CA  TYR    59      -3.558   0.730   0.403  1.00  0.00      1IGL1270
+ATOM    895  C   TYR    59      -4.920   0.088   0.141  1.00  0.00      1IGL1271
+ATOM    896  O   TYR    59      -5.567   0.321  -0.868  1.00  0.00      1IGL1272
+ATOM    897  CB  TYR    59      -2.515   0.054  -0.479  1.00  0.00      1IGL1273
+ATOM    898  CG  TYR    59      -1.534   1.141  -0.906  1.00  0.00      1IGL1274
+ATOM    899  CD1 TYR    59      -1.825   1.997  -1.948  1.00  0.00      1IGL1275
+ATOM    900  CD2 TYR    59      -0.355   1.291  -0.235  1.00  0.00      1IGL1276
+ATOM    901  CE1 TYR    59      -0.934   2.991  -2.302  1.00  0.00      1IGL1277
+ATOM    902  CE2 TYR    59       0.523   2.276  -0.584  1.00  0.00      1IGL1278
+ATOM    903  CZ  TYR    59       0.248   3.134  -1.615  1.00  0.00      1IGL1279
+ATOM    904  OH  TYR    59       1.138   4.129  -1.947  1.00  0.00      1IGL1280
+ATOM    914  N   CYS    60      -5.284  -0.746   1.074  1.00  0.00      1IGL1290
+ATOM    915  CA  CYS    60      -6.582  -1.456   1.013  1.00  0.00      1IGL1291
+ATOM    916  C   CYS    60      -7.771  -0.493   0.809  1.00  0.00      1IGL1292
+ATOM    917  O   CYS    60      -7.662   0.696   1.038  1.00  0.00      1IGL1293
+ATOM    918  CB  CYS    60      -6.735  -2.205   2.304  1.00  0.00      1IGL1294
+ATOM    919  SG  CYS    60      -7.878  -3.591   2.219  1.00  0.00      1IGL1295
+ATOM    924  N   ALA    61      -8.886  -1.041   0.390  1.00  0.00      1IGL1300
+ATOM    925  CA  ALA    61     -10.124  -0.225   0.146  1.00  0.00      1IGL1301
+ATOM    926  C   ALA    61     -11.436  -0.807   0.732  1.00  0.00      1IGL1302
+ATOM    927  O   ALA    61     -12.130  -1.569   0.089  1.00  0.00      1IGL1303
+ATOM    928  CB  ALA    61     -10.318  -0.056  -1.364  1.00  0.00      1IGL1304
+ATOM    934  N   THR    62     -11.763  -0.455   1.947  1.00  0.00      1IGL1310
+ATOM    935  CA  THR    62     -13.015  -0.969   2.557  1.00  0.00      1IGL1311
+ATOM    936  C   THR    62     -14.276  -0.564   1.798  1.00  0.00      1IGL1312
+ATOM    937  O   THR    62     -15.094  -1.419   1.506  1.00  0.00      1IGL1313
+ATOM    938  CB  THR    62     -13.007  -0.493   4.070  1.00  0.00      1IGL1314
+ATOM    939  OG1 THR    62     -14.264   0.084   4.395  1.00  0.00      1IGL1315
+ATOM    940  CG2 THR    62     -11.960   0.578   4.467  1.00  0.00      1IGL1316
+ATOM    948  N   PRO    63     -14.443   0.686   1.478  1.00  0.00      1IGL1324
+ATOM    949  CA  PRO    63     -15.573   1.099   0.629  1.00  0.00      1IGL1325
+ATOM    950  C   PRO    63     -15.302   0.697  -0.827  1.00  0.00      1IGL1326
+ATOM    951  O   PRO    63     -14.996   1.504  -1.682  1.00  0.00      1IGL1327
+ATOM    952  CB  PRO    63     -15.621   2.550   0.929  1.00  0.00      1IGL1328
+ATOM    953  CG  PRO    63     -14.143   2.955   1.018  1.00  0.00      1IGL1329
+ATOM    954  CD  PRO    63     -13.594   1.837   1.894  1.00  0.00      1IGL1330
+ATOM    962  N   ALA    64     -15.425  -0.579  -1.038  1.00  0.00      1IGL1338
+ATOM    963  CA  ALA    64     -15.210  -1.211  -2.371  1.00  0.00      1IGL1339
+ATOM    964  C   ALA    64     -16.482  -2.003  -2.709  1.00  0.00      1IGL1340
+ATOM    965  O   ALA    64     -17.198  -2.401  -1.809  1.00  0.00      1IGL1341
+ATOM    966  CB  ALA    64     -13.984  -2.137  -2.256  1.00  0.00      1IGL1342
+ATOM    972  N   LYS    65     -16.741  -2.213  -3.973  1.00  0.00      1IGL1348
+ATOM    973  CA  LYS    65     -17.916  -2.952  -4.415  1.00  0.00      1IGL1349
+ATOM    974  C   LYS    65     -17.862  -4.389  -3.875  1.00  0.00      1IGL1350
+ATOM    975  O   LYS    65     -17.263  -5.246  -4.490  1.00  0.00      1IGL1351
+ATOM    976  CB  LYS    65     -17.858  -2.845  -5.935  1.00  0.00      1IGL1352
+ATOM    977  CG  LYS    65     -16.488  -3.329  -6.553  1.00  0.00      1IGL1353
+ATOM    978  CD  LYS    65     -16.699  -4.413  -7.673  1.00  0.00      1IGL1354
+ATOM    979  CE  LYS    65     -17.094  -5.793  -7.066  1.00  0.00      1IGL1355
+ATOM    980  NZ  LYS    65     -17.267  -6.825  -8.135  1.00  0.00      1IGL1356
+ATOM    994  N   SER    66     -18.457  -4.631  -2.746  1.00  0.00      1IGL1370
+ATOM    995  CA  SER    66     -18.444  -6.011  -2.172  1.00  0.00      1IGL1371
+ATOM    996  C   SER    66     -18.924  -7.056  -3.205  1.00  0.00      1IGL1372
+ATOM    997  O   SER    66     -19.665  -6.730  -4.117  1.00  0.00      1IGL1373
+ATOM    998  CB  SER    66     -19.347  -5.991  -0.941  1.00  0.00      1IGL1374
+ATOM    999  OG  SER    66     -18.957  -4.778  -0.297  1.00  0.00      1IGL1375
+ATOM   1005  N   GLU    67     -18.481  -8.269  -3.013  1.00  0.00      1IGL1381
+ATOM   1006  CA  GLU    67     -18.829  -9.414  -3.905  1.00  0.00      1IGL1382
+ATOM   1007  C   GLU    67     -19.391 -10.553  -3.025  1.00  0.00      1IGL1383
+ATOM   1008  O   GLU    67     -19.914 -11.493  -3.605  1.00  0.00      1IGL1384
+ATOM   1009  CB  GLU    67     -17.542  -9.865  -4.633  1.00  0.00      1IGL1385
+ATOM   1010  CG  GLU    67     -16.897  -8.659  -5.380  1.00  0.00      1IGL1386
+ATOM   1011  CD  GLU    67     -15.535  -9.016  -5.999  1.00  0.00      1IGL1387
+ATOM   1012  OE1 GLU    67     -14.801  -9.789  -5.412  1.00  0.00      1IGL1388
+ATOM   1013  OE2 GLU    67     -15.309  -8.462  -7.063  1.00  0.00      1IGL1389
+ATOM   1014  OXT GLU    67     -19.259 -10.411  -1.817  1.00  0.00      1IGL1390
+TER    1021      GLU    67                                              1IGL1397
diff --git a/tests/Makefile.am b/tests/Makefile.am
new file mode 100644
index 0000000..c0fd421
--- /dev/null
+++ b/tests/Makefile.am
@@ -0,0 +1,17 @@
+#===============================================================================
+# Makefile.am : for automake
+# #===============================================================================
+#
+noinst_DATA = \
+	1bom_atm.pdb \
+	1igl_atm.pdb \
+	sapout.pdb
+
+noinst_SCRIPTS = \
+	test1.sh \
+	test2.sh
+
+EXTRA_DIST = $(noinst_DATA) $(noinst_SCRIPTS)
+
+TESTS = $(noinst_SCRIPTS)
+
diff --git a/tests/Makefile.in b/tests/Makefile.in
new file mode 100644
index 0000000..d814c49
--- /dev/null
+++ b/tests/Makefile.in
@@ -0,0 +1,388 @@
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+subdir = tests
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/src/config.h
+CONFIG_CLEAN_FILES =
+SCRIPTS = $(noinst_SCRIPTS)
+SOURCES =
+DIST_SOURCES =
+DATA = $(noinst_DATA)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTI_CFLAGS = @INTI_CFLAGS@
+INTI_LIBS = @INTI_LIBS@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build_alias = @build_alias@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host_alias = @host_alias@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+#===============================================================================
+# Makefile.am : for automake
+# #===============================================================================
+#
+noinst_DATA = \
+	1bom_atm.pdb \
+	1igl_atm.pdb \
+	sapout.pdb
+
+noinst_SCRIPTS = \
+	test1.sh \
+	test2.sh
+
+EXTRA_DIST = $(noinst_DATA) $(noinst_SCRIPTS)
+TESTS = $(noinst_SCRIPTS)
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  tests/Makefile'; \
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu  tests/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+check-TESTS: $(TESTS)
+	@failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[	 ]'; \
+	srcdir=$(srcdir); export srcdir; \
+	list=' $(TESTS) '; \
+	if test -n "$$list"; then \
+	  for tst in $$list; do \
+	    if test -f ./$$tst; then dir=./; \
+	    elif test -f $$tst; then dir=; \
+	    else dir="$(srcdir)/"; fi; \
+	    if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
+	      all=`expr $$all + 1`; \
+	      case " $(XFAIL_TESTS) " in \
+	      *$$ws$$tst$$ws*) \
+		xpass=`expr $$xpass + 1`; \
+		failed=`expr $$failed + 1`; \
+		echo "XPASS: $$tst"; \
+	      ;; \
+	      *) \
+		echo "PASS: $$tst"; \
+	      ;; \
+	      esac; \
+	    elif test $$? -ne 77; then \
+	      all=`expr $$all + 1`; \
+	      case " $(XFAIL_TESTS) " in \
+	      *$$ws$$tst$$ws*) \
+		xfail=`expr $$xfail + 1`; \
+		echo "XFAIL: $$tst"; \
+	      ;; \
+	      *) \
+		failed=`expr $$failed + 1`; \
+		echo "FAIL: $$tst"; \
+	      ;; \
+	      esac; \
+	    else \
+	      skip=`expr $$skip + 1`; \
+	      echo "SKIP: $$tst"; \
+	    fi; \
+	  done; \
+	  if test "$$failed" -eq 0; then \
+	    if test "$$xfail" -eq 0; then \
+	      banner="All $$all tests passed"; \
+	    else \
+	      banner="All $$all tests behaved as expected ($$xfail expected failures)"; \
+	    fi; \
+	  else \
+	    if test "$$xpass" -eq 0; then \
+	      banner="$$failed of $$all tests failed"; \
+	    else \
+	      banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \
+	    fi; \
+	  fi; \
+	  dashes="$$banner"; \
+	  skipped=""; \
+	  if test "$$skip" -ne 0; then \
+	    skipped="($$skip tests were not run)"; \
+	    test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
+	      dashes="$$skipped"; \
+	  fi; \
+	  report=""; \
+	  if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
+	    report="Please report to $(PACKAGE_BUGREPORT)"; \
+	    test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
+	      dashes="$$report"; \
+	  fi; \
+	  dashes=`echo "$$dashes" | sed s/./=/g`; \
+	  echo "$$dashes"; \
+	  echo "$$banner"; \
+	  test -z "$$skipped" || echo "$$skipped"; \
+	  test -z "$$report" || echo "$$report"; \
+	  echo "$$dashes"; \
+	  test "$$failed" -eq 0; \
+	else :; fi
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+	$(MAKE) $(AM_MAKEFLAGS) check-TESTS
+check: check-am
+all-am: Makefile $(SCRIPTS) $(DATA)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-TESTS check-am clean clean-generic \
+	distclean distclean-generic distdir dvi dvi-am html html-am \
+	info info-am install install-am install-data install-data-am \
+	install-dvi install-dvi-am install-exec install-exec-am \
+	install-html install-html-am install-info install-info-am \
+	install-man install-pdf install-pdf-am install-ps \
+	install-ps-am install-strip installcheck installcheck-am \
+	installdirs maintainer-clean maintainer-clean-generic \
+	mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \
+	uninstall-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/tests/sapout.pdb b/tests/sapout.pdb
new file mode 100644
index 0000000..d62f998
--- /dev/null
+++ b/tests/sapout.pdb
@@ -0,0 +1,123 @@
+ATOM      1  CA  ALA A   1       2.169  -7.575  12.870  0.11  0.41
+ATOM      2  CA  TYR A   2       2.933  -5.617   9.647  0.52  0.28
+ATOM      3  CA  ARG A   3       6.616  -4.865   8.814  0.66  0.31
+ATOM      4  CA  PRO A   4       9.169  -2.282  10.010  0.39  0.13
+ATOM      5  CA  SER A   5       9.867   0.718   7.818  0.65  1.19
+ATOM      6  CA  GLU A   6      10.301   0.327   4.038  0.47  0.28
+ATOM      7  CA  THR A   7       9.923   2.249   0.732  0.67  0.39
+ATOM      8  CA  LEU A   8       7.624   0.981  -2.069  0.59  1.47
+ATOM      9  CA  CYS A   9       6.748   2.687  -5.363  0.55  1.02
+ATOM     10  CA  GLY A  10       3.803   3.493  -7.678  0.45  1.82
+ATOM     11  CA  GLY A  11       1.414   0.530  -7.739  0.41  1.79
+ATOM     12  CA  GLU A  12       3.584  -1.377  -5.297  0.46  1.62
+ATOM     13  CA  LEU A  13       3.033   1.122  -2.454  0.96  1.36
+ATOM     14  CA  VAL A  14      -0.713   0.773  -3.160  0.52  1.91
+ATOM     15  CA  ASP A  15      -0.194  -2.310  -0.972  0.55  2.20
+ATOM     16  CA  THR A  16       0.777  -0.117   2.003  0.59  2.25
+ATOM     17  CA  LEU A  17      -2.498   1.752   2.091  0.88  2.02
+ATOM     18  CA  GLN A  18      -4.135  -1.507   1.072  0.62  1.91
+ATOM     19  CA  PHE A  19      -2.968  -2.897   4.406  0.37  2.36
+ATOM     20  CA  VAL A  20      -3.284   0.211   6.607  0.47  1.56
+ATOM     21  CA  CYS A  21      -6.196   2.150   5.025  0.65  1.71
+ATOM     22  CA  GLY A  22      -8.389  -0.967   4.887  0.64  0.37
+ATOM     23  CA  ASP A  23     -12.071  -1.540   4.242  0.30  0.33
+ATOM     24  CA  ARG A  24     -12.920   1.837   2.685  0.80  0.38
+ATOM     25  CA  GLY A  25     -10.123   2.476   0.201  0.53  0.17
+ATOM     26  CA  PHE A  26      -7.626   5.407   0.141  0.89  0.40
+ATOM     27  CA  TYR A  27      -7.645   8.429  -2.141  0.56  0.00
+ATOM     28  CA  PHE A  28      -3.931   9.097  -2.996  0.47  0.00
+ATOM     29  CA  SER A  29      -4.776  12.655  -3.916  0.49  0.00
+ATOM     30  CA  ARG A  30      -5.112  14.390  -0.542  0.66  0.00
+ATOM     31  CA  PRO A  31      -6.619  17.890  -1.042  0.49  0.00
+ATOM     32  CA  ALA A  32      -5.270  20.886   0.869  0.75  0.00
+ATOM     33  CA  SER A  33      -4.461  20.487   4.586  0.59  0.00
+ATOM     34  CA  ARG A  34      -3.911  22.984   7.467  0.31  0.00
+ATOM     35  CA  VAL A  35      -0.592  24.321   6.281  0.42  0.00
+ATOM     36  CA  SER A  36      -2.224  27.043   4.065  0.33  0.00
+ATOM     37  CA  ARG A  37      -0.729  25.476   0.946  0.39  0.00
+ATOM     38  CA  ARG A  38      -0.882  21.879  -0.315  0.48  0.00
+ATOM     39  CA  SER A  39       0.626  18.794   1.380  0.69  0.00
+ATOM     40  CA  ARG A  40       2.324  15.545   0.412  0.68  0.00
+ATOM     41  CA  GLY A  41       0.622  12.923  -1.771  0.84  0.00
+ATOM     42  CA  ILE A  42       1.397   9.198  -2.395  0.77  0.00
+ATOM     43  CA  VAL A  43       4.485   7.944  -4.378  0.64  0.00
+ATOM     44  CA  GLU A  44       6.596  11.141  -4.028  0.48  0.00
+ATOM     45  CA  GLU A  45       6.714   9.939  -0.453  0.66  0.00
+ATOM     46  CA  CYS A  46       6.840   6.085  -0.370  0.83  0.00
+ATOM     47  CA  CYS A  47       8.480   6.026  -3.813  0.58  0.00
+ATOM     48  CA  PHE A  48      10.645   9.166  -3.573  0.39  0.00
+ATOM     49  CA  ARG A  49      10.694   9.937   0.224  0.38  0.00
+ATOM     50  CA  SER A  50      10.047   7.231   2.858  0.56  0.00
+ATOM     51  CA  CYS A  51       6.956   5.277   3.870  0.84  0.00
+ATOM     52  CA  ASP A  52       6.428   6.946   7.268  0.47  0.00
+ATOM     53  CA  LEU A  53       3.438   4.492   7.656  0.65  0.00
+ATOM     54  CA  ALA A  54       1.282   7.028   9.610  0.44  0.00
+ATOM     55  CA  LEU A  55       1.000   8.612   6.162  0.48  0.00
+ATOM     56  CA  LEU A  56      -0.644   5.622   4.586  0.65  0.00
+ATOM     57  CA  GLU A  57      -2.748   5.381   7.719  0.57  0.00
+ATOM     58  CA  THR A  58      -4.074   8.882   6.944  0.37  0.00
+ATOM     59  CA  TYR A  59      -4.286   8.290   3.094  0.72  0.00
+ATOM     60  CA  CYS A  60      -7.310   6.104   3.704  0.69  0.00
+ATOM     61  CA  ALA A  61     -10.852   7.335   2.837  0.69  0.00
+ATOM     62  CA  THR A  62     -13.743   6.591   5.248  0.51  0.00
+ATOM     63  CA  PRO A  63     -16.301   8.659   3.320  0.31  0.00
+ATOM     64  CA  ALA A  64     -15.938   6.349   0.320  0.63  0.00
+ATOM     65  CA  LYS A  65     -18.644   4.608  -1.724  0.39  0.00
+ATOM     66  CA  SER A  66     -19.172   1.549   0.519  0.63  0.00
+ATOM     67  CA  GLU A  67     -19.557  -1.854  -1.214  0.11  0.00
+TER
+ATOM     68  CA  GLN B   1      18.247  -4.712   7.703  0.26  0.41
+ATOM     69  CA  PRO B   2      17.610  -2.112  10.405  0.48  0.28
+ATOM     70  CA  GLN B   3      14.169  -1.625  11.959  0.26  0.31
+ATOM     71  CA  ALA B   4      12.657  -0.402   8.698  0.58  0.13
+ATOM     72  CA  VAL B   5      13.720   1.829   5.835  0.57  1.19
+ATOM     73  CA  HIS B   6      13.905  -0.263   2.699  0.56  0.28
+ATOM     74  CA  THR B   7      10.465   1.029   1.851  0.71  0.39
+ATOM     75  CA  TYR B   8       9.046   0.529  -1.640  0.85  1.47
+ATOM     76  CA  CYS B   9       8.247   2.655  -4.695  0.41  1.02
+ATOM     77  CA  GLY B  10       5.147   2.600  -6.916  0.42  1.82
+ATOM     78  CA  ARG B  11       2.431  -0.093  -6.723  0.41  1.79
+ATOM     79  CA  HIS B  12       3.776  -1.450  -3.474  0.47  1.62
+ATOM     80  CA  LEU B  13       2.349   1.810  -2.180  0.66  1.36
+ATOM     81  CA  ALA B  14      -1.070   1.380  -3.751  0.44  1.91
+ATOM     82  CA  ARG B  15      -1.212  -1.877  -1.845  0.47  2.20
+ATOM     83  CA  THR B  16       0.010  -0.302   1.373  0.51  2.25
+ATOM     84  CA  LEU B  17      -2.922   2.075   1.890  0.49  2.02
+ATOM     85  CA  ALA B  18      -5.069  -0.864   0.983  0.48  1.91
+ATOM     86  CA  ASP B  19      -3.782  -2.923   3.840  0.47  2.36
+ATOM     87  CA  LEU B  20      -3.597  -0.073   6.305  0.53  1.56
+ATOM     88  CA  CYS B  21      -6.984   1.472   5.670  0.56  1.71
+ATOM     89  CA  TRP B  22      -7.829  -2.162   6.125  0.60  0.37
+ATOM     90  CA  GLU B  23      -6.134  -2.566   9.496  0.36  0.33
+ATOM     91  CA  ALA B  24      -7.262   0.877  10.572  0.38  0.38
+ATOM     92  CA  GLY B  25     -10.783  -0.507  10.471  0.53  0.17
+ATOM     93  CA  VAL B  26     -11.894  -2.781   7.616  0.63  0.40
+ATOM     94  CA  ASP B  27     -15.252  -1.237   8.432  0.18  0.00
+TER
+CONECT    1    0    0    0    0   68                                           :
+CONECT    2    0    0    0    0   69                                           :
+CONECT    3    0    0    0    0   70                                           :
+CONECT    4    0    0    0    0   71                                           :
+CONECT    5    0    0    0    0   72                                           :
+CONECT    6    0    0    0    0   73                                           :
+CONECT    7    0    0    0    0   74                                           :
+CONECT    8    0    0    0    0   75                                           :
+CONECT    9    0    0    0    0   76                                           :
+CONECT   10    0    0    0    0   77                                           :
+CONECT   11    0    0    0    0   78                                           :
+CONECT   12    0    0    0    0   79                                           :
+CONECT   13    0    0    0    0   80                                           :
+CONECT   14    0    0    0    0   81                                           :
+CONECT   15    0    0    0    0   82                                           :
+CONECT   16    0    0    0    0   83                                           :
+CONECT   17    0    0    0    0   84                                           :
+CONECT   18    0    0    0    0   85                                           :
+CONECT   19    0    0    0    0   86                                           :
+CONECT   20    0    0    0    0   87                                           :
+CONECT   21    0    0    0    0   88                                           :
+CONECT   22    0    0    0    0   89                                           :
+CONECT   23    0    0    0    0   90                                           :
+CONECT   24    0    0    0    0   91                                           :
+CONECT   25    0    0    0    0   92                                           :
+CONECT   26    0    0    0    0   93                                           :
+END
diff --git a/tests/test1.sh b/tests/test1.sh
new file mode 100755
index 0000000..58f4fdc
--- /dev/null
+++ b/tests/test1.sh
@@ -0,0 +1,4 @@
+#! /bin/sh
+
+../src/sap 1bom_atm.pdb 1igl_atm.pdb 
+
diff --git a/tests/test2.sh b/tests/test2.sh
new file mode 100755
index 0000000..4525e67
--- /dev/null
+++ b/tests/test2.sh
@@ -0,0 +1,3 @@
+#! /bin/sh
+
+diff super.pdb sapout.pdb

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/sap.git



More information about the debian-med-commit mailing list