summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@jelmer.uk>2017-03-06 21:42:03 +0000
committerJelmer Vernooij <jelmer@jelmer.uk>2017-03-06 21:42:03 +0000
commit1d8db2007b420c0e9601be49567e1a1dd6ac33be (patch)
tree53cb0adcca04ef61d5d1fabfae0f54f883ff5ec4
New upstream version 0.13
-rw-r--r--COPYING340
-rw-r--r--ChangeLog372
-rw-r--r--ChangeLog.CVS578
-rw-r--r--FAQ76
-rw-r--r--INSTALL182
-rw-r--r--Makefile.in123
-rw-r--r--NEWS142
-rw-r--r--README54
-rw-r--r--THANKS4
-rw-r--r--TODO10
-rw-r--r--aclocal.m416
-rwxr-xr-xautogen.sh10
-rw-r--r--config.h.in481
-rwxr-xr-xconfigure10495
-rw-r--r--configure.ac58
-rw-r--r--htdocs/foo8
-rwxr-xr-xinstall-sh251
-rw-r--r--lib/basename.c57
-rw-r--r--lib/basename.h2
-rw-r--r--lib/dirname.c78
-rw-r--r--lib/dirname.h31
-rw-r--r--lib/fnmatch.c212
-rw-r--r--lib/fnmatch.h69
-rw-r--r--lib/getopt.c1052
-rw-r--r--lib/getopt.h133
-rw-r--r--lib/getopt1.c190
-rw-r--r--lib/getpass.c205
-rw-r--r--lib/getpass.h9
-rw-r--r--lib/glob.c1439
-rw-r--r--lib/glob.h194
-rw-r--r--lib/mkstemp.c40
-rw-r--r--lib/netrc.c425
-rw-r--r--lib/netrc.h65
-rw-r--r--lib/rpmatch.c84
-rw-r--r--lib/snprintf.c835
-rw-r--r--lib/snprintf.h245
-rw-r--r--lib/strcasecmp.c49
-rw-r--r--lib/strftime.c1241
-rw-r--r--lib/tempname.c360
-rw-r--r--lib/yesno.c54
-rw-r--r--litmus.in60
-rw-r--r--macros/ChangeLog1085
-rw-r--r--macros/ld-version-script.m443
-rw-r--r--macros/neon-test.m446
-rw-r--r--macros/neon-xml-parser.m4155
-rw-r--r--macros/neon.m41197
-rw-r--r--macros/socklen-arg-type.m443
-rw-r--r--src/basic.c394
-rw-r--r--src/common.c408
-rw-r--r--src/common.h103
-rw-r--r--src/copymove.c375
-rw-r--r--src/http.c105
-rw-r--r--src/largefile.c152
-rw-r--r--src/locks.c651
-rw-r--r--src/props.c623
-rw-r--r--test-common/ChangeLog245
-rw-r--r--test-common/README4
-rw-r--r--test-common/child.c489
-rw-r--r--test-common/child.h117
-rwxr-xr-xtest-common/run.sh19
-rw-r--r--test-common/tests.c443
-rw-r--r--test-common/tests.h128
62 files changed, 27154 insertions, 0 deletions
diff --git a/COPYING b/COPYING
new file mode 100644
index 0000000..dc63aac
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,340 @@
+
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 675 Mass Ave, Cambridge, MA 02139, USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ Appendix: How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) 19yy <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) 19yy name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/ChangeLog b/ChangeLog
new file mode 100644
index 0000000..1797f2e
--- /dev/null
+++ b/ChangeLog
@@ -0,0 +1,372 @@
+------------------------------------------------------------------------
+r1870 | joe | 2011-12-09 10:36:02 +0000 (Fri, 09 Dec 2011) | 1 line
+
+Tag release 0.13.
+------------------------------------------------------------------------
+r1869 | joe | 2011-12-09 10:33:14 +0000 (Fri, 09 Dec 2011) | 2 lines
+
+* configure.ac, NEWS: Update for 0.13.
+
+------------------------------------------------------------------------
+r1868 | joe | 2011-12-09 09:43:38 +0000 (Fri, 09 Dec 2011) | 2 lines
+
+* litmus.in: Add client cert arg to usage.
+
+------------------------------------------------------------------------
+r1867 | joe | 2011-12-09 09:38:10 +0000 (Fri, 09 Dec 2011) | 5 lines
+
+* src/common.c (init_session): Read and use client cert if configured.
+ (init): Take client certificate argument.
+
+Submitted by: Alejandro Álvarez Ayllón <aalvarez cern.ch>
+
+------------------------------------------------------------------------
+r1791 | joe | 2010-02-08 09:53:54 +0000 (Mon, 08 Feb 2010) | 2 lines
+
+* configure.ac: Update to build with neon 0.29.x.
+
+------------------------------------------------------------------------
+r1789 | joe | 2010-02-08 09:52:25 +0000 (Mon, 08 Feb 2010) | 2 lines
+
+* src/http.c (expect100): Add X- headers per normal requests.
+
+------------------------------------------------------------------------
+r1788 | joe | 2010-02-08 09:51:48 +0000 (Mon, 08 Feb 2010) | 3 lines
+
+* src/locks.c (owner_modify): Test that PROPPATCH works on a
+ locked resource. Thanks to Javier Godoy.
+
+------------------------------------------------------------------------
+r1608 | joe | 2008-11-18 10:50:27 +0000 (Tue, 18 Nov 2008) | 4 lines
+
+* src/copymove.c (copy_overwrite, move_overwrite): FAIL if a 412 is not
+given in the failure case, since this is a MUST, and output the error
+message.
+
+------------------------------------------------------------------------
+r1605 | joe | 2008-11-06 12:32:39 +0000 (Thu, 06 Nov 2008) | 2 lines
+
+* NEWS: Fix.
+
+------------------------------------------------------------------------
+r1604 | joe | 2008-11-06 12:31:42 +0000 (Thu, 06 Nov 2008) | 2 lines
+
+* NEWS, configure.ac: Update for 0.12.1.
+
+------------------------------------------------------------------------
+r1603 | joe | 2008-11-06 12:31:15 +0000 (Thu, 06 Nov 2008) | 2 lines
+
+* src/props.c: Use the example domain more.
+
+------------------------------------------------------------------------
+r1602 | joe | 2008-11-06 12:29:09 +0000 (Thu, 06 Nov 2008) | 2 lines
+
+* src/props.c: Use real URIs for the example namespaces.
+
+------------------------------------------------------------------------
+r1601 | joe | 2008-11-06 09:35:38 +0000 (Thu, 06 Nov 2008) | 2 lines
+
+* src/locks.c (getlock): Fail if lockscope is not satisfied.
+
+------------------------------------------------------------------------
+r1566 | joe | 2008-10-13 21:06:37 +0100 (Mon, 13 Oct 2008) | 3 lines
+
+* src/locks.c (unmapped_lock): Remove DELETE call, which otherwise
+ should nuke the lock per 4918.
+
+------------------------------------------------------------------------
+r1565 | joe | 2008-10-13 21:02:05 +0100 (Mon, 13 Oct 2008) | 2 lines
+
+* src/locks.c: Fix RFC reference.
+
+------------------------------------------------------------------------
+r1554 | joe | 2008-09-29 21:28:19 +0100 (Mon, 29 Sep 2008) | 1 line
+
+News.
+------------------------------------------------------------------------
+r1553 | joe | 2008-09-29 21:25:06 +0100 (Mon, 29 Sep 2008) | 3 lines
+
+* src/basic.c (put_no_parent): New test.
+ Add 2518 references.
+
+------------------------------------------------------------------------
+r1552 | joe | 2008-09-29 21:22:38 +0100 (Mon, 29 Sep 2008) | 2 lines
+
+* litmus.in, Makefile.in: Substitute datarootdir to quieten autoconf.
+
+------------------------------------------------------------------------
+r1551 | joe | 2008-09-29 21:20:46 +0100 (Mon, 29 Sep 2008) | 1 line
+
+Ignore more.
+------------------------------------------------------------------------
+r1550 | joe | 2008-09-29 21:19:49 +0100 (Mon, 29 Sep 2008) | 2 lines
+
+Bump to neon 0.28.x externals.
+
+------------------------------------------------------------------------
+r1549 | joe | 2008-09-29 21:18:47 +0100 (Mon, 29 Sep 2008) | 1 line
+
+Note %20 test needed.
+------------------------------------------------------------------------
+r1548 | joe | 2008-09-29 21:18:28 +0100 (Mon, 29 Sep 2008) | 2 lines
+
+* configure.ac: Bump to 0.12.
+
+------------------------------------------------------------------------
+r1547 | joe | 2008-09-29 21:15:27 +0100 (Mon, 29 Sep 2008) | 2 lines
+
+* src/props.c (propvalnspace): Use valid namespace URI.
+
+------------------------------------------------------------------------
+r1546 | joe | 2008-09-29 20:33:36 +0100 (Mon, 29 Sep 2008) | 2 lines
+
+Update mailing list address.
+
+------------------------------------------------------------------------
+r1545 | joe | 2008-09-29 20:29:04 +0100 (Mon, 29 Sep 2008) | 4 lines
+
+* src/locks.c (unmapped_lock): New test.
+
+Submitted by: Henrik Holst <henrik@witsbits.com>
+
+------------------------------------------------------------------------
+r1450 | joe | 2008-06-16 21:42:21 +0100 (Mon, 16 Jun 2008) | 2 lines
+
+* configure.ac: Support neon 25-28, patch by Henrik Holst.
+
+------------------------------------------------------------------------
+r1339 | joe | 2008-02-08 10:01:18 +0000 (Fri, 08 Feb 2008) | 2 lines
+
+* src/copymove.c: Add some 2518 references.
+
+------------------------------------------------------------------------
+r1163 | joe | 2007-02-13 11:09:28 +0000 (Tue, 13 Feb 2007) | 2 lines
+
+* src/props.c (d0_results): Fix propfind_d0 for neon < 0.26.
+
+------------------------------------------------------------------------
+r1150 | joe | 2007-01-23 17:53:58 +0000 (Tue, 23 Jan 2007) | 2 lines
+
+* NEWS: Update.
+
+------------------------------------------------------------------------
+r1149 | joe | 2007-01-23 17:53:27 +0000 (Tue, 23 Jan 2007) | 2 lines
+
+* configure.ac: Bump to 0.11.
+
+------------------------------------------------------------------------
+r1043 | joe | 2006-04-27 15:37:32 +0100 (Thu, 27 Apr 2006) | 3 lines
+
+* src/props.c (propremoveset): Tweak to test ordering of multiple
+'set' operations in a PROPPATCH body, from Julian Reschke.
+
+------------------------------------------------------------------------
+r1041 | joe | 2006-04-18 17:42:55 +0100 (Tue, 18 Apr 2006) | 2 lines
+
+News for 0.11.
+
+------------------------------------------------------------------------
+r1040 | joe | 2006-04-18 17:40:12 +0100 (Tue, 18 Apr 2006) | 3 lines
+
+* src/locks.c (verify_discover, count_discover) [HAVE_NEON_026PLUS]:
+Adjust for neon 0.26 API.
+
+------------------------------------------------------------------------
+r1039 | joe | 2006-04-18 17:35:05 +0100 (Tue, 18 Apr 2006) | 4 lines
+
+Tests for PROPPATCH evaluation order from Julian Reschke:
+
+* src/props.c (propremoveset, propsetremove): New functions.
+
+------------------------------------------------------------------------
+r1035 | joe | 2006-04-13 15:29:39 +0100 (Thu, 13 Apr 2006) | 2 lines
+
+* src/common.c (init): Don't path-escape input path.
+
+------------------------------------------------------------------------
+r1034 | joe | 2006-04-13 14:21:26 +0100 (Thu, 13 Apr 2006) | 4 lines
+
+Test for depth zero collection COPY from Julian Reschke:
+
+* src/copymove.c (copy_shallow): New function.
+
+------------------------------------------------------------------------
+r1033 | joe | 2006-04-13 14:14:15 +0100 (Thu, 13 Apr 2006) | 11 lines
+
+Switch externals to use neon 0.26.x branches.
+
+* configure.ac: Support neon 0.26.
+
+* src/common.h (HAVE_NEON_026PLUS): Define for neon 0.26 and later.
+
+* src/props.c (d0_results, pg_results, propfind_d0): Adjust for neon
+0.26 API.
+(create_private, destroy_private) [HAVE_NEON_026PLUS]: Reimplement for
+0.26.
+
+------------------------------------------------------------------------
+r751 | joe | 2005-11-02 20:43:44 +0000 (Wed, 02 Nov 2005) | 2 lines
+
+Bump for 0.10.5.
+
+------------------------------------------------------------------------
+r745 | joe | 2005-10-28 15:54:13 +0100 (Fri, 28 Oct 2005) | 3 lines
+
+* src/largefile.c (large_put): Check response code.
+(large_get): Fail if ne_read_response_block returns an error.
+
+------------------------------------------------------------------------
+r744 | joe | 2005-10-28 12:49:43 +0100 (Fri, 28 Oct 2005) | 2 lines
+
+* src/largefile.c (large_get): Fail for non-2xx responses.
+
+------------------------------------------------------------------------
+r743 | joe | 2005-10-28 12:38:05 +0100 (Fri, 28 Oct 2005) | 3 lines
+
+* src/locks.c (fail_cond_put_unlocked): Add another test for handling
+of unknown state tokens as per Julian's locking tests.
+
+------------------------------------------------------------------------
+r703 | joe | 2005-09-17 10:19:29 +0100 (Sat, 17 Sep 2005) | 3 lines
+
+* src/locks.c (verify_discover): Thou really shalt not commit
+debugging code.
+
+------------------------------------------------------------------------
+r701 | joe | 2005-09-17 10:12:04 +0100 (Sat, 17 Sep 2005) | 2 lines
+
+Bump to 0.10.4.
+
+------------------------------------------------------------------------
+r699 | joe | 2005-09-17 10:09:13 +0100 (Sat, 17 Sep 2005) | 4 lines
+
+* src/locks.c (compare_locks): New function.
+(verify_discover): Use it; fix crashes if owner or token
+is NULL in expected or actual lock.
+
+------------------------------------------------------------------------
+r682 | joe | 2005-08-20 09:37:17 +0100 (Sat, 20 Aug 2005) | 2 lines
+
+Use test/common from neon 0.25.x branch.
+
+------------------------------------------------------------------------
+r676 | joe | 2005-08-17 21:09:45 +0100 (Wed, 17 Aug 2005) | 2 lines
+
+* NEWS: Add news for 0.10.3.
+
+------------------------------------------------------------------------
+r675 | joe | 2005-08-17 21:08:59 +0100 (Wed, 17 Aug 2005) | 2 lines
+
+* src/basic.c (create_temp, do_put_get): Add some error checking.
+
+------------------------------------------------------------------------
+r674 | joe | 2005-08-17 21:06:10 +0100 (Wed, 17 Aug 2005) | 3 lines
+
+* configure.ac: Unbump version since it was bumped once already since
+the last release.
+
+------------------------------------------------------------------------
+r673 | joe | 2005-08-17 21:03:23 +0100 (Wed, 17 Aug 2005) | 2 lines
+
+* configure.ac: Fix build with bundled expat. Bump to 0.10.4.
+
+------------------------------------------------------------------------
+r607 | joe | 2005-04-24 21:42:42 +0100 (Sun, 24 Apr 2005) | 3 lines
+
+* Makefile.in (install): Fix installation for VPATH builds (Mike
+Castle).
+
+------------------------------------------------------------------------
+r606 | joe | 2005-04-24 21:41:53 +0100 (Sun, 24 Apr 2005) | 2 lines
+
+- use neon 0.25.x branch for externals
+
+------------------------------------------------------------------------
+r605 | joe | 2005-04-24 21:41:15 +0100 (Sun, 24 Apr 2005) | 2 lines
+
+* configure.ac: Adapt for neon 0.25.
+
+------------------------------------------------------------------------
+r535 | joe | 2005-03-29 20:56:26 +0100 (Tue, 29 Mar 2005) | 4 lines
+
+* configure.ac: Bump for 0.10.2 release.
+
+* README: Update copyright.
+
+------------------------------------------------------------------------
+r514 | joe | 2005-03-02 15:02:25 +0000 (Wed, 02 Mar 2005) | 2 lines
+
+* src/http.c: Define EOL now neon doesn't.
+
+------------------------------------------------------------------------
+r487 | joe | 2005-02-24 14:37:06 +0000 (Thu, 24 Feb 2005) | 1 line
+
+Rename ChangeLog to ChangeLog.CVS.
+------------------------------------------------------------------------
+r486 | joe | 2005-02-24 14:36:28 +0000 (Thu, 24 Feb 2005) | 2 lines
+
+* Makefile.in (distclean, clean): Clean more.
+
+------------------------------------------------------------------------
+r485 | joe | 2005-02-24 14:24:03 +0000 (Thu, 24 Feb 2005) | 3 lines
+
+* src/largefile.c (init_largefile): Upload dummy file once to prep
+auth if necessary; don't disable persistent connections.
+
+------------------------------------------------------------------------
+r484 | joe | 2005-02-24 14:16:32 +0000 (Thu, 24 Feb 2005) | 7 lines
+
+Test that the entity returned by GET matches the entity stored by PUT
+in the largefile tests:
+
+* src/largefile.c (large_get): New test.
+
+* configure.ac: Check how to print long long.
+
+------------------------------------------------------------------------
+r482 | joe | 2005-02-23 16:59:09 +0000 (Wed, 23 Feb 2005) | 2 lines
+
+* src/largefile.c (provider): Fix to really increment the counter.
+
+------------------------------------------------------------------------
+r416 | joe | 2005-01-07 15:32:29 +0000 (Fri, 07 Jan 2005) | 3 lines
+
+* litmus.in: Support --version, advertise mailing list address in
+--help.
+
+------------------------------------------------------------------------
+r415 | joe | 2005-01-07 15:25:22 +0000 (Fri, 07 Jan 2005) | 2 lines
+
+* src/common.c (get_etag): Fix use-after-free.
+
+------------------------------------------------------------------------
+r408 | joe | 2005-01-06 13:40:05 +0000 (Thu, 06 Jan 2005) | 2 lines
+
+* src/common.c (get_etag): Update for neon 0.25 response-header API.
+
+------------------------------------------------------------------------
+r340 | joe | 2004-10-30 12:43:06 +0100 (Sat, 30 Oct 2004) | 2 lines
+
+* src/common.c: Include sys/stat.h
+
+------------------------------------------------------------------------
+r338 | joe | 2004-10-30 12:37:20 +0100 (Sat, 30 Oct 2004) | 7 lines
+
+* lib/neon: Move neon/src external here from "libneon" which might
+help stop people calling neon "libneon".
+
+* lib/expat: Import from cadaver/trunk/lib/expat.
+
+* Makefile.in, configure.in: Adapt for new externals locations.
+
+------------------------------------------------------------------------
+r278 | joe | 2004-10-04 22:57:34 +0100 (Mon, 04 Oct 2004) | 3 lines
+
+Set svn:externals to pick up libneon, macros and test-common directories from
+the neon trunk.
+
+------------------------------------------------------------------------
+r277 | joe | 2004-10-04 22:53:13 +0100 (Mon, 04 Oct 2004) | 1 line
+
+Import litmus HEAD.
+------------------------------------------------------------------------
diff --git a/ChangeLog.CVS b/ChangeLog.CVS
new file mode 100644
index 0000000..d73cc6a
--- /dev/null
+++ b/ChangeLog.CVS
@@ -0,0 +1,578 @@
+Sat Sep 18 10:53:33 2004 Joe Orton <joe@manyfish.co.uk>
+
+ * src/basic.c (delete_fragment): New test.
+
+Sat Sep 18 10:50:21 2004 Joe Orton <joe@manyfish.co.uk>
+
+ * src/basic.c (compare_contents): Use NE_FMT_SIZE_T.
+
+Sun Sep 12 21:43:56 2004 Joe Orton <joe@manyfish.co.uk>
+
+ * configure.ac: Bump to 0.10.0.
+
+Sun Sep 12 21:40:15 2004 Joe Orton <joe@manyfish.co.uk>
+
+ * src/locks.c (getlock): Take depth as argument.
+ (lock_excl, lock_shared): Adjust accordingly.
+ (prep_collection, lock_collection, indirect_refresh):
+ Collection locking tests.
+
+Sun Sep 12 19:20:01 2004 Joe Orton <joe@manyfish.co.uk>
+
+ * src/largefile.c: New file.
+
+ * Makefile.in (largefile, src/largefile.o): Add targets.
+
+Sun Sep 12 19:15:04 2004 Joe Orton <joe@manyfish.co.uk>
+
+ * src/props.c (do_patch): Avoid false negative from
+ -Wformat-security.
+
+Sun Sep 12 19:14:18 2004 Joe Orton <joe@manyfish.co.uk>
+
+ * src/locks.c (refresh): New test.
+ (conditional_put): Avoid false negative from -Wformat-security.
+
+Tue May 11 16:12:07 2004 Joe Orton <joe@manyfish.co.uk>
+
+ * src/locks.c (notowner_lock): Fix memory corruption issue.
+
+Sun Apr 4 10:10:43 2004 Joe Orton <joe@manyfish.co.uk>
+
+ * src/http.c (expect100): Include port in Host header when
+ appropriate.
+
+Sun Mar 7 11:49:08 2004 Joe Orton <joe@manyfish.co.uk>
+
+ * src/http.c (expect100): Skip for SSL session.
+
+Sun Mar 7 11:43:38 2004 Joe Orton <joe@manyfish.co.uk>
+
+ * src/props.c (propfind_returns_wellformed): Take a msg argument.
+ (propwformed): Adjust accordingly.
+ (propextended): New test.
+
+Sun Mar 7 11:18:59 2004 Joe Orton <joe@manyfish.co.uk>
+
+ Update for neon 0.25 API:
+
+ * configure.ac: Require neon 0.25.
+
+ * src/common.h: Add i_foo_len.
+
+ * src/common.c (open_foo): Set i_foo_len.
+ (get_etag): Move here.
+
+ * src/locks.c: Use get_etag from common.h; use i_foo_len.
+
+ * src/props.c (propfind_returns_wellformed): Use ne_xml_failed.
+
+Tue Aug 19 21:29:41 2003 Joe Orton <joe@manyfish.co.uk>
+
+ * configure.ac: Bump for 0.9.3.
+
+Mon Jan 5 17:02:51 2004 Joe Orton <jorton@redhat.com>
+
+ * src/copymove.c (copy_nodestcoll): New test.
+
+Wed Aug 27 11:34:02 2003 Joe Orton <joe@manyfish.co.uk>
+
+ * src/locks.c (fail_complex_cond_put): Revert previous "fix"
+ which wasn't.
+
+Tue Aug 26 23:45:05 2003 Joe Orton <joe@manyfish.co.uk>
+
+ * src/locks.c (fail_complex_cond_put): Fix to really send an
+ invalid etag (thanks to Tod Sambar).
+
+Sun Aug 24 20:52:40 2003 Joe Orton <joe@manyfish.co.uk>
+
+ * src/props.c (d0_results): Fix absolute URI comparison; Thomas
+ Kemmer.
+
+Tue Aug 19 21:29:41 2003 Joe Orton <joe@manyfish.co.uk>
+
+ * configure.ac: Bump for 0.9.3.
+
+Tue Aug 19 17:25:54 2003 Joe Orton <joe@manyfish.co.uk>
+
+ * src/basic.c (compare_contents): Fix signedness warnings.
+
+Tue Aug 19 17:17:06 2003 Joe Orton <joe@manyfish.co.uk>
+
+ Update for neon 0.24 API:
+
+ * src/props.c (propfind_d0): Only pass three arguments to
+ ne_propfind_set_private.
+
+ * src/common.c (test_connect): Use new sock_create/connect
+ API.
+
+ * src/http.c (expect100): Likewise.
+
+Tue Aug 19 16:56:08 2003 Joe Orton <joe@manyfish.co.uk>
+
+ * src/props.c (d0_results): Compare absolute URI against scheme
+ used for session, not "http://".
+
+Mon Jul 21 20:56:37 2003 Joe Orton <jorton@redhat.com>
+
+ Update to conditional PUT expected failure codes from Julian:
+
+ * src/locks.c (fail_cond_put): Warn on a non-412 error.
+ (cond_put_corrupt_token): Warn on a non-423 error.
+
+Wed Jun 4 14:33:56 2003 Joe Orton <jorton@redhat.com>
+
+ * Makefile.in (install): Support $(DESTDIR).
+
+Wed Jun 4 12:57:36 2003 Joe Orton <joe@manyfish.co.uk>
+
+ * src/locks.c (notowner_lock): Fix free() error if the ne_lock()
+ call unexpectedly succeeds - thanks to Thomas Kemmer
+ <tkemmer@hyperwave.com>.
+
+Wed Jun 4 12:55:41 2003 Joe Orton <joe@manyfish.co.uk>
+
+ * src/common.c (init_session): Fix to set useragent on given
+ session.
+
+Wed Jun 4 12:54:05 2003 Joe Orton <joe@manyfish.co.uk>
+
+ Update for neon 0.24 XML API.
+
+ * src/props.c (startelm): Replace d0_validate, endelm.
+ (propfind_d0): Pass startelm.
+ (dummy_valid): Removed function.
+ (propfind_returns_wellformed): No longer need dummy_valid.
+
+Wed Apr 9 09:38:23 2003 Joe Orton <joe@manyfish.co.uk>
+
+ * src/locks.c (cond_put, fail_cond_put): Add precondition on valid
+ lock.
+ (tests): Re-order to run copy and conditional PUT tests using the
+ exclusively-locked resource.
+
+Sun Mar 16 16:00:25 2003 Joe Orton <joe@manyfish.co.uk>
+
+ * src/locks.c (fail_cond_put): Use a token of <DAV:no-lock> not
+ <DAV-nolock>.
+
+Sun Mar 16 14:24:40 2003 Joe Orton <joe@manyfish.co.uk>
+
+ * src/locks.c (cond_put_corrupt_token): Give a warning for any
+ non-412 status, not non-423.
+
+Sat Mar 15 14:39:02 2003 Joe Orton <joe@manyfish.co.uk>
+
+ * src/props.c (dummy_valid, propfind_returns_wellformed,
+ propvalnspace, propwformed): New functions.
+
+Sat Mar 15 13:24:00 2003 Joe Orton <joe@manyfish.co.uk>
+
+ * src/props.c (do_patch): Factor out.
+ (propnullns, prophighunicode): Use it.
+ (propfind_d0): Adjust for neon 0.24 API.
+
+Sat Mar 15 13:18:44 2003 Joe Orton <joe@manyfish.co.uk>
+
+ * src/locks.c (get_etag, conditional_put, cond_put, fail_cond_put,
+ cond_put_with_not, cond_put_corrupt_token, complex_cond_put,
+ fail_complex_cond_put): New functions; Julian's conditional PUT
+ cases.
+
+Mon Feb 10 17:32:52 2003 Joe Orton <joe@manyfish.co.uk>
+
+ * src/common.c (test_connect): Connect to correct port when using
+ proxy server, and fix for neon 0.24 API.
+
+Thu Oct 10 09:07:55 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * src/common.c (i_pre_send): Use ne_snprintf.
+
+ * src/basic.c (do_put_get): Use ne_snprintf.
+
+ * configure.ac: Don't use NEON_REPLACE_SNPRINTF.
+
+Sat Sep 14 12:40:06 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * configure.ac: Renamed from configure.in.
+
+Sat Sep 14 12:37:23 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * configure.in: Add AC_COPYRIGHT, use AC_MSG_NOTICE for
+ post-configure message, modern use of AC_CONFIG_FILES and
+ AC_OUTPUT.
+
+Mon Sep 2 23:53:23 2002 Joe Orton <joe@manyfish.co.uk>
+
+ New test for resources with URL-encoded UTF-8-encoded names,
+ from Julian Reschke.
+
+ * src/basic.c (do_put_get): Factored out from put_get.
+ (put_get_utf8_segment): New function.
+ (put_get): Use do_put_get.
+
+Mon Sep 2 18:33:44 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * src/props.c (prophighunicode): New function, from Julian Reschke
+ <julian.reschke@gmx.de>.
+
+Mon Aug 26 17:16:29 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * configure.in: Bump version to 0.8; require neon 0.23.
+
+Mon Aug 26 17:15:20 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * src/common.c (init_session): Use PACKAGE_VERSION for user-agent.
+
+Mon Aug 26 17:10:15 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * src/common.c (test_connect): Updated for neon 0.23 resolver API.
+
+ * src/http.c (expect100): Likewise.
+
+Wed Aug 21 13:34:50 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * src/*.c: Replace use of CONCAT2 with ne_concat():
+ perl -pi -e 's/CONCAT2\(([^,]*), ([^)]*)\)/\1 = ne_concat(\2, NULL)/' src/props.c
+
+Wed Aug 21 10:20:10 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * src/common.h (i_address): Change type to ne_sock_addr.
+
+ * src/common.c (open_foo, make_space, upload_foo, init): Use
+ ne_concat not CONCAT2.
+ (test_resolve): New function.
+ (init): Use test_resolve.
+ (i_pre_send): Update for neon 0.22 hooks API.
+
+Wed Aug 21 10:19:24 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * src/common.h (ONNREQ2): Fix error string, thanks to Kai Pan
+ <pankai@soe.ucsc.edu>.
+
+Sat Aug 3 10:22:49 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * src/common.c (init_session): Don't disable persistent
+ connections.
+
+Sun May 19 18:28:42 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * src/http.c (expect100, ONS): Update for neon 0.21 socket API.
+
+ * src/common.c (test_connect, init): Likewise.
+
+Sun May 19 08:38:36 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * configure.in: Don't need ACL support in neon.
+
+Tue Feb 12 20:27:58 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * src/common.c (ignore_verify): New function.
+ (begin, init_session): Updated for neon 0.19 session API.
+
+Fri Jan 25 19:29:16 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * src/locks.c (getlock): Leave gotlock as NULL if LOCK fails.
+ (notowner_modify, notowner_lock, double_sharedlock, owner_modify,
+ copy, discover): Skip if gotlock is NULL.
+
+Mon Jan 21 20:29:08 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * src/basic.c (BINARYMODE): New macro. (create_temp, put_get):
+ Use BINARYMODE on fd returned by mkstemp.
+
+Mon Jan 21 19:52:42 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * src/basic.c (compare_contents, put_get): Pass O_BINARY to
+ open().
+
+ * src/common.c (open_foo): Pass O_BINARY to open().
+
+ * src/common.h: Define O_BINARY as (0) if undefined.
+
+Mon Jan 21 19:52:00 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * litmus.in: Mention debug.log on failure.
+
+Sat Jan 5 18:39:21 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * src/common.c (init, init_tests): Add support for proxy server.
+
+Sat Jan 5 16:46:48 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * litmus.in (litmus): Add --keep-going/-k option.
+
+Sat Jan 5 16:45:01 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * Makefile.in: Pass $(OPTS) variable to litmus.
+
+Sat Jan 5 16:43:49 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * src/common.c (init): Fix authentication set up.
+
+Sat Jan 5 16:40:58 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * src/basic.c (mkcol_with_body): Fix RFC number in error messages.
+
+Sat Jan 5 16:04:51 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * src/common.c (test_connect): Improve error message.
+
+Sat Jan 5 16:01:20 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * src/common.c (begin): Call make_space. (init): Call
+ test_connect and open_foo.
+
+ * src/common.h (INIT_TESTS): Reduced to init, begin.
+
+Sat Jan 5 11:15:54 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * src/locks.c (discover, verify_discover): New test.
+
+Sat Jan 5 10:54:32 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * src/locks.c (double_sharedlock): Use ONNREQ2.
+ (copy): New test.
+
+Sat Jan 5 10:49:11 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * src/common.h (ONNREQ, ONNREQ2): New macros.
+
+Fri Jan 4 23:02:20 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * src/locks.c (double_sharedlock): New function.
+
+Fri Jan 4 22:26:50 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * src/locks.c (precond): New function. (getlock): Factored out
+ from lock. (lock_excl): Renamed from lock. (lock_shared): New
+ function. (notowner_lock): Try with an exclusive lock.
+ (tests): Try modifying shared locked resource similarly to
+ exclusive locked resource.
+
+Fri Jan 4 21:32:59 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * litmus.in: Add usage description; check for invocation with
+ --help and -h.
+
+Tue Jan 1 23:29:21 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * configure.in: Support bundled expat build.
+
+ * expat/: Imported.
+
+Tue Jan 1 23:28:00 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * Makefile.in: Add LIBOBJS as last in ALL_LIBS rather than in
+ -ltest, so bundled expat build works.
+
+Tue Jan 1 17:03:39 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * litmus.in: New file.
+
+ * install-sh: Imported file.
+
+ * configure.in: Create litmus script.
+
+ * Makefile.in (check): Use litmus script to run tests.
+ (install, litmus): New target.
+
+Tue Jan 1 17:01:13 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * src/common.c (usage): New function.
+ (init): Add options support via getopt_long.
+ (open_foo): Support movable htdocs root.
+
+Tue Jan 1 15:57:24 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * src/copymove.c (move): Use i_foo_fd.
+
+Sun Nov 11 11:34:38 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * src/locks.c (notowner_modify): Add COPY test.
+
+Sun Nov 11 10:51:13 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * src/locks.c (owner_modify): New function. (tests): Run
+ notowner_* tests again after running owner_* tests, catching
+ mod_dav atomic-PUT regression.
+
+Sun Nov 11 10:34:10 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * src/common.c (init_session): Factored out from begin().
+ (begin): Use init_session; open i_session2 as well. (open_foo):
+ Rename fd variable to (exported) i_foo_fd.
+
+ * src/common.h: Export i_session2, i_foo_fd. (GETSTATUS2,
+ STATUS2): New macros.
+
+Sun Nov 11 10:32:51 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * src/locks.c (init_locks, put, lock, notowner_modify,
+ notowner_lock, unlock): New functions.
+
+Sat Nov 10 22:31:03 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * src/common.c (i_pre_send): Take header name as userdata; add
+ test suite name to field value. (begin): Use 'X-Litmus-One' as
+ header name for debug header on default session.
+
+Sat Nov 10 22:03:05 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * src/basic.c, src/interop.c (options): Moved to src/interop.c.
+
+Sat Nov 10 21:45:44 2001 Joe Orton <joe@manyfish.co.uk>
+
+ Make each test module a self-contained suite program.
+
+ * src/interop.c, src/interop.h: Export the common routines init,
+ test_connect etc. Define INIT_TESTS, FINISH_TESTS for easily
+ populating tests array with these routines. (expect100): Moved to
+ src/http.c.
+
+ * src/basic.c, src/copymove.c, src/props.c: Define `tests' array.
+
+ * src/http.c: New file.
+
+Sat Nov 10 21:20:40 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * src/basic.c (mkcol_over_plain, mkcol_with_body): New functions.
+
+Thu Nov 8 23:09:19 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * src/interop.c (make_space): New function. Run tests in a new,
+ empty collection.
+
+Wed Nov 7 21:20:42 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * configure.in: Project renamed to "litmus".
+
+ * Makefile.in (TARGET): Renamed to "litmus".
+
+ * src/interop.c (begin): Rename user-agent to "litmus/VERSION".
+
+Sun Oct 28 22:27:55 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * src/props.c (propinit): Remove the resource first. (propset,
+ propdeletes, propreplace): Use 'numprops' global for number of
+ properties set. (pg_results): Include namespace in "property not
+ found" message. (propnullns, propmanyns): New functions.
+
+Tue Oct 23 22:04:42 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * src/props.c (do_invalid_pfind): Factored out from
+ propfind_invalid. (propfind_invalid): Use it.
+ (propfind_invalid2): New function.
+
+Wed Aug 8 22:23:09 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * src/interop.c (begin): Use VERSION in user-agent. (expect100):
+ Fix duplicate defn warnings.
+
+Wed Aug 8 22:09:57 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * Makefile.in: Pick up AR/RANLIB from configure. Define .c -> .o
+ rule correctly.
+
+Wed Aug 8 21:44:35 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * src/interop.c: Integrated expect100 test with main tests.
+
+Wed Aug 8 21:28:27 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * src/interop.c (open_foo): New function. (ONS): New macro.
+ (expect100): New test.
+
+Wed Aug 8 21:12:33 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * src/props.c (NS): Moved props namespace here.
+ (propfind_invalid): New test. (d0_results): Handle absolute URIs.
+ (pg_results): More descriptive error messages.
+
+Wed Aug 8 21:08:05 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * src/basic.c (put_get): DELETE before initial PUT to be sure it
+ is a new resource. (delete_null): Only issue warning for
+ incorrect status code for DELETE on null resource. (mkcol):
+ DELETE first. (mkcol_no_parent): New test.
+
+Fri Jul 20 04:44:31 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * src/props.c (d0_results): Strip hostname segment.
+
+Tue Jul 17 23:24:57 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * src/copymove.c (move_coll): New function. (copy_coll): Fixes.
+
+Tue Jul 17 11:23:37 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * src/props.c: New file.
+
+Tue Jul 17 10:48:37 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * src/copymove.c (copy_init, copy_coll): Use upload_foo.
+
+Tue Jul 17 10:46:30 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * src/interop.c (upload_foo): New function. (init, begin): Handle
+ https: URLs.
+
+Mon Jul 16 21:18:03 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * src/copymove.c: Moved COPY/MOVE tests from basic.c.
+
+Mon Jul 16 20:32:24 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * src/basic.c (copy_coll): Test overwrite t/f too.
+
+Mon Jul 16 19:31:13 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * src/interop.c (auth): New function. (main) Take optional
+ username/password parms. (begin): Register auth callback if
+ necessary.
+
+Mon Jul 16 19:13:15 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * src/basic.c (copy, copy_coll): New tests.
+
+Mon Jul 16 18:23:02 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * src/interop.c (begin): Set a user-agent.
+
+Mon Jul 16 17:54:13 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * src/basic.c (mkcol, mkcol_again, delete_coll, mkcol_no_parent):
+ New tests. (put_get): Check for 201 status.
+
+ * src/interop.h (STATUS): New macro.
+
+Mon Jul 16 16:44:09 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * src/interop.c (test_connect): New test.
+
+Mon Jul 16 16:38:36 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * src/basic.c (delete_null): New test.
+
+Mon Jul 16 16:28:09 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * src/basic.c (delete): New test.
+
+Mon Jul 16 16:27:44 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * src/basic.c (compare_contents): Fix buffer_append problem.
+
+Mon Jul 16 14:45:49 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * src/interop.c (init): Ensure path has trailing slash.
+
+2001-07-16 Joe Orton <joe@toilet.worknet>
+
+ * src/basic.c (put_get): New test.
+
+Mon Jul 16 15:21:17 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * src/interop.c (init): Take and parse a URL in argv[1].
+
diff --git a/FAQ b/FAQ
new file mode 100644
index 0000000..07f8b40
--- /dev/null
+++ b/FAQ
@@ -0,0 +1,76 @@
+
+* Why does the move_coll test fail on test.webdav.org?
+
+At time of writing, test.webdav.org is running an old version of
+mod_dav which has a few bugs. mod_dav 1.0.3 passes all litmus tests.
+
+* What does the "propfind_invalid2" test check for?
+
+This was a bug found in mod_dav 1.0.2 by Julian Reschke.
+
+If a request was sent with an XML body which included an empty
+namespace prefix declaration (xmlns:ns1=""), then the server must
+reject that with a "400 Bad Request" response, as it is invalid
+according to the XML Namespace specification:
+
+http://www.w3.org/TR/REC-xml-names#dt-prefix
+
+* What does the "propnullns" test check for?
+
+This was a bug found in mod_dav 1.0.2 by Julian Reschke.
+
+If a property was created which had a name with an empty namespace,
+then mod_dav would produce a PROPFIND response for that property which
+itself included an invalid empty namespace prefix declaration. The
+"propnullns" test checks for this, simply by setting a property with
+an empty namespace, and retrieving it again.
+
+* How do I use litmus with a proxy server?
+
+For instance, using an HTTP proxy called "foobar" on port 8080, use:
+
+ $ litmus --proxy=foobar:8080 http://server/dav/
+
+* How do I use litmus with an SSL server?
+
+Just pass in the appropriate https:// URL, for instance:
+
+ $ litmus https://server/dav/
+
+* What do the cond_put tests do?
+
+Here are brief descriptions of the conditional PUT tests: these tests
+send conditional PUT requests against an exclusive-locked resource;
+conditions using the If header, see RFC2518 section 9.4.
+
+1. cond_put: a PUT conditional on the resource state having the known
+etag and lock token; should succeed.
+
+2. fail_cond_put: a PUT conditional on the resource having the known
+etag and the lock token "DAV:nolock"; since this is an invalid
+lock-token, the PUT should fail.
+
+3. cond_put_with_not: a PUT including a binary conditional:
+ If: (<real-lock-token>) (Not <DAV:no-lock>)
+since the first part of the condition should be true (the real
+lock token), and the second part is (Not false) == true,
+the PUT should succeed.
+
+4. cond_put_corrupt_token: a PUT conditional including an If
+header with a *corrupt* etag; this should not match the resource
+state so the request should fail.
+
+5. complex_cond_put: a complex conditional as follows:
+
+ If: <(real-lock-token) [real-etag]) (Not <DAV:no-lock> [real-etag])
+
+the first half of the condition should be true; as tested in
+cond_put_with_not, the second half should also be true; so the
+condition should be met and the PUT should succeed.
+
+6. fail_complex_cond_put: a complex conditional as follows:
+
+ If: <(real-lock-token) [corrupt-etag]) (Not <DAV:no-lock> [real-etag])
+
+the first half of the condition should be false, so the condition as
+a whole should be false, so the PUT should fail with a 412 result.
diff --git a/INSTALL b/INSTALL
new file mode 100644
index 0000000..b42a17a
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,182 @@
+Basic Installation
+==================
+
+ These are generic installation instructions.
+
+ The `configure' shell script attempts to guess correct values for
+various system-dependent variables used during compilation. It uses
+those values to create a `Makefile' in each directory of the package.
+It may also create one or more `.h' files containing system-dependent
+definitions. Finally, it creates a shell script `config.status' that
+you can run in the future to recreate the current configuration, a file
+`config.cache' that saves the results of its tests to speed up
+reconfiguring, and a file `config.log' containing compiler output
+(useful mainly for debugging `configure').
+
+ If you need to do unusual things to compile the package, please try
+to figure out how `configure' could check whether to do them, and mail
+diffs or instructions to the address given in the `README' so they can
+be considered for the next release. If at some point `config.cache'
+contains results you don't want to keep, you may remove or edit it.
+
+ The file `configure.in' is used to create `configure' by a program
+called `autoconf'. You only need `configure.in' if you want to change
+it or regenerate `configure' using a newer version of `autoconf'.
+
+The simplest way to compile this package is:
+
+ 1. `cd' to the directory containing the package's source code and type
+ `./configure' to configure the package for your system. If you're
+ using `csh' on an old version of System V, you might need to type
+ `sh ./configure' instead to prevent `csh' from trying to execute
+ `configure' itself.
+
+ Running `configure' takes awhile. While running, it prints some
+ messages telling which features it is checking for.
+
+ 2. Type `make' to compile the package.
+
+ 3. Optionally, type `make check' to run any self-tests that come with
+ the package.
+
+ 4. Type `make install' to install the programs and any data files and
+ documentation.
+
+ 5. You can remove the program binaries and object files from the
+ source code directory by typing `make clean'. To also remove the
+ files that `configure' created (so you can compile the package for
+ a different kind of computer), type `make distclean'. There is
+ also a `make maintainer-clean' target, but that is intended mainly
+ for the package's developers. If you use it, you may have to get
+ all sorts of other programs in order to regenerate files that came
+ with the distribution.
+
+Compilers and Options
+=====================
+
+ Some systems require unusual options for compilation or linking that
+the `configure' script does not know about. You can give `configure'
+initial values for variables by setting them in the environment. Using
+a Bourne-compatible shell, you can do that on the command line like
+this:
+ CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
+
+Or on systems that have the `env' program, you can do it like this:
+ env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
+
+Compiling For Multiple Architectures
+====================================
+
+ You can compile the package for more than one kind of computer at the
+same time, by placing the object files for each architecture in their
+own directory. To do this, you must use a version of `make' that
+supports the `VPATH' variable, such as GNU `make'. `cd' to the
+directory where you want the object files and executables to go and run
+the `configure' script. `configure' automatically checks for the
+source code in the directory that `configure' is in and in `..'.
+
+ If you have to use a `make' that does not supports the `VPATH'
+variable, you have to compile the package for one architecture at a time
+in the source code directory. After you have installed the package for
+one architecture, use `make distclean' before reconfiguring for another
+architecture.
+
+Installation Names
+==================
+
+ By default, `make install' will install the package's files in
+`/usr/local/bin', `/usr/local/man', etc. You can specify an
+installation prefix other than `/usr/local' by giving `configure' the
+option `--prefix=PATH'.
+
+ You can specify separate installation prefixes for
+architecture-specific files and architecture-independent files. If you
+give `configure' the option `--exec-prefix=PATH', the package will use
+PATH as the prefix for installing programs and libraries.
+Documentation and other data files will still use the regular prefix.
+
+ In addition, if you use an unusual directory layout you can give
+options like `--bindir=PATH' to specify different values for particular
+kinds of files. Run `configure --help' for a list of the directories
+you can set and what kinds of files go in them.
+
+ If the package supports it, you can cause programs to be installed
+with an extra prefix or suffix on their names by giving `configure' the
+option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
+
+Optional Features
+=================
+
+ Some packages pay attention to `--enable-FEATURE' options to
+`configure', where FEATURE indicates an optional part of the package.
+They may also pay attention to `--with-PACKAGE' options, where PACKAGE
+is something like `gnu-as' or `x' (for the X Window System). The
+`README' should mention any `--enable-' and `--with-' options that the
+package recognizes.
+
+ For packages that use the X Window System, `configure' can usually
+find the X include and library files automatically, but if it doesn't,
+you can use the `configure' options `--x-includes=DIR' and
+`--x-libraries=DIR' to specify their locations.
+
+Specifying the System Type
+==========================
+
+ There may be some features `configure' can not figure out
+automatically, but needs to determine by the type of host the package
+will run on. Usually `configure' can figure that out, but if it prints
+a message saying it can not guess the host type, give it the
+`--host=TYPE' option. TYPE can either be a short name for the system
+type, such as `sun4', or a canonical name with three fields:
+ CPU-COMPANY-SYSTEM
+
+See the file `config.sub' for the possible values of each field. If
+`config.sub' isn't included in this package, then this package doesn't
+need to know the host type.
+
+ If you are building compiler tools for cross-compiling, you can also
+use the `--target=TYPE' option to select the type of system they will
+produce code for and the `--build=TYPE' option to select the type of
+system on which you are compiling the package.
+
+Sharing Defaults
+================
+
+ If you want to set default values for `configure' scripts to share,
+you can create a site shell script called `config.site' that gives
+default values for variables like `CC', `cache_file', and `prefix'.
+`configure' looks for `PREFIX/share/config.site' if it exists, then
+`PREFIX/etc/config.site' if it exists. Or, you can set the
+`CONFIG_SITE' environment variable to the location of the site script.
+A warning: not all `configure' scripts look for a site script.
+
+Operation Controls
+==================
+
+ `configure' recognizes the following options to control how it
+operates.
+
+`--cache-file=FILE'
+ Use and save the results of the tests in FILE instead of
+ `./config.cache'. Set FILE to `/dev/null' to disable caching, for
+ debugging `configure'.
+
+`--help'
+ Print a summary of the options to `configure', and exit.
+
+`--quiet'
+`--silent'
+`-q'
+ Do not print messages saying which checks are being made. To
+ suppress all normal output, redirect it to `/dev/null' (any error
+ messages will still be shown).
+
+`--srcdir=DIR'
+ Look for the package's source code in directory DIR. Usually
+ `configure' can determine that directory automatically.
+
+`--version'
+ Print the version of Autoconf used to generate the `configure'
+ script, and exit.
+
+`configure' also accepts some other, not widely useful, options.
diff --git a/Makefile.in b/Makefile.in
new file mode 100644
index 0000000..5a183a4
--- /dev/null
+++ b/Makefile.in
@@ -0,0 +1,123 @@
+# litmus @configure_input@
+SHELL = @SHELL@
+
+# Installation directories
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+libexecdir = @libexecdir@
+bindir = @bindir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+
+# Toolchain settings
+CC = @CC@
+CFLAGS = @CFLAGS@
+CPPFLAGS = @DEFS@ @CPPFLAGS@ -I$(top_srcdir)/src -I$(top_srcdir)/test-common
+
+LDFLAGS = @LDFLAGS@
+LIBS = @NEON_LIBS@ @LIBS@
+# expat may be in LIBOBJS, so must come after $(LIBS) (which has -lneon)
+ALL_LIBS = -L. -ltest $(LIBS) $(LIBOBJS)
+
+top_builddir = .
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+@SET_MAKE@
+
+AR = @AR@
+RANLIB = @RANLIB@
+
+LIBOBJS = @LIBOBJS@
+TESTOBJS = src/common.o test-common/child.o test-common/tests.o
+HDRS = src/common.h test-common/tests.h config.h
+
+TESTS = @TESTS@
+HTDOCS = foo
+
+URL = http://`hostname`/dav/
+CREDS = `whoami` `whoami`
+DIR = .
+OPTS =
+
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL = @INSTALL@
+
+# Fixme; use $(LIBOBJS) here instead. not happy on many non-GNU makes
+# though; not sure why.
+ODEPS = subdirs libtest.a @LIBOBJS@
+
+all: $(TESTS)
+ @echo
+ @echo " Now run:"
+ @echo ""
+ @echo ' make URL=http://dav.server/path/ check'
+ @echo ' or make URL=http://dav.server/path/ CREDS="uname passwd" check'
+ @echo ""
+
+litmus: litmus.in
+ @./config.status $@
+
+check: $(TESTS) litmus
+ @test -d "$(DIR)" || mkdir "$(DIR)"
+ @rm -f $(DIR)/debug.log $(DIR)/child.log
+ @if test "$(DIR)" != "."; then echo "TESTS FOR $(DIR) ---"; fi
+ @cd $(DIR) && TESTROOT="$(top_builddir)" HTDOCS="$(top_srcdir)/htdocs" \
+ $(top_builddir)/litmus $(OPTS) $(URL) $(CREDS)
+
+install: $(TESTS) litmus
+ $(INSTALL) -d $(DESTDIR)$(bindir)
+ $(INSTALL) -d $(DESTDIR)$(libexecdir)/litmus
+ $(INSTALL) -d $(DESTDIR)$(datadir)/litmus/htdocs
+ $(INSTALL_PROGRAM) $(top_builddir)/litmus $(DESTDIR)$(bindir)/litmus
+ for t in $(TESTS); do \
+ $(INSTALL_PROGRAM) $(top_builddir)/$$t $(DESTDIR)$(libexecdir)/litmus/$$t; done
+ for d in $(HTDOCS); do \
+ $(INSTALL_DATA) $(top_srcdir)/htdocs/$$d $(DESTDIR)$(datadir)/litmus/htdocs/$d; done
+
+props: src/props.o $(ODEPS)
+ $(CC) $(LDFLAGS) -o $@ src/props.o $(ALL_LIBS)
+
+basic: src/basic.o $(ODEPS)
+ $(CC) $(LDFLAGS) -o $@ src/basic.o $(ALL_LIBS)
+
+copymove: src/copymove.o $(ODEPS)
+ $(CC) $(LDFLAGS) -o $@ src/copymove.o $(ALL_LIBS)
+
+locks: src/locks.o $(ODEPS)
+ $(CC) $(LDFLAGS) -o $@ src/locks.o $(ALL_LIBS)
+
+http: src/http.o $(ODEPS)
+ $(CC) $(LDFLAGS) -o $@ src/http.o $(ALL_LIBS)
+
+largefile: src/largefile.o $(ODEPS)
+ $(CC) $(LDFLAGS) -o $@ src/largefile.o $(ALL_LIBS)
+
+subdirs:
+ @cd lib/neon && $(MAKE)
+
+libtest.a: $(TESTOBJS)
+ $(AR) cru $@ $(TESTOBJS)
+ $(RANLIB) $@
+
+clean:
+ @cd lib/neon && $(MAKE) clean
+ rm -f */*.o $(TESTS) largefile libtest.a *~ debug.log child.log
+
+distclean: clean
+ @cd lib/neon && $(MAKE) distclean
+ rm Makefile litmus config.log config.h config.status
+
+.c.o:
+ $(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@
+
+Makefile: $(top_srcdir)/Makefile.in
+ ./config.status Makefile
+
+src/basic.o: src/basic.c $(HDRS)
+src/common.o: src/common.c $(HDRS)
+src/copymove.o: src/copymove.c $(HDRS)
+src/locks.o: src/locks.c $(HDRS)
+src/props.o: src/props.c $(HDRS)
+src/http.o: src/http.c $(HDRS)
+src/largefile.o: src/largefile.c $(HDRS)
diff --git a/NEWS b/NEWS
new file mode 100644
index 0000000..aedadbe
--- /dev/null
+++ b/NEWS
@@ -0,0 +1,142 @@
+Changes in version 0.13:
+* Changed tests:
+ - locks: owner_modify checks that PROPPATCH works against a locked
+ resource (thanks to Javier Godoy)
+* Support PKCS#12 client cert with --client-cert/-c (Alejandro Alvarez Ayllon)
+* Update to neon 0.29.6.
+
+Changes in version 0.12.1:
+* Changed tests:
+ - locks: remove DELETE from unmapped URI LOCK/DELETE/UNLOCK sequence
+ - locks: fail if LOCK gives a lockscope which does not match that requested
+ - props: use real URIs for the property namespaces
+
+Changes in version 0.12:
+* New tests:
+ - props: unmapped_lock (Henrik Holst)
+ - basic: put_no_parent
+* Changed tests:
+ - props: propvalnspace - use a valid URI in the 'foo' element
+* Update to neon 0.28.3; support neon 0.25.x->0.28.x
+
+Changes in version 0.11:
+* New tests from Julian Reschke:
+ - props: test for correct PROPPATCH propertyupdate evaluation order
+ - copymove: test for "Depth: 0" COPY of collection
+* Test URL is no longer path-escaped internally.
+* Update to neon 0.26.3.
+
+Changes in version 0.10.5:
+* Add another test for handling of unknown state tokens in an If: header.
+* Update to neon 0.25.4.
+
+Changes in version 0.10.4:
+* Fix possible crashes in lock discovery.
+* Update to neon 0.25.3.
+
+Changes in version 0.10.3:
+* Fix VPATH builds (Mike Castle).
+* Fix build with bundled expat.
+* Update to neon 0.25.2.
+
+Changes in version 0.10.2:
+* Fix build on Mac OS X.
+* Fixes for the "largefile" test suite.
+
+Changes in version 0.10.1:
+* Add check for DELETE safety with #fragment in Request-URI.
+
+Changes in version 0.10:
+* Add some basic collection locking tests.
+* Correct fail_complex_cond_put to really send an invalid etag as intended,
+ thanks to Tod Sambar.
+* Describe the conditional PUT tests in the FAQ.
+* Add test for PROPFIND <propfind> extensibility rules in request body.
+* Skip the 'expect100' in the 'http' suite for an SSL session.
+
+Changes in version 0.9.4:
+* Correct fix for comparison of absolute URIs in PROPFIND responses,
+ thanks to Thomas Kemmer.
+
+Changes in version 0.9.3:
+* Fix some segfaults when some lock tests fail (thanks to Thomas Kemmer).
+* Fix comparison of hrefs in PROPFIND responses containing absolute https URI.
+* Run conditional PUT tests against exclusive-locked resource.
+
+Changes in version 0.9.2:
+* Fix build when configured without SSL support.
+* Fix build on FreeBSD.
+
+Changes in version 0.9.1:
+* Fix build with bundled copy of expat.
+* Tweaks to conditional PUT tests (Julian Reschke).
+
+Changes in version 0.9:
+* New tests submitted by Julian Reschke <julian.reschke@gmx.de>:
+ - check handling of high Unicode values in property values
+ - check handling of resource URIs including non-ASCII characters
+* Implement Julian's conditional PUT tests, testing If: headers with
+ various combinations of lock-tokens and etags.
+* Add test for Apache 2.0 namespace handling bug #14969.
+* Fix use of proxy with non-default port.
+
+Changes in version 0.8:
+* Persistent connections are enabled by default.
+* Updated to neon 0.23.0:
+ - many SSL fixes and improvements
+ - IPv6 support when getaddrinfo() is detected
+
+Changes in version 0.7:
+* Updated to neon 0.20.0:
+ - better handling of LOCK responses for shared locks; use the lock token
+ from the Lock-Token header (not really in 0.6 as claimed).
+
+Changes in version 0.6.1:
+* Better chance of compiling on cygwin.
+
+Changes in version 0.6:
+* Fixes for cygwin (thanks to Julian Reschke).
+* Improved failure messages.
+* If a LOCK fails, dependant tests will be skipped.
+* Add documentation to 'FAQ' on some of the tests which failed with
+ mod_dav 1.0.2.
+* Upgrade to neon 0.20.0-dev:
+ - RFC2518 compliance fix: use absoluteURIs in If: headers
+
+Changes in version 0.5:
+* Fix authentication.
+* Add support for proxy servers using `--proxy=hostname:port' option.
+ - from build tree, use "make OPTS="--proxy=hostname:port" URL="..." check
+* Add -k/--keep-going option to 'litmus' script, to have testing
+ continue even after a test program fails.
+
+Changes in version 0.4:
+* Renamed project from "neon-interop" to "litmus".
+* Greatly improved error messages for test failures throughout.
+* Add locking tests (portions from Chris Sharp <csharp@apple.com>):
+ - modifying a locked resource as and not as lock owner
+ - shared and exclusive locks, lock discovery
+ - lock doesn't follow COPY
+* Tests are run in a new, empty collection: eliminate problems caused
+ by left-over files from previous failed runs.
+* Add tests for MKCOL on plain resource, with strange body.
+* Each request will have a request header 'X-Litmus' giving the test
+ number and description, to aid debugging using network trace tools.
+* Tests separated into several executables. Can easily run a subset of
+ tests now using e.g. 'make TESTS=locks URL=http://blah/ check'
+* Add 'litmus' wrapper script and 'make install' target.
+* Based on neon 0.18: brings portability fixes, etc.
+
+Changes in version 0.3:
+* Add tests for "empty namespace" bugs found in mod_dav by Julian Reschke.
+* Add tests for properties in many namespaces.
+
+Changes in version 0.2:
+* Catch up with neon 0.17 test framework, beautify output.
+
+Changes in version 0.1:
+* Added check for "Expect: 100-continue" support.
+
+Changes in version 0.0:
+* Initial version used at the WebDAV Interoperability Event in
+ UC Santa Cruz, July 19-20th 2001.
diff --git a/README b/README
new file mode 100644
index 0000000..338710d
--- /dev/null
+++ b/README
@@ -0,0 +1,54 @@
+
+litmus: WebDAV server protocol compliance test suite. Tests include:
+
+* OPTIONS for DAV: header
+* PUT, GET with byte comparison
+* MKCOL
+* DELETE (collections, non-collections)
+* COPY, MOVE using combinations of:
+ - overwrite t/f
+ - destination exists/doesn't exist
+ - collection/non-collection
+* Property manipulation and querying:
+ - set, delete, replace properties
+ - persist dead props across COPY
+ - namespace handling
+* Locking
+ - attempts to modify locked resource (as lock owner, not owner)
+ - shared/exclusive locks, lock discovery
+
+litmus comprises of a set of test suites as separate executables: each
+program takes a URL on the command-line, optionally followed by
+username and password. To run all the suites from a built litmus
+tree, use
+
+ make URL=http://dav.server.url/path/ check
+
+Where http://dav.server.url/path/ is a DAV-enabled collection. litmus
+must be able to create a new collection called 'litmus' at that
+location. The Makefile variable 'CREDS' can also be defined to be a
+username/password separated by strings. e.g. if you have a user 'jim'
+defined with password '2518', use:
+
+ make URL=http://dav.server.url/path/ CREDS="jim 2518" check
+
+To aid debugging, litmus adds a header `X-Litmus-One' to every request
+made. After running a test suite, the file 'debug.log' includes a
+full neon debugging trace (unless neon or litmus was configured
+without debugging enabled!).
+
+To use after installation is complete ('make install'), run the
+'litmus' script, passing in a URL, optionally followed by the
+username/password. For instance:
+
+ litmus http://dav.server.url/path/
+ or litmus http://dav.server.url/path/ jim 2518
+
+litmus is licensed under the GNU GPL; see COPYING for full details.
+litmus is (C) 2001-2005 Joe Orton
+
+neon is licensed under the GNU LGPL; see libneon/COPYING.LIB for details.
+neon is (C) 1999-2005 Joe Orton and others.
+
+Please send bug reports, feature requests, etc. in to the neon mailing
+list at litmus@lists.manyfish.co.uk
diff --git a/THANKS b/THANKS
new file mode 100644
index 0000000..a94b3b7
--- /dev/null
+++ b/THANKS
@@ -0,0 +1,4 @@
+Chris Sharp <csharp@apple.com>
+Julian Reschke <julian.reschke@gmx.de>
+Thomas Kemmer <tkemmer@hyperwave.com>
+Tod Sambar <sambart@corp.earthlink.net>
diff --git a/TODO b/TODO
new file mode 100644
index 0000000..0acf1de
--- /dev/null
+++ b/TODO
@@ -0,0 +1,10 @@
+
+Bugs from Keith/Julian:
+- PROPPATCH response may be 207 with embedded 423, lock tests
+check for 423 directly. Extend PROPPATCH interface to return
+true ne_status structures for each operation?
+
+Features:
+* add collection locking tests.
+* add lock-null tests.
+* test for collection creation with %20 space
diff --git a/aclocal.m4 b/aclocal.m4
new file mode 100644
index 0000000..b01b53e
--- /dev/null
+++ b/aclocal.m4
@@ -0,0 +1,16 @@
+# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2007, 2008, 2009 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_include([macros/neon-test.m4])
+m4_include([macros/neon-xml-parser.m4])
+m4_include([macros/neon.m4])
diff --git a/autogen.sh b/autogen.sh
new file mode 100755
index 0000000..8abab7b
--- /dev/null
+++ b/autogen.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+set -e
+echo -n "aclocal... "
+${ACLOCAL:-aclocal} -I macros
+echo -n "autoheader... "
+${AUTOHEADER:-autoheader}
+echo -n "autoconf... "
+${AUTOCONF:-autoconf}
+echo okay.
+rm -rf autom4te*.cache
diff --git a/config.h.in b/config.h.in
new file mode 100644
index 0000000..2590f8a
--- /dev/null
+++ b/config.h.in
@@ -0,0 +1,481 @@
+/* config.h.in. Generated from configure.ac by autoheader. */
+
+/* Define if building universal (internal helper macro) */
+#undef AC_APPLE_UNIVERSAL_BUILD
+
+/* Define to specific EGD socket path */
+#undef EGD_PATH
+
+/* Define if EGD should be supported */
+#undef ENABLE_EGD
+
+/* Define if GSS_C_NT_HOSTBASED_SERVICE is not defined otherwise */
+#undef GSS_C_NT_HOSTBASED_SERVICE
+
+/* Define to 1 if you have the <arpa/inet.h> header file. */
+#undef HAVE_ARPA_INET_H
+
+/* Define to 1 if you have the `CRYPTO_set_idptr_callback' function. */
+#undef HAVE_CRYPTO_SET_IDPTR_CALLBACK
+
+/* Define to 1 if you have the declaration of `h_errno', and to 0 if you
+ don't. */
+#undef HAVE_DECL_H_ERRNO
+
+/* Define to 1 if you have the declaration of `stpcpy', and to 0 if you don't.
+ */
+#undef HAVE_DECL_STPCPY
+
+/* Define to 1 if you have the declaration of `strerror_r', and to 0 if you
+ don't. */
+#undef HAVE_DECL_STRERROR_R
+
+/* Define to 1 if you have the <errno.h> header file. */
+#undef HAVE_ERRNO_H
+
+/* Define if you have expat */
+#undef HAVE_EXPAT
+
+/* Define to 1 if you have the `fcntl' function. */
+#undef HAVE_FCNTL
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#undef HAVE_FCNTL_H
+
+/* Define to 1 if you have the `fstat64' function. */
+#undef HAVE_FSTAT64
+
+/* Define to 1 if you have the `gai_strerror' function. */
+#undef HAVE_GAI_STRERROR
+
+/* Define to 1 if you have the `gethostname' function. */
+#undef HAVE_GETHOSTNAME
+
+/* Define to 1 if you have the `getnameinfo' function. */
+#undef HAVE_GETNAMEINFO
+
+/* Define to 1 if you have the `getsockopt' function. */
+#undef HAVE_GETSOCKOPT
+
+/* Define if GnuTLS support is enabled */
+#undef HAVE_GNUTLS
+
+/* Define to 1 if you have the `gnutls_certificate_get_x509_cas' function. */
+#undef HAVE_GNUTLS_CERTIFICATE_GET_X509_CAS
+
+/* Define to 1 if you have the `gnutls_certificate_verify_peers2' function. */
+#undef HAVE_GNUTLS_CERTIFICATE_VERIFY_PEERS2
+
+/* Define to 1 if you have the `gnutls_session_get_data2' function. */
+#undef HAVE_GNUTLS_SESSION_GET_DATA2
+
+/* Define to 1 if you have the `gnutls_sign_callback_set' function. */
+#undef HAVE_GNUTLS_SIGN_CALLBACK_SET
+
+/* Define to 1 if you have the `gnutls_x509_dn_get_rdn_ava' function. */
+#undef HAVE_GNUTLS_X509_DN_GET_RDN_AVA
+
+/* Define if GSSAPI support is enabled */
+#undef HAVE_GSSAPI
+
+/* Define to 1 if you have the <gssapi/gssapi_generic.h> header file. */
+#undef HAVE_GSSAPI_GSSAPI_GENERIC_H
+
+/* Define to 1 if you have the <gssapi/gssapi.h> header file. */
+#undef HAVE_GSSAPI_GSSAPI_H
+
+/* Define to 1 if you have the <gssapi.h> header file. */
+#undef HAVE_GSSAPI_H
+
+/* Define to 1 if you have the `gss_init_sec_context' function. */
+#undef HAVE_GSS_INIT_SEC_CONTEXT
+
+/* Define to 1 if you have the `hstrerror' function. */
+#undef HAVE_HSTRERROR
+
+/* Define to 1 if you have the `iconv' function. */
+#undef HAVE_ICONV
+
+/* Define to 1 if you have the <iconv.h> header file. */
+#undef HAVE_ICONV_H
+
+/* Define to 1 if you have the `inet_ntop' function. */
+#undef HAVE_INET_NTOP
+
+/* Define to 1 if you have the `inet_pton' function. */
+#undef HAVE_INET_PTON
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the `isatty' function. */
+#undef HAVE_ISATTY
+
+/* Define to 1 if you have the <libintl.h> header file. */
+#undef HAVE_LIBINTL_H
+
+/* Define if libproxy is supported */
+#undef HAVE_LIBPROXY
+
+/* Define if you have libxml */
+#undef HAVE_LIBXML
+
+/* Define to 1 if you have the <libxml/parser.h> header file. */
+#undef HAVE_LIBXML_PARSER_H
+
+/* Define to 1 if you have the <libxml/xmlversion.h> header file. */
+#undef HAVE_LIBXML_XMLVERSION_H
+
+/* Define to 1 if you have the <limits.h> header file. */
+#undef HAVE_LIMITS_H
+
+/* Define to 1 if you have the <locale.h> header file. */
+#undef HAVE_LOCALE_H
+
+/* Define to 1 if you have the `lseek64' function. */
+#undef HAVE_LSEEK64
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the <netdb.h> header file. */
+#undef HAVE_NETDB_H
+
+/* Define to 1 if you have the <netinet/in.h> header file. */
+#undef HAVE_NETINET_IN_H
+
+/* Define to 1 if you have the <netinet/tcp.h> header file. */
+#undef HAVE_NETINET_TCP_H
+
+/* Define if NTLM is supported */
+#undef HAVE_NTLM
+
+/* Define if OpenSSL support is enabled */
+#undef HAVE_OPENSSL
+
+/* Define to 1 if you have the <openssl/opensslv.h> header file. */
+#undef HAVE_OPENSSL_OPENSSLV_H
+
+/* Define to 1 if you have the <openssl/ssl.h> header file. */
+#undef HAVE_OPENSSL_SSL_H
+
+/* Define if pakchois library supported */
+#undef HAVE_PAKCHOIS
+
+/* Define to 1 if you have the `pipe' function. */
+#undef HAVE_PIPE
+
+/* Define to 1 if you have the `poll' function. */
+#undef HAVE_POLL
+
+/* Define to 1 if you have the `pthread_mutex_init' function. */
+#undef HAVE_PTHREAD_MUTEX_INIT
+
+/* Define to 1 if you have the `pthread_mutex_lock' function. */
+#undef HAVE_PTHREAD_MUTEX_LOCK
+
+/* Define to 1 if you have the `setlocale' function. */
+#undef HAVE_SETLOCALE
+
+/* Define to 1 if you have the `setsockopt' function. */
+#undef HAVE_SETSOCKOPT
+
+/* Define to 1 if you have the `setvbuf' function. */
+#undef HAVE_SETVBUF
+
+/* Define to 1 if you have the `shutdown' function. */
+#undef HAVE_SHUTDOWN
+
+/* Define to 1 if you have the `signal' function. */
+#undef HAVE_SIGNAL
+
+/* Define to 1 if you have the <signal.h> header file. */
+#undef HAVE_SIGNAL_H
+
+/* Define to 1 if you have the `snprintf' function. */
+#undef HAVE_SNPRINTF
+
+/* Define to 1 if the system has the type `socklen_t'. */
+#undef HAVE_SOCKLEN_T
+
+/* Define to 1 if you have the `SSL_SESSION_cmp' function. */
+#undef HAVE_SSL_SESSION_CMP
+
+/* Define to 1 if you have the <stdarg.h> header file. */
+#undef HAVE_STDARG_H
+
+/* 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 `stpcpy' function. */
+#undef HAVE_STPCPY
+
+/* Define to 1 if you have the `strcasecmp' function. */
+#undef HAVE_STRCASECMP
+
+/* Define to 1 if you have the `strerror_r' function. */
+#undef HAVE_STRERROR_R
+
+/* 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 `strtoll' function. */
+#undef HAVE_STRTOLL
+
+/* Define to 1 if you have the `strtoq' function. */
+#undef HAVE_STRTOQ
+
+/* Define to 1 if `tm_gmtoff' is a member of `struct tm'. */
+#undef HAVE_STRUCT_TM_TM_GMTOFF
+
+/* Define to 1 if `__tm_gmtoff' is a member of `struct tm'. */
+#undef HAVE_STRUCT_TM___TM_GMTOFF
+
+/* Define to 1 if you have the <sys/limits.h> header file. */
+#undef HAVE_SYS_LIMITS_H
+
+/* Define to 1 if you have the <sys/poll.h> header file. */
+#undef HAVE_SYS_POLL_H
+
+/* Define to 1 if you have the <sys/select.h> header file. */
+#undef HAVE_SYS_SELECT_H
+
+/* Define to 1 if you have the <sys/socket.h> header file. */
+#undef HAVE_SYS_SOCKET_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/time.h> header file. */
+#undef HAVE_SYS_TIME_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define if the timezone global is available */
+#undef HAVE_TIMEZONE
+
+/* Use trio printf replacement library */
+#undef HAVE_TRIO
+
+/* Define to 1 if you have the <trio.h> header file. */
+#undef HAVE_TRIO_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define to 1 if you have the `usleep' function. */
+#undef HAVE_USLEEP
+
+/* Define to 1 if you have the `vsnprintf' function. */
+#undef HAVE_VSNPRINTF
+
+/* Define if using expat which includes xmlparse.h */
+#undef HAVE_XMLPARSE_H
+
+/* Define to be the neon version string */
+#undef NEON_VERSION
+
+/* Define to enable debugging */
+#undef NE_DEBUGGING
+
+/* Define to be printf format string for long long */
+#undef NE_FMT_LONG_LONG
+
+/* Define to be printf format string for ne_off_t */
+#undef NE_FMT_NE_OFF_T
+
+/* Define to be printf format string for off64_t */
+#undef NE_FMT_OFF64_T
+
+/* Define to be printf format string for off_t */
+#undef NE_FMT_OFF_T
+
+/* Define to be printf format string for size_t */
+#undef NE_FMT_SIZE_T
+
+/* Define to be printf format string for ssize_t */
+#undef NE_FMT_SSIZE_T
+
+/* Define to be printf format string for time_t */
+#undef NE_FMT_TIME_T
+
+/* Define to be printf format string for XML_Size */
+#undef NE_FMT_XML_SIZE
+
+/* Defined if DAV is supported */
+#undef NE_HAVE_DAV
+
+/* Defined if IPV6 is supported */
+#undef NE_HAVE_IPV6
+
+/* Defined if LFS is supported */
+#undef NE_HAVE_LFS
+
+/* Defined if LIBPXY is supported */
+#undef NE_HAVE_LIBPXY
+
+/* Defined if SSL is supported */
+#undef NE_HAVE_SSL
+
+/* Defined if TS_SSL is supported */
+#undef NE_HAVE_TS_SSL
+
+/* Defined if ZLIB is supported */
+#undef NE_HAVE_ZLIB
+
+/* Define to be filename of an SSL CA root bundle */
+#undef NE_SSL_CA_BUNDLE
+
+/* Define if poll() should be used */
+#undef NE_USE_POLL
+
+/* Define to be neon library major version */
+#undef NE_VERSION_MAJOR
+
+/* Define to be neon library minor version */
+#undef NE_VERSION_MINOR
+
+/* Define to be neon library patch version */
+#undef NE_VERSION_PATCH
+
+/* 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
+
+/* The size of `int', as computed by sizeof. */
+#undef SIZEOF_INT
+
+/* The size of `long', as computed by sizeof. */
+#undef SIZEOF_LONG
+
+/* The size of `long long', as computed by sizeof. */
+#undef SIZEOF_LONG_LONG
+
+/* The size of `off64_t', as computed by sizeof. */
+#undef SIZEOF_OFF64_T
+
+/* The size of `off_t', as computed by sizeof. */
+#undef SIZEOF_OFF_T
+
+/* The size of `size_t', as computed by sizeof. */
+#undef SIZEOF_SIZE_T
+
+/* The size of `ssize_t', as computed by sizeof. */
+#undef SIZEOF_SSIZE_T
+
+/* The size of `time_t', as computed by sizeof. */
+#undef SIZEOF_TIME_T
+
+/* The size of `XML_Size', as computed by sizeof. */
+#undef SIZEOF_XML_SIZE
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Define to 1 if strerror_r returns char *. */
+#undef STRERROR_R_CHAR_P
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+#undef TIME_WITH_SYS_TIME
+
+/* Define if getaddrinfo supports AI_ADDRCONFIG */
+#undef USE_GAI_ADDRCONFIG
+
+/* Define if getaddrinfo() should be used */
+#undef USE_GETADDRINFO
+
+/* Enable extensions on AIX 3, Interix. */
+#ifndef _ALL_SOURCE
+# undef _ALL_SOURCE
+#endif
+/* Enable GNU extensions on systems that have them. */
+#ifndef _GNU_SOURCE
+# undef _GNU_SOURCE
+#endif
+/* Enable threading extensions on Solaris. */
+#ifndef _POSIX_PTHREAD_SEMANTICS
+# undef _POSIX_PTHREAD_SEMANTICS
+#endif
+/* Enable extensions on HP NonStop. */
+#ifndef _TANDEM_SOURCE
+# undef _TANDEM_SOURCE
+#endif
+/* Enable general extensions on Solaris. */
+#ifndef __EXTENSIONS__
+# undef __EXTENSIONS__
+#endif
+
+
+/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
+ significant byte first (like Motorola and SPARC, unlike Intel). */
+#if defined AC_APPLE_UNIVERSAL_BUILD
+# if defined __BIG_ENDIAN__
+# define WORDS_BIGENDIAN 1
+# endif
+#else
+# ifndef WORDS_BIGENDIAN
+# undef WORDS_BIGENDIAN
+# endif
+#endif
+
+/* Define to enable GNU extensions */
+#undef _GNU_SOURCE
+
+/* Define to 1 if on MINIX. */
+#undef _MINIX
+
+/* Define to 2 if the system does not provide POSIX.1 features except with
+ this defined. */
+#undef _POSIX_1_SOURCE
+
+/* Define to 1 if you need to in order for `stat' and other things to work. */
+#undef _POSIX_SOURCE
+
+/* Define to empty if `const' does not conform to ANSI C. */
+#undef const
+
+/* Define if in_addr_t is not available */
+#undef in_addr_t
+
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+ calls it, or to nothing if 'inline' is not supported under any name. */
+#ifndef __cplusplus
+#undef inline
+#endif
+
+/* Define to `long int' if <sys/types.h> does not define. */
+#undef off_t
+
+/* Define to `int' if <sys/types.h> does not define. */
+#undef pid_t
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+#undef size_t
+
+/* Define if socklen_t is not available */
+#undef socklen_t
+
+#if defined(HAVE_STPCPY) && defined(HAVE_DECL_STPCPY) && !HAVE_DECL_STPCPY && !defined(stpcpy)
+char *stpcpy(char *, const char *);
+#endif
diff --git a/configure b/configure
new file mode 100755
index 0000000..ca26119
--- /dev/null
+++ b/configure
@@ -0,0 +1,10495 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.66 for litmus 0.13.
+#
+# Report bugs to <litmus@lists.manyfish.co.uk>.
+#
+#
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
+# Foundation, Inc.
+#
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+#
+# Copyright (c) 2001-2009 Joe Orton and others
+# This configure script may be copied, distributed and modified under the
+# terms of the GNU General Public license; see COPYING for more details
+## -------------------- ##
+## 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.
+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
+
+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"
+ 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 :
+ # 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.
+ BASH_ENV=/dev/null
+ ENV=/dev/null
+ (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+ export CONFIG_SHELL
+ exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+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@gnu.org and
+$0: litmus@lists.manyfish.co.uk about your system,
+$0: including any error possibly output before this
+$0: message. Then install a modern shell, or manually run
+$0: the script under such a shell if you do 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_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; }
+
+ # 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 -p'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -p'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -p'
+ fi
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p='mkdir -p "$as_dir"'
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+ as_test_x='test -x'
+else
+ if ls -dL / >/dev/null 2>&1; then
+ as_ls_L_option=L
+ else
+ as_ls_L_option=
+ fi
+ as_test_x='
+ eval sh -c '\''
+ if test -d "$1"; then
+ test -d "$1/.";
+ else
+ case $1 in #(
+ -*)set "./$1";;
+ esac;
+ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
+ ???[sx]*):;;*)false;;esac;fi
+ '\'' sh
+ '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+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='litmus'
+PACKAGE_TARNAME='litmus'
+PACKAGE_VERSION='0.13'
+PACKAGE_STRING='litmus 0.13'
+PACKAGE_BUGREPORT='litmus@lists.manyfish.co.uk'
+PACKAGE_URL=''
+
+ac_unique_file="litmus.in"
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+# include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+# include <memory.h>
+# endif
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_subst_vars='LTLIBOBJS
+XML2_CONFIG
+NEON_LINK_FLAGS
+NEON_EXTRAOBJS
+NEONOBJS
+NEON_OBJEXT
+NEON_TARGET
+NE_FLAG_DAV
+NEON_BUILD_BUNDLED
+NEON_LTLIBS
+NEON_LIBS
+NEON_CFLAGS
+NE_FLAG_LIBPXY
+KRB5_CONFIG
+NEON_SUPPORTS_SSL
+GNUTLS_CONFIG
+PKG_CONFIG
+LIBOBJS
+NE_FLAG_TS_SSL
+NE_FLAG_LFS
+NE_FLAG_IPV6
+NE_FLAG_ZLIB
+NE_FLAG_SSL
+NEON_CONFIG
+RANLIB
+AR
+EGREP
+GREP
+CPP
+TESTS
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+SET_MAKE
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+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
+with_included_neon
+with_neon
+with_ssl
+with_egd
+with_pakchois
+with_ca_bundle
+enable_threadsafe_ssl
+with_gssapi
+with_libproxy
+with_libxml2
+with_expat
+with_included_expat
+enable_debug
+enable_warnings
+'
+ ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CPP'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+for ac_option
+do
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval $ac_prev=\$ac_option
+ ac_prev=
+ continue
+ fi
+
+ case $ac_option in
+ *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+ *) ac_optarg=yes ;;
+ esac
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case $ac_dashdash$ac_option in
+ --)
+ ac_dashdash=yes ;;
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir=$ac_optarg ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build_alias ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build_alias=$ac_optarg ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file=$ac_optarg ;;
+
+ --config-cache | -C)
+ cache_file=config.cache ;;
+
+ -datadir | --datadir | --datadi | --datad)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=*)
+ datadir=$ac_optarg ;;
+
+ -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+ | --dataroo | --dataro | --datar)
+ ac_prev=datarootdir ;;
+ -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+ datarootdir=$ac_optarg ;;
+
+ -disable-* | --disable-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_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
+ $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host.
+ If a cross compiler is detected then cross compile mode will be used" >&2
+ elif test "x$build_alias" != "x$host_alias"; then
+ cross_compiling=yes
+ fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+ as_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 litmus 0.13 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/litmus]
+ --htmldir=DIR html documentation [DOCDIR]
+ --dvidir=DIR dvi documentation [DOCDIR]
+ --pdfdir=DIR pdf documentation [DOCDIR]
+ --psdir=DIR ps documentation [DOCDIR]
+_ACEOF
+
+ cat <<\_ACEOF
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+ case $ac_init_help in
+ short | recursive ) echo "Configuration of litmus 0.13:";;
+ 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-threadsafe-ssl=posix
+ enable SSL library thread-safety using POSIX
+ threads: suitable CC/CFLAGS/LIBS must be used to
+ make the POSIX library interfaces available
+ --disable-debug disable runtime debugging messages
+ --enable-warnings enable compiler warnings
+
+Optional Packages:
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --with-included-neon force use of included neon library
+ --with-neon[=DIR] specify location of neon library
+ --with-ssl=openssl|gnutls
+ enable SSL support (default OpenSSL)
+ --with-egd[=PATH] enable EGD support [using EGD socket at PATH]
+ --without-pakchois disable support for PKCS#11 using pakchois
+ --with-ca-bundle specify filename of an SSL CA root bundle
+ --without-gssapi disable GSSAPI support
+ --without-libproxy disable libproxy support
+ --with-libxml2 force use of libxml 2.x
+ --with-expat force use of expat
+ --with-included-expat use bundled expat sources
+
+Some influential environment variables:
+ CC C compiler command
+ CFLAGS C compiler flags
+ LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
+ nonstandard directory <lib dir>
+ LIBS libraries to pass to the linker, e.g. -l<library>
+ CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
+ you have headers in a nonstandard directory <include dir>
+ CPP C preprocessor
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+Report bugs to <litmus@lists.manyfish.co.uk>.
+_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
+litmus configure 0.13
+generated by GNU Autoconf 2.66
+
+Copyright (C) 2010 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+
+Copyright (c) 2001-2009 Joe Orton and others
+This configure script may be copied, distributed and modified under the
+terms of the GNU General Public license; see COPYING for more details
+_ACEOF
+ exit
+fi
+
+## ------------------------ ##
+## Autoconf initialization. ##
+## ------------------------ ##
+
+# 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; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_compile
+
+# 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; } >/dev/null && {
+ 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; test "x$as_lineno_stack" = x && { as_lineno=; 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 "test \"\${$3+set}\"" = set; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval "test \"\${$3+set}\"" = set; 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.$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 litmus@lists.manyfish.co.uk ##
+## ------------------------------------------ ##"
+ ) | 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 "test \"\${$3+set}\"" = set; 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; test "x$as_lineno_stack" = x && { as_lineno=; 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; test "x$as_lineno_stack" = x && { as_lineno=; 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 "test \"\${$3+set}\"" = set; 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; test "x$as_lineno_stack" = x && { as_lineno=; 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 "test \"\${$3+set}\"" = set; 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; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+
+} # ac_fn_c_check_type
+
+# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES
+# --------------------------------------------
+# Tries to find the compile-time value of EXPR in a program that includes
+# INCLUDES, setting VAR accordingly. Returns whether the value could be
+# computed
+ac_fn_c_compute_int ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if test "$cross_compiling" = yes; then
+ # Depending upon the size, compute the lo and hi bounds.
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) >= 0)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_lo=0 ac_mid=0
+ while :; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) <= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_hi=$ac_mid; break
+else
+ as_fn_arith $ac_mid + 1 && ac_lo=$as_val
+ if test $ac_lo -le $ac_mid; then
+ ac_lo= ac_hi=
+ break
+ fi
+ as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) < 0)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_hi=-1 ac_mid=-1
+ while :; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) >= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_lo=$ac_mid; break
+else
+ as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val
+ if test $ac_mid -le $ac_hi; then
+ ac_lo= ac_hi=
+ break
+ fi
+ as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+else
+ ac_lo= ac_hi=
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+ as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+static int test_array [1 - 2 * !(($2) <= $ac_mid)];
+test_array [0] = 0
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_hi=$ac_mid
+else
+ as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in #((
+?*) eval "$3=\$ac_lo"; ac_retval=0 ;;
+'') ac_retval=1 ;;
+esac
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+static long int longval () { return $2; }
+static unsigned long int ulongval () { return $2; }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main ()
+{
+
+ FILE *f = fopen ("conftest.val", "w");
+ if (! f)
+ return 1;
+ if (($2) < 0)
+ {
+ long int i = longval ();
+ if (i != ($2))
+ return 1;
+ fprintf (f, "%ld", i);
+ }
+ else
+ {
+ unsigned long int i = ulongval ();
+ if (i != ($2))
+ return 1;
+ fprintf (f, "%lu", i);
+ }
+ /* Do not output a trailing newline, as this causes \r\n confusion
+ on some platforms. */
+ return ferror (f) || fclose (f) != 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ echo >>conftest.val; read $3 <conftest.val; ac_retval=0
+else
+ ac_retval=1
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f conftest.val
+
+ fi
+ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_compute_int
+
+# 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 ||
+ $as_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; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_link
+
+# 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 "test \"\${$3+set}\"" = set; 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; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+
+} # ac_fn_c_check_func
+
+# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES
+# ---------------------------------------------
+# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
+# accordingly.
+ac_fn_c_check_decl ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ as_decl_name=`echo $2|sed 's/ *(.*//'`
+ as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
+$as_echo_n "checking whether $as_decl_name is declared... " >&6; }
+if eval "test \"\${$3+set}\"" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+#ifndef $as_decl_name
+#ifdef __cplusplus
+ (void) $as_decl_use;
+#else
+ (void) $as_decl_name;
+#endif
+#endif
+
+ ;
+ return 0;
+}
+_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; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+
+} # ac_fn_c_check_decl
+
+# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES
+# ----------------------------------------------------
+# Tries to find if the field MEMBER exists in type AGGR, after including
+# INCLUDES, setting cache variable VAR accordingly.
+ac_fn_c_check_member ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5
+$as_echo_n "checking for $2.$3... " >&6; }
+if eval "test \"\${$4+set}\"" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$5
+int
+main ()
+{
+static $2 ac_aggr;
+if (ac_aggr.$3)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ eval "$4=yes"
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$5
+int
+main ()
+{
+static $2 ac_aggr;
+if (sizeof ac_aggr.$3)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ eval "$4=yes"
+else
+ eval "$4=no"
+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=\$$4
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+
+} # ac_fn_c_check_member
+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 litmus $as_me 0.13, which was
+generated by GNU Autoconf 2.66. 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
+
+
+
+
+
+
+
+
+ac_config_headers="$ac_config_headers config.h"
+
+
+
+$as_echo "#define _GNU_SOURCE 1" >>confdefs.h
+
+
+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 test "${ac_cv_prog_CC+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_CC="${ac_tool_prefix}gcc"
+ $as_echo "$as_me:${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 test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_CC="gcc"
+ $as_echo "$as_me:${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 test "${ac_cv_prog_CC+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_CC="${ac_tool_prefix}cc"
+ $as_echo "$as_me:${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 test "${ac_cv_prog_CC+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ $as_echo "$as_me:${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 test "${ac_cv_prog_CC+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${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 test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_ac_ct_CC="$ac_prog"
+ $as_echo "$as_me:${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
+
+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 test "${ac_cv_objext+set}" = set; 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 test "${ac_cv_c_compiler_gnu+set}" = set; 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 test "${ac_cv_prog_cc_g+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_save_c_werror_flag=$ac_c_werror_flag
+ ac_c_werror_flag=yes
+ ac_cv_prog_cc_g=no
+ CFLAGS="-g"
+ cat 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 test "${ac_cv_prog_cc_c89+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
+ function prototypes and stuff, but not '\xHH' hex character constants.
+ These don't provoke an error unfortunately, instead are silently treated
+ as 'x'. The following induces an error, until -std is added to get
+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
+ array size at least. It's necessary to write '\x00'==0 to get something
+ that's true only with -std. */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+ inside strings and character constants. */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ 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
+
+{ $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 "test \"\${ac_cv_prog_make_${ac_make}_set+set}\"" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+ @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+ *@@@%%%=?*=@@@%%%*)
+ eval ac_cv_prog_make_${ac_make}_set=yes;;
+ *)
+ eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+ { $as_echo "$as_me:${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
+
+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 test "${ac_cv_path_install+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in #((
+ ./ | .// | /[cC]/* | \
+ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
+ /usr/ucb/* ) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
+ if test $ac_prog = install &&
+ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ elif test $ac_prog = install &&
+ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # program-specific install script used by HP pwplus--don't use.
+ :
+ else
+ rm -rf conftest.one conftest.two conftest.dir
+ echo one > conftest.one
+ echo two > conftest.two
+ mkdir conftest.dir
+ if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+ test -s conftest.one && test -s conftest.two &&
+ test -s conftest.dir/conftest.one &&
+ test -s conftest.dir/conftest.two
+ then
+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ break 3
+ fi
+ fi
+ fi
+ done
+ done
+ ;;
+esac
+
+ done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
+
+fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL=$ac_cv_path_install
+ else
+ # As a last resort, use the slow shell script. Don't cache a
+ # value for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the value is a relative name.
+ INSTALL=$ac_install_sh
+ fi
+fi
+{ $as_echo "$as_me:${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'
+
+
+TESTS="basic copymove props locks http"
+
+
+
+
+
+
+
+
+
+
+# Turn off ACL support
+neon_no_acl=yes
+
+
+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 test "${ac_cv_prog_CPP+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ # Double quotes because CPP needs to be expanded
+ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat 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.$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.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+ break
+fi
+
+ done
+ ac_cv_prog_CPP=$CPP
+
+fi
+ CPP=$ac_cv_prog_CPP
+else
+ ac_cv_prog_CPP=$CPP
+fi
+{ $as_echo "$as_me:${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.$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.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
+else
+ { { $as_echo "$as_me:${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 test "${ac_cv_path_GREP+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$GREP"; then
+ ac_path_GREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in grep ggrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+ # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'GREP' >> "conftest.nl"
+ "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ 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 test "${ac_cv_path_EGREP+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+ then ac_cv_path_EGREP="$GREP -E"
+ else
+ if test -z "$EGREP"; then
+ ac_path_EGREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in egrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+ # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'EGREP' >> "conftest.nl"
+ "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ 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 test "${ac_cv_header_stdc+set}" = set; 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
+
+
+
+ ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default"
+if test "x$ac_cv_header_minix_config_h" = x""yes; then :
+ MINIX=yes
+else
+ MINIX=
+fi
+
+
+ if test "$MINIX" = yes; then
+
+$as_echo "#define _POSIX_SOURCE 1" >>confdefs.h
+
+
+$as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h
+
+
+$as_echo "#define _MINIX 1" >>confdefs.h
+
+ fi
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5
+$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; }
+if test "${ac_cv_safe_to_define___extensions__+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+# define __EXTENSIONS__ 1
+ $ac_includes_default
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_safe_to_define___extensions__=yes
+else
+ ac_cv_safe_to_define___extensions__=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5
+$as_echo "$ac_cv_safe_to_define___extensions__" >&6; }
+ test $ac_cv_safe_to_define___extensions__ = yes &&
+ $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h
+
+ $as_echo "#define _ALL_SOURCE 1" >>confdefs.h
+
+ $as_echo "#define _GNU_SOURCE 1" >>confdefs.h
+
+ $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h
+
+ $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
+$as_echo_n "checking for inline... " >&6; }
+if test "${ac_cv_c_inline+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_c_inline=no
+for ac_kw in inline __inline__ __inline; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifndef __cplusplus
+typedef int foo_t;
+static $ac_kw foo_t static_foo () {return 0; }
+$ac_kw foo_t foo () {return 0; }
+#endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_c_inline=$ac_kw
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ test "$ac_cv_c_inline" != no && break
+done
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
+$as_echo "$ac_cv_c_inline" >&6; }
+
+case $ac_cv_c_inline in
+ inline | yes) ;;
+ *)
+ case $ac_cv_c_inline in
+ no) ac_val=;;
+ *) ac_val=$ac_cv_c_inline;;
+ esac
+ cat >>confdefs.h <<_ACEOF
+#ifndef __cplusplus
+#define inline $ac_val
+#endif
+_ACEOF
+ ;;
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
+$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
+if test "${ac_cv_c_const+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+/* FIXME: Include the comments suggested by Paul. */
+#ifndef __cplusplus
+ /* Ultrix mips cc rejects this. */
+ typedef int charset[2];
+ const charset cs;
+ /* SunOS 4.1.1 cc rejects this. */
+ char const *const *pcpcc;
+ char **ppc;
+ /* NEC SVR4.0.2 mips cc rejects this. */
+ struct point {int x, y;};
+ static struct point const zero = {0,0};
+ /* AIX XL C 1.02.0.0 rejects this.
+ It does not let you subtract one const X* pointer from another in
+ an arm of an if-expression whose if-part is not a constant
+ expression */
+ const char *g = "string";
+ pcpcc = &g + (g ? g-g : 0);
+ /* HPUX 7.0 cc rejects these. */
+ ++pcpcc;
+ ppc = (char**) pcpcc;
+ pcpcc = (char const *const *) ppc;
+ { /* SCO 3.2v4 cc rejects this. */
+ char *t;
+ char const *s = 0 ? (char *) 0 : (char const *) 0;
+
+ *t++ = 0;
+ if (s) return 0;
+ }
+ { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
+ int x[] = {25, 17};
+ const int *foo = &x[0];
+ ++foo;
+ }
+ { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
+ typedef const int *iptr;
+ iptr p = 0;
+ ++p;
+ }
+ { /* AIX XL C 1.02.0.0 rejects this saying
+ "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
+ struct s { int j; const int *ap[3]; };
+ struct s *b; b->j = 5;
+ }
+ { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
+ const int foo = 10;
+ if (!foo) return 0;
+ }
+ return !cs[0] && !zero.x;
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_c_const=yes
+else
+ ac_cv_c_const=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5
+$as_echo "$ac_cv_c_const" >&6; }
+if test $ac_cv_c_const = no; then
+
+$as_echo "#define const /**/" >>confdefs.h
+
+fi
+
+ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
+if test "x$ac_cv_type_size_t" = x""yes; then :
+
+else
+
+cat >>confdefs.h <<_ACEOF
+#define size_t unsigned int
+_ACEOF
+
+fi
+
+ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default"
+if test "x$ac_cv_type_off_t" = x""yes; then :
+
+else
+
+cat >>confdefs.h <<_ACEOF
+#define off_t long int
+_ACEOF
+
+fi
+
+
+# Check for Darwin, which needs extra cpp and linker flags.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uname" >&5
+$as_echo_n "checking for uname... " >&6; }
+if test "${ne_cv_os_uname+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ ne_cv_os_uname=`uname -s 2>/dev/null`
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ne_cv_os_uname" >&5
+$as_echo "$ne_cv_os_uname" >&6; }
+
+if test "$ne_cv_os_uname" = "Darwin"; then
+ CPPFLAGS="$CPPFLAGS -no-cpp-precomp"
+ LDFLAGS="$LDFLAGS -flat_namespace"
+ # poll has various issues in various Darwin releases
+ if test x${ac_cv_func_poll+set} != xset; then
+ ac_cv_func_poll=no
+ fi
+fi
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5
+$as_echo_n "checking size of int... " >&6; }
+if test "${ac_cv_sizeof_int+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_int" = yes; then
+ { { $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 "cannot compute sizeof (int)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_int=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5
+$as_echo "$ac_cv_sizeof_int" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_INT $ac_cv_sizeof_int
+_ACEOF
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5
+$as_echo_n "checking size of long... " >&6; }
+if test "${ac_cv_sizeof_long+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_long" = yes; then
+ { { $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 "cannot compute sizeof (long)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_long=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5
+$as_echo "$ac_cv_sizeof_long" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_LONG $ac_cv_sizeof_long
+_ACEOF
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long" >&5
+$as_echo_n "checking size of long long... " >&6; }
+if test "${ac_cv_sizeof_long_long+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long))" "ac_cv_sizeof_long_long" "$ac_includes_default"; then :
+
+else
+ if test "$ac_cv_type_long_long" = yes; then
+ { { $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 "cannot compute sizeof (long long)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_long_long=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long" >&5
+$as_echo "$ac_cv_sizeof_long_long" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long
+_ACEOF
+
+
+if test "$GCC" = "yes"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcc -Wformat -Werror sanity" >&5
+$as_echo_n "checking for gcc -Wformat -Werror sanity... " >&6; }
+if test "${ne_cv_cc_werror+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ # See whether a simple test program will compile without errors.
+ ne_save_CPPFLAGS=$CPPFLAGS
+ CPPFLAGS="$CPPFLAGS -Wformat -Werror"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <stdio.h>
+int
+main ()
+{
+int i = 42; printf("%d", i);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ne_cv_cc_werror=yes
+else
+ ne_cv_cc_werror=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ CPPFLAGS=$ne_save_CPPFLAGS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ne_cv_cc_werror" >&5
+$as_echo "$ne_cv_cc_werror" >&6; }
+ ne_fmt_trycompile=$ne_cv_cc_werror
+else
+ ne_fmt_trycompile=no
+fi
+
+
+
+# These checks are done whether or not the bundled neon build
+# is used.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+for ac_header in errno.h stdarg.h string.h stdlib.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
+
+
+
+
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of size_t" >&5
+$as_echo_n "checking size of size_t... " >&6; }
+if test "${ac_cv_sizeof_size_t+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (size_t))" "ac_cv_sizeof_size_t" "$ac_includes_default
+
+"; then :
+
+else
+ if test "$ac_cv_type_size_t" = yes; then
+ { { $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 "cannot compute sizeof (size_t)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_size_t=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_size_t" >&5
+$as_echo "$ac_cv_sizeof_size_t" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_SIZE_T $ac_cv_sizeof_size_t
+_ACEOF
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print size_t" >&5
+$as_echo_n "checking how to print size_t... " >&6; }
+if test "${ne_cv_fmt_size_t+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ne_cv_fmt_size_t=none
+if test $ne_fmt_trycompile = yes; then
+ oflags="$CPPFLAGS"
+ # Consider format string mismatches as errors
+ CPPFLAGS="$CPPFLAGS -Wformat -Werror"
+ for str in u lu llu; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+
+#include <stdio.h>
+int
+main ()
+{
+size_t i = 1; printf("%$str", i);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ne_cv_fmt_size_t=$str; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+ CPPFLAGS=$oflags
+else
+ # Best guess. Don't have to be too precise since we probably won't
+ # get a warning message anyway.
+ case $ac_cv_sizeof_size_t in
+ $ac_cv_sizeof_int) ne_cv_fmt_size_t="u" ;;
+ $ac_cv_sizeof_long) ne_cv_fmt_size_t="lu" ;;
+ $ac_cv_sizeof_long_long) ne_cv_fmt_size_t="llu" ;;
+ esac
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ne_cv_fmt_size_t" >&5
+$as_echo "$ne_cv_fmt_size_t" >&6; }
+
+if test "x$ne_cv_fmt_size_t" = "xnone"; then
+ as_fn_error $? "format string for size_t not found" "$LINENO" 5
+fi
+
+
+cat >>confdefs.h <<_ACEOF
+#define NE_FMT_SIZE_T "$ne_cv_fmt_size_t"
+_ACEOF
+
+
+
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of off_t" >&5
+$as_echo_n "checking size of off_t... " >&6; }
+if test "${ac_cv_sizeof_off_t+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (off_t))" "ac_cv_sizeof_off_t" "$ac_includes_default
+
+"; then :
+
+else
+ if test "$ac_cv_type_off_t" = yes; then
+ { { $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 "cannot compute sizeof (off_t)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_off_t=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_off_t" >&5
+$as_echo "$ac_cv_sizeof_off_t" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_OFF_T $ac_cv_sizeof_off_t
+_ACEOF
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print off_t" >&5
+$as_echo_n "checking how to print off_t... " >&6; }
+if test "${ne_cv_fmt_off_t+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ne_cv_fmt_off_t=none
+if test $ne_fmt_trycompile = yes; then
+ oflags="$CPPFLAGS"
+ # Consider format string mismatches as errors
+ CPPFLAGS="$CPPFLAGS -Wformat -Werror"
+ for str in d ld lld; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+
+#include <stdio.h>
+int
+main ()
+{
+off_t i = 1; printf("%$str", i);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ne_cv_fmt_off_t=$str; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+ CPPFLAGS=$oflags
+else
+ # Best guess. Don't have to be too precise since we probably won't
+ # get a warning message anyway.
+ case $ac_cv_sizeof_off_t in
+ $ac_cv_sizeof_int) ne_cv_fmt_off_t="d" ;;
+ $ac_cv_sizeof_long) ne_cv_fmt_off_t="ld" ;;
+ $ac_cv_sizeof_long_long) ne_cv_fmt_off_t="lld" ;;
+ esac
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ne_cv_fmt_off_t" >&5
+$as_echo "$ne_cv_fmt_off_t" >&6; }
+
+if test "x$ne_cv_fmt_off_t" = "xnone"; then
+ as_fn_error $? "format string for off_t not found" "$LINENO" 5
+fi
+
+
+cat >>confdefs.h <<_ACEOF
+#define NE_FMT_OFF_T "$ne_cv_fmt_off_t"
+_ACEOF
+
+
+
+
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of ssize_t" >&5
+$as_echo_n "checking size of ssize_t... " >&6; }
+if test "${ac_cv_sizeof_ssize_t+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (ssize_t))" "ac_cv_sizeof_ssize_t" "$ac_includes_default
+
+"; then :
+
+else
+ if test "$ac_cv_type_ssize_t" = yes; then
+ { { $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 "cannot compute sizeof (ssize_t)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_ssize_t=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_ssize_t" >&5
+$as_echo "$ac_cv_sizeof_ssize_t" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_SSIZE_T $ac_cv_sizeof_ssize_t
+_ACEOF
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print ssize_t" >&5
+$as_echo_n "checking how to print ssize_t... " >&6; }
+if test "${ne_cv_fmt_ssize_t+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ne_cv_fmt_ssize_t=none
+if test $ne_fmt_trycompile = yes; then
+ oflags="$CPPFLAGS"
+ # Consider format string mismatches as errors
+ CPPFLAGS="$CPPFLAGS -Wformat -Werror"
+ for str in d ld lld; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+
+#include <stdio.h>
+int
+main ()
+{
+ssize_t i = 1; printf("%$str", i);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ne_cv_fmt_ssize_t=$str; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+ CPPFLAGS=$oflags
+else
+ # Best guess. Don't have to be too precise since we probably won't
+ # get a warning message anyway.
+ case $ac_cv_sizeof_ssize_t in
+ $ac_cv_sizeof_int) ne_cv_fmt_ssize_t="d" ;;
+ $ac_cv_sizeof_long) ne_cv_fmt_ssize_t="ld" ;;
+ $ac_cv_sizeof_long_long) ne_cv_fmt_ssize_t="lld" ;;
+ esac
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ne_cv_fmt_ssize_t" >&5
+$as_echo "$ne_cv_fmt_ssize_t" >&6; }
+
+if test "x$ne_cv_fmt_ssize_t" = "xnone"; then
+ as_fn_error $? "format string for ssize_t not found" "$LINENO" 5
+fi
+
+
+cat >>confdefs.h <<_ACEOF
+#define NE_FMT_SSIZE_T "$ne_cv_fmt_ssize_t"
+_ACEOF
+
+
+
+
+
+
+
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of time_t" >&5
+$as_echo_n "checking size of time_t... " >&6; }
+if test "${ac_cv_sizeof_time_t+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (time_t))" "ac_cv_sizeof_time_t" "$ac_includes_default
+
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+"; then :
+
+else
+ if test "$ac_cv_type_time_t" = yes; then
+ { { $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 "cannot compute sizeof (time_t)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_time_t=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_time_t" >&5
+$as_echo "$ac_cv_sizeof_time_t" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_TIME_T $ac_cv_sizeof_time_t
+_ACEOF
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print time_t" >&5
+$as_echo_n "checking how to print time_t... " >&6; }
+if test "${ne_cv_fmt_time_t+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ne_cv_fmt_time_t=none
+if test $ne_fmt_trycompile = yes; then
+ oflags="$CPPFLAGS"
+ # Consider format string mismatches as errors
+ CPPFLAGS="$CPPFLAGS -Wformat -Werror"
+ for str in d ld lld; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#include <stdio.h>
+int
+main ()
+{
+time_t i = 1; printf("%$str", i);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ne_cv_fmt_time_t=$str; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+ CPPFLAGS=$oflags
+else
+ # Best guess. Don't have to be too precise since we probably won't
+ # get a warning message anyway.
+ case $ac_cv_sizeof_time_t in
+ $ac_cv_sizeof_int) ne_cv_fmt_time_t="d" ;;
+ $ac_cv_sizeof_long) ne_cv_fmt_time_t="ld" ;;
+ $ac_cv_sizeof_long_long) ne_cv_fmt_time_t="lld" ;;
+ esac
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ne_cv_fmt_time_t" >&5
+$as_echo "$ne_cv_fmt_time_t" >&6; }
+
+if test "x$ne_cv_fmt_time_t" = "xnone"; then
+ as_fn_error $? "format string for time_t not found" "$LINENO" 5
+fi
+
+
+cat >>confdefs.h <<_ACEOF
+#define NE_FMT_TIME_T "$ne_cv_fmt_time_t"
+_ACEOF
+
+
+
+ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default"
+if test "x$ac_cv_type_pid_t" = x""yes; then :
+
+else
+
+cat >>confdefs.h <<_ACEOF
+#define pid_t int
+_ACEOF
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5
+$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; }
+if test "${ac_cv_header_time+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <sys/time.h>
+#include <time.h>
+
+int
+main ()
+{
+if ((struct tm *) 0)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_header_time=yes
+else
+ ac_cv_header_time=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5
+$as_echo "$ac_cv_header_time" >&6; }
+if test $ac_cv_header_time = yes; then
+
+$as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h
+
+fi
+
+
+
+# Search in /usr/ccs/bin for Solaris
+ne_PATH=$PATH:/usr/ccs/bin
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ar; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_AR+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $AR in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_AR="$AR" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $ne_PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_AR="$as_dir/$ac_word$ac_exec_ext"
+ $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
+
+ ;;
+esac
+fi
+AR=$ac_cv_path_AR
+if test -n "$AR"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
+$as_echo "$AR" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_AR"; then
+ ac_pt_AR=$AR
+ # Extract the first word of "ar", so it can be a program name with args.
+set dummy ar; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_ac_pt_AR+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $ac_pt_AR in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_ac_pt_AR="$ac_pt_AR" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $ne_PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_ac_pt_AR="$as_dir/$ac_word$ac_exec_ext"
+ $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
+
+ ;;
+esac
+fi
+ac_pt_AR=$ac_cv_path_ac_pt_AR
+if test -n "$ac_pt_AR"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_AR" >&5
+$as_echo "$ac_pt_AR" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_pt_AR" = x; then
+ AR="notfound"
+ 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
+ AR=$ac_pt_AR
+ fi
+else
+ AR="$ac_cv_path_AR"
+fi
+
+if test "x$AR" = "xnotfound"; then
+ as_fn_error $? "could not find ar tool" "$LINENO" 5
+fi
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_RANLIB+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $RANLIB in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_RANLIB="$RANLIB" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $ne_PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_RANLIB="$as_dir/$ac_word$ac_exec_ext"
+ $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
+
+ ;;
+esac
+fi
+RANLIB=$ac_cv_path_RANLIB
+if test -n "$RANLIB"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
+$as_echo "$RANLIB" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_RANLIB"; then
+ ac_pt_RANLIB=$RANLIB
+ # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_ac_pt_RANLIB+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $ac_pt_RANLIB in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_ac_pt_RANLIB="$ac_pt_RANLIB" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $ne_PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_ac_pt_RANLIB="$as_dir/$ac_word$ac_exec_ext"
+ $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
+
+ ;;
+esac
+fi
+ac_pt_RANLIB=$ac_cv_path_ac_pt_RANLIB
+if test -n "$ac_pt_RANLIB"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_RANLIB" >&5
+$as_echo "$ac_pt_RANLIB" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_pt_RANLIB" = x; then
+ RANLIB=":"
+ 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
+ RANLIB=$ac_pt_RANLIB
+ fi
+else
+ RANLIB="$ac_cv_path_RANLIB"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+for ac_header in sys/time.h stdint.h locale.h signal.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
+
+
+for ac_func in pipe isatty usleep shutdown setlocale gethostname
+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
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
+$as_echo_n "checking whether byte ordering is bigendian... " >&6; }
+if test "${ac_cv_c_bigendian+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_c_bigendian=unknown
+ # See if we're dealing with a universal compiler.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifndef __APPLE_CC__
+ not a universal capable compiler
+ #endif
+ typedef int dummy;
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+ # Check for potential -arch flags. It is not universal unless
+ # there are at least two -arch flags with different values.
+ ac_arch=
+ ac_prev=
+ for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
+ if test -n "$ac_prev"; then
+ case $ac_word in
+ i?86 | x86_64 | ppc | ppc64)
+ if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
+ ac_arch=$ac_word
+ else
+ ac_cv_c_bigendian=universal
+ break
+ fi
+ ;;
+ esac
+ ac_prev=
+ elif test "x$ac_word" = "x-arch"; then
+ ac_prev=arch
+ fi
+ done
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ if test $ac_cv_c_bigendian = unknown; then
+ # See if sys/param.h defines the BYTE_ORDER macro.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+ #include <sys/param.h>
+
+int
+main ()
+{
+#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
+ && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
+ && LITTLE_ENDIAN)
+ bogus endian macros
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ # It does; now see whether it defined to BIG_ENDIAN or not.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+ #include <sys/param.h>
+
+int
+main ()
+{
+#if BYTE_ORDER != BIG_ENDIAN
+ not big endian
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_c_bigendian=yes
+else
+ ac_cv_c_bigendian=no
+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
+ if test $ac_cv_c_bigendian = unknown; then
+ # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <limits.h>
+
+int
+main ()
+{
+#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
+ bogus endian macros
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ # It does; now see whether it defined to _BIG_ENDIAN or not.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <limits.h>
+
+int
+main ()
+{
+#ifndef _BIG_ENDIAN
+ not big endian
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_c_bigendian=yes
+else
+ ac_cv_c_bigendian=no
+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
+ if test $ac_cv_c_bigendian = unknown; then
+ # Compile a test program.
+ if test "$cross_compiling" = yes; then :
+ # Try to guess by grepping values from an object file.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+short int ascii_mm[] =
+ { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
+ short int ascii_ii[] =
+ { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
+ int use_ascii (int i) {
+ return ascii_mm[i] + ascii_ii[i];
+ }
+ short int ebcdic_ii[] =
+ { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
+ short int ebcdic_mm[] =
+ { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
+ int use_ebcdic (int i) {
+ return ebcdic_mm[i] + ebcdic_ii[i];
+ }
+ extern int foo;
+
+int
+main ()
+{
+return use_ascii (foo) == use_ebcdic (foo);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
+ ac_cv_c_bigendian=yes
+ fi
+ if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
+ if test "$ac_cv_c_bigendian" = unknown; then
+ ac_cv_c_bigendian=no
+ else
+ # finding both strings is unlikely to happen, but who knows?
+ ac_cv_c_bigendian=unknown
+ fi
+ fi
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+
+ /* Are we little or big endian? From Harbison&Steele. */
+ union
+ {
+ long int l;
+ char c[sizeof (long int)];
+ } u;
+ u.l = 1;
+ return u.c[sizeof (long int) - 1] == 1;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ac_cv_c_bigendian=no
+else
+ ac_cv_c_bigendian=yes
+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_c_bigendian" >&5
+$as_echo "$ac_cv_c_bigendian" >&6; }
+ case $ac_cv_c_bigendian in #(
+ yes)
+ $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h
+;; #(
+ no)
+ ;; #(
+ universal)
+
+$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
+
+ ;; #(
+ *)
+ as_fn_error $? "unknown endianness
+ presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
+ esac
+
+ac_fn_c_check_decl "$LINENO" "strerror_r" "ac_cv_have_decl_strerror_r" "$ac_includes_default"
+if test "x$ac_cv_have_decl_strerror_r" = x""yes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_STRERROR_R $ac_have_decl
+_ACEOF
+
+for ac_func in strerror_r
+do :
+ ac_fn_c_check_func "$LINENO" "strerror_r" "ac_cv_func_strerror_r"
+if test "x$ac_cv_func_strerror_r" = x""yes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_STRERROR_R 1
+_ACEOF
+
+fi
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror_r returns char *" >&5
+$as_echo_n "checking whether strerror_r returns char *... " >&6; }
+if test "${ac_cv_func_strerror_r_char_p+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ ac_cv_func_strerror_r_char_p=no
+ if test $ac_cv_have_decl_strerror_r = yes; then
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+
+ char buf[100];
+ char x = *strerror_r (0, buf, sizeof buf);
+ char *p = strerror_r (0, buf, sizeof buf);
+ return !p || x;
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_func_strerror_r_char_p=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ else
+ # strerror_r is not declared. Choose between
+ # systems that have relatively inaccessible declarations for the
+ # function. BeOS and DEC UNIX 4.0 fall in this category, but the
+ # former has a strerror_r that returns char*, while the latter
+ # has a strerror_r that returns `int'.
+ # This test should segfault on the DEC system.
+ if test "$cross_compiling" = yes; then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+ extern char *strerror_r ();
+int
+main ()
+{
+char buf[100];
+ char x = *strerror_r (0, buf, sizeof buf);
+ return ! isalpha (x);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ac_cv_func_strerror_r_char_p=yes
+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_func_strerror_r_char_p" >&5
+$as_echo "$ac_cv_func_strerror_r_char_p" >&6; }
+if test $ac_cv_func_strerror_r_char_p = yes; then
+
+$as_echo "#define STRERROR_R_CHAR_P 1" >>confdefs.h
+
+fi
+
+
+for ac_func in snprintf vsnprintf
+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
+
+else
+
+ ne_save_LIBS=$LIBS
+ LIBS="$LIBS -lm" # Always need -lm
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for trio_vsnprintf in -ltrio" >&5
+$as_echo_n "checking for trio_vsnprintf in -ltrio... " >&6; }
+if test "${ac_cv_lib_trio_trio_vsnprintf+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ltrio $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 trio_vsnprintf ();
+int
+main ()
+{
+return trio_vsnprintf ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_trio_trio_vsnprintf=yes
+else
+ ac_cv_lib_trio_trio_vsnprintf=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_trio_trio_vsnprintf" >&5
+$as_echo "$ac_cv_lib_trio_trio_vsnprintf" >&6; }
+if test "x$ac_cv_lib_trio_trio_vsnprintf" = x""yes; then :
+ for ac_header in trio.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "trio.h" "ac_cv_header_trio_h" "$ac_includes_default"
+if test "x$ac_cv_header_trio_h" = x""yes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_TRIO_H 1
+_ACEOF
+
+else
+ as_fn_error $? "trio installation problem? libtrio found but not trio.h" "$LINENO" 5
+fi
+
+done
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: using trio printf replacement library" >&5
+$as_echo "$as_me: using trio printf replacement library" >&6;}
+ NEON_LIBS="$NEON_LIBS -ltrio -lm"
+
+$as_echo "#define HAVE_TRIO 1" >>confdefs.h
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: no vsnprintf/snprintf detected in C library" >&5
+$as_echo "$as_me: no vsnprintf/snprintf detected in C library" >&6;}
+ as_fn_error $? "Install the trio library from http://daniel.haxx.se/projects/trio/" "$LINENO" 5
+fi
+
+ LIBS=$ne_save_LIBS
+ break
+
+fi
+done
+
+
+
+neon_bundled_srcdir='$(top_srcdir)/lib/neon'
+neon_bundled_builddir=lib/neon
+
+
+
+
+
+# Check whether --with-included-neon was given.
+if test "${with_included_neon+set}" = set; then :
+ withval=$with_included_neon; neon_force_included="$withval"
+else
+ neon_force_included="no"
+fi
+
+
+
+
+
+
+
+# Check whether --with-neon was given.
+if test "${with_neon+set}" = set; then :
+ withval=$with_neon; case $withval in
+yes|no) neon_force_external=$withval; neon_ext_path= ;;
+*) neon_force_external=yes; neon_ext_path=$withval ;;
+esac;
+else
+
+neon_force_external=no
+neon_ext_path=
+
+fi
+
+
+if test "$neon_force_included" = "no"; then
+ # There is no included neon source directory, or --with-included-neon
+ # wasn't given (so we're not forced to use it).
+
+ # Default to no external neon.
+ neon_got_library=no
+ if test "x$neon_ext_path" = "x"; then
+ # Extract the first word of "neon-config", so it can be a program name with args.
+set dummy neon-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_NEON_CONFIG+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $NEON_CONFIG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_NEON_CONFIG="$NEON_CONFIG" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_NEON_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+ $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
+
+ test -z "$ac_cv_path_NEON_CONFIG" && ac_cv_path_NEON_CONFIG="none"
+ ;;
+esac
+fi
+NEON_CONFIG=$ac_cv_path_NEON_CONFIG
+if test -n "$NEON_CONFIG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NEON_CONFIG" >&5
+$as_echo "$NEON_CONFIG" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ if test "x${NEON_CONFIG}" = "xnone"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: no external neon library found" >&5
+$as_echo "$as_me: no external neon library found" >&6;}
+ elif test -x "${NEON_CONFIG}"; then
+
+# Configure to use an external neon, given a neon-config script
+# found at $NEON_CONFIG.
+neon_prefix=`$NEON_CONFIG --prefix`
+
+
+ # Check whether the library is of required version
+ ne_save_LIBS="$LIBS"
+ ne_save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS `$NEON_CONFIG --cflags`"
+ LIBS="$LIBS `$NEON_CONFIG --libs`"
+ ne_libver=`$NEON_CONFIG --version | sed -e "s/neon //g"`
+ # Check whether it's possible to link against neon
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking linking against neon" >&5
+$as_echo_n "checking linking against neon... " >&6; }
+if test "${ne_cv_lib_neon+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ne_utils.h>
+int
+main ()
+{
+ne_version_match(0, 0);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ne_cv_lib_neon=yes
+else
+ ne_cv_lib_neon=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ne_cv_lib_neon" >&5
+$as_echo "$ne_cv_lib_neon" >&6; }
+ if test "$ne_cv_lib_neon" = "yes"; then
+ ne_cv_lib_neonver=no
+ for v in 25 26 27 28 29; do
+ case $ne_libver in
+ 0.$v.*) ne_cv_lib_neonver=yes ;;
+ esac
+ done
+ fi
+ ne_goodver=$ne_cv_lib_neonver
+ LIBS=$ne_save_LIBS
+ CFLAGS=$ne_save_CFLAGS
+
+
+if test "$ne_goodver" = "yes"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: using neon library $ne_libver" >&5
+$as_echo "$as_me: using neon library $ne_libver" >&6;}
+
+ # Pick up CFLAGS and LIBS needed
+ CFLAGS="$CFLAGS `$NEON_CONFIG --cflags`"
+ NEON_LIBS="$NEON_LIBS `$NEON_CONFIG --libs`"
+ # Pick up library version
+ set dummy `$NEON_CONFIG --version | sed 's/\./ /g'`
+ NE_VERSION_MAJOR=$3; NE_VERSION_MINOR=$4; NE_VERSION_PATCH=$5
+
+
+NEON_VERSION="${NE_VERSION_MAJOR}.${NE_VERSION_MINOR}.${NE_VERSION_PATCH}${NE_VERSION_TAG}"
+
+
+cat >>confdefs.h <<_ACEOF
+#define NEON_VERSION "${NEON_VERSION}"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define NE_VERSION_MAJOR (${NE_VERSION_MAJOR})
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define NE_VERSION_MINOR (${NE_VERSION_MINOR})
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define NE_VERSION_PATCH (${NE_VERSION_PATCH})
+_ACEOF
+
+
+ neon_library_message="library in ${neon_prefix} (${NEON_VERSION})"
+ neon_xml_parser_message="using whatever neon uses"
+
+if $NEON_CONFIG --support ssl >/dev/null; then
+
+NE_FLAG_SSL=yes
+
+
+$as_echo "#define NE_HAVE_SSL 1" >>confdefs.h
+
+ne_SSL_message="SSL is supported by neon"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: SSL is supported by neon" >&5
+$as_echo "$as_me: SSL is supported by neon" >&6;}
+
+else
+
+NE_FLAG_SSL=no
+
+ne_SSL_message="SSL is not supported by neon"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: SSL is not supported by neon" >&5
+$as_echo "$as_me: SSL is not supported by neon" >&6;}
+
+fi
+
+
+if $NEON_CONFIG --support zlib >/dev/null; then
+
+NE_FLAG_ZLIB=yes
+
+
+$as_echo "#define NE_HAVE_ZLIB 1" >>confdefs.h
+
+ne_ZLIB_message="zlib is supported by neon"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: zlib is supported by neon" >&5
+$as_echo "$as_me: zlib is supported by neon" >&6;}
+
+else
+
+NE_FLAG_ZLIB=no
+
+ne_ZLIB_message="zlib is not supported by neon"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: zlib is not supported by neon" >&5
+$as_echo "$as_me: zlib is not supported by neon" >&6;}
+
+fi
+
+
+if $NEON_CONFIG --support ipv6 >/dev/null; then
+
+NE_FLAG_IPV6=yes
+
+
+$as_echo "#define NE_HAVE_IPV6 1" >>confdefs.h
+
+ne_IPV6_message="IPv6 is supported by neon"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: IPv6 is supported by neon" >&5
+$as_echo "$as_me: IPv6 is supported by neon" >&6;}
+
+else
+
+NE_FLAG_IPV6=no
+
+ne_IPV6_message="IPv6 is not supported by neon"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: IPv6 is not supported by neon" >&5
+$as_echo "$as_me: IPv6 is not supported by neon" >&6;}
+
+fi
+
+
+if $NEON_CONFIG --support lfs >/dev/null; then
+
+NE_FLAG_LFS=yes
+
+
+$as_echo "#define NE_HAVE_LFS 1" >>confdefs.h
+
+ne_LFS_message="LFS is supported by neon"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: LFS is supported by neon" >&5
+$as_echo "$as_me: LFS is supported by neon" >&6;}
+
+else
+
+NE_FLAG_LFS=no
+
+ne_LFS_message="LFS is not supported by neon"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: LFS is not supported by neon" >&5
+$as_echo "$as_me: LFS is not supported by neon" >&6;}
+
+fi
+
+
+if $NEON_CONFIG --support ts_ssl >/dev/null; then
+
+NE_FLAG_TS_SSL=yes
+
+
+$as_echo "#define NE_HAVE_TS_SSL 1" >>confdefs.h
+
+ne_TS_SSL_message="thread-safe SSL is supported by neon"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: thread-safe SSL is supported by neon" >&5
+$as_echo "$as_me: thread-safe SSL is supported by neon" >&6;}
+
+else
+
+NE_FLAG_TS_SSL=no
+
+ne_TS_SSL_message="thread-safe SSL is not supported by neon"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: thread-safe SSL is not supported by neon" >&5
+$as_echo "$as_me: thread-safe SSL is not supported by neon" >&6;}
+
+fi
+
+ neon_got_library=yes
+ if test $NE_FLAG_LFS = yes; then
+
+
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of off64_t" >&5
+$as_echo_n "checking size of off64_t... " >&6; }
+if test "${ac_cv_sizeof_off64_t+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (off64_t))" "ac_cv_sizeof_off64_t" "$ac_includes_default
+
+"; then :
+
+else
+ if test "$ac_cv_type_off64_t" = yes; then
+ { { $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 "cannot compute sizeof (off64_t)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_off64_t=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_off64_t" >&5
+$as_echo "$ac_cv_sizeof_off64_t" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_OFF64_T $ac_cv_sizeof_off64_t
+_ACEOF
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print off64_t" >&5
+$as_echo_n "checking how to print off64_t... " >&6; }
+if test "${ne_cv_fmt_off64_t+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ne_cv_fmt_off64_t=none
+if test $ne_fmt_trycompile = yes; then
+ oflags="$CPPFLAGS"
+ # Consider format string mismatches as errors
+ CPPFLAGS="$CPPFLAGS -Wformat -Werror"
+ for str in d ld lld; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+
+#include <stdio.h>
+int
+main ()
+{
+off64_t i = 1; printf("%$str", i);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ne_cv_fmt_off64_t=$str; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+ CPPFLAGS=$oflags
+else
+ # Best guess. Don't have to be too precise since we probably won't
+ # get a warning message anyway.
+ case $ac_cv_sizeof_off64_t in
+ $ac_cv_sizeof_int) ne_cv_fmt_off64_t="d" ;;
+ $ac_cv_sizeof_long) ne_cv_fmt_off64_t="ld" ;;
+ $ac_cv_sizeof_long_long) ne_cv_fmt_off64_t="lld" ;;
+ esac
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ne_cv_fmt_off64_t" >&5
+$as_echo "$ne_cv_fmt_off64_t" >&6; }
+
+if test "x$ne_cv_fmt_off64_t" = "xnone"; then
+ as_fn_error $? "format string for off64_t not found" "$LINENO" 5
+fi
+
+
+cat >>confdefs.h <<_ACEOF
+#define NE_FMT_OFF64_T "$ne_cv_fmt_off64_t"
+_ACEOF
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define NE_FMT_NE_OFF_T NE_FMT_OFF64_T
+_ACEOF
+
+ else
+ cat >>confdefs.h <<_ACEOF
+#define NE_FMT_NE_OFF_T NE_FMT_OFF_T
+_ACEOF
+
+ fi
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: incompatible neon library version $ne_libver: wanted 0.25 26 27 28 29" >&5
+$as_echo "$as_me: incompatible neon library version $ne_libver: wanted 0.25 26 27 28 29" >&6;}
+ neon_got_library=no
+fi
+
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: ignoring non-executable ${NEON_CONFIG}" >&5
+$as_echo "$as_me: ignoring non-executable ${NEON_CONFIG}" >&6;}
+ fi
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for neon library in $neon_ext_path" >&5
+$as_echo_n "checking for neon library in $neon_ext_path... " >&6; }
+ NEON_CONFIG="$neon_ext_path/bin/neon-config"
+ if test -x ${NEON_CONFIG}; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5
+$as_echo "found" >&6; }
+
+# Configure to use an external neon, given a neon-config script
+# found at $NEON_CONFIG.
+neon_prefix=`$NEON_CONFIG --prefix`
+
+
+ # Check whether the library is of required version
+ ne_save_LIBS="$LIBS"
+ ne_save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS `$NEON_CONFIG --cflags`"
+ LIBS="$LIBS `$NEON_CONFIG --libs`"
+ ne_libver=`$NEON_CONFIG --version | sed -e "s/neon //g"`
+ # Check whether it's possible to link against neon
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking linking against neon" >&5
+$as_echo_n "checking linking against neon... " >&6; }
+if test "${ne_cv_lib_neon+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ne_utils.h>
+int
+main ()
+{
+ne_version_match(0, 0);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ne_cv_lib_neon=yes
+else
+ ne_cv_lib_neon=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ne_cv_lib_neon" >&5
+$as_echo "$ne_cv_lib_neon" >&6; }
+ if test "$ne_cv_lib_neon" = "yes"; then
+ ne_cv_lib_neonver=no
+ for v in 25 26 27 28 29; do
+ case $ne_libver in
+ 0.$v.*) ne_cv_lib_neonver=yes ;;
+ esac
+ done
+ fi
+ ne_goodver=$ne_cv_lib_neonver
+ LIBS=$ne_save_LIBS
+ CFLAGS=$ne_save_CFLAGS
+
+
+if test "$ne_goodver" = "yes"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: using neon library $ne_libver" >&5
+$as_echo "$as_me: using neon library $ne_libver" >&6;}
+
+ # Pick up CFLAGS and LIBS needed
+ CFLAGS="$CFLAGS `$NEON_CONFIG --cflags`"
+ NEON_LIBS="$NEON_LIBS `$NEON_CONFIG --libs`"
+ # Pick up library version
+ set dummy `$NEON_CONFIG --version | sed 's/\./ /g'`
+ NE_VERSION_MAJOR=$3; NE_VERSION_MINOR=$4; NE_VERSION_PATCH=$5
+
+
+NEON_VERSION="${NE_VERSION_MAJOR}.${NE_VERSION_MINOR}.${NE_VERSION_PATCH}${NE_VERSION_TAG}"
+
+
+cat >>confdefs.h <<_ACEOF
+#define NEON_VERSION "${NEON_VERSION}"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define NE_VERSION_MAJOR (${NE_VERSION_MAJOR})
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define NE_VERSION_MINOR (${NE_VERSION_MINOR})
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define NE_VERSION_PATCH (${NE_VERSION_PATCH})
+_ACEOF
+
+
+ neon_library_message="library in ${neon_prefix} (${NEON_VERSION})"
+ neon_xml_parser_message="using whatever neon uses"
+
+if $NEON_CONFIG --support ssl >/dev/null; then
+
+NE_FLAG_SSL=yes
+
+
+$as_echo "#define NE_HAVE_SSL 1" >>confdefs.h
+
+ne_SSL_message="SSL is supported by neon"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: SSL is supported by neon" >&5
+$as_echo "$as_me: SSL is supported by neon" >&6;}
+
+else
+
+NE_FLAG_SSL=no
+
+ne_SSL_message="SSL is not supported by neon"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: SSL is not supported by neon" >&5
+$as_echo "$as_me: SSL is not supported by neon" >&6;}
+
+fi
+
+
+if $NEON_CONFIG --support zlib >/dev/null; then
+
+NE_FLAG_ZLIB=yes
+
+
+$as_echo "#define NE_HAVE_ZLIB 1" >>confdefs.h
+
+ne_ZLIB_message="zlib is supported by neon"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: zlib is supported by neon" >&5
+$as_echo "$as_me: zlib is supported by neon" >&6;}
+
+else
+
+NE_FLAG_ZLIB=no
+
+ne_ZLIB_message="zlib is not supported by neon"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: zlib is not supported by neon" >&5
+$as_echo "$as_me: zlib is not supported by neon" >&6;}
+
+fi
+
+
+if $NEON_CONFIG --support ipv6 >/dev/null; then
+
+NE_FLAG_IPV6=yes
+
+
+$as_echo "#define NE_HAVE_IPV6 1" >>confdefs.h
+
+ne_IPV6_message="IPv6 is supported by neon"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: IPv6 is supported by neon" >&5
+$as_echo "$as_me: IPv6 is supported by neon" >&6;}
+
+else
+
+NE_FLAG_IPV6=no
+
+ne_IPV6_message="IPv6 is not supported by neon"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: IPv6 is not supported by neon" >&5
+$as_echo "$as_me: IPv6 is not supported by neon" >&6;}
+
+fi
+
+
+if $NEON_CONFIG --support lfs >/dev/null; then
+
+NE_FLAG_LFS=yes
+
+
+$as_echo "#define NE_HAVE_LFS 1" >>confdefs.h
+
+ne_LFS_message="LFS is supported by neon"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: LFS is supported by neon" >&5
+$as_echo "$as_me: LFS is supported by neon" >&6;}
+
+else
+
+NE_FLAG_LFS=no
+
+ne_LFS_message="LFS is not supported by neon"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: LFS is not supported by neon" >&5
+$as_echo "$as_me: LFS is not supported by neon" >&6;}
+
+fi
+
+
+if $NEON_CONFIG --support ts_ssl >/dev/null; then
+
+NE_FLAG_TS_SSL=yes
+
+
+$as_echo "#define NE_HAVE_TS_SSL 1" >>confdefs.h
+
+ne_TS_SSL_message="thread-safe SSL is supported by neon"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: thread-safe SSL is supported by neon" >&5
+$as_echo "$as_me: thread-safe SSL is supported by neon" >&6;}
+
+else
+
+NE_FLAG_TS_SSL=no
+
+ne_TS_SSL_message="thread-safe SSL is not supported by neon"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: thread-safe SSL is not supported by neon" >&5
+$as_echo "$as_me: thread-safe SSL is not supported by neon" >&6;}
+
+fi
+
+ neon_got_library=yes
+ if test $NE_FLAG_LFS = yes; then
+
+
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of off64_t" >&5
+$as_echo_n "checking size of off64_t... " >&6; }
+if test "${ac_cv_sizeof_off64_t+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (off64_t))" "ac_cv_sizeof_off64_t" "$ac_includes_default
+
+"; then :
+
+else
+ if test "$ac_cv_type_off64_t" = yes; then
+ { { $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 "cannot compute sizeof (off64_t)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_off64_t=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_off64_t" >&5
+$as_echo "$ac_cv_sizeof_off64_t" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_OFF64_T $ac_cv_sizeof_off64_t
+_ACEOF
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print off64_t" >&5
+$as_echo_n "checking how to print off64_t... " >&6; }
+if test "${ne_cv_fmt_off64_t+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ne_cv_fmt_off64_t=none
+if test $ne_fmt_trycompile = yes; then
+ oflags="$CPPFLAGS"
+ # Consider format string mismatches as errors
+ CPPFLAGS="$CPPFLAGS -Wformat -Werror"
+ for str in d ld lld; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+
+#include <stdio.h>
+int
+main ()
+{
+off64_t i = 1; printf("%$str", i);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ne_cv_fmt_off64_t=$str; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+ CPPFLAGS=$oflags
+else
+ # Best guess. Don't have to be too precise since we probably won't
+ # get a warning message anyway.
+ case $ac_cv_sizeof_off64_t in
+ $ac_cv_sizeof_int) ne_cv_fmt_off64_t="d" ;;
+ $ac_cv_sizeof_long) ne_cv_fmt_off64_t="ld" ;;
+ $ac_cv_sizeof_long_long) ne_cv_fmt_off64_t="lld" ;;
+ esac
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ne_cv_fmt_off64_t" >&5
+$as_echo "$ne_cv_fmt_off64_t" >&6; }
+
+if test "x$ne_cv_fmt_off64_t" = "xnone"; then
+ as_fn_error $? "format string for off64_t not found" "$LINENO" 5
+fi
+
+
+cat >>confdefs.h <<_ACEOF
+#define NE_FMT_OFF64_T "$ne_cv_fmt_off64_t"
+_ACEOF
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define NE_FMT_NE_OFF_T NE_FMT_OFF64_T
+_ACEOF
+
+ else
+ cat >>confdefs.h <<_ACEOF
+#define NE_FMT_NE_OFF_T NE_FMT_OFF_T
+_ACEOF
+
+ fi
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: incompatible neon library version $ne_libver: wanted 0.25 26 27 28 29" >&5
+$as_echo "$as_me: incompatible neon library version $ne_libver: wanted 0.25 26 27 28 29" >&6;}
+ neon_got_library=no
+fi
+
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
+$as_echo "not found" >&6; }
+ # ...will fail since force_external=yes
+ fi
+ fi
+
+ if test "$neon_got_library" = "no"; then
+ if test $neon_force_external = yes; then
+ as_fn_error $? "could not use external neon library" "$LINENO" 5
+ elif test -n "$neon_bundled_srcdir"; then
+ # Couldn't find external neon, forced to use bundled sources
+ neon_force_included="yes"
+ else
+ # Couldn't find neon, and don't have bundled sources
+ as_fn_error $? "could not find neon" "$LINENO" 5
+ fi
+ fi
+fi
+
+if test "$neon_force_included" = "yes"; then
+
+
+# Define the current versions.
+NE_VERSION_MAJOR=0
+NE_VERSION_MINOR=29
+NE_VERSION_PATCH=6
+NE_VERSION_TAG=
+
+# 0.29.x is backwards-compatible to 0.27.x, so AGE=2
+NE_LIBTOOL_VERSINFO="29:${NE_VERSION_PATCH}:2"
+
+
+
+NEON_VERSION="${NE_VERSION_MAJOR}.${NE_VERSION_MINOR}.${NE_VERSION_PATCH}${NE_VERSION_TAG}"
+
+
+cat >>confdefs.h <<_ACEOF
+#define NEON_VERSION "${NEON_VERSION}"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define NE_VERSION_MAJOR (${NE_VERSION_MAJOR})
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define NE_VERSION_MINOR (${NE_VERSION_MINOR})
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define NE_VERSION_PATCH (${NE_VERSION_PATCH})
+_ACEOF
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: using bundled neon ($NEON_VERSION)" >&5
+$as_echo "$as_me: using bundled neon ($NEON_VERSION)" >&6;}
+ NEON_BUILD_BUNDLED="yes"
+
+
+
+
+
+
+
+for ac_header in sys/time.h limits.h sys/select.h arpa/inet.h libintl.h \
+ signal.h sys/socket.h netinet/in.h netinet/tcp.h netdb.h sys/poll.h \
+ sys/limits.h fcntl.h iconv.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
+/* netinet/tcp.h requires netinet/in.h on some platforms. */
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+"
+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
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for timezone global" >&5
+$as_echo_n "checking for timezone global... " >&6; }
+if test "${ne_cv_cc_timezone+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <time.h>
+int
+main ()
+{
+time_t t = 0 - timezone; timezone = 1;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ne_cv_cc_timezone=yes
+else
+ ne_cv_cc_timezone=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ne_cv_cc_timezone" >&5
+$as_echo "$ne_cv_cc_timezone" >&6; }
+
+if test "$ne_cv_cc_timezone" = "yes"; then
+
+$as_echo "#define HAVE_TIMEZONE 1" >>confdefs.h
+
+fi
+
+
+
+
+if test -z "$ac_cv_sizeof_off_t"; then
+
+NE_FLAG_LFS=no
+
+ne_LFS_message="LFS support omitted: off_t size unknown!"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: LFS support omitted: off_t size unknown!" >&5
+$as_echo "$as_me: LFS support omitted: off_t size unknown!" >&6;}
+
+elif test $ac_cv_sizeof_off_t != 4; then
+
+NE_FLAG_LFS=no
+
+ne_LFS_message="LFS support unnecessary, off_t is not 32-bit"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: LFS support unnecessary, off_t is not 32-bit" >&5
+$as_echo "$as_me: LFS support unnecessary, off_t is not 32-bit" >&6;}
+
+ for ac_func in strtoll strtoq
+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
+ break
+fi
+done
+
+elif test -z "$ac_cv_sizeof_long_long"; then
+
+NE_FLAG_LFS=no
+
+ne_LFS_message="LFS support omitted: long long size unknown"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: LFS support omitted: long long size unknown" >&5
+$as_echo "$as_me: LFS support omitted: long long size unknown" >&6;}
+
+elif test $ac_cv_sizeof_long_long != 8; then
+
+NE_FLAG_LFS=no
+
+ne_LFS_message="LFS support omitted: long long not 64-bit"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: LFS support omitted: long long not 64-bit" >&5
+$as_echo "$as_me: LFS support omitted: long long not 64-bit" >&6;}
+
+else
+ ne_save_CPPFLAGS=$CPPFLAGS
+ CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE"
+ ac_fn_c_check_type "$LINENO" "off64_t" "ac_cv_type_off64_t" "$ac_includes_default"
+if test "x$ac_cv_type_off64_t" = x""yes; then :
+
+
+
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of off64_t" >&5
+$as_echo_n "checking size of off64_t... " >&6; }
+if test "${ac_cv_sizeof_off64_t+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (off64_t))" "ac_cv_sizeof_off64_t" "$ac_includes_default
+
+"; then :
+
+else
+ if test "$ac_cv_type_off64_t" = yes; then
+ { { $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 "cannot compute sizeof (off64_t)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_off64_t=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_off64_t" >&5
+$as_echo "$ac_cv_sizeof_off64_t" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_OFF64_T $ac_cv_sizeof_off64_t
+_ACEOF
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print off64_t" >&5
+$as_echo_n "checking how to print off64_t... " >&6; }
+if test "${ne_cv_fmt_off64_t+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ne_cv_fmt_off64_t=none
+if test $ne_fmt_trycompile = yes; then
+ oflags="$CPPFLAGS"
+ # Consider format string mismatches as errors
+ CPPFLAGS="$CPPFLAGS -Wformat -Werror"
+ for str in d ld lld; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+
+#include <stdio.h>
+int
+main ()
+{
+off64_t i = 1; printf("%$str", i);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ne_cv_fmt_off64_t=$str; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+ CPPFLAGS=$oflags
+else
+ # Best guess. Don't have to be too precise since we probably won't
+ # get a warning message anyway.
+ case $ac_cv_sizeof_off64_t in
+ $ac_cv_sizeof_int) ne_cv_fmt_off64_t="d" ;;
+ $ac_cv_sizeof_long) ne_cv_fmt_off64_t="ld" ;;
+ $ac_cv_sizeof_long_long) ne_cv_fmt_off64_t="lld" ;;
+ esac
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ne_cv_fmt_off64_t" >&5
+$as_echo "$ne_cv_fmt_off64_t" >&6; }
+
+if test "x$ne_cv_fmt_off64_t" = "xnone"; then
+ as_fn_error $? "format string for off64_t not found" "$LINENO" 5
+fi
+
+
+cat >>confdefs.h <<_ACEOF
+#define NE_FMT_OFF64_T "$ne_cv_fmt_off64_t"
+_ACEOF
+
+
+ ne_lfsok=no
+ for ac_func in strtoll strtoq
+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
+ ne_lfsok=yes; break
+fi
+done
+
+ for ac_func in lseek64 fstat64
+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
+
+else
+ ne_lfsok=no; break
+fi
+done
+
+ if test x$ne_lfsok = xyes; then
+
+NE_FLAG_LFS=yes
+
+
+$as_echo "#define NE_HAVE_LFS 1" >>confdefs.h
+
+ne_LFS_message="LFS (large file) support enabled"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: LFS (large file) support enabled" >&5
+$as_echo "$as_me: LFS (large file) support enabled" >&6;}
+
+ NEON_CFLAGS="$NEON_CFLAGS -D_LARGEFILE64_SOURCE -DNE_LFS"
+ ne_save_CPPFLAGS="$CPPFLAGS -DNE_LFS"
+ else
+
+NE_FLAG_LFS=no
+
+ne_LFS_message="LFS support omitted: 64-bit support functions not found"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: LFS support omitted: 64-bit support functions not found" >&5
+$as_echo "$as_me: LFS support omitted: 64-bit support functions not found" >&6;}
+
+ fi
+else
+
+NE_FLAG_LFS=no
+
+ne_LFS_message="LFS support omitted: off64_t type not found"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: LFS support omitted: off64_t type not found" >&5
+$as_echo "$as_me: LFS support omitted: off64_t type not found" >&6;}
+
+fi
+
+ CPPFLAGS=$ne_save_CPPFLAGS
+fi
+if test "$NE_FLAG_LFS" = "yes"; then
+
+cat >>confdefs.h <<_ACEOF
+#define NE_FMT_NE_OFF_T NE_FMT_OFF64_T
+_ACEOF
+
+else
+ cat >>confdefs.h <<_ACEOF
+#define NE_FMT_NE_OFF_T NE_FMT_OFF_T
+_ACEOF
+
+fi
+
+
+ac_fn_c_check_func "$LINENO" "strcasecmp" "ac_cv_func_strcasecmp"
+if test "x$ac_cv_func_strcasecmp" = x""yes; then :
+ $as_echo "#define HAVE_STRCASECMP 1" >>confdefs.h
+
+else
+ case " $LIBOBJS " in
+ *" strcasecmp.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS strcasecmp.$ac_objext"
+ ;;
+esac
+
+fi
+
+
+
+for ac_func in signal setvbuf setsockopt stpcpy poll fcntl getsockopt
+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
+
+
+if test "x${ac_cv_func_poll}${ac_cv_header_sys_poll_h}y" = "xyesyesy"; then
+
+$as_echo "#define NE_USE_POLL 1" >>confdefs.h
+
+fi
+
+if test "$ac_cv_func_stpcpy" = "yes"; then
+ ac_fn_c_check_decl "$LINENO" "stpcpy" "ac_cv_have_decl_stpcpy" "$ac_includes_default"
+if test "x$ac_cv_have_decl_stpcpy" = x""yes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_STPCPY $ac_have_decl
+_ACEOF
+
+fi
+
+# Modern AIXes with the "Linux-like" libc have an undeclared stpcpy
+
+
+# Unixware 7 can only link gethostbyname with -lnsl -lsocket
+# Pick up -lsocket first, then the gethostbyname check will work.
+# Haiku requires -lnetwork for socket functions.
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing socket" >&5
+$as_echo_n "checking for library containing socket... " >&6; }
+if test "${ne_cv_libsfor_socket+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+socket();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ne_cv_libsfor_socket="none needed"
+else
+
+ne_sl_save_LIBS=$LIBS
+ne_cv_libsfor_socket="not found"
+for lib in socket inet ws2_32 network; do
+ # The w32api libraries link using the stdcall calling convention.
+ case ${lib}-${ne_cv_os_uname} in
+ ws2_32-MINGW*) ne__code="__stdcall socket();" ;;
+ *) ne__code="socket();" ;;
+ esac
+
+ LIBS="$ne_sl_save_LIBS -l$lib $NEON_LIBS"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+$ne__code
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ne_cv_libsfor_socket="-l$lib"; break
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+done
+LIBS=$ne_sl_save_LIBS
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ne_cv_libsfor_socket" >&5
+$as_echo "$ne_cv_libsfor_socket" >&6; }
+
+if test "$ne_cv_libsfor_socket" = "not found"; then
+ as_fn_error $? "could not find library containing socket" "$LINENO" 5
+elif test "$ne_cv_libsfor_socket" = "none needed"; then
+ :
+else
+ NEON_LIBS="$ne_cv_libsfor_socket $NEON_LIBS"
+
+fi
+
+# Enable getaddrinfo support if it, gai_strerror and inet_ntop are
+# all available.
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing getaddrinfo" >&5
+$as_echo_n "checking for library containing getaddrinfo... " >&6; }
+if test "${ne_cv_libsfor_getaddrinfo+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+getaddrinfo();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ne_cv_libsfor_getaddrinfo="none needed"
+else
+
+ne_sl_save_LIBS=$LIBS
+ne_cv_libsfor_getaddrinfo="not found"
+for lib in nsl; do
+ # The w32api libraries link using the stdcall calling convention.
+ case ${lib}-${ne_cv_os_uname} in
+ ws2_32-MINGW*) ne__code="__stdcall getaddrinfo();" ;;
+ *) ne__code="getaddrinfo();" ;;
+ esac
+
+ LIBS="$ne_sl_save_LIBS -l$lib $NEON_LIBS"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+$ne__code
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ne_cv_libsfor_getaddrinfo="-l$lib"; break
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+done
+LIBS=$ne_sl_save_LIBS
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ne_cv_libsfor_getaddrinfo" >&5
+$as_echo "$ne_cv_libsfor_getaddrinfo" >&6; }
+
+if test "$ne_cv_libsfor_getaddrinfo" = "not found"; then
+ ne_enable_gai=no
+elif test "$ne_cv_libsfor_getaddrinfo" = "none needed"; then
+ # HP-UX boxes commonly get into a state where getaddrinfo is present
+ # but borked: http://marc.theaimsgroup.com/?l=apr-dev&m=107730955207120&w=2
+ case x`uname -sr 2>/dev/null`y in
+ xHP-UX*11.[01]*y)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: getaddrinfo support disabled on HP-UX 11.0x/11.1x" >&5
+$as_echo "$as_me: getaddrinfo support disabled on HP-UX 11.0x/11.1x" >&6;} ;;
+ *)
+ ne_enable_gai=yes
+
+ne_cf_save_LIBS=$LIBS
+LIBS="$LIBS $NEON_LIBS"
+for ac_func in gai_strerror getnameinfo inet_ntop inet_pton
+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
+
+else
+ ne_enable_gai=no; break
+fi
+done
+
+LIBS=$ne_cf_save_LIBS ;;
+ esac
+
+else
+ NEON_LIBS="$ne_cv_libsfor_getaddrinfo $NEON_LIBS"
+ # HP-UX boxes commonly get into a state where getaddrinfo is present
+ # but borked: http://marc.theaimsgroup.com/?l=apr-dev&m=107730955207120&w=2
+ case x`uname -sr 2>/dev/null`y in
+ xHP-UX*11.[01]*y)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: getaddrinfo support disabled on HP-UX 11.0x/11.1x" >&5
+$as_echo "$as_me: getaddrinfo support disabled on HP-UX 11.0x/11.1x" >&6;} ;;
+ *)
+ ne_enable_gai=yes
+
+ne_cf_save_LIBS=$LIBS
+LIBS="$LIBS $NEON_LIBS"
+for ac_func in gai_strerror getnameinfo inet_ntop inet_pton
+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
+
+else
+ ne_enable_gai=no; break
+fi
+done
+
+LIBS=$ne_cf_save_LIBS ;;
+ esac
+
+fi
+
+if test $ne_enable_gai = yes; then
+
+NE_FLAG_IPV6=yes
+
+
+$as_echo "#define NE_HAVE_IPV6 1" >>confdefs.h
+
+ne_IPV6_message="IPv6 support is enabled"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: IPv6 support is enabled" >&5
+$as_echo "$as_me: IPv6 support is enabled" >&6;}
+
+
+$as_echo "#define USE_GETADDRINFO 1" >>confdefs.h
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working AI_ADDRCONFIG" >&5
+$as_echo_n "checking for working AI_ADDRCONFIG... " >&6; }
+if test "${ne_cv_gai_addrconfig+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ if test "$cross_compiling" = yes; then :
+ ne_cv_gai_addrconfig=no
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <netdb.h>
+#include <stdlib.h>
+int
+main ()
+{
+struct addrinfo hints = {0}, *result;
+hints.ai_flags = AI_ADDRCONFIG;
+if (getaddrinfo("localhost", NULL, &hints, &result) != 0) return 1;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ne_cv_gai_addrconfig=yes
+else
+ ne_cv_gai_addrconfig=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: $ne_cv_gai_addrconfig" >&5
+$as_echo "$ne_cv_gai_addrconfig" >&6; }
+ if test $ne_cv_gai_addrconfig = yes; then
+
+$as_echo "#define USE_GAI_ADDRCONFIG 1" >>confdefs.h
+
+ fi
+else
+ # Checks for non-getaddrinfo() based resolver interfaces.
+ # QNX has gethostbyname in -lsocket. BeOS only has it in -lbind.
+ # CygWin/Winsock2 has it in -lws2_32, allegedly.
+ # Haiku requires -lnetwork for socket functions.
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gethostbyname" >&5
+$as_echo_n "checking for library containing gethostbyname... " >&6; }
+if test "${ne_cv_libsfor_gethostbyname+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+gethostbyname();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ne_cv_libsfor_gethostbyname="none needed"
+else
+
+ne_sl_save_LIBS=$LIBS
+ne_cv_libsfor_gethostbyname="not found"
+for lib in socket nsl bind ws2_32 network; do
+ # The w32api libraries link using the stdcall calling convention.
+ case ${lib}-${ne_cv_os_uname} in
+ ws2_32-MINGW*) ne__code="__stdcall gethostbyname();" ;;
+ *) ne__code="gethostbyname();" ;;
+ esac
+
+ LIBS="$ne_sl_save_LIBS -l$lib $NEON_LIBS"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+$ne__code
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ne_cv_libsfor_gethostbyname="-l$lib"; break
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+done
+LIBS=$ne_sl_save_LIBS
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ne_cv_libsfor_gethostbyname" >&5
+$as_echo "$ne_cv_libsfor_gethostbyname" >&6; }
+
+if test "$ne_cv_libsfor_gethostbyname" = "not found"; then
+ as_fn_error $? "could not find library containing gethostbyname" "$LINENO" 5
+elif test "$ne_cv_libsfor_gethostbyname" = "none needed"; then
+ :
+else
+ NEON_LIBS="$ne_cv_libsfor_gethostbyname $NEON_LIBS"
+
+fi
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing hstrerror" >&5
+$as_echo_n "checking for library containing hstrerror... " >&6; }
+if test "${ne_cv_libsfor_hstrerror+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+hstrerror();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ne_cv_libsfor_hstrerror="none needed"
+else
+
+ne_sl_save_LIBS=$LIBS
+ne_cv_libsfor_hstrerror="not found"
+for lib in resolv; do
+ # The w32api libraries link using the stdcall calling convention.
+ case ${lib}-${ne_cv_os_uname} in
+ ws2_32-MINGW*) ne__code="__stdcall hstrerror();" ;;
+ *) ne__code="hstrerror();" ;;
+ esac
+
+ LIBS="$ne_sl_save_LIBS -l$lib $NEON_LIBS"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+$ne__code
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ne_cv_libsfor_hstrerror="-l$lib"; break
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+done
+LIBS=$ne_sl_save_LIBS
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ne_cv_libsfor_hstrerror" >&5
+$as_echo "$ne_cv_libsfor_hstrerror" >&6; }
+
+if test "$ne_cv_libsfor_hstrerror" = "not found"; then
+ :
+elif test "$ne_cv_libsfor_hstrerror" = "none needed"; then
+ :
+else
+ NEON_LIBS="$ne_cv_libsfor_hstrerror $NEON_LIBS"
+
+fi
+
+ne_cf_save_LIBS=$LIBS
+LIBS="$LIBS $NEON_LIBS"
+for ac_func in hstrerror
+do :
+ ac_fn_c_check_func "$LINENO" "hstrerror" "ac_cv_func_hstrerror"
+if test "x$ac_cv_func_hstrerror" = x""yes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_HSTRERROR 1
+_ACEOF
+
+fi
+done
+
+LIBS=$ne_cf_save_LIBS
+ # Older Unixes don't declare h_errno.
+ ac_fn_c_check_decl "$LINENO" "h_errno" "ac_cv_have_decl_h_errno" "#include <netdb.h>
+"
+if test "x$ac_cv_have_decl_h_errno" = x""yes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_H_ERRNO $ac_have_decl
+_ACEOF
+
+ ac_fn_c_check_type "$LINENO" "in_addr_t" "ac_cv_type_in_addr_t" "
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
+
+"
+if test "x$ac_cv_type_in_addr_t" = x""yes; then :
+
+else
+
+
+$as_echo "#define in_addr_t unsigned int" >>confdefs.h
+
+fi
+
+fi
+
+ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" "
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+# include <sys/socket.h>
+#endif
+
+"
+if test "x$ac_cv_type_socklen_t" = x""yes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_SOCKLEN_T 1
+_ACEOF
+
+
+else
+ # Linux accept(2) says this should be size_t for SunOS 5... gah.
+
+$as_echo "#define socklen_t int" >>confdefs.h
+
+fi
+
+
+ac_fn_c_check_member "$LINENO" "struct tm" "tm_gmtoff" "ac_cv_member_struct_tm_tm_gmtoff" "#include <time.h>
+"
+if test "x$ac_cv_member_struct_tm_tm_gmtoff" = x""yes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_TM_TM_GMTOFF 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_member "$LINENO" "struct tm" "__tm_gmtoff" "ac_cv_member_struct_tm___tm_gmtoff" "#include <time.h>
+"
+if test "x$ac_cv_member_struct_tm___tm_gmtoff" = x""yes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_TM___TM_GMTOFF 1
+_ACEOF
+
+
+fi
+
+
+if test ${ac_cv_member_struct_tm_tm_gmtoff}${ac_cv_member_struct_tm___tm_gmtoff}${ne_cv_cc_timezone} = nonono; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: no timezone handling in date parsing on this platform" >&5
+$as_echo "$as_me: WARNING: no timezone handling in date parsing on this platform" >&2;}
+fi
+
+
+NE_FLAG_ZLIB=no
+
+ne_ZLIB_message="zlib not supported"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: zlib not supported" >&5
+$as_echo "$as_me: zlib not supported" >&6;}
+
+
+# Conditionally enable ACL support
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable ACL support in neon" >&5
+$as_echo_n "checking whether to enable ACL support in neon... " >&6; }
+if test "x$neon_no_acl" = "xyes"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ NEON_EXTRAOBJS="$NEON_EXTRAOBJS ne_oldacl ne_acl3744"
+fi
+
+
+
+
+# Check whether --with-ssl was given.
+if test "${with_ssl+set}" = set; then :
+ withval=$with_ssl;
+fi
+
+
+
+# Check whether --with-egd was given.
+if test "${with_egd+set}" = set; then :
+ withval=$with_egd;
+fi
+
+
+
+# Check whether --with-pakchois was given.
+if test "${with_pakchois+set}" = set; then :
+ withval=$with_pakchois;
+fi
+
+
+case $with_ssl in
+/*)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: to use SSL libraries in non-standard locations, try --with-ssl --with-libs=$with_ssl" >&5
+$as_echo "$as_me: to use SSL libraries in non-standard locations, try --with-ssl --with-libs=$with_ssl" >&6;}
+ as_fn_error $? "--with-ssl does not take a path argument" "$LINENO" 5
+ ;;
+yes|openssl)
+
+
+
+# Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $PKG_CONFIG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+ $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
+
+ test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
+ ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+if test "$PKG_CONFIG" = "no"; then
+ : Not using pkg-config
+ # Either OpenSSL library may require -ldl if built with dynamic engine support
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing RSA_new" >&5
+$as_echo_n "checking for library containing RSA_new... " >&6; }
+if test "${ne_cv_libsfor_RSA_new+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+RSA_new();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ne_cv_libsfor_RSA_new="none needed"
+else
+
+ne_sl_save_LIBS=$LIBS
+ne_cv_libsfor_RSA_new="not found"
+for lib in crypto; do
+ # The w32api libraries link using the stdcall calling convention.
+ case ${lib}-${ne_cv_os_uname} in
+ ws2_32-MINGW*) ne__code="__stdcall RSA_new();" ;;
+ *) ne__code="RSA_new();" ;;
+ esac
+
+ LIBS="$ne_sl_save_LIBS -l$lib $NEON_LIBS"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+$ne__code
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ne_cv_libsfor_RSA_new="-l$lib"; break
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS="$ne_sl_save_LIBS -l$lib -ldl $NEON_LIBS"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+$ne__code
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ne_cv_libsfor_RSA_new="-l$lib -ldl"; break
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+done
+LIBS=$ne_sl_save_LIBS
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ne_cv_libsfor_RSA_new" >&5
+$as_echo "$ne_cv_libsfor_RSA_new" >&6; }
+
+if test "$ne_cv_libsfor_RSA_new" = "not found"; then
+ as_fn_error $? "could not find library containing RSA_new" "$LINENO" 5
+elif test "$ne_cv_libsfor_RSA_new" = "none needed"; then
+ :
+else
+ NEON_LIBS="$ne_cv_libsfor_RSA_new $NEON_LIBS"
+
+fi
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing SSL_library_init" >&5
+$as_echo_n "checking for library containing SSL_library_init... " >&6; }
+if test "${ne_cv_libsfor_SSL_library_init+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+SSL_library_init();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ne_cv_libsfor_SSL_library_init="none needed"
+else
+
+ne_sl_save_LIBS=$LIBS
+ne_cv_libsfor_SSL_library_init="not found"
+for lib in ssl; do
+ # The w32api libraries link using the stdcall calling convention.
+ case ${lib}-${ne_cv_os_uname} in
+ ws2_32-MINGW*) ne__code="__stdcall SSL_library_init();" ;;
+ *) ne__code="SSL_library_init();" ;;
+ esac
+
+ LIBS="$ne_sl_save_LIBS -l$lib $NEON_LIBS"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+$ne__code
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ne_cv_libsfor_SSL_library_init="-l$lib"; break
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS="$ne_sl_save_LIBS -l$lib -ldl $NEON_LIBS"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+$ne__code
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ne_cv_libsfor_SSL_library_init="-l$lib -ldl"; break
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+done
+LIBS=$ne_sl_save_LIBS
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ne_cv_libsfor_SSL_library_init" >&5
+$as_echo "$ne_cv_libsfor_SSL_library_init" >&6; }
+
+if test "$ne_cv_libsfor_SSL_library_init" = "not found"; then
+ as_fn_error $? "could not find library containing SSL_library_init" "$LINENO" 5
+elif test "$ne_cv_libsfor_SSL_library_init" = "none needed"; then
+ :
+else
+ NEON_LIBS="$ne_cv_libsfor_SSL_library_init $NEON_LIBS"
+
+fi
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for openssl pkg-config data" >&5
+$as_echo_n "checking for openssl pkg-config data... " >&6; }
+if test "${ne_cv_pkg_openssl+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if $PKG_CONFIG openssl; then
+ ne_cv_pkg_openssl=yes
+ else
+ ne_cv_pkg_openssl=no
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ne_cv_pkg_openssl" >&5
+$as_echo "$ne_cv_pkg_openssl" >&6; }
+
+ if test "$ne_cv_pkg_openssl" = "yes"; then
+ NE_SSL_CFLAGS=`$PKG_CONFIG --cflags openssl`
+ NE_SSL_LIBS=`$PKG_CONFIG --libs openssl`
+ : Using provided pkg-config data
+ { $as_echo "$as_me:${as_lineno-$LINENO}: using SSL library configuration from pkg-config" >&5
+$as_echo "$as_me: using SSL library configuration from pkg-config" >&6;}
+ CPPFLAGS="$CPPFLAGS ${NE_SSL_CFLAGS}"
+ NEON_LIBS="$NEON_LIBS ${NE_SSL_LIBS}"
+ else
+ : No pkg-config for openssl provided
+ # Either OpenSSL library may require -ldl if built with dynamic engine support
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing RSA_new" >&5
+$as_echo_n "checking for library containing RSA_new... " >&6; }
+if test "${ne_cv_libsfor_RSA_new+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+RSA_new();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ne_cv_libsfor_RSA_new="none needed"
+else
+
+ne_sl_save_LIBS=$LIBS
+ne_cv_libsfor_RSA_new="not found"
+for lib in crypto; do
+ # The w32api libraries link using the stdcall calling convention.
+ case ${lib}-${ne_cv_os_uname} in
+ ws2_32-MINGW*) ne__code="__stdcall RSA_new();" ;;
+ *) ne__code="RSA_new();" ;;
+ esac
+
+ LIBS="$ne_sl_save_LIBS -l$lib $NEON_LIBS"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+$ne__code
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ne_cv_libsfor_RSA_new="-l$lib"; break
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS="$ne_sl_save_LIBS -l$lib -ldl $NEON_LIBS"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+$ne__code
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ne_cv_libsfor_RSA_new="-l$lib -ldl"; break
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+done
+LIBS=$ne_sl_save_LIBS
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ne_cv_libsfor_RSA_new" >&5
+$as_echo "$ne_cv_libsfor_RSA_new" >&6; }
+
+if test "$ne_cv_libsfor_RSA_new" = "not found"; then
+ as_fn_error $? "could not find library containing RSA_new" "$LINENO" 5
+elif test "$ne_cv_libsfor_RSA_new" = "none needed"; then
+ :
+else
+ NEON_LIBS="$ne_cv_libsfor_RSA_new $NEON_LIBS"
+
+fi
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing SSL_library_init" >&5
+$as_echo_n "checking for library containing SSL_library_init... " >&6; }
+if test "${ne_cv_libsfor_SSL_library_init+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+SSL_library_init();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ne_cv_libsfor_SSL_library_init="none needed"
+else
+
+ne_sl_save_LIBS=$LIBS
+ne_cv_libsfor_SSL_library_init="not found"
+for lib in ssl; do
+ # The w32api libraries link using the stdcall calling convention.
+ case ${lib}-${ne_cv_os_uname} in
+ ws2_32-MINGW*) ne__code="__stdcall SSL_library_init();" ;;
+ *) ne__code="SSL_library_init();" ;;
+ esac
+
+ LIBS="$ne_sl_save_LIBS -l$lib $NEON_LIBS"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+$ne__code
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ne_cv_libsfor_SSL_library_init="-l$lib"; break
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS="$ne_sl_save_LIBS -l$lib -ldl $NEON_LIBS"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+$ne__code
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ne_cv_libsfor_SSL_library_init="-l$lib -ldl"; break
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+done
+LIBS=$ne_sl_save_LIBS
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ne_cv_libsfor_SSL_library_init" >&5
+$as_echo "$ne_cv_libsfor_SSL_library_init" >&6; }
+
+if test "$ne_cv_libsfor_SSL_library_init" = "not found"; then
+ as_fn_error $? "could not find library containing SSL_library_init" "$LINENO" 5
+elif test "$ne_cv_libsfor_SSL_library_init" = "none needed"; then
+ :
+else
+ NEON_LIBS="$ne_cv_libsfor_SSL_library_init $NEON_LIBS"
+
+fi
+ fi
+fi
+
+
+
+
+ for ac_header in openssl/ssl.h openssl/opensslv.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
+
+else
+ as_fn_error $? "OpenSSL headers not found, cannot enable SSL support" "$LINENO" 5
+fi
+
+done
+
+
+ # Enable EGD support if using 0.9.7 or newer
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking OpenSSL version is >= 0.9.7" >&5
+$as_echo_n "checking OpenSSL version is >= 0.9.7... " >&6; }
+if test "${ne_cv_lib_ssl097+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <openssl/opensslv.h>
+#if OPENSSL_VERSION_NUMBER >= 0x00907000L
+good
+#endif
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "good" >/dev/null 2>&1; then :
+ ne_cv_lib_ssl097=yes
+else
+ ne_cv_lib_ssl097=no
+fi
+rm -f conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ne_cv_lib_ssl097" >&5
+$as_echo "$ne_cv_lib_ssl097" >&6; }
+ if test "$ne_cv_lib_ssl097" = "yes"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: OpenSSL >= 0.9.7; EGD support not needed in neon" >&5
+$as_echo "$as_me: OpenSSL >= 0.9.7; EGD support not needed in neon" >&6;}
+
+NE_FLAG_SSL=yes
+
+
+$as_echo "#define NE_HAVE_SSL 1" >>confdefs.h
+
+ne_SSL_message="SSL support enabled, using OpenSSL (0.9.7 or later)"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: SSL support enabled, using OpenSSL (0.9.7 or later)" >&5
+$as_echo "$as_me: SSL support enabled, using OpenSSL (0.9.7 or later)" >&6;}
+
+
+ne_cf_save_LIBS=$LIBS
+LIBS="$LIBS $NEON_LIBS"
+for ac_func in CRYPTO_set_idptr_callback SSL_SESSION_cmp
+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
+
+LIBS=$ne_cf_save_LIBS
+ else
+ # Fail if OpenSSL is older than 0.9.6
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking OpenSSL version is >= 0.9.6" >&5
+$as_echo_n "checking OpenSSL version is >= 0.9.6... " >&6; }
+if test "${ne_cv_lib_ssl096+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <openssl/opensslv.h>
+#if OPENSSL_VERSION_NUMBER >= 0x00906000L
+good
+#endif
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "good" >/dev/null 2>&1; then :
+ ne_cv_lib_ssl096=yes
+else
+ ne_cv_lib_ssl096=no
+fi
+rm -f conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ne_cv_lib_ssl096" >&5
+$as_echo "$ne_cv_lib_ssl096" >&6; }
+ if test "$ne_cv_lib_ssl096" != "yes"; then
+ as_fn_error $? "OpenSSL 0.9.6 or later is required" "$LINENO" 5
+ fi
+
+NE_FLAG_SSL=yes
+
+
+$as_echo "#define NE_HAVE_SSL 1" >>confdefs.h
+
+ne_SSL_message="SSL support enabled, using OpenSSL (0.9.6 or later)"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: SSL support enabled, using OpenSSL (0.9.6 or later)" >&5
+$as_echo "$as_me: SSL support enabled, using OpenSSL (0.9.6 or later)" >&6;}
+
+
+ case "$with_egd" in
+ yes|no) ne_cv_lib_sslegd=$with_egd ;;
+ /*) ne_cv_lib_sslegd=yes
+
+cat >>confdefs.h <<_ACEOF
+#define EGD_PATH "$with_egd"
+_ACEOF
+ ;;
+ *) # Guess whether EGD support is needed
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable EGD support" >&5
+$as_echo_n "checking whether to enable EGD support... " >&6; }
+if test "${ne_cv_lib_sslegd+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -r /dev/random || test -r /dev/urandom; then
+ ne_cv_lib_sslegd=no
+ else
+ ne_cv_lib_sslegd=yes
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ne_cv_lib_sslegd" >&5
+$as_echo "$ne_cv_lib_sslegd" >&6; }
+ ;;
+ esac
+ if test "$ne_cv_lib_sslegd" = "yes"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: EGD support enabled for seeding OpenSSL PRNG" >&5
+$as_echo "$as_me: EGD support enabled for seeding OpenSSL PRNG" >&6;}
+
+$as_echo "#define ENABLE_EGD 1" >>confdefs.h
+
+ fi
+ fi
+
+
+$as_echo "#define HAVE_OPENSSL 1" >>confdefs.h
+
+ NEON_EXTRAOBJS="$NEON_EXTRAOBJS ne_openssl"
+
+
+$as_echo "#define HAVE_NTLM 1" >>confdefs.h
+
+ ;;
+gnutls)
+
+
+
+# Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $PKG_CONFIG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+ $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
+
+ test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
+ ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+if test "$PKG_CONFIG" = "no"; then
+ : Not using pkg-config
+
+ # Fall back on libgnutls-config script
+ # Extract the first word of "libgnutls-config", so it can be a program name with args.
+set dummy libgnutls-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_GNUTLS_CONFIG+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $GNUTLS_CONFIG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_GNUTLS_CONFIG="$GNUTLS_CONFIG" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_GNUTLS_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+ $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
+
+ test -z "$ac_cv_path_GNUTLS_CONFIG" && ac_cv_path_GNUTLS_CONFIG="no"
+ ;;
+esac
+fi
+GNUTLS_CONFIG=$ac_cv_path_GNUTLS_CONFIG
+if test -n "$GNUTLS_CONFIG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GNUTLS_CONFIG" >&5
+$as_echo "$GNUTLS_CONFIG" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+ if test "$GNUTLS_CONFIG" = "no"; then
+ as_fn_error $? "could not find libgnutls-config in \$PATH" "$LINENO" 5
+ fi
+
+ CPPFLAGS="$CPPFLAGS `$GNUTLS_CONFIG --cflags`"
+ NEON_LIBS="$NEON_LIBS `$GNUTLS_CONFIG --libs`"
+
+ ne_gnutls_ver=`$GNUTLS_CONFIG --version`
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gnutls pkg-config data" >&5
+$as_echo_n "checking for gnutls pkg-config data... " >&6; }
+if test "${ne_cv_pkg_gnutls+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if $PKG_CONFIG gnutls; then
+ ne_cv_pkg_gnutls=yes
+ else
+ ne_cv_pkg_gnutls=no
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ne_cv_pkg_gnutls" >&5
+$as_echo "$ne_cv_pkg_gnutls" >&6; }
+
+ if test "$ne_cv_pkg_gnutls" = "yes"; then
+ NE_SSL_CFLAGS=`$PKG_CONFIG --cflags gnutls`
+ NE_SSL_LIBS=`$PKG_CONFIG --libs gnutls`
+ : Using provided pkg-config data
+ { $as_echo "$as_me:${as_lineno-$LINENO}: using GnuTLS configuration from pkg-config" >&5
+$as_echo "$as_me: using GnuTLS configuration from pkg-config" >&6;}
+ CPPFLAGS="$CPPFLAGS ${NE_SSL_CFLAGS}"
+ NEON_LIBS="$NEON_LIBS ${NE_SSL_LIBS}"
+
+ ne_gnutls_ver=`$PKG_CONFIG --modversion gnutls`
+
+ else
+ : No pkg-config for gnutls provided
+
+ # Fall back on libgnutls-config script
+ # Extract the first word of "libgnutls-config", so it can be a program name with args.
+set dummy libgnutls-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_GNUTLS_CONFIG+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $GNUTLS_CONFIG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_GNUTLS_CONFIG="$GNUTLS_CONFIG" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_GNUTLS_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+ $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
+
+ test -z "$ac_cv_path_GNUTLS_CONFIG" && ac_cv_path_GNUTLS_CONFIG="no"
+ ;;
+esac
+fi
+GNUTLS_CONFIG=$ac_cv_path_GNUTLS_CONFIG
+if test -n "$GNUTLS_CONFIG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GNUTLS_CONFIG" >&5
+$as_echo "$GNUTLS_CONFIG" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+ if test "$GNUTLS_CONFIG" = "no"; then
+ as_fn_error $? "could not find libgnutls-config in \$PATH" "$LINENO" 5
+ fi
+
+ CPPFLAGS="$CPPFLAGS `$GNUTLS_CONFIG --cflags`"
+ NEON_LIBS="$NEON_LIBS `$GNUTLS_CONFIG --libs`"
+
+ ne_gnutls_ver=`$GNUTLS_CONFIG --version`
+
+ fi
+fi
+
+
+
+
+ ac_fn_c_check_header_mongrel "$LINENO" "gnutls/gnutls.h" "ac_cv_header_gnutls_gnutls_h" "$ac_includes_default"
+if test "x$ac_cv_header_gnutls_gnutls_h" = x""yes; then :
+
+else
+ as_fn_error $? "could not find gnutls/gnutls.h in include path" "$LINENO" 5
+fi
+
+
+
+
+NE_FLAG_SSL=yes
+
+
+$as_echo "#define NE_HAVE_SSL 1" >>confdefs.h
+
+ne_SSL_message="SSL support enabled, using GnuTLS $ne_gnutls_ver"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: SSL support enabled, using GnuTLS $ne_gnutls_ver" >&5
+$as_echo "$as_me: SSL support enabled, using GnuTLS $ne_gnutls_ver" >&6;}
+
+ NEON_EXTRAOBJS="$NEON_EXTRAOBJS ne_gnutls"
+
+$as_echo "#define HAVE_GNUTLS 1" >>confdefs.h
+
+
+ # Check for functions in later releases
+
+ne_cf_save_LIBS=$LIBS
+LIBS="$LIBS $NEON_LIBS"
+for ac_func in gnutls_session_get_data2 gnutls_x509_dn_get_rdn_ava \
+ gnutls_sign_callback_set \
+ gnutls_certificate_get_x509_cas \
+ gnutls_certificate_verify_peers2
+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
+
+LIBS=$ne_cf_save_LIBS
+
+ # fail if gnutls_certificate_verify_peers2 is not found
+ if test x${ac_cv_func_gnutls_certificate_verify_peers2} != xyes; then
+ as_fn_error $? "GnuTLS version predates gnutls_certificate_verify_peers2, newer version required" "$LINENO" 5
+ fi
+
+ # Check for iconv support if using the new RDN access functions:
+ if test ${ac_cv_func_gnutls_x509_dn_get_rdn_ava}X${ac_cv_header_iconv_h} = yesXyes; then
+ for ac_func in iconv
+do :
+ ac_fn_c_check_func "$LINENO" "iconv" "ac_cv_func_iconv"
+if test "x$ac_cv_func_iconv" = x""yes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_ICONV 1
+_ACEOF
+
+fi
+done
+
+ fi
+ ;;
+*) # Default to off; only create crypto-enabled binaries if requested.
+
+NE_FLAG_SSL=no
+
+ne_SSL_message="SSL support is not enabled"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: SSL support is not enabled" >&5
+$as_echo "$as_me: SSL support is not enabled" >&6;}
+
+
+NE_FLAG_TS_SSL=no
+
+ne_TS_SSL_message="Thread-safe SSL support is not enabled"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Thread-safe SSL support is not enabled" >&5
+$as_echo "$as_me: Thread-safe SSL support is not enabled" >&6;}
+
+ NEON_EXTRAOBJS="$NEON_EXTRAOBJS ne_stubssl"
+ ;;
+esac
+
+
+
+# Check whether --with-ca-bundle was given.
+if test "${with_ca_bundle+set}" = set; then :
+ withval=$with_ca_bundle;
+else
+ with_ca_bundle=no
+fi
+
+
+case ${NE_FLAG_SSL}-${with_ca_bundle} in
+*-no) ;;
+yes-*)
+
+cat >>confdefs.h <<_ACEOF
+#define NE_SSL_CA_BUNDLE "${with_ca_bundle}"
+_ACEOF
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Using ${with_ca_bundle} as default SSL CA bundle" >&5
+$as_echo "$as_me: Using ${with_ca_bundle} as default SSL CA bundle" >&6;}
+ ;;
+esac
+
+# Check whether --enable-threadsafe-ssl was given.
+if test "${enable_threadsafe_ssl+set}" = set; then :
+ enableval=$enable_threadsafe_ssl;
+else
+ enable_threadsafe_ssl=no
+fi
+
+
+case $enable_threadsafe_ssl in
+posix|yes)
+ ne_pthr_ok=yes
+ for ac_func in pthread_mutex_init pthread_mutex_lock
+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
+
+else
+ ne_pthr_ok=no
+fi
+done
+
+ if test "${ne_pthr_ok}" = "no"; then
+ as_fn_error $? "could not find POSIX mutex interfaces; (try CC=\"${CC} -pthread\"?)" "$LINENO" 5
+ fi
+
+NE_FLAG_TS_SSL=yes
+
+
+$as_echo "#define NE_HAVE_TS_SSL 1" >>confdefs.h
+
+ne_TS_SSL_message="Thread-safe SSL supported using POSIX threads"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Thread-safe SSL supported using POSIX threads" >&5
+$as_echo "$as_me: Thread-safe SSL supported using POSIX threads" >&6;}
+
+ ;;
+*)
+
+NE_FLAG_TS_SSL=no
+
+ne_TS_SSL_message="Thread-safe SSL not supported"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Thread-safe SSL not supported" >&5
+$as_echo "$as_me: Thread-safe SSL not supported" >&6;}
+
+ ;;
+esac
+
+case ${with_pakchois}X${ac_cv_func_gnutls_sign_callback_set}Y${ne_cv_lib_ssl097} in
+noX*Y*) ;;
+*X*Yyes|*XyesY*)
+ # PKCS#11... ho!
+
+
+
+# Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $PKG_CONFIG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+ $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
+
+ test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
+ ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+if test "$PKG_CONFIG" = "no"; then
+ : Not using pkg-config
+ { $as_echo "$as_me:${as_lineno-$LINENO}: pakchois library not found; no PKCS#11 support" >&5
+$as_echo "$as_me: pakchois library not found; no PKCS#11 support" >&6;}
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pakchois pkg-config data" >&5
+$as_echo_n "checking for pakchois pkg-config data... " >&6; }
+if test "${ne_cv_pkg_pakchois+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if $PKG_CONFIG pakchois; then
+ ne_cv_pkg_pakchois=yes
+ else
+ ne_cv_pkg_pakchois=no
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ne_cv_pkg_pakchois" >&5
+$as_echo "$ne_cv_pkg_pakchois" >&6; }
+
+ if test "$ne_cv_pkg_pakchois" = "yes"; then
+ NE_PK11_CFLAGS=`$PKG_CONFIG --cflags pakchois`
+ NE_PK11_LIBS=`$PKG_CONFIG --libs pakchois`
+ : Using provided pkg-config data
+ { $as_echo "$as_me:${as_lineno-$LINENO}: using pakchois for PKCS#11 support" >&5
+$as_echo "$as_me: using pakchois for PKCS#11 support" >&6;}
+
+$as_echo "#define HAVE_PAKCHOIS 1" >>confdefs.h
+
+ CPPFLAGS="$CPPFLAGS ${NE_PK11_CFLAGS}"
+ NEON_LIBS="${NEON_LIBS} ${NE_PK11_LIBS}"
+ else
+ : No pkg-config for pakchois provided
+ { $as_echo "$as_me:${as_lineno-$LINENO}: pakchois library not found; no PKCS#11 support" >&5
+$as_echo "$as_me: pakchois library not found; no PKCS#11 support" >&6;}
+ fi
+fi
+
+
+
+ ;;
+esac
+
+
+
+# Check whether --with-gssapi was given.
+if test "${with_gssapi+set}" = set; then :
+ withval=$with_gssapi;
+fi
+
+if test "$with_gssapi" != "no"; then
+ # Extract the first word of "krb5-config", so it can be a program name with args.
+set dummy krb5-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_KRB5_CONFIG+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $KRB5_CONFIG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_KRB5_CONFIG="$KRB5_CONFIG" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_dummy="$PATH:/usr/kerberos/bin"
+for as_dir in $as_dummy
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_KRB5_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+ $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
+
+ test -z "$ac_cv_path_KRB5_CONFIG" && ac_cv_path_KRB5_CONFIG="none"
+ ;;
+esac
+fi
+KRB5_CONFIG=$ac_cv_path_KRB5_CONFIG
+if test -n "$KRB5_CONFIG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $KRB5_CONFIG" >&5
+$as_echo "$KRB5_CONFIG" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+else
+ KRB5_CONFIG=none
+fi
+if test "x$KRB5_CONFIG" != "xnone"; then
+ ne_save_CPPFLAGS=$CPPFLAGS
+ ne_save_LIBS=$NEON_LIBS
+ NEON_LIBS="$NEON_LIBS `${KRB5_CONFIG} --libs gssapi`"
+ CPPFLAGS="$CPPFLAGS `${KRB5_CONFIG} --cflags gssapi`"
+ # MIT and Heimdal put gssapi.h in different places
+ for ac_header in gssapi/gssapi.h gssapi.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
+
+
+ne_cf_save_LIBS=$LIBS
+LIBS="$LIBS $NEON_LIBS"
+for ac_func in gss_init_sec_context
+do :
+ ac_fn_c_check_func "$LINENO" "gss_init_sec_context" "ac_cv_func_gss_init_sec_context"
+if test "x$ac_cv_func_gss_init_sec_context" = x""yes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_GSS_INIT_SEC_CONTEXT 1
+_ACEOF
+
+ ne_save_CPPFLAGS=$CPPFLAGS
+ ne_save_LIBS=$NEON_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: GSSAPI authentication support enabled" >&5
+$as_echo "$as_me: GSSAPI authentication support enabled" >&6;}
+
+$as_echo "#define HAVE_GSSAPI 1" >>confdefs.h
+
+ for ac_header in gssapi/gssapi_generic.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "gssapi/gssapi_generic.h" "ac_cv_header_gssapi_gssapi_generic_h" "$ac_includes_default"
+if test "x$ac_cv_header_gssapi_gssapi_generic_h" = x""yes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_GSSAPI_GSSAPI_GENERIC_H 1
+_ACEOF
+
+fi
+
+done
+
+ # Older versions of MIT Kerberos lack GSS_C_NT_HOSTBASED_SERVICE
+ ac_fn_c_check_decl "$LINENO" "GSS_C_NT_HOSTBASED_SERVICE" "ac_cv_have_decl_GSS_C_NT_HOSTBASED_SERVICE" "#ifdef HAVE_GSSAPI_GSSAPI_H
+#include <gssapi/gssapi.h>
+#else
+#include <gssapi.h>
+#endif
+"
+if test "x$ac_cv_have_decl_GSS_C_NT_HOSTBASED_SERVICE" = x""yes; then :
+
+else
+
+$as_echo "#define GSS_C_NT_HOSTBASED_SERVICE gss_nt_service_name" >>confdefs.h
+
+fi
+
+fi
+done
+
+LIBS=$ne_cf_save_LIBS
+ break
+
+fi
+
+done
+
+ CPPFLAGS=$ne_save_CPPFLAGS
+ NEON_LIBS=$ne_save_LIBS
+fi
+
+
+# Check whether --with-libproxy was given.
+if test "${with_libproxy+set}" = set; then :
+ withval=$with_libproxy;
+fi
+
+if test "x$with_libproxy" != "xno"; then
+
+
+
+# Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $PKG_CONFIG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+ $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
+
+ test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
+ ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+if test "$PKG_CONFIG" = "no"; then
+ : Not using pkg-config
+
+NE_FLAG_LIBPXY=no
+
+ne_LIBPXY_message="libproxy support not enabled"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: libproxy support not enabled" >&5
+$as_echo "$as_me: libproxy support not enabled" >&6;}
+
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libproxy-1.0 pkg-config data" >&5
+$as_echo_n "checking for libproxy-1.0 pkg-config data... " >&6; }
+if test "${ne_cv_pkg_libproxy_1_0+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if $PKG_CONFIG libproxy-1.0; then
+ ne_cv_pkg_libproxy_1_0=yes
+ else
+ ne_cv_pkg_libproxy_1_0=no
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ne_cv_pkg_libproxy_1_0" >&5
+$as_echo "$ne_cv_pkg_libproxy_1_0" >&6; }
+
+ if test "$ne_cv_pkg_libproxy_1_0" = "yes"; then
+ NE_PXY_CFLAGS=`$PKG_CONFIG --cflags libproxy-1.0`
+ NE_PXY_LIBS=`$PKG_CONFIG --libs libproxy-1.0`
+ : Using provided pkg-config data
+
+$as_echo "#define HAVE_LIBPROXY 1" >>confdefs.h
+
+ CPPFLAGS="$CPPFLAGS $NE_PXY_CFLAGS"
+ NEON_LIBS="$NEON_LIBS ${NE_PXY_LIBS}"
+
+NE_FLAG_LIBPXY=yes
+
+
+$as_echo "#define NE_HAVE_LIBPXY 1" >>confdefs.h
+
+ne_LIBPXY_message="libproxy support enabled"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: libproxy support enabled" >&5
+$as_echo "$as_me: libproxy support enabled" >&6;}
+
+ else
+ : No pkg-config for libproxy-1.0 provided
+
+NE_FLAG_LIBPXY=no
+
+ne_LIBPXY_message="libproxy support not enabled"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: libproxy support not enabled" >&5
+$as_echo "$as_me: libproxy support not enabled" >&6;}
+
+ fi
+fi
+
+
+
+else
+
+NE_FLAG_LIBPXY=no
+
+ne_LIBPXY_message="libproxy support not enabled"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: libproxy support not enabled" >&5
+$as_echo "$as_me: libproxy support not enabled" >&6;}
+
+fi
+
+
+
+
+
+
+
+ CFLAGS="$CFLAGS -I$neon_bundled_srcdir"
+ NEON_LIBS="-L$neon_bundled_builddir -lneon $NEON_LIBS"
+ NEON_NEED_XML_PARSER=yes
+ neon_library_message="included libneon (${NEON_VERSION})"
+else
+ # Don't need to configure an XML parser
+ NEON_NEED_XML_PARSER=no
+ NEON_BUILD_BUNDLED=no
+fi
+
+
+
+
+
+# The colons are here so there is something to evaluate
+# in case the argument was not passed.
+if test "$neon_force_included" = "yes"; then
+ :
+
+
+NEON_TARGET=libneon.a
+NEON_OBJEXT=o
+
+
+
+
+
+# Using the default set of object files to build.
+# Add the extension to EXTRAOBJS
+ne="$NEON_EXTRAOBJS"
+NEON_EXTRAOBJS=
+for o in $ne; do
+ NEON_EXTRAOBJS="$NEON_EXTRAOBJS $o.$NEON_OBJEXT"
+done
+
+# Was DAV support explicitly turned off?
+if test "x$neon_no_webdav" = "xyes"; then
+ # No WebDAV support
+ NEONOBJS="$NEONOBJS \$(NEON_BASEOBJS)"
+
+NE_FLAG_DAV=no
+
+ne_DAV_message="WebDAV support is not enabled"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WebDAV support is not enabled" >&5
+$as_echo "$as_me: WebDAV support is not enabled" >&6;}
+
+
+if test "x${NE_LIBTOOL_RELEASE}y" = "xy"; then
+ NE_LIBTOOL_RELEASE="NODAV"
+else
+ NE_LIBTOOL_RELEASE="${NE_LIBTOOL_RELEASE}-NODAV"
+fi
+
+else
+ # WebDAV support
+ NEONOBJS="$NEONOBJS \$(NEON_DAVOBJS)"
+
+NE_FLAG_DAV=yes
+
+
+$as_echo "#define NE_HAVE_DAV 1" >>confdefs.h
+
+ne_DAV_message="WebDAV support is enabled"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WebDAV support is enabled" >&5
+$as_echo "$as_me: WebDAV support is enabled" >&6;}
+
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+# Check whether --with-libxml2 was given.
+if test "${with_libxml2+set}" = set; then :
+ withval=$with_libxml2;
+fi
+
+
+# Check whether --with-expat was given.
+if test "${with_expat+set}" = set; then :
+ withval=$with_expat;
+fi
+
+
+
+
+# Check whether --with-included-expat was given.
+if test "${with_included_expat+set}" = set; then :
+ withval=$with_included_expat;
+else
+ with_included_expat=no
+fi
+
+
+if test "$NEON_NEED_XML_PARSER" = "yes"; then
+ # Find an XML parser
+ neon_xml_parser=none
+
+ # Forced choice of expat:
+ case $with_expat in
+ yes)
+ac_fn_c_check_header_mongrel "$LINENO" "expat.h" "ac_cv_header_expat_h" "$ac_includes_default"
+if test "x$ac_cv_header_expat_h" = x""yes; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XML_SetXmlDeclHandler in -lexpat" >&5
+$as_echo_n "checking for XML_SetXmlDeclHandler in -lexpat... " >&6; }
+if test "${ac_cv_lib_expat_XML_SetXmlDeclHandler+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lexpat $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 XML_SetXmlDeclHandler ();
+int
+main ()
+{
+return XML_SetXmlDeclHandler ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_expat_XML_SetXmlDeclHandler=yes
+else
+ ac_cv_lib_expat_XML_SetXmlDeclHandler=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_expat_XML_SetXmlDeclHandler" >&5
+$as_echo "$ac_cv_lib_expat_XML_SetXmlDeclHandler" >&6; }
+if test "x$ac_cv_lib_expat_XML_SetXmlDeclHandler" = x""yes; then :
+
+
+$as_echo "#define HAVE_EXPAT 1" >>confdefs.h
+
+ neon_xml_parser_message="expat"
+ NEON_LIBS="$NEON_LIBS -lexpat"
+ neon_xml_parser=expat
+ ac_fn_c_check_type "$LINENO" "XML_Size" "ac_cv_type_XML_Size" "#include <expat.h>
+"
+if test "x$ac_cv_type_XML_Size" = x""yes; then :
+
+
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of XML_Size" >&5
+$as_echo_n "checking size of XML_Size... " >&6; }
+if test "${ac_cv_sizeof_XML_Size+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (XML_Size))" "ac_cv_sizeof_XML_Size" "$ac_includes_default
+#include <expat.h>
+"; then :
+
+else
+ if test "$ac_cv_type_XML_Size" = yes; then
+ { { $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 "cannot compute sizeof (XML_Size)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_XML_Size=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_XML_Size" >&5
+$as_echo "$ac_cv_sizeof_XML_Size" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_XML_SIZE $ac_cv_sizeof_XML_Size
+_ACEOF
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print XML_Size" >&5
+$as_echo_n "checking how to print XML_Size... " >&6; }
+if test "${ne_cv_fmt_XML_Size+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ne_cv_fmt_XML_Size=none
+if test $ne_fmt_trycompile = yes; then
+ oflags="$CPPFLAGS"
+ # Consider format string mismatches as errors
+ CPPFLAGS="$CPPFLAGS -Wformat -Werror"
+ for str in d ld lld; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <expat.h>
+#include <stdio.h>
+int
+main ()
+{
+XML_Size i = 1; printf("%$str", i);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ne_cv_fmt_XML_Size=$str; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+ CPPFLAGS=$oflags
+else
+ # Best guess. Don't have to be too precise since we probably won't
+ # get a warning message anyway.
+ case $ac_cv_sizeof_XML_Size in
+ $ac_cv_sizeof_int) ne_cv_fmt_XML_Size="d" ;;
+ $ac_cv_sizeof_long) ne_cv_fmt_XML_Size="ld" ;;
+ $ac_cv_sizeof_long_long) ne_cv_fmt_XML_Size="lld" ;;
+ esac
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ne_cv_fmt_XML_Size" >&5
+$as_echo "$ne_cv_fmt_XML_Size" >&6; }
+
+if test "x$ne_cv_fmt_XML_Size" = "xnone"; then
+ as_fn_error $? "format string for XML_Size not found" "$LINENO" 5
+fi
+
+
+cat >>confdefs.h <<_ACEOF
+#define NE_FMT_XML_SIZE "$ne_cv_fmt_XML_Size"
+_ACEOF
+
+
+else
+ cat >>confdefs.h <<_ACEOF
+#define NE_FMT_XML_SIZE "d"
+_ACEOF
+
+fi
+
+
+else
+ as_fn_error $? "expat library not found, cannot proceed" "$LINENO" 5
+fi
+
+else
+ as_fn_error $? "expat library not found, cannot proceed" "$LINENO" 5
+fi
+
+
+ ;;
+ no) ;;
+ */libexpat.la)
+ # Special case for Subversion
+ ne_expdir=`echo $with_expat | sed 's:/libexpat.la$::'`
+ $as_echo "#define HAVE_EXPAT 1" >>confdefs.h
+
+ cat >>confdefs.h <<_ACEOF
+#define NE_FMT_XML_SIZE "d"
+_ACEOF
+
+ CPPFLAGS="$CPPFLAGS -I$ne_expdir"
+ if test "x${NEON_TARGET}" = "xlibneon.la"; then
+ NEON_LTLIBS=$with_expat
+ else
+ # no dependency on libexpat => crippled libneon, so do partial install
+ ALLOW_INSTALL=lib
+ fi
+ neon_xml_parser=expat
+ neon_xml_parser_message="expat in $ne_expdir"
+ ;;
+ /*) as_fn_error $? "--with-expat does not take a directory argument" "$LINENO" 5 ;;
+ esac
+
+ # If expat wasn't specifically enabled and libxml was:
+ if test "${neon_xml_parser}-${with_libxml2}-${with_included_expat}" = "none-yes-no"; then
+
+# Extract the first word of "xml2-config", so it can be a program name with args.
+set dummy xml2-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_XML2_CONFIG+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$XML2_CONFIG"; then
+ ac_cv_prog_XML2_CONFIG="$XML2_CONFIG" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_XML2_CONFIG="xml2-config"
+ $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
+XML2_CONFIG=$ac_cv_prog_XML2_CONFIG
+if test -n "$XML2_CONFIG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XML2_CONFIG" >&5
+$as_echo "$XML2_CONFIG" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+if test -n "$XML2_CONFIG"; then
+ neon_xml_parser_message="libxml `$XML2_CONFIG --version`"
+
+$as_echo "#define HAVE_LIBXML 1" >>confdefs.h
+
+ # xml2-config in some versions erroneously includes -I/include
+ # in the --cflags output.
+ CPPFLAGS="$CPPFLAGS `$XML2_CONFIG --cflags | sed 's| -I/include||g'`"
+ NEON_LIBS="$NEON_LIBS `$XML2_CONFIG --libs | sed 's|-L/usr/lib ||g'`"
+ for ac_header in libxml/xmlversion.h libxml/parser.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
+
+else
+
+ as_fn_error $? "could not find parser.h, libxml installation problem?" "$LINENO" 5
+fi
+
+done
+
+ neon_xml_parser=libxml2
+else
+ as_fn_error $? "libxml2.x library not found, cannot proceed" "$LINENO" 5
+fi
+
+ fi
+
+ # Otherwise, by default search for expat then libxml2:
+ if test "${neon_xml_parser}-${with_included_expat}" = "none-no"; then
+
+ac_fn_c_check_header_mongrel "$LINENO" "expat.h" "ac_cv_header_expat_h" "$ac_includes_default"
+if test "x$ac_cv_header_expat_h" = x""yes; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XML_SetXmlDeclHandler in -lexpat" >&5
+$as_echo_n "checking for XML_SetXmlDeclHandler in -lexpat... " >&6; }
+if test "${ac_cv_lib_expat_XML_SetXmlDeclHandler+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lexpat $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 XML_SetXmlDeclHandler ();
+int
+main ()
+{
+return XML_SetXmlDeclHandler ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_expat_XML_SetXmlDeclHandler=yes
+else
+ ac_cv_lib_expat_XML_SetXmlDeclHandler=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_expat_XML_SetXmlDeclHandler" >&5
+$as_echo "$ac_cv_lib_expat_XML_SetXmlDeclHandler" >&6; }
+if test "x$ac_cv_lib_expat_XML_SetXmlDeclHandler" = x""yes; then :
+
+
+$as_echo "#define HAVE_EXPAT 1" >>confdefs.h
+
+ neon_xml_parser_message="expat"
+ NEON_LIBS="$NEON_LIBS -lexpat"
+ neon_xml_parser=expat
+ ac_fn_c_check_type "$LINENO" "XML_Size" "ac_cv_type_XML_Size" "#include <expat.h>
+"
+if test "x$ac_cv_type_XML_Size" = x""yes; then :
+
+
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of XML_Size" >&5
+$as_echo_n "checking size of XML_Size... " >&6; }
+if test "${ac_cv_sizeof_XML_Size+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (XML_Size))" "ac_cv_sizeof_XML_Size" "$ac_includes_default
+#include <expat.h>
+"; then :
+
+else
+ if test "$ac_cv_type_XML_Size" = yes; then
+ { { $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 "cannot compute sizeof (XML_Size)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_XML_Size=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_XML_Size" >&5
+$as_echo "$ac_cv_sizeof_XML_Size" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_XML_SIZE $ac_cv_sizeof_XML_Size
+_ACEOF
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print XML_Size" >&5
+$as_echo_n "checking how to print XML_Size... " >&6; }
+if test "${ne_cv_fmt_XML_Size+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ne_cv_fmt_XML_Size=none
+if test $ne_fmt_trycompile = yes; then
+ oflags="$CPPFLAGS"
+ # Consider format string mismatches as errors
+ CPPFLAGS="$CPPFLAGS -Wformat -Werror"
+ for str in d ld lld; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <expat.h>
+#include <stdio.h>
+int
+main ()
+{
+XML_Size i = 1; printf("%$str", i);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ne_cv_fmt_XML_Size=$str; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+ CPPFLAGS=$oflags
+else
+ # Best guess. Don't have to be too precise since we probably won't
+ # get a warning message anyway.
+ case $ac_cv_sizeof_XML_Size in
+ $ac_cv_sizeof_int) ne_cv_fmt_XML_Size="d" ;;
+ $ac_cv_sizeof_long) ne_cv_fmt_XML_Size="ld" ;;
+ $ac_cv_sizeof_long_long) ne_cv_fmt_XML_Size="lld" ;;
+ esac
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ne_cv_fmt_XML_Size" >&5
+$as_echo "$ne_cv_fmt_XML_Size" >&6; }
+
+if test "x$ne_cv_fmt_XML_Size" = "xnone"; then
+ as_fn_error $? "format string for XML_Size not found" "$LINENO" 5
+fi
+
+
+cat >>confdefs.h <<_ACEOF
+#define NE_FMT_XML_SIZE "$ne_cv_fmt_XML_Size"
+_ACEOF
+
+
+else
+ cat >>confdefs.h <<_ACEOF
+#define NE_FMT_XML_SIZE "d"
+_ACEOF
+
+fi
+
+
+else
+
+# Extract the first word of "xml2-config", so it can be a program name with args.
+set dummy xml2-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_XML2_CONFIG+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$XML2_CONFIG"; then
+ ac_cv_prog_XML2_CONFIG="$XML2_CONFIG" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_XML2_CONFIG="xml2-config"
+ $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
+XML2_CONFIG=$ac_cv_prog_XML2_CONFIG
+if test -n "$XML2_CONFIG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XML2_CONFIG" >&5
+$as_echo "$XML2_CONFIG" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+if test -n "$XML2_CONFIG"; then
+ neon_xml_parser_message="libxml `$XML2_CONFIG --version`"
+
+$as_echo "#define HAVE_LIBXML 1" >>confdefs.h
+
+ # xml2-config in some versions erroneously includes -I/include
+ # in the --cflags output.
+ CPPFLAGS="$CPPFLAGS `$XML2_CONFIG --cflags | sed 's| -I/include||g'`"
+ NEON_LIBS="$NEON_LIBS `$XML2_CONFIG --libs | sed 's|-L/usr/lib ||g'`"
+ for ac_header in libxml/xmlversion.h libxml/parser.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
+
+else
+
+ as_fn_error $? "could not find parser.h, libxml installation problem?" "$LINENO" 5
+fi
+
+done
+
+ neon_xml_parser=libxml2
+else
+ :
+fi
+
+fi
+
+else
+
+# Extract the first word of "xml2-config", so it can be a program name with args.
+set dummy xml2-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_XML2_CONFIG+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$XML2_CONFIG"; then
+ ac_cv_prog_XML2_CONFIG="$XML2_CONFIG" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_prog_XML2_CONFIG="xml2-config"
+ $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
+XML2_CONFIG=$ac_cv_prog_XML2_CONFIG
+if test -n "$XML2_CONFIG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XML2_CONFIG" >&5
+$as_echo "$XML2_CONFIG" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+if test -n "$XML2_CONFIG"; then
+ neon_xml_parser_message="libxml `$XML2_CONFIG --version`"
+
+$as_echo "#define HAVE_LIBXML 1" >>confdefs.h
+
+ # xml2-config in some versions erroneously includes -I/include
+ # in the --cflags output.
+ CPPFLAGS="$CPPFLAGS `$XML2_CONFIG --cflags | sed 's| -I/include||g'`"
+ NEON_LIBS="$NEON_LIBS `$XML2_CONFIG --libs | sed 's|-L/usr/lib ||g'`"
+ for ac_header in libxml/xmlversion.h libxml/parser.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
+
+else
+
+ as_fn_error $? "could not find parser.h, libxml installation problem?" "$LINENO" 5
+fi
+
+done
+
+ neon_xml_parser=libxml2
+else
+ :
+fi
+
+fi
+
+
+
+ fi
+
+ # If an XML parser still has not been found, fail or use the bundled expat
+ if test "$neon_xml_parser" = "none"; then
+ # Configure the bundled copy of expat
+
+
+
+# Define XML_BYTE_ORDER for expat sources.
+if test $ac_cv_c_bigendian = "yes"; then
+ ne_xml_border=21
+else
+ ne_xml_border=12
+fi
+
+# mini-expat doesn't pick up config.h
+CPPFLAGS="$CPPFLAGS -DXML_BYTE_ORDER=$ne_xml_border -DXML_DTD -I\$(top_srcdir)/lib/expat/xmlparse -I\$(top_srcdir)/lib/expat/xmltok"
+
+cat >>confdefs.h <<_ACEOF
+#define NE_FMT_XML_SIZE "d"
+_ACEOF
+
+
+# Use the bundled expat sources
+case " $LIBOBJS " in
+ *" \$(top_builddir)/lib/expat/xmltok/xmltok.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS \$(top_builddir)/lib/expat/xmltok/xmltok.$ac_objext"
+ ;;
+esac
+
+case " $LIBOBJS " in
+ *" \$(top_builddir)/lib/expat/xmltok/xmlrole.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS \$(top_builddir)/lib/expat/xmltok/xmlrole.$ac_objext"
+ ;;
+esac
+
+case " $LIBOBJS " in
+ *" \$(top_builddir)/lib/expat/xmlparse/xmlparse.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS \$(top_builddir)/lib/expat/xmlparse/xmlparse.$ac_objext"
+ ;;
+esac
+
+case " $LIBOBJS " in
+ *" \$(top_builddir)/lib/expat/xmlparse/hashtable.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS \$(top_builddir)/lib/expat/xmlparse/hashtable.$ac_objext"
+ ;;
+esac
+
+
+$as_echo "#define HAVE_EXPAT 1" >>confdefs.h
+
+
+
+$as_echo "#define HAVE_XMLPARSE_H 1" >>confdefs.h
+
+
+
+ neon_xml_parser_message="bundled expat in \$(top_srcdir)/lib/expat"
+ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: XML parser used: $neon_xml_parser_message" >&5
+$as_echo "$as_me: XML parser used: $neon_xml_parser_message" >&6;}
+fi
+
+
+
+else
+ :
+
+fi
+
+
+
+
+
+ac_fn_c_check_func "$LINENO" "getopt_long" "ac_cv_func_getopt_long"
+if test "x$ac_cv_func_getopt_long" = x""yes; then :
+
+else
+ case " $LIBOBJS " in
+ *" lib/getopt.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS lib/getopt.$ac_objext"
+ ;;
+esac
+
+case " $LIBOBJS " in
+ *" lib/getopt1.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS lib/getopt1.$ac_objext"
+ ;;
+esac
+
+fi
+
+
+
+
+
+
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long" >&5
+$as_echo_n "checking size of long long... " >&6; }
+if test "${ac_cv_sizeof_long_long+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long))" "ac_cv_sizeof_long_long" "$ac_includes_default
+
+"; then :
+
+else
+ if test "$ac_cv_type_long_long" = yes; then
+ { { $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 "cannot compute sizeof (long long)
+See \`config.log' for more details" "$LINENO" 5; }
+ else
+ ac_cv_sizeof_long_long=0
+ fi
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long" >&5
+$as_echo "$ac_cv_sizeof_long_long" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long
+_ACEOF
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print long long" >&5
+$as_echo_n "checking how to print long long... " >&6; }
+if test "${ne_cv_fmt_long_long+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ne_cv_fmt_long_long=none
+if test $ne_fmt_trycompile = yes; then
+ oflags="$CPPFLAGS"
+ # Consider format string mismatches as errors
+ CPPFLAGS="$CPPFLAGS -Wformat -Werror"
+ for str in d ld lld; do
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/types.h>
+
+#include <stdio.h>
+int
+main ()
+{
+long long i = 1; printf("%$str", i);
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ne_cv_fmt_long_long=$str; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+ CPPFLAGS=$oflags
+else
+ # Best guess. Don't have to be too precise since we probably won't
+ # get a warning message anyway.
+ case $ac_cv_sizeof_long_long in
+ $ac_cv_sizeof_int) ne_cv_fmt_long_long="d" ;;
+ $ac_cv_sizeof_long) ne_cv_fmt_long_long="ld" ;;
+ $ac_cv_sizeof_long_long) ne_cv_fmt_long_long="lld" ;;
+ esac
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ne_cv_fmt_long_long" >&5
+$as_echo "$ne_cv_fmt_long_long" >&6; }
+
+if test "x$ne_cv_fmt_long_long" = "xnone"; then
+ as_fn_error $? "format string for long long not found" "$LINENO" 5
+fi
+
+
+cat >>confdefs.h <<_ACEOF
+#define NE_FMT_LONG_LONG "$ne_cv_fmt_long_long"
+_ACEOF
+
+
+
+
+# Check whether --enable-debug was given.
+if test "${enable_debug+set}" = set; then :
+ enableval=$enable_debug;
+fi
+
+
+# default is to enable debugging
+case $enable_debug in
+no) { $as_echo "$as_me:${as_lineno-$LINENO}: debugging is disabled" >&5
+$as_echo "$as_me: debugging is disabled" >&6;}
+ ;;
+*) { $as_echo "$as_me:${as_lineno-$LINENO}: debugging is enabled" >&5
+$as_echo "$as_me: debugging is enabled" >&6;}
+
+$as_echo "#define NE_DEBUGGING 1" >>confdefs.h
+
+
+;;
+esac
+
+
+
+# Check whether --enable-warnings was given.
+if test "${enable_warnings+set}" = set; then :
+ enableval=$enable_warnings;
+fi
+
+
+if test "$enable_warnings" = "yes"; then
+ case $GCC:`uname` in
+ yes:*)
+ CFLAGS="$CFLAGS -Wall -Wmissing-declarations -Wshadow -Wreturn-type -Wsign-compare -Wundef -Wpointer-arith -Wbad-function-cast -Wformat-security"
+ if test -z "$with_ssl" -o "$with_ssl" = "no"; then
+ # OpenSSL headers fail strict prototypes checks
+ CFLAGS="$CFLAGS -Wstrict-prototypes"
+ fi
+ ;;
+ no:OSF1) CFLAGS="$CFLAGS -check -msg_disable returnchecks -msg_disable alignment -msg_disable overflow" ;;
+ no:IRIX) CFLAGS="$CFLAGS -fullwarn" ;;
+ no:UnixWare) CFLAGS="$CFLAGS -v" ;;
+ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: warning flags unknown for compiler on this platform" >&5
+$as_echo "$as_me: WARNING: warning flags unknown for compiler on this platform" >&2;} ;;
+ esac
+fi
+
+
+CPPFLAGS="$CPPFLAGS -I\${top_builddir} -I\$(top_srcdir)/lib"
+
+ac_config_files="$ac_config_files litmus"
+
+ac_config_files="$ac_config_files Makefile lib/neon/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
+ test "x$cache_file" != "x/dev/null" &&
+ { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+ cat confcache >$cache_file
+ 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
+
+
+
+
+: ${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.
+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 -p'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -p'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -p'
+ fi
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+
+# 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
+
+if test -x / >/dev/null 2>&1; then
+ as_test_x='test -x'
+else
+ if ls -dL / >/dev/null 2>&1; then
+ as_ls_L_option=L
+ else
+ as_ls_L_option=
+ fi
+ as_test_x='
+ eval sh -c '\''
+ if test -d "$1"; then
+ test -d "$1/.";
+ else
+ case $1 in #(
+ -*)set "./$1";;
+ esac;
+ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
+ ???[sx]*):;;*)false;;esac;fi
+ '\'' sh
+ '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+exec 6>&1
+## ----------------------------------- ##
+## 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 litmus $as_me 0.13, which was
+generated by GNU Autoconf 2.66. 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"
+
+_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
+
+Report bugs to <litmus@lists.manyfish.co.uk>."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
+ac_cs_version="\\
+litmus config.status 0.13
+configured by $0, generated by GNU Autoconf 2.66,
+ with options \\"\$ac_cs_config\\"
+
+Copyright (C) 2010 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'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+ac_need_defaults=:
+while test $# != 0
+do
+ case $1 in
+ --*=*)
+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
+ ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+ ac_shift=:
+ ;;
+ *)
+ ac_option=$1
+ ac_optarg=$2
+ ac_shift=shift
+ ;;
+ esac
+
+ case $ac_option in
+ # Handling of the options.
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ ac_cs_recheck=: ;;
+ --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+ $as_echo "$ac_cs_version"; exit ;;
+ --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"` ;;
+ 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
+_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" ;;
+ "litmus") CONFIG_FILES="$CONFIG_FILES litmus" ;;
+ "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+ "lib/neon/Makefile") CONFIG_FILES="$CONFIG_FILES lib/neon/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
+fi
+
+# Have a temporary directory for convenience. Make it in the build tree
+# simply because there is no reason against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+ tmp=
+ trap 'exit_status=$?
+ { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
+' 0
+ trap '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 -n "$tmp" && test -d "$tmp"
+} ||
+{
+ tmp=./conf$$-$RANDOM
+ (umask 077 && mkdir "$tmp")
+} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
+
+# 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 {' >"$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 >>"\$tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\)..*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\)..*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+ N
+ s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$tmp/subs1.awk" <<_ACAWK &&
+ for (key in S) S_is_set[key] = 1
+ FS = ""
+
+}
+{
+ line = $ 0
+ nfields = split(line, field, "@")
+ substed = 0
+ len = length(field[1])
+ for (i = 2; i < nfields; i++) {
+ key = field[i]
+ keylen = length(key)
+ if (S_is_set[key]) {
+ value = S[key]
+ line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+ len += length(value) + length(field[++i])
+ substed = 1
+ } else
+ len += 1 + keylen
+ }
+
+ print line
+}
+
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+ sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+ cat
+fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
+ || as_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 >"$tmp/defines.awk" <<\_ACAWK ||
+BEGIN {
+_ACEOF
+
+# Transform confdefs.h into an awk script `defines.awk', embedded as
+# here-document in config.status, that substitutes the proper values into
+# config.h.in to produce config.h.
+
+# Create a delimiter string that does not exist in confdefs.h, to ease
+# handling of long lines.
+ac_delim='%!_!# '
+for ac_last_try in false false :; do
+ ac_t=`sed -n "/$ac_delim/p" confdefs.h`
+ if test -z "$ac_t"; then
+ break
+ elif $ac_last_try; then
+ as_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 "
+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="$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 >"$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
+_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
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$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' "$tmp/out"`; test -n "$ac_out"; } &&
+ { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$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 "$tmp/stdin"
+ case $ac_file in
+ -) cat "$tmp/out" && rm -f "$tmp/out";;
+ *) rm -f "$ac_file" && mv "$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 "$tmp/defines.awk"' "$ac_file_inputs"
+ } >"$tmp/config.h" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ if diff "$ac_file" "$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 "$tmp/config.h" "$ac_file" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ fi
+ else
+ $as_echo "/* $configure_input */" \
+ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
+ || as_fn_error $? "could not create -" "$LINENO" 5
+ fi
+ ;;
+
+
+ esac
+
+
+ case $ac_file$ac_mode in
+ "litmus":F) chmod +x litmus ;;
+
+ 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
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: Configured to build litmus 0.13:
+
+ Install prefix: ${prefix}
+ Compiler: ${CC}
+ neon library: ${neon_library_message}
+ XML parser: ${neon_xml_parser_message}
+ SSL library: ${ne_SSL_message}
+" >&5
+$as_echo "$as_me: Configured to build litmus 0.13:
+
+ Install prefix: ${prefix}
+ Compiler: ${CC}
+ neon library: ${neon_library_message}
+ XML parser: ${neon_xml_parser_message}
+ SSL library: ${ne_SSL_message}
+" >&6;}
+
+# For VPATH builds
+for d in lib lib/expat lib/neon test-common src; do
+ test -d $d || mkdir $d
+done
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..e6b7800
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,58 @@
+dnl autoconf script for litmus
+
+AC_INIT(litmus, 0.13, litmus@lists.manyfish.co.uk)
+
+AC_PREREQ(2.59)
+
+AC_COPYRIGHT([Copyright (c) 2001-2009 Joe Orton and others
+This configure script may be copied, distributed and modified under the
+terms of the GNU General Public license; see COPYING for more details])
+
+AC_CONFIG_SRCDIR(litmus.in)
+AC_CONFIG_HEADER(config.h)
+
+AC_DEFINE([_GNU_SOURCE], 1, [Define to enable GNU extensions])
+
+AC_PROG_CC
+AC_SET_MAKE
+AC_PROG_INSTALL
+
+dnl List of tests
+AC_SUBST([TESTS], ["basic copymove props locks http"])
+
+NE_REQUIRE_VERSIONS([0], [25 26 27 28 29])
+NEON_WITHOUT_ZLIB
+NEON_WITHOUT_ACL
+NEON_TEST
+NEON_VPATH_BUNDLED(['$(top_srcdir)/lib/neon'], [lib/neon], [NEON_NORMAL_BUILD()
+NEON_XML_PARSER([\$(top_srcdir)/lib/expat], [\$(top_builddir)/lib/expat])
+])
+
+dnl Check for getopt_long
+AC_CHECK_FUNC(getopt_long,,[AC_LIBOBJ(lib/getopt)
+AC_LIBOBJ(lib/getopt1)])
+
+NEON_FORMAT(long long)
+NEON_DEBUG
+NEON_WARNINGS
+
+CPPFLAGS="$CPPFLAGS -I\${top_builddir} -I\$(top_srcdir)/lib"
+
+AC_CONFIG_FILES([litmus], [chmod +x litmus])
+AC_CONFIG_FILES([Makefile lib/neon/Makefile])
+
+AC_OUTPUT
+
+AC_MSG_NOTICE([Configured to build AC_PACKAGE_STRING:
+
+ Install prefix: ${prefix}
+ Compiler: ${CC}
+ neon library: ${neon_library_message}
+ XML parser: ${neon_xml_parser_message}
+ SSL library: ${ne_SSL_message}
+])
+
+# For VPATH builds
+for d in lib lib/expat lib/neon test-common src; do
+ test -d $d || mkdir $d
+done
diff --git a/htdocs/foo b/htdocs/foo
new file mode 100644
index 0000000..a7922d0
--- /dev/null
+++ b/htdocs/foo
@@ -0,0 +1,8 @@
+This
+is
+a
+test
+file
+called
+foo
+
diff --git a/install-sh b/install-sh
new file mode 100755
index 0000000..e9de238
--- /dev/null
+++ b/install-sh
@@ -0,0 +1,251 @@
+#!/bin/sh
+#
+# install - install a program, script, or datafile
+# This comes from X11R5 (mit/util/scripts/install.sh).
+#
+# Copyright 1991 by the Massachusetts Institute of Technology
+#
+# Permission to use, copy, modify, distribute, and sell this software and its
+# documentation for any purpose is hereby granted without fee, provided that
+# the above copyright notice appear in all copies and that both that
+# copyright notice and this permission notice appear in supporting
+# documentation, and that the name of M.I.T. not be used in advertising or
+# publicity pertaining to distribution of the software without specific,
+# written prior permission. M.I.T. makes no representations about the
+# suitability of this software for any purpose. It is provided "as is"
+# without express or implied warranty.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch. It can only install one file at a time, a restriction
+# shared with many OS's install programs.
+
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit="${DOITPROG-}"
+
+
+# put in absolute paths if you don't have them in your path; or use env. vars.
+
+mvprog="${MVPROG-mv}"
+cpprog="${CPPROG-cp}"
+chmodprog="${CHMODPROG-chmod}"
+chownprog="${CHOWNPROG-chown}"
+chgrpprog="${CHGRPPROG-chgrp}"
+stripprog="${STRIPPROG-strip}"
+rmprog="${RMPROG-rm}"
+mkdirprog="${MKDIRPROG-mkdir}"
+
+transformbasename=""
+transform_arg=""
+instcmd="$mvprog"
+chmodcmd="$chmodprog 0755"
+chowncmd=""
+chgrpcmd=""
+stripcmd=""
+rmcmd="$rmprog -f"
+mvcmd="$mvprog"
+src=""
+dst=""
+dir_arg=""
+
+while [ x"$1" != x ]; do
+ case $1 in
+ -c) instcmd="$cpprog"
+ shift
+ continue;;
+
+ -d) dir_arg=true
+ shift
+ continue;;
+
+ -m) chmodcmd="$chmodprog $2"
+ shift
+ shift
+ continue;;
+
+ -o) chowncmd="$chownprog $2"
+ shift
+ shift
+ continue;;
+
+ -g) chgrpcmd="$chgrpprog $2"
+ shift
+ shift
+ continue;;
+
+ -s) stripcmd="$stripprog"
+ shift
+ continue;;
+
+ -t=*) transformarg=`echo $1 | sed 's/-t=//'`
+ shift
+ continue;;
+
+ -b=*) transformbasename=`echo $1 | sed 's/-b=//'`
+ shift
+ continue;;
+
+ *) if [ x"$src" = x ]
+ then
+ src=$1
+ else
+ # this colon is to work around a 386BSD /bin/sh bug
+ :
+ dst=$1
+ fi
+ shift
+ continue;;
+ esac
+done
+
+if [ x"$src" = x ]
+then
+ echo "install: no input file specified"
+ exit 1
+else
+ true
+fi
+
+if [ x"$dir_arg" != x ]; then
+ dst=$src
+ src=""
+
+ if [ -d $dst ]; then
+ instcmd=:
+ chmodcmd=""
+ else
+ instcmd=mkdir
+ fi
+else
+
+# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
+# might cause directories to be created, which would be especially bad
+# if $src (and thus $dsttmp) contains '*'.
+
+ if [ -f $src -o -d $src ]
+ then
+ true
+ else
+ echo "install: $src does not exist"
+ exit 1
+ fi
+
+ if [ x"$dst" = x ]
+ then
+ echo "install: no destination specified"
+ exit 1
+ else
+ true
+ fi
+
+# If destination is a directory, append the input filename; if your system
+# does not like double slashes in filenames, you may need to add some logic
+
+ if [ -d $dst ]
+ then
+ dst="$dst"/`basename $src`
+ else
+ true
+ fi
+fi
+
+## this sed command emulates the dirname command
+dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
+
+# Make sure that the destination directory exists.
+# this part is taken from Noah Friedman's mkinstalldirs script
+
+# Skip lots of stat calls in the usual case.
+if [ ! -d "$dstdir" ]; then
+defaultIFS='
+'
+IFS="${IFS-${defaultIFS}}"
+
+oIFS="${IFS}"
+# Some sh's can't handle IFS=/ for some reason.
+IFS='%'
+set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
+IFS="${oIFS}"
+
+pathcomp=''
+
+while [ $# -ne 0 ] ; do
+ pathcomp="${pathcomp}${1}"
+ shift
+
+ if [ ! -d "${pathcomp}" ] ;
+ then
+ $mkdirprog "${pathcomp}"
+ else
+ true
+ fi
+
+ pathcomp="${pathcomp}/"
+done
+fi
+
+if [ x"$dir_arg" != x ]
+then
+ $doit $instcmd $dst &&
+
+ if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
+ if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
+ if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
+ if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
+else
+
+# If we're going to rename the final executable, determine the name now.
+
+ if [ x"$transformarg" = x ]
+ then
+ dstfile=`basename $dst`
+ else
+ dstfile=`basename $dst $transformbasename |
+ sed $transformarg`$transformbasename
+ fi
+
+# don't allow the sed command to completely eliminate the filename
+
+ if [ x"$dstfile" = x ]
+ then
+ dstfile=`basename $dst`
+ else
+ true
+ fi
+
+# Make a temp file name in the proper directory.
+
+ dsttmp=$dstdir/#inst.$$#
+
+# Move or copy the file name to the temp name
+
+ $doit $instcmd $src $dsttmp &&
+
+ trap "rm -f ${dsttmp}" 0 &&
+
+# and set any options; do chmod last to preserve setuid bits
+
+# If any of these fail, we abort the whole thing. If we want to
+# ignore errors from any of these, just make sure not to ignore
+# errors from the above "$doit $instcmd $src $dsttmp" command.
+
+ if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
+ if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
+ if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
+ if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
+
+# Now rename the file to the real destination.
+
+ $doit $rmcmd -f $dstdir/$dstfile &&
+ $doit $mvcmd $dsttmp $dstdir/$dstfile
+
+fi &&
+
+
+exit 0
diff --git a/lib/basename.c b/lib/basename.c
new file mode 100644
index 0000000..358f5e8
--- /dev/null
+++ b/lib/basename.c
@@ -0,0 +1,57 @@
+/* basename.c -- return the last element in a path
+ Copyright (C) 1990, 1998, 1999 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#if HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <basename.h>
+
+#ifndef FILESYSTEM_PREFIX_LEN
+# define FILESYSTEM_PREFIX_LEN(Filename) 0
+#endif
+
+#ifndef ISSLASH
+# define ISSLASH(C) ((C) == '/')
+#endif
+
+/* In general, we can't use the builtin `basename' function if available,
+ since it has different meanings in different environments.
+ In some environments the builtin `basename' modifies its argument.
+ If NAME is all slashes, be sure to return `/'. */
+
+char *
+base_name (char const *name)
+{
+ char const *base = name += FILESYSTEM_PREFIX_LEN (name);
+ int all_slashes = 1;
+ char const *p;
+
+ for (p = name; *p; p++)
+ {
+ if (ISSLASH (*p))
+ base = p + 1;
+ else
+ all_slashes = 0;
+ }
+
+ /* If NAME is all slashes, arrange to return `/'. */
+ if (*base == '\0' && ISSLASH (*name) && all_slashes)
+ --base;
+
+ return (char *) base;
+}
diff --git a/lib/basename.h b/lib/basename.h
new file mode 100644
index 0000000..6b02212
--- /dev/null
+++ b/lib/basename.h
@@ -0,0 +1,2 @@
+
+char *base_name (char const *name);
diff --git a/lib/dirname.c b/lib/dirname.c
new file mode 100644
index 0000000..8ebed67
--- /dev/null
+++ b/lib/dirname.c
@@ -0,0 +1,78 @@
+/* dirname.c -- return all but the last element in a path
+ Copyright (C) 1990, 1998 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#if HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+/*******************************************************
+ * THIS IS A MODIFIED dirname IMPLEMENTATION:
+ * - sitecopy wants "" if there is no directory name,
+ * standard GNU implementation gives us "."
+ * - sitecopy wants the trailing slash.
+ *******************************************************/
+
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+#else
+char *malloc ();
+#endif
+#if defined STDC_HEADERS || defined HAVE_STRING_H
+# include <string.h>
+#else
+# include <strings.h>
+# ifndef strrchr
+# define strrchr rindex
+# endif
+#endif
+
+#include "dirname.h"
+
+/* Return the leading directories part of PATH,
+ allocated with malloc. If out of memory, return 0.
+ Assumes that trailing slashes have already been
+ removed. */
+
+char *
+dir_name (const char *path)
+{
+ char *newpath;
+ char *slash;
+ int length; /* Length of result, not including NUL. */
+
+ slash = strrchr (path, '/');
+ if (slash == 0)
+ {
+ /* File is in the current directory. */
+ path = "";
+ length = 0;
+ }
+ else
+ {
+ /* Remove any trailing slashes from the result.
+ while (slash > path && *slash == '/')
+ --slash; */
+
+ length = slash - path + 1;
+ }
+ newpath = (char *) malloc (length + 1);
+ if (newpath == 0)
+ return 0;
+ strncpy (newpath, path, length);
+ newpath[length] = 0;
+ return newpath;
+}
diff --git a/lib/dirname.h b/lib/dirname.h
new file mode 100644
index 0000000..fc46699
--- /dev/null
+++ b/lib/dirname.h
@@ -0,0 +1,31 @@
+/* Copyright (C) 1998 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifndef DIRNAME_H_
+# define DIRNAME_H_ 1
+
+# ifndef PARAMS
+# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
+# define PARAMS(Args) Args
+# else
+# define PARAMS(Args) ()
+# endif
+# endif
+
+char *
+dir_name PARAMS ((const char *path));
+
+#endif /* not DIRNAME_H_ */
diff --git a/lib/fnmatch.c b/lib/fnmatch.c
new file mode 100644
index 0000000..4bc7cd9
--- /dev/null
+++ b/lib/fnmatch.c
@@ -0,0 +1,212 @@
+/* Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
+
+ NOTE: The canonical source of this file is maintained with the GNU C
+ Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation; either version 2, or (at your option) any
+ later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#if HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <errno.h>
+#include <fnmatch.h>
+#include <ctype.h>
+
+#if defined (STDC_HEADERS) || !defined (isascii)
+# define ISASCII(c) 1
+#else
+# define ISASCII(c) isascii(c)
+#endif
+
+#define ISUPPER(c) (ISASCII (c) && isupper (c))
+
+
+/* Comment out all this code if we are using the GNU C Library, and are not
+ actually compiling the library itself. This code is part of the GNU C
+ Library, but also included in many other GNU distributions. Compiling
+ and linking in this code is a waste when using the GNU C library
+ (especially if it is a shared library). Rather than having every GNU
+ program understand `configure --with-gnu-libc' and omit the object files,
+ it is simpler to just do this in the source for each such file. */
+
+#if defined (_LIBC) || !defined (__GNU_LIBRARY__)
+
+
+# ifndef errno
+extern int errno;
+# endif
+
+/* Match STRING against the filename pattern PATTERN, returning zero if
+ it matches, nonzero if not. */
+int
+fnmatch (pattern, string, flags)
+ const char *pattern;
+ const char *string;
+ int flags;
+{
+ register const char *p = pattern, *n = string;
+ register char c;
+
+/* Note that this evalutes C many times. */
+# define FOLD(c) ((flags & FNM_CASEFOLD) && ISUPPER (c) ? tolower (c) : (c))
+
+ while ((c = *p++) != '\0')
+ {
+ c = FOLD (c);
+
+ switch (c)
+ {
+ case '?':
+ if (*n == '\0')
+ return FNM_NOMATCH;
+ else if ((flags & FNM_FILE_NAME) && *n == '/')
+ return FNM_NOMATCH;
+ else if ((flags & FNM_PERIOD) && *n == '.' &&
+ (n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/')))
+ return FNM_NOMATCH;
+ break;
+
+ case '\\':
+ if (!(flags & FNM_NOESCAPE))
+ {
+ c = *p++;
+ c = FOLD (c);
+ }
+ if (FOLD (*n) != c)
+ return FNM_NOMATCH;
+ break;
+
+ case '*':
+ if ((flags & FNM_PERIOD) && *n == '.' &&
+ (n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/')))
+ return FNM_NOMATCH;
+
+ for (c = *p++; c == '?' || c == '*'; c = *p++, ++n)
+ if (((flags & FNM_FILE_NAME) && *n == '/') ||
+ (c == '?' && *n == '\0'))
+ return FNM_NOMATCH;
+
+ if (c == '\0')
+ return 0;
+
+ {
+ char c1 = (!(flags & FNM_NOESCAPE) && c == '\\') ? *p : c;
+ c1 = FOLD (c1);
+ for (--p; *n != '\0'; ++n)
+ if ((c == '[' || FOLD (*n) == c1) &&
+ fnmatch (p, n, flags & ~FNM_PERIOD) == 0)
+ return 0;
+ return FNM_NOMATCH;
+ }
+
+ case '[':
+ {
+ /* Nonzero if the sense of the character class is inverted. */
+ register int not;
+
+ if (*n == '\0')
+ return FNM_NOMATCH;
+
+ if ((flags & FNM_PERIOD) && *n == '.' &&
+ (n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/')))
+ return FNM_NOMATCH;
+
+ not = (*p == '!' || *p == '^');
+ if (not)
+ ++p;
+
+ c = *p++;
+ for (;;)
+ {
+ register char cstart = c, cend = c;
+
+ if (!(flags & FNM_NOESCAPE) && c == '\\')
+ cstart = cend = *p++;
+
+ cstart = cend = FOLD (cstart);
+
+ if (c == '\0')
+ /* [ (unterminated) loses. */
+ return FNM_NOMATCH;
+
+ c = *p++;
+ c = FOLD (c);
+
+ if ((flags & FNM_FILE_NAME) && c == '/')
+ /* [/] can never match. */
+ return FNM_NOMATCH;
+
+ if (c == '-' && *p != ']')
+ {
+ cend = *p++;
+ if (!(flags & FNM_NOESCAPE) && cend == '\\')
+ cend = *p++;
+ if (cend == '\0')
+ return FNM_NOMATCH;
+ cend = FOLD (cend);
+
+ c = *p++;
+ }
+
+ if (FOLD (*n) >= cstart && FOLD (*n) <= cend)
+ goto matched;
+
+ if (c == ']')
+ break;
+ }
+ if (!not)
+ return FNM_NOMATCH;
+ break;
+
+ matched:;
+ /* Skip the rest of the [...] that already matched. */
+ while (c != ']')
+ {
+ if (c == '\0')
+ /* [... (unterminated) loses. */
+ return FNM_NOMATCH;
+
+ c = *p++;
+ if (!(flags & FNM_NOESCAPE) && c == '\\')
+ /* XXX 1003.2d11 is unclear if this is right. */
+ ++p;
+ }
+ if (not)
+ return FNM_NOMATCH;
+ }
+ break;
+
+ default:
+ if (c != FOLD (*n))
+ return FNM_NOMATCH;
+ }
+
+ ++n;
+ }
+
+ if (*n == '\0')
+ return 0;
+
+ if ((flags & FNM_LEADING_DIR) && *n == '/')
+ /* The FNM_LEADING_DIR flag says that "foo*" matches "foobar/frobozz". */
+ return 0;
+
+ return FNM_NOMATCH;
+
+# undef FOLD
+}
+
+#endif /* _LIBC or not __GNU_LIBRARY__. */
diff --git a/lib/fnmatch.h b/lib/fnmatch.h
new file mode 100644
index 0000000..af1dcf5
--- /dev/null
+++ b/lib/fnmatch.h
@@ -0,0 +1,69 @@
+/* Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
+
+NOTE: The canonical source of this file is maintained with the GNU C Library.
+Bugs can be reported to bug-glibc@prep.ai.mit.edu.
+
+This program is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software Foundation,
+Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifndef _FNMATCH_H
+
+#define _FNMATCH_H 1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if defined (__cplusplus) || (defined (__STDC__) && __STDC__)
+#undef __P
+#define __P(protos) protos
+#else /* Not C++ or ANSI C. */
+#undef __P
+#define __P(protos) ()
+/* We can get away without defining `const' here only because in this file
+ it is used only inside the prototype for `fnmatch', which is elided in
+ non-ANSI C where `const' is problematical. */
+#endif /* C++ or ANSI C. */
+
+
+/* We #undef these before defining them because some losing systems
+ (HP-UX A.08.07 for example) define these in <unistd.h>. */
+#undef FNM_PATHNAME
+#undef FNM_NOESCAPE
+#undef FNM_PERIOD
+
+/* Bits set in the FLAGS argument to `fnmatch'. */
+#define FNM_PATHNAME (1 << 0) /* No wildcard can ever match `/'. */
+#define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */
+#define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */
+
+#if !defined (_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined (_GNU_SOURCE)
+#define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */
+#define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */
+#define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */
+#endif
+
+/* Value returned by `fnmatch' if STRING does not match PATTERN. */
+#define FNM_NOMATCH 1
+
+/* Match STRING against the filename pattern PATTERN,
+ returning zero if it matches, FNM_NOMATCH if not. */
+extern int fnmatch __P ((const char *__pattern, const char *__string,
+ int __flags));
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* fnmatch.h */
diff --git a/lib/getopt.c b/lib/getopt.c
new file mode 100644
index 0000000..7da985f
--- /dev/null
+++ b/lib/getopt.c
@@ -0,0 +1,1052 @@
+/* Getopt for GNU.
+ NOTE: getopt is now part of the C library, so if you don't know what
+ "Keep this file name-space clean" means, talk to drepper@gnu.org
+ before changing it!
+
+ Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98
+ Free Software Foundation, Inc.
+
+ NOTE: The canonical source of this file is maintained with the GNU C Library.
+ Bugs can be reported to bug-glibc@prep.ai.mit.edu.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation; either version 2, or (at your option) any
+ later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ USA. */
+
+/* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>.
+ Ditto for AIX 3.2 and <stdlib.h>. */
+#ifndef _NO_PROTO
+# define _NO_PROTO
+#endif
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if !defined __STDC__ || !__STDC__
+/* This is a separate conditional since some stdc systems
+ reject `defined (const)'. */
+# ifndef const
+# define const
+# endif
+#endif
+
+#include <stdio.h>
+
+/* Comment out all this code if we are using the GNU C Library, and are not
+ actually compiling the library itself. This code is part of the GNU C
+ Library, but also included in many other GNU distributions. Compiling
+ and linking in this code is a waste when using the GNU C library
+ (especially if it is a shared library). Rather than having every GNU
+ program understand `configure --with-gnu-libc' and omit the object files,
+ it is simpler to just do this in the source for each such file. */
+
+#define GETOPT_INTERFACE_VERSION 2
+#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2
+# include <gnu-versions.h>
+# if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION
+# define ELIDE_CODE
+# endif
+#endif
+
+#ifndef ELIDE_CODE
+
+
+/* This needs to come after some library #include
+ to get __GNU_LIBRARY__ defined. */
+#ifdef __GNU_LIBRARY__
+/* Don't include stdlib.h for non-GNU C libraries because some of them
+ contain conflicting prototypes for getopt. */
+# include <stdlib.h>
+# include <unistd.h>
+#endif /* GNU C library. */
+
+#ifdef VMS
+# include <unixlib.h>
+# if HAVE_STRING_H - 0
+# include <string.h>
+# endif
+#endif
+
+#ifndef _
+/* This is for other GNU distributions with internationalized messages.
+ When compiling libc, the _ macro is predefined. */
+# ifdef HAVE_LIBINTL_H
+# include <libintl.h>
+# define _(msgid) gettext (msgid)
+# else
+# define _(msgid) (msgid)
+# endif
+#endif
+
+/* This version of `getopt' appears to the caller like standard Unix `getopt'
+ but it behaves differently for the user, since it allows the user
+ to intersperse the options with the other arguments.
+
+ As `getopt' works, it permutes the elements of ARGV so that,
+ when it is done, all the options precede everything else. Thus
+ all application programs are extended to handle flexible argument order.
+
+ Setting the environment variable POSIXLY_CORRECT disables permutation.
+ Then the behavior is completely standard.
+
+ GNU application programs can use a third alternative mode in which
+ they can distinguish the relative order of options and other arguments. */
+
+#include "getopt.h"
+
+/* For communication from `getopt' to the caller.
+ When `getopt' finds an option that takes an argument,
+ the argument value is returned here.
+ Also, when `ordering' is RETURN_IN_ORDER,
+ each non-option ARGV-element is returned here. */
+
+char *optarg = NULL;
+
+/* Index in ARGV of the next element to be scanned.
+ This is used for communication to and from the caller
+ and for communication between successive calls to `getopt'.
+
+ On entry to `getopt', zero means this is the first call; initialize.
+
+ When `getopt' returns -1, this is the index of the first of the
+ non-option elements that the caller should itself scan.
+
+ Otherwise, `optind' communicates from one call to the next
+ how much of ARGV has been scanned so far. */
+
+/* 1003.2 says this must be 1 before any call. */
+int optind = 1;
+
+/* Formerly, initialization of getopt depended on optind==0, which
+ causes problems with re-calling getopt as programs generally don't
+ know that. */
+
+int __getopt_initialized = 0;
+
+/* The next char to be scanned in the option-element
+ in which the last option character we returned was found.
+ This allows us to pick up the scan where we left off.
+
+ If this is zero, or a null string, it means resume the scan
+ by advancing to the next ARGV-element. */
+
+static char *nextchar;
+
+/* Callers store zero here to inhibit the error message
+ for unrecognized options. */
+
+int opterr = 1;
+
+/* Set to an option character which was unrecognized.
+ This must be initialized on some systems to avoid linking in the
+ system's own getopt implementation. */
+
+int optopt = '?';
+
+/* Describe how to deal with options that follow non-option ARGV-elements.
+
+ If the caller did not specify anything,
+ the default is REQUIRE_ORDER if the environment variable
+ POSIXLY_CORRECT is defined, PERMUTE otherwise.
+
+ REQUIRE_ORDER means don't recognize them as options;
+ stop option processing when the first non-option is seen.
+ This is what Unix does.
+ This mode of operation is selected by either setting the environment
+ variable POSIXLY_CORRECT, or using `+' as the first character
+ of the list of option characters.
+
+ PERMUTE is the default. We permute the contents of ARGV as we scan,
+ so that eventually all the non-options are at the end. This allows options
+ to be given in any order, even with programs that were not written to
+ expect this.
+
+ RETURN_IN_ORDER is an option available to programs that were written
+ to expect options and other ARGV-elements in any order and that care about
+ the ordering of the two. We describe each non-option ARGV-element
+ as if it were the argument of an option with character code 1.
+ Using `-' as the first character of the list of option characters
+ selects this mode of operation.
+
+ The special argument `--' forces an end of option-scanning regardless
+ of the value of `ordering'. In the case of RETURN_IN_ORDER, only
+ `--' can cause `getopt' to return -1 with `optind' != ARGC. */
+
+static enum
+{
+ REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER
+} ordering;
+
+/* Value of POSIXLY_CORRECT environment variable. */
+static char *posixly_correct;
+
+#ifdef __GNU_LIBRARY__
+/* We want to avoid inclusion of string.h with non-GNU libraries
+ because there are many ways it can cause trouble.
+ On some systems, it contains special magic macros that don't work
+ in GCC. */
+# include <string.h>
+# define my_index strchr
+#else
+
+# if HAVE_STRING_H
+# include <string.h>
+# else
+# include <strings.h>
+# endif
+
+/* Avoid depending on library functions or files
+ whose names are inconsistent. */
+
+#ifndef getenv
+extern char *getenv ();
+#endif
+
+static char *
+my_index (str, chr)
+ const char *str;
+ int chr;
+{
+ while (*str)
+ {
+ if (*str == chr)
+ return (char *) str;
+ str++;
+ }
+ return 0;
+}
+
+/* If using GCC, we can safely declare strlen this way.
+ If not using GCC, it is ok not to declare it. */
+#ifdef __GNUC__
+/* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h.
+ That was relevant to code that was here before. */
+# if (!defined __STDC__ || !__STDC__) && !defined strlen
+/* gcc with -traditional declares the built-in strlen to return int,
+ and has done so at least since version 2.4.5. -- rms. */
+extern int strlen (const char *);
+# endif /* not __STDC__ */
+#endif /* __GNUC__ */
+
+#endif /* not __GNU_LIBRARY__ */
+
+/* Handle permutation of arguments. */
+
+/* Describe the part of ARGV that contains non-options that have
+ been skipped. `first_nonopt' is the index in ARGV of the first of them;
+ `last_nonopt' is the index after the last of them. */
+
+static int first_nonopt;
+static int last_nonopt;
+
+#ifdef _LIBC
+/* Bash 2.0 gives us an environment variable containing flags
+ indicating ARGV elements that should not be considered arguments. */
+
+/* Defined in getopt_init.c */
+extern char *__getopt_nonoption_flags;
+
+static int nonoption_flags_max_len;
+static int nonoption_flags_len;
+
+static int original_argc;
+static char *const *original_argv;
+
+/* Make sure the environment variable bash 2.0 puts in the environment
+ is valid for the getopt call we must make sure that the ARGV passed
+ to getopt is that one passed to the process. */
+static void
+__attribute__ ((unused))
+store_args_and_env (int argc, char *const *argv)
+{
+ /* XXX This is no good solution. We should rather copy the args so
+ that we can compare them later. But we must not use malloc(3). */
+ original_argc = argc;
+ original_argv = argv;
+}
+# ifdef text_set_element
+text_set_element (__libc_subinit, store_args_and_env);
+# endif /* text_set_element */
+
+# define SWAP_FLAGS(ch1, ch2) \
+ if (nonoption_flags_len > 0) \
+ { \
+ char __tmp = __getopt_nonoption_flags[ch1]; \
+ __getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2]; \
+ __getopt_nonoption_flags[ch2] = __tmp; \
+ }
+#else /* !_LIBC */
+# define SWAP_FLAGS(ch1, ch2)
+#endif /* _LIBC */
+
+/* Exchange two adjacent subsequences of ARGV.
+ One subsequence is elements [first_nonopt,last_nonopt)
+ which contains all the non-options that have been skipped so far.
+ The other is elements [last_nonopt,optind), which contains all
+ the options processed since those non-options were skipped.
+
+ `first_nonopt' and `last_nonopt' are relocated so that they describe
+ the new indices of the non-options in ARGV after they are moved. */
+
+#if defined __STDC__ && __STDC__
+static void exchange (char **);
+#endif
+
+static void
+exchange (argv)
+ char **argv;
+{
+ int bottom = first_nonopt;
+ int middle = last_nonopt;
+ int top = optind;
+ char *tem;
+
+ /* Exchange the shorter segment with the far end of the longer segment.
+ That puts the shorter segment into the right place.
+ It leaves the longer segment in the right place overall,
+ but it consists of two parts that need to be swapped next. */
+
+#ifdef _LIBC
+ /* First make sure the handling of the `__getopt_nonoption_flags'
+ string can work normally. Our top argument must be in the range
+ of the string. */
+ if (nonoption_flags_len > 0 && top >= nonoption_flags_max_len)
+ {
+ /* We must extend the array. The user plays games with us and
+ presents new arguments. */
+ char *new_str = malloc (top + 1);
+ if (new_str == NULL)
+ nonoption_flags_len = nonoption_flags_max_len = 0;
+ else
+ {
+ memset (__mempcpy (new_str, __getopt_nonoption_flags,
+ nonoption_flags_max_len),
+ '\0', top + 1 - nonoption_flags_max_len);
+ nonoption_flags_max_len = top + 1;
+ __getopt_nonoption_flags = new_str;
+ }
+ }
+#endif
+
+ while (top > middle && middle > bottom)
+ {
+ if (top - middle > middle - bottom)
+ {
+ /* Bottom segment is the short one. */
+ int len = middle - bottom;
+ register int i;
+
+ /* Swap it with the top part of the top segment. */
+ for (i = 0; i < len; i++)
+ {
+ tem = argv[bottom + i];
+ argv[bottom + i] = argv[top - (middle - bottom) + i];
+ argv[top - (middle - bottom) + i] = tem;
+ SWAP_FLAGS (bottom + i, top - (middle - bottom) + i);
+ }
+ /* Exclude the moved bottom segment from further swapping. */
+ top -= len;
+ }
+ else
+ {
+ /* Top segment is the short one. */
+ int len = top - middle;
+ register int i;
+
+ /* Swap it with the bottom part of the bottom segment. */
+ for (i = 0; i < len; i++)
+ {
+ tem = argv[bottom + i];
+ argv[bottom + i] = argv[middle + i];
+ argv[middle + i] = tem;
+ SWAP_FLAGS (bottom + i, middle + i);
+ }
+ /* Exclude the moved top segment from further swapping. */
+ bottom += len;
+ }
+ }
+
+ /* Update records for the slots the non-options now occupy. */
+
+ first_nonopt += (optind - last_nonopt);
+ last_nonopt = optind;
+}
+
+/* Initialize the internal data when the first call is made. */
+
+#if defined __STDC__ && __STDC__
+static const char *_getopt_initialize (int, char *const *, const char *);
+#endif
+static const char *
+_getopt_initialize (argc, argv, optstring)
+ int argc;
+ char *const *argv;
+ const char *optstring;
+{
+ /* Start processing options with ARGV-element 1 (since ARGV-element 0
+ is the program name); the sequence of previously skipped
+ non-option ARGV-elements is empty. */
+
+ first_nonopt = last_nonopt = optind;
+
+ nextchar = NULL;
+
+ posixly_correct = getenv ("POSIXLY_CORRECT");
+
+ /* Determine how to handle the ordering of options and nonoptions. */
+
+ if (optstring[0] == '-')
+ {
+ ordering = RETURN_IN_ORDER;
+ ++optstring;
+ }
+ else if (optstring[0] == '+')
+ {
+ ordering = REQUIRE_ORDER;
+ ++optstring;
+ }
+ else if (posixly_correct != NULL)
+ ordering = REQUIRE_ORDER;
+ else
+ ordering = PERMUTE;
+
+#ifdef _LIBC
+ if (posixly_correct == NULL
+ && argc == original_argc && argv == original_argv)
+ {
+ if (nonoption_flags_max_len == 0)
+ {
+ if (__getopt_nonoption_flags == NULL
+ || __getopt_nonoption_flags[0] == '\0')
+ nonoption_flags_max_len = -1;
+ else
+ {
+ const char *orig_str = __getopt_nonoption_flags;
+ int len = nonoption_flags_max_len = strlen (orig_str);
+ if (nonoption_flags_max_len < argc)
+ nonoption_flags_max_len = argc;
+ __getopt_nonoption_flags =
+ (char *) malloc (nonoption_flags_max_len);
+ if (__getopt_nonoption_flags == NULL)
+ nonoption_flags_max_len = -1;
+ else
+ memset (__mempcpy (__getopt_nonoption_flags, orig_str, len),
+ '\0', nonoption_flags_max_len - len);
+ }
+ }
+ nonoption_flags_len = nonoption_flags_max_len;
+ }
+ else
+ nonoption_flags_len = 0;
+#endif
+
+ return optstring;
+}
+
+/* Scan elements of ARGV (whose length is ARGC) for option characters
+ given in OPTSTRING.
+
+ If an element of ARGV starts with '-', and is not exactly "-" or "--",
+ then it is an option element. The characters of this element
+ (aside from the initial '-') are option characters. If `getopt'
+ is called repeatedly, it returns successively each of the option characters
+ from each of the option elements.
+
+ If `getopt' finds another option character, it returns that character,
+ updating `optind' and `nextchar' so that the next call to `getopt' can
+ resume the scan with the following option character or ARGV-element.
+
+ If there are no more option characters, `getopt' returns -1.
+ Then `optind' is the index in ARGV of the first ARGV-element
+ that is not an option. (The ARGV-elements have been permuted
+ so that those that are not options now come last.)
+
+ OPTSTRING is a string containing the legitimate option characters.
+ If an option character is seen that is not listed in OPTSTRING,
+ return '?' after printing an error message. If you set `opterr' to
+ zero, the error message is suppressed but we still return '?'.
+
+ If a char in OPTSTRING is followed by a colon, that means it wants an arg,
+ so the following text in the same ARGV-element, or the text of the following
+ ARGV-element, is returned in `optarg'. Two colons mean an option that
+ wants an optional arg; if there is text in the current ARGV-element,
+ it is returned in `optarg', otherwise `optarg' is set to zero.
+
+ If OPTSTRING starts with `-' or `+', it requests different methods of
+ handling the non-option ARGV-elements.
+ See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above.
+
+ Long-named options begin with `--' instead of `-'.
+ Their names may be abbreviated as long as the abbreviation is unique
+ or is an exact match for some defined option. If they have an
+ argument, it follows the option name in the same ARGV-element, separated
+ from the option name by a `=', or else the in next ARGV-element.
+ When `getopt' finds a long-named option, it returns 0 if that option's
+ `flag' field is nonzero, the value of the option's `val' field
+ if the `flag' field is zero.
+
+ The elements of ARGV aren't really const, because we permute them.
+ But we pretend they're const in the prototype to be compatible
+ with other systems.
+
+ LONGOPTS is a vector of `struct option' terminated by an
+ element containing a name which is zero.
+
+ LONGIND returns the index in LONGOPT of the long-named option found.
+ It is only valid when a long-named option has been found by the most
+ recent call.
+
+ If LONG_ONLY is nonzero, '-' as well as '--' can introduce
+ long-named options. */
+
+int
+_getopt_internal (argc, argv, optstring, longopts, longind, long_only)
+ int argc;
+ char *const *argv;
+ const char *optstring;
+ const struct option *longopts;
+ int *longind;
+ int long_only;
+{
+ optarg = NULL;
+
+ if (optind == 0 || !__getopt_initialized)
+ {
+ if (optind == 0)
+ optind = 1; /* Don't scan ARGV[0], the program name. */
+ optstring = _getopt_initialize (argc, argv, optstring);
+ __getopt_initialized = 1;
+ }
+
+ /* Test whether ARGV[optind] points to a non-option argument.
+ Either it does not have option syntax, or there is an environment flag
+ from the shell indicating it is not an option. The later information
+ is only used when the used in the GNU libc. */
+#ifdef _LIBC
+# define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \
+ || (optind < nonoption_flags_len \
+ && __getopt_nonoption_flags[optind] == '1'))
+#else
+# define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0')
+#endif
+
+ if (nextchar == NULL || *nextchar == '\0')
+ {
+ /* Advance to the next ARGV-element. */
+
+ /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been
+ moved back by the user (who may also have changed the arguments). */
+ if (last_nonopt > optind)
+ last_nonopt = optind;
+ if (first_nonopt > optind)
+ first_nonopt = optind;
+
+ if (ordering == PERMUTE)
+ {
+ /* If we have just processed some options following some non-options,
+ exchange them so that the options come first. */
+
+ if (first_nonopt != last_nonopt && last_nonopt != optind)
+ exchange ((char **) argv);
+ else if (last_nonopt != optind)
+ first_nonopt = optind;
+
+ /* Skip any additional non-options
+ and extend the range of non-options previously skipped. */
+
+ while (optind < argc && NONOPTION_P)
+ optind++;
+ last_nonopt = optind;
+ }
+
+ /* The special ARGV-element `--' means premature end of options.
+ Skip it like a null option,
+ then exchange with previous non-options as if it were an option,
+ then skip everything else like a non-option. */
+
+ if (optind != argc && !strcmp (argv[optind], "--"))
+ {
+ optind++;
+
+ if (first_nonopt != last_nonopt && last_nonopt != optind)
+ exchange ((char **) argv);
+ else if (first_nonopt == last_nonopt)
+ first_nonopt = optind;
+ last_nonopt = argc;
+
+ optind = argc;
+ }
+
+ /* If we have done all the ARGV-elements, stop the scan
+ and back over any non-options that we skipped and permuted. */
+
+ if (optind == argc)
+ {
+ /* Set the next-arg-index to point at the non-options
+ that we previously skipped, so the caller will digest them. */
+ if (first_nonopt != last_nonopt)
+ optind = first_nonopt;
+ return -1;
+ }
+
+ /* If we have come to a non-option and did not permute it,
+ either stop the scan or describe it to the caller and pass it by. */
+
+ if (NONOPTION_P)
+ {
+ if (ordering == REQUIRE_ORDER)
+ return -1;
+ optarg = argv[optind++];
+ return 1;
+ }
+
+ /* We have found another option-ARGV-element.
+ Skip the initial punctuation. */
+
+ nextchar = (argv[optind] + 1
+ + (longopts != NULL && argv[optind][1] == '-'));
+ }
+
+ /* Decode the current option-ARGV-element. */
+
+ /* Check whether the ARGV-element is a long option.
+
+ If long_only and the ARGV-element has the form "-f", where f is
+ a valid short option, don't consider it an abbreviated form of
+ a long option that starts with f. Otherwise there would be no
+ way to give the -f short option.
+
+ On the other hand, if there's a long option "fubar" and
+ the ARGV-element is "-fu", do consider that an abbreviation of
+ the long option, just like "--fu", and not "-f" with arg "u".
+
+ This distinction seems to be the most useful approach. */
+
+ if (longopts != NULL
+ && (argv[optind][1] == '-'
+ || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1])))))
+ {
+ char *nameend;
+ const struct option *p;
+ const struct option *pfound = NULL;
+ int exact = 0;
+ int ambig = 0;
+ int indfound = -1;
+ int option_index;
+
+ for (nameend = nextchar; *nameend && *nameend != '='; nameend++)
+ /* Do nothing. */ ;
+
+ /* Test all long options for either exact match
+ or abbreviated matches. */
+ for (p = longopts, option_index = 0; p->name; p++, option_index++)
+ if (!strncmp (p->name, nextchar, nameend - nextchar))
+ {
+ if ((unsigned int) (nameend - nextchar)
+ == (unsigned int) strlen (p->name))
+ {
+ /* Exact match found. */
+ pfound = p;
+ indfound = option_index;
+ exact = 1;
+ break;
+ }
+ else if (pfound == NULL)
+ {
+ /* First nonexact match found. */
+ pfound = p;
+ indfound = option_index;
+ }
+ else
+ /* Second or later nonexact match found. */
+ ambig = 1;
+ }
+
+ if (ambig && !exact)
+ {
+ if (opterr)
+ fprintf (stderr, _("%s: option `%s' is ambiguous\n"),
+ argv[0], argv[optind]);
+ nextchar += strlen (nextchar);
+ optind++;
+ optopt = 0;
+ return '?';
+ }
+
+ if (pfound != NULL)
+ {
+ option_index = indfound;
+ optind++;
+ if (*nameend)
+ {
+ /* Don't test has_arg with >, because some C compilers don't
+ allow it to be used on enums. */
+ if (pfound->has_arg)
+ optarg = nameend + 1;
+ else
+ {
+ if (opterr)
+ if (argv[optind - 1][1] == '-')
+ /* --option */
+ fprintf (stderr,
+ _("%s: option `--%s' doesn't allow an argument\n"),
+ argv[0], pfound->name);
+ else
+ /* +option or -option */
+ fprintf (stderr,
+ _("%s: option `%c%s' doesn't allow an argument\n"),
+ argv[0], argv[optind - 1][0], pfound->name);
+
+ nextchar += strlen (nextchar);
+
+ optopt = pfound->val;
+ return '?';
+ }
+ }
+ else if (pfound->has_arg == 1)
+ {
+ if (optind < argc)
+ optarg = argv[optind++];
+ else
+ {
+ if (opterr)
+ fprintf (stderr,
+ _("%s: option `%s' requires an argument\n"),
+ argv[0], argv[optind - 1]);
+ nextchar += strlen (nextchar);
+ optopt = pfound->val;
+ return optstring[0] == ':' ? ':' : '?';
+ }
+ }
+ nextchar += strlen (nextchar);
+ if (longind != NULL)
+ *longind = option_index;
+ if (pfound->flag)
+ {
+ *(pfound->flag) = pfound->val;
+ return 0;
+ }
+ return pfound->val;
+ }
+
+ /* Can't find it as a long option. If this is not getopt_long_only,
+ or the option starts with '--' or is not a valid short
+ option, then it's an error.
+ Otherwise interpret it as a short option. */
+ if (!long_only || argv[optind][1] == '-'
+ || my_index (optstring, *nextchar) == NULL)
+ {
+ if (opterr)
+ {
+ if (argv[optind][1] == '-')
+ /* --option */
+ fprintf (stderr, _("%s: unrecognized option `--%s'\n"),
+ argv[0], nextchar);
+ else
+ /* +option or -option */
+ fprintf (stderr, _("%s: unrecognized option `%c%s'\n"),
+ argv[0], argv[optind][0], nextchar);
+ }
+ nextchar = (char *) "";
+ optind++;
+ optopt = 0;
+ return '?';
+ }
+ }
+
+ /* Look at and handle the next short option-character. */
+
+ {
+ char c = *nextchar++;
+ char *temp = my_index (optstring, c);
+
+ /* Increment `optind' when we start to process its last character. */
+ if (*nextchar == '\0')
+ ++optind;
+
+ if (temp == NULL || c == ':')
+ {
+ if (opterr)
+ {
+ if (posixly_correct)
+ /* 1003.2 specifies the format of this message. */
+ fprintf (stderr, _("%s: illegal option -- %c\n"),
+ argv[0], c);
+ else
+ fprintf (stderr, _("%s: invalid option -- %c\n"),
+ argv[0], c);
+ }
+ optopt = c;
+ return '?';
+ }
+ /* Convenience. Treat POSIX -W foo same as long option --foo */
+ if (temp[0] == 'W' && temp[1] == ';')
+ {
+ char *nameend;
+ const struct option *p;
+ const struct option *pfound = NULL;
+ int exact = 0;
+ int ambig = 0;
+ int indfound = 0;
+ int option_index;
+
+ /* This is an option that requires an argument. */
+ if (*nextchar != '\0')
+ {
+ optarg = nextchar;
+ /* If we end this ARGV-element by taking the rest as an arg,
+ we must advance to the next element now. */
+ optind++;
+ }
+ else if (optind == argc)
+ {
+ if (opterr)
+ {
+ /* 1003.2 specifies the format of this message. */
+ fprintf (stderr, _("%s: option requires an argument -- %c\n"),
+ argv[0], c);
+ }
+ optopt = c;
+ if (optstring[0] == ':')
+ c = ':';
+ else
+ c = '?';
+ return c;
+ }
+ else
+ /* We already incremented `optind' once;
+ increment it again when taking next ARGV-elt as argument. */
+ optarg = argv[optind++];
+
+ /* optarg is now the argument, see if it's in the
+ table of longopts. */
+
+ for (nextchar = nameend = optarg; *nameend && *nameend != '='; nameend++)
+ /* Do nothing. */ ;
+
+ /* Test all long options for either exact match
+ or abbreviated matches. */
+ for (p = longopts, option_index = 0; p->name; p++, option_index++)
+ if (!strncmp (p->name, nextchar, nameend - nextchar))
+ {
+ if ((unsigned int) (nameend - nextchar) == strlen (p->name))
+ {
+ /* Exact match found. */
+ pfound = p;
+ indfound = option_index;
+ exact = 1;
+ break;
+ }
+ else if (pfound == NULL)
+ {
+ /* First nonexact match found. */
+ pfound = p;
+ indfound = option_index;
+ }
+ else
+ /* Second or later nonexact match found. */
+ ambig = 1;
+ }
+ if (ambig && !exact)
+ {
+ if (opterr)
+ fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"),
+ argv[0], argv[optind]);
+ nextchar += strlen (nextchar);
+ optind++;
+ return '?';
+ }
+ if (pfound != NULL)
+ {
+ option_index = indfound;
+ if (*nameend)
+ {
+ /* Don't test has_arg with >, because some C compilers don't
+ allow it to be used on enums. */
+ if (pfound->has_arg)
+ optarg = nameend + 1;
+ else
+ {
+ if (opterr)
+ fprintf (stderr, _("\
+%s: option `-W %s' doesn't allow an argument\n"),
+ argv[0], pfound->name);
+
+ nextchar += strlen (nextchar);
+ return '?';
+ }
+ }
+ else if (pfound->has_arg == 1)
+ {
+ if (optind < argc)
+ optarg = argv[optind++];
+ else
+ {
+ if (opterr)
+ fprintf (stderr,
+ _("%s: option `%s' requires an argument\n"),
+ argv[0], argv[optind - 1]);
+ nextchar += strlen (nextchar);
+ return optstring[0] == ':' ? ':' : '?';
+ }
+ }
+ nextchar += strlen (nextchar);
+ if (longind != NULL)
+ *longind = option_index;
+ if (pfound->flag)
+ {
+ *(pfound->flag) = pfound->val;
+ return 0;
+ }
+ return pfound->val;
+ }
+ nextchar = NULL;
+ return 'W'; /* Let the application handle it. */
+ }
+ if (temp[1] == ':')
+ {
+ if (temp[2] == ':')
+ {
+ /* This is an option that accepts an argument optionally. */
+ if (*nextchar != '\0')
+ {
+ optarg = nextchar;
+ optind++;
+ }
+ else
+ optarg = NULL;
+ nextchar = NULL;
+ }
+ else
+ {
+ /* This is an option that requires an argument. */
+ if (*nextchar != '\0')
+ {
+ optarg = nextchar;
+ /* If we end this ARGV-element by taking the rest as an arg,
+ we must advance to the next element now. */
+ optind++;
+ }
+ else if (optind == argc)
+ {
+ if (opterr)
+ {
+ /* 1003.2 specifies the format of this message. */
+ fprintf (stderr,
+ _("%s: option requires an argument -- %c\n"),
+ argv[0], c);
+ }
+ optopt = c;
+ if (optstring[0] == ':')
+ c = ':';
+ else
+ c = '?';
+ }
+ else
+ /* We already incremented `optind' once;
+ increment it again when taking next ARGV-elt as argument. */
+ optarg = argv[optind++];
+ nextchar = NULL;
+ }
+ }
+ return c;
+ }
+}
+
+int
+getopt (argc, argv, optstring)
+ int argc;
+ char *const *argv;
+ const char *optstring;
+{
+ return _getopt_internal (argc, argv, optstring,
+ (const struct option *) 0,
+ (int *) 0,
+ 0);
+}
+
+#endif /* Not ELIDE_CODE. */
+
+#ifdef TEST
+
+/* Compile with -DTEST to make an executable for use in testing
+ the above definition of `getopt'. */
+
+int
+main (argc, argv)
+ int argc;
+ char **argv;
+{
+ int c;
+ int digit_optind = 0;
+
+ while (1)
+ {
+ int this_option_optind = optind ? optind : 1;
+
+ c = getopt (argc, argv, "abc:d:0123456789");
+ if (c == -1)
+ break;
+
+ switch (c)
+ {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ if (digit_optind != 0 && digit_optind != this_option_optind)
+ printf ("digits occur in two different argv-elements.\n");
+ digit_optind = this_option_optind;
+ printf ("option %c\n", c);
+ break;
+
+ case 'a':
+ printf ("option a\n");
+ break;
+
+ case 'b':
+ printf ("option b\n");
+ break;
+
+ case 'c':
+ printf ("option c with value `%s'\n", optarg);
+ break;
+
+ case '?':
+ break;
+
+ default:
+ printf ("?? getopt returned character code 0%o ??\n", c);
+ }
+ }
+
+ if (optind < argc)
+ {
+ printf ("non-option ARGV-elements: ");
+ while (optind < argc)
+ printf ("%s ", argv[optind++]);
+ printf ("\n");
+ }
+
+ exit (0);
+}
+
+#endif /* TEST */
diff --git a/lib/getopt.h b/lib/getopt.h
new file mode 100644
index 0000000..c4adc30
--- /dev/null
+++ b/lib/getopt.h
@@ -0,0 +1,133 @@
+/* Declarations for getopt.
+ Copyright (C) 1989,90,91,92,93,94,96,97 Free Software Foundation, Inc.
+
+ NOTE: The canonical source of this file is maintained with the GNU C Library.
+ Bugs can be reported to bug-glibc@prep.ai.mit.edu.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation; either version 2, or (at your option) any
+ later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ USA. */
+
+#ifndef _GETOPT_H
+#define _GETOPT_H 1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* For communication from `getopt' to the caller.
+ When `getopt' finds an option that takes an argument,
+ the argument value is returned here.
+ Also, when `ordering' is RETURN_IN_ORDER,
+ each non-option ARGV-element is returned here. */
+
+extern char *optarg;
+
+/* Index in ARGV of the next element to be scanned.
+ This is used for communication to and from the caller
+ and for communication between successive calls to `getopt'.
+
+ On entry to `getopt', zero means this is the first call; initialize.
+
+ When `getopt' returns -1, this is the index of the first of the
+ non-option elements that the caller should itself scan.
+
+ Otherwise, `optind' communicates from one call to the next
+ how much of ARGV has been scanned so far. */
+
+extern int optind;
+
+/* Callers store zero here to inhibit the error message `getopt' prints
+ for unrecognized options. */
+
+extern int opterr;
+
+/* Set to an option character which was unrecognized. */
+
+extern int optopt;
+
+/* Describe the long-named options requested by the application.
+ The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
+ of `struct option' terminated by an element containing a name which is
+ zero.
+
+ The field `has_arg' is:
+ no_argument (or 0) if the option does not take an argument,
+ required_argument (or 1) if the option requires an argument,
+ optional_argument (or 2) if the option takes an optional argument.
+
+ If the field `flag' is not NULL, it points to a variable that is set
+ to the value given in the field `val' when the option is found, but
+ left unchanged if the option is not found.
+
+ To have a long-named option do something other than set an `int' to
+ a compiled-in constant, such as set a value from `optarg', set the
+ option's `flag' field to zero and its `val' field to a nonzero
+ value (the equivalent single-letter option character, if there is
+ one). For long options that have a zero `flag' field, `getopt'
+ returns the contents of the `val' field. */
+
+struct option
+{
+#if defined (__STDC__) && __STDC__
+ const char *name;
+#else
+ char *name;
+#endif
+ /* has_arg can't be an enum because some compilers complain about
+ type mismatches in all the code that assumes it is an int. */
+ int has_arg;
+ int *flag;
+ int val;
+};
+
+/* Names for the values of the `has_arg' field of `struct option'. */
+
+#define no_argument 0
+#define required_argument 1
+#define optional_argument 2
+
+#if defined (__STDC__) && __STDC__
+#ifdef __GNU_LIBRARY__
+/* Many other libraries have conflicting prototypes for getopt, with
+ differences in the consts, in stdlib.h. To avoid compilation
+ errors, only prototype getopt for the GNU C library. */
+extern int getopt (int argc, char *const *argv, const char *shortopts);
+#else /* not __GNU_LIBRARY__ */
+extern int getopt ();
+#endif /* __GNU_LIBRARY__ */
+extern int getopt_long (int argc, char *const *argv, const char *shortopts,
+ const struct option *longopts, int *longind);
+extern int getopt_long_only (int argc, char *const *argv,
+ const char *shortopts,
+ const struct option *longopts, int *longind);
+
+/* Internal only. Users should not call this directly. */
+extern int _getopt_internal (int argc, char *const *argv,
+ const char *shortopts,
+ const struct option *longopts, int *longind,
+ int long_only);
+#else /* not __STDC__ */
+extern int getopt ();
+extern int getopt_long ();
+extern int getopt_long_only ();
+
+extern int _getopt_internal ();
+#endif /* __STDC__ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* getopt.h */
diff --git a/lib/getopt1.c b/lib/getopt1.c
new file mode 100644
index 0000000..4ce1065
--- /dev/null
+++ b/lib/getopt1.c
@@ -0,0 +1,190 @@
+/* getopt_long and getopt_long_only entry points for GNU getopt.
+ Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98
+ Free Software Foundation, Inc.
+
+ NOTE: The canonical source of this file is maintained with the GNU C Library.
+ Bugs can be reported to bug-glibc@prep.ai.mit.edu.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation; either version 2, or (at your option) any
+ later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ USA. */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "getopt.h"
+
+#if !defined __STDC__ || !__STDC__
+/* This is a separate conditional since some stdc systems
+ reject `defined (const)'. */
+#ifndef const
+#define const
+#endif
+#endif
+
+#include <stdio.h>
+
+/* Comment out all this code if we are using the GNU C Library, and are not
+ actually compiling the library itself. This code is part of the GNU C
+ Library, but also included in many other GNU distributions. Compiling
+ and linking in this code is a waste when using the GNU C library
+ (especially if it is a shared library). Rather than having every GNU
+ program understand `configure --with-gnu-libc' and omit the object files,
+ it is simpler to just do this in the source for each such file. */
+
+#define GETOPT_INTERFACE_VERSION 2
+#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2
+#include <gnu-versions.h>
+#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION
+#define ELIDE_CODE
+#endif
+#endif
+
+#ifndef ELIDE_CODE
+
+
+/* This needs to come after some library #include
+ to get __GNU_LIBRARY__ defined. */
+#ifdef __GNU_LIBRARY__
+#include <stdlib.h>
+#endif
+
+#ifndef NULL
+#define NULL 0
+#endif
+
+int
+getopt_long (argc, argv, options, long_options, opt_index)
+ int argc;
+ char *const *argv;
+ const char *options;
+ const struct option *long_options;
+ int *opt_index;
+{
+ return _getopt_internal (argc, argv, options, long_options, opt_index, 0);
+}
+
+/* Like getopt_long, but '-' as well as '--' can indicate a long option.
+ If an option that starts with '-' (not '--') doesn't match a long option,
+ but does match a short option, it is parsed as a short option
+ instead. */
+
+int
+getopt_long_only (argc, argv, options, long_options, opt_index)
+ int argc;
+ char *const *argv;
+ const char *options;
+ const struct option *long_options;
+ int *opt_index;
+{
+ return _getopt_internal (argc, argv, options, long_options, opt_index, 1);
+}
+
+
+#endif /* Not ELIDE_CODE. */
+
+#ifdef TEST
+
+#include <stdio.h>
+
+int
+main (argc, argv)
+ int argc;
+ char **argv;
+{
+ int c;
+ int digit_optind = 0;
+
+ while (1)
+ {
+ int this_option_optind = optind ? optind : 1;
+ int option_index = 0;
+ static struct option long_options[] =
+ {
+ {"add", 1, 0, 0},
+ {"append", 0, 0, 0},
+ {"delete", 1, 0, 0},
+ {"verbose", 0, 0, 0},
+ {"create", 0, 0, 0},
+ {"file", 1, 0, 0},
+ {0, 0, 0, 0}
+ };
+
+ c = getopt_long (argc, argv, "abc:d:0123456789",
+ long_options, &option_index);
+ if (c == -1)
+ break;
+
+ switch (c)
+ {
+ case 0:
+ printf ("option %s", long_options[option_index].name);
+ if (optarg)
+ printf (" with arg %s", optarg);
+ printf ("\n");
+ break;
+
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ if (digit_optind != 0 && digit_optind != this_option_optind)
+ printf ("digits occur in two different argv-elements.\n");
+ digit_optind = this_option_optind;
+ printf ("option %c\n", c);
+ break;
+
+ case 'a':
+ printf ("option a\n");
+ break;
+
+ case 'b':
+ printf ("option b\n");
+ break;
+
+ case 'c':
+ printf ("option c with value `%s'\n", optarg);
+ break;
+
+ case 'd':
+ printf ("option d with value `%s'\n", optarg);
+ break;
+
+ case '?':
+ break;
+
+ default:
+ printf ("?? getopt returned character code 0%o ??\n", c);
+ }
+ }
+
+ if (optind < argc)
+ {
+ printf ("non-option ARGV-elements: ");
+ while (optind < argc)
+ printf ("%s ", argv[optind++]);
+ printf ("\n");
+ }
+
+ exit (0);
+}
+
+#endif /* TEST */
diff --git a/lib/getpass.c b/lib/getpass.c
new file mode 100644
index 0000000..f075d3b
--- /dev/null
+++ b/lib/getpass.c
@@ -0,0 +1,205 @@
+/*
+ * For license terms, see the file COPYING in this directory.
+ */
+
+/***********************************************************************
+ module: getpass.c
+ project: fetchmail
+ programmer: Carl Harris, ceharris@mal.com
+ description: getpass() replacement which allows for long passwords.
+ This version hacked by Wilfred Teiken, allowing the
+ password to be piped to fetchmail.
+
+ ***********************************************************************/
+
+#include "config.h"
+
+#include <stdio.h>
+#include <signal.h>
+#include <fcntl.h>
+#if defined(HAVE_UNISTD_H)
+#include <unistd.h>
+#endif
+#if defined(HAVE_STDLIB_H)
+#include <stdlib.h>
+#endif
+#include "i18n.h"
+#include "getpass.h"
+
+#define INPUT_BUF_SIZE PASSWORDLEN
+
+#if defined(HAVE_TERMIOS_H) && defined(HAVE_TCSETATTR)
+# include <termios.h>
+#else
+#if defined(HAVE_TERMIO_H)
+# include <sys/ioctl.h>
+# include <termio.h>
+#else
+#if defined(HAVE_SGTTY_H)
+# include <sgtty.h>
+#endif
+#endif
+#endif
+
+static int ttyfd;
+
+#if defined(HAVE_TCSETATTR)
+ static struct termios termb;
+ static tcflag_t flags;
+#else
+#if defined(HAVE_TERMIO_H)
+ static struct termio termb;
+ static unsigned short flags;
+#else
+#if defined(HAVE_STTY)
+ static struct sgttyb ttyb;
+ static int flags;
+#endif
+#endif
+#endif
+
+void static save_tty_state(void);
+void static disable_tty_echo(void);
+void static restore_tty_state(void);
+static RETSIGTYPE sigint_handler(int);
+
+char *fm_getpassword(const char *prompt)
+{
+#if !(defined(HAVE_TCSETATTR) || defined(HAVE_TERMIO_H) || defined(HAVE_STTY))
+#if defined(HAVE_GETPASS)
+ char *getpass();
+ return getpass(prompt);
+#else
+ fputs(_("ERROR: no support for getpassword() routine\n"),stderr);
+ exit(1);
+#endif
+#else
+ register char *p;
+ register int c;
+ FILE *fi;
+ static char pbuf[INPUT_BUF_SIZE];
+ RETSIGTYPE (*sig)(int) = 0; /* initialization pacifies -Wall */
+ RETSIGTYPE sigint_handler(int);
+ char *ret;
+
+ int istty = isatty(0);
+
+ /* get the file descriptor for the actual input device if it's a tty */
+ if (istty)
+ {
+ if ((fi = fdopen(open("/dev/tty", 2), "r")) == NULL)
+ fi = stdin;
+ else
+ setbuf(fi, (char *)NULL);
+ }
+ else
+ fi = stdin;
+
+ /* store descriptor for the tty */
+ ttyfd = fileno(fi);
+
+ if (istty)
+ {
+ /* preserve tty state before turning off echo */
+ save_tty_state();
+
+ /* now that we have the current tty state, we can catch SIGINT and
+ exit gracefully */
+ sig = signal(SIGINT, sigint_handler);
+
+ /* turn off echo on the tty */
+ disable_tty_echo();
+
+ /* display the prompt and get the input string */
+ fprintf(stderr, "%s", prompt);
+ }
+
+ for (p = pbuf; (c = getc(fi))!='\n' && c!=EOF;)
+ {
+ if (p < &pbuf[INPUT_BUF_SIZE - 1])
+ *p++ = c;
+ }
+ *p = '\0';
+
+ if (c == EOF)
+ ret = NULL;
+ else
+ ret = pbuf;
+
+ /* write a newline so cursor won't appear to hang */
+ if (fi != stdin)
+ fprintf(stderr, "\n");
+
+ if (istty)
+ {
+ /* restore previous state of the tty */
+ restore_tty_state();
+
+ /* restore previous state of SIGINT */
+ signal(SIGINT, sig);
+ }
+ if (fi != stdin)
+ fclose(fi); /* not checking should be safe, file mode was "r" */
+
+ return(ret);
+#endif /* !(defined(HAVE_TCSETATTR) || ... */
+}
+
+static void save_tty_state (void)
+{
+#if defined(HAVE_TCSETATTR)
+ tcgetattr(ttyfd, &termb);
+ flags = termb.c_lflag;
+#else
+#if defined(HAVE_TERMIO_H)
+ ioctl(ttyfd, TCGETA, (char *) &termb);
+ flags = termb.c_lflag;
+#else /* we HAVE_STTY */
+ gtty(ttyfd, &ttyb);
+ flags = ttyb.sg_flags;
+#endif
+#endif
+}
+
+static void disable_tty_echo(void)
+{
+ /* turn off echo on the tty */
+#if defined(HAVE_TCSETATTR)
+ termb.c_lflag &= ~ECHO;
+ tcsetattr(ttyfd, TCSAFLUSH, &termb);
+#else
+#if defined(HAVE_TERMIO_H)
+ termb.c_lflag &= ~ECHO;
+ ioctl(ttyfd, TCSETA, (char *) &termb);
+#else /* we HAVE_STTY */
+ ttyb.sg_flags &= ~ECHO;
+ stty(ttyfd, &ttyb);
+#endif
+#endif
+}
+
+static void restore_tty_state(void)
+{
+ /* restore previous tty echo state */
+#if defined(HAVE_TCSETATTR)
+ termb.c_lflag = flags;
+ tcsetattr(ttyfd, TCSAFLUSH, &termb);
+#else
+#if defined(HAVE_TERMIO_H)
+ termb.c_lflag = flags;
+ ioctl(ttyfd, TCSETA, (char *) &termb);
+#else /* we HAVE_STTY */
+ ttyb.sg_flags = flags;
+ stty(ttyfd, &ttyb);
+#endif
+#endif
+}
+
+static RETSIGTYPE sigint_handler(int signum)
+{
+ restore_tty_state();
+ fprintf(stderr, _("\nCaught SIGINT... bailing out.\n"));
+ exit(1);
+}
+
+/* getpass.c ends here */
diff --git a/lib/getpass.h b/lib/getpass.h
new file mode 100644
index 0000000..d96fb99
--- /dev/null
+++ b/lib/getpass.h
@@ -0,0 +1,9 @@
+
+#ifndef GETPASS_H
+#define GETPASS_H
+
+char *fm_getpassword(const char *prompt);
+
+#define PASSWORDLEN 256
+
+#endif /* GETPASS_H */
diff --git a/lib/glob.c b/lib/glob.c
new file mode 100644
index 0000000..e3a6047
--- /dev/null
+++ b/lib/glob.c
@@ -0,0 +1,1439 @@
+/* Copyright (C) 1991,92,93,94,95,96,97,98,99 Free Software Foundation, Inc.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ This library 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+/* AIX requires this to be the first thing in the file. */
+#if defined _AIX && !defined __GNUC__
+ #pragma alloca
+#endif
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+/* joe: so we can interrupt easier */
+#define SHELL 1
+
+/* Enable GNU extensions in glob.h. */
+#ifndef _GNU_SOURCE
+# define _GNU_SOURCE 1
+#endif
+
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+
+/* Outcomment the following line for production quality code. */
+/* #define NDEBUG 1 */
+#include <assert.h>
+
+#include <stdio.h> /* Needed on stupid SunOS for assert. */
+
+
+/* Comment out all this code if we are using the GNU C Library, and are not
+ actually compiling the library itself. This code is part of the GNU C
+ Library, but also included in many other GNU distributions. Compiling
+ and linking in this code is a waste when using the GNU C library
+ (especially if it is a shared library). Rather than having every GNU
+ program understand `configure --with-gnu-libc' and omit the object files,
+ it is simpler to just do this in the source for each such file. */
+
+#if 0
+/* joe: do like it says above */
+
+#define GLOB_INTERFACE_VERSION 1
+#if !defined _LIBC && defined __GNU_LIBRARY__ && __GNU_LIBRARY__ > 1
+# include <gnu-versions.h>
+# if _GNU_GLOB_INTERFACE_VERSION == GLOB_INTERFACE_VERSION
+# define ELIDE_CODE
+# endif
+#endif
+
+#endif /* 0 */
+
+#ifndef ELIDE_CODE
+
+#if defined STDC_HEADERS || defined __GNU_LIBRARY__
+# include <stddef.h>
+#endif
+
+#if defined HAVE_UNISTD_H || defined _LIBC
+# include <unistd.h>
+# ifndef POSIX
+# ifdef _POSIX_VERSION
+# define POSIX
+# endif
+# endif
+#endif
+
+#if !defined _AMIGA && !defined VMS && !defined WINDOWS32
+# include <pwd.h>
+#endif
+
+#if !defined __GNU_LIBRARY__ && !defined STDC_HEADERS
+extern int errno;
+#endif
+#ifndef __set_errno
+# define __set_errno(val) errno = (val)
+#endif
+
+#ifndef NULL
+# define NULL 0
+#endif
+
+
+#if defined HAVE_DIRENT_H || defined __GNU_LIBRARY__
+# include <dirent.h>
+# define NAMLEN(dirent) strlen((dirent)->d_name)
+#else
+# define dirent direct
+# define NAMLEN(dirent) (dirent)->d_namlen
+# ifdef HAVE_SYS_NDIR_H
+# include <sys/ndir.h>
+# endif
+# ifdef HAVE_SYS_DIR_H
+# include <sys/dir.h>
+# endif
+# ifdef HAVE_NDIR_H
+# include <ndir.h>
+# endif
+# ifdef HAVE_VMSDIR_H
+# include "vmsdir.h"
+# endif /* HAVE_VMSDIR_H */
+#endif
+
+
+/* In GNU systems, <dirent.h> defines this macro for us. */
+#ifdef _D_NAMLEN
+# undef NAMLEN
+# define NAMLEN(d) _D_NAMLEN(d)
+#endif
+
+/* When used in the GNU libc the symbol _DIRENT_HAVE_D_TYPE is available
+ if the `d_type' member for `struct dirent' is available. */
+#ifdef _DIRENT_HAVE_D_TYPE
+# define HAVE_D_TYPE 1
+#endif
+
+
+#if (defined POSIX || defined WINDOWS32) && !defined __GNU_LIBRARY__
+/* Posix does not require that the d_ino field be present, and some
+ systems do not provide it. */
+# define REAL_DIR_ENTRY(dp) 1
+#else
+# define REAL_DIR_ENTRY(dp) (dp->d_ino != 0)
+#endif /* POSIX */
+
+#if defined STDC_HEADERS || defined __GNU_LIBRARY__
+# include <stdlib.h>
+# include <string.h>
+# define ANSI_STRING
+#else /* No standard headers. */
+
+extern char *getenv ();
+
+# ifdef HAVE_STRING_H
+# include <string.h>
+# define ANSI_STRING
+# else
+# include <strings.h>
+# endif
+# ifdef HAVE_MEMORY_H
+# include <memory.h>
+# endif
+
+extern char *malloc (), *realloc ();
+extern void free ();
+
+extern void qsort ();
+extern void abort (), exit ();
+
+#endif /* Standard headers. */
+
+/* joe: added this... __P was blowing up everywhere */
+#ifndef __P
+#define __P(a) ()
+#endif
+
+/* joe: added this */
+int __glob_pattern_p __P ((__const char *__pattern, int __quote));
+
+#ifdef HAVE_GETLOGIN_R
+extern int getlogin_r __P ((char *, size_t));
+#else
+extern char *getlogin __P ((void));
+#endif
+
+#ifndef ANSI_STRING
+
+# ifndef bzero
+extern void bzero ();
+# endif
+# ifndef bcopy
+extern void bcopy ();
+# endif
+
+# define memcpy(d, s, n) bcopy ((s), (d), (n))
+# define strrchr rindex
+/* memset is only used for zero here, but let's be paranoid. */
+# define memset(s, better_be_zero, n) \
+ ((void) ((better_be_zero) == 0 ? (bzero((s), (n)), 0) : (abort(), 0)))
+#endif /* Not ANSI_STRING. */
+
+#if !defined HAVE_STRCOLL && !defined _LIBC
+# define strcoll strcmp
+#endif
+
+#if !defined HAVE_MEMPCPY && __GLIBC__ - 0 == 2 && __GLIBC_MINOR__ >= 1
+# define HAVE_MEMPCPY 1
+# undef mempcpy
+# define mempcpy(Dest, Src, Len) __mempcpy (Dest, Src, Len)
+#endif
+
+#ifndef __GNU_LIBRARY__
+# ifdef __GNUC__
+__inline
+# endif
+# ifndef __SASC
+# ifdef WINDOWS32
+static void *
+# else
+static char *
+# endif
+my_realloc (p, n)
+ char *p;
+ unsigned int n;
+{
+ /* These casts are the for sake of the broken Ultrix compiler,
+ which warns of illegal pointer combinations otherwise. */
+ if (p == NULL)
+ return (char *) malloc (n);
+ return (char *) realloc (p, n);
+}
+# define realloc my_realloc
+# endif /* __SASC */
+#endif /* __GNU_LIBRARY__ */
+
+
+#if !defined __alloca && !defined __GNU_LIBRARY__
+
+# ifdef __GNUC__
+# undef alloca
+# define alloca(n) __builtin_alloca (n)
+# else /* Not GCC. */
+# ifdef HAVE_ALLOCA_H
+# include <alloca.h>
+# else /* Not HAVE_ALLOCA_H. */
+# ifndef _AIX
+# ifdef WINDOWS32
+# include <malloc.h>
+# else
+extern char *alloca ();
+# endif /* WINDOWS32 */
+# endif /* Not _AIX. */
+# endif /* sparc or HAVE_ALLOCA_H. */
+# endif /* GCC. */
+
+#endif
+
+# define __alloca alloca
+# define __stat stat
+
+#ifndef __GNU_LIBRARY__
+# define __stat stat
+# ifdef STAT_MACROS_BROKEN
+# undef S_ISDIR
+# endif
+# ifndef S_ISDIR
+# define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
+# endif
+#endif
+
+#ifdef _LIBC
+# undef strdup
+# define strdup(str) __strdup (str)
+# define sysconf(id) __sysconf (id)
+# define closedir(dir) __closedir (dir)
+# define opendir(name) __opendir (name)
+# define readdir(str) __readdir (str)
+# define getpwnam_r(name, bufp, buf, len, res) \
+ __getpwnam_r (name, bufp, buf, len, res)
+# ifndef __stat
+# define __stat(fname, buf) __xstat (_STAT_VER, fname, buf)
+# endif
+#endif
+
+#if !(defined STDC_HEADERS || defined __GNU_LIBRARY__)
+# undef size_t
+# define size_t unsigned int
+#endif
+
+/* Some system header files erroneously define these.
+ We want our own definitions from <fnmatch.h> to take precedence. */
+#ifndef __GNU_LIBRARY__
+# undef FNM_PATHNAME
+# undef FNM_NOESCAPE
+# undef FNM_PERIOD
+#endif
+#include <fnmatch.h>
+
+/* Some system header files erroneously define these.
+ We want our own definitions from <glob.h> to take precedence. */
+#ifndef __GNU_LIBRARY__
+# undef GLOB_ERR
+# undef GLOB_MARK
+# undef GLOB_NOSORT
+# undef GLOB_DOOFFS
+# undef GLOB_NOCHECK
+# undef GLOB_APPEND
+# undef GLOB_NOESCAPE
+# undef GLOB_PERIOD
+#endif
+#include <glob.h>
+
+static
+#if __GNUC__ - 0 >= 2
+inline
+#endif
+const char *next_brace_sub __P ((const char *begin));
+static int glob_in_dir __P ((const char *pattern, const char *directory,
+ int flags,
+ int (*errfunc) (const char *, int),
+ glob_t *pglob));
+static int prefix_array __P ((const char *prefix, char **array, size_t n));
+static int collated_compare __P ((const __ptr_t, const __ptr_t));
+
+
+/* Find the end of the sub-pattern in a brace expression. We define
+ this as an inline function if the compiler permits. */
+static
+#if __GNUC__ - 0 >= 2
+inline
+#endif
+const char *
+next_brace_sub (begin)
+ const char *begin;
+{
+ unsigned int depth = 0;
+ const char *cp = begin;
+
+ while (1)
+ {
+ if (depth == 0)
+ {
+ if (*cp != ',' && *cp != '}' && *cp != '\0')
+ {
+ if (*cp == '{')
+ ++depth;
+ ++cp;
+ continue;
+ }
+ }
+ else
+ {
+ while (*cp != '\0' && (*cp != '}' || depth > 0))
+ {
+ if (*cp == '}')
+ --depth;
+ ++cp;
+ }
+ if (*cp == '\0')
+ /* An incorrectly terminated brace expression. */
+ return NULL;
+
+ continue;
+ }
+ break;
+ }
+
+ return cp;
+}
+
+/* Do glob searching for PATTERN, placing results in PGLOB.
+ The bits defined above may be set in FLAGS.
+ If a directory cannot be opened or read and ERRFUNC is not nil,
+ it is called with the pathname that caused the error, and the
+ `errno' value from the failing call; if it returns non-zero
+ `glob' returns GLOB_ABORTED; if it returns zero, the error is ignored.
+ If memory cannot be allocated for PGLOB, GLOB_NOSPACE is returned.
+ Otherwise, `glob' returns zero. */
+int
+glob (pattern, flags, errfunc, pglob)
+ const char *pattern;
+ int flags;
+ int (*errfunc) __P ((const char *, int));
+ glob_t *pglob;
+{
+ const char *filename;
+ const char *dirname;
+ size_t dirlen;
+ int status;
+ size_t oldcount;
+
+ if (pattern == NULL || pglob == NULL || (flags & ~__GLOB_FLAGS) != 0)
+ {
+ __set_errno (EINVAL);
+ return -1;
+ }
+
+ if (flags & GLOB_BRACE)
+ {
+ const char *begin = strchr (pattern, '{');
+ if (begin != NULL)
+ {
+ /* Allocate working buffer large enough for our work. Note that
+ we have at least an opening and closing brace. */
+ size_t firstc;
+ char *alt_start;
+ const char *p;
+ const char *next;
+ const char *rest;
+ size_t rest_len;
+#ifdef __GNUC__
+ char onealt[strlen (pattern) - 1];
+#else
+ char *onealt = (char *) malloc (strlen (pattern) - 1);
+ if (onealt == NULL)
+ {
+ if (!(flags & GLOB_APPEND))
+ globfree (pglob);
+ return GLOB_NOSPACE;
+ }
+#endif
+
+ /* We know the prefix for all sub-patterns. */
+#ifdef HAVE_MEMPCPY
+ alt_start = mempcpy (onealt, pattern, begin - pattern);
+#else
+ memcpy (onealt, pattern, begin - pattern);
+ alt_start = &onealt[begin - pattern];
+#endif
+
+ /* Find the first sub-pattern and at the same time find the
+ rest after the closing brace. */
+ next = next_brace_sub (begin + 1);
+ if (next == NULL)
+ {
+ /* It is an illegal expression. */
+#ifndef __GNUC__
+ free (onealt);
+#endif
+ return glob (pattern, flags & ~GLOB_BRACE, errfunc, pglob);
+ }
+
+ /* Now find the end of the whole brace expression. */
+ rest = next;
+ while (*rest != '}')
+ {
+ rest = next_brace_sub (rest + 1);
+ if (rest == NULL)
+ {
+ /* It is an illegal expression. */
+#ifndef __GNUC__
+ free (onealt);
+#endif
+ return glob (pattern, flags & ~GLOB_BRACE, errfunc, pglob);
+ }
+ }
+ /* Please note that we now can be sure the brace expression
+ is well-formed. */
+ rest_len = strlen (++rest) + 1;
+
+ /* We have a brace expression. BEGIN points to the opening {,
+ NEXT points past the terminator of the first element, and END
+ points past the final }. We will accumulate result names from
+ recursive runs for each brace alternative in the buffer using
+ GLOB_APPEND. */
+
+ if (!(flags & GLOB_APPEND))
+ {
+ /* This call is to set a new vector, so clear out the
+ vector so we can append to it. */
+ pglob->gl_pathc = 0;
+ pglob->gl_pathv = NULL;
+ }
+ firstc = pglob->gl_pathc;
+
+ p = begin + 1;
+ while (1)
+ {
+ int result;
+
+ /* Construct the new glob expression. */
+#ifdef HAVE_MEMPCPY
+ mempcpy (mempcpy (alt_start, p, next - p), rest, rest_len);
+#else
+ memcpy (alt_start, p, next - p);
+ memcpy (&alt_start[next - p], rest, rest_len);
+#endif
+
+ result = glob (onealt,
+ ((flags & ~(GLOB_NOCHECK|GLOB_NOMAGIC))
+ | GLOB_APPEND), errfunc, pglob);
+
+ /* If we got an error, return it. */
+ if (result && result != GLOB_NOMATCH)
+ {
+#ifndef __GNUC__
+ free (onealt);
+#endif
+ if (!(flags & GLOB_APPEND))
+ globfree (pglob);
+ return result;
+ }
+
+ if (*next == '}')
+ /* We saw the last entry. */
+ break;
+
+ p = next + 1;
+ next = next_brace_sub (p);
+ assert (next != NULL);
+ }
+
+#ifndef __GNUC__
+ free (onealt);
+#endif
+
+ if (pglob->gl_pathc != firstc)
+ /* We found some entries. */
+ return 0;
+ else if (!(flags & (GLOB_NOCHECK|GLOB_NOMAGIC)))
+ return GLOB_NOMATCH;
+ }
+ }
+
+ /* Find the filename. */
+ filename = strrchr (pattern, '/');
+#if defined __MSDOS__ || defined WINDOWS32
+ /* The case of "d:pattern". Since `:' is not allowed in
+ file names, we can safely assume that wherever it
+ happens in pattern, it signals the filename part. This
+ is so we could some day support patterns like "[a-z]:foo". */
+ if (filename == NULL)
+ filename = strchr (pattern, ':');
+#endif /* __MSDOS__ || WINDOWS32 */
+ if (filename == NULL)
+ {
+ /* This can mean two things: a simple name or "~name". The later
+ case is nothing but a notation for a directory. */
+ if ((flags & (GLOB_TILDE|GLOB_TILDE_CHECK)) && pattern[0] == '~')
+ {
+ dirname = pattern;
+ dirlen = strlen (pattern);
+
+ /* Set FILENAME to NULL as a special flag. This is ugly but
+ other solutions would require much more code. We test for
+ this special case below. */
+ filename = NULL;
+ }
+ else
+ {
+ filename = pattern;
+#ifdef _AMIGA
+ dirname = "";
+#else
+ dirname = ".";
+#endif
+ dirlen = 0;
+ }
+ }
+ else if (filename == pattern)
+ {
+ /* "/pattern". */
+ dirname = "/";
+ dirlen = 1;
+ ++filename;
+ }
+ else
+ {
+ char *newp;
+ dirlen = filename - pattern;
+#if defined __MSDOS__ || defined WINDOWS32
+ if (*filename == ':'
+ || (filename > pattern + 1 && filename[-1] == ':'))
+ {
+ char *drive_spec;
+
+ ++dirlen;
+ drive_spec = (char *) __alloca (dirlen + 1);
+#ifdef HAVE_MEMPCPY
+ *((char *) mempcpy (drive_spec, pattern, dirlen)) = '\0';
+#else
+ memcpy (drive_spec, pattern, dirlen);
+ drive_spec[dirlen] = '\0';
+#endif
+ /* For now, disallow wildcards in the drive spec, to
+ prevent infinite recursion in glob. */
+ if (__glob_pattern_p (drive_spec, !(flags & GLOB_NOESCAPE)))
+ return GLOB_NOMATCH;
+ /* If this is "d:pattern", we need to copy `:' to DIRNAME
+ as well. If it's "d:/pattern", don't remove the slash
+ from "d:/", since "d:" and "d:/" are not the same.*/
+ }
+#endif
+ newp = (char *) __alloca (dirlen + 1);
+#ifdef HAVE_MEMPCPY
+ *((char *) mempcpy (newp, pattern, dirlen)) = '\0';
+#else
+ memcpy (newp, pattern, dirlen);
+ newp[dirlen] = '\0';
+#endif
+ dirname = newp;
+ ++filename;
+
+ if (filename[0] == '\0'
+#if defined __MSDOS__ || defined WINDOWS32
+ && dirname[dirlen - 1] != ':'
+ && (dirlen < 3 || dirname[dirlen - 2] != ':'
+ || dirname[dirlen - 1] != '/')
+#endif
+ && dirlen > 1)
+ /* "pattern/". Expand "pattern", appending slashes. */
+ {
+ int val = glob (dirname, flags | GLOB_MARK, errfunc, pglob);
+ if (val == 0)
+ pglob->gl_flags = ((pglob->gl_flags & ~GLOB_MARK)
+ | (flags & GLOB_MARK));
+ return val;
+ }
+ }
+
+ if (!(flags & GLOB_APPEND))
+ {
+ pglob->gl_pathc = 0;
+ pglob->gl_pathv = NULL;
+ }
+
+ oldcount = pglob->gl_pathc;
+
+#ifndef VMS
+ if ((flags & (GLOB_TILDE|GLOB_TILDE_CHECK)) && dirname[0] == '~')
+ {
+ if (dirname[1] == '\0' || dirname[1] == '/')
+ {
+ /* Look up home directory. */
+ const char *home_dir = getenv ("HOME");
+# ifdef _AMIGA
+ if (home_dir == NULL || home_dir[0] == '\0')
+ home_dir = "SYS:";
+# else
+# ifdef WINDOWS32
+ if (home_dir == NULL || home_dir[0] == '\0')
+ home_dir = "c:/users/default"; /* poor default */
+# else
+ if (home_dir == NULL || home_dir[0] == '\0')
+ {
+ int success;
+ char *name;
+# if defined HAVE_GETLOGIN_R || defined _LIBC
+#ifdef _SC_LOGIN_NAME_MAX
+ size_t buflen = sysconf (_SC_LOGIN_NAME_MAX) + 1;
+#else
+ size_t buflen = 20;
+#endif
+ if (buflen == 0)
+ /* `sysconf' does not support _SC_LOGIN_NAME_MAX. Try
+ a moderate value. */
+ buflen = 20;
+ name = (char *) __alloca (buflen);
+
+ success = getlogin_r (name, buflen) >= 0;
+# else
+ success = (name = getlogin ()) != NULL;
+# endif
+ if (success)
+ {
+ struct passwd *p;
+# if defined HAVE_GETPWNAM_R || defined _LIBC
+ size_t pwbuflen = sysconf (_SC_GETPW_R_SIZE_MAX);
+ char *pwtmpbuf;
+ struct passwd pwbuf;
+ int save = errno;
+
+ if (pwbuflen == -1)
+ /* `sysconf' does not support _SC_GETPW_R_SIZE_MAX.
+ Try a moderate value. */
+ pwbuflen = 1024;
+ pwtmpbuf = (char *) __alloca (pwbuflen);
+
+ while (getpwnam_r (name, &pwbuf, pwtmpbuf, pwbuflen, &p)
+ != 0)
+ {
+ if (errno != ERANGE)
+ {
+ p = NULL;
+ break;
+ }
+ pwbuflen *= 2;
+ pwtmpbuf = (char *) __alloca (pwbuflen);
+ __set_errno (save);
+ }
+# else
+ p = getpwnam (name);
+# endif
+ if (p != NULL)
+ home_dir = p->pw_dir;
+ }
+ }
+ if (home_dir == NULL || home_dir[0] == '\0')
+ {
+ if (flags & GLOB_TILDE_CHECK)
+ return GLOB_NOMATCH;
+ else
+ home_dir = "~"; /* No luck. */
+ }
+# endif /* WINDOWS32 */
+# endif
+ /* Now construct the full directory. */
+ if (dirname[1] == '\0')
+ dirname = home_dir;
+ else
+ {
+ char *newp;
+ size_t home_len = strlen (home_dir);
+ newp = (char *) __alloca (home_len + dirlen);
+# ifdef HAVE_MEMPCPY
+ mempcpy (mempcpy (newp, home_dir, home_len),
+ &dirname[1], dirlen);
+# else
+ memcpy (newp, home_dir, home_len);
+ memcpy (&newp[home_len], &dirname[1], dirlen);
+# endif
+ dirname = newp;
+ }
+ }
+# if !defined _AMIGA && !defined WINDOWS32
+ else
+ {
+ char *end_name = strchr (dirname, '/');
+ const char *user_name;
+ const char *home_dir;
+
+ if (end_name == NULL)
+ user_name = dirname + 1;
+ else
+ {
+ char *newp;
+ newp = (char *) __alloca (end_name - dirname);
+# ifdef HAVE_MEMPCPY
+ *((char *) mempcpy (newp, dirname + 1, end_name - dirname))
+ = '\0';
+# else
+ memcpy (newp, dirname + 1, end_name - dirname);
+ newp[end_name - dirname - 1] = '\0';
+# endif
+ user_name = newp;
+ }
+
+ /* Look up specific user's home directory. */
+ {
+ struct passwd *p;
+# if defined HAVE_GETPWNAM_R || defined _LIBC
+ size_t buflen = sysconf (_SC_GETPW_R_SIZE_MAX);
+ char *pwtmpbuf;
+ struct passwd pwbuf;
+ int save = errno;
+
+ if (buflen == -1)
+ /* `sysconf' does not support _SC_GETPW_R_SIZE_MAX. Try a
+ moderate value. */
+ buflen = 1024;
+ pwtmpbuf = (char *) __alloca (buflen);
+
+ while (getpwnam_r (user_name, &pwbuf, pwtmpbuf, buflen, &p) != 0)
+ {
+ if (errno != ERANGE)
+ {
+ p = NULL;
+ break;
+ }
+ buflen *= 2;
+ pwtmpbuf = __alloca (buflen);
+ __set_errno (save);
+ }
+# else
+ p = getpwnam (user_name);
+# endif
+ if (p != NULL)
+ home_dir = p->pw_dir;
+ else
+ home_dir = NULL;
+ }
+ /* If we found a home directory use this. */
+ if (home_dir != NULL)
+ {
+ char *newp;
+ size_t home_len = strlen (home_dir);
+ size_t rest_len = end_name == NULL ? 0 : strlen (end_name);
+ newp = (char *) __alloca (home_len + rest_len + 1);
+# ifdef HAVE_MEMPCPY
+ *((char *) mempcpy (mempcpy (newp, home_dir, home_len),
+ end_name, rest_len)) = '\0';
+# else
+ memcpy (newp, home_dir, home_len);
+ memcpy (&newp[home_len], end_name, rest_len);
+ newp[home_len + rest_len] = '\0';
+# endif
+ dirname = newp;
+ }
+ else
+ if (flags & GLOB_TILDE_CHECK)
+ /* We have to regard it as an error if we cannot find the
+ home directory. */
+ return GLOB_NOMATCH;
+ }
+# endif /* Not Amiga && not WINDOWS32. */
+ }
+#endif /* Not VMS. */
+
+ /* Now test whether we looked for "~" or "~NAME". In this case we
+ can give the answer now. */
+ if (filename == NULL)
+ {
+ struct stat st;
+
+ /* Return the directory if we don't check for error or if it exists. */
+ if ((flags & GLOB_NOCHECK)
+ || (((flags & GLOB_ALTDIRFUNC)
+ ? (*pglob->gl_stat) (dirname, &st)
+ : __stat (dirname, &st)) == 0
+ && S_ISDIR (st.st_mode)))
+ {
+ pglob->gl_pathv
+ = (char **) realloc (pglob->gl_pathv,
+ (pglob->gl_pathc +
+ ((flags & GLOB_DOOFFS) ?
+ pglob->gl_offs : 0) +
+ 1 + 1) *
+ sizeof (char *));
+ if (pglob->gl_pathv == NULL)
+ return GLOB_NOSPACE;
+
+ if (flags & GLOB_DOOFFS)
+ while (pglob->gl_pathc < pglob->gl_offs)
+ pglob->gl_pathv[pglob->gl_pathc++] = NULL;
+
+#if defined HAVE_STRDUP || defined _LIBC
+ pglob->gl_pathv[pglob->gl_pathc] = strdup (dirname);
+#else
+ {
+ size_t len = strlen (dirname) + 1;
+ char *dircopy = malloc (len);
+ if (dircopy != NULL)
+ pglob->gl_pathv[pglob->gl_pathc] = memcpy (dircopy, dirname,
+ len);
+ }
+#endif
+ if (pglob->gl_pathv[pglob->gl_pathc] == NULL)
+ {
+ free (pglob->gl_pathv);
+ return GLOB_NOSPACE;
+ }
+ pglob->gl_pathv[++pglob->gl_pathc] = NULL;
+ pglob->gl_flags = flags;
+
+ return 0;
+ }
+
+ /* Not found. */
+ return GLOB_NOMATCH;
+ }
+
+ if (__glob_pattern_p (dirname, !(flags & GLOB_NOESCAPE)))
+ {
+ /* The directory name contains metacharacters, so we
+ have to glob for the directory, and then glob for
+ the pattern in each directory found. */
+ glob_t dirs;
+ register size_t i;
+ if (flags & GLOB_ALTDIRFUNC)
+ {
+ dirs.gl_opendir = pglob->gl_opendir;
+ dirs.gl_readdir = pglob->gl_readdir;
+ dirs.gl_closedir = pglob->gl_closedir;
+ dirs.gl_stat = pglob->gl_stat;
+ dirs.gl_lstat = pglob->gl_lstat;
+ }
+
+ status = glob (dirname,
+ ((flags & (GLOB_ERR | GLOB_NOCHECK | GLOB_NOESCAPE
+ | GLOB_ALTDIRFUNC))
+ | GLOB_NOSORT | GLOB_ONLYDIR),
+ errfunc, &dirs);
+ if (status != 0)
+ return status;
+
+ /* We have successfully globbed the preceding directory name.
+ For each name we found, call glob_in_dir on it and FILENAME,
+ appending the results to PGLOB. */
+ for (i = 0; i < dirs.gl_pathc; ++i)
+ {
+ int old_pathc;
+
+#ifdef SHELL
+ {
+ /* Make globbing interruptible in the bash shell. */
+ extern int interrupt_state;
+
+ if (interrupt_state)
+ {
+ globfree (&dirs);
+#if 0
+ /* joe: this isn't defined. */
+ globfree (&files);
+#endif
+ return GLOB_ABORTED;
+ }
+ }
+#endif /* SHELL. */
+
+ old_pathc = pglob->gl_pathc;
+ status = glob_in_dir (filename, dirs.gl_pathv[i],
+ ((flags | GLOB_APPEND)
+ & ~(GLOB_NOCHECK | GLOB_ERR)),
+ errfunc, pglob);
+ if (status == GLOB_NOMATCH)
+ /* No matches in this directory. Try the next. */
+ continue;
+
+ if (status != 0)
+ {
+ globfree (&dirs);
+ globfree (pglob);
+ return status;
+ }
+
+ /* Stick the directory on the front of each name. */
+ if (prefix_array (dirs.gl_pathv[i],
+ &pglob->gl_pathv[old_pathc],
+ pglob->gl_pathc - old_pathc))
+ {
+ globfree (&dirs);
+ globfree (pglob);
+ return GLOB_NOSPACE;
+ }
+ }
+
+ flags |= GLOB_MAGCHAR;
+
+ /* We have ignored the GLOB_NOCHECK flag in the `glob_in_dir' calls.
+ But if we have not found any matching entry and thie GLOB_NOCHECK
+ flag was set we must return the list consisting of the disrectory
+ names followed by the filename. */
+ if (pglob->gl_pathc == oldcount)
+ {
+ /* No matches. */
+ if (flags & GLOB_NOCHECK)
+ {
+ size_t filename_len = strlen (filename) + 1;
+ char **new_pathv;
+ struct stat st;
+
+ /* This is an pessimistic guess about the size. */
+ pglob->gl_pathv
+ = (char **) realloc (pglob->gl_pathv,
+ (pglob->gl_pathc +
+ ((flags & GLOB_DOOFFS) ?
+ pglob->gl_offs : 0) +
+ dirs.gl_pathc + 1) *
+ sizeof (char *));
+ if (pglob->gl_pathv == NULL)
+ {
+ globfree (&dirs);
+ return GLOB_NOSPACE;
+ }
+
+ if (flags & GLOB_DOOFFS)
+ while (pglob->gl_pathc < pglob->gl_offs)
+ pglob->gl_pathv[pglob->gl_pathc++] = NULL;
+
+ for (i = 0; i < dirs.gl_pathc; ++i)
+ {
+ const char *dir = dirs.gl_pathv[i];
+ size_t dir_len = strlen (dir);
+
+ /* First check whether this really is a directory. */
+ if (((flags & GLOB_ALTDIRFUNC)
+ ? (*pglob->gl_stat) (dir, &st) : __stat (dir, &st)) != 0
+ || !S_ISDIR (st.st_mode))
+ /* No directory, ignore this entry. */
+ continue;
+
+ pglob->gl_pathv[pglob->gl_pathc] = malloc (dir_len + 1
+ + filename_len);
+ if (pglob->gl_pathv[pglob->gl_pathc] == NULL)
+ {
+ globfree (&dirs);
+ globfree (pglob);
+ return GLOB_NOSPACE;
+ }
+
+#ifdef HAVE_MEMPCPY
+ mempcpy (mempcpy (mempcpy (pglob->gl_pathv[pglob->gl_pathc],
+ dir, dir_len),
+ "/", 1),
+ filename, filename_len);
+#else
+ memcpy (pglob->gl_pathv[pglob->gl_pathc], dir, dir_len);
+ pglob->gl_pathv[pglob->gl_pathc][dir_len] = '/';
+ memcpy (&pglob->gl_pathv[pglob->gl_pathc][dir_len + 1],
+ filename, filename_len);
+#endif
+ ++pglob->gl_pathc;
+ }
+
+ pglob->gl_pathv[pglob->gl_pathc] = NULL;
+ pglob->gl_flags = flags;
+
+ /* Now we know how large the gl_pathv vector must be. */
+ new_pathv = (char **) realloc (pglob->gl_pathv,
+ ((pglob->gl_pathc + 1)
+ * sizeof (char *)));
+ if (new_pathv != NULL)
+ pglob->gl_pathv = new_pathv;
+ }
+ else
+ return GLOB_NOMATCH;
+ }
+
+ globfree (&dirs);
+ }
+ else
+ {
+ status = glob_in_dir (filename, dirname, flags, errfunc, pglob);
+ if (status != 0)
+ return status;
+
+ if (dirlen > 0)
+ {
+ /* Stick the directory on the front of each name. */
+ size_t ignore = oldcount;
+
+ if ((flags & GLOB_DOOFFS) && ignore < pglob->gl_offs)
+ ignore = pglob->gl_offs;
+
+ if (prefix_array (dirname,
+ &pglob->gl_pathv[ignore],
+ pglob->gl_pathc - ignore))
+ {
+ globfree (pglob);
+ return GLOB_NOSPACE;
+ }
+ }
+ }
+
+ if (flags & GLOB_MARK)
+ {
+ /* Append slashes to directory names. */
+ size_t i;
+ struct stat st;
+ for (i = oldcount; i < pglob->gl_pathc; ++i)
+ if (((flags & GLOB_ALTDIRFUNC)
+ ? (*pglob->gl_stat) (pglob->gl_pathv[i], &st)
+ : __stat (pglob->gl_pathv[i], &st)) == 0
+ && S_ISDIR (st.st_mode))
+ {
+ size_t len = strlen (pglob->gl_pathv[i]) + 2;
+ char *new = realloc (pglob->gl_pathv[i], len);
+ if (new == NULL)
+ {
+ globfree (pglob);
+ return GLOB_NOSPACE;
+ }
+ strcpy (&new[len - 2], "/");
+ pglob->gl_pathv[i] = new;
+ }
+ }
+
+ if (!(flags & GLOB_NOSORT))
+ {
+ /* Sort the vector. */
+ int non_sort = oldcount;
+
+ if ((flags & GLOB_DOOFFS) && pglob->gl_offs > oldcount)
+ non_sort = pglob->gl_offs;
+
+ qsort ((__ptr_t) &pglob->gl_pathv[non_sort],
+ pglob->gl_pathc - non_sort,
+ sizeof (char *), collated_compare);
+ }
+
+ return 0;
+}
+
+
+/* Free storage allocated in PGLOB by a previous `glob' call. */
+void
+globfree (pglob)
+ register glob_t *pglob;
+{
+ if (pglob->gl_pathv != NULL)
+ {
+ register size_t i;
+ for (i = 0; i < pglob->gl_pathc; ++i)
+ if (pglob->gl_pathv[i] != NULL)
+ free ((__ptr_t) pglob->gl_pathv[i]);
+ free ((__ptr_t) pglob->gl_pathv);
+ }
+}
+
+
+/* Do a collated comparison of A and B. */
+static int
+collated_compare (a, b)
+ const __ptr_t a;
+ const __ptr_t b;
+{
+ const char *const s1 = *(const char *const * const) a;
+ const char *const s2 = *(const char *const * const) b;
+
+ if (s1 == s2)
+ return 0;
+ if (s1 == NULL)
+ return 1;
+ if (s2 == NULL)
+ return -1;
+ return strcoll (s1, s2);
+}
+
+
+/* Prepend DIRNAME to each of N members of ARRAY, replacing ARRAY's
+ elements in place. Return nonzero if out of memory, zero if successful.
+ A slash is inserted between DIRNAME and each elt of ARRAY,
+ unless DIRNAME is just "/". Each old element of ARRAY is freed. */
+static int
+prefix_array (dirname, array, n)
+ const char *dirname;
+ char **array;
+ size_t n;
+{
+ register size_t i;
+ size_t dirlen = strlen (dirname);
+#if defined __MSDOS__ || defined WINDOWS32
+ int sep_char = '/';
+# define DIRSEP_CHAR sep_char
+#else
+# define DIRSEP_CHAR '/'
+#endif
+
+ if (dirlen == 1 && dirname[0] == '/')
+ /* DIRNAME is just "/", so normal prepending would get us "//foo".
+ We want "/foo" instead, so don't prepend any chars from DIRNAME. */
+ dirlen = 0;
+#if defined __MSDOS__ || defined WINDOWS32
+ else if (dirlen > 1)
+ {
+ if (dirname[dirlen - 1] == '/')
+ /* DIRNAME is "d:/". Don't prepend the slash from DIRNAME. */
+ --dirlen;
+ else if (dirname[dirlen - 1] == ':')
+ {
+ /* DIRNAME is "d:". Use `:' instead of `/'. */
+ --dirlen;
+ sep_char = ':';
+ }
+ }
+#endif
+
+ for (i = 0; i < n; ++i)
+ {
+ size_t eltlen = strlen (array[i]) + 1;
+ char *new = (char *) malloc (dirlen + 1 + eltlen);
+ if (new == NULL)
+ {
+ while (i > 0)
+ free ((__ptr_t) array[--i]);
+ return 1;
+ }
+
+#ifdef HAVE_MEMPCPY
+ {
+ char *endp = (char *) mempcpy (new, dirname, dirlen);
+ *endp++ = DIRSEP_CHAR;
+ mempcpy (endp, array[i], eltlen);
+ }
+#else
+ memcpy (new, dirname, dirlen);
+ new[dirlen] = DIRSEP_CHAR;
+ memcpy (&new[dirlen + 1], array[i], eltlen);
+#endif
+ free ((__ptr_t) array[i]);
+ array[i] = new;
+ }
+
+ return 0;
+}
+
+
+/* We must not compile this function twice. */
+#if !defined _LIBC || !defined NO_GLOB_PATTERN_P
+/* Return nonzero if PATTERN contains any metacharacters.
+ Metacharacters can be quoted with backslashes if QUOTE is nonzero. */
+int
+__glob_pattern_p (pattern, quote)
+ const char *pattern;
+ int quote;
+{
+ register const char *p;
+ int open = 0;
+
+ for (p = pattern; *p != '\0'; ++p)
+ switch (*p)
+ {
+ case '?':
+ case '*':
+ return 1;
+
+ case '\\':
+ if (quote && p[1] != '\0')
+ ++p;
+ break;
+
+ case '[':
+ open = 1;
+ break;
+
+ case ']':
+ if (open)
+ return 1;
+ break;
+ }
+
+ return 0;
+}
+# ifdef _LIBC
+weak_alias (__glob_pattern_p, glob_pattern_p)
+# endif
+#endif
+
+
+/* Like `glob', but PATTERN is a final pathname component,
+ and matches are searched for in DIRECTORY.
+ The GLOB_NOSORT bit in FLAGS is ignored. No sorting is ever done.
+ The GLOB_APPEND flag is assumed to be set (always appends). */
+static int
+glob_in_dir (pattern, directory, flags, errfunc, pglob)
+ const char *pattern;
+ const char *directory;
+ int flags;
+ int (*errfunc) __P ((const char *, int));
+ glob_t *pglob;
+{
+ __ptr_t stream = NULL;
+
+ struct globlink
+ {
+ struct globlink *next;
+ char *name;
+ };
+ struct globlink *names = NULL;
+ size_t nfound;
+ int meta;
+ int save;
+
+ meta = __glob_pattern_p (pattern, !(flags & GLOB_NOESCAPE));
+ if (meta == 0)
+ {
+ if (flags & (GLOB_NOCHECK|GLOB_NOMAGIC))
+ /* We need not do any tests. The PATTERN contains no meta
+ characters and we must not return an error therefore the
+ result will always contain exactly one name. */
+ flags |= GLOB_NOCHECK;
+ else
+ {
+ /* Since we use the normal file functions we can also use stat()
+ to verify the file is there. */
+ struct stat st;
+ size_t patlen = strlen (pattern);
+ size_t dirlen = strlen (directory);
+ char *fullname = (char *) __alloca (dirlen + 1 + patlen + 1);
+
+# ifdef HAVE_MEMPCPY
+ mempcpy (mempcpy (mempcpy (fullname, directory, dirlen),
+ "/", 1),
+ pattern, patlen + 1);
+# else
+ memcpy (fullname, directory, dirlen);
+ fullname[dirlen] = '/';
+ memcpy (&fullname[dirlen + 1], pattern, patlen + 1);
+# endif
+ if (((flags & GLOB_ALTDIRFUNC)
+ ? (*pglob->gl_stat) (fullname, &st)
+ : __stat (fullname, &st)) == 0)
+ /* We found this file to be existing. Now tell the rest
+ of the function to copy this name into the result. */
+ flags |= GLOB_NOCHECK;
+ }
+
+ nfound = 0;
+ }
+ else
+ {
+ if (pattern[0] == '\0')
+ {
+ /* This is a special case for matching directories like in
+ "*a/". */
+ names = (struct globlink *) __alloca (sizeof (struct globlink));
+ names->name = (char *) malloc (1);
+ if (names->name == NULL)
+ goto memory_error;
+ names->name[0] = '\0';
+ names->next = NULL;
+ nfound = 1;
+ meta = 0;
+ }
+ else
+ {
+ stream = ((flags & GLOB_ALTDIRFUNC)
+ ? (*pglob->gl_opendir) (directory)
+ : (__ptr_t) opendir (directory));
+ if (stream == NULL)
+ {
+ if (errno != ENOTDIR
+ && ((errfunc != NULL && (*errfunc) (directory, errno))
+ || (flags & GLOB_ERR)))
+ return GLOB_ABORTED;
+ nfound = 0;
+ meta = 0;
+ }
+ else
+ {
+ int fnm_flags = ((!(flags & GLOB_PERIOD) ? FNM_PERIOD : 0)
+ | ((flags & GLOB_NOESCAPE) ? FNM_NOESCAPE : 0)
+#if defined _AMIGA || defined VMS
+ | FNM_CASEFOLD
+#endif
+ );
+ nfound = 0;
+ flags |= GLOB_MAGCHAR;
+
+ while (1)
+ {
+ const char *name;
+ size_t len;
+ struct dirent *d = ((flags & GLOB_ALTDIRFUNC)
+ ? (*pglob->gl_readdir) (stream)
+ : readdir ((DIR *) stream));
+ if (d == NULL)
+ break;
+ if (! REAL_DIR_ENTRY (d))
+ continue;
+
+#ifdef HAVE_D_TYPE
+ /* If we shall match only directories use the information
+ provided by the dirent call if possible. */
+ if ((flags & GLOB_ONLYDIR)
+ && d->d_type != DT_UNKNOWN && d->d_type != DT_DIR)
+ continue;
+#endif
+
+ name = d->d_name;
+
+ if (fnmatch (pattern, name, fnm_flags) == 0)
+ {
+ struct globlink *new = (struct globlink *)
+ __alloca (sizeof (struct globlink));
+ len = NAMLEN (d);
+ new->name = (char *) malloc (len + 1);
+ if (new->name == NULL)
+ goto memory_error;
+#ifdef HAVE_MEMPCPY
+ *((char *) mempcpy ((__ptr_t) new->name, name, len))
+ = '\0';
+#else
+ memcpy ((__ptr_t) new->name, name, len);
+ new->name[len] = '\0';
+#endif
+ new->next = names;
+ names = new;
+ ++nfound;
+ }
+ }
+ }
+ }
+ }
+
+ if (nfound == 0 && (flags & GLOB_NOCHECK))
+ {
+ size_t len = strlen (pattern);
+ nfound = 1;
+ names = (struct globlink *) __alloca (sizeof (struct globlink));
+ names->next = NULL;
+ names->name = (char *) malloc (len + 1);
+ if (names->name == NULL)
+ goto memory_error;
+#ifdef HAVE_MEMPCPY
+ *((char *) mempcpy (names->name, pattern, len)) = '\0';
+#else
+ memcpy (names->name, pattern, len);
+ names->name[len] = '\0';
+#endif
+ }
+
+ if (nfound != 0)
+ {
+ pglob->gl_pathv
+ = (char **) realloc (pglob->gl_pathv,
+ (pglob->gl_pathc +
+ ((flags & GLOB_DOOFFS) ? pglob->gl_offs : 0) +
+ nfound + 1) *
+ sizeof (char *));
+ if (pglob->gl_pathv == NULL)
+ goto memory_error;
+
+ if (flags & GLOB_DOOFFS)
+ while (pglob->gl_pathc < pglob->gl_offs)
+ pglob->gl_pathv[pglob->gl_pathc++] = NULL;
+
+ for (; names != NULL; names = names->next)
+ pglob->gl_pathv[pglob->gl_pathc++] = names->name;
+ pglob->gl_pathv[pglob->gl_pathc] = NULL;
+
+ pglob->gl_flags = flags;
+ }
+
+ save = errno;
+ if (stream != NULL)
+ {
+ if (flags & GLOB_ALTDIRFUNC)
+ (*pglob->gl_closedir) (stream);
+ else
+ closedir ((DIR *) stream);
+ }
+ __set_errno (save);
+
+ return nfound == 0 ? GLOB_NOMATCH : 0;
+
+ memory_error:
+ {
+ int esave = errno;
+ if (flags & GLOB_ALTDIRFUNC)
+ (*pglob->gl_closedir) (stream);
+ else
+ closedir ((DIR *) stream);
+ __set_errno (esave);
+ }
+ while (names != NULL)
+ {
+ if (names->name != NULL)
+ free ((__ptr_t) names->name);
+ names = names->next;
+ }
+ return GLOB_NOSPACE;
+}
+
+#endif /* Not ELIDE_CODE. */
diff --git a/lib/glob.h b/lib/glob.h
new file mode 100644
index 0000000..42ababe
--- /dev/null
+++ b/lib/glob.h
@@ -0,0 +1,194 @@
+/* Copyright (C) 1991, 92, 95, 96, 97, 98 Free Software Foundation, Inc.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef _GLOB_H
+#define _GLOB_H 1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#undef __ptr_t
+#if defined __cplusplus || (defined __STDC__ && __STDC__) || defined WINDOWS32
+/* joe: added !defined __PMT at the end here: */
+# if !defined __GLIBC__ || !defined __P || !defined __PMT
+# undef __P
+# undef __PMT
+# define __P(protos) protos
+# define __PMT(protos) protos
+# if !defined __GNUC__ || __GNUC__ < 2
+# undef __const
+# define __const const
+# endif
+# endif
+# define __ptr_t void *
+#else /* Not C++ or ANSI C. */
+# undef __P
+# undef __PMT
+# define __P(protos) ()
+# define __PMT(protos) ()
+# undef __const
+# define __const
+# define __ptr_t char *
+#endif /* C++ or ANSI C. */
+
+/* We need `size_t' for the following definitions. */
+#ifndef __size_t
+# if defined __GNUC__ && __GNUC__ >= 2
+typedef __SIZE_TYPE__ __size_t;
+# else
+/* This is a guess. */
+typedef unsigned long int __size_t;
+# endif
+#else
+/* The GNU CC stddef.h version defines __size_t as empty. We need a real
+ definition. */
+# undef __size_t
+# define __size_t size_t
+#endif
+
+/* Bits set in the FLAGS argument to `glob'. */
+#define GLOB_ERR (1 << 0)/* Return on read errors. */
+#define GLOB_MARK (1 << 1)/* Append a slash to each name. */
+#define GLOB_NOSORT (1 << 2)/* Don't sort the names. */
+#define GLOB_DOOFFS (1 << 3)/* Insert PGLOB->gl_offs NULLs. */
+#define GLOB_NOCHECK (1 << 4)/* If nothing matches, return the pattern. */
+#define GLOB_APPEND (1 << 5)/* Append to results of a previous call. */
+#define GLOB_NOESCAPE (1 << 6)/* Backslashes don't quote metacharacters. */
+#define GLOB_PERIOD (1 << 7)/* Leading `.' can be matched by metachars. */
+
+#if (!defined _POSIX_C_SOURCE || _POSIX_C_SOURCE < 2 || defined _BSD_SOURCE \
+ || defined _GNU_SOURCE)
+# define GLOB_MAGCHAR (1 << 8)/* Set in gl_flags if any metachars seen. */
+# define GLOB_ALTDIRFUNC (1 << 9)/* Use gl_opendir et al functions. */
+# define GLOB_BRACE (1 << 10)/* Expand "{a,b}" to "a" "b". */
+# define GLOB_NOMAGIC (1 << 11)/* If no magic chars, return the pattern. */
+# define GLOB_TILDE (1 << 12)/* Expand ~user and ~ to home directories. */
+# define GLOB_ONLYDIR (1 << 13)/* Match only directories. */
+# define GLOB_TILDE_CHECK (1 << 14)/* Like GLOB_TILDE but return an error
+ if the user name is not available. */
+# define __GLOB_FLAGS (GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS| \
+ GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND| \
+ GLOB_PERIOD|GLOB_ALTDIRFUNC|GLOB_BRACE| \
+ GLOB_NOMAGIC|GLOB_TILDE|GLOB_ONLYDIR|GLOB_TILDE_CHECK)
+#else
+# define __GLOB_FLAGS (GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS| \
+ GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND| \
+ GLOB_PERIOD)
+#endif
+
+/* Error returns from `glob'. */
+#define GLOB_NOSPACE 1 /* Ran out of memory. */
+#define GLOB_ABORTED 2 /* Read error. */
+#define GLOB_NOMATCH 3 /* No matches found. */
+#define GLOB_NOSYS 4 /* Not implemented. */
+#ifdef _GNU_SOURCE
+/* Previous versions of this file defined GLOB_ABEND instead of
+ GLOB_ABORTED. Provide a compatibility definition here. */
+# define GLOB_ABEND GLOB_ABORTED
+#endif
+
+/* Structure describing a globbing run. */
+#if !defined _AMIGA && !defined VMS /* Buggy compiler. */
+struct stat;
+#endif
+typedef struct
+ {
+ __size_t gl_pathc; /* Count of paths matched by the pattern. */
+ char **gl_pathv; /* List of matched pathnames. */
+ __size_t gl_offs; /* Slots to reserve in `gl_pathv'. */
+ int gl_flags; /* Set to FLAGS, maybe | GLOB_MAGCHAR. */
+
+ /* If the GLOB_ALTDIRFUNC flag is set, the following functions
+ are used instead of the normal file access functions. */
+ void (*gl_closedir) __PMT ((void *));
+ struct dirent *(*gl_readdir) __PMT ((void *));
+ __ptr_t (*gl_opendir) __PMT ((__const char *));
+ int (*gl_lstat) __PMT ((__const char *, struct stat *));
+ int (*gl_stat) __PMT ((__const char *, struct stat *));
+ } glob_t;
+
+#ifdef _LARGEFILE64_SOURCE
+struct stat64;
+typedef struct
+ {
+ __size_t gl_pathc;
+ char **gl_pathv;
+ __size_t gl_offs;
+ int gl_flags;
+
+ /* If the GLOB_ALTDIRFUNC flag is set, the following functions
+ are used instead of the normal file access functions. */
+ void (*gl_closedir) __PMT ((void *));
+ struct dirent64 *(*gl_readdir) __PMT ((void *));
+ __ptr_t (*gl_opendir) __PMT ((__const char *));
+ int (*gl_lstat) __PMT ((__const char *, struct stat64 *));
+ int (*gl_stat) __PMT ((__const char *, struct stat64 *));
+ } glob64_t;
+#endif
+
+/* Do glob searching for PATTERN, placing results in PGLOB.
+ The bits defined above may be set in FLAGS.
+ If a directory cannot be opened or read and ERRFUNC is not nil,
+ it is called with the pathname that caused the error, and the
+ `errno' value from the failing call; if it returns non-zero
+ `glob' returns GLOB_ABEND; if it returns zero, the error is ignored.
+ If memory cannot be allocated for PGLOB, GLOB_NOSPACE is returned.
+ Otherwise, `glob' returns zero. */
+#if !defined(_FILE_OFFSET_BITS) || _FILE_OFFSET_BITS != 64
+extern int glob __P ((__const char *__pattern, int __flags,
+ int (*__errfunc) (__const char *, int),
+ glob_t *__pglob));
+
+/* Free storage allocated in PGLOB by a previous `glob' call. */
+extern void globfree __P ((glob_t *__pglob));
+#else
+# if __GNUC__ >= 2
+extern int glob __P ((__const char *__pattern, int __flags,
+ int (*__errfunc) (__const char *, int),
+ glob_t *__pglob)) __asm__ ("glob64");
+
+extern void globfree __P ((glob_t *__pglob)) __asm__ ("globfree64");
+# else
+# define glob glob64
+# define globfree globfree64
+# endif
+#endif
+
+#ifdef _LARGEFILE64_SOURCE
+extern int glob64 __P ((__const char *__pattern, int __flags,
+ int (*__errfunc) (__const char *, int),
+ glob64_t *__pglob));
+
+extern void globfree64 __P ((glob64_t *__pglob));
+#endif
+
+
+#ifdef _GNU_SOURCE
+/* Return nonzero if PATTERN contains any metacharacters.
+ Metacharacters can be quoted with backslashes if QUOTE is nonzero.
+
+ This function is not part of the interface specified by POSIX.2
+ but several programs want to use it. */
+extern int glob_pattern_p __P ((__const char *__pattern, int __quote));
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* glob.h */
diff --git a/lib/mkstemp.c b/lib/mkstemp.c
new file mode 100644
index 0000000..5a1eecf
--- /dev/null
+++ b/lib/mkstemp.c
@@ -0,0 +1,40 @@
+/* Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc.
+ This file is derived from the one in the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include <config.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "common.h"
+
+#ifndef __GT_FILE
+# define __GT_FILE 0
+#endif
+
+int __gen_tempname ();
+
+/* Generate a unique temporary file name from TEMPLATE.
+ The last six characters of TEMPLATE must be "XXXXXX";
+ they are replaced with a string that makes the filename unique.
+ Then open the file and return a fd. */
+int
+cad_mkstemp (char *template)
+{
+ return __gen_tempname (template, __GT_FILE);
+}
diff --git a/lib/netrc.c b/lib/netrc.c
new file mode 100644
index 0000000..0114bb9
--- /dev/null
+++ b/lib/netrc.c
@@ -0,0 +1,425 @@
+/* netrc.c -- parse the .netrc file to get hosts, accounts, and passwords
+
+ Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 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 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+ For license terms, see the file COPYING in this directory.
+
+ Compile with -DSTANDALONE to test this module. */
+
+#include <stdio.h>
+#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <config.h>
+#include "netrc.h"
+
+/* Normally defined in xstrdup.c. */
+# define xstrdup strdup
+
+/* Normally defined in xmalloc.c */
+# define xmalloc malloc
+# define xrealloc realloc
+
+#define POPBUFSIZE BUFSIZ
+
+/* Maybe add NEWENTRY to the account information list, LIST. NEWENTRY is
+ set to a ready-to-use netrc_entry, in any event. */
+static void
+maybe_add_to_list (netrc_entry **newentry, netrc_entry **list)
+{
+ netrc_entry *a, *l;
+ a = *newentry;
+ l = *list;
+
+ /* We need an account name in order to add the entry to the list. */
+ if (a && ! a->account)
+ {
+ /* Free any allocated space. */
+ if (a->host)
+ free (a->host);
+ if (a->password)
+ free (a->password);
+ }
+ else
+ {
+ if (a)
+ {
+ /* Add the current machine into our list. */
+ a->next = l;
+ l = a;
+ }
+
+ /* Allocate a new netrc_entry structure. */
+ a = (netrc_entry *) xmalloc (sizeof (netrc_entry));
+ }
+
+ /* Zero the structure, so that it is ready to use. */
+ memset (a, 0, sizeof(*a));
+
+ /* Return the new pointers. */
+ *newentry = a;
+ *list = l;
+ return;
+}
+
+
+/* Parse FILE as a .netrc file (as described in ftp(1)), and return a
+ list of entries. NULL is returned if the file could not be
+ parsed. */
+netrc_entry *
+parse_netrc (file)
+ char *file;
+{
+ FILE *fp;
+ char buf[POPBUFSIZE+1], *p, *tok;
+ const char *premature_token;
+ netrc_entry *current, *retval;
+ int ln;
+
+ /* The latest token we've seen in the file. */
+ enum
+ {
+ tok_nothing, tok_account, tok_login, tok_macdef, tok_machine, tok_password
+ } last_token = tok_nothing;
+
+ current = retval = NULL;
+
+ fp = fopen (file, "r");
+ if (!fp)
+ {
+ /* Just return NULL if we can't open the file. */
+ return NULL;
+ }
+
+ /* Initialize the file data. */
+ ln = 0;
+ premature_token = NULL;
+
+ /* While there are lines in the file... */
+ while (fgets(buf, POPBUFSIZE, fp))
+ {
+ ln++;
+
+ /* Strip trailing CRLF */
+ for (p = buf + strlen(buf) - 1; (p >= buf) && isspace((unsigned)*p); p--)
+ *p = '\0';
+
+ /* Parse the line. */
+ p = buf;
+
+ /* If the line is empty... */
+ if (!*p) {
+ if (last_token == tok_macdef) { /* end of macro */
+ last_token = tok_nothing;
+ } else {
+ continue; /* otherwise ignore it */
+ }
+ }
+
+ /* If we are defining macros, then skip parsing the line. */
+ while (*p && last_token != tok_macdef)
+ {
+ char quote_char = 0;
+ char *pp;
+
+ /* Skip any whitespace. */
+ while (*p && isspace ((unsigned)*p))
+ p++;
+
+ /* Discard end-of-line comments. */
+ if (*p == '#')
+ break;
+
+ tok = pp = p;
+
+ /* Find the end of the token. */
+ while (*p && (quote_char || !isspace ((unsigned)*p)))
+ {
+ if (quote_char)
+ {
+ if (quote_char == *p)
+ {
+ quote_char = 0;
+ p ++;
+ }
+ else
+ {
+ *pp = *p;
+ p ++;
+ pp ++;
+ }
+ }
+ else
+ {
+ if (*p == '"' || *p == '\'')
+ quote_char = *p;
+ else
+ {
+ *pp = *p;
+ pp ++;
+ }
+ p ++;
+ }
+ }
+ /* Null-terminate the token, if it isn't already. */
+ if (*p)
+ *p ++ = '\0';
+ *pp = 0;
+
+ switch (last_token)
+ {
+ case tok_login:
+ if (current)
+ current->account = (char *) xstrdup (tok);
+ else
+ premature_token = "login";
+ break;
+
+ case tok_machine:
+ /* Start a new machine entry. */
+ maybe_add_to_list (&current, &retval);
+ current->host = (char *) xstrdup (tok);
+ break;
+
+ case tok_password:
+ if (current)
+ current->password = (char *) xstrdup (tok);
+ else
+ premature_token = "password";
+ break;
+
+ /* We handle most of tok_macdef above. */
+ case tok_macdef:
+ if (!current)
+ premature_token = "macdef";
+ break;
+
+ /* We don't handle the account keyword at all. */
+ case tok_account:
+ if (!current)
+ premature_token = "account";
+ break;
+
+ /* We handle tok_nothing below this switch. */
+ case tok_nothing:
+ break;
+ }
+
+ if (premature_token)
+ {
+#ifdef HAVE_ERROR
+ error_at_line (0, file, ln,
+ "warning: found \"%s\" before any host names",
+ premature_token);
+#else
+ fprintf (stderr,
+ "%s:%d: warning: found \"%s\" before any host names\n",
+ file, ln, premature_token);
+#endif
+ premature_token = NULL;
+ }
+
+ if (last_token != tok_nothing)
+ /* We got a value, so reset the token state. */
+ last_token = tok_nothing;
+ else
+ {
+ /* Fetch the next token. */
+ if (!strcmp (tok, "default"))
+ {
+ maybe_add_to_list (&current, &retval);
+ }
+ else if (!strcmp (tok, "login"))
+ last_token = tok_login;
+
+ else if (!strcmp (tok, "user"))
+ last_token = tok_login;
+
+ else if (!strcmp (tok, "macdef"))
+ last_token = tok_macdef;
+
+ else if (!strcmp (tok, "machine"))
+ last_token = tok_machine;
+
+ else if (!strcmp (tok, "password"))
+ last_token = tok_password;
+
+ else if (!strcmp (tok, "passwd"))
+ last_token = tok_password;
+
+ else if (!strcmp (tok, "account"))
+ last_token = tok_account;
+
+ else
+ {
+ fprintf (stderr, "%s:%d: warning: unknown token \"%s\"\n",
+ file, ln, tok);
+ }
+ }
+ }
+ }
+
+ fclose (fp);
+
+ /* Finalize the last machine entry we found. */
+ maybe_add_to_list (&current, &retval);
+ free (current);
+
+ /* Reverse the order of the list so that it appears in file order. */
+ current = retval;
+ retval = NULL;
+ while (current)
+ {
+ netrc_entry *saved_reference;
+
+ /* Change the direction of the pointers. */
+ saved_reference = current->next;
+ current->next = retval;
+
+ /* Advance to the next node. */
+ retval = current;
+ current = saved_reference;
+ }
+
+ return retval;
+}
+
+
+/* Return the netrc entry from LIST corresponding to HOST. NULL is
+ returned if no such entry exists. */
+netrc_entry *
+search_netrc (list, host)
+ netrc_entry *list;
+ const char *host;
+{
+ /* Look for the HOST in LIST. */
+ while (list)
+ {
+ if (!list->host)
+ /* We hit the default entry. */
+ break;
+
+ else if (!strcmp (list->host, host))
+ /* We found a matching entry. */
+ break;
+
+ list = list->next;
+ }
+
+ /* Return the matching entry, or NULL. */
+ return list;
+}
+
+
+#ifdef STANDALONE
+#include <sys/types.h>
+#include <sys/stat.h>
+
+extern int errno;
+
+int
+main (argc, argv)
+ int argc;
+ char **argv;
+{
+ struct stat sb;
+ char *program_name, *file, *target;
+ netrc_entry *head, *a;
+
+ if (argc < 2)
+ {
+ fprintf (stderr, "Usage: %s NETRC [HOSTNAME]...\n", argv[0]);
+ exit (1);
+ }
+
+ program_name = argv[0];
+ file = argv[1];
+ target = argv[2];
+
+ if (stat (file, &sb))
+ {
+ fprintf (stderr, "%s: cannot stat %s: %s\n", argv[0], file,
+ strerror (errno));
+ exit (1);
+ }
+
+ head = parse_netrc (file);
+ if (!head)
+ {
+ fprintf (stderr, "%s: no entries found in %s\n", argv[0], file);
+ exit (1);
+ }
+
+ if (argc > 2)
+ {
+ int i, status;
+ status = 0;
+ for (i = 2; i < argc; i++)
+ {
+ /* Print out the host that we are checking for. */
+ fputs (argv[i], stdout);
+
+ a = search_netrc (head, argv[i]);
+ if (a)
+ {
+ /* Print out the account and password (if any). */
+ fputc (' ', stdout);
+ fputs (a->account, stdout);
+ if (a->password)
+ {
+ fputc (' ', stdout);
+ fputs (a->password, stdout);
+ }
+ }
+ else
+ status = 1;
+
+ fputc ('\n', stdout);
+ }
+ exit (status);
+ }
+
+ /* Print out the entire contents of the netrc. */
+ a = head;
+ while (a)
+ {
+ /* Print the host name. */
+ if (a->host)
+ fputs (a->host, stdout);
+ else
+ fputs ("DEFAULT", stdout);
+
+ fputc (' ', stdout);
+
+ /* Print the account name. */
+ fputs (a->account, stdout);
+
+ if (a->password)
+ {
+ /* Print the password, if there is any. */
+ fputc (' ', stdout);
+ fputs (a->password, stdout);
+ }
+
+ fputc ('\n', stdout);
+ a = a->next;
+ }
+
+ exit (0);
+}
+#endif /* STANDALONE */
diff --git a/lib/netrc.h b/lib/netrc.h
new file mode 100644
index 0000000..66916b0
--- /dev/null
+++ b/lib/netrc.h
@@ -0,0 +1,65 @@
+/* netrc.h -- declarations for netrc.c
+ Copyright (C) 1996, Free Software Foundation, Inc.
+ Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 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 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#ifndef _NETRC_H_
+#define _NETRC_H_ 1
+
+# undef __BEGIN_DECLS
+# undef __END_DECLS
+#ifdef __cplusplus
+# define __BEGIN_DECLS extern "C" {
+# define __END_DECLS }
+#else
+# define __BEGIN_DECLS /* empty */
+# define __END_DECLS /* empty */
+#endif
+
+#undef __P
+#if defined (__STDC__) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4)) || defined(WIN32) || defined(__cplusplus)
+# define __P(protos) protos
+#else
+# define __P(protos) ()
+#endif
+
+/* The structure used to return account information from the .netrc. */
+typedef struct _netrc_entry {
+ /* The exact host name given in the .netrc, NULL if default. */
+ char *host;
+
+ /* The name of the account. */
+ char *account;
+
+ /* Password for the account (NULL, if none). */
+ char *password;
+
+ /* Pointer to the next entry in the list. */
+ struct _netrc_entry *next;
+} netrc_entry;
+
+__BEGIN_DECLS
+/* Parse FILE as a .netrc file (as described in ftp(1)), and return a
+ list of entries. NULL is returned if the file could not be
+ parsed. */
+netrc_entry *parse_netrc __P((char *file));
+
+/* Return the netrc entry from LIST corresponding to HOST. NULL is
+ returned if no such entry exists. */
+netrc_entry *search_netrc __P((netrc_entry *list, const char *host));
+__END_DECLS
+
+#endif /* _NETRC_H_ */
diff --git a/lib/rpmatch.c b/lib/rpmatch.c
new file mode 100644
index 0000000..34ed7cf
--- /dev/null
+++ b/lib/rpmatch.c
@@ -0,0 +1,84 @@
+/* Determine whether string value is affirmation or negative response
+ according to current locale's data.
+ Copyright (C) 1996, 1998 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#if HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if STDC_HEADERS || _LIBC
+# include <stddef.h>
+# include <stdlib.h>
+#else
+# ifndef NULL
+# define NULL 0
+# endif
+#endif
+
+#ifdef ENABLE_NLS
+# include <sys/types.h>
+# include <regex.h>
+# include <libintl.h>
+# define _(Text) gettext (Text)
+
+static int
+try (const char *response, const char *pattern, const int match,
+ const int nomatch, const char **lastp, regex_t *re)
+{
+ if (pattern != *lastp)
+ {
+ /* The pattern has changed. */
+ if (*lastp)
+ {
+ /* Free the old compiled pattern. */
+ regfree (re);
+ *lastp = NULL;
+ }
+ /* Compile the pattern and cache it for future runs. */
+ if (regcomp (re, pattern, REG_EXTENDED) != 0)
+ return -1;
+ *lastp = pattern;
+ }
+
+ /* See if the regular expression matches RESPONSE. */
+ return regexec (re, response, 0, NULL, 0) == 0 ? match : nomatch;
+}
+#endif
+
+
+int
+rpmatch (const char *response)
+{
+#ifdef ENABLE_NLS
+ /* Match against one of the response patterns, compiling the pattern
+ first if necessary. */
+
+ /* We cache the response patterns and compiled regexps here. */
+ static const char *yesexpr, *noexpr;
+ static regex_t yesre, nore;
+ int result;
+
+ return ((result = try (response, _("^[yY]"), 1, 0,
+ &yesexpr, &yesre))
+ ? result
+ : try (response, _("^[nN]"), 0, -1, &noexpr, &nore));
+#else
+ /* Test against "^[yY]" and "^[nN]", hardcoded to avoid requiring regex */
+ return (*response == 'y' || *response == 'Y' ? 1
+ : *response == 'n' || *response == 'N' ? 0 : -1);
+#endif
+}
diff --git a/lib/snprintf.c b/lib/snprintf.c
new file mode 100644
index 0000000..4984117
--- /dev/null
+++ b/lib/snprintf.c
@@ -0,0 +1,835 @@
+
+/*
+ Unix snprintf implementation.
+ Version 1.1
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+ Revision History:
+
+ sitecopy changes:
+ renamed dtoa -> doubletoa to avoid dtoa conflict with cygwin.
+
+
+ 1.1:
+ * added changes from Miles Bader
+ * corrected a bug with %f
+ * added support for %#g
+ * added more comments :-)
+ 1.0:
+ * supporting must ANSI syntaxic_sugars
+ 0.0:
+ * suppot %s %c %d
+
+ THANKS(for the patches and ideas):
+ Miles Bader
+ Cyrille Rustom
+ Jacek Slabocewiz
+ Mike Parker(mouse)
+
+*/
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "snprintf.h"
+
+#ifdef HAVE_STRING_H
+#include <string.h> /* for strlen() */
+#endif
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h> /* for atoi() */
+#endif
+#include <ctype.h>
+
+
+/*
+ * Find the nth power of 10
+ */
+PRIVATE double
+#ifdef __STDC__
+pow_10(int n)
+#else
+pow_10(n)
+int n;
+#endif
+{
+ int i;
+ double P;
+
+ if (n < 0)
+ for (i = 1, P = 1., n = -n ; i <= n ; i++) {P *= .1;}
+ else
+ for (i = 1, P = 1. ; i <= n ; i++) {P *= 10.0;}
+ return P;
+}
+
+/*
+ * Find the integral part of the log in base 10
+ * Note: this not a real log10()
+ I just need and approximation(integerpart) of x in:
+ 10^x ~= r
+ * log_10(200) = 2;
+ * log_10(250) = 2;
+ */
+PRIVATE int
+#ifdef __STDC__
+log_10(double r)
+#else
+log_10(r)
+double r;
+#endif
+{
+ int i = 0;
+ double result = 1.;
+
+ if (r < 0.)
+ r = -r;
+
+ if (r < 1.) {
+ while (result >= r) {result *= .1; i++;}
+ return (-i);
+ } else {
+ while (result <= r) {result *= 10.; i++;}
+ return (i - 1);
+ }
+}
+
+/*
+ * This function return the fraction part of a double
+ * and set in ip the integral part.
+ * In many ways it resemble the modf() found on most Un*x
+ */
+PRIVATE double
+#ifdef __STDC__
+integral(double real, double * ip)
+#else
+integral(real, ip)
+double real;
+double * ip;
+#endif
+{
+ int j;
+ double i, s, p;
+ double real_integral = 0.;
+
+/* take care of the obvious */
+/* equal to zero ? */
+ if (real == 0.) {
+ *ip = 0.;
+ return (0.);
+ }
+
+/* negative number ? */
+ if (real < 0.)
+ real = -real;
+
+/* a fraction ? */
+ if ( real < 1.) {
+ *ip = 0.;
+ return real;
+ }
+/* the real work :-) */
+ for (j = log_10(real); j >= 0; j--) {
+ p = pow_10(j);
+ s = (real - real_integral)/p;
+ i = 0.;
+ while (i + 1. <= s) {i++;}
+ real_integral += i*p;
+ }
+ *ip = real_integral;
+ return (real - real_integral);
+}
+
+#define PRECISION 1.e-6
+/*
+ * return an ascii representation of the integral part of the number
+ * and set fract to be an ascii representation of the fraction part
+ * the container for the fraction and the integral part or staticly
+ * declare with fix size
+ */
+PRIVATE char *
+#ifdef __STDC__
+numtoa(double number, int base, int precision, char ** fract)
+#else
+numtoa(number, base, precision, fract)
+double number;
+int base;
+int precision;
+char ** fract;
+#endif
+{
+ register int i, j;
+ double ip, fp; /* integer and fraction part */
+ double fraction;
+ int digits = MAX_INT - 1;
+ static char integral_part[MAX_INT];
+ static char fraction_part[MAX_FRACT];
+ double sign;
+ int ch;
+
+/* taking care of the obvious case: 0.0 */
+ if (number == 0.) {
+ integral_part[0] = '0';
+ integral_part[1] = '\0';
+ fraction_part[0] = '0';
+ fraction_part[1] = '\0';
+ return integral_part;
+ }
+
+/* for negative numbers */
+ if ((sign = number) < 0.) {
+ number = -number;
+ digits--; /* sign consume one digit */
+ }
+
+ fraction = integral(number, &ip);
+ number = ip;
+/* do the integral part */
+ if ( ip == 0.) {
+ integral_part[0] = '0';
+ i = 1;
+ } else {
+ for ( i = 0; i < digits && number != 0.; ++i) {
+ number /= base;
+ fp = integral(number, &ip);
+ ch = (int)((fp + PRECISION)*base); /* force to round */
+ integral_part[i] = (ch <= 9) ? ch + '0' : ch + 'a' - 10;
+ if (! isxdigit(integral_part[i])) /* bail out overflow !! */
+ break;
+ number = ip;
+ }
+ }
+
+/* Oh No !! out of bound, ho well fill it up ! */
+ if (number != 0.)
+ for (i = 0; i < digits; ++i)
+ integral_part[i] = '9';
+
+/* put the sign ? */
+ if (sign < 0.)
+ integral_part[i++] = '-';
+
+ integral_part[i] = '\0';
+
+/* reverse every thing */
+ for ( i--, j = 0; j < i; j++, i--)
+ SWAP_INT(integral_part[i], integral_part[j]);
+
+/* the fractionnal part */
+ for (i=0, fp=fraction; precision > 0 && i < MAX_FRACT ; i++, precision-- ) {
+ fraction_part[i] = (int)((fp + PRECISION)*10. + '0');
+ if (! isdigit(fraction_part[i])) /* underflow ? */
+ break;
+ fp = (fp*10.0) - (double)(long)((fp + PRECISION)*10.);
+ }
+ fraction_part[i] = '\0';
+
+ if (fract != (char **)0)
+ *fract = fraction_part;
+
+ return integral_part;
+
+}
+
+/* for %d and friends, it puts in holder
+ * the representation with the right padding
+ */
+PRIVATE void
+#ifdef __STDC__
+decimal(struct DATA *p, double d)
+#else
+decimal(p, d)
+struct DATA *p;
+double d;
+#endif
+{
+ char *tmp;
+
+ tmp = itoa(d);
+ p->width -= strlen(tmp);
+ PAD_RIGHT(p);
+ PUT_PLUS(d, p);
+ PUT_SPACE(d, p);
+ while (*tmp) { /* the integral */
+ PUT_CHAR(*tmp, p);
+ tmp++;
+ }
+ PAD_LEFT(p);
+}
+
+/* for %o octal representation */
+PRIVATE void
+#ifdef __STDC__
+octal(struct DATA *p, double d)
+#else
+octal(p, d)
+struct DATA *p;
+double d;
+#endif
+{
+ char *tmp;
+
+ tmp = otoa(d);
+ p->width -= strlen(tmp);
+ PAD_RIGHT(p);
+ if (p->square == FOUND) /* had prefix '0' for octal */
+ PUT_CHAR('0', p);
+ while (*tmp) { /* octal */
+ PUT_CHAR(*tmp, p);
+ tmp++;
+ }
+ PAD_LEFT(p);
+}
+
+/* for %x %X hexadecimal representation */
+PRIVATE void
+#ifdef __STDC__
+hexa(struct DATA *p, double d)
+#else
+hexa(p, d)
+struct DATA *p;
+double d;
+#endif
+{
+ char *tmp;
+
+ tmp = htoa(d);
+ p->width -= strlen(tmp);
+ PAD_RIGHT(p);
+ if (p->square == FOUND) { /* prefix '0x' for hexa */
+ PUT_CHAR('0', p); PUT_CHAR(*p->pf, p);
+ }
+ while (*tmp) { /* hexa */
+ PUT_CHAR((*p->pf == 'X' ? toupper(*tmp) : *tmp), p);
+ tmp++;
+ }
+ PAD_LEFT(p);
+}
+
+/* %s strings */
+PRIVATE void
+#ifdef __STDC__
+strings(struct DATA *p, char *tmp)
+#else
+strings(p, tmp)
+struct DATA *p;
+char *tmp;
+#endif
+{
+ int i;
+
+ i = strlen(tmp);
+ if (p->precision != NOT_FOUND) /* the smallest number */
+ i = (i < p->precision ? i : p->precision);
+ p->width -= i;
+ PAD_RIGHT(p);
+ while (i-- > 0) { /* put the sting */
+ PUT_CHAR(*tmp, p);
+ tmp++;
+ }
+ PAD_LEFT(p);
+}
+
+/* %f or %g floating point representation */
+PRIVATE void
+#ifdef __STDC__
+floating(struct DATA *p, double d)
+#else
+floating(p, d)
+struct DATA *p;
+double d;
+#endif
+{
+ char *tmp, *tmp2;
+ int i;
+
+ DEF_PREC(p);
+ d = ROUND(d, p);
+ tmp = doubletoa(d, p->precision, &tmp2);
+ /* calculate the padding. 1 for the dot */
+ p->width = p->width -
+ ((d > 0. && p->justify == RIGHT) ? 1:0) -
+ ((p->space == FOUND) ? 1:0) -
+ strlen(tmp) - p->precision - 1;
+ PAD_RIGHT(p);
+ PUT_PLUS(d, p);
+ PUT_SPACE(d, p);
+ while (*tmp) { /* the integral */
+ PUT_CHAR(*tmp, p);
+ tmp++;
+ }
+ if (p->precision != 0 || p->square == FOUND)
+ PUT_CHAR('.', p); /* put the '.' */
+ if (*p->pf == 'g' || *p->pf == 'G') /* smash the trailing zeros */
+ for (i = strlen(tmp2) - 1; i >= 0 && tmp2[i] == '0'; i--)
+ tmp2[i] = '\0';
+ for (; *tmp2; tmp2++)
+ PUT_CHAR(*tmp2, p); /* the fraction */
+
+ PAD_LEFT(p);
+}
+
+/* %e %E %g exponent representation */
+PRIVATE void
+#ifdef __STDC__
+exponent(struct DATA *p, double d)
+#else
+exponent(p, d)
+struct DATA *p;
+double d;
+#endif
+{
+ char *tmp, *tmp2;
+ int j, i;
+
+ DEF_PREC(p);
+ j = log_10(d);
+ d = d / pow_10(j); /* get the Mantissa */
+ d = ROUND(d, p);
+ tmp = doubletoa(d, p->precision, &tmp2);
+ /* 1 for unit, 1 for the '.', 1 for 'e|E',
+ * 1 for '+|-', 3 for 'exp' */
+ /* calculate how much padding need */
+ p->width = p->width -
+ ((d > 0. && p->justify == RIGHT) ? 1:0) -
+ ((p->space == FOUND) ? 1:0) - p->precision - 7;
+ PAD_RIGHT(p);
+ PUT_PLUS(d, p);
+ PUT_SPACE(d, p);
+ while (*tmp) {/* the integral */
+ PUT_CHAR(*tmp, p);
+ tmp++;
+ }
+ if (p->precision != 0 || p->square == FOUND)
+ PUT_CHAR('.', p); /* the '.' */
+ if (*p->pf == 'g' || *p->pf == 'G') /* smash the trailing zeros */
+ for (i = strlen(tmp2) - 1; i >= 0 && tmp2[i] == '0'; i--)
+ tmp2[i] = '\0';
+ for (; *tmp2; tmp2++)
+ PUT_CHAR(*tmp2, p); /* the fraction */
+
+ if (*p->pf == 'g' || *p->pf == 'e') { /* the exponent put the 'e|E' */
+ PUT_CHAR('e', p);
+ } else
+ PUT_CHAR('E', p);
+ if (j > 0) { /* the sign of the exp */
+ PUT_CHAR('+', p);
+ } else {
+ PUT_CHAR('-', p);
+ j = -j;
+ }
+ tmp = itoa((double)j);
+ if (j < 9) { /* need to pad the exponent with 0 '000' */
+ PUT_CHAR('0', p); PUT_CHAR('0', p);
+ } else if (j < 99)
+ PUT_CHAR('0', p);
+ while (*tmp) { /* the exponent */
+ PUT_CHAR(*tmp, p);
+ tmp++;
+ }
+ PAD_LEFT(p);
+}
+
+/* initialize the conversion specifiers */
+PRIVATE void
+#ifdef __STDC__
+conv_flag(char * s, struct DATA * p)
+#else
+conv_flag(s, p)
+char * s;
+struct DATA * p;
+#endif
+{
+ char number[MAX_FIELD/2];
+ int i;
+
+ p->precision = p->width = NOT_FOUND;
+ p->star_w = p->star_p = NOT_FOUND;
+ p->square = p->space = NOT_FOUND;
+ p->a_long = p->justify = NOT_FOUND;
+ p->pad = ' ';
+
+ for(;s && *s ;s++) {
+ switch(*s) {
+ case ' ': p->space = FOUND; break;
+ case '#': p->square = FOUND; break;
+ case '*': if (p->width == NOT_FOUND)
+ p->width = p->star_w = FOUND;
+ else
+ p->precision = p->star_p = FOUND;
+ break;
+ case '+': p->justify = RIGHT; break;
+ case '-': p->justify = LEFT; break;
+ case '.': if (p->width == NOT_FOUND)
+ p->width = 0;
+ break;
+ case '0': p->pad = '0'; break;
+ case '1': case '2': case '3':
+ case '4': case '5': case '6':
+ case '7': case '8': case '9': /* gob all the digits */
+ for (i = 0; isdigit(*s); i++, s++)
+ if (i < MAX_FIELD/2 - 1)
+ number[i] = *s;
+ number[i] = '\0';
+ if (p->width == NOT_FOUND)
+ p->width = atoi(number);
+ else
+ p->precision = atoi(number);
+ s--; /* went to far go back */
+ break;
+ }
+ }
+}
+
+PUBLIC int
+#ifdef __STDC__
+vsnprintf(char *string, size_t length, const char * format, va_list args)
+#else
+vsnprintf(string, length, format, args)
+char *string;
+size_t length;
+char * format;
+va_list args;
+#endif
+{
+ struct DATA data;
+ char conv_field[MAX_FIELD];
+ double d; /* temporary holder */
+ int state;
+ int i;
+
+ data.length = length - 1; /* leave room for '\0' */
+ data.holder = string;
+ data.pf = format;
+ data.counter = 0;
+
+
+/* sanity check, the string must be > 1 */
+ if (length < 1)
+ return -1;
+
+
+ for (; *data.pf && (data.counter < data.length); data.pf++) {
+ if ( *data.pf == '%' ) { /* we got a magic % cookie */
+ conv_flag((char *)0, &data); /* initialise format flags */
+ for (state = 1; *data.pf && state;) {
+ switch (*(++data.pf)) {
+ case '\0': /* a NULL here ? ? bail out */
+ *data.holder = '\0';
+ return data.counter;
+ break;
+ case 'f': /* float, double */
+ STAR_ARGS(&data);
+ d = va_arg(args, double);
+ floating(&data, d);
+ state = 0;
+ break;
+ case 'g':
+ case 'G':
+ STAR_ARGS(&data);
+ DEF_PREC(&data);
+ d = va_arg(args, double);
+ i = log_10(d);
+ /*
+ * for '%g|%G' ANSI: use f if exponent
+ * is in the range or [-4,p] exclusively
+ * else use %e|%E
+ */
+ if (-4 < i && i < data.precision)
+ floating(&data, d);
+ else
+ exponent(&data, d);
+ state = 0;
+ break;
+ case 'e':
+ case 'E': /* Exponent double */
+ STAR_ARGS(&data);
+ d = va_arg(args, double);
+ exponent(&data, d);
+ state = 0;
+ break;
+ case 'u':
+ case 'd': /* decimal */
+ STAR_ARGS(&data);
+ if (data.a_long == FOUND)
+ d = va_arg(args, long);
+ else
+ d = va_arg(args, int);
+ decimal(&data, d);
+ state = 0;
+ break;
+ case 'o': /* octal */
+ STAR_ARGS(&data);
+ if (data.a_long == FOUND)
+ d = va_arg(args, long);
+ else
+ d = va_arg(args, int);
+ octal(&data, d);
+ state = 0;
+ break;
+ case 'x':
+ case 'X': /* hexadecimal */
+ STAR_ARGS(&data);
+ if (data.a_long == FOUND)
+ d = va_arg(args, long);
+ else
+ d = va_arg(args, int);
+ hexa(&data, d);
+ state = 0;
+ break;
+ case 'c': /* character */
+ d = va_arg(args, int);
+ PUT_CHAR(d, &data);
+ state = 0;
+ break;
+ case 's': /* string */
+ STAR_ARGS(&data);
+ strings(&data, va_arg(args, char *));
+ state = 0;
+ break;
+ case 'n':
+ *(va_arg(args, int *)) = data.counter; /* what's the count ? */
+ state = 0;
+ break;
+ case 'l':
+ data.a_long = FOUND;
+ break;
+ case 'h':
+ break;
+ case '%': /* nothing just % */
+ PUT_CHAR('%', &data);
+ state = 0;
+ break;
+ case '#': case ' ': case '+': case '*':
+ case '-': case '.': case '0': case '1':
+ case '2': case '3': case '4': case '5':
+ case '6': case '7': case '8': case '9':
+ /* initialize width and precision */
+ for (i = 0; isflag(*data.pf); i++, data.pf++)
+ if (i < MAX_FIELD - 1)
+ conv_field[i] = *data.pf;
+ conv_field[i] = '\0';
+ conv_flag(conv_field, &data);
+ data.pf--; /* went to far go back */
+ break;
+ default:
+ /* is this an error ? maybe bail out */
+ state = 0;
+ break;
+ } /* end switch */
+ } /* end of for state */
+ } else { /* not % */
+ PUT_CHAR(*data.pf, &data); /* add the char the string */
+ }
+ }
+
+ *data.holder = '\0'; /* the end ye ! */
+
+ return data.counter;
+}
+
+#ifndef HAVE_SNPRINTF
+
+PUBLIC int
+#if defined(HAVE_STDARG_H) && defined(__STDC__) && __STDC__
+snprintf(char *string, size_t length, const char * format, ...)
+#else
+snprintf(string, length, format, va_alist)
+char *string;
+size_t length;
+char * format;
+va_dcl
+#endif
+{
+ int rval;
+ va_list args;
+
+#if defined(HAVE_STDARG_H) && defined(__STDC__) && __STDC__
+ va_start(args, format);
+#else
+ va_start(args);
+#endif
+
+ rval = vsnprintf (string, length, format, args);
+
+ va_end(args);
+
+ return rval;
+}
+
+#endif /* HAVE_SNPRINTF */
+
+
+#ifdef DRIVER
+
+#include <stdio.h>
+
+/* set of small tests for snprintf() */
+void main()
+{
+ char holder[100];
+ int i;
+
+/*
+ printf("Suite of test for snprintf:\n");
+ printf("a_format\n");
+ printf("printf() format\n");
+ printf("snprintf() format\n\n");
+*/
+/* Checking the field widths */
+
+ printf("/%%d/, 336\n");
+ snprintf(holder, sizeof holder, "/%d/\n", 336);
+ printf("/%d/\n", 336);
+ printf("%s\n", holder);
+
+ printf("/%%2d/, 336\n");
+ snprintf(holder, sizeof holder, "/%2d/\n", 336);
+ printf("/%2d/\n", 336);
+ printf("%s\n", holder);
+
+ printf("/%%10d/, 336\n");
+ snprintf(holder, sizeof holder, "/%10d/\n", 336);
+ printf("/%10d/\n", 336);
+ printf("%s\n", holder);
+
+ printf("/%%-10d/, 336\n");
+ snprintf(holder, sizeof holder, "/%-10d/\n", 336);
+ printf("/%-10d/\n", 336);
+ printf("%s\n", holder);
+
+
+/* floating points */
+
+ printf("/%%f/, 1234.56\n");
+ snprintf(holder, sizeof holder, "/%f/\n", 1234.56);
+ printf("/%f/\n", 1234.56);
+ printf("%s\n", holder);
+
+ printf("/%%e/, 1234.56\n");
+ snprintf(holder, sizeof holder, "/%e/\n", 1234.56);
+ printf("/%e/\n", 1234.56);
+ printf("%s\n", holder);
+
+ printf("/%%4.2f/, 1234.56\n");
+ snprintf(holder, sizeof holder, "/%4.2f/\n", 1234.56);
+ printf("/%4.2f/\n", 1234.56);
+ printf("%s\n", holder);
+
+ printf("/%%3.1f/, 1234.56\n");
+ snprintf(holder, sizeof holder, "/%3.1f/\n", 1234.56);
+ printf("/%3.1f/\n", 1234.56);
+ printf("%s\n", holder);
+
+ printf("/%%10.3f/, 1234.56\n");
+ snprintf(holder, sizeof holder, "/%10.3f/\n", 1234.56);
+ printf("/%10.3f/\n", 1234.56);
+ printf("%s\n", holder);
+
+ printf("/%%10.3e/, 1234.56\n");
+ snprintf(holder, sizeof holder, "/%10.3e/\n", 1234.56);
+ printf("/%10.3e/\n", 1234.56);
+ printf("%s\n", holder);
+
+ printf("/%%+4.2f/, 1234.56\n");
+ snprintf(holder, sizeof holder, "/%+4.2f/\n", 1234.56);
+ printf("/%+4.2f/\n", 1234.56);
+ printf("%s\n", holder);
+
+ printf("/%%010.2f/, 1234.56\n");
+ snprintf(holder, sizeof holder, "/%010.2f/\n", 1234.56);
+ printf("/%010.2f/\n", 1234.56);
+ printf("%s\n", holder);
+
+#define BLURB "Outstanding acting !"
+/* strings precisions */
+
+ printf("/%%2s/, \"%s\"\n", BLURB);
+ snprintf(holder, sizeof holder, "/%2s/\n", BLURB);
+ printf("/%2s/\n", BLURB);
+ printf("%s\n", holder);
+
+ printf("/%%22s/ %s\n", BLURB);
+ snprintf(holder, sizeof holder, "/%22s/\n", BLURB);
+ printf("/%22s/\n", BLURB);
+ printf("%s\n", holder);
+
+ printf("/%%22.5s/ %s\n", BLURB);
+ snprintf(holder, sizeof holder, "/%22.5s/\n", BLURB);
+ printf("/%22.5s/\n", BLURB);
+ printf("%s\n", holder);
+
+ printf("/%%-22.5s/ %s\n", BLURB);
+ snprintf(holder, sizeof holder, "/%-22.5s/\n", BLURB);
+ printf("/%-22.5s/\n", BLURB);
+ printf("%s\n", holder);
+
+/* see some flags */
+
+ printf("%%x %%X %%#x, 31, 31, 31\n");
+ snprintf(holder, sizeof holder, "%x %X %#x\n", 31, 31, 31);
+ printf("%x %X %#x\n", 31, 31, 31);
+ printf("%s\n", holder);
+
+ printf("**%%d**%% d**%% d**, 42, 42, -42\n");
+ snprintf(holder, sizeof holder, "**%d**% d**% d**\n", 42, 42, -42);
+ printf("**%d**% d**% d**\n", 42, 42, -42);
+ printf("%s\n", holder);
+
+/* other flags */
+
+ printf("/%%g/, 31.4\n");
+ snprintf(holder, sizeof holder, "/%g/\n", 31.4);
+ printf("/%g/\n", 31.4);
+ printf("%s\n", holder);
+
+ printf("/%%.6g/, 31.4\n");
+ snprintf(holder, sizeof holder, "/%.6g/\n", 31.4);
+ printf("/%.6g/\n", 31.4);
+ printf("%s\n", holder);
+
+ printf("/%%.1G/, 31.4\n");
+ snprintf(holder, sizeof holder, "/%.1G/\n", 31.4);
+ printf("/%.1G/\n", 31.4);
+ printf("%s\n", holder);
+
+ printf("abc%%n\n");
+ printf("abc%n", &i); printf("%d\n", i);
+ snprintf(holder, sizeof holder, "abc%n", &i);
+ printf("%s", holder); printf("%d\n\n", i);
+
+ printf("%%*.*s --> 10.10\n");
+ snprintf(holder, sizeof holder, "%*.*s\n", 10, 10, BLURB);
+ printf("%*.*s\n", 10, 10, BLURB);
+ printf("%s\n", holder);
+
+ printf("%%%%%%%%\n");
+ snprintf(holder, sizeof holder, "%%%%\n");
+ printf("%%%%\n");
+ printf("%s\n", holder);
+
+#define BIG "Hello this is a too big string for the buffer"
+/* printf("A buffer to small of 10, trying to put this:\n");*/
+ printf("<%%>, %s\n", BIG);
+ i = snprintf(holder, 10, "%s\n", BIG);
+ printf("<%s>\n", BIG);
+ printf("<%s>\n", holder);
+}
+#endif
diff --git a/lib/snprintf.h b/lib/snprintf.h
new file mode 100644
index 0000000..511deca
--- /dev/null
+++ b/lib/snprintf.h
@@ -0,0 +1,245 @@
+/*
+ Unix snprintf implementation.
+ Version 1.1
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+ Revision History:
+
+ sitecopy changes:
+ added sys/types.h include to pick up size_t define.
+ renamed dtoa -> doubletoa to avoid dtoa conflict with cygwin.
+
+ 1.1:
+ * added changes from Miles Bader
+ * corrected a bug with %f
+ * added support for %#g
+ * added more comments :-)
+ 1.0:
+ * supporting must ANSI syntaxic_sugars(see below)
+ 0.0:
+ * suppot %s %c %d
+
+ it understands:
+ Integer:
+ %lu %lu %u
+ %hd %ld %d decimal
+ %ho %lo %o octal
+ %hx %lx %x %X hexa
+ Floating points:
+ %g %G %e %E %f double
+ Strings:
+ %s %c string
+ %% %
+
+ Formating conversion flags:
+ - justify left
+ + Justify right or put a plus if number
+ # prefix 0x, 0X for hexa and 0 for octal
+ * precision/witdth is specify as an (int) in the arguments
+ ' ' leave a blank for number with no sign
+ l the later should be a long
+ h the later should be a short
+
+format:
+ snprintf(holder, sizeof_holder, format, ...)
+
+Return values:
+ (sizeof_holder - 1)
+
+
+ THANKS(for the patches and ideas):
+ Miles Bader
+ Cyrille Rustom
+ Jacek Slabocewiz
+ Mike Parker(mouse)
+
+Alain Magloire: alainm@rcsm.ee.mcgill.ca
+*/
+
+#if defined(HAVE_STDARG_H) && defined(__STDC__) && __STDC__
+/**** changed for sitecopy ****/
+#include <sys/types.h>
+#include <stdarg.h>
+#else
+#include <varargs.h>
+#endif
+
+/*
+ * For the FLOATING POINT FORMAT :
+ * the challenge was finding a way to
+ * manipulate the Real numbers without having
+ * to resort to mathematical function(it
+ * would require to link with -lm) and not
+ * going down to the bit pattern(not portable)
+ *
+ * so a number, a real is:
+
+ real = integral + fraction
+
+ integral = ... + a(2)*10^2 + a(1)*10^1 + a(0)*10^0
+ fraction = b(1)*10^-1 + b(2)*10^-2 + ...
+
+ where:
+ 0 <= a(i) => 9
+ 0 <= b(i) => 9
+
+ from then it was simple math
+ */
+
+/*
+ * size of the buffer for the integral part
+ * and the fraction part
+ */
+#define MAX_INT 99 + 1 /* 1 for the null */
+#define MAX_FRACT 29 + 1
+
+/*
+ * numtoa() uses PRIVATE buffers to store the results,
+ * So this function is not reentrant
+ */
+#define itoa(n) numtoa(n, 10, 0, (char **)0)
+#define otoa(n) numtoa(n, 8, 0, (char **)0)
+#define htoa(n) numtoa(n, 16, 0, (char **)0)
+#define doubletoa(n, p, f) numtoa(n, 10, p, f)
+
+#define SWAP_INT(a,b) {int t; t = (a); (a) = (b); (b) = t;}
+
+/* this struct holds everything we need */
+struct DATA {
+ int length;
+ char *holder;
+ int counter;
+#ifdef __STDC__
+ const char *pf;
+#else
+ char *pf;
+#endif
+/* FLAGS */
+ int width, precision;
+ int justify; char pad;
+ int square, space, star_w, star_p, a_long ;
+};
+
+#define PRIVATE static
+#define PUBLIC extern
+/* signature of the functions */
+#ifdef __STDC__
+/* the floating point stuff */
+ PRIVATE double pow_10(int);
+ PRIVATE int log_10(double);
+ PRIVATE double integral(double, double *);
+ PRIVATE char * numtoa(double, int, int, char **);
+
+/* for the format */
+ PRIVATE void conv_flag(char *, struct DATA *);
+ PRIVATE void floating(struct DATA *, double);
+ PRIVATE void exponent(struct DATA *, double);
+ PRIVATE void decimal(struct DATA *, double);
+ PRIVATE void octal(struct DATA *, double);
+ PRIVATE void hexa(struct DATA *, double);
+ PRIVATE void strings(struct DATA *, char *);
+
+#else
+/* the floating point stuff */
+ PRIVATE double pow_10();
+ PRIVATE int log_10();
+ PRIVATE double integral();
+ PRIVATE char * numtoa();
+
+/* for the format */
+ PRIVATE void conv_flag();
+ PRIVATE void floating();
+ PRIVATE void exponent();
+ PRIVATE void decimal();
+ PRIVATE void octal();
+ PRIVATE void hexa();
+ PRIVATE void strings();
+#endif
+
+/* those are defines specific to snprintf to hopefully
+ * make the code clearer :-)
+ */
+#define RIGHT 1
+#define LEFT 0
+#define NOT_FOUND -1
+#define FOUND 1
+#define MAX_FIELD 15
+
+/* the conversion flags */
+#define isflag(c) ((c) == '#' || (c) == ' ' || \
+ (c) == '*' || (c) == '+' || \
+ (c) == '-' || (c) == '.' || \
+ isdigit(c))
+
+/* round off to the precision */
+#define ROUND(d, p) \
+ (d < 0.) ? \
+ d - pow_10(-(p)->precision) * 0.5 : \
+ d + pow_10(-(p)->precision) * 0.5
+
+/* set default precision */
+#define DEF_PREC(p) \
+ if ((p)->precision == NOT_FOUND) \
+ (p)->precision = 6
+
+/* put a char */
+#define PUT_CHAR(c, p) \
+ if ((p)->counter < (p)->length) { \
+ *(p)->holder++ = (c); \
+ (p)->counter++; \
+ }
+
+#define PUT_PLUS(d, p) \
+ if ((d) > 0. && (p)->justify == RIGHT) \
+ PUT_CHAR('+', p)
+
+#define PUT_SPACE(d, p) \
+ if ((p)->space == FOUND && (d) > 0.) \
+ PUT_CHAR(' ', p)
+
+/* pad right */
+#define PAD_RIGHT(p) \
+ if ((p)->width > 0 && (p)->justify != LEFT) \
+ for (; (p)->width > 0; (p)->width--) \
+ PUT_CHAR((p)->pad, p)
+
+/* pad left */
+#define PAD_LEFT(p) \
+ if ((p)->width > 0 && (p)->justify == LEFT) \
+ for (; (p)->width > 0; (p)->width--) \
+ PUT_CHAR((p)->pad, p)
+
+/* if width and prec. in the args */
+#define STAR_ARGS(p) \
+ if ((p)->star_w == FOUND) \
+ (p)->width = va_arg(args, int); \
+ if ((p)->star_p == FOUND) \
+ (p)->precision = va_arg(args, int)
+
+
+PUBLIC int
+#if defined(HAVE_STDARG_H) && defined(__STDC__) && __STDC__
+snprintf(char *string, size_t length, const char * format, ...);
+#else
+snprintf(string, length, format, va_alist);
+char *string;
+size_t length;
+char * format;
+va_dcl
+#endif
+
+
+
diff --git a/lib/strcasecmp.c b/lib/strcasecmp.c
new file mode 100644
index 0000000..366bcf2
--- /dev/null
+++ b/lib/strcasecmp.c
@@ -0,0 +1,49 @@
+/* Copyright (C) 1991, 1992 Free Software Foundation, Inc.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <string.h>
+#include <ctype.h>
+
+/* Compare S1 and S2, ignoring case, returning less than, equal to or
+ greater than zero if S1 is lexiographically less than,
+ equal to or greater than S2. */
+int
+strcasecmp (s1, s2)
+ const char *s1;
+ const char *s2;
+{
+ register const unsigned char *p1 = (const unsigned char *) s1;
+ register const unsigned char *p2 = (const unsigned char *) s2;
+ unsigned char c1, c2;
+
+ if (p1 == p2)
+ return 0;
+
+ do
+ {
+ c1 = tolower (*p1++);
+ c2 = tolower (*p2++);
+ if (c1 == '\0')
+ break;
+ }
+ while (c1 == c2);
+
+ return c1 - c2;
+}
diff --git a/lib/strftime.c b/lib/strftime.c
new file mode 100644
index 0000000..fc3d0c7
--- /dev/null
+++ b/lib/strftime.c
@@ -0,0 +1,1241 @@
+/* Copyright (C) 1991,92,93,94,95,96,97,98,99 Free Software Foundation, Inc.
+
+ NOTE: The canonical source of this file is maintained with the GNU C Library.
+ Bugs can be reported to bug-glibc@prep.ai.mit.edu.
+
+ 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ USA. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#ifdef _LIBC
+# define HAVE_LIMITS_H 1
+# define HAVE_MBLEN 1
+# define HAVE_MBRLEN 1
+# define HAVE_STRUCT_ERA_ENTRY 1
+# define HAVE_TM_GMTOFF 1
+# define HAVE_TM_ZONE 1
+# define HAVE_TZNAME 1
+# define HAVE_TZSET 1
+# define MULTIBYTE_IS_FORMAT_SAFE 1
+# define STDC_HEADERS 1
+# include "../locale/localeinfo.h"
+#endif
+
+#if defined emacs && !defined HAVE_BCOPY
+# define HAVE_MEMCPY 1
+#endif
+
+#include <ctype.h>
+#include <sys/types.h> /* Some systems define `time_t' here. */
+
+#ifdef TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# ifdef HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+#if HAVE_TZNAME
+extern char *tzname[];
+#endif
+
+/* Do multibyte processing if multibytes are supported, unless
+ multibyte sequences are safe in formats. Multibyte sequences are
+ safe if they cannot contain byte sequences that look like format
+ conversion specifications. The GNU C Library uses UTF8 multibyte
+ encoding, which is safe for formats, but strftime.c can be used
+ with other C libraries that use unsafe encodings. */
+#define DO_MULTIBYTE (HAVE_MBLEN && ! MULTIBYTE_IS_FORMAT_SAFE)
+
+#if DO_MULTIBYTE
+# if HAVE_MBRLEN
+# include <wchar.h>
+# else
+ /* Simulate mbrlen with mblen as best we can. */
+# define mbstate_t int
+# define mbrlen(s, n, ps) mblen (s, n)
+# define mbsinit(ps) (*(ps) == 0)
+# endif
+ static const mbstate_t mbstate_zero;
+#endif
+
+#if HAVE_LIMITS_H
+# include <limits.h>
+#endif
+
+#if STDC_HEADERS
+# include <stddef.h>
+# include <stdlib.h>
+# include <string.h>
+#else
+# ifndef HAVE_MEMCPY
+# define memcpy(d, s, n) bcopy ((s), (d), (n))
+# endif
+#endif
+
+#ifdef _LIBC
+# define MEMPCPY(d, s, n) __mempcpy (d, s, n)
+#else
+# ifndef HAVE_MEMPCPY
+# define MEMPCPY(d, s, n) ((void *) ((char *) memcpy (d, s, n) + (n)))
+# endif
+#endif
+
+#ifndef __P
+# if defined (__GNUC__) || (defined (__STDC__) && __STDC__)
+# define __P(args) args
+# else
+# define __P(args) ()
+# endif /* GCC. */
+#endif /* Not __P. */
+
+#ifndef PTR
+# ifdef __STDC__
+# define PTR void *
+# else
+# define PTR char *
+# endif
+#endif
+
+#ifndef CHAR_BIT
+# define CHAR_BIT 8
+#endif
+
+#ifndef NULL
+# define NULL 0
+#endif
+
+#define TYPE_SIGNED(t) ((t) -1 < 0)
+
+/* Bound on length of the string representing an integer value of type t.
+ Subtract one for the sign bit if t is signed;
+ 302 / 1000 is log10 (2) rounded up;
+ add one for integer division truncation;
+ add one more for a minus sign if t is signed. */
+#define INT_STRLEN_BOUND(t) \
+ ((sizeof (t) * CHAR_BIT - TYPE_SIGNED (t)) * 302 / 1000 + 1 + TYPE_SIGNED (t))
+
+#define TM_YEAR_BASE 1900
+
+#ifndef __isleap
+/* Nonzero if YEAR is a leap year (every 4 years,
+ except every 100th isn't, and every 400th is). */
+# define __isleap(year) \
+ ((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0))
+#endif
+
+
+#ifdef _LIBC
+# define my_strftime_gmtime_r __gmtime_r
+# define my_strftime_localtime_r __localtime_r
+# define tzname __tzname
+# define tzset __tzset
+#else
+
+/* If we're a strftime substitute in a GNU program, then prefer gmtime
+ to gmtime_r, since many gmtime_r implementations are buggy.
+ Similarly for localtime_r. */
+
+# if ! HAVE_TM_GMTOFF
+static struct tm *my_strftime_gmtime_r __P ((const time_t *, struct tm *));
+static struct tm *
+my_strftime_gmtime_r (const time_t *t, struct tm *tp)
+{
+ struct tm *l = gmtime (t);
+ if (! l)
+ return 0;
+ *tp = *l;
+ return tp;
+}
+# endif /* ! HAVE_TM_GMTOFF */
+
+static struct tm *my_strftime_localtime_r __P ((const time_t *, struct tm *));
+static struct tm *
+my_strftime_localtime_r (const time_t *t, struct tm *tp)
+{
+ struct tm *l = localtime (t);
+ if (! l)
+ return 0;
+ *tp = *l;
+ return tp;
+}
+#endif /* ! defined _LIBC */
+
+
+#if !defined memset && !defined HAVE_MEMSET && !defined _LIBC
+/* Some systems lack the `memset' function and we don't want to
+ introduce additional dependencies. */
+/* The SGI compiler reportedly barfs on the trailing null
+ if we use a string constant as the initializer. 28 June 1997, rms. */
+static const char spaces[16] = /* " " */
+ { ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ' };
+static const char zeroes[16] = /* "0000000000000000" */
+ { '0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0' };
+
+# define memset_space(P, Len) \
+ do { \
+ int _len = (Len); \
+ \
+ do \
+ { \
+ int _this = _len > 16 ? 16 : _len; \
+ (P) = MEMPCPY ((P), spaces, _this); \
+ _len -= _this; \
+ } \
+ while (_len > 0); \
+ } while (0)
+
+# define memset_zero(P, Len) \
+ do { \
+ int _len = (Len); \
+ \
+ do \
+ { \
+ int _this = _len > 16 ? 16 : _len; \
+ (P) = MEMPCPY ((P), zeroes, _this); \
+ _len -= _this; \
+ } \
+ while (_len > 0); \
+ } while (0)
+#else
+# define memset_space(P, Len) (memset ((P), ' ', (Len)), (P) += (Len))
+# define memset_zero(P, Len) (memset ((P), '0', (Len)), (P) += (Len))
+#endif
+
+#define add(n, f) \
+ do \
+ { \
+ int _n = (n); \
+ int _delta = width - _n; \
+ int _incr = _n + (_delta > 0 ? _delta : 0); \
+ if (i + _incr >= maxsize) \
+ return 0; \
+ if (p) \
+ { \
+ if (_delta > 0) \
+ { \
+ if (pad == '0') \
+ memset_zero (p, _delta); \
+ else \
+ memset_space (p, _delta); \
+ } \
+ f; \
+ p += _n; \
+ } \
+ i += _incr; \
+ } while (0)
+
+#define cpy(n, s) \
+ add ((n), \
+ if (to_lowcase) \
+ memcpy_lowcase (p, (s), _n); \
+ else if (to_uppcase) \
+ memcpy_uppcase (p, (s), _n); \
+ else \
+ memcpy ((PTR) p, (PTR) (s), _n))
+
+
+
+#ifdef _LIBC
+# define TOUPPER(Ch) toupper (Ch)
+# define TOLOWER(Ch) tolower (Ch)
+#else
+# define TOUPPER(Ch) (islower (Ch) ? toupper (Ch) : (Ch))
+# define TOLOWER(Ch) (isupper (Ch) ? tolower (Ch) : (Ch))
+#endif
+/* We don't use `isdigit' here since the locale dependent
+ interpretation is not what we want here. We only need to accept
+ the arabic digits in the ASCII range. One day there is perhaps a
+ more reliable way to accept other sets of digits. */
+#define ISDIGIT(Ch) ((unsigned int) (Ch) - '0' <= 9)
+
+static char *memcpy_lowcase __P ((char *dest, const char *src, size_t len));
+
+static char *
+memcpy_lowcase (char *dest, const char *src, size_t len)
+{
+ while (len-- > 0)
+ dest[len] = TOLOWER ((unsigned char) src[len]);
+ return dest;
+}
+
+static char *memcpy_uppcase __P ((char *dest, const char *src, size_t len));
+
+static char *
+memcpy_uppcase (char *dest, const char *src, size_t len)
+{
+ while (len-- > 0)
+ dest[len] = TOUPPER ((unsigned char) src[len]);
+ return dest;
+}
+
+
+#if ! HAVE_TM_GMTOFF
+/* Yield the difference between *A and *B,
+ measured in seconds, ignoring leap seconds. */
+# define tm_diff ftime_tm_diff
+static int tm_diff __P ((const struct tm *, const struct tm *));
+static int
+tm_diff (const struct tm *a, const struct tm *b)
+{
+ /* Compute intervening leap days correctly even if year is negative.
+ Take care to avoid int overflow in leap day calculations,
+ but it's OK to assume that A and B are close to each other. */
+ int a4 = (a->tm_year >> 2) + (TM_YEAR_BASE >> 2) - ! (a->tm_year & 3);
+ int b4 = (b->tm_year >> 2) + (TM_YEAR_BASE >> 2) - ! (b->tm_year & 3);
+ int a100 = a4 / 25 - (a4 % 25 < 0);
+ int b100 = b4 / 25 - (b4 % 25 < 0);
+ int a400 = a100 >> 2;
+ int b400 = b100 >> 2;
+ int intervening_leap_days = (a4 - b4) - (a100 - b100) + (a400 - b400);
+ int years = a->tm_year - b->tm_year;
+ int days = (365 * years + intervening_leap_days
+ + (a->tm_yday - b->tm_yday));
+ return (60 * (60 * (24 * days + (a->tm_hour - b->tm_hour))
+ + (a->tm_min - b->tm_min))
+ + (a->tm_sec - b->tm_sec));
+}
+#endif /* ! HAVE_TM_GMTOFF */
+
+
+
+/* The number of days from the first day of the first ISO week of this
+ year to the year day YDAY with week day WDAY. ISO weeks start on
+ Monday; the first ISO week has the year's first Thursday. YDAY may
+ be as small as YDAY_MINIMUM. */
+#define ISO_WEEK_START_WDAY 1 /* Monday */
+#define ISO_WEEK1_WDAY 4 /* Thursday */
+#define YDAY_MINIMUM (-366)
+static int iso_week_days __P ((int, int));
+#ifdef __GNUC__
+__inline__
+#endif
+static int
+iso_week_days (int yday, int wday)
+{
+ /* Add enough to the first operand of % to make it nonnegative. */
+ int big_enough_multiple_of_7 = (-YDAY_MINIMUM / 7 + 2) * 7;
+ return (yday
+ - (yday - wday + ISO_WEEK1_WDAY + big_enough_multiple_of_7) % 7
+ + ISO_WEEK1_WDAY - ISO_WEEK_START_WDAY);
+}
+
+
+#if !(defined _NL_CURRENT || HAVE_STRFTIME)
+static char const weekday_name[][10] =
+ {
+ "Sunday", "Monday", "Tuesday", "Wednesday",
+ "Thursday", "Friday", "Saturday"
+ };
+static char const month_name[][10] =
+ {
+ "January", "February", "March", "April", "May", "June",
+ "July", "August", "September", "October", "November", "December"
+ };
+#endif
+
+
+#ifdef emacs
+# define my_strftime emacs_strftimeu
+# define ut_argument , ut
+# define ut_argument_spec int ut;
+# define ut_argument_spec_iso , int ut
+#else
+# define my_strftime strftime
+# define ut_argument
+# define ut_argument_spec
+# define ut_argument_spec_iso
+/* We don't have this information in general. */
+# define ut 0
+#endif
+
+#if !defined _LIBC && HAVE_TZNAME && HAVE_TZSET
+ /* Solaris 2.5 tzset sometimes modifies the storage returned by localtime.
+ Work around this bug by copying *tp before it might be munged. */
+ size_t _strftime_copytm __P ((char *, size_t, const char *,
+ const struct tm * ut_argument_spec_iso));
+ size_t
+ my_strftime (s, maxsize, format, tp ut_argument)
+ char *s;
+ size_t maxsize;
+ const char *format;
+ const struct tm *tp;
+ ut_argument_spec
+ {
+ struct tm tmcopy;
+ tmcopy = *tp;
+ return _strftime_copytm (s, maxsize, format, &tmcopy ut_argument);
+ }
+# undef my_strftime
+# define my_strftime(S, Maxsize, Format, Tp) \
+ _strftime_copytm (S, Maxsize, Format, Tp)
+#endif
+
+
+/* Write information from TP into S according to the format
+ string FORMAT, writing no more that MAXSIZE characters
+ (including the terminating '\0') and returning number of
+ characters written. If S is NULL, nothing will be written
+ anywhere, so to determine how many characters would be
+ written, use NULL for S and (size_t) UINT_MAX for MAXSIZE. */
+size_t
+my_strftime (char *s, size_t maxsize, const char *format, const struct tm *tp
+ ut_argument_spec)
+{
+ int hour12 = tp->tm_hour;
+#ifdef _NL_CURRENT
+ /* We cannot make the following values variables since we must delay
+ the evaluation of these values until really needed since some
+ expressions might not be valid in every situation. The `struct tm'
+ might be generated by a strptime() call that initialized
+ only a few elements. Dereference the pointers only if the format
+ requires this. Then it is ok to fail if the pointers are invalid. */
+# define a_wkday _NL_CURRENT (LC_TIME, ABDAY_1 + tp->tm_wday)
+# define f_wkday _NL_CURRENT (LC_TIME, DAY_1 + tp->tm_wday)
+# define a_month _NL_CURRENT (LC_TIME, ABMON_1 + tp->tm_mon)
+# define f_month _NL_CURRENT (LC_TIME, MON_1 + tp->tm_mon)
+# define ampm _NL_CURRENT (LC_TIME, tp->tm_hour > 11 ? PM_STR : AM_STR)
+
+# define aw_len strlen (a_wkday)
+# define am_len strlen (a_month)
+# define ap_len strlen (ampm)
+#else
+# if !HAVE_STRFTIME
+# define f_wkday (weekday_name[tp->tm_wday])
+# define f_month (month_name[tp->tm_mon])
+# define a_wkday f_wkday
+# define a_month f_month
+# define ampm ("AMPM" + 2 * (tp->tm_hour > 11))
+
+ size_t aw_len = 3;
+ size_t am_len = 3;
+ size_t ap_len = 2;
+# endif
+#endif
+ const char *zone;
+ size_t i = 0;
+ char *p = s;
+ const char *f;
+
+ zone = NULL;
+#if HAVE_TM_ZONE
+ /* The POSIX test suite assumes that setting
+ the environment variable TZ to a new value before calling strftime()
+ will influence the result (the %Z format) even if the information in
+ TP is computed with a totally different time zone.
+ This is bogus: though POSIX allows bad behavior like this,
+ POSIX does not require it. Do the right thing instead. */
+ zone = (const char *) tp->tm_zone;
+#endif
+#if HAVE_TZNAME
+ if (ut)
+ {
+ if (! (zone && *zone))
+ zone = "GMT";
+ }
+ else
+ {
+ /* POSIX.1 8.1.1 requires that whenever strftime() is called, the
+ time zone names contained in the external variable `tzname' shall
+ be set as if the tzset() function had been called. */
+# if HAVE_TZSET
+ tzset ();
+# endif
+ }
+#endif
+
+ if (hour12 > 12)
+ hour12 -= 12;
+ else
+ if (hour12 == 0)
+ hour12 = 12;
+
+ for (f = format; *f != '\0'; ++f)
+ {
+ int pad = 0; /* Padding for number ('-', '_', or 0). */
+ int modifier; /* Field modifier ('E', 'O', or 0). */
+ int digits; /* Max digits for numeric format. */
+ int number_value; /* Numeric value to be printed. */
+ int negative_number; /* 1 if the number is negative. */
+ const char *subfmt;
+ char *bufp;
+ char buf[1 + (sizeof (int) < sizeof (time_t)
+ ? INT_STRLEN_BOUND (time_t)
+ : INT_STRLEN_BOUND (int))];
+ int width = -1;
+ int to_lowcase = 0;
+ int to_uppcase = 0;
+ int change_case = 0;
+ int format_char;
+
+#if DO_MULTIBYTE
+
+ switch (*f)
+ {
+ case '%':
+ break;
+
+ case '\a': case '\b': case '\t': case '\n':
+ case '\v': case '\f': case '\r':
+ case ' ': case '!': case '"': case '#': case '&': case'\'':
+ case '(': case ')': case '*': case '+': case ',': case '-':
+ case '.': case '/': case '0': case '1': case '2': case '3':
+ case '4': case '5': case '6': case '7': case '8': case '9':
+ case ':': case ';': case '<': case '=': case '>': case '?':
+ case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
+ case 'G': case 'H': case 'I': case 'J': case 'K': case 'L':
+ case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R':
+ case 'S': case 'T': case 'U': case 'V': case 'W': case 'X':
+ case 'Y': case 'Z': case '[': case'\\': case ']': case '^':
+ case '_': case 'a': case 'b': case 'c': case 'd': case 'e':
+ case 'f': case 'g': case 'h': case 'i': case 'j': case 'k':
+ case 'l': case 'm': case 'n': case 'o': case 'p': case 'q':
+ case 'r': case 's': case 't': case 'u': case 'v': case 'w':
+ case 'x': case 'y': case 'z': case '{': case '|': case '}':
+ case '~':
+ /* The C Standard requires these 98 characters (plus '%') to
+ be in the basic execution character set. None of these
+ characters can start a multibyte sequence, so they need
+ not be analyzed further. */
+ add (1, *p = *f);
+ continue;
+
+ default:
+ /* Copy this multibyte sequence until we reach its end, find
+ an error, or come back to the initial shift state. */
+ {
+ mbstate_t mbstate = mbstate_zero;
+ size_t len = 0;
+
+ do
+ {
+ size_t bytes = mbrlen (f + len, (size_t) -1, &mbstate);
+
+ if (bytes == 0)
+ break;
+
+ if (bytes == (size_t) -2)
+ {
+ len += strlen (f + len);
+ break;
+ }
+
+ if (bytes == (size_t) -1)
+ {
+ len++;
+ break;
+ }
+
+ len += bytes;
+ }
+ while (! mbsinit (&mbstate));
+
+ cpy (len, f);
+ f += len - 1;
+ continue;
+ }
+ }
+
+#else /* ! DO_MULTIBYTE */
+
+ /* Either multibyte encodings are not supported, or they are
+ safe for formats, so any non-'%' byte can be copied through. */
+ if (*f != '%')
+ {
+ add (1, *p = *f);
+ continue;
+ }
+
+#endif /* ! DO_MULTIBYTE */
+
+ /* Check for flags that can modify a format. */
+ while (1)
+ {
+ switch (*++f)
+ {
+ /* This influences the number formats. */
+ case '_':
+ case '-':
+ case '0':
+ pad = *f;
+ continue;
+
+ /* This changes textual output. */
+ case '^':
+ to_uppcase = 1;
+ continue;
+ case '#':
+ change_case = 1;
+ continue;
+
+ default:
+ break;
+ }
+ break;
+ }
+
+ /* As a GNU extension we allow to specify the field width. */
+ if (ISDIGIT (*f))
+ {
+ width = 0;
+ do
+ {
+ width *= 10;
+ width += *f - '0';
+ ++f;
+ }
+ while (ISDIGIT (*f));
+ }
+
+ /* Check for modifiers. */
+ switch (*f)
+ {
+ case 'E':
+ case 'O':
+ modifier = *f++;
+ break;
+
+ default:
+ modifier = 0;
+ break;
+ }
+
+ /* Now do the specified format. */
+ format_char = *f;
+ switch (format_char)
+ {
+#define DO_NUMBER(d, v) \
+ digits = width == -1 ? d : width; \
+ number_value = v; goto do_number
+#define DO_NUMBER_SPACEPAD(d, v) \
+ digits = width == -1 ? d : width; \
+ number_value = v; goto do_number_spacepad
+
+ case '%':
+ if (modifier != 0)
+ goto bad_format;
+ add (1, *p = *f);
+ break;
+
+ case 'a':
+ if (modifier != 0)
+ goto bad_format;
+ if (change_case)
+ {
+ to_uppcase = 1;
+ to_lowcase = 0;
+ }
+#if defined _NL_CURRENT || !HAVE_STRFTIME
+ cpy (aw_len, a_wkday);
+ break;
+#else
+ goto underlying_strftime;
+#endif
+
+ case 'A':
+ if (modifier != 0)
+ goto bad_format;
+ if (change_case)
+ {
+ to_uppcase = 1;
+ to_lowcase = 0;
+ }
+#if defined _NL_CURRENT || !HAVE_STRFTIME
+ cpy (strlen (f_wkday), f_wkday);
+ break;
+#else
+ goto underlying_strftime;
+#endif
+
+ case 'b':
+ case 'h': /* POSIX.2 extension. */
+ if (modifier != 0)
+ goto bad_format;
+#if defined _NL_CURRENT || !HAVE_STRFTIME
+ cpy (am_len, a_month);
+ break;
+#else
+ goto underlying_strftime;
+#endif
+
+ case 'B':
+ if (modifier != 0)
+ goto bad_format;
+ if (change_case)
+ {
+ to_uppcase = 1;
+ to_lowcase = 0;
+ }
+#if defined _NL_CURRENT || !HAVE_STRFTIME
+ cpy (strlen (f_month), f_month);
+ break;
+#else
+ goto underlying_strftime;
+#endif
+
+ case 'c':
+ if (modifier == 'O')
+ goto bad_format;
+#ifdef _NL_CURRENT
+ if (! (modifier == 'E'
+ && *(subfmt = _NL_CURRENT (LC_TIME, ERA_D_T_FMT)) != '\0'))
+ subfmt = _NL_CURRENT (LC_TIME, D_T_FMT);
+#else
+# if HAVE_STRFTIME
+ goto underlying_strftime;
+# else
+ subfmt = "%a %b %e %H:%M:%S %Y";
+# endif
+#endif
+
+ subformat:
+ {
+ char *old_start = p;
+ size_t len = my_strftime (NULL, (size_t) -1, subfmt, tp);
+ add (len, my_strftime (p, maxsize - i, subfmt, tp));
+
+ if (to_uppcase)
+ while (old_start < p)
+ {
+ *old_start = TOUPPER ((unsigned char) *old_start);
+ ++old_start;
+ }
+ }
+ break;
+
+#if HAVE_STRFTIME && ! (defined _NL_CURRENT && HAVE_STRUCT_ERA_ENTRY)
+ underlying_strftime:
+ {
+ /* The relevant information is available only via the
+ underlying strftime implementation, so use that. */
+ char ufmt[4];
+ char *u = ufmt;
+ char ubuf[1024]; /* enough for any single format in practice */
+ size_t len;
+ *u++ = '%';
+ if (modifier != 0)
+ *u++ = modifier;
+ *u++ = format_char;
+ *u = '\0';
+ len = strftime (ubuf, sizeof ubuf, ufmt, tp);
+ if (len == 0 && ubuf[0] != '\0')
+ return 0;
+ cpy (len, ubuf);
+ }
+ break;
+#endif
+
+ case 'C': /* POSIX.2 extension. */
+ if (modifier == 'O')
+ goto bad_format;
+ if (modifier == 'E')
+ {
+#if HAVE_STRUCT_ERA_ENTRY
+ struct era_entry *era = _nl_get_era_entry (tp);
+ if (era)
+ {
+ size_t len = strlen (era->name_fmt);
+ cpy (len, era->name_fmt);
+ break;
+ }
+#else
+# if HAVE_STRFTIME
+ goto underlying_strftime;
+# endif
+#endif
+ }
+
+ {
+ int year = tp->tm_year + TM_YEAR_BASE;
+ DO_NUMBER (1, year / 100 - (year % 100 < 0));
+ }
+
+ case 'x':
+ if (modifier == 'O')
+ goto bad_format;
+#ifdef _NL_CURRENT
+ if (! (modifier == 'E'
+ && *(subfmt = _NL_CURRENT (LC_TIME, ERA_D_FMT)) != '\0'))
+ subfmt = _NL_CURRENT (LC_TIME, D_FMT);
+ goto subformat;
+#else
+# if HAVE_STRFTIME
+ goto underlying_strftime;
+# else
+ /* Fall through. */
+# endif
+#endif
+ case 'D': /* POSIX.2 extension. */
+ if (modifier != 0)
+ goto bad_format;
+ subfmt = "%m/%d/%y";
+ goto subformat;
+
+ case 'd':
+ if (modifier == 'E')
+ goto bad_format;
+
+ DO_NUMBER (2, tp->tm_mday);
+
+ case 'e': /* POSIX.2 extension. */
+ if (modifier == 'E')
+ goto bad_format;
+
+ DO_NUMBER_SPACEPAD (2, tp->tm_mday);
+
+ /* All numeric formats set DIGITS and NUMBER_VALUE and then
+ jump to one of these two labels. */
+
+ do_number_spacepad:
+ /* Force `_' flag unless overwritten by `0' flag. */
+ if (pad != '0')
+ pad = '_';
+
+ do_number:
+ /* Format the number according to the MODIFIER flag. */
+
+ if (modifier == 'O' && 0 <= number_value)
+ {
+#ifdef _NL_CURRENT
+ /* Get the locale specific alternate representation of
+ the number NUMBER_VALUE. If none exist NULL is returned. */
+ const char *cp = _nl_get_alt_digit (number_value);
+
+ if (cp != NULL)
+ {
+ size_t digitlen = strlen (cp);
+ if (digitlen != 0)
+ {
+ cpy (digitlen, cp);
+ break;
+ }
+ }
+#else
+# if HAVE_STRFTIME
+ goto underlying_strftime;
+# endif
+#endif
+ }
+ {
+ unsigned int u = number_value;
+
+ bufp = buf + sizeof (buf);
+ negative_number = number_value < 0;
+
+ if (negative_number)
+ u = -u;
+
+ do
+ *--bufp = u % 10 + '0';
+ while ((u /= 10) != 0);
+ }
+
+ do_number_sign_and_padding:
+ if (negative_number)
+ *--bufp = '-';
+
+ if (pad != '-')
+ {
+ int padding = digits - (buf + sizeof (buf) - bufp);
+
+ if (pad == '_')
+ {
+ while (0 < padding--)
+ *--bufp = ' ';
+ }
+ else
+ {
+ bufp += negative_number;
+ while (0 < padding--)
+ *--bufp = '0';
+ if (negative_number)
+ *--bufp = '-';
+ }
+ }
+
+ cpy (buf + sizeof (buf) - bufp, bufp);
+ break;
+
+ case 'F':
+ if (modifier != 0)
+ goto bad_format;
+ subfmt = "%Y-%m-%d";
+ goto subformat;
+
+ case 'H':
+ if (modifier == 'E')
+ goto bad_format;
+
+ DO_NUMBER (2, tp->tm_hour);
+
+ case 'I':
+ if (modifier == 'E')
+ goto bad_format;
+
+ DO_NUMBER (2, hour12);
+
+ case 'k': /* GNU extension. */
+ if (modifier == 'E')
+ goto bad_format;
+
+ DO_NUMBER_SPACEPAD (2, tp->tm_hour);
+
+ case 'l': /* GNU extension. */
+ if (modifier == 'E')
+ goto bad_format;
+
+ DO_NUMBER_SPACEPAD (2, hour12);
+
+ case 'j':
+ if (modifier == 'E')
+ goto bad_format;
+
+ DO_NUMBER (3, 1 + tp->tm_yday);
+
+ case 'M':
+ if (modifier == 'E')
+ goto bad_format;
+
+ DO_NUMBER (2, tp->tm_min);
+
+ case 'm':
+ if (modifier == 'E')
+ goto bad_format;
+
+ DO_NUMBER (2, tp->tm_mon + 1);
+
+ case 'n': /* POSIX.2 extension. */
+ add (1, *p = '\n');
+ break;
+
+ case 'P':
+ to_lowcase = 1;
+#if !defined _NL_CURRENT && HAVE_STRFTIME
+ format_char = 'p';
+#endif
+ /* FALLTHROUGH */
+
+ case 'p':
+ if (change_case)
+ {
+ to_uppcase = 0;
+ to_lowcase = 1;
+ }
+#if defined _NL_CURRENT || !HAVE_STRFTIME
+ cpy (ap_len, ampm);
+ break;
+#else
+ goto underlying_strftime;
+#endif
+
+ case 'R': /* GNU extension. */
+ subfmt = "%H:%M";
+ goto subformat;
+
+ case 'r': /* POSIX.2 extension. */
+#ifdef _NL_CURRENT
+ if (*(subfmt = _NL_CURRENT (LC_TIME, T_FMT_AMPM)) == '\0')
+#endif
+ subfmt = "%I:%M:%S %p";
+ goto subformat;
+
+ case 'S':
+ if (modifier == 'E')
+ goto bad_format;
+
+ DO_NUMBER (2, tp->tm_sec);
+
+ case 's': /* GNU extension. */
+ {
+ struct tm ltm;
+ time_t t;
+
+ ltm = *tp;
+ t = mktime (&ltm);
+
+ /* Generate string value for T using time_t arithmetic;
+ this works even if sizeof (long) < sizeof (time_t). */
+
+ bufp = buf + sizeof (buf);
+ negative_number = t < 0;
+
+ do
+ {
+ int d = t % 10;
+ t /= 10;
+
+ if (negative_number)
+ {
+ d = -d;
+
+ /* Adjust if division truncates to minus infinity. */
+ if (0 < -1 % 10 && d < 0)
+ {
+ t++;
+ d += 10;
+ }
+ }
+
+ *--bufp = d + '0';
+ }
+ while (t != 0);
+
+ digits = 1;
+ goto do_number_sign_and_padding;
+ }
+
+ case 'X':
+ if (modifier == 'O')
+ goto bad_format;
+#ifdef _NL_CURRENT
+ if (! (modifier == 'E'
+ && *(subfmt = _NL_CURRENT (LC_TIME, ERA_T_FMT)) != '\0'))
+ subfmt = _NL_CURRENT (LC_TIME, T_FMT);
+ goto subformat;
+#else
+# if HAVE_STRFTIME
+ goto underlying_strftime;
+# else
+ /* Fall through. */
+# endif
+#endif
+ case 'T': /* POSIX.2 extension. */
+ subfmt = "%H:%M:%S";
+ goto subformat;
+
+ case 't': /* POSIX.2 extension. */
+ add (1, *p = '\t');
+ break;
+
+ case 'u': /* POSIX.2 extension. */
+ DO_NUMBER (1, (tp->tm_wday - 1 + 7) % 7 + 1);
+
+ case 'U':
+ if (modifier == 'E')
+ goto bad_format;
+
+ DO_NUMBER (2, (tp->tm_yday - tp->tm_wday + 7) / 7);
+
+ case 'V':
+ case 'g': /* GNU extension. */
+ case 'G': /* GNU extension. */
+ if (modifier == 'E')
+ goto bad_format;
+ {
+ int year = tp->tm_year + TM_YEAR_BASE;
+ int days = iso_week_days (tp->tm_yday, tp->tm_wday);
+
+ if (days < 0)
+ {
+ /* This ISO week belongs to the previous year. */
+ year--;
+ days = iso_week_days (tp->tm_yday + (365 + __isleap (year)),
+ tp->tm_wday);
+ }
+ else
+ {
+ int d = iso_week_days (tp->tm_yday - (365 + __isleap (year)),
+ tp->tm_wday);
+ if (0 <= d)
+ {
+ /* This ISO week belongs to the next year. */
+ year++;
+ days = d;
+ }
+ }
+
+ switch (*f)
+ {
+ case 'g':
+ DO_NUMBER (2, (year % 100 + 100) % 100);
+
+ case 'G':
+ DO_NUMBER (1, year);
+
+ default:
+ DO_NUMBER (2, days / 7 + 1);
+ }
+ }
+
+ case 'W':
+ if (modifier == 'E')
+ goto bad_format;
+
+ DO_NUMBER (2, (tp->tm_yday - (tp->tm_wday - 1 + 7) % 7 + 7) / 7);
+
+ case 'w':
+ if (modifier == 'E')
+ goto bad_format;
+
+ DO_NUMBER (1, tp->tm_wday);
+
+ case 'Y':
+ if (modifier == 'E')
+ {
+#if HAVE_STRUCT_ERA_ENTRY
+ struct era_entry *era = _nl_get_era_entry (tp);
+ if (era)
+ {
+ subfmt = strchr (era->name_fmt, '\0') + 1;
+ goto subformat;
+ }
+#else
+# if HAVE_STRFTIME
+ goto underlying_strftime;
+# endif
+#endif
+ }
+ if (modifier == 'O')
+ goto bad_format;
+ else
+ DO_NUMBER (1, tp->tm_year + TM_YEAR_BASE);
+
+ case 'y':
+ if (modifier == 'E')
+ {
+#if HAVE_STRUCT_ERA_ENTRY
+ struct era_entry *era = _nl_get_era_entry (tp);
+ if (era)
+ {
+ int delta = tp->tm_year - era->start_date[0];
+ DO_NUMBER (1, (era->offset
+ + (era->direction == '-' ? -delta : delta)));
+ }
+#else
+# if HAVE_STRFTIME
+ goto underlying_strftime;
+# endif
+#endif
+ }
+ DO_NUMBER (2, (tp->tm_year % 100 + 100) % 100);
+
+ case 'Z':
+ if (change_case)
+ {
+ to_uppcase = 0;
+ to_lowcase = 1;
+ }
+
+#if HAVE_TZNAME
+ /* The tzset() call might have changed the value. */
+ if (!(zone && *zone) && tp->tm_isdst >= 0)
+ zone = tzname[tp->tm_isdst];
+#endif
+ if (! zone)
+ zone = ""; /* POSIX.2 requires the empty string here. */
+
+ cpy (strlen (zone), zone);
+ break;
+
+ case 'z': /* GNU extension. */
+ if (tp->tm_isdst < 0)
+ break;
+
+ {
+ int diff;
+#if HAVE_TM_GMTOFF
+ diff = tp->tm_gmtoff;
+#else
+ if (ut)
+ diff = 0;
+ else
+ {
+ struct tm gtm;
+ struct tm ltm;
+ time_t lt;
+
+ ltm = *tp;
+ lt = mktime (&ltm);
+
+ if (lt == (time_t) -1)
+ {
+ /* mktime returns -1 for errors, but -1 is also a
+ valid time_t value. Check whether an error really
+ occurred. */
+ struct tm tm;
+
+ if (! my_strftime_localtime_r (&lt, &tm)
+ || ((ltm.tm_sec ^ tm.tm_sec)
+ | (ltm.tm_min ^ tm.tm_min)
+ | (ltm.tm_hour ^ tm.tm_hour)
+ | (ltm.tm_mday ^ tm.tm_mday)
+ | (ltm.tm_mon ^ tm.tm_mon)
+ | (ltm.tm_year ^ tm.tm_year)))
+ break;
+ }
+
+ if (! my_strftime_gmtime_r (&lt, &gtm))
+ break;
+
+ diff = tm_diff (&ltm, &gtm);
+ }
+#endif
+
+ if (diff < 0)
+ {
+ add (1, *p = '-');
+ diff = -diff;
+ }
+ else
+ add (1, *p = '+');
+
+ diff /= 60;
+ DO_NUMBER (4, (diff / 60) * 100 + diff % 60);
+ }
+
+ case '\0': /* GNU extension: % at end of format. */
+ --f;
+ /* Fall through. */
+ default:
+ /* Unknown format; output the format, including the '%',
+ since this is most likely the right thing to do if a
+ multibyte string has been misparsed. */
+ bad_format:
+ {
+ int flen;
+ for (flen = 1; f[1 - flen] != '%'; flen++)
+ continue;
+ cpy (flen, &f[1 - flen]);
+ }
+ break;
+ }
+ }
+
+ if (p && maxsize != 0)
+ *p = '\0';
+ return i;
+}
+
+
+#ifdef emacs
+/* For Emacs we have a separate interface which corresponds to the normal
+ strftime function and does not have the extra information whether the
+ TP arguments comes from a `gmtime' call or not. */
+size_t
+emacs_strftime (s, maxsize, format, tp)
+ char *s;
+ size_t maxsize;
+ const char *format;
+ const struct tm *tp;
+{
+ return my_strftime (s, maxsize, format, tp, 0);
+}
+#endif
diff --git a/lib/tempname.c b/lib/tempname.c
new file mode 100644
index 0000000..35e4bcd
--- /dev/null
+++ b/lib/tempname.c
@@ -0,0 +1,360 @@
+/* Copyright (C) 1991-1999, 2000, 2001 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#if HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <sys/types.h>
+#include <assert.h>
+
+#include <errno.h>
+#ifndef __set_errno
+# define __set_errno(Val) errno = (Val)
+#endif
+
+#include <stdio.h>
+#ifndef P_tmpdir
+# define P_tmpdir "/tmp"
+#endif
+#ifndef TMP_MAX
+# define TMP_MAX 238328
+#endif
+#ifndef __GT_FILE
+# define __GT_FILE 0
+# define __GT_BIGFILE 1
+# define __GT_DIR 2
+# define __GT_NOCREATE 3
+#endif
+
+#if STDC_HEADERS || defined(_LIBC)
+# include <stddef.h>
+# include <string.h>
+#endif
+
+#include <stdlib.h>
+
+#if HAVE_FCNTL_H || defined(_LIBC)
+# include <fcntl.h>
+#endif
+
+#if HAVE_SYS_TIME_H || defined(_LIBC)
+# include <sys/time.h>
+#endif
+
+#if HAVE_STDINT_H || defined(_LIBC)
+# include <stdint.h>
+#endif
+
+#if HAVE_UNISTD_H || defined(_LIBC)
+# include <unistd.h>
+#endif
+
+#include <sys/stat.h>
+#ifdef STAT_MACROS_BROKEN
+# undef S_ISDIR
+#endif
+#if !defined S_ISDIR && defined S_IFDIR
+# define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
+#endif
+#if !S_IRUSR && S_IREAD
+# define S_IRUSR S_IREAD
+#endif
+#if !S_IRUSR
+# define S_IRUSR 00400
+#endif
+#if !S_IWUSR && S_IWRITE
+# define S_IWUSR S_IWRITE
+#endif
+#if !S_IWUSR
+# define S_IWUSR 00200
+#endif
+#if !S_IXUSR && S_IEXEC
+# define S_IXUSR S_IEXEC
+#endif
+#if !S_IXUSR
+# define S_IXUSR 00100
+#endif
+
+#if defined(_LIBC)
+# define struct_stat64 struct stat64
+#else
+# define struct_stat64 struct stat
+# define __getpid getpid
+# define __gettimeofday gettimeofday
+# define __mkdir mkdir
+# define __open open
+# define __open64 open
+# define __lxstat64(version, path, buf) lstat (path, buf)
+# define __xstat64(version, path, buf) stat (path, buf)
+#endif
+
+#if ! (HAVE___SECURE_GETENV || defined(_LIBC))
+# define __secure_getenv getenv
+#endif
+
+#ifdef _LIBC
+# include <hp-timing.h>
+# if HP_TIMING_AVAIL
+# define RANDOM_BITS(Var) \
+ if (__builtin_expect (value == UINT64_C (0), 0)) \
+ { \
+ /* If this is the first time this function is used initialize \
+ the variable we accumulate the value in to some somewhat \
+ random value. If we'd not do this programs at startup time \
+ might have a reduced set of possible names, at least on slow \
+ machines. */ \
+ struct timeval tv; \
+ __gettimeofday (&tv, NULL); \
+ value = ((uint64_t) tv.tv_usec << 16) ^ tv.tv_sec; \
+ } \
+ HP_TIMING_NOW (Var)
+# endif
+#endif
+
+/* Use the widest available unsigned type if uint64_t is not
+ available. The algorithm below extracts a number less than 62**6
+ (approximately 2**35.725) from uint64_t, so ancient hosts where
+ uintmax_t is only 32 bits lose about 3.725 bits of randomness,
+ which is better than not having mkstemp at all. */
+#if !defined UINT64_MAX && !defined uint64_t
+# define uint64_t uintmax_t
+#endif
+
+/* Return nonzero if DIR is an existent directory. */
+static int
+direxists (const char *dir)
+{
+ struct_stat64 buf;
+ return __xstat64 (_STAT_VER, dir, &buf) == 0 && S_ISDIR (buf.st_mode);
+}
+
+/* Prototypes. */
+int
+__path_search (char *tmpl, size_t tmpl_len, const char *dir, const char *pfx,
+ int try_tmpdir);
+int
+__gen_tempname (char *tmpl, int kind);
+
+/* Path search algorithm, for tmpnam, tmpfile, etc. If DIR is
+ non-null and exists, uses it; otherwise uses the first of $TMPDIR,
+ P_tmpdir, /tmp that exists. Copies into TMPL a template suitable
+ for use with mk[s]temp. Will fail (-1) if DIR is non-null and
+ doesn't exist, none of the searched dirs exists, or there's not
+ enough space in TMPL. */
+int
+__path_search (char *tmpl, size_t tmpl_len, const char *dir, const char *pfx,
+ int try_tmpdir)
+{
+ const char *d;
+ size_t dlen, plen;
+
+ if (!pfx || !pfx[0])
+ {
+ pfx = "file";
+ plen = 4;
+ }
+ else
+ {
+ plen = strlen (pfx);
+ if (plen > 5)
+ plen = 5;
+ }
+
+ if (try_tmpdir)
+ {
+ d = __secure_getenv ("TMPDIR");
+ if (d != NULL && direxists (d))
+ dir = d;
+ else if (dir != NULL && direxists (dir))
+ /* nothing */ ;
+ else
+ dir = NULL;
+ }
+ if (dir == NULL)
+ {
+ if (direxists (P_tmpdir))
+ dir = P_tmpdir;
+ else if (strcmp (P_tmpdir, "/tmp") != 0 && direxists ("/tmp"))
+ dir = "/tmp";
+ else
+ {
+ __set_errno (ENOENT);
+ return -1;
+ }
+ }
+
+ dlen = strlen (dir);
+ while (dlen > 1 && dir[dlen - 1] == '/')
+ dlen--; /* remove trailing slashes */
+
+ /* check we have room for "${dir}/${pfx}XXXXXX\0" */
+ if (tmpl_len < dlen + 1 + plen + 6 + 1)
+ {
+ __set_errno (EINVAL);
+ return -1;
+ }
+
+ sprintf (tmpl, "%.*s/%.*sXXXXXX", (int) dlen, dir, (int) plen, pfx);
+ return 0;
+}
+
+/* These are the characters used in temporary filenames. */
+static const char letters[] =
+"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
+
+/* Generate a temporary file name based on TMPL. TMPL must match the
+ rules for mk[s]temp (i.e. end in "XXXXXX"). The name constructed
+ does not exist at the time of the call to __gen_tempname. TMPL is
+ overwritten with the result.
+
+ KIND may be one of:
+ __GT_NOCREATE: simply verify that the name does not exist
+ at the time of the call.
+ __GT_FILE: create the file using open(O_CREAT|O_EXCL)
+ and return a read-write fd. The file is mode 0600.
+ __GT_BIGFILE: same as __GT_FILE but use open64().
+ __GT_DIR: create a directory, which will be mode 0700.
+
+ We use a clever algorithm to get hard-to-predict names. */
+
+int
+__gen_tempname (char *tmpl, int kind)
+{
+ char *XXXXXX;
+ static uint64_t value;
+ uint64_t random_time_bits;
+ unsigned int count;
+ int fd = -1;
+ int save_errno = errno;
+ struct_stat64 st;
+
+ /* A lower bound on the number of temporary files to attempt to
+ generate. The maximum total number of temporary file names that
+ can exist for a given template is 62**6. It should never be
+ necessary to try all these combinations. Instead if a reasonable
+ number of names is tried (we define reasonable as 62**3) fail to
+ give the system administrator the chance to remove the problems. */
+ unsigned int attempts_min = 62 * 62 * 62;
+
+ /* The number of times to attempt to generate a temporary file. To
+ conform to POSIX, this must be no smaller than TMP_MAX. */
+ unsigned int attempts = attempts_min < TMP_MAX ? TMP_MAX : attempts_min;
+
+#ifdef VANILLA
+ len = strlen (tmpl);
+ if (len < 6 || strcmp (&tmpl[len - 6], "XXXXXX"))
+ {
+ __set_errno (EINVAL);
+ return -1;
+ }
+
+ /* This is where the Xs start. */
+ XXXXXX = &tmpl[len - 6];
+#else /* !VANILLA */
+ /* hacked for cadaver. */
+ XXXXXX = strstr(tmpl, "XXXXXX");
+ if (XXXXXX == NULL)
+ {
+ __set_errno (EINVAL);
+ return -1;
+ }
+#endif /* VANILLA */
+
+ /* Get some more or less random data. */
+#ifdef RANDOM_BITS
+ RANDOM_BITS (random_time_bits);
+#else
+# if HAVE_GETTIMEOFDAY || defined(_LIBC)
+ {
+ struct timeval tv;
+ __gettimeofday (&tv, NULL);
+ random_time_bits = ((uint64_t) tv.tv_usec << 16) ^ tv.tv_sec;
+ }
+# else
+ random_time_bits = time (NULL);
+# endif
+#endif
+ value += random_time_bits ^ __getpid ();
+
+ for (count = 0; count < attempts; value += 7777, ++count)
+ {
+ uint64_t v = value;
+
+ /* Fill in the random bits. */
+ XXXXXX[0] = letters[v % 62];
+ v /= 62;
+ XXXXXX[1] = letters[v % 62];
+ v /= 62;
+ XXXXXX[2] = letters[v % 62];
+ v /= 62;
+ XXXXXX[3] = letters[v % 62];
+ v /= 62;
+ XXXXXX[4] = letters[v % 62];
+ v /= 62;
+ XXXXXX[5] = letters[v % 62];
+
+ switch (kind)
+ {
+ case __GT_FILE:
+ fd = __open (tmpl, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
+ break;
+
+ case __GT_BIGFILE:
+ fd = __open64 (tmpl, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
+ break;
+
+ case __GT_DIR:
+ fd = __mkdir (tmpl, S_IRUSR | S_IWUSR | S_IXUSR);
+ break;
+
+ case __GT_NOCREATE:
+ /* This case is backward from the other three. __gen_tempname
+ succeeds if __xstat fails because the name does not exist.
+ Note the continue to bypass the common logic at the bottom
+ of the loop. */
+ if (__lxstat64 (_STAT_VER, tmpl, &st) < 0)
+ {
+ if (errno == ENOENT)
+ {
+ __set_errno (save_errno);
+ return 0;
+ }
+ else
+ /* Give up now. */
+ return -1;
+ }
+ continue;
+
+ default:
+ assert (! "invalid KIND in __gen_tempname");
+ }
+
+ if (fd >= 0)
+ {
+ __set_errno (save_errno);
+ return fd;
+ }
+ else if (errno != EEXIST)
+ return -1;
+ }
+
+ /* We got out of the loop because we ran out of combinations to try. */
+ __set_errno (EEXIST);
+ return -1;
+}
diff --git a/lib/yesno.c b/lib/yesno.c
new file mode 100644
index 0000000..788b77d
--- /dev/null
+++ b/lib/yesno.c
@@ -0,0 +1,54 @@
+/* yesno.c -- read a yes/no response from stdin
+ Copyright (C) 1990, 1998 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#if HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <ctype.h>
+#if HAVE_STDLIB_H
+# include <stdlib.h>
+#endif
+#include <stdio.h>
+
+#include "common.h"
+
+/* Read one line from standard input
+ and return nonzero if that line begins with y or Y,
+ otherwise return 0. */
+
+int rpmatch ();
+
+int
+yesno ()
+{
+ /* We make some assumptions here:
+ a) leading white space in the response are not vital
+ b) the first 128 characters of the answer are enough (the rest can
+ be ignored)
+ I cannot think for a situation where this is not ok. --drepper@gnu */
+ char buf[128];
+ int len = 0;
+ int c;
+
+ while ((c = getchar ()) != EOF && c != '\n')
+ if ((len > 0 && len < 127) || (len == 0 && !isspace (c)))
+ buf[len++] = c;
+ buf[len] = '\0';
+
+ return rpmatch (buf) == 1;
+}
diff --git a/litmus.in b/litmus.in
new file mode 100644
index 0000000..c650029
--- /dev/null
+++ b/litmus.in
@@ -0,0 +1,60 @@
+#!/bin/sh
+# Copyright (c) 2001-2005, 2008 Joe Orton <litmus@lists.manyfish.co.uk>
+
+prefix=@prefix@
+exec_prefix=@prefix@
+libexecdir=@libexecdir@
+datadir=@datadir@
+datarootdir=@datarootdir@
+
+HTDOCS=${HTDOCS-"@datadir@/litmus/htdocs"}
+TESTROOT=${TESTROOT-"@libexecdir@/litmus"}
+TESTS=${TESTS-"@TESTS@"}
+
+usage() {
+ cat <<EOF
+litmus: Usage: $0 [OPTIONS] URL [USERNAME PASSWORD]
+
+Options:
+ -k, --keep-going continue testing even if one suite fails
+ -p, --proxy=URL use given proxy server URL
+ -c, --client-cert=CERT use given PKCS#12 client cert
+
+Significant environment variables:
+
+ \$TESTS - specify test programs to run
+ default: "@TESTS@"
+ \$HTDOCS - specify alternate document root
+ default: @datadir@/litmus/htdocs
+ \$TESTROOT - specify alternate program directory
+ default: @libexecdir@/litmus
+
+Feedback to <litmus@webdav.org>.
+EOF
+ exit 1
+}
+
+nofail=0
+
+case $1 in
+--help|-h) usage ;;
+--keep-going|-k) nofail=1; shift ;;
+--version) echo litmus @PACKAGE_VERSION@; exit 0 ;;
+esac
+
+test "$#" = "0" && usage
+
+for t in $TESTS; do
+ tprog="${TESTROOT}/${t}"
+ if test -x ${tprog}; then
+ if ${tprog} --htdocs ${HTDOCS} "$@"; then
+ : pass
+ elif test $nofail -eq 0; then
+ echo "See debug.log for network/debug traces."
+ exit 1
+ fi
+ else
+ echo "ERROR: Could not find ${tprog}"
+ exit 1
+ fi
+done
diff --git a/macros/ChangeLog b/macros/ChangeLog
new file mode 100644
index 0000000..ad26543
--- /dev/null
+++ b/macros/ChangeLog
@@ -0,0 +1,1085 @@
+Sun Sep 12 18:38:13 2004 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NEON_USE_EXTERNAL): Check for IDNA, LFS, SOCKS
+ support.
+ (NEON_SOCKS): Use common feature code for SOCKSv5 support.
+
+Fri Sep 10 20:52:54 2004 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (LIBNEON_SOURCE_CHECKS): Safer autoheader template for
+ declaring stpcpy as necessary for bundled neon builds.
+ (NEON_WARNINGS): Drop -Winline.
+
+Wed Aug 25 19:44:26 2004 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (LIBNEON_SOURCE_CHECKS): Check for poll.
+
+Sat Jul 3 11:39:01 2004 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (LIBNEON_SOURCE_CHECKS): Pick up gethostbyname in
+ -lsocket for QNX.
+
+Fri Apr 16 11:43:10 2004 Joe Orton <joe@manyfish.co.uk>
+
+ * neon-xml-parser.m4 (NEON_XML_PARSER): If built using libtool,
+ and --with-expat specifies a libexpat.la file, add the libexpat.la
+ to NEON_LTLIBS.
+
+ * neon.m4 (NEON_COMMON_CHECKS): Substitute NEON_LTLIBS.
+
+Tue Apr 13 20:51:59 2004 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NEON_GSSAPI): Check for presence of
+ gssapi/gssapi_generic.h.
+
+Wed Apr 7 13:16:33 2004 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NE_LARGEFILE): Check for strtoq.
+
+Mon Mar 15 19:59:36 2004 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (LIBNEON_SOURCE_CHECKS): Be safer around getaddrinfo
+ blacklist for HP-UX and reference why it's needed.
+
+Sun Mar 7 11:15:44 2004 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (LIBNEON_SOURCE_CHECKS): Use NE_LARGEFILE in-place
+ rather than AC_REQUIRE'ing it.
+ (NE_LARGEFILE): Add NE_LFS to CPPFLAGS for use in bundled builds.
+
+Mon Feb 23 23:02:54 2004 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NE_SNPRINTF): Define HAVE_TRIO if trio is used.
+
+Mon Feb 23 00:22:39 2004 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (LIBNEON_SOURCE_CHECKS): Give INCLUDES argument to
+ AC_CHECK_HEADERS; prevent warning from cpp test for netinet/in.h
+ on some platforms.
+
+Sun Feb 22 17:52:42 2004 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NE_SEARCH_LIBS): Fix to run actions-if-found if
+ function is found without needing additional libraries.
+ (LIBNEON_SOURCE_CHECKS): Only check for gethostbyname if
+ getaddrinfo is not found. Disable getaddrinfo on HP-UX 11.[01]*
+ here rather than ne_socket.c.
+
+Sat Jan 24 17:49:50 2004 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (LIBNEON_SOURCE_CHECKS): Also check for __tm_gmtoff in
+ struct tm.
+
+Sat Jan 24 17:16:48 2004 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4: Remove -ansi-pedantic and -Wimplicit-prototypes for gcc
+ 3.4 compatibility (thanks to Olaf Hering).
+
+Sat Jan 3 14:11:14 2004 Joe Orton <joe@manyfish.co.uk>
+
+ * neon-test.m4: Check for stdint.h.
+
+Sat Jan 3 13:17:21 2004 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NE_LARGEFILE): Add NE_LFS to neon-config --cflags
+ output.
+
+Thu Jan 1 18:42:56 2004 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NEON_FORMAT): Use C99 'll' rather than non-standard 'q'
+ length modifier.
+
+Thu Jan 1 17:36:39 2004 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NE_LARGEFILE): New macro.
+ (LIBNEON_SOURCE_CHECKS): Call it.
+
+Sat Nov 15 09:25:43 2003 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4, neon-xml-parser.m4: Update for latest autoconf
+ best-practice: s/AC_HELP_STRING/AS_HELP_STRING, replace AC_TRY_RUN
+ with AC_RUN_IFELSE, AC_TRY_LINK_FUNC with AC_LINK_IFELSE,
+ AC_TRY_COMPILE with AC_COMPILE_IFELSE, remove AC_LANG_C and
+ AC_PROG_CC_STDC,
+
+Fri Nov 14 13:12:10 2003 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NEON_LIBIDN): New macro.
+ (LIBNEON_SOURCE_CHECKS): Use NEON_LIBIDN.
+
+Fri Nov 14 11:28:58 2003 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NE_ENABLE_SUPPORT, NE_DISABLE_SUPPORT): New macros.
+ Use throughout to flag support or lack of support for optional
+ features.
+
+Thu Nov 13 20:25:28 2003 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (LIBNEON_SOURCE_CHECKS): Check for gethostbyname in
+ -lbind too.
+
+Tue Oct 7 21:20:16 2003 Joe Orton <joe@manyfish.co.uk>
+
+ * neon-test.m4 (NEON_TEST): Check for shutdown.
+
+Mon Sep 22 21:20:37 2003 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NE_CHECK_FUNCS, NE_SEARCH_LIBS): Avoid clobbering
+ ne_save_{LIBS,CPPFLAGS}.
+
+Sun Sep 14 10:51:34 2003 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (LIBNEON_SOURCE_CHECKS): Check for working AI_ADDRCONFIG
+ flag for getaddrinfo().
+
+Wed Sep 10 21:45:10 2003 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NEON_GSSAPI): Restore CPPFLAGS and NEON_LIBS if GSSAPI
+ detection fails.
+
+Thu Sep 4 21:29:06 2003 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (LIBNEON_SOURCE_CHECKS): Check for netinet/tcp.h.
+
+Wed Jul 23 21:17:40 2003 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NEON_GSSAPI): New macro.
+
+Mon Apr 21 18:24:12 2003 Joe Orton <joe@manyfish.co.uk>
+
+ * neon-xml-parser.m4 (HAVE_EXPAT): Fail if --with-expat is given
+ but expat.h is not found.
+
+Wed Mar 26 20:29:11 2003 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NEON_SSL): And add ne_stubssl to NEON_EXTRAOBJS for
+ non-SSL build.
+
+Tue Mar 25 20:43:01 2003 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NEON_SSL): Add ne_openssl to NEON_EXTRAOBJS.
+
+Mon Mar 17 20:34:55 2003 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (LIBNEON_SOURCE_CHECKS): Check for netdb.h.
+
+Sun Mar 16 14:22:02 2003 Joe Orton <joe@manyfish.co.uk>
+
+ * neon-xml-parser.m4 (NE_XML_BUNDLED_EXPAT): Define
+ HAVE_XMLPARSE_H.
+
+Sun Mar 16 11:47:35 2003 Joe Orton <joe@manyfish.co.uk>
+
+ * neon-xml-parser.m4 (NEON_XML_PARSER): Also fix
+ non-included-expat build for when included expat is not an option.
+
+Sun Mar 16 11:20:23 2003 Joe Orton <joe@manyfish.co.uk>
+
+ * neon-xml-parser.m4 (NEON_XML_PARSER): Fix non-included-expat
+ build broken in previous commit.
+
+Sun Mar 16 09:06:41 2003 Joe Orton <joe@manyfish.co.uk>
+
+ * neon-xml-parser.m4 (NEON_XML_PARSER): Fix --with-included-expat
+ support.
+
+Sun Mar 9 10:08:57 2003 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NEON_SSL): Fail if --with-ssl is given an argument.
+
+Sun Mar 9 08:55:04 2003 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NE_SEARCH_LIBS): Bug fix to always compare against
+ `extras' if given. Add support for optional `actions-if-found'
+ argument.
+
+ * neon-xml-parser.m4: Largely rewritten. Drop support for
+ libxml 1.x; require expat 1.95.x.
+
+Sun Mar 9 08:50:22 2003 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (LIBNEON_SOURCE_CHECKS): Check for stpcpy.
+
+Mon Mar 3 22:15:56 2003 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NE_CHECK_FUNCS): Check whether h_errno is declared.
+
+Wed Feb 19 21:35:20 2003 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NEON_FORMAT): Revert use of 'z' modifier; breaks on
+ CygWin.
+
+Tue Jan 14 17:06:07 2003 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NEON_FORMAT): Prefer the C99 'z' modifier to printf
+ size_t/ssize_t values where available.
+
+Fri Jan 3 23:12:20 2003 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NE_PKG_CONFIG): New macro.
+ (NEON_SSL): Use NE_PKG_CONFIG rather than PKG_CHECK_MODULES.
+
+Mon Dec 16 20:02:45 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NEON_SSL): Only check for OpenSSL <=0.9.6 if version is
+ known to be <=0.9.7.
+
+Mon Dec 16 19:01:57 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4: Use pkg-config data to determine location OpenSSL
+ libraries/headers, if available.
+
+Tue Nov 19 11:21:31 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * neon-test.m4 (NEON_TEST): Suggest this macro is run before
+ NEON_XML_PARSER.
+
+Mon Oct 7 22:22:12 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NE_CHECK_SSLVER): New macro.
+ (NEON_SSL): Use NE_CHECK_SSLVER. Add --with-egd argument;
+ conditionally enable EGD, optionally using only a specific EGD
+ socket path, and only if using OpenSSL before 0.9.7.
+
+Tue Sep 24 21:36:01 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NE_ZLIB_VERSION): Removed macro.
+ (NEON_ZLIB): Removed --with-force-zlib flag; don't check zlib
+ version.
+ (NEON_SSL): Removed --with-force-ssl flag, only require OpenSSL
+ 0.9.6 or later.
+
+Sat Aug 31 17:28:15 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NEON_FORMAT_PREP): Add check for gcc -Wformat -Werror
+ sanity.
+ (NEON_FORMAT): Only use gcc -Wformat -Werror if sanity is assured.
+
+Fri Aug 30 22:07:59 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4: Set NEON_INTERFACE_VERSION according to
+ NEON_VERSION_MINOR, NEON_VERSION_RELEASE, for the duration of neon
+ 0.x releases.
+
+Sun Aug 25 23:52:38 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NE_CHECK_FUNCS): New macro.
+ (LIBNEON_SOURCE_CHECKS): Use NE_CHECK_FUNCS rather than
+ AC_CHECK_FUNCS, so $NEON_LIBS are searched.
+
+Sun Aug 25 11:53:20 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (LIBNEON_SOURCE_CHECKS): Require inet_ntop as well for
+ USE_GETADDRINFO test.
+
+Sun Aug 18 22:50:09 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (LIBNEON_SOURCE_CHECKS): Remove redundant check for
+ SIGPIPE definition.
+
+Sun Aug 18 22:41:15 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NE_SEARCH_LIBS): Take optional fourth argument.
+ (LIBNEON_SOURCE_CHECKS): Define USE_GETADDRINFO if getaddrinfo and
+ gai_strerror are present. Otherwise, check for hstrerror,
+ possibly in -lresolv.
+
+ * neon-test.m4: Don't check for hstrerror().
+
+Sun Aug 18 22:31:13 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * neon-xml-parser.m4 (NEON_FIND_PARSER_H, NEON_XML_LIBXML2):
+ Re-order checks to skip redundant tests, speeding up common case.
+
+Fri Aug 9 19:47:14 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NEON_SSL): Require OpenSSL 0.9.6f or later.
+
+Wed Jul 31 23:01:17 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * strftime.m4, readline.m4: Removed from neon/macros CVS module.
+
+Tue Jul 30 19:09:20 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NEON_COMMON_CHECKS): Require AC_TYPE_SIZE_T,
+ AC_TYPE_OFF_T.
+
+ * neon-test.m4 (NEON_TEST): Require AC_TYPE_PID_T.
+
+Tue Jul 30 19:06:48 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NEON_SSL): Require OpenSSL 0.9.6e or later for security
+ fixes; add --with-force-ssl to override version check.
+
+Fri Jul 26 00:01:07 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NE_MACOSX): Just check for any Darwin system.
+
+Sat Jul 20 10:40:29 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NEON_WITH_LIBS): Allow a colon-separated list of
+ directories for --with-libs argument.
+
+Thu Jul 18 20:07:43 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (LIBNEON_SOURCE_CHECKS): Require AC_FUNC_STRERROR_R.
+
+Wed Jul 17 23:26:51 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NEON_CHECK_VERSION): Rewrite to cache results,
+ simplify, and use new ne_version_match.
+ (NE_ZLIB_VERSION): Cache result.
+
+Fri Jul 5 12:57:56 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NEON_SSL): Fail if openssl/opensslv.h header is not
+ found, or if OpenSSL version is earlier than 0.9.6.
+
+Sun Jun 16 14:04:18 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NEON_FORMAT): Take optional third argument giving
+ format string specifier to use.
+ (NEON_COMMON_CHECKS): Get format string for ssize_t; fix to
+ use 'u' specifier for size_t format string.
+
+Thu Jun 13 20:34:35 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * neon-xml-parser.m4 (NEON_XML_PARSER): Undocument use of =DIR
+ parameter to --with-expat, as it gives false expectations.
+
+Wed Jun 12 23:26:40 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NEON_WITH_LIBS): New macro.
+
+Mon Jun 10 22:31:50 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NEON_WARNINGS): Replace -ansi-pedantic with -pedantic.
+
+Sun May 26 19:08:12 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * neon-xml-parser.m4 (NEON_XML_LIBXML2): Check for
+ libxml/xmlversion.h header too.
+
+Wed May 22 09:54:42 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NE_MACOSX): Cache result.
+ (NE_COMMON_CHECKS): Simplify tm_gmtoff check further: use
+ AC_CHECK_MEMBERS.
+
+Mon May 20 21:18:06 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NE_SEARCH_LIBS): Cache results.
+
+Mon May 20 20:55:04 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (LIBNEON_SOURCE_CHECKS): Use AC_CACHE_CHECK to check for
+ SIGPIPE in signal.h; don't invade the ac_ namespace with cache
+ variables. Cache results of tm_gmtoff test too.
+
+Mon May 20 20:35:22 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NE_SNPRINTF): Simplify logic.
+
+Sun May 19 20:23:55 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NEON_WARNINGS): Remove with_warnings variable;
+ simplify.
+
+Wed May 19 08:36:44 2004 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (LIBNEON_SOURCE_CHECKS): Declare stpcpy on modern
+ "Linux-like" AIXes.
+
+Sun May 19 09:35:08 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NE_FIND_AR): Fix $PATH handling on some Linux
+ platforms.
+
+Sun May 19 09:05:22 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NE_FIND_AR): New macro.
+ (NEON_NORMAL_BUILD): Require NE_FIND_AR.
+
+ * neon-test.m4: Require NE_FIND_AR. Check for hstrerror().
+
+Fri May 17 23:37:19 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NEON_SSL): Allow --without-ssl again.
+
+Wed May 15 21:00:15 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * neon-xml-parser.m4 (NEON_XML_LIBXML2): sed '-L/usr/lib ' out of
+ xml2-config --libs output.
+
+Sat May 11 15:30:38 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NEON_SOCKS): Moved and simplified from neon-socks.m4.
+ Drop support for specifying directory argument; fail if
+ --with-socks is given and socks.h is not found.
+
+ * neon-socks.m4: Removed file.
+
+Sat May 11 15:22:36 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NEON_DEBUG): Moved and simplified from neon-debug.m4.
+
+ * neon-debug.m4: Removed file.
+
+Sat May 11 13:40:29 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NEON_WARNINGS): Moved and simplified from
+ neon-warnings.m4.
+
+ * neon-warnings.m4: Removed file.
+
+Sat May 11 13:26:00 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NEON_SSL): Simplified version of NEON_SSL from
+ neon-ssl.m4. Check for ssl.h; detect OpenSSL ENGINE correctly
+ when -lcrypto requries -ldl.
+
+ * neon-ssl.m4: Removed file.
+
+Sat May 11 13:16:27 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NE_SEARCH_LIBS): Allow passing 'extralibs' to include
+ in library list when link against a specified library fails.
+ Prepend found library/libraries to $NEON_LIBS.
+
+Sat May 11 12:40:24 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * neon-xml-parser.m4 (NEON_XML_PARSER),
+ * neon.m4 (NEON_REPLACE_SNPRINTF):
+ Use AC_LIBOBJ rather than modify LIBOBJS directly, to appease
+ autoconf 2.53.
+
+Wed May 1 22:32:10 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * neon-xml-parser.m4 (NEON_XML_LIBXML1): Fix syntax error in
+ libxml 1.x detection causing spurious or missing warning message.
+
+Thu Apr 25 07:38:33 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * neon-xml-parser.m4 (NEON_XML_EXTERNAL_EXPAT): Check for expat.h
+ too, to support expat 1.95.x (Branko ibej).
+
+Tue Apr 23 21:09:55 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * neon-xml-parser.m4 (NEON_FIND_PARSER_H): New macro, factored out
+ from NEON_XML_LIBXML2.
+ (NEON_XML_LIBXML2, NEON_XML_LIBXML1): Use it.
+
+Tue Apr 23 20:54:30 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * neon-xml-parser.m4 (NEON_XML_LIBXML2): Check for parser.h or
+ libxml/parser.h, or fail.
+
+Sat Apr 13 22:35:01 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NE_SNPRINTF): Define NEON_TRIO in NEON_CFLAGS, export
+ it from 'neon-config --cflags' output.
+
+Fri Apr 5 23:40:00 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NEON_ZLIB, NE_ZLIB_VERSION): Add --with-force-zlib, to
+ skip zlib version check. Simplify neon_zlib_message handling a
+ little.
+
+Tue Mar 12 00:18:00 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NE_ZLIB_VERSION): New macro.
+ (NEON_ZLIB): Use it to require zlib 1.1.4.
+
+Sun Mar 10 22:05:26 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NEON_ZLIB): Don't add ne_compress to NEON_EXTRAOBJS.
+
+Mon Mar 4 21:04:28 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * neon-ssl.m4 (NEON_SSL): Avoid adding -I/usr/include to CFLAGS
+ during build as well as not exporting it via neon-config.
+
+Tue Feb 19 21:30:50 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * neon-socks.m4 (NEON_SOCKS): Fix configure argument name, export
+ -L argument in NEON_LIBS, check for socks.h not sock.h, define
+ NEON_SOCKS.
+
+Sun Jan 13 20:07:51 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NE_MACOSX): New macro.
+ (NEON_COMMON_CHECKS): Call it.
+
+Sun Jan 6 21:35:08 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * neon-xml-parser.m4 (NEON_XML_PARSER): Add XML_BYTE_ORDER to
+ CPPFLAGS; mini-expat doesn't pick up config.h.
+
+Tue Jan 1 23:30:03 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * neon-xml-parser.m4 (NEON_XML_PARSER): Set XML_BYTE_ORDER
+ appropriately.
+
+Tue Jan 1 22:50:15 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NEON_CHECK_VERSION): Don't add libs for external neon
+ to NEON_LIBS here.
+
+Tue Jan 1 22:44:05 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * neon-xml-parser.m4 (NEON_XML_LIBXML2, NEON_XML_LIBXML1): Alter
+ CPPFLAGS only, not CFLAGS.
+
+Tue Jan 1 21:49:16 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NEON_USE_EXTERNAL): Factored out from NEON_COMMON.
+ (NEON_COMMON): Use NEON_USE_EXTERNAL; simplify, improve reporting.
+
+ * neon.m4 (NEON_COMMON_CHECKS): Move check for common headers
+ here... (LIBNEON_SOURCE_CHECKS): from here.
+
+Tue Jan 1 21:44:33 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * neon-test.m4 (NEON_TEST): Check for AR and RANLIB.
+
+Fri Dec 14 22:39:57 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * neon-test.m4 (NEON_TEST): Pick up time_t definition from
+ sys/time.h if present (fix for Solaris 2.6 and probably
+ elsewhere).
+
+Fri Dec 14 22:39:32 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NEON_FORMAT): Allow passing in headers where type may
+ be defined.
+
+Mon Dec 10 07:36:26 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NEON_COMMON): Fix --with-neon=PATH again.
+
+Sun Dec 9 21:40:47 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * neon-test.m4 (NEON_TEST): Determine how to print time_t.
+
+Sun Dec 9 11:50:03 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NEON_WITHOUT_ACL): New macro.
+ (LIBNEON_SOURCE_CHECKS): Conditionally build ACL support.
+
+Sun Dec 9 01:06:32 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NEON_CHECK_VERSION): Use NEON_CONFIG as config script,
+ drop first argument. Better error message if the link failed.
+ (NEON_COMMON): Cleanup. Check for neon-config in PATH. Stop if
+ --with-neon was given, and the external neon wasn't good enough.
+
+Sun Dec 9 00:17:19 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * neon-test.m4 (NEON_TEST): Requires NEON_COMMON_CHECKS.
+
+ * neon-warnings.m4 (NEON_WARNINGS): Requires AC_PROG_CC.
+
+Sun Dec 9 00:13:47 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NEON_COMMON_CHECKS): New macro; runs common C
+ language/compiler checks, which may be useful to neon applications
+ regardless of whether a bundled or external neon is being used.
+ Use AC_REQUIRE to prevent macros being expanded more than once.
+ (LIBNEON_SOURCE_CHECKS, NEON_COMMON): Require NEON_COMMON_CHECKS
+ to have been expanded.
+
+Sat Dec 8 00:56:34 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NEON_FORMAT): Rewrite to use cache results (should fix
+ for cross-compiling), and for GCC, actually test for warnings -
+ fix for Linux.
+
+Sat Dec 8 00:15:44 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NEON_CHECK_SUPPORT): Send --support output to
+ /dev/null, in case it is from pre-0.18 and prints the usage
+ message.
+
+Sat Dec 8 00:13:55 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NEON_COMMON): Prepend -lneon to NEON_LIBS rather than
+ overwriting it when using bundled build.
+
+Mon Dec 3 19:49:28 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NEON_FORMAT_PREP, NEON_FORMAT): New macros.
+ (LIBNEON_SOURCE_CHECKS): Call them.
+
+Mon Dec 3 19:43:11 2001 Joe Orton <joe@manyfish.co.uk>
+
+ Fix gethostbyname() detection on Unixware 7:
+
+ * neon.m4 (NEON_COMMON): Add -lneon to NEON_LIBS after performing
+ source checks. (NE_SEARCH_LIBS): Test using libraries from
+ NEON_LIBS too.
+
+Sat Nov 24 20:33:11 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NEON_CHECK_SUPPORT): New macro. (NEON_COMMON): Define
+ NEON_SUPPORTS_{SSL,ZLIB} when using an external neon.
+
+Sat Nov 24 20:25:15 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NEON_WITHOUT_ZLIB): New function.
+ (LIBNEON_SOURCE_CHECKS): Conditionally enable zlib support.
+
+Sun Nov 18 12:29:08 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * neon-ssl.m4 (NEON_SSL): Don't add -I/usr/include to NEON_CFLAGS.
+
+Sat Oct 27 12:20:08 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4, neon-ssl.m4: Substitute NEON_SUPPORTS_ZLIB,
+ NEON_SUPPORTS_DAV, NEON_SUPPORTS_SSL as "yes" or "no"
+ appropriately.
+
+Thu Oct 25 14:29:53 2001 Mo DeJong <supermo@bayarea.net>
+
+ * neon.m4 (NEON_NORMAL_BUILD): Use AC_CHECK_TOOL instead of
+ AC_PATH_PROG so that cross compilation works properly.
+
+Sat Oct 6 13:36:58 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NEON_ZLIB): New macro. (LIBNEON_SOURCE_CHECKS):
+ print warning if struct tm lacks tm_gmtoff.
+
+Sat Oct 6 12:39:09 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4: Require autoconf 2.50. Use AC_HELP_STRING where
+ possible, and AC_MSG_NOTICE instead of 'echo'.
+
+ * neon-ssl.m4, neon-xml-parser.m4, neon-socks.m4: Quoting fixes
+ for help strings.
+
+Tue Oct 2 21:13:24 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (LIBNEON_SOURCE_CHECKS): Check for tm_gmtoff in struct
+ tm.
+
+Sun Sep 30 23:35:03 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NE_SEARCH_LIBS): AC_SEARCH_LIBS replacement, adds found
+ libraries to NEON_LIBS instead.
+
+Sun Sep 30 11:11:19 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * neon-test.m4: New file.
+
+Sun Sep 30 11:09:58 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4, neon-xml-parser.m4: Always add libs to $LIBS rather
+ than $NEONLIBS.
+
+ * neon.m4: Export NEON_CFLAGS.
+
+Sat Sep 29 14:12:53 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (LIBNEON_SOURCE_CHECKS): Check for zlib (zlib.h, inflate
+ in -lz). Add ne_compress to NEON_EXTRAOBJS.
+
+Tue Sep 25 07:31:53 2001 Mo DeJong <supermo@bayarea.net>
+
+ * neon.m4 (LIBNEON_SOURCE_CHECKS): Check for <signal.h> instead of
+ <sys/signal.h>. Define HAVE_SIGPIPE if SIGPIPE is defined in
+ <signal.h>.
+
+Mon Sep 24 20:16:47 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * neon-xml-parser.m4 (NEON_XML_EXTERNAL_EXPAT): Fix broken
+ AC_DEFINE (Mo DeJong).
+
+Mon Sep 24 17:24:42 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * ac_c_bigendian_cross.m4: New file.
+
+ * neon.m4: Use AC_C_BIGENDIAN_CROSS rather than AC_C_BIGENDIAN.
+
+Mon Sep 17 23:29:11 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (LIBNEON_SOURCE_CHECKS): Check for setvbuf().
+
+Sun Sep 16 20:39:05 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * neon-ssl.m4 (NEON_SSL): Put SSL libs in LIBS rather than
+ NEONLIBS (and lib paths).
+
+Sun Sep 16 20:36:53 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NEON_COMMON): Add library paths to NEONLIBS rather than
+ LDFLAGS.
+
+Sat Jun 9 22:06:25 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * neon-debug.m4: New file.
+
+Thu May 31 00:04:51 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NEON_COMMON_BUILD): Update filenames.
+ (NEON_CHECK_VERSION): Do simple AC_TRY_LINK and warn appropriately
+ before checking version.
+
+Thu May 31 00:03:40 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * neon-warnings.m4: Add -Wbad-function-cast.
+
+Wed May 30 23:37:48 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * neon-xml-parser.m4: Added --with-libxml1 and --with-libxml2
+ arguments.
+
+Tue Apr 17 23:06:25 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * neon-ssl.m4: Define neon_ssl_message for configure output.
+
+Wed Apr 11 23:14:33 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NEON_COMMON_BUILD): Fix specifying a list of object
+ files.
+
+Fri Apr 6 23:09:58 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (LIBNEON_SOURCE_CHECKS): Call NEON_SOCKS.
+
+Fri Apr 6 23:08:39 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * neon-socks.m4: Add basic SOCKSv5 support (untested).
+
+Mon Apr 2 21:42:40 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4: Version is 0.13.0, interface version 13:0:0.
+
+Mon Apr 2 00:27:37 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4: Move check for 'ar' program to NEON_NORMAL_BUILD, it's
+ not necessary for libtool build.
+
+Mon Apr 2 00:17:58 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * neon-xml-parser.m4 (NEON_XML_PARSER): Check for xmlversion.h
+ header from libxml2.
+
+Sun Apr 1 21:23:26 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * neon-xml-parser.m4: Add expat2 support (Sam TH <sam@uchicago.edu>).
+
+Wed Mar 21 10:56:03 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * neon-xml-parser.m4: Add libxml2 support.
+
+Sun Mar 4 15:45:21 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * neon-xml-parser.m4 (NEON_XML_PARSER): Use an m4 ifelse rather
+ than a shell test to code the conditional on whether an argument
+ was passed to the macro or not.
+
+Sun Mar 4 15:23:47 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4: Add "actions if not bundled" argument to *_BUNDLED
+ macros.
+
+Mon Feb 26 22:52:24 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4: Version is 0.12.0.
+
+Mon Feb 26 22:06:13 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4: Versionn is 0.12.0-dev.
+
+Sun Feb 25 17:12:49 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (LIBNEON_SOURCE_CHECKS): Add checks for endianness (for
+ md5 code), inline, and const.
+
+Sun Feb 25 17:00:07 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NEON_COMMON): Rename NEON_IS_BUNDLED to
+ NEON_BUILD_BUNDLED.
+
+Sun Feb 25 16:52:19 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NEON_COMMON): Define NEON_IS_BUNDLED to "yes" or "no"
+ appropriately.
+
+Sat Feb 24 00:06:09 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (LIBNEON_SOURCE_CHECKS): Don't set NEON_NEED_XML_PARSER
+ here. (NEON_COMMON): ... set it here instead.
+ (NEON_WITHOUT_WEBDAV): New macro to disable WebDAV support.
+ (NEON_COMMON_BUILD): Select default set of object files to build
+ depending on whether DAV is enabled or not.
+
+Fri Feb 23 23:28:09 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NEON_COMMON_BUILD): Use an m4 'ifelse' for the number
+ of args test.
+
+ * neon.m4 (NEON_LIBTOOL_BUILD, NEON_NORMAL_BUILD,
+ NEON_COMMON_BUILD): Set NEON_OBJEXT correctly (fixes
+ dependancies).
+
+Sun Feb 4 14:55:10 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4: Version is 0.11.0, interface version is 11:0:0.
+
+Sun Jan 28 17:16:27 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NEON_CHECK_VERSION): Run actions-if-okay if
+ NEON_REQUIRE has not been called.
+
+Sun Jan 28 14:53:57 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4 (NEON_REQUIRE, NEON_CHECK_VERSION): New macros.
+ (NEON_COMMON): If a required version is defined, check that an
+ external neon library matches it.
+
+Sun Jan 28 10:39:31 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4: Define NEON_VERSION, NEON_VERSION_{MAJOR,MINOR} in
+ config.h rather than substituting into neon_config.h.
+
+Sat Jan 27 22:55:42 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * neon.m4: Include version string in library message.
+
+Tue Jan 23 23:14:33 2001 Joe Orton <joe@light.plus.com>
+
+ * neon.m4 (NEON_VERSIONS): New macro. (NEON_COMMON): Call it from
+ here.
+
+Mon Jan 15 22:26:54 2001 Joe Orton <joe@light.plus.com>
+
+ * neon-xml-parser.m4 (NEON_XML_PARSER): Append rather than
+ overwrite CFLAGS.
+
+Thu Jan 11 20:49:12 2001 Joe Orton <joe@light.plus.com>
+
+ * neon-ssl.m4: Check for OpenSSL in /usr too.
+
+Thu Jan 11 20:05:34 2001 Joe Orton <joe@light.plus.com>
+
+ * neon.m4 (NEON_VPATH_BUNDLED): New macro. (NEON_BUNDLED): Call
+ NEON_COMMON_BUNDLED. (NEON_COMMON_BUNDLED): Abstracted from
+ NEON_BUNDLED.
+
+Wed Jan 10 22:44:37 2001 Joe Orton <joe@light.plus.com>
+
+ * neon.m4 (NEON_LIBTOOL_BUILD, NEON_NORMAL_BUILD): Pass optional
+ set of objects to build to these macros. Else, all objects go in
+ NEONOBJS. (NEON_COMMON_BUILD): Implement that. Also substitute
+ NEON_LINK_FLAGS.
+
+Mon Jan 8 22:23:51 2001 Joe Orton <joe@light.plus.com>
+
+ * neon-xml-parser.m4 (NEON_XML_PARSER): Put XML parser libs in
+ $NEONLIBS rather than $LIBS.
+
+Mon Jan 8 22:20:51 2001 Joe Orton <joe@light.plus.com>
+
+ * neon-ssl.m4 (NEON_SSL): Put OpenSSL libs in $NEONLIBS rather
+ than LIBS.
+
+Sun Jan 7 17:30:54 2001 Joe Orton <joe@light.plus.com>
+
+ * neon.m4 (NEON_BUNDLED): Add optional second argument to specify
+ builddir of bundled sources (Peter Moulder <pjm@bofh.asn.au>).
+
+Wed Jan 3 21:33:05 2001 Joe Orton <joe@light.plus.com>
+
+ * neon.m4: Place libraries needed to use neon in NEONLIBS. Adding
+ them to LIBS breaks bundled builds since libneon doesn't exist at
+ configure-time, and configure uses $LIBS.
+
+Wed Jan 3 21:17:00 2001 Joe Orton <joe@light.plus.com>
+
+ * neon.m4 (NEON_COMMON_BUILD): Don't set top_builddir using 'pwd'.
+
+Wed Jan 3 21:15:04 2001 Joe Orton <joe@light.plus.com>
+
+ * neon.m4 (NEON_COMMON): If using bundled neon, add -L<bundled
+ dir> to LDFLAGS, and -lneon to LIBS.
+
+Fri Dec 22 23:13:39 2000 Joe Orton <joe@light.plus.com>
+
+ * neon.m4 (NEON_NORMAL_BUILD, NEON_COMMON_BUILD): New macros.
+
+Tue Dec 19 22:13:18 2000 Joe Orton <joe@light.plus.com>
+
+ * neon.m4 (NEON_LIBTOOL_BUILD): New macro.
+
+Wed Dec 13 22:07:07 2000 Joe Orton <joe@light.plus.com>
+
+ * neon.m4: Add a decent interface: NEON_LIBRARY for non-bundled
+ case, NEON_BUNDLED for the bundled case. (LIBNEON_SOURCE_CHECKS):
+ Always set NEON_NEED_XML_PARSER.
+
+ * neon-xml-parser.m4 (NEON_XML_PARSER): Only execute if
+ "$NEON_NEED_XML_PARSER" = "yes".
+
+Sun Nov 19 22:52:56 2000 Joe Orton <joe@light.plus.com>
+
+ * neon.m4, neon-ssl.m4, neon-warnings.m4, neon-xml-parser.m4:
+ Clarify that the more liberal license applies to the m4 files
+ only, not neon in general.
+
+Sun Nov 19 22:40:01 2000 Joe Orton <joe@light.plus.com>
+
+ * neon.m4 (NEON_LIBRARY): Don't call NEON_XML_PARSER, set
+ NEON_NEED_XML_PARSER to "yes" if it needs to be called.
+
+Sun Nov 19 22:31:26 2000 Joe Orton <joe@light.plus.com>
+
+ * neon-xml-parser.m4 (NEON_XML_PARSER): Switch to useing
+ NEON_INCLUDED_EXPAT m4 macro rather than passing arguments.
+
+Sun Nov 19 22:20:36 2000 Joe Orton <joe@light.plus.com>
+
+ * neon.m4 (NEON_LIBRARY): Switch to using NEON_INCLUDED_SOURCE m4
+ macro rather than passing arguments to the NEON_LIBRARY macro.
+
+Sun Nov 5 23:26:18 2000 Joe Orton <joe@light.plus.com>
+
+ * neon-xml-parser.m4: Never set LIBS if using a libtool-built
+ libexpat.la (Greg Stein).
+
+2000-10-10 Joe Orton <joe@monolith.orton.local>
+
+ * neon-xml-parser.m4: If libexpat.la is included in the
+ --with-expat parameter, then use a libtool-friendly LIBS. (Greg
+ Stein)
+
+Sat Oct 7 19:16:08 2000 Joe Orton <joe@light.plus.com>
+
+ * neon-xml-parser.m4: Link against a libexpat.la if found in
+ --with-expat location. (Greg Stein).
+
+Mon Sep 11 15:05:58 2000 Joe Orton <joe@light.plus.com>
+
+ * neon.m4: Use AC_SEARCH_LIBS for finding gethostbyname() and
+ socket().
+
+Mon Sep 11 15:03:45 2000 Joe Orton <joe@light.plus.com>
+
+ * neon.m4 (NEON_REPLACE_SNPRINTF): New macro.
+
+Fri Sep 8 14:30:37 2000 Joe Orton <joe@orton.demon.co.uk>
+
+ * neon.m4: Check for socket() in -lsocket, -linet.
+
+Thu Sep 7 00:11:51 2000 Joe Orton <joe@orton.demon.co.uk>
+
+ * neon-xml-parser.m4: Added --with-expat flag (patch by Greg
+ Stein).
+
+Sun Aug 13 11:12:41 2000 Joe Orton <joe@orton.demon.co.uk>
+
+ * strftime.m4: New file, from fileutils-4.0i.
+
+Thu Jul 27 19:59:18 2000 Joe Orton <joe@orton.demon.co.uk>
+
+ * neon-ssl.m4: Append the SSL libs on the end of $LIBS rather than
+ redefining it completely.
+
+Thu Jul 27 19:43:38 2000 Joe Orton <joe@orton.demon.co.uk>
+
+ * neon.m4: Define variable neon_library_message to describe what
+ neon library is being used.
+
+Mon Jul 24 16:56:34 2000 Joe Orton <joe@orton.demon.co.uk>
+
+ * neon-ssl.m4: Put -lssl before -lcrypto in LIBS.
+
+Thu Jul 20 15:12:14 2000 Joe Orton <joe@orton.demon.co.uk>
+
+ * neon-xml-parser.m4 (NEON_XML_PARSER): Pass directory name
+ containing bundled expat sources as $1.
+
+ * neon.m4 (NEON_LIBRARY): Pass directory name containing bundled
+ neon sources as $1, and $2 is passed to NEON_XML_PARSER for
+ similar use.
+
+Thu Jul 20 15:04:49 2000 Joe Orton <joe@orton.demon.co.uk>
+
+ * neon-ssl.m4: Rewritten from scratch. Support OpenSSL only.
+
+Thu Jul 20 12:41:23 2000 Joe Orton <joe@orton.demon.co.uk>
+
+ * neon.m4, neon-xml-parser.m4, neon_warnings.m4: Added licensing
+ information.
+
+Wed Jul 19 19:30:24 2000 Joe Orton <joe@orton.demon.co.uk>
+
+ * neon-warnings.m4: New file. (NEON_WARNINGS): Macro for doing
+ --enable-warnings.
+
+Sun Jun 18 12:12:23 2000 Joe Orton <joe@orton.demon.co.uk>
+
+ * neon.m4: Only add --with-included-neon flag if neon is bundled.
+
+Sun Jun 18 12:08:23 2000 Joe Orton <joe@orton.demon.co.uk>
+
+ * gnome-x-checks.m4: Imported from GNOME CVS macros module,
+ adding: descriptive args to AC_DEFINE HAVE_LIBSM call, requiring
+ Gtk 1.2.8 and the Gtk 'gthread' module.
+
+Mon May 29 15:10:24 2000 Joe Orton <joe@orton.demon.co.uk>
+
+ * neon.m4 (LIBNEON_SOURCE_CHECKS): Call NEON_SSL.
+
+Tue May 23 19:11:29 2000 Joe Orton <joe@orton.demon.co.uk>
+
+ * neon.m4: Renamed from neon-checks.m4.
+
+Sun May 21 23:52:27 2000 Joe Orton <joe@orton.demon.co.uk>
+
+ * neon-ssl.m4: New file.
+
+Sat May 13 21:08:54 2000 Joe Orton <joe@orton.demon.co.uk>
+
+ * acconfig.h: Added HAVE_LC_MESSAGE (my lcmessage.m4 is missing
+ the appropriate description arguments).
+
+Sat May 13 21:08:40 2000 Joe Orton <joe@orton.demon.co.uk>
+
+ * acconfig.h: Added PACKAGE and VERSION.
+
+Sat May 13 21:02:29 2000 Joe Orton <joe@orton.demon.co.uk>
+
+ * socklen-arg-type.m4: Added file, modified from a KDE
+ configure.in.
+
+Sat May 13 20:44:56 2000 Joe Orton <joe@orton.demon.co.uk>
+
+ * gnome-x-checks.m4: Added description arguments to
+ AC_DEFINE(HAVE_LIBSM).
+
+Wed May 10 19:18:14 2000 Joe Orton <joe@orton.demon.co.uk>
+
+ * neon-xml-parser.m4: Error if no XML parser is found.
+
+Wed May 10 14:33:21 2000 Joe Orton <joe@orton.demon.co.uk>
+
+ * neon-checks.m4: New file.
+
+Wed May 10 14:26:57 2000 Joe Orton <joe@orton.demon.co.uk>
+
+ * neon-xml-parser.m4 (NEON_XML_PARSER): Use "neon_" prefix for
+ variables.
+
+Wed May 10 13:47:04 2000 Joe Orton <joe@orton.demon.co.uk>
+
+ * acconfig.h: New file.
+
+Wed May 10 13:42:16 2000 Joe Orton <joe@orton.demon.co.uk>
+
+ * neon-xml-parser.m4: New file.
+
+Sun May 7 21:57:32 2000 Joe Orton <joe@orton.demon.co.uk>
+
+ * gnome-x-checks.m4 (GNOME_X_CHECKS): Check for Gtk 1.2.7 or
+ later, passing "gthread" module argument.
+
diff --git a/macros/ld-version-script.m4 b/macros/ld-version-script.m4
new file mode 100644
index 0000000..4dec588
--- /dev/null
+++ b/macros/ld-version-script.m4
@@ -0,0 +1,43 @@
+# ld-version-script.m4 serial 1
+dnl Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Simon Josefsson
+
+# FIXME: The test below returns a false positive for mingw
+# cross-compiles, 'local:' statements does not reduce number of
+# exported symbols in a DLL. Use --disable-ld-version-script to work
+# around the problem.
+
+# gl_LD_VERSION_SCRIPT
+# --------------------
+# Check if LD supports linker scripts, and define automake conditional
+# HAVE_LD_VERSION_SCRIPT if so.
+AC_DEFUN([gl_LD_VERSION_SCRIPT],
+[
+ AC_ARG_ENABLE([ld-version-script],
+ AS_HELP_STRING([--enable-ld-version-script],
+ [enable linker version script (default is enabled when possible)]),
+ [have_ld_version_script=$enableval], [])
+ if test -z "$have_ld_version_script"; then
+ AC_MSG_CHECKING([if LD -Wl,--version-script works])
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map"
+ cat > conftest.map <<EOF
+VERS_1 {
+ global: sym;
+};
+
+VERS_2 {
+ global: sym;
+} VERS_1;
+EOF
+ AC_LINK_IFELSE(AC_LANG_PROGRAM([], []),
+ [have_ld_version_script=yes], [have_ld_version_script=no])
+ rm -f conftest.map
+ LDFLAGS="$save_LDFLAGS"
+ AC_MSG_RESULT($have_ld_version_script)
+ fi
+])
diff --git a/macros/neon-test.m4 b/macros/neon-test.m4
new file mode 100644
index 0000000..d1aa930
--- /dev/null
+++ b/macros/neon-test.m4
@@ -0,0 +1,46 @@
+# Copyright (C) 2001-2006 Joe Orton <joe@manyfish.co.uk> -*- autoconf -*-
+#
+# This file is free software; you may copy and/or distribute it with
+# or without modifications, as long as this notice is preserved.
+# This software 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.
+
+# The above license applies to THIS FILE ONLY, the neon library code
+# itself may be copied and distributed under the terms of the GNU
+# LGPL, see COPYING.LIB for more details
+
+# This file is part of the neon HTTP/WebDAV client library.
+# See http://www.webdav.org/neon/ for the latest version.
+# Please send any feedback to <neon@lists.manyfish.co.uk>
+
+# Tests needed for the neon-test common test code.
+
+AC_DEFUN([NE_FORMAT_TIMET], [
+NEON_FORMAT(time_t, [
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif])
+])
+
+AC_DEFUN([NEON_TEST], [
+
+AC_REQUIRE([NEON_COMMON_CHECKS])
+AC_REQUIRE([NE_FORMAT_TIMET])
+
+AC_REQUIRE([AC_TYPE_PID_T])
+AC_REQUIRE([AC_HEADER_TIME])
+
+dnl NEON_XML_PARSER may add things (e.g. -I/usr/local/include) to
+dnl CPPFLAGS which make "gcc -Werror" fail in NEON_FORMAT; suggest
+dnl this macro is used first.
+AC_BEFORE([$0], [NEON_XML_PARSER])
+
+AC_CHECK_HEADERS(sys/time.h stdint.h locale.h signal.h)
+
+AC_CHECK_FUNCS(pipe isatty usleep shutdown setlocale gethostname)
+
+AC_REQUIRE([NE_FIND_AR])
+
+])
diff --git a/macros/neon-xml-parser.m4 b/macros/neon-xml-parser.m4
new file mode 100644
index 0000000..dbcb899
--- /dev/null
+++ b/macros/neon-xml-parser.m4
@@ -0,0 +1,155 @@
+# Copyright (C) 1998-2005, 2007 Joe Orton <joe@manyfish.co.uk> -*- autoconf -*-
+#
+# This file is free software; you may copy and/or distribute it with
+# or without modifications, as long as this notice is preserved.
+# This software 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.
+
+# The above license applies to THIS FILE ONLY, the neon library code
+# itself may be copied and distributed under the terms of the GNU
+# LGPL, see COPYING.LIB for more details
+
+# This file is part of the neon HTTP/WebDAV client library.
+# See http://www.webdav.org/neon/ for the latest version.
+# Please send any feedback to <neon@lists.manyfish.co.uk>
+
+# Check for XML parser, supporting libxml 2.x and expat 1.95.x,
+# or a bundled copy of expat.
+# * Bundled expat if a directory name argument is passed
+# -> expat dir must contain minimal expat sources, i.e.
+# xmltok, xmlparse sub-directories. See sitecopy/cadaver for
+# examples of how to do this.
+#
+# Usage:
+# NEON_XML_PARSER()
+# or
+# NEON_XML_PARSER([expat-srcdir], [expat-builddir])
+
+dnl Find expat: run $1 if found, else $2
+AC_DEFUN([NE_XML_EXPAT], [
+AC_CHECK_HEADER(expat.h,
+ [AC_CHECK_LIB(expat, XML_SetXmlDeclHandler, [
+ AC_DEFINE(HAVE_EXPAT, 1, [Define if you have expat])
+ neon_xml_parser_message="expat"
+ NEON_LIBS="$NEON_LIBS -lexpat"
+ neon_xml_parser=expat
+ AC_CHECK_TYPE(XML_Size,
+ [NEON_FORMAT(XML_Size, [#include <expat.h>])],
+ [AC_DEFINE_UNQUOTED([NE_FMT_XML_SIZE], ["d"])],
+ [#include <expat.h>])
+ ], [$1])], [$1])
+])
+
+dnl Find libxml2: run $1 if found, else $2
+AC_DEFUN([NE_XML_LIBXML2], [
+AC_CHECK_PROG(XML2_CONFIG, xml2-config, xml2-config)
+if test -n "$XML2_CONFIG"; then
+ neon_xml_parser_message="libxml `$XML2_CONFIG --version`"
+ AC_DEFINE(HAVE_LIBXML, 1, [Define if you have libxml])
+ # xml2-config in some versions erroneously includes -I/include
+ # in the --cflags output.
+ CPPFLAGS="$CPPFLAGS `$XML2_CONFIG --cflags | sed 's| -I/include||g'`"
+ NEON_LIBS="$NEON_LIBS `$XML2_CONFIG --libs | sed 's|-L/usr/lib ||g'`"
+ AC_CHECK_HEADERS(libxml/xmlversion.h libxml/parser.h,,[
+ AC_MSG_ERROR([could not find parser.h, libxml installation problem?])])
+ neon_xml_parser=libxml2
+else
+ $1
+fi
+])
+
+dnl Configure for a bundled expat build.
+AC_DEFUN([NE_XML_BUNDLED_EXPAT], [
+
+AC_REQUIRE([AC_C_BIGENDIAN])
+# Define XML_BYTE_ORDER for expat sources.
+if test $ac_cv_c_bigendian = "yes"; then
+ ne_xml_border=21
+else
+ ne_xml_border=12
+fi
+
+# mini-expat doesn't pick up config.h
+CPPFLAGS="$CPPFLAGS -DXML_BYTE_ORDER=$ne_xml_border -DXML_DTD -I$1/xmlparse -I$1/xmltok"
+
+AC_DEFINE_UNQUOTED([NE_FMT_XML_SIZE], ["d"])
+
+# Use the bundled expat sources
+AC_LIBOBJ($2/xmltok/xmltok)
+AC_LIBOBJ($2/xmltok/xmlrole)
+AC_LIBOBJ($2/xmlparse/xmlparse)
+AC_LIBOBJ($2/xmlparse/hashtable)
+
+AC_DEFINE(HAVE_EXPAT)
+
+AC_DEFINE(HAVE_XMLPARSE_H, 1, [Define if using expat which includes xmlparse.h])
+
+])
+
+AC_DEFUN([NEON_XML_PARSER], [
+
+dnl Switches to force choice of library
+AC_ARG_WITH([libxml2],
+AS_HELP_STRING([--with-libxml2], [force use of libxml 2.x]))
+AC_ARG_WITH([expat],
+AS_HELP_STRING([--with-expat], [force use of expat]))
+
+dnl Flag to force choice of included expat, if available.
+ifelse($#, 2, [
+AC_ARG_WITH([included-expat],
+AS_HELP_STRING([--with-included-expat], [use bundled expat sources]),,
+with_included_expat=no)],
+with_included_expat=no)
+
+if test "$NEON_NEED_XML_PARSER" = "yes"; then
+ # Find an XML parser
+ neon_xml_parser=none
+
+ # Forced choice of expat:
+ case $with_expat in
+ yes) NE_XML_EXPAT([AC_MSG_ERROR([expat library not found, cannot proceed])]) ;;
+ no) ;;
+ */libexpat.la)
+ # Special case for Subversion
+ ne_expdir=`echo $with_expat | sed 's:/libexpat.la$::'`
+ AC_DEFINE(HAVE_EXPAT)
+ AC_DEFINE_UNQUOTED([NE_FMT_XML_SIZE], ["d"])
+ CPPFLAGS="$CPPFLAGS -I$ne_expdir"
+ if test "x${NEON_TARGET}" = "xlibneon.la"; then
+ NEON_LTLIBS=$with_expat
+ else
+ # no dependency on libexpat => crippled libneon, so do partial install
+ ALLOW_INSTALL=lib
+ fi
+ neon_xml_parser=expat
+ neon_xml_parser_message="expat in $ne_expdir"
+ ;;
+ /*) AC_MSG_ERROR([--with-expat does not take a directory argument]) ;;
+ esac
+
+ # If expat wasn't specifically enabled and libxml was:
+ if test "${neon_xml_parser}-${with_libxml2}-${with_included_expat}" = "none-yes-no"; then
+ NE_XML_LIBXML2(
+ [AC_MSG_ERROR([libxml2.x library not found, cannot proceed])])
+ fi
+
+ # Otherwise, by default search for expat then libxml2:
+ if test "${neon_xml_parser}-${with_included_expat}" = "none-no"; then
+ NE_XML_EXPAT([NE_XML_LIBXML2([:])])
+ fi
+
+ # If an XML parser still has not been found, fail or use the bundled expat
+ if test "$neon_xml_parser" = "none"; then
+ m4_if($1, [],
+ [AC_MSG_ERROR([no XML parser was found: expat or libxml 2.x required])],
+ [# Configure the bundled copy of expat
+ NE_XML_BUNDLED_EXPAT($@)
+ neon_xml_parser_message="bundled expat in $1"])
+ fi
+
+ AC_MSG_NOTICE([XML parser used: $neon_xml_parser_message])
+fi
+
+])
diff --git a/macros/neon.m4 b/macros/neon.m4
new file mode 100644
index 0000000..32111c7
--- /dev/null
+++ b/macros/neon.m4
@@ -0,0 +1,1197 @@
+# Copyright (C) 1998-2010 Joe Orton <joe@manyfish.co.uk> -*- autoconf -*-
+# Copyright (C) 2004 Aleix Conchillo Flaque <aleix@member.fsf.org>
+#
+# This file is free software; you may copy and/or distribute it with
+# or without modifications, as long as this notice is preserved.
+# This software 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.
+
+# The above license applies to THIS FILE ONLY, the neon library code
+# itself may be copied and distributed under the terms of the GNU
+# LGPL, see COPYING.LIB for more details
+
+# This file is part of the neon HTTP/WebDAV client library.
+# See http://www.webdav.org/neon/ for the latest version.
+# Please send any feedback to <neon@lists.manyfish.co.uk>
+
+#
+# Usage:
+#
+# NEON_LIBRARY
+# or NEON_BUNDLED(srcdir, [ACTIONS-IF-BUNDLED], [ACTIONS-IF-NOT_BUNDLED])
+# or NEON_VPATH_BUNDLED(srcdir, builddir,
+# [ACTIONS-IF-BUNDLED], [ACTIONS-IF-NOT-BUNDLED])
+#
+# where srcdir is the location of bundled neon 'src' directory.
+# If using a VPATH-enabled build, builddir is the location of the
+# build directory corresponding to srcdir.
+#
+# If a bundled build *is* being used, ACTIONS-IF-BUNDLED will be
+# evaluated. These actions should ensure that 'make' is run
+# in srcdir, and that one of NEON_NORMAL_BUILD or NEON_LIBTOOL_BUILD
+# is called.
+#
+# After calling one of the above macros, if the NEON_NEED_XML_PARSER
+# variable is set to "yes", then you must configure an XML parser
+# too. You can do this your own way, or do it easily using the
+# NEON_XML_PARSER() macro. Example usage for where we have bundled the
+# neon sources in a directory called libneon, and bundled expat
+# sources in a directory called 'expat'.
+#
+# NEON_BUNDLED(libneon, [
+# NEON_XML_PARSER(expat)
+# NEON_NORMAL_BUILD
+# ])
+#
+# Alternatively, for a simple standalone app with neon as a
+# dependancy, use just:
+#
+# NEON_LIBRARY
+#
+# and rely on the user installing neon correctly.
+#
+# You are free to configure an XML parser any other way you like,
+# but the end result must be, either expat or libxml will get linked
+# in, and HAVE_EXPAT or HAVE_LIBXML is defined appropriately.
+#
+# To set up the bundled build environment, call
+#
+# NEON_NORMAL_BUILD
+# or
+# NEON_LIBTOOL_BUILD
+#
+# depending on whether you are using libtool to build, or not.
+# Both these macros take an optional argument specifying the set
+# of object files you wish to build: if the argument is not given,
+# all of neon will be built.
+
+AC_DEFUN([NEON_BUNDLED],[
+
+neon_bundled_srcdir=$1
+neon_bundled_builddir=$1
+
+NEON_COMMON_BUNDLED([$2], [$3])
+
+])
+
+AC_DEFUN([NEON_VPATH_BUNDLED],[
+
+neon_bundled_srcdir=$1
+neon_bundled_builddir=$2
+NEON_COMMON_BUNDLED([$3], [$4])
+
+])
+
+AC_DEFUN([NEON_COMMON_BUNDLED],[
+
+AC_PREREQ(2.50)
+
+AC_ARG_WITH(included-neon,
+AS_HELP_STRING([--with-included-neon], [force use of included neon library]),
+[neon_force_included="$withval"], [neon_force_included="no"])
+
+NEON_COMMON
+
+# The colons are here so there is something to evaluate
+# in case the argument was not passed.
+if test "$neon_force_included" = "yes"; then
+ :
+ $1
+else
+ :
+ $2
+fi
+
+])
+
+dnl Not got any bundled sources:
+AC_DEFUN([NEON_LIBRARY],[
+
+AC_PREREQ(2.50)
+neon_force_included=no
+neon_bundled_srcdir=
+neon_bundled_builddir=
+
+NEON_COMMON
+
+])
+
+AC_DEFUN([NE_DEFINE_VERSIONS], [
+
+NEON_VERSION="${NE_VERSION_MAJOR}.${NE_VERSION_MINOR}.${NE_VERSION_PATCH}${NE_VERSION_TAG}"
+
+AC_DEFINE_UNQUOTED([NEON_VERSION], ["${NEON_VERSION}"],
+ [Define to be the neon version string])
+AC_DEFINE_UNQUOTED([NE_VERSION_MAJOR], [(${NE_VERSION_MAJOR})],
+ [Define to be neon library major version])
+AC_DEFINE_UNQUOTED([NE_VERSION_MINOR], [(${NE_VERSION_MINOR})],
+ [Define to be neon library minor version])
+AC_DEFINE_UNQUOTED([NE_VERSION_PATCH], [(${NE_VERSION_PATCH})],
+ [Define to be neon library patch version])
+])
+
+AC_DEFUN([NE_VERSIONS_BUNDLED], [
+
+# Define the current versions.
+NE_VERSION_MAJOR=0
+NE_VERSION_MINOR=29
+NE_VERSION_PATCH=6
+NE_VERSION_TAG=
+
+# 0.29.x is backwards-compatible to 0.27.x, so AGE=2
+NE_LIBTOOL_VERSINFO="29:${NE_VERSION_PATCH}:2"
+
+NE_DEFINE_VERSIONS
+
+])
+
+dnl Adds an ABI variation tag which will be added to the SONAME of
+dnl a shared library. e.g. NE_ADD_ABITAG(FOO)
+AC_DEFUN([NE_ADD_ABITAG], [
+if test "x${NE_LIBTOOL_RELEASE}y" = "xy"; then
+ NE_LIBTOOL_RELEASE="$1"
+else
+ NE_LIBTOOL_RELEASE="${NE_LIBTOOL_RELEASE}-$1"
+fi
+])
+
+dnl Define the minimum required versions, usage:
+dnl NE_REQUIRE_VERSIONS([major-version], [minor-versions])
+dnl e.g.
+dnl NE_REQUIRE_VERSIONS([0], [24 25])
+dnl to require neon 0.24.x or neon 0.25.x.
+AC_DEFUN([NE_REQUIRE_VERSIONS], [
+m4_define([ne_require_major], [$1])
+m4_define([ne_require_minor], [$2])
+])
+
+dnl Check that the external library found in a given location
+dnl matches the min. required version (if any). Requires that
+dnl NEON_CONFIG be set the the full path of a valid neon-config
+dnl script
+dnl
+dnl Usage:
+dnl NEON_CHECK_VERSION(ACTIONS-IF-OKAY, ACTIONS-IF-FAILURE)
+dnl
+AC_DEFUN([NEON_CHECK_VERSION], [
+m4_ifdef([ne_require_major], [
+ # Check whether the library is of required version
+ ne_save_LIBS="$LIBS"
+ ne_save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS `$NEON_CONFIG --cflags`"
+ LIBS="$LIBS `$NEON_CONFIG --libs`"
+ ne_libver=`$NEON_CONFIG --version | sed -e "s/neon //g"`
+ # Check whether it's possible to link against neon
+ AC_CACHE_CHECK([linking against neon], [ne_cv_lib_neon],
+ [AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM([[#include <ne_utils.h>]], [[ne_version_match(0, 0);]])],
+ [ne_cv_lib_neon=yes], [ne_cv_lib_neon=no])])
+ if test "$ne_cv_lib_neon" = "yes"; then
+ ne_cv_lib_neonver=no
+ for v in ne_require_minor; do
+ case $ne_libver in
+ ne_require_major.$v.*) ne_cv_lib_neonver=yes ;;
+ esac
+ done
+ fi
+ ne_goodver=$ne_cv_lib_neonver
+ LIBS=$ne_save_LIBS
+ CFLAGS=$ne_save_CFLAGS
+], [
+ # NE_REQUIRE_VERSIONS not used; presume all versions OK!
+ ne_goodver=yes
+ ne_libver="(version unknown)"
+])
+
+if test "$ne_goodver" = "yes"; then
+ AC_MSG_NOTICE([using neon library $ne_libver])
+ $1
+else
+ AC_MSG_NOTICE([incompatible neon library version $ne_libver: wanted ne_require_major.ne_require_minor])
+ $2
+fi])
+
+dnl NEON_CHECK_SUPPORT(feature, var, name)
+AC_DEFUN([NEON_CHECK_SUPPORT], [
+if $NEON_CONFIG --support $1 >/dev/null; then
+ NE_ENABLE_SUPPORT($2, [$3 is supported by neon])
+else
+ NE_DISABLE_SUPPORT($2, [$3 is not supported by neon])
+fi
+])
+
+dnl enable support for feature $1 with define NE_HAVE_$1, message $2
+AC_DEFUN([NE_ENABLE_SUPPORT], [
+NE_FLAG_$1=yes
+AC_SUBST(NE_FLAG_$1)
+AC_DEFINE([NE_HAVE_]$1, 1, [Defined if $1 is supported])
+m4_if([$2], [],
+ [ne_$1_message="support enabled"
+ AC_MSG_NOTICE([$1 support is enabled])],
+ [ne_$1_message="$2"
+ AC_MSG_NOTICE([$2])])
+])
+
+dnl Disable support for feature $1, giving message $2
+AC_DEFUN([NE_DISABLE_SUPPORT], [
+NE_FLAG_$1=no
+AC_SUBST(NE_FLAG_$1)
+m4_if([$2], [],
+ [ne_$1_message="not supported"
+ AC_MSG_NOTICE([$1 support is not enabled])],
+ [ne_$1_message="$2"
+ AC_MSG_NOTICE([$2])])
+])
+
+AC_DEFUN([NEON_USE_EXTERNAL], [
+# Configure to use an external neon, given a neon-config script
+# found at $NEON_CONFIG.
+neon_prefix=`$NEON_CONFIG --prefix`
+NEON_CHECK_VERSION([
+ # Pick up CFLAGS and LIBS needed
+ CFLAGS="$CFLAGS `$NEON_CONFIG --cflags`"
+ NEON_LIBS="$NEON_LIBS `$NEON_CONFIG --libs`"
+ # Pick up library version
+ set dummy `$NEON_CONFIG --version | sed 's/\./ /g'`
+ NE_VERSION_MAJOR=[$]3; NE_VERSION_MINOR=[$]4; NE_VERSION_PATCH=[$]5
+ NE_DEFINE_VERSIONS
+ neon_library_message="library in ${neon_prefix} (${NEON_VERSION})"
+ neon_xml_parser_message="using whatever neon uses"
+ NEON_CHECK_SUPPORT([ssl], [SSL], [SSL])
+ NEON_CHECK_SUPPORT([zlib], [ZLIB], [zlib])
+ NEON_CHECK_SUPPORT([ipv6], [IPV6], [IPv6])
+ NEON_CHECK_SUPPORT([lfs], [LFS], [LFS])
+ NEON_CHECK_SUPPORT([ts_ssl], [TS_SSL], [thread-safe SSL])
+ neon_got_library=yes
+ if test $NE_FLAG_LFS = yes; then
+ NEON_FORMAT(off64_t)
+ AC_DEFINE_UNQUOTED([NE_FMT_NE_OFF_T], [NE_FMT_OFF64_T],
+ [Define to be printf format string for ne_off_t])
+ else
+ AC_DEFINE_UNQUOTED([NE_FMT_NE_OFF_T], [NE_FMT_OFF_T])
+ fi
+], [neon_got_library=no])
+])
+
+AC_DEFUN([NEON_COMMON],[
+
+AC_REQUIRE([NEON_COMMON_CHECKS])
+
+AC_ARG_WITH(neon,
+[ --with-neon[[=DIR]] specify location of neon library],
+[case $withval in
+yes|no) neon_force_external=$withval; neon_ext_path= ;;
+*) neon_force_external=yes; neon_ext_path=$withval ;;
+esac;], [
+neon_force_external=no
+neon_ext_path=
+])
+
+if test "$neon_force_included" = "no"; then
+ # There is no included neon source directory, or --with-included-neon
+ # wasn't given (so we're not forced to use it).
+
+ # Default to no external neon.
+ neon_got_library=no
+ if test "x$neon_ext_path" = "x"; then
+ AC_PATH_PROG([NEON_CONFIG], neon-config, none)
+ if test "x${NEON_CONFIG}" = "xnone"; then
+ AC_MSG_NOTICE([no external neon library found])
+ elif test -x "${NEON_CONFIG}"; then
+ NEON_USE_EXTERNAL
+ else
+ AC_MSG_NOTICE([ignoring non-executable ${NEON_CONFIG}])
+ fi
+ else
+ AC_MSG_CHECKING([for neon library in $neon_ext_path])
+ NEON_CONFIG="$neon_ext_path/bin/neon-config"
+ if test -x ${NEON_CONFIG}; then
+ AC_MSG_RESULT([found])
+ NEON_USE_EXTERNAL
+ else
+ AC_MSG_RESULT([not found])
+ # ...will fail since force_external=yes
+ fi
+ fi
+
+ if test "$neon_got_library" = "no"; then
+ if test $neon_force_external = yes; then
+ AC_MSG_ERROR([could not use external neon library])
+ elif test -n "$neon_bundled_srcdir"; then
+ # Couldn't find external neon, forced to use bundled sources
+ neon_force_included="yes"
+ else
+ # Couldn't find neon, and don't have bundled sources
+ AC_MSG_ERROR(could not find neon)
+ fi
+ fi
+fi
+
+if test "$neon_force_included" = "yes"; then
+ NE_VERSIONS_BUNDLED
+ AC_MSG_NOTICE([using bundled neon ($NEON_VERSION)])
+ NEON_BUILD_BUNDLED="yes"
+ LIBNEON_SOURCE_CHECKS
+ CFLAGS="$CFLAGS -I$neon_bundled_srcdir"
+ NEON_LIBS="-L$neon_bundled_builddir -lneon $NEON_LIBS"
+ NEON_NEED_XML_PARSER=yes
+ neon_library_message="included libneon (${NEON_VERSION})"
+else
+ # Don't need to configure an XML parser
+ NEON_NEED_XML_PARSER=no
+ NEON_BUILD_BUNDLED=no
+fi
+
+AC_SUBST(NEON_BUILD_BUNDLED)
+
+])
+
+dnl AC_SEARCH_LIBS done differently. Usage:
+dnl NE_SEARCH_LIBS(function, libnames, [extralibs], [actions-if-not-found],
+dnl [actions-if-found])
+dnl Tries to find 'function' by linking againt `-lLIB $NEON_LIBS' for each
+dnl LIB in libnames. If link fails and 'extralibs' is given, will also
+dnl try linking against `-lLIB extralibs $NEON_LIBS`.
+dnl Once link succeeds, `-lLIB [extralibs]` is prepended to $NEON_LIBS, and
+dnl `actions-if-found' are executed, if given.
+dnl If link never succeeds, run `actions-if-not-found', if given, else
+dnl give an error and fail configure.
+AC_DEFUN([NE_SEARCH_LIBS], [
+
+AC_REQUIRE([NE_CHECK_OS])
+
+AC_CACHE_CHECK([for library containing $1], [ne_cv_libsfor_$1], [
+AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM([], [[$1();]])],
+ [ne_cv_libsfor_$1="none needed"], [
+ne_sl_save_LIBS=$LIBS
+ne_cv_libsfor_$1="not found"
+for lib in $2; do
+ # The w32api libraries link using the stdcall calling convention.
+ case ${lib}-${ne_cv_os_uname} in
+ ws2_32-MINGW*) ne__code="__stdcall $1();" ;;
+ *) ne__code="$1();" ;;
+ esac
+
+ LIBS="$ne_sl_save_LIBS -l$lib $NEON_LIBS"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([], [$ne__code])],
+ [ne_cv_libsfor_$1="-l$lib"; break])
+ m4_if($3, [], [], dnl If $3 is specified, then...
+ [LIBS="$ne_sl_save_LIBS -l$lib $3 $NEON_LIBS"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([], [$ne__code])],
+ [ne_cv_libsfor_$1="-l$lib $3"; break])])
+done
+LIBS=$ne_sl_save_LIBS])])
+
+if test "$ne_cv_libsfor_$1" = "not found"; then
+ m4_if([$4], [], [AC_MSG_ERROR([could not find library containing $1])], [$4])
+elif test "$ne_cv_libsfor_$1" = "none needed"; then
+ m4_if([$5], [], [:], [$5])
+else
+ NEON_LIBS="$ne_cv_libsfor_$1 $NEON_LIBS"
+ $5
+fi])
+
+dnl Check for presence and suitability of zlib library
+AC_DEFUN([NEON_ZLIB], [
+
+AC_ARG_WITH(zlib, AS_HELP_STRING([--without-zlib], [disable zlib support]),
+ne_use_zlib=$withval, ne_use_zlib=yes)
+
+if test "$ne_use_zlib" = "yes"; then
+ AC_CHECK_HEADER(zlib.h, [
+ AC_CHECK_LIB(z, inflate, [
+ NEON_LIBS="$NEON_LIBS -lz"
+ NE_ENABLE_SUPPORT(ZLIB, [zlib support enabled, using -lz])
+ ], [NE_DISABLE_SUPPORT(ZLIB, [zlib library not found])])
+ ], [NE_DISABLE_SUPPORT(ZLIB, [zlib header not found])])
+else
+ NE_DISABLE_SUPPORT(ZLIB, [zlib not enabled])
+fi
+])
+
+AC_DEFUN([NE_CHECK_OS], [
+# Check for Darwin, which needs extra cpp and linker flags.
+AC_CACHE_CHECK([for uname], ne_cv_os_uname, [
+ ne_cv_os_uname=`uname -s 2>/dev/null`
+])
+
+if test "$ne_cv_os_uname" = "Darwin"; then
+ CPPFLAGS="$CPPFLAGS -no-cpp-precomp"
+ LDFLAGS="$LDFLAGS -flat_namespace"
+ # poll has various issues in various Darwin releases
+ if test x${ac_cv_func_poll+set} != xset; then
+ ac_cv_func_poll=no
+ fi
+fi
+])
+
+AC_DEFUN([NEON_COMMON_CHECKS], [
+
+# These checks are done whether or not the bundled neon build
+# is used.
+
+ifdef([AC_USE_SYSTEM_EXTENSIONS],
+[AC_USE_SYSTEM_EXTENSIONS],
+[AC_ISC_POSIX])
+AC_REQUIRE([AC_PROG_CC])
+AC_REQUIRE([AC_C_INLINE])
+AC_REQUIRE([AC_C_CONST])
+AC_REQUIRE([AC_TYPE_SIZE_T])
+AC_REQUIRE([AC_TYPE_OFF_T])
+
+AC_REQUIRE([NE_CHECK_OS])
+
+AC_REQUIRE([AC_PROG_MAKE_SET])
+
+AC_REQUIRE([AC_HEADER_STDC])
+
+AC_CHECK_HEADERS([errno.h stdarg.h string.h stdlib.h])
+
+NEON_FORMAT(size_t,,u) dnl size_t is unsigned; use %u formats
+NEON_FORMAT(off_t)
+NEON_FORMAT(ssize_t)
+
+])
+
+AC_DEFUN([NEON_FORMAT_PREP], [
+AC_CHECK_SIZEOF(int)
+AC_CHECK_SIZEOF(long)
+AC_CHECK_SIZEOF(long long)
+if test "$GCC" = "yes"; then
+ AC_CACHE_CHECK([for gcc -Wformat -Werror sanity], ne_cv_cc_werror, [
+ # See whether a simple test program will compile without errors.
+ ne_save_CPPFLAGS=$CPPFLAGS
+ CPPFLAGS="$CPPFLAGS -Wformat -Werror"
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
+#include <stdio.h>]], [[int i = 42; printf("%d", i);]])],
+ [ne_cv_cc_werror=yes], [ne_cv_cc_werror=no])
+ CPPFLAGS=$ne_save_CPPFLAGS])
+ ne_fmt_trycompile=$ne_cv_cc_werror
+else
+ ne_fmt_trycompile=no
+fi
+])
+
+dnl Check for LFS support
+AC_DEFUN([NE_LARGEFILE], [
+dnl Need the size of off_t
+AC_REQUIRE([NEON_COMMON_CHECKS])
+
+if test -z "$ac_cv_sizeof_off_t"; then
+ NE_DISABLE_SUPPORT(LFS, [LFS support omitted: off_t size unknown!])
+elif test $ac_cv_sizeof_off_t != 4; then
+ NE_DISABLE_SUPPORT(LFS, [LFS support unnecessary, off_t is not 32-bit])
+ AC_CHECK_FUNCS([strtoll strtoq], [break])
+elif test -z "$ac_cv_sizeof_long_long"; then
+ NE_DISABLE_SUPPORT(LFS, [LFS support omitted: long long size unknown])
+elif test $ac_cv_sizeof_long_long != 8; then
+ NE_DISABLE_SUPPORT(LFS, [LFS support omitted: long long not 64-bit])
+else
+ ne_save_CPPFLAGS=$CPPFLAGS
+ CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE"
+ AC_CHECK_TYPE(off64_t, [
+ NEON_FORMAT(off64_t)
+ ne_lfsok=no
+ AC_CHECK_FUNCS([strtoll strtoq], [ne_lfsok=yes; break])
+ AC_CHECK_FUNCS([lseek64 fstat64], [], [ne_lfsok=no; break])
+ if test x$ne_lfsok = xyes; then
+ NE_ENABLE_SUPPORT(LFS, [LFS (large file) support enabled])
+ NEON_CFLAGS="$NEON_CFLAGS -D_LARGEFILE64_SOURCE -DNE_LFS"
+ ne_save_CPPFLAGS="$CPPFLAGS -DNE_LFS"
+ else
+ NE_DISABLE_SUPPORT(LFS,
+ [LFS support omitted: 64-bit support functions not found])
+ fi], [NE_DISABLE_SUPPORT(LFS, [LFS support omitted: off64_t type not found])])
+ CPPFLAGS=$ne_save_CPPFLAGS
+fi
+if test "$NE_FLAG_LFS" = "yes"; then
+ AC_DEFINE_UNQUOTED([NE_FMT_NE_OFF_T], [NE_FMT_OFF64_T],
+ [Define to be printf format string for ne_off_t])
+else
+ AC_DEFINE_UNQUOTED([NE_FMT_NE_OFF_T], [NE_FMT_OFF_T])
+fi
+])
+
+dnl NEON_FORMAT(TYPE[, HEADERS[, [SPECIFIER]])
+dnl
+dnl This macro finds out which modifier is needed to create a
+dnl printf format string suitable for printing integer type TYPE (which
+dnl may be an int, long, or long long).
+dnl The default specifier is 'd', if SPECIFIER is not given.
+dnl TYPE may be defined in HEADERS; sys/types.h is always used first.
+AC_DEFUN([NEON_FORMAT], [
+
+AC_REQUIRE([NEON_FORMAT_PREP])
+
+AC_CHECK_SIZEOF($1,, [AC_INCLUDES_DEFAULT
+$2])
+
+dnl Work out which specifier character to use
+m4_ifdef([ne_spec], [m4_undefine([ne_spec])])
+m4_if($#, 3, [m4_define(ne_spec,$3)], [m4_define(ne_spec,d)])
+
+m4_ifdef([ne_cvar], [m4_undefine([ne_cvar])])dnl
+m4_define([ne_cvar], m4_translit(ne_cv_fmt_[$1], [ ], [_]))dnl
+
+AC_CACHE_CHECK([how to print $1], [ne_cvar], [
+ne_cvar=none
+if test $ne_fmt_trycompile = yes; then
+ oflags="$CPPFLAGS"
+ # Consider format string mismatches as errors
+ CPPFLAGS="$CPPFLAGS -Wformat -Werror"
+ dnl obscured for m4 quoting: "for str in d ld lld; do"
+ for str in ne_spec l]ne_spec[ ll]ne_spec[; do
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
+$2
+#include <stdio.h>]], [[$1 i = 1; printf("%$str", i);]])],
+ [ne_cvar=$str; break])
+ done
+ CPPFLAGS=$oflags
+else
+ # Best guess. Don't have to be too precise since we probably won't
+ # get a warning message anyway.
+ case $ac_cv_sizeof_]m4_translit($1, [ ], [_])[ in
+ $ac_cv_sizeof_int) ne_cvar="ne_spec" ;;
+ $ac_cv_sizeof_long) ne_cvar="l]ne_spec[" ;;
+ $ac_cv_sizeof_long_long) ne_cvar="ll]ne_spec[" ;;
+ esac
+fi
+])
+
+if test "x$ne_cvar" = "xnone"; then
+ AC_MSG_ERROR([format string for $1 not found])
+fi
+
+AC_DEFINE_UNQUOTED([NE_FMT_]m4_translit($1, [a-z ], [A-Z_]), "$ne_cvar",
+ [Define to be printf format string for $1])
+])
+
+dnl Wrapper for AC_CHECK_FUNCS; uses libraries from $NEON_LIBS.
+AC_DEFUN([NE_CHECK_FUNCS], [
+ne_cf_save_LIBS=$LIBS
+LIBS="$LIBS $NEON_LIBS"
+AC_CHECK_FUNCS($@)
+LIBS=$ne_cf_save_LIBS])
+
+dnl Checks needed when compiling the neon source.
+AC_DEFUN([LIBNEON_SOURCE_CHECKS], [
+
+dnl Run all the normal C language/compiler tests
+AC_REQUIRE([NEON_COMMON_CHECKS])
+
+dnl Needed for building the MD5 code.
+AC_REQUIRE([AC_C_BIGENDIAN])
+dnl Is strerror_r present; if so, which variant
+AC_REQUIRE([AC_FUNC_STRERROR_R])
+
+AC_CHECK_HEADERS([sys/time.h limits.h sys/select.h arpa/inet.h libintl.h \
+ signal.h sys/socket.h netinet/in.h netinet/tcp.h netdb.h sys/poll.h \
+ sys/limits.h fcntl.h iconv.h],,,
+[AC_INCLUDES_DEFAULT
+/* netinet/tcp.h requires netinet/in.h on some platforms. */
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif])
+
+AC_REQUIRE([NE_SNPRINTF])
+
+AC_CACHE_CHECK([for timezone global], ne_cv_cc_timezone, [
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
+#include <time.h>]],
+[[time_t t = 0 - timezone; timezone = 1;]])],
+ne_cv_cc_timezone=yes, ne_cv_cc_timezone=no)])
+
+if test "$ne_cv_cc_timezone" = "yes"; then
+ AC_DEFINE([HAVE_TIMEZONE], 1, [Define if the timezone global is available])
+fi
+
+dnl Check for large file support
+NE_LARGEFILE
+
+AC_REPLACE_FUNCS(strcasecmp)
+
+AC_CHECK_FUNCS(signal setvbuf setsockopt stpcpy poll fcntl getsockopt)
+
+if test "x${ac_cv_func_poll}${ac_cv_header_sys_poll_h}y" = "xyesyesy"; then
+ AC_DEFINE([NE_USE_POLL], 1, [Define if poll() should be used])
+fi
+
+if test "$ac_cv_func_stpcpy" = "yes"; then
+ AC_CHECK_DECLS(stpcpy)
+fi
+
+# Modern AIXes with the "Linux-like" libc have an undeclared stpcpy
+AH_BOTTOM([#if defined(HAVE_STPCPY) && defined(HAVE_DECL_STPCPY) && !HAVE_DECL_STPCPY && !defined(stpcpy)
+char *stpcpy(char *, const char *);
+#endif])
+
+# Unixware 7 can only link gethostbyname with -lnsl -lsocket
+# Pick up -lsocket first, then the gethostbyname check will work.
+# Haiku requires -lnetwork for socket functions.
+NE_SEARCH_LIBS(socket, socket inet ws2_32 network)
+
+# Enable getaddrinfo support if it, gai_strerror and inet_ntop are
+# all available.
+NE_SEARCH_LIBS(getaddrinfo, nsl,,
+ [ne_enable_gai=no],
+ [# HP-UX boxes commonly get into a state where getaddrinfo is present
+ # but borked: http://marc.theaimsgroup.com/?l=apr-dev&m=107730955207120&w=2
+ case x`uname -sr 2>/dev/null`y in
+ xHP-UX*11.[[01]]*y)
+ AC_MSG_NOTICE([getaddrinfo support disabled on HP-UX 11.0x/11.1x]) ;;
+ *)
+ ne_enable_gai=yes
+ NE_CHECK_FUNCS(gai_strerror getnameinfo inet_ntop inet_pton,,
+ [ne_enable_gai=no; break]) ;;
+ esac
+])
+
+if test $ne_enable_gai = yes; then
+ NE_ENABLE_SUPPORT(IPV6, [IPv6 support is enabled])
+ AC_DEFINE(USE_GETADDRINFO, 1, [Define if getaddrinfo() should be used])
+ AC_CACHE_CHECK([for working AI_ADDRCONFIG], [ne_cv_gai_addrconfig], [
+ AC_RUN_IFELSE([AC_LANG_PROGRAM([#include <netdb.h>
+#include <stdlib.h>],
+[struct addrinfo hints = {0}, *result;
+hints.ai_flags = AI_ADDRCONFIG;
+if (getaddrinfo("localhost", NULL, &hints, &result) != 0) return 1;])],
+ ne_cv_gai_addrconfig=yes, ne_cv_gai_addrconfig=no, ne_cv_gai_addrconfig=no)])
+ if test $ne_cv_gai_addrconfig = yes; then
+ AC_DEFINE(USE_GAI_ADDRCONFIG, 1, [Define if getaddrinfo supports AI_ADDRCONFIG])
+ fi
+else
+ # Checks for non-getaddrinfo() based resolver interfaces.
+ # QNX has gethostbyname in -lsocket. BeOS only has it in -lbind.
+ # CygWin/Winsock2 has it in -lws2_32, allegedly.
+ # Haiku requires -lnetwork for socket functions.
+ NE_SEARCH_LIBS(gethostbyname, socket nsl bind ws2_32 network)
+ NE_SEARCH_LIBS(hstrerror, resolv,,[:])
+ NE_CHECK_FUNCS(hstrerror)
+ # Older Unixes don't declare h_errno.
+ AC_CHECK_DECLS(h_errno,,,[#include <netdb.h>])
+ AC_CHECK_TYPE(in_addr_t,,[
+ AC_DEFINE([in_addr_t], [unsigned int],
+ [Define if in_addr_t is not available])], [
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
+])
+fi
+
+AC_CHECK_TYPES(socklen_t,,
+# Linux accept(2) says this should be size_t for SunOS 5... gah.
+[AC_DEFINE([socklen_t], [int],
+ [Define if socklen_t is not available])],[
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+# include <sys/socket.h>
+#endif
+])
+
+AC_CHECK_MEMBERS([struct tm.tm_gmtoff, struct tm.__tm_gmtoff],,,
+ [#include <time.h>])
+
+if test ${ac_cv_member_struct_tm_tm_gmtoff}${ac_cv_member_struct_tm___tm_gmtoff}${ne_cv_cc_timezone} = nonono; then
+ AC_MSG_WARN([no timezone handling in date parsing on this platform])
+fi
+
+ifdef([neon_no_zlib],
+ [NE_DISABLE_SUPPORT(ZLIB, [zlib not supported])],
+ [NEON_ZLIB()])
+
+# Conditionally enable ACL support
+AC_MSG_CHECKING([whether to enable ACL support in neon])
+if test "x$neon_no_acl" = "xyes"; then
+ AC_MSG_RESULT(no)
+else
+ AC_MSG_RESULT(yes)
+ NEON_EXTRAOBJS="$NEON_EXTRAOBJS ne_oldacl ne_acl3744"
+fi
+
+NEON_SSL()
+NEON_GSSAPI()
+NEON_LIBPROXY()
+
+AC_SUBST(NEON_CFLAGS)
+AC_SUBST(NEON_LIBS)
+AC_SUBST(NEON_LTLIBS)
+
+])
+
+dnl Call to put lib/snprintf.o in LIBOBJS and define HAVE_SNPRINTF_H
+dnl if snprintf isn't in libc.
+
+AC_DEFUN([NEON_REPLACE_SNPRINTF], [
+# Check for snprintf
+AC_CHECK_FUNC(snprintf,,[
+ AC_DEFINE(HAVE_SNPRINTF_H, 1, [Define if need to include snprintf.h])
+ AC_LIBOBJ(lib/snprintf)])
+])
+
+dnl turn off webdav, boo hoo.
+AC_DEFUN([NEON_WITHOUT_WEBDAV], [
+neon_no_webdav=yes
+neon_no_acl=yes
+NEON_NEED_XML_PARSER=no
+neon_xml_parser_message="none needed"
+])
+
+dnl Turn off zlib support
+AC_DEFUN([NEON_WITHOUT_ZLIB], [
+define(neon_no_zlib, yes)
+])
+
+AC_DEFUN([NEON_WITHOUT_ACL], [
+# Turn off ACL support
+neon_no_acl=yes
+])
+
+dnl Common macro to NEON_LIBTOOL_BUILD and NEON_NORMAL_BUILD
+dnl Sets NEONOBJS appropriately if it has not already been set.
+dnl
+dnl NOT FOR EXTERNAL USE: use LIBTOOL_BUILD or NORMAL_BUILD.
+dnl
+
+AC_DEFUN([NEON_COMMON_BUILD], [
+
+# Using the default set of object files to build.
+# Add the extension to EXTRAOBJS
+ne="$NEON_EXTRAOBJS"
+NEON_EXTRAOBJS=
+for o in $ne; do
+ NEON_EXTRAOBJS="$NEON_EXTRAOBJS $o.$NEON_OBJEXT"
+done
+
+# Was DAV support explicitly turned off?
+if test "x$neon_no_webdav" = "xyes"; then
+ # No WebDAV support
+ NEONOBJS="$NEONOBJS \$(NEON_BASEOBJS)"
+ NE_DISABLE_SUPPORT(DAV, [WebDAV support is not enabled])
+ NE_ADD_ABITAG(NODAV)
+else
+ # WebDAV support
+ NEONOBJS="$NEONOBJS \$(NEON_DAVOBJS)"
+ NE_ENABLE_SUPPORT(DAV, [WebDAV support is enabled])
+fi
+
+AC_SUBST(NEON_TARGET)
+AC_SUBST(NEON_OBJEXT)
+AC_SUBST(NEONOBJS)
+AC_SUBST(NEON_EXTRAOBJS)
+AC_SUBST(NEON_LINK_FLAGS)
+
+])
+
+# The libtoolized build case:
+AC_DEFUN([NEON_LIBTOOL_BUILD], [
+
+NEON_TARGET=libneon.la
+NEON_OBJEXT=lo
+
+NEON_COMMON_BUILD($#, $*)
+
+])
+
+dnl Find 'ar' and 'ranlib', fail if ar isn't found.
+AC_DEFUN([NE_FIND_AR], [
+
+# Search in /usr/ccs/bin for Solaris
+ne_PATH=$PATH:/usr/ccs/bin
+AC_PATH_TOOL(AR, ar, notfound, $ne_PATH)
+if test "x$AR" = "xnotfound"; then
+ AC_MSG_ERROR([could not find ar tool])
+fi
+AC_PATH_TOOL(RANLIB, ranlib, :, $ne_PATH)
+
+])
+
+# The non-libtool build case:
+AC_DEFUN([NEON_NORMAL_BUILD], [
+
+NEON_TARGET=libneon.a
+NEON_OBJEXT=o
+
+AC_REQUIRE([NE_FIND_AR])
+
+NEON_COMMON_BUILD($#, $*)
+
+])
+
+AC_DEFUN([NE_SNPRINTF], [
+AC_CHECK_FUNCS(snprintf vsnprintf,,[
+ ne_save_LIBS=$LIBS
+ LIBS="$LIBS -lm" # Always need -lm
+ AC_CHECK_LIB(trio, trio_vsnprintf,
+ [AC_CHECK_HEADERS(trio.h,,
+ AC_MSG_ERROR([trio installation problem? libtrio found but not trio.h]))
+ AC_MSG_NOTICE(using trio printf replacement library)
+ NEON_LIBS="$NEON_LIBS -ltrio -lm"
+ AC_DEFINE(HAVE_TRIO, 1, [Use trio printf replacement library])],
+ [AC_MSG_NOTICE([no vsnprintf/snprintf detected in C library])
+ AC_MSG_ERROR([Install the trio library from http://daniel.haxx.se/projects/trio/])])
+ LIBS=$ne_save_LIBS
+ break
+])])
+
+dnl Usage: NE_CHECK_OPENSSLVER(variable, version-string, version-hex)
+dnl Define 'variable' to 'yes' if OpenSSL version is >= version-hex
+AC_DEFUN([NE_CHECK_OPENSSLVER], [
+AC_CACHE_CHECK([OpenSSL version is >= $2], $1, [
+AC_EGREP_CPP(good, [#include <openssl/opensslv.h>
+#if OPENSSL_VERSION_NUMBER >= $3
+good
+#endif], [$1=yes], [$1=no])])])
+
+dnl Less noisy replacement for PKG_CHECK_MODULES
+AC_DEFUN([NE_PKG_CONFIG], [
+
+m4_define([ne_cvar], m4_translit(ne_cv_pkg_[$2], [.-], [__]))dnl
+
+AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
+if test "$PKG_CONFIG" = "no"; then
+ : Not using pkg-config
+ $4
+else
+ AC_CACHE_CHECK([for $2 pkg-config data], ne_cvar,
+ [if $PKG_CONFIG $2; then
+ ne_cvar=yes
+ else
+ ne_cvar=no
+ fi])
+
+ if test "$ne_cvar" = "yes"; then
+ $1_CFLAGS=`$PKG_CONFIG --cflags $2`
+ $1_LIBS=`$PKG_CONFIG --libs $2`
+ : Using provided pkg-config data
+ $3
+ else
+ : No pkg-config for $2 provided
+ $4
+ fi
+fi
+
+m4_undefine([ne_cvar])
+])
+
+dnl Check for an SSL library (GNU TLS or OpenSSL)
+AC_DEFUN([NEON_SSL], [
+
+AC_ARG_WITH(ssl,
+ AS_HELP_STRING([--with-ssl=openssl|gnutls],
+ [enable SSL support (default OpenSSL)]))
+
+AC_ARG_WITH(egd,
+[[ --with-egd[=PATH] enable EGD support [using EGD socket at PATH]]])
+
+AC_ARG_WITH(pakchois,
+ AS_HELP_STRING([--without-pakchois],
+ [disable support for PKCS#11 using pakchois]))
+
+case $with_ssl in
+/*)
+ AC_MSG_NOTICE([to use SSL libraries in non-standard locations, try --with-ssl --with-libs=$with_ssl])
+ AC_MSG_ERROR([--with-ssl does not take a path argument])
+ ;;
+yes|openssl)
+ NE_PKG_CONFIG(NE_SSL, openssl,
+ [AC_MSG_NOTICE(using SSL library configuration from pkg-config)
+ CPPFLAGS="$CPPFLAGS ${NE_SSL_CFLAGS}"
+ NEON_LIBS="$NEON_LIBS ${NE_SSL_LIBS}"],
+ [# Either OpenSSL library may require -ldl if built with dynamic engine support
+ NE_SEARCH_LIBS(RSA_new, crypto, -ldl)
+ NE_SEARCH_LIBS(SSL_library_init, ssl, -ldl)])
+
+ AC_CHECK_HEADERS(openssl/ssl.h openssl/opensslv.h,,
+ [AC_MSG_ERROR([OpenSSL headers not found, cannot enable SSL support])])
+
+ # Enable EGD support if using 0.9.7 or newer
+ NE_CHECK_OPENSSLVER(ne_cv_lib_ssl097, 0.9.7, 0x00907000L)
+ if test "$ne_cv_lib_ssl097" = "yes"; then
+ AC_MSG_NOTICE([OpenSSL >= 0.9.7; EGD support not needed in neon])
+ NE_ENABLE_SUPPORT(SSL, [SSL support enabled, using OpenSSL (0.9.7 or later)])
+ NE_CHECK_FUNCS(CRYPTO_set_idptr_callback SSL_SESSION_cmp)
+ else
+ # Fail if OpenSSL is older than 0.9.6
+ NE_CHECK_OPENSSLVER(ne_cv_lib_ssl096, 0.9.6, 0x00906000L)
+ if test "$ne_cv_lib_ssl096" != "yes"; then
+ AC_MSG_ERROR([OpenSSL 0.9.6 or later is required])
+ fi
+ NE_ENABLE_SUPPORT(SSL, [SSL support enabled, using OpenSSL (0.9.6 or later)])
+
+ case "$with_egd" in
+ yes|no) ne_cv_lib_sslegd=$with_egd ;;
+ /*) ne_cv_lib_sslegd=yes
+ AC_DEFINE_UNQUOTED([EGD_PATH], "$with_egd",
+ [Define to specific EGD socket path]) ;;
+ *) # Guess whether EGD support is needed
+ AC_CACHE_CHECK([whether to enable EGD support], [ne_cv_lib_sslegd],
+ [if test -r /dev/random || test -r /dev/urandom; then
+ ne_cv_lib_sslegd=no
+ else
+ ne_cv_lib_sslegd=yes
+ fi])
+ ;;
+ esac
+ if test "$ne_cv_lib_sslegd" = "yes"; then
+ AC_MSG_NOTICE([EGD support enabled for seeding OpenSSL PRNG])
+ AC_DEFINE([ENABLE_EGD], 1, [Define if EGD should be supported])
+ fi
+ fi
+
+ AC_DEFINE([HAVE_OPENSSL], 1, [Define if OpenSSL support is enabled])
+ NEON_EXTRAOBJS="$NEON_EXTRAOBJS ne_openssl"
+
+ AC_DEFINE([HAVE_NTLM], 1, [Define if NTLM is supported])
+ ;;
+gnutls)
+ NE_PKG_CONFIG(NE_SSL, gnutls,
+ [AC_MSG_NOTICE(using GnuTLS configuration from pkg-config)
+ CPPFLAGS="$CPPFLAGS ${NE_SSL_CFLAGS}"
+ NEON_LIBS="$NEON_LIBS ${NE_SSL_LIBS}"
+
+ ne_gnutls_ver=`$PKG_CONFIG --modversion gnutls`
+ ], [
+ # Fall back on libgnutls-config script
+ AC_PATH_PROG(GNUTLS_CONFIG, libgnutls-config, no)
+
+ if test "$GNUTLS_CONFIG" = "no"; then
+ AC_MSG_ERROR([could not find libgnutls-config in \$PATH])
+ fi
+
+ CPPFLAGS="$CPPFLAGS `$GNUTLS_CONFIG --cflags`"
+ NEON_LIBS="$NEON_LIBS `$GNUTLS_CONFIG --libs`"
+
+ ne_gnutls_ver=`$GNUTLS_CONFIG --version`
+ ])
+
+ AC_CHECK_HEADER([gnutls/gnutls.h],,
+ [AC_MSG_ERROR([could not find gnutls/gnutls.h in include path])])
+
+ NE_ENABLE_SUPPORT(SSL, [SSL support enabled, using GnuTLS $ne_gnutls_ver])
+ NEON_EXTRAOBJS="$NEON_EXTRAOBJS ne_gnutls"
+ AC_DEFINE([HAVE_GNUTLS], 1, [Define if GnuTLS support is enabled])
+
+ # Check for functions in later releases
+ NE_CHECK_FUNCS([gnutls_session_get_data2 gnutls_x509_dn_get_rdn_ava \
+ gnutls_sign_callback_set \
+ gnutls_certificate_get_x509_cas \
+ gnutls_certificate_verify_peers2])
+
+ # fail if gnutls_certificate_verify_peers2 is not found
+ if test x${ac_cv_func_gnutls_certificate_verify_peers2} != xyes; then
+ AC_MSG_ERROR([GnuTLS version predates gnutls_certificate_verify_peers2, newer version required])
+ fi
+
+ # Check for iconv support if using the new RDN access functions:
+ if test ${ac_cv_func_gnutls_x509_dn_get_rdn_ava}X${ac_cv_header_iconv_h} = yesXyes; then
+ AC_CHECK_FUNCS(iconv)
+ fi
+ ;;
+*) # Default to off; only create crypto-enabled binaries if requested.
+ NE_DISABLE_SUPPORT(SSL, [SSL support is not enabled])
+ NE_DISABLE_SUPPORT(TS_SSL, [Thread-safe SSL support is not enabled])
+ NEON_EXTRAOBJS="$NEON_EXTRAOBJS ne_stubssl"
+ ;;
+esac
+AC_SUBST(NEON_SUPPORTS_SSL)
+
+AC_ARG_WITH(ca-bundle,
+ AS_HELP_STRING(--with-ca-bundle, specify filename of an SSL CA root bundle),,
+ with_ca_bundle=no)
+
+case ${NE_FLAG_SSL}-${with_ca_bundle} in
+*-no) ;;
+yes-*)
+ AC_DEFINE_UNQUOTED([NE_SSL_CA_BUNDLE], ["${with_ca_bundle}"],
+ [Define to be filename of an SSL CA root bundle])
+ AC_MSG_NOTICE([Using ${with_ca_bundle} as default SSL CA bundle])
+ ;;
+esac
+
+AC_ARG_ENABLE(threadsafe-ssl,
+AS_HELP_STRING(--enable-threadsafe-ssl=posix,
+[enable SSL library thread-safety using POSIX threads: suitable
+CC/CFLAGS/LIBS must be used to make the POSIX library interfaces
+available]),,
+enable_threadsafe_ssl=no)
+
+case $enable_threadsafe_ssl in
+posix|yes)
+ ne_pthr_ok=yes
+ AC_CHECK_FUNCS([pthread_mutex_init pthread_mutex_lock],,[ne_pthr_ok=no])
+ if test "${ne_pthr_ok}" = "no"; then
+ AC_MSG_ERROR([could not find POSIX mutex interfaces; (try CC="${CC} -pthread"?)])
+ fi
+ NE_ENABLE_SUPPORT(TS_SSL, [Thread-safe SSL supported using POSIX threads])
+ ;;
+*)
+ NE_DISABLE_SUPPORT(TS_SSL, [Thread-safe SSL not supported])
+ ;;
+esac
+
+case ${with_pakchois}X${ac_cv_func_gnutls_sign_callback_set}Y${ne_cv_lib_ssl097} in
+noX*Y*) ;;
+*X*Yyes|*XyesY*)
+ # PKCS#11... ho!
+ NE_PKG_CONFIG(NE_PK11, pakchois,
+ [AC_MSG_NOTICE([[using pakchois for PKCS#11 support]])
+ AC_DEFINE(HAVE_PAKCHOIS, 1, [Define if pakchois library supported])
+ CPPFLAGS="$CPPFLAGS ${NE_PK11_CFLAGS}"
+ NEON_LIBS="${NEON_LIBS} ${NE_PK11_LIBS}"],
+ [AC_MSG_NOTICE([[pakchois library not found; no PKCS#11 support]])])
+ ;;
+esac
+]) dnl -- end defun NEON_SSL
+
+dnl Check for Kerberos installation
+AC_DEFUN([NEON_GSSAPI], [
+AC_ARG_WITH(gssapi, AS_HELP_STRING(--without-gssapi, disable GSSAPI support))
+if test "$with_gssapi" != "no"; then
+ AC_PATH_PROG([KRB5_CONFIG], krb5-config, none, $PATH:/usr/kerberos/bin)
+else
+ KRB5_CONFIG=none
+fi
+if test "x$KRB5_CONFIG" != "xnone"; then
+ ne_save_CPPFLAGS=$CPPFLAGS
+ ne_save_LIBS=$NEON_LIBS
+ NEON_LIBS="$NEON_LIBS `${KRB5_CONFIG} --libs gssapi`"
+ CPPFLAGS="$CPPFLAGS `${KRB5_CONFIG} --cflags gssapi`"
+ # MIT and Heimdal put gssapi.h in different places
+ AC_CHECK_HEADERS(gssapi/gssapi.h gssapi.h, [
+ NE_CHECK_FUNCS(gss_init_sec_context, [
+ ne_save_CPPFLAGS=$CPPFLAGS
+ ne_save_LIBS=$NEON_LIBS
+ AC_MSG_NOTICE([GSSAPI authentication support enabled])
+ AC_DEFINE(HAVE_GSSAPI, 1, [Define if GSSAPI support is enabled])
+ AC_CHECK_HEADERS(gssapi/gssapi_generic.h)
+ # Older versions of MIT Kerberos lack GSS_C_NT_HOSTBASED_SERVICE
+ AC_CHECK_DECL([GSS_C_NT_HOSTBASED_SERVICE],,
+ [AC_DEFINE([GSS_C_NT_HOSTBASED_SERVICE], gss_nt_service_name,
+ [Define if GSS_C_NT_HOSTBASED_SERVICE is not defined otherwise])],
+ [#ifdef HAVE_GSSAPI_GSSAPI_H
+#include <gssapi/gssapi.h>
+#else
+#include <gssapi.h>
+#endif])])
+ break
+ ])
+ CPPFLAGS=$ne_save_CPPFLAGS
+ NEON_LIBS=$ne_save_LIBS
+fi])
+
+AC_DEFUN([NEON_LIBPROXY], [
+AC_ARG_WITH(libproxy, AS_HELP_STRING(--without-libproxy, disable libproxy support))
+if test "x$with_libproxy" != "xno"; then
+ NE_PKG_CONFIG(NE_PXY, libproxy-1.0,
+ [AC_DEFINE(HAVE_LIBPROXY, 1, [Define if libproxy is supported])
+ CPPFLAGS="$CPPFLAGS $NE_PXY_CFLAGS"
+ NEON_LIBS="$NEON_LIBS ${NE_PXY_LIBS}"
+ NE_ENABLE_SUPPORT(LIBPXY, [libproxy support enabled])],
+ [NE_DISABLE_SUPPORT(LIBPXY, [libproxy support not enabled])])
+else
+ NE_DISABLE_SUPPORT(LIBPXY, [libproxy support not enabled])
+fi
+])
+
+dnl Adds an --enable-warnings argument to configure to allow enabling
+dnl compiler warnings
+AC_DEFUN([NEON_WARNINGS],[
+
+AC_REQUIRE([AC_PROG_CC]) dnl so that $GCC is set
+
+AC_ARG_ENABLE(warnings,
+AS_HELP_STRING(--enable-warnings, [enable compiler warnings]))
+
+if test "$enable_warnings" = "yes"; then
+ case $GCC:`uname` in
+ yes:*)
+ CFLAGS="$CFLAGS -Wall -Wmissing-declarations -Wshadow -Wreturn-type -Wsign-compare -Wundef -Wpointer-arith -Wbad-function-cast -Wformat-security"
+ if test -z "$with_ssl" -o "$with_ssl" = "no"; then
+ # OpenSSL headers fail strict prototypes checks
+ CFLAGS="$CFLAGS -Wstrict-prototypes"
+ fi
+ ;;
+ no:OSF1) CFLAGS="$CFLAGS -check -msg_disable returnchecks -msg_disable alignment -msg_disable overflow" ;;
+ no:IRIX) CFLAGS="$CFLAGS -fullwarn" ;;
+ no:UnixWare) CFLAGS="$CFLAGS -v" ;;
+ *) AC_MSG_WARN([warning flags unknown for compiler on this platform]) ;;
+ esac
+fi
+])
+
+dnl Adds an --disable-debug argument to configure to allow disabling
+dnl debugging messages.
+dnl Usage:
+dnl NEON_WARNINGS([actions-if-debug-enabled], [actions-if-debug-disabled])
+dnl
+AC_DEFUN([NEON_DEBUG], [
+
+AC_ARG_ENABLE(debug,
+AS_HELP_STRING(--disable-debug,[disable runtime debugging messages]))
+
+# default is to enable debugging
+case $enable_debug in
+no) AC_MSG_NOTICE([debugging is disabled])
+$2 ;;
+*) AC_MSG_NOTICE([debugging is enabled])
+AC_DEFINE(NE_DEBUGGING, 1, [Define to enable debugging])
+$1
+;;
+esac])
+
+dnl Macro to optionally enable socks support
+AC_DEFUN([NEON_SOCKS], [
+])
+
+AC_DEFUN([NEON_WITH_LIBS], [
+AC_ARG_WITH([libs],
+[[ --with-libs=DIR[:DIR2...] look for support libraries in DIR/{bin,lib,include}]],
+[case $with_libs in
+yes|no) AC_MSG_ERROR([--with-libs must be passed a directory argument]) ;;
+*) ne_save_IFS=$IFS; IFS=:
+ for dir in $with_libs; do
+ ne_add_CPPFLAGS="$ne_add_CPPFLAGS -I${dir}/include"
+ ne_add_LDFLAGS="$ne_add_LDFLAGS -L${dir}/lib"
+ ne_add_PATH="${ne_add_PATH}${dir}/bin:"
+ PKG_CONFIG_PATH=${PKG_CONFIG_PATH}${PKG_CONFIG_PATH+:}${dir}/lib/pkgconfig
+ done
+ IFS=$ne_save_IFS
+ CPPFLAGS="${ne_add_CPPFLAGS} $CPPFLAGS"
+ LDFLAGS="${ne_add_LDFLAGS} $LDFLAGS"
+ PATH=${ne_add_PATH}$PATH
+ export PKG_CONFIG_PATH ;;
+esac])])
+
+AC_DEFUN([NEON_I18N], [
+
+dnl Check for NLS iff libintl.h was detected.
+AC_ARG_ENABLE(nls,
+ AS_HELP_STRING(--disable-nls, [disable internationalization support]),,
+ [enable_nls=${ac_cv_header_libintl_h}])
+
+if test x${enable_nls} = xyes; then
+ # presume that dgettext() is available if bindtextdomain() is...
+ # checking for dgettext() itself is awkward because gcc has a
+ # builtin of that function, which confuses AC_CHECK_FUNCS et al.
+ NE_SEARCH_LIBS(bindtextdomain, intl,,[enable_nls=no])
+ NE_CHECK_FUNCS(bind_textdomain_codeset)
+fi
+
+if test "$enable_nls" = "no"; then
+ NE_DISABLE_SUPPORT(I18N, [Internationalization support not enabled])
+else
+ NE_ENABLE_SUPPORT(I18N, [Internationalization support enabled])
+ eval localedir="${datadir}/locale"
+ AC_DEFINE_UNQUOTED([LOCALEDIR], "$localedir",
+ [Define to be location of localedir])
+fi
+
+])
diff --git a/macros/socklen-arg-type.m4 b/macros/socklen-arg-type.m4
new file mode 100644
index 0000000..2d84ac4
--- /dev/null
+++ b/macros/socklen-arg-type.m4
@@ -0,0 +1,43 @@
+dnl This function is (C) 1997,98,99 Stephan Kulow (coolo@kde.org)
+dnl Modifications (C) Joe Orton 1999,2000
+
+AC_DEFUN([SOCKLEN_ARG_TYPE],[
+
+dnl Check for the type of the third argument of getsockname
+AC_MSG_CHECKING(for the third argument of getsockname)
+AC_CACHE_VAL(ac_cv_ksize_t,
+[AC_TRY_COMPILE([
+#include <sys/types.h>
+#include <sys/socket.h>
+],[
+socklen_t a=0;
+getsockname(0,(struct sockaddr*)0, &a);
+],
+ac_cv_ksize_t=socklen_t,
+ac_cv_ksize_t=)
+if test -z "$ac_cv_ksize_t"; then
+ac_safe_cflags="$CFLAGS"
+if test "$GCC" = "yes"; then
+ CFLAGS="-Werror $CFLAGS"
+fi
+AC_TRY_COMPILE([
+#include <sys/types.h>
+#include <sys/socket.h>
+],[
+int a=0;
+getsockname(0,(struct sockaddr*)0, &a);
+],
+ac_cv_ksize_t=int,
+ac_cv_ksize_t=size_t)
+CFLAGS="$ac_safe_cflags"
+fi
+])
+
+if test -z "$ac_cv_ksize_t"; then
+ ac_cv_ksize_t=int
+fi
+
+AC_MSG_RESULT($ac_cv_ksize_t)
+AC_DEFINE_UNQUOTED(ksize_t, $ac_cv_ksize_t, [Define to be the type of the third argument to getsockname])
+
+]) \ No newline at end of file
diff --git a/src/basic.c b/src/basic.c
new file mode 100644
index 0000000..0b96b08
--- /dev/null
+++ b/src/basic.c
@@ -0,0 +1,394 @@
+/*
+ litmus: WebDAV server test suite
+ Copyright (C) 2001-2007, Joe Orton <joe@manyfish.co.uk>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#include "config.h"
+
+#include <sys/types.h>
+
+#include <string.h>
+#include <unistd.h>
+#include <stdlib.h>
+
+#include <fcntl.h>
+
+#include <ne_request.h>
+#include <ne_string.h>
+
+#include "common.h"
+
+#if 0
+static struct {
+ const char *name;
+ int found;
+} methods[] = {
+#define M(x) { #x, 0 }
+ M(PROPFIND), M(HEAD), M(GET), M(OPTIONS), M(DELETE),
+ M(PROPPATCH), M(COPY), M(MOVE), M(LOCK), M(UNLOCK),
+ { NULL, 0 }
+};
+
+static void allow_hdr(void *userdata, const char *value)
+{
+ char *str = ne_strdup(value), *pnt = str;
+
+ do {
+ char *tok = ne_token(&pnt, ',', NULL);
+ int n;
+
+ for (n = 0; methods[n].name != NULL; n++) {
+ if (strcmp(methods[n].name, tok) == 0) {
+ methods[n].found = 1;
+ break;
+ }
+ }
+
+ } while (pnt != NULL);
+
+ free(str);
+}
+
+static int allowed(const char *method)
+{
+ int n;
+
+ for (n = 0; methods[n].name != NULL; n++) {
+ if (strcmp(methods[n].name, method) == 0) {
+ return methods[n].found;
+ break;
+ }
+ }
+
+ return -1;
+}
+
+/* pull in from ne_basic.c. */
+extern void dav_hdr_handler(void *userdata, const char *value);
+
+static int adv_options(void)
+{
+ ne_request *req = ne_request_create(i_session, "OPTIONS", "/dav/");
+
+ ne_add_response_header_handler(req, "Allow", allow_hdr, NULL);
+ ne_add_response_header_handler(req, "DAV", dav_hdr_handler, &caps);
+
+ ONREQ(ne_request_dispatch(req) || ne_get_status(req)->code != 200);
+
+ ne_request_destroy(req);
+
+ return OK;
+}
+
+#endif
+
+/* BINARYMODE() enables binary file I/O on cygwin. */
+#ifdef __CYGWIN__
+#define BINARYMODE(fd) do { setmode(fd, O_BINARY); } while (0)
+#else
+#define BINARYMODE(fd) if (0)
+#endif
+
+static char *create_temp(const char *contents)
+{
+ char tmp[256] = "/tmp/litmus-XXXXXX";
+ int fd;
+ size_t len = strlen(contents);
+
+ fd = mkstemp(tmp);
+ BINARYMODE(fd);
+ if (write(fd, contents, len) != (ssize_t)len) {
+ close(fd);
+ return NULL;
+ }
+ close(fd);
+
+ return ne_strdup(tmp);
+}
+
+static int compare_contents(const char *fn, const char *contents)
+{
+ int fd = open(fn, O_RDONLY | O_BINARY), ret;
+ char buffer[BUFSIZ];
+ ne_buffer *b = ne_buffer_create();
+ ssize_t bytes;
+
+ while ((bytes = read(fd, buffer, BUFSIZ)) > 0) {
+ ne_buffer_append(b, buffer, bytes);
+ }
+
+ close(fd);
+
+#define SvsS "%" NE_FMT_SIZE_T " vs %" NE_FMT_SIZE_T
+ if (strlen(b->data) != strlen(contents)) {
+ t_warning("length mismatch: " SvsS, strlen(b->data), strlen(contents));
+ }
+ if (strlen(b->data) != ne_buffer_size(b)) {
+ t_warning("buffer problem: " SvsS,
+ strlen(b->data), ne_buffer_size(b));
+ }
+#undef SvsS
+
+ ret = memcmp(b->data, contents, ne_buffer_size(b));
+ ne_buffer_destroy(b);
+
+ return ret;
+}
+
+static const char *test_contents = ""
+"This is\n"
+"a test file.\n"
+"for litmus\n"
+"testing.\n";
+
+static char *pg_uri = NULL;
+
+static int do_put_get(const char *segment)
+{
+ char *fn, tmp[] = "/tmp/litmus2-XXXXXX", *uri;
+ int fd, res;
+
+ fn = create_temp(test_contents);
+ ONN("could not create temporary file", fn == NULL);
+
+ uri = ne_concat(i_path, segment, NULL);
+
+ fd = open(fn, O_RDONLY | O_BINARY);
+ ONV(ne_put(i_session, uri, fd),
+ ("PUT of `%s' failed: %s", uri, ne_get_error(i_session)));
+ close(fd);
+
+ if (STATUS(201)) {
+ t_warning("PUT of new resource gave %d, should be 201",
+ GETSTATUS);
+ }
+
+ fd = mkstemp(tmp);
+ BINARYMODE(fd);
+ ONV(ne_get(i_session, uri, fd),
+ ("GET of `%s' failed: %s", uri, ne_get_error(i_session)));
+ close(fd);
+
+ res = compare_contents(tmp, test_contents);
+ if (res != OK) {
+ char cmd[1024];
+
+ ne_snprintf(cmd, 1024, "diff -u %s %s", fn, tmp);
+ system(cmd);
+ ONN("PUT/GET byte comparison", res);
+ }
+
+ /* Clean up. */
+ unlink(fn);
+ unlink(tmp);
+
+ /* so delete() isn't skipped. */
+ pg_uri = uri;
+
+ return OK;
+}
+
+static int put_get(void)
+{
+ return do_put_get("res");
+}
+
+static int put_get_utf8_segment(void)
+{
+ return do_put_get("res-%e2%82%ac");
+}
+
+static int put_no_parent(void)
+{
+ char *uri = ne_concat(i_path, "409me/noparent.txt", NULL);
+ ONN("MKCOL with missing intermediate succeeds",
+ ne_mkcol(i_session, uri) != NE_ERROR);
+
+ if (STATUS(409)) {
+ t_warning("MKCOL with missing intermediate gave %d, should be 409",
+ GETSTATUS);
+ }
+
+ ne_free(uri);
+
+ return OK;
+}
+
+static int mkcol_over_plain(void)
+{
+ PRECOND(pg_uri);
+
+ ONV(ne_mkcol(i_session, pg_uri) != NE_ERROR,
+ ("MKCOL on plain resource `%s' succeeded!", pg_uri));
+
+ return OK;
+}
+
+static int delete(void)
+{
+ PRECOND(pg_uri); /* skip if put_get failed. */
+
+ ONV(ne_delete(i_session, pg_uri),
+ ("DELETE on normal resource failed: %s", ne_get_error(i_session)));
+
+ return OK;
+}
+
+static int delete_null(void)
+{
+ char *uri;
+
+ uri = ne_concat(i_path, "404me", NULL);
+ ONN("DELETE nonexistent resource succeeded",
+ ne_delete(i_session, uri) != NE_ERROR);
+
+ if (STATUS(404)) {
+ t_warning("DELETE on null resource gave %d, should be 404 (RFC2518:S3)",
+ GETSTATUS);
+ }
+
+ return OK;
+}
+
+static int delete_fragment(void)
+{
+ char *uri = ne_concat(i_path, "frag/", NULL);
+ char *frag = ne_concat(i_path, "frag/#ment", NULL);
+
+ ONN("could not create collection", ne_mkcol(i_session, uri) != NE_OK);
+
+ if (ne_delete(i_session, frag) == NE_OK) {
+ t_warning("DELETE removed collection resource with Request-URI including fragment; unsafe");
+ } else {
+ ONMREQ("DELETE", uri, ne_delete(i_session, uri));
+ }
+
+ return OK;
+}
+
+static char *coll_uri = NULL;
+
+static int mkcol(void)
+{
+ char *uri;
+
+ uri = ne_concat(i_path, "coll/", NULL);
+
+ ONV(ne_mkcol(i_session, uri),
+ ("MKCOL %s: %s", uri, ne_get_error(i_session)));
+
+ coll_uri = uri; /* for subsequent tests. */
+
+ return OK;
+}
+
+static int mkcol_again(void)
+{
+ PRECOND(coll_uri);
+
+ ONN("MKCOL on existing collection should fail (RFC2518:8.3.1)",
+ ne_mkcol(i_session, coll_uri) != NE_ERROR);
+
+ if (STATUS(405)) {
+ t_warning("MKCOL on existing collection gave %d, should be 405 (RFC2518:8.3.2)",
+ GETSTATUS);
+ }
+
+ return OK;
+}
+
+static int delete_coll(void)
+{
+ PRECOND(coll_uri);
+
+ ONV(ne_delete(i_session, coll_uri),
+ ("DELETE on collection `%s': %s", coll_uri,
+ ne_get_error(i_session)));
+
+ return OK;
+}
+
+static int mkcol_no_parent(void)
+{
+ char *uri;
+
+ uri = ne_concat(i_path, "409me/noparent/", NULL);
+
+ ONN("MKCOL with missing intermediate should fail (RFC2518:8.3.1)",
+ ne_mkcol(i_session, uri) != NE_ERROR);
+
+ if (STATUS(409)) {
+ t_warning("MKCOL with missing intermediate gave %d, should be 409 (RFC2518:8.3.1)",
+ GETSTATUS);
+ }
+
+ free(uri);
+
+ return OK;
+}
+
+static int mkcol_with_body(void)
+{
+ char *uri;
+ ne_request *req;
+ static const char body[] = "afafafaf";
+
+ uri = ne_concat(i_path, "mkcolbody", NULL);
+
+ req = ne_request_create(i_session, "MKCOL", uri);
+
+ /* Presume nobody will register this MIME type. */
+ ne_add_request_header(req, "Content-Type", "xzy-foo/bar-512");
+
+ ne_set_request_body_buffer(req, body, strlen(body));
+
+ ONV(ne_request_dispatch(req),
+ ("MKCOL on `%s' with (invalid) body: %s", uri,
+ ne_get_error(i_session)));
+
+ ONN("MKCOL with weird body must fail (RFC2518:8.3.1)",
+ ne_get_status(req)->klass == 2);
+
+ ONN("MKCOL with weird body must fail with 415 (RFC2518:8.3.1)",
+ ne_get_status(req)->code != 415);
+
+ ne_request_destroy(req);
+
+ return OK;
+}
+
+ne_test tests[] = {
+ INIT_TESTS,
+
+ /* Basic tests. */
+ T(options),
+ T(put_get),
+ T(put_get_utf8_segment),
+ T(put_no_parent),
+ T(mkcol_over_plain),
+ T(delete),
+ T(delete_null),
+ T(delete_fragment),
+ T(mkcol),
+ T(mkcol_again),
+ T(delete_coll),
+ T(mkcol_no_parent),
+ T(mkcol_with_body),
+
+ FINISH_TESTS
+};
+
diff --git a/src/common.c b/src/common.c
new file mode 100644
index 0000000..2ab6233
--- /dev/null
+++ b/src/common.c
@@ -0,0 +1,408 @@
+/*
+ litmus: WebDAV server test suite: common routines
+ Copyright (C) 2001-2004, 2011, Joe Orton <joe@manyfish.co.uk>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#include <config.h>
+
+#include <sys/stat.h> /* for struct stat */
+
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#ifdef HAVE_ERRNO_H
+#include <errno.h>
+#endif
+
+#include <fcntl.h>
+#include <stdlib.h>
+
+#include <ne_uri.h>
+#include <ne_auth.h>
+#include <ne_ssl.h>
+#include <ne_session.h>
+
+#include "getopt.h"
+
+#include "common.h"
+
+int i_class2 = 0;
+
+ne_session *i_session, *i_session2;
+
+const char *i_hostname;
+unsigned int i_port;
+ne_sock_addr *i_address;
+char *i_path;
+
+static int use_secure = 0;
+
+const char *i_username = NULL, *i_password;
+
+static char *htdocs_root = NULL;
+
+static char *proxy_hostname = NULL;
+static unsigned int proxy_port;
+
+int i_foo_fd;
+off_t i_foo_len;
+
+static char *client_certificate = NULL;
+
+const static struct option longopts[] = {
+ { "htdocs", required_argument, NULL, 'd' },
+ { "help", no_argument, NULL, 'h' },
+ { "proxy", required_argument, NULL, 'p' },
+ { "client-cert", required_argument, NULL, 'c' },
+#if 0
+ { "colour", no_argument, NULL, 'c' },
+ { "no-colour", no_argument, NULL, 'n' },
+#endif
+ { NULL }
+};
+
+static void usage(FILE *output)
+{
+ fprintf(output,
+ "\rUsage: %s [OPTIONS] URL [username password]\n"
+ " Options are:\n"
+ " -d DIR use given htdocs root directory\n"
+ " -d PROXY use PROXY as proxy URL\n"
+ " -c CERT use a PKCS#12 client certificate\n",
+ test_argv[0]);
+}
+
+static int open_foo(void)
+{
+ char *foofn = ne_concat(htdocs_root, "/foo", NULL);
+ struct stat st;
+
+ i_foo_fd = open(foofn, O_RDONLY | O_BINARY);
+ if (i_foo_fd < 0) {
+ t_context("could not open %s: %s", foofn, strerror(errno));
+ return FAILHARD;
+ }
+
+ ONV(fstat(i_foo_fd, &st) < 0, ("could not stat file: %s", strerror(errno)));
+ i_foo_len = st.st_size;
+
+ return OK;
+}
+
+static int test_connect(void)
+{
+ const ne_inet_addr *ia;
+ ne_socket *sock = ne_sock_create();
+ unsigned int port = proxy_hostname ? proxy_port : i_port;
+ int success = 0;
+
+ if (!sock) {
+ t_context("could not create socket");
+ return FAILHARD;
+ }
+
+ for (ia = ne_addr_first(i_address); ia && !success;
+ ia = ne_addr_next(i_address))
+ success = ne_sock_connect(sock, ia, port) == 0;
+
+ if (!success) {
+ t_context("connection refused by `%s' port %d: %s",
+ i_hostname, port, ne_sock_error(sock));
+ return FAILHARD;
+ }
+
+ ne_sock_close(sock);
+ return OK;
+}
+
+static int test_resolve(const char *hostname, const char *name)
+{
+ i_address = ne_addr_resolve(hostname, 0);
+ if (ne_addr_result(i_address)) {
+ char buf[256];
+ t_context("%s hostname `%s' lookup failed: %s", name, hostname,
+ ne_addr_error(i_address, buf, sizeof buf));
+ return FAILHARD;
+ }
+ return OK;
+}
+
+int init(void)
+{
+ ne_uri u = {0}, proxy = {0};
+ int optc, n;
+ char *proxy_url = NULL;
+
+ while ((optc = getopt_long(test_argc, test_argv,
+ "d:hpc:", longopts, NULL)) != -1) {
+ switch (optc) {
+ case 'd':
+ htdocs_root = optarg;
+ break;
+ case 'p':
+ proxy_url = optarg;
+ break;
+ case 'h':
+ usage(stdout);
+ exit(1);
+ case 'c':
+ client_certificate = optarg;
+ break;
+ default:
+ usage(stderr);
+ exit(1);
+ }
+ }
+
+ n = test_argc - optind;
+
+ if (n == 0 || n > 3 || n == 2) {
+ usage(stderr);
+ exit(1);
+ }
+
+ if (htdocs_root == NULL)
+ htdocs_root = "htdocs";
+
+ if (ne_uri_parse(test_argv[optind], &u)) {
+ t_context("couldn't parse server URL `%s'",
+ test_argv[optind]);
+ return FAILHARD;
+ }
+
+ if (proxy_url) {
+ if (ne_uri_parse(proxy_url, &proxy)) {
+ t_context("couldn't parse proxy URL `%s'", proxy_url);
+ return FAILHARD;
+ }
+ if (proxy.scheme && strcmp(proxy.scheme, "http") != 0) {
+ t_context("cannot use scheme `%s' for proxy", proxy.scheme);
+ return FAILHARD;
+ }
+ if (proxy.port > 0) {
+ proxy_port = proxy.port;
+ } else {
+ proxy_port = 8080;
+ }
+ proxy_hostname = proxy.host;
+ }
+
+ if (u.scheme && strcmp(u.scheme, "https") == 0)
+ use_secure = 1;
+
+ i_hostname = u.host;
+ if (u.port > 0) {
+ i_port = u.port;
+ } else {
+ if (use_secure) {
+ i_port = 443;
+ } else {
+ i_port = 80;
+ }
+ }
+ if (ne_path_has_trailing_slash(u.path)) {
+ i_path = u.path;
+ } else {
+ i_path = ne_concat(u.path, "/", NULL);
+ }
+
+ if (n > 2) {
+ i_username = test_argv[optind+1];
+ i_password = test_argv[optind+2];
+
+ if (strlen(i_username) >= NE_ABUFSIZ) {
+ t_context("username must be <%d chars", NE_ABUFSIZ);
+ return FAILHARD;
+ }
+
+ if (strlen(i_password) >= NE_ABUFSIZ) {
+ t_context("password must be <%d chars", NE_ABUFSIZ);
+ return FAILHARD;
+ }
+ }
+
+ if (proxy_hostname)
+ CALL(test_resolve(proxy_hostname, "proxy server"));
+ else
+ CALL(test_resolve(i_hostname, "server"));
+
+ CALL(open_foo());
+
+ CALL(test_connect());
+
+ return OK;
+}
+
+static int auth(void *ud, const char *realm, int attempt,
+ char *username, char *password)
+{
+ strcpy(username, i_username);
+ strcpy(password, i_password);
+ return attempt;
+}
+
+static void i_pre_send(ne_request *req, void *userdata, ne_buffer *hdr)
+{
+ char buf[BUFSIZ];
+ const char *name = userdata;
+
+ ne_snprintf(buf, BUFSIZ, "%s: %s: %d (%s)\r\n",
+ name, test_suite, test_num, tests[test_num].name);
+
+ ne_buffer_zappend(hdr, buf);
+}
+
+/* Allow all certificates. */
+static int ignore_verify(void *ud, int fs, const ne_ssl_certificate *cert)
+{
+ return 0;
+}
+
+static int init_session(ne_session *sess)
+{
+ if (proxy_hostname) {
+ ne_session_proxy(sess, proxy_hostname, proxy_port);
+ }
+
+ ne_set_useragent(sess, "litmus/" PACKAGE_VERSION);
+
+ if (i_username) {
+ ne_set_server_auth(sess, auth, NULL);
+ }
+
+ if (use_secure) {
+ if (!ne_has_support(NE_FEATURE_SSL)) {
+ t_context("No SSL support, reconfigure using --with-ssl");
+ return FAILHARD;
+ }
+ else {
+ ne_ssl_set_verify(sess, ignore_verify, NULL);
+
+ if (client_certificate) {
+ ne_ssl_client_cert *cc;
+
+ cc = ne_ssl_clicert_read(client_certificate);
+ if (!cc) {
+ t_context("Can not read the client certificate '%s'",
+ client_certificate);
+ return FAILHARD;
+ }
+ if (ne_ssl_clicert_encrypted(cc)) {
+ if(ne_ssl_clicert_decrypt(cc, i_password)) {
+ t_context("Invalid password for the certificate");
+ return FAILHARD;
+ }
+ }
+
+ ne_ssl_set_clicert(sess, cc);
+ ne_ssl_clicert_free(cc);
+ }
+ }
+ }
+
+ return OK;
+}
+
+static int make_space(void)
+{
+ char *space = ne_concat(i_path, "litmus/", NULL);
+
+ ne_delete(i_session, space);
+
+ if (ne_mkcol(i_session, space)) {
+ t_context("Could not create new collection `%s' for tests: %s\n"
+ "Server must allow `MKCOL %s' for tests to proceed",
+ space, ne_get_error(i_session), space);
+ return FAILHARD;
+ }
+
+ free(i_path);
+ i_path = space;
+
+ return OK;
+}
+
+int begin(void)
+{
+ const char *scheme = use_secure?"https":"http";
+ i_session = ne_session_create(scheme, i_hostname, i_port);
+ i_session2 = ne_session_create(scheme, i_hostname, i_port);
+
+ CALL(init_session(i_session));
+ CALL(init_session(i_session2));
+
+ /* Send header with every request associating the request with the
+ * test number and session. */
+ ne_hook_pre_send(i_session, i_pre_send, "X-Litmus");
+ ne_hook_pre_send(i_session2, i_pre_send, "X-Litmus-Second");
+
+ CALL(make_space());
+
+ return OK;
+}
+
+int finish(void)
+{
+ ne_session_destroy(i_session);
+ return OK;
+}
+
+int upload_foo(const char *path)
+{
+ char *uri = ne_concat(i_path, path, NULL);
+ int ret;
+ /* i_foo_fd is rewound automagically by ne_request.c */
+ ret = ne_put(i_session, uri, i_foo_fd);
+ free(uri);
+ if (ret)
+ t_context("PUT of `%s': %s", uri, ne_get_error(i_session));
+ return ret;
+}
+
+int options(void)
+{
+ ne_server_capabilities caps = {0};
+
+ ONV(ne_options(i_session, i_path, &caps),
+ ("OPTIONS on base collection `%s': %s", i_path,
+ ne_get_error(i_session)));
+
+ ONN("server does not claim WebDAV compliance", caps.dav_class1 == 0);
+ if (caps.dav_class2 == 0) {
+ t_warning("server does not claim Class 2 compliance");
+ }
+ i_class2 = caps.dav_class2;
+
+ return OK;
+}
+
+char *get_etag(const char *path)
+{
+ ne_request *req = ne_request_create(i_session, "HEAD", path);
+ char *etag = NULL;
+
+ if (ne_request_dispatch(req) == NE_OK && ne_get_status(req)->code == 200) {
+ const char *value = ne_get_response_header(req, "Etag");
+ if (value) etag = ne_strdup(value);
+ }
+
+ ne_request_destroy(req);
+ return etag;
+}
diff --git a/src/common.h b/src/common.h
new file mode 100644
index 0000000..f0c058d
--- /dev/null
+++ b/src/common.h
@@ -0,0 +1,103 @@
+/*
+ litmus: WebDAV server test suite: common routines
+ Copyright (C) 2001-2002, Joe Orton <joe@manyfish.co.uk>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#ifndef INTEROP_H
+#define INTEROP_H 1
+
+#include <ne_session.h>
+#include <ne_request.h>
+#include <ne_basic.h>
+#include <ne_socket.h> /* for ne_sock_addr */
+
+#include "tests.h"
+
+/* always use O_BINARY for cygwin/windows compatibility. */
+#ifndef O_BINARY
+#define O_BINARY (0)
+#endif
+
+/* prototype a test function. */
+#define TF(x) int x(void)
+
+/* Standard test functions.
+ * init: parses and verifies cmd-line args (URL, username/password)
+ * test_connect: checks that server is running.
+ * open_foo: opens the dummy 'foo' file.
+ * begin: opens session 'i_session' to server.
+ * options: does an OPTIONS request on i_path, sets i_class2.
+ * finish: closes i_session. */
+
+TF(init); TF(begin);
+TF(options); TF(finish);
+
+/* Standard initialisers for tests[] array: start everything up: */
+#define INIT_TESTS T(init), T(begin)
+
+/* And finish everything off */
+#define FINISH_TESTS T(finish), T(NULL)
+
+/* The sesssion to use. */
+extern ne_session *i_session, *i_session2;
+
+/* server details. */
+extern const char *i_hostname;
+extern unsigned int i_port;
+extern ne_sock_addr *i_address;
+extern char *i_path;
+
+extern int i_class2; /* true if server is a class 2 DAV server. */
+
+/* If open_foo() has been called, this is the fd to the 'foo' file. */
+extern int i_foo_fd;
+
+/* size of file in foo */
+extern off_t i_foo_len;
+
+/* Upload htdocs/foo to i_path + path */
+int upload_foo(const char *path);
+
+/* Returns etag of resource at path within i_session */
+char *get_etag(const char *path);
+
+/* for method 'method' on 'uri', do operation 'x'. */
+#define ONMREQ(method, uri, x) do { int _ret = (x); if (_ret) { t_context("%s on `%s': %s", method, uri, ne_get_error(i_session)); return FAIL; } } while (0)
+
+/* for method 'method' which 'uri1' to 'uri2', do operation 'x'. */
+#define ONM2REQ(method, uri1, uri2, x) do { int _ret = (x); if (_ret) { t_context("%s `%s' to `%s': %s", method, uri1, uri2, ne_get_error(i_session)); return FAIL; } } while (0)
+
+/* ONNREQ(msg, x): fails if (x) is non-zero, giving 'msg' followed by
+ * neon session error. */
+#define ONNREQ(msg, x) do { int _ret = (x); if (_ret) { t_context("%s:\n%s", msg, ne_get_error(i_session)); return FAIL; } } while (0)
+
+/* similarly for second session. */
+#define ONNREQ2(msg, x) do { int _ret = (x); if (_ret) { t_context("%s:\n%s", msg, ne_get_error(i_session2)); return FAIL; } } while (0)
+
+#define GETSTATUS (atoi(ne_get_error(i_session)))
+
+/* STATUS(404) returns non-zero if status code is not 404 */
+#define STATUS(code) (GETSTATUS != (code))
+
+#define GETSTATUS2 (atoi(ne_get_error((i_session2))))
+#define STATUS2(code) (GETSTATUS2 != (code))
+
+#if NE_VERSION_MAJOR > 0 || NE_VERSION_MINOR > 25
+#define HAVE_NEON_026PLUS /* at least neon 0.26.x. */
+#endif
+
+#endif /* INTEROP_H */
diff --git a/src/copymove.c b/src/copymove.c
new file mode 100644
index 0000000..6b62a9e
--- /dev/null
+++ b/src/copymove.c
@@ -0,0 +1,375 @@
+/*
+ litmus: WebDAV server test suite
+ Copyright (C) 2001-2002, 2007, Joe Orton <joe@manyfish.co.uk>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#include "config.h"
+
+#include <sys/types.h>
+
+#include <string.h>
+#include <unistd.h>
+#include <stdlib.h>
+
+#include <fcntl.h>
+
+#include <ne_request.h>
+#include <ne_string.h>
+
+#include "common.h"
+
+static char *src, *dest, *coll, *ncoll;
+
+static int copy_ok = 0;
+
+static int copy_init(void)
+{
+ src = ne_concat(i_path, "copysrc", NULL);
+ dest = ne_concat(i_path, "copydest", NULL);
+ coll = ne_concat(i_path, "copycoll/", NULL);
+ ncoll = ne_concat(i_path, "copycoll", NULL);
+
+ CALL(upload_foo("copysrc"));
+ ONNREQ("could not create collection", ne_mkcol(i_session, coll));
+
+ copy_ok = 1;
+ return OK;
+}
+
+static int copy_simple(void)
+{
+ PRECOND(copy_ok);
+
+ /* Now copy it once */
+ ONNREQ("simple resource COPY",
+ ne_copy(i_session, 0, NE_DEPTH_INFINITE, src, dest));
+
+ if (STATUS(201)) {
+ t_warning("COPY to new resource should give 201 (RFC2518:S8.8.5)");
+ }
+
+ return OK;
+}
+
+static int copy_overwrite(void)
+{
+ PRECOND(copy_ok);
+
+ /* Do it again with Overwrite: F to check that fails. */
+ ONN("COPY on existing resource with Overwrite: F should fail (RFC2518:S8.8.4)",
+ ne_copy(i_session, 0, NE_DEPTH_INFINITE, src, dest) != NE_ERROR);
+
+ ONNREQ("COPY-on-existing with 'Overwrite: F' MUST fail with 412 "
+ "(RFC4918:10.6)", STATUS(412));
+
+ ONV(ne_copy(i_session, 1, NE_DEPTH_INFINITE, src, dest),
+ ("COPY-on-existing with 'Overwrite: T' should succeed (RFC2518:S8.8.4): %s", ne_get_error(i_session)));
+
+ /* tricky one this, I didn't think it should work, but the spec
+ * makes it look like it should. */
+ ONV(ne_copy(i_session, 1, NE_DEPTH_INFINITE, src, coll),
+ ("COPY overwrites collection: %s", ne_get_error(i_session)));
+
+ if (STATUS(204)) {
+ t_warning("COPY to existing resource should give 204 (RFC2518:S8.8.5),"
+ " got %s", ne_get_error(i_session));
+ }
+
+ return OK;
+}
+
+static int copy_nodestcoll(void)
+{
+ char *nodest = ne_concat(i_path, "nonesuch/foo", NULL);
+ int ret;
+
+ PRECOND(copy_ok);
+
+ ret = ne_copy(i_session, 0, NE_DEPTH_ZERO, src, nodest);
+
+ ONV(ret == NE_OK,
+ ("COPY into non-existant collection '%snonesuch' succeeded", i_path));
+
+ if (STATUS(409)) {
+ t_warning("COPY to non-existant collection '%snonesuch' gave '%s' not 409"
+ " (RFC2518:S8.8.5)",
+ i_path, ne_get_error(i_session));
+ }
+
+ ne_free(nodest);
+ return OK;
+}
+
+static int copy_cleanup(void)
+{
+ ne_delete(i_session, src);
+ ne_delete(i_session, dest);
+ ne_delete(i_session, ncoll);
+ ne_delete(i_session, coll);
+ return OK;
+}
+
+static int copy_coll(void)
+{
+ int n;
+ char *csrc, *cdest, *rsrc, *rdest, *subsrc, *subdest, *cdest2;
+ char res[512];
+
+ csrc = ne_concat(i_path, "ccsrc/", NULL);
+ cdest = ne_concat(i_path, "ccdest/", NULL);
+ cdest2 = ne_concat(i_path, "ccdest2/", NULL);
+ rsrc = ne_concat(i_path, "ccsrc/foo", NULL);
+ rdest = ne_concat(i_path, "ccdest/foo", NULL);
+ subsrc = ne_concat(i_path, "ccsrc/subcoll/", NULL);
+ subdest = ne_concat(i_path, "ccdest/subcoll/", NULL);
+
+ /* Set up the ccsrc collection. */
+ ONMREQ("MKCOL", csrc, ne_mkcol(i_session, csrc));
+ for (n = 0; n < 10; n++) {
+ sprintf(res, "ccsrc/foo.%d", n);
+ CALL(upload_foo(res));
+ }
+ ONMREQ("MKCOL", subsrc, ne_mkcol(i_session, subsrc));
+
+ /* Clean up to make some fresh copies. */
+ ne_delete(i_session, cdest);
+ ne_delete(i_session, cdest2);
+
+ /* Now copy the collection a couple of times */
+ ONV(ne_copy(i_session, 0, NE_DEPTH_INFINITE, csrc, cdest),
+ ("collection COPY `%s' to `%s': %s", csrc, cdest,
+ ne_get_error(i_session)));
+ ONV(ne_copy(i_session, 0, NE_DEPTH_INFINITE, csrc, cdest2),
+ ("collection COPY `%s' to `%s': %s", csrc, cdest,
+ ne_get_error(i_session)));
+
+ ONN("COPY-on-existing-coll should fail",
+ ne_copy(i_session, 0, NE_DEPTH_INFINITE, cdest, cdest2) != NE_ERROR);
+
+ ONV(ne_copy(i_session, 1, NE_DEPTH_INFINITE, cdest2, cdest),
+ ("COPY-on-existing-coll with overwrite: %s", ne_get_error(i_session)));
+
+ /* Remove the source, to be paranoid. */
+ if (ne_delete(i_session, csrc)) {
+ t_warning("Could not delete csrc");
+ }
+
+ /* Now delete things out of the destination collection to check if
+ * they are there. */
+ for (n = 0; n < 10; n++) {
+ sprintf(res, "%s%s.%d", i_path, "ccdest/foo", n);
+ ONV(ne_delete(i_session, res),
+ ("COPY destination coll missing %s? %s", res,
+ ne_get_error(i_session)));
+ }
+
+ ONV(ne_delete(i_session, subdest),
+ ("COPY destination missing sub-coll %s? %s", subdest,
+ ne_get_error(i_session)));
+
+ /* Now nuke the whole of the second copy. */
+ ONV(ne_delete(i_session, cdest2),
+ ("COPY destination %s missing? %s", cdest2, ne_get_error(i_session)));
+
+ if (ne_delete(i_session, cdest)) {
+ t_warning("Could not clean up cdest");
+ }
+
+ return OK;
+}
+
+static int copy_shallow(void)
+{
+ char *csrc, *cdest, *res;
+
+ csrc = ne_concat(i_path, "ccsrc/", NULL);
+ cdest = ne_concat(i_path, "ccdest/", NULL);
+
+ /* Set up the ccsrc collection with one member */
+ ONMREQ("MKCOL", csrc, ne_mkcol(i_session, csrc));
+ CALL(upload_foo("ccsrc/foo"));
+
+ /* Clean up to make some fresh copies. */
+ ne_delete(i_session, cdest);
+
+ /* Now copy with Depth 0 */
+ ONV(ne_copy(i_session, 0, NE_DEPTH_ZERO, csrc, cdest),
+ ("collection COPY `%s' to `%s': %s", csrc, cdest,
+ ne_get_error(i_session)));
+
+ /* Remove the source, to be paranoid. */
+ if (ne_delete(i_session, csrc)) {
+ t_warning("Could not delete csrc");
+ }
+
+ /* Now make sure the child resource hasn't been copied along with
+ * the collection. */
+ res = ne_concat(i_path, "foo", NULL);
+ ne_delete(i_session, res);
+ ONV(STATUS(404),
+ ("DELETE on `%s' should fail with 404: got %d", res, GETSTATUS));
+ ne_free(res);
+
+ if (ne_delete(i_session, cdest)) {
+ t_warning("Could not clean up cdest");
+ }
+
+ return OK;
+}
+
+static int move(void)
+{
+ char *src2;
+
+ src = ne_concat(i_path, "move", NULL);
+ src2 = ne_concat(i_path, "move2", NULL);
+ dest = ne_concat(i_path, "movedest", NULL);
+ coll = ne_concat(i_path, "movecoll/", NULL);
+ ncoll = ne_concat(i_path, "movecoll", NULL);
+
+ /* Upload it twice. */
+ CALL(upload_foo("move"));
+ CALL(upload_foo("move2"));
+ ONMREQ("MKCOL", coll, ne_mkcol(i_session, coll));
+
+ /* Now move it */
+ ONM2REQ("MOVE", src, dest, ne_move(i_session, 0, src, dest));
+
+ if (STATUS(201)) {
+ t_warning("MOVE to new resource didn't give 201");
+ }
+
+ /* Try a move with Overwrite: F to check that fails. */
+ ONM2REQ("MOVE on existing resource with Overwrite: F succeeded",
+ src2, dest,
+ ne_move(i_session, 0, src2, dest) != NE_ERROR);
+
+ ONNREQ("MOVE onto existing resource with 'Overwrite: F' MUST fail "
+ "with 412 (RFC4918:10.6)", STATUS(412));
+
+ ONM2REQ("MOVE onto existing resource with Overwrite: T",
+ src2, dest,
+ ne_move(i_session, 1, src2, dest));
+
+ ONM2REQ("MOVE overwrites collection", coll, dest,
+ ne_move(i_session, 1, dest, coll));
+
+ if (STATUS(204)) {
+ t_warning("MOVE to existing collection resource didn't give 204");
+ }
+
+ if (ne_delete(i_session, ncoll)) {
+ t_warning("Could not clean up `%s'", ncoll);
+ }
+
+ return OK;
+}
+
+static char *mdest, *msrc, *mdest2, *mnoncoll;
+
+#define SERR (ne_get_error(i_session))
+
+static int move_coll(void)
+{
+ int n;
+ char *rsrc, *rdest, *subsrc, *subdest;
+ char res[512];
+
+ msrc = ne_concat(i_path, "mvsrc/", NULL);
+ mdest = ne_concat(i_path, "mvdest/", NULL);
+ mdest2 = ne_concat(i_path, "mvdest2/", NULL);
+ rsrc = ne_concat(i_path, "mvsrc/foo", NULL);
+ rdest = ne_concat(i_path, "mvdest/foo", NULL);
+ subsrc = ne_concat(i_path, "mvsrc/subcoll/", NULL);
+ subdest = ne_concat(i_path, "mvdest/subcoll/", NULL);
+ mnoncoll = ne_concat(i_path, "mvnoncoll", NULL);
+
+ /* Set up the mvsrc collection. */
+ ONMREQ("MKCOL", msrc, ne_mkcol(i_session, msrc));
+ for (n = 0; n < 10; n++) {
+ sprintf(res, "mvsrc/foo.%d", n);
+ CALL(upload_foo(res));
+ }
+ CALL(upload_foo("mvnoncoll"));
+
+ ONV(ne_mkcol(i_session, subsrc),
+ ("MKCOL of `%s' failed: %s\n", subsrc, SERR));
+
+ /* Now make a copy of the collection */
+ ONV(ne_copy(i_session, 0, NE_DEPTH_INFINITE, msrc, mdest2),
+ ("collection COPY `%s' to `%s', depth infinity: %s",
+ msrc, mdest2, SERR));
+
+ ONV(ne_move(i_session, 0, msrc, mdest),
+ ("collection MOVE `%s' to `%s': %s", msrc, mdest, SERR));
+
+ ONN("MOVE-on-existing-coll should fail",
+ ne_move(i_session, 0, mdest, mdest2) != NE_ERROR);
+
+ ONN("MOVE-on-existing-coll with overwrite",
+ ne_move(i_session, 1, mdest2, mdest));
+
+ /* Take another copy. */
+ ONV(ne_copy(i_session, 0, NE_DEPTH_INFINITE, mdest, mdest2),
+ ("collection COPY `%s' to `%s', depth infinity: %s",
+ mdest, mdest2, ne_get_error(i_session)));
+
+ /* Now delete things out of the destination collection to check if
+ * they are there. */
+ for (n = 0; n < 10; n++) {
+ sprintf(res, "%s%s.%d", i_path, "mvdest/foo", n);
+ ONV(ne_delete(i_session, res),
+ ("DELETE from copied collection failed for `%s': %s",
+ res, SERR));
+ }
+
+ ONV(ne_delete(i_session, subdest),
+ ("DELETE from copied collection failed for `%s': %s",
+ subdest, SERR));
+
+ /* And move the spare collection over a non-coll. */
+ ONV(ne_move(i_session, 1, mdest2, mnoncoll),
+ ("MOVE collection `%s' over non-collection `%s' with overwrite: %s",
+ mdest2, mnoncoll, ne_get_error(i_session)));
+
+ return OK;
+}
+
+static int move_cleanup(void)
+{
+ ne_delete(i_session, mdest);
+ ne_delete(i_session, mdest2);
+ ne_delete(i_session, mnoncoll);
+ return OK;
+}
+
+ne_test tests[] = {
+ INIT_TESTS,
+
+ /*** Copy/move tests. ***/
+ T(copy_init), T(copy_simple), T(copy_overwrite),
+ T(copy_nodestcoll),
+ T(copy_cleanup),
+
+ T(copy_coll), T(copy_shallow),
+
+ T(move), T(move_coll), T(move_cleanup),
+
+ FINISH_TESTS
+};
+
+
diff --git a/src/http.c b/src/http.c
new file mode 100644
index 0000000..3b0f7f9
--- /dev/null
+++ b/src/http.c
@@ -0,0 +1,105 @@
+/*
+ litmus: WebDAV server test suite
+ Copyright (C) 2001-2005, Joe Orton <joe@manyfish.co.uk>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#include <config.h>
+
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+#include "common.h"
+
+#define EOL "\r\n"
+
+#define ONS(str, x) do { \
+ if ((x) < 0) { \
+ t_context("%s: %s", (str), ne_sock_error(sock)); \
+ return FAIL; \
+ } \
+} while (0)
+
+static int expect100(void)
+{
+ ne_socket *sock = ne_sock_create();
+ char req[BUFSIZ], buf[BUFSIZ];
+ ne_status status = {0};
+ const ne_inet_addr *ia;
+ int success = 0;
+
+ if (strcmp(ne_get_scheme(i_session), "https") == 0) {
+ t_context("skipping for SSL server");
+ return SKIP;
+ }
+
+ for (ia = ne_addr_first(i_address); ia && !success;
+ ia = ne_addr_next(i_address))
+ success = ne_sock_connect(sock, ia, i_port) == 0;
+
+ ONN("could not connect to server", !success);
+
+ ne_snprintf(req, sizeof req,
+ "PUT %sexpect100 HTTP/1.1" EOL
+ "Host: %s" EOL
+ "X-Litmus: http" EOL
+ "User-Agent: litmus/" PACKAGE_VERSION EOL
+ "Content-Length: 100" EOL
+ "Expect: 100-continue" EOL EOL,
+ i_path, ne_get_server_hostport(i_session));
+
+ NE_DEBUG(NE_DBG_SOCKET, "Request:\n%s", req);
+
+ ONS("sending request", ne_sock_fullwrite(sock, req, strlen(req)));
+
+ switch (ne_sock_block(sock, 30)) {
+ case NE_SOCK_TIMEOUT:
+ ONN("timeout waiting for interim response", FAIL);
+ break;
+ case 0:
+ /* no error. */
+ break;
+ default:
+ ONN("error reading from socket", FAIL);
+ break;
+ }
+
+ ONS("reading status line", ne_sock_readline(sock, buf, BUFSIZ));
+
+ NE_DEBUG(NE_DBG_HTTP, "[status] %s", buf);
+
+ ONN("parse status line", ne_parse_statusline(buf, &status));
+
+ if (status.code == 100) {
+ char rbuf[100] = {0};
+
+ ONN("write request body", ne_sock_fullwrite(sock, rbuf, 100));
+ }
+
+ ne_sock_close(sock);
+
+ return OK;
+}
+
+ne_test tests[] = {
+ INIT_TESTS,
+
+ T(expect100),
+
+ FINISH_TESTS
+};
+
diff --git a/src/largefile.c b/src/largefile.c
new file mode 100644
index 0000000..c03807e
--- /dev/null
+++ b/src/largefile.c
@@ -0,0 +1,152 @@
+/*
+ Litmus tests for large file support
+ Copyright (C) 2004, 2005, Joe Orton <joe@manyfish.co.uk>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+#include "config.h"
+
+#include <sys/types.h>
+
+#include <unistd.h>
+#include <fcntl.h>
+#include <assert.h>
+#include <string.h>
+
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
+#include "ne_request.h"
+
+#include "tests.h"
+#include "common.h"
+
+#ifndef INT64_C
+#define INT64_C(x) x ## LL
+#endif
+
+#define BLOCKSIZE (INT64_C(8192))
+#define NUMBLOCKS (262152)
+#define TOTALSIZE (BLOCKSIZE * NUMBLOCKS)
+
+static char block[BLOCKSIZE], *path;
+
+static int init_largefile(void)
+{
+ int n;
+
+#ifndef NE_LFS
+ if (sizeof(off_t) == 4) {
+ t_context("32-bit off_t and no LFS support detected "
+ "=> cannot run tests!");
+ return SKIPREST;
+ }
+#endif
+
+ for (n = 0; n < BLOCKSIZE; n++)
+ block[n] = n % 256;
+
+ /* upload a random file to prep auth if necessary. */
+ CALL(upload_foo("random.txt"));
+
+ path = ne_concat(i_path, "large.txt", NULL);
+
+ /* don't log a message for each body block! */
+ ne_debug_init(ne_debug_stream, ne_debug_mask & ~(NE_DBG_HTTPBODY|NE_DBG_HTTP));
+
+ return OK;
+}
+
+static ssize_t provider(void *userdata, char *buffer, size_t buflen)
+{
+ int *count = userdata;
+
+ if (buflen == 0) {
+ *count = 0;
+ return 0;
+ }
+
+ assert(buflen == BLOCKSIZE);
+
+ if ((*count)++ < NUMBLOCKS) {
+ memcpy(buffer, block, BLOCKSIZE);
+ return buflen;
+ }
+ else
+ return 0;
+}
+
+static int large_put(void)
+{
+ ne_request *req = ne_request_create(i_session, "PUT", path);
+ int count, ret;
+
+#ifdef NE_LFS
+ ne_set_request_body_provider64(req, TOTALSIZE, provider, &count);
+#else
+ ne_set_request_body_provider(req, TOTALSIZE, provider, &count);
+#endif
+
+ ret = ne_request_dispatch(req);
+
+ ONNREQ("large PUT request", ret || ne_get_status(req)->klass != 2);
+
+ ne_request_destroy(req);
+
+ return OK;
+}
+
+static int large_get(void)
+{
+ ne_request *req = ne_request_create(i_session, "GET", path);
+ char buffer[BLOCKSIZE], origin[BLOCKSIZE * 2];
+ long long progress = 0;
+ ssize_t offset = 0;
+ ssize_t bytes;
+
+ memcpy(origin, block, BLOCKSIZE);
+ memcpy(origin + BLOCKSIZE, block, BLOCKSIZE);
+
+ ONNREQ("begin large GET request", ne_begin_request(req));
+
+ ONNREQ("failed GET request", ne_get_status(req)->klass != 2);
+
+ while ((bytes = ne_read_response_block(req, buffer, BLOCKSIZE)) > 0) {
+ ONV(memcmp(origin + offset, buffer, bytes),
+ ("byte mismatch at %" NE_FMT_LONG_LONG, progress));
+ offset = (offset + bytes) % BLOCKSIZE;
+ progress += bytes;
+ }
+
+ ONNREQ("failed reading GET response", bytes < 0);
+
+ ONNREQ("end large GET request", ne_end_request(req));
+
+ ne_request_destroy(req);
+ return OK;
+}
+
+ne_test tests[] = {
+ INIT_TESTS,
+ T(init_largefile),
+
+ T(large_put),
+ T(large_get),
+
+ FINISH_TESTS
+};
diff --git a/src/locks.c b/src/locks.c
new file mode 100644
index 0000000..0aea24f
--- /dev/null
+++ b/src/locks.c
@@ -0,0 +1,651 @@
+/*
+ litmus: WebDAV server test suite
+ Copyright (C) 2001-2006, 2008, 2010, Joe Orton <joe@manyfish.co.uk>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+/* Several tests here are based on or copied from code contributed by
+ * Chris Sharp <csharp@apple.com> */
+
+#include "config.h"
+
+#include <stdlib.h>
+
+#include <ne_props.h>
+#include <ne_uri.h>
+#include <ne_locks.h>
+
+#include "common.h"
+
+static char *res, *res2, *coll;
+static ne_lock_store *store;
+
+static struct ne_lock reslock, *gotlock = NULL;
+
+static int precond(void)
+{
+ if (!i_class2) {
+ t_context("locking tests skipped,\n"
+ "server does not claim Class 2 compliance");
+ return SKIPREST;
+ }
+
+ return OK;
+}
+
+static int init_locks(void)
+{
+ store = ne_lockstore_create();
+ ne_lockstore_register(store, i_session);
+ return OK;
+}
+
+static int put(void)
+{
+ res = ne_concat(i_path, "lockme", NULL);
+ res2 = ne_concat(i_path, "notlocked", NULL);
+
+ CALL(upload_foo("lockme"));
+ CALL(upload_foo("notlocked"));
+
+ return OK;
+}
+
+/* Get a lock, store pointer in global 'getlock'. */
+static int getlock(enum ne_lock_scope scope, int depth)
+{
+ memset(&reslock, 0, sizeof(reslock));
+
+ ne_fill_server_uri(i_session, &reslock.uri);
+ reslock.uri.path = res;
+ reslock.depth = depth;
+ reslock.scope = scope;
+ reslock.type = ne_locktype_write;
+ reslock.timeout = 3600;
+ reslock.owner = ne_strdup("litmus test suite");
+
+ /* leave gotlock as NULL if the LOCK fails. */
+ gotlock = NULL;
+
+ ONMREQ("LOCK", res, ne_lock(i_session, &reslock));
+
+ if (scope != reslock.scope) {
+ t_context("requested lockscope not satisfied! got %s, wanted %s",
+ scope == ne_lockscope_exclusive ? "exclusive" : "shared",
+ reslock.scope == ne_lockscope_exclusive ?
+ "exclusive" : "shared");
+ ne_unlock(i_session, &reslock);
+ return FAIL;
+ }
+
+ /* Take a copy of the lock. */
+ gotlock = ne_lock_copy(&reslock);
+ ne_lockstore_add(store, gotlock);
+
+ return OK;
+}
+
+static int lock_excl(void)
+{
+ return getlock(ne_lockscope_exclusive, NE_DEPTH_ZERO);
+}
+
+static int lock_shared(void)
+{
+ return getlock(ne_lockscope_shared, NE_DEPTH_ZERO);
+}
+
+static int notowner_modify(void)
+{
+ char *tmp;
+ ne_propname pname = { "http://webdav.org/neon/litmus/", "random" };
+ ne_proppatch_operation pops[] = {
+ { NULL, ne_propset, "foobar" },
+ { NULL }
+ };
+
+ PRECOND(gotlock);
+
+ pops[0].name = &pname;
+
+ ONN("DELETE of locked resource should fail",
+ ne_delete(i_session2, res) != NE_ERROR);
+
+ if (STATUS2(423))
+ t_warning("DELETE failed with %d not 423", GETSTATUS2);
+
+ tmp = ne_concat(i_path, "whocares", NULL);
+ ONN("MOVE of locked resource should fail",
+ ne_move(i_session2, 0, res, tmp) != NE_ERROR);
+ free(tmp);
+
+ if (STATUS2(423))
+ t_warning("MOVE failed with %d not 423", GETSTATUS2);
+
+ ONN("COPY onto locked resource should fail",
+ ne_copy(i_session2, 1, NE_DEPTH_ZERO, res2, res) != NE_ERROR);
+
+ if (STATUS2(423))
+ t_warning("COPY failed with %d not 423", GETSTATUS2);
+
+ ONN("PROPPATCH of locked resource should fail",
+ ne_proppatch(i_session2, res, pops) != NE_ERROR);
+
+ if (STATUS2(423))
+ t_warning("PROPPATCH failed with %d not 423", GETSTATUS2);
+
+ ONN("PUT on locked resource should fail",
+ ne_put(i_session2, res, i_foo_fd) != NE_ERROR);
+
+ if (STATUS2(423))
+ t_warning("PUT failed with %d not 423", GETSTATUS2);
+
+ return OK;
+}
+
+static int notowner_lock(void)
+{
+ struct ne_lock dummy;
+
+ PRECOND(gotlock);
+
+ memcpy(&dummy, &reslock, sizeof(reslock));
+ dummy.token = ne_strdup("opaquelocktoken:foobar");
+ dummy.scope = ne_lockscope_exclusive;
+ dummy.owner = ne_strdup("notowner lock");
+
+ ONN("UNLOCK with bogus lock token",
+ ne_unlock(i_session2, &dummy) != NE_ERROR);
+
+ /* 2518 doesn't really say what status code that UNLOCK should
+ * fail with. mod_dav gives a 400 as the locktoken is bogus. */
+
+ ONN("LOCK on locked resource",
+ ne_lock(i_session2, &dummy) != NE_ERROR);
+
+ if (dummy.token)
+ ne_free(dummy.token);
+
+ if (STATUS2(423))
+ t_warning("LOCK failed with %d not 423", GETSTATUS2);
+
+ return OK;
+}
+
+/* take out another shared lock on the resource. */
+static int double_sharedlock(void)
+{
+ struct ne_lock dummy;
+
+ PRECOND(gotlock);
+
+ memcpy(&dummy, &reslock, sizeof(reslock));
+ dummy.token = NULL;
+ dummy.owner = ne_strdup("litmus: notowner_sharedlock");
+ dummy.scope = ne_lockscope_shared;
+
+ ONNREQ2("shared LOCK on locked resource",
+ ne_lock(i_session2, &dummy));
+
+ ONNREQ2("unlock of second shared lock",
+ ne_unlock(i_session2, &dummy));
+
+ return OK;
+}
+
+static int owner_modify(void)
+{
+ PRECOND(gotlock);
+ ne_proppatch_operation pops[] = {
+ { NULL, ne_propset, "foobar" },
+ { NULL }
+ };
+ const ne_propname pname = { "http://webdav.org/neon/litmus/", "random" };
+
+ pops[0].name = &pname;
+
+ ONV(ne_put(i_session, res, i_foo_fd),
+ ("PUT on locked resource failed: %s", ne_get_error(i_session)));
+
+ ONMREQ("PROPPATCH on locked resouce", res,
+ ne_proppatch(i_session, res, pops));
+
+ return OK;
+}
+
+/* ne_lock_discover which counts number of calls. */
+static void count_discover(void *userdata, const struct ne_lock *lock,
+#ifdef HAVE_NEON_026PLUS
+ const ne_uri *uri,
+#else
+ const char *uri,
+#endif
+ const ne_status *status)
+{
+ if (lock) {
+ int *count = userdata;
+ *count += 1;
+ }
+}
+
+/* check that locks don't follow copies. */
+static int copy(void)
+{
+ char *dest;
+ int count = 0;
+
+ PRECOND(gotlock);
+
+ dest = ne_concat(res, "-copydest", NULL);
+
+ ne_delete(i_session2, dest);
+
+ ONNREQ2("could not COPY locked resource",
+ ne_copy(i_session2, 1, NE_DEPTH_ZERO, res, dest));
+
+ ONNREQ2("LOCK discovery failed",
+ ne_lock_discover(i_session2, dest, count_discover, &count));
+
+ ONV(count != 0,
+ ("found %d locks on copied resource", count));
+
+ ONNREQ2("could not delete copy of locked resource",
+ ne_delete(i_session2, dest));
+
+ free(dest);
+
+ return OK;
+}
+
+/* Compare locks, expected EXP, actual ACT. */
+static int compare_locks(const struct ne_lock *exp, const struct ne_lock *act)
+{
+ ONCMP(exp->token, act->token, "compare discovered lock", "token");
+ ONCMP(exp->owner, act->owner, "compare discovered lock", "owner");
+ return OK;
+}
+
+/* check that the lock returned has correct URI, token */
+static void verify_discover(void *userdata, const struct ne_lock *lock,
+#ifdef HAVE_NEON_026PLUS
+ const ne_uri *uri,
+#else
+ const char *uri,
+#endif
+ const ne_status *status)
+{
+ int *ret = userdata;
+
+ if (*ret == 1) {
+ /* already failed. */
+ return;
+ }
+
+ if (lock) {
+ *ret = compare_locks(gotlock, lock);
+ } else {
+ *ret = 1;
+ t_context("failed: %d %s\n", status->code, status->reason_phrase);
+ }
+
+}
+
+static int discover(void)
+{
+ int ret = 0;
+
+ PRECOND(gotlock);
+
+ ONNREQ("lock discovery failed",
+ ne_lock_discover(i_session, res, verify_discover, &ret));
+
+ /* check for failure from the callback. */
+ if (ret)
+ return FAIL;
+
+ return OK;
+}
+
+static int refresh(void)
+{
+ PRECOND(gotlock);
+
+ ONMREQ("LOCK refresh", gotlock->uri.path,
+ ne_lock_refresh(i_session, gotlock));
+
+ return OK;
+}
+
+static int unlock(void)
+{
+ PRECOND(gotlock);
+
+ ONMREQ("UNLOCK", gotlock->uri.path, ne_unlock(i_session, gotlock));
+ /* Remove lock from session. */
+ ne_lockstore_remove(store, gotlock);
+ /* for safety sake. */
+ gotlock = NULL;
+ return OK;
+}
+
+/* Perform a conditional PUT request with given If: header value,
+ * placing response status-code in *code and class in *klass. Fails
+ * if requests cannot be dispatched. */
+static int conditional_put(const char *ifhdr, int *klass, int *code)
+{
+ ne_request *req;
+
+ req = ne_request_create(i_session, "PUT", res);
+ ne_set_request_body_fd(req, i_foo_fd, 0, i_foo_len);
+
+ ne_print_request_header(req, "If", "%s", ifhdr);
+
+ ONMREQ("PUT", res, ne_request_dispatch(req));
+
+ if (code) *code = ne_get_status(req)->code;
+ if (klass) *klass = ne_get_status(req)->klass;
+
+ ne_request_destroy(req);
+ return OK;
+}
+
+/*** A series of conditional PUTs suggested by Julian Reschke. */
+
+/* a PUT conditional on lock and etag should succeed */
+static int cond_put(void)
+{
+ char *etag = get_etag(res);
+ char hdr[200];
+ int klass;
+
+ PRECOND(etag && gotlock);
+
+ ne_snprintf(hdr, sizeof hdr, "(<%s> [%s])", gotlock->token, etag);
+
+ CALL(conditional_put(hdr, &klass, NULL));
+
+ ONV(klass != 2,
+ ("PUT conditional on lock and etag failed: %s",
+ ne_get_error(i_session)));
+
+ return OK;
+}
+
+/* PUT conditional on bogus lock-token and valid etag, should fail. */
+static int fail_cond_put(void)
+{
+ int klass, code;
+ char *etag = get_etag(res);
+ char hdr[200];
+
+ PRECOND(etag && gotlock);
+
+ ne_snprintf(hdr, sizeof hdr, "(<DAV:no-lock> [%s])", etag);
+
+ CALL(conditional_put(hdr, &klass, &code));
+
+ ONV(klass == 2,
+ ("conditional PUT with invalid lock-token should fail: %s",
+ ne_get_error(i_session)));
+
+ ONN("conditional PUT with invalid lock-token code got 400", code == 400);
+
+ if (code != 412)
+ t_warning("PUT failed with %d not 412", code);
+
+ return OK;
+}
+
+/* PUT conditional on bogus lock-token and valid etag, should fail. */
+static int fail_cond_put_unlocked(void)
+{
+ int klass, code;
+
+ CALL(conditional_put("(<DAV:no-lock>)", &klass, &code));
+
+ ONV(klass == 2,
+ ("conditional PUT with invalid lock-token should fail: %s",
+ ne_get_error(i_session)));
+
+ ONN("conditional PUT with invalid lock-token code got 400", code == 400);
+
+ if (code != 412)
+ t_warning("PUT failed with %d not 412", code);
+
+ return OK;
+}
+
+
+/* PUT conditional on real lock-token and not(bogus lock-token),
+ * should succeed. */
+static int cond_put_with_not(void)
+{
+ int klass, code;
+ char hdr[200];
+
+ PRECOND(gotlock);
+
+ ne_snprintf(hdr, sizeof hdr, "(<%s>) (Not <DAV:no-lock>)",
+ gotlock->token);
+
+ CALL(conditional_put(hdr, &klass, &code));
+
+ ONV(klass != 2,
+ ("PUT with conditional (Not <DAV:no-lock>) failed: %s",
+ ne_get_error(i_session)));
+
+ return OK;
+}
+
+/* PUT conditional on corruption of real lock-token and not(bogus
+ * lock-token) , should fail. */
+static int cond_put_corrupt_token(void)
+{
+ int class, code;
+ char hdr[200];
+
+ PRECOND(gotlock);
+
+ ne_snprintf(hdr, sizeof hdr, "(<%sx>) (Not <DAV:no-lock>)",
+ gotlock->token);
+
+ CALL(conditional_put(hdr, &class, &code));
+
+ ONV(class == 2,
+ ("conditional PUT with invalid lock-token should fail: %s",
+ ne_get_error(i_session)));
+
+ if (code != 423)
+ t_warning("PUT failed with %d not 423", code);
+
+ return OK;
+}
+
+/* PUT with a conditional (lock-token and etag) (Not bogus-token and etag) */
+static int complex_cond_put(void)
+{
+ int klass, code;
+ char hdr[200];
+ char *etag = get_etag(res);
+
+ PRECOND(gotlock && etag != NULL);
+
+ ne_snprintf(hdr, sizeof hdr, "(<%s> [%s]) (Not <DAV:no-lock> [%s])",
+ gotlock->token, etag, etag);
+
+ CALL(conditional_put(hdr, &klass, &code));
+
+ ONV(klass != 2,
+ ("PUT with complex conditional failed: %s",
+ ne_get_error(i_session)));
+
+ return OK;
+}
+
+/* PUT with a conditional (lock-token and not-the-etag) (Not
+ * bogus-token and etag) */
+static int fail_complex_cond_put(void)
+{
+ int klass, code;
+ char hdr[200];
+ char *etag = get_etag(res), *pnt;
+
+ PRECOND(gotlock && etag != NULL);
+
+ /* Corrupt the etag string: change the third character from the end. */
+ pnt = etag + strlen(etag) - 3;
+ PRECOND(pnt > etag);
+ (*pnt)++;
+
+ ne_snprintf(hdr, sizeof hdr, "(<%s> [%s]) (Not <DAV:no-lock> [%s])",
+ gotlock->token, etag, etag);
+
+ CALL(conditional_put(hdr, &klass, &code));
+
+ ONV(code != 412,
+ ("PUT with complex bogus conditional should fail with 412: %s",
+ ne_get_error(i_session)));
+
+ return OK;
+}
+
+static int prep_collection(void)
+{
+ if (gotlock) {
+ ne_lock_destroy(gotlock);
+ gotlock = NULL;
+ }
+ ne_free(res);
+ res = coll = ne_concat(i_path, "lockcoll/", NULL);
+ ONV(ne_mkcol(i_session, res),
+ ("MKCOL %s: %s", res, ne_get_error(i_session)));
+ return OK;
+}
+
+static int lock_collection(void)
+{
+ CALL(getlock(ne_lockscope_exclusive, NE_DEPTH_INFINITE));
+ /* change res to point to a normal resource for subsequent
+ * {not_,}owner_modify tests */
+ res = ne_concat(coll, "lockme.txt", NULL);
+ return upload_foo("lockcoll/lockme.txt");
+}
+
+/* indirectly refresh the the collection lock */
+static int indirect_refresh(void)
+{
+ struct ne_lock *indirect;
+
+ PRECOND(gotlock);
+
+ indirect = ne_lock_copy(gotlock);
+ ne_free(indirect->uri.path);
+ indirect->uri.path = ne_strdup(res);
+
+ ONV(ne_lock_refresh(i_session, indirect),
+ ("indirect refresh LOCK on %s via %s: %s",
+ coll, res, ne_get_error(i_session)));
+
+ ne_lock_destroy(indirect);
+
+ return OK;
+}
+
+/* lock on unmapped url should return 201 */
+static int unmapped_lock(void)
+{
+ if (gotlock) {
+ ne_lock_destroy(gotlock);
+ gotlock = NULL;
+ }
+ ne_free(res);
+
+ res = ne_concat(i_path, "unmapped_url", NULL);
+
+ ONV(getlock(ne_lockscope_exclusive, NE_DEPTH_ZERO),
+ ("LOCK on %s via %s: %s",
+ coll, res, ne_get_error(i_session)));
+
+ if (STATUS(201))
+ t_warning("LOCK on unmapped url returned %d not 201 (RFC4918:S7.3)", GETSTATUS);
+
+ return OK;
+}
+
+ne_test tests[] = {
+ INIT_TESTS,
+
+ /* check server is class 2. */
+ T(options), T(precond),
+
+ T(init_locks),
+
+ /* upload, and exclusive lock a resource. */
+ T(put), T(lock_excl),
+
+ /* check lock discovery and refresh */
+ T(discover), T(refresh),
+
+ T(notowner_modify), T(notowner_lock),
+ T(owner_modify),
+
+ /* After modifying the resource, check it is still locked (this
+ * catches a mod_dav regression when the atomic PUT code is
+ * enabled). */
+ T(notowner_modify), T(notowner_lock),
+
+ /* make sure locks don't follow a COPY */
+ T(copy),
+
+ /* Julian's conditional PUTs. */
+ T(cond_put),
+ T(fail_cond_put),
+ T(cond_put_with_not),
+ T(cond_put_corrupt_token),
+ T(complex_cond_put),
+ T(fail_complex_cond_put),
+
+ T(unlock),
+
+ T(fail_cond_put_unlocked),
+
+ /* now try it all again with a shared lock. */
+ T(lock_shared),
+
+ T(notowner_modify), T(notowner_lock), T(owner_modify),
+
+ /* take out a second shared lock */
+ T(double_sharedlock),
+
+ /* make sure the main lock is still intact. */
+ T(notowner_modify), T(notowner_lock),
+ /* finally, unlock the poor abused resource. */
+ T(unlock),
+
+ /* collection locking */
+ T(prep_collection),
+ T(lock_collection),
+ T(owner_modify), T(notowner_modify),
+ T(refresh),
+ T(indirect_refresh),
+ T(unlock),
+
+ /* lock on a unmapped url */
+ T(unmapped_lock),
+ T(unlock),
+
+ FINISH_TESTS
+};
diff --git a/src/props.c b/src/props.c
new file mode 100644
index 0000000..34e6b58
--- /dev/null
+++ b/src/props.c
@@ -0,0 +1,623 @@
+/*
+ litmus: DAV server test suite
+ Copyright (C) 2001-2006, Joe Orton <joe@manyfish.co.uk>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#include "config.h"
+
+#include <stdlib.h>
+
+#include <ne_request.h>
+#include <ne_props.h>
+#include <ne_uri.h>
+
+#include "common.h"
+
+#define NS "http://example.com/neon/litmus/"
+
+#define NSPACE(x) ((x) ? (x) : "")
+
+static const ne_propname props[] = {
+ { "DAV:", "getcontentlength" },
+ { "DAV:", "getlastmodified" },
+ { "DAV:", "displayname" },
+ { "DAV:", "resourcetype" },
+ { NS, "foo" },
+ { NS, "bar" },
+ { NULL }
+};
+
+#define ELM_resourcetype (NE_PROPS_STATE_TOP + 1)
+#define ELM_collection (NE_PROPS_STATE_TOP + 2)
+
+#define XML_DECL "<?xml version=\"1.0\" encoding=\"utf-8\" ?>"
+
+static const struct ne_xml_idmap map[] = {
+ { "DAV:", "resourcetype", ELM_resourcetype },
+ { "DAV:", "collection", ELM_collection }
+};
+
+struct private {
+ int collection;
+};
+
+struct results {
+ ne_propfind_handler *ph;
+ int result;
+};
+
+#ifdef HAVE_NEON_026PLUS
+static void d0_results(void *userdata, const ne_uri *uri,
+ const ne_prop_result_set *rset)
+#else
+static void d0_results(void *userdata, const char *uri,
+ const ne_prop_result_set *rset)
+#endif
+{
+ struct results *r = userdata;
+ const char *path;
+#ifndef HAVE_NEON_026PLUS
+ const char *scheme;
+ size_t slen;
+
+ scheme = ne_get_scheme(ne_get_session(ne_propfind_get_request(r->ph)));
+ slen = strlen(scheme);
+
+ if (strncmp(uri, scheme, slen) == 0 &&
+ strncmp(uri+slen, "://", 3) == 0) {
+ /* Absolute URI */
+ path = strchr(uri+slen+3, '/');
+ if (path == NULL) {
+ NE_DEBUG(NE_DBG_HTTP, "Invalid URI???");
+ return;
+ }
+ }
+ else {
+ path = uri;
+ }
+#else
+ path = uri->path;
+#endif
+
+ if (ne_path_compare(path, i_path)) {
+ t_warning("response href for wrong resource");
+ } else {
+ struct private *priv = ne_propset_private(rset);
+ if (!priv->collection) {
+ r->result = FAIL;
+ t_context("Base collection did not define {DAV:}collection property");
+ return;
+ } else {
+ r->result = 0;
+ }
+ }
+}
+
+#ifdef HAVE_NEON_026PLUS
+static void *create_private(void *userdata, const ne_uri *uri)
+{
+ return ne_calloc(sizeof(struct private));
+}
+
+static void destroy_private(void *userdata, void *private)
+{
+ ne_free(private);
+}
+
+#else
+static void *create_private(void *userdata, const char *uri)
+{
+ return ne_calloc(sizeof(struct private));
+}
+#endif
+
+static int startelm(void *ud, int parent, const char *nspace,
+ const char *name, const char **atts)
+{
+ int state = ne_xml_mapid(map, NE_XML_MAPLEN(map), nspace, name);
+ struct private *p = ne_propfind_current_private(ud);
+
+ if (parent == NE_207_STATE_PROP && state == ELM_resourcetype)
+ return ELM_resourcetype;
+ else if (parent == ELM_resourcetype && state == ELM_collection)
+ p->collection = 1;
+
+ return NE_XML_DECLINE;
+}
+
+/* Depth 0 PROPFIND on root collection. */
+static int propfind_d0(void)
+{
+ int ret;
+ struct results r = {0};
+
+ r.ph = ne_propfind_create(i_session, i_path, NE_DEPTH_ZERO);
+
+ ne_propfind_set_private(r.ph, create_private,
+#ifdef HAVE_NEON_026PLUS
+ destroy_private,
+#endif
+ NULL);
+
+ r.result = FAIL;
+ t_context("No responses returned");
+
+ ne_xml_push_handler(ne_propfind_get_parser(r.ph), startelm,
+ NULL, NULL, r.ph);
+
+ ret = ne_propfind_named(r.ph, props, d0_results, &r);
+
+ if (r.result) {
+ return r.result;
+ }
+
+ return OK;
+}
+
+static int do_invalid_pfind(const char *body, const char *failmsg)
+{
+ ne_request *req = ne_request_create(i_session, "PROPFIND", i_path);
+
+ ne_set_request_body_buffer(req, body, strlen(body));
+
+ ne_add_depth_header(req, NE_DEPTH_ZERO);
+
+ ONV(ne_request_dispatch(req),
+ ("PROPFIND with %s failed: %s", failmsg, ne_get_error(i_session)));
+
+ if (STATUS(400)) {
+ t_context("PROPFIND with %s got %d response not 400",
+ failmsg, GETSTATUS);
+ return FAIL;
+ }
+
+ ne_request_destroy(req);
+
+ return OK;
+}
+
+static int propfind_invalid(void)
+{
+ return do_invalid_pfind("<foo>", "non-well-formed XML request body");
+}
+
+/* Julian Reschke's bug regarding invalid namespace declarations.
+ * http://dav.lyra.org/pipermail/dav-dev/2001-August/002593.html
+ * (mod_dav regression test). */
+static int propfind_invalid2(void)
+{
+ return do_invalid_pfind(
+ "<D:propfind xmlns:D=\"DAV:\">"
+ "<D:prop><bar:foo xmlns:bar=\"\"/>"
+ "</D:prop></D:propfind>",
+ "invalid namespace declaration in body (see FAQ)");
+}
+
+
+static int prop_ok = 0;
+char *prop_uri;
+
+static int propinit(void)
+{
+ prop_uri = ne_concat(i_path, "prop", NULL);
+
+ ne_delete(i_session, prop_uri);
+
+ CALL(upload_foo("prop"));
+
+ prop_ok = 1;
+
+ return OK;
+}
+
+#define NP (10)
+
+static ne_proppatch_operation pops[NP + 1];
+static ne_propname propnames[NP + 1];
+static char *values[NP + 1];
+
+static int numprops = NP, removedprops = 5;
+
+#define PS_VALUE "value goes here"
+
+static int propset(void)
+{
+ int n;
+ char tmp[100];
+
+ for (n = 0; n < numprops; n++) {
+ sprintf(tmp, "prop%d", n);
+ propnames[n].nspace = NS;
+ propnames[n].name = ne_strdup(tmp);
+ pops[n].name = &propnames[n];
+ pops[n].type = ne_propset;
+ sprintf(tmp, "value%d", n);
+ values[n] = ne_strdup(tmp);
+ pops[n].value = values[n];
+ }
+
+ memset(&pops[n], 0, sizeof(pops[n]));
+ memset(&propnames[n], 0, sizeof(propnames[n]));
+ values[n] = NULL;
+
+ PRECOND(prop_ok);
+
+ prop_ok = 0; /* if the PROPPATCH fails, no point in testing further. */
+ ONMREQ("PROPPATCH", prop_uri, ne_proppatch(i_session, prop_uri, pops));
+ prop_ok = 1;
+
+ return OK;
+}
+
+#ifdef HAVE_NEON_026PLUS
+static void pg_results(void *userdata, const ne_uri *uri,
+ const ne_prop_result_set *rset)
+#else
+static void pg_results(void *userdata, const char *uri,
+ const ne_prop_result_set *rset)
+#endif
+{
+ struct results *r = userdata;
+ const char *value;
+ const ne_status *status;
+ int n;
+
+ r->result = 0;
+
+ for (n = 0; n < numprops; n++) {
+ value = ne_propset_value(rset, &propnames[n]);
+ status = ne_propset_status(rset, &propnames[n]);
+
+ if (values[n] == NULL) {
+ /* We should have received a 404 for this property. */
+
+ if (value == NULL) {
+ if (status == NULL) {
+ t_warning("Property %d omitted from results with no status",
+ n);
+ } else if (status->code != 404) {
+ t_warning("Status for missing property %d was not 404", n);
+ }
+ } else {
+ r->result = FAIL;
+ t_context("Deleted property `{%s}%s' was still present",
+ NSPACE(propnames[n].nspace), propnames[n].name);
+ }
+ } else {
+ /* We should have a value for this property. */
+ if (value == NULL) {
+ t_context("No value given for property {%s}%s",
+ NSPACE(propnames[n].nspace), propnames[n].name);
+ r->result = FAIL;
+ } else if (strcmp(value, values[n])) {
+ t_context("Property {%s}%s had value %s, expected %s",
+ NSPACE(propnames[n].nspace), propnames[n].name,
+ value, values[n]);
+ /* Check the value matches. */
+ r->result = FAIL;
+ }
+ }
+ }
+
+}
+
+static int propget(void)
+{
+ struct results r = {0};
+
+ PRECOND(prop_ok);
+
+ r.result = 1;
+ t_context("No responses returned");
+
+ ONMREQ("PROPFIND", prop_uri,
+ ne_simple_propfind(i_session, prop_uri, NE_DEPTH_ZERO,
+ propnames, pg_results, &r));
+
+ if (r.result) {
+ return r.result;
+ }
+
+ return OK;
+}
+
+static int propmove(void)
+{
+ char *dest;
+
+ PRECOND(prop_ok);
+
+ dest = ne_concat(i_path, "prop2", NULL);
+
+ ne_delete(i_session, dest);
+
+ ONM2REQ("MOVE", prop_uri, dest,
+ ne_move(i_session, 0, prop_uri, dest));
+
+ free(prop_uri);
+ prop_uri = dest;
+
+ return OK;
+}
+
+static int propdeletes(void)
+{
+ int n;
+
+ PRECOND(prop_ok);
+
+ for (n = 0; n < removedprops; n++) {
+ pops[n].type = ne_propremove;
+ values[n] = NULL;
+ }
+
+ ONMREQ("PROPPATCH", prop_uri,
+ ne_proppatch(i_session, prop_uri, pops));
+
+ return OK;
+}
+
+static int propreplace(void)
+{
+ int n;
+
+ PRECOND(prop_ok);
+
+ for (n = removedprops; n < numprops; n++) {
+ char tmp[100];
+ sprintf(tmp, "newvalue%d", n);
+ pops[n].type = ne_propset;
+ pops[n].value = values[n] = ne_strdup(tmp);
+ }
+
+ ONMREQ("PROPPATCH", prop_uri,
+ ne_proppatch(i_session, prop_uri, pops));
+
+ return OK;
+}
+
+/* Test whether the response to a PROPFIND request with given body is
+ * well-formed XML. */
+static int propfind_returns_wellformed(const char *msg, const char *body)
+{
+ ne_xml_parser *p = ne_xml_create();
+ ne_request *req = ne_request_create(i_session, "PROPFIND", prop_uri);
+
+ ne_set_request_body_buffer(req, body, strlen(body));
+
+ ne_add_response_body_reader(req, ne_accept_207, ne_xml_parse_v, p);
+ ONMREQ("PROPFIND", prop_uri, ne_request_dispatch(req));
+
+ ONV(ne_xml_failed(p), ("PROPFIND response %s was not well-formed: %s",
+ msg, ne_xml_get_error(p)));
+
+ ne_xml_destroy(p);
+ ne_request_destroy(req);
+ return OK;
+}
+
+/* Run a PROPPATCH request with given body; do an XML parse on the
+ * response to make sure its well-formed. Return failure with given
+ * 'msg' if the request fails. */
+static int do_patch(const char *failmsg, const char *body)
+{
+ ne_request *req = ne_request_create(i_session, "PROPPATCH", prop_uri);
+
+ ne_set_request_body_buffer(req, body, strlen(body));
+
+ ONNREQ(failmsg, ne_request_dispatch(req));
+ ONV(ne_get_status(req)->klass != 2, ("%s", failmsg));
+
+ ne_request_destroy(req);
+ return OK;
+}
+
+/* Regression test for mod_dav 1.0.2, another found by Julian Reschke,
+ * see FAQ for details. */
+static int propnullns(void)
+{
+ PRECOND(prop_ok);
+
+ numprops = 1;
+ removedprops = 0;
+
+ propnames[0].nspace = NULL;
+ propnames[0].name = "nonamespace";
+ pops[0].value = values[0] = "randomvalue";
+ pops[0].type = ne_propset;
+
+ pops[1].name = NULL;
+ propnames[1].name = NULL;
+
+ CALL(do_patch("PROPPATCH of property with null namespace (see FAQ)",
+ XML_DECL
+ "<propertyupdate xmlns=\"DAV:\"><set><prop>"
+ "<nonamespace xmlns=\"\">randomvalue</nonamespace>"
+ "</prop></set></propertyupdate>"));
+
+ return OK;
+}
+
+/* Test ability to parse and persist Unicode characters above UXFFFF. */
+static int prophighunicode(void)
+{
+ PRECOND(prop_ok);
+
+ numprops = 1;
+ removedprops = 0;
+
+ propnames[0].nspace = NS;
+ propnames[0].name = "high-unicode";
+ pops[0].value = values[0] = "\xf0\x90\x80\x80";
+ pops[0].type = ne_propset;
+
+ pops[1].name = NULL;
+ propnames[1].name = NULL;
+
+ CALL(do_patch("PROPPATCH of property with high unicode value",
+ XML_DECL "<propertyupdate xmlns='DAV:'><set><prop>"
+ "<high-unicode xmlns='" NS "'>&#65536;</high-unicode>"
+ "</prop></set></propertyupdate>"));
+
+ return OK;
+}
+
+/* Test whether PROPPATCH is processed in document order (1/2). */
+static int propremoveset(void)
+{
+ PRECOND(prop_ok);
+
+ numprops = 1;
+ removedprops = 0;
+
+ propnames[0].nspace = NS;
+ propnames[0].name = "removeset";
+ values[0] = "y";
+
+ CALL(do_patch("PROPPATCH remove then set",
+ XML_DECL "<propertyupdate xmlns='DAV:'>"
+ "<remove><prop><removeset xmlns='" NS "'/></prop></remove>"
+ "<set><prop><removeset xmlns='" NS "'>x</removeset></prop></set>"
+ "<set><prop><removeset xmlns='" NS "'>y</removeset></prop></set>"
+ "</propertyupdate>"));
+
+ return OK;
+}
+
+/* Test whether PROPPATCH is processed in document order (2/2). */
+static int propsetremove(void)
+{
+ PRECOND(prop_ok);
+
+ numprops = 1;
+ removedprops = 0;
+
+ propnames[0].nspace = NS;
+ propnames[0].name = "removeset";
+ values[0] = NULL;
+
+ CALL(do_patch("PROPPATCH remove then set",
+ XML_DECL "<propertyupdate xmlns='DAV:'>"
+ "<set><prop><removeset xmlns='" NS "'>x</removeset></prop></set>"
+ "<remove><prop><removeset xmlns='" NS "'/></prop></remove>"
+ "</propertyupdate>"));
+
+ return OK;
+}
+
+/* regression test for Apache bug #15728. */
+static int propvalnspace(void)
+{
+ PRECOND(prop_ok);
+
+ numprops = 1;
+ removedprops = 0;
+
+ propnames[0].nspace = NS;
+ propnames[0].name = "valnspace";
+ pops[0].value = values[0] = "<foo></foo>";
+ pops[0].type = ne_propset;
+
+ pops[1].name = NULL;
+ propnames[1].name = NULL;
+
+ CALL(do_patch("PROPPATCH of property with value defining namespace",
+ XML_DECL "<propertyupdate xmlns='DAV:'><set><prop>"
+ "<t:valnspace xmlns:t='" NS "'><foo xmlns='http://bar'/></t:valnspace>"
+ "</prop></set></propertyupdate>"));
+
+ return OK;
+}
+
+static int propwformed(void)
+{
+ char body[500];
+
+ ne_snprintf(body, sizeof body, XML_DECL "<propfind xmlns='DAV:'><prop>"
+ "<%s xmlns='%s'/></prop></propfind>",
+ propnames[0].name, propnames[0].nspace);
+
+ return propfind_returns_wellformed("for property in namespace", body);
+}
+
+static int propextended(void)
+{
+ return propfind_returns_wellformed("with extended <propfind> element",
+ XML_DECL "<propfind xmlns=\"DAV:\"><foobar/>"
+ "<allprop/></propfind>");
+}
+
+static const char *manyns[10] = {
+ "http://example.com/alpha", "http://example.com/beta",
+ "http://example.com/gamma", "http://example.com/delta",
+ "http://example.com/epsilon", "http://example.com/zeta",
+ "http://example.com/eta", "http://example.com/theta",
+ "http://example.com/iota", "http://example.com/kappa"
+};
+
+static int propmanyns(void)
+{
+ int n;
+
+ numprops = 10;
+
+ for (n = 0; n < numprops; n++) {
+ propnames[n].nspace = manyns[n];
+ propnames[n].name = "somename";
+ pops[n].name = &propnames[n];
+ pops[n].value = values[n] = "manynsvalue";
+ pops[n].type = ne_propset;
+ }
+
+ ONMREQ("PROPPATCH", prop_uri,
+ ne_proppatch(i_session, prop_uri, pops));
+
+ return OK;
+}
+
+static int propcleanup(void)
+{
+ ne_delete(i_session, prop_uri);
+ return OK;
+}
+
+ne_test tests[] =
+{
+ INIT_TESTS,
+
+ T(propfind_invalid), T(propfind_invalid2),
+ T(propfind_d0),
+ T(propinit),
+ T(propset), T(propget),
+ T(propextended),
+
+ T(propmove), T(propget),
+ T(propdeletes), T(propget),
+ T(propreplace), T(propget),
+ T(propnullns), T(propget),
+ T(prophighunicode), T(propget),
+ T(propremoveset), T(propget),
+ T(propsetremove), T(propget),
+ T(propvalnspace), T(propwformed),
+
+ T(propinit),
+
+ T(propmanyns), T(propget),
+ T(propcleanup),
+
+ FINISH_TESTS
+};
diff --git a/test-common/ChangeLog b/test-common/ChangeLog
new file mode 100644
index 0000000..f17d47d
--- /dev/null
+++ b/test-common/ChangeLog
@@ -0,0 +1,245 @@
+Wed Aug 25 19:27:26 2004 Joe Orton <joe@manyfish.co.uk>
+
+ * child.c (reset_socket): New function.
+
+Mon Jul 5 18:38:08 2004 Joe Orton <joe@manyfish.co.uk>
+
+ * tests.c (main): Print 'xfail' for expected failures.
+
+Tue Oct 7 21:19:56 2003 Joe Orton <joe@manyfish.co.uk>
+
+ * child.c (close_socket): New function.
+ (server_child, spawn_server_repeat): Use it.
+
+Fri Jul 25 12:13:59 2003 Joe Orton <joe@manyfish.co.uk>
+
+ Add support for test type which is expected to fail
+ memory leak checks.
+
+ * tests.h (T_XLEAKY, T_EXPECT_LEAKS): New defines.
+
+ * test.c (main) [NEON_MEMLEAK]: If T_EXPECT_LEAKS is set, fail if
+ the test did not leak memory.
+
+Wed Jun 18 20:10:45 2003 Joe Orton <joe@manyfish.co.uk>
+
+ * child.c (server_child, spawn_server_repeat): Adapt for new
+ socket API.
+
+Sun Mar 9 17:52:11 2003 Joe Orton <joe@manyfish.co.uk>
+
+ * test.h (T_EXPECT_FAIL): New constant.
+ (T_XFAIL): New test function wrapper.
+
+ * tests.c (main): Handle expected failures.
+
+Sat Mar 1 21:04:35 2003 Joe Orton <joe@manyfish.co.uk>
+
+ Extend the ne_test structure with a 'flags' field which can
+ optionally request leak checking at run-time.
+
+ * tests.h (ne_test): Add 'flags' field.
+ (T_CHECK_LEAKS): New flag.
+ (T): Use T_CHECK_LEAKS flag by default.
+ (T_LEAKY): Like T, but with no flags set.
+
+ * tests.c (main) [NEON_MEMLEAK]: If leak checking is requested,
+ if a test passes, but leaks memory, fail the test.
+
+Wed Feb 26 21:52:15 2003 Joe Orton <joe@manyfish.co.uk>
+
+ * tests.c (main): Test the "disable debugging" mode of
+ ne_debug_init, NE_DBG_FLUSH, and a ne_debug() with no output.
+
+Fri Aug 23 22:54:35 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * tests.c (main): Call ne_sock_init after ne_debug_init, so that
+ debugging messages are caught from ne_sock_init. Print a warning
+ message if ne_sock_init fails.
+
+Wed Aug 21 13:29:20 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * tests.h (ONCMP): New macro.
+
+Mon Aug 19 16:53:20 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * child.c (lookup_localhost): Just use inet_addr to resolve
+ 127.0.0.1.
+
+Sun Aug 18 13:50:30 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * tests.c (TEST_DEBUG): Add NE_DBG_SSL.
+
+Sat Aug 10 10:19:18 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * child.c (server_send): Fix declaration.
+ (discard_body): Use NE_FMT_SSIZE_T for print ssize_t's.
+
+Sat Jul 6 08:42:37 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * child.c (discard_body): New function.
+
+Sun Jun 30 10:26:33 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * child.c (server_send): New function.
+ (discard_request): Fail with appropriate error.
+
+Sun Jun 30 09:03:51 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * tests.c (main): Reap server after each test has run.
+
+Sun Jun 30 09:00:43 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * child.c (reap_server): Set `child' to 0 so child can't be reaped
+ twice.
+
+Sun Jun 23 12:09:09 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * child.c (serve_file): Use large buffer when sending in chunked
+ mode to support large chunk sizes.
+
+Sun Jun 23 09:35:09 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * child.c (serve_file): Use NE_FMT_OFF_T and NE_FMT_SSIZE_T.
+
+Thu May 30 21:57:39 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * child.c (minisleep): Export function.
+
+Sun May 19 18:23:19 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * child.c, tests.c: s/sock_/ne_sock_/, s/SOCK_/NE_SOCK_/ for
+ socket layer API change.
+
+ * child.h (SEND_STRING): New macro.
+
+Sun May 19 08:57:21 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * child.c (lookup_hostname): Conditionally use hstrerror().
+
+Mon Feb 25 20:54:56 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * tests.c (t_context): Use ne_vsnprintf.
+
+Mon Feb 11 21:52:23 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * child.c (lookup_hostname): New function.
+ (server_child, do_listen): Pass around struct in_addr argument.
+ (spawn_server_addr): Renamed from spawn_server, take bind_local
+ flag to use localhost or "real" hostname to bind to.
+ (spawn_server): New function, use spawn_server
+
+Mon Feb 11 20:51:27 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * child.c (minisleep) [HAVE_USLEEP]: Use nice short usleep()
+ rather than boring long sleep().
+
+Sat Feb 2 14:15:25 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * child.c (spawn_server_repeat): Exit child process (with failure)
+ if the server callback fails.
+
+Fri Jan 4 22:06:17 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * tests.h: Add SKIPREST result value.
+
+ * tests.c (TEST_DEBUG): Add NE_DBG_LOCKS. (main): Support
+ SKIPREST.
+
+Tue Jan 1 20:36:58 2002 Joe Orton <joe@manyfish.co.uk>
+
+ * tests.h: Make test_suite symbol have external linkage.
+
+Sat Nov 10 22:28:55 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * tests.c, test.h: Export name of test suite.
+
+Sun Nov 4 13:56:42 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * child.c (discard_request): Support retrieving arbitrary header
+ values from request via want_request, got_request globals.
+
+Wed Oct 24 21:41:39 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * tests.h (ONV): New macro. (ON, ONN): Redefine in terms of ONV.
+
+Wed Oct 24 20:44:59 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * tests.c (main, t_warning, segv): Use colours when stdout is a
+ terminal device.
+
+Wed Oct 24 20:36:38 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * tests.c (t_context, t_warning): Renamed from i_am, warning.
+ (t_context): Take printf varargs.
+
+ * tests.h (ONN, ON): Update, simplify.
+
+ * child.c: Update.
+
+Tue Oct 23 22:15:17 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * tests.c (main): Vertically align results after warnings.
+
+Tue Oct 2 23:36:44 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * child.c (do_listen): Refactored from server_socket, only does
+ bind/listen. (spawn_server): Moved awaken/accept calls here.
+ (spawn_server_repeat, dead_server): New functions.
+
+Sun Sep 30 10:14:35 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * tests.h: Use a function/name structure for tests, add 'T' macro
+ for easily writing initializers. Rename 'name' global variable to
+ 'test_context' to avoid parameter name collisions.
+
+ * child.c (spawn_server): Update accordingly.
+
+ * tests.c (i_am): Update accordingly. (main): Update; prettify
+ output using new 'name' from test structure. Cope better when all
+ tests in a suite are skipped.
+
+Sat Sep 29 11:04:40 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * child.c (serve_file): If 'chunks' is set in argument object,
+ then deliver the file as a series of chunks.
+
+Thu Sep 27 20:28:45 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * child.c (serve_file): New function.
+
+Thu Sep 27 20:28:41 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * child.c (discard_request): Reset clength.
+
+Mon Aug 27 00:31:09 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * tests.c (test_num): Expose test counter. (segv): Handle
+ segfault nicely.
+
+Mon Aug 27 00:30:20 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * child.c (discard_request): New function, from request.c in
+ neon/test.
+
+Wed Aug 8 22:09:21 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * tests.c, test.h: Only define test_argc/argv once.
+
+Mon Jul 16 16:30:28 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * tests.c (warning): Take printf-style arguments list.
+
+Mon Jul 16 16:16:08 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * tests.c (main): Cope with skipped tests properly.
+
+Mon Jul 16 16:00:59 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * tests.c (warning): New function. (main): Cope with warnings.
+
+Sun Jul 8 16:09:33 2001 Joe Orton <joe@manyfish.co.uk>
+
+ * tests.c (main): Export argc/argv as test_argc, test_argv.
+
+
diff --git a/test-common/README b/test-common/README
new file mode 100644
index 0000000..a910a23
--- /dev/null
+++ b/test-common/README
@@ -0,0 +1,4 @@
+
+Simple test framework for neon; licensed under the GNU GPL.
+
+Copyright (C) 2001-2002 Joe Orton
diff --git a/test-common/child.c b/test-common/child.c
new file mode 100644
index 0000000..d8f5c2b
--- /dev/null
+++ b/test-common/child.c
@@ -0,0 +1,489 @@
+/*
+ Framework for testing with a server process
+ Copyright (C) 2001-2008, Joe Orton <joe@manyfish.co.uk>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+#include "config.h"
+
+#include <sys/types.h>
+
+#include <sys/wait.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+
+#include <sys/stat.h>
+
+#ifdef HAVE_ERRNO_H
+#include <errno.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+
+#include <fcntl.h>
+#include <netdb.h>
+#include <signal.h>
+
+#include "ne_socket.h"
+#include "ne_utils.h"
+#include "ne_string.h"
+
+#include "tests.h"
+#include "child.h"
+
+static pid_t child = 0;
+
+int clength;
+
+static struct in_addr lh_addr = {0}, hn_addr = {0};
+
+const char *want_header = NULL;
+got_header_fn got_header = NULL;
+char *local_hostname = NULL;
+
+/* If we have pipe(), then use a pipe between the parent and child to
+ * know when the child is ready to accept incoming connections.
+ * Otherwise use boring sleep()s trying to avoid the race condition
+ * between listen() and connect() in the two processes. */
+#ifdef HAVE_PIPE
+#define USE_PIPE 1
+#endif
+
+int lookup_localhost(void)
+{
+ /* this will break if a system is set up so that `localhost' does
+ * not resolve to 127.0.0.1, but... */
+ lh_addr.s_addr = inet_addr("127.0.0.1");
+ return OK;
+}
+
+int lookup_hostname(void)
+{
+ char buf[BUFSIZ];
+ struct hostent *ent;
+
+ local_hostname = NULL;
+ ONV(gethostname(buf, BUFSIZ) < 0,
+ ("gethostname failed: %s", strerror(errno)));
+
+ ent = gethostbyname(buf);
+#ifdef HAVE_HSTRERROR
+ ONV(ent == NULL,
+ ("could not resolve `%s': %s", buf, hstrerror(h_errno)));
+#else
+ ONV(ent == NULL, ("could not resolve `%s'", buf));
+#endif
+
+ local_hostname = ne_strdup(ent->h_name);
+
+ return OK;
+}
+
+static int do_listen(struct in_addr addr, int port)
+{
+ int ls = socket(AF_INET, SOCK_STREAM, 0);
+ struct sockaddr_in saddr = {0};
+ int val = 1;
+
+ setsockopt(ls, SOL_SOCKET, SO_REUSEADDR, (void *)&val, sizeof(int));
+
+ saddr.sin_addr = addr;
+ saddr.sin_port = htons(port);
+ saddr.sin_family = AF_INET;
+
+ if (bind(ls, (struct sockaddr *)&saddr, sizeof(saddr))) {
+ printf("bind failed: %s\n", strerror(errno));
+ return -1;
+ }
+ if (listen(ls, 5)) {
+ printf("listen failed: %s\n", strerror(errno));
+ return -1;
+ }
+
+ return ls;
+}
+
+void minisleep(void)
+{
+#ifdef HAVE_USLEEP
+ usleep(500);
+#else
+ sleep(1);
+#endif
+}
+
+int reset_socket(ne_socket *sock)
+{
+#ifdef SO_LINGER
+ /* Stevens' magic trick to send an RST on close(). */
+ struct linger l = {1, 0};
+ return setsockopt(ne_sock_fd(sock), SOL_SOCKET, SO_LINGER, &l, sizeof l);
+#else
+ return 1;
+#endif
+}
+
+/* close 'sock', performing lingering close to avoid premature RST. */
+static int close_socket(ne_socket *sock)
+{
+#ifdef HAVE_SHUTDOWN
+ char buf[20];
+ int fd = ne_sock_fd(sock);
+
+ shutdown(fd, 0);
+ while (ne_sock_read(sock, buf, sizeof buf) > 0);
+#endif
+ return ne_sock_close(sock);
+}
+
+/* This runs as the child process. */
+static int server_child(int readyfd, struct in_addr addr, int port,
+ server_fn callback, void *userdata)
+{
+ ne_socket *s = ne_sock_create();
+ int ret, listener;
+
+ in_child();
+
+ listener = do_listen(addr, port);
+ if (listener < 0)
+ return FAIL;
+
+#ifdef USE_PIPE
+ /* Tell the parent we're ready for the request. */
+ if (write(readyfd, "a", 1) != 1) abort();
+#endif
+
+ ONN("accept failed", ne_sock_accept(s, listener));
+
+ ret = callback(s, userdata);
+
+ close_socket(s);
+
+ return ret;
+}
+
+int spawn_server(int port, server_fn fn, void *ud)
+{
+ return spawn_server_addr(1, port, fn, ud);
+}
+
+int spawn_server_addr(int bind_local, int port, server_fn fn, void *ud)
+{
+ int fds[2];
+ struct in_addr addr;
+
+ addr = bind_local?lh_addr:hn_addr;
+
+#ifdef USE_PIPE
+ if (pipe(fds)) {
+ perror("spawn_server: pipe");
+ return FAIL;
+ }
+#else
+ /* avoid using uninitialized variable. */
+ fds[0] = fds[1] = 0;
+#endif
+
+ child = fork();
+
+ ONN("fork server", child == -1);
+
+ if (child == 0) {
+ /* this is the child. */
+ int ret;
+
+ ret = server_child(fds[1], addr, port, fn, ud);
+
+#ifdef USE_PIPE
+ close(fds[0]);
+ close(fds[1]);
+#endif
+
+ /* print the error out otherwise it gets lost. */
+ if (ret) {
+ printf("server child failed: %s\n", test_context);
+ }
+
+ /* and quit the child. */
+ NE_DEBUG(NE_DBG_HTTP, "child exiting with %d\n", ret);
+ exit(ret);
+ } else {
+ char ch;
+
+#ifdef USE_PIPE
+ if (read(fds[0], &ch, 1) < 0)
+ perror("parent read");
+
+ close(fds[0]);
+ close(fds[1]);
+#else
+ minisleep();
+#endif
+
+ return OK;
+ }
+}
+
+int spawn_server_repeat(int port, server_fn fn, void *userdata, int n)
+{
+ int fds[2];
+
+#ifdef USE_PIPE
+ if (pipe(fds)) {
+ perror("spawn_server: pipe");
+ return FAIL;
+ }
+#else
+ /* avoid using uninitialized variable. */
+ fds[0] = fds[1] = 0;
+#endif
+
+ child = fork();
+
+ if (child == 0) {
+ /* this is the child. */
+ int listener, count = 0;
+
+ in_child();
+
+ listener = do_listen(lh_addr, port);
+
+#ifdef USE_PIPE
+ if (write(fds[1], "Z", 1) != 1) abort();
+#endif
+
+ close(fds[1]);
+ close(fds[0]);
+
+ /* Loop serving requests. */
+ while (++count < n) {
+ ne_socket *sock = ne_sock_create();
+ int ret;
+
+ NE_DEBUG(NE_DBG_HTTP, "child awaiting connection #%d.\n", count);
+ ONN("accept failed", ne_sock_accept(sock, listener));
+ ret = fn(sock, userdata);
+ close_socket(sock);
+ NE_DEBUG(NE_DBG_HTTP, "child served request, %d.\n", ret);
+ if (ret) {
+ printf("server child failed: %s\n", test_context);
+ exit(-1);
+ }
+ /* don't send back notification to parent more than
+ * once. */
+ }
+
+ NE_DEBUG(NE_DBG_HTTP, "child aborted.\n");
+ close(listener);
+
+ exit(-1);
+
+ } else {
+ char ch;
+ /* this is the parent. wait for the child to get ready */
+#ifdef USE_PIPE
+ if (read(fds[0], &ch, 1) < 0)
+ perror("parent read");
+
+ close(fds[0]);
+ close(fds[1]);
+#else
+ minisleep();
+#endif
+ }
+
+ return OK;
+}
+
+int dead_server(void)
+{
+ int status;
+
+ if (waitpid(child, &status, WNOHANG)) {
+ /* child quit already! */
+ return FAIL;
+ }
+
+ NE_DEBUG(NE_DBG_HTTP, "child has not quit.\n");
+
+ return OK;
+}
+
+
+int await_server(void)
+{
+ int status, code;
+
+ (void) wait(&status);
+
+ /* so that we aren't reaped by mistake. */
+ child = 0;
+
+ if (WIFEXITED(status)) {
+ code = WEXITSTATUS(status);
+
+ ONV(code,
+ ("server process terminated abnormally: %s (%d)",
+ code == FAIL ? "FAIL" : "error", code));
+ }
+ else {
+ ONV(WIFSIGNALED(status),
+ ("server process terminated by signal %d", WTERMSIG(status)));
+ }
+
+ return OK;
+}
+
+int reap_server(void)
+{
+ int status;
+
+ if (child != 0) {
+ (void) kill(child, SIGTERM);
+ minisleep();
+ (void) wait(&status);
+ child = 0;
+ }
+
+ return OK;
+}
+
+ssize_t server_send(ne_socket *sock, const char *str, size_t len)
+{
+ NE_DEBUG(NE_DBG_HTTP, "Sending: %.*s\n", (int)len, str);
+ return ne_sock_fullwrite(sock, str, len);
+}
+
+int discard_request(ne_socket *sock)
+{
+ char buffer[1024];
+ size_t offset = want_header?strlen(want_header):0;
+
+ clength = 0;
+
+ NE_DEBUG(NE_DBG_HTTP, "Discarding request...\n");
+ do {
+ ONV(ne_sock_readline(sock, buffer, 1024) < 0,
+ ("error reading line: %s", ne_sock_error(sock)));
+ NE_DEBUG(NE_DBG_HTTP, "[req] %s", buffer);
+ if (strncasecmp(buffer, "content-length:", 15) == 0) {
+ clength = atoi(buffer + 16);
+ }
+ if (got_header != NULL && want_header != NULL &&
+ strncasecmp(buffer, want_header, offset) == 0 &&
+ buffer[offset] == ':') {
+ char *value = buffer + offset + 1;
+ if (*value == ' ') value++;
+ got_header(ne_shave(value, "\r\n"));
+ }
+ } while (strcmp(buffer, "\r\n") != 0);
+
+ return OK;
+}
+
+int discard_body(ne_socket *sock)
+{
+ while (clength > 0) {
+ char buf[BUFSIZ];
+ size_t bytes = clength;
+ ssize_t ret;
+ if (bytes > sizeof(buf)) bytes = sizeof(buf);
+ NE_DEBUG(NE_DBG_HTTP, "Discarding %" NE_FMT_SIZE_T " bytes.\n",
+ bytes);
+ ret = ne_sock_read(sock, buf, bytes);
+ ONV(ret < 0, ("socket read failed (%" NE_FMT_SSIZE_T "): %s",
+ ret, ne_sock_error(sock)));
+ clength -= ret;
+ NE_DEBUG(NE_DBG_HTTP, "Got %" NE_FMT_SSIZE_T " bytes.\n", ret);
+ }
+ NE_DEBUG(NE_DBG_HTTP, "Discard successful.\n");
+ return OK;
+}
+
+int serve_file(ne_socket *sock, void *ud)
+{
+ char buffer[BUFSIZ];
+ struct stat st;
+ struct serve_file_args *args = ud;
+ ssize_t ret;
+ int fd;
+
+ CALL(discard_request(sock));
+
+ ne_sock_fullread(sock, buffer, clength);
+
+ fd = open(args->fname, O_RDONLY);
+ if (fd < 0) {
+ SEND_STRING(sock,
+ "HTTP/1.0 404 File Not Found\r\n"
+ "Content-Length: 0\r\n\r\n");
+ return 0;
+ }
+
+ ONN("fstat fd", fstat(fd, &st));
+
+ SEND_STRING(sock, "HTTP/1.0 200 OK\r\n");
+ if (args->chunks) {
+ sprintf(buffer, "Transfer-Encoding: chunked\r\n");
+ } else {
+ sprintf(buffer, "Content-Length: %" NE_FMT_OFF_T "\r\n",
+ st.st_size);
+ }
+
+ if (args->headers) {
+ strcat(buffer, args->headers);
+ }
+
+ strcat(buffer, "\r\n");
+
+ SEND_STRING(sock, buffer);
+
+ NE_DEBUG(NE_DBG_HTTP, "Serving %s (%" NE_FMT_OFF_T " bytes).\n",
+ args->fname, st.st_size);
+
+ if (args->chunks) {
+ char buf[1024];
+
+ while ((ret = read(fd, &buf, args->chunks)) > 0) {
+ /* this is a small integer, cast it explicitly to avoid
+ * warnings with printing an ssize_t. */
+ sprintf(buffer, "%x\r\n", (unsigned int)ret);
+ SEND_STRING(sock, buffer);
+ ONN("writing body", ne_sock_fullwrite(sock, buf, ret));
+ SEND_STRING(sock, "\r\n");
+ }
+
+ SEND_STRING(sock, "0\r\n\r\n");
+
+ } else {
+ while ((ret = read(fd, buffer, BUFSIZ)) > 0) {
+ ONN("writing body", ne_sock_fullwrite(sock, buffer, ret));
+ }
+ }
+
+ ONN("error reading from file", ret < 0);
+
+ (void) close(fd);
+
+ return OK;
+}
diff --git a/test-common/child.h b/test-common/child.h
new file mode 100644
index 0000000..39bdb1d
--- /dev/null
+++ b/test-common/child.h
@@ -0,0 +1,117 @@
+/*
+ Framework for testing with a server process
+ Copyright (C) 2001-2004, Joe Orton <joe@manyfish.co.uk>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+#ifndef CHILD_H
+#define CHILD_H 1
+
+#include "config.h"
+
+#ifdef HAVE_STRING_H
+#include <string.h> /* for strlen() */
+#endif
+
+#include "ne_socket.h"
+
+/* Test which does DNS lookup on "localhost": this must be the first
+ * named test. */
+int lookup_localhost(void);
+
+/* Test which looks up real local hostname. */
+int lookup_hostname(void);
+
+/* set to local hostname if lookup_hostname succeeds. */
+extern char *local_hostname;
+
+/* Callback for spawn_server. */
+typedef int (*server_fn)(ne_socket *sock, void *userdata);
+
+/* Spawns server child process:
+ * - forks child process.
+ * - child process listens on localhost at given port.
+ * - when you connect to it, 'fn' is run...
+ * fn is passed the client/server socket as first argument,
+ * and userdata as second.
+ * - the socket is closed when 'fn' returns, so don't close in in 'fn'.
+ */
+int spawn_server(int port, server_fn fn, void *userdata);
+
+/* Like spawn_server; if bind_local is non-zero, binds server to
+ * localhost, otherwise, binds server to real local hostname. (must
+ * have called lookup_localhost or lookup_hostname as approprate
+ * beforehand). */
+int spawn_server_addr(int bind_local, int port, server_fn fn, void *userdata);
+
+/* Like spawn server except will continue accepting connections and
+ * processing requests, up to 'n' times. If 'n' is reached, then the
+ * child process exits with a failure status. */
+int spawn_server_repeat(int port, server_fn fn, void *userdata, int n);
+
+/* Blocks until child process exits, and gives return code of 'fn'. */
+int await_server(void);
+
+/* Kills child process. */
+int reap_server(void);
+
+/* Returns non-zero if server process has already died. */
+int dead_server(void);
+
+/* If discard_request comes across a header called 'want_header', it
+ * will call got_header passing the header field value. */
+extern const char *want_header;
+typedef void (*got_header_fn)(char *value);
+extern got_header_fn got_header;
+
+/* Send string to child; ne_sock_fullwrite with debugging. */
+ssize_t server_send(ne_socket *sock, const char *data, size_t len);
+
+/* Utility macro: send given string down socket. */
+#define SEND_STRING(sock, str) server_send((sock), (str), strlen((str)))
+
+/* Tries to ensure that the socket will be closed using RST rather
+ * than FIN. */
+int reset_socket(ne_socket *sock);
+
+/* Utility function: discard request. Sets context on error. */
+int discard_request(ne_socket *sock);
+
+/* Utility function: discard request body. Sets context on error. */
+int discard_body(ne_socket *sock);
+
+struct serve_file_args {
+ const char *fname;
+ const char *headers;
+ int chunks;
+};
+
+/* Utility function: callback for spawn_server: pass pointer to
+ * serve_file_args as userdata, and args->fname is served as a 200
+ * request. If args->headers is non-NULL, it must be a set of
+ * CRLF-terminated lines which is added in to the response headers.
+ * If args->chunks is non-zero, the file is delivered using chunks of
+ * that size. */
+int serve_file(ne_socket *sock, void *ud);
+
+/* set to value of C-L header by discard_request. */
+extern int clength;
+
+/* Sleep for a short time. */
+void minisleep(void);
+
+#endif /* CHILD_H */
diff --git a/test-common/run.sh b/test-common/run.sh
new file mode 100755
index 0000000..01ed5a9
--- /dev/null
+++ b/test-common/run.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+rm -f debug.log
+rm -f child.log
+
+# for shared builds.
+LD_LIBRARY_PATH=../src/.libs:$LD_LIBRARY_PATH
+export LD_LIBRARY_PATH
+
+for f in $*; do
+ if ./$f; then
+ :
+ else
+ echo FAILURE
+ exit 1
+ fi
+done
+
+exit 0
diff --git a/test-common/tests.c b/test-common/tests.c
new file mode 100644
index 0000000..1ef9981
--- /dev/null
+++ b/test-common/tests.c
@@ -0,0 +1,443 @@
+/*
+ Stupidly simple test framework
+ Copyright (C) 2001-2009, Joe Orton <joe@manyfish.co.uk>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+#include "config.h"
+
+#include <sys/types.h>
+
+#include <stdio.h>
+#ifdef HAVE_SIGNAL_H
+#include <signal.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_ERRNO_H
+#include <errno.h>
+#endif
+#ifdef HAVE_LOCALE_H
+#include <locale.h>
+#endif
+
+#include "ne_string.h"
+#include "ne_utils.h"
+#include "ne_socket.h"
+#include "ne_i18n.h"
+
+#include "tests.h"
+#include "child.h"
+
+char test_context[BUFSIZ];
+int have_context = 0;
+
+static FILE *child_debug, *debug;
+
+char **test_argv;
+int test_argc;
+
+const char *test_suite;
+int test_num;
+
+static int quiet, count;
+
+/* statistics for all tests so far */
+static int passes = 0, fails = 0, skipped = 0, warnings = 0;
+
+/* per-test globals: */
+static int warned, aborted = 0;
+static const char *test_name; /* current test name */
+
+static int use_colour = 0;
+
+static int flag_child;
+
+/* resource for ANSI escape codes:
+ * http://www.isthe.com/chongo/tech/comp/ansi_escapes.html */
+#define COL(x) do { if (use_colour) printf("\033[" x "m"); } while (0)
+
+#define NOCOL COL("00")
+
+void t_context(const char *context, ...)
+{
+ va_list ap;
+ va_start(ap, context);
+ ne_vsnprintf(test_context, BUFSIZ, context, ap);
+ va_end(ap);
+ if (flag_child) {
+ NE_DEBUG(NE_DBG_HTTP, "context: %s\n", test_context);
+ }
+ have_context = 1;
+}
+
+void t_warning(const char *str, ...)
+{
+ va_list ap;
+ COL("43;01"); printf("WARNING:"); NOCOL;
+ putchar(' ');
+ va_start(ap, str);
+ vprintf(str, ap);
+ va_end(ap);
+ warnings++;
+ warned++;
+ putchar('\n');
+}
+
+#define TEST_DEBUG \
+(NE_DBG_HTTP | NE_DBG_SOCKET | NE_DBG_HTTPBODY | NE_DBG_HTTPAUTH | \
+ NE_DBG_LOCKS | NE_DBG_XMLPARSE | NE_DBG_XML | NE_DBG_SSL | \
+ NE_DBG_HTTPPLAIN)
+
+#define W(m) do { if (write(0, m, strlen(m)) < 0) exit(99); } while(0)
+
+#define W_RED(m) do { if (use_colour) W("\033[41;37;01m"); \
+W(m); if (use_colour) W("\033[00m\n"); } while (0);
+
+/* Signal handler for child processes. */
+static void child_segv(int signo)
+{
+ signal(SIGSEGV, SIG_DFL);
+ signal(SIGABRT, SIG_DFL);
+ W_RED("Fatal signal in child!");
+ kill(getpid(), SIGSEGV);
+ minisleep();
+}
+
+/* Signal handler for parent process. */
+static void parent_segv(int signo)
+{
+ signal(SIGSEGV, SIG_DFL);
+ signal(SIGABRT, SIG_DFL);
+ if (signo == SIGSEGV) {
+ W_RED("FAILED - segmentation fault");
+ } else if (signo == SIGABRT) {
+ W_RED("ABORTED");
+ }
+ reap_server();
+ kill(getpid(), SIGSEGV);
+ minisleep();
+}
+
+void in_child(void)
+{
+ ne_debug_init(child_debug, TEST_DEBUG);
+ NE_DEBUG(TEST_DEBUG, "**** Child forked for test %s ****\n", test_name);
+ signal(SIGSEGV, child_segv);
+ signal(SIGABRT, child_segv);
+ flag_child = 1;
+}
+
+static const char dots[] = "......................";
+
+static void print_prefix(int n)
+{
+ if (quiet) {
+ printf("\r%s%.*s %2u/%2u ", test_suite,
+ (int) (strlen(dots) - strlen(test_suite)), dots,
+ n + 1, count);
+ }
+ else {
+ if (warned) {
+ printf(" %s ", dots);
+ }
+ else {
+ printf("\r%2d. %s%.*s ", n, test_name,
+ (int) (strlen(dots) - strlen(test_name)), dots);
+ }
+ }
+ fflush(stdout);
+}
+
+
+int main(int argc, char *argv[])
+{
+ int n;
+ char *tmp;
+
+ /* get basename(argv[0]) */
+ test_suite = strrchr(argv[0], '/');
+ if (test_suite == NULL) {
+ test_suite = argv[0];
+ } else {
+ test_suite++;
+ }
+
+#ifdef HAVE_SETLOCALE
+ setlocale(LC_MESSAGES, "");
+#endif
+
+ ne_i18n_init(NULL);
+
+#if defined(HAVE_ISATTY) && defined(STDOUT_FILENO)
+ if (isatty(STDOUT_FILENO)) {
+ use_colour = 1;
+ }
+#endif
+
+ test_argc = argc;
+ test_argv = argv;
+
+ debug = fopen("debug.log", "a");
+ if (debug == NULL) {
+ fprintf(stderr, "%s: Could not open debug.log: %s\n", test_suite,
+ strerror(errno));
+ return -1;
+ }
+ child_debug = fopen("child.log", "a");
+ if (child_debug == NULL) {
+ fprintf(stderr, "%s: Could not open child.log: %s\n", test_suite,
+ strerror(errno));
+ fclose(debug);
+ return -1;
+ }
+
+ if (tests[0].fn == NULL) {
+ printf("-> no tests found in `%s'\n", test_suite);
+ return -1;
+ }
+
+ /* install special SEGV handler. */
+ signal(SIGSEGV, parent_segv);
+ signal(SIGABRT, parent_segv);
+
+ /* test the "no-debugging" mode of ne_debug. */
+ ne_debug_init(NULL, 0);
+ NE_DEBUG(TEST_DEBUG, "This message should go to /dev/null");
+
+ /* enable debugging for real. */
+ ne_debug_init(debug, TEST_DEBUG);
+ NE_DEBUG(TEST_DEBUG | NE_DBG_FLUSH, "Version string: %s\n",
+ ne_version_string());
+
+ /* another silly test. */
+ NE_DEBUG(0, "This message should also go to /dev/null");
+
+ if (ne_sock_init()) {
+ COL("43;01"); printf("WARNING:"); NOCOL;
+ printf(" Socket library initalization failed.\n");
+ }
+
+ if ((tmp = getenv("TEST_QUIET")) != NULL && strcmp(tmp, "1") == 0) {
+ quiet = 1;
+ }
+
+ if (!quiet)
+ printf("-> running `%s':\n", test_suite);
+
+ for (count = 0; tests[count].fn; count++)
+ /* nullop */;
+
+ for (n = 0; !aborted && tests[n].fn != NULL; n++) {
+ int result, is_xfail = 0;
+#ifdef NEON_MEMLEAK
+ size_t allocated = ne_alloc_used;
+ int is_xleaky = 0;
+#endif
+
+ test_name = tests[n].name;
+
+ print_prefix(n);
+
+ have_context = 0;
+ test_num = n;
+ warned = 0;
+ fflush(stdout);
+ NE_DEBUG(TEST_DEBUG, "******* Running test %d: %s ********\n",
+ n, test_name);
+
+ /* run the test. */
+ result = tests[n].fn();
+
+#ifdef NEON_MEMLEAK
+ /* issue warnings for memory leaks, if requested */
+ if ((tests[n].flags & T_CHECK_LEAKS) && result == OK &&
+ ne_alloc_used > allocated) {
+ t_context("memory leak of %" NE_FMT_SIZE_T " bytes",
+ ne_alloc_used - allocated);
+ fprintf(debug, "Blocks leaked: ");
+ ne_alloc_dump(debug);
+ result = FAIL;
+ } else if (tests[n].flags & T_EXPECT_LEAKS && result == OK &&
+ ne_alloc_used == allocated) {
+ t_context("expected memory leak not detected");
+ result = FAIL;
+ } else if (tests[n].flags & T_EXPECT_LEAKS && result == OK) {
+ fprintf(debug, "Blocks leaked (expected): ");
+ ne_alloc_dump(debug);
+ is_xleaky = 1;
+ }
+#endif
+
+ if (tests[n].flags & T_EXPECT_FAIL) {
+ if (result == OK) {
+ t_context("test passed but expected failure");
+ result = FAIL;
+ } else if (result == FAIL) {
+ result = OK;
+ is_xfail = 1;
+ }
+ }
+
+ print_prefix(n);
+
+ switch (result) {
+ case OK:
+ passes++;
+ if (is_xfail) {
+ COL("32;07");
+ printf("XFAIL");
+ } else if (!quiet) {
+ COL("32");
+ printf("pass");
+ }
+ NOCOL;
+ if (quiet && is_xfail) {
+ printf(" - %s", test_name);
+ if (have_context) {
+ printf(" (%s)", test_context);
+ }
+ }
+ if (warned && !quiet) {
+ printf(" (with %d warning%s)", warned, (warned > 1)?"s":"");
+ }
+#ifdef NEON_MEMLEAK
+ if (is_xleaky) {
+ if (quiet) {
+ printf("expected leak - %s: %" NE_FMT_SIZE_T " bytes",
+ test_name, ne_alloc_used - allocated);
+ }
+ else {
+ printf(" (expected leak, %" NE_FMT_SIZE_T " bytes)",
+ ne_alloc_used - allocated);
+ }
+ }
+#endif
+ if (!quiet || is_xfail) putchar('\n');
+ break;
+ case FAILHARD:
+ aborted = 1;
+ /* fall-through */
+ case FAIL:
+ COL("41;37;01"); printf("FAIL"); NOCOL;
+ if (quiet) {
+ printf(" - %s", test_name);
+ }
+ if (have_context) {
+ printf(" (%s)", test_context);
+ }
+ putchar('\n');
+ fails++;
+ break;
+ case SKIPREST:
+ aborted = 1;
+ /* fall-through */
+ case SKIP:
+ COL("44;37;01"); printf("SKIPPED"); NOCOL;
+ if (quiet) {
+ printf(" - %s", test_name);
+ }
+ if (have_context) {
+ printf(" (%s)", test_context);
+ }
+ putchar('\n');
+ skipped++;
+ break;
+ default:
+ COL("41;37;01"); printf("OOPS"); NOCOL;
+ printf(" unexpected test result `%d'\n", result);
+ break;
+ }
+
+ reap_server();
+
+ if (quiet) {
+ print_prefix(n);
+ }
+ }
+
+ /* discount skipped tests */
+ if (skipped) {
+ if (!quiet)
+ printf("-> %d %s.\n", skipped,
+ skipped == 1 ? "test was skipped" : "tests were skipped");
+ n -= skipped;
+ }
+ /* print the summary. */
+ if (skipped && n == 0) {
+ if (quiet)
+ puts("(all skipped)");
+ else
+ printf("<- all tests skipped for `%s'.\n", test_suite);
+ } else {
+ if (quiet) {
+ printf("\r%s%.*s %2u/%2u ", test_suite,
+ (int) (strlen(dots) - strlen(test_suite)), dots,
+ passes, count);
+ if (fails == 0) {
+ COL("32");
+ printf("passed");
+ NOCOL;
+ putchar(' ');
+ }
+ else {
+ printf("passed, %d failed ", fails);
+ }
+ if (skipped)
+ printf("(%d skipped) ", skipped);
+ }
+ else /* !quiet */
+ printf("<- summary for `%s': "
+ "of %d tests run: %d passed, %d failed. %.1f%%\n",
+ test_suite, n, passes, fails, 100*(float)passes/n);
+ if (warnings) {
+ if (quiet) {
+ printf("(%d warning%s)\n", warnings,
+ warnings==1?"s":"");
+ }
+ else {
+ printf("-> %d warning%s issued.\n", warnings,
+ warnings==1?" was":"s were");
+ }
+ }
+ else if (quiet) {
+ putchar('\n');
+ }
+ }
+
+ if (fclose(debug)) {
+ fprintf(stderr, "Error closing debug.log: %s\n", strerror(errno));
+ fails = 1;
+ }
+
+ if (fclose(child_debug)) {
+ fprintf(stderr, "Error closing child.log: %s\n", strerror(errno));
+ fails = 1;
+ }
+
+ ne_sock_exit();
+
+ return fails;
+}
+
diff --git a/test-common/tests.h b/test-common/tests.h
new file mode 100644
index 0000000..fe6ed3f
--- /dev/null
+++ b/test-common/tests.h
@@ -0,0 +1,128 @@
+/*
+ Stupidly simple test framework
+ Copyright (C) 2001-2004, Joe Orton <joe@manyfish.co.uk>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+ MA 02111-1307, USA
+
+*/
+
+#ifndef TESTS_H
+#define TESTS_H 1
+
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+#include <stdio.h>
+
+#define OK 0
+#define FAIL 1
+#define FAILHARD 2 /* fail and skip all succeeding tests in this suite. */
+#define SKIP 3 /* test was skipped because precondition was not met */
+#define SKIPREST 4 /* skipped, and skip all succeeding tests in suite */
+
+/* A test function. Must return any of OK, FAIL, FAILHARD, SKIP, or
+ * SKIPREST. May call t_warning() any number of times. If not
+ * returning OK, optionally call t_context to provide an error
+ * message. */
+typedef int (*test_func)(void);
+
+typedef struct {
+ test_func fn; /* the function to test. */
+ const char *name; /* the name of the test. */
+ int flags;
+} ne_test;
+
+/* possible values for flags: */
+#define T_CHECK_LEAKS (1) /* check for memory leaks */
+#define T_EXPECT_FAIL (2) /* expect failure */
+#define T_EXPECT_LEAKS (4) /* expect memory leak failures */
+
+/* array of tests to run: must be defined by each test suite. */
+extern ne_test tests[];
+
+/* define a test function which has the same name as the function,
+ * and does check for memory leaks. */
+#define T(fn) { fn, #fn, T_CHECK_LEAKS }
+/* define a test function which is expected to return FAIL. */
+#define T_XFAIL(fn) { fn, #fn, T_EXPECT_FAIL | T_CHECK_LEAKS }
+/* define a test function which isn't checked for memory leaks. */
+#define T_LEAKY(fn) { fn, #fn, 0 }
+/* define a test function which is expected to fail memory leak checks */
+#define T_XLEAKY(fn) { fn, #fn, T_EXPECT_LEAKS }
+
+/* current test number */
+extern int test_num;
+
+/* name of test suite */
+extern const char *test_suite;
+
+/* Provide result context message. */
+void t_context(const char *ctx, ...)
+#ifdef __GNUC__
+ __attribute__ ((format (printf, 1, 2)))
+#endif /* __GNUC__ */
+ ;
+
+extern char test_context[];
+
+/* the command-line arguments passed in to the test suite: */
+extern char **test_argv;
+extern int test_argc;
+
+/* child process should call this. */
+void in_child(void);
+
+/* issue a warning. */
+void t_warning(const char *str, ...)
+#ifdef __GNUC__
+ __attribute__ ((format (printf, 1, 2)))
+#endif /* __GNUC__ */
+;
+
+/* Macros for easily writing is-not-zero comparison tests; the ON*
+ * macros fail the function if a comparison is not zero.
+ *
+ * ONV(x,vs) takes a comparison X, and a printf varargs list for
+ * the failure message.
+ * e.g. ONV(strcmp(bar, "foo"), ("bar was %s not 'foo'", bar))
+ *
+ * ON(x) takes a comparison X, and uses the line number for the failure
+ * message. e.g. ONV(strcmp(bar, "foo"))
+ *
+ * ONN(n, x) takes a comparison X, and a flat string failure message.
+ * e.g. ONN("foo was wrong", strcmp(bar, "foo")) */
+
+#define ONV(x,vs) do { if ((x)) { t_context vs; return FAIL; } } while (0)
+#define ON(x) ONV((x), ("line %d", __LINE__ ))
+#define ONN(n,x) ONV((x), (n))
+
+/* ONCMP(exp, act, name): 'exp' is the expected string, 'act' is the
+ * actual string for some field 'name'. Succeeds if strcmp(exp,act)
+ * == 0 or both are NULL. */
+#define ONCMP(exp, act, ctx, name) do { \
+ ONV(exp && !act, ("%s: " name " was NULL, expected '%s'", ctx, exp)); \
+ ONV(!exp && act, ("%s: " name " was '%s', expected NULL", ctx, act)); \
+ ONV(exp && strcmp(exp, act), ("%s: " name " was '%s' not '%s'", ctx, act, exp)); \
+} while (0)
+
+/* return immediately with result of test 'x' if it fails. */
+#define CALL(x) do { int t_ret = (x); if (t_ret != OK) return t_ret; } while (0)
+
+/* PRECOND: skip current test if condition 'x' is not true. */
+#define PRECOND(x) do { if (!(x)) { return SKIP; } } while (0)
+
+#endif /* TESTS_H */