[hamradio-commits] [nec2c] 04/08: Imported Upstream version 1.3

Dave Hibberd hibby-guest at moszumanska.debian.org
Sun Feb 15 00:35:20 UTC 2015


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

hibby-guest pushed a commit to branch master
in repository nec2c.

commit c8953e5a53a0fd6bec7bc6a740b5a6daafb46200
Author: Dave Hibberd <d at vehibberd.com>
Date:   Sat Feb 14 23:40:15 2015 +0000

    Imported Upstream version 1.3
---
 AUTHORS        |    1 +
 COPYING        |  675 +++++-
 ChangeLog      |    1 +
 INSTALL        |  370 ++++
 Makefile       |   26 -
 Makefile.am    |   50 +
 Makefile.in    |  808 +++++++
 NEWS           |    1 +
 README         |   90 +-
 aclocal.m4     | 1185 +++++++++++
 autogen.sh     |  167 ++
 calculations.c |  355 ++--
 compile        |  347 +++
 config.h.in    |   87 +
 configure      | 6445 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 configure.ac   |   44 +
 depcomp        |  791 +++++++
 fields.c       |  440 ++--
 geometry.c     |  500 +++--
 ground.c       |   69 +-
 input.c        |   63 +-
 install-sh     |  527 +++++
 main.c         |  400 ++--
 matrix.c       |  236 +--
 misc.c         |   19 +-
 missing        |  215 ++
 nec2c.h        |  198 +-
 network.c      |  172 +-
 radiation.c    |  401 ++--
 shared.c       |   67 +
 shared.h       |   67 +
 somnec.c       |  193 +-
 32 files changed, 13377 insertions(+), 1633 deletions(-)

diff --git a/AUTHORS b/AUTHORS
index 9b094ff..510331a 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -1,2 +1,3 @@
 Neoklis Kyriazis
 Ham Radio Call: 5B4AZ
+nkcyham at yahoo.com
diff --git a/COPYING b/COPYING
deleted file mode 120000
index 0b6cbf8..0000000
--- a/COPYING
+++ /dev/null
@@ -1 +0,0 @@
-/usr/share/automake-1.10/COPYING
\ No newline at end of file
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..5b6184f
--- /dev/null
+++ b/ChangeLog
@@ -0,0 +1 @@
+Please see the README file
diff --git a/INSTALL b/INSTALL
new file mode 100644
index 0000000..007e939
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,370 @@
+Installation Instructions
+*************************
+
+Copyright (C) 1994-1996, 1999-2002, 2004-2013 Free Software Foundation,
+Inc.
+
+   Copying and distribution of this file, with or without modification,
+are permitted in any medium without royalty provided the copyright
+notice and this notice are preserved.  This file is offered as-is,
+without warranty of any kind.
+
+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.  Some packages provide this
+`INSTALL' file but do not implement all of the features documented
+below.  The lack of an optional feature in a given package is not
+necessarily a bug.  More recommendations for GNU packages can be found
+in *note Makefile Conventions: (standards)Makefile Conventions.
+
+   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, generally using the just-built uninstalled binaries.
+
+  4. Type `make install' to install the programs and any data files and
+     documentation.  When installing into a prefix owned by root, it is
+     recommended that the package be configured and built as a regular
+     user, and only the `make install' phase executed with root
+     privileges.
+
+  5. Optionally, type `make installcheck' to repeat any self-tests, but
+     this time using the binaries in their final installed location.
+     This target does not install anything.  Running this target as a
+     regular user, particularly if the prior `make install' required
+     root privileges, verifies that the installation completed
+     correctly.
+
+  6. 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.
+
+  7. Often, you can also type `make uninstall' to remove the installed
+     files again.  In practice, not all packages have tested that
+     uninstallation works correctly, even though it is required by the
+     GNU Coding Standards.
+
+  8. Some packages, particularly those that use Automake, provide `make
+     distcheck', which can by used by developers to test that all other
+     targets like `make install' and `make uninstall' work correctly.
+     This target is generally not run by end users.
+
+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 `..'.  This
+is known as a "VPATH" build.
+
+   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', where PREFIX must be an
+absolute file name.
+
+   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.  In general, the
+default for these options is expressed in terms of `${prefix}', so that
+specifying just `--prefix' will affect all of the other directory
+specifications that were not explicitly provided.
+
+   The most portable way to affect installation locations is to pass the
+correct locations to `configure'; however, many packages provide one or
+both of the following shortcuts of passing variable assignments to the
+`make install' command line to change installation locations without
+having to reconfigure or recompile.
+
+   The first method involves providing an override variable for each
+affected directory.  For example, `make install
+prefix=/alternate/directory' will choose an alternate location for all
+directory configuration variables that were expressed in terms of
+`${prefix}'.  Any directories that were specified during `configure',
+but not in terms of `${prefix}', must each be overridden at install
+time for the entire installation to be relocated.  The approach of
+makefile variable overrides for each directory variable is required by
+the GNU Coding Standards, and ideally causes no recompilation.
+However, some platforms have known limitations with the semantics of
+shared libraries that end up requiring recompilation when using this
+method, particularly noticeable in packages that use GNU Libtool.
+
+   The second method involves providing the `DESTDIR' variable.  For
+example, `make install DESTDIR=/alternate/directory' will prepend
+`/alternate/directory' before all installation names.  The approach of
+`DESTDIR' overrides is not required by the GNU Coding Standards, and
+does not work on platforms that have drive letters.  On the other hand,
+it does better at avoiding recompilation issues, and works well even
+when some directory options were not specified in terms of `${prefix}'
+at `configure' time.
+
+Optional Features
+=================
+
+   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'.
+
+   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.
+
+   Some packages offer the ability to configure how verbose the
+execution of `make' will be.  For these packages, running `./configure
+--enable-silent-rules' sets the default to minimal output, which can be
+overridden with `make V=1'; while running `./configure
+--disable-silent-rules' sets the default to verbose, which can be
+overridden with `make V=0'.
+
+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 -D_XOPEN_SOURCE=500"
+
+and if that doesn't work, install pre-built binaries of GCC for HP-UX.
+
+   HP-UX `make' updates targets which have the same time stamps as
+their prerequisites, which makes it generally unusable when shipped
+generated files such as `configure' are involved.  Use GNU `make'
+instead.
+
+   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"
+
+   On Solaris, don't put `/usr/ucb' early in your `PATH'.  This
+directory contains several dysfunctional programs; working variants of
+these programs are available in `/usr/bin'.  So, if you need `/usr/ucb'
+in your `PATH', put it _after_ `/usr/bin'.
+
+   On Haiku, software installed for all users goes in `/boot/common',
+not `/usr/local'.  It is recommended to use the following options:
+
+     ./configure --prefix=/boot/common
+
+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 limitation.  Until the limitation is lifted, you can use
+this workaround:
+
+     CONFIG_SHELL=/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 b/Makefile
deleted file mode 100644
index 47b30c2..0000000
--- a/Makefile
+++ /dev/null
@@ -1,26 +0,0 @@
-#Makefile for nec2c     21 Aug 2003
-
-SHELL = /bin/sh
-PROJECT = nec2c
-BINDIR  = /usr/local/bin
-CC = gcc -Wall -O2 -march=native
-
-objects = calculations.o fields.o geometry.o ground.o input.o \
-	  main.o matrix.o misc.o network.o radiation.o somnec.o
-
-$(PROJECT) : $(objects)
-	    $(CC) -lm -o $(PROJECT) $(objects)
-
-$(objects) : nec2c.h
-
-nec2dx :
-	g77 -o nec2dx nec2dx.f
-	install -m 755 --strip nec2dx $(BINDIR)
-
-install : $(PROJECT)
-	  install -m 755 $(PROJECT) $(BINDIR)
-
-.PHONY : distclean
-distclean  :
-	-rm -f *.o *~ $(PROJECT) nec2dx
-
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..4f7dc87
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,50 @@
+## Process this file with automake to produce Makefile.in
+
+EXTRA_DIST = \
+  autogen.sh \
+  NEC2-bug.txt 
+
+AM_CPPFLAGS = \
+	-DPACKAGE_DATA_DIR=\""$(datadir)"\" \
+	-DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \
+	@PACKAGE_CFLAGS@
+
+bin_PROGRAMS = nec2c
+
+nec2c_SOURCES = \
+  calculations.c \
+  geometry.c \
+  input.c \
+  matrix.c \
+  network.c \
+  shared.c \
+  fields.c \
+  ground.c \
+  main.c \
+  misc.c \
+  radiation.c \
+  somnec.c \
+  nec2c.h \
+  shared.h
+
+install-data-local:
+	@$(NORMAL_INSTALL)
+	if test -d $(srcdir)/pixmaps; then \
+	  $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/pixmaps; \
+	  for pixmap in $(srcdir)/pixmaps/*; do \
+	    if test -f $$pixmap; then \
+	      $(INSTALL_DATA) $$pixmap $(DESTDIR)$(pkgdatadir)/pixmaps; \
+	    fi \
+	  done \
+	fi
+
+dist-hook:
+	if test -d pixmaps; then \
+	  mkdir $(distdir)/pixmaps; \
+	  for pixmap in pixmaps/*; do \
+	    if test -f $$pixmap; then \
+	      cp -p $$pixmap $(distdir)/pixmaps; \
+	    fi \
+	  done \
+	fi
+
diff --git a/Makefile.in b/Makefile.in
new file mode 100644
index 0000000..b4c5f58
--- /dev/null
+++ b/Makefile.in
@@ -0,0 +1,808 @@
+# Makefile.in generated by automake 1.14 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2013 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@
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@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 = nec2c$(EXEEXT)
+subdir = .
+DIST_COMMON = INSTALL NEWS README AUTHORS ChangeLog \
+	$(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+	$(top_srcdir)/configure $(am__configure_deps) \
+	$(srcdir)/config.h.in depcomp COPYING compile 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 = config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)"
+PROGRAMS = $(bin_PROGRAMS)
+am_nec2c_OBJECTS = calculations.$(OBJEXT) geometry.$(OBJEXT) \
+	input.$(OBJEXT) matrix.$(OBJEXT) network.$(OBJEXT) \
+	shared.$(OBJEXT) fields.$(OBJEXT) ground.$(OBJEXT) \
+	main.$(OBJEXT) misc.$(OBJEXT) radiation.$(OBJEXT) \
+	somnec.$(OBJEXT)
+nec2c_OBJECTS = $(am_nec2c_OBJECTS)
+nec2c_LDADD = $(LDADD)
+AM_V_P = $(am__v_P_ at AM_V@)
+am__v_P_ = $(am__v_P_ at AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_ at AM_V@)
+am__v_GEN_ = $(am__v_GEN_ at AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_ at AM_V@)
+am__v_at_ = $(am__v_at_ at AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
+DEFAULT_INCLUDES = -I. at am__isrc@
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_ at AM_V@)
+am__v_CC_ = $(am__v_CC_ at AM_DEFAULT_V@)
+am__v_CC_0 = @echo "  CC      " $@;
+am__v_CC_1 = 
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_ at AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_ at AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo "  CCLD    " $@;
+am__v_CCLD_1 = 
+SOURCES = $(nec2c_SOURCES)
+DIST_SOURCES = $(nec2c_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
+	$(LISP)config.h.in
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+CSCOPE = cscope
+AM_RECURSIVE_TARGETS = cscope
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+am__remove_distdir = \
+  if test -d "$(distdir)"; then \
+    find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
+      && rm -rf "$(distdir)" \
+      || { sleep 5 && rm -rf "$(distdir)"; }; \
+  else :; fi
+am__post_remove_distdir = $(am__remove_distdir)
+DIST_ARCHIVES = $(distdir).tar.gz
+GZIP_ENV = --best
+DIST_TARGETS = dist-gzip
+distuninstallcheck_listfiles = find . -type f -print
+am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
+  | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
+distcleancheck_listfiles = find . -type f -print
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+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@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_CFLAGS = @PACKAGE_CFLAGS@
+PACKAGE_LIBS = @PACKAGE_LIBS@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+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@
+ac_ct_CXX = @ac_ct_CXX@
+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@
+EXTRA_DIST = \
+  autogen.sh \
+  NEC2-bug.txt 
+
+AM_CPPFLAGS = \
+	-DPACKAGE_DATA_DIR=\""$(datadir)"\" \
+	-DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \
+	@PACKAGE_CFLAGS@
+
+nec2c_SOURCES = \
+  calculations.c \
+  geometry.c \
+  input.c \
+  matrix.c \
+  network.c \
+  shared.c \
+  fields.c \
+  ground.c \
+  main.c \
+  misc.c \
+  radiation.c \
+  somnec.c \
+  nec2c.h \
+  shared.h
+
+all: config.h
+	$(MAKE) $(AM_MAKEFLAGS) all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .o .obj
+am--refresh: Makefile
+	@:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \
+	      $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
+	$(am__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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+	$(am__cd) $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+	$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+$(am__aclocal_m4_deps):
+
+config.h: stamp-h1
+	@test -f $@ || rm -f stamp-h1
+	@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1
+
+stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
+	@rm -f stamp-h1
+	cd $(top_builddir) && $(SHELL) ./config.status config.h
+$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) 
+	($(am__cd) $(top_srcdir) && $(AUTOHEADER))
+	rm -f stamp-h1
+	touch $@
+
+distclean-hdr:
+	-rm -f config.h stamp-h1
+install-binPROGRAMS: $(bin_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+	fi; \
+	for p in $$list; do echo "$$p $$p"; done | \
+	sed 's/$(EXEEXT)$$//' | \
+	while read p p1; do if test -f $$p \
+	  ; then echo "$$p"; echo "$$p"; else :; fi; \
+	done | \
+	sed -e 'p;s,.*/,,;n;h' \
+	    -e 's|.*|.|' \
+	    -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+	sed 'N;N;N;s,\n, ,g' | \
+	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+	  { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+	    if ($$2 == $$4) files[d] = files[d] " " $$1; \
+	    else { print "f", $$3 "/" $$4, $$1; } } \
+	  END { for (d in files) print "f", d, files[d] }' | \
+	while read type dir files; do \
+	    if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+	    test -z "$$files" || { \
+	      echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+	      $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+	    } \
+	; done
+
+uninstall-binPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+	files=`for p in $$list; do echo "$$p"; done | \
+	  sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+	      -e 's/$$/$(EXEEXT)/' \
+	`; \
+	test -n "$$list" || exit 0; \
+	echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+	cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+	-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+
+nec2c$(EXEEXT): $(nec2c_OBJECTS) $(nec2c_DEPENDENCIES) $(EXTRA_nec2c_DEPENDENCIES) 
+	@rm -f nec2c$(EXEEXT)
+	$(AM_V_CCLD)$(LINK) $(nec2c_OBJECTS) $(nec2c_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/calculations.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/fields.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/geometry.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ground.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/input.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/main.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)/misc.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/network.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/radiation.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/shared.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/somnec.Po at am__quote@
+
+.c.o:
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+ at am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(AM_V_CC at am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+ID: $(am__tagged_files)
+	$(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	set x; \
+	here=`pwd`; \
+	$(am__define_uniq_tagged_files); \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	$(am__define_uniq_tagged_files); \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+cscope: cscope.files
+	test ! -s cscope.files \
+	  || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
+clean-cscope:
+	-rm -f cscope.files
+cscope.files: clean-cscope cscopelist
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+	list='$(am__tagged_files)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+	-rm -f cscope.out cscope.in.out cscope.po.out cscope.files
+
+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 "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+	$(MAKE) $(AM_MAKEFLAGS) \
+	  top_distdir="$(top_distdir)" distdir="$(distdir)" \
+	  dist-hook
+	-test -n "$(am__skip_mode_fix)" \
+	|| find "$(distdir)" -type d ! -perm -755 \
+		-exec chmod u+rwx,go+rx {} \; -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__post_remove_distdir)
+
+dist-bzip2: distdir
+	tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
+	$(am__post_remove_distdir)
+
+dist-lzip: distdir
+	tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
+	$(am__post_remove_distdir)
+
+dist-xz: distdir
+	tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
+	$(am__post_remove_distdir)
+
+dist-tarZ: distdir
+	@echo WARNING: "Support for shar distribution archives is" \
+	               "deprecated." >&2
+	@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
+	tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
+	$(am__post_remove_distdir)
+
+dist-shar: distdir
+	@echo WARNING: "Support for distribution archives compressed with" \
+		       "legacy program 'compress' is deprecated." >&2
+	@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
+	shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+	$(am__post_remove_distdir)
+
+dist-zip: distdir
+	-rm -f $(distdir).zip
+	zip -rq $(distdir).zip $(distdir)
+	$(am__post_remove_distdir)
+
+dist dist-all:
+	$(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
+	$(am__post_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) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
+	*.tar.bz2*) \
+	  bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
+	*.tar.lz*) \
+	  lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
+	*.tar.xz*) \
+	  xz -dc $(distdir).tar.xz | $(am__untar) ;;\
+	*.tar.Z*) \
+	  uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
+	*.shar.gz*) \
+	  GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
+	*.zip*) \
+	  unzip $(distdir).zip ;;\
+	esac
+	chmod -R a-w $(distdir)
+	chmod u+w $(distdir)
+	mkdir $(distdir)/_build $(distdir)/_inst
+	chmod a-w $(distdir)
+	test -d $(distdir)/_build || exit 0; \
+	dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+	  && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+	  && am__cwd=`pwd` \
+	  && $(am__cd) $(distdir)/_build \
+	  && ../configure --srcdir=.. --prefix="$$dc_install_base" \
+	    $(AM_DISTCHECK_CONFIGURE_FLAGS) \
+	    $(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 \
+	  && cd "$$am__cwd" \
+	  || exit 1
+	$(am__post_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:
+	@test -n '$(distuninstallcheck_dir)' || { \
+	  echo 'ERROR: trying to run $@ with an empty' \
+	       '$$(distuninstallcheck_dir)' >&2; \
+	  exit 1; \
+	}; \
+	$(am__cd) '$(distuninstallcheck_dir)' || { \
+	  echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
+	  exit 1; \
+	}; \
+	test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
+	   || { 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-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:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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-binPROGRAMS clean-generic mostlyclean-am
+
+distclean: distclean-am
+	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
+	-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
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-data-local
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
+	-rm -rf $(top_srcdir)/autom4te.cache
+	-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: all install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am am--refresh check check-am clean \
+	clean-binPROGRAMS clean-cscope clean-generic cscope \
+	cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \
+	dist-gzip dist-hook dist-lzip dist-shar dist-tarZ dist-xz \
+	dist-zip distcheck distclean distclean-compile \
+	distclean-generic distclean-hdr distclean-tags distcleancheck \
+	distdir distuninstallcheck dvi dvi-am html html-am info \
+	info-am install install-am install-binPROGRAMS install-data \
+	install-data-am install-data-local 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 tags-am uninstall \
+	uninstall-am uninstall-binPROGRAMS
+
+
+install-data-local:
+	@$(NORMAL_INSTALL)
+	if test -d $(srcdir)/pixmaps; then \
+	  $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/pixmaps; \
+	  for pixmap in $(srcdir)/pixmaps/*; do \
+	    if test -f $$pixmap; then \
+	      $(INSTALL_DATA) $$pixmap $(DESTDIR)$(pkgdatadir)/pixmaps; \
+	    fi \
+	  done \
+	fi
+
+dist-hook:
+	if test -d pixmaps; then \
+	  mkdir $(distdir)/pixmaps; \
+	  for pixmap in pixmaps/*; do \
+	    if test -f $$pixmap; then \
+	      cp -p $$pixmap $(distdir)/pixmaps; \
+	    fi \
+	  done \
+	fi
+
+# 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..5b6184f
--- /dev/null
+++ b/NEWS
@@ -0,0 +1 @@
+Please see the README file
diff --git a/README b/README
old mode 100755
new mode 100644
index 0ac41e7..cf2c9fd
--- a/README
+++ b/README
@@ -1,6 +1,21 @@
 
   README File for nec2c
 
+  0. IMPORTANT!: As I am getting on in age (I am 1948 vintage), I have decided
+  to spend more time on easier and possibly more pleasant activities, like 
+  gardening and photography. Another pressing reason for moving away from
+  active work on computers is the increasing complexity of FOSS operating
+  systems, which have recently made it more or less impossible for me to
+  install a distribution that would work well with all my peripherals, notably
+  my printer, sound card and WIFI adaptor.
+
+  Therefore I will only undertake to fix minor bugs in the applications I have
+  written and provide some help with setting up and configuring, if needed. I
+  can no longer undertake to implement new large scale and difficult feature
+  requests and modifications to my applications, however anyone interested in
+  taking over maintenance and development is welcome to peruse freely any
+  source code I have written, respecting the GPL license where applicable.
+
   1. INTRODUCTION:
   nec2c is a translation of the NEC2 FORTRAN source code to the C language.
   The translation was performed mostly "by hand" and a lot of modifications
@@ -69,28 +84,28 @@
   results for graphical plots directly in its buffers.
 
   3. COMPILATION:
-  The nec2c package is very simple at this time and compilation basically
-  only requires a Linux platform with development tools installed (gcc,
-  make and optionally gdb and "valgrind" for debugging). To compile the
-  source code just type "make nec2c" in the nec2c directory and if all is
-  well an executable binary (nec2c) should be produced. If gdb is not
-  installed, remove the -g option from the line in Makefile the reads:
-  CC = gcc -Wall -O3 -g
-
-  These changes can also be made if debugging is not of interest, thereby
-  reducing the size of the binary and speeding it as well. If desired,
-  nec2c can be installed (to /usr/local/bin) with "make install".
-
-  There is a double precision FORTRAN source (nec2dx.f) in this package
-  and this can be compiled and installed by typing "make nec2dx" in the
-  nec2c directory. It can be run by typing nec2dx and supplying an input
-  and output file name and it may be used to check nec2c's results for
-  bugs etc.
+  Please note that I use Arch Linux AMD64 which is a "bleeding edge"
+  type distribution, so there may be compilation and/or run time
+  difficulties if you are using a relatively old distro.
+  
+  To compile the package, it may be preferable to first run the
+  included "autogen.sh" script in the package's top directory, to
+  produce a fresh build environment. Then the "configure" script can
+  be run with optional parameters to override the default settings
+  and compiler flags, e.g: ./configure --prefix=/usr CFLAGS="-g -O2"
+  will override the default /usr/local installation prefix and the
+  "-Wall -O2" compiler flags.
+ 
+  Running "make" in the package's top directory should produce the
+  executable binary in src/. Running "make install" will install the
+  binary into /usr/local/bin by default or under the specified
+  prefix. There is also this hypertext documentation file which
+  you can copy to a location of your choice.
 
   4. USAGE: nec2c is run as a non-interactive command-line application
   and is invoked in the following manner:
   nec2c -i<input-file-name> [-o<output-file-name>][-hv]
-         -h: print this usage information and exit.
+  -h: print this usage information and exit.
          -v: print nec2c version number and exit.
 
   The -i option is always needed and it specifies the name of the input
@@ -155,14 +170,45 @@
   when maximum admittance matrix asymmetry printing is requested in the
   Ex card.
 
+  Version 0.9: After a bug report by David J. Singer, I changed all
+  declarations of variables that are used in memory allocations, from int
+  to size_t. This error was in the nec2c code from the beginning but
+  apparently it only showed up when extremely large memory allocations
+  are requested in nec2c.
+
+  Version 1.0: Changed timing calculations to be in sec rather than msec,
+  as there are indications that for very long execution time, (working on
+  a huge number of wire segments and frequencies etc) negative times are
+  reporeted, possibly due to numerical overflows.
+
+  Version 1.1: I made extensive modifications to the source code to
+  silence a large number of warnings generated by the  LLVM clang
+  compiler when used with the -Weverything option. These  were mostly
+  cases of implicit conversions between variable types, like int to
+  char or uint to int etc. Also introduced an Autotools build system
+  for compiling and installation.
+
+  Version 1.2: Fixed four issues (defects) reported by Coverity Scan
+  (https://scan.coverity.com/). Two of those were in the somnec
+  functions and I suspect that they did effect the calculations in
+  the rom1() and gshank() functions, at least under some circumstances.
+  Unfortunately the original Fortran source (somnec.for), as the rest
+  of the NEC2 Fortran source, is extremely difficult to read so I am
+  not able to confirm the impact of those reported defects.
+
+  Version 1.3: Revised the fix of one issue reported by Coverity Scan,
+  as on more detailed comparison with the original Fortran code, it
+  seems the original changes (in the ROM1 function in SOMNEC) were
+  not correct. Unfortunately I cannot verify the correctness of the
+  above fixes, as nec2c does not print out SOMNEC output files.
+
   7. License:
   nec2c is Public Domain, same as the original FORTRAN source.
-  Please keep any software you write incorporating nec2c in Public Domain
-  or at least use an open license like GPL or BSD.
+  Please keep any software you write incorporating nec2c in Public
+  Domain or at least use an open license like GPL or BSD.
 
   8. AUTHOR:
 
   Neoklis Kyriazis
 
-  January 27 2004
-
+  February 12 2013
diff --git a/aclocal.m4 b/aclocal.m4
new file mode 100644
index 0000000..b85f6ae
--- /dev/null
+++ b/aclocal.m4
@@ -0,0 +1,1185 @@
+# generated automatically by aclocal 1.14 -*- Autoconf -*-
+
+# Copyright (C) 1996-2013 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_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
+[m4_warning([this file was generated for autoconf 2.69.
+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-2013 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.14'
+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.14], [],
+      [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 AM_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+[AM_AUTOMAKE_VERSION([1.14])dnl
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
+
+# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
+
+# Copyright (C) 2001-2013 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-2013 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_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+AC_DEFUN([AM_CONDITIONAL],
+[AC_PREREQ([2.52])dnl
+ m4_if([$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
+m4_define([_AM_COND_VALUE_$1], [$2])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-2013 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.
+
+
+# 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", "OBJC", "OBJCXX", "UPC", or "GJC".
+# 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
+
+m4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
+      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
+      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+      [$1], [OBJCXX], [depcc="$OBJCXX" 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".
+  rm -rf conftest.dir
+  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
+  am__universal=false
+  m4_case([$1], [CC],
+    [case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac],
+    [CXX],
+    [case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac])
+
+  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 10 /bin/sh.
+      echo '/* dummy */' > sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    # 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.  Also, some Intel
+    # versions had trouble with output in subdirs.
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    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
+      ;;
+    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+      # This compiler won't grok '-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj 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 $am__obj 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], [dnl
+AS_HELP_STRING(
+  [--enable-dependency-tracking],
+  [do not reject slow dependency extractors])
+AS_HELP_STRING(
+  [--disable-dependency-tracking],
+  [speeds up one-time build])])
+if test "x$enable_dependency_tracking" != xno; then
+  am_depcomp="$ac_aux_dir/depcomp"
+  AMDEPBACKSLASH='\'
+  am__nodep='_no'
+fi
+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+AC_SUBST([AMDEPBACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+AC_SUBST([am__nodep])dnl
+_AM_SUBST_NOTMAKE([am__nodep])dnl
+])
+
+# Generate code to set up dependency tracking.              -*- Autoconf -*-
+
+# Copyright (C) 1999-2013 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_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[{
+  # Older Autoconf quotes --file arguments for eval, but not when files
+  # are listed without --file.  Let's play safe and only enable the eval
+  # if we detect the quoting.
+  case $CONFIG_FILES in
+  *\'*) eval set x "$CONFIG_FILES" ;;
+  *)   set x $CONFIG_FILES ;;
+  esac
+  shift
+  for mf
+  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"`
+    # 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'`; 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-2013 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 macro actually does too much.  Some checks are only needed if
+# your package does certain things.  But this isn't really a big deal.
+
+dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
+m4_define([AC_PROG_CC],
+m4_defn([AC_PROG_CC])
+[_AM_PROG_CC_C_O
+])
+
+# 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.65])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],
+[AC_DIAGNOSE([obsolete],
+             [$0: two- and three-arguments forms are deprecated.])
+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], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
+  [ok:ok],,
+  [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])
+AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+# For better backward compatibility.  To be removed once Automake 1.9.x
+# dies out for good.  For more background, see:
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
+# 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])],
+		  [m4_define([AC_PROG_CC],
+			     m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+		  [_AM_DEPENDENCIES([CXX])],
+		  [m4_define([AC_PROG_CXX],
+			     m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+		  [_AM_DEPENDENCIES([OBJC])],
+		  [m4_define([AC_PROG_OBJC],
+			     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
+		  [_AM_DEPENDENCIES([OBJCXX])],
+		  [m4_define([AC_PROG_OBJCXX],
+			     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
+])
+AC_REQUIRE([AM_SILENT_RULES])dnl
+dnl The testsuite driver may need to know about EXEEXT, so add the
+dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
+dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
+AC_CONFIG_COMMANDS_PRE(dnl
+[m4_provide_if([_AM_COMPILER_EXEEXT],
+  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
+
+# POSIX will say in a future version that running "rm -f" with no argument
+# is OK; and we want to be able to make that assumption in our Makefile
+# recipes.  So use an aggressive probe to check that the usage we want is
+# actually supported "in the wild" to an acceptable degree.
+# See automake bug#10828.
+# To make any issue more visible, cause the running configure to be aborted
+# by default if the 'rm' program in use doesn't match our expectations; the
+# user can still override this though.
+if rm -f && rm -fr && rm -rf; then : OK; else
+  cat >&2 <<'END'
+Oops!
+
+Your 'rm' program seems unable to run without file operands specified
+on the command line, even when the '-f' option is present.  This is contrary
+to the behaviour of most rm programs out there, and not conforming with
+the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
+
+Please tell bug-automake at gnu.org about your system, including the value
+of your $PATH and any error possibly output before this message.  This
+can help us improve future automake versions.
+
+END
+  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
+    echo 'Configuration will proceed anyway, since you have set the' >&2
+    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
+    echo >&2
+  else
+    cat >&2 <<'END'
+Aborting the configuration process, to ensure you take notice of the issue.
+
+You can download and install GNU coreutils to get an 'rm' implementation
+that behaves properly: <http://www.gnu.org/software/coreutils/>.
+
+If you want to complete the configuration process using your problematic
+'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
+to "yes", and re-run configure.
+
+END
+    AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
+  fi
+fi])
+
+dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
+dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
+dnl mangled by Autoconf and run in a shell conditional statement.
+m4_define([_AC_COMPILER_EXEEXT],
+m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
+
+# 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-2013 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
+if test x"${install_sh}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\	*)
+    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+  *)
+    install_sh="\${SHELL} $am_aux_dir/install-sh"
+  esac
+fi
+AC_SUBST([install_sh])])
+
+# Copyright (C) 2003-2013 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.
+
+# 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])])
+
+# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
+# From Jim Meyering
+
+# Copyright (C) 1996-2013 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_MAINTAINER_MODE([DEFAULT-MODE])
+# ----------------------------------
+# Control maintainer-specific portions of Makefiles.
+# Default is to disable them, unless 'enable' is passed literally.
+# For symmetry, 'disable' may be passed as well.  Anyway, the user
+# can override the default with the --enable/--disable switch.
+AC_DEFUN([AM_MAINTAINER_MODE],
+[m4_case(m4_default([$1], [disable]),
+       [enable], [m4_define([am_maintainer_other], [disable])],
+       [disable], [m4_define([am_maintainer_other], [enable])],
+       [m4_define([am_maintainer_other], [enable])
+        m4_warn([syntax], [unexpected argument to AM@&t at _MAINTAINER_MODE: $1])])
+AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
+  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
+  AC_ARG_ENABLE([maintainer-mode],
+    [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode],
+      am_maintainer_other[ make rules and dependencies not useful
+      (and sometimes confusing) to the casual installer])],
+    [USE_MAINTAINER_MODE=$enableval],
+    [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
+  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
+  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
+  MAINT=$MAINTAINER_MODE_TRUE
+  AC_SUBST([MAINT])dnl
+]
+)
+
+# Check to see how 'make' treats includes.	            -*- Autoconf -*-
+
+# Copyright (C) 2001-2013 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_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+	@echo this is the am__doit target
+.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
+# Ignore all kinds of additional output from 'make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+  am__include=include
+  am__quote=
+  _am_result=GNU
+  ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   case `$am_make -s -f confmf 2> /dev/null` in #(
+   *the\ am__doit\ target*)
+     am__include=.include
+     am__quote="\""
+     _am_result=BSD
+     ;;
+   esac
+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-2013 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_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 is modern enough.
+# If it is, 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
+if test x"${MISSING+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\	*)
+    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+  *)
+    MISSING="\${SHELL} $am_aux_dir/missing" ;;
+  esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --is-lightweight"; then
+  am_missing_run="$MISSING "
+else
+  am_missing_run=
+  AC_MSG_WARN(['missing' script is too old or missing])
+fi
+])
+
+# Helper functions for option handling.                     -*- Autoconf -*-
+
+# Copyright (C) 2001-2013 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_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],
+[m4_foreach_w([_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])])
+
+# Copyright (C) 1999-2013 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_CC_C_O
+# ---------------
+# Like AC_PROG_CC_C_O, but changed for automake.  We rewrite AC_PROG_CC
+# to automatically call this.
+AC_DEFUN([_AM_PROG_CC_C_O],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([compile])dnl
+AC_LANG_PUSH([C])dnl
+AC_CACHE_CHECK(
+  [whether $CC understands -c and -o together],
+  [am_cv_prog_cc_c_o],
+  [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
+  # Make sure it works both with $CC and with simple cc.
+  # Following AC_PROG_CC_C_O, we do the test twice because some
+  # compilers refuse to overwrite an existing .o file with -o,
+  # though they will create one.
+  am_cv_prog_cc_c_o=yes
+  for am_i in 1 2; do
+    if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
+         && test -f conftest2.$ac_objext; then
+      : OK
+    else
+      am_cv_prog_cc_c_o=no
+      break
+    fi
+  done
+  rm -f core conftest*
+  unset am_i])
+if test "$am_cv_prog_cc_c_o" != yes; then
+   # Losing compiler, so override with the script.
+   # FIXME: It is wrong to rewrite CC.
+   # But if we don't then we get into trouble of one sort or another.
+   # A longer-term fix would be to have automake use am__CC in this case,
+   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+   CC="$am_aux_dir/compile $CC"
+fi
+AC_LANG_POP([C])])
+
+# For backward compatibility.
+AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
+
+# Copyright (C) 2001-2013 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_RUN_LOG(COMMAND)
+# -------------------
+# Run COMMAND, save the exit status in ac_status, and log it.
+# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
+AC_DEFUN([AM_RUN_LOG],
+[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
+   ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+   (exit $ac_status); }])
+
+# Check to make sure that the build environment is sane.    -*- Autoconf -*-
+
+# Copyright (C) 1996-2013 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_SANITY_CHECK
+# ---------------
+AC_DEFUN([AM_SANITY_CHECK],
+[AC_MSG_CHECKING([whether build environment is sane])
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name.  Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+  *[[\\\"\#\$\&\'\`$am_lf]]*)
+    AC_MSG_ERROR([unsafe absolute working directory name]);;
+esac
+case $srcdir in
+  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
+    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
+esac
+
+# 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 (
+   am_has_slept=no
+   for am_try in 1 2; do
+     echo "timestamp, slept: $am_has_slept" > conftest.file
+     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
+     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
+     if test "$[2]" = conftest.file || test $am_try -eq 2; then
+       break
+     fi
+     # Just in case.
+     sleep 1
+     am_has_slept=yes
+   done
+   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])
+# If we didn't sleep, we still need to ensure time stamps of config.status and
+# generated files are strictly newer.
+am_sleep_pid=
+if grep 'slept: no' conftest.file >/dev/null 2>&1; then
+  ( sleep 1 ) &
+  am_sleep_pid=$!
+fi
+AC_CONFIG_COMMANDS_PRE(
+  [AC_MSG_CHECKING([that generated files are newer than configure])
+   if test -n "$am_sleep_pid"; then
+     # Hide warnings about reused PIDs.
+     wait $am_sleep_pid 2>/dev/null
+   fi
+   AC_MSG_RESULT([done])])
+rm -f conftest.file
+])
+
+# Copyright (C) 2009-2013 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_SILENT_RULES([DEFAULT])
+# --------------------------
+# Enable less verbose build rules; with the default set to DEFAULT
+# ("yes" being less verbose, "no" or empty being verbose).
+AC_DEFUN([AM_SILENT_RULES],
+[AC_ARG_ENABLE([silent-rules], [dnl
+AS_HELP_STRING(
+  [--enable-silent-rules],
+  [less verbose build output (undo: "make V=1")])
+AS_HELP_STRING(
+  [--disable-silent-rules],
+  [verbose build output (undo: "make V=0")])dnl
+])
+case $enable_silent_rules in @%:@ (((
+  yes) AM_DEFAULT_VERBOSITY=0;;
+   no) AM_DEFAULT_VERBOSITY=1;;
+    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
+esac
+dnl
+dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
+dnl do not support nested variable expansions.
+dnl See automake bug#9928 and bug#10237.
+am_make=${MAKE-make}
+AC_CACHE_CHECK([whether $am_make supports nested variables],
+   [am_cv_make_support_nested_variables],
+   [if AS_ECHO([['TRUE=$(BAR$(V))
+BAR0=false
+BAR1=true
+V=1
+am__doit:
+	@$(TRUE)
+.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
+  am_cv_make_support_nested_variables=yes
+else
+  am_cv_make_support_nested_variables=no
+fi])
+if test $am_cv_make_support_nested_variables = yes; then
+  dnl Using '$V' instead of '$(V)' breaks IRIX make.
+  AM_V='$(V)'
+  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
+else
+  AM_V=$AM_DEFAULT_VERBOSITY
+  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
+fi
+AC_SUBST([AM_V])dnl
+AM_SUBST_NOTMAKE([AM_V])dnl
+AC_SUBST([AM_DEFAULT_V])dnl
+AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
+AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
+AM_BACKSLASH='\'
+AC_SUBST([AM_BACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
+])
+
+# Copyright (C) 2001-2013 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-2013 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])
+
+# AM_SUBST_NOTMAKE(VARIABLE)
+# --------------------------
+# Public sister of _AM_SUBST_NOTMAKE.
+AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
+
+# Check how to create a tarball.                            -*- Autoconf -*-
+
+# Copyright (C) 2004-2013 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_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.  Yes, it's still used
+# in the wild :-(  We should find a proper way to deprecate it ...
+AC_SUBST([AMTAR], ['$${TAR-tar}'])
+
+# We'll loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
+
+m4_if([$1], [v7],
+  [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
+
+  [m4_case([$1],
+    [ustar],
+     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
+      # There is notably a 21 bits limit for the UID and the GID.  In fact,
+      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
+      # and bug#13588).
+      am_max_uid=2097151 # 2^21 - 1
+      am_max_gid=$am_max_uid
+      # The $UID and $GID variables are not portable, so we need to resort
+      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
+      # below are definitely unexpected, so allow the users to see them
+      # (that is, avoid stderr redirection).
+      am_uid=`id -u || echo unknown`
+      am_gid=`id -g || echo unknown`
+      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
+      if test $am_uid -le $am_max_uid; then
+         AC_MSG_RESULT([yes])
+      else
+         AC_MSG_RESULT([no])
+         _am_tools=none
+      fi
+      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
+      if test $am_gid -le $am_max_gid; then
+         AC_MSG_RESULT([yes])
+      else
+        AC_MSG_RESULT([no])
+        _am_tools=none
+      fi],
+
+  [pax],
+    [],
+
+  [m4_fatal([Unknown tar format])])
+
+  AC_MSG_CHECKING([how to create a $1 tar archive])
+
+  # Go ahead even if we have the value already cached.  We do so because we
+  # need to set the values for the 'am__tar' and 'am__untar' variables.
+  _am_tools=${am_cv_prog_tar_$1-$_am_tools}
+
+  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])
+      AM_RUN_LOG([cat conftest.dir/file])
+      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/autogen.sh b/autogen.sh
new file mode 100755
index 0000000..a6a66b0
--- /dev/null
+++ b/autogen.sh
@@ -0,0 +1,167 @@
+#!/bin/sh
+# Run this to generate all the initial makefiles, etc.
+
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+
+DIE=0
+
+if [ -n "$GNOME2_DIR" ]; then
+	ACLOCAL_FLAGS="-I $GNOME2_DIR/share/aclocal $ACLOCAL_FLAGS"
+	LD_LIBRARY_PATH="$GNOME2_DIR/lib:$LD_LIBRARY_PATH"
+	PATH="$GNOME2_DIR/bin:$PATH"
+	export PATH
+	export LD_LIBRARY_PATH
+fi
+
+(test -f $srcdir/configure.ac) || {
+    echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
+    echo " top-level package directory"
+    exit 1
+}
+
+(autoconf --version) < /dev/null > /dev/null 2>&1 || {
+  echo
+  echo "**Error**: You must have \`autoconf' installed."
+  echo "Download the appropriate package for your distribution,"
+  echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
+  DIE=1
+}
+
+(grep "^AC_PROG_INTLTOOL" $srcdir/configure.ac >/dev/null) && {
+  (intltoolize --version) < /dev/null > /dev/null 2>&1 || {
+    echo 
+    echo "**Error**: You must have \`intltool' installed."
+    echo "You can get it from:"
+    echo "  ftp://ftp.gnome.org/pub/GNOME/"
+    DIE=1
+  }
+}
+
+(grep "^AM_PROG_XML_I18N_TOOLS" $srcdir/configure.ac >/dev/null) && {
+  (xml-i18n-toolize --version) < /dev/null > /dev/null 2>&1 || {
+    echo
+    echo "**Error**: You must have \`xml-i18n-toolize' installed."
+    echo "You can get it from:"
+    echo "  ftp://ftp.gnome.org/pub/GNOME/"
+    DIE=1
+  }
+}
+
+(grep "^AM_PROG_LIBTOOL" $srcdir/configure.ac >/dev/null) && {
+  (libtool --version) < /dev/null > /dev/null 2>&1 || {
+    echo
+    echo "**Error**: You must have \`libtool' installed."
+    echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/"
+    DIE=1
+  }
+}
+
+(grep "^AM_GLIB_GNU_GETTEXT" $srcdir/configure.ac >/dev/null) && {
+  (grep "sed.*POTFILES" $srcdir/configure.ac) > /dev/null || \
+  (glib-gettextize --version) < /dev/null > /dev/null 2>&1 || {
+    echo
+    echo "**Error**: You must have \`glib' installed."
+    echo "You can get it from: ftp://ftp.gtk.org/pub/gtk"
+    DIE=1
+  }
+}
+
+(automake --version) < /dev/null > /dev/null 2>&1 || {
+  echo
+  echo "**Error**: You must have \`automake' installed."
+  echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/"
+  DIE=1
+  NO_AUTOMAKE=yes
+}
+
+
+# if no automake, don't bother testing for aclocal
+test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || {
+  echo
+  echo "**Error**: Missing \`aclocal'.  The version of \`automake'"
+  echo "installed doesn't appear recent enough."
+  echo "You can get automake from ftp://ftp.gnu.org/pub/gnu/"
+  DIE=1
+}
+
+if test "$DIE" -eq 1; then
+  exit 1
+fi
+
+if test -z "$*"; then
+  echo "**Warning**: I am going to run \`configure' with no arguments."
+  echo "If you wish to pass any to it, please specify them on the"
+  echo \`$0\'" command line."
+  echo
+fi
+
+case $CC in
+xlc )
+  am_opt=--include-deps;;
+esac
+
+for coin in `find $srcdir -name configure.ac -print`
+do 
+  dr=`dirname $coin`
+  if test -f $dr/NO-AUTO-GEN; then
+    echo skipping $dr -- flagged as no auto-gen
+  else
+	echo processing $dr
+	( cd $dr
+
+	aclocalinclude="$ACLOCAL_FLAGS"
+
+	if grep "^AM_GLIB_GNU_GETTEXT" configure.ac >/dev/null; then
+	  echo "Creating $dr/aclocal.m4 ..."
+	  test -r $dr/aclocal.m4 || touch $dr/aclocal.m4
+
+	  echo "Running glib-gettextize...  Ignore non-fatal messages."
+	  echo "no" | glib-gettextize --force --copy
+
+	  echo "Making $dr/aclocal.m4 writable ..."
+	  test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4
+	fi
+
+	if grep "^AC_PROG_INTLTOOL" configure.ac >/dev/null; then
+	  echo "Running intltoolize..."
+	  intltoolize --copy --force --automake
+	fi
+
+	if grep "^AM_PROG_XML_I18N_TOOLS" configure.ac >/dev/null; then
+	  echo "Running xml-i18n-toolize..."
+	  xml-i18n-toolize --copy --force --automake
+	fi
+
+	if grep "^AM_PROG_LIBTOOL" configure.ac >/dev/null; then
+	  if test -z "$NO_LIBTOOLIZE" ; then 
+		echo "Running libtoolize..."
+		libtoolize --force --copy
+	  fi
+	fi
+
+	echo "Running aclocal $aclocalinclude ..."
+	aclocal $aclocalinclude
+
+	if grep "^AC_CONFIG_HEADERS" configure.ac >/dev/null; then
+	  echo "Running autoheader..."
+	  autoheader
+	fi
+
+	echo "Running automake --gnu $am_opt ..."
+	automake --add-missing --gnu $am_opt
+	echo "Running autoconf ..."
+	autoconf
+	)
+  fi
+done
+
+conf_flags="--enable-maintainer-mode"
+
+if test x$NOCONFIGURE = x; then
+  echo Running $srcdir/configure $conf_flags "$@" ...
+  $srcdir/configure $conf_flags "$@" \
+	&& echo Now type \`make\' to compile. || exit 1
+else
+  echo Skipping configure process.
+fi
diff --git a/calculations.c b/calculations.c
index 6526ece..aaf1298 100644
--- a/calculations.c
+++ b/calculations.c
@@ -24,47 +24,18 @@
  ******************************************************************/
 
 #include "nec2c.h"
-
-/* common  /tmi/ */
-extern tmi_t tmi;
-
-/*common  /ggrid/ */
-extern ggrid_t ggrid;
-
-/* common  /data/ */
-extern data_t data;
-
-/* common  /crnt/ */
-extern crnt_t crnt;
-
-/* common  /vsorc/ */
-extern vsorc_t vsorc;
-
-/* common  /segj/ */
-extern segj_t segj;
-
-/* common  /yparm/ */
-extern yparm_t yparm;
-
-/* common  /zload/ */
-extern zload_t zload;
-
-/* common  /smat/ */
-extern smat_t smat;
-
-/* pointers to input/output files */
-extern FILE *input_fp, *output_fp, *plot_fp;
+#include "shared.h"
 
 /*-----------------------------------------------------------------------*/
 
 /* cabc computes coefficients of the constant (a), sine (b), and */
 /* cosine (c) terms in the current interpolation functions for the */
 /* current vector cur. */
-void cabc( complex long double *curx)
+void cabc( complex double *curx)
 {
   int i, is, j, jx, jco1, jco2;
-  long double ar, ai, sh;
-  complex long double curd, cs1, cs2;
+  double ar, ai, sh;
+  complex double curd, cs1, cs2;
 
   if( data.n != 0)
   {
@@ -80,8 +51,8 @@ void cabc( complex long double *curx)
 
 	for( i = 0; i < data.n; i++ )
 	{
-	  ar= creall( curx[i]);
-	  ai= cimagl( curx[i]);
+	  ar= creal( curx[i]);
+	  ai= cimag( curx[i]);
 	  tbf( i+1, 1 );
 
 	  for( jx = 0; jx < segj.jsno; jx++ )
@@ -107,11 +78,11 @@ void cabc( complex long double *curx)
 		tbf(i+1,0);
 		data.icon1[i]= jx;
 		sh= data.si[i]*.5;
-		curd= CCJ* vsorc.vqds[is]/( (logl(2.* sh/ data.bi[i])-1.)*
-			(segj.bx[segj.jsno-1]* cosl(TP* sh)+ segj.cx[segj.jsno-1]*
-			 sinl(TP* sh))* data.wlam );
-		ar= creall( curd);
-		ai= cimagl( curd);
+		curd= CCJ* vsorc.vqds[is]/( (log(2.* sh/ data.bi[i])-1.)*
+			(segj.bx[segj.jsno-1]* cos(TP* sh)+ segj.cx[segj.jsno-1]*
+			 sin(TP* sh))* data.wlam );
+		ar= creal( curd);
+		ai= cimag( curd);
 
 		for( jx = 0; jx < segj.jsno; jx++ )
 		{
@@ -157,11 +128,12 @@ void cabc( complex long double *curx)
 /*-----------------------------------------------------------------------*/
 
 /* couple computes the maximum coupling between pairs of segments. */
-void couple( complex long double *cur, long double wlam )
+void couple( complex double *cur, double wlam )
 {
   int j, j1, j2, l1, i, k, itt1, itt2, its1, its2, isg1, isg2, npm1;
-  long double dbc, c, gmax;
-  complex long double y11, y12, y22, yl, yin, zl, zin, rho;
+  double dbc, c, gmax;
+  complex double y11, y12, y22, yl, yin, zl, zin, rho;
+  size_t mreq;
 
   if( (vsorc.nsant != 1) || (vsorc.nvqd != 0) )
 	return;
@@ -172,7 +144,9 @@ void couple( complex long double *cur, long double wlam )
 
   zin= vsorc.vsant[0];
   yparm.icoup++;
-  mem_realloc( (void *)&yparm.y11a, yparm.icoup * sizeof( complex long double) );
+  mreq = (size_t)yparm.icoup;
+  mreq *= sizeof( complex double);
+  mem_realloc( (void *)&yparm.y11a, mreq );
   yparm.y11a[yparm.icoup-1]= cur[j-1]*wlam/zin;
 
   l1=(yparm.icoup-1)*(yparm.ncoup-1);
@@ -182,7 +156,9 @@ void couple( complex long double *cur, long double wlam )
 	  continue;
 
 	l1++;
-	mem_realloc( (void *)&yparm.y12a, l1 * sizeof( complex long double) );
+	mreq = (size_t)l1;
+	mreq *= sizeof( complex double);
+	mem_realloc( (void *)&yparm.y12a, mreq );
 	k= isegno( yparm.nctag[i], yparm.ncseg[i]);
 	yparm.y12a[l1-1]= cur[k-1]* wlam/ zin;
   }
@@ -220,28 +196,28 @@ void couple( complex long double *cur, long double wlam )
 	  y22= yparm.y11a[j];
 	  y12=.5*( yparm.y12a[j1]+ yparm.y12a[j2]);
 	  yin= y12* y12;
-	  dbc= cabsl( yin);
-	  c= dbc/(2.* creall( y11)* creall( y22)- creall( yin));
+	  dbc= cabs( yin);
+	  c= dbc/(2.* creal( y11)* creal( y22)- creal( yin));
 
 	  if( (c >= 0.0) && (c <= 1.0) )
 	  {
 		if( c >= .01 )
-		  gmax=(1.- sqrtl(1.- c*c))/c;
+		  gmax=(1.- sqrt(1.- c*c))/c;
 		else
 		  gmax=.5*( c+.25* c* c* c);
 
-		rho= gmax* conjl( yin)/ dbc;
-		yl=((1.- rho)/(1.+ rho)+1.)* creall( y22)- y22;
+		rho= gmax* conj( yin)/ dbc;
+		yl=((1.- rho)/(1.+ rho)+1.)* creal( y22)- y22;
 		zl=1./ yl;
 		yin= y11- yin/( y22+ yl);
 		zin=1./ yin;
 		dbc= db10( gmax);
 
 		fprintf( output_fp, "\n"
-			" %4d %4d %5d  %4d %4d %5d  %9.3LF"
-			"  %12.5LE %12.5LE  %12.5LE %12.5LE",
+			" %4d %4d %5d  %4d %4d %5d  %9.3f"
+			"  %12.5E %12.5E  %12.5E %12.5E",
 			itt1, its1, isg1, itt2, its2, isg2, dbc,
-			creall(zl), cimagl(zl), creall(zin), cimagl(zin) );
+			creal(zl), cimag(zl), creal(zin), cimag(zin) );
 
 		continue;
 
@@ -249,7 +225,7 @@ void couple( complex long double *cur, long double wlam )
 
 	  fprintf( output_fp, "\n"
 		  " %4d %4d %5d   %4d %4d %5d  **ERROR** "
-		  "COUPLING IS NOT BETWEEN 0 AND 1. (= %12.5LE)",
+		  "COUPLING IS NOT BETWEEN 0 AND 1. (= %12.5E)",
 		  itt1, its1, isg1, itt2, its2, isg2, c );
 
 	} /* for( j = l1; j < yparm.ncoup; j++ ) */
@@ -264,12 +240,13 @@ void couple( complex long double *cur, long double wlam )
 /* load calculates the impedance of specified */
 /* segments for various types of loading */
 void load( int *ldtyp, int *ldtag, int *ldtagf, int *ldtagt,
-	long double *zlr, long double *zli, long double *zlc )
+	double *zlr, double *zli, double *zlc )
 {
   int i, iwarn, istep, istepx, l1, l2, ldtags, jump, ichk;
-  complex long double zt=CPLX_00, tpcj;
+  complex double zt=CPLX_00, tpcj;
+  size_t mreq;
 
-  tpcj = (0.0+1.883698955e+9fj);
+  tpcj = (0.0+I*1.883698955e+9);
   fprintf( output_fp, "\n"
 	  "  LOCATION        RESISTANCE  INDUCTANCE  CAPACITANCE   "
 	  "  IMPEDANCE (OHMS)   CONDUCTIVITY  CIRCUIT\n"
@@ -278,7 +255,9 @@ void load( int *ldtyp, int *ldtag, int *ldtagf, int *ldtagt,
 
   /* initialize d array, used for temporary */
   /* storage of loading information. */
-  mem_realloc( (void *)&zload.zarray, data.npm * sizeof(complex long double) );
+  mreq = (size_t)data.npm;
+  mreq *= sizeof(complex double);
+  mem_realloc( (void *)&zload.zarray, mreq );
   for( i = 0; i < data.n; i++ )
 	zload.zarray[i]=CPLX_00;
 
@@ -369,30 +348,30 @@ void load( int *ldtyp, int *ldtag, int *ldtagf, int *ldtagt,
 	  {
 		case 1:
 		  zt= zlr[istepx]/ data.si[i]+ tpcj* zli[istepx]/( data.si[i]* data.wlam);
-		  if( fabsl( zlc[istepx]) > 1.0e-20)
+		  if( fabs( zlc[istepx]) > 1.0e-20)
 			zt += data.wlam/( tpcj* data.si[i]* zlc[istepx]);
 		  break;
 
 		case 2:
 		  zt= tpcj* data.si[i]* zlc[istepx]/ data.wlam;
-		  if( fabsl( zli[istepx]) > 1.0e-20)
+		  if( fabs( zli[istepx]) > 1.0e-20)
 			zt += data.si[i]* data.wlam/( tpcj* zli[istepx]);
-		  if( fabsl( zlr[istepx]) > 1.0e-20)
+		  if( fabs( zlr[istepx]) > 1.0e-20)
 			zt += data.si[i]/ zlr[istepx];
 		  zt=1./ zt;
 		  break;
 
 		case 3:
 		  zt= zlr[istepx]* data.wlam+ tpcj* zli[istepx];
-		  if( fabsl( zlc[istepx]) > 1.0e-20)
+		  if( fabs( zlc[istepx]) > 1.0e-20)
 			zt += 1./( tpcj* data.si[i]* data.si[i]* zlc[istepx]);
 		  break;
 
 		case 4:
 		  zt= tpcj* data.si[i]* data.si[i]* zlc[istepx];
-		  if( fabsl( zli[istepx]) > 1.0e-20)
+		  if( fabs( zli[istepx]) > 1.0e-20)
 			zt += 1./( tpcj* zli[istepx]);
-		  if( fabsl( zlr[istepx]) > 1.0e-20)
+		  if( fabs( zlr[istepx]) > 1.0e-20)
 			zt += 1./( zlr[istepx]* data.wlam);
 		  zt=1./ zt;
 		  break;
@@ -406,7 +385,7 @@ void load( int *ldtyp, int *ldtag, int *ldtagf, int *ldtagt,
 
 	  } /* switch( jump ) */
 
-	  if(( fabsl( creall( zload.zarray[i]))+ fabsl( cimagl( zload.zarray[i]))) > 1.0e-20)
+	  if(( fabs( creal( zload.zarray[i]))+ fabs( cimag( zload.zarray[i]))) > 1.0e-20)
 		iwarn=TRUE;
 	  zload.zarray[i] += zt;
 
@@ -456,29 +435,28 @@ void load( int *ldtyp, int *ldtag, int *ldtagf, int *ldtagt,
 
   } /* while( TRUE ) */
 
-  return;
 }
 
 /*-----------------------------------------------------------------------*/
 
 /* gf computes the integrand exp(jkr)/(kr) for numerical integration. */
-void gf( long double zk, long double *co, long double *si )
+void gf( double zk, double *co, double *si )
 {
-  long double zdk, rk, rks;
+  double zdk, rk, rks;
 
   zdk= zk- tmi.zpk;
-  rk= sqrtl( tmi.rkb2+ zdk* zdk);
-  *si= sinl( rk)/ rk;
+  rk= sqrt( tmi.rkb2+ zdk* zdk);
+  *si= sin( rk)/ rk;
 
   if( tmi.ij != 0 )
   {
-	*co= cosl( rk)/ rk;
+	*co= cos( rk)/ rk;
 	return;
   }
 
   if( rk >= .2)
   {
-	*co=( cosl( rk)-1.)/ rk;
+	*co=( cos( rk)-1.)/ rk;
 	return;
   }
 
@@ -491,41 +469,41 @@ void gf( long double zk, long double *co, long double *si )
 /*-----------------------------------------------------------------------*/
 
 /* function db10 returns db for magnitude (field) */
-long double db10( long double x )
+double db10( double x )
 {
   if( x < 1.e-20 )
 	return( -999.99 );
 
-  return( 10. * log10l(x) );
+  return( 10. * log10(x) );
 }
 
 /*-----------------------------------------------------------------------*/
 
 /* function db20 returns db for mag**2 (power) i */
-long double db20( long double x )
+double db20( double x )
 {
   if( x < 1.e-20 )
 	return( -999.99 );
 
-  return( 20. * log10l(x) );
+  return( 20. * log10(x) );
 }
 
 /*-----------------------------------------------------------------------*/
 
 /* intrp uses bivariate cubic interpolation to obtain */
 /* the values of 4 functions at the point (x,y). */
-void intrp( long double x, long double y, complex long double *f1,
-	complex long double *f2, complex long double *f3, complex long double *f4 )
+void intrp( double x, double y, complex double *f1,
+	complex double *f2, complex double *f3, complex double *f4 )
 {
   static int ix, iy, ixs=-10, iys=-10, igrs=-10, ixeg=0, iyeg=0;
   static int nxm2, nym2, nxms, nyms, nd, ndp;
   int nda[3]={11,17,9}, ndpa[3]={110,85,72};
-  int igr, iadd, iadz, i, k, jump;
-  static long double dx = 1., dy = 1., xs = 0., ys = 0., xz, yz;
-  long double xx, yy;
-  static complex long double a[4][4], b[4][4], c[4][4], d[4][4];
-  complex long double p1=CPLX_00, p2=CPLX_00, p3=CPLX_00, p4=CPLX_00;
-  complex long double fx1, fx2, fx3, fx4;
+  int jump;
+  static double dx = 1., dy = 1., xs = 0., ys = 0., xz, yz;
+  double xx, yy;
+  static complex double a[4][4], b[4][4], c[4][4], d[4][4];
+  complex double p1=CPLX_00, p2=CPLX_00, p3=CPLX_00, p4=CPLX_00;
+  complex double fx1, fx2, fx3, fx4;
 
   jump = FALSE;
   if( (x < xs) || (y < ys) )
@@ -544,6 +522,7 @@ void intrp( long double x, long double y, complex long double *f1,
 	  (abs(iy- iys) >= 2) ||
 	  jump )
   {
+	int igr, iadd, iadz, i, k;
 	/* determine correct grid and grid region */
 	if( x <= ggrid.xsa[1])
 	  igr=0;
@@ -690,16 +669,16 @@ void intrp( long double x, long double y, complex long double *f1,
 /* intx performs numerical integration of exp(jkr)/r by the method of */
 /* variable interval width romberg integration.  the integrand value */
 /* is supplied by subroutine gf. */
-void intx( long double el1, long double el2, long double b,
-	int ij, long double *sgr, long double *sgi)
+void intx( double el1, double el2, double b,
+	int ij, double *sgr, double *sgi)
 {
   int ns, nt;
   int nx = 1, nma = 65536, nts = 4;
   int flag = TRUE;
-  long double z, s, ze, fnm, ep, zend, fns, dz=0., zp, dzot=0., t00r, g1r, g5r, t00i;
-  long double g1i, g5i, t01r, g3r, t01i, g3i, t10r, t10i, te1i, te1r, t02r;
-  long double g2r, g4r, t02i, g2i, g4i, t11r, t11i, t20r, t20i, te2i, te2r;
-  long double rx = 1.0e-4;
+  double z, s, ze, fnm, ep, zend, fns, dz=0., zp, dzot=0., t00r, g1r, g5r=0.0, t00i;
+  double g1i, g5i=0.0, t01r, g3r=0.0, t01i, g3i=0.0, t10r, t10i, te1i, te1r, t02r;
+  double g2r, g4r, t02i, g2i, g4i, t11r, t11i, t20r, t20i, te2i, te2r;
+  double rx = 1.0e-4;
 
   z= el1;
   ze= el2;
@@ -726,12 +705,12 @@ void intx( long double el1, long double el2, long double b,
 	  if( zp > ze)
 	  {
 		dz= ze- z;
-		if( fabsl(dz) <= ep)
+		if( fabs(dz) <= ep)
 		{
 		  /* add contribution of near singularity for diagonal term */
 		  if(ij == 0)
 		  {
-			*sgr=2.*( *sgr+ logl(( sqrtl( b* b+ s* s)+ s)/ b));
+			*sgr=2.*( *sgr+ log(( sqrt( b* b+ s* s)+ s)/ b));
 			*sgi=2.* *sgi;
 		  }
 		  return;
@@ -768,7 +747,7 @@ void intx( long double el1, long double el2, long double b,
 		/* add contribution of near singularity for diagonal term */
 		if(ij == 0)
 		{
-		  *sgr=2.*( *sgr+ logl(( sqrtl( b* b+ s* s)+ s)/ b));
+		  *sgr=2.*( *sgr+ log(( sqrt( b* b+ s* s)+ s)/ b));
 		  *sgi=2.* *sgi;
 		}
 		return;
@@ -805,7 +784,7 @@ void intx( long double el1, long double el2, long double b,
 	{
 	  nt=0;
 	  if( ns >= nma)
-		fprintf( output_fp, "\n  STEP SIZE LIMITED AT Z= %10.5LF", z );
+		fprintf( output_fp, "\n  STEP SIZE LIMITED AT Z= %10.5f", z );
 	  else
 	  {
 		/* halve step size */
@@ -834,7 +813,7 @@ void intx( long double el1, long double el2, long double b,
 	  /* add contribution of near singularity for diagonal term */
 	  if(ij == 0)
 	  {
-		*sgr=2.*( *sgr+ logl(( sqrtl( b* b+ s* s)+ s)/ b));
+		*sgr=2.*( *sgr+ log(( sqrt( b* b+ s* s)+ s)/ b));
 		*sgi=2.* *sgi;
 	  }
 	  return;
@@ -869,13 +848,13 @@ int min( int a, int b )
 /*-----------------------------------------------------------------------*/
 
 /* test for convergence in numerical integration */
-void test( long double f1r, long double f2r, long double *tr,
-	long double f1i, long double f2i, long double *ti, long double dmin )
+void test( double f1r, double f2r, double *tr,
+	double f1i, double f2i, double *ti, double dmin )
 {
-  long double den;
+  double den;
 
-  den= fabsl( f2r);
-  *tr= fabsl( f2i);
+  den= fabs( f2r);
+  *tr= fabs( f2i);
 
   if( den < *tr)
 	den= *tr;
@@ -889,8 +868,8 @@ void test( long double f1r, long double f2r, long double *tr,
 	return;
   }
 
-  *tr= fabsl(( f1r- f2r)/ den);
-  *ti= fabsl(( f1i- f2i)/ den);
+  *tr= fabs(( f1r- f2r)/ den);
+  *ti= fabs(( f1i- f2i)/ den);
 
   return;
 }
@@ -898,10 +877,10 @@ void test( long double f1r, long double f2r, long double *tr,
 /*-----------------------------------------------------------------------*/
 
 /* compute component of basis function i on segment is. */
-void sbf( int i, int is, long double *aa, long double *bb, long double *cc )
+void sbf( int i, int is, double *aa, double *bb, double *cc )
 {
   int ix, jsno, june, jcox, jcoxx, jend, iend, njun1=0, njun2;
-  long double d, sig, pp, sdh, cdh, sd, omc, aj, pm=0, cd, ap, qp, qm, xxi;
+  double d, sig, pp, sdh, cdh, sd, omc, aj, pm=0, cd, ap, qp, qm, xxi;
 
   *aa=0.;
   *bb=0.;
@@ -913,7 +892,6 @@ void sbf( int i, int is, long double *aa, long double *bb, long double *cc )
 
   jcox= data.icon1[ix];
   if( jcox > PCHCON) jcox= i;
-  jcoxx = jcox-1;
 
   jend=-1;
   iend=-1;
@@ -924,18 +902,18 @@ void sbf( int i, int is, long double *aa, long double *bb, long double *cc )
 	if( jcox != 0 )
 	{
 	  if( jcox < 0 )
-		jcox=- jcox;
+		jcox= -jcox;
 	  else
 	  {
-		sig=- sig;
-		jend=- jend;
+		sig= -sig;
+		jend= -jend;
 	  }
-
 	  jcoxx = jcox-1;
+
 	  jsno++;
 	  d= PI* data.si[jcoxx];
-	  sdh= sinl( d);
-	  cdh= cosl( d);
+	  sdh= sin( d);
+	  cdh= cos( d);
 	  sd=2.* sdh* cdh;
 
 	  if( d <= 0.015)
@@ -946,14 +924,14 @@ void sbf( int i, int is, long double *aa, long double *bb, long double *cc )
 	  else
 		omc=1.- cdh* cdh+ sdh* sdh;
 
-	  aj=1./( logl(1./( PI* data.bi[jcoxx]))-.577215664);
+	  aj=1./( log(1./( PI* data.bi[jcoxx]))-.577215664);
 	  pp -= omc/ sd* aj;
 
 	  if( jcox == is)
 	  {
 		*aa= aj/ sd* sig;
 		*bb= aj/(2.* cdh);
-		*cc=- aj/(2.* sdh)* sig;
+		*cc= -aj/(2.* sdh)* sig;
 		june= iend;
 	  }
 
@@ -979,14 +957,14 @@ void sbf( int i, int is, long double *aa, long double *bb, long double *cc )
 	  } /* if( jcox != i ) */
 	  else
 		if( jcox == is)
-		  *bb=- *bb;
+		  *bb= -*bb;
 
 	  if( iend == 1)
 		break;
 
 	} /* if( jcox != 0 ) */
 
-	pm=- pp;
+	pm= -pp;
 	pp=0.;
 	njun1= jsno;
 
@@ -1002,8 +980,8 @@ void sbf( int i, int is, long double *aa, long double *bb, long double *cc )
 
   njun2= jsno- njun1;
   d= PI* data.si[ix];
-  sdh= sinl( d);
-  cdh= cosl( d);
+  sdh= sin( d);
+  cdh= cos( d);
   sd=2.* sdh* cdh;
   cd= cdh* cdh- sdh* sdh;
 
@@ -1015,7 +993,7 @@ void sbf( int i, int is, long double *aa, long double *bb, long double *cc )
   else
 	omc=1.- cd;
 
-  ap=1./( logl(1./( PI* data.bi[ix])) -.577215664);
+  ap=1./( log(1./( PI* data.bi[ix])) -.577215664);
   aj= ap;
 
   if( njun1 == 0)
@@ -1037,9 +1015,9 @@ void sbf( int i, int is, long double *aa, long double *bb, long double *cc )
 
 	if( june == 1)
 	{
-	  *aa=- *aa* qp;
+	  *aa= -*aa* qp;
 	  *bb=  *bb* qp;
-	  *cc=- *cc* qp;
+	  *cc= -*cc* qp;
 	  if( i != is)
 		return;
 	}
@@ -1090,9 +1068,9 @@ void sbf( int i, int is, long double *aa, long double *bb, long double *cc )
 	}
 	else
 	{
-	  *aa=- *aa* qp;
+	  *aa= -*aa* qp;
 	  *bb= *bb* qp;
-	  *cc=- *cc* qp;
+	  *cc= -*cc* qp;
 	}
 
 	if( i != is)
@@ -1113,8 +1091,8 @@ void sbf( int i, int is, long double *aa, long double *bb, long double *cc )
 void tbf( int i, int icap )
 {
   int ix, jcox, jcoxx, jend, iend, njun1=0, njun2, jsnop, jsnox;
-  long double pp, sdh, cdh, sd, omc, aj, pm=0, cd, ap, qp, qm, xxi;
-  long double d, sig; /*** also global ***/
+  double pp, sdh, cdh, sd, omc, aj, pm=0, cd, ap, qp, qm, xxi;
+  double d, sig; /*** also global ***/
 
   segj.jsno=0;
   pp=0.;
@@ -1132,11 +1110,11 @@ void tbf( int i, int icap )
 	if( jcox != 0 )
 	{
 	  if( jcox < 0 )
-		jcox=- jcox;
+		jcox= -jcox;
 	  else
 	  {
-		sig=- sig;
-		jend=- jend;
+		sig= -sig;
+		jend= -jend;
 	  }
 
 	  jcoxx = jcox-1;
@@ -1144,8 +1122,8 @@ void tbf( int i, int icap )
 	  jsnox = segj.jsno-1;
 	  segj.jco[jsnox]= jcox;
 	  d= PI* data.si[jcoxx];
-	  sdh= sinl( d);
-	  cdh= cosl( d);
+	  sdh= sin( d);
+	  cdh= cos( d);
 	  sd=2.* sdh* cdh;
 
 	  if( d <= 0.015)
@@ -1156,11 +1134,11 @@ void tbf( int i, int icap )
 	  else
 		omc=1.- cdh* cdh+ sdh* sdh;
 
-	  aj=1./( logl(1./( PI* data.bi[jcoxx]))-.577215664);
+	  aj=1./( log(1./( PI* data.bi[jcoxx]))-.577215664);
 	  pp= pp- omc/ sd* aj;
 	  segj.ax[jsnox]= aj/ sd* sig;
 	  segj.bx[jsnox]= aj/(2.* cdh);
-	  segj.cx[jsnox]=- aj/(2.* sdh)* sig;
+	  segj.cx[jsnox]= -aj/(2.* sdh)* sig;
 
 	  if( jcox != i)
 	  {
@@ -1183,14 +1161,14 @@ void tbf( int i, int icap )
 
 	  } /* if( jcox != i) */
 	  else
-		segj.bx[jsnox] =- segj.bx[jsnox];
+		segj.bx[jsnox] = -segj.bx[jsnox];
 
 	  if( iend == 1)
 		break;
 
 	} /* if( jcox != 0 ) */
 
-	pm=- pp;
+	pm= -pp;
 	pp=0.;
 	njun1= segj.jsno;
 
@@ -1208,8 +1186,8 @@ void tbf( int i, int icap )
   jsnop= segj.jsno;
   segj.jco[jsnop]= i;
   d= PI* data.si[ix];
-  sdh= sinl( d);
-  cdh= cosl( d);
+  sdh= sin( d);
+  cdh= cos( d);
   sd=2.* sdh* cdh;
   cd= cdh* cdh- sdh* sdh;
 
@@ -1221,7 +1199,7 @@ void tbf( int i, int icap )
   else
 	omc=1.- cd;
 
-  ap=1./( logl(1./( PI* data.bi[ix]))-.577215664);
+  ap=1./( log(1./( PI* data.bi[ix]))-.577215664);
   aj= ap;
 
   if( njun1 == 0)
@@ -1262,9 +1240,9 @@ void tbf( int i, int icap )
 
 	for( iend = 0; iend < njun2; iend++ )
 	{
-	  segj.ax[iend]=- segj.ax[iend]* qp;
+	  segj.ax[iend]= -segj.ax[iend]* qp;
 	  segj.bx[iend]= segj.bx[iend]* qp;
-	  segj.cx[iend]=- segj.cx[iend]* qp;
+	  segj.cx[iend]= -segj.cx[iend]* qp;
 	}
 
 	segj.jsno= jsnop+1;
@@ -1318,9 +1296,9 @@ void tbf( int i, int icap )
   jend= njun1;
   for( iend = jend; iend < segj.jsno; iend++ )
   {
-	segj.ax[iend]=- segj.ax[iend]* qp;
+	segj.ax[iend]= -segj.ax[iend]* qp;
 	segj.bx[iend]= segj.bx[iend]* qp;
-	segj.cx[iend]=- segj.cx[iend]* qp;
+	segj.cx[iend]= -segj.cx[iend]* qp;
   }
 
   segj.jsno= jsnop+1;
@@ -1337,7 +1315,6 @@ void trio( int j )
   segj.jsno=0;
   jx = j-1;
   jcox= data.icon1[jx];
-  jcoxx = jcox-1;
 
   if( jcox <= PCHCON)
   {
@@ -1348,7 +1325,6 @@ void trio( int j )
   if( (jcox == 0) || (jcox > PCHCON) )
   {
 	jcox= data.icon2[jx];
-	jcoxx = jcox-1;
 
 	if( jcox <= PCHCON)
 	{
@@ -1365,10 +1341,14 @@ void trio( int j )
 	  if( segj.jsno >= segj.maxcon )
 	  {
 		segj.maxcon = segj.jsno +1;
-		mem_realloc( (void *)&segj.jco, segj.maxcon * sizeof(int) );
-		mem_realloc( (void *) &segj.ax, segj.maxcon * sizeof(long double) );
-		mem_realloc( (void *) &segj.bx, segj.maxcon * sizeof(long double) );
-		mem_realloc( (void *) &segj.cx, segj.maxcon * sizeof(long double) );
+		size_t mreq = (size_t)segj.maxcon;
+		mreq *= sizeof(int);
+		mem_realloc( (void *)&segj.jco, mreq );
+		mreq = (size_t)segj.maxcon;
+		mreq *= sizeof(double);
+		mem_realloc( (void *) &segj.ax, mreq );
+		mem_realloc( (void *) &segj.bx, mreq );
+		mem_realloc( (void *) &segj.cx, mreq );
 	  }
 
 	  sbf( j, j, &segj.ax[jsnox], &segj.bx[jsnox], &segj.cx[jsnox]);
@@ -1381,9 +1361,9 @@ void trio( int j )
   do
   {
 	if( jcox < 0 )
-	  jcox=- jcox;
+	  jcox= -jcox;
 	else
-	  jend=- jend;
+	  jend= -jend;
 	jcoxx = jcox-1;
 
 	if( jcox != j)
@@ -1395,10 +1375,14 @@ void trio( int j )
 	  if( segj.jsno >= segj.maxcon )
 	  {
 		segj.maxcon = segj.jsno +1;
-		mem_realloc( (void *)&segj.jco, segj.maxcon * sizeof(int) );
-		mem_realloc( (void *) &segj.ax, segj.maxcon * sizeof(long double) );
-		mem_realloc( (void *) &segj.bx, segj.maxcon * sizeof(long double) );
-		mem_realloc( (void *) &segj.cx, segj.maxcon * sizeof(long double) );
+		size_t mreq = (size_t)segj.maxcon;
+		mreq *= sizeof(int);
+		mem_realloc( (void *)&segj.jco, mreq );
+		mreq = (size_t)segj.maxcon;
+		mreq *= sizeof(double);
+		mem_realloc( (void *) &segj.ax, mreq );
+		mem_realloc( (void *) &segj.bx, mreq );
+		mem_realloc( (void *) &segj.cx, mreq );
 	  }
 
 	  sbf( jcox, j, &segj.ax[jsnox], &segj.bx[jsnox], &segj.cx[jsnox]);
@@ -1440,10 +1424,14 @@ void trio( int j )
   if( segj.jsno >= segj.maxcon )
   {
 	segj.maxcon = segj.jsno +1;
-	mem_realloc( (void *)&segj.jco, segj.maxcon * sizeof(int) );
-	mem_realloc( (void *) &segj.ax, segj.maxcon * sizeof(long double) );
-	mem_realloc( (void *) &segj.bx, segj.maxcon * sizeof(long double) );
-	mem_realloc( (void *) &segj.cx, segj.maxcon * sizeof(long double) );
+	size_t mreq = (size_t)segj.maxcon;
+	mreq *= sizeof(int);
+	mem_realloc( (void *)&segj.jco, mreq );
+	mreq = (size_t)segj.maxcon;
+	mreq *= sizeof(double);
+	mem_realloc( (void *) &segj.ax, mreq );
+	mem_realloc( (void *) &segj.bx, mreq );
+	mem_realloc( (void *) &segj.cx, mreq );
   }
 
   sbf( j, j, &segj.ax[jsnox], &segj.bx[jsnox], &segj.cx[jsnox]);
@@ -1456,39 +1444,38 @@ void trio( int j )
 /*-----------------------------------------------------------------------*/
 
 /* zint computes the internal impedance of a circular wire */
-void zint( long double sigl, long double rolam, complex long double *zint )
+void zint( double sigl, double rolam, complex double *zint )
 {
-#define cc1	( 6.0e-7     + 1.9e-6fj)
-#define cc2	(-3.4e-6     + 5.1e-6fj)
-#define cc3	(-2.52e-5    + 0.fj)
-#define cc4	(-9.06e-5    - 9.01e-5fj)
-#define cc5	( 0.         - 9.765e-4fj)
-#define cc6	(.0110486    - .0110485fj)
-#define cc7	( 0.         - .3926991fj)
-#define cc8	( 1.6e-6     - 3.2e-6fj)
-#define cc9	( 1.17e-5    - 2.4e-6fj)
-#define cc10	( 3.46e-5    + 3.38e-5fj)
-#define cc11	( 5.0e-7     + 2.452e-4fj)
-#define cc12	(-1.3813e-3  + 1.3811e-3fj)
-#define cc13	(-6.25001e-2 - 1.0e-7fj)
-#define cc14	(.7071068    + .7071068fj)
+#define cc1		( 6.0e-7     + I*1.9e-6)
+#define cc2		(-3.4e-6     + I*5.1e-6)
+#define cc3		(-2.52e-5    + I*0.0)
+#define cc4		(-9.06e-5    - I*9.01e-5)
+#define cc5		( 0.         - I*9.765e4)
+#define cc6		(.0110486    - I*0.0110485)
+#define cc7		( 0.         - I*0.3926991)
+#define cc8		( 1.6e-6     - I*3.2e-6)
+#define cc9		( 1.17e-5    - I*2.4e-6)
+#define cc10	( 3.46e-5    + I*3.38e-5)
+#define cc11	( 5.0e-7     + I*2.452e-4)
+#define cc12	(-1.3813e-3  + I*1.3811e-3)
+#define cc13	(-6.25001e-2 - I*1.0e-7)
+#define cc14	(.7071068    + I*0.7071068)
 #define cn	cc14
 
 #define th(d) ( (((((cc1*(d)+cc2)*(d)+cc3)*(d)+cc4)*(d)+cc5)*(d)+cc6)*(d) + cc7 )
 #define ph(d) ( (((((cc8*(d)+cc9)*(d)+cc10)*(d)+cc11)*(d)+cc12)*(d)+cc13)*(d)+cc14 )
-#define f(d)  ( csqrtl(POT/(d))*cexpl(-cn*(d)+th(-8./x)) )
-#define g(d)  ( cexpl(cn*(d)+th(8./x))/csqrtl(TP*(d)) )
+#define f(d)  ( csqrt(POT/(d))*cexp(-cn*(d)+th(-8./x)) )
+#define g(d)  ( cexp(cn*(d)+th(8./x))/csqrt(TP*(d)) )
 
-  long double x, y, s, ber, bei;
-  long double tpcmu = 2.368705e+3;
-  long double cmotp = 60.00;
-  complex long double br1, br2;
+  double x, tpcmu = 2.368705e+3, cmotp = 60.00;
+  complex double br1, br2;
 
-  x= sqrtl( tpcmu* sigl)* rolam;
+  x= sqrt( tpcmu* sigl)* rolam;
   if( x <= 110.)
   {
 	if( x <= 8.)
 	{
+	  double y, s, ber, bei;
 	  y= x/8.;
 	  y= y* y;
 	  s= y* y;
@@ -1509,28 +1496,28 @@ void zint( long double sigl, long double rolam, complex long double *zint )
 
 	  br2= cmplx( ber, bei);
 	  br1= br1/ br2;
-	  *zint= CPLX_01* sqrtl( cmotp/sigl )* br1/ rolam;
+	  *zint= CPLX_01* sqrt( cmotp/sigl )* br1/ rolam;
 
   } /* if( x <= 8.) */
 
-	br2= CPLX_01* f(x)/ PI;
+	br2= I*f(x)/ PI;
 	br1= g( x)+ br2;
 	br2= g( x)* ph(8./ x)- br2* ph(-8./ x);
 	br1= br1/ br2;
-	*zint= CPLX_01* sqrtl( cmotp/ sigl)* br1/ rolam;
+	*zint= CPLX_01* sqrt( cmotp/ sigl)* br1/ rolam;
 
   } /* if( x <= 110.) */
 
   br1= cmplx(.70710678,-.70710678);
-  *zint= CPLX_01* sqrtl( cmotp/ sigl)* br1/ rolam;
+  *zint= CPLX_01* sqrt( cmotp/ sigl)* br1/ rolam;
 }
 
 /*-----------------------------------------------------------------------*/
 
 /* cang returns the phase angle of a complex number in degrees. */
-long double cang( complex long double z )
+double cang( complex double z )
 {
-  return( cargl(z)*TD );
+  return( carg(z)*TD );
 }
 
 /*-----------------------------------------------------------------------*/
diff --git a/compile b/compile
new file mode 100755
index 0000000..531136b
--- /dev/null
+++ b/compile
@@ -0,0 +1,347 @@
+#! /bin/sh
+# Wrapper for compilers which do not understand '-c -o'.
+
+scriptversion=2012-10-14.11; # UTC
+
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Written by Tom Tromey <tromey at cygnus.com>.
+#
+# 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, see <http://www.gnu.org/licenses/>.
+
+# 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.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake at gnu.org> or send patches to
+# <automake-patches at gnu.org>.
+
+nl='
+'
+
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent tools from complaining about whitespace usage.
+IFS=" ""	$nl"
+
+file_conv=
+
+# func_file_conv build_file lazy
+# Convert a $build file to $host form and store it in $file
+# Currently only supports Windows hosts. If the determined conversion
+# type is listed in (the comma separated) LAZY, no conversion will
+# take place.
+func_file_conv ()
+{
+  file=$1
+  case $file in
+    / | /[!/]*) # absolute file, and not a UNC file
+      if test -z "$file_conv"; then
+	# lazily determine how to convert abs files
+	case `uname -s` in
+	  MINGW*)
+	    file_conv=mingw
+	    ;;
+	  CYGWIN*)
+	    file_conv=cygwin
+	    ;;
+	  *)
+	    file_conv=wine
+	    ;;
+	esac
+      fi
+      case $file_conv/,$2, in
+	*,$file_conv,*)
+	  ;;
+	mingw/*)
+	  file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
+	  ;;
+	cygwin/*)
+	  file=`cygpath -m "$file" || echo "$file"`
+	  ;;
+	wine/*)
+	  file=`winepath -w "$file" || echo "$file"`
+	  ;;
+      esac
+      ;;
+  esac
+}
+
+# func_cl_dashL linkdir
+# Make cl look for libraries in LINKDIR
+func_cl_dashL ()
+{
+  func_file_conv "$1"
+  if test -z "$lib_path"; then
+    lib_path=$file
+  else
+    lib_path="$lib_path;$file"
+  fi
+  linker_opts="$linker_opts -LIBPATH:$file"
+}
+
+# func_cl_dashl library
+# Do a library search-path lookup for cl
+func_cl_dashl ()
+{
+  lib=$1
+  found=no
+  save_IFS=$IFS
+  IFS=';'
+  for dir in $lib_path $LIB
+  do
+    IFS=$save_IFS
+    if $shared && test -f "$dir/$lib.dll.lib"; then
+      found=yes
+      lib=$dir/$lib.dll.lib
+      break
+    fi
+    if test -f "$dir/$lib.lib"; then
+      found=yes
+      lib=$dir/$lib.lib
+      break
+    fi
+    if test -f "$dir/lib$lib.a"; then
+      found=yes
+      lib=$dir/lib$lib.a
+      break
+    fi
+  done
+  IFS=$save_IFS
+
+  if test "$found" != yes; then
+    lib=$lib.lib
+  fi
+}
+
+# func_cl_wrapper cl arg...
+# Adjust compile command to suit cl
+func_cl_wrapper ()
+{
+  # Assume a capable shell
+  lib_path=
+  shared=:
+  linker_opts=
+  for arg
+  do
+    if test -n "$eat"; then
+      eat=
+    else
+      case $1 in
+	-o)
+	  # configure might choose to run compile as 'compile cc -o foo foo.c'.
+	  eat=1
+	  case $2 in
+	    *.o | *.[oO][bB][jJ])
+	      func_file_conv "$2"
+	      set x "$@" -Fo"$file"
+	      shift
+	      ;;
+	    *)
+	      func_file_conv "$2"
+	      set x "$@" -Fe"$file"
+	      shift
+	      ;;
+	  esac
+	  ;;
+	-I)
+	  eat=1
+	  func_file_conv "$2" mingw
+	  set x "$@" -I"$file"
+	  shift
+	  ;;
+	-I*)
+	  func_file_conv "${1#-I}" mingw
+	  set x "$@" -I"$file"
+	  shift
+	  ;;
+	-l)
+	  eat=1
+	  func_cl_dashl "$2"
+	  set x "$@" "$lib"
+	  shift
+	  ;;
+	-l*)
+	  func_cl_dashl "${1#-l}"
+	  set x "$@" "$lib"
+	  shift
+	  ;;
+	-L)
+	  eat=1
+	  func_cl_dashL "$2"
+	  ;;
+	-L*)
+	  func_cl_dashL "${1#-L}"
+	  ;;
+	-static)
+	  shared=false
+	  ;;
+	-Wl,*)
+	  arg=${1#-Wl,}
+	  save_ifs="$IFS"; IFS=','
+	  for flag in $arg; do
+	    IFS="$save_ifs"
+	    linker_opts="$linker_opts $flag"
+	  done
+	  IFS="$save_ifs"
+	  ;;
+	-Xlinker)
+	  eat=1
+	  linker_opts="$linker_opts $2"
+	  ;;
+	-*)
+	  set x "$@" "$1"
+	  shift
+	  ;;
+	*.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
+	  func_file_conv "$1"
+	  set x "$@" -Tp"$file"
+	  shift
+	  ;;
+	*.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
+	  func_file_conv "$1" mingw
+	  set x "$@" "$file"
+	  shift
+	  ;;
+	*)
+	  set x "$@" "$1"
+	  shift
+	  ;;
+      esac
+    fi
+    shift
+  done
+  if test -n "$linker_opts"; then
+    linker_opts="-link$linker_opts"
+  fi
+  exec "$@" $linker_opts
+  exit 1
+}
+
+eat=
+
+case $1 in
+  '')
+     echo "$0: No command.  Try '$0 --help' for more information." 1>&2
+     exit 1;
+     ;;
+  -h | --h*)
+    cat <<\EOF
+Usage: compile [--help] [--version] PROGRAM [ARGS]
+
+Wrapper for compilers which do not understand '-c -o'.
+Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
+arguments, and rename the output as expected.
+
+If you are trying to build a whole package this is not the
+right script to run: please start by reading the file 'INSTALL'.
+
+Report bugs to <bug-automake at gnu.org>.
+EOF
+    exit $?
+    ;;
+  -v | --v*)
+    echo "compile $scriptversion"
+    exit $?
+    ;;
+  cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
+    func_cl_wrapper "$@"      # Doesn't return...
+    ;;
+esac
+
+ofile=
+cfile=
+
+for arg
+do
+  if test -n "$eat"; then
+    eat=
+  else
+    case $1 in
+      -o)
+	# configure might choose to run compile as 'compile cc -o foo foo.c'.
+	# So we strip '-o arg' only if arg is an object.
+	eat=1
+	case $2 in
+	  *.o | *.obj)
+	    ofile=$2
+	    ;;
+	  *)
+	    set x "$@" -o "$2"
+	    shift
+	    ;;
+	esac
+	;;
+      *.c)
+	cfile=$1
+	set x "$@" "$1"
+	shift
+	;;
+      *)
+	set x "$@" "$1"
+	shift
+	;;
+    esac
+  fi
+  shift
+done
+
+if test -z "$ofile" || test -z "$cfile"; then
+  # If no '-o' option was seen then we might have been invoked from a
+  # pattern rule where we don't need one.  That is ok -- this is a
+  # normal compilation that the losing compiler can handle.  If no
+  # '.c' file was seen then we are probably linking.  That is also
+  # ok.
+  exec "$@"
+fi
+
+# Name of file we expect compiler to create.
+cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
+
+# Create the lock directory.
+# Note: use '[/\\:.-]' here to ensure that we don't use the same name
+# that we are using for the .o file.  Also, base the name on the expected
+# object file name, since that is what matters with a parallel build.
+lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
+while true; do
+  if mkdir "$lockdir" >/dev/null 2>&1; then
+    break
+  fi
+  sleep 1
+done
+# FIXME: race condition here if user kills between mkdir and trap.
+trap "rmdir '$lockdir'; exit 1" 1 2 15
+
+# Run the compile.
+"$@"
+ret=$?
+
+if test -f "$cofile"; then
+  test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
+elif test -f "${cofile}bj"; then
+  test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
+fi
+
+rmdir "$lockdir"
+exit $ret
+
+# 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-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/config.h.in b/config.h.in
new file mode 100644
index 0000000..8ff53b7
--- /dev/null
+++ b/config.h.in
@@ -0,0 +1,87 @@
+/* config.h.in.  Generated from configure.ac by autoheader.  */
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#undef HAVE_FCNTL_H
+
+/* Define to 1 if you have the `floor' function. */
+#undef HAVE_FLOOR
+
+/* 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 home page for this package. */
+#undef PACKAGE_URL
+
+/* 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/configure b/configure
new file mode 100755
index 0000000..2512103
--- /dev/null
+++ b/configure
@@ -0,0 +1,6445 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.69 for nec2c 1.3.
+#
+# Report bugs to <nkcyham at yahoo.com>.
+#
+#
+# Copyright (C) 1992-1996, 1998-2012 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
+
+
+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
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='print -r --'
+  as_echo_n='print -rn --'
+elif (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
+
+
+# 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.
+as_myself=
+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
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there.  '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+# Use a proper internal environment variable to ensure we don't fall
+  # into an infinite loop, continuously re-executing ourselves.
+  if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
+    _as_can_reexec=no; export _as_can_reexec;
+    # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+  *v*x* | *x*v* ) as_opts=-vx ;;
+  *v* ) as_opts=-v ;;
+  *x* ) as_opts=-x ;;
+  * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+as_fn_exit 255
+  fi
+  # We don't want this to propagate to other subprocesses.
+          { _as_can_reexec=; unset _as_can_reexec;}
+if test "x$CONFIG_SHELL" = x; then
+  as_bourne_compatible="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_required="as_fn_return () { (exit \$1); }
+as_fn_success () { as_fn_return 0; }
+as_fn_failure () { as_fn_return 1; }
+as_fn_ret_success () { return 0; }
+as_fn_ret_failure () { return 1; }
+
+exitcode=0
+as_fn_success || { exitcode=1; echo as_fn_success failed.; }
+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
+
+else
+  exitcode=1; echo positional parameters were not saved.
+fi
+test x\$exitcode = x0 || exit 1
+test -x / || exit 1"
+  as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
+  as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
+  eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
+  test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
+test \$(( 1 + 1 )) = 2 || exit 1"
+  if (eval "$as_required") 2>/dev/null; then :
+  as_have_required=yes
+else
+  as_have_required=no
+fi
+  if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
+
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  as_found=:
+  case $as_dir in #(
+	 /*)
+	   for as_base in sh bash ksh sh5; do
+	     # Try only shells that exist, to save several forks.
+	     as_shell=$as_dir/$as_base
+	     if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+		    { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+  CONFIG_SHELL=$as_shell as_have_required=yes
+		   if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+  break 2
+fi
+fi
+	   done;;
+       esac
+  as_found=false
+done
+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+	      { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
+  CONFIG_SHELL=$SHELL as_have_required=yes
+fi; }
+IFS=$as_save_IFS
+
+
+      if test "x$CONFIG_SHELL" != x; then :
+  export CONFIG_SHELL
+             # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+  *v*x* | *x*v* ) as_opts=-vx ;;
+  *v* ) as_opts=-v ;;
+  *x* ) as_opts=-x ;;
+  * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+exit 255
+fi
+
+    if test x$as_have_required = xno; then :
+  $as_echo "$0: This script requires a shell more modern than all"
+  $as_echo "$0: the shells that I found on your system."
+  if test x${ZSH_VERSION+set} = xset ; then
+    $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+    $as_echo "$0: be upgraded to zsh 4.3.4 or later."
+  else
+    $as_echo "$0: Please tell bug-autoconf at gnu.org and nkcyham at yahoo.com
+$0: about your system, including any error possibly output
+$0: before this message. Then install a modern shell, or
+$0: manually run the script under such a shell if you do
+$0: have one."
+  fi
+  exit 1
+fi
+fi
+fi
+SHELL=${CONFIG_SHELL-/bin/sh}
+export SHELL
+# Unset more variables known to interfere with behavior of common tools.
+CLICOLOR_FORCE= GREP_OPTIONS=
+unset CLICOLOR_FORCE GREP_OPTIONS
+
+## --------------------- ##
+## M4sh Shell Functions. ##
+## --------------------- ##
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+  { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || eval $as_mkdir_p || {
+    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_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+  test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+  eval 'as_fn_append ()
+  {
+    eval $1+=\$2
+  }'
+else
+  as_fn_append ()
+  {
+    eval $1=\$$1\$2
+  }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+  eval 'as_fn_arith ()
+  {
+    as_val=$(( $* ))
+  }'
+else
+  as_fn_arith ()
+  {
+    as_val=`expr "$@" || test $? -eq 1`
+  }
+fi # as_fn_arith
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+  as_status=$1; test $as_status -eq 0 && as_status=1
+  if test "$4"; then
+    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+  fi
+  $as_echo "$as_me: error: $2" >&2
+  as_fn_exit $as_status
+} # as_fn_error
+
+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
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+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'`
+
+# 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_lineno_1=$LINENO as_lineno_1a=$LINENO
+  as_lineno_2=$LINENO as_lineno_2a=$LINENO
+  eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+  test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+  # 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; as_fn_exit 1; }
+
+  # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
+  # already done that, so ensure we don't try to do so again and fall
+  # in an infinite loop.  This has already happened in practice.
+  _as_can_reexec=no; export _as_can_reexec
+  # 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
+}
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+  case `echo 'xy\c'` in
+  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
+  xy)  ECHO_C='\c';;
+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
+       ECHO_T='	';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+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 -pR'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -pR'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -pR'
+  fi
+else
+  as_ln_s='cp -pR'
+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='mkdir -p "$as_dir"'
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
+
+# 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'"
+
+
+test -n "$DJDIR" || exec 7<&0 </dev/null
+exec 6>&1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, old GNU/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=
+
+# Identity of this package.
+PACKAGE_NAME='nec2c'
+PACKAGE_TARNAME='nec2c'
+PACKAGE_VERSION='1.3'
+PACKAGE_STRING='nec2c 1.3'
+PACKAGE_BUGREPORT='nkcyham at yahoo.com'
+PACKAGE_URL=''
+
+ac_unique_file="main.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='am__EXEEXT_FALSE
+am__EXEEXT_TRUE
+LTLIBOBJS
+LIBOBJS
+EGREP
+GREP
+CPP
+PACKAGE_LIBS
+PACKAGE_CFLAGS
+am__fastdepCC_FALSE
+am__fastdepCC_TRUE
+CCDEPMODE
+ac_ct_CC
+CFLAGS
+CC
+am__fastdepCXX_FALSE
+am__fastdepCXX_TRUE
+CXXDEPMODE
+am__nodep
+AMDEPBACKSLASH
+AMDEP_FALSE
+AMDEP_TRUE
+am__quote
+am__include
+DEPDIR
+OBJEXT
+EXEEXT
+ac_ct_CXX
+CPPFLAGS
+LDFLAGS
+CXXFLAGS
+CXX
+MAINT
+MAINTAINER_MODE_FALSE
+MAINTAINER_MODE_TRUE
+AM_BACKSLASH
+AM_DEFAULT_VERBOSITY
+AM_DEFAULT_V
+AM_V
+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_URL
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
+ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+enable_silent_rules
+enable_maintainer_mode
+enable_dependency_tracking
+'
+      ac_precious_vars='build_alias
+host_alias
+target_alias
+CXX
+CXXFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CCC
+CC
+CFLAGS
+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= ;;
+  *)    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_fn_error $? "invalid feature name: $ac_useropt"
+    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_fn_error $? "invalid feature name: $ac_useropt"
+    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_fn_error $? "invalid package name: $ac_useropt"
+    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_fn_error $? "invalid package name: $ac_useropt"
+    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_fn_error $? "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information"
+    ;;
+
+  *=*)
+    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+    # Reject names that are not valid shell variable names.
+    case $ac_envvar in #(
+      '' | [0-9]* | *[!_$as_cr_alnum]* )
+      as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
+    esac
+    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_fn_error $? "missing argument to $ac_option"
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+  case $enable_option_checking in
+    no) ;;
+    fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
+    *)     $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_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
+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
+  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_fn_error $? "working directory cannot be determined"
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+  as_fn_error $? "pwd does not report name of working directory"
+
+
+# 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_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+	cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
+	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 nec2c 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/nec2c]
+  --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 nec2c 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]
+  --enable-silent-rules   less verbose build output (undo: "make V=1")
+  --disable-silent-rules  verbose build output (undo: "make V=0")
+  --enable-maintainer-mode
+                          enable make rules and dependencies not useful (and
+                          sometimes confusing) to the casual installer
+  --enable-dependency-tracking
+                          do not reject slow dependency extractors
+  --disable-dependency-tracking
+                          speeds up one-time build
+
+Some influential environment variables:
+  CXX         C++ compiler command
+  CXXFLAGS    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    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
+              you have headers in a nonstandard directory <include dir>
+  CC          C compiler command
+  CFLAGS      C compiler flags
+  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 <nkcyham at yahoo.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
+nec2c configure 1.3
+generated by GNU Autoconf 2.69
+
+Copyright (C) 2012 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
+
+## ------------------------ ##
+## Autoconf initialization. ##
+## ------------------------ ##
+
+# ac_fn_cxx_try_compile LINENO
+# ----------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_cxx_try_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  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:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_retval=1
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_cxx_try_compile
+
+# ac_fn_c_try_compile LINENO
+# --------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  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:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_retval=1
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_compile
+
+# ac_fn_c_try_link LINENO
+# -----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_link ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  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:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 test -x conftest$ac_exeext
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_retval=1
+fi
+  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+  # interfere with the next link command; also delete a directory that is
+  # left behind by Apple's compiler.  We do this before executing the actions.
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_link
+
+# ac_fn_c_try_cpp LINENO
+# ----------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_cpp ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  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:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } > conftest.i && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+    ac_retval=1
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_cpp
+
+# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists, giving a warning if it cannot be compiled using
+# the include files in INCLUDES and setting the cache variable VAR
+# accordingly.
+ac_fn_c_check_header_mongrel ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if eval \${$3+:} false; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
+$as_echo_n "checking $2 usability... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_header_compiler=yes
+else
+  ac_header_compiler=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
+$as_echo_n "checking $2 presence... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <$2>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  ac_header_preproc=yes
+else
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+    ;;
+  no:yes:* )
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $2:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+( $as_echo "## -------------------------------- ##
+## Report this to nkcyham at yahoo.com ##
+## -------------------------------- ##"
+     ) | sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  eval "$3=\$ac_header_compiler"
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_mongrel
+
+# ac_fn_c_try_run LINENO
+# ----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
+# that executables *can* be run.
+ac_fn_c_try_run ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  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:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && { 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:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  ac_retval=0
+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
+
+       ac_retval=$ac_status
+fi
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_run
+
+# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists and can be compiled using the include files in
+# INCLUDES, setting the cache variable VAR accordingly.
+ac_fn_c_check_header_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_compile
+
+# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
+# -------------------------------------------
+# Tests whether TYPE exists after having included INCLUDES, setting cache
+# variable VAR accordingly.
+ac_fn_c_check_type ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  eval "$3=no"
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+if (sizeof ($2))
+	 return 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+if (sizeof (($2)))
+	    return 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+  eval "$3=yes"
+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
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_type
+
+# ac_fn_c_check_func LINENO FUNC VAR
+# ----------------------------------
+# Tests whether FUNC exists, setting the cache variable VAR accordingly
+ac_fn_c_check_func ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $2 innocuous_$2
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $2 (); 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 $2
+
+/* 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 $2 ();
+/* 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_$2 || defined __stub___$2
+choke me
+#endif
+
+int
+main ()
+{
+return $2 ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_func
+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 nec2c $as_me 1.3, which was
+generated by GNU Autoconf 2.69.  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) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
+    2)
+      as_fn_append 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
+      as_fn_append ac_configure_args " '$ac_arg'"
+      ;;
+    esac
+  done
+done
+{ ac_configure_args0=; unset ac_configure_args0;}
+{ ac_configure_args1=; unset 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
+
+    $as_echo "## ---------------- ##
+## Cache variables. ##
+## ---------------- ##"
+    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:${as_lineno-$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= ;; #(
+      *) { eval $ac_var=; 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
+
+    $as_echo "## ----------------- ##
+## Output variables. ##
+## ----------------- ##"
+    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
+      $as_echo "## ------------------- ##
+## File substitutions. ##
+## ------------------- ##"
+      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
+      $as_echo "## ----------- ##
+## confdefs.h. ##
+## ----------- ##"
+      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'; as_fn_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
+
+$as_echo "/* confdefs.h */" > 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
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_URL "$PACKAGE_URL"
+_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
+  # We do not want a PATH search for config.site.
+  case $CONFIG_SITE in #((
+    -*)  ac_site_file1=./$CONFIG_SITE;;
+    */*) ac_site_file1=$CONFIG_SITE;;
+    *)   ac_site_file1=./$CONFIG_SITE;;
+  esac
+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 /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
+    { $as_echo "$as_me:${as_lineno-$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" \
+      || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "failed to load site script $ac_site_file
+See \`config.log' for more details" "$LINENO" 5; }
+  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.  DJGPP emulates it as a regular file.
+  if test /dev/null != "$cache_file" && test -f "$cache_file"; then
+    { $as_echo "$as_me:${as_lineno-$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:${as_lineno-$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:${as_lineno-$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:${as_lineno-$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:${as_lineno-$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:${as_lineno-$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:${as_lineno-$LINENO}:   former value:  \`$ac_old_val'" >&5
+$as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
+	{ $as_echo "$as_me:${as_lineno-$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.
+      *) as_fn_append ac_configure_args " '$ac_arg'" ;;
+    esac
+  fi
+done
+if $ac_cache_corrupted; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+  { $as_echo "$as_me:${as_lineno-$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_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+fi
+## -------------------- ##
+## Main body of script. ##
+## -------------------- ##
+
+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
+
+
+am__api_version='1.14'
+
+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_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
+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:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if ${ac_cv_path_install+:} false; 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 as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+	  if test $ac_prog = install &&
+	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # AIX install.  It has an incompatible calling convention.
+	    :
+	  elif test $ac_prog = install &&
+	    grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # program-specific install script used by HP pwplus--don't use.
+	    :
+	  else
+	    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:${as_lineno-$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:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
+$as_echo_n "checking whether build environment is sane... " >&6; }
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name.  Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+  *[\\\"\#\$\&\'\`$am_lf]*)
+    as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
+esac
+case $srcdir in
+  *[\\\"\#\$\&\'\`$am_lf\ \	]*)
+    as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;;
+esac
+
+# 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 (
+   am_has_slept=no
+   for am_try in 1 2; do
+     echo "timestamp, slept: $am_has_slept" > conftest.file
+     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
+     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_fn_error $? "ls -t appears to fail.  Make sure there is not a broken
+  alias in your environment" "$LINENO" 5
+     fi
+     if test "$2" = conftest.file || test $am_try -eq 2; then
+       break
+     fi
+     # Just in case.
+     sleep 1
+     am_has_slept=yes
+   done
+   test "$2" = conftest.file
+   )
+then
+   # Ok.
+   :
+else
+   as_fn_error $? "newly created file is older than distributed files!
+Check your system clock" "$LINENO" 5
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+# If we didn't sleep, we still need to ensure time stamps of config.status and
+# generated files are strictly newer.
+am_sleep_pid=
+if grep 'slept: no' conftest.file >/dev/null 2>&1; then
+  ( sleep 1 ) &
+  am_sleep_pid=$!
+fi
+
+rm -f conftest.file
+
+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`
+
+if test x"${MISSING+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\	*)
+    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+  *)
+    MISSING="\${SHELL} $am_aux_dir/missing" ;;
+  esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --is-lightweight"; then
+  am_missing_run="$MISSING "
+else
+  am_missing_run=
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
+fi
+
+if test x"${install_sh}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\	*)
+    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+  *)
+    install_sh="\${SHELL} $am_aux_dir/install-sh"
+  esac
+fi
+
+# 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:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_STRIP+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_STRIP+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$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:${as_lineno-$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"
+
+{ $as_echo "$as_me:${as_lineno-$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 ${ac_cv_path_mkdir+:} false; 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
+	   as_fn_executable_p "$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
+
+  test -d ./--version && rmdir ./--version
+  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.
+    MKDIR_P="$ac_install_sh -d"
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
+$as_echo "$MKDIR_P" >&6; }
+
+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:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AWK+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_AWK="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$AWK" && break
+done
+
+{ $as_echo "$as_me:${as_lineno-$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 eval \${ac_cv_prog_make_${ac_make}_set+:} false; 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:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+  SET_MAKE=
+else
+  { $as_echo "$as_me:${as_lineno-$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
+
+# Check whether --enable-silent-rules was given.
+if test "${enable_silent_rules+set}" = set; then :
+  enableval=$enable_silent_rules;
+fi
+
+case $enable_silent_rules in # (((
+  yes) AM_DEFAULT_VERBOSITY=0;;
+   no) AM_DEFAULT_VERBOSITY=1;;
+    *) AM_DEFAULT_VERBOSITY=1;;
+esac
+am_make=${MAKE-make}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
+$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
+if ${am_cv_make_support_nested_variables+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if $as_echo 'TRUE=$(BAR$(V))
+BAR0=false
+BAR1=true
+V=1
+am__doit:
+	@$(TRUE)
+.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
+  am_cv_make_support_nested_variables=yes
+else
+  am_cv_make_support_nested_variables=no
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
+$as_echo "$am_cv_make_support_nested_variables" >&6; }
+if test $am_cv_make_support_nested_variables = yes; then
+    AM_V='$(V)'
+  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
+else
+  AM_V=$AM_DEFAULT_VERBOSITY
+  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
+fi
+AM_BACKSLASH='\'
+
+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_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
+  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='nec2c'
+ VERSION='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"}
+
+# For better backward compatibility.  To be removed once Automake 1.9.x
+# dies out for good.  For more background, see:
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+mkdir_p='$(MKDIR_P)'
+
+# We need awk for the "check" target.  The system "awk" is bad on
+# some platforms.
+# Always define AMTAR for backward compatibility.  Yes, it's still used
+# in the wild :-(  We should find a proper way to deprecate it ...
+AMTAR='$${TAR-tar}'
+
+
+# We'll loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar  pax cpio none'
+
+am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
+
+
+
+
+
+
+# POSIX will say in a future version that running "rm -f" with no argument
+# is OK; and we want to be able to make that assumption in our Makefile
+# recipes.  So use an aggressive probe to check that the usage we want is
+# actually supported "in the wild" to an acceptable degree.
+# See automake bug#10828.
+# To make any issue more visible, cause the running configure to be aborted
+# by default if the 'rm' program in use doesn't match our expectations; the
+# user can still override this though.
+if rm -f && rm -fr && rm -rf; then : OK; else
+  cat >&2 <<'END'
+Oops!
+
+Your 'rm' program seems unable to run without file operands specified
+on the command line, even when the '-f' option is present.  This is contrary
+to the behaviour of most rm programs out there, and not conforming with
+the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
+
+Please tell bug-automake at gnu.org about your system, including the value
+of your $PATH and any error possibly output before this message.  This
+can help us improve future automake versions.
+
+END
+  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
+    echo 'Configuration will proceed anyway, since you have set the' >&2
+    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
+    echo >&2
+  else
+    cat >&2 <<'END'
+Aborting the configuration process, to ensure you take notice of the issue.
+
+You can download and install GNU coreutils to get an 'rm' implementation
+that behaves properly: <http://www.gnu.org/software/coreutils/>.
+
+If you want to complete the configuration process using your problematic
+'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
+to "yes", and re-run configure.
+
+END
+    as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5
+  fi
+fi
+
+ac_config_headers="$ac_config_headers config.h"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
+$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
+    # Check whether --enable-maintainer-mode was given.
+if test "${enable_maintainer_mode+set}" = set; then :
+  enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
+else
+  USE_MAINTAINER_MODE=no
+fi
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5
+$as_echo "$USE_MAINTAINER_MODE" >&6; }
+   if test $USE_MAINTAINER_MODE = yes; then
+  MAINTAINER_MODE_TRUE=
+  MAINTAINER_MODE_FALSE='#'
+else
+  MAINTAINER_MODE_TRUE='#'
+  MAINTAINER_MODE_FALSE=
+fi
+
+  MAINT=$MAINTAINER_MODE_TRUE
+
+
+
+# Set CFLAGS if not set in environment
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether configure should try to set CFLAGS" >&5
+$as_echo_n "checking whether configure should try to set CFLAGS... " >&6; }
+if test "x${CFLAGS+set}" = xset; then
+   enable_cflags_setting=no
+else
+   enable_cflags_setting=yes
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_cflags_setting" >&5
+$as_echo "$enable_cflags_setting" >&6; }
+test "x$enable_cflags_setting" = xyes && CFLAGS="-Wall -O2"
+
+# Checks for programs.
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+if test -z "$CXX"; then
+  if test -n "$CCC"; then
+    CXX=$CCC
+  else
+    if test -n "$ac_tool_prefix"; then
+  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
+  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:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CXX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CXX"; then
+  ac_cv_prog_CXX="$CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CXX=$ac_cv_prog_CXX
+if test -n "$CXX"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5
+$as_echo "$CXX" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$CXX" && break
+  done
+fi
+if test -z "$CXX"; then
+  ac_ct_CXX=$CXX
+  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
+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:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CXX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CXX"; then
+  ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CXX="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
+if test -n "$ac_ct_CXX"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5
+$as_echo "$ac_ct_CXX" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CXX" && break
+done
+
+  if test "x$ac_ct_CXX" = x; then
+    CXX="g++"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$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
+    CXX=$ac_ct_CXX
+  fi
+fi
+
+  fi
+fi
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+  { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    sed '10a\
+... rest of stderr output deleted ...
+         10q' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+  fi
+  rm -f conftest.er1 conftest.err
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+done
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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:${as_lineno-$LINENO}: checking whether the C++ compiler works" >&5
+$as_echo_n "checking whether the C++ compiler works... " >&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:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link_default") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; 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
+if test -z "$ac_file"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "C++ compiler cannot create executables
+See \`config.log' for more details" "$LINENO" 5; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler default output file name" >&5
+$as_echo_n "checking for C++ compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+ac_exeext=$ac_cv_exeext
+
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; 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:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest conftest$ac_cv_exeext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdio.h>
+int
+main ()
+{
+FILE *f = fopen ("conftest.out", "w");
+ return ferror (f) || fclose (f) != 0;
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files="$ac_clean_files conftest.out"
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+if test "$cross_compiling" != yes; then
+  { { 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:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+  if { ac_try='./conftest$ac_cv_exeext'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then
+    cross_compiling=no
+  else
+    if test "$cross_compiling" = maybe; then
+	cross_compiling=yes
+    else
+	{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run C++ compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details" "$LINENO" 5; }
+    fi
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if ${ac_cv_objext+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; 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:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ $as_echo "$as_me:${as_lineno-$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 ${ac_cv_cxx_compiler_gnu+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  ac_compiler_gnu=yes
+else
+  ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5
+$as_echo "$ac_cv_cxx_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GXX=yes
+else
+  GXX=
+fi
+ac_test_CXXFLAGS=${CXXFLAGS+set}
+ac_save_CXXFLAGS=$CXXFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5
+$as_echo_n "checking whether $CXX accepts -g... " >&6; }
+if ${ac_cv_prog_cxx_g+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_save_cxx_werror_flag=$ac_cxx_werror_flag
+   ac_cxx_werror_flag=yes
+   ac_cv_prog_cxx_g=no
+   CXXFLAGS="-g"
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  ac_cv_prog_cxx_g=yes
+else
+  CXXFLAGS=""
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+
+else
+  ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+	 CXXFLAGS="-g"
+	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  ac_cv_prog_cxx_g=yes
+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_cxx_werror_flag=$ac_save_cxx_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5
+$as_echo "$ac_cv_prog_cxx_g" >&6; }
+if test "$ac_test_CXXFLAGS" = set; then
+  CXXFLAGS=$ac_save_CXXFLAGS
+elif test $ac_cv_prog_cxx_g = yes; then
+  if test "$GXX" = yes; then
+    CXXFLAGS="-g -O2"
+  else
+    CXXFLAGS="-g"
+  fi
+else
+  if test "$GXX" = yes; then
+    CXXFLAGS="-O2"
+  else
+    CXXFLAGS=
+  fi
+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
+DEPDIR="${am__leading_dot}deps"
+
+ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+	@echo this is the am__doit target
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+{ $as_echo "$as_me:${as_lineno-$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
+# Ignore all kinds of additional output from 'make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+  am__include=include
+  am__quote=
+  _am_result=GNU
+  ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   case `$am_make -s -f confmf 2> /dev/null` in #(
+   *the\ am__doit\ target*)
+     am__include=.include
+     am__quote="\""
+     _am_result=BSD
+     ;;
+   esac
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$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='\'
+  am__nodep='_no'
+fi
+ if test "x$enable_dependency_tracking" != xno; then
+  AMDEP_TRUE=
+  AMDEP_FALSE='#'
+else
+  AMDEP_TRUE='#'
+  AMDEP_FALSE=
+fi
+
+
+
+depcc="$CXX"  am_compiler_list=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if ${am_cv_CXX_dependencies_compiler_type+:} false; 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".
+  rm -rf conftest.dir
+  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_CXX_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+  fi
+  am__universal=false
+  case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac
+
+  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 10 /bin/sh.
+      echo '/* dummy */' > sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    # 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.  Also, some Intel
+    # versions had trouble with output in subdirs.
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    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
+      ;;
+    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+      # This compiler won't grok '-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj 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 $am__obj 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_CXX_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_CXX_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; }
+CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
+
+ if
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
+  am__fastdepCXX_TRUE=
+  am__fastdepCXX_FALSE='#'
+else
+  am__fastdepCXX_TRUE='#'
+  am__fastdepCXX_FALSE=
+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
+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:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CC="gcc"
+    $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$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:${as_lineno-$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:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CC="${ac_tool_prefix}cc"
+    $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+       ac_prog_rejected=yes
+       continue
+     fi
+    ac_cv_prog_CC="cc"
+    $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CC="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$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:${as_lineno-$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:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+  { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    sed '10a\
+... rest of stderr output deleted ...
+         10q' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+  fi
+  rm -f conftest.er1 conftest.err
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+done
+
+{ $as_echo "$as_me:${as_lineno-$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 ${ac_cv_c_compiler_gnu+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_compiler_gnu=yes
+else
+  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:${as_lineno-$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:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if ${ac_cv_prog_cc_g+:} false; 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 confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=yes
+else
+  CFLAGS=""
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+  ac_c_werror_flag=$ac_save_c_werror_flag
+	 CFLAGS="-g"
+	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=yes
+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:${as_lineno-$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:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if ${ac_cv_prog_cc_c89+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdio.h>
+struct stat;
+/* 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"
+  if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_c89=$ac_arg
+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:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c89"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+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_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:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5
+$as_echo_n "checking whether $CC understands -c and -o together... " >&6; }
+if ${am_cv_prog_cc_c_o+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+  # Make sure it works both with $CC and with simple cc.
+  # Following AC_PROG_CC_C_O, we do the test twice because some
+  # compilers refuse to overwrite an existing .o file with -o,
+  # though they will create one.
+  am_cv_prog_cc_c_o=yes
+  for am_i in 1 2; do
+    if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5
+   ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } \
+         && test -f conftest2.$ac_objext; then
+      : OK
+    else
+      am_cv_prog_cc_c_o=no
+      break
+    fi
+  done
+  rm -f core conftest*
+  unset am_i
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5
+$as_echo "$am_cv_prog_cc_c_o" >&6; }
+if test "$am_cv_prog_cc_c_o" != yes; then
+   # Losing compiler, so override with the script.
+   # FIXME: It is wrong to rewrite CC.
+   # But if we don't then we get into trouble of one sort or another.
+   # A longer-term fix would be to have automake use am__CC in this case,
+   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+   CC="$am_aux_dir/compile $CC"
+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
+
+
+depcc="$CC"   am_compiler_list=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if ${am_cv_CC_dependencies_compiler_type+:} false; 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".
+  rm -rf conftest.dir
+  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
+  am__universal=false
+  case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac
+
+  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 10 /bin/sh.
+      echo '/* dummy */' > sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    # 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.  Also, some Intel
+    # versions had trouble with output in subdirs.
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    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
+      ;;
+    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+      # This compiler won't grok '-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj 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 $am__obj 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:${as_lineno-$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:${as_lineno-$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 eval \${ac_cv_prog_make_${ac_make}_set+:} false; 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:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+  SET_MAKE=
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+  SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+
+# Checks for libraries.
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sin in -lm" >&5
+$as_echo_n "checking for sin in -lm... " >&6; }
+if ${ac_cv_lib_m_sin+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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 sin ();
+int
+main ()
+{
+return sin ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_sin=yes
+else
+  ac_cv_lib_m_sin=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_sin" >&5
+$as_echo "$ac_cv_lib_m_sin" >&6; }
+if test "x$ac_cv_lib_m_sin" = xyes; 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:${as_lineno-$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 ${ac_cv_prog_CPP+:} false; 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 confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  # Broken: success on invalid input.
+continue
+else
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i 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:${as_lineno-$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 confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  # Broken: success on invalid input.
+continue
+else
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
+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:${as_lineno-$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 ${ac_cv_path_GREP+:} false; 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"
+      as_fn_executable_p "$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
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    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_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if ${ac_cv_path_EGREP+:} false; 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"
+      as_fn_executable_p "$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
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    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_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_EGREP=$EGREP
+fi
+
+   fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if ${ac_cv_header_stdc+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_header_stdc=yes
+else
+  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 confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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 confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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 confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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
+if ac_fn_c_try_run "$LINENO"; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
+
+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`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+for ac_header in fcntl.h stdlib.h string.h unistd.h
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = 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.
+ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
+if test "x$ac_cv_type_size_t" = xyes; then :
+
+else
+
+cat >>confdefs.h <<_ACEOF
+#define size_t unsigned int
+_ACEOF
+
+fi
+
+
+# Checks for library functions.
+for ac_header in stdlib.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default"
+if test "x$ac_cv_header_stdlib_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_STDLIB_H 1
+_ACEOF
+
+fi
+
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5
+$as_echo_n "checking for GNU libc compatible malloc... " >&6; }
+if ${ac_cv_func_malloc_0_nonnull+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test "$cross_compiling" = yes; then :
+  ac_cv_func_malloc_0_nonnull=no
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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
+if ac_fn_c_try_run "$LINENO"; then :
+  ac_cv_func_malloc_0_nonnull=yes
+else
+  ac_cv_func_malloc_0_nonnull=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$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 :
+
+$as_echo "#define HAVE_MALLOC 1" >>confdefs.h
+
+else
+  $as_echo "#define HAVE_MALLOC 0" >>confdefs.h
+
+   case " $LIBOBJS " in
+  *" malloc.$ac_objext "* ) ;;
+  *) LIBOBJS="$LIBOBJS malloc.$ac_objext"
+ ;;
+esac
+
+
+$as_echo "#define malloc rpl_malloc" >>confdefs.h
+
+fi
+
+
+for ac_header in stdlib.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default"
+if test "x$ac_cv_header_stdlib_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_STDLIB_H 1
+_ACEOF
+
+fi
+
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible realloc" >&5
+$as_echo_n "checking for GNU libc compatible realloc... " >&6; }
+if ${ac_cv_func_realloc_0_nonnull+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test "$cross_compiling" = yes; then :
+  ac_cv_func_realloc_0_nonnull=no
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* 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
+if ac_fn_c_try_run "$LINENO"; then :
+  ac_cv_func_realloc_0_nonnull=yes
+else
+  ac_cv_func_realloc_0_nonnull=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$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 :
+
+$as_echo "#define HAVE_REALLOC 1" >>confdefs.h
+
+else
+  $as_echo "#define HAVE_REALLOC 0" >>confdefs.h
+
+   case " $LIBOBJS " in
+  *" realloc.$ac_objext "* ) ;;
+  *) LIBOBJS="$LIBOBJS realloc.$ac_objext"
+ ;;
+esac
+
+
+$as_echo "#define realloc rpl_realloc" >>confdefs.h
+
+fi
+
+
+for ac_func in floor pow sqrt
+do :
+  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = 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"
+
+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:${as_lineno-$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= ;; #(
+      *) { eval $ac_var=; 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
+    if test "x$cache_file" != "x/dev/null"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+      if test ! -f "$cache_file" || test -h "$cache_file"; then
+	cat confcache >"$cache_file"
+      else
+        case $cache_file in #(
+        */* | ?:*)
+	  mv -f confcache "$cache_file"$$ &&
+	  mv -f "$cache_file"$$ "$cache_file" ;; #(
+        *)
+	  mv -f confcache "$cache_file" ;;
+	esac
+      fi
+    fi
+  else
+    { $as_echo "$as_me:${as_lineno-$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=
+U=
+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.
+  as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+  as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5
+$as_echo_n "checking that generated files are newer than configure... " >&6; }
+   if test -n "$am_sleep_pid"; then
+     # Hide warnings about reused PIDs.
+     wait $am_sleep_pid 2>/dev/null
+   fi
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
+$as_echo "done" >&6; }
+ if test -n "$EXEEXT"; then
+  am__EXEEXT_TRUE=
+  am__EXEEXT_FALSE='#'
+else
+  am__EXEEXT_TRUE='#'
+  am__EXEEXT_FALSE=
+fi
+
+if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
+  as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+  as_fn_error $? "conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
+  as_fn_error $? "conditional \"am__fastdepCXX\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+  as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+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:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+as_write_fail=0
+cat >$CONFIG_STATUS <<_ASEOF || as_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}
+export SHELL
+_ASEOF
+cat >>$CONFIG_STATUS <<\_ASEOF || as_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
+
+
+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
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='print -r --'
+  as_echo_n='print -rn --'
+elif (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
+
+
+# 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.
+as_myself=
+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
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there.  '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+  as_status=$1; test $as_status -eq 0 && as_status=1
+  if test "$4"; then
+    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+  fi
+  $as_echo "$as_me: error: $2" >&2
+  as_fn_exit $as_status
+} # as_fn_error
+
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+  { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+  eval 'as_fn_append ()
+  {
+    eval $1+=\$2
+  }'
+else
+  as_fn_append ()
+  {
+    eval $1=\$$1\$2
+  }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+  eval 'as_fn_arith ()
+  {
+    as_val=$(( $* ))
+  }'
+else
+  as_fn_arith ()
+  {
+    as_val=`expr "$@" || test $? -eq 1`
+  }
+fi # as_fn_arith
+
+
+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
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+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'`
+
+# 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
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+  case `echo 'xy\c'` in
+  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
+  xy)  ECHO_C='\c';;
+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
+       ECHO_T='	';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+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 -pR'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -pR'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -pR'
+  fi
+else
+  as_ln_s='cp -pR'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || eval $as_mkdir_p || {
+    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_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p='mkdir -p "$as_dir"'
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+  test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
+
+# 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
+## ----------------------------------- ##
+## Main body of $CONFIG_STATUS script. ##
+## ----------------------------------- ##
+_ASEOF
+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=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 nec2c $as_me 1.3, which was
+generated by GNU Autoconf 2.69.  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 and other configuration actions
+from templates according to the current configuration.  Unless the files
+and actions are specified as TAGs, all are instantiated by default.
+
+Usage: $0 [OPTION]... [TAG]...
+
+  -h, --help       print this help, then exit
+  -V, --version    print version number and configuration settings, then exit
+      --config     print configuration, 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 <nkcyham at yahoo.com>."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
+ac_cs_version="\\
+nec2c config.status 1.3
+configured by $0, generated by GNU Autoconf 2.69,
+  with options \\"\$ac_cs_config\\"
+
+Copyright (C) 2012 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=`expr "X$1" : 'X\([^=]*\)='`
+    ac_optarg=
+    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 ;;
+  --config | --confi | --conf | --con | --co | --c )
+    $as_echo "$ac_cs_config"; 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"` ;;
+    '') as_fn_error $? "missing file argument" ;;
+    esac
+    as_fn_append 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
+    as_fn_append CONFIG_HEADERS " '$ac_optarg'"
+    ac_need_defaults=false;;
+  --he | --h)
+    # Conflict between --help and --header
+    as_fn_error $? "ambiguous option: \`$1'
+Try \`$0 --help' for more information.";;
+  --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_fn_error $? "unrecognized option: \`$1'
+Try \`$0 --help' for more information." ;;
+
+  *) as_fn_append 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
+    "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+    "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+
+  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+  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= ac_tmp=
+  trap 'exit_status=$?
+  : "${ac_tmp:=$tmp}"
+  { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
+' 0
+  trap 'as_fn_exit 1' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+  test -d "$tmp"
+}  ||
+{
+  tmp=./conf$$-$RANDOM
+  (umask 077 && mkdir "$tmp")
+} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
+ac_tmp=$tmp
+
+# 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=`echo X | tr X '\015'`
+# On cygwin, bash can eat \r inside `` if the user requested igncr.
+# But we know of no other shell where ac_cr would be empty at this
+# point, so we can use a bashism as a fallback.
+if test "x$ac_cr" = x; then
+  eval ac_cr=\$\'\\r\'
+fi
+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 {' >"$ac_tmp/subs1.awk" &&
+_ACEOF
+
+
+{
+  echo "cat >conf$$subs.awk <<_ACEOF" &&
+  echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+  echo "_ACEOF"
+} >conf$$subs.sh ||
+  as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+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_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+
+  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_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+  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 >>"\$ac_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 >>"\$ac_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 < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
+  || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
+_ACEOF
+
+# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
+# ${srcdir} and @srcdir@ entries 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[	 ]*=[	 ]*/{
+h
+s///
+s/^/:/
+s/[	 ]*$/:/
+s/:\$(srcdir):/:/g
+s/:\${srcdir}:/:/g
+s/:@srcdir@:/:/g
+s/^:*//
+s/:*$//
+x
+s/\(=[	 ]*\).*/\1/
+G
+s/\n//
+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 >"$ac_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_tt=`sed -n "/$ac_delim/p" confdefs.h`
+  if test -z "$ac_tt"; then
+    break
+  elif $ac_last_try; then
+    as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
+  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_fn_error $? "could not setup config headers machinery" "$LINENO" 5
+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_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
+  :[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="$ac_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_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
+      esac
+      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+      as_fn_append 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:${as_lineno-$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 >"$ac_tmp/stdin" \
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
+    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"; as_fn_mkdir_p
+  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:${as_lineno-$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 "$ac_tmp/subs.awk" \
+  >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' \
+      "$ac_tmp/out"`; test -z "$ac_out"; } &&
+  { $as_echo "$as_me:${as_lineno-$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 "$ac_tmp/stdin"
+  case $ac_file in
+  -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
+  *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
+  esac \
+  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ ;;
+  :H)
+  #
+  # CONFIG_HEADER
+  #
+  if test x"$ac_file" != x-; then
+    {
+      $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
+    } >"$ac_tmp/config.h" \
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+    if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
+$as_echo "$as_me: $ac_file is unchanged" >&6;}
+    else
+      rm -f "$ac_file"
+      mv "$ac_tmp/config.h" "$ac_file" \
+	|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
+    fi
+  else
+    $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
+      || as_fn_error $? "could not create -" "$LINENO" 5
+  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:${as_lineno-$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"" || {
+  # Older Autoconf quotes --file arguments for eval, but not when files
+  # are listed without --file.  Let's play safe and only enable the eval
+  # if we detect the quoting.
+  case $CONFIG_FILES in
+  *\'*) eval set x "$CONFIG_FILES" ;;
+  *)   set x $CONFIG_FILES ;;
+  esac
+  shift
+  for mf
+  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"`
+    # 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'`; 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; as_fn_mkdir_p
+      # echo "creating $dirpart/$file"
+      echo '# dummy' > "$dirpart/$file"
+    done
+  done
+}
+ ;;
+
+  esac
+done # for ac_tag
+
+
+as_fn_exit 0
+_ACEOF
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+  as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
+
+
+# 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 || as_fn_exit 1
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+  { $as_echo "$as_me:${as_lineno-$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..19d8ed3
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,44 @@
+#                                               -*- Autoconf -*-
+# Process this file with autoconf to produce a configure script.
+
+AC_PREREQ([2.69])
+AC_INIT([nec2c], [1.3], [nkcyham at yahoo.com])
+AM_INIT_AUTOMAKE
+AC_CONFIG_SRCDIR([main.c])
+AC_CONFIG_HEADERS([config.h])
+AM_MAINTAINER_MODE
+
+# Set CFLAGS if not set in environment
+AC_MSG_CHECKING([whether configure should try to set CFLAGS])
+if test "x${CFLAGS+set}" = xset; then
+   enable_cflags_setting=no
+else
+   enable_cflags_setting=yes
+fi
+AC_MSG_RESULT($enable_cflags_setting)
+test "x$enable_cflags_setting" = xyes && CFLAGS="-Wall -O2"
+
+# Checks for programs.
+AC_PROG_CXX
+AC_PROG_CC
+AC_PROG_INSTALL
+AC_PROG_MAKE_SET
+
+# Checks for libraries.
+AC_CHECK_LIB([m], [sin])
+AC_SUBST(PACKAGE_CFLAGS)
+AC_SUBST(PACKAGE_LIBS)
+
+# Checks for header files.
+AC_CHECK_HEADERS([fcntl.h stdlib.h string.h unistd.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([floor pow sqrt])
+
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
diff --git a/depcomp b/depcomp
new file mode 100755
index 0000000..4ebd5b3
--- /dev/null
+++ b/depcomp
@@ -0,0 +1,791 @@
+#! /bin/sh
+# depcomp - compile a program generating dependencies as side-effects
+
+scriptversion=2013-05-30.07; # UTC
+
+# Copyright (C) 1999-2013 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, see <http://www.gnu.org/licenses/>.
+
+# 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 outputting 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
+
+# Get the directory component of the given path, and save it in the
+# global variables '$dir'.  Note that this directory component will
+# be either empty or ending with a '/' character.  This is deliberate.
+set_dir_from ()
+{
+  case $1 in
+    */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;;
+      *) dir=;;
+  esac
+}
+
+# Get the suffix-stripped basename of the given path, and save it the
+# global variable '$base'.
+set_base_from ()
+{
+  base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'`
+}
+
+# If no dependency file was actually created by the compiler invocation,
+# we still have to create a dummy depfile, to avoid errors with the
+# Makefile "include basename.Plo" scheme.
+make_dummy_depfile ()
+{
+  echo "#dummy" > "$depfile"
+}
+
+# Factor out some common post-processing of the generated depfile.
+# Requires the auxiliary global variable '$tmpdepfile' to be set.
+aix_post_process_depfile ()
+{
+  # If the compiler actually managed to produce a dependency file,
+  # post-process it.
+  if test -f "$tmpdepfile"; then
+    # Each line is of the form 'foo.o: dependency.h'.
+    # Do two passes, one to just change these to
+    #   $object: dependency.h
+    # and one to simply output
+    #   dependency.h:
+    # which is needed to avoid the deleted-header problem.
+    { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile"
+      sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile"
+    } > "$depfile"
+    rm -f "$tmpdepfile"
+  else
+    make_dummy_depfile
+  fi
+}
+
+# A tabulation character.
+tab='	'
+# A newline character.
+nl='
+'
+# Character ranges might be problematic outside the C locale.
+# These definitions help.
+upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
+lower=abcdefghijklmnopqrstuvwxyz
+digits=0123456789
+alpha=${upper}${lower}
+
+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"
+
+# Avoid interferences from the environment.
+gccflag= dashmflag=
+
+# 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
+
+cygpath_u="cygpath -u -f -"
+if test "$depmode" = msvcmsys; then
+  # This is just like msvisualcpp but w/o cygpath translation.
+  # Just convert the backslash-escaped backslashes to single forward
+  # slashes to satisfy depend.m4
+  cygpath_u='sed s,\\\\,/,g'
+  depmode=msvisualcpp
+fi
+
+if test "$depmode" = msvc7msys; then
+  # This is just like msvc7 but w/o cygpath translation.
+  # Just convert the backslash-escaped backslashes to single forward
+  # slashes to satisfy depend.m4
+  cygpath_u='sed s,\\\\,/,g'
+  depmode=msvc7
+fi
+
+if test "$depmode" = xlc; then
+  # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
+  gccflag=-qmakedep=gcc,-MF
+  depmode=gcc
+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 -ne 0; then
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  mv "$tmpdepfile" "$depfile"
+  ;;
+
+gcc)
+## Note that this doesn't just cater to obsosete pre-3.x GCC compilers.
+## but also to in-use compilers like IMB xlc/xlC and the HP C compiler.
+## (see the conditional assignment to $gccflag above).
+## 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).  Also, it might not be
+##   supported by the other compilers which use the 'gcc' depmode.
+## - 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 -ne 0; then
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  # 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.
+## 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.  hp depmode also adds that space, but also prefixes the VPATH
+## to the object.  Take care to not repeat it in the output.
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly.  Breaking it into two sed invocations is a workaround.
+  tr ' ' "$nl" < "$tmpdepfile" \
+    | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -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 -ne 0; then
+    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 ' ' "$nl" < "$tmpdepfile" \
+      | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
+      | tr "$nl" ' ' >> "$depfile"
+    echo >> "$depfile"
+    # The second pass generates a dummy entry for each header file.
+    tr ' ' "$nl" < "$tmpdepfile" \
+      | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
+      >> "$depfile"
+  else
+    make_dummy_depfile
+  fi
+  rm -f "$tmpdepfile"
+  ;;
+
+xlc)
+  # 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
+  ;;
+
+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.
+  set_dir_from "$object"
+  set_base_from "$object"
+  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 -ne 0; then
+    rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+    exit $stat
+  fi
+
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+  do
+    test -f "$tmpdepfile" && break
+  done
+  aix_post_process_depfile
+  ;;
+
+tcc)
+  # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26
+  # FIXME: That version still under development at the moment of writing.
+  #        Make that this statement remains true also for stable, released
+  #        versions.
+  # It will wrap lines (doesn't matter whether long or short) with a
+  # trailing '\', as in:
+  #
+  #   foo.o : \
+  #    foo.c \
+  #    foo.h \
+  #
+  # It will put a trailing '\' even on the last line, and will use leading
+  # spaces rather than leading tabs (at least since its commit 0394caf7
+  # "Emit spaces for -MD").
+  "$@" -MD -MF "$tmpdepfile"
+  stat=$?
+  if test $stat -ne 0; then
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+  # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'.
+  # We have to change lines of the first kind to '$object: \'.
+  sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile"
+  # And for each line of the second kind, we have to emit a 'dep.h:'
+  # dummy dependency, to avoid the deleted-header problem.
+  sed -n -e 's|^  *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+## The order of this option in the case statement is important, since the
+## shell code in configure will try each of these formats in the order
+## listed in this file.  A plain '-MD' option would be understood by many
+## compilers, so we must ensure this comes after the gcc and icc options.
+pgcc)
+  # Portland's C compiler understands '-MD'.
+  # Will always output deps to 'file.d' where file is the root name of the
+  # source file under compilation, even if file resides in a subdirectory.
+  # The object file name does not affect the name of the '.d' file.
+  # pgcc 10.2 will output
+  #    foo.o: sub/foo.c sub/foo.h
+  # and will wrap long lines using '\' :
+  #    foo.o: sub/foo.c ... \
+  #     sub/foo.h ... \
+  #     ...
+  set_dir_from "$object"
+  # Use the source, not the object, to determine the base name, since
+  # that's sadly what pgcc will do too.
+  set_base_from "$source"
+  tmpdepfile=$base.d
+
+  # For projects that build the same source file twice into different object
+  # files, the pgcc approach of using the *source* file root name can cause
+  # problems in parallel builds.  Use a locking strategy to avoid stomping on
+  # the same $tmpdepfile.
+  lockdir=$base.d-lock
+  trap "
+    echo '$0: caught signal, cleaning up...' >&2
+    rmdir '$lockdir'
+    exit 1
+  " 1 2 13 15
+  numtries=100
+  i=$numtries
+  while test $i -gt 0; do
+    # mkdir is a portable test-and-set.
+    if mkdir "$lockdir" 2>/dev/null; then
+      # This process acquired the lock.
+      "$@" -MD
+      stat=$?
+      # Release the lock.
+      rmdir "$lockdir"
+      break
+    else
+      # If the lock is being held by a different process, wait
+      # until the winning process is done or we timeout.
+      while test -d "$lockdir" && test $i -gt 0; do
+        sleep 1
+        i=`expr $i - 1`
+      done
+    fi
+    i=`expr $i - 1`
+  done
+  trap - 1 2 13 15
+  if test $i -le 0; then
+    echo "$0: failed to acquire lock after $numtries attempts" >&2
+    echo "$0: check lockdir '$lockdir'" >&2
+    exit 1
+  fi
+
+  if test $stat -ne 0; then
+    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.
+  set_dir_from  "$object"
+  set_base_from "$object"
+  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 -ne 0; then
+     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,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile"
+    # Add 'dependent.h:' lines.
+    sed -ne '2,${
+               s/^ *//
+               s/ \\*$//
+               s/$/:/
+               p
+             }' "$tmpdepfile" >> "$depfile"
+  else
+    make_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.
+  set_dir_from  "$object"
+  set_base_from "$object"
+
+  if test "$libtool" = yes; then
+    # Libtool 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$base.o.d          # libtool 1.5
+    tmpdepfile2=$dir.libs/$base.o.d    # Likewise.
+    tmpdepfile3=$dir.libs/$base.d      # Compaq CCC V6.2-504
+    "$@" -Wc,-MD
+  else
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir$base.d
+    tmpdepfile3=$dir$base.d
+    "$@" -MD
+  fi
+
+  stat=$?
+  if test $stat -ne 0; then
+    rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+    exit $stat
+  fi
+
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+  do
+    test -f "$tmpdepfile" && break
+  done
+  # Same post-processing that is required for AIX mode.
+  aix_post_process_depfile
+  ;;
+
+msvc7)
+  if test "$libtool" = yes; then
+    showIncludes=-Wc,-showIncludes
+  else
+    showIncludes=-showIncludes
+  fi
+  "$@" $showIncludes > "$tmpdepfile"
+  stat=$?
+  grep -v '^Note: including file: ' "$tmpdepfile"
+  if test $stat -ne 0; then
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  # The first sed program below extracts the file names and escapes
+  # backslashes for cygpath.  The second sed program outputs the file
+  # name when reading, but also accumulates all include files in the
+  # hold buffer in order to output them again at the end.  This only
+  # works with sed implementations that can handle large buffers.
+  sed < "$tmpdepfile" -n '
+/^Note: including file:  *\(.*\)/ {
+  s//\1/
+  s/\\/\\\\/g
+  p
+}' | $cygpath_u | sort -u | sed -n '
+s/ /\\ /g
+s/\(.*\)/'"$tab"'\1 \\/p
+s/.\(.*\) \\/\1:/
+H
+$ {
+  s/.*/'"$tab"'/
+  G
+  p
+}' >> "$depfile"
+  echo >> "$depfile" # make sure the fragment doesn't end with a backslash
+  rm -f "$tmpdepfile"
+  ;;
+
+msvc7msys)
+  # 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
+  ;;
+
+#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 "X$1" != 'X--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|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile"
+  rm -f "$depfile"
+  cat < "$tmpdepfile" > "$depfile"
+  # Some versions of the HPUX 10.20 sed can't process this sed invocation
+  # correctly.  Breaking it into two sed invocations is a workaround.
+  tr ' ' "$nl" < "$tmpdepfile" \
+    | 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 "X$1" != 'X--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+  # X makedepend
+  shift
+  cleared=no eat=no
+  for arg
+  do
+    case $cleared in
+    no)
+      set ""; shift
+      cleared=yes ;;
+    esac
+    if test $eat = yes; then
+      eat=no
+      continue
+    fi
+    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.
+    -arch)
+      eat=yes ;;
+    -*|$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"
+  # makedepend may prepend the VPATH from the source file name to the object.
+  # No need to regex-escape $object, excess matching of '.' is harmless.
+  sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
+  # Some versions of the HPUX 10.20 sed can't process the last invocation
+  # correctly.  Breaking it into two sed invocations is a workaround.
+  sed '1,2d' "$tmpdepfile" \
+    | tr ' ' "$nl" \
+    | 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 "X$1" != 'X--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.
+  "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test "X$1" != 'X--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
+  IFS=" "
+  for arg
+  do
+    case "$arg" in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
+    "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
+        set fnord "$@"
+        shift
+        shift
+        ;;
+    *)
+        set fnord "$@" "$arg"
+        shift
+        shift
+        ;;
+    esac
+  done
+  "$@" -E 2>/dev/null |
+  sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
+  echo "$tab" >> "$depfile"
+  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+msvcmsys)
+  # 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
+  ;;
+
+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-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/fields.c b/fields.c
index a1d92ad..4c121a3 100644
--- a/fields.c
+++ b/fields.c
@@ -24,45 +24,16 @@
  ******************************************************************/
 
 #include "nec2c.h"
-
-/* common  /dataj/ */
-dataj_t dataj;
-
-/* common  /gnd/ */
-extern gnd_t gnd;
-
-/* common  /incom/ */
-extern incom_t incom;
-
-/* common  /tmi/ */
-tmi_t tmi;
+#include "shared.h"
 
 /*common  /tmh/ */
 static tmh_t tmh;
 
-/* common  /gwav/ */
-extern gwav_t gwav;
-
-/* common  /data/ */
-extern data_t data;
-
-/* common  /crnt/ */
-extern crnt_t crnt;
-
-/* common  /fpat/ */
-extern fpat_t fpat;
-
-/* common  /plot/ */
-extern plot_t plot;
-
-/* pointers to input/output files */
-extern FILE *input_fp, *output_fp, *plot_fp;
-
 /*-------------------------------------------------------------------*/
 
 /* compute near e fields of a segment with sine, cosine, and */
 /* constant currents.  ground effect included. */
-void efld( long double xi, long double yi, long double zi, long double ai, int ij )
+void efld( double xi, double yi, double zi, double ai, int ij )
 {
 #define	txk	egnd[0]
 #define	tyk	egnd[1]
@@ -74,12 +45,12 @@ void efld( long double xi, long double yi, long double zi, long double ai, int i
 #define	tyc	egnd[7]
 #define	tzc	egnd[8]
 
-  int ip;
-  long double xij, yij, ijx, rfl, salpr, zij, zp, rhox;
-  long double rhoy, rhoz, rh, r, rmag, cth, px, py;
-  long double xymag, xspec, yspec, rhospc, dmin, shaf;
-  complex long double epx, epy, refs, refps, zrsin, zratx, zscrn;
-  complex long double tezs, ters, tezc, terc, tezk, terk, egnd[9];
+  int ip, ijx;
+  double xij, yij, rfl, salpr, zij, zp, rhox;
+  double rhoy, rhoz, rh, r, rmag, cth, px, py;
+  double xymag, xspec, yspec, rhospc, dmin;
+  complex double epx, epy, refs, refps, zrsin, zratx, zscrn;
+  complex double tezs, ters, tezc, terc, tezk, terk, egnd[9];
 
   xij= xi- dataj.xj;
   yij= yi- dataj.yj;
@@ -90,7 +61,7 @@ void efld( long double xi, long double yi, long double zi, long double ai, int i
   {
 	if( ip == 1)
 	  ijx=1;
-	rfl=- rfl;
+	rfl= -rfl;
 	salpr= dataj.salpj* rfl;
 	zij= zi- rfl* dataj.zj;
 	zp= xij* dataj.cabj+ yij* dataj.sabj+ zij* salpr;
@@ -98,7 +69,7 @@ void efld( long double xi, long double yi, long double zi, long double ai, int i
 	rhoy= yij- dataj.sabj* zp;
 	rhoz= zij- salpr* zp;
 
-	rh= sqrtl( rhox* rhox+ rhoy* rhoy+ rhoz* rhoz+ ai* ai);
+	rh= sqrt( rhox* rhox+ rhoy* rhoy+ rhoz* rhoz+ ai* ai);
 	if( rh <= 1.e-10)
 	{
 	  rhox=0.;
@@ -113,19 +84,19 @@ void efld( long double xi, long double yi, long double zi, long double ai, int i
 	}
 
 	/* lumped current element approx. for large separations */
-	r= sqrtl( zp* zp+ rh* rh);
+	r= sqrt( zp* zp+ rh* rh);
 	if( r >= dataj.rkh)
 	{
 	  rmag= TP* r;
 	  cth= zp/ r;
 	  px= rh/ r;
-	  txk= cmplx( cosl( rmag),- sinl( rmag));
+	  txk= cmplx( cos( rmag), -sin( rmag));
 	  py= TP* r* r;
 	  tyk= ETA* cth* txk* cmplx(1.0,-1.0/ rmag)/ py;
 	  tzk= ETA* px* txk* cmplx(1.0, rmag-1.0/ rmag)/(2.* py);
 	  tezk= tyk* cth- tzk* px;
 	  terk= tyk* px+ tzk* cth;
-	  rmag= sinl( PI* dataj.s)/ PI;
+	  rmag= sin( PI* dataj.s)/ PI;
 	  tezc= tezk* rmag;
 	  terc= terk* rmag;
 	  tezk= tezk* dataj.s;
@@ -135,8 +106,7 @@ void efld( long double xi, long double yi, long double zi, long double ai, int i
 	  tzs=CPLX_00;
 
 	} /* if( r >= dataj.rkh) */
-
-	if( r < dataj.rkh)
+	else
 	{
 	  /* eksc for thin wire approx. or ekscx for extended t.w. approx. */
 	  if( dataj.iexk != 1)
@@ -165,18 +135,18 @@ void efld( long double xi, long double yi, long double zi, long double ai, int i
 	  {
 		zratx= gnd.zrati;
 		rmag= r;
-		xymag= sqrtl( xij* xij+ yij* yij);
+		xymag= sqrt( xij* xij+ yij* yij);
 
 		/* set parameters for radial wire ground screen. */
 		if( gnd.nradl != 0)
 		{
 		  xspec=( xi* dataj.zj+ zi* dataj.xj)/( zi+ dataj.zj);
 		  yspec=( yi* dataj.zj+ zi* dataj.yj)/( zi+ dataj.zj);
-		  rhospc= sqrtl( xspec* xspec+ yspec* yspec+ gnd.t2* gnd.t2);
+		  rhospc= sqrt( xspec* xspec+ yspec* yspec+ gnd.t2* gnd.t2);
 
 		  if( rhospc <= gnd.scrwl)
 		  {
-			zscrn= gnd.t1* rhospc* logl( rhospc/ gnd.t2);
+			zscrn= gnd.t1* rhospc* log( rhospc/ gnd.t2);
 			zratx=( zscrn* gnd.zrati)/( ETA* gnd.zrati+ zscrn);
 		  }
 		} /* if( gnd.nradl != 0) */
@@ -191,10 +161,10 @@ void efld( long double xi, long double yi, long double zi, long double ai, int i
 		}
 		else
 		{
-		  px=- yij/ xymag;
+		  px= -yij/ xymag;
 		  py= xij/ xymag;
 		  cth= zij/ rmag;
-		  zrsin= csqrtl(1.0 - zratx*zratx*(1.0 - cth*cth) );
+		  zrsin= csqrt(1.0 - zratx*zratx*(1.0 - cth*cth) );
 
 		} /* if( xymag <= 1.0e-6) */
 
@@ -251,7 +221,7 @@ void efld( long double xi, long double yi, long double zi, long double ai, int i
 	return;
 
   /* field due to ground using sommerfeld/norton */
-  incom.sn= sqrtl( dataj.cabj* dataj.cabj+ dataj.sabj* dataj.sabj);
+  incom.sn= sqrt( dataj.cabj* dataj.cabj+ dataj.sabj* dataj.sabj);
   if( incom.sn >= 1.0e-5)
   {
 	incom.xsn= dataj.cabj/ incom.sn;
@@ -266,7 +236,7 @@ void efld( long double xi, long double yi, long double zi, long double ai, int i
 
   /* displace observation point for thin wire approximation */
   zij= zi+ dataj.zj;
-  salpr=- dataj.salpj;
+  salpr= -dataj.salpj;
   rhox= dataj.sabj* zij- salpr* yij;
   rhoy= salpr* xij- dataj.cabj* zij;
   rhoz= dataj.cabj* yij- dataj.sabj* xij;
@@ -280,9 +250,9 @@ void efld( long double xi, long double yi, long double zi, long double ai, int i
   }
   else
   {
-	rh= ai/ sqrtl( rh);
+	rh= ai/ sqrt( rh);
 	if( rhoz < 0.)
-	  rh=- rh;
+	  rh= -rh;
 	incom.xo= xi+ rh* rhox;
 	incom.yo= yi+ rh* rhoy;
 	incom.zo= zi+ rh* rhoz;
@@ -292,11 +262,13 @@ void efld( long double xi, long double yi, long double zi, long double ai, int i
   r= xij* xij+ yij* yij+ zij* zij;
   if( r <= .95)
   {
+	double shaf;
 	/* field from interpolation is integrated over segment */
 	incom.isnor=1;
-	dmin= dataj.exk* conjl( dataj.exk)+ dataj.eyk*
-	  conjl( dataj.eyk)+ dataj.ezk* conjl( dataj.ezk);
-	dmin=.01* sqrtl( dmin);
+	dmin= creal(dataj.exk*conj(dataj.exk)) +
+	  creal(dataj.eyk*conj(dataj.eyk)) +
+	  creal(dataj.ezk*conj(dataj.ezk) );
+	dmin=.01* sqrt( dmin);
 	shaf=.5* dataj.s;
 	rom2(- shaf, shaf, egnd, dmin);
   }
@@ -314,7 +286,7 @@ void efld( long double xi, long double yi, long double zi, long double ai, int i
 	if( rh <= 1.e-10)
 	  dmin=0.;
 	else
-	  dmin= sqrtl( rh/( rh+ ai* ai));
+	  dmin= sqrt( rh/( rh+ ai* ai));
 
 	if( dmin <= .95)
 	{
@@ -353,12 +325,12 @@ void efld( long double xi, long double yi, long double zi, long double ai, int i
 
 /* compute e field of sine, cosine, and constant */
 /* current filaments by thin wire approximation. */
-void eksc( long double s, long double z, long double rh, long double xk, int ij,
-	complex long double *ezs, complex long double *ers, complex long double *ezc,
-	complex long double *erc, complex long double *ezk, complex long double *erk )
+void eksc( double s, double z, double rh, double xk, int ij,
+	complex double *ezs, complex double *ers, complex double *ezc,
+	complex double *erc, complex double *ezk, complex double *erk )
 {
-  long double rhk, sh, shk, ss, cs, z1a, z2a, cint, sint;
-  complex long double gz1, gz2, gp1, gp2, gzp1, gzp2;
+  double rhk, sh, shk, ss, cs, z1a, z2a, cint, sint;
+  complex double gz1, gz2, gp1, gp2, gzp1, gzp2;
 
   tmi.ij= ij;
   tmi.zpk= xk* z;
@@ -366,8 +338,8 @@ void eksc( long double s, long double z, long double rh, long double xk, int ij,
   tmi.rkb2= rhk* rhk;
   sh=.5* s;
   shk= xk* sh;
-  ss= sinl( shk);
-  cs= cosl( shk);
+  ss= sin( shk);
+  cs= cos( shk);
   z2a= sh- z;
   z1a=-( sh+ z);
   gx( z1a, rh, xk, &gz1, &gp1);
@@ -375,18 +347,18 @@ void eksc( long double s, long double z, long double rh, long double xk, int ij,
   gzp1= gp1* z1a;
   gzp2= gp2* z2a;
   *ezs=  CONST1*(( gz2- gz1)* cs* xk-( gzp2+ gzp1)* ss);
-  *ezc=- CONST1*(( gz2+ gz1)* ss* xk+( gzp2- gzp1)* cs);
+  *ezc= -CONST1*(( gz2+ gz1)* ss* xk+( gzp2- gzp1)* cs);
   *erk= CONST1*( gp2- gp1)* rh;
   intx(- shk, shk, rhk, ij, &cint, &sint);
-  *ezk=- CONST1*( gzp2- gzp1+ xk* xk* cmplx( cint,- sint));
+  *ezk= -CONST1*( gzp2- gzp1+ xk* xk* cmplx( cint,- sint));
   gzp1= gzp1* z1a;
   gzp2= gzp2* z2a;
 
   if( rh >= 1.0e-10)
   {
-	*ers=- CONST1*(( gzp2+ gzp1+ gz2+ gz1)*
+	*ers= -CONST1*(( gzp2+ gzp1+ gz2+ gz1)*
 		ss-( z2a* gz2- z1a* gz1)* cs*xk)/ rh;
-	*erc=- CONST1*(( gzp2- gzp1+ gz2- gz1)*
+	*erc= -CONST1*(( gzp2- gzp1+ gz2- gz1)*
 		cs+( z2a* gz2+ z1a* gz1)* ss*xk)/ rh;
 	return;
   }
@@ -401,16 +373,16 @@ void eksc( long double s, long double z, long double rh, long double xk, int ij,
 
 /* compute e field of sine, cosine, and constant current */
 /* filaments by extended thin wire approximation. */
-void ekscx( long double bx, long double s, long double z,
-	long double rhx, long double xk, int ij, int inx1, int inx2,
-	complex long double *ezs, complex long double *ers, complex long double *ezc,
-	complex long double *erc, complex long double *ezk, complex long double *erk )
+void ekscx( double bx, double s, double z,
+	double rhx, double xk, int ij, int inx1, int inx2,
+	complex double *ezs, complex double *ers, complex double *ezc,
+	complex double *erc, complex double *ezk, complex double *erk )
 {
   int ira;
-  long double b, rh, sh, rhk, shk, ss, cs, z1a;
-  long double z2a, a2, bk, bk2, cint, sint;
-  complex long double gz1, gz2, gzp1, gzp2, gr1, gr2;
-  complex long double grp1, grp2, grk1, grk2, gzz1, gzz2;
+  double b, rh, sh, rhk, shk, ss, cs, z1a;
+  double z2a, a2, bk, bk2, cint, sint;
+  complex double gz1, gz2, gzp1, gzp2, gr1, gr2;
+  complex double grp1, grp2, grk1, grk2, gzz1, gzz2;
 
   if( rhx >= bx)
   {
@@ -431,8 +403,8 @@ void ekscx( long double bx, long double s, long double z,
   rhk= xk* rh;
   tmi.rkb2= rhk* rhk;
   shk= xk* sh;
-  ss= sinl( shk);
-  cs= cosl( shk);
+  ss= sin( shk);
+  cs= cos( shk);
   z2a= sh- z;
   z1a=-( sh+ z);
   a2= b* b;
@@ -464,16 +436,16 @@ void ekscx( long double bx, long double s, long double z,
   }
 
   *ezs= CONST1*(( gz2- gz1)* cs* xk-( gzp2+ gzp1)* ss);
-  *ezc=- CONST1*(( gz2+ gz1)* ss* xk+( gzp2- gzp1)* cs);
-  *ers=- CONST1*(( z2a* grp2+ z1a* grp1+ gr2+ gr1)*ss
+  *ezc= -CONST1*(( gz2+ gz1)* ss* xk+( gzp2- gzp1)* cs);
+  *ers= -CONST1*(( z2a* grp2+ z1a* grp1+ gr2+ gr1)*ss
 	  -( z2a* gr2- z1a* gr1)* cs* xk);
-  *erc=- CONST1*(( z2a* grp2- z1a* grp1+ gr2- gr1)*cs
+  *erc= -CONST1*(( z2a* grp2- z1a* grp1+ gr2- gr1)*cs
 	  +( z2a* gr2+ z1a* gr1)* ss* xk);
   *erk= CONST1*( grk2- grk1);
   intx(- shk, shk, rhk, ij, &cint, &sint);
   bk= b* xk;
   bk2= bk* bk*.25;
-  *ezk=- CONST1*( gzp2- gzp1+ xk* xk*(1.- bk2)*
+  *ezk= -CONST1*( gzp2- gzp1+ xk* xk*(1.- bk2)*
 	  cmplx( cint,- sint)-bk2*( gzz2- gzz1));
 
   return;
@@ -482,15 +454,15 @@ void ekscx( long double bx, long double s, long double z,
 /*-----------------------------------------------------------------------*/
 
 /* integrand for h field of a wire */
-void gh( long double zk, long double *hr, long double *hi)
+void gh( double zk, double *hr, double *hi)
 {
-  long double rs, r, ckr, skr, rr2, rr3;
+  double rs, r, ckr, skr, rr2, rr3;
 
   rs= zk- tmh.zpka;
   rs= tmh.rhks+ rs* rs;
-  r= sqrtl( rs);
-  ckr= cosl( r);
-  skr= sinl( r);
+  r= sqrt( rs);
+  ckr= cos( r);
+  skr= sin( r);
   rr2=1./ rs;
   rr3= rr2/ r;
   *hr= skr* rr2+ ckr* rr3;
@@ -505,13 +477,13 @@ void gh( long double zk, long double *hr, long double *hi)
 /* current element over a ground plane using formulas of k.a. norton */
 /* (proc. ire, sept., 1937, pp.1203,1236.) */
 
-void gwave( complex long double *erv, complex long double *ezv,
-	complex long double *erh, complex long double *ezh, complex long double *eph )
+void gwave( complex double *erv, complex double *ezv,
+	complex double *erh, complex double *ezh, complex double *eph )
 {
-  long double sppp, sppp2, cppp2, cppp, spp, spp2, cpp2, cpp;
-  complex long double rk1, rk2, t1, t2, t3, t4, p1, rv;
-  complex long double omr, w, f, q1, rh, v, g, xr1, xr2;
-  complex long double x1, x2, x3, x4, x5, x6, x7;
+  double sppp, sppp2, cppp2, cppp, spp, spp2, cpp2, cpp;
+  complex double rk1, rk2, t1, t2, t3, t4, p1, rv;
+  complex double omr, w, f, q1, rh, v, g, xr1, xr2;
+  complex double x1, x2, x3, x4, x5, x6, x7;
 
   sppp= gwav.zmh/ gwav.r1;
   sppp2= sppp* sppp;
@@ -520,7 +492,7 @@ void gwave( complex long double *erv, complex long double *ezv,
   if( cppp2 < 1.0e-20)
 	cppp2=1.0e-20;
 
-  cppp= sqrtl( cppp2);
+  cppp= sqrt( cppp2);
   spp= gwav.zph/ gwav.r2;
   spp2= spp* spp;
   cpp2=1.- spp2;
@@ -528,23 +500,23 @@ void gwave( complex long double *erv, complex long double *ezv,
   if( cpp2 < 1.0e-20)
 	cpp2=1.0e-20;
 
-  cpp= sqrtl( cpp2);
-  rk1=- TPJ* gwav.r1;
-  rk2=- TPJ* gwav.r2;
+  cpp= sqrt( cpp2);
+  rk1= -TPJ* gwav.r1;
+  rk2= -TPJ* gwav.r2;
   t1=1. -gwav.u2* cpp2;
-  t2= csqrtl( t1);
+  t2= csqrt( t1);
   t3=(1. -1./ rk1)/ rk1;
   t4=(1. -1./ rk2)/ rk2;
   p1= rk2* gwav.u2* t1/(2.* cpp2);
   rv=( spp- gwav.u* t2)/( spp+ gwav.u* t2);
   omr=1.- rv;
   w=1./ omr;
-  w=(4.0 + 0.0fj)* p1* w* w;
+  w=(4.0 + I*0.0)* p1* w* w;
   fbar( w, &f );
   q1= rk2* t1/(2.* gwav.u2* cpp2);
   rh=( t2- gwav.u* spp)/( t2+ gwav.u* spp);
   v=1./(1.+ rh);
-  v=(4.0 + 0.0fj)* q1* v* v;
+  v=(4.0 + I*0.0)* q1* v* v;
   fbar( v, &g );
   xr1= gwav.xx1/ gwav.r1;
   xr2= gwav.xx2/ gwav.r2;
@@ -585,16 +557,16 @@ void gwave( complex long double *erv, complex long double *ezv,
 /*-----------------------------------------------------------------------*/
 
 /* segment end contributions for thin wire approx. */
-void gx( long double zz, long double rh, long double xk,
-	complex long double *gz, complex long double *gzp)
+void gx( double zz, double rh, double xk,
+	complex double *gz, complex double *gzp)
 {
-  long double r, r2, rkz;
+  double r, r2, rkz;
 
   r2= zz* zz+ rh* rh;
-  r= sqrtl( r2);
+  r= sqrt( r2);
   rkz= xk* r;
-  *gz= cmplx( cosl( rkz),- sinl( rkz))/ r;
-  *gzp=- cmplx(1.0, rkz)* *gz/ r2;
+  *gz= cmplx( cos( rkz),- sin( rkz))/ r;
+  *gzp= -cmplx(1.0, rkz)* *gz/ r2;
 
   return;
 }
@@ -602,16 +574,16 @@ void gx( long double zz, long double rh, long double xk,
 /*-----------------------------------------------------------------------*/
 
 /* segment end contributions for ext. thin wire approx. */
-void gxx( long double zz, long double rh, long double a,
-	long double a2, long double xk, int ira, complex long double *g1,
-	complex long double *g1p, complex long double *g2,
-	complex long double *g2p, complex long double *g3, complex long double *gzp )
+void gxx( double zz, double rh, double a,
+	double a2, double xk, int ira, complex double *g1,
+	complex double *g1p, complex double *g2,
+	complex double *g2p, complex double *g3, complex double *gzp )
 {
-  long double r, r2, r4, rk, rk2, rh2, t1, t2;
-  complex long double  gz, c1, c2, c3;
+  double r, r2, r4, rk, rk2, rh2, t1, t2;
+  complex double  gz, c1, c2, c3;
 
   r2= zz* zz+ rh* rh;
-  r= sqrtl( r2);
+  r= sqrt( r2);
   r4= r2* r2;
   rk= xk* r;
   rk2= rk* rk;
@@ -621,7 +593,7 @@ void gxx( long double zz, long double rh, long double a,
   c1= cmplx(1.0, rk);
   c2=3.* c1- rk2;
   c3= cmplx(6.0, rk)* rk2-15.* c1;
-  gz= cmplx( cosl( rk),- sinl( rk))/ r;
+  gz= cmplx( cos( rk),- sin( rk))/ r;
   *g2= gz*(1.+ t1* c2);
   *g1= *g2- t2* c1* gz;
   gz= gz/ r2;
@@ -633,7 +605,7 @@ void gxx( long double zz, long double rh, long double a,
   if( ira != 1)
   {
 	*g3=( *g3+ *gzp)* rh;
-	*gzp=- zz* c1* gz;
+	*gzp= -zz* c1* gz;
 
 	if( rh <= 1.0e-10)
 	{
@@ -649,11 +621,11 @@ void gxx( long double zz, long double rh, long double a,
   } /* if( ira != 1) */
 
   t2=.5* a;
-  *g2=- t2* c1* gz;
+  *g2= -t2* c1* gz;
   *g2p= t2* gz* c2/ r2;
   *g3= rh2* *g2p- a* gz* c1;
   *g2p= *g2p* zz;
-  *gzp=- zz* c1* gz;
+  *gzp= -zz* c1* gz;
 
   return;
 }
@@ -662,16 +634,16 @@ void gxx( long double zz, long double rh, long double a,
 
 /* hfk computes the h field of a uniform current */
 /* filament by numerical integration */
-void hfk( long double el1, long double el2, long double rhk,
-	long double zpkx, long double *sgr, long double *sgi )
+void hfk( double el1, double el2, double rhk,
+	double zpkx, double *sgr, double *sgi )
 {
   int nx = 1, nma = 65536, nts = 4;
   int ns, nt;
   int flag = TRUE;
-  long double rx = 1.0e-4;
-  long double z, ze, s, ep, zend, dz=0., zp, dzot=0., t00r, g1r, g5r=0, t00i;
-  long double g1i, g5i=0., t01r, g3r=0, t01i, g3i=0, t10r, t10i, te1i, te1r, t02r;
-  long double g2r, g4r, t02i, g2i, g4i, t11r, t11i, t20r, t20i, te2i, te2r;
+  double rx = 1.0e-4;
+  double z, ze, s, ep, zend, dz=0., zp, dzot=0., t00r, g1r, g5r=0, t00i;
+  double g1i, g5i=0., t01r, g3r=0, t01i, g3i=0, t10r, t10i, te1i, te1r, t02r;
+  double g2r, g4r, t02i, g2i, g4i, t11r, t11i, t20r, t20i, te2i, te2r;
 
   tmh.zpka= zpkx;
   tmh.rhks= rhk* rhk;
@@ -696,7 +668,7 @@ void hfk( long double el1, long double el2, long double rhk,
 	  if( zp > ze )
 	  {
 		dz= ze- z;
-		if( fabsl(dz) <= ep )
+		if( fabs(dz) <= ep )
 		{
 		  *sgr= *sgr* rhk*.5;
 		  *sgi= *sgi* rhk*.5;
@@ -763,7 +735,7 @@ void hfk( long double el1, long double el2, long double rhk,
 	{
 	  nt=0;
 	  if( ns >= nma)
-		fprintf( output_fp, "\n  STEP SIZE LIMITED AT Z= %10.5LF", z );
+		fprintf( output_fp, "\n  STEP SIZE LIMITED AT Z= %10.5f", z );
 	  else
 	  {
 		ns= ns*2;
@@ -809,12 +781,12 @@ void hfk( long double el1, long double el2, long double rhk,
 /*-----------------------------------------------------------------------*/
 
 /* hintg computes the h field of a patch current */
-void hintg( long double xi, long double yi, long double zi )
+void hintg( double xi, double yi, double zi )
 {
   int ip;
-  long double rx, ry, rfl, xymag, pxx, pyy, cth;
-  long double rz, rsq, r, rk, cr, sr, t1zr, t2zr;
-  complex long double  gam, f1x, f1y, f1z, f2x, f2y, f2z, rrv, rrh;
+  double rx, ry, rfl, xymag, pxx, pyy, cth;
+  double rz, rsq, r, rk, cr, sr, t1zr, t2zr;
+  complex double  gam, f1x, f1y, f1z, f2x, f2y, f2z, rrv, rrh;
 
   rx= xi- dataj.xj;
   ry= yi- dataj.yj;
@@ -828,17 +800,17 @@ void hintg( long double xi, long double yi, long double zi )
 
   for( ip = 1; ip <= gnd.ksymp; ip++ )
   {
-	rfl=- rfl;
+	rfl= -rfl;
 	rz= zi- dataj.zj* rfl;
 	rsq= rx* rx+ ry* ry+ rz* rz;
 
 	if( rsq < 1.0e-20)
 	  continue;
 
-	r = sqrtl( rsq );
+	r = sqrt( rsq );
 	rk= TP* r;
-	cr= cosl( rk);
-	sr= sinl( rk);
+	cr= cos( rk);
+	sr= sin( rk);
 	gam=-( cmplx(cr,-sr)+rk*cmplx(sr,cr) )/( FPI*rsq*r )* dataj.s;
 	dataj.exc= gam* rx;
 	dataj.eyc= gam* ry;
@@ -856,16 +828,16 @@ void hintg( long double xi, long double yi, long double zi )
 	{
 	  if( gnd.iperf == 1)
 	  {
-		f1x=- f1x;
-		f1y=- f1y;
-		f1z=- f1z;
-		f2x=- f2x;
-		f2y=- f2y;
-		f2z=- f2z;
+		f1x= -f1x;
+		f1y= -f1y;
+		f1z= -f1z;
+		f2x= -f2x;
+		f2y= -f2y;
+		f2z= -f2z;
 	  }
 	  else
 	  {
-		xymag= sqrtl( rx* rx+ ry* ry);
+		xymag= sqrt( rx* rx+ ry* ry);
 		if( xymag <= 1.0e-6)
 		{
 		  pxx=0.;
@@ -875,10 +847,10 @@ void hintg( long double xi, long double yi, long double zi )
 		}
 		else
 		{
-		  pxx=- ry/ xymag;
+		  pxx= -ry/ xymag;
 		  pyy= rx/ xymag;
 		  cth= rz/ r;
-		  rrv= csqrtl(1.- gnd.zrati* gnd.zrati*(1.- cth* cth));
+		  rrv= csqrt(1.- gnd.zrati* gnd.zrati*(1.- cth* cth));
 
 		} /* if( xymag <= 1.0e-6) */
 
@@ -915,12 +887,12 @@ void hintg( long double xi, long double yi, long double zi )
 
 /* hsfld computes the h field for constant, sine, and */
 /* cosine current on a segment including ground effects. */
-void hsfld( long double xi, long double yi, long double zi, long double ai )
+void hsfld( double xi, double yi, double zi, double ai )
 {
   int ip;
-  long double xij, yij, rfl, salpr, zij, zp, rhox, rhoy, rhoz, rh, phx;
-  long double phy, phz, rmag, xymag, xspec, yspec, rhospc, px, py, cth;
-  complex long double hpk, hps, hpc, qx, qy, qz, rrv, rrh, zratx;
+  double xij, yij, rfl, salpr, zij, zp, rhox, rhoy, rhoz, rh, phx;
+  double phy, phz, rmag, xymag, xspec, yspec, rhospc, px, py, cth;
+  complex double hpk, hps, hpc, qx, qy, qz, rrv, rrh, zratx;
 
   xij= xi- dataj.xj;
   yij= yi- dataj.yj;
@@ -928,14 +900,14 @@ void hsfld( long double xi, long double yi, long double zi, long double ai )
 
   for( ip = 0; ip < gnd.ksymp; ip++ )
   {
-	rfl=- rfl;
+	rfl= -rfl;
 	salpr= dataj.salpj* rfl;
 	zij= zi- rfl* dataj.zj;
 	zp= xij* dataj.cabj+ yij* dataj.sabj+ zij* salpr;
 	rhox= xij- dataj.cabj* zp;
 	rhoy= yij- dataj.sabj* zp;
 	rhoz= zij- salpr* zp;
-	rh= sqrtl( rhox* rhox+ rhoy* rhoy+ rhoz* rhoz+ ai* ai);
+	rh= sqrt( rhox* rhox+ rhoy* rhoy+ rhoz* rhoz+ ai* ai);
 
 	if( rh <= 1.0e-10)
 	{
@@ -965,19 +937,19 @@ void hsfld( long double xi, long double yi, long double zi, long double ai )
 	  if( gnd.iperf != 1 )
 	  {
 		zratx= gnd.zrati;
-		rmag= sqrtl( zp* zp+ rh* rh);
-		xymag= sqrtl( xij* xij+ yij* yij);
+		rmag= sqrt( zp* zp+ rh* rh);
+		xymag= sqrt( xij* xij+ yij* yij);
 
 		/* set parameters for radial wire ground screen. */
 		if( gnd.nradl != 0)
 		{
 		  xspec=( xi* dataj.zj+ zi* dataj.xj)/( zi+ dataj.zj);
 		  yspec=( yi* dataj.zj+ zi* dataj.yj)/( zi+ dataj.zj);
-		  rhospc= sqrtl( xspec* xspec+ yspec* yspec+ gnd.t2* gnd.t2);
+		  rhospc= sqrt( xspec* xspec+ yspec* yspec+ gnd.t2* gnd.t2);
 
 		  if( rhospc <= gnd.scrwl)
 		  {
-			rrv= gnd.t1* rhospc* logl( rhospc/ gnd.t2);
+			rrv= gnd.t1* rhospc* log( rhospc/ gnd.t2);
 			zratx=( rrv* gnd.zrati)/( ETA* gnd.zrati+ rrv);
 		  }
 		}
@@ -992,10 +964,10 @@ void hsfld( long double xi, long double yi, long double zi, long double ai )
 		}
 		else
 		{
-		  px=- yij/ xymag;
+		  px= -yij/ xymag;
 		  py= xij/ xymag;
 		  cth= zij/ rmag;
-		  rrv= csqrtl(1.- zratx* zratx*(1.- cth* cth));
+		  rrv= csqrt(1.- zratx* zratx*(1.- cth* cth));
 		}
 
 		rrh= zratx* cth;
@@ -1050,17 +1022,18 @@ void hsfld( long double xi, long double yi, long double zi, long double ai )
 /*-----------------------------------------------------------------------*/
 
 /* calculates h field of sine cosine, and constant current of segment */
-void hsflx( long double s, long double rh, long double zpx,
-	complex long double *hpk, complex long double *hps,
-	complex long double *hpc )
+void hsflx( double s, double rh, double zpx,
+	complex double *hpk, complex double *hps,
+	complex double *hpc )
 {
-  long double r1, r2, zp, z2a, hss, dh, z1;
-  long double rhz, dk, cdk, sdk, hkr, hki, rh2;
-  complex long double fjk, ekr1, ekr2, t1, t2, cons;
+  complex double fjk, ekr1, ekr2, t1, t2, cons;
 
   fjk = -TPJ;
   if( rh >= 1.0e-10)
   {
+	double zp, z2a, hss, dh, z1;
+	double rhz, dk, cdk, sdk, hkr, hki;
+
 	if( zpx >= 0.)
 	{
 	  zp= zpx;
@@ -1068,7 +1041,7 @@ void hsflx( long double s, long double rh, long double zpx,
 	}
 	else
 	{
-	  zp=- zpx;
+	  zp= -zpx;
 	  hss=-1.;
 	}
 
@@ -1081,23 +1054,24 @@ void hsflx( long double s, long double rh, long double zpx,
 	  rhz=1.;
 
 	dk= TP* dh;
-	cdk= cosl( dk);
-	sdk= sinl( dk);
+	cdk= cos( dk);
+	sdk= sin( dk);
 	hfk(- dk, dk, rh* TP, zp* TP, &hkr, &hki);
 	*hpk= cmplx( hkr, hki);
 
 	if( rhz >= 1.0e-3)
 	{
+	  double rh2, r1, r2;
 	  rh2= rh* rh;
-	  r1= sqrtl( rh2+ z1* z1);
-	  r2= sqrtl( rh2+ z2a* z2a);
+	  r1= sqrt( rh2+ z1* z1);
+	  r2= sqrt( rh2+ z2a* z2a);
 	  ekr1= cexp( fjk* r1);
 	  ekr2= cexp( fjk* r2);
 	  t1= z1* ekr1/ r1;
 	  t2= z2a* ekr2/ r2;
 	  *hps=( cdk*( ekr2- ekr1)- CPLX_01* sdk*( t2+ t1))* hss;
-	  *hpc=- sdk*( ekr2+ ekr1)- CPLX_01* cdk*( t2- t1);
-	  cons=- CPLX_01/(2.* TP* rh);
+	  *hpc= -sdk*( ekr2+ ekr1)- CPLX_01* cdk*( t2- t1);
+	  cons= -CPLX_01/(2.* TP* rh);
 	  *hps= cons* *hps;
 	  *hpc= cons* *hpc;
 	  return;
@@ -1125,12 +1099,12 @@ void hsflx( long double s, long double rh, long double zpx,
 
 /* nefld computes the near field at specified points in space after */
 /* the structure currents have been computed. */
-void nefld( long double xob, long double yob, long double zob,
-	complex long double *ex, complex long double *ey, complex long double *ez )
+void nefld( double xob, double yob, double zob,
+	complex double *ex, complex double *ey, complex double *ez )
 {
   int i, ix, ipr, iprx, jc, ipa;
-  long double zp, xi, ax;
-  complex long double acx, bcx, ccx;
+  double zp, xi, ax;
+  complex double acx, bcx, ccx;
 
   *ex=CPLX_00;
   *ey=CPLX_00;
@@ -1146,7 +1120,7 @@ void nefld( long double xob, long double yob, long double zob,
 	  dataj.zj= zob- data.z[i];
 	  zp= data.cab[i]* dataj.xj+ data.sab[i]* dataj.yj+ data.salp[i]* dataj.zj;
 
-	  if( fabsl( zp) > 0.5001* data.si[i])
+	  if( fabs( zp) > 0.5001* data.si[i])
 		continue;
 
 	  zp= dataj.xj* dataj.xj+ dataj.yj* dataj.yj+ dataj.zj* dataj.zj- zp* zp;
@@ -1176,7 +1150,7 @@ void nefld( long double xob, long double yob, long double zob,
 	  {
 		ipr= data.icon1[i];
 
-		if (ipr > PCHCON) dataj.ind1 = 2;
+		if(ipr > PCHCON) dataj.ind1 = 2;
 		else if( ipr < 0 )
 		{
 		  ipr = -ipr;
@@ -1186,9 +1160,9 @@ void nefld( long double xob, long double yob, long double zob,
 			dataj.ind1=2;
 		  else
 		  {
-			xi= fabsl( dataj.cabj* data.cab[iprx]+ dataj.sabj*
+			xi= fabs( dataj.cabj* data.cab[iprx]+ dataj.sabj*
 				data.sab[iprx]+ dataj.salpj* data.salp[iprx]);
-			if( (xi < 0.999999) || (fabsl(data.bi[iprx]/dataj.b-1.) > 1.0e-6) )
+			if( (xi < 0.999999) || (fabs(data.bi[iprx]/dataj.b-1.) > 1.0e-6) )
 			  dataj.ind1=2;
 			else
 			  dataj.ind1=0;
@@ -1207,9 +1181,9 @@ void nefld( long double xob, long double yob, long double zob,
 				dataj.ind1=2;
 			  else
 			  {
-				xi= fabsl( dataj.cabj* data.cab[iprx]+ dataj.sabj*
+				xi= fabs( dataj.cabj* data.cab[iprx]+ dataj.sabj*
 					data.sab[iprx]+ dataj.salpj* data.salp[iprx]);
-				if( (xi < 0.999999) || (fabsl(data.bi[iprx]/dataj.b-1.) > 1.0e-6) )
+				if( (xi < 0.999999) || (fabs(data.bi[iprx]/dataj.b-1.) > 1.0e-6) )
 				  dataj.ind1=2;
 				else
 				  dataj.ind1=0;
@@ -1236,9 +1210,9 @@ void nefld( long double xob, long double yob, long double zob,
 			dataj.ind1=2;
 		  else
 		  {
-			xi= fabsl( dataj.cabj* data.cab[iprx]+ dataj.sabj*
+			xi= fabs( dataj.cabj* data.cab[iprx]+ dataj.sabj*
 				data.sab[iprx]+ dataj.salpj* data.salp[iprx]);
-			if( (xi < 0.999999) || (fabsl(data.bi[iprx]/dataj.b-1.) > 1.0e-6) )
+			if( (xi < 0.999999) || (fabs(data.bi[iprx]/dataj.b-1.) > 1.0e-6) )
 			  dataj.ind1=2;
 			else
 			  dataj.ind1=0;
@@ -1257,9 +1231,9 @@ void nefld( long double xob, long double yob, long double zob,
 				dataj.ind2=2;
 			  else
 			  {
-				xi= fabsl( dataj.cabj* data.cab[iprx]+ dataj.sabj*
+				xi= fabs( dataj.cabj* data.cab[iprx]+ dataj.sabj*
 					data.sab[iprx]+ dataj.salpj* data.salp[iprx]);
-				if( (xi < 0.999999) || (fabsl(data.bi[iprx]/dataj.b-1.) > 1.0e-6) )
+				if( (xi < 0.999999) || (fabs(data.bi[iprx]/dataj.b-1.) > 1.0e-6) )
 				  dataj.ind2=2;
 				else
 				  dataj.ind2=0;
@@ -1329,9 +1303,9 @@ void nefld( long double xob, long double yob, long double zob,
 void nfpat( void )
 {
   int i, j, kk;
-  long double znrt, cth=0., sth=0., ynrt, cph=0., sph=0., xnrt, xob, yob;
-  long double zob, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, xxx;
-  complex long double ex, ey, ez;
+  double znrt, cth=0., sth=0., ynrt, cph=0., sph=0., xnrt, xob, yob;
+  double zob, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, xxx;
+  complex double ex, ey, ez;
 
   if( fpat.nfeh != 1)
   {
@@ -1358,8 +1332,8 @@ void nfpat( void )
 	znrt += fpat.dznr;
 	if( fpat.near != 0)
 	{
-	  cth= cosl( TA* znrt);
-	  sth= sinl( TA* znrt);
+	  cth= cos( TA* znrt);
+	  sth= sin( TA* znrt);
 	}
 
 	ynrt= fpat.ynr- fpat.dynr;
@@ -1368,8 +1342,8 @@ void nfpat( void )
 	  ynrt += fpat.dynr;
 	  if( fpat.near != 0)
 	  {
-		cph= cosl( TA* ynrt);
-		sph= sinl( TA* ynrt);
+		cph= cos( TA* ynrt);
+		sph= sin( TA* ynrt);
 	  }
 
 	  xnrt= fpat.xnr- fpat.dxnr;
@@ -1398,15 +1372,15 @@ void nfpat( void )
 		else
 		  nhfld( tmp1, tmp2, tmp3, &ex, &ey, &ez);
 
-		tmp1= cabsl( ex);
+		tmp1= cabs( ex);
 		tmp2= cang( ex);
-		tmp3= cabsl( ey);
+		tmp3= cabs( ey);
 		tmp4= cang( ey);
-		tmp5= cabsl( ez);
+		tmp5= cabs( ez);
 		tmp6= cang( ez);
 
 		fprintf( output_fp, "\n"
-			" %9.4LF %9.4LF %9.4LF  %11.4LE %7.2LF  %11.4LE %7.2LF  %11.4LE %7.2LF",
+			" %9.4f %9.4f %9.4f  %11.4E %7.2f  %11.4E %7.2f  %11.4E %7.2f",
 			xob, yob, zob, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6 );
 
 		if( plot.iplp1 != 2)
@@ -1425,16 +1399,16 @@ void nfpat( void )
 		  switch( plot.iplp3 )
 		  {
 			case 1:
-			  fprintf( plot_fp, "%12.4LE %12.4LE %12.4LE\n", xxx, tmp1, tmp2 );
+			  fprintf( plot_fp, "%12.4E %12.4E %12.4E\n", xxx, tmp1, tmp2 );
 			  break;
 			case 2:
-			  fprintf( plot_fp, "%12.4LE %12.4LE %12.4LE\n", xxx, tmp3, tmp4 );
+			  fprintf( plot_fp, "%12.4E %12.4E %12.4E\n", xxx, tmp3, tmp4 );
 			  break;
 			case 3:
-			  fprintf( plot_fp, "%12.4LE %12.4LE %12.4LE\n", xxx, tmp5, tmp6 );
+			  fprintf( plot_fp, "%12.4E %12.4E %12.4E\n", xxx, tmp5, tmp6 );
 			  break;
 			case 4:
-			  fprintf( plot_fp, "%12.4LE %12.4LE %12.4LE %12.4LE %12.4LE %12.4LE %12.4LE\n",
+			  fprintf( plot_fp, "%12.4E %12.4E %12.4E %12.4E %12.4E %12.4E %12.4E\n",
 				  xxx, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6 );
 		  }
 		  continue;
@@ -1446,17 +1420,17 @@ void nfpat( void )
 		switch( plot.iplp3 )
 		{
 		  case 1:
-			fprintf( plot_fp, "%12.4LE %12.4LE %12.4LE\n", xxx, creall(ex), cimagl(ex) );
+			fprintf( plot_fp, "%12.4E %12.4E %12.4E\n", xxx, creal(ex), cimag(ex) );
 			break;
 		  case 2:
-			fprintf( plot_fp, "%12.4LE %12.4LE %12.4LE\n", xxx, creall(ey), cimagl(ey) );
+			fprintf( plot_fp, "%12.4E %12.4E %12.4E\n", xxx, creal(ey), cimag(ey) );
 			break;
 		  case 3:
-			fprintf( plot_fp, "%12.4LE %12.4LE %12.4LE\n", xxx, creall(ez), cimagl(ez) );
+			fprintf( plot_fp, "%12.4E %12.4E %12.4E\n", xxx, creal(ez), cimag(ez) );
 			break;
 		  case 4:
-			fprintf( plot_fp, "%12.4LE %12.4LE %12.4LE %12.4LE %12.4LE %12.4LE %12.4LE\n",
-				xxx,creall(ex),cimagl(ex),creall(ey),cimagl(ey),creall(ez),cimagl(ez) );
+			fprintf( plot_fp, "%12.4E %12.4E %12.4E %12.4E %12.4E %12.4E %12.4E\n",
+				xxx,creal(ex),cimag(ex),creal(ey),cimag(ey),creal(ez),cimag(ez) );
 		}
 	  } /* for( kk = 0; kk < fpat.nrx; kk++ ) */
 
@@ -1472,12 +1446,12 @@ void nfpat( void )
 /* nhfld computes the near field at specified points in space after */
 /* the structure currents have been computed. */
 
-void nhfld( long double xob, long double yob, long double zob,
-	complex long double *hx, complex long double *hy, complex long double *hz )
+void nhfld( double xob, double yob, double zob,
+	complex double *hx, complex double *hy, complex double *hz )
 {
   int i, jc;
-  long double ax, zp;
-  complex long double acx, bcx, ccx;
+  double ax, zp;
+  complex double acx, bcx, ccx;
 
   *hx=CPLX_00;
   *hy=CPLX_00;
@@ -1493,7 +1467,7 @@ void nhfld( long double xob, long double yob, long double zob,
 	  dataj.zj= zob- data.z[i];
 	  zp= data.cab[i]* dataj.xj+ data.sab[i]* dataj.yj+ data.salp[i]* dataj.zj;
 
-	  if( fabsl( zp) > 0.5001* data.si[i])
+	  if( fabs( zp) > 0.5001* data.si[i])
 		continue;
 
 	  zp= dataj.xj* dataj.xj+ dataj.yj* dataj.yj+ dataj.zj* dataj.zj- zp* zp;
@@ -1558,17 +1532,17 @@ void nhfld( long double xob, long double yob, long double zob,
 /*-----------------------------------------------------------------------*/
 
 /* integrate over patches at wire connection point */
-void pcint( long double xi, long double yi, long double zi, long double cabi,
-	long double sabi, long double salpi, complex long double *e )
+void pcint( double xi, double yi, double zi, double cabi,
+	double sabi, double salpi, complex double *e )
 {
   int nint, i1, i2;
-  long double d, ds, da, gcon, fcon, xxj, xyj, xzj, xs, s1;
-  long double xss, yss, zss, s2x, s2, g1, g2, g3, g4, f2, f1;
-  complex long double e1, e2, e3, e4, e5, e6, e7, e8, e9;
+  double d, ds, da, gcon, fcon, xxj, xyj, xzj, xs, s1;
+  double xss, yss, zss, s2x, s2, g1, g2, g3, g4, f2, f1;
+  complex double e1, e2, e3, e4, e5, e6, e7, e8, e9;
 
   nint = 10;
-  d= sqrtl( dataj.s)*.5;
-  ds=4.* d/ (long double) nint;
+  d= sqrt( dataj.s)*.5;
+  ds=4.* d/ (double) nint;
   da= ds* ds;
   gcon=1./ dataj.s;
   fcon=1./(2.* TP* d);
@@ -1655,11 +1629,11 @@ void pcint( long double xi, long double yi, long double zi, long double cabi,
 
 /* calculates the electric field due to unit current */
 /* in the t1 and t2 directions on a patch */
-void unere( long double xob, long double yob, long double zob )
+void unere( double xob, double yob, double zob )
 {
-  long double zr, t1zr, t2zr, rx, ry, rz, r, tt1;
-  long double tt2, rt, xymag, px, py, cth, r2;
-  complex long double er, q1, q2, rrv, rrh, edp;
+  double zr, t1zr, t2zr, rx, ry, rz, r, tt1;
+  double tt2, rt, xymag, px, py, cth, r2;
+  complex double er, q1, q2, rrv, rrh, edp;
 
   zr= dataj.zj;
   t1zr= dataj.t1zj;
@@ -1667,9 +1641,9 @@ void unere( long double xob, long double yob, long double zob )
 
   if( dataj.ipgnd == 2)
   {
-	zr=- zr;
-	t1zr=- t1zr;
-	t2zr=- t2zr;
+	zr= -zr;
+	t1zr= -t1zr;
+	t2zr= -t2zr;
   }
 
   rx= xob- dataj.xj;
@@ -1688,11 +1662,11 @@ void unere( long double xob, long double yob, long double zob )
 	return;
   }
 
-  r= sqrtl( r2);
-  tt1=- TP* r;
+  r= sqrt( r2);
+  tt1= -TP* r;
   tt2= tt1* tt1;
   rt= r2* r;
-  er= cmplx( sinl( tt1),- cosl( tt1))*( CONST2* dataj.s);
+  er= cmplx( sin( tt1),- cos( tt1))*( CONST2* dataj.s);
   q1= cmplx( tt2-1., tt1)* er/ rt;
   q2= cmplx(3.- tt2,-3.* tt1)* er/( rt* r2);
   er = q2*( dataj.t1xj* rx+ dataj.t1yj* ry+ t1zr* rz);
@@ -1709,16 +1683,16 @@ void unere( long double xob, long double yob, long double zob )
 
   if( gnd.iperf == 1)
   {
-	dataj.exk=- dataj.exk;
-	dataj.eyk=- dataj.eyk;
-	dataj.ezk=- dataj.ezk;
-	dataj.exs=- dataj.exs;
-	dataj.eys=- dataj.eys;
-	dataj.ezs=- dataj.ezs;
+	dataj.exk= -dataj.exk;
+	dataj.eyk= -dataj.eyk;
+	dataj.ezk= -dataj.ezk;
+	dataj.exs= -dataj.exs;
+	dataj.eys= -dataj.eys;
+	dataj.ezs= -dataj.ezs;
 	return;
   }
 
-  xymag= sqrtl( rx* rx+ ry* ry);
+  xymag= sqrt( rx* rx+ ry* ry);
   if( xymag <= 1.0e-6)
   {
 	px=0.;
@@ -1728,10 +1702,10 @@ void unere( long double xob, long double yob, long double zob )
   }
   else
   {
-	px=- ry/ xymag;
+	px= -ry/ xymag;
 	py= rx/ xymag;
-	cth= rz/ sqrtl( xymag* xymag+ rz* rz);
-	rrv= csqrtl(1.- gnd.zrati* gnd.zrati*(1.- cth* cth));
+	cth= rz/ sqrt( xymag* xymag+ rz* rz);
+	rrv= csqrt(1.- gnd.zrati* gnd.zrati*(1.- cth* cth));
   }
 
   rrh= gnd.zrati* cth;
diff --git a/geometry.c b/geometry.c
index e474f2a..1c7ac9f 100644
--- a/geometry.c
+++ b/geometry.c
@@ -24,27 +24,15 @@
  *******************************************************************/
 
 #include "nec2c.h"
-
-/* common  /data/ */
-extern data_t data;
-
-/* common  /segj/ */
-extern segj_t segj;
-
-/* pointers to input/output files */
-extern FILE *input_fp, *output_fp, *plot_fp;
-
-/* common  /plot/ */
-extern plot_t plot;
+#include "shared.h"
 
 /*-------------------------------------------------------------------*/
 
 /* arc generates segment geometry data for an arc of ns segments */
-void arc( int itg, int ns, long double rada,
-	long double ang1, long double ang2, long double rad )
+void arc( int itg, int ns, double rada,
+	double ang1, double ang2, double rad )
 {
-  int ist, i, mreq;
-  long double ang, dang, xs1, xs2, zs1, zs2;
+  int ist;
 
   ist= data.n;
   data.n += ns;
@@ -55,13 +43,19 @@ void arc( int itg, int ns, long double rada,
   if( ns < 1)
 	return;
 
-  if( fabsl( ang2- ang1) < 360.00001)
+  if( fabs( ang2- ang1) < 360.00001)
   {
+	int i;
+	double ang, dang, xs1, xs2, zs1, zs2;
+
 	/* Reallocate tags buffer */
-	mem_realloc( (void *)&data.itag, (data.n+data.m) * sizeof(int) );
+	size_t mreq = (size_t)data.n;
+	mreq *= sizeof(int);
+	mem_realloc( (void *)&data.itag, mreq );
 
 	/* Reallocate wire buffers */
-	mreq = data.n * sizeof(long double);
+	mreq = (size_t)data.n;
+	mreq *= sizeof(double);
 	mem_realloc( (void *)&data.x1, mreq );
 	mem_realloc( (void *)&data.y1, mreq );
 	mem_realloc( (void *)&data.z1, mreq );
@@ -72,14 +66,14 @@ void arc( int itg, int ns, long double rada,
 
 	ang= ang1* TA;
 	dang=( ang2- ang1)* TA/ ns;
-	xs1= rada* cosl( ang);
-	zs1= rada* sinl( ang);
+	xs1= rada* cos( ang);
+	zs1= rada* sin( ang);
 
 	for( i = ist; i < data.n; i++ )
 	{
 	  ang += dang;
-	  xs2= rada* cosl( ang);
-	  zs2= rada* sinl( ang);
+	  xs2= rada* cos( ang);
+	  zs2= rada* sin( ang);
 	  data.x1[i]= xs1;
 
 	  data.y1[i]=0.;
@@ -94,7 +88,7 @@ void arc( int itg, int ns, long double rada,
 
 	} /* for( i = ist; i < data.n; i++ ) */
 
-  } /* if( fabsl( ang2- ang1) < 360.00001) */
+  } /* if( fabs( ang2- ang1) < 360.00001) */
   else
   {
 	fprintf( output_fp, "\n  ERROR -- ARC ANGLE EXCEEDS 360 DEGREES");
@@ -110,9 +104,10 @@ void arc( int itg, int ns, long double rada,
 /* icon2 by searching for segment ends that are in contact. */
 void conect( int ignd )
 {
-  int i, iz, ic, j, jx, ix, ixx, iseg, iend, jend, nsflg, jump, ipf;
-  long double sep=0., xi1, yi1, zi1, xi2, yi2, zi2;
-  long double slen, xa, ya, za, xs, ys, zs;
+  int i, iz, ic, j, jx, ix, ixx, iseg, iend, jend, jump, ipf;
+  double sep=0., xi1, yi1, zi1, xi2, yi2, zi2;
+  double slen, xa, ya, za, xs, ys, zs;
+  size_t mreq;
 
   segj.maxcon = 1;
 
@@ -137,7 +132,7 @@ void conect( int ignd )
 	  data.mp= data.m;
 	}
 
-	/*** possibly should be error condition?? **/
+	/** possibly should be error condition?? **/
 	if( data.np > data.n)
 	{
 	  fprintf( output_fp,
@@ -153,8 +148,10 @@ void conect( int ignd )
   if( data.n != 0)
   {
 	/* Allocate memory to connections */
-	mem_realloc( (void *)&data.icon1, (data.n+data.m) * sizeof(int) );
-	mem_realloc( (void *)&data.icon2, (data.n+data.m) * sizeof(int) );
+	mreq = (size_t)(data.n + data.m);
+	mreq *= sizeof(int);
+	mem_realloc( (void *)&data.icon1, mreq );
+	mem_realloc( (void *)&data.icon2, mreq );
 
 	for( i = 0; i < data.n; i++ )
 	{
@@ -166,7 +163,7 @@ void conect( int ignd )
 	  xi2= data.x2[i];
 	  yi2= data.y2[i];
 	  zi2= data.z2[i];
-	  slen= sqrtl( (xi2- xi1)*(xi2- xi1) + (yi2- yi1) *
+	  slen= sqrt( (xi2- xi1)*(xi2- xi1) + (yi2- yi1) *
 		  (yi2- yi1) + (zi2- zi1)*(zi2- zi1) ) * SMIN;
 
 	  /* determine connection data for end 1 of segment. */
@@ -191,7 +188,7 @@ void conect( int ignd )
 
 	  } /* if( ignd > 0) */
 
-	  if( ! jump )
+	  if( !jump )
 	  {
 		ic= i;
 		for( j = 1; j < data.n; j++)
@@ -200,14 +197,14 @@ void conect( int ignd )
 		  if( ic >= data.n)
 			ic=0;
 
-		  sep= fabsl( xi1- data.x1[ic])+ fabsl(yi1- data.y1[ic])+ fabsl(zi1- data.z1[ic]);
+		  sep= fabs( xi1- data.x1[ic])+ fabs(yi1- data.y1[ic])+ fabs(zi1- data.z1[ic]);
 		  if( sep <= slen)
 		  {
 			data.icon1[i]= -(ic+1);
 			break;
 		  }
 
-		  sep= fabsl( xi1- data.x2[ic])+ fabsl(yi1- data.y2[ic])+ fabsl(zi1- data.z2[ic]);
+		  sep= fabs( xi1- data.x2[ic])+ fabs(yi1- data.y2[ic])+ fabs(zi1- data.z2[ic]);
 		  if( sep <= slen)
 		  {
 			data.icon1[i]= (ic+1);
@@ -254,14 +251,14 @@ void conect( int ignd )
 		if( ic >= data.n)
 		  ic=0;
 
-		sep= fabsl(xi2- data.x1[ic])+ fabsl(yi2- data.y1[ic])+ fabsl(zi2- data.z1[ic]);
+		sep= fabs(xi2- data.x1[ic])+ fabs(yi2- data.y1[ic])+ fabs(zi2- data.z1[ic]);
 		if( sep <= slen)
 		{
 		  data.icon2[i]= (ic+1);
 		  break;
 		}
 
-		sep= fabsl(xi2- data.x2[ic])+ fabsl(yi2- data.y2[ic])+ fabsl(zi2- data.z2[ic]);
+		sep= fabs(xi2- data.x2[ic])+ fabs(yi2- data.y2[ic])+ fabs(zi2- data.z2[ic]);
 		if( sep <= slen)
 		{
 		  data.icon2[i]= -(ic+1);
@@ -294,8 +291,8 @@ void conect( int ignd )
 		  zi2= data.z2[iseg];
 
 		  /* for first end of segment */
-		  slen=( fabsl(xi2- xi1)+ fabsl(yi2- yi1)+ fabsl(zi2- zi1))* SMIN;
-		  sep= fabsl(xi1- xs)+ fabsl(yi1- ys)+ fabsl(zi1- zs);
+		  slen=( fabs(xi2- xi1)+ fabs(yi2- yi1)+ fabs(zi2- zi1))* SMIN;
+		  sep= fabs(xi1- xs)+ fabs(yi1- ys)+ fabs(zi1- zs);
 
 		  /* connection - divide patch into 4 patches at present array loc. */
 		  if( sep <= slen)
@@ -306,7 +303,7 @@ void conect( int ignd )
 			break;
 		  }
 
-		  sep= fabsl(xi2- xs)+ fabsl(yi2- ys)+ fabsl(zi2- zs);
+		  sep= fabs(xi2- xs)+ fabs(yi2- ys)+ fabs(zi2- zs);
 		  if( sep <= slen)
 		  {
 			data.icon2[iseg]=PCHCON+ i;
@@ -362,7 +359,9 @@ void conect( int ignd )
 	return;
 
   /* Allocate to connection buffers */
-  mem_realloc( (void *)&segj.jco, segj.maxcon * sizeof(int) );
+  mreq = (size_t)segj.maxcon;
+  mreq *= sizeof(int);
+  mem_realloc( (void *)&segj.jco, mreq );
 
   /* adjust connected seg. ends to exactly coincide.  print junctions */
   /* of 3 or more seg.  also find old seg. connecting to new seg. */
@@ -380,21 +379,19 @@ void conect( int ignd )
 	ya= data.y1[j];
 	za= data.z1[j];
 
+	/* if( ix == 0 ) Not needed??
+	{
+	  fprintf( output_fp,
+		  "\n  CONNECT - SEGMENT CONNECTION ERROR FOR SEGMENT: %d", ix );
+	  stop(-1);
+	} */
+
 	while( TRUE )
 	{
 	  if( (ix != 0) && (ix != (j+1)) && (ix <= PCHCON) )
 	  {
-		nsflg=0;
-
 		do
 		{
-		  if( ix == 0 )
-		  {
-			fprintf( output_fp,
-				"\n  CONNECT - SEGMENT CONNECTION ERROR FOR SEGMENT: %d", ix );
-			stop(-1);
-		  }
-
 		  if( ix < 0 )
 			ix= -ix;
 		  else
@@ -416,13 +413,12 @@ void conect( int ignd )
 		  if( ic >= segj.maxcon )
 		  {
 			segj.maxcon = ic+1;
-			mem_realloc( (void *)&segj.jco, segj.maxcon * sizeof(int) );
+			mreq = (size_t)segj.maxcon;
+			mreq *= sizeof(int);
+			mem_realloc( (void *)&segj.jco, mreq );
 		  }
 		  segj.jco[ic-1]= ix* jend;
 
-		  if( ix > 0)
-			nsflg=1;
-
 		  ixx = ix-1;
 		  if( jend != 1)
 		  {
@@ -457,7 +453,7 @@ void conect( int ignd )
 			continue;
 		  }
 
-		sep= (long double)ic;
+		sep= (double)ic;
 		xa= xa/ sep;
 		ya= ya/ sep;
 		za= za/ sep;
@@ -467,7 +463,7 @@ void conect( int ignd )
 		  ix= segj.jco[i];
 		  if( ix <= 0)
 		  {
-			ix=- ix;
+			ix= -ix;
 			ixx = ix-1;
 			data.x1[ixx]= xa;
 			data.y1[ixx]= ya;
@@ -522,9 +518,11 @@ void conect( int ignd )
 
   } /* for( j = 0; j < data.n; j++ ) */
 
-  mem_realloc( (void *)&segj.ax, segj.maxcon * sizeof(long double) );
-  mem_realloc( (void *)&segj.bx, segj.maxcon * sizeof(long double) );
-  mem_realloc( (void *)&segj.cx, segj.maxcon * sizeof(long double) );
+  mreq = (size_t)segj.maxcon;
+  mreq *= sizeof(double);
+  mem_realloc( (void *)&segj.ax, mreq );
+  mem_realloc( (void *)&segj.bx, mreq );
+  mem_realloc( (void *)&segj.cx, mreq );
 
   return;
 }
@@ -540,18 +538,19 @@ void datagn( void )
 
   /* input card mnemonic list */
   /* "XT" stands for "exit", added for testing */
-#define GM_NUM  12
+  #define GM_NUM  12
   char *atst[GM_NUM] =
   {
 	"GW", "GX", "GR", "GS", "GE", "GM", \
 	  "SP", "SM", "GA", "SC", "GH", "GF"
   };
 
-  int nwire, isct, iphd, i1, i2, itg, iy, iz, mreq;
+  int nwire, isct, iphd, i1, i2, itg, iy, iz;
+  size_t mreq;
   int ix, i, ns, gm_num; /* geometry card id as a number */
-  long double rad, xs1, xs2, ys1, ys2, zs1, zs2, x4=0, y4=0, z4=0;
-  long double x3=0, y3=0, z3=0, xw1, xw2, yw1, yw2, zw1, zw2;
-  long double dummy;
+  double rad, xs1, xs2, ys1, ys2, zs1, zs2, x4=0, y4=0, z4=0;
+  double x3=0, y3=0, z3=0, xw1, xw2, yw1, yw2, zw1, zw2;
+  double dummy;
 
   data.ipsym=0;
   nwire=0;
@@ -606,11 +605,11 @@ void datagn( void )
 		i2= data.n+ ns;
 
 		fprintf( output_fp, "\n"
-			" %5d  %10.4LF %10.4LF %10.4LF %10.4LF"
-			" %10.4LF %10.4LF %10.4LF %5d %5d %5d %4d",
+			" %5d  %10.5f %10.5f %10.5f %10.5f"
+			" %10.5f %10.5f %10.5f %5d %5d %5d %4d",
 			nwire, xw1, yw1, zw1, xw2, yw2, zw2, rad, ns, i1, i2, itg );
 
-		if( rad != 0)
+		if( rad != 0.0 )
 		{
 		  xs1=1.;
 		  ys1=1.;
@@ -627,18 +626,18 @@ void datagn( void )
 		  }
 
 		  fprintf( output_fp,
-			  "\n  ABOVE WIRE IS TAPERED.  SEGMENT LENGTH RATIO: %9.5LF\n"
+			  "\n  ABOVE WIRE IS TAPERED.  SEGMENT LENGTH RATIO: %9.5f\n"
 			  "                                 "
-			  "RADIUS FROM: %9.5LF TO: %9.5LF", xs1, ys1, zs1 );
+			  "RADIUS FROM: %9.5f TO: %9.5f", xs1, ys1, zs1 );
 
-		  if( (ys1 == 0) || (zs1 == 0) )
+		  if( (ys1 == 0.0) || (zs1 == 0.0) )
 		  {
 			fprintf( output_fp, "\n  GEOMETRY DATA CARD ERROR" );
 			stop(-1);
 		  }
 
 		  rad= ys1;
-		  ys1= powl( (zs1/ys1), (1./(ns-1.)) );
+		  ys1= pow( (zs1/ys1), (1./(ns-1.)) );
 		}
 
 		wire( xw1, yw1, zw1, xw2, yw2, zw2, rad, xs1, ys1, ns, itg);
@@ -662,8 +661,8 @@ void datagn( void )
 		  iz=1;
 
 		fprintf( output_fp,
-			"\n  STRUCTURE REFLECTED ALONG THE AXES %c %c %c"
-			" - TAGS INCREMENTED BY %d\n",
+			"\n      STRUCTURE REFLECTED ALONG THE AXES %c %c %c"
+			" - TAGS INCREMENTED BY %d",
 			ifx[ix], ify[iy], ifz[iz], itg );
 
 		reflc( ix, iy, iz, itg, ns);
@@ -674,10 +673,11 @@ void datagn( void )
 
 		fprintf( output_fp,
 			"\n  STRUCTURE ROTATED ABOUT Z-AXIS %d TIMES"
-			" - LABELS INCREMENTED BY %d\n", ns, itg );
+			" - LABELS INCREMENTED BY %d", ns, itg );
 
-		ix=-1;
+		ix =-1;
 		iz = 0;
+		iy = 0;
 		reflc( ix, iy, iz, itg, ns);
 
 		continue;
@@ -711,7 +711,7 @@ void datagn( void )
 		} /* if( data.m >= m2) */
 
 		fprintf( output_fp,
-			"\n     STRUCTURE SCALED BY FACTOR: %10.5LF", xw1 );
+			"\n     STRUCTURE SCALED BY FACTOR: %10.5f", xw1 );
 
 		continue;
 
@@ -728,7 +728,8 @@ void datagn( void )
 		if( data.n != 0)
 		{
 		  /* Allocate wire buffers */
-		  mreq = data.n * sizeof(long double);
+		  mreq = (size_t)data.n;
+		  mreq *= sizeof(double);
 		  mem_realloc( (void *)&data.si, mreq );
 		  mem_realloc( (void *)&data.sab, mreq );
 		  mem_realloc( (void *)&data.cab, mreq );
@@ -760,7 +761,7 @@ void datagn( void )
 			data.y[i]=( data.y1[i]+ data.y2[i])/2.;
 			data.z[i]=( data.z1[i]+ data.z2[i])/2.;
 			xw2= xw1* xw1+ yw1* yw1+ zw1* zw1;
-			yw2= sqrtl( xw2);
+			yw2= sqrt( xw2);
 			yw2=( xw2/ yw2+ yw2)*.5;
 			data.si[i]= yw2;
 			data.cab[i]= xw1/ yw2;
@@ -773,18 +774,18 @@ void datagn( void )
 			  xw2=-1.;
 
 			data.salp[i]= xw2;
-			xw2= asinl( xw2)* TD;
-			yw2= atan2l( yw1, xw1)* TD;
+			xw2= asin( xw2)* TD;
+			yw2= atan2( yw1, xw1)* TD;
 
 			fprintf( output_fp, "\n"
-				" %5d %9.4LF %9.4LF %9.4LF %9.4LF"
-				" %9.4LF %9.4LF %9.4LF %5d %5d %5d %5d",
+				" %5d %9.4f %9.4f %9.4f %9.4f"
+				" %9.4f %9.4f %9.4f %5d %5d %5d %5d",
 				i+1, data.x[i], data.y[i], data.z[i], data.si[i], xw2, yw2,
 				data.bi[i], data.icon1[i], i+1, data.icon2[i], data.itag[i] );
 
 			if( plot.iplp1 == 1)
-			  fprintf( plot_fp, "%12.4LE %12.4LE %12.4LE "
-				  "%12.4LE %12.4LE %12.4LE %12.4LE %5d %5d %5d\n",
+			  fprintf( plot_fp, "%12.4E %12.4E %12.4E "
+				  "%12.4E %12.4E %12.4E %12.4E %5d %5d %5d\n",
 				  data.x[i],data.y[i],data.z[i],data.si[i],xw2,yw2,
 				  data.bi[i],data.icon1[i],i+1,data.icon2[i] );
 
@@ -817,8 +818,8 @@ void datagn( void )
 			zw1=( data.t1x[i]* data.t2y[i]- data.t1y[i]* data.t2x[i])* data.psalp[i];
 
 			fprintf( output_fp, "\n"
-				" %4d %10.5LF %10.5LF %10.5LF  %8.4LF %8.4LF %8.4LF"
-				" %10.5LF  %8.4LF %8.4LF %8.4LF  %8.4LF %8.4LF %8.4LF",
+				" %4d %10.5f %10.5f %10.5f  %8.4f %8.4f %8.4f"
+				" %10.5f  %8.4f %8.4f %8.4f  %8.4f %8.4f %8.4f",
 				i+1, data.px[i], data.py[i], data.pz[i], xw1, yw1, zw1, data.pbi[i],
 				data.t1x[i], data.t1y[i], data.t1z[i], data.t2x[i], data.t2y[i], data.t2z[i] );
 
@@ -838,7 +839,7 @@ void datagn( void )
 
 		fprintf( output_fp,
 			"\n     THE STRUCTURE HAS BEEN MOVED, MOVE DATA CARD IS:\n"
-			"   %3d %5d %10.5LF %10.5LF %10.5LF %10.5LF %10.5LF %10.5LF %10.5LF",
+			"   %3d %5d %10.5f %10.5f %10.5f %10.5f %10.5f %10.5f %10.5f",
 			itg, ns, xw1, yw1, zw1, xw2, yw2, zw2, rad );
 
 		xw1= xw1* TA;
@@ -860,7 +861,7 @@ void datagn( void )
 		}
 
 		fprintf( output_fp, "\n"
-			" %5d%c %10.5LF %10.5LF %10.5LF %10.5LF %10.5LF %10.5LF",
+			" %5d%c %10.5f %10.5f %10.5f %10.5f %10.5f %10.5f",
 			i1, ipt[ns-1], xw1, yw1, zw1, xw2, yw2, zw2 );
 
 		if( (ns == 2) || (ns == 4) )
@@ -878,7 +879,7 @@ void datagn( void )
 		  }
 
 		  fprintf( output_fp, "\n"
-			  "      %11.5LF %11.5LF %11.5LF %11.5LF %11.5LF %11.5LF",
+			  "      %11.5f %11.5f %11.5f %11.5f %11.5f %11.5f",
 			  x3, y3, z3, x4, y4, z4 );
 
 		  if( strcmp(gm, "SC") != 0 )
@@ -902,7 +903,7 @@ void datagn( void )
 
 		i1= data.m+1;
 		fprintf( output_fp, "\n"
-			" %5d%c %10.5LF %11.5LF %11.5LF %11.5LF %11.5LF %11.5LF"
+			" %5d%c %10.5f %11.5f %11.5f %11.5f %11.5f %11.5f"
 			"     SURFACE - %d BY %d PATCHES",
 			i1, ipt[1], xw1, yw1, zw1, xw2, yw2, zw2, itg, ns );
 
@@ -922,7 +923,7 @@ void datagn( void )
 		}
 
 		fprintf( output_fp, "\n"
-			"      %11.5LF %11.5LF %11.5LF %11.5LF %11.5LF %11.5LF",
+			"      %11.5f %11.5f %11.5f %11.5f %11.5f %11.5f",
 			x3, y3, z3, x4, y4, z4 );
 
 		if( strcmp(gm, "SC" ) != 0 )
@@ -942,8 +943,8 @@ void datagn( void )
 		i2= data.n+ ns;
 
 		fprintf( output_fp, "\n"
-			" %5d  ARC RADIUS: %9.5LF  FROM: %8.3LF TO: %8.3LF DEGREES"
-			"       %11.5LF %5d %5d %5d %4d",
+			" %5d ARC RADIUS: %9.5f  FROM: %8.3f TO: %8.3f DEGREES"
+			"       %11.5f %5d %5d %5d %4d",
 			nwire, xw1, yw1, zw1, xw2, ns, i1, i2, itg );
 
 		arc( itg, ns, xw1, yw1, zw1, xw2);
@@ -999,11 +1000,11 @@ void datagn( void )
 		}
 
 		fprintf( output_fp, "\n"
-			" %5d%c %10.5LF %11.5LF %11.5LF %11.5LF %11.5LF %11.5LF",
+			" %5d%c %10.5f %11.5f %11.5f %11.5f %11.5f %11.5f",
 			i1, ipt[ns-1], xw1, yw1, zw1, xw2, yw2, zw2 );
 
 		fprintf( output_fp, "\n"
-			"      %11.5LF %11.5LF %11.5LF  %11.5LF %11.5LF %11.5LF",
+			"      %11.5f %11.5f %11.5f  %11.5f %11.5f %11.5f",
 			x3, y3, z3, x4, y4, z4 );
 
 		patch( itg, ns, xw1, yw1, zw1, xw2, yw2, zw2, x3, y3, z3, x4, y4, z4);
@@ -1017,9 +1018,9 @@ void datagn( void )
 		i2= data.n+ ns;
 
 		fprintf( output_fp, "\n"
-			" %5d HELIX STRUCTURE - SPACING OF TURNS: %8.3LF AXIAL"
-			" LENGTH: %8.3LF  %8.3LF %5d %5d %5d %4d\n      "
-			" RADIUS X1:%8.3LF Y1:%8.3LF X2:%8.3LF Y2:%8.3LF ",
+			" %5d HELIX STRUCTURE - SPACING OF TURNS: %8.3f AXIAL"
+			" LENGTH: %8.3f  %8.3f %5d %5d %5d %4d\n      "
+			" RADIUS X1:%8.3f Y1:%8.3f X2:%8.3f Y2:%8.3f ",
 			nwire, xw1, yw1, rad, ns, i1, i2, itg, zw1, xw2, yw2, zw2 );
 
 		helix( xw1, yw1, zw1, xw2, yw2, zw2, rad, ns, itg);
@@ -1033,7 +1034,7 @@ void datagn( void )
 
 		fprintf( output_fp, "\n  GEOMETRY DATA CARD ERROR" );
 		fprintf( output_fp, "\n"
-			" %2s %3d %5d %10.5LF %10.5LF %10.5LF %10.5LF %10.5LF %10.5LF %10.5LF",
+			" %2s %3d %5d %10.5f %10.5f %10.5f %10.5f %10.5f %10.5f %10.5f",
 			gm, itg, ns, xw1, yw1, zw1, xw2, yw2, zw2, rad );
 
 		stop(-1);
@@ -1043,18 +1044,18 @@ void datagn( void )
   } /* do */
   while( TRUE );
 
-  return;
 }
 
 /*-----------------------------------------------------------------------*/
 
 /* subroutine helix generates segment geometry */
 /* data for a helix of ns segments */
-void helix( long double s, long double hl, long double a1, long double b1,
-	long double a2, long double b2, long double rad, int ns, int itg )
+void helix( double s, double hl, double a1, double b1,
+	double a2, double b2, double rad, int ns, int itg )
 {
-  int ist, i, mreq;
-  long double turns, zinc, copy, sangle, hdia, turn, pitch, hmaj, hmin;
+  int ist, i;
+  size_t mreq;
+  double zinc, copy, sangle, hdia, turn, pitch, hmaj, hmin;
 
   ist= data.n;
   data.n += ns;
@@ -1065,14 +1066,16 @@ void helix( long double s, long double hl, long double a1, long double b1,
   if( ns < 1)
 	return;
 
-  turns= fabsl( hl/ s);
-  zinc= fabsl( hl/ ns);
+  zinc= fabs( hl/ ns);
 
   /* Reallocate tags buffer */
-  mem_realloc( (void *)&data.itag, (data.n+data.m) * sizeof(int) );/*????*/
+  mreq = (size_t)(data.n + data.m);
+  mreq *= sizeof(int);
+  mem_realloc( (void *)&data.itag, mreq );
 
   /* Reallocate wire buffers */
-  mreq = data.n * sizeof(long double);
+  mreq = (size_t)data.n;
+  mreq *= sizeof(double);
   mem_realloc( (void *)&data.x1, mreq );
   mem_realloc( (void *)&data.y1, mreq );
   mem_realloc( (void *)&data.z1, mreq );
@@ -1092,25 +1095,25 @@ void helix( long double s, long double hl, long double a1, long double b1,
 
 	data.z2[i]= data.z1[i]+ zinc;
 
-	if( a2 == a1)
+	if( a2 == a1 )
 	{
 	  if( b1 == 0.)
 		b1= a1;
 
-	  data.x1[i]= a1* cosl(2.* PI* data.z1[i]/ s);
-	  data.y1[i]= b1* sinl(2.* PI* data.z1[i]/ s);
-	  data.x2[i]= a1* cosl(2.* PI* data.z2[i]/ s);
-	  data.y2[i]= b1* sinl(2.* PI* data.z2[i]/ s);
+	  data.x1[i]= a1* cos(2.* PI* data.z1[i]/ s);
+	  data.y1[i]= b1* sin(2.* PI* data.z1[i]/ s);
+	  data.x2[i]= a1* cos(2.* PI* data.z2[i]/ s);
+	  data.y2[i]= b1* sin(2.* PI* data.z2[i]/ s);
 	}
 	else
 	{
 	  if( b2 == 0.)
 		b2= a2;
 
-	  data.x1[i]=( a1+( a2- a1)* data.z1[i]/ fabsl( hl))* cosl(2.* PI* data.z1[i]/ s);
-	  data.y1[i]=( b1+( b2- b1)* data.z1[i]/ fabsl( hl))* sinl(2.* PI* data.z1[i]/ s);
-	  data.x2[i]=( a1+( a2- a1)* data.z2[i]/ fabsl( hl))* cosl(2.* PI* data.z2[i]/ s);
-	  data.y2[i]=( b1+( b2- b1)* data.z2[i]/ fabsl( hl))* sinl(2.* PI* data.z2[i]/ s);
+	  data.x1[i]=( a1+( a2- a1)* data.z1[i]/ fabs( hl))* cos(2.* PI* data.z1[i]/ s);
+	  data.y1[i]=( b1+( b2- b1)* data.z1[i]/ fabs( hl))* sin(2.* PI* data.z1[i]/ s);
+	  data.x2[i]=( a1+( a2- a1)* data.z2[i]/ fabs( hl))* cos(2.* PI* data.z2[i]/ s);
+	  data.y2[i]=( b1+( b2- b1)* data.z2[i]/ fabs( hl))* sin(2.* PI* data.z2[i]/ s);
 
 	} /* if( a2 == a1) */
 
@@ -1128,9 +1131,9 @@ void helix( long double s, long double hl, long double a1, long double b1,
 
   if( a2 != a1)
   {
-	sangle= atanl( a2/( fabsl( hl)+( fabsl( hl)* a1)/( a2- a1)));
+	sangle= atan( a2/( fabs( hl)+( fabs( hl)* a1)/( a2- a1)));
 	fprintf( output_fp,
-		"\n       THE CONE ANGLE OF THE SPIRAL IS %10.4LF", sangle );
+		"\n       THE CONE ANGLE OF THE SPIRAL IS %10.4f", sangle );
 	return;
   }
 
@@ -1138,8 +1141,8 @@ void helix( long double s, long double hl, long double a1, long double b1,
   {
 	hdia=2.* a1;
 	turn= hdia* PI;
-	pitch= atanl( s/( PI* hdia));
-	turn= turn/ cosl( pitch);
+	pitch= atan( s/( PI* hdia));
+	turn= turn/ cos( pitch);
 	pitch=180.* pitch/ PI;
   }
   else
@@ -1155,14 +1158,14 @@ void helix( long double s, long double hl, long double a1, long double b1,
 	  hmin=2.* a1;
 	}
 
-	hdia= sqrtl(( hmaj*hmaj+ hmin*hmin)/2* hmaj);
+	hdia= sqrt(( hmaj*hmaj+ hmin*hmin)/2* hmaj);
 	turn=2.* PI* hdia;
-	pitch=(180./ PI)* atanl( s/( PI* hdia));
+	pitch=(180./ PI)* atan( s/( PI* hdia));
 
   } /* if( a1 == b1) */
 
   fprintf( output_fp, "\n"
-	  "       THE PITCH ANGLE IS: %.4LF    THE LENGTH OF WIRE/TURN IS: %.4LF",
+	  "       THE PITCH ANGLE IS: %.4f    THE LENGTH OF WIRE/TURN IS: %.4f",
 	  pitch, turn );
 
   return;
@@ -1174,7 +1177,7 @@ void helix( long double s, long double hl, long double a1, long double b1,
 /* tag number itagi.  if itagi=0 segment number m is returned. */
 int isegno( int itagi, int mx)
 {
-  int icnt, i, iseg;
+  int icnt, iseg;
 
   if( mx <= 0)
   {
@@ -1193,6 +1196,7 @@ int isegno( int itagi, int mx)
 
   if( data.n > 0)
   {
+	int i;
 	for( i = 0; i < data.n; i++ )
 	{
 	  if( data.itag[i] != itagi )
@@ -1222,29 +1226,30 @@ int isegno( int itagi, int mx)
 /* coordinate system or reproduces structure in new positions. */
 /* structure is rotated about x,y,z axes by rox,roy,roz */
 /* respectively, then shifted by xs,ys,zs */
-void move( long double rox, long double roy, long double roz, long double xs,
-	long double ys, long double zs, int its, int nrpt, int itgi )
+void move( double rox, double roy, double roz, double xs,
+	double ys, double zs, int its, int nrpt, int itgi )
 {
-  int nrp, ix, i1, k, ir, i, ii, mreq;
-  long double sps, cps, sth, cth, sph, cph, xx, xy;
-  long double xz, yx, yy, yz, zx, zy, zz, xi, yi, zi;
+  int nrp, ix, i1, k, i;
+  size_t mreq;
+  double sps, cps, sth, cth, sph, cph, xx, xy;
+  double xz, yx, yy, yz, zx, zy, zz, xi, yi, zi;
 
-  if( fabsl( rox)+ fabsl( roy) > 1.0e-10)
+  if( fabs( rox)+ fabs( roy) > 1.0e-10)
 	data.ipsym= data.ipsym*3;
 
-  sps= sinl( rox);
-  cps= cosl( rox);
-  sth= sinl( roy);
-  cth= cosl( roy);
-  sph= sinl( roz);
-  cph= cosl( roz);
+  sps= sin( rox);
+  cps= cos( rox);
+  sth= sin( roy);
+  cth= cos( roy);
+  sph= sin( roz);
+  cph= cos( roz);
   xx= cph* cth;
   xy= cph* sth* sps- sph* cps;
   xz= cph* sth* cps+ sph* sps;
   yx= sph* cth;
   yy= sph* sth* sps+ cph* cps;
   yz= sph* sth* cps- cph* sps;
-  zx=- sth;
+  zx= -sth;
   zy= cth* sps;
   zz= cth* cps;
 
@@ -1256,6 +1261,7 @@ void move( long double rox, long double roy, long double roz, long double xs,
   ix=1;
   if( data.n > 0)
   {
+	int ir;
 	i1= isegno( its, 1);
 	if( i1 < 1)
 	  i1= 1;
@@ -1267,11 +1273,13 @@ void move( long double rox, long double roy, long double roz, long double xs,
 	{
 	  k= data.n;
 	  /* Reallocate tags buffer */
-	  mreq = data.n+data.m + (data.n+1-i1)*nrpt;
-	  mem_realloc( (void *)&data.itag, mreq * sizeof(int) );
+	  mreq = (size_t)(data.n + data.m + (data.n + 1 - i1) * nrpt);
+	  mreq *= sizeof(int);
+	  mem_realloc( (void *)&data.itag, mreq );
 
 	  /* Reallocate wire buffers */
-	  mreq = (data.n+(data.n+1-i1)*nrpt) * sizeof(long double);
+	  mreq = (size_t)(data.n + (data.n + 1 - i1) * nrpt);
+	  mreq *= sizeof(double);
 	  mem_realloc( (void *)&data.x1, mreq );
 	  mem_realloc( (void *)&data.y1, mreq );
 	  mem_realloc( (void *)&data.z1, mreq );
@@ -1315,6 +1323,7 @@ void move( long double rox, long double roy, long double roz, long double xs,
 
   if( data.m > 0)
   {
+	int ii;
 	i1 = 0;
 	if( nrpt == 0)
 	  k= 0;
@@ -1322,7 +1331,8 @@ void move( long double rox, long double roy, long double roz, long double xs,
 	  k = data.m;
 
 	/* Reallocate patch buffers */
-	mreq = data.m * (1+nrpt) * sizeof(long double);
+	mreq = (size_t)(data.m * (nrpt + 1));
+	mreq *= sizeof(double);
 	mem_realloc( (void *)&data.px, mreq );
 	mem_realloc( (void *)&data.py, mreq );
 	mem_realloc( (void *)&data.pz, mreq );
@@ -1384,14 +1394,15 @@ void move( long double rox, long double roy, long double roz, long double xs,
 
 /* patch generates and modifies patch geometry data */
 void patch( int nx, int ny,
-	long double ax1, long double ay1, long double az1,
-	long double ax2, long double ay2, long double az2,
-	long double ax3, long double ay3, long double az3,
-	long double ax4, long double ay4, long double az4 )
+	double ax1, double ay1, double az1,
+	double ax2, double ay2, double az2,
+	double ax3, double ay3, double az3,
+	double ax4, double ay4, double az4 )
 {
-  int mi, ntp, iy, ix, mreq;
-  long double s1x=0., s1y=0., s1z=0., s2x=0., s2y=0., s2z=0., xst=0.;
-  long double znv, xnv, ynv, xa, xn2, yn2, zn2, salpn, xs, ys, zs, xt, yt, zt;
+  int mi, ntp;
+  size_t mreq;
+  double s1x=0., s1y=0., s1z=0., s2x=0., s2y=0., s2z=0., xst=0.;
+  double znv, xnv, ynv, xa, xn2, yn2, zn2;
 
   /* new patches.  for nx=0, ny=1,2,3,4 patch is (respectively) */
   /* arbitrary, rectagular, triangular, or quadrilateral. */
@@ -1402,7 +1413,8 @@ void patch( int nx, int ny,
   mi= data.m-1;
 
   /* Reallocate patch buffers */
-  mreq = data.m * sizeof(long double);
+  mreq = (size_t)data.m;
+  mreq *= sizeof(double);
   mem_realloc( (void *)&data.px, mreq );
   mem_realloc( (void *)&data.py, mreq );
   mem_realloc( (void *)&data.pz, mreq );
@@ -1426,15 +1438,15 @@ void patch( int nx, int ny,
 	data.py[mi]= ay1;
 	data.pz[mi]= az1;
 	data.pbi[mi]= az2;
-	znv= cosl( ax2);
-	xnv= znv* cosl( ay2);
-	ynv= znv* sinl( ay2);
-	znv= sinl( ax2);
-	xa= sqrtl( xnv* xnv+ ynv* ynv);
+	znv= cos( ax2);
+	xnv= znv* cos( ay2);
+	ynv= znv* sin( ay2);
+	znv= sin( ax2);
+	xa= sqrt( xnv* xnv+ ynv* ynv);
 
 	if( xa >= 1.0e-6)
 	{
-	  data.t1x[mi]=- ynv/ xa;
+	  data.t1x[mi]= -ynv/ xa;
 	  data.t1y[mi]= xnv/ xa;
 	  data.t1z[mi]=0.;
 	}
@@ -1468,11 +1480,11 @@ void patch( int nx, int ny,
 	xnv= s1y* s2z- s1z* s2y;
 	ynv= s1z* s2x- s1x* s2z;
 	znv= s1x* s2y- s1y* s2x;
-	xa= sqrtl( xnv* xnv+ ynv* ynv+ znv* znv);
+	xa= sqrt( xnv* xnv+ ynv* ynv+ znv* znv);
 	xnv= xnv/ xa;
 	ynv= ynv/ xa;
 	znv= znv/ xa;
-	xst= sqrtl( s1x* s1x+ s1y* s1y+ s1z* s1z);
+	xst= sqrt( s1x* s1x+ s1y* s1y+ s1z* s1z);
 	data.t1x[mi]= s1x/ xst;
 	data.t1y[mi]= s1y/ xst;
 	data.t1z[mi]= s1z/ xst;
@@ -1495,6 +1507,7 @@ void patch( int nx, int ny,
 	  }
 	  else
 	  {
+		double salpn;
 		s1x= ax3- ax1;
 		s1y= ay3- ay1;
 		s1z= az3- az1;
@@ -1504,7 +1517,7 @@ void patch( int nx, int ny,
 		xn2= s1y* s2z- s1z* s2y;
 		yn2= s1z* s2x- s1x* s2z;
 		zn2= s1x* s2y- s1y* s2x;
-		xst= sqrtl( xn2* xn2+ yn2* yn2+ zn2* zn2);
+		xst= sqrt( xn2* xn2+ yn2* yn2+ zn2* zn2);
 		salpn=1./(3.*( xa+ xst));
 		data.px[mi]=( xa*( ax1+ ax2+ ax3)+ xst*( ax1+ ax3+ ax4))* salpn;
 		data.py[mi]=( xa*( ay1+ ay2+ ay3)+ xst*( ay1+ ay3+ ay4))* salpn;
@@ -1533,10 +1546,13 @@ void patch( int nx, int ny,
 
   if( nx != 0)
   {
-	data.m += nx*ny-1;
+	int iy, ix;
+	double xs, ys, zs, xt, yt, zt;
 
+	data.m += nx*ny-1;
 	/* Reallocate patch buffers */
-	mreq = data.m * sizeof(long double);
+	mreq = (size_t)data.m;
+	mreq *= sizeof(double);
 	mem_realloc( (void *)&data.px, mreq );
 	mem_realloc( (void *)&data.py, mreq );
 	mem_realloc( (void *)&data.pz, mreq );
@@ -1567,7 +1583,7 @@ void patch( int nx, int ny,
 
 	  for( ix = 1; ix <= nx; ix++ )
 	  {
-		xst= (long double)ix;
+		xst= (double)ix;
 		data.px[mi]= xn2+ xst* s1x;
 		data.py[mi]= yn2+ xst* s1y;
 		data.pz[mi]= zn2+ xst* s1z;
@@ -1598,8 +1614,9 @@ void patch( int nx, int ny,
 /*** this function was an 'entry point' (part of) 'patch()' ***/
 void subph( int nx, int ny )
 {
-  int mia, ix, iy, mi, mreq;
-  long double xs, ys, zs, xa, xst, s1x, s1y, s1z, s2x, s2y, s2z, saln, xt, yt;
+  int mia, ix, iy, mi;
+  size_t mreq;
+  double xs, ys, zs, xa, xst, s1x, s1y, s1z, s2x, s2y, s2z, saln, xt, yt;
 
   /* Reallocate patch buffers */
   if( ny == 0 )
@@ -1607,7 +1624,8 @@ void subph( int nx, int ny )
   else
 	data.m += 4;
 
-  mreq = data.m * sizeof(long double);
+  mreq = (size_t)data.m;
+  mreq *= sizeof(double);
   mem_realloc( (void *)&data.px, mreq );
   mem_realloc( (void *)&data.py, mreq );
   mem_realloc( (void *)&data.pz, mreq );
@@ -1619,9 +1637,10 @@ void subph( int nx, int ny )
   mem_realloc( (void *)&data.t2z, mreq );
   mem_realloc( (void *)&data.pbi, mreq );
   mem_realloc( (void *)&data.psalp, mreq );
-  mem_realloc( (void *)&data.icon1, (data.n+data.m) * sizeof(int) );
-  mem_realloc( (void *)&data.icon2, (data.n+data.m) * sizeof(int) );
-
+  mreq = (size_t)(data.n + data.m);
+  mreq *= sizeof(int);
+  mem_realloc( (void *)&data.icon1, mreq );
+  mem_realloc( (void *)&data.icon2, mreq );
 
   /* Shift patches to make room for new ones */
   if( (ny == 0) && (nx != data.m) )
@@ -1650,7 +1669,7 @@ void subph( int nx, int ny )
   ys= data.py[mi];
   zs= data.pz[mi];
   xa= data.pbi[mi]/4.;
-  xst= sqrtl( xa)/2.;
+  xst= sqrt( xa)/2.;
   s1x= data.t1x[mi];
   s1y= data.t1y[mi];
   s1z= data.t1z[mi];
@@ -1684,10 +1703,10 @@ void subph( int nx, int ny )
 	data.psalp[mia]= saln;
 
 	if( ix == 2)
-	  yt=- yt;
+	  yt= -yt;
 
 	if( (ix == 1) || (ix == 3) )
-	  xt=- xt;
+	  xt= -xt;
 
 	mia++;
   }
@@ -1703,21 +1722,21 @@ void subph( int nx, int ny )
 
 /*-----------------------------------------------------------------------*/
 
-void readgm( char *gm, int *i1, int *i2, long double *x1, long double *y1,
-	long double *z1, long double *x2, long double *y2, long double *z2, long double *rad )
+void readgm( char *gm, int *i1, int *i2, double *x1, double *y1,
+	double *z1, double *x2, double *y2, double *z2, double *rad )
 {
   char line_buf[134];
   int nlin, i, line_idx;
   int nint = 2, nflt = 7;
   int iarr[2] = { 0, 0 };
-  long double rarr[7] = { 0., 0., 0., 0., 0., 0., 0. };
+  double rarr[7] = { 0., 0., 0., 0., 0., 0., 0. };
 
 
   /* read a line from input file */
   load_line( line_buf, input_fp );
 
   /* get line length */
-  nlin= strlen( line_buf );
+  nlin= (int)strlen( line_buf );
 
   /* abort if card's mnemonic too short or missing */
   if( nlin < 2 )
@@ -1759,7 +1778,7 @@ void readgm( char *gm, int *i1, int *i2, long double *x1, long double *y1,
 		  (line_buf[  line_idx] >  '9')) &&
 		(line_buf[  line_idx] != '+')  &&
 		(line_buf[  line_idx] != '-') )
-	  if( (line_buf[line_idx] == '\0') )
+	  if( line_buf[line_idx] == '\0' )
 	  {
 		*i1= iarr[0];
 		*i2= iarr[1];
@@ -1816,7 +1835,7 @@ void readgm( char *gm, int *i1, int *i2, long double *x1, long double *y1,
 
   } /* for( i = 0; i < nint; i++ ) */
 
-  /* read long doubles from line */
+  /* read doubles from line */
   for( i = 0; i < nflt; i++ )
   {
 	/* Find first numerical character */
@@ -1825,7 +1844,7 @@ void readgm( char *gm, int *i1, int *i2, long double *x1, long double *y1,
 		(line_buf[  line_idx] != '+')  &&
 		(line_buf[  line_idx] != '-')  &&
 		(line_buf[  line_idx] != '.') )
-	  if( (line_buf[line_idx] == '\0') )
+	  if( line_buf[line_idx] == '\0' )
 	  {
 		*i1= iarr[0];
 		*i2= iarr[1];
@@ -1839,7 +1858,7 @@ void readgm( char *gm, int *i1, int *i2, long double *x1, long double *y1,
 		return;
 	  }
 
-	/* read a long double from line */
+	/* read a double from line */
 	rarr[i] = atof( &line_buf[line_idx] );
 
 	/* traverse numerical field to next ' ' or ',' or '\0' */
@@ -1904,8 +1923,9 @@ void readgm( char *gm, int *i1, int *i2, long double *x1, long double *y1,
 /* structure to complete a symmetric structure. */
 void reflc( int ix, int iy, int iz, int itx, int nop )
 {
-  int iti, i, nx, itagi, k, mreq;
-  long double e1, e2, fnop, sam, cs, ss, xk, yk;
+  int iti, i, nx, itagi, k;
+  size_t mreq;
+  double e1, e2, fnop, sam, cs, ss, xk, yk;
 
   data.np= data.n;
   data.mp= data.m;
@@ -1927,10 +1947,13 @@ void reflc( int ix, int iy, int iz, int itx, int nop )
 	  if( data.n > 0 )
 	  {
 		/* Reallocate tags buffer */
-		mem_realloc( (void *)&data.itag, (2*data.n+data.m) * sizeof(int) );
+		mreq = (size_t)(2 * data.n + data.m);
+		mreq *= sizeof(int);
+		mem_realloc( (void *)&data.itag, mreq );
 
 		/* Reallocate wire buffers */
-		mreq = 2*data.n * sizeof(long double);
+		mreq = (size_t)(2 * data.n);
+		mreq *= sizeof(double);
 		mem_realloc( (void *)&data.x1, mreq );
 		mem_realloc( (void *)&data.y1, mreq );
 		mem_realloc( (void *)&data.z1, mreq );
@@ -1945,7 +1968,7 @@ void reflc( int ix, int iy, int iz, int itx, int nop )
 		  e1= data.z1[i];
 		  e2= data.z2[i];
 
-		  if( (fabsl(e1)+fabsl(e2) <= 1.0e-5) || (e1*e2 < -1.0e-6) )
+		  if( (fabs(e1)+fabs(e2) <= 1.0e-5) || (e1*e2 < -1.0e-6) )
 		  {
 			fprintf( output_fp,
 				"\n  GEOMETRY DATA ERROR--SEGMENT %d"
@@ -1955,10 +1978,10 @@ void reflc( int ix, int iy, int iz, int itx, int nop )
 
 		  data.x1[nx]= data.x1[i];
 		  data.y1[nx]= data.y1[i];
-		  data.z1[nx]=- e1;
+		  data.z1[nx]= -e1;
 		  data.x2[nx]= data.x2[i];
 		  data.y2[nx]= data.y2[i];
-		  data.z2[nx]=- e2;
+		  data.z2[nx]= -e2;
 		  itagi= data.itag[i];
 
 		  if( itagi == 0)
@@ -1978,7 +2001,8 @@ void reflc( int ix, int iy, int iz, int itx, int nop )
 	  if( data.m > 0 )
 	  {
 		/* Reallocate patch buffers */
-		mreq = 2*data.m * sizeof(long double);
+		mreq = (size_t)(2 * data.m);
+		mreq *= sizeof(double);
 		mem_realloc( (void *)&data.px, mreq );
 		mem_realloc( (void *)&data.py, mreq );
 		mem_realloc( (void *)&data.pz, mreq );
@@ -1994,7 +2018,7 @@ void reflc( int ix, int iy, int iz, int itx, int nop )
 		for( i = 0; i < data.m; i++ )
 		{
 		  nx = i+data.m;
-		  if( fabsl(data.pz[i]) <= 1.0e-10)
+		  if( fabs(data.pz[i]) <= 1.0e-10)
 		  {
 			fprintf( output_fp,
 				"\n  GEOMETRY DATA ERROR--PATCH %d"
@@ -2004,14 +2028,14 @@ void reflc( int ix, int iy, int iz, int itx, int nop )
 
 		  data.px[nx]= data.px[i];
 		  data.py[nx]= data.py[i];
-		  data.pz[nx]=- data.pz[i];
+		  data.pz[nx]= -data.pz[i];
 		  data.t1x[nx]= data.t1x[i];
 		  data.t1y[nx]= data.t1y[i];
-		  data.t1z[nx]=- data.t1z[i];
+		  data.t1z[nx]= -data.t1z[i];
 		  data.t2x[nx]= data.t2x[i];
 		  data.t2y[nx]= data.t2y[i];
-		  data.t2z[nx]=- data.t2z[i];
-		  data.psalp[nx]=- data.psalp[i];
+		  data.t2z[nx]= -data.t2z[i];
+		  data.psalp[nx]= -data.psalp[i];
 		  data.pbi[nx]= data.pbi[i];
 		}
 
@@ -2027,10 +2051,13 @@ void reflc( int ix, int iy, int iz, int itx, int nop )
 	  if( data.n > 0)
 	  {
 		/* Reallocate tags buffer */
-		mem_realloc( (void *)&data.itag, (2*data.n+data.m) * sizeof(int) );/*????*/
+		mreq = (size_t)(2 * data.n + data.m);
+		mreq *= sizeof(int);
+		mem_realloc( (void *)&data.itag, mreq );
 
 		/* Reallocate wire buffers */
-		mreq = 2*data.n * sizeof(long double);
+		mreq = (size_t)(2 * data.n);
+		mreq *= sizeof(double);
 		mem_realloc( (void *)&data.x1, mreq );
 		mem_realloc( (void *)&data.y1, mreq );
 		mem_realloc( (void *)&data.z1, mreq );
@@ -2045,7 +2072,7 @@ void reflc( int ix, int iy, int iz, int itx, int nop )
 		  e1= data.y1[i];
 		  e2= data.y2[i];
 
-		  if( (fabsl(e1)+fabsl(e2) <= 1.0e-5) || (e1*e2 < -1.0e-6) )
+		  if( (fabs(e1)+fabs(e2) <= 1.0e-5) || (e1*e2 < -1.0e-6) )
 		  {
 			fprintf( output_fp,
 				"\n  GEOMETRY DATA ERROR--SEGMENT %d"
@@ -2054,10 +2081,10 @@ void reflc( int ix, int iy, int iz, int itx, int nop )
 		  }
 
 		  data.x1[nx]= data.x1[i];
-		  data.y1[nx]=- e1;
+		  data.y1[nx]= -e1;
 		  data.z1[nx]= data.z1[i];
 		  data.x2[nx]= data.x2[i];
-		  data.y2[nx]=- e2;
+		  data.y2[nx]= -e2;
 		  data.z2[nx]= data.z2[i];
 		  itagi= data.itag[i];
 
@@ -2078,7 +2105,8 @@ void reflc( int ix, int iy, int iz, int itx, int nop )
 	  if( data.m > 0 )
 	  {
 		/* Reallocate patch buffers */
-		mreq = 2*data.m * sizeof(long double);
+		mreq = (size_t)(2 * data.m);
+		mreq *= sizeof(double);
 		mem_realloc( (void *)&data.px, mreq );
 		mem_realloc( (void *)&data.py, mreq );
 		mem_realloc( (void *)&data.pz, mreq );
@@ -2094,7 +2122,7 @@ void reflc( int ix, int iy, int iz, int itx, int nop )
 		for( i = 0; i < data.m; i++ )
 		{
 		  nx= i+data.m;
-		  if( fabsl( data.py[i]) <= 1.0e-10)
+		  if( fabs( data.py[i]) <= 1.0e-10)
 		  {
 			fprintf( output_fp,
 				"\n  GEOMETRY DATA ERROR--PATCH %d"
@@ -2103,15 +2131,15 @@ void reflc( int ix, int iy, int iz, int itx, int nop )
 		  }
 
 		  data.px[nx]= data.px[i];
-		  data.py[nx]=- data.py[i];
+		  data.py[nx]= -data.py[i];
 		  data.pz[nx]= data.pz[i];
 		  data.t1x[nx]= data.t1x[i];
-		  data.t1y[nx]=- data.t1y[i];
+		  data.t1y[nx]= -data.t1y[i];
 		  data.t1z[nx]= data.t1z[i];
 		  data.t2x[nx]= data.t2x[i];
-		  data.t2y[nx]=- data.t2y[i];
+		  data.t2y[nx]= -data.t2y[i];
 		  data.t2z[nx]= data.t2z[i];
-		  data.psalp[nx]=- data.psalp[i];
+		  data.psalp[nx]= -data.psalp[i];
 		  data.pbi[nx]= data.pbi[i];
 
 		} /* for( i = m2; i <= data.m; i++ ) */
@@ -2129,10 +2157,13 @@ void reflc( int ix, int iy, int iz, int itx, int nop )
 	if( data.n > 0 )
 	{
 	  /* Reallocate tags buffer */
-	  mem_realloc( (void *)&data.itag, (2*data.n+data.m) * sizeof(int) );/*????*/
+	  mreq = (size_t)(2 * data.n + data.m);
+	  mreq *= sizeof(int);
+	  mem_realloc( (void *)&data.itag, mreq );
 
 	  /* Reallocate wire buffers */
-	  mreq = 2*data.n * sizeof(long double);
+	  mreq = (size_t)(2 * data.n);
+	  mreq *= sizeof(double);
 	  mem_realloc( (void *)&data.x1, mreq );
 	  mem_realloc( (void *)&data.y1, mreq );
 	  mem_realloc( (void *)&data.z1, mreq );
@@ -2147,7 +2178,7 @@ void reflc( int ix, int iy, int iz, int itx, int nop )
 		e1= data.x1[i];
 		e2= data.x2[i];
 
-		if( (fabsl(e1)+fabsl(e2) <= 1.0e-5) || (e1*e2 < -1.0e-6) )
+		if( (fabs(e1)+fabs(e2) <= 1.0e-5) || (e1*e2 < -1.0e-6) )
 		{
 		  fprintf( output_fp,
 			  "\n  GEOMETRY DATA ERROR--SEGMENT %d"
@@ -2155,10 +2186,10 @@ void reflc( int ix, int iy, int iz, int itx, int nop )
 		  stop(-1);
 		}
 
-		data.x1[nx]=- e1;
+		data.x1[nx]= -e1;
 		data.y1[nx]= data.y1[i];
 		data.z1[nx]= data.z1[i];
-		data.x2[nx]=- e2;
+		data.x2[nx]= -e2;
 		data.y2[nx]= data.y2[i];
 		data.z2[nx]= data.z2[i];
 		itagi= data.itag[i];
@@ -2179,7 +2210,8 @@ void reflc( int ix, int iy, int iz, int itx, int nop )
 	  return;
 
 	/* Reallocate patch buffers */
-	mreq = 2*data.m * sizeof(long double);
+	mreq = (size_t)(2 * data.m);
+	mreq *= sizeof(double);
 	mem_realloc( (void *)&data.px, mreq );
 	mem_realloc( (void *)&data.py, mreq );
 	mem_realloc( (void *)&data.pz, mreq );
@@ -2195,7 +2227,7 @@ void reflc( int ix, int iy, int iz, int itx, int nop )
 	for( i = 0; i < data.m; i++ )
 	{
 	  nx= i+data.m;
-	  if( fabsl( data.px[i]) <= 1.0e-10)
+	  if( fabs( data.px[i]) <= 1.0e-10)
 	  {
 		fprintf( output_fp,
 			"\n  GEOMETRY DATA ERROR--PATCH %d"
@@ -2203,16 +2235,16 @@ void reflc( int ix, int iy, int iz, int itx, int nop )
 		stop(-1);
 	  }
 
-	  data.px[nx]=- data.px[i];
+	  data.px[nx]= -data.px[i];
 	  data.py[nx]= data.py[i];
 	  data.pz[nx]= data.pz[i];
-	  data.t1x[nx]=- data.t1x[i];
+	  data.t1x[nx]= -data.t1x[i];
 	  data.t1y[nx]= data.t1y[i];
 	  data.t1z[nx]= data.t1z[i];
-	  data.t2x[nx]=- data.t2x[i];
+	  data.t2x[nx]= -data.t2x[i];
 	  data.t2y[nx]= data.t2y[i];
 	  data.t2z[nx]= data.t2z[i];
-	  data.psalp[nx]=- data.psalp[i];
+	  data.psalp[nx]= -data.psalp[i];
 	  data.pbi[nx]= data.pbi[i];
 	}
 
@@ -2222,11 +2254,11 @@ void reflc( int ix, int iy, int iz, int itx, int nop )
   } /* if( ix >= 0) */
 
   /* reproduce structure with rotation to form cylindrical structure */
-  fnop= (long double)nop;
+  fnop= (double)nop;
   data.ipsym=-1;
   sam=TP/ fnop;
-  cs= cosl( sam);
-  ss= sinl( sam);
+  cs= cos( sam);
+  ss= sin( sam);
 
   if( data.n > 0)
   {
@@ -2234,10 +2266,13 @@ void reflc( int ix, int iy, int iz, int itx, int nop )
 	nx= data.np;
 
 	/* Reallocate tags buffer */
-	mem_realloc( (void *)&data.itag, (data.n+data.m) * sizeof(int) );/*????*/
+	mreq = (size_t)(data.n + data.m);
+	mreq *= sizeof(int);
+	mem_realloc( (void *)&data.itag, mreq );
 
 	/* Reallocate wire buffers */
-	mreq = data.n * sizeof(long double);
+	mreq = (size_t)data.n;
+	mreq *= sizeof(double);
 	mem_realloc( (void *)&data.x1, mreq );
 	mem_realloc( (void *)&data.y1, mreq );
 	mem_realloc( (void *)&data.z1, mreq );
@@ -2277,7 +2312,8 @@ void reflc( int ix, int iy, int iz, int itx, int nop )
   nx= data.mp;
 
   /* Reallocate patch buffers */
-  mreq = data.m * sizeof(long double);
+  mreq = (size_t)data.m;
+  mreq *= sizeof(double);
   mem_realloc( (void *)&data.px, mreq  );
   mem_realloc( (void *)&data.py, mreq  );
   mem_realloc( (void *)&data.pz, mreq );
@@ -2320,13 +2356,14 @@ void reflc( int ix, int iy, int iz, int itx, int nop )
 
 /* subroutine wire generates segment geometry */
 /* data for a straight wire of ns segments. */
-void wire( long double xw1, long double yw1, long double zw1,
-	long double xw2, long double yw2, long double zw2, long double rad,
-	long double rdel, long double rrad, int ns, int itg )
+void wire( double xw1, double yw1, double zw1,
+	double xw2, double yw2, double zw2, double rad,
+	double rdel, double rrad, int ns, int itg )
 {
-  int ist, i, mreq;
-  long double xd, yd, zd, delz, rd, fns, radz;
-  long double xs1, ys1, zs1, xs2, ys2, zs2;
+  int ist, i;
+  size_t mreq;
+  double xd, yd, zd, delz, rd, fns, radz;
+  double xs1, ys1, zs1, xs2, ys2, zs2;
 
   ist= data.n;
   data.n= data.n+ ns;
@@ -2338,10 +2375,13 @@ void wire( long double xw1, long double yw1, long double zw1,
 	return;
 
   /* Reallocate tags buffer */
-  mem_realloc( (void *)&data.itag, (data.n+data.m) * sizeof(int) );/*????*/
+  mreq = (size_t)(data.n + data.m);
+  mreq *= sizeof(int);
+  mem_realloc( (void *)&data.itag, mreq );
 
   /* Reallocate wire buffers */
-  mreq = data.n * sizeof(long double);
+  mreq = (size_t)data.n;
+  mreq *= sizeof(double);
   mem_realloc( (void *)&data.x1, mreq );
   mem_realloc( (void *)&data.y1, mreq );
   mem_realloc( (void *)&data.z1, mreq );
@@ -2354,13 +2394,13 @@ void wire( long double xw1, long double yw1, long double zw1,
   yd= yw2- yw1;
   zd= zw2- zw1;
 
-  if( fabsl( rdel-1.) >= 1.0e-6)
+  if( fabs( rdel-1.) >= 1.0e-6)
   {
-	delz= sqrtl( xd* xd+ yd* yd+ zd* zd);
+	delz= sqrt( xd* xd+ yd* yd+ zd* zd);
 	xd= xd/ delz;
 	yd= yd/ delz;
 	zd= zd/ delz;
-	delz= delz*(1.- rdel)/(1.- powl(rdel, ns) );
+	delz= delz*(1.- rdel)/(1.- pow(rdel, ns) );
 	rd= rdel;
   }
   else
diff --git a/ground.c b/ground.c
index 86577b5..a26e0a5 100644
--- a/ground.c
+++ b/ground.c
@@ -24,24 +24,7 @@
  *******************************************************************/
 
 #include "nec2c.h"
-
-/* pointers to input/output files */
-extern FILE *input_fp, *output_fp, *plot_fp;
-
-/* common  /data/ */
-extern data_t data;
-
-/* common  /dataj/ */
-extern dataj_t dataj;
-
-/* common  /incom/ */
-incom_t incom;;
-
-/* common  /gwav/ */
-extern gwav_t gwav;
-
-/* common  /gnd/ */
-extern gnd_t gnd;
+#include "shared.h"
 
 /*-------------------------------------------------------------------*/
 
@@ -49,15 +32,15 @@ extern gnd_t gnd;
 /* variable interval width romberg integration is used.  there are 9 */
 /* field components - the x, y, and z components due to constant, */
 /* sine, and cosine current distributions. */
-void rom2( long double a, long double b, complex long double *sum, long double dmin )
+void rom2( double a, double b, complex double *sum, double dmin )
 {
   int i, ns, nt, flag=TRUE;
   int nts = 4, nx = 1, n = 9;
-  long double ze, ep, zend, dz=0., dzot=0., tmag1, tmag2, tr, ti;
-  long double z, s; /***also global***/
-  long double rx = 1.0e-4;
-  complex long double g1[9], g2[9], g3[9], g4[9], g5[9];
-  complex long double t00, t01[9], t10[9], t02, t11, t20[9];
+  double ze, ep, zend, dz=0., dzot=0., tmag1, tmag2, tr, ti;
+  double z, s; /***also global***/
+  double rx = 1.0e-4;
+  complex double g1[9], g2[9], g3[9], g4[9], g5[9];
+  complex double t00, t01[9], t10[9], t02, t11, t20[9];
 
   z= a;
   ze= b;
@@ -118,8 +101,8 @@ void rom2( long double a, long double b, complex long double *sum, long double d
 
 	} /* for( i = 0; i < n; i++ ) */
 
-	tmag1= sqrtl( tmag1);
-	tmag2= sqrtl( tmag2);
+	tmag1= sqrt( tmag1);
+	tmag2= sqrt( tmag2);
 	test( tmag1, tmag2, &tr, 0., 0., &ti, dmin);
 
 	if( tr <= rx)
@@ -168,8 +151,8 @@ void rom2( long double a, long double b, complex long double *sum, long double d
 
 	} /* for( i = 0; i < n; i++ ) */
 
-	tmag1= sqrtl( tmag1);
-	tmag2= sqrtl( tmag2);
+	tmag1= sqrt( tmag1);
+	tmag2= sqrt( tmag2);
 	test( tmag1, tmag2, &tr, 0.,0., &ti, dmin);
 
 	if( tr > rx)
@@ -193,7 +176,7 @@ void rom2( long double a, long double b, complex long double *sum, long double d
 	  } /* if( ns < npm) */
 
 	  fprintf( output_fp,
-		  "\n  ROM2 -- STEP SIZE LIMITED AT Z = %12.5LE", z );
+		  "\n  ROM2 -- STEP SIZE LIMITED AT Z = %12.5E", z );
 
 	} /* if( tr > rx) */
 
@@ -223,11 +206,11 @@ void rom2( long double a, long double b, complex long double *sum, long double d
 
 /* sfldx returns the field due to ground for a current element on */
 /* the source segment at t relative to the segment center. */
-void sflds( long double t, complex long double *e )
+void sflds( double t, complex double *e )
 {
-  long double xt, yt, zt, rhx, rhy, rhs, rho, phx, phy;
-  long double cph, sph, zphs, r2s, rk, sfac, thet;
-  complex long double  erv, ezv, erh, ezh, eph, er, et, hrv, hzv, hrh;
+  double xt, yt, zt, rhx, rhy, rhs, rho, phx, phy;
+  double cph, sph, zphs, r2s, rk, sfac, thet;
+  complex double  erv, ezv, erh, ezh, eph, er, et, hrv, hzv, hrh;
 
   xt= dataj.xj+ t* dataj.cabj;
   yt= dataj.yj+ t* dataj.sabj;
@@ -235,7 +218,7 @@ void sflds( long double t, complex long double *e )
   rhx= incom.xo- xt;
   rhy= incom.yo- yt;
   rhs= rhx* rhx+ rhy* rhy;
-  rho= sqrtl( rhs);
+  rho= sqrt( rhs);
 
   if( rho <= 0.)
   {
@@ -248,24 +231,24 @@ void sflds( long double t, complex long double *e )
   {
 	rhx= rhx/ rho;
 	rhy= rhy/ rho;
-	phx=- rhy;
+	phx= -rhy;
 	phy= rhx;
   }
 
   cph= rhx* incom.xsn+ rhy* incom.ysn;
   sph= rhy* incom.xsn- rhx* incom.ysn;
 
-  if( fabsl( cph) < 1.0e-10)
+  if( fabs( cph) < 1.0e-10)
 	cph=0.;
-  if( fabsl( sph) < 1.0e-10)
+  if( fabs( sph) < 1.0e-10)
 	sph=0.;
 
   gwav.zph= incom.zo+ zt;
   zphs= gwav.zph* gwav.zph;
   r2s= rhs+ zphs;
-  gwav.r2= sqrtl( r2s);
+  gwav.r2= sqrt( r2s);
   rk= gwav.r2* TP;
-  gwav.xx2= cmplx( cosl( rk),- sinl( rk));
+  gwav.xx2= cmplx( cos( rk),- sin( rk));
 
   /* use norton approximation for field due to ground.  current is */
   /* lumped at segment center with current moment for constant, sine, */
@@ -301,7 +284,7 @@ void sflds( long double t, complex long double *e )
 	e[4]=0.;
 	e[5]=0.;
 	sfac= PI* dataj.s;
-	sfac= sinl( sfac)/ sfac;
+	sfac= sin( sfac)/ sfac;
 	e[6]= e[0]* sfac;
 	e[7]= e[1]* sfac;
 	e[8]= e[2]* sfac;
@@ -311,7 +294,7 @@ void sflds( long double t, complex long double *e )
 
   /* interpolate in sommerfeld field tables */
   if( rho >= 1.0e-12)
-	thet= atanl( gwav.zph/ rho);
+	thet= atan( gwav.zph/ rho);
   else
 	thet= POT;
 
@@ -329,12 +312,12 @@ void sflds( long double t, complex long double *e )
   e[2]= ezh;
   /* x,y,z fields for sine current */
   rk= TP* t;
-  sfac= sinl( rk);
+  sfac= sin( rk);
   e[3]= e[0]* sfac;
   e[4]= e[1]* sfac;
   /* x,y,z fields for cosine current */
   e[5]= e[2]* sfac;
-  sfac= cosl( rk);
+  sfac= cos( rk);
   e[6]= e[0]* sfac;
   e[7]= e[1]* sfac;
   e[8]= e[2]* sfac;
diff --git a/input.c b/input.c
index 2192965..f7b1a1e 100644
--- a/input.c
+++ b/input.c
@@ -24,33 +24,16 @@
 *******************************************************************/
 
 #include "nec2c.h"
-
-/* common  /data/ */
-extern data_t data;
-
-/* common  /segj/ */
-extern segj_t segj;
-
-/* common  /vsorc/ */
-extern vsorc_t vsorc;
-
-/* common  /dataj/ */
-extern dataj_t dataj;
-
-/* common  /zload/ */
-extern zload_t zload;
-
-/* pointers to input/output files */
-extern FILE *input_fp, *output_fp, *plot_fp;
+#include "shared.h"
 
 /*-------------------------------------------------------------------*/
 
 /* fill incident field array for charge discontinuity voltage source */
-void qdsrc( int is, complex long double v, complex long double *e )
+void qdsrc( int is, complex double v, complex double *e )
 {
   int i, jx, j, jp1, ipr, ij, i1;
-  long double xi, yi, zi, ai, cabi, sabi, salpi, tx, ty, tz;
-  complex long double curd, etk, ets, etc;
+  double xi, yi, zi, ai, cabi, sabi, salpi, tx, ty, tz;
+  complex double curd, etk, ets, etc;
 
   is--;
   i= data.icon1[is];
@@ -58,8 +41,8 @@ void qdsrc( int is, complex long double v, complex long double *e )
   tbf( is+1,0);
   data.icon1[is]= i;
   dataj.s= data.si[is]*.5;
-  curd= CCJ* v/(( logl(2.* dataj.s/ data.bi[is])-1.)*( segj.bx[segj.jsno-1]*
-		cosl( TP* dataj.s)+ segj.cx[segj.jsno-1]* sinl( TP* dataj.s))* data.wlam);
+  curd= CCJ* v/(( log(2.* dataj.s/ data.bi[is])-1.)*( segj.bx[segj.jsno-1]*
+		cos( TP* dataj.s)+ segj.cx[segj.jsno-1]* sin( TP* dataj.s))* data.wlam);
   vsorc.vqds[vsorc.nqds]= v;
   vsorc.iqds[vsorc.nqds]= is+1;
   vsorc.nqds++;
@@ -84,15 +67,15 @@ void qdsrc( int is, complex long double v, complex long double *e )
 	  if (ipr > PCHCON) dataj.ind1=2;
 	  else if( ipr < 0 )
 	  {
-		ipr=- ipr;
+		ipr= -ipr;
 		ipr--;
 		if( -data.icon1[ipr-1] != jp1 )
 		  dataj.ind1=2;
 		else
 		{
-		  xi= fabsl( dataj.cabj* data.cab[ipr]+ dataj.sabj*
+		  xi= fabs( dataj.cabj* data.cab[ipr]+ dataj.sabj*
 			  data.sab[ipr]+ dataj.salpj* data.salp[ipr]);
-		  if( (xi < 0.999999) || (fabsl(data.bi[ipr]/dataj.b-1.) > 1.0e-6) )
+		  if( (xi < 0.999999) || (fabs(data.bi[ipr]/dataj.b-1.) > 1.0e-6) )
 			dataj.ind1=2;
 		  else
 			dataj.ind1=0;
@@ -110,9 +93,9 @@ void qdsrc( int is, complex long double v, complex long double *e )
 			  dataj.ind1=2;
 			else
 			{
-			  xi= fabsl( dataj.cabj* data.cab[ipr]+ dataj.sabj*
+			  xi= fabs( dataj.cabj* data.cab[ipr]+ dataj.sabj*
 				  data.sab[ipr]+ dataj.salpj* data.salp[ipr]);
-			  if( (xi < 0.999999) || (fabsl(data.bi[ipr]/dataj.b-1.) > 1.0e-6) )
+			  if( (xi < 0.999999) || (fabs(data.bi[ipr]/dataj.b-1.) > 1.0e-6) )
 				dataj.ind1=2;
 			  else
 				dataj.ind1=0;
@@ -137,9 +120,9 @@ void qdsrc( int is, complex long double v, complex long double *e )
 		  dataj.ind1=2;
 		else
 		{
-		  xi= fabsl( dataj.cabj* data.cab[ipr]+ dataj.sabj*
+		  xi= fabs( dataj.cabj* data.cab[ipr]+ dataj.sabj*
 			  data.sab[ipr]+ dataj.salpj* data.salp[ipr]);
-		  if( (xi < 0.999999) || (fabsl(data.bi[ipr]/dataj.b-1.) > 1.0e-6) )
+		  if( (xi < 0.999999) || (fabs(data.bi[ipr]/dataj.b-1.) > 1.0e-6) )
 			dataj.ind1=2;
 		  else
 			dataj.ind1=0;
@@ -157,9 +140,9 @@ void qdsrc( int is, complex long double v, complex long double *e )
 			  dataj.ind2=2;
 			else
 			{
-			  xi= fabsl( dataj.cabj* data.cab[ipr]+ dataj.sabj*
+			  xi= fabs( dataj.cabj* data.cab[ipr]+ dataj.sabj*
 				  data.sab[ipr]+ dataj.salpj* data.salp[ipr]);
-			  if( (xi < 0.999999) || (fabsl(data.bi[ipr]/dataj.b-1.) > 1.0e-6) )
+			  if( (xi < 0.999999) || (fabs(data.bi[ipr]/dataj.b-1.) > 1.0e-6) )
 				dataj.ind2=2;
 			  else
 				dataj.ind2=0;
@@ -235,20 +218,20 @@ void qdsrc( int is, complex long double v, complex long double *e )
 /*-----------------------------------------------------------------------*/
 
 void readmn( char *gm, int *i1, int *i2, int *i3, int *i4,
-	long double *f1, long double *f2, long double *f3,
-	long double *f4, long double *f5, long double *f6 )
+	double *f1, double *f2, double *f3,
+	double *f4, double *f5, double *f6 )
 {
   char line_buf[134];
   int nlin, i, line_idx;
   int nint = 4, nflt = 6;
   int iarr[4] = { 0, 0, 0, 0 };
-  long double rarr[6] = { 0., 0., 0., 0., 0., 0. };
+  double rarr[6] = { 0., 0., 0., 0., 0., 0. };
 
   /* read a line from input file */
   load_line( line_buf, input_fp );
 
   /* get line length */
-  nlin= strlen( line_buf );
+  nlin= (int)strlen( line_buf );
 
   /* abort if card's mnemonic too short or missing */
   if( nlin < 2 )
@@ -290,7 +273,7 @@ void readmn( char *gm, int *i1, int *i2, int *i3, int *i4,
 		  (line_buf[  line_idx] >  '9')) &&
 		(line_buf[  line_idx] != '+')  &&
 		(line_buf[  line_idx] != '-') )
-	  if( (line_buf[line_idx] == '\0') )
+	  if( line_buf[line_idx] == '\0' )
 	  {
 		*i1= iarr[0];
 		*i2= iarr[1];
@@ -349,7 +332,7 @@ void readmn( char *gm, int *i1, int *i2, int *i3, int *i4,
 
   } /* for( i = 0; i < nint; i++ ) */
 
-  /* read long doubles from line */
+  /* read doubles from line */
   for( i = 0; i < nflt; i++ )
   {
 	/* Find first numerical character */
@@ -358,7 +341,7 @@ void readmn( char *gm, int *i1, int *i2, int *i3, int *i4,
 		(line_buf[  line_idx] != '+')  &&
 		(line_buf[  line_idx] != '-')  &&
 		(line_buf[  line_idx] != '.') )
-	  if( (line_buf[line_idx] == '\0') )
+	  if( line_buf[line_idx] == '\0' )
 	  {
 		*i1= iarr[0];
 		*i2= iarr[1];
@@ -373,7 +356,7 @@ void readmn( char *gm, int *i1, int *i2, int *i3, int *i4,
 		return;
 	  }
 
-	/* read a long double from line */
+	/* read a double from line */
 	rarr[i] = atof( &line_buf[line_idx] );
 
 	/* traverse numerical field to next ' ' or ',' */
diff --git a/install-sh b/install-sh
new file mode 100755
index 0000000..377bb86
--- /dev/null
+++ b/install-sh
@@ -0,0 +1,527 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2011-11-20.07; # UTC
+
+# 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
+	# Protect names problematic for 'test' and other utilities.
+	case $dst_arg in
+	  -* | [=\(\)!]) dst_arg=./$dst_arg;;
+	esac
+	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
+    # Protect names problematic for 'test' and other utilities.
+    case $dst_arg in
+      -* | [=\(\)!]) dst_arg=./$dst_arg;;
+    esac
+  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
+  do_exit='(exit $ret); exit $ret'
+  trap "ret=129; $do_exit" 1
+  trap "ret=130; $do_exit" 2
+  trap "ret=141; $do_exit" 13
+  trap "ret=143; $do_exit" 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 problematic for 'test' and other utilities.
+  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
+
+    # 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-writable 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 X"$d" = X && 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-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/main.c b/main.c
index 6b75199..e6d39ff 100644
--- a/main.c
+++ b/main.c
@@ -23,58 +23,12 @@
 
 *******************************************************************/
 
-#include "nec2c.h"
-
-/* common  /cmb/ */
-complex long double *cm;
-
-/* common  /crnt/ */
-crnt_t crnt;
-
-/* common  /data/ */
-data_t data;
-
-/*common  /ggrid/ */
-extern ggrid_t ggrid;
-
-/* common  /gnd/ */
-gnd_t gnd;
-
-/* common  /matpar/ */
-matpar_t matpar;
-
-/* common  /netcx/ */
-netcx_t netcx;
-
-/* common  /save/ */
-save_t save;
-
-/* common  /segj/ */
-segj_t segj;
-
-/* common  /yparm/ */
-yparm_t yparm;
-
-/* common  /zload/ */
-zload_t zload;
+#ifdef HAVE_CONFIG_H
+#  include <config.h>
+#endif
 
-/* common  /vsorc/ */
-vsorc_t vsorc;
-
-/* common  /fpat/ */
-fpat_t fpat;
-
-/* common  /gwav/ */
-gwav_t gwav;
-
-/* common  /plot/ */
-plot_t plot;
-
-/* common  /smat/ */
-smat_t smat;
-
-/* pointers to input/output files */
-FILE *input_fp=NULL, *output_fp=NULL, *plot_fp=NULL;
+#include "nec2c.h"
+#include "shared.h"
 
 /* signal handler */
 static void sig_handler( int signal );
@@ -86,7 +40,7 @@ int main( int argc, char **argv )
   char infile[81] = "", otfile[81] = "";
   char ain[3], line_buf[81];
 
-  /* input card mnemonic list */
+/* input card mnemonic list */
 #define NUM_CMNDS  20
   char *atst[NUM_CMNDS] =
   {
@@ -107,25 +61,22 @@ int main( int argc, char **argv )
   int i, j, itmp5, nthic=0, mhz=0, ifrq=0, isave=0;
 
   int
-	igox,       /* used in place of "igo" in freq loop */
-	next_job,   /* start next job (next sructure) flag */
-	idx,        /* general purpose index    */
-	ain_num,    /* ain mnemonic as a number */
-	jmp_iloop,  /* jump to input loop flag  */
-	jmp_floop=0,/* jump to freq. loop flag  */
-	mreq;       /* Size req. for malloc's   */
-
-  long double *zlr, *zli, *zlc, *fnorm;
-  long double *xtemp, *ytemp, *ztemp, *sitemp, *bitemp;
-  long double rkh, tmp1, delfrq=0., tmp2, tmp3, tmp4, tmp5, tmp6;
-  long double xpr1=0., xpr2=0., xpr3=0., xpr4=0., xpr5=0.;
-  long double zpnorm=0., thetis=0., phiss=0., extim;
-  long double tim1, tim, tim2, etha, fr, fr2, cmag, ph, ethm, ephm, epha;
-  complex long double eth, eph, curi, ex, ey, ez, epsc;
+	igox,        /* used in place of "igo" in freq loop */
+	next_job,    /* start next job (next sructure) flag */
+	ain_num,     /* ain mnemonic as a number */
+	jmp_iloop,   /* jump to input loop flag  */
+	jmp_floop=0; /* jump to freq. loop flag  */
+	size_t mreq; /* Size req. for malloc's   */
+
+  double *zlr, *zli, *zlc, *fnorm;
+  double *xtemp, *ytemp, *ztemp, *sitemp, *bitemp;
+  double rkh, tmp1, delfrq=0., tmp2, tmp3, tmp4, tmp5, tmp6;
+  double xpr1=0., xpr2=0., xpr3=0., xpr4=0., xpr5=0.;
+  double zpnorm=0., thetis=0., phiss=0., extim;
+  double tim1, tim, tim2, etha, fr, fr2, cmag, ph, ethm, ephm, epha;
+  complex double eth, eph, curi, ex, ey, ez, epsc, *cm = NULL;
 
   /* getopt() variables */
-  extern char *optarg;
-  extern int optind, opterr, optopt;
   int option;
 
   /*** signal handler related code ***/
@@ -174,7 +125,7 @@ int main( int argc, char **argv )
 		exit(0);
 
 	  case 'v' : /* print nec2c version */
-		puts( version );
+		puts( PACKAGE_STRING );
 		exit(0);
 
 	  default: /* print usage and exit */
@@ -200,7 +151,7 @@ int main( int argc, char **argv )
   if( strlen( otfile ) == 0 )
   {
 	/* strip file name extension if there is one */
-	idx = 0;
+	int idx = 0;
 	while( (infile[++idx] != '.') && (infile[idx] != '\0') );
 	infile[idx] = '\0';
 
@@ -227,19 +178,22 @@ int main( int argc, char **argv )
   /* Null local buffer pointers */
   /* type int */
   ldtyp = ldtag = ldtagf = ldtagt = NULL;
-  /* type long double */
+  /* type double */
   zlr = zli = zlc = fnorm = NULL;
   xtemp = ytemp = ztemp = sitemp = bitemp = NULL;
-  /* type complex long double */
+  /* type complex double */
   cm = NULL;
 
   /* Null global pointers */
   Null_Pointers();
 
   /* Allocate some buffers */
-  mem_alloc( (void *)&ggrid.ar1, sizeof(complex long double)*11*10*4 );
-  mem_alloc( (void *)&ggrid.ar2, sizeof(complex long double)*17*5*4 );
-  mem_alloc( (void *)&ggrid.ar3, sizeof(complex long double)*9*8*4 );
+  mreq = sizeof(complex double) * 11 * 10 * 4;
+  mem_alloc( (void *)&ggrid.ar1, mreq );
+  mreq = sizeof(complex double) * 17 * 5 * 4;
+  mem_alloc( (void *)&ggrid.ar2, mreq );
+  mreq = sizeof(complex double) * 9 * 8 * 4;
+  mem_alloc( (void *)&ggrid.ar3, mreq );
 
   /* Initialize ground grid parameters for somnec */
   ggrid.nxa[0] = 11;
@@ -347,7 +301,8 @@ int main( int argc, char **argv )
 	iflow=1;
 
 	/* Allocate some buffers */
-	mreq = data.npm * sizeof(long double);
+	mreq = (size_t)data.npm;
+	mreq *= sizeof(double);
 	mem_realloc( (void *)&crnt.air, mreq );
 	mem_realloc( (void *)&crnt.aii, mreq );
 	mem_realloc( (void *)&crnt.bir, mreq );
@@ -360,10 +315,12 @@ int main( int argc, char **argv )
 	mem_realloc( (void *)&sitemp, mreq );
 	mem_realloc( (void *)&bitemp, mreq );
 
-	mreq = data.np2m * sizeof(int);
+	mreq = (size_t)data.np2m;
+	mreq *= sizeof(int);
 	mem_realloc( (void *)&save.ip, mreq );
 
-	mreq = data.np3m * sizeof( complex long double);
+	mreq = (size_t)data.np3m;
+	mreq *= sizeof( complex double);
 	mem_realloc( (void *)&crnt.cur, mreq );
 
 	/* Matrix parameters */
@@ -428,7 +385,7 @@ int main( int argc, char **argv )
 	  mpcnt++;
 	  fprintf( output_fp,
 		  "\n  DATA CARD No: %3d "
-		  "%s %3d %5d %5d %5d %12.5LE %12.5LE %12.5LE %12.5LE %12.5LE %12.5LE",
+		  "%s %3d %5d %5d %5d %12.5E %12.5E %12.5E %12.5E %12.5E %12.5E",
 		  mpcnt, ain, itmp1, itmp2, itmp3, itmp4,
 		  tmp1, tmp2, tmp3, tmp4, tmp5, tmp6 );
 
@@ -480,15 +437,17 @@ int main( int argc, char **argv )
 
 			/* Reallocate loading buffers */
 			zload.nload++;
-			idx = zload.nload * sizeof(int);
-			mem_realloc( (void *)&ldtyp,  idx );
-			mem_realloc( (void *)&ldtag,  idx );
-			mem_realloc( (void *)&ldtagf, idx );
-			mem_realloc( (void *)&ldtagt, idx );
-			idx = zload.nload * sizeof(long double);
-			mem_realloc( (void *)&zlr, idx );
-			mem_realloc( (void *)&zli, idx );
-			mem_realloc( (void *)&zlc, idx );
+			mreq = (size_t)zload.nload;
+			mreq *= sizeof(int);
+			mem_realloc( (void *)&ldtyp,  mreq );
+			mem_realloc( (void *)&ldtag,  mreq );
+			mem_realloc( (void *)&ldtagf, mreq );
+			mem_realloc( (void *)&ldtagt, mreq );
+			mreq = (size_t)zload.nload;
+			mreq *= sizeof(double);
+			mem_realloc( (void *)&zlr, mreq );
+			mem_realloc( (void *)&zli, mreq );
+			mem_realloc( (void *)&zlc, mreq );
 
 			idx = zload.nload-1;
 			ldtyp[idx]= itmp1;
@@ -586,18 +545,22 @@ int main( int argc, char **argv )
 			if( fpat.ixtyp == 5)
 			{
 			  vsorc.nvqd++;
-			  mem_realloc( (void *)&vsorc.ivqd, vsorc.nvqd * sizeof(int) );
-			  mem_realloc( (void *)&vsorc.iqds, vsorc.nvqd * sizeof(int) );
-			  mem_realloc( (void *)&vsorc.vqd,  vsorc.nvqd * sizeof(complex long double) );
-			  mem_realloc( (void *)&vsorc.vqds, vsorc.nvqd * sizeof(complex long double) );
+			  mreq = (size_t)vsorc.nvqd;
+			  mreq *= sizeof(int);
+			  mem_realloc( (void *)&vsorc.ivqd, mreq );
+			  mem_realloc( (void *)&vsorc.iqds, mreq );
+			  mreq = (size_t)vsorc.nvqd;
+			  mreq *= sizeof(complex double);
+			  mem_realloc( (void *)&vsorc.vqd, mreq );
+			  mem_realloc( (void *)&vsorc.vqds, mreq );
 
 			  {
-				int indx = vsorc.nvqd-1;
+				int idx = vsorc.nvqd-1;
 
-				vsorc.ivqd[indx]= isegno( itmp2, itmp3);
-				vsorc.vqd[indx]= cmplx( tmp1, tmp2);
-				if( cabsl( vsorc.vqd[indx]) < 1.e-20)
-				  vsorc.vqd[indx] = CPLX_10;
+				vsorc.ivqd[idx]= isegno( itmp2, itmp3);
+				vsorc.vqd[idx]= cmplx( tmp1, tmp2);
+				if( cabs( vsorc.vqd[idx]) < 1.e-20)
+				  vsorc.vqd[idx] = CPLX_10;
 
 				iped= itmp4- netcx.masym*10;
 				zpnorm= tmp3;
@@ -609,16 +572,20 @@ int main( int argc, char **argv )
 			} /* if( fpat.ixtyp == 5) */
 
 			vsorc.nsant++;
-			mem_realloc( (void *)&vsorc.isant, vsorc.nsant * sizeof(int) );
-			mem_realloc( (void *)&vsorc.vsant, vsorc.nsant * sizeof(complex long double) );
+			mreq = (size_t)vsorc.nsant;
+			mreq *= sizeof(int);
+			mem_realloc( (void *)&vsorc.isant, mreq );
+			mreq = (size_t)vsorc.nsant;
+			mreq *= sizeof(complex double);
+			mem_realloc( (void *)&vsorc.vsant, mreq );
 
 			{
-			  int indx = vsorc.nsant-1;
+			  int idx = vsorc.nsant-1;
 
-			  vsorc.isant[indx]= isegno( itmp2, itmp3);
-			  vsorc.vsant[indx]= cmplx( tmp1, tmp2);
-			  if( cabsl( vsorc.vsant[indx]) < 1.e-20)
-				vsorc.vsant[indx] = CPLX_10;
+			  vsorc.isant[idx]= isegno( itmp2, itmp3);
+			  vsorc.vsant[idx]= cmplx( tmp1, tmp2);
+			  if( cabs( vsorc.vsant[idx]) < 1.e-20)
+				vsorc.vsant[idx] = CPLX_10;
 
 			  iped= itmp4- netcx.masym*10;
 			  zpnorm= tmp3;
@@ -674,17 +641,19 @@ int main( int argc, char **argv )
 
 			/* Re-allocate network buffers */
 			netcx.nonet++;
-			idx = netcx.nonet * sizeof(int);
-			mem_realloc( (void *)&netcx.ntyp, idx );
-			mem_realloc( (void *)&netcx.iseg1, idx );
-			mem_realloc( (void *)&netcx.iseg2, idx );
-			idx = netcx.nonet * sizeof(long double);
-			mem_realloc( (void *)&netcx.x11r, idx );
-			mem_realloc( (void *)&netcx.x11i, idx );
-			mem_realloc( (void *)&netcx.x12r, idx );
-			mem_realloc( (void *)&netcx.x12i, idx );
-			mem_realloc( (void *)&netcx.x22r, idx );
-			mem_realloc( (void *)&netcx.x22i, idx );
+			mreq = (size_t)netcx.nonet;
+			mreq *= sizeof(int);
+			mem_realloc( (void *)&netcx.ntyp, mreq );
+			mem_realloc( (void *)&netcx.iseg1, mreq );
+			mem_realloc( (void *)&netcx.iseg2, mreq );
+			mreq = (size_t)netcx.nonet;
+			mreq *= sizeof(double);
+			mem_realloc( (void *)&netcx.x11r, mreq );
+			mem_realloc( (void *)&netcx.x11i, mreq );
+			mem_realloc( (void *)&netcx.x12r, mreq );
+			mem_realloc( (void *)&netcx.x12i, mreq );
+			mem_realloc( (void *)&netcx.x22r, mreq );
+			mem_realloc( (void *)&netcx.x22i, mreq );
 
 			idx = netcx.nonet-1;
 			if( ain_num == 4 )
@@ -705,7 +674,7 @@ int main( int argc, char **argv )
 			  continue; /* continue card input loop */
 
 			netcx.ntyp[idx]=3;
-			netcx.x11r[idx]=- tmp1;
+			netcx.x11r[idx]= -tmp1;
 
 			continue; /* continue card input loop */
 		  }
@@ -898,8 +867,10 @@ int main( int argc, char **argv )
 			continue; /* continue card input loop */
 
 		  yparm.ncoup++;
-		  mem_realloc( (void *)&yparm.nctag, (yparm.ncoup) * sizeof(int) );
-		  mem_realloc( (void *)&yparm.ncseg, (yparm.ncoup) * sizeof(int) );
+		  mreq = (size_t)yparm.ncoup;
+		  mreq *= sizeof(int);
+		  mem_realloc( (void *)&yparm.nctag, mreq );
+		  mem_realloc( (void *)&yparm.ncseg, mreq );
 		  yparm.nctag[yparm.ncoup-1]= itmp1;
 		  yparm.ncseg[yparm.ncoup-1]= itmp2;
 
@@ -907,8 +878,10 @@ int main( int argc, char **argv )
 			continue; /* continue card input loop */
 
 		  yparm.ncoup++;
-		  mem_realloc( (void *)&yparm.nctag, (yparm.ncoup) * sizeof(int) );
-		  mem_realloc( (void *)&yparm.ncseg, (yparm.ncoup) * sizeof(int) );
+		  mreq = (size_t)yparm.ncoup;
+		  mreq *= sizeof(int);
+		  mem_realloc( (void *)&yparm.nctag, mreq );
+		  mem_realloc( (void *)&yparm.ncseg, mreq );
 		  yparm.nctag[yparm.ncoup-1]= itmp3;
 		  yparm.ncseg[yparm.ncoup-1]= itmp4;
 
@@ -972,13 +945,19 @@ int main( int argc, char **argv )
 
 	  /* Allocate to normalization buffer */
 	  {
-		int mreq1, mreq2;
+		size_t mreq1, mreq2;
 
 		mreq1 = mreq2 = 0;
 		if( iped )
-		  mreq1 = 4*nfrq * sizeof(long double);
+		{
+		  mreq1 = (size_t)(4 * nfrq);
+		  mreq1 *= sizeof(double);
+		}
 		if( iptflg >= 2 )
-		  mreq2 = nthi*nphi * sizeof(long double);
+		{
+		  mreq2 = (size_t)(nthi * nphi);
+		  mreq2 *= sizeof(double);
+		}
 
 		if( (mreq1 > 0) || (mreq2 > 0) )
 		{
@@ -1000,12 +979,16 @@ int main( int argc, char **argv )
 	  {
 		case 1: /* label 41 */
 		  /* Memory allocation for primary interacton matrix. */
-		  iresrv = data.np2m * (data.np+2*data.mp);
-		  mem_realloc( (void *)&cm, iresrv * sizeof(complex long double) );
+		  iresrv = data.np2m * (data.np + 2 * data.mp);
+		  mreq = (size_t)iresrv;
+		  mreq *= sizeof(complex double);
+		  mem_realloc( (void *)&cm, mreq );
 
 		  /* Memory allocation for symmetry array */
 		  smat.nop = netcx.neq/netcx.npeq;
-		  mem_realloc( (void *)&smat.ssx, smat.nop*smat.nop* sizeof( complex long double) );
+		  mreq = (size_t)(smat.nop * smat.nop);
+		  mreq *= sizeof(complex double);
+		  mem_realloc( (void *)&smat.ssx, mreq );
 
 		  mhz=1;
 
@@ -1059,15 +1042,15 @@ int main( int argc, char **argv )
 				"                               "
 				"--------- FREQUENCY --------\n"
 				"                                "
-				"FREQUENCY :%11.4LE MHz\n"
+				"FREQUENCY :%11.4E MHz\n"
 				"                                "
-				"WAVELENGTH:%11.4LE Mtr", save.fmhz, data.wlam );
+				"WAVELENGTH:%11.4E Mtr", save.fmhz, data.wlam );
 
 			fprintf( output_fp, "\n\n"
 				"                        "
 				"APPROXIMATE INTEGRATION EMPLOYED FOR SEGMENTS \n"
 				"                        "
-				"THAT ARE MORE THAN %.3LF WAVELENGTHS APART", rkh );
+				"THAT ARE MORE THAN %.3f WAVELENGTHS APART", rkh );
 
 			if( iexk == 1)
 			  fprintf( output_fp, "\n"
@@ -1100,7 +1083,7 @@ int main( int argc, char **argv )
 			  }
 			}
 
-			igo = 2;
+			//igo = 2;
 
 			/* label 46 */
 			case 2: /* structure segment loading */
@@ -1127,10 +1110,10 @@ int main( int argc, char **argv )
 			  if( gnd.iperf != 1)
 			  {
 				if( save.sig < 0.)
-				  save.sig=- save.sig/(59.96*data.wlam);
+				  save.sig= -save.sig/(59.96*data.wlam);
 
 				epsc= cmplx( save.epsr, -save.sig*data.wlam*59.96);
-				gnd.zrati=1./ csqrtl( epsc);
+				gnd.zrati=1./ csqrt( epsc);
 				gwav.u= gnd.zrati;
 				gwav.u2= gwav.u* gwav.u;
 
@@ -1138,8 +1121,8 @@ int main( int argc, char **argv )
 				{
 				  gnd.scrwl= save.scrwlt/ data.wlam;
 				  gnd.scrwr= save.scrwrt/ data.wlam;
-				  gnd.t1= CPLX_01*2367.067/ (long double)gnd.nradl;
-				  gnd.t2= gnd.scrwr* (long double)gnd.nradl;
+				  gnd.t1= CPLX_01*2367.067/ (double)gnd.nradl;
+				  gnd.t2= gnd.scrwr* (double)gnd.nradl;
 
 				  fprintf( output_fp, "\n"
 					  "                            "
@@ -1147,9 +1130,9 @@ int main( int argc, char **argv )
 					  "                            "
 					  "%d WIRES\n"
 					  "                            "
-					  "WIRE LENGTH: %8.2LF METERS\n"
+					  "WIRE LENGTH: %8.2f METERS\n"
 					  "                            "
-					  "WIRE RADIUS: %10.3LE METERS",
+					  "WIRE RADIUS: %10.3E METERS",
 					  gnd.nradl, save.scrwlt, save.scrwrt );
 
 				  fprintf( output_fp, "\n"
@@ -1166,13 +1149,14 @@ int main( int argc, char **argv )
 				{
 				  somnec( save.epsr, save.sig, save.fmhz );
 				  gnd.frati=( epsc-1.)/( epsc+1.);
-				  if( cabsl(( ggrid.epscf- epsc)/ epsc) >= 1.0e-3 )
+				  if( cabs(( ggrid.epscf- epsc)/ epsc) >= 1.0e-3 )
 				  {
 					fprintf( output_fp,
 						"\n ERROR IN GROUND PARAMETERS -"
-						"\n COMPLEX DIELECTRIC CONSTANT FROM FILE IS: %12.5LE%+12.5LEj"
-						"\n                                REQUESTED: %12.5LE%+12.5LEj",
-						creall(ggrid.epscf), cimagl(ggrid.epscf), creall(epsc), cimagl(epsc) );
+						"\n COMPLEX DIELECTRIC CONSTANT FROM FILE IS: %12.5E%+12.5Ej"
+						"\n                                REQUESTED: %12.5E%+12.5Ej",
+						creal(ggrid.epscf), cimag(ggrid.epscf),
+						creal(epsc), cimag(epsc) );
 					stop(-1);
 				  }
 
@@ -1184,12 +1168,12 @@ int main( int argc, char **argv )
 
 				fprintf( output_fp, "\n"
 					"                            "
-					"RELATIVE DIELECTRIC CONST: %.3LF\n"
+					"RELATIVE DIELECTRIC CONST: %.3f\n"
 					"                            "
-					"CONDUCTIVITY: %10.3LE MHOS/METER\n"
+					"CONDUCTIVITY: %10.3E MHOS/METER\n"
 					"                            "
-					"COMPLEX DIELECTRIC CONSTANT: %11.4LE%+11.4LEj",
-					save.epsr, save.sig, creall(epsc), cimagl(epsc) );
+					"COMPLEX DIELECTRIC CONSTANT: %11.4E%+11.4Ej",
+					save.epsr, save.sig, creal(epsc), cimag(epsc) );
 
 			  } /* if( gnd.iperf != 1) */
 			  else
@@ -1219,7 +1203,7 @@ int main( int argc, char **argv )
 				"FILL: %d msec  FACTOR: %d msec",
 				(int)tim, (int)tim2 );
 
-			igo=3;
+			//igo=3;
 			netcx.ntsol=0;
 
 			/* label 53 */
@@ -1257,8 +1241,8 @@ int main( int argc, char **argv )
 					  "      ORIENTATION (DEG)\n"
 					  "                     X          Y          Z "
 					  "      ALPHA        BETA   DIPOLE MOMENT\n"
-					  "               %10.5LF %10.5LF %10.5LF "
-					  " %7.2LF     %7.2LF    %8.3LF",
+					  "               %10.5f %10.5f %10.5f "
+					  " %7.2f     %7.2f    %8.3f",
 					  xpr1, xpr2, xpr3, xpr4, xpr5, fpat.xpr6 );
 				}
 				else
@@ -1270,8 +1254,8 @@ int main( int argc, char **argv )
 
 				  if( iptflg <= 0)
 					fprintf( output_fp,
-						"\n  PLANE WAVE - THETA: %7.2LF deg, PHI: %7.2LF deg,"
-						" ETA=%7.2LF DEG, TYPE - %s  AXIAL RATIO: %6.3LF",
+						"\n  PLANE WAVE - THETA: %7.2f deg, PHI: %7.2f deg,"
+						" ETA=%7.2f DEG, TYPE - %s  AXIAL RATIO: %6.3f",
 						xpr1, xpr2, xpr3, hpol[fpat.ixtyp-1], fpat.xpr6 );
 
 				} /* if( fpat.ixtyp == 4) */
@@ -1331,17 +1315,17 @@ int main( int argc, char **argv )
 
 					  if( (itmp2 >= 2) && (netcx.x11i[j] <= 0.) )
 					  {
-						long double xx, yy, zz;
+						double xx, yy, zz;
 
 						xx = data.x[idx5]- data.x[idx4];
 						yy = data.y[idx5]- data.y[idx4];
 						zz = data.z[idx5]- data.z[idx4];
-						netcx.x11i[j]= data.wlam* sqrtl( xx*xx + yy*yy + zz*zz );
+						netcx.x11i[j]= data.wlam* sqrt( xx*xx + yy*yy + zz*zz );
 					  }
 
 					  fprintf( output_fp, "\n"
-						  " %4d %5d %4d %5d  %11.4LE %11.4LE  "
-						  "%11.4LE %11.4LE  %11.4LE %11.4LE %s",
+						  " %4d %5d %4d %5d  %11.4E %11.4E  "
+						  "%11.4E %11.4E  %11.4E %11.4E %s",
 						  data.itag[idx4], itmp4, data.itag[idx5], itmp5,
 						  netcx.x11r[j], netcx.x11i[j], netcx.x12r[j], netcx.x12i[j],
 						  netcx.x22r[j], netcx.x22i[j], pnet[itmp2-1] );
@@ -1369,9 +1353,9 @@ int main( int argc, char **argv )
 			  {
 				itmp1= 4*( mhz-1);
 
-				fnorm[itmp1  ]= creall( netcx.zped);
-				fnorm[itmp1+1]= cimagl( netcx.zped);
-				fnorm[itmp1+2]= cabsl( netcx.zped);
+				fnorm[itmp1  ]= creal( netcx.zped);
+				fnorm[itmp1+1]= cimag( netcx.zped);
+				fnorm[itmp1+2]= cabs( netcx.zped);
 				fnorm[itmp1+3]= cang( netcx.zped);
 
 				if( iped != 2 )
@@ -1408,11 +1392,11 @@ int main( int argc, char **argv )
 						  "                        "
 						  "-------- RECEIVING PATTERN PARAMETERS --------\n"
 						  "                        "
-						  "         ETA: %7.2LF DEGREES\n"
+						  "         ETA: %7.2f DEGREES\n"
 						  "                        "
 						  "         TYPE: %s\n"
 						  "                        "
-						  "         AXIAL RATIO: %6.3LF\n\n"
+						  "         AXIAL RATIO: %6.3f\n\n"
 						  "                        "
 						  "THETA     PHI      ----- CURRENT ----    SEG\n"
 						  "                        "
@@ -1429,11 +1413,11 @@ int main( int argc, char **argv )
 				for( i = 0; i < data.n; i++ )
 				{
 				  curi= crnt.cur[i]* data.wlam;
-				  cmag= cabsl( curi);
+				  cmag= cabs( curi);
 				  ph= cang( curi);
 
-				  if( (zload.nload != 0) && (fabsl(creall(zload.zarray[i])) >= 1.e-20) )
-					fpat.ploss += 0.5* cmag* cmag* creall( zload.zarray[i])* data.si[i];
+				  if( (zload.nload != 0) && (fabs(creal(zload.zarray[i])) >= 1.e-20) )
+					fpat.ploss += 0.5* cmag* cmag* creal( zload.zarray[i])* data.si[i];
 
 				  if( iptflg == -1 )
 					continue;
@@ -1459,7 +1443,7 @@ int main( int argc, char **argv )
 					  {
 						fprintf( output_fp, "\n"
 							"                      "
-							"%7.2LF  %7.2LF   %11.4LE  %7.2LF  %5d",
+							"%7.2f  %7.2f   %11.4E  %7.2f  %5d",
 							xpr1, xpr2, cmag, ph, i+1 );
 						continue;
 					  }
@@ -1467,28 +1451,28 @@ int main( int argc, char **argv )
 					} /* if( iptflg != 0) */
 					else
 					  fprintf( output_fp, "\n"
-						  " %5d %4d %9.4LF %9.4LF %9.4LF %9.5LF"
-						  " %11.4LE %11.4LE %11.4LE %8.3LF",
+						  " %5d %4d %9.4f %9.4f %9.4f %9.5f"
+						  " %11.4E %11.4E %11.4E %8.3f",
 						  i+1, data.itag[i], data.x[i], data.y[i], data.z[i],
-						  data.si[i], creall(curi), cimagl(curi), cmag, ph );
+						  data.si[i], creal(curi), cimag(curi), cmag, ph );
 
 				  } /* if( iptflg >= 0 ) */
 				  else
 				  {
 					fprintf( output_fp, "\n"
-						" %5d %4d %9.4LF %9.4LF %9.4LF %9.5LF"
-						" %11.4LE %11.4LE %11.4LE %8.3LF",
+						" %5d %4d %9.4f %9.4f %9.4f %9.5f"
+						" %11.4E %11.4E %11.4E %8.3f",
 						i+1, data.itag[i], data.x[i], data.y[i], data.z[i],
-						data.si[i], creall(curi), cimagl(curi), cmag, ph );
+						data.si[i], creal(curi), cimag(curi), cmag, ph );
 
 					if( plot.iplp1 != 1 )
 					  continue;
 
 					if( plot.iplp2 == 1)
-					  fprintf( plot_fp, "%12.4LE %12.4LE\n", creall(curi), cimagl(curi) );
+					  fprintf( plot_fp, "%12.4E %12.4E\n", creal(curi), cimag(curi) );
 					else
 					  if( plot.iplp2 == 2)
-						fprintf( plot_fp, "%12.4LE %12.4LE\n", cmag, ph );
+						fprintf( plot_fp, "%12.4E %12.4E\n", cmag, ph );
 				  }
 
 				} /* for( i = 0; i < n; i++ ) */
@@ -1522,14 +1506,14 @@ int main( int argc, char **argv )
 					} /* if( iptflq == -2) */
 
 					curi= fr* cmplx(- crnt.bii[i], crnt.bir[i]);
-					cmag= cabsl( curi);
+					cmag= cabs( curi);
 					ph= cang( curi);
 
 					fprintf( output_fp, "\n"
-						" %5d %4d %9.4LF %9.4LF %9.4LF %9.5LF"
-						" %11.4LE %11.4LE %11.4LE %8.3LF",
+						" %5d %4d %9.4f %9.4f %9.4f %9.5f"
+						" %11.4E %11.4E %11.4E %8.3f",
 						i+1, data.itag[i], data.x[i], data.y[i], data.z[i],
-						data.si[i], creall(curi), cimagl(curi), cmag, ph );
+						data.si[i], creal(curi), cimag(curi), cmag, ph );
 
 				  } /* for( i = 0; i < n; i++ ) */
 
@@ -1567,30 +1551,32 @@ int main( int argc, char **argv )
 				  ez= crnt.cur[j+2];
 				  eth= ex* data.t1x[itmp1]+ ey* data.t1y[itmp1]+ ez* data.t1z[itmp1];
 				  eph= ex* data.t2x[itmp1]+ ey* data.t2y[itmp1]+ ez* data.t2z[itmp1];
-				  ethm= cabsl( eth);
+				  ethm= cabs( eth);
 				  etha= cang( eth);
-				  ephm= cabsl( eph);
+				  ephm= cabs( eph);
 				  epha= cang( eph);
 
 				  fprintf( output_fp, "\n"
-					  " %4d %7.3LF %7.3LF %7.3LF %11.4LE %8.2LF %11.4LE %8.2LF"
-					  " %9.2LE %9.2LE %9.2LE %9.2LE %9.2LE %9.2LE",
+					  " %4d %7.3f %7.3f %7.3f %11.4E %8.2f %11.4E %8.2f"
+					  " %9.2E %9.2E %9.2E %9.2E %9.2E %9.2E",
 					  i+1, data.px[itmp1], data.py[itmp1], data.pz[itmp1],
-					  ethm, etha, ephm, epha, creall(ex), cimagl(ex),
-					  creall(ey), cimagl(ey), creall(ez), cimagl(ez) );
+					  ethm, etha, ephm, epha, creal(ex), cimag(ex),
+					  creal(ey), cimag(ey), creal(ez), cimag(ez) );
 
 				  if( plot.iplp1 != 1)
 					continue;
 
 				  if( plot.iplp3 == 1)
-					fprintf( plot_fp, "%12.4LE %12.4LE\n", creall(ex), cimagl(ex) );
+					fprintf( plot_fp, "%12.4E %12.4E\n", creal(ex), cimag(ex) );
 				  if( plot.iplp3 == 2)
-					fprintf( plot_fp, "%12.4LE %12.4LE\n", creall(ey), cimagl(ey) );
+					fprintf( plot_fp, "%12.4E %12.4E\n", creal(ey), cimag(ey) );
 				  if( plot.iplp3 == 3)
-					fprintf( plot_fp, "%12.4LE %12.4LE\n", creall(ez), cimagl(ez) );
+					fprintf( plot_fp, "%12.4E %12.4E\n", creal(ez), cimag(ez) );
 				  if( plot.iplp3 == 4)
-					fprintf( plot_fp, "%12.4LE %12.4LE %12.4LE %12.4LE %12.4LE %12.4LE\n",
-						creall(ex),cimagl(ex),creall(ey),cimagl(ey),creall(ez),cimagl(ez) );
+					fprintf(
+						plot_fp, "%12.4E %12.4E %12.4E %12.4E %12.4E %12.4E\n",
+						creal(ex),cimag(ex),creal(ey),
+						cimag(ey),creal(ez),cimag(ez) );
 
 				} /* for( i=0; i<m; i++ ) */
 
@@ -1605,15 +1591,15 @@ int main( int argc, char **argv )
 					"                               "
 					"---------- POWER BUDGET ---------\n"
 					"                               "
-					"INPUT POWER   = %11.4LE Watts\n"
+					"INPUT POWER   = %11.4E Watts\n"
 					"                               "
-					"RADIATED POWER= %11.4LE Watts\n"
+					"RADIATED POWER= %11.4E Watts\n"
 					"                               "
-					"STRUCTURE LOSS= %11.4LE Watts\n"
+					"STRUCTURE LOSS= %11.4E Watts\n"
 					"                               "
-					"NETWORK LOSS  = %11.4LE Watts\n"
+					"NETWORK LOSS  = %11.4E Watts\n"
 					"                               "
-					"EFFICIENCY    = %7.2LF Percent",
+					"EFFICIENCY    = %7.2f Percent",
 					netcx.pin, tmp1, fpat.ploss, netcx.pnls, tmp2 );
 
 			  } /* if( (fpat.ixtyp == 0) || (fpat.ixtyp == 5) ) */
@@ -1752,12 +1738,12 @@ int main( int argc, char **argv )
 				  "                     "
 				  "---- NORMALIZED RECEIVING PATTERN ----\n"
 				  "                      "
-				  "NORMALIZATION FACTOR: %11.4LE\n"
+				  "NORMALIZATION FACTOR: %11.4E\n"
 				  "                      "
-				  "ETA: %7.2LF DEGREES\n"
+				  "ETA: %7.2f DEGREES\n"
 				  "                      "
 				  "TYPE: %s\n"
-				  "                      AXIAL RATIO: %6.3LF\n"
+				  "                      AXIAL RATIO: %6.3f\n"
 				  "                      SEGMENT No: %d\n\n"
 				  "                      "
 				  "THETA     PHI       ---- PATTERN ----\n"
@@ -1779,7 +1765,7 @@ int main( int argc, char **argv )
 					tmp3= db20( tmp2);
 
 					fprintf( output_fp, "\n"
-						"                    %7.2LF  %7.2LF   %7.2LF  %11.4LE",
+						"                    %7.2f  %7.2f   %7.2f  %11.4E",
 						xpr1, xpr2, tmp3, tmp2 );
 
 					xpr1 += xpr4;
@@ -1828,7 +1814,7 @@ int main( int argc, char **argv )
 				"                                     "
 				" SOURCE SEGMENT No: %d\n"
 				"                                  "
-				" NORMALIZATION FACTOR:%12.5LE\n\n"
+				" NORMALIZATION FACTOR:%12.5E\n\n"
 				"              ----------- UNNORMALIZED IMPEDANCE ----------  "
 				"  ------------ NORMALIZED IMPEDANCE -----------\n"
 				"      FREQ    RESISTANCE    REACTANCE    MAGNITUDE    PHASE  "
@@ -1842,7 +1828,7 @@ int main( int argc, char **argv )
 			  tmp1= save.fmhz-( nfrq-1)* delfrq;
 			else
 			  if( ifrq == 1)
-				tmp1= save.fmhz/( powl(delfrq, (nfrq-1)) );
+				tmp1= save.fmhz/( pow(delfrq, (nfrq-1)) );
 
 			for( i = 0; i < itmp1; i++ )
 			{
@@ -1853,8 +1839,8 @@ int main( int argc, char **argv )
 			  tmp5= fnorm[itmp2+3];
 
 			  fprintf( output_fp, "\n"
-				  " %9.3LF   %11.4LE  %11.4LE  %11.4LE  %7.2LF  "
-				  " %11.4LE  %11.4LE  %11.4LE  %7.2LF",
+				  " %9.3f   %11.4E  %11.4E  %11.4E  %7.2f  "
+				  " %11.4E  %11.4E  %11.4E  %7.2f",
 				  tmp1, fnorm[itmp2], fnorm[itmp2+1], fnorm[itmp2+2],
 				  fnorm[itmp2+3], tmp2, tmp3, tmp4, tmp5 );
 
@@ -1879,8 +1865,6 @@ int main( int argc, char **argv )
 
   } /* while(TRUE): Main execution loop (l_1) */
 
-  return(0);
-
 } /* end of main() */
 
 /*-----------------------------------------------------------------------*/
@@ -1933,14 +1917,14 @@ Null_Pointers( void )
 /*-----------------------------------------------------------------------*/
 
 /* prnt sets up the print formats for impedance loading */
-void prnt( int in1, int in2, int in3, long double fl1, long double fl2,
-		   long double fl3, long double fl4, long double fl5,
-		   long double fl6, char *ia, int ichar )
+void prnt( int in1, int in2, int in3, double fl1, double fl2,
+		   double fl3, double fl4, double fl5,
+		   double fl6, char *ia, int ichar )
 {
   /* record to be output and buffer used to make it */
-  char record[101+ichar*4], buff[15];
+  char record[101+ichar*4], buff[16];
   int in[3], i1, i;
-  long double fl[6];
+  double fl[6];
 
   in[0]= in1;
   in[1]= in2;
@@ -1976,9 +1960,9 @@ void prnt( int in1, int in2, int in3, long double fl1, long double fl2,
   /* floating point format */
   for( i = 0; i < 6; i++ )
   {
-	if( fabsl( fl[i]) >= 1.0e-20 )
+	if( fabs( fl[i]) >= 1.0e-20 )
 	{
-	  snprintf( buff, 15, " %11.4LE", fl[i] );
+	  snprintf( buff, 15, " %11.4E", fl[i] );
 	  strcat( record, buff );
 	}
 	else
diff --git a/matrix.c b/matrix.c
index e25fdfb..a311103 100644
--- a/matrix.c
+++ b/matrix.c
@@ -24,42 +24,16 @@
 *******************************************************************/
 
 #include "nec2c.h"
-
-/* common  /data/ */
-extern data_t data;
-
-/* common  /dataj/ */
-extern dataj_t dataj;
-
-/* common  /matpar/ */
-extern matpar_t matpar;
-
-/* common  /segj/ */
-extern segj_t segj;
-
-/* common  /zload/ */
-extern zload_t zload;
-
-/* common  /smat/ */
-extern smat_t smat;
-
-/* common  /gnd/ */
-extern gnd_t gnd;
-
-/* common  /vsorc/ */
-extern vsorc_t vsorc;
-
-/* pointers to input/output files */
-extern FILE *input_fp, *output_fp, *plot_fp;
+#include "shared.h"
 
 /*-------------------------------------------------------------------*/
 
 /* cmset sets up the complex structure matrix in the array cm */
-void cmset( int nrow, complex long double *cm, long double rkhx, int iexkx )
+void cmset( int nrow, complex double *cm, double rkhx, int iexkx )
 {
-  int mp2, neq, npeq, iout, it, i, j, i1, i2, in2;
+  int mp2, neq, npeq, it, i, j, i1, i2, in2;
   int im1, im2, ist, ij, ipr, jss, jm1, jm2, jst, k, ka, kk;
-  complex long double zaj, deter, *scm = NULL;
+  complex double zaj, deter, *scm = NULL;
 
   mp2=2* data.mp;
   npeq= data.np+ mp2;
@@ -68,7 +42,6 @@ void cmset( int nrow, complex long double *cm, long double rkhx, int iexkx )
 
   dataj.rkh= rkhx;
   dataj.iexk= iexkx;
-  iout=2* matpar.npblk* nrow;
   it= matpar.nlast;
 
   for( i = 0; i < nrow; i++ )
@@ -108,7 +81,7 @@ void cmset( int nrow, complex long double *cm, long double rkhx, int iexkx )
 		cmww( j, i1, in2, cm, nrow, cm, nrow,1);
 
 	  if( im1 <= im2)
-		cmws( j, im1, im2, &cm[(ist-1)*nrow], nrow, cm, nrow, 1);
+		cmws( j, im1, im2, &cm[(ist-1)*nrow], nrow, cm, 1);
 
 	  /* matrix elements modified by loading */
 	  if( zload.nload == 0)
@@ -159,7 +132,9 @@ void cmset( int nrow, complex long double *cm, long double rkhx, int iexkx )
 	return;
 
   /* Allocate to scratch memory */
-  mem_alloc( (void *)&scm, data.np2m * sizeof(complex long double) );
+  size_t mreq = (size_t)data.np2m;
+  mreq *= sizeof(complex double);
+  mem_alloc( (void *)&scm, mreq );
 
   /* combine elements for symmetry modes */
   for( i = 0; i < it; i++ )
@@ -205,11 +180,11 @@ void cmset( int nrow, complex long double *cm, long double rkhx, int iexkx )
 
 /* cmss computes matrix elements for surface-surface interactions. */
 void cmss( int j1, int j2, int im1, int im2,
-	complex long double *cm, int nrow, int itrp )
+	complex double *cm, int nrow, int itrp )
 {
   int i1, i2, icomp, ii1, i, il, ii2, jj1, j, jl, jj2;
-  long double t1xi, t1yi, t1zi, t2xi, t2yi, t2zi, xi, yi, zi;
-  complex long double g11, g12, g21, g22;
+  double t1xi, t1yi, t1zi, t2xi, t2yi, t2zi, xi, yi, zi;
+  complex double g11, g12, g21, g22;
 
   i1=( im1+1)/2;
   i2=( im2+1)/2;
@@ -310,19 +285,19 @@ void cmss( int j1, int j2, int im1, int im2,
 /*-----------------------------------------------------------------------*/
 
 /* computes matrix elements for e along wires due to patch current */
-void cmsw( int j1, int j2, int i1, int i2, complex long double *cm,
-	complex long double *cw, int ncw, int nrow, int itrp )
+void cmsw( int j1, int j2, int i1, int i2, complex double *cm,
+	complex double *cw, int ncw, int nrow, int itrp )
 {
-  int neqs, k, icgo, i, ipch, jl, j, js, il, ip;
   int jsnox; /* -1 offset to "jsno" for array indexing */
-  long double xi, yi, zi, cabi, sabi, salpi, fsign=1., pyl, pxl;
-  complex long double emel[9];
+  complex double emel[9];
 
-  neqs= data.np2m;
   jsnox = segj.jsno-1;
 
   if( itrp >= 0)
   {
+	int k, icgo, i, ipch, jl, j, js, il, ip;
+	double xi, yi, zi, cabi, sabi, salpi, fsign=1., pyl, pxl;
+
 	k=-1;
 	icgo=0;
 
@@ -379,8 +354,8 @@ void cmsw( int j1, int j2, int i1, int i2, complex long double *cm,
 			  pcint( xi, yi, zi, cabi, sabi, salpi, emel);
 
 			  pyl= PI* data.si[i]* fsign;
-			  pxl= sinl( pyl);
-			  pyl= cosl( pyl);
+			  pxl= sin( pyl);
+			  pyl= cos( pyl);
 			  dataj.exc= emel[8]* fsign;
 
 			  trio(i+1);
@@ -445,12 +420,12 @@ void cmsw( int j1, int j2, int i1, int i2, complex long double *cm,
 /*-----------------------------------------------------------------------*/
 
 /* cmws computes matrix elements for wire-surface interactions */
-void cmws( int j, int i1, int i2, complex long double *cm,
-	int nr, complex long double *cw, int nw, int itrp )
+void cmws( int j, int i1, int i2, complex double *cm,
+	int nr, complex double *cw, int itrp )
 {
   int ipr, i, ipatch, ik, js=0, ij, jx;
-  long double xi, yi, zi, tx, ty, tz;
-  complex long double etk, ets, etc;
+  double xi, yi, zi, tx, ty, tz;
+  complex double etk, ets, etc;
 
   j--;
   dataj.s= data.si[j];
@@ -552,12 +527,12 @@ void cmws( int j, int i1, int i2, complex long double *cm,
 /*-----------------------------------------------------------------------*/
 
 /* cmww computes matrix elements for wire-wire interactions */
-void cmww( int j, int i1, int i2, complex long double *cm,
-	int nr, complex long double *cw, int nw, int itrp)
+void cmww( int j, int i1, int i2, complex double *cm,
+	int nr, complex double *cw, int nw, int itrp)
 {
   int ipr, iprx, i, ij, jx;
-  long double xi, yi, zi, ai, cabi, sabi, salpi;
-  complex long double etk, ets, etc;
+  double xi, yi, zi, ai, cabi, sabi, salpi;
+  complex double etk, ets, etc;
 
   /* set source segment parameters */
   jx = j;
@@ -584,9 +559,9 @@ void cmww( int j, int i1, int i2, complex long double *cm,
 	  if( -data.icon1[iprx] != jx )	dataj.ind1 = 2;
 	  else
 	  {
-		xi= fabsl( dataj.cabj* data.cab[iprx]+ dataj.sabj*
+		xi= fabs( dataj.cabj* data.cab[iprx]+ dataj.sabj*
 			data.sab[iprx]+ dataj.salpj* data.salp[iprx]);
-		if( (xi < 0.999999) || (fabsl(data.bi[iprx]/dataj.b-1.) > 1.e-6) )
+		if( (xi < 0.999999) || (fabs(data.bi[iprx]/dataj.b-1.) > 1.e-6) )
 		  dataj.ind1=2;
 		else
 		  dataj.ind1=0;
@@ -605,9 +580,9 @@ void cmww( int j, int i1, int i2, complex long double *cm,
 		  if( data.icon2[iprx] != jx ) dataj.ind1=2;
 		  else
 		  {
-			xi= fabsl( dataj.cabj* data.cab[iprx]+ dataj.sabj*
+			xi= fabs( dataj.cabj* data.cab[iprx]+ dataj.sabj*
 				data.sab[iprx]+ dataj.salpj* data.salp[iprx]);
-			if( (xi < 0.999999) || (fabsl(data.bi[iprx]/dataj.b-1.) > 1.e-6) )
+			if( (xi < 0.999999) || (fabs(data.bi[iprx]/dataj.b-1.) > 1.e-6) )
 			  dataj.ind1=2;
 			else
 			  dataj.ind1=0;
@@ -635,9 +610,9 @@ void cmww( int j, int i1, int i2, complex long double *cm,
 		dataj.ind2=2;
 	  else
 	  {
-		xi= fabsl( dataj.cabj* data.cab[iprx]+ dataj.sabj*
+		xi= fabs( dataj.cabj* data.cab[iprx]+ dataj.sabj*
 			data.sab[iprx]+ dataj.salpj* data.salp[iprx]);
-		if( (xi < 0.999999) || (fabsl(data.bi[iprx]/dataj.b-1.) > 1.e-6) )
+		if( (xi < 0.999999) || (fabs(data.bi[iprx]/dataj.b-1.) > 1.e-6) )
 		  dataj.ind2=2;
 		else
 		  dataj.ind2=0;
@@ -648,8 +623,7 @@ void cmww( int j, int i1, int i2, complex long double *cm,
 	else
 	{
 	  iprx = ipr-1;
-	  if( ipr == 0 )
-		dataj.ind2=1;
+	  if( ipr == 0 ) dataj.ind2=1;
 	  else
 	  {
 		if( ipr != jx )
@@ -658,9 +632,9 @@ void cmww( int j, int i1, int i2, complex long double *cm,
 			dataj.ind2=2;
 		  else
 		  {
-			xi= fabsl( dataj.cabj* data.cab[iprx]+ dataj.sabj*
+			xi= fabs( dataj.cabj* data.cab[iprx]+ dataj.sabj*
 				data.sab[iprx]+ dataj.salpj* data.salp[iprx]);
-			if( (xi < 0.999999) || (fabsl(data.bi[iprx]/dataj.b-1.) > 1.e-6) )
+			if( (xi < 0.999999) || (fabs(data.bi[iprx]/dataj.b-1.) > 1.e-6) )
 			  dataj.ind2=2;
 			else
 			  dataj.ind2=0;
@@ -749,13 +723,13 @@ void cmww( int j, int i1, int i2, complex long double *cm,
 /* etmns fills the array e with the negative of the */
 /* electric field incident on the structure. e is the */
 /* right hand side of the matrix equation. */
-void etmns( long double p1, long double p2, long double p3, long double p4,
-	long double p5, long double p6, int ipr, complex long double *e )
+void etmns( double p1, double p2, double p3, double p4,
+	double p5, double p6, int ipr, complex double *e )
 {
   int i, is, i1, i2=0, neq;
-  long double cth, sth, cph, sph, cet, set, pxl, pyl, pzl, wx;
-  long double wy, wz, qx, qy, qz, arg, ds, dsh, rs, r;
-  complex long double cx, cy, cz, er, et, ezh, erh, rrv=CPLX_00, rrh=CPLX_00, tt1, tt2;
+  double cth, sth, cph, sph, cet, set, pxl, pyl, pzl, wx;
+  double wy, wz, qx, qy, qz, arg, ds, dsh, rs, r;
+  complex double cx, cy, cz, er, et, ezh, erh, rrv=CPLX_00, rrh=CPLX_00, tt1, tt2;
 
   neq= data.n+2*data.m;
   vsorc.nqds=0;
@@ -790,18 +764,18 @@ void etmns( long double p1, long double p2, long double p3, long double p4,
   /* incident plane wave, linearly polarized. */
   if( ipr <= 3)
   {
-	cth= cosl( p1);
-	sth= sinl( p1);
-	cph= cosl( p2);
-	sph= sinl( p2);
-	cet= cosl( p3);
-	set= sinl( p3);
+	cth= cos( p1);
+	sth= sin( p1);
+	cph= cos( p2);
+	sph= sin( p2);
+	cet= cos( p3);
+	set= sin( p3);
 	pxl= cth* cph* cet- sph* set;
 	pyl= cth* sph* cet+ cph* set;
-	pzl=- sth* cet;
-	wx=- sth* cph;
-	wy=- sth* sph;
-	wz=- cth;
+	pzl= -sth* cet;
+	wx= -sth* cph;
+	wy= -sth* sph;
+	wz= -cth;
 	qx= wy* pzl- wz* pyl;
 	qy= wz* pxl- wx* pzl;
 	qz= wx* pyl- wy* pxl;
@@ -810,7 +784,7 @@ void etmns( long double p1, long double p2, long double p3, long double p4,
 	{
 	  if( gnd.iperf != 1)
 	  {
-		rrv= csqrtl(1.- gnd.zrati* gnd.zrati* sth* sth);
+		rrv= csqrt(1.- gnd.zrati* gnd.zrati* sth* sth);
 		rrh= gnd.zrati* cth;
 		rrh=( rrh- rrv)/( rrh+ rrv);
 		rrv= gnd.zrati* rrv;
@@ -830,9 +804,9 @@ void etmns( long double p1, long double p2, long double p3, long double p4,
 	  {
 		for( i = 0; i < data.n; i++ )
 		{
-		  arg=- TP*( wx* data.x[i]+ wy* data.y[i]+ wz* data.z[i]);
+		  arg= -TP*( wx* data.x[i]+ wy* data.y[i]+ wz* data.z[i]);
 		  e[i]=-( pxl* data.cab[i]+ pyl* data.sab[i]+ pzl*
-			  data.salp[i])* cmplx( cosl( arg), sinl( arg));
+			  data.salp[i])* cmplx( cos( arg), sin( arg));
 		}
 
 		if( gnd.ksymp != 1)
@@ -840,13 +814,13 @@ void etmns( long double p1, long double p2, long double p3, long double p4,
 		  tt1=( pyl* cph- pxl* sph)*( rrh- rrv);
 		  cx= rrv* pxl- tt1* sph;
 		  cy= rrv* pyl+ tt1* cph;
-		  cz=- rrv* pzl;
+		  cz= -rrv* pzl;
 
 		  for( i = 0; i < data.n; i++ )
 		  {
-			arg=- TP*( wx* data.x[i]+ wy* data.y[i]- wz* data.z[i]);
+			arg= -TP*( wx* data.x[i]+ wy* data.y[i]- wz* data.z[i]);
 			e[i]= e[i]-( cx* data.cab[i]+ cy* data.sab[i]+
-				cz* data.salp[i])* cmplx(cosl( arg), sinl( arg));
+				cz* data.salp[i])* cmplx(cos( arg), sin( arg));
 		  }
 
 		} /* if( gnd.ksymp != 1) */
@@ -863,8 +837,8 @@ void etmns( long double p1, long double p2, long double p3, long double p4,
 		i++;
 		i1 += 2;
 		i2 = i1+1;
-		arg=- TP*( wx* data.px[i]+ wy* data.py[i]+ wz* data.pz[i]);
-		tt1= cmplx( cosl( arg), sinl( arg))* data.psalp[i]* RETA;
+		arg= -TP*( wx* data.px[i]+ wy* data.py[i]+ wz* data.pz[i]);
+		tt1= cmplx( cos( arg), sin( arg))* data.psalp[i]* RETA;
 		e[i2]=( qx* data.t1x[i]+ qy* data.t1y[i]+ qz* data.t1z[i])* tt1;
 		e[i1]=( qx* data.t2x[i]+ qy* data.t2y[i]+ qz* data.t2z[i])* tt1;
 	  }
@@ -884,8 +858,8 @@ void etmns( long double p1, long double p2, long double p3, long double p4,
 		i++;
 		i1 += 2;
 		i2 = i1+1;
-		arg=- TP*( wx* data.px[i]+ wy* data.py[i]- wz* data.pz[i]);
-		tt1= cmplx( cosl( arg), sinl( arg))* data.psalp[i]* RETA;
+		arg= -TP*( wx* data.px[i]+ wy* data.py[i]- wz* data.pz[i]);
+		tt1= cmplx( cos( arg), sin( arg))* data.psalp[i]* RETA;
 		e[i2]= e[i2]+( cx* data.t1x[i]+ cy* data.t1y[i]+ cz* data.t1z[i])* tt1;
 		e[i1]= e[i1]+( cx* data.t2x[i]+ cy* data.t2y[i]+ cz* data.t2z[i])* tt1;
 	  }
@@ -896,7 +870,7 @@ void etmns( long double p1, long double p2, long double p3, long double p4,
 	/* incident plane wave, elliptic polarization. */
 	tt1=-(CPLX_01)* p6;
 	if( ipr == 3)
-	  tt1=- tt1;
+	  tt1= -tt1;
 
 	if( data.n != 0)
 	{
@@ -906,9 +880,9 @@ void etmns( long double p1, long double p2, long double p3, long double p4,
 
 	  for( i = 0; i < data.n; i++ )
 	  {
-		arg=- TP*( wx* data.x[i]+ wy* data.y[i]+ wz* data.z[i]);
+		arg= -TP*( wx* data.x[i]+ wy* data.y[i]+ wz* data.z[i]);
 		e[i]=-( cx* data.cab[i]+ cy* data.sab[i]+ cz*
-			data.salp[i])* cmplx( cosl( arg), sinl( arg));
+			data.salp[i])* cmplx( cos( arg), sin( arg));
 	  }
 
 	  if( gnd.ksymp != 1)
@@ -916,13 +890,13 @@ void etmns( long double p1, long double p2, long double p3, long double p4,
 		tt2=( cy* cph- cx* sph)*( rrh- rrv);
 		cx= rrv* cx- tt2* sph;
 		cy= rrv* cy+ tt2* cph;
-		cz=- rrv* cz;
+		cz= -rrv* cz;
 
 		for( i = 0; i < data.n; i++ )
 		{
-		  arg=- TP*( wx* data.x[i]+ wy* data.y[i]- wz* data.z[i]);
+		  arg= -TP*( wx* data.x[i]+ wy* data.y[i]- wz* data.z[i]);
 		  e[i]= e[i]-( cx* data.cab[i]+ cy* data.sab[i]+
-			  cz* data.salp[i])* cmplx(cosl( arg), sinl( arg));
+			  cz* data.salp[i])* cmplx(cos( arg), sin( arg));
 		}
 
 	  } /* if( gnd.ksymp != 1) */
@@ -943,8 +917,8 @@ void etmns( long double p1, long double p2, long double p3, long double p4,
 	  i++;
 	  i1 += 2;
 	  i2 = i1+1;
-	  arg=- TP*( wx* data.px[i]+ wy* data.py[i]+ wz* data.pz[i]);
-	  tt2= cmplx( cosl( arg), sinl( arg))* data.psalp[i]* RETA;
+	  arg= -TP*( wx* data.px[i]+ wy* data.py[i]+ wz* data.pz[i]);
+	  tt2= cmplx( cos( arg), sin( arg))* data.psalp[i]* RETA;
 	  e[i2]=( cx* data.t1x[i]+ cy* data.t1y[i]+ cz* data.t1z[i])* tt2;
 	  e[i1]=( cx* data.t2x[i]+ cy* data.t2y[i]+ cz* data.t2z[i])* tt2;
 	}
@@ -964,8 +938,8 @@ void etmns( long double p1, long double p2, long double p3, long double p4,
 	  i++;
 	  i1 += 2;
 	  i2 = i1+1;
-	  arg=- TP*( wx* data.px[i]+ wy* data.py[i]- wz* data.pz[i]);
-	  tt1= cmplx( cosl( arg), sinl( arg))* data.psalp[i]* RETA;
+	  arg= -TP*( wx* data.px[i]+ wy* data.py[i]- wz* data.pz[i]);
+	  tt1= cmplx( cos( arg), sin( arg))* data.psalp[i]* RETA;
 	  e[i2]= e[i2]+( cx* data.t1x[i]+ cy* data.t1y[i]+ cz* data.t1z[i])* tt1;
 	  e[i1]= e[i1]+( cx* data.t2x[i]+ cy* data.t2y[i]+ cz* data.t2z[i])* tt1;
 	}
@@ -975,10 +949,10 @@ void etmns( long double p1, long double p2, long double p3, long double p4,
   } /* if( ipr <= 3) */
 
   /* incident field of an elementary current source. */
-  wz= cosl( p4);
-  wx= wz* cosl( p5);
-  wy= wz* sinl( p5);
-  wz= sinl( p4);
+  wz= cos( p4);
+  wx= wz* cos( p5);
+  wy= wz* sin( p5);
+  wz= sin( p4);
   ds= p6*59.958;
   dsh= p6/(2.* TP);
 
@@ -1005,17 +979,17 @@ void etmns( long double p1, long double p2, long double p3, long double p4,
 	if( rs < 1.0e-30)
 	  continue;
 
-	r= sqrtl( rs);
+	r= sqrt( rs);
 	pxl= pxl/ r;
 	pyl= pyl/ r;
 	pzl= pzl/ r;
 	cth= pxl* wx+ pyl* wy+ pzl* wz;
-	sth= sqrtl(1.- cth* cth);
+	sth= sqrt(1.- cth* cth);
 	qx= pxl- wx* cth;
 	qy= pyl- wy* cth;
 	qz= pzl- wz* cth;
 
-	arg= sqrtl( qx* qx+ qy* qy+ qz* qz);
+	arg= sqrt( qx* qx+ qy* qy+ qz* qz);
 	if( arg >= 1.e-30)
 	{
 	  qx= qx/ arg;
@@ -1030,8 +1004,8 @@ void etmns( long double p1, long double p2, long double p3, long double p4,
 
 	} /* if( arg >= 1.e-30) */
 
-	arg=- TP* r;
-	tt1= cmplx( cosl( arg), sinl( arg));
+	arg= -TP* r;
+	tt1= cmplx( cos( arg), sin( arg));
 
 	if( i < data.n )
 	{
@@ -1072,14 +1046,16 @@ void etmns( long double p1, long double p2, long double p3, long double p4,
 /* numerical analysis.  comments below refer to comments in ralstons */
 /* text.    (matrix transposed.) */
 
-void factr( int n, complex long double *a, int *ip, int ndim)
+void factr( int n, complex double *a, int *ip, int ndim)
 {
   int r, rm1, rp1, pj, pr, iflg, k, j, jp1, i;
-  long double dmax, elmag;
-  complex long double arj, *scm = NULL;
+  double dmax, elmag;
+  complex double arj, *scm = NULL;
 
   /* Allocate to scratch memory */
-  mem_alloc( (void *)&scm, data.np2m * sizeof(complex long double) );
+  size_t mreq = (size_t)data.np2m;
+  mreq *= sizeof(complex double);
+  mem_alloc( (void *)&scm, mreq );
 
   /* Un-transpose the matrix for Gauss elimination */
   for( i = 1; i < n; i++ )
@@ -1117,7 +1093,7 @@ void factr( int n, complex long double *a, int *ip, int ndim)
 	} /* if( rm1 >= 0.) */
 
 	/* step 4 */
-	dmax= creal( scm[r]*conjl(scm[r]) );
+	dmax= creal( scm[r]*conj(scm[r]) );
 
 	rp1= r+1;
 	ip[r]= rp1;
@@ -1125,7 +1101,7 @@ void factr( int n, complex long double *a, int *ip, int ndim)
 	{
 	  for( i = rp1; i < n; i++ )
 	  {
-		elmag= creal( scm[i]* conjl(scm[i]) );
+		elmag= creal( scm[i]* conj(scm[i]) );
 		if( elmag >= dmax)
 		{
 		  dmax= elmag;
@@ -1153,7 +1129,7 @@ void factr( int n, complex long double *a, int *ip, int ndim)
 	if( iflg == TRUE )
 	{
 	  fprintf( output_fp,
-		  "\n  PIVOT(%d)= %16.8LE", r, dmax );
+		  "\n  PIVOT(%d)= %16.8E", r, dmax );
 	  iflg=FALSE;
 	}
 
@@ -1170,7 +1146,7 @@ void factr( int n, complex long double *a, int *ip, int ndim)
 /* matricies of the symmetric modes and calls routine to factor */
 /* matricies.  if no symmetry, the routine is called to factor the */
 /* complete matrix. */
-void factrs( int np, int nrow, complex long double *a, int *ip )
+void factrs( int np, int nrow, complex double *a, int *ip )
 {
   int kk, ka;
 
@@ -1190,8 +1166,8 @@ void factrs( int np, int nrow, complex long double *a, int *ip )
 void fblock( int nrow, int ncol, int imax, int ipsym )
 {
   int i, j, k, ka, kk;
-  long double phaz, arg;
-  complex long double deter;
+  double phaz, arg;
+  complex double deter;
 
   if( nrow*ncol <= imax)
   {
@@ -1226,8 +1202,8 @@ void fblock( int nrow, int ncol, int imax, int ipsym )
 	{
 	  for( j= i; j < smat.nop; j++ )
 	  {
-		arg= phaz* (long double)i * (long double)j;
-		smat.ssx[i+j*smat.nop]= cmplx( cosl( arg), sinl( arg));
+		arg= phaz* (double)i * (double)j;
+		smat.ssx[i+j*smat.nop]= cmplx( cos( arg), sin( arg));
 		smat.ssx[j+i*smat.nop]= smat.ssx[i+j*smat.nop];
 	  }
 	}
@@ -1251,7 +1227,7 @@ void fblock( int nrow, int ncol, int imax, int ipsym )
 	  {
 		deter= smat.ssx[i+j*smat.nop];
 		smat.ssx[i+(j+kk)*smat.nop]= deter;
-		smat.ssx[i+kk+(j+kk)*smat.nop]=- deter;
+		smat.ssx[i+kk+(j+kk)*smat.nop]= -deter;
 		smat.ssx[i+kk+j*smat.nop]= deter;
 	  }
 	}
@@ -1269,14 +1245,16 @@ void fblock( int nrow, int ncol, int imax, int ipsym )
 /* lower triangular matrix and u is an upper triangular matrix both */
 /* of which are stored in a.  the rhs vector b is input and the */
 /* solution is returned through vector b.   (matrix transposed. */
-void solve( int n, complex long double *a, int *ip,
-	complex long double *b, int ndim )
+void solve( int n, complex double *a, int *ip,
+	complex double *b, int ndim )
 {
   int i, ip1, j, k, pia;
-  complex long double sum, *scm = NULL;
+  complex double sum, *scm = NULL;
 
   /* Allocate to scratch memory */
-  mem_alloc( (void *)&scm, data.np2m * sizeof(complex long double) );
+  size_t mreq = (size_t)data.np2m;
+  mreq *= sizeof(complex double);
+  mem_alloc( (void *)&scm, mreq );
 
   /* forward substitution */
   for( i = 0; i < n; i++ )
@@ -1315,12 +1293,12 @@ void solve( int n, complex long double *a, int *ip,
 /* subroutine solves, for symmetric structures, handles the */
 /* transformation of the right hand side vector and solution */
 /* of the matrix eq. */
-void solves( complex long double *a, int *ip, complex long double *b,
+void solves( complex double *a, int *ip, complex double *b,
 	int neq, int nrh, int np, int n, int mp, int m)
 {
   int npeq, nrow, ic, i, kk, ia, ib, j, k;
-  long double fnop, fnorm;
-  complex long double  sum, *scm = NULL;
+  double fnop, fnorm;
+  complex double  sum, *scm = NULL;
 
   npeq= np+ 2*mp;
   smat.nop = neq/npeq;
@@ -1329,7 +1307,9 @@ void solves( complex long double *a, int *ip, complex long double *b,
   nrow= neq;
 
   /* Allocate to scratch memory */
-  mem_alloc( (void *)&scm, data.np2m * sizeof(complex long double) );
+  size_t mreq = (size_t)data.np2m;
+  mreq *= sizeof(complex double);
+  mem_alloc( (void *)&scm, mreq );
 
   if( smat.nop != 1)
   {
@@ -1393,7 +1373,7 @@ void solves( complex long double *a, int *ip, complex long double *b,
 		  sum= scm[0];
 
 		  for( j = 1; j < smat.nop; j++ )
-			sum += scm[j]* conjl( smat.ssx[k+j*smat.nop]);
+			sum += scm[j]* conj( smat.ssx[k+j*smat.nop]);
 
 		  b[ia+ic*neq]= sum* fnorm;
 		}
diff --git a/misc.c b/misc.c
index 2be1c95..0b7ef68 100644
--- a/misc.c
+++ b/misc.c
@@ -2,10 +2,7 @@
  * Miscellaneous support functions for nec2c.c
  */
 
-#include "nec2c.h"
-
-/* pointers to input/output files */
-extern FILE *input_fp, *output_fp, *plot_fp;
+#include "shared.h"
 
 /*------------------------------------------------------------------------*/
 
@@ -78,13 +75,14 @@ void abort_on_error( int why )
 /*------------------------------------------------------------------------*/
 
 /* Returns process time (user+system) BUT in _msec_ */
-void secnds( long double *x)
+void secnds( double *x)
 {
   struct tms buffer;
+  double clk_tck;
 
   times(&buffer);
-  *x = 1000. * ( (long double)(buffer.tms_utime + buffer.tms_stime) ) /
-	( (long double) sysconf(_SC_CLK_TCK) );
+  clk_tck = sysconf( _SC_CLK_TCK );
+  *x = 1000.0 * (double)(buffer.tms_utime + buffer.tms_stime) / clk_tck;
 
   return;
 }
@@ -153,7 +151,7 @@ int load_line( char *buff, FILE *pfile )
 	  break;
 
 	/* enter new char to buffer */
-	buff[num_chr++] = chr;
+	buff[num_chr++] = (char)chr;
 
 	/* terminate buffer as a string on EOF */
 	if( (chr = fgetc(pfile)) == EOF )
@@ -180,8 +178,7 @@ int load_line( char *buff, FILE *pfile )
 /*------------------------------------------------------------------------*/
 
 /***  Memory allocation/freeing utils ***/
-
-void mem_alloc( void **ptr, int req )
+void mem_alloc( void **ptr, size_t req )
 {
   free_ptr( ptr );
   *ptr = malloc( req );
@@ -192,7 +189,7 @@ void mem_alloc( void **ptr, int req )
 
 /*------------------------------------------------------------------------*/
 
-void mem_realloc( void **ptr, int req )
+void mem_realloc( void **ptr, size_t req )
 {
   *ptr = realloc( *ptr, req );
   if( *ptr == NULL )
diff --git a/missing b/missing
new file mode 100755
index 0000000..cdea514
--- /dev/null
+++ b/missing
@@ -0,0 +1,215 @@
+#! /bin/sh
+# Common wrapper for a few potentially missing GNU programs.
+
+scriptversion=2012-06-26.16; # UTC
+
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Originally written 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, see <http://www.gnu.org/licenses/>.
+
+# 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
+
+case $1 in
+
+  --is-lightweight)
+    # Used by our autoconf macros to check whether the available missing
+    # script is modern enough.
+    exit 0
+    ;;
+
+  --run)
+    # Back-compat with the calling convention used by older automake.
+    shift
+    ;;
+
+  -h|--h|--he|--hel|--help)
+    echo "\
+$0 [OPTION]... PROGRAM [ARGUMENT]...
+
+Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due
+to PROGRAM being missing or too old.
+
+Options:
+  -h, --help      display this help and exit
+  -v, --version   output version information and exit
+
+Supported PROGRAM values:
+  aclocal   autoconf  autoheader   autom4te  automake  makeinfo
+  bison     yacc      flex         lex       help2man
+
+Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
+'g' are ignored when checking the name.
+
+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
+
+# Run the given program, remember its exit status.
+"$@"; st=$?
+
+# If it succeeded, we are done.
+test $st -eq 0 && exit 0
+
+# Also exit now if we it failed (or wasn't found), and '--version' was
+# passed; such an option is passed most likely to detect whether the
+# program is present and works.
+case $2 in --version|--help) exit $st;; esac
+
+# Exit code 63 means version mismatch.  This often happens when the user
+# tries to use an ancient version of a tool on a file that requires a
+# minimum version.
+if test $st -eq 63; then
+  msg="probably too old"
+elif test $st -eq 127; then
+  # Program was missing.
+  msg="missing on your system"
+else
+  # Program was found and executed, but failed.  Give up.
+  exit $st
+fi
+
+perl_URL=http://www.perl.org/
+flex_URL=http://flex.sourceforge.net/
+gnu_software_URL=http://www.gnu.org/software
+
+program_details ()
+{
+  case $1 in
+    aclocal|automake)
+      echo "The '$1' program is part of the GNU Automake package:"
+      echo "<$gnu_software_URL/automake>"
+      echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
+      echo "<$gnu_software_URL/autoconf>"
+      echo "<$gnu_software_URL/m4/>"
+      echo "<$perl_URL>"
+      ;;
+    autoconf|autom4te|autoheader)
+      echo "The '$1' program is part of the GNU Autoconf package:"
+      echo "<$gnu_software_URL/autoconf/>"
+      echo "It also requires GNU m4 and Perl in order to run:"
+      echo "<$gnu_software_URL/m4/>"
+      echo "<$perl_URL>"
+      ;;
+  esac
+}
+
+give_advice ()
+{
+  # Normalize program name to check for.
+  normalized_program=`echo "$1" | sed '
+    s/^gnu-//; t
+    s/^gnu//; t
+    s/^g//; t'`
+
+  printf '%s\n' "'$1' is $msg."
+
+  configure_deps="'configure.ac' or m4 files included by 'configure.ac'"
+  case $normalized_program in
+    autoconf*)
+      echo "You should only need it if you modified 'configure.ac',"
+      echo "or m4 files included by it."
+      program_details 'autoconf'
+      ;;
+    autoheader*)
+      echo "You should only need it if you modified 'acconfig.h' or"
+      echo "$configure_deps."
+      program_details 'autoheader'
+      ;;
+    automake*)
+      echo "You should only need it if you modified 'Makefile.am' or"
+      echo "$configure_deps."
+      program_details 'automake'
+      ;;
+    aclocal*)
+      echo "You should only need it if you modified 'acinclude.m4' or"
+      echo "$configure_deps."
+      program_details 'aclocal'
+      ;;
+   autom4te*)
+      echo "You might have modified some maintainer files that require"
+      echo "the 'automa4te' program to be rebuilt."
+      program_details 'autom4te'
+      ;;
+    bison*|yacc*)
+      echo "You should only need it if you modified a '.y' file."
+      echo "You may want to install the GNU Bison package:"
+      echo "<$gnu_software_URL/bison/>"
+      ;;
+    lex*|flex*)
+      echo "You should only need it if you modified a '.l' file."
+      echo "You may want to install the Fast Lexical Analyzer package:"
+      echo "<$flex_URL>"
+      ;;
+    help2man*)
+      echo "You should only need it if you modified a dependency" \
+           "of a man page."
+      echo "You may want to install the GNU Help2man package:"
+      echo "<$gnu_software_URL/help2man/>"
+    ;;
+    makeinfo*)
+      echo "You should only need it if you modified a '.texi' file, or"
+      echo "any other file indirectly affecting the aspect of the manual."
+      echo "You might want to install the Texinfo package:"
+      echo "<$gnu_software_URL/texinfo/>"
+      echo "The spurious makeinfo call might also be the consequence of"
+      echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might"
+      echo "want to install GNU make:"
+      echo "<$gnu_software_URL/make/>"
+      ;;
+    *)
+      echo "You might have modified some files without having the proper"
+      echo "tools for further handling them.  Check the 'README' file, it"
+      echo "often tells you about the needed prerequisites for installing"
+      echo "this package.  You may also peek at any GNU archive site, in"
+      echo "case some other package contains this missing '$1' program."
+      ;;
+  esac
+}
+
+give_advice "$1" | sed -e '1s/^/WARNING: /' \
+                       -e '2,$s/^/         /' >&2
+
+# Propagate the correct exit status (expected to be 127 for a program
+# not found, 63 for a program that failed due to version mismatch).
+exit $st
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/nec2c.h b/nec2c.h
index 0ed8a7a..5354032 100644
--- a/nec2c.h
+++ b/nec2c.h
@@ -23,17 +23,17 @@
 #endif
 
 /* commonly used complex constants */
-#define	CPLX_00	(0.0+0.0fj)
-#define	CPLX_01	(0.0+1.0fj)
-#define	CPLX_10	(1.0+0.0fj)
-#define	CPLX_11	(1.0+1.0fj)
+#define	CPLX_00	(0.0+I*0.0)
+#define	CPLX_01	(0.0+I*1.0)
+#define	CPLX_10	(1.0+I*0.0)
+#define	CPLX_11	(1.0+I*1.0)
 
 /* common constants */
 #define PI		3.141592654
 #define	POT		1.570796327
 #define	TP		6.283185308
 #define	PTP		.6283185308
-#define	TPJ		(0.0+6.283185308fj)
+#define	TPJ		(0.0+I*6.283185308)
 #define PI8		25.13274123
 #define PI10	31.41592654
 #define	TA		1.745329252E-02
@@ -45,11 +45,11 @@
 #define ACCS	1.E-12
 #define	SP		1.772453851
 #define	FPI		12.56637062
-#define	CCJ		(0.0-0.01666666667fj)
-#define	CONST1	(0.0+4.771341189fj)
+#define	CCJ		(0.0-I*0.01666666667)
+#define	CONST1	(0.0+I*4.771341189)
 #define	CONST2	4.771341188
-#define	CONST3	(0.0-29.97922085fj)
-#define	CONST4	(0.0+188.365fj)
+#define	CONST3	(0.0-I*29.97922085)
+#define	CONST4	(0.0+I*188.365)
 #define	GAMMA	.5772156649
 #define C1		-.02457850915
 #define C2		.3674669052
@@ -79,14 +79,12 @@
 
 /* max length of a line read from input file */
 #define	LINE_LEN	132
-/* version of fortran source for the -v option */
-#define		version "nec2c 0.7"
 
 /*** Structs encapsulating global ("common") variables ***/
 /* common  /crnt/ */
 typedef struct
 {
-  long double
+  double
 	*air,	/* Ai/lambda, real part */
 	*aii,	/* Ai/lambda, imaginary part */
 	*bir,	/* Bi/lambda, real part */
@@ -94,7 +92,7 @@ typedef struct
 	*cir,	/* Ci/lambda, real part */
 	*cii;	/* Ci/lambda, imaginary part */
 
-  complex long double *cur; /* Amplitude of basis function */
+  complex double *cur; /* Amplitude of basis function */
 
 } crnt_t;
 
@@ -115,7 +113,7 @@ typedef struct
 	*itag;	/* Segments tag number */
 
   /* Wire segment data */
-  long double
+  double
 	*x1, *y1, *z1,	/* End 1 coordinates of wire segments */
 	*x2, *y2, *z2,	/* End 2 coordinates of wire segments */
 	*x, *y, *z,		/* Coordinates of segment centers */
@@ -147,7 +145,7 @@ typedef struct
 	indd2,
 	ipgnd;
 
-  long double
+  double
 	s,
 	b,
 	xj,
@@ -164,7 +162,7 @@ typedef struct
 	t2yj,
 	t2zj;
 
-  complex long double
+  complex double
 	exk,
 	eyk,
 	ezk,
@@ -194,7 +192,7 @@ typedef struct
 	iax,
 	ixtyp;
 
-  long double
+  double
 	thets,
 	phis,
 	dth,
@@ -225,13 +223,13 @@ typedef struct
 	nxa[3],
 	nya[3];
 
-  long double
+  double
 	dxa[3],
 	dya[3],
 	xsa[3],
 	ysa[3];
 
-  complex long double
+  complex double
 	epscf,
 	*ar1,
 	*ar2,
@@ -248,14 +246,14 @@ typedef struct
 	iperf,	/* Type of ground flag */
 	nradl;	/* Number of radials in ground screen */
 
-  long double
+  double
 	t2,		/* Const for radial wire ground impedance */
 	cl,		/* Distance in wavelengths of cliff edge from origin */
 	ch,		/* Cliff height in wavelengths */
 	scrwl,	/* Wire length in radial ground screen normalized to w/length */
 	scrwr;	/* Radius of wires in screen in wavelengths */
 
-  complex long double
+  complex double
 	zrati,	/* Ground medium [Er-js/wE0]^-1/2 */
 	zrati2,	/* As above for 2nd ground medium */
 	t1,		/* Const for radial wire ground impedance */
@@ -266,13 +264,13 @@ typedef struct
 /* common  /gwav/ */
 typedef struct
 {
-  long double
+  double
 	r1,		/* Distance from current element to point where field is evaluated  */
 	r2,		/* Distance from image of element to point where field is evaluated */
 	zmh,	/* Z-Z', Z is height of field evaluation point */
 	zph;	/* Z+Z', Z' is height of current element */
 
-  complex long double
+  complex double
 	u,		/* (Er-jS/WE0)^-1/2 */
 	u2,		/* u^2 */
 	xx1,	/* G1*exp(jkR1.r[i])  */
@@ -285,7 +283,7 @@ typedef struct
 {
   int isnor;
 
-  long double
+  double
 	xo,
 	yo,
 	zo,
@@ -321,7 +319,7 @@ typedef struct
 	*iseg2,	/* Num of seg to which port 2 of network is connected */
 	*ntyp;	/* Type of networks */
 
-  long double
+  double
 	*x11r,	/* Real and imaginary parts of network impedances */
 	*x11i,
 	*x12r,
@@ -331,7 +329,7 @@ typedef struct
 	pin,	/* Total input power from sources */
 	pnls;	/* Power lost in networks */
 
-  complex long double zped;
+  complex double zped;
 
 } netcx_t;
 
@@ -352,7 +350,7 @@ typedef struct
 {
   int *ip;	/* Vector of indices of pivot elements used to factor matrix */
 
-  long double
+  double
 	epsr,	/* Relative dielectric constant of ground */
 	sig,	/* Conductivity of ground */
 	scrwlt,	/* Length of radials in ground screen approximation */
@@ -369,7 +367,7 @@ typedef struct
 	jsno,	/* Total number of entries in ax, bx, cx */
 	maxcon; /* Max. no. connections */
 
-  long double
+  double
 	*ax, *bx, *cx;	/* Store constants A, B, C used in current expansion */
 
 } segj_t;
@@ -379,7 +377,7 @@ typedef struct
 {
   int nop; /* My addition */
 
-  complex long double *ssx;
+  complex double *ssx;
 
 } smat_t;
 
@@ -388,7 +386,7 @@ typedef struct
 {
   int ij;
 
-  long double
+  double
 	zpk,
 	rkb2;
 
@@ -397,7 +395,7 @@ typedef struct
 /*common  /tmh/ */
 typedef struct
 {
-  long double
+  double
 	zpka,
 	rhks;
 
@@ -414,7 +412,7 @@ typedef struct
 	nvqd,	/* Number of applied current-slope discontinuity sources */
 	nqds;	/* Same as above (?) */
 
-  complex long double
+  complex double
 	*vqd,	/* Voltage of applied-current slope discontinuity sources */
 	*vqds,	/* Same as above (?) */
 	*vsant;	/* Voltages of applied field voltage sources */
@@ -430,7 +428,7 @@ typedef struct
 	*nctag,	/* Tag number of segments */
 	*ncseg;	/* Num of segs in set of segs that have same tag number */
 
-  complex long double
+  complex double
 	*y11a,	/* Self admittance of segments */
 	*y12a;	/* Mutual admittances stored in order 1,2 1,3 2,3 2,4 etc */
 
@@ -441,108 +439,108 @@ typedef struct
 {
   int nload;	/* Number of loading networks */
 
-  complex long double *zarray;	/* = Zi/(Di/lambda) */
+  complex double *zarray;	/* = Zi/(Di/lambda) */
 
 } zload_t;
 
-/* Returns the complex long double of the arguments */
-#define cmplx(r, i) ((r)+(i)*CPLX_01)
+/* Returns the complex double of the arguments */
+#define cmplx(r, i) ((r)+I*(i))
 
 /*------------------------------------------------------------------------*/
 
 /* Function prototypes produced by cproto */
 /* calculations.c */
-void cabc(complex long double *curx);
-void couple(complex long double *cur, long double wlam);
-void load(int *ldtyp, int *ldtag, int *ldtagf, int *ldtagt, long double *zlr, long double *zli, long double *zlc);
-void gf(long double zk, long double *co, long double *si);
-long double db10(long double x);
-long double db20(long double x);
-void intrp(long double x, long double y, complex long double *f1, complex long double *f2, complex long double *f3, complex long double *f4);
-void intx(long double el1, long double el2, long double b, int ij, long double *sgr, long double *sgi);
+void cabc(complex double *curx);
+void couple(complex double *cur, double wlam);
+void load(int *ldtyp, int *ldtag, int *ldtagf, int *ldtagt, double *zlr, double *zli, double *zlc);
+void gf(double zk, double *co, double *si);
+double db10(double x);
+double db20(double x);
+void intrp(double x, double y, complex double *f1, complex double *f2, complex double *f3, complex double *f4);
+void intx(double el1, double el2, double b, int ij, double *sgr, double *sgi);
 int min(int a, int b);
-void test(long double f1r, long double f2r, long double *tr, long double f1i, long double f2i, long double *ti, long double dmin);
-void sbf(int i, int is, long double *aa, long double *bb, long double *cc);
+void test(double f1r, double f2r, double *tr, double f1i, double f2i, double *ti, double dmin);
+void sbf(int i, int is, double *aa, double *bb, double *cc);
 void tbf(int i, int icap);
 void trio(int j);
-void zint(long double sigl, long double rolam, complex long double *zt);
-long double cang(complex long double z);
+void zint(double sigl, double rolam, complex double *zt);
+double cang(complex double z);
 /* fields.c */
-void efld(long double xi, long double yi, long double zi, long double ai, int ij);
-void eksc(long double s, long double z, long double rh, long double xk, int ij, complex long double *ezs, complex long double *ers, complex long double *ezc, complex long double *erc, complex long double *ezk, complex long double *erk);
-void ekscx(long double bx, long double s, long double z, long double rhx, long double xk, int ij, int inx1, int inx2, complex long double *ezs, complex long double *ers, complex long double *ezc, complex long double *erc, complex long double *ezk, complex long double *erk);
-void gh(long double zk, long double *hr, long double *hi);
-void gwave(complex long double *erv, complex long double *ezv, complex long double *erh, complex long double *ezh, complex long double *eph);
-void gx(long double zz, long double rh, long double xk, complex long double *gz, complex long double *gzp);
-void gxx(long double zz, long double rh, long double a, long double a2, long double xk, int ira, complex long double *g1, complex long double *g1p, complex long double *g2, complex long double *g2p, complex long double *g3, complex long double *gzp);
-void hfk(long double el1, long double el2, long double rhk, long double zpkx, long double *sgr, long double *sgi);
-void hintg(long double xi, long double yi, long double zi);
-void hsfld(long double xi, long double yi, long double zi, long double ai);
-void hsflx(long double s, long double rh, long double zpx, complex long double *hpk, complex long double *hps, complex long double *hpc);
-void nefld(long double xob, long double yob, long double zob, complex long double *ex, complex long double *ey, complex long double *ez);
+void efld(double xi, double yi, double zi, double ai, int ij);
+void eksc(double s, double z, double rh, double xk, int ij, complex double *ezs, complex double *ers, complex double *ezc, complex double *erc, complex double *ezk, complex double *erk);
+void ekscx(double bx, double s, double z, double rhx, double xk, int ij, int inx1, int inx2, complex double *ezs, complex double *ers, complex double *ezc, complex double *erc, complex double *ezk, complex double *erk);
+void gh(double zk, double *hr, double *hi);
+void gwave(complex double *erv, complex double *ezv, complex double *erh, complex double *ezh, complex double *eph);
+void gx(double zz, double rh, double xk, complex double *gz, complex double *gzp);
+void gxx(double zz, double rh, double a, double a2, double xk, int ira, complex double *g1, complex double *g1p, complex double *g2, complex double *g2p, complex double *g3, complex double *gzp);
+void hfk(double el1, double el2, double rhk, double zpkx, double *sgr, double *sgi);
+void hintg(double xi, double yi, double zi);
+void hsfld(double xi, double yi, double zi, double ai);
+void hsflx(double s, double rh, double zpx, complex double *hpk, complex double *hps, complex double *hpc);
+void nefld(double xob, double yob, double zob, complex double *ex, complex double *ey, complex double *ez);
 void nfpat(void);
-void nhfld(long double xob, long double yob, long double zob, complex long double *hx, complex long double *hy, complex long double *hz);
-void pcint(long double xi, long double yi, long double zi, long double cabi, long double sabi, long double salpi, complex long double *e);
-void unere(long double xob, long double yob, long double zob);
+void nhfld(double xob, double yob, double zob, complex double *hx, complex double *hy, complex double *hz);
+void pcint(double xi, double yi, double zi, double cabi, double sabi, double salpi, complex double *e);
+void unere(double xob, double yob, double zob);
 /* geometry.c */
-void arc(int itg, int ns, long double rada, long double ang1, long double ang2, long double rad);
+void arc(int itg, int ns, double rada, double ang1, double ang2, double rad);
 void conect(int ignd);
 void datagn(void);
-void helix(long double s, long double hl, long double a1, long double b1, long double a2, long double b2, long double rad, int ns, int itg);
+void helix(double s, double hl, double a1, double b1, double a2, double b2, double rad, int ns, int itg);
 int isegno(int itagi, int mx);
-void move(long double rox, long double roy, long double roz, long double xs, long double ys, long double zs, int its, int nrpt, int itgi);
-void patch(int nx, int ny, long double ax1, long double ay1, long double az1, long double ax2, long double ay2, long double az2, long double ax3, long double ay3, long double az3, long double ax4, long double ay4, long double az4);
+void move(double rox, double roy, double roz, double xs, double ys, double zs, int its, int nrpt, int itgi);
+void patch(int nx, int ny, double ax1, double ay1, double az1, double ax2, double ay2, double az2, double ax3, double ay3, double az3, double ax4, double ay4, double az4);
 void subph(int nx, int ny);
-void readgm(char *gm, int *i1, int *i2, long double *x1, long double *y1, long double *z1, long double *x2, long double *y2, long double *z2, long double *rad);
+void readgm(char *gm, int *i1, int *i2, double *x1, double *y1, double *z1, double *x2, double *y2, double *z2, double *rad);
 void reflc(int ix, int iy, int iz, int itx, int nop);
-void wire(long double xw1, long double yw1, long double zw1, long double xw2, long double yw2, long double zw2, long double rad, long double rdel, long double rrad, int ns, int itg);
+void wire(double xw1, double yw1, double zw1, double xw2, double yw2, double zw2, double rad, double rdel, double rrad, int ns, int itg);
 /* ground.c */
-void rom2(long double a, long double b, complex long double *sum, long double dmin);
-void sflds(long double t, complex long double *e);
+void rom2(double a, double b, complex double *sum, double dmin);
+void sflds(double t, complex double *e);
 /* input.c */
-void qdsrc(int is, complex long double v, complex long double *e);
-void readmn(char *gm, int *i1, int *i2, int *i3, int *i4, long double *f1, long double *f2, long double *f3, long double *f4, long double *f5, long double *f6);
+void qdsrc(int is, complex double v, complex double *e);
+void readmn(char *gm, int *i1, int *i2, int *i3, int *i4, double *f1, double *f2, double *f3, double *f4, double *f5, double *f6);
 /* main.c */
 int main(int argc, char **argv);
 void Null_Pointers(void);
-void prnt(int in1, int in2, int in3, long double fl1, long double fl2, long double fl3, long double fl4, long double fl5, long double fl6, char *ia, int ichar);
+void prnt(int in1, int in2, int in3, double fl1, double fl2, double fl3, double fl4, double fl5, double fl6, char *ia, int ichar);
 /* matrix.c */
-void cmset(int nrow, complex long double *cm, long double rkhx, int iexkx);
-void cmss(int j1, int j2, int im1, int im2, complex long double *cm, int nrow, int itrp);
-void cmsw(int j1, int j2, int i1, int i2, complex long double *cm, complex long double *cw, int ncw, int nrow, int itrp);
-void cmws(int j, int i1, int i2, complex long double *cm, int nr, complex long double *cw, int nw, int itrp);
-void cmww(int j, int i1, int i2, complex long double *cm, int nr, complex long double *cw, int nw, int itrp);
-void etmns(long double p1, long double p2, long double p3, long double p4, long double p5, long double p6, int ipr, complex long double *e);
-void factr(int n, complex long double *a, int *ip, int ndim);
-void factrs(int np, int nrow, complex long double *a, int *ip);
+void cmset(int nrow, complex double *cm, double rkhx, int iexkx);
+void cmss(int j1, int j2, int im1, int im2, complex double *cm, int nrow, int itrp);
+void cmsw(int j1, int j2, int i1, int i2, complex double *cm, complex double *cw, int ncw, int nrow, int itrp);
+void cmws(int j, int i1, int i2, complex double *cm, int nr, complex double *cw, int itrp);
+void cmww(int j, int i1, int i2, complex double *cm, int nr, complex double *cw, int nw, int itrp);
+void etmns(double p1, double p2, double p3, double p4, double p5, double p6, int ipr, complex double *e);
+void factr(int n, complex double *a, int *ip, int ndim);
+void factrs(int np, int nrow, complex double *a, int *ip);
 void fblock(int nrow, int ncol, int imax, int ipsym);
-void solve(int n, complex long double *a, int *ip, complex long double *b, int ndim);
-void solves(complex long double *a, int *ip, complex long double *b, int neq, int nrh, int np, int n, int mp, int m);
+void solve(int n, complex double *a, int *ip, complex double *b, int ndim);
+void solves(complex double *a, int *ip, complex double *b, int neq, int nrh, int np, int n, int mp, int m);
 /* misc.c */
 void usage(void);
 void abort_on_error(int why);
-void secnds(long double *x);
+void secnds(double *x);
 int stop(int flag);
 int load_line(char *buff, FILE *pfile);
-void mem_alloc(void **ptr, int req);
-void mem_realloc(void **ptr, int req);
+void mem_alloc(void **ptr, size_t req);
+void mem_realloc(void **ptr, size_t req);
 void free_ptr(void **ptr);
 /* network.c */
-void netwk(complex long double *cm, int *ip, complex long double *einc);
+void netwk(complex double *cm, int *ip, complex double *einc);
 /* radiation.c */
-void ffld(long double thet, long double phi, complex long double *eth, complex long double *eph);
-void fflds(long double rox, long double roy, long double roz, complex long double *scur, complex long double *ex, complex long double *ey, complex long double *ez);
-void gfld(long double rho, long double phi, long double rz, complex long double *eth, complex long double *epi, complex long double *erd, complex long double ux, int ksymp);
+void ffld(double thet, double phi, complex double *eth, complex double *eph);
+void fflds(double rox, double roy, double roz, complex double *scur, complex double *ex, complex double *ey, complex double *ez);
+void gfld(double rho, double phi, double rz, complex double *eth, complex double *epi, complex double *erd, complex double ux, int ksymp);
 void rdpat(void);
 /* somnec.c */
-void somnec(long double epr, long double sig, long double fmhz);
-void bessel(complex long double z, complex long double *j0, complex long double *j0p);
-void evlua(complex long double *erv, complex long double *ezv, complex long double *erh, complex long double *eph);
-void fbar(complex long double p, complex long double *r);
-void gshank(complex long double start, complex long double dela, complex long double *sum, int nans, complex long double *seed, int ibk, complex long double bk, complex long double delb);
-void hankel(complex long double z, complex long double *h0, complex long double *h0p);
-void lambda(long double t, complex long double *xlam, complex long double *dxlam);
-void rom1(int n, complex long double *sum, int nx);
-void saoa(long double t, complex long double *ans);
+void somnec(double epr, double sig, double fmhz);
+void bessel(complex double z, complex double *j0, complex double *j0p);
+void evlua(complex double *erv, complex double *ezv, complex double *erh, complex double *eph);
+void fbar(complex double p, complex double *r);
+void gshank(complex double start, complex double dela, complex double *sum, int nans, complex double *seed, int ibk, complex double bk, complex double delb);
+void hankel(complex double z, complex double *h0, complex double *h0p);
+void lambda(double t, complex double *xlam, complex double *dxlam);
+void rom1(int n, complex double *sum, int nx);
+void saoa(double t, complex double *ans);
 #endif
 
diff --git a/network.c b/network.c
old mode 100755
new mode 100644
index 884123c..a3f0fa6
--- a/network.c
+++ b/network.c
@@ -24,40 +24,22 @@
 *******************************************************************/
 
 #include "nec2c.h"
-
-/* common  /netcx/ */
-extern netcx_t netcx;
-
-/* common  /vsorc/ */
-extern vsorc_t vsorc;
-
-/* common  /data/ */
-extern data_t data;
-
-/* common  /crnt/ */
-extern crnt_t crnt;
-
-/* pointers to input/output files */
-extern FILE *input_fp, *output_fp, *plot_fp;
+#include "shared.h"
 
 /*-------------------------------------------------------------------*/
 
-
 /* subroutine netwk solves for structure currents for a given */
 /* excitation including the effect of non-radiating networks if */
 /* present. */
-void netwk( complex long double *cm, int *ip, complex long double *einc )
+void netwk( complex double *cm, int *ip, complex double *einc )
 {
   int *ipnt = NULL, *nteqa = NULL, *ntsca = NULL;
-  int jump1, jump2, nteq=0, ntsc=0, nseg2, irow2=0, j, ndimn;
-  int neqz2, neqt, irow1=0, i, nseg1, isc1=0, isc2=0;
-  long double asmx, asa, pwr, y11r, y11i, y12r, y12i, y22r, y22i;
-  complex long double *vsrc = NULL, *rhs = NULL, *cmn = NULL;
-  complex long double *rhnt = NULL, *rhnx = NULL, ymit, vlt, cux;
-
-  neqz2= netcx.neq2;
-  if( neqz2 == 0)
-	neqz2=1;
+  int nteq=0, ntsc=0, irow2=0, j, ndimn;
+  int neqt, irow1=0, i, isc1=0;
+  size_t mreq;
+  double pwr;
+  complex double *vsrc = NULL, *rhs = NULL, *cmn = NULL;
+  complex double *rhnt = NULL, *rhnx = NULL, ymit, vlt, cux=CPLX_00;
 
   netcx.pin=0.;
   netcx.pnls=0.;
@@ -67,29 +49,38 @@ void netwk( complex long double *cm, int *ip, complex long double *einc )
   /* Allocate network buffers */
   if( netcx.nonet != 0 )
   {
-	mem_alloc( (void *)&rhs, data.np3m * sizeof(complex long double) );
-
-	i = j * sizeof(complex long double);
-	mem_alloc( (void *)&rhnt, i );
-	mem_alloc( (void *)&rhnx, i );
-	mem_alloc( (void *)&cmn, i * j );
-
-	i = j * sizeof(int);
-	mem_alloc( (void *)&ntsca, i );
-	mem_alloc( (void *)&nteqa, i );
-	mem_alloc( (void *)&ipnt, i );
-
-	mem_alloc( (void *)&vsrc, vsorc.nsant * sizeof(complex long double) );
+	mreq = (size_t)data.np3m;
+	mreq *= sizeof(complex double);
+	mem_alloc( (void *)&rhs, mreq );
+
+	mreq = (size_t)j;
+	mreq *= sizeof(complex double);
+	mem_alloc( (void *)&rhnt, mreq );
+	mem_alloc( (void *)&rhnx, mreq );
+	mreq *= (size_t)j;
+	mem_alloc( (void *)&cmn, mreq );
+
+	mreq = (size_t)j;
+	mreq *= sizeof(int);
+	mem_alloc( (void *)&ntsca, mreq );
+	mem_alloc( (void *)&nteqa, mreq );
+	mem_alloc( (void *)&ipnt, mreq );
+
+	mreq = (size_t)vsorc.nsant;
+	mreq *= sizeof(complex double);
+	mem_alloc( (void *)&vsrc, mreq );
   }
   else
 	if( netcx.masym != 0)
 	{
-	  i = j * sizeof(int);
-	  mem_alloc( (void *)&ipnt, i );
+	  mreq = (size_t)j;
+	  mreq *= sizeof(int);
+	  mem_alloc( (void *)&ipnt, mreq );
 	}
 
   if( netcx.ntsol == 0)
   {
+	int nseg1;
 	/* compute relative matrix asymmetry */
 	if( netcx.masym != 0)
 	{
@@ -155,6 +146,7 @@ void netwk( complex long double *cm, int *ip, complex long double *einc )
 
 	  if( irow1 >= 2)
 	  {
+		double asmx, asa;
 		for( i = 0; i < irow1; i++ )
 		{
 		  isc1= ipnt[i]-1;
@@ -184,7 +176,7 @@ void netwk( complex long double *cm, int *ip, complex long double *einc )
 		  for( j = 0; j < isc1; j++ )
 		  {
 			cux= cmn[i+j*ndimn];
-			pwr= cabsl(( cux- cmn[j+i*ndimn])/ cux);
+			pwr= cabs(( cux- cmn[j+i*ndimn])/ cux);
 			asa += pwr* pwr;
 
 			if( pwr < asmx)
@@ -198,11 +190,11 @@ void netwk( complex long double *cm, int *ip, complex long double *einc )
 
 		} /* for( i = 1; i < irow1; i++ ) */
 
-		asa= sqrtl( asa*2./ (long double)( irow1*( irow1-1)));
+		asa= sqrt( asa*2./ (double)( irow1*( irow1-1)));
 		fprintf( output_fp, "\n\n"
 			"   MAXIMUM RELATIVE ASYMMETRY OF THE DRIVING POINT ADMITTANCE\n"
-			"   MATRIX IS %10.3LE FOR SEGMENTS %d AND %d\n"
-			"   RMS RELATIVE ASYMMETRY IS %10.3LE",
+			"   MATRIX IS %10.3E FOR SEGMENTS %d AND %d\n"
+			"   RMS RELATIVE ASYMMETRY IS %10.3E",
 			asmx, nteq, ntsc, asa );
 
 	  } /* if( irow1 >= 2) */
@@ -226,6 +218,9 @@ void netwk( complex long double *cm, int *ip, complex long double *einc )
 
 	  for( j = 0; j < netcx.nonet; j++ )
 	  {
+		int jump1, jump2, isc2=0, nseg2;
+		double y11r, y11i, y12r, y12i, y22r, y22i;
+
 		nseg1= netcx.iseg1[j];
 		nseg2= netcx.iseg2[j];
 
@@ -242,17 +237,17 @@ void netwk( complex long double *cm, int *ip, complex long double *einc )
 		{
 		  y22r= TP* netcx.x11i[j]/ data.wlam;
 		  y12r=0.;
-		  y12i=1./( netcx.x11r[j]* sinl( y22r));
+		  y12i=1./( netcx.x11r[j]* sin( y22r));
 		  y11r= netcx.x12r[j];
-		  y11i=- y12i* cosl( y22r);
+		  y11i= -y12i* cos( y22r);
 		  y22r= netcx.x22r[j];
 		  y22i= y11i+ netcx.x22i[j];
 		  y11i= y11i+ netcx.x12i[j];
 
 		  if( netcx.ntyp[j] != 2)
 		  {
-			y12r=- y12r;
-			y12i=- y12i;
+			y12r= -y12r;
+			y12i= -y12i;
 		  }
 
 		} /* if( netcx.ntyp[j] <= 1) */
@@ -488,15 +483,15 @@ void netwk( complex long double *cm, int *ip, complex long double *einc )
 	  ymit= cux/ vlt;
 	  netcx.zped= vlt/ cux;
 	  irow2= data.itag[irow1];
-	  pwr=.5* creall( vlt* conjl( cux));
+	  pwr=.5* creal( vlt* conj( cux));
 	  netcx.pnls= netcx.pnls- pwr;
 
 	  if( netcx.nprint == 0)
 		fprintf( output_fp, "\n"
-			" %4d %5d %11.4LE %11.4LE %11.4LE %11.4LE"
-			" %11.4LE %11.4LE %11.4LE %11.4LE %11.4LE",
-			irow2, irow1+1, creall(vlt), cimagl(vlt), creall(cux), cimagl(cux),
-			creall(netcx.zped), cimagl(netcx.zped), creall(ymit), cimagl(ymit), pwr );
+			" %4d %5d %11.4E %11.4E %11.4E %11.4E"
+			" %11.4E %11.4E %11.4E %11.4E %11.4E",
+			irow2, irow1+1, creal(vlt), cimag(vlt), creal(cux), cimag(cux),
+			creal(netcx.zped), cimag(netcx.zped), creal(ymit), cimag(ymit), pwr );
 	}
 
 	if( ntsc != 0)
@@ -509,15 +504,15 @@ void netwk( complex long double *cm, int *ip, complex long double *einc )
 		ymit= cux/ vlt;
 		netcx.zped= vlt/ cux;
 		irow2= data.itag[irow1];
-		pwr=.5* creall( vlt* conjl( cux));
+		pwr=.5* creal( vlt* conj( cux));
 		netcx.pnls= netcx.pnls- pwr;
 
 		if( netcx.nprint == 0)
 		  fprintf( output_fp, "\n"
-			  " %4d %5d %11.4LE %11.4LE %11.4LE %11.4LE"
-			  " %11.4LE %11.4LE %11.4LE %11.4LE %11.4LE",
-			  irow2, irow1+1, creall(vlt), cimagl(vlt), creall(cux), cimagl(cux),
-			  creall(netcx.zped), cimagl(netcx.zped), creall(ymit), cimagl(ymit), pwr );
+			  " %4d %5d %11.4E %11.4E %11.4E %11.4E"
+			  " %11.4E %11.4E %11.4E %11.4E %11.4E",
+			  irow2, irow1+1, creal(vlt), cimag(vlt), creal(cux), cimag(cux),
+			  creal(netcx.zped), cimag(netcx.zped), creal(ymit), cimag(ymit), pwr );
 
 	  } /* for( i = 0; i < ntsc; i++ ) */
 
@@ -533,7 +528,10 @@ void netwk( complex long double *cm, int *ip, complex long double *einc )
   }
 
   if( (vsorc.nsant+vsorc.nvqd) == 0)
+  {
+	free_ptr( (void *)&ipnt );
 	return;
+  }
 
   fprintf( output_fp, "\n\n\n"
 	  "                        "
@@ -576,7 +574,7 @@ void netwk( complex long double *cm, int *ip, complex long double *einc )
 
 	  ymit= cux/ vlt;
 	  netcx.zped= vlt/ cux;
-	  pwr=.5* creall( vlt* conjl( cux));
+	  pwr=.5* creal( vlt* conj( cux));
 	  netcx.pin= netcx.pin+ pwr;
 
 	  if( irow1 != 0)
@@ -584,40 +582,38 @@ void netwk( complex long double *cm, int *ip, complex long double *einc )
 
 	  irow2= data.itag[isc1];
 	  fprintf( output_fp, "\n"
-		  " %4d %5d %11.4LE %11.4LE %11.4LE %11.4LE"
-		  " %11.4LE %11.4LE %11.4LE %11.4LE %11.4LE",
-		  irow2, isc1+1, creall(vlt), cimagl(vlt), creall(cux), cimagl(cux),
-		  creall(netcx.zped), cimagl(netcx.zped), creall(ymit), cimagl(ymit), pwr );
+		  " %4d %5d %11.4E %11.4E %11.4E %11.4E"
+		  " %11.4E %11.4E %11.4E %11.4E %11.4E",
+		  irow2, isc1+1, creal(vlt), cimag(vlt), creal(cux), cimag(cux),
+		  creal(netcx.zped), cimag(netcx.zped), creal(ymit), cimag(ymit), pwr );
 
 	} /* for( i = 0; i < vsorc.nsant; i++ ) */
 
   } /* if( vsorc.nsant != 0) */
 
-  if( vsorc.nvqd == 0)
-	return;
+  if( vsorc.nvqd != 0)
+	for( i = 0; i < vsorc.nvqd; i++ )
+	{
+	  isc1= vsorc.ivqd[i]-1;
+	  vlt= vsorc.vqd[i];
+	  cux= cmplx( crnt.air[isc1], crnt.aii[isc1]);
+	  ymit= cmplx( crnt.bir[isc1], crnt.bii[isc1]);
+	  netcx.zped= cmplx( crnt.cir[isc1], crnt.cii[isc1]);
+	  pwr= data.si[isc1]* TP*.5;
+	  cux=( cux- ymit* sin( pwr)+ netcx.zped* cos( pwr))* data.wlam;
+	  ymit= cux/ vlt;
+	  netcx.zped= vlt/ cux;
+	  pwr=.5* creal( vlt* conj( cux));
+	  netcx.pin= netcx.pin+ pwr;
+	  irow2= data.itag[isc1];
 
-  for( i = 0; i < vsorc.nvqd; i++ )
-  {
-	isc1= vsorc.ivqd[i]-1;
-	vlt= vsorc.vqd[i];
-	cux= cmplx( crnt.air[isc1], crnt.aii[isc1]);
-	ymit= cmplx( crnt.bir[isc1], crnt.bii[isc1]);
-	netcx.zped= cmplx( crnt.cir[isc1], crnt.cii[isc1]);
-	pwr= data.si[isc1]* TP*.5;
-	cux=( cux- ymit* sinl( pwr)+ netcx.zped* cosl( pwr))* data.wlam;
-	ymit= cux/ vlt;
-	netcx.zped= vlt/ cux;
-	pwr=.5* creall( vlt* conjl( cux));
-	netcx.pin= netcx.pin+ pwr;
-	irow2= data.itag[isc1];
-
-	fprintf( output_fp,	"\n"
-		" %4d %5d %11.4LE %11.4LE %11.4LE %11.4LE"
-		" %11.4LE %11.4LE %11.4LE %11.4LE %11.4LE",
-		irow2, isc1+1, creall(vlt), cimagl(vlt), creall(cux), cimagl(cux),
-		creall(netcx.zped), cimagl(netcx.zped), creall(ymit), cimagl(ymit), pwr );
-
-  } /* for( i = 0; i < vsorc.nvqd; i++ ) */
+	  fprintf( output_fp,	"\n"
+		  " %4d %5d %11.4E %11.4E %11.4E %11.4E"
+		  " %11.4E %11.4E %11.4E %11.4E %11.4E",
+		  irow2, isc1+1, creal(vlt), cimag(vlt), creal(cux), cimag(cux),
+		  creal(netcx.zped), cimag(netcx.zped), creal(ymit), cimag(ymit), pwr );
+
+	} /* for( i = 0; i < vsorc.nvqd; i++ ) */
 
   /* Free network buffers */
   free_ptr( (void *)&ipnt );
diff --git a/radiation.c b/radiation.c
index 0a3a7a0..bea8d50 100644
--- a/radiation.c
+++ b/radiation.c
@@ -24,57 +24,33 @@
  ******************************************************************/
 
 #include "nec2c.h"
-
-/* common  /data/ */
-extern data_t data;
-
-/* common  /gnd/ */
-extern gnd_t gnd;
-
-/* common  /crnt/ */
-extern crnt_t crnt;
-
-/* common  /gwav/ */
-extern gwav_t gwav;
-
-/* common  /fpat/ */
-extern fpat_t fpat;
-
-/* pointers to input/output files */
-extern FILE *input_fp, *output_fp, *plot_fp;
-
-/* common  /save/ */
-extern save_t save;
-
-/* common  /plot/ */
-extern plot_t plot;
-
+#include "shared.h"
 
 /*-----------------------------------------------------------------------*/
 
 /* ffld calculates the far zone radiated electric fields, */
 /* the factor exp(j*k*r)/(r/lamda) not included */
-void ffld( long double thet, long double phi,
-	complex long double *eth, complex long double *eph )
+void ffld( double thet, double phi,
+	complex double *eth, complex double *eph )
 {
   int k, i, ip, jump;
-  long double phx, phy, roz, rozs, thx, thy, thz, rox, roy;
-  long double tthet=0., darg=0., omega, el, sill, top, bot, a;
-  long double too, boo, b, c, d, rr, ri, arg, dr, rfl, rrz;
-  complex long double cix=CPLX_00, ciy=CPLX_00, ciz=CPLX_00;
-  complex long double exa, ccx=CPLX_00, ccy=CPLX_00, ccz=CPLX_00, cdp;
-  complex long double zrsin, rrv=CPLX_00, rrh=CPLX_00, rrv1=CPLX_00;
-  complex long double rrh1=CPLX_00, rrv2=CPLX_00, rrh2=CPLX_00;
-  complex long double tix, tiy, tiz, zscrn, ex=CPLX_00, ey=CPLX_00, ez=CPLX_00, gx, gy, gz;
-
-  phx=- sinl( phi);
-  phy= cosl( phi);
-  roz= cosl( thet);
+  double phx, phy, roz, rozs, thx, thy, thz, rox, roy;
+  double tthet=0., darg=0., omega, el, sill, top, bot, a;
+  double too, boo, b, c, d, rr, ri, arg, dr, rfl, rrz;
+  complex double cix=CPLX_00, ciy=CPLX_00, ciz=CPLX_00;
+  complex double exa, ccx=CPLX_00, ccy=CPLX_00, ccz=CPLX_00, cdp;
+  complex double zrsin, rrv=CPLX_00, rrh=CPLX_00, rrv1=CPLX_00;
+  complex double rrh1=CPLX_00, rrv2=CPLX_00, rrh2=CPLX_00;
+  complex double tix, tiy, tiz, zscrn, ex=CPLX_00, ey=CPLX_00, ez=CPLX_00, gx, gy, gz;
+
+  phx= -sin( phi);
+  phy= cos( phi);
+  roz= cos( thet);
   rozs= roz;
   thx= roz* phy;
-  thy=- roz* phx;
-  thz=- sinl( thet);
-  rox=- thz* phy;
+  thy= -roz* phx;
+  thz= -sin( thet);
+  rox= -thz* phy;
   roy= thz* phx;
 
   jump = FALSE;
@@ -95,7 +71,7 @@ void ffld( long double thet, long double phi,
 		else
 		{
 		  /* for infinite planar ground */
-		  zrsin= csqrtl(1.- gnd.zrati* gnd.zrati* thz* thz);
+		  zrsin= csqrt(1.- gnd.zrati* gnd.zrati* thz* thz);
 		  rrv=-( roz- gnd.zrati* zrsin)/( roz+ gnd.zrati* zrsin);
 		  rrh=( gnd.zrati* roz- zrsin)/( gnd.zrati* roz+ zrsin);
 
@@ -106,18 +82,18 @@ void ffld( long double thet, long double phi,
 		{
 		  rrv1= rrv;
 		  rrh1= rrh;
-		  tthet= tanl( thet);
+		  tthet= tan( thet);
 
 		  if( gnd.ifar != 4)
 		  {
-			zrsin= csqrtl(1.- gnd.zrati2* gnd.zrati2* thz* thz);
+			zrsin= csqrt(1.- gnd.zrati2* gnd.zrati2* thz* thz);
 			rrv2=-( roz- gnd.zrati2* zrsin)/( roz+ gnd.zrati2* zrsin);
 			rrh2=( gnd.zrati2* roz- zrsin)/( gnd.zrati2* roz+ zrsin);
-			darg=- TP*2.* gnd.ch* roz;
+			darg= -TP*2.* gnd.ch* roz;
 		  }
 		} /* if( gnd.ifar > 1) */
 
-		roz=- roz;
+		roz= -roz;
 		ccx= cix;
 		ccy= ciy;
 		ccz= ciz;
@@ -137,18 +113,18 @@ void ffld( long double thet, long double phi,
 		top= el+ sill;
 		bot= el- sill;
 
-		if( fabsl( omega) >= 1.0e-7)
-		  a=2.* sinl( sill)/ omega;
+		if( fabs( omega) >= 1.0e-7)
+		  a=2.* sin( sill)/ omega;
 		else
 		  a=(2.- omega* omega* el* el/3.)* el;
 
-		if( fabsl( top) >= 1.0e-7)
-		  too= sinl( top)/ top;
+		if( fabs( top) >= 1.0e-7)
+		  too= sin( top)/ top;
 		else
 		  too=1.- top* top/6.;
 
-		if( fabsl( bot) >= 1.0e-7)
-		  boo= sinl( bot)/ bot;
+		if( fabs( bot) >= 1.0e-7)
+		  boo= sin( bot)/ bot;
 		else
 		  boo=1.- bot* bot/6.;
 
@@ -161,7 +137,7 @@ void ffld( long double thet, long double phi,
 		if( (k != 1) || (gnd.ifar < 2) )
 		{
 		  /* summation for far field integral */
-		  exa= cmplx( cosl( arg), sinl( arg))* cmplx( rr, ri);
+		  exa= cmplx( cos( arg), sin( arg))* cmplx( rr, ri);
 		  cix= cix+ exa* data.cab[i];
 		  ciy= ciy+ exa* data.sab[i];
 		  ciz= ciz+ exa* data.salp[i];
@@ -191,7 +167,7 @@ void ffld( long double thet, long double phi,
 		} /* if( gnd.ifar == 2) */
 		else
 		{
-		  d= sqrtl( d*d + (data.y[i]-dr*phx)*(data.y[i]-dr*phx) );
+		  d= sqrt( d*d + (data.y[i]-dr*phx)*(data.y[i]-dr*phx) );
 		  if( gnd.ifar == 3)
 		  {
 			if(( gnd.cl- d) > 0.)
@@ -212,9 +188,9 @@ void ffld( long double thet, long double phi,
 			{
 			  /* radial wire ground screen reflection coefficient */
 			  d= d+ gnd.t2;
-			  zscrn= gnd.t1* d* logl( d/ gnd.t2);
+			  zscrn= gnd.t1* d* log( d/ gnd.t2);
 			  zscrn=( zscrn* gnd.zrati)/( ETA* gnd.zrati+ zscrn);
-			  zrsin= csqrtl(1.- zscrn* zscrn* thz* thz);
+			  zrsin= csqrt(1.- zscrn* zscrn* thz* thz);
 			  rrv=( roz+ zscrn* zrsin)/(- roz+ zscrn* zrsin);
 			  rrh=( zscrn* roz+ zrsin)/( zscrn* roz- zrsin);
 			} /* if(( gnd.scrwl- d) < 0.) */
@@ -252,7 +228,7 @@ void ffld( long double thet, long double phi,
 
 		/* contribution of each image segment modified by */
 		/* reflection coef, for cliff and ground screen problems */
-		exa= cmplx( cosl( arg), sinl( arg))* cmplx( rr, ri);
+		exa= cmplx( cos( arg), sin( arg))* cmplx( rr, ri);
 		tix= exa* data.cab[i];
 		tiy= exa* data.sab[i];
 		tiz= exa* data.salp[i];
@@ -306,7 +282,7 @@ void ffld( long double thet, long double phi,
   rfl=-1.;
   for( ip = 0; ip < gnd.ksymp; ip++ )
   {
-	rfl=- rfl;
+	rfl= -rfl;
 	rrz= roz* rfl;
 	fflds( rox, roy, rrz, &crnt.cur[data.n], &gx, &gy, &gz);
 
@@ -320,13 +296,13 @@ void ffld( long double thet, long double phi,
 
 	if( gnd.iperf == 1)
 	{
-	  gx=- gx;
-	  gy=- gy;
-	  gz=- gz;
+	  gx= -gx;
+	  gy= -gy;
+	  gz= -gz;
 	}
 	else
 	{
-	  rrv= csqrtl(1.- gnd.zrati* gnd.zrati* thz* thz);
+	  rrv= csqrt(1.- gnd.zrati* gnd.zrati* thz* thz);
 	  rrh= gnd.zrati* roz;
 	  rrh=( rrh- rrv)/( rrh+ rrv);
 	  rrv= gnd.zrati* rrv;
@@ -357,14 +333,14 @@ void ffld( long double thet, long double phi,
 
 /* calculates the xyz components of the electric */
 /* field due to surface currents */
-void fflds( long double rox, long double roy, long double roz,
-	complex long double *scur, complex long double *ex,
-	complex long double *ey, complex long double *ez )
+void fflds( double rox, double roy, double roz,
+	complex double *scur, complex double *ex,
+	complex double *ey, complex double *ez )
 {
-  long double *xs, *ys, *zs, *s;
+  double *xs, *ys, *zs, *s;
   int j, i, k;
-  long double arg;
-  complex long double ct;
+  double arg;
+  complex double ct;
 
   xs = data.px;
   ys = data.py;
@@ -380,7 +356,7 @@ void fflds( long double rox, long double roy, long double roz,
   {
 	i++;
 	arg= TP*( rox* xs[i]+ roy* ys[i]+ roz* zs[i]);
-	ct= cmplx( cosl( arg)* s[i], sinl( arg)* s[i]);
+	ct= cmplx( cos( arg)* s[i], sin( arg)* s[i]);
 	k=3*j;
 	*ex += scur[k  ]* ct;
 	*ey += scur[k+1]* ct;
@@ -398,29 +374,29 @@ void fflds( long double rox, long double roy, long double roz,
 /*-----------------------------------------------------------------------*/
 
 /* gfld computes the radiated field including ground wave. */
-void gfld( long double rho, long double phi, long double rz,
-	complex long double *eth, complex long double *epi,
-	complex long double *erd, complex long double ux, int ksymp )
+void gfld( double rho, double phi, double rz,
+	complex double *eth, complex double *epi,
+	complex double *erd, complex double ux, int ksymp )
 {
   int i, k;
-  long double b, r, thet, arg, phx, phy, rx, ry, dx, dy, dz, rix, riy, rhs, rhp;
-  long double rhx, rhy, calp, cbet, sbet, cph, sph, el, rfl, riz, thx, thy, thz;
-  long double rxyz, rnx, rny, rnz, omega, sill, top, bot, a, too, boo, c, rr, ri;
-  complex long double cix, ciy, ciz, exa, erv;
-  complex long double ezv, erh, eph, ezh, ex, ey;
+  double b, r, thet, arg, phx, phy, rx, ry, dx, dy, dz, rix, riy, rhs, rhp;
+  double rhx, rhy, calp, cbet, sbet, cph, sph, el, rfl, riz, thx, thy, thz;
+  double rxyz, rnx, rny, rnz, omega, sill, top, bot, a, too, boo, c, rr, ri;
+  complex double cix, ciy, ciz, exa, erv;
+  complex double ezv, erh, eph, ezh, ex, ey;
 
-  r= sqrtl( rho*rho+ rz*rz );
+  r= sqrt( rho*rho+ rz*rz );
   if( (ksymp == 1) || (cabs(ux) > .5) || (r > 1.e5) )
   {
 	/* computation of space wave only */
 	if( rz >= 1.0e-20)
-	  thet= atanl( rho/ rz);
+	  thet= atan( rho/ rz);
 	else
 	  thet= PI*.5;
 
 	ffld( thet, phi, eth, epi);
-	arg=- TP* r;
-	exa= cmplx( cosl( arg), sinl( arg))/ r;
+	arg= -TP* r;
+	exa= cmplx( cos( arg), sin( arg))/ r;
 	*eth= *eth* exa;
 	*epi= *epi* exa;
 	*erd=CPLX_00;
@@ -430,10 +406,10 @@ void gfld( long double rho, long double phi, long double rz,
   /* computation of space and ground waves. */
   gwav.u= ux;
   gwav.u2= gwav.u* gwav.u;
-  phx=- sinl( phi);
-  phy= cosl( phi);
+  phx= -sin( phi);
+  phy= cos( phi);
   rx= rho* phy;
-  ry=- rho* phx;
+  ry= -rho* phx;
   cix=CPLX_00;
   ciy=CPLX_00;
   ciz=CPLX_00;
@@ -447,7 +423,7 @@ void gfld( long double rho, long double phi, long double rz,
 	rix= rx- data.x[i];
 	riy= ry- data.y[i];
 	rhs= rix* rix+ riy* riy;
-	rhp= sqrtl( rhs);
+	rhp= sqrt( rhs);
 
 	if( rhp >= 1.0e-6)
 	{
@@ -463,7 +439,7 @@ void gfld( long double rho, long double phi, long double rz,
 	calp=1.- dz* dz;
 	if( calp >= 1.0e-6)
 	{
-	  calp= sqrtl( calp);
+	  calp= sqrt( calp);
 	  cbet= dx/ calp;
 	  sbet= dy/ calp;
 	  cph= rhx* cbet+ rhy* sbet;
@@ -482,9 +458,9 @@ void gfld( long double rho, long double phi, long double rz,
 	/* constant, sine, and cosine current distributions */
 	for( k = 0; k < 2; k++ )
 	{
-	  rfl=- rfl;
+	  rfl= -rfl;
 	  riz= rz- data.z[i]* rfl;
-	  rxyz= sqrtl( rix* rix+ riy* riy+ riz* riz);
+	  rxyz= sqrt( rix* rix+ riy* riy+ riz* riz);
 	  rnx= rix/ rxyz;
 	  rny= riy/ rxyz;
 	  rnz= riz/ rxyz;
@@ -493,18 +469,18 @@ void gfld( long double rho, long double phi, long double rz,
 	  top= el+ sill;
 	  bot= el- sill;
 
-	  if( fabsl( omega) >= 1.0e-7)
-		a=2.* sinl( sill)/ omega;
+	  if( fabs( omega) >= 1.0e-7)
+		a=2.* sin( sill)/ omega;
 	  else
 		a=(2.- omega* omega* el* el/3.)* el;
 
-	  if( fabsl( top) >= 1.0e-7)
-		too= sinl( top)/ top;
+	  if( fabs( top) >= 1.0e-7)
+		too= sin( top)/ top;
 	  else
 		too=1.- top* top/6.;
 
-	  if( fabsl( bot) >= 1.0e-7)
-		boo= sinl( bot)/ bot;
+	  if( fabs( bot) >= 1.0e-7)
+		boo= sin( bot)/ bot;
 	  else
 		boo=1.- bot* bot/6.;
 
@@ -513,7 +489,7 @@ void gfld( long double rho, long double phi, long double rz,
 	  rr= a* crnt.air[i]+ b* crnt.bii[i]+ c* crnt.cir[i];
 	  ri= a* crnt.aii[i]- b* crnt.bir[i]+ c* crnt.cii[i];
 	  arg= TP*( data.x[i]* rnx+ data.y[i]* rny+ data.z[i]* rnz* rfl);
-	  exa= cmplx( cosl( arg), sinl( arg))* cmplx( rr, ri)/ TP;
+	  exa= cmplx( cos( arg), sin( arg))* cmplx( rr, ri)/ TP;
 
 	  if( k != 1 )
 	  {
@@ -543,8 +519,8 @@ void gfld( long double rho, long double phi, long double rz,
 
   } /* for( i = 0; i < n; i++ ) */
 
-  arg=- TP* r;
-  exa= cmplx( cosl( arg), sinl( arg));
+  arg= -TP* r;
+  exa= cmplx( cos( arg), sin( arg));
   cix= cix* exa;
   ciy= ciy* exa;
   ciz= ciz* exa;
@@ -552,8 +528,8 @@ void gfld( long double rho, long double phi, long double rz,
   rny= ry/ r;
   rnz= rz/ r;
   thx= rnz* phy;
-  thy=- rnz* phx;
-  thz=- rho/ r;
+  thy= -rnz* phx;
+  thz= -rho/ r;
   *eth= cix* thx+ ciy* thy+ ciz* thz;
   *epi= cix* phx+ ciy* phy;
   *erd= cix* rnx+ ciy* rny+ ciz* rnz;
@@ -569,21 +545,25 @@ void rdpat( void )
   char  *hpol[3] = { "LINEAR", "RIGHT ", "LEFT  " };
   char  *igtp[2] = { "----- POWER GAINS ----- ", "--- DIRECTIVE GAINS ---" };
   char  *igax[4] = { " MAJOR", " MINOR", " VERTC", " HORIZ" };
-  char *igntp[5] =  { " MAJOR AXIS", "  MINOR AXIS",
+  char *igntp[5] = { " MAJOR AXIS", "  MINOR AXIS",
 	"    VERTICAL", "  HORIZONTAL", "       TOTAL " };
 
   char *hclif=NULL, *isens;
   int i, j, jump, itmp1, itmp2, kth, kph, itmp3, itmp4;
-  long double exrm=0., exra=0., prad, gcon, gcop, gmax, pint, tmp1, tmp2;
-  long double phi, pha, thet, tha, erdm=0., erda=0., ethm2, ethm, *gain = NULL;
-  long double etha, ephm2, ephm, epha, tilta, emajr2, eminr2, axrat;
-  long double dfaz, dfaz2, cdfaz, tstor1=0., tstor2, stilta, gnmj;
-  long double gnmn, gnv, gnh, gtot, tmp3, tmp4, da, tmp5, tmp6;
-  complex long double  eth, eph, erd;
+  double exrm=0., exra=0., prad, gcon, gcop, gmax, pint, tmp1, tmp2;
+  double phi, pha, thet, tha, erdm=0., erda=0., ethm2, ethm, *gain = NULL;
+  double etha, ephm2, ephm, epha, tilta, emajr2, eminr2, axrat;
+  double dfaz, dfaz2, cdfaz, tstor1=0., tstor2, stilta, gnmj;
+  double gnmn, gnv, gnh, gtot, tmp3, tmp4, da, tmp5, tmp6;
+  complex double  eth, eph, erd;
 
   /* Allocate memory to gain buffer */
   if( fpat.inor > 0 )
-	mem_alloc( (void *)&gain, fpat.nth*fpat.nph * sizeof(long double) );
+  {
+	size_t mreq = (size_t)(fpat.nth * fpat.nph);
+	mreq *= sizeof(double);
+	mem_alloc( (void *)&gain, mreq );
+  }
 
   if( gnd.ifar > 1)
   {
@@ -600,9 +580,9 @@ void rdpat( void )
 		  "                               "
 		  "NUM OF WIRES= %d\n"
 		  "                               "
-		  "WIRE LENGTH= %8.2LF METERS\n"
+		  "WIRE LENGTH= %8.2f METERS\n"
 		  "                               "
-		  "WIRE RADIUS= %10.3LE METERS",
+		  "WIRE RADIUS= %10.3E METERS",
 		  gnd.nradl, save.scrwlt, save.scrwrt );
 
 	  if( gnd.ifar == 4)
@@ -619,21 +599,21 @@ void rdpat( void )
 
 	  gnd.cl= fpat.clt/ data.wlam;
 	  gnd.ch= fpat.cht/ data.wlam;
-	  gnd.zrati2= csqrtl(1./ cmplx( fpat.epsr2,- fpat.sig2* data.wlam*59.96));
+	  gnd.zrati2= csqrt(1./ cmplx( fpat.epsr2,- fpat.sig2* data.wlam*59.96));
 
 	  fprintf( output_fp, "\n"
 		  "                               "
 		  "--- %s CLIFF ---\n"
 		  "                               "
-		  "EDGE DISTANCE= %9.2LF METERS\n"
+		  "EDGE DISTANCE= %9.2f METERS\n"
 		  "                               "
-		  "       HEIGHT= %9.2LF METERS\n"
+		  "       HEIGHT= %9.2f METERS\n"
 		  "                               "
 		  "--- SECOND MEDIUM ---\n"
 		  "                               "
-		  "RELATIVE DIELECTRIC CONST= %10.3LF\n"
+		  "RELATIVE DIELECTRIC CONST= %10.3f\n"
 		  "                               "
-		  "      GROUND CONDUCTIVITY= %10.3LF MHOS",
+		  "      GROUND CONDUCTIVITY= %10.3f MHOS",
 		  hclif, fpat.clt, fpat.cht, fpat.epsr2, fpat.sig2 );
 
 	} /* if( ! jump ) */
@@ -665,13 +645,13 @@ void rdpat( void )
 	{
 	  exrm=1./ fpat.rfld;
 	  exra= fpat.rfld/ data.wlam;
-	  exra=-360.*( exra- floorl( exra));
+	  exra=-360.*( exra- floor( exra));
 
 	  fprintf( output_fp, "\n"
 		  "                             "
-		  "RANGE: %13.6LE METERS\n"
+		  "RANGE: %13.6E METERS\n"
 		  "                             "
-		  "EXP(-JKR)/R: %12.5LE AT PHASE: %7.2LF DEGREES\n",
+		  "EXP(-JKR)/R: %12.5E AT PHASE: %7.2f DEGREES\n",
 		  fpat.rfld, exrm, exra );
 	}
 
@@ -706,7 +686,6 @@ void rdpat( void )
 	}
 	else
 	{
-	  prad=0.;
 	  gcon=4.* PI/(1.+ fpat.xpr6* fpat.xpr6);
 	  gcop= gcon;
 	}
@@ -741,11 +720,11 @@ void rdpat( void )
 		erda= cang( erd);
 	  }
 
-	  ethm2= creal( eth* conjl( eth));
-	  ethm= sqrtl( ethm2);
+	  ethm2= creal( eth* conj( eth));
+	  ethm= sqrt( ethm2);
 	  etha= cang( eth);
-	  ephm2= creal( eph* conjl( eph));
-	  ephm= sqrtl( ephm2);
+	  ephm2= creal( eph* conj( eph));
+	  ephm= sqrt( ephm2);
 	  epha= cang( eph);
 
 	  /* elliptical polarization calc. */
@@ -767,22 +746,22 @@ void rdpat( void )
 		  else
 			dfaz2= dfaz+360.;
 
-		  if( fabsl(dfaz) > fabsl(dfaz2) )
+		  if( fabs(dfaz) > fabs(dfaz2) )
 			dfaz= dfaz2;
 
-		  cdfaz= cosl( dfaz* TA);
+		  cdfaz= cos( dfaz* TA);
 		  tstor1= ethm2- ephm2;
 		  tstor2=2.* ephm* ethm* cdfaz;
-		  tilta=.5* atan2l( tstor2, tstor1);
-		  stilta= sinl( tilta);
+		  tilta=.5* atan2( tstor2, tstor1);
+		  stilta= sin( tilta);
 		  tstor1= tstor1* stilta* stilta;
-		  tstor2= tstor2* stilta* cosl( tilta);
-		  emajr2=- tstor1+ tstor2+ ethm2;
+		  tstor2= tstor2* stilta* cos( tilta);
+		  emajr2= -tstor1+ tstor2+ ethm2;
 		  eminr2= tstor1- tstor2+ ephm2;
 		  if( eminr2 < 0.)
 			eminr2=0.;
 
-		  axrat= sqrtl( eminr2/ emajr2);
+		  axrat= sqrt( eminr2/ emajr2);
 		  tilta= tilta* TD;
 		  if( axrat <= 1.0e-5)
 			isens= hpol[0];
@@ -843,7 +822,7 @@ void rdpat( void )
 			if( kth == fpat.nth)
 			  tmp4= tha;
 
-		  da= fabsl( tmp1*( cosl( tmp3)- cosl( tmp4)));
+		  da= fabs( tmp1*( cos( tmp3)- cos( tmp4)));
 		  if( (kph == 1) || (kph == fpat.nph) )
 			da *=.5;
 		  pint += tstor1* da;
@@ -875,8 +854,8 @@ void rdpat( void )
 		}
 
 		fprintf( output_fp, "\n"
-			" %7.2LF %9.2LF  %8.2LF %8.2LF %8.2LF %11.4LF"
-			" %9.2LF %6s %11.4LE %9.2LF %11.4LE %9.2LF",
+			" %7.2f %9.2f  %8.2f %8.2f %8.2f %11.4f"
+			" %9.2f %6s %11.4E %9.2f %11.4E %9.2f",
 			thet, phi, tmp5, tmp6, gtot, axrat,
 			tilta, isens, ethm, etha, ephm, epha );
 
@@ -888,19 +867,19 @@ void rdpat( void )
 		  if( plot.iplp2 == 1 )
 		  {
 			if( plot.iplp3 == 1 )
-			  fprintf( plot_fp, "%12.4LE %12.4LE %12.4LE\n", thet, ethm, etha );
+			  fprintf( plot_fp, "%12.4E %12.4E %12.4E\n", thet, ethm, etha );
 			else
 			  if( plot.iplp3 == 2 )
-				fprintf( plot_fp, "%12.4LE %12.4LE %12.4LE\n", thet, ephm, epha );
+				fprintf( plot_fp, "%12.4E %12.4E %12.4E\n", thet, ephm, epha );
 		  }
 
 		  if( plot.iplp2 == 2 )
 		  {
 			if( plot.iplp3 == 1 )
-			  fprintf( plot_fp, "%12.4LE %12.4LE %12.4LE\n", phi, ethm, etha );
+			  fprintf( plot_fp, "%12.4E %12.4E %12.4E\n", phi, ethm, etha );
 			else
 			  if( plot.iplp3 == 2 )
-				fprintf( plot_fp, "%12.4LE %12.4LE %12.4LE\n", phi, ephm, epha );
+				fprintf( plot_fp, "%12.4E %12.4E %12.4E\n", phi, ephm, epha );
 		  }
 		}
 
@@ -912,13 +891,13 @@ void rdpat( void )
 		  switch( plot.iplp4 )
 		  {
 			case 1:
-			  fprintf( plot_fp, "%12.4LE %12.4LE\n", thet, tmp5 );
+			  fprintf( plot_fp, "%12.4E %12.4E\n", thet, tmp5 );
 			  break;
 			case 2:
-			  fprintf( plot_fp, "%12.4LE %12.4LE\n", thet, tmp6 );
+			  fprintf( plot_fp, "%12.4E %12.4E\n", thet, tmp6 );
 			  break;
 			case 3:
-			  fprintf( plot_fp, "%12.4LE %12.4LE\n", thet, gtot );
+			  fprintf( plot_fp, "%12.4E %12.4E\n", thet, gtot );
 		  }
 		}
 
@@ -927,13 +906,13 @@ void rdpat( void )
 		  switch( plot.iplp4 )
 		  {
 			case 1:
-			  fprintf( plot_fp, "%12.4LE %12.4LE\n", phi, tmp5 );
+			  fprintf( plot_fp, "%12.4E %12.4E\n", phi, tmp5 );
 			  break;
 			case 2:
-			  fprintf( plot_fp, "%12.4LE %12.4LE\n", phi, tmp6 );
+			  fprintf( plot_fp, "%12.4E %12.4E\n", phi, tmp6 );
 			  break;
 			case 3:
-			  fprintf( plot_fp, "%12.4LE %12.4LE\n", phi, gtot );
+			  fprintf( plot_fp, "%12.4E %12.4E\n", phi, gtot );
 		  }
 		}
 
@@ -941,7 +920,7 @@ void rdpat( void )
 	  } /* if( gnd.ifar != 1) */
 
 	  fprintf( output_fp, "\n"
-		  " %9.2LF %7.2LF %9.2LF  %11.4LE %7.2LF  %11.4LE %7.2LF  %11.4LE %7.2LF",
+		  " %9.2f %7.2f %9.2f  %11.4E %7.2f  %11.4E %7.2f  %11.4E %7.2f",
 		  fpat.rfld, phi, thet, ethm, etha, ephm, epha, erdm, erda );
 
 	} /* for( kth = 1; kth <= fpat.nth; kth++ ) */
@@ -951,88 +930,90 @@ void rdpat( void )
   if( fpat.iavp != 0)
   {
 	tmp3= fpat.thets* TA;
-	tmp4= tmp3+ fpat.dth* TA* (long double)( fpat.nth-1);
-	tmp3= fabsl( fpat.dph* TA* (long double)( fpat.nph-1)*( cosl( tmp3)- cosl( tmp4)));
+	tmp4= tmp3+ fpat.dth* TA* (double)( fpat.nth-1);
+	tmp3= fabs( fpat.dph* TA* (double)( fpat.nph-1)*( cos( tmp3)- cos( tmp4)));
 	pint /= tmp3;
 	tmp3 /= PI;
 
 	fprintf( output_fp, "\n\n\n"
-		"  AVERAGE POWER GAIN: %11.4LE - SOLID ANGLE"
-		" USED IN AVERAGING: (%+7.4LF)*PI STERADIANS",
+		"  AVERAGE POWER GAIN: %11.4E - SOLID ANGLE"
+		" USED IN AVERAGING: (%+7.4f)*PI STERADIANS",
 		pint, tmp3 );
   }
 
-  if( fpat.inor == 0)
-	return;
-
-  if( fabsl( fpat.gnor) > 1.0e-20)
-	gmax= fpat.gnor;
-  itmp1=( fpat.inor-1);
-
-  fprintf( output_fp,	"\n\n\n"
-	  "                             "
-	  " ---------- NORMALIZED GAIN ----------\n"
-	  "                                      %6s GAIN\n"
-	  "                                  "
-	  " NORMALIZATION FACTOR: %.2LF db\n\n"
-	  "    ---- ANGLES ----                ---- ANGLES ----"
-	  "                ---- ANGLES ----\n"
-	  "    THETA      PHI        GAIN      THETA      PHI  "
-	  "      GAIN      THETA      PHI       GAIN\n"
-	  "   DEGREES   DEGREES        DB     DEGREES   DEGREES "
-	  "       DB     DEGREES   DEGREES       DB",
-	  igntp[itmp1], gmax );
-
-  itmp2= fpat.nph* fpat.nth;
-  itmp1=( itmp2+2)/3;
-  itmp2= itmp1*3- itmp2;
-  itmp3= itmp1;
-  itmp4=2* itmp1;
-
-  if( itmp2 == 2)
-	itmp4--;
-
-  for( i = 0; i < itmp1; i++ )
+  if( fpat.inor > 0)
   {
-	itmp3++;
-	itmp4++;
-	j= i/ fpat.nth;
-	tmp1= fpat.thets+ (long double)( i - j*fpat.nth )* fpat.dth;
-	tmp2= fpat.phis+ (long double)(j)* fpat.dph;
-	j=( itmp3-1)/ fpat.nth;
-	tmp3= fpat.thets+ (long double)( itmp3- j* fpat.nth-1)* fpat.dth;
-	tmp4= fpat.phis+ (long double)(j)* fpat.dph;
-	j=( itmp4-1)/ fpat.nth;
-	tmp5= fpat.thets+ (long double)( itmp4- j* fpat.nth-1)* fpat.dth;
-	tmp6= fpat.phis+ (long double)(j)* fpat.dph;
-	tstor1= gain[i]- gmax;
-
-	if( ((i+1) == itmp1) && (itmp2 != 0) )
+	if( fabs( fpat.gnor) > 1.0e-20)
+	  gmax= fpat.gnor;
+	itmp1=( fpat.inor-1);
+
+	fprintf( output_fp,	"\n\n\n"
+		"                             "
+		" ---------- NORMALIZED GAIN ----------\n"
+		"                                      %6s GAIN\n"
+		"                                  "
+		" NORMALIZATION FACTOR: %.2f db\n\n"
+		"    ---- ANGLES ----                ---- ANGLES ----"
+		"                ---- ANGLES ----\n"
+		"    THETA      PHI        GAIN      THETA      PHI  "
+		"      GAIN      THETA      PHI       GAIN\n"
+		"   DEGREES   DEGREES        DB     DEGREES   DEGREES "
+		"       DB     DEGREES   DEGREES       DB",
+		igntp[itmp1], gmax );
+
+	itmp2= fpat.nph* fpat.nth;
+	itmp1=( itmp2+2)/3;
+	itmp2= itmp1*3- itmp2;
+	itmp3= itmp1;
+	itmp4=2* itmp1;
+
+	if( itmp2 == 2)
+	  itmp4--;
+
+	for( i = 0; i < itmp1; i++ )
 	{
-	  if( itmp2 != 2)
+	  itmp3++;
+	  itmp4++;
+	  j= i/ fpat.nth;
+	  tmp1= fpat.thets+ (double)( i - j*fpat.nth )* fpat.dth;
+	  tmp2= fpat.phis+ (double)(j)* fpat.dph;
+	  j=( itmp3-1)/ fpat.nth;
+	  tmp3= fpat.thets+ (double)( itmp3- j* fpat.nth-1)* fpat.dth;
+	  tmp4= fpat.phis+ (double)(j)* fpat.dph;
+	  j=( itmp4-1)/ fpat.nth;
+	  tmp5= fpat.thets+ (double)( itmp4- j* fpat.nth-1)* fpat.dth;
+	  tmp6= fpat.phis+ (double)(j)* fpat.dph;
+	  tstor1= gain[i]- gmax;
+
+	  if( ((i+1) == itmp1) && (itmp2 != 0) )
 	  {
-		tstor2= gain[itmp3-1]- gmax;
+		if( itmp2 != 2)
+		{
+		  tstor2= gain[itmp3-1]- gmax;
+		  fprintf( output_fp, "\n"
+			  " %9.2f %9.2f %9.2f   %9.2f %9.2f %9.2f   ",
+			  tmp1, tmp2, tstor1, tmp3, tmp4, tstor2 );
+		  free_ptr( (void *)&gain );
+		  return;
+		}
+
 		fprintf( output_fp, "\n"
-			" %9.2LF %9.2LF %9.2LF   %9.2LF %9.2LF %9.2LF   ",
-			tmp1, tmp2, tstor1, tmp3, tmp4, tstor2 );
+			" %9.2f %9.2f %9.2f   ",
+			tmp1, tmp2, tstor1 );
+		free_ptr( (void *)&gain );
 		return;
-	  }
 
-	  fprintf( output_fp, "\n"
-		  " %9.2LF %9.2LF %9.2LF   ",
-		  tmp1, tmp2, tstor1 );
-	  return;
-
-	} /* if( ((i+1) == itmp1) && (itmp2 != 0) ) */
+	  } /* if( ((i+1) == itmp1) && (itmp2 != 0) ) */
 
-	tstor2= gain[itmp3-1]- gmax;
-	pint= gain[itmp4-1]- gmax;
+	  tstor2= gain[itmp3-1]- gmax;
+	  pint= gain[itmp4-1]- gmax;
 
-	fprintf( output_fp, "\n"
-		" %9.2LF %9.2LF %9.2LF   %9.2LF %9.2LF %9.2LF   %9.2LF %9.2LF %9.2LF",
-		tmp1, tmp2, tstor1, tmp3, tmp4, tstor2, tmp5, tmp6, pint );
+	  fprintf( output_fp, "\n"
+		  " %9.2f %9.2f %9.2f   %9.2f %9.2f %9.2f   %9.2f %9.2f %9.2f",
+		  tmp1, tmp2, tstor1, tmp3, tmp4, tstor2, tmp5, tmp6, pint );
 
-  } /* for( i = 0; i < itmp1; i++ ) */
+	} /* for( i = 0; i < itmp1; i++ ) */
+  }
 
   free_ptr( (void *)&gain );
 
diff --git a/shared.c b/shared.c
new file mode 100644
index 0000000..2ba6aee
--- /dev/null
+++ b/shared.c
@@ -0,0 +1,67 @@
+/*
+ * Shared global variables for nec2c.c
+ */
+
+#include "shared.h"
+
+/*------------------------------------------------------------------------*/
+
+/* common  /crnt/ */
+crnt_t crnt;
+
+/* common  /dataj/ */
+dataj_t dataj;
+
+/* common  /data/ */
+data_t data;
+
+/* pointers to input/output files */
+FILE *input_fp=NULL, *output_fp=NULL, *plot_fp=NULL;
+
+/* common  /fpat/ */
+fpat_t fpat;
+
+/*common  /ggrid/ */
+ggrid_t ggrid;
+
+/* common  /gnd/ */
+gnd_t gnd;
+
+/* common  /gwav/ */
+gwav_t gwav;
+
+/* common  /incom/ */
+incom_t incom;
+
+/* common  /matpar/ */
+matpar_t matpar;
+
+/* common  /netcx/ */
+netcx_t netcx;
+
+/* common  /plot/ */
+plot_t plot;
+
+/* common  /save/ */
+save_t save;
+
+/* common  /segj/ */
+segj_t segj;
+
+/* common  /smat/ */
+smat_t smat;
+
+/* common  /tmi/ */
+tmi_t tmi;
+
+/* common  /vsorc/ */
+vsorc_t vsorc;
+
+/* common  /yparm/ */
+yparm_t yparm;
+
+/* common  /zload/ */
+zload_t zload;
+
+/*------------------------------------------------------------------------*/
+
diff --git a/shared.h b/shared.h
new file mode 100644
index 0000000..633a9b5
--- /dev/null
+++ b/shared.h
@@ -0,0 +1,67 @@
+#ifndef SHARED_H
+#define SHARED_H	1
+
+#include "nec2c.h"
+
+/*------------------------------------------------------------------------*/
+
+/* common  /crnt/ */
+extern crnt_t crnt;
+
+/* common  /dataj/ */
+extern dataj_t dataj;
+
+/* common  /data/ */
+extern data_t data;
+
+/* pointers to input/output files */
+extern FILE *input_fp, *output_fp, *plot_fp;
+
+/* common  /fpat/ */
+extern fpat_t fpat;
+
+/*common  /ggrid/ */
+extern ggrid_t ggrid;
+
+/* common  /gnd/ */
+extern gnd_t gnd;
+
+/* common  /gwav/ */
+extern gwav_t gwav;
+
+/* common  /incom/ */
+extern incom_t incom;
+
+/* common  /matpar/ */
+extern matpar_t matpar;
+
+/* common  /netcx/ */
+extern netcx_t netcx;
+
+/* common  /plot/ */
+extern plot_t plot;
+
+/* common  /save/ */
+extern save_t save;
+
+/* common  /segj/ */
+extern segj_t segj;
+
+/* common  /smat/ */
+extern smat_t smat;
+
+/* common  /tmi/ */
+extern tmi_t tmi;
+
+/* common  /vsorc/ */
+extern vsorc_t vsorc;
+
+/* common  /yparm/ */
+extern yparm_t yparm;
+
+/* common  /zload/ */
+extern zload_t zload;
+
+/*------------------------------------------------------------------------*/
+
+#endif
diff --git a/somnec.c b/somnec.c
index 2614e43..6f3448e 100644
--- a/somnec.c
+++ b/somnec.c
@@ -5,11 +5,11 @@
  ground.  field components are computed by numerical evaluation
  of modified sommerfeld integrals.
 
- somnec2d is a long double precision version of somnec for use with
+ somnec2d is a double precision version of somnec for use with
  nec2d.  an alternate version (somnec2sd) is also provided in which
  computation is in single precision but the output file is written
- in long double precision for use with nec2d.  somnec2sd runs about twic
- as fast as the full long double precision somnec2d.  the difference
+ in double precision for use with nec2d.  somnec2sd runs about twic
+ as fast as the full double precision somnec2d.  the difference
  between nec2d results using a for021 file from this code rather
  than from somnec2sd was insignficant in the cases tested.
 
@@ -18,26 +18,24 @@
  status of output files set to 'unknown' */
 
 #include "nec2c.h"
+#include "shared.h"
 
 /* common /evlcom/ */
 static int jh;
-static long double ck2, ck2sq, tkmag, tsmag, ck1r, zph, rho;
-static complex long double ct1, ct2, ct3, ck1, ck1sq, cksm;
+static double ck2, ck2sq, tkmag, tsmag, ck1r, zph, rho;
+static complex double ct1, ct2, ct3, ck1, ck1sq, cksm;
 
 /* common /cntour/ */
-static complex long double a, b;
-
-/*common  /ggrid/ */
-ggrid_t ggrid;
+static complex double a, b;
 
 /*-----------------------------------------------------------------------*/
 
 /* This is the "main" of somnec */
-void somnec( long double epr, long double sig, long double fmhz )
+void somnec( double epr, double sig, double fmhz )
 {
   int k, nth, ith, irs, ir, nr;
-  long double tim, wlam, tst, dr, dth, r, rk, thet, tfac1, tfac2;
-  complex long double erv, ezv, erh, eph, cl1, cl2, con;
+  double tim, wlam, tst, dr, dth=0.0, r, rk, thet, tfac1, tfac2;
+  complex double erv, ezv, erh, eph, cl1, cl2, con;
 
   if(sig >= 0.)
   {
@@ -56,10 +54,10 @@ void somnec( long double epr, long double sig, long double fmhz )
   /* evlua. */
 
   ck1sq=ck2sq*conj(ggrid.epscf);
-  ck1=csqrtl(ck1sq);
+  ck1=csqrt(ck1sq);
   ck1r=creal(ck1);
   tkmag=100.*cabs(ck1);
-  tsmag=100.*ck1*conj(ck1);
+  tsmag=100.*creal(ck1*conj(ck1));
   cksm=ck2sq/(ck1sq+ck2sq);
   ct1=.5*(ck1sq-ck2sq);
   erv=ck1sq*ck1sq;
@@ -84,7 +82,7 @@ void somnec( long double epr, long double sig, long double fmhz )
 	  irs=2;
 	}
 
-	/*  loop over r.  (r=sqrtl(rho**2 + (z+h)**2)) */
+	/*  loop over r.  (r=sqrt(rho**2 + (z+h)**2)) */
 	for( ir = irs-1; ir < nr; ir++ )
 	{
 	  r += dr;
@@ -94,8 +92,8 @@ void somnec( long double epr, long double sig, long double fmhz )
 	  for( ith = 0; ith < nth; ith++ )
 	  {
 		thet += dth;
-		rho=r*cosl(thet);
-		zph=r*sinl(thet);
+		rho=r*cos(thet);
+		zph=r*sin(thet);
 		if(rho < 1.e-7)
 		  rho=1.e-8;
 		if(zph < 1.e-7)
@@ -104,7 +102,7 @@ void somnec( long double epr, long double sig, long double fmhz )
 		evlua( &erv, &ezv, &erh, &eph );
 
 		rk=ck2*r;
-		con=-CONST1*r/cmplx(cosl(rk),-sinl(rk));
+		con=-CONST1*r/cmplx(cos(rk),-sin(rk));
 
 		switch( k )
 		{
@@ -148,8 +146,8 @@ void somnec( long double epr, long double sig, long double fmhz )
 	thet += dth;
 	if( (ith+1) != nth )
 	{
-	  tfac2=cosl(thet);
-	  tfac1=(1.-sinl(thet))/tfac2;
+	  tfac2=cos(thet);
+	  tfac1=(1.-sin(thet))/tfac2;
 	  tfac2=tfac1/tfac2;
 	  erv=ggrid.epscf*cl1*tfac1;
 	  erh=cl1*(tfac2-1.)+cl2;
@@ -178,17 +176,18 @@ void somnec( long double epr, long double sig, long double fmhz )
 
 /* bessel evaluates the zero-order bessel function */
 /* and its derivative for complex argument z. */
-void bessel( complex long double z, complex long double *j0, complex long double *j0p )
+void bessel( complex double z, complex double *j0, complex double *j0p )
 {
-  int k, i, ib, iz, miz;
+  int k, ib;
   static int m[101], init = FALSE;
-  static long double a1[25], a2[25];
-  long double tst, zms;
-  complex long double p0z, p1z, q0z, q1z, zi, zi2, zk, cz, sz, j0x=CPLX_00, j0px=CPLX_00;
+  static double a1[25], a2[25];
+  double zms;
+  complex double p0z, p1z, q0z, q1z, zi, zi2, zk, cz, sz, j0x=CPLX_00, j0px=CPLX_00;
 
   /* initialization of constants */
   if( ! init )
   {
+	int i;
 	for( k = 1; k <= 25; k++ )
 	{
 	  i = k-1;
@@ -198,7 +197,7 @@ void bessel( complex long double z, complex long double *j0, complex long double
 
 	for( i = 1; i <= 101; i++ )
 	{
-	  tst=1.0;
+	  double tst = 1.0;
 	  for( k = 0; k < 24; k++ )
 	  {
 		init = k;
@@ -213,7 +212,7 @@ void bessel( complex long double z, complex long double *j0, complex long double
 	init = TRUE;
   } /* if(init == 0) */
 
-  zms=z*conj(z);
+  zms=creal(z*conj(z));
   if(zms <= 1.e-12)
   {
 	*j0=CPLX_10;
@@ -228,8 +227,8 @@ void bessel( complex long double z, complex long double *j0, complex long double
 	  ib=1;
 
 	/* series expansion */
-	iz=zms;
-	miz=m[iz];
+	int iz=(int)zms;
+	int miz=m[iz];
 	*j0=CPLX_10;
 	*j0p=*j0;
 	zk=*j0;
@@ -261,14 +260,14 @@ void bessel( complex long double z, complex long double *j0, complex long double
   zi2=1./zk;
   cz=.5*(zk+zi2);
   sz=CPLX_01*.5*(zi2-zk);
-  zk=C3*csqrtl(zi);
+  zk=C3*csqrt(zi);
   *j0=zk*(p0z*cz-q0z*sz);
   *j0p=-zk*(p1z*sz+q1z*cz);
 
   if(ib == 0)
 	return;
 
-  zms=cosl((sqrtl(zms)-6.)*PI10);
+  zms=cos((sqrt(zms)-6.)*PI10);
   *j0=.5*(j0x*(1.+zms)+ *j0*(1.-zms));
   *j0p=.5*(j0px*(1.+zms)+ *j0p*(1.-zms));
 
@@ -279,12 +278,12 @@ void bessel( complex long double z, complex long double *j0, complex long double
 
 /* evlua controls the integration contour in the complex */
 /* lambda plane for evaluation of the sommerfeld integrals */
-void evlua( complex long double *erv, complex long double *ezv,
-	complex long double *erh, complex long double *eph )
+void evlua( complex double *erv, complex double *ezv,
+	complex double *erh, complex double *eph )
 {
   int i, jump;
-  static long double del, slope, rmis;
-  static complex long double cp1, cp2, cp3, bk, delta, delta2, sum[6], ans[6];
+  static double del, slope, rmis;
+  static complex double cp1, cp2, cp3, bk, delta, delta2, sum[6], ans[6];
 
   del=zph;
   if( rho > del )
@@ -349,7 +348,7 @@ void evlua( complex long double *erv, complex long double *ezv,
 	slope=1000.;
 
   del=PTP/del;
-  delta=cmplx(-1.0,slope)*del/sqrtl(1.+slope*slope);
+  delta=cmplx(-1.0,slope)*del/sqrt(1.+slope*slope);
   delta2=-conj(delta);
   gshank(cp1,delta,ans,6,sum,0,bk,bk);
   rmis=rho*(creal(ck1)-ck2);
@@ -360,7 +359,7 @@ void evlua( complex long double *erv, complex long double *ezv,
 	if(zph >= 1.e-10)
 	{
 	  bk=cmplx(-zph,rho)*(ck1-cp3);
-	  rmis=-creal(bk)/fabsl(cimag(bk));
+	  rmis=-creal(bk)/fabs(cimag(bk));
 	  if(rmis > 4.*rho/zph)
 		jump = TRUE;
 	}
@@ -368,7 +367,7 @@ void evlua( complex long double *erv, complex long double *ezv,
 	if( ! jump )
 	{
 	  /* integrate up between branch cuts, then to + infinity */
-	  cp1=ck1-(.1+.2fj);
+	  cp1=ck1-(.1+I*0.2);
 	  cp2=cp1+.2;
 	  bk=cmplx(0.,del);
 	  gshank(cp1,bk,sum,6,ans,0,bk,bk);
@@ -419,13 +418,13 @@ void evlua( complex long double *erv, complex long double *ezv,
 /*-----------------------------------------------------------------------*/
 
 /* fbar is sommerfeld attenuation function for numerical distance p */
-void fbar( complex long double p, complex long double *fbar )
+void fbar( complex double p, complex double *fbar )
 {
   int i, minus;
-  long double tms, sms;
-  complex long double z, zs, sum, pow, term;
+  double tms, sms;
+  complex double z, zs, sum, pow, term;
 
-  z= CPLX_01* csqrtl( p);
+  z= CPLX_01* csqrt( p);
   if( cabs( z) <= 3.)
   {
 	/* series expansion */
@@ -435,7 +434,7 @@ void fbar( complex long double p, complex long double *fbar )
 
 	for( i = 1; i <= 100; i++ )
 	{
-	  pow=- pow* zs/ (long double)i;
+	  pow= -pow* zs/ (double)i;
 	  term= pow/(2.* i+1.);
 	  sum= sum+ term;
 	  tms= creal( term* conj( term));
@@ -452,7 +451,7 @@ void fbar( complex long double p, complex long double *fbar )
   if( creal( z) < 0.)
   {
 	minus=1;
-	z=- z;
+	z= -z;
   }
   else
 	minus=0;
@@ -463,13 +462,13 @@ void fbar( complex long double p, complex long double *fbar )
 
   for( i = 1; i <= 6; i++ )
   {
-	term =- term*(2.*i -1.)* zs;
+	term = -term*(2.*i -1.)* zs;
 	sum += term;
   }
 
   if( minus == 1)
 	sum -= 2.* SP* z* cexp( z* z);
-  *fbar=- sum;
+  *fbar= -sum;
 }
 
 /*-----------------------------------------------------------------------*/
@@ -479,14 +478,14 @@ void fbar( complex long double p, complex long double *fbar )
 /* the step increment may be changed from dela to delb.  shank's */
 /* algorithm to accelerate convergence of a slowly converging series */
 /* is used */
-void gshank( complex long double start, complex long double dela,
-	complex long double *sum, int nans, complex long double *seed,
-	int ibk, complex long double bk, complex long double delb )
+void gshank( complex double start, complex double dela,
+	complex double *sum, int nans, complex double *seed,
+	int ibk, complex double bk, complex double delb )
 {
   int ibx, j, i, jm, intx, inx, brk=0;
-  static long double rbk, amg, den, denm;
-  complex long double a1, a2, as1, as2, del, aa;
-  complex long double q1[6][20], q2[6][20], ans1[6], ans2[6];
+  static double rbk, amg, den, denm;
+  complex double a1, a2, as1, as2, del, aa;
+  complex double q1[6][20], q2[6][20], ans1[6], ans2[6];
 
   rbk=creal(bk);
   del=dela;
@@ -497,8 +496,8 @@ void gshank( complex long double start, complex long double dela,
 
   for( i = 0; i < nans; i++ )
 	ans2[i]=seed[i];
-
   b=start;
+
   for( intx = 1; intx <= MAXH; intx++ )
   {
 	inx=intx-1;
@@ -512,19 +511,10 @@ void gshank( complex long double start, complex long double dela,
 	  b=bk;
 	  del=delb;
 	  rom1(nans,sum,2);
-	  if( ibx != 2 )
-	  {
-		for( i = 0; i < nans; i++ )
-		  ans2[i] += sum[i];
-		intx = 0;
-		continue;
-	  }
-
 	  for( i = 0; i < nans; i++ )
-		ans2[i]=ans1[i]+sum[i];
+		ans2[i] += sum[i];
 	  intx = 0;
 	  continue;
-
 	} /* if( (ibx == 0) && (creal(b) >= rbk) ) */
 
 	rom1(nans,sum,2);
@@ -532,7 +522,6 @@ void gshank( complex long double start, complex long double dela,
 	  ans1[i] = ans2[i]+sum[i];
 	a=b;
 	b += del;
-
 	if( (ibx == 0) && (creal(b) >= rbk) )
 	{
 	  /* hit break point.  reset seed and start over. */
@@ -540,19 +529,10 @@ void gshank( complex long double start, complex long double dela,
 	  b=bk;
 	  del=delb;
 	  rom1(nans,sum,2);
-	  if( ibx != 2 )
-	  {
-		for( i = 0; i < nans; i++ )
-		  ans2[i] += sum[i];
-		intx = 0;
-		continue;
-	  }
-
 	  for( i = 0; i < nans; i++ )
 		ans2[i] = ans1[i]+sum[i];
 	  intx = 0;
 	  continue;
-
 	} /* if( (ibx == 0) && (creal(b) >= rbk) ) */
 
 	rom1(nans,sum,2);
@@ -591,14 +571,13 @@ void gshank( complex long double start, complex long double dela,
 		  q2[i][jm]=as2;
 		  as1=a1;
 		  as2=a2;
-
 		} /* for( j = 1; i < intx; i++ ) */
 
 	  } /* if(intx >= 2) */
 
 	  q1[i][intx-1]=as1;
 	  q2[i][intx-1]=as2;
-	  amg=fabsl(creal(as2))+fabsl(cimag(as2));
+	  amg=fabs(creal(as2))+fabs(cimag(as2));
 	  if(amg > den)
 		den=amg;
 
@@ -615,11 +594,11 @@ void gshank( complex long double start, complex long double dela,
 	  for( i = 0; i < nans; i++ )
 	  {
 		a1=q2[i][j];
-		den=(fabsl(creal(a1))+fabsl(cimag(a1)))*CRIT;
+		den=(fabs(creal(a1))+fabs(cimag(a1)))*CRIT;
 		if(den < denm)
 		  den=denm;
 		a1=q1[i][j]-a1;
-		amg=fabsl(creal(a1)+fabsl(cimag(a1)));
+		amg=fabs(creal(a1)+fabs(cimag(a1)));
 		if(amg > den)
 		{
 		  brk = TRUE;
@@ -649,16 +628,17 @@ void gshank( complex long double start, complex long double dela,
 
 /* hankel evaluates hankel function of the first kind,   */
 /* order zero, and its derivative for complex argument z */
-void hankel( complex long double z, complex long double *h0, complex long double *h0p )
+void hankel( complex double z, complex double *h0, complex double *h0p )
 {
-  int i, k, ib, iz, miz;
+  int k, ib;
   static int m[101], init = FALSE;
-  static long double a1[25], a2[25], a3[25], a4[25], psi, tst, zms;
-  complex long double clogz, j0, j0p, p0z, p1z, q0z, q1z, y0=CPLX_00, y0p=CPLX_00, zi, zi2, zk;
+  static double a1[25], a2[25], a3[25], a4[25], psi, tst, zms;
+  complex double clogz, j0, j0p, p0z, p1z, q0z, q1z, y0=CPLX_00, y0p=CPLX_00, zi, zi2, zk;
 
   /* initialization of constants */
   if( ! init )
   {
+	int i;
 	psi=-GAMMA;
 	for( k = 1; k <= 25; k++ )
 	{
@@ -687,7 +667,7 @@ void hankel( complex long double z, complex long double *h0, complex long double
 
   } /* if( ! init ) */
 
-  zms=z*conj(z);
+  zms=creal(z*conj(z));
   if(zms == 0.)
 	abort_on_error(-7);
 
@@ -698,8 +678,8 @@ void hankel( complex long double z, complex long double *h0, complex long double
 	  ib=1;
 
 	/* series expansion */
-	iz=zms;
-	miz=m[iz];
+	int iz=(int)zms;
+	int miz=m[iz];
 	j0=CPLX_10;
 	j0p=j0;
 	y0=CPLX_00;
@@ -717,7 +697,7 @@ void hankel( complex long double z, complex long double *h0, complex long double
 	}
 
 	j0p *= -.5*z;
-	clogz=clogl(.5*z);
+	clogz=clog(.5*z);
 	y0=(2.*j0*clogz-y0)/PI+C2;
 	y0p=(2./z+2.*j0p*clogz+.5*y0p*z)/PI+C1*z;
 	*h0=j0+CPLX_01*y0;
@@ -738,14 +718,14 @@ void hankel( complex long double z, complex long double *h0, complex long double
   p1z=1.+(P11-P21*zi2)*zi2;
   q0z=(Q20*zi2-Q10)*zi;
   q1z=(Q11-Q21*zi2)*zi;
-  zk=cexp(CPLX_01*(z-POF))*csqrtl(zi)*C3;
+  zk=cexp(CPLX_01*(z-POF))*csqrt(zi)*C3;
   *h0=zk*(p0z+CPLX_01*q0z);
   *h0p=CPLX_01*zk*(p1z+CPLX_01*q1z);
 
   if(ib == 0)
 	return;
 
-  zms=cosl((sqrtl(zms)-4.)*31.41592654);
+  zms=cos((sqrt(zms)-4.)*31.41592654);
   *h0=.5*(y0*(1.+zms)+ *h0*(1.-zms));
   *h0p=.5*(y0p*(1.+zms)+ *h0p*(1.-zms));
 
@@ -755,7 +735,7 @@ void hankel( complex long double z, complex long double *h0, complex long double
 /*-----------------------------------------------------------------------*/
 
 /* compute integration parameter xlam=lambda from parameter t. */
-void lambda( long double t, complex long double *xlam, complex long double *dxlam )
+void lambda( double t, complex double *xlam, complex double *dxlam )
 {
   *dxlam=b-a;
   *xlam=a+*dxlam*t;
@@ -766,12 +746,12 @@ void lambda( long double t, complex long double *xlam, complex long double *dxla
 
 /* rom1 integrates the 6 sommerfeld integrals from a to b in lambda. */
 /* the method of variable interval width romberg integration is used. */
-void rom1( int n, complex long double *sum, int nx )
+void rom1( int n, complex double *sum, int nx )
 {
   int jump, lstep, nogo, i, ns, nt;
-  static long double z, ze, s, ep, zend, dz=0., dzot=0., tr, ti;
-  static complex long double t00, t11, t02;
-  static complex long double g1[6], g2[6], g3[6], g4[6], g5[6], t01[6], t10[6], t20[6];
+  static double z, ze, s, ep, zend, dz=0., dzot=0., tr, ti;
+  static complex double t00, t11, t02;
+  static complex double g1[6], g2[6], g3[6], g4[6], g5[6], t01[6], t10[6], t20[6];
 
   lstep=0;
   z=0.;
@@ -821,8 +801,8 @@ void rom1( int n, complex long double *sum, int nx )
 	{
 	  for( i = 0; i < n; i++ )
 		sum[i] += t10[i];
-
 	  nt += 2;
+
 	  z += dz;
 	  if(z > zend)
 		return;
@@ -915,12 +895,6 @@ void rom1( int n, complex long double *sum, int nx )
 	for( i = 0; i < n; i++ )
 	  g1[i]=g5[i];
 
-	if( (nt >= NTS) && (ns > nx) )
-	{
-	  ns /= 2;
-	  nt=1;
-	}
-
 	jump = FALSE;
 
   } /* while( TRUE ) */
@@ -931,10 +905,10 @@ void rom1( int n, complex long double *sum, int nx )
 
 /* saoa computes the integrand for each of the 6 sommerfeld */
 /* integrals for source and observer above ground */
-void saoa( long double t, complex long double *ans)
+void saoa( double t, complex double *ans)
 {
-  long double xlr, sign;
-  static complex long double xl, dxl, cgam1, cgam2, b0, b0p, com, dgam, den1, den2;
+  double xlr;
+  static complex double xl, dxl, cgam1, cgam2, b0, b0p, com, dgam, den1, den2;
 
   lambda(t, &xl, &dxl);
   if( jh == 0 )
@@ -943,30 +917,31 @@ void saoa( long double t, complex long double *ans)
 	bessel(xl*rho, &b0, &b0p);
 	b0  *=2.;
 	b0p *=2.;
-	cgam1=csqrtl(xl*xl-ck1sq);
-	cgam2=csqrtl(xl*xl-ck2sq);
+	cgam1=csqrt(xl*xl-ck1sq);
+	cgam2=csqrt(xl*xl-ck2sq);
 	if(creal(cgam1) == 0.)
-	  cgam1=cmplx(0.,-fabsl(cimag(cgam1)));
+	  cgam1=cmplx(0.,-fabs(cimag(cgam1)));
 	if(creal(cgam2) == 0.)
-	  cgam2=cmplx(0.,-fabsl(cimag(cgam2)));
+	  cgam2=cmplx(0.,-fabs(cimag(cgam2)));
   }
   else
   {
 	/* hankel function form */
 	hankel(xl*rho, &b0, &b0p);
 	com=xl-ck1;
-	cgam1=csqrtl(xl+ck1)*csqrtl(com);
+	cgam1=csqrt(xl+ck1)*csqrt(com);
 	if(creal(com) < 0. && cimag(com) >= 0.)
 	  cgam1=-cgam1;
 	com=xl-ck2;
-	cgam2=csqrtl(xl+ck2)*csqrtl(com);
+	cgam2=csqrt(xl+ck2)*csqrt(com);
 	if(creal(com) < 0. && cimag(com) >= 0.)
 	  cgam2=-cgam2;
   }
 
-  xlr=xl*conj(xl);
+  xlr=creal(xl*conj(xl));
   if(xlr >= tsmag)
   {
+	double sign;
 	if(cimag(xl) >= 0.)
 	{
 	  xlr=creal(xl);

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



More information about the pkg-hamradio-commits mailing list